Complexitylib: a blueprint for computational complexity in Lean

8 Circuit lower bounds and proof complexity

This chapter collects unconditional lower bounds for concrete computational models, together with the proof-complexity side of the same program. The library proves Shannon’s counting bounds, which determine the maximum circuit complexity of an \(N\)-bit function up to a constant factor, the essential-input bound and Schnorr’s \(2N - 1\) bound for parity, Valiant’s depth-reduction lemma, Spira’s formula balancing, the monotone Karchmer–Wigderson correspondence, and the soundness of resolution. For \(\mathsf{AC}^0\) it proves a finite, width-sensitive switching lemma, iterates it through arbitrary depth-bounded formulas, and derives a finite counting obstruction for every formula computing parity. All of these results are finite or nonuniform. The next target is the family-level theorem that parity is not in \(\mathsf{AC}^0\) as defined in this library. Circuits are already normalized to formulas (Theorem 333), so what remains is arithmetic on top of the finite obstruction (roadmap track L4). Beyond it, the plan covers monotone circuit lower bounds, pseudorandom restrictions, and resolution size and width lower bounds leading to the pigeonhole principle and to Cook–Reckhow proof systems (roadmap track L5). Section 8.2 collects the results of the imported algebraic-circuits library: parity bounds in the De Morgan basis and in its own \(\mathsf{AC}^0\) model (including parity outside that model’s \(\mathsf{AC}^0\) and an explicit Håstad-type size bound), monotone CLIQUE at explicit parameters, Nechiporuk’s formula bound, Karchmer–Wigderson, a circuit-size hierarchy, conditional complexity, algebraic lower bounds, and mass production; the imported sunflower lemma appears in Section 8.7. Its circuit results use CSLib’s circuits, each over the imported library’s own signature and cost model; Nechiporuk’s bound and Karchmer–Wigderson are about formulas, and the Waring bound is an identity of polynomials.

8.1 Counting bounds

For every \(N \ge 6\) there is a function \(f : \{ 0,1\} ^N \to \{ 0,1\} \) that no fan-in-two AND/OR circuit of size at most \(\lfloor 2^N / (5N) \rfloor \) computes, where the size \(G + 1\) of a single-output circuit counts its output gate. Consequently \(\mathrm{size}(f) {\gt} \lfloor 2^N / (5N) \rfloor \).

Proof ▶

Encode circuits of a given size by short descriptors and compare their number with the \(2^{2^N}\) functions.

Theorem 292 Shannon upper bound
✓
#

For every \(N \ge 16\), every \(f : \{ 0,1\} ^N \to \{ 0,1\} \) satisfies \(\mathrm{size}(f) \le \lfloor 18 \cdot 2^N / N \rfloor \) over the fan-in-two AND/OR basis.

Proof ▶

Select among the columns of the truth table with a multiplexer, reading each column from a library that contains every function of the remaining variables.

Theorem 293 Lupanov
✓

For every \(\varepsilon {\gt} 0\) and all sufficiently large \(N\), every \(f : \{ 0,1\} ^N \to \{ 0,1\} \) satisfies \(\mathrm{size}(f) \le (1 + \varepsilon )\, 2^N / N\).

Proof ▶

CSLib proves the bound for its De Morgan circuits by refining the column library: the rows of the truth table are grouped into strips, and each strip’s column patterns are computed once and shared. A CSLib circuit with \(g\) gates is a fan-in-two AND/OR circuit of size \(g + 1\), and the extra gate is absorbed by the slack in \(\varepsilon \).

Theorem 294 Shannon lower bound via CSLib
✓

For all sufficiently large \(N\), some \(f : \{ 0,1\} ^N \to \{ 0,1\} \) satisfies \(2^N / N {\lt} N + 2\, \mathrm{size}(f)\), that is, \(\mathrm{size}(f) {\gt} (2^N / N - N) / 2\), with \(2^N / N\) a real quotient.

Proof ▶

CSLib’s counting argument gives a function that no De Morgan circuit with at most \(2^N / N\) gates computes, and a fan-in-two AND/OR circuit of size \(s\) is a CSLib circuit with at most \(N + 2s\) gates.

Let the slice complexity of a language \(L\) at length \(n \ge 1\) be the size complexity of its length-\(n\) slice, and \(0\) at \(n = 0\), where a circuit family answers with a stored bit. Then \(L \in \mathsf{SIZE}(s)\) exactly when the slice complexity is at most \(s(n)\) at every \(n\). If \(L \in \mathsf{SIZE}(s)\), then every length-\(n\) slice, \(n = 0\) included, is decided by a CSLib De Morgan circuit with at most \(n + 2s(n) + 1\) gates; conversely, CSLib circuits with at most \(s(n)\) gates at every length \(n \ge 1\) put \(L\) in \(\mathsf{SIZE}(s + 1)\).

For every \(\varepsilon {\gt} 0\) there is one threshold \(N_0\) such that every language has slice complexity at most \((1 + \varepsilon ) 2^n / n\) at every length \(n \ge N_0\). Hence every language is in \(\mathsf{SIZE}(s)\) for some \(s\) with \(s(n) \le (1 + \varepsilon ) 2^n / n\) for all large \(n\), and for some \(s = O(\lfloor 2^n / n \rfloor )\). Conversely, a single language lies outside \(\mathsf{SIZE}(s)\) for every \(s\) with \(n + 2s(n) \le 2^n / n\) for all large \(n\), in particular for every \(s = o(\lfloor 2^n / n \rfloor )\).

