Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§5, p. 189 — the average loss of a fixed hypothesis is unbiased for its risk

Proved
OnlineLearningOCO.OnlineToBatch.comparator_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 T≥1T\ge1T≥1, let ψ0,…,ψT−1\psi_0,\dots,\psi_{T-1}ψ0​,…,ψT−1​ be independent examples, each with law QQQ, and let ccc be an admissible cost on S×ΨS\times\PsiS×Ψ with risk CCC. For every fixed u∈Su\in Su∈S,

E[1T∑tc(u,ψt)]=C(u).\mathbb E\Big[\frac1T\sum_{t} c(u,\psi_t)\Big] = C(u).E[T1​t∑​c(u,ψt​)]=C(u).

This identity turns the comparator term of the regret into the risk of the comparator; it is the step from Theorem 5.1 to Corollary 5.2.

Formalization Note Rounds are numbered 0,…,T−10,\dots,T-10,…,T−1. "uuu any vector" is read as u∈Su\in Su∈S, where c(u,⋅)c(u,\cdot)c(u,⋅) is defined.

Preamble
import Mathlib
import Definitions.Def_OnlineLearningOCO_OnlineToBatch_Setting

open MeasureTheory
Formal statement
namespace OnlineLearningOCO.OnlineToBatch

/-- Shalev-Shwartz, FnT ML 4(2) (2011), §5, p. 189, the line before Corollary 5.2:
for a fixed hypothesis `u ∈ S` and an i.i.d. sample `ψ₀, …, ψ_{T-1}` with law `Q`,
`𝔼[(1/T) ∑_t c(u, ψ_t)] = C(u)`. -/
theorem comparator_identity {d : ℕ} {Ψ : Type*} [MeasurableSpace Ψ]
    (S : Set (EuclideanSpace ℝ (Fin d)))
    (Q : Measure Ψ) [IsProbabilityMeasure Q] (c : EuclideanSpace ℝ (Fin d) → Ψ → ℝ)
    (hc : IsCost S Q c) (T : ℕ) (hT : 0 < T) (u : EuclideanSpace ℝ (Fin d)) (hu : u ∈ S) :
    ∫ ψ, (1 / (T : ℝ)) * ∑ t : Fin T, c u (ψ t) ∂(sampleLaw Q T) = risk Q c u := by sorry

end OnlineLearningOCO.OnlineToBatch
Source
Shalev-Shwartz, Online Learning and Online Convex Optimization, Found. Trends Mach. Learn. 4(2) (2011) 107–194, p. 189, §5, the sentence before Corollary 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