Lean module · Thompson sampling
BanditRLProof.Algorithms.ThompsonClippedUCBScore
This module instantiates HistoryActionScore with the clipped upper-confidence score used by the pinned LML Thompson regret proof. The finite-history score is measurable and lies in [l, u]; those bounds discharge every score integrability premise in the compiled Bayesian-regret decomposition.
Module map
Imports
BanditRLProof.Algorithms.ThompsonBayesRegretDecomposition, BanditRLProof.Algorithms.UCBRealHistoryIndex, BanditRLProof.PullCountDecomposition
Imported by
BanditRLProof, BanditRLProof.Algorithms.ThompsonStationaryReward
Declarations
Open an item to read its exact compact statement and source link. Detailed teaching notes are linked when registered.
def
BanditRLProof.Thompson.clippedUCB
Compiled
The clipped UCB score on a complete action/reward trace.
Used in these reading views: Bandit Book
6. Thompson sampling and Bayesian regret
Canonical node identity
declaration:BanditRLProof.Thompson.clippedUCBReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
def clippedUCB {K : Nat} (l u sigma2 delta : Real) (action : ActionTrace (Fin K)) (reward : RewardTrace Real) (arm : Fin K) (t : Nat) : Real
def
BanditRLProof.Thompson.clippedUCBHistory
Compiled
The same clipped score on the inclusive history through time `n`.
Used in these reading views: Bandit Book
6. Thompson sampling and Bayesian regret
Canonical node identity
declaration:BanditRLProof.Thompson.clippedUCBHistoryReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
def clippedUCBHistory {K : Nat} (l u sigma2 delta : Real) (n : Nat) (history : History.FinitePairHistory (Fin K) Real n) (arm : Fin K) : Real
theorem
BanditRLProof.Thompson.clippedUCB_zero
Compiled
No declaration docstring is present; use the chapter context and exact statement below.
Used in these reading views: Bandit Book
6. Thompson sampling and Bayesian regret
Canonical node identity
declaration:BanditRLProof.Thompson.clippedUCB_zeroReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem clippedUCB_zero {K : Nat} (l u sigma2 delta : Real) (action : ActionTrace (Fin K)) (reward : RewardTrace Real) (arm : Fin K) : clippedUCB l u sigma2 delta action reward arm 0 = u
theorem
BanditRLProof.Thompson.clippedUCB_mem_Icc
Compiled
No declaration docstring is present; use the chapter context and exact statement below.
Used in these reading views: Bandit Book
6. Thompson sampling and Bayesian regret
Canonical node identity
declaration:BanditRLProof.Thompson.clippedUCB_mem_IccReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem clippedUCB_mem_Icc {K : Nat} (l u sigma2 delta : Real) (hlu : l <= u) (action : ActionTrace (Fin K)) (reward : RewardTrace Real) (arm : Fin K) (t : Nat) : clippedUCB l u sigma2 delta action reward arm t ∈ Set.Icc l u
theorem
BanditRLProof.Thompson.finset_sum_sqrt_le
Compiled Internal helper
No declaration docstring is present; use the chapter context and exact statement below.
Used in these reading views: Bandit Book
6. Thompson sampling and Bayesian regret
Canonical node identity
declaration:BanditRLProof.Thompson.finset_sum_sqrt_leReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
private theorem finset_sum_sqrt_le {ι : Type*} (s : Finset ι) (c : ι -> Real) (hc : forall i, 0 <= c i) : ∑ i ∈ s, Real.sqrt (c i) <= Real.sqrt (s.card * ∑ i ∈ s, c i)
theorem
BanditRLProof.Thompson.finset_sum_one_div_sqrt_le
Compiled Internal helper
No declaration docstring is present; use the chapter context and exact statement below.
Used in these reading views: Bandit Book
6. Thompson sampling and Bayesian regret
Canonical node identity
declaration:BanditRLProof.Thompson.finset_sum_one_div_sqrt_leReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
private theorem finset_sum_one_div_sqrt_le {n : Nat} (hn : 0 < n) : ∑ k ∈ Finset.range (n + 1), 1 / Real.sqrt k <= 2 * Real.sqrt n - 1
theorem
BanditRLProof.Thompson.sum_clippedUCB_action_sub_mean_le
Compiled
Pathwise selected-action clipped-UCB excess bound from the pinned LML Thompson route. The only hypothesis is that every positive-count empirical mean is strictly below its arm mean plus the confidence width.
Used in these reading views: Bandit Book
6. Thompson sampling and Bayesian regret
Canonical node identity
declaration:BanditRLProof.Thompson.sum_clippedUCB_action_sub_mean_leReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem sum_clippedUCB_action_sub_mean_le {K : Nat} [NeZero K] (action : ActionTrace (Fin K)) (reward : RewardTrace Real) (mean : Fin K -> Real) (l u sigma2 delta : Real) (hmeanMem : forall arm, mean arm ∈ Set.Icc l u) (hlu : l <= u) (hgood : forall s, s < n -> pullCount action (action s) s ≠ 0 -> UCB.realEmpiricalMean action reward (action s) s - mean (action s) < Real.sqrt (2 * sigma2 * Real.log (1 / delta) / (pullCount action (action s) s : Real))) : ∑ s ∈ Finset.range n, (clippedUCB l u sigma2 delta action reward (action s) s - mean (action s)) <= (u - l) * K + 4 * Real.sqrt (2 * sigma2 * Real.log (1 / delta) * K * n)
theorem
BanditRLProof.Thompson.clippedUCBHistory_mem_Icc
Compiled
No declaration docstring is present; use the chapter context and exact statement below.
Used in these reading views: Bandit Book
6. Thompson sampling and Bayesian regret
Canonical node identity
declaration:BanditRLProof.Thompson.clippedUCBHistory_mem_IccReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem clippedUCBHistory_mem_Icc {K : Nat} (l u sigma2 delta : Real) (hlu : l <= u) (n : Nat) (history : History.FinitePairHistory (Fin K) Real n) (arm : Fin K) : clippedUCBHistory l u sigma2 delta n history arm ∈ Set.Icc l u
theorem
BanditRLProof.Thompson.measurable_clippedUCBHistory
Compiled
A fixed-arm clipped score is measurable on inclusive pair histories.
Used in these reading views: Bandit Book
6. Thompson sampling and Bayesian regret
Canonical node identity
declaration:BanditRLProof.Thompson.measurable_clippedUCBHistoryReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem measurable_clippedUCBHistory {K : Nat} (l u sigma2 delta : Real) (n : Nat) (arm : Fin K) : Measurable (fun history : History.FinitePairHistory (Fin K) Real n => clippedUCBHistory l u sigma2 delta n history arm)
theorem
BanditRLProof.Thompson.measurable_uncurry_clippedUCBHistory
Compiled
Joint measurability in the visible history and candidate action.
Used in these reading views: Bandit Book
6. Thompson sampling and Bayesian regret
Canonical node identity
declaration:BanditRLProof.Thompson.measurable_uncurry_clippedUCBHistoryReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem measurable_uncurry_clippedUCBHistory {K : Nat} (l u sigma2 delta : Real) (n : Nat) : Measurable (fun pair : History.FinitePairHistory (Fin K) Real n × Fin K => clippedUCBHistory l u sigma2 delta n pair.1 pair.2)
def
BanditRLProof.Thompson.clippedUCBHistoryScore
Compiled
`HistoryActionScore` instance for the pinned LML clipped-UCB formula.
Used in these reading views: Bandit Book
6. Thompson sampling and Bayesian regret
Canonical node identity
declaration:BanditRLProof.Thompson.clippedUCBHistoryScoreReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
def clippedUCBHistoryScore {K : Nat} (l u sigma2 delta : Real) : HistoryActionScore (Fin K) Real where
theorem
BanditRLProof.Thompson.clippedUCBHistory_finitePairHistoryOfTrace
Compiled
Inclusive finite-history and exclusive trace versions agree at `n + 1`.
Used in these reading views: Bandit Book
6. Thompson sampling and Bayesian regret
Canonical node identity
declaration:BanditRLProof.Thompson.clippedUCBHistory_finitePairHistoryOfTraceReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem clippedUCBHistory_finitePairHistoryOfTrace {K : Nat} (l u sigma2 delta : Real) (action : ActionTrace (Fin K)) (reward : RewardTrace Real) (n : Nat) (arm : Fin K) : clippedUCBHistory l u sigma2 delta n (History.finitePairHistoryOfTrace action reward n) arm = clippedUCB l u sigma2 delta action reward arm (n + 1)
theorem
BanditRLProof.Thompson.clippedUCBHistoryScore_atTrace
Compiled
Evaluating the history score at the selected action recovers `clippedUCB`.
Used in these reading views: Bandit Book
6. Thompson sampling and Bayesian regret
Canonical node identity
declaration:BanditRLProof.Thompson.clippedUCBHistoryScore_atTraceReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem clippedUCBHistoryScore_atTrace {K : Nat} (l u sigma2 delta : Real) (action : ActionTrace (Fin K)) (reward : RewardTrace Real) (t : Nat) : (clippedUCBHistoryScore l u sigma2 delta).atTrace action reward t = clippedUCB l u sigma2 delta action reward (action t) t
theorem
BanditRLProof.Thompson.clippedUCBHistoryScore_atBestTrace
Compiled
Evaluating at a comparison arm recovers the same trace score.
Used in these reading views: Bandit Book
6. Thompson sampling and Bayesian regret
Canonical node identity
declaration:BanditRLProof.Thompson.clippedUCBHistoryScore_atBestTraceReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem clippedUCBHistoryScore_atBestTrace {K : Nat} (l u sigma2 delta : Real) (bestArm : Fin K) (action : ActionTrace (Fin K)) (reward : RewardTrace Real) (t : Nat) : (clippedUCBHistoryScore l u sigma2 delta).atBestTrace bestArm action reward t = clippedUCB l u sigma2 delta action reward bestArm t
theorem
BanditRLProof.Thompson.integrable_of_measurable_mem_Icc
Compiled
A measurable real function with pointwise range in `[l, u]` is integrable.
Used in these reading views: Bandit Book
6. Thompson sampling and Bayesian regret
Canonical node identity
declaration:BanditRLProof.Thompson.integrable_of_measurable_mem_IccReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem integrable_of_measurable_mem_Icc {Omega : Type u} [MeasurableSpace Omega] (mu : Measure Omega) [IsFiniteMeasure mu] (f : Omega -> Real) (hf : Measurable f) {l u : Real} (hmem : forall omega, f omega ∈ Set.Icc l u) : Integrable f mu
theorem
BanditRLProof.Thompson.integrable_trajectoryHistoryScore_clippedUCB
Compiled
No declaration docstring is present; use the chapter context and exact statement below.
Used in these reading views: Bandit Book
6. Thompson sampling and Bayesian regret
Canonical node identity
declaration:BanditRLProof.Thompson.integrable_trajectoryHistoryScore_clippedUCBReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem integrable_trajectoryHistoryScore_clippedUCB {Env : Type u} {K : Nat} [MeasurableSpace Env] (mu : Measure (Env × ((n : Nat) -> Fin K × Real))) [IsFiniteMeasure mu] (l u sigma2 delta : Real) (hlu : l <= u) (t : Nat) : Integrable (fun sample => trajectoryHistoryScore (clippedUCBHistoryScore l u sigma2 delta) sample t) mu
theorem
BanditRLProof.Thompson.integrable_trajectoryBestHistoryScore_clippedUCB
Compiled
No declaration docstring is present; use the chapter context and exact statement below.
Used in these reading views: Bandit Book
6. Thompson sampling and Bayesian regret
Canonical node identity
declaration:BanditRLProof.Thompson.integrable_trajectoryBestHistoryScore_clippedUCBReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem integrable_trajectoryBestHistoryScore_clippedUCB {Env : Type u} {K : Nat} [MeasurableSpace Env] (mu : Measure (Env × ((n : Nat) -> Fin K × Real))) [IsFiniteMeasure mu] (bestAction : Env -> Fin K) (hbestAction : Measurable bestAction) (l u sigma2 delta : Real) (hlu : l <= u) (t : Nat) : Integrable (fun sample => trajectoryBestHistoryScore (clippedUCBHistoryScore l u sigma2 delta) bestAction sample t) mu
theorem
BanditRLProof.Thompson.integrable_trajectoryMean_bestAction
Compiled
No declaration docstring is present; use the chapter context and exact statement below.
Used in these reading views: Bandit Book
6. Thompson sampling and Bayesian regret
Canonical node identity
declaration:BanditRLProof.Thompson.integrable_trajectoryMean_bestActionReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem integrable_trajectoryMean_bestAction {Env : Type u} {K : Nat} [MeasurableSpace Env] (mu : Measure (Env × ((n : Nat) -> Fin K × Real))) [IsFiniteMeasure mu] (mean : Env -> Fin K -> Real) (hmean : Measurable (fun pair : Env × Fin K => mean pair.1 pair.2)) (hmeanMem : forall env arm, mean env arm ∈ Set.Icc l u) (bestAction : Env -> Fin K) (hbestAction : Measurable bestAction) : Integrable (fun sample : Env × ((n : Nat) -> Fin K × Real) => mean sample.1 (bestAction sample.1)) mu
theorem
BanditRLProof.Thompson.integrable_trajectoryMean_action
Compiled
No declaration docstring is present; use the chapter context and exact statement below.
Used in these reading views: Bandit Book
6. Thompson sampling and Bayesian regret
Canonical node identity
declaration:BanditRLProof.Thompson.integrable_trajectoryMean_actionReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem integrable_trajectoryMean_action {Env : Type u} {K : Nat} [MeasurableSpace Env] (mu : Measure (Env × ((n : Nat) -> Fin K × Real))) [IsFiniteMeasure mu] (mean : Env -> Fin K -> Real) (hmean : Measurable (fun pair : Env × Fin K => mean pair.1 pair.2)) (hmeanMem : forall env arm, mean env arm ∈ Set.Icc l u) (t : Nat) : Integrable (fun sample : Env × ((n : Nat) -> Fin K × Real) => mean sample.1 (environmentTrajectoryAction sample t)) mu
theorem
BanditRLProof.Thompson.integral_trajectoryBayesMeanRegret_eq_add_clippedUCB
Compiled
Concrete clipped-UCB specialization of the actual-trajectory Thompson Bayesian-regret decomposition. Range and measurability assumptions discharge all four integrability families from `integral_trajectoryBayesMeanRegret_eq_add_historyScore`.
Used in these reading views: Bandit Book
6. Thompson sampling and Bayesian regret
Canonical node identity
declaration:BanditRLProof.Thompson.integral_trajectoryBayesMeanRegret_eq_add_clippedUCBReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem integral_trajectoryBayesMeanRegret_eq_add_clippedUCB {Env : Type u} {K : Nat} [MeasurableSpace Env] [StandardBorelSpace Env] [Nonempty Env] [Nonempty (Fin K)] (prior : Measure Env) [IsProbabilityMeasure prior] (environment : MeasurableHistoryEnvironment Env (Fin K) Real) (bestAction : Env -> Fin K) (hbestAction : Measurable bestAction) (mean : Env -> Fin K -> Real) (hmean : Measurable (fun pair : Env × Fin K => mean pair.1 pair.2)) (l u sigma2 delta : Real) (hlu : l <= u) (hmeanMem : forall env arm, mean env arm ∈ Set.Icc l u) (horizon : Nat) : let algorithm := uniformReferenceThompsonAlgorithm prior environment bestAction hbestAction let actualMeasure := prior ⊗ₘ canonicalMeasurableEnvironmentTrajectoryKernel algorithm environment integral actualMeasure (fun sample => trajectoryBayesMeanRegret mean bestAction sample horizon) = integral actualMeasure (fun sample => ∑ t ∈ range horizon, (mean sample.1 (bestAction sample.1) - clippedUCB l u sigma2 delta (environmentTrajectoryAction sample) (environmentTrajectoryReward sample) (bestAction sample.1) t)) + integral actualMeasure (fun sample => ∑ t ∈ range horizon, (clippedUCB l u sigma2 delta (environmentTrajectoryAction sample) (environmentTrajectoryReward sample) (environmentTrajectoryAction sample t) t - mean sample.1 (environmentTrajectoryAction sample t)))