Documentation

CslibFrontier.Computability.Circuit.Arithmetic.SyntacticMultilinear

Syntactically multilinear arithmetic circuits #

An arithmetic program is syntactically multilinear when the two arguments of every multiplication are reached by disjoint sets of inputs (Cslib.Circuits.Program.IsDecomposableAt for ArithOp.mul). The polynomial computed at each wire then involves only the inputs that reach it and has degree at most one in each of them.

The statement allows the inputs to be specialized: evaluate the program on polynomials ρ i, where each ρ i is multilinear in its own set V i of variables and the sets are pairwise disjoint. Taking ρ i = X i gives the polynomial computed by the program, and taking some ρ i to be constants restricts it to the remaining inputs. The polynomial at a wire w then involves only the variables V i of the inputs i reaching w and is multilinear (Cslib.Circuits.Program.vars_trace_subset_and_mem_restrictDegree). So a syntactically multilinear program computes the multilinear extension of the function it computes on the Boolean cube (Cslib.Circuits.Program.trace_eq_multilinearExtension).

A circuit over a commutative ring K computes the multilinear representative of a Boolean function f when the polynomial at its output is the multilinear extension of f, with values 0 and 1 in K (Cslib.Circuits.Circuit.ComputesMultilinear). Lower bounds for syntactically multilinear circuits are stated in this model. Syntactically multilinear circuits simulate deterministic decomposable circuits and read-once parity branching programs with linear overhead, so such lower bounds transfer to both models (Cslib.Circuits.Circuit.IsDeterministicDecomposable.exists_syntacticallyMultilinear, Cslib.BranchingPrograms.NBP.exists_syntacticallyMultilinear).

Main results #

Main definitions #

theorem Cslib.Circuits.Program.vars_trace_subset_and_mem_restrictDegree {F : Type u} {n g : ℕ} {τ : Type u_1} {K : Type u_2} [CommSemiring K] [DecidableEq τ] (p : Program (arithSignature F) n g) (hp : p.IsDecomposableAt fun (x : (arithSignature F).Op) => x = ArithOp.mul) (φ : F → K) (ρ : Fin n → MvPolynomial τ K) (V : Fin n → Finset τ) (hV : Pairwise fun (i j : Fin n) => Disjoint (V i) (V j)) (hvars : ∀ (i : Fin n), (ρ i).vars ⊆ V i) (hdeg : ∀ (i : Fin n), ρ i ∈ MvPolynomial.restrictDegree τ K 1) (w : Wire n g) :

Syntactic multilinearity gives multilinear polynomials. Evaluate a syntactically multilinear program on polynomials ρ i, each multilinear in its own set V i of variables, the sets being pairwise disjoint, and interpret each constant c as C (φ c). The polynomial at a wire w involves only the variables V i of the inputs i that reach w, and it has degree at most one in each variable.

theorem Cslib.Circuits.Program.trace_mem_restrictDegree {F : Type u} {n g : ℕ} {τ : Type u_1} {K : Type u_2} [CommSemiring K] (p : Program (arithSignature F) n g) (hp : p.IsDecomposableAt fun (x : (arithSignature F).Op) => x = ArithOp.mul) (φ : F → K) (ρ : Fin n → MvPolynomial τ K) (V : Fin n → Finset τ) (hV : Pairwise fun (i j : Fin n) => Disjoint (V i) (V j)) (hvars : ∀ (i : Fin n), (ρ i).vars ⊆ V i) (hdeg : ∀ (i : Fin n), ρ i ∈ MvPolynomial.restrictDegree τ K 1) (w : Wire n g) :

A syntactically multilinear program, evaluated on multilinear polynomials in pairwise disjoint sets of variables, computes multilinear polynomials.

theorem Cslib.Circuits.Program.eval_trace {F : Type u} {n g : ℕ} {τ : Type u_3} {K : Type u_4} [CommSemiring K] (p : Program (arithSignature F) n g) (φ : F → K) (ρ : Fin n → MvPolynomial τ K) (z : τ → K) (w : Wire n g) :

Evaluating the polynomial at a wire on specialized inputs evaluates the program at the evaluated inputs.

A syntactically multilinear program computes multilinear extensions. The polynomial at a wire is the multilinear extension of the values of the wire at the points of the Boolean cube.

Circuits computing multilinear representatives #

@[reducible, inline]

An arithmetic circuit is syntactically multilinear when the two arguments of every multiplication are reached by disjoint sets of inputs.

theorem Cslib.Circuits.Circuit.eval_eval {F : Type u} {n m : ℕ} {τ : Type u_3} {K : Type u_4} [CommSemiring K] (c : Circuit (arithSignature F) n m) (φ : F → K) (ρ : Fin n → MvPolynomial τ K) (z : τ → K) (j : Fin m) :
(MvPolynomial.eval z) (c.eval (arithInterpretationWith F (⇑MvPolynomial.C ∘ φ)) ρ j) = c.eval (arithInterpretationWith F φ) (fun (i : Fin n) => (MvPolynomial.eval z) (ρ i)) j

Evaluating the polynomial computed by an arithmetic circuit on specialized inputs evaluates the circuit on the evaluated inputs. With ρ = X this is Cslib.Circuits.Circuit.eval_arithInterpretationWith_mvPolynomial.

def Cslib.Circuits.Circuit.ComputesMultilinear {n : ℕ} {K : Type u_3} [CommRing K] (c : Circuit (arithSignature K) n 1) (f : (Fin n → Bool) → Bool) :

An arithmetic circuit over K computes the multilinear representative of the Boolean function f when the polynomial at its output is the multilinear extension of f, with values 0 and 1 in K.

A circuit computing the multilinear representative of f computes f on the Boolean cube.

Syntactically multilinear circuits compute multilinear representatives. A syntactically multilinear circuit computes the multilinear representative of f exactly when it computes f on the Boolean cube.

Multiplying a circuit by a constant #

def Cslib.Circuits.Circuit.mulConst {n : ℕ} {R : Type u_4} (c : Circuit (arithSignature R) n 1) (s : R) :

The arithmetic circuit c followed by a multiplication of its output by the constant s.

theorem Cslib.Circuits.Circuit.size_mulConst {n : ℕ} {R : Type u_4} (c : Circuit (arithSignature R) n 1) (s : R) :
(c.mulConst s).size = c.size + 2

Multiplying by a constant adds two gates.

theorem Cslib.Circuits.Circuit.eval_mulConst {n : ℕ} {R : Type u_4} (c : Circuit (arithSignature R) n 1) (s : R) {A : Type u_5} [CommRing A] (φ : R → A) (x : Fin n → A) :

Multiplying by a constant multiplies the output, for every interpretation φ of the constants.

Multiplying a syntactically multilinear circuit by a constant keeps it syntactically multilinear.