Proof ▶

Apply Lupanov’s bound to every slice. A big-O bound only constrains large lengths, so Lupanov’s bound with \(\varepsilon = 1\) gives \(O(\lfloor 2^n / n \rfloor )\), the floor costing at most a factor of two. For the lower bound, CSLib’s family-level Shannon bound gives a language with \(2^n / n {\lt} n + 2\, \mathrm{size}\) at every large length after translating circuits as in Theorem 250; a size bound \(s\) with \(n + 2s(n) \le 2^n / n\) for large \(n\) contradicts this at some length.

8.2 Results from the algebraic-circuits library

These results come from the algebraic-circuits library, imported wholesale under Complexitylib/Algebraic, and keep the Algebraic namespace. The circuit results are stated for CSLib’s straight-line circuits (Cslib.Circuits.Circuit), but each over the imported library’s own signature and cost model, not over CSLib’s De Morgan signature or the bases of this library. For example, its De Morgan signature adds an identity gate to constants, negation, conjunction, and disjunction; the De Morgan parity bound charges only conjunctions and disjunctions, while the hierarchy counts every gate; its \(\mathsf{AC}^0\) circuits have unbounded fan-in, with negations free and adding no depth; mass production charges negations, conjunctions, and disjunctions but not constants or identities. Each node names its model and what it counts. Nechiporuk’s bound and Karchmer–Wigderson are stated for the imported library’s formula types, not for circuits, and the Waring bound is an identity of polynomials with no circuit in its statement. Conditional complexity is defined in this library, although it lives in CSLib’s namespace. The consolidation plan in ROADMAP.md relates these results to the statements elsewhere in this chapter.

Theorem 296 Parity in the De Morgan basis
✓
#

For every \(n\), every circuit over the imported library’s De Morgan signature computing \(n\)-input parity has at least \(3(n - 1)\) AND and OR gates; constant, identity, and negation gates are free.

Proof ▶

Gate elimination: fixing a well-chosen input removes at least three AND or OR gates while leaving a parity function on one fewer input.

Theorem 297 Parity is not in \(\mathsf{AC}^0\)
✓

No nonuniform family of unbounded fan-in AND/OR circuits with negations at the inputs, with polynomially many AND and OR gates (negations free) and constant AND/OR depth (negations add no depth), computes parity at every input length. The same holds when negation gates may occur anywhere in the circuits. This is stated for the imported library’s own \(\mathsf{AC}^0\) model; deriving Theorem 336 for \(\mathsf{AC}^0\) as defined here from it is part of the consolidation plan.

Proof ▶

Håstad’s switching lemma: random restrictions collapse each bottom layer of such a circuit to a shallow decision tree, reducing the depth, while parity restricts to parity on the remaining inputs. At input length \((20(t + 1))^{d - 1}\) this forces \(2^{t + 1} \le 20\, t\, S\) for a depth-\(d\) circuit with \(S\) AND and OR gates, which a polynomial bound on \(S\) violates for large \(t\).

Theorem 298 Håstad’s size bound, imported model
✓

Consider circuits of the imported library’s \(\mathsf{AC}^0\) model: unbounded fan-in AND and OR gates and negation gates anywhere, where \(S\) counts the AND and OR gates and the depth counts AND and OR levels only. Let \(d \ge 2\) and \(t \ge 1\). Every such circuit with \(n \ge (20(t + 1))^{d - 1}\) inputs and depth at most \(d\) that computes \(n\)-input parity satisfies \(2^{t + 1} \le 20\, t\, S\). In particular, if \(n \ge 40^{d - 1}\) and \(q = \lfloor \lfloor n^{1/(d-1)} \rfloor / 20 \rfloor \), with \(\lfloor n^{1/(d-1)} \rfloor \) the integer root, then \(S \ge \lfloor 2^q / (20(q - 1)) \rfloor \). This bound is of order \(2^{\Omega (n^{1/(d-1)})}\), but no asymptotic form is stated. It is not transferred to the circuits of this library; see Theorem 337.

Proof ▶

Apply \(d - 1\) rounds of random restrictions. Each round switches one layer, with a union bound over the \(S\) AND and OR gates, while an explicit integer schedule keeps enough inputs free; the unreduced top gate is then a bounded-width normal form, which cannot compute parity on the surviving inputs. The switching condition is equivalent to \(20\, t\, S {\lt} 2^{t + 1}\), and \(n \ge (20(t + 1))^{d - 1}\) implies the survivor condition.

Theorem 299 Monotone CLIQUE
✓

Let \(t \ge 4\) and \(N = 2^{20t}\). Every circuit over the imported library’s binary AND/OR signature (fan-in-two AND and OR gates, no constants and no negations, every gate counted) whose inputs are the \(\binom {N}{2}\) edge variables of an \(N\)-vertex graph and which computes \(2^{4t}\)-CLIQUE has more than \(2^{t \cdot 2^t}\) gates.

Proof ▶

Razborov’s method of approximations, with the sunflower lemma bounding the error introduced at each gate.

Theorem 300 Nechiporuk
✓

