BanditRLlib
Lean gate passed before this site build; local proof declarations are shown as compiled.

Lean module · Foundations

BanditRLProof.LowerBounds.BanditHistoryKL

# Same-policy finite-history KL for stochastic bandits This module connects the conditional-kernel KL integral to the repository's kernel-valued `HistoryAlgorithm` and canonical Ionescu--Tulcea trajectory. The observable history includes every sampled action and reward, so the same possibly randomized nonanticipating policy is shared by both environments.

Module map

Declarations
32
Placeholders
0

Imports

BanditRLProof.LowerBounds.ConditionalKernelKL, BanditRLProof.Algorithms.ThompsonCanonicalTrajectory

Imported by

BanditRLProof

Declarations

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

def BanditRLProof.LowerBounds.pairHistoryZeroMeasurableEquiv Compiled

The time-zero action/reward pair is measurably equivalent to its singleton history.

def pairHistoryZeroMeasurableEquiv (Action : Type u) (Reward : Type v) [MeasurableSpace Action] [MeasurableSpace Reward] : (Action × Reward) ≃ᵐ History.FinitePairHistory Action Reward 0 where
def BanditRLProof.LowerBounds.pairHistorySuccMeasurableEquiv Compiled

A finite history and one next pair are measurably equivalent to the successor history.

def pairHistorySuccMeasurableEquiv (Action : Type u) (Reward : Type v) [MeasurableSpace Action] [MeasurableSpace Reward] (n : Nat) : (History.FinitePairHistory Action Reward n × (Action × Reward)) ≃ᵐ History.FinitePairHistory Action Reward (n + 1)
theorem BanditRLProof.LowerBounds.pairHistoryZeroMeasurableEquiv_apply Compiled

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

theorem pairHistoryZeroMeasurableEquiv_apply {Action : Type u} {Reward : Type v} [MeasurableSpace Action] [MeasurableSpace Reward] (pair : Action × Reward) : pairHistoryZeroMeasurableEquiv Action Reward pair = Thompson.singletonPairHistory pair
theorem BanditRLProof.LowerBounds.pairHistorySuccMeasurableEquiv_apply Compiled

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

theorem pairHistorySuccMeasurableEquiv_apply {Action : Type u} {Reward : Type v} [MeasurableSpace Action] [MeasurableSpace Reward] (n : Nat) (input : History.FinitePairHistory Action Reward n × (Action × Reward)) : pairHistorySuccMeasurableEquiv Action Reward n input = History.extendPairHistorySucc input.1 input.2
def BanditRLProof.LowerBounds.stationaryBanditHistoryEnvironment Compiled

A stationary arm-indexed reward kernel viewed as a history environment.

noncomputable def stationaryBanditHistoryEnvironment {K : Nat} {Reward : Type v} [MeasurableSpace Reward] (armLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] : Thompson.HistoryEnvironment (Fin K) Reward where
theorem BanditRLProof.LowerBounds.stationaryBanditHistoryEnvironment_initialFeedback Compiled

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

theorem stationaryBanditHistoryEnvironment_initialFeedback {K : Nat} {Reward : Type v} [MeasurableSpace Reward] (armLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] : (stationaryBanditHistoryEnvironment armLaw).initialFeedback = armLaw
theorem BanditRLProof.LowerBounds.stationaryBanditHistoryEnvironment_feedback_apply Compiled

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

theorem stationaryBanditHistoryEnvironment_feedback_apply {K : Nat} {Reward : Type v} [MeasurableSpace Reward] (armLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] (n : Nat) (history : History.FinitePairHistory (Fin K) Reward n) (arm : Fin K) : (stationaryBanditHistoryEnvironment armLaw).feedback n (history, arm) = armLaw arm
def BanditRLProof.LowerBounds.canonicalBanditHistoryMeasure Compiled

Law of the observable action/reward history through the inclusive round `n`.

noncomputable def canonicalBanditHistoryMeasure {K : Nat} {Reward : Type v} [MeasurableSpace Reward] (algorithm : Thompson.HistoryAlgorithm (Fin K) Reward) (armLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] (n : Nat) : Measure (History.FinitePairHistory (Fin K) Reward n)
theorem BanditRLProof.LowerBounds.canonicalBanditHistoryMeasure_zero Compiled

The inclusive time-zero history is the initial action/reward law in singleton form.

