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 ; discard those indexed by
- Result size
- 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 whose columns are the vectors of the generating set , in whatever order you choose. Reduce and note the pivot column indices . Then keep exactly the original vectors sitting in those columns and throw away every other one. The retained set is linearly independent and generates the same subspace as .
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
SSCVFor a set of column vectors from , the span is the set of all linear combinations of its members, . Many different sets can share a span; this page selects a distinguished small one.
Pivot Column
PCA column of a matrix in reduced row-echelon form that contains a leading one. The pivot indices are written with ; the remaining indices form and correspond to the free variables.
Because the reduced row-echelon form is unique, and are determined by the matrix alone, which is what makes the selection below canonical.
Basis of a Span
BSGiven with , let be the matrix with these vectors as columns and let be the pivot column indices of its reduced row-echelon form. The basis of the span extracted from is
The vectors in 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 , set every other free variable to , 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 .
That relation has coefficient on the free column's own vector and coefficient 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 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 gives . The coefficients are literally the entries of column 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 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 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 , 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: , so every combination of is a combination of and . For the reverse, take any and write it with the terms grouped as pivot vectors plus discarded vectors.
Replace each discarded by its expression in the retained vectors and collect coefficients. The result is a linear combination of alone, so . Both inclusions hold, and the two sets are equal. Note that all 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 elements, where is the number of pivot columns and therefore the rank of . Because is an independent spanning set, is the dimension of the subspace generated by . 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 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 — and therefore the set — is determined by 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
Equations
Matrix of columns and its reduced form
EQ-COV-01The single computation the whole method rests on. The pivot indices decide what is kept and the free indices decide what is cast out.
The retained set
EQ-COV-02Original vectors, selected by index. Nothing is scaled, combined or modified.
Canonical relation from free column
EQ-COV-03Obtained by setting free variable and all other free variables to zero. The coefficient on guarantees the relation can be solved for that vector.
Each discarded vector in terms of the retained ones
EQ-COV-04The coefficients are the entries of column of the reduced form, taken in order against the pivot vectors.
Span preservation
EQ-COV-05The retained set generates exactly the subspace the original set generated, no more and no less.
Size of the retained set
EQ-COV-06Because 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-07A consequence of independence: over the original dependent set the coefficients were not unique, and over they are.
Variable Definitions
| Symbol | Name | Meaning | Domain / type |
|---|---|---|---|
| Original generating set | The vectors whose span is to be described more economically | finite subset of C^m | |
| Retained set | The subset of indexed by the pivot columns; independent and with the same span | subset of S of size r | |
| Matrix of columns | The matrix built by using the vectors of as its columns | m x n matrix over C | |
| Reduced form | The unique reduced row-echelon form of , source of both and the substitution coefficients | m x n matrix over C | |
| Pivot index set | Indices of the columns containing leading ones; these vectors are retained | subset of 1..n of size r | |
| Free index set | Indices of columns without leading ones; these vectors are cast out | subset of 1..n of size n-r | |
| Rank | Number of pivot columns, equal to the dimension of the subspace generated | 0 to min(m,n) | |
| Generated subspace | The span of , equivalently the column space of | subspace of C^m | |
| Substitution coefficient | Entry of the reduced form giving the weight of in the reconstruction of a discarded vector | complex 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.
List the catalogue
Six load patterns through in , one entry per node. Write for the achievable set.
Assemble the matrix of columns
Six vectors from must be dependent, since the associated homogeneous system has more unknowns than equations. The reduction will say precisely how much redundancy there is.
Reduce and read the pivot pattern
Three non-zero rows, so . Leading ones sit in columns 1, 3 and 4, giving and .
Retain the pivot vectors
Keep the original patterns , and exactly as they were recorded. The reduced columns are used only to select indices and to supply coefficients; they are not the answer.
Cast out pattern 2
Column 2 of is , so the coefficients on , , are , , . Checking: .
Cast out pattern 5
Column 5 of is . Checking entrywise: .
Cast out pattern 6
Column 6 of is . Checking: .
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 on , on , and on . Direct arithmetic confirms .
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 & Industry Use
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.
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.
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.
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.
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.
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 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 of the reduced form is the complete recipe for rebuilding discarded vector . 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 & 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 set, index and matrix notation used for , , and , and the upright rendering of operator names such as and . |
LAPACK / BLAS reference | Linear Algebra PACKage reference implementation | Supplies xGEQP3, the column-pivoted QR that performs the same selection numerically and returns the retained-column permutation directly. |
BLAS Level 3 | Basic Linear Algebra Subprograms, matrix-matrix operations | Underpins 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-2019 | IEEE Standard for Floating-Point Arithmetic | Governs the rounding that makes the pivot pattern — and hence which vectors are cast out — a tolerance-dependent decision on measured data. |
ISO/IEC 40314 | Mathematical Markup Language (MathML) Version 3.0 | Encodes 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 | Select when | Trade-off |
|---|---|---|
| Exact rational arithmetic | The 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 elimination | Integer 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 tolerance | Measured 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 selection | Numerical 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 storage | Catalogue sizes in the hundreds to low thousands of vectors. | Simple and cache-friendly for the reduction, but memory grows as and offers no benefit when the vectors are mostly zero. |
| Sparse storage with fill-reducing ordering | Very 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 matrix of columns costs operations, and everything else — selecting indices, reading substitution coefficients — is bookkeeping. Removing vectors one at a time, re-reducing after each removal, multiplies the dominant cost by for no additional information.
Hand procedure
Rule the reduced matrix into pivot and free columns and label them and before writing anything else. Copy each free column vertically as the coefficient list for that vector's reconstruction, pairing entry with . 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 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 ; reconstruct every discarded vector from its coefficient column and compare entrywise against the original; and confirm that the matrix formed from 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 be the matrix of retained columns and the submatrix of the reduced form consisting of the free columns restricted to the first rows. Then the discarded vectors are recovered as the single matrix product . Verifying all reconstructions therefore reduces to one GEMM call and one comparison against the discarded columns.
Failure Modes & Common Mistakes
| Failure mode / mistake | Impact | Root cause | Prevention & detection |
|---|---|---|---|
| Returning the reduced columns instead of the original vectors | high | Taking the pivot columns of — which are columns of an identity matrix — as the answer. | Use only to obtain the index set and the substitution coefficients. The retained vectors are the untouched columns of . |
| Pairing coefficients with the wrong retained vectors | high | Matching entry of a free column with rather than with . | Write out explicitly and index the reconstruction by . Verify each reconstruction entrywise before trusting it. |
| Assuming a different column order gives the same subset | medium | Comparing 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 orthonormal | medium | Projecting 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 data | high | A rounding artefact of magnitude 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 reconstruction | medium | Retaining 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 mistake | medium | Placing 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 subset | low | Reporting 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, 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
- 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.
- 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.
- 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
Cast out redundant vectors from a generating set and return the retained basis with each discarded vector's reconstruction formula.
Column Space Basis CalculatorReturn a basis for the column space of a matrix drawn from its original columns, with the pivot index set.
Linear Independence CheckerTest a set of vectors for independence and return an explicit relation of linear dependence when one exists.
