Dimension
How many numbers does it take to describe a point in space? For the plane the answer is two. For ordinary space it is three. For the space of polynomials of degree less than it is . Every one of these answers is really a statement about the size of a basis. The deep fact making the question sensible at all is that every basis of a given vector space has the same size. Without that fact, "dimension" would be meaningless. A space could be -dimensional on Tuesdays and -dimensional on Fridays, depending on which basis you happened to pick. This article proves that well-definedness, using the Steinitz Exchange Lemma as the load-bearing tool. It then defines the dimension of a finite-dimensional vector space as the common cardinality of its bases. The result is one of the shortest and most consequential theorems in linear algebra. It converts a fact about a chosen basis into an invariant of the space itself. This is a number that does not care how you look at the space. Everything downstream rests on this invariance — coordinate representations, rank-nullity, and the classification of finite-dimensional vector spaces up to isomorphism. The chapter also nails down what "finite-dimensional" means. It computes the dimension of the standard examples (, matrix spaces, polynomial spaces). It also shows how dimension controls linear independence and spanning. In an -dimensional space, no set of more than vectors can be independent. Likewise, no set of fewer than vectors can span. These two one-line consequences of the exchange lemma are used constantly. They are worth memorizing as reflexes. By the end you will have a single clean theorem (Well-Definedness of Dimension). You will also have a full proof built only from the exchange lemma and the definition of a basis. The article includes worked computations in and in a matrix space. Finally, it gives a precise sense of where the finite-dimensional theory stops. That is also where the infinite-dimensional theory begins — where "dimension" needs cardinal numbers.
- A basis of a vector space is a linearly independent spanning set; is finite-dimensional if some basis is finite (or ).
- Every two bases of a finite-dimensional vector space have the same number of elements — this is the content of the theorem proved here.
- This common size is called , the dimension of ; it is a well-defined nonnegative integer.
- The proof rests entirely on the Steinitz Exchange Lemma: a linearly independent set can never outnumber a spanning set.
- Consequences used constantly: any independent set with elements is a basis; any spanning set with elements is a basis; independent sets have size and spanning sets have size .
- Key idea: dimension is well-defined because independence bounds spanning size from below and spanning bounds independence from above, squeezing every basis to the same length.
Where this lives today
Dimension is the single number that lets linear algebra talk about "size" at all, and every field that uses linear algebra leans on it. In numerical linear algebra, the dimension of a solution space (the kernel of a matrix) controls how many free parameters a linear system has, feeding directly into the rank–nullity theorem. In quantum mechanics, the state space of a physical system is a (finite- or infinite-dimensional) Vector Space over , and the dimension of the Hilbert space for a qubit (), a qutrit (), or a composite system of qubits () directly determines how much information the system can encode — the whole subject of quantum information theory tracks dimension counts obsessively. In coding theory and cryptography, a linear code is a subspace of , and its dimension (giving code parameters ) determines the information rate of the code; error-correcting capability and rate trade off precisely through dimension. In statistics, the dimension of the column space of a design matrix is the number of independent parameters a linear regression model can estimate, and degrees-of-freedom counts in ANOVA are dimension computations for nested subspaces. In computer graphics and robotics, the dimension of a configuration space (e.g., the space of joint angles of a robot arm, linearized locally) determines the degrees of freedom of a mechanism. In pure mathematics, dimension is the starting invariant for classifying finite-dimensional vector spaces up to isomorphism — two finite-dimensional spaces over the same field are isomorphic exactly when they have the same dimension, a fact that follows immediately once Coordinates Relative to a Basis are introduced.
:::quiz[Which hypothesis is essential in the Well-Definedness of Dimension theorem, and is violated by with basis ?]
- must be over an infinite field
- must have a finite basis ✓
- must be a subspace of
- The basis must be orthogonal
Ask the tutor: How does dimension combine with subspaces to give the dimension formulas ?
Let be a vector space over a field . A basis of is a subset that is linearly independent and spans . is called finite-dimensional if or if has a finite basis . If is not finite-dimensional, it is called infinite-dimensional. Suppose is finite-dimensional. The dimension of , written (or when the field needs emphasis), is defined by
This is only a legitimate definition if the number does not depend on which basis was chosen — that independence of choice is exactly the content of the theorem below, and it is what makes "" a single well-defined nonnegative integer rather than a basis-dependent quantity.
Intuition
Think of a basis as a minimal, non-redundant "coordinate grid" for : every vector in is a unique linear combination of the basis vectors, so once you fix a basis, every point of becomes a list of scalars. The number feels like it should be a property of the space, not of the grid — rotating the axes of still gives three axes, never two or four. The exchange lemma is the precise mechanism that forbids a "four-axis grid" and a "two-axis grid" from coexisting: it lets you trade elements of one basis for elements of another, one at a time, without ever running out of room, which forces the two bases to match in size. Picture two bases of the same plane : and . Both have exactly two vectors. The exchange lemma says this is not a coincidence — it is a mathematical necessity, because is independent and spans (so ), and symmetrically is independent and spans (so ).
The central theorem
Let be a vector space over a field , and suppose has a finite basis with vectors. Then every basis of is finite and has exactly vectors.
Let be a vector space over . Suppose spans and is linearly independent in . Then .
(This lemma is assumed known as a prerequisite; we record its proof technique — repeated exchange — for completeness and because the dimension theorem is built directly on it.) We argue by induction on the claim: for each , after reordering if necessary, the set
still spans , and in particular .
Base case : the set is , which spans by hypothesis, and trivially.
Inductive step. Suppose the claim holds for some , so after reordering, spans . Since this set spans and , we may write
for scalars . If , this equation expresses as a linear combination of alone, contradicting the linear independence of (since would then be dependent). Hence , so , proving as required at this stage of the induction. Since , at least one is nonzero (otherwise the same contradiction with independence of arises, as would be a combination of the 's only). Reorder so that . Then we can solve for :
This shows lies in the span of . Since spans (inductive hypothesis) and every vector in that spanning set — including — lies in the span of , this new set also spans . This completes the induction. Taking in the claim, we obtain , as desired.
∎(Proof of Well-Definedness of Dimension, using the Steinitz Exchange Lemma. Proof technique: apply the exchange lemma in both directions.) Let be the given finite basis of , and let be any other basis of . We must show is finite with exactly elements.
Step 1: is finite, and if finite with elements then . Suppose first that contains a finite subset with . Since is linearly independent (being a basis), is linearly independent. Since spans , the exchange lemma applies with (size ) and this (size ), giving — contradicting . Hence cannot contain a finite independent subset of size greater than ; consequently every finite subset of has at most elements. If were infinite, it would contain finite subsets of arbitrarily large size, contradicting the previous sentence. So is finite, say with by the exchange lemma applied directly to , .
Step 2: . Now reverse the roles. spans (it is a basis), and is linearly independent (it is a basis). Applying the exchange lemma with (spanning, size ) and (independent, size ) gives
Step 3: conclude. Combining Step 1 () and Step 2 () gives . Thus every basis of is finite and has exactly elements, matching the size of .
∎For a finite-dimensional vector space , the quantity in the Definition of Dimension does not depend on the choice of basis used to compute it; it is a single well-defined element of .
If , by definition, with no ambiguity. If , fix any finite basis with elements — such a basis exists because is finite-dimensional. By the theorem just proved, every other basis of also has exactly elements. Hence "the number of elements in a basis of " is a single number , independent of which basis was used to compute it, and is well defined.
∎Let be finite-dimensional with . Then: 1. Any linearly independent subset of has at most elements. 2. Any spanning subset of has at least elements. 3. Any linearly independent subset of with exactly elements is a basis. 4. Any spanning subset of with exactly elements is a basis.
Fix a basis of with (exists by finite-dimensionality and is well defined by the theorem). (1) If is independent, apply the exchange lemma with (spans , size ) and this : independence of and spanning of give whenever is finite; and as in Step 1 of the theorem's proof, an infinite independent set would contain finite independent subsets of size , impossible. So is finite with . (2) If spans , apply the exchange lemma with (spanning) and the independent set (size ): this gives whenever is finite. If were infinite the inequality trivially holds as well (an infinite set is not smaller than ), so in all cases . (3) Let be independent with . Suppose toward contradiction that does not span ; then there is . The set is linearly independent — for if with not all zero, then (else independence of forces all too), so , contradicting the choice of . But is then an independent set of size , contradicting part (1). Hence spans , and being independent and spanning, is a basis. (4) Let span with . Suppose toward contradiction is linearly dependent. Then some is a linear combination of the others (a standard fact about dependent sets: some element lies in the span of the rest), so still spans and has elements, contradicting part (2) applied to the spanning set . Hence is independent, and being independent and spanning, is a basis.
∎Worked examples
Example 1: Dimension of a subspace of described by two independent constraints. Let
We compute directly by exhibiting and verifying a basis, then invoking the theorem to know the answer is basis-independent. Solve the constraints. From the second equation, . From the first, . So every vector of has the form
with free. Let , . We have shown spans . Independence: suppose . Comparing the second coordinate, . Comparing the third coordinate, . So is linearly independent. Thus is a basis of , and by the well-definedness theorem this is the number of vectors in every basis of :
As a check via Corollary (Independent sets, spanning sets, dimension): since , no independent subset of can have or more vectors. Indeed ... let's verify directly: is a combination of ? We'd need . From : check first equation ✓, last ✓. So indeed , confirming but is automatically dependent, consistent with .
Example 2: Dimension of the space of matrices with a trace-like linear constraint. Let , the space of all real matrices, and let
where . First, : the six matrix units (having a in position and elsewhere, for , ) are easily checked to be independent (a vanishing linear combination has each coefficient equal to the corresponding matrix entry, so all coefficients are ) and to span (every matrix is the combination of the with coefficients equal to its own entries). Hence they form a basis, so by the theorem. Now for : it is the solution set of one linear equation in the free entries , namely , i.e. . Every matrix in is determined by choosing freely (5 free scalars) and setting . So a natural spanning set for is obtained by setting each free variable to in turn and the rest to :
(These come from setting equal to the five standard basis vectors of and reading off each time.) Spanning: every equals — check the -entry of this combination is as required, and all other entries match by inspection. Independence: if , then comparing entries directly gives (each of these five positions is touched by only one ). So is a basis of , and by the theorem,
This matches the general principle (a foreshadow of dimension formulas) that imposing one nontrivial linear constraint drops dimension by exactly .
The well-definedness theorem assumes has a finite basis. Drop this hypothesis and the statement "every basis has elements" is not merely false — it becomes a different kind of statement altogether, one the finite-dimensional proof cannot address. Let , the space of all real polynomials (no bound on degree). The set
is linearly independent (a finite linear combination as a polynomial forces every , since a nonzero polynomial of degree has at most roots, so it cannot vanish identically unless all coefficients vanish) and spans (every polynomial is by definition a finite sum of scalar multiples of powers of ). So is a basis, but it is infinite. Here the exchange lemma, as proved above, gives no contradiction: it only bounds a finite independent set against a finite spanning set. If we try to run the finite-dimensional proof, Step 1 breaks down immediately — there is no finite spanning set to compare against, so the inequality is never produced, and the entire squeeze argument has no anchor. It is true (via a more elaborate cardinal-arithmetic argument, beyond the scope of the finite exchange lemma) that any two bases of have the same cardinality — here, countably infinite. But this requires the theory of infinite-dimensional bases (Hamel bases) and cardinal comparison, not the finite exchange lemma used above; it is not a corollary of the theorem proved in this article. This is exactly why finite-dimensionality is stated as an explicit hypothesis, and why Infinite-Dimensional Vector Spaces need their own separate treatment.
Scope, edge cases & common traps
| Situation | What happens | Why |
|---|---|---|
| , basis is | The empty set is vacuously independent and spans | |
| has one finite basis of size | Every basis has size | Well-Definedness of Dimension theorem |
| infinite-dimensional (e.g. ) | "" as an integer is undefined here | No finite basis exists; needs cardinal-number theory |
| Field changes (e.g. as -space vs. -space) | , | Dimension depends on the scalar field, not just the additive group |
| Comparing bases across different subspaces | Sizes need not match | Theorem only compares bases of the same space |
The mathematician behind it
Origins · 1 minErnst Steinitz and how this was discovered
Ernst Steinitz worked in Breslau (now Wrocław) and Kiel, and is best known in this corner of mathematics for the 1910 paper "Algebraische Theorie der Körper" ("Algebraic Theory of Fields"), which laid rigorous foundations for abstract field theory — including the classification of fields by characteristic and transcendence degree, ideas that run in close parallel to the basis-exchange argument used to make dimension well defined. The "exchange" technique bearing his name — swapping elements of an independent set for elements of a spanning set one at a time — appears in that broader context of proving invariants (like transcendence degree) are well defined, exactly mirroring its role for vector space dimension.
Why isn't dimension just "the number of coordinates," defined however you like?
That informal idea is exactly what the theorem makes rigorous. "Number of coordinates" secretly means "number of vectors in the basis you used to set up coordinates," and a priori different bases could give different counts. The Well-Definedness of Dimension theorem proves this cannot happen: any two bases of the same finite-dimensional space have the same size. Only because of this proof can we drop the phrase "using this particular basis" and say a space simply has a dimension, as an intrinsic number attached to the space itself, independent of any coordinate choice.
Does the theorem also work for infinite-dimensional spaces, just with infinite cardinal numbers instead of integers?
A generalized version is true — any two bases (Hamel bases) of an infinite-dimensional vector space have the same cardinality — but that is a genuinely different theorem, proved with different tools (typically via the axiom of choice and comparison of infinite cardinalities), not a direct corollary of the finite Steinitz exchange lemma used here. The finite exchange lemma compares only finite sets. Extending it to infinite bases requires infinite combinatorics beyond this article's scope; see Infinite-Dimensional Vector Spaces.
If I find one spanning set and one independent set of the same size in , do I automatically get a basis?
Almost, but check the logic carefully: you need the same set to be both independent and spanning, not merely two different sets of matching size. However, once you know , Corollary (Independent sets, spanning sets, and dimension) does give a shortcut: any independent set of size is automatically a basis, and any spanning set of size is automatically a basis. So finding either one, once you know in advance, suffices — you don't need to separately check both properties.
Can a vector space have two different finite dimensions depending on context?
No — dimension is fixed once the field of scalars is fixed. What changes with context is the field itself. For example, has dimension as a complex vector space but dimension as a real vector space, because a complex basis of size corresponds to a real basis of size (each complex basis vector contributes and as two real-independent directions). This is not an inconsistency in the theorem; it reflects that " as an -vector space" already specifies the field, and dimension is well defined relative to that field.
Why does the proof need both directions of the exchange lemma — spanning bounding independence, and independence bounding spanning?
Because equality can only be squeezed out from two inequalities pointing in opposite directions. Applying the exchange lemma once (with spanning against independent) gives only — a one-sided bound. To get the reverse bound , you must apply the lemma again with the roles of and swapped, since is also a basis and therefore also spans while is also independent. Both applications are needed; neither alone proves equality.
Is really consistent with the rest of the theory, given that the empty set is a strange-looking basis?
Yes, and it is the right convention. The empty set is vacuously linearly independent (there is no nontrivial finite linear combination of zero vectors to worry about) and its span is by the convention that an empty sum of vectors equals the zero vector. So satisfies both defining properties of a basis for , has elements, and by the theorem every basis of must also have elements — consistent, since has no nonzero vectors to include in any independent set.