← All papers
First page of Lattice Trapezoids of Prime Gaps: Minimal Interior Counts and Empirical Statistics

Lattice Trapezoids of Prime Gaps: Minimal Interior Counts and Empirical Statistics

Rafael A. Gonzalez Castillo

math.NT Nov 25, 2026 · v1
Lean 4 with Mathlib formalizes the area bounds, minimal interior-count classification, telescoping boundary sum, and a direct lattice-point count of trapezoid interiors.
Let $p_n$ denote the $n$-th prime and $g_n = p_{n+1} - p_n$. Mapping consecutive primes to $z_n = p_n + ip_{n+1} \in \mathbb{Z}[i]$ defines, for each $n \ge 1$, a convex lattice quadrilateral $Q_n \subset \mathbb{R}^2$ whose vertices lie in $\mathbb{Z}^2$ with area $ΔA_n = \frac{1}{2} g_n(g_n + g_{n+1})$. We prove two-sided bounds relating $\sum_{n=1}^{N} ΔA_n$ to the second moment $\sum_{n=1}^{N} g_n^2$, express the boundary and interior lattice-point counts $B_n$ and $I_n$ of $Q_n$ in terms of $(g_n, g_{n+1})$, and classify all minimal values of $I_n$. In particular, for $n \ge 3$ one has $I_n \ge 2$, with equality if and only if $(p_n, p_{n+1}, p_{n+2})$ is a prime triple $(p, p+2, p+6)$. We also prove a telescoping identity for $\sum_{n=1}^{N} B_n$ implying $\lim_{N\to\infty} \sum_{n=1}^{N} I_n / \sum_{n=1}^{N} ΔA_n = 1$ at rate $O(1/\ln N)$ using only Chebyshev's bound and Bertrand's postulate. Numerically, for all primes below $3\times 10^{10}$ ($1.3\times 10^{9}$ primes) we compare the distribution of $\gcd(g_n, g_{n+1})$ and the sign of the discrete convexity $K_n = \frac{1}{2}(g_n g_{n+2} - g_{n+1}^2)$ with a local-scale windowed empirical-marginal null. The residual adjacency shifts decrease monotonically in magnitude across six disjoint intervals from $10^5$ to $2\times 10^{10}$. A one-parameter $c/\ln x$ decay is adequate only for the $K_n > 0$ shift and is rejected for the other three; two-parameter forms fit all four, but the data cannot determine the asymptotic rate. The algebraic bounds, minimal-count classifications, telescoping boundary sum, and direct discrete interior-point formula are verified in Lean 4.

Mapping consecutive primes to Gaussian integers p_n + i p_{n+1} defines convex lattice quadrilaterals whose areas depend on adjacent prime gaps. The paper studies their area, boundary and interior lattice-point counts, and the empirical statistics of adjacent gaps.

The author proves two-sided bounds relating the summed trapezoid areas to the second moment of prime gaps, derives boundary and interior counts from Pick's theorem, and classifies the minimal interior counts. A telescoping identity for the boundary sum yields an interior-to-area ratio tending to 1 at rate O(1/ln N), using only Chebyshev's bound and Bertrand's postulate. The finite and algebraic results are formalized in Lean 4 with Mathlib. The interior count is verified directly by vertical slicing and Gauss pairing, without formalizing Pick's theorem. Numerical statistics on gcd and discrete convexity are computed for primes below 3×10^10.

For n ≥ 3, I_n ≥ 2, with equality exactly at prime triples (p, p+2, p+6). The interior-to-area ratio rises to 0.9366 at 2×10^8. The adjacency shifts decrease monotonically across six intervals, but a one-parameter c/ln x decay fits only the K_n > 0 shift. All formal theorems check in the Lean kernel with no sorry.

xNΣI/ΣΔAΣ(B/2)/ΣΔA
10^41,2290.8462790.165865
10^678,4980.9069000.097798
10^85,761,4550.9338370.068618
2×10^811,078,9350.9366330.065628
Convergence of the interior-to-area ratio for prime trapezoids