Let $V$ be a [[Vector spaces|vector space]] and $W_{1},W_{2}\subset V$ be [[Vector subspace|subspaces]] of $V.$ Then we define their **sum** to be the [[Span of Subset of Vector Space|span]] of their [[Union of sets|union]] $W_{1}+W_{2}=\langle W_{1} \cup W_{2} \rangle.$If $W_{1}$ and $W_{2}$ are finite-dimensional, how are $\dim(W_{1}), \text{dim}(W_{2})$ and $\dim(W_{1}+W_{2})$ related? # Statements > [!NOTE] Theorem (Dimension Formula) > Let $U_{1}, U_{2}$ be two finite-dimensional subspaces of $V.$ Then $\dim U_{1} +\dim U_{2} = \dim (U_{1}+U_{2}) + \dim(U_{1} \cap U_{2}).$ In particular, if $V$ is the [[Internal direct sum|internal direct sum]] of $U$ and $U'$, then $\text{dim}(V)=\text{dim}(U_{1})+\dim(U_{2})$. This is the content of the [[Rank-nullity formula]]. # Proofs *Proof*. Let $W=U_{1} \cap U_{2}$, [[Vector subspace#^dc4bab|which is finite-dimensional subspace]] of $V$. Choose a basis $B_{W}:=\{ w_{1},\dots,w_{t} \}$ for $W$. By [[Basis of Vector Space#^df1788|sifting lemma]], we may extend it to basis $\{ w_{1},\dots,w_{t},u_{1},\dots,u_{s} \}$ of $U_{1}$. Similarly, we may extend $B_{W}$ to a basis $\{ w_{1},\dots,w_{t},v_{1},\dots,v_{r} \}$ of $U_{2}$. By [[Inclusion-Exclusion Principle|PIE]], STP $B:=\{ w_{1},\dots,w_{t}, u_{1},\dots,u_{s},v_{1},\dots,v_{r} \}$ is a basis for $U_{1}+U_{2}$. $B$ spans: any $v\in U_{1}+U_{2}$ has the form $p_{1}+p_{2}$ with $p_{i}\in U_{i}$, and each of these may be written as a linear combination of $B$. To show that $B$ is linearly independent, suppose $\exists!\alpha_{i}, \beta_{j},\gamma_{k}\in\mathbb{R}$ such that $\alpha_{1} u_{1} +\dots+\alpha_{s} u_{s} + \beta_{1} v_{1}+\dots \beta_{r} v_{r} + \gamma_{1}w_{1}+\dots+\gamma_{t} w_{t} = 0_{V} \tag{1}$Rearranging determines $p\in V$ defined by $p= \alpha_{1} u_{1} +\dots+\alpha_{s} u_{s} + \gamma_{1}w_{1}+\dots+\gamma_{t} w_{t} = -( \beta_{1} v_{1}+\dots \beta_{r} v_{r}) $which shows that $p\in U_{1}$ and $p\in U_{2}$ so $p\in U_{1}\cap U_{2}$. We deduce that $\exists ! \tau_{i}$ such that $p=\tau_{1}w_{1}+\dots+\tau_{t}w_{t}$Thus, subtracting two expression for $p$ gives $\alpha_{1} u_{1} +\dots+\alpha_{s} u_{s} + (\gamma_{1}-\tau_{1})w_{1}+\dots+(\gamma_{t}-\tau_{t}) w_{t} =0_{V}$hence $\alpha_{i}=0$ since $u_{i},w_{k}$ form a basis for $U_{1}$. Since $v_{j},w_{k}$ form a basis for $U_{2}$, equation $(1)$ with all $\alpha_{i}=0$ shows that $\beta_{j}=0$ and $\gamma_{k}=0$. $\square$