Algorithms and Lower Bounds for Comparator Circuits from Shrinkage

In this paper, we initiate the study of average-case complexity and circuit analysis algorithms for comparator circuits. Departing from previous approaches, we exploit the technique of shrinkage under random restrictions to obtain a variety of new results for this model. Among them, we show Average-case Lower Bounds For every k=k(n)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$k = k(n)$$\end{document} with k⩾logn\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$k \geqslant \log n$$\end{document}, there exists a polynomial-time computable function fk\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$f_k$$\end{document} on n bits such that, for every comparator circuit C with at most n1.5/Ok·logn\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$n^{1.5}/O\!\left( k\cdot \sqrt{\log n}\right) $$\end{document} gates, we have Prx∈0,1nC(x)=fk(x)⩽12+12Ω(k).\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} \mathop {{{\,\mathrm{\textbf{Pr}}\,}}}\limits _{x\in \left\{ 0,1\right\} ^n}\left[ C(x)=f_k(x)\right] \leqslant \frac{1}{2} + \frac{1}{2^{\Omega (k)}}. \end{aligned}$$\end{document} This average-case lower bound matches the worst-case lower bound of Gál and Robere by letting k=Ologn\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$k=O\!\left( \log n\right) $$\end{document}. #\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\#$$\end{document}SAT Algorithms There is an algorithm that counts the number of satisfying assignments of a given comparator circuit with at most n1.5/Ok·logn\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$n^{1.5}/O\!\left( k\cdot \sqrt{\log n}\right) $$\end{document} gates, in time 2n-k·poly(n)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$2^{n-k}\cdot {{\,\textrm{poly}\,}}(n)$$\end{document}, for any k⩽n/4\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$k\leqslant n/4$$\end{document}. The running time is non-trivial (i.e., 2n/nω(1)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$2^n/n^{\omega (1)}$$\end{document}) when k=ω(logn)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$k=\omega (\log n)$$\end{document}. Pseudorandom Generators and MCSP\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textsf {MCSP} $$\end{document}Lower Bounds There is a pseudorandom generator of seed length s2/3+o(1)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$s^{2/3+o(1)}$$\end{document} that fools comparator circuits with s gates. Also, using this PRG, we obtain an n1.5-o(1)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$n^{1.5-o(1)}$$\end{document} lower bound for MCSP\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textsf {MCSP} $$\end{document} against comparator circuits. Average-case Lower Bounds For every k=k(n)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$k = k(n)$$\end{document} with k⩾logn\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$k \geqslant \log n$$\end{document}, there exists a polynomial-time computable function fk\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$f_k$$\end{document} on n bits such that, for every comparator circuit C with at most n1.5/Ok·logn\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$n^{1.5}/O\!\left( k\cdot \sqrt{\log n}\right) $$\end{document} gates, we have Prx∈0,1nC(x)=fk(x)⩽12+12Ω(k).\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\begin{aligned} \mathop {{{\,\mathrm{\textbf{Pr}}\,}}}\limits _{x\in \left\{ 0,1\right\} ^n}\left[ C(x)=f_k(x)\right] \leqslant \frac{1}{2} + \frac{1}{2^{\Omega (k)}}. \end{aligned}$$\end{document} This average-case lower bound matches the worst-case lower bound of Gál and Robere by letting k=Ologn\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$k=O\!\left( \log n\right) $$\end{document}. #\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\#$$\end{document}SAT Algorithms There is an algorithm that counts the number of satisfying assignments of a given comparator circuit with at most n1.5/Ok·logn\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$n^{1.5}/O\!\left( k\cdot \sqrt{\log n}\right) $$\end{document} gates, in time 2n-k·poly(n)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$2^{n-k}\cdot {{\,\textrm{poly}\,}}(n)$$\end{document}, for any k⩽n/4\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$k\leqslant n/4$$\end{document}. The running time is non-trivial (i.e., 2n/nω(1)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$2^n/n^{\omega (1)}$$\end{document}) when k=ω(logn)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$k=\omega (\log n)$$\end{document}. Pseudorandom Generators and MCSP\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textsf {MCSP} $$\end{document}Lower Bounds There is a pseudorandom generator of seed length s2/3+o(1)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$s^{2/3+o(1)}$$\end{document} that fools comparator circuits with s gates. Also, using this PRG, we obtain an n1.5-o(1)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$n^{1.5-o(1)}$$\end{document} lower bound for MCSP\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\textsf {MCSP} $$\end{document} against comparator circuits.

• Average-case Lower Bounds.For every k = k(n) with k log n, there exists a polynomial-time computable function f k on n bits such that, for every comparator circuit C with at most n 1.5 /O k • √ log n gates, we have This average-case lower bound matches the worst-case lower bound of Gál and Robere by letting k = O(log n).
• #SAT Algorithms.There is an algorithm that counts the number of satisfying assignments of a given comparator circuit with at most n 1.5 /O k • √ log n gates, in time 2 n−k • poly(n), for any k n/4.The running time is non-trivial (i.e., 2 n /n ω(1) ) when k = ω(log n).
• Pseudorandom Generators and MCSP Lower Bounds.There is a pseudorandom generator of seed length s 2/3+o(1) that fools comparator circuits with s gates.Also, using this PRG, we obtain an n 1.5−o(1) lower bound for MCSP against comparator circuits.

