Rigorous results in the mean-field theory of freezing