Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Cook–Levin machine model: sequential composition with additive runtime

Proved
CookLevin.machine_sequence_preserves_turing_and_time

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

complexity-theorycook-levinturing-machines

Two well-formed multi-tape Turing machines with the same tape count and alphabet can be sequenced by appending the second command list after shifting its state addresses. The explicit combined machine is well formed. If the first machine transforms the initial tapes to intermediate tapes within T1 steps and the second transforms those intermediate tapes to final tapes within T2 steps, the combined machine performs the transformation within T1 + T2 steps. This is a tape-level composition theorem; preparing the intermediate tapes for independently specified string functions is a separate obligation.

Preamble
import Definitions.Def_CookLevin_Basic
open CookLevin
set_option autoImplicit false
Formal statement
theorem CookLevin.machine_sequence_preserves_turing_and_time
    {k G : Nat} (M₁ M₂ : Machine)
    (h₁ : TuringMachine k G M₁) (h₂ : TuringMachine k G M₂) :
    let combined : Machine := M₁ ++ M₂.map
      (fun cmd gs => (M₁.length + (cmd gs).1, (cmd gs).2))
    TuringMachine k G combined ∧
      ∀ (tps middle finalTps : List Tape) (T₁ T₂ : Nat),
        Transforms M₁ tps T₁ middle → Transforms M₂ middle T₂ finalTps →
        Transforms combined tps (T₁ + T₂) finalTps := by sorry
Source
The existing CookLevin Basic machine semantics, with explicit relocation of state addresses and first-halting-time simulation. Developed for composition in the polynomial-time reduction milestone.

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, licensed under Apache 2.0.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTermsJoin SlackJoin Zulip© 2026 Prove2Me