Polynomial time relative to an oracle language #
An oracle language A : Set (List Bool) answers a word request w with the one-bit word
[decide (w ∈ A)] (Cslib.Complexity.languageOracle). A deterministic oracle algorithm is a
program WordQueryComp Unit β: a PFunctor.FreeM program whose calls are word requests and
whose later requests may depend on earlier replies. Run against A, it returns
OracleComp.interpret (m := Id) (languageOracle A) program.
f is computable in polynomial time relative to A
(Cslib.Complexity.ComputableInPolyTimeWithOracle) when one deterministic program computes f
against A and the program is strict oracle PPT (Cslib.Probability.IsOraclePPTOn) with one
channel: one finite-control machine, under one polynomial clock in the encoded input length,
reproduces the program's complete interaction with every stateful oracle. This is the oracle
Turing machine of Arora and Barak, Section 3.4 on the common machine
(Turing.MultiTapeMachine with oracle channels): each request symbol is written onto the query
buffer at the cost of one instruction, submitting a request costs one instruction, and the reply
bit is the first cell of the answer tape, read by the answer head with no further instruction.
The oracle's own computation is not charged. The certificate quantifies over every handler, not
only language oracles, so the program, not the oracle, determines which requests are made; the
machine's clock also bounds their number and length
(Cslib.Probability.IsOraclePPTOn.query_bounds).
The classes relativize P and NP by this one substitution: PWithOracle A enc and
NPWithOracle A enc are Cslib.Complexity.P and Cslib.Complexity.NP with
ComputableInPolyTime replaced by ComputableInPolyTimeWithOracle A. Hence NPWithOracle
uses verifiers with an oracle and certificates of exactly polynomial length. When the oracle is a
promise problem or an encoded class of oracles (PWithSharpPOracle, PWithPPOracle,
RPWithPromiseOracle), Cslib.Complexity.PolyTimeOracleProgram asks for one deterministic
polynomial-time oracle program whose function against every admissible oracle language satisfies a
given specification.
For a deterministic program and an answer function, OracleComp.queriesWith
(CslibFrontier/Languages/Probabilistic/QueriesWith.lean) lists the requests made. Only their
answers
matter (OracleComp.interpret_id_congr), which is the locality on which oracle constructions rest.
Main definitions #
Cslib.Complexity.WordQueryComp: deterministic programs making word requests.Cslib.Complexity.languageOracle: the replies of an oracle language.Cslib.Complexity.ComputableInPolyTimeWithOracle: polynomial time relative to an oracle.Cslib.Complexity.PolyTimeOracleProgram: one polynomial-time oracle program satisfying a specification across every admissible oracle language.Cslib.Complexity.PWithOracle,Cslib.Complexity.NPWithOracle:PandNPrelative to an oracle language.
Main results #
Turing.MultiTapeTM.ComputableInPolyTime.computableInPolyTimeWithOracle: polynomial time is polynomial time relative to every oracle.Cslib.Complexity.PolyTimeOracleProgram.of_polyTime,Cslib.Complexity.PolyTimeOracleProgram.exists_computableInPolyTimeWithOracle,Cslib.Complexity.PolyTimeOracleProgram.of_computableInPolyTimeWithOracle.Cslib.Complexity.P_subset_PWithOracle,Cslib.Complexity.NP_subset_NPWithOracle.
References #
Deterministic programs whose calls are word requests on the channels Operation, answered by
words.
Instances For
Language oracles that agree on every word requested by program under one of them give the
same run.
f is computable in polynomial time relative to the oracle language A: a deterministic
word-query program computes f against A, and one finite machine under one polynomial clock
realizes the program against every stateful oracle, charging request construction and reply
access. This is the oracle Turing machine of Arora and Barak, Section 3.4.
Instances For
A polynomial-time computation makes no request, so it is polynomial time relative to every oracle.
One deterministic polynomial-time oracle program whose function against every oracle language
satisfying Admissible satisfies Spec. The program is fixed before the oracle language, so
answers on words unconstrained by Admissible may be arbitrary.
Instances For
ComputableInPolyTimeWithOracle is PolyTimeOracleProgram for a single oracle language and a
single target function.
A polynomial-time function makes no oracle request, so it satisfies Spec against every
admissible oracle language whenever g does.
Evaluating a PolyTimeOracleProgram against any admissible oracle language A yields a
function computable in polynomial time relative to A satisfying Spec.
A function computable in polynomial time relative to a single oracle language A witnesses
PolyTimeOracleProgram whenever A is the unique admissible oracle language.
The problems decidable in polynomial time relative to the oracle language A, with respect to
the encoding enc of instances: Cslib.Complexity.P with an oracle
Arora and Barak, Section 3.4.
Instances For
The problems with verifiers computable in polynomial time relative to the oracle language A
and polynomially long certificates: Cslib.Complexity.NP with an oracle
Arora and Barak, Section 3.4.