Lecture 27 · Week 7· 18:54

The four fundamental subspaces

How the four fit together, rank–nullity for matrices.

Play: Lecture 27: The four fundamental subspaces
Lecture · 18:54 · Open on YouTube · Report a problem with this video
TranscriptThe full text of the lecture. Click any sentence to play the video from there.

Today: four subspaces of one matrix

Welcome back. Last time, in lecture twenty six, we met the row space of a matrix, and its rank, the common dimension of the column space and the row space. Today we put together everything we know about the subspaces that come from one matrix. Let A be an m by n matrix over a field F. So far, A has given us three subspaces. The column space, inside F m. The null space, inside F n. And the row space, also inside F n. There is a natural fourth one. The row space of A is the span of its rows, and the rows of A are the columns of A transpose. So the row space of A is the column space of A transpose. That suggests taking the null space of A transpose as well. It lives in F m.

Here is the plan. We name the four subspaces and see where each one lives. We find all four dimensions, from the rank nullity theorem. We find a basis of each one from a single elimination. We see what the fourth subspace says about solving A x equals b. And over the real numbers, we see how the four fit together at right angles.

The four fundamental subspaces

Here is the definition. Let A be an m by n matrix over a field F. The null space of A transpose is called the left null space of A. The four fundamental subspaces of A are the column space and the left null space, which are subspaces of F m, and the row space and the null space, which are subspaces of F n. Why the name left null space? A vector y is in it when A transpose y is zero. Take the transpose of both sides. The transpose of A transpose y is y transpose times A, and the transpose of the zero vector is the zero row. So y transpose A is the zero row: y multiplies A from the left, and gives zero. Where do the four live? A x makes sense for x in F n, because A has n columns. So the null space lives in F n, and so does the row space, because each row has n entries.

Each column has m entries, so the column space lives in F m. And A transpose y makes sense for y in F m, so the left null space lives in F m too. For example, take the matrix from lecture twenty. Its first row is (one, two, minus one, minus one), its second row is (two, four, minus one, zero), and its third row is (minus one, minus two, two, three). It is three by four. So its row space and its null space live in four dimensional space, and its column space and its left null space live in three dimensional space.

The rank-nullity theorem

How big are the four subspaces? Start with A itself. Here is the rank nullity theorem for matrices. Let A be an m by n matrix over a field F. Then the rank of A, plus the dimension of the null space of A, equals n, the number of columns. Proof. Row reduce A to an echelon form, and let r be the number of pivots. By lecture twenty, the pivot columns of A form a basis of the column space. So the rank of A, which is the dimension of the column space, equals r. Also by lecture twenty, the null space has a basis with one vector for each free variable. So the dimension of the null space is the number of free variables.

Each of the n columns belongs either to a pivot variable or to a free variable, and never to both. So the number of pivots, plus the number of free variables, is n. That is the theorem. Read it as a count of the n unknowns of A x equals zero. Each unknown is either pinned down by a pivot, or free. The rank counts the pinned ones, and the null space has one direction for each free one. In our example, the pivots are in columns one and three, so the rank is two. The free variables are x two and x four, so the null space has dimension two. And two plus two is four, the number of columns.

The dimensions of all four

Now apply the theorem to A transpose. It is an n by m matrix, so it has m columns. So the rank of A transpose, plus the dimension of its null space, is m. By lecture twenty six, row rank equals column rank: A transpose has the same rank as A, namely r. So the left null space has dimension m minus r. Here are all four dimensions together. Let A be an m by n matrix over a field F, of rank r. The row space and the column space both have dimension r. The null space has dimension n minus r. And the left null space has dimension m minus r.

Picture each dimension as a bar. In F n, the row space takes r cells and the null space the remaining n minus r cells. In F m, the column space takes r cells and the left null space the remaining m minus r cells. So in each space, the two dimensions add up to the dimension of the whole space. In our three by four example, r is two. The row space and the column space have dimension two. The null space has dimension four minus two, which is two. And the left null space has dimension three minus two, which is one: it is a line in three dimensional space. The count gives quick conclusions. Each pivot sits in its own row and its own column, so r is at most m and at most n. So if A has more columns than rows, the null space has dimension n minus r, at least n minus m, which is more than zero. And if A has more rows than columns, the left null space is more than just zero.

