Prove dimensions of subspaces Let $V$ be a vector space and $U,W$ be its subspaces. Prove that 
$$\text{dim}(U)+\text{dim}(W)=\text{dim}(U\cap W)+\text{dim}(\text{span}(U,W)).$$
Dimension of the vector spaces can be infinite. Any ideas on how to approach this problem?
 A: Denote ${\rm span}(U,W)=U+W=\{u+w:u\in U\mbox{ and }w\in W\}$.
Since $U$ and $W$ are finite-dimensional, 
$U\cap W$ is also finite-dimensional.
Let $\{v_1,\ldots,v_k\}$ be a basis for $U\cap W$, extend it to the bases
$\beta=\{v_1,\ldots,v_k,u_1,\ldots,u_m\}$ and $\gamma=\{v_1,\ldots,v_k,w_1,\ldots,w_n\}$ 
 for $U$ and $W$, respectively. Then
$$U+W={\rm span}(\beta)+{\rm span}(\gamma)={\rm span}(\beta\cup\gamma),$$ 
that is, $U+W$ has a finite generating set $\beta\cup\gamma$, and hence $U+W$ is 
finite-dimensional. Moreover, we claim that $\beta\cup\gamma$ is linearly independent. Actually,
we only have to claim $\{u_1,\ldots,u_m,w_1,\ldots,w_n\}$ is linearly independent.
One case is that if $w_j\in{\rm span}(\{u_1,\ldots,u_m\})$ for some $1\leq j\leq n,$ then 
$w_j\in U\cap W={\rm span}(\{v_1,\ldots,v_k\})$, and then 
$\{w_j,v_1,\ldots,v_k\}$ is linearly dependent, a contradiction. The same
result for the other case $u_i\in{\rm span}(\{w_1,\ldots,w_n\})$ for some  $1\leq i\leq m$.
Hence we get the conclusion that $\beta\cup\gamma$ forms a basis for $U+W$. Finally, we have
\begin{align}
\dim(U)+\dim(W)&=(k+m)+(k+n)  \\
               &=k+(k+m+n)   \\
               &=\dim(U\cap W)+\dim(U+W).
\end{align}