theorem canonicalBanditHistoryMeasure_zero {K : Nat} {Reward : Type v} [MeasurableSpace Reward] (algorithm : Thompson.HistoryAlgorithm (Fin K) Reward) (armLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] : canonicalBanditHistoryMeasure algorithm armLaw 0 = (algorithm.initialAction ⊗ₘ armLaw).map (pairHistoryZeroMeasurableEquiv (Fin K) Reward)
theorem BanditRLProof.LowerBounds.canonicalBanditHistoryMeasure_succ Compiled

The inclusive successor history is obtained from the prefix history and the canonical same-policy action/reward step, then re-encoded by a measurable equivalence.

theorem canonicalBanditHistoryMeasure_succ {K : Nat} {Reward : Type v} [MeasurableSpace Reward] (algorithm : Thompson.HistoryAlgorithm (Fin K) Reward) (armLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] (n : Nat) : canonicalBanditHistoryMeasure algorithm armLaw (n + 1) = (canonicalBanditHistoryMeasure algorithm armLaw n ⊗ₘ Thompson.historyStepKernel algorithm (stationaryBanditHistoryEnvironment armLaw) n).map (pairHistorySuccMeasurableEquiv (Fin K) Reward n)
theorem BanditRLProof.LowerBounds.klDiv_canonicalBanditHistoryMeasure_zero Compiled

At the first pull, same-policy history KL is the initial-action average of the arm-law KL divergence. The expectation is under the first environment.

theorem klDiv_canonicalBanditHistoryMeasure_zero {K : Nat} {Reward : Type v} [MeasurableSpace Reward] [MeasurableSpace.CountablyGenerated Reward] (algorithm : Thompson.HistoryAlgorithm (Fin K) Reward) (armLaw referenceArmLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] [IsMarkovKernel referenceArmLaw] (h_ac : ∀ arm, armLaw arm ≪ referenceArmLaw arm) : InformationTheory.klDiv (canonicalBanditHistoryMeasure algorithm armLaw 0) (canonicalBanditHistoryMeasure algorithm referenceArmLaw 0) = ∫⁻ arm, InformationTheory.klDiv (armLaw arm) (referenceArmLaw arm) ∂algorithm.initialAction
theorem BanditRLProof.LowerBounds.klDiv_canonicalBanditHistoryMeasure_succ Compiled

One successor round adds the first-environment policy average of the selected arm KL divergence. This is the exact adaptive-history chain-rule step; the possibly randomized policy is shared and contributes no additional KL term.

theorem klDiv_canonicalBanditHistoryMeasure_succ {K : Nat} {Reward : Type v} [MeasurableSpace Reward] [MeasurableSpace.CountablyGenerated Reward] (algorithm : Thompson.HistoryAlgorithm (Fin K) Reward) (armLaw referenceArmLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] [IsMarkovKernel referenceArmLaw] (h_ac : ∀ arm, armLaw arm ≪ referenceArmLaw arm) (n : Nat) : InformationTheory.klDiv (canonicalBanditHistoryMeasure algorithm armLaw (n + 1)) (canonicalBanditHistoryMeasure algorithm referenceArmLaw (n + 1)) = InformationTheory.klDiv (canonicalBanditHistoryMeasure algorithm armLaw n) (canonicalBanditHistoryMeasure algorithm referenceArmLaw n) + ∫⁻ history, ∫⁻ arm, InformationTheory.klDiv (armLaw arm) (referenceArmLaw arm) ∂algorithm.policy n history ∂canonicalBanditHistoryMeasure algorithm armLaw n
def BanditRLProof.LowerBounds.canonicalPolicyArmMass Compiled

First-environment probability mass assigned to one arm at successor round `n + 1`.

noncomputable def canonicalPolicyArmMass {K : Nat} {Reward : Type v} [MeasurableSpace Reward] (algorithm : Thompson.HistoryAlgorithm (Fin K) Reward) (armLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] (n : Nat) (arm : Fin K) : ENNReal
def BanditRLProof.LowerBounds.canonicalExpectedPullCountThrough Compiled

Expected number of selections of `arm` through inclusive round `n`: the initial-action mass plus the successor policy masses for rounds `1, ..., n`. The equality with the lower integral of the realized finite-history pull count is proved below; this definition exposes the recurrence used by the KL proof.

noncomputable def canonicalExpectedPullCountThrough {K : Nat} {Reward : Type v} [MeasurableSpace Reward] (algorithm : Thompson.HistoryAlgorithm (Fin K) Reward) (armLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] (n : Nat) (arm : Fin K) : ENNReal
theorem BanditRLProof.LowerBounds.canonicalExpectedPullCountThrough_zero Compiled

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

