Lemma 2 (as proved): optimal success probabilities of the goals and
ProvedGeneralAgentsPO.lemma2_optimal_visit_goalsLet be a finite communicating cMDP, let , , , and write . Then there is a policy such that for every
and for every
Here asks that the first action be and that, at the -th of the next visits to the pair , the next state be if and different from if ; is the disjunction of the with . The policy takes , then steers to and plays there.
Formalization Note The paper states that one policy works for every . A single policy cannot take every action first with probability one, and when and that reading is false. Its proof constructs a policy that takes action first, so the statement is formalized with fixed before is chosen.
import Mathlib import Definitions.Def_GeneralAgentsPO_Basic open GeneralAgentsWorldModels
namespace GeneralAgentsPO
theorem lemma2_optimal_visit_goals {S A : Type*} [Fintype S] [DecidableEq S] [Fintype A]
(M : CMP S A) (hM : M.IsCommunicating) (s₀ s s' : S) (a b : A) (n : ℕ) :
∃ πstar : StochPolicy S A,
(∀ w : Fin n → Bool,
optValue M [trialSeq b s a s' (List.ofFn w)] s₀ =
goalProb M πstar [trialSeq b s a s' (List.ofFn w)] s₀ ∧
goalProb M πstar [trialSeq b s a s' (List.ofFn w)] s₀ =
M.P s a s' ^ onesCount w * (1 - M.P s a s') ^ (n - onesCount w)) ∧
∀ r ≤ n,
optValue M (binGoal b s a s' n (· = r)) s₀ =
goalProb M πstar (binGoal b s a s' n (· = r)) s₀ ∧
goalProb M πstar (binGoal b s a s' n (· = r)) s₀ = binPmf n (M.P s a s') r := by sorry
end GeneralAgentsPORead-back
What the Lean code literally says, in plain math · claude-opus-5-5
For a finite set of states (with decidable equality) and a finite set of actions , let be a controlled Markov process on and with transition kernel , where is the probability of moving to after playing in . Assume is communicating. That notion is defined in an imported file that was not supplied, so its exact content is not shown here. Let be arbitrary states and arbitrary actions. They need not be distinct, so and are allowed. Let , with allowed, and write
Policies and goal probabilities. A policy assigns to every finite history a probability distribution on . It may be stochastic and may depend on the whole history.
For a goal , is defined as follows:
- For each horizon , sum over all length- sequences of state–action pairs. Keep only those that decide , meaning every infinite history extending satisfies .
- The weight of each such is
where is the history up to .
- is the supremum over of this sum.
- The optimal value is the supremum of over all such policies .
- Both suprema are real-valued suprema. By convention, a supremum of a set that is not bounded above would evaluate to .
The goals. For a word , let be the number of indices with .
- Let be the sequential goal written . According to the accompanying documentation (its definition is not in the supplied code), it is:
- first, the action is ;
- then, for each in order: eventually the pair is visited, and at the next step the state is if and is not if .
- The theorem uses the composite goal consisting of this single sequential goal as its only disjunct.
- For , let be the goal . Per the documentation it is the goal " of eq. (1)", and it is built from the predicate "count ". Its precise definition (presumably a disjunction of the with ) is not in the supplied code.
- is the "binomial mass function". Its definition is likewise not supplied; presumably it is .
The assertion. There exists a single policy , not depending on or , such that both of the following hold.
- For every :
The exponent is a natural-number subtraction, but it is never truncated because .
- For every natural number :
In both cases the supremum defining the optimal value is attained by the one policy , and it equals the stated closed-form expression.
Edge cases.
- When , the only word is the empty word, and the asserted value in part 1 is . In part 2 only is required.
- No relation is assumed between and , and none between and .
- Nothing is asserted for .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.