Gate elimination: parity needs 3 (n - 1) binary gates #
A De Morgan circuit computing the parity of n bits has at least 3 (n - 1) AND and OR gates,
however many negations and constants it uses (three_mul_le_cost_of_computes_parity). This is
Schnorr's bound [Sch74], Jukna, Section 1.6. It is attained by chaining
x ⊕ y = (x ∨ y) ∧ ¬(x ∧ y), which spends three binary gates on each bit after the first
(exists_computes_parity), so 3 (n - 1) is the exact count (isLeast_cost_parity). It is the
prototypical gate-elimination argument: fixing one bit suitably makes three binary gates
superfluous and leaves the parity of the other bits, possibly negated.
The proof does not rewrite circuits. For a restriction (partial assignment) ρ it counts the
nonredundant gates: AND and OR gates whose function, once the bits fixed by ρ are hardwired, is
neither constant, nor a literal, nor one of its arguments up to negation
(GateElimination.NonRedundant). Fixing more bits never makes a redundant gate nonredundant
(GateElimination.nonRedundant_update_subset). Every nonredundant gate survives the simplifications
of the textbook proof, so their number is a lower bound on the number of binary gates, and it is
what each step of the proof decreases.
The step follows Schnorr. Consider the nonredundant gates from which a chain of nonredundant gates,
negations and gates that compute one of their arguments up to negation leads to the output. The
first of them reads two different bits xᵢ and xⱼ, each of which, suitably fixed, makes it
constant. Another of them reads xᵢ: otherwise fixing xⱼ would make the output ignore xᵢ.
Fixing xᵢ then makes three of them redundant: the first gate, the other reader of xᵢ, and a
gate reading the first one, or reading the other reader of xᵢ if that is the same gate.
Main definitions #
Cslib.Circuits.Boolean.GateElimination.restricted: the function of a wire under a restriction.Cslib.Circuits.Boolean.GateElimination.NonRedundant: nonredundant gates under a restriction.
Main results #
Cslib.Circuits.Boolean.three_mul_le_cost_of_computes_parity: a circuit computing the parity ofnbits has at least3 (n - 1)AND and OR gates.Cslib.Circuits.Boolean.isLeast_cost_parity: and some circuit has exactly that many.Cslib.Circuits.Boolean.three_mul_le_complexity_parity: the circuit complexity of parity is at least3 (n - 1).
References #
Constants, literals and negations #
φ is ψ or its negation.
Instances For
φ is constant or a literal.
Instances For
A function of bit i alone is constant or a literal.
Hardwiring bits keeps constants and literals.
A constant or a literal is bit i up to negation or ignores it.
Gates #
Restricted programs #
The function computed at wire w once the bits fixed by ρ are hardwired.
Instances For
Fixing one more free bit is restricting the restricted function.
A wire that is another up to negation is constant when the other is, after fixing a bit.
Fixing a free bit of the parity of all free bits leaves the parity of the others, possibly negated.
Nonredundant gates #
Gate k is a nonredundant binary gate once the bits fixed by ρ are hardwired: an AND or
OR gate whose function is neither constant, nor a literal, nor one of its arguments up to
negation.
Instances For
The nonredundant binary gates under ρ.
Instances For
There are at most as many nonredundant gates as binary gates.
Fixing one more bit only makes gates redundant.
Wires that may matter #
Eliminating three gates #
Schnorr's elimination step. If, under ρ, the wire o computes the parity of all free
bits, possibly negated, and at least two bits are free, then fixing one free bit suitably makes at
least three nonredundant gates redundant.
Under a restriction leaving m + 1 bits free for which the wire o computes their parity,
possibly negated, at least 3 m gates are nonredundant.
Schnorr's bound. A De Morgan circuit computing the parity of n bits has at least
3 (n - 1) AND and OR gates, however many negations and constants it uses.
The least number of AND and OR gates in a De Morgan circuit computing the parity of n bits
is 3 (n - 1).
The De Morgan circuit complexity of the parity of n bits is at least 3 (n - 1).