Zum Inhalt springen

# Sum of subspaces – Serlo

In this article, we define the sum of two subspaces. This sum will again be a subspace, containing the two initial subspaces. We can think of the sum as a structure-preserving union.

## What is the sum of subspaces?

Consider two subspaces ${\displaystyle U}$ and ${\displaystyle W}$ of a vector space ${\displaystyle V}$. Now we want to combine these subspaces into a larger subspace that contains ${\displaystyle U}$ and ${\displaystyle W}$. A first approach could be to consider ${\displaystyle U\cup W}$. However, we have already seen in the article union and intersection of vector spaces that the union is generally not a subvector space.

Why is that the case? For ${\displaystyle u\in U}$ and ${\displaystyle w\in W}$, the vector ${\displaystyle u+w}$ is not always in ${\displaystyle U\cup W}$, as you can see from this example.

In order to solve the problem, we add all sums of the form ${\displaystyle u+w}$ with ${\displaystyle u\in U}$ and ${\displaystyle w\in W}$ to the union of the two subspaces ${\displaystyle U}$ and ${\displaystyle W}$. That means, we consider ${\displaystyle U\cup W\cup \{u+w\mid u\in U,w\in W\}}$. This expression still seems very complicated, but we can simplify it to ${\displaystyle \{u+w\mid u\in U,w\in W\}}$.

Question: Why is ${\displaystyle U\cup W\cup \{u+w\mid u\in U,w\in W\}=\{u+w\mid u\in U,w\in W\}}$?

Since ${\displaystyle U}$ and ${\displaystyle W}$ are subspace, the vector ${\displaystyle 0}$ is contained in both subspaces. Therefore, the following applies to all${\displaystyle w\in W}$ :

${\displaystyle w=w+0\in \{u+w\mid u\in U,w\in W\}}$

Therefore, ${\displaystyle W\subseteq \{u+w\mid u\in U,w\in W\}}$. Analogously, we get ${\displaystyle U\subseteq \{u+w\mid u\in U,w\in W\}}$.

We call this set the sum of ${\displaystyle U}$ and ${\displaystyle W}$ because it consists of the sums of vectors from ${\displaystyle U}$ and ${\displaystyle W}$. Later we will show that this is a subspace.

## Definition

Definition (Sum of two subspaces)

Let ${\displaystyle U}$ and ${\displaystyle W}$ be two subspaces of a vector space ${\displaystyle V}$. Then we define the sum of ${\displaystyle U}$ and ${\displaystyle W}$ as

${\displaystyle U+W:=\{u+w\in V\mid u\in U,w\in W\}.}$

## The sum is a subspace

We still have to prove that ${\displaystyle U+W}$ is a subspace.

Theorem (The sum is a subspace)

The sum
${\displaystyle U+W:=\{u+w\in V\mid u\in U,w\in W\}}$
is a subspace of ${\displaystyle V}$.

How to get to the proof? (The sum is a subspace)

We need to check the subspace criterion. To do so, we utilise the fact that all vectors ${\displaystyle v\in U+W}$ can be written as ${\displaystyle v=u+w}$ with ${\displaystyle u\in U}$ and ${\displaystyle w\in W}$. We can then trace the conditions of the subspace criterion back to the respective properties of ${\displaystyle U}$ and ${\displaystyle W}$.

Proof (The sum is a subspace)

Proof step: ${\displaystyle 0\in U+W}$

Since ${\displaystyle U}$ and ${\displaystyle W}$ are subspaces, we have ${\displaystyle 0\in U}$ and ${\displaystyle 0\in W}$. Thus, ${\displaystyle 0=0+0\in U+W}$.

Proof step: ${\displaystyle U+W}$ is closed with respect to addition

Let ${\displaystyle x,y\in U+W}$. We must show that ${\displaystyle x+y\in U+W}$. According to the definition of ${\displaystyle U+W}$, there exist ${\displaystyle u_{1},u_{2}\in U}$ and ${\displaystyle w_{1},w_{2}\in W}$, such that ${\displaystyle x=u_{1}+w_{1}}$ and ${\displaystyle y=u_{2}+w_{2}}$. We know that ${\displaystyle U}$ and ${\displaystyle W}$ are subspaces and therefore closed with respect to addition. Hence,

${\displaystyle x+y=(u_{1}+w_{1})+(u_{2}+w_{2})=\underbrace {(u_{1}+u_{2})} _{\in U}+\underbrace {(w_{1}+w_{2})} _{\in W}\in U+W}$.

