In this lecture we prove the Karp-Lipton theorem that if all NP problems have polynomial size circuits then the polynomial hierarchy collapses. A nice application is a theorem of Kannan, showing that, for every , there are languages in requiring circuits of size . The next result we wish to prove is that all approximate combinatorial counting problem can be solved within the polynomial hierarchy. Before introducing counting problems and the hashing techniques that will yield this result, we prove the Valiant-Vazirani theorem that solving SAT on instances with exactly one satisfying assignment is as hard as solving SAT in general.

**1. The Karp-Lipton Theorem **

Theorem 1 (Karp-Lipton)If then and therefore the polynomial hierarchy would collapse to its second level.

Before proving the above theorem, we first show a result that contains some of the ideas in the proof of the Karp-Lipton theorem.

Lemma 2If then for every polynomial time computable and every polynomial , there is a family of polynomial size circuits such that

*Proof:* We define the circuits as follows:

, on input x and bits , outputs 1 if and only if there is a satisfying assignment for where .

Also, each circuit realizes an **NP** computation, and so it can be built of polynomial size. Consider now the sequence , , , , as shown in the following picture:

The reader should be able to convince himself that this is a satisfying assignment for if it is satisfiable, and a sequence of zeroes otherwise.

We now prove the Karp-Lipton theorem.

*Proof:* } We will show that if then . By a result in a previous lecture, this implies that .

Let , then there is a polynomial and a polynomial-time computable such that

By using Lemma 2, we can show that, for every , there is a circuit of size polynomial in such that for every of length and every , ,

Let be a polynomial upper bound to the size of .

So now we have that for inputs of length ,

which shows that is in .

**2. Kannan’s Theorem **

Although it is open to prove that the polynomial hierarchy is not contained in , it is not hard to prove the following result.

Theorem 3For every polynomial , there is a language such that .

Note that Theorem is not saying that , because for that to be true we would have to be able to construct a single language such that for every polynomial we have , instead of constructing a different language for each polynomial. (This is an important difference: the time hierarchy theorem gives us, for every polynomial , a language such that , but this doesn’t mean that .)

Kannan observed the following consequence of Theorem 2 and of the Karp-Lipton theorem.

Theorem 4For every polynomial , there is a language such that .

*Proof:* We consider two cases:

- if ; then we are done because .
- if , then , so by the Karp-Lipton theorem we have , and the language given by Theorem 2 is in .

**3. The Valiant-Vazirani Theorem **

In this section we show the following: suppose there is an algorithm for the satisfiability problem that always find a satisfying assignment for formulae that have exactly one satisfiable assignment (and behaves arbitrarily on other instances): then we can get an **RP** algorithm for the general satisfiability problem, and so .

We prove the result by presenting a randomized reduction that given in input a CNF formula produces in output a polynomial number of formulae . If is satisfiable, then (with high probability) at least one of the is satisfiable and has exactly one satisfying assignment; if is not satisfiable, then (with probability one) all are unsatisfiable.

The idea for the reduction is the following. Suppose is a satisfiable formula with variables that has about satisfying assignments, and let be a hash function picked from a family of pairwise independent hash functions: then the average number of assignments such that is true and is about one. Indeed, we can prove formally that with constant probability there is exactly one such assignment,\footnote{ For technical reasons, it will be easier to prove that this is the case when picking a hash function .} and that there is CNF formula (easily constructed from and ) that is satisfied precisely by that assignment. By doing the above construction for values of ranging from to , we obtain the desired reduction. Details follow.

Definition 5Let be a family of functions of the form . We say that is a family of pair-wise independent hash functions if for every two different inputs and for every two possible outputs we have

Another way to look at the definition is that for every , when we pick at random then the random variables and are independent and uniformly distributed. In particular, for every and for every we have .

For vectors and bits , define as where , and let be the family of functions defined this way. Then it is not hard to see that is a family of pairwise independent hash functions.

Thanks again.

Are pdfs of these lecture notes available? I noticed that the handout at http://theory.stanford.edu/~trevisan/cs254-10/lecture06.pdf is missing Kannan’s theorem.

I have made all the corrections that people have suggested in past comments (thanks to all!) and synchronized the pdf files with the versions posted here

No proof of Theorem 3? =(

Also, a small typo: all occurrences of “Theorem 2” should be “Theorem 3”

Regarding Theorem 3, Kannan first argues directly about \Sigma_4 (not \Sigma_3). Or is there a similarly easy argument that applies to \Sigma_3?

I don’t know what’s the original proof of Kannan, but consider the language where, on input x of length n, I output h(x), where h() is the lexicographically first function among those that (i) depend only on the first 2klog n bits of the input and (ii) have circuit complexity > n^k.

Then the language is in , because it is formulated as

if and only if

there exists an h (specified as a truth-table of a function on 2klog n bits) such that:

1) for all circuits C of size less than n^k (operating on 2klog n input bits), C and h compute different functions;

2) for all functions g smaller than h in lexicographic order, there exists a circuit C of size less than n^k (operating on 2klog n input bits) such that g and C compute the same function

note that you can check in deterministic polynomial time whether C and g compute the same function.

What was Kannan’s proof?

What was Kannanâ€™s proof?The same, except that he looked at functions on n-bit inputs and so (essentially) used another alternation to check whether C and g compute the same function.