As I was reading the proof of Jensen's inequality by Evans' book, I came across with this:
Since $\;f\;$ is a convex function, for each $\;p \in \mathbb R\;$ there exists $\;r\in \mathbb R\;$ such that $$f(q) \ge f(p)+r(q-p).\quad\forall q \in \mathbb R$$
However the definition of convex function as I know it is the following:
$\;f:\mathbb R^n \to \mathbb R\;$ is convex if its domain is convex set and for all $\;x,y\;$ in its domain, and all $\;λ \in [0,1]\;$ we have $$f(λx+(1-λ)y) \le λf(x)+(1-λ)f(y).$$
Thus my question is, why is the statement in Evans'book true?
which states that if a function is convex then its graph should lie above then tangent line for all $\;x\;$ in its domain.Although in my case $\;f\;$ is not necessary differentiable and hence I can't assume $\;r=f'(p)\;$.
Last but not least, I found this question here but these answers weren't that helpful for me.
I would really appreciate if somebody could explain to me all the above and save me from all this confusion!
Thanks in advance!


It is well known that one equivalent definition of convexity is the statement that the gradient of secant lines increase. One way to write this down is as follows: for all $x<y<z$,
$$ \frac{f(y)-f(x)}{y-x} ≤ \frac{f(z)-f(y)}{z-y}$$ Let $y$ be fixed. Take $r := \liminf_{z\downarrow y} \frac{f(z) - f(y)}{z-y}, $ so that $$ \frac{f(y) - f(x) }{y-x} ≤ r$$ Then $$f(x) ≥ f(y) + r(x-y), \quad x<y$$
Similarly if $r':= \limsup_{x\uparrow y}\frac{f(y)-f(x)}{y-x}$ one obtains $$f(z) ≥ f(y) + r'(z-y), \quad y<z$$ If $r'>r$ then $(r'-r)(x-y) ≤0 $ for $x<y$, so we can write $$ f(x) ≥ f(y) + r(x-y) + (r'-r)(x-y) = f(y) + r'(x-y) $$ and hence $$ f(x) ≥ f(y) + r'(x-y) \quad ∀ x$$
If instead $r'<r$ we can similarly unify both inequalities, hence the result. Also, if $f$ were differentiable at $y$ then $r=r'=f'(y)$.