Closed Stopping Observations and Finite Visit Bounds
DefinitionMonodromy_ObservationDefines optional stopping from a total successor and a Boolean test. Shows that observations closed under evolution preserve partial evaluation and halting, and that a reachable accepting observation in a finite state space is visited before the number of available observation states.
-- Generated by Lean-fact skeleton subtraction; original source is frozen in imports/monodromy/source.
module
public import Lean.Elab.Tactic.Omega
public import Mathlib.Computability.StateTransition
public import Mathlib.Data.Fintype.Card
public import Mathlib.Data.Set.Finite.Basic
@[expose] public section
/-!
# Closed observations
An observation that evolves on its own carries the complete stopping semantics.
A finite such quotient bounds the information available to internal control.
-/
@[expose] public section
namespace Monodromy.Observation
universe u
def stopped {S : Type*} (next : S → S) (halt : S → Bool) (state : S) : Option S :=
if halt state then none else some (next state)
end Monodromy.Observation
namespace Monodromy.Observation
variable {S : Type*}
/-- Evaluate at most the finite number of available observation states. -/
def finiteHalts [Fintype S] (next : S → S) (halt : S → Bool) (state : S) : Bool :=
(List.range (Fintype.card S)).any (fun rounds => halt ((next^[rounds]) state))
end Monodromy.Observation
Read-back
What the Lean code literally says, in plain math · OpenAI Codex (independent agent)
For any type , total successor , Boolean halt flag and state , stopped is the optional transition with value absent when is true and value present otherwise. If is additionally equipped with a finite enumeration, finiteHalts returns the Boolean disjunction of over exactly the natural indices , evaluating those iterates of the total successor even beyond a potential earlier halt; means the initial state. When the state set is empty this disjunction is over an empty list and is false, although no state argument exists to apply the function; a singleton examines only its initial state. This bundle defines the bounded Boolean test and optional transition, without an equivalence between that Boolean result and partial termination in the definition itself.
Confirmed by the mission captain (proposal self-audit).