Tutorials › Linear Algebra › The Rank-Nullity Theorem for Linear Maps

Linear Maps Between Vector Spaces · Tutorial 410 of 1000

The Rank-Nullity Theorem for Linear Maps

Learn why the domain’s dimension splits into the dimensions of the kernel and image, and how extending a kernel basis proves the result.

Intermediate 11 min read

What You'll Learn

  • State rank-nullity with its finite-dimensional domain hypothesis.
  • Extend a basis of the kernel to a basis of the domain.
  • Prove that the added basis vectors map to a basis of the image.
  • Distinguish the dimension of the image from the dimension of the codomain.
  • Apply the theorem to maps on coordinate, polynomial, and matrix spaces.
  • Check the dimension count using explicit kernel and image bases.

Why the Domain Splits into Two Parts

A linear map can send some vectors to zero and send others to nonzero vectors. The vectors sent to zero form the kernel; the outputs the map can produce form the image. The Rank-Nullity Theorem says that, when the domain is finite-dimensional, its dimension is exactly the sum of the dimensions of these two subspaces. The theorem is more than a counting rule: its proof explains how directions in the domain divide into those lost by the map and those that produce independent outputs.

Let \(\mathbb{F}\) be either \(\mathbb{R}\) or \(\mathbb{C}\), and let \(T:V\to W\) be a linear map between vector spaces over \(\mathbb{F}\). Linearity means \(T(a\mathbf{v}+b\mathbf{u})=aT(\mathbf{v})+bT(\mathbf{u})\) for all \(\mathbf{u},\mathbf{v}\in V\) and \(a,b\in\mathbb{F}\). The kernel and image are the subspaces

$$ \ker T=\{\mathbf{v}\in V:T(\mathbf{v})=\mathbf{0}\}, \qquad \operatorname{im}T=\{T(\mathbf{v}):\mathbf{v}\in V\}\subseteq W. $$

A basis is a linearly independent list that spans its space, and the dimension of a finite-dimensional space is the number of vectors in any basis. The kernel and image are subspaces, so their dimensions are defined when they are finite-dimensional. For a map with finite-dimensional domain, both are finite-dimensional: the kernel is a subspace of the domain, and the image is spanned by the images of any finite basis of the domain.

Theorem (Rank-Nullity Theorem): Let \(T:V\to W\) be a linear map over \(\mathbb{F}\), where \(V\) is finite-dimensional. Then $$ \dim V=\dim(\ker T)+\dim(\operatorname{im}T). $$ The dimension \(\dim(\ker T)\) is called the nullity of \(T\), and \(\dim(\operatorname{im}T)\) is called the rank of \(T\).

The Basis-Extension Idea

The proof begins with a basis of the kernel. Extend that list to a basis of the entire domain. The added vectors account for everything in the domain not already represented by kernel directions. Their images span the image, because every domain vector is a combination of the full basis and the kernel-basis vectors map to zero. More importantly, their images are independent: a combination of them that maps to zero would itself belong to the kernel, contradicting independence of the extended basis unless all its coefficients were zero.

We use the standard basis-extension fact for finite-dimensional spaces: a basis of a subspace can be extended to a basis of the whole space. Here is why the fact applies. If \(V\) has a basis of \(n\) vectors, then any linearly independent list in \(V\) has at most \(n\) vectors. Indeed, write the vectors as coordinate columns in the chosen basis. Their coordinate matrix has trivial null space, because a linear combination of the columns is zero exactly when the same combination of the original vectors is zero. By the pivot test for independence, every column must be a pivot column, and an \(n\)-row matrix has at most \(n\) pivots. Thus the list has at most \(n\) vectors. Starting with a basis of a subspace, append a vector outside its span whenever one exists. Each addition preserves independence, and the process must stop after at most \(n\) vectors. When it stops, the list spans the whole space. In particular, a subspace of \(V\) has a finite basis, and any such basis extends to a basis of \(V\).

Proof of the Rank-Nullity Theorem

Proof. Since \(\ker T\) is a subspace of the finite-dimensional space \(V\), choose a basis \((\mathbf{k}_1,\dots,\mathbf{k}_r)\) of \(\ker T\). By the basis-extension fact, extend it to a basis of \(V\), writing that basis as \((\mathbf{k}_1,\dots,\mathbf{k}_r,\mathbf{u}_1,\dots,\mathbf{u}_s)\). The first \(r\) vectors form a basis of the kernel, so \(\dim(\ker T)=r\). The full basis has \(r+s\) vectors, so \(\dim V=r+s\).

