Documentation

CslibFrontier.Computability.BlumComplexity.Speedup

Blum's speedup theorem #

For every Blum complexity measure Φ and every computable r, there is a computable 0/1-valued function f with no fastest program: every program c for f is beaten by another program c' for f with r n (Φ c' n) < Φ c n for almost all n Blum, A machine-independent theory of the complexity of recursive functions. Taking r n m = 2 ^ m, for instance, every program for f can be sped up exponentially, and the speedup can be repeated forever.

Construction #

The proof is Blum's priority construction combined with the recursion theorem. For a program e, parameters u, d and an input x, the version vers e u d runs the following cancellation run (Cslib.BlumComplexity.Cancellation.canc). At stage y, the program numbered i is eligible when u ≤ i ≤ y and, for some d' ≤ y, Φ i y ≤ r y (Φ (vers e (i + 1) d') y). The least eligible program not cancelled earlier is cancelled, and the version outputs 1 - φ_i y there, so that φ_i differs from it at y. Stages without a cancellation output 0. The data d encodes a finite table that fixes the output at some of the first stages; nothing is cancelled at such a stage. By the recursion theorem (Nat.Partrec.Code.fixed_point₂), the program e can run its own versions.

Strength #

The conclusion r n (Φ c' n) < Φ c n is strict, so it implies the non-strict form r n (Φ c' n) ≤ Φ c n. The function r takes the input n as an extra argument, as in Blum's paper. The one-argument form r (Φ c' n) < Φ c n is the special case fun _ m => r m (speedup'). The statement is not vacuous: f is computable, so it has a program, and every program for f halts on every input, so both costs in the conclusion are defined everywhere (Cslib.BlumComplexity.BlumMeasure.dom_cost_of_total).

Main results #

References #

The construction #

Computability of the construction #

Semantics of the construction #

theorem Cslib.BlumComplexity.BlumMeasure.speedup (Φ : BlumMeasure) {r : ℕ → ℕ → ℕ} (hr : Computable₂ r) :
∃ (f : ℕ → ℕ), Computable f ∧ (∀ (n : ℕ), f n ≤ 1) ∧ ∀ (c : Nat.Partrec.Code), (∀ (n : ℕ), f n ∈ c.eval n) → ∃ (c' : Nat.Partrec.Code), (∀ (n : ℕ), f n ∈ c'.eval n) ∧ ∀ᶠ (n : ℕ) in Filter.atTop, ∀ m ∈ Φ.cost c' n, ∀ m' ∈ Φ.cost c n, r n m < m'

Blum's speedup theorem [Blu67]. For every computable r, there is a computable function f with values in {0, 1} such that every program c for f has another program c' for f with r n (Φ c' n) < Φ c n for all sufficiently large n.

theorem Cslib.BlumComplexity.BlumMeasure.speedup' (Φ : BlumMeasure) {r : ℕ → ℕ} (hr : Computable r) :
∃ (f : ℕ → ℕ), Computable f ∧ (∀ (n : ℕ), f n ≤ 1) ∧ ∀ (c : Nat.Partrec.Code), (∀ (n : ℕ), f n ∈ c.eval n) → ∃ (c' : Nat.Partrec.Code), (∀ (n : ℕ), f n ∈ c'.eval n) ∧ ∀ᶠ (n : ℕ) in Filter.atTop, ∀ m ∈ Φ.cost c' n, ∀ m' ∈ Φ.cost c n, r m < m'

Blum's speedup theorem, one-argument form: for every computable r, there is a computable function f with values in {0, 1} such that every program c for f has another program c' for f with r (Φ c' n) < Φ c n for all sufficiently large n.

theorem Cslib.BlumComplexity.BlumMeasure.exists_no_fastest (Φ : BlumMeasure) {r : ℕ → ℕ → ℕ} (hr : Computable₂ r) :
∃ (f : ℕ → ℕ), Computable f ∧ (∀ (n : ℕ), f n ≤ 1) ∧ ¬∃ (c : Nat.Partrec.Code), (∀ (n : ℕ), f n ∈ c.eval n) ∧ ∀ (c' : Nat.Partrec.Code), (∀ (n : ℕ), f n ∈ c'.eval n) → ∀ᶠ (n : ℕ) in Filter.atTop, ∀ m ∈ Φ.cost c n, ∀ m' ∈ Φ.cost c' n, m ≤ r n m'

The function of Blum's speedup theorem has no program that is fastest up to r: for each program c for it, some program c' for it is faster than c by r almost everywhere, so c is not within r of every other program.