Let $f : \mathbb{R}^n \to \mathbb{R}$, $n \in \mathbb{N}$, be such that

  1. $f \in C^1(\mathbb{R}^n)$,
  2. $f(0) = 0$,
  3. $f(x) > 0$ for all $x \in \mathbb{R}^n \setminus\{0\}$.

Is it true that such function must be convex on a neighborhood of the origin? If not, can you come up with a counterexample?

Considering the simplest scenario when $n = 1$, I expect that a smooth function with infinite amount of minima approaching the origin should serve as a counterexample. But I am unable to construct an explicit formula for the function.

  • $\begingroup$ if it is smooth (or even $C^2$), then it is surely convex , since its second derivative is positive $\endgroup$
    – Exodd
    May 3 at 18:07
  • $\begingroup$ @Exodd Interesting! Could you show me a sketch of the proof for a $C^2$ function? Or is this available in the literature? $\endgroup$ May 3 at 18:12
  • $\begingroup$ for $C^2$ functions, just expand $f(h) + f(-h) -2f(0) / h^2$ with Taylor, to find that $f''(0)\ge 0$ $\endgroup$
    – Exodd
    May 3 at 18:26
  • $\begingroup$ @Exodd It seems like $f(x) = x^6(1 + \sin^2(x^{-1}))$ disproves your claim. $\endgroup$ May 4 at 6:56

The answer is in general no. As a general counterexample, consider any smooth strictly positive function $f_0$ that is defined on the unit sphere $S^{n-1} \subset \mathbb{R}^n$ and then define $f$ to be homogeneous of degree $p>1$ such that $f$ agrees with $f_0$ on $S^{n-1}$, that is $$ f(x) = \|x\|^p f_0(x/\|x\|) $$ for $x \ne 0$. Then $f$ is clearly $C^1$, but it need not be convex in any neighborhood of the origin.

For a one-dimensional counterexample, consider $f(x) = x^4 \left( 1 + \sin^2(x^{-1}) \right)$.

  • $\begingroup$ I have troubles understanding the general counterexample. If I take $n = 2$, $\|\cdot\|$ as the Euclidean norm, $p = 2$, and I set $f_0 \equiv 1$ on the unit sphere $S^1$, then $f(x) = x^2 + y^2$ which is clearly convex. Am I missing something? $\endgroup$ May 4 at 9:05
  • $\begingroup$ @sleepingrabbit, his general counterexample is a counterexample in the sense that a function with that form will satisfy your hypothesis without necessarily being convex about the origin, he is not saying that any function of that form is not convex about the origin. You can think of it rather as a guide to find concrete counterexamples. $\endgroup$
    – Hal
    May 4 at 10:08
  • $\begingroup$ @Hal Okay, in that case I don't fully understand what use is this general "counterexample". But I'm happy with the one-dimensional counterexample. $\endgroup$ May 4 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.