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 #
Cslib.Circuits.Boolean.exists_ring_simulation: all-output simulation with gate-size factor five over any ring, using the zero/one representation.
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.