Proposition 4 — ε-Greedy regret
ProvedFoundationsRL.Bandits.epsilon_greedy_regret_bound(Proposition 4, p. 24.) Assume the mean reward function satisfies for every , and fix a horizon and failure probability . The ε-Greedy algorithm (Eq. (2.6)) plays, at each round , the empirical maximizer with probability and a uniformly random decision with probability , for set to the value
that balances the exploration/exploitation trade-off in the proof (Eq. (2.14)). Conditional on the estimation event of Eq. (2.9) — that with probability at least the empirical mean is within of at every round — the algorithm's regret satisfies
This is the chapter's first regret bound and motivates the search for a better exploration strategy: it establishes sublinear regret but at a worse rate than the -rate UCB (Proposition 5) later attains.
Formalization Note. The "with probability " clause of the book's proposition is formalized as the deterministic consequence of the estimation event of Eq. (2.9) holding — precisely how the book's own proof proceeds ("we will show that the event ... occurs ... with probability at least ", then reasons deterministically conditional on it). The underlying high-probability claim (built from Hoeffding's and Bernstein's inequalities, Lemma 33/Lemma 5 of the book's appendix) is outside this chapter and is not itself a milestone here.
import Mathlib import Definitions.Def_FoundationsRL_Bandits_regret
namespace FoundationsRL.Bandits
/-- Proposition 4 (ε-Greedy regret), Foster–Rakhlin p. 24. Assume `fStar π ∈ [0,1]`
for every decision `π`. Conditional on the estimation event of Eq. (2.9) — that at
every round `t ≤ T` the empirical mean concentrates around `fStar` at the rate the
ε-fraction of uniform exploration buys — and with `ε` set to the value (Eq. (2.14))
that balances the two terms of the regret decomposition, the ε-Greedy algorithm's
regret satisfies `Reg ≲ A^{1/3} T^{2/3} log^{1/3}(AT/δ)`. The constant `C` is
universal: fixed once, before every instance parameter, matching the book's `≲`. -/
theorem epsilon_greedy_regret_bound :
∃ C : ℝ, 0 < C ∧
∀ (A : ℕ), 0 < A → ∀ (fStar : Fin A → ℝ),
(∀ a : Fin A, fStar a ∈ Set.Icc (0 : ℝ) 1) →
∀ (piStar : Fin A), (∀ a : Fin A, fStar a ≤ fStar piStar) →
∀ (T : ℕ), 0 < T → ∀ (δ : ℝ), 0 < δ → δ < 1 →
∀ (ε : ℝ), ε = ((A : ℝ) * Real.log ((A : ℝ) * T / δ) / T) ^ ((1 : ℝ) / 3) →
∀ (piHat : ℕ → Fin A) (p : ℕ → Fin A → ℝ),
-- Eq. (2.6): ε-Greedy plays the empirical maximizer with probability `1 - ε`
-- and a uniform random decision with probability `ε`.
(∀ t : ℕ, ∀ a : Fin A,
p t a = (1 - ε) * (if a = piHat t then (1 : ℝ) else 0) + ε * (1 / A)) →
∀ (fhat : ℕ → Fin A → ℝ),
(∀ t : ℕ, ∀ a : Fin A, fhat t a ≤ fhat t (piHat t)) →
-- Eq. (2.9): the good event, holding with probability at least `1 - δ`.
(∀ t ∈ Finset.range T, ∀ a : Fin A,
|fhat t a - fStar a| ≤ Real.sqrt ((A : ℝ) * Real.log ((A : ℝ) * T / δ) / (ε * (t + 1)))) →
regret fStar piStar T p ≤
C * (A : ℝ) ^ ((1 : ℝ) / 3) * (T : ℝ) ^ ((2 : ℝ) / 3) *
(Real.log ((A : ℝ) * T / δ)) ^ ((1 : ℝ) / 3) := by sorry
end FoundationsRL.Bandits
Read-back
What the Lean code literally says, in plain math · claude-fable-5-1
Let be a real number whose existence is the outermost claim: the statement asserts that there is a single positive real constant such that all of the following holds for every choice of the remaining parameters.
Parameters and hypotheses (all universally quantified after is fixed):
- is a natural number with ; decisions are the elements of .
- is a function with (closed interval, both endpoints allowed) for every decision .
- is a decision such that for every decision ; i.e. is some maximizer of (not required to be unique).
- is a natural number with .
- is a real number with .
- is a real number constrained by the equation
where and are read as reals, is the natural logarithm, and the exponent is a real power. (Since , and , the argument exceeds , so the logarithm is a genuine positive number and . Nothing in the statement requires ; for parameter values making one has .)
- is an arbitrary sequence of decisions indexed by all natural numbers (not only ); it is not required to be computed from anything.
- is a real-valued function constrained, for every and every decision , by
This is the only condition on . It is not separately required that be a probability distribution; in particular, if then can be negative.
- is an arbitrary real-valued function such that, for every and every decision , ; i.e. is a maximizer of for every . No other link between , , , or any data is imposed; there is no probability space, no sampling, and no randomness anywhere in the statement.
- "Good event" hypothesis: for every and every decision ,
Here and , so the radicand is positive and the square root is the ordinary one. This is assumed outright as a hypothesis; the statement contains no claim that it holds with any probability.
Conclusion: under all of the above,
with , cast to reals and all exponents real powers.
About : the quantity is a real number produced by a definition named regret imported from the bundle's definition file Def_FoundationsRL_Bandits_regret, whose body is not part of the code supplied here. From this declaration alone one can only see its inputs: the reward function , the comparator decision , the horizon , and the whole sequence of weight functions (indexed by all of , though presumably only matter — this cannot be verified from the given code). Whatever that definition computes — whether it involves summed over , or something else, and whether it uses as weights or as a distribution — is exactly what is bounded; the auditor should consult that definition, since the statement's meaning depends entirely on it. Note that and enter the conclusion only through (via the formula for ).
Degenerate cases silently included: the hypotheses are simultaneously satisfiable (e.g. take and any maximizer of ), so the theorem is not vacuous. is allowed, in which case for all . is allowed, in which case the good event is imposed only at . The constant is chosen once, before , so it may depend on nothing.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.