Proof step: ${\displaystyle U+W}$ is closed with respect to scalar multiplication

Let ${\displaystyle v\in U+W}$ and ${\displaystyle \lambda \in K}$. We must show that ${\displaystyle \lambda v\in U+W}$. According to the definition of ${\displaystyle U+W}$, there exist ${\displaystyle u\in U}$ and ${\displaystyle w\in W}$, such that ${\displaystyle v=u+w}$. Since ${\displaystyle U}$ and ${\displaystyle W}$ are closed with respect to scalar multiplication, we have

${\displaystyle \lambda v=\lambda (u+w)=\underbrace {\lambda u} _{\in U}+\underbrace {\lambda w} _{\in W}\in U+W}$.

## Examples

### Sum of two lines in ℝ²

We consider the following two lines in ${\displaystyle \mathbb {R} ^{2}}$:

{\displaystyle {\begin{aligned}U:=\left\{{\begin{pmatrix}x\\0\end{pmatrix}}\mid x\in \mathbb {R} \right\}{\text{ und }}W:=\left\{{\begin{pmatrix}x\\x\end{pmatrix}}\mid x\in \mathbb {R} \right\}\end{aligned}}}

So ${\displaystyle U}$ is the ${\displaystyle x}$-axis and ${\displaystyle W}$ is the line that runs through the origin and the point ${\displaystyle (1,1)}$. What is the sum ${\displaystyle U+W}$?

Using the definition ${\displaystyle U+W=\{u+w\mid u\in U,w\in W\}}$ we can calculate a convenient set description for ${\displaystyle U+W}$:

{\displaystyle {\begin{aligned}&U+W\\[0.3em]=&\left\{{\begin{pmatrix}x\\0\end{pmatrix}}\mid x\in \mathbb {R} \right\}+\left\{{\begin{pmatrix}x\\x\end{pmatrix}}\mid x\in \mathbb {R} \right\}\\[0.3em]=&\left\{{\begin{pmatrix}x\\0\end{pmatrix}}\mid x\in \mathbb {R} \right\}+\left\{{\begin{pmatrix}y\\y\end{pmatrix}}\mid y\in \mathbb {R} \right\}\\[0.3em]=&\left\{{\begin{pmatrix}x\\0\end{pmatrix}}+{\begin{pmatrix}y\\y\end{pmatrix}}\mid x,y\in \mathbb {R} \right\}\\[0.3em]=&\left\{{\begin{pmatrix}x+y\\y\end{pmatrix}}\mid x,y\in \mathbb {R} \right\}\end{aligned}}}

We can write each vector in ${\displaystyle \mathbb {R} ^{2}}$ as ${\displaystyle (x+y,y)^{T}}$ with matching ${\displaystyle x,y\in \mathbb {R} }$. Specifically, for each vector ${\displaystyle (a,b)^{T}\in \mathbb {R} ^{2}}$ we can find scalars ${\displaystyle x}$ and ${\displaystyle y\in \mathbb {R} }$ such that ${\displaystyle (a,b)=(x+y,y)}$, namely ${\displaystyle x:=a-b}$ and ${\displaystyle y:=b}$. Therefore, ${\displaystyle U+W=\mathbb {R} ^{2}}$ holds.

Intuitively, you can immediately see that ${\displaystyle U+W=\mathbb {R} ^{2}}$. This is because ${\displaystyle U+W}$ is a subspace of ${\displaystyle \mathbb {R} ^{2}}$, which contains the straight lines ${\displaystyle U}$ and ${\displaystyle W}$. The only subspaces of ${\displaystyle \mathbb {R} ^{2}}$ are the null space, lines that run through the origin and ${\displaystyle \mathbb {R} ^{2}}$. As the straight lines ${\displaystyle U}$ and ${\displaystyle W}$ do not coincide but are different, ${\displaystyle U+W}$ cannot be a line. Therefore, we must have ${\displaystyle U+W=\mathbb {R} ^{2}}$.

### Sum of two lines in ℝ³

Consider the following lines in ${\displaystyle \mathbb {R} ^{3}}$:

{\displaystyle {\begin{aligned}U:=\left\{{\begin{pmatrix}x\\x\\2x\end{pmatrix}}\mid x\in \mathbb {R} \right\}{\text{ and }}W:=\left\{{\begin{pmatrix}3x\\0\\5x\end{pmatrix}}\mid x\in \mathbb {R} \right\}\end{aligned}}}

