Let $V$ be closed and convex, and denote $P_V(x)$ as projection onto $V$ show that $(w-y,y-x)\geq 0$ for all $w \in V$ $\iff$ $y=P_V(x)$ Let $V$ be closed and convex, and denote $P_V(x)$ as projection onto $V$ show that $(w-y,y-x)\geq 0$ for all $w \in V$ $\iff$ $y=P_V(x)$
I have been struggling to show this. I tried contradiction and tried to show that if a $w$ exists where  the inner product is negative then it has smaller distance to $x$ than $y$. But that was unsuccessful.
I also tried using the fact that $\|x-(\lambda w+(1-\lambda) y)\|\geq \|x-y\|$ and that the derivative of such function would be $0$ at $\lambda=0$ but I could not get anything useful. I might have made a mistake when expanding the inner product as it gets messy.
 A: Suppose that $\langle w-y,x-y\rangle>0$. Let $H$ be the hyperplane $H=\{w:\ \langle w-y,x-y\rangle=0\}$. As the orthogonal complement of $H$ is $L=\mathbb R(x-y)$, we may write $w-y = h+P_L(w-y)$ for some $h\in H$. We have
$$
P_L(w-y)=\frac{\langle w-y,x-y\rangle}{\|x-y\|^2}\,(x-y)=\alpha\,(x-y), 
$$
where the assumption guarantees that $\alpha>0$. Define
$$
w_t=(1-t)y+tw,\ \ \ t\in[0,1]. 
$$
The convexity of $V$ guarantees that $w_t\in  V$ for all $t\in[0,1]$. Now
\begin{align*}
x-w_t&=x-y-t(w-y)\\
&=x-y-th-t\alpha (x-y)\\
&=(1-t\alpha)(x-y)-th.
\end{align*}
If $h=0$ we get, for $0<t<\tfrac1\alpha$, that $\|x-w_t\|<\|x-y\|$, contradicting the minimality of $y$. If $h\ne0$, let $\beta=\tfrac{\|x-y\|}{\|h\|}>0$. The function $f(\delta)=\alpha\beta\delta+\sqrt{1-\delta^2}$ satisfies $f(0)=1$ and $f'(\delta)=\alpha\beta-\tfrac\delta{\sqrt{1-\delta^2}}$. For $\delta$ close enough to zero this will be positive, so $f$ is increasing in some interval $[0,\eta]$ with  $\eta>0$. So we can choose $\delta>0$ with $\delta<1$ and $\alpha\beta\delta+\sqrt{1-\delta^2}>1$. Thus $\tfrac{1-\sqrt{1-\delta^2}}{\alpha}<\beta\delta$ and so there exists $t\in(0,1)$ with
$$
\frac{1-\sqrt{1-\delta^2}}{\alpha}<t<\beta\delta.
$$
Then
\begin{align*}
\|x-w_t\|^2&=(1-t\alpha)^2\|x-y\|^2+t^2\|h\|^2\\
&<(1-\delta^2)\|x-y\|^2+\delta^2\|x-y\|^2
=\|x-y\|^2,
\end{align*}
again contradicting the minimality of $y$. Thus, contrary to our assumption, $\langle w-y,x-y\rangle\leq0$.
Conversely, suppose that $y\in V$ but $y\ne P_Vx$. Then there exists $w\in V$, with $\|x-w\|<\|x-y\|$. Expanding, this is
$$
\|x\|^2+\|w\|^2-2\langle x,w\rangle < \|x\|^2+\|y\|^2-2\langle x,y\rangle. 
$$
Then
$$
\|w\|^2<\|y\|^2-2\langle x,y-w\rangle=\|y\|^2-2\langle x-y,y-w\rangle -2\langle y,y-w\rangle.
$$Thus
\begin{align}
\langle x-y,y-w\rangle&<\|y\|^2-2\langle y,y-w\rangle-\|w\|^2\\[0.3cm]
&<\|y\|^2-2\langle y,y-w\rangle+\|y-w\|^2-\|y-w\|^2-\|w\|^2\\[0.3cm]
&=\|y-(y-w)\|^2-\|y-w\|^2-\|w\|^2\\[0.3cm]
&=-\|y-w\|^2<0.
\end{align}
