Study Notes

Convex Optimization

Optimization’s real watershed is not linear vs nonlinear but convex vs nonconvex: for a convex problem a local optimum is automatically global, and a simple gradient/KKT condition certifies it — convex problems are the ones you can actually solve and trust. The subject then has two jobs. (1) Recognize or build convexity — a calculus of convexity-preserving operations on sets and functions, the two welded together by the epigraph. (2) Exploit it — optimality conditions and, above all, duality, which lower-bounds every problem, closes the gap under Slater, certifies optimality via KKT, prices the constraints, and turns intractable robust/infinite problems into solvable ones. Problems sort into a hierarchy LP ⊂ QP ⊂ SOCP ⊂ SDP; modeling is transforming yours down to the simplest class that still holds it. A running thread climbs that tower: norm approximation minAxb\min \lVert Ax - b\rVert. Prerequisites cashed in: PSD matrices, eigenvalues, SVD, projection (track 2); OLS / ridge / lasso (track 4); lasso geometry, SVM, soft-thresholding, logistic loss (track 6); MAP-as-penalty and conjugacy (track 7); MLE (track 3).

1. Why convexity — local is global

  • Convex set: the segment between any two of its points stays inside — θx+(1θ)yC\theta x + (1-\theta)y \in C for θ[0,1]\theta \in [0,1]. Convex function: its domain is convex and every chord lies above the graph,

f(θx+(1θ)y)θf(x)+(1θ)f(y),θ[0,1].f(\theta x + (1-\theta)y) \le \theta f(x) + (1-\theta)f(y), \qquad \theta \in [0,1].

(Affine = the boundary case, equality always; concave = f-f convex.)

  • The payoff — local optimum is global. Derive it. Suppose xx is locally optimal but some feasible yy has f(y)<f(x)f(y) < f(x). Walk from xx toward yy: zθ=(1θ)x+θyz_\theta = (1-\theta)x + \theta y. Convexity bounds the value on the segment,

f(zθ)(1θ)f(x)+θf(y)<f(x)for θ(0,1].f(z_\theta) \le (1-\theta)f(x) + \theta f(y) < f(x) \quad\text{for } \theta \in (0,1].

Because the feasible set is convex and x,yx, y are both feasible, every zθz_\theta on the segment is feasible too. For small θ\theta, zθz_\theta is arbitrarily close to xx yet strictly better — contradicting local optimality. So no feasible point beats xx: local = global. This single fact is why convex problems are tractable; non-convex ones hide better optima in valleys you can’t see locally.

  • Certifiability (first-order). For differentiable convex ff, the first-order Taylor expansion is a global underestimator:

f(y)f(x)+f(x)T(yx)x,y.f(y) \ge f(x) + \nabla f(x)^T(y - x) \quad \forall x, y.

From local information at xx you bound ff everywhere. Setting up the unconstrained optimum: f(x)=0\nabla f(x) = 0 then forces f(y)f(x)f(y) \ge f(x) for all yy — a certificate of global optimality, not just a stationarity coincidence.

  • Recognizing the easy cases. Least squares (minAxb22\min \lVert Ax-b\rVert_2^2, a bowl) and linear programs (linear objective, affine constraints) are the two oldest convex templates. The running example minAxb\min \lVert Ax - b\rVert is convex for any norm (norms are convex) — the open question is which class it lands in (§4).

Implications

  • “Local = global” is the entire reason the taxonomy below matters: every modeling trick exists to keep you inside the convex world where this holds.
  • Certifiability means convex solvers return not just an answer but a proof (the dual certificate, §5) — you know you’re done.

Core competency set

  • State convex set / convex function (chords above); prove local = global by the segment argument.
  • State the first-order global-underestimator inequality and why f=0\nabla f = 0 certifies the unconstrained optimum.

2. Convex sets

  • Three notions, one knob: how free is θ\theta in θ1x1+θ2x2+\theta_1 x_1 + \theta_2 x_2 + \cdots?

    • affine combination: θi=1\sum\theta_i = 1, θi\theta_i any sign — the whole line through any two points stays in. Example: the solution set {x:Ax=b}\{x : Ax = b\} (and conversely every affine set is such a solution set).
    • convex combination: θi=1\sum\theta_i = 1, θi0\theta_i \ge 0 — only the segment stays in.
    • conic combination: θi0\theta_i \ge 0 (no sum constraint) — a convex cone holds all of these.

    Each hull (affine/convex/conic) is the smallest such set containing CC; loosening the constraint on θ\theta enlarges the notion. A set is convex iff it equals its convex hull.

  • The example zoo — memorize the shape and a representation:

    • hyperplane {aTx=b}\{a^Tx = b\} (normal aa); halfspace {aTxb}\{a^Tx \le b\} — convex, not affine (not closed under scaling).
    • Euclidean ball B(xc,r)={xc+ru:u21}B(x_c, r) = \{x_c + ru : \lVert u\rVert_2 \le 1\}; ellipsoid {(xxc)TP1(xxc)1}\{(x-x_c)^TP^{-1}(x-x_c) \le 1\}, P0P \succ 0, equivalently {xc+Au:u21}\{x_c + Au : \lVert u\rVert_2 \le 1\} — the semi-axes are the singular values of AA (track 2).
    • norm ball {x:xxcr}\{x : \lVert x - x_c\rVert \le r\} for any norm (L1L_1 ball = diamond, LL_\infty = cube); norm cone {(x,t):xt}\{(x,t) : \lVert x\rVert \le t\} — the Euclidean one is the second-order cone.
    • polyhedron {Axb, Cx=d}\{Ax \preceq b,\ Cx = d\} — a finite intersection of halfspaces and hyperplanes.
    • PSD cone S+n={X=XT:zTXz0 z}S^n_+ = \{X = X^T : z^TXz \ge 0\ \forall z\} — a convex cone (the boundary is rank-deficient matrices); the workhorse of SDP (§4).
  • The working skill — build, don’t check. To show a set is convex, assemble it from the zoo via operations that preserve convexity (never grind the definition; that’s only for disproving — find two points whose midpoint escapes):

    • intersection of any number of convex sets — a polyhedron is an intersection of halfspaces, and the construction extends to infinite intersections. Example: {x:x1cost++xmcosmt1 tπ/3}\{x : |x_1\cos t + \cdots + x_m\cos mt| \le 1\ \forall\, |t| \le \pi/3\} is convex — an infinite intersection of slabs, one per tt.
    • affine image / preimage {Ax+b:xC}\{Ax + b : x \in C\} and {x:Ax+bC}\{x : Ax + b \in C\} — scaling, translation, projection; also the LMI solution set {x:xiAiB}\{x : \sum x_iA_i \preceq B\} (preimage of S+nS^n_+, hence convex) and the hyperbolic cone {x:xTPx(cTx)2, cTx0}\{x : x^TPx \le (c^Tx)^2,\ c^Tx \ge 0\}.
    • perspective P(x,t)=x/tP(x,t) = x/t (t>0t > 0) — the pinhole-camera map (divide by the last coordinate and drop it); preserves convexity both ways.
    • linear-fractional f(x)=(Ax+b)/(cTx+d)f(x) = (Ax+b)/(c^Tx+d) — affine, then perspective.
  • Separating hyperplane theorem. Two nonempty disjoint convex sets C,DC, D can be separated: a0,b\exists\, a \ne 0, b with aTxba^Tx \le b on CC and aTxba^Tx \ge b on DD (build aa from the segment between the two closest points). Strict separation needs extra (e.g. one set closed, the other a point). This theorem is the existence engine behind duality (§5) and the Fredholm-style “either solve it or certify infeasibility” alternatives.

  • Supporting hyperplane theorem. At every boundary point x0x_0 of a convex set CC there is a supporting hyperplane {x:aTx=aTx0}\{x : a^Tx = a^Tx_0\} with aTxaTx0a^Tx \le a^Tx_0 for all xCx \in C — a tangent halfspace containing CC. (Convexity is exactly what guarantees one exists at every boundary point.) This is the geometric content of strong duality: the dual optimum is the supporting hyperplane to the value set at the optimum (§5).

  • Generalized inequalities. A proper cone KK — convex, closed, solid (nonempty interior), pointed (contains no line) — defines a partial order xKy    yxKx \preceq_K y \iff y - x \in K. The two you use: componentwise (K=R+nK = \mathbb R^n_+) and the Löwner/PSD order (K=S+nK = S^n_+). Unlike \le on R\mathbb R it is not a total order — some pairs are incomparable.

  • Dual cone K={y:yTx0 xK}K^* = \{y : y^Tx \ge 0\ \forall x \in K\} (the vectors making a non-obtuse angle with all of KK) — always convex, even if KK isn’t. R+n\mathbb R^n_+ and S+nS^n_+ are self-dual; the (L1,L)(L_1, L_\infty) norm cones are duals of each other. The dual cone supplies the multipliers for cone constraints (§4 SDP, §5).

  • Minimum vs minimal — and why scalarization works. With a non-total order, “smallest” splits in two:

    • xx is the minimum of SS if xKyx \preceq_K y for all ySy \in S (it beats everything; unique if it exists). Dual test: xx is minimum iff it is the unique minimizer of λTz\lambda^Tz over SS for every λK0\lambda \succ_{K^*} 0.
    • xx is minimal if nothing is strictly below it (yKxy=xy \preceq_K x \Rightarrow y = x); there can be many. Dual fact: if xx minimizes λTz\lambda^Tz over SS for some λK0\lambda \succ_{K^*} 0 then xx is minimal — and for convex SS every minimal point arises this way.

    This is exactly scalarization: a single price λK0\lambda \succ_{K^*} 0 collapses a vector objective to a scalar one whose solution is Pareto-optimal — the Pareto frontier is traced by sweeping λ\lambda (regularization tradeoff curves, §6).

