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

Lean module · ETC

BanditRLProof.Algorithms.ETCRealEmpiricalMean

This module supplies the Real-valued empirical-mean and measurable finite argmax surface needed before transporting ETC to an arbitrary native Real environment. It stays below reward-law identification, concentration, and the final IsAlgEnvSeq regret theorem.

Module map

Teaching chapter
3. Explore-Then-Commit
Declarations
15
Placeholders
0

Imports

BanditRLProof.MeasurableLocalQuantities, BanditRLProof.Algorithms.ETCExpectedPullCount

Imported by

BanditRLProof, BanditRLProof.Algorithms.ETCRealInfinitePiTail, BanditRLProof.OFULMeasurableRecursiveSelection

Declarations

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

def BanditRLProof.ETC.realEmpMeanAtExploration Compiled

The exploration empirical mean formed directly from a Real reward trace.

Used in these reading views: Bandit Book

3. Explore-Then-Commit

Canonical node identitydeclaration:BanditRLProof.ETC.realEmpMeanAtExploration

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

noncomputable def realEmpMeanAtExploration {K : Nat} (spec : ETC.Spec K) (baseCommitArm : Fin K) (reward : RewardTrace Real) (a : Fin K) : Real
theorem BanditRLProof.ETC.realEmpMeanAtExploration_eq_sumRewards_div_explorationPulls Compiled

The deterministic exploration count removes the pull-count denominator.

Used in these reading views: Bandit Book

3. Explore-Then-Commit

Canonical node identitydeclaration:BanditRLProof.ETC.realEmpMeanAtExploration_eq_sumRewards_div_explorationPulls

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

theorem realEmpMeanAtExploration_eq_sumRewards_div_explorationPulls {K : Nat} (spec : ETC.Spec K) (baseCommitArm : Fin K) (reward : RewardTrace Real) (a : Fin K) : ETC.realEmpMeanAtExploration spec baseCommitArm reward a = sumRewards (ETC.actionWithCommit spec baseCommitArm) reward a (spec.explorationPulls * K) / (spec.explorationPulls : Real)
theorem BanditRLProof.ETC.measurable_realEmpMeanAtExploration Compiled

Real exploration empirical means are measurable from measurable rewards.

Used in these reading views: Bandit Book

3. Explore-Then-Commit

Canonical node identitydeclaration:BanditRLProof.ETC.measurable_realEmpMeanAtExploration

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

theorem measurable_realEmpMeanAtExploration {Omega : Type u} {K : Nat} [MeasurableSpace Omega] (spec : ETC.Spec K) (baseCommitArm a : Fin K) (reward : Omega -> RewardTrace Real) (hreward : forall t : Nat, Measurable (fun omega : Omega => reward omega t)) : Measurable (fun omega : Omega => ETC.realEmpMeanAtExploration spec baseCommitArm (reward omega) a)
theorem BanditRLProof.ETC.real_score_le_foldl_select Compiled Internal helper

No declaration docstring is present; use the chapter context and exact statement below.

Used in these reading views: Bandit Book

3. Explore-Then-Commit

Canonical node identitydeclaration:BanditRLProof.ETC.real_score_le_foldl_select

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

private theorem real_score_le_foldl_select {K : Nat} (scores : Fin K -> Real) (init : Fin K) : forall l : List (Fin K), (forall a : Fin K, List.Mem a l -> scores a <= scores (l.foldl (fun best arm : Fin K => if scores best < scores arm then arm else best) init)) /\ scores init <= scores (l.foldl (fun best arm : Fin K => if scores best < scores arm then arm else best) init) | [] => by exact And.intro (by intro _ ha; cases ha) (by simp) | arm :: rest => by let select := fun best arm : Fin K => if scores best < scores arm then arm else best let next := select init arm have ih
def BanditRLProof.ETC.realArgmaxCommit Compiled

A deterministic finite argmax for Real-valued arm scores.

Used in these reading views: Bandit Book

3. Explore-Then-Commit

Canonical node identitydeclaration:BanditRLProof.ETC.realArgmaxCommit

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

