TCS: What If P = NP?
What If P = NP?
From Decision to Search
Suppose SAT has a polynomial-time decision algorithm. We can recover a satisfying assignment through a sequence of decision queries
- Test whether the input formula is satisfiable; stop with failure if it is not
- Try setting the first unassigned variable to
- Keep that value if the restricted formula is satisfiable; otherwise set it to
- Repeat until all variables are assigned, then output the assignment
The invariant is that the currently restricted formula remains satisfiable. There are at most decision queries for variables, and each restricted instance has polynomial size
Searching for Arbitrary NP Witnesses
For a polynomial-time verifier and a candidate witness prefix , define the prefix-extension question
Use a fixed polynomial witness length, padding shorter witnesses through the verifier’s encoding if needed. The extension problem is in , since is a polynomial-length certificate
If , every polynomially bounded NP witness relation has a polynomial-time search algorithm: decide prefix extension and determine the witness one bit at a time
The prefix problem need not be identical to the original decision language. The general argument uses the assumption that all NP languages are in
Optimization and Applications
Binary Search on a Threshold
Suppose feasible solutions have polynomial-length encodings, feasibility is efficiently checked, and the objective has a polynomial-time computable integer value of polynomial bit length
For maximization, ask
This is an NP question. Binary search over the objective range uses polynomially many queries even when the range contains exponentially many integers, because its endpoints have polynomial bit length
After finding the optimum threshold, witness search recovers an optimal solution. This applies to problems such as maximum cut and longest simple path
Learning and Cryptography
For a finite hypothesis representation with polynomially many parameter bits and efficient evaluation, the question of whether some makes at most errors on a given sample is in
Under , the minimum empirical error and a parameter vector achieving it can therefore be found efficiently. Generalization to unseen examples still depends on the hypothesis class and the data distribution
A candidate preimage of an efficiently computable function is also efficiently verifiable. If , a preimage of a function value can be found by witness search, ruling out one-way functions in the usual computational sense
Likewise, when a secret key or equivalent explanation has polynomial length and can be checked against available data, finding one becomes an NP search task. Information-theoretic secrecy, such as a correctly used one-time pad, is governed by a different condition
Searching for Short Proofs
Let be a polynomial-time checker for a fixed formal proof system. Consider
The unary bound makes the candidate proof polynomial in the total input length. Thus this bounded proof-existence problem lies in
If , a proof can be found in time polynomial in whenever one of length at most exists
The bound is essential. A true statement may have no proof in the chosen system, or its shortest proof may be enormous. Efficient bounded proof search is compatible with incompleteness
Quantifier Alternation
NP uses one existential block over a polynomial-time predicate. More blocks give the polynomial hierarchy
For polynomially bounded strings and a polynomial-time predicate ,
The class is the union of the levels with any fixed constant number of alternating blocks
Assume . For fixed , the negation of is the NP question . Its answer can be computed in polynomial time and complemented
The remaining outer existential question is then another NP problem, also decidable in polynomial time. Repeating this argument for any fixed number of blocks gives
The number of blocks must be a fixed constant for this argument. An input may encode polynomially many alternating quantifiers in TQBF, which leads to the space complexity of the next lecture
Counting Is a Further Task
Given a circuit , define its number of satisfying inputs by
Counting accepting witnesses defines the function class . Knowing whether the count is zero does not directly determine its exact value
Stockmeyer’s approximate-counting theorem provides randomized multiplicative approximation with an NP oracle. Hashing helps estimate the size of the witness set through existence queries
If , those oracle queries become polynomial-time computations. Exact counting does not follow from the decision-to-search argument; an additional theorem would be needed to conclude that every function is polynomial-time computable
Oracle Machines and Relativization
An oracle machine can query membership in a fixed language . One oracle answer costs one step, while writing the query string still takes time
The resulting classes are denoted by and . For example,
A relativizing argument continues to work when the same arbitrary oracle is supplied to all the machines involved
An Oracle That Separates P and NP
For an oracle , define
This language is in : guess one length- string and ask the oracle
Enumerate clocked deterministic polynomial-time oracle machines . At stage , choose a fresh length larger than every string length fixed earlier and with larger than the running-time bound of on
Simulate while preserving previous oracle answers and answering every new query negatively. Freeze every answer made during this simulation
- If accepts, put no length- string in
- If rejects, put one length- string it never queried in
There is an unqueried string because the number of queries is smaller than . The final membership assignment changes no observed answer, so is wrong on
Subsequent stages preserve all frozen answers. Completing the oracle with negative answers at all unspecified strings yields
An Oracle That Makes Them Equal
Take . Its PSPACE-completeness and Savitch’s theorem, developed in Lecture 9, give
An NP oracle machine makes polynomially long queries; each TQBF query can be answered using polynomial space, which is reused between queries
Together, these two oracle worlds establish the relativization barrier. Any argument that remained valid for every common oracle could establish neither the equality nor the separation of and