## Another Proof that Midpoint-Convex and Continuous Implies Convex

A few months back, I wrote a post about some elementary results concerning convex functions on the interval. One of these results was that a real-valued continuous function $f:I\rightarrow\mathbb{R}$ defined on an interval $I\subset\mathbb{R}$ is convex if and only if it is midpoint convex. I want to present another proof of this result, one which comes from Constantin Niculescu’s and Lars-Erik Persson’s text Convex Functions and Their Applications.

Proposition 1. Suppose $f: I \rightarrow \mathbb{R}$ is continuous. Then $f$ is convex if and only if $f$ is midpoint convex.

Proof. Necessity is obvious. For sufficiency, suppose that $f$ is not convex; that is, there exist $a,b\in I$ and $t\in (0,1)$ such that

$\displaystyle f(ta+(1-t)b)>tf(a)+(1-t)f(b)$

Define a function $\varphi: I \rightarrow\mathbb{R}$ by

$\displaystyle\varphi(x):=f(x)-\dfrac{f(b)-f(a)}{b-a}(x-a)-f(a),\indent\forall x\in[a,b]$

Note that $\varphi$ is the sum of $f$ and an affine function. I claim that $\gamma:=\sup_{x\in[a,b]}\varphi(x)>0$. Indeed,

$\begin{array}{lcl}\displaystyle\varphi(ta+(1-t)b)&=&\displaystyle f(ta+(1-t)b)-\dfrac{f(b)-f(a)}{b-a}\left(ta+(1-t)b-a\right)-f(a)\\&>&\displaystyle tf(a)+(1-t)f(b)-\dfrac{f(b)-f(a)}{b-a}\left(ta+(1-t)b-a\right)-f(a)\\&=&\displaystyle tf(a)+(1-t)f(b)-(1-t)[f(b)-f(a)]-f(a)\\&=&\displaystyle 0\end{array}$

Observe that $\varphi(a)=\varphi(b)=0$ and $\varphi$ is midpoint convex, since

$\begin{array}{lcl}\displaystyle\varphi\left(\frac{x+y}{2}\right)&=&\displaystyle f\left(\frac{x+y}{2}\right)-\dfrac{f(b)-f(a)}{b-a}\left(\dfrac{x+y}{2}-a\right)-f(a)\\&\leq&\displaystyle\dfrac{f(x)+f(y)}{2}-\dfrac{f(b)-f(a)}{b-a}\left(\dfrac{x+y}{2}-2\dfrac{a}{2}\right)-2\dfrac{f(a)}{2}\\&=&\displaystyle\dfrac{\varphi(x)+\varphi(y)}{2}\end{array}$

Set $c:=\inf\left\{x\in[a,b]:\varphi(x)=\gamma\right\}$. Since $\varphi$ is continuous, $\varphi(c)=\gamma>0$, where the positivity implies that $c\in(a,b)$. For any $h>0$ such that $c\pm h\in (a,b)$, we have that $\varphi(c-h)<\varphi(c)$ and $\varphi(c+h)\leq\varphi(c)$, so by midpoint convexity of $\varphi$,

$\displaystyle\varphi(c)\leq\dfrac{\varphi(c-h)+\varphi(c+h)}{2}<\dfrac{\varphi(c)+\varphi(c)}{2}=\varphi(c)$,

which is a contradiction. $\Box$

I claim that any function $f: I \rightarrow \mathbb{R}$ satisfying

$\displaystyle f(x+h)-f(x-h)-2f(x)\geq 0$,

for all $x\in I$ and $h>0$ such that $x\pm h\in I$, is midpoint convex. Indeed, Fix $a,b \in I$ and set $h:=\frac{b-a}{2}$. Then

$\displaystyle a=\dfrac{a+b}{2}-h,\indent b=\dfrac{a+b}{2}+h$,

so that

$\begin{array}{lcl}\displaystyle f(a)+f(b)-2f\left(\dfrac{a+b}{2}\right)&=&\displaystyle f\left(\dfrac{a+b}{2}-h\right)+f\left(\dfrac{a+b}{2}+h\right)-2f\left(\frac{a+b}{2}\right)\\&\geq&\displaystyle 0\end{array}$

Thus, we obtain a corollary.

Corollary 2. A continuous function $f: I \rightarrow\mathbb{R}$ is convex if and only if

$\displaystyle f(x+h)+f(x-h)-2f(x)\geq 0$,

for all $x\in I$ and $h>0$ such that $x\pm h\in I$.

In fact, for Proposition 1, we can relax the sufficiency condition to

$\displaystyle f(\alpha x+(1-\alpha y))\leq\alpha x+(1-\alpha)y,\indent\forall x,y\in I$

for some fixed parameter $\alpha\in (0,1)$. Indeed, it is easy to verify that $\varphi$ satisfies the same condition as $f$. I claim that there exist $x,y \in [a,b]\setminus\left\{c\right\}$, where without loss of generality, $x < c$, such that

$\displaystyle c=\alpha x+(1-\alpha)y$

Indeed,

$\begin{array}{lcl}\displaystyle\dfrac{c-(1-\alpha)x}{\alpha}-a=\dfrac{c-(1-\alpha)x-\alpha a}{\alpha}=\dfrac{c-x+\alpha(x-a)}{\alpha}&=&\displaystyle\alpha^{-1}(c-x)+(x-a)>0\\&\Longleftrightarrow&\displaystyle\dfrac{\alpha^{-1}c-a}{\alpha^{-1}-1}>x\end{array}$

and

$\begin{array}{lcl}\displaystyle b-\dfrac{c-(1-\alpha)x}{\alpha}=\dfrac{\alpha b-c+(1-\alpha)x}{\alpha}&=&\displaystyle(b-x)+\alpha^{-1}(x-c)>0\\&\Longleftrightarrow&\displaystyle -\dfrac{b-\alpha^{-1}c}{\alpha^{-1}-1}

So we can make an appropriate choice of $x \in (-\frac{b-\alpha^{-1}c}{\alpha^{-1}-1},\frac{\alpha^{-1}c-a}{\alpha^{-1}-1})$ satisfying $x, which uniquely determines $y$. Then $\varphi(x)<\varphi(c)$ and $\varphi(y)\leq\varphi(c)$ so that

$\displaystyle\varphi(c)\leq\alpha\varphi(x)+(1-\alpha)\varphi(y)<\alpha\varphi(c)+(1-\alpha)\varphi(c)=\varphi(c)$,

We also can relax the hypothesis that $f$ is continuous to $f$ is bounded from above on compact subintervals of $I$.