Ergodic Theory in Statistical Mechanics