Introduction
A comparator circuit is a Boolean circuit whose gates are comparator gates, each of which maps a pair of inputs (x, y) to (x ∧ y, x ∨ y), and whose inputs are labelled by a literal (i.e., a variable x i or its negation ¬x i ).A convenient way of representing a comparator circuit is seen in Figure 1.We draw a set of horizontal lines, each of which is called a wire and is labelled by an input literal.The gates are represented as a sequence of vertical arrows, each of which connects some wire to another.The tip of the arrow is the logical disjunction gate (∨), and the rear of the arrow is the logical conjunction gate (∧).One of the wires is selected to represent the Boolean value of the computation.The size of the circuit is the number of gates in the circuit.
Comparator circuits can be viewed as a restricted type of circuit in which the gates have bounded fan-out.It is easy to see that comparator circuits can efficiently simulate Boolean formulas over {∧, ∨, ¬} with no overhead1 .Moreover, it is also known that polynomial-size comparator  circuits can even simulate nondeterministic branching programs [MS92] with a polynomial overhead only.On the other hand, comparator circuits appear to be much stronger than formulas2 , as it is conjectured that polynomial-size comparator circuits are incomparable to NC [MS92].Evidence for this conjecture is that polynomial-size comparator circuits can compute problems whose known algorithms are inherently sequential, such as stable marriage and lexicographically first maximal matching [MS92], and there is an oracle separation between NC and polynomial-size comparator circuits [CFL14].Moreover, Robere, Pitassi, Rossman and Cook [RPRC16] showed that there exists a Boolean function in mNC 2 not computed by polynomial-size monotone comparator circuits3 .For these reasons, comparator circuits are likely to be incomparable to NC, and polynomial-size span programs, which are contained in NC 2 , are not expected to be stronger than polynomial-size comparator circuits.Despite the importance of comparator circuits, we don't know much about them.Though it is easy to see that Parity can be computed by comparator circuits with O(n) wires and gates (See Figure 1), the best known comparator circuit for Majority uses O(n) wires and O(n log n) gates [AKS83].We don't know if there is a linear-size comparator circuit for Majority4 , whereas, for the weaker model of nondeterministic branching programs, superlinear lower bounds are known [Raz90].Structural questions about comparator circuits have also received some attention in recent years [GKRS19,KSS18].
The first superlinear worst-case lower bound for comparator circuits was recently obtained by Gál and Robere [GR20], by an adaptation of Nečiporuk's argument [Nec66].Their proof yields a lower bound of Ω (n/ log n) 1.5 to comparator circuits computing a function of n bits.For monotone comparator circuits, exponential lower bounds are known [RPRC16].
In this paper, we exploit structural properties of small-size comparator circuits in order to prove the first average-case lower bounds and design the first circuit analysis algorithms for small comparator circuits.Developing circuit analysis algorithms is a crucial step for understanding a given circuit class [Oli13,Wil14a], and are often obtained only after lower bounds have been proven for the class 5 .Many well-studied circuit classes have been investigated from this perspective, such as AC 0 circuits [IMP12], De Morgan formulas [Tal15], branching programs [IMZ19], ACC circuits [Wil14b], and many others (see also [CKK + 15, ST17, KKL + 20]).Our paper commences an investigation of this kind for comparator circuits.

