Proof (sum-intersection formula)
Proof 1: using external direct sums
Define a map from the external direct sum of $U$ and $W$ to $U+W$ $$ \begin{align*} \phi: U\oplus W &\to U+W \\ (u+w) &\mapsto u+w. \end{align*} $$ $\phi$ is clearly surjective and linear. For the kernel of $\phi$, $$ \begin{align*} (u,w)\in\ker(\phi) \iff u+w = \v 0 \iff u=-w \in U\cap W \end{align*} $$ so $$ \begin{align*} \ker(\phi) = \sb{(x,-x)}{x\in U\cap W}. \end{align*} $$ We have $\ker(\phi) \isom U\cap W$ since $$ \begin{align*} \psi: U\cap W &\to \ker(\phi) \\ x &\mapsto (x,-x) \end{align*} $$ is a linear isomorphism.
Hence applying the rank-nullity theorem to $\phi$, $$ \begin{align*} \dim(U\oplus W) &= \dim(\ker(\phi)) + \dim(\im(\phi)) \\ \dim(U) + \dim(W) &= \dim(U\cap W) + \dim(V+W) \end{align*} $$ which follows from the dimension of external direct sums and isomorphic vector spaces.
Proof 2: using bases
$U\cap W$ is finite-dimensional, so let $B=\set{v_1, \ldots, v_n}$ be a basis of $U\cap W$. Extend $B$ to a basis $B_U = \set{v_1, \ldots, v_n, u_{n+1}, \ldots, u_m}$ for $U$, and extend $B$ to a basis $B_W = \set{v_1, \ldots, v_n, w_{n+1}, \ldots, w_p}$ for $W$.
To see $B_U\cup B_W$ spans $U+W$, for each element $u+w\in U+W$ where $u\in U$ and $w\in W$, write $$ \begin{align*} u = \sum_{b\in B_U} \lambda_b b, \quad w = \sum_{b'\in B_W} \mu_{b'} b' \implies u + w = \sum_{b\in B_U}\lambda_b b + \sum_{b'\in B_W} \mu_{b'}b'. \end{align*} $$
To see $B_U\cup B_W$ is linearly independent, let $$ \begin{align*} \v 0 &= \sum_{i=1}^{n} \lambda_i v_i + \sum_{i=n+1}^m \mu_i u_i + \sum_{i=n+1}^{p} \kappa_i w_i \\ \implies W\ni -\sum_{i=n+1}^p \kappa_i w_i &= \sum_{i=1}^{n} \lambda_i v_i + \sum_{i=n+1}^{m} \mu_i u_i \in U. \end{align*} $$ So this quantity is in $U\cap W$. Thus we can write, for some $\set{c_i}$, $$ \begin{align*} &-\sum_{i=n+1}^p \kappa_i w_i = \sum_{i=1}^{n} \lambda_i v_i + \sum_{i=n+1}^{m} \mu_i u_i = \sum_{i=1}^{n} c_iv_i \end{align*} $$ so by linear independence, $$ \begin{align*} \sum_{i=1}^{n} c_i v_i + \sum_{i=n+1}^{p} \kappa_i w_i = \v 0 &\implies \kappa_i = 0, c_i=0, \\ \sum_{i=1}^{n} (\lambda_i - c_i) v_i + \sum_{i=n+1}^{m} \mu_i u_i = \v 0 &\implies \mu_i = 0, \lambda_i = 0. \end{align*} $$
Hence $B_U \cup B_W$ is a basis of $U+W$. Therefore $$ \begin{align*} \dim(U+W) = |B_U \cup B_W| = m + p - n = \dim(U) + \dim(W) - \dim(U\cap W). \end{align*} $$