Theorem 2 (as proved): stochastic -optimal agents contain world models
ProvedGeneralAgentsPO.theorem2_stochastic_agents_contain_world_modelsLet be finite sets with . Fix , , an integer and , and put
There is an estimator , a function of the goal-conditioned policy alone, with the following property. For every communicating cMDP and every goal-conditioned (possibly stochastic) policy that is -th-degree -optimal for ,
In particular the error tends to at rate . So a world model can be read off any sufficiently capable stochastic agent by querying it.
Formalization Note "An estimator defined by querying the policy" is a function of the policy that does not depend on , chosen before and . The proof uses only the first-step action probabilities of at a fixed state on the goals , which is a special case. The hypotheses and are not printed. The proof uses two distinct actions and divides by , and with a single action the statement is false. The rate is a consequence of the bound and is not stated separately.
import Mathlib import Definitions.Def_GeneralAgentsPO_Basic open GeneralAgentsWorldModels
namespace GeneralAgentsPO
theorem theorem2_stochastic_agents_contain_world_models {S A : Type*} [Fintype S] [DecidableEq S]
[Fintype A] [DecidableEq A] (hA : 2 ≤ Fintype.card A) (s s' : S) (a : A) (n : ℕ) (hn : 1 ≤ n)
(δ : ℝ) (hδ : δ < 1 / 2) :
∃ est : GCStochPolicy S S A → ℝ, ∀ M : CMP S A, M.IsCommunicating →
∀ π : GCStochPolicy S S A, IsDeltaOptimal M δ (PsiDepth (2 * n + 1)) π →
|est π - 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 GeneralAgentsPORead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Fix finite types (states) and (actions), both with decidable equality, and assume
Fix:
- two states , which may be equal;
- an action ;
- a natural number ;
- a real number . No lower bound is imposed, so may be zero or negative.
Write
(natural logarithm). Because , the argument is positive and strictly greater than , so . For example, , and as .
Claim. There exists a single real-valued function on goal-conditioned stochastic policies (described below) such that the following holds. For every controlled Markov process on with transition kernel that satisfies the communicating condition, and every goal-conditioned policy that is -optimal on in :
Here is taken to be for .
Order of choices. is chosen after , so it may depend on them. It is chosen before , so the same must work for every communicating . Its only input is the policy , and no restriction is placed on how it is computed or how it uses . The bound is stated in terms of the true value , not the estimate.
The terms "controlled Markov process", "communicating", "goal", "satisfaction" and "decides" come from a separate definitions file that is not reproduced here.
Policies. A stochastic policy over observation set assigns, to each finite history, a probability vector on :
The history consists of a list of past pairs and a current element . A goal-conditioned policy is a map assigning such a policy (with ) to every goal .
Goals and depth. A goal is a finite list (a disjunction) of sequential goals, each a finite list of basic goals. Its depth is the maximum length of its sequential goals, with depth for the empty list. is the set of goals of depth exactly .
Prefix probability. For a finite sequence , its probability under a policy started from is
For this equals .
Goal probability. The probability that achieves from is
This is a real supremum, which by convention equals if the set is unbounded above.
Optimal value. The optimal value is
taken over all stochastic history-dependent policies, with the same convention.
-optimality. is -optimal on if, for every goal of depth exactly and every starting state ,
When , the factor exceeds . In that case the condition can hold only for goals and start states where strictly exceeds the supremum , or where . So for negative the hypothesis on may be unsatisfiable for some or all , which would make the conclusion vacuous for those .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.