WhatsApp us
University Maths25 Nov 2026

The Rank–Nullity Theorem Explained, with Examples for Matrices and Linear Transformations

What the rank–nullity theorem says, why it is true, and how to use it on matrices, polynomial maps and matrix spaces, with six checked examples, common mistakes and practice.

The Rank–Nullity Theorem Explained, with Examples for Matrices and Linear Transformations

The rank–nullity theorem says that for an m×n matrix A, rank A + nullity A = n, the number of columns. For a linear map T from a finite-dimensional space V, it reads dim(ker T) + dim(im T) = dim V. Put simply, every input dimension is either crushed to zero or survives into the image, and the theorem counts both. Below are the reason it holds, six original examples and the quick deductions examiners love.

The two versions, side by side

Matrix version. If A is m×n, then

rank A + nullity A = n

where rank A is the dimension of the column space and nullity A is the dimension of the null space, the solutions of Ax = 0.

Linear map version. If T : V → W is linear and V is finite-dimensional, then

dim(ker T) + dim(im T) = dim V

The kernel lives in the domain V and the image lives in the codomain W, but both dimensions are measured against the domain. The codomain's dimension does not appear at all, which surprises many students the first time.

Why it is true

Row reduce A to reduced row echelon form. Each of the n columns is either a pivot column or a free column, never both.

  • The number of pivot columns is the rank.
  • Each free column gives one free variable in Ax = 0, and each free variable contributes one basis vector of the null space, so the number of free columns is the nullity.

Pivots plus free columns = all n columns. For a general linear map, choose a basis of the kernel, extend it to a basis of V, and show that T applied to the extra vectors gives a basis of the image. Proving that extension step yourself is a standard exercise and worth doing once.

Our linear algebra tutor online page explains how sessions with Ajay Vatsyayan work if you want to practise proofs like this with feedback.

What each number tells you

QuantityHow to read it from the RREFWhat it tells you
rank Anumber of pivotsdim of column space = dim of row space
nullity Anumber of free variables (n − rank)how many independent solutions Ax = 0 has
nullity = 0a pivot in every columnT is one-to-one (injective)
rank = ma pivot in every rowT is onto (surjective); Ax = b solvable for every b
square A, rank = npivots everywhereinvertible, and injective and surjective together

Example 1: a 3×4 matrix, with bases for both spaces

Let A = [[1, 2, 0, 3], [2, 4, 1, 8], [1, 2, 1, 5]].

R₂ − 2R₁ gives (0, 0, 1, 2) and R₃ − R₁ gives (0, 0, 1, 2); subtracting these two clears the last row:

RREF = [[1, 2, 0, 3], [0, 0, 1, 2], [0, 0, 0, 0]]

Pivots in columns 1 and 3, so rank A = 2. Columns 2 and 4 are free: set x₂ = s, x₄ = t. Then x₃ = −2t and x₁ = −2s − 3t, so

x = s(−2, 1, 0, 0) + t(−3, 0, −2, 1)

Nullity 2, and 2 + 2 = 4 columns. For the column space, take columns 1 and 3 of the original A: (1, 2, 1) and (0, 1, 1). Not the RREF columns: (1, 0, 0) is not even in the column space of A.

Example 2: a tall matrix and a hidden dependency

Let B = [[1, 1, 2], [1, 3, 4], [2, 1, 3], [0, 1, 1]], a 4×3 matrix.

Look before you row reduce: column 3 = column 1 + column 2 in every row. So the columns span only a plane, rank B = 2, and rank–nullity forces nullity = 3 − 2 = 1. The dependency itself is the null space: c₁ + c₂ − c₃ = 0 means (1, 1, −1) spans ker B.

Every column dependency is a null space vector, and every null space vector is a column dependency. That one sentence explains a lot of exam questions.

Example 3: a map on polynomials

Define T : P₃ → R² by T(p) = (p(1), p(−1)), where P₃ is the polynomials of degree at most 3 (dimension 4).

Image first. p = (1 + x)/2 gives (1, 0) and p = (1 − x)/2 gives (0, 1), so the image is all of R²: rank 2. The theorem then says nullity = 4 − 2 = 2 without solving anything.

To name the kernel: p(1) = p(−1) = 0 means (x − 1)(x + 1) divides p, so p = (x² − 1)(a + bx). A basis is x² − 1 and x³ − x. Two vectors, as predicted.

