Type a command or search the notes. Tab cycles completions. Up and down recall history when blank. Escape dismisses, then leaves the prompt.
MATH
[1251]

Rank-nullity

How the dimensions of the kernel and image account for the dimension of the domain.

Rank-nullity says that the dimensions of the kernel and image of a linear map add up to the dimension of its domain. This page computes both dimensions for matrices by row reduction, states the theorem for matrices and for general linear maps and uses it to classify the solution sets of Ax=bAx=b.

Computing kernel and image dimensions

[DEFINITION]

Kernel

If T:V→WT:V\to W is a linear map, its kernel is

ker⁡(T)={u∈V:T(u)=0}.\ker(T)=\{u\in V:T(u)=0\}.

The same set is also called the null space. If A∈Fm×nA\in\mathbb F^{m\times n} is regarded as the map Fn→Fm\mathbb F^n\to\mathbb F^m, then

ker⁡(A)={x∈Fn:Ax=0}.\ker(A)=\{x\in\mathbb F^n:Ax=0\}.
[DEFINITION]

Image

If T:V→WT:V\to W is a linear map, its image is

im⁡(T)={u∈W:u=T(v) for some v∈V}.\operatorname{im}(T)=\{u\in W:u=T(v)\text{ for some }v\in V\}.

The same set is also called the range. If A∈Fm×nA\in\mathbb F^{m\times n} is regarded as the map Fn→Fm\mathbb F^n\to\mathbb F^m, then

im⁡(A)={u∈Fm:u=Ax for some x∈Fn},\operatorname{im}(A)=\{u\in\mathbb F^m:u=Ax\text{ for some }x\in\mathbb F^n\},

which is the column space of AA.

[DEFINITION]

Dimension

If a vector space VV has a finite basis, then VV is finite-dimensional and its dimension, denoted dim⁡(V)\dim(V), is the common number of vectors in all bases of VV.

Geometrically, a linear map may collapse some input directions to zero (the kernel) while keeping other directions in its output (the image). Together these account for every degree of freedom in the domain.

For a matrix, row reduction records this split: free variables give the nullity and pivot columns give the rank. The following examples compute both.

[EXAMPLE]

Kernel and image bases of a matrix

Consider

A=(1012011−11121).A= \begin{pmatrix} 1&0&1&2\\ 0&1&1&-1\\ 1&1&2&1 \end{pmatrix}.

The third row is the sum of the first two. Replacing R3R_3 by R3−R1−R2R_3-R_1-R_2 therefore gives a zero row, leaving pivots in columns 11 and 22. To find the kernel, let x3=λ3x_3=\lambda_3 and x4=λ4x_4=\lambda_4. The first two equations give

x1=−λ3−2λ4,x2=−λ3+λ4.x_1=-\lambda_3-2\lambda_4, \qquad x_2=-\lambda_3+\lambda_4.

Therefore a basis for the kernel is

{(−1−110),(−2101)}.\left\{ \begin{pmatrix} -1\\-1\\1\\0 \end{pmatrix}, \begin{pmatrix} -2\\1\\0\\1 \end{pmatrix} \right\}.

The pivot positions are in columns 11 and 22, so the corresponding columns of the original matrix give a basis for the image. (Their leading coordinates also make their linear independence immediate.)

{(101),(011)}.\left\{ \begin{pmatrix} 1\\0\\1 \end{pmatrix}, \begin{pmatrix} 0\\1\\1 \end{pmatrix} \right\}.

Hence nullity⁡(A)=2\operatorname{nullity}(A)=2, rank⁡(A)=2\operatorname{rank}(A)=2 and

rank⁡(A)+nullity⁡(A)=2+2=4,\operatorname{rank}(A)+\operatorname{nullity}(A)=2+2=4,

the number of columns.

[EXAMPLE]

Kernel basis of a row-echelon matrix

Consider the row-echelon matrix

