# Compute the dimension of a sum of subspaces

Let $$V$$ be the vector space of $$2 \times 2$$ matrices over $$\mathbb F$$. Let $$W_1$$ be the set of matrices of the form $$\begin{bmatrix} x &−x \\ y & z \end{bmatrix}$$ and let $$W_2$$ be the set of matrices of the form $$\begin{bmatrix} a &b \\ −a & c \end{bmatrix}$$. What is the dimension of $$W_1+W_2$$?

I found that the basis of $$W_1$$ and the basis of $$W_2$$ have size $$3$$, so $$\dim W_1=\dim W_2=3$$. I also found that the basis of $$W_1 \cap W_2$$ has size $$2$$, so $$\dim(W_1 \cap W_2)=2$$.

From this informatinon, how can I find the dimension of $$W_1+W_2$$ (without using the formula for the dimension of a sum)?

All I know so far is that $$W_1+W_2$$ is the smallest subspace that contains $$W_1$$ and $$W_2$$, and is contained in $$V$$. Since $$\dim W_1=\dim W_2=3$$ and $$\dim V=4$$, we must have $$\dim(W_1+W_2)$$ to be $$3$$ or $$4$$.

How do I know which one is it?

Source: Linear Algebra by Hoffman and Kunze - Exercise 7 of Section 2.3

• If $\beta_1$ is a basis for $W_1$ and $\beta_2$ is a basis for $W_2$, then it should be easy for you to verify that $\beta_1 \cup \beta_2$ will span $W_1+W_2$. So, to find the dimension of this space, all you need to do is find the number of linearly independent vectors in $\beta_1 \cup \beta_2$. In this particular example, it is not hard to find an explicit basis for $W_1 + W_2$ (after finding the basis, you'll see the dimension is $4$). – peek-a-boo Jul 9 '19 at 0:56

The dimension is $$4$$, that is, $$W_1+W_2$$ consists of all the $$2\times 2$$ matrices. You can check directly that every matrix can be written as a sum of a matrix from $$W_1$$ and a matrix from $$W_2$$, for instance: $$\begin{bmatrix} x &y \\ z & t \end{bmatrix}=\begin{bmatrix} x &-x \\ z & t \end{bmatrix}+ \begin{bmatrix} 0 & x+y \\ 0 & 0 \end{bmatrix}$$
Alternatively, still without using the inclusion-exclusion dimension formula, note that $$W_1 = W_1 + \{0\} \subseteq W_1 + W_2.$$ If $$\dim(W_1 + W_2) = 3 = \dim(W_1)$$, then $$W_1$$ is a subspace of $$W_1 + W_2$$, but with the same dimension. This implies that $$W_1 = W_1 + W_2$$. A similar argument also shows that $$W_2 = W_1 + W_2$$. So, under this assumption, we have $$W_1 = W_2.$$ This is very easy to disprove!