Documentation

CslibFrontier.Computability.Circuit.Boolean.Smolensky

The Razborov–Smolensky lower bound #

MOD_p is not in AC⁰[q] for any two distinct primes p ≠ q (modGate_notMem_AC0Mod, compl_modGate_notMem_AC0Mod): constant-depth, polynomial-size circuits of negations, unbounded fan-in conjunctions and disjunctions, and MOD_q gates do not compute MOD_p [Raz87], [Smo87]. The library's modGate p m x accepts when the number of true inputs is not divisible by p (mem_ofSlices_modGate_iff); the complement (Language.ofSlices (modGate p))ᶜ is the textbook convention rejecting when the count is nonzero mod p (mem_compl_ofSlices_modGate_iff). Since modGate 2 = parity, the p = 2 special case is parity_notMem_AC0Mod.

For the general finite tradeoff (two_mul_two_pow_le_size_of_computes_modGate), an AC⁰[q] circuit of depth d computing modGate p on n bits is approximated in degree D = ((q - 1) ℓ) ^ d over the algebraic closure F of ZMod q with error rate size / 2 ^ ℓ (exists_lowDegree_approx). Fixing a primitive p-th root of unity ω ∈ F and padding r ∈ [1, p) additional true bits onto m = n - (p - 1) inputs turns the approximator into a degree-D polynomial agreeing with ω ^ weight x whenever all p - 1 shifted evaluations agree, yielding 2 · 2 ^ ℓ ≤ 5 (p - 1) 2 ^ (p - 1) · size when 100 (D + 1)² + (p - 1) ≤ n + 1 via BitString.card_agree_phaseChar_le and ten_mul_card_filter_card_le_le. For parity against an odd prime (two_mul_two_pow_le_size_of_computes_parity), working directly over ZMod p preserves the sharper constant 2 · 2 ^ ℓ ≤ 5 · size under 100 (D + 1)² ≤ n + 1.

Main definitions #

Main results #

References #

Language.ofSlices (modGate p) accepts bit strings whose number of true entries is not divisible by p.

The complement (Language.ofSlices (modGate p))ᶜ accepts bit strings whose number of true entries is divisible by p, matching the MOD_p convention where multiples of p are accepted.

Padding helpers and shared counting bound #

Finite size–depth tradeoffs and separation theorems #

@[instance_reducible]

2 is invertible in ZMod p for an odd prime p.

theorem Cslib.Circuits.Boolean.Smolensky.two_mul_two_pow_le_size_of_computes_modGate {p q : ℕ} [hp : Fact (Nat.Prime p)] [hq : Fact (Nat.Prime q)] {n : ℕ} (hpq : p ≠ q) {C : Circuit Unbounded.extSignature n 1} (hC : C.Computes (Unbounded.extInterpretation (modGate q)) (single (modGate p n))) {ℓ : ℕ} (hℓ : 1 ≤ ℓ) (hn : 100 * (((q - 1) * ℓ) ^ C.depth + 1) ^ 2 + (p - 1) ≤ n + 1) :
2 * 2 ^ ℓ ≤ 5 * (p - 1) * 2 ^ (p - 1) * C.size

The general Razborov–Smolensky size–depth tradeoff. A circuit of the AC⁰[q] basis of depth d computing modGate p on n bits, for distinct primes p ≠ q, has size at least 2 * 2 ^ ℓ / (5 * (p - 1) * 2 ^ (p - 1)) whenever 100 (((q - 1) ℓ) ^ d + 1)² + (p - 1) ≤ n + 1.

MOD_p is not in AC⁰[q] for any two distinct primes p ≠ q (Razborov–Smolensky).

The complement (Language.ofSlices (modGate p))ᶜ (accepting counts divisible by p) is not in AC⁰[q] for any two distinct primes p ≠ q.

theorem Cslib.Circuits.Boolean.Smolensky.two_mul_two_pow_le_size_of_computes_parity {p : ℕ} [hp : Fact (Nat.Prime p)] {n : ℕ} (hp2 : p ≠ 2) {C : Circuit Unbounded.extSignature n 1} (hC : C.Computes (Unbounded.extInterpretation (modGate p)) (single (parity n))) {ℓ : ℕ} (hℓ : 1 ≤ ℓ) (hn : 100 * (((p - 1) * ℓ) ^ C.depth + 1) ^ 2 ≤ n + 1) :
2 * 2 ^ ℓ ≤ 5 * C.size

The Razborov–Smolensky size–depth tradeoff for parity. A circuit of the AC⁰[p] basis of depth d computing the parity of n bits, for an odd prime p, has size at least 2 ^ ℓ · 2 / 5 whenever 100 (((p - 1) ℓ) ^ d + 1)² ≤ n + 1.

Parity is not in AC⁰[p] for an odd prime p (Razborov–Smolensky), as the q = 2 case of modGate_notMem_AC0Mod.