Documentation

CslibFrontier.Computability.Circuit.Arithmetic.Synthesis

Synthesis over the arithmetic basis #

Constants, sums and products can be synthesized over an arithmetic signature without importing polynomial families, degree bounds or projections. The constant symbols have arbitrary type K and are interpreted in a carrier R by a supplied map. The primitive rules need only addition and multiplication on R; the finite-sum rule needs an additive commutative monoid. There is no semiring assumption on K.

The declarations retain their names, statements and proofs from the VP module. VP publicly imports this module, while value-level clients can import it directly.

Main results #

theorem Cslib.Circuits.Synthesis.arith_const {K : Type u} {n : ℕ} {R : Type u_1} {constant : K → R} {s : Set ((Fin n → R) → R)} [Add R] [Mul R] (a : K) :
Synthesis (arithInterpretationWith K constant) s {fun (x : Fin n → R) => constant a} 1

A constant costs one gate.

theorem Cslib.Circuits.Synthesis.arith_add {K : Type u} {n : ℕ} {R : Type u_1} {constant : K → R} {s : Set ((Fin n → R) → R)} {f g : (Fin n → R) → R} [Add R] [Mul R] (hf : f ∈ s) (hg : g ∈ s) :
Synthesis (arithInterpretationWith K constant) s {fun (x : Fin n → R) => f x + g x} 1

The sum of two available functions costs one gate.

theorem Cslib.Circuits.Synthesis.arith_mul {K : Type u} {n : ℕ} {R : Type u_1} {constant : K → R} {s : Set ((Fin n → R) → R)} {f g : (Fin n → R) → R} [Add R] [Mul R] (hf : f ∈ s) (hg : g ∈ s) :
Synthesis (arithInterpretationWith K constant) s {fun (x : Fin n → R) => f x * g x} 1

The product of two available functions costs one gate.

theorem Cslib.Circuits.Synthesis.arith_sum {K : Type u} {n : ℕ} {R : Type u_1} {constant : K → R} {s : Set ((Fin n → R) → R)} {ι : Type u_2} [AddCommMonoid R] [Mul R] (indices : Finset ι) (summand : ι → (Fin n → R) → R) (cost : ι → ℕ) (hzero : (fun (x : Fin n → R) => 0) ∈ s) (h : ∀ i ∈ indices, Synthesis (arithInterpretationWith K constant) s {summand i} (cost i)) :
Synthesis (arithInterpretationWith K constant) s {fun (x : Fin n → R) => ∑ i ∈ indices, summand i x} (∑ i ∈ indices, (cost i + 1))

A finite sum costs its summands and one addition each, when zero is available.