Documentation

CslibFrontier.Computability.Complexity.Classes.Immune.Construction

A P-bi-immune problem in E #

Exponential time contains P-bi-immune problems Balcázar and Schöning. This module constructs one by a priority (slow) diagonalization over all machines, Cslib.Complexity.BiImmune.language, and proves that it is in E (Cslib.Complexity.BiImmune.language_mem_E) and P-bi-immune (Cslib.Complexity.BiImmune.isBiImmune_language).

Words are enumerated by index (Cslib.Complexity.Ladner.word), as are machines: the machine with index i is the one described at the start of the i-th word, run by the universal function (Cslib.Complexity.Ladner.runIndexed). Requirement e concerns the machine with index e / 2. It asks for a word accepted by that machine inside the language when e is even, and outside it when e is odd. At stage n, requirement e is eligible (Cslib.Complexity.BiImmune.Eligible) when e < n, it has not acted before, and the machine accepts the n-th word within n steps. The least eligible requirement e, if any, acts (Cslib.Complexity.BiImmune.act is e + 1). The n-th word belongs to the language exactly when the requirement acting at stage n is even. Otherwise the word stays outside.

Each requirement acts at most once. If the machine of requirement e accepts at infinitely many stages, then e eventually acts: past the finitely many actions of smaller requirements, e is the least eligible requirement (Cslib.Complexity.BiImmune.exists_act_eq_succ). Let B be an infinite problem in P, decided by a machine within a polynomial time bound, and let i be an index of that machine. The words of B have unboundedly large indices, and from some point on the time bound is below the index. So both requirements 2 i and 2 i + 1 act, at stages whose words the machine accepts. These words are in B, one inside the language and one outside (Cslib.Complexity.BiImmune.exists_act_mem). Hence the language is P-bi-immune (Cslib.Complexity.isBiImmune_P_iff).

Stage n runs at most n machines for n steps each, so the table of the first n actions is polynomial-time in n in unary (Cslib.Complexity.BiImmune.computableInPolyTime_table). The word y has index below 2 ^ (|y| + 1), so its membership is computed in polynomial time from (y, 2 ^ |y|), and the language is in E (Cslib.Complexity.Ladner.setOf_index_mem_E_of_computableInPolyTime).

By Berman's theorem (CslibFrontier.Computability.Complexity.Classes.Immune.Complete), the language is not complete for E or EXP (Cslib.Complexity.BiImmune.not_polyTimeComplete_E_language, Cslib.Complexity.BiImmune.not_polyTimeComplete_EXP_language).

The problem is decidable, so every machine deciding it runs in superpolynomial time on almost every instance (Cslib.Complexity.BiImmune.isPolyTimeCore_univ_language): the universe is a polynomial complexity core (CslibFrontier.Computability.Complexity.Classes.Immune.PolyTimeCore).

Main definitions #

Main results #

References #

The construction #

The machine of requirement e accepts at stage n: the machine with index e / 2 accepts the n-th word within n steps.

The action at stage T.length, from the table T of the earlier actions: e + 1 for the least requirement e < T.length that has not acted and whose machine accepts, or 0.

The table of the actions at the first n stages.

The action at stage n: e + 1 if requirement e acts, 0 if none does.

The P-bi-immune problem: the words whose stage is used by an even requirement.

The least eligible requirement acts #

Requirement e is eligible at stage n: e < n, it has not acted before, and its machine accepts at stage n.

theorem Cslib.Complexity.BiImmune.act_eq_succ_iff {n e : ℕ} :
act n = e + 1 ↔ Eligible e n ∧ ∀ e' < e, ¬Eligible e' n

The least eligible requirement acts.

No requirement acts exactly when none is eligible.

theorem Cslib.Complexity.BiImmune.eq_of_act_eq_succ {m n e : ℕ} (hm : act m = e + 1) (hn : act n = e + 1) :
m = n

Each requirement acts at most once.

theorem Cslib.Complexity.BiImmune.exists_act_eq_succ {e : ℕ} (h : ∀ (N : ℕ), ∃ n ≥ N, accepts e n = true) :
∃ (n : ℕ), act n = e + 1

A requirement whose machine accepts at infinitely many stages acts: past the finitely many actions of smaller requirements, it is the least eligible requirement.

The problem is in E #

The problem is P-bi-immune #

theorem Cslib.Complexity.BiImmune.exists_act_mem {B : Set (List Bool)} (hB : B ∈ P Turing.MultiTapeTM.encBits) (hinf : B.Infinite) {r : ℕ} (hr : r < 2) :
∃ (i : ℕ) (n : ℕ), Ladner.word n ∈ B ∧ act n = 2 * i + r + 1

Every infinite problem in P is met by requirements of both parities: for r < 2, some requirement 2 * i + r acts at a stage whose word is in the problem.

The problem is not complete #

The problem is not complete for E under polynomial-time many-one reductions.

The problem is not hard for E under polynomial-time many-one reductions.

The problem is not complete for EXP under polynomial-time many-one reductions.

The problem is not hard for EXP under polynomial-time many-one reductions.

Every decider is slow almost everywhere #

The problem is decidable: it is decided within time c₁ 2 ^ (k n) + c₂.

Every machine deciding the problem runs in superpolynomial time almost everywhere: for every polynomially bounded p, it halts within p |x| steps on only finitely many x.