NP relations #
An NP relation is a search problem whose solutions are checked in polynomial time: Goldreich's
class PC Goldreich, Definition 2.3. Here it is presented, like NP itself
(Cslib.Complexity.NP), by a certificate-length polynomial p and a verifier V computable in
polynomial time: w is a witness for a when w has length exactly p (enc a).length and
V (a, w) holds (Cslib.Complexity.NPRelation.IsWitness). Exact certificate lengths are the
convention of Cslib.Complexity.IsVerifier; Goldreich only bounds the length of a solution.
An NP relation is a problem in NP together with a chosen verifier: its language, the instances
that have a witness, satisfies IsVerifier by definition
(Cslib.Complexity.NPRelation.isVerifier_language), and every problem in NP is the language of
some NP relation (Cslib.Complexity.mem_NP_iff_exists_npRelation). Witness-preserving (Levin)
reductions are defined between NP relations in
CslibFrontier.Computability.Complexity.Reduction.Levin.
Main definitions #
Cslib.Complexity.NPRelation: a certificate-length polynomial and a polynomial-time verifier.Cslib.Complexity.NPRelation.IsWitness: the relation the verifier defines.Cslib.Complexity.NPRelation.language: the instances that have a witness.
Main results #
Cslib.Complexity.NPRelation.isVerifier_language: the verifier verifies the language.Cslib.Complexity.NPRelation.language_mem_NP: the language is inNP.Cslib.Complexity.mem_NP_iff_exists_npRelation: the problems inNPare exactly the languages of NP relations.
References #
- O. Goldreich, Computational Complexity: A Conceptual Perspective; numbering of the author's online draft of 30 December 2006.
An NP relation over instances encoded by enc: a polynomial giving the length of
certificates as a function of the length of the encoded instance, and a verifier computable in
polynomial time on encoded instance–certificate pairs. This is Goldreich's class PC
Goldreich, Definition 2.3 with certificates of exactly the prescribed length.
- certLength : Polynomial ℕ
The length of certificates, as a polynomial in the length of the encoded instance.
The verifier, on an instance and a certificate.
- computableInPolyTime_verifier : Turing.MultiTapeTM.ComputableInPolyTime self.verifier (Turing.MultiTapeTM.encPair enc Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBool
The verifier is computable in polynomial time.
w is a witness for a: it has the prescribed length and the verifier accepts it.
Instances For
The language of an NP relation: the instances that have a witness.
The verifier of an NP relation verifies its language.
If the verifier of an NP relation verifies A, then A is its language.
The language of an NP relation is in NP.