Learning Theory From First Principles