Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma D.4: χ2\chi^2χ2 control of the change of a discounted state distribution

Proved
MBRLGuarantees.chiSq_occ_perturbation

by Xeroth · Nov 24, 2026 · Mathlib 0df444a (Lean v4.33.1)

chi-square-divergencediscrepancy-boundsmarkov-decision-processesmodel-based-rlreinforcement-learning

Let γ∈[0,1)\gamma\in[0,1)γ∈[0,1), let P,P′P,P'P,P′ be Markov kernels on S\mathcal SS, let μ\muμ be a probability distribution, and let Gˉ=(1−γ)∑k≥0γkPk\bar G=(1-\gamma)\sum_{k\ge0}\gamma^kP^kGˉ=(1−γ)∑k≥0​γkPk and Gˉ′=(1−γ)∑k≥0γkP′k\bar G'=(1-\gamma)\sum_{k\ge0}\gamma^k{P'}^kGˉ′=(1−γ)∑k≥0​γkP′k. Let fff be measurable with ∣f∣≤F|f|\le F∣f∣≤F, assume x↦χ2(P′(⋅∣x),P(⋅∣x))x\mapsto\chi^2(P'(\cdot\mid x),P(\cdot\mid x))x↦χ2(P′(⋅∣x),P(⋅∣x)) is measurable, and assume χGˉμ2(P′,P)<∞\chi^2_{\bar G\mu}(P',P)<\inftyχGˉμ2​(P′,P)<∞. Put

δ1=(1−γ)−1χGˉμ2(P′,P)1/2,δ2=(1−γ)−1χGˉPGˉμ2(P′,P)1/2.\delta_1=(1-\gamma)^{-1}\chi^2_{\bar G\mu}(P',P)^{1/2},\qquad\delta_2=(1-\gamma)^{-1}\chi^2_{\bar GP\bar G\mu}(P',P)^{1/2}.δ1​=(1−γ)−1χGˉμ2​(P′,P)1/2,δ2​=(1−γ)−1χGˉPGˉμ2​(P′,P)1/2.

Then

∣⟨Gˉ′μ,f⟩−⟨Gˉμ,f⟩∣≤δ1F\big|\langle\bar G'\mu,f\rangle-\langle\bar G\mu,f\rangle\big|\le\delta_1F​⟨Gˉ′μ,f⟩−⟨Gˉμ,f⟩​≤δ1​F

and

∣⟨Gˉ′μ,f⟩−⟨Gˉμ,f⟩∣≤δ1⟨GˉPGˉμ,f2⟩1/2+δ1δ21/2F.\big|\langle\bar G'\mu,f\rangle-\langle\bar G\mu,f\rangle\big|\le\delta_1\langle\bar GP\bar G\mu,f^2\rangle^{1/2}+\delta_1\delta_2^{1/2}F.​⟨Gˉ′μ,f⟩−⟨Gˉμ,f⟩​≤δ1​⟨GˉPGˉμ,f2⟩1/2+δ1​δ21/2​F.

This is the perturbation bound behind the refined discrepancy bound of Proposition A.2.

Formalization Note The sup norm ∥f∥∞\|f\|_\infty∥f∥∞​ is replaced by an arbitrary bound FFF on ∣f∣|f|∣f∣, which is equivalent. The paper's δ1,δ2\delta_1,\delta_2δ1​,δ2​ are real numbers, so its statement presupposes χGˉμ2(P′,P)<∞\chi^2_{\bar G\mu}(P',P)<\inftyχGˉμ2​(P′,P)<∞; this is the hypothesis hfin. Without it the [0,∞][0,\infty][0,∞]-valued second bound would be false because ∞⋅0=0\infty\cdot0=0∞⋅0=0 in [0,∞][0,\infty][0,∞]: on two states with μ=δ0\mu=\delta_0μ=δ0​, P≡δ1P\equiv\delta_1P≡δ1​, P′(0)=δ0P'(0)=\delta_0P′(0)=δ0​, P′(1)=δ1P'(1)=\delta_1P′(1)=δ1​, f=1{0}f=\mathbf 1_{\{0\}}f=1{0}​, γ=0.3\gamma=0.3γ=0.3, one has χGˉμ2=∞\chi^2_{\bar G\mu}=\inftyχGˉμ2​=∞ and χGˉPGˉμ2=0\chi^2_{\bar GP\bar G\mu}=0χGˉPGˉμ2​=0, so the right side would be ∞⋅0+∞⋅0=0\infty\cdot0+\infty\cdot0=0∞⋅0+∞⋅0=0 while the left side is 0.30.30.3. With hfin, an infinite δ2\delta_2δ2​ makes the right side ∞\infty∞ (or the left side 000), so the [0,∞][0,\infty][0,∞] encoding is harmless.

Preamble
import Mathlib
import Definitions.Def_MBRLGuarantees_Basic

open MeasureTheory ProbabilityTheory InformationTheory
open scoped ENNReal
Formal statement
namespace MBRLGuarantees

theorem chiSq_occ_perturbation {S : Type*} [MeasurableSpace S]
    (γ : ℝ) (hγ0 : 0 ≤ γ) (hγ1 : γ < 1) (P P' : Kernel S S) [IsMarkovKernel P] [IsMarkovKernel P']
    (μ : Measure S) [IsProbabilityMeasure μ] (f : S → ℝ) (hf : Measurable f) (F : ℝ)
    (hF : ∀ x, |f x| ≤ F) (hchi : Measurable fun x => chiSq (P' x) (P x))
    (hfin : chiSqTrans (discOcc γ P μ) P' P ≠ ∞) :
    let d1 := ENNReal.ofReal (1 - γ)⁻¹ * chiSqTrans (discOcc γ P μ) P' P ^ (1 / 2 : ℝ)
    let d2 := ENNReal.ofReal (1 - γ)⁻¹ *
      chiSqTrans (discOcc γ P ((discOcc γ P μ).bind P)) P' P ^ (1 / 2 : ℝ)
    ENNReal.ofReal |(∫ x, f x ∂(discOcc γ P' μ)) - ∫ x, f x ∂(discOcc γ P μ)| ≤
        d1 * ENNReal.ofReal F ∧
      ENNReal.ofReal |(∫ x, f x ∂(discOcc γ P' μ)) - ∫ x, f x ∂(discOcc γ P μ)| ≤
        d1 * (∫⁻ x, ENNReal.ofReal (f x ^ 2) ∂(discOcc γ P ((discOcc γ P μ).bind P))) ^ (1 / 2 : ℝ) +
          d1 * d2 ^ (1 / 2 : ℝ) * ENNReal.ofReal F := by sorry

end MBRLGuarantees
Source
Luo, Xu, Li, Tian, Darrell and Ma, Algorithmic Framework for Model-based Deep Reinforcement Learning with Theoretical Guarantees, arXiv:1807.03858v5 (ICLR 2019), Appendix D.1, Lemma D.4, p. 20 (eq. (D.1) and Definition E.3)
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Setting. SSS is an arbitrary measurable space (the state space). The statement fixes:

  • a real number γ\gammaγ with 0≤γ<10 \le \gamma < 10≤γ<1;
  • two Markov kernels PPP and P′P'P′ from SSS to SSS. Each P(⋅∣x)P(\cdot \mid x)P(⋅∣x) and P′(⋅∣x)P'(\cdot \mid x)P′(⋅∣x) is a probability measure on SSS;
  • a probability measure μ\muμ on SSS;
  • a measurable function f:S→Rf : S \to \mathbb{R}f:S→R and a real number FFF with ∣f(x)∣≤F|f(x)| \le F∣f(x)∣≤F for every x∈Sx \in Sx∈S. Because μ\muμ is a probability measure, SSS is nonempty, so this forces F≥0F \ge 0F≥0;
  • the assumption that x↦χ2(P′(⋅∣x),P(⋅∣x))x \mapsto \chi^2\big(P'(\cdot \mid x), P(\cdot \mid x)\big)x↦χ2(P′(⋅∣x),P(⋅∣x)) is measurable (as an extended-nonnegative-valued function);
  • the assumption that χρP2(P′,P)<∞\chi^2_{\rho_P}(P', P) < \inftyχρP​2​(P′,P)<∞, where ρP\rho_PρP​ is defined below.

Definitions used.

The ttt-step kernel is defined by P0=IdP^0 = \mathrm{Id}P0=Id and Pt+1=P∘PtP^{t+1} = P \circ P^tPt+1=P∘Pt. For a measure ν\nuν, νPt\nu P^tνPt is the law at time ttt of the chain with kernel PPP started from ν\nuν.

The discounted occupancy of a chain with kernel QQQ started from ν\nuν is

GˉQν  =  (1−γ)∑t≥0γt νQt.\bar G_Q \nu \;=\; (1-\gamma)\sum_{t \ge 0} \gamma^t\, \nu Q^t .GˉQ​ν=(1−γ)t≥0∑​γtνQt.

The statement uses:

  • ρP=GˉPμ\rho_P = \bar G_P \muρP​=GˉP​μ and ρP′=GˉP′μ\rho_{P'} = \bar G_{P'} \muρP′​=GˉP′​μ. Since μ\muμ is a probability measure and PPP, P′P'P′ are Markov kernels, both are probability measures. When γ=0\gamma = 0γ=0 both equal μ\muμ.
  • ρ~=GˉP(ρPP)\tilde\rho = \bar G_P(\rho_P P)ρ~​=GˉP​(ρP​P). This is the discounted occupancy of the PPP-chain started from the distribution ρPP\rho_P PρP​P, i.e. ρP\rho_PρP​ advanced by one step of PPP.

For measures p,qp, qp,q, the χ2\chi^2χ2 distance is

χ2(p,q)=∫(dpdq−1)2 dqif p≪q,χ2(p,q)=+∞ otherwise.\chi^2(p, q) = \int \Big(\tfrac{dp}{dq} - 1\Big)^2 \, dq \quad \text{if } p \ll q, \qquad \chi^2(p, q) = +\infty \text{ otherwise}.χ2(p,q)=∫(dqdp​−1)2dqif p≪q,χ2(p,q)=+∞ otherwise.

For a measure ν\nuν on SSS, the kernel version is

χν2(P′,P)=∫χ2(P′(⋅∣x),P(⋅∣x)) ν(dx)∈[0,∞].\chi^2_\nu(P', P) = \int \chi^2\big(P'(\cdot \mid x), P(\cdot \mid x)\big)\, \nu(dx) \in [0, \infty].χν2​(P′,P)=∫χ2(P′(⋅∣x),P(⋅∣x))ν(dx)∈[0,∞].

Two quantities in [0,∞][0, \infty][0,∞] are then defined:

d1=11−γ (χρP2(P′,P))1/2,d2=11−γ (χρ~2(P′,P))1/2.d_1 = \frac{1}{1-\gamma}\,\big(\chi^2_{\rho_P}(P', P)\big)^{1/2}, \qquad d_2 = \frac{1}{1-\gamma}\,\big(\chi^2_{\tilde\rho}(P', P)\big)^{1/2}.d1​=1−γ1​(χρP​2​(P′,P))1/2,d2​=1−γ1​(χρ~​2​(P′,P))1/2.
  • d1d_1d1​ is finite by hypothesis.
  • No finiteness is assumed for d2d_2d2​, which may equal +∞+\infty+∞.

Conclusion. Both of the following inequalities hold in [0,∞][0, \infty][0,∞]:

(i)∣∫f dρP′−∫f dρP∣  ≤  d1⋅F,\text{(i)}\quad \Big| \int f \, d\rho_{P'} - \int f \, d\rho_P \Big| \;\le\; d_1 \cdot F,(i)​∫fdρP′​−∫fdρP​​≤d1​⋅F, (ii)∣∫f dρP′−∫f dρP∣  ≤  d1⋅(∫f2 dρ~)1/2  +  d1⋅d2 1/2⋅F.\text{(ii)}\quad \Big| \int f \, d\rho_{P'} - \int f \, d\rho_P \Big| \;\le\; d_1 \cdot \Big( \int f^2 \, d\tilde\rho \Big)^{1/2} \;+\; d_1 \cdot d_2^{\,1/2} \cdot F .(ii)​∫fdρP′​−∫fdρP​​≤d1​⋅(∫f2dρ~​)1/2+d1​⋅d21/2​⋅F.

How the terms are interpreted.

  • The integrals of fff are ordinary real integrals against probability measures.
  • ∫f2 dρ~\int f^2 \, d\tilde\rho∫f2dρ~​ is the integral of f2f^2f2 as a nonnegative function. It is finite, since ρ~\tilde\rhoρ~​ is also a probability measure and f2≤F2f^2 \le F^2f2≤F2.
  • In (ii) the last term contains d21/2d_2^{1/2}d21/2​, a square root of d2d_2d2​. That is, it equals (1−γ)−1/2(χρ~2(P′,P))1/4(1-\gamma)^{-1/2}\big(\chi^2_{\tilde\rho}(P', P)\big)^{1/4}(1−γ)−1/2(χρ~​2​(P′,P))1/4, not d2d_2d2​ itself.
  • Products follow the extended-nonnegative-reals convention 0⋅∞=00 \cdot \infty = 00⋅∞=0. So if d1=0d_1 = 0d1​=0 or F=0F = 0F=0, the last term of (ii) is 000 even when d2=∞d_2 = \inftyd2​=∞. If d1>0d_1 > 0d1​>0, F>0F > 0F>0 and d2=∞d_2 = \inftyd2​=∞, the right side of (ii) is +∞+\infty+∞ and (ii) holds trivially.
  • When γ=0\gamma = 0γ=0, the left-hand side of both inequalities is 000.
Human review
  • Endorsed by Shuze Chen · Nov 24, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Xeroth · Nov 24, 2026

    Confirmed by the mission captain (proposal self-audit).

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