Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 1: Lipschitz-valued policies (part 2 as proved)

Proved
DeepMDP.lipschitz_value

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

bisimulation-metricsmarkov-decision-processesreinforcement-learningrepresentation-learningwasserstein-distance

Let Mˉ\bar MMˉ be a (KRˉ,KPˉ)(K_{\bar R},K_{\bar P})(KRˉ​,KPˉ​)-Lipschitz DeepMDP with discount 0≤γ<10\le\gamma<10≤γ<1, bounded measurable rewards, and γKPˉ<1\gamma K_{\bar P}<1γKPˉ​<1 (Assumption 1). Then:

  1. Every optimal policy πˉ∗\bar\pi^*πˉ∗ of Mˉ\bar MMˉ is KRˉ1−γKPˉ\dfrac{K_{\bar R}}{1-\gamma K_{\bar P}}1−γKPˉ​KRˉ​​-Lipschitz-valued.
  2. Let πˉ\bar\piπˉ be a policy whose reward function Rˉπˉ\bar R_{\bar\pi}Rˉπˉ​ is KRˉπˉK_{\bar R_{\bar\pi}}KRˉπˉ​​-Lipschitz and whose transition function satisfies W(Pˉπˉ(⋅∣sˉ1),Pˉπˉ(⋅∣sˉ2))≤KPˉπˉ dSˉ(sˉ1,sˉ2)W(\bar P_{\bar\pi}(\cdot|\bar s_1),\bar P_{\bar\pi}(\cdot|\bar s_2))\le K_{\bar P_{\bar\pi}}\,d_{\bar S}(\bar s_1,\bar s_2)W(Pˉπˉ​(⋅∣sˉ1​),Pˉπˉ​(⋅∣sˉ2​))≤KPˉπˉ​​dSˉ​(sˉ1​,sˉ2​), with γKPˉπˉ<1\gamma K_{\bar P_{\bar\pi}}<1γKPˉπˉ​​<1. Then Vˉπˉ\bar V^{\bar\pi}Vˉπˉ is KRˉπˉ1−γKPˉπˉ\dfrac{K_{\bar R_{\bar\pi}}}{1-\gamma K_{\bar P_{\bar\pi}}}1−γKPˉπˉ​​KRˉπˉ​​​-Lipschitz, and each Qˉπˉ(⋅,a)\bar Q^{\bar\pi}(\cdot,a)Qˉ​πˉ(⋅,a) is Lipschitz.
  3. Every constant policy (πˉ(a∣sˉ1)=πˉ(a∣sˉ2)\bar\pi(a|\bar s_1)=\bar\pi(a|\bar s_2)πˉ(a∣sˉ1​)=πˉ(a∣sˉ2​) for all a,sˉ1,sˉ2a,\bar s_1,\bar s_2a,sˉ1​,sˉ2​) is KRˉ1−γKPˉ\dfrac{K_{\bar R}}{1-\gamma K_{\bar P}}1−γKPˉ​KRˉ​​-Lipschitz-valued.

These are the policies to which the value-difference and representation bounds apply.

Formalization Note Part 2 is stated as the proof in Appendix A.1 establishes it. The printed part 2 claims that πˉ\bar\piπˉ is KRˉπˉ/(1−γKPˉπˉ)K_{\bar R_{\bar\pi}}/(1-\gamma K_{\bar P_{\bar\pi}})KRˉπˉ​​/(1−γKPˉπˉ​​)-Lipschitz-valued under KPˉπˉ≤1/γK_{\bar P_{\bar\pi}}\le1/\gammaKPˉπˉ​​≤1/γ. That fails for Qˉπˉ\bar Q^{\bar\pi}Qˉ​πˉ, whose Lipschitz constant depends on the per-action rewards (see the mission report), and the constant is undefined when γKPˉπˉ=1\gamma K_{\bar P_{\bar\pi}}=1γKPˉπˉ​​=1. The proof shows the bound for Vˉπˉ\bar V^{\bar\pi}Vˉπˉ under γKPˉπˉ<1\gamma K_{\bar P_{\bar\pi}}<1γKPˉπˉ​​<1 and states that Qˉπˉ\bar Q^{\bar\pi}Qˉ​πˉ is also Lipschitz. The Lipschitz constant is passed to Lean's LipschitzWith as a nonnegative real.

Preamble
import Mathlib
import Definitions.Def_DeepMDP_Basic

open MeasureTheory ProbabilityTheory Filter
open scoped ENNReal NNReal
Formal statement
namespace DeepMDP

