Session 10 · Unit 1

The Four Fundamental Subspaces


Every m by n matrix comes with four subspaces — the column space and null space we know, plus the row space and the left null space. Strang locates each one, gives its dimension in terms of the rank r, and shows how one row reduction produces a basis for all four. The lecture opens by correcting an error from lecture nine and closes by promoting matrices themselves to vectors.

An error corrected: the rows know about the columns

Strang opens by fixing “the blackboard with that awful error” from lecture nine. He had wanted three vectors that form a basis for R3\mathbb{R}^3, started with (1,1,2)(1,1,2) and (2,2,5)(2,2,5) — independent — and knew that (3,3,7)(3,3,7), their sum, wouldn’t do. So “in my innocence” he wrote (3,3,8)(3,3,8), figuring that if (3,3,7)(3,3,7) lies in the plane of the first two, then (3,3,8)(3,3,8) probably sticks a little bit out of it.

After class a student told him: that third vector is not independent. And she didn’t hunt for the combination that produces it. She looked at the matrix with those three columns,

A=[123123258],A = \begin{bmatrix} 1 & 2 & 3 \\ 1 & 2 & 3 \\ 2 & 5 & 8 \end{bmatrix},

and saw two identical rows. A square matrix with two equal rows is not invertible — its rows are obviously dependent, and that forces its columns to be dependent too. The row space of this matrix is only two-dimensional, so the rank is two, so only two columns can be independent.

The four subspaces

Here they are — “really the heart of this approach to linear algebra.” For an m×nm \times n matrix AA:

  1. The column space C(A)C(A) — all combinations of the columns.
  2. The null space N(A)N(A) — all solutions of Ax=0A\mathbf{x} = \mathbf{0}.
  3. The row space — all combinations of the rows.
  4. The null space of ATA^T, written N(AT)N(A^T) — the fourth guy.

Where do the four spaces live? Vectors in N(A)N(A) have nn components (they’re solutions x\mathbf{x}), so N(A)N(A) is in Rn\mathbb{R}^n — and so is the row space, since rows of AA have nn components. Columns have mm components, so C(A)C(A) is in Rm\mathbb{R}^m — and so is N(AT)N(A^T). Two subspaces sit in Rn\mathbb{R}^n, two in Rm\mathbb{R}^m. Strang draws his famous picture: row space and null space on the Rn\mathbb{R}^n side, column space and left null space on the Rm\mathbb{R}^m side. (He notices the fourth space “is already getting second-class citizen treatment and it doesn’t deserve it.”)

To understand these spaces means answering two questions for each: how do you construct a basis, and what is the dimension? The dimension is just a number, so it has a real short answer — and Strang can’t resist giving all four short answers first.

The dimensions: r, r, n − r, m − r

Where do these come from?

Column space: a basis is the pivot columns — the pivot columns of the original AA, not of RR. There are rr of them; the rank counts them.

Null space: a basis is the special solutions, one for each free variable — set that free variable to 11, the other free variables to 00, and solve for the pivot variables. There are nrn - r free variables, so dimN(A)=nr\dim N(A) = n - r. And that’s just restating the count of variables: nn variables, rr pivot variables, nrn - r free ones — r+(nr)=nr + (n-r) = n.

Left null space: “it’s got to be mrm - r.” Why? Because ”ATA^T is just as good a matrix as AA.” It happens to be n×mn \times m, so it has mm columns, hence mm variables in ATy=0A^T\mathbf{y} = \mathbf{0}; its rank is also rr, leaving mrm - r free variables. Same rule, applied to the transpose.

That leaves the row space’s dimension rr — and its basis — to be earned, which is the next job.

A basis for the row space

You could find the row space basis by transposing AA, row-reducing ATA^T, and taking its pivot columns — but that means doing all that elimination over again. The work already done on AA ought to reveal it. Take the matrix from last lecture:

Now, a warning first. The column space changed: (1,1,1)(1,1,1) is certainly in C(A)C(A) and certainly not in C(R)C(R). Row operations do not preserve the column space. But they do preserve the row space — every operation replaced a row by a combination of rows, so at every step you stay inside the row space of AA. And the steps reverse: undoing the subtractions writes the original rows as combinations of the rows of RR. Same row space, both directions.

So a basis for the row space of AA is sitting in RR: the first rr rows of RR. Here, (1,0,1,1)(1,0,1,1) and (0,1,1,0)(0,1,1,0). Not the first rr rows of AA — sometimes that works, but not necessarily. They’re in the row space, there are rr of them, and they’re visibly independent (look at the identity sitting in the pivot columns). In fact this is the best basis: “if the columns of the identity matrix are the best basis for Rn\mathbb{R}^n, the rows of this matrix are the best basis for the row space” — as clean as it can be made.

The left null space, and the matrix E

For this same 3×43 \times 4 example, r=2r = 2 and m=3m = 3, so the left null space should be mr=1m - r = 1-dimensional: there is one combination of the three rows of AA that produces the zero row. (For the null space you combine columns to get the zero column; for the left null space you combine rows to get the zero row.) But the special-solutions trick reads off N(A)N(A), not N(AT)N(A^T) — the left null space “is not jumping out at me here.” The trick is to keep a record of the elimination steps.

