The Foundational Role of Ergodic Theory