Modular counts and prime selection for integer Exact Triangle #
A minimum-count prime in [sqrt D / 2, sqrt D) also minimises false positives. For weights
bounded by n^κ, with 16 ≤ D ≤ n and 1 ≤ κ, a universal constant bounds its false positives
by C * κ * n^3 * log n / sqrt D. The prime count used here is proved for every admitted D.
Main definitions #
countZeroMod,falsePositiveCount,zeroCount: counts of finite triples.IsSelectedPrime: a minimum-count prime in the specified window.matP,matQ: cyclic polynomial matrices encoding edge residues.
Main results #
countZeroMod_eq: modular count is the sum of false positives and true zeros.coeff_matP_mul_matQ,falsePositiveCount_add_zeroCount_eq_sum_coeff: coefficient identities.exists_isSelectedPrime: the minimum exists.falsePositiveCount_le_const_mul: the uniform false-positive bound.
This is a mathematical reduction step. No native program or charged running-time bound is
asserted. The supplied three matrices retain the existing HasZeroTriangle semantics.
References #
The modular reduction is part of [AlmanWilliams2026, Section 3].
Direct adaptation of Anthropic's
Hashing.lean,
with the minimal count/selection definitions extracted from its PaperStatements.lean.
The declaration docstrings describe the Lean definitions and statements in local notation.
The source pin is
anthropics/formal-math@16a5ce41304fcdaea4e0be7c132e1c361dc26da5.
A prime in Nat.sqrtPrimeWindow D whose modular-zero count is minimal among all primes in that
window. Tied minima all satisfy this predicate.
Instances For
Counting triples with a vanishing modular weight sum #
Count vertex triples satisfying IsFalsePositive for the supplied three weight matrices and
modulus.
Instances For
The zero-triple count is positive exactly when the supplied matrices satisfy
HasZeroTriangle.
For a nonzero modulus and a residue r < p, the coefficient of degree r in the cyclic
matrix product counts middle vertices whose two incident weights sum to r modulo p.
Selecting the prime #
For every D ≥ 16 and every three supplied weight matrices, the prime window contains a
minimum of the modular-zero count.
A selected minimum of the modular-zero count also minimizes the false-positive count over the same prime window.
The bound on the number of false positives of the selected prime #
For a fixed nonzero-sum triple and edge weights bounded by n^κ, bound the number of window
primes accepting that triple by the base-sqrt D / 2 logarithm of 3*n^κ.
Sum the per-triple prime-divisibility bound over all n^3 triples. For D ≥ 16, κ ≥ 1 and
edge weights bounded by n^κ, the sum of false-positive counts is at most n^3 * logb (sqrt D / 2) (3*n^κ).
Multiply the selected prime’s minimum false-positive count by the number of window primes to obtain a bound by the sum of their false-positive counts.
For 16 ≤ D ≤ n, κ ≥ 1 and edge weights bounded by n^κ, a positive pointwise prime-count
lower bound c * sqrt D / log D gives every selected prime at most (4/c) * n^3 * log (3*n^κ) / sqrt D false positives.
There is a universal C ≥ 1 such that, for 16 ≤ D ≤ n, κ ≥ 1 and edge weights bounded by
n^κ, every selected prime has at most C * κ * n^3 * log n / sqrt D false positives.
A universal real constant witnessing exists_falsePositiveCount_le. It depends on none of the
input dimensions, weight matrices, exponent or selected prime, and is at least one.
Instances For
The universal false-positive constant falsePositiveConst is at least one.
For 16 ≤ D ≤ n, κ ≥ 1 and edge weights bounded by n^κ, bound every selected prime’s
false-positive count by falsePositiveConst * κ * n^3 * log n / sqrt D.