theorem lipschitz_value {Sb A : Type*} [MetricSpace Sb] [MeasurableSpace Sb] [BorelSpace Sb]
    [Fintype A] [Nonempty A] [MeasurableSpace A] [MeasurableSingletonClass A]
    (Rb : Sb → A → ℝ) (Pb : A → Kernel Sb Sb) (γ : ℝ) (hMb : IsMDP Rb Pb γ)
    (KRb KPb : ℝ≥0) (hLip : IsLipschitzMDP Rb Pb KRb KPb) (hA1 : γ * (KPb : ℝ) < 1) :
    (∀ πs : Kernel Sb A, IsOptimalPolicy Rb Pb γ πs →
      IsLipschitzValued Rb Pb γ πs (Real.toNNReal (KRb / (1 - γ * KPb)))) ∧
    (∀ πb : Kernel Sb A, IsMarkovKernel πb → ∀ KRpi KPpi : ℝ≥0,
      LipschitzWith KRpi (policyReward Rb πb) →
      (∀ x y, wasserstein (policyTrans Pb πb x) (policyTrans Pb πb y) ≤ (KPpi : ℝ≥0∞) * edist x y) →
      γ * (KPpi : ℝ) < 1 →
      LipschitzWith (Real.toNNReal (KRpi / (1 - γ * KPpi))) (vValue Rb Pb γ πb) ∧
        ∀ a, ∃ K : ℝ≥0, LipschitzWith K fun x => qValue Rb Pb γ πb x a) ∧
    (∀ πb : Kernel Sb A, IsMarkovKernel πb → (∀ a x y, πb x {a} = πb y {a}) →
      IsLipschitzValued Rb Pb γ πb (Real.toNNReal (KRb / (1 - γ * KPb)))) := by sorry

end DeepMDP
Source
Gelada, Kumar, Buckman, Nachum and Bellemare, DeepMDP: Learning Continuous Latent Space Models for Representation Learning, arXiv:1906.02736v1 (ICML 2019), Section 2.4, Lemma 1, p. 4; proof in Appendix A.1, p. 16
Read-back

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

Setting. Let (Sˉ,d)(\bar S, d)(Sˉ,d) be a metric space equipped with its Borel σ\sigmaσ-algebra. Let AAA be a finite, nonempty set of actions, with a σ\sigmaσ-algebra in which every singleton {a}\{a\}{a} is measurable. The data are:

  • a reward function Rˉ:Sˉ×A→R\bar R : \bar S \times A \to \mathbb{R}Rˉ:Sˉ×A→R;
  • for each action a∈Aa \in Aa∈A, a measurable kernel Pˉa\bar P_aPˉa​ from Sˉ\bar SSˉ to Sˉ\bar SSˉ, written Pˉ(⋅∣x,a)\bar P(\cdot \mid x, a)Pˉ(⋅∣x,a);
  • a real number γ\gammaγ;
  • two constants KRˉ,KPˉ≥0K_{\bar R}, K_{\bar P} \ge 0KRˉ​,KPˉ​≥0.

Hypotheses.

  1. MDP conditions. 0≤γ<10 \le \gamma < 10≤γ<1. Each Pˉ(⋅∣x,a)\bar P(\cdot\mid x,a)Pˉ(⋅∣x,a) is a probability measure for every xxx and aaa. For each aaa, the map x↦Rˉ(x,a)x \mapsto \bar R(x,a)x↦Rˉ(x,a) is measurable. There is a real constant CCC with ∣Rˉ(x,a)∣≤C|\bar R(x,a)| \le C∣Rˉ(x,a)∣≤C for all x,ax, ax,a.
  2. Lipschitz MDP. For every action aaa and all x,y∈Sˉx, y \in \bar Sx,y∈Sˉ,
∣Rˉ(x,a)−Rˉ(y,a)∣≤KRˉ d(x,y),W(Pˉ(⋅∣x,a),Pˉ(⋅∣y,a))≤KPˉ d(x,y).|\bar R(x,a) - \bar R(y,a)| \le K_{\bar R}\, d(x,y), \qquad W\big(\bar P(\cdot\mid x,a), \bar P(\cdot\mid y,a)\big) \le K_{\bar P}\, d(x,y).∣Rˉ(x,a)−Rˉ(y,a)∣≤KRˉ​d(x,y),W(Pˉ(⋅∣x,a),Pˉ(⋅∣y,a))≤KPˉ​d(x,y).
  1. Contraction. γKPˉ<1\gamma K_{\bar P} < 1γKPˉ​<1.

Here WWW is the Wasserstein-1 quantity with values in [0,∞][0,\infty][0,∞]:

W(μ,ν)=inf⁡λ∫Sˉ×Sˉd(u,v) dλ(u,v).W(\mu,\nu) = \inf_{\lambda} \int_{\bar S\times \bar S} d(u,v)\, d\lambda(u,v).W(μ,ν)=λinf​∫Sˉ×Sˉ​d(u,v)dλ(u,v).

The infimum ranges over all measures λ\lambdaλ on Sˉ×Sˉ\bar S \times \bar SSˉ×Sˉ whose two marginals (pushforwards under the coordinate projections) are exactly μ\muμ and ν\nuν. The integral is the nonnegative extended Lebesgue integral, and the infimum over an empty set of couplings would be +∞+\infty+∞.

Value functions. A policy is a kernel π\piπ from Sˉ\bar SSˉ to AAA. Write π(a∣x)\pi(a\mid x)π(a∣x) for the real number π(x)({a})\pi(x)(\{a\})π(x)({a}). For a policy π\piπ, define iterates by Q0≡0Q_0 \equiv 0Q0​≡0 and