theorem canonicalExpectedPullCountThrough_zero {K : Nat} {Reward : Type v} [MeasurableSpace Reward] (algorithm : Thompson.HistoryAlgorithm (Fin K) Reward) (armLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] (arm : Fin K) : canonicalExpectedPullCountThrough algorithm armLaw 0 arm = algorithm.initialAction ({arm} : Set (Fin K))
theorem BanditRLProof.LowerBounds.canonicalExpectedPullCountThrough_succ Compiled

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

theorem canonicalExpectedPullCountThrough_succ {K : Nat} {Reward : Type v} [MeasurableSpace Reward] (algorithm : Thompson.HistoryAlgorithm (Fin K) Reward) (armLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] (n : Nat) (arm : Fin K) : canonicalExpectedPullCountThrough algorithm armLaw (n + 1) arm = canonicalExpectedPullCountThrough algorithm armLaw n arm + canonicalPolicyArmMass algorithm armLaw n arm
theorem BanditRLProof.LowerBounds.lintegral_lintegral_fin_eq_sum_armMass_mul Compiled

A finite-action conditional cost integral regroups by action mass.

theorem lintegral_lintegral_fin_eq_sum_armMass_mul {K : Nat} {History : Type*} [MeasurableSpace History] (historyLaw : Measure History) (policy : Kernel History (Fin K)) [IsMarkovKernel policy] (cost : Fin K → ENNReal) : (∫⁻ history, ∫⁻ arm, cost arm ∂policy history ∂historyLaw) = ∑ arm : Fin K, (∫⁻ history, policy history ({arm} : Set (Fin K)) ∂historyLaw) * cost arm
theorem BanditRLProof.LowerBounds.klDiv_canonicalBanditHistoryMeasure_eq_sum_expectedPullCount_mul_armKL Compiled

Policy-mass recurrence form of the finite-history KL decomposition.

theorem klDiv_canonicalBanditHistoryMeasure_eq_sum_expectedPullCount_mul_armKL {K : Nat} {Reward : Type v} [MeasurableSpace Reward] [MeasurableSpace.CountablyGenerated Reward] (algorithm : Thompson.HistoryAlgorithm (Fin K) Reward) (armLaw referenceArmLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] [IsMarkovKernel referenceArmLaw] (h_ac : ∀ arm, armLaw arm ≪ referenceArmLaw arm) (n : Nat) : InformationTheory.klDiv (canonicalBanditHistoryMeasure algorithm armLaw n) (canonicalBanditHistoryMeasure algorithm referenceArmLaw n) = ∑ arm : Fin K, canonicalExpectedPullCountThrough algorithm armLaw n arm * InformationTheory.klDiv (armLaw arm) (referenceArmLaw arm)
def BanditRLProof.LowerBounds.finiteHistoryPullCountENNReal Compiled

Realized pull count encoded directly on an inclusive finite history.

noncomputable def finiteHistoryPullCountENNReal {K : Nat} {Reward : Type v} : (n : Nat) → History.FinitePairHistory (Fin K) Reward n → Fin K → ENNReal | 0, history, arm => if (history ⟨0, Finset.mem_Iic.mpr le_rfl⟩).1 = arm then 1 else 0 | n + 1, history, arm => finiteHistoryPullCountENNReal n (Thompson.pairHistoryPrefix history) arm + if (Thompson.pairHistoryLast history).1 = arm then 1 else 0 theorem measurable_finiteHistoryPullCountENNReal {K : Nat} {Reward : Type v} [MeasurableSpace Reward] (n : Nat) (arm : Fin K) : Measurable (fun history : History.FinitePairHistory (Fin K) Reward n => finiteHistoryPullCountENNReal n history arm)
theorem BanditRLProof.LowerBounds.measurable_finiteHistoryPullCountENNReal Compiled

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

theorem measurable_finiteHistoryPullCountENNReal {K : Nat} {Reward : Type v} [MeasurableSpace Reward] (n : Nat) (arm : Fin K) : Measurable (fun history : History.FinitePairHistory (Fin K) Reward n => finiteHistoryPullCountENNReal n history arm)
theorem BanditRLProof.LowerBounds.finiteHistoryPullCountENNReal_pairHistoryZeroMeasurableEquiv Compiled

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

theorem finiteHistoryPullCountENNReal_pairHistoryZeroMeasurableEquiv {K : Nat} {Reward : Type v} [MeasurableSpace Reward] (pair : Fin K × Reward) (arm : Fin K) : finiteHistoryPullCountENNReal 0 (pairHistoryZeroMeasurableEquiv (Fin K) Reward pair) arm = if pair.1 = arm then 1 else 0
theorem BanditRLProof.LowerBounds.finiteHistoryPullCountENNReal_pairHistorySuccMeasurableEquiv Compiled

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

