Documentation

CslibFrontier.Computability.BlumComplexity.Cancellation

Priority cancellation runs #

Blum's speedup theorem uses a priority construction, as do many diagonal constructions in abstract complexity theory. Stage by stage, a run cancels indices. At stage y it cancels the least index i in [u, y] that is eligible at y and has not been cancelled before. An override predicate can suppress a stage, in which case nothing is cancelled there.

This file defines the run canc E ov u y for an arbitrary eligibility predicate E i y and override ov y, and proves the facts the speedup construction needs:

Main definitions #

References #

The least i ∈ [s, s + n) with p i, if any.

theorem Cslib.BlumComplexity.Cancellation.computable_bfind {α : Type u_1} [Primcodable α] {p : α → ℕ → Bool} {s n : α → ℕ} (hp : Computable₂ p) (hs : Computable s) (hn : Computable n) :
Computable fun (a : α) => bfind (p a) (s a) (n a)
theorem Cslib.BlumComplexity.Cancellation.bfind_eq_some {p : ℕ → Bool} {s n i : ℕ} :
bfind p s n = some i ↔ s ≤ i ∧ i < s + n ∧ p i = true ∧ ∀ (j : ℕ), s ≤ j → j < i → p j = false
theorem Cslib.BlumComplexity.Cancellation.bfind_eq_none {p : ℕ → Bool} {s n : ℕ} :
bfind p s n = none ↔ ∀ (i : ℕ), s ≤ i → i < s + n → p i = false
theorem Cslib.BlumComplexity.Cancellation.bfind_congr {p q : ℕ → Bool} {s n : ℕ} (h : ∀ (i : ℕ), s ≤ i → i < s + n → p i = q i) :
bfind p s n = bfind q s n

The priority run #

def Cslib.BlumComplexity.Cancellation.canc (E : ℕ → ℕ → Bool) (ov : ℕ → Bool) (u y : ℕ) :

The index cancelled at stage y of the run with eligibility E, override ov and least index u, if any.

theorem Cslib.BlumComplexity.Cancellation.canc_eq_some {E : ℕ → ℕ → Bool} {ov : ℕ → Bool} {u y i : ℕ} :
canc E ov u y = some i ↔ ov y = false ∧ u ≤ i ∧ i ≤ y ∧ E i y = true ∧ (∀ k < y, canc E ov u k ≠ some i) ∧ ∀ (j : ℕ), u ≤ j → j < i → E j y = true → ∃ k < y, canc E ov u k = some j

Stage y cancels i exactly when there is no override at y, i ∈ [u, y] is eligible at y and was not cancelled earlier, and every smaller eligible index in [u, i) was cancelled earlier.

theorem Cslib.BlumComplexity.Cancellation.canc_eq_none {E : ℕ → ℕ → Bool} {ov : ℕ → Bool} {u y : ℕ} :
canc E ov u y = none ↔ ov y = true ∨ ∀ (i : ℕ), u ≤ i → i ≤ y → E i y = true → ∃ k < y, canc E ov u k = some i

Stage y cancels nothing exactly when there is an override at y or every eligible index in [u, y] was cancelled earlier.

theorem Cslib.BlumComplexity.Cancellation.canc_injective {E : ℕ → ℕ → Bool} {ov : ℕ → Bool} {u y₁ y₂ i : ℕ} (h₁ : canc E ov u y₁ = some i) (h₂ : canc E ov u y₂ = some i) :
y₁ = y₂

Each index is cancelled at most once.

theorem Cslib.BlumComplexity.Cancellation.canc_le {E : ℕ → ℕ → Bool} {ov : ℕ → Bool} {u y i : ℕ} (h : canc E ov u y = some i) :
u ≤ i ∧ i ≤ y
theorem Cslib.BlumComplexity.Cancellation.canc_congr {E₁ E₂ : ℕ → ℕ → Bool} {ov : ℕ → Bool} {u x : ℕ} (h : ∀ (i y : ℕ), u ≤ i → i ≤ y → y ≤ x → E₁ i y = E₂ i y) (y : ℕ) :
y ≤ x → canc E₁ ov u y = canc E₂ ov u y

Changing E outside u ≤ i ≤ y ≤ x does not change the run up to stage x.

theorem Cslib.BlumComplexity.Cancellation.computable_canc {α : Type u_1} [Primcodable α] {E : α → ℕ → ℕ → Bool} {ov : α → ℕ → Bool} {u y : α → ℕ} (hE : Computable fun (p : α × ℕ × ℕ) => E p.1 p.2.1 p.2.2) (hov : Computable₂ ov) (hu : Computable u) (hy : Computable y) :
Computable fun (a : α) => canc (E a) (ov a) (u a) (y a)

The run is computable, uniformly in a parameter, whenever the eligibility predicate and the override are.

theorem Cslib.BlumComplexity.Cancellation.exists_canc_le {E : ℕ → ℕ → Bool} {ov : ℕ → Bool} {u y j : ℕ} (hov : ov y = false) (hu : u ≤ j) (hj : j ≤ y) (hE : E j y = true) (hnc : ∀ k < y, canc E ov u k ≠ some j) :
∃ j' ≤ j, canc E ov u y = some j'

An eligible index that has not been cancelled yet forces a cancellation at or below it.

theorem Cslib.BlumComplexity.Cancellation.eventually_canc_ne (E : ℕ → ℕ → Bool) (ov : ℕ → Bool) (u i : ℕ) :
∀ᶠ (y : ℕ) in Filter.atTop, ∀ j < i, canc E ov u y ≠ some j

Eventually, no index below i is cancelled any more.

theorem Cslib.BlumComplexity.Cancellation.eventually_not_eligible {E : ℕ → ℕ → Bool} {i : ℕ} (hi : ∀ (y : ℕ), canc E (fun (x : ℕ) => false) 0 y ≠ some i) :

In a run without overrides from 0, an index that is never cancelled is eligible at only finitely many stages.

theorem Cslib.BlumComplexity.Cancellation.canc_override {E : ℕ → ℕ → Bool} {u : ℕ} {ov : ℕ → Bool} (hov : ∀ (y : ℕ), ov y = true ↔ ∃ j < u, canc E (fun (x : ℕ) => false) 0 y = some j) (y j : ℕ) :
u ≤ j → (canc E ov u y = some j ↔ canc E (fun (x : ℕ) => false) 0 y = some j)

Starting at u, with an override exactly at the stages where the run from 0 cancels an index below u, reproduces the cancellations ≥ u of the run from 0.