Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Additive ordinary-step and local word-space recursive execution certificates

Definition
IntMul_EndParkRecursiveWorkload

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

algorithmsfixed-tape-routinginteger-multiplicationturing-machines
Definition code
import Definitions.Def_IntMul_EndParkRecursiveExecution

namespace IntMul.EndParkRecursiveWorkload

open IntMul.EndParkRecursiveEvaluation
open IntMul.EndParkRecursiveCall
open IntMul.EndParkRecursiveResume
open IntMul.TrackedBankedSimulation (nextExtent)
open IntMul.TrackedBankPreparation (inputWord initialExtent)
open IntMul.TrackedBankCleanup (span)

/-- Space and shared-word charge for one invocation's final physical cleanup. -/
def returnMass (M : MultitapeTM) (extent : Fin M.k → ℕ) (v w : List Bool) : ℕ :=
  span M extent+v.length+w.length+1

/-- Space, shared words, packet and finite-label charge for one physical call
and parent resumption. It is local, independent of depth and bank offsets. -/
def callMass (M : MultitapeTM) (labels : ℕ) (extent : Fin M.k → ℕ)
    (v x y childWord : List Bool) : ℕ :=
  span M extent+v.length+(inputWord M x y).length+childWord.length+labels+1

/-- A finite computation certificate counts actual ordinary body transitions
and an additive local word/space workload over its entire recursive tree.
It describes executions of the SAME body; it never enters machine control. -/
inductive HasWorkload (M : MultitapeTM) (labels : ℕ)
    (request : M.K → Option (Fin labels)) (resume : Fin labels → M.K) :
    (Fin M.k → ℕ) → M.Cfg → List Bool → List Bool → ℕ → ℕ → Prop
  | halt (extent : Fin M.k → ℕ) (c : M.Cfg) (v w : List Bool)
      (halt : c.state=M.qHalt) (out : c.cells M.outTape=M.tapeOf (w.map M.bitSym)) :
      HasWorkload M labels request resume extent c v w 0 (returnMass M extent v w)
  | step (extent : Fin M.k → ℕ) (c : M.Cfg) (v w : List Bool) (steps mass : ℕ)
      (live : c.state≠M.qHalt) (ordinary : request c.state=none)
      (rest : HasWorkload M labels request resume (nextExtent M c extent) (M.step c) v w steps mass) :
      HasWorkload M labels request resume extent c v w (steps+1) mass
  | call (extent : Fin M.k → ℕ) (c : M.Cfg) (v x y childWord w : List Bool)
      (label : Fin labels) (childSteps childMass parentSteps parentMass : ℕ)
      (live : c.state≠M.qHalt) (request_label : request c.state=some label)
      (packet : c.cells M.outTape=M.tapeOf (inputWord M x y))
      (child : HasWorkload M labels request resume (initialExtent M x y) (M.initCfg x y) [] childWord childSteps childMass)
      (parent : HasWorkload M labels request resume (parentAfterChildExtent M extent childWord)
        (resumedParent M labels resume label extent c childWord) childWord w parentSteps parentMass) :
      HasWorkload M labels request resume extent c v w (childSteps+parentSteps)
        (childMass+parentMass+callMass M labels extent v x y childWord)

end IntMul.EndParkRecursiveWorkload
Source
Original additive workload certificates for complete same-body finite recursive execution on a fixed tape machine. 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