Lean module · Finite-horizon RL
BanditRLProof.RL.FiniteHorizonStochasticRewardTrajectory
This module generates finite policy trajectories whose coordinates retain the sampled action, sampled Real reward, and next state. Selected rewards need only the L1 mean-compatibility contract from the stochastic Bellman layer. The cumulative sampled reward is proved integrable recursively and its expectation is identified with both stochastic and mean policy evaluation.
Module map
Imports
BanditRLProof.RL.FiniteHorizonStochasticRewardBellman
Imported by
BanditRLProof, BanditRLProof.RL.FiniteHorizonStochasticRewardMarginal
Declarations
Open an item to read its exact compact statement and source link. Detailed teaching notes are linked when registered.
abbrev
BanditRLProof.FiniteHorizonRL.RewardStepTrace
Compiled
A finite trace of sampled action, reward, and resulting next state.
Used in these reading views: Bandit Book · Reinforcement Learning Book
9. Finite-horizon reinforcement learning
Canonical node identity
declaration:BanditRLProof.FiniteHorizonRL.RewardStepTraceReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
abbrev RewardStepTrace (Action : Type v) (State : Type u) (n : Nat)
theorem
BanditRLProof.FiniteHorizonRL.RewardStepTrace.measurable_cons
Compiled
Prepending a sampled action-reward-state coordinate is measurable.
Used in these reading views: Bandit Book · Reinforcement Learning Book
9. Finite-horizon reinforcement learning
Canonical node identity
declaration:BanditRLProof.FiniteHorizonRL.RewardStepTrace.measurable_consReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem measurable_cons (n : Nat) : Measurable (fun p : Prod (Prod Action (Prod Real State)) (RewardStepTrace Action State n) => @Fin.cons n (fun _ => Prod Action (Prod Real State)) p.1 p.2)
theorem
BanditRLProof.FiniteHorizonRL.RewardStepTrace.measurable_tail
Compiled
Removing the first sampled coordinate is measurable.
Used in these reading views: Bandit Book · Reinforcement Learning Book
9. Finite-horizon reinforcement learning
Canonical node identity
declaration:BanditRLProof.FiniteHorizonRL.RewardStepTrace.measurable_tailReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem measurable_tail (n : Nat) : Measurable (fun trace : RewardStepTrace Action State (n + 1) => Fin.tail trace)
theorem
BanditRLProof.FiniteHorizonRL.integrable_of_fintype_aestronglyMeasurable
Compiled
An a.e. strongly measurable Real function on a finite type is integrable.
Used in these reading views: Bandit Book · Reinforcement Learning Book
9. Finite-horizon reinforcement learning
Canonical node identity
declaration:BanditRLProof.FiniteHorizonRL.integrable_of_fintype_aestronglyMeasurableReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem integrable_of_fintype_aestronglyMeasurable {Omega : Type*} [Fintype Omega] [MeasurableSpace Omega] (mu : Measure Omega) [IsFiniteMeasure mu] (f : Omega -> Real) (hf : AEStronglyMeasurable f mu) : Integrable f mu
def
BanditRLProof.FiniteHorizonRL.MDP.MeanCompatibleRewardKernel.actionRewardStateKernel
Compiled
One policy action followed by its sampled reward and next state.
Used in these reading views: Bandit Book · Reinforcement Learning Book
9. Finite-horizon reinforcement learning
Canonical node identity
declaration:BanditRLProof.FiniteHorizonRL.MDP.MeanCompatibleRewardKernel.actionRewardStateKernelReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
noncomputable def actionRewardStateKernel (source : MeanCompatibleRewardKernel mdp) (policy : MarkovPolicy mdp) (stage : Fin mdp.horizon) : ProbabilityTheory.Kernel State (Prod Action (Prod Real State))
def
BanditRLProof.FiniteHorizonRL.MDP.MeanCompatibleRewardKernel.stochasticTrajectoryKernelRemaining
Compiled
Kernel of the next `remaining` sampled action-reward-state coordinates. The first chronological stage is `mdp.horizon - remaining`.
Used in these reading views: Bandit Book · Reinforcement Learning Book
9. Finite-horizon reinforcement learning
Canonical node identity
declaration:BanditRLProof.FiniteHorizonRL.MDP.MeanCompatibleRewardKernel.stochasticTrajectoryKernelRemainingReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
noncomputable def stochasticTrajectoryKernelRemaining (source : MeanCompatibleRewardKernel mdp) (policy : MarkovPolicy mdp) : (remaining : Nat) -> remaining <= mdp.horizon -> ProbabilityTheory.Kernel State (RewardStepTrace Action State remaining) | 0, _ => ProbabilityTheory.Kernel.deterministic (fun _ => fun i => Fin.elim0 i) measurable_const | remaining + 1, hremaining => let stage : Fin mdp.horizon := ⟨mdp.horizon - (remaining + 1), by omega⟩ let tailKernel : ProbabilityTheory.Kernel (Prod State (Prod Action (Prod Real State))) (RewardStepTrace Action State remaining)
def
BanditRLProof.FiniteHorizonRL.MDP.sampledCumulativeRewardFrom
Compiled
Sum of the actual sampled rewards in a reward-bearing finite trace.
Used in these reading views: Bandit Book · Reinforcement Learning Book
9. Finite-horizon reinforcement learning
Canonical node identity
declaration:BanditRLProof.FiniteHorizonRL.MDP.sampledCumulativeRewardFromReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
def sampledCumulativeRewardFrom : (remaining : Nat) -> RewardStepTrace Action State remaining -> Real | 0, _ => 0 | remaining + 1, trace => (trace 0).2.1 + sampledCumulativeRewardFrom remaining (Fin.tail trace) omit [Fintype State] [Fintype Action] in /-- The sampled finite cumulative reward is measurable. -/ theorem measurable_sampledCumulativeRewardFrom (remaining : Nat) : Measurable (sampledCumulativeRewardFrom (Action := Action) (State := State) remaining)
theorem
BanditRLProof.FiniteHorizonRL.MDP.measurable_sampledCumulativeRewardFrom
Compiled
The sampled finite cumulative reward is measurable.
Used in these reading views: Bandit Book · Reinforcement Learning Book
9. Finite-horizon reinforcement learning
Canonical node identity
declaration:BanditRLProof.FiniteHorizonRL.MDP.measurable_sampledCumulativeRewardFromReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem measurable_sampledCumulativeRewardFrom (remaining : Nat) : Measurable (sampledCumulativeRewardFrom (Action := Action) (State := State) remaining)
theorem
BanditRLProof.FiniteHorizonRL.MDP.MeanCompatibleRewardKernel.integrable_sampledCumulativeRewardFrom_stochasticTrajectoryKernelRemaining
Compiled
The sampled cumulative reward is `L1` under every statewise stochastic trajectory law. No boundedness or second-moment hypothesis is used.
Used in these reading views: Bandit Book · Reinforcement Learning Book
9. Finite-horizon reinforcement learning
Canonical node identity
declaration:BanditRLProof.FiniteHorizonRL.MDP.MeanCompatibleRewardKernel.integrable_sampledCumulativeRewardFrom_stochasticTrajectoryKernelRemainingReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem integrable_sampledCumulativeRewardFrom_stochasticTrajectoryKernelRemaining (source : MeanCompatibleRewardKernel mdp) (policy : MarkovPolicy mdp) (remaining : Nat) (hremaining : remaining <= mdp.horizon) (state : State) : Integrable (MDP.sampledCumulativeRewardFrom (Action := Action) (State := State) remaining) (source.stochasticTrajectoryKernelRemaining policy remaining hremaining state)
theorem
BanditRLProof.FiniteHorizonRL.MDP.MeanCompatibleRewardKernel.integral_sampledCumulativeRewardFrom_stochasticTrajectoryKernelRemaining_eq_stochasticValueRemaining
Compiled
Statewise stochastic trajectory identity: expected sampled cumulative reward equals the independently defined stochastic backward policy value.
Used in these reading views: Bandit Book · Reinforcement Learning Book
9. Finite-horizon reinforcement learning
Canonical node identity
declaration:BanditRLProof.FiniteHorizonRL.MDP.MeanCompatibleRewardKernel.integral_sampledCumulativeRewardFrom_stochasticTrajectoryKernelRemaining_eq_stochasticValueRemainingReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem integral_sampledCumulativeRewardFrom_stochasticTrajectoryKernelRemaining_eq_stochasticValueRemaining (source : MeanCompatibleRewardKernel mdp) (policy : MarkovPolicy mdp) (remaining : Nat) (hremaining : remaining <= mdp.horizon) (state : State) : integral (source.stochasticTrajectoryKernelRemaining policy remaining hremaining state) (MDP.sampledCumulativeRewardFrom (Action := Action) (State := State) remaining) = source.stochasticValueRemaining policy remaining hremaining state
def
BanditRLProof.FiniteHorizonRL.MDP.MeanCompatibleRewardKernel.stochasticTrajectoryMeasure
Compiled
Full reward-bearing trajectory law, including the initial state.
Used in these reading views: Bandit Book · Reinforcement Learning Book
9. Finite-horizon reinforcement learning
Canonical node identity
declaration:BanditRLProof.FiniteHorizonRL.MDP.MeanCompatibleRewardKernel.stochasticTrajectoryMeasureReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
noncomputable def stochasticTrajectoryMeasure (source : MeanCompatibleRewardKernel mdp) (policy : MarkovPolicy mdp) (initialState : Measure State) : Measure (Prod State (RewardStepTrace Action State mdp.horizon))
def
BanditRLProof.FiniteHorizonRL.MDP.MeanCompatibleRewardKernel.sampledCumulativeReward
Compiled
Sampled cumulative reward on the full stochastic trajectory.
Used in these reading views: Bandit Book · Reinforcement Learning Book
9. Finite-horizon reinforcement learning
Canonical node identity
declaration:BanditRLProof.FiniteHorizonRL.MDP.MeanCompatibleRewardKernel.sampledCumulativeRewardReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
def sampledCumulativeReward (trajectory : Prod State (RewardStepTrace Action State mdp.horizon)) : Real
theorem
BanditRLProof.FiniteHorizonRL.MDP.MeanCompatibleRewardKernel.measurable_sampledCumulativeReward
Compiled
The full sampled cumulative reward is measurable.
Used in these reading views: Bandit Book · Reinforcement Learning Book
9. Finite-horizon reinforcement learning
Canonical node identity
declaration:BanditRLProof.FiniteHorizonRL.MDP.MeanCompatibleRewardKernel.measurable_sampledCumulativeRewardReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem measurable_sampledCumulativeReward : Measurable (sampledCumulativeReward (mdp := mdp))
theorem
BanditRLProof.FiniteHorizonRL.MDP.MeanCompatibleRewardKernel.integrable_sampledCumulativeReward_stochasticTrajectoryMeasure
Compiled
The full sampled cumulative reward is integrable under its generated law.
Used in these reading views: Bandit Book · Reinforcement Learning Book
9. Finite-horizon reinforcement learning
Canonical node identity
declaration:BanditRLProof.FiniteHorizonRL.MDP.MeanCompatibleRewardKernel.integrable_sampledCumulativeReward_stochasticTrajectoryMeasureReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem integrable_sampledCumulativeReward_stochasticTrajectoryMeasure (source : MeanCompatibleRewardKernel mdp) (policy : MarkovPolicy mdp) (initialState : Measure State) [IsProbabilityMeasure initialState] : Integrable (sampledCumulativeReward (mdp := mdp)) (source.stochasticTrajectoryMeasure policy initialState)
theorem
BanditRLProof.FiniteHorizonRL.MDP.MeanCompatibleRewardKernel.integral_sampledCumulativeReward_stochasticTrajectoryMeasure_eq_integral_valueAt_zero
Compiled
Route endpoint: expected sampled cumulative reward equals the stochastic and existing mean policy values at chronological stage zero.
Used in these reading views: Bandit Book · Reinforcement Learning Book
9. Finite-horizon reinforcement learning
Canonical node identity
declaration:BanditRLProof.FiniteHorizonRL.MDP.MeanCompatibleRewardKernel.integral_sampledCumulativeReward_stochasticTrajectoryMeasure_eq_integral_valueAt_zeroReading membership is not a proof dependency. Exact assumptions remain in the Lean statement.
theorem integral_sampledCumulativeReward_stochasticTrajectoryMeasure_eq_integral_valueAt_zero (source : MeanCompatibleRewardKernel mdp) (policy : MarkovPolicy mdp) (initialState : Measure State) [IsProbabilityMeasure initialState] : integral (source.stochasticTrajectoryMeasure policy initialState) (sampledCumulativeReward (mdp := mdp)) = integral initialState (source.stochasticValueAt policy 0 (Nat.zero_le mdp.horizon)) ∧ integral (source.stochasticTrajectoryMeasure policy initialState) (sampledCumulativeReward (mdp := mdp)) = integral initialState (policy.valueAt 0 (Nat.zero_le mdp.horizon))