Suppose that, for all large \(n\), the length-\(n\) member of a family of Boolean functions is \(K(n)\)-rectangle-free (under every split of its inputs, every rectangle of accepted inputs has a side with fewer than \(K(n)\) elements), with \(K(n) \le n^c\) for a natural number \(c\), and has at least \(2^{n - 2}\) accepting inputs. Then for all large \(n\) every formula over the full binary basis (all sixteen binary gates, constant leaves allowed) computing the length-\(n\) member satisfies \(n^2 \le 64(c + 3)\log _2 n \cdot L\), where \(L\) counts variable leaves and constants are free; that is, it has at least \(n^2 / (64(c + 3)\log _2 n)\) variable leaves. This is a conditional statement about any such family: no explicit rectangle-free family is formalized.

Proof ▶

Count subfunctions on each block of a partition of the inputs; rectangle-freeness forces the maximal number on every block at once.

Theorem 301 Karchmer–Wigderson
✓

Consider the imported library’s De Morgan formulas, trees of literal leaves \(x_i\) and \(\neg x_i\), constant leaves, and binary AND and OR gates, with depth the length of a longest root-to-leaf path and size the number of leaves, constants included. In the Karchmer–Wigderson game of \(f\), Alice holds \(x\) with \(f(x) = 1\), Bob holds \(y\) with \(f(y) = 0\), and a deterministic protocol must output a coordinate where \(x\) and \(y\) differ. For every \(f\) on \(n \ge 1\) inputs, the minimum depth of a formula computing \(f\) equals the minimum depth of a protocol for this game, and the minimum size of a formula equals the minimum number of leaves of a protocol. The hypothesis \(n \ge 1\) is used because a protocol leaf names an input position; the fact that no protocol exists at \(n = 0\) is a remark, not a formalized statement.

Proof ▶

Formulas and protocols translate into each other gate for move: an AND gate is a move of the player holding a rejected input, an OR gate a move of the player holding an accepted input.

Theorem 302 Polynomial circuit size hierarchy
✓
#

For real exponents \(1 \le a {\lt} b\), the class of Boolean function families, one function for each input length, whose De Morgan circuit complexity in the imported library’s signature (every gate counted, constants and identities included) is at most \(C \lfloor n^a \rfloor \) for some constant \(C\) and all large \(n\) is strictly contained in the corresponding class for \(\lfloor n^b \rfloor \). The families are nonuniform and no explicit separating family is given.

Proof ▶

At each length walk from a constant function towards a function of complexity above \(2^n / n\), which Shannon’s counting bound supplies, one truth-table entry at a time. Each step changes the complexity by at most \(2n\), so some function has complexity in \((\lfloor n^b \rfloor - 2n, \lfloor n^b \rfloor ]\). The resulting family is in the larger class, and since \(\lfloor n^b \rfloor - 2n\) eventually exceeds every constant multiple of \(\lfloor n^a \rfloor \), not in the smaller one.

Lemma 303 Hamming-Lipschitz circuit complexity
✓

Let \(C(f)\) be the minimum number of gates of a single-output circuit over the imported library’s De Morgan signature computing \(f : \{ 0,1\} ^n \to \{ 0,1\} \), every gate counted, constants and identities included. Then \(\lvert C(f) - C(g) \rvert \le 2n \cdot d_H(f, g)\), where \(d_H\) is the number of truth-table entries on which \(f\) and \(g\) differ. Consequently, if \(t \ge 1\) and \(t {\lt} C(h)\) for some \(h\), then some \(f\) has \(t {\lt} C(f) \le t + 2n\).

Proof ▶

Patching one truth-table entry costs at most \(2n\) gates, by combining the old circuit with an indicator of the changed point. Walk from a constant function to a hard one entry by entry.

Definition 304 Conditional circuit complexity
✓

Fix a signature and an interpretation of it. The conditional complexity of a target \(f\), possibly with several outputs, given supplied functions \(g_1, \ldots , g_k\) of the same input is the minimum number of gates, every gate counted, of a circuit \(h\) with \(h(x, g(x)) = f(x)\) for every \(x\): the original inputs and the supplied values are free extra inputs, and nothing is required of \(h(x, y)\) when \(y \ne g(x)\). It is \(\infty \) when no circuit computes \(f\) this way.

Over any signature and interpretation, conditional complexity obeys the triangle inequality: computing \(h\) given \(f\) costs at most computing \(h\) given \(g\) plus computing \(g\) given \(f\). Over \(\mathbb {F}_2\), take any signature whose operations have arity at most two, interpreted over \(\mathbb {F}_2\), in which some one-gate circuit computes \(x_0 + x_1\). Then the conditional complexity of a nonzero linear form \(t \cdot x\) given linear helpers \(s_1 \cdot x, \ldots , s_k \cdot x\) is exactly

\[ \min _{c \in \mathbb {F}_2^k} \Bigl(\lvert c \rvert + \bigl\lvert t + \textstyle \sum _j c_j s_j \bigr\rvert - 1\Bigr), \]

where \(\lvert \cdot \rvert \) is Hamming weight: the fewest helpers and inputs whose sum is the target, minus one. Every gate is counted, constant gates included. The signature may contain other operations as well, nonlinear ones included; the single-gate addition is a hypothesis of the theorem.

Proof ▶

Compose the two circuits for the triangle inequality. For linear forms, a circuit computing the form must combine at least the minimum number of input and helper terms, and such a combination is realized directly.

