Documentation

CslibFrontier.Computability.Circuit.Boolean.SymAnd

SYM ∘ AND circuits #

A depth-two SYM ∘ AND circuit on inputs ι (Circuits.Boolean.SymAnd) is a finite multiset of AND gates, each given by the finite set of input positions it reads, below one symmetric gate out : ℕ → Bool applied to the number of satisfied AND gates, counted with multiplicity. This is the target model of the Yao and Beigel–Tarui simulation of ACC⁰ [BeigelTarui1994, Theorem 1.1] (their SYM⁺ circuits) and the representation consumed by Williams's ACC satisfiability algorithm [Wil14]. The AND gates read positive literals only; negations are absorbed by the polynomial constructions that produce such circuits.

The size of a circuit is the number of AND gates (SymAnd.size) and its fan-in is the largest AND fan-in (SymAnd.fanIn). Read in a commutative ring, the number of satisfied AND gates is a sum of monomials (SymAnd.natCast_count_eq_sum). The converse, an integer-valued function of degree at most D as an AND count modulo M, is the canonical circuit SymAnd.ofLowDegree of CslibFrontier.Computability.Circuit.Boolean.SymAnd.Mobius.

Main definitions #

Main results #

References #

structure Cslib.Circuits.Boolean.SymAnd (ι : Type u_1) :
Type u_1

A depth-two SYM ∘ AND circuit on inputs ι: a multiset of AND gates, each reading the positive literals of a finite set of positions, below a symmetric output gate out, which sees only the number of satisfied AND gates.

  • gates : Multiset (Finset ι)

    The AND gates, as the sets of positions they read, with multiplicity.

  • out : ℕ → Bool

    The symmetric output gate, applied to the number of satisfied AND gates.

def Cslib.Circuits.Boolean.SymAnd.count {ι : Type u_1} (C : SymAnd ι) (x : ι → Bool) :

The number of AND gates of C satisfied by x, counted with multiplicity.

def Cslib.Circuits.Boolean.SymAnd.eval {ι : Type u_1} (C : SymAnd ι) (x : ι → Bool) :

The output of C on x: the symmetric gate applied to the number of satisfied AND gates.

The size of C: its number of AND gates, counted with multiplicity.

The fan-in of C: the largest fan-in of its AND gates (0 without gates).

theorem Cslib.Circuits.Boolean.SymAnd.fanIn_le_iff {ι : Type u_1} {C : SymAnd ι} {f : ℕ} :
C.fanIn ≤ f ↔ ∀ S ∈ C.gates, S.card ≤ f

The fan-in is at most f exactly when every AND gate reads at most f positions.

theorem Cslib.Circuits.Boolean.SymAnd.card_le_fanIn {ι : Type u_1} {C : SymAnd ι} {S : Finset ι} (hS : S ∈ C.gates) :

Every AND gate reads at most C.fanIn positions.

theorem Cslib.Circuits.Boolean.SymAnd.count_le_size {ι : Type u_1} (C : SymAnd ι) (x : ι → Bool) :
C.count x ≤ C.size

At most all the AND gates are satisfied.

theorem Cslib.Circuits.Boolean.SymAnd.natCast_countP_eq_sum {ι : Type u_1} {R : Type u_2} [CommRing R] (G : Multiset (Finset ι)) (x : ι → Bool) :
↑(Multiset.countP (fun (S : Finset ι) => ∀ i ∈ S, x i = true) G) = (Multiset.map (fun (S : Finset ι) => BitString.monomial R S x) G).sum

Read in a commutative ring, the number of sets in G all of whose positions are true at x is the sum of their monomials at x.

theorem Cslib.Circuits.Boolean.SymAnd.natCast_count_eq_sum {ι : Type u_1} {R : Type u_2} [CommRing R] (C : SymAnd ι) (x : ι → Bool) :
↑(C.count x) = (Multiset.map (fun (S : Finset ι) => BitString.monomial R S x) C.gates).sum

Read in a commutative ring, the number of satisfied AND gates is the sum of the monomials of the gates.

def Cslib.Circuits.Boolean.SymAnd.slot {ι : Type u_1} (t : ι) :

The SYM ∘ AND circuit reading the single input t: one AND gate {t} and the output "at least one satisfied gate".

@[simp]
theorem Cslib.Circuits.Boolean.SymAnd.eval_slot {ι : Type u_1} (t : ι) (x : ι → Bool) :
(slot t).eval x = x t

The circuit slot t outputs the input bit at t.

@[simp]
theorem Cslib.Circuits.Boolean.SymAnd.size_slot {ι : Type u_1} (t : ι) :
(slot t).size = 1

The circuit slot t has one AND gate.

@[simp]
theorem Cslib.Circuits.Boolean.SymAnd.fanIn_slot {ι : Type u_1} (t : ι) :
(slot t).fanIn = 1

The circuit slot t has fan-in one.