Complete native cyclic-Strassen modular triangle counter #
One fixed 128-register standard WordRAM program counts the existing modular-zero triangles
from raw (n,p) headers and three canonical signed matrices. It computes residues, the
Morton table, padding and both cyclic-monomial matrices, executes the actual seven-product
recursion with an explicit stack, then reads and sums the selected coefficients. Its raw
count is register 70; caller arguments are registers 64 through 69. The callable variant takes
runtime matrix/workspace pointers and preserves original arrays and outside memory.
Main results #
exec: actual complete caller execution from original signed arrays, allowing dirty scratch.runs_input_subcubic: actual initialized prefix and charged halt, exact raw count and3704*(p+1)^2*(n+1)^2.81instruction bound.admissionWidth_le_log: ifp,A≤(n+2)^κ, physical width(κ+24)*clog₂(n+2)is sufficient and the original input fits.bounded_reachable_polynomial: every admitted wider prefix has words and memory support bounded by(n+2)^(κ+25), independently of the selected physical width.
The n exponent is subcubic and the runtime p factor remains explicit. This is the concrete counter prerequisite for prime selection, not prime enumeration/argmin, an aggregate ExactTriangle solver or the ordinary 3SUM exponent 1.9992 endpoint.
References #
Selectively adapts the algorithm in Programs/Sec3/Theorem17/Hashing/{CountPrime,RingOps, Strassen,StrassenTime,ZOrder,Count}.lean and its finite specification at Anthropic formal-math revision 16a5ce41304fcdaea4e0be7c132e1c361dc26da5. Credit is retained in adapted source modules. Native implementation, frames, fits, execution and instruction constants are independently proved against existing standard WordRAM APIs; no Light semantics or assumed machine simulation is imported.
One actual initialized finite native program, exact modular count and charged execution
within 3704*(p+1)^2*(n+1)^2.81 instructions: subcubic in n, with an explicit quadratic factor
in the modulus p. The prefix and halting result belong to the same state. All setup, ring
arithmetic, indexing, copying, recursion/control/return, scan and halt instructions are included.
The modulus and original-weight bound determine admission; no intermediate certificate is input.