2.3  The Rank–Nullity Theorem

The examples of the last section kept producing the same coincidence. Differentiation R[x]≤3→R[x]≤2 has a kernel of dimension 1 and an image of dimension 3, and 1+3=4=dim⁡R[x]≤3. The trace on M2(R) gives 3+1=4 again. This section proves that the same equation holds for every linear map on a finite-dimensional space, with no matrices at all, and then turns it into the most useful counting tool of the chapter. Chapter 3 meets the equation again for matrices, counted a different way.

2.3.1. Rank and nullity

The two numbers in the equation are dimensions of the two subspaces of Definition 2.2.1 and Definition 2.2.2, so they are defined whenever those subspaces are finite-dimensional.

Definition 2.3.1 (Nullity)

Let T:V→W be a linear map with kerT finite-dimensional. The nullity of T is nullityT:=dim⁡kerT.

Definition 2.3.2 (Rank)

Let T:V→W be a linear map with imT finite-dimensional. The rank of T is rankT:=dim⁡imT.

If V is finite-dimensional, both numbers are defined: kerT is a subspace of V, hence finite-dimensional (Theorem 1.6.7), and imT is finite-dimensional by Theorem 2.2.4. The nullity counts the independent directions that T destroys; the rank counts the independent directions that survive in the output.

Example (Rank and Nullity in Examples)

Find the nullity and rank of (a) differentiation D:R[x]≤3→R[x]≤2; (b) the zero map and the identity on a space of dimension n.

Solution.

A non-example. The integration map J:R[x]→R[x] of Example (Integration) has nullity 0, but its image contains the independent list (x,x2,…,xk) for every k, so the image is not finite-dimensional (Theorem 1.6.3) and rankJ is not defined. What separates J from the examples above is that its domain is infinite-dimensional.

2.3.2. The theorem

We want to prove that for every linear T:V→W with V finite-dimensional, dim⁡kerT+dim⁡imT=dim⁡V. This is a dimension formula, so we look for the proof pattern that proved the last one, the Dimension Formula for Sums (Theorem 1.7.3): take a basis of the smallest space, extend it, make a Big Claim about the vectors that were added, and count. Which space is the smallest? The kernel lives in V and the image lives in W, different spaces that cannot be compared. The only inclusion available is kerT⊆V. So we start with a basis of kerT and extend it to a basis of V. The image has to be reached by applying T, and the kernel vectors contribute nothing when we do. So the natural candidate for a basis of imT is the images of the added vectors.

Theorem 2.3.1 (Rank–Nullity Theorem)

Let V be a finite-dimensional vector space, let W be any vector space over the same field, and let T:V→W be linear. Then kerT and imT are finite-dimensional, and nullityT+rankT=dim⁡V.

Diagram. Labels: V, ker T, u_1, dots , u_k, v_1, dots , v_r, W, im T, Tv_1, dots , Tv_r, \0, T, T kills the u 's

Idea. The picture is the whole proof. The u’s all go to 0; the v’s carry everything else.

① Take a basis (u1,…,uk) of kerT, the smallest space in sight. ② Extend it to a basis (u1,…,uk,v1,…,vr) of V (Basis Extension). ③ Big Claim: (Tv1,…,Tvr) is a basis of imT. Spanning: apply T to a general vector of V; the u-terms die because they are in the kernel. Independence: the only way to use linearity is backwards, turning ∑bjTvj=0 into T(∑bjvj)=0. Then ∑bjvj is in the kernel, where the u’s are a basis, and the big basis of V finishes it. ④ Count: dim⁡V=k+r=nullityT+rankT.

This is the move of Theorem 1.7.3: basis of the smallest space, extend, Big Claim, count. The new ingredient is that the Big Claim is about the images of the added vectors.

Proof. Step 1: bases. By Theorem 2.2.1, kerT is a subspace of V. Since V is finite-dimensional, so is kerT (Theorem 1.6.7), and it has a basis (u1,…,uk) with k=nullityT (Corollary 1.5.5). This list is linearly independent in V, so by the Basis Extension Theorem (Theorem 1.6.5) there are v1,…,vr∈V such that (u1,…,uk,v1,…,vr) is a basis of V. Thus dim⁡V=k+r.

