Verifiers, Certificates and the Class NP
Context: FIT2014_MOC · swaps deciding for verifying — the same move that separates sitting the exam from showing the degree certificate; the problem catalogue lives in Standard NP Problems and Certificates and the comparison machinery in Polynomial-Time Reductions
Quick Revision
- 🎯 Objective: a verifier for is a TM on two inputs that always halts, with the TM accepts , and every is rejected ➔ has a verifier of time complexity , .
- 📦 Core Components: certificate ➔ the guessed evidence | verifier ➔ the polynomial-time check | NDTM ➔ the equivalent machine model that supplies the letter N.
- ⚡ Key Constraint: the polynomial is in only — never in . That single bound silently caps the useful certificate length at symbols and is what makes provable.
📝 How It Works
1. Deciding versus verifying
- The distinction ➔ deciding answers “is ?” either way; verifying only confirms a Yes, and only when handed suitable evidence.
- Lecture’s two analogies ➔ people who can kick a football ➔ hand them a ball ⟹ that procedure is a decider, settling Yes and No alike. university graduates ➔ no efficient decider exists, but a degree certificate verifies membership instantly — and non-membership stays hard to verify.
- Asymmetry is the point ➔ is a class of languages whose Yes-instances have short, checkable evidence; nothing is claimed about the No-instances (that is ).
2. Verifier, certificate,
A verifier for is a TM taking two strings that (i) always halts; (ii) if , there exists making it accept; (iii) if , every makes it reject. The string is a certificate. A polynomial-time verifier has time complexity where .
- Acceptance restated ➔ is accepted iff it has a certificate that the verifier passes — so designing a certificate is designing the proof of membership.
- ➔ the class of languages possessing a polynomial-time verifier; the name is Nondeterministic Polynomial time, justified in §5 — it does not stand for “non-polynomial”.
- The four obligations of a membership proof ➔ ① specify the certificate; ② give the verifier as an algorithm; ③ prove it is a verifier (the iff chain); ④ prove it runs in polynomial time. Skipping ③ or ④ is where the marks go.
3. Worked membership proof —
- Certificate ➔ a function , stored as a list of colours indexed by vertex.
- Verifier ➔ for each edge : look up and ; if Reject and halt; if the loop completes with no violation, Accept and halt.
Claim 1 — it is a verifier
- Key move: the definition of 3-colourability is already an -statement over exactly the object used as the certificate — so the chain is one line. Choose the certificate to be the witness the definition quantifies.
Claim 2 — it is polynomial time
- Key move: is a deliberately loose bound — array lookup is faster than — and looseness costs nothing, because membership of needs only some polynomial. Do not optimise; bound and move on.
4. , and the exponential ceiling
Theorem. . Theorem. Every is decidable in time for some constant .
Derivation — both directions of the sandwich
➔ take a polynomial-time decider for and make it a verifier that ignores the certificate: on run the decider on and echo its answer. If every works (so one exists); if every fails. Time is unchanged, hence polynomial. ➔ let verify in time . Decider for on input : for each certificate , run ; Accept on the first success, Reject after exhausting them. It accepts iff some works and rejects iff every fails, which is the definition of a verifier ⟹ it decides .
- Key move: the certificate space looks infinite, but a TM reads at most one symbol per step, so anything past position is invisible to and need never be enumerated. The same one-symbol-per-step lemma reappears in Polynomial-Time Reductions.
5. Nondeterministic TMs — where the “N” comes from
- NDTM ➔ a Turing machine whose transition function may offer more than one action for a given (state, symbol) pair ⟹ one input spawns many possible computations. Every deterministic TM is an NDTM (the degenerate case).
- Acceptance ➔ accepts iff some computation path reaches Accept — exactly the NFA convention lifted to tapes.
- Nondeterministic decider ➔ halts on all inputs and the accepted language is . Polynomial-time NDTM ➔ time complexity , the maximum taken over all inputs of length and all computation paths for each.
Theorem. some polynomial-time NDTM is a nondeterministic decider for .
Derivation (outline, both directions)
Given a verifier of time , build that nondeterministically writes a string of length and then runs the verifier on deterministically. Guessing costs , checking costs . Given a polynomial-time NDTM deciding , fix an encoding of the sequence of choices made at each nondeterministic step and use that string as the certificate; the verifier replays the choices deterministically.
- Key move: guess-then-check certificate-plus-verifier. The certificate is the record of the lucky path.
- ⚡ Key Constraint: contrast DFA vs NFA, where nondeterminism costs nothing in expressive power. Here determinising an NDTM is only known to cost exponential time — which is precisely the open problem below.
6. The -versus- problem
- Conjecture ➔ : the biggest open problem in computer science and one of the biggest in mathematics, carrying a Clay Institute Millennium Prize of US$1 million. Many false solutions appear and continue to appear.
- The disputed middle ➔ in but not known to be in : SATISFIABILITY, 3-SAT, HAMILTONIAN CIRCUIT, 3-COLOURABILITY, VERTEX COVER, INDEPENDENT SET, GRAPH ISOMORPHISM, INTEGER FACTORISATION — see Standard NP Problems and Certificates.
- Known inside ➔ 2-SAT, EULERIAN CIRCUIT, 2-COLOURABILITY, CONNECTED GRAPHS, SHORTEST PATH, PRIMES, invertible matrices, all context-free and all regular languages ⟹ if the two pictures collapse into one.
⚠️ Common Mistakes
- 💡 Bounding the verifier in ➔ the definition fixes . Bounding by the certificate’s length would let an exponentially long certificate smuggle in exponential time.
- 💡 Proving only the Yes direction ➔ condition (iii) — every rejected when — is what forbids a certificate that fakes membership. A “verifier” that accepts some with verifies nothing.
- 💡 Reading NP as “not polynomial” ➔ it abbreviates Nondeterministic Polynomial, and is a theorem, so the reading is not merely wrong but self-contradictory.
- 💡 Claiming means “unsolvable” ➔ every language is decidable, in by brute-force certificate search. is a tractability question, not a computability one (Undecidability and the Halting Problem).
- 💡 Over-tightening the time bound ➔ marks come from exhibiting a polynomial. Optimising to earns nothing and wastes exam minutes.
🧠 Active Recall
You must show a language is in . What exactly do you have to produce, and which of the four parts do students omit?
Answer
- Short answer: the certificate, the verifier as an algorithm, the iff proof that it is a verifier, and the polynomial time bound. The two proofs are the parts that get dropped.
- Why: The certificate should be the object the definition already quantifies ➔ for 3-colourability the definition reads , so taking as the certificate makes Claim 1 a one-line chain, and Claim 2 need only reach some bound — for the edge loop with lookups is fine and deliberately loose.
If is defined by verifiers, why is it named after nondeterminism?
Answer
- Short answer: because iff a polynomial-time NDTM decides — guess-then-check and certificate-plus-verifier are two descriptions of one class.
- Why: The certificate encodes the choice sequence ➔ from a verifier, build an NDTM that nondeterministically writes of length then verifies; from a poly-time NDTM, record its nondeterministic choices as the certificate and replay them. Note the contrast with DFA vs NFA, where nondeterminism is free — for TMs the known cost is exponential, and whether it truly is is the vs question.
Why does exhaustive search over certificates terminate, given there are infinitely many strings ?
Answer
- Short answer: a TM running in steps reads at most symbols, so all certificates agreeing on that prefix behave identically — only distinct prefixes need testing.
- Why: One symbol per step is the lemma that bounds everything ➔ it converts an infinite search into a finite one and yields the decider’s bound, placing inside exponential time. The same lemma bounds in Polynomial-Time Reductions.