Boolean circuits for binary field polynomials #
In the power basis of the explicit degree-n binary field, form the coefficients of the
ordinary polynomial product and then apply the fixed linear reduction modulo the defining
polynomial. Grouping the products of input bits by degree makes both stages quadratic in n.
Horner evaluation reuses this multiplier once per coefficient.
theorem Cslib.Circuits.Boolean.synthesis_binaryFieldMul {n a : ℕ} (hn : n ≠ 0) (s : Set (BooleanFunction a)) (x y : BitString a → BinaryField n) (hx : ∀ (i : Fin n), (fun (z : BitString a) => (BinaryField.equivBits hn) (x z) i) ∈ s) (hy : ∀ (i : Fin n), (fun (z : BitString a) => (BinaryField.equivBits hn) (y z) i) ∈ s) :
Multiply two available field elements in power-basis coordinates, sharing the unreduced product coefficients across all output bits. The De Morgan gate count includes constants.
theorem Cslib.Circuits.Boolean.exists_binaryFieldPolynomial_circuit {n : ℕ} (hn : n ≠ 0) {k : ℕ} (coeff : Fin k → BinaryField n) :
∃ (q : Circuit signature n n),
(q.Computes interpretation fun (z : Fin n → Bool) =>
(BinaryField.equivBits hn) (Probability.polynomialHash coeff ((BinaryField.equivBits hn).symm z))) ∧ q.size ≤ n + k * (13 * n ^ 2 + 8 * n)
A fixed vector of k field coefficients gives an n-input, n-output circuit for the
corresponding polynomial. Only the input point varies when this circuit is evaluated.