LINEAR ALGEBRA • MATRIX DECOMPOSITIONS & STRUCTURE

Rank-Nullity Theorem

Every matrix splits its input space into two complementary parts whose sizes always add up perfectly.

Historical Context & Motivation

Imagine you have a machine that takes in a list of numbers, mixes them up using a rule, and spits out a new list. Some inputs produce unique outputs, while other inputs get "crushed" to zero. Mathematicians spent centuries trying to understand this behavior. The Rank-Nullity Theorem is the elegant answer they found — a simple equation that connects the useful outputs of a matrix to the inputs it destroys.

To understand where this theorem came from, let's look at a few key moments in the history of linear algebra.

1750s
Systems of Equations
Mathematicians like Gabriel Cramer and Leonhard Euler developed rules for solving systems of linear equations. They noticed that some systems have one solution, some have many, and some have none at all.
1850s
Matrices Are Born
Arthur Cayley and James Joseph Sylvester introduced the idea of a matrix — a rectangular grid of numbers — as a compact way to organize and study linear equations.
1870s
Rank and Nullity
Georg Frobenius formalized the concept of rank (how many independent directions a matrix uses) and nullity (how many directions it crushes to zero).
1884
The Theorem Takes Shape
Sylvester and others proved that for any matrix, rank + nullity always equals the number of columns. This became known as the Rank-Nullity Theorem, one of the most important results in linear algebra.
1900s–Today
Modern Applications
The theorem is now a cornerstone tool used in computer graphics, data science, engineering, and machine learning to understand how information flows through mathematical systems.

The central question this theorem answers is simple but powerful: if a matrix has a certain number of input slots (columns), how are those slots divided between the directions that produce real output and the directions that get squished to zero? The Rank-Nullity Theorem says the answer is a perfect split — no column is left unaccounted for.

Core Principles & Definitions

Before we state the theorem, we need to understand four key ideas. Think of a matrix as a function that transforms input vectors into output vectors. The theorem describes how those inputs get sorted into two groups.

1

Matrix & Columns

A matrix is a rectangular grid of numbers. The number of columns (often called n) tells you the size of the input space — how many numbers go in.
2

Rank

The rank of a matrix counts how many truly independent output directions it can produce. It equals the number of pivot columns when you row-reduce the matrix.
3

Null Space (Kernel)

The null space is the set of all input vectors that get sent to the zero vector by the matrix. If you plug in a vector and get all zeros out, that vector lives in the null space.
4

Nullity

The nullity is the dimension of the null space — it tells you how many independent directions get crushed to zero. It equals the number of free variable columns.
KEY TAKEAWAY
Think of a matrix like a bus with a fixed number of seats (columns). Some seats carry passengers to a real destination (rank), and the rest are empty seats that go nowhere (nullity). No matter what bus (matrix) you pick, occupied seats + empty seats = total seats. That's the Rank-Nullity Theorem!

Visual Explanation

The diagram below shows how a matrix takes its input space and splits it into two pieces. On the left, you see the full input space (the domain). The matrix acts like a sorter: some input directions get mapped to actual outputs (the column space), while other input directions get flattened to zero (the null space). The theorem guarantees that these two pieces together account for every column.

The input space (left, purple) is divided into pivot directions that map to the column space (top right, cyan) and free directions that map to zero (bottom right, pink). The golden bar at the bottom shows the theorem: rank + nullity = n.

Notice how every input direction ends up in one of the two groups. The cyan arrows show directions that create real, nonzero outputs. The pink arrows show directions that the matrix "kills" — they all collapse to the zero vector. Together, these two groups account for every possible input direction, which is exactly what the theorem says.

Mathematical Framework

Now let's write the theorem out formally and understand each piece. Suppose A is an m × n matrix — that means it has m rows and n columns. When we multiply A by a column vector with n entries, we get a column vector with m entries. The theorem connects the structure of A to the number n.

RANK-NULLITY THEOREM
rank(A) + nullity(A) = n
rank(A) = the number of pivot columns in A (dimension of the column space). nullity(A) = the number of free variable columns in A (dimension of the null space). n = the total number of columns in A.

To find the rank and nullity, you row-reduce the matrix to its reduced row echelon form (RREF). Each column with a leading 1 (a pivot) is a pivot column, and every other column is a free column. Let's see a quick example of how to count these.

