The rank–nullity theorem
Statement
Let \( F \) be a field, let \( V \) and \( W \) be vector spaces over \( F \), and let \( T : V \to W \) be a linear map. Suppose \( V \) is finite-dimensional, say \( \dim V = n \). Then the image \( \operatorname{im} T = \{ T(v) : v \in V \} \) and the kernel \( \ker T = \{ v \in V : T(v) = 0 \} \) are subspaces (of \( W \) and \( V \) respectively), both are finite-dimensional, and \[ \operatorname{rank} T + \operatorname{null} T = \dim V, \] where \( \operatorname{rank} T := \dim \operatorname{im} T \) and \( \operatorname{null} T := \dim \ker T \). No hypothesis is needed on \( W \): it may be infinite-dimensional, and the field \( F \) is arbitrary.
Why it matters
The rank–nullity theorem is the fundamental conservation law of linear algebra: a linear map cannot simultaneously collapse a large subspace to zero and have a large image. Every dimension of the domain is accounted for — it is either "killed" (contributes to the kernel) or "survives" (contributes to the image). This single identity governs the solvability of linear systems: for an \( m \times n \) matrix \( A \), the solution space of \( Ax = 0 \) has dimension exactly \( n - \operatorname{rank} A \), which is why the number of free parameters in Gaussian elimination is forced, not accidental.
It is also the prototype of a far-reaching pattern. It is the dimension-counting shadow of the first isomorphism theorem \( V / \ker T \cong \operatorname{im} T \), and its descendants include the additivity of dimension along exact sequences, the Euler characteristic of a chain complex, and the index of a Fredholm operator. Learning to argue "count what dies, count what survives, and the totals must match" is one of the most transferable habits in pure mathematics.
Hypotheses
Proof
Write \( n = \dim V \), \( k = \operatorname{null} T \), and let the strategy be: build a basis of \( V \) adapted to \( \ker T \), and show its "non-kernel part" maps to a basis of \( \operatorname{im} T \).
Result
Reading. A linear map splits the dimension of its domain into two exact parts: the dimensions that get crushed to zero (nullity) and the dimensions that survive into the image (rank). Nothing is lost and nothing is created — the books always balance.
Scope. Applies to any linear map out of a finite-dimensional vector space over any field, with an arbitrary (possibly infinite-dimensional) codomain over the same field. For an \( m \times n \) matrix \( A \) over \( F \) it reads \( \operatorname{rank} A + \dim \{ x : Ax = 0 \} = n \) (the number of columns). It fails, as an informative statement, for infinite-dimensional domains.
Corollaries & converses
- Injectivity–surjectivity dichotomy. If \( \dim V = \dim W \lt \infty \) and \( T : V \to W \) is linear, then \( T \) injective \( \iff \) \( T \) surjective \( \iff \) \( T \) bijective. (Injective means \( \operatorname{null} T = 0 \), so \( \operatorname{rank} T = \dim W \), so surjective; and conversely.)
- Rank bound. \( \operatorname{rank} T \le \min(\dim V, \dim W) \): the theorem gives \( \operatorname{rank} T \le \dim V \), and \( \operatorname{im} T \subseteq W \) gives the other bound.
- Solution spaces. For \( A \in F^{m \times n} \), the solution set of \( Ax = 0 \) has dimension \( n - \operatorname{rank} A \); a consistent system \( Ax = b \) has solution set an affine translate of it, of the same dimension.
- No injections downward, no surjections upward. If \( \dim V \gt \dim W \) no linear \( T : V \to W \) is injective; if \( \dim V \lt \dim W \) none is surjective.
- Converse (realisability). The numerical converse holds: for any \( r, k \ge 0 \) with \( r + k = n \) and any \( W \) with \( \dim W \ge r \), there is a linear \( T : V \to W \) with rank \( r \) and nullity \( k \) (send \( r \) basis vectors to independent targets and the rest to \( 0 \)). But the dichotomy corollary has no infinite-dimensional analogue: the left shift on sequence space is surjective, not injective; the right shift is injective, not surjective.
Fails without
- Without finite-dimensionality of \( V \): let \( D : \mathbb{R}[x] \to \mathbb{R}[x] \) be differentiation, \( D(p) = p' \). Then \( D \) is surjective (every polynomial has a polynomial antiderivative) and \( \ker D \) is the one-dimensional space of constants. Any attempted identity "\( \operatorname{rank} + \operatorname{null} = \dim \)" degenerates to \( \infty + 1 = \infty \); worse, the corollary "injective \( \iff \) surjective on a space mapped to itself" is outright false here.
- Without finite-dimensionality, second failure mode: the right shift \( R : (a_1, a_2, \dots) \mapsto (0, a_1, a_2, \dots) \) on the sequence space \( \mathbb{R}^{\mathbb{N}} \) is injective (\( \operatorname{null} R = 0 \)) but not surjective — its image has, informally, "codimension 1". In finite dimensions nullity \( 0 \) forces the image to have the full dimension of the domain; infinite dimension breaks that rigidity.
- Without linearity: \( f : \mathbb{R}^2 \to \mathbb{R}^2 \), \( f(x,y) = (x^2 - y^2, \, 2xy) \) (the squaring map of \( \mathbb{C} \)). The zero set of \( f \) is \( \{(0,0)\} \) and \( f \) is surjective, yet \( f \) is 2-to-1 away from the origin: "trivial kernel" does not imply injectivity, and no dimension count of the sort survives. Kernel–image bookkeeping is a strictly linear phenomenon.
Common errors
- Using \( \dim W \) instead of \( \dim V \). The theorem counts the domain: for a \( 3 \times 5 \) matrix, rank + nullity \( = 5 \) (columns), not \( 3 \). The codomain's dimension only supplies the bound \( \operatorname{rank} \le \dim W \).
- Believing \( V = \ker T \oplus \operatorname{im} T \) when \( T : V \to V \). The dimensions add up, but the subspaces need not be complementary: for \( T = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} \) on \( F^2 \), \( \ker T = \operatorname{im} T = \operatorname{span}(e_1) \). The proof produces a complement of \( \ker T \) inside \( V \), and that complement merely maps isomorphically onto \( \operatorname{im} T \) — the image itself lives wherever it likes.
- Concluding injectivity from "kernel is small" for nonlinear maps. \( \ker \) detects injectivity only for linear (more generally, group-homomorphic) maps.
- Applying the injective \( \iff \) surjective corollary when \( \dim V \ne \dim W \), or in infinite dimensions. Both hypotheses are essential (shift operators, differentiation).
- Row rank vs. column confusion. Students who compute rank by row reduction sometimes then write rank + nullity \( = m \) for an \( m \times n \) matrix. Row rank equals column rank, but the nullity count is against the number of variables, \( n \).
Discussion
The cleanest modern way to see the theorem is through the first isomorphism theorem: any linear \( T : V \to W \) induces an isomorphism \( \bar{T} : V / \ker T \to \operatorname{im} T \), \( \bar{T}(v + \ker T) = T(v) \). Granting the quotient-dimension formula \( \dim (V/U) = \dim V - \dim U \) for subspaces \( U \) of a finite-dimensional \( V \), rank–nullity drops out immediately. The hands-on basis-extension proof given above is essentially a proof of that quotient formula in disguise: the vectors \( v_1, \dots, v_r \) project to a basis of \( V / \ker T \). Both proofs are worth internalising — the first generalises to modules and groups, the second is the one you actually compute with.
Historically the result descends from James Joseph Sylvester's work on matrices in the 1880s; his 1884 "law of nullity" states that for square matrices \( \operatorname{null}(AB) \le \operatorname{null} A + \operatorname{null} B \), and the modern rank inequalities of Sylvester and Frobenius are all rank–nullity in various costumes (see Problem 5). The abstract vector-space formulation is a child of the 20th century, crystallising with the axiomatisation of linear algebra by Peano, Weyl, and ultimately the textbook tradition following van der Waerden and Halmos.
The theorem is best remembered as an exactness statement: the sequence \( 0 \to \ker T \to V \to \operatorname{im} T \to 0 \) is a short exact sequence of vector spaces, and dimension is additive on short exact sequences. That single sentence is the germ of homological algebra. For a chain complex, iterating rank–nullity over all the maps shows that the alternating sum of the dimensions of the chain spaces equals the alternating sum of the dimensions of the homology spaces — the invariance of the Euler characteristic. What began as bookkeeping for one linear map becomes the reason a polyhedron's \( V - E + F \) does not depend on the triangulation.
In infinite dimensions the correct heir is not the naive identity but the theory of Fredholm operators: a bounded operator \( T \) between Banach spaces is Fredholm when \( \ker T \) and \( \operatorname{coker} T = W / \operatorname{im} T \) are both finite-dimensional, and its index \( \operatorname{ind} T = \dim \ker T - \dim \operatorname{coker} T \) is the surviving finite quantity. Rank–nullity is precisely the statement that for \( T : V \to W \) with \( \dim V, \dim W \lt \infty \), \( \operatorname{ind} T = \dim V - \dim W \) — the index depends only on the spaces, not on the map. That rigidity (invariance of the index under perturbation) persists for Fredholm operators and culminates in the Atiyah–Singer index theorem, which computes analytic indices by topology. The left and right shifts, which broke the naive theorem above, are Fredholm of index \( +1 \) and \( -1 \): the failure was not lawless, it was measuring something.
Common misconceptions. The theorem does not say the kernel and image are complementary subspaces (they generally are not, and for \( T: V \to W \) with \( V \neq W \) they do not even inhabit the same space); it does not constrain \( \dim W \) at all beyond \( \operatorname{rank} T \le \dim W \); and "nullity" is the dimension of the kernel, not the number of zero rows in an echelon form of a matrix (though for an \( m \times n \) matrix the two are related: zero rows count \( m - \operatorname{rank} \), nullity is \( n - \operatorname{rank} \)).
Worked examples
Example 1 (differentiation on polynomials of bounded degree). Let \( P_3 = \{ p \in \mathbb{R}[x] : \deg p \le 3 \} \), a vector space with basis \( 1, x, x^2, x^3 \), so \( \dim P_3 = 4 \). Let \( D : P_3 \to P_3 \) be \( D(p) = p' \). Find the rank and nullity of \( D \) and a basis of \( \operatorname{im} D \).
Reading. Differentiation on cubics kills exactly the constants and reaches exactly the quadratics; rank–nullity converts one easy computation (the kernel) into a surjectivity theorem for free.
Scope. The same argument gives \( \operatorname{im} D = P_{n-1} \) on \( P_n \) for every \( n \ge 1 \).
Example 2 (kernel of an explicit matrix map). Let \( T : \mathbb{R}^4 \to \mathbb{R}^3 \) be given by the matrix \[ A = \begin{pmatrix} 1 & 2 & 0 & 1 \\ 2 & 4 & 1 & 3 \\ 1 & 2 & 1 & 2 \end{pmatrix}. \] Find \( \operatorname{rank} T \), \( \operatorname{null} T \), and a basis of \( \ker T \).
Reading. The theorem is used here as a completeness check: once the nullity is known to be \( 4 - 2 = 2 \), finding two independent solutions of \( Ax = 0 \) proves we have a basis of the whole kernel.
Scope. This is the standard workflow for any homogeneous system over any field: pivots give rank, rank–nullity gives the number of basis solutions to look for.
Problems
- Let \( T : \mathbb{R}^3 \to \mathbb{R}^2 \), \( T(x, y, z) = (x + y, \; y + z) \). Compute \( \operatorname{rank} T \) and \( \operatorname{null} T \), and decide whether \( T \) is surjective.
Solution
The matrix of \( T \) is \( \begin{pmatrix} 1 & 1 & 0 \\ 0 & 1 & 1 \end{pmatrix} \), already in echelon form with pivots in columns 1 and 2, so \( \operatorname{rank} T = 2 \). By rank–nullity, \( \operatorname{null} T = 3 - 2 = 1 \); explicitly \( \ker T = \operatorname{span}(1, -1, 1) \), since \( x + y = 0 \) and \( y + z = 0 \) give \( x = -y = z \). Since \( \operatorname{rank} T = 2 = \dim \mathbb{R}^2 \), the image is all of \( \mathbb{R}^2 \): \( T \) is surjective. It is not injective, as the nonzero kernel shows. - Let \( \operatorname{tr} : M_n(F) \to F \) be the trace, \( \operatorname{tr}(A) = \sum_{i=1}^{n} a_{ii} \), on the space of \( n \times n \) matrices over a field \( F \). Show \( \operatorname{tr} \) is linear and compute the dimension of the space of trace-zero matrices.
Solution
Linearity: \( \operatorname{tr}(\lambda A + \mu B) = \sum_i (\lambda a_{ii} + \mu b_{ii}) = \lambda \operatorname{tr} A + \mu \operatorname{tr} B \). The trace is not the zero map (e.g. \( \operatorname{tr}(E_{11}) = 1 \), where \( E_{11} \) is the matrix unit), so its image is a nonzero subspace of the one-dimensional space \( F \), hence \( \operatorname{rank}(\operatorname{tr}) = 1 \). Since \( \dim M_n(F) = n^2 \), rank–nullity gives \[ \dim \{ A : \operatorname{tr} A = 0 \} = \operatorname{null}(\operatorname{tr}) = n^2 - 1. \] (For \( F = \mathbb{R} \) or \( \mathbb{C} \) this space is the Lie algebra \( \mathfrak{sl}_n \).) - Let \( V \) be finite-dimensional and \( T : V \to V \) linear. Prove that \( T \) is injective if and only if \( T \) is surjective. Then give an explicit example showing both implications fail when \( V \) is infinite-dimensional.
Solution
Injective \( \Rightarrow \) surjective: injectivity of a linear map means \( \ker T = \{0\} \) (if \( T(v) = T(w) \) then \( T(v - w) = 0 \)), so \( \operatorname{null} T = 0 \) and rank–nullity gives \( \operatorname{rank} T = \dim V \). Thus \( \operatorname{im} T \) is a subspace of \( V \) of full dimension, hence \( \operatorname{im} T = V \) (a proper subspace of a finite-dimensional space has strictly smaller dimension, since a basis of the subspace could otherwise be a basis of the whole space). Surjective \( \Rightarrow \) injective: \( \operatorname{rank} T = \dim V \) forces \( \operatorname{null} T = 0 \), and a linear map with zero kernel is injective. Infinite-dimensional failure: on \( V = \mathbb{R}[x] \), the map \( p \mapsto x\,p \) is injective but not surjective (nothing maps to \( 1 \)), while differentiation \( p \mapsto p' \) is surjective but not injective (constants die). - Let \( V \) be finite-dimensional and \( T : V \to V \) linear with \( T^2 = 0 \). Prove that \( \operatorname{rank} T \le \frac{1}{2} \dim V \). Deduce that there is no linear map \( T : \mathbb{R}^5 \to \mathbb{R}^5 \) with \( \operatorname{im} T = \ker T \), but exhibit one on \( \mathbb{R}^4 \).
Solution
\( T^2 = 0 \) means \( T(T(v)) = 0 \) for all \( v \), i.e. \( \operatorname{im} T \subseteq \ker T \). Taking dimensions, \( \operatorname{rank} T \le \operatorname{null} T \). Rank–nullity gives \( \operatorname{null} T = \dim V - \operatorname{rank} T \), so \( \operatorname{rank} T \le \dim V - \operatorname{rank} T \), i.e. \( 2 \operatorname{rank} T \le \dim V \), as required. If \( \operatorname{im} T = \ker T \) then \( \operatorname{rank} T = \operatorname{null} T \), so rank–nullity reads \( 2 \operatorname{rank} T = \dim V \): the dimension must be even, ruling out \( \mathbb{R}^5 \). On \( \mathbb{R}^4 \) take \( T(e_1) = T(e_2) = 0 \), \( T(e_3) = e_1 \), \( T(e_4) = e_2 \); then \( \ker T = \operatorname{span}(e_1, e_2) \) (the matrix has two pivot columns, so nullity \( = 4 - 2 = 2 \), and \( e_1, e_2 \) are visibly in the kernel) and \( \operatorname{im} T = \operatorname{span}(e_1, e_2) \) as well, so \( \operatorname{im} T = \ker T \). - (Sylvester's rank inequality.) Let \( U, V, W \) be finite-dimensional, and let \( T : U \to V \) and \( S : V \to W \) be linear. Prove
\[ \operatorname{rank}(S T) \ \ge \ \operatorname{rank} S + \operatorname{rank} T - \dim V. \]
Solution
Let \( S' : \operatorname{im} T \to W \) be the restriction of \( S \) to the subspace \( \operatorname{im} T \subseteq V \); it is linear, its domain has dimension \( \operatorname{rank} T \), and its image is \( S(\operatorname{im} T) = \operatorname{im}(ST) \). Its kernel is \( \ker S' = \ker S \cap \operatorname{im} T \). Applying rank–nullity to \( S' \): \[ \operatorname{rank} T = \dim \operatorname{im}(ST) + \dim ( \ker S \cap \operatorname{im} T ) = \operatorname{rank}(ST) + \dim( \ker S \cap \operatorname{im} T ). \] Now \( \ker S \cap \operatorname{im} T \subseteq \ker S \), so \( \dim(\ker S \cap \operatorname{im} T) \le \operatorname{null} S \), and rank–nullity applied to \( S \) itself gives \( \operatorname{null} S = \dim V - \operatorname{rank} S \). Combining, \[ \operatorname{rank}(ST) = \operatorname{rank} T - \dim(\ker S \cap \operatorname{im} T) \ \ge \ \operatorname{rank} T - ( \dim V - \operatorname{rank} S ) = \operatorname{rank} S + \operatorname{rank} T - \dim V, \] which is the claim. (Equality holds exactly when \( \ker S \subseteq \operatorname{im} T \).) Note the theorem was used twice: once for the restricted map \( S' \), once for \( S \).