TITLE: The projection onto a subspace of a Hilbert space is the nearest point
QUESTION [0 upvotes]: Let $H$ be a Hilbert space, $M$ its linear subspace, and $p_M$ the projection onto $M$. Prove the following: for every $v \in H$ and every $u \in M$, $$\|v-p_Mv \| \leq \|v-u\|$$ with equality only if $u=p_Mv$.

Attempted Proof: $$\|v-p_Mv\|=\|v-u+u-p_Mv\| \leq \|v-u\|+\|u-p_Mv\|$$
Note that $p_Mv=\frac{u\cdot v}{\|v\|^2}v$ for all $u \in M$. So $\|u-p_Mv\|=\|u-\frac{u\cdot v}{\|v\|^2}v\|$. But if we notice this norm is the norm of the vector component of u perpendicular to v. How do I show that $\|u-\frac{u\cdot v}{\|v\|^2}v\|=0$?

REPLY [2 votes]: I assume: we are in a vector space with inner product; $M$ a subspace of $H$ and $p_M$ the orthogonal projection onto $M$. (This is basically clear from the attempted proof.)
We have $$\|u-v\|^2 = \|v-p_Mv + p_Mv -u\|^2 = \|v-p_Mv\|^2 + \|p_M v-u\|^2 - 2 \langle v-p_Mv,u-p_Mv \rangle .$$
Now note/check $\langle v-p_Mv,u-p_Mv \rangle = 0$. So
$$ \|u - v \|^2 = \|v-p_Mv\|^2 + \|p_Mv - u\|^2.$$
Implying the claim.
{"set_name": "stack_exchange", "score": 0, "question_id": 980045}