# Proof of “every convex function is continuous”

A real valued function $f$ defined in $(a,b)$ is said to be convex if $$f(\lambda x+(1-\lambda)y)\le \lambda f(x)+(1-\lambda)f(y)$$ whenever $a < x < b,\; a < y < b,\; 0< \lambda <1$.
Prove that every convex function is continuous.

Usually it uses the fact:
If $a < s < t < u < b$ then $$\frac{f(t)-f(s)}{t-s}\le \frac{f(u)-f(s)}{u-s}\le\frac{f(u)-f(t)}{u-t}.$$

I wonder whether any other version of this proof exists or not?

-
All proofs I have seen boil down to something similar. The above fact is useful in that it shows that right- and left-hand derivatives exist at each point, and hence it is locally Lipschitz. This is true in $\mathbb{R}^n$ as well. –  copper.hat Dec 14 '12 at 7:39

The pictorial version. (But it is the same as your inequality version, actually.)

Suppose you want to prove continuity at $a$. Choose points $b,c$ on either side. (This fails at an endpoint, in fact the result itself fails at an endpoint.)

By convexity, the $c$ point is above the $a,b$ line, as shown:

Again, the $b$ point is above the $a,c$ line, as shown:

The graph lies inside the red region,

so obviously we have continuity at $a$.

-

I would be careful to rephrase the query as:

Is there an alternative proof of the fact that a real-valued convex function defined on an open interval of the reals is continuous?

Since in general convex functions are not continuous nor are they necessarily continuous when defined on open sets in topological vector spaces.

An alternative might be to identify the point of discontinuity as x. Then there exists a point arbitrarily close to x, denoted x', whose value f(x') is bounded away by a constant from f(x). Depending on how you want your proof structured, you may think it sufficient to note that this implies the epigraph of the function is not closed and therefore the function is not lower semicontinuous. But every convex function on the reals is lower semicontinuous on the relative interior of its effective domain, which equals the domain of definition in this case.

A more general proof of this property is given in "Convexity and Optimization in Banach Spaces." The authors prove the proposition that every proper convex function defined on a finite-dimensional separated topological linear space is continuous on the interior of its effective domain. You can likely see the relevant proof using Amazon's or Google Book's look inside feature.

-
+1 Welcome to Math.SE! Keep coming back. –  user53153 Jan 5 '13 at 8:21

This is an exercise in Rudin's Principles of Mathematical Analysis (Chapter 4 Problem 23 in the 3rd edition). The inequalities you quoted in "Usually it uses the fact", which is an alternative definition of convex functions, are part of an exercise in the problem 23.

One can use the inequalities $$\frac{f(t)-f(x)}{t-s}\le \frac{f(u)-f(x)}{u-s}\le\frac{f(u)-f(t)}{u-t}$$ to show that both $\lim_{h\to 0^+}F_x(h)$ and $\lim_{h\to 0^-}F_x(h)$ exist, where $$F_x(h):=\frac{f(x+h)-f(x)}{h}$$ for $x\in(a,b)$. It follows that $\lim_{h\to 0}f(x+h)-f(x)=0$.

Alternatively, let $x\in (a,b)$. Consider $a<x<x_n<y<b$, where $(x_n)$ is such that $x_n\to x$ as $n\to\infty$ and $y\in (a,b)$ is fixed. Then we have $$x_n=\lambda_n x+(1-\lambda_n)y$$ where $$\lambda_n=\frac{x_n-y}{x-y}\to 1,$$ as $n\to\infty$ and thus $$f(x_n)\leq \lambda_nf(x)+(1-\lambda_n)f(y).$$ since $x_n\to x$ and thus $$\limsup_{n\to\infty} f(x_n)\leq \lim_{n\to\infty} \left(\lambda_nf(x)+(1-\lambda_n)f(y)\right)=f(x).\tag{1}$$ Similarly, one can get $$\liminf_{n\to\infty} f(x_n)\geq f(x) \tag{2}$$ by considering a sequence $(x_n)$ such that $x_n\to x$ and $a<x_n<x<z<b$. Note that we can write $$x=\mu_nx_n+(1-\mu_n)z$$ where $$\mu_n=\frac{x-z}{x_n-z}.$$ Hence $$f(x)\leq \mu_nf(x_n)+(1-\mu_n)f(z),$$ which implies that $$\mu_n^{-1}f(x)\leq f(x_n)+(1-\mu_n)\mu_n^{-1}f(z).$$ Taking $\liminf$ on both sides, we get (2).

Combining (1) and (2), we have $$\lim_{n\to \infty}f(x_n)=f(x)$$ and hence $f$ is continuous at $x\in (a,b)$.

-