Any vector can be decomposed into one vector and another in its orthogonal complement

Theorem : Given any vector $v$ and another vector $u$, $\| u \| \neq 0$, $u$ generating the one-dimensional subspace $W = \textrm{Span}(u)$, then $v$ can be written as

\begin{equation} v = \alpha u + w \end{equation}

with a unique $\alpha \in \mathbb{R}$ and a unique $w \in W^\perp$.

Proof : First project $v$ onto $u$, via

\begin{equation} \mathrm{Proj_u(v)} = \frac{\langle v, u \rangle}{\langle u, u \rangle} u \end{equation}

If we decompose our vector $v$ via

\begin{equation} v = \mathrm{Proj_u(v)} + (v - \mathrm{Proj_u(v)}) \end{equation}

Then we need to show that the second part is orthogonal to $u$.

\begin{eqnarray} \langle v - \mathrm{Proj_u(v)}, u \rangle &=& \langle v, u \rangle - \langle \mathrm{Proj_u(v)}, u \rangle\\ &=& \langle v, u \rangle - \frac{\langle v, u \rangle}{\langle u, u \rangle} \langle u, u \rangle\\ &=& \langle v, u \rangle - \langle v, u \rangle\\ &=& 0 \end{eqnarray}

Now let's show that this decomposition is unique. Consider a second decomposition :

\begin{equation} v = \alpha' u + w' \end{equation}

As $w'$ is orthogonal to $u$, we can just substract the two :

\begin{equation} v - v= (\alpha - \alpha') u + (w - w') \end{equation}

Being in different subspaces, $\alpha - \alpha'$ remains in $W$ and $w - w'$ in $W^\perp$, and therefore each must be equal to zero independently. Our decomposition is therefore unique.