I've found two different definitions of the Hamiltonian functions as related to a Lagrangian $\mathcal{L}(t,q,\dot{q})$.
- $$H(t,q,p):=\sup_{\dot{q}}\big(p_j\dot{q}^j-\mathcal{L}(t,q,\dot{q})\big);$$
- $$H(t,q,p):=\big(p_j\dot{q}^j-\mathcal{L}(t,q,\dot{q})\big)\qquad\text{with }\dot{q}=\mathbb{L}_\dot{q}^{-1}(t,q,p),$$
where $\mathbb{L}$ is the Legendre transformation.
Are the two definition equivalent? Thank you.