When Dimensions Add—and When They Do Not
Two subspaces contribute vectors to a common space, but some of those vectors may be shared. If we add the dimensions of the subspaces without accounting for that overlap, the shared directions are counted twice. The dimension formula for a sum makes this precise: it subtracts the dimension of the intersection. Its proof is a useful application of basis extension, because a basis of the intersection can be extended separately to bases of both subspaces.
Throughout, let \(V\) be a finite-dimensional vector space over \(\mathbb{R}\), and let \(U\) and \(W\) be subspaces of \(V\). A basis is an ordered list that is both linearly independent and spanning; the dimension of a finite-dimensional space is the number of vectors in any basis. The intersection \(U\cap W\) consists of the vectors that belong to both subspaces. The sum \(U+W\) consists of all vectors that can be written as \(\mathbf{u}+\mathbf{w}\), where \(\mathbf{u}\in U\) and \(\mathbf{w}\in W\).
For the last claim, \(U\cap W\) is a subspace of \(U\), so it is finite-dimensional. Also, the union of a finite basis of \(U\) and a finite basis of \(W\) spans \(U+W\): every \(\mathbf{u}+\mathbf{w}\) is a combination of those basis vectors. A space spanned by a finite list is finite-dimensional, so \(U+W\) is finite-dimensional.
The Dimension Formula
We use the basis extension theorem: in a finite-dimensional vector space, an independent list can be extended to a basis. Choose a basis of the intersection first. Extending that list within \(U\) adds the directions in \(U\) not already supplied by the intersection; extending it within \(W\) adds the corresponding directions in \(W\). The proof below shows that the two groups of added vectors, taken together with the intersection basis, form a basis of the sum.
Proof. Let \((\mathbf{c}_1,\ldots,\mathbf{c}_r)\) be a basis of \(U\cap W\). By the basis extension theorem, extend it to a basis \((\mathbf{c}_1,\ldots,\mathbf{c}_r,\mathbf{u}_1,\ldots,\mathbf{u}_p)\) of \(U\), and separately to a basis \((\mathbf{c}_1,\ldots,\mathbf{c}_r,\mathbf{w}_1,\ldots,\mathbf{w}_q)\) of \(W\). We show that the list \((\mathbf{c}_1,\ldots,\mathbf{c}_r,\mathbf{u}_1,\ldots,\mathbf{u}_p,\mathbf{w}_1,\ldots,\mathbf{w}_q)\) is a basis of \(U+W\).
First, it spans \(U+W\). Any \(\mathbf{x}\in U+W\) has the form \(\mathbf{x}=\mathbf{u}+\mathbf{w}\). Express \(\mathbf{u}\) in the chosen basis of \(U\) and \(\mathbf{w}\) in the chosen basis of \(W\); adding those expressions writes \(\mathbf{x}\) as a combination of the displayed list.
To prove independence, suppose \[ \sum_{i=1}^{r}a_i\mathbf{c}_i+\sum_{j=1}^{p}b_j\mathbf{u}_j+\sum_{k=1}^{q}d_k\mathbf{w}_k=\mathbf{0}. \] Set \(\mathbf{x}=\sum_{i=1}^{r}a_i\mathbf{c}_i+\sum_{j=1}^{p}b_j\mathbf{u}_j\in U\) and \(\mathbf{y}=\sum_{k=1}^{q}d_k\mathbf{w}_k\in W\). The equation gives \(\mathbf{x}=-\mathbf{y}\), so \(\mathbf{x}\in U\cap W\). Write \(\mathbf{x}=\sum_{i=1}^{r}e_i\mathbf{c}_i\), since the \(\mathbf{c}_i\) span the intersection. Then \[ \sum_{i=1}^{r}(a_i-e_i)\mathbf{c}_i+\sum_{j=1}^{p}b_j\mathbf{u}_j=\mathbf{0}. \] The chosen list is a basis of \(U\), hence independent; therefore \(a_i=e_i\) for every \(i\), and \(b_j=0\) for every \(j\). Substituting these facts into the original relation gives \[ \sum_{i=1}^{r}e_i\mathbf{c}_i+\sum_{k=1}^{q}d_k\mathbf{w}_k=\mathbf{0}. \] The chosen basis of \(W\) is independent, so every \(e_i=0\) and every \(d_k=0\). Thus all the original coefficients are zero, proving independence. The displayed list is a basis of \(U+W\). Counting its vectors gives \(\dim(U+W)=r+p+q\), while \(\dim U=r+p\), \(\dim W=r+q\), and \(\dim(U\cap W)=r\). Substitution proves the formula. \(\square\)
Finding the Intersection in a Concrete Example
Worked Example: Two Planes in R³
Let \(U=\operatorname{span}\{(1,0,1),(0,1,1)\}\) and \(W=\operatorname{span}\{(1,1,0),(0,1,1)\}\) in \(\mathbb{R}^3\). Find their intersection and the dimension of their sum.
Write a general vector of each subspace using scalars \(a,b,c,d\in\mathbb{R}\): \[ a(1,0,1)+b(0,1,1)=(a,b,a+b),\qquad c(1,1,0)+d(0,1,1)=(c,c+d,d). \] A vector is in the intersection exactly when these expressions are equal. Equating coordinates gives \(a=c\), \(b=c+d\), and \(a+b=d\). Using \(c=a\) and \(d=a+b\) in the second equation gives \(b=a+(a+b)\), so \(a=0\). Consequently \(c=0\), \(d=b\), and the common vector is \((0,b,b)=b(0,1,1)\). Thus \[ U\cap W=\operatorname{span}\{(0,1,1)\}. \]
The two generators of \(U\) are independent: if \(a(1,0,1)+b(0,1,1)=\mathbf{0}\), the first coordinate gives \(a=0\), and the second gives \(b=0\). The two generators of \(W\) are independent: if \(c(1,1,0)+d(0,1,1)=\mathbf{0}\), the first coordinate gives \(c=0\), and the third gives \(d=0\). Each pair is therefore a basis of its subspace, so \(\dim U=\dim W=2\), and the intersection has dimension \(1\).
For a direct check that \(U+W=\mathbb{R}^3\), use the three vectors \((1,0,1),(0,1,1),(1,1,0)\), which belong to \(U+W\). Given any \((x,y,z)\in\mathbb{R}^3\), set \[ a=\frac{x+z-y}{2},\qquad b=\frac{y+z-x}{2},\qquad c=\frac{x+y-z}{2}. \] Then \(a+c=x\), \(b+c=y\), and \(a+b=z\), so \(a(1,0,1)+b(0,1,1)+c(1,1,0)=(x,y,z)\). This verifies that the three vectors span \(\mathbb{R}^3\). The dimension formula agrees: \[ \dim(U+W)=2+2-1=3. \]
When the Intersection Is Only the Zero Vector
The formula also handles the case in which the subspaces have no shared nonzero vectors. Since every subspace contains \(\mathbf{0}\), this case means \(U\cap W=\{\mathbf{0}\}\), whose dimension is \(0\). The formula then says that the dimensions add. The next example checks this both by solving for an intersection and by representing an arbitrary vector in the sum.
Worked Example: Two Subspaces with Zero Intersection in R⁴
Let \[ U=\operatorname{span}\{(1,0,1,0),(0,1,0,1)\},\qquad W=\operatorname{span}\{(1,0,-1,0),(0,1,0,-1)\}. \] First, each displayed pair is independent. For \(U\), a zero linear combination has first and second coordinates equal to its two coefficients, so both are zero. For \(W\), the first and second coordinates likewise equal the coefficients, so both are zero. Hence \(\dim U=\dim W=2\).
A general vector in \(U\) is \((a,b,a,b)\), and a general vector in \(W\) is \((c,d,-c,-d)\). If these are equal, then \(a=c\) and \(a=-c\), giving \(a=c=0\); also \(b=d\) and \(b=-d\), giving \(b=d=0\). Thus \(U\cap W=\{\mathbf{0}\}\).
To verify the sum, a general combination of the four displayed generators is \[ (a+c,\ b+d,\ a-c,\ b-d). \] For any \((x_1,x_2,x_3,x_4)\in\mathbb{R}^4\), choose \[ a=\frac{x_1+x_3}{2},\quad c=\frac{x_1-x_3}{2},\quad b=\frac{x_2+x_4}{2},\quad d=\frac{x_2-x_4}{2}. \] Then \(a+c=x_1\), \(a-c=x_3\), \(b+d=x_2\), and \(b-d=x_4\). Every vector of \(\mathbb{R}^4\) belongs to \(U+W\), so \(\dim(U+W)=4\). The formula gives \(2+2-0=4\), as required.
When One Subspace Is Contained in the Other
At the other extreme, if \(U\subseteq W\), then \(U\cap W=U\) and \(U+W=W\). The formula reduces to \(\dim W=\dim U+\dim W-\dim U\). This limiting case is useful as a check: adding a subspace already contained in another does not enlarge the sum.
Worked Example: A Subspace Contained in a Larger One
In \(\mathbb{R}^4\), let \(U=\operatorname{span}\{\mathbf{e}_1,\mathbf{e}_2\}\) and \(W=\operatorname{span}\{\mathbf{e}_1,\mathbf{e}_2,\mathbf{e}_3\}\). The standard coordinate vectors in each displayed list are independent, so \(\dim U=2\) and \(\dim W=3\). Every vector of \(U\) is in \(W\), hence \(U\cap W=U\) and \(U+W=W\). Therefore \(\dim(U\cap W)=2\), \(\dim(U+W)=3\), and the formula gives \(2+3-2=3\).
For an explicit check, the vectors in \(W\) have the form \((a,b,c,0)\), and these are exactly the vectors obtained by adding a vector \((a,b,0,0)\in U\) and a vector \((0,0,c,0)\in W\). The sum is precisely \(W\), not a larger space.
What the Formula Tells Us
Because \(\dim(U\cap W)\geq 0\), the dimension formula implies \[ \dim(U+W)\leq \dim U+\dim W. \] Equality holds exactly when \(U\cap W=\{\mathbf{0}\}\): if the intersection is zero, its dimension is zero and the formula gives equality; if equality holds, the formula forces \(\dim(U\cap W)=0\), and a zero-dimensional subspace contains only \(\mathbf{0}\). This is a dimension count, not a claim that the subspaces themselves have no vectors in common: they always share the zero vector.
A common mistake is to add dimensions and stop there. In the first example, that incorrect calculation would give \(\dim(U+W)=2+2=4\). But \(U+W\subseteq\mathbb{R}^3\), and the intersection contains the one-dimensional subspace \(\operatorname{span}\{(0,1,1)\}\). The correction is to subtract the overlap: \(2+2-1=3\). Counting a basis of the intersection once in each subspace is exactly why the uncorrected sum counts shared directions twice.
Another useful check is containment. If \(U\subseteq W\), adding \(\dim U\) to \(\dim W\) without subtracting the intersection would incorrectly predict a larger dimension, even though \(U+W=W\). The formula subtracts \(\dim U\) in this case. In practice, first identify a basis for each subspace, then determine the intersection, and only then use the dimension formula. If an intersection is found by equating parametrizations, substitute the resulting parameters back into both parametrizations to verify that the claimed common vectors really belong to both subspaces.
Check Your Understanding
For each question, state the dimensions used and explain how the intersection affects the count.
- If \(\dim U=4\), \(\dim W=3\), and \(\dim(U\cap W)=2\), find \(\dim(U+W)\).
- In \(\mathbb{R}^3\), let \(U=\operatorname{span}\{(1,0,0),(0,1,0)\}\) and \(W=\operatorname{span}\{(0,1,0),(0,0,1)\}\). Find a basis of \(U\cap W\), then compute \(\dim(U+W)\).
- Suppose \(U\subseteq W\) and \(\dim U=2\), \(\dim W=5\). Find \(\dim(U\cap W)\), \(\dim(U+W)\), and check the formula.
- Prove that if \(\dim(U+W)=\dim U+\dim W\), then \(U\cap W=\{\mathbf{0}\}\).
- Explain why the intersection term must be subtracted when two subspaces share a nonzero vector.