Uniform diagonalization #
Schöning's uniform diagonalization theorem Schöning
(Cslib.Complexity.exists_mem_P_ite_notMem): let C₁, C₂ be recursively presentable classes
of sets of bit words, both closed under finite variations, and let A₁ ∉ C₁ and A₂ ∉ C₂ be
decidable. Then some G ∈ P makes the set G.ite A₁ A₂, which agrees with A₁ on G and with
A₂ off G, belong to neither class. This set is decidable, reduces to the marked union of A₁
and A₂, and reduces to A₂ when A₁ ∈ P and A₂ is neither empty nor everything. The two
predicates on classes live in
CslibFrontier.Computability.Complexity.Classes.RecursivelyPresentable, and the recursive
presentation of P lives in
CslibFrontier.Computability.Complexity.Classes.RecursivelyPresentable.PolyTime.
The proof is delayed diagonalization. Stage k separates the mixed set from the member of index
k / 2 of the first family (even k) or the second family (odd k). The words of length n are
put on the side of the stage at n. The stage at n advances over the stage at n - 1 when a
word of index below n separates the two sets, as seen by runs of n steps of both machines
(Turing.MultiTapeTM.Universal.runBool). This check takes polynomial time in n, so G ∈ P.
Since the sets of each side are infinitely different from the members of their family, every
stage is reached, and leaving stage k needs a separating word.
P itself meets the hypotheses: it is closed under finite variations
(Cslib.Complexity.closedUnderFiniteVariation_P), and it is recursively presentable by the
machines run within polynomial clocks (Cslib.Complexity.recursivelyPresentable_P).
Main definitions #
Cslib.Complexity.markedUnion:false :: xforx ∈ A₁andtrue :: xforx ∈ A₂.
Main results #
Cslib.Complexity.exists_mem_P_ite_notMem: Schöning's uniform diagonalization theorem.Cslib.Complexity.exists_mem_P_forall_ite_ne: the effective form, against two computable families of sets, each infinitely different fromA₁orA₂.Cslib.Complexity.isDecidable_ite,Cslib.Complexity.polyTimeReducible_ite_markedUnion,Cslib.Complexity.polyTimeReducible_ite_of_mem_P: the mixed set is decidable and reduces to the marked union, and toA₂whenA₁ ∈ P.Cslib.Complexity.polyTimeReducible_left_markedUnion,Cslib.Complexity.polyTimeReducible_right_markedUnion,Cslib.Complexity.polyTimeReducible_markedUnion,Cslib.Complexity.isDecidable_markedUnion,Cslib.Complexity.markedUnion_mem_NP: reduction and closure properties ofmarkedUnion.Cslib.Complexity.exists_mem_P_ite_notMem_P: the theorem withC₁ = P.
Implementation notes #
The classes are of sets of bit words (encBits), so the theorem is the binary-alphabet case of
the source statement. Decidable sets and presentations are computed by total native machines
(Turing.MultiTapeTM.IsComputable). The reduction to A₂ takes a member and a non-member of
A₂ in place of the hypothesis that A₂ is neither empty nor everything.
Ladner's density theorem, obtained by presenting polynomial-time degrees and cones, is proved in
CslibFrontier.Computability.Complexity.Classes.Ladner.Density, and recursive presentations of
NP, PSPACE, PH, and EXP are in
CslibFrontier.Computability.Complexity.Classes.RecursivelyPresentable.Classes.
References #
The construction #
The side of stage k: true (the first pair) at even stages, false at odd ones.
The clocked answer, within t steps, for membership of w in the set diagonalized at stage
k.
Two clocked answers that are both present and differ.
Whether a word with index below T.length separates the mixed set from the set diagonalized at
stage k, as seen by runs of T.length steps.
The stage after the table T of the earlier stages: the last stage, advanced by one if it has
a witness.
The table of the first n stages.
The stage at length n.
Soundness and completeness of the witnesses #
Clocked runs of dA b decide A b, and clocked runs of dF b decide the family F b, soundly
and eventually completely.
- soundF (b : Bool) (i : ℕ) (w : List Bool) (t : ℕ) (c : Bool) : Turing.MultiTapeTM.Universal.runBool (dF b) ((Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encBits) (i, w)) t = some c → (c = true ↔ w ∈ F b i)
- completeF (b : Bool) (i : ℕ) (w : List Bool) : ∃ (T : ℕ), ∀ (t : ℕ), T ≤ t → ∃ (c : Bool), Turing.MultiTapeTM.Universal.runBool (dF b) ((Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encUnary Turing.MultiTapeTM.encBits) (i, w)) t = some c
A separating word is eventually a witness.
Every stage is reached when each A b is infinitely different from every F b i: if the
stages stayed at k, the sets of the side of k would agree on all long words.
The mixed set differs from every diagonalized set.
The stages in polynomial time #
The tables of the stages are polynomial-time in their length, in unary.
The stages are polynomial-time on unary numbers.
Uniform diagonalization #
Uniform diagonalization, effective form. Let A₁, A₂ be decidable sets of words and
F₁, F₂ computable families of sets of words, with A₁ infinitely different from every member
of F₁ and A₂ from every member of F₂. Some G ∈ P makes the set agreeing with A₁ on G
and with A₂ off G differ from every member of both families.
Schöning's uniform diagonalization theorem. Let C₁, C₂ be recursively presentable
classes of sets of words, closed under finite variations, and A₁ ∉ C₁, A₂ ∉ C₂ decidable. Some
G ∈ P makes the set agreeing with A₁ on G and with A₂ off G belong to neither class.
The mixed set and marked union #
The mixed set is decidable when G, A₁ and A₂ are.
The left summand A reduces to markedUnion A B by prepending false.
The right summand B reduces to markedUnion A B by prepending true.
markedUnion A B reduces in polynomial time to any C with a non-member c₀ ∉ C whenever
both A and B reduce to C.
The marked union of two decidable sets of words is decidable.
The marked union of two problems in NP on bit words belongs to NP.
The mixed set reduces to the marked union when G ∈ P.
The mixed set reduces to A₂ when G and A₁ are in P and A₂ has a member and a
non-member: on G, the reduction answers with the member or the non-member.
Schöning's theorem for P against a second class.