Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Fact 8.7.1 — first-order optimality criterion for a convex function on a convex set

Proved
MatousekLP.SmallestBall.first_order_optimality

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

convex-programmingoptimality-conditionsp2o-batch-b23bp2o-gran-per-chapterp2o-plan-bookp2o-v1

Let C⊆RnC\subseteq\mathbb{R}^nC⊆Rn be a convex set and f:Rn→Rf:\mathbb{R}^n\to\mathbb{R}f:Rn→R a differentiable convex function, and let x∗∈Cx^*\in Cx∗∈C. Write ∇f(x∗)\nabla f(x^*)∇f(x∗) for the gradient of fff at x∗x^*x∗, viewed as a row vector, so that ∇f(x∗)(x−x∗)\nabla f(x^*)(x-x^*)∇f(x∗)(x−x∗) is its scalar product with x−x∗x-x^*x−x∗. Then x∗x^*x∗ minimizes fff over CCC, that is, f(x∗)≤f(x)f(x^*)\le f(x)f(x∗)≤f(x) for all x∈Cx\in Cx∈C, if and only if

∇f(x∗)(x−x∗) ≥ 0for all x∈C.\nabla f(x^*)(x-x^*)\ \ge\ 0\qquad\text{for all } x\in C .∇f(x∗)(x−x∗) ≥ 0for all x∈C.

This is the variational inequality characterizing minimizers of a convex differentiable function over a convex set. It is the bridge from convex programming to linear programming used in the proof of the Karush–Kuhn–Tucker conditions (Proposition 8.7.2).

Formalization Note ∇f(x∗)(x−x∗)\nabla f(x^*)(x-x^*)∇f(x∗)(x−x∗) is the Fréchet derivative of fff at x∗x^*x∗ applied to x−x∗x-x^*x−x∗. The book's phrase "a vector x∗x^*x∗ minimizes f(x)f(x)f(x) over CCC" includes x∗∈Cx^*\in Cx∗∈C; this membership is a hypothesis.

Preamble
import Mathlib
Formal statement
namespace MatousekLP.SmallestBall

/-- Fact 8.7.1 (Matoušek & Gärtner, p. 186). Let `C ⊆ ℝⁿ` be convex and `f : ℝⁿ → ℝ`
differentiable and convex, and let `x* ∈ C`. Then `x*` minimizes `f` over `C` if and only if
`∇f(x*)(x − x*) ≥ 0` for all `x ∈ C`; here `∇f(x*)(x − x*)` is the derivative of `f` at `x*`
applied to `x − x*`. -/
theorem first_order_optimality {n : ℕ} (C : Set (Fin n → ℝ)) (hC : Convex ℝ C)
    (f : (Fin n → ℝ) → ℝ) (hf : Differentiable ℝ f) (hfc : ConvexOn ℝ Set.univ f)
    (xstar : Fin n → ℝ) (hxstar : xstar ∈ C) :
    IsMinOn f C xstar ↔ ∀ x ∈ C, 0 ≤ fderiv ℝ f xstar (x - xstar) := by sorry

end MatousekLP.SmallestBall
Source
Matoušek & Gärtner, Understanding and Using Linear Programming, Springer 2007, p. 186, Fact 8.7.1
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 paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me