Module 5: Vector Spaces
Every matrix creates three fundamental spaces. Understanding them tells you everything about what the matrix can and can't do.
The column space of A is the set of all vectors that A can produce — all outputs Ax for any input x. It's spanned by the columns of A.
Think of it as the "reach" of the matrix. If A is 2×2 with rank 2, it can reach anywhere in ℝ². If rank 1, it can only reach a line.
The null space of A is all vectors x where Ax=0. These inputs get squashed to zero.
When A is full rank (rank = 2), the null space contains only the zero vector — the transformation is injective, no two inputs produce the same output. When rank drops, a whole line of inputs collapses to zero.
The row space is spanned by the rows of A. It lives in the input space and is the orthogonal complement of the null space. Together, the null space and row space partition every input vector perfectly.
Drag the column vectors. When they're linearly independent, the column space is all of ℝ² and the null space is just zero.
Drag them to be parallel — the matrix loses rank. The column space collapses to a line, and the null space becomes a line (shown in amber).
import numpy as np
A = np.array([[2, 1], [1, 2]])
# Column space (via SVD)
U, s, Vh = np.linalg.svd(A)
rank = np.sum(s > 1e-9)
# Null space
_, _, Vh = np.linalg.svd(A)
null = Vh[rank:] # rows of Vh after rankMatrix A = [col₁ | col₂] = [[2, 0], [1, 2]]
det(A) = 4
Column space = all of ℝ² · · Null space = just {0}
Drag the column vectors. Make them parallel to collapse the column space to a line.