3

Suppose $K$ is convex and $F(x) = 1$ for $x$ in $K$ and $F(x) = 0$ for $x$ not in $K$. Is $F$ a convex function ? What if the $0$ and $1$ are reversed ?

I think in both cases, the function is not convex because the set of points above $F$ is not a convex set since we can pick two points such that the line joining them goes outside the convex set.

Is this intuition correct?

RobPratt
  • 50,938
Ray
  • 537
  • 1
    That’s correct but you should say “above the graph of $F$” rather than “above $F$”. And you shouldn’t say “outside the convex set” because the set you’re describing is not convex. – littleO Jun 17 '22 at 01:07
  • Some authors define a convex function as one whose epigraph is a convex set. – copper.hat Jun 17 '22 at 03:37
  • Maybe an even stronger intuition is that a convex function $,\mathbb R^n \to \mathbb R,$ must be continuous. But a function which takes only two distinct values and no other values in between cannot be continuous, and this does not depend on $K$ being convex or not. For the proof of continuity see for example Prove that every convex function is continuous, noting the assumption that the domain of $F$ is an open set. – dxiv Jun 17 '22 at 03:48
  • Generally, convex analysis embraces the infinities. So, if you let $F(x) =+\infty $ for $x \notin K$ and $0$ otherwise it would be considered convex. – copper.hat Jun 17 '22 at 03:57

1 Answers1

1

Consider the following functions defined on $[0,1]$. All these functions takes value $1$ when input comes from $K$ and $0$ otherwise. I am also assuming $K$ is convex. These are all possibilities:

  • $f_1:[0,1]\rightarrow\{0,1\}$ and $K=\{1\}$. $f_1$ is a convex function.
  • $f_2:[0,1]\rightarrow\{0,1\}$ and $K=\{0\}$. $f_2$ is a convex function.
  • $f_3:[0,1]\rightarrow\{0,1\}$ and $K=[0,1]$. $f_3$ is a convex function.
  • $f_4:[0,1]\rightarrow\{0,1\}$ and $K=\emptyset$. $f_4$ is a convex function.
  • $f_5:[0,1]\rightarrow\{0,1\}$ is not convex if point of discontinuity of $f_5$ is in $(0,1)$.
Amit
  • 1,426