We show that \((T(\mathbf{u}_1),\dots,T(\mathbf{u}_s))\) is a basis of \(\operatorname{im}T\). To show it spans, take any \(\mathbf{y}\in\operatorname{im}T\). By definition, \(\mathbf{y}=T(\mathbf{v})\) for some \(\mathbf{v}\in V\). Express \(\mathbf{v}\) in the basis of \(V\): $$ \mathbf{v}=\sum_{i=1}^{r}a_i\mathbf{k}_i+\sum_{j=1}^{s}b_j\mathbf{u}_j. $$ Linearity and \(T(\mathbf{k}_i)=\mathbf{0}\) give $$ \mathbf{y}=T(\mathbf{v})=\sum_{j=1}^{s}b_jT(\mathbf{u}_j), $$ so the listed images span \(\operatorname{im}T\).

To show independence, suppose \(\sum_{j=1}^{s}c_jT(\mathbf{u}_j)=\mathbf{0}\). By linearity, \(T(\sum_{j=1}^{s}c_j\mathbf{u}_j)=\mathbf{0}\), so \(\sum_{j=1}^{s}c_j\mathbf{u}_j\in\ker T\). Because \((\mathbf{k}_1,\dots,\mathbf{k}_r)\) spans the kernel, there are scalars \(d_1,\dots,d_r\) such that $$ \sum_{j=1}^{s}c_j\mathbf{u}_j=\sum_{i=1}^{r}d_i\mathbf{k}_i. $$ Rearranging gives a linear combination of the basis of \(V\) equal to zero: $$ \sum_{i=1}^{r}(-d_i)\mathbf{k}_i+\sum_{j=1}^{s}c_j\mathbf{u}_j=\mathbf{0}. $$ The basis of \(V\) is linearly independent, so every coefficient is zero, in particular \(c_1=\cdots=c_s=0\). The image list is therefore a basis of \(\operatorname{im}T\), and \(\dim(\operatorname{im}T)=s\). Hence $$ \dim V=r+s=\dim(\ker T)+\dim(\operatorname{im}T). $$ If \(r=0\) or \(s=0\), the corresponding list is empty and the same argument applies: an empty basis spans the zero space, and the displayed sums over that list are zero. Thus the conclusion also covers a zero kernel or a zero image. \(\square\)

Worked Applications of the Dimension Count

Worked Example: A Map from \(\mathbb{R}^3\) to \(\mathbb{R}^2\)

Define \(T:\mathbb{R}^3\to\mathbb{R}^2\) by \(T(x,y,z)=(x+y,y+z)\). Find bases of its kernel and image, then check the dimension equation.

To find the kernel, solve \(T(x,y,z)=(0,0)\). The equations are \(x+y=0\) and \(y+z=0\), so \(x=-y\) and \(z=-y\). Taking \(y=t\) gives \((x,y,z)=t(-1,1,-1)\). Thus \(\ker T\) has basis \(((-1,1,-1))\) and dimension \(1\). Check: \(T(-1,1,-1)=(0,0)\).

For the image, \(T(1,0,0)=(1,0)\) and \(T(0,0,1)=(0,1)\). These outputs span \(\mathbb{R}^2\), since every \((a,b)\) equals \(a(1,0)+b(0,1)\), and they are independent: \(a(1,0)+b(0,1)=(0,0)\) forces \(a=b=0\). Hence they form an image basis and \(\dim(\operatorname{im}T)=2\). The dimension check is \(3=1+2\), as required.

Check: For any \((x,y,z)\), \(T(x,y,z)=(x+y,y+z)=(x+y)(1,0)+(y+z)(0,1)\), confirming that the stated image basis spans every output.

Worked Example: Differentiation on \(\mathcal{P}_3\)

