Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 3 (as proved): stochastic δ\deltaδ-optimal agents contain world models under partial observability

Proved
GeneralAgentsPO.theorem3_partially_observable_agents_contain_world_models

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

goal-conditioned-agentsmarkov-decision-processespartial-observabilityreinforcement-learningworld-models

Let S,A,O\mathcal S,\mathcal A,OS,A,O be finite sets with ∣A∣≥2|\mathcal A|\ge2∣A∣≥2. Fix s,s′∈Ss,s'\in\mathcal Ss,s′∈S, a∈Aa\in\mathcal Aa∈A, an integer n≥1n\ge1n≥1 and δ<12\delta<\tfrac12δ<21​, and put L=log⁡2(1−δ)1−2δL=\log\frac{2(1-\delta)}{1-2\delta}L=log1−2δ2(1−δ)​. There is an estimator P^\hat PP^ with the following property. It receives only the agent's observable first-step behaviour: for every goal ψ\psiψ, start state xxx and action ccc, the probability qψ(x,c)=∑oΩ(o∣x)Pr⁡(πψ(o)=c)q_\psi(x,c)=\sum_{o}\Omega(o\mid x)\Pr(\pi_\psi(o)=c)qψ​(x,c)=∑o​Ω(o∣x)Pr(πψ​(o)=c) that the agent, started in xxx, takes ccc as its first action. For every partially observable cMDP (S,A,P,O,Ω)(\mathcal S,\mathcal A,P,O,\Omega)(S,A,P,O,Ω) whose cMDP is communicating, and every goal-conditioned observation-based policy π\piπ that is (2n+1)(2n+1)(2n+1)-th-degree δ\deltaδ-optimal for it,

∣P^(q)−P(s′∣s,a)∣≤2P(s′∣s,a)(1−P(s′∣s,a))nL+2L3n+1n.\big|\hat P(q)-P(s'\mid s,a)\big|\le\sqrt{\frac{2P(s'\mid s,a)\big(1-P(s'\mid s,a)\big)}{n}L}+\frac{2L}{3n}+\frac1n.​P^(q)−P(s′∣s,a)​≤n2P(s′∣s,a)(1−P(s′∣s,a))​L​+3n2L​+n1​.

Even an agent that cannot see the state, if it is nearly optimal for goals phrased in terms of states, determines the transition probabilities.

Formalization Note The paper states that Theorem 2 "continues to hold" for observation-based policies, with the estimator obtained "by querying the policy". If the estimator may look only at the policy as a function of observation histories, the statement is false. Let each of two environments with the same states have state-revealing observations, the first emitting ox1o^1_xox1​ in state xxx and the second ox2o^2_xox2​, and let them have P(s′∣s,a)=0.1P(s'\mid s,a)=0.1P(s′∣s,a)=0.1 and 0.90.90.9. Take δ∈(0,12)\delta\in(0,\frac12)δ∈(0,21​) and nnn large enough that the bound is below 0.40.40.4. A single policy that, after a first observation oxio^i_xoxi​, plays a nearly optimal policy for environment iii from xxx is δ\deltaδ-optimal in both, so an estimator that sees only the policy returns the same value in both. The proof uses only the probabilities of the agent's first action from a start state inside the environment, ∑oΩ(o∣s0)Pr⁡(πξ(o)=c)\sum_o\Omega(o\mid s_0)\Pr(\pi_{\xi}(o)=c)∑o​Ω(o∣s0​)Pr(πξ​(o)=c), which is what querying the agent as a black box gives. The estimator receives exactly these numbers, for all goals, start states and actions, and nothing else; in particular it does not receive Ω\OmegaΩ or PPP. The hypotheses ∣A∣≥2|\mathcal A|\ge2∣A∣≥2 and n≥1n\ge1n≥1 are added as in Theorem 2, and OOO is finite.

Preamble
import Mathlib
import Definitions.Def_GeneralAgentsPO_Basic

open GeneralAgentsWorldModels
Formal statement
namespace GeneralAgentsPO

theorem theorem3_partially_observable_agents_contain_world_models {S A O : Type*} [Fintype S]
    [DecidableEq S] [Fintype A] [DecidableEq A] [Fintype O] (hA : 2 ≤ Fintype.card A)
    (s s' : S) (a : A) (n : ℕ) (hn : 1 ≤ n) (δ : ℝ) (hδ : δ < 1 / 2) :
    ∃ est : (CompGoal S A → S → A → ℝ) → ℝ, ∀ M : POCMP S A O, M.toCMP.IsCommunicating →
      ∀ π : GCStochPolicy S O A, IsObsDeltaOptimal M δ (PsiDepth (2 * n + 1)) π →
        |est (fun ψ x c => ∑ o, M.obs x o * (π ψ).act [] o c) - M.P s a s'| ≤
          Real.sqrt (2 * M.P s a s' * (1 - M.P s a s') / n *
              Real.log (2 * (1 - δ) / (1 - 2 * δ))) +
            2 * Real.log (2 * (1 - δ) / (1 - 2 * δ)) / (3 * n) + 1 / n := by sorry

end GeneralAgentsPO
Source
Cifuentes, General Agents Contain World Models, even under Partial Observability and Stochasticity, arXiv:2602.03146v1 (2026), Section 4.2, Theorem 3, p. 12; proof pp. 12-14
Read-back

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

Setting. Let SSS (states), AAA (actions) and OOO (observations) be finite types, with decidable equality on SSS and AAA. Assume AAA has at least two elements, ∣A∣≥2|A| \ge 2∣A∣≥2. Fix:

  • states s,s′∈Ss, s' \in Ss,s′∈S and an action a∈Aa \in Aa∈A;
  • a natural number n≥1n \ge 1n≥1;
  • a real number δ<12\delta < \tfrac12δ<21​. No lower bound is imposed, so δ\deltaδ may be zero or negative.

Write

Lδ=log⁡2(1−δ)1−2δ.L_\delta = \log\frac{2(1-\delta)}{1-2\delta}.Lδ​=log1−2δ2(1−δ)​.

Since δ<12\delta < \tfrac12δ<21​, the fraction is strictly greater than 111, so Lδ>0L_\delta > 0Lδ​>0.

The claim. There exists a single function est\mathrm{est}est with the following property. Its input is any real-valued function F(ψ,x,c)F(\psi, x, c)F(ψ,x,c) of a goal ψ\psiψ over S×AS\times AS×A, a state x∈Sx\in Sx∈S and an action c∈Ac\in Ac∈A. Its output is a real number. The function est\mathrm{est}est is chosen once, depending only on S,A,O,s,s′,a,n,δS, A, O, s, s', a, n, \deltaS,A,O,s,s′,a,n,δ, and before any model or policy is given.

The required property is this. Take any partially observable cMDP MMM whose underlying cMDP is communicating. Take any goal-conditioned observation-based stochastic policy π\piπ that is δ\deltaδ-optimal for the class Ψ2n+1\Psi_{2n+1}Ψ2n+1​. Then

∣ est(FM,π)−P(s′∣s,a)∣  ≤  2 P(s′∣s,a) (1−P(s′∣s,a))n Lδ  +  2Lδ3n  +  1n,\Bigl|\,\mathrm{est}\bigl(F_{M,\pi}\bigr) - P(s'\mid s,a)\Bigr| \;\le\; \sqrt{\frac{2\,P(s'\mid s,a)\,\bigl(1-P(s'\mid s,a)\bigr)}{n}\,L_\delta}\;+\;\frac{2L_\delta}{3n}\;+\;\frac1n,​est(FM,π​)−P(s′∣s,a)​≤n2P(s′∣s,a)(1−P(s′∣s,a))​Lδ​​+3n2Lδ​​+n1​,

where the input is

FM,π(ψ,x,c)=∑o∈OΩ(o∣x) πψ(c∣o).F_{M,\pi}(\psi,x,c)=\sum_{o\in O}\Omega(o\mid x)\,\pi_\psi(c\mid o).FM,π​(ψ,x,c)=o∈O∑​Ω(o∣x)πψ​(c∣o).

Here πψ(c∣o)\pi_\psi(c\mid o)πψ​(c∣o) is the probability that the policy for goal ψ\psiψ picks action ccc when its entire history is the single initial observation ooo, with no earlier observation–action pairs.

So est\mathrm{est}est sees only one thing: for every goal ψ\psiψ of any depth and every state xxx, the distribution of the agent's very first action when an observation is first drawn from Ω(⋅∣x)\Omega(\cdot\mid x)Ω(⋅∣x). It does not see Ω\OmegaΩ or PPP separately, and it sees no later-step behaviour.

For n=1n = 1n=1 the right-hand side is at least 111.

Partially observable cMDP. MMM consists of an underlying cMDP (S,A,P)(S,A,P)(S,A,P) with transition values P(s′′∣x,b)P(s'' \mid x, b)P(s′′∣x,b), plus an observation kernel Ω(o∣x)≥0\Omega(o\mid x)\ge 0Ω(o∣x)≥0 with ∑oΩ(o∣x)=1\sum_o \Omega(o\mid x)=1∑o​Ω(o∣x)=1 for every xxx. Because sss exists, SSS is nonempty, and this forces OOO to be nonempty.

The structure of a cMDP and the meaning of "communicating" come from an imported file that is not shown here. They are taken as given.

Policies. An observation-based stochastic policy assigns, to each finite history (o0,a0),…,(ot−1,at−1)(o_0,a_0),\dots,(o_{t-1},a_{t-1})(o0​,a0​),…,(ot−1​,at−1​) together with a current observation oto_tot​, a probability vector on AAA. Its entries are nonnegative and sum to 111.

A goal-conditioned policy π\piπ assigns such a policy πψ\pi_\psiπψ​ to every goal ψ\psiψ.

Goals and depth. A goal ψ\psiψ is a finite list (a disjunction) of sequential goals. Each sequential goal is a finite list of basic sub-goals. The syntax and the satisfaction relation come from the unshown imported file.

The depth of ψ\psiψ is the maximum length among its sequential goals, and is 000 for the empty list. Ψ2n+1\Psi_{2n+1}Ψ2n+1​ is the set of all goals whose depth is exactly 2n+12n+12n+1. There is no restriction on the number of disjuncts.

Goal probability. For an observation-based policy ρ\rhoρ and a start state xxx, let PrT(ψ∣ρ,x)\mathrm{Pr}_T(\psi\mid\rho,x)PrT​(ψ∣ρ,x) be the following sum. It runs over all length-TTT state–action sequences u=((s0,a0),…,(sT−1,aT−1))u=((s_0,a_0),\dots,(s_{T-1},a_{T-1}))u=((s0​,a0​),…,(sT−1​,aT−1​)) that already decide ψ\psiψ, i.e. satisfy the imported finite-prefix test. Each such uuu contributes

[s0=x]∑o0,…,oT−1∏i<TΩ(oi∣si) ρ(ai∣o0a0⋯oi)∏i+1<TP(si+1∣si,ai).[s_0=x]\sum_{o_0,\dots,o_{T-1}}\prod_{i<T}\Omega(o_i\mid s_i)\,\rho(a_i\mid o_0a_0\cdots o_i)\prod_{i+1<T}P(s_{i+1}\mid s_i,a_i).[s0​=x]o0​,…,oT−1​∑​i<T∏​Ω(oi​∣si​)ρ(ai​∣o0​a0​⋯oi​)i+1<T∏​P(si+1​∣si​,ai​).

For T=0T=0T=0 the indicator and the product are both 111.

The goal probability is the real supremum over TTT:

Pr(ψ∣ρ,x)=sup⁡T∈NPrT(ψ∣ρ,x).\mathrm{Pr}(\psi\mid\rho,x)=\sup_{T\in\mathbb N}\mathrm{Pr}_T(\psi\mid\rho,x).Pr(ψ∣ρ,x)=T∈Nsup​PrT​(ψ∣ρ,x).

This is the usual supremum when the set is bounded above; otherwise a conventional junk value applies. Goals are evaluated on the true states and actions.

The optimal value is Opt(ψ,x)=sup⁡ρPr(ψ∣ρ,x)\mathrm{Opt}(\psi,x)=\sup_\rho \mathrm{Pr}(\psi\mid\rho,x)Opt(ψ,x)=supρ​Pr(ψ∣ρ,x), taken over all observation-based stochastic policies ρ\rhoρ, which are not goal-conditioned.

δ\deltaδ-optimality. π\piπ is δ\deltaδ-optimal for Ψ2n+1\Psi_{2n+1}Ψ2n+1​ if, for every goal φ∈Ψ2n+1\varphi\in\Psi_{2n+1}φ∈Ψ2n+1​ and every start state x∈Sx\in Sx∈S,

(1−δ) Opt(φ,x)≤Pr(φ∣πφ,x).(1-\delta)\,\mathrm{Opt}(\varphi,x)\le \mathrm{Pr}(\varphi\mid\pi_\varphi,x).(1−δ)Opt(φ,x)≤Pr(φ∣πφ​,x).

When δ<0\delta<0δ<0 the factor 1−δ1-\delta1−δ exceeds 111. The condition then demands that πφ\pi_\varphiπφ​ do strictly better than the supremum wherever Opt(φ,x)>0\mathrm{Opt}(\varphi,x)>0Opt(φ,x)>0.

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