Column space, row space, null space, rank, nullity, and the Rank-Nullity Theorem — the structural anatomy of every matrix, connecting dimension, consistency, and information
Every matrix carries hidden structure. When you write down a matrix — whether it represents a system of equations, a data table, a linear transformation, or a network — it contains information about dimension, dependence, consistency, and collapse. Chapter 10 is about learning to read that structure.
In previous chapters, you learned that vector spaces and subspaces are the natural setting for linear algebra, and that span, linear independence, and basis give you the tools to describe dimension precisely. Now you will connect those ideas directly to matrices. You will learn to ask: what output vectors can this matrix produce? What input vectors does this matrix send to zero? How much information does this matrix preserve, and how much does it collapse?
The answers are organized into four distinguished subspaces — the column space, the row space, the null space, and the left null space — collectively called the fundamental subspaces of a matrix. Two numbers, called rank and nullity, measure the dimensions of these spaces and are connected by a beautiful theorem called the Rank-Nullity Theorem. Together, these ideas form one of the most complete structural accounts in all of linear algebra.
Suppose a company tracks five products across three stores. An analyst organizes the sales data into a matrix A with 3 rows and 5 columns. She runs row reduction and finds that only two pivot columns appear. What does this mean? Can she reconstruct the full picture from two columns? Are some product patterns redundant? If she tries to fit a model Ax = b using this data, for which demand vectors b does a solution exist? How many solutions are there? These are questions about rank, column space, and null space. By the end of this chapter, you will be able to answer all of them.
The ideas here appear throughout applied mathematics. In data science and machine learning, the rank of a data matrix tells you how many truly independent features exist — low-rank matrices indicate redundancy or correlation. In systems and engineering, the column space tells you which outputs a system can produce, and the null space describes which inputs have no effect on output. In statistics, the null space of the design matrix corresponds to combinations of predictors that cannot be estimated from the data. In computer graphics, transformations that collapse dimension produce degenerate projections. In differential equations, the null space of a coefficient matrix determines the structure of homogeneous solution sets. Understanding rank and null space means understanding how information flows through a linear system.
A matrix is not just a rectangular array of numbers. When you multiply a matrix A by a vector x, you produce a new vector Ax. This operation assigns to each input vector an output vector. In the language of functions, the matrix A defines a function from one vector space to another.
If A is an m × n matrix, then x must be a vector in ℝⁿ (with n components) and the product Ax is a vector in ℝᵐ (with m components). The matrix A maps vectors from ℝⁿ to vectors in ℝᵐ. This is a natural extension of the function idea from Precalculus, where a function maps a single real number to another. Here, inputs and outputs are vectors.
The domain of the map is ℝⁿ: all possible input vectors x. The codomain is ℝᵐ: the space where all outputs Ax live. But the matrix does not necessarily reach every vector in ℝᵐ. The collection of all vectors that A can actually produce — the set of all Ax as x ranges over all inputs — is called the image or range of the map. This is exactly the column space of A.
Similarly, some nonzero input vectors x may be sent to 0 by the matrix. The collection of all such vectors forms the null space of A. The rank and nullity measure how much of the output space is reached and how much of the input space is collapsed.
Draw two ovals: the left labeled ℝⁿ (input space) and the right labeled ℝᵐ (output space). Draw an arrow labeled A from left to right. Inside the left oval, shade a region labeled "Null space of A" that maps to the origin in ℝᵐ. Inside the right oval, shade a smaller region labeled "Column space of A" to show that not all of ℝᵐ may be reachable. This picture captures: the null space is what gets collapsed to zero, and the column space is what gets produced.
The column space of a matrix A, written Col(A), is the set of all vectors that can be written as linear combinations of the columns of A. If A has columns a₁, a₂, …, aₙ, then:
Col(A) = span{a₁, a₂, …, aₙ}
This is a subspace of ℝᵐ. Because Ax = x₁a₁ + x₂a₂ + ··· + xₙaₙ, the column space is exactly the set of all vectors A can produce as outputs.
Geometric meaning: The column space is the reachable output region of the matrix. If b is in Col(A), the equation Ax = b has at least one solution. If b is not in Col(A), the equation has no solution at all.
The columns of A may not all be linearly independent. To find a basis for the column space, use row reduction to identify the pivot columns — the columns containing the leading entries — then select those columns from the original matrix A (not from the reduced form).
Use the pivot columns from the original matrix A, not from the row-reduced form. Row operations change column relationships, so the reduced columns do not lie in the original column space.
1 2 3
A = 2 4 7
1 2 4
1 2 3 1 2 3 1 2 3
2 4 7 → 0 0 1 → 0 0 1
1 2 4 0 0 1 0 0 0
Pivots appear in columns 1 and 3. Column 2 is a free column.
a₁ = (1, 2, 1)ᵀ a₃ = (3, 7, 4)ᵀ
The row space of a matrix A, written Row(A), is the subspace of ℝⁿ spanned by the rows of A. The row space lives in the input space ℝⁿ, while the column space lives in the output space ℝᵐ.
The row space represents the directions in the input space that the matrix can "detect." Input vectors perpendicular to the row space are sent to zero — they lie in the null space.
Unlike the column space, the row space is preserved by row operations. Taking linear combinations of rows does not change what those rows span. Therefore, use the nonzero rows of the echelon form as a basis for Row(A) — you may use the reduced rows directly, which is not permitted for the column space.
r₁ = (1, 2, 3) r₂ = (0, 0, 1)
For column space: take pivot columns from the original matrix. For row space: take nonzero rows from the echelon form. These rules are different because row operations change columns but preserve row span.
The null space of a matrix A, written Null(A), is the set of all solutions to the homogeneous system Ax = 0:
Null(A) = {x ∈ ℝⁿ : Ax = 0}
The null space always contains the zero vector and is a subspace of ℝⁿ (the input space).
Suppose u and v are both in Null(A), meaning Au = 0 and Av = 0. Then A(u + v) = Au + Av = 0 + 0 = 0, so u + v is also in Null(A). Similarly, A(cu) = cAu = c0 = 0, so scalar multiples stay in the null space. Closed under addition and scalar multiplication — the null space is a subspace.
Geometric meaning: The null space contains all input vectors that the matrix collapses to zero — vectors "invisible" to the matrix. If the null space contains only the zero vector, the matrix is one-to-one: different inputs produce different outputs. If the null space contains nonzero vectors, information is lost. The null space lives in the input space ℝⁿ, just like the row space.
Finding the null space means solving the homogeneous system Ax = 0. Because the right-hand side is zero and row operations preserve this, you only need to row-reduce A itself, then identify pivot and free variables and write the solution in parametric vector form.
1 2 0
0 0 1
0 0 0
Pivot columns: 1 and 3. Free column: 2. Let x₂ = t (free parameter).
From row 2: x₃ = 0
From row 1: x₁ + 2x₂ = 0 → x₁ = −2x₂ = −2t
x = t · (−2, 1, 0)ᵀ
1 2 0 3
B = 2 4 0 6
1 2 0 3
0 0 0 0
Pivot column: 1. Free columns: 2, 3, 4. Let x₂ = s, x₃ = t, x₄ = u.
From row 1: x₁ = −2x₂ − 3x₄ = −2s − 3u
x = s·(−2,1,0,0)ᵀ + t·(0,0,1,0)ᵀ + u·(−3,0,0,1)ᵀ
The rank of a matrix A, written rank(A), is the dimension of the column space of A. Equivalently, the rank equals:
· The number of pivot columns in the row echelon form of A
· The number of nonzero rows in the echelon form
· The dimension of the row space of A
All three descriptions give the same number. That the column space and row space always have the same dimension is one of the most important theorems in linear algebra.
The rank measures how much independent information the matrix contains. A matrix with high rank preserves more information about the input; a matrix with low rank collapses more information. If A is m × n, then rank(A) ≤ min(m, n).
| Condition | Name | Meaning |
|---|---|---|
rank(A) = n | Full column rank | Columns are independent; Ax = 0 has only x = 0; map is one-to-one |
rank(A) = m | Full row rank | Every b ∈ ℝᵐ is reachable; Ax = b always has at least one solution |
rank(A) = n = m | Full rank (square) | Matrix is invertible; unique solution to Ax = b for every b |
rank(A) < min(m,n) | Rank-deficient | Some output directions missing; some inputs collapsed to zero |
rank(A) = 2
Matrix B (2×4 from earlier): echelon form has 1 nonzero row and 1 pivot column.
rank(B) = 1
The nullity of a matrix A, written nullity(A), is the dimension of the null space of A. Since the null space is spanned by one vector for each free variable in Ax = 0, the nullity equals the number of free variables — the number of non-pivot columns in the row echelon form.
Nullity and information loss: If the nullity is 0, the matrix is one-to-one — no information is lost. If the nullity is large, many different inputs map to the same output: the matrix collapses a high-dimensional subspace of inputs to zero.
nullity(A) = 1 (confirmed: null space is a line — dimension 1)
Matrix B (2×4): 1 pivot column → 3 free columns.
nullity(B) = 3 (confirmed: null space is three-dimensional)
Let A be an m × n matrix. Then: rank(A) + nullity(A) = n where n is the number of columns of A.
This says that rank and nullity partition the total number of input dimensions. Every column is either a pivot column (contributing to rank) or a free column (contributing to nullity). Since there are exactly n columns, the two counts must sum to n.
Think of the Rank-Nullity Theorem as a conservation law for dimensions:
dimensions preserved + dimensions collapsed = total input dimensions
Rank counts independent directions mapped to nonzero outputs. Nullity counts independent directions collapsed to zero. Together they account for all of ℝⁿ.
rank(A) + nullity(A) = n
3 + nullity(A) = 7
nullity(A) = 4
rank(A) + 0 = 5 → rank(A) = 5The system Ax = b is consistent (has at least one solution) if and only if b ∈ Col(A) — that is, if and only if b is a linear combination of the columns of A.
To check: augment [A | b] and row-reduce. If rank([A|b]) = rank(A), the system is consistent. If rank([A|b]) = rank(A) + 1, the system is inconsistent — a new pivot appeared in the last column.
1 2 3 | 1 1 2 3 | 1 1 2 3 | 1
2 4 7 | 3 → 0 0 1 | 1 → 0 0 1 | 1
1 2 4 | 2 0 0 1 | 1 0 0 0 | 0
No new pivot in the last column. rank([A|b]) = 2 = rank(A). Consistent.
1 2 3 | 1 1 2 3 | 1 1 2 3 | 1
2 4 7 | 3 → 0 0 1 | 1 → 0 0 1 | 1
1 2 4 | 3 0 0 1 | 2 0 0 0 | 1
New pivot in the last column (the equation 0 = 1). rank([A|b']) = 3 > 2 = rank(A). Inconsistent.
Row reduction is the universal tool for finding all three bases. It is worth summarizing the procedures clearly, because each subspace requires different handling:
| Subspace | Procedure | Why |
|---|---|---|
| Column space | Identify pivot columns from echelon form; take those columns from the original matrix A | Row ops change columns; use original |
| Row space | Take the nonzero rows of the echelon form | Row ops preserve row span; use reduced rows |
| Null space | Reduce to RREF; express pivot vars in terms of free vars; write parametric vectors | Free vars directly produce basis vectors |
1 0 2 −1
C = 0 1 −1 2
2 1 3 0
1 0 2 −1
0 1 −1 2
0 0 0 0
Pivot columns: 1 and 2. Free columns: 3 and 4.
c₁ = (1,0,2)ᵀ c₂ = (0,1,1)ᵀ
r₁ = (1, 0, 2, −1) r₂ = (0, 1, −1, 2)
x = s·(−2, 1, 1, 0)ᵀ + t·(1, −2, 0, 1)ᵀ
rank(C) + nullity(C) = 2 + 2 = 4 = n ✓
| Subspace | Dimension | Basis |
|---|---|---|
| Col(C) | 2 | c₁, c₂ from original matrix |
| Row(C) | 2 | rows 1 and 2 from echelon form |
| Null(C) | 2 | two parametric vectors |
Every m × n matrix A has four fundamental subspaces, first identified and named by Gilbert Strang. These four subspaces describe everything about the structure of the linear map defined by A.
| Subspace | Symbol | Lives in | Dimension | Geometric meaning |
|---|---|---|---|---|
| Column space | Col(A) | ℝᵐ (output) | r | All reachable outputs |
| Left null space | Null(Aᵀ) | ℝᵐ (output) | m − r | Output directions unreachable |
| Row space | Row(A) | ℝⁿ (input) | r | Input directions detectable |
| Null space | Null(A) | ℝⁿ (input) | n − r | Input directions collapsed to zero |
where r = rank(A). Notice: in ℝᵐ, the column space and left null space have dimensions r and m − r that sum to m. In ℝⁿ, the row space and null space have dimensions r and n − r that sum to n. This is a second expression of the Rank-Nullity idea — both ambient spaces are completely partitioned.
The row space and null space are orthogonal complements in ℝⁿ: every vector in the row space is perpendicular to every vector in the null space. Similarly, the column space and left null space are orthogonal complements in ℝᵐ. You can see a preview now: a vector v in the null space satisfies Av = 0. If r is any row of A, the dot product r · v equals the corresponding component of Av, which is 0. So null space vectors are perpendicular to all rows — perpendicular to the entire row space. Chapter 11 will develop this relationship fully and precisely.
Draw two large ovals for the input space ℝⁿ (left) and the output space ℝᵐ (right). Inside the left oval, draw two non-overlapping shaded regions: a darker region labeled "Row space, dim = r" and a lighter region labeled "Null space, dim = n−r". Inside the right oval, draw two non-overlapping regions: darker "Column space, dim = r" and lighter "Left null space, dim = m−r". Draw arrows from the row space region to the column space region labeled "A maps these to nonzero outputs." Draw a collapsed arrow from the null space region to the origin in the right oval labeled "A sends these to 0."
Col(A) ⊂ ℝ³ dim = r = 2 (a plane)
Null(Aᵀ) ⊂ ℝ³ dim = m − r = 1 (a line)
Row(A) ⊂ ℝ³ dim = r = 2 (a plane)
Null(A) ⊂ ℝ³ dim = n − r = 1 (a line)
In data science and statistics, a data matrix A might have m observations (rows) and n features (columns). The rank tells you how many truly independent patterns exist in the data. If the rank is much smaller than n, many features carry no information that cannot be recovered from the others. This is the foundation of principal component analysis (PCA), encountered in Data Science Foundations and Machine Learning Mathematics.
When n > m (more unknowns than equations), a consistent system has infinitely many solutions — the null space is nontrivial. The solution set has dimension equal to the nullity: a whole family parameterized by the free variables. When m > n (more equations than unknowns), the system generally has no exact solution unless b happens to lie in the column space of A. This is the context for least squares approximation (Chapter 11): when Ax = b has no solution, find the x that makes Ax as close as possible to b.
80 40 160 80
D = 70 35 140 70
90 45 180 90
60 30 120 60
Determine the rank and interpret the result.
rank(D) = 1
Row operations change columns. The RREF pivot columns (containing standard basis vectors) are not in the column space of the original A. Correct approach: use the pivot positions to identify which columns to take, but take those columns from the original matrix.
Rows live in ℝⁿ (input space). Columns live in ℝᵐ (output space). They are not the same when m ≠ n, and even when m = n they are distinct subspaces with distinct meanings. Column space uses original pivot columns; row space uses reduced nonzero rows.
The null space is a subspace, not a single vector. When there is one free variable, the null space is span{v} — a whole line. When there are two free variables, the null space is a plane. Always express Null(A) as a span, and verify the nullity matches the number of free variables.
The rank is at most min(m, n), but it may be less. A 4 × 7 matrix can have rank anywhere from 0 to 4. You must row-reduce the matrix to determine the actual rank. Many matrices are rank-deficient.
A 5 × 3 matrix can still have a nontrivial null space if its rank is less than 3. Whether the null space is trivial depends entirely on the rank, not on whether m > n. Always check rank before drawing conclusions about the null space.
The Rank-Nullity Theorem uses the number of columns n, not rows m. The null space lives in the input space ℝⁿ, and nullity counts free variables — which depend on the number of columns. Correct statement: rank(A) + nullity(A) = n.
A system can be consistent (have solutions) without A being invertible. If A has a nontrivial null space, the system may have infinitely many solutions. Invertibility requires both consistency (at least one solution) and uniqueness (exactly one solution), which requires nullity 0.
Chapter 10 has revealed the deep structure inside every matrix: four subspaces, two dimensions (rank and nullity), and a beautiful theorem connecting them. But there is a geometric relationship you have only glimpsed: the row space and the null space are perpendicular, and the column space and the left null space are perpendicular.
To understand perpendicularity precisely in ℝⁿ, you need the concept of the dot product and orthogonality — the subjects of Chapter 11.
Chapter 11 will define the dot product and length precisely for vectors in ℝⁿ, define orthogonal vectors, orthogonal sets, and orthogonal complements, and prove that the null space is the orthogonal complement of the row space. It will develop projections as a way to find the "closest" vector in a subspace, and introduce least squares as an application of projection when a system has no exact solution. The fundamental subspaces you identified in Chapter 10 will become the geometric stage for Chapter 11's orthogonality theory.
For each matrix: (a) row-reduce to echelon form, (b) identify pivot columns, (c) write a basis for the column space from the original matrix, (d) state the dimension.
Find the null space of each matrix in parametric vector form. State the nullity.
Find rank and nullity for each matrix; verify Rank-Nullity. Then complete the fill-in-the-blank table.
For the matrix below, find all three bases and all four fundamental subspace dimensions.
1 2 1 0
D = 0 0 1 1
1 2 2 1
Find: (a) basis for Col(D) from original matrix; (b) basis for Row(D) from echelon form; (c) basis for Null(D) in parametric form; (d) rank and nullity; (e) verify Rank-Nullity; (f) dimensions of all four fundamental subspaces.
Each problem shows a student's error. Identify the mistake and write the correct solution.
What is the error? What is the correct column space basis?
What went wrong? What is the correct nullity?
The computation may be correct, but the description is wrong. What should the student have written?
Identify the error and write the correct statement about where the row space lives.
What is the correct application of the Rank-Nullity Theorem? What is the actual nullity?
You now know how to find four fundamental subspaces inside any matrix and how rank and nullity measure the structure of those subspaces. Throughout this chapter, one geometric relationship appeared as a preview: the null space and the row space are perpendicular, and the column space and the left null space are perpendicular. To work with perpendicularity carefully in ℝⁿ, you need a precise tool for measuring angles between vectors. That tool is the dot product, also called the inner product. Chapter 11 will use it to develop the full theory of orthogonality and projections — proving the orthogonal complement relationships, finding the "closest" vector in a subspace, and introducing least squares solutions when no exact solution exists. Every result in Chapter 11 depends on the subspace structure you built in Chapter 10.