---
title: "EE 364A (Convex Optimization): Chapter 5.2 — The Lagrange Dual Problem"
author: "Chao Ma"
date: "2026-12-05"
categories: [Convex Optimization, Lagrange Duality, Slater's Condition, Semidefinite Programming]
image: "ee364a-ch5-2-assets/lagrange-duality-weak-strong-slater.png"
resources:
- ee364a-ch5-2-assets/create_figures.py
- ee364a-ch5-2-assets/manifest.json
- ee364a-ch5-2-assets/lagrange-duality-weak-strong-slater.svg
- ee364a-ch5-2-assets/slater-geometry-and-duality-gap-counterexample.svg
- ee364a-ch5-2-assets/nonconvex-partitioning-and-trust-region-duality.svg
---
In [Chapter 5.1](ee364a-chapter5-1-lagrange-dual-function.qmd), the Lagrange dual function $g(\lambda, \nu) = \inf_{x \in \mathcal{D}} L(x, \lambda, \nu)$ gave a **concave lower bound** on the primal optimal value $p^\star$ for every $\lambda \succeq 0$ and $\nu \in \mathbb{R}^p$. Chapter 5.2 asks the natural next question: **what is the tightest lower bound we can extract from $g$, and when does it hit $p^\star$ exactly?**
Answering that question produces the **Lagrange dual problem**—a problem that is *always convex*, even when the original primal problem is nonconvex and NP-hard—and leads directly to **weak duality**, **Slater's constraint qualification**, **strong duality**, and **minimax equilibrium for matrix games** (Boyd & Vandenberghe, *Convex Optimization*, §5.2–5.3, [`bv_cvxbook.pdf`, pp. 237–250](https://stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf#page=237); [`bv_cvxslides.pdf`, slides 5.10–5.17, pp. 164–171](https://stanford.edu/~boyd/cvxbook/bv_cvxslides.pdf#page=164)).
<iframe width="100%" height="415" src="https://www.youtube.com/embed/FJVmflArCXc" title="Stanford EE 364A Lecture 8: Duality (Prof. Stephen Boyd)" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
*Official Stanford Engineering Everywhere / Stanford Online EE 364A Lecture 8 video (`FJVmflArCXc`, published July 8, 2008, `1:16:15`). Key timestamps: `[25:37]` two-way partitioning, `[38:11]` Lagrange dual problem, `[40:16]` making dual constraints explicit, `[46:26]` weak duality & partitioning SDP, `[50:17]` strong duality & Slater's condition, `[1:04:07]` geometric interpretation.*
---
## 1. The Lagrange Dual Problem
Start from the standard-form optimization problem (not necessarily convex) with variable $x \in \mathbb{R}^n$, domain $\mathcal{D} = \bigcap_{i=0}^m \mathrm{dom}\, f_i \cap \bigcap_{i=1}^p \mathrm{dom}\, h_i$, and optimal value $p^\star$:
$$
\begin{aligned}
\text{minimize} \quad & f_0(x) \\
\text{subject to} \quad & f_i(x) \le 0, \quad i = 1, \dots, m, \\
& h_i(x) = 0, \quad i = 1, \dots, p.
\end{aligned}
$$
For every $\lambda \in \mathbb{R}^m$ with $\lambda \succeq 0$ and every $\nu \in \mathbb{R}^p$, the dual function $g(\lambda, \nu) = \inf_{x \in \mathcal{D}} \left(f_0(x) + \sum_{i=1}^m \lambda_i f_i(x) + \sum_{i=1}^p \nu_i h_i(x)\right)$ satisfies $g(\lambda, \nu) \le p^\star$. Searching for the best such lower bound defines the **Lagrange dual problem** (Book p. 223 / PDF p. 237, Eq. 5.16; Slide 5.10, PDF p. 164; Lecture `[38:11]`):
$$
\begin{aligned}
\text{maximize} \quad & g(\lambda, \nu) \\
\text{subject to} \quad & \lambda \succeq 0.
\end{aligned}
$$
- A pair $(\lambda, \nu)$ is **dual feasible** if $\lambda \succeq 0$ and $(\lambda, \nu) \in \mathrm{dom}\, g$ (i.e., $g(\lambda, \nu) > -\infty$).
- The optimal value of the dual problem is denoted $d^\star \in [-\infty, +\infty]$, attained at **dual optimal** multipliers $(\lambda^\star, \nu^\star)$ when the supremum is achieved.
- **Always convex:** Because $g(\lambda, \nu)$ is a pointwise infimum of affine functions of $(\lambda, \nu)$, $g$ is concave, and $\lambda \succeq 0$ is a convex constraint. Maximizing a concave function over a convex set is a **convex optimization problem** regardless of whether the primal problem is convex.

---
## 2. Making Dual Constraints Explicit
Often $g(\lambda, \nu) = -\infty$ outside an affine or semidefinite subspace. Rather than leaving $(\lambda, \nu) \in \mathrm{dom}\, g$ implicit inside the objective, we pull those domain conditions out as explicit constraints (Book pp. 224–225 / PDF pp. 238–239, Eq. 5.17–5.22; Slides 5.11 & 5.14, PDF pp. 165, 168; Lecture `[40:16]`).
### Standard-Form Linear Program
Consider the primal standard-form LP with $x \in \mathbb{R}^n$, $c \in \mathbb{R}^n$, $A \in \mathbb{R}^{p \times n}$, $b \in \mathbb{R}^p$:
$$
\begin{aligned}
\text{minimize} \quad & c^\top x \\
\text{subject to} \quad & A x = b, \quad x \succeq 0.
\end{aligned}
$$
Rewriting $x \succeq 0$ as $-x \preceq 0$ with multiplier $\lambda \in \mathbb{R}^n$ ($\lambda \succeq 0$) and equality multiplier $\nu \in \mathbb{R}^p$ gives the Lagrangian:
$$
L(x, \lambda, \nu) = c^\top x - \lambda^\top x + \nu^\top (Ax - b) = -b^\top \nu + (A^\top \nu - \lambda + c)^\top x.
$$
A linear function of $x \in \mathbb{R}^n$ is bounded below if and only if its slope is zero, so:
$$
g(\lambda, \nu) = \inf_{x \in \mathbb{R}^n} L(x, \lambda, \nu) =
\begin{cases}
-b^\top \nu & \text{if } A^\top \nu - \lambda + c = 0, \\
-\infty & \text{otherwise.}
\end{cases}
$$
Making the domain constraint explicit produces the dual LP (Eq. 5.19):
$$
\begin{aligned}
\text{maximize} \quad & -b^\top \nu \\
\text{subject to} \quad & A^\top \nu - \lambda + c = 0, \quad \lambda \succeq 0.
\end{aligned}
$$
Eliminating the slack variable $\lambda = A^\top \nu + c \succeq 0$ yields the compact inequality-form dual LP (Eq. 5.20):
$$
\begin{aligned}
\text{maximize} \quad & -b^\top \nu \\
\text{subject to} \quad & A^\top \nu + c \succeq 0.
\end{aligned}
$$
### Inequality-Form Linear Program
Symmetrically, starting from the inequality-form LP $\min c^\top x$ subject to $Ax \preceq b$ ($A \in \mathbb{R}^{m \times n}$, $b \in \mathbb{R}^m$) with multiplier $\lambda \in \mathbb{R}^m$ ($\lambda \succeq 0$) gives $L(x, \lambda) = -b^\top \lambda + (A^\top \lambda + c)^\top x$, whose explicit dual is the standard-form LP (Eq. 5.22; Slide 5.14, PDF p. 168):
$$
\begin{aligned}
\text{maximize} \quad & -b^\top \lambda \\
\text{subject to} \quad & A^\top \lambda + c = 0, \quad \lambda \succeq 0.
\end{aligned}
$$
Taking the dual of the dual LP recovers the original primal LP.
---
## 3. Weak Duality and Nonconvex Lower Bounds
For **every** optimization problem—convex or nonconvex—the optimal values satisfy **weak duality** (Book pp. 225–226 / PDF pp. 239–240, Eq. 5.23; Slide 5.12, PDF p. 166; Lecture `[46:26]`):
$$
d^\star \le p^\star.
$$
This inequality holds even in the extended real cases:
- If the primal is unbounded below ($p^\star = -\infty$), then $d^\star = -\infty$, meaning the dual is infeasible.
- If the dual is unbounded above ($d^\star = +\infty$), then $p^\star = +\infty$, meaning the primal is infeasible.
When $p^\star$ and $d^\star$ are finite, the nonnegative quantity $p^\star - d^\star \ge 0$ is called the **optimal duality gap** (note that $d^\star \le p^\star$ holds even for infinite optimal values, though subtracting equal infinities is undefined). Weak duality is especially useful when the primal is nonconvex and hard to solve: any feasible dual point $(\lambda, \nu)$ gives a rigorous certificate $p^\star \ge g(\lambda, \nu)$, and solving the convex dual gives the tightest Lagrangian lower bound $d^\star$.
### Two-Way Partitioning: SDP Dual vs. Spectral Bound
Consider the NP-hard nonconvex two-way partitioning problem (Book pp. 219–220 & 226 / PDF pp. 233–234 & 240; Lecture `[25:37]`, `[48:16]`):
$$
\begin{aligned}
\text{minimize} \quad & x^\top W x \\
\text{subject to} \quad & x_i^2 = 1, \quad i = 1, \dots, n,
\end{aligned}
$$
where $W = W^\top \in \mathbb{S}^n$ is a symmetric cost matrix. With equality multipliers $\nu \in \mathbb{R}^n$, the Lagrangian is:
$$
L(x, \nu) = x^\top W x + \sum_{i=1}^n \nu_i (x_i^2 - 1) = x^\top (W + \mathrm{diag}(\nu)) x - \mathbf{1}^\top \nu.
$$
The quadratic form $x^\top (W + \mathrm{diag}(\nu)) x$ is bounded below over $x \in \mathbb{R}^n$ if and only if $W + \mathrm{diag}(\nu) \succeq 0$, in which case its infimum is $0$. Therefore, the Lagrange dual is a **semidefinite program (SDP)**:
$$
\begin{aligned}
\text{maximize} \quad & -\mathbf{1}^\top \nu \\
\text{subject to} \quad & W + \mathrm{diag}(\nu) \succeq 0.
\end{aligned}
$$
Compare this against the elementary **spectral lower bound**: since $\|x\|_2^2 = \sum_{i=1}^n x_i^2 = n$, Rayleigh's quotient gives $x^\top W x \ge \lambda_{\min}(W) \|x\|_2^2 = n \lambda_{\min}(W)$. Notice that choosing the uniform multiplier $\nu = -\lambda_{\min}(W)\mathbf{1}$ is dual feasible ($W - \lambda_{\min}(W) I \succeq 0$) and achieves objective $-\mathbf{1}^\top \nu = n \lambda_{\min}(W)$. Because the SDP dual optimizes over *all* diagonal shifts $\nu \in \mathbb{R}^n$ rather than restricting to scalar multiples of $\mathbf{1}$, it is guaranteed to satisfy:
$$
n \lambda_{\min}(W) \le d^\star \le p^\star.
$$
In **Figure 3A** below (a constructed numerical check on four $n = 8$ symmetric weighted graphs with $W_{ii} = 0$, where the continuous SDP dual $d^\star$ is certified to primal-dual SDP solver residual $< 10^{-7}$—enforced $< 10^{-5}$ in `create_figures.py`—and compared separately against the exact discrete optimum $p^\star$ found by brute-force enumeration over $2^7 = 128$ sign patterns), the SDP dual dramatically tightens the spectral bound:
| Constructed $n = 8$ Graph | Spectral Bound $n\lambda_{\min}(W)$ | SDP Dual $d^\star$ | Exact Primal $p^\star$ | Spectral Gap $p^\star - n\lambda_{\min}(W)$ | Dual Gap $p^\star - d^\star$ |
| :--- | :---: | :---: | :---: | :---: | :---: |
| Asymmetric Hub + Ring | `-39.6314` | `-22.2884` | `-19.6000` | `20.0314` | `2.6884` |
| Chorded 8-Cycle | `-28.8620` | `-26.5000` | `-26.5000` | `2.3620` | `0.0000` |
| Signed 2-Cluster | `-42.5565` | `-39.2000` | `-39.2000` | `3.3565` | `0.0000` |
| Random Weighted (`seed=364`) | `-19.2159` | `-16.7163` | `-15.8823` | `3.3337` | `0.8340` |
*Provenance:* Constructed numerical verification of Boyd & Vandenberghe §5.2.2 (`bv_cvxbook.pdf`, p. 240); generated by `ee364a-ch5-2-assets/create_figures.py`.
---
## 4. Strong Duality and Slater's Constraint Qualification
When $d^\star = p^\star$ (zero optimal duality gap), we say **strong duality** holds. Strong duality does **not** hold in general—even for convex problems—unless a **constraint qualification** rules out degenerate boundary geometry.
### Slater's Condition (Convex Primal)
Consider a convex optimization problem in standard form (Book pp. 226–227 / PDF pp. 240–241, Eq. 5.24–5.27; Slide 5.13, PDF p. 167; Lecture `[50:17]`–`[58:07]`):
$$
\begin{aligned}
\text{minimize} \quad & f_0(x) \\
\text{subject to} \quad & f_i(x) \le 0, \quad i = 1, \dots, m, \\
& A x = b,
\end{aligned}
$$
where $f_0, \dots, f_m$ are convex and the equality constraints are affine ($A \in \mathbb{R}^{p \times n}$).
**Slater's condition:** There exists a **strictly feasible** point $x \in \mathrm{relint}\,\mathcal{D}$ such that:
$$
f_i(x) < 0 \quad (i = 1, \dots, m), \qquad A x = b.
$$
**Theorem (Slater):** If the primal problem is convex and Slater's condition holds, then:
1. **Strong duality holds:** $d^\star = p^\star$.
2. **Dual attainment:** Whenever $d^\star > -\infty$, the dual optimal value is attained by some $(\lambda^\star, \nu^\star)$ with $\lambda^\star \succeq 0$ and $g(\lambda^\star, \nu^\star) = d^\star = p^\star$.
**Refinement for affine inequalities (Eq. 5.27):** If the first $k$ inequality constraints $f_1, \dots, f_k$ are **affine**, they do not need strict inequality! It suffices to find $x \in \mathrm{relint}\,\mathcal{D}$ satisfying:
$$
f_i(x) \le 0 \quad (i = 1, \dots, k), \qquad f_i(x) < 0 \quad (i = k+1, \dots, m), \qquad A x = b.
$$
In particular, for a **linear program** (where all constraints are affine and $\mathcal{D} = \mathbb{R}^n$), primal feasibility immediately satisfies refined Slater's condition, so strong duality holds whenever the primal is feasible (and by symmetry whenever the dual is feasible; the *only* exception for an LP is when both primal and dual are infeasible, giving $p^\star = +\infty$ and $d^\star = -\infty$, Exercise 5.23, Book pp. 280–281 / PDF pp. 294–295).
### When Convexity Alone Is Not Enough: Textbook Exercise 5.21
Convexity without Slater's condition can still produce a strictly positive duality gap. Boyd & Vandenberghe Exercise 5.21 (Book p. 280 / PDF p. 294, referenced in §5.3.2 on PDF p. 250) gives the classic 2-variable counterexample:
$$
\begin{aligned}
\text{minimize} \quad & e^{-x} \\
\text{subject to} \quad & \frac{x^2}{y} \le 0, \qquad \mathcal{D} = \{(x, y) \in \mathbb{R}^2 \mid y > 0\}.
\end{aligned}
$$
1. **Convexity:** $f_0(x) = e^{-x}$ is convex, and $f_1(x, y) = x^2 / y$ is quadratic-over-linear, which is convex on $\{(x, y) \mid y > 0\}$.
2. **Primal optimal value:** For $y > 0$, $x^2 / y \le 0$ forces $x = 0$. Every feasible point $(0, y)$ has objective $e^0 = 1$, so $p^\star = 1$.
3. **Dual function and optimal value:** For any $\lambda \ge 0$,
$$
g(\lambda) = \inf_{x \in \mathbb{R},\, y > 0} \left(e^{-x} + \lambda \frac{x^2}{y}\right).
$$
Holding any $x \in \mathbb{R}$ fixed and sending $y \to +\infty$ drives $\lambda x^2 / y \to 0$, leaving $\inf_{x \in \mathbb{R}} e^{-x} = 0$. Hence $g(\lambda) = 0$ for all $\lambda \ge 0$, giving $d^\star = 0$ (attained at any $\lambda^\star \ge 0$).
4. **Duality gap:** $p^\star - d^\star = 1 - 0 = 1 > 0$. Slater's condition fails because $x^2 / y < 0$ has no solution for $y > 0$.
---
## 5. Geometric Interpretation and Proof of Slater's Theorem
Why does strict feasibility force $d^\star = p^\star$, and why did Exercise 5.21 fail? Section 5.3.1–5.3.2 (Book pp. 232–236 / PDF pp. 246–250; Slides 5.16–5.17, PDF pp. 170–171; Lecture `[1:04:07]`) explains both in one picture.
Define the set of achievable constraint-objective pairs $\mathcal{G}$ and its upward-right **epigraph set** $\mathcal{A}$:
$$
\mathcal{G} = \{(f_1(x), \dots, f_m(x), h_1(x), \dots, h_p(x), f_0(x)) \mid x \in \mathcal{D}\} \subseteq \mathbb{R}^m \times \mathbb{R}^p \times \mathbb{R},
$$
$$
\mathcal{A} = \{(u, v, t) \mid \exists x \in \mathcal{D},\ f_i(x) \le u_i,\ h_i(x) = v_i,\ f_0(x) \le t\}.
$$
- For a **convex primal problem**, $\mathcal{A}$ is a **convex set** (even when $\mathcal{G}$ itself is not).
- The primal optimal value is the lowest $t$ where $\mathcal{A}$ meets the vertical axis $(u, v) = (0, 0)$: $p^\star = \inf \{t \mid (0, 0, t) \in \mathcal{A}\}$.
- Evaluating $g(\lambda, \nu)$ minimizes the linear functional $(\lambda, \nu, 1)^\top (u, v, t)$ over $\mathcal{A}$: geometrically, $t + \lambda^\top u + \nu^\top v = g(\lambda, \nu)$ is a **nonvertical supporting hyperplane** to $\mathcal{A}$ whose intercept on the vertical axis $(u, v) = (0, 0)$ is $g(\lambda, \nu)$.
### Sketch of the Separating Hyperplane Proof (Book pp. 234–236 / PDF pp. 248–250)
Following Boyd & Vandenberghe §5.3.2 (Book p. 235 / PDF p. 249), we make two simplifying assumptions: (a) $\mathcal{D}$ has nonempty interior ($\mathrm{int}\,\mathcal{D} \neq \emptyset$, so $\mathrm{relint}\,\mathcal{D} = \mathrm{int}\,\mathcal{D}$), and (b) $\mathrm{rank}(A) = p$. We also assume $p^\star$ is finite (if $p^\star = -\infty$, weak duality already forces $d^\star = -\infty$) and Slater's condition holds: there exists $\tilde{x} \in \mathrm{int}\,\mathcal{D}$ with $f_i(\tilde{x}) < 0$ and $A\tilde{x} = b$. Define the convex open ray below $(0, 0, p^\star)$:
$$
\mathcal{B} = \{(0, 0, s) \in \mathbb{R}^m \times \mathbb{R}^p \times \mathbb{R} \mid s < p^\star\}.
$$
1. **Disjointness:** $\mathcal{A} \cap \mathcal{B} = \emptyset$ by definition of $p^\star$.
2. **Separation:** Because $\mathcal{A}$ and $\mathcal{B}$ are nonempty disjoint convex sets, the Separating Hyperplane Theorem yields a nonzero $(\tilde{\lambda}, \tilde{\nu}, \mu) \neq 0$ and $\alpha \in \mathbb{R}$ such that:
$$
\tilde{\lambda}^\top u + \tilde{\nu}^\top v + \mu t \ge \alpha \quad \forall (u, v, t) \in \mathcal{A}, \qquad \mu s \le \alpha \quad \forall s < p^\star.
$$
3. **Signs:** Because $u$ and $t$ can be arbitrarily large inside $\mathcal{A}$, we must have $\tilde{\lambda} \succeq 0$ and $\mu \ge 0$. From $\mu s \le \alpha$ for all $s < p^\star$, we get $\mu p^\star \le \alpha$.
4. **Why Slater forces $\mu > 0$ (nonvertical hyperplane):** Suppose for contradiction that $\mu = 0$. Then $\tilde{\lambda}^\top u + \tilde{\nu}^\top v \ge \alpha \ge 0$ for all $(u, v, t) \in \mathcal{A}$. Evaluating at the Slater point $\tilde{x}$ (where $v = A\tilde{x} - b = 0$ and $f_i(\tilde{x}) < 0$) gives $\sum_{i=1}^m \tilde{\lambda}_i f_i(\tilde{x}) \ge 0$. Since $\tilde{\lambda} \succeq 0$ and every $f_i(\tilde{x}) < 0$, this forces $\tilde{\lambda} = 0$. Then $\tilde{\nu}^\top (Ax - b) \ge 0$ for all $x \in \mathcal{D}$. Because $\tilde{x} \in \mathrm{int}\,\mathcal{D}$ satisfies $A\tilde{x} = b$ and $\mathrm{rank}(A) = p$, taking a small step $x = \tilde{x} - \epsilon A^\top \tilde{\nu} \in \mathcal{D}$ ($\epsilon > 0$) yields $-\epsilon \|A^\top \tilde{\nu}\|_2^2 \ge 0 \implies A^\top \tilde{\nu} = 0 \implies \tilde{\nu} = 0$—contradicting $(\tilde{\lambda}, \tilde{\nu}, \mu) \neq 0$!
5. **Normalize by $\mu > 0$:** Setting $\lambda^\star = \tilde{\lambda}/\mu \succeq 0$ and $\nu^\star = \tilde{\nu}/\mu$, we obtain for every $x \in \mathcal{D}$:
$$
L(x, \lambda^\star, \nu^\star) = f_0(x) + (\lambda^\star)^\top f(x) + (\nu^\star)^\top (Ax - b) \ge \frac{\alpha}{\mu} \ge p^\star.
$$
Taking the infimum over $x \in \mathcal{D}$ gives $g(\lambda^\star, \nu^\star) \ge p^\star$. Combined with weak duality ($g(\lambda^\star, \nu^\star) \le d^\star \le p^\star$), this proves both $d^\star = p^\star$ and attainment of the dual optimum!

In **Figure 2A** (constructed convex example: $\min (x - 2)^2 + 0.5$ s.t. $x^2 - 1 \le 0$), the strict Slater point $x = 0$ puts $u = f_1(0) = -1 < 0$ inside the open left half-plane, forcing a nonvertical supporting line at $(0, p^\star) = (0, 1.5)$ with slope $-\lambda^\star = -1$ and zero gap ($d^\star = p^\star = 1.5$). In **Figure 2B** (Exercise 5.21), $\mathcal{A}$ has no points with $u < 0$, so the vertical line $u = 0$ ($\mu = 0$) separates $\mathcal{A}$ from $\mathcal{B}$. Every nonvertical supporting line $t = -\lambda u$ ($\lambda \ge 0$) has vertical intercept $g(\lambda) = 0$ (with $\lambda = 0$ giving the horizontal line $t = 0$ drawn), leaving $p^\star - d^\star = 1$.
---
## 6. Key Examples of Strong Duality (Including a Nonconvex Surprise)
Section 5.2.4 (Book pp. 227–229 / PDF pp. 241–243; Slide 5.15, PDF p. 169) catalogs five convex classes where Slater's condition delivers clean duals—plus one famous **nonconvex** problem where strong duality holds anyway:
| Problem Class | Primal Form | Explicit Dual Form | Strong Duality Condition |
| :--- | :--- | :--- | :--- |
| **Least Squares** (Eq. 5.5) | $\min x^\top x$ s.t. $Ax = b$ | $\max -\frac{1}{4}\nu^\top A A^\top \nu - b^\top \nu$ | Always (affine equality; feasible $\implies d^\star = p^\star$) |
| **Linear Program** (Eq. 5.17–5.22) | $\min c^\top x$ s.t. $Ax \preceq b$ | $\max -b^\top \lambda$ s.t. $A^\top \lambda + c = 0,\ \lambda \succeq 0$ | Unless both primal & dual infeasible (Ex. 5.23) |
| **Convex QCQP** (Eq. 5.28–5.29) | $\min \frac{1}{2}x^\top P_0 x + q_0^\top x + r_0$ s.t. $\frac{1}{2}x^\top P_i x + q_i^\top x + r_i \le 0$ ($P_0 \succ 0$, $P_i \succeq 0$ for $i \ge 1$) | $\max -\frac{1}{2}q(\lambda)^\top P(\lambda)^{-1} q(\lambda) + r(\lambda)$ s.t. $\lambda \succeq 0$, where $P(\lambda)=P_0+\sum_i \lambda_i P_i$ (and $q, r$ analogously) | Strict feasibility $\exists x:\ \frac{1}{2}x^\top P_i x + q_i^\top x + r_i < 0$ |
| **Entropy Maximization** (Eq. 5.13, 5.30) | $\min \sum_{i=1}^n x_i \log x_i$ ($x \succeq 0,\ 0\log 0 = 0$) s.t. $Ax \preceq b,\ \mathbf{1}^\top x = 1$ | $\max -b^\top \lambda - \log \sum_{i=1}^n e^{-a_i^\top \lambda}$ s.t. $\lambda \succeq 0$ ($a_i$ is column $i$ of $A$; $\nu$ eliminated) | Feasible $x \succ 0$ with $Ax \preceq b,\ \mathbf{1}^\top x = 1$ (affine constraints!) |
| **Min-Volume Covering Ellipsoid** (Eq. 5.14, 5.31) | $\min \log\det X^{-1}$ s.t. $a_i^\top X a_i \le 1$ ($X \succ 0$) | $\max \log\det\left(\sum_{i=1}^m \lambda_i a_i a_i^\top\right) - \mathbf{1}^\top \lambda + n$ s.t. $\lambda \succeq 0$, $\sum_i \lambda_i a_i a_i^\top \succ 0$ | Slater always holds for any finite point set ($X = \epsilon I \succ 0$ small); spanning makes $p^\star$ finite |
| **Trust-Region Problem** (Eq. 5.32–5.33) | $\min x^\top A x + 2 b^\top x$ s.t. $x^\top x \le 1$ (**$A \not\succeq 0$ allowed!**) | $\max -b^\top (A + \lambda I)^\dagger b - \lambda$ s.t. $\lambda \ge 0,\ A + \lambda I \succeq 0,\ b \in \mathrm{range}(A + \lambda I)$ | **Always holds** (separate theorem in Appendix §B.1 / §B.4, even when nonconvex!) |
### Why the Nonconvex Trust-Region Problem Has Zero Duality Gap
In the trust-region subproblem (Book p. 229 / PDF p. 243, Eq. 5.32–5.33), $A \in \mathbb{S}^n$ is symmetric but **need not be positive semidefinite** ($A \not\succeq 0$), so the primal objective is nonconvex. Forming the Lagrangian $L(x, \lambda) = x^\top (A + \lambda I) x + 2b^\top x - \lambda$ and using the eigendecomposition $A = \sum_{i=1}^n \lambda_i q_i q_i^\top$, let $M(\lambda) = A + \lambda I$. Finite dual feasibility requires $\lambda \ge 0$, $M(\lambda) \succeq 0$ (i.e., $\lambda \ge \max(0, -\lambda_{\min}(A))$), and $b \in \mathrm{range}(M(\lambda))$, on which $g(\lambda) = -b^\top M(\lambda)^\dagger b - \lambda = -\sum_{i=1}^n \frac{(q_i^\top b)^2}{\lambda_i + \lambda} - \lambda$ (with $0/0 = 0$ if $q_i^\top b = 0$ when $\lambda_i + \lambda = 0$). Whenever $q_{\min}^\top b \neq 0$ and $\lambda_{\min}(A) < 0$, the finite dual domain is the open half-line $\lambda > -\lambda_{\min}(A)$:
$$
\begin{aligned}
\text{maximize} \quad & -\sum_{i=1}^n \frac{(q_i^\top b)^2}{\lambda_i + \lambda} - \lambda \\
\text{subject to} \quad & \lambda \ge 0, \quad A + \lambda I \succeq 0, \quad b \in \mathrm{range}(A + \lambda I).
\end{aligned}
$$
Despite nonconvexity, strong duality **always** holds (stated in Appendix §B.1, using the S-procedure in §B.2, and proved in §B.4 of Boyd & Vandenberghe). **Figure 3B** verifies this on a constructed 2-D indefinite example with $A = \mathrm{diag}(-2.0, 1.5)$ ($\lambda_{\min}(A) = -2.0$) and $b = [0.6, 0.8]^\top$: because $b_1 = 0.6 \neq 0$ lies in the nullspace at $\lambda = 2$, $g(2) = -\infty$ and the finite dual domain is $\lambda > 2.0$. Maximizing the 1-D concave dual on $\lambda > 2.0$ hits $\lambda^\star = 2.611690$ with $d^\star = -3.355877$, matching the exact nonconvex primal optimum $p^\star = -3.355877$ (at $x^\star = [-0.981, -0.195]^\top$, $\|x^\star\|_2 = 1$) to machine precision (`gap = 0.0000`).

---
## 7. Mixed Strategies for Matrix Games: Minimax via LP Duality
Chapter 5.2 concludes with a classic application of strong LP duality: **zero-sum two-player matrix games** (Book pp. 230–231 / PDF pp. 244–245, Eq. 5.34–5.35).
Let $P \in \mathbb{R}^{n \times m}$ be the payoff matrix from Player 1 (choosing mixed strategy $u \in \mathbb{R}^n$, $u \succeq 0$, $\mathbf{1}^\top u = 1$) to Player 2 (choosing mixed strategy $v \in \mathbb{R}^m$, $v \succeq 0$, $\mathbf{1}^\top v = 1$). The expected payment from Player 1 to Player 2 is $u^\top P v$.
- **Player 1 moves first (minimizer):** Knowing Player 2 will maximize $u^\top P v$ over the probability simplex, Player 1 solves $\min_{u \succeq 0,\, \mathbf{1}^\top u = 1} \max_j (P^\top u)_j$ (Eq. 5.34), which rewrites as the LP reformulation:
$$
\begin{aligned}
\text{minimize}_{u, t} \quad & t \\
\text{subject to} \quad & u \succeq 0, \quad \mathbf{1}^\top u = 1, \quad P^\top u \preceq t \mathbf{1},
\end{aligned}
$$
with optimal value $p_1^\star$.
- **Player 2 moves first (maximizer):** Knowing Player 1 will minimize $u^\top P v$ over the simplex, Player 2 solves $\max_{v \succeq 0,\, \mathbf{1}^\top v = 1} \min_i (Pv)_i$ (Eq. 5.35), which rewrites as the LP reformulation:
$$
\begin{aligned}
\text{maximize}_{v, s} \quad & s \\
\text{subject to} \quad & v \succeq 0, \quad \mathbf{1}^\top v = 1, \quad P v \succeq s \mathbf{1},
\end{aligned}
$$
with optimal value $p_2^\star$.
Forming the Lagrangian of Player 1's LP with multipliers $\lambda \in \mathbb{R}^n$ ($\lambda \succeq 0$ for $-u \preceq 0$), $v \in \mathbb{R}^m$ ($v \succeq 0$ for $P^\top u - t\mathbf{1} \preceq 0$), and $\nu \in \mathbb{R}$ (for $1 - \mathbf{1}^\top u = 0$) gives:
$$
L(u, t, \lambda, v, \nu) = t(1 - \mathbf{1}^\top v) + (P v - \nu \mathbf{1} - \lambda)^\top u + \nu.
$$
Taking the infimum over $(u, t)$ yields finite value $\nu$ if and only if $\mathbf{1}^\top v = 1$ and $P v - \nu \mathbf{1} = \lambda \succeq 0$, i.e., $P v \succeq \nu \mathbf{1}$ with $v \succeq 0$ and $\mathbf{1}^\top v = 1$—which is **identically Player 2's LP** (with $s = \nu$)!
Because both LPs are always feasible (pick uniform $u = \frac{1}{n}\mathbf{1}$, $t = \max_j (P^\top u)_j$), LP strong duality immediately proves **von Neumann's minimax theorem**:
$$
p_1^\star = p_2^\star.
$$
In mixed strategies, there is zero advantage to going second.
---
## Summary Takeaways
1. **Always convex:** The Lagrange dual problem $\max g(\lambda, \nu)$ subject to $\lambda \succeq 0$ is always convex, regardless of primal convexity.
2. **Always a valid bound:** Weak duality ($d^\star \le p^\star$) holds universally and produces computable convex relaxations (such as the two-way partitioning SDP) for NP-hard nonconvex problems.
3. **Slater's condition closes the gap:** For a convex primal problem, a single strictly feasible point $x \in \mathrm{relint}\,\mathcal{D}$ ($f_i(x) < 0$ for non-affine inequalities, $f_i(x) \le 0$ for affine inequalities, $Ax = b$) forces a nonvertical separating hyperplane ($\mu > 0$), certifying $d^\star = p^\star$ and dual attainment whenever $d^\star > -\infty$.
4. **Watch the boundaries and exceptions:** Convexity without Slater can fail (Exercise 5.21: $p^\star = 1$, $d^\star = 0$), while special nonconvex problems like the trust-region subproblem still satisfy strong duality.
5. **LP duality is ubiquitous:** Explicit dual constraints turn standard-form and inequality-form LPs into each other's duals and prove von Neumann's minimax theorem ($p_1^\star = p_2^\star$) in three lines of algebra.
---
## Primary Sources
- Stephen Boyd & Lieven Vandenberghe, *Convex Optimization*, Cambridge University Press (2004), Chapter 5 (§5.2 *The Lagrange dual problem*, Book pp. 223–231 / [`bv_cvxbook.pdf`, pp. 237–245](https://stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf#page=237); §5.3.1–5.3.2 *Geometric interpretation & Slater's theorem*, Book pp. 232–236 / [`bv_cvxbook.pdf`, pp. 246–250](https://stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf#page=246); Exercises 5.21 & 5.23, Book pp. 280–281 / [`bv_cvxbook.pdf`, pp. 294–295](https://stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf#page=294)).
- Official Lecture Slides: *Duality*, slides 5.10–5.17 ([`bv_cvxslides.pdf`, pp. 164–171](https://stanford.edu/~boyd/cvxbook/bv_cvxslides.pdf#page=164)).
- Official Stanford Engineering Everywhere / Stanford Online EE 364A Lecture 8 Video (published July 8, 2008): [Convex Optimization — Lecture 8: Duality (`FJVmflArCXc`)](https://www.youtube.com/watch?v=FJVmflArCXc).