Implications

  • The convexity-preserving operations mirror §3’s function operations — and are the reason real modeling never invokes the definition: you assemble convex objects from a known kit.
  • The supporting hyperplane theorem is the seed of duality: a separating/supporting hyperplane between the achievable-value set and the “better-than-pp^\star” region is the optimal dual multiplier (§5’s geometric interpretation). Set geometry and duality are one story.
  • Scalarization (minimal-via-dual-inequality) is why multi-objective problems reduce to weighted scalar ones, and why the regularization parameter γ\gamma traces a Pareto curve.

Core competency set

  • Give the affine/convex/conic combination distinction (the θ\theta knob) and the example zoo with a representation each (ellipsoid, norm cone, polyhedron, PSD cone).
  • Name the convexity-preserving operations with an example each (infinite intersection, LMI preimage, perspective); state the separating and supporting hyperplane theorems and their link to duality.
  • Define proper cone, K\preceq_K, dual cone (self-dual examples); distinguish minimum vs minimal and state the scalarization (dual-inequality) characterization.

3. Convex functions

  • Definition and the line test. ff is convex if domf\mathrm{dom}\,f is convex and every chord lies above the graph (§1). The practical checker: ff is convex iff its restriction to every line is convexg(t)=f(x+tv)g(t) = f(x + tv) convex in tt for all xdomfx \in \mathrm{dom}\,f, all vv. This collapses an nn-dimensional question to one dimension. Worked (logdet\log\det): for f(X)=logdetXf(X) = \log\det X on S++nS^n_{++}, restrict to the line X+tVX + tV and set g(t)=logdet(X+tV)g(t) = \log\det(X + tV). Factor out X1/2X^{1/2} from both sides:

X+tV=X1/2(I+tX1/2VX1/2)X1/2.X + tV = X^{1/2}\big(I + t\,X^{-1/2}VX^{-1/2}\big)X^{1/2}.

Take logdet\log\det, using det(ABC)=detAdetBdetC\det(ABC) = \det A\,\det B\,\det C and detX1/2detX1/2=detX\det X^{1/2}\,\det X^{1/2} = \det X:

g(t)=logdetX+logdet(I+tX1/2VX1/2).g(t) = \log\det X + \log\det\big(I + t\,X^{-1/2}VX^{-1/2}\big).

Let λi\lambda_i be the eigenvalues of M=X1/2VX1/2M = X^{-1/2}VX^{-1/2}; then I+tMI + tM has eigenvalues 1+tλi1 + t\lambda_i and det(I+tM)=i(1+tλi)\det(I+tM) = \prod_i(1+t\lambda_i), so the log of the product is a sum of logs:

g(t)=logdetX+i=1nlog(1+tλi).g(t) = \log\det X + \sum_{i=1}^n \log(1 + t\lambda_i).

Each log(1+tλi)\log(1+t\lambda_i) is concave in tt and a sum of concave functions is concave, so gg is concave on every line — by the line test, logdet\log\det is concave.

  • First-order condition (differentiable): convex     \iff the tangent is a global underestimator,

f(y)f(x)+f(x)T(yx)x,y.f(y) \ge f(x) + \nabla f(x)^T(y - x) \quad \forall x, y.

Local slope bounds the entire function — the property that makes f=0\nabla f = 0 certify a global min (§1) and that powers the dual lower bounds (§5).

  • Second-order condition: convex     2f(x)0\iff \nabla^2 f(x) \succeq 0 everywhere (PD ⟹ strictly convex). Worked, in rising difficulty:
    • quadratic 12xTPx+qTx+r\tfrac12 x^TPx + q^Tx + r: 2f=P\nabla^2 f = P, convex iff P0P \succeq 0 (the bowl opens up everywhere);
    • least squares Axb22=(Axb)T(Axb)\lVert Ax - b\rVert_2^2 = (Ax-b)^T(Ax-b): gradient f=2AT(Axb)\nabla f = 2A^T(Ax-b), so 2f=2ATA\nabla^2 f = 2A^TA; and ATA0A^TA \succeq 0 for any AA because zTATAz=Az220z^TA^TAz = \lVert Az\rVert_2^2 \ge 0 (track 2) — convex always;
    • quadratic-over-linear x2/yx^2/y (y>0y>0): partials fx=2x/yf_x = 2x/y, fy=x2/y2f_y = -x^2/y^2, then fxx=2/yf_{xx} = 2/y, fxy=2x/y2f_{xy} = -2x/y^2, fyy=2x2/y3f_{yy} = 2x^2/y^3, which assemble as 2f=2y3[y2xyxyx2]=2y3(yx)(yx)T0,\nabla^2 f = \frac{2}{y^3}\begin{bmatrix} y^2 & -xy \\ -xy & x^2 \end{bmatrix} = \frac{2}{y^3}\binom{y}{-x}\binom{y}{-x}^T \succeq 0, a rank-1 outer product scaled by 2/y3>02/y^3 > 0, hence PSD;
    • log-sum-exp logkexk\log\sum_k e^{x_k} (the smooth max\max): with zk=exkz_k = e^{x_k}, 2f=11Tzdiag(z)1(1Tz)2zzT\nabla^2 f = \tfrac{1}{\mathbf 1^Tz}\mathrm{diag}(z) - \tfrac{1}{(\mathbf 1^Tz)^2}zz^T, and

