Let be $V$ a vector space with an inner product, $W \subset V$ a subspace with $\dim W < \infty$ and $P:V \to V$ a projection s.t $Im P = W$ and $\vert \vert P(v) \vert \vert \leq \vert \vert v \vert \vert$, for all $v \in V$. then $P=P_W$, where $P_W$ is the orthogonal projection of $W$.
I know that if $\{w_1,w_2,\dots,w_n\}$ is an orthonormal basis of $W$ then $P_W(v)= \sum_{k=1}^n \langle v,w_k\rangle w_k$. I was thinking about using that and triangle inequality to show some way that $\vert \vert P(v) - P_W(v) \vert \vert = 0$, can you give me a hint?
Suppose that $P\ne P_W$; I will prove that there is some $v\in V$ such that $\|v\|<\bigl\|P(v)\bigr\|$.
Since $P\ne P_W$, $\ker P\ne W^\perp$ and so, since $\ker P$ and $W^\perp$ are distinct subspaces of $V$ with the same dimension, there is some $v_0\in V\setminus W^\perp$ such that $P(v_0)=0$. The vector $v_0$ can be written as $w+v_1$, with $w\in W$ and $v_1\in W^\perp$, and then$$P(v_1)=P(v_0-w)=-w,$$since $P(v_0)=0$ and $P(w)=w$.
If $\lambda\in\Bbb R$, let $v_\lambda=v_1+\lambda v_0$. Then, since $P(v_0)=0$, $P(v_\lambda)=P(v_1)=-w$. On the other hand\begin{align}\|v_\lambda\|&=\|v_1+\lambda v\|\\&=\bigl\|v_1+\lambda(w+v_1)\bigr\|\\&=\bigl\|(\lambda+1)v_1+\lambda w\bigr\|\\&=\sqrt{(\lambda+1)^2\|v_1\|^2+\lambda^2\|w\|^2},\end{align}since $v_1$ and $w$ are orthogonal. Since $P(v_\lambda)=-w$, if I am able to find a $\lambda$ such that $\|v_\lambda\|<\|-w\|=\|w\|$, then $\|v_\lambda\|<\bigl\|P(v_\lambda)\bigr\|$.
Consider the function$$\begin{array}{rccc}q\colon&\Bbb R&\longrightarrow&\Bbb R\\&\lambda&\mapsto&\sqrt{(\lambda+1)^2\|v_1\|^2+\lambda^2\|w\|^2}.\end{array}$$Then $q(-1)=\|w\|$. Besides, $q'(-1)=-\|w\|\ne0$ (if $w=0$, then $v_0=v_1\in W^\perp$). So, $-1$ is not a local minimum of $q$ and therefore there is some $\lambda\in\Bbb R$ such that $q(\lambda)<\|w\|=q(-1)$. In other words, there is some $\lambda\in\Bbb R$ such that $\|v_\lambda\|<\|w\|$.