Results
Average-case lower bounds.Our work starts with the first average-case lower bound against comparator circuits.
Theorem 1 (Average-case Lower Bound).There exist constants c, d 1 such that the following holds.For any k c • log n, there is a polynomial-time computable function f k such that, for every comparator circuit C with at most An important feature of the lower bound in Theorem 1 is that it matches the Ω (n/ log n) 1.5 worst-case lower bound of [GR20], in the sense that we can recover their result (up to a multiplicative constant) by setting k = O(log n).
Using ideas from the proof of the above average-case lower bound, we also show average-case lower bounds against various models that tightly match their state-of-the-art worst-case lower bounds, such as general formulas, (deterministic-, nondeterministic-, parity-)branching programs and span programs (see Section 4).Note that strong average-case lower bounds against n 2−o(1) -size general formulas and deterministic branching programs were previously known [KR13, CKK + 15] but they did not match the worst-case lower bounds, whereas tight average-case lower bounds for De Morgan formulas were proved by [KRT17].
#SAT algorithms.The design of algorithms for interesting circuit analysis problems is a growing line of research in circuit complexity [Wil14a].These are problems that take circuits as inputs.A famous example of such a circuit analysis problem is the satisfiability problem (SAT), which asks to determine whether a given circuit has a satisfying assignment.Note that the satisfiability problem for polynomial-size general circuits is NP-complete, so it is not believed to have a polynomial-time (or subexponential-time) algorithm.However, one can still ask whether we can obtain non-trivial SAT algorithms running faster than exhaustive search, say in time 2 n /n ω(1) where n is the number of variables of the input circuit, even for restricted circuit classes.While designing non-trivial SAT algorithms is an interesting problem by itself, it turns out that this task is also tightly connected to proving lower bounds.In particular, recent works of Williams [Wil13,Wil14b] have shown that such a non-trivial satisfiability algorithm for a given class of circuits can often be used to prove non-trivial circuit lower bounds against that same circuit class.
Here, we show an algorithm with non-trivial running time that counts the number of satisfying assignments of a given comparator circuit.
Theorem 2 (#SAT Algorithms).There is a constant d > 1 and a deterministic algorithm such that, for every k n/4, given a comparator circuit on n variables with at most gates, the algorithm outputs the number of satisfying assignments of C in time Note that the running time in Theorem 2 is non-trivial for size up to o(n/ log n) 1.5 , in which case k = ω(log n) and the running time becomes 2 n /n ω(1) .
Pseudorandom generators and MCSP lower bounds.Another important circuit analysis problem is derandomization, which, roughly speaking, asks to decide whether a given circuit accepts or rejects a large fraction of its inputs.A standard approach to solve this problem is to construct a pseudorandom generator (PRG).A PRG against a class C of circuits is an efficient and deterministic procedure G mapping short binary strings (seeds) to longer binary strings, with the property that G's output (over uniformly random seeds) "looks random" to every circuit in C.More precisely, we say that a generator G : {0, 1} r → {0, 1} n ε-fools a class C of circuits if, for every C : {0, 1} n → {0, 1} from C, we have In constructing PRGs, we aim to minimize the parameter r, which is called the seed length.We show a PRG against comparator circuits of size s with seed length s 2/3+o(1) .
Note that the seed length of the PRG in Theorem 3 is non-trivial (i.e., o(n)) for comparator circuits of size n 1.5−o(1) .
The PRG above has an application in obtaining lower bounds for the minimum circuit size problem (MCSP) against comparator circuits.The MCSP problem asks if a given truth table 6represents a function that can be computed by some small-size circuit.Understanding the exact complexity of MCSP is a fundamental problem in complexity theory.Motivated by a recent line of research called hardness magnification [OS18, OPS19, CJW19, CHO + 20], which states that a weak circuit lower bound for certain variants of MCSP implies breakthrough results in circuit complexity, researchers have been interested in showing lower bounds for MCSP against restricted classes of circuits.For many restricted circuit classes such as constant-depth circuits, formulas and branching programs, the lower bounds that have been proved for MCSP essentially match the best known lower bounds that we have for any explicit functions [GII + 19, CKLM20, KKL + 20].Here we obtain MCSP lower bounds against comparator circuits that nearly match the worst-case lower bounds.
Theorem 4 (MCSP Lower Bounds).Let MCSP[n α ] denote the problem of deciding whether a given n-bit truth table represents a function that can be computed by some general circuit of size at most n α .For any ε > 0 and any 0 < α 1 − ε, the MCSP[n α ] problem does not have comparator circuits with n 1+α/2−ε gates.
Previously, non-trivial comparator circuit lower bounds were known only for functions satisfying Nečiporuk's criterion [Nec66,GR20], such as Element Distinctness and Indirect Storage Access.Theorem 4 provides yet another natural computational problem which is hard for bounded-size comparator circuits.We remark that the MCSP problem is expected to require much larger circuits than the lower bound of Theorem 4 provides; however, the lack of combinatorial, algebraic or analytic structure in the MCSP function means that proving lower bounds for it is usually hard.
Finally, we also observe that the framework developed in [ST17] can be used to obtain a nontrivial (distribution-independent) PAC learning algorithm for comparator circuits of size n 1.5−o(1) , that uses membership queries (see Section 7).

Techniques
Random restrictions have been very fruitful in the study of weaker circuit classes, such as AC 0 circuits [Hås86, IMP12], De Morgan formulas [KR13] and branching programs [IMZ19], both for the proof of lower bounds and the construction of algorithms [CKK + 15].However, as observed by Gál and Robere [GR20], there are technical challenges when trying to apply this approach to comparator circuits.In this work, we successfully apply the method of random restrictions to comparator circuits for the first time.
Average-case lower bounds.At a high level, the proof of our average-case lower bound is based on the approach developed in [KR13, CKK + 15], which can be used to obtain average-case-lower bounds against circuits that admit a property called "shrinkage with high probability under random restrictions".Roughly speaking, this property says that, if we randomly fix the values of some variables in the circuit except for a 0 < p < 1 fraction of them, then its size shrinks by a factor of p Γ for some Γ > 0, with very high probability.This method has been used to obtain strong average-case lower bounds against n 2.5−o(1) -size De Morgan formulas [KR13, CKK + 15] (later improved to n 3−o(1) by [KRT17]) and n 2−o(1) -size general formulas and deterministic branching programs.
An obvious issue of applying this approach to comparator circuits is that we don't know how to shrink the size (i.e., number of gates) of a comparator circuit using random restrictions, as when we fix the value of a (non-trivial7 ) wire, we may only be able to remove one gate in the worst scenario (i.e., the gate that is directly connected to that wire).The idea is that instead of shrinking the number of gates, we will try to shrink the number of wires.The reason why this can be useful is that one can effectively bound the number of gates of a comparator circuit by its number of wires; this is a structural result of comparator circuits proved by Gál and Robere [GR20] and was the key ingredient in proving their worst-case lower bound.More precisely, they showed that any comparator circuit that has at most wires needs no more than 2 gates (see Lemma 8).Now following [KR13, CKK + 15], one can show that under some certain type of random restriction that leaves a p := k/n fraction of the variables unfixed, for any large enough k, the number of wires of a comparator circuit will shrink (with very high probability) by roughly a factor of p, and hence its number of gates is bounded by (p • ) 2 .By letting = o n 1.5 / k • √ log n , this size is less than o(n/ log n) and from there one can show that the original circuit cannot compute some hard function on more than 1/2 + 1/2 k Ω(1) fraction of the inputs.
While the above gives an average-case lower bound, it does not match the worst-case one, because we need to set k log c n for some (unspecified) constant c > 1, which is controlled by the type of random restrictions and the extractor used in the construction of the hard function in both [KR13, CKK + 15].This means we can only achieve a lower bound that is at best n 1.5 /(log n) c+.5 (even for worst-case hardness).In order to be able to set k = O(log n), one way is to use a more sophisticated (so called non-explicit bit-fixing) extractor shown in [KRT17], which will allow us to set k ∈ O(log n) , Ω n 1/3 (with hardness 1/2 + 1/2 Ω(k) ).Here we refine and simplify this approach in the case of comparator circuits by using a more structural (block-wise) random restriction that shrinks the number of wires with probability one.Such a random restriction, when combined with a simple extractor, allows us to set k ∈ #SAT algorithms.Based on the above analysis in showing average-case lower bounds, one can try to design a SAT algorithm for comparator circuits in a way that is similar to that of [CKK + 15], which combines "shrinkage under restrictions" with a memorization technique.Suppose we have a comparator circuit C with s := o n 1.5 /(k • √ log n) gates and and s non-trivial wires.By partitioning the variables into n/k equal-size blocks, we can show that there is some block S i such that after fixing the variables outside of this block, the number of wires in the restricted circuit is at most 0 := /(n/k) o n/ log n .Again by the structural property of comparator circuits (Lemma 8), this restricted circuit, which is on k variables, has an equivalent circuit with o(n/ log n) gates.Then to count the number of satisfying assignments for the original circuit, we can first memorize the numbers of satisfying assignments for all circuits with at most with o(n/ log n) gates.There are 2 o(n) of them and hence we can compute in time 2 k • 2 o(n) a table that stores those numbers.We then enumerate all possible 2 n−k restrictions ρ ∈ {0, 1} [n]\S i and for each ρ we look up the number of satisfying assignments of the restricted circuit C ρ from the pre-computed table.Summing these numbers over all the ρ's gives the number of satisfying assignments of C.
However, there is a subtle issue in the above argument: although we know that a restricted circuit has an equivalent simple circuit with o(n/ log n) gates, we do not know which simple circuit it is equal to.Note that when we fix the value of a (non-trivial) wire, we may only be able to remove one gate, so the number of gates left in the restricted circuit is possibly s − ( − 0 ), which can be much larger than n/ log n, and it is not clear how we can further simplify such a circuit efficiently.To overcome this issue, we explore structural properties of comparator circuits to show how to construct a more sophisticated data structure that not only can tell us the number of satisfying assignments of a circuit with o(n/ log n) gates but also allows us to efficiently simplify each restricted circuit to an equivalent circuit with at most this many gates.
Pseudorandom generators and MCSP lower bounds.Our PRG against comparator circuits builds upon the paradigm of [IMZ19], which was used to construct PRGs against circuits that admit "shrinkage under pseudorandom restrictions".As in the proof of our average-case-lower bound, in order to apply this paradigm, we will shrink the number of wires instead of the number of gates.Following [IMZ19], we prove a pseudorandom shrinkage lemma for comparator circuits, which can then be used to obtain a PRG of seed length s 2/3+o(1) , where s is the size of a comparator circuit.
As observed in [CKLM20], one can modify the construction of the PRG in [IMZ19] to make it "locally explicit".This means that, for every seed, the output of the PRG, when viewed as a truth table of a function, has circuit complexity that is about the same as the seed length.Such a "local" PRG immediately implies that MCSP cannot be computed by comparator circuits of size n 1.5−o(1) , when the size parameter of MCSP is nearly-maximum (i.e., n/O(log n))8 .Furthermore, we show a better trade-off between the size parameters of MCSP and the lower bound size of the comparator circuits, as in Theorem 4. This is similar to what was done by [CJW20] in the case of MCSP lower bounds against De Morgan formulas.

Directions and open problems
We now state some further directions and open problems for which our work may be a starting point, or that are connected to our results.
Algorithms and lower bounds for larger comparator circuits.Our lower bounds and circuit analysis algorithms only work for comparator circuits of size up to n 1.5−o(1) .Can we improve this?Specifically, can we show a lower bound of n 1.51 for comparator circuits computing a function of n bits, and design algorithms for comparator circuits of the same size?In this paper, we used the random restriction method to analyse comparator circuits by shrinking the number of wires and using a structural result of [GR20] that relates the number of gates to the number of wires.Can we analyse the effect of random restrictions on the gates directly, and show a shrinkage lemma for comparator circuits on the number of gates, with a shrinkage exponent Γ > 1/2?Such a lemma would imply a lower bound that is better than n 1.5 , and would allow us to design algorithms for comparator circuits larger than n 1.5 .
Hardness magnification near the state-of-the-art.Recent work on hardness magnification [OS18, OPS19, CJW19, CHO + 20] has shown that marginally improving the state-of-art worstcase lower bounds in a variety of circuit models would imply major breakthroughs in complexity theory.Although we don't prove this here, it is possible to show hardness magnification results for comparator circuits of size n 2+o(1) by a simple adaptation of their arguments.Unfortunately, this does not match the best lower bounds we have for comparator circuits, which are around n 1.5−o(1) as we have seen.Can we show a hardness magnification phenomenom nearly matching the state-of-art lower bounds for comparator circuits?
Extensions and restrictions of comparator circuits.Recent work of Komarath, Sarma and Sunil [KSS18] has provided characterisations of various complexity classes, such as L, P and NP, by means of extensions or restrictions of comparator circuits.Can our results and techniques applied to comparator circuits be extended to those variations of comparator circuits?Can this extension shed any light into the classes characterised by [KSS18]?

Definitions and notations
For n ∈ N, we denote {1, . . ., n} by [n].For a string x, we denote by K(x) the Kolmogorov complexity of x, which is defined as the minimum length of a Turing machine that prints x as output.

Restrictions.
A restriction for an n-variate Boolean function f , denoted by ρ ∈ {0, 1, * } n , specifies a way of fixing the values of some subset of variables for f .That is, if ρ(i) is * , we leave the i-th variable unrestricted and otherwise fix its value to be ρ(i) ∈ {0, 1}.We denote by f ρ : {0, 1} ρ −1 ( * ) → {0, 1} the restricted function after the variables are restricted according to ρ, where ρ −1 ( * ) is the set of unrestricted variables.
Comparator circuits.We define comparator circuits as a set of wires labelled by an input literal (a variable x i or its negation ¬x i ), a sequence of gates, which are ordered pairs of wires, and a designated output wire.In other words, each gate is a pair of wires (w i , w j ), denoting that the wire w i receives the logical conjunction (∧) of the wires, and w j receives the logical disjunction (∨).On a given input a, a comparator circuit computes as follows: each wire labelled with a literal x i is initialised with a i , and we update the value of the wires by following the sequence of gates; the output wire contains the result of the computation.A wire is called non-trivial if there is a gate connected to this wire.Note that, if a comparator circuit has non-trivial wires and s gates, then s.This means that lower bounds on the number of wires also imply lower bounds on the number of gates.

Structural properties of comparator circuits
For a gate g in a comparator circuit and an input x ∈ {0, 1} n , we denote by u g (x) (resp.v g (x)) the first (resp.second) in-value to the gate g when given x as input to the circuit.
We say that a useless gate is of TYPE-1 (resp.TYPE-2) if it is the first (resp.second) case.Also, a gate is called useful if it is not useless.
The following proposition allows us to remove useless gates from a comparator circuit.
Proposition 6 ([GR20, Proof of Proposition 3.2]).Let C be a comparator circuit whose gates are g 1 , g 2 , . . ., g s (where g s is the output gate) and let g i = (α, β) be any useless gate in C.
• Suppose g i is of TYPE-1.Then the circuit C obtained from C by removing the gate g i computes the same function as that of C.
• Suppose g i is of TYPE-2.Let C be the circuit whose gates are g 1 , g 2 , . . ., g i−1 , g i+1 . . ., g s , where for j = i + 1, . . ., s, g j is obtained from g j by replacing α with β (if g j contains α) and at the same time replacing β with α (if g j contains β).Then C computes the same function as that of C.
Proof.On the one hand, if g is a TYPE-1 useless gate, then for every input to the circuit, the out-values of g are the same as its in-values, so removing g does not affect the function computed by the original circuit.On the other hand, if g is of TYPE-2, then the in-values feeding to g will get swapped after g is applied.This has the same effect as removing g and "re-wiring" the gates after g so that a gate connecting one of the wires of g gets switched to connect the other wire of g, as described in the second item of the proposition.
We need the following powerful structural result for comparator circuits from [GR20].
Theorem 7 ([GR20, Theorem 1.2]).If C be is a comparator circuit with wires and s gates such that every gate in C is useful, then s Proposition 6 and Theorem 7 together give the following lemma.
Lemma 8. Every comparator circuit with > 0 wires has an equivalent comparator circuit with wires and with at most • ( − 1)/2 gates.

Average-case Lower Bounds
In this section, we prove our average-case lower bound against comparator circuits.We first describe the hard function.

The hard function
List-decodable codes.Recall that a (ζ, L)-list-decodable binary code is a function Enc : {0, 1} n → {0, 1} m that maps n-bit messages to m-bit codewords so that, for each y ∈ {0, 1} m , there are at most L codewords in the range of Enc that have relative hamming distance at most ζ from y.We will use the following list-decodable code.
Note that the function A k defined above is polynomial-time computable since we can compute α(y) and Enc(x) i for any given i in poly(n) time.

Proof of the average-case lower bound
We will show a lower bound on the number of wires, which automatically implies a lower bound on the number of gates.
Theorem 11.There exist constants c, d 1 such that the following holds.For any k c • log n, there is a polynomial-time computable function f k such that, for every comparator circuit C whose number of wires is Proof.Let A k be the generalized Andreev's function on 2n variables.Let C be a comparator circuit on 2n variables with n 1.5 / d • k • √ log n wires, where d 1 is a sufficiently large constant.To avoid some technicalities due to divisibility that can be overcome easily, we assume that n is divisible by k.
We need to upper bound the following probability.
Let x be any fixed n-bit string with Kolmogorov complexity at least n/2.Let A : {0, 1} n → {0, 1} be A (y) := A k (x, y), and let C be a comparator circuit on n variables with at most wires defined as C (y) := C(x, y).
We will show that Pr y∈{0,1} n A (y) = C (y) First of all, let us divide the n variables of C into n/k parts, each of which contains k variables, as follows.We first partition the n variables evenly into k consecutive blocks, denoted as B 1 , B 2 , . . ., B k .Then we define the i-th part S i , where i ∈ [n/k], to be the union of the i-th variables in each of B 1 , B 2 , . . ., B k .That is {y : y is the i-th variables of B j } .Now we count the number of wires that are labelled by the variables in each S i and let w i := |{u : u is a wire labelled by some x ∈ S i (or its negation)}| .

We have i∈[n/k]
w i = , which implies that there is a particular i ∈ [n/k] such that Next, we will consider restrictions that fix the values of the variables outside S i .Note that if we fix the value of a variable x i in a comparator circuit, then we can obtain a restricted circuit so that all the wires that are labelled by either x i or ¬x i are eliminated, after some appropriate updates on the gates in the circuit.This is not an obvious fact.One way to see this is that once we fix the value of a wire, the gate that directly connects this wire becomes useless in the sense of Definition 5 so it can be removed after some appropriate "re-wirings" of the gates in the circuit as described in Proposition 6.Then we can keep doing this until no gate is connected to that wire, in which case the wire can be removed from the circuit.Now we have

It suffices to upper bound
Pr for every ρ ∈ {0, 1} [n]\S i .For the sake of contradiction, suppose for some ρ, we have where α ∈ {0, 1} k is α j := Parity ρ| B j \S i ⊕ z j , and ρ| B j \S i denotes the partial assignment given by ρ but restricted to only variables in the set B j \S i .Note that α is uniformly distributed for uniformly random z.Therefore, if we have the values of Parity ρ| B j \S i for each j ∈ [k] (k bits in total), and if we know the restricted circuit C ρ , then we can compute the codeword Enc(x) correctly on at least 1/2 + n/2 k/4 positions, by evaluating C ρ (z) for every z ∈ {0, 1} k .As a result, we can list-decode Enc(x), and, using additional k/2 bits (to specify the index of x in the list), we can recover x exactly.Finally, note that the number of wires in C ρ is at most 0 .Therefore, by Lemma 8, such a circuit can be described using a string of length at most where the last inequality holds when d is sufficiently large.Therefore, we can recover x using less than n/4 bits.Here we assume k n/8 since otherwise the theorem can be shown trivially.This contradicts the fact that the Kolmogorov complexity of x is at least n/2.
4 Tight Average-case Lower Bounds from a Nečiporuk-Type Property Here, we describe a generalization of the average-case lower bound in Section 3 to circuit classes whose worst-case lower bounds can be proved via Nečiporuk's method.
Theorem 12.There is a constant c > 1 such that the following holds.Let C be a class of Boolean circuits that is closed under restrictions.Suppose that, for any k ∈ [c • log n, n/3], there exists a partition of the n variables into m := n/k equal-sized blocks S 1 , S 2 , . . ., S m and a collection of k-input-bit functions H such that 1. |H| 2 n/2 , and 2. for every C ∈ C n of size s(n, k), there exists some block S i such that {C ρ } ρ∈{0,1} [n]\S i ⊆ H.
Then for any k ∈ [c • log n, n/6], there exists a polynomial-time computable function f k which satisfies Remark.In the original Nečiporuk's argument for getting worst-case lower bounds, it is only required that, for every C ∈ C, there is some block such that the number of distinct functions, after fixing the variables outside of the block, is at most 2 n/2 , and this set of functions can be different for different C. For Theorem 12, we need something stronger which says that it is the same set of 2 n/2 functions for every C. We remark that, though the weaker condition is sufficient for worst-case lower bounds, all applications of Nečiporuk's method known to us also prove the stronger condition, thus yielding average-case lower bounds by Theorem 12.
Theorem 12 requires a slightly different argument than that of Theorem 11.Its proof is presented in Appendix A.
By combining Theorem 12 with known structural properties for various models (see e.g., [Juk12]), we get that for the class of circuits C of size s, where • C is the class of general formulas, and s = n 2 /O(k), or • C is the class of deterministic branching programs or switching networks, and s = n 2 /O(k•log n), or • C is the class of nondeterministic branching programs, parity branching programs, or span programs, and s = n 1.5 /O(k), k) for every C ∈ C, which matches the state-of-the-art worst-case lower bounds (up to a multiplicative constant) by letting k = O(log n).

