← LibraryCasting Out Vectors: Reducing a Spanning Set | KEVOS® MathematicsProject Delivery · Project ManagementLesson 37/189← PrevNext →
ArticlePublished 8 Aug 202622 min readBy Kevin Jogin
Skip to content

Engineering/Mathematics/Vectors

Casting Out Vectors: Reducing a Spanning Set

Assemble a generating set as the columns of a matrix, reduce it, and keep only the vectors sitting in pivot columns. The survivors are linearly independent and span exactly what the original set spanned.

  • Core level
  • Stream: independence
  • Reading time 15 min
  • Ref KVS-ENG-MATH-0028
Taxonomy
Engineering / Mathematics
Prerequisite
Span, linear dependence, reduced row-echelon form
Selection rule
Retain the columns indexed by D; discard those indexed by F
Result size
r=rank(A) vectors
Cost
One row reduction of the matrix of columns
Output
A basis drawn from the original vectors

Overview

A generating set for a subspace is rarely economical. Vectors accumulate from measurements, from catalogue entries, from repeated design iterations, and many of them are linear combinations of the others. Removing one such redundant vector at a time is possible but tedious, and each removal invalidates the analysis that justified the next one. Casting out vectors replaces that loop with a single decision made once.

The construction is disarmingly simple. Build the matrix A whose columns are the vectors of the generating set S, in whatever order you choose. Reduce A and note the pivot column indices D={d1,,dr}. Then keep exactly the original vectors sitting in those columns and throw away every other one. The retained set T is linearly independent and generates the same subspace as S.

Both halves of that claim carry weight. Independence follows because any relation of linear dependence restricted to the pivot columns corresponds to a solution of the homogeneous system in which every free variable is zero — and the only such solution is the trivial one. The spanning half follows because each discarded vector can be written explicitly in terms of the retained ones, with coefficients read straight out of the reduced form.

The result is one of the workhorses of applied linear algebra. It is the mechanism behind extracting a basis for a column space from the original columns of a matrix, behind pruning redundant load cases or reaction steps, and behind converting an over-complete description of a subspace into a minimal one. Crucially, the retained vectors are members of the original set, not abstract combinations of them, so whatever physical meaning they carried survives the reduction.

Definition

Span of a Set of Vectors

SSCV

For S={v1,v2,,vn} a set of column vectors from m, the span is the set of all linear combinations of its members, span(S)={α1v1++αnvnαi}. Many different sets can share a span; this page selects a distinguished small one.

Pivot Column

PC

A column of a matrix in reduced row-echelon form that contains a leading one. The pivot indices are written D={d1,d2,,dr} with d1<d2<<dr; the remaining indices form F={f1,,fnr} and correspond to the free variables.

Because the reduced row-echelon form is unique, D and F are determined by the matrix alone, which is what makes the selection below canonical.

Basis of a Span

BS

Given S={v1,,vn} with W=span(S), let A be the matrix with these vectors as columns and let D be the pivot column indices of its reduced row-echelon form. The basis of the span extracted from S is

  • T={vd1,vd2,,vdr}
This set is linearly independent and satisfies span(T)=W.

The vectors in T are the original vectors, unmodified. The reduced form is only used to decide which indices to keep.

Concepts

One relation per free variable

Each free column supplies exactly one canonical relation of linear dependence. Set that free variable to 1, set every other free variable to 0, and read the dependent variables off the reduced rows. The resulting coefficient vector is a solution of the homogeneous system, and by the correspondence between homogeneous solutions and relations on the columns, it is a relation of linear dependence on S.

That relation has coefficient 1 on the free column's own vector and coefficient 0 on every other free column's vector. It can therefore always be solved for that one vector, and never accidentally involves another discarded vector. This is why all nr removals can be carried out from a single reduction rather than one at a time.

Discarded vectors, written explicitly

Rearranging the relation associated with free column fk gives vfk=[B]1,fkvd1+[B]2,fkvd2++[B]r,fkvdr. The coefficients are literally the entries of column fk of the reduced form, read top to bottom and matched against the pivot vectors in order.

