← LibraryComputing Column Spaces | KEVOS® MathematicsProject Delivery · Project ManagementLesson 45/189← PrevNext →
ArticlePublished 8 Aug 202623 min readBy Kevin Jogin
Skip to content

Engineering/Mathematics/Matrices

Computing Column Spaces

A column space can be described in at least four ways, and they are not equivalent in usefulness. The most powerful of them turns the question inside out: instead of listing what is in C(A), it produces a small matrix L whose null space is the column space, converting membership into a couple of scalar tests.

  • Advanced level
  • Stream: computation
  • Reading time 15 min
  • Ref KVS-ENG-MATH-0052
Taxonomy
Engineering / Mathematics
Prerequisite
Column space, consistency test, reduced row-echelon form
Methods covered
Four, of increasing structural value
Key identity
C(A)=N(L)
Cost
One reduction of the m×(n+m) array [AIm]
Output
Linearly independent spanning set plus a membership test

Overview

The column space of a matrix is the set of all linear combinations of its columns, and equivalently the set of right-hand sides b for which Ax=b has a solution. That second reading is the one that matters in practice: knowing C(A) is knowing exactly which loads, demands or targets the system can meet.

Describing the set is another matter. The definition supplies a spanning set immediately — all n columns — but that set is usually redundant and gives no help in deciding membership. Selecting the pivot columns of A trims it to a linearly independent set drawn from genuine columns of the matrix, which preserves physical interpretation. Transposing and reducing yields a different independent set whose vectors carry a clean pattern of zeros and ones in their leading coordinates, which makes membership almost free to test.

The fourth description is structurally different from the other three. Rather than exhibiting generators, it produces a small matrix L with the property that C(A)=N(L). The column space is presented not as a span but as the solution set of a homogeneous system with mr equations. Membership of a vector b is then decided by evaluating mr scalar expressions, with no linear solve at all.

The route to L is worth understanding even where it is not the fastest way to a basis. Row-reduce the augmented matrix [Ab] carrying a symbolic right-hand side. Consistency requires that every entry of the final column corresponding to a zero row of the reduced A vanishes, and those requirements are homogeneous linear equations in the entries of b. Collecting their coefficients gives L. Doing this with symbols is error-prone, so the practical version augments with an identity matrix instead and lets the block record the same information numerically.

Definition

Column Space of a Matrix

CSM

Let A be an m×n matrix with columns A1,,An. The column space is C(A)=span({A1,,An})m.

Column Space and Consistent Systems

CSCS

For an m×n matrix A and a vector bm, the system Ax=b is consistent if and only if bC(A). This equivalence is what makes every column space computation simultaneously a solvability computation.

It follows directly from the fact that Ax is the linear combination of the columns of A with coefficients drawn from x.

Basis of the Column Space from original columns

BCS

Let B be the reduced row-echelon form of A and let D={d1,,dr} be the indices of the pivot columns of B. Then the corresponding columns of A — not of B — form a linearly independent set spanning C(A).

The pivot indices come from the reduced matrix; the vectors come from the original. Taking the columns of B instead is the classic error, since row operations do not preserve the column space.

Column space as a null space

CSNS

For an m×n matrix A of rank r there exists an (mr)×m matrix L, in reduced row-echelon form with no zero rows, such that C(A)=N(L). The rows of L are the consistency conditions on the right-hand side, and L is obtained from the trailing rows of the identity block after reducing [AIm].

Concepts

Method one: the definition

Writing C(A) as the span of all n columns costs nothing and is always correct, but it is the weakest description available. The generating set is typically dependent, so the representation of any given vector is not unique; the set may be far larger than the dimension r; and deciding whether a candidate b belongs still requires solving a full linear system. It is a definition, not a computation.

Method two: pivot columns of the original matrix

Reducing A identifies which columns are pivot columns. Those same-indexed columns of the original matrix form a linearly independent set that still spans C(A). This description has a property none of the others share: every basis vector is an actual column of A, so it retains whatever physical meaning the columns carried — a member force pattern, a reaction, a basis load. Its drawback is that the vectors have arbitrary entries, so membership testing is no easier than before.

