Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Polynomial-time machine for appending one fixed output bit

Proved
CookLevin.appendBit_machine

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

cook-levinpolynomial-timeturing-machine

Given a well-formed machine that computes a bit-string function within a polynomial step bound, there is a well-formed polynomial-time machine that computes the same output followed by one fixed bit. The construction scans or rewinds the original output, writes the fixed bit at the first non-bit cell, and halts within a polynomial bound.

Preamble
import Definitions.Def_CookLevin_Complexity
open CookLevin
Formal statement
namespace CookLevin

/-- A low-level output postprocessor: after a well-formed machine computes a
bit string within a polynomial bound, one may rewind/scan its output tape,
write one fixed bit at the first non-bit cell, and halt. The constants in the
new polynomial absorb the original run, rewind, scan, and final write. -/
theorem appendBit_machine
    (M : Machine) (k G c d : Nat) (u : List Bool → List Bool)
    (hwf : TuringMachine k G M)
    (hcomp : ComputesInTime M k (polyBound c d) u)
    (b : Bool) :
    ∃ (M' : Machine) (k' G' c' d' : Nat),
      TuringMachine k' G' M' ∧
      ComputesInTime M' k' (polyBound c' d') (fun x => u x ++ [b]) := by
  sorry

end CookLevin
Source
Machine-construction child of CookLevin.polyTime_append_true (https://prove2.me/theorems/923eb852); CookLevinLean Cost/Complexity model.

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