Best approximation in a Hilbert space Let $H$ be a $\mathbb C$-Hilbert space, $U\subseteq H$ be a closed subspace of $H$, $\operatorname P_U$ denote the orthogonal projection from $H$ onto $U$ and $x\in H$. I want to show that $$\tilde x=\underset{u\in U}{\operatorname{arg min}}\left\|u-x\right\|_H\Leftrightarrow\tilde x=\operatorname P_Ux\tag1\;.$$
"$\Leftarrow$": $\tilde x=\operatorname P_Ux$ $\Rightarrow$ $$\langle\tilde x-u,u\rangle_H=0\;\;\;\text{for all }u\in U\tag2$$ and hence (since $t\tilde x\in U$)
\begin{equation}
\begin{split}
\left\|\tilde x-x\right\|_H^2&=\overbrace{\langle\tilde x-x,\tilde x\rangle_H}^{=\:0}-\langle\tilde x-x,x\rangle_H\color{blue}{+\overbrace{\langle\tilde x-x,u\rangle_H}^{=\:0}}\\
&=\langle\tilde x-x,u-x\rangle_H\\
&\le\left\|\tilde x-x\right\|_H\left\|u-x\right\|_H
\end{split}\tag3
\end{equation}
by the Cauchy-Schwarz inequality for all $u\in U$, i.e. $$\left\|\tilde x-x\right\|_H\le\left\|u-x\right\|_H\;\;\;\text{for all }u\in U\tag4\;.$$

How can we show "$\Rightarrow$"?

 A: Let $\tilde x = \newcommand{\argmin}{\operatorname{arg min}}\argmin_{u \in U} \|u - x\|$. 
Note that if $\tilde y \in U$ and $\|\tilde x - x\| = \|\tilde y - x\|$ the parallelogram law yields $$\left\| \frac{\tilde x + \tilde y}{2} - x \right\|^2 + \left\| \frac{\tilde x - \tilde y}2 \right\|^2 = \frac 12 \|\tilde x - x\|^2 + \frac 12 \|\tilde y - x\|^2 = \|\tilde x - x\|^2$$ If $\tilde x \not= \tilde y$ then
$$\left\| \frac{\tilde x + \tilde y}{2} - x \right\|^2 < \|\tilde x - x\|^2$$ which contradicts minimality since $(\tilde x + \tilde y)/2 \in U$. Thus the minimizer is unique.
Now let $u \in U$ and $\lambda \in \newcommand{\C}{\mathbb C}\C$. By the remarks above you have $$\|\tilde x - x\|^2 \le \|\tilde x - \lambda u - x\|^2$$ because $\tilde x - \lambda u \in U$.  Since $$\|\tilde x - \lambda u - x\|^2 = \|\tilde x -  x\|^2 - 2 \Re(\tilde x - x,\lambda u) + |\lambda|^2 \|u\|^2$$ you have $$2 \Re \bar \lambda (\tilde x-x,u) \le |\lambda|^2 \|u\|^2.$$ In particular, with $t > 0$ and $\lambda = t (\tilde x-x,u)$ it must follow that $$2|(\tilde x-x,u)|^2 \le t |(\tilde x-x,u)|^2 \|u\|^2$$ for all $t > 0$, which is possible only if $(\tilde x-x,u) = 0$.  
This shows $\tilde x - x \in U^\perp$, and writing $$x = \tilde x + (x - \tilde x) \in U \oplus U^\perp$$ it follows that $\tilde x = P_U x$.
A: I guess you can find the proof for this in standard functional analysis textbook. For the $\Rightarrow$ direction, observe that it suffices to show that $x-\bar x\in U^\perp$. Suppose not, then there exists a nonzero $\hat u\in U$ such that
$$\langle x-\bar x,\hat u\rangle = \langle y,\hat u\rangle = \alpha\neq 0, $$
for some $\alpha\in\mathbb{C}$. Observe that for any scalar $\beta$, 
\begin{align*}
\|y-\beta\hat u\|^2 & = \|y\|^2 - \beta\langle\hat u,y\rangle - \bar\beta\langle y,\hat u\rangle + |\beta|^2\|\hat u\|^2 \\
& = \|y\|^2 - \bar\beta\langle y,\hat u\rangle - \beta\Big[\langle\hat u,y\rangle - \bar\beta\|\hat u\|^2\Big]\\
& = \|y\|^2 - \bar\beta\alpha - \beta\Big[\bar\alpha - \bar\beta\|\hat u\|^2\Big].
\end{align*}
Now, choose $\beta$ such that $\bar\alpha-\bar\beta\|\hat u\|^2=0$. The above expression reduces to:
$$\|y - \beta\hat u\|^2 = \|y\|^2 - \frac{|\beta|^2}{\|\hat u\|^2} <\|y\|^2 = \|x-\bar x\|^2\le \left(\inf_{u\in U}\|u-x\|\right)^2 = d^2.$$
On the other hand,
$$y-\beta\hat u = x-\bar x - \beta\hat u = x - u_1,$$
where $u_1=\bar x + \beta\hat u\in U$ since both $\bar x,\hat u$ are in $U$ and $U$ is a subspace. This yields
$$\|y - \beta\hat u\| = \|x-u_1\|\ge d, $$
and we arrive at a contradiction. 
