Null Space & Column Space of a Matrix
2148 words
11 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# Null Space & Column Space of a Matrix ## 🎯 Learning Objectives After this topic you will be able to: - Find a basis for the null space of a matrix - Find a basis for the column space of a matrix - Relate nullity and rank to the geometry of $A\mathbf{x} = \mathbf{b}$ - Understand the relationship between the four...

Null Space & Column Space of a Matrix
🎯 Learning Objectives
After this topic you will be able to:
- Find a basis for the null space of a matrix
- Find a basis for the column space of a matrix
- Relate nullity and rank to the geometry of Ax=b
- Understand the relationship between the four fundamental subspaces
- Determine whether a given vector is in the null space or column space
📋 Prerequisites
- Rank & Dimension (Week 4) — rank, nullity, rank-nullity theorem
- Gaussian Elimination (Week 2) — solving homogeneous systems
- Subspaces (Week 3) — definition of subspaces
1. The Four Fundamental Subspaces
Every m×n matrix A defines four subspaces:
| Subspace | Notation | Definition | Lives in |
|---|---|---|---|
| Null space | N(A) | {x∈Rn∣Ax=0} | Rn |
| Column space | C(A) | {Ax∈Rm∣x∈Rn} | Rm |
| Row space | R(A) | Span of rows of A | Rn |
| Left null space | N(AT) | {y∈Rm∣ATy=0} | Rm |
(Diagram)
2. Null Space (Kernel)
2.1 Definition and Geometry
>N(A)={x∈Rn∣Ax=0}>Definition (Null Space). The null space of an m×n matrix A is:
The null space contains all vectors that A annihilates (maps to zero). It is always a subspace of Rn.
Geometric intuition: If A projects R3 onto the xy-plane, the z-axis becomes the null space — every vector (0,0,z) maps to (0,0,0).
2.2 Finding a Basis for the Null Space
Algorithm:
- Row reduce A to RREF
- Identify pivot columns (basic variables) and non-pivot columns (free variables)
- Express basic variables in terms of free variables
- Write the solution as a linear combination of basis vectors, one per free variable
>A=100200010120−110>Example 1: Null space basis
>x1+2x2+x4−x5=0⇒x1=−2x2−x4+x5>(already in RREF)Step 1: Identify pivots. Pivot columns: 1, 3. Free variables: x2,x4,x5.Step 2: Write equations:
>x3+2x4+x5=0⇒x3=−2x4−x5>
>x1x2x3x4x5=x2−21000+x4−10−210+x510−101>Step 3: Parametric form:
Basis for N(A): {(−2,1,0,0,0),(−1,0,−2,1,0),(1,0,−1,0,1)}.nullity(A)=3.
2.3 Checking Membership
To check if x∈N(A): compute Ax. If Ax=0, then x is in the null space.
>Ax=1(2)+2(−1)+0+0+00+0+0+0+00=000>Example 2: Membership testIs (2,−1,0,0,0) in N(A) from Example 1?
✓Yes, it's in N(A). Indeed, it's −21 times the first basis vector.
3. Column Space (Range)
3.1 Definition
>C(A)={y∈Rm∣y=Ax for some x∈Rn}>Definition (Column Space). The column space of A is:
Equivalently, C(A)=span{columns of A}. The column space captures all possible outputs of A.
3.2 Finding a Basis for the Column Space
Algorithm:
- Row reduce A to RREF
- Identify pivot columns
- The original columns of A at the pivot positions form a basis for C(A)
>A=12124201−1130>Example 3: Column space basis
>R2−2R1,R3−R110020001−111−1R3+R2100200010110>Row reduce:
>⎩⎨⎧121,01−1⎭⎬⎫>Pivot columns: 1 and 3.Basis for C(A):
.rank(A)=2.
3.3 Checking Membership
To check if b∈C(A): solve Ax=b. If a solution exists, b is in the column space.
>12124201−1130351>Example 4: Column space membershipIs b=(3,5,1) in C(A) from Example 3?Solve Ax=b:
After row reduction, check consistency. If consistent, b∈C(A).
4. Column Space vs. Row Space
| Aspect | Column Space C(A) | Row Space R(A) |
|---|---|---|
| Subspace of | Rm | Rn |
| Basis from | Pivot columns of original A | Non-zero rows of RREF |
| Dimension | rank(A) | rank(A) |
| Related to | Outputs of A | Linear relations among columns |
>100200010110>Example 5: Row space basisUsing A from Example 3, RREF is
.Basis for R(A): {(1,2,0,1),(0,0,1,1)}.
5. The Fundamental Theorem of Linear Algebra
Theorem (Fundamental Theorem of Linear Algebra, Part I). For an m×n matrix A:
- N(A) and R(A) are orthogonal complements in Rn
- N(AT) and C(A) are orthogonal complements in Rm
- dim(N(A))+dim(R(A))=n
- dim(N(AT))+dim(C(A))=m Orthogonal complements means every vector in one subspace is orthogonal to every vector in the other, and together they span the whole space.
6. Edge Cases & Gotchas
| Situation | What Happens |
|---|---|
| **Zero matrix 0m×n ** | N(A)=Rn (whole domain), C(A)={0} |
| **Identity In ** | N(A)={0} , C(A)=Rn |
| Square invertible | N(A)={0} , C(A)=Rn |
| One row | N(A) is (n−1) -dimensional; C(A) is a line |
7. Common Pitfalls
❌ Pitfall 1: Thinking N(A) and C(A) live in the same space
N(A)⊆Rn (domain), C(A)⊆Rm (codomain). For m=n, they are different spaces entirely.
❌ Pitfall 2: Using RREF columns for column space basis
The column space basis must use original columns from A, not the RREF columns. The RREF columns are linear combinations of original columns and may live in a different coordinate system.
❌ Pitfall 3: Forgetting to check 0 for null space membership
0 is always in N(A). The question is whether there are non-zero vectors as well.
8. Formula Summary Table
| Concept | Basis | Dimension |
|---|---|---|
| **Null space N(A) ** | Parametric solution vectors of Ax=0 | nullity(A)=n−r |
| **Column space C(A) ** | Original pivot columns of A | rank(A)=r |
| **Row space R(A) ** | Non-zero rows of RREF | rank(A)=r |
| **Left null space N(AT) ** | Solve ATy=0 | m−r |
9. 📝 Practice Questions
>A=[1224]>Q1: Null space of a 2×2 matrixFind a basis for N(A) where
>A=[1224]>.Solution: Solve Ax=0: x+2y=0, 2x+4y=0 ⇒ x=−2y, y free. N(A)=span{(−2,1)}. Dimension = 1. Q2: Column space of a 2×2 matrixFind a basis for C(A) where
>A=121012−103>.Solution: Columns are (1,2) and (2,4). Column 2 = 2(column 1), so they are dependent. C(A)=span{(1,2)}. Dimension = 1. Q3: Three independent columnsFind a basis for C(A) where
>121012−103R2−2R1,R3−R1100012−124R3−2R2100010−120>.Solution: Row reduce:
>A=[1224]>Pivot columns: 1 and 2. Basis for C(A): columns 1 and 2 of original A: {(1,2,1),(0,1,2)}. Q4: Complete solution to Ax = bFind the complete solution to Ax=b where
>b=[36]>,
>x=[30]+t[−21]>.Solution: Particular solution: Solve x+2y=3. Set y=0, then x=3. xp=(3,0).Homogeneous solution: N(A)=span{(−2,1)}.Complete solution:
>A=101011>, t∈R. Q5: Column space membership testIs b=(1,2,3) in C(A) for
>⎩⎨⎧x=1y=2x+y=3⇒1+2=3 ✓>?Solution: Solve Ax=b:
>A=100110110>Yes, b∈C(A) with x=(1,2). Q6: Null space of a 3×3 singular matrixFind N(A) for
>A=[1224]>.Solution: Solve Ax=0: x+y+z=0, y+z=0 ⇒ y=−z, x=−y−z=z−z=0. So x=0, y=−z, z free.N(A)=span{(0,−1,1)}. Nullity = 1. Q7: Finding left null spaceFind a basis for N(AT) where
>AT=[1224]>.Solution:
(same here). Solve ATy=0: y1+2y2=0, 2y1+4y2=0 ⇒ y1=−2y2, y2 free.N(AT)=span{(−2,1)}. Dimension = m−r=2−1=1. Q8: Rank from nullityIf A is 7×5 with nullity 3, what is the rank?Solution: rank(A)=5−3=2. Q9: When does N(A) = {0}?For what type of matrix does N(A)={0}?Solution: When A has full column rank, i.e., rank(A)=n (number of columns). Then nullity = n−n=0. Q10: Four subspaces dimensionsFor A4×6 with rank 2, give dimensions of all four fundamental subspaces.Solution:
- dim(N(A))=6−2=4
- dim(C(A))=2
- dim(R(A))=2
- dim(N(AT))=4−2=2
🔗 Cross-References
- Next topic: Rank-Nullity Theorem (review)
- Next: Linear Transformations Introduction
- Week 6 (Kernel & Image): Generalises null space and column space
- BSMA1001 (Maths 1): Solving systems of equations
- BSCS2004 (ML Foundations): Underdetermined and overdetermined systems Join Discord Previous4.2 Rank & DimensionNext5.2 Linear Transformations