How to minimize $\|v-w\|_2$? Let $W\subseteq \mathbb R^m$ be a $n$-dimensional subspace and $F:W\longrightarrow \mathbb R$ given by $$F(w)=\|v-w\|,$$ where $v$ is a fixed vector on $\mathbb R^m$. I need some help for showing $\displaystyle u=\sum_{i=1}^n \langle v, w_i\rangle w_i$ is a minimum for $F$. Here $\{w_1, \ldots, w_n\}$ is an orthonormal basis for $W$. 
Sketch: I have already found the gradient of $F$: $$\nabla F(w)=\left(\frac{v_1-w_1}{\|v-w\|}, \ldots, \frac{v_m-w_m}{\|v-w\|}\right).$$ I tried to find the critical points of $F$ but it sounds $v=w$ is the only critical point..I don't know how to proceed.. 
Any help will be valuable.. Thanks
 A: A straightforward way to this is to apply the Projection Theorem:

Theorem: Let $H$ be a Hilbert space and $M$ a closed subspace of $H$. For any $v\in H$ there exists a unique vector $m_0\in M$ such that  $||x-m_0||\leq||x-m||$ for all $m\in M$. Futhermore, a necessary and sufficient condition that $m_0\in M$ be the unique minimising vector is that $x-m_0$ be orthogonal to $M$.

Above $||x ||:=\sqrt{\langle x, x\rangle}$ denote the norm on $H$ induced by its inner product $\langle\cdot,\cdot\rangle$.
The vector space $\mathbb{R}^m$ (together with the inner product $\langle x,y\rangle=\sum_{i=1}^m x_iy_i$) is a Hilbert space. Furthermore, since it is finite dimensional any subspace is closed. Hence, all that is left to do is to show that $v-u$ is orthogonal to $y$ for any $y\in W$. Pick any $y\in W$. Since, $\{w_1,\dots,w_n\}$ spans $W$ we have that
$$y=\sum_{i=1}^n\alpha_i w_i$$
for some scalars $\alpha_1,\dots,\alpha_n$. Two vectors are orthogonal iff they're inner product equals zero. So
$$\left\langle v-u,y\right\rangle=\left\langle v-\sum_{i=1}^n\langle v,w_i\rangle w_i,\sum_{i=1}^n\alpha_i w_i\right\rangle=\sum_{i=1}^n\alpha_i \langle v,w\rangle-\sum_{i=1}^n\sum_{j=1}^n\alpha_i\langle v,w_i\rangle \langle w_i,w_j\rangle$$
$$=\sum_{i=1}^n\alpha_i \langle v,w\rangle-\sum_{i=1}^n\alpha_i\langle v,w_i\rangle=0.$$
The second equality followed from bi-linearity of inner products, while the third followed from the fact that $\{w_1,\dots,w_n\}$ is an orthonormal set of vectors.
P.S. Luenberger's book on this material is a really good (and easy) read.
Edit: I've gone this route instead of the gradient/Hessian type approach you were taking because I got the feeling you had not encountered this before and (I think) its a result that is quite handy to know. If you'd like to carry on as you were what you are missing is that you are not look for the minimum of $F(y)$ over any old $y\in\mathbb{R}^m$ but only over those that lie in $W$. You can parametrise these vectors as
$$y=\sum_{i=1}^n\alpha_i w_i$$
and then look over all combinations vectors $(\alpha_1,\dots,\alpha_n)$ for the one that minimises 
$$F\left(\sum_{i=1}^n\alpha_i w_i\right).$$
For example, you can look for critical points by solving (in $\alpha$)
$$\nabla_\alpha F\left(\sum_{i=1}^n\alpha_i w_i\right)=0.$$
Lemme know if anything remains unclear.
