It is known that
If $f:U→ R$ is a real-valued convex function defined on a convex open set in the Euclidean space $R^n$, a vector v in that space is called a subgradient at a point $x\_0$ in $U$ if for any $x$ in U one has
$f(x)-f(x\_0)\geq v\cdot(x-x\_0)$


What if for function $f$, at any $x\_0$ I can find $v$, such that $f(x)-f(x\_0)\geq v\cdot(x-x\_0)$ for any $x$, does this show that $f$ is convex?



Can subgradient infer convexity?
Yes. Let $x, y \in U$. Let $z = \lambda x + (1 - \lambda) y$, for $\lambda \in [0,1]$. Let $v\_z$ be a subgradient for $z$.


Then $$f(x) \geq f(z) + v\_z \cdot (x - z) = f(z) + v\_z \cdot \left(x - ( \lambda x + (1 - \lambda) y)\right) $$
$$= f(z) + (1 - \lambda) v\_z \cdot (x - y).$$
Similarly, 
$$f(y) \geq f(z) - \lambda v\_z \cdot (x - y).$$


Multiplying the first inequality by $\lambda$ and the second by $1 - \lambda$ and adding the two, we obtain


$$\lambda f(x) + (1 - \lambda)f(y) \geq f(z),$$
proving that $f$ is convex.


