Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Cook–Levin machines: link clauses for a complete time slice

Proved
CookLevin.machine_emit_link_time_block

by Robertboy18 · Sep 22, 2026 · Mathlib 0df444a (Lean v4.33.1)

complexitycook-levinloopsturing-machines

Emit all link clauses for every logical tape and position at one time. The fixed tape count determines the machine; the runtime width is supplied by reusable unary fuel. All three literal counters advance to the next time. Zero tape and alphabet bounds are included.

Preamble
import Definitions.Def_CookLevin_Tableau
import Definitions.Def_CookLevin_Complexity
open CookLevin
set_option autoImplicit false
Formal statement
theorem CookLevin.machine_emit_link_time_block {k G : Nat} (hk : 6 ≤ k)
    (hG : 4 ≤ G) (tapes symbols : Nat) :
    ∃ R : Machine, ∃ A B : Nat, TuringMachine k G R ∧
      ∀ (sh : Shape) (t : Nat) (input : Tape) (bits : List Bool)
        (fuel : Nat → Symbol) (saved : List Tape),
        sh.k = tapes → sh.G = symbols → saved.length + 6 = k →
        fuel 0 ≠ oneSymbol →
        (∀ i, i < sh.T + 1 → fuel (1 + i) = oneSymbol) →
        fuel (1 + (sh.T + 1)) ≠ oneSymbol →
        let a := fun t => literalN (.Neg (sh.headVar t 0 0))
        let b := fun t => literalN (.Neg (sh.cellVar t 0 0 blankSymbol))
        let c := fun t => literalN (.Pos (sh.readVar t 0 blankSymbol))
        let chunk := (List.range sh.k).flatMap fun j =>
          (List.range (sh.T + 1)).flatMap fun p =>
            (encodeFormula ((List.range sh.G).map fun s =>
      [Literal.Neg (sh.headVar t j p), Literal.Neg (sh.cellVar t j p s),
       Literal.Pos (sh.readVar t j s)])).dropLast
        Transforms R
          (input :: (contents (boolsToSymbols (List.replicate (a t) true)), 1 + a t) ::
            (contents (boolsToSymbols (List.replicate (b t) true)), 1 + b t) ::
            (contents (boolsToSymbols (List.replicate (c t) true)), 1 + c t) ::
            (contents (boolsToSymbols bits), 1 + bits.length) :: (fuel, 1) :: saved)
          (tapes * ((sh.T + 1) * (A * (a (t + 1) + b (t + 1) + c (t + 1)) + B + 6) + 4 + (8 + 16 * symbols)))
          (input :: (contents (boolsToSymbols (List.replicate (a (t + 1)) true)), 1 + a (t + 1)) ::
            (contents (boolsToSymbols (List.replicate (b (t + 1)) true)), 1 + b (t + 1)) ::
            (contents (boolsToSymbols (List.replicate (c (t + 1)) true)), 1 + c (t + 1)) ::
            (contents (boolsToSymbols (bits ++ chunk)), 1 + (bits ++ chunk).length) ::
            (fuel, 1) :: saved) := by sorry
Source
Compose accepted literal emission, fixed counter increments, and reusable unary iteration with an exact output-prefix invariant.

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