Documentation

CslibFrontier.Computability.Circuit.Boolean.NonlinearCost

Fourier bounds from the number of nonlinear gates #

nonlinearCost I charges one for a nonaffine Boolean operation and zero for an affine one. For a basis of fan-in at most two, this counts precisely the AND-type gates: XOR, negation, constants and projections are free. The count is syntactic; an AND gate reading the same wire twice still costs one. Circuit fanout and reuse of nonlinear intermediate values are unrestricted.

Every affine Boolean function has Fourier norm one, and every Boolean function on at most two bits has Fourier norm at most two. The joint workspace bound of SpectralNorm therefore gives Fourier norm at most 2 ^ m for an output of a circuit with nonlinear cost m. Every output Fourier coefficient is also an integer multiple of 2 ^ (-m). This denominator invariant can give lower bounds even when the Fourier norm is small; MajorityNonlinear applies it to majority.

Main definitions #

Main results #

Charge one for a nonaffine Boolean operation, and zero for an affine operation. For fan-in at most two this is the number of AND-type gates, with XOR and negation free.

@[simp]

Exactly the affine operations have zero nonlinear cost.

theorem Cslib.Circuits.Boolean.sum_abs_fourierCoeff_le_two_pow_nonlinearCost {σ : Signature} (I : Interpretation σ Bool) (op : σ.Op) (hArity : σ.Arity op ≤ 2) :
∑ S : Finset (Fin (σ.Arity op)), |BitString.fourierCoeff (fun (x : Fin (σ.Arity op) → Bool) => BitString.signVal (I op x)) S| ≤ 2 ^ nonlinearCost I op

The Fourier norm of a gate with fan-in at most two is bounded by its nonlinear cost.

theorem Cslib.Circuits.Circuit.sum_abs_fourierCoeff_signVal_eval_le_two_pow_nonlinearCost {σ : Signature} {n m : ℕ} (c : Circuit σ n m) (I : Interpretation σ Bool) (hArity : ∀ (op : σ.Op), σ.Arity op ≤ 2) (j : Fin m) :
∑ S : Finset (Fin n), |BitString.fourierCoeff (fun (x : Fin n → Bool) => BitString.signVal (c.eval I x j)) S| ≤ 2 ^ c.program.cost (Boolean.nonlinearCost I)

A circuit over any Boolean basis of fan-in at most two has output Fourier norm at most 2 ^ m, where m counts nonaffine gates. Affine gates and arbitrary wire reuse are free.

theorem Cslib.Circuits.Circuit.exists_fourierCoeff_signVal_eval_eq_intCast_div_two_pow_nonlinearCost {σ : Signature} {n m : ℕ} (c : Circuit σ n m) (I : Interpretation σ Bool) (hArity : ∀ (op : σ.Op), σ.Arity op ≤ 2) (j : Fin m) (S : Finset (Fin n)) :
∃ (z : ℤ), BitString.fourierCoeff (fun (x : Fin n → Bool) => BitString.signVal (c.eval I x j)) S = ↑z / 2 ^ c.program.cost (Boolean.nonlinearCost I)

Every Fourier coefficient of a circuit with m nonaffine binary gates is an integer multiple of 2 ^ (-m). Affine gates, fanout and arbitrary reuse are free.