Mathematical Foundations of Artificial Intelligence