Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Weak duality

Proved
ConvexOptimization.weak_duality

by Shuze Chen · Aug 12, 2026 · Mathlib 0df444a (Lean v4.33.1)

convexoptimizationdualitykkt

Weak duality — inequality (5.2) of Boyd & Vandenberghe: the dual function is a lower bound on the primal objective at every feasible point.

For the standard problem with objective f0f_0f0​, inequality constraints fi(x)≤0f_i(x) \le 0fi​(x)≤0 and equality constraints ⟨aj,x⟩=bj\langle a_j,x\rangle = b_j⟨aj​,x⟩=bj​, write L(x,λ,ν)=f0(x)+∑iλifi(x)+∑jνj(⟨aj,x⟩−bj)L(x,\lambda,\nu) = f_0(x) + \sum_i \lambda_i f_i(x) + \sum_j \nu_j(\langle a_j,x\rangle - b_j)L(x,λ,ν)=f0​(x)+∑i​λi​fi​(x)+∑j​νj​(⟨aj​,x⟩−bj​) and g(λ,ν)=inf⁡xL(x,λ,ν)g(\lambda,\nu) = \inf_x L(x,\lambda,\nu)g(λ,ν)=infx​L(x,λ,ν). Let λ∈Rm\lambda \in \mathbb{R}^mλ∈Rm with λi≥0\lambda_i \ge 0λi​≥0 for all iii, let ν∈Rp\nu \in \mathbb{R}^pν∈Rp be arbitrary, and let xxx be feasible. Then

g(λ,ν)  ≤  f0(x).g(\lambda,\nu) \;\le\; f_0(x).g(λ,ν)≤f0​(x).

Taking the infimum over feasible xxx gives g(λ,ν)≤p⋆g(\lambda,\nu) \le p^{\star}g(λ,ν)≤p⋆: every dual-feasible pair certifies a lower bound on the optimal value, at the cost of a single evaluation and with no convexity assumption on the problem. The difference p⋆−g(λ,ν)p^{\star} - g(\lambda,\nu)p⋆−g(λ,ν) is the duality gap, and an equality g(λ,ν)=f0(x)g(\lambda,\nu) = f_0(x)g(λ,ν)=f0​(x) therefore proves simultaneously that xxx is primal optimal and (λ,ν)(\lambda,\nu)(λ,ν) dual optimal — the mechanism behind every statement later in this mission.

Formalization Note The inequality is between EReal values, so the vacuous case g(λ,ν)=−∞g(\lambda,\nu) = -\inftyg(λ,ν)=−∞ needs no separate treatment; feasibility of xxx is membership in the mission's feasible-set definition. Source: B&V §5.2.2, p. 225, eq. (5.2).

Preamble
import Mathlib
import Definitions.Def_ConvexOptimization_lagrangeDuality

open scoped RealInnerProductSpace ENNReal
open MeasureTheory

Formal statement
theorem ConvexOptimization.weak_duality {n mm p : ℕ}
    (f₀ : EuclideanSpace ℝ (Fin n) → ℝ)
    (fc : Fin mm → EuclideanSpace ℝ (Fin n) → ℝ)
    (a : Fin p → EuclideanSpace ℝ (Fin n)) (b : Fin p → ℝ)
    (lam : Fin mm → ℝ) (hlam : ∀ i, 0 ≤ lam i) (nu : Fin p → ℝ)
    (x : EuclideanSpace ℝ (Fin n)) (hx : x ∈ feasibleSet fc a b) :
    dualFunction f₀ fc a b lam nu ≤ (f₀ x : EReal) := by
  sorry
Source
Boyd & Vandenberghe 2004, Convex Optimization, Cambridge University Press (seventh printing with corrections, 2009), https://web.stanford.edu/~boyd/cvxbook/, pp. 225, §5.2.2 eq. (5.2) (weak duality)

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