Engineering/Mathematics/Vectors
Null Spaces, Spans and Linear Independence
Row reduction hands you exactly vectors whose span is the null space of a matrix. Those vectors are always linearly independent, so the description they give is not merely correct but minimal.
- Core level
- Stream: independence
- Reading time 14 min
- Ref KVS-ENG-MATH-0026
- Taxonomy
- Engineering / Mathematics
- Prerequisite
- Reduced row-echelon form, span, linear independence
- Key result
- The null space spanning set is linearly independent
- Set size
- vectors, one per free variable
- Reads off
- Nullity, degrees of freedom, redundancy
- Produced by
- One Gauss-Jordan reduction of
Overview
The null space of an matrix is the set of all vectors with . It is an infinite set whenever the matrix is rank-deficient, so it cannot be listed; it has to be described. The span construction supplies the description — a finite list of vectors whose linear combinations generate everything — and row reduction supplies the list.
A spanning set alone is a weak result. Any set can be padded with redundant vectors and still span the same space, so a spanning set carries no guarantee of economy. The substantive claim on this page is that the particular set produced by row reduction, one vector per free variable, is linearly independent. Nothing in it can be discarded and nothing in it is a combination of the others.
Independence upgrades the description in two ways that matter operationally. First, the count is meaningful: the set has exactly elements, and because no smaller spanning set exists, is the true number of degrees of freedom of the homogeneous system. Second, coordinates become unique: every null space vector is a linear combination of these vectors in precisely one way, so the free variables act as genuine, non-interacting parameters.
The proof is short and instructive because it exploits a structural accident of the construction. In the positions corresponding to free variables, the vectors carry a pattern of ones and zeros that is a copy of the identity matrix. Comparing a single entry of a relation of linear dependence therefore isolates a single scalar and forces it to zero. That pattern-reading argument recurs throughout linear algebra whenever independence must be proved rather than tested.
Definition
Null Space of a Matrix
NSMFor an matrix , the null space is the set of all size- column vectors annihilated by :
The null space is a property of alone. Changing the vector of constants changes the solution set of the system but not the null space.
Linearly Independent Set of Column Vectors
LICVA set of vectors from is linearly independent when the only scalars satisfying are . Any equation of that form is a relation of linear dependence; the all-zero choice is the trivial one, and independence says the trivial relation is the only one.
Null Space Basis Vectors
BNSLet be the reduced row-echelon form of , with non-zero rows, pivot column indices and non-pivot indices . For each with , define the size- vector entrywise by
- when and ;
- when and ;
- when and .
In words: switch on the -th free variable, switch off every other free variable, and let the pivot rows dictate the remaining entries.
Concepts
The theorem: a spanning set that is also independent
For an matrix with row-equivalent reduced row-echelon form of rank , the set constructed above satisfies both and " is linearly independent". The first conclusion says nothing is missing; the second says nothing is surplus. Together they make a basis, and they make the exact dimension of the null space.
The spanning half comes directly from the vector form of the solution set of a homogeneous system: writing every dependent variable in terms of the free ones expresses an arbitrary solution as . The independence half is the new content, and it is what stops the description from being wasteful.
The identity pattern in the free positions
Stack the vectors as columns and delete every row whose index lies in . What remains is the identity matrix, because was defined to hold in position and in every other free position. This is not an incidental feature; it is the entire mechanism of the independence proof.
Start with a relation of linear dependence and read off entry of both sides. Every term except the -th contributes , and the -th contributes . The equation collapses to . Repeating for each forces all scalars to zero, which is precisely linear independence.
Why independence is worth proving separately
Spanning and independence are logically unrelated properties. A set of ten vectors can span a two-dimensional space, and a set of two vectors can be independent without spanning anything of interest. Redundant spanning sets are common: any set containing , or containing a vector twice, or containing a vector already expressible from the others, still spans.
Redundancy is expensive. It inflates parameter counts, makes the coefficients in a representation non-unique, and produces rank-deficient design matrices downstream. Proving that the row-reduction output is independent therefore certifies that the parameters are genuinely independent knobs, not an over-parameterisation waiting to cause trouble.
Uniqueness of representation
Independence is equivalent to uniqueness of coordinates. If a vector in the null space could be written as and also as , subtracting gives , a relation of linear dependence. Independence forces every difference to vanish, so for all .
For the standard null space basis the unique coordinates are especially transparent: the coefficient on is simply the value of the free variable . Reading a vector's coordinates requires no computation at all — just inspect entries .
Canonicality and the rank-nullity count
Because reduced row-echelon form is unique, the set is determined by alone. Two engineers reducing the same matrix, by different pivot sequences and in different orders, obtain the same vectors. This makes a legitimate canonical output that can be stored, compared and version-controlled.
The count that falls out is the rank-nullity relationship in its most concrete form: . Every column is accounted for exactly once, either as a pivot column contributing to rank or as a free column contributing a null space direction.
Homogeneous solutions inside general solutions
For a consistent non-homogeneous system , the solution set is for any single particular solution . The vectors appear unchanged in that description — only the constant vector depends on .
The engineering reading is direct. The particular solution is one admissible operating point; the null space basis is the set of independent adjustments that move you to another admissible point without violating any constraint. Solving one system therefore yields the entire family of alternatives at no extra cost.
Procedure: build an independent spanning set for the null space
Equations
Entrywise construction of the null space basis vectors
EQ-BNS-01One vector for each non-pivot column index . The first two cases create the identity pattern; the third copies the negated entries of the reduced form.
Null space as a span of the constructed set
EQ-BNS-02Every solution of the homogeneous system is a linear combination of these vectors, and every such combination is a solution.
Entry of a relation of linear dependence
EQ-BNS-03The independence argument in one line. Reading a single free-variable position of the relation isolates one scalar and forces it to vanish.
Dimension of the null space
EQ-BNS-04The size of an independent spanning set is the dimension. Without independence the count would only be an upper bound.
General solution of a consistent system
EQ-BNS-05A particular solution plus the null space. For a homogeneous system and the solution set is the null space itself.
Rank-nullity accounting of the columns
EQ-BNS-06Variable Definitions
| Symbol | Name | Meaning | Domain / type |
|---|---|---|---|
| Coefficient matrix | The matrix whose null space is being described | m x n matrix over C | |
| Reduced form | The unique reduced row-echelon form row-equivalent to | m x n matrix over C | |
| Rank | Number of non-zero rows of , equivalently the number of pivot columns | 0 to min(m,n) | |
| Pivot index set | Column indices carrying leading ones; these index the dependent variables | subset of 1..n of size r | |
| Free index set | Column indices without leading ones; these index the free variables | subset of 1..n of size n-r | |
| Null space basis vector | The solution obtained by setting free variable to one and all other free variables to zero | vector in C^n | |
| Relation scalar | Coefficient of in a candidate relation of linear dependence | complex scalar | |
| Null space | All vectors with | subspace of C^n | |
| Particular solution | Any single solution of a consistent non-homogeneous system | vector in C^n |
Worked Numerical Example
Problem statement
A process model links five stream variables through three linearised balance equations. The constraint Jacobian is the matrix below. Find an independent set of vectors spanning its null space — the admissible perturbations that keep all three balances satisfied — and confirm the degrees of freedom available to the designer.
State the constraint matrix
Rows are the three balance equations, columns are the five stream variables through .
Reduce to reduced row-echelon form
Gauss-Jordan elimination gives . Three non-zero rows, so ; the leading ones sit in columns 1, 3 and 4.
Record the index sets
Pivot columns give , so , , . The remaining columns give , so and . The set will contain vectors, and and are the free variables.
Build from free column 2
Entry 2 is and entry 5 is . The pivot entries are the negated column-2 entries of : entry takes , entry takes , entry takes .
Build from free column 5
Entry 5 is and entry 2 is . Entry takes , entry takes , entry takes .
Verify both vectors lie in the null space
Multiply by the original matrix, not the reduced one. For : , , . For : , , . Both give .
Confirm independence from the pattern
Extract rows 2 and 5 — the free positions — from the matrix . The result is the identity, so any relation read at entry 2 gives and read at entry 5 gives .
State the null space
The two vectors span the null space and are linearly independent, so they form a basis and the nullity is .
The design has exactly two degrees of freedom. Any feasible operating point can be shifted along or , or any combination of the two, without disturbing the three balances — and because the pair is independent, those two adjustments are genuinely distinct: no setting of one reproduces the effect of the other. Stream 4 appears with a zero entry in both vectors, so is pinned by the balances and offers no freedom at all.
Applications & Industry Use
Independent recycle and purge adjustments
Linearised material balances around a flowsheet give a constraint matrix whose null space is the set of flow adjustments that preserve every balance. An independent spanning set names the smallest number of manipulated variables an operator must touch, and guarantees that no two of those handles duplicate each other.
Self-stress states in redundant frames
For a pin-jointed structure the equilibrium matrix maps member forces to nodal loads. Its null space contains the self-stress states — internal force patterns in equilibrium with zero external load. An independent basis for that space gives the exact degree of static indeterminacy and a non-overlapping set of prestress patterns for form-finding.
Redundant manipulator null space motion
A redundant arm has more joints than task-space coordinates, so the Jacobian has a non-trivial null space. An independent basis for it defines self-motions that reconfigure the arm while holding the end effector fixed, used for obstacle avoidance and joint-limit management without disturbing the task.
Elementary flux modes
A stoichiometric matrix at steady state imposes on the flux vector. The null space is the space of admissible steady-state flux distributions, and an independent basis identifies the smallest number of independent pathways needed to account for all observed metabolism.
Datum defects in adjustment networks
A free network adjustment has a singular normal matrix whose null space corresponds to unconstrained translations, rotations and scale. An independent basis for that space quantifies exactly how many datum constraints must be imposed, and which, to make the adjustment determinate.
Exact collinearity in design matrices
When a regression design matrix is rank-deficient, the null space describes the coefficient directions to which the data are blind. An independent basis lists these unidentifiable directions without repetition, showing precisely which reparameterisations or constraints will restore identifiability.
Design Considerations
Reduce the coefficient matrix only
For a homogeneous system the augmented column is zero and remains zero under every row operation, so carrying it is wasted arithmetic. Reduce alone and treat the invisible zero column as understood. This is the one situation where dropping the augmented column is safe.
Verify against the original matrix
The construction reads entries out of , so any error committed during reduction is inherited without complaint: the vectors will lie in the null space of the erroneous but not of . Always confirm using the original entries. It is matrix-vector products and it catches the failure that the method cannot self-detect.
The empty set is a legitimate answer
When there are no free columns, is empty, and the null space is . Interpreting the span of the empty set as keeps the statement uniform, but code and prose both tend to mishandle this case. Test it explicitly: a nonsingular square matrix always lands here.
This basis is canonical, not optimal
Uniqueness of the reduced form makes reproducible, which is valuable for comparison and testing. It does not make well conditioned, sparse in a useful pattern, or physically meaningful. If the application wants an orthonormal null space basis, take the trailing right singular vectors instead; if it wants a sparse or non-negative basis, expect to post-process.
Nullity is discontinuous in the data
The count jumps as soon as the rank changes, and rank changes under arbitrarily small perturbations. A matrix that is exactly rank-deficient in the model may be full rank once measurement noise is added, collapsing a genuine degree of freedom into a merely ill-conditioned direction. Any production nullity determination must be stated together with the tolerance that produced it.
Free variable choice is fixed by the pivot pattern
Which variables become free is decided by the reduced form, not by engineering preference. If a particular variable must be free for interpretability, permute the columns before reducing and permute back afterwards, keeping a careful record. Reordering columns changes which basis you obtain, though not the subspace it spans.
Standards & Codes
Notation, interchange and numerical standards that govern how this material is written down, stored and computed in production systems.
| Reference | Title | Relevance to this topic |
|---|---|---|
ISO 80000-2 | Quantities and units — Part 2: Mathematics | Fixes the notation used here: italic scalars, arrow or bold vectors, upright operator names such as , and set-builder braces for the null space. |
IEEE 754-2019 | IEEE Standard for Floating-Point Arithmetic | Defines the rounding behaviour that makes the rank — and therefore the size of this basis — a tolerance-dependent decision in any floating-point implementation. |
LAPACK / BLAS reference | Linear Algebra PACKage reference implementation | Provides xGESVD and xGEQP3, the rank-revealing routines a numerical code should use to obtain a null space basis, in preference to a floating-point reduced row-echelon form. |
ISO/IEC 40314 | Mathematical Markup Language (MathML) Version 3.0 | Encodes the piecewise definition of and the matrix displays on this page as semantic markup rather than images. |
W3C WCAG 2.1 AA | Web Content Accessibility Guidelines | Requires the column vectors and case definitions to carry text alternatives so their structure is available to screen readers and remains legible under magnification. |
Material Selection
For a mathematical topic, "material" is the numeric representation: the scalar field, storage format and precision the computation is built from.
| Representation | Select when | Trade-off |
|---|---|---|
| Exact rational arithmetic | Symbolic or structural work where the pivot pattern, and hence the number of degrees of freedom, must be certain. | Gives an exactly correct nullity with no tolerance, but intermediate fractions can grow rapidly on larger integer matrices. |
| Arbitrary-precision integers with fraction-free elimination | Integer constraint matrices from incidence, stoichiometry or connectivity models. | Keeps entries integral and bounded via Bareiss-style elimination, at the cost of a final scaling step to recover the reduced form. |
| IEEE 754 binary64 | Measured or simulated Jacobians where the data already carry uncertainty. | Fast and standard, but requires an explicit rank tolerance; a near-dependency can be silently promoted to independence or vice versa. |
| Orthonormal null basis from SVD | Numerical work where conditioning matters more than reproducibility of a canonical form. | Well-conditioned and stable with a principled tolerance from the singular values, but the basis is dense and loses the interpretable zero-one pattern. |
| Finite field arithmetic modulo a prime | Coding theory, combinatorial designs and modular rank certification. | Exact with fixed-size operands, but the nullity over a finite field can exceed the nullity over the rationals for unlucky primes. |
| Sparse storage with fill-reducing ordering | Very large structured constraint matrices from network or finite element models. | Preserves memory for the input, but full reduction produces heavy fill-in; a sparse QR or iterative null space method is usually preferable. |
Manufacturing Notes
Implementation notes — how the result is actually produced by hand, by algorithm and by library, including cost and numerical behaviour.
Cost is one reduction plus a copy
Producing the entire basis costs a single Gauss-Jordan reduction, roughly operations for a square system, plus work to transcribe the entries. There is no per-vector solve. Anyone re-solving the homogeneous system once for each free variable is doing times more work than necessary.
Hand procedure
Write the reduced form, box the pivot columns, and rule a vertical line under each free column. Then fill one output vector per ruled column: a at that column's own position, at the other free positions, and the negated entries of the ruled column distributed into the pivot positions in pivot order. Distributing into the wrong pivot positions is the dominant hand error, and it happens whenever the pivots are assumed to lie on the diagonal.
Library behaviour
SymPy's Matrix.nullspace returns exactly this construction over the rationals, one vector per free column with the identity pattern intact. SciPy's scipy.linalg.null_space returns an orthonormal basis from the SVD with a tolerance derived from machine epsilon and the matrix dimensions. The two answers span the same space but agree entry-for-entry only by coincidence; never compare them elementwise.
Verification technique
Three checks together are conclusive. Confirm the set size equals minus the number of pivot columns; confirm against the original matrix for every ; and confirm the submatrix on the free rows is the identity. The last check is cheap and certifies independence without forming any relation of linear dependence.
Scaling for presentation
The vectors frequently contain fractions when the reduced form does. Multiplying an individual by a non-zero scalar preserves both the span and the independence, so clearing denominators is safe for reporting. It does destroy the identity pattern, so do the scaling last, after the independence check.
Failure Modes & Common Mistakes
| Failure mode / mistake | Impact | Root cause | Prevention & detection |
|---|---|---|---|
| Assuming a spanning set is automatically minimal | high | Reporting the number of vectors in an arbitrary spanning set as the dimension of the space. | Only an independent spanning set counts the dimension. Verify independence, or obtain the set from a construction such as this one that guarantees it. |
| Placing the negated entries in the wrong positions | high | Assuming pivot lies in column , so entry is written at position instead of position . | Write out explicitly before constructing anything, and index the assignment by rather than by row number. |
| Forgetting the sign | high | Copying instead of , because the reduced row reads and the transposition step is skipped. | Verify against the original matrix; a sign error fails this test immediately. |
| Reducing the augmented matrix of a non-homogeneous system | medium | Applying the construction to with , which produces vectors of the wrong size describing the wrong set. | The null space is defined by alone. Reduce ; obtain the particular solution separately if the general solution set is wanted. |
| Miscounting nullity as the number of zero rows | medium | Confusing with ; these agree only when the matrix is square. | Count non-pivot columns. Zero rows count dependent equations, which is a different quantity entirely. |
| Treating a numerically small pivot as zero, or not | high | Exact comparison against zero on floating-point data, so a rounding artefact of magnitude either creates or destroys a free column. | Use a scaled tolerance relative to the matrix norm, or determine the null space from an SVD and state the threshold used. |
| Claiming the empty set spans nothing | low | Special-casing incorrectly and reporting an error or an undefined result instead of . | Adopt the convention that the span of the empty set is and unit-test the full-rank case. |
| Assuming this basis is orthogonal | medium | Using the vectors as if they were an orthonormal frame, for example by projecting with plain dot products. | The construction guarantees independence only. Apply the Gram-Schmidt procedure, or take an SVD-based basis, if orthogonality is required. |
FAQs
Why does the set produced by row reduction have to be linearly independent?
Because of the pattern the construction plants in the free-variable positions. Vector holds at position and at every other free position, so reading entry of any relation of linear dependence collapses the whole sum to the single term . That forces for every , which is exactly independence.
Is this the only basis for the null space?
No. Any independent set of vectors drawn from the null space is a basis, and there are infinitely many of them once the nullity is at least one. What is special about this one is that it is determined uniquely by the matrix, because the reduced row-echelon form is unique, and that its coordinates are readable by inspection.
What happens when the matrix has full column rank?
Then , there are no free columns, and the constructed set is empty. The null space is , the system has only the trivial solution, and for a square matrix this is precisely the nonsingular case. The count still works: nullity .
How does this relate to the vector form of a general solution set?
Identically. Solving and writing the answer in vector form produces a constant vector plus the same vectors multiplied by the free variables. Setting makes and leaves the null space description untouched, which is why one reduction answers both questions.
Can I use these vectors as coordinates for a null space element?
Yes, and the coordinates are free. Because the set is independent, the representation of any null space vector as a combination of the is unique, and the coefficient on is just the value of in that vector. No solve is required to extract coordinates.
Should I use this construction in floating-point code?
Usually not. The pivot pattern it depends on is discontinuous in the matrix entries, so rounding can change the number of vectors returned. For numerical work take an orthonormal null space basis from a singular value decomposition with an explicit tolerance; reserve this construction for exact arithmetic and for reasoning about structure.
Does scaling one of the vectors break anything?
It preserves the span and the independence, so the set remains a basis. It does break the identity pattern in the free positions, which means the coefficient on that vector is no longer simply the value of the corresponding free variable. Rescale only for presentation, and only after all verification is complete.
References
- Beezer, R. A. A First Course in Linear Algebra, Version 0.70. University of Puget Sound, 2006. Section LI, Subsection NSSLI. Licensed under the GNU Free Documentation License v1.2.
- ISO 80000-2:2019, Quantities and units — Part 2: Mathematics. International Organization for Standardization.
- Golub, G. H. and Van Loan, C. F. Matrix Computations, 4th edition. Johns Hopkins University Press, 2013.
- Anderson, E. et al. LAPACK Users' Guide, 3rd edition. Society for Industrial and Applied Mathematics, 1999.
- IEEE 754-2019, IEEE Standard for Floating-Point Arithmetic. Institute of Electrical and Electronics Engineers.
AI Suggested Questions
- Construct a 4x7 matrix whose null space basis from row reduction contains exactly three vectors, and show the identity pattern in the free positions.
- Compare the null space basis from reduced row-echelon form with the orthonormal basis returned by an SVD for the same matrix, and explain when each is preferable.
- If I permute the columns of a matrix before reducing, how does the resulting null space basis change, and how do I map it back?
- Show why an independent spanning set of a subspace cannot be larger than any other spanning set of the same subspace.
- Give a numerical example where a rank tolerance of 1e-10 and one of 1e-14 produce null space bases of different sizes.
- How do the null space basis vectors of a stoichiometric matrix relate to elementary flux modes in metabolic network analysis?
Related Calculators
Row-reduce any matrix and return the independent basis vectors together with the pivot and free index sets.
Matrix Rank & Nullity CalculatorReport rank, nullity and the pivot column pattern with a selectable numerical tolerance.
Linear Independence CheckerTest any set of column vectors for independence and, when dependent, return an explicit relation of linear dependence.
