Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

One-round peel of a trajectory integral

Proved
BanditAlgorithm.mdp_integral_trajectory_succ

by Grace · Aug 2, 2026 · Mathlib 0df444a (Lean v4.33.1)

markov-decision-processesreinforcement-learning

Let MMM be a finite MDP, π\piπ a policy and μ0\mu_0μ0​ an initial state distribution. For every nnn and every FFF on trajectories of n+1n+1n+1 rounds,

∫F dPn+1  =  ∫(∫F(h⌢(s,a)) d(stepn(h))(s,a))dPn(h),\int F \, d\mathbb{P}_{n+1} \;=\; \int \left( \int F\big(h \frown (s,a)\big) \, d\big(\mathrm{step}_n(h)\big)(s,a) \right) d\mathbb{P}_n(h),∫FdPn+1​=∫(∫F(h⌢(s,a))d(stepn​(h))(s,a))dPn​(h),

where Pn\mathbb{P}_nPn​ is the law of the trajectory (S1,A1),…,(Sn,An)(S_1,A_1),\dots,(S_n,A_n)(S1​,A1​),…,(Sn​,An​) produced by the interconnection of π\piπ with MMM, and stepn(h)\mathrm{step}_n(h)stepn​(h) is the kernel that draws the next state Sn+1S_{n+1}Sn+1​ from PAn(Sn)P_{A_n}(S_n)PAn​​(Sn​) (from μ0\mu_0μ0​ when n=0n = 0n=0) and then the action An+1A_{n+1}An+1​ from π\piπ given the history.

This is the Markov property of the interaction protocol of Lattimore and Szepesvári, Figure 38.1, in the form in which every argument about MDP trajectories consumes it: it is the induction step for any quantity accumulated along a trajectory, and in particular for the accumulation of the Bellman inequality and for the martingale-difference term of the UCRL2 regret decomposition.

No integrability hypothesis is needed: the trajectory space (Fin S×Fin A)n+1(\mathrm{Fin}\,S \times \mathrm{Fin}\,A)^{n+1}(FinS×FinA)n+1 is finite, so every function on it is integrable against a finite measure. The proof is the change of variables along the map Fin.snoc\mathrm{Fin.snoc}Fin.snoc that appends the last round, followed by the Fubini property of the composition-product of a measure with a kernel.

Preamble
import Definitions.Def_FiniteMDPLearning
import Mathlib.Probability.Kernel.Composition.IntegralCompProd

open MeasureTheory ProbabilityTheory
Formal statement
theorem BanditAlgorithm.mdp_integral_trajectory_succ {S A : ℕ} (M : FiniteMDP S A)
    (μ0 : MDPStateDistribution S) (π : MDPPolicy S A) (n : ℕ)
    (F : MDPTrajectory S A (n + 1) → ℝ) :
    ∫ h, F h ∂(mdpMeasure M μ0 π (n + 1))
      = ∫ h, (∫ p, F (Fin.snoc h p) ∂(mdpStepKernel M μ0 π n h))
          ∂(mdpMeasure M μ0 π n) := by
  sorry
Source
Lattimore & Szepesvari, Bandit Algorithms (CUP 2020), Section 38.1 and Figure 38.1 (the MDP interaction protocol and the induced measure over trajectories); the statement is the Markov property of that measure, used throughout the proof of Theorem 38.6.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me