Here ${\displaystyle U}$ is the line in ${\displaystyle \mathbb {R} ^{3}}$ that runs through the origin and the point ${\displaystyle (1,1,2)}$ and ${\displaystyle W}$ is the line that runs through the origin and ${\displaystyle (3,0,5)}$. We want to determine the sum ${\displaystyle U+W=\{u+w\mid u\in U,w\in W\}}$.

{\displaystyle {\begin{aligned}&U+W\\[0.3em]=&\left\{{\begin{pmatrix}x\\x\\2x\end{pmatrix}}\mid x\in \mathbb {R} \right\}+\left\{{\begin{pmatrix}3y\\0\\5y\end{pmatrix}}\mid y\in \mathbb {R} \right\}\\[0.3em]=&\left\{{\begin{pmatrix}x\\x\\2x\end{pmatrix}}+{\begin{pmatrix}3y\\0\\5y\end{pmatrix}}\mid x,y\in \mathbb {R} \right\}\\[0.3em]=&\left\{x{\begin{pmatrix}1\\1\\2\end{pmatrix}}+y{\begin{pmatrix}3\\0\\5\end{pmatrix}}\mid x,y\in \mathbb {R} \right\}\end{aligned}}}

So ${\displaystyle U+W}$ is the plane that is spanned by the vectors ${\displaystyle (1,1,2)^{T}}$ and ${\displaystyle (3,0,5)^{T}}$.

### Sum of two planes in ℝ³

Consider the following two planes:

${\displaystyle U_{1}=\left\{{\begin{pmatrix}2x\\x\\y\end{pmatrix}}\mid x,y\in \mathbb {R} \right\}{\text{ and }}W=\left\{{\begin{pmatrix}0\\2x\\-y\end{pmatrix}}\mid x,y\in \mathbb {R} \right\}}$

The planes are not equal. We can see this, for example, from the fact that the vector ${\displaystyle (2,1,0)^{T}}$ lies in ${\displaystyle U_{1}}$, but not in ${\displaystyle W}$. Therefore, the two planes should intuitively span the entire space ${\displaystyle \mathbb {R} ^{3}}$. So we can initially assume that ${\displaystyle U_{1}+W=\mathbb {R} ^{3}}$.

We now try to prove this assumption. To do so, we have to show that each vector ${\displaystyle (a,b,c)^{T}\in \mathbb {R} ^{3}}$ lies in the sum ${\displaystyle U_{1}+W=\{u+w\mid u\in U_{1},w\in W\}}$. We must therefore find vectors ${\displaystyle (a,b,c)^{T}}$ for ${\displaystyle u\in U_{1}}$ and ${\displaystyle w\in W}$ such that ${\displaystyle (a,b,c)^{T}=u+w}$. Then ${\displaystyle (a,b,c)^{T}\in U_{1}+W}$ applies. Here we can use the definitions of ${\displaystyle U_{1}}$ and ${\displaystyle W}$: Each vector ${\displaystyle u\in U_{1}}$ can be written as ${\displaystyle (2x_{1},x_{1},y_{1})^{T}}$ with ${\displaystyle x_{1},y_{1}\in \mathbb {R} }$. Similarly, each vector ${\displaystyle w\in W}$ can be written as ${\displaystyle (0,2x_{2},-y_{2})^{T}}$ with ${\displaystyle x_{2},y_{2}\in \mathbb {R} }$. So we want to find numbers ${\displaystyle x_{1},y_{1},x_{2},y_{2}\in \mathbb {R} }$ for the vector ${\displaystyle (a,b,c)^{T}\in \mathbb {R} ^{3}}$ satisfying

${\displaystyle {\begin{pmatrix}a\\b\\c\end{pmatrix}}={\begin{pmatrix}2x_{1}\\x_{1}\\y_{1}\end{pmatrix}}+{\begin{pmatrix}0\\2x_{2}\\-y_{2}\end{pmatrix}}.}$

We can re-write this as

${\displaystyle {\begin{pmatrix}a\\b\\c\end{pmatrix}}={\begin{pmatrix}2x_{1}+0\\x_{1}+2x_{2}\\y_{1}-y_{2}\end{pmatrix}}={\begin{pmatrix}2x_{1}\\x_{1}+2x_{2}\\y_{1}-y_{2}\end{pmatrix}}.}$

How can we choose ${\displaystyle x_{1},y_{1},x_{2},y_{2}\in \mathbb {R} }$ such that the above equation is satisfied? For instance,