This is the practical payoff and the audit trail. Every removal comes with an explicit formula reconstructing the removed vector from the survivors, so the claim "nothing was lost" is not an assertion but a computation that can be checked entrywise.

Why the retained set is independent

Start with a relation α1vd1++αrvdr=0 among the retained vectors only. Pad it with zero coefficients on all the discarded vectors; this changes nothing. The padded coefficient vector is now a solution of the homogeneous system Ax=0 in which every free variable equals zero.

But in the vector form of the solution set, a solution is determined entirely by its free variables. Setting them all to zero gives the trivial solution and nothing else. Hence every αi=0, and the retained set is linearly independent. The argument uses no arithmetic at all — only the structure of the solution set.

Why the span is unchanged

One inclusion is immediate: TS, so every combination of T is a combination of S and span(T)span(S). For the reverse, take any wspan(S) and write it with the terms grouped as pivot vectors plus discarded vectors.

Replace each discarded vfk by its expression in the retained vectors and collect coefficients. The result is a linear combination of T alone, so wspan(T). Both inclusions hold, and the two sets are equal. Note that all nr substitutions are performed simultaneously, which is exactly what removing vectors one at a time obscures.

The size of the result is the rank

The retained set has r elements, where r is the number of pivot columns and therefore the rank of A. Because T is an independent spanning set, r is the dimension of the subspace generated by S. This is precisely the statement that the rank of a matrix equals the dimension of its column space.

The count is also a hard lower bound: no set of fewer than r vectors can span the subspace, so the reduction is not merely a shrinkage but an optimal one. Any further removal loses part of the span.

Canonical, but only one of many valid answers

Uniqueness of the reduced row-echelon form means the index set D — and therefore the set T — is determined by S together with the order in which the vectors were placed as columns. Two people following this procedure on the same ordered list get the same answer, which makes the result reproducible and testable.

It is not, however, the only independent subset with the right span. Reordering the columns typically selects a different subset; other algorithms such as column-pivoted QR select yet another, chosen for numerical conditioning rather than for lexicographic priority. All are correct; they differ in which physical vectors survive.

Procedure: cast out the redundant vectors

Order and assembleDecide the order of the vectors — earlier vectors are preferentially retained — and form the matrix A with them as columns.
Reduce to BRow-reduce A to reduced row-echelon form. Record the number of non-zero rows r and the pivot index set D.
Retain the pivot vectorsKeep the original vectors vd1,,vdr unmodified. Do not use the reduced columns themselves.
Write out each discarded vectorFor each free index fk, express vfk using the entries of column fk of B as coefficients on the retained vectors.
Verify the reconstructionsCheck each expression entrywise against the original vector. This confirms both the reduction and the coefficient bookkeeping.
Report the basisThe retained set is linearly independent, spans the same subspace, and has size r, which is the dimension of that subspace.

Equations

Matrix of columns and its reduced form

EQ-COV-01
A=[v1v2vn]B=RREF(A),D={d1,,dr},F={f1,,fnr}

The single computation the whole method rests on. The pivot indices D decide what is kept and the free indices F decide what is cast out.

The retained set

EQ-COV-02
T={vd1,vd2,vd3,,vdr}

Original vectors, selected by index. Nothing is scaled, combined or modified.

Canonical relation from free column fk

EQ-COV-03
[B]1,fkvd1[B]2,fkvd2[B]r,fkvdr+1vfk=0

Obtained by setting free variable xfk=1 and all other free variables to zero. The coefficient 1 on vfk guarantees the relation can be solved for that vector.

Each discarded vector in terms of the retained ones

EQ-COV-04
vfk=[B]1,fkvd1+[B]2,fkvd2++[B]r,fkvdr

The coefficients are the entries of column fk of the reduced form, taken in order against the pivot vectors.

Span preservation

EQ-COV-05
span(T)=span(S)=W

