The Steinitz Exchange Lemma
Suppose you have a spanning set of 5 vectors for a vector space. Someone hands you 7 vectors they claim are linearly independent. Can you trust them? The Steinitz Exchange Lemma answers this instantly. No independent set can be larger than any spanning set. So 7 independent vectors cannot coexist with a 5-element spanning set. This single fact is proved by a clever swapping argument. It is the hinge on which the entire theory of dimension turns. The lemma matters for a key reason. It converts a qualitative distinction (independent vs. spanning) into a quantitative inequality (sizes of finite sets). Before this result, "independent set" and "spanning set" are just two different properties. A list of vectors might have one or both. After this result, we know something important. Every independent list is shorter or equal in length to every spanning list. This is exactly the leverage needed to show something crucial. All Bases of a finite-dimensional vector space have the same size. That fact makes "dimension" a well-defined number rather than an ambiguous choice. The big picture is this: linear algebra needs a notion of "size" for vector spaces. This notion must not depend on which basis you happened to pick. Without a theorem like this one, a problem could arise. A space could conceivably have a basis of 3 vectors and another basis of 5 vectors. Then dimension would be meaningless. The Exchange Lemma is the load-bearing wall underneath the definition of dimension. Every later fact about dimension is built by standing on it. This includes rank-nullity, the dimension formula for subspaces, and the classification of finite-dimensional spaces. This article gives the precise statement. It includes a complete proof by the exchange (swapping) technique. It offers worked numerical examples with genuinely asymmetric data. It presents a counterexample showing why finiteness and independence are both essential. Finally, it discusses how the lemma is used across mathematics today.
- Compares the sizes of an independent set and a spanning set in the same vector space.
- States: if are linearly independent and span the space, then .
- Proved by repeatedly swapping a out for a , one vector at a time, keeping a spanning set at each stage.
- Requires the spanning set to be finite; independence alone is not enough without it.
- Immediately implies all finite bases of a vector space have equal size, justifying the definition of dimension.
- Key idea: independent vectors can always be traded into a spanning set one-for-one, so independence can never outrun spanning.
Where this lives today
The Exchange Lemma is the direct ancestor of the proof that all bases of a finite-dimensional vector space have the same number of elements — since a basis is simultaneously independent and spanning, applying the lemma in both directions (basis as the independent list against basis as the spanning list, and vice versa) forces and , hence equality. This is exactly what lets us define Dimension as a single well-defined number rather than a basis-dependent artifact. Beyond linear algebra proper, the same combinatorial exchange pattern reappears as the defining axiom of a matroid in combinatorics — matroids abstract exactly this exchange property away from vector spaces, applying it to graphs (spanning trees), transcendence degree in field theory, and combinatorial optimization (greedy algorithms for finding maximum-weight independent sets rely on matroid exchange). In numerical linear algebra and data science, the idea underlies rank computations: the exchange lemma is what guarantees the row rank and column rank of a matrix, or the rank computed via any valid spanning set, is a consistent, well-defined quantity independent of the algorithm used to compute it. In coding theory, the dimension of a linear code (a subspace of ) is computed via generator matrices whose row space is spanned by a fixed number of independent rows, again relying on exchange-lemma consistency. In quantum information and physics, the dimension of a Hilbert space subsystem — central to counting degrees of freedom — is justified by the same invariance-of-basis-size argument. Even in economics and optimization (linear programming basic feasible solutions), the notion of a "basis" of columns providing a feasible solution, and the fact that any two bases have the same size, is this lemma in a change of clothing.
Ask the tutor: How does the Exchange Lemma get used, step by step, to prove that all bases of a finite-dimensional vector space have the same number of vectors?
Let be a vector space over a field . A list of vectors is linearly independent if the only scalars satisfying
are . A list of vectors spans if every can be written as
for some scalars . Equivalently, . We say is replaceable into the spanning list if, after relabeling the 's, the list
still spans . The Exchange Lemma asserts this replacement is always possible, one vector at a time, as long as the are independent.
Intuition
Picture a spanning set as a "generating toolkit": every vector in is buildable from these tools. An independent set is a collection of vectors that carry genuinely new, non-redundant information — none is a combination of the others. The exchange lemma says you can always trade tools: take one independent vector , express it in terms of the spanning set , and since (independence forces this) some must appear with a nonzero coefficient. Solve for that in terms of and the rest of the 's, and swap it out. The new list — together with the remaining 's — still spans , because you can recover the discarded whenever you need it. Repeat this swap for Each swap consumes one -slot and installs one -vector, while the span never shrinks. If you ever ran out of 's to swap out before you finished installing all the 's, you'd be stuck trying to express some later purely in terms of already-installed 's — but that would make a linear combination of , contradicting independence. So the process cannot stall early: there must be at least as many 's as 's.
Let be a vector space over a field . Suppose: 1. is a linearly independent list, and 2. is a finite spanning list for (i.e. ). Then . Moreover, the 's can be relabeled so that for every , the list
spans .
We argue by induction on , constructing the relabeling step by step, and use strong use of linear independence to show the process cannot stall before reaches . This is the classical exchange technique.
Base case (). The statement " spans " is hypothesis (2), so the claim holds trivially at .
Inductive step. Suppose and, after some relabeling of , the list
spans (inductive hypothesis). We must produce the list for , and in doing so we must show , i.e. that there is at least one left to exchange. Since spans and , we may write
for some scalars . Claim: not all of are zero. If they were all zero, would read
i.e.
a nontrivial linear dependence among (the coefficient of is ), contradicting hypothesis (1) that is linearly independent. This proves the claim. In particular, at least one of exists with a nonzero coefficient in , so in particular (there is at least one index left in the range ). Relabel the indices (a relabeling of only, leaving fixed) so that . Now solve for :
which is valid since exists in the field . This exhibits as a linear combination of
We now show
Let be arbitrary. By the inductive hypothesis, write
for scalars . Substitute the expression for derived above in place of ; the result is a linear combination of equal to (all substitutions are linear operations on scalars in the field , so the result is again a legitimate linear combination). Since was arbitrary, this proves . This completes the inductive step: we have produced a relabeling of (extending the relabeling already fixed on ) such that spans , and we showed along the way that whenever .
Conclusion. By induction, for every the list spans (after appropriate relabeling), provided the induction can run all the way to . The induction produces, at each step from to for , the strict fact . Taking in this fact (valid since , so the inductive step at applies) gives , i.e.
This also confirms the induction never stalls: at every stage we verified , so there was always an available -index to exchange, and the full relabeled chain of spanning lists for exists as claimed.
∎Worked examples
Example 1 — a genuine size comparison in . Let . Consider the spanning list (we will not claim it is a basis — check it merely spans , which it does since it's exactly the standard basis reshuffled with an extra redundant vector):
This list of 5 vectors spans (it contains the standard basis already). Now consider the independent list
Check independence: suppose . Componentwise:
From the first equation ; then the second gives ; the fourth gives . So are independent, . The lemma guarantees , i.e. — consistent, and we can even watch the exchange happen explicitly. Step : Express . The coefficient of is nonzero, so exchange out. New spanning list:
Indeed , recoverable, so this list still spans . Step : Express in terms of . Since has zero first coordinate and has first coordinate , any combination needs to keep the first coordinate zero (as all have first coordinate ). So . Coefficient of is nonzero: exchange out. New list:
Step : Express : first two coordinates are , and each contribute nonzero first/second coordinates unless their coefficients vanish, forcing coefficients of to be (a short direct check: writing and matching the first coordinate gives ; matching the second coordinate then gives ). So . Coefficient of nonzero: exchange out. Final list:
which spans — five vectors, matching exactly as promised.
Example 2 — using the lemma to rule out an impossible claim. Let , polynomials of degree , with spanning list
(this is the standard spanning set, so ). Someone claims the following four polynomials are linearly independent:
By the Exchange Lemma, if were truly independent we would need , which is false. So the lemma predicts the claim must be wrong — the four polynomials must be dependent. Let's verify directly. Try
Expanding in the basis :
- constant term:
- term:
- term:
This is 3 equations in 4 unknowns, so a nontrivial solution must exist (more unknowns than equations over a field guarantees a nonzero solution to a homogeneous linear system). Solve: from the third equation, . Substitute into the second: . Substitute into the first: . Then . Take : then . Check:
Indeed a genuine nontrivial dependence: . This confirms exactly what the lemma forced: with only 3 spanning vectors, no 4 vectors in can be independent.
Drop hypothesis (2)'s finiteness requirement — allow an infinite spanning list — and the conclusion can fail outright in the sense that the bound "" becomes vacuous or misapplied, and more importantly the proof technique itself breaks down because the induction has no terminal comparison to make. Concretely, let , the vector space of all polynomials with real coefficients (no degree bound). This space is spanned by the infinite list
Now consider any finite independent list — say , or indeed for any you like, e.g. take larger than any number you care to name. This list is linearly independent for every (standard fact: distinct powers of are independent), yet there is no finite such that the spanning list has exactly elements — the natural spanning list is genuinely infinite. The point is not that the inequality "" is falsified (comparing to is not meaningful the way the theorem intends); the point is that the entire mechanism of the proof — exchanging vectors one at a time and then comparing final counts vs. — requires to be an actual finite number to reach a contradiction when tries to exceed it. If the spanning set is infinite, you can exchange a for some at every stage no matter how large is, so the argument never detects any obstruction, and indeed none exists: contains independent sets of every finite size. This is precisely why is called infinite-dimensional — the exchange lemma's finite bookkeeping simply does not apply, and a separate (cardinal-based) theory is needed to compare sizes there. This shows finiteness of the spanning list is not a technicality but load-bearing: remove it and the numerical conclusion of the theorem has no content to assert.
Scope, edge cases & common traps
| Situation | What happens | Why |
|---|---|---|
| Spanning list is finite, independent list is finite | Lemma applies directly: | Core hypothesis satisfied |
| Spanning list infinite (e.g. ) | Lemma does not apply; no finite bound on independent sets | Induction needs a finite to terminate the comparison |
| merely a spanning list, not independent | Conclusion can fail (a longer spanning list can "span" while a shorter independent-looking list is compared incorrectly) | Hypothesis (1) — independence — is essential, not just convenience |
| exactly | Both and the leftover-free relabeled 's coincide in role; this is the key step toward proving all bases have equal size | Sets exactly Dimension's well-definedness |
| Working over a general field (not just ) | Proof goes through unchanged | Only field axioms (existence of inverses for nonzero scalars) were used |
The mathematician behind it
Origins · 1 minErnst Steinitz and how this was discovered
Ernst Steinitz is best known for his 1910 paper Algebraische Theorie der Körper ("Algebraic Theory of Fields"), a foundational work that systematically developed abstract field theory — including the classification of fields by characteristic, the theory of transcendence degree, and the general existence of algebraic closures. The exchange technique bearing his name emerged from this broader program of finding invariants (like transcendence degree of a field extension, or dimension of a vector space) that do not depend on an arbitrary choice of generating set. The same combinatorial idea — that a maximal independent set can be exchanged into any spanning set one element at a time — appears in Steinitz's work on transcendence bases for field extensions, and was later recognized as the same underlying lemma used throughout linear algebra, matroid theory, and beyond.
Does the Exchange Lemma tell us bases have the same size, or is that a separate theorem?
The Exchange Lemma is the key ingredient, but the "same size" fact requires one more short step. If and are both bases of a finite-dimensional , apply the lemma twice: treat as independent and as spanning to get , then swap roles (treat as independent and as spanning) to get . Combining these two inequalities gives . So the invariance of basis size is a direct two-line corollary of the Exchange Lemma, not a separate independent argument — the lemma does all the real work.
Can the Exchange Lemma be applied when the spanning list contains repeated vectors or the zero vector?
Yes, with no modification to the proof. If for , or some , the spanning list still spans by definition (spanning only requires every vector be expressible as a combination, and repeats or zero vectors don't prevent that). The proof's inductive step only uses that some in equation is nonzero, which remains valid regardless of redundancy in the -list. However, note that the independent list can never contain a repeated vector or the zero vector, since either would immediately produce a nontrivial dependence, violating hypothesis (1) outright.
Is the ordering of the exchange (which goes first, which gets replaced) unique?
No, and the theorem does not claim uniqueness. At each inductive step, there may be several indices with in equation , and any one of them may be chosen for the swap — different choices generally lead to different final spanning lists (after full relabeling). What the theorem guarantees is only the existence of at least one valid exchange at every stage and the resulting numeric bound ; it says nothing about which particular relabeling occurs, and different valid proofs of the same instance can produce different relabelings.
Does the lemma require the vector space to be finite-dimensional?
Not as a standing hypothesis on itself — the theorem is about a specific finite spanning list and a specific finite independent list. However, the existence of any finite spanning list for is precisely the definition of being finite-dimensional, so in practice the lemma is always invoked within the finite-dimensional setting. If has no finite spanning list at all (it is infinite-dimensional), the lemma's finite spanning hypothesis simply cannot be satisfied, so the lemma gives no information — consistent with the counterexample discussed above involving .
How does the Exchange Lemma relate to solving linear systems and matrix rank?
Rank of a matrix is defined as the dimension of its column space (or row space), and the fact that "dimension" is well-defined at all is a direct consequence of the Exchange Lemma applied to any two bases of that column space. Concretely, when row-reducing a matrix to find a maximal independent set of columns, the number of pivot columns you find is guaranteed to be the same regardless of which row-reduction path you take — this consistency is exactly the invariance-of-basis-size corollary of the lemma. Without the lemma, "rank" could depend on the algorithm used to compute it.
What is the connection to matroid theory mentioned in the applications?
A matroid is an abstract combinatorial structure consisting of a finite ground set together with a notion of "independent subsets," designed to axiomatize exactly the properties that make the Exchange Lemma true — in particular, an axiom stating that if is independent, is independent, and , then some element of can be added to keeping it independent. Vector spaces (with linear independence) are the motivating example of a matroid, and graphs (with "independent" meaning "acyclic edge set") are another. The Exchange Lemma is thus the vector-space instance of a far more general combinatorial principle.
If exactly in the theorem, does that mean is automatically a basis?
Not from the Exchange Lemma alone in full generality, but in the finite-dimensional setting with known independently, yes: an independent list of size equal to the dimension of must also span (this is a standard companion fact proved alongside the Exchange Lemma, often called the "extension to a basis" theorem). The Exchange Lemma itself only guarantees the numeric inequality and the existence of a spanning relabeling ; when this relabeled list is just itself, which therefore is spanning — so in this special case the lemma directly upgrades independence to a full basis.