A=(1234571500016826000019370000001800000000).A= \begin{pmatrix} 1&2&3&4&5&7&1&5\\ 0&0&0&1&6&8&2&6\\ 0&0&0&0&1&9&3&7\\ 0&0&0&0&0&0&1&8\\ 0&0&0&0&0&0&0&0 \end{pmatrix}.

The leading columns are 1,4,5,71,4,5,7, so the free variables are x2,x3,x6,x8x_2,x_3,x_6,x_8. Set

x2=a,x3=b,x6=c,x8=d.x_2=a,\qquad x_3=b,\qquad x_6=c,\qquad x_8=d.

Solving Ax=0Ax=0 from the bottom non-zero row upwards gives

x7=−8d,x5=−9c+17d,x4=46c−92d,x_7=-8d,\qquad x_5=-9c+17d,\qquad x_4=46c-92d,

The fourth row gives x7=−8dx_7=-8d and substituting this into the third row gives x5=−9c+17dx_5=-9c+17d. The second row then gives x4x_4 in the same way.

Finally, the first row gives

x1=−2a−3b−146c+286d.x_1=-2a-3b-146c+286d.

Setting each free parameter in turn to 11 and the others to 00 gives one kernel basis vector per free variable. Thus a basis for the kernel is

{(−21000000),(−30100000),(−1460046−9100),(28600−92170−81)}.\left\{ \begin{pmatrix} -2\\1\\0\\0\\0\\0\\0\\0 \end{pmatrix}, \begin{pmatrix} -3\\0\\1\\0\\0\\0\\0\\0 \end{pmatrix}, \begin{pmatrix} -146\\0\\0\\46\\-9\\1\\0\\0 \end{pmatrix}, \begin{pmatrix} 286\\0\\0\\-92\\17\\0\\-8\\1 \end{pmatrix} \right\}.

Because the displayed matrix is already row-echelon, no row operation has changed its columns. Its pivot columns therefore give a basis for the image:

{(10000),(41000),(56100),(12310)}.\left\{ \begin{pmatrix}1\\0\\0\\0\\0\end{pmatrix}, \begin{pmatrix}4\\1\\0\\0\\0\end{pmatrix}, \begin{pmatrix}5\\6\\1\\0\\0\end{pmatrix}, \begin{pmatrix}1\\2\\3\\1\\0\end{pmatrix} \right\}.

There are four pivot and four free columns, so

rank⁡(A)=4,nullity⁡(A)=4.\operatorname{rank}(A)=4,\qquad \operatorname{nullity}(A)=4.

Rank-nullity for matrices

[THEOREM]

Rank-nullity theorem

For a matrix AA over a scalar field F\mathbb F with nn columns,

rank⁡(A)+nullity⁡(A)=n.\operatorname{rank}(A)+\operatorname{nullity}(A)=n.

In a row-echelon form, rank counts the pivot columns and nullity counts the free variables, or non-pivot columns. Their sum is therefore the number of columns of AA.

Solution sets as affine translates

[THEOREM]

Classes of solutions of Ax=bAx=b

Let AA be a matrix over an infinite scalar field F\mathbb F (such as R\mathbb R or C\mathbb C), let bb be a vector of the appropriate dimension and let [A∣b][A\mid b] be the augmented matrix formed by appending bb to AA. The equation Ax=bAx=b has:

  1. no solution if rank⁡(A)≠rank⁡([A∣b]);\operatorname{rank}(A)\ne\operatorname{rank}([A\mid b]);
  2. a unique solution if rank⁡(A)=rank⁡([A∣b])andnullity⁡(A)=0;\operatorname{rank}(A)=\operatorname{rank}([A\mid b]) \quad\text{and}\quad \operatorname{nullity}(A)=0;
  3. infinitely many solutions if rank⁡(A)=rank⁡([A∣b])andnullity⁡(A)>0.\operatorname{rank}(A)=\operatorname{rank}([A\mid b]) \quad\text{and}\quad \operatorname{nullity}(A)>0.

