[proofplan]
We start with a basis for $U \cap W$, extend it separately to bases for $U$ and for $W$ using [Properties of Finite Dimensional Bases](/theorems/374) part (v), then show the combined set is a basis for $U + W$. Counting the elements gives the dimension formula.
[/proofplan]
[step:Extend a basis for $U \cap W$ to bases for $U$ and $W$]
Let $r = \dim(U \cap W)$ and choose a basis $\{v_1, \ldots, v_r\}$ for $U \cap W$. Since $U \cap W \subset U$, this is a linearly independent subset of $U$. By [Properties of Finite Dimensional Bases](/theorems/374) part (v), extend it to a basis
\begin{align*}
\{v_1, \ldots, v_r, u_1, \ldots, u_s\}
\end{align*}
for $U$, so $\dim U = r + s$. Similarly, extend $\{v_1, \ldots, v_r\}$ to a basis
\begin{align*}
\{v_1, \ldots, v_r, w_1, \ldots, w_t\}
\end{align*}
for $W$, so $\dim W = r + t$.
[/step]
[step:Show $B = \{v_1, \ldots, v_r, u_1, \ldots, u_s, w_1, \ldots, w_t\}$ spans $U + W$]
Any element of $U + W$ has the form $x + y$ with $x \in U$ and $y \in W$. Since $\{v_1, \ldots, v_r, u_1, \ldots, u_s\}$ is a basis for $U$, the vector $x$ is a linear combination of these. Since $\{v_1, \ldots, v_r, w_1, \ldots, w_t\}$ is a basis for $W$, the vector $y$ is a linear combination of these. Hence $x + y \in \langle B \rangle$, so $B$ spans $U + W$.
[/step]
[step:Show $B$ is linearly independent]
Suppose
\begin{align*}
\sum_{i=1}^{r}\alpha_i v_i + \sum_{j=1}^{s}\beta_j u_j + \sum_{k=1}^{t}\gamma_k w_k = \mathbf{0}.
\end{align*}
Rearranging:
\begin{align*}
\sum_{k=1}^{t}\gamma_k w_k = -\sum_{i=1}^{r}\alpha_i v_i - \sum_{j=1}^{s}\beta_j u_j.
\end{align*}
The left side belongs to $W$ and the right side belongs to $U$, so both sides lie in $U \cap W$. Since $\{v_1, \ldots, v_r\}$ is a basis for $U \cap W$, there exist $\delta_1, \ldots, \delta_r \in \mathbb{F}$ with
\begin{align*}
\sum_{k=1}^{t}\gamma_k w_k = \sum_{i=1}^{r}\delta_i v_i.
\end{align*}
Rewriting: $\sum_{k=1}^{t}\gamma_k w_k - \sum_{i=1}^{r}\delta_i v_i = \mathbf{0}$. Since $\{v_1, \ldots, v_r, w_1, \ldots, w_t\}$ is a basis for $W$ (hence linearly independent), all coefficients vanish: $\gamma_k = 0$ for all $k$ and $\delta_i = 0$ for all $i$.
Substituting $\gamma_k = 0$ back into the original equation: $\sum_{i=1}^{r}\alpha_i v_i + \sum_{j=1}^{s}\beta_j u_j = \mathbf{0}$. Since $\{v_1, \ldots, v_r, u_1, \ldots, u_s\}$ is a basis for $U$ (hence linearly independent), $\alpha_i = 0$ for all $i$ and $\beta_j = 0$ for all $j$.
[guided]
The independence proof hinges on one key idea: the "cross term" between the $U$-vectors and $W$-vectors must pass through $U \cap W$, where we already have a basis.
Starting from $\sum \alpha_i v_i + \sum \beta_j u_j + \sum \gamma_k w_k = \mathbf{0}$, we isolate the $W$-specific vectors on one side:
\begin{align*}
\sum_{k=1}^{t}\gamma_k w_k = -\sum_{i=1}^{r}\alpha_i v_i - \sum_{j=1}^{s}\beta_j u_j.
\end{align*}
The left side is in $W$ (as a combination of $w_k$ and $v_i$ are in $W$ too, but we have only $w_k$ here). The right side is in $U$ (as a combination of $v_i$ and $u_j$, all of which lie in $U$). So both sides lie in $U \cap W = \langle v_1, \ldots, v_r \rangle$.
Expressing the left side in terms of the basis $\{v_1, \ldots, v_r\}$ for $U \cap W$ and using the independence of the basis $\{v_1, \ldots, v_r, w_1, \ldots, w_t\}$ for $W$ forces $\gamma_k = 0$ for all $k$. Once the $\gamma_k$ vanish, the original equation reduces to a relation in $U$, and the independence of the $U$-basis forces $\alpha_i = 0$ and $\beta_j = 0$.
[/guided]
[/step]
[step:Count elements to obtain the dimension formula]
Since $B$ is a basis for $U + W$ with $r + s + t$ elements:
\begin{align*}
\dim(U + W) &= r + s + t \\
&= (r + s) + (r + t) - r \\
&= \dim U + \dim W - \dim(U \cap W).
\end{align*}
[/step]