Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§5, p. 188 — the online loss of round t is unbiased for the risk of w_t

Proved
OnlineLearningOCO.OnlineToBatch.round_identity

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

online-learningonline-to-batchp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1stochastic-learning

Let ψ0,…,ψT−1\psi_0,\dots,\psi_{T-1}ψ0​,…,ψT−1​ be independent examples, each with law QQQ, let ccc be an admissible cost on S×ΨS\times\PsiS×Ψ with risk C(w)=Eψ∼Q[c(w,ψ)]C(w) = \mathbb E_{\psi\sim Q}[c(w,\psi)]C(w)=Eψ∼Q​[c(w,ψ)], and let wt=At(ψ0,…,ψt−1)∈Sw_t = A_t(\psi_0,\dots,\psi_{t-1}) \in Swt​=At​(ψ0​,…,ψt−1​)∈S be the prediction of an online learner in round ttt. Then for every round ttt,

E[c(wt,ψt)]=E[C(wt)].\mathbb E\big[c(w_t,\psi_t)\big] = \mathbb E\big[C(w_t)\big].E[c(wt​,ψt​)]=E[C(wt​)].

This is the step of the proof of Theorem 5.1 where the non-anticipation of the online algorithm enters: wtw_twt​ is a function of the earlier examples only, and ψt\psi_tψt​ is a fresh draw from QQQ.

Formalization Note Rounds are numbered from 000. No integrability of c(wt,ψt)c(w_t,\psi_t)c(wt​,ψt​) is assumed; both sides are Bochner integrals of nonnegative functions.

Preamble
import Mathlib
import Definitions.Def_OnlineLearningOCO_OnlineToBatch_Setting

open MeasureTheory
Formal statement
namespace OnlineLearningOCO.OnlineToBatch

/-- Shalev-Shwartz, FnT ML 4(2) (2011), §5, proof of Theorem 5.1, display after (5.2), p. 188.
Let `ψ₀, …, ψ_{T-1}` be i.i.d. with law `Q`, and let `w_t` be the prediction of a
non-anticipating online algorithm in round `t` of the online-to-batch conversion. Then
`𝔼[c(w_t, ψ_t)] = 𝔼[C(w_t)]`. -/
theorem round_identity {d : ℕ} {Ψ : Type*} [MeasurableSpace Ψ] (S : Set (EuclideanSpace ℝ (Fin d)))
    (Q : Measure Ψ) [IsProbabilityMeasure Q] (c : EuclideanSpace ℝ (Fin d) → Ψ → ℝ)
    (hc : IsCost S Q c) (A : (t : ℕ) → (Fin t → Ψ) → EuclideanSpace ℝ (Fin d))
    (hA : IsOnlineLearner S A)
    {T : ℕ} (t : Fin T) :
    ∫ ψ, c (iterate A ψ t) (ψ t) ∂(sampleLaw Q T) =
      ∫ ψ, risk Q c (iterate A ψ t) ∂(sampleLaw Q T) := by sorry

end OnlineLearningOCO.OnlineToBatch
Source
Shalev-Shwartz, Online Learning and Online Convex Optimization, Found. Trends Mach. Learn. 4(2) (2011) 107–194, p. 188, §5, proof of Theorem 5.1, display after (5.2)
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