I have to prove that if $A$ is convex and closed set, then $z=P_A(x)$ for all $z\in A$ if and only if $\langle x-z, z-y\rangle \geq 0$ for all $y\in A$
I have following proof which is not much complicated, but I don't understand few things.
If $g(\theta)=||x-((1-\theta)z+\theta y)||^2, \theta \in R, z=P_A(x), y\in A$ is quadratic function of the variable $\theta$ and it has minimum at $\theta =-\frac{\langle x-z,z-y\rangle}{||z-y||^2}$
Now there is a part that I don't understand:
For $z=P_A(x)$, from convexity of a set A, we get $g(0)\leq g(\theta)$ for all $\theta \in [0,1]$, so $\theta_{min} \leq 0$.
I know why $g(0)\leq g(\theta)$ (I can see it by simply putting $0$ in function), but I don't know how convexity of $A$ caused that and why did we take $\theta$ from $[0,1]$.
The rest of the proof is ok.
Would anybody try to make this clear to me?