vT2fv=(kzkvk2)(kzk)(kvkzk)2(kzk)20v^T\nabla^2 f\,v = \frac{(\sum_k z_k v_k^2)(\sum_k z_k) - (\sum_k v_k z_k)^2}{(\sum_k z_k)^2} \ge 0

by Cauchy–Schwarz on the vectors zk\sqrt{z_k} and zkvk\sqrt{z_k}\,v_k — a genuine PSD proof, not an assertion.

  • The epigraph bridge — the keystone. epif={(x,t):f(x)t}\text{epi}\,f = \{(x,t): f(x) \le t\}, everything on/above the graph. Then

f convex    epif convex.f \text{ convex} \iff \text{epi}\,f \text{ convex}.

This welds §2 to §3: every fact about convex sets becomes a fact about convex functions and back. It is also the reformulation trick behind half of modeling — replace “minimize f(x)f(x)” by “minimize tt s.t. f(x)tf(x) \le t” (§4). (Sublevel sets {fα}\{f \le \alpha\} are convex too — but the converse fails, which is what makes quasiconvexity weaker.)

  • Jensen. Convexity is exactly f(θx+(1θ)y)θf(x)+(1θ)f(y)f(\theta x + (1-\theta)y) \le \theta f(x) + (1-\theta)f(y); the probabilistic form is f(Ez)Ef(z)f(E z) \le E f(z) — you pay more on the downside than you recover on the up. (Reappears as the certainty-equivalence bound, §6.)
  • The convexity calculus — atoms + operations. Never check the definition; decompose. Atoms: affine aTx+ba^Tx+b, any norm, max\max, exp\exp, log-\log, xlogxx\log x, log-sum-exp, quadratic-over-linear x2/yx^2/y, logdet\log\det (concave). Operations that preserve convexity, each with its signature use:
    • nonnegative weighted sum / integralwifi\sum w_i f_i, wi0w_i \ge 0;
    • affine precomposition f(Ax+b)f(Ax+b) — the log-barrier ilog(biaiTx)-\sum_i \log(b_i - a_i^Tx) (convex on the polyhedron interior, the engine of interior-point methods), and any norm of an affine map Axb\lVert Ax - b\rVert (the running example, convex for free);
    • pointwise max maxifi\max_i f_ipiecewise-linear maxi(aiTx+bi)\max_i(a_i^Tx + b_i), and the sum of the rr largest entries x[1]++x[r]=max{xi1++xir}x_{[1]} + \cdots + x_{[r]} = \max\{x_{i_1} + \cdots + x_{i_r}\} over index sets (a max of linear functions);
    • pointwise sup g(x)=supyf(x,y)g(x) = \sup_{y} f(x,y) — convex because epig=yepif(,y)\text{epi}\,g = \bigcap_y \text{epi}\,f(\cdot,y) (epigraph bridge). The support function SC(x)=supyCyTxS_C(x) = \sup_{y\in C} y^Tx, the distance to the farthest point of a set, and λmax(X)=supy2=1yTXy\lambda_{\max}(X) = \sup_{\lVert y\rVert_2=1} y^TXy (a sup of linear-in-XX functions — that’s why max-eigenvalue is convex);
    • composition h(g(x))h(g(x)): convex if (hh convex ↑, gg convex) or (hh convex ↓, gg concave) — read it off the chain rule h(g)g2+h(g)gh''(g)\,g'^2 + h'(g)\,g'';
    • partial minimization infyCf(x,y)\inf_{y\in C} f(x,y) convex if ff is jointly convex and CC convex (Schur-complement minimization is the classic instance — minimizing a joint quadratic over yy leaves the Schur complement in xx);
    • perspective tf(x/t)t\,f(x/t) (t>0t>0) — cone-ifies ff;
    • conjugate f(y)=supx(yTxf(x))f^*(y) = \sup_{x}(y^Tx - f(x)) — convex even if ff isn’t (a sup of affine functions of yy); the biconjugate ff^{**} is the convex envelope (largest convex underestimator). Worked: negative entropy f(x)=ixilogxif(x) = \sum_i x_i\log x_i has conjugate f(y)=ieyi1f^*(y) = \sum_i e^{y_i - 1} — the term that makes the entropy-maximization dual closed-form (§5).
  • Quasiconvex (weaker): all sublevel sets {fα}\{f \le \alpha\} are convex (but ff itself need not be) — e.g. x\sqrt{|x|}, the linear-fractional (cTx+d)/(eTx+f)(c^Tx+d)/(e^Tx+f), internal rate of return. Optimized by bisection on α\alpha (a convex feasibility problem at each threshold), not in one shot. Log-concave (logf\log f concave): Gaussian densities, CDFs — and preserved under products and (crucially) marginalization/convolution, the reason many statistical likelihoods stay tractable.

Implications

  • The atom-list + operation-list is the subject’s working skill; the rest of modeling is pattern-matching your objective to it, never invoking the definition.
  • The conjugate is the analytic engine of duality (§5) — the dual function literally is a conjugate of the objective.
  • Sup-of-convex is convex but inf is not (unless jointly convex) — the asymmetry is why worst-case robustness (§6) is the hard direction and partial-minimization needs joint convexity.

Core competency set

  • Use the line test (log-det example); state FOC (global underestimator) and SOC.
  • Prove log-sum-exp convex via the Cauchy–Schwarz Hessian argument; prove ff convex     \iff epi ff convex and use it for pointwise sup.
  • Recite the atoms and operations with a signature example each; give the composition rule and the negative-entropy conjugate.
  • Define quasiconvex (sublevel sets) + bisection, and log-concave + what it survives.

4. Convex problems and the hierarchy

  • Standard form: minimize f0(x)f_0(x) s.t. fi(x)0f_i(x) \le 0 (i=1..mi=1..m), hi(x)=0h_i(x) = 0 (i=1..pi=1..p). It is a convex problem when f0,fif_0, f_i are convex and the equalities are affine (Ax=bAx = b) — then the feasible set is convex and (§1) every local optimum is global.
  • Optimality condition (differentiable f0f_0): xx is optimal iff feasible and

f0(x)T(yx)0for all feasible y\nabla f_0(x)^T(y - x) \ge 0 \quad \text{for all feasible } y

— the negative gradient points out of the feasible set; you can’t descend without leaving. Unconstrained, this is f0(x)=0\nabla f_0(x) = 0.

  • Equivalent reformulations (solve one, recover the other) — the modeling toolkit:
    • epigraph: mint\min t s.t. f0(x)tf_0(x) \le t (the bridge from §3) — turns any objective into a linear one with one extra constraint;
    • slack variables: aiTxbiaiTx+si=bi, si0a_i^Tx \le b_i \rightsquigarrow a_i^Tx + s_i = b_i,\ s_i \ge 0;
    • eliminate equalities: Ax=bx=Fz+x0Ax = b \rightsquigarrow x = Fz + x_0 with range(F)=N(A)\text{range}(F) = \mathcal N(A);
    • introduce variables / partial-minimize to expose structure.
  • The hierarchy — each class contains the previous; modeling is recognizing (or transforming to) the lowest one that holds your problem.

