Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

A Complete Packed Cycle Executes the Ordered Stage Tuple

Proved
Monodromy.StagedProgram.cycle_ofFn

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

computabilitycovering-spacesmonodromy-computation

For positive natural numbers c,d, any stage tuple P:Fin c→Program d, and any coupled state s, c total advances of the compiled staged program from the phase-zero embedding of s equal the phase-zero embedding of the left fold applying P_0.advance through P_{c−1}.advance to s in order. This statement concerns total advance iteration and imposes no stopping hypothesis.

Statement dependencies: Monodromy.CoupledContinuation.Memory, Monodromy.CoupledContinuation.Point, Monodromy.CoupledContinuation.Program, Monodromy.CoupledContinuation.Program.advance, Monodromy.StagedProgram.compile, Monodromy.StagedProgram.embed.

Original proof dependencies: Monodromy.CoupledContinuation.Memory, Monodromy.CoupledContinuation.Point, Monodromy.CoupledContinuation.Program, Monodromy.CoupledContinuation.Program.advance, Monodromy.StagedProgram.compile, Monodromy.StagedProgram.cycle, Monodromy.StagedProgram.embed.

Statement elaboration dependencies: Monodromy.CoupledContinuation.Memory, Monodromy.CoupledContinuation.Point, Monodromy.CoupledContinuation.Program, Monodromy.CoupledContinuation.Program.advance, Monodromy.StagedProgram.compile, Monodromy.StagedProgram.embed.

Proof elaboration dependencies: Monodromy.CoupledContinuation.Memory, Monodromy.CoupledContinuation.Point, Monodromy.CoupledContinuation.Program, Monodromy.CoupledContinuation.Program.advance, Monodromy.StagedProgram.compile, Monodromy.StagedProgram.cycle, Monodromy.StagedProgram.embed.

Preamble
module
public import Definitions.Def_Monodromy_Continuation
public import Lean.Elab.Tactic.Omega
public import Mathlib.Analysis.Analytic.Constructions
public import Mathlib.Analysis.Analytic.IsolatedZeros
public import Mathlib.Analysis.Analytic.Linear
public import Mathlib.Analysis.Calculus.DSlope
public import Mathlib.Analysis.Calculus.Deriv.Add
public import Mathlib.Analysis.Calculus.Deriv.Comp
public import Mathlib.Analysis.Calculus.Deriv.Mul
public import Mathlib.Analysis.Calculus.Deriv.Pow
public import Mathlib.Analysis.Complex.Basic
public import Mathlib.Analysis.Complex.CoveringMap
public import Mathlib.Analysis.Real.Pi.Bounds
public import Mathlib.Analysis.SpecialFunctions.Complex.Analytic
public import Mathlib.Analysis.SpecialFunctions.Complex.Circle
public import Mathlib.Computability.StateTransition
public import Mathlib.Data.Fin.Basic
public import Mathlib.Data.Fintype.Card
public import Mathlib.Logic.Equiv.Fin.Rotate
public import Mathlib.Logic.Function.Conjugate
public import Mathlib.RingTheory.RootsOfUnity.Complex
public import Mathlib.Tactic.FieldSimp
public import Mathlib.Tactic.FunProp
public import Mathlib.Tactic.Linarith
public import Mathlib.Tactic.Ring
public import Mathlib.Topology.Homotopy.Lifting

@[expose] public section

open Monodromy
open Monodromy.StagedProgram
open CoupledContinuation
open Fin.NatCast
variable (count degree : ℕ) [NeZero count] [NeZero degree]

Formal statement
theorem Monodromy.StagedProgram.cycle_ofFn (stages : Fin count → Program degree) (state : Memory) :
    ((compile count degree stages).advance)^[count] (embed count 0 state) =
      embed count 0 ((List.ofFn stages).foldl
        (fun point program => program.advance point) state) := by sorry
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/Continuation.lean (file SHA-256 c41996cad30503403fe284de8929124f849aa5fd0aaba5433e5e0d4d36fec912): Monodromy.StagedProgram.cycle_ofFn at L2656-L2671 [UTF-8 132287:133108].
Read-back

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

