The Cook–Mertz procedure for Tree Evaluation with fan-in d #
This generalizes the binary procedure Cslib.TreeEval.proc to fan-in d; at d = 2 it is that
procedure step for step (Cslib.TreeEval.Ary.proc_ofBinary, proved beside the binary procedure,
which derives its correctness from this file). The procedure keeps d + 1 registers, each
holding ℓ elements of a finite field K, as global storage shared by all levels of the
recursion. Called on a subtree, a coefficient c and a target register t, it adds c times the
value of the subtree (read as 0/1 field elements) to register t and leaves the other d
registers unchanged, whatever their contents.
The child j of a target t uses the register reg t j = t + (j + 1), so the d children use
exactly the registers other than t; for d = 2 these are the registers t + 1 and t + 2 of
the binary procedure. At an internal node with gate f, the procedure runs one round for every
unit u of K. A round scales the child registers by u, adds the children's values to them by
recursive calls, subtracts c times the multilinear extension of f at the masked values from
register t, and then undoes the recursive calls and the scaling. Summed over all units, the masks
cancel (FiniteField.sum_units_eval_mul_add), because the extension has degree at most
d * ℓ < |K| - 1, and register t has gained c • f (v₀, …, v_{d-1}).
This file proves correctness only; space bounds are separate.
Main definitions #
Cslib.TreeEval.embed: anℓ-bit value read as0/1field elements, for any fan-in.Cslib.TreeEval.Ary.reg: the register of a child.Cslib.TreeEval.Ary.gatePoly: the multilinear extension of an output bit of a gate.Cslib.TreeEval.Ary.proc: the procedure, parametrized by an enumeration of the units ofK.
Main results #
Cslib.TreeEval.Ary.proc_eq: the procedure addsctimes the value of the tree to the target register and leaves the other registers unchanged.Cslib.TreeEval.Ary.proc_zero: started from zero registers, it leaves the value of the tree in the target register.Cslib.TreeEval.Ary.embed_eval_eq_proc: the same, for the canonical enumeration of the units.
References #
- J. Cook and I. Mertz, Tree Evaluation is in Space O(log n · log log n),
Lemma 13 and Theorem 10, for fan-in
d. - O. Goldreich, On the Cook–Mertz Tree Evaluation procedure, Algorithm 1, whose signed recursive calls are followed here.
The global storage: d + 1 registers of ℓ field elements.
Instances For
One round of the procedure at a gate f, for the unit u, given procedures p j for the
subtrees. The target is t, and the child registers reg t j hold the masks.
Instances For
Correctness of the Cook–Mertz procedure for fan-in d. If us enumerates the units of
K without repetition and d * ℓ < |K| - 1, then the procedure adds c times the value of the
tree to the target register and leaves the other registers unchanged, whatever their initial
contents.
Started from zero registers, the procedure leaves the value of the tree in the target register.
Tree Evaluation with fan-in d by the Cook–Mertz procedure. Run over the units of K in
any order with d * ℓ < |K| - 1, from zero registers, the procedure computes the value of the
tree into the target register.