# Conditions to perform Legendre transformation of lagrangian

Let $$\mathcal{L}(\boldsymbol{q}, \dot{\boldsymbol{q}},t)$$ be the lagrangian of a certain system with $$n$$ degrees of freedom. By definition of Legendre transformation (not Legendre-Fenchel) the lagrangian hessian matrix with respect to generalized velocities:

$$$$\left(\frac{\partial^2\mathcal{L}}{\partial\dot{q}^i\partial\dot{q}^j}\right) \tag{1}$$$$

has to be positive definite. If the lagrangian is of the form: $$$$\mathcal{L}=T-U \tag{2}$$$$ Where $$T$$ is the kinetic energy and $$U$$ is a generalized potential, it can be proved that for a mechanical system $$(1)$$ is positive definite (it's the matrix of the quadratic form associated to $$T$$). On the other hand, I've seen some only require that $$$$\det\left(\frac{\partial^2\mathcal{L}}{\partial\dot{q}^i\partial\dot{q}^j}\right)\neq0 \tag{3}$$$$ (non degenerate lagrangian) that means that the system:

$$$$\frac{\partial \mathcal{L}}{\partial\dot{q^j}}=p_j\qquad j=1...n$$$$

is invertible. This condition is necessary, though, it does not guarantee $$(1)$$ to be positive definite and thus the requirements of legendre transformation. So why is $$(3)$$ in some context used as a condition to perform the Legendre transform of the lagrangian?