Remember Gauss–Jordan, where you tack the identity onto a square invertible matrix? Do the same for rectangular AA: row-reduce the long matrix [AI]\begin{bmatrix} A & I \end{bmatrix}, with II the m×mm \times m identity, all the way to

[Am×nIm×m]    [Rm×nEm×m].\begin{bmatrix} A_{m\times n} & I_{m \times m} \end{bmatrix} \;\longrightarrow\; \begin{bmatrix} R_{m\times n} & E_{m \times m} \end{bmatrix}.

All the row reduction amounts to multiplying on the left by one matrix — some product of elementary matrices. That something took II to EE, so that something was EE, and therefore

EA=R.EA = R.

In chapter two, when AA was square and invertible, RR was II, and EA=IEA = I meant E=A1E = A^{-1}. For a rectangular AA there’s no inverse, but there is still an EE.

Review of all four: the row space and null space are in Rn\mathbb{R}^n, dimensions adding to nn; the column space and left null space are in Rm\mathbb{R}^m, dimensions adding to mm.

A new vector space: matrices as “vectors”

In the last minutes, Strang pushes to a new type of vector space. Every space so far has been a subspace of some Rn\mathbb{R}^n. Now take MM = all 3×33 \times 3 matrices, and call the matrices themselves the “vectors.” Is that allowed? Yes — because they obey the rules. You can add two matrices; you can multiply a matrix by a scalar like 77; you can take combinations like three of one matrix minus five of another; there’s a zero matrix that changes nothing when added. All eight vector-space rules are easily satisfied. The fact that you can also multiply two matrices is irrelevant — “I’m not interested in ABAB for now.”

Subspaces of MM: all upper triangular matrices; all symmetric matrices. The intersection of two subspaces is a subspace, and here the intersection — symmetric and upper triangular — is the diagonal matrices DD, smaller than both. “Smaller” can now be made precise by dimension. For DD, Strang produces a basis of three matrices:

