Prove $f$ convex $\iff$ $f(y)\ge f(x)+\nabla f(x)(x-y)$
$$\rightarrow$$
$$f(\lambda x + (1-\lambda)y) \le \lambda f(x) + (1-\lambda)f(y)$$
$$\nabla f(\lambda x+(1-\lambda)y)(x-y)\le f(x) - f(y)$$
$$\nabla f(x)(x-y)\le f(x) - f(y)$$
$$\leftarrow$$
Suppose that there exists $x,y$ such that the hypothesis is true $$f(y)\ge f(x)+\nabla f(x)(x-y)$$
but $$f(\lambda x + (1-\lambda)y) >\lambda f(x) + (1-\lambda)f(y)\tag{1}$$
Then $(1)\implies \nabla f(\lambda x + (1-\lambda)y)(x-y)>f(x)-f(y)\implies \nabla f(x)(x-y)+f(x)>f(y)$ which contradicts the hypothesis that $f(y)\ge f(x)+\nabla f(x)(x-y)$
Is my proof right? Specially the $\leftarrow$ part?
UPDATE:
it was supposed to be
$$f(y) \ge f(x) + \nabla^Tf(x)(y-x)\implies f(y)-f(x)\ge \nabla^Tf(x)(y-x)$$
so my proof sketch cleary won't work
so suppose the thing above is true (that's our hyphotesis) and now suppose that $f$ is not convex, that is, $f(\lambda x + (1-\lambda)y) >\lambda f(x) + (1-\lambda)f(y)\tag{1}$
so $(1)$ implies that $\nabla f(\lambda x+(1-\lambda)y)(y-x)>f(x)-f(y)\implies \nabla f(x)(y-x)-f(x)+f(y)>0$
Is the question correct?
$f$ is convex if and only if
$f(x) - f(y) - \nabla f(y)^\top(x-y) \geq 0$
This is easy to see, because $f(y) + \nabla f(y)^\top(x-y)$ is the supporting hyperplane of $f$ at $y$
Your question states that:
The equation of the supporting hyperplane is wrong.
See related: $f$ convex $\iff$ $f(y) \ge f(x) + \nabla^Tf(x)(y-x)$ and $f$ is convex $\iff$ $\nabla^2f(x)\ge 0$