BanditRLlib
Lean gate passed before this site build; local proof declarations are shown as compiled.Lean-verified build · exact declarations linked.

Lean module · Foundations

BanditRLProof.LeafLemmas

These lemmas are the first compiled ABRL leaf library. They deliberately avoid Mathlib imports while exposing stable theorem names that later Mathlib-backed tasks can replace, generalize, or upstream.

Module map

Declarations
38
Placeholders
0

Imports

BanditRLProof.Regret

Imported by

BanditRLProof, BanditRLProof.Algorithms.ETCTraceCountLemmas, BanditRLProof.Algorithms.StochasticGradientBanditTheoremTwoStarvation, BanditRLProof.ExpectationPullCount, BanditRLProof.MathlibWrappers, BanditRLProof.MeasurablePullCount, BanditRLProof.PullCountReindex

Declarations

Open an item to read its exact compact statement and source link. Detailed teaching notes are linked when registered.

theorem BanditRLProof.pullCount_one 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 identitydeclaration:BanditRLProof.pullCount_one

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

@[simp] theorem pullCount_one : pullCount action a 1 = if action 0 = a then 1 else 0
theorem BanditRLProof.pullCount_succ_of_eq 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 identitydeclaration:BanditRLProof.pullCount_succ_of_eq

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pullCount_succ_of_eq (h : action t = a) : pullCount action a (t + 1) = pullCount action a t + 1
theorem BanditRLProof.pullCount_succ_of_ne 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 identitydeclaration:BanditRLProof.pullCount_succ_of_ne

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pullCount_succ_of_ne (h : action t ≠ a) : pullCount action a (t + 1) = pullCount action a t
theorem BanditRLProof.pullCount_le_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 identitydeclaration:BanditRLProof.pullCount_le_succ

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pullCount_le_succ : pullCount action a t ≤ pullCount action a (t + 1)
theorem BanditRLProof.pullCount_succ_le_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 identitydeclaration:BanditRLProof.pullCount_succ_le_succ

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pullCount_succ_le_succ : pullCount action a (t + 1) ≤ pullCount action a t + 1
theorem BanditRLProof.pullCount_lt_of_forall_succ_ne Compiled

If a positive count level is never hit at a successor time, every finite pull count stays strictly below that level. The proof uses only that `pullCount` starts at zero and grows by at most one per round.

Used in these reading views: Bandit Book

1. Finite bandits, traces, and regret

Canonical node identitydeclaration:BanditRLProof.pullCount_lt_of_forall_succ_ne

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pullCount_lt_of_forall_succ_ne (target : Nat) (htarget : 0 < target) (hnever : ∀ chron, pullCount action a (chron + 1) ≠ target) : pullCount action a t < target
theorem BanditRLProof.pullCount_mono 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 identitydeclaration:BanditRLProof.pullCount_mono

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pullCount_mono {s t : Nat} (h : s ≤ t) : pullCount action a s ≤ pullCount action a t
theorem BanditRLProof.pullCount_le_time 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 identitydeclaration:BanditRLProof.pullCount_le_time

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pullCount_le_time : pullCount action a t ≤ t
theorem BanditRLProof.pullCount_add_le 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 identitydeclaration:BanditRLProof.pullCount_add_le

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pullCount_add_le (n : Nat) : pullCount action a (t + n) ≤ pullCount action a t + n
theorem BanditRLProof.pullCount_le_add 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 identitydeclaration:BanditRLProof.pullCount_le_add

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pullCount_le_add : pullCount action a t ≤ pullCount action a (t + n)
theorem BanditRLProof.pullCount_eq_zero_of_forall_ne 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 identitydeclaration:BanditRLProof.pullCount_eq_zero_of_forall_ne

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pullCount_eq_zero_of_forall_ne (h : ∀ s, s < t → action s ≠ a) : pullCount action a t = 0
theorem BanditRLProof.pullCount_eq_time_of_forall_eq 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 identitydeclaration:BanditRLProof.pullCount_eq_time_of_forall_eq

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pullCount_eq_time_of_forall_eq (h : ∀ s, s < t → action s = a) : pullCount action a t = t
theorem BanditRLProof.pullCount_pos_of_eq_before 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 identitydeclaration:BanditRLProof.pullCount_pos_of_eq_before

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pullCount_pos_of_eq_before {s t : Nat} (hst : s < t) (h : action s = a) : 0 < pullCount action a t
theorem BanditRLProof.pullCount_eq_of_forall_lt Compiled

Pull counts depend only on the half-open action prefix `0, ..., t - 1`. This keeps later adaptive-policy wrappers from reproving the same induction when a history-generated trace is known to agree pointwise with an index-policy trace up to a finite horizon.

Used in these reading views: Bandit Book

1. Finite bandits, traces, and regret