RREF IDENTIFICATION
A → RREF(A) → count pivots = rank, count free columns = nullity
Row reduction uses elementary row operations (swap rows, multiply a row by a nonzero constant, add a multiple of one row to another) to simplify the matrix. The number of pivots never changes no matter which sequence of operations you choose.
NULL SPACE EQUATION
Null(A) = { x⃗ ∈ ℝⁿ : A·x⃗ = 0⃗ }
The null space is the collection of all vectors x⃗ such that when you multiply A times x⃗, you get the zero vector. Solving Ax⃗ = 0⃗ is the same as solving a homogeneous system of linear equations.
💡 Quick Check
If a 4 × 7 matrix has 3 pivots, then rank = 3 and nullity = 7 − 3 = 4. There are 4 free variables, meaning the null space is 4-dimensional. The rank (3) plus the nullity (4) equals the number of columns (7). ✓

Detailed Breakdown — Pivot vs. Free Columns

Let's look at an actual matrix and see how pivots and free columns appear after row reduction. The diagram below shows a 3 × 5 matrix being row-reduced. Watch how each column is labeled as either a pivot column or a free column.

A 3 × 5 matrix is row-reduced to RREF. The leading 1s in columns 1 and 3 are pivots (rank = 2). Columns 2, 4, and 5 are free (nullity = 3). The green box confirms 2 + 3 = 5.

In the RREF, each row with a leading 1 contributes one pivot. The remaining columns without leading 1s correspond to free variables. When you solve Ax⃗ = 0⃗, each free variable can be set to anything, and the pivot variables adjust accordingly. The number of free variables tells you the dimension of the null space.

Pivot columns contribute to rank; free columns contribute to nullity.
Column TypeWhat It MeansContributes To
Pivot columnContains a leading 1 in RREF; variable is determined by the othersRank
Free columnNo leading 1; variable can be chosen freely when solving Ax⃗ = 0⃗Nullity

Worked Example

Let's work through a full example to find the rank and nullity of a matrix, then verify the Rank-Nullity Theorem.

Find the rank and nullity of A
1
Step 1 — Write Down the MatrixConsider the 3 × 4 matrix: A = [ 1 2 1 0 ] [ 2 4 3 1 ] [ 3 6 4 1 ] This matrix has m = 3 rows and n = 4 columns. The theorem tells us rank + nullity = 4.
2
Step 2 — Row-Reduce to RREFSubtract 2 × Row 1 from Row 2, and 3 × Row 1 from Row 3: [ 1 2 1 0 ] [ 0 0 1 1 ] [ 0 0 1 1 ] Subtract Row 2 from Row 3: [ 1 2 1 0 ] [ 0 0 1 1 ] [ 0 0 0 0 ] Subtract Row 2 from Row 1 to clear the entry above the second pivot: [ 1 2 0 −1 ] [ 0 0 1 1 ] [ 0 0 0 0 ]
RREF reached. Leading 1s appear in columns 1 and 3.
3
Step 3 — Count Pivots and Free ColumnsPivots are in column 1 and column 3. Free variable columns are column 2 and column 4.
Rank = 2, Nullity = 2
4
Step 4 — Verify the Theoremrank(A) + nullity(A) = 2 + 2 = 4. The matrix has 4 columns, so the Rank-Nullity Theorem checks out. ✓
2 + 2 = 4 = n ✓
5
Step 5 — Interpret the ResultThis tells us that out of the 4 input dimensions, the matrix A uses 2 of them to produce actual output (rank = 2), and the other 2 input directions get crushed to zero (nullity = 2). The null space is a 2-dimensional plane inside 4-dimensional space.

Strengths & Limitations

The Rank-Nullity Theorem is incredibly useful, but it's helpful to understand both what it can and what it can't tell you.

