Documentation

CslibFrontier.Computability.Circuit.Boolean.ArithmeticRing

Boolean circuits as arithmetic circuits over any ring #

Boolean values are represented by the ring elements zero and one. AND is multiplication, NOT is 1 + (-1) * x, and OR is (x + y) + (-1) * (x * y). These expressions use only constant, addition and multiplication gates and work in every characteristic. Five arithmetic gates per Boolean gate suffice. All outputs agree on Boolean-valued inputs; no assertion about arbitrary ring-valued inputs is made. Constants count as gates and wires are free.

This is the Boolean-to-arithmetic direction of Arora–Barak, web draft 2007-01-08, Chapter 14 Exercise 1, printed p. 265/PDF p. 281. Rings need not be finite. The opposite direction requires a finite-carrier encoding. No formal polynomial equality or compiler-runtime bound is claimed.

Main results #

theorem Cslib.Circuits.Boolean.exists_ring_simulation {R : Type u_1} [Ring R] {n m : ℕ} (c : Circuit signature n m) :
∃ (d : Circuit (arithSignature R) n m), d.size ≤ 5 * c.size ∧ ∀ (x : Fin n → Bool), (d.eval (arithInterpretation R) fun (i : Fin n) => ↑(x i).toNat) = fun (j : Fin m) => ↑(c.eval interpretation x j).toNat

Every De Morgan circuit has an arithmetic simulation over any ring with at most five arithmetic gates per Boolean gate. Inputs and outputs represent false by zero and true by one. Correctness is on these represented inputs, rather than on arbitrary ring inputs.