Lecture 26 · Week 7· 12:00
Row space and rank
Row rank equals column rank, rank of a matrix.
Saved in this browser only. No account needed.
TranscriptThe full text of the lecture. Click any sentence to play the video from there.
Today: the rows of a matrix
Welcome back. In lectures nineteen and twenty we met two subspaces that come with every matrix A: the column space, spanned by the columns, and the null space, made of the solutions of A x equals zero. We also found a basis of the column space: the pivot columns of A. So the dimension of the column space is the number of pivots. Back in lecture nine we promised that this number would get a name. Today it does. But a matrix has rows as well as columns. Each row is a list of n numbers, and standing it upright makes it a vector in F n. The rows span a subspace too, and we call it the row space.
Here is a puzzle. Take a matrix with three rows and four columns. Its rows are vectors in four dimensional space, and its columns are vectors in three dimensional space. How many of the rows are independent, and how many of the columns? The two questions live in different spaces, and there is no obvious reason for the answers to agree. Yet they always do. That is the main theorem of today. Here is the plan. We define the row space and show that row operations do not change it. Then we read a basis off an echelon form, and prove that row rank equals column rank. That common number is the rank of the matrix.
The row space
Here is the definition. Let A be an m by n matrix over a field F, with rows r one up to r m. Each row, written as a vector, lies in F n. The row space of A, written Row A, is the span of the rows. A span is always a subspace, so the row space is a subspace of F n. Compare the column space, which is a subspace of F m. Turning the rows of A into columns gives the transpose. So the row space of A is the column space of A transpose.
Here is our example, the matrix from lectures ten and twenty. Its rows are r one, which is (one, two, minus one, minus one), r two, which is (two, four, minus one, zero), and r three, which is (minus one, minus two, two, three). The row space is the span of these three vectors in four dimensional space. Are they independent? Let's compute minus three times r one, plus r two. In the first entry, minus three plus two is minus one. In the second, minus six plus four is minus two. In the third, three minus one is two. And in the fourth, three plus zero is three. That is exactly r three.
So r three is a combination of r one and r two, and it adds nothing to the span. The row space is spanned by r one and r two alone. But we found this relation by a lucky guess. We need a method, and the method is elimination.
Row operations keep the row space
Here is the key fact. Let A and B be m by n matrices over F. If B is row equivalent to A, then A and B have the same row space. We prove it for a single row operation first, and the proof has two halves. First half: after one row operation, every new row is a combination of the old rows. A replacement turns row i into r i plus c times r j. A swap only reorders the rows. And a scaling turns row i into c times r i, with c not zero. In every case, each new row lies in the old row space.
The old row space is a subspace, so it contains every combination of the new rows. In other words, the new row space is contained in the old one. Second half: every row operation can be undone by a row operation. Subtract c times r j again, swap the two rows back, or scale by one over c. So the old matrix comes from the new one by a row operation, and by the first half, the old row space is contained in the new one. Both inclusions hold, so the two row spaces are equal.
Finally, a row equivalent matrix is reached by a sequence of row operations, and each step keeps the row space. So B has the same row space as A. Notice the contrast with columns. Row operations keep the relations between the columns, but they usually change the column space itself. With rows it is the other way round: the rows themselves change, but their span stays the same. For example, one replacement turns the matrix whose rows are (one, two), and (two, four), into the matrix whose rows are (one, two), and (zero, zero).
Both row spaces are the line through the point (one, two). But the column space moves. Before, every column is a multiple of (one, two), and after, every column is a multiple of (one, zero).
A basis from an echelon form
Now we can read off a basis. Here is the theorem. Let A be a matrix over F, and let U be an echelon form of A. Then the nonzero rows of U form a basis of the row space of A. So its dimension is the number of pivots. Back to our example. Replace row two by row two minus two times row one, and row three by row three plus row one. Then replace row three by row three minus row two. The echelon form has two nonzero rows: (one, two, minus one, minus one), and (zero, zero, one, two). By the theorem they form a basis of the row space, so the row space of A has dimension two.
As a check, two times u one, plus u two, is (two, four, minus one, zero). That is r two, which lies in the span, as it must. Why is the theorem true? First, the nonzero rows span. U has the same row space as A, by the proposition we just proved, and the zero rows add nothing to a span. Second, the nonzero rows are independent. Call them u one up to u r, and suppose c one u one, plus c two u two, and so on up to c r u r, is zero.
Look at the entry in the pivot column of the first row. Every later row has a zero there, because its own pivot lies further to the right. So in this entry, the sum is just c one times the first pivot. A pivot is not zero, so c one is zero. Now look at the pivot column of the second row. The rows below it have zeros there, and c one is already zero, so the entry is c two times the second pivot, and c two is zero. Going down the rows in this way, every weight is zero, down to c r. So the nonzero rows are independent, and they form a basis of the row space.
One warning. The basis comes from the rows of U, not from the rows of A in the same positions. Take the matrix whose row one is (one, two), row two is (two, four), and row three is (zero, one). Replacing row two by row two minus two times row one gives a zero row, and a swap moves it to the bottom. The nonzero rows of U are (one, two), and (zero, one), and they form a basis. But the first two rows of A are (one, two), and (two, four), and they are dependent. For the column space it is the reverse: the basis is the pivot columns of A itself, not of U. So for rows, take U. For columns, take A.
Row rank equals column rank
Now the main theorem. Let A be an m by n matrix over a field F. Then the row space and the column space of A have the same dimension. The proof is short, because the work is already done. The dimension of the row space is the number of pivots, by the theorem we just proved. The dimension of the column space is also the number of pivots, by lecture twenty. So the two are equal. This deserves a pause. In our example, the row space is a plane in four dimensional space, and the column space is a plane in three dimensional space. They are different spaces, but they have the same dimension: two.
In words: every matrix has exactly as many independent rows as independent columns. Nothing about rows and columns makes this obvious. It holds because both numbers count the same pivots. Here is the definition. The rank of A is this common number: the dimension of the column space, which equals the dimension of the row space, which equals the number of pivots. Two facts follow at once. First, A and A transpose have the same rank, because the row space of A transpose is the column space of A.
Second, the rank is at most the number of rows, m, and at most the number of columns, n, because each row and each column holds at most one pivot. So a three by four matrix has rank at most three.
Rank at work
Let's see the theorem at work. Take the two by three matrix B whose rows are (one, two, three), and (two, four, six). The second row is twice the first, so the row space is the line in three dimensional space spanned by (one, two, three). The rank of B is one. Now the columns. The first is (one, two), the second is (two, four), and the third is (three, six). Each is a multiple of (one, two), so the column space is a line in the plane. Its dimension is one too, just as the theorem promised.
This matrix of rank one is a column times a row. In lecture fifty two, such matrices come back as the building blocks of low rank approximation. For a square matrix, the rank decides invertibility. Theorem: let A be an n by n matrix over F. Then A is invertible exactly when its rank is n, exactly when its rows are linearly independent, and exactly when its rows span F n. For the rank: the rank is the number of pivots, and by the invertible matrix theorem, A is invertible exactly when it has n pivot positions.
For the rows: the rows of A are the columns of A transpose. By the invertible matrix theorem applied to A transpose, these columns are independent exactly when A transpose is invertible, and they span F n exactly when A transpose is invertible. Finally, A transpose is invertible exactly when A is. An example: the matrix C whose row one is (one, two, three), row two is (four, five, six), and row three is (seven, eight, nine). Two times the second row, minus the first row, gives the third row. In the first entry, eight minus one is seven. In the second, ten minus two is eight. In the third, twelve minus three is nine.
So the rows of C are dependent, and C is not invertible. We never had to try to invert it. The first two rows are not multiples of each other, so they are independent, and by the relation they span the row space. So the rank of C is exactly two.
Summary
Let's sum up. The row space of an m by n matrix A is the span of its rows. It is a subspace of F n, and it equals the column space of A transpose. Row operations do not change the row space, so the nonzero rows of any echelon form are a basis of it. The row space and the column space have the same dimension, the number of pivots. This common number is the rank of A. A transpose has the same rank, and the rank is at most the number of rows and at most the number of columns.
A square matrix of size n is invertible exactly when its rank is n. Before the next lecture, read section five point two of the course book, try the problems on sheet seven about row space and rank, and do the lecture check on this lecture's page at Open Semester dot com. Next time we put four subspaces of a matrix together, and we see how their dimensions fit in the rank nullity theorem. See you there.
In this lecture
Materials
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.
- Question 1 of 3 Warm-up
is a matrix, and an echelon form of has pivots. Find , and . Could some other matrix have rank ?
Hint 1 of 2
is the number of pivots (Theorem 5.2.4), and so is , since the pivot columns of are a basis of (Theorem 4.2.14(a)).
Hint 2 of 2
Transposing does not change the rank (Proposition 5.2.9(a)). For the last question, count how many pivots fit in a matrix with columns (Proposition 5.2.9(b)).
Worked solution
- By Theorem 5.2.4, the nonzero rows of the echelon form are a basis of ; there are as many of them as pivots, so .
- The pivot columns of are a basis of (Theorem 4.2.14(a)), so , as Theorem 5.2.7 promises. So .
- , so (Proposition 5.2.9(a)).
- No: and for every matrix (Proposition 5.2.9(b)), so its rank is at most .
- Question 2 of 3 Core
Let over . Row reduce to an echelon form and find . The nonzero rows of are and . Write . Is in ?
Hint 1 of 2
Use and , then compare the new rows two and three.
Hint 2 of 2
In , the first entry gives and the third gives . Then check the other two entries.
Worked solution
- gives and gives . Then gives a zero row.
- has pivots, so , and are a basis of (Theorem 5.2.4).
- . For : and . Check: and .
- For : and , but then . Every vector of is such a combination, so is not in .
- Question 3 of 3 Stretch
Let over , with rows . For which are the rows dependent? For that , find and write . Is invertible for ?
Hint 1 of 2
Row reduce with kept as a letter: , , then .
Hint 2 of 2
The last row becomes . The rows are dependent exactly when the rank is less than (Theorem 5.2.11). For and , compare with .
Worked solution
- gives and gives . Then gives .
- So when and when . By Theorem 5.2.11, the rows are independent exactly when the rank is , so they are dependent exactly for .
- For : . So and .
- For the rank is , so is invertible by Theorem 5.2.11, with no need to compute .
How did it go?