Step 2: the Big Claim.

Claim. The list (Tv1,…,Tvr) is a basis of imT.

Proof. Spanning. By Theorem 2.2.4 applied to the basis of Step 1, imT=span(Tu1,…,Tuk,Tv1,…,Tvr). Each Tui=0, since ui∈kerT, and deleting a zero vector from a list does not change its span, because 0 lies in every span (Theorem 1.3.5). Hence imT=span(Tv1,…,Tvr).

Independence. Let b1,…,br∈F satisfy b1Tv1+⋯+brTvr=0. By Theorem 2.1.4, T(b1v1+⋯+brvr)=0, so b1v1+⋯+brvr∈kerT. Since (u1,…,uk) spans kerT, there are a1,…,ak∈F with b1v1+⋯+brvr=a1u1+⋯+akuk. Rearranging, (−a1)u1+⋯+(−ak)uk+b1v1+⋯+brvr=0. This is a combination of the basis (u1,…,uk,v1,…,vr) of V, which is linearly independent, so all its coefficients are 0. In particular b1=⋯=br=0. Hence (Tv1,…,Tvr) is linearly independent.

Step 3: count. By the claim, imT has a basis of length r, so it is finite-dimensional with rankT=r (Definition 1.6.1). Therefore nullityT+rankT=k+r=dim⁡V, as claimed.

The proof reads correctly when k=0 (injective T: the v’s are a basis of V) and when r=0 (kerT=V: the claim says imT has the empty basis). Notice what was not used: nothing about W beyond its being a vector space. The theorem counts only in the domain.

Applied to the matrix map TA:Fn→Fm, the theorem says nullityTA+rankTA=n. In particular, the solutions of a homogeneous system Ax=0 in n unknowns form a subspace of dimension n−rankTA, whatever method is used to find the rank. Chapter 3 proves this equation a second way, by counting the free and pivot columns of a reduced matrix; here we counted basis vectors, and no row operation appeared.

In the online version you can test the count on any matrix map.

from sympy import Matrix

A = Matrix([
    [1, 2, 0, 3],
    [2, 4, 1, 8],
    [-1, -2, 1, -1],
])
rank = A.rank()                  # dim im T_A
nullity = len(A.nullspace())     # dim ker T_A: length of a basis of the kernel
print("rank =", rank, " nullity =", nullity, " dim of domain =", A.cols)
rank + nullity == A.cols

2.3.3. Count instead of check

Rank–Nullity links the two questions of the last section. Injectivity is about the kernel, surjectivity about the image, and the theorem says the two dimensions add up to a fixed number. So one controls the other.

Corollary 2.3.2 (Consequences of Rank–Nullity)

Let V and W be finite-dimensional vector spaces over F, and let T:V→W be linear.

  • (a) T is injective if and only if rankT=dim⁡V.
  • (b) T is surjective if and only if rankT=dim⁡W.
  • (c) If dim⁡V>dim⁡W, then T is not injective.
  • (d) If dim⁡V<dim⁡W, then T is not surjective.
  • (e) If dim⁡V=dim⁡W, then T is injective ⟺ T is surjective ⟺ T is bijective.

Proof.

  • (a) By Theorem 2.2.3, T is injective if and only if kerT={0}. A finite-dimensional space is {0} exactly when its dimension is 0, because the empty list is a basis of {0} and a basis of length 0 spans only {0}. So T is injective if and only if nullityT=0, which by Theorem 2.3.1 means rankT=dim⁡V.

  • (b) If T is surjective, then imT=W (Theorem 2.2.2), so rankT=dim⁡W. Conversely, if rankT=dim⁡W, then imT is a subspace of W of the same dimension, so imT=W by Theorem 1.6.8, and T is surjective.

  • (c) Since imT is a subspace of W, rankT≤dim⁡W<dim⁡V by Theorem 1.6.7. By (a), T is not injective.

  • (d) By Theorem 2.3.1, rankT=dim⁡V−nullityT≤dim⁡V<dim⁡W. By (b), T is not surjective.

  • (e) If dim⁡V=dim⁡W, then (a) and (b) have the same right-hand side, so T is injective if and only if it is surjective. Hence either property gives both, which is bijectivity; and bijective maps are injective by definition.