What the Rank-Nullity Theorem can and cannot do.
StrengthsLimitations
Gives you nullity for free once you know the rank, without solving Ax⃗ = 0⃗ fully.It tells you the size (dimension) of the null space, but not which specific vectors are in it.
Works for any matrix — square, tall, wide, any size.You still need to row-reduce to find the rank; the theorem doesn't skip that step.
Instantly tells you if a system Ax⃗ = 0⃗ has nontrivial solutions (if nullity > 0).It only applies to the homogeneous system Ax⃗ = 0⃗. For Ax⃗ = b⃗, you need more tools.
Helps determine if a matrix is invertible (rank = n and nullity = 0 for square matrices).Doesn't directly tell you about eigenvalues, determinants, or other deeper properties.
🔑 WHY IT MATTERS
The Rank-Nullity Theorem is like a conservation law in physics. In physics, energy can't be created or destroyed — it just changes form. Similarly, dimensions can't be created or destroyed by a matrix. Every input dimension either contributes to the rank (useful output) or to the nullity (crushed to zero). None is lost, and none appears from nowhere.

Connection to Advanced Topics

The Rank-Nullity Theorem is a gateway to several deeper ideas in linear algebra. As you advance, you'll see it connect to invertibility, determinants, and even more abstract theorems about linear transformations between vector spaces.

How the Rank-Nullity Theorem connects to more advanced linear algebra.
ConceptConnection to Rank-Nullity
Invertible Matrix TheoremA square n × n matrix is invertible if and only if rank = n and nullity = 0. The Rank-Nullity Theorem is the reason: if any dimension is "wasted" (nullity > 0), the matrix loses information and can't be undone.
Fundamental Theorem of Linear AlgebraThe Rank-Nullity Theorem is one piece of a bigger picture. The full theorem also describes the row space and left null space, giving four fundamental subspaces that completely describe any matrix.
Dimension Theorem for Linear MapsThe Rank-Nullity Theorem generalizes beyond matrices to any linear transformation T : V → W. The formula becomes dim(kernel of T) + dim(image of T) = dim(V).
Singular Value Decomposition (SVD)SVD breaks a matrix into its rank-r core plus the null space components. Rank-Nullity guarantees the split is clean and complete.

As you continue studying, you'll find that the Rank-Nullity Theorem keeps showing up in new contexts. It's one of those rare results that feels simple once you understand it, but its consequences reach into nearly every corner of linear algebra, data science, and engineering.

Practice Problems

PROBLEM 1CONCEPTUAL
In your own words, explain what the Rank-Nullity Theorem says. If a 5 × 8 matrix has rank 3, what is its nullity? What does that tell you about the null space?
PROBLEM 2BASIC CALCULATION
The RREF of a 4 × 6 matrix B is: [ 1 0 3 0 2 0 ] [ 0 1 −1 0 4 0 ] [ 0 0 0 1 5 0 ] [ 0 0 0 0 0 0 ] Find rank(B) and nullity(B). Verify the Rank-Nullity Theorem.
PROBLEM 3INTERMEDIATE
Consider the matrix: C = [ 1 1 2 ] [ 2 2 4 ] [ 3 3 6 ] Row-reduce C, find its rank and nullity, and describe what kind of solutions Cx⃗ = 0⃗ has.
PROBLEM 4APPLIED
A network engineer models data flow through 5 routers using a 5 × 5 matrix M. After analysis, she finds rank(M) = 5. What does the Rank-Nullity Theorem tell her about the nullity? What does this mean for the network — can two different input signals produce the same output?
PROBLEM 5CRITICAL THINKING
Can a 3 × 7 matrix ever have nullity equal to 0? Explain why or why not using the Rank-Nullity Theorem. What is the smallest possible nullity for a 3 × 7 matrix?

Summary

The Rank-Nullity Theorem states that for any m × n matrix A, rank(A) + nullity(A) = n. The rank counts the number of pivot columns (independent output directions), and the nullity counts the number of free columns (directions crushed to zero). Together they account for every column. You find the rank and nullity by row-reducing to RREF and counting pivots.

This theorem has far-reaching consequences. If a square matrix has full rank (rank = n), then nullity = 0 and the matrix is invertible. If a matrix is wider than it is tall (more columns than rows), then the nullity must be at least n − m, guaranteeing nontrivial null space solutions. The Rank-Nullity Theorem is a cornerstone of linear algebra that connects to the Invertible Matrix Theorem, the Fundamental Theorem of Linear Algebra, and Singular Value Decomposition.

Varsity Tutors • Linear Algebra • Rank-Nullity Theorem