Documentation

CslibFrontier.Computability.Complexity.Classes.Immune.PolyTimeCore

Polynomial complexity cores of machines #

Lynch defines a polynomial complexity core of a decidable set A in terms of the machines deciding it: X is a core (Cslib.Complexity.IsPolyTimeCore) when every machine deciding A runs for more than p (|x|) steps on all but finitely many x ∈ X, for every polynomially bounded p. Lynch allows any deterministic machine; here machines have a binary alphabet and finitely many states, as in P, which changes running times only polynomially.

For decidable A these are the complexity cores of A for P (Cslib.Complexity.isPolyTimeCore_iff_isComplexityCore):

No machine decides an undecidable set, so every set is a machine core of an undecidable set; the second direction needs decidability.

Combined with the class-generic core theorem (Cslib.Complexity.exists_infinite_isComplexityCore_P_subset), this gives Lynch, Lemma 1 in a proper-core form: a problem is outside P exactly when it has an infinite polynomial complexity core inside it (Cslib.Complexity.notMem_P_iff_exists_infinite_isPolyTimeCore). Lynch's lemma gives, for a recursive set outside P, an infinite recursive core that need not lie inside the set. The core here lies inside the set, which is stronger, but it is not claimed to be recursive. For decidable problems on bit strings, Immune.RecursiveCore chooses it decidable as well (Cslib.Complexity.exists_infinite_isDecidable_isPolyTimeCore). Problems hard for E or EXP are outside P, so they have infinite cores (Cslib.Complexity.PolyTimeHard.exists_infinite_isPolyTimeCore_E, Cslib.Complexity.PolyTimeHard.exists_infinite_isPolyTimeCore_EXP).

The universe is a machine core of A when every machine deciding A runs in superpolynomial time on almost all instances. For decidable A with A and its complement infinite, this is P-bi-immunity (Balcázar and Schöning, Cslib.Complexity.isBiImmune_P_iff_isPolyTimeCore_univ).

Main definitions #

Main results #

References #

def Cslib.Complexity.IsPolyTimeCore {β : Type} (enc : β ↪ List Bool) (A X : Set β) :

X is a polynomial complexity core of A Lynch: for every machine with a binary alphabet and finitely many states deciding A, and every polynomially bounded p, the machine halts within p (enc x).length steps on only finitely many x ∈ X.

theorem Cslib.Complexity.isPolyTimeCore_iff {β : Type} {enc : β ↪ List Bool} {A X : Set β} :
IsPolyTimeCore enc A X ↔ ∀ (k : ℕ) (State : Type) [Finite State] (tm : Turing.MultiTapeTM k Bool State), (∀ (a : β), tm.Computes (enc a) [Turing.MultiTapeTM.indicator A a]) → ∀ (p : ℕ → ℕ), PolynomiallyBounded p → {x : β | x ∈ X ∧ (Turing.MultiTapeTM.runFrom (tm.initCfg (enc x)) (p (enc x).length)).Halted}.Finite
theorem Cslib.Complexity.IsComplexityCore.isPolyTimeCore {β : Type} {enc : β ↪ List Bool} {A X : Set β} (h : IsComplexityCore (P enc) A X) :

Complexity cores for P are polynomial complexity cores: the instances on which a decider halts in time with a given answer form a problem in P, by universal simulation.

Polynomial complexity cores of decidable problems are complexity cores for P.

For decidable problems, polynomial complexity cores are the complexity cores for P.

theorem Cslib.Complexity.IsPolyTimeCore.finite_of_mem_P {β : Type} {enc : β ↪ List Bool} {A X : Set β} (h : IsPolyTimeCore enc A X) (hA : A ∈ P enc) :

A problem in P has only finite polynomial complexity cores: its polynomial-time decider halts in time on every instance.

theorem Cslib.Complexity.notMem_P_iff_exists_infinite_isPolyTimeCore {β : Type} {enc : β ↪ List Bool} {A : Set β} :
A ∉ P enc ↔ ∃ X ⊆ A, X.Infinite ∧ IsPolyTimeCore enc A X

Problems outside P have infinite polynomial complexity cores (Lynch, Lemma 1, proper-core strengthening): a problem is outside P exactly when it has an infinite polynomial complexity core inside it. Unlike Lynch's core, this one is not claimed to be recursive; for a decidable core of a decidable problem on bit strings, see Cslib.Complexity.exists_infinite_isDecidable_isPolyTimeCore.

P-bi-immunity in terms of machines Balcázar and Schöning: a decidable problem is P-bi-immune exactly when it and its complement are infinite and every machine deciding it runs in superpolynomial time on almost every instance.

Every machine deciding a P-bi-immune problem runs in superpolynomial time on almost every instance.

theorem Cslib.Complexity.PolyTimeHard.exists_infinite_isPolyTimeCore_E {β : Type} {enc : β ↪ List Bool} {A : Set β} (h : PolyTimeHard (@E) enc A) :
∃ X ⊆ A, X.Infinite ∧ IsPolyTimeCore enc A X

Problems hard for E have infinite polynomial complexity cores, since they are not in P.

theorem Cslib.Complexity.PolyTimeHard.exists_infinite_isPolyTimeCore_EXP {β : Type} {enc : β ↪ List Bool} {A : Set β} (h : PolyTimeHard (@EXP) enc A) :
∃ X ⊆ A, X.Infinite ∧ IsPolyTimeCore enc A X

Problems hard for EXP have infinite polynomial complexity cores, since they are not in P.