Shared coordinate transforms in flat arrays #
After j coordinates have been transformed, the array has 10^j * 7^k entries, where
j + k = L. Its entry at (p, r) sums the input entries with suffix r, weighting their
prefixes by the product of the selected coefficients. The next coordinate transform computes
each new entry from seven entries of this shared array. It does not independently enumerate
all input entries for every final leaf.
Main definitions #
CoordinateTransform.weight: product of coefficients along the transformed prefix.CoordinateTransform.value: prefix expansion at a mixed-radix array position.
Main results #
CoordinateTransform.value_step: the seven-to-ten shared coordinate update.CoordinateTransform.stageSize_le: every stage has at most10^Lentries.
References #
An iterative implementation invariant for [AlmanWilliams2026, Section 2.4.1]. The coefficients
are those of the existing encoding API, adapted from Anthropic, PBC's formal source at
16a5ce41304fcdaea4e0be7c132e1c361dc26da5. This module defines mathematical arrays and sums,
not a separate machine or an instruction-counting semantics.
Product of j coefficients, reading prefix digits from least significant to most
significant. Values at noncanonical indices are harmless; clients use indices below the powers.
Instances For
Input bounds suffice for every shared intermediate value, including all depths and all prefixes. Only the original input segment is used in this estimate.
Flat prefix weights are exactly the product of the original coordinate coefficients.
finFunctionFinEquiv supplies the existing Mathlib digit numbering, least significant first.
At the final stage the flat transform is the tensor encoding sum on digit strings. The input array is supplied explicitly by its values at Mathlib's numbered string positions.
Even charging every one of the L stages at the maximum array size gives only
L * 10^L cells. This is a combinatorial bound; native loop and arithmetic costs are separate.