#SAT Algorithms
In this section, we present our #SAT algorithm for comparator circuits.As mentioned briefly in Section 1.2, we will need a preprocessed data structure that enables us to efficiently convert a circuit with small number of wires but large number of gates to an equivalent circuit (with the same number of wires) whose number of gates is at most quadratic in the number wires.

Memorization and simplification of comparator circuits
Lemma 13.Let n, 1 be integers.For any fixed labelling of wires on n variables, there is a data structure DS such that • Given access to DS and given any comparator circuit C with wires (whose labelling is consistent with the one used for DS) and s gates, we can output in time poly(s, ) the number of satisfying assignments of C.Moreover, we obtain a comparator circuit with wires and at most • ( − 1)/2 gates that is equivalent to C.
Proof.We know that every comparator circuit with wires has an equivalent circuit with • ( − 1)/2 gates (Lemma 8).Therefore, we can try to memorize the number of satisfying assignments for each of these circuits (by brute-force).Then for a given circuit C with wires and s gates where s poly( ), we need to simplify C to be a circuit with • ( − 1)/2 gates so that we can look up its number of satisfying assignments, which was already computed.However, it is not clear how we can efficiently simplify such a comparator circuit.
The idea here is to remove the useless gates one by one (from left to right).To do this, firstly, we need to be able to tell whether a gate is useless, and secondly whenever we remove a useless gate, we need to "re-wire" the gates that come after that gate, which can depend on the types of the useless gate that we are removing, as described in Proposition 6.
More specifically, DS will be a "tree-like" structure of depth at most • ( − 1)/2 + 2 where the internal nodes are labelled as gates.Note that a path from the root to any internal node in the tree gives a sequence of gates, which specifies a comparator circuit up to a choice of the output wire.We will require the label of every internal node to be a useful gate in the circuit specified by the path from the root to the node.In other words, each internal node will branch on all possible useful gates that could occur next in the circuit.Moreover, each leaf is either labelled as a useless gate, with respect to the circuit specified by the path from the root to the current leaf, or is labelled as a single wire that is designed to be the output wire.
For every leaf that is a useless gate, we store its type, and for each leaf that is a single wire, we store the number of satisfying assignments of the circuit that is specified by the path from the root to the leaf.Moreover, each internal node is a useful gate whose children are indexed by the set of all possible gates (each is an ordered pair of wires) and the set of wires (called an output leaf ).Note that checking whether a new gate is useless and computing its type require evaluating the current circuit on all possible inputs, which takes time 2 n • poly( ), but this is fine with our running time.Similarly, we can compute the number of satisfying assignments in each output leaf by brute force.Note that by Theorem 7, the depth of such a tree is at most • ( − 1)/2 + 2, otherwise there would be a comparator circuit with wires that has more than • ( − 1)/2 useful gates.Since each internal node has at most 2 children, the tree has at most O 2 nodes in total.Since each node can be constructed in time 2 n • poly( ), the running time is clear.
To look up the number of the satisfying assignments of a given circuit C (with a labelling of the wires that is consistent with the one used for DS), we start from the root of DS, and move down the tree as we look at the gates in C one by one (from left to right in the natural way).If we reach an output leaf, we output the number of satisfying assignments stored in that leaf.However, if we reach a leaf v that is specified as a useless gate, we remove the corresponding gate in C and update the gates that come after it according to the type of this useless gate, using Proposition 6.Once we update the circuit, we start again from the parent of v and look at the next gate in the updated circuit.We repeat this until we reach an output leaf.