Theorem 306 Hessian rank bounds multiplications
✓

Every arithmetic circuit over a field, with addition, multiplication, and constant gates, whose output equals \(p\) as a formal polynomial has at least \(\lceil \operatorname {rank} H_p(a) / 2 \rceil \) multiplication gates, where \(H_p(a)\) is the Hessian of \(p\) at any point \(a\). Additions and constants are free, but every multiplication gate is counted, including multiplication by a constant. This is weaker than the classical form of the bound, which counts only nonscalar multiplications.

Proof ▶

Each multiplication gate raises the rank of the second-order part of the computed polynomials by at most two, while additions and constants do not.

Theorem 307 Waring bound for the squarefree monomial
✓

Over a field of characteristic zero, any expression of \(x_1 x_2 \cdots x_{2n}\) as a polynomial identity \(\sum _{i \in I} a_i \ell _i^{2n}\), with scalars \(a_i\) and linear forms \(\ell _i\) without constant term, has \(\lvert I \rvert \ge \binom {2n}{n}\). This bounds the number of terms of this restricted representation, not arithmetic circuit size.

Proof ▶

Compare the dimension of the space of partial derivatives of order \(n\) of each side.

Circuits are over the imported library’s De Morgan signature with its standard cost: negation, AND, and OR gates cost one, constants and identities are free. For \(f\) on \(n\) inputs and \(t \ge 1\), the mass complexity of \(f\) at \(t\) copies is the minimum cost of one circuit that evaluates \(f\) independently on \(t\) disjoint blocks of \(n\) inputs.

For every real \(0 \le \gamma {\lt} 1\) and \(\varepsilon {\gt} 0\) there is a threshold such that for every \(n\) above it, every \(f\) on \(n\) inputs, and every \(1 \le t \le 2^{\gamma n}\), the mass complexity of \(f\) at \(t\) copies is at most \((1/(1 - \gamma ) + \varepsilon )\, 2^n / n\). In a coarser discrete form, for all natural numbers \(a {\lt} b\) there is a constant \(C\) such that at every length \(n \ge 1\), every \(f\) on \(n\) inputs, and every \(1 \le t \le 2^{\lfloor a n / b \rfloor }\), the mass complexity is at most \(C \lfloor 2^n / n \rfloor \).

Proof ▶

A nonuniform construction that routes all copies through shared table lookups: sorting and routing networks gather the requests, each table entry is computed once and broadcast to every copy that needs it, and finite-field local-recovery codes with disjoint-line scheduling serve the requests. The discrete form comes from an induction over equal input blocks, which reaches every rational rate below one.

Theorem 309 Uhlig’s mass production
✓

With mass complexity as in Theorem 308, let \(D : \mathbb {N} \to \mathbb {N}\) satisfy \(D(n) = o(n / \log n)\) in the discrete form: for every natural number \(M \ge 1\), eventually \(M \cdot D(n) \cdot \lfloor \log _2 n \rfloor \le n\). Then for every natural number \(P \ge 1\), for all large \(n\), every \(f\) on \(n\) inputs, and every \(1 \le t \le 2^{D(n)}\), the mass complexity of \(f\) at \(t\) copies is at most \((1 + 1/P)\, 2^n / n\), stated without division as \(P\, n \cdot \mathrm{mass}(f, t) \le (P + 1)\, 2^n\).

Proof ▶

Combine a coefficient-one Lupanov circuit for a single copy with Uhlig’s recursive two-copy construction, in which XORs of subfunctions at adjacent prefix values serve as shared resources from which each request is recovered through its own disjoint set of resources.

Theorem 310 Cutwidth bound, conditional
✓

Assume that for every \(\xi {\gt} 0\) all sufficiently large simple 3-regular graphs on \(h\) vertices have pathwidth at most \((1/6 + \xi )h\), that is, a path decomposition whose bags have at most \((1/6 + \xi )h + 1\) vertices. Then every rectangle-free Boolean function family with polynomial rectangle threshold and at least \(2^{n-2}\) accepting inputs, as in Theorem 300, needs circuits of more than \((4 - \varepsilon )n\) gates over the full binary basis (all sixteen binary gates, every gate counted), for every \(\varepsilon {\gt} 0\) and all large \(n\). The pathwidth bound is an explicit hypothesis of the theorem. It is the published theorem of Fomin and Høie on the pathwidth of cubic graphs, which is not formalized here. As for Theorem 300, no explicit rectangle-free family is formalized, so this is a conditional statement about any such family.

Proof ▶

Order the gates by a path decomposition of the circuit’s wiring graph and count the rectangles cut at each position.

Let \(D(f)\) and \(L(f)\) be the minimum depth and the minimum number of leaves, constant leaves included, of a De Morgan formula of Theorem 301 computing \(f\); they are defined for every number of inputs, \(0\) included. For \(f\) on \(m\) bits and \(g\) on \(n\) bits, the block composition \(f \diamond g\) applies \(f\) to the values of \(g\) on \(m\) disjoint blocks of \(n\) bits. Substituting formulas gives \(D(f \diamond g) \le D(f) + D(g)\) and \(L(f \diamond g) \le L(f)\, L(g)\) for all \(f\) and \(g\); both bounds are proved.

