Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 4.1 (Theorem A.1): MBPO performance bound

Proved
WhenToTrustYourModel.mbpo_performance_bound

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

markov-decision-processmodel-based-rlreinforcement-learningtotal-variation

Consider a discounted Markov decision process with finite state and action sets, true dynamics ppp, discount γ∈(0,1)\gamma\in(0,1)γ∈(0,1), a reward with ∣r(s,a)∣≤rmax⁡|r(s,a)|\le r_{\max}∣r(s,a)∣≤rmax​ and an initial distribution ρ0\rho_0ρ0​. Let p^\hat pp^​ be a learned model of the dynamics, πD\pi_DπD​ the data-collecting policy and π\piπ a new policy. Write η[π]\eta[\pi]η[π] for the return of π\piπ under ppp, η^[π]\hat\eta[\pi]η^​[π] for its return under p^\hat pp^​, and πD,t\pi_{D,t}πD,t​ for the state marginal at time ttt of πD\pi_DπD​ under ppp. Suppose

max⁡tEs∼πD,t, a∼πD(⋅∣s)[DTV(p(⋅∣s,a)∥p^(⋅∣s,a))]≤ϵm,max⁡sDTV(πD(⋅∣s)∥π(⋅∣s))≤ϵπ.\max_t E_{s\sim\pi_{D,t},\,a\sim\pi_D(\cdot\mid s)}\big[D_{TV}\big(p(\cdot\mid s,a)\|\hat p(\cdot\mid s,a)\big)\big]\le\epsilon_m,\qquad \max_s D_{TV}\big(\pi_D(\cdot\mid s)\|\pi(\cdot\mid s)\big)\le\epsilon_\pi .tmax​Es∼πD,t​,a∼πD​(⋅∣s)​[DTV​(p(⋅∣s,a)∥p^​(⋅∣s,a))]≤ϵm​,smax​DTV​(πD​(⋅∣s)∥π(⋅∣s))≤ϵπ​.

Then

η[π]≥η^[π]−[2γrmax⁡(ϵm+2ϵπ)(1−γ)2+4rmax⁡ϵπ1−γ].\eta[\pi]\ge\hat\eta[\pi]-\left[\frac{2\gamma r_{\max}(\epsilon_m+2\epsilon_\pi)}{(1-\gamma)^2}+\frac{4r_{\max}\epsilon_\pi}{1-\gamma}\right].η[π]≥η^​[π]−[(1−γ)22γrmax​(ϵm​+2ϵπ​)​+1−γ4rmax​ϵπ​​].

Any improvement of the model return by more than the bracket C(ϵm,ϵπ)C(\epsilon_m,\epsilon_\pi)C(ϵm​,ϵπ​) is therefore an improvement of the true return: this is the monotonic-improvement guarantee behind model-based policy optimization.

Formalization Note Theorem 4.1 measures the total variation of the joint law p(s′,r∣s,a)p(s',r\mid s,a)p(s′,r∣s,a) of next state and reward, with a learned reward; the appendix version (Theorem A.1), which is the one proved, uses the dynamics p(s′∣s,a)p(s'\mid s,a)p(s′∣s,a) and a known reward. The Lean statement is Theorem A.1. The paper does not say how actions are drawn in the model error; they are drawn from πD\pi_DπD​, the policy whose data the model is trained on.

Preamble
import Mathlib
import Definitions.Def_WhenToTrustYourModel_Basic

open Finset
Formal statement
namespace WhenToTrustYourModel

theorem mbpo_performance_bound {S A : Type*} [Fintype S] [Fintype A]
    (γ : ℝ) (hγ₀ : 0 < γ) (hγ₁ : γ < 1)
    (r : S → A → ℝ) (rmax : ℝ) (hr : ∀ s a, |r s a| ≤ rmax)
    (ρ₀ : S → ℝ) (hρ₀ : IsDist ρ₀)
    (π πD : S → A → ℝ) (hπ : IsPolicy π) (hπD : IsPolicy πD)
    (P Phat : S → A → S → ℝ) (hP : IsDynamics P) (hPhat : IsDynamics Phat)
    (εm επ : ℝ)
    (hm : ∀ t, expectedTV (stateDist ρ₀ (fun _ => πD) (fun _ => P) t) πD P Phat ≤ εm)
    (hdiv : ∀ s, tvDist (πD s) (π s) ≤ επ) :
    policyReturn γ r ρ₀ π Phat
        - (2 * γ * rmax * (εm + 2 * επ) / (1 - γ) ^ 2 + 4 * rmax * επ / (1 - γ)) ≤
      policyReturn γ r ρ₀ π P := by sorry

end WhenToTrustYourModel
Source
Janner, Fu, Zhang and Levine, When to Trust Your Model: Model-Based Policy Optimization, arXiv:1906.08253v3 (NeurIPS 2019), Section 4.1, Theorem 4.1, eq. (1), p. 4; proof as Theorem A.1, Appendix A, p. 13
Read-back

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

Fix finite sets SSS (states) and AAA (actions). Either could in principle be empty, but the hypotheses below force both to be nonempty: ρ0\rho_0ρ0​ must have total mass 111, and each π(⋅∣s)\pi(\cdot\mid s)π(⋅∣s) must be a distribution on AAA.