[100000000],[100030000],[000000007]\begin{bmatrix} 1 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix}, \quad \begin{bmatrix} 1 & 0 & 0 \\ 0 & 3 & 0 \\ 0 & 0 & 0 \end{bmatrix}, \quad \begin{bmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 7 \end{bmatrix}

— three independent diagonal matrices whose combinations give every diagonal matrix. So dimD=3\dim D = 3. The idea of basis and dimension stretches from Rn\mathbb{R}^n to matrix space without changing at all.

Problems

Work these before revealing the solutions — each one uses only the four-subspace machinery from the lecture.

Problem 10.1 All four subspaces

Find the dimension of, and a basis for, each of the four fundamental subspaces of

A=[124248].A = \begin{bmatrix} 1 & 2 & 4 \\ 2 & 4 & 8 \end{bmatrix}.
Show solution

Row reduce: subtract 22 of row 1 from row 2 to get R=[124000]R = \begin{bmatrix} 1 & 2 & 4 \\ 0 & 0 & 0 \end{bmatrix}. One pivot, so r=1r = 1, with m=2m = 2, n=3n = 3.

Column space (dim=r=1\dim = r = 1): the pivot column of AA, basis [12]\begin{bmatrix} 1 \\ 2 \end{bmatrix}.

Row space (dim=r=1\dim = r = 1): the first rr rows of RR, basis (1,2,4)(1, 2, 4).

Null space (dim=nr=2\dim = n - r = 2): free variables x2,x3x_2, x_3. Special solutions: x2=1,x3=0x_2 = 1, x_3 = 0 gives (2,1,0)(-2, 1, 0); x2=0,x3=1x_2 = 0, x_3 = 1 gives (4,0,1)(-4, 0, 1). Those two are a basis.

Left null space (dim=mr=1\dim = m - r = 1): the combination of rows giving the zero row is 2-2 of row 1 plus row 2, so a basis is y=(2,1)\mathbf{y} = (-2, 1). Check: yTA=0T\mathbf{y}^T A = \mathbf{0}^T. ✓

Problem 10.2 Rows expose the columns

Without finding any explicit combination, show that the three vectors

[113],[227],[4413]\begin{bmatrix} 1 \\ 1 \\ 3 \end{bmatrix}, \quad \begin{bmatrix} 2 \\ 2 \\ 7 \end{bmatrix}, \quad \begin{bmatrix} 4 \\ 4 \\ 13 \end{bmatrix}

are dependent — use the student’s argument from the start of the lecture.

Show solution

Put the vectors as the columns of a matrix:

A=[1241243713].A = \begin{bmatrix} 1 & 2 & 4 \\ 1 & 2 & 4 \\ 3 & 7 & 13 \end{bmatrix}.

Rows 1 and 2 are identical, so the rows are dependent and the row space has dimension at most 22. The row space and column space have the same dimension rr, so r2r \le 2 while there are 33 columns. Three columns in a space of dimension at most two must be dependent — no combination needed.

Problem 10.3 Row space vs column space of R

Row reduce

A=[1352610147]A = \begin{bmatrix} 1 & 3 & 5 \\ 2 & 6 & 10 \\ 1 & 4 & 7 \end{bmatrix}

to RR. Give a basis for the row space of AA from RR, and then exhibit one vector that is in the column space of AA but not in the column space of RR.

Show solution

Subtract 22 of row 1 from row 2, and row 1 from row 3:

[135000012]    [135012000]    R=[101012000]\begin{bmatrix} 1 & 3 & 5 \\ 0 & 0 & 0 \\ 0 & 1 & 2 \end{bmatrix} \;\longrightarrow\; \begin{bmatrix} 1 & 3 & 5 \\ 0 & 1 & 2 \\ 0 & 0 & 0 \end{bmatrix} \;\longrightarrow\; R = \begin{bmatrix} 1 & 0 & -1 \\ 0 & 1 & 2 \\ 0 & 0 & 0 \end{bmatrix}

(exchange rows 2 and 3, then subtract 33 of the new row 2 from row 1). Rank r=2r = 2.

Row space basis — the first two rows of RR: (1,0,1)(1, 0, -1) and (0,1,2)(0, 1, 2). Row operations preserved the row space, so these span the row space of AA too.

Column spaces differ: every column of RR has third component 00, so C(R)C(R) lies in the plane z=0z = 0. But column 1 of AA, namely (1,2,1)(1, 2, 1), has third component 11 — it is in C(A)C(A) and cannot be in C(R)C(R).

Problem 10.4 Finding E and the left null space

For

A=[101112213],A = \begin{bmatrix} 1 & 0 & 1 \\ 1 & 1 & 2 \\ 2 & 1 & 3 \end{bmatrix},

row reduce [AI]\begin{bmatrix} A & I \end{bmatrix} to [RE]\begin{bmatrix} R & E \end{bmatrix}, verify EA=REA = R, and read off a basis for N(AT)N(A^T).

Show solution

Start with [AI]\begin{bmatrix} A & I \end{bmatrix} and eliminate. Subtract row 1 from row 2, and 22 of row 1 from row 3:

[101100011110011201]\begin{bmatrix} 1 & 0 & 1 & \big| & 1 & 0 & 0 \\ 0 & 1 & 1 & \big| & -1 & 1 & 0 \\ 0 & 1 & 1 & \big| & -2 & 0 & 1 \end{bmatrix}

Subtract row 2 from row 3:

[101100011110000111]=[RE],E=[100110111].\begin{bmatrix} 1 & 0 & 1 & \big| & 1 & 0 & 0 \\ 0 & 1 & 1 & \big| & -1 & 1 & 0 \\ 0 & 0 & 0 & \big| & -1 & -1 & 1 \end{bmatrix} = \begin{bmatrix} R & E \end{bmatrix}, \qquad E = \begin{bmatrix} 1 & 0 & 0 \\ -1 & 1 & 0 \\ -1 & -1 & 1 \end{bmatrix}.

RR is already reduced (row 1 has a 00 above the second pivot). Check EAEA: row 2 of EAEA is row 1+row 2=(0,1,1)-\text{row 1} + \text{row 2} = (0,1,1) ✓; row 3 is row 1row 2+row 3=(0,0,0)-\text{row 1} - \text{row 2} + \text{row 3} = (0,0,0) ✓. So EA=REA = R.

Rank r=2r = 2, so dimN(AT)=mr=1\dim N(A^T) = m - r = 1. The zero row of RR came from the last row of EE, so a basis for the left null space is y=(1,1,1)\mathbf{y} = (-1, -1, 1): indeed row 3 of AA equals row 1 plus row 2.

Problem 10.5 Dimensions in matrix space

In the vector space MM of all 3×33 \times 3 matrices, find the dimension of the subspace UU of upper triangular matrices and of the subspace SS of symmetric matrices, by producing a basis for each. Check that USU \cap S has the dimension found in lecture.

Show solution

Upper triangular: a 3×33 \times 3 upper triangular matrix has 66 free entries — three on the diagonal, three above. A basis is the six matrices with a single 11 in one of those positions and zeros elsewhere. Any upper triangular matrix is a unique combination of them, so dimU=6\dim U = 6.

Symmetric: a symmetric matrix is determined by its diagonal (33 entries) and the entries above the diagonal (33 entries) — the below-diagonal entries are copies. A basis: three matrices with a single 11 on the diagonal, plus three matrices with a 11 in position (i,j)(i,j) and in position (j,i)(j,i) for each pair iji \ne j. So dimS=6\dim S = 6.

Intersection: a matrix in USU \cap S is symmetric with zeros below the diagonal, hence zeros above too — it is diagonal. The three single-entry diagonal matrices are a basis, so dim(US)=3\dim(U \cap S) = 3, matching the lecture’s answer for the diagonal matrices DD.