The Karchmer–Raz–Wigderson conjecture says these bounds are nearly tight. It is formalized in its strong form, with a constant slack. The depth form says that there is a constant \(c\) such that \(D(f) + D(g) \le D(f \diamond g) + c\) for all \(m\), \(n\) and all non-constant \(f\) and \(g\). The size form says that there is a constant \(c\) such that \(L(f)\, L(g) \le c \cdot L(f \diamond g)\) for all such \(f\) and \(g\). The constant does not depend on \(m\), \(n\), \(f\) or \(g\); forms whose slack grows with \(m\) or \(n\) are not formalized. The conjecture is open; it is formalized as a statement only.

Both non-constancy hypotheses are needed. If \(f\) or \(g\) is constant, so is \(f \diamond g\), and it is proved that dropping either hypothesis makes the depth form and the size form false for every \(c\).

8.3 Essential inputs and gate elimination

Definition 312 Essential input
✓

Input \(i\) is essential for \(f : \{ 0,1\} ^N \to \{ 0,1\} ^M\) if flipping bit \(i\) changes \(f(x)\) for some \(x\).

Over any basis, the number of essential inputs of the function \(\{ 0,1\} ^N \to \{ 0,1\} ^M\) computed by a circuit is at most the circuit’s total fan-in, the number of gate-input occurrences with output gates included. For circuits over the AND/OR basis of fan-in at most \(k\), it is at most \(k\) times the size \(G + M\).

Proof ▶

Every essential input is read by some gate input occurrence.

Definition 314 Parity
✓
#

The parity family \(\oplus \) maps \(x \in \{ 0,1\} ^N\) to \(x_0 \oplus \cdots \oplus x_{N-1}\), with value \(0\) on the empty string.

Every fan-in-two AND/OR circuit computing \(N\)-bit parity or its complement, \(N \ge 1\), has size at least \(2N - 1\), that is, at least \(2(N - 1)\) internal gates. Hence \(\mathrm{size}(\oplus _N) \ge 2N - 1\).

Proof ▶

Gate elimination: fixing a well-chosen input removes at least two gates and leaves parity or its complement on one fewer input.

8.4 Depth, formulas, and communication

Theorem 316 Valiant’s depth reduction
✓
#

Let \(G\) be a finite acyclic digraph with \(S\) edges whose longest simple path has at most \(2^k\) vertices, and let \(r \le k\). There is a set \(F\) of edges of \(G\) with \(k\, |F| \le r S\) whose removal leaves a digraph whose longest simple path has at most \(2^k / 2^r\) vertices.

Proof ▶

Label vertices by longest-path depth, partition the edges by the first bit in which the labels of their endpoints differ, and remove the \(r\) smallest classes.

Corollary 317 Depth reduction for circuits

Let \(C\) be a circuit whose dependency graph has longest paths of at most \(2^k\) vertices, and let \(r \le k\). There is a set \(F\) of dependency edges with \(k\, |F| \le r \cdot \mathrm{totalFanIn}(C)\) whose removal leaves a graph whose longest paths have at most \(2^{k-r}\) vertices.

Proof ▶

The dependency graph is acyclic and has at most \(\mathrm{totalFanIn}(C)\) edges.

Theorem 318 Spira
✓

Every Boolean formula \(\varphi \) of size \(s\) has an equivalent formula of depth at most \(15 + 12 \lceil \log _2 s \rceil \) and size at most \(80 s^8 - 4\).

Proof ▶

Find a subformula of between one third and two thirds of the size, and recombine the two cases for its value; recurse on both parts.

A monotone formula over \(N\) variables is a tree built from variables \(x_0, \dots , x_{N-1}\) and binary conjunction and disjunction, without constants or negation. Its leaves are its variable occurrences, and its depth is the length of a longest root-to-leaf path, variables having depth zero. A function \(f\) is monotone if \(x \le y\) pointwise and \(f(x) = 1\) imply \(f(y) = 1\).

Every monotone formula computes a monotone function, and a monotone formula computing \(f\) has at least as many leaves as \(f\) has essential inputs.

Proof ▶

Induction on the formula; an essential input must occur as a leaf.

A protocol is a tree indexed by a rectangle \(X \times Y\) of sets of inputs in \(\{ 0,1\} ^N\), \(X\) on the one side and \(Y\) on the zero side. At an internal node, Alice splits \(X\) or Bob splits \(Y\) by an arbitrary predicate, and the two children are indexed by the two parts. A leaf names a coordinate \(i\) with \(x_i = 1\) for all \(x \in X\) and \(y_i = 0\) for all \(y \in Y\). A protocol for the monotone Karchmer–Wigderson game of \(f : \{ 0,1\} ^N \to \{ 0,1\} \) is one indexed by the root rectangle \(f^{-1}(1) \times f^{-1}(0)\), so every node’s rectangle lies in it. The depth is the height of the tree.

Every monotone formula computing \(f : \{ 0,1\} ^N \to \{ 0,1\} \) yields a protocol for the monotone Karchmer–Wigderson game of \(f\) of the same depth, and every such protocol yields a monotone formula of the same depth computing \(f\). Hence, for every \(d \in \mathbb {N}\), the game has a protocol of depth at most \(d\) if and only if some monotone formula of depth at most \(d\) computes \(f\). There is no monotonicity hypothesis on \(f\); by Lemma 320, both sides fail when \(f\) is not monotone.

Proof ▶

An OR node is an Alice split and an AND node is a Bob split; both translations preserve depth exactly.

