  We develop a geometric theory of phase transitions (PTs) for Hamiltonian
systems in the microcanonical ensemble. This theory allows to reformulate
Bachmann's classification of PTs for finite-size systems in terms of geometric
properties of the energy level sets (ELSs) associated to the Hamiltonian
function. Specifically, by defining the microcanonical entropy as the logarithm
of the ELS's volume equipped with a suitable metric tensor, we obtain an exact
equivalence between thermodynamics and geometry. In fact, we show that any
derivative of entropy with respect to the energy variable can be associated to
a specific combination of geometric curvature structures of the ELSs which, in
turn, are precise combinations of the potential function derivatives. In this
way, we establish a direct connection between the microscopic description
provided by the Hamiltonian and the collective behavior which emerges in a PT.
Finally, we also analyze the behavior of the ELSs' geometry in the
thermodynamic limit, showing that non-analyticities of the energy-derivatives
of the entropy are caused by non-analyticities of certain geometric properties
of the ELSs around the transition point. Finally, we validate the theory
studying the PTs that occur in the $\phi^4$ and Ginzburg-Landau-like models.
