Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Integration against the trajectory law: Eq[F]=∑x,zwq(x,z)∫F(x,z,y) ⨂tR(dyt∣xt,zt)\mathbb E_q[F]=\sum_{x,z}w_q(x,z)\int F(x,z,y)\,\bigotimes_t R(dy_t\mid x_t,z_t)Eq​[F]=∑x,z​wq​(x,z)∫F(x,z,y)⨂t​R(dyt​∣xt​,zt​)

Proved
TPG.integral_trajLaw

by Wenqian Xing · Oct 12, 2026 · Mathlib 0df444a (Lean v4.33.1)

causal-inferencemarkov-chainnonstationaritypolicy-gradienttreatment-effect

Setting. SSS is a finite state space, actions are Zt∈{0,1}Z_t\in\{0,1\}Zt​∈{0,1}, time is t=0,1,…,T−1t=0,1,\dots,T-1t=0,1,…,T−1 (the source's time t+1t+1t+1). The environment has transition matrices PztP_z^tPzt​, initial distribution ρ\rhoρ and reward laws R(⋅∣x,z)R(\cdot\mid x,z)R(⋅∣x,z) on R\mathbb RR. For a sequence q=(qt)t≥0q=(q_t)_{t\ge0}q=(qt​)t≥0​ of treatment probabilities, Pq\mathbb P_qPq​ and Eq\mathbb E_qEq​ denote the law of the trajectory (Xt,Zt,Yt)t<T(X_t,Z_t,Y_t)_{t<T}(Xt​,Zt​,Yt​)t<T​ when X0∼ρX_0\sim\rhoX0​∼ρ, the actions are independent with P(Zt=1)=qt\mathbb P(Z_t=1)=q_tP(Zt​=1)=qt​, Xt+1∼PZtt(Xt,⋅)X_{t+1}\sim P^t_{Z_t}(X_t,\cdot)Xt+1​∼PZt​t​(Xt​,⋅), and the rewards are conditionally independent with Yt∼R(⋅∣Xt,Zt)Y_t\sim R(\cdot\mid X_t,Z_t)Yt​∼R(⋅∣Xt​,Zt​) (Env.trajLaw T q); the Bernoulli policy πθ\pi_\thetaπθ​ is qt≡θq_t\equiv\thetaqt​≡θ.

Lemma. Let 0≤qt≤10\le q_t\le10≤qt​≤1 for all ttt, let FFF be a measurable real function of the trajectory, and suppose that for every state path xxx and action path zzz the function y↦F((xt,zt,yt)t<T)y\mapsto F\bigl((x_t,z_t,y_t)_{t<T}\bigr)y↦F((xt​,zt​,yt​)t<T​) is integrable with respect to ⨂t<TR(⋅∣xt,zt)\bigotimes_{t<T}R(\cdot\mid x_t,z_t)⨂t<T​R(⋅∣xt​,zt​). Then FFF is integrable under Pq\mathbb P_qPq​ and

Eq[F]=∑x∈ST ∑z∈{0,1}Twq(x,z)∫F((xt,zt,yt)t<T) ⨂t<TR(dyt∣xt,zt),\mathbb E_q[F]=\sum_{x\in S^T}\ \sum_{z\in\{0,1\}^T}w_q(x,z)\int F\bigl((x_t,z_t,y_t)_{t<T}\bigr)\,\bigotimes_{t<T}R(dy_t\mid x_t,z_t),Eq​[F]=x∈ST∑​ z∈{0,1}T∑​wq​(x,z)∫F((xt​,zt​,yt​)t<T​)t<T⨂​R(dyt​∣xt​,zt​),

with the path weight

wq(x,z)=ρ(x0)∏s+1<TPzss(xs,xs+1)∏t<Tqt zt(1−qt)1−ztw_q(x,z)=\rho(x_0)\prod_{s+1<T}P^s_{z_s}(x_s,x_{s+1})\prod_{t<T}q_t^{\,z_t}(1-q_t)^{1-z_t}wq​(x,z)=ρ(x0​)s+1<T∏​Pzs​s​(xs​,xs+1​)t<T∏​qtzt​​(1−qt​)1−zt​

Every expectation in the mission is computed through this formula.

Preamble
import Mathlib
import Definitions.Def_TPG_Model
import Definitions.Def_TPG_Markov

open MeasureTheory ProbabilityTheory
open scoped BigOperators ENNReal
Formal statement
namespace TPG
theorem integral_trajLaw {S : Type} [Fintype S] [MeasurableSpace S] [MeasurableSingletonClass S]
    (E : Env S) (T : ℕ) (q : ℕ → ℝ) (hq : ∀ t : ℕ, 0 ≤ q t ∧ q t ≤ 1)
    (F : Traj S T → ℝ) (hF : Measurable F)
    (hint : ∀ p : (Fin T → S) × (Fin T → Bool),
      Integrable (fun y : Fin T → ℝ => F (embedPath p.1 p.2 y)) (E.rewardLaw p.1 p.2)) :
    Integrable F (E.trajLaw T q)
      ∧ ∫ ω, F ω ∂(E.trajLaw T q)
        = ∑ p : (Fin T → S) × (Fin T → Bool),
            E.pathWeight T q p.1 p.2 * ∫ y, F (embedPath p.1 p.2 y) ∂(E.rewardLaw p.1 p.2) := by sorry
end TPG
Source
Johari, Peng, Xing, Estimation of Treatment Effects Under Nonstationarity via the Truncated Policy Gradient Estimator, revised manuscript of October 2026 (revision of arXiv:2506.05308v3, https://arxiv.org/abs/2506.05308); numbering follows the revised manuscript. Auxiliary statement, not a numbered result of the paper: it is the expectation formula implied by the model of §2.2, pp. 8–9.

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