Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Lecture 17

In-class notes: CS 505 Spring 2025 Lecture 17

Continuing our discussion on circuits, recall that is the set of all languages that are decidable by an -sized circuit family , where for all , we have if and only if .

We highlight two facts related to circuits.

  1. Any (3)CNF Boolean formula is a special-case of circuits.
  2. Recall at the beginning of class this semester, we stated that every Boolean function has an sized CNF formula computing it. This readily implies that any such function is computable by an -sized circuit.
    • Shannon improved this bound to for any such .
    • Others improved over Shannon, giving an upper bound of .

Circuit Complexity: P/poly

We’ll not discuss what complexity theorists feel is one of the most important circuit complexity classes: . Intuitively, this is the circuit equivalent of .

Definition. The class is the set of all polynomial-sized circuits. That is, .

Theorem. .

Proof. First, recall that any time- Turing machine has an equivalent oblivious Turing machine running in time (in class, we saw a simpler proof of ). The properties of this machine are as follows.

  1. For all , .
  2. At any timestep , the position of the tape heads of are a function of and the current timestep (that is, they only depend on these two quantities).

Crucially, (2) above tells us for any fixed input length , the machine for any moves its heads the exact same way. Now, to show the theorem, we will argue that every time- oblivious TM has an -sized circuit family deciding it. The remainder of the proof will be a high-level overview.

Let denote the runtime of . For timestep , we define to be a snapshot of the execution of on input . This snapshot contains

  • The current state of at timestep
  • All symbols under the tape heads of .

Since for every fixed Turing machine, the number of states and tapes is constant, we have that for every . Now, we define a transcript of as , where is the initial snapshot of in its initial configuration, and snapshot follows from via the transition function. That is, we can write (to abuse notation).

The key observation here is that since each is constant-size, and moving from to for every only depends on and , we can compute each using a constant-sized circuit. This constant-sized circuit, which we denote by , takes as input and (and assumes that ) and outputs . Then, to construct the final circuit , we simply compose all of these sub-circuits together to compute , and a final sub-circuit which reads and outputs if and only if contains the accept state.
This circuit has size , and we can define such a circuit for every input length . Finally, the circuit has worst-case size if we started with a non-oblivious Turing machine.

Note. In the above proof, the transformation from the non-oblivious Turing machine to a circuit can be performed in polynomial-time and logarithmic space. We will use this fact later.

P is a strict subset of P/poly

The non-uniform power of can be showcased in a number of ways. Here, we’ll first show that the inclusion of the above theorem is strict. That is, . This follows from last lecture when we stated that any unary language is in .

Lemma. For any , we have .

Proof. For every , we have two cases. First, if , we define the circuit to be the constant-sized circuit encoding the Boolean formula , ignoring all other input bits.1 This formula always outputs , so it will always reject since (and no other strings of length are in too).

Now, if , we define to be the -size circuit encoding . This formula outputs if and only if .

Why does this show ? It is because we can encode Turing undecidable problems into unary languages. Consider the following unary halting problem language.

Clearly, , so , but is not Turing decidable!

Alternate Proof of Cook-Levin Theorem

We can use circuits and obtain an alternate proof of the Cook-Levin theorem. To do this, we’ll need the language of circuit satisfiablility. We let denote the set of all strings such that encodes a circuit with a -bit output and there exists such that .

Theorem. is NP-complete.

Proof. It is clear that since given the encoding and a string , one can check in time if . Now, we show that is NP-hard. To see this, we must show that for all , we have . Fortunately, in our proof that , the transformation from a Turing machine running in time to a -sized circuit family is (1) a polynomial-time transformation; and (2) works for non-deterministic Turing machines as well. Or, if we strictly use deterministic Turing machines, this proof shows how to transform any polynomial-time verifier (i.e., iff such that ) into a polynomial-sized circuit family such that if and only if such that .

With the above theorem, to show an alternate proof of the Cook-Levin theorem, we must now show that . This is done by constructing a 3CNF formula as follows. Consider any circuit and any node in with parent nodes and .

  1. If is the AND of and , we encode the Boolean formula “” in the formula , using the fact that the Boolean operator “” can be written as . To turn this into a 3CNF, we can encode “” as 4 clauses in 3CNF form. The final expression will be
  2. If is the OR of and , we again do the same thing as above. This will result in 3 clauses in 3CNF form; namely, where we can turn the two 2CNF clauses into 3CNF by simply repeating a variable already in the clause.
  3. If is the NOT of , then we simply encode into a 3CNF, resulting in 2 clauses in 3CNF form.

Crucially, for every triple of nodes (or just in the case of NOT), there is a constant-sized 3CNF formula on 3 (or 2) variables to compute it. This means that , so the transformation is polynomial-time in . Finally, clearly we have that is satisfiable if and only if is satisfiable. Thus, we have given an alternate proof of the Cook-Levin Theorem.

Corollary. If , then .2

Uniformly Generated Circuits

So far we have seen that circuits are quite powerful and can decide Turing undecidable languages. This is because of the non-uniform computation model of circuits. In particular, to show that , it is enough that there exists a circuit family which decides . This does not ever consider if this family is constructible at all! So this begs the natural question: what if we restrict our attention to circuit families which are only efficiently constructible?

Definition. A circuit family is said to be P-uniform if there exists a polynomial-time Turing machine such that for all , . That is, outputs the description of the circuit in time for some constant .

Unfortunately, restricting our attention to such circuits only gives us P.

Theorem. A language is decidable by a P-uniform circuit family if and only if .

Proof. For all , let . Suppose that is decidable by a P-uniform circuit family . This means that if and only if , where in time. Define a new Turing machine that on input simply runs to obtain , then evaluates and outputs the circuit outputs. Clearly, this machine runs in polynomial time since and runs in time.

The other direction follows directly from the above corollary: implies . In particular, for any with Turing machine , we can construct a new DTM which on input outputs the circuit for the oblivious Turing machine which decides .

Logspace Uniform Circuits

We can further restrict P-uniform circuits to require that they be implicitly logspace computable. That is, using space on the non-output tape. More formally, in space (i.e., we can compute the -th bit of the representation of in logarithmic space).

Theorem. is decidable by a logspace uniform circuit family if and only if .

This again follow from our proof that since the transformation in that proof is implicitly logspace computable, and the fact that logspace computable circuits are already P-uniform circuits.

P/poly vs Other Classes

Circuits are, in principle, one way to overcome the barriers of diagonalization and relativization which do not allow us to separate P and NP. We’ll now examine how relates to other complexity classes. For now, we’ll only state the results and prove (some of) them in the next lecture.

P/poly vs. NP

Theorem. If , then .

P/poly vs. EXP

Theorem. If , then .

P/poly vs. BPP

Theorem. .


  1. Technically speaking, we should be defining the circuit as since takes inputs. Clearly, this circuit has size .

  2. More precisely, .