M2 Β· Constrained optimality (KKT), from zero

Chapter 6 (notes Β§6.1–6.4) Β· about 2 h Β· Goal: for any smooth problem with equality and inequality constraints, you can write the KKT conditions with the right signs, find every KKT point by trying active sets, and decide with the second-order test which ones are minima. He said: Seventy percent of mark is covered by memorizing this equation and the following KKT Ch 6 lec 3 [11:30].

How this page works

It's a story: each section uses only what came before. Every idea appears first in plain words, then with numbers or a picture, then in the exact form from his notes, then in a worked example, then with its traps. Small Check boxes let you test yourself (answers hidden). The one-page summary is at the very end, for revision.

Notation used on this page (each is explained again where it first appears):

  • $x=(x_1,\dots,x_n)$: the unknowns, a column vector. In 2-D examples his notes often write the two unknowns as $(u,v)$.
  • $f(x)$: the objective (what we minimise). $h_i(x)=0$, $i=1,\dots,m$: equality constraints. $g_j(x)\le0$, $j=1,\dots,p$: inequality constraints.
  • $\Omega$ ("Omega"): the feasible set, all $x$ that satisfy every constraint. $x^\star$: the point we are testing.
  • $\nabla f(x)$: the gradient, the column of first partial derivatives; it points in the direction of steepest increase. $\nabla^2 f(x)$: the Hessian, the matrix of second partial derivatives.
  • $d$: a direction (a vector); $t\gt0$: a small step length. $d^\top c=d_1c_1+\dots+d_nc_n$ is the dot product; $d^\top c\lt0$ means $d$ and $c$ make an angle of more than 90Β°.
  • $\mathcal A(x^\star)$: the active set, the indices $j$ with $g_j(x^\star)=0$.
  • $\lambda=(\lambda_1,\dots,\lambda_m)$: multipliers of the equalities (any sign). $\mu=(\mu_1,\dots,\mu_p)$: multipliers of the inequalities (must be $\ge0$).
  • $\ell(x,\lambda,\mu)=f(x)+\sum_i\lambda_ih_i(x)+\sum_j\mu_jg_j(x)$: the Lagrangian. (Midterm 2 wrote $L$ for the same thing.) $\mathbf L_\star=\nabla^2_{xx}\ell(x^\star,\lambda^\star,\mu^\star)$: its Hessian in $x$ at the KKT point, multipliers held fixed.
  • $T_\Omega(x^\star)$: tangent cone. $\mathcal L_\Omega(x^\star)$ (curly L): linearised cone. $C$: critical cone. $\mathcal A_+$, $\mathcal A_0$: active constraints with $\mu_j\gt0$, resp. $\mu_j=0$.
  • $Q\succ0$: $Q$ is positive definite ($x^\top Qx\gt0$ for every $x\ne0$, all eigenvalues $\gt0$). $Q\succeq0$: positive semidefinite ($x^\top Qx\ge0$, all eigenvalues $\ge0$).
  • A cone is a set of directions: if $d$ is in it, so is $2d$, $0.1d$, any positive multiple.
  • Abbreviations: FONC / SONC = first / second-order necessary condition; SOSC = second-order sufficient condition; LICQ = linear independence constraint qualification; KKT = Karush–Kuhn–Tucker.
  • For vectors, "$\mu\ge0$" means every entry is $\ge0$. "$t_k\downarrow0$" means positive numbers shrinking to 0.
  • Section F only: $\theta_1\lt\dots\lt\theta_n$ are the eigenvalues of a matrix $Q$ and $q_1,\dots,q_n$ its unit eigenvectors. (His paper called them $\lambda_i$, $v_i$; here they get their own letters so they can't be confused with the multiplier $\lambda$ or the coordinate $v$.)
  • Letters introduced inside a practice question (like a parameter $a$ or a vector $c$) belong to that question only.

0. Why this topic exists (the problem it solves)

In Chapter 1 you learnt: at a minimum of a smooth function with no constraints, the gradient is zero, $\nabla f(x^\star)=0$. (If gradients, Hessians, positive definiteness or FONC/SONC/SOSC feel rusty, M6 sections C–D rebuild them from zero in about 20 minutes; this page uses them from section E on.) Real problems have constraints: a budget, a capacity, "this quantity can't be negative".

A concrete problem. Find the point closest to $(2,2)$ among the points with $x_1+x_2\le2$. As a minimisation: $\min\ f(x)=(x_1-2)^2+(x_2-2)^2$ subject to $x_1+x_2\le2$.

  • Without the constraint the answer is $(2,2)$, where $\nabla f=0$. But $2+2=4\gt2$: that point is not allowed.
  • The best allowed point is $(1,1)$, on the boundary line (the figure below shows it). There $\nabla f(1,1)=\big(2(1-2),\,2(1-2)\big)=(-2,-2)\ne0$.

The pain: the test "$\nabla f=0$" fails at the real answer. We need a new test for constrained minima. That test is KKT, and this whole chapter builds it.

x₁xβ‚‚ x₁ + xβ‚‚ = 2 feasible: x₁ + xβ‚‚ ≀ 2 (2,2): βˆ‡f = 0,but infeasible βˆ’βˆ‡f = (2,2) βˆ‡g = (1,1) x* = (1,1)
Dashed circles are level sets of $f$ (points of equal distance to $(2,2)$). The best feasible point $x^\star=(1,1)$ is where a level circle just touches the line. There, the downhill direction $-\nabla f$ (red) points straight out through the wall, the same way as the wall's outward normal $\nabla g$ (green) for $g=x_1+x_2-2$: $-\nabla f=2\,\nabla g$.
The whole chapter in one sentence

At a constrained minimum, every direction you are allowed to move in goes uphill (or flat); equivalently, the downhill direction $-\nabla f$ is "held back" by the walls: $-\nabla f$ equals a combination of the active constraints' gradients, with non-negative weights on the inequality walls. Those weights are the multipliers $\mu$ (here $\mu=2$).

Roadmap: A sets up the language (feasible set, active constraints). B makes "directions you are allowed to move in" precise (two cones). C turns "no allowed downhill direction" into multipliers (Farkas). D is KKT and how to solve it by hand. E is the second-order test that tells minima from saddles. F is the eigenvector problem he loves. G is the trap bank, H the one proof, I the exam recipe.

A. The set-up: the course form, active constraints, and why βˆ‡f = 0 fails

A1. The course form (he accepts no other)

Every problem is first rewritten in exactly this form:

$$\min_{x\in\mathbb R^n} f(x)\quad\text{subject to}\quad h_i(x)=0\ \ (i=1,\dots,m),\qquad g_j(x)\le0\ \ (j=1,\dots,p).$$

The feasible set is $\Omega=\{x:\ h_i(x)=0\text{ for all }i,\ g_j(x)\le0\text{ for all }j\}$. A point $x^\star\in\Omega$ is a local minimiser if $f(x^\star)\le f(x)$ for every feasible $x$ near $x^\star$ (strict: $\lt$ for every such $x\ne x^\star$).

Rewriting rules:

  • A maximisation $\max F$ becomes $\min f$ with $f=-F$.
  • "$\ge$" constraints are flipped by moving everything to one side: $x_1\ge0$ becomes $-x_1\le0$; $x^\top Qx\ge1$ becomes $1-x^\top Qx\le0$; $x_1+x_2\ge1$ becomes $1-x_1-x_2\le0$.
  • Equalities go to "$\dots=0$": $x_1^2+x_2^2=4$ becomes $x_1^2+x_2^2-4=0$.
Worked rewrite Problem: $\max\ x_1x_2$ s.t. $x_1+x_2\ge1$, $x_1^2+x_2^2=4$, $x_2\le3$.
  1. Max β†’ min: $f(x)=-x_1x_2$.
  2. Equality: $h(x)=x_1^2+x_2^2-4=0$.
  3. Inequalities: $g_1(x)=1-x_1-x_2\le0$, $g_2(x)=x_2-3\le0$.
Trap If you keep $x_1+x_2-1\ge0$ and later use the KKT signs for "$\le0$", every inequality multiplier comes out with the wrong sign and you will reject the true answer. He said other books' forms are not accepted Ch 7 lec 2 [41:00]. Always rewrite first.

A2. Active and inactive constraints

At a feasible point $x^\star$, an inequality $g_j\le0$ is either

  • active: $g_j(x^\star)=0$. You are standing on that wall; a small move can break it.
  • inactive: $g_j(x^\star)\lt0$. You are strictly inside; any small enough move keeps it satisfied, so near $x^\star$ it does not matter at all.

The active set is $\mathcal A(x^\star)=\{j:\ g_j(x^\star)=0\}$. Equalities $h_i=0$ always count as "on the wall".

Numbers: with $g_1=x_1+x_2-2$, $g_2=-x_1$: at $(1,1)$: $g_1=0$ (active), $g_2=-1$ (inactive), so $\mathcal A=\{1\}$. At $(0,2)$: $g_1=0$, $g_2=0$, so $\mathcal A=\{1,2\}$ (a corner).

Check A2. Constraints $g_1=x_1^2+x_2^2-1\le0$, $g_2=-x_2\le0$. What is $\mathcal A$ at $(1,0)$, at $(0.5,0)$, and at $(0,0.5)$?
Show answer

$(1,0)$: $g_1=0$, $g_2=0$ β‡’ $\{1,2\}$. $(0.5,0)$: $g_1=-0.75$, $g_2=0$ β‡’ $\{2\}$. $(0,0.5)$: $g_1=-0.75$, $g_2=-0.5$ β‡’ $\varnothing$ (an interior point).

A3. Why "βˆ‡f = 0" is the wrong test with constraints

Recall what $\nabla f$ tells you: moving a small step $t$ in direction $d$ changes $f$ by about $t\,\nabla f(x)^\top d$ (first-order Taylor). So $f$ goes down in direction $d$ exactly when $\nabla f^\top d\lt0$.

  • No constraints: you may move in every direction. If $\nabla f\ne0$, the direction $d=-\nabla f$ gives $\nabla f^\top d=-\|\nabla f\|^2\lt0$: downhill. So a minimum needs $\nabla f=0$.
  • With constraints: you may only move in allowed directions. At $(1,1)$ in section 0, the downhill direction $d=-\nabla f=(2,2)$ leaves the feasible set (it increases $x_1+x_2$). Every direction that stays feasible (with $d_1+d_2\le0$) has $\nabla f^\top d=-2(d_1+d_2)\ge0$: not downhill. So $(1,1)$ is a minimum although $\nabla f\ne0$.

So the correct condition must be: "$\nabla f(x^\star)^\top d\ge0$ for every allowed direction $d$". The next section makes "allowed direction" precise. It is subtler than it looks, because on a curved constraint no straight line stays feasible.

B. Which directions are you allowed to move in? Two cones

B1. Straight rays fail on curved constraints

First idea: call $d$ allowed if the straight ray $x^\star+td$ stays feasible for all small $t\gt0$ (a "feasible direction"). This works for straight-line constraints, but not for curved ones.

Example: $\Omega=\{(u,v):\ v=u^2\}$, a parabola, at the origin. Which straight rays stay on it? The point $(t\,d_1,t\,d_2)$ is on the parabola only if $t\,d_2=t^2d_1^2$ for all small $t$, which forces $d=0$. So no direction is a feasible direction, yet you can obviously move along the curve. The feasible-direction idea throws away everything.

Better idea: allow curves. Walk along feasible points $x_k=(t_k,t_k^2)$ towards the origin. The chord from the origin to $x_k$, scaled by $1/t_k$, is $(1,t_k)$, which tends to $(1,0)$ as $t_k\to0$. So $(1,0)$ is the direction from which feasible points approach the origin. That's a tangent direction.

uv Ξ©: v = uΒ² x_k = (t_k, t_kΒ²) tangent d = (1,0) Γ—Γ— Γ— = points (t,0) of the straight ray: not feasible (0 β‰  tΒ²)
Blue: the feasible set $v=u^2$. Dashed chords from the origin to feasible points $x_k$ flatten towards the horizontal as $x_k$ gets closer, so the limiting direction is $d=(1,0)$ (green). The straight ray $(t,0)$ itself (red Γ—) leaves the set immediately. A tangent direction is a limit of directions to feasible points, not a direction you can travel in a straight line.

B2. The tangent cone $T_\Omega(x^\star)$: the honest set of directions

In plain words: $d$ is a tangent direction if there are feasible points approaching $x^\star$ "from direction $d$".

Precisely (Def. 6.1.2.1): $d\in T_\Omega(x^\star)$ if there are numbers $t_k\gt0$, $t_k\downarrow0$, and vectors $d_k\to d$ with

$$x^\star+t_kd_k\in\Omega\quad\text{for every }k.$$

Read it as: $x_k=x^\star+t_kd_k$ are feasible points; $t_k$ is how far away they are (roughly), $d_k=(x_k-x^\star)/t_k$ is the scaled direction to them, and these directions settle down to $d$. The $d_k$ need not have length 1. In the parabola example, $t_k$ is the $u$-value and $d_k=(1,t_k)\to(1,0)$.

  • $d=0$ is always in $T_\Omega$ (take $x_k=x^\star$). If $d\in T_\Omega$ then so is $s\,d$ for $s\gt0$ (rescale $t_k$). So $T_\Omega$ is a cone.
  • For the parabola at the origin, $T_\Omega=\{(d_1,0)\}$: the whole horizontal line (approach from the left with $u\lt0$ too: take feasible points $x_k=(-s_k,s_k^2)$ with $s_k\downarrow0$ and $t_k=|u_k|=s_k\gt0$; then $d_k=(x_k-0)/t_k=(-1,s_k)\to(-1,0)$, so $(-1,0)\in T_\Omega$).
  • If $x^\star$ is an interior point (no active constraints, no equalities), $T_\Omega=\mathbb R^n$.

The problem with $T_\Omega$: it's defined by limits of sequences of points. You can't compute it by a formula. So we look for a formula-based replacement.

B3. The linearised cone $\mathcal L_\Omega(x^\star)$: what the gradients claim

In plain words: replace each constraint by its first-order (linear) approximation at $x^\star$, and ask which directions keep the linear versions satisfied.

  • Equality $h_i$: to first order $h_i(x^\star+td)\approx h_i(x^\star)+t\,\nabla h_i(x^\star)^\top d=t\,\nabla h_i^\top d$. To stay at 0 we need $\nabla h_i(x^\star)^\top d=0$ (move along the surface, not across it).
  • Active inequality ($g_j(x^\star)=0$): $g_j(x^\star+td)\approx t\,\nabla g_j^\top d$. To stay $\le0$ we need $\nabla g_j(x^\star)^\top d\le0$ (don't move outward through the wall). $\nabla g_j$ is the wall's outward normal: it points to where $g_j$ increases, i.e. out of the feasible side.
  • Inactive inequalities: no condition (small moves keep them strictly negative).

Precisely (Def. 6.1.3.1):

$$\mathcal L_\Omega(x^\star)=\{d:\ \nabla h_i(x^\star)^\top d=0\ \ \forall i,\qquad \nabla g_j(x^\star)^\top d\le0\ \ \forall j\in\mathcal A(x^\star)\}.$$

This is a finite list of linear conditions, so you can always write it down. It is a closed convex cone. (A set is convex if the straight segment between any two of its points stays inside it; closed if it contains the limits of its convergent sequences, e.g. it is cut out by "$=$" and "$\le$", never "$\lt$".)

Numbers: parabola $h(u,v)=v-u^2$: $\nabla h=(-2u,1)=(0,1)$ at the origin, so $\mathcal L=\{d:d_2=0\}$, the horizontal line. Same as $T_\Omega$. Good, here the gradients told the truth.

Check B3. $g_1=-u\le0$, $g_2=-v\le0$ at the origin. Write $\mathcal L_\Omega$.
Show answer

Both active, $\nabla g_1=(-1,0)$, $\nabla g_2=(0,-1)$: $-d_1\le0$, $-d_2\le0$, i.e. $\mathcal L=\{d:d_1\ge0,\ d_2\ge0\}$, the first quadrant. (Constraints are linear, so this is also $T_\Omega$.)

B4. Why $T_\Omega\subseteq\mathcal L_\Omega$ always (the gradients can only over-promise)

Take a tangent direction $d$: feasible points $x_k=x^\star+t_kd_k$ with $t_k\downarrow0$, $d_k\to d$.

  1. Equality $h_i$: $0=h_i(x_k)=h_i(x^\star)+t_k\nabla h_i(x^\star)^\top d_k+o(t_k)$ (Taylor; $o(t_k)$ means "a remainder that, divided by $t_k$, goes to 0").
  2. $h_i(x^\star)=0$, so $0=t_k\nabla h_i^\top d_k+o(t_k)$. Divide by $t_k\gt0$: $0=\nabla h_i^\top d_k+o(1)$.
  3. Let $k\to\infty$: $\nabla h_i(x^\star)^\top d=0$.
  4. Active $g_j$: same steps with "$\le$": $0\ge g_j(x_k)=0+t_k\nabla g_j^\top d_k+o(t_k)$ β‡’ $\nabla g_j(x^\star)^\top d\le0$.

So every tangent direction passes the linearised tests: $\boxed{T_\Omega(x^\star)\subseteq\mathcal L_\Omega(x^\star)}$ (Theorem 6.1.1, needs only $C^1$ constraints, i.e. continuously differentiable). The reverse can fail: the linear test can accept directions that no feasible points come from, when a gradient is zero or the gradients are "degenerate".

uv = 0 at the origin T = both axes (= Ξ© itself) 𝓛 = whole plane (shaded) βˆ‡h = (v,u) = (0,0): the linear test is "0 = 0" vΒ³ = 0 at the origin Ξ© = T = u-axis 𝓛 = whole plane (shaded) βˆ‡h = (0, 3vΒ²) = (0,0): again "0 = 0"
Blue: the true feasible set, which here is also the tangent cone. Orange shading: the linearised cone. In both cases the constraint gradient is zero at the origin, so the linear test accepts every direction and $T_\Omega\subsetneq\mathcal L_\Omega$. Note $v^3=0$ is the same set as $v=0$, but $v=0$ has $\nabla h=(0,1)$ and gives $\mathcal L=$ the $u$-axis $=T$. Whether $T=\mathcal L$ depends on how the constraint is written.

Also note: for $uv=0$, $T_\Omega$ is the union of two lines. It contains $(1,0)$ and $(0,1)$ but not their sum $(1,1)$, so it is not convex and not a subspace. $\mathcal L_\Omega$ is always convex.

B5. LICQ: the condition that makes the gradients honest

In plain words: the gradients that matter at $x^\star$ (all equalities and the active inequalities) point in genuinely different directions: none of them is zero and none is a combination of the others. Then the linear picture is faithful and $T_\Omega=\mathcal L_\Omega$.

Precisely (Def. 6.1.4.1): $x^\star$ is a regular point (LICQ holds) if

$$\{\nabla h_i(x^\star)\}_{i=1}^m\ \cup\ \{\nabla g_j(x^\star)\}_{j\in\mathcal A(x^\star)}\ \text{ is linearly independent.}$$

Theorem 6.1.1: if $x^\star$ is regular, then $T_\Omega(x^\star)=\mathcal L_\Omega(x^\star)$. (Why, in one line: with independent gradients you can bend any straight ray $x^\star+td$, $d\in\mathcal L$, by a tiny correction so it stays on the constraints; this uses the implicit function theorem, and the proof isn't examined.)

How to check it: put the relevant gradients as columns of a matrix; LICQ ⇔ that matrix has full column rank. With two gradients in 2-D: determinant $\ne0$. With one gradient: it is nonzero. With no active constraints and no equalities: LICQ holds automatically ("vacuously").

The Midterm 2 III problem (used again in D3, E5 and Practice D) $$\min f(x)=x_1^2+x_2^2\quad\text{s.t.}\quad g_1=4-x_1-x_2^2\le0,\quad g_2=3x_2-x_1\le0,\quad g_3=-3x_2-x_1\le0.$$

In words: stay to the right of the parabola $x_1=4-x_2^2$ and inside the wedge $x_1\ge3|x_2|$; find the feasible point nearest the origin. Its KKT points (found in Practice D) are $(4,0)$ with $\mu=(8,0,0)$, and the corners $(3,\pm1)$ with $\mu=(4,2,0)$ resp. $(4,0,2)$.

Worked example (Midterm 2 III at the corner (3,1)) Active: $g_1=4-x_1-x_2^2$ and $g_2=3x_2-x_1$. $\nabla g_1=(-1,-2x_2)=(-1,-2)$, $\nabla g_2=(-1,3)$. $\det\begin{pmatrix}-1&-1\\-2&3\end{pmatrix}=(-1)(3)-(-1)(-2)=-3-2=-5\ne0$ β‡’ LICQ holds.
  • Another way to get $T=\mathcal L$: if all constraints are linear (affine), then $T=\mathcal L$ even if LICQ fails. E.g. $v=0$ and $2v=0$ together: dependent gradients $(0,1),(0,2)$, but both cones are the $u$-axis. So LICQ is sufficient, not necessary.
  • LICQ is a property of the representation: $v=0$ is regular at the origin, $v^3=0$ and $v^2=0$ are not.
Check B5. Constraints $h=x_1+x_2+x_3=0$, $g_1=-x_1\le0$, $g_2=-x_2\le0$ at $x=0$. Is it regular?
Show answer

Active: $g_1,g_2$. Columns $(1,1,1)$, $(-1,0,0)$, $(0,-1,0)$; the matrix $\begin{pmatrix}1&-1&0\\1&0&-1\\1&0&0\end{pmatrix}$ has determinant $1\ne0$ β‡’ regular. (This is Midterm 2 V.)

Tangent cone T vs linearised cone 𝓛

Pick a constraint set. The left panel shows the feasible set Ξ© near the origin and the constraint gradients there; the right panel shows the true tangent directions T (green) and the directions the gradients accept, 𝓛 (gold). Drag the arrow d on the right (or use the slider) and see whether it is in T and in 𝓛.

What to notice. Whenever LICQ says yes, green and gold coincide ($T=\mathcal L$). When a gradient is zero ($uv=0$, $v^3=0$) the gold fills the whole plane: 𝓛 accepts directions such as $d=(1,1)$ that no feasible points come from. $v^3=0$ and $v=0$ are the same set with different 𝓛, because LICQ is about the formula, not the set. "$v=0$ and $2v=0$": LICQ fails yet $T=\mathcal L$ (linear constraints), so LICQ is sufficient, not necessary. Cusp: 𝓛 is the whole $u$-axis but T only its left half.

C. The first-order condition, and how Farkas turns it into multipliers

C1. At a minimum, no tangent direction goes downhill

Plain words: if some tangent direction $d$ had $\nabla f^\top d\lt0$, the feasible points approaching from $d$ would have smaller $f$ than $x^\star$ (for points close enough). So at a local minimum that can't happen.

Theorem 6.2.1 (fundamental FONC: no constraint qualification needed)

If $x^\star$ is a local minimiser of $f$ over $\Omega$ and $f$ is differentiable at $x^\star$, then

$$\nabla f(x^\star)^\top d\ \ge\ 0\qquad\text{for every }d\in T_\Omega(x^\star).$$

This is the only theorem he proves in the chapter; the proof is in section H. It's correct but not usable yet, because $T_\Omega$ is hard to compute and there are infinitely many $d$ to check.

Worked example (Quiz 3 Q12: linear constraints, so T = 𝓛) $f=u+2v$ on $u+v+w=0$, $u\ge0$, $v\le1$. Is the origin a local min?
  1. Course form: $h=u+v+w$, $g_1=-u\le0$ (active at 0), $g_2=v-1\le0$ (value $-1$: inactive).
  2. Linear constraints β‡’ $T=\mathcal L=\{d=(d_1,d_2,d_3):\ d_1+d_2+d_3=0,\ -d_1\le0\}$.
  3. $\nabla f=(1,2,0)$. Try $d=(0,-1,1)$: $0-1+1=0$ βœ“ and $d_1=0\ge0$ βœ“, so $d\in T$. $\nabla f^\top d=0-2+0=-2\lt0$.
  4. A downhill tangent direction exists β‡’ FONC fails β‡’ the origin is not a local min.
  5. Careful: $(-1,0,1)$ also gives $\nabla f^\top d=-1$, but it is not tangent ($d_1=-1\lt0$ breaks $u\ge0$).

The plan from here: (1) at a regular point, replace $T$ by $\mathcal L$, which is a list of linear inequalities; (2) use Farkas' lemma to replace "for every $d$" by "there exist a few numbers". Those numbers are the multipliers.

C2. Farkas' lemma: from "every direction" to "a few numbers"

The picture first. Take a corner where two walls are active: $g_1=x_1-1\le0$ and $g_2=x_2-1\le0$ at $x^\star=(1,1)$, and $f=(x_1-2)^2+(x_2-2)^2$. The outward normals are $\nabla g_1=(1,0)$ and $\nabla g_2=(0,1)$. Allowed directions ($\mathcal L$) satisfy $d_1\le0$, $d_2\le0$: they point back into the box.

feasible: x₁ ≀ 1, xβ‚‚ ≀ 1 cone of normals: ΞΌβ‚βˆ‡g₁ + ΞΌβ‚‚βˆ‡gβ‚‚, ΞΌ β‰₯ 0 βˆ‡g₁=(1,0) βˆ‡gβ‚‚=(0,1) βˆ’βˆ‡f = (2,2) (2,2) a different βˆ’βˆ‡f = (1,βˆ’2): outside the cone β‡’ not KKT x*
Blue: the feasible box near the corner $x^\star=(1,1)$. Green: the active walls' outward normals and the cone they span (all non-negative combinations). Red solid: $-\nabla f=(2,2)=2\nabla g_1+2\nabla g_2$ lies inside the cone, so $\mu=(2,2)\ge0$ exists and $x^\star$ is a KKT point. Red dashed: if $-\nabla f$ were $(1,-2)$, it would need $\mu_2=-2\lt0$; then the allowed direction $d=(0,-1)$ (slide down along the wall $x_1=1$) has $\nabla f^\top d=-2\lt0$: downhill.

What the picture says: "no allowed direction goes downhill" is the same as "the downhill arrow $-\nabla f$ lies in the cone of the active outward normals", i.e. $-\nabla f=\sum\mu_j\nabla g_j$ with all $\mu_j\ge0$. If $-\nabla f$ pokes out of that cone, you can find an allowed direction making an acute angle with it, and that direction is downhill.

Why the weights on equalities have no sign: an equality $h=0$ is like two walls, $h\le0$ and $-h\le0$, with normals $\nabla h$ and $-\nabla h$. Non-negative weights on both give any real weight on $\nabla h$. So $\lambda$ is free.

Lemma 6.3.1 (Farkas, course form)

Let $A$ be an $n\times m$ matrix, $B$ an $n\times r$ matrix, $c\in\mathbb R^n$. These two statements are equivalent:

  • Directional form: $d^\top c\ge0$ for every $d$ with $A^\top d=0$ and $B^\top d\le0$.
  • Multiplier form: there exist $\lambda\in\mathbb R^m$ (no sign restriction) and $\mu\in\mathbb R^r$, $\mu\ge0$, with $c+A\lambda+B\mu=0$.

No rank assumption on $A$ or $B$.

The easy direction, by hand (multiplier form β‡’ directional form): suppose $c=-A\lambda-B\mu$ with $\mu\ge0$. Take any $d$ with $A^\top d=0$, $B^\top d\le0$. Then

$$d^\top c=-(A^\top d)^\top\lambda-(B^\top d)^\top\mu=-0-\underbrace{(B^\top d)^\top\mu}_{\le0\ \text{(each term: }\le0\text{ times }\ge0)}\ \ge0.$$

The other direction is the hard part of the lemma (it uses a separating-hyperplane argument); he doesn't ask for it. Know the statement and the signs.

Check C2. In Farkas, which sign does $\mu$ get if the directional form says $B^\top d\ge0$ instead of $\le0$?
Show answer

$\mu\le0$ (flip $B\to-B$). That is exactly what happens if you write $g\ge0$ constraints and keep "$+\mu g$": the multiplier signs flip. Hence the rule: always $g\le0$.

C3. Putting it together: the equation worth 70% of the marks

Chain of reasoning (Theorem 6.3.2), at a local minimiser $x^\star$ that is regular:

  1. Local min β‡’ $\nabla f(x^\star)^\top d\ge0$ for all $d\in T_\Omega$ (C1, no assumption).
  2. Regular β‡’ $T_\Omega=\mathcal L_\Omega$, so $\nabla f^\top d\ge0$ for all $d$ with $\nabla h_i^\top d=0$, $\nabla g_j^\top d\le0$ ($j$ active) (B5).
  3. Farkas with $c=\nabla f(x^\star)$, $A=$ columns $\nabla h_i(x^\star)$, $B=$ columns $\nabla g_j(x^\star)$ for $j\in\mathcal A$ β‡’ there are $\lambda$ free and $\mu_j\ge0$ with
Active-set first-order condition ("this equation") $$\nabla f(x^\star)+\sum_{i=1}^m\lambda_i\nabla h_i(x^\star)+\sum_{j\in\mathcal A(x^\star)}\mu_j\nabla g_j(x^\star)=0,\qquad \mu_j\ge0\ \ (j\in\mathcal A).$$

He said at exactly this point: Gradient plus weighted sum of equality gradients plus weighted sum of active inequality gradients should sum up to zero… those weights Ξ» are unrestricted, and ΞΌ are non-negative Ch 6 lec 3 [10:00–10:30], then Seventy percent of mark is covered by memorizing this equation and the following KKT [11:30].

The only annoyance: the sum runs over the active set, which you don't know in advance. KKT (next section) hides it.

D. The KKT conditions, and how to solve them by hand

D1. The five parts

The trick that hides the active set: give every inequality a multiplier $\mu_j\ge0$, and demand $\mu_j g_j(x^\star)=0$ for every $j$. That product condition (complementary slackness) says, in plain words:

  • If constraint $j$ is inactive ($g_j\lt0$), its multiplier must be $\mu_j=0$: a wall you aren't touching can't push you.
  • If $\mu_j\gt0$ (the wall is pushing), then $g_j=0$: you must be on that wall.
  • Active with $\mu_j=0$ is allowed: you're on the wall but it isn't pushing (the minimum would be there even without that wall).

So $\sum_{j=1}^p\mu_j\nabla g_j$ over all $j$ equals the active-only sum from C3. With the Lagrangian $\ell(x,\lambda,\mu)=f(x)+\sum_i\lambda_ih_i(x)+\sum_j\mu_jg_j(x)$ (plus signs everywhere), the first condition is just "$\nabla_x\ell=0$".

Theorem 6.3.3 (KKT necessary conditions)

If $f,h_i,g_j$ are $C^1$ near a local minimiser $x^\star$ and $x^\star$ is regular, then there exist $\lambda^\star\in\mathbb R^m$, $\mu^\star\in\mathbb R^p$ with:

  1. Stationarity: $\nabla f(x^\star)+\sum_{i=1}^m\lambda_i^\star\nabla h_i(x^\star)+\sum_{j=1}^p\mu_j^\star\nabla g_j(x^\star)=0$, i.e. $\nabla_x\ell=0$.
  2. Primal feasibility (equalities): $h_i(x^\star)=0$ for all $i$.
  3. Primal feasibility (inequalities): $g_j(x^\star)\le0$ for all $j$.
  4. Dual feasibility: $\mu_j^\star\ge0$ for all $j$. ($\lambda^\star$: no sign restriction.)
  5. Complementarity: $\mu_j^\star g_j(x^\star)=0$ for all $j$.

A point $x^\star$ with such multipliers is a KKT point. Under LICQ the multipliers are unique (the gradients are independent, so the combination is unique). That says nothing about the minimiser being unique.

Useful fact: since every product $\mu_jg_j$ is $\le0$ (a $\ge0$ number times a $\le0$ number), the single equation $\sum_j\mu_jg_j=0$ already forces each product to be 0; nothing can cancel.

Check D1. At a KKT point, which of these must be true? (i) $g_j\lt0\Rightarrow\mu_j=0$; (ii) $g_j=0\Rightarrow\mu_j\gt0$; (iii) $\mu_j\gt0\Rightarrow g_j=0$.
Show answer

(i) and (iii). (ii) is false: an active wall can have $\mu_j=0$ (e.g. $\min x^2$ s.t. $-x\le0$ at $x=0$: $2\cdot0-\mu=0$ β‡’ $\mu=0$, yet the constraint is active). He called this an important distinction you have to remember Ch 6 lec 2 [29:00].

D2. The signs, once more, with a picture in mind

  • $g\le0$ and "$+\mu g$" with $\mu\ge0$: stationarity says $-\nabla f=\sum\mu_j\nabla g_j$, the downhill arrow is a non-negative mix of outward normals. It's the section-0 picture: $-\nabla f=(2,2)=2\cdot(1,1)$, $\mu=2$.
  • $\lambda$ free: an equality can push either way.
  • Write the Lagrangian for the worked rewrite of A1: $\ell=-x_1x_2+\lambda(x_1^2+x_2^2-4)+\mu_1(1-x_1-x_2)+\mu_2(x_2-3)$, $\lambda$ free, $\mu_1,\mu_2\ge0$.
Trap: the wrong-sign student $\min(x_1+1)^2+x_2^2$ s.t. $x_1\ge0$. A student writes $\ell=f+\mu x_1$: at $(0,0)$, $(2,0)+\mu(1,0)=0$ gives $\mu=-2$ and he rejects the true minimum. Course form $g=-x_1$: $(2,0)+\mu(-1,0)=0$ β‡’ $\mu=2\ge0$ βœ“. (Practice A1.)

D3. Solving KKT by hand: try every active set

Why this works: complementarity says each inequality is either "on the wall" ($g_j=0$) or "not pushing" ($\mu_j=0$). Guess which ones are on the wall (an active set guess $\mathcal A$), and every product $\mu_jg_j=0$ turns into a plain equation. With $p$ inequalities there are $2^p$ guesses. For each guess:

  1. Set $\mu_j=0$ for $j\notin\mathcal A$ and $g_j(x)=0$ for $j\in\mathcal A$.
  2. Solve stationarity + equalities + those $g_j=0$ for $x$, $\lambda$, $\mu_{\mathcal A}$. (Now as many equations as unknowns.) If the system is nonlinear (curved constraints, products like $x_2(1-\mu_1)=0$), split it into branches ("$x_2=0$ or $\mu_1=1$"), solve every branch, and carry each solution forward as a separate candidate; a guess can give several points or none.
  3. Keep the solution only if $\mu_j\ge0$ for $j\in\mathcal A$ and $g_j(x)\le0$ for $j\notin\mathcal A$. Write down which condition kills each rejected case; marks are given for that.
Fully by hand: min (xβ‚βˆ’2)Β² + (xβ‚‚βˆ’1)Β² s.t. x₁ + xβ‚‚ ≀ 2, x₁ β‰₯ 0
  1. Course form. $g_1(x)=x_1+x_2-2\le0$, $g_2(x)=-x_1\le0$. No equalities.
  2. Lagrangian. $\ell=(x_1-2)^2+(x_2-1)^2+\mu_1(x_1+x_2-2)+\mu_2(-x_1)$.
  3. All five KKT parts. $$\begin{aligned} &\partial\ell/\partial x_1:\ 2(x_1-2)+\mu_1-\mu_2=0 &&\text{(S1)}\\ &\partial\ell/\partial x_2:\ 2(x_2-1)+\mu_1=0 &&\text{(S2)}\\ &x_1+x_2\le2,\quad -x_1\le0;\qquad \mu_1,\mu_2\ge0;\qquad \mu_1(x_1+x_2-2)=0,\ \ \mu_2x_1=0. \end{aligned}$$
  4. Guess $\mathcal A=\varnothing$ ($\mu_1=\mu_2=0$). (S1): $2(x_1-2)=0$ β‡’ $x_1=2$. (S2): $x_2=1$. Check $g_1=2+1-2=1\gt0$: infeasible, reject. (The unconstrained minimum breaks the first wall.)
  5. Guess $\mathcal A=\{1\}$ ($\mu_2=0$, $x_1+x_2=2$). (S2): $x_2=1-\mu_1/2$. (S1): $x_1=2-\mu_1/2$. Add them: $x_1+x_2=3-\mu_1$. Set equal to 2: $3-\mu_1=2$ β‡’ $\mu_1=1$. So $x=(3/2,\,1/2)$. Checks: $\mu_1=1\ge0$ βœ“; inactive $g_2=-3/2\lt0$ βœ“. KKT point $x^\star=(3/2,1/2)$, $\mu^\star=(1,0)$.
  6. Guess $\mathcal A=\{2\}$ ($\mu_1=0$, $x_1=0$). (S2): $x_2=1$. (S1): $2(0-2)-\mu_2=0$ β‡’ $\mu_2=-4\lt0$: dual feasibility fails, reject. (Pressing against $x_1\ge0$ would need a pull, not a push.)
  7. Guess $\mathcal A=\{1,2\}$ ($x_1=0$, $x_1+x_2=2$ β‡’ $x_2=2$). (S2): $2(2-1)+\mu_1=0$ β‡’ $\mu_1=-2\lt0$: reject. (For the record (S1) gives $\mu_2=-6$.)
  8. LICQ at the survivor. Only $g_1$ active, $\nabla g_1=(1,1)\ne0$ βœ“. LICQ holds at every feasible point here (linear constraints, never both gradients dependent), so every local min must be among the KKT points: the only candidate is $(3/2,1/2)$.
  9. Sanity check with geometry. $f$ is squared distance to $(2,1)$; the nearest point of the line $x_1+x_2=2$ is $(2,1)-\frac{(2+1-2)}{2}(1,1)=(3/2,1/2)$ βœ“. Whether it is a minimum is decided in E5 (second order).

Shortcuts to kill cases fast (from Midterm 2):

  • Geometrically impossible sets: if forcing some $g_j=0$ together makes another constraint fail, that exact active set never occurs (Midterm 2 III.1, problem in B5: $g_2=g_3=0$ forces $x=0$, where $g_1=4\gt0$).
  • Too many actives: more active constraints than unknowns usually has no solution; if it has one, check LICQ (more than $n$ gradients in $\mathbb R^n$ can't be independent).
  • Sign contradictions: Midterm 2 IV (Practice E1): $\min\tfrac12[(x_1-a)^2+(x_2+1)^2]$ s.t. $g_1=x_1^2+x_2^2-1\le0$, $g_2=-x_2\le0$; the second stationarity equation is $(1+2\mu_1)x_2+1-\mu_2=0$. If $x_2\gt0$ then $\mu_2=0$ and $(1+2\mu_1)x_2+1=0$ is impossible, so $x_2=0$ at every KKT point.
  • Homogeneity trick: when the $g_j$ are linear with no constant term, $\nabla g_j^\top x=g_j(x)$; dotting stationarity with $x$ then kills the multiplier terms by complementarity (Midterm 2 III.2, problem in B5: with $\mu_1=0$ it gives $2\|x\|^2=0$).
Check D3. $\min(x-2)^2$ s.t. $g(x)=x-1\le0$. Do both active-set cases.
Show answer

$\ell=(x-2)^2+\mu(x-1)$, stationarity $2(x-2)+\mu=0$. Inactive ($\mu=0$): $x=2$, but $g=1\gt0$: reject. Active ($x=1$): $\mu=2\ge0$ βœ“. KKT pair $(x^\star,\mu^\star)=(1,2)$. (Quiz 3 Q14.)

KKT at a point: drag the target, watch the active set and the multipliers

Problem: $\min f=(x_1-a)^2+(x_2-b)^2$ over the triangle $x_1\ge0,\ x_2\ge0,\ x_1+x_2\le2$, so $x^\star$ is the feasible point nearest the target $(a,b)$. Drag the red target (or use the sliders) and watch the active walls (gold), the red arrow $-\nabla f(x^\star)$ and how it splits into $\mu_i\nabla g_i$ (dashed gold). It starts at $(2,1)$, the D3 example.

What to notice. Target inside the triangle: nothing active, all $\mu=0$, $x^\star$ = target. Past the slanted edge: only $g_3$ active and $-\nabla f$ points straight out through it ($\mu_3\gt0$). Past a corner: two walls active and $-\nabla f$ lies inside the gold cone of their normals, so both $\mu$'s are $\ge0$. Put the target at $(3,1)$: $x^\star=(2,0)$ with $g_2$ active but $\mu_2=0$; that is the moment a multiplier hits 0, just before its wall drops out of the active set (move the target up a little and $g_2$ is gone). The βœ“/βœ— list repeats the D3 recipe live: every wrong guess dies by infeasibility or a negative $\mu$.

D4. When KKT fails at a true minimum (and why that's no contradiction)

KKT is guaranteed only at regular points. He stressed: KKT is necessary only when the point is regular. Very important. Ch 6 lec 4 [22:30]

Example: min x s.t. βˆ’xΒ³ ≀ 0
  1. Feasible set: $-x^3\le0$ ⇔ $x\ge0$. So $x^\star=0$ is the global minimum.
  2. $g'(x)=-3x^2$, so $g'(0)=0$: LICQ fails (the only active gradient is zero).
  3. Stationarity: $1+\mu\cdot0=0$, impossible for every $\mu$. KKT fails.
  4. The geometric FONC still holds: $T=[0,\infty)$ and $f'(0)d=d\ge0$ there. What broke is step 2 of C3: $\mathcal L=\mathbb R$ (since the gradient is 0) is bigger than $T$, and $d=-1\in\mathcal L$ "looks" downhill.
  5. Rewrite the same set as $-x\le0$: now $g'=-1\ne0$, regular, and $\mu=1$ works.

The other direction needs no LICQ: if $x^\star$ satisfies KKT, then $\nabla f^\top d\ge0$ on all of $\mathcal L$ (Farkas, easy direction), hence on $T\subseteq\mathcal L$. He: A feasible KKT point satisfies the tangent cone first order condition even without LICQ. Okay, it's very important. Ch 6 lec 2 [44:30]

Consequence for exams: after finding KKT points, ask "could a non-regular feasible point be a minimum that my KKT search missed?" If LICQ holds at every feasible point, no.

E. Second order: telling minima from saddles

E1. Why first order isn't enough

KKT is only necessary. Compare two problems at $x=0$, both with the wall $g=-x\le0$:

  • $\min x^2$: stationarity $2x-\mu=0$ at 0 β‡’ $\mu=0$. KKT holds. And 0 is the minimum.
  • $\min -x^2$: stationarity $-2x-\mu=0$ at 0 β‡’ $\mu=0$. KKT holds. But $f(t)=-t^2\lt0$ for $t\gt0$: 0 is not a minimum.

First-order information is identical ($\nabla f(0)=0$ in both). The difference is curvature. At a KKT point, every direction $d\in\mathcal L$ has $\nabla f^\top d\ge0$. Directions with $\nabla f^\top d\gt0$ are settled (uphill at first order). Directions with $\nabla f^\top d=0$ are ties: first order says nothing, just like $f'(x)=0$ in 1-D could be a min, a max or an inflection. On the ties we must look at second derivatives.

E2. Which Hessian? The Lagrangian's, because constraints bend

The surprise first. $\min f=v-u^2$ s.t. $h=v-2u^2=0$, at the origin.

  1. $\nabla f=(-2u,1)=(0,1)$, $\nabla h=(-4u,1)=(0,1)\ne0$ β‡’ regular. Stationarity $(0,1)+\lambda(0,1)=0$ β‡’ $\lambda^\star=-1$.
  2. Tie directions: $\nabla f^\top d=d_2=0$, i.e. $d=(d_1,0)$, along the $u$-axis.
  3. $\nabla^2 f=\begin{pmatrix}-2&0\\0&0\end{pmatrix}$: along $d=(1,0)$ the curvature of $f$ is $-2$. "Looks like a maximum"?
  4. But walk along the feasible curve $v=2u^2$: $f(u,2u^2)=2u^2-u^2=u^2$. It's a strict minimum.

Why: the feasible curve bends upward, and $f$ increases in $v$ ($\partial f/\partial v=1$), so the bending of the constraint adds curvature. The Lagrangian accounts for it automatically:

$$\mathbf L_\star=\nabla^2f+\lambda^\star\nabla^2h=\begin{pmatrix}-2&0\\0&0\end{pmatrix}+(-1)\begin{pmatrix}-4&0\\0&0\end{pmatrix}=\begin{pmatrix}2&0\\0&0\end{pmatrix},\qquad d^\top\mathbf L_\star d=2d_1^2\gt0.$$

Why the Lagrangian is the right function (the reason in three lines). Take feasible points $x(t)$ near $x^\star$ that stay on the equalities and on the walls with $\mu_j\gt0$. On them $h_i=0$ and those $g_j=0$, so $f(x(t))=\ell(x(t))$. Taylor-expand $\ell$ around $x^\star$:

$$f(x(t))-f(x^\star)=\ell(x(t))-\ell(x^\star)=\underbrace{\nabla_x\ell^\top(x(t)-x^\star)}_{=0\text{ by stationarity}}+\tfrac12(x(t)-x^\star)^\top\mathbf L_\star(x(t)-x^\star)+\dots$$

The first-order term vanishes no matter how the path curves, so what's left is the Lagrangian's curvature. With $x(t)-x^\star\approx td$: the change is about $\tfrac12t^2\,d^\top\mathbf L_\star d$. Check on the example: $d=(1,0)$, $\tfrac12t^2\cdot2=t^2$ βœ“ (matches $f(t,2t^2)=t^2$).

Definition $$\mathbf L_\star=\nabla^2_{xx}\ell(x^\star,\lambda^\star,\mu^\star)=\nabla^2f(x^\star)+\sum_i\lambda_i^\star\nabla^2h_i(x^\star)+\sum_j\mu_j^\star\nabla^2g_j(x^\star)\quad\text{(multipliers fixed at their KKT values).}$$

Linear constraints have zero Hessian, so then $\mathbf L_\star=\nabla^2 f$.

Trap Using $\nabla^2 f$ alone with curved constraints. He: objective function or constraint function alone can be misleading Ch 6 lec 4 [45:30]. Quiz 3 Q16 (Practice B8) is this exact trap with $h=v-3u^2$.

E3. The critical cone C: exactly the tie directions

Which directions $d\in\mathcal L_\Omega$ are ties ($\nabla f^\top d=0$)? Use stationarity to rewrite $\nabla f$, then dot with $d$:

$$\nabla f^\top d=-\sum_i\lambda_i^\star\underbrace{\nabla h_i^\top d}_{=0\ (d\in\mathcal L)}-\sum_{j\in\mathcal A}\mu_j^\star\nabla g_j^\top d=\sum_{j\in\mathcal A}\underbrace{\mu_j^\star}_{\ge0}\cdot\underbrace{(-\nabla g_j^\top d)}_{\ge0\ (d\in\mathcal L)}.$$

(Inactive $j$ dropped out because $\mu_j^\star=0$.) Each term is $\ge0$, so the sum is 0 exactly when every term is 0:

  • $j\in\mathcal A_+$ ($\mu_j^\star\gt0$): need $\nabla g_j^\top d=0$. Moving inward off a pushing wall costs first-order increase, so that direction is settled, not a tie. Ties must stay on pushing walls: "$=$" rows.
  • $j\in\mathcal A_0$ ($\mu_j^\star=0$): the term is $0$ anyway. Moving inward off a non-pushing wall costs nothing at first order, so it's still a tie and must still be tested: keep "$\le$" rows.
Definition 6.4.1.1 (critical cone) $$C=\left\{d:\ \begin{array}{ll}\nabla h_i(x^\star)^\top d=0, & i=1,\dots,m\\ \nabla g_j(x^\star)^\top d=0, & j\in\mathcal A_+=\{j\in\mathcal A:\mu_j^\star\gt0\}\\ \nabla g_j(x^\star)^\top d\le0, & j\in\mathcal A_0=\{j\in\mathcal A:\mu_j^\star=0\}\end{array}\right\}\ =\ \{d\in\mathcal L_\Omega:\ \nabla f(x^\star)^\top d=0\}.$$

$C$ is a closed convex cone; it is a subspace when $\mathcal A_0=\varnothing$.

Worked example (notes Ex. 6.4.3.2): f = u + vΒ² on u β‰₯ 0, v β‰₯ 0, at the origin
  1. $g_1=-u$, $g_2=-v$, both active. $\nabla f=(1,2v)=(1,0)$.
  2. Stationarity: $(1,0)+\mu_1(-1,0)+\mu_2(0,-1)=0$ β‡’ $\mu_1=1$, $\mu_2=0$. So $\mathcal A_+=\{1\}$, $\mathcal A_0=\{2\}$.
  3. $\mathcal L=\{d_1\ge0,\ d_2\ge0\}$. $C$: row for $g_1$ becomes $-d_1=0$; row for $g_2$ stays $-d_2\le0$. So $C=\{(0,d_2):\ d_2\ge0\}$, a ray (not the whole line, not $\{0\}$).
  4. $\mathbf L_\star=\nabla^2f=\operatorname{diag}(0,2)$ (linear constraints). On $C$: $d^\top\mathbf L_\star d=2d_2^2\gt0$ for $d_2\gt0$ β‡’ SOSC (next subsection) β‡’ strict local min.
  5. Change to $f=u-v^2$: same $\mu$, same $C$, but $d^\top\mathbf L_\star d=-2d_2^2\lt0$ β‡’ not a min (indeed $f(0,t)=-t^2$). If you had wrongly written "$=$" for the $\mathcal A_0$ row, $C$ would be $\{0\}$ and you would wrongly declare a strict minimum.
uv 𝓛 = first quadrant C = ray (0, dβ‚‚), dβ‚‚ β‰₯ 0 stays on u = 0 (μ₁ = 1 > 0), may leave v = 0 (ΞΌβ‚‚ = 0) d = (1,0): βˆ‡fα΅€d = 1 > 0, settled d = (1,1): βˆ‡fα΅€d = 1 > 0, settled
$f=u+v^2$ on the quadrant, $\nabla f(0)=(1,0)$. Every allowed direction (blue) with $d_1\gt0$ goes uphill at first order. The ties are $d_1=0$, $d_2\ge0$ (green ray): moving up the $v$-axis leaves the wall $v=0$, which is allowed because that wall has $\mu_2=0$. Only the green ray needs the second-order test.
Check E3. $f=v+u^2$ on $u\ge0$, $v\ge0$ at the origin. Find $\mu$, $\mathcal A_+$, $\mathcal A_0$ and $C$. Is the origin a strict local min?
Show answer

$\nabla f=(2u,1)=(0,1)$. $(0,1)+\mu_1(-1,0)+\mu_2(0,-1)=0$ β‡’ $\mu_1=0$, $\mu_2=1$. $\mathcal A_+=\{2\}$ β‡’ $-d_2=0$; $\mathcal A_0=\{1\}$ β‡’ $-d_1\le0$. $C=\{(d_1,0):d_1\ge0\}$, a ray along the $u$-axis. $\mathbf L_\star=\operatorname{diag}(2,0)$ β‡’ $2d_1^2\gt0$ for $d_1\gt0$ β‡’ SOSC β‡’ strict local min.

E4. The second-order conditions (SONC and SOSC)

On $C$, test the sign of $d^\top\mathbf L_\star d$ (curvature of the Lagrangian). The course has two theorems:

Theorem 6.4.1 (SONC: necessary)

$f,h,g$ are $C^2$ (twice continuously differentiable) near $x^\star$, $x^\star$ is a local minimiser, and $x^\star$ is regular β‡’ KKT multipliers exist and $d^\top\mathbf L_\star d\ge0$ for every $d\in C$.

Use it backwards: at a regular KKT point, one $d\in C$ with $d^\top\mathbf L_\star d\lt0$ β‡’ not a local minimiser.

Theorem 6.4.2 (SOSC: sufficient)

$f,h,g$ are $C^2$ near $x^\star$, $(x^\star,\lambda^\star,\mu^\star)$ satisfies KKT, and $d^\top\mathbf L_\star d\gt0$ for every $d\in C$ with $d\ne0$ β‡’ $x^\star$ is a strict local minimiser. No LICQ needed.

He: when we state sufficiency, we always state for strict Ch 6 lec 4 [33:30]; No LICQ assumption is required once KKT is given [34:00].

What you find on $C$Conclusion
$C=\{0\}$SOSC holds (nothing to test) β‡’ strict local min. Never say "SOSC fails" or "not applicable".
$d^\top\mathbf L_\star d\gt0$ for all $0\ne d\in C$SOSC β‡’ strict local min, even if $\mathbf L_\star$ is indefinite or singular on $\mathbb R^n$.
Some $d\in C$ with $d^\top\mathbf L_\star d\lt0$, point regularSONC fails β‡’ not a local min.
$\ge0$ on $C$ but $=0$ for some $d\ne0$SONC holds, SOSC fails β‡’ undecided by these tests (look at $f$ directly).
Negative curvature on $C$ but LICQ failsNo conclusion (SONC needs regularity).

Why $C=\{0\}$ means "strict minimum": then every allowed direction goes strictly uphill at first order, so there are no ties left for curvature to spoil. He: when your critical cone is only zero vector, you don't say SOSC is failed Ch 6 lec 4 [52:00].

Full Hessian negative definite, yet a strict minimum (notes, "the zero critical cone") $f=u+v-u^2-v^2$ on $u\ge0$, $v\ge0$, at the origin.
  1. $\nabla f=(1-2u,\,1-2v)=(1,1)$. Stationarity $(1,1)+\mu_1(-1,0)+\mu_2(0,-1)=0$ β‡’ $\mu=(1,1)$, both $\gt0$.
  2. $C$: $-d_1=0$ and $-d_2=0$ β‡’ $C=\{0\}$ β‡’ SOSC holds β‡’ strict local min.
  3. Yet $\mathbf L_\star=\nabla^2f=-2I$ (negative definite!). Direct check: $f=u(1-u)+v(1-v)\gt0=f(0)$ for feasible $(u,v)\ne0$ with $u,v\lt1/2$ βœ“. (Not a global min: $f\to-\infty$ as $u\to\infty$.)
Traps
  • Testing $\mathbf L_\star$ on all of $\mathbb R^n$ instead of on $C$ (Quiz 3 Q18, Practice B9: $f=u^2+6uv+v^2$ on $u,v\ge0$ at the origin; $\mu=(0,0)$, $C$ = first quadrant, $\mathbf L_\star=\begin{pmatrix}2&6\\6&2\end{pmatrix}$ has eigenvalues $8,-4$ but is positive on $C$).
  • Turning $\mathcal A_0$ rows into "$=$" (shrinks $C$, can fake a pass).
  • Claiming "SONC fails β‡’ not a min" at a non-regular point.
Check E4. At a KKT point, $C=\{t(1,1):t\in\mathbb R\}$ and $\mathbf L_\star=\begin{pmatrix}1&-3\\-3&1\end{pmatrix}$. Conclusion?
Show answer

$d=t(1,1)$: $d^\top\mathbf L_\star d=t^2(1-3-3+1)=-4t^2\lt0$. If the point is regular: SONC fails, not a local min. (Without regularity: no conclusion.)

Critical cone and curvature: SOSC is "positive on C only"

Pick a KKT point and rotate the direction d (slider, or drag on the left). The ring plots $d^\top\mathbf L_\star d$ for every unit direction: outside the dashed circle = positive (green), inside = negative (red), drawn bold where d is in the critical cone C. Blue shading = 𝓛, green shading = C. The bars on the right show the slope $\nabla f^\top d$ and the curvature for the current d.

What to notice. Inside 𝓛 but outside C the slope bar is positive: those directions are already settled at first order, so their curvature does not matter. SOSC only asks for green on the bold part. Quiz 3 Q18 ($u^2+6uv+v^2$): $\mathbf L_\star$ is indefinite (red lobes), but the red lies outside the first quadrant $C$, so SOSC holds. $u-v^2$: C is the ray up the $v$-axis and the ring is red there, so not a minimum. Zero critical cone: the ring is red everywhere, but nothing is bold, so it is a strict minimum. E2 example: tick the trap box and the verdict flips, because the constraint's bending is lost.

E5. Finishing the worked examples

The D3 example: x* = (3/2, 1/2), ΞΌ* = (1, 0)
  1. Active: only $g_1$, with $\mu_1=1\gt0$ β‡’ $\mathcal A_+=\{1\}$, $\mathcal A_0=\varnothing$.
  2. $C=\{d:\ \nabla g_1^\top d=d_1+d_2=0\}=\{t(1,-1)\}$, a line (sliding along the wall).
  3. Constraints linear β‡’ $\mathbf L_\star=\nabla^2f=2I$. $d=t(1,-1)$: $d^\top\mathbf L_\star d=2(t^2+t^2)=4t^2\gt0$ for $t\ne0$.
  4. SOSC β‡’ strict local minimiser. It is the only KKT point and LICQ holds everywhere; $f$ is convex on a convex set, so it is the global minimiser, $f=\tfrac14+\tfrac14=\tfrac12$.
Quiz 3 Q14: x* = 1, ΞΌ* = 2 $\mu\gt0$ β‡’ $C=\{d:\ 1\cdot d=0\}=\{0\}$ β‡’ SOSC holds β‡’ strict local min (global too: convex problem).
Midterm 2 III corners: full Hessian indefinite, yet SOSC (Problem stated in B5.) At $(3,1)$: $\mu=(4,2,0)$, the two active constraints are both in $\mathcal A_+$ with independent gradients β‡’ two "$=$" rows in 2-D β‡’ $C=\{0\}$. $\mathbf L_\star=2I+4\operatorname{diag}(0,-2)=\operatorname{diag}(2,-6)$ is indefinite, but there is no nonzero critical direction β‡’ SOSC β‡’ strict local min.

F. Eigenvector problems (he asked you to practise every variant)

Set-up: $Q$ is symmetric positive definite with distinct eigenvalues $0\lt\theta_1\lt\theta_2\lt\dots\lt\theta_n$ and orthonormal eigenvectors $q_1,\dots,q_n$ ($Qq_i=\theta_iq_i$, $q_i^\top q_j=0$ for $i\ne j$, $\|q_i\|=1$). (Midterm 2 VI wrote $\lambda_i$, $v_i$ for $\theta_i$, $q_i$.)

Picture first. In 2-D with $Q=\operatorname{diag}(1,4)$ ($\theta_1=1$, $\theta_2=4$), the set $x^\top Qx=1$ is an ellipse $x_1^2+4x_2^2=1$ with semi-axes $1/\sqrt{\theta_1}=1$ (along $q_1$) and $1/\sqrt{\theta_2}=1/2$ (along $q_2$). $x^\top x$ is squared distance from the origin, so "max $x^\top x$ on the ellipse" asks for the farthest ellipse point (the long axis), and "min" for the nearest (the short axis).

Β±q₁/βˆšΞΈβ‚ Β±qβ‚‚/βˆšΞΈβ‚‚ xα΅€Qx = 1 (θ₁=1, ΞΈβ‚‚=4) farthest: xα΅€x = 1/θ₁ = 1 nearest: xα΅€x = 1/ΞΈβ‚‚ = 1/4
Blue: $x^\top Qx\le1$ (filled) and its boundary. Red circle touches the ellipse at the ends of the long axis: the maximum of $x^\top x$ is $1/\theta_1$ at $\pm q_1/\sqrt{\theta_1}$. Green circle touches at the ends of the short axis: the minimum of $x^\top x$ on the boundary is $1/\theta_n$ at $\pm q_n/\sqrt{\theta_n}$.
Eigenvector problem: max / min $x^\top x$ on the ellipse $x^\top Qx=1$

Drag the black point x around the ellipse (or use the position slider), and change $\theta_1,\theta_2$ (the eigenvalues of Q) and the rotation of its eigenvectors $q_1,q_2$. Watch the two gradient arrows at x and the graph of $x^\top x$ along the ellipse.

What to notice. The purple arrow (gradient of the objective, $2x$) and the gold arrow (gradient of the constraint, $2Qx$) are parallel only at the four points on the eigenvector axes; that is the KKT condition $x=\mu Qx$. There $x^\top x=1/\theta_i=\mu$: the far pair (red, smallest ΞΈ) is the max and touches the red circle, the near pair (green, largest ΞΈ) is the min. In the graph the eigen-points are exactly the peaks and valleys. Set $\theta_1=\theta_2$: the ellipse becomes a circle and every point is a KKT point.

Why eigenvectors appear: stationarity always has the form "$x$ = number Γ— $Qx$", i.e. $Qx=(\text{number})\,x$, so every boundary KKT point is an eigenvector rescaled to lie on the constraint surface.

Worked template: min xα΅€x s.t. xα΅€Qx β‰₯ 1
  1. Course form. $g=1-x^\top Qx\le0$. $\ell=x^\top x+\mu(1-x^\top Qx)$. (Gradients: $\nabla(x^\top x)=2x$, $\nabla(x^\top Qx)=2Qx$ for symmetric $Q$.)
  2. KKT. $2x-2\mu Qx=0$; $x^\top Qx\ge1$; $\mu\ge0$; $\mu(1-x^\top Qx)=0$.
  3. Inactive β‡’ $\mu=0$ β‡’ $2x=0$ β‡’ $x=0$, but $0^\top Q0=0\lt1$: infeasible. So the constraint is active and $\mu\ne0$.
  4. Active: $x=\mu Qx$ β‡’ $Qx=\tfrac1\mu x$ β‡’ $x$ is an eigenvector: $x=s\,q_i$ with $\tfrac1\mu=\theta_i$, i.e. $\mu=1/\theta_i\gt0$ βœ“. On the surface: $x^\top Qx=s^2\theta_i=1$ β‡’ $s=\pm1/\sqrt{\theta_i}$. KKT points $x_i^\pm=\pm q_i/\sqrt{\theta_i}$, value $f=s^2=1/\theta_i$.
  5. LICQ. $\nabla g=-2Qx=-2\theta_ix\ne0$ βœ“.
  6. Critical cone. $\mu\gt0$ β‡’ "$=$" row: $\nabla g^\top d=0$ ⇔ $x_i^\top d=0$ ⇔ $q_i^\top d=0$. So $C=\operatorname{span}\{q_j:j\ne i\}$: write $d=\sum_{j\ne i}\alpha_jq_j$.
  7. Hessian. $\mathbf L_\star=2I-2\mu Q=2(I-Q/\theta_i)$. With orthonormal $q_j$: $d^\top d=\sum_{j\ne i}\alpha_j^2$ and $d^\top Qd=\sum_{j\ne i}\theta_j\alpha_j^2$, so $$d^\top\mathbf L_\star d=2\sum_{j\ne i}\Big(1-\frac{\theta_j}{\theta_i}\Big)\alpha_j^2.$$
  8. Classify. $i=n$: every $\theta_j\lt\theta_n$ β‡’ every coefficient $\gt0$ β‡’ SOSC β‡’ strict local min. $i\lt n$: $d=q_n$ gives $2(1-\theta_n/\theta_i)\lt0$, regular β‡’ SONC fails.
  9. Global. Feasible set closed and nonempty, $f$ coercive ($\to\infty$ as $\|x\|\to\infty$) β‡’ a global min exists; it's a KKT point (LICQ everywhere) β‡’ $\min=1/\theta_n$ at $\pm q_n/\sqrt{\theta_n}$.
Variant ($Q\succ0$)KKT pointsAnswer
$\max x^\top x$, $x^\top Qx\le1$ (Midterm 2 VI)$0$ ($\mu=0$) and $\pm q_i/\sqrt{\theta_i}$ ($\mu=1/\theta_i$)$1/\theta_1$ at $\pm q_1/\sqrt{\theta_1}$; origin fails SONC
$\max x^\top x$, $x^\top Qx=1$$\pm q_i/\sqrt{\theta_i}$ ($\lambda$ free)$1/\theta_1$ at $\pm q_1/\sqrt{\theta_1}$
$\max x^\top x$, $x^\top Qx\ge1$noneunbounded, no maximiser
$\min x^\top x$, $x^\top Qx\le1$only $x=0$ (boundary would need $\mu\lt0$)$0$ at the origin
$\min x^\top x$, $x^\top Qx=1$ or $\ge1$$\pm q_i/\sqrt{\theta_i}$$1/\theta_n$ at $\pm q_n/\sqrt{\theta_n}$
$\max x^\top Qx$, $x^\top x\le1$ or $=1$ ($Q$ and $I$ swapped)$\pm q_i$ (and $0$ for $\le$)$\theta_n$ at $\pm q_n$
$\min x^\top Qx$, $x^\top x=1$ or $\ge1$$\pm q_i$, multiplier $\theta_i$ (sign per form)$\theta_1$ at $\pm q_1$
$\min x^\top Qx$, $x^\top x\le1$only $0$$0$

Every row was checked numerically (random sampling with eigenvalues 2, 4, 6). The unit-norm versions follow by swapping $Q\leftrightarrow I$: e.g. $\min x^\top Qx$ s.t. $x^\top x=1$ has $\mathbf L_\star=2(Q-\theta_iI)$ on $C=q_i^\perp$ (all vectors orthogonal to $q_i$), giving $2\sum_{j\ne i}(\theta_j-\theta_i)\alpha_j^2$.

Check F. For $\max x^\top x$ s.t. $x^\top Qx\le1$, why is the origin a KKT point, and why is it rejected?
Show answer

With $f=-x^\top x$, $g=x^\top Qx-1$: at 0 the constraint is inactive, $\mu=0$, and $\nabla f(0)=0$ β‡’ KKT holds. $C=\mathbb R^n$, $\mathbf L_\star=-2I$ β‡’ $d^\top\mathbf L_\star d\lt0$ β‡’ SONC fails (the origin is the minimum of $x^\top x$).

G. Counter-example bank (MCQ trap fuel)

Each line is a tiny example you already met; MCQs are built from them.

ExampleWhat it shows
$v=u^2$ (or $v=2u^2$) at the origin$(1,0)\in T_\Omega$ via the curve $(t,t^2)$, but the straight ray $(t,0)$ is infeasible: tangent β‰  feasible-ray direction. Regular, so $T=\mathcal L=\{(d_1,0)\}$.
$uv=0$ at the origin$T$ = union of both axes (not convex, not a subspace); $\nabla h=0$ β‡’ $\mathcal L=\mathbb R^2$; $T\ne\mathcal L$. FONC on $T$ forces $\nabla f(0)=0$.
$v^3=0$ (or $v^2=0$) at the originSame set as $v=0$, so $T=\mathbb R\times\{0\}$, but $\nabla h=0$ β‡’ $\mathcal L=\mathbb R^2$. LICQ depends on the representation.
$v=0$ and $2v=0$ togetherLICQ fails, yet $T=\mathcal L$ (linear constraints). LICQ is sufficient, not necessary.
$\min x$ s.t. $-x^3\le0$$x=0$ is the global min, FONC on $T=[0,\infty)$ holds, but KKT fails: $1+\mu\cdot0=0$ impossible. LICQ fails ($g'(0)=0$). Rewrite as $-x\le0$ β‡’ $\mu=1$.
$\min x^2$ vs $\min -x^2$ s.t. $-x\le0$Both: active at 0 with $\mu=0$ (active ⇏ $\mu\gt0$). $\mathcal A_0=\{1\}$, $C=\{d\ge0\}$. $x^2$: SOSC, strict min. $-x^2$: $\mathbf L_\star=-2$, SONC fails. KKT is only necessary.
$f_\pm=v\pm u^4$ on $v\ge0$Both KKT with $\mu=1$, $C=\{(d_1,0)\}$, $\mathbf L_\star=0$: SONC holds, SOSC fails for both. $f_+$ has a strict min, $f_-$ has no min. Second-order tests can be inconclusive.
$\min v^2-u^2$ s.t. $u^4=0$Strict min (the set is the $v$-axis), but LICQ fails, $C=\mathbb R^2$, $\mathbf L_\star=\operatorname{diag}(-2,2)$: "SONC fails" yet it is a min. SONC needs regularity.
$\min u^2+v^2$ s.t. $u^2=0$LICQ fails, but KKT with $\lambda=0$ and $\mathbf L_\star=2I$ positive definite β‡’ SOSC still certifies a strict min (SOSC needs no LICQ).
$u+v-u^2-v^2$ on the quadrant$C=\{0\}$ with $\mathbf L_\star=-2I$: strict local min anyway.

H. The FONC proof (the only proof in the Ch 6 syllabus)

He: this is the only theorem we'll prove in this chapter Ch 6 lec 1 [1:04:00]. It's short; learn it as a chain of five links.

Statement (Theorem 6.2.1): $x^\star\in\Omega$ a local minimiser, $f$ differentiable at $x^\star$ β‡’ $d^\top\nabla f(x^\star)\ge0$ for all $d\in T_\Omega(x^\star)$.

  1. Pick a tangent direction. $d\in T_\Omega(x^\star)$: there are $t_k\downarrow0$, $d_k\to d$ with $x_k=x^\star+t_kd_k\in\Omega$. Since $d_k$ converges it is bounded, so $x_k\to x^\star$.
  2. Use local minimality. For large $k$, $x_k$ is feasible and close to $x^\star$, so $f(x_k)-f(x^\star)\ge0$.
  3. Use differentiability. $f(x_k)-f(x^\star)=t_k\,d_k^\top\nabla f(x^\star)+o(t_k)$. Here $R(s)=f(x^\star+s)-f(x^\star)-\nabla f(x^\star)^\top s$ is the Taylor remainder; differentiability means $R(s)/\|s\|\to0$ as $s\to0$. The remainder is $o(t_k)$ because $d_k$ is bounded: $\dfrac{R(t_kd_k)}{t_k}=\dfrac{R(t_kd_k)}{\|t_kd_k\|}\,\|d_k\|\to0\cdot(\text{bounded})=0$.
  4. Divide by $t_k\gt0$ (keeps "$\ge$"): $0\le d_k^\top\nabla f(x^\star)+o(1)$.
  5. Let $k\to\infty$: $d^\top\nabla f(x^\star)\ge0$. No regularity used anywhere.

Try it as MCQ steps (click an option):

P1 Guided proof stepMCQ

Why can we divide $f(x_k)-f(x^\star)\ge 0$ by $t_k$ and keep the inequality?

  1. (a) Because $d_k\to d$.
  2. (b) Because $x^\star$ is regular.
  3. (c) Because $t_k\gt 0$.
  4. (d) Because $\nabla f(x^\star)=0$.
Show answer

(c). Dividing by a positive number keeps "$\ge$". (a) is used later, for the limit and the remainder. (b) regularity is never used in this proof. (d) is false in general: at a boundary min $\nabla f\ne 0$.

P2 Guided proof stepMCQ

Why is the remainder $o(t_k)$ and not just $o(\|t_kd_k\|)$?

  1. (a) Because $f$ is convex.
  2. (b) Because $d_k$ converges, hence is bounded, so $o(\|t_kd_k\|)/t_k\to 0$.
  3. (c) Because $\|d_k\|=1$ by definition of the tangent cone.
  4. (d) Because $x_k$ is feasible.
Show answer

(b). $R(t_kd_k)/t_k=\frac{R(t_kd_k)}{\|t_kd_k\|}\|d_k\|$; the first factor $\to 0$ and $\|d_k\|$ is bounded. (a) no convexity assumed. (c) the course definition does not normalise $d_k$. (d) feasibility gives the sign $f(x_k)\ge f(x^\star)$, not the remainder size.

P3 Guided proof stepMCQ

Which hypothesis is not needed for Theorem 6.2.1?

  1. (a) $x^\star$ is a local minimizer.
  2. (b) $f$ is differentiable at $x^\star$.
  3. (c) The definition of $T_\Omega$ via sequences.
  4. (d) LICQ at $x^\star$.
Show answer

(d). The geometric FONC needs no constraint qualification. LICQ enters only at the next step ($T=\mathcal L$), which is what turns FONC into KKT.

I. The exam recipe: the KKT ladder

Every descriptive Ch 6 question so far (Midterm 2 IV, V, VI) is this ladder, sometimes with a parameter. Write every rung; he marks them.

The ladder (write every rung)
  1. Rewrite constraints as $h=0$, $g\le0$; max β†’ min of $-F$. Name each constraint.
  2. Lagrangian $\ell=f+\lambda^\top h+\mu^\top g$.
  3. Write all five KKT parts explicitly.
  4. Enumerate active-set guesses $\mathcal A\subseteq\{1,\dots,p\}$: $\mu_j=0$ for $j\notin\mathcal A$, $g_j=0$ for $j\in\mathcal A$.
  5. Solve stationarity + $h=0$ + active $g_j=0$ for $x,\lambda,\mu_{\mathcal A}$.
  6. Check $\mu_{\mathcal A}\ge0$, inactive $g_j(x)\le0$, $h=0$. Discard failures, saying which condition fails.
  7. LICQ at each survivor (and ask: could a non-regular feasible point be a minimum the KKT search missed?).
  8. Split the active set into $\mathcal A_+$ ($\mu\gt0$) and $\mathcal A_0$ ($\mu=0$).
  9. Critical cone $C$: "$=$" rows for $h$ and $\mathcal A_+$, "$\le$" rows for $\mathcal A_0$.
  10. Hessian of $\ell$ with multipliers fixed: $\mathbf L_\star$.
  11. Test $d^\top\mathbf L_\star d$ on $C$: $\gt0$ for all $d\ne0$ β‡’ SOSC; some $d\in C$ with $\lt0$ at a regular point β‡’ SONC fails; $\ge0$ with some zero β‡’ undecided. $C=\{0\}$ β‡’ SOSC holds.
  12. Classify each point in one clear sentence (strict local min / not a local min / undecided), then the global answer (compare values; existence: a continuous $f$ on a compact (closed and bounded) feasible set attains its minimum (Weierstrass); or $f$ coercive, i.e. $f\to\infty$ as $\|x\|\to\infty$, on a closed nonempty set).
Worked example: full ladder with an equality (Quiz 3 Q13) $\min (u-2)^2+v^2$ s.t. $u+v=1$, $u\ge0$, $v\ge0$.
  1. Form. $h=u+v-1=0$, $g_1=-u\le0$, $g_2=-v\le0$. $\ell=(u-2)^2+v^2+\lambda(u+v-1)-\mu_1u-\mu_2v$.
  2. KKT. $\partial\ell/\partial u$: $2(u-2)+\lambda-\mu_1=0$; $\partial\ell/\partial v$: $2v+\lambda-\mu_2=0$; $u+v=1$; $u,v\ge0$; $\mu_1,\mu_2\ge0$; $\mu_1u=0$, $\mu_2v=0$.
  3. $\mathcal A=\varnothing$: $\mu=0$. Subtract the two stationarity equations: $2(u-2)-2v=0$ β‡’ $u-v=2$. With $u+v=1$: $u=3/2$, $v=-1/2$ (then $\lambda=1$). Violates $v\ge0$: reject.
  4. $\mathcal A=\{1\}$: $u=0$, so $v=1$; $\mu_2=0$ β‡’ $\lambda=-2v=-2$; then $\mu_1=2(0-2)+\lambda=-6\lt0$: reject (dual feasibility).
  5. $\mathcal A=\{2\}$: $v=0$, so $u=1$; $\mu_1=0$ β‡’ $\lambda=-2(1-2)=2$; then $\mu_2=2\cdot0+\lambda=2\ge0$ βœ“. KKT point $(1,0)$, $\lambda^\star=2$, $\mu^\star=(0,2)$.
  6. $\mathcal A=\{1,2\}$: $u=v=0$ violates $u+v=1$: impossible.
  7. LICQ at $(1,0)$: $\nabla h=(1,1)$, $\nabla g_2=(0,-1)$, $\det\begin{pmatrix}1&0\\1&-1\end{pmatrix}=-1\ne0$ βœ“.
  8. $\mathcal A_+=\{2\}$, $\mathcal A_0=\varnothing$. $C=\{d: d_1+d_2=0,\ -d_2=0\}=\{0\}$.
  9. $\mathbf L_\star=2I$ (constraints linear). $C=\{0\}$ β‡’ SOSC holds β‡’ $(1,0)$ is a strict local minimiser; global too (convex problem, only KKT point).
Worked example 2: full ladder where an active constraint has ΞΌ = 0 (exam style) $\min f(x)=x_2-x_1^2$ s.t. $x_1\ge0$, $x_2\ge0$, $x_1+x_2\le1$ (a triangle).
  1. Form. $g_1=-x_1\le0$, $g_2=-x_2\le0$, $g_3=x_1+x_2-1\le0$. $\ell=x_2-x_1^2-\mu_1x_1-\mu_2x_2+\mu_3(x_1+x_2-1)$.
  2. KKT. $\partial\ell/\partial x_1$: $-2x_1-\mu_1+\mu_3=0$ (S1); $\partial\ell/\partial x_2$: $1-\mu_2+\mu_3=0$ (S2); $x_1,x_2\ge0$, $x_1+x_2\le1$; $\mu\ge0$; $\mu_1x_1=0$, $\mu_2x_2=0$, $\mu_3(x_1+x_2-1)=0$.
  3. Guesses with $\mu_2=0$ ($\varnothing$, $\{1\}$, $\{3\}$, $\{1,3\}$): (S2) becomes $1+\mu_3=0$. If $\mu_3=0$ too ($\varnothing$, $\{1\}$) this reads $1=0$: impossible. If $3$ is active ($\{3\}$, $\{1,3\}$), $\mu_3=-1\lt0$: reject. (So $g_2$ must be active at every KKT point.)
  4. $\{2\}$ ($x_2=0$, $\mu_1=\mu_3=0$): (S1) $x_1=0$; (S2) $\mu_2=1$. Point $(0,0)$. There $g_1=0$ as well, so the exact active set is $\{1,2\}$ with $\mu_1=0$. Guess $\{1,2\}$ gives the same: $x=(0,0)$, (S1) $\mu_1=0$, (S2) $\mu_2=1$. KKT point $(0,0)$, $\mu^\star=(0,1,0)$.
  5. $\{2,3\}$ ($x_2=0$, $x_1=1$, $\mu_1=0$): (S1) $-2+\mu_3=0$ β‡’ $\mu_3=2$; (S2) $\mu_2=1+2=3$. $g_1=-1\lt0$ βœ“. KKT point $(1,0)$, $\mu^\star=(0,3,2)$.
  6. $\{1,2,3\}$: $x_1=x_2=0$ gives $g_3=-1\ne0$: impossible.
  7. LICQ. At $(0,0)$: $\nabla g_1=(-1,0)$, $\nabla g_2=(0,-1)$, $\det=1\ne0$ βœ“. At $(1,0)$: $\nabla g_2=(0,-1)$, $\nabla g_3=(1,1)$, $\det\begin{pmatrix}0&1\\-1&1\end{pmatrix}=1\ne0$ βœ“. (At the third corner $(0,1)$: $(-1,0),(1,1)$, $\det=-1\ne0$; elsewhere at most one constraint is active.) LICQ holds everywhere, so every local min is one of these two KKT points.
  8. $(0,0)$: split. $\mathcal A_+=\{2\}$, $\mathcal A_0=\{1\}$. $C$: $-d_2=0$ ("$=$" row) and $-d_1\le0$ ("$\le$" row) β‡’ $C=\{(d_1,0):d_1\ge0\}$, a ray. $\mathbf L_\star=\nabla^2f=\operatorname{diag}(-2,0)$ (constraints linear). $d=(1,0)\in C$: $d^\top\mathbf L_\star d=-2\lt0$, regular β‡’ SONC fails β‡’ not a local min. Check: $f(t,0)=-t^2\lt0=f(0,0)$. (Writing "$=$" for the $\mathcal A_0$ row would give $C=\{0\}$ and the false verdict "strict local min".)
  9. $(1,0)$: split. $\mathcal A_+=\{2,3\}$, $\mathcal A_0=\varnothing$. $C$: $-d_2=0$, $d_1+d_2=0$ β‡’ $C=\{0\}$ β‡’ SOSC holds β‡’ strict local min, although $\mathbf L_\star=\operatorname{diag}(-2,0)$ is not positive semidefinite.
  10. Global. The triangle is compact and $f$ continuous β‡’ a global min exists and is a KKT point β‡’ global min $f=-1$ at $(1,0)$.

Parametric version (Midterm 2 IV, Practice F1). When $f$ contains a parameter $a$, the active set changes with $a$. Do the enumeration with $a$ as a symbol; each case gives a condition on $a$ ("$\mu\ge0$ iff $a\ge1$", "inactive iff $a\lt1$"). Then treat each switching value on its own: there the constraint is usually active with $\mu=0$ (it's in $\mathcal A_0$), so its row in $C$ is "$\le$", not "$=$".

Last-line traps
  • Forgetting to rewrite "$\ge$" constraints (wrong-sign $\mu$).
  • Putting a sign restriction on $\lambda$.
  • Using $\nabla^2 f$ instead of $\mathbf L_\star$ when constraints are curved.
  • Testing curvature on $\mathbb R^n$ instead of on $C$; making $\mathcal A_0$ rows "$=$".
  • Saying "SOSC fails" when $C=\{0\}$.
  • Saying "KKT fails β‡’ not a minimum" at a non-regular point.
Check I. Without looking: list the 12 rungs in order.
Show answer

Rewrite β†’ Lagrangian β†’ five KKT parts β†’ active-set guesses β†’ solve β†’ check signs/feasibility β†’ LICQ β†’ split $\mathcal A_+/\mathcal A_0$ β†’ critical cone β†’ $\mathbf L_\star$ β†’ test on $C$ β†’ classify (local, then global).

What the professor said about this

In class (Qwen transcripts; wording is speech-to-text)
  • Seventy percent of mark is covered by memorizing this equation and the following KKT. Ch 6 lec 3 [11:30] β†’ the equation in section C3 and the KKT in D1 must be automatic; then drill the ladder (section I).
  • you have five set of equations… the gradient equation, the equality constraint, inequality constraints… complementarity, and then… the non negativity Ch 6 lec 2 [38:30] β†’ always write all five KKT parts.
  • these inequality gradient, they are restricted. You can have only non-negative weights Ch 6 lec 2 [24:00] β†’ $\mu\ge 0$, $\lambda$ free.
  • just strictly follow the convention we have here Ch 6 lec 4 [07:00] β†’ $g\le 0$, $\ell=f+\lambda^\top h+\mu^\top g$; other books' forms "not accepted" (Ch 7 lec 2 [41:00]).
  • that's an important distinction you have to remember Ch 6 lec 2 [29:00] β†’ an active constraint can have $\mu=0$.
  • A feasible KKT point satisfies the tangent cone first order condition even without LICQ. Okay, it's very important. Ch 6 lec 2 [44:30]
  • KKT is necessary only when the point is regular. Very important. Ch 6 lec 4 [22:30]; LICQ-dependence is a weakness of the theory Ch 6 lec 2 [42:30]; under full rank the multiplier is unique but not the minimizer Ch 6 lec 2 [44:00].
  • when we state sufficiency, we always state for strict Ch 6 lec 4 [33:30]; No LICQ assumption is required once KKT is given Ch 6 lec 4 [34:00].
  • when your critical cone is only zero vector, you don't say SOSC is failed Ch 6 lec 4 [52:00] β†’ $C=\{0\}$ β‡’ SOSC passes.
  • objective function or constraint function alone can be misleading Ch 6 lec 4 [45:30] β†’ always use $\mathbf L_\star$, never $\nabla^2 f$ alone.
  • I will not ask you to compute tangent cone. Ch 6 lec 3 [44:30]; if… all constraint are linear, tangent cone is again is the same Ch 6 lec 3 [45:00] β†’ only linear-constraint cones (Midterm 2 V).
  • this is the only theorem we'll prove in this chapter Ch 6 lec 1 [1:04:00] β†’ the tangent-cone FONC proof (section H).
  • Try different combination, maximization, minimization, direction of inequality, interchanging identity with Q. Ch 6 lec 4 [1:15:00] β†’ the variant table in section F; Midterm 2 VI was one.
Exam pattern (from the end-term guide)
  • KKT + second order has been in every constrained paper: Quiz 3 (all 20 MCQs), Midterm 2 III (12-MCQ active-set chain), IV (parametric KKT), V (cones + Farkas), VI (eigenvector problem).
  • He reuses his own problems: Midterm 2 was 90% repetition of tutorial/problem-set problems Ch 8 lec 1 [01:30]. Problem Sets 2–3 are worth a look after this page.
  • Difficulty "same level" as the midterms; possibly a no-sheet short-answer part ("things you have to remember absolutely").

Practice (try first, then open the answer)

Order: warm-up traps β†’ past Quiz 3 β†’ medium new β†’ Midterm 2 (past exam) β†’ exam-level new. Each question names the page section it practises in its explanation; if you get stuck, reread that section. Every number below was re-computed with a sympy script.

A. Warm-up traps (new, easy)

A1 New, in his styleMCQ Β· easy

$\min (x_1+1)^2+x_2^2$ s.t. $x_1\ge 0$. A student writes $\ell=f+\mu x_1$, $\mu\ge 0$. At $x=(0,0)$, which is correct?

  1. (a) With the course form $g=-x_1\le 0$: $\mu^\star=2$, KKT holds, $C=\{(0,t)\}$, SOSC β‡’ strict local min.
  2. (b) $\mu^\star=-2\lt 0$, so $(0,0)$ is not a KKT point and not a minimizer.
  3. (c) $\mu^\star=0$ because the constraint is active.
  4. (d) KKT fails because $\nabla f(0,0)=(2,0)\ne 0$.
Show answer

(a). Rewrite $x_1\ge 0$ as $g=-x_1\le 0$. Stationarity: $(2,0)+\mu(-1,0)=0$ β‡’ $\mu=2\ge 0$. $\mu\gt 0$ β‡’ $C=\{d:-d_1=0\}=\{(0,t)\}$; $\mathbf L_\star=2I$ β‡’ $2t^2\gt 0$ β‡’ SOSC β‡’ strict local min (global too, convex).

(b) is the student's sign error: with $+\mu x_1$ he gets $\mu=-2$ and wrongly rejects the true minimum. (c) active does not force $\mu=0$ (nor $\mu\gt 0$); here it is $2$. (d) at a boundary point $\nabla f\ne 0$ is normal; stationarity is for $\ell$, not $f$.

A2 New, in his styleMCQ Β· easy

$\min -x^2$ s.t. $x\ge 0$, at $x^\star=0$. Which statement is correct?

  1. (a) KKT fails because the constraint is active but $\mu^\star=0$.
  2. (b) $C=\{0\}$, so SOSC passes and $0$ is a strict local min.
  3. (c) KKT holds with $\mu^\star=0$, $C=\{d\ge 0\}$, $d^\top \mathbf L_\star d=-2d^2\lt 0$ for $d\gt 0$, so SONC fails and $0$ is not a local min.
  4. (d) KKT holds with $\mu^\star=0$; since $\mathcal A_0$ rows become equalities, $C=\{0\}$ and the tests are inconclusive.
Show answer

(c). $g=-x$; stationarity $-2x-\mu=0$ at $0$ β‡’ $\mu=0$: active with zero multiplier, so $\mathcal A_0=\{1\}$, and the row stays one-sided: $C=\{d:-d\le 0\}=\{d\ge 0\}$. $\mathbf L_\star=-2$, regular ($g'=-1\ne 0$) β‡’ SONC fails. Check: $f(t)=-t^2\lt 0$.

(a) KKT allows active with $\mu=0$. (b) and (d) both wrongly turn the $\mathcal A_0$ row into "$=0$" and lose the direction $d\gt 0$.

A3 New, in his styleMCQ Β· easy

$\min x$ s.t. $g(x)=-x^3\le 0$. Which statement about $x^\star=0$ is correct?

  1. (a) $0$ is not a minimizer because KKT fails there.
  2. (b) $0$ is the global minimizer; the tangent-cone FONC holds, but no KKT multiplier exists because LICQ fails.
  3. (c) KKT holds with $\mu^\star=1/3$.
  4. (d) $T_\Omega(0)=\mathcal L_\Omega(0)=[0,\infty)$.
Show answer

(b). Feasible set $[0,\infty)$, so $0$ is the global min. $T=[0,\infty)$ and $f'(0)d=d\ge 0$ there. But $g'(0)=0$: stationarity $1+\mu\cdot 0=0$ is impossible. KKT is only necessary at regular points, and $0$ is not regular.

(a) confuses "KKT fails" with "not a min". (c) $g'(0)=-3x^2=0$, so no $\mu$ works. (d) $\mathcal L=\mathbb R$ since the gradient is zero; $T\subsetneq\mathcal L$. Writing $-x\le 0$ instead gives $\mu=1$.

A4 New, in his styleMCQ Β· easy

$\Omega=\{(u,v):uv=0\}$ and $f(u,v)=u+v^2$. At the origin, which statement is correct?

  1. (a) $T_\Omega=\mathcal L_\Omega=\mathbb R^2$, and the origin is a local min.
  2. (b) $T_\Omega$ is a subspace, so $\nabla f(0)\perp T_\Omega$ is the right test.
  3. (c) KKT holds with $\lambda^\star=-1$ since $\nabla h(0)=0$.
  4. (d) $T_\Omega$ is the union of the two axes, $\mathcal L_\Omega=\mathbb R^2$; $d=(-1,0)\in T_\Omega$ gives $\nabla f^\top d=-1\lt 0$, so the origin is not a local min.
Show answer

(d). Feasible points near $0$ lie on the axes, so $T$ = axes (not convex). $\nabla h=(v,u)=0$ β‡’ $\mathcal L=\mathbb R^2$. $\nabla f(0)=(1,0)$; along the feasible ray $(-t,0)$: $f=-t\lt 0$. FONC fails.

(a) $T\ne\mathcal L$ here. (b) the union of axes is not a subspace (contains $(1,0)$ and $(0,1)$, not their sum). (c) $\nabla h(0)=0$ means stationarity reads $(1,0)+\lambda(0,0)=0$: no $\lambda$ works.

A5 New, in his style (Farkas picture)MCQ Β· easy

At a feasible point $x^\star$ exactly two inequalities are active, with $\nabla g_1(x^\star)=(1,0)$ and $\nabla g_2(x^\star)=(0,1)$, and $\nabla f(x^\star)=(-1,2)$. Which statement is correct?

  1. (a) $x^\star$ is a KKT point with $\mu^\star=(1,2)$.
  2. (b) $x^\star$ is a KKT point with $\mu^\star=(1,-2)$; negative inequality multipliers are allowed when the constraint is active.
  3. (c) $x^\star$ is not a KKT point: stationarity needs $\mu_2=-2\lt0$; the allowed direction $d=(0,-1)$ has $\nabla f^\top d=-2\lt0$.
  4. (d) $x^\star$ is not a KKT point because $\nabla f(x^\star)\ne0$.
Show answer

(c). Stationarity: $(-1,2)+\mu_1(1,0)+\mu_2(0,1)=0$ β‡’ $\mu_1=1$, $\mu_2=-2$. Dual feasibility fails, so $-\nabla f=(1,-2)$ is outside the cone of the normals (the dashed arrow in the section C2 figure). The direction $d=(0,-1)$ satisfies $\nabla g_1^\top d=0\le0$ and $\nabla g_2^\top d=-1\le0$ (allowed) and $\nabla f^\top d=-2\lt0$ (downhill). If LICQ holds (it does: the two normals are independent), $x^\star$ is not a local min.

(a) has the sign of $\mu_2$ wrong (it solves $\nabla f=\sum\mu_j\nabla g_j$ instead of $\nabla f+\sum\mu_j\nabla g_j=0$). (b) $\mu\ge0$ is required for every inequality, active or not. (d) a nonzero $\nabla f$ is normal at a boundary point.

B. Quiz 3 MCQs (past paper, version V059 option letters)

B1 Quiz 3 Q1 (past paper)MCQ

Let $f$ be differentiable at a local minimizer $x^\star$ over a feasible set $\Omega$. Which statement must hold without a constraint qualification?

  1. (A) $\nabla f(x^\star)=0$.
  2. (B) $\nabla f(x^\star)^\top d\ge 0$ for every $d\in\mathcal L_\Omega(x^\star)$ whenever a differentiable constraint representation is given.
  3. (C) $\nabla f(x^\star)^\top d\ge 0$ for every $d\in T_\Omega(x^\star)$.
  4. (D) $\nabla f(x^\star)^\top d=0$ for every $d\in T_\Omega(x^\star)$.
Show answer

(C). Theorem 6.2.1 needs no CQ. (A) false at boundary minima. (B) $\mathcal L$ may be larger than $T$ without LICQ (e.g. $\min x$ on $-x^3\le 0$: $d=-1\in\mathcal L$ gives $-1$). (D) inward directions can give $\gt 0$.

B2 Quiz 3 Q2 (past paper)MCQ

For $C^1$ equality and inequality constraints, which relationship between the tangent cone and the linearized cone is correct at a feasible point?

  1. (A) $T_\Omega\subseteq\mathcal L_\Omega$ always; LICQ is sufficient, but not necessary, for equality.
  2. (B) $\mathcal L_\Omega\subseteq T_\Omega$ always.
  3. (C) Whenever LICQ fails, $T_\Omega$ is a proper subset of $\mathcal L_\Omega$.
  4. (D) $T_\Omega=\mathcal L_\Omega$ at every feasible point.
Show answer

(A). Theorem 6.1.1. (B) reversed. (C) LICQ failing does not force strict inclusion: $v=0$ and $2v=0$ have dependent gradients but $T=\mathcal L$ = horizontal axis. (D) fails for $uv=0$ or $v^3=0$.

B3 Quiz 3 Q3 (past paper)MCQ

Let $A\in\mathbb R^{n\times m}$, $B\in\mathbb R^{n\times r}$, $c\in\mathbb R^n$. Farkas' lemma states that "$c^\top d\ge 0$ whenever $A^\top d=0$, $B^\top d\le 0$" is equivalent to which multiplier statement?

  1. (A) $c+A\lambda+B\mu=0$ for some unrestricted $\lambda$ and some $\mu\le 0$.
  2. (B) $c+A\lambda+B\mu=0$ for some $\lambda\ge 0$ and $\mu\ge 0$.
  3. (C) $c+A\lambda+B\mu=0$ for some unrestricted $\lambda$ and some $\mu\ge 0$.
  4. (D) $c+A\lambda+B\mu=0$ for some unrestricted $\lambda$ and unrestricted $\mu$.
Show answer

(C). Check one direction: $c^\top d=-\lambda^\top A^\top d-\mu^\top B^\top d=-\mu^\top(B^\top d)\ge 0$ needs $\mu\ge 0$ (since $B^\top d\le 0$). (A) wrong sign. (B) restricts the equality multiplier for no reason. (D) loses the inequality sign. No rank assumption on $A,B$.

B4 Quiz 3 Q4 (past paper)MCQ

At a feasible KKT point, with $g_j\le 0$ and $\mu_j\ge 0$, which implication is always valid?

  1. (A) $\mu_j^\star\gt 0\Rightarrow g_j(x^\star)\lt 0$.
  2. (B) $g_j(x^\star)=0\Rightarrow\mu_j^\star\gt 0$.
  3. (C) $g_j(x^\star)\lt 0\Rightarrow\mu_j^\star=0$.
  4. (D) $\mu_j^\star=0\Rightarrow g_j(x^\star)\lt 0$.
Show answer

(C). From $\mu_jg_j=0$. (A) backwards: $\mu\gt 0$ forces active. (B) and (D) fail for degenerate active constraints ($x^2$ on $x\ge 0$: active, $\mu=0$).

B5 Quiz 3 Q10 (past paper)MCQ

At a feasible KKT point, split the active inequalities into $\mathcal A_+=\{j:\mu_j^\star\gt 0\}$, $\mathcal A_0=\{j:\mu_j^\star=0\}$. Which additional condition on $d\in\mathcal L_\Omega(x^\star)$ defines membership in the critical cone?

  1. (A) $\nabla g_j(x^\star)^\top d=0$ for every $j\in\mathcal A_+\cup\mathcal A_0$.
  2. (B) $\nabla g_j(x^\star)^\top d=0$ for every $j\in\mathcal A_0$.
  3. (C) $\nabla g_j(x^\star)^\top d\lt 0$ for at least one $j\in\mathcal A_+$.
  4. (D) $\nabla g_j(x^\star)^\top d=0$ for every $j\in\mathcal A_+$.
Show answer

(D). $\mathcal L_\Omega$ already gives $\le 0$ for all active $j$; criticality adds $=0$ for $\mathcal A_+$. (A) freezes $\mathcal A_0$ too and discards critical directions. (B) freezes the wrong group. (C) describes the complement $\bar C$ (strictly positive first-order change).

B6 Quiz 3 Q11 (past paper)MCQ

Let $\Omega=\{(u,v): h(u,v)=v^3=0\}$. At $(0,0)$, which pair gives the tangent cone and the linearized cone?

  1. (A) $T_\Omega=\mathbb R\times\{0\}$ and $\mathcal L_\Omega=\mathbb R^2$.
  2. (B) $T_\Omega=\{(0,0)\}$ and $\mathcal L_\Omega=\mathbb R^2$.
  3. (C) $T_\Omega=\mathbb R^2$ and $\mathcal L_\Omega=\mathbb R\times\{0\}$.
  4. (D) $T_\Omega=\mathcal L_\Omega=\mathbb R\times\{0\}$.
Show answer

(A). The set is the horizontal axis, so $T$ is that axis. $\nabla h=(0,3v^2)=0$ at the origin β‡’ linearized equation $0=0$ β‡’ $\mathcal L=\mathbb R^2$. (C) reverses $T\subseteq\mathcal L$, impossible. (D) would be true for $h=v$. (B) the axis has nonzero tangents.

B7 Quiz 3 Q15 (past paper)MCQ

Minimize $f(u,v)=3u+v^2$ on $u\ge 0$, $v\ge 0$ ($g_1=-u$, $g_2=-v$). What is the critical cone at the origin?

  1. (A) $C=\{(a,b):a\ge 0,b\ge 0\}$.
  2. (B) $C=\{(0,0)\}$.
  3. (C) $C=\{(0,b):b\in\mathbb R\}$.
  4. (D) $C=\{(0,b):b\ge 0\}$.
Show answer

(D). Stationarity $(3,0)-\mu_1(1,0)-\mu_2(0,1)=0$ β‡’ $\mu=(3,0)$. $\mathcal A_+=\{1\}$ β‡’ $d_1=0$; $\mathcal A_0=\{2\}$ β‡’ $-d_2\le 0$. Ray. (A) is $\mathcal L_\Omega$ (forgot $\mathcal A_+$). (B) froze $\mathcal A_0$ too. (C) dropped $d_2\ge 0$. Then $\mathbf L_\star=\operatorname{diag}(0,2)$, $2b^2\gt 0$ β‡’ SOSC, strict local min.

B8 Quiz 3 Q16 (past paper)MCQ

Minimize $f(u,v)=v-2u^2$ s.t. $h(u,v)=v-3u^2=0$. At the origin, critical directions have the form $d=(a,0)$. Which statement is correct for $\ell=f+\lambda h$?

  1. (A) $\lambda^\star=-1$ and $d^\top \mathbf L_\star d=2a^2$; SOSC gives a strict local minimum.
  2. (B) $\lambda^\star=-1$ and $d^\top \mathbf L_\star d=-4a^2$; SONC rules out a minimum.
  3. (C) $\lambda^\star=1$ and $d^\top \mathbf L_\star d=2a^2$; SOSC gives a strict local minimum.
  4. (D) $\lambda^\star=-1$ and $d^\top \mathbf L_\star d=0$; the second-order tests are inconclusive.
Show answer

(A). $(0,1)+\lambda(0,1)=0$ β‡’ $\lambda=-1$. $\mathbf L_\star=\operatorname{diag}(-4,0)-\operatorname{diag}(-6,0)=\operatorname{diag}(2,0)$ β‡’ $2a^2$. (B) uses $\nabla^2 f$ only (forgets constraint curvature). (C) wrong multiplier sign. (D) arithmetic slip. Check: $f(u,3u^2)=u^2$.

B9 Quiz 3 Q18 (past paper)MCQ

For $f(u,v)=u^2+6uv+v^2$ on $u\ge 0$, $v\ge 0$, consider the origin. Which statement is correct?

  1. (A) KKT fails because both active inequality multipliers are zero.
  2. (B) SONC fails because the Hessian has a negative eigenvalue.
  3. (C) SONC holds, but SOSC fails because both active multipliers are zero.
  4. (D) SOSC holds on the critical cone, even though the Hessian is indefinite on $\mathbb R^2$.
Show answer

(D). $\nabla f(0)=0$ β‡’ $\mu=(0,0)$, both in $\mathcal A_0$ β‡’ $C$ = first quadrant. $\mathbf L_\star=\begin{pmatrix}2&6\\6&2\end{pmatrix}$ (eigenvalues $8,-4$: indefinite). On $C$: $2a^2+12ab+2b^2\ge 2(a^2+b^2)\gt 0$. The negative direction $(1,-1)$ is outside $C$. (A) zero multipliers are allowed. (B) tests the whole space. (C) zero multipliers do not make SOSC fail.

B10 Quiz 3 Q20 (past paper)MCQ

For minimization of $f(u,v)=2v-u^4$ s.t. $v\ge 0$, which statement about the origin is correct?

  1. (A) KKT fails because the objective gradient is nonzero.
  2. (B) SONC fails because some nearby feasible points have a smaller objective value.
  3. (C) KKT and SOSC hold, so the origin is a strict local minimum.
  4. (D) KKT and SONC hold, SOSC fails, and the origin is not a local minimum.
Show answer

(D). $g=-v$: $(0,2)+\mu(0,-1)=0$ β‡’ $\mu=2\gt 0$ β‡’ $C=\{(a,0)\}$. $\mathbf L_\star=\nabla^2(-u^4)=0$ at the origin β‡’ $d^\top \mathbf L_\star d=0$: SONC holds, SOSC fails. Directly $f(t,0)=-t^4\lt 0$ β‡’ not a min. (A) nonzero $\nabla f$ is fine at a boundary. (B) SONC is a curvature test; it holds here even though the point is not a min. (C) SOSC needs strict positivity.

C. Medium (new)

C1 New, in his style (full ladder)Descriptive Β· medium

$\min f(x)=x_1x_2$ s.t. $x_1^2+x_2^2\le 2$. (a) Write the complete KKT conditions. (b) Find all KKT points and multipliers. (c) Check LICQ. (d) Find the critical cone and $\mathbf L_\star$ at each KKT point and classify every point. (e) Give the global minimum.

Hint

Two cases: inactive ($\mu=0$) and active. In the active case add and subtract the two stationarity equations.

Show answer
  1. Form. $g(x)=x_1^2+x_2^2-2\le 0$; $\ell=x_1x_2+\mu(x_1^2+x_2^2-2)$.
  2. KKT. $x_2+2\mu x_1=0$, $x_1+2\mu x_2=0$; $x_1^2+x_2^2\le 2$; $\mu\ge 0$; $\mu(x_1^2+x_2^2-2)=0$.
  3. Inactive ($\mu=0$): $x_2=0$, $x_1=0$. $(0,0)$, $g=-2\lt 0$ βœ“. KKT point $x^{(0)}=(0,0)$, $\mu=0$.
  4. Active: adding: $(x_1+x_2)(1+2\mu)=0$ β‡’ $x_2=-x_1$ (since $1+2\mu\gt 0$). Then $-x_1+2\mu x_1=0$ β‡’ $\mu=\tfrac12$. On the circle: $2x_1^2=2$ β‡’ $x=(1,-1)$ or $(-1,1)$, $\mu=\tfrac12\ge 0$ βœ“, $f=-1$. (The points $(1,1),(-1,-1)$ satisfy stationarity only with $\mu=-\tfrac12\lt 0$: rejected; they are the maximizers, $f=1$.)
  5. LICQ. Origin: no active constraint β‡’ holds vacuously. On the circle: $\nabla g=2x\ne 0$ β‡’ holds.
  6. Origin. No active constraints, $\nabla f(0)=0$ β‡’ $C=\mathbb R^2$. $\mathbf L_\star=\nabla^2 f=\begin{pmatrix}0&1\\1&0\end{pmatrix}$. $d=(1,-1)$: $d^\top \mathbf L_\star d=-2\lt 0$. Regular β‡’ SONC fails β‡’ not a local min (saddle: $f(t,-t)=-t^2$).
  7. $(1,-1)$, $\mu=\tfrac12$. $\mathcal A_+=\{1\}$, $\nabla g=(2,-2)$ β‡’ $C=\{d:2d_1-2d_2=0\}=\{t(1,1)\}$. $\mathbf L_\star=\begin{pmatrix}0&1\\1&0\end{pmatrix}+2\cdot\tfrac12 I=\begin{pmatrix}1&1\\1&1\end{pmatrix}$ (eigenvalues $0,2$: singular!). $d^\top \mathbf L_\star d=t^2(1+1+1+1)=4t^2\gt 0$ for $t\ne 0$ β‡’ SOSC β‡’ strict local min. Same at $(-1,1)$ with $\nabla g=(-2,2)$, same $C$, same result.
  8. Global. Feasible set compact, $f$ continuous β‡’ global min exists and is a KKT point (LICQ holds everywhere). Values: $f(0)=0$, $f(\pm(1,-1))=-1$. Global min $=-1$ at $(1,-1)$ and $(-1,1)$ (both strict local minima, neither a strict global min).
C2 New, in his style (eigen variant, Q and I swapped)MCQ Β· medium

$Q\succ 0$ with distinct eigenvalues $\theta_1\lt\dots\lt\theta_n$, orthonormal eigenvectors $q_i$. Consider $\min x^\top Qx$ s.t. $h(x)=x^\top x-1=0$ with $\ell=x^\top Qx+\lambda(x^\top x-1)$. Which statement is correct?

  1. (a) KKT points are $\pm q_i$ with $\lambda=\theta_i$; all of them satisfy SOSC because $Q\succ 0$.
  2. (b) KKT points are $\pm q_i$ with $\lambda=-\theta_i$; $C=\operatorname{span}\{q_j:j\ne i\}$, $d^\top \mathbf L_\star d=2\sum_{j\ne i}(\theta_j-\theta_i)\alpha_j^2$; only $\pm q_1$ pass SONC, and they satisfy SOSC.
  3. (c) Only $\pm q_n$ satisfy SOSC, because the multiplier must be nonnegative.
  4. (d) $\mathbf L_\star=2Q$ is PD, so every KKT point is a strict local minimizer.
Show answer

(b). Stationarity $2Qx+2\lambda x=0$ β‡’ $Qx=-\lambda x$ β‡’ $x=\pm q_i$, $\lambda=-\theta_i$ (equality multiplier: any sign is fine). $\nabla h=2x$ β‡’ $C=q_i^\perp$. $\mathbf L_\star=2Q+2\lambda I=2(Q-\theta_iI)$. With $d=\sum_{j\ne i}\alpha_jq_j$: $2\sum_{j\ne i}(\theta_j-\theta_i)\alpha_j^2$. For $i=1$ all coefficients $\gt 0$ β‡’ SOSC; for $i\gt 1$, $d=q_1$ gives $2(\theta_1-\theta_i)\lt 0$ β‡’ SONC fails. Min value $\theta_1$.

(a) wrong multiplier sign and ignores the $-\theta_iI$ term. (c) puts a sign restriction on an equality multiplier and picks the wrong end. (d) forgets the constraint's contribution $2\lambda I$ to $\mathbf L_\star$.

C3 New, in his style (an active constraint with zero multiplier)Descriptive Β· medium

$\min f(x)=(x_1-1)^2+(x_2-3)^2$ s.t. $x_1+x_2\le2$, $x_1\ge0$. (a) Course form and all KKT conditions. (b) Try all four active-set guesses. (c) At the KKT point find $\mathcal A_+$, $\mathcal A_0$, $C$ and classify.

Hint

The guess $\mathcal A=\{1\}$ lands on a point where $g_2$ is also zero. What does that say about $\mu_2$?

Show answer
  1. (a) $g_1=x_1+x_2-2\le0$, $g_2=-x_1\le0$. $\ell=(x_1-1)^2+(x_2-3)^2+\mu_1(x_1+x_2-2)-\mu_2x_1$. KKT: $2(x_1-1)+\mu_1-\mu_2=0$, $2(x_2-3)+\mu_1=0$; $x_1+x_2\le2$, $x_1\ge0$; $\mu_1,\mu_2\ge0$; $\mu_1(x_1+x_2-2)=0$, $\mu_2x_1=0$.
  2. $\varnothing$: $x=(1,3)$, $g_1=2\gt0$: infeasible, reject.
  3. $\{1\}$ ($\mu_2=0$): $x_1=1-\mu_1/2$, $x_2=3-\mu_1/2$; sum $4-\mu_1=2$ β‡’ $\mu_1=2$, $x=(0,2)$. Here $g_2=0$ too, so the exact active set is $\{1,2\}$ with $\mu_2=0$: a KKT point, $\mu^\star=(2,0)$.
  4. $\{2\}$ ($\mu_1=0$, $x_1=0$): $x_2=3$, but then $g_1=1\gt0$ (infeasible), and also $2(0-1)-\mu_2=0$ β‡’ $\mu_2=-2\lt0$: reject.
  5. $\{1,2\}$: $x=(0,2)$; second equation $2(2-3)+\mu_1=0$ β‡’ $\mu_1=2$; first $2(0-1)+2-\mu_2=0$ β‡’ $\mu_2=0$. Same KKT point, same multipliers.
  6. LICQ: $\nabla g_1=(1,1)$, $\nabla g_2=(-1,0)$, $\det\begin{pmatrix}1&-1\\1&0\end{pmatrix}=1\ne0$ βœ“.
  7. (c) $\mathcal A_+=\{1\}$ β‡’ $d_1+d_2=0$; $\mathcal A_0=\{2\}$ β‡’ $-d_1\le0$. $C=\{t(1,-1):t\ge0\}$, a ray. $\mathbf L_\star=2I$ β‡’ $d^\top\mathbf L_\star d=4t^2\gt0$ for $t\gt0$ β‡’ SOSC β‡’ strict local min, and global (convex problem), $f=1+1=2$.
  8. Lesson: writing "$=$" for the $\mathcal A_0$ row would give $C=\{0\}$ and the same verdict here, but for the wrong reason; with a nonconvex $f$ it could give the wrong verdict.

D. Midterm 2 Question III (past paper, 12-part MCQ chain)

$\min f(x)=x_1^2+x_2^2$ s.t. $g_1=4-x_1-x_2^2\le 0$, $g_2=3x_2-x_1\le 0$, $g_3=-3x_2-x_1\le 0$. $L=f+\mu_1g_1+\mu_2g_2+\mu_3g_3$ (the paper's $L$ is this page's $\ell$), $\mu\ge 0$. "Exact active set" $\mathcal A(x)=\{i:g_i(x)=0\}$. KKT: $2x_1-\mu_1-\mu_2-\mu_3=0$, $2x_2(1-\mu_1)+3\mu_2-3\mu_3=0$, plus feasibility, signs, complementarity.

D1 Midterm 2 III.1 (past paper)MCQ

Which pair lists all the exact active sets that cannot occur at any feasible point?

  1. (a) $\{2,3\}$ and $\{1,2,3\}$.
  2. (b) $\varnothing$ and $\{1\}$.
  3. (c) $\{2\}$ and $\{3\}$.
  4. (d) $\{1,2\}$ and $\{1,3\}$.
Show answer

(a). $g_2=g_3=0$ β‡’ $x_1=3x_2=-3x_2$ β‡’ $x=0$, where $g_1=4\gt 0$: infeasible. Every other set occurs: e.g. $\varnothing$ at $(10,0)$, $\{1\}$ at $(4,0)$, $\{2\}$ at $(30,10)$, $\{1,2\}$ at $(3,1)$.

D2 Midterm 2 III.2 (past paper)MCQ

Consider the exact active sets $\varnothing,\{2\},\{3\}$. Which statement is correct?

  1. (a) None of the three can occur at feasible points.
  2. (b) All three can occur at feasible points, but only $\{2\}$ and $\{3\}$ can occur at KKT points.
  3. (c) All three can occur at feasible points, and all three can occur at KKT points.
  4. (d) All three can occur at feasible points, but none can occur at KKT points.
Show answer

(d). In all three, $\mu_1=0$. Dot stationarity with $x$: $0=2\|x\|^2+\mu_2g_2(x)+\mu_3g_3(x)=2\|x\|^2$ (complementarity kills the last two; $g_2,g_3$ are linear homogeneous so $\nabla g_i^\top x=g_i(x)$). So $x=0$, infeasible.

D3 Midterm 2 III.3 (past paper)MCQ

Only $g_1$ active: impose $g_1=0$, $\mu_2=\mu_3=0$, solve stationarity with $\mu_1\ge 0$ (before checking $g_2,g_3$). Which option lists all resulting pairs $(x,\mu_1)$?

  1. (a) $((4,0)^\top,4)$, $((\tfrac12,\pm\sqrt{7/2})^\top,1)$.
  2. (b) $((4,0)^\top,8)$, $((\tfrac12,\pm\sqrt{7/2})^\top,1)$.
  3. (c) $((4,0)^\top,8)$, $((\tfrac12,\pm\sqrt{7/2})^\top,2)$.
  4. (d) $((4,0)^\top,8)$, $((1,\pm\sqrt 3)^\top,2)$.
Show answer

(b). $\mu_1=2x_1$, $x_2(1-\mu_1)=0$, $x_1+x_2^2=4$. Branch $x_2=0$: $x_1=4$, $\mu_1=8$. Branch $\mu_1=1$: $x_1=\tfrac12$, $x_2^2=\tfrac72$.

D4 Midterm 2 III.4 (past paper)MCQ

After checking all constraints and KKT conditions, which pair is valid with exact active set $\{1\}$?

  1. (a) $x=(\tfrac12,-\sqrt{7/2})^\top$, $\mu=(1,0,0)^\top$.
  2. (b) $x=(4,0)^\top$, $\mu=(4,0,0)^\top$.
  3. (c) $x=(\tfrac12,\sqrt{7/2})^\top$, $\mu=(1,0,0)^\top$.
  4. (d) $x=(4,0)^\top$, $\mu=(8,0,0)^\top$.
Show answer

(d). $(\tfrac12,\pm\sqrt{7/2})$ violate $x_1\ge 3|x_2|$ ($\tfrac12\lt 3\cdot 1.87$). At $(4,0)$: $g_2=g_3=-4\lt 0$ βœ“, $\mu_1=8$.

D5 Midterm 2 III.5 (past paper)MCQ

For the exact active set $\{1,2\}$, which pair satisfies all KKT conditions?

  1. (a) $x=(3,1)^\top$, $\mu=(2,4,0)^\top$.
  2. (b) $x=(-12,-4)^\top$, $\mu=(16,-40,0)^\top$.
  3. (c) $x=(3,1)^\top$, $\mu=(4,2,0)^\top$.
  4. (d) $x=(3,1)^\top$, $\mu=(4,0,2)^\top$.
Show answer

(c). $x_1=3x_2$ and $4-3x_2-x_2^2=0$ β‡’ $(x_2-1)(x_2+4)=0$. $(-12,-4)$: $g_3=24\gt 0$, infeasible (and $\mu_2=-40$). At $(3,1)$: $\mu_1+\mu_2=6$, $2(1-\mu_1)+3\mu_2=0$ β‡’ $-2\mu_1+3\mu_2=-2$ β‡’ $\mu_1=4$, $\mu_2=2$. (a) swaps them; (d) puts weight on the inactive $g_3$.

D6 Midterm 2 III.6 (past paper)MCQ

For the exact active set $\{1,3\}$, which pair satisfies all KKT conditions?

  1. (a) $x=(3,-1)^\top$, $\mu=(4,0,2)^\top$.
  2. (b) $x=(-12,4)^\top$, $\mu=(16,0,-40)^\top$.
  3. (c) $x=(3,-1)^\top$, $\mu=(2,0,4)^\top$.
  4. (d) $x=(3,-1)^\top$, $\mu=(4,2,0)^\top$.
Show answer

(a). Mirror image: $x_1=-3x_2$, $(x_2+1)(x_2-4)=0$; $(-12,4)$ has $g_2=24\gt 0$. At $(3,-1)$: $\mu_1+\mu_3=6$, $2\mu_1-3\mu_3=2$ β‡’ $\mu_1=4$, $\mu_3=2$.

D7 Midterm 2 III.7 (past paper)MCQ

What is the Hessian of the Lagrangian with respect to $x$?

  1. (a) $\begin{pmatrix}2&0\\0&2\end{pmatrix}$.
  2. (b) $\begin{pmatrix}2&0\\0&2-2\mu_1\end{pmatrix}$.
  3. (c) $\begin{pmatrix}2-2\mu_1&0\\0&2\end{pmatrix}$.
  4. (d) $\begin{pmatrix}2&0\\0&2+2\mu_1\end{pmatrix}$.
Show answer

(b). Only $g_1$ is curved: $\nabla^2g_1=\operatorname{diag}(0,-2)$. $\mathbf L_\star=2I+\mu_1\operatorname{diag}(0,-2)$. (a) ignores constraint curvature; (d) wrong sign of $\nabla^2 g_1$.

D8 Midterm 2 III.8 (past paper)MCQ

Let $\bar x$ be the feasible KKT point for $\mathcal A=\{1\}$. What is its critical cone?

  1. (a) $\{0\}$.
  2. (b) $\{d:d_1\ge 0\}$.
  3. (c) $\{d:d_2=0\}$.
  4. (d) $\{d:d_1=0\}$.
Show answer

(d). At $(4,0)$, $\mu_1=8\gt 0$, $\nabla g_1=(-1,-2x_2)=(-1,0)$ β‡’ $-d_1=0$. (b) would be the $\mathcal A_0$ (one-sided) version, wrong because $\mu_1\gt 0$.

D9 Midterm 2 III.9 (past paper)MCQ

Which statement correctly describes the second-order analysis at the KKT point associated with $\{1\}$?

  1. (a) Nonnegative on $C$ but vanishes along a nonzero critical direction, so SONC holds while SOSC fails.
  2. (b) The Lagrangian Hessian is positive definite, so SOSC holds.
  3. (c) There is a nonzero critical direction with negative Lagrangian curvature, so SONC fails and the point is not a local minimizer.
  4. (d) The critical cone contains only the zero vector, so SOSC holds automatically.
Show answer

(c). $\mathbf L_\star=\operatorname{diag}(2,2-16)=\operatorname{diag}(2,-14)$; $d=(0,t)$: $-14t^2\lt 0$. LICQ holds ($\nabla g_1\ne 0$) β‡’ SONC applies and fails. Direct check: $x(t)=(4-t^2,t)$ is feasible for small $t$ and $f=16-7t^2+t^4\lt 16$.

D10 Midterm 2 III.10 (past paper)MCQ

Let $x^{(+)}=(3,1)$, $x^{(-)}=(3,-1)$. Which option gives their critical cones?

  1. (a) Both $\mathbb R^2$.
  2. (b) $C(x^{(+)})=\{-d_1-2d_2=0\}$, $C(x^{(-)})=\{-d_1+2d_2=0\}$.
  3. (c) Both $\{0\}$.
  4. (d) Both $\{d:d_1=0\}$.
Show answer

(c). Both active multipliers positive β‡’ two equality rows. At $x^{(+)}$: $-d_1-2d_2=0$, $-d_1+3d_2=0$ β‡’ $d=0$. Similarly at $x^{(-)}$. (b) keeps only the $g_1$ row (forgot $g_2$/$g_3\in\mathcal A_+$).

D11 Midterm 2 III.11 (past paper)MCQ

What does SOSC imply at these two KKT points?

  1. (a) Both satisfy SOSC because there are no nonzero critical directions on which positivity must be checked.
  2. (b) Neither satisfies SOSC because the full Lagrangian Hessian has a negative eigenvalue.
  3. (c) Only the point associated with $\{1,2\}$ satisfies SOSC.
  4. (d) Neither satisfies SOSC because a critical cone containing only the zero vector makes SOSC inapplicable.
Show answer

(a). $\mathbf L_\star=\operatorname{diag}(2,-6)$ is indefinite, but $C=\{0\}$ β‡’ SOSC passes vacuously. (b) tests the full space. (d) is exactly what he said not to say.

D12 Midterm 2 III.12 (past paper)MCQ

After examining all possible active sets and second-order conditions, which statement is correct?

  1. (a) The only strict local minimizer is $(4,0)^\top$.
  2. (b) The strict local minimizers are exactly $(3,1)^\top$ and $(3,-1)^\top$.
  3. (c) The problem has no strict local minimizers.
  4. (d) All three points are strict local minimizers.
Show answer

(b). LICQ holds at every feasible point, so every local min is among the three KKT points; $(4,0)$ fails SONC; the corners pass SOSC. Both have $f=10$, which is the global min ($f$ coercive, feasible set closed).

E. Midterm 2 Questions IV–VI (past paper, descriptive)

E1 Midterm 2 IV (past paper)Descriptive Β· exam

For a parameter $a\ge 0$: $\min f_a(x)=\tfrac12[(x_1-a)^2+(x_2+1)^2]$ s.t. $g_1=x_1^2+x_2^2-1\le 0$, $g_2=-x_2\le 0$; $L=f_a+\mu_1g_1+\mu_2g_2$.
(a) Complete KKT conditions. (b) All KKT points and multipliers for every $a\ge 0$; active sets and where they change. (c) LICQ and strict complementarity; any $a$ with an active constraint having zero multiplier. (d) Critical cone in each regime (treat transition values separately). (e) Hessian of $L$, SOSC, which KKT points are strict local minimizers.

Hint

Show first that $x_2\gt 0$ is impossible at a KKT point.

Show answer
  1. (a) $L=\tfrac12[(x_1-a)^2+(x_2+1)^2]+\mu_1(x_1^2+x_2^2-1)-\mu_2x_2$. Stationarity: $(1+2\mu_1)x_1-a=0$, $(1+2\mu_1)x_2+1-\mu_2=0$. Primal: $x_1^2+x_2^2\le 1$, $x_2\ge 0$. Dual: $\mu_1,\mu_2\ge 0$. Complementarity: $\mu_1(x_1^2+x_2^2-1)=0$, $\mu_2x_2=0$.
  2. (b) If $x_2\gt 0$ then $\mu_2=0$ and $(1+2\mu_1)x_2+1=0$ is impossible. So $x_2=0$, $\mu_2=1$, $x_1=a/(1+2\mu_1)\ge 0$.
    • $g_1\lt 0$: $\mu_1=0$, $x_1=a$, needs $0\le a\lt 1$.
    • $g_1=0$: $x_1=1$, $\mu_1=(a-1)/2\ge 0$ iff $a\ge 1$.
    $a$$x^\star$$\mu^\star$$\mathcal A$
    $0\le a\lt 1$$(a,0)$$(0,1)$$\{2\}$
    $a=1$$(1,0)$$(0,1)$$\{1,2\}$
    $a\gt 1$$(1,0)$$((a-1)/2,1)$$\{1,2\}$
    The disk becomes active at $a=1$; its multiplier is positive only for $a\gt 1$.
  3. (c) $a\lt 1$: only $\nabla g_2=(0,-1)\ne 0$. $a\ge 1$: $\nabla g_1=(2,0)$, $\nabla g_2=(0,-1)$ independent. LICQ holds at every KKT point. Strict complementarity holds for $a\ne 1$; at $a=1$, $g_1$ is active with $\mu_1=0$ (fails), while LICQ still holds.
  4. (d) $\mu_2=1\gt 0$ always β‡’ $-d_2=0$. $a\lt 1$: disk inactive β‡’ $C=\{(t,0):t\in\mathbb R\}$. $a=1$: $g_1\in\mathcal A_0$ β‡’ $2d_1\le 0$ β‡’ $C=\{(t,0):t\le 0\}$. $a\gt 1$: $g_1\in\mathcal A_+$ β‡’ $2d_1=0$ β‡’ $C=\{0\}$.
  5. (e) $\mathbf L_\star=(1+2\mu_1^\star)I$ = $I$ for $a\le 1$, $aI$ for $a\gt 1$. $a\lt 1$: $d^\top \mathbf L_\star d=t^2\gt 0$. $a=1$: $t^2\gt 0$ for $t\lt 0$. $a\gt 1$: $C=\{0\}$, vacuous. SOSC holds in every regime β‡’ the KKT point is a strict local minimizer for every $a\ge 0$ (and the unique global minimizer, convex problem with strictly convex $f$): $x^\star=(\min\{a,1\},0)$, $p^\star(a)=\tfrac12(1+[\max\{a-1,0\}]^2)$.
E2 Midterm 2 V (past paper)Descriptive Β· exam

For fixed $c\in\mathbb R^3$: $\min f_c(x)=c^\top x+\tfrac12\|x\|^2$ s.t. $h=x_1+x_2+x_3=0$, $g_1=-x_1\le 0$, $g_2=-x_2\le 0$, $g_3=-x_3-2\le 0$. Examine $x^\star=0$.
(a) Active set, LICQ, tangent cone and linearized cone. (b) Exact conditions on $c$ for $c^\top d\ge 0$ on every tangent direction. (c) Farkas multipliers when (b) holds; a descent tangent direction when it fails. (d) Show (b) is necessary and sufficient for $0$ to be the unique global minimizer.

Show answer
  1. (a) $g_1=g_2=0$, $g_3=-2$ β‡’ $\mathcal A=\{1,2\}$. $J=[\nabla h\ \nabla g_1\ \nabla g_2]=\begin{pmatrix}1&-1&0\\1&0&-1\\1&0&0\end{pmatrix}$, $\det J=1$ β‡’ LICQ. $\mathcal L=\{d:d_1+d_2+d_3=0,\ d_1\ge 0,\ d_2\ge 0\}=\{(r,s,-r-s):r,s\ge 0\}$. Constraints linear (and $td$ feasible for small $t$) β‡’ $T=\mathcal L$.
  2. (b) $\nabla f_c(0)=c$. $c^\top d=(c_1-c_3)r+(c_2-c_3)s\ge 0$ for all $r,s\ge 0$ ⇔ $c_1\ge c_3$ and $c_2\ge c_3$ (test $(r,s)=(1,0),(0,1)$).
  3. (c) $\mu_3=0$ (inactive). Stationarity $c+\lambda(1,1,1)-\mu_1e_1-\mu_2e_2=0$ β‡’ $\lambda^\star=-c_3$, $\mu_1^\star=c_1-c_3$, $\mu_2^\star=c_2-c_3$ (unique; $\ge 0$ exactly under (b)). If $c_1\lt c_3$: $d=(1,0,-1)$, $c^\top d=c_1-c_3\lt 0$; if $c_2\lt c_3$: $d=(0,1,-1)$. Then $f_c(td)=tc^\top d+t^2\lt 0$ for $0\lt t\lt\min\{2,-c^\top d\}$.
  4. (d) Necessity: global β‡’ local β‡’ FONC (b). Sufficiency: on $\Omega$, $x_3=-x_1-x_2$ with $x_1,x_2\ge 0$, so $f_c(x)=(c_1-c_3)x_1+(c_2-c_3)x_2+\tfrac12\|x\|^2\ge\tfrac12\|x\|^2\gt 0=f_c(0)$ for $x\ne 0$. $0$ is the unique global minimizer ⇔ $c_1\ge c_3$ and $c_2\ge c_3$.
E3 Midterm 2 VI (past paper)Descriptive Β· exam

$Q\succ 0$, $n\ge 2$, distinct eigenvalues $0\lt\theta_1\lt\dots\lt\theta_n$, unit eigenvectors $q_i$ (the paper writes $\lambda_i$, $v_i$). $\max F(x)=x^\top x$ s.t. $g(x)=x^\top Qx-1\le 0$. Use $f=-x^\top x$ and $\mu\ge 0$.
(a) Feasible set compact, global max exists. (b) Lagrangian and complete KKT. (c) All KKT points and multipliers. (d) LICQ and critical cones. (e) Hessian and SONC; exclude points, exhibit failing directions. (f) SOSC on the survivors; strict local maximizers.

Show answer
  1. (a) $0\in\Omega$; closed (continuity). $\theta_1\|x\|^2\le x^\top Qx\le 1$ β‡’ $\|x\|\le 1/\sqrt{\theta_1}$ β‡’ bounded β‡’ compact β‡’ $F$ attains its max (Weierstrass).
  2. (b) $L=-x^\top x+\mu(x^\top Qx-1)$. KKT: $2(\mu Q-I)x=0$; $x^\top Qx\le 1$; $\mu\ge 0$; $\mu(x^\top Qx-1)=0$.
  3. (c) Inactive β‡’ $\mu=0$ β‡’ $x=0$: KKT pair $(0,0)$. Active β‡’ $x\ne 0$ β‡’ $\mu\ne 0$ β‡’ $Qx=\tfrac1\mu x$ β‡’ $x=tq_i$, $\theta_it^2=1$: $x_i^\pm=\pm q_i/\sqrt{\theta_i}$, $\mu_i=1/\theta_i$, $F=1/\theta_i$. Total $2n+1$ KKT points.
  4. (d) Origin: no active constraint, LICQ vacuous, $\nabla f(0)=0$ β‡’ $C_0=\mathbb R^n$. Boundary: $\nabla g=2Qx_i^\pm=2\theta_ix_i^\pm\ne 0$ β‡’ LICQ; $\mu_i\gt 0$ β‡’ $C_i^\pm=\{d:q_i^\top d=0\}=\operatorname{span}\{q_j:j\ne i\}$.
  5. (e) $H(\mu)=2(\mu Q-I)$. Origin: $H=-2I$, $q_1^\top Hq_1=-2\lt 0$ β‡’ SONC fails β‡’ origin is not a local max of $F$. At $x_i^\pm$: $H_i=2(Q/\theta_i-I)$, $d=\sum_{j\ne i}\alpha_jq_j$: $d^\top H_id=2\sum_{j\ne i}(\theta_j/\theta_i-1)\alpha_j^2$. For $i\ge 2$: $d=q_1$ gives $2(\theta_1/\theta_i-1)\lt 0$ β‡’ SONC fails β‡’ excluded. For $i=1$: all coefficients $\gt 0$ β‡’ SONC holds.
  6. (f) At $x_1^\pm$: $d^\top H_1d=2\sum_{j\ge 2}(\theta_j/\theta_1-1)\alpha_j^2\gt 0$ for $d\ne 0$ in $C$ β‡’ SOSC β‡’ $\pm q_1/\sqrt{\theta_1}$ are strict local minimizers of $f$, i.e. strict local maximizers of $F$ (note $H_1q_1=0$, but $q_1\notin C$, so no conflict).
  7. (g, global) $x^\top Qx-\theta_1\|x\|^2=\sum_{j\ge 2}(\theta_j-\theta_1)\beta_j^2\ge 0$ β‡’ $F\le x^\top Qx/\theta_1\le 1/\theta_1$, equality only at $\pm q_1/\sqrt{\theta_1}$. $F^\star=1/\theta_1$, two global maximizers (strict local, not strict global).

F. Exam level (new)

F1 New, in his style (parametric ladder, nonconvex feasible set)Descriptive Β· exam level

For $a\ge 0$: $\min f_a(x)=\tfrac12(x_1-a)^2+\tfrac12x_2^2$ s.t. $x_1^2+x_2^2\ge 1$ (stay outside the unit disk).
(a) Rewrite in course form and write the complete KKT conditions. (b) Find all KKT points and multipliers as functions of $a$; state where the active set changes. (c) Check LICQ. (d) For each KKT point and each parameter regime (treat $a=0$ and $a=1$ separately) find $C$, $\mathbf L_\star$, and classify. (e) State the global minimizer for each $a$.

Hint

Second stationarity equation: $x_2(1-2\mu)=0$. Split into $x_2=0$ and $\mu=\tfrac12$.

Show answer
  1. (a) $g(x)=1-x_1^2-x_2^2\le 0$. $\ell=\tfrac12(x_1-a)^2+\tfrac12x_2^2+\mu(1-x_1^2-x_2^2)$. KKT: $(1-2\mu)x_1-a=0$, $(1-2\mu)x_2=0$; $x_1^2+x_2^2\ge 1$; $\mu\ge 0$; $\mu(1-x_1^2-x_2^2)=0$.
  2. (b) Inactive ($\mu=0$): $x=(a,0)$; strictly inactive needs $a\gt 1$. Active ($x_1^2+x_2^2=1$):
    • $x_2=0$, $x_1=1$: $1-2\mu=a$ β‡’ $\mu=(1-a)/2\ge 0$ iff $a\le 1$.
    • $x_2=0$, $x_1=-1$: $-(1-2\mu)=a$ β‡’ $\mu=(1+a)/2\gt 0$ for every $a\ge 0$.
    • $\mu=\tfrac12$: first equation gives $a=0$; then every point of the circle is a KKT point with $\mu=\tfrac12$.
    $a$KKT points (multiplier)
    $a=0$every $x$ with $\|x\|=1$ ($\mu=\tfrac12$)
    $0\lt a\lt 1$$(1,0)$ ($\mu=\tfrac{1-a}2\gt 0$); $(-1,0)$ ($\mu=\tfrac{1+a}2$)
    $a=1$$(1,0)$ ($\mu=0$, active: degenerate); $(-1,0)$ ($\mu=1$)
    $a\gt 1$$(a,0)$ ($\mu=0$, inactive); $(-1,0)$ ($\mu=\tfrac{1+a}2$). [$(1,0)$ would need $\mu=\tfrac{1-a}2\lt 0$: rejected.]
    The constraint stops being active at $(1,0)$ when $a$ passes $1$.
  3. (c) On the circle $\nabla g=-2x\ne 0$; at $(a,0)$ for $a\gt 1$ nothing is active. LICQ holds at every feasible point, so every local min is a KKT point.
  4. (d) $\mathbf L_\star=\nabla^2f+\mu\nabla^2g=I-2\mu I=(1-2\mu)I$.
    • $(1,0)$, $0\lt a\lt 1$: $\mu\gt 0$, $\nabla g=(-2,0)$ β‡’ $C=\{(0,t)\}$. $\mathbf L_\star=aI$ β‡’ $at^2\gt 0$ β‡’ SOSC β‡’ strict local min.
    • $(1,0)$, $a=1$: $\mu=0$, $g\in\mathcal A_0$ β‡’ $C=\{d:-2d_1\le 0\}=\{d_1\ge 0\}$ (a half-plane). $\mathbf L_\star=I$ β‡’ $\|d\|^2\gt 0$ β‡’ SOSC β‡’ strict local min.
    • $(a,0)$, $a\gt 1$: inactive, $\nabla f=0$ β‡’ $C=\mathbb R^2$, $\mathbf L_\star=I$ β‡’ SOSC β‡’ strict local min ($f=0$).
    • $(-1,0)$, $a\gt 0$: $\mu=\tfrac{1+a}2\gt 0$, $\nabla g=(2,0)$ β‡’ $C=\{(0,t)\}$; $\mathbf L_\star=(1-(1+a))I=-aI$ β‡’ $-at^2\lt 0$; regular β‡’ SONC fails β‡’ not a local min (it is the farthest point from $(a,0)$ locally).
    • $a=0$, any circle point: $\mu=\tfrac12$ β‡’ $\mathbf L_\star=0$, $C=\{d:x^\top d=0\}$ (tangent line) β‡’ SONC holds, SOSC fails β‡’ second-order tests are inconclusive. Directly: $f=\tfrac12\|x\|^2\ge\tfrac12$ on $\Omega$ with equality on the whole circle β‡’ every circle point is a global (hence local) minimizer, none strict.
  5. (e) $f_a$ is half the squared distance to $(a,0)$. $a=0$: whole unit circle, value $\tfrac12$. $0\lt a\le 1$: $(1,0)$, value $\tfrac12(1-a)^2$. $a\gt 1$: $(a,0)$, value $0$. (Checked numerically on a grid for $a=0.5,1,2$.)
F2 New, in his style (eigenvector variant he asked you to try)Descriptive Β· exam level

Let $Q=\begin{pmatrix}3&1\\1&3\end{pmatrix}$ (eigenvalues $\theta_i$, unit eigenvectors $q_i$). Solve $\min f(x)=x^\top x$ s.t. $x^\top Qx\ge 1$ by the full ladder: KKT points with multipliers, LICQ, critical cones, $\mathbf L_\star$, SONC/SOSC classification, and the global minimum. Then state the general answer for $Q\succ 0$ with distinct eigenvalues.

Hint

Eigenpairs: $\theta_1=2$, $q_1=(1,-1)/\sqrt2$; $\theta_2=4$, $q_2=(1,1)/\sqrt2$.

Show answer
  1. Form. $g=1-x^\top Qx\le 0$; $\ell=x^\top x+\mu(1-x^\top Qx)$.
  2. KKT. $2x-2\mu Qx=0$; $x^\top Qx\ge 1$; $\mu\ge 0$; $\mu(1-x^\top Qx)=0$.
  3. Inactive β‡’ $\mu=0$ β‡’ $x=0$, but $g(0)=1\gt 0$: infeasible. So the constraint is active, $\mu\ne 0$, $Qx=\tfrac1\mu x$.
  4. $\theta=4$: $x=\pm q_2/2=\pm(\tfrac{\sqrt2}4,\tfrac{\sqrt2}4)$, $\mu=\tfrac14$, $f=\tfrac14$. $\theta=2$: $x=\pm q_1/\sqrt2=\pm(\tfrac12,-\tfrac12)$, $\mu=\tfrac12$, $f=\tfrac12$. All $\mu\gt 0$ βœ“, all on $x^\top Qx=1$ βœ“.
  5. LICQ. $\nabla g=-2Qx=-2\theta_ix\ne 0$ βœ“ at all four.
  6. Critical cones. $\mu\gt 0$ β‡’ $C=\{d:(Qx)^\top d=0\}=\{d:x^\top d=0\}$: at $\pm q_2/2$, $C=\operatorname{span}\{(1,-1)\}$; at $\pm q_1/\sqrt2$, $C=\operatorname{span}\{(1,1)\}$.
  7. $\mathbf L_\star=2(I-\mu Q)$. At $\mu=\tfrac14$: $\mathbf L_\star=\begin{pmatrix}\tfrac12&-\tfrac12\\-\tfrac12&\tfrac12\end{pmatrix}$, $d=(1,-1)$: $d^\top \mathbf L_\star d=2\gt 0$ β‡’ SOSC β‡’ $\pm(\tfrac{\sqrt2}4,\tfrac{\sqrt2}4)$ strict local minimizers. At $\mu=\tfrac12$: $\mathbf L_\star=\begin{pmatrix}-1&-1\\-1&-1\end{pmatrix}$, $d=(1,1)$: $-4\lt 0$, regular β‡’ SONC fails β‡’ $\pm(\tfrac12,-\tfrac12)$ are not local minimizers.
  8. Global. Feasible set closed and nonempty, $f$ coercive β‡’ a global min exists; it is a KKT point (LICQ everywhere) β‡’ $\min=\tfrac14=1/\theta_{\max}$ at $\pm(\tfrac{\sqrt2}4,\tfrac{\sqrt2}4)$.
  9. General. KKT points $\pm q_i/\sqrt{\theta_i}$, $\mu=1/\theta_i$; on $C=q_i^\perp$: $d^\top \mathbf L_\star d=2\sum_{j\ne i}(1-\theta_j/\theta_i)\alpha_j^2$ β‡’ only $i=n$ passes (SOSC); answer $1/\theta_n$ at $\pm q_n/\sqrt{\theta_n}$.

Self-test (no looking)

S1

Write the Lagrangian and all five KKT conditions for $\min f$ s.t. $h=0$, $g\le 0$. Which multipliers have a sign restriction?

Show answer

$\ell=f+\lambda^\top h+\mu^\top g$. $\nabla f+J_h\lambda+J_g\mu=0$; $h=0$; $g\le 0$; $\mu\ge 0$; $\mu_jg_j=0\ \forall j$. Only $\mu\ge 0$; $\lambda$ free.

S2

Define LICQ. Under LICQ, what is unique and what is not?

Show answer

Gradients of all equalities and active inequalities linearly independent. The KKT multipliers are unique; the minimizer need not be.

S3

State the relation between $T_\Omega$ and $\mathcal L_\Omega$, and two cases where they are equal.

Show answer

$T\subseteq\mathcal L$ always ($C^1$ constraints). Equal at regular points (LICQ, sufficient not necessary) and whenever all constraints are affine.

S4

Write the critical cone with the $\mathcal A_+/\mathcal A_0$ split. Why do $\mathcal A_0$ rows keep "$\le$"?

Show answer

$C=\{d:\nabla h_i^\top d=0,\ \nabla g_j^\top d=0\ (j\in\mathcal A_+),\ \nabla g_j^\top d\le 0\ (j\in\mathcal A_0)\}$. A zero-multiplier constraint costs no first-order increase when you move inward, so those inward directions are still "ties" and must be tested; forcing "$=$" would lose them (e.g. $u-v^2$ on the quadrant).

S5

State SONC and SOSC with all hypotheses. Which one needs LICQ? Which gives a strict minimum?

Show answer

SONC: $C^2$, local min, regular β‡’ $d^\top \mathbf L_\star d\ge 0$ on $C$ (needs LICQ). SOSC: $C^2$, KKT holds, $d^\top \mathbf L_\star d\gt 0$ for all $0\ne d\in C$ β‡’ strict local min (no LICQ).

S6

$C=\{0\}$ at a KKT point. Does SOSC pass or fail? What if $\mathbf L_\star$ is indefinite?

Show answer

Passes (vacuously) β‡’ strict local min. Indefinite $\mathbf L_\star$ on $\mathbb R^n$ is irrelevant; only $C$ matters.

S7

State Farkas' lemma in the course form (signs!).

Show answer

$d^\top c\ge 0$ for all $d$ with $A^\top d=0$, $B^\top d\le 0$ ⇔ $\exists\lambda$ free, $\mu\ge 0$ with $c+A\lambda+B\mu=0$.

S8

Give one example each: (i) a minimum where KKT fails; (ii) an active constraint with $\mu=0$; (iii) KKT + SONC hold, SOSC fails, not a min.

Show answer

(i) $\min x$ s.t. $-x^3\le 0$ at $0$. (ii) $\min x^2$ s.t. $-x\le 0$ at $0$. (iii) $\min v-u^4$ s.t. $-v\le 0$ at the origin ($\mu=1$, $C=\{(a,0)\}$, $\mathbf L_\star=0$, $f(t,0)=-t^4$).

S9

In plain words: what does complementary slackness $\mu_jg_j(x^\star)=0$ say, and what does it not say?

Show answer

A wall you aren't touching ($g_j\lt0$) can't push ($\mu_j=0$), and a wall that pushes ($\mu_j\gt0$) must be touched ($g_j=0$). It does not say a touched wall must push: active with $\mu_j=0$ is allowed.

S10

Why is $T_\Omega\subseteq\mathcal L_\Omega$ always, and give one example where they differ.

Show answer

For $x_k=x^\star+t_kd_k\in\Omega$: Taylor gives $0=h(x_k)=t_k\nabla h^\top d_k+o(t_k)$ and $0\ge g_j(x_k)=t_k\nabla g_j^\top d_k+o(t_k)$ for active $j$; divide by $t_k$ and let $k\to\infty$. Example: $uv=0$ (or $v^3=0$) at the origin: gradient zero, so $\mathcal L=\mathbb R^2$, but $T$ is the two axes (resp. the $u$-axis).

Summary card (for revision; the formula sheet copies this)

Memorise cold (course form, Theorems 6.1.1, 6.2.1, 6.3.3, 6.4.1, 6.4.2)

Symbols: $f$ objective; $h_i=0$ ($i=1..m$) equalities; $g_j\le0$ ($j=1..p$) inequalities; $\Omega$ feasible set; $x^\star$ the point tested; $\mathcal A=\{j:g_j(x^\star)=0\}$ active set; $\lambda$ equality multipliers (free), $\mu$ inequality multipliers ($\ge0$); $d$ a direction; $\theta_i,q_i$ eigenvalues/unit eigenvectors of $Q$.

  • Problem form: $\min f(x)$ s.t. $h_i(x)=0$, $g_j(x)\le0$. Rewrite first: $x_1\ge0\to-x_1\le0$; $x^\top Qx\ge1\to1-x^\top Qx\le0$; $\max F\to\min -F$.
  • Lagrangian: $\ell(x,\lambda,\mu)=f(x)+\sum_i\lambda_ih_i(x)+\sum_j\mu_jg_j(x)$ (plus signs; Midterm 2 calls it $L$).
  • KKT (five parts): (1) $\nabla f+\sum\lambda_i\nabla h_i+\sum\mu_j\nabla g_j=0$; (2) $h=0$; (3) $g\le0$; (4) $\mu\ge0$; (5) $\mu_jg_j=0$ for every $j$. $\lambda$ has no sign. Inactive β‡’ $\mu_j=0$; $\mu_j\gt0$ β‡’ active; active does not force $\mu_j\gt0$.
  • LICQ / regular point: gradients of all $h_i$ and all active $g_j$ linearly independent. KKT is necessary only at regular points; under LICQ the multipliers are unique.
  • Cones: tangent $T_\Omega$: $d$ with $x^\star+t_kd_k\in\Omega$, $t_k\downarrow0$, $d_k\to d$. Linearised $\mathcal L_\Omega=\{d:\nabla h_i^\top d=0,\ \nabla g_j^\top d\le0\ (j\in\mathcal A)\}$. $T_\Omega\subseteq\mathcal L_\Omega$ always; equal if regular (sufficient, not necessary) or all constraints linear. Counterexamples: $uv=0$, $v^3=0$.
  • Geometric FONC (no CQ): local min β‡’ $\nabla f(x^\star)^\top d\ge0$ for all $d\in T_\Omega(x^\star)$. A KKT point satisfies it without LICQ.
  • Farkas: [$c^\top d\ge0$ whenever $A^\top d=0,\ B^\top d\le0$] ⇔ [$c+A\lambda+B\mu=0$ for some $\lambda$ free, $\mu\ge0$]. No rank assumption.
  • Active split: $\mathcal A_+=\{j\in\mathcal A:\mu_j^\star\gt0\}$, $\mathcal A_0=\{j\in\mathcal A:\mu_j^\star=0\}$.
  • Critical cone: $C=\{d:\ \nabla h_i^\top d=0\ \forall i,\ \nabla g_j^\top d=0\ (j\in\mathcal A_+),\ \nabla g_j^\top d\le0\ (j\in\mathcal A_0)\}=\{d\in\mathcal L_\Omega:\nabla f(x^\star)^\top d=0\}$.
  • Hessian of the Lagrangian: $\mathbf L_\star=\nabla^2f+\sum\lambda_i^\star\nabla^2h_i+\sum\mu_j^\star\nabla^2g_j$ at $x^\star$, multipliers fixed. Never $\nabla^2 f$ alone with curved constraints.
  • SONC ($C^2$, local min, regular): $d^\top\mathbf L_\star d\ge0$ for all $d\in C$. Fails at a regular KKT point β‡’ not a local min.
  • SOSC ($C^2$, KKT holds, no LICQ needed): $d^\top\mathbf L_\star d\gt0$ for all $0\ne d\in C$ β‡’ strict local min. $C=\{0\}$ β‡’ SOSC holds. Indefinite $\mathbf L_\star$ on $\mathbb R^n$ is irrelevant.
  • Ladder: rewrite β†’ $\ell$ β†’ five KKT parts β†’ active-set guesses β†’ solve β†’ check signs/feasibility β†’ LICQ β†’ $\mathcal A_+/\mathcal A_0$ β†’ $C$ β†’ $\mathbf L_\star$ β†’ test on $C$ β†’ classify (local, then global).
  • Eigenvector answers ($Q\succ0$, $0\lt\theta_1\lt\dots\lt\theta_n$): $\max x^\top x$ s.t. $x^\top Qx\le1$ β†’ $1/\theta_1$ at $\pm q_1/\sqrt{\theta_1}$; $\min x^\top x$ s.t. $x^\top Qx\ge1$ (or $=1$) β†’ $1/\theta_n$ at $\pm q_n/\sqrt{\theta_n}$; on $C=q_i^\perp$, writing $d=\sum_{j\ne i}\alpha_jq_j$: $d^\top\mathbf L_\star d=2\sum_{j\ne i}(1-\theta_j/\theta_i)\alpha_j^2$ for the min problem.