Is a convex function always continuous?

It is well known that a convex function defined on $\mathbb{R}$ is continuous (it is even left and right differentiable. Now you can define a convex function for any normed vector space $E$ : $f : E\mapsto \mathbb{R}$ is convex iff $$f\big(\lambda x + (1-\lambda)y\big) \le \lambda f(x)+(1-\lambda)f(y)$$

I know that such a function is not necessarily continuous if $E$ has infinite dimension: $f$ can be a discontinuous linear form. For instance, if $E = \ell^2(\mathbb{N})$ the space of square summable sequences (endowed with the supremum norm $||\cdot||_{\infty}$ instead of its natural norm), and $f(u) = \sum \limits_{i \ge 1} \frac{u_i}{i}$, then $f$ is linear, thus convex, yet it is well-known that $f$ is not continuous.

Now my question is: what about finite dimensions? Does there exist a convex function $f : \mathbb{R}^2 \to \mathbb{R}$ which is not continuous?

I know that there are discontinuous functions from $\mathbb{R}^2$ to $\mathbb{R}$ that have derivatives in every direction (that's a good start since this is a necessary condition !) but I don't know any that is convex.


Corollary 10.1.1 of Convex Analysis by Rockafellar says all convex functions from $\mathbb R^{n}$ to $\mathbb R$ are continuous. The proof is very long and it is not worth reproducing the complete proof here. In the infinite dimensional case there are are discontinuous linear functionals.


No: all convex functions $f: \mathbb R^2 \to \mathbb R$ are continuous.

Here's a slightly more general statement. Let $f : \mathbb R^n \to \mathbb R$ be a convex function, and let $\mathbf x^* \in \mathbb R^n$. We show that $f$ is continuous at $\mathbf x^*$.

Let $S = \{\mathbf y \in \mathbb R^n : \|\mathbf x^* - \mathbf y\| = 1\}$. Our first goal is to show that there's some $M\in \mathbb R$ such that $f(\mathbf y)\le M$ for all $\mathbf y \in S$.

To prove that $M$ exists: by Jensen's inequality, if $\mathbf x^{(1)}, \dots, \mathbf x^{(m)}$ are arbitrary points in $\mathbb R^n$, and $\mathbf x$ is a point in their convex hull, then $f(\mathbf x)$ is a weighted average of $f(\mathbf x^{(1)}), \dots, f(\mathbf x^{(m)})$, so it is bounded above by $\max\{f(\mathbf x^{(1)}), \dots, f(\mathbf x^{(m)})\}$. From there, it's enough to find finitely many points whose convex hull contains $S$: for example, the vertices of a hypercube circumscribed about $S$.

Now suppose we take some $\mathbf x$ close to $\mathbf x^*$. Let $r = \|\mathbf x^* - \mathbf x\|$; we may assume $r<1$, since ultimately we want to consider $\|\mathbf x^* - \mathbf x\|$ arbitrarily small.

On the line through $\mathbf x$ and $\mathbf x^*$, we can pick points $\mathbf y^-, \mathbf y^+ \in S$ such that they appear in the order $\mathbf y^-, \mathbf x^*, \mathbf x, \mathbf y^+$ on that line. They can be defined by: $$ \mathbf y^- = \mathbf x^* - \frac{\mathbf x - \mathbf x^*}{r} \text{ and } \mathbf y^+ = \mathbf x^* + \frac{\mathbf x - \mathbf x^*}{r}. $$ From this, we have

  • $\mathbf x^* = \frac{r}{r+1} \mathbf y^- + \frac{1}{r+1} \mathbf x$, so $f(\mathbf x^*) \le \frac{r}{r+1} f(\mathbf y^-) + \frac{1}{r+1} f(\mathbf x)$, which gives us the lower bound $$f(\mathbf x) - f(\mathbf x^*) \ge r f(\mathbf x^*) - r f(\mathbf y^-) \ge r(f(\mathbf x^*) - M).$$
  • $\mathbf x = r \mathbf y^+ + (1-r) \mathbf x^*$, so $f(\mathbf x) \le r f(\mathbf y^+) + (1-r)f(\mathbf x^*)$, which gives us the upper bound $$f(\mathbf x) - f(\mathbf x^*) \le r f(\mathbf y^+) - r f(\mathbf x^*) \le r(M - f(\mathbf x^*)).$$

Putting these together, we get $$ -r(M - f(\mathbf x^*)) \le f(\mathbf x) - f(\mathbf x^*) \le r(M - f(\mathbf x^*)) $$ which is the statement we need to prove continuity. (In the usual $\epsilon$-$\delta$ form: given $\epsilon > 0$, take $\delta = \frac{\epsilon}{M - f(\mathbf x^*)}$. Then if $\|\mathbf x^* - \mathbf x\| < \delta$, the inequalities above tell us that $|f(\mathbf x^*) - f(\mathbf x)| < \epsilon$.)


Yes, if $E$ is an infinite-dimensional real Banach space then a discontinuous linear functional is a discontinuous convex function. But the map $f$ defined by $f(u)=\sum u_i/i$ is certainly continuous on $\ell_2$.

You're not going to be able to write down a formula for a discontinuous linear functional on a Banach space - it takes the Axiom of Choice to show such a thing exists.