Documentation

CslibFrontier.Computability.Circuit.Probabilistic

Decomposable probabilistic circuits #

A probabilistic circuit over Boolean variables is a circuit whose input units compute functions of one variable, and whose other units compute products of their children or weighted sums of their children. It is decomposable when the children of every product reach disjoint sets of variables. The manuscript of #8623 allows weights and input functions of either sign Anonymous, Section 10.2.

Here a probabilistic circuit over a commutative ring R is a circuit over Cslib.Circuits.Probabilistic.signature R, with three kinds of units:

Products and weighted sums of larger fan-in are trees of binary units, so a circuit with s edges has at most s units. In the manuscript the leaves read input variables; here a leaf may read any wire, which only strengthens the simulation. The circuit computes a function on the Boolean cube (Cslib.Circuits.Probabilistic.interpretation at the Boolean points).

Each unit is computed by a small arithmetic circuit, with at most five gates (Cslib.Circuits.Probabilistic.toArith). Decomposable products become syntactically multilinear multiplications, so syntactically multilinear circuits simulate decomposable probabilistic circuits with linear overhead. A decomposable probabilistic circuit computing a nonzero multiple of a Boolean function on the cube, over a field, gives a syntactically multilinear circuit computing its multilinear representative (Cslib.Circuits.Probabilistic.exists_syntacticallyMultilinear), as in the proof of Corollary 5 of the manuscript.

Main definitions #

Main results #

References #

The model #

The units of a probabilistic circuit over R: a leaf reading one wire with values given by a function Bool → R, a product of two wires, and a weighted sum of two wires.

  • leaf {R : Type u} (g : Bool → R) : Op R

    A leaf: the affine function of its wire with values g false and g true at 0 and 1.

  • mul {R : Type u} : Op R

    A product of two wires.

  • sum {R : Type u} (a b : R) : Op R

    A weighted sum a * u + b * v of two wires.

@[instance_reducible]

Whether a unit is a product is decidable, so decomposability is decidable.

@[reducible, inline]

A leaf reads one wire; products and weighted sums read two.

@[reducible, inline]

The probabilistic signature: leaves, products and weighted sums.

The values of the units in an R-algebra: a leaf g computes g false * (1 - z) + g true * z, a product multiplies and a weighted sum adds with weights.

@[simp]
theorem Cslib.Circuits.Probabilistic.interpretationIn_leaf {R : Type u} [CommRing R] (A : Type u_1) [CommRing A] [Algebra R A] (g : Bool → R) (x : Fin 1 → A) :
interpretationIn A (Op.leaf g) x = (algebraMap R A) (g false) * (1 - x 0) + (algebraMap R A) (g true) * x 0
@[simp]
theorem Cslib.Circuits.Probabilistic.interpretationIn_mul {R : Type u} [CommRing R] (A : Type u_1) [CommRing A] [Algebra R A] (x : Fin 2 → A) :
@[simp]
theorem Cslib.Circuits.Probabilistic.interpretationIn_sum {R : Type u} [CommRing R] (A : Type u_1) [CommRing A] [Algebra R A] (a b : R) (x : Fin 2 → A) :
interpretationIn A (Op.sum a b) x = (algebraMap R A) a * x 0 + (algebraMap R A) b * x 1
@[reducible, inline]

The values of the units in R. On the Boolean points of R, a probabilistic circuit computes its function on the cube.

A leaf at a Boolean point takes the value of its function.

The arithmetic circuit #

Simulation by syntactically multilinear circuits #

The arithmetic circuit of a probabilistic circuit: every unit replaced by its arithmetic circuit.

theorem Cslib.Circuits.Probabilistic.size_toArith_le {n : ℕ} {R : Type u} [CommRing R] {m : ℕ} (c : Circuit (signature R) n m) :
(toArith R c).size ≤ 5 * c.size

The arithmetic circuit has at most five gates for each unit.

The arithmetic circuit of a decomposable probabilistic circuit is syntactically multilinear: its multiplications come from decomposable products and from multiplications by constants.

A decomposable probabilistic circuit computes the multilinear extension of its function. The polynomial computed by its arithmetic circuit at each output is the multilinear extension of the function the probabilistic circuit computes on the cube.

theorem Cslib.Circuits.Probabilistic.exists_syntacticallyMultilinear {n : ℕ} {K : Type u} [Field K] {c : Circuit (signature K) n 1} (hc : c.program.IsDecomposableAt fun (x : (signature K).Op) => x = Op.mul) {f : (Fin n → Bool) → Bool} {k : K} (hk : k ≠ 0) (hf : ∀ (x : Fin n → Bool), c.eval (interpretation K) (BitString.bitPoint x) 0 = k * BitString.bitVal K (f x)) :

Syntactically multilinear circuits simulate decomposable probabilistic circuits. Over a field, if a decomposable probabilistic circuit with s units computes on the cube a nonzero multiple k of a Boolean function, then the function has a syntactically multilinear circuit with at most 5 s + 2 gates computing its multilinear representative. This is the reduction in the proof of Corollary 5 of the manuscript Anonymous, Section 10.2.