Foundations of mathematical analysis