Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Complete physical child-workspace cleanup with exact clock and fresh reusable banks

Proved
IntMul.TrackedBankCleanup.cleanup_correct

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

algorithmsfixed-tape-routinginteger-multiplicationturing-machines

Starting from arbitrary prepared tracked child banks, unique local start markers, initialized blank tails and arbitrary nonnegative bank-head distances, exactly max(head distances)+2*max(visited payload extents)+3 actual machine transitions clear all child bank suffixes and local markers and halt with every work head at its original boundary. The root input and caller buffer cells/heads, all ancestor prefixes and every outer cell-zero marker are preserved. Every bank cell at or beyond its offset is genuinely fresh blank with false visited flag. Smaller banks stop independently during all parallel seeks/sweeps. No ancestor-size scan, numerical address oracle or supplied endmarker is used. This is a clearing contract; output copying, bank preparation and recursive scheduling remain separate obligations.

Preamble
import Definitions.Def_IntMul_TrackedBankCleanup
import Mathlib.Tactic
open IntMul.BankedSimulation (workTape)

open IntMul IntMul.TrackedBankCleanup
Formal statement
theorem IntMul.TrackedBankCleanup.cleanup_correct (M : MultitapeTM) (base : (machine M).Cfg)
    (offset extent : Fin M.k → ℕ) (positive : ∀ j, 1 ≤ offset j)
    (c : M.Cfg) (pos : Fin M.k → ℕ)
    (unique : ∀ j p, c.cells j p = M.startSym ↔ p = 0)
    (tail : ∀ j p, extent j < p → c.cells j p = M.blank) :
    let final := (machine M).step^[span M pos + 2 * span M extent + 3]
      (rewindFrame M base offset extent c pos)
    final = finalFrame M base offset ∧
      (∀ i : Fin (M.k + 2), i.val < 2 → final.cells i = base.cells i ∧ final.head i = base.head i) ∧
      (∀ j p, p < offset j → final.cells (workTape M j) p = base.cells (workTape M j) p) ∧
      (∀ j, final.cells (workTape M j) 0 = base.cells (workTape M j) 0) ∧
      (∀ j p, offset j ≤ p → final.cells (workTape M j) p = some (M.blank,false)) ∧
      (∀ j, final.head (workTape M j) = offset j) := by sorry
Source
Original finite visited-workspace clearing construction for the integer-multiplication campaign. 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