Documentation

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

Polynomially many queries with a common running-time factor #

A polynomial-time procedure produces a list of queries. The answer procedure may take superpolynomial time, but its time on each query is a common factor T x times a polynomial in the encoded query, and its workspace is polynomial. Computing all answers costs only a polynomial factor beyond T x and still uses polynomial space, including the full answer list.

The theorem uses the plain native list-mapping machine. In particular, it does not assume an oracle for the answers or charge a superpolynomial answer procedure as a polynomial-time step.

Main results #

theorem Turing.MultiTapeTM.ComputableInO.polynomial_queries {α β γ : Type} {ei : α ↪ List Bool} {eq : β ↪ List Bool} {eo : γ ↪ List Bool} {answer : α × β → γ} {queries : α → List β} {T : α → ℕ} {e b : ℕ} (ha : ComputableInO answer (encPair ei eq) eo (fun (p : α × β) => T p.1 * (((encPair ei eq) p).length + 1) ^ e) fun (p : α × β) => (((encPair ei eq) p).length + 1) ^ b) (hq : ComputableInPolyTime queries ei (encList eq)) (hT : ∀ (x : α), 1 ≤ T x) :
∃ (d : ℕ), ComputableInO (fun (x : α) => List.map (fun (q : β) => answer (x, q)) (queries x)) ei (encList eo) (fun (x : α) => T x * ((ei x).length + 1) ^ d) fun (x : α) => ((ei x).length + 1) ^ d

Compute a polynomial-size list of answers while preserving the common running-time factor. The constants e, b, and the resulting d are fixed before the input x.

theorem Turing.MultiTapeTM.ComputableInO.polynomial_postprocessing {α β γ : Type} {ei : α ↪ List Bool} {eq : β ↪ List Bool} {eo : γ ↪ List Bool} {f : α → β} {g : β → γ} {T : α → ℕ} {e b : ℕ} (hf : ComputableInO f ei eq (fun (x : α) => T x * ((ei x).length + 1) ^ e) fun (x : α) => ((ei x).length + 1) ^ b) (hg : ComputableInPolyTime g eq eo) (hT : ∀ (x : α), 1 ≤ T x) :
∃ (d : ℕ), ComputableInO (g ∘ f) ei eo (fun (x : α) => T x * ((ei x).length + 1) ^ d) fun (x : α) => ((ei x).length + 1) ^ d

Polynomial postprocessing of a polynomial-space result preserves the common time factor. The producer itself need not run in polynomial time.