Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Closed Stopping Observations and Finite Visit Bounds

Definition
Monodromy_Observation

by Xiaoyang Liu · Nov 5, 2026 · Mathlib 0df444a (Lean v4.33.1)

computabilitycovering-spacesmonodromy-computation

Defines 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.

Definition code
-- 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
Source
Authoritative local working-tree snapshot SHA-256 e03ce2d08e07ee663140bec213fb21e995f44153a3c556c908fcf1c8d6fefe6c; repository https://github.com/ERHUTUZI123/monodromy. The remote Git base is incomplete and is not asserted to contain these declarations. src/Monodromy/Observation.lean (file SHA-256 7989443c07eb69c1a560c79f678d827f7e8efd3f352ab0119eebb2cac76505bd): Monodromy.Observation.stopped at L21-L22 [UTF-8 434:569]. Monodromy.Observation.finiteHalts at L126-L128 [UTF-8 6011:6253].
Read-back

What the Lean code literally says, in plain math · OpenAI Codex (independent agent)

For any type SSS, total successor N:S→SN:S\to SN:S→S, Boolean halt flag H:S→{false,true}H:S\to\{\mathrm{false},\mathrm{true}\}H:S→{false,true} and state s∈Ss\in Ss∈S, stopped is the optional transition with value absent when H(s)H(s)H(s) is true and value N(s)N(s)N(s) present otherwise. If SSS is additionally equipped with a finite enumeration, finiteHalts returns the Boolean disjunction of H(Nj(s))H(N^j(s))H(Nj(s)) over exactly the natural indices 0≤j<∣S∣0\le j<|S|0≤j<∣S∣, evaluating those iterates of the total successor even beyond a potential earlier halt; j=0j=0j=0 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.

Human review
  • Endorsed by marwahaha · Nov 6, 2026

  • Endorsed by Xiaoyang Liu · Nov 6, 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