Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 2.3 — the regret of FoReL is at most R(u) − R(w₁) plus its stability

Proved
OnlineLearningOCO.FoReL.lemma_2_3

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

online-convex-optimizationonline-learningp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1regret

Let SSS be a set, f1,f2,⋯:S→Rf_1, f_2, \dots : S \to \mathbb Rf1​,f2​,⋯:S→R arbitrary loss functions and R:S→RR : S \to \mathbb RR:S→R an arbitrary regularization function, and let w1,w2,…w_1, w_2, \dotsw1​,w2​,… be a run of Follow-the-Regularized-Leader, wt∈argmin⁡w∈S∑i<tfi(w)+R(w)w_t \in \operatorname{argmin}_{w \in S} \sum_{i<t} f_i(w) + R(w)wt​∈argminw∈S​∑i<t​fi​(w)+R(w). Then for every horizon T≥0T \ge 0T≥0 and every u∈Su \in Su∈S,

∑t=1T(ft(wt)−ft(u))≤R(u)−R(w1)+∑t=1T(ft(wt)−ft(wt+1)).\sum_{t=1}^{T} \big(f_t(w_t) - f_t(u)\big) \le R(u) - R(w_1) + \sum_{t=1}^{T} \big(f_t(w_t) - f_t(w_{t+1})\big).t=1∑T​(ft​(wt​)−ft​(u))≤R(u)−R(w1​)+t=1∑T​(ft​(wt​)−ft​(wt+1​)).

The lemma reduces bounding the regret of FoReL to bounding how much consecutive predictions differ in loss; Theorem 2.11 combines it with the stability bound of Lemma 2.10.

Formalization Note No convexity, continuity or structure is assumed: the lemma holds for arbitrary ftf_tft​ and RRR, as on the page. Rounds are 1-based.

Preamble
import Mathlib
import Definitions.Def_OnlineLearningOCO_FoReL_IsFoReLRun
Formal statement
namespace OnlineLearningOCO.FoReL

/-- Lemma 2.3 (Shalev-Shwartz, FnT ML 4(2) (2011), p. 128). Let `w₁, w₂, …` be the sequence
of vectors produced by FoReL. Then for all `u ∈ S`,
`∑_{t=1}^T (f_t(w_t) − f_t(u)) ≤ R(u) − R(w_1) + ∑_{t=1}^T (f_t(w_t) − f_t(w_{t+1}))`.
No convexity or structure is needed: `f` and `R` are arbitrary real functions. -/
theorem lemma_2_3 {E : Type*} (S : Set E) (f : ℕ → E → ℝ) (R : E → ℝ) (w : ℕ → E)
    (hw : IsFoReLRun S f R w) (T : ℕ) :
    ∀ u ∈ S,
      ∑ t ∈ Finset.Icc 1 T, (f t (w t) - f t u)
        ≤ R u - R (w 1) + ∑ t ∈ Finset.Icc 1 T, (f t (w t) - f t (w (t + 1))) := by sorry

end OnlineLearningOCO.FoReL
Source
Shalev-Shwartz, Online Learning and Online Convex Optimization, Found. Trends Mach. Learn. 4(2) (2011) 107–194, p. 128, Lemma 2.3
Human review
  • Endorsed by Shuze Chen · Oct 7, 2026

    Confirmed by the moderator at approval.

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