Linear-time construction of a clipped and interleaved binary clock packet
ProvedPvsNP.unaryWidthClockPacket_linearTimecomplexity-theoryturing-machines
A binary clock packet consists of leading ones, a zero separator, and a binary digit sequence. Its clipped representation begins with one bit recording whether any digit beyond the first is nonzero. The next bits pair each of the first digits with a zero, padding the digit sequence with zeros when it is shorter than . There is a finite-stack TM2 machine that computes this representation on every such packet and halts within steps on every binary input of length .
Preamble
import Mathlib.Computability.TuringMachine.Computable open Turing Computability
Formal statement
theorem PvsNP.unaryWidthClockPacket_linearTime :
∃ (f : List Bool → List Bool)
(M : TM2ComputableInTime (id : List Bool → List Bool) (id : List Bool → List Bool) f),
(∀ n : ℕ, M.time n = 3 * n + 4) ∧
∀ (w : ℕ) (bits : List Bool),
f (List.replicate w true ++ false :: bits) =
(bits.drop w).any id ::
((bits.take w ++ List.replicate (w - bits.length) false).flatMap
(fun b => [b, false])) := by sorrySource
Original machine and trace formalization for this packet format. For the surrounding binary Turing machine model, see S. Cook, The P versus NP Problem, Section 1, pp. 1–2, https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf.