Smolensky's gate approximators #
Over a commutative ring R of prime characteristic p, such as ZMod p or the fields of order
p ^ k in which Smolensky works [Smo87], every gate of the AC⁰[p] basis has a polynomial
approximator that multiplies degrees by at most (p - 1) ℓ:
MOD_pof bitsu₁, …, u_mis exactly(∑ uᵢ) ^ (p - 1), since the sum is the image of the count in the prime fieldZMod p, where nonzero elements have(p - 1)-st power1(natCast_pow_eq_bitVal,modApprox);- OR of
u₁, …, u_mis approximated by1 - ∏_{j < ℓ} (1 - (∑_{i ∈ T j} uᵢ) ^ (p - 1))for a tupleTofℓsets of arguments (orApprox), and AND is its De Morgan dual; - negation is exactly
1 - u.
For a nonzero Boolean vector, adding or removing a true coordinate changes the count of a set by
one, so at most half of the sets have a count divisible by p, and at most a 2 ^ (-ℓ) fraction of
the tuples err (card_orApprox_wrong_mul_le). Double counting over the inputs gives, for every
gate and every way its arguments depend on the input, an approximator that errs on at most
2 ^ n / 2 ^ ℓ inputs (exists_gate_approx) [Raz87], [Smo87],
Jukna, Chapter 12.
Main definitions #
Cslib.Circuits.Boolean.Smolensky.orApprox,Cslib.Circuits.Boolean.Smolensky.andApprox: the approximators of OR and AND for a tuple of sets of arguments.Cslib.Circuits.Boolean.Smolensky.modApprox: theMOD_ppolynomial.
Main results #
Cslib.Circuits.Boolean.Smolensky.natCast_pow_eq_bitVal: Fermat's little theorem for counts in characteristicp.Cslib.Circuits.Boolean.Smolensky.exists_gate_approx: the gate approximators.
References #
Sums of bits #
If some coordinate is true, at most half of the sets have a sum of bits equal to zero.
Exactness in characteristic p #
The (p - 1)-st power of a count is whether the count is not divisible by p: in
characteristic p the count is the image of its residue in ZMod p, where Fermat's little
theorem applies.
Counting erring tuples #
At most a 2 ^ (-ℓ) fraction of the tuples make the OR approximator err on a fixed Boolean
vector.
Averaging over the inputs. For arguments u x depending on the input, some tuple makes the
OR approximator err on at most 2 ^ n / 2 ^ ℓ inputs.
Gate approximators. Over a commutative ring R of characteristic p, for every operation
of the AC⁰[p] basis and every way u its arguments depend on the input, some approximator
multiplies degrees by at most (p - 1) ℓ and errs on at most 2 ^ n / 2 ^ ℓ inputs.