4.5.14 · D2Linear Algebra (Full)

Visual walkthrough — Rank-nullity theorem — proof

1,696 words8 min readBack to topic

We will build everything from one idea: a linear map is a machine that eats vectors from a space and spits out vectors into a space .


Step 0 — What is a vector space, a map, and a "dimension"?

WHAT. A vector space is a collection of arrows you can add and stretch. Its dimension is the number of independent directions you need to reach every arrow — like axes reaching every point in a room. See Dimension of a Vector Space.

A linear map is a machine: push in an arrow , get out an arrow . "Linear" means it respects adding and stretching — no bending.

WHY start here. Every later symbol (, , rank, nullity) is a fact about this machine. We cannot use them before we can see the machine.

PICTURE. On the left, the input room with axes. On the right, the output room . An arrow between them is the machine .

Figure — Rank-nullity theorem — proof

Step 1 — The kernel: the directions the machine crushes

WHAT. The kernel is every input arrow that comes out as the zero arrow: Its dimension is the nullity: . See Kernel and Image of a Linear Map.

WHY. Some directions of the input get flattened — the machine ignores them. We must identify them first, because they behave completely differently from the rest.

PICTURE. A whole plane (2 directions, so here imagined smaller) of input arrows all landing on the single dot in . That plane is the kernel.

Figure — Rank-nullity theorem — proof

We name a basis for this crushed part:


Step 2 — Extend to a full basis of

WHAT. The only describe the crushed part. We add fresh directions until we can reach all of :

WHY this tool. The Basis Extension Theorem promises: any basis of a subspace can be grown into a basis of the whole space. We use it because it cleanly cuts into two labelled piles — the kernel directions and the new ones — with no overlap and nothing missed. There are exactly new vectors because a basis of an -dimensional space always has elements.

PICTURE. The kernel plane (blue) plus new orange arrows poking out of that plane, together filling the whole input room.

Figure — Rank-nullity theorem — proof

Step 3 — Push the survivors through: meet the image

WHAT. Apply the machine to each survivor to get the set The image is everything the machine can produce; its dimension is the rank. See Rank of a Matrix (row vs column space).

WHY. The kernel arrows all die (), so the only things that can build outputs are these survivor-outputs. Our whole plan is: show is a basis of the image. If it is, then and the theorem falls out.

PICTURE. Orange survivors on the left map to orange output arrows on the right; the blue kernel plane collapses onto the dot .

Figure — Rank-nullity theorem — proof

To be a basis, must do two jobs: span the image (Step 4) and be independent (Step 5).


Step 4 — spans the image (every output is a mix of survivor-outputs)

WHAT. Take any output . Write its input in the full basis, then push through:

\ \xrightarrow{\ T\ }\ w=\underbrace{\sum a_i\,T(u_i)}_{=\,0\ \text{(crushed!)}}+\sum_{j=1}^{n-k} b_j\,T(v_j).$$ Because every $T(u_i)=0$, the first sum vanishes: $$w=\sum_{j=1}^{n-k} b_j\,T(v_j).$$ **WHY.** This says any output is built *only* from the $T(v_j)$ — the kernel contributes literally nothing. So $B$ reaches every point of the image: it **spans**. ✓ **PICTURE.** The input arrow $v$ splits into a blue (kernel) shadow and an orange (survivor) part; only the orange part survives to build $w$. ![[deepdives/dd-maths-4.5.14-d2-s05.png]] > [!intuition] The kernel pays no rent > When forming an output, the coefficients $a_i$ on the kernel directions are wasted — they multiply zero. Only the $b_j$ matter. That's the visual meaning of "crushed." --- ## Step 5 — $B$ is independent (the survivors don't secretly collapse) **WHAT.** Suppose some mix of survivor-outputs is zero: $$\sum_{j=1}^{n-k} c_j\,T(v_j)=0 \ \xRightarrow{\ \text{linearity}\ }\ T\!\Big(\underbrace{\sum_j c_j v_j}_{\text{some input arrow}}\Big)=0 \ \Longrightarrow\ \sum_j c_j v_j\in\ker T.$$ That input arrow is in the kernel, so it's some mix of the $u_i$: $$\sum_{j} c_j v_j=\sum_i d_i u_i \ \Longrightarrow\ \underbrace{\sum_j c_j v_j-\sum_i d_i u_i=0}_{\text{a dependence among the FULL basis}}.$$ But the full set $\{u_1,\dots,u_k,v_1,\dots,v_{n-k}\}$ is a basis — **independent** — so every coefficient is forced to $0$: $$c_1=\dots=c_{n-k}=0\quad(\text{and all }d_i=0).$$ **WHY.** A zero-combination of the $T(v_j)$ drags us *back into* the kernel; but the survivors were chosen to lie *outside* it. The only escape is all $c_j=0$ — the definition of independence. ✓ **WHY this and not "just quote independence of $v_j$":** a linear map *can* collapse independent inputs. We can't assume outputs stay independent — we had to travel into the kernel and use the full basis to prove it. This is the subtle heart of the whole theorem. **PICTURE.** Two orange survivor-outputs; the red dashed loop shows the attempted collapse, and the "pull-back arrow" shows it landing in the blue kernel, contradicting independence unless all $c_j=0$. ![[deepdives/dd-maths-4.5.14-d2-s06.png]] --- ## Step 6 — Count and conclude **WHAT.** $B=\{T(v_1),\dots,T(v_{n-k})\}$ spans (Step 4) and is independent (Step 5), so it is a **basis of the image** with exactly $n-k$ elements. Therefore $$\operatorname{rank}(T)=\underbrace{n-k}_{\dim\operatorname{im}T},\qquad \operatorname{nullity}(T)=\underbrace{k}_{\dim\ker T},$$ $$\boxed{\ \operatorname{rank}(T)+\operatorname{nullity}(T)=(n-k)+k=n=\dim V\ }.$$ **WHY.** Each input direction was sorted into exactly one pile — crushed ($k$) or kept ($n-k$). No dimension was lost or created; they were merely *labelled*. **PICTURE.** A single bar of length $n$ split into a blue segment (nullity $k$) and an orange segment (rank $n-k$) — the conservation of dimensions, drawn. ![[deepdives/dd-maths-4.5.14-d2-s07.png]] --- ## Step 7 — Edge and degenerate cases Never leave a scenario undrawn. Below, "iso" refers to [[Invertible Linear Maps and Isomorphisms]] and the free-variable count to [[Solving Linear Systems — free variables count]]. **Case A — kernel is everything ($k=n$).** The zero map $T\equiv 0$ crushes *all* of $V$. Then $\operatorname{nullity}=n$, and $B$ is **empty** (no survivors), so $\operatorname{rank}=0$. Check: $0+n=n$. ✓ An empty set is a valid basis of the zero image $\{0\}$. **Case B — kernel is trivial ($k=0$).** Nothing is crushed: $\ker T=\{0\}$, $\operatorname{nullity}=0$. Every direction survives, $\operatorname{rank}=n$. The map is **injective**, and if $\dim W=n$ too it is an isomorphism. Check: $n+0=n$. ✓ **Case C — the $2\times3$ matrix (real numbers).** $A=\begin{pmatrix}1&2&3\\2&4&6\end{pmatrix}$ as $T:\mathbb R^3\to\mathbb R^2$. Row 2 $=2\times$ row 1, so $\operatorname{rank}=1$. The theorem *hands us* $\operatorname{nullity}=3-1=2$ for free — matching the $2$ free variables in $x_1+2x_2+3x_3=0$. **PICTURE.** Three little bars of length $n$: all-blue (Case A), all-orange (Case B), and the mixed $1/2$ split (Case C). ![[deepdives/dd-maths-4.5.14-d2-s08.png]] > [!recall]- Check the edge cases yourself > Zero map on $\mathbb R^3$: nullity ::: $3$ (rank $0$). > Identity map on $\mathbb R^3$: rank ::: $3$ (nullity $0$). > Rank-1 map $\mathbb R^3\to\mathbb R^2$: nullity ::: $2$. --- ## The one-picture summary Everything at once: the input room $V$ splits into the blue **kernel** (crushed to $0$) and the orange **survivors**; the survivors map to a genuine basis of the **image** in $W$; the dimension bar shows $k+(n-k)=n$. ![[deepdives/dd-maths-4.5.14-d2-s09.png]] > [!recall]- Feynman retelling — the whole walkthrough in plain words > Think of the input space as a room with $n$ directions. Our machine $T$ does two things to those directions and nothing else. Some directions it **ignores** — push along them and the output never moves; collect all of those into a flat "kernel" pile of size $k$. The remaining $n-k$ directions I pick *outside* that pile (the basis-extension theorem lets me finish the room's basis this way). When I push those survivors through the machine, two nice things happen. First, they build **every** possible output — because any output's kernel-part multiplies zero and dies, leaving only survivor-parts. Second, they build outputs **without waste** — if some survivor-outputs cancelled, tracing back would drop us into the kernel, but survivors live outside it, so nothing cancels. So the survivor-outputs are a perfect, minimal set describing the image: their count $n-k$ *is* the rank. Add the crushed pile $k$ back in and you recover all $n$ directions. Nothing was lost, nothing was invented — the $n$ input dimensions were merely sorted into "crushed" and "kept." That sorting *is* the rank–nullity theorem. > [!mnemonic] One line to keep > **Crushed + Kept = All the input.** ($k + (n-k) = n$.) --- Parent: [[Rank-nullity theorem — proof]]