Bandits.ETC.regret_le
Regret bound for the ETC algorithm.
-
Ω : Type u_1mΩ : MeasurableSpace ΩA measurable space is a space equipped with a σ-algebra.
-
K : ℕNonempty (Fin K) -
m : ℕ -
ν : ProbabilityTheory.Kernel (Fin K) ℝA kernel from a measurable spaceαto another measurable spaceβis a measurable functionκ : α → Measure β.ProbabilityTheory.IsMarkovKernel νA kernel is a Markov kernel if every measure in its image is a probability measure. -
P : MeasureTheory.Measure ΩA measure is defined to be an outer measure that is countably additive on measurable sets, with the additional assumption that the outer measure is the canonical extension of the restricted measure.MeasureTheory.IsProbabilityMeasure PA measureμis called a probability measure ifμ univ = 1. -
A : ℕ → Ω → Fin K -
R : ℕ → Ω → ℝ -
σ2 : NNReal -
n : ℕ
-
hK : 0 < Kimplicit -
h : Learning.IsAlgEnvSeq A R (etcAlgorithm hK m) (Learning.stationaryEnv ν) PAn algorithm-environment sequence: a sequence of actions and feedbacks generated by an algorithm interacting with an environment. -
hν : ∀ (a : Fin K), ProbabilityTheory.HasSubgaussianMGF (fun x => x - ∫ (x : ℝ), id x ∂ν a) σ2 (ν a)A random variableXhas a sub-Gaussian moment-generating function with parametercwith respect to a measureμif for allt : ℝ,exp (t * X)isμ-integrable and the moment-generating funct… -
hm : m ≠ 0 -
hn : K * m ≤ n
∫ (x : Ω), regret ν A n x ∂P ≤ ∑ a, gap ν a * (↑m + (↑n - ↑K * ↑m) * Real.exp (-↑m * gap ν a ^ 2 / (4 * ↑σ2)))MeasurableSpace : Type u_6 → Type u_6A measurable space is a space equipped with a σ-algebra.
Nonempty : Sort u → Prop`Nonempty α` is a typeclass that says that `α` is not an empty type, that is, there exists an element in the type. It differs from `Inhabited α` in that `Nonempty α` is a `Prop`, which means that it does not actually carry an element of `α`, only a proof that *there exists* such an element. Given `Nonempty α`, you can construct an element of `α` *nonconstructively* using `Classical.choice`.
Fin : ℕ → TypeNatural numbers less than some upper bound. In particular, a `Fin n` is a natural number `i` with the constraint that `i < n`. It is the canonical type with `n` elements.
Nat : TypeThe natural numbers, starting at zero. This type is special-cased by both the kernel and the compiler, and overridden with an efficient implementation. Both use a fast arbitrary-precision arithmetic library (usually [GMP](https://gmplib.org/)); at runtime, `Nat` values that are sufficiently small are unboxed.
ProbabilityTheory.IsMarkovKernel : {α : Type u_1} →
{β : Type u_2} → {mα : MeasurableSpace α} → {mβ : MeasurableSpace β} → ProbabilityTheory.Kernel α β → PropA kernel is a Markov kernel if every measure in its image is a probability measure.
ProbabilityTheory.Kernel : (α : Type u_1) → (β : Type u_2) → [MeasurableSpace α] → [MeasurableSpace β] → Type (max u_1 u_2)A kernel from a measurable space `α` to another measurable space `β` is a measurable function `κ : α → Measure β`. The measurable space structure on `MeasureTheory.Measure β` is given by `MeasureTheory.Measure.instMeasurableSpace`. A map `κ : α → MeasureTheory.Measure β` is measurable iff `∀ s : Set β, MeasurableSet s → Measurable (fun a ↦ κ a s)`.
Real : TypeThe type `ℝ` of real numbers constructed as equivalence classes of Cauchy sequences of rational numbers.
MeasureTheory.IsProbabilityMeasure : {α : Type u_1} → {m0 : MeasurableSpace α} → MeasureTheory.Measure α → PropA measure `μ` is called a probability measure if `μ univ = 1`.
MeasureTheory.Measure : (α : Type u_5) → [MeasurableSpace α] → Type u_5A measure is defined to be an outer measure that is countably additive on measurable sets, with the additional assumption that the outer measure is the canonical extension of the restricted measure. The measure of a set `s`, denoted `μ s`, is an extended nonnegative real. The real-valued version is written `μ.real s`.
NNReal : TypeNonnegative real numbers, denoted as `ℝ≥0` within the NNReal namespace
LT.lt : {α : Type u} → [self : LT α] → α → α → PropThe less-than relation: `x < y` Conventions for notations in identifiers: * The recommended spelling of `<` in identifiers is `lt`.
Learning.IsAlgEnvSeq : {𝓐 : Type u_1} →
{𝓨 : Type u_2} →
{Ω : Type u_3} →
{m𝓐 : MeasurableSpace 𝓐} →
{m𝓨 : MeasurableSpace 𝓨} →
{mΩ : MeasurableSpace Ω} →
(ℕ → Ω → 𝓐) →
(ℕ → Ω → 𝓨) →
Learning.Algorithm 𝓐 𝓨 →
Learning.Environment 𝓐 𝓨 → (P : MeasureTheory.Measure Ω) → [MeasureTheory.IsFiniteMeasure P] → PropAn algorithm-environment sequence: a sequence of actions and feedbacks generated by an algorithm interacting with an environment.Go to its page
Bandits.etcAlgorithm : {K : ℕ} → 0 < K → ℕ → Learning.Algorithm (Fin K) ℝThe Explore-Then-Commit algorithm: deterministic algorithm that chooses the next arm according to `ETC.nextArm`.Go to its page
Learning.stationaryEnv : {𝓐 : Type u_1} →
{𝓨 : Type u_2} →
{m𝓐 : MeasurableSpace 𝓐} →
{m𝓨 : MeasurableSpace 𝓨} →
(ν : ProbabilityTheory.Kernel 𝓐 𝓨) → [ProbabilityTheory.IsMarkovKernel ν] → Learning.Environment 𝓐 𝓨A stationary environment, in which the distribution of the next feedback depends only on the last action.Go to its page
ProbabilityTheory.HasSubgaussianMGF : {Ω : Type u_1} →
{mΩ : MeasurableSpace Ω} →
(Ω → ℝ) → NNReal → autoParam (MeasureTheory.Measure Ω) ProbabilityTheory.HasSubgaussianMGF._auto_1 → PropA random variable `X` has a sub-Gaussian moment-generating function with parameter `c` with respect to a measure `μ` if for all `t : ℝ`, `exp (t * X)` is `μ`-integrable and the moment-generating function of `X` is bounded by `exp (c * t ^ 2 / 2)` for all `t : ℝ`. This implies in particular that `X` has expectation 0. This is equivalent to `Kernel.HasSubgaussianMGF X c (Kernel.const Unit μ) (Measure.dirac ())`, as proved in `HasSubgaussianMGF_iff_kernel`. Properties about sub-Gaussian moment-generating functions should be proved first for `Kernel.HasSubgaussianMGF` when possible.
HSub.hSub : {α : Type u} → {β : Type v} → {γ : outParam (Type w)} → [self : HSub α β γ] → α → β → γ`a - b` computes the difference of `a` and `b`. The meaning of this notation is type-dependent. * For natural numbers, this operator saturates at 0: `a - b = 0` when `a ≤ b`. Conventions for notations in identifiers: * The recommended spelling of `-` in identifiers is `sub` (when used as a binary operator).
MeasureTheory.integral : {α : Type u_6} →
{G : Type u_7} →
[inst : NormedAddCommGroup G] → [NormedSpace ℝ G] → {x : MeasurableSpace α} → MeasureTheory.Measure α → (α → G) → GThe Bochner integral
id : {α : Sort u} → α → αThe identity function. `id` takes an implicit argument `α : Sort u` (a type in any universe), and an argument `a : α`, and returns `a`. Although this may look like a useless function, one application of the identity function is to explicitly put a type on an expression. If `e` has type `T`, and `T'` is definitionally equal to `T`, then `@id T' e` typechecks, and Lean knows that this expression has type `T'` rather than `T`. This can make a difference for typeclass inference, since `T` and `T'` may have different typeclass instances on them. `show T' from e` is sugar for an `@id T' e` expression.
Ne : {α : Sort u} → α → α → Prop`a ≠ b`, or `Ne a b` is defined as `¬ (a = b)` or `a = b → False`, and asserts that `a` and `b` are not equal. Conventions for notations in identifiers: * The recommended spelling of `≠` in identifiers is `ne`.
LE.le : {α : Type u} → [self : LE α] → α → α → PropThe less-equal relation: `x ≤ y` Conventions for notations in identifiers: * The recommended spelling of `≤` in identifiers is `le`.
HMul.hMul : {α : Type u} → {β : Type v} → {γ : outParam (Type w)} → [self : HMul α β γ] → α → β → γ`a * b` computes the product of `a` and `b`. The meaning of this notation is type-dependent. Conventions for notations in identifiers: * The recommended spelling of `*` in identifiers is `mul`.
Bandits.regret : {𝓐 : Type u_1} → {Ω : Type u_2} → {m𝓐 : MeasurableSpace 𝓐} → ProbabilityTheory.Kernel 𝓐 ℝ → (ℕ → Ω → 𝓐) → ℕ → Ω → ℝRegret of a sequence of pulls `k : ℕ → 𝓐` at time `t` for the reward kernel `ν ; Kernel 𝓐 ℝ`.Go to its page
Bandits.gap : {𝓐 : Type u_1} → {m𝓐 : MeasurableSpace 𝓐} → ProbabilityTheory.Kernel 𝓐 ℝ → 𝓐 → ℝGap of an action `a`: difference between the highest mean of the actions and the mean of `a`.Go to its page
HAdd.hAdd : {α : Type u} → {β : Type v} → {γ : outParam (Type w)} → [self : HAdd α β γ] → α → β → γ`a + b` computes the sum of `a` and `b`. The meaning of this notation is type-dependent. Conventions for notations in identifiers: * The recommended spelling of `+` in identifiers is `add`.
Real.exp : ℝ → ℝThe real exponential function, defined as the real part of the complex exponential
Neg.neg : {α : Type u} → [self : Neg α] → α → α`-a` computes the negative or opposite of `a`. The meaning of this notation is type-dependent. Conventions for notations in identifiers: * The recommended spelling of `-` in identifiers is `neg` (when used as a unary operator).
HPow.hPow : {α : Type u} → {β : Type v} → {γ : outParam (Type w)} → [self : HPow α β γ] → α → β → γ`a ^ b` computes `a` to the power of `b`. The meaning of this notation is type-dependent. Conventions for notations in identifiers: * The recommended spelling of `^` in identifiers is `pow`.
HDiv.hDiv : {α : Type u} → {β : Type v} → {γ : outParam (Type w)} → [self : HDiv α β γ] → α → β → γ`a / b` computes the result of dividing `a` by `b`. The meaning of this notation is type-dependent. * For most types like `Nat`, `Int`, `Rat`, `Real`, `a / 0` is defined to be `0`. * For `Nat`, `a / b` rounds downwards. * For `Int`, `a / b` rounds downwards if `b` is positive or upwards if `b` is negative. It is implemented as `Int.ediv`, the unique function satisfying `a % b + b * (a / b) = a` and `0 ≤ a % b < natAbs b` for `b ≠ 0`. Other rounding conventions are available using the functions `Int.fdiv` (floor rounding) and `Int.tdiv` (truncation rounding). * For `Float`, `a / 0` follows the IEEE 754 semantics for division, usually resulting in `inf` or `nan`. Conventions for notations in identifiers: * The recommended spelling of `/` in identifiers is `div`.
Code
theorem regret_le [Nonempty (Fin K)]
(h : IsAlgEnvSeq A R (etcAlgorithm hK m) (stationaryEnv ν) P)
(hν : ∀ a, HasSubgaussianMGF (fun x ↦ x - (ν a)[id]) σ2 (ν a)) (hm : m ≠ 0)
(n : ℕ) (hn : K * m ≤ n) :
P[regret ν A n] ≤
∑ a, gap ν a * (m + (n - K * m) * Real.exp (- (m : ℝ) * gap ν a ^ 2 / (4 * σ2)))Proof
integral_regret_le_of_forall_integral_pullCount_le h
(fun a _ ↦ expectation_pullCount_le h hν a hm hn)Actions: Source · Open Issue
Meaning last changed in v4.34.0-rc2-39-gb743f31 (2026-09-08), the 6th recorded change.
Self-contained, with its dependencies inlined and proofs replaced by sorry: download the raw file · open it in the Lean web editor.
Dependency graph
Audit surface: 18 project declarations, 124 external constants
✓ Proved: no sorry anywhere in its closure
This is the tool's own reading of one build's recorded axioms, and it is not robust against an author who wants it to pass. Checking meant to be relied on should go through Comparator, which replays the proof through the kernel from an export against an explicit list of permitted axioms.