Guess and verify, for any language #
The guess-and-verify machine built for SAT is not in fact specific to SAT: it
takes an arbitrary deterministic verifier M, guesses a string of length at
most |x| + 1, pairs it with the input and runs M on the result. Every
structural theorem about it in SAT/Internal/GuessVerify is already stated for
an arbitrary language L; only the final assembly mentions SAT.
This module performs that assembly generically, first for witnesses of linear
length and then for any polynomial witness bound, by padding the input until the
bound is linear. Complexitylib.Classes.NP.WitnessConstruction repackages the
result as the proof NP.witnessNTMConstruction of the guess-and-verify
interface NP.WitnessNTMConstruction.
Main results #
Complexity.mem_NP_of_linear_witness— a language with a polynomial-time verifier and witnesses of length at most|x| + 1is inNPComplexity.mem_NP_of_poly_witness— the same for any polynomial witness bound, by padding the input until the bound is linear
The guess-and-verify machine decides any language whose members are exactly
the inputs with a short certificate accepted by M.
Guess and verify. A language whose members are exactly the inputs
carrying a certificate of length at most |x| + 1 that a polynomial-time
verifier accepts is in NP.
Any polynomial witness bound #
The input padded with a ruler long enough to make the witness bound linear.
Equations
- Complexity.padWith p x = Complexity.pair x (Complexity.polyRuler p x)
Instances For
The verifier for the padded language: run the original verifier on the unpadded input, and check that the padding really is long enough.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The padded language, whose witnesses are short enough for the linear guess-and-verify machine.
Equations
Instances For
Guess and verify, with any polynomial witness bound. A language whose
members are exactly the inputs carrying a certificate a polynomial-time verifier
accepts is in NP, provided the verifier only accepts certificates of
polynomial length.