Gate Elimination Lower Bound #
For every circuit, the number of essential input variables is at most its total
fan-in. For a bounded fan-in k AND/OR basis (Basis.boundedAndOr k), this is
at most k times circuit size.
The key insight: if no gate directly reads a primary input wire, then that
input cannot influence the circuit's output. By contrapositive, every
essential variable must be "covered" by at least one gate. Since each gate
reads at most k inputs, the circuit needs at least ⌈n'/k⌉ gates.
Definitions (from Complexitylib.Circuits.EssentialInput) #
IsEssentialInput f i— functionfdepends on input variablei(flipping bitican change some output)essentialInputs f— theFinsetof all essential input variables
Main results #
The generic theorem is Circuit.card_essentialInputs_le_totalFanIn; its
bounded-fan-in corollary is Circuit.card_essentialInputs_le_mul_size:
theorem Circuit.card_essentialInputs_le_mul_size {k : Nat}
(c : Circuit (Basis.boundedAndOr k) N M G)
(f : BitString N → BitString M)
(hf : c.eval = f) :
(essentialInputs f).card ≤ k * c.size
And its corollary for functions that depend on all inputs:
theorem Circuit.le_mul_size_of_forall_isEssentialInput {k : Nat}
(c : Circuit (Basis.boundedAndOr k) N M G)
(f : BitString N → BitString M)
(hf : c.eval = f)
(hall : ∀ i : Fin N, IsEssentialInput f i) :
N ≤ k * c.size
Over any basis, the number of essential variables of a computed function is at most the circuit's total number of gate-input occurrences.
If a function depends on every input, every circuit computing it has total
fan-in at least N.
For bounded fan-in k, the number of essential variables of a computed
function is at most k times the circuit's total gate count.
If a function computed by a bounded fan-in k circuit depends on every
input, then N ≤ k * c.size.