Building a convex function from a convex set

calculusconvex-analysis

Let function $f:\mathbb{R}^n\rightarrow \mathbb{R}$ then we have a definition of epigraph

$$epif:= \{(x,\alpha)\in\mathbb{R}^n\times\mathbb{R}\;|\;f(x)\leq \alpha\}$$

With above definition we have a theorem
$$f \text{ is convex function iff } epif \text{ is convex set}$$

This theorem helps us build a set from the function f such that the convexity of the set leads to the convexity of $f$, and vice versa. Is it possible to build a function $f$ from a given set to obtain the above property? I specify my question as follows

Problem: Let $C\subset \mathbb{R}^n$ is nonempty set. Find a function $f_C$ such that $C$ is convex iff $f_C$ is convex.

What's I try: I've tried with the distance function $f_C(x) = \inf_{c\in C}||x-c||$. It is proven that if $C$ is nonempty convex set then $f_C$ is convex. You can read the proof in Proposition 4.4 through this link: https://maunamn.wordpress.com/4-distance-function/. The real problem is that I can't prove the converse of the theorem. If $f_C$ defined above is convex function then with every $x,y\in C$ and $\lambda\in[0;1]$, we have
$$f_C(\lambda x + (1-\lambda)y)\leq \lambda f(x) + (1-\lambda)f(y)$$

Because $f_C$ is a distance function to $C$, we conclude that $f_C(x) = f_C(y) = 0$. This leads to $f_C(\lambda x + (1-\lambda)y) = 0$ or $\lambda x + (1-\lambda)y \in \overline{C}$. However, to prove that $C$ is convex set, I need to indicate that $\lambda x + (1-\lambda)y\in C$. And this can only be completed if we have C is a closed set.

Best Answer

On $\Bbb R^n,$ define $f_C:=(+∞)(1-{\bf 1}_C).$

(${\bf 1}_C$ is the characteristic function of $C.$ And here by convention $(+∞)0=0,$ i.e. $(+∞)(1-{\bf 1}_C(x))=0$ if $x∈C,$ and $+∞$ else.)