Canonical node identitydeclaration:BanditRLProof.pullCount_eq_of_forall_lt

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pullCount_eq_of_forall_lt (action action' : ActionTrace Action) (a : Action) : forall t : Nat, (forall s : Nat, s < t -> action s = action' s) -> pullCount action a t = pullCount action' a t
theorem BanditRLProof.pullCount_const_self 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 identitydeclaration:BanditRLProof.pullCount_const_self

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

@[simp] theorem pullCount_const_self (a : Action) (t : Nat) : pullCount (fun _ => a) a t = t
theorem BanditRLProof.pullCount_const_of_ne 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 identitydeclaration:BanditRLProof.pullCount_const_of_ne

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pullCount_const_of_ne (b : Action) (h : b ≠ a) (t : Nat) : pullCount (fun _ => b) a t = 0
theorem BanditRLProof.pullCount_add_eq_of_forall_ne_between 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 identitydeclaration:BanditRLProof.pullCount_add_eq_of_forall_ne_between

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pullCount_add_eq_of_forall_ne_between (n : Nat) (h : ∀ s, t ≤ s → s < t + n → action s ≠ a) : pullCount action a (t + n) = pullCount action a t
theorem BanditRLProof.pullCount_add_eq_add_of_forall_eq_between 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 identitydeclaration:BanditRLProof.pullCount_add_eq_add_of_forall_eq_between

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pullCount_add_eq_add_of_forall_eq_between (n : Nat) (h : ∀ s, t ≤ s → s < t + n → action s = a) : pullCount action a (t + n) = pullCount action a t + n
theorem BanditRLProof.pullCount_eq_list_filter_length Compiled

The recursive pull count equals the number of matching actions in the half-open time prefix `0, ..., t - 1`. This is intentionally a dependency-light `List.range` bridge. The Mathlib `Finset.range` cardinality wrapper is a separate downstream leaf.

Used in these reading views: Bandit Book

1. Finite bandits, traces, and regret

Canonical node identitydeclaration:BanditRLProof.pullCount_eq_list_filter_length

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pullCount_eq_list_filter_length : pullCount action a t = ((List.range t).filter (fun s : Nat => decide (action s = a))).length
theorem BanditRLProof.sumRewards_succ_of_eq 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 identitydeclaration:BanditRLProof.sumRewards_succ_of_eq

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem sumRewards_succ_of_eq (h : action t = a) : sumRewards action reward a (t + 1) = sumRewards action reward a t + reward t
theorem BanditRLProof.sumRewards_succ_of_ne 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 identitydeclaration:BanditRLProof.sumRewards_succ_of_ne

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem sumRewards_succ_of_ne (hzero : ∀ x : Reward, x + 0 = x) (h : action t ≠ a) : sumRewards action reward a (t + 1) = sumRewards action reward a t
theorem BanditRLProof.sumRewards_eq_zero_of_forall_ne 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 identitydeclaration:BanditRLProof.sumRewards_eq_zero_of_forall_ne

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem sumRewards_eq_zero_of_forall_ne (hzero : ∀ x : Reward, x + 0 = x) (h : ∀ s, s < t → action s ≠ a) : sumRewards action reward a t = 0
theorem BanditRLProof.sumRewards_const_of_ne 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 identitydeclaration:BanditRLProof.sumRewards_const_of_ne

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem sumRewards_const_of_ne (hzero : ∀ x : Reward, x + 0 = x) (b : Action) (h : b ≠ a) (t : Nat) : sumRewards (fun _ => b) reward a t = 0
theorem BanditRLProof.sumRewards_add_eq_of_forall_ne_between 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 identitydeclaration:BanditRLProof.sumRewards_add_eq_of_forall_ne_between

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem sumRewards_add_eq_of_forall_ne_between (hzero : ∀ x : Reward, x + 0 = x) (n : Nat) (h : ∀ s, t ≤ s → s < t + n → action s ≠ a) : sumRewards action reward a (t + n) = sumRewards action reward a t
theorem BanditRLProof.sumRewards_eq_list_range_foldl Compiled

The recursive reward sum equals a left fold over the half-open time prefix. This bridge deliberately keeps the false-branch `+ 0` steps in the fold, so it does not require additive laws beyond the weak assumptions used by `sumRewards`.

Used in these reading views: Bandit Book

1. Finite bandits, traces, and regret

Canonical node identitydeclaration:BanditRLProof.sumRewards_eq_list_range_foldl

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem sumRewards_eq_list_range_foldl : sumRewards action reward a t = (List.range t).foldl (fun acc s => acc + if action s = a then reward s else 0) 0
theorem BanditRLProof.sumRewards_eq_list_range_filter_foldl Compiled

The reward sum can also drop nonmatching time steps from the list fold when the accumulator has a right-zero law. This is still dependency-light: it uses `List.range` and `List.filter`, not a Mathlib `Finset` sum.