{\displaystyle {\begin{aligned}x_{1}&:={\tfrac {1}{2}}a\\y_{1}&:=c\\x_{2}&:={\tfrac {1}{2}}b-{\tfrac {1}{4}}a\\y_{2}&:=0\end{aligned}}}

will do this job.

To summarise, the following applies to any vector ${\displaystyle (a,b,c)^{T}\in \mathbb {R} ^{3}}$:

${\displaystyle {\begin{pmatrix}a\\b\\c\end{pmatrix}}=\underbrace {\begin{pmatrix}2\left({\tfrac {1}{2}}a\right)\\{\tfrac {1}{2}}a\\c\end{pmatrix}} _{\in U_{1}}+\underbrace {\begin{pmatrix}0\\2\left({\tfrac {1}{2}}b-{\tfrac {1}{4}}a\right)\\-0\end{pmatrix}} _{\in W}\in U_{1}+W}$

Therefore, ${\displaystyle U_{1}+W=\mathbb {R} ^{3}}$ indeed holds, i.e. the two planes together span the entire ${\displaystyle \mathbb {R} ^{3}}$.

### Absorption property of the sum

We have already looked at a few examples of sums in the space ${\displaystyle \mathbb {R} ^{3}}$. Now let's look at another example in ${\displaystyle \mathbb {R} ^{3}}$. Let

{\displaystyle {\begin{aligned}&U_{2}=\left\{{\begin{pmatrix}0\\x\\2x\end{pmatrix}}\mid x\in \mathbb {R} \right\}\\&{\text{and}}\\&W=\left\{{\begin{pmatrix}0\\y\\z\end{pmatrix}}\mid y,z\in \mathbb {R} \right\}\end{aligned}}}

Then ${\displaystyle U_{2}}$ is the line that runs through the origin and through the point ${\displaystyle (0,1,2)}$. The subspace ${\displaystyle W}$ is the ${\displaystyle y,z}$-plane.

What is the sum of the subspaces ${\displaystyle U_{2}+W}$? The line ${\displaystyle U_{2}}$ lies in the ${\displaystyle y,z}$-plane, i.e. in ${\displaystyle W}$. The sum is intuitively the subspace consisting of ${\displaystyle U_{2}}$ and ${\displaystyle W}$. Since ${\displaystyle U_{2}}$ is already contained in ${\displaystyle W}$, the sum should simply be ${\displaystyle W}$, i.e. ${\displaystyle U_{2}+W=W}$. This is indeed the case, as the exercise below shows.

Intuitively, this should also apply more generally: Let ${\displaystyle U}$ and ${\displaystyle W}$ be two subspaces of an arbitrary vector space ${\displaystyle V}$. If ${\displaystyle U}$ lies in ${\displaystyle W}$, i.e. ${\displaystyle U\subseteq W}$, then the sum ${\displaystyle U+W}$ should simply result in ${\displaystyle W}$. This is called the absorption property, as ${\displaystyle U}$ is absorbed by ${\displaystyle W}$ when taking the sum. We prove it in the following exercise.

Exercise (Absorption property of the sum)

Let ${\displaystyle V}$ be a ${\displaystyle K}$-verctor space, as well as ${\displaystyle U}$ and ${\displaystyle W}$ two subspaces of ${\displaystyle V}$. Whenever ${\displaystyle U\subseteq W}$, then it follows that ${\displaystyle U+W=W}$.

Solution (Absorption property of the sum)

We assume that ${\displaystyle U\subseteq W}$ applies and prove that ${\displaystyle U+W=W}$. To show this equality, we prove the two inclusions ${\displaystyle W\subseteq U+W}$ and ${\displaystyle U+W\subseteq W}$.

Proof step: ${\displaystyle W\subseteq U+W}$

Let ${\displaystyle w\in W}$. Then,

${\displaystyle w=\underbrace {0} _{\in U}+\underbrace {w} _{\in W}\in U+W.}$

Proof step: ${\displaystyle U+W\subseteq W}$

Let ${\displaystyle v\in U+W}$. Then there are vectors ${\displaystyle u\in U}$ and ${\displaystyle w\in W}$, such that ${\displaystyle v=u+w}$. Since ${\displaystyle U\subseteq W}$ we have ${\displaystyle u\in W}$. We know that ${\displaystyle W}$ is a subspace and therefore closed under addition. Furthermore, ${\displaystyle u,w\in W}$. Thus we get ${\displaystyle v=u+w\in W}$.

