Foundations — Convex vs non-convex functions
This page assumes you know nothing. Every squiggle the parent note used — , , , , , — is built here from the ground up, one at a time, each with a picture and a reason it exists. Read top to bottom; nothing is used before it's earned.
0. What is a function , really?
The picture of a function is its graph: for every input on the horizontal axis, we plot a point at height . Sweep across all inputs and the dots join into a curve.

Why the topic needs it: in machine learning the machine is a loss function Loss Functions — you feed it your model's settings, it tells you how wrong the model is. The whole topic is about the shape of that curve.
1. The parameter symbol
So = "how bad is the model when the knobs are set to ." Turning the knobs moves you left/right along the floor; the loss curve tells you the height there. Optimization = find the knob setting with the lowest height.
Why the topic needs it: the parent note's sentence "minimize " is meaningless until you know is just the input to a function-machine.
2. Two points and the segment between them
To even state convexity we must talk about "any two points" and "the line between them." So we need a clean way to name every point on that connecting line using one slider.
Given two floor-positions and , the blended position is
Read it as a recipe: take scoops of and scoops of .
- : all → you're standing at .
- : all → you're standing at .
- : half-and-half → the exact midpoint.
As slides from to , the blended point sweeps the entire straight segment between and . One dial, every in-between point.

Why the topic needs it: this exact expression appears on both sides of the master convexity inequality. Left side blends the inputs; right side blends the outputs.
3. The chord vs the curve
Take the two graph points and . The straight line joining them is the chord.
Convex means: curve height chord height, for every choice of . That's it — the parent's "master definition" decoded.

4. Slope, then the derivative
To talk about tangent lines (Lens 2) and curvature (Lens 3), we need slope.
Why this tool and not another? We ask "which way is downhill, and how steep?" — that is a question about instantaneous slope, and the derivative is the one tool that answers it. Averages over an interval won't do; we need the slope at a single knob-setting so we know which way to nudge.
A point where is flat — a stationary point. Bottoms of valleys, tops of hills, and saddle flat-spots all have zero slope. (Which kind it is comes next.)
5. Second derivative — the curvature
Slope tells you the tilt. But convexity is about whether the curve bends up or down. So we take the slope of the slope.

Why this is THE practical convexity test: "does the curve cup upward everywhere?" is exactly " everywhere." One clean sign-check, no dragging chords around. This is the parent's Lens 3 in 1D. See Taylor Series Expansion for why is precisely the coefficient of curvature in the local picture.
6. Going multivariate: the gradient and the transpose
Real models have many knobs, so is a list of numbers (a vector), and eats the whole list.
So the first-order condition reads: the number is just "slope how far you moved," i.e. the height the flat tangent predicts.
Why the topic needs it: with many knobs you can't say "left/right"; the gradient packages all directions, and is the glue that turns a direction-of-motion into a predicted height change.
7. The Hessian and ""
Curvature in many dimensions isn't a single number — a surface can cup up one way and dome down another (a saddle!). We need a table of curvatures.

Why the topic needs it: multivariate convex everywhere. One downward-bending direction (one negative slice) and you get a saddle — non-convex — and the guarantee that local = global evaporates.
8. Putting the payoff in one line
Convex bowl ⇒ a flat spot () can only be the bottom ⇒ every local minimum is the global minimum. That single implication is why Convex Optimization is "easy" and neural nets are "hard."
Prerequisite map
Equipment checklist
Reveal each and check you could explain it cold.
What does mean and what is its picture?
What is and why not just call it ?
What does do in ?
Curve height vs chord height at a blended point?
State convexity in words.
What is and why do we need it?
What does everywhere tell you?
What is ?
What does compute?
What is the Hessian ?
What does (PSD) mean geometrically?
The one payoff of convexity?
Recall Feynman check
Explain to a 12-year-old: a function is a candy machine (input coin position → output height). Convex means the machine's height-graph is one smooth soup bowl. Stretch a string between any two spots on the bowl — the string is always above the bowl, never cutting through it. That's why a dropped marble always finds the one true bottom.