Mathematical Foundations of Statistical Mechanics