Bases from one elimination

Next, a basis of each of the four. One elimination gives all of them. Put the identity matrix beside A, and row reduce the whole block, until the left part is an echelon form. For our matrix: first, replace row two by row two, minus two times row one. Then replace row three by row three, plus row one. Finally, replace row three by row three, minus row two. The left part is now an echelon form U, with pivots in columns one and three. Call the right part E.

Why does this help? Each row operation is multiplication on the left by an elementary matrix, and it acts on both parts at once. So E is the product of these elementary matrices, and the left part is E times A. So U equals E A, and E is invertible, as a product of elementary matrices. Now read off the bases. The pivot columns of A, columns one and three, form a basis of the column space. And by lecture twenty six, the nonzero rows of U form a basis of the row space. For the null space, solve U x equals zero, with x two and x four free. Row two gives x three equals minus two x four. Row one gives x one equals minus two x two, plus x three, plus x four, which is minus two x two, minus x four. Setting one free variable to one and the other to zero gives the basis (minus two, one, zero, zero), and (minus one, zero, minus two, one).

The new one is the left null space. Look at the last row of E: (three, minus one, one). Since E A equals U, this row times A is the last row of U, which is zero. So the vector y with these entries lies in the left null space. Let's check it, one column at a time. In the first column, three, minus two, minus one, gives zero. In the second, six, minus four, minus two, gives zero. In the third, minus three, plus one, plus two, gives zero. And in the fourth, minus three, plus zero, plus three, gives zero. So y records how the rows of A depend on each other: three times row one, minus row two, plus row three, is the zero row.

And y is a basis. The left null space has dimension three minus two, which is one, and y is a nonzero vector in it. One nonzero vector is an independent list, so by lecture twenty, it is a basis. This works for every matrix. Here is the theorem. Let A be an m by n matrix over a field F, and let E be an invertible matrix such that E A is an echelon form U with r nonzero rows. Then the last m minus r rows of E form a basis of the left null space of A. Proof. It takes a few steps, so take it slowly, and pause if you need to. Those rows of E, times A, give the last m minus r rows of U, which are zero. So they lie in the left null space. E is invertible, so by the invertible matrix theorem, E transpose is invertible, and its columns, the rows of E, are independent. Part of an independent list is independent. The same theorem says that E is a product of elementary matrices. So U is an echelon form of A, with the pivots of A, and r is the rank of A. Finally, there are m minus r of these rows, which is the dimension of the left null space. So by lecture twenty, they form a basis.

Solvable systems

The left null space answers a question we have asked since week two. For which right hand sides b does A x equals b have a solution? We know one answer: exactly when b lies in the column space. The left null space turns this into a test. Here is the theorem. Let A be an m by n matrix over a field F, and let b be a vector in F m. Then A x equals b has a solution if and only if y dot b equals zero for every y in the left null space of A. The proof is demanding, so take it slowly, and pause or rewatch it if you need to. First, suppose that A x equals b, and take y in the left null space. Then y dot b is y transpose times A x. Group it as y transpose A, times x. Since y transpose A is the zero row, this is zero.

Conversely, suppose that y dot b is zero for every y in the left null space. Take E and U from the elimination, so that E A equals U. Since E is invertible, A x equals b exactly when U x equals E b. By lecture ten, the system U x equals E b has a solution exactly when no zero row of U meets a nonzero entry of E b. The zero rows are the last m minus r. The matching entries of E b are the last m minus r rows of E, dotted with b. Those rows lie in the left null space, so by our assumption, each of these entries is zero. So the system has a solution. In our example, the left null space consists of the multiples t y of the vector y equal to (three, minus one, one). Since t y dot b is t times y dot b, the whole test is one equation: three b one, minus b two, plus b three, equals zero.