Hint

From the absorption property, we conclude ${\displaystyle U+U=U}$ for any subspace ${\displaystyle U}$. This is because every subspace is contained within itself, i.e., ${\displaystyle U\subseteq U}$.

## Alternative definitions

### Using the intersection

We have constructed a subspace ${\displaystyle U+W}$ of ${\displaystyle V}$, which contains the two subspaces ${\displaystyle U}$ and ${\displaystyle W}$. Since we have included only "necessary" vectors in our construction of ${\displaystyle U+W}$, this sum ${\displaystyle U+W}$ should be the smallest subspace that contains both ${\displaystyle U}$ and ${\displaystyle W}$.

We can also describe the smallest subspace containing ${\displaystyle U}$ and ${\displaystyle W}$ differently: We first consider all subspaces that contain ${\displaystyle U}$ and ${\displaystyle W}$ and then take the intersection of these subspaces. This intersection still contains ${\displaystyle U}$ and ${\displaystyle W}$ and is also a subspace, since the intersection of any number of subspaces is again a subspace. Intuitively, there should be no smaller subspace with this property. Thus, we also obtain the smallest subspace that contains both ${\displaystyle U}$ and ${\displaystyle W}$. According to these considerations, it should therefore be the case that ${\displaystyle U+W}$ is equal to the intersection of all subspaces containing ${\displaystyle U}$ and ${\displaystyle W}$. We now want to prove this:

Theorem (Definition of the sum over the intersection of subspaces)

Let ${\displaystyle V}$ be a vector space, as well as ${\displaystyle U}$ and ${\displaystyle W}$ two subspaces of ${\displaystyle V}$. For ${\displaystyle S:=\bigcap _{U\cup W\subseteq Z \atop Z{\text{ subspace}}}Z}$ gilt:

${\displaystyle S=U+W}$

Proof (Definition of the sum over the intersection of subspaces)

We prove the two inclusions ${\displaystyle S\subseteq U+W}$ and ${\displaystyle S\supseteq U+W}$.

Proof step: ${\displaystyle \subseteq }$

It is sufficient to show that ${\displaystyle U+W}$ is a subspace that contains ${\displaystyle U\cup W}$. Then it follows from the definition of ${\displaystyle S}$ that

${\displaystyle S=\bigcap _{U\cup W\subseteq Z \atop Z{\text{ subspace}}}Z\subseteq U+W.}$

We first show that ${\displaystyle U}$ is contained in ${\displaystyle U+W}$. Then, ${\displaystyle W}$ being contained in ${\displaystyle U+W}$ will follow analogously. So let ${\displaystyle u\in U}$. Since ${\displaystyle W}$ is a subspace, ${\displaystyle 0\in W}$. Therefore, ${\displaystyle u=u+0\in U+W}$.

Proof step: ${\displaystyle \supseteq }$

We must show that every subspace ${\displaystyle Z}$ of ${\displaystyle V}$ that contains both ${\displaystyle U}$ and ${\displaystyle W}$ must also contain ${\displaystyle U+W}$.

Let ${\displaystyle Z}$ be such a subspace. Let ${\displaystyle v\in U+W}$. Then there exist ${\displaystyle u\in U}$ and ${\displaystyle w\in W}$ with ${\displaystyle v=u+w}$.

In particular, ${\displaystyle u,w\in Z}$ applies. Since ${\displaystyle Z}$ is a subspace, ${\displaystyle v=u+w\in Z}$ holds.

We have thus shown: ${\displaystyle U+W\subseteq Z}$.

This renders us the two alternative definitions:

Definition (Definition of the sum of subvspaces via the intersection)

Let ${\displaystyle V}$ be a vector space, as well as ${\displaystyle U}$ and ${\displaystyle W}$ two subspaces of ${\displaystyle V}$. Then the sum of ${\displaystyle U}$ and ${\displaystyle W}$ is given by

${\displaystyle U+W=\bigcap _{U\cup W\subseteq Z \atop Z{\text{ subspace}}}Z.}$

### Using the span

We can describe the smallest subspace containing ${\displaystyle U}$ and ${\displaystyle W}$ or ${\displaystyle U\cup W}$ in yet a third way. In the article "span", we saw that for a given subset ${\displaystyle M}$ of ${\displaystyle V}$, the span of ${\displaystyle M}$ is the smallest subspace containing ${\displaystyle M}$. Therefore, ${\displaystyle \operatorname {span} (U\cup W)}$ is the smallest subspace that contains ${\displaystyle U}$ and ${\displaystyle W}$. So it must also be equal to the sum ${\displaystyle U+W}$.

