Mehmet Emre Tiryaki
Back to Notes

Fritz John and KKT Conditions

Setting

(P)min⁡  f(x)s.t.gi(x)≤0,i=1,…,m(P) \quad \min \; f(x) \quad \text{s.t.} \quad g_i(x) \le 0, \quad i = 1, \ldots, m

with f,g1,…,gm:Rn→Rf, g_1, \ldots, g_m : \mathbb{R}^n \to \mathbb{R} continuously differentiable. Write g⃗=(g1,…,gm):Rn→Rm\vec{g} = (g_1, \ldots, g_m) : \mathbb{R}^n \to \mathbb{R}^m and its Jacobian ∇g⃗(x)=[∇g1(x) ∣ ⋯ ∣ ∇gm(x)]∈Rn×m\nabla \vec{g}(x) = \big[ \nabla g_1(x) \,|\, \cdots \,|\, \nabla g_m(x) \big] \in \mathbb{R}^{n \times m}.

For xx feasible, the active constraints are the ones on the boundary,

Ax={i:gi(x)=0}\mathcal{A}_x = \{ i : g_i(x) = 0 \}

Road to Fritz John

Let xx be feasible and a local min of (P)(P).

  1. There is no d∈Rnd \in \mathbb{R}^n that is a descent direction for ff and all active gig_i. Otherwise, for all small enough α>0\alpha > 0, gi(x+αd)<gi(x)=0g_i(x + \alpha d) < g_i(x) = 0 for i∈Axi \in \mathcal{A}_x and, by continuity, gi(x+αd)<0g_i(x + \alpha d) < 0 for i∉Axi \notin \mathcal{A}_x, so x+αdx + \alpha d is feasible with f(x+αd)<f(x)f(x + \alpha d) < f(x), a contradiction.
  2. Equivalently, there is no dd with JTd<0⃗J^T d < \vec{0}, where the rows of JTJ^T are ∇f(x)T\nabla f(x)^T and ∇gi(x)T\nabla g_i(x)^T for i∈Axi \in \mathcal{A}_x.
  3. By Gordan, there is λ≥0⃗\lambda \ge \vec{0}, λ≠0⃗\lambda \neq \vec{0}, with Jλ=0⃗J\lambda = \vec{0}.
  4. Setting the multipliers of inactive constraints to 0, there is a nonzero (β,λ)≥0⃗(\beta, \lambda) \ge \vec{0}, β∈R\beta \in \mathbb{R}, λ∈Rm\lambda \in \mathbb{R}^m, with β∇f(x)+∇g⃗(x)λ=0⃗\beta \nabla f(x) + \nabla \vec{g}(x) \lambda = \vec{0} and λi=0\lambda_i = 0 whenever gi(x)≠0g_i(x) \neq 0.
  5. The last condition is λigi(x)=0\lambda_i g_i(x) = 0 for all ii. Since λi≥0\lambda_i \ge 0 and gi(x)≤0g_i(x) \le 0, every term λigi(x)≤0\lambda_i g_i(x) \le 0, so it is equivalent to ∑iλigi(x)=λTg⃗(x)=0\sum_i \lambda_i g_i(x) = \lambda^T \vec{g}(x) = 0 (complementary slackness, λ≥0⃗\lambda \ge \vec{0} and g⃗(x)≤0⃗\vec{g}(x) \le \vec{0} are orthogonal).

Fritz John Conditions

If xx is feasible and a local min of (P)(P), there are β∈R\beta \in \mathbb{R}, λ∈Rm\lambda \in \mathbb{R}^m with

β∇f(x)+∇g⃗(x)λ=0⃗,λTg⃗(x)=0,[βλ]≥0⃗, nonzero\beta \nabla f(x) + \nabla \vec{g}(x) \lambda = \vec{0}, \qquad \lambda^T \vec{g}(x) = 0, \qquad \begin{bmatrix} \beta \\ \lambda \end{bmatrix} \ge \vec{0}, \text{ nonzero}

or, β∇f(x)+∑i=1mλi∇gi(x)=0⃗\beta \nabla f(x) + \sum_{i=1}^m \lambda_i \nabla g_i(x) = \vec{0}, λigi(x)=0\lambda_i g_i(x) = 0 for all ii, β,λi≥0\beta, \lambda_i \ge 0 not all zero.

