Linear algebra - Dimension theorem. Suppose we have a vector space $V$, and $U$, $W$ subspaces of  $V$.
Dimension theorem states:
$$ \dim(U+W)=\dim U+ \dim W - \dim (U\cap W).$$
My question is:
Why is $U \cap W$ necessary in this theorem?

$U \cap W$ is the intersection of the vector spaces $U$ and $W$, that is, the set of all vectors of the space $V$ which are in both subspaces $U$ and $W$.
As $U$ and $W$ are both subspaces of $V$, their intersection $U \cap W$ is also a subspace of $V$ (this assertion can be easily proved). Because $U \cap W$ is a subspace, it is also a vector space itself, and as such it has a basis. The number of elements in this basis will be the space's dimension, $\dim (U \cap W)$.
Loosely speaking, one could think that summing $\dim(U)$ and $\dim(W)$ would yield $\dim(U+W)$. But as $(U \cap W) \subset U$ and $(U \cap W) \subset W$, the sum $\dim(U) + \dim(W)$ "counts" two times the dimension of $U \cap W$ - once in $\dim(U)$ and once more in $\dim(W)$. To make it sum up to $\dim(U+W)$ accurately, we must then subtract the dimension of $U \cap W$, so that it is "counted" only once. This way, we obtain:
$$ \dim(U+W)  = \dim(U) + \dim(W) - \dim(U \cap W).$$
Note that this is not, by any means, a formal proof. It is only an informal explanation of why $U \cap W$ is needed in this formula.
