Documentation

CslibFrontier.Computability.Complexity.Reduction.Turing

Polynomial-time Turing reductions and the Turing bridge #

A polynomial-time Turing reduction (Cook reduction) A ≤ᵖ_T B allows adaptive queries to an oracle for B within polynomial time Ladner, Lynch and Selman, Arora and Barak, Section 3.4.

Main definitions #

Main results #

References #

def Cslib.Complexity.PolyTimeTuringReducible {α β : Type} (encA : α ↪ List Bool) (encB : β ↪ List Bool) (A : Set α) (B : Set β) :

A is polynomial-time Turing reducible to B (A ≤ᵖ_T B): some algorithm deciding A runs in polynomial time relative to an oracle for the encoded language of B Ladner, Lynch and Selman.

Query and resource conventions: an algorithm is represented by a single deterministic, adaptive WordQueryComp program certified by IsOraclePPTOn. The clock is polynomial in |encA a|, with each query symbol costing one step, bounding both query length and the number of queries via IsOraclePPTOn.query_bounds. Oracle evaluation itself takes one step.

theorem Cslib.Complexity.polyTimeTuringReducible_iff_mem_PWithOracle {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} :
PolyTimeTuringReducible encA encB A B ↔ A ∈ PWithOracle (⇑encB '' B) encA

The Turing bridge: A ≤ᵖ_T B if and only if A ∈ P^B with respect to the encoded oracle language encB '' B.

On bitstring languages with the default encoding encBits, A ≤ᵖ_T B is exactly A ∈ P^B.

theorem Cslib.Complexity.PolyTimeReducible.polyTimeTuringReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : PolyTimeReducible encA encB A B) :

Every polynomial-time many-one reduction is a polynomial-time Turing reduction making a single query to the oracle.

theorem Cslib.Complexity.PolyTimeOneOneReducible.polyTimeTuringReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : PolyTimeOneOneReducible encA encB A B) :

A one-one reduction is a polynomial-time Turing reduction.

Truth-table reductions are Turing reductions #

One step of queryWords: ask the first remaining word, and append whether its reply begins with true to the accumulated answer word.

Ask the oracle every word of the list, in order, and collect the one-bit answers.

Asking every word of a list and collecting the one-bit answers is strict oracle PPT: each step pops one word from the framed list and appends one bit to the answer word, so the encoded state never grows.

theorem Cslib.Complexity.interpret_queryWords (O : Set (List Bool)) (words : List (List Bool)) :
OracleComp.interpret (languageOracle O) (queryWords words) = List.map (fun (word : List Bool) => decide (word ∈ O)) words

Interpreting queryWords words against languageOracle O returns the list of membership decisions words.map (fun word => decide (word ∈ O)).

Evaluating membership in O across a list of words is computable in polynomial time relative to O.

Computing the semantic answer word truthTableAnswers (q ⁻¹' B) r of a polynomial-time batch of queries (r, q) is polynomial time relative to the encoded oracle language encB '' B.

theorem Cslib.Complexity.PolyTimeTruthTableReducible.polyTimeTuringReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : PolyTimeTruthTableReducible encA encB A B) :

Every polynomial-time truth-table reduction is a polynomial-time Turing reduction (≤_tt ⇒ ≤_T) Ladner, Lynch and Selman.

theorem Cslib.Complexity.PolyTimeKTruthTableReducible.polyTimeTuringReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} {k : ℕ} (h : PolyTimeKTruthTableReducible k encA encB A B) :

Every k-truth-table reduction is a polynomial-time Turing reduction (≤_{k-tt} ⇒ ≤_T).

theorem Cslib.Complexity.PolyTimeBTTReducible.polyTimeTuringReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : PolyTimeBTTReducible encA encB A B) :

Every bounded truth-table reduction is a polynomial-time Turing reduction (≤_btt ⇒ ≤_T).

theorem Cslib.Complexity.PolyTimePTTReducible.polyTimeTuringReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : PolyTimePTTReducible encA encB A B) :

Every positive truth-table reduction is a polynomial-time Turing reduction (≤_ptt ⇒ ≤_T).

theorem Cslib.Complexity.PolyTimeDTTReducible.polyTimeTuringReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : PolyTimeDTTReducible encA encB A B) :