The retained set generates exactly the subspace the original set generated, no more and no less.

Size of the retained set

EQ-COV-06
|T|=r=rank(A)=dim(W)

Because T is both independent and spanning, its size is the dimension of the subspace, and no smaller generating set exists.

Uniqueness of coordinates over the retained set

EQ-COV-07
w=i=1rγivdiwith the scalars γi uniquely determined by w

A consequence of independence: over the original dependent set the coefficients were not unique, and over T they are.

Variable Definitions

Symbols used on this page
SymbolNameMeaningDomain / type
SOriginal generating setThe n vectors whose span is to be described more economicallyfinite subset of C^m
TRetained setThe subset of S indexed by the pivot columns; independent and with the same spansubset of S of size r
AMatrix of columnsThe m×n matrix built by using the vectors of S as its columnsm x n matrix over C
BReduced formThe unique reduced row-echelon form of A, source of both D and the substitution coefficientsm x n matrix over C
DPivot index setIndices of the columns containing leading ones; these vectors are retainedsubset of 1..n of size r
FFree index setIndices of columns without leading ones; these vectors are cast outsubset of 1..n of size n-r
rRankNumber of pivot columns, equal to the dimension of the subspace generated0 to min(m,n)
WGenerated subspaceThe span of S, equivalently the column space of Asubspace of C^m
[B]k,fkSubstitution coefficientEntry of the reduced form giving the weight of vdk in the reconstruction of a discarded vectorcomplex scalar

Worked Numerical Example

Problem statement

A structural test rig can apply six catalogued load patterns to a four-node frame. The set of achievable loadings is the span of the six patterns. Reduce the catalogue to the smallest subset of the original patterns that achieves the same set, and show how each discarded pattern is reproduced.

  1. List the catalogue

    Six load patterns v1 through v6 in 4, one entry per node. Write W=span(S) for the achievable set.

    v1=[1201],v2=[3603],v3=[0110],v4=[2011],v5=[2510],v6=[1030]
  2. Assemble the matrix of columns

    Six vectors from 4 must be dependent, since the associated homogeneous system has more unknowns than equations. The reduction will say precisely how much redundancy there is.

    A=[130221261050001113130100]
  3. Reduce and read the pivot pattern

    Three non-zero rows, so r=3. Leading ones sit in columns 1, 3 and 4, giving D={1,3,4} and F={2,5,6}.

    B=[130021001012000121000000]
  4. Retain the pivot vectors

    Keep the original patterns v1, v3 and v4 exactly as they were recorded. The reduced columns are used only to select indices and to supply coefficients; they are not the answer.

    T={[1201],[0110],[2011]}
  5. Cast out pattern 2

    Column 2 of B is (3,0,0), so the coefficients on v1, v3, v4 are 3, 0, 0. Checking: 3(1,2,0,1)=(3,6,0,3)=v2.

    v2=3v1+0v3+0v4=3v1
  6. Cast out pattern 5

    Column 5 of B is (2,1,2). Checking entrywise: 2(1,2,0,1)+(0,1,1,0)2(2,0,1,1)=(2,4,0,2)+(0,1,1,0)(4,0,2,2)=(2,5,1,0)=v5.

    v5=2v1+1v32v4
  7. Cast out pattern 6

    Column 6 of B is (1,2,1). Checking: (1,2,0,1)+2(0,1,1,0)+(2,0,1,1)=(1,2,0,1)+(0,2,2,0)+(2,0,1,1)=(1,0,3,0)=v6.

    v6=1v1+2v3+1v4
  8. Express an arbitrary loading over the retained set

    Take the loading obtained by applying all six patterns at unit weight. Substituting the three reconstructions and collecting coefficients gives weights 1+3+21=5 on v1, 1+1+2=4 on v3, and 12+1=0 on v4. Direct arithmetic confirms 5(1,2,0,1)+4(0,1,1,0)=(5,14,4,5).

    w=v1+v2+v3+v4+v5+v6=[51445]=5v1+4v3
Result