In the last case, if nullity⁡(A)=k\operatorname{nullity}(A)=k, then every solution has the form

x=xp+ω1u1+⋯+ωkuk,x=x_p+\omega_1u_1+\cdots+\omega_ku_k,

where xpx_p is any particular solution of Ax=bAx=b, {u1,…,uk}\{u_1,\ldots,u_k\} is a basis for ker⁡(A)\ker(A) and ω1,…,ωk∈F\omega_1,\ldots,\omega_k\in\mathbb F.

Appending bb increases the rank exactly when bb is not in the column space of AA, that is, when Ax=bAx=b is inconsistent. The infinite-field assumption ensures that a free parameter can take infinitely many values.

When a particular solution exists, subtracting it from any other solution gives a vector in the kernel. So the solution set is the affine translate xp+ker⁡(A)x_p+\ker(A) of the kernel. The same pattern holds for any linear map: two inputs have the same output precisely when their difference lies in the kernel, so each non-empty fibre is a translate of the kernel.

[EXAMPLE]

General solution of an inhomogeneous system

For

A=(1012011−11121),b=(314),A= \begin{pmatrix} 1&0&1&2\\ 0&1&1&-1\\ 1&1&2&1 \end{pmatrix}, \qquad b= \begin{pmatrix} 3\\1\\4 \end{pmatrix},

take x3=λ3x_3=\lambda_3 and x4=λ4x_4=\lambda_4. Solving the first two equations gives

x1=3−λ3−2λ4,x2=1−λ3+λ4.x_1=3-\lambda_3-2\lambda_4, \qquad x_2=1-\lambda_3+\lambda_4.

Therefore

x=(3100) ⁣+λ3(−1−110) ⁣+λ4(−2101),λ3,λ4∈R.x= \begin{pmatrix} 3\\1\\0\\0 \end{pmatrix} \!+\lambda_3 \begin{pmatrix} -1\\-1\\1\\0 \end{pmatrix} \!+\lambda_4 \begin{pmatrix} -2\\1\\0\\1 \end{pmatrix}, \qquad \lambda_3,\lambda_4\in\mathbb R.

The two direction vectors are the kernel basis found in the first example and the constant vector is a particular solution: Axp=bAx_p=b.

Rank-nullity for vector spaces

[THEOREM]

Rank-nullity theorem for vector spaces

If T:V→WT:V\to W is a linear map over a scalar field F\mathbb F and VV is finite-dimensional, then

rank⁡(T)+nullity⁡(T)=dim⁡(V).\operatorname{rank}(T)+\operatorname{nullity}(T)=\dim(V).

The codomain need not be finite-dimensional: the image of a map from the finite-dimensional space VV is automatically finite-dimensional.

[PROOF]

Let k=dim⁡ker⁡(T)k=\dim\ker(T) and choose a basis

u1,…,uku_1,\ldots,u_k

for ker⁡(T)\ker(T). Extend it to a basis of VV:

u1,…,uk,v1,…,vr.u_1,\ldots,u_k,v_1,\ldots,v_r.

The vectors T(v1),…,T(vr)T(v_1),\ldots,T(v_r) span im⁡(T)\operatorname{im}(T). Indeed, if x∈Vx\in V, write

x=a1u1+⋯+akuk+b1v1+⋯+brvr.x=a_1u_1+\cdots+a_ku_k+b_1v_1+\cdots+b_rv_r.

Applying TT gives

T(x)=b1T(v1)+⋯+brT(vr),T(x)=b_1T(v_1)+\cdots+b_rT(v_r),

because T(ui)=0T(u_i)=0 for each ii.

The vectors T(v1),…,T(vr)T(v_1),\ldots,T(v_r) are linearly independent. If

c1T(v1)+⋯+crT(vr)=0,c_1T(v_1)+\cdots+c_rT(v_r)=0,

