Certifying Optimality When the Gradient Is Nonzero
Motivation
Suppose an iterative solver for \min_{\|\mathbf{x}\|_2 \le 1}\tfrac12\|\mathbf{x} - \mathbf{x}_0\|_2^2(\mathbf{x}_0 = (3, 4)) halts at feasible \mathbf{x} = (0.55, 0.835) with f(\mathbf{x}) = 8.01 \ge p^\star:
Why unconstrained checks fail: At the constrained optimum \mathbf{x}^\star = (0.6, 0.8), \nabla f(\mathbf{x}^\star) = (-2.4, -3.2) \neq \mathbf{0}.
Dual lower-bound certificate: For any \lambda \ge 0, \lambda g(\mathbf{x}) \le 0 on the disk, so minimizing f(\mathbf{x}) + \lambda g(\mathbf{x}) over all of \mathbb{R}^2 certifies an ironclad lower bound q(\lambda) \le p^\star.
Folding Constraints into Unconstrained Lower Bounds
The Dual Problem
For the clipping problem (f(\mathbf{x}) = \tfrac12\|\mathbf{x} - \mathbf{x}_0\|^2,g(\mathbf{x}) = \tfrac12(\|\mathbf{x}\|^2 - 1) \le 0, \|\mathbf{x}_0\|^2 = 25), fix any \lambda \ge 0:
Universal concavity: For each fixed \mathbf{x}, \mathcal{L}(\mathbf{x}, \boldsymbol{\lambda}, \boldsymbol{\nu}) is affine in (\boldsymbol{\lambda}, \boldsymbol{\nu}). Because a pointwise infimum of affine lines is always concave, q is concave even when the primal is nonconvex.
Weak Duality and the Duality Gap
The Dual Problem
Maximizing the concave dual function over dual-feasible multipliers (\boldsymbol{\lambda} \succeq \mathbf{0}) defines the convex dual problem:
Two-line proof of Weak Duality (d^\star \le p^\star): For any primal-feasible \mathbf{x}(g_i(\mathbf{x}) \le 0, h_j(\mathbf{x}) = 0) and any dual-feasible (\boldsymbol{\lambda} \succeq \mathbf{0}, \boldsymbol{\nu}), every penalty term satisfies \lambda_i g_i(\mathbf{x}) \le 0 and \nu_j h_j(\mathbf{x}) = 0: q(\boldsymbol{\lambda}, \boldsymbol{\nu}) = \inf_{\mathbf{z} \in \mathcal{D}}\mathcal{L}(\mathbf{z}, \boldsymbol{\lambda}, \boldsymbol{\nu}) \le \mathcal{L}(\mathbf{x}, \boldsymbol{\lambda}, \boldsymbol{\nu}) = f(\mathbf{x}) + \sum_{i=1}^m \lambda_i g_i(\mathbf{x}) + \sum_{j=1}^p \nu_j h_j(\mathbf{x}) \le f(\mathbf{x})
Duality gap and stopping certificates: The nonnegative difference p^\star - d^\star \ge 0 is the duality gap. Any dual-feasible pair (\boldsymbol{\lambda}, \boldsymbol{\nu}) immediately bounds the suboptimality of any primal-feasible candidate \mathbf{x} via f(\mathbf{x}) - p^\star \le f(\mathbf{x}) - q(\boldsymbol{\lambda}, \boldsymbol{\nu}).
Slater’s Condition and Strong Duality
Strong Duality
Slater’s Condition (\Rightarrow d^\star = p^\star): If the primal problem is convex (f, g_i convex, h_j affine) and there exists a point \bar{\mathbf{x}} \in \mathrm{relint}(\mathcal{D}) with g_i(\bar{\mathbf{x}}) < 0 (for non-affine g_i), g_i(\bar{\mathbf{x}}) \le 0 (for affine g_i), and h_j(\bar{\mathbf{x}}) = 0, then strong duality holds (d^\star = p^\star) and dual optimal multipliers (\boldsymbol{\lambda}^\star, \boldsymbol{\nu}^\star) exist.
Affine shortcut: When all inequalities are linear/affine (LPs, SVMs), mere feasibility suffices.
Supporting-Line Geometry of Strong Duality
Strong Duality
For a single inequality g(\mathbf{x}) \le 0, form the epigraph set of attainable constraint and objective values:
\mathcal{A} = \big\{(u, t) : u \ge g(\mathbf{x}),\; t \ge f(\mathbf{x})\text{ for some }\mathbf{x} \in \mathcal{D}\big\}
Visualizing p^\star and q(\lambda):p^\star is the lowest height t of \mathcal{A} on the vertical axis u = 0. Evaluating q(\lambda) = \inf_{(u,t)\in\mathcal{A}}(t + \lambda u) pushes a line of slope -\lambda up from below until it supports \mathcal{A}; its intercept at u = 0 is q(\lambda).
Why convexity + Slater work: Convexity makes \mathcal{A} convex so a supporting line exists at (0, p^\star); Slater’s point u = g(\bar{\mathbf{x}}) < 0 prevents that line from being vertical.
Saddle Points and Min–Max Swapability
Strong Duality
Primal and dual optima are the two orders of a min–max game on \mathcal{L}:
Saddle-point equivalence:d^\star = p^\star with attained optima holds iff (\mathbf{x}^\star, \boldsymbol{\lambda}^\star, \boldsymbol{\nu}^\star) is a saddle point (\mathcal{L}(\mathbf{x}^\star, \boldsymbol{\lambda}, \boldsymbol{\nu}) \le \mathcal{L}(\mathbf{x}^\star, \boldsymbol{\lambda}^\star, \boldsymbol{\nu}^\star) \le \mathcal{L}(\mathbf{x}, \boldsymbol{\lambda}^\star, \boldsymbol{\nu}^\star)).
KKT necessity: Minimizing over \mathbf{x} gives \nabla_{\mathbf{x}}\mathcal{L} = \mathbf{0}, and d^\star = p^\star forces \sum_i \lambda_i^\star g_i(\mathbf{x}^\star) = 0.
Min–Max Games in Deep Learning: GANs and Robustness
Strong Duality
Primal recovery & dimension reduction: When f is strictly convex, \mathbf{x}^\star = \mathrm{argmin}_{\mathbf{x}}\mathcal{L}(\mathbf{x}, \boldsymbol{\lambda}^\star, \boldsymbol{\nu}^\star) recovers the primal solution from the n-variable dual (e.g., kernel SVMs when n \ll d).
GAN & adversarial rotational instability: On a bilinear game \min_x\max_y xy, simultaneous gradient descent–ascent multiplies the radius by \sqrt{1 + \eta^2} > 1 at every step, spiraling outward unless stabilized by extragradient or damping.
Lagrange Multipliers as Shadow Prices
Sensitivity & Prices
How much does the optimal value improve if we relax the constraints to g_i(\mathbf{x}) \le u_i and h_j(\mathbf{x}) = v_j? Let p^\star(\mathbf{u}, \mathbf{v}) denote the perturbed optimal value:
Global sensitivity lower bound: Under strong duality with dual optimum (\boldsymbol{\lambda}^\star, \boldsymbol{\nu}^\star), any \mathbf{x} feasible for (\mathbf{u}, \mathbf{v}) satisfies: p^\star(\mathbf{0}, \mathbf{0}) = q(\boldsymbol{\lambda}^\star, \boldsymbol{\nu}^\star) \le f(\mathbf{x}) + \sum_{i=1}^m \lambda_i^\star g_i(\mathbf{x}) + \sum_{j=1}^p \nu_j^\star h_j(\mathbf{x}) \le f(\mathbf{x}) + \boldsymbol{\lambda}^{\star\top}\mathbf{u} + \boldsymbol{\nu}^{\star\top}\mathbf{v} Taking the infimum over perturbed-feasible \mathbf{x} yields: p^\star(\mathbf{u}, \mathbf{v}) \ge p^\star(\mathbf{0}, \mathbf{0}) - \boldsymbol{\lambda}^{\star\top}\mathbf{u} - \boldsymbol{\nu}^{\star\top}\mathbf{v}
Identical KKT stationarity: Both share \nabla\ell(\mathbf{w}) + \lambda\mathbf{w} = \mathbf{0}.
Bijective correspondence: The penalized minimizer \mathbf{w}_\lambda solves the ball problem of radius r = \|\mathbf{w}_\lambda\|_2, and the ball multiplier satisfies \lambda^\star = -\partial p^\star/\partial(\tfrac12 r^2).
Numerical Verification: Penalty vs. Ball Projection
Sensitivity & Prices
On a convex least-squares loss \ell(\mathbf{w}) = \tfrac12\|\mathbf{A}\mathbf{w} - \mathbf{b}\|_2^2(30 \times 5), we solve the penalized ridge problem in closed form for \lambda \in \{0.1, 1.0, 10.0\}, set r = \|\mathbf{w}_\lambda\|_2, and run PGD on the r-ball:
PGD on the norm ball recovers the penalized solution \mathbf{w}_\lambda to machine precision (10^{-16}), and the multiplier recovered from -\mathbf{w}^\top\nabla\ell(\mathbf{w})/r^2 matches \lambda to all six decimal places.
The Fenchel Convex Conjugate: Supporting Lines
Convex Conjugates
The convex conjugate (or Fenchel conjugate) f^*(\mathbf{y}) encodes a function f(\mathbf{x}) by the intercepts of its supporting hyperplanes of slope \mathbf{y}:
Always convex & biconjugacy:f^* is a pointwise supremum of affine functions of \mathbf{y}, hence always convex. If f is proper, closed, and convex, then f^{**} = f.
Quadratics:\tfrac12\|\mathbf{x}\|_2^2 is self-conjugate (\tfrac12\|\mathbf{y}\|_2^2), and \tfrac12\mathbf{x}^\top\mathbf{A}\mathbf{x}(\mathbf{A} \succ \mathbf{0}) has conjugate \tfrac12\mathbf{y}^\top\mathbf{A}^{-1}\mathbf{y}.
Exponential \leftrightarrow entropy:f(x) = e^x has conjugate f^*(y) = y\log y - y for y > 0 (attained at x^\star = \log y).
For any linearly constrained problem \min_{\mathbf{x}} f(\mathbf{x}) subject to \mathbf{A}\mathbf{x} \preceq \mathbf{b} (or \mathbf{A}\mathbf{x} = \mathbf{b}), the dual function q(\boldsymbol{\lambda}) reduces directly to the Fenchel conjugate f^*:
Worked example (closest point in a half-plane): Minimize f(\mathbf{x}) = \tfrac12\|\mathbf{x}\|_2^2 subject to \mathbf{a}^\top\mathbf{x} \le b with \mathbf{a} = (1, 2)(\|\mathbf{a}\|^2 = 5) and b = -1.
Biconjugate variational law (\mathrm{lse}^{**} = \mathrm{lse}):\mathrm{lse}(\mathbf{x}) = \max_{\mathbf{p} \in \Delta}(\mathbf{p}^\top\mathbf{x} + H(\mathbf{p})), uniquely attained at \mathbf{p}^\star = \mathrm{softmax}(\mathbf{x}).
Deriving the Support Vector Machine (SVM) Dual
Worked Duals: SVM
For linearly separable data \{(\mathbf{x}_i, y_i)\}_{i=1}^n with y_i \in \{\pm 1\}, the hard-margin SVM maximizes the geometric margin 2/\|\mathbf{w}\|_2 by solving the convex quadratic program:
\min_{\mathbf{w}, b}\;\tfrac12\|\mathbf{w}\|_2^2 \quad \text{subject to} \quad g_i(\mathbf{w}, b) = 1 - y_i(\mathbf{w}^\top\mathbf{x}_i + b) \le 0, \quad i = 1, \ldots, n
Forming and minimizing the Lagrangian (\alpha_i \ge 0):\mathcal{L}(\mathbf{w}, b, \boldsymbol{\alpha}) = \tfrac12\|\mathbf{w}\|_2^2 + \sum_{i=1}^n \alpha_i\big(1 - y_i(\mathbf{w}^\top\mathbf{x}_i + b)\big)
Support vector sparsity: By complementary slackness, \alpha_i^\star > 0 only for active points on the margin y_i(\mathbf{w}^{\star\top}\mathbf{x}_i + b^\star) = 1.
Kernel trick: Training and prediction depend on \mathbf{x}_i solely via inner products \mathbf{x}_i^\top\mathbf{x}_j \mapsto k(\mathbf{x}_i, \mathbf{x}_j).
Solving the SVM Dual via Projected Gradient Ascent
Worked Duals: SVM
Folding the offset b into \tilde{\mathbf{w}} = (\mathbf{w}, b) with \tilde{\mathbf{x}}_i = (\mathbf{x}_i, 1) turns the dual into \max_{\boldsymbol{\alpha} \succeq \mathbf{0}}\big(\mathbf{1}^\top\boldsymbol{\alpha} - \tfrac12\boldsymbol{\alpha}^\top\mathbf{Q}\boldsymbol{\alpha}\big) over the nonnegative orthant, solved via projected gradient ascent:
KKT stationarity: With multiplier \nu on \sum_i P_i = P and \lambda_i \ge 0 on -P_i \le 0(\lambda_i P_i = 0), stationarity requires \frac{1}{N_i + P_i} = \nu - \lambda_i.
Uniform water level \theta = 1/\nu^\star: Active channels fill to \theta(P_i^\star = \max(\theta - N_i,\, 0)), where \theta solves: \sum_{i=1}^n \max(\theta - N_i,\, 0) = P
Verifying Water-Filling and Its Shadow Price
Worked Duals: Water-Filling
With noise floors \mathbf{N} = (0.1, 0.4, 0.8, 1.6, 2.5) and total budget P = 3.0, bisection finds the water level \theta and verifies that the Lagrange multiplier \nu^\star = 1/\theta equals the marginal capacity \mathrm{d}U^\star / \mathrm{d}P:
water level theta = 1.433333 P* = [1.3333 1.0333 0.6333 0. 0. ] total = 3.000000
wet channels at the common level: [1.433333 1.433333 1.433333]
dry channels above the level: True
nu = 1/theta = 0.697674 vs finite-difference dU*/dP = 0.697674
The three quietest channels fill to N_i + P_i^\star = \theta = 1.433333, the two noisy channels (N_i > \theta) stay dry (P_4^\star = P_5^\star = 0), and \nu^\star = 1/\theta = 0.697674 matches \mathrm{d}U^\star/\mathrm{d}P to six digits.
When Strong Duality Fails: An Explicit Duality Gap
Nonconvex Duality
To see why convexity is required for strong duality, minimize the concave objective f(x) = -x^2 over \mathcal{D} = [0, 1] subject to g(x) = x - \tfrac12 \le 0(p^\star = f(\tfrac12) = -\tfrac14):
p* = -0.2500, d* = -0.5000 at lambda = 1.00, gap = 0.2500
Even though x = 1/4 is strictly feasible (g(1/4) = -1/4 < 0), nonconvexity leaves a strict duality gap p^\star - d^\star = 1/4.
Concept Check: Dual Bounds, Prices, and Water Levels
Concept Check
Test your understanding of dual certificates, shadow prices, and water-filling:
In the disk-clipping problem (p^\star = 8), a solver stops at a feasible point with f(\mathbf{x}) = 8.01. Without finding \lambda^\star = 4, what suboptimality bound does the unoptimized multiplier \lambda = 3(q(3) = 7.875) certify?
Clipping (3, 4) to the unit disk (\tfrac12(\|\mathbf{x}\|^2 - 1) \le 0) has p^\star(0) = 8 and optimal multiplier \lambda^\star = 4. If we relax the constraint by u = \tfrac12 (enlarging the disk to radius r = \sqrt{2}), what lower bound on p^\star(\tfrac12) does the shadow price guarantee, and how does it compare with the true p^\star(\tfrac12)?
In water-filling with noise floors (0.1, 0.4, 0.8, 1.6, 2.5), how did we calculate the exact water level \theta = 1.433333 for P = 3 by hand?
Answers:(1) Weak duality guarantees p^\star \ge q(3) = 7.875, certifying immediately that f(\mathbf{x}) - p^\star \le 8.01 - 7.875 = \mathbf{0.135}. (2) The global sensitivity bound guarantees p^\star(\tfrac12) \ge p^\star(0) - \lambda^\star u = 8 - 4(\tfrac12) = \mathbf{6.00}. The exact new optimum is \tfrac12(5 - \sqrt{2})^2 \approx \mathbf{6.43} > 6.00. (3) Guessing that the 3 quietest channels are active, \sum_{i=1}^3(\theta - N_i) = 3\theta - (0.1 + 0.4 + 0.8) = 3 \implies 3\theta = 4.3 \implies \theta = \mathbf{4.3/3 \approx 1.4333}, which is consistent since 0.8 < 1.4333 < 1.6.