Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Complexity.BigO.Preprocess

Polynomial-time preprocessing of exponential bounds #

A computation within time 2 ^ E times a polynomial in the length of its input and within polynomial space keeps bounds of this form when its input is first computed by a polynomial-time map: the map takes polynomial time, and the length of its value is polynomial in the length of the original input, so the polynomial factors compose (Turing.MultiTapeTM.ComputableInO.comp_polyTime). Subexponential counters on encoded instances thereby transfer along polynomial-time reductions from other encodings.

Main results #

theorem Turing.MultiTapeTM.ComputableInO.comp_polyTime {α β γ : Type} {encIn : α ↪ List Bool} {encMid : β ↪ List Bool} {encOut : γ ↪ List Bool} {f : β → γ} {g : α → β} {T S : β → ℕ} {E : α → ℕ} {e b : ℕ} (hf : ComputableInO f encMid encOut T S) (hg : ComputableInPolyTime g encIn encMid) (hT : ∀ (a : α), T (g a) ≤ 2 ^ E a * ((encMid (g a)).length + 1) ^ e) (hS : ∀ (a : α), S (g a) ≤ ((encMid (g a)).length + 1) ^ b) :
∃ (e' : ℕ) (b' : ℕ), ComputableInO (fun (a : α) => f (g a)) encIn encOut (fun (a : α) => 2 ^ E a * ((encIn a).length + 1) ^ e') fun (a : α) => ((encIn a).length + 1) ^ b'

Polynomial-time preprocessing keeps a time bound 2 ^ E times a polynomial. If f runs, on the values of a polynomial-time map g, within time 2 ^ E a times a polynomial in the length of g a and within space polynomial in that length, then f ∘ g runs within time 2 ^ E a times a polynomial in the length of a, and within polynomial space.