Residues and registers of the Tree Evaluation read machine #
The read machine computes with natural numbers below a prime p; this file relates them to
ZMod p. The residue operations cast to the field operations, and the register operations to
those of Cslib.TreeEval.Iter on the registers read as field elements. The weight of a table entry
casts to the value of the indicator polynomial of its inputs, so that the sums over the table give
the multilinear extension of a gate.
Main definitions #
Cslib.TreeEval.Reader.Regs.toState: the registers read inZMod p.Cslib.TreeEval.Reader.Regs.WF: registers of lengthℓholding residues belowp.
Main results #
Cslib.TreeEval.Reader.cast_weight: the weight casts to the product ofxor1 - xover the bits of the inputs.Cslib.TreeEval.Reader.eval_gatePoly_eq_sum: the multilinear extension of an output bit of a gate as a sum over the table indicesk < 4^ℓ.
References #
- J. Cook and I. Mertz, Tree Evaluation is in Space O(log n · log log n)
- O. Goldreich, On the Cook–Mertz Tree Evaluation procedure, Algorithm 1, which the machine runs.
Residues #
Registers #
The registers read as field elements: element i of register r, or 0.
Instances For
Registers of length ℓ holding residues below p.
Instances For
theorem Cslib.TreeEval.Reader.Regs.WF.scale {p ℓ : ℕ} (hp : 0 < p) {R : Regs} (hR : WF p ℓ R) (r : Fin 3) (a : ℕ) :
WF p ℓ (Regs.scale p r a R)
theorem Cslib.TreeEval.Reader.toState_set_modifyAt {p : ℕ} [Fact (Nat.Prime p)] {ℓ : ℕ} (R : Regs) (t : Fin 3) (i : Fin ℓ) (hlen : (R.get t).length = ℓ) (g : ℕ → ℕ) :
Regs.toState p ℓ (R.set t (modifyAt (R.get t) (↑i) g)) = Function.update (Regs.toState p ℓ R) t (Function.update (Regs.toState p ℓ R t) i ↑(g ((R.get t).getD (↑i) 0)))
theorem Cslib.TreeEval.Reader.toState_subtractSums {p : ℕ} [Fact (Nat.Prime p)] {ℓ : ℕ} (R : Regs) (c : ℕ) (t : Fin 3) (acc : List ℕ) (hlen : (R.get t).length = ℓ) :
Regs.toState p ℓ (subtractSums p c t acc R) = Function.update (Regs.toState p ℓ R) t fun (i : Fin ℓ) => Regs.toState p ℓ R t i - ↑c * ↑(acc.getD (↑i) 0)