Majority needs at least n - B(n) nonlinear gates #
Here B(n) is the sum of the binary digits of n. Every circuit over a Boolean basis of
fan-in at most two computing majority on n inputs has at least n - B(n) nonaffine gates,
with no restriction on depth, fanout, or the number of affine gates. Specializing to the native
Zhegalkin basis {⊕, ∧, 1} gives
n - B(n) ≤ Zhegalkin.multiplicativeComplexity (single (majority n)), the multiplicative
complexity lower bound of [Chistopolskaya and Podolskii, Corollary 11, §4, p. 12]
[CP18].
The source counts AND gates in the basis {AND, XOR, NOT}. The native basis uses a free
constant 1 in place of NOT: negation is XOR with 1, and for a nonempty input a constant
1 can be made as NOT (x XOR x), with no AND gates. Thus the cost conventions agree for
positive input counts. The zero-input case here is the trivial extension, computed by the
free constant 1.
The proof combines the integer-denominator invariant in Boolean.NonlinearCost with one
explicit Fourier coefficient. On 2 r + 1 inputs, a singleton coefficient is C(2r,r) / 4^r.
On 2 r inputs, the constant coefficient is its negative: the library's majority convention
accepts ties. The exponent of two dividing C(2r,r) is B(r), by Legendre's formula, so its
denominator forces at least 2r - B(r) nonlinear gates. The binary digit identities for 2r
and 2r + 1 give the claimed bound for every input count, including zero.
Main results #
Cslib.Circuits.Circuit.sub_sum_digits_le_nonlinearCost_of_eval_eq_majority: every designated output computing majority requires at leastn - B(n)nonaffine gates.Cslib.Circuits.Boolean.Zhegalkin.sub_sum_digits_le_multiplicativeComplexity_majority: the native multiplicative complexity of majority is at leastn - B(n).
References #
A designated circuit output computing majority on n inputs requires at least n - B(n)
nonaffine gates, where B(n) is the sum of the binary digits of n. All affine operations and
arbitrary wire reuse are free. This generalizes [Chistopolskaya and Podolskii, Corollary 11]
[CP18] from the basis {AND, XOR, NOT} to every basis of fan-in at most
two; the cited statement is
Boolean.Zhegalkin.sub_sum_digits_le_multiplicativeComplexity_majority.
In the Zhegalkin basis, precisely conjunction is nonaffine, so the native nonlinear cost equals the existing conjunction-gate cost.
Majority multiplicative-complexity lower bound Chistopolskaya and Podolskii,
Corollary 11, §4, p. 12: computing majority on n inputs needs at
least n - B(n) conjunction gates over {⊕, ∧, 1}, where B(n) is the binary digit sum.