Method three: transpose, reduce, transpose back

Since C(A)=R(At), the column space is the row space of the transpose, and the non-zero rows of RREF(At) transpose back into a linearly independent spanning set. The resulting vectors carry leading ones in the first few coordinates with zeros elsewhere in those positions, so the coefficients needed to express any member are read directly from its leading entries. Membership becomes: read r numbers, form the combination, compare the remaining mr coordinates.

Method four: solving with a symbolic right-hand side

Reduce [Ab] treating the entries of b as symbols. Nothing prevents this — the row operations chosen are exactly those that would reduce A alone, and the final column simply accumulates linear expressions in b1,,bm. When the reduced A has mr zero rows, consistency requires the corresponding entries of the final column to be zero. Those are mr homogeneous linear equations in the bi, so the set of admissible right-hand sides is the null space of their coefficient matrix L. This identifies C(A) as N(L).

Replacing the symbols with an identity block

Symbolic row reduction by hand is slow and error-prone, and produces results that differ superficially depending on the order of operations. The remedy is to write b=Imb and reduce [AIm] instead. The identity block accumulates the same linear expressions in numeric form; multiplying the reduced block by b afterwards recovers exactly the symbolic column. Standardising by continuing the reduction until the appended block is also in reduced form makes the answer unique, so every practitioner reaches the same L.

Why the null space description is worth the effort

A span answers 'what can I build?'; a null space answers 'what is admissible?'. For a consistency question the second form is far more direct. With L in hand, testing whether a load vector is achievable costs mr inner products and no factorisation, which matters when the same matrix is queried against thousands of candidate right-hand sides. The rows of L also have independent meaning: they are a basis for the left null space of A, so the same computation delivers the redundancy relations among the equations.

Choosing a column space description

Do the basis vectors need physical meaning?If each column of A represents a real object and the answer must be expressed in those terms, use the pivot columns of the original matrix.
Is the deliverable a compact spanning set?Transpose, reduce, discard zero rows and transpose back. The leading-one pattern makes the coefficients readable and the set is guaranteed independent.
Will many right-hand sides be tested?Compute L from the extended reduction. Each membership test then costs mr inner products with no solve.
Are other subspaces also required?The extended reduction of [AIm] supplies material for the null space, row space, column space and left null space at once.
Is only the dimension needed?Reduce A and count pivot columns. No basis construction is required for a rank figure.

Equations

Column space and consistency

EQ-CCS-01
bC(A)Ax=bis consistent

The equivalence that turns every column space computation into a solvability computation.

Basis from the pivot columns of A

EQ-CCS-02
C(A)=span({Ad1,Ad2,,Adr})

The indices di are read from the reduced form of A, but the vectors Adi are columns of the original matrix.

Column space via the transpose

EQ-CCS-03
C(A)=R(At)

Transpose, reduce, discard zero rows, transpose the survivors back into columns. The result is independent and carries a leading-one pattern.

Extended reduction

EQ-CCS-04
[AIm]reduce[BJ]=[CK0L]

The appended identity block records the cumulative row operations. The trailing mr rows of that block, in the last m columns, form L.

Column space as a null space

EQ-CCS-05
C(A)=N(L),LM(mr)m

The rows of L are the independent consistency conditions on the right-hand side. Testing membership costs mr inner products.

Consistency conditions written out

EQ-CCS-06
j=1m[L]kjbj=0,1kmr

Each row of L contributes one scalar equation that a right-hand side must satisfy for Ax=b to be solvable.

Dimension check across all descriptions

EQ-CCS-07
dimC(A)=r=mrank(L)

Every method must return r vectors, or an L of full row rank mr. A mismatch is a computational error, not a modelling subtlety.

Variable Definitions

