Cook–Levin machines: link clause body with counter advance
ProvedCookLevin.machine_emit_link_clause_bodycomplexitycook-levinloopsturing-machines
Emit all head-cell-read link clauses at one position and advance the head and cell unary counters by 8 and 8*symbols. The read counter, input and saved tapes are preserved. Time is affine in the sum of the three counters.
Preamble
import Definitions.Def_CookLevin_Tableau import Definitions.Def_CookLevin_Complexity open CookLevin set_option autoImplicit false
Formal statement
theorem CookLevin.machine_emit_link_clause_body {k G : Nat} (hk : 5 ≤ k) (hG : 4 ≤ G)
(symbols : Nat) :
∃ R : Machine, ∃ A B : Nat, TuringMachine k G R ∧
∀ (sh : Shape) (t j p : Nat) (input : Tape) (bits : List Bool) (saved : List Tape),
sh.G = symbols → saved.length + 5 = k →
let a := literalN (.Neg (sh.headVar t j p))
let b := literalN (.Neg (sh.cellVar t j p blankSymbol))
let c := literalN (.Pos (sh.readVar t j blankSymbol))
let chunk := (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 true)), 1 + a) ::
(contents (boolsToSymbols (List.replicate b true)), 1 + b) ::
(contents (boolsToSymbols (List.replicate c true)), 1 + c) ::
(contents (boolsToSymbols bits), 1 + bits.length) :: saved) (A * (a + b + c) + B)
(input :: (contents (boolsToSymbols (List.replicate (a + 8) true)), 1 + (a + 8)) ::
(contents (boolsToSymbols (List.replicate (b + 8 * symbols) true)), 1 + (b + 8 * symbols)) ::
(contents (boolsToSymbols (List.replicate c true)), 1 + c) ::
(contents (boolsToSymbols (bits ++ chunk)), 1 + (bits ++ chunk).length) :: saved) := by sorrySource
Compose accepted literal emission, fixed counter increments, and reusable unary iteration with an exact output-prefix invariant.