Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Duality-gap identity P(w(α))−D(α)=1n∑i(φi(w⊤xi)+φi∗(−αi)+αiw⊤xi)P(w(\alpha))-D(\alpha)=\frac1n\sum_i(\varphi_i(w^\top x_i)+\varphi_i^*(-\alpha_i)+\alpha_i w^\top x_i)P(w(α))−D(α)=n1​∑i​(φi​(w⊤xi​)+φi∗​(−αi​)+αi​w⊤xi​)

Proved
SDCA.Smooth.gap_identity

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

coordinate-ascentdualityp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1stochastic-optimization

Let x1,…,xn∈Rdx_1,\dots,x_n\in\mathbb R^dx1​,…,xn​∈Rd with n≥1n\ge1n≥1, let φ1,…,φn:R→R\varphi_1,\dots,\varphi_n:\mathbb R\to\mathbb Rφ1​,…,φn​:R→R be convex, let λ>0\lambda>0λ>0, and let PPP and DDD be the primal and dual objectives of problems (1) and (2). For every dual point α∈Rn\alpha\in\mathbb R^nα∈Rn, with w=w(α)=1λn∑iαixiw=w(\alpha)=\frac{1}{\lambda n}\sum_i\alpha_ix_iw=w(α)=λn1​∑i​αi​xi​,

P(w)−D(α)=1n∑i=1n(φi(w⊤xi)+φi∗(−αi)+αi w⊤xi),P(w)-D(\alpha)=\frac1n\sum_{i=1}^n\Big(\varphi_i(w^\top x_i)+\varphi_i^*(-\alpha_i)+\alpha_i\,w^\top x_i\Big),P(w)−D(α)=n1​i=1∑n​(φi​(w⊤xi​)+φi∗​(−αi​)+αi​w⊤xi​),

as an identity in (−∞,+∞](-\infty,+\infty](−∞,+∞]: both sides are +∞+\infty+∞ exactly when some φi∗(−αi)=+∞\varphi_i^*(-\alpha_i)=+\inftyφi∗​(−αi​)=+∞.

The identity writes the duality gap as an average of nonnegative Fenchel–Young gaps, one per example; taking the expectation of the one-coordinate estimate (10) over the chosen coordinate turns its right-hand side into this gap.

Formalization Note DDD and φi∗\varphi_i^*φi∗​ are EReal-valued; the left side is the coerced real P(w)P(w)P(w) minus D(α)D(\alpha)D(α) in EReal.

Preamble
import Mathlib
import Definitions.Def_SDCA_Smooth_Model
open scoped InnerProductSpace
Formal statement
namespace SDCA.Smooth

/-- §7.1, proof of Lemma 1, p. 13 (Shalev-Shwartz–Zhang, arXiv:1209.1873v2): for every dual point
`α` and `w = w(α)`, the duality gap is
`P(w) − D(α) = (1/n) ∑ᵢ (φᵢ(wᵀxᵢ) + φᵢ*(−αᵢ) + αᵢ wᵀxᵢ)`, as an identity in `EReal`
(both sides are `+∞` exactly when some `φᵢ*(−αᵢ) = +∞`). -/
theorem gap_identity {d n : ℕ} (hn : 0 < n) (x : Fin n → EuclideanSpace ℝ (Fin d))
    (φ : Fin n → ℝ → ℝ) (hconv : ∀ i, ConvexOn ℝ Set.univ (φ i))
    (lam : ℝ) (hlam : 0 < lam) (α : Fin n → ℝ) :
    ((primal lam x φ (wOf lam x α) : ℝ) : EReal) - dual lam x φ α =
      ((1 / (n : ℝ) : ℝ) : EReal) *
        ∑ i, (((φ i ⟪wOf lam x α, x i⟫_ℝ : ℝ) : EReal) + SDCA.Lipschitz.conj (φ i) (-α i) +
          ((α i * ⟪wOf lam x α, x i⟫_ℝ : ℝ) : EReal)) := by sorry

end SDCA.Smooth
Source
Shalev-Shwartz and Zhang, Stochastic Dual Coordinate Ascent Methods for Regularized Loss Minimization, arXiv:1209.1873v2, §7.1, proof of Lemma 1, p. 13 (display after (10))
Human review
  • Endorsed by Shuze Chen · Oct 8, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 8, 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