Part (e) is the linear version of the pigeonhole principle for finite sets (Theorem 0.4.9), with dimension in place of the number of elements. It is a count instead of check: to show that a map between spaces of the same finite dimension is bijective, check only the kernel, usually the easier half, and let the count supply surjectivity. For TA with A square, it says that if Ax=0 has only the trivial solution then Ax=b is solvable for every b; Chapter 3 puts that equivalence at the center of its account of square systems. Parts (c) and (d) are the linear version of “no injection from a bigger finite set into a smaller one, and no surjection the other way”.

Warning. Both finiteness and equal dimension are needed. Rank–Nullity requires V to be finite-dimensional; W may be anything, as for the inclusion R[x]≤2→R[x], with nullity 0 and rank 3. Part (e) fails when the spaces are infinite-dimensional, even for an operator V→V: the right shift R on FN is injective but not surjective, and the left shift L is surjective but not injective (Example (The Shifts: Injective but Not Surjective, and Conversely)). And the hypothesis dim⁡V=dim⁡W cannot be dropped: T(x,y)=(2x−y, x+y, x−y) from R2 to R3 is injective but not surjective.

Quick check. Answer each question with a count.

  • (a) Can a linear map R5→R2 be injective?
  • (b) Is there a linear map T:R6→R4 with nullityT=1?
  • (c) A linear operator T on R[x]≤3 satisfies kerT={0}. Must T be surjective?

Solution.

  • (a) No, by Corollary 2.3.2 (c): 5>2. Concretely, the rank is at most 2, so the nullity is at least 3.

  • (b) No. By Theorem 2.3.1 the rank would be 6−1=5, but imT⊆R4 has dimension at most 4.

  • (c) Yes. The domain and codomain are both R[x]≤3, of dimension 4, and T is injective, so it is surjective by Corollary 2.3.2 (e).

2.3.4. Existence with conditions on derivatives

The same argument works when some conditions are on derivatives, where no Vandermonde matrix is at hand.

Example (Prescribing Values and Slopes)

Show that for all a,b,c,d∈R there is exactly one p∈R[x]≤3 with p(0)=a,p(1)=b,p′(0)=c,p′(1)=d. Hence find the cubic that rises from 0 at x=0 to 1 at x=1 with slope 0 at both ends.

Solution. Define T:R[x]≤3→R4 by T(p)=(p(0), p(1), p′(0), p′(1)). Each entry is linear in p: evaluation respects sums and scalar multiples (Theorem 0.8.5), and so does differentiation (Example (Differentiation)). Hence T is linear by Theorem 2.1.3.

Kernel. Let p=c0+c1x+c2x2+c3x3 with T(p)=0. Then p(0)=c0=0 and p′(0)=c1=0. So p=c2x2+c3x3, and the remaining conditions read p(1)=c2+c3=0,p′(1)=2c2+3c3=0. Subtracting twice the first from the second gives c3=0, and then c2=0. Hence kerT={0}.

Count. dim⁡R[x]≤3=4=dim⁡R4, so T is bijective by Corollary 2.3.2 (e). Surjectivity is existence for every (a,b,c,d), and injectivity is uniqueness.

For the data (0,1,0,0), try p=αx2+βx3, which already has p(0)=p′(0)=0. Then p(1)=α+β=1 and p′(1)=2α+3β=0 give β=−2 and α=3. So p=3x2−2x3; by uniqueness it is the only such cubic.

2.3.5. Dimensions of subspaces cut out by conditions

Many subspaces are defined as “all vectors satisfying some linear conditions”, which is to say as the kernel of a linear map. If the map is surjective, Rank–Nullity gives the dimension of the kernel at once, and surjectivity is often easy to see.

Example (Dimension of a Kernel from a Surjective Map)

Find the dimension of each subspace.

Solution.

Without the theorem, (a) needs an explicit basis of n2−1 matrices together with a proof of independence and spanning. With it, one matrix of trace 1 is enough.