Example 4: a map on 2×2 matrices

Let T(X) = X − Xᵀ on the 4-dimensional space of 2×2 matrices. For X = [[a, b], [c, d]],

T(X) = [[0, b − c], [c − b, 0]]

The kernel is every X with b = c, the symmetric matrices, which have three free entries: nullity 3. The image is every multiple of [[0, 1], [−1, 0]]: rank 1. And 3 + 1 = 4.

Example 5: using the theorem instead of a matrix

Let a = (1, 2, 3) and T(v) = a × v on R³.

The kernel is the set of v parallel to a, so it is the line spanned by a: nullity 1. Rank–nullity gives rank 2. Every a × v is perpendicular to a, so the image sits inside the plane x + 2y + 3z = 0, which is two-dimensional. A 2-dimensional subspace inside a 2-dimensional plane must be the whole plane, so the image is exactly that plane. No matrix was needed.

Example 6: rank depending on a parameter

For which k does K = [[1, 2, 1], [2, k, 2], [1, 2, k]] have a nontrivial null space?

det K = (k − 1)(k − 4), so K is invertible (rank 3, nullity 0) unless k = 1 or k = 4.

  • k = 1: rows 1 and 3 are both (1, 2, 1), so rank 2 and nullity 1.
  • k = 4: row 2 becomes (2, 4, 2) = 2 × row 1, so rank 2 and nullity 1.

In both special cases the rank drops by exactly one, so the null space is a line, not a plane.

Quick deductions that need no row reduction

  • A linear map R⁵ → R³ cannot be one-to-one. Rank is at most 3, so nullity is at least 2.
  • A linear map R³ → R⁵ cannot be onto. Rank is at most 3, so the image misses most of R⁵.
  • A 6×9 matrix of rank 6 has nullity 3, and Ax = b is solvable for every b, because the column space is all of R⁶.
  • For a square matrix, one-to-one and onto are the same thing. Nullity 0 forces rank n.
  • The eigenspace of λ has dimension n − rank(A − λI). This is rank–nullity applied to A − λI, and it is the count you need when deciding diagonalisability.

Where students lose marks

  • Using m instead of n. Nullity is n − rank, with n the number of columns (the domain dimension), not rows.
  • Taking column space vectors from the RREF. Use the pivot columns of the original matrix.
  • Mixing up where things live. The kernel is in the domain; the image is in the codomain. A basis of ker T for T : P₃ → R² consists of polynomials, not pairs of numbers.
  • Listing a spanning set that is not independent. A null space basis must have exactly nullity vectors. If you have more, some are redundant.
  • Forgetting to show the map is linear. For maps given by a formula, check additivity and scaling first, or say why the map is linear.
  • Applying the theorem to an infinite-dimensional domain. The statement needs dim V finite.

Practice questions

  1. Find the rank, the nullity and a basis for the null space of [[1, −1, 2, 0, 1], [2, −2, 5, 1, 3], [−1, 1, −1, 1, 0]].
  2. Find the rank and nullity of the trace map from 2×2 matrices to R.
  3. For differentiation D : P₃ → P₃, find the kernel and the rank.
  4. A 7×4 matrix has a one-dimensional null space. What is its rank, and is Ax = b solvable for every b in R⁷?
  5. Can a linear map T : R⁴ → R⁴ have ker T = im T? What about T : R³ → R³?
  6. Let T : P₂ → P₂ be T(p) = x·p′(x). Find the rank and nullity.

Answers.

  1. RREF [[1, −1, 0, −2, −1], [0, 0, 1, 1, 1], [0, 0, 0, 0, 0]]: rank 2, nullity 3, basis (1, 1, 0, 0, 0), (2, 0, −1, 1, 0), (1, 0, −1, 0, 1).
  2. Rank 1 (the image is all of R), nullity 3.
  3. Kernel = constant polynomials, so nullity 1 and rank 3 (the image is P₂).
  4. Rank 3. No: the column space is only three-dimensional inside R⁷.
  5. R⁴: yes, for example T(x₁, x₂, x₃, x₄) = (x₃, x₄, 0, 0), where both equal the span of the first two standard basis vectors. R³: no, because ker = im would need 2·dim ker = 3.
  6. T(1) = 0, T(x) = x, T(x²) = 2x², so rank 2 (image spanned by x and x²) and nullity 1 (the constants).

