Lemma B.3 (as proved): returns bound
ProvedWhenToTrustYourModel.returns_boundConsider a discounted Markov decision process with finite state and action sets, discount , a reward with and an initial distribution . Let be the return of policy under dynamics , and the return of policy under dynamics , both started from , and let be the state marginal at time of the first process. Suppose
Then
This is the basic simulation bound from which Theorem 4.1 is assembled.
Formalization Note The paper's statement assumes a bound on an expected KL divergence of , but the proof uses the total variation of the dynamics, through Lemma B.2 with , and that is how the lemma is applied in Theorem A.1. With the KL hypothesis the statement is false. The Lean statement uses the total variation of the dynamics, averaged over and , as proved. The paper's constant is .
import Mathlib import Definitions.Def_WhenToTrustYourModel_Basic open Finset
namespace WhenToTrustYourModel
theorem returns_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 ρ₀)
(π₁ π₂ : S → A → ℝ) (hπ₁ : IsPolicy π₁) (hπ₂ : IsPolicy π₂)
(P₁ P₂ : S → A → S → ℝ) (hP₁ : IsDynamics P₁) (hP₂ : IsDynamics P₂)
(εm επ : ℝ)
(hm : ∀ t, expectedTV (stateDist ρ₀ (fun _ => π₁) (fun _ => P₁) t) π₁ P₁ P₂ ≤ εm)
(hπ : ∀ s, tvDist (π₁ s) (π₂ s) ≤ επ) :
|policyReturn γ r ρ₀ π₁ P₁ - policyReturn γ r ρ₀ π₂ P₂| ≤
2 * rmax * γ * (επ + εm) / (1 - γ) ^ 2 + 2 * rmax * επ / (1 - γ) := by sorry
end WhenToTrustYourModelRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Fix finite sets (states) and (actions). A distribution on a finite set is a function with for every and . The total variation distance between any two real functions on is
A policy is a function such that is a distribution on for every state . A dynamics is a function such that is a distribution on for every pair .
For a policy , a dynamics and an initial function , the state marginals for are defined recursively:
The return of under , with discount and reward , is the infinite series
This series is taken with the convention that a non-summable series is assigned the value .
Hypotheses. The theorem takes the following data and assumptions:
- a real number with ;
- a reward function and a real number with for all (nonnegativity of is not assumed separately);
- a distribution on ;
- two policies ;
- two dynamics ;
- real numbers satisfying the two conditions below.
The model-error condition must hold for every time :
Here the expectation is taken only over the state marginals of the process run with and , with actions drawn from . It is not a worst case over states.
The policy-divergence condition must hold uniformly over every state :
Edge cases. The total mass condition on cannot hold if is empty, and the policy condition cannot hold if is empty while is nonempty. So the hypotheses force and to be nonempty. That in turn forces . The two conditions above also force and .
Conclusion. The theorem asserts
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.