Linear AlgebraVector Spaces

The Rank–Nullity Theorem and the Four Subspaces

rank + nullity = number of columns.

Not started Jump to practice

Rank counts pivot columns; nullity counts free columns. Together they account for every column, and that simple count connects the size of the outputs to the size of what gets lost. It sharpens what we learned about one-to-one and onto maps.

Key idea

Rank–nullity theorem. For an $m \times n$ matrix $A$: $\operatorname{rank} A + \dim \operatorname{Nul} A = n$, the number of columns.

Why it works

Every column of $A$ is either a pivot column or a free column, never both. The pivot columns give a basis of $\operatorname{Col} A$, so there are $\operatorname{rank} A$ of them. The free columns each give one vector in a basis of $\operatorname{Nul} A$, so there are $\dim \operatorname{Nul} A$ of them. The two counts add up to $n$. For a linear map $T: \mathbb{R}^n \to \mathbb{R}^m$ this reads: $\dim(\text{range}) + \dim(\text{kernel})$ $= n$. Every input dimension either shows up in the output or gets crushed to $\mathbf{0}$.

The four fundamental subspaces

The row space $\operatorname{Row} A$ is the span of the rows of $A$ (a subspace of $\mathbb{R}^n$). Row operations replace rows by combinations of rows, so they never change the row space, and the nonzero rows of an echelon form are a basis. That gives $\dim \operatorname{Row} A = \operatorname{rank} A$: the row rank equals the column rank. Applying rank–nullity to $A^{T}$ as well gives four subspaces with linked sizes:

For an m × n matrix of rank r.
SubspaceLives inDimension
Column space $\operatorname{Col} A$$\mathbb{R}^m$$r$
Left null space $\operatorname{Nul} A^{T}$$\mathbb{R}^m$$m - r$
Row space $\operatorname{Row} A = \operatorname{Col} A^{T}$$\mathbb{R}^n$$r$
Null space $\operatorname{Nul} A$$\mathbb{R}^n$$n - r$

Worked example: All four dimensions

$A$ is $5 \times 7$ with rank $3$. Find the dimensions of the four fundamental subspaces.
  1. $\dim \operatorname{Col} A = \dim \operatorname{Row} A = 3$.
  2. $\dim \operatorname{Nul} A = 7 - 3 = 4$ (subspace of $\mathbb{R}^7$).
  3. $A^{T}$ is $7 \times 5$ with rank $3$, so $\dim \operatorname{Nul} A^{T} = 5 - 3 = 2$ (subspace of $\mathbb{R}^5$).

Answer: 3, 3, 4, 2.

Worked example: Is it possible?

Can a $4 \times 6$ matrix have a null space of dimension $1$?
  1. Rank–nullity would need $\operatorname{rank} A = 6 - 1 = 5$.
  2. But the rank is at most the number of rows, $4$. So the nullity is at least $6 - 4 = 2$.

Answer: No.

Worked example: Reading a matrix

For $A = \begin{bmatrix} 1 & 3 & 1 & 2 \\ 2 & 6 & 4 & 8 \\ 0 & 0 & 2 & 4 \end{bmatrix}$, find the rank and nullity, and decide whether $\mathbf{x} \mapsto A\mathbf{x}$ is onto $\mathbb{R}^3$.
  1. Row reduce: $\begin{bmatrix} 1 & 3 & 0 & 0 \\ 0 & 0 & 1 & 2 \\ 0 & 0 & 0 & 0 \end{bmatrix}$. Two pivots.
  2. Rank $2$, nullity $4 - 2 = 2$.
  3. The range has dimension $2 < 3$, so the map is not onto $\mathbb{R}^3$.

Answer: Rank 2, nullity 2, not onto.

A $2 \times 2$ matrix of rank 1: one dimension survives (the output line) and one is crushed (the null space line). $1 + 1 = 2$.
The theorem gives quick consequences. $A\mathbf{x} = \mathbf{b}$ solvable for every $\mathbf{b}$ means rank $= m$, so nullity $= n - m$. A map from $\mathbb{R}^5$ to $\mathbb{R}^3$ always crushes at least $2$ dimensions.

Common mistake

Subtracting the rank from the number of rows to get $\dim \operatorname{Nul} A$. The null space lives among the inputs, so use the number of columns, $n$. ($m - r$ is the dimension of the other null space, $\operatorname{Nul} A^{T}$.)

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.

Loading practice…

Builds on

Leads to

This is one of the top rungs of Linear Algebra.

Sources and further reading

  • Margalit and Rabinoff, Interactive Linear Algebra (Georgia Tech), §2.9 The Rank Theorem
  • MIT OpenCourseWare 18.06 Linear Algebra (Gilbert Strang, Spring 2010), Lecture 10: The Four Fundamental Subspaces
@teddyrookbook GitHub