Polynomial-time machine for appending one fixed output bit
ProvedCookLevin.appendBit_machinecook-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.