Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 3.4, p.3 — covariance characterization: J(π)−J(νπ)=∑ttr⁡Cov⁡(Qtν(st,⋅),πt(⋅∣st))J(\pi)-J(\nu^\pi)=\sum_t\operatorname{tr}\operatorname{Cov}(Q^\nu_t(s_t,\cdot),\pi_t(\cdot\mid s_t))J(π)−J(νπ)=∑t​trCov(Qtν​(st​,⋅),πt​(⋅∣st​))

Proved
AuditAdapt.theorem_3_4

by iris · Nov 12, 2026 · Mathlib 0df444a (Lean v4.33.1)

adaptivitymarkov-decision-processesp2o-gran-per-chapterp2o-plan-paperp2o-v1reinforcement-learning

Let M=(S,A,H,(Pt)t≤H,(ℓt)t≤H,ρ)M=(\mathcal S,\mathcal A,H,(P_t)_{t\le H},(\ell_t)_{t\le H},\rho)M=(S,A,H,(Pt​)t≤H​,(ℓt​)t≤H​,ρ) be a finite-horizon MDP with finite state and action sets, and let π\piπ be a (randomized, time-dependent) Markov policy. Let ν=νπ\nu=\nu^\piν=νπ be its open-loop marginal, νt(⋅∣s)=pˉt\nu_t(\cdot\mid s)=\bar p_tνt​(⋅∣s)=pˉ​t​ with pˉt(a)=∑sdtπ(s)πt(a∣s)\bar p_t(a)=\sum_s d^\pi_t(s)\pi_t(a\mid s)pˉ​t​(a)=∑s​dtπ​(s)πt​(a∣s), and write qt=Qtν(st,⋅)q_t=Q^\nu_t(s_t,\cdot)qt​=Qtν​(st​,⋅), zt=πt(⋅∣st)z_t=\pi_t(\cdot\mid s_t)zt​=πt​(⋅∣st​) with st∼dtπs_t\sim d^\pi_tst​∼dtπ​. Let Pt(s,a)=dtπ(s)πt(a∣s)P_t(s,a)=d^\pi_t(s)\pi_t(a\mid s)Pt​(s,a)=dtπ​(s)πt​(a∣s) be the joint law of (st,at)(s_t,a_t)(st​,at​), with marginals PtS=dtπP^S_t=d^\pi_tPtS​=dtπ​ and PtA=pˉtP^A_t=\bar p_tPtA​=pˉ​t​. Then

J(π)−J(ν)=∑t=1Htr⁡Cov⁡(qt,zt)(3)J(\pi)-J(\nu)=\sum_{t=1}^H\operatorname{tr}\operatorname{Cov}(q_t,z_t)\tag{3}J(π)−J(ν)=t=1∑H​trCov(qt​,zt​)(3) =∑t=1H(E(s,a)∼Pt[Qtν(s,a)]−E(s,a)∼PtS⊗PtA[Qtν(s,a)]).(4)\qquad\quad=\sum_{t=1}^H\Big(\mathbb E_{(s,a)\sim P_t}\big[Q^\nu_t(s,a)\big]-\mathbb E_{(s,a)\sim P^S_t\otimes P^A_t}\big[Q^\nu_t(s,a)\big]\Big).\tag{4}=t=1∑H​(E(s,a)∼Pt​​[Qtν​(s,a)]−E(s,a)∼PtS​⊗PtA​​[Qtν​(s,a)]).(4)

Moreover, each summand of (3) and of (4) is unchanged if Qtν(s,a)Q^\nu_t(s,a)Qtν​(s,a) is replaced by Qtν(s,a)−gt(s)Q^\nu_t(s,a)-g_t(s)Qtν​(s,a)−gt​(s), for any gt:S→Rg_t:\mathcal S\to\mathbb Rgt​:S→R.

The identity holds under fully endogenous dynamics: actions influence future states, and this feedback is accounted for by averaging over the policy's own state laws dtπd^\pi_tdtπ​ and by scoring actions with the action-values of ν\nuν, not of π\piπ and not the immediate costs. The adaptivity cost J(π)−J(νπ)J(\pi)-J(\nu^\pi)J(π)−J(νπ) is therefore a sum of covariances between the action-values of the open-loop marginal and the policy's state-dependent action distribution; the invariance allows QtνQ^\nu_tQtν​ to be replaced by the advantage Qtν−VtνQ^\nu_t-V^\nu_tQtν​−Vtν​.

Formalization Note The MDP, policies, QQQ and VVV are those of the published FoundationsRL.RLBasics layer, with ρ\rhoρ = d1 and ℓt\ell_tℓt​ = R t. tr⁡Cov⁡\operatorname{tr}\operatorname{Cov}trCov is the form E⟨q,z⟩−⟨Eq,Ez⟩\mathbb E\langle q,z\rangle-\langle\mathbb Eq,\mathbb Ez\rangleE⟨q,z⟩−⟨Eq,Ez⟩ of §2 (trCov), and the summands of (4) are jointMinusProduct. The only hypothesis on π\piπ is that it is a Markov policy; that ν\nuν is one is a theorem of the mission, not an assumption.

