Skip to main content
© 2026 ePowerAI. All rights reserved.
CoursesContact
eAI
CoursesContact
Week 6: The Four Fundamental Subspaces
Linear Algebra
01Week 1: Vectors and Linear Combinations
02Week 2: Linear Transformations and Matrices
03Week 3: Elimination and LU Factorization
04Week 4: Determinants
05Week 5: Vector Spaces, Independence, and Basis
06Week 6: The Four Fundamental Subspaces
07Week 7: Orthogonality and Projections
08Week 8: Least Squares and QR
09Week 9: Eigenvalues and Eigenvectors
10Week 10: Diagonalization and Markov Matrices
11Week 11: Differential Equations
12Week 12: Symmetric and Positive Definite Matrices
13Week 13: The SVD and Complex Matrices
14Week 14: The Fourier Matrix, FFT, and PCA
Week 06· Linear Algebra20 min read

Week 6: The Four Fundamental Subspaces

✦Learning Outcomes
  • Define the column space, null space, row space, and left null space of a matrix
  • Compute the null space of a matrix using elimination
  • State the rank-nullity (dimension) formula and its geometric meaning
  • Relate the four subspaces to the kernel and range of a linear transformation
◆Prerequisites

Background knowledge assumed:

  • Independence, basis, and dimension
  • Linear transformations

Recommended: Review Week 5: Vector Spaces, Independence, and Basis and Week 2: Linear Transformations and Matrices before starting.

Column Space and Null Space#

Every m×nm \times nm×n matrix AAA defines two subspaces of special importance: one in the output space Rm\mathbb{R}^mRm, and one in the input space Rn\mathbb{R}^nRn.

Column space. Write the columns of AAA as a1,a2,…,an∈Rma_1, a_2, \ldots, a_n \in \mathbb{R}^ma1​,a2​,…,an​∈Rm. The column space C(A)C(A)C(A) is their span:

C(A)=span⁡{a1,…,an}={Ax:x∈Rn}.C(A) = \operatorname{span}\{a_1, \ldots, a_n\} = \{ Ax : x \in \mathbb{R}^n \}.C(A)=span{a1​,…,an​}={Ax:x∈Rn}.

So C(A)C(A)C(A) is exactly the set of all possible outputs of the map x↦Axx \mapsto Axx↦Ax. It is a subspace of Rm\mathbb{R}^mRm (Week 5: span is always a subspace). Its dimension is the rank of AAA — the number of pivot columns, or equivalently the size of any basis drawn from the columns.

Null space. The null space (or nullspace) of AAA is the set of all inputs that map to zero:

N(A)={x∈Rn:Ax=0}.N(A) = \{ x \in \mathbb{R}^n : Ax = 0 \}.N(A)={x∈Rn:Ax=0}.

It is a subspace of Rn\mathbb{R}^nRn: if Au=0Au = 0Au=0 and Av=0Av = 0Av=0, then A(u+v)=0A(u+v) = 0A(u+v)=0 and A(cu)=0A(cu) = 0A(cu)=0. Geometrically, N(A)N(A)N(A) is the set of directions that AAA “kills.” Algebraically it is the solution set of the homogeneous system Ax=0Ax = 0Ax=0.

Worked picture. Take the 2×32 \times 32×3 matrix

