Skip to content

The rank-nullity theorem, explained

7 min read

Short answer

For an m×nm\times n matrix AA, rank + nullity = nn, the number of columns. Every input dimension either survives into the output (counted by the rank) or is crushed to zero (counted by the nullity). There is no third option, and no dimension is lost without being counted.

Inputs (n dims) compared with OutputsInputs (n dims)Null space: crushed to0Dimension = nullityThe rest survivesDimension = rankOutputsColumn space: what ishitDimension = rankEverything crushedlands on the singlepoint 0
Input dimensions split into those that get crushed (the null space) and those that map one-to-one onto the column space.

The two spaces

The null space is the set of inputs that AA sends to zero, and its dimension is the nullity. The column space is the set of all outputs AxA\mathbf{x}, and its dimension is the rank. Both are subspaces: the first lives among the inputs (Rn\mathbb{R}^n), the second among the outputs (Rm\mathbb{R}^m).

Rank-nullity says the inputs split cleanly: nullity measures what is forgotten, rank measures what is remembered, and together they use up all nn input dimensions.

Why it is true

Pick a basis u1,…,uk\mathbf{u}_1,\dots,\mathbf{u}_k of the null space and extend it with w1,…,wr\mathbf{w}_1,\dots,\mathbf{w}_r to a basis of all of Rn\mathbb{R}^n, so k+r=nk+r=n.

  • The null vectors ui\mathbf{u}_i map to 0\mathbf{0} and contribute nothing to the output.
  • The images Aw1,…,AwrA\mathbf{w}_1,\dots,A\mathbf{w}_r span the column space, since any input is a combination of the basis vectors and the u\mathbf{u}'s vanish.
  • They are independent: if ∑cjAwj=0\sum c_jA\mathbf{w}_j=\mathbf{0}, then ∑cjwj\sum c_j\mathbf{w}_j is in the null space, so it is a combination of the u\mathbf{u}'s, which contradicts the basis being independent unless every cj=0c_j=0.

Hence the column space has dimension exactly rr, and k+r=nk+r=n.

What it buys you

  • More unknowns than equations. If n>mn>m then rank≤m<n\text{rank}\le m<n, so the nullity is positive: a homogeneous system has nontrivial solutions.
  • One-to-one test. AA is injective exactly when the nullity is 00.
  • Solutions come in families. If Ax=bA\mathbf{x}=\mathbf{b} has one solution, the full solution set is that solution plus the null space, so its dimension is the nullity.
  • Checking work. Row reduce, count pivots (rank) and free variables (nullity) and confirm they add up to nn.

Worked example

For A=(120001)A=\begin{pmatrix}1&2&0\\0&0&1\end{pmatrix} find the rank and nullity and check the theorem.

The matrix is already in echelon form with pivots in columns 1 and 3, so the rank is 2.

Solve Ax=0A\mathbf{x}=\mathbf{0}: x1+2x2=0x_1+2x_2=0 and x3=0x_3=0, with x2x_2 free. The solutions are x2(−2,1,0)x_2(-2,1,0), so the null space has dimension 11 and the nullity is 1.

Check: rank + nullity =2+1=3=n=2+1=3=n, the number of columns. ✓

Try it yourself

A 4×64\times6 matrix has rank 3. What is its nullity, and could Ax=bA\mathbf{x}=\mathbf{b} have exactly one solution for some b\mathbf{b}?

Show the answer

Nullity =6−3=3=6-3=3. Because the null space is not just {0}\{\mathbf{0}\}, any solution can be shifted by a null vector, so a solvable system has infinitely many solutions, never exactly one.

Keep going with practice

Vidi's rank and null space lessons let you practice the pivot-counting version of this theorem.