Lean module · Foundations
BanditRLProof.Core
This file keeps the first project layer dependency-light. It provides a small executable language for finite action traces, pull counts, reward sums, and finite-arm mean models. Strong probabilistic statements can later import Mathlib or external libraries without changing this public surface.
Module map
Imports
No project-local imports.
Imported by
BanditRLProof, BanditRLProof.Algorithms.ETCMeasurability, BanditRLProof.Algorithms.ETCTrace, BanditRLProof.FiniteBanditModelInvariants, BanditRLProof.IndependenceFoundation, BanditRLProof.MeasureFoundation, BanditRLProof.Regret
Declarations
Open an item to read its exact compact statement and source link. Detailed teaching notes are linked when registered.
abbrev
BanditRLProof.ActionTrace
Compiled
A sequence of actions chosen by a bandit algorithm.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.ActionTraceReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
abbrev ActionTrace (Action : Type u)
abbrev
BanditRLProof.RewardTrace
Compiled
A sequence of observed rewards.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.RewardTraceReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
abbrev RewardTrace (Reward : Type v)
def
BanditRLProof.pullCount
Compiled
Number of pulls of action `a` before time `t`.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.pullCountReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
def pullCount [DecidableEq Action] (action : ActionTrace Action) (a : Action) : Nat → Nat | 0 => 0 | t + 1 => pullCount action a t + if action t = a then 1 else 0 @[simp] theorem pullCount_zero [DecidableEq Action] (action : ActionTrace Action) (a : Action) : pullCount action a 0 = 0
theorem
BanditRLProof.pullCount_zero
Compiled
No declaration docstring is present; use the chapter context and exact statement below.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.pullCount_zeroReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
@[simp] theorem pullCount_zero [DecidableEq Action] (action : ActionTrace Action) (a : Action) : pullCount action a 0 = 0
theorem
BanditRLProof.pullCount_succ
Compiled
No declaration docstring is present; use the chapter context and exact statement below.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.pullCount_succReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
@[simp] theorem pullCount_succ [DecidableEq Action] (action : ActionTrace Action) (a : Action) (t : Nat) : pullCount action a (t + 1) = pullCount action a t + if action t = a then 1 else 0
def
BanditRLProof.sumRewards
Compiled
Sum of rewards obtained from action `a` before time `t`.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.sumRewardsReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
def sumRewards [DecidableEq Action] [OfNat Reward 0] [HAdd Reward Reward Reward] (action : ActionTrace Action) (reward : RewardTrace Reward) (a : Action) : Nat → Reward | 0 => 0 | t + 1 => sumRewards action reward a t + if action t = a then reward t else 0 @[simp] theorem sumRewards_zero [DecidableEq Action] [OfNat Reward 0] [HAdd Reward Reward Reward] (action : ActionTrace Action) (reward : RewardTrace Reward) (a : Action) : sumRewards action reward a 0 = 0
theorem
BanditRLProof.sumRewards_zero
Compiled
No declaration docstring is present; use the chapter context and exact statement below.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.sumRewards_zeroReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
@[simp] theorem sumRewards_zero [DecidableEq Action] [OfNat Reward 0] [HAdd Reward Reward Reward] (action : ActionTrace Action) (reward : RewardTrace Reward) (a : Action) : sumRewards action reward a 0 = 0
theorem
BanditRLProof.sumRewards_succ
Compiled
No declaration docstring is present; use the chapter context and exact statement below.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.sumRewards_succReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
@[simp] theorem sumRewards_succ [DecidableEq Action] [OfNat Reward 0] [HAdd Reward Reward Reward] (action : ActionTrace Action) (reward : RewardTrace Reward) (a : Action) (t : Nat) : sumRewards action reward a (t + 1) = sumRewards action reward a t + if action t = a then reward t else 0
structure
BanditRLProof.FiniteBanditModel
Compiled
A finite stochastic bandit model represented by the mean reward of each arm.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.FiniteBanditModelReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
structure FiniteBanditModel (K : Nat) where
def
BanditRLProof.FiniteBanditModel.bestArm
Compiled
A computable argmax-style selector for the best arm.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.FiniteBanditModel.bestArmReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
noncomputable def bestArm (model : FiniteBanditModel K) : Fin K
def
BanditRLProof.FiniteBanditModel.bestMean
Compiled
The mean reward of `bestArm`.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.FiniteBanditModel.bestMeanReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
noncomputable def bestMean (model : FiniteBanditModel K) : Rat
def
BanditRLProof.FiniteBanditModel.gap
Compiled
The gap of an arm relative to the selected best arm.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.FiniteBanditModel.gapReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
noncomputable def gap (model : FiniteBanditModel K) (arm : Fin K) : Rat
theorem
BanditRLProof.FiniteBanditModel.gap_bestArm
Compiled
No declaration docstring is present; use the chapter context and exact statement below.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.FiniteBanditModel.gap_bestArmReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
@[simp] theorem gap_bestArm (model : FiniteBanditModel K) : model.gap model.bestArm = 0
structure
BanditRLProof.PolicySketch
Compiled
A named policy surface that agents can map to a concrete Lean definition.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.PolicySketchReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
structure PolicySketch (K : Nat) where
inductive
BanditRLProof.CertificateStatus
Compiled
Status of a theorem or candidate in the harness memory.
Used in these reading views: Bandit Book
1. Finite bandits, traces, and regret
Canonical node identity
declaration:BanditRLProof.CertificateStatusReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
inductive CertificateStatus where