Used in these reading views: Bandit Book

1. Finite bandits, traces, and regret

Canonical node identitydeclaration:BanditRLProof.sumRewards_eq_list_range_filter_foldl

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem sumRewards_eq_list_range_filter_foldl (hzero : ∀ x : Reward, x + 0 = x) : sumRewards action reward a t = ((List.range t).filter (fun s : Nat => decide (action s = a))).foldl (fun acc s => acc + reward s) 0
theorem BanditRLProof.FiniteBanditModel.bestMean_eq_mean_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 identitydeclaration:BanditRLProof.FiniteBanditModel.bestMean_eq_mean_bestArm

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

@[simp] theorem bestMean_eq_mean_bestArm (model : FiniteBanditModel K) : model.bestMean = model.mean model.bestArm
theorem BanditRLProof.FiniteBanditModel.gap_of_ne_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 identitydeclaration:BanditRLProof.FiniteBanditModel.gap_of_ne_bestArm

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem gap_of_ne_bestArm (model : FiniteBanditModel K) (arm : Fin K) (h : arm ≠ model.bestArm) : model.gap arm = model.bestMean - model.mean arm
theorem BanditRLProof.pseudoRegret_one 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 identitydeclaration:BanditRLProof.pseudoRegret_one

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

@[simp] theorem pseudoRegret_one : pseudoRegret model action 1 = model.gap (action 0)
theorem BanditRLProof.pseudoRegret_succ_of_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 identitydeclaration:BanditRLProof.pseudoRegret_succ_of_bestArm

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pseudoRegret_succ_of_bestArm (h : action t = model.bestArm) : pseudoRegret model action (t + 1) = pseudoRegret model action t
theorem BanditRLProof.pseudoRegret_succ_of_gap_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 identitydeclaration:BanditRLProof.pseudoRegret_succ_of_gap_zero

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pseudoRegret_succ_of_gap_zero (h : model.gap (action t) = 0) : pseudoRegret model action (t + 1) = pseudoRegret model action t
theorem BanditRLProof.pseudoRegret_eq_zero_of_forall_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 identitydeclaration:BanditRLProof.pseudoRegret_eq_zero_of_forall_bestArm

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pseudoRegret_eq_zero_of_forall_bestArm (h : ∀ s, s < t → action s = model.bestArm) : pseudoRegret model action t = 0
theorem BanditRLProof.pseudoRegret_eq_zero_of_forall_gap_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 identitydeclaration:BanditRLProof.pseudoRegret_eq_zero_of_forall_gap_zero

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pseudoRegret_eq_zero_of_forall_gap_zero (h : ∀ s, s < t → model.gap (action s) = 0) : pseudoRegret model action t = 0
theorem BanditRLProof.pseudoRegret_const_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 identitydeclaration:BanditRLProof.pseudoRegret_const_bestArm

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

@[simp] theorem pseudoRegret_const_bestArm : pseudoRegret model (fun _ => model.bestArm) t = 0
theorem BanditRLProof.pseudoRegret_const_of_gap_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 identitydeclaration:BanditRLProof.pseudoRegret_const_of_gap_zero

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pseudoRegret_const_of_gap_zero (arm : Fin K) (h : model.gap arm = 0) : pseudoRegret model (fun _ => arm) t = 0
theorem BanditRLProof.pseudoRegret_add_eq_of_forall_bestArm_between 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 identitydeclaration:BanditRLProof.pseudoRegret_add_eq_of_forall_bestArm_between

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pseudoRegret_add_eq_of_forall_bestArm_between (n : Nat) (h : ∀ s, t ≤ s → s < t + n → action s = model.bestArm) : pseudoRegret model action (t + n) = pseudoRegret model action t
theorem BanditRLProof.pseudoRegret_add_eq_of_forall_gap_zero_between 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 identitydeclaration:BanditRLProof.pseudoRegret_add_eq_of_forall_gap_zero_between

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pseudoRegret_add_eq_of_forall_gap_zero_between (n : Nat) (h : ∀ s, t ≤ s → s < t + n → model.gap (action s) = 0) : pseudoRegret model action (t + n) = pseudoRegret model action t
theorem BanditRLProof.pseudoRegret_eq_list_range_foldl Compiled

The recursive pseudo-regret equals a left fold over the half-open time prefix. This is the dependency-light `List.range` bridge for the Rat-valued regret accumulator. It matches the recursive bracketing directly.

Used in these reading views: Bandit Book

1. Finite bandits, traces, and regret

Canonical node identitydeclaration:BanditRLProof.pseudoRegret_eq_list_range_foldl

Reading membership is not a proof dependency. Exact assumptions remain in the Lean statement.

theorem pseudoRegret_eq_list_range_foldl : pseudoRegret model action t = (List.range t).foldl (fun acc s => acc + model.gap (action s)) 0