Theorem (Definition via the span)

Let ${\displaystyle V}$ be a vector space, as well as ${\displaystyle U}$ and ${\displaystyle W}$ two subspaces of ${\displaystyle V}$. Then,

${\displaystyle U+W=\operatorname {span} (U\cup W)}$

Proof (Definition via the span)

We show the two inclusions ${\displaystyle U+W\subseteq \operatorname {span} (U\cup W)}$ and ${\displaystyle U+W\supseteq \operatorname {span} (U\cup W)}$.

Proof step: ${\displaystyle \subseteq }$

Let ${\displaystyle v\in U+W}$. Then there exist ${\displaystyle u\in U}$ and ${\displaystyle w\in W}$ with ${\displaystyle v=u+w}$. Because the span of ${\displaystyle U\cup W}$ consists of linear combinations of vectors from ${\displaystyle U}$ and ${\displaystyle W}$, we indeed have ${\displaystyle v=u+w\in \operatorname {span} (U\cup W)}$.

Proof step: ${\displaystyle \supseteq }$

we have seen that ${\displaystyle \operatorname {span} (U\cup W)}$ is the smallest subspace that contains ${\displaystyle U\cup W}$. Since ${\displaystyle U+W}$ is a subspace of ${\displaystyle V}$ that contains ${\displaystyle U\cup W}$, we finally obtain ${\displaystyle \operatorname {span} (U\cup W)\subseteq U+W}$.

## Dimension formula

Now that we know what the sum of two subspaces ${\displaystyle U}$ and ${\displaystyle W}$ of a vector space ${\displaystyle V}$ is, we can ask ourselves how large the sum ${\displaystyle U+W}$ is. The sum of subspaces is the vector space analogue of the union of sets. For two sets ${\displaystyle X}$ and ${\displaystyle Y}$, the union ${\displaystyle X\cup Y}$ has a maximum of ${\displaystyle |X|+|Y|}$ elements. If ${\displaystyle X}$ and ${\displaystyle Y}$ share elements, i.e. have a non-empty intersection, then ${\displaystyle X\cup Y}$ has fewer than ${\displaystyle |X|+|Y|}$ elements, because we count the elements from ${\displaystyle X\cap Y}$ twice. This gives us the formula

${\displaystyle |X\cup Y|+|X\cap Y|=|X|+|Y|.}$

In order to transfer this formula to vector spaces, we need the correct concept of the size of a vector space, i.e. the analogue for the cardinality of a set for vector spaces. This is exactly the idea of the dimension of a vector space. Therefore, if an analogue formula holds for vector spaces, the following should be true:

${\displaystyle \dim(U+W)+\dim(U\cap W)=\dim(U)+\dim(W).}$

If ${\displaystyle \dim(U\cap W)}$ is finite, we can convert this formula to a formula for ${\displaystyle \dim(U+W)}$, namely

${\displaystyle \dim(U+W)=\dim(U)+\dim(W)-\dim(U\cap W).}$

Before we prove our assumption, we will test it with a few examples:

Let us reconsider the two lines from the example above:

{\displaystyle {\begin{aligned}U:=\left\{{\begin{pmatrix}x\\0\end{pmatrix}}\mid x\in \mathbb {R} \right\}{\text{ and }}W:=\left\{{\begin{pmatrix}x\\x\end{pmatrix}}\mid x\in \mathbb {R} \right\}\end{aligned}}}

We have already calculated above that ${\displaystyle U+W=\mathbb {R} ^{2}}$. This fits our assumption: ${\displaystyle \mathbb {R} ^{2}}$ is two-dimensional, ${\displaystyle U}$ and ${\displaystyle W}$ are one-dimensional and the intersection ${\displaystyle U\cap W=\{0\}}$ is zero-dimensional.

Let us look again at the example above with the two planes:

${\displaystyle U_{1}=\left\{{\begin{pmatrix}2x\\x\\y\end{pmatrix}}\mid x,y\in \mathbb {R} \right\}{\text{ and }}W=\left\{{\begin{pmatrix}0\\2x\\-y\end{pmatrix}}\mid x,y\in \mathbb {R} \right\}}$

