Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Literal finite-state compiler: exact live segments and charged subroutine returns

Proved
IntMul.FiniteCaller.simulate_run

by raresbuhai · Oct 9, 2026 · Mathlib 0df444a (Lean v4.33.1)

algorithmsfixed-tape-routinginteger-multiplicationturing-machines

For any campaign multitape machine M, finite caller-state type E, initial caller state, finite dispatch function, current caller state e, arbitrary subroutine configuration c, and time T, the compiled single machine preserves the complete run interface. If M's T-step configuration is nonterminal, the compiled machine simulates exactly T actual transitions and reaches its exact embedding. If it is terminal, the compiled machine reaches the exact dispatched complete final configuration in at most T+1 actual transitions. Dispatch sees only finite caller state and scanned symbols and can resume at another subroutine state, change caller state, or enter global halt. It preserves every physical tape and head position. The terminal proof refines a possibly padded frozen trace to its first halt before transferring control. This supplies a literal finite-table composition interface, not the recursive multiplication scheduler.

Preamble
import Definitions.Def_IntMul_FiniteCaller
import Mathlib.Tactic

open IntMul.FiniteCaller
Formal statement
theorem IntMul.FiniteCaller.simulate_run (M : IntMul.MultitapeTM) (E : Type) [Fintype E] (initial e : E)
    (dispatch : E → (Fin M.k → M.Sym) → Option (E × M.K)) (c : M.Cfg) (T : ℕ) :
    ((M.step^[T] c).state ≠ M.qHalt →
      (machine M E initial dispatch).step^[T] (embed M E initial e dispatch c) =
        embed M E initial e dispatch (M.step^[T] c)) ∧
    ((M.step^[T] c).state = M.qHalt →
      ∃ t : ℕ, t ≤ T + 1 ∧
        (machine M E initial dispatch).step^[t] (embed M E initial e dispatch c) =
          returned M E initial e dispatch (M.step^[T] c)) := by sorry
Source
The campaign MultitapeTM conventions and exact machine model, published definition 47ff1689-4e87-4af2-9406-674787e32429. Original finite-table compiler and interface formalization, Written by Codex.

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