= Solution
For the given <orthonormal basis>, the <orthogonal projection> is
$$
\boxed{\pi v=\sum_{j=1}^k\langle v,e_j\rangle e_j.}
$$
It belongs to $W$, and $\langle v-\pi v,e_j\rangle=0$ for every basis vector. Thus $v-\pi v\in W^\perp$. For any $w\in W$, decompose $v-w=(v-\pi v)+(\pi v-w)$. The summands are orthogonal, so the <Pythagorean theorem in an inner-product space> for the <inner product> gives
$$
\|v-w\|^2=\|v-\pi v\|^2+\|\pi v-w\|^2\geq\|v-\pi v\|^2.
$$
Equality holds exactly when $w=\pi v$. Hence \b[$\pi v$ is the unique closest point of $W$ to $v$]. This proves the minimizing property as well as the formula, including $W=\{0\}$ and $W=V$.
Back to article page