Three of the six catalogued patterns suffice. Patterns 1, 3 and 4 are linearly independent and generate every loading the full catalogue could generate, so the achievable set is three-dimensional and patterns 2, 5 and 6 can be retired from the rig without narrowing its capability. Each retirement is documented by an exact recipe reproducing the retired pattern from the three that remain, and because the survivors are independent, the recipe for any target loading is now unique rather than one of infinitely many.

Applications &amp; Industry Use

Structural engineering

Minimal load case sets for certification

Certification programmes specify long lists of load cases, many of which are superpositions of others. Casting out the dependent cases yields the smallest set that still covers the full loading envelope, cutting analysis runs while leaving the covered envelope provably identical.

Chemical &amp; process engineering

Independent reaction sets

A mechanism written with many elementary steps usually contains steps that are stoichiometric combinations of others. Retaining the pivot-column reactions produces a maximal independent reaction set, which is what determines the number of extents needed to describe every possible composition change.

Computing &amp; data

Feature selection under exact collinearity

When design matrix columns are exactly dependent, the fitted model is unidentifiable. Retaining pivot columns removes the redundancy while keeping original, interpretable features rather than replacing them with principal components, so the resulting model still speaks in the language of the measured variables.

Computer graphics &amp; geometry

Reducing a generator set for a subspace of deformations

Blend-shape rigs accumulate targets that overlap in their effect on the mesh. Selecting the pivot targets keeps the achievable deformation space intact while removing shapes that add nothing, which shortens artist workflows and reduces solve time in inverse-kinematic fitting.

Wireless communications

Pruning an over-complete beam codebook

Beamforming codebooks are deliberately redundant for search convenience. When a minimal exactly-equivalent codebook is required — for storage or for enumeration — casting out identifies which beam vectors are combinations of the rest and can be dropped without changing the reachable beam space.

Electrical power systems

Independent measurement channels for state estimation

Retaining pivot columns of the measurement matrix identifies a minimal channel set with the same observability. Each discarded channel comes with an explicit formula reconstructing it from the retained ones, which doubles as a consistency check on live telemetry.

Design Considerations

Column order decides which vectors survive

Reduction favours earlier columns: a column becomes a pivot column only if it is independent of everything to its left. Place vectors you want to keep — because they are cheap to apply, easy to interpret or already validated — at the front of the list. The subspace is unaffected, but the surviving subset is not.

Keep the original vectors, not the reduced columns

The reduced form is a selection device only. The pivot columns of B are columns of an identity matrix and span the wrong space entirely. This is the most common conceptual error in implementing the method, and it produces an answer that is independent but has nothing to do with the original subspace.

This gives a basis, not a well-conditioned one

The retained vectors can be nearly parallel even though they are exactly independent. If the basis will be used for projection, least squares or coordinate extraction, follow the selection with a Gram-Schmidt orthogonalisation, or select columns by pivoted QR instead, which chooses for conditioning rather than for index priority.

Exact dependence versus near dependence

The method acts on exact linear dependence. Measured vectors are almost never exactly dependent, so a naive reduction will retain everything. Decide whether the question is algebraic or numerical; for the numerical case, define a rank tolerance and use a rank-revealing factorisation, then state the tolerance alongside the retained set.

Retain the reconstruction formulas

Column fk of the reduced form is the complete recipe for rebuilding discarded vector fk. Store those columns with the reduced catalogue. They allow any historical result expressed in the old generating set to be translated into the new one without redoing the reduction.

Duplicate and zero vectors are handled automatically