theorem finiteHistoryPullCountENNReal_pairHistorySuccMeasurableEquiv {K : Nat} {Reward : Type v} [MeasurableSpace Reward] (n : Nat) (input : History.FinitePairHistory (Fin K) Reward n × (Fin K × Reward)) (arm : Fin K) : finiteHistoryPullCountENNReal (n + 1) (pairHistorySuccMeasurableEquiv (Fin K) Reward n input) arm = finiteHistoryPullCountENNReal n input.1 arm + if input.2.1 = arm then 1 else 0
def BanditRLProof.LowerBounds.canonicalRealizedExpectedPullCountThrough Compiled

Lower integral of the realized pull count on the generated finite history.

noncomputable def canonicalRealizedExpectedPullCountThrough {K : Nat} {Reward : Type v} [MeasurableSpace Reward] (algorithm : Thompson.HistoryAlgorithm (Fin K) Reward) (armLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] (n : Nat) (arm : Fin K) : ENNReal
theorem BanditRLProof.LowerBounds.lintegral_historyStepKernel_armIndicator_eq_policy_mass Compiled

The action indicator under a history-step kernel integrates to policy mass.

theorem lintegral_historyStepKernel_armIndicator_eq_policy_mass {K : Nat} {Reward : Type v} [MeasurableSpace Reward] (algorithm : Thompson.HistoryAlgorithm (Fin K) Reward) (environment : Thompson.HistoryEnvironment (Fin K) Reward) (n : Nat) (history : History.FinitePairHistory (Fin K) Reward n) (arm : Fin K) : (∫⁻ pair, ({arm} : Set (Fin K)).indicator (fun _ => (1 : ENNReal)) pair.1 ∂Thompson.historyStepKernel algorithm environment n history) = algorithm.policy n history ({arm} : Set (Fin K))
theorem BanditRLProof.LowerBounds.canonicalRealizedExpectedPullCountThrough_zero Compiled

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

theorem canonicalRealizedExpectedPullCountThrough_zero {K : Nat} {Reward : Type v} [MeasurableSpace Reward] (algorithm : Thompson.HistoryAlgorithm (Fin K) Reward) (armLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] (arm : Fin K) : canonicalRealizedExpectedPullCountThrough algorithm armLaw 0 arm = algorithm.initialAction ({arm} : Set (Fin K))
theorem BanditRLProof.LowerBounds.canonicalRealizedExpectedPullCountThrough_succ Compiled

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

theorem canonicalRealizedExpectedPullCountThrough_succ {K : Nat} {Reward : Type v} [MeasurableSpace Reward] (algorithm : Thompson.HistoryAlgorithm (Fin K) Reward) (armLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] (n : Nat) (arm : Fin K) : canonicalRealizedExpectedPullCountThrough algorithm armLaw (n + 1) arm = canonicalRealizedExpectedPullCountThrough algorithm armLaw n arm + canonicalPolicyArmMass algorithm armLaw n arm
theorem BanditRLProof.LowerBounds.canonicalRealizedExpectedPullCountThrough_eq_expectedPullCountThrough Compiled

The policy-mass recurrence is exactly the lower integral of the realized pull count on the first-environment finite history.

theorem canonicalRealizedExpectedPullCountThrough_eq_expectedPullCountThrough {K : Nat} {Reward : Type v} [MeasurableSpace Reward] (algorithm : Thompson.HistoryAlgorithm (Fin K) Reward) (armLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] (n : Nat) (arm : Fin K) : canonicalRealizedExpectedPullCountThrough algorithm armLaw n arm = canonicalExpectedPullCountThrough algorithm armLaw n arm
theorem BanditRLProof.LowerBounds.klDiv_canonicalBanditHistoryMeasure_zero_general Compiled

The first-pull KL identity, including singular and infinite-divergence arms.

theorem klDiv_canonicalBanditHistoryMeasure_zero_general {K : Nat} {Reward : Type v} [MeasurableSpace Reward] [MeasurableSpace.CountablyGenerated Reward] (algorithm : Thompson.HistoryAlgorithm (Fin K) Reward) (armLaw referenceArmLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] [IsMarkovKernel referenceArmLaw] : InformationTheory.klDiv (canonicalBanditHistoryMeasure algorithm armLaw 0) (canonicalBanditHistoryMeasure algorithm referenceArmLaw 0) = ∫⁻ arm, InformationTheory.klDiv (armLaw arm) (referenceArmLaw arm) ∂algorithm.initialAction
theorem BanditRLProof.LowerBounds.klDiv_canonicalBanditHistoryMeasure_succ_general Compiled

