Every m×n matrix A defines two subspaces of special importance: one in the output space Rm, and one in the input space Rn.
Column space. Write the columns of A as a1,a2,…,an∈Rm. The column spaceC(A) is their span:
C(A)=span{a1,…,an}={Ax:x∈Rn}.
It is a subspace of Rm (Week 5: span is always a subspace). Its dimension is the rank of A — the number of pivot columns, or equivalently the size of any basis drawn from the columns.
Null space. The null space (or nullspace) of A is the set of all inputs that map to zero:
N(A)={x∈Rn:Ax=0}.
It is a subspace of Rn: if Au=0 and Av=0, then A(u+v)=0 and A(cu)=0. Geometrically, N(A) is the set of directions that A “kills.”
Worked picture. Take the 2×3 matrix
A=(122436).
The second row is twice the first, so every column is a multiple of (1,2)⊤; every Ax lies on that same line — a multiple of (12). Thus
C(A)=span{(12)}⊂R2,
a one-dimensional subspace of R2, and rank(A)=1. The null space lives in R3 and will turn out to be two-dimensional — we compute it explicitly below.
Solvability of Ax=b. The equation Ax=b has a solution if and only if b∈C(A). When a solution exists and N(A) is nontrivial, solutions are never unique: if Ax0=b and n∈N(A), then A(x0+n)=b as well. The general solution is a particular solution plus the null space.
The same two constructions applied to the transpose A⊤ produce the remaining pair.
Row space. The rows of A are the columns of A⊤, so the row space is
C(A⊤)={A⊤y:y∈Rm}⊂Rn.
It is the span of the m row vectors of A, viewed as vectors in Rn. A fundamental fact from elimination is that row operations do not change the row space, and that
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⊤:
N(A⊤)={y∈Rm:A⊤y=0}={y∈Rm:y⊤A=0}.
Vectors in N(A⊤) are orthogonal to every column of A (because y⊤A=0 means y is orthogonal to each column). Equivalently, y⊤(Ax)=0 for every x, so y 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)
Rm
r
Null space
N(A)
Rn
n−r
Row space
C(A⊤)
Rn
r
Left null space
N(A⊤)
Rm
m−r
Two live in Rn and two in Rm, and every dimension in the table is fixed by m, n, and the single number r=rank(A).
Picture. Think of two ambient spaces linked by A:
DomainRn: row space C(A⊤) (dim r) and null space N(A) (dim n−r) sit side by side and will later turn out to be orthogonal complements.
CodomainRm: column space C(A) (dim r) and left null space N(A⊤) (dim m−r) are the matching pair.
The map A:Rn→Rm sends the row space onto the column space and collapses the null space to 0.
The four fundamental subspaces. Within each ambient space the two subspaces are orthogonal complements, and every dimension is fixed by m, n, and the rank r. A maps the row space one-to-one onto the column space and sends the null space to 0.
To find a basis for N(A), solve Ax=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 1 and the others to 0. Those special solutions form a basis of N(A).
Worked example. Continue with
A=(122436).
Row-reduce: subtract 2 times row 1 from row 2 to get
R=(102030).
There is one pivot, in column 1, so x1 is a basic (pivot) variable and x2,x3 are free. The single nonzero equation is
x1+2x2+3x3=0⟹x1=−2x2−3x3.
Special solution for x2=1, x3=0:
x1=−2,n1=−210.
Special solution for x2=0, x3=1:
x1=−3,n2=−301.
Check: An1=−2(12)+1(24)+0(36)=0, and similarly An2=0. The set {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) and dimN(A)=2.
In general, after reduction to row echelon form with r pivots and n−r free variables, you get exactly n−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 counts above are not an accident. For any m×n matrix A of rank r,
rank(A)+dimN(A)=n.
This is the rank–nullity theorem (also called the dimension formula).
Why it holds. Elimination produces r pivot variables and n−r free variables. The free variables parametrize N(A), so dimN(A)=n−r. The r pivot columns form a basis of C(A), so rank(A)=r. Adding these identities gives the formula.
Geometric meaning. The map x↦Ax “uses up” r independent input directions (those that produce the r-dimensional column space) and “kills” the remaining n−r directions (the null space). Input dimension splits cleanly into range contribution plus kernel:
n=r+(n−r).
For the transpose the same theorem says rank(A⊤)+dimN(A⊤)=m, and since rank(A⊤)=r we get dimN(A⊤)=m−r — completing the four dimension counts in the table above.
Check on the example. For our 2×3 matrix, n=3 and r=1, so dimN(A)=3−1=2, matching the two special solutions. Also dimN(A⊤)=2−1=1: the left null space is spanned by (−2,1)⊤, because that vector is orthogonal to every column of A.
Week 2 defined a linear transformation T:Rn→Rm by T(x)=Ax. The four subspaces are the kernel and range of T and of T⊤ under different names.
Range of T. By definition,
range(T)={T(x):x∈Rn}={Ax:x∈Rn}=C(A).
So the column space is the range (image) of the transformation.
Kernel of T. Likewise,
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),
the classical form for any linear map between finite-dimensional spaces.
The transpose map. The map T⊤:Rm→Rn given by T⊤(y)=A⊤y has range C(A⊤) (row space) and kernel N(A⊤) (left null space). Everything we said about A applies to A⊤ with the roles of m and n swapped.
Summary dictionary.
Transformation language
Matrix language
range(T) for T(x)=Ax
C(A)
ker(T) for T(x)=Ax
N(A)
range(T⊤)
C(A⊤)
ker(T⊤)
N(A⊤)
Week 7 will add one more structural fact: within Rn, the row space and null space are orthogonal complements of each other, and within Rm 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.
Gilbert Strang, Introduction to Linear Algebra, 6th ed. (Wellesley–Cambridge Press, 2023). Chapters 3.1–3.5 cover the four fundamental subspaces with worked examples and geometric intuition.
David C. Lay, Steven R. Lay, and Judi J. McDonald, Linear Algebra and Its Applications, 6th ed. (Pearson, 2021). Chapter 4 develops the column space, null space, and rank-nullity with computational emphasis.
Lloyd N. Trefethen and David Bau III, Numerical Linear Algebra (SIAM, 1997). Lectures 4–5 cover the SVD and its relationship to the four subspaces with numerical stability analysis.
Compute rank and a null-space basis with numpy only (SVD — no scipy). For an m×n matrix of rank r, the last n−r right singular vectors (rows of V⊤, or columns of V) form an orthonormal basis of 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)
print("Notice: rank(A) = 1 gives dim N(A) = 2; the two basis columns satisfy A @ ns ≈ 0.")
You can name the four fundamental subspaces, compute a null-space basis for a small matrix, and state the rank-nullity identity rank(A)+dimN(A)=n. Check it against the browser lab: for A=(122436) the output must read rank(A) = 1, A @ ns ≈ 0? True, and dim N(A) should be n - r = 2.