A=(123246).A = \begin{pmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \end{pmatrix}.A=(12​24​36​).

The second row is twice the first, so every column is a multiple of (1,2)⊤(1,2)^\top(1,2)⊤; every AxAxAx lies on that same line — a multiple of (12)\begin{pmatrix} 1 \\ 2 \end{pmatrix}(12​). Thus

C(A)=span⁡{(12)}⊂R2,C(A) = \operatorname{span}\left\{ \begin{pmatrix} 1 \\ 2 \end{pmatrix} \right\} \subset \mathbb{R}^2,C(A)=span{(12​)}⊂R2,

a one-dimensional subspace of R2\mathbb{R}^2R2, and rank⁡(A)=1\operatorname{rank}(A) = 1rank(A)=1. The null space lives in R3\mathbb{R}^3R3 and will turn out to be two-dimensional — we compute it explicitly below.

Solvability of Ax=bAx = bAx=b. The equation Ax=bAx = bAx=b has a solution if and only if b∈C(A)b \in C(A)b∈C(A). When a solution exists and N(A)N(A)N(A) is nontrivial, solutions are never unique: if Ax0=bAx_0 = bAx0​=b and n∈N(A)n \in N(A)n∈N(A), then A(x0+n)=bA(x_0 + n) = bA(x0​+n)=b as well. The general solution is a particular solution plus the null space.


Row Space and Left Null Space#

The same two constructions applied to the transpose A⊤A^\topA⊤ produce the remaining pair.

Row space. The rows of AAA are the columns of A⊤A^\topA⊤, so the row space is

C(A⊤)={A⊤y:y∈Rm}⊂Rn.C(A^\top) = \{ A^\top y : y \in \mathbb{R}^m \} \subset \mathbb{R}^n.C(A⊤)={A⊤y:y∈Rm}⊂Rn.

It is the span of the mmm row vectors of AAA, viewed as vectors in Rn\mathbb{R}^nRn. A fundamental fact from elimination is that row operations do not change the row space, and that

dim⁡C(A⊤)=dim⁡C(A)=r=rank⁡(A).\dim C(A^\top) = \dim C(A) = r = \operatorname{rank}(A).dimC(A⊤)=dimC(A)=r=rank(A).

Column rank equals row rank: the number of independent rows equals the number of independent columns.

Left null space. The left null space is the null space of A⊤A^\topA⊤:

N(A⊤)={y∈Rm:A⊤y=0}={y∈Rm:y⊤A=0}.N(A^\top) = \{ y \in \mathbb{R}^m : A^\top y = 0 \} = \{ y \in \mathbb{R}^m : y^\top A = 0 \}.N(A⊤)={y∈Rm:A⊤y=0}={y∈Rm:y⊤A=0}.

Vectors in N(A⊤)N(A^\top)N(A⊤) are orthogonal to every column of AAA (because y⊤A=0y^\top A = 0y⊤A=0 means yyy is orthogonal to each column). Equivalently, y⊤(Ax)=0y^\top (Ax) = 0y⊤(Ax)=0 for every xxx, so yyy is orthogonal to the entire column space. That is the seed of the orthogonal complements we will prove carefully in Week 7.

Where each subspace lives.

| Subspace | Symbol | Ambient space | Dimension | | --- | --- | --- | --- | | Column space | C(A)C(A)C(A) | Rm\mathbb{R}^mRm | rrr | | Null space | N(A)N(A)N(A) | Rn\mathbb{R}^nRn | n−rn - rn−r | | Row space | C(A⊤)C(A^\top)C(A⊤) | Rn\mathbb{R}^nRn | rrr | | Left null space | N(A⊤)N(A^\top)N(A⊤) | Rm\mathbb{R}^mRm | m−rm - rm−r |

Two live in Rn\mathbb{R}^nRn (row space and null space) and two live in Rm\mathbb{R}^mRm (column space and left null space). Their dimensions are completely determined by mmm, nnn, and the single number r=rank⁡(A)r = \operatorname{rank}(A)r=rank(A).

Picture. Think of two ambient spaces linked by AAA:

  • Domain Rn\mathbb{R}^nRn: row space C(A⊤)C(A^\top)C(A⊤) (dim rrr) and null space N(A)N(A)N(A) (dim n−rn-rn−r) sit side by side and will later turn out to be orthogonal complements.
  • Codomain Rm\mathbb{R}^mRm: column space C(A)C(A)C(A) (dim rrr) and left null space N(A⊤)N(A^\top)N(A⊤) (dim m−rm-rm−r) are the matching pair.

The map A ⁣:Rn→RmA \colon \mathbb{R}^n \to \mathbb{R}^mA:Rn→Rm sends the row space onto the column space and collapses the null space to 000.


Computing the Null Space#

To find a basis for N(A)N(A)N(A), solve Ax=0Ax = 0Ax=0 by elimination and express the pivot variables in terms of the free variables. Each free variable produces one special solution by setting that free variable to 111 and the others to 000. Those special solutions form a basis of N(A)N(A)N(A).

Worked example. Continue with

A=(123246).A = \begin{pmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \end{pmatrix}.A=(12​24​36​).

Row-reduce: subtract 222 times row 1 from row 2 to get

R=(123000).R = \begin{pmatrix} 1 & 2 & 3 \\ 0 & 0 & 0 \end{pmatrix}.R=(10​20​30​).

There is one pivot, in column 1, so x1x_1x1​ is a basic (pivot) variable and x2,x3x_2, x_3x2​,x3​ are free. The single nonzero equation is

x1+2x2+3x3=0⟹x1=−2x2−3x3.x_1 + 2x_2 + 3x_3 = 0 \quad\Longrightarrow\quad x_1 = -2x_2 - 3x_3.x1​+2x2​+3x3​=0⟹x1​=−2x2​−3x3​.

Special solution for x2=1x_2 = 1x2​=1, x3=0x_3 = 0x3​=0:

x1=−2,n1=(−210).x_1 = -2,\quad n_1 = \begin{pmatrix} -2 \\ 1 \\ 0 \end{pmatrix}.x1​=−2,n1​=​−210​​.

Special solution for x2=0x_2 = 0x2​=0, x3=1x_3 = 1x3​=1:

x1=−3,n2=(−301).x_1 = -3,\quad n_2 = \begin{pmatrix} -3 \\ 0 \\ 1 \end{pmatrix}.x1​=−3,n2​=​−301​​.

Check: An1=−2(12)+1(24)+0(36)=0A n_1 = -2\begin{pmatrix}1\\2\end{pmatrix} + 1\begin{pmatrix}2\\4\end{pmatrix} + 0\begin{pmatrix}3\\6\end{pmatrix} = 0An1​=−2(12​)+1(24​)+0(36​)=0, and similarly An2=0A n_2 = 0An2​=0. The set {n1,n2}\{n_1, n_2\}{n1​,n2​} is independent (the free-variable identity block in the last two coordinates makes that immediate) and spans every solution, so it is a basis of N(A)N(A)N(A) and dim⁡N(A)=2\dim N(A) = 2dimN(A)=2.

In general, after reduction to row echelon form with rrr pivots and n−rn - rn−r free variables, you get exactly n−rn - rn−r special solutions — a basis of the null space.

Exercise · Fill in the blank

A = [[1,2,3],[2,4,6]] has null space defined by x1 + 2x2 + 3x3 = 0. Setting the free variables x2 = 1 and x3 = 0, what is x1?


The Dimension Formula#

The counts above are not an accident. For any m×nm \times nm×n matrix AAA of rank rrr,

rank⁡(A)+dim⁡N(A)=n.\operatorname{rank}(A) + \dim N(A) = n.rank(A)+dimN(A)=n.

This is the rank–nullity theorem (also called the dimension formula). Equivalently, dim⁡N(A)=n−r\dim N(A) = n - rdimN(A)=n−r.

Why it holds. Elimination produces rrr pivot variables and n−rn - rn−r free variables. The free variables parametrize N(A)N(A)N(A), so dim⁡N(A)=n−r\dim N(A) = n - rdimN(A)=n−r. The rrr pivot columns form a basis of C(A)C(A)C(A), so rank⁡(A)=r\operatorname{rank}(A) = rrank(A)=r. Adding these identities gives the formula.

Geometric meaning. The map x↦Axx \mapsto Axx↦Ax “uses up” rrr independent input directions (those that produce the rrr-dimensional column space) and “kills” the remaining n−rn - rn−r directions (the null space). Input dimension splits cleanly into range contribution plus kernel:

n=r+(n−r).n = r + (n - r).n=r+(n−r).

For the transpose the same theorem says rank⁡(A⊤)+dim⁡N(A⊤)=m\operatorname{rank}(A^\top) + \dim N(A^\top) = mrank(A⊤)+dimN(A⊤)=m, and since rank⁡(A⊤)=r\operatorname{rank}(A^\top) = rrank(A⊤)=r we get dim⁡N(A⊤)=m−r\dim N(A^\top) = m - rdimN(A⊤)=m−r — completing the four dimension counts in the table above.

Check on the example. For our 2×32 \times 32×3 matrix, n=3n = 3n=3 and r=1r = 1r=1, so dim⁡N(A)=3−1=2\dim N(A) = 3 - 1 = 2dimN(A)=3−1=2, matching the two special solutions. Also dim⁡N(A⊤)=2−1=1\dim N(A^\top) = 2 - 1 = 1dimN(A⊤)=2−1=1: the left null space is spanned by (−2,1)⊤(-2, 1)^\top(−2,1)⊤, because that vector is orthogonal to every column of AAA.


Kernel, Range, and the Four Subspaces#

Week 2 defined a linear transformation T ⁣:Rn→RmT \colon \mathbb{R}^n \to \mathbb{R}^mT:Rn→Rm by T(x)=AxT(x) = AxT(x)=Ax. The four subspaces are the kernel and range of TTT and of T⊤T^\topT⊤ under different names.

Range of TTT. By definition,

range⁡(T)={T(x):x∈Rn}={Ax:x∈Rn}=C(A).\operatorname{range}(T) = \{ T(x) : x \in \mathbb{R}^n \} = \{ Ax : x \in \mathbb{R}^n \} = C(A).range(T)={T(x):x∈Rn}={Ax:x∈Rn}=C(A).

So the column space is the range (image) of the transformation.

Kernel of TTT. Likewise,

ker⁡(T)={x:T(x)=0}={x:Ax=0}=N(A).\ker(T) = \{ x : T(x) = 0 \} = \{ x : Ax = 0 \} = N(A).ker(T)={x:T(x)=0}={x:Ax=0}=N(A).

The null space is the kernel. Rank–nullity then reads

dim⁡(range⁡(T))+dim⁡(ker⁡(T))=n=dim⁡(domain),\dim(\operatorname{range}(T)) + \dim(\ker(T)) = n = \dim(\text{domain}),dim(range(T))+dim(ker(T))=n=dim(domain),

the classical form for any linear map between finite-dimensional spaces.

The transpose map. The map T⊤ ⁣:Rm→RnT^\top \colon \mathbb{R}^m \to \mathbb{R}^nT⊤:Rm→Rn given by T⊤(y)=A⊤yT^\top(y) = A^\top yT⊤(y)=A⊤y has range C(A⊤)C(A^\top)C(A⊤) (row space) and kernel N(A⊤)N(A^\top)N(A⊤) (left null space). Everything we said about AAA applies to A⊤A^\topA⊤ with the roles of mmm and nnn swapped.

Summary dictionary.

| Transformation language | Matrix language | | --- | --- | | range⁡(T)\operatorname{range}(T)range(T) for T(x)=AxT(x)=AxT(x)=Ax | C(A)C(A)C(A) | | ker⁡(T)\ker(T)ker(T) for T(x)=AxT(x)=AxT(x)=Ax | N(A)N(A)N(A) | | range⁡(T⊤)\operatorname{range}(T^\top)range(T⊤) | C(A⊤)C(A^\top)C(A⊤) | | ker⁡(T⊤)\ker(T^\top)ker(T⊤) | N(A⊤)N(A^\top)N(A⊤) |

Week 7 will add one more structural fact: within Rn\mathbb{R}^nRn, the row space and null space are orthogonal complements of each other, and within Rm\mathbb{R}^mRm the column space and left null space are orthogonal complements. Week 13’s SVD will build orthonormal bases for all four of these spaces at once.


Knowledge check#

Question 1 of 3

The column space C(A) lives in which space, for an m×n matrix A?

R^m
R^n
R^(m+n)
R^(mn)

Browser lab#

Compute rank and a null-space basis with numpy only (SVD — no scipy). For an m×nm \times nm×n matrix of rank rrr, the last n−rn - rn−r right singular vectors (rows of V⊤V^\topV⊤, or columns of VVV) form an orthonormal basis of N(A)N(A)N(A). That basis spans the same null space as the special solutions from elimination above, but the individual vectors need not match those special solutions numerically.

python · runs in browser
import numpy as np

A = np.array([[1., 2., 3.],
              [2., 4., 6.]])

# Full SVD: A = U @ diag(S) @ Vt  (Vt is V^T)
U, S, Vt = np.linalg.svd(A, full_matrices=True)
rank = np.linalg.matrix_rank(A)
# Right singular vectors for near-zero singular values: last n - rank rows of Vt
ns = Vt[rank:].T  # columns form a basis of N(A)

print("rank(A) =", rank)
print("null space basis (columns):\n", ns)
print("A @ ns ≈ 0?", np.allclose(A @ ns, 0))
print("dim N(A) should be n - r =", A.shape[1] - rank)
← Previous
Week 5: Vector Spaces, Independence, and Basis
Next →
Week 7: Orthogonality and Projections
On this page
  • Column Space and Null Space
  • Row Space and Left Null Space
  • Computing the Null Space
  • The Dimension Formula
  • Kernel, Range, and the Four Subspaces
  • Knowledge check
  • Browser lab