Linear Algebra · Intermediate · 10 min read
The Rank–Nullity Theorem and the Four Fundamental Subspaces
Every matrix hides four subspaces. Once you know what they are and how their dimensions fit together, a long list of linear algebra facts becomes a single picture.
Meeting the subspaces
For an m×n matrix A, the column space Col(A) is spanned by the columns and lives in ℝm. The row space Row(A) is spanned by the rows and lives in ℝn. The null space Null(A) consists of all x with Ax = 0 and lives in ℝn. The left null space, the null space of Aᵀ, lives in ℝm.
Dimensions and the theorem
The column space and the row space both have dimension equal to the rank r. The null space has dimension n − r, the number of free variables, and the left null space has dimension m − r. The statement rank + nullity = n is the rank–nullity theorem. It says that the columns of A either contribute a new direction (a pivot) or are redundant (a free variable), and these two cases exhaust all columns.
Finding bases
Reduce A to RREF. The pivot columns of the original matrix are a basis of the column space; the non-zero rows of the RREF are a basis of the row space; and each free variable produces one null space basis vector. Taking pivot columns from the RREF instead of from A is a very common mistake, because row operations change the column space.
Why it matters
Solvability of Ax = b is the question of whether b lies in Col(A). Uniqueness is the question of whether Null(A) is trivial. A square matrix is invertible exactly when its null space is {0}, which is when the rank is full.
Key formulas
rank(A) = dim Col(A) = dim Row(A)nullity(A) = dim Null(A) = n − rank(A)dim Null(Aᵀ) = m − rank(A)
Solved example
Subspaces of the 3×4 matrix with rows (1, 2, 1, 3), (2, 4, 0, 2), (3, 6, 1, 5)
- Row reduce: R₂ ← R₂ − 2R₁ gives (0, 0, −2, −4); R₃ ← R₃ − 3R₁ gives (0, 0, −2, −4). Then R₃ ← R₃ − R₂ gives 0, and R₂ ← R₂ / (−2) gives (0, 0, 1, 2). Finally R₁ ← R₁ − R₂ gives (1, 2, 0, 1).
- The pivots are in columns 1 and 3, so the rank is 2 and the nullity is 4 − 2 = 2.
- Column space basis (original columns 1 and 3): (1, 2, 3) and (1, 0, 1).
- Row space basis (non-zero RREF rows): (1, 2, 0, 1) and (0, 0, 1, 2).
- Null space: the free variables are x₂ and x₄. Setting x₂ = 1 gives (−2, 1, 0, 0). Setting x₄ = 1 gives x₃ = −2 and x₁ = −1, so (−1, 0, −2, 1).
- Check: the second vector times row 1 gives −1 + 0 − 2 + 3 = 0, and times row 2 gives −2 + 0 + 0 + 2 = 0; row 3 gives −3 + 0 − 2 + 5 = 0.
Practice questions
Try each question first, then open the answer.
1. A 4×6 matrix has rank 3. What is the dimension of its null space?
6 − 3 = 3.
2. A 5×5 matrix has non-zero determinant. What is its null space?
Only the zero vector, of dimension 0, because the matrix has full rank 5.
3. A 3×5 matrix has rank 3. What is the dimension of its left null space?
3 − 3 = 0, so the left null space is {0}.