8.5 Restrictions, normal forms, and decision trees

A restriction assigns each variable \(x_i\), \(i \in \mathbb {N}\), either a fixed bit or “free”; the finite-arity version does this for exactly \(N\) variables. The composition \(\rho _1 \circ \rho _2\) fixes a variable to \(\rho _1\)’s value when \(\rho _1\) fixes it and to \(\rho _2\)’s value otherwise. A restriction acts on a total assignment by overwriting the fixed variables, and on a Boolean formula by replacing each fixed variable with the corresponding constant.

Evaluating \(\varphi |_\rho \) at \(\alpha \) equals evaluating \(\varphi \) at \(\rho \) applied to \(\alpha \). Restricting by \(\rho _1\) and then by \(\rho _2\) equals restricting by \(\rho _1 \circ \rho _2\), and restriction preserves formula size and depth exactly.

Proof ▶

Induction on the formula.

A CNF (resp. DNF) over \(N\) variables is a list of clauses (resp. terms), each a list of literals. Its width is the largest number of literals in a clause (term), and its complexity is the number of clauses (terms). These finite-arity normal forms are distinct from the CNF formulas used for satisfiability and resolution.

For a finite-arity restriction \(\rho \) and a CNF or DNF \(\varphi \) over \(N\) variables, the simplified restriction \(\varphi |_\rho \) satisfies \(\varphi |_\rho (x) = \varphi (\rho \text{ applied to } x)\) for every \(x \in \{ 0,1\} ^N\), and its width is at most the width of \(\varphi \).

Proof ▶

In a CNF delete falsified literals and satisfied clauses; in a DNF delete satisfied literals and falsified terms.

A decision tree queries a variable at each internal node and outputs a bit at each leaf. The finite-arity version queries only variables below \(N\). Its depth is the length of a longest root-to-leaf path.

A decision tree of depth \(s\) is computed by a DNF of width at most \(s\) and by a CNF of width at most \(s\).

Proof ▶

Take one term per accepting path, and dually one clause per rejecting path.

For \(N \ge 1\), every DNF and every CNF computing \(N\)-bit parity has at least \(2^{N-1}\) terms, respectively clauses.

Proof ▶

A satisfiable term that omits a variable accepts two inputs of different parity, so every satisfiable term accepts exactly one input, while parity accepts \(2^{N-1}\) inputs. CNFs follow by negation.

8.6 The switching lemma and \(\mathsf{AC}^0\)

For \(q \in \mathbb {N}\), a seed assigns to each of \(N\) coordinates one of \(2q + 1\) symbols: one free symbol and \(q\) labelled copies of each fixed bit, so there are exactly \((2q + 1)^N\) seeds. A seed decodes to a finite-arity restriction, so a uniform seed leaves each coordinate free with probability \(1/(2q+1)\) and fixes it to each bit with probability \(q/(2q+1)\), independently. Events are measured by exact counts of seeds rather than by probabilities.

Let \(\varphi \) be a DNF of width \(w\) over \(N\) variables, no term of which contains a complementary pair of literals, and let \(q, s \in \mathbb {N}\). Call a restriction bad if the complete-block switching decision tree of the restricted formula has depth at least \(s\). This tree, rather than the canonical tree that queries one variable at a time, is the one used here: at the first surviving term it queries all of that term’s free variables before accepting or continuing. Then