The algorithm
We will show an algorithm for comparator circuits with small number of wires, while the number of gates can be polynomial.
Theorem 14.There is a constant d > 1 and a deterministic algorithm such that for every k n/4, given a comparator circuit on n variables with at most wires and poly(n) gates, the algorithm outputs the number of satisfying assignments of C in time Proof.Let C be a comparator circuit with n 1.5 / d • k • √ log n wires and poly(n) gates, where d 1 is a sufficiently large constant.
We partition the n variables almost-evenly into n/k consecutive blocks, denoted as S 1 , S 2 , . . ., S n/k .We then count the number of wires that are labelled by the variables in each S i and let w i := |{u : u is a wire labelled by some x ∈ S i (or its negation)}| .
We have which implies that there is a particular i ∈ [k] such that Moreover, we can find such i efficiently.
Constructing DS.Using Lemma 13, we create a data structure DS with w i wires and |S i | k variables and a labelling consistent with that of C for the wires labelled by variables from S i .This can be done in time Enumeration.For each ρ ∈ {0, 1} [n]\S i , we obtain a restricted circuit C ρ (on either k or k + 1 variables), which has 0 wires (whose labelling is consistent with the one used for DS created above) and has poly(n) gates.Then using DS, we can efficiently look up the number of satisfying assignments of C ρ .Finally we sum over these numbers over all such ρ's and this gives the number of satisfying assignments of C.
The total running time of the above algorithm is as desired.
6 Pseudorandom Generators and MCSP Lower Bounds In this section, we show a PRG for small comparator circuits, and derive from it lower bounds for comparator circuits computing MCSP.

