Dimension Formulas for Subspaces
How large is the space you get by combining two subspaces? Suppose and are subspaces of a finite-dimensional vector space. Each has a known dimension. You also know how large their overlap is. Is the dimension of the combined space determined by these three numbers? If so, how? This question is not idle bookkeeping. It is the linear-algebraic shadow of inclusion–exclusion. It governs everything from counting solutions of simultaneous linear systems to computing ranks of block matrices. The formula that answers this question, , is one of the most quietly powerful identities in the subject. It converts a question about a sum into a question about intersections and dimensions. The sum operation is hard to visualize directly, since vectors in can be split into pieces from and in many different ways. Intersections and dimensions, by contrast, are far more tractable. This is the exact linear-algebra analogue of for finite sets. The proof strategy, extending a basis of the overlap outward in two directions, is a template used throughout the subject. A special and especially clean case occurs when . Then the formula collapses to . One says the sum is a Direct Sum. This is the dimension count that makes direct sum decompositions so useful. It helps in building explicit bases, verifying that a space splits into independent pieces, and organizing linear maps via invariant subspaces. The formula also generalizes cleanly. For direct sums of any finite number of subspaces, dimensions simply add. This article gives the precise statement and a complete non-circular proof by basis extension. It includes worked numerical examples that show the formula in action for genuinely different subspaces. It also gives a counterexample demonstrating why finite-dimensionality is essential. Finally, it looks at how the identity generalizes and where it appears across mathematics.
- The formula holds for any subspaces of a finite-dimensional vector space.
- It is proved by extending a basis of to bases of and of separately, then showing the union is a basis of .
- When , the formula simplifies to .
- The identity generalizes to finite direct sums: , but for three or more subspaces there is no simple inclusion–exclusion analogue for .
- The formula fails if the ambient space (or the relevant subspaces) are infinite-dimensional, since "dimension" arithmetic on infinite cardinals behaves differently.
- Key idea: counting a sum of subspaces is really counting how much overlap you subtracted twice when you added the two dimensions.
Where this lives today
The sum–intersection dimension formula is a workhorse well beyond pure linear algebra courses.
- Linear systems and rank–nullity companions: When solving simultaneous systems of linear equations defined by two different subspaces (e.g., solution sets of two separate homogeneous systems), the formula computes the dimension of the combined solution space and detects when the systems are "independent enough" to force a large intersection, directly informing consistency and uniqueness questions tied to Rank–Nullity Theorem.
- Coding theory and cryptography: Linear error-correcting codes are subspaces of ; combining two codes via sum and intersection, and tracking dimensions, is used in analyzing code concatenation and in secret-sharing schemes built from linear codes.
- Computer graphics and robotics: Configuration spaces and constraint subspaces (e.g., the space of joint velocities satisfying multiple simultaneous linear constraints) are intersected, and their dimensions computed via this formula, to determine the true degrees of freedom of a mechanical system.
- Statistics: In linear regression and the analysis of variance, model subspaces (column spaces of design matrices) are summed and intersected; the formula underlies dimension counts used in computing degrees of freedom for nested and combined models.
- Quantum mechanics: Subspaces of a Hilbert space corresponding to eigenspaces or symmetry sectors combine according to the same dimension arithmetic (in the finite-dimensional setting), governing degeneracy counts when two conserved quantities' eigenspaces overlap.
- Algebraic geometry and combinatorics: Grassmannians, the parameter spaces of -dimensional subspaces of an -dimensional space, rely on exactly this dimension calculus to define Schubert cell dimensions and intersection conditions.
- Foreshadowing further theory: The dimension formula is also the seed of the idea behind Quotient Spaces: one can prove again, more conceptually, via the isomorphism , a fact that becomes available once quotient space dimension theory is developed.
Ask the tutor: Can you show me how to compute when and are each given as solution sets of homogeneous linear systems, rather than as spans of vectors?
Let be a vector space over a field , and let be subspaces. The sum of and is
This is itself a subspace of : it contains , and it is closed under addition and scalar multiplication because and . The intersection is also a subspace of (a standard fact: the intersection of any collection of subspaces is a subspace). The sum is called a direct sum, written , if every vector can be written as (with , ) in exactly one way. A standard equivalent characterization is:
If is finite-dimensional, denotes the number of vectors in any basis of (well-defined since all bases of a finite-dimensional space have the same size).
Intuition
Think of and as two flat sheets (subspaces) sitting inside a room (). If the sheets only touch at the origin, gluing them together to form costs you nothing: every direction in is genuinely new relative to , and vice versa, so the dimensions simply add. But if the sheets already share a whole line, or plane, of common directions, then when you list a spanning set for together with a spanning set for , the shared directions get counted twice. The formula's job is to subtract that double-counted overlap exactly once — precisely as in for finite sets. The proof strategy makes this precise: start with a basis for the "shared part" , then extend it in two independent directions — once using vectors that live only in , once using vectors that live only in . The claim is that combining all three pieces (the shared basis, the -only extension, the -only extension) gives a basis for , with no redundancy and nothing missing.
Theorem and Proof
Let be a finite-dimensional vector space over a field , and let be subspaces. Then , , , and are all finite-dimensional, and
Setup. Since is finite-dimensional and every subspace of a finite-dimensional vector space is finite-dimensional (a basic consequence of the fact that any linearly independent list in has length at most ), each of , , , and (all subspaces of ) is finite-dimensional. Write
Since and , we have and .
Step 1: Extend a basis of the intersection. Choose a basis of (if , this is the empty list). By the Basis Extension Theorem (also called the Steinitz exchange / extension lemma: any linearly independent list in a finite-dimensional space extends to a basis), extend this list to a basis of :
and independently extend the same list to a basis of :
(This is possible for both and because is a linearly independent list lying inside , and separately lying inside , since and .)
Step 2: Claim. The list
of length is a basis of . If we prove this, then
which is exactly the claimed formula.
Step 3: spans . Any vector can be written with , . Since is a basis of , we can write as a linear combination of the 's and 's. Since is a basis of , we can write as a linear combination of the 's and 's. Adding these expressions writes as a linear combination of all the vectors in . Hence spans .
Step 4: is linearly independent. Suppose scalars , , satisfy
Rearrange as
The left side is a vector in (linear combination of basis vectors of ); the right side is a vector in (linear combination of the , up to sign, still in since is a subspace). Since the two sides are equal, this common vector, call it , lies in . Because and is a basis of , we can write
for some scalars . In particular,
so
But is a basis of , hence linearly independent; the only way a linear combination of a linearly independent list vanishes is if all coefficients are . Thus (and also all , though we do not need that fact further). Substituting for all back into gives
But is a basis of , hence linearly independent, forcing and . All coefficients in are therefore zero, so is linearly independent.
Conclusion. By Steps 3 and 4, is a basis of consisting of vectors, so
Let be a finite-dimensional vector space and subspaces with . Then
By the equivalence stated in the definition, means the sum is direct, i.e. (the same set, with the direct-sum property). Since , the Dimension Formula for Sums of Subspaces gives
and since as sets, .
∎Let be finite-dimensional and let be subspaces such that
meaning every is uniquely expressible as with . Then
We induct on . The base case is trivial (). For the inductive step, suppose the result holds for direct sums of subspaces. Let (a subspace of , and it is genuinely a direct sum of these subspaces because the uniqueness of the decomposition for restricts to uniqueness of representations within ). By the inductive hypothesis,
Now : every decomposes as with , and this decomposition is unique because the full decomposition is unique and is determined by 's own unique decomposition within . In particular : if is nonzero, then gives two different decompositions of as (element of ) (element of ), namely and , contradicting uniqueness unless . By the direct-sum dimension corollary just proved,
This completes the induction.
∎Worked examples
Example 1: Two planes in meeting in a line. Let . Define
Both and are -dimensional (each spanning list is clearly linearly independent, since neither spanning vector is a scalar multiple of the other in either list — check the second coordinates for and the ratio of first coordinates against last coordinates for ). Finding . A vector in has the form . A vector in has the form . Setting these equal:
The second and fourth equations give and , so , forcing (over , or any field of characteristic ). Then and . So every common vector has the form . Thus , which is -dimensional (the vector is nonzero). Applying the formula.
Direct check. is spanned by . Row-reduce:
which has rank (three nonzero pivot rows, and no further cancellation is possible). This confirms , matching the formula, and since , is a proper subspace of — in particular here.
Example 2: Polynomial subspaces (a direct sum case). Let , the real polynomials of degree at most , with (basis ). Define
Dimension of . An even polynomial of degree has the form , so , and this list is linearly independent (it consists of monomials of distinct degrees, which are always linearly independent — a linear dependence among monomials of different degrees would force a nonzero polynomial identity of the form , impossible unless all by comparing coefficients). Hence . Dimension of . An odd polynomial of degree has the form (no constant, , or term, since those are even-degree). So , linearly independent by the same monomial argument, giving . Intersection. If then and simultaneously, so , i.e. , forcing (valid since has characteristic , so ). Hence , so , and the sum is direct. Applying the formula.
Since is a -dimensional subspace of the -dimensional space , in fact (a subspace of the same finite dimension as the whole space must equal the whole space, since a proper subspace has strictly smaller dimension — itself a consequence of the Basis Extension Theorem). So every polynomial of degree decomposes uniquely as (even part) (odd part), confirming the familiar even–odd decomposition of polynomials as an instance of :
Drop the hypothesis that (equivalently, that and ) is finite-dimensional, and the naive numerical formula breaks down, because "dimension" for infinite-dimensional spaces is an infinite cardinal, and cardinal arithmetic does not support subtraction the way the formula implicitly requires. Let -type space, concretely take , the space of all polynomials (no degree bound), which is infinite-dimensional with basis . Let
Exactly as in Example 2, , and has basis , has basis — both are infinite-dimensional, with (countably infinite dimension). The even–odd decomposition still shows . If one tried to blindly apply as an equation of numbers, one would attempt
which is technically a true statement about cardinal arithmetic (), but it is not informative: the same equation would hold even if were forced to be some other infinite-dimensional space, so the formula's proof method (extending a basis of the intersection by disjoint finite complements and counting) simply does not go through — there is no meaningful subtraction of infinite cardinals that recovers a well-defined "leftover count." The finite basis-extension argument in the proof crucially used that are finite integers so that expressions like and make sense and the induction/counting arguments terminate. This is exactly why the hypothesis " finite-dimensional" appears in the theorem: it is not a cosmetic simplification but the load-bearing assumption that makes the arithmetic in the formula meaningful and the extension argument valid.
Scope, edge cases & common traps
| Situation | What happens |
|---|---|
| Formula reduces to | |
| Then , so , consistent with | |
| , consistent with | |
| Forces , i.e. must intersect nontrivially | |
| Three or more subspaces | No simple inclusion–exclusion formula for in general (see below) |
| Infinite-dimensional | The formula's proof breaks; cardinal arithmetic does not recover the identity meaningfully |
A frequent trap: students assume the three-subspace analogue
mimicking set-theoretic inclusion–exclusion. This is false in general for subspaces. A standard counterexample: in , let , , . Each pairwise intersection is and the triple intersection is , so the right side would give . But has dimension , not . The two-subspace formula is a genuine theorem; it does not extend by naive analogy to three or more subspaces.
The mathematician behind it
Origins · 1 minHermann Grassmann and how this was discovered
Hermann Grassmann developed the foundational ideas of what we now call vector spaces, linear independence, dimension, and the sum/intersection dimension formula in his 1844 treatise Die lineale Ausdehnungslehre ("The Theory of Linear Extension"), decades before the abstract vector space axioms were formalized by others. Working largely in isolation as a secondary-school teacher in Stettin, Grassmann introduced an algebra of "extensive quantities" that anticipated exterior algebra, and within it he proved the dimension-counting relationships between subspaces (which he called "regions") that are now packaged as the identity. His work was so far ahead of the mathematical vocabulary of his time that it was largely unrecognized during his life; he also made major contributions to Sanskrit philology and linguistics, for which he was better known by contemporaries. The dimension formula bearing this conceptual lineage is sometimes called Grassmann's dimension formula in tribute to this pioneering, underappreciated work.
Why does the formula subtract instead of adding it?
Because listing a basis of together with a basis of double-counts every direction that lies in both. If , then (or a multiple of it) effectively appears once via the basis of and again via the basis of , even though it represents only one independent direction in . The proof handles this precisely: it builds a basis of by taking a basis of once, then adding only the extra directions needed to reach all of , and separately only the extra directions needed to reach all of . Subtracting in the final formula corrects for the fact that a naive sum would count the overlapping directions twice.
Does guarantee equals the whole ambient space ?
No. The condition only guarantees that the sum is direct, meaning ; it says nothing about whether this sum fills up all of . For example, in , let and . Then , and , but is only the -plane, a proper subspace of . To conclude , one additionally needs .
How does this formula relate to rank of matrices?
If and are column spaces (or row spaces) of two matrices with the same number of rows, then is the column space of the matrix formed by placing the two matrices' columns side by side, and its dimension is the rank of that combined matrix. The formula then says the rank of the combined matrix equals the sum of the individual ranks minus the dimension of the overlap of their column spaces, which is a useful tool in numerical linear algebra for predicting when concatenating data (or constraint) matrices increases effective rank versus introduces redundancy.
Is there an intersection-dimension formula, i.e., can I always compute directly instead of via the sum?
Yes — you can rearrange the theorem's formula as , provided you already know or can compute (for instance, by row-reducing a spanning set for , as in Example 1). In practice, this rearranged form is often exactly how the intersection's dimension is computed in concrete examples: it is usually easier to find a basis for by combining spanning sets and row-reducing than to solve directly for the intersection, especially when and are given by spanning sets rather than defining equations.
Does the formula hold over any field, or only over or ?
The formula holds over any field , for any finite-dimensional vector space over . Nothing in the proof (basis extension, spanning, linear independence arguments) uses any property special to or , such as an ordering or completeness; it only uses the vector space axioms and the Basis Extension Theorem, both of which hold verbatim over an arbitrary field. The one subtlety is characteristic: in Example 2's argument that for even/odd polynomials, we used , which fails in characteristic — but that is a feature of that specific example, not a limitation of the general dimension formula itself.
What is the fastest way to remember which term gets subtracted?
Picture merging two lists of basis vectors, one for and one for : their union spans but may be linearly dependent exactly because of the shared directions in . The number of "redundant" vectors introduced by this overlap is precisely , so you subtract that amount from the naive total to get the true dimension of the union's span. A quick sanity check: if , the formula must give back , and indeed checks out.
How does this connect to quotient spaces?
Once Quotient Spaces are available, there is a slicker proof: the map sending is a linear surjection with kernel exactly (since iff , iff for ). The Rank–Nullity Theorem applied to this map gives , and since , rearranging recovers exactly . This quotient-space proof is more conceptual but relies on machinery (quotient spaces and their dimension formula) built on top of the basis-extension techniques used in the direct proof given here.