Where the theorem leads next

Rank–nullity is the counting tool behind much of a first course. It decides how many eigenvectors a repeated eigenvalue has (see our eigenvalues and eigenvectors examples), which feeds directly into diagonalising a matrix. It is easiest to apply once you can write down the matrix of a linear transformation in a chosen basis. Later it appears as the first isomorphism theorem in abstract algebra, and in data science as the reason a regression with more variables than independent data rows has infinitely many solutions.

If the words kernel, image and dimension still feel abstract, our article on why vector spaces make linear algebra feel hard is a good companion. Students writing their first proofs in parallel may also like our guide to starting real analysis proofs, since the structure of a good argument is the same.

How Maths Bodhi helps

Rank–nullity questions reward clear reasoning more than long calculation. In online sessions we take your own course problems, ask you to justify each dimension count, and review your written proofs so they read the way a marker expects. We explain and practise; we don't complete graded work. Indian B.Tech and IIT students can also see our first-year IIT maths support.

Home tuition is available in Gurgaon (Gurugram). Students elsewhere in India and abroad learn with us online. You can book a free demo class.

Written and checked by the Maths Bodhi team (November 2026).

Frequently asked questions

What does the rank nullity theorem state?
For an m×n matrix, rank + nullity = n; for a linear map on a finite-dimensional space V, dim ker + dim image = dim V.
How do you find the nullity of a matrix?
Row reduce it and count the free variables, or compute n minus the rank.
Does rank nullity use the number of rows or columns?
Columns, because the null space lives in the domain, which has dimension n.
How do you use rank nullity for a linear transformation?
Find whichever of the kernel or image is easier, then the theorem gives the other dimension as dim V minus it.
Can a linear map from R3 to R2 be injective?
No; its rank is at most 2, so its nullity is at least 1.
What is the nullity of an invertible matrix?
Zero, since Ax = 0 has only the trivial solution and the rank equals n.
rank nullity theoremlinear algebranull spacelinear transformationsuniversity maths

Related guides

Keep exploring this maths topic

University Maths2 Nov 2026

Why Linear Algebra Feels Hard After the First Few Weeks, and How to Fix It

Many students cope with matrix calculations, then get lost at subspaces, independence, bases and linear maps. Here is why that happens, five worked examples of the questions that cause it, and a study method that gets you through.

linear algebra helpvector spaceslinear algebra proofsuniversity linear algebra

By Maths Bodhi Team

Read guide

University Maths25 Nov 2026

How to Find the Matrix of a Linear Transformation: Examples and Solutions

How to build the matrix of a linear transformation from a formula, from images of other vectors, from a geometric description, on polynomial and function spaces, and in a new basis, with six checked examples and practice.

linear transformationslinear algebrachange of basisstandard matrix

By Maths Bodhi Team

Read guide

University Maths25 Nov 2026

Singular Value Decomposition Explained, with Step-by-Step Examples

What the singular value decomposition A = UΣVᵀ means, how to compute it by hand for square and rectangular matrices, and how it gives low-rank approximations and the pseudo-inverse, with checked examples and practice.

singular value decompositionSVDlinear algebrapseudo-inverse

By Maths Bodhi Team

Read guide

University Maths25 Nov 2026

Linear Algebra for Machine Learning: What You Actually Need, with Small Worked Examples

The linear algebra that computer science and data science students really use in machine learning, mapped to the topics of a standard course, with a small worked example for each idea.

linear algebramachine learningdata sciencePCA

By Maths Bodhi Team

Read guide

University Maths25 Nov 2026

The Gram–Schmidt Process and Least Squares, Step by Step

How the Gram–Schmidt process builds an orthogonal basis, how it gives the QR factorisation, and how both solve least squares problems such as fitting a line, with six checked examples and practice.

Gram-Schmidtleast squaresQR factorisationlinear algebra

By Maths Bodhi Team

Read guide

University Maths25 Nov 2026

Diagonalization of a Matrix: The Test, the Method and 6 Worked Examples

How to diagonalise a matrix as A = PDP⁻¹, how to tell quickly whether it can be done, and how to use it for matrix powers, symmetric matrices and differential equations, with checked examples and practice.

diagonalizationlinear algebraeigenvaluesmatrix powers

By Maths Bodhi Team

Read guide