Mathematical Foundations for Machine Learning