We have already calculated above that ${\displaystyle U_{1}+W=\mathbb {R} ^{3}}$ and the figure shows that ${\displaystyle U_{1}}$ and ${\displaystyle W}$ intersect in a straight line. This means that the dimension of ${\displaystyle U_{1}+W}$ is three, the dimension of ${\displaystyle U_{1}}$ and ${\displaystyle W}$ are both two and the dimension of ${\displaystyle U_{1}\cap W}$ is just one. So the dimension formula also holds in this case.

As a final example, we consider the subspace ${\displaystyle U=\mathbb {R} ^{3}}$ in ${\displaystyle V=\mathbb {R} ^{3}}$ and

${\displaystyle W=\left\{{\begin{pmatrix}x\\0\\x\end{pmatrix}};x\in \mathbb {R} \right\}}$

The subspace ${\displaystyle W}$ is a line through the origin, i.e. ${\displaystyle \dim(W)=1}$ and we have ${\displaystyle \dim(U)=\dim(\mathbb {R} ^{3}==3}$. Because ${\displaystyle U\subseteq W}$, the Absorption property of the sum tells us that ${\displaystyle U+W=U=\mathbb {R} ^{3}}$. For the same reason, we have ${\displaystyle U\cap W=W}$. Thus,

${\displaystyle \dim(U+W)=3=3+1-1=\dim(U)+\dim(W)-\dim(U\cap W).}$

So the dimension formula is also valid in this case.

Theorem (Dimension formula)

Let ${\displaystyle V}$ be a finite-dimensional ${\displaystyle K}$-vector space, as well as ${\displaystyle U}$ and ${\displaystyle W}$ two subspaces of ${\displaystyle V}$. Then,

${\displaystyle \dim(U+W)=\dim(U)+\dim(W)-\dim(U\cap W).}$

How to get to the proof? (Dimension formula)

The motivation for our formula comes from the world of finite sets. Therefore, we would also like to trace the proof back to the case of (finite) sets. The structure of a vector space can be reduced to its basis, which is indeed a finite set. The cardinality of a basis is exactly the dimension of the vector space, so we can trace the dimension formula back to a statement about the cardinality of (finite) basis sets. To do so, we have to choose suitable bases ${\displaystyle B_{U},B_{W},B_{U\cap W}}$ of ${\displaystyle U}$, ${\displaystyle W}$ and ${\displaystyle U\cap W}$ for which ${\displaystyle B_{U}\cap B_{W}=B_{U\cap W}}$. In this case, we obtain from the number-of-elements-formula for sets that ${\displaystyle B_{U}\cup B_{W}}$ has the desired size. Then we just have to prove that ${\displaystyle B_{U}\cup B_{W}}$ is a basis of ${\displaystyle U+W}$. We do this by reducing everything to the fact that ${\displaystyle B_{U}}$ and ${\displaystyle B_{W}}$ are already bases of ${\displaystyle U}$ and ${\displaystyle W}$.

To construct the desired bases ${\displaystyle B_{U},B_{W}}$ and ${\displaystyle B_{U\cap W}}$, we use the basis completion theorem. With this we can extend a basis of ${\displaystyle U\cap W}$ to one of ${\displaystyle U}$ and one of ${\displaystyle W}$.

Proof (Dimension formula)

Let now ${\displaystyle n=\dim(U),m=\dim(W)}$ and ${\displaystyle k=\dim(U\cap W)}$. Then there is a basis ${\displaystyle \{v_{1},\ldots ,v_{k}\}}$ of ${\displaystyle U\cap W}$. We can extend it to a basis ${\displaystyle B_{U}:=\{v_{1},\ldots ,v_{k},u_{k+1},\ldots ,u_{n}\}}$ of ${\displaystyle U}$, as well as to a basis ${\displaystyle B_{W}:=\{v_{1},\ldots ,v_{k},w_{k+1},\ldots ,w_{m}\}}$ of ${\displaystyle W}$.

We now show that ${\displaystyle B:=\{v_{1},\ldots ,v_{k},u_{k+1},\ldots ,u_{n},w_{k+1},\ldots ,w_{m}\}}$ is a basis of ${\displaystyle U+W}$.

Proof step: ${\displaystyle B}$ is a generating system

Since according to the previous theorem we have ${\displaystyle U+W=\operatorname {span} (U\cup W)=\operatorname {span} (B_{U}\cup B_{W})=\operatorname {span} (B)}$ , we know that ${\displaystyle B}$ is a generating system of ${\displaystyle U+W}$.

Proof step: ${\displaystyle B}$ is linearly independent

Let ${\displaystyle \alpha _{i},\beta _{j},\gamma _{l}\in K}$ with ${\displaystyle i\in \{1,\ldots k\},j\in \{k+1,\ldots ,n\}}$ and ${\displaystyle l\in \{k+1,\ldots ,m\}}$ such that

${\displaystyle \sum _{i=1}^{k}\alpha _{i}v_{i}+\sum _{j=k+1}^{n}\beta _{j}u_{j}+\sum _{l=k+1}^{m}\gamma _{l}w_{l}=0.}$

We can re-write this as

${\displaystyle \underbrace {\sum _{i=1}^{k}\alpha _{i}v_{i}+\sum _{j=k+1}^{n}\beta _{j}u_{j}} _{\in U}=\underbrace {-\sum _{l=k+1}^{m}\gamma _{l}w_{l}} _{\in W}\in U\cap W.}$

Since ${\displaystyle \{v_{1},\ldots ,v_{k}\}}$ is a basis of ${\displaystyle U\cap W}$, we can write the above element as a linear combination of these basis vectors:

${\displaystyle \sum _{i=1}^{k}\alpha _{i}v_{i}+\sum _{j=k+1}^{n}\beta _{j}u_{j}=\sum _{i=1}^{k}\alpha '_{i}v_{i}}$

This is equivalent to

${\displaystyle \sum _{i=1}^{k}(\alpha _{i}-\alpha ')_{i}v_{i}+\sum _{j=k+1}^{n}\beta _{j}u_{j}=0}$

Since ${\displaystyle B_{U}=\{v_{1},\ldots ,v_{k},u_{k+1},\ldots ,u_{n}\}}$ is a basis of ${\displaystyle U}$, it follows that ${\displaystyle \beta _{j}=0}$ for all ${\displaystyle j=k+1,\ldots ,n}$ and thus we get ${\displaystyle \alpha _{i}-\alpha '_{i}=0}$ for all ${\displaystyle i=1,\ldots ,k}$.

Plugging ${\displaystyle \beta _{j}=0}$ into our first equation, we then get

${\displaystyle \sum _{i=1}^{k}\alpha _{i}v_{i}+\sum _{l=k+1}^{m}\gamma _{l}w_{l}=0.}$

This is a linear combination of the basis vectors from ${\displaystyle B_{W}}$, so ${\displaystyle \alpha _{i}=0}$ must also apply for all ${\displaystyle i=1,\ldots ,k}$ and ${\displaystyle \gamma _{l}=0}$ for all ${\displaystyle l=k+1,\ldots ,m}$. Hence ${\displaystyle B}$ is linearly independent.

Since ${\displaystyle B}$ is a basis of ${\displaystyle U+W}$ , we have

${\displaystyle \dim(U+W)=|B|=k+(n-k)+(m-k)=n+m-k=|B_{U}|+|B_{W}|-|\{v_{1},\ldots ,v_{k}\}|=\dim(U)+\dim(W)-\dim(U\cap W).}$

Warning

The formula from the above theorem cannot be used for infinite-dimensional vector spaces. The reason is that there is no unique, meaningful way to subtract infinity from infinity. To illustrate this problem, consider the sets ${\displaystyle U=\{0,1,2,\dots \}}$ and ${\displaystyle W=\{1,2,\dots \}}$. Then ${\displaystyle U\cap W=W}$ and thus ${\displaystyle |U|+|W|-|U\cap W|=\infty +\infty -\infty }$, which makes mathematically no sense. The same can happen with vector spaces: For example, we can consider ${\displaystyle U=k[X]}$ and ${\displaystyle W=\{f\in k[X]\mid \deg f\geq 1\}}$ in ${\displaystyle V=k[X]}$. Again, ${\displaystyle U\cap W=W}$ and we have ${\displaystyle \dim(U)+\dim(W)-\dim(U\cap W)=\infty +\infty -\infty }$.

However, if we move the term with the intersection to the other side of the equation, then the formula makes sense also for infinite-dimensional vector spaces. This means that for any subspaces ${\displaystyle U}$ and ${\displaystyle W}$ of a vector space ${\displaystyle V}$, we have

${\displaystyle \dim(U+W)+\dim(U\cap W)=\dim(U)+\dim(W).}$

For this formula to also make sense in infinite dimensions, we require ${\displaystyle \infty +\infty =\infty }$, which is a mathematically meaningful and true statement.