Documentation

CslibFrontier.Computability.Circuit.Boolean.SymAnd.Mobius

The canonical SYM ∘ AND circuit of a low-degree function #

Let c be an integer function of degree at most D on the cube T → Bool, for a finite set of positions T. Its subset Möbius coefficients μ S = ∑_{U ⊆ S} (-1) ^ (#S - #U) c 1_U (Cslib.BitString.subsetMobius) vanish on sets of more than D positions, and c = ∑_S μ S · x^S (Cslib.BitString.eq_sum_subsetMobius_smul_monomial). Modulo M > 0, taking every set S of at most D positions as an AND gate with multiplicity the least residue of μ S modulo M (Cslib.Circuits.Boolean.SymAnd.mobiusGates) gives a multiset of AND gates whose number of satisfied gates is congruent to c modulo M at every point. Applying a symmetric gate to that number modulo M gives the canonical circuit Cslib.Circuits.Boolean.SymAnd.ofLowDegree: it outputs out (c x mod M) (SymAnd.eval_ofLowDegree), with fan-in at most D and at most M (|T| + 1) ^ D AND gates.

The circuit is determined by D, M, out and the values of c at the indicators of sets of at most D positions, with no choice. Its gates give the existence form SymAnd.exists_countP_modEq_of_mem_lowDegree, and it is the step from which the collapse of modular towers (CslibFrontier.Computability.Circuit.Boolean.SymAnd.Collapse) builds its circuits.

Main definitions #

Main results #

References #

def Cslib.Circuits.Boolean.SymAnd.mobiusGates {T : Type u_1} [Fintype T] [DecidableEq T] (D M : ℕ) (c : (T → Bool) → ℤ) :

The AND gates of c modulo M up to degree D: every set S of at most D positions, with multiplicity the least residue modulo M of the subset Möbius coefficient of c at S.

theorem Cslib.Circuits.Boolean.SymAnd.card_le_of_mem_mobiusGates {T : Type u_1} [Fintype T] [DecidableEq T] {D M : ℕ} {c : (T → Bool) → ℤ} {S : Finset T} (hS : S ∈ mobiusGates D M c) :
S.card ≤ D

Every gate of mobiusGates D M c reads at most D positions.

theorem Cslib.Circuits.Boolean.SymAnd.card_mobiusGates_le {T : Type u_1} [Fintype T] [DecidableEq T] (D : ℕ) {M : ℕ} (hM : 0 < M) (c : (T → Bool) → ℤ) :
(mobiusGates D M c).card ≤ M * (Fintype.card T + 1) ^ D

There are at most M (|T| + 1) ^ D gates: fewer than M copies of each set of at most D positions.

def Cslib.Circuits.Boolean.SymAnd.ofLowDegree {T : Type u_1} [Fintype T] [DecidableEq T] (D M : ℕ) (c : (T → Bool) → ℤ) (out : ℕ → Bool) :

The canonical SYM ∘ AND circuit of c modulo M up to degree D: the gates mobiusGates D M c below the symmetric gate z ↦ out (z mod M).

theorem Cslib.Circuits.Boolean.SymAnd.natCast_count_ofLowDegree_modEq {T : Type u_1} [Fintype T] [DecidableEq T] {D : ℕ} {c : (T → Bool) → ℤ} (hc : c ∈ BitString.lowDegree ℤ T D) {M : ℕ} (hM : 0 < M) (out : ℕ → Bool) (x : T → Bool) :
↑((ofLowDegree D M c out).count x) ≡ c x [ZMOD ↑M]

The canonical gates count c modulo M. If c has degree at most D and M > 0, the number of satisfied gates of ofLowDegree D M c out is congruent to c modulo M.

theorem Cslib.Circuits.Boolean.SymAnd.count_ofLowDegree_mod {T : Type u_1} [Fintype T] [DecidableEq T] {D : ℕ} {c : (T → Bool) → ℤ} (hc : c ∈ BitString.lowDegree ℤ T D) {M : ℕ} (hM : 0 < M) (out : ℕ → Bool) (x : T → Bool) :
(ofLowDegree D M c out).count x % M = (c x % ↑M).toNat

The number of satisfied gates modulo M is the least residue of c modulo M.

theorem Cslib.Circuits.Boolean.SymAnd.eval_ofLowDegree {T : Type u_1} [Fintype T] [DecidableEq T] {D : ℕ} {c : (T → Bool) → ℤ} (hc : c ∈ BitString.lowDegree ℤ T D) {M : ℕ} (hM : 0 < M) (out : ℕ → Bool) (x : T → Bool) :
(ofLowDegree D M c out).eval x = out (c x % ↑M).toNat

What the canonical circuit computes: out of the least residue of c x modulo M, for c of degree at most D and M > 0.

theorem Cslib.Circuits.Boolean.SymAnd.fanIn_ofLowDegree_le {T : Type u_1} [Fintype T] [DecidableEq T] (D M : ℕ) (c : (T → Bool) → ℤ) (out : ℕ → Bool) :
(ofLowDegree D M c out).fanIn ≤ D

The canonical circuit has fan-in at most D.

theorem Cslib.Circuits.Boolean.SymAnd.size_ofLowDegree_le {T : Type u_1} [Fintype T] [DecidableEq T] (D : ℕ) {M : ℕ} (hM : 0 < M) (c : (T → Bool) → ℤ) (out : ℕ → Bool) :
(ofLowDegree D M c out).size ≤ M * (Fintype.card T + 1) ^ D

The canonical circuit has at most M (|T| + 1) ^ D AND gates.

theorem Cslib.Circuits.Boolean.SymAnd.exists_countP_modEq_of_mem_lowDegree {T : Type u_1} [Fintype T] {D : ℕ} {c : (T → Bool) → ℤ} (hc : c ∈ BitString.lowDegree ℤ T D) {M : ℕ} (hM : 0 < M) :
∃ (G : Multiset (Finset T)), (∀ S ∈ G, S.card ≤ D) ∧ G.card ≤ M * (Fintype.card T + 1) ^ D ∧ ∀ (x : T → Bool), ↑(Multiset.countP (fun (S : Finset T) => ∀ i ∈ S, x i = true) G) ≡ c x [ZMOD ↑M]

Low-degree integer functions are AND counts modulo M. For c of degree at most D on the cube and M > 0, some multiset of at most M * (|T| + 1) ^ D sets of at most D positions has, at every point, a number of satisfied sets congruent to c modulo M; the gates of ofLowDegree are one.