Documentation

CslibFrontier.Computability.Complexity.Classes.Oracle.Substitution

Oracle substitution for polynomial-time oracle classes #

If an oracle language O₁ belongs to P^{O₂}, a polynomial-time computation relative to O₁ becomes one relative to O₂: each query to O₁ is answered by running the polynomial-time O₂-oracle program deciding O₁. The simulation runs a finite oracle machine for the outer computation and replaces each of its oracle steps by a call to the inner program; the outer clock bounds both the number and the length of the queries, so the composite stays polynomial.

The special case where O₁ many-one reduces to O₂ is Cslib.Complexity.PolyTimeReducible.PWithOracle_subset in CslibFrontier.Computability.Complexity.Classes.Oracle.Monotone, which also covers non-Boolean outputs.

Main results #

Oracle substitution for polynomial-time Boolean computations: if an oracle language O₁ belongs to P^{O₂} and f : α → Bool is computable in polynomial time relative to O₁, then f is computable in polynomial time relative to O₂.

A polynomial-time Boolean oracle computation extends to all raw inputs by running its machine under the same clock and reading the first output bit.

theorem Cslib.Complexity.PWithOracle_subset_of_mem_PWithOracle {α : Type} {O₁ O₂ : Set (List Bool)} (hO₁ : O₁ ∈ PWithOracle O₂ Turing.MultiTapeTM.encBits) (enc : α ↪ List Bool) :
PWithOracle O₁ enc ⊆ PWithOracle O₂ enc

If O₁ ∈ P^{O₂}, then P^{O₁} ⊆ P^{O₂}.

theorem Cslib.Complexity.NPWithOracle_subset_of_mem_PWithOracle {α : Type} {O₁ O₂ : Set (List Bool)} (hO₁ : O₁ ∈ PWithOracle O₂ Turing.MultiTapeTM.encBits) (enc : α ↪ List Bool) :
NPWithOracle O₁ enc ⊆ NPWithOracle O₂ enc

If O₁ ∈ P^{O₂}, then NP^{O₁} ⊆ NP^{O₂}.