Uniform modular evaluation of finite pure-power residues #
The evaluator sums coefficients of the geometric-series numerators over short base-addresses.
A degree mask removes the noncontributing indices before coefficient extraction. Unary arity
and binary modulus, degree and exponents keep each address polynomial in the encoded input;
the number of summands may be exponential. Uniform numerator and relation evaluators in
CountingFunction a give a residue evaluator in CountingFunction (a + 5).
Correctness identifies this constructed evaluator with the actual finite residue over
ZMod p when the source degree and prime bounds hold. No residue oracle is assumed.
Ported and simplified from LeanCanny.CountingHierarchy.ResidueEvaluation and
ResidueEnumeration at lean-canny commit 970f28a5ecefc1327402ade16c068aa4b1b2c183.
Critical-system evaluation and the full real-counting endpoints remain
#6560.
Shifting every binary geometric-series index preserves polynomial-time access.
Constructing the residue from uniform modular numerator and relation evaluations costs five function levels, independently of arity and degree.
The constructed evaluator computes the actual residue, using only canonical finite-field evaluation points and bounded base-address indices.