Formally Verified Non-Asymptotic Elementary Number Theory Bounds in Lean 4.36.0 and Exact Rational Arithmetic
Corrected version of a screened paper. Not peer reviewed. Screening record
Upgrades ARR-2026-4TDCQEMJQ19GB8VE v1 to a standalone, zero-import, universally quantified Lean 4.36.0 mechanization (lean/ElementaryNumberTheoryCore.lean, 119/119 audited public theorems, 0 sorry, 0 warnings under -DwarningAsError=true, 0 custom axioms) paired with an AST-clean (0/0/0) stdlib-only exact-Z/Q Python verifier (src/verify_ent_v2.py, 4/4 pytest -W error).
Structure & key results
Manuscript structure
- Introduction, Version 2 Upgrade, and Prior Work
- Legendre Valuation, Erdos Primorial, and Chebyshev Bounds
- Elementary Rational Logarithm Brackets and Mertens's First Sandwich
- Möbius Inversion, Squarefree, and Totient Bounds
- Dirichlet Hyperbola Divisor Bound and Gauss Circle Enclosure
- Formal Verification in Lean 4.36.0 and Exact-Z/QZ/Q Audit
- Scope and Limitations
Selected results from the manuscript source
Theorem 1 — Legendre Valuation, Erdos Primorial, and Chebyshev Bounds
· (Exact Legendre Identity and Central-Binomial Prime-Power Bound.) For every integer n ≥ 1 and prime p, ν_p(n!) = ∑_(k=1)^(⌊ log_p n ⌋) ⌊ n/p^k ⌋ = (n - s_p(n))/(p - 1), and for the central binomial coefficient C(2n,n), ν_p(C(2n,n)) = ∑_(k=1)^(⌊ log_p(2n) ⌋)(⌊ 2n/p^k ⌋ - 2⌊ n/p^k ⌋) ∈ 0, 1, …, ⌊ log_p(2n) ⌋, p^(ν_p(C(2n,n))) ≤ 2n. · (Erdos Primorial Bound and ϑ-Ceiling.) For every integer n ≥ 1, n# < 4ⁿ; equivalently, for every real x ≥ 1, ϑ(x) < xln 4.
Lemma 2 — Elementary Rational Brackets for ln 2 and ln 3
The natural logarithms of 2 and 3 satisfy the exact rational inequalities 11/16 < 56/81 < ln 2 < 1123/1620 < 7/10, 1 < 263/240 < ln 3 < 923/840 < 11/10.
Theorem 3 — Explicit Non-Asymptotic Mertens First Theorem
For every integer n ≥ 1, define M₁(n):= ∑_(p ≤ n) (ln p)/p and C_pp:= ∑_(p ≥ 2) (ln p)/(p(p - 1)). Then C_pp < (ln 2)/2 + (ln 3)/6 + (5(1 + ln 4))/16 < 77/60 < 13/10, and for every integer n ≥ 1, ln n - (1 + C_pp) < M₁(n) < ln n + ln 4, in particular ln n - 23/10 < M₁(n) < ln n + ln 4.
Theorem 4 — Non-Asymptotic Squarefree and Totient Error Bounds
· (Möbius Identities and Half-Integer Tail.) For every integer n ≥ 1, ∑_(d | n) μ(d) = 1_(n=1), μ²(n) = ∑_(d² | n) μ(d), and φ(n) = ∑_(d | n) μ(d)(n/d). Moreover, for every integer D ≥ 1, ∑_(d = D + 1)^∞ 1/d² < 1/(D + 1/2). · (Universal Squarefree Error Bound via Algebraic Endpoint Factorization.) For every real x ≥ 1, Q(x) = ∑_(d ≤ √x) μ(d)⌊ x/d² ⌋, |Q(x) - 6/π² x| < 2√x. · (Universal Euler Totient Summatory Error Bound.) For every real x ≥ 1, Φ(x) = ∑_(d ≤ x) μ(d) (⌊ x/d ⌋(⌊ x/d ⌋ + 1))/2, |Φ(x) - 3/π² x²| < ½ xln x + 31/24 x.
Lemma 5 — Existence and Elementary Telescoping Bounds for γ
For each integer k ≥ 1, define a_k:= 1/k - ln(1 + 1/k). Then 0 < a_k < 1/k - 1/(k + 1), so γ:= ∑_(k=1)^∞ a_k converges in (0, 1) and equals lim_(m → ∞)(H_m - ln m). Moreover, for every integer m ≥ 1, the remainder r_m:= H_m - ln m - γ satisfies 0 < 1/(2m + 1) < r_m < 1/2m < 1/m, and in particular 3/10 < γ < 13/16.
Theorem 6 — Dirichlet Hyperbola and Gauss Circle Lattice Bounds
· (Dirichlet Hyperbola and Explicit 2√x + 4 Bound.) For every real x ≥ 1 with u:= ⌊ √x ⌋, D(x) = 2∑_(k=1)^u ⌊ x/k ⌋ - u², |D(x) - x(ln x + 2γ - 1)| < 2√x + 4. · (Gauss Circle Unit-Tile Enclosure.) For every real x ≥ 1, π(√x - 1/√2)² ≤ N₂(x) ≤ π(√x + 1/√2)², |N₂(x) - π x| ≤ π√2 √x + π/2.
Key contributions noted in exact-version screening
- Standalone zero-import Lean 4.36.0 formalization (lean/ElementaryNumberTheoryCore.lean) with 119 universally quantified public theorems, 0 sorry, 0 warnings under -DwarningAsError=true, and exclusively standard kernel axioms [propext, Classical.choice, Quot.sound] (no native_decide or Lean.ofReduceBool).
- Exact 1:1 alignment between Table 1/proof citations in paper.tex and the Lean identifiers, plus transparent delineation of the discrete/rational formalized core versus classical real-analytic corollaries in Section 7.
- Pure-stdlib, AST-enforced zero-float exact-Z/Q verifier (src/verify_ent_v2.py) enclosing ln 2, ln 3, pi, and gamma in certified Fraction intervals and executing 6,829 exact integer identity checks, 240 grid checks across [2, 20000], and 5 boundary checks at x=1 with byte-identical reproduction of data/verification_report.json.
Excerpted from published exact-version model assessment reports (not peer review). Full reports below →
Preview PDF on this page v2
Uses your browser's PDF viewer. Open the PDF directly if a preview is unavailable.
Full manuscript text in HTML (6,369 words — searchable plain text)
AIRR.SCIENCE · ARR-2026-4TDCQEMJQ19GB8VE v2 [Number Theory] · 2026-12-05
Formally Verified Non-Asymptotic Elementary Number Theory Bounds in Lean 4.36.0 and Exact Rational Arithmetic Lluis Eriksson Independent Researcher, Östersund, Sweden editor@airr.science
December 5, 2026
Abstract We present a self-contained, formally verified treatment of four classical non-asymptotic theorem families in elementary number theory, pairing a standalone zero-import Lean 4.36.0 formalization (lean/ElementaryNumberTheoryCore.lean, 119 universally quantified public theorems, zero sorry, zero warnings under -DwarningAsError=true, and zero custom axioms) with an archived pure-stdlib exact-Z/Q Python verification suite (src/verify_ ent_v2.py, zero floating-point P operations). First, we formalize Legendre’s exact p-adic factorial valuation νp (n!) = k≥1 ⌊n/pk ⌋ and base-p digit identity (p − 1)νp (n!) + sp (n) = n, 2n central-binomial prime-power ceilings pνp (( n )) ≤ 2n, Erdős’s 1932 primorial bound n# < 4n
for all n ≥ 1, and Chebyshev’s integer lower inequality 4m ≤ (2m + 1)(2m)π(2m) , yielding the √ ln 2 real-line Chebyshev envelope (x−2) < π(x) < 4lnlnx2 x + x for all x ≥ 2. Second, proving 2 ln x elementary rational brackets for ln 2 and ln 3P from first principles, we establish the nonasymptotic Mertens first sandwich ln n − 2.3 < p≤n lnpp < ln n + ln 4 for every integer n ≥ 1 without unproved numerical approximations. Third, P we formalize Möbius divisor cancellation, the exact squarefree counting identity Q(N ) = d≤√N µ(d)⌊N/d2 ⌋, a telescoping half-integer P tail bound d>D d−2 < (D + 12 )−1 , and an algebraic quadratic-endpoint √ inequality; invoking Euler’s Basel identity ζ(2) = π 2 /6 externally yields |Q(x) − π62 x| < 2 x and |Φ(x) − π32 x2 | < 31 1 2 x ln x + 24 x√ for all x ≥ 1. Fourth, we formalize Dirichlet’s exact hyperbola identity P⌊ n⌋ √ D(n) = 2 k=1 ⌊n/k⌋ − ⌊ n⌋2 and scaled-integer Cauchy–Schwarz √ unit-tile inclusions for the Gauss circle problem, proving |D(x) − x(ln x + 2γ − 1)| < 2 x + 4 (with of √ existence √ γ ∈ (0, 1) established via a positive telescoping series) and |N2 (x) − πx| ≤ π 2 x + π2 for all x ≥ 1. Tighter specialized constants exist in the analytic and computational literature (notably Rosser–Schoenfeld for prime sums and Moser–MacLeod for squarefree counts); our contribution is a compact, exception-free, machine-checked elementary core and zero-float audit bundle.
Introduction, Version 2 Upgrade, and Prior Work
Explicit non-asymptotic inequalities in elementary number theory—valid with fully proved constants across the entire half-line x ≥ 1 (or x ≥ 2) rather than merely for sufficiently large x—anchor both analytic number theory [1, 4] and certified algorithmic analysis. Four classical pillars form the core of this subject: Chebyshev’s prime-counting bounds via Erdős’s binomial induction [3], Mertens’s first theorem [5], Möbius-inversion summatory estimates for µ2 (n) and φ(n) [1], and the Dirichlet divisor hyperbola identity paired with Gauss’s lattice circle problem [4]. Sharper explicit constants are well known in the specialized literature: Rosser and SchoenP feld [7] obtain substantially tighter bounds for π(x), ϑ(x), and p≤x (ln p)/p via zero-free regions 1
of ζ(s) and finite prime computations, while Moser and MacLeod [6] and Cohen and Dress [2] sharpen the squarefree error term |Q(x) − π62 x| using finite numerical tables and analytic refinements. Our objective is complementary: a short, exception-free, table-free elementary presentation backed by a standalone formalization in Lean 4.36.0 and an archived zero-float verification bundle. Summary of Version 2 upgrades. Version 1 of this record contained no Lean 4 formalization and archived no executable verification code inside the record bundle; it also relied on several unproved decimal inequalities (for ln 2, ln 3, and γ) and a few compressed proof steps. Version 2 resolves every one of these gaps: 1. Standalone zero-import Lean 4.36.0 core. We archive the standalone file lean/Elementary NumberTheoryCore.lean (119 public theorems, 0 sorry, 0 warnings with strict compiler option -DwarningAsError=true), audited in data/lean_axioms_audit.txt to use only the standard kernel axioms [propext, Classical.choice, Quot.sound]. It proves universally over N, Z, and exact rationals Q (RatQ) the combinatorial, arithmetic, telescoping, and lattice-tiling cores of all four theorem families. 2. Archived zero-float exact-Z/Q Python verifier and test suite. We archive src/verify_ent_ v2.py (AST-verified zero float literals, zero float() calls, and zero math/numpy imports; all real constants are enclosed in certified Fraction intervals) and tests/test_ent_v2.py (6/6 passing under pytest -W error), reporting exact computed margins across all four theorems (including exact lower and upper grid margins for Mertens’s sandwich). 3. Proof-level precision fixes. We explicitly require leading digit dr ≥ 1 in Theorem 2.1(a), prove
2 2m+1 < 22m+1 explicitly in Theorem 2.1(b), give the explicit derivative (t − 2)/t2 ≥ 0 m 4 on [2, 6] and the table-free step ln ln 6 < 1 in Theorem 2.1(c), prove rational brackets for ln 2 and ln 3 in Lemma 3.1, replace the convex-quadratic appeal in Theorem 4.1(b) by an exact algebraic factorization, establish existence of γ ∈ (0, 1) via a positive telescoping series before defining rm in Theorem 5.2(a), and state explicitly the measure-zero boundary overlap of unit squares in Theorem 5.2(b).
Legendre Valuation, Erdős Primorial, and Chebyshev Bounds
Let π(x) := #{p ≤ x : p prime}, n# := p≤n p (the primorial, with 1# := 1), and ϑ(x) := P p≤x ln p = ln(⌊x⌋#) (empty sums equal 0). For any prime p and integer n ≥ 1, let νp (n!) be the exponent of p in n! and let sp (n) be the sum of the base-p digits of n. Q
Theorem 2.1 (Legendre Valuation, Erdős Primorial, and Chebyshev Bounds). (a) (Exact Legendre Identity and Central-Binomial Prime-Power Bound.) For every integer n ≥ 1 and prime p, νp (n!) =
⌊logp n⌋
and for the central binomial coefficient νp
2n n
⌊logp (2n)⌋
2n n −2 k k p p
n n − sp (n) = , k p p−1
∈ 0, 1, . . . , ⌊logp (2n)⌋ ,
pνp (( n )) ≤ 2n. (2) 2n
(b) (Erdős Primorial Bound and ϑ-Ceiling.) For every integer n ≥ 1, n# < 4n ; equivalently, for every real x ≥ 1, ϑ(x) < x ln 4. (3) 2
(c) (Non-Asymptotic Two-Sided Chebyshev Prime Envelope.) For every integer m ≥ 1, 4m ≤ (2m + 1)(2m)π(2m) , whence π(2m) ≥ m ln 4−ln(2m+1) . Moreover, for every real x ≥ 2, ln(2m) √ (x − 2) ln 2 4 ln 2 < π(x) < x + x. 2 ln x ln x
Proof. Part (a). Among {1, . . . , n}, exactly ⌊n/pk ⌋ integers are divisible by pk , so summing over k ≥ 1 counts each factor p in n! once (equivalently, νp ((n + 1)!) − νp (n!) = νp (n + 1) matches the P P increment of k≥1 ⌊n/pk ⌋, formalized in Lean as legendre_valuation). Writing n = rj=0 dj pj P with 0 ≤ dj ≤ p − 1 and leading digit dr ≥ 1 (so r = ⌊logp n⌋), we have ⌊n/pk ⌋ = rj=k dj pj−k , whence
X j r
r r X X X n pj − 1 n − sp (n) j−k = d p = d = , j j k p p−1 p−1 j=1 j=1 k=1 k=1 formalized multiplicatively without division as (p − 1)νp (n!) + sp (n) = n in legendre_digit_sum. 2 Since 2n ∈ {0, 1} for n (n!) = (2n)!, (1) gives the valuation sum in (2). Because ⌊2u⌋ − 2⌊u⌋
every real u, each of the ⌊logp (2n)⌋ nonzero summands is at most 1, giving νp ( 2n ) ≤ ⌊logp (2n)⌋ n νp ((2n ) n ) ≤ 2n (central_binom_padicVal_bound). and p
Part (b). We prove n# < 4n for every integer n ≥ 1 by strong induction [3] (formalized in erdos_primorial_lt_pow4). Base cases: 1# = 1 < 4 and 2# = 2 < 16. Fix n ≥ 3 and assume k# < 4k for all 1 ≤ k < n. If n = 2m ≥ 4 is even, then n is composite so (2m)# = (2m − 1)# < 42m−1 < 42m . If n = 2m + 1 (m ≥ 1) is odd, every prime p with m + 1 < p ≤ 2m + 1 divides (2m + 1)! but divides neither m! nor (m + 1)!, so by Euclid’s
lemma p divides 2m+1 ( binom_middle_div_by_prime ), and since distinct primes are pairwise m Q 2m+1
coprime, m+1<p≤2m+1 p | m (prod_primes_range_dvd_binom_odd). For every m ≥ 1, the
P 2m+1
indices 0 < m < m + 1 ≤ 2m + 1 are distinct in 2m+1 = 22m+1 with 2m+1 = 1 and k=0 k 0 2m+1
2m+1
, hence m+1 = m 2m + 1 1+2 m
2m+1
2m + 1 =⇒ 2 m
2m+1
2m + 1 m
< 4m
(central_binom_bounds). Applying the inductive hypothesis to m + 1 < 2m + 1 yields (2m + 1)# = (m + 1)#
p < 4m+1 · 4m = 42m+1 .
m+1<p≤2m+1
Taking natural logarithms gives ϑ(x) = ln(⌊x⌋#) < ⌊x⌋ ln 4 ≤ x ln 4 for all real x ≥ 1. √ Part (c). For the upper bound in (4), fix real x ≥ 2. Every prime p ∈ ( x, x] obeys √ √ ln p > 12 ln x (and if no prime lies in ( x, x], then π(x) − π( x) = 0 so the first inequality holds trivially), whence (3) yields √
√ √ 1 4 ln 2 4 ln 2 (ln x) π(x)−π( x) ≤ ϑ(x) < x ln 4 = (2 ln 2)x =⇒ π(x) < x+π( x) ≤ x+ x. 2 ln x ln x m For the lower bound, let m ≥ 1. Because 2m m is the largest of the 2m + 1 terms summing to 4 (binom_le_central), we have 4m ≤ (2m + 1) 2m m . By (2) and unique factorization over primes Q 2m
νp ((2m ) π(2m) ) m p ≤ 2m, = p ≤ (2m) , yielding 4m ≤ (2m + 1)(2m)π(2m) (chebyshev_
p≤2m
m ln 4−ln(2m+1) . ln(2m) ′ Now let x ≥ 2. If x ∈ [2, 6), set g(t) := ln t+2/t on [2, 6]; its derivative is g (t) = (t−2)/t2 ≥ 0,
prime_count_lower_exp), and taking logarithms gives π(2m) ≥
ln t−1+2/t so g(t) ≥ g(2) = ln 2 + 1 > 1. Hence t 7→ t−2 > 0 on ln t has strictly positive derivative (ln t)2 [2, 6], giving (x − 2) ln 2 (6 − 2) ln 2 ln 4 < = < 1 ≤ π(x) 2 ln x 2 ln 6 ln 6
because 4 < 6. If x ≥ 6, set m := ⌊x/2⌋ ≥ 3. By induction 2m + 1 < 2m for all m ≥ 3, so 2m
4m x−2 m m ≥ 2m+1 > 2 (chebyshev_binom_lower_pow2). Using m > 2 and 2m ≤ x yields π(x) ≥ π(2m) >
m ln 2 (x − 2) ln 2 > . ln(2m) 2 ln x
Elementary Rational Logarithm Brackets and Mertens’s First Sandwich
To avoid any unproved numerical approximations in the elementary bounds of Sections 3 and 5, we first establish sharp rational brackets for ln 2 and ln 3 directly from polynomial integrals. Lemma 3.1 (Elementary Rational Brackets for ln 2 and ln 3). The natural logarithms of 2 and 3 satisfy the exact rational inequalities 11 56 1123 7 < < ln 2 < < , 16 81 1620 10
263 923 11 < ln 3 < < . 240 840 10
Proof. For any u ∈ (0, 1), substitution gives ln 1+u 1−u = 1+u 9 1 1−u = 2, and for every t ∈ (0, 1/3] we have 1−t2 ≤ 8 , so
1 + t2 <
dt −u 1−t
dt = 2 0u 1−t 2 . For u = 1/3,
t4 9 1 2 = 1 + t + ≤ 1 + t2 + t4 . 2 2 1−t 1−t 8
R 1/3
Integrating 2 0 (·) dt yields 56 1 1 =2 + 81 3 81
< ln 2 < 2
1 1 9 1 + + · 3 81 8 5 · 243
56 1 1123 + = . 81 540 1620
1 4 2 4 Similarly, for u = 1/2, 1+u 1−u = 3, and for every t ∈ (0, 1/2] we have 1−t2 ≤ 3 , so 1 + t + t <
R 1/2 1 ≤ 1 + t2 + t4 + 43 t6 . Integrating 2 0 (·) dt yields 1−t2
263 1 1 1 =2 + + 240 2 24 160
< ln 3 <
263 4 1 263 1 923 +2· · = + = . 240 3 7 · 128 240 336 840
56 1123 7 11 263 923 The outer rational comparisons 11 16 < 81 , 1620 < 10 , 1 < 240 , and 840 < 10 hold by crossmultiplication (verified in Lean 4.36.0 in rational_log_mertens_dirichlet_bounds).
Theorem 3.2 (Explicit Non-Asymptotic Mertens First Theorem). For every integer n ≥ 1, P P ln p define M1 (n) := p≤n lnpp and Cpp := p≥2 p(p−1) . Then Cpp <
ln 2 ln 3 5(1 + ln 4) 77 13 + + < < , 2 6 16 60 10
and for every integer n ≥ 1, ln n − (1 + Cpp ) < M1 (n) < ln n + ln 4,
in particular ln n −
23 < M1 (n) < ln n + ln 4. (7) 10
Proof. Splitting Legendre’s exact identity (1) into k = 1 and k ≥ 2 gives ln(n!) =
ln p + R(n),
R(n) :=
X X n
p≤n k≥2
By integral comparison of the increasing function ln t (using n ln n − n <
Z n 1
ln t dt ≤
ln k = ln(n!) ≤
Z n 1
ln p ≥ 0.
1 ln t dt = n ln n − n + 1),
ln t dt + ln n = n ln n − n + 1 + ln n.
For the upper bound on M1 (n), using ⌊n/p⌋ > n/p − 1 for every prime p ≤ n (and empty-sum equality at n = 1) alongside R(n) ≥ 0, (3), and (9) gives nM1 (n) − n ln 4 < nM1 (n) − ϑ(n) ≤
ln p ≤ ln(n!) ≤ n ln n − n + 1 + ln n,
n where the first inequality is strict for every n ≥ 1 by (3). Dividing by n and noting 1+ln ≤1 n (since ln n ≤ n − 1 for all n ≥ 1) yields M1 (n) < ln n + ln 4. P P For the lower bound, ⌊n/p⌋ ≤ n/p and ⌊n/pk ⌋ ≤ n/pk give R(n) ≤ n p≥2 k≥2 lnpkp = nCpp , so (8) and (9) yield n ln n − n < ln(n!) ≤ nM1 (n) + nCpp , hence M1 (n) > ln n − (1 + Cpp ) [5]. Because t 7→ lnt2t is strictly decreasing on [4, ∞) (derivative (1 − 2 ln t)/t3 < 0 since ln 4 = 2 ln 2 > 1 5 11/8 > 1/2) and m(m−1) ≤ 4m 2 for all m ≥ 5,
Cpp ≤
∞ ln 2 ln 3 5 X ln m ln 2 ln 3 5 + + < + + 2 2 6 4 m=5 m 2 6 4
Z ∞ 4
ln t ln 2 ln 3 5(1 + ln 4) dt = + + . 2 t 2 6 16
Substituting ln 2 < 7/10 and ln 3 < 11/10 from Lemma 3.1 yields Cpp <
11 5(1 + 7/5) 32 3 77 13 7 + + = + = < 20 60 16 60 4 60 10
(rational_log_mertens_dirichlet_bounds), so 1 + Cpp < 23 10 = 2.3, proving (7).
Möbius Inversion, Squarefree, and Totient Bounds
Recall the Möbius function µ(n) (µ(1) = 1, µ(n) = (−1)r if n is a product of r distinct primes, µ(n) = 0 if p2 | n) and Euler’s totient φ(n) := #{1 ≤ k ≤ n : gcd(k, n) = 1}. Define P P Q(x) := n≤x µ2 (n) and Φ(x) := n≤x φ(n). In the analytic corollaries of Parts (b) and (c) P −2 = π 2 /6 and its Euler product below, we cite externally Euler’s Basel identity ζ(2) = ∞ n=1 n P∞ Q 2 −2 −1 2 = 6/π [1]; the Möbius divisor-cancellation and squarefree d=1 µ(d)/d = p (1−p ) = ζ(2) counting identities, the half-integer tail estimate, and the algebraic endpoint inequality are proved from first principles and formally verified in Lean 4.36.0, while the finite totient identities in Parts (a) and (c) are checked exhaustively in exact integer arithmetic in src/verify_ent_ v2.py. Theorem 4.1 (Non-Asymptotic Squarefree and Totient Error Bounds). (a) (Möbius Identities and Half-Integer Tail.) For every integer n ≥ 1, d|n µ(d) = 1{n=1} , P P µ2 (n) = d2 |n µ(d), and φ(n) = d|n µ(d)(n/d). Moreover, for every integer D ≥ 1, P
1 1 < . 2 d D + 1/2 d=D+1
(10)
(b) (Universal Squarefree Error Bound via Algebraic Endpoint Factorization.) For every real x ≥ 1,
X √ x 6 Q(x) = µ(d) 2 , Q(x) − 2 x < 2 x. (11) d π √ d≤ x
(c) (Universal Euler Totient Summatory Error Bound.) For every real x ≥ 1, Φ(x) =
X d≤x
µ(d)
⌊x/d⌋(⌊x/d⌋ + 1) , 2 5
Φ(x) −
3 2 1 31 x < x ln x + x. π2 2 24
(12)
Proof. Part (a). If n > 1, choose a prime p | n and write n = pe m with e ≥ 1 and p ∤ m; squarefree P divisors of n pair bijectively as {d, pd} for d | m with µ(pd) = −µ(d), giving d|n µ(d) = 0 (sum_ divisors_mobius). Letting s = sqPart(n) be the largest integer with s2 | n (so d2 | n ⇐⇒ d | s P P and s = 1 ⇐⇒ n is squarefree) gives d2 |n µ(d) = d|s µ(d) = 1{s=1} = µ2 (n) (mobius_sq_ P indicator). Partitioning {1, . . . , n} by g = gcd(k, n) gives d|n φ(d) = n, and Möbius inversion P 1 1 1 gives φ(n) = d|n µ(d)(n/d). For (10), every integer d ≥ 1 obeys d12 < d2 −1/4 = d−1/2 ; − d+1/2 1 1 − D+M1+1/2 < D+1/2 summing from d = D + 1 to D + M telescopes to D+1/2 (half_int_inv_ sq_telescope), and taking M → ∞ gives (10) (strict because the first term is strictly less than its telescoping bound). √ √ Part (b). Setting D := ⌊ x⌋ ≥ 1 and u := x ∈ [D, D + 1), interchanging summation P P in Q(x) = n≤x d2 |n µ(d) gives the exact identity in (11) (squarefree_count_mobius_exact). P 2 2 Writing ⌊x/d2 ⌋ = x/d2 − {x/d2 } and substituting ∞ d=1 µ(d)/d = 6/π [1] gives ∞ D X 6 µ(d) X x x = −x − µ(d) 2 2 2 π d d d=D+1 d=1
Q(x) −
Applying the triangle inequality, |µ(d)| ≤ 1, {x/d2 } ∈ [0, 1), and (10) yields Q(x) −
6 u2 x < + D. π2 D + 1/2
Instead of invoking convexity, observe the exact algebraic identity 2u(2D + 1) − 2u2 + D(2D + 1) = 2(u − D)(D + 1 − u) + D.
For D ≥ 1 and u ∈ [D, D + 1], both (u − D) ≥ 0 and (D + 1 − u) ≥ 0, so the right-hand side is at least D ≥ 1 > 0 (formalized universally over Q in convex_quadratic_endpoint_bound). Dividing √ u2 + D < 2u = 2 x, proving (11). by 2D + 1 yields D+1/2 Part (c). Setting N := ⌊x⌋ ≥ 1 and md := ⌊x/d⌋ = x/d − θd (θd ∈ [0, 1)), substituting P φ(n) = d|n µ(d)(n/d) and summing k = n/d ∈ {1, . . . , md } yields the exact identity in (12). x(1−2θd ) x Expanding 12 md (md +1) = 2d + θd (θ2d −1) and noting |1−2θd | ≤ 1 and |θd (θd −1)| ≤ 1/4 2 + 2d gives ∞ N 3 x2 X 1 xX 1 N Φ(x) − 2 x2 ≤ + + . 2 π 2 d=N +1 d 2 d=1 d 8 2
By (10), x2 Using
2 x N +1 4 x2 −2 < d>N d 2(N +1/2) < 3 x (since x < N + 1 implies N +1/2 < N +1/2 ≤ 3 at N = 1). d−1 ≤ 1 + ln N ≤ 1 + ln x and N ≤ x yields
Φ(x) −
3 2 2 1 1 1 31 x < x + x(ln x + 1) + x = x ln x + x. 2 π 3 2 8 2 24
Dirichlet Hyperbola Divisor Bound and Gauss Circle Enclosure
−1 2 Let d(n) := k|n 1, D(x) := n≤x d(n), Hm := m k=1 k , and N2 (x) := #{(a, b) ∈ Z : 2 2 a + b ≤ x}. We first establish the existence and elementary rational bounds of the Euler– Mascheroni constant γ directly from a positive telescoping series, avoiding any circular definition.
Lemma 5.1 (Existence and Elementary Telescoping Bounds for γ). For each integer k ≥ 1,
P 1 define ak := k1 −ln 1+ k1 . Then 0 < ak < k1 − k+1 , so γ := ∞ k=1 ak converges in (0, 1) and equals limm→∞ (Hm − ln m). Moreover, for every integer m ≥ 1, the remainder rm := Hm − ln m − γ satisfies 1 1 1 3 13 0< < rm < < , and in particular <γ< . (13) 2m + 1 2m m 10 16 6
1 Proof. Since t 7→ 1/t is strictly decreasing on [k, k + 1], k+1 < ln(1 + k1 ) = kk+1 dtt < k1 , whence P 1 0 < ak < k1 − k+1 . Hence the partial sums m−1 k=1 ak = Hm−1 − ln m are strictly increasing Pm−1 1 1 and bounded above by the telescoping sum k=1 ( k1 − k+1 )=1− m < 1 (euler_mascheroni_ P∞ telescoping_bound), proving convergence of γ := k=1 ak ∈ (0, 1) and limm→∞ (Hm − ln m) = γ. For every m ≥ 1,
rm = Hm − ln m − γ =
∞ ∞ X X 1 1 − ak = ln 1 + m k=m k k=m
1 . k+1
By strict convexity of t 7→ 1/t on [k, k + 1], the midpoint and trapezoid inequalities give
1 1 1 1 1 1 < ln(1 + ) < + . Subtracting k+1 yields k 2 k k+1 k+1/2 1 1 1 − 2 k + 1/2 k + 3/2
1 1 < ln 1 + 2(k + 1)(k + 1/2) k
1 1 1 1 . < − k+1 2 k k+1
1 1 1 Summing k = m, . . . , ∞ telescopes directly to 2m+1 . Evaluating 0 < r2 = < rm < 2m < m 3 1 3 11 7 2 − ln 2 − γ < 2 gives 1 − ln 2 < γ < 2 − ln 2, and Lemma 3.1 ( 16 < ln 2 < 10 ) yields 3 13 10 < γ < 16 .
Theorem 5.2 (Dirichlet Hyperbola and Gauss Circle Lattice Bounds). √ √ (a) (Dirichlet Hyperbola and Explicit 2 x + 4 Bound.) For every real x ≥ 1 with u := ⌊ x⌋, D(x) = 2
X x k=1
− u2 ,
√ D(x) − x(ln x + 2γ − 1) < 2 x + 4.
(14)
(b) (Gauss Circle Unit-Tile Enclosure.) For every real x ≥ 1,
1 x− √ 2
≤ N2 (x) ≤ π
1 x+ √ 2
√ √ π N2 (x) − πx ≤ π 2 x + . 2
(15)
Proof. Part (a). Since D(x) = D(⌊x⌋) and ⌊x/k⌋ = ⌊⌊x⌋/k⌋, the hyperbola identity in (14) reduces to integers n = ⌊x⌋, where counting lattice pairs (a, b) ∈ N2≥1 with ab ≤ n by splitting P at a ≤ u vs. a > u (whence b ≤ u) proves D(n) + u2 = 2 uk=1 ⌊n/k⌋ [4] (formalized universally in Lean 4.36.0 as dirichlet_hyperbola_additive and dirichlet_hyperbola_exact). Writing ⌊x/k⌋ = x/k − {x/k} and Hu = ln u + γ + ru gives u X √
D(x) = x(ln x + 2γ − 1) + 2x ln(u/ x) + x − u2 + 2xru − 2 k=1
x . k
√ √ √ √ Let δ := x − u ∈ [0, 1) and t := δ/ x ∈ [0, 1), so u/ x = 1 − t and 2x ln(u/ x) + x − u2 = x(2 ln(1 − t) + 2t − t2 ). Since ln(1 − t) ≤ −t − t2 /2 on [0, 1), this term is at most 0. For x ≥ 4, √ we have u ≥ 2 and t < 1/ x ≤ 1/2; on [0, 1/2], h(t) := ln(1 − t) + t + t2 satisfies h(0) = 0 and h′ (t) = t(1 − 2t)/(1 − t) ≥ 0, so ln(1 − t) ≥ −t − t2 and hence −3δ 2 ≤ x(2 ln(1 − t) + 2t − t2 ) ≤ 0 √ √ 2 (magnitude < 3). By Lemma 5.1, 0 < 2xru < 2x while u = 2( x + δ + δ /u) <√2 x + 4, √ √ √ Pu −2 k=1 {x/k} ∈ (−2 x, 0]. Combining upper (< 2 x+4) and lower (> −3−2 x > −(2 x+4)) bounds proves (14) for all x ≥ 4. For x ∈ [1, 4), let f (x) := x(ln x + 2γ − 1). Since f ′ (x) = ln x + 2γ > 0 on [1, 4] by Lemma 5.1, 7 f is strictly increasing on [1, 4]. By Lemmas 3.1 and 5.1, − 52 < 2γ − 1 < 58 , 11 16 < ln 2 < 10 , 11 and 1 < ln 3 < 10 . Checking the three subintervals where D(x) ∈ {1, 3, 5} is constant while √ 2 x + 4 ≥ 6: 7 53 • On [1, 2) (D(x) = 1): f (1) > − 52 and f (2) < 2( 10 + 58 ) = 20 , so |1 − f (x)| < 33 20 < 6.
23 11 5 207 2 • On [2, 3) (D(x) = 3): f (2) > 2( 11 16 − 5 ) = 40 > 0 and f (3) < 3( 10 + 8 ) = 40 , so |3 − f (x)| < 3 < 6. 16 • On [3, 4) (D(x) = 5): f (3) > 3(1 − 25 ) = 95 and f (4) < 4( 75 + 58 ) = 81 10 , so |5 − f (x)| < 5 < 6.
Every rational comparison is verified in Lean 4.36.0 (rational_log_mertens_dirichlet_bounds), completing the proof of (14) for all x ≥ 1. Part (b). Let B(0, R) := {z ∈ R2 : ∥z∥2 ≤ R} denote the closed Euclidean disk of radius R > 0. Associate to each (a, b) ∈ Z2 the closed unit square Sa,b := [a− 12 , a+ 12 ]×[b− 12 , b+ 12 ], whose √ S half-diagonal has length 1/ 2, and let U(x) := a2 +b2 ≤x Sa,b . Distinct closed squares Sa,b have pairwise disjoint interiors and intersect at most along shared boundary segments or vertices, which P have two-dimensional Lebesgue measure zero; hence Area(U(x)) = a2 +b2 ≤x Area(Sa,b ) = N2 (x). √ √ √ Every z ∈ Sa,b with ∥(a, b)∥2 ≤ x obeys ∥z∥2 ≤ ∥(a, b)∥2 + ∥z − (a, b)∥2 ≤ x + 1/ 2 (formalized in exact scaled-integer Cauchy–Schwarz form in lattice_tile_outer_sq), giving √ √ U(x) ⊆ √ B(0, x + 1/ 2) and the upper√bound in (15). Conversely, since x ≥ 1 ensures √ √ x − 1/ 2 > 0, every z ∈ B(0, x − 1/ 2) lies in a unit square Sa,b whose center satisfies √ √ √ √ ∥(a, b)∥2 ≤ ∥z∥2 + 1/ 2 ≤ x (lattice_tile_inner_sq), so B(0, √x − 1/ 2) ⊆ U(x), proving √ the lower bound. Expanding both squares yields |N2 (x) − πx| ≤ π 2 x + π2 .
Formal Verification in Lean 4.36.0 and Exact-Z/Q Audit
To ensure end-to-end reproducibility inside the archived bundle, we pair a standalone Lean 4.36.0 formalization with a zero-float Python verification script and test suite.
Standalone Zero-Import Lean 4.36.0 Core
The Lean module lean/ElementaryNumberTheoryCore.lean compiles cleanly under toolchain leanprover/lean4:v4.36.0 with lean -DwarningAsError=true (0 imports beyond core Init, 0 errors, 0 warnings, 0 sorry). Every one of its 119 public theorems is audited via #print axioms in data/lean_axioms_audit.txt and depends exclusively on the standard Lean kernel axioms [propext, Classical.choice, Quot.sound] (zero custom axioms, zero native_decide or Lean. ofReduceBool). Table 1 summarizes the exact 1:1 correspondence between the Lean 4.36.0 theorems and the manuscript, explicitly delimiting the formally proved algebraic/combinatorial core from the classical real-analytic corollaries (logarithms, integrals, ζ(2) = π 2 /6, and Lebesgue area).
Archived Zero-Float Exact-Z/Q Python Verification
The archived script src/verify_ent_v2.py uses only the Python standard library (fractions, json, pathlib, argparse) and contains zero floating-point literals, zero float() calls, and zero math/numpy imports (AST-enforced in tests/test_ent_v2.py). Every analytic constant is enclosed in a certified rational interval derived from elementary series and Lemma 5.1: ln 2 ∈ [0.693147180560, 0.693147180560],
ln 3 ∈ [1.098612288668, 1.098612288668],
π ∈ [3.141592653590, 3.141592653590],
γ ∈ [0.577215652, 0.577215692],
where π is enclosed via Machin’s alternating series and γ via (13) at m = 2,500 (rounded endpoints displayed to 12 and 9 decimals; exact unrounded Fraction bounds are used internally). Using a pure-integer deterministic threshold grid of 60 distinct integers in [2, 20,000] (defined recurrently by xk+1 = max(xk + 1, ⌊117xk /100⌋) capped at 20,000), the verifier executes 240 certified rational-interval grid checks, 5 boundary checks at x = 1 (Mertens n = 1 plus Q, Φ, D, and N2 , with the 4 error ratios reported in Table 2), and 6,829 exhaustive exactinteger identity checks (2,037 Legendre valuations for n ≤ 120, 3,472 central-binomial primepower ceilings, 500 exact integer primorial checks n# < 4n , 120 exact factorial split checks 8
Table 1: 1:1 coverage map for lean/ElementaryNumberTheoryCore.lean (Lean 4.36.0, 119 audited public theorems, 0 sorry, 0 warnings, standard axioms only). Manuscript Pillar
Primary Lean 4.36.0 Identifiers
Universally Quantified Formal Statement (N/Z/Q)
Thm. 2.1 (Binomial, Erdős, Chebyshev)
central_binom_bounds, binom_ middle_div_by_prime, erdos_ primorial_lt_pow4, chebyshev_ prime_count_lower_exp legendre_valuation, legendre_ digit_sum, central_binom_ padicVal_bound divisorSummatory_eq_sum_floor, dirichlet_hyperbola_additive, dirichlet_hyperbola_exact
∀m ≥ 1, 4m ≤ (2m + 1) 2m and 2 2m+1 < 22m+1 ; prime m m divisibility for m + 1 < p ≤ 2m + 1; ∀n ≥ 1, n# < 4n ; ∀m ≥ 1, 4m ≤ (2m + 1)(2m)π(2m) (and 2m < 2m for m ≥ 3). m
Thm. 2.1(a) (Legendre Valuation) Thm. 5.2(a) (Dirichlet Hyperbola) Lem. 3.1–5.1, Thm. 3.2–5.2 (Möbius, Rationals, Gauss)
sum_divisors_mobius, mobius_sq_ indicator, squarefree_count_ mobius_exact, half_int_inv_sq_ telescope, convex_quadratic_ endpoint_bound, euler_ mascheroni_telescoping_bound, rational_log_mertens_ dirichlet_bounds, lattice_tile_ outer_sq, lattice_tile_inner_sq
∀p prime, ∀n ∈ N, νp (n!) =
⌊n/pk ⌋, k=1 νp ( 2n ) n
(p − 1)νp (n!) + sp (n) = n, and p ∀n ∈ N, D(n) =
≤ 2n (n ≥ 1).
⌊n/k⌋ and P⌊√n⌋ k=1 √ 2 D(n) = 2 k=1 ⌊n/k⌋ − ⌊ n⌋ (both additive and subtraction forms). P P ∀n ≥ 1, µ(d) = 1{n=1} and µ(d) = µ2 (n); ∀N , d|n d2 |n
√ µ(d)⌊N/d2 ⌋; ∀D ≥ 1, M , d≤ N 2 (D + 1 + k)−2 < 2D+1 ; ∀u ∈ [D, D + 1]Q , k=0 2 2u + D(2D + 1) < 2u(2D + 1); telescoping bound < 1/m;
Q(N ) =
PM −1
exact rational log/Mertens/Dirichlet checks; exact scaled-integer Cauchy–Schwarz outer/inner unit-tile inclusions.
n! = p≤n p⌊n/p⌋ p≤n,k≥2 p⌊n/p ⌋ , 200 Möbius convolution checks, and 500 Dirichlet hyperbola checks). All 6/6 unit tests in tests/test_ent_v2.py pass under pytest -W error in 0.85 s; full outputs are archived in data/verification_report.json and summarized in Table 2 and Figures 1–2. Q
Table 2: Zero-float exact-Z/Q verification summary from data/verification_report.json (60point deterministic integer grid in [2, 20,000], 240 grid checks + 5 checks at x = 1 + 6,829 exhaustive exact-integer identity checks; pytest -W error: 6/6 passed in 0.85 s). Grid Checks
Max Identity Error
Tightest Certified Grid Ratio / Margin (x ∈ [2, 20,000])
Thm. 2.1 (Legendre & Chebyshev) Thm. 3.2 (Mertens First) Thm. 4.1 (Squarefree & Totient)
0 (exact Z: νp , n#)
0 (exact Z factorial split) 0 (exact Z Möbius sums)
Thm. 5.2 (Dirichlet & Gauss)
max(ϑ(x)/(x ln 4)) = 0.7169 (x = 18,448); 0 π(x) violations min(M1 (n) − (ln n − 2.3)) = 0.9740 (n = 20,000); min((ln n + ln 4) − M1 (n)) = 1.7329 (n = 2) √ max(|Q− π62 x|/2 x) = 0.3395 (x = 3; 0.1960 at x = 1); 3 2 max(|Φ− π2 x |/bnd) = 0.2393 (x = 2; 0.5389 at x = 1) √ max(Dir. err/(2 x+4)) = 0.3045 (x = 12; 0.1409 at x = 1); max(Gauss/bnd) = 0.4600 (x = 5; 0.3090 at x = 1)
Theorem
0 (exact Z hyperbola D)
(b) Non-Asymptotic Mertens First Sandwich
Upper: 4ln 2 + ln√ xx
Lower: (x −2x2)ln 2
Upper: ln n + ln 4 10
π(x)ln x/x
Mertens sum M1(n)
Normalized prime count π(x)ln x/x
(a) Chebyshev Prime-Counting Envelope 3.5
2.5 2.0 1.5 1.0
M1(n) =
ln p p
Lower: ln n − 2.3
6 4 2 0
0.5 0.0 101
x (log scale, x
∈ [10, 20,000])
n (log scale, n
∈ [2, 20,000])
Figure 1: (a) Normalized prime count π(x) ln x/x across x ∈ [10, 20,000] strictly bracketed by P the explicit Chebyshev envelope (4). (b) Mertens sum M1 (n) = p≤n lnpp across n ∈ [2, 20,000] strictly bracketed by the non-asymptotic sandwich ln n − 2.3 < M1 (n) < ln n + ln 4 (7).
(a) Squarefree Counting Error vs. 2√ x
Bound: 2√ x |Q(x)
− π6 x|
|N2(x)
Absolute remainder
Absolute remainder
(b) Dirichlet Hyperbola and Gauss Circle Errors Gauss bound: π√ 2x + π/2
101 100 10−1
− πx|
Dirichlet bound: 2√ x + 4 |D(x)
− x(ln x + 2γ − 1)|
101 100 10−1
x (log scale, x
∈ [2, 20,000])
x (log scale, x
∈ [2, 20,000])
Figure 2: (a) Squarefree remainder |Q(x) − π62 x| across x ∈ [2, 20,000] lying cleanly below √ 2 x (11). (b) Dirichlet divisor remainder |D(x) − x(ln x + 2γ − 1)| and Gauss √ √circle remainder √ |N2 (x)−πx| across x ∈ [2, 20,000] below their explicit ceilings 2 x+4 and π 2 x+ π2 (14)–(15).
Scope and Limitations
Four explicit boundaries clarify the scope of this work: 1. Elementary constants vs. specialized explicit literature. Theorems 2.1–4.1 prioritize short, table-free proofs valid for all x ≥ 1 (or x ≥ 2). Substantially tighter explicit constants exist in the specialized analytic and computational literature—including Rosser–Schoenfeld [7] for π(x), ϑ(x), and Mertens sums, and Moser–MacLeod [6] and Cohen–Dress [2] for Q(x)—by invoking zero-free regions of ζ(s) and extensive finite numerical tables. 2. Power-saving exponents in divisor and lattice problems. Theorem 5.2 gives explicit O(x1/2 ) remainders via elementary hyperbola and unit-tile geometry, whereas exponential-sum methods reduce the asymptotic error exponent below 1/3 (with optimal exponent conjectured to be 1/4 + ε). 3. External invocation of Basel’s identity. The analytic error corollaries in Theorem 4.1(b)–(c) P 2 2 cite the classical evaluation ζ(2) = π 2 /6 and its Euler product ∞ d=1 µ(d)/d = 6/π [1] externally; the Möbius divisor-cancellation and squarefree counting identities, the halfinteger tail bound, and the algebraic endpoint inequality are proved from first principles and formalized in Lean 4.36.0 (with Euler’s totient finite identities checked in exact integer arithmetic in src/verify_ent_v2.py). 4. Boundary between Lean 4.36.0 core and real-analytic corollaries. Because lean/Elementary NumberTheoryCore.lean is intentionally standalone with zero external imports (no Mathlib dependency), it formalizes universally all discrete (N/Z) and exact rational (Q) theorems in Table 1, while the real-analytic steps involving ln, Riemann integrals, limits, and planar Lebesgue measure are presented rigorously in Sections 2–5 and numerically checked with certified rational intervals in src/verify_ent_v2.py.
References [1] Tom M. Apostol. Introduction to Analytic Number Theory. Springer, New York, 1976. [2] Henri Cohen and François Dress. Estimations numériques du reste de la fonction sommatoire relative aux entiers sans facteur carré. Publ. Math. Orsay, 88-02:73–76, 1988. [3] Paul Erdős. Beweis eines satzes von tschebyschef. Acta Litt. Sci. Szeged, 5:194–198, 1932. [4] G. H. Hardy and E. M. Wright. An Introduction to the Theory of Numbers. Oxford University Press, 6th edition, 2008. [5] Franz Mertens. Ein beitrag zur analytischen zahlentheorie. J. Reine Angew. Math., 78:46–62, 1874. [6] Leo Moser and Robert A. MacLeod. The error term for the squarefree integers. Canad. Math. Bull., 9:303–306, 1966. [7] J. Barkley Rosser and Lowell Schoenfeld. Approximate formulas for some functions of prime numbers. Illinois J. Math., 6:64–94, 1962.
Complete plain-text extraction (6,369 words). Open the canonical PDF above for full mathematical typesetting and figures.
References (7)
- (1976) “Introduction to Analytic Number Theory” Springer
- (1988) “Estimations numériques du reste de la fonction sommatoire relative aux entiers sans facteur carré” Publ. Math. Orsay, 88-02, 73–76
- (1932) “Beweis eines Satzes von Tschebyschef” Acta Litt. Sci. Szeged, 5, 194–198
- (2008) “An Introduction to the Theory of Numbers” Oxford University Press
- (1874) “Ein Beitrag zur analytischen Zahlentheorie” J. Reine Angew. Math, 78, 46–62
- (1966) “The error term for the squarefree integers” Canad. Math. Bull, 9, 303–306
- (1962) “Approximate formulas for some functions of prime numbers” Illinois J. Math, 6, 64–94
Cite this paper
Lluis Eriksson (2026). Formally Verified Non-Asymptotic Elementary Number Theory Bounds in Lean 4.36.0 and Exact Rational Arithmetic. AIRR.SCIENCE, ARR-2026-4TDCQEMJQ19GB8VE, v2. https://airr.science/papers/ARR-2026-4TDCQEMJQ19GB8VE/versions/v2/
Use the DOI (when listed) or permanent version link to cite the exact manuscript you read. A DOI is a persistent citation identifier, not journal peer review. A Working paper label means the version has not completed AIRR screening. Import BibTeX, RIS or CSL JSON into your reference manager to apply a citation style.
Version history
The paper identifier remains stable. Each version has its own immutable release, timestamp and version identifier.
Revision statement
Major revision. Upgrades ARR-2026-4TDCQEMJQ19GB8VE v1 to a standalone, zero-import, universally quantified Lean 4.36.0 mechanization (lean/ElementaryNumberTheoryCore.lean, 119/119 audited public theorems, 0 sorry, 0 warnings under -DwarningAsError=true, 0 custom axioms) paired with an AST-clean (0/0/0) stdlib-only exact-Z/Q Python verifier (src/verify_ent_v2.py, 4/4 pytest -W error).
Verification record
- Frontier-model screening
- Pass · 2 models
- Source integrity
- Pass
- Bibliographic integrity
- Pass
- Reproducibility
- Pass
- Lean 4
- L2
Recorded under ARR-VERIFY-1.0. AIRR verification and screening are not peer review.
More in Number Theory
Centered Falling-Factorial Bounds, the Quadratic Overshoot Barrier, Constructive Pell-Lucas Classification, Residue Monotonicity, and Pellian Uniqueness for Repeated Entries in Pascal's Triangle ACCEPTABLE
Hidden Negacyclic Symmetry and Exact Arithmetic Classification of Pretty Good State Transfer on Transitive Tournaments VERY GOOD
Birational Quartic Descent, Infinite Duplication Towers, Elementary 2-Descent Rank-Zero Proofs, Group-Law Duality, and Constructive Fermat Descent for Pythapotent Hypotenuse-Leg Pairs ACCEPTABLE
Kloosterman Magic States, Exact Discrete Wigner Negativity Bounds, and Affine Blocking-Set Obstructions in Odd Prime Dimensions STRONG
Resonant Non-Integer Fourier Duality and a Record Pure-Kernel Lean 4 Formalization of mu >= 761/2000 = 0.3805 for Erdos's Minimum Overlap Problem STRONG
Complete Characteristic-2 Theory for Self-Reciprocal Irreducible Central Coefficients: Exact All-n Mobius Inversion, Square-Root Equidistribution Classification, and Universal Hyper-Kloosterman Congruences STRONG
AI assistance statement
Authored by Lluis Eriksson with AI-assisted Lean 4.36.0 mechanization, exact-Z/Q verifier engineering, and LaTeX drafting (Google Antigravity). Evaluated independently in fresh isolated blind sessions by Google DeepMind/gemini-4-hydrogen (6.00/10 accept) and Google DeepMind/gemini-4-neon (5.00/10 accept) under ARR-ASSESS-1.0 with zero unresolved material objections.
Frontier-model screening
Status: pass. Any listed reports correspond to this exact version under ARR-ASSESS-1.0; no absent assessment is represented as a pass.
- gemini-4-hydrogenGoogle DeepMind · pass
- gemini-4-neonGoogle DeepMind · pass
Model assessments and review context
- Distinct models
- 3
- Range
- 3.55–6.00
- Method
- bounded capability-weighted mean · exact version only
Limited evidence · 0/3 benchmark matches. This is an evidence description, not a probability of correctness.
Fresh blinded review context not documented for every model; Benchmark match incomplete; Review scores differ by more than one point
Anthropic · claude-opus-5-5 · not involved in manuscript · review context: unknown3.55
Recommendation: Accept · Material objections: 0
The manuscript gives explicit, exception-free versions of four classical elementary number-theory families. It covers Legendre/Erdos/Chebyshev bounds (n# < 4^n and a two-sided pi(x) envelope for x >= 2) and Mertens's first sandwich ln n - 2.3 < M1(n) < ln n + ln 4. It also treats the squarefree count (error < 2 sqrt x), the totient sum, the Dirichlet divisor problem (error < 2 sqrt x + 4) and the Gauss circle problem via unit tiles. Rational brackets for ln 2, ln 3 and gamma are proved from scratch. The discrete and rational cores are claimed to be formalized in a standalone Lean 4 file, with a float-free Python audit. I checked all main computations and found them correct. The scope is honestly stated. The mathematical content is textbook-level, constants are weaker than the specialized literature, and the formalization does not reach the real-analytic statements. The paper is a clean, correct, modest technical note at the publishable floor.
- Correctness confidence
- I re-derived the main steps by hand and found no error. These include the ln 2 and ln 3 brackets (56/81, 1123/1620, 263/240, 923/840), the Cpp < 77/60 estimate, the endpoint identity 2u(2D+1)-(2u^2+D(2D+1)) = 2(u-D)(D+1-u)+D, the 31/24 totient constant, the gamma remainder telescoping 1/(2m+1) < r_m < 1/(2m), the three Dirichlet subcases on [1,4), and the Gauss tile inclusions. Sample Table 2 entries (Q at x=3 and x=1, Gauss at x=1, Mertens at n=2) also check out.
- Rigor
- The proofs are complete and elementary. The v2 additions close gaps that v1 left open: rational log brackets, existence of gamma, the algebraic endpoint factorization, and the measure-zero tile overlaps. Rigor is capped because ln, integrals, limits, zeta(2) = pi^2/6 and the Lebesgue area argument are handled on paper only. The Lean core has no imports, so primes, pi(x), mu and nu_p are custom definitions whose fidelity to the standard notions cannot be checked from the PDF.
- Novelty
- Every theorem is a classical textbook result: Legendre, Erdos's 4^n primorial bound, Chebyshev, Mertens's first theorem, Mobius counts for squarefree integers and the totient sum, the Dirichlet hyperbola method, and unit-tile Gauss circle bounds. The constants are deliberately weaker than Rosser-Schoenfeld and Moser-MacLeod. The only new element is the packaging: a dependency-free Lean core plus a zero-float audit.
- Significance
- This is useful as a teaching aid or certified reference for explicit bounds valid on the whole half-line. However, it advances no open problem and sharpens no known constant. The formalization covers only the discrete and rational skeleton, not the analytic statements themselves.
- Reproducibility
- Proofs are fully written out and easy to check by hand. The Lean file, axiom audit, Python verifier and JSON report are described in detail (identifiers, check counts, grid recurrence), but none of that code appears in the PDF, so those claims cannot be inspected here. The totient finite identities are checked only numerically, not formalized.
Strengths
- All explicit constants come from fully elementary, verifiable arguments with no unproved decimal approximations. The ln 2 and ln 3 brackets from polynomial integrands and the telescoping gamma bounds (1/(2m+1) < r_m < 1/(2m)) are tight and correct.
- The exact algebraic identity 2u(2D+1)-(2u^2+D(2D+1)) = 2(u-D)(D+1-u)+D gives a clean, convexity-free proof of the 2 sqrt x squarefree bound for all x >= 1.
- The small-x ranges (x in [2,6) for Chebyshev, x in [1,4) for Dirichlet) are handled explicitly with rational arithmetic, so the bounds hold with no exceptions.
- The scope section is honest: it delimits what is formalized, what is cited (Basel identity), and how the constants compare to Rosser-Schoenfeld and Moser-MacLeod.
Weaknesses
- There is no new mathematics. Every theorem is classical and the constants are intentionally non-competitive (e.g. 2 sqrt x versus known bounds below 0.5 sqrt x for squarefree counts).
- The Lean core imports nothing, not even Mathlib. Primality, pi(x), padic valuation, Mobius and digit sums must therefore be custom definitions, and their agreement with the standard notions cannot be checked from the PDF. The headline real inequalities (4), (7), (11), (12), (14), (15) are not formalized at all.
- The Euler totient identities in Theorem 4.1(a,c) are verified only by finite exhaustive integer checks, not formally proved in Lean.
- The Dirichlet proof uses the weaker remainder bound r_u < 1/u where the available r_u < 1/(2u) would tighten the constant. Similarly, the Gauss bound is stated as non-strict while the other bounds are strict.
- The rounded interval displays in Section 6.2 have identical endpoints, e.g. ln 2 in [0.693147180560, 0.693147180560]. This is expository but looks degenerate to a reader.
Potential errors
- Expository: the displayed 12-decimal enclosures for ln 2, ln 3 and pi have coincident endpoints, which looks like a point value rather than a certified interval.
- Expository: the Lean table states the Legendre identity as a sum over k = 1..n, while equation (1) uses k up to floor(log_p n). The two are equivalent but the relationship is not explained.
Strong novelty candidates
None reported.
Unresolved material objections
None reported.
arr:assessment:d966684a-9a2a-4e32-9d25-c1dfff5f3749 · prompt ARR-ASSESS-1.0 · response SHA-256 2c5f33151cae2167b7b4999236c2e3b34de837a52ab82a5fa0ca0a6840fc6c01 · canonical PDF SHA-256 23f7be0ca3f0f396b5e85bdba352266a9186bae14a375dab3c71eb5773ad27c4
Google DeepMind · gemini-4-hydrogen · High · not involved in manuscript · review context: fresh blind6.00
Recommendation: Accept · Material objections: 0
Version 2 of ARR-2026-4TDCQEMJQ19GB8VE presents a clean, self-contained, and rigorously verified exposition of four classical non-asymptotic theorem families in elementary number theory (Legendre/Erdos/Chebyshev, Mertens's first sandwich, Mobius squarefree/totient error bounds, and Dirichlet hyperbola/Gauss circle bounds). Independent verification on OVH Limburgo confirmed MANIFEST.sha256 integrity across all 16 files, warning-free Lean 4.36.0 compilation of lean/ElementaryNumberTheoryCore.lean (119 public theorems, 0 sorry, standard axioms [propext, Classical.choice, Quot.sound] matching data/lean_axioms_audit.txt 1:1), exact reproduction of data/verification_report.json by the AST-verified zero-float Python verifier src/verify_ent_v2.py, 6/6 passing pytest -W error checks, and 1:1 consistency with paper.tex and paper.pdf. While the mathematical theorems and constants are classical and non-optimal, the formalization boundary and external analytic dependencies (real logarithms, integrals, zeta(2)=pi^2/6, Lebesgue measure, and totient finite checks in Python) are accurately and transparently scoped.
- Correctness confidence
- Lean 4.36.0 (lean -DwarningAsError=true) compiles ElementaryNumberTheoryCore.lean cleanly (119 public theorems, 0 sorry, standard axioms only matching data/lean_axioms_audit.txt). Python exact-Z/Q verifier reproduces data/verification_report.json identically (0 errors across 6,829 identity checks and 240+5 rational-interval checks), 6/6 pytest -W error pass, and all manual proofs in Sections 2-5 verify cleanly.
- Rigor
- V2 resolves all V1 gaps: leading-digit condition in Thm 2.1(a), explicit 2*C(2m+1,m)<2^(2m+1), derivative check on [2,6], rational brackets for ln 2 and ln 3 via polynomial integrals, algebraic factorization in Thm 4.1(b), positive telescoping construction of gamma before r_m, explicit [1,4) Dirichlet interval checks, measure-zero boundary note in Gauss circle, and AST-enforced zero-float Python verification.
- Novelty
- The underlying theorems (Legendre, Erdos primorial, Chebyshev, Mertens, Mobius squarefree/totient, Dirichlet hyperbola, Gauss circle) and elementary constants are classical and non-optimal compared to Rosser-Schoenfeld, Moser-MacLeod, and Cohen-Dress. The contribution is an exception-free synthesis pairing a standalone zero-import Lean 4.36.0 core with a zero-float rational-interval audit.
- Significance
- Delivers a clean, reusable, zero-import Lean 4.36.0 core of 119 discrete/rational elementary number theory theorems and a deterministic zero-float Python verifier suitable for certified baseline reference and education. Impact is bounded by the classical nature of the results and external reliance on real analysis (ln, integrals, zeta(2)=pi^2/6, Lebesgue area) outside Lean.
- Reproducibility
- All 16 files pass sha256sum -c MANIFEST.sha256. Lean 4.36.0 compilation, #print axioms generation across all 119 theorems, python3 src/verify_ent_v2.py --max-x 20000, pytest -W error (6/6 passed in 0.66s), and pdflatex/bibtex build all succeeded cleanly on OVH Limburgo with zero mismatches against archived data/verification_report.json and data/lean_axioms_audit.txt.
Strengths
- Standalone zero-import Lean 4.36.0 formalization (lean/ElementaryNumberTheoryCore.lean) with 119 universally quantified public theorems, 0 sorry, 0 warnings under -DwarningAsError=true, and exclusively standard kernel axioms [propext, Classical.choice, Quot.sound] (no native_decide or Lean.ofReduceBool).
- Exact 1:1 alignment between Table 1/proof citations in paper.tex and the Lean identifiers, plus transparent delineation of the discrete/rational formalized core versus classical real-analytic corollaries in Section 7.
- Pure-stdlib, AST-enforced zero-float exact-Z/Q verifier (src/verify_ent_v2.py) enclosing ln 2, ln 3, pi, and gamma in certified Fraction intervals and executing 6,829 exact integer identity checks, 240 grid checks across [2, 20000], and 5 boundary checks at x=1 with byte-identical reproduction of data/verification_report.json.
- Rigorous elementary proof repairs in Version 2, including polynomial-integral rational bounds for ln 2 and ln 3, non-circular telescoping existence of gamma in (0, 1), algebraic endpoint factorization replacing convexity in Theorem 4.1(b), explicit [1, 4) interval checks in Theorem 5.2(a), and explicit measure-zero square-boundary handling in Theorem 5.2(b).
Weaknesses
- The mathematical results and explicit constants are classical and substantially weaker than specialized analytic/computational bounds (e.g., Rosser-Schoenfeld 1962, Moser-MacLeod 1966, Cohen-Dress 1988, and O(x^(1/3)) divisor/circle bounds), as acknowledged in Section 7.
- Because Lean formalization uses zero external imports (no Mathlib), real-analytic steps (ln, Riemann integrals, limits, Basel identity zeta(2)=pi^2/6, and planar Lebesgue measure) remain paper proofs audited numerically by certified rational intervals up to x=20,000 rather than machine-checked real-analysis proofs.
- Euler's totient phi(n) and its finite Mobius convolution identity in Theorem 4.1(a),(c) are verified exhaustively in exact integer arithmetic in src/verify_ent_v2.py rather than formalized in lean/ElementaryNumberTheoryCore.lean (disclosed in Sections 4 and 7).
Potential errors
None reported.
Strong novelty candidates
None reported.
Unresolved material objections
None reported.
arr:assessment:cf2df36f-57f4-45fd-876c-c618ad7d52e2 · prompt ARR-ASSESS-1.0 · runtime identity: Google DeepMind gemini-4-hydrogen · reasoning effort: high · basis: platform runtime metadata · evidence SHA-256 bf96b52e2042b800118f1eb3b47b38c00361e172db3e731138d7b5271b41bfb3 · response SHA-256 614b430ef5980cc1b95e48892e13d5ee0068c25f09f557fd715ef6a8fc150a72 · canonical PDF SHA-256 23f7be0ca3f0f396b5e85bdba352266a9186bae14a375dab3c71eb5773ad27c4
Google DeepMind · gemini-4-neon · High · not involved in manuscript · review context: fresh blind5.00
Recommendation: Accept · Material objections: 0
Version 2 of ARR-2026-4TDCQEMJQ19GB8VE delivers a clean, mathematically sound, and highly reproducible treatment of four classical non-asymptotic theorem families in elementary number theory (Legendre/Erdos/Chebyshev, Mertens first theorem via proved rational log brackets, Mobius squarefree/totient bounds, and Dirichlet hyperbola/Gauss circle enclosures). Independent execution on Linux (Lean 4.36.0 and Python 3.12) confirmed 16/16 MANIFEST.sha256 checksums, warning-free compilation of lean/ElementaryNumberTheoryCore.lean under -DwarningAsError=true with zero imports, zero sorry, and standard kernel axioms across all 119 public theorems matching data/lean_axioms_audit.txt identically, exact byte-for-byte reproduction of data/verification_report.json by the AST-verified zero-float exact-Z/Q suite (6/6 pytest -W error passing), and clean 11-page LaTeX compilation with exact 1:1 fidelity across all 22 cited Lean identifiers and tabulated numbers. While the mathematical results are classical and looser than specialized analytic/computational bounds (accurately attributed to Rosser-Schoenfeld, Moser-MacLeod, and Cohen-Dress), the standalone zero-import Lean formalization and certified rational-interval audit bundle are executed to an exemplary standard with no unresolved material objections.
- Correctness confidence
- All four theorem families and Lemmas 3.1 and 5.1 were audited line-by-line and hold without error. Independent verification on Lean 4.36.0 (-DwarningAsError=true) passed with 0 sorry, 0 warnings, and standard kernel axioms across all 119 public theorems; the zero-float exact-Z/Q verifier reproduced verification_report.json byte-for-byte with 6/6 pytest passing.
- Rigor
- Version 2 closes prior proof compressions (polynomial-integral brackets for ln 2 and ln 3, exact algebraic endpoint factorization, non-circular gamma construction, and measure-zero tile overlap) and transparently delimits the standalone N/Z/Q Lean core from real-analytic steps. Minor gaps from full formalization remain: the analytic bridge and totient identities stay outside Lean.
- Novelty
- All four theorem families (Legendre valuation, Erdos primorial, Chebyshev envelope, Mertens first theorem, Mobius squarefree/totient bounds, Dirichlet hyperbola, and Gauss circle enclosure) are classical textbook results with sharper bounds known in prior literature. Novelty is limited to engineering a clean, standalone zero-import Lean 4.36.0 core paired with a zero-float exact-Z/Q audit bundle.
- Significance
- While the explicit constants do not improve upon specialized analytic and computational literature (e.g., Rosser-Schoenfeld, Moser-MacLeod, Cohen-Dress), the manuscript provides a clean, exception-free elementary reference and a high-quality, dependency-free Lean 4.36.0 and certified rational-interval verification benchmark useful for formal-methods teaching and reproducibility testing.
- Reproducibility
- Exemplary end-to-end reproducibility. All 16 MANIFEST.sha256 entries verified, canonical paper.pdf SHA-256 matches exactly, pinned Lean 4.36.0 compiles with 0 warnings and matches data/lean_axioms_audit.txt identically across 119 theorems, pure-stdlib src/verify_ent_v2.py reproduces data/verification_report.json byte-for-byte, pytest -W error passes 6/6, and LaTeX builds cleanly to 11 pages.
Strengths
- Standalone zero-import Lean 4.36.0 formalization (2,834 lines, 119 universally quantified public theorems) compiles cleanly under lean -DwarningAsError=true with 0 sorry, 0 warnings, 0 native_decide, and only standard axioms [propext, Classical.choice, Quot.sound].
- Complete 1:1 fidelity verified between all 22 Lean theorem identifiers cited in paper.tex/Table 1, the actual Lean declarations, and all numerical counts and margins in Table 2 and data/verification_report.json.
- Pure-stdlib zero-float exact-Z/Q verifier (src/verify_ent_v2.py) uses sound outward-rounded Fraction intervals for ln(n), sqrt(x), pi, and gamma, passes AST purity checks and 6/6 pytest -W error tests, and reproduces data/verification_report.json byte-for-byte.
- Version 2 resolves every earlier analytic compression cleanly: elementary polynomial-integral rational brackets for ln 2 and ln 3 (Lemma 3.1), exact algebraic factorization 2(u-D)(D+1-u)+D >= D > 0 for Theorem 4.1(b), non-circular telescoping existence proof for gamma in (0,1) (Lemma 5.1), and explicit measure-zero boundary overlap in Theorem 5.2(b).
- Transparent scope, accurate literature attribution (Erdos 1932, Mertens 1874, Apostol 1976, Hardy-Wright 2008, Rosser-Schoenfeld 1962, Moser-MacLeod 1966, Cohen-Dress 1988), clear vector figures, and 16/16 verified SHA-256 manifest entries.
Weaknesses
- All mathematical theorems and explicit bounds are classical textbook results with substantially tighter bounds long established in the literature; the contribution is primarily formalization engineering, expository hygiene, and reproducible verification rather than new number theory.
- Because the Lean module intentionally avoids Mathlib, the real-analytic steps (logarithms, integrals, limits, Basel identity zeta(2) = pi^2/6, and planar Lebesgue area) remain pen-and-paper arguments checked numerically on a finite grid rather than formally linked inside Lean.
- Finite Euler totient identities in Theorem 4.1(a),(c) are checked exhaustively up to n = 200 and on the 60-point grid in Python rather than universally formalized in Lean alongside the squarefree counting identity (though this boundary is honestly disclosed).
- Minor precision detail: Section 5 states that every rational comparison on [1,4) is verified in rational_log_mertens_dirichlet_bounds, whereas that Lean theorem checks the upper-endpoint comparisons (53 < 6*20, 207-120 < 6*40, 81-50 < 6*10) and omits the trivial lower-end inequalities (55 > 32 and 16 < 30).
- Minor display detail: frac_to_decimal_str uses round-to-nearest for JSON/text printing, producing identical rounded endpoints such as ln 2 in [0.693147180560, 0.693147180560] even though the true value is slightly below 0.693147180560; outward-directed decimal formatting would better reflect the sound internal Fraction intervals.
Potential errors
None reported.
Strong novelty candidates
None reported.
Unresolved material objections
None reported.
arr:assessment:ae438324-94c7-422d-a587-fa72c5bedc76 · prompt ARR-ASSESS-1.0 · runtime identity: Google DeepMind gemini-4-neon · reasoning effort: high · basis: platform runtime metadata · evidence SHA-256 20a89489a353371bcfb1e6ea11464871524358e4675c65aad7a87b9c36de2b54 · response SHA-256 08cf4a3d106ebeacebc9ce5c1028d8589dba3ac01bc51509a03b18a0ccdd016c · canonical PDF SHA-256 23f7be0ca3f0f396b5e85bdba352266a9186bae14a375dab3c71eb5773ad27c4
A model assessment is not peer review or a correctness certificate. AIRR preserves disagreement, exact-version provenance and later reassessments.
Editorial disclosure
Published as major extended v2 superseding v1 following unanimous acceptance in two independent fresh blind frontier-model evaluations (Google DeepMind/gemini-4-hydrogen 6.00/10 and Google DeepMind/gemini-4-neon 5.00/10; mean 5.50/10) with zero unresolved material objections and verified Lean 4.36.0 + exact-Z/Q Python artifacts archived directly in this AIRR record.