Let $V$ be an inner product space of finite dimension. Let $v_1, v_2, ... , v_m$ be orthonormal vectors in $V$ and $W=\operatorname{sp}\{v_1, v_2, ... , v_m\}$. let $v$ be some vector and $\alpha _i=\langle v,v_i \rangle$ it's Fourier coefficient. Let $\beta _1, \beta _2, ... , \beta _n$ some scalars. I need to prove that: $$||v-\sum \alpha _i v_i||\le ||v-\sum \beta _i v_i||$$
- as a clue, it says I can use this result: $$||v_1+v_2+...+v_m||^2=||v_1||^2+||v_2||^2+...+||v_m||^2$$
Let $\dim V = n\geq m$. Then we can extend the orthonormal basis $\mathcal{B}_{W} = \{v_{1},v_{2},\ldots,v_{m}\}$ of $W$ to an orthonormal basis $\mathcal{B}_{V} = \{v_{1},v_{2},\ldots,v_{m},\ldots,v_{n}\}$ of $V$. Let us also set that $z = v - w$, where $w$ is the projection of $v\in V$ onto $W$. Thus we have that $z \perp x$ whenever $x\in W$. Indeed, one has \begin{align*} \langle v-w,x\rangle & = \Big\langle\sum_{i=1}^{m}\langle v,v_{i}\rangle v_{i} + \sum_{i=m+1}^{n}\langle v,v_{i}\rangle v_{i} - \sum_{i=1}^{m}\langle v,v_{i}\rangle v_{i},\sum_{i=1}^{m}\langle x,v_{i}\rangle v_{i}\Big\rangle\\\\ & = \Big\langle\sum_{i=m+1}^{n}\langle v,v_{i}\rangle v_{i},\sum_{i=1}^{m}\langle x,v_{i}\rangle v_{i} \Big\rangle = 0 \end{align*}
Thus if we consider any vector $u\in W$, we have that \begin{align*} \|v - u\|^{2} = \|z + w - u\|^{2} = \|z + (w - u)\|^{2} = \|z\|^{2} + \|w - u\|^{2}\geq \|z\|^{2} = \|v - w\|^{2} \end{align*}
whence we conclude that $\|v - u\| \geq \|v - w\|$ for any $u\in W$, and we are done.