convex function
A convex function is one whose graph holds water — it bends upward like a bowl, never bulging up in the middle. The defining picture is simple: take any two points on the graph and draw the straight chord between them; for a convex function the chord always lies on or above the graph. There are no local dips that are not also the global low point, no hidden valleys to get trapped in.
Precisely, f is convex if for any two points and any blend fraction t between 0 and 1, f(t x + (1-t) y) is less than or equal to t f(x) + (1-t) f(y) — the value at a weighted average never exceeds the weighted average of the values. For a smooth function of several variables there is a clean second-order test: f is convex exactly when its Hessian is positive semidefinite everywhere, the multivariable statement of curving upward in every direction. Strict convexity (strictly positive curvature) means the bowl has a single, sharp bottom.
Convexity is the dividing line that separates optimization problems we can solve reliably from those we cannot. For a convex objective over a convex feasible set, every local minimum is automatically a global minimum, so any method that goes downhill — gradient descent included — cannot get stuck in a false optimum, and the KKT conditions become sufficient, not just necessary. This is why so much of applied optimization, from portfolio theory to support-vector machines to signal recovery, is deliberately formulated to be convex. When a problem is non-convex, all guarantees soften to local statements.
The parabola f(x) = x^2 is convex: any chord between two points on it lies above the curve, and f'' = 2 > 0 everywhere. The bowl f(x, y) = x^2 + y^2 is its two-variable cousin, with Hessian [2, 0; 0, 2], positive definite, hence convex with a single global minimum at the origin.
A positive semidefinite Hessian everywhere is the working definition of convexity for a smooth function.
Convexity is a global property checked everywhere, not at one point: a positive definite Hessian at a single stationary point only makes that point a local minimum, whereas convexity needs the Hessian non-negative across the whole domain.