noncomputable def realArgmaxCommit {K : Nat} (hK : 0 < K) (scores : Fin K -> Real) : Fin K
theorem BanditRLProof.ETC.realArgmaxCommit_spec Compiled

The Real finite argmax dominates every arm score.

Used in these reading views: Bandit Book

3. Explore-Then-Commit

Canonical node identitydeclaration:BanditRLProof.ETC.realArgmaxCommit_spec

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

theorem realArgmaxCommit_spec {K : Nat} (hK : 0 < K) (scores : Fin K -> Real) (a : Fin K) : scores a <= scores (ETC.realArgmaxCommit hK scores)
theorem BanditRLProof.ETC.realArgmaxCommit_const Compiled

On a constant score vector, the tie rule keeps the initial arm `0`.

Used in these reading views: Bandit Book

3. Explore-Then-Commit

Canonical node identitydeclaration:BanditRLProof.ETC.realArgmaxCommit_const

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

@[simp] theorem realArgmaxCommit_const {K : Nat} (hK : 0 < K) (c : Real) : ETC.realArgmaxCommit hK (fun _a : Fin K => c) = Fin.mk 0 hK
theorem BanditRLProof.ETC.measurable_selected_real_score Compiled Internal helper

No declaration docstring is present; use the chapter context and exact statement below.

Used in these reading views: Bandit Book

3. Explore-Then-Commit

Canonical node identitydeclaration:BanditRLProof.ETC.measurable_selected_real_score

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

private theorem measurable_selected_real_score {Omega : Type u} {K : Nat} [MeasurableSpace Omega] (scores : Omega -> Fin K -> Real) (hscores : forall a : Fin K, Measurable (fun omega : Omega => scores omega a)) (best : Omega -> Fin K) (hbest : Measurable best) : Measurable (fun omega : Omega => scores omega (best omega))
theorem BanditRLProof.ETC.measurable_foldl_real_select Compiled Internal helper

No declaration docstring is present; use the chapter context and exact statement below.

Used in these reading views: Bandit Book

3. Explore-Then-Commit

Canonical node identitydeclaration:BanditRLProof.ETC.measurable_foldl_real_select

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

private theorem measurable_foldl_real_select {Omega : Type u} {K : Nat} [MeasurableSpace Omega] (scores : Omega -> Fin K -> Real) (hscores : forall a : Fin K, Measurable (fun omega : Omega => scores omega a)) (best : Omega -> Fin K) (hbest : Measurable best) : forall l : List (Fin K), Measurable (fun omega : Omega => l.foldl (fun best arm : Fin K => if scores omega best < scores omega arm then arm else best) (best omega)) | [] => by simpa using hbest | arm :: rest => by have hselected : Measurable (fun omega : Omega => scores omega (best omega))
theorem BanditRLProof.ETC.measurable_realArgmaxCommit_of_forall_measurable Compiled

The finite Real argmax is measurable when every score coordinate is.

Used in these reading views: Bandit Book

3. Explore-Then-Commit

Canonical node identitydeclaration:BanditRLProof.ETC.measurable_realArgmaxCommit_of_forall_measurable

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

theorem measurable_realArgmaxCommit_of_forall_measurable {Omega : Type u} {K : Nat} [MeasurableSpace Omega] (hK : 0 < K) (scores : Omega -> Fin K -> Real) (hscores : forall a : Fin K, Measurable (fun omega : Omega => scores omega a)) : Measurable (fun omega : Omega => ETC.realArgmaxCommit hK (scores omega))
def BanditRLProof.ETC.realExplorationArgmaxCommit Compiled

Commit to the arm maximizing the native Real exploration means.

Used in these reading views: Bandit Book

3. Explore-Then-Commit

Canonical node identitydeclaration:BanditRLProof.ETC.realExplorationArgmaxCommit

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

noncomputable def realExplorationArgmaxCommit {K : Nat} (spec : ETC.Spec K) (baseCommitArm : Fin K) (reward : RewardTrace Real) : Fin K
def BanditRLProof.ETC.realExplorationArgmaxAction Compiled

