Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Theorem 21.11: for T > 2 log d and η = √(2 log(d)/T), Weighted-Majority pays ∑ₜ⟨w⁽ᵗ⁾, vₜ⟩ ≤ minᵢ ∑ₜ vₜ,ᵢ + √(2 log(d) T)

Proved
UnderstandingML.weighted_majority_regret

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

prediction-with-expert-adviceregretweighted-majority

Theorem 21.11. Assuming that T>2log⁡(d)T > 2\log(d)T>2log(d), the Weighted-Majority algorithm enjoys the bound

∑t=1T⟨w(t),vt⟩−min⁡i∈[d]∑t=1Tvt,i≤2log⁡(d) T.\sum_{t=1}^T \langle w^{(t)}, v_t\rangle - \min_{i \in [d]}\sum_{t=1}^T v_{t,i} \le \sqrt{2\log(d)\,T}.t=1∑T​⟨w(t),vt​⟩−i∈[d]min​t=1∑T​vt,i​≤2log(d)T​.

Formally: d≥1d \ge 1d≥1 experts, costs vt∈[0,1]dv_t \in [0,1]^dvt​∈[0,1]d, η=2log⁡(d)/T\eta = \sqrt{2\log(d)/T}η=2log(d)/T​, rounds indexed from 000, and wi(t)∝exp⁡(−η∑s<tvs,i)w^{(t)}_i \propto \exp(-\eta\sum_{s<t}v_{s,i})wi(t)​∝exp(−η∑s<t​vs,i​) (the unrolled update rule).

Preamble
import Definitions.Def_UnderstandingML_Online

open MeasureTheory
open scoped InnerProductSpace
Formal statement
namespace UnderstandingML

/-- **Theorem 21.11** (p. 296). Assuming that `T > 2 log(d)`, the Weighted-Majority algorithm
with `η = √(2 log(d)/T)` enjoys the bound
`∑_{t=1}^T ⟨w⁽ᵗ⁾, vₜ⟩ − min_{i ∈ [d]} ∑_{t=1}^T v_{t,i} ≤ √(2 log(d) T)`,
for every sequence of cost vectors `vₜ ∈ [0,1]^d`. Rounds indexed from `0`; `d ≥ 1`. -/
theorem weighted_majority_regret (d : ℕ) (hd : 0 < d) (T : ℕ) (hT : 2 * Real.log d < T)
    (v : ℕ → Fin d → ℝ) (hv : ∀ t i, v t i ∈ Set.Icc (0 : ℝ) 1) :
    ∑ t ∈ Finset.range T, ∑ i, wmWeights (Real.sqrt (2 * Real.log d / T)) v t i * v t i -
      ⨅ i, ∑ t ∈ Finset.range T, v t i ≤ Real.sqrt (2 * Real.log d * T) := 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, §21.2.1 p. 296, Theorem 21.11
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