Theorem. Certificates and Verifiers
[certificates-verifiers]
Theorem. Certificates and Verifiers [certificates-verifiers]
NP has two main, equivalent definitions:
- There exists a nondeterministic polytime TM that decides .
There exists a deterministic polytime TM and a constant s.t.:
- where is the “input”, is the “certificate”, is the “verifier”
i.e. for the three color graph, give us a colored graph and we can verify it
The certificate serves as the verifier ’s substitute for nondeterminism.
Example. Verifying 3colormap
Claim: 3colormap Np (complexity class).
- Must find a deterministic polytime TM V s.t.
Code for : on input
- If not of form , where is a Graph, reject
- From , extract values for each
- For every edge :
if color(u) == color(v), reject - Otherwise accept
- does exist, it’s simply a valid coloring of the graph
To show correctness of , we need three things:
If and G is 3-colorable: need and .
- It does exist, can be a valid 3 coloring of . Note: and
If where G is 3-colorable: then no certificate should make erroneously accept.
- If not of form : definitely rejects.
- If of form by not 3-colorable, then must reject because it always checks that is a valid coloring.
Must check that runs in time polynomial in .
Example. Proofs of equivalence of our NP definitions
Proof.
- Given verifier , must construct a NTM deciding
Inputs to the verifier are and , with
- : input string
- : certificate (like a proof that is in the language)
Code for :
- On input , nondeterministically pick with
- Run on input
- Accept if accepts. Reject if rejects.
i.e. Suppose . If , so does not accept .
Proof.
- Given an NTM , you can convert that into a verifier for .
- Input to is , runtime is at most
Idea: simulates the tree, but only on a single branch of configuration tree. specifies which branch. nondeterminism comes into play by letting us pick the correct branch.
- our nondeterminism lets us pick the correct branch: then the term is the depth of the path, which is at most polynomial
Code for :
- Simulate deterministically on input , using as the sequence of nondeterministic decisions
- Accept if accepts. Reject if rejects.