Qn+1(x,a)=Rˉ(x,a)+γ∫Sˉ∑a′∈Aπ(a′∣y) Qn(y,a′) Pˉ(dy∣x,a).Q_{n+1}(x,a) = \bar R(x,a) + \gamma \int_{\bar S} \sum_{a'\in A} \pi(a'\mid y)\, Q_n(y,a')\, \bar P(dy\mid x,a).Qn+1​(x,a)=Rˉ(x,a)+γ∫Sˉ​a′∈A∑​π(a′∣y)Qn​(y,a′)Pˉ(dy∣x,a).

This integral is a Bochner integral, so it is taken to be 000 whenever the integrand is not integrable. From these iterates:

  • Qπ(x,a)Q^\pi(x,a)Qπ(x,a) is the limit of Qn(x,a)Q_n(x,a)Qn​(x,a) as n→∞n\to\inftyn→∞ when that limit exists. When the limit does not exist, Qπ(x,a)Q^\pi(x,a)Qπ(x,a) is an unspecified real number.
  • Vπ(x)=∑aπ(a∣x) Qπ(x,a)V^\pi(x) = \sum_{a} \pi(a\mid x)\, Q^\pi(x,a)Vπ(x)=∑a​π(a∣x)Qπ(x,a).

Derived notions.

  • KKK-Lipschitz. A function fff is KKK-Lipschitz if ∣f(x)−f(y)∣≤K d(x,y)|f(x)-f(y)| \le K\, d(x,y)∣f(x)−f(y)∣≤Kd(x,y) for all x,yx,yx,y.
  • KKK-Lipschitz-valued policy. π\piπ is KKK-Lipschitz-valued if VπV^\piVπ is KKK-Lipschitz and, for every action aaa, x↦Qπ(x,a)x \mapsto Q^\pi(x,a)x↦Qπ(x,a) is KKK-Lipschitz.
  • The constant K∗K^*K∗. Set
K∗=KRˉ1−γKPˉ.K^* = \frac{K_{\bar R}}{1-\gamma K_{\bar P}}.K∗=1−γKPˉ​KRˉ​​.

The denominator is positive by hypothesis 3, so K∗≥0K^* \ge 0K∗≥0.

Conclusion. The theorem asserts the conjunction of the following three statements.

  1. Optimal policies. Let π\piπ be an optimal policy: every π(⋅∣x)\pi(\cdot\mid x)π(⋅∣x) is a probability measure, and Vπ′(x)≤Vπ(x)V^{\pi'}(x) \le V^{\pi}(x)Vπ′(x)≤Vπ(x) for every policy π′\pi'π′ with probability-measure fibres and every xxx. Then π\piπ is K∗K^*K∗-Lipschitz-valued. This part says nothing about whether any optimal policy exists; if none exists, it holds vacuously.

  2. Arbitrary policies under policy-level hypotheses. Let π\piπ be any policy whose fibres are probability measures, and let KRπ,KPπ≥0K_{R\pi}, K_{P\pi} \ge 0KRπ​,KPπ​≥0. Define

rπ(x)=∑aπ(a∣x) Rˉ(x,a),Pπ(⋅∣x)=∑aπ(a∣x) Pˉ(⋅∣x,a).r_\pi(x) = \sum_a \pi(a\mid x)\, \bar R(x,a), \qquad P_\pi(\cdot\mid x) = \sum_a \pi(a\mid x)\, \bar P(\cdot\mid x,a).rπ​(x)=a∑​π(a∣x)Rˉ(x,a),Pπ​(⋅∣x)=a∑​π(a∣x)Pˉ(⋅∣x,a).

Suppose that:

  • rπr_\pirπ​ is KRπK_{R\pi}KRπ​-Lipschitz;
  • W(Pπ(⋅∣x),Pπ(⋅∣y))≤KPπ d(x,y)W\big(P_\pi(\cdot\mid x), P_\pi(\cdot\mid y)\big) \le K_{P\pi}\, d(x,y)W(Pπ​(⋅∣x),Pπ​(⋅∣y))≤KPπ​d(x,y) for all x,yx,yx,y;
  • γKPπ<1\gamma K_{P\pi} < 1γKPπ​<1.

Then:

  • VπV^\piVπ is KRπ1−γKPπ\dfrac{K_{R\pi}}{1-\gamma K_{P\pi}}1−γKPπ​KRπ​​-Lipschitz;
  • for each action aaa there exists some constant K≥0K \ge 0K≥0 (depending on aaa, with no stated bound) such that x↦Qπ(x,a)x \mapsto Q^\pi(x,a)x↦Qπ(x,a) is KKK-Lipschitz.

This part does not use the constants KRˉ,KPˉK_{\bar R}, K_{\bar P}KRˉ​,KPˉ​.

  1. State-independent policies. Let π\piπ be any policy whose fibres are probability measures and whose action probabilities do not depend on the state, i.e. π(a∣x)=π(a∣y)\pi(a\mid x) = \pi(a\mid y)π(a∣x)=π(a∣y) for all a,x,ya, x, ya,x,y. Then π\piπ is K∗K^*K∗-Lipschitz-valued.
Human review
  • Endorsed by Shuze Chen · Nov 23, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Xeroth · Nov 23, 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