Proof of the PRG
We start with some definitions and notations.
• For a Boolean function f , we denote by (f ) the minimum number of wires in a comparator circuit computing f .
• We will often describe a restriction ρ ∈ {0, 1, * } n as a pair (σ, β) ∈ {0, 1} n × {0, 1} n .The string σ is the characteristic vector of the set of coordinates that are assigned * by ρ, and β is an assignment of values to the remaining coordinates.The string σ is also called a selection.
• We say that a distribution D on {0, 1} n is a p-regular As mentioned in Section 1.2, we will need a result saying that the number of wires in a comparator circuit shrinks with high probability under pseudorandom restrictions.
The proof of Lemma 15 follows closely that of [IMZ19, Lemma 5.3], except for that here we also need to show that the pseudorandom restriction can be computed with small size circuits.Such a restriction is proved to exist in Lemma 18 of [CKLM20].For completeness, a proof is presented in Appendix B.
Proof Sketch.In [IMZ19], it is shown that if a circuit class "shrinks" with high probability under a pseudorandom restriction, then we can construct pseudorandom generators for this circuit class with non-trivial seed-length.The authors of [CKLM20] then showed that if the same shrinkage property holds for random selections that can be efficiently sampled and computed, then we can obtain local PRGs.In Lemma 15, we proved exactly what is required by [CKLM20] to obtain local PRGs for comparator circuits.
More specifically, the theorem can be derived by following the proof of [CKLM20, Lemma 16], and adjusting the parameters there in a natural way.In particular, we will use p := −2/3 so that after the pseudorandom restriction in Lemma 15, the restricted comparator circuit has at most • 1/3 wires (with high probability).Another observation needed in the proof is that, by Lemma 8, there can be at most 2 2/3+o(1) distinct functions for comparator circuits with this many wires.We omit the details here.