KKT Conditions

If xx is feasible, a local min of (P)(P), and satisfies the constraint qualification that {∇gi(x)}i∈Ax\{\nabla g_i(x)\}_{i \in \mathcal{A}_x} are linearly independent, then there is λ∈Rm\lambda \in \mathbb{R}^m with

∇f(x)+∇g⃗(x)λ=0⃗,λTg⃗(x)=0,λ≥0⃗\nabla f(x) + \nabla \vec{g}(x) \lambda = \vec{0}, \qquad \lambda^T \vec{g}(x) = 0, \qquad \lambda \ge \vec{0}

Proof Take (β,λ)(\beta, \lambda) from Fritz John. If β=0\beta = 0, then ∑i∈Axλi∇gi(x)=0⃗\sum_{i \in \mathcal{A}_x} \lambda_i \nabla g_i(x) = \vec{0} with the λi\lambda_i not all zero, a nontrivial linear combination of the active gradients giving 0⃗\vec{0}, which contradicts independence. So β>0\beta > 0, and scaling (β,λ)(\beta, \lambda) by 1/β1/\beta gives β=1\beta = 1, after which nonzero is automatic.

So under the constraint qualification, a point that is not a KKT point is not a local min.

Checking a point For a candidate x^\hat{x}, check feasibility and that the gradients of the active constraints are linearly independent. Inactive constraints have λi=0\lambda_i = 0 by complementary slackness, so solve the linear system ∇f(x^)+∑i∈Ax^λi∇gi(x^)=0⃗\nabla f(\hat{x}) + \sum_{i \in \mathcal{A}_{\hat{x}}} \lambda_i \nabla g_i(\hat{x}) = \vec{0} and check λ≥0⃗\lambda \ge \vec{0}.

Sufficiency

Convex programs Let S⊆Rn\mathcal{S} \subseteq \mathbb{R}^n be nonempty, open and convex, and f,g1,…,gm:S→Rf, g_1, \ldots, g_m : \mathcal{S} \to \mathbb{R} continuously differentiable and convex. If xˉ∈S\bar{x} \in \mathcal{S} is a KKT point of

min⁡  f(x)s.t.gi(x)≤0,  i=1,…,m,x∈S\min \; f(x) \quad \text{s.t.} \quad g_i(x) \le 0, \; i = 1, \ldots, m, \quad x \in \mathcal{S}

i.e. gi(xˉ)≤0g_i(\bar{x}) \le 0, ∇f(xˉ)+∑iλi∇gi(xˉ)=0⃗\nabla f(\bar{x}) + \sum_i \lambda_i \nabla g_i(\bar{x}) = \vec{0}, λigi(xˉ)=0\lambda_i g_i(\bar{x}) = 0, λi≥0\lambda_i \ge 0, then xˉ\bar{x} is a global min. No constraint qualification is needed.

Local version Let S\mathcal{S} be nonempty and open and f,gif, g_i twice continuously differentiable. If xˉ\bar{x} is a KKT point with ∇2f(xˉ)\nabla^2 f(\bar{x}) PD and ∇2gi(xˉ)\nabla^2 g_i(\bar{x}) PD for all i∈Axˉi \in \mathcal{A}_{\bar{x}}, then xˉ\bar{x} is a local min.

Proof By continuity of the gig_i and of the eigenvalues of the Hessians, and since S\mathcal{S} is open, there is ε>0\varepsilon > 0 with Nε(xˉ)⊆SN_\varepsilon(\bar{x}) \subseteq \mathcal{S} such that on Nε(xˉ)N_\varepsilon(\bar{x})

  • gi(x)<0g_i(x) < 0 for i∉Axˉi \notin \mathcal{A}_{\bar{x}},
  • ∇2gi(x)\nabla^2 g_i(x) is PSD for i∈Axˉi \in \mathcal{A}_{\bar{x}},
  • ∇2f(x)\nabla^2 f(x) is PSD.

Consider