\[ \# \{ \text{bad seeds}\} \cdot q^s \le (2q + 1)^N \, (4(w + 1))^s . \]

Every DNF agrees with its sub-DNF of consistent terms, whose width is no larger, and the bound holds for that sub-DNF with \(w\) the original width. The same bounds hold for CNFs, where the condition is that no clause contains a complementary pair, and the switching tree and bad event are defined through the De Morgan dual DNF. Reading the counts as probabilities, which is not a separate formal statement: a uniform seed is bad with probability at most \((4(w+1)/q)^s\) when \(q \ge 1\).

Proof ▶

Encode each bad restriction, together with the labels of its first \(s\) queried coordinates, injectively as a seed plus \(s\) advice symbols from an alphabet of size \(4(w + 1)\) (Razborov’s encoding). CNFs follow by De Morgan duality.

Definition 332 \(\mathsf{AC}^0\) formula
✓

A negation-normal unbounded formula over \(N\) variables is a tree built from constants, literals, and AND and OR gates of any fan-in; an empty AND is true and an empty OR is false. Its size counts all nodes (constants, literal occurrences, and gates), and its depth counts gates on a longest root-to-leaf path.

Theorem 333 Normalization of \(\mathsf{AC}^0\) circuits
✓

Let \(C\) be an unbounded-fan-in AND/OR circuit, with negations only through the free per-input flags, with \(N\) inputs and \(G\) internal gates, and let output \(j\) have depth \(D\), counting the output gate. Some negation-normal unbounded formula computes output \(j\), has depth at most \(D\), and has size at most \((2(N + G) + 1)^{D+1}\).

Proof ▶

Push negations to the literals by De Morgan duality, remove duplicate signed inputs of each gate, and unfold the circuit into a tree.

Let \(\varphi \) be a negation-normal unbounded formula over \(N\) variables with depth at most \(d\), and let \(s \ge 2\) and \(q \in \mathbb {N}\). For any sequence of \(d\) restrictions, one per level, a staged compiler turns \(\varphi \) into a decision tree that computes \(\varphi \) under their composition, earlier restrictions taking precedence. For \(d\) independent sparse seeds, the number of \(d\)-tuples of seeds for which this decision tree has depth at least \(s\), multiplied by \(q^s\), is at most \(\mathrm{size}(\varphi )\, ((2q+1)^N)^d\, (4(s + 1))^s\). Consequently, if \(q {\gt} 0\) and

\[ ((2q+1)^N)^d\, s\, q^s + \mathrm{size}(\varphi )\, ((2q+1)^N)^d\, (4(s+1))^s N {\lt} N\, ((2q+1)^{N-1})^d\, q^s , \]

then some tuple of seeds leaves at least \(s\) variables free and reduces \(\varphi \) to a decision tree of depth less than \(s\).

Proof ▶

At a gate, the earlier stages have compiled the children to decision trees; their conjunction is a CNF and their disjunction a DNF of width at most the largest child depth. Unless some child already failed, that width is below \(s\), so the switching lemma bounds the failures at the gate. A union bound over the nodes and the exact first moment of the number of surviving variables give the criterion.

Theorem 335 Finite parity obstruction
✓

Let \(\varphi \) be a negation-normal unbounded formula over \(N\) variables that computes parity, and let \(d \ge \mathrm{depth}(\varphi )\), \(s \ge 2\) and \(q \ge 1\). Then

\[ N\, ((2q+1)^{N-1})^d\, q^s \le ((2q+1)^N)^d\, s\, q^s + \mathrm{size}(\varphi )\, ((2q+1)^N)^d\, (4(s+1))^s N . \]
Proof ▶

Parity restricted to a set of free variables needs a decision tree querying all of them, so the conclusion of Theorem 334 is impossible and its numeric hypothesis must fail.

Theorem 336 Parity is not in \(\mathsf{AC}^0\)

The parity family is not in \(\mathsf{AC}^0\). The analogous statement for the imported library’s \(\mathsf{AC}^0\) model is Theorem 297; this one, for \(\mathsf{AC}^0\) as defined in this library, is not yet formalized.

Proof ▶

Normalize a constant-depth polynomial-size family into formulas of constant depth \(d\) and polynomial size, then choose \(q\) and \(s\) as powers of \(N\) so that the inequality of Theorem 335 fails for large \(N\).

Theorem 337 Håstad’s size bound

For every \(d \ge 2\) there is \(\varepsilon _d {\gt} 0\) such that, for all sufficiently large \(N\), every unbounded-fan-in AND/OR circuit of depth \(d\) computing \(N\)-bit parity has size at least \(2^{\varepsilon _d N^{1/(d-1)}}\). Theorem 298 proves an explicit non-asymptotic form of this bound for the imported library’s \(\mathsf{AC}^0\) model; the statement here, for the circuits of this library, is not yet formalized.

Proof ▶

The same argument with the restriction parameters optimized, keeping the bottom fan-in bound separate from the size.

Lemma 338 Parity in \(\mathsf{TC}^0\)

The parity family is in \(\mathsf{TC}^0\).

Proof ▶

For each odd \(k \le N\), the conjunction of the threshold gates “at least \(k\) ones” and “not at least \(k + 1\) ones” detects exactly \(k\) ones; parity is the disjunction of these, a depth-three circuit of linear size.

\(\mathsf{AC}^0 \subsetneq \mathsf{TC}^0\).

Proof ▶

\(\mathsf{AC}^0 \subseteq \mathsf{TC}^0\) is formalized, and parity separates them.

Theorem 340 Pseudorandom switching lemma

The bound of Theorem 331 holds, up to an additive error \(\varepsilon \), when the free/fixed pattern and the fixed values are drawn from a distribution that \(\varepsilon \)-fools CNFs of size polynomial in \(N\) instead of the uniform product distribution (Trevisan–Xue). With an explicit generator fooling CNFs, such restrictions can be sampled from \(\mathrm{polylog}(N / \varepsilon )\) random bits.

Proof ▶

The bad event of the switching lemma is itself decided by a small CNF-like test on the restriction, so fooling that test preserves its probability. This requires a formal notion of pseudorandom distributions and of fooling a class of tests, which the library does not yet state; pseudorandom generators for \(\mathsf{AC}^0\) would build on it.

8.7 Monotone circuits

Definition 341 Monotone circuit

A monotone circuit is an AND/OR circuit all of whose negation flags are false. Every monotone circuit computes a monotone function.

Theorem 342 Monotone Boolean matrix product

Every monotone fan-in-two circuit computing the product of two \(n \times n\) Boolean matrices has at least \(n^3\) AND gates.

Proof ▶

Each product \(x_{ik} y_{kj}\) is a prime implicant of output \((i, j)\), and a monotone circuit must realize each of the \(n^3\) of them at a distinct AND gate (Pratt; Paterson; Mehlhorn–Galil). The bound is monotone-specific: circuits with negation compute the product with \(O(n^{\log _2 7})\) gates through integer matrix multiplication.

Let \(p \ge 2\). Every finite family of more than \(\ell !\, (p-1)^\ell \) finite sets, each of size exactly \(\ell \), contains \(p\) distinct sets whose pairwise intersections are all equal (to their common intersection). The same holds for more than \((\ell + 1)\, \ell !\, (p-1)^\ell \) sets, each of size at most \(\ell \). This is proved in the imported algebraic-circuits library.

Proof ▶

Induction on \(\ell \): either a maximal pairwise-disjoint subfamily has \(p\) members, or some element lies in many sets and the lemma applies to them with that element removed (Erdős–Rado). For sets of size at most \(\ell \), some size class has more than \(\ell !\, (p-1)^\ell \) members.

Theorem 344 Monotone clique lower bound

There is \(\varepsilon {\gt} 0\) such that for all \(k \le n^{1/4}\), every monotone circuit deciding whether an \(n\)-vertex graph, given by its adjacency bits, contains a \(k\)-clique has size at least \(2^{\varepsilon \sqrt{k}}\) (Razborov; Alon–Boppana; Arora–Barak Theorem 14.7). Only a weaker bound at special parameters, in the imported library’s model, is formalized: Theorem 299 gives more than \(2^{t \cdot 2^t}\) gates for \(k = 2^{4t}\) and \(n = 2^{20t}\), \(t \ge 4\), which for large \(t\) is below \(2^{\varepsilon \sqrt{k}} = 2^{\varepsilon 4^t}\).

Proof ▶

Razborov’s method of approximations: replace each gate by an approximator that is a small union of clique indicators, use the sunflower lemma to keep approximators small, and show that each replacement errs on few positive or negative test graphs.

8.8 Proof complexity

Definition 345 Resolution
✓

Clauses are lists of literals over variables in \(\mathbb {N}\), and a CNF is a list of clauses; an assignment is a finite list of bits, variables beyond its end reading \(0\). The resolvent of clauses \(C_1\) and \(C_2\) on a variable \(v\) deletes every occurrence of \(x_v\) from \(C_1\) and of \(\neg x_v\) from \(C_2\) and concatenates the rest. A clause is derivable from \(\varphi \) if it is a clause of \(\varphi \) or a resolvent of two derivable clauses. There is no weakening rule, and the pivot need not occur in the parents.

Lemma 346 Resolution step
✓

Every assignment satisfying \(C_1\) and \(C_2\) satisfies their resolvent on any variable, and the resolvent has at most \(|C_1| + |C_2|\) literals.

Proof ▶

Case on the value of \(x_v\): the parent whose pivot literal is false keeps a true literal in the resolvent.

Theorem 347 Soundness of resolution
✓

Every clause derivable from \(\varphi \) is satisfied by every assignment satisfying \(\varphi \). In particular, if the empty clause is derivable from \(\varphi \), then \(\varphi \) is unsatisfiable.

Proof ▶

Induction on the derivation.

Theorem 348 Completeness of resolution

If \(\varphi \) is unsatisfiable, then the empty clause is derivable from \(\varphi \).

Proof ▶

Induction on the number of variables, eliminating one variable by resolving all pairs of clauses on it (Davis–Putnam).

Definition 349 Resolution refutations and their measures

A resolution refutation of \(\varphi \) is a sequence of clauses ending in the empty clause, each a clause of \(\varphi \) or a resolvent of two earlier ones. Its size is its length and its width is the largest number of literals in one of its clauses. A clause is derivable exactly when it ends such a sequence.

Theorem 350 Ben-Sasson–Wigderson size–width relation

If an unsatisfiable CNF over \(n\) variables whose clauses have at most \(k\) literals has a resolution refutation of size \(S\), then it has one of width at most \(k + O(\sqrt{n \log S})\).

Proof ▶

Repeatedly restrict a variable occurring in many wide clauses, and combine the refutations of the two restrictions.

Theorem 351 Haken

Let \(\mathrm{PHP}^{n+1}_n\) be the CNF over variables \(p_{ij}\) (\(i \le n + 1\), \(j \le n\)) stating that every pigeon \(i\) sits in some hole and no hole holds two pigeons. Every resolution refutation of \(\mathrm{PHP}^{n+1}_n\) has size \(2^{\Omega (n)}\).

Proof ▶

Restrict the refutation so that every wide clause disappears, then show that any refutation of the remaining pigeonhole instance contains a wide clause (Beame–Pitassi), or use Haken’s bottleneck counting.

Definition 352 Cook–Reckhow proof system

A propositional proof system for unsatisfiable CNFs is a polynomial-time decidable relation \(V(\varphi , \pi )\) that is sound (\(V(\varphi , \pi )\) implies that \(\varphi \) is unsatisfiable) and complete (every unsatisfiable \(\varphi \) has some \(\pi \) with \(V(\varphi , \pi )\)). It is polynomially bounded if every unsatisfiable \(\varphi \) has such a \(\pi \) with \(|\pi | \le p(|\varphi |)\) for a fixed polynomial \(p\).

Proposition 353 Resolution is a proof system

Checking a resolution refutation, encoded as a clause sequence, is a Cook–Reckhow proof system.

Proof ▶

Checking each step takes polynomial time; soundness and completeness are the two theorems above.

Theorem 354 Cook–Reckhow

A polynomially bounded propositional proof system exists if and only if \(\mathsf{NP} = \mathsf{coNP}\).

Proof ▶

Unsatisfiability of CNFs is \(\mathsf{coNP}\)-complete. A polynomially bounded proof system puts it in \(\mathsf{NP}\); conversely an \(\mathsf{NP}\) verifier for it is a polynomially bounded proof system.