Math Core

Lesson 4.5 · Vector Spaces

Rank

A matrix has columns and rows, and each set spans its own subspace. Remarkably, those two subspaces always have the same dimension, and that single number, the rank, controls how many solutions Ax=bA\mathbf{x} = \mathbf{b} can have. The Rank Theorem ties it all together in one equation.

The row space

Think of each row of an m×nm \times n matrix AA as a vector in Rn\mathbb{R}^n.

Definition

Row space

The row space of AA, written Row⁡A\operatorname{Row} A, is the set of all linear combinations of the rows of AA. It is a subspace of Rn\mathbb{R}^n. Since the rows of AA are the columns of ATA^T, Row⁡A=Col⁡AT\operatorname{Row} A = \operatorname{Col} A^T.

Row operations interact with the row space very differently than with the column space. Each row operation replaces rows by combinations of rows, so the new rows lie in the old row space. Each operation is also reversible, so the old rows lie in the new row space. Therefore:

Row space and row reduction

If AA and BB are row equivalent, then Row⁡A=Row⁡B\operatorname{Row} A = \operatorname{Row} B. If BB is in echelon form, the nonzero rows of BB form a basis for Row⁡A\operatorname{Row} A (and for Row⁡B\operatorname{Row} B).

The nonzero rows of an echelon form are independent because each has a leading entry in a column where all the rows below it have zeros.

Worked example: Bases for all three subspaces

Find bases for Row⁡A\operatorname{Row} A, Col⁡A\operatorname{Col} A and Nul⁡A\operatorname{Nul} A, where

A=[12−13240236−15].A = \begin{bmatrix} 1 & 2 & -1 & 3 \\ 2 & 4 & 0 & 2 \\ 3 & 6 & -1 & 5 \end{bmatrix}.

R2−2R1R_2 - 2R_1 gives (0,0,2,−4)(0, 0, 2, -4) and R3−3R1R_3 - 3R_1 gives (0,0,2,−4)(0, 0, 2, -4), then R3−R2R_3 - R_2 gives a zero row:

A∼B=[12−13002−40000].A \sim B = \begin{bmatrix} 1 & 2 & -1 & 3 \\ 0 & 0 & 2 & -4 \\ 0 & 0 & 0 & 0 \end{bmatrix}.

Row space: the nonzero rows of BB, namely (1,2,−1,3)(1, 2, -1, 3) and (0,0,2,−4)(0, 0, 2, -4).

Column space: pivots are in columns 11 and 33, so use columns 11 and 33 of AA: (1,2,3)(1, 2, 3) and (−1,0,−1)(-1, 0, -1).

Null space: scale row 22 of BB by 12\tfrac{1}{2} and add it to row 11 to get the reduced form with rows (1,2,0,1)(1, 2, 0, 1) and (0,0,1,−2)(0, 0, 1, -2). So x1=−2x2−x4x_1 = -2x_2 - x_4 and x3=2x4x_3 = 2x_4, giving the basis (−2,1,0,0)(-2, 1, 0, 0) and (−1,0,2,1)(-1, 0, 2, 1).

All three bases have size 22, 22 and 22, and 2+2=42 + 2 = 4, the number of columns.

Common mistake

For the row space you use the rows of the echelon form; for the column space you use the columns of the original matrix. Mixing these up is the most common error here. (The rows of AA itself also span Row⁡A\operatorname{Row} A, but they may be dependent, as the third row of AA above is the sum of the first two.)

Rank and the Rank Theorem

Definition

Rank

The rank of AA is the dimension of its column space: rank⁡A=dim⁡Col⁡A\operatorname{rank} A = \dim \operatorname{Col} A.

Both dim⁡Col⁡A\dim \operatorname{Col} A and dim⁡Row⁡A\dim \operatorname{Row} A equal the number of pivots in an echelon form of AA: the pivot columns give a basis for Col⁡A\operatorname{Col} A, and each nonzero row of the echelon form contains exactly one pivot. Meanwhile, each non-pivot column gives one free variable.

The Rank Theorem

For an m×nm \times n matrix AA,

dim⁡Col⁡A=dim⁡Row⁡A=rank⁡Aandrank⁡A+dim⁡Nul⁡A=n.\dim \operatorname{Col} A = \dim \operatorname{Row} A = \operatorname{rank} A \qquad\text{and}\qquad \operatorname{rank} A + \dim \operatorname{Nul} A = n.

