Polynomial-time bit functions are computed by mission machines in time
ProvedIntConeFPT.machine_of_polyTimeThis is a transfer lemma between two machine models: a function that is polynomial-time computable on multi-tape Turing machines (in the sense of complexitylib, where such statements are proved compositionally with fun_prop) is computed by a machine of the mission's model, with a polynomial step bound on every input.
Words of the mission are written over the four-letter alphabet . Write each letter as two bits, the high bit followed by the low bit , and let be the letter-by-letter image of a word .
Let be computable in polynomial time by a multi-tape Turing machine, with bit strings encoded as themselves. Then there are a constant and a machine such that for all words and over ,
The lemma lets every word-processing and arithmetic subroutine of the algorithm (parsing, rational arithmetic, rounding, merging) be specified as an ordinary function on bit strings and certified polynomial-time by composition, instead of by a hand-built machine. The hypothesis is only needed on the inputs one cares about, so it also serves promise problems.
Formalization Note The machine model of the conclusion is Mathlib's multi-stack TM2 (IntConeFPT.Machine, IntConeFPT.RunsWithin); the hypothesis is Turing.MultiTapeTM.ComputableInPolyTime with the identity embedding of List Bool on both sides. The bound on the output length is not a hypothesis: it follows from the polynomial running time of .
import Mathlib import Definitions.Def_OnlineCRS_Combine_Sym import Definitions.Def_IntConeFPT_Machine import Definitions.Def_Complexitylib_0ebd467_Computability_Machines_Turing_MultiTape_PolyTime open OnlineCRS.Combine IntConeFPT
theorem IntConeFPT.machine_of_polyTime (F : List Bool → List Bool)
(hF : Turing.MultiTapeTM.ComputableInPolyTime F
(Function.Embedding.refl (List Bool)) (Function.Embedding.refl (List Bool))) :
let bits := fun w : List Sym => w.flatMap fun s => [decide (2 ≤ s.1), decide (s.1 % 2 = 1)]
∃ C : ℕ, ∃ M : Machine, ∀ w out : List Sym, F (bits w) = bits out →
RunsWithin M w out (((w.length : ℝ) + 2) ^ C) := by sorry