Native Real ETC trace: round-robin exploration, then Real empirical argmax.

Used in these reading views: Bandit Book

3. Explore-Then-Commit

Canonical node identitydeclaration:BanditRLProof.ETC.realExplorationArgmaxAction

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

noncomputable def realExplorationArgmaxAction {K : Nat} (spec : ETC.Spec K) (baseCommitArm : Fin K) (reward : RewardTrace Real) : ActionTrace (Fin K)
theorem BanditRLProof.ETC.measurable_realExplorationArgmaxCommit Compiled

The reward-dependent native Real ETC commit arm is measurable.

Used in these reading views: Bandit Book

3. Explore-Then-Commit

Canonical node identitydeclaration:BanditRLProof.ETC.measurable_realExplorationArgmaxCommit

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

theorem measurable_realExplorationArgmaxCommit {Omega : Type u} {K : Nat} [MeasurableSpace Omega] (spec : ETC.Spec K) (baseCommitArm : Fin K) (reward : Omega -> RewardTrace Real) (hreward : forall t : Nat, Measurable (fun omega : Omega => reward omega t)) : Measurable (fun omega : Omega => ETC.realExplorationArgmaxCommit spec baseCommitArm (reward omega))
theorem BanditRLProof.ETC.integral_real_pullCount_realExplorationArgmaxAction_eq_exploration_add_remaining_mul_commit_prob Compiled

Exact expected pull count for the native Real empirical-argmax ETC trace.

Used in these reading views: Bandit Book

3. Explore-Then-Commit

Canonical node identitydeclaration:BanditRLProof.ETC.integral_real_pullCount_realExplorationArgmaxAction_eq_exploration_add_remaining_mul_commit_prob

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

theorem integral_real_pullCount_realExplorationArgmaxAction_eq_exploration_add_remaining_mul_commit_prob {Omega : Type u} {K : Nat} [MeasurableSpace Omega] (mu : Measure Omega) [IsProbabilityMeasure mu] (spec : ETC.Spec K) (baseCommitArm : Fin K) (reward : Omega -> RewardTrace Real) (hreward : forall t : Nat, Measurable (fun omega : Omega => reward omega t)) (a : Fin K) (n : Nat) (hn : K * spec.explorationPulls <= n) : integral mu (fun omega : Omega => ((pullCount (ETC.realExplorationArgmaxAction spec baseCommitArm (reward omega)) a n : Nat) : Real)) = (spec.explorationPulls : Real) + ((n - K * spec.explorationPulls : Nat) : Real) * mu.real {omega : Omega | ETC.realExplorationArgmaxCommit spec baseCommitArm (reward omega) = a}
theorem BanditRLProof.ETC.integral_real_pullCount_realExplorationArgmaxAction_le_exploration_add_remaining_mul_of_commit_prob_le Compiled

A commit-fiber bound immediately yields the native Real expected count bound.

Used in these reading views: Bandit Book

3. Explore-Then-Commit

Canonical node identitydeclaration:BanditRLProof.ETC.integral_real_pullCount_realExplorationArgmaxAction_le_exploration_add_remaining_mul_of_commit_prob_le

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

theorem integral_real_pullCount_realExplorationArgmaxAction_le_exploration_add_remaining_mul_of_commit_prob_le {Omega : Type u} {K : Nat} [MeasurableSpace Omega] (mu : Measure Omega) [IsProbabilityMeasure mu] (spec : ETC.Spec K) (baseCommitArm : Fin K) (reward : Omega -> RewardTrace Real) (hreward : forall t : Nat, Measurable (fun omega : Omega => reward omega t)) (a : Fin K) (n : Nat) (p : Real) (hn : K * spec.explorationPulls <= n) (hprob : mu.real {omega : Omega | ETC.realExplorationArgmaxCommit spec baseCommitArm (reward omega) = a} <= p) : integral mu (fun omega : Omega => ((pullCount (ETC.realExplorationArgmaxAction spec baseCommitArm (reward omega)) a n : Nat) : Real)) <= (spec.explorationPulls : Real) + ((n - K * spec.explorationPulls : Nat) : Real) * p