AFTD Auto-Formalizing Theoretical Domains

hedgeLoss_nonneg

theoremverifiedimported Lean

Nonnegativity of Hedge's expected loss. Let $\ell$ be a valid loss sequence for $N \ge 1$ experts over $T$ rounds, fix any learning rate $\eta \in \bbr$, and let $t$ be one of the rounds. Then the learner's expected loss $\widehat{\ell}_t = \sum_{i=1}^{N} p_t(i)\,\ell_t(i)$ under the Hedge distribution is nonnegative, $\widehat{\ell}_t \ge 0$.

Statement

set_option relaxedAutoImplicit false in
set_option autoImplicit false in
open Real Finset BigOperators in
lemma hedgeLoss_nonneg {N T : ℕ} [NeZero N] (η : ℝ) (ℓ : LossSeq N T) (hℓ : ℓ.Valid)
    (t : Fin T) : 0 ≤ hedgeLoss η ℓ t
Source
TCSlib, `hedgeLoss_nonneg`
Lean proof
By Karim Abdel Sadek, Mark Bedaywi, from github.com/Shilun-Allan-Li/tcslib at c8a02591b1e5 (Copyright (c) 2026 Karim Abdel Sadek and Mark Bedaywi. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.25.0.
Verified
07 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 4
  • LossSeq.ValidA loss sequence $\ell$ is valid if all individual losses are in $[0,1]$: $\forall t\,i,\; 0 \le \ell_t(i) \le 1$.
  • hedgeLossThe expected loss of the learner at round $t$ under the Hedge distribution is…
  • hedgeDist_nonnegNonnegativity of the Hedge distribution. Fix $N \ge 1$ experts and $T$ rounds, a learning rate $\eta \in \bbr$, and a loss sequence…
  • LossSeqA loss sequence $\ell$ for $N$ experts over $T$ rounds is a function $\ell : \mathrm{Fin}\,T \to \mathrm{Fin}\,N \to \mathbb{R}$,…
Used by 2
  • log_potential_step_tightTight per-step logarithmic potential bound for Hedge. Fix $N \ge 1$ experts and a learning rate $\eta > 0$, and let $\ell$ be a valid loss…
  • hedge_regret_boundRegret bound for the Hedge algorithm. Fix $N \ge 1$ experts and $T$ rounds, and let $\ell$ be a valid loss sequence, so that…

Lean source view module on GitHub

set_option relaxedAutoImplicit false inset_option autoImplicit false inopen Real Finset BigOperators in/-- For a valid loss sequence, Hedge's expected loss at each round is nonnegative. -/lemma hedgeLoss_nonneg {N T : ℕ} [NeZero N] (η : ℝ) (ℓ : LossSeq N T) (hℓ : ℓ.Valid)    (t : Fin T) : 0 ≤ hedgeLoss η ℓ t := by  -- A convex combination of nonnegative losses is nonnegative.  apply Finset.sum_nonneg  intro i _  exact mul_nonneg (hedgeDist_nonneg η ℓ t.val i) (hℓ t i).1
See it in the graphDiscuss this resultChallenge it