Write τ=2πi\tau=2\pi iτ=2πi. The memory space M\mathcal MM consists of triples (zL,zR,w)∈(C∗)2×C(z_L,z_R,w)\in(\mathbb C^*)^2\times\mathbb C(zL​,zR​,w)∈(C∗)2×C with ezL=ezR=ee^{z_L}=e^{z_R}=eezL​=ezR​=e and ew=zLzRe^w=z_Lz_Rew=zL​zR​; the integer-labelled point Φ(l,r,c)\Phi(l,r,c)Φ(l,r,c) is (1+τl,1+τr,log⁡(1+τl)+log⁡(1+τr)+τc)(1+\tau l,1+\tau r,\log(1+\tau l)+\log(1+\tau r)+\tau c)(1+τl,1+τr,log(1+τl)+log(1+τr)+τc) with principal complex logarithms. A native program of positive degree ddd consists of ddd finite words and ddd Boolean stop flags. Letters are left shift, right shift, left zero probe, right zero probe and control shift, with forward/reverse flags. The respective drivers move one lower base coordinate along t↦e1+2πitt\mapsto e^{1+2\pi it}t↦e1+2πit or t↦exp⁡(e2πit)t\mapsto\exp(e^{2\pi it})t↦exp(e2πit), or the control coordinate along t↦e2πitt\mapsto e^{2\pi it}t↦e2πit; unmentioned coordinates are constant. A driver acts by lower exponential lifts starting at zL,zRz_L,z_RzL​,zR​, followed by an upper exponential lift starting at www over the product of the lower lifts and the control path, and takes the endpoint. Words concatenate these drivers in list order, reversing paths for reversed letters; the empty word is idle. Routing observes rd=exp⁡((w−log⁡zL−log⁡zR)/d)r_d=\exp((w-\log z_L-\log z_R)/d)rd​=exp((w−logzL​−logzR​)/d) and selects values at the roots ωj=e2πij/d\omega_j=e^{2\pi ij/d}ωj​=e2πij/d by ∑jKd(ωj,rd)vj\sum_j K_d(\omega_j,r_d)v_j∑j​Kd​(ωj​,rd​)vj​, with Kd(r,z)K_d(r,z)Kd​(r,z) the divided slope of z↦zdz\mapsto z^dz↦zd at (r,z)(r,z)(r,z) divided by its derivative at rrr (the divided slope at z=rz=rz=r is the derivative). Advance executes the routed word; the halt signal selects 111 for true stop flags and 000 otherwise. The optional step is absent exactly when this signal is 111, and is advance otherwise. Partial evaluation repeatedly takes present steps and returns the first state with absent step; it is undefined if there is no such finite stopping time. For c,d>0c,d>0c,d>0, a family P0,…,Pc−1P_0,\ldots,P_{c-1}P0​,…,Pc−1​ of degree-ddd native programs is staged into degree cdcdcd by associating address cj+pcj+pcj+p with row j<dj<dj<d and phase p<cp<cp<c. Its table there consists of PpP_pPp​'s row-jjj word with every probe/control letter repeated ccc times (memory-shift letters unchanged), followed by a control word of displacement ((p+1) mod c)−p((p+1)\bmod c)-p((p+1)modc)−p. The unmarked staged program has all stop flags false. The phase embedding ιp\iota_pιp​ sends Φ(l,r,k)\Phi(l,r,k)Φ(l,r,k) to Φ(l,r,ck+p)\Phi(l,r,ck+p)Φ(l,r,ck+p) and is defined on all memories using the inverse of the specified label-memory bijection. Marked staging uses the same words and marks address cj+pcj+pcj+p precisely if p=0p=0p=0 and a supplied Boolean mark at jjj is true. For every positive natural c,dc,dc,d, every family (Pp)p<c(P_p)_{p<c}(Pp​)p<c​ of degree-ddd native programs, and every memory xxx, the ccc-fold iterate of the staged program's advance at ι0(x)\iota_0(x)ι0​(x) equals ι0(Pc−1.advance(⋯P1.advance(P0.advance(x))⋯ ))\iota_0(P_{c-1}.\mathrm{advance}(\cdots P_1.\mathrm{advance}(P_0.\mathrm{advance}(x))\cdots))ι0​(Pc−1​.advance(⋯P1​.advance(P0​.advance(x))⋯)). The list fold visits the stages in increasing order, and uses their advances irrespective of their own stop flags. The cases c=1c=1c=1 or d=1d=1d=1, empty stage words, and arbitrary memories are included; c=0c=0c=0 and d=0d=0d=0 are excluded.

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