Lemma 1.4 — Randomized Weighted Majority mistake bound
ProvedOnlineConvexOpt.Introduction.randomized_weighted_majority_mistake_boundLemma 1.4 (Randomized Weighted Majority mistake bound, Hazan, p. 11). Let denote the number of mistakes made by RWM until iteration . Then, for any expert and any run of Randomized Weighted Majority with parameter ,
Randomizing the prediction rule (Weighted Majority's deterministic majority vote becomes RWM's sampling proportional to weight) halves both the multiplicative constant, from to , and the additive term, from to , relative to Lemma 1.3.
Formalization Note. ε ∈ (0, 1/2) is again the range under which the book's proof is
valid; is expectedMistakes, the deterministic inner product of RWM's
probability vector with the -mistake indicator (§1.3.3), not a measure-theoretic
expectation over an explicit probability space.
import Mathlib import Definitions.Def_OnlineConvexOpt_Introduction_MistakeCounts import Definitions.Def_OnlineConvexOpt_Introduction_RandomizedWeightedMajority
namespace OnlineConvexOpt.Introduction
/-- **Lemma 1.4** (Randomized Weighted Majority mistake bound), Hazan, *Introduction to
Online Convex Optimization*, 2nd ed., arXiv:1909.05207v3, p. 11.
"Let `M_T` denote the number of mistakes made by RWM until iteration `T`. Then, for any
expert `i ∈ [N]` we have `E[M_T] ≤ (1 + ε) M_T(i) + log N / ε`."
As in Lemma 1.3, `0 < ε < 1/2` is the range under which the book's own proof (the same
logarithm bound, `-x - x² ≤ log(1 - x) ≤ -x` for `0 < x < 1/2`) is valid, matching Theorem
1.2's explicit range for the corollary that packages this lemma. -/
theorem randomized_weighted_majority_mistake_bound {N : ℕ} (hN : 0 < N) (ε : ℝ)
(hε : ε ∈ Set.Ioo (0 : ℝ) (1 / 2))
(expertPredict : ℕ → Fin N → Bool) (outcome : ℕ → Bool) (W p : ℕ → Fin N → ℝ)
(hrun : IsRandomizedWeightedMajorityRun ε expertPredict outcome W p)
(T : ℕ) (i : Fin N) :
expectedMistakes expertPredict outcome p T ≤
(1 + ε) * (expertMistakes expertPredict outcome i T : ℝ) + Real.log N / ε := by sorry
end OnlineConvexOpt.Introduction
Read-back
What the Lean code literally says, in plain math · claude-fable-5-1
Fix a natural number with , a real number with (both inequalities strict; the open interval ), a function (for each time index , starting at , and each expert , a Boolean prediction), a function (a Boolean outcome at each time), and two functions (a real number attached to each time and each expert; nothing in this statement constrains them to be nonnegative, to sum to one, or to be related to each other). Assume the hypothesis
a predicate imported from Def_OnlineConvexOpt_Introduction_RandomizedWeightedMajority whose defining clauses are not part of the code supplied here; the read-back can only record that the statement is conditional on this predicate holding for the tuple , and that if it is unsatisfiable for some or all choices of these data the conclusion below is asserted vacuously for those choices. Let be any natural number (including ) and any index in .
The theorem asserts the real-number inequality
where:
- is a real number produced by a function imported from
Def_OnlineConvexOpt_Introduction_MistakeCounts, depending on the expert predictions, the outcomes, the function (but not on or on ), and the horizon ; its definition is not supplied here, so this read-back cannot state what it computes. - is a natural number produced by a function from the same imported file, depending on the predictions, the outcomes, the single expert , and , and cast into before being multiplied by ; its definition is likewise not supplied.
- is the real natural logarithm of cast to a real; since , this is , and equals when . Division by is ordinary real division, well-defined since .
The conclusion is a non-strict inequality . It is claimed for every horizon and every expert simultaneously, under the single hypothesis above; no assumption is made about or beyond the imported run-predicate, and appears only as an argument to that predicate, not in the conclusion.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.