For b equal to (zero, one, one): zero, minus one, plus one, is zero, so there is a solution. Indeed, b is column one plus column three. For b equal to (one, one, one): three, minus one, plus one, is three, not zero. So there is no solution. Over the real numbers, y dot b equal to zero says that b is orthogonal to y. So A x equals b has a solution exactly when b is orthogonal to every vector of the left null space. In our example, the column space is the plane through the origin that is orthogonal to (three, minus one, one).

How the four fit together

Now let the field be the real numbers. Then the row space and the null space meet at right angles. Take x in the null space. By the row rule, each entry of A x is a row of A, dotted with x. All these entries are zero, so every row of A is orthogonal to x. A vector of the row space is a combination of the rows, c one r one, up to c m r m. Its dot product with x is c one times r one dot x, up to c m times r m dot x, and every term is zero. So every vector of the row space is orthogonal to every vector of the null space. So the two spaces share only the zero vector. A vector v in both is orthogonal to itself: v dot v is zero. Over the real numbers, v dot v is the sum of the squares of its entries, so every entry is zero, and v is the zero vector.

Here is the theorem. Let A be a real m by n matrix. Then R n is the direct sum of the row space and the null space of A, and R m is the direct sum of the column space and the left null space. In each pair, every vector of one space is orthogonal to every vector of the other. Proof. The row space and the null space meet only in zero, so their sum is direct. By lecture twenty four, its dimension is the sum of their dimensions, which by theorem five point three point four is r, plus n minus r, which is n. By lecture twenty, a subspace of R n of dimension n is all of R n. For the second pair, apply the same argument to A transpose: its row space is the column space of A, and its null space is the left null space. In other words, each space in the pair is a complement of the other, at right angles to it. In lecture forty six we meet this idea in general, as the orthogonal complement.

Here is a consequence. Let A be a real m by n matrix. Since R n is the direct sum of the row space and the null space, every x splits in exactly one way as x row plus x null, with x row in the row space and x null in the null space. And A x is A x row, plus A x null, which is A x row. So A sends the row space onto the column space: every b in the column space is A x for some x, so it is A x row. And A is one to one on the row space. If A x row equals A x row prime, their difference is sent to zero. It lies in the row space and in the null space, so it is zero. Let's see it in the plane. Take A with first row (one, two), and second row (three, six). The second row is three times the first, so the rank is one. The row space is spanned by the rows. Both rows are multiples of the vector (one, two), so the row space is the line through (one, two).

The null space is the set of solutions of A x equals zero. Both rows give the same equation: x one, plus two x two, equals zero. Its solutions are the multiples of the vector (minus two, one). So the null space is the line through (minus two, one), at a right angle to the row space. On the output side, the column space is spanned by the columns. The second column is two times the first, so the column space is the line through (one, three). The left null space is the null space of A transpose, whose rows are the columns of A. Again both give one equation: y one, plus three y two, equals zero. Its solutions are the multiples of the vector (minus three, one). So the left null space is the line through (minus three, one), again at a right angle to the column space.

Every x in the plane splits, in exactly one way, into a part in the row space and a part in the null space. Take the vector (minus one, three). We look for a multiple of (one, two), plus a multiple of (minus two, one), that gives it. Matching the two entries gives two equations for the two multiples, and both multiples come out as one. So the vector (minus one, three), splits into the vector (one, two), in the row space, plus the vector (minus two, one), in the null space. Now apply A. The null space part is sent to zero, so A x is A times the row space part. Each entry is a row of A, dotted with (one, two): one plus four is five, and three plus twelve is fifteen. So A x is the vector (five, fifteen), which is five times the vector (one, three). It lies on the column space, as it must.

You can try this yourself, on this lecture's page at opensemester.com. It starts with the same matrix A, and the same vector x, split into its row space part and its null space part. Now slide x along the null space. The violet part changes, but the row space part stays the same, so A x does not move. Drag x anywhere else, and A x moves with it, but it always stays on the column space.

You can also pick other matrices, and watch the four subspaces change. One warning. All of this needs the real numbers. Over the field Z two, take A with the single row (one, one). Its row space is spanned by (one, one). But one plus one is zero in Z two, so the vector (one, one), is also in the null space. By theorem five point three point four, with r equal to one and n equal to two, both spaces are lines. So here the row space and the null space are the same line.

