# Invertible Legendre-Fenchel transform of non-convex function

According to a number of source I've found online, including this very popular document, the Legendre-Fenchel transformation is an involution iff it is applied to a convex function. However, take the function $f(x) = x^3 + 1$, which is non-convex on $[-1, 1]$. Let $y = f(x)$. Since it is differentiable, we can use the simpler Legendre transform. Starting with $p = \frac{d f}{dx} = 3x^2$ and $x = \pm \sqrt{\frac{p}{3}}$, we find that the transform is (up to a negative): \begin{equation} \begin{split} f^*(p) &= f(x) - px \\ &= \frac{\pm p^{3/2}}{3\sqrt{3}} + 1 \mp \frac{p^{3/2}}{\sqrt{3}} \\ &= \mp \frac{2p^{3/2}}{3\sqrt{3}} + 1 \end{split} \end{equation}

If we then take the Legendre transform of the this function, using $-x = -\frac{df^*}{dp} = \pm\sqrt{\frac{p}{3}}$, we find that: \begin{equation} \begin{split} f^{**}(x) &= f^*(p) - xp \\ &= \mp \frac{2p^{3/2}}{3\sqrt{3}} + 1 \pm \sqrt{\frac{p}{3}} p \\ &= \pm \frac{p^{3/2}}{3\sqrt{3}} + 1\\ &= x^3 + 1 \\ &= y \end{split} \end{equation}

There is obviously the issue of $f^*(p)$ being a multifunction rather than a function, but that could easily be fixed by just defining the square root as a mapping onto the positive reals instead of the whole set of real numbers, and the result would be the same. So why, in this case, is the LF transform an involution despite the input function not being convex?

• The more I read, the more I'm coming to realize that the issue of $f^*(p)$ being a multifunction is actually what does the trick; I can roughly see this geometrically, but a more rigorous explanation of that would still be helpful. – Vyas Apr 12 '17 at 14:50

The problem is that $\sup_x (px-f(x))$ is not always achieved when $f'(x)=p$: this may be a maximum or a minimum. Indeed, the second derivative of the quantity to be maximised is $-f''(x)$, so if $f''(x)<0$ where $f'(x)=p$, that point is a minimum. Moreover, even if a point is a maximum, the derivative only checks that it is a local maximum: the global maximum/supremum can occur elsewhere.

Another problem is that $f^*$ is always a convex function (and in turn, so is $f^{**}$), so if your calculation doesn't produce a convex function, it can't be right.

Let's look graphically at what's happening. Here we have graphs of $px-(x^3+1)$ when $p=0$ (blue), $p=3/4$ (orange) and $p=1$ (green). When $p=0$, the supremum clearly occurs at $x=-1$ (and is zero). As we increase $p$, this remains the case, so the value of $px-(x^3+1)$ is $-p$. This continues until $p=3/4$, where we see the local maximum on the other side becomes level with the value at $x=-1$ (how did I get this? I found the value of $p$ for which a line through $(-1,0)$ of gradient $p$ became a tangent; I recommend you think about why this works yourself). From then on, the supremum occurs at the local maximum you found, and since this is positive, it must be at $x=+\sqrt{p/3}$, so $px-f(x) = 2(p/3)^{3/2}-1$. Putting all this together, the Legendre–Fenchel transform looks like this: This is clearly convex. One can compute $f^{**}$ as well: the affine part on the left vanishes into the point $x=-1$, the point at $p=3/4$ becomes an affine piece $\frac{3}{4}(x-1)$, and the other part returns to itself since it is convex and we find this: where $f$ is blue and $f^{**}$ is orange: we see in particular that $f^{**}$ is the convex hull of $f$: the largest convex function no larger than $f$.

• Based on this, it seems that my argument breaks down because convexity is required for the derivative form of the transform to make sense (i.e. differentiability alone is not enough because you need $sup_x(px−f(x))$ to coincide with the point where the derivative is 0). Is that right? It looks like what I did serves the purpose that the Legendre transform is used for in e.g. Hamiltonian dynamics and thermodynamics, preserving information content, whereas the proper definition does not. Does that mean that at some level the transform used in physics is actually a different transform? @Chappers – Vyas Apr 12 '17 at 17:55
• Hamiltonians (at least of the $\dot{q}^2$ variety) tend to be convex with invertible derivatives ($m\dot{q}^2/2 \to p^2/2m$ &c.). The postulates of thermodynamics tend to be formulated so that the internal energy ends up convex (and then the other potentials are defined using the LF transform). See here for a mathematical formulation that explains this. I think it's probably the usual story of physicists being more interested in deriving results than formulating theories to be mathematically sound. – Chappers Apr 12 '17 at 18:36
• Agreed regarding the formulations of Hamiltonians and thermodynamic potentials (I was actually on that page earlier). I guess my question is essentially, is it just a fortunate accident that in this case my incorrect application of the Legendre transform turned out to be invertible? Or is there some deeper structure here? @Chappers – Vyas Apr 12 '17 at 20:05