Convex function and inequality (slope)

378 Views Asked by At

I post here because I don't succeed to find out where I'm wrong in order to demonstrate that if $f$ is a function defined on $I$ and verifying :

$\forall x_0 \in I \quad g_{x_0} : I\setminus\{x_0\} \rightarrow \mathbb{R}$, $x\rightarrow \frac{f(x)-f(x_0)}{x-x_0}$

is non-decreasing function, then $f$ is convex. This is what I did :

Let $x,y \in I$ and $\lambda \in ]0;1[$, with $x \neq y$ (thus we can suppose $y > x$). We want to show that :

$$\label{main}\tag{$*$} (1-\lambda)f(x)+\lambda f(y) \geq f((1-\lambda)x+\lambda y)$$

So, let's $v = (1-\lambda)x+\lambda y$. Then: $$\lambda = \frac{v-x}{y-x}\in(0,1). $$

We have, then:

\begin{align} (\ref{main}) &\iff \frac{y-v}{y-x}f(x) + \frac{v-x}{y-x}f(y) \geq f(v) \\ &\iff (y-v)f(x) + (v-x)f(y) \geq f(v)(y-x) \\ &\iff vf(y)+f(v)x-xf(y) \geq f(v)y-f(x)y+f(x)v \\ &\iff (v-x)f(y)+f(v)x \geq (v-y)f(x)+f(v)y \\ &\iff (v-x)(f(y)-f(v)) \geq (v-y)(f(x)-f(v)) \\ &\iff \frac{f(y)-f(v)}{v-y} \geq \frac{f(x)-f(v)}{v-x} \\ &\iff -g_v(y) \geq -g_v(x) \\ &\iff g_v(y) \leq g_v(x) \end{align}

which is wrong cause $g$ is non decreasing. But even when I read and re-read what I've written, I don't find where I made a mistake, where is the sign problem.

Thank you !