4.10.17 · D1Advanced Topics (Elite Level)

Foundations — Convex optimization — convex sets, convex functions

3,350 words15 min readBack to topic

This page assumes nothing. Every squiggle in the parent note is built here from the ground up, in an order where each symbol is earned before the next one uses it. Read top to bottom.


0. The very first symbols: numbers, points, and

The picture. is a line. is a flat sheet — a point is , an address "go right , go up ". is space around you. Beyond we can't draw it, but the rules stay identical, so we picture and trust it.

Why the topic needs it. Optimization asks "which point is best?" — you cannot ask that until you know what a "point" is and what "space" it lives in. Everything else is decoration on top of .


1. Mixing points: scalar multiplication and vector addition

Before any "" makes sense, we must know what it means to stretch a point and to add two points. These two operations are the whole grammar of .

What it looks like — read the figure. The figure shows scaled to (shorter, same direction), and two arrows added tip-to-tail. Once you can stretch and add, you can build any mix : scale by , scale by , then add the two scaled arrows.

Figure — Convex optimization — convex sets, convex functions

Why the topic needs it. Every convex combination, every gradient step, every chord is literally "scale, then add." These are the only two moves; the rest of the chapter just chooses clever numbers to scale by.


2. A set, and the line segment between two points

Now the single most important construction of the entire chapter: the line segment between two points, written with a knob you can slide. It is built purely from the scale-and-add operations of Section 1.

What it looks like — read the figure. As slides from to :

  • at : the point is (you're standing on ),
  • at : the point is (you've walked to ),
  • at : the point is , the exact midpoint.

So the formula traces the straight segment from to , and is your position along it. The two weights and always add to — that "adds to " is exactly what keeps you on the segment and never off it.

Figure — Convex optimization — convex sets, convex functions

Why the topic needs it. "No dents, no holes" has to be said in symbols. The only tool for that is: pick two points, walk the straight segment between them, ask whether the segment stays inside. That question is convexity.


3. The dot product and — how flat walls are written

The parent writes half-spaces like . That needs three new symbols: , the dot product, and used on a whole expression.

What it looks like. Fix the arrow . The equation (for a fixed number ) draws a flat wall — a line in 2-D, a plane in 3-D — sitting perpendicular ("at right angles") to . Sliding up and down shifts that wall parallel to itself. See the figure: the arrow points across the wall, and measures how far along 's direction the point has travelled.

Figure — Convex optimization — convex sets, convex functions

Why the topic needs it. A half-space is the simplest possible convex region with a flat boundary. Stack ("intersect") many of them and you carve out a polyhedron — the feasible region of every linear program. So is the atom that convex feasible regions are built from. The dot product also returns in norms and inner products and in the gradient (Section 6).


4. Length of a vector: the norm

What it looks like. = "all points within distance of the centre" = a filled ball (a disk in 2-D). = "points at exactly distance " = the rim only. Same , wildly different sets — the filled disk is convex, the rim is not.

Why the topic needs it. Balls are the standard example of a convex set, and the norm function is the standard example of a convex function built from the triangle inequality: This is the picture behind "every norm is convex," and it links straight to Norms and Inner Products.


5. The graph, the chord, and the epigraph

What it looks like — read the figure. Pick two points on a bowl-shaped graph and draw the chord between them. For a convex function the chord sits on or above the curve (the bowl never bulges up past its own strings). The epigraph — the sand above the curve — is then a dent-free region, i.e. a convex set. That is the deep secret of the whole topic: a function is convex exactly when its "above-region" is a convex set. One idea wearing two hats.

Figure — Convex optimization — convex sets, convex functions

Why the topic needs it. This inequality is the engine of the whole chapter: it forces "no fake dips," which is why a convex function has exactly one bottom.


6. Slopes in many directions: gradient and Hessian

To test convexity by calculus we need "slope" and "curvature" for landscapes.

Why a second derivative and not the first? Convexity is about bending, not about tilting. A straight ramp tilts () but doesn't bend () — and a ramp is convex. Only the second derivative sees the bend, which is exactly what "bowl-shaped" means. That's why the curvature test uses , not .

This is why the first-order convexity test looks the way it does: the right-hand side is the flat tangent plane's prediction, and convex means the true surface always sits above that flat prediction. It's also the object Gradient Descent follows downhill (walk against ).

Why the topic needs it. In more than one dimension a surface can curve up along one axis and down along another (a saddle). A single number can't capture that; the Hessian and the test can, direction by direction, through .


7. The prerequisite map

Here is how these foundations flow into the two central definitions of the topic.

Real space R and R-n

Points and vectors

Scale and add operations

Segment theta x plus 1 minus theta y

Dot product a-transpose x

Half-space and polyhedron

Norm length of a vector

Convex SET no dents no holes

Function f height landscape

Chord on the graph

Convex FUNCTION chord on top

Partial derivatives

Gradient steepest uphill arrow

First-order test tangent below

Hessian multi-direction curvature

Second-order test PSD v-transpose M v >= 0

Convex Optimization global min guaranteed


Equipment checklist

Read each question, answer out loud, then reveal. If any one trips you, reread its section above before tackling the parent note.

What does mean in plain words?
The point is a member of (lives inside) the set .
What does the colon mean in ?
"Such that" — the collection of all satisfying the rule after it.
How do you compute and ?
Scale every coordinate of by ; add and coordinate by coordinate (tip-to-tail arrows).
As slides , where does go?
Along the straight segment from (at ) to (at ), hitting the midpoint at .
State the definition of a convex set.
For all and all , — the whole segment stays inside.
State the definition of a convex function.
for all and — the chord lies on/above the graph.
Why must the weights and sum to ?
So the combined point stays exactly on the segment between and , never drifting off it.
What kind of object is the dot product — vector or number?
A single number (it collapses two vectors into one "alignment" value).
What shape is ?
A half-space — all points on one side of the flat wall .
General formula for the norm in ?
.
Difference between and ?
The first is the filled disk (convex); the second is only the rim circle (not convex).
What does the epigraph of look like?
Everything on or above the graph — the sand poured above the surface; .
What does a partial derivative measure?
The slope of in the direction only, holding all other coordinates fixed.
Why does the curvature test use and not ?
Convexity is about bending, which only detects; only measures tilt, and a tilted straight ramp is still convex.
What are the entries of the Hessian , and why is it symmetric?
Entry is ; symmetry of second derivatives makes entry equal entry .
What does mean, spelled out?
For every direction , — the surface bends upward (or stays flat) in every direction.

Connections

  • Parent topic — the full convexity note
  • Linear Programming — the half-space of Section 3 stacks into the feasible polyhedron.
  • Norms and Inner Products — the norm (Section 4) and dot product (Section 3) formalised.
  • Gradient Descent — follows the gradient arrow of Section 6 downhill.
  • Positive Definite Matrices — the Hessian test of Section 6.
  • Jensen's Inequality — the chord picture of Section 5 pushed to averages.
  • Lagrange Multipliers and KKT Conditions — builds on gradients once convexity is set.