Every disjunctive truth-table reduction is a polynomial-time Turing reduction (≤_dtt ⇒ ≤_T).

theorem Cslib.Complexity.PolyTimeCTTReducible.polyTimeTuringReducible {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : PolyTimeCTTReducible encA encB A B) :

Every conjunctive truth-table reduction is a polynomial-time Turing reduction (≤_ctt ⇒ ≤_T).

Transitivity of Turing reductions #

P relative to an oracle is closed under polynomial-time Turing reductions to word languages.

Polynomial-time Turing reductions through word languages compose (≤_T ∘ ≤_T ⇒ ≤_T).

Every problem reduces to itself under polynomial-time Turing reductions.

theorem Cslib.Complexity.PolyTimeReducible.trans_turing {α β γ : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {encL : γ ↪ List Bool} {A : Set α} {B : Set β} {L : Set γ} (hAL : PolyTimeReducible encA encL A L) (hLB : PolyTimeTuringReducible encL encB L B) :

Pre-composing a polynomial-time Turing reduction with a polynomial-time many-one reduction yields a polynomial-time Turing reduction.

theorem Cslib.Complexity.PolyTimeTuringReducible.compl_left {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {A : Set α} {B : Set β} (h : PolyTimeTuringReducible encA encB A B) :

Negating the boolean output of the decider reduces the complement Aᶜ to B.

A language's complement is polynomial-time Turing reducible to the language itself.

P is closed under polynomial-time Turing reductions to word languages.

def Cslib.Complexity.PolyTimeTuringHard {β : Type} (C : {α : Type} → (α ↪ List Bool) → Set (Set α)) (encB : β ↪ List Bool) (B : Set β) :

B is hard for the class C under polynomial-time Turing reductions: every problem in C Turing-reduces to B.

def Cslib.Complexity.PolyTimeTuringComplete {β : Type} (C : {α : Type} → (α ↪ List Bool) → Set (Set α)) (encB : β ↪ List Bool) (B : Set β) :

B is complete for the class C under polynomial-time Turing reductions: it belongs to C and is Turing-hard for C.

@[reducible, inline]
abbrev Cslib.Complexity.NPTuringHard {β : Type} (encB : β ↪ List Bool) (B : Set β) :

Hardness for NP under polynomial-time Turing reductions.

@[reducible, inline]
abbrev Cslib.Complexity.NPTuringComplete {β : Type} (encB : β ↪ List Bool) (B : Set β) :

Completeness for NP under polynomial-time Turing reductions.

@[reducible, inline]
abbrev Cslib.Complexity.coNPTuringHard {β : Type} (encB : β ↪ List Bool) (B : Set β) :

Hardness for coNP under polynomial-time Turing reductions.

@[reducible, inline]
abbrev Cslib.Complexity.coNPTuringComplete {β : Type} (encB : β ↪ List Bool) (B : Set β) :

Completeness for coNP under polynomial-time Turing reductions.

theorem Cslib.Complexity.coNPHard.npTuringHard {β : Type} {encB : β ↪ List Bool} {B : Set β} (hB : coNPHard encB B) :

Every coNP-hard problem is NP-hard under polynomial-time Turing reductions: to decide A ∈ NP, query the coNP-hard oracle on the many-one reduction of Aᶜ ∈ coNP and negate the answer.

theorem Cslib.Complexity.NPHard.coNPTuringHard {β : Type} {encB : β ↪ List Bool} {B : Set β} (hB : NPHard encB B) :

Every NP-hard problem is coNP-hard under polynomial-time Turing reductions: to decide A ∈ coNP, query the NP-hard oracle on the many-one reduction of Aᶜ ∈ NP and negate the answer.

@[reducible, inline]
abbrev Cslib.Complexity.PPTuringHard {β : Type} (encB : β ↪ List Bool) (B : Set β) :

Hardness for PP under polynomial-time Turing reductions.

@[reducible, inline]
abbrev Cslib.Complexity.PPTuringComplete {β : Type} (encB : β ↪ List Bool) (B : Set β) :

Completeness for PP under polynomial-time Turing reductions.

@[reducible, inline]
abbrev Cslib.Complexity.PSPACETuringHard {β : Type} (encB : β ↪ List Bool) (B : Set β) :

Hardness for PSPACE under polynomial-time Turing reductions.

@[reducible, inline]
abbrev Cslib.Complexity.PSPACETuringComplete {β : Type} (encB : β ↪ List Bool) (B : Set β) :

Completeness for PSPACE under polynomial-time Turing reductions.

theorem Cslib.Complexity.PolyTimeHard.polyTimeTuringHard {β : Type} {encB : β ↪ List Bool} {B : Set β} {C : {α : Type} → (α ↪ List Bool) → Set (Set α)} (h : PolyTimeHard (fun {α : Type} => C) encB B) :
PolyTimeTuringHard (fun {α : Type} => C) encB B

Every problem hard for C under polynomial-time many-one reductions is also hard for C under polynomial-time Turing reductions.

theorem Cslib.Complexity.PolyTimeHard.polyTimeTuringHard_of_turing {β γ : Type} {encB : β ↪ List Bool} {encL : γ ↪ List Bool} {B : Set β} {L : Set γ} {C : {α : Type} → (α ↪ List Bool) → Set (Set α)} (hL : PolyTimeHard (fun {α : Type} => C) encL L) (hLB : PolyTimeTuringReducible encL encB L B) :
PolyTimeTuringHard (fun {α : Type} => C) encB B

A problem that is Turing-reducible from a many-one hard problem is Turing-hard.

theorem Cslib.Complexity.PolyTimeTuringHard.trans {γ : Type} {encL : γ ↪ List Bool} {L : Set γ} {C : {α : Type} → (α ↪ List Bool) → Set (Set α)} {B : Set (List Bool)} (hB : PolyTimeTuringHard (fun {α : Type} => C) Turing.MultiTapeTM.encBits B) (hBL : PolyTimeTuringReducible Turing.MultiTapeTM.encBits encL B L) :
PolyTimeTuringHard (fun {α : Type} => C) encL L

Turing hardness transfers along Turing reductions from a word language: if every problem of C Turing-reduces to B ⊆ {0,1}* and B Turing-reduces to L, then every problem of C Turing-reduces to L. With C = NP and L ∈ NP, this is the Cook-reduction form of Goldreich, Proposition 2.20 (draft r1.pdf of 30 December 2006, PDF p. 103, printed p. 78), where NP-hardness allows arbitrary Cook reductions and problems are sets of bit strings. The intermediate problem is a word language because a Turing reduction to B under an encoding encB may ask about words outside the range of encB.

theorem Cslib.Complexity.PolyTimeHard.subset_P_of_turing_mem_P {γ : Type} {encL : γ ↪ List Bool} {L : Set γ} {C : {α : Type} → (α ↪ List Bool) → Set (Set α)} {B : Set (List Bool)} (hL : PolyTimeHard (fun {α : Type} => C) encL L) (hLB : PolyTimeTuringReducible encL Turing.MultiTapeTM.encBits L B) (hB : B ∈ P Turing.MultiTapeTM.encBits) {α : Type} (encA : α ↪ List Bool) :
C encA ⊆ P encA

Hardness transfer to P: if a problem hard for C under many-one reductions Turing-reduces to a problem B ∈ P, then C ⊆ P.

NP-hardness transfer: if an NP-hard problem Turing-reduces to a language in P, then P = NP.

PP-hardness transfer: if a PP-hard problem Turing-reduces to a language in P, then P = PP.

PSPACE-hardness transfer: if a PSPACE-hard problem Turing-reduces to a language in P, then P = PSPACE.

theorem Cslib.Complexity.PolyTimeTuringHard.subset_P_of_mem_P {C : {α : Type} → (α ↪ List Bool) → Set (Set α)} {B : Set (List Bool)} (hB_hard : PolyTimeTuringHard (fun {α : Type} => C) Turing.MultiTapeTM.encBits B) (hB : B ∈ P Turing.MultiTapeTM.encBits) {α : Type} (encA : α ↪ List Bool) :
C encA ⊆ P encA

A problem that is Turing-hard for C and belongs to P forces C ⊆ P.

If an NP-hard problem Turing-reduces to a problem in NP ∩ coNP, then NP = coNP.