[proofplan]
We construct a basis for $V$ by concatenating a basis for $U$ with a basis for $W$. The direct sum condition $U \cap W = \{0\}$ ensures the concatenation is linearly independent, and the condition $V = U + W$ ensures it spans $V$. Counting the elements of this basis gives $\dim V = \dim U + \dim W$.
[/proofplan]
[step:Fix bases for $U$ and $W$]
Let $p := \dim U$ and $q := \dim W$. Let $\{u_1, \ldots, u_p\}$ be a basis for $U$ and $\{w_1, \ldots, w_q\}$ be a basis for $W$. Define
\begin{align*}
S := \{u_1, \ldots, u_p, w_1, \ldots, w_q\}.
\end{align*}
We will show that $S$ is a basis for $V$, which immediately gives $\dim V = |S| = p + q = \dim U + \dim W$.
[/step]
[step:Show that $S$ spans $V$]
Let $v \in V$. Since $V = U + W$ (the sum condition in $V = U \oplus W$), there exist $u \in U$ and $w \in W$ with $v = u + w$. Since $\{u_1, \ldots, u_p\}$ spans $U$, there exist scalars $a_1, \ldots, a_p$ with $u = a_1 u_1 + \cdots + a_p u_p$. Since $\{w_1, \ldots, w_q\}$ spans $W$, there exist scalars $b_1, \ldots, b_q$ with $w = b_1 w_1 + \cdots + b_q w_q$. Therefore
\begin{align*}
v = a_1 u_1 + \cdots + a_p u_p + b_1 w_1 + \cdots + b_q w_q \in \operatorname{span}(S).
\end{align*}
Since $v$ was arbitrary, $S$ spans $V$.
[/step]
[step:Show that $S$ is linearly independent using $U \cap W = \{0\}$]
Suppose
\begin{align*}
a_1 u_1 + \cdots + a_p u_p + b_1 w_1 + \cdots + b_q w_q = 0
\end{align*}
for scalars $a_1, \ldots, a_p, b_1, \ldots, b_q$. Rearranging:
\begin{align*}
a_1 u_1 + \cdots + a_p u_p = -(b_1 w_1 + \cdots + b_q w_q).
\end{align*}
The left-hand side lies in $U$ (as a linear combination of basis vectors of $U$) and the right-hand side lies in $W$ (as a linear combination of basis vectors of $W$). Therefore this common vector lies in $U \cap W$. Since $V = U \oplus W$ requires $U \cap W = \{0\}$, we conclude
\begin{align*}
a_1 u_1 + \cdots + a_p u_p = 0 \quad \text{and} \quad b_1 w_1 + \cdots + b_q w_q = 0.
\end{align*}
Since $\{u_1, \ldots, u_p\}$ is linearly independent, $a_1 = \cdots = a_p = 0$. Since $\{w_1, \ldots, w_q\}$ is linearly independent, $b_1 = \cdots = b_q = 0$. Therefore $S$ is linearly independent.
[guided]
This is the step where the direct sum hypothesis $U \cap W = \{0\}$ is consumed. The argument has a clean structure: rearrange the linear relation to isolate the $U$-part on one side and the $W$-part on the other.
Starting from
\begin{align*}
a_1 u_1 + \cdots + a_p u_p + b_1 w_1 + \cdots + b_q w_q = 0,
\end{align*}
we move the $W$-terms to the right:
\begin{align*}
\underbrace{a_1 u_1 + \cdots + a_p u_p}_{\in\, U} = \underbrace{-(b_1 w_1 + \cdots + b_q w_q)}_{\in\, W}.
\end{align*}
Call this common vector $z$. Then $z \in U$ (it is a linear combination of $u_1, \ldots, u_p$) and $z \in W$ (it equals a linear combination of $w_1, \ldots, w_q$). So $z \in U \cap W = \{0\}$, hence $z = 0$.
Now $z = 0$ yields two separate equations: $a_1 u_1 + \cdots + a_p u_p = 0$ and $b_1 w_1 + \cdots + b_q w_q = 0$. The linear independence of each basis forces all coefficients to vanish. Without the condition $U \cap W = \{0\}$, we could not conclude $z = 0$, and the concatenated set might be linearly dependent.
[/guided]
[/step]
[step:Conclude the dimension formula]
Since $S = \{u_1, \ldots, u_p, w_1, \ldots, w_q\}$ is a linearly independent spanning set for $V$, it is a basis for $V$. Therefore
\begin{align*}
\dim V = |S| = p + q = \dim U + \dim W.
\end{align*}
[/step]