The class NP #
NP is defined through polynomial-time verifiers Arora and Barak, Definition 2.1:
A ∈ NP enc when there are a polynomial p and a function V : α × List Bool → Bool, computable
in polynomial time on inputs encPair enc encBits (a, w) = frame (enc a) ++ w, such that a ∈ A
exactly when some certificate w of length p (enc a).length makes V (a, w) true.
Two details follow the textbook and matter for reductions. The certificate length is fixed, so the
input length of the verifier is a function of the instance alone. And p is a polynomial, not
merely a polynomially bounded function: a reduction from an NP problem must be able to compute
where the certificate ends, which an arbitrary bound would not allow.
NP is exactly the class of problems decided in polynomial time by nondeterministic machines
with a binary alphabet and finitely many states (Cslib.Complexity.mem_NP_iff_decidableInPolyTime
in CslibFrontier.Computability.Complexity.Classes.NP.Nondeterministic): such a machine guesses a
certificate and verifies it, and conversely a verifier checks an encoded accepting computation.
Verifiers are usually built from short certificates padded with false to the prescribed length
(Cslib.Complexity.IsVerifier.of_padding);
CslibFrontier.Computability.Complexity.Classes.NP.Witness
builds them from polynomial-time witness relations.
The verifier's efficiency can equally be stated in upstream terms: some machine computes it, in the
sense of Turing.MultiTapeTM.ComputableInTimeAndSpaceOfLength, within time and space bounded by
polynomially bounded functions of the length of its encoded input, which pairs the instance with
the certificate (Cslib.Complexity.mem_NP_iff_exists_computableInTimeAndSpaceOfLength).
Main definitions #
Cslib.Complexity.IsVerifier: the verifier condition.Cslib.Complexity.NP,Cslib.Complexity.coNP.
Main results #
Cslib.Complexity.mem_NP_iff_exists_computableInTimeAndSpaceOfLength:NPwith verifiers computed in the sense of upstreamTuring.MultiTapeTM.ComputableInTimeAndSpaceOfLength.Cslib.Complexity.IsVerifier.of_padding: a verifier that accepts certificates of exactly the prescribed length only for members, and accepts for every member some short prefix whatever padding byfalsefollows it, verifies with certificates of exactly that length.Cslib.Complexity.IsVerifier.guard: guarding a verifier by a test on instances verifies the members that pass the test.Cslib.Complexity.NP_eq_coNP_iff_coNP_subset_NP:NP = coNPexactly whencoNP ⊆ NP.
References #
The problems with polynomial-time verifiers and polynomially long certificates, with respect to
the encoding enc of instances Arora and Barak, Definition 2.1.
Instances For
NP in upstream terms: A ∈ NP enc exactly when, for a polynomial p, some verifier for
A with certificates of length p is computed by a machine with a binary alphabet and finitely
many states within time and space bounded by polynomially bounded functions of the length of the
encoded pair of an instance and a certificate.
Padded certificates #
Padded certificates. A verifier verifies A with certificates of length exactly
p (enc a).length if it accepts certificates of that length only for members of A, and every
member has a prefix u of at most that length which is accepted whatever padding by false
follows it.
Guarding a verifier by a test c on instances verifies the members of A that pass the
test.
The problems whose complements are in NP Arora and Barak, Section 2.6.