Proof of the MCSP lower bound
We prove the following stronger result which implies Theorem 4.
Proof.Let f denote the function MCSP[n α ] on inputs of length n.For the sake of contradiction, suppose f can be computed by a comparator circuit C with n 1+α/2−ε wires, for some ε > 0.
Let k := n α+ε/2 .Consider an (almost-even) partition of the n variables into n/k consecutive blocks, denoted as S 1 , S 2 , . . ., S n/k .Again, by an averaging argument, there is some i ∈ [ n/k ] such that after fixing the values of the variables outside S i , the number of wires in the restricted circuit is at most : Let ρ be a restriction that fixes the values of the variables outside S i to be 0 and leaves the variables in S i unrestricted.Let G be the PRG from Theorem 16 that has seed length r := 2/3+o(1) and (1/3)-fools comparator circuits with at most wires.On the one hand, since |S i | k, then by a counting argument, for a uniformly random x ∈ {0, 1} n , the circuit size of the truth table given by ρ • x is at least k/(10 log k) > n α , with probability at least 1/2.In other words, Pr x∈{0,1} n [f ρ (x) = 1] 1/2.On the other hand, by the second item of Theorem 16, for any seed z ∈ {0, 1} r , the output of the PRG G(z), viewed as a truth table, represents a function that can be computed by a circuit of size 2/3+o(1) .Then knowing i ∈ [n] (which can be encoded using log(n) bits), the truth table given by ρ • G(z) has circuit size at most polylog(n) + 2/3+o(1) n α .

