Theoretical Foundations Of Deep Learning: Optimization, Generalization, And Scaling