= Rank-nullity theorem
{title2=$\dim V=\dim\ker T+\dim\operatorname{im}T$}
{wiki}
The <rank-nullity theorem> accounts for the input dimensions of a <linear map>: the number of independent invisible input directions plus the number of independent reachable output directions equals the input <dimension>. For $T:V\to W$ over a <field>, with finite-dimensional <domain of a function> $V$,
$$
\boxed{\dim V=\dim\ker T+\dim\operatorname{im}T.}
$$
Here $\dim\ker T$ is the <nullity>, and $\dim\operatorname{im}T$ is the <rank of a linear map>. The <kernel> lives in the input <vector space>, while the <image of a linear map> lives in the output <vector space>. For an $m$-by-$n$ <matrix> of <matrix rank> $r$, the formula is $n=(n-r)+r$: the number of columns counts input coordinates. <Linear Algebra Done Right by Sheldon Axler (4th edition)>[Sheldon Axler, Linear Algebra Done Right, fourth edition, §3B: fundamental theorem of linear maps]{ref}
For a computed example over the <real numbers>, take
$$
A=\begin{pmatrix}1&2\\0&0\end{pmatrix},\qquad
T(x,y)=A\begin{pmatrix}x\\y\end{pmatrix}=(x+2y,0).
$$
The <kernel> is $\operatorname{span}\{(-2,1)\}$ and the <image of a linear map> is $\operatorname{span}\{(1,0)\}$. Each has <dimension> one, so the two input dimensions split as $2=1+1$. The <vector> $(3,1)$ can be written
$$
(3,1)=(1,2)+(2,-1),\qquad
T(1,2)=(5,0),\qquad T(2,-1)=(0,0).
$$
The second summand is undetectable: $T(3,1)=T(1,2)$. The picture uses the standard <dot product> to choose a visible direction perpendicular to the <kernel>; this is a convenient geometric choice, not an extra hypothesis of the <rank-nullity theorem>.
\Image[/rank-nullity-domain-decomposition.png]
{title=Two input dimensions split into one visible direction and one kernel direction}
{description=For $T(x,y)=(x+2y,0)$, the input $(3,1)$ splits into $(1,2)$ and $(2,-1)$. Both $(3,1)$ and $(1,2)$ map to $(5,0)$, while the <kernel> component maps to zero. The horizontal output line is the entire <image of a linear map>.}
This explains a practical tradeoff in a <linear system>. If $T(x_0)=b$, every other input with output $b$ is $x_0+k$ for $k\in\ker T$. The <nullity> therefore counts independent freedom in an existing solution; the <rank> counts independent reachable output directions. In the example, $T(x,y)=(3,0)$ has all solutions $(x,y)=(3-2t,t)$, while $T(x,y)=(3,1)$ has none. The <cokernel> records this failure of reachability.
For an $m$-by-$n$ <matrix>, <injectivity> requires <matrix rank> $n$, and <surjectivity> requires <matrix rank> $m$. When $m\ne n$, these conditions differ. For example, $B:\mathbb R^3\to\mathbb R^2$ with $B(x,y,z)=(x+2y,0)$ has <rank> one and <nullity> two, because $\ker B=\operatorname{span}\{(-2,1,0),(0,0,1)\}$. The input accounting is $3=2+1$, although only one of two output directions is reached.
Proof outline: extend a <basis> $k_1,\ldots,k_q$ of the <kernel> to a <basis> $k_1,\ldots,k_q,v_1,\ldots,v_r$ of $V$. Every output is a <linear combination> of $T(v_1),\ldots,T(v_r)$ because the $k_i$ vanish under $T$. If a <linear combination> of the $T(v_j)$ is zero, the corresponding combination of the $v_j$ lies in the <kernel>; <linear independence> of the full <basis> forces all its coefficients to vanish. Thus the added <basis vectors> give a <basis> of the <image of a linear map>. Counting them proves the formula.
Back to article page