Foundations of Mathematical Optimization: Convex Analysis without Linearity