Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Proposition 8.7.2 — Karush–Kuhn–Tucker conditions for convex programs in equational form

Proved
MatousekLP.SmallestBall.kkt_conditions

by mikedeng1 · Oct 3, 2026 · Mathlib 0df444a (Lean v4.33.1)

convex-programmingkkt-conditionsoptimality-conditionsp2o-batch-b23bp2o-gran-per-chapterp2o-plan-bookp2o-v1

Let AAA be a real m×nm\times nm×n matrix with columns a1,…,ana_1,\dots,a_na1​,…,an​, let b∈Rmb\in\mathbb{R}^mb∈Rm, and let f:Rn→Rf:\mathbb{R}^n\to\mathbb{R}f:Rn→R be convex and differentiable with continuous partial derivatives. Consider the convex program

minimize f(x)  subject to Ax=b, x≥0.\text{minimize } f(x)\ \text{ subject to } Ax=b,\ x\ge 0 .minimize f(x)  subject to Ax=b, x≥0.

A feasible solution x∗∈Rnx^*\in\mathbb{R}^nx∗∈Rn is optimal if and only if there is a vector y~∈Rm\tilde y\in\mathbb{R}^my~​∈Rm such that for all j∈{1,…,n}j\in\{1,\dots,n\}j∈{1,…,n},

∇f(x∗)j+y~Taj {=0if xj∗>0,≥0otherwise.\nabla f(x^*)_j+\tilde y^{T}a_j\ \begin{cases}=0 & \text{if } x^*_j>0,\\ \ge 0 & \text{otherwise.}\end{cases}∇f(x∗)j​+y~​Taj​ {=0≥0​if xj∗​>0,otherwise.​

Here ∇f(x∗)j=∂f/∂xj\nabla f(x^*)_j=\partial f/\partial x_j∇f(x∗)j​=∂f/∂xj​ at x∗x^*x∗. The components of y~\tilde yy~​ are the Karush–Kuhn–Tucker multipliers.

The KKT conditions are the optimality certificate for convex programs; in this section they are the step that turns the smallest-ball program (8.15) into the geometry of Lemma 8.7.3.

Formalization Note ∇f(x∗)j\nabla f(x^*)_j∇f(x∗)j​ is the derivative of fff at x∗x^*x∗ applied to the jjjth unit vector, and y~Taj=∑iy~iAij\tilde y^Ta_j=\sum_i \tilde y_i A_{ij}y~​Taj​=∑i​y~​i​Aij​ is the jjjth entry of the row vector y~TA\tilde y^TAy~​TA. "Continuous partial derivatives" is ContDiff ℝ 1 f. "Otherwise" is read as xj∗≯0x^*_j\not>0xj∗​>0, which for a feasible x∗x^*x∗ means xj∗=0x^*_j=0xj∗​=0.

Preamble
import Mathlib
import Definitions.Def_MatousekLP_SmallestBall_Basic

open Matrix
Formal statement
namespace MatousekLP.SmallestBall

/-- Proposition 8.7.2 (Karush–Kuhn–Tucker conditions; Matoušek & Gärtner, p. 187). Consider the
convex program "minimize `f(x)` subject to `Ax = b`, `x ≥ 0`" with `f` convex and differentiable
with continuous partial derivatives. A feasible `x*` is optimal iff there is `ỹ ∈ ℝ^m` such that
for all `j`, `∇f(x*)ⱼ + ỹᵀaⱼ = 0` if `x*ⱼ > 0` and `≥ 0` otherwise, where `aⱼ` is the `j`th column
of `A`. Here `∇f(x*)ⱼ = fderiv ℝ f x* (eⱼ)` and `ỹᵀaⱼ = ∑ᵢ ỹᵢ Aᵢⱼ = (ỹ ᵥ* A) j`. -/
theorem kkt_conditions {m n : ℕ} (A : Matrix (Fin m) (Fin n) ℝ) (b : Fin m → ℝ)
    (f : (Fin n → ℝ) → ℝ) (hfc : ConvexOn ℝ Set.univ f) (hf : ContDiff ℝ 1 f)
    (xstar : Fin n → ℝ) (hxstar : MatousekLP.BFS.IsFeasible A b xstar) :
    IsOptimal f A b xstar ↔
      ∃ y : Fin m → ℝ, ∀ j : Fin n,
        (0 < xstar j → fderiv ℝ f xstar (Pi.single j 1) + (y ᵥ* A) j = 0) ∧
        (¬ 0 < xstar j → 0 ≤ fderiv ℝ f xstar (Pi.single j 1) + (y ᵥ* A) j) := by sorry

end MatousekLP.SmallestBall
Source
Matoušek & Gärtner, Understanding and Using Linear Programming, Springer 2007, p. 187, Proposition 8.7.2 (Karush–Kuhn–Tucker conditions)
Human review
  • Endorsed by Shuze Chen · Oct 5, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 5, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me