← LibraryNull Spaces, Spans and Linear Independence | KEVOS® MathematicsProject Delivery · Project ManagementLesson 111/189← PrevNext →
ArticlePublished 8 Aug 202623 min readBy Kevin Jogin
Skip to content

Engineering/Mathematics/Vectors

Null Spaces, Spans and Linear Independence

Row reduction hands you exactly nr 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
nr vectors, one per free variable
Reads off
Nullity, degrees of freedom, redundancy
Produced by
One Gauss-Jordan reduction of A

Overview

The null space N(A) of an m×n matrix is the set of all vectors x with Ax=0. 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 nr elements, and because no smaller spanning set exists, nr 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 nr 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

NSM

For an m×n matrix A, the null space is the set of all size-n column vectors annihilated by A:

  • N(A)={xnAx=0}
Equivalently, it is the solution set of the homogeneous system with coefficient matrix A. It always contains 0, so it is never empty.

The null space is a property of A alone. Changing the vector of constants changes the solution set of the system but not the null space.

Linearly Independent Set of Column Vectors

LICV

A set S={u1,u2,,un} of vectors from m is linearly independent when the only scalars satisfying α1u1+α2u2++αnun=0 are α1=α2==αn=0. 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

BNS

Let B be the reduced row-echelon form of A, with r non-zero rows, pivot column indices D={d1,,dr} and non-pivot indices F={f1,,fnr}. For each j with 1jnr, define the size-n vector zj entrywise by

  • [zj]i=1 when iF and i=fj;
  • [zj]i=0 when iF and ifj;
  • [zj]i=[B]k,fj when iD and i=dk.
The set S={z1,z2,,znr} is the standard null space basis of A.

In words: switch on the j-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 m×n matrix A with row-equivalent reduced row-echelon form B of rank r, the set S={z1,,znr} constructed above satisfies both N(A)=span(S) and "S is linearly independent". The first conclusion says nothing is missing; the second says nothing is surplus. Together they make S a basis, and they make nr 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 xf1z1++xfnrznr. 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 z1,,znr as columns and delete every row whose index lies in D. What remains is the (nr)×(nr) identity matrix, because zj was defined to hold 1 in position fj and 0 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 α1z1++αnrznr=0 and read off entry fj of both sides. Every term except the j-th contributes αi0, and the j-th contributes αj1. The equation collapses to 0=αj. Repeating for each j 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 0, 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 nr 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 x in the null space could be written as αjzj and also as βjzj, subtracting gives (αjβj)zj=0, a relation of linear dependence. Independence forces every difference to vanish, so αj=βj for all j.

For the standard null space basis the unique coordinates are especially transparent: the coefficient on zj is simply the value of the free variable xfj. Reading a vector's coordinates requires no computation at all — just inspect entries f1,,fnr.

Canonicality and the rank-nullity count

Because reduced row-echelon form is unique, the set S is determined by A alone. Two engineers reducing the same matrix, by different pivot sequences and in different orders, obtain the same nr vectors. This makes S 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: rank(A)+nullity(A)=r+(nr)=n. 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 Ax=b, the solution set is {c+wwN(A)} for any single particular solution c. The vectors zj appear unchanged in that description — only the constant vector c depends on b.

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

Reduce A to BApply Gauss-Jordan elimination to the coefficient matrix alone; the augmented column of a homogeneous system is zero and stays zero.
Record r, D and FCount the non-zero rows to get r, list the pivot column indices as D, and take F as the remaining nr column indices.
Check for the trivial caseIf r=n then F is empty, S is empty and N(A)={0}. Stop.
Build one vector per free columnFor each fjF set entry fj to 1, all other free entries to 0, and entry dk to [B]k,fj.
Verify by multiplicationConfirm Azj=0 for each j. This catches arithmetic slips in the reduction itself, which the construction would otherwise propagate silently.
Report the basis and the nullityThe set S spans N(A), is linearly independent, and has size nullity(A)=nr.

Equations

Entrywise construction of the null space basis vectors