Symbols used on this page
SymbolNameMeaningDomain / type
AMatrixThe m×n matrix whose column space is soughtm x n matrix over C
bRight-hand sideThe candidate vector whose membership of C(A) decides solvabilityvector in C^m
rRankNumber of non-zero rows of the reduced form of A; the dimension of C(A)0 to min(m,n)
DPivot column setIndices of the pivot columns of the reduced form of Asubset of 1..n
MAugmented arrayThe m×(n+m) matrix [AIm] before reductionm x (n+m) matrix
NExtended echelon formThe reduced row-echelon form of M, partitioned as [BJ]m x (n+m) matrix
JOperation recordThe last m columns of N; a nonsingular matrix with JA=Bm x m nonsingular matrix
LConsistency matrixThe last mr rows of J; satisfies C(A)=N(L)(m-r) x m matrix
C(A)Column spaceAll achievable right-hand sidessubspace of C^m

Worked Numerical Example

Problem statement

A four-node distribution network is driven through three independent supply settings, giving a 4 by 3 matrix mapping settings to nodal demands. Determine which demand vectors are achievable, using all four descriptions of the column space, and compare what each one is good for.

  1. Set up the matrix

    Column j holds the nodal demand pattern produced by unit supply setting j. There are m=4 nodes and n=3 settings.

    A=[121231352583]
  2. Method two: pivot columns of A

    Reducing A gives leading ones in columns 1 and 2, so r=2 and the third setting is dependent — indeed column 3 equals column 2 minus column 1. The basis drawn from the original matrix is therefore the first two columns, each of which is a real, physically meaningful demand pattern.

    RREF(A)=[101011000000],C(A)=span({[1235],[2358]})
  3. Method three: transpose and reduce

    Reducing At gives two non-zero rows. Transposing them back produces a different basis for the same subspace, this time with the identity pattern in the first two coordinates.

    RREF(At)=[101101120000],C(A)=span({[1011],[0112]})
  4. Method four, part one: augment with the identity

    Form the 4×7 array [AI4] and reduce it fully, continuing until the appended block is itself in reduced form so the result is unique. The reduced A occupies the first three columns and has two zero rows, confirming r=2.

    N=[1010085011005300010210000111]
  5. Extract L and read the consistency conditions

    The last mr=2 rows of the appended block give L. Multiplying L by a symbolic demand vector produces exactly the entries that must vanish for consistency, so the achievable demand vectors are those satisfying two scalar conditions.

    L=[10210111],{b12b3+b4=0b2+b3b4=0
  6. Method four, part two: a basis from N(L)

    The matrix L is already in reduced form with pivot columns 1 and 2 and free columns 3 and 4. Setting each free variable to 1 in turn gives a third basis for the same column space, this time with the identity pattern near the bottom.

    C(A)=N(L)=span({[2110],[1101]})
  7. Test two candidate demand vectors

    For b=(3,1,4,5) the conditions give 38+5=0 and 1+45=0, so the demand is achievable. For c=(3,1,4,6) the first condition gives 38+6=10, so it is not. Neither test involved solving a system.

  8. Cross-check the three bases

    All three sets have two vectors, matching r=2. Each vector from every set satisfies both rows of L: for instance (1,2,3,5) gives 16+5=0 and 2+35=0, while (1,0,1,1) gives 12+1=0 and 0+11=0. Three different descriptions, one subspace.

Result

The network can meet exactly a two-dimensional family of nodal demands out of a four-dimensional space of possibilities, so the third supply setting adds no capability. The pivot-column basis reports that capability in terms of real supply settings; the transpose basis gives the most compact generator list; the N(L) description converts every future feasibility query into the evaluation of two scalar expressions, which is the form to ship if demand vectors will be screened in bulk.

Applications & Industry Use

Power distribution

Screening feasible demand profiles

Where a network's achievable nodal injections form a low-dimensional subspace, the consistency matrix L reduces feasibility screening of a large catalogue of demand profiles to a handful of inner products per profile. Profiles failing a condition are rejected immediately, and the magnitude of the violation indicates how far the profile lies outside capability.

Manufacturing and blending

Achievable product specifications

Blending a fixed set of feedstocks generates a column space of achievable property vectors. Expressing that space as N(L) produces explicit linear conditions on the target specification, so an infeasible specification is identified and diagnosed before any optimisation is run and without a solver reporting an uninformative infeasibility.

Robotics and mechanism design

Reachable wrench and twist sets

The columns of a Jacobian span the instantaneous twists a mechanism can produce at a given configuration. A basis drawn from the original columns names which actuators contribute; the null space description gives the constraint wrenches that no actuation can resist, which is precisely the signature of a singular configuration.

Structural engineering

Self-equilibrating load identification

For a structure whose equilibrium matrix is rank-deficient in its rows, the conditions encoded in L state which external load vectors admit an equilibrium solution. Loads violating them cannot be carried by any distribution of internal forces, indicating a mechanism rather than a strength deficiency.

Signal processing

Subspace membership in array processing

The signal subspace of an array response matrix is its column space. Describing it by a set of orthogonality conditions rather than by generators aligns directly with subspace-based direction-finding methods, where the test statistic is the residual of a candidate steering vector against those conditions.

Scientific computing

Reduced-order model admissibility

Projection-based reduced-order models represent states within the column space of a basis matrix. The consistency conditions provide a cheap runtime check that an incoming snapshot lies within the trained subspace, flagging extrapolation before the reduced model is trusted to produce a prediction.

Design Considerations

Never take the columns of the reduced matrix

Row operations preserve the row space and the null space but move the column space. The pivot columns must be selected from the original A; the reduced form supplies only the indices. A quick confirmation is to check whether the reduced form has a zero row: if it does, every one of its columns has a zero in that coordinate while columns of A generally do not, so the two column spaces cannot be equal.

Match the description to the number of queries

If one right-hand side must be tested, an ordinary elimination on [Ab] answers the question immediately and any of these constructions is overkill. If thousands of right-hand sides must be screened against a fixed A, precomputing L once and evaluating mr inner products per query is dramatically cheaper. The break-even point is low.

Standardise the reduction if results must be comparable

Different operation orders produce different-looking consistency conditions that describe the same subspace. Continuing the reduction until the appended block is itself in reduced row-echelon form makes L unique, which is essential when the conditions are recorded in a specification, compared across teams, or regression-tested.

The extended reduction is more work but returns more

Reducing [AIm] processes an m×(n+m) array rather than m×n, so for a square matrix it roughly doubles the work. In exchange it delivers material for all four fundamental subsets and the transforming matrix J with JA=B. If more than one subspace is wanted, it is the cheaper path overall; if only one is wanted, it is not.

Avoid symbolic right-hand sides in production

Reducing with symbols in the final column is instructive for deriving where L comes from, but it is slow, hard to automate and prone to expression swell. Numerical and symbolic packages alike handle the identity-block formulation far better. Use symbols for the derivation and the identity block for the computation.

Choose a numerically defensible route for measured data

All four methods rest on an exact-rank decision that floating-point data cannot supply. Where A comes from measurement, the orthonormal column space basis from the leading left singular vectors of an SVD is the appropriate substitute, with the trailing left singular vectors playing the role of the rows of L and the singular-value gap justifying the chosen dimension.

Standards & 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: MathematicsGoverns the partitioned-matrix and augmented-array notation used to present [AIm] and its reduced form unambiguously.
LAPACK / BLAS referenceLinear Algebra PACKage reference implementationSupplies the practical substitutes for these constructions on floating-point data: xGEQP3 for a rank-revealing column space basis and xGESVD for orthonormal bases of the column space and its complement.
IEEE 754-2019IEEE Standard for Floating-Point ArithmeticDefines the arithmetic in which the consistency conditions are evaluated, and hence the residual magnitudes against which a membership tolerance must be set.
ISO/IEC 40314Mathematical Markup Language (MathML) Version 3.0Encodes the partitioned matrices and case systems on this page as structured markup so that block boundaries survive into assistive technology.
W3C WCAG 2.1 AAWeb Content Accessibility GuidelinesRequires the augmented arrays here to be navigable as tabular mathematical structures rather than presented as static images.

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 arithmeticDeriving consistency conditions that will be recorded in a specification or used symbolically.Produces exact integer or rational conditions with unambiguous rank, but entries in the appended block can grow substantially during the extended reduction.
Arbitrary-precision integersIncidence, stoichiometric or equilibrium matrices with small integer entries where integer conditions are wanted.Keeps the conditions interpretable as integer relations; requires clearing denominators and normalising signs to present a canonical result.
IEEE 754 binary64 with SVDMeasured or assembled matrices where rank is not exactly known.Gives an orthonormal, well-conditioned description with a quantified rank gap, but loses the sparsity and integer structure that make hand-derived conditions readable.
IEEE 754 binary64 with pivoted QRLarge dense matrices where an SVD is too expensive but a numerically sound column space basis is needed.Roughly an order of magnitude cheaper than SVD and returns a basis of actual columns via the pivot ordering, but the rank decision is less reliable near a shallow gap.
Finite field arithmeticCoding and combinatorial applications where the column space of a generator or parity-check matrix is the object of interest.Exact and fast with no coefficient growth; L becomes a parity-check matrix, which is exactly the form these applications want.
Sparse storage with column pivotingVery large sparse systems from network or discretised models.The extended reduction with an identity block destroys sparsity aggressively, since J is generally dense; prefer a sparse QR and avoid materialising L explicitly.

Manufacturing Notes

Implementation notes — how the result is actually produced by hand, by algorithm and by library, including cost and numerical behaviour.

Operation counts

Reducing A alone costs on the order of mnr multiply-adds. Reducing [AIm] costs on the order of m(n+m)r, so for a square matrix the extended route is roughly twice the work. Against that, a single extended reduction supplies B, C, J, K and L, from which all four fundamental subsets follow with only null space and row space extractions on small reduced matrices.

Performing the extended reduction by hand

Write the identity block explicitly and apply every operation to the full width of the array without exception; skipping the appended block on a single operation invalidates the entire result silently. After the left block reaches reduced form, continue reducing the appended block so the trailing rows acquire leading ones and those columns are cleared above. Only then are L and the whole of N canonical.

Verification technique

Three cheap checks catch almost every error. Confirm JA=B by direct multiplication. Confirm that every column of A satisfies LAj=0, since each column is trivially in the column space. Confirm that L has full row rank mr, which it must if the reduction was carried to completion.

Library behaviour

SymPy computes the pivot-column basis with Matrix.columnspace() and will reduce an explicitly constructed augmented array via rref(), from which L is sliced. NumPy and SciPy provide no extended echelon form; the intended equivalents are scipy.linalg.orth for a column space basis and scipy.linalg.null_space(A.T) for the row content of L, both derived from the SVD with explicit tolerances.

Runtime cost of membership testing

Once L is available, each membership test is (mr) inner products of length m, so O(m(mr)) operations with no factorisation and no allocation. For a rank-deficient system with mr small this is close to free, which is what makes the null space description the right choice for high-volume screening.

Failure Modes & Common Mistakes

Failure modes, root causes and prevention
Failure mode / mistakeImpactRoot causePrevention & detection
Using columns of the reduced matrixhighTaking C(A)=C(RREF(A)) by false analogy with the row space.Row operations do not preserve column spaces. Read pivot indices from the reduced form and take the corresponding columns of the original matrix.
Failing to apply an operation to the appended blockhighReducing [AIm] but omitting the identity block on one step, so J no longer records the true cumulative transformation.Verify JA=B before extracting L. The check costs one matrix product and catches the error immediately.
Stopping the reduction too earlymediumHalting once the left block is in reduced form, leaving the appended block un-normalised so L is not canonical.Continue until the trailing rows of the appended block have leading ones and those columns are cleared above, giving a unique N.
Extracting L from the wrong rowsmediumTaking the first mr rows of J (which is K) instead of the last mr.The rows of L are those aligned with the zero rows of the reduced A. Confirm by checking that LAj=0 for every column of A.
Testing membership with an exact zerohighEvaluating the consistency conditions on floating-point data and requiring the result to be exactly zero.Scale the residual by the norms of L and b and compare against a stated relative tolerance.
Expecting L when the matrix has full row ranklowAssuming a non-empty consistency matrix always exists; when r=m, L has no rows.Interpret an empty L correctly: no conditions to satisfy, so C(A)=m and every right-hand side is achievable.
Symbolic reduction expression swellmediumReducing with a symbolic right-hand side on a matrix of any size, so the final column accumulates unwieldy expressions.Use the identity-block formulation and multiply by b afterwards; the two are equivalent because row operations commute with the matrix-vector product.
Reporting different bases as different subspaceslowComparing outputs of two methods vector by vector and concluding they disagree.Compare dimensions and cross-check that each vector of one basis satisfies the conditions of the other description.

FAQs

Why can I not just row-reduce the matrix and use its columns?

Because row operations do not preserve the column space. If the reduced form has a zero row, every one of its columns has a zero in that coordinate, while columns of the original matrix generally do not, so the two spans are demonstrably different sets. Row operations do preserve the row space and the null space, which is the source of the confusion.

Which of the four descriptions should I use?

It depends on the deliverable. Use the pivot columns of A when the basis vectors must retain physical meaning; use the transpose route when a compact, readable generating set is wanted; use N(L) when many right-hand sides will be tested for feasibility or when other subspaces are also required.

What exactly is the matrix L?

It is the block of the reduced identity augmentation lying alongside the zero rows of the reduced A. Its rows are the linear combinations of the rows of A that vanish, so it is simultaneously a basis for the left null space of A and the coefficient matrix of the consistency conditions on the right-hand side. Its size is (mr)×m.

Is it legitimate to row-reduce a matrix whose last column contains symbols?

Yes. The row operations chosen are exactly those that reduce A alone, and the symbolic column simply accumulates linear expressions in the entries of b. It is legitimate but tedious, which is why the identity-block formulation is preferred: row operations commute with the matrix-vector product, so reducing Im and multiplying by b afterwards gives the same result.

What happens if the matrix has full row rank?

Then r=m, no zero rows appear, and L has no rows at all. There are no conditions for a right-hand side to satisfy, so every vector in m is achievable and C(A)=m. Reading an empty condition set as 'nothing is achievable' rather than 'everything is' inverts the answer completely.

Do different reduction orders give different consistency conditions?

They give different-looking conditions describing the same subspace, unless the reduction is carried far enough to make the result canonical. Continuing until the appended block is itself in reduced row-echelon form makes L unique, which is what allows two independent computations to be compared directly.

How does this change for floating-point data?

All four methods depend on an exact rank determination that rounding makes unsafe. The numerically sound substitute is a singular value decomposition: the leading left singular vectors give an orthonormal column space basis and the trailing ones play the role of L, with the singular value gap providing the justification for the chosen dimension.

References

  1. Beezer, R. A. A First Course in Linear Algebra, Version 0.70. University of Puget Sound, 2006. Section FS, Subsection CRS. 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. Trefethen, L. N. and Bau, D. Numerical Linear Algebra. Society for Industrial and Applied Mathematics, 1997.
  6. IEEE 754-2019, IEEE Standard for Floating-Point Arithmetic. Institute of Electrical and Electronics Engineers.

AI Suggested Questions

  • Derive the consistency matrix L for a 5x3 matrix of rank 2 by reducing with a symbolic right-hand side, and confirm it matches the identity-block route.
  • Compare the operation counts of reducing A alone against reducing the augmented array, for a 200x200 matrix, and say when the extra cost pays for itself.
  • Show a matrix where the pivot-column basis and the transpose-derived basis look completely different, and prove they span the same subspace.
  • How do the rows of L relate to the trailing left singular vectors of A, and when do the two descriptions disagree numerically?
  • Explain why row operations commute with the matrix-vector product, which is what licenses replacing a symbolic right-hand side with an identity block.
  • Given a fixed 100x40 matrix and a million candidate right-hand sides, design the cheapest feasibility screening pipeline and justify each step.

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