Shannon's circuit-size lower bound
DefinitionWire count of a flat circuit#✓fully proved
The wire count of a flat Boolean circuit on \(n\) inputs, given as a list of gates, is the sum over its gates of the lengths of their predecessor lists: every reference of a gate to a gate index is counted, with multiplicity, while input variables and constants contribute nothing and the modulus of a mod gate is not counted.
def wireCount {n : ℕ} (C : List (ACGate n)) : ℕ :=
(C.map gateInputs).flatten.length
inductive ACGate (n : ℕ) where
| var : Fin n → ACGate n
| const : Bool → ACGate n
| notGate : ℕ → ACGate n
| andGate : List ℕ → ACGate n
| orGate : List ℕ → ACGate n
| modGate : ℕ → List ℕ → ACGate n
CSLibExt/Computability/Complexity/Classes.lean:414
def gateInputs {n : ℕ} : ACGate n → List ℕ
| .var _ => []
| .const _ => []
| .notGate a => [a]
| .andGate l => l
| .orGate l => l
| .modGate _ l => l
CSLibExt/Computability/Complexity/Classes.lean:423
Uses 2 · Used by 1
TheoremShannon: most Boolean functions need exponential circuits#●ready to prove
For every natural number \(n \ge 10\), at least \(2^{2^n}/2\) of the Boolean functions \(f\) on \(n\) input bits have the following property: for every well-formed flat Boolean circuit \(C\) on \(n\) inputs without mod gates whose wire count (the total length of the predecessor lists of its gates) is at most \(\lfloor 2^n / (10 n) \rfloor\), there is an input \(x \in \{0,1\}^n\) such that \(C\) has no gates or the value of the last gate of \(C\) on \(x\) differs from \(f(x)\).
public theorem_wanted shannon_hard_function :
∀ n : ℕ, 10 ≤ n →
(Set.ncard {f : (Fin n → Bool) → Bool | ∀ C : List (ACGate n),
WellFormedCircuit C → IsModFree C → wireCount C ≤ 2 ^ n / (10 * n) →
∃ x : Fin n → Bool, (circuitEval C x).getLast? ≠ some (f x)} ≥
2 ^ (2 ^ n) / 2)
inductive ACGate (n : ℕ) where
| var : Fin n → ACGate n
| const : Bool → ACGate n
| notGate : ℕ → ACGate n
| andGate : List ℕ → ACGate n
| orGate : List ℕ → ACGate n
| modGate : ℕ → List ℕ → ACGate n
CSLibExt/Computability/Complexity/Classes.lean:414
def WellFormedCircuit {n : ℕ} (C : List (ACGate n)) : Prop :=
∀ j (h : j < C.length), ∀ a ∈ gateInputs (C[j]'h), a < j
CSLibExt/Computability/Complexity/Classes.lean:432
def IsModFree {n : ℕ} (C : List (ACGate n)) : Prop :=
∀ g ∈ C, match g with
| .modGate _ _ => False
| _ => True
CSLibExt/Computability/Complexity/Classes.lean:538
def wireCount {n : ℕ} (C : List (ACGate n)) : ℕ :=
(C.map gateInputs).flatten.length
WantedExt/Complexity/KeyTheorems/ShannonHardFunctionWanted.lean:46
def circuitEval {n : ℕ} (C : List (ACGate n)) (assign : Fin n → Bool) : List Bool :=
C.foldl (fun vs g => vs ++ [gateValue vs assign g]) []
CSLibExt/Computability/Complexity/Classes.lean:447
Sources
- C. E. Shannon, "The synthesis of two-terminal switching circuits", Bell System Technical Journal 28 (1949), 59-98.
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.