Show that $\| u - v \|^2 = \| u - P_U(v) \|^2 + \| v - P_U(v) \|^2 $ and minimize $d(u, v)$ i) Let $\left(V, \langle\ ,\ \rangle\right)$ be an inner-product space, $v \in V$, and let $U$ be a subspace of $V$ with the orthogonal projection map $P_U$.
Show that $ \| u - v \|^2 = \| u - P_U(v) \|^2 + \| v - P_U(v) \|^2 \quad \forall \space u \in U $.
ii) Let $u_1 = (\frac{1}{2}, \frac{1}{2}, \frac{-1}{2}, \frac{-1}{2})$ and $u_2 = (\frac{1}{2}, \frac{-1}{2}, \frac{1}{2}, \frac{-1}{2})$ in $\mathbb{R}^4$, $U = \operatorname{span}(u_1, u_2)$, and $v = (1,2,1,-4)$.
Find $u_0 \in U$ minimizing $\left\{ d(u,v) \mid u \in U \right\}$.
I don't think I've ever been this confused before... could someone please give me a hand or point me in the right direction? 
 A: In general, if $x$ and $y$ are orthogonal vectors in an inner product space, then
$$
\|x \pm y\|^{2} = \|x\|^{2} + \|y\|^{2}.
$$
(This is often called the Pythagorean Theorem, for obvious reasons.)
The vector $u - P_{U}(v)$ lies in $U$, while $v - P_{U}(v)$ is orthogonal to $U$ (that's essentially the definition of the orthogonal projection of $v$ to $U$), and
$$
u - v = \bigl(u - P_{U}(v)\bigr) - \bigl(v - P_{U}(v)\bigr).
$$
Your first conclusion follows immediately from the Pythagorean Theorem by taking $x = u - P_{U}(v)$ and $y = v - P_{U}(v)$.
As a consequence,
$$
\|v - P_{U}(v)\|^{2} \leq \|v - P_{U}(v)\|^{2} + \|u - P_{U}(v)\|^{2} = \|u - v\|^{2}\quad\text{for all $u$ in $U$,}
$$
with equality if and only if $u = P_{U}(v)$. In words, $P_{U}(v)$ is closer to $v$ than every element of $U$. (If that isn't apparent at first glance (which is often the case the first time you see this), inspect each term and think about what it means.)
For (ii), you want to compute $P_{U}(v)$ for the given subspace $U$ and vector $v$. Luckily, the basis of $U$ that's been provided is orthonormal: Each of $u_{1}$ and $u_{2}$ is a unit vector, and $\langle u_{1}, u_{2}\rangle = 0$. You probably have a formula for orthogonal projection to a subspace $U$ when an orthonormal basis of $U$ is given...?
If that formula doesn't sound familiar, you can derive it on the spot: There exist scalars $c_{1}$ and $c_{2}$ such that
$$
P_{U}(v) = c_{1} u_{1} + c_{2} u_{2}.
$$
Since $v - P_{U}(v)$ is orthogonal to $U$, you have
$$
\langle v - (c_{1} u_{1} + c_{2} u_{2}), u_{1}\rangle = 0,\qquad
\langle v - (c_{1} u_{1} + c_{2} u_{2}), u_{2}\rangle = 0.
$$
Since $\{u_{1}, u_{2}\}$ is orthonormal, the preceding equations can be solved easily (almost by inspection) for $c_{1}$ and $c_{2}$ by distributing the dot product.