Linear program (LP)mincTx\min c^Tx s.t. Gxh, Ax=bGx \preceq h,\ Ax = b. The feasible set is a polyhedron; the level sets of cTxc^Tx are parallel hyperplanes, so you slide the c-c hyperplane across the polyhedron until it last touches — the optimum sits at a vertex.

  • Diet problem (the archetype): cheapest food mix meeting nutrient floors, mincTx\min c^Tx s.t. Axb, x0Ax \succeq b,\ x \succeq 0.
  • Piecewise-linear minimization minmaxi(aiTx+bi)\min \max_i(a_i^Tx + b_i) is not linear — but epigraph-ize the max: mint\min t s.t. aiTx+bita_i^Tx + b_i \le t, an LP. (This is precisely how L1L_1 and LL_\infty norm approximation of the running example become LPs.)
  • Chebyshev center — the gem. Find the largest ball {xc+u:u2r}\{x_c + u : \lVert u\rVert_2 \le r\} inscribed in a polyhedron {aiTxbi}\{a_i^Tx \le b_i\}. “Maximize the inscribed radius” looks nonlinear, but the ball lies in halfspace ii iff its worst (deepest-into-the-constraint) point does. Split the sup off the constant term:

supu2raiT(xc+u)=aiTxc+supu2raiTu.\sup_{\lVert u\rVert_2 \le r} a_i^T(x_c + u) = a_i^Tx_c + \sup_{\lVert u\rVert_2 \le r} a_i^Tu.

The inner sup is maximized at u=rai/ai2u = r\,a_i/\lVert a_i\rVert_2 (Cauchy–Schwarz), giving rai2r\lVert a_i\rVert_2, so the halfspace constraint becomes

aiTxc+rai2bi,a_i^Tx_c + r\lVert a_i\rVert_2 \le b_i,

linear in (xc,r)(x_c, r) — so maxr\max r s.t. these constraints is an LP. Recognizing the linear problem hiding under a geometric description is the whole skill.

  • Linear-fractional min(cTx+d)/(eTx+f)\min (c^Tx+d)/(e^Tx+f) is quasiconvex (bisection), but homogenizes to an exact LP: set y=x/(eTx+f)y = x/(e^Tx+f), z=1/(eTx+f)z = 1/(e^Tx+f), giving mincTy+dz\min c^Ty + dz s.t. GyhzGy \preceq hz, Ay=bzAy = bz, eTy+fz=1e^Ty + fz = 1, z0z \ge 0.

Quadratic program (QP)min12xTPx+qTx+r\min \tfrac12 x^TPx + q^Tx + r s.t. Gxh, Ax=bGx \preceq h,\ Ax = b, with P0P \succeq 0 (the bowl). Minimize a convex quadratic over a polyhedron; the objective’s sublevel sets are ellipsoids, and the optimum is where the smallest ellipsoid touches the polyhedron.

  • Least squares is the unconstrained QP, minAxb22\min \lVert Ax - b\rVert_2^2, with the analytic solution x=Abx^\star = A^\dagger b (track 2/4) — and the QP framework lets you add what OLS can’t handle: box bounds lxul \preceq x \preceq u, ordering (isotonic regression), nonnegativity.
  • Markowitz mean–variance (the archetype): with random cost cc (mean cˉ\bar c, covariance Σ\Sigma), cTxc^Tx has mean cˉTx\bar c^Tx and variance xTΣxx^T\Sigma x, so

min cˉTx+γxTΣx=E[cTx]+γVar(cTx)\min\ \bar c^Tx + \gamma\, x^T\Sigma x = E[c^Tx] + \gamma\,\mathrm{Var}(c^Tx)

trades expected cost against risk, γ>0\gamma > 0 the risk-aversion dial. The L2L_2 version of the running example lives here.

QCQP — convex-quadratic constraints too, 12xTPix+qiTx+ri0\tfrac12 x^TP_ix + q_i^Tx + r_i \le 0 (Pi0P_i \succeq 0): the feasible set is an intersection of ellipsoids with an affine set.

Second-order cone program (SOCP)minfTx\min f^Tx s.t. Aix+bi2ciTx+di\lVert A_ix + b_i\rVert_2 \le c_i^Tx + d_i (norm \le affine, not squared). Setting ci=0c_i = 0 recovers a QCQP; Ai=0A_i = 0 recovers an LP — so SOCP strictly generalizes both. Robust LP with ellipsoidal data uncertainty lands exactly here (§6).

Geometric program (GP) — minimize a posynomial (sum of monomials cx1a1xnanc\,x_1^{a_1}\cdots x_n^{a_n}, c>0c > 0, any real exponents) s.t. posynomials 1\le 1, monomials =1= 1. Not convex as written — but substitute yi=logxiy_i = \log x_i and take logs: a monomial becomes affine aTy+ba^Ty + b, a posynomial becomes log-sum-exp of affine, both convex. The cantilever-beam design (minimize weight s.t. bounds on stress, deflection, aspect ratio) is the archetype — weight and stress are posynomials/monomials in the segment dimensions.

Semidefinite program (SDP) — the variable enters a linear matrix inequality ixiFiG\sum_i x_iF_i \preceq G (Fi,GF_i, G symmetric), objective cTxc^Tx. Top of the everyday hierarchy.

  • Eigenvalue minimization: minλmax(A(x))\min \lambda_{\max}(A(x)), A(x)=A0+ixiAiA(x) = A_0 + \sum_i x_iA_i — use λmax(A)t    AtI\lambda_{\max}(A) \le t \iff A \preceq tI to get mint\min t s.t. A(x)tIA(x) \preceq tI, an SDP.
  • Everything is an SDP (the containment chain made concrete): an LP is mincTx\min c^Tx s.t. diag(Axb)0\mathrm{diag}(Ax-b) \preceq 0 (a diagonal LMI); an SOCP constraint Ax+b2cTx+d\lVert Ax+b\rVert_2 \le c^Tx+d is the LMI [(cTx+d)IAx+b(Ax+b)TcTx+d]0\begin{bmatrix} (c^Tx+d)I & Ax+b \\ (Ax+b)^T & c^Tx+d \end{bmatrix} \succeq 0 (Schur complement). So LP ⊂ QP ⊂ QCQP ⊂ SOCP ⊂ SDP is a true nesting — each solvable as the next, the price being a slower solver.
  • Quasiconvex problems (quasiconvex objective, convex constraints) are solved by bisection — at each candidate value tt, the sublevel set is convex, so check feasibility; log2((ul)/ϵ)\lceil\log_2((u-l)/\epsilon)\rceil iterations (e.g. bounds ul=1u - l = 1, tolerance ϵ=103\epsilon = 10^{-3}: log21000=10\lceil\log_2 1000\rceil = 10 feasibility solves).
  • Picture to hold: the objective’s level sets are nested contours; slide to the lowest one still touching the feasible set. At the touch point the contour’s normal f0\nabla f_0 points back into the set — which is exactly f0(x)T(yx)0\nabla f_0(x)^T(y-x) \ge 0.

Implications

  • “Which class?” is the central modeling question: the lower the class, the faster and more reliable the solver, so transform down (the running example shows one problem taking different classes by norm choice).
  • The epigraph reformulation is the universal move — it linearizes objectives and is why “minimize tt s.t. …” appears everywhere.