(P′)min⁡  f(x)s.t.gi(x)≤0,  i∈Axˉ,x∈Nε(xˉ)(P') \quad \min \; f(x) \quad \text{s.t.} \quad g_i(x) \le 0, \; i \in \mathcal{A}_{\bar{x}}, \quad x \in N_\varepsilon(\bar{x})

Nε(xˉ)N_\varepsilon(\bar{x}) is open and convex, and ff and the active gig_i are convex on it, so (P′)(P') is a convex program. xˉ\bar{x} is a KKT point of (P)(P), with inactive multipliers 0, so it is a KKT point of (P′)(P') and hence a global min of (P′)(P'). Within Nε(xˉ)N_\varepsilon(\bar{x}) the feasible sets of (P)(P) and (P′)(P') agree, so xˉ\bar{x} is a local min of (P)(P).

Equality Constraints

With equality constraints hj(x)=0h_j(x) = 0, j=1,…,ℓj = 1, \ldots, \ell, stationarity becomes

∇f(x)+∑i=1mλi∇gi(x)+∑j=1ℓμj∇hj(x)=0⃗\nabla f(x) + \sum_{i=1}^m \lambda_i \nabla g_i(x) + \sum_{j=1}^{\ell} \mu_j \nabla h_j(x) = \vec{0}

with λigi(x)=0\lambda_i g_i(x) = 0, λ≥0⃗\lambda \ge \vec{0}, and μ\mu free in sign.

Equality constrained QP

min⁡  12xTQx+cTx+ds.t.Ax=b\min \; \frac{1}{2} x^T Q x + c^T x + d \quad \text{s.t.} \quad Ax = b

with Q∈Rn×nQ \in \mathbb{R}^{n \times n} PD, A∈Rm×nA \in \mathbb{R}^{m \times n}. This is always convex. With ∇f(x)=Qx+c\nabla f(x) = Qx + c,

Qx+c+ATμ=0⃗,Ax=b  ⟺  [QATA0][xμ]=[−cb]Qx + c + A^T \mu = \vec{0}, \quad Ax = b \iff \begin{bmatrix} Q & A^T \\ A & 0 \end{bmatrix} \begin{bmatrix} x \\ \mu \end{bmatrix} = \begin{bmatrix} -c \\ b \end{bmatrix}

and the KKT matrix is invertible if AA has full row rank.

KKT for Linear Programs

(LP)min⁡  cTxs.t.Ax≥b,  x≥0⃗(DP)max⁡  bTys.t.ATy≤c,  y≥0⃗(LP) \quad \min \; c^T x \quad \text{s.t.} \quad Ax \ge b, \; x \ge \vec{0} \qquad \qquad (DP) \quad \max \; b^T y \quad \text{s.t.} \quad A^T y \le c, \; y \ge \vec{0}

Rewrite the constraints as g⃗(x)≤0⃗\vec{g}(x) \le \vec{0},

[b−Ax−x]≤0⃗  ⟺  [−A−I]x+[b0⃗]≤0⃗\begin{bmatrix} b - Ax \\ -x \end{bmatrix} \le \vec{0} \iff \begin{bmatrix} -A \\ -I \end{bmatrix} x + \begin{bmatrix} b \\ \vec{0} \end{bmatrix} \le \vec{0}

so ∇f=c\nabla f = c and ∇g⃗=[−AT ∣ −I]\nabla \vec{g} = [-A^T \,|\, -I]. With multipliers λ=(y,z)\lambda = (y, z), xx is a KKT point iff

Ax≥b,  x≥0⃗,c−ATy−z=0⃗,yT(b−Ax)=0,  −zTx=0,y,z≥0⃗Ax \ge b, \; x \ge \vec{0}, \qquad c - A^T y - z = \vec{0}, \qquad y^T (b - Ax) = 0, \; -z^T x = 0, \qquad y, z \ge \vec{0}

Substituting z=c−ATyz = c - A^T y,

Ax≥b,  x≥0⃗⏟primal feasible,ATy≤c,  y≥0⃗⏟dual feasible,yT(Ax−b)=0,  xT(c−ATy)=0⏟complementary slackness\underbrace{Ax \ge b, \; x \ge \vec{0}}_{\text{primal feasible}}, \qquad \underbrace{A^T y \le c, \; y \ge \vec{0}}_{\text{dual feasible}}, \qquad \underbrace{y^T (Ax - b) = 0, \; x^T (c - A^T y) = 0}_{\text{complementary slackness}}

i.e. primal feasibility of xx, dual feasibility of yy, and complementary slackness.