My question is the following:
Let $K$ be a non-empty convex set of a Hilbert space $X$, and let $y\in K$. Prove that the following are equivalent:
(1) $||x-y||\le||x-z||$ for all $x\in X, z\in K$;
(2) $\langle x-y,z-y\rangle \le 0$ for all $x\in X, z\in K$.
I have been given the clue of considering vectors $(1-t)y+tz$ for $t\in (0,1)$, which will be in $K$ as this is a convex set. I assume that the expression ought to be substituted for $z$ somewhere, but I can't work out how, or which value of $t$ to take.
Moreover, the question might be related to the Closest Point Theorem, which guarantees that, if $K$ is closed, there is a unique point satisfying (1).