2.3.6. Exercises

A. Check your understanding

Exercise (A1)
  • (a) Define the rank and the nullity of a linear map.
  • (b) State the Rank–Nullity Theorem, with its hypotheses.
  • (c) True or false: there is an injective linear map R4→R3. Justify your answer.
  • (d) True or false: if V is finite-dimensional and T:V→V is linear with imT=V, then T is injective. Justify your answer.
  • (e) True or false: every injective linear map FN→FN is surjective. Justify your answer.
  • (f) Name the four steps of the proof of Rank–Nullity.

Solution.

  • (a) See Definition 2.3.1 and Definition 2.3.2: nullityT=dim⁡kerT and rankT=dim⁡imT, when these are finite-dimensional.

  • (b) See Theorem 2.3.1: if V is finite-dimensional and T:V→W is linear, then nullityT+rankT=dim⁡V.

  • (c) False. 4>3, so no linear map R4→R3 is injective (Corollary 2.3.2 (c)).

  • (d) True. T is surjective, and its domain and codomain are the same finite-dimensional space, so T is injective by Corollary 2.3.2 (e).

  • (e) False. The right shift R is injective but not surjective (Example (The Shifts: Injective but Not Surjective, and Conversely)). The count fails because FN is not finite-dimensional.

  • (f) Take a basis of kerT; extend it to a basis of V; prove the Big Claim that the images of the added vectors form a basis of imT (spanning, then independence); count.

B. Practice

Exercise (B1: Verifying Rank–Nullity)

For each map, find a basis of the kernel and a basis of the image, and verify that nullityT+rankT=dim⁡V.

  • (a) T:R[x]≤3→R2, T(p)=(p(0),p(1)).
  • (b) T:M2(R)→M2(R), T(A)=A+A⊤.

Solution.

  • (a) T is linear by Theorem 0.8.5. Kernel: for p=a0+a1x+a2x2+a3x3, T(p)=0 means a0=0 and a1+a2+a3=0, that is, p=a2(x2−x)+a3(x3−x). The list (x2−x,x3−x) spans kerT, and it is independent by Theorem 1.4.4, so it is a basis. Image: T(1)=(1,1) and T(x)=(0,1) are independent, so they span a 2-dimensional subspace of R2, which is R2 (Theorem 1.6.8). So imT=R2 with basis ((1,1),(0,1)). Hence 2+2=4=dim⁡R[x]≤3.

  • (b) T is linear because the transpose is (Example (Trace and Transpose)). Kernel: A+A⊤=0 means a11=a22=0 and a21=−a12, so kerT=span(E12−E21), with basis (E12−E21). Image: each A+A⊤ is symmetric, since (A+A⊤)⊤=A⊤+A, and each symmetric B equals T(12B). So imT is the space of symmetric matrices, with basis (E11,E22,E12+E21) (as in Exercise (B2: Kernels and Images Beyond Fn)). Hence 1+3=4=dim⁡M2(R).

Exercise (B2: Bijective by the Kernel Alone)

Let n≥0 and T:R[x]≤n→R[x]≤n, T(p)=p+xp′.

  • (a) Show that T is a linear map into R[x]≤n and that kerT={0}. Deduce that T is bijective.
  • (b) Hence show that there is exactly one p∈R[x]≤2 with p+xp′=1+x+x2, and find it.

Solution.

  • (a) For p=∑k=0nakxk, xp′=∑k=1nkakxk, so T(p)=∑k=0n(1+k)akxk∈R[x]≤n. Linearity: T(cp+q)=(cp+q)+x(cp′+q′)=c(p+xp′)+(q+xq′)=cT(p)+T(q), using Example (Differentiation). If T(p)=0, then (1+k)ak=0 for each k; since 1+k≠0 in R, every ak=0. So kerT={0}, and T is injective (Theorem 2.2.3). Domain and codomain have the same finite dimension n+1, so T is bijective by Corollary 2.3.2 (e).

  • (b) With n=2, surjectivity gives a solution and injectivity makes it unique. By the formula in (a), T(a0+a1x+a2x2)=a0+2a1x+3a2x2, so we need a0=1, 2a1=1, 3a2=1. Hence p=1+12x+13x2. Check: xp′=12x+23x2, and p+xp′=1+x+x2.