A repeated vector or a zero vector always lands in a free column and is cast out without special handling. There is no need to pre-screen for them, though doing so can shrink the matrix before reduction and save arithmetic on large catalogues.

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 set, index and matrix notation used for S, T, D and F, and the upright rendering of operator names such as rank and dim.
LAPACK / BLAS referenceLinear Algebra PACKage reference implementationSupplies xGEQP3, the column-pivoted QR that performs the same selection numerically and returns the retained-column permutation directly.
BLAS Level 3Basic Linear Algebra Subprograms, matrix-matrix operationsUnderpins the blocked elimination kernels used to reduce a large matrix of columns, and the xGEMM call that verifies every reconstruction in one operation.
IEEE 754-2019IEEE Standard for Floating-Point ArithmeticGoverns the rounding that makes the pivot pattern — and hence which vectors are cast out — a tolerance-dependent decision on measured data.
ISO/IEC 40314Mathematical Markup Language (MathML) Version 3.0Encodes the matrices, index sets and reconstruction formulas on this page as semantic markup so they remain searchable and machine-readable.

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 arithmeticThe generating set is exact — stoichiometric, combinatorial or symbolic — and the retained subset must be canonical.Gives the exact pivot pattern with no tolerance, but intermediate fractions can grow substantially on large catalogues.
Arbitrary-precision integers, fraction-free eliminationInteger vector catalogues where entry growth must stay controlled.Bounded operand growth via Bareiss-style elimination, at the cost of an extra normalisation to recover the substitution coefficients.
IEEE 754 binary64 with a rank toleranceMeasured or simulated vector catalogues where near-dependence is the real question.Practical and fast, but the retained subset now depends on a threshold that must be reported with the result.
Column-pivoted QR selectionNumerical work where the retained vectors will be used for projection or fitting.Chooses well-conditioned columns and is backward stable, but the selection is not canonical and generally differs from the row-reduction choice.
Dense column-major storageCatalogue sizes in the hundreds to low thousands of vectors.Simple and cache-friendly for the reduction, but memory grows as mn and offers no benefit when the vectors are mostly zero.
Sparse storage with fill-reducing orderingVery large catalogues derived from incidence or connectivity structures.Compact input representation, but elimination generates fill-in; a sparse rank-revealing QR is usually the better instrument.

Manufacturing Notes

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

Complexity and what dominates

Reducing an m×n matrix of columns costs O(mnmin(m,n)) operations, and everything else — selecting indices, reading substitution coefficients — is O(rn) bookkeeping. Removing vectors one at a time, re-reducing after each removal, multiplies the dominant cost by nr for no additional information.

Hand procedure

Rule the reduced matrix into pivot and free columns and label them d1,d2, and f1,f2, before writing anything else. Copy each free column vertically as the coefficient list for that vector's reconstruction, pairing entry k with vdk. Pairing by row number instead of by pivot index is the dominant hand error and is invisible whenever the pivots happen to start at column 1.

Library behaviour

SymPy's Matrix.columnspace and Matrix.rref implement exactly this selection over the rationals. NumPy and SciPy provide no equivalent; the standard numerical substitute is scipy.linalg.qr(A, pivoting=True), whose permutation array orders columns by decreasing importance, so the first r entries name a well-conditioned retained set. MATLAB's rref returns the pivot indices as a second output for the same purpose.

Verification technique

Three checks close the loop. Confirm |T|=r; reconstruct every discarded vector from its coefficient column and compare entrywise against the original; and confirm that the matrix formed from T alone reduces to a form with every column a pivot column. Together these certify both conclusions of the theorem for the specific data at hand.

Batch reconstruction as one product

Let AD be the matrix of retained columns and BF the submatrix of the reduced form consisting of the free columns restricted to the first r rows. Then the discarded vectors are recovered as the single matrix product ADBF. Verifying all reconstructions therefore reduces to one GEMM call and one comparison against the discarded columns.

Failure Modes &amp; Common Mistakes

Failure modes, root causes and prevention
Failure mode / mistakeImpactRoot causePrevention & detection
Returning the reduced columns instead of the original vectorshighTaking the pivot columns of B — which are columns of an identity matrix — as the answer.Use B only to obtain the index set D and the substitution coefficients. The retained vectors are the untouched columns of A.
Pairing coefficients with the wrong retained vectorshighMatching entry k of a free column with vk rather than with vdk.Write D out explicitly and index the reconstruction by dk. Verify each reconstruction entrywise before trusting it.
Assuming a different column order gives the same subsetmediumComparing results from two tools or two runs that ordered the vectors differently and concluding one is wrong.Compare spans, not subsets: check that both retained sets have the same size and that each reconstructs the other's vectors.
Using the retained set as if it were orthonormalmediumProjecting onto the subspace with plain inner products against the retained vectors.Independence does not imply orthogonality. Apply the Gram-Schmidt procedure first, or solve a least squares problem rather than projecting term by term.
Exact zero pivot test on floating-point datahighA rounding artefact of magnitude 1016 promoted to a pivot, so a dependent vector is retained and the reported dimension is too large.Use a scaled tolerance relative to the matrix norm, or a rank-revealing factorisation with an explicit threshold.
Discarding a vector without recording its reconstructionmediumRetaining only the surviving set and losing the free columns of the reduced form.Store the free columns alongside the retained set; they are the only record of how earlier results in the old set translate to the new one.
Reducing the transpose by mistakemediumPlacing the vectors as rows, which selects independent rows and describes the row space rather than the span of the given vectors.The vectors must be columns. If they arrive as rows, transpose before reducing and transpose the interpretation back.
Believing the result is the unique minimal subsetlowReporting the retained set as the only possible basis drawn from the generating set.Many subsets of the same size work. State the selection rule; only under a fixed column order is the answer canonical.

FAQs

Why can I keep the original vectors rather than the reduced columns?

Because row operations preserve linear relationships among columns but not the columns themselves. The reduced form tells you which columns are independent and how the others depend on them, and those facts transfer back to the original matrix. The reduced columns span a different subspace entirely and are never the answer.

Does the answer change if I reorder the vectors?

The subspace does not change and the size of the retained set does not change, but which vectors are retained usually does. Reduction retains a column only when it is independent of everything to its left, so earlier vectors are favoured. Order the list deliberately if some vectors are preferable to keep.

How is this different from removing dependent vectors one at a time?

It gives the same kind of result with one reduction instead of many, and it avoids the trap of using a single relation to justify multiple removals. The canonical relation attached to each free column has a zero coefficient on every other free column, so all removals are simultaneously valid.

Is the retained set a basis?

Yes. It is linearly independent and spans the same subspace as the original set, which is exactly the definition of a basis for that subspace. Its size is therefore the dimension of the subspace, which equals the rank of the matrix of columns.

What if the generating set is already independent?

Then every column is a pivot column, F is empty, and the method retains everything. That is the correct answer: an independent generating set has no redundancy to remove, and the reduction confirms it rather than failing.

Can I use this to get a basis for the column space of a matrix?

Yes, and it is the standard way to do so from the original columns. Reduce the matrix, take the columns of the original in the pivot positions, and you have a basis for the column space consisting of actual columns rather than abstract combinations — which matters whenever the columns carry physical meaning.

Why do numerical libraries use pivoted QR instead?

Because the pivot pattern from row reduction is discontinuous in the entries, so rounding can change which vectors are retained. Column-pivoted QR chooses columns by decreasing residual magnitude, which is numerically stable and yields a well-conditioned retained set, at the price of losing the canonical, order-determined answer.

References

  1. Beezer, R. A. A First Course in Linear Algebra, Version 0.70. University of Puget Sound, 2006. Section LDS, Subsection COV. 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.

AI Suggested Questions

  • Take a set of eight vectors in four dimensions, reduce it, and show which four are cast out along with their reconstruction formulas.
  • How does reordering the columns before reduction change which vectors survive, and can I force a particular vector to be retained?
  • Compare the retained subset from row reduction against the one chosen by column-pivoted QR on a badly conditioned example.
  • Show that the pivot columns of the original matrix form a basis for its column space, and why the pivot columns of the reduced form do not.
  • Given a catalogue of load cases with measurement noise, how should I set a rank tolerance before casting out cases?
  • Express a target vector in the span using the retained set, and explain why that representation is unique while the original one was not.

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