EQ-BNS-01
[zj]i={1iF,i=fj0iF,ifj[B]k,fjiD,i=dk

One vector for each non-pivot column index fj. 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-02
N(A)=span({z1,z2,,znr})

Every solution of the homogeneous system is a linear combination of these vectors, and every such combination is a solution.

Entry fj of a relation of linear dependence

EQ-BNS-03
0=[0]fj=i=1nrαi[zi]fj=αj(1)+ijαi(0)=αj

The 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-04
nullity(A)=dimN(A)=nr

The 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-05
S={c+j=1nrxfjzjxfj}

A particular solution c plus the null space. For a homogeneous system c=0 and the solution set is the null space itself.

Rank-nullity accounting of the columns

EQ-BNS-06
rank(A)+nullity(A)=r+(nr)=n

Variable Definitions

Symbols used on this page
SymbolNameMeaningDomain / type
ACoefficient matrixThe m×n matrix whose null space is being describedm x n matrix over C
BReduced formThe unique reduced row-echelon form row-equivalent to Am x n matrix over C
rRankNumber of non-zero rows of B, equivalently the number of pivot columns0 to min(m,n)
DPivot index setColumn indices d1<<dr carrying leading ones; these index the dependent variablessubset of 1..n of size r
FFree index setColumn indices f1<<fnr without leading ones; these index the free variablessubset of 1..n of size n-r
zjNull space basis vectorThe solution obtained by setting free variable xfj to one and all other free variables to zerovector in C^n
αjRelation scalarCoefficient of zj in a candidate relation of linear dependencecomplex scalar
N(A)Null spaceAll vectors x with Ax=0subspace of C^n
cParticular solutionAny single solution of a consistent non-homogeneous systemvector 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 3×5 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.

  1. State the constraint matrix

    Rows are the three balance equations, columns are the five stream variables x1 through x5.

    A=[120312417012103]
  2. Reduce to reduced row-echelon form

    Gauss-Jordan elimination gives B. Three non-zero rows, so r=3; the leading ones sit in columns 1, 3 and 4.

    B=[120010010200010]
  3. Record the index sets

    Pivot columns give D={1,3,4}, so d1=1, d2=3, d3=4. The remaining columns give F={2,5}, so f1=2 and f2=5. The set will contain nr=53=2 vectors, and x2 and x5 are the free variables.

  4. Build z1 from free column 2

    Entry 2 is 1 and entry 5 is 0. The pivot entries are the negated column-2 entries of B: entry d1=1 takes [B]1,2=2, entry d2=3 takes [B]2,2=0, entry d3=4 takes [B]3,2=0.

    z1=[21000]
  5. Build z2 from free column 5

    Entry 5 is 1 and entry 2 is 0. Entry 1 takes [B]1,5=1, entry 3 takes [B]2,5=2, entry 4 takes [B]3,5=0.

    z2=[10201]
  6. Verify both vectors lie in the null space

    Multiply by the original matrix, not the reduced one. For z1: 1(2)+2(1)=0, 2(2)+4(1)=0, 1(2)2(1)=0. For z2: 1(1)+0(2)+(1)(1)=0, 2(1)+1(2)+0(1)=0, 1(1)+1(2)+3(1)=0. Both give 0.

    Az1=0,Az2=0
  7. Confirm independence from the pattern

    Extract rows 2 and 5 — the free positions — from the matrix [z1z2]. The result is the 2×2 identity, so any relation α1z1+α2z2=0 read at entry 2 gives α1=0 and read at entry 5 gives α2=0.

    [[z1]2[z2]2[z1]5[z2]5]=[1001]
  8. State the null space

    The two vectors span the null space and are linearly independent, so they form a basis and the nullity is 2.

    N(A)=span({[21000],[10201]})
Result

The design has exactly two degrees of freedom. Any feasible operating point can be shifted along z1 or z2, 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 x4 is pinned by the balances and offers no freedom at all.

Applications &amp; Industry Use

Process &amp; chemical engineering

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.

Structural engineering

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.

Robotics &amp; mechanism design

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.

Systems biology &amp; metabolic engineering

Elementary flux modes

A stoichiometric matrix at steady state imposes Sv=0 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.

Geodesy &amp; surveying

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.

Computing &amp; data

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 A 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 B, so any error committed during reduction is inherited without complaint: the vectors will lie in the null space of the erroneous B but not of A. Always confirm Azj=0 using the original entries. It is nr matrix-vector products and it catches the failure that the method cannot self-detect.

The empty set is a legitimate answer

When r=n there are no free columns, S is empty, and the null space is {0}. Interpreting the span of the empty set as {0} 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 S reproducible, which is valuable for comparison and testing. It does not make S 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 nr 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 &amp; Codes

Notation, interchange and numerical standards that govern how this material is written down, stored and computed in production systems.

Applicable standards, conventions and reference implementations
ReferenceTitleRelevance to this topic
ISO 80000-2Quantities and units — Part 2: MathematicsFixes the notation used here: italic scalars, arrow or bold vectors, upright operator names such as dim, and set-builder braces for the null space.
IEEE 754-2019IEEE Standard for Floating-Point ArithmeticDefines the rounding behaviour that makes the rank r — and therefore the size nr of this basis — a tolerance-dependent decision in any floating-point implementation.
LAPACK / BLAS referenceLinear Algebra PACKage reference implementationProvides 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 40314Mathematical Markup Language (MathML) Version 3.0Encodes the piecewise definition of [zj]i and the matrix displays on this page as semantic markup rather than images.
W3C WCAG 2.1 AAWeb Content Accessibility GuidelinesRequires 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 and precision selection
RepresentationSelect whenTrade-off
Exact rational arithmeticSymbolic 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 eliminationInteger 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 binary64Measured 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 SVDNumerical 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 primeCoding 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 orderingVery 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 n3 operations for a square system, plus O(r(nr)) work to transcribe the entries. There is no per-vector solve. Anyone re-solving the homogeneous system once for each free variable is doing nr 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 1 at that column's own position, 0 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 n minus the number of pivot columns; confirm Azj=0 against the original matrix for every j; 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 zj 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 &amp; Common Mistakes

Failure modes, root causes and prevention
Failure mode / mistakeImpactRoot causePrevention & detection
Assuming a spanning set is automatically minimalhighReporting 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 positionshighAssuming pivot k lies in column k, so entry [B]k,fj is written at position k instead of position dk.Write out D explicitly before constructing anything, and index the assignment by dk rather than by row number.
Forgetting the signhighCopying [B]k,fj instead of [B]k,fj, because the reduced row reads xdk+[B]k,fjxfj=0 and the transposition step is skipped.Verify Azj=0 against the original matrix; a sign error fails this test immediately.
Reducing the augmented matrix of a non-homogeneous systemmediumApplying the construction to [Ab] with b0, which produces vectors of the wrong size describing the wrong set.The null space is defined by A alone. Reduce A; obtain the particular solution separately if the general solution set is wanted.
Miscounting nullity as the number of zero rowsmediumConfusing mr with nr; 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 nothighExact comparison against zero on floating-point data, so a rounding artefact of magnitude 1016 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 nothinglowSpecial-casing r=n incorrectly and reporting an error or an undefined result instead of N(A)={0}.Adopt the convention that the span of the empty set is {0} and unit-test the full-rank case.
Assuming this basis is orthogonalmediumUsing 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 zj holds 1 at position fj and 0 at every other free position, so reading entry fj of any relation of linear dependence collapses the whole sum to the single term αj. That forces αj=0 for every j, which is exactly independence.

Is this the only basis for the null space?

No. Any independent set of nr 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 r=n, there are no free columns, and the constructed set is empty. The null space is {0}, the system has only the trivial solution, and for a square matrix this is precisely the nonsingular case. The count still works: nullity =nr=0.

How does this relate to the vector form of a general solution set?

Identically. Solving Ax=b and writing the answer in vector form produces a constant vector c plus the same zj vectors multiplied by the free variables. Setting b=0 makes c=0 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 zj is unique, and the coefficient on zj is just the value of xfj 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

  1. 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.
  2. ISO 80000-2:2019, Quantities and units — Part 2: Mathematics. International Organization for Standardization.
  3. Golub, G. H. and Van Loan, C. F. Matrix Computations, 4th edition. Johns Hopkins University Press, 2013.
  4. Anderson, E. et al. LAPACK Users' Guide, 3rd edition. Society for Industrial and Applied Mathematics, 1999.
  5. 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

Continue learning

Algebraic and Geometric Multiplicities of Eigenvalues | KEVOS® MathematicsArticle · Project ManagementAmitsur’s Theorem on the Radical of a Polynomial Ring | KEVOS®Article · Project ManagementAmitsur’s Theorem on the Radical of an Algebra of Small Dimension | KEVOS®Article · Project ManagementArchetypes: Reference Catalogue of Worked Systems | KEVOS® MathematicsArticle · Project Management