Counter evaluation of a packed gate extension #
The grid is numbered by its base-s digits. A coordinate counter multiplies modular Lagrange
weights; an assignment counter sums the weighted table entries. Neither loop constructs a list
of assignments or a truth table. The caller supplies the table entry at one assignment index.
Main definitions #
Cslib.TreeEval.Ary.Packed.gridWeight: the product of basis weights for one assignment.Cslib.TreeEval.Ary.Packed.interpolateGrid: sum the weighted entries using a counter.
Main results #
Cslib.TreeEval.Ary.Packed.cast_interpolateGrid: agreement with the existing low-degree extension, including the empty coordinate tuple.
References #
- R. Williams, Simulating Time With Square-Root Space, Appendix A, equation (6). This is an executable prime-field realization of that interpolation formula.
This file proves functional correctness and accumulator bounds. The table supplier is an explicit parameter, without an assumed native resource bound. Its query implementation and the native certificate for the complete loop remain separate obligations.
One coordinate of the assignment index, in least-significant-first order.
The coordinate counter advances while the assignment is consumed one digit at a time.
Only division by s is computed at a step; no large power is materialized.
A positive modulus keeps every product accumulator reduced.
The streamed modular sum is exactly the finite-grid low-degree extension. The table is
indexed by Mathlib's existing base-s numbering of tuples; no additional gate model is used.