Exercise (B3: A Dimension via a Surjective Map)

Let U={p∈R[x]≤4:p(1)=p(2)=0}. Use a surjective linear map to show that dim⁡U=3. Hence find a basis of U.

Solution. Define T:R[x]≤4→R2, T(p)=(p(1),p(2)). It is linear by Theorem 0.8.5, and U=kerT. Its image contains T(1)=(1,1) and T(x)=(1,2), which are independent, so imT is a 2-dimensional subspace of R2 and equals R2 (Theorem 1.6.8). Thus rankT=2, and by Theorem 2.3.1, dim⁡U=5−2=3.

The polynomials (x−1)(x−2), x(x−1)(x−2) and x2(x−1)(x−2) vanish at 1 and 2 and have degrees 2,3,4≤4, so they lie in U. They are non-zero of distinct degrees, hence independent (Theorem 1.4.4). There are 3=dim⁡U of them, so they form a basis of U (Theorem 1.6.4).

C. Going deeper

Exercise (C1: A Lower Bound for the Rank of a Composite)

Let U and V be finite-dimensional, let W be a vector space, all over F, and let T:U→V and S:V→W be linear. Write ST for the composite S∘T, which is linear (see the note before Exercise (C1: Kernels and Images of a Composite)). Let S′:imT→W be the restriction of S to imT, that is, S′(v)=S(v) for v∈imT.

  • (a) Show that S′ is linear, that imS′=im(ST) and that kerS′=kerS∩imT.
  • (b) Deduce that rank(ST)=rankT−dim⁡(kerS∩imT).
  • (c) Hence prove Sylvester’s inequality: rank(ST)≥rankS+rankT−dim⁡V.

Hint: for (c), compare kerS∩imT with kerS.

Solution.

  • (a) S′ satisfies (LT1) and (LT2) because S does and imT is a subspace (Theorem 2.2.2) with the operations of V. A vector w lies in imS′ exactly when w=S(v) with v=T(u) for some u∈U, that is, when w=ST(u); so imS′=im(ST). A vector v∈imT lies in kerS′ exactly when S(v)=0; so kerS′=kerS∩imT.

  • (b) imT is finite-dimensional with dim⁡imT=rankT, since U is finite-dimensional (Theorem 2.2.4). By Theorem 2.3.1 applied to S′:imT→W and by (a), rankT=dim⁡kerS′+dim⁡imS′=dim⁡(kerS∩imT)+rank(ST).

  • (c) kerS∩imT is a subspace of kerS, so dim⁡(kerS∩imT)≤nullityS=dim⁡V−rankS, by Theorem 1.6.7 and Theorem 2.3.1 for S. Substituting into (b), rank(ST)≥rankT−(dim⁡V−rankS)=rankS+rankT−dim⁡V.

Exercise (C2: When the Kernel Equals the Image)

Let V be finite-dimensional and T:V→V linear with kerT=imT.

  • (a) Prove that dim⁡V is even.
  • (b) Give an example of such a T on R2, and one on R4.
  • (c) Is there such a T on R3? Justify your answer.

Solution.

  • (a) By Theorem 2.3.1, dim⁡V=nullityT+rankT=dim⁡kerT+dim⁡imT=2dim⁡imT, which is even.

  • (b) On R2, let T(x,y)=(y,0). Then T(x,y)=0 exactly when y=0, so kerT is the x-axis; and the outputs (y,0) fill the x-axis, so imT is the x-axis too. On R4, let T(x1,x2,x3,x4)=(x2,0,x4,0). Its kernel is {x2=x4=0}=span(e1,e3), and its image is {(a,0,b,0)}=span(e1,e3). Both maps are matrix maps, hence linear.

  • (c) No. By (a), dim⁡V would be even, but dim⁡R3=3.

Found a typo or a mistake? Report it, or read this page’s source

The text of this book is licensed under CC BY-NC-SA 4.0.