  We derive an analytical theory of the prestellar core initial mass function
based on an extension of the Press-Schechter statistical formalism. With the
same formalism, we also obtain the mass spectrum for the non self-gravitating
clumps produced in supersonic flows. The mass spectrum of the self-gravitating
cores reproduces very well the observed initial mass function and identifies
the different mechanisms responsible for its behaviour. The theory predicts
that the shape of the IMF results from two competing contributions, namely a
power-law at large scales and an exponential cut-off (lognormal form) centered
around the characteristic mass for gravitational collapse. The cut-off exists
already in the case of pure thermal collapse, provided that the underlying
density field has a lognormal distribution. Whereas pure thermal collapse
produces a power-law tail steeper than the Salpeter value, dN/dlog M\propto
M^{-x}, with x=1.35, this latter is recovered exactly for the (3D) value of the
spectral index of the velocity power spectrum, n\simeq 3.8, found in
observations and in numerical simulations of isothermal supersonic turbulence.
Indeed, the theory predicts that x=(n+1)/(2n-4) for self-gravitating structures
and x=2-n'/3 for non self-gravitating structures, where n' is the power
spectrum index of log(rho). We show that, whereas supersonic turbulence
promotes the formation of both massive stars and brown dwarfs, it has an
overall negative impact on star formation, decreasing the star formation
efficiency. This theory provides a novel theoretical foundation to understand
the origin of the IMF and to infer its behaviour in different environments. It
also provides a complementary approach and useful guidance to numerical
simulations exploring star formation, while making testable predictions.