Summary

Let's summarise. An m by n matrix A has four fundamental subspaces. The column space and the left null space live in F m. The row space and the null space live in F n. The rank nullity theorem says that the rank of A, plus the dimension of its null space, is n. With row rank equal to column rank, the four dimensions are r, r, n minus r, and m minus r. One elimination, of A with the identity beside it, gives a basis of all four. The last m minus r rows of E give a basis of the left null space.

A x equals b has a solution exactly when y dot b is zero for every y in the left null space. Over the real numbers, R n is the direct sum of the row space and the null space, and R m is the direct sum of the column space and the left null space, at right angles. And A matches the row space with the column space, one to one. Before the next lecture, read section five point three of the course book, try the problems on sheet seven about the four fundamental subspaces, and do the lecture check on this lecture's page at Open Semester dot com. Next time, we finish week seven with change of basis: how the coordinates of one vector in two different bases are related. See you there.

In this lecture

  1. 0:00Today: four subspaces of one matrix
  2. 1:09The four fundamental subspaces
  3. 2:40The rank–nullity theorem
  4. 4:01The dimensions of all four
  5. 5:36Bases from one elimination
  6. 9:11Solvable systems
  7. 11:47How the four fit together
  8. 16:20Try it yourself
  9. 16:51The field matters
  10. 17:19Summary

Materials

Try it

Where the four subspaces live

A =

Drag the gold point x, change the entries of A with the sliders, or pick a matrix. x splits into a part on Row A and a part on Nul A, at right angles. A sends the Nul A part to 0, so sliding x along the violet line leaves Ax where it is, on the blue line Col A. The tour does exactly that.

Check yourself

3 questions, from warm-up to stretch

Work each one out on paper, type your answer and press Check. Stuck? Open a hint; the worked solution is there when you need it.

  1. Question 1 of 3 Warm-up

    is a real matrix with . Column space and left null space live in : find . Then find the dimensions of , , and .

    Hint 1 of 2

    has rows and columns. A column of has one entry per row, and makes sense for with one entry per row of (Section 5.3, after Definition 5.3.1).

    Hint 2 of 2

    Theorem 5.3.4: the four dimensions are , , and , with .

    Worked solution
    1. Here , and . and are subspaces of (); and are subspaces of .
    2. .
    3. Rank–nullity (Theorem 5.3.3): .
    4. Rank–nullity for , which is with the same rank: .
    5. Check: and .
  2. Question 2 of 3 Core

    Let . Its rank is , and consists of the multiples of . Find . For , find the value of for which has a solution. Does have a solution?

    has a solution:
    Hint 1 of 2

    Row reduce (Example 5.3.6). The last row of , beside the zero row of , is a basis of (Theorem 5.3.7). Or look for a combination of the rows of that is the zero row.

    Hint 2 of 2

    Row three is row one plus row two. Then use the solvability test (Theorem 5.3.8): has a solution exactly when .

    Worked solution
    1. Row reduce : gives ; then gives .
    2. So has two nonzero rows () and one zero row, and the last row of is . By Theorem 5.3.7, consists of its multiples, among them : . Check: .
    3. By Theorem 5.3.8, and since , has a solution exactly when .
    4. For : , so . Indeed gives .
    5. For : , so there is no solution.
  3. Question 3 of 3 Stretch

    Let , a real matrix. Then is the line through and the line through . Split as with and : find and . Then : find . Finally, over , do and of meet only in ?

    Over they meet only in :
    Hint 1 of 2

    . Compare it with entry by entry. For , Proposition 5.3.11 says .

    Hint 2 of 2

    Over , : compute times (Remark 5.3.13).

    Worked solution
    1. . Adding the two equations, , so , and then : .
    2. Check: , so the two parts are at right angles, and .
    3. , and directly . So , and lies in , the line through .
    4. Over : , and puts in the null space too. Both are lines (Theorem 5.3.4 with , ), so they are the same line: they do not meet only in .

Found a mistake, or something not working on this page? Report it and we'll fix it. See what we've corrected.