Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Packed Stopping Signals Read Only Marked Phase-Zero Addresses

Proved
Monodromy.StagedProgram.haltSignal_embed

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

computabilitycovering-spacesmonodromy-computation

For positive naturals c,d, any stages P:Fin c→Program d, any Boolean address marks b:Fin d→Bool, integers ℓ,r,q, address j∈Fin d and phase k∈Fin c, the marked compiler’s halt signal at the phase-k embedding of prepare(ℓ,r,dq+j) is 1 exactly when k=0 and b(j)=true, and is 0 otherwise.

Statement dependencies: Monodromy.CoupledContinuation.Program, Monodromy.CoupledContinuation.Program.haltSignal, Monodromy.CoupledContinuation.prepare, Monodromy.StagedProgram.embed, Monodromy.StagedProgram.markedCompile.

Original proof dependencies: Monodromy.CoupledContinuation.Memory, Monodromy.CoupledContinuation.Point, Monodromy.CoupledContinuation.Program, Monodromy.CoupledContinuation.Program.haltSignal, Monodromy.CoupledContinuation.Program.haltSignal_prepare, Monodromy.CoupledContinuation.prepare, Monodromy.StagedProgram.address, Monodromy.StagedProgram.address_val, Monodromy.StagedProgram.embed, Monodromy.StagedProgram.embed_prepare, Monodromy.StagedProgram.markedCompile, Monodromy.StagedProgram.markedCompile_stop_address.

Statement elaboration dependencies: Monodromy.CoupledContinuation.Program, Monodromy.CoupledContinuation.Program.haltSignal, Monodromy.CoupledContinuation.prepare, Monodromy.StagedProgram.embed, Monodromy.StagedProgram.markedCompile.

Proof elaboration dependencies: Monodromy.CoupledContinuation.Labels, Monodromy.CoupledContinuation.Memory, Monodromy.CoupledContinuation.Point, Monodromy.CoupledContinuation.Program, Monodromy.CoupledContinuation.Program.haltSignal, Monodromy.CoupledContinuation.Program.haltSignal_prepare, Monodromy.CoupledContinuation.prepare, Monodromy.StagedProgram.address, Monodromy.StagedProgram.address_val, Monodromy.StagedProgram.embed, Monodromy.StagedProgram.embed_prepare, Monodromy.StagedProgram.markedCompile, Monodromy.StagedProgram.markedCompile_stop_address.

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.haltSignal_embed (stages : Fin count → Program degree) (mark : Fin degree → Bool)
    (left right quotient : ℤ) (index : Fin degree) (phase : Fin count) :
    (markedCompile count degree stages mark).haltSignal
      (embed count phase (prepare left right ((degree : ℤ) * quotient + index.val))) =
      if (if phase = 0 then mark index else false) then 1 else 0 := 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.haltSignal_embed at L2834-L2852 [UTF-8 141628:142759].
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 all positive natural c,dc,dc,d, all families of ccc degree-ddd native programs, all Boolean row marks mmm, all integers l,r,kl,r,kl,r,k, all rows j<dj<dj<d and phases p<cp<cp<c, the marked staged program's complex halt signal at ιp(Φ(l,r,dk+j))\iota_p(\Phi(l,r,dk+j))ιp​(Φ(l,r,dk+j)) is exactly 111 if p=0p=0p=0 and m(j)=truem(j)=\mathrm{true}m(j)=true, and exactly 000 otherwise. This is an equality of the selector's complex value, including negative integer labels and c=1c=1c=1 or d=1d=1d=1; it does not impose any condition on the words in the stage family.

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