then

T(c1v1+⋯+crvr)=0,T(c_1v_1+\cdots+c_rv_r)=0,

so c1v1+⋯+crvr∈ker⁡(T)c_1v_1+\cdots+c_rv_r\in\ker(T). It is therefore a linear combination of u1,…,uku_1,\ldots,u_k. Since the full list

u1,…,uk,v1,…,vru_1,\ldots,u_k,v_1,\ldots,v_r

is linearly independent, c1=⋯=cr=0c_1=\cdots=c_r=0. Thus T(v1),…,T(vr)T(v_1),\ldots,T(v_r) is a basis of the image, so rank⁡(T)=r\operatorname{rank}(T)=r. The basis of VV has k+rk+r vectors, giving

rank⁡(T)+nullity⁡(T)=r+k=dim⁡(V).\operatorname{rank}(T)+\operatorname{nullity}(T)=r+k=\dim(V).
[EXAMPLE]

Differentiation on polynomial spaces

Over R\mathbb R and for n≥1n\ge1, consider

D:Pn→Pn−1,D(p)=dp(x)dx.D:P_n\to P_{n-1}, \qquad D(p)=\frac{dp(x)}{dx}.

For p1,p2∈Pnp_1,p_2\in P_n and λ∈R\lambda\in\mathbb R,

D(p1+p2)=D(p1)+D(p2),D(λp1)=λD(p1),D(p_1+p_2)=D(p_1)+D(p_2), \qquad D(\lambda p_1)=\lambda D(p_1),

so DD is a linear map. If

p(x)=c0+c1x+⋯+cnxn,p(x)=c_0+c_1x+\cdots+c_nx^n,

then

D(p)=c1+2c2x+⋯+ncnxn−1.D(p)=c_1+2c_2x+\cdots+n c_nx^{n-1}.

Its kernel consists of the constant polynomials:

ker⁡(D)={α:α∈R}=span⁡{1}.\ker(D)=\{\alpha:\alpha\in\mathbb R\} =\operatorname{span}\{1\}.

Thus nullity⁡(D)=1\operatorname{nullity}(D)=1. Since dim⁡(Pn)=n+1\dim(P_n)=n+1, rank-nullity gives

rank⁡(D)=n.\operatorname{rank}(D)=n.

The image is Pn−1P_{n-1}: every polynomial of degree at most n−1n-1 has a polynomial antiderivative in PnP_n. Hence its dimension is also nn, agreeing with the rank calculation.

Summary and equivalent conditions

The matrix and vector-space statements are

rank⁡(A)+nullity⁡(A)=number of columns of A\operatorname{rank}(A)+\operatorname{nullity}(A) =\text{number of columns of }A

and

rank⁡(T)+nullity⁡(T)=dim⁡(V).\operatorname{rank}(T)+\operatorname{nullity}(T)=\dim(V).
[COROLLARY]

Equivalent conditions for a square matrix

For a square matrix A∈Mn×n(R)A\in M_{n\times n}(\mathbb R), the following statements are equivalent:

  1. Ax=uAx=u has a unique solution for every u∈Rnu\in\mathbb R^n;
  2. Ax=0Ax=0 has only the trivial solution;
  3. every column of the reduced echelon form of AA is leading;
  4. det⁡(A)≠0\det(A)\ne0;
  5. AA is invertible;
  6. the columns of AA are linearly independent;
  7. the columns of AA span Rn\mathbb R^n;
  8. the columns of AA form a basis for Rn\mathbb R^n;
  9. rank⁡(A)=n\operatorname{rank}(A)=n;
  10. nullity⁡(A)=0\operatorname{nullity}(A)=0.

Rank-nullity links the kernel conditions to the column conditions: for a square matrix with nn columns, zero nullity is equivalent to rank nn.

Once bases are chosen, a linear map has a matrix representation and these dimension counts become calculations on that matrix.

On this page