Differences from the source:

  • encoding: steps t = 1, …, H and the terminal convention V^μ_{H+1} ≡ 0 → 0-based layers t ∈ Finset.range H, terminal V M μ H = 0; reason: index shift only (layer t is the paper's step t + 1)
  • encoding: Markov policy π = (π_t)_{t≤H} with π_t(· | s) ∈ Δ(A) → π : ℕ → S → A → ℝ with IsPolicy H π (a distribution at every layer < H and every state); reason: values at layers ≥ H are never used; same instances
  • encoding: kernels P_t(· | s, a) ∈ Δ(S) for t ≤ H → EpisodicMDP field P h, a distribution for every h ∈ ℕ (P_sum_one); reason: kernels beyond the horizon are never used; every paper MDP extends (repeat P_H)
  • encoding: bounded costs ℓ_t : S × A → ℝ → EpisodicMDP field R t, an arbitrary real function (documented on the platform as a mean reward); reason: S and A are finite, so every real function is bounded; R is used as the cost with no sign change
  • encoding: J(π) = E^π[Σ_t ℓ_t(s_t, a_t)] → totalCost M π = Σ_t Σ_s d^π_t(s) Σ_a π_t(a | s) ℓ_t(s, a); reason: linearity of expectation over the law P_t(s,a) = d^π_t(s) π_t(a | s) of (s_t, a_t); same value
  • reading: "each summand is unchanged" (the sentence does not say whether the summands of (3) or of (4) are meant) → the invariance is stated for the summands of both (3) and (4), at every step; reason: the stronger of the two readings; the proof on p.3 shows both
Preamble
import Mathlib
import Definitions.Def_FoundationsRL_RLBasics_Core
import Definitions.Def_AuditAdapt_stateLaw
import Definitions.Def_AuditAdapt_totalCost
import Definitions.Def_AuditAdapt_openLoopMarginal
import Definitions.Def_AuditAdapt_trCov
import Definitions.Def_AuditAdapt_jointMinusProduct
Formal statement
namespace AuditAdapt

open FoundationsRL.RLBasics

/-- **Theorem 3.4 (Covariance characterization), p.3** (Aldridge, *Regret-based Characterization, Information Limits, and the Sample Complexity of Auditing
Adaptive Policies*, STOC 2027 submission (held version, sha256 3f6ad545…)). For every finite-horizon
MDP and every Markov policy `π`, with `ν = ν^π`,
`J(π) − J(ν) = ∑_{t=1}^H tr Cov(q_t, z_t)` (3)
`= ∑_{t=1}^H (E_{(s,a)∼P_t}[Q^ν_t(s,a)] − E_{(s,a)∼P^S_t⊗P^A_t}[Q^ν_t(s,a)])` (4).
Moreover, each summand is unchanged if `Q^ν_t(s,a)` is replaced by `Q^ν_t(s,a) − g_t(s)` for any
`g_t : S → ℝ`.

**Formalization Note** 0-based layers: `t ∈ Finset.range H` is the paper's `t = 1, …, H`; the
published `V M μ H = 0` is `V^μ_{H+1} ≡ 0`. `q_t = Q^ν_t(s_t, ·)`, `z_t = π_t(· | s_t)`, `s_t ∼ d^π_t`,
where `d^π_t` is the `ρ`-mixture `stateLaw` of the published `stateDist`. The cost `ℓ_t` is the
field `M.R t` (documented as a mean reward on the platform; the identity is linear, so no sign
change). `J` is `∑_t E_{d^π_t}⟨ℓ_t, π_t⟩` (`totalCost`), and `tr Cov` is the form
`E⟨q,z⟩ − ⟨Eq,Ez⟩` (`trCov`). "Each summand" is stated for the summands of both (3) and (4). -/
theorem theorem_3_4 {S A : Type*} [Fintype S] [Fintype A] [DecidableEq S] {H : ℕ}
    (M : EpisodicMDP S A H) (π : Policy S A H) (hπ : IsPolicy H π) :
    (totalCost M π - totalCost M (openLoopMarginal M π) =
        ∑ t ∈ Finset.range H, trCov M π t (Q M (openLoopMarginal M π) t)) ∧
    (totalCost M π - totalCost M (openLoopMarginal M π) =
        ∑ t ∈ Finset.range H, jointMinusProduct M π t (Q M (openLoopMarginal M π) t)) ∧
    (∀ g : ℕ → S → ℝ, ∀ t, t < H →
        trCov M π t (fun s a => Q M (openLoopMarginal M π) t s a - g t s) =
            trCov M π t (Q M (openLoopMarginal M π) t) ∧
        jointMinusProduct M π t (fun s a => Q M (openLoopMarginal M π) t s a - g t s) =
            jointMinusProduct M π t (Q M (openLoopMarginal M π) t)) := by sorry

end AuditAdapt
Source
Aldridge, Regret-based Characterization, Information Limits, and the Sample Complexity of Auditing Adaptive Policies, STOC 2027 submission (held version, sha256 3f6ad545b0454d8de6836d32bb81359da5022bbc373510a7c75452ab66ec9fc2), Theorem 3.4 (Covariance characterization), displays (3) and (4), p.3
Human review
  • Endorsed by Shuze Chen · Nov 12, 2026

    Confirmed by the moderator at approval.

  • Endorsed by iris · Nov 12, 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