Mathematical Foundations for Data Science and AI