Bring the mental model from Vector Spaces; this page will reuse it instead of restarting from zero.
Linear Algebra
Rank, Null Space, Column Space, and Conditioning
Rank says which outputs a matrix can reach, null space says which inputs disappear, and conditioning says how fragile those directions are numerically.
Concept Structure
Rank, Null Space, Column Space, and Conditioning
Start with the picture, metaphor, or geometric mechanism.
Make the objects explicit and connect them with notation.
Mirror the equations with runnable implementation details.
Manipulate the mechanism and watch the idea respond.
Learning map
Rank, Null Space, Column Space, and ConditioningConceptual Bridge
What should feel connected as you move through this page.
Rank says which outputs a matrix can reach, null space says which inputs disappear, and conditioning says how fragile those directions are numerically.
The next edge should feel earned: use the demo prediction here before following Orthogonality, Projections, and Least-Squares Geometry.
01
Intuition
Build the mental picture first so the rest of the page has something to attach to.
A matrix is a machine that turns input directions into output directions.
Some output directions are reachable. Those directions form the column space. If you ask the matrix to produce an output outside that space, no input vector can do it exactly.
Some input directions disappear. Those directions form the null space. If is in the null space of , then . Moving along that direction changes the coefficients but does not change the output.
The rank tells you how many independent output directions survive. If rank is low, the matrix has crushed the input space into a smaller output space. If a direction is almost crushed but not exactly zero, the matrix may still be full rank in exact algebra, but it can be numerically fragile. That is poor conditioning: tiny output perturbations can require huge changes in the input or coefficient vector.
This is why rank and conditioning sit underneath so much machine learning:
- Least squares asks whether feature columns span the target direction well enough.
- PCA and low-rank models ask which directions carry most variation.
- Regularization damps directions that are poorly identified.
- Numerical solvers become fragile when a matrix nearly loses a direction.
One sentence to carry through the page:
A matrix reaches its column space, hides its null space, and becomes unstable when a nearly hidden direction still has to be solved for.
02
Math
Translate the story into symbols, assumptions, and a derivation you can inspect.
Let
and define the linear map
Write the columns of as
The column space of is the set of all outputs the map can reach:
The rank is the dimension of that reachable output space:
The null space is the set of input directions that vanish:
Its dimension is the nullity:
Rank-nullity says that every input dimension either survives into the image or is lost in the kernel:
For a square matrix :
- If , the map has no nonzero null-space direction and is invertible.
- If , some nonzero direction disappears, so cannot have a unique solution for every .
For rectangular matrices, "full rank" means
That can still mean different things. A tall full-column-rank matrix has no nonzero null-space direction, but it cannot reach every vector in . A wide full-row-rank matrix can reach every vector in , but it has non-unique inputs because its null space is nontrivial.
Conditioning adds a numerical layer. Let the singular values of be
where . Singular values tell us how much stretches orthogonal input directions. A zero singular value is an exactly vanished direction. A tiny singular value is an almost vanished direction.
For a full-rank square matrix, the 2-norm condition number is
If , the matrix is singular and this ratio is infinite. If is merely tiny, the matrix may be exactly invertible but practically fragile.
That fragility appears when solving
A small perturbation can produce a much larger change in the solution when has a tiny singular direction. In learning language: the predictions may barely change, but the coefficients can swing wildly. Regularization and SVD-based solvers handle this by damping or separating those fragile directions instead of pretending every direction is equally trustworthy.
Two caveats matter:
- Exact rank is a mathematical property. Numerical rank depends on a tolerance, the data scale, and floating-point precision.
- A large condition number is a sensitivity warning. It does not say every computation will fail; it says there are directions where small errors can be amplified.
03
Code
Keep the implementation aligned with the notation so the algorithm is legible.
import numpy as np
matrices = {
"stable full rank": np.array([[1.0, 0.25], [0.0, 1.0]]),
"ill-conditioned": np.array([[1.0, 1.00], [0.0, 0.02]]),
"rank deficient": np.array([[1.0, 1.00], [0.0, 0.00]]),
}
x_true = np.array([1.0, -0.7])
noise = np.array([0.0, 1e-3])
for name, A in matrices.items():
_, s, vh = np.linalg.svd(A)
rank = np.linalg.matrix_rank(A, tol=1e-10)
cond = np.inf if s[-1] < 1e-12 else s[0] / s[-1]
hidden_direction = vh[-1]
hidden_output = np.linalg.norm(A @ hidden_direction)
b = A @ x_true
b_noisy = b + noise
x_hat, *_ = np.linalg.lstsq(A, b, rcond=None)
x_noisy, *_ = np.linalg.lstsq(A, b_noisy, rcond=None)
solution_change = np.linalg.norm(x_noisy - x_hat)
print(f"\n{name}")
print("singular values:", np.round(s, 6))
print("rank:", rank, "condition:", cond)
print("||A @ smallest-singular-vector||:", round(hidden_output, 6))
print("solution change from tiny noise:", round(solution_change, 6))
The exact rank-deficient matrix has a true null-space direction: the smallest singular vector maps to zero. The ill-conditioned matrix is still full rank, but that same diagnostic is tiny, and the least-squares solution becomes much more sensitive to the same output perturbation.
04
Interactive Demo
Use direct manipulation to connect the explanation to a moving system.
Predict what kind of matrix you are seeing before revealing the diagnostics.
The left panel shows the input unit square. The right panel shows the same square after multiplication by . If the image stays like a healthy parallelogram, the matrix is stable full rank. If the parallelogram becomes a very thin sliver, the matrix is full rank but fragile. If it collapses onto a line, the matrix has lost rank.
After you commit a prediction, the reveal shows:
- as a 2D area signal
- singular values and
- the condition number
- a null or near-null input direction
- how much a tiny output perturbation changes the recovered input
Live Concept Demo
Explore Rank, Null Space, Column Space, and Conditioning
The stage is code-native and interactive. Use it to test the explanation against the mechanism.
Manipulate one control and predict the visible change.
Commit to what Rank, Null Space, Column Space, and Conditioning should make visible before reading the result.
After The First Pass
Turn the concept into an inspected object.
Once the invariant is visible in the intuition, math, code, and demo, use these panels to inspect the mechanism visually, check source support, practice the idea, and attach a grounded research question.
Mechanism Storyboard
See the idea move before the page explains it
Rank says which outputs a matrix can reach, null space says which inputs disappear, and conditioning says how fragile those directions are numerically.
Start with the picture, metaphor, or geometric mechanism.
Before reading further, choose the kind of change Rank, Null Space, Column Space, and Conditioning should make visible.
Visual Inquiry
Make the image answer a mathematical question
Rank says which outputs a matrix can reach, null space says which inputs disappear, and conditioning says how fragile those directions are numerically.
Which visible object should carry the first intuition?
Pick the cue that should make Rank, Null Space, Column Space, and Conditioning easier to reason about before the page gives the answer.
Source Grounding
Canonical references for the mechanism on this page.
Primary source for rank, image/column space, kernel/null space, full rank, rank deficiency, rank-nullity, and SVD geometry.
Open sourcePrimary source for poor conditioning as rapid output change under small input perturbations and error amplification by matrix inversion.
Open sourceDocumentation source for practical numerical-rank tolerance and condition-number helpers used in the runnable witness.
Open sourceClaim Review
Rank says which outputs a matrix can reach, null space says which inputs disappear, and conditioning says how fragile those directions are numerically.
Claims without a substantive review badge still need exact source-support review.
deisenroth-2020-mml-rank-nullity, goodfellow-2016-deep-learning-poor-conditioning, numpy-linalg-rank-cond-docs
Use equation, code, and demo objects to check whether the source support is operational.
The page combines exact subspace facts from MML with the Deep Learning Book's numerical-conditioning warning, then uses NumPy's documented SVD-based helpers only for practical floating-point diagnostics.
Sources: Mathematics for Machine Learning, Deep Learning, Chapter 4: Numerical Computation, NumPy linear algebra reference: matrix_rank and condExact rank is algebraic, while numerical rank depends on tolerance. A large condition number is a sensitivity warning, not proof that every output or every solver will fail.A bounded review summary is present; still check caveats and exact source scope.MML pages 53 and 64-66 support rank, column space/image, kernel/null space, full-rank/rank-deficient language, and rank-nullity. MML SVD sections support singular-value geometry. Deep Learning Book section 4.2 supports poor conditioning as sensitivity to small input perturbations and intrinsic error amplification.
Reviewer: codex-source-excerpt-audit; reviewed 2026-06-28Source support candidates
book 2020Mathematics for Machine LearningPrimary source for rank, image/column space, kernel/null space, full rank, rank deficiency, rank-nullity, and SVD geometry.
book 2016Deep Learning, Chapter 4: Numerical ComputationPrimary source for poor conditioning as rapid output change under small input perturbations and error amplification by matrix inversion.
documentation 2026NumPy linear algebra reference: matrix_rank and condDocumentation source for practical numerical-rank tolerance and condition-number helpers used in the runnable witness.
Practice Loop
Try the idea before it explains itself
Rank says which outputs a matrix can reach, null space says which inputs disappear, and conditioning says how fragile those directions are numerically.
Before touching the demo, predict one visible change that should happen in Rank, Null Space, Column Space, and Conditioning.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
A concrete answer is on the canvas.
The answer names why the claim should hold.
It touches the page context or a neighboring idea.
Research Room
Attach the question to an exact object
Pick the concept, equation, source, code witness, claim, misconception, or demo state before asking for help. The handoff stays grounded to that object.Open the draft below to save one note and next action in this browser.
Rank, Null Space, Column Space, and Conditioning
What is the smallest example that makes Rank, Null Space, Column Space, and Conditioning click without losing the math?
Local action draftNo local draft saved yetExpand only when ready to capture one local next action
This draft stays locally in this browser for concept:linear-algebra/rank-null-column-space-conditioning.
- Source ids to inspect: deisenroth-2020-mml-rank-nullity, goodfellow-2016-deep-learning-poor-conditioning, numpy-linalg-rank-cond-docs
- Definition, prerequisite, and contrast concept links
- The equation or code witness that makes the concept operational
- One demo state that shows the invariant instead of a slogan
- The learner can state the mechanism in their own words
- The learner can name the prerequisite that would repair confusion
- The learner can predict how the mechanism changes under one perturbation
I am working in Continuous Function's research reading room. Object: concept - Rank, Null Space, Column Space, and Conditioning Object key: concept:linear-algebra/rank-null-column-space-conditioning Context: Linear Algebra Anchor id: concept/concept-notebook/linear-algebra/rank-null-column-space-conditioning Open question: What is the smallest example that makes Rank, Null Space, Column Space, and Conditioning click without losing the math? Evidence to inspect: - Source ids to inspect: deisenroth-2020-mml-rank-nullity, goodfellow-2016-deep-learning-poor-conditioning, numpy-linalg-rank-cond-docs - Definition, prerequisite, and contrast concept links - The equation or code witness that makes the concept operational - One demo state that shows the invariant instead of a slogan What would resolve this: - The learner can state the mechanism in their own words - The learner can name the prerequisite that would repair confusion - The learner can predict how the mechanism changes under one perturbation Answer as a careful research tutor: stay source-grounded, separate verified evidence from assumptions, name the relevant math objects, and end with one next action.
concept/concept-notebook/linear-algebra/rank-null-column-space-conditioning
concept:linear-algebra/rank-null-column-space-conditioning