In words: (pivot columns) + (free columns) = (total columns). The quantity dim⁡Nul⁡A\dim \operatorname{Nul} A is often called the nullity of AA.

Two consequences come up constantly:

  • rank⁡A≤min⁡(m,n)\operatorname{rank} A \le \min(m, n), since pivots need distinct rows and distinct columns.
  • rank⁡AT=rank⁡A\operatorname{rank} A^T = \operatorname{rank} A, because Col⁡AT=Row⁡A\operatorname{Col} A^T = \operatorname{Row} A.

Using the Rank Theorem

The theorem lets you answer questions about solutions without doing any row reduction.

Worked example: Information from dimensions alone

(a) A 7×97 \times 9 matrix AA has a 2-dimensional null space. Is Ax=bA\mathbf{x} = \mathbf{b} consistent for every b\mathbf{b} in R7\mathbb{R}^7?

rank⁡A=9−2=7\operatorname{rank} A = 9 - 2 = 7. So Col⁡A\operatorname{Col} A is a 7-dimensional subspace of R7\mathbb{R}^7, which must be all of R7\mathbb{R}^7. Yes, every equation Ax=bA\mathbf{x} = \mathbf{b} is consistent.

(b) Can a 6×96 \times 9 matrix have a 2-dimensional null space?

That would force rank⁡A=9−2=7\operatorname{rank} A = 9 - 2 = 7. But the rank is at most 66, the number of rows. So no: the null space of a 6×96 \times 9 matrix has dimension at least 33.

Worked example: Choosing a parameter to control the rank

For what value of hh does A=[1232h6124]A = \begin{bmatrix} 1 & 2 & 3 \\ 2 & h & 6 \\ 1 & 2 & 4 \end{bmatrix} have rank 22?

Expanding along the first row,

det⁡A=1(4h−12)−2(8−6)+3(4−h)=h−4.\det A = 1(4h - 12) - 2(8 - 6) + 3(4 - h) = h - 4.

If h≠4h \ne 4, AA is invertible with rank 33. If h=4h = 4, row 22 is twice row 11, and row 33 is not a multiple of row 11, so exactly two rows are independent and the rank is 22. The answer is h=4h = 4.

Rank and invertibility

For a square n×nn \times n matrix, the Rank Theorem adds new entries to the Invertible Matrix Theorem. Each of the following is equivalent to AA being invertible:

  • The columns of AA form a basis of Rn\mathbb{R}^n.
  • Col⁡A=Rn\operatorname{Col} A = \mathbb{R}^n.
  • rank⁡A=n\operatorname{rank} A = n.
  • Nul⁡A={0}\operatorname{Nul} A = \lbrace \mathbf{0} \rbrace, that is, dim⁡Nul⁡A=0\dim \operatorname{Nul} A = 0.

Tip

To sanity-check any rank calculation, add the rank to the number of free variables. If the total isn't the number of columns, something went wrong.

Practice

Practice 1

AA is a 5×75 \times 7 matrix with rank 33. What is dim⁡Nul⁡A\dim \operatorname{Nul} A?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

Find the rank of A=[120124141213]A = \begin{bmatrix} 1 & 2 & 0 & 1 \\ 2 & 4 & 1 & 4 \\ 1 & 2 & 1 & 3 \end{bmatrix}.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

AA is a 6×46 \times 4 matrix with dim⁡Nul⁡A=1\dim \operatorname{Nul} A = 1. What is dim⁡Row⁡A\dim \operatorname{Row} A?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

AA is a 4×64 \times 6 matrix. What is the smallest possible value of dim⁡Nul⁡A\dim \operatorname{Nul} A?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

Can a 5×85 \times 8 matrix have a null space of dimension 22?

Practice 6

AA is a 9×129 \times 12 matrix, and Ax=bA\mathbf{x} = \mathbf{b} has a solution for every b\mathbf{b} in R9\mathbb{R}^9. What is dim⁡Nul⁡A\dim \operatorname{Nul} A?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

AA is a 4×74 \times 7 matrix with dim⁡Nul⁡A=5\dim \operatorname{Nul} A = 5. What is dim⁡Nul⁡AT\dim \operatorname{Nul} A^T?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 8

For what value of hh does A=[1−123h6011]A = \begin{bmatrix} 1 & -1 & 2 \\ 3 & h & 6 \\ 0 & 1 & 1 \end{bmatrix} have rank 22?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.