# Determine the dimension of $U+W$ and of $U \cap W$. Which sums are direct sums?

Problem: Determine the dimension of the sum $U + W$ and of the intersection $U \cap W$ of the following subspaces $U$ and $W$. Which sums are direct sums?

1) $U = \text{span}\left\{(1,1,1)\right\}$ and $W = \text{span}\left\{(1,-1,2),(3,1,0)\right\} \in \mathbb{R}^3$;

2) \begin{align*} U = \text{span} \left\{ \begin{pmatrix} 1 & -1 \\ 0 & 0 \end{pmatrix}, \begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix}\right\} \end{align*} and \begin{align*} W = \text{span} \left\{ \begin{pmatrix} 0 & 0 \\ 1 & -1 \end{pmatrix}, \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}\right\} \end{align*}

Attempt at solution: 1) Since we see that the vectors are linearly independent, we have that $\dim(U) = 1$ and $\dim(W) = 2$. Furthermore we have $U \cap W = \left\{(0,0,0)\right\}$, since this is the only vector they have in common (not sure about this one). So $\dim(U \cap W) = 0$. On the basis of the equation $\dim(U+ W) = \dim(U) + \dim(W) - \dim(U \cap W)$ we then have that $\dim(U + W) = 3$. Also, this is a direct sum since any vector in $(U+W)$ can be written uniquely as a sum of a vector in $U$ and a vector in $W$.

2) I would say here that $\dim(U) = 2$ and $\dim(W) = 2$. But I'm not sure how to determine $U \cap W$? How does one handle problems like this, where a subspace is given in terms of the span of some vectors?

In 1), you are correct that $U\cap W=\{(0,0,0\}$ since the equation $a(1,1,1)=b(1,-1,2)+c(3,1,0)$ has only the trivial solution. (Equivalently, the 3 vectors are linearly independent.)
Any vector in U has the form $\begin{pmatrix}a&b-a\\-b&0\end{pmatrix}$ and any vector in W has the form $\begin{pmatrix}d&0\\c&-c-d\end{pmatrix}$,
so any vector in $U\cap W$ satisfies $a=b=d$ and $c=-a$;
so it has the form $\begin{pmatrix}a&0\\-a&0\end{pmatrix}$ and therefore $\text{dim}(U\cap W)=1$.
• I see. So that means $\dim(U + W) = 3$ for the second question. Also, I was wondering, for the first question, was I correct in saying that $(U+W)$ is a direct sum? How can I know this for sure? Because I guessed it. We had that $U \cap W = \left\{(0,0,0)\right\}$, but this doesn't prove the second condition yet, i.e. that any vector can be written in an unique manner as a sum of a vector in $U$ and a vector in $W$. – Kamil Jun 30 '15 at 22:19
• You are right about $\text{dim}(U+W)$, and you were correct in part 1 when you said that $U+W$ is a direct sum, since this follows from $U\cap W=\{\vec{0}\}$. – user84413 Jun 30 '15 at 22:24