Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Corollary 14.14: for a convex-smooth-bounded problem (β, B) with ℓ(0,z) ≤ 1 and ε > 0, SGD with η = 1/(β(1 + 3/ε)) and T ≥ 12B²β/ε² has E[L_D(w̄)] ≤ min_{w∈H} L_D(w) + ε

Proved
UnderstandingML.sgd_learns_convex_smooth

by naimengye · Sep 24, 2026 · Mathlib 0df444a (Lean v4.33.1)

convex-learninglearnabilitysmoothnessstochastic-gradient-descent

Corollary 14.14. Consider a convex-smooth-bounded learning problem with parameters β,B\beta, Bβ,B. Assume in addition that ℓ(0,z)≤1\ell(0, z) \le 1ℓ(0,z)≤1 for all z∈Zz \in Zz∈Z. For every ϵ>0\epsilon > 0ϵ>0, set η=1β(1+3/ϵ)\eta = \frac{1}{\beta(1 + 3/\epsilon)}η=β(1+3/ϵ)1​. Then running SGD with T≥12B2β/ϵ2T \ge 12B^2\beta/\epsilon^2T≥12B2β/ϵ2 yields E[LD(wˉ)]≤min⁡w∈HLD(w)+ϵ\mathbb{E}[L_D(\bar w)] \le \min_{w \in H} L_D(w) + \epsilonE[LD​(wˉ)]≤minw∈H​LD​(w)+ϵ.

Formally, as printed: every ϵ>0\epsilon > 0ϵ>0, with no assumption that 0∈H0 \in H0∈H. By Theorem 14.13 with ηβ=ϵ/(ϵ+3)\eta\beta = \epsilon/(\epsilon + 3)ηβ=ϵ/(ϵ+3), for every w⋆w^\starw⋆ one has E[LD(wˉ)]≤(1+ϵ/3)(LD(w⋆)+∥w⋆∥2β(1+3/ϵ)/(2T))\mathbb{E}[L_D(\bar w)] \le (1 + \epsilon/3)(L_D(w^\star) + \|w^\star\|^2\beta(1 + 3/\epsilon)/(2T))E[LD​(wˉ)]≤(1+ϵ/3)(LD​(w⋆)+∥w⋆∥2β(1+3/ϵ)/(2T)). Taking w⋆=0w^\star = 0w⋆=0 gives E[LD(wˉ)]≤1+ϵ/3\mathbb{E}[L_D(\bar w)] \le 1 + \epsilon/3E[LD​(wˉ)]≤1+ϵ/3, which is at most LD(w)+ϵL_D(w) + \epsilonLD​(w)+ϵ whenever LD(w)>1L_D(w) > 1LD​(w)>1 or ϵ≥3/2\epsilon \ge 3/2ϵ≥3/2. Taking w⋆=w∈Hw^\star = w \in Hw⋆=w∈H gives LD(w)+(ϵ/3)LD(w)+(1+ϵ/3)(ϵ2+3ϵ)/24L_D(w) + (\epsilon/3)L_D(w) + (1 + \epsilon/3)(\epsilon^2 + 3\epsilon)/24LD​(w)+(ϵ/3)LD​(w)+(1+ϵ/3)(ϵ2+3ϵ)/24, which is at most LD(w)+ϵL_D(w) + \epsilonLD​(w)+ϵ when LD(w)≤1L_D(w) \le 1LD​(w)≤1 and (3+ϵ)2≤48(3 + \epsilon)^2 \le 48(3+ϵ)2≤48, that is ϵ≤3.9\epsilon \le 3.9ϵ≤3.9.

Preamble
import Definitions.Def_UnderstandingML_SGD

open MeasureTheory
open scoped InnerProductSpace
Formal statement
namespace UnderstandingML

/-- **Corollary 14.14** (p. 199). Consider a convex-smooth-bounded learning problem with
parameters `β, B`, and assume in addition that `ℓ(0, z) ≤ 1` for all `z`. For every `ε > 0` set
`η = 1/(β(1 + 3/ε))`. Then running SGD with `T ≥ 12B²β/ε²` yields
`E[L_D(w̄)] ≤ min_{w ∈ H} L_D(w) + ε`. From Theorem 14.13, applied with `w⋆ = w` and with
`w⋆ = 0` (which need not lie in `H`), this holds for every `ε > 0`. -/
theorem sgd_learns_convex_smooth {d : ℕ} {Z : Type*} [MeasurableSpace Z] (H : Set (Vec d))
    (loss : Vec d → Z → ℝ) {β B : ℝ} (hβ : 0 < β) (hB : 0 < B)
    (hprob : ConvexSmoothBounded H loss β B) (h0 : ∀ z, loss 0 z ≤ 1)
    (hmeas : Measurable (Function.uncurry loss))
    (hgrad : Measurable (Function.uncurry fun w z ↦ gradient (fun w ↦ loss w z) w)) {ε : ℝ}
    (hε0 : 0 < ε) (T : ℕ) (hT : 12 * B ^ 2 * β / ε ^ 2 ≤ T) (D : Measure Z)
    [IsProbabilityMeasure D] :
    ∀ w ∈ H, ∫ S, risk loss D
        (sgdAverage (1 / (β * (1 + 3 / ε))) (fun w z ↦ gradient (fun w ↦ loss w z) w) S)
        ∂(iidLaw D T) ≤ risk loss D w + ε := by sorry

end UnderstandingML
Source
Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press 2014, doi:10.1017/CBO9781107298019, §14.5.2 p. 199, Corollary 14.14 (from Theorem 14.13)
Human review
  • Endorsed by Shuze Chen · Sep 25, 2026

    Confirmed by the moderator at approval.

  • Endorsed by naimengye · Sep 25, 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