*preprint*

**Inserted:** 6 feb 2019

**Year:** 2018

**Abstract:**

We show that a necessary and sufficient condition for a smooth function on the tangent bundle of a manifold to be a Lagrangian density whose action can be minimized is, roughly speaking, that it be the sum of a constant, a nonnegative function vanishing on the support of the minimizers, and an exact form. We show that this exact form corresponds to the differential of a Lipschitz function on the manifold that is differentiable on the projection of the support of the minimizers, and its derivative there is Lipschitz. This function generalizes the notion of subsolution of the Hamilton-Jacobi equation that appears in weak KAM theory, and the Lipschitzity result allows for the recovery of Mather's celebrated 1991 result as a special case. We also show that our result is sharp with several examples. Finally, we apply the same type of reasoning to an example of a finite horizon Legendre problem in optimal control, and together with the Lipschitzity result we obtain the Hamilton-Jacobi-Bellman equation and the Maximum Principle.