Core competency set

  • Write standard form and the variational optimality condition f0(x)T(yx)0\nabla f_0(x)^T(y-x)\ge0.
  • Reformulate via epigraph / slack / equality-elimination.
  • Build the hierarchy LP ⊂ QP ⊂ QCQP ⊂ SOCP ⊂ SDP with the form + geometry of each; sort L1/L2/LL_1/L_2/L_\infty approximation by class.
  • Reproduce the gems: piecewise-linear → epigraph → LP; the Chebyshev-center sup-derivation; Markowitz mean–variance QP; eigenvalue-min and LP/SOCP-as-SDP (diag / Schur). State bisection for quasiconvex.

5. Duality — the keystone

Constraints are inconvenient; price them instead of enforcing them. This one idea pays off four ways: it bounds, certifies, prices, and robustifies.

  • The Lagrangian folds constraints into the objective with prices λi0\lambda_i \ge 0 (inequalities) and νi\nu_i (equalities):

L(x,λ,ν)=f0(x)+iλifi(x)+iνihi(x).L(x, \lambda, \nu) = f_0(x) + \sum_i \lambda_i f_i(x) + \sum_i \nu_i h_i(x).

(λi\lambda_i is the charge for violating fi0f_i \le 0; you’re subsidized for slack. Sign convention matters — write constraints as fi0f_i \le 0 so λi0\lambda_i \ge 0.)

  • The dual function minimizes out xx: g(λ,ν)=infxL(x,λ,ν)g(\lambda, \nu) = \inf_x L(x,\lambda,\nu). It is concave always (an infimum of functions affine in (λ,ν)(\lambda,\nu)), even when the primal is non-convex — and it is built from conjugates, gg involves f0()-f_0^*(\cdot).
  • Weak duality — bound. Derive it. Take any feasible xx and any λ0,ν\lambda \succeq 0, \nu. Since gg is an infimum over xx', it is below LL at this particular xx:

g(λ,ν)=infxL(x,λ,ν)L(x,λ,ν).g(\lambda,\nu) = \inf_{x'} L(x',\lambda,\nu) \le L(x,\lambda,\nu).

Expand LL and sign the two penalty terms — λifi(x)0\lambda_i f_i(x) \le 0 (λi0\lambda_i\ge0, fi0f_i\le0) and νihi(x)=0\nu_i h_i(x) = 0 (hi=0h_i = 0):

L(x,λ,ν)=f0(x)+iλifi(x)0+iνihi(x)=0f0(x).L(x,\lambda,\nu) = f_0(x) + \underbrace{\textstyle\sum_i \lambda_i f_i(x)}_{\le\,0} + \underbrace{\textstyle\sum_i \nu_i h_i(x)}_{=\,0} \le f_0(x).

Chaining, g(λ,ν)f0(x)g(\lambda,\nu) \le f_0(x) for every feasible xx; take the inf over feasible xx: g(λ,ν)pg(\lambda,\nu) \le p^\star. Every dual value is a lower bound on the primal optimum — for any problem, convex or not. The best bound is the dual problem maxλ0,νg\max_{\lambda \succeq 0,\nu} g, itself always convex. Picture to hold: each price vector (λ,ν)(\lambda,\nu) lays a horizontal floor g(λ,ν)g(\lambda,\nu) under pp^\star; the dual problem raises the highest floor, and under Slater the floor reaches the ceiling — the gap closes.

  • Worked dual functions (the bound made concrete — each derivation is “form LL, minimize out xx, read off gg”):
    • Least-norm of linear equations minxTx\min x^Tx s.t. Ax=bAx = b. L=xTx+νT(Axb)L = x^Tx + \nu^T(Ax - b); set xL=2x+ATν=0x=12ATν\nabla_x L = 2x + A^T\nu = 0 \Rightarrow x = -\tfrac12 A^T\nu; substitute back:

g(ν)=14νTAATνbTν,g(\nu) = -\tfrac14 \nu^TAA^T\nu - b^T\nu,

a concave quadratic, giving pg(ν)p^\star \ge g(\nu) for every ν\nu (useful as a stopping certificate for iterative solvers).

  • Standard-form LP mincTx\min c^Tx s.t. Ax=b, x0Ax = b,\ x \succeq 0. L=bTν+(c+ATνλ)TxL = -b^T\nu + (c + A^T\nu - \lambda)^Tx is affine in xx, so infxL=\inf_x L = -\infty unless the xx-coefficient vanishes:

g(λ,ν)={bTνATνλ+c=0otherwiseg(\lambda,\nu) = \begin{cases} -b^T\nu & A^T\nu - \lambda + c = 0 \\ -\infty & \text{otherwise}\end{cases}

— finite only on an affine set, hence concave. Making that implicit constraint explicit, the dual of an LP is another LP: maxbTν\max -b^T\nu s.t. ATν+c0A^T\nu + c \succeq 0.

  • Norm minimization minx\min \lVert x\rVert s.t. Ax=bAx = b: g(ν)=bTνg(\nu) = b^T\nu if ATν1\lVert A^T\nu\rVert_* \le 1, else -\infty, where \lVert\cdot\rVert_* is the dual norm — because infx(xyTx)=0\inf_x(\lVert x\rVert - y^Tx) = 0 when y1\lVert y\rVert_* \le 1 and -\infty otherwise.
  • The dual function is a conjugate. For minf0(x)\min f_0(x) s.t. Axb, Cx=dAx \preceq b,\ Cx = d,

g(λ,ν)=f0(ATλCTν)bTλdTν,g(\lambda,\nu) = -f_0^*(-A^T\lambda - C^T\nu) - b^T\lambda - d^T\nu,

so once you know the conjugate f0f_0^* (§3) the dual is automatic — e.g. entropy maximization plugs in f0(y)=ieyi1f_0^*(y) = \sum_i e^{y_i-1}. The dual is the objective’s conjugate, evaluated at the constraint-transformed prices.

  • Geometric interpretation — why duality works (the deep picture). Plot the achievable (constraint, objective) pairs G={(f1(x),f0(x)):xD}\mathcal G = \{(f_1(x), f_0(x)) : x \in \mathcal D\} in the (u,t)(u,t) plane (one inequality, for drawing). Then p=inf{t:(u,t)G, u0}p^\star = \inf\{t : (u,t)\in\mathcal G,\ u \le 0\}, and the dual value is

g(λ)=inf(u,t)G(t+λu),g(\lambda) = \inf_{(u,t)\in\mathcal G}\,(t + \lambda u),

the lowest intercept of the line λu+t=g(λ)\lambda u + t = g(\lambda) — a non-vertical supporting hyperplane of G\mathcal G with slope λ-\lambda, read where it crosses the tt-axis (u=0u = 0). Raising λ0\lambda \ge 0 tilts the line up to the highest intercept dd^\star. So: strong duality = there is a non-vertical supporting hyperplane to (the epigraph of) G\mathcal G at (0,p)(0, p^\star). For a convex problem that boundary is convex, so the hyperplane exists; and Slater — a point with u<0u < 0 — is exactly what forces it to be non-vertical, closing the gap. The multipliers are the slopes of that supporting hyperplane, tying duality back to §2’s hyperplanes.

  • Strong duality — the gap closes. dpd^\star \le p^\star always (weak); d=pd^\star = p^\star (no gap) holds for convex problems under a constraint qualificationSlater’s: a strictly feasible point exists (fi(x)<0f_i(x) < 0, equalities met). LPs have strong duality whenever feasible. Duality is bigger than convexity: some non-convex problems (the trust-region subproblem minxTAx+2bTx\min x^TAx + 2b^Tx s.t. xTx1x^Tx \le 1, A⪰̸0A \not\succeq 0) still have zero gap, and the dual of the non-convex two-way partitioning minxTWx\min x^TWx s.t. xi2=1x_i^2 = 1 gives the bound pnλmin(W)p^\star \ge n\lambda_{\min}(W) — a free certificate from an SDP dual.
  • Complementary slackness — derive it. Assume strong duality, xx^\star and (λ,ν)(\lambda^\star,\nu^\star) optimal. Run the weak-duality chain at equality:

f0(x)=g(λ,ν)L(x,λ,ν)=f0(x)+iλifi(x)f0(x).f_0(x^\star) = g(\lambda^\star,\nu^\star) \le L(x^\star,\lambda^\star,\nu^\star) = f_0(x^\star) + \sum_i \lambda_i^\star f_i(x^\star) \le f_0(x^\star).

Every "\le" is an equality, so iλifi(x)=0\sum_i \lambda_i^\star f_i(x^\star) = 0; each term is 0\le 0, so each is zero: λifi(x)=0\lambda_i^\star f_i(x^\star) = 0. A constraint is either tight (fi=0f_i = 0) or unpriced (λi=0\lambda_i = 0).

  • KKT conditions — certify. At a primal–dual optimum (with strong duality) all four hold: (1) primal feasibility fi(x)0, hi(x)=0f_i(x)\le0,\ h_i(x)=0; (2) dual feasibility λ0\lambda \succeq 0; (3) complementary slackness λifi(x)=0\lambda_i f_i(x)=0; (4) stationarity f0(x)+iλifi(x)+iνihi(x)=0\nabla f_0(x) + \sum_i \lambda_i \nabla f_i(x) + \sum_i \nu_i \nabla h_i(x) = 0. For convex problems the converse holds — KKT ⟹ optimal: stationarity makes xx minimize L(,λ,ν)L(\cdot,\lambda,\nu) so g(λ,ν)=L(x,λ,ν)g(\lambda,\nu) = L(x,\lambda,\nu), and CS makes L(x,λ,ν)=f0(x)L(x,\lambda,\nu) = f_0(x); hence f0(x)=g(λ,ν)f_0(x) = g(\lambda,\nu) and weak duality says xx is optimal. KKT is the optimality certificate solvers return.
  • KKT in action — water-filling (the worked example to know cold). minilog(xi+αi)\min -\sum_i \log(x_i + \alpha_i) s.t. x0, 1Tx=1x \succeq 0,\ \mathbf 1^Tx = 1 (αi>0\alpha_i > 0). Stationarity, dual feasibility, complementary slackness: 1xi+αiλi+ν=0-\tfrac{1}{x_i + \alpha_i} - \lambda_i + \nu = 0, λi0\lambda_i \ge 0, λixi=0\lambda_i x_i = 0. Casework on whether xi>0x_i > 0 collapses to

xi=max{0, 1/ναi},ν fixed by imax{0, 1/ναi}=1.x_i = \max\{0,\ 1/\nu - \alpha_i\}, \qquad \nu \text{ fixed by } \textstyle\sum_i \max\{0,\ 1/\nu - \alpha_i\} = 1.

Picture: the αi\alpha_i are floor heights of nn patches; pour one unit of water and it floods to a common level 1/ν1/\nu — patches poking above the waterline get xi=0x_i = 0. The dual variable ν\nu is the water level. (This is how power is allocated across parallel communication channels.)

  • Numeric anchor: α=(0.2, 0.5, 1.5)\alpha = (0.2,\ 0.5,\ 1.5). Try flooding all three patches, so xi=1/ναix_i = 1/\nu - \alpha_i and the budget ixi=1\sum_i x_i = 1 reads i(1/ναi)=1\sum_i(1/\nu - \alpha_i) = 1. With iαi=2.2\sum_i\alpha_i = 2.2 this is 3/ν2.2=13/\nu - 2.2 = 1, so 3/ν=3.23/\nu = 3.2 and 1/ν=3.2/31.071/\nu = 3.2/3 \approx 1.07. But 1.07<α3=1.51.07 < \alpha_3 = 1.5 would give x3<0x_3 < 0 — patch 3 is above water; drop it and re-solve on {1,2}\{1,2\}: 2/ν(0.2+0.5)=12/\nu - (0.2+0.5) = 1, so 2/ν=1.72/\nu = 1.7 and 1/ν=0.851/\nu = 0.85. Now 0.85<1.50.85 < 1.5 (3 stays dry) and >0.5,0.2> 0.5, 0.2 (1,2 wet). Allocation x=(0.65, 0.35, 0)x = (0.65,\ 0.35,\ 0), water level 1/ν=0.851/\nu = 0.85 — the active set found by the same drop-and-recheck the KKT casework prescribes.
  • Sensitivity — price. Perturb the constraints to fiuif_i \le u_i, hi=vih_i = v_i; the optimal value p(u,v)p^\star(u,v) satisfies the local shadow-price relation

λi=pui,νi=pvi.\lambda_i^\star = -\frac{\partial p^\star}{\partial u_i}, \qquad \nu_i^\star = -\frac{\partial p^\star}{\partial v_i}.

A big λi\lambda_i^\star means tightening constraint ii hurts a lot; a slack constraint has λi=0\lambda_i^\star = 0 (CS, read as sensitivity). The multipliers are exactly the supporting-hyperplane slopes of §2.

Implications

  • The four dividends are one idea: weak duality (bound) → strong duality (the bound is tight) → KKT (a checkable certificate) → shadow prices (what the constraints cost). This is the connective tissue of the whole field.
  • Even for non-convex problems the dual gives a free lower bound and is convex — which is why hard combinatorial problems (two-way partitioning) get SDP-relaxation bounds from their duals.
  • KKT specializes to everything you’ve seen: OLS normal equations, ridge, the lasso soft-threshold and its active-set xj,r=λ|\langle x_j, r\rangle| = \lambda (track 6), the SVM support vectors (track 6) — all are KKT systems.

Core competency set

  • Write the Lagrangian and dual function; argue gg is concave; derive at least one worked dual (least-norm or LP) by “minimize out xx, read off gg.”
  • State the dual-as-conjugate formula; draw the G\mathcal G-set geometric interpretation and say what strong duality / Slater mean on it.
  • Derive weak duality (the two-inequality chain) and complementary slackness (the sandwich).
  • State the four KKT conditions, that KKT ⟺ optimal for convex problems, and solve water-filling; state the shadow-price reading of λ\lambda^\star.

6. Recognizing convex problems in the wild

The skill that makes the theory pay: take a messy real problem and reveal/transform it into a convex program in the hierarchy.

Maximum likelihood

  • MLE maximizes (x)=logpx(y)\ell(x) = \log p_x(y); it’s a convex problem whenever the log-likelihood is concave in the parameters. iid data factorizes it into a sum, (x)=ilogp(yiaiTx)\ell(x) = \sum_i \log p(y_i - a_i^Tx) for the linear-measurement model yi=aiTx+viy_i = a_i^Tx + v_i.
  • Gaussian noiseAxb22\ell \propto -\lVert Ax - b\rVert_2^2 ⟹ MLE is least squares (a QP). The running example is the Gaussian MLE.
  • Poisson counts (yiPois(aiTx)y_i \sim \text{Pois}(a_i^Tx)): (x)=iyilog(aiTx)iaiTx\ell(x) = \sum_i y_i \log(a_i^Tx) - \sum_i a_i^Tx — concave (log\log is), maximize s.t. aiTx0a_i^Tx \ge 0.
  • Logistic: (a,b)=yT(Ua+b1)ilog(1+eaTui+b)\ell(a,b) = y^T(Ua + b\mathbf 1) - \sum_i \log(1 + e^{a^Tu_i + b}) — affine minus log-sum-exp, hence concave (track 6’s logistic regression, now seen as a convex program with a unique optimum). The ML-classification view: sign(aTxi+b)=yi\text{sign}(a^Tx_i+b) = y_i is non-convex, but maximizing the margin yi(aTxi+b)y_i(a^Tx_i+b) and applying any nonincreasing convex ϕ\phi gives the convex surrogate miniϕ(yi(aTxi+b))\min \sum_i \phi(y_i(a^Tx_i+b))ϕ(t)=log(1+et)\phi(t)=\log(1+e^{-t}) recovers logistic, the hinge recovers the SVM (track 6).

Norm approximation, regularization, and the dual’s residual story

  • Choosing the norm in minAxb\min\lVert Ax-b\rVert chooses the penalty on residuals, and the dual reveals where residuals concentrate. For the L1L_1 problem, the dual condition is νi1|\nu_i| \le 1 with the minimizer of riνiri|r_i| - \nu_i r_i forcing ri=0r_i = 0 unless νi=1|\nu_i| = 1 — so L1L_1 approximation drives many residuals exactly to zero (sparse residuals), the same KKT mechanism as lasso’s sparse coefficients (track 6). Penalty shape is a modeling decision: dead-zone ignores small errors, log-barrier forbids large ones.
  • Regularized approximation is bi-objective (Axb,x)(\lVert Ax-b\rVert, \lVert x\rVert), scalarized to minAxb+γx\min \lVert Ax-b\rVert + \gamma\lVert x\rVert; sweeping γ>0\gamma>0 traces the optimal tradeoff curve. Tikhonov Axb22+δx22\lVert Ax-b\rVert_2^2 + \delta\lVert x\rVert_2^2 is ridge (track 4), 1\lVert\cdot\rVert_1 regularization is lasso — the convex-optimization view of the penalty-as-prior dictionary (track 7).

Robust optimization — where duality earns its keep

  • Data AA is uncertain in a set U\mathcal U; worst-case robustness minimizes supAUAxb\sup_{A\in\mathcal U}\lVert Ax-b\rVert — an infinite family of constraints, one per uUu\in\mathcal U. The constraint set is still convex (intersection of convex sets), but you make it solvable by dualizing the inner sup into a finite program.
  • Robust LP stays an LP under box uncertainty. Require (a+u)Txb(a+u)^Tx \le b for all uδ\lVert u\rVert_\infty \le \delta; the binding case is the worst uu, which maximizes uTx=iuixiu^Tx = \sum_i u_i x_i. The box decouples across coordinates, and each uiδ|u_i| \le \delta independently picks ui=δsign(xi)u_i = \delta\,\mathrm{sign}(x_i):

supuδuTx=isupuiδuixi=iδxi=δx1.\sup_{\lVert u\rVert_\infty \le \delta} u^Tx = \sum_i \sup_{|u_i|\le\delta} u_i x_i = \sum_i \delta|x_i| = \delta\lVert x\rVert_1.

So the robust constraint is aTx+δx1ba^Tx + \delta\lVert x\rVert_1 \le b, still linear-representable: introduce tit_i with tixiti-t_i \le x_i \le t_i and use δ1Tt\delta\mathbf 1^Tt — the L1L_1 term epigraph-izes into an LP. For ellipsoidal uncertainty u=Pz, z21u = Pz,\ \lVert z\rVert_2 \le 1, the same sup is supz21zTPTx=PTx2\sup_{\lVert z\rVert_2\le1} z^TP^Tx = \lVert P^Tx\rVert_2, so the constraint reads aTx+PTx2ba^Tx + \lVert P^Tx\rVert_2 \le b — a norm \le affine, i.e. an SOCP (a general norm ball gives the dual norm PTx\lVert P^Tx\rVert_*). Numeric feel: a manufacturing LP that loses most of its profit under a tiny data perturbation becomes, robustified, provably no worse than ~6% off the nominal optimum — a small price for guaranteed feasibility, bought entirely with the dual reformulation. Polyhedral uncertainty {u:Fu+g0}\{u: Fu+g\succeq0\} needs the Lagrange dual of the inner max: supu{xTu:Fu+g0}\sup_u\{x^Tu : Fu+g\succeq0\} becomes min{λTg:FTλ+x=0, λ0}\min\{\lambda^Tg : F^T\lambda + x = 0,\ \lambda\succeq0\}, turning u\forall u into finitely many linear constraints.

  • Robust LS = regularized LS. With A=Aˉ+UA = \bar A + U, UU random mean-zero covariance PP:

E(Aˉ+U)xb22=Aˉxb22+xTPx=Aˉxb22+P1/2x22.E\lVert(\bar A + U)x - b\rVert_2^2 = \lVert\bar Ax - b\rVert_2^2 + x^TPx = \lVert\bar Ax-b\rVert_2^2 + \lVert P^{1/2}x\rVert_2^2.

Robustness is Tikhonov regularization — and worst-case robust LS climbs to an SDP. The standing lesson: robustness moves you up the hierarchy (LP→SOCP→SDP), and duality is the vehicle.

Stochastic programming

  • Objective/constraints depend on xx and a random ww; minimize F0(x)=Ef0(x,w)F_0(x) = E\,f_0(x,w) s.t. Efi(x,w)0E\,f_i(x,w) \le 0. If each ff is convex in xx for every ww, then FF is convex (linearity of expectation preserves it) — a convex problem, though usually without closed form.
  • Certainty equivalence ignores noise, using w=Eww = E w. Jensen bounds the error: fi(x,Ew)Efi(x,w)f_i(x, E w) \le E f_i(x, w) for fif_i convex in ww — the mean-field problem under-states the true (stochastic) optimum.
  • Chance/violation constraints: replace "Efi0E f_i \le 0" with Prob(fi(x,w)0)η\text{Prob}(f_i(x,w) \le 0) \ge \eta or a penalty on the violation E(maxifi)+ϵE(\max_i f_i)_+ \le \epsilon — sometimes convex (SOCP for Gaussian linear constraints).
  • Monte Carlo sample-average approximation F^i(x)=jπjfi(x,wj)\hat F_i(x) = \sum_j \pi_j f_i(x, w_j) replaces the expectation by samples. Solution and value are random; as NN\to\infty they converge — but with a downward (optimistic) bias, EF^0(xmcs)pE\,\hat F_0(x^\star_{\text{mcs}}) \le p^\star, since E[min]min[E]E[\min] \le \min[E]. Validate out of sample (the firewall principle, track 6).

Optimal detector & experiment design (vector/SDP applications)

  • Detector design: choose a randomized detector TT (columns are choice probabilities) to trade off false-positive vs false-negative rates — a vector objective; scalarize by λ\lambda and recover the Neyman–Pearson likelihood-ratio test analytically, or minimize the worst error as an LP.
  • Experiment design: mm noisy measurements yi=aiTx+wiy_i = a_i^Tx + w_i give estimator error covariance E=(iaiaiT)1E = (\sum_i a_i a_i^T)^{-1}; choosing the aia_i to make EE “small” (in the S+n\preceq_{S^n_+} order) is an SDP — diversity of measurements (a larger aiaiT\sum a_ia_i^T) shrinks the error.

Implications

  • Every application is the same move: find the convex program underneath, then place it on the hierarchy. MLE concavity, regularization-as-prior, and robust-LS-as-Tikhonov all unify stats/ML methods you met elsewhere under one optimization roof.
  • Duality is not just theory: it’s the concrete tool that converts a sup-over-uncertainty (infinite constraints) into a finite SOCP/SDP — the workhorse of robust optimization.

Core competency set

  • Show Gaussian/Poisson/logistic MLE are concave and place each in the hierarchy; give the margin-surrogate view of classification.
  • Explain the L1L_1 dual’s sparse-residual story and regularization-as-scalarization (ridge/lasso/Tikhonov).
  • Derive robust-LP-box → δx1\delta\lVert x\rVert_1 and robust-LS → Tikhonov; state “robustness climbs the hierarchy via duality.”
  • State certainty-equivalence (Jensen bound) and the MC downward bias.

7. Memorize cold

  • Convex set: segment stays in; convex function: chords above, f(θx+(1θ)y)θf(x)+(1θ)f(y)f(\theta x + (1-\theta)y) \le \theta f(x) + (1-\theta)f(y).
  • Local = global for convex (segment-contradiction proof); FOC global underestimator f(y)f(x)+f(x)T(yx)f(y) \ge f(x) + \nabla f(x)^T(y-x); SOC 2f0\nabla^2 f \succeq 0.
  • Epigraph bridge: ff convex     \iff epi ff convex; minimize-tt-s.t.-ftf\le t reformulation.
  • Convexity-preserving ops (functions): nonneg sum, affine precomp, pointwise sup (epigraph intersection), composition rule, partial min (jointly convex), perspective, conjugate f(y)=supx(yTxf(x))f^*(y)=\sup_x(y^Tx - f(x)).
  • Affine/convex/conic = the θ\theta knob (sum-1 any-sign / sum-1 nonneg / nonneg). Zoo: halfspace, ellipsoid {xc+Au}\{x_c + Au\}, norm cone, polyhedron, PSD cone {zTXz0}\{z^TXz\ge0\}.
  • Convexity-preserving ops (sets): intersection (even infinite), affine image/preimage, perspective x/tx/t, linear-fractional. Separating hyperplane (disjoint convex → aa separates); supporting hyperplane (convex → one at every boundary point) = the seed of duality.
  • Proper cone (convex/closed/solid/pointed) → K\preceq_K (not total); dual cone K={y:yTx0xK}K^* = \{y: y^Tx\ge0\,\forall x\in K\}; R+n,S+n\mathbb R^n_+, S^n_+ self-dual, (L1,L)(L_1,L_\infty) dual. Minimum (beats all; unique-min of every λTz\lambda^Tz) vs minimal (nothing below; minimizes some λTz\lambda^Tz) → scalarization/Pareto.
  • Hierarchy LP ⊂ QP/QCQP ⊂ SOCP (Ax+b2cTx+d\lVert Ax+b\rVert_2 \le c^Tx+d) ⊂ SDP (xiFiG\sum x_iF_i \preceq G); GP convex after log\log; quasiconvex by bisection.
  • LP gems: piecewise-linear minmaxi(aiTx+bi)\min\max_i(a_i^Tx+b_i) → epigraph → LP; Chebyshev center aiTxc+rai2bia_i^Tx_c + r\lVert a_i\rVert_2 \le b_i. QP gems: least squares = unconstrained QP; Markowitz mincˉTx+γxTΣx\min \bar c^Tx + \gamma x^T\Sigma x. SDP: λmax(A)t    AtI\lambda_{\max}(A) \le t \iff A \preceq tI; LP/SOCP as SDP via diag / Schur.
  • Optimality (diff’able): f0(x)T(yx)0 \nabla f_0(x)^T(y-x) \ge 0\ \forall feasible yy; unconstrained f0=0\nabla f_0 = 0.
  • Lagrangian L=f0+λifi+νihiL = f_0 + \sum\lambda_i f_i + \sum\nu_i h_i; dual g=infxLg = \inf_x L is concave always; g=f0(ATλCTν)bTλdTνg = -f_0^*(-A^T\lambda - C^T\nu) - b^T\lambda - d^T\nu (dual = conjugate). Worked: least-norm g(ν)=14νTAATνbTνg(\nu) = -\tfrac14\nu^TAA^T\nu - b^T\nu; LP dual is an LP maxbTν\max -b^T\nu s.t. ATν+c0A^T\nu + c \succeq 0; norm-min needs ATν1\lVert A^T\nu\rVert_* \le 1.
  • Weak duality g(λ,ν)pg(\lambda,\nu) \le p^\star (always); strong d=pd^\star = p^\star under Slater (strict feasibility); gap pdp^\star - d^\star. Geometric: g(λ)g(\lambda) = tt-intercept of a non-vertical supporting hyperplane (slope λ-\lambda) of G={(f1,f0)}\mathcal G = \{(f_1, f_0)\}; strong duality = such a hyperplane at (0,p)(0, p^\star), Slater forces non-vertical.
  • Complementary slackness λifi(x)=0\lambda_i^\star f_i(x^\star) = 0 (tight or unpriced). KKT = primal feas + dual feas + CS + stationarity f0+λifi+νihi=0\nabla f_0 + \sum\lambda_i\nabla f_i + \sum\nu_i\nabla h_i = 0; for convex problems KKT ⟺ optimal. Water-filling: xi=max{0,1/ναi}x_i = \max\{0, 1/\nu - \alpha_i\}, ν\nu = water level.
  • Shadow price λi=p/ui\lambda_i^\star = -\partial p^\star/\partial u_i.
  • MLE concave ⟹ convex: Gaussian→LS, Poisson, logistic (affine − log-sum-exp); margin surrogate minϕ(yi(aTxi+b))\min\sum\phi(y_i(a^Tx_i+b)).
  • Robust LP box → aTx+δx1ba^Tx + \delta\lVert x\rVert_1 \le b; norm-ball → dual-norm SOCP; robust LS = Tikhonov Aˉxb2+P1/2x2\lVert\bar Ax-b\rVert^2 + \lVert P^{1/2}x\rVert^2; robustness climbs the hierarchy via duality.
  • Certainty equivalence Jensen bound f(x,Ew)Ef(x,w)f(x,Ew)\le Ef(x,w); MC downward bias E[min]min[E]E[\min]\le\min[E].

Named moves (cross-track glossary): local-is-global (the watershed); build-don’t-check (convexity calculus of atoms + operations); epigraph-bridge (sets↔functions, minimize-tt); recognize-the-class then transform-down the hierarchy; price-the-constraints (Lagrangian); inf-of-affine-is-concave (dual function); dual-is-a-conjugate; supporting-hyperplane-of-the-G\mathcal G-set (the geometric why of duality); weak-duality-bound then close-under-Slater; the-sandwich (complementary slackness); water-fill (KKT casework); KKT-as-certificate (and KKT-systems behind OLS/ridge/lasso/SVM — tracks 4, 6); shadow-price (sensitivity); scalarize-the-vector-objective (regularization, detector design); dualize-the-inner-sup (robust optimization, infinite → finite); robustness-climbs-the-hierarchy.