Learning Algorithms
Recall that a (distribution-independent) PAC learning algorithm for a class of functions C has access to labelled examples (x, f (x)) from an unknown function f ∈ C, where x is sampled according to some (also unknown) distribution D. The goal of the learner is to output, with high probability over its internal randomness and over the choice of random examples, a hypothesis h that is close to f under D. As in [ST17], here we consider the stronger model of "randomized exact learning from membership and equivalence queries".It is known that learnability in this model implies learnability in the distribution-independent PAC model with membership queries (see [ST17, Section 2] and the references therein).
Theorem 18 ([ST17, Lemma 4.4]).Fix any partition S 1 , S 2 , . . ., S n 1−n δ of [n] into equal-size subsets, where each S i is of size n δ and δ > 0. Let C be a class of n-variate functions such that for each f ∈ C, there is an S i such that {f ρ } ρ∈{0,1} [n]\S i 2 n β , where β < 1 and moreover δ + β < 1.Then there is a randomized exact learning algorithms for C that uses membership and equivalence queries and runs in time 2 n−n δ • poly(n).
Corollary 19.For every ε > 0, there is a randomized exact learning algorithms for comparator circuits with n 1.5−ε wires that uses membership and equivalence queries that runs in time 2 n−n Ω(ε) • poly(n).
Proof.Consider Theorem 18 and any partition S 1 , S 2 , . . ., S n 1−n δ of the n variables into equal-size subsets, each is of size n δ , where δ := ε/3.Then by an averaging argument, for every comparator circuit C with n 1.5−ε wires, there is some S i such that after fixing the variables outside of S i , the number of wires in the restricted circuit is at most := n 1.5−ε /n 1−δ n .5−2ε/3 .By Lemma 8, such a restricted circuit computes some function that is equivalent to a circuit with ( − 1)/2 gates, and there are at most O( 2 )) 2 n 1−ε/2 such circuits.Therefore we have where β := 1 − ε/2 < 1 and δ + β < 1.The algorithm then follows from Theorem 18.
B Pseudorandom Shrinkage for Comparator Circuits: Proof of Lemma 15 Technical tools.We will need a Chernoff-Hoeffding bounds for distributions with bounded independence from [SSS95] (Lemmas 2.3 in [IMZ19]).Recall that a distribution D on [m] n is k-wise independent if, for any set A ⊆ [n] of size |A| k, the random variables {σ(i) : i ∈ A} are mutually independent when σ ∼ D.
Shrinkage of comparator circuits under pseudorandom restrictions.We first show the following result for comparator circuits which is analogous to [IMZ19, Lemma 5.2] for branching programs.
Proof.First, we note that a k-wise independent random selection that can be efficiently sampled and computed with the required parameters is proved to exist in Lemma 18 of [CKLM20].Henceforth, we let ρ be the random restriction described by the pair (σ, β).
Let C be a comparator circuit with wires computing f .Let k = c • log .For i ∈ [n], let w i be the number of wires in C labelled with the variable x i .
We now let h = 3/2 • c/α , and observe that Pr Let X i be a random variable such that X i = 1 iff ρ(i) = * .From Lemma 22, it follows that the first term can be bounded by (|H|p) h p αh −c .For the second term, we can apply Lemma 21 on the light variables with µ p and m < p 1−α , so that m + µ 2p 1−α , thus bounding the probability by 2 −k −c .

Figure 1 :
Figure 1: A comparator circuit with 2 inputs, 4 wires and 4 gates.The third wire computes the parity of the two bits.