Theorem 1.5 — Hedge's loss bound
ProvedOnlineConvexOpt.Introduction.hedge_loss_boundTheorem 1.5 (Hedge's loss bound, Hazan, p. 12). Let denote the -dimensional vector of square losses, i.e. , let , and assume all losses are non-negative. The Hedge algorithm satisfies, for any expert ,
This is the chapter's most general guarantee: it drops the binary-mistake restriction of Theorems 1.1–1.4 in favor of arbitrary non-negative real-valued losses, replacing the earlier multiplicative slack with an explicit additive second-moment correction term that vanishes as losses shrink, and leaves free rather than tuned to a particular horizon.
Formalization Note. IsHedgeRun fixes the algorithm's own update rule
() as part of the hypothesis, since the bound
is meaningful only for this specific update; it is not a black-box regret guarantee that holds
for an arbitrary mixed-strategy sequence. ε is kept as a free parameter throughout, matching
the book's presentation (no substitution of a later corollary's optimized
).
import Mathlib import Definitions.Def_OnlineConvexOpt_Introduction_Hedge
namespace OnlineConvexOpt.Introduction
/-- **Theorem 1.5** (Hedge's loss bound), Hazan, *Introduction to Online Convex
Optimization*, 2nd ed., arXiv:1909.05207v3, p. 12.
"Let `ℓ²_t` denote the `N`-dimensional vector of square losses, i.e., `ℓ²_t(i) = ℓ_t(i)²`,
let `ε > 0`, and assume all losses to be non-negative. The Hedge algorithm satisfies for any
expert `i⋆ ∈ [N]`: `∑_{t=1}^T x_t^⊤ ℓ_t ≤ ∑_{t=1}^T ℓ_t(i⋆) + ε ∑_{t=1}^T x_t^⊤ ℓ²_t + log N / ε`." -/
theorem hedge_loss_bound {N : ℕ} (hN : 0 < N) (ε : ℝ) (hε : 0 < ε)
(ℓ x W : ℕ → Fin N → ℝ) (hnonneg : ∀ t i, 0 ≤ ℓ t i)
(hrun : IsHedgeRun ε ℓ W x) (T : ℕ) (istar : Fin N) :
expectedLoss x ℓ T ≤
expertLoss ℓ istar T + ε * expectedLoss x (fun t i => ℓ t i ^ 2) 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 together with the hypothesis , and a real number with . Three functions are given, each taking a natural number and an index to a real number:
- , written ;
- , written ;
- , written .
Note that the time index ranges over all natural numbers starting at , not over a finite horizon, and that is an arbitrary real vector — nothing in the statement itself constrains it to be a probability distribution (any such constraint would have to come from the hypothesis IsHedgeRun below).
The hypotheses are:
- Non-negativity: for every and every , .
- Run predicate: the proposition holds. This predicate is imported from the bundle's definition file
Def_OnlineConvexOpt_Introduction_Hedge, whose code is not part of the declaration shown here; the read-back therefore cannot unfold it. Whatever relation it imposes among , the losses , the weights and the vectors is exactly what this hypothesis asserts, and no more. If that predicate is unsatisfiable for some inputs, the theorem is vacuous for those inputs.
Further fix a natural number (including ) and an index .
The conclusion is the real-number inequality
where:
- and are functions imported from the same definition file, whose bodies are likewise not shown. The read-back can only record their arguments: the first takes the vector sequence , the loss sequence and the horizon ; the second takes the loss sequence , the single index and the horizon . Whether these are sums over , over , or something else, is determined by the imported definitions, not by this statement.
- The middle term applies to the same and horizon , but with the loss sequence replaced by the pointwise square .
- is the real natural logarithm of the real number obtained from ; since is assumed, this is a genuine logarithm (for it equals ). Division by is real division, and so it is not the degenerate division-by-zero case.
The inequality is non-strict (). The statement is universally quantified over every choice of , , , , , and satisfying the hypotheses above; in particular appears only inside the hypothesis and nowhere in the conclusion.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.