Let \(\mathcal{P}_3\) be the real vector space of polynomials of degree at most \(3\), including the zero polynomial, and let \(D:\mathcal{P}_3\to\mathcal{P}_2\) be \(D(p)=p'\). Find the kernel and image dimensions.

Write \(p(x)=a+bx+cx^2+dx^3\). Then \(D(p)=b+2cx+3dx^2\). The derivative is the zero polynomial exactly when \(b=0\), \(2c=0\), and \(3d=0\), which over \(\mathbb{R}\) means \(b=c=d=0\). Therefore \(\ker D\) consists of the constant polynomials and has basis \((1)\), so its dimension is \(1\).

The space \(\mathcal{P}_2\) has basis \((1,x,x^2)\). The derivatives of the domain basis \((1,x,x^2,x^3)\) are $$ D(1)=0,\qquad D(x)=1,\qquad D(x^2)=2x,\qquad D(x^3)=3x^2. $$ The nonzero outputs \(1,2x,3x^2\) span \(\mathcal{P}_2\): for \(A+Bx+Cx^2\), the polynomial is \(A\cdot1+\frac{B}{2}(2x)+\frac{C}{3}(3x^2)\). They are independent because the coefficients of \(1,x,x^2\) in a zero combination must each vanish. Thus the image has dimension \(3\). Since \(\dim\mathcal{P}_3=4\), the theorem gives \(4=1+3\).

Check: Differentiating the stated preimage \(A x+\frac{B}{2}x^2+\frac{C}{3}x^3\) gives \(A+Bx+Cx^2\), so every element of the claimed image is attained.

Worked Example: The Trace Map on \(2\times2\) Matrices

Define \(S:\mathbb{R}^{2\times2}\to\mathbb{R}\) by \(S(\mathbf{A})=\operatorname{tr}\mathbf{A}\), the sum of the diagonal entries. Exhibit bases that verify rank-nullity.

Write \(\mathbf{A}=\begin{bmatrix}a&b\\c&d\end{bmatrix}\). Then \(S(\mathbf{A})=a+d\), so the kernel condition is \(d=-a\). Every kernel element has the form $$ \begin{bmatrix}a&b\\c&-a\end{bmatrix} =a\begin{bmatrix}1&0\\0&-1\end{bmatrix} +b\begin{bmatrix}0&1\\0&0\end{bmatrix} +c\begin{bmatrix}0&0\\1&0\end{bmatrix}. $$ These three matrices span the kernel. They are independent because a zero linear combination has entries \(a,b,c\) in the upper-left, upper-right, and lower-left positions, forcing all three coefficients to be zero. Thus the kernel dimension is \(3\).

The map takes \(\begin{bmatrix}1&0\\0&0\end{bmatrix}\) to \(1\), so its image contains \(1\) and therefore equals \(\mathbb{R}\); the image dimension is \(1\). The four matrices with a single \(1\) in one position and zeros elsewhere form a basis of \(\mathbb{R}^{2\times2}\), so the domain dimension is \(4\). The equation is \(4=3+1\).

Check: The displayed three kernel basis matrices each have trace zero. Also, every real number \(r\) is the trace of \(\begin{bmatrix}r&0\\0&0\end{bmatrix}\), verifying the image claim.

What the Theorem Does—and Does Not—Count

Rank-nullity counts dimensions in the domain. The image is a subspace of the codomain, but it need not be the whole codomain, so its dimension is not automatically the codomain dimension. The theorem also requires a finite-dimensional domain. Its proof uses a finite basis of \(V\), extends a kernel basis within that finite list of dimensions, and counts the resulting image basis. No assumption that \(W\) is finite-dimensional is needed: the image is spanned by the images of a finite basis of \(V\), so it is finite-dimensional regardless.

A common mistake is to substitute the codomain dimension for the image dimension. For example, let \(Z:\mathbb{R}^3\to\mathbb{R}^4\) be the zero map, \(Z(\mathbf{x})=\mathbf{0}\). The incorrect calculation \(3=0+4\) uses the codomain dimension \(4\) as though it were the image dimension. In fact, \(\ker Z=\mathbb{R}^3\) has dimension \(3\), while \(\operatorname{im}Z=\{\mathbf{0}\}\) has dimension \(0\); the correct equation is \(3=3+0\). The image consists only of the zero vector, not all of \(\mathbb{R}^4\).

The basis proof also explains why the two terms are complementary in the dimension count without asserting that the kernel and image are subspaces of the same space: the kernel is in \(V\), and the image is in \(W\). The vectors \(\mathbf{u}_j\) lie in the domain, while their images \(T(\mathbf{u}_j)\) provide a basis of the output space. This distinction is useful whenever a map is described by a formula rather than by a square matrix.

Check Your Understanding

Use bases and the theorem’s hypotheses to support each conclusion.

  1. In the proof, why must the images \(T(\mathbf{u}_1),\dots,T(\mathbf{u}_s)\) span the image?
  2. Why does \(\sum_j c_jT(\mathbf{u}_j)=\mathbf{0}\) imply that every \(c_j=0\)?
  3. A linear map has a \(5\)-dimensional domain and a \(2\)-dimensional kernel. What is the dimension of its image?
  4. For the zero map from \(\mathbb{R}^2\) to \(\mathbb{R}^5\), state the kernel dimension, image dimension, and rank-nullity equation.
  5. Which hypothesis in the Rank-Nullity Theorem guarantees that a basis of the kernel can be extended to a finite basis of the domain?

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon