circuit complexity - sjtuyuxi/teaching/complexity/part...uniform circuit 3. p =poly 4. karp-lipton...

59
Circuit Complexity

Upload: others

Post on 26-Oct-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Circuit Complexity

Page 2: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Circuit model aims to offer unconditional lower bound results.

Computational Complexity, by Fu Yuxi Circuit Complexity 1 / 58

Page 3: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Synopsis

1. Boolean Circuit Model

2. Uniform Circuit

3. P/poly

4. Karp-Lipton Theorem

5. NC and AC

6. P-Completeness

Computational Complexity, by Fu Yuxi Circuit Complexity 2 / 58

Page 4: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Boolean Circuit Model

Computational Complexity, by Fu Yuxi Circuit Complexity 3 / 58

Page 5: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Boolean circuit is a nonuniform computation model that allows a different algorithm tobe used for each input size.

Boolean circuit model appears mathematically simpler, with which one can talk aboutcombinatorial structure of computation.

Computational Complexity, by Fu Yuxi Circuit Complexity 4 / 58

Page 6: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Boolean Circuit

An n-input, single-output boolean circuit is a dag with

I n sources (vertex with fan-in 0), and

I one sink (vertex with fan-out 0).

All non-source vertices are called gates and are labeled with

I ∨,∧ (vertex with fan-in 2), and

I ¬ (vertex with fan-in 1).

A Boolean circuit is monotone if it contains no ¬-gate.

If C is a boolean circuit and x ∈ {0, 1}n is some input, then the output of C on x ,denoted by C (x), is defined in the natural way.

Computational Complexity, by Fu Yuxi Circuit Complexity 5 / 58

Page 7: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Example

1. {1n | n ∈ N}.

2. {〈m, n,m+n〉 | m, n ∈ N}.

Computational Complexity, by Fu Yuxi Circuit Complexity 6 / 58

Page 8: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Boolean Circuit Family

The size of a circuit C , notation |C |, is the number of gates in it.

Let S : N→ N be a function.

An S(n)-size boolean circuit family is a sequence {Cn}n∈N of boolean circuits, whereCn has n inputs and a single output, and |Cn| ≤ S(n) for every n.

Computational Complexity, by Fu Yuxi Circuit Complexity 7 / 58

Page 9: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Circuit Model Accepts Undecidable Language

A unary language L is such that L ⊆ {1n | n ∈ N}. It is accepted by a linear sizeboolean circuit.

Fact. Not every unary language is decidable.

Computational Complexity, by Fu Yuxi Circuit Complexity 8 / 58

Page 10: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Nonuniform Complexity Class

A problem L is in SIZE(S(n)) if there exists an S(n)-size circuit family {Cn}n∈N suchthat for each x ∈ {0, 1}n, x ∈ L iff Cn(x) = 1.

Unlike in a uniform model, SIZE(cS(n)) 6= SIZE(S(n)) generally. This follows fromCircuit Hierarchy Theorem.

Computational Complexity, by Fu Yuxi Circuit Complexity 9 / 58

Page 11: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Boolean Functions are Hard

Shannon. Most n-ary boolean functions have circuit complexity > 2n

n − o(2n

n ).

Lupanov. The size complexity of the hardest n-ary boolean function is < 2n

n + o(2n

n ).

Lutz. The size complexity of the hardest n-ary boolean function is > 2n

n (1 + c log nn ) for

some c < 1 and all large n.

1. C. Shannon. The Synthesis of Two-Terminal Switching Circuits. Bell System Technical Journal. 28:59-98, 1949.

2. O. Lupanov. The Synthesis of Contact Circuits. Dokl. Akad. Nauk SSSR (N.S.) 119:23-26, 1958.

3. J. Lutz. Almost Everywhere High Nonuniform Complexity. JCSS, 1992.

Computational Complexity, by Fu Yuxi Circuit Complexity 10 / 58

Page 12: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Shannon’s Counting Argument

Fixing an output gate, the number of functions defined by S-size circuits is bounded by

(S + n + 2)2S3S

(S − 1)!<

(S + n + 2)2S(3e)S

SSS

= (1 +n + 2

S)S(3e(S + n + 2))SS

< (en+2S 3e(S + n + 2))SS

< (3e2(S + n + 2))SS

< (6e2S)SS .

To define an ε-fraction of the functions, (7e2S)S ≥ ε22n must be valid. It follows that

S(log(7e2) + log S) ≥ 2n − log ε−1. (1)

It is easy to see that S ≤ 2n

n − log(1ε ) would contradict (1).

Computational Complexity, by Fu Yuxi Circuit Complexity 11 / 58

Page 13: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

By Shannon Theorem and Lupanov Theorem, the circuit Cf for the hardest n-aryboolean function f has the following bounds:

|Cf | =2n

n± o

(2n

n

).

Frandsen and Miltersen have provided a proof of the following.

2n

n

(1 +

log n

n− O

(1

n

))≤ |Cf | ≤

2n

n

(1 + 3

log n

n+ O

(1

n

)).

1. G. Frandsen and P. Miltersen. Reviewing Bounds on the Circuit Size of the Hardest Functions. Information Processing Letters, 2005.

Computational Complexity, by Fu Yuxi Circuit Complexity 12 / 58

Page 14: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Lower Bound

Frandsen and Miltersen translate a circuit into a stack machine, and bound the lengthof the machine by a combinatorial argument.

I Inputs are numbered 1, . . . , n.

I Boolean operations are numbered n + 1, . . . , n + s.I A program is a finite sequence of push and Boolean operation.

I Push i , where i is a number for an input or an early Boolean operation.I A Boolean operation pops two elements and pushes one element.

I After the execution of a program, there is exactly one element left in the stack.

continued on the next two slides.

Computational Complexity, by Fu Yuxi Circuit Complexity 13 / 58

Page 15: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Input: A circuit C = {1, . . . , n} ∪⋃n+s

i=n+1{gi = gi1 op gi2}, where g1, . . . , gn are inputs.

Output: A program P that computes the same boolean function as C .

Procedure: begin P is initially empty; SM(n+ s) end

SM(i).

1. If gi is an input, add “Push i” to P.

2. If gi has been computed by the j-th Boolean operation in P, add “Push n+ j” to P.

3. If gi = gi1 op gi2 has not been computed yet, then

3.1 SM(i1).3.2 SM(i2).3.3 Add “op” to P.

Each push increases stack size by one, and each operation decreases stack size by at most one.

Since the machine stops with one value in the stack, P has precisely s + 1 push operations.

Computational Complexity, by Fu Yuxi Circuit Complexity 14 / 58

Page 16: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

|P| < (s + 1)(c + log(n + s)) for some c since the size of the argument of Push is log(n + s).

There are 22n Boolean functions. So for some function the optimal circuit has size s such that

(s + 1)(c + log(n + s)) ≥ 2n. (2)

We show that (2) implies the lower bound inequality s > 2n

n (1 + log(n)n − c

n ) for large n.

If s ≤ 2n

n (1 + log(n)n − c

n ), then n + s ≤ 2n

n (1 + log(n)n − c

n + n2

2n ). By log(1+x) < x log(e),

2n ≤ (s + 1)(c + log(n + s))

≤ 2n

n(1 +

log(n)

n− c

n+

n

2n)(n − log n + c + (

log n

n− c

n+

n2

2n) log e)

≤ 2n

n2(n + log(n)− c +

n2

2n)(n − log n + c + (

log n

n− c

n+

n2

2n) log e)

≤ (2n/n2)(n2 − log2(n) + O(log n)) < 2n.

Computational Complexity, by Fu Yuxi Circuit Complexity 15 / 58

Page 17: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Upper Bound

(k , s)-Lupanov representation of n-ary boolean function f .

f (x) =∨i∈[p]

∨v∈{0,1}s

f ri ,v (a) ∧ f ci ,v (b).

I x = ab where a ∈ {0, 1}k and b ∈ {0, 1}n−k ; and p = 2k/s.

I A1,A2, . . . ,Ap are a partition of {0, 1}k , s = |A1| = . . . = |Ap−1| ≥ |Ap| > 0.

I f ci ,v (b) = 1 if v is the function table of f ( ,b) on Ai .

I f ri ,v (a) = 1 if a = Ai (j) for j ∈ [s], necessarily unique, and v(j) = 1.

Computational Complexity, by Fu Yuxi Circuit Complexity 16 / 58

Page 18: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Upper Bound

A Circuit for f can be constructed in three steps.

1. Use 2(2k + 2n−k) gates to compute all minterms over a and b.

2. Use p2n−k , respectively p2s , or-gates to compute f(c)i ,v , respectively f

(r)i ,v , for all i , v.

3. Use 2p2n−k gates to compute f .

So we may use at most 2(2k + 2n−k) + p2n−k + 3p2n−k gates to compute f .

I Using p ≤ 1 + 2k/s, we get the upper bound 2n/s + 2 ·2k + 3(2n−k + 2s + 2k+s/s).I Set k = 2 log n and s = n − 3 log n. The upper bound is dominated by 2n/s. Now

2n

s≤ 2n

n − 3 log n=

2n

n

(1 +

3 log n

n − 3 log n

)=

2n

n

(1 + 3

log n

n+ O

(log2 n

n2

)).

Computational Complexity, by Fu Yuxi Circuit Complexity 17 / 58

Page 19: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Circuit Hierarchy Theorem

Theorem. If n < (2 + ε)S(n) < S ′(n)� 2n/n for ε > 0, then SIZE(S(n)) ( SIZE(S ′(n)).

Let

m = maxm.

(S ′(n) ≥

(1 +

ε

4

) 2m

m

).

It follows from the assumption that

S(n) <

(1− ε

4 + 2ε

)2m

m.

Consider the set Bn of all n-ary Boolean functions that depend on the first m inputs.

I By Lupanov Theorem, Bn ⊆ SIZE(S ′(n)) for large n.

I By Shannon Theorem, Bn 6⊆ SIZE(S(n)) for large n.

Computational Complexity, by Fu Yuxi Circuit Complexity 18 / 58

Page 20: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Uniform Circuit

Computational Complexity, by Fu Yuxi Circuit Complexity 19 / 58

Page 21: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

A boolean circuit family {Cn}n∈N is uniform if there is an implicitly logspacecomputable function mapping 1n to Cn.

Computational Complexity, by Fu Yuxi Circuit Complexity 20 / 58

Page 22: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Uniform Circuit Family and P

Theorem. A language is accepted by a uniform circuit family if and only if it is in P.

‘⇒’: Trivial.

‘⇐’: A detailed proof is given next.

Computational Complexity, by Fu Yuxi Circuit Complexity 21 / 58

Page 23: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

From P to Uniform Circuit Family

Suppose M is a one tape TM bounded in time by T (n) = cnc .

I Given input 1n one writes down t = cnc in logspace.

I Let T0, . . . ,Tt be the configurations.

I Let Tij be the j-th symbol of Ti , where 0 ≤ j ≤ t + 1.

I Ti0 is B, and Ti(t+1) is �.I Use s to indicate that s is in the cell the reader is pointing to.

Let Cij for i , j ∈ [t] be the circuit that computes Tij .

I All Cij ’s are copy of a fixed C whose size depends only on M.

I Input to Cij = output of C(i−1)(j−1), C(i−1)j , C(i−1)(j+1)

+ input x + B + �.

Using adjacency matrix it is easy to see that the reduction is computable in logspace.

Computational Complexity, by Fu Yuxi Circuit Complexity 22 / 58

Page 24: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Configuration Circuit

t

n

t

n

T0

T1

T2

Tt-1

Tt

T0

Tt

T1

T2

Tt-1

1

C C CCC ……

… …C C CCC

……

C C CCC…

… …C C CCC

0 1 …… 1 0 1 ……

1

……

…………

…………

…… ……

…… ……

……101……10

Computational Complexity, by Fu Yuxi Circuit Complexity 23 / 58

Page 25: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Circuit Satisfiability

A binary string is in CKT-SAT if it represents an n-input boolean circuit C such that∃u ∈ {0, 1}n.C (u) = 1.

Computational Complexity, by Fu Yuxi Circuit Complexity 24 / 58

Page 26: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

From NP to Circuit Satisfiability

Let L ∈ NP, p be a polynomial, and M be a P-time TM such that

x ∈ L iff ∃u ∈{0, 1}p(|x |).M(x , u) = 1.

Now apply to M(x , u) the logspace reduction defined on page 22.

Lemma. L ≤L CKT-SAT for every L ∈ NP.

Computational Complexity, by Fu Yuxi Circuit Complexity 25 / 58

Page 27: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

From CKT-SAT to SAT

Lemma. CKT-SAT ≤L SAT.

Introduce a boolean variable for every gate, every circuit input and the circuit output.The formula is a big conjunction of the clauses relating input and output variables.

Computational Complexity, by Fu Yuxi Circuit Complexity 26 / 58

Page 28: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Cook-Levin reduction is computable in logspace.

Computational Complexity, by Fu Yuxi Circuit Complexity 27 / 58

Page 29: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

P/poly

Computational Complexity, by Fu Yuxi Circuit Complexity 28 / 58

Page 30: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Turing Machines that Take Advice

Let T , a : N→ N be functions. The class of languages decidable by T (n)-time TM’swith a(n) bits of advice, denoted

DTIME(T (n))/a(n),

contains every L such that there exists a countable sequence {αn}n∈N of strings withαn ∈ {0, 1}a(n) and a TM M satisfying

x ∈ L iff M(x , αn) = 1

for all x ∈ {0, 1}n, where on input x , αn the machine M stops in O(T (n)) steps.

Computational Complexity, by Fu Yuxi Circuit Complexity 29 / 58

Page 31: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Complexity Class ( )/poly

Complexity class defined by TM using advice.

I P/poly is the class of languages decidable by P-time TM using P-size advice.

I NP/poly is the class of languages decidable by P-time NDTM using P-size advice.

I L/poly . . .

1. R. Karp and R. Lipton. Turing Machines that Take Advice. STOC, 1980.

Computational Complexity, by Fu Yuxi Circuit Complexity 30 / 58

Page 32: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

P/poly

Theorem. P/poly =⋃

c SIZE(cnc).

If L is computable by {Cn}n∈N, we use the description of Cn as advice.

Conversely we apply the reduction defined on page 22 to the TM’s that take advice,and hard-wire the advice to the circuit.

Computational Complexity, by Fu Yuxi Circuit Complexity 31 / 58

Page 33: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Karp-Lipton Theorem

Computational Complexity, by Fu Yuxi Circuit Complexity 32 / 58

Page 34: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

It follows from P ⊆ P/poly that NP 6⊆ P/poly would imply NP 6= P.

Computational Complexity, by Fu Yuxi Circuit Complexity 33 / 58

Page 35: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Karp-Lipton Theorem. If NP ⊆ P/poly then∏

2 SAT ≤K∑

2 SAT.

I∏

2 SAT is the set of the true QBFs of the form ∀ ∃ . .

I∑

2 SAT is the set of the true QBFs of the form ∃ ∀ . .

1. R. Karp and R. Lipton. Turing Machines that Take Advice. STOC, 1980.

Computational Complexity, by Fu Yuxi Circuit Complexity 34 / 58

Page 36: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

The basic idea:

1. Construct some P-time M such that, for some polynomial q, ψ ∈∏

2 SAT if andonly if ∃w∈{0, 1}q(|ψ|).∀u∈{0, 1}q(|ψ|).M(ψ) = 1.

2. Non-uniformity of circuits is dealt with by ∃ quantifier.

If NP ⊆ P/poly, then SAT would be solved by a P-size circuit family {Cn}n∈N.

1. Given ψ = ∀u∈{0, 1}m.∃v∈{0, 1}m.ϕ(u, v), there is a P-time machine that uponinput u outputs the formula ϕ(u, v).

2. By assumption ϕ(u, v) ∈ SAT is decided by a P-size circuit C ′.

3. By self reducibility there exists a circuit C of polynomial q size such thatC (u) = v whenever ϕ(u, v) is satisfiable.

Conclude that ∀u∈{0, 1}m.∃v∈{0, 1}m.ϕ(u, v) = 1 if and only if

∃C∈{0, 1}q(|ψ|).∀u∈{0, 1}m.C is a boolean circuit ∧ ϕ(u,C (u)) = 1.

Computational Complexity, by Fu Yuxi Circuit Complexity 35 / 58

Page 37: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

In terms of polynomial hierarchy NP ⊆ P/poly implies PH =∑p

2 .

Computational Complexity, by Fu Yuxi Circuit Complexity 36 / 58

Page 38: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Meyer Theorem. If EXP ⊆ P/poly then∑

2 SAT is EXP-hard.

Let L ∈ EXP be decided by a 2p(n)-time oblivious k-tape TM M.

If EXP ⊆ P/poly, a P-size circuit C , say of size q(n), computes the i-th snapshot zi .

It follows that x ∈ L if and only if

∃C∈{0, 1}q(n)∀i , i1, .., ik∈{0, 1}p(n).T(x ,C (i),C (i1), ..,C (ik)) = 1,

where the P-time TM T checks the local properties of the snapshot sequence of M(x).

1. R. Karp and R. Lipton. Turing Machines that Take Advice. STOC, 1980.

Computational Complexity, by Fu Yuxi Circuit Complexity 37 / 58

Page 39: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

NC and AC

Computational Complexity, by Fu Yuxi Circuit Complexity 38 / 58

Page 40: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Massively Parallel Computer

Off-the-shelf micro processers linked via interconnection network.

The processors compute in lock-step; and the communication overhead is O(log(n)),where n is the number of processor.

Computational Complexity, by Fu Yuxi Circuit Complexity 39 / 58

Page 41: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Efficient Parallel Algorithm

A problem has an efficient parallel algorithm if, for each n, it can be solved for inputsof size n using a parallel computer of nO(1) processors in logO(1)(n) time.

Computational Complexity, by Fu Yuxi Circuit Complexity 40 / 58

Page 42: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Matrix Multiplication

There is an efficient parallel algorithm for the multiplication of two (n×n)-matrices ofnumbers using n3 processors and log(n) time.

Computational Complexity, by Fu Yuxi Circuit Complexity 41 / 58

Page 43: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Massively Parallel Computing in Circuit Model

Computations in a circuit can be largely carried out in parallel.

The flatter a circuit is, the more parallel its computation can be.

Computational Complexity, by Fu Yuxi Circuit Complexity 42 / 58

Page 44: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

NC

A language L is in NCd if L can be decided by a uniform circuit family {Cn}n∈N ofpoly(n) size and of O(logd(n)) depth.

NC =⋃d∈N

NCd .

Nick’s Class was introduced by Nick Pippenger.

Computational Complexity, by Fu Yuxi Circuit Complexity 43 / 58

Page 45: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

AC

ACd extends NCd by admitting unbounded fan-in’s.

AC =⋃d∈N

ACd .

I A P-size fan-in can be simulated by a tree of bounded fan-in’s of depth O(log(n)).

I Consequently NCi ⊆ ACi ⊆ NCi+1.

I HenceAC = NC.

Gates in a circuit of unbounded fan-in can be arranged in layers in alternating fashion.This is convenient when reasoning about circuits.

Computational Complexity, by Fu Yuxi Circuit Complexity 44 / 58

Page 46: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Boolean Matrix Multiplication

Suppose A is a boolean (n×n)-matrix. Now

(A2)ij =n∨

k=1

Aik ∧ Akj .

If there are n3 processors, then the calculation of all Aik ∧ Akj ’s requires one parallelstep, and the calculation of all (A2)ij ’s needs log(n) parallel steps.

I A2 is in NC1.

I An is in NC2.

Computational Complexity, by Fu Yuxi Circuit Complexity 45 / 58

Page 47: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Reachability is in NC2

Using matrix representation we see immediately that graph reachability is just theboolean matrix multiplication problem.

Computational Complexity, by Fu Yuxi Circuit Complexity 46 / 58

Page 48: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Prefix Sums Problem

Given x1, . . . , xn, we compute x1, x1 + x2, x1 + x2 + x3, . . . , x1 + x2 + . . .+ xn.

I In one parallel step we get the following

x1 + x2, x3 + x4, . . . , xn−1 + xn.

I In 2(log(n)− 1) parallel steps we get inductively the sequence

x1 + x2, x1 + x2 + x3 + x4, x1 + x2 + x3 + x4 + x5 + x6, . . . .

I We get all the sums in one more parallel step.

The time complexity is 2 log(n), discounting the network cost.

Computational Complexity, by Fu Yuxi Circuit Complexity 47 / 58

Page 49: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Carry Lookahead Addition

Problem: Calculate∑n

i=0 ai2i +∑n

i=0 bi2i with an = bn = 0.

Let xi be the carry at the i-th position, where 0 ≤ i ≤ n−1. Define

gi = ai ∧ bi , the carry generate bit;

pi = ai ∨ bi , the carry propagate bit.

Now xi = gi ∨ (pi ∧ xi−1) = gi ∨ (pi ∧ gi−1)∨ (pi ∧ pi−1 ∧ xi−2). Introduce the operation

(g ′, p′)� (g , p) = (g ∨ (p ∧ g ′), p ∧ p′).

Let (g0, p0) = (a0∧b0, 0). The carries x0, . . . , xn−1 can be calculated in 2 log n parallel steps as

(g0, p0), (g0, p0)� (g1, p1), (g0, p0)� (g1, p1)� (g2, p2), . . . .

Finally a1 ∨ b1 ∨ x0, . . . , an ∨ bn ∨ xn−1 can be calculated in parallel.

Computational Complexity, by Fu Yuxi Circuit Complexity 48 / 58

Page 50: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

NC = Problems with Efficient Parallel Algorithm

Theorem. L has efficient parallel algorithms if and only if L ∈ NC.

Let L ∈ NC be decided by a circuit family of O(nc)-size and O(logd(n))-depth. Assigna processor to each node. The running time of the computer is O(logd+1(n)).

Conversely a processor is replaced by a small circuit, and the interconnection networkis replaced by circuit wires.

I The running time of a processor is in polylog.

NC is the class of problems that have efficient parallel algorithms.

Computational Complexity, by Fu Yuxi Circuit Complexity 49 / 58

Page 51: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

P-Completeness

Computational Complexity, by Fu Yuxi Circuit Complexity 50 / 58

Page 52: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Does every problem in P have an efficient parallel algorithm?

We intend to characterize a class of P-time solvable problems that are most unlikely tohave any parallel algorithms.

What is the right notion of reduction?

Computational Complexity, by Fu Yuxi Circuit Complexity 51 / 58

Page 53: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Lemma. An implicitly logspace computable function is efficiently parallel.

Here is the argument:

1. All output bits can be calculated in parallel.

2. The adjacency matrix of the configuration graph of an implicitly logspacecomputable function can be constructed by an efficient parallel algorithm.

3. Reachability is in NC2.

Computational Complexity, by Fu Yuxi Circuit Complexity 52 / 58

Page 54: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

P-Completeness

A language is P-complete if it is in P and every problem in P is logspace reducible to it.

Computational Complexity, by Fu Yuxi Circuit Complexity 53 / 58

Page 55: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Circuit Evaluation is P-Complete

Circuit-Eval is the language consisting of all pairs 〈C , x〉 where C is an n-inputcircuit and x ∈ {0, 1}n is such that C (x) = 1.

The reduction is defined on page 22.

Computational Complexity, by Fu Yuxi Circuit Complexity 54 / 58

Page 56: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Monotone Circuit Evaluation is P-Complete

We can recycle the reduction defined on page 22.

I We turn C into C ′ by pushing negation operations downwards and remove them.Similarly we construct C ′ from C .

I The monotone circuit is defined in terms of C ′ and C ′.

Notice that input may be doubled in length.

Monotone-CKT-SAT however is a very different story.

Computational Complexity, by Fu Yuxi Circuit Complexity 55 / 58

Page 57: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

The Most “Difficult” Problems in P

Theorem. Suppose L is P-complete. Then L ∈ NC iff P = NC.

1. An implicitly logspace computable function is efficiently parallel.

2. We are done by composing two efficient parallel algorithms.

Computational Complexity, by Fu Yuxi Circuit Complexity 56 / 58

Page 58: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Inside P

Theorem. NC1 ⊆ L ⊆ NL ⊆ NC2 ⊆ . . . ⊆ NCi ⊆ . . .P.

1. NL ⊆ NC2. This is because PATH is in NC2.

2. NC1 ⊆ L. Let {Cn}n∈N accepts L ∈ NC1 and let x ∈ {0, 1}n.

I A string of length no more than log(n) is used to indicate the position of thecurrent gate of C .

I The initial value of this string is 0O(log n).

Using the depth first strategy, we only have to record the value of the current gate.

All we know is that AC0 and NC1 are separated by parity function.

Computational Complexity, by Fu Yuxi Circuit Complexity 57 / 58

Page 59: Circuit Complexity - SJTUyuxi/teaching/complexity/Part...Uniform Circuit 3. P =poly 4. Karp-Lipton Theorem 5. NC and AC 6. P-Completeness Computational Complexity, by Fu YuxiCircuit

Books.

1. Heribert Vollmer. Introduction to Circuit Complexity. Springer, 1999.

2. Stasys Jukna. Boolean Function Complexity: Advances and Frontiers. Springer, 2011.

3. Ryan O’Donnell. Analysis of Boolean Functions. CUP, 2014.

Computational Complexity, by Fu Yuxi Circuit Complexity 58 / 58