Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

(1.28) — log-loss increment: ℓlog⁡(f^t(xt),yt)=Φ1t−Φ1t−1\ell_{\log}(\hat f^t(x^t),y^t)=\Phi^t_1-\Phi^{t-1}_1ℓlog​(f^​t(xt),yt)=Φ1t​−Φ1t−1​

Proved
FoundationsRL.OnlineLearning.eq_1_28

by iris · Oct 30, 2026 · Mathlib 0df444a (Lean v4.33.1)

exponential-weightsonline-learningp2o-gran-per-chapterp2o-plan-bookp2o-strengthenedp2o-v1regret

Let F\mathcal FF be a finite class of conditional densities. With η=1\eta=1η=1, the averaged variant of Exponential Weights predicts the mixture f^t(y∣x)=∑f∈Fqt(f)f(y∣x)\hat f^t(y\mid x)=\sum_{f\in\mathcal F}q^t(f)f(y\mid x)f^​t(y∣x)=∑f∈F​qt(f)f(y∣x), and at each round for which qtq^tqt is defined,

ℓlog⁡(f^t(xt),yt)=−log⁡f^t(yt∣xt)=Φ1t−Φ1t−1.\ell_{\log}(\hat f^t(x^t),y^t)=-\log\hat f^t(y^t\mid x^t)=\Phi^t_1-\Phi^{t-1}_1.ℓlog​(f^​t(xt),yt)=−logf^​t(yt∣xt)=Φ1t​−Φ1t−1​.

The loss on each round is exactly the change in potential, which is what makes the log-loss regret telescope.

Formalization Note Values lie in EReal. qtq^tqt is defined when the likelihoods of the past do not all vanish. The new potential may still be +∞+\infty+∞, and then so is the loss.

Differences from the source:

  • generalization: f(·|x) a density on Y → f : X → Y → ℝ any nonnegative function; reason: the argument uses only nonnegativity, and densities are nonnegative functions
  • encoding: ℓ_log = −log f(y|x), exp{−∑ℓ_log} → values in EReal with −log 0 = +∞, and weights written as the likelihood product; reason: a zero density has infinite loss, and exp(−∞) = 0 makes the two weight formulas agree
  • encoding: (1.28) stated without condition → 0 < ∑ f ∈ F, likelihood f x y t; reason: this only says q^t is defined; otherwise (1.27) is 0/0 and the right side is ⊤ − ⊤
  • encoding: rounds t = 1, …, T → 0-based rounds in Finset.range T; reason: Lean convention; same instances
Preamble
import Mathlib
import Definitions.Def_FoundationsRL_OnlineLearning_Losses
import Definitions.Def_FoundationsRL_OnlineLearning_ExponentialWeights
import Definitions.Def_FoundationsRL_OnlineLearning_LogLossWeights
Formal statement
namespace FoundationsRL.OnlineLearning

/-- **(1.28) (the log-loss potential telescopes).** Foster & Rakhlin, Foundations of Reinforcement
Learning and Interactive Decision Making, arXiv:2312.16730v1, (1.28), p. 16.

With `η = 1`, the averaged prediction satisfies `ℓ_log(f̂^t(x^t), y^t) = Φ^t_1 - Φ^{t-1}_1`.

**Formalization Note.** Rounds are 0-based, so the notes' `t` is `t + 1` here. Values are in `EReal`.
The hypothesis `ht` says that `q^t` is defined, that is, its denominator in (1.27) is positive. Without
it the right side would be `⊤ - ⊤`. The new potential may still be `+∞`, in which case so is the loss. -/
theorem eq_1_28 {X Y : Type*} (F : Finset (X → Y → ℝ)) (hF : ∀ f ∈ F, ∀ x y, 0 ≤ f x y)
    (x : ℕ → X) (y : ℕ → Y) (t : ℕ) (ht : 0 < ∑ f ∈ F, likelihood f x y t) :
    logLoss (ewAveraged F (logDist F x y t) (x t)) (y t) =
      logPotential F x y (t + 1) - logPotential F x y t := by sorry

end FoundationsRL.OnlineLearning
Source
Foster & Rakhlin, Foundations of Reinforcement Learning and Interactive Decision Making, arXiv:2312.16730v1, (1.27)–(1.28), p. 16
Human review
  • Endorsed by Shuze Chen · Oct 31, 2026

    Confirmed by the moderator at approval.

  • Endorsed by iris · Oct 31, 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