General successor KL recursion for a common randomized history policy.

theorem klDiv_canonicalBanditHistoryMeasure_succ_general {K : Nat} {Reward : Type v} [MeasurableSpace Reward] [MeasurableSpace.CountablyGenerated Reward] (algorithm : Thompson.HistoryAlgorithm (Fin K) Reward) (armLaw referenceArmLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] [IsMarkovKernel referenceArmLaw] (n : Nat) : InformationTheory.klDiv (canonicalBanditHistoryMeasure algorithm armLaw (n + 1)) (canonicalBanditHistoryMeasure algorithm referenceArmLaw (n + 1)) = InformationTheory.klDiv (canonicalBanditHistoryMeasure algorithm armLaw n) (canonicalBanditHistoryMeasure algorithm referenceArmLaw n) + ∫⁻ history, ∫⁻ arm, InformationTheory.klDiv (armLaw arm) (referenceArmLaw arm) ∂algorithm.policy n history ∂canonicalBanditHistoryMeasure algorithm armLaw n
theorem BanditRLProof.LowerBounds.klDiv_canonicalBanditHistoryMeasure_eq_sum_expectedPullCount_mul_armKL_general Compiled

Policy-mass form of the unrestricted finite-history decomposition.

theorem klDiv_canonicalBanditHistoryMeasure_eq_sum_expectedPullCount_mul_armKL_general {K : Nat} {Reward : Type v} [MeasurableSpace Reward] [MeasurableSpace.CountablyGenerated Reward] (algorithm : Thompson.HistoryAlgorithm (Fin K) Reward) (armLaw referenceArmLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] [IsMarkovKernel referenceArmLaw] (n : Nat) : InformationTheory.klDiv (canonicalBanditHistoryMeasure algorithm armLaw n) (canonicalBanditHistoryMeasure algorithm referenceArmLaw n) = ∑ arm : Fin K, canonicalExpectedPullCountThrough algorithm armLaw n arm * InformationTheory.klDiv (armLaw arm) (referenceArmLaw arm)
theorem BanditRLProof.LowerBounds.klDiv_canonicalBanditHistoryMeasure_eq_sum_realizedExpectedPullCount_mul_armKL Compiled

Lattimore--Szepesvari Lemma 15.1 in the repository's inclusive-round convention. `canonicalBanditHistoryMeasure ... n` contains exactly `n + 1` action/reward pairs. Its directed KL divergence is the finite-arm sum of the first-environment lower integrals of the realized pull counts through round `n`, multiplied by the arm-law KL divergences. The algorithm is one common, possibly randomized, nonanticipating history policy in both environments.

theorem klDiv_canonicalBanditHistoryMeasure_eq_sum_realizedExpectedPullCount_mul_armKL {K : Nat} {Reward : Type v} [MeasurableSpace Reward] [MeasurableSpace.CountablyGenerated Reward] (algorithm : Thompson.HistoryAlgorithm (Fin K) Reward) (armLaw referenceArmLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] [IsMarkovKernel referenceArmLaw] (n : Nat) : InformationTheory.klDiv (canonicalBanditHistoryMeasure algorithm armLaw n) (canonicalBanditHistoryMeasure algorithm referenceArmLaw n) = ∑ arm : Fin K, canonicalRealizedExpectedPullCountThrough algorithm armLaw n arm * InformationTheory.klDiv (armLaw arm) (referenceArmLaw arm)
theorem BanditRLProof.LowerBounds.banditHistoryRelativeEntropy_eq_expectedPulls_sum Compiled

Source-facing name for Lattimore--Szepesvari Lemma 15.1 / Eq. (15.1). The local history index `lastRound` represents exactly `lastRound + 1` pulls.

theorem banditHistoryRelativeEntropy_eq_expectedPulls_sum {K : Nat} {Reward : Type v} [MeasurableSpace Reward] [MeasurableSpace.CountablyGenerated Reward] (algorithm : Thompson.HistoryAlgorithm (Fin K) Reward) (armLaw referenceArmLaw : Kernel (Fin K) Reward) [IsMarkovKernel armLaw] [IsMarkovKernel referenceArmLaw] (lastRound : Nat) : InformationTheory.klDiv (canonicalBanditHistoryMeasure algorithm armLaw lastRound) (canonicalBanditHistoryMeasure algorithm referenceArmLaw lastRound) = ∑ arm : Fin K, canonicalRealizedExpectedPullCountThrough algorithm armLaw lastRound arm * InformationTheory.klDiv (armLaw arm) (referenceArmLaw arm)