Matrix Subspaces: Row and Column Spaces
Matrix Subspaces: Row and Column Spaces
Let A be an m × n matrix,
a11 a12 ··· a1n
a21 a22 ··· a2n
A= . .. .
.. ..
.. . . .
am1 am2 ··· amn
The row space is a subspace of
(a) Rn
(b) Rm
(b) Rm
Example
1 0 2 0
Let A = 0 1 0 2.
1 1 2 2
Columns space of A:
1 0 2 0 1 0
Col(A) = span 0 , 1 , 0 , 2 = span 0 , 1
1 1 2 2 1 1
Row space of A:
Row(A) = span{ 1 0 2 0 , 0 1 0 2 , 1 1 2 2 }
= span{ 1 0 2 0 , 0 1 0 2 }.
5 2 −1 −1
1 −1 4 −3
Let A =
8 3 −1 −2. Which of the following statements are true?
9 3 0 −3
5 2 −1 −1
1 −1
, , , −3 is a basis for the column space of A.
4
(i)
8 3 −1 −2
9 3 0 −3
5 1 8 9
2 −1
, , , 3 is a basis for the row space of A.
3
(ii) −1 4 −1 0
−1 −3 −2 −3
Example
Suppose
a1 1 2 2 −1 1 2 2 −1 b1
R2 ↔R3
A = a2 = 1 −2 0 3 −− −−→ 0 1 3 0 = b2 = B.
a3 0 1 3 0 1 −2 0 3 b3
Suppose
a1 1 2 2 −1 1 2 2 −1 b1
−R3
A = a2 = 1 −2 0 3 −−→ 1 −2 0 3 = b2 = B.
a3 0 1 3 0 0 −1 −3 0 b3
Then it is clear that Row(A) = span{a1 , a2 , a3 } = span{b1 , b2 , b3 } = Row(B) since b1 = a1 , b2 = a2 , and b3 = −a3 .
Example
Suppose
a1 1 2 2 −1 1 2 2 −1 b1
R −R1
A = a2 = 1 −2 0 3 −−2−−→ 0 −4 −2 4 = b2 = B.
a3 0 1 3 0 0 1 3 0 b3
This discussion shows that row operations do not change the row space.
Row Operations Preserves Row Space
Sketch of proof.
Ri ↔Rj
(i) Suppose A −−−−→ B. Then the rows of B are the rows of A rearranged, which will not change the span.
1
cR
i Ri
(ii) Suppose A −−→ B, c ̸= 0. Then Row(B) ⊆ Row(A). But B −c−→ A shows that Row(A) ⊆ Row(B) too.
Ri +aRj Ri −aRj
(iii) Suppose A −−−−→ B. Then Row(B) ⊆ Row(A). But B −−−−→ A shows that Row(A) ⊆ Row(B) too.
Finding Basis for Row Space
Theorem
If a matrix R is in reduced row-echelon form, then the nonzero rows of R form a basis for its row space.
Sketch of proof.
0 ··· 1 ··· ∗ 0 ··· ∗ 0 ···
0
··· 0 ··· 0 1 ··· ∗ 0 · · ·
Write R = 0
··· 0 ··· 0 0 ··· 0 1 · · ·
. By definition, the 1 in the leading entry in each nonzero row
0 ··· 0 ··· 0 0 ··· 0 0 · · ·
.. .. .. ..
. . . .
is only nonzero entry in that coordinate among the rows. This shows that each nonzero row cannot be a linear
combination of the other rows. Hence, the rows of R are linearly independent. It is clear that the nonzero rows spans
the row space of R.
Theorem
For any matrix A, the nonzero rows of the reduced row-echelon form of A form a basis for for the row space of A.
Proof.
Follows from the fact that A is row equivalent to its reduced row-echelon form R, and that the nonzero rows of R
form a basis for Row(R).
Examples
1 0 2 0 1 0 2 0
RREF
1. A = 0 1 0 2 −−−→ 0 1 0 2
1 1 2 2 0 0 0 0
So 1 0 2 0 , 0 1 0 2 is a basis for Row(A).
1 2 1 1 0 5
3 4 7 RREF 0
−−−→ 1 −3
2. A =
−1
.
7 −19 0 0 0
1 9 −13 0 0 0
So 1 0 5 , 0 1 −3 is a basis for Row(A).
Challenge
1 1 2 −1 1 0 0 2
RREF
3. A = 0 1 1 0 −−−→ 0 1 0 −1
1 1 0 1 0 0 1 1
So 1 0 0 2 , 0 1 0 −1 , 0 0 1 1 is a basis for Row(A).
In fact, the linear relations between A and its reduced row-echelon form are preserved for any columns. Consider
a1 a2 a3 a4 a5 r1 r2 r3 r4 r5
2 8 2 4 2 RREF 1 0 3 −2 −3
A= −−−→ = R.
1 6 0 4 3 0 1 −1/2 1 1
−1 −4 −1 −2 −1 0 0 0 0 0
Then
r3 = 3r1 − 21 r2 ←→ a3 = 3a1 − 12 a2
r4 = −2r1 + r2 ←→ a4 = −2a1 + a2
r5 = −3r1 + r2 ←→ a5 = −3a1 + a2
c1 a1 + c2 a2 + · · · + cn an = 0
if and only if
c1 b1 + c2 b2 + · · · + cn bn = 0.
So, if c1 b1 + c2 b2 + · · · + cn bn = 0,
Theorem
Suppose R is the reduced row-echelon form of a matrix A. Then the columns of A corresponding to the pivot
columns in R form a basis for the column space of A.
Proof.
First observe that the pivot columns in R are linearly independent since they are just the vectors in the standard basis.
Also, the non-pivot columns of R linearly dependent on the pivot columns. Hence, the columns of A that corresponds
to the pivot columns of R are linearly independent and are sufficient to span Col(A), and thus form a basis.
Question
2 1 4 1 2 1 1/2 0 5/6 1/3
4 2 2 3 2 RREF 0
−−−→ R = 0 1 −1/6 1/3
A=
2 1 −2 2 0 0 0 0 0 0
6 3 6 4 4 0 0 0 0 0
3 6 4 6 6 4 6 6
Since the first and third columns of R are the pivot columns, the first an third columns of A form a basis for Col(A).
However, in this case, we could take any 2 columns of A except columns 1 and 2, to be a basis for the column space
of A. Why?
Question
1 0 1 1 0
1. Suppose A is a 3 × 3 matrix whose reduced row-echelon form is 0 1 0. Then the set 0 , 1 is
0 0 0 0 0
a basis for the column space of A.
1 0 1
0 1 −1
2. Suppose A is a 4 × 3 matrix whose reduced row-echelon form is
0
. Then we can conclude that the
0 0
0 0 0
first 2 rows of A are linearly independent.
Remarks
v in the column space of A if and only if there exists coefficients c1 , c2 , c3 , c4 such that
2 8 2 4 6
c1 1 + c2 6 + c3 0 + c4 4 = 7 ,
−1 −4 −1 −2 −3
Col(A) = { v = Au u ∈ Rk } = { v Ax = v is consistent }.
Nullspace
Definition
The nullspace of a m × n matrix A is the solution space to the homogeneous system Ax = 0 with coefficient
matrix A. It is denoted as
Null(A) = { v ∈ Rn Av = 0 }.
nullity(A) = dim(Null(A)).
Question
Let
2 1 4 1 2 1 1/2 0 5/6 1/3
4 2 2 3 2 RREF 0
−−−→ R = 0 1 −1/6 1/3
A= .
2 1 −2 2 0 0 0 0 0 0
6 3 6 4 4 0 0 0 0 0
For any matrix A, the dimension of the column space of A is equal to the dimension of the row space of A. True or
false?
Rank
Definition
Define the rank of A to be the dimension of its column or row space
rank(A) = rank(AT ).
Examples
1 1 2 −1 1 0 0 2
RREF
2. A = 0 1 1 0 −−−→ 0 1 0 −1. So rank(A) = 3.
1 1 0 1 0 0 1 1
1 2 3 1 0 0
3 4 2 RREF 0 1 0
3. A =
− −−→
. So rank(A) = 3.
−1 7 5 0 0 1
1 9 2 0 0 0
1 2 1 1 0 5
3 4 7 RREF 0
−−−→ 1 −3
4. A =
−1
. So rank(A) = 2.
7 −19 0 0 0
1 9 −13 0 0 0
Challenge: Rank and Consistency of Linear Systems
4 3 5
3 −1
5 −1 5
and B = 1
Let A =
−1 1 . Then rank(A) = 3 and rank(B) = 2. Now,
0 0
3 3
5 2 5
30 14
29 9
AB =
−3
,
1
32 12
and rank(AB) = 2.
−1 0 −1
1 −1 3
Let A = and B = 0 1 2 . Check that rank(A) = rank(B) = 2. Next,
−1 0 0
3 0 3
8 −1 6
AB =
1 0 1
−2 −3 −1
1 0 3 −1 −3 −4 −1
Let A = 3 −2 1 −1 and B =
1
. Check that rank(A) = rank(B) = 2. Now
1 0
3 −2 1 −1
1 0 −1
0 0 0
AB = 0 0 0 ⇒ rank(AB) = 0.
0 0 0
Lemma
Let A be a m × n matrix and B a n × p matrix. The column space of the product AB is a subspace of the column
space of A,
Col(AB) ⊆ Col(A).
Sketch of proof.
Write B = b1 b2 · · · bp . Then
AB = A b1 b2 · · · bp = Ab1 Ab2 · · · Abp .
Recall that Au ∈ Col(A) for all u, and hence, Abi ∈ Col(A) for all i = 1, .., p. Therefore
Theorem
Let A be a m × n matrix and B a n × p matrix. Then
Proof.
By the previous lemma,
rank(AB) = dim(Col(AB)) ≤ dim(Col(A)) = rank(A).
T
Next, using the previous lemma and the above derivation on (AB) = BT AT , we have
Hence,
rank(AB) ≤ min{rank(A), rank(B)}.
Question
Show that if A and B are row equivalent matrices, then rank(A) = rank(B).
Rank-Nullity Theorem
rank(A) + nullity(A) = n.
Sketch of Proof.
This follows from the fact that the nullity of A is equal to the number of non-pivot columns in its reduced
row-echelon form, and that the rank of A is equal to the number of pivot columns of its reduced row-echelon
form.
Examples
1 2 2 −1 1 2 0 5
RREF
A = 3 6 5 0 −−−→ 0 0 1 −3
1 2 1 2 0 0 0 0
1 2
rank(A) + nullity(A) = 2 + 2 = 4 = number of columns of A. Indeed, 3 , 5 is a basis of the column
1 1
−2 −5
1 , 0 is a basis for the nullspace.
space, and
0
3
0 1
Observe that the column space is a subspace of R3 but the subspace is a subspace of R4 .
Summary of the Subspaces Associated to a Matrix
Let A be a m × n matrix.
So, the rank of A is no greater than the number of rows or columns, whichever is smaller,
The maximum rank a matrix can attain is when it is equal to either the number of rows or columns, whichever is
smaller.
Definition
A m × n matrix A is said to be of full rank if its rank is equal to either the number of rows or columns,
1 9 2 0 0 0
1 1 0 1 1 0 −1 1
RREF
3. A = 0 1 1 0 −−−→ 0 1 1 0 rank(A) = 2 which is strictly smaller than the number rows and
1 2 1 1 0 0 0 0
number of columns. So A is not of full rank.
1 0 1 1 0 1
1 1 2 RREF 0 1 1
4. A= 0 1 1 −−−→ 0 0 0 rank(A) = 2 which is strictly smaller than the number rows and number
1 0 1 0 0 0
of columns. So A is not of full rank.
Discussion
Consider the case when A is a square matrix m = n. Then A is full rank if and only if its is invertible. The proof is
left as an exercise. We will include this in the list of equivalent statements for invertibility.
Equivalent Statements for Invertibility
Theorem
Let A be a square matrix of order n. The following statements are equivalent.
(i) A is invertible.
(ii) AT is invertible.
(iii) (left inverse) There is a matrix B such that BA = I.
(iv) (right inverse) There is a matrix B such that AB = I.
(v) The reduced row-echelon form of A is the identity matrix.
(vi) A can be expressed as a product of elementary matrices.
(vii) The homogeneous system Ax = 0 has only the trivial solution.
(viii) For any b, the system Ax = b has a unique solution.
(ix) The determinant of A is nonzero, det(A) ̸= 0.
(x) The columns/rows of A are linearly independent.
(xi) The columns/rows of A spans Rn .
(xii) rank(A) = n (A has full rank).
(xiii) nullity(A) = 0.
Discussion
Let A be a m × n matrix. Suppose A is not a square matrix m ̸= n, and A is full rank.
Then either rank(A) = n < m, rank(A) = m < n. In either cases, some of the equivalent statements of invertibility
will still be true of A.
Lemma
Let A be a m × n matrix. Then the nullspace of A is equal to the nullspace of AT A,
Proof.
Suppose u is in the nullspace of A, Au = 0. Then premultiplying by AT , AT Au = 0 too. This shows that u is in the
nullspace of AT A. This proves Null(A) ⊆ Null(AT A).
Conversely, suppose u is in the nullspace of AT A, AT Au = 0. Premultiplying both sides by uT , and noting that
uT AT Au = (Au) · (Au),
(Au) · (Au) = uT AT Au = uT (0) = 0.
Hence, Au = 0 too, that is, u is in the nullspace of A. This proves that Null(AT A) ⊆ Null(A) too.
Full Rank Equals Number of Columns
Theorem
Suppose A is a m × n matrix. The following statements are equivalent.
(i) A is full rank, where the rank is equal to the number of columns, rank(A) = n.
(iv) The homogeneous system Ax = 0 has only the trivial solution, that is, Null(A) = {0}.
Proof.
We will only prove the equivalence of the last 3 statements, the rest are left as an exercise. Hint: One might try to
prove (i) ⇒ (ii) ⇒ (iii) ⇒ (iv). Observe that if rank(A) = n, then the reduced row-echelon form is of the form
In
R= .
0(m−n)×n
Full Rank Equals Number of Columns
Continue of Proof.
(iv) ⇒ (v): Suppose the homogeneous system Ax = 0 has only the trivial solution. By the lemma, the homogeneous
system AT Ax = 0 has only the trivial solution too. But since AT A is a square matrix, by the equivalent statements
of invertibility, AT A is invertible.
(v) ⇒ (vi): Suppose AT A is invertible. Then
1 01 1 0 0
1 10
. Its reduce row-echelon form is 0 1 0.
Let A =
0 11 0 0 1
1 11 0 0 0
▶ So, A is full
rank, where the rank is equal to the number of columns.
3 2 2 5 −2 −2
▶ Check that AT A = 2 3 2 is invertbile, with inverse (AT A)−1 = 17 −2 5 −2.
2 2 3 −2 −2 5
▶ Check that
3 3 −4 1
1
(AT A)−1 AT = −4 3 3 1
7
3 −4 3 1
is a left inverse of A.
Full Rank Equals Number of Rows
Theorem
Suppose A is a m × n matrix. The following statements are equivalent.
(i) A is full rank, where the rank is equal to the number of rows, rank(A) = m.
The proof follows from the previous theorem by replacing A with AT . For statement (iv), use rank-nullity theorem.
The details are left to the readers.
Example
1 12 −1 1 0 0 2
Let A = 0 11 0 . The reduced row-echelon form of A is 0 1 0 −1.
1 10 1 0 0 1 1
▶ So, A is full
rank, where the rank is equal to the number of rows.
7 3 1 5 −8 1
▶ Check that AAT = 3 2 1 is invertbile, with inverse AAT )−1 1
= 12 −8 20 −4.
1 1 3 1 −4 5
▶ Check that
3 −6 3
1 −1 4 1
AT (AAT )−1 =
6 1 2 −1
−2 2 2
is a right inverse of A.
Challenge
Let A be a m × n matrix such that rank(A) = m. Suppose m > n. By the equivalent statements of full rank equals
number of columns, (AT A) invertible and (AT A)−1 AT . is a left inverse of A.
Now consider the system Ax = b for some vector b in Rm . Premultiplying the left inverse above on both sides of the
equation, we get
x = ((AT A)−1 AT )Ax =((AT A)−1 AT )b,
that is, (AT A)−1 AT )b is a solution to Ax = b. But this is true for every b, which by the equivalent statements of
full rank equals number or rows, means that the rank of A is equal to m, the number of row. This is a contradiction
to m > n.