Data and hypotheses. The theorem quantifies over all of the following.

  • A discount factor γ\gammaγ with 0<γ<10<\gamma<10<γ<1 (strict on both sides).
  • A reward function r:S×A→Rr : S\times A\to\mathbb Rr:S×A→R and a real number rmax⁡r_{\max}rmax​ with ∣r(s,a)∣≤rmax⁡|r(s,a)|\le r_{\max}∣r(s,a)∣≤rmax​ for every s,as,as,a. Since SSS and AAA are nonempty, this forces rmax⁡≥0r_{\max}\ge 0rmax​≥0.
  • An initial state distribution ρ0\rho_0ρ0​ on SSS: ρ0(s)≥0\rho_0(s)\ge 0ρ0​(s)≥0 and ∑sρ0(s)=1\sum_s\rho_0(s)=1∑s​ρ0​(s)=1.
  • Two policies π\piπ and πD\pi_DπD​. For each state sss, π(⋅∣s)\pi(\cdot\mid s)π(⋅∣s) and πD(⋅∣s)\pi_D(\cdot\mid s)πD​(⋅∣s) are probability distributions on AAA (nonnegative, summing to 111).
  • Two transition kernels PPP and P^\hat PP^. For each pair (s,a)(s,a)(s,a), P(⋅∣s,a)P(\cdot\mid s,a)P(⋅∣s,a) and P^(⋅∣s,a)\hat P(\cdot\mid s,a)P^(⋅∣s,a) are probability distributions on SSS.
  • Two real numbers εm\varepsilon_mεm​ and επ\varepsilon_\piεπ​. No sign is assumed, but the two hypotheses below force both to be ≥0\ge 0≥0, because total variation is nonnegative.

Total variation. For functions μ,ν\mu,\nuμ,ν on a finite set,

DTV(μ ∥ ν)=12∑x∣μ(x)−ν(x)∣.D_{TV}(\mu\,\|\,\nu)=\tfrac12\sum_x|\mu(x)-\nu(x)|.DTV​(μ∥ν)=21​x∑​∣μ(x)−ν(x)∣.

State marginals. For a stationary policy σ\sigmaσ and kernel QQQ, the time-ttt state marginal pσ,Qtp^t_{\sigma,Q}pσ,Qt​ is defined recursively:

pσ,Q0=ρ0,pσ,Qt+1(s′)=∑s∈Spσ,Qt(s)∑a∈Aσ(a∣s) Q(s′∣s,a).p^0_{\sigma,Q}=\rho_0,\qquad p^{t+1}_{\sigma,Q}(s')=\sum_{s\in S}p^t_{\sigma,Q}(s)\sum_{a\in A}\sigma(a\mid s)\,Q(s'\mid s,a).pσ,Q0​=ρ0​,pσ,Qt+1​(s′)=s∈S∑​pσ,Qt​(s)a∈A∑​σ(a∣s)Q(s′∣s,a).

Model-error hypothesis. For every time t∈Nt\in\mathbb Nt∈N, measured along the marginal of πD\pi_DπD​ under the true kernel PPP, with actions drawn from πD\pi_DπD​:

∑spπD,Pt(s)∑aπD(a∣s) DTV(P(⋅∣s,a) ∥ P^(⋅∣s,a))  ≤  εm.\sum_{s}p^t_{\pi_D,P}(s)\sum_{a}\pi_D(a\mid s)\,D_{TV}\big(P(\cdot\mid s,a)\,\|\,\hat P(\cdot\mid s,a)\big)\;\le\;\varepsilon_m.s∑​pπD​,Pt​(s)a∑​πD​(a∣s)DTV​(P(⋅∣s,a)∥P^(⋅∣s,a))≤εm​.

This is a bound uniform in ttt, imposed separately at each time step. It is not a bound on a discounted or averaged state distribution.

Policy-divergence hypothesis. For every state sss:

DTV(πD(⋅∣s) ∥ π(⋅∣s))≤επ.D_{TV}\big(\pi_D(\cdot\mid s)\,\|\,\pi(\cdot\mid s)\big)\le\varepsilon_\pi.DTV​(πD​(⋅∣s)∥π(⋅∣s))≤επ​.

Returns. The return of π\piπ under a kernel QQQ is

ηQ[π]=∑t=0∞γt∑s∑apπ,Qt(s) π(a∣s) r(s,a).\eta_Q[\pi]=\sum_{t=0}^{\infty}\gamma^t\sum_{s}\sum_{a}p^t_{\pi,Q}(s)\,\pi(a\mid s)\,r(s,a).ηQ​[π]=t=0∑∞​γts∑​a∑​pπ,Qt​(s)π(a∣s)r(s,a).

The infinite sum is taken with the convention that it equals 000 if the series is not summable. Under the stated hypotheses, each inner sum is bounded by rmax⁡r_{\max}rmax​ in absolute value and 0<γ<10<\gamma<10<γ<1, so the series converges absolutely.

Conclusion. The theorem asserts the one-sided inequality

ηP^[π]  −  (2γ rmax⁡ (εm+2επ)(1−γ)2+4 rmax⁡ επ1−γ)  ≤  ηP[π].\eta_{\hat P}[\pi]\;-\;\left(\frac{2\gamma\,r_{\max}\,(\varepsilon_m+2\varepsilon_\pi)}{(1-\gamma)^2}+\frac{4\,r_{\max}\,\varepsilon_\pi}{1-\gamma}\right)\;\le\;\eta_P[\pi].ηP^​[π]−((1−γ)22γrmax​(εm​+2επ​)​+1−γ4rmax​επ​​)≤ηP​[π].

In words, the true return of π\piπ is at least its return under the model P^\hat PP^, minus the displayed penalty. Only this lower bound on ηP[π]\eta_P[\pi]ηP​[π] is stated. No upper bound, and no bound on ∣ηP[π]−ηP^[π]∣|\eta_P[\pi]-\eta_{\hat P}[\pi]|∣ηP​[π]−ηP^​[π]∣, is asserted.

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