# Why do we need the supremum when performing Legendre transformations?

Legendre transforms appear all over physics. For instance, in statistical mechanics, they allow us to move between descriptions in terms of different thermodynamic potentials. Similarly, in quantum field theory, they are used to construct the effective action $\Gamma[\varphi]$ (the generating functional of one-particle irreducible correlators) from $W[J]$, the generating functional of connected correlators.

The thing is, you often see these transformations in two different forms. It might be either $$\Gamma[\varphi] = \sup_J(J \cdot \varphi - W[J]),$$ see e.g. here, or just $$\Gamma[\varphi] = J \cdot \varphi - W[J].$$ as it is written here and on Wikipedia. I understand taking the supremum ensures that $\Gamma[\varphi]$ ends up a convex function of $\varphi$. So why do some people worry about this and others don't? Is there any more to it, perhaps with regard to invertibility?

The second form is ill-defined: you want to swap the independent variable from $J$ to $\varphi$, so you can't have any dependence on $J$ in the final answer.
That's the case, explicitly, in your first equation, but it's also implicit in the second form, where it'll be implicit that $J$ needs to be taken at an extremum or at the solution of some equation that encodes that extremum. However, as you've written it, there is not enough information to fully define the transform.
The first formula is the definition of the Legendre transform $\Gamma$ of $\phi$, and $J$ is a dummy variable.
In the second formula it is already presupposed that $\Gamma$ is the Legendre transform of $\phi$, and that $J$ is the maximizer in the first formula (which is assumed to exist). It is an identity that follows under this additional condition from the first formula.