Engineering/Mathematics/Vector Spaces
Testing Subspaces
A subset of a vector space is a subspace precisely when it is non-empty and closed under both operations — three conditions instead of ten axioms. The saving is not cosmetic: it turns subspace verification into a routine two-line calculation and makes whole families of sets recognisable at sight.
- Core level
- Stream: subspaces
- Reading time 14 min
- Ref KVS-ENG-MATH-0060
- Taxonomy
- Engineering / Mathematics
- Prerequisite
- Definition of a subspace; the ten vector space axioms
- Test
- Non-empty, closed under , closed under scalar multiplication
- Logical form
- Equivalence — usable in both directions
- Fastest disqualifier
- Immediate corollary
- is a subspace of
Overview
Verifying a subspace straight from the definition means walking all ten vector space axioms. Most of that walk is wasted effort, because six of the axioms are universally quantified identities that a subset inherits from its parent space for free, and a seventh — the existence of additive inverses — follows from closure under scalar multiplication via . What remains is a short, sharp test.
The result is stated as an equivalence: a subset of a vector space , endowed with 's operations, is a subspace if and only if is non-empty, closed under vector addition and closed under scalar multiplication. Because it is an equivalence and not merely an implication, it works in both directions. Three conditions establish a subspace; the failure of any one of them refutes a subspace.
The non-emptiness condition is easy to under-rate. It is what supplies the zero vector: pick any , use scalar closure to place in , then use additive closure to place in . In practice the condition is checked by exhibiting a single member, and the member usually chosen is itself, which is why the zero-vector screen is the standard opening move.
The payoff extends well beyond individual verifications. The same three conditions prove, in a few lines each, that the null space of a matrix is a subspace, that a span is a subspace, and that upper-triangular matrices, trace-free matrices and polynomials vanishing at a fixed point are subspaces of their respective ambient spaces. Once these general results are available, most sets encountered in practice are recognised rather than verified.
Definition
Testing Subsets for Subspaces
TSSLet be a vector space and let carry the same vector addition and scalar multiplication as . Then is a subspace of if and only if all three of the following hold:
- is non-empty, ;
- if and then ;
- if and then .
Paraphrase: a subspace is a non-empty subset of a vector space that is closed under vector addition and scalar multiplication. The hypothesis that is a vector space is doing real work and must not be dropped.
Trivial Subspaces
TSFor a vector space , both itself and the single-element set satisfy the three conditions and are therefore subspaces. They are called the trivial subspaces of .
Null Space of a Matrix is a Subspace
NSMSLet be an matrix. Then the null space is a subspace of .
Proved directly from the three conditions using distributivity of the matrix-vector product over addition and its commutation with scalars.
Concepts
Why three conditions suffice
The reverse implication is the substantive half. Assume the three conditions. Additive and scalar closure are two of the ten axioms outright. Six more — commutativity, associativity of addition, associativity of scalar multiplication, both distributive laws and — are identities holding for every vector of , hence for every vector of the subset ; restricting a universally quantified true statement cannot make it false. That leaves additive inverses and the zero vector, and both are manufactured from the three conditions rather than assumed.
Manufacturing inverses and the zero vector
For , scalar closure with gives , and in any vector space , so additive inverses live inside . For the zero vector, non-emptiness supplies some ; the previous sentence supplies ; additive closure then supplies . This chain is the reason non-emptiness cannot be dropped from the list — without a starting vector there is nothing to build the zero vector from.
The forward direction and its use as a refutation tool
The forward implication is immediate: a subspace is a vector space, so it contains a zero vector (hence is non-empty) and satisfies both closure axioms. Its practical value is contrapositive. To show a set is not a subspace it is enough to exhibit one specific failure — one pair of vectors whose sum escapes, or one scalar and one vector whose product escapes. A single counterexample settles the matter; no general argument is needed.
The three standard modes of failure
Candidate sets fail in three recognisable ways.
- No zero vector: fails because . Any non-zero constant on the right-hand side does this.
- Additive closure fails: contains , and contains and , but their sum has . A product condition is non-linear and does not survive addition.
- Scalar closure fails: contains and is closed under addition, but escapes.
The null space as the flagship application
The three-condition test proves in half a page that is a subspace of . Non-emptiness holds because , so a homogeneous system is always consistent. Additive closure follows from . Scalar closure follows from . Both steps are properties of the matrix-vector product, not of the particular matrix, so the result holds for every .
Recasting as a null space is often faster than testing
A set defined by several simultaneous homogeneous linear conditions on the entries of a vector can be tested condition by condition, which grows tedious quickly. It is faster to read the conditions as the rows of a coefficient matrix , observe that the set is exactly , and cite the null space theorem. The recognition step costs nothing and returns a spanning set as a by-product once the system is solved.
Decision path: is a subspace of ?
Equations
The three-condition subspace test
EQ-TSS-01The equivalence in full. Both directions are used in practice: left to right to refute, right to left to establish.
Constructing the zero vector from the three conditions
EQ-TSS-02Non-emptiness plus the two closure conditions deliver the zero vector. This is why need not be assumed separately.
Additive closure of a null space
EQ-TSS-03Distributivity of the matrix-vector product over vector addition is the entire content of the additive closure step for .
Scalar closure of a null space
EQ-TSS-04Scalars commute past the matrix-vector product, so a scaled null space vector remains in the null space for every .
Recasting simultaneous homogeneous conditions as a null space
EQ-TSS-05The rows of the conditions become the rows of . Recognition replaces three separate closure arguments with one citation.
A set that fails additive closure
EQ-TSS-06A single escaping pair is a complete refutation. Note that the set does contain the zero vector, so the zero-vector screen alone would have passed it.
A set that fails scalar closure
EQ-TSS-07The integer lattice contains and is closed under addition, yet fails the third condition. All three conditions must be checked.
Variable Definitions
| Symbol | Name | Meaning | Domain / type |
|---|---|---|---|
| Parent vector space | The ambient space whose axioms and operations inherits | any vector space | |
| Candidate subset | The subset being tested for subspace status | subset of V | |
| Witness vector | Any single member exhibited to establish non-emptiness | element of W | |
| Scalar | Arbitrary multiplier in the scalar closure condition | complex number | |
| Coefficient matrix | Matrix whose rows are the homogeneous conditions defining | m x n matrix | |
| Null space | All with ; a subspace of | subspace of C^n | |
| Empty set | The set with no members; disqualified by the first condition | set | |
| Trace | Sum of the diagonal entries of a square matrix; a linear function of the entries | complex number | |
| Matrix space | All matrices with complex entries | vector space of dimension 9 |
Worked Numerical Example
Problem statement
In plasticity modelling a stress state is decomposed into a hydrostatic part and a deviatoric part. The deviatoric states are the symmetric matrices of zero trace. Establish that these form a subspace of using the three-condition test, then show that two nearby-looking sets fail it.
Fix the ambient space and the membership test
Take , the matrices with entrywise addition and scalar multiplication, which is a vector space. The candidate is the set of deviatoric states:
Condition one — non-empty
Exhibit a member. The matrix with in position , in position and zeros elsewhere is symmetric and has trace , so it lies in and . The zero matrix also qualifies, which is the usual choice.
Condition two — additive closure
Let , so , , and . Transposition and trace are both additive, so both parts of the membership test survive the sum:
Condition three — scalar closure
Let and . Scalars pass through both transposition and trace:
Conclude for
All three conditions hold, so is a subspace of and therefore a vector space in its own right. Note what was not done: no commutativity, associativity or distributivity was checked, and no zero matrix or additive inverse was verified. The theorem supplied all seven remaining axioms.
Counterexample one — a fixed non-zero pressure
Replace the trace condition by with , describing states at one specified hydrostatic pressure. The zero matrix has trace , so and the set is not a subspace. Superposition of two such states doubles the pressure, which is the physical reading of the same failure.
Counterexample two — singular stress states
Take the set of matrices with , that is, stress states with at least one zero principal value. This set does contain the zero matrix, so the zero-vector screen passes. But additive closure fails:
Read the counterexamples against the conditions
The first set fails condition one by way of the zero vector; the second fails condition two despite containing the zero vector. Together they show why the zero-vector screen is a filter and not a proof, and why the determinant condition — being non-linear in the entries — cannot define a subspace.
Deviatoric stress states form a six-dimensional subspace of the nine-dimensional space : symmetry removes three degrees of freedom and the trace condition removes one more. Because it is a subspace, deviatoric states may be superposed and scaled freely without leaving the deviatoric family, which is exactly the property that yield criteria such as von Mises depend on. The fixed-pressure family and the singular family have no such property, and any code that treats them as linear will produce inadmissible states.
Applications & Industry Use
Deviatoric decomposition in plasticity
Yield criteria are formulated on the deviatoric part of the stress tensor. Establishing that deviatoric states form a subspace justifies projecting a stress state onto it linearly, and guarantees that the projection of a superposed load case is the superposition of the projections.
Zero-sequence-free current sets
In a balanced three-phase system the currents summing to zero form the null space of a single row vector of ones, hence a subspace. Filters and transformations that operate on this set can be applied to sums of load patterns without re-checking the balance condition.
Trim-constrained control allocation
Actuator commands producing zero net moment about a chosen axis satisfy a homogeneous linear condition, so they form a subspace of the command space. Control allocation exploits this by adding null-space commands to redistribute effort without disturbing the trimmed state.
Element-conserving reaction vectors
Reaction extents that conserve every element are the null space of the atomic composition matrix. Recognising this set as a subspace, rather than testing it condition by condition, immediately gives the number of independent reactions as its dimension.
Volume-preserving linear deformations
To first order, volume-preserving deformations are the trace-free matrices, which form a subspace of . Interpolating between two such deformations linearly stays inside the family, which is why trace-free representations are preferred for blending.
Centred and contrast-coded feature sets
Contrast codings in experimental design require coefficient vectors summing to zero. That set is a subspace, so contrasts can be added and rescaled and remain valid contrasts, which underpins the algebra of orthogonal contrast families.
Design Considerations
Recognise before you verify
The cheapest subspace proof is a citation. Before starting closure arguments, check whether the set is a null space, a column space, a row space, a left null space or a span, since each is a subspace by a standing theorem. Only genuinely novel descriptions warrant the three-condition test from scratch.
One counterexample refutes; no counterexample proves nothing
Because the test is an equivalence, exhibiting a single escaping sum or a single escaping scalar multiple is a complete refutation. The converse asymmetry matters: failing to find a counterexample after sampling is not evidence of a subspace. Establishing one requires an argument for arbitrary , and .
Use arbitrary vectors, not examples, in the closure arguments
The additive and scalar closure conditions are universally quantified. A proof must begin "let and be arbitrary elements of " and use only what membership guarantees. Substituting specific numbers demonstrates nothing beyond that particular pair, and is the single most common flaw in written verifications.
Watch the scalar field
Scalar closure must hold for every scalar in the field under consideration. A set closed under real scaling but not complex scaling is not a subspace of a complex vector space. Similarly, the integer lattice is closed under integer scaling but fails over or , which is precisely the third standard counterexample.
Non-linear membership tests are almost never subspaces
Determinant conditions, products of entries, ranks bounded above, norms bounded above and rank-one constraints all define sets that contain but fail additive closure. If the membership test is not a system of homogeneous linear equations in the coordinates, expect failure and look for the counterexample rather than a proof.
Numerical tolerance changes the question
In floating point a residual is never exactly zero, so "" becomes " below a tolerance", and the tolerance-defined set is not a subspace: adding two vectors that each just satisfy the tolerance can produce one that does not. Keep the mathematical subspace and the numerical test conceptually separate, and document the tolerance.
Standards & Codes
Notation, interchange and numerical standards that govern how this material is written down, stored and computed in production systems.
| Reference | Title | Relevance to this topic |
|---|---|---|
ISO 80000-2 | Quantities and units — Part 2: Mathematics | Fixes the notation for set membership, the empty set , logical equivalence and the upright rendering of operator names such as and used throughout the test. |
IEEE 754-2019 | IEEE Standard for Floating-Point Arithmetic | Explains why a numerically evaluated membership test yields a small residual rather than an exact zero, so the tolerance-defined set fails closure even when the underlying mathematical set does not. |
LAPACK / BLAS reference | Linear Algebra PACKage reference implementation | Supplies the rank-revealing routines (xGESVD, xGEQP3) used to obtain a basis for a null space in practice, which is the computational form of the null space subspace theorem. |
ISO/IEC 40314 | Mathematical Markup Language (MathML) Version 3.0 | Encodes the set-builder notation and matrix displays used for the counterexamples, so their structure is machine-readable. |
W3C WCAG 2.1 AA | Web Content Accessibility Guidelines | Requires the three test conditions to be presented as a semantic list rather than as an image, so the structure of the test is available to assistive technology. |
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 | Certifying that a described set really is a subspace, or constructing an exact counterexample. | The membership residual is exactly zero or not, so the verdict is unambiguous; intermediate coefficients can grow during elimination. |
| Symbolic entries | Proving closure for a family of sets parameterised by unspecified constants, as in the deviatoric example. | Handles the required "arbitrary vector" quantifier directly, but expression swell makes it impractical beyond modest sizes. |
| IEEE 754 binary64 | Testing membership of computed vectors against constraints derived from measured or meshed data. | Efficient and standard, but membership becomes a tolerance decision and the tolerance-defined set is not itself closed. |
| Integer entries with exact tests | Combinatorial or coding-theoretic settings where the constraint matrix has integer entries. | Exact and fast, but note that restricting the vectors to integers destroys scalar closure and is a classic non-subspace. |
| Sparse constraint storage | The membership test consists of many conditions each involving a few coordinates. | Makes very large null spaces tractable, but the closure verification must be phrased as a sparse matrix-vector product rather than an entrywise identity. |
| Symmetric packed storage | The ambient space is symmetric matrices, as for stress and covariance states. | Halves memory and enforces the symmetry condition structurally, but the trace condition still has to be imposed explicitly. |
Manufacturing Notes
Implementation notes — how the result is actually produced by hand, by algorithm and by library, including cost and numerical behaviour.
Cost of the test in practice
For a set defined by an homogeneous constraint matrix, checking that a candidate vector is a member costs one matrix-vector product, about operations. The closure argument itself is symbolic and executes once at design time. Computing a basis for the resulting subspace costs a factorisation, roughly for a dense matrix.
Writing the proof by hand
Use a fixed template. Line one exhibits a member. Line two takes arbitrary , records exactly what membership gives, and evaluates the membership test on . Line three does the same for . Deviating from the template usually means an unjustified assumption has been introduced about the particular vectors.
Constructing counterexamples systematically
To refute additive closure on a set defined by a non-linear condition, choose two vectors whose supports are disjoint, since the cross terms that break the condition then appear cleanly in the sum. To refute scalar closure on a discretely defined set, use a scalar of . Both recipes succeed on the first attempt for the standard families.
Library behaviour
SymPy's Matrix.nullspace returns an exact basis and so certifies the subspace directly. SciPy's scipy.linalg.null_space returns an orthonormal basis from an SVD with a singular value cutoff, so it returns a numerically defined approximation whose dimension depends on the tolerance passed. Neither library has a general subspace predicate; the recognition step remains the caller's responsibility.
Verification by round trip
After computing a basis for a claimed subspace defined by , verify to machine precision and check that the number of basis vectors equals minus the rank of . A dimension mismatch usually indicates a tolerance set too loosely, admitting near-null directions as exact ones.
Failure Modes & Common Mistakes
| Failure mode / mistake | Impact | Root cause | Prevention & detection |
|---|---|---|---|
| Omitting the non-emptiness condition | high | Assuming closure alone is sufficient; the empty set satisfies both closure conditions vacuously yet is not a subspace. | Always exhibit an explicit member, normally by checking that passes the membership test. |
| Proving closure with specific vectors | high | Substituting numeric examples instead of arbitrary and , so the universal quantifier is never discharged. | Begin every closure argument with arbitrary symbolic members and use only the properties membership guarantees. |
| Accepting a set because belongs to it | high | Treating the zero-vector screen as sufficient; sets such as and pass it and are not subspaces. | Follow the screen with both closure checks, or find a counterexample if the condition is non-linear. |
| Checking only real scalars | medium | Verifying scalar closure for positive or real only, missing failures at negative or complex values. | Test with and, over , with a genuinely complex scalar before concluding. |
| Applying the test when the operations differ | medium | Using the theorem on a subset that carries its own addition or scaling, so the inherited-axiom argument does not apply. | State that is endowed with the operations of as an explicit hypothesis of every application. |
| Missing that a set is affine, not linear | medium | A constraint exported with a non-zero right-hand side describes a translate of a subspace, not a subspace. | Assert the right-hand side is zero, or decompose the set as a particular vector plus the associated homogeneous set. |
| Treating a numerical tolerance set as a subspace | medium | Defining membership as a residual below a threshold; two members can sum to a non-member. | Keep the mathematical subspace and its numerical test distinct, and never form long linear combinations of tolerance-qualified vectors. |
| Forgetting to verify containment in | low | Testing closure for a set whose elements are not actually elements of the claimed parent space, for example mismatched sizes. | Confirm the type and size of every member against the parent space before starting. |
FAQs
Why is non-emptiness listed separately when closure seems to imply it?
It does not. The empty set satisfies both closure conditions vacuously — there are no pairs to test — but has no zero vector, so it is not a vector space. Non-emptiness supplies a starting vector from which scalar and additive closure manufacture the zero vector.
Can I just check that the zero vector is in the set?
No. It is a necessary condition and an excellent first filter, but not sufficient. The set of vectors in with contains the zero vector and fails additive closure; the integer lattice contains it and fails scalar closure. Both closure conditions still have to be verified.
Do I need to check that additive inverses lie in the set?
No. Scalar closure with gives , and in any vector space . The additive inverse axiom is therefore a consequence of the three conditions and is proved once inside the theorem rather than checked each time.
Why does the theorem require to be a vector space?
Because six of the ten axioms are inherited from by restriction. If were merely a set with two operations, commutativity and the distributive laws would not be available to inherit, and the three conditions would prove nothing. The hypothesis is doing genuine work.
Is the intersection of two subspaces a subspace?
Yes, and the three-condition test proves it quickly. The intersection contains since both subspaces do; a sum of two members lies in each subspace by their individual closure, hence in the intersection; the same argument handles scalar multiples. Unions, by contrast, are almost never subspaces.
Is the set of matrices of rank at most a subspace?
No, except in the degenerate cases or . It contains the zero matrix and is closed under scalar multiplication, but rank is subadditive rather than additive: two rank-one matrices can sum to a rank-two matrix. This is one of the most frequently mis-stated examples in applied work.
How does the null space theorem shorten a verification?
A set described by several simultaneous homogeneous linear conditions on the coordinates is exactly the null space of the matrix whose rows are those conditions. Recognising the pattern replaces a condition-by-condition closure argument with one citation, and solving the system supplies a spanning set at the same time.
References
- Beezer, R. A. A First Course in Linear Algebra, Version 0.70. University of Puget Sound, 2006. Section S, Subsection TS, Theorem TSS. Licensed under the GNU Free Documentation License v1.2.
- Halmos, P. R. Finite-Dimensional Vector Spaces, 2nd edition. Springer, 1974.
- Horn, R. A. and Johnson, C. R. Matrix Analysis, 2nd edition. Cambridge University Press, 2013.
- ISO 80000-2:2019, Quantities and units — Part 2: Mathematics. International Organization for Standardization.
- Anderson, E. et al. LAPACK Users' Guide, 3rd edition. Society for Industrial and Applied Mathematics, 1999.
AI Suggested Questions
- Give me a subset of that contains the zero matrix, is closed under scalar multiplication, and still fails to be a subspace.
- Prove that the intersection of two subspaces is a subspace, then show by example that the union usually is not.
- Why does the set of matrices of rank at most one fail additive closure, and what is the smallest counterexample?
- Show how a set defined by four simultaneous homogeneous conditions on becomes a null space, and compute its dimension.
- In floating-point arithmetic, how should I define membership in a null space so that the tolerance is defensible?
- Walk me through the three-condition test for the set of upper-triangular matrices inside .
Related Calculators
Enter a membership condition and get the three-condition verdict, with an explicit counterexample when the set fails.
Null Space Basis CalculatorRecast simultaneous homogeneous conditions as a matrix and return a basis and dimension for the resulting subspace.
Closure Property TesterSample pairs and scalars from a described set and report the first violation of additive or scalar closure found.
