Mathematics / Formalization Note / Number Theory

Kaczorowski's Theorem in Lean 4: Under GRH, the Knapowski-Turan Chebyshev Bias Conjecture Fails

Assembles an end-to-end Lean 4 proof of Kaczorowski's theorem. The file derives a triangle-smoothed explicit formula for psi(x, chi_4) by contour shifting, proves a spectral trough lemma showing that the zero-sum profile becomes arbitrarily negative, transfers the resulting minorant to prime counts by Abel summation, and proves a logarithmic second-moment bound; the file header does not mark these as adapted. They rest on adapted Apache-2.0 components: @tkaiman's density reduction (PR #22748), @mattdorman's character lemmas and parameterized critical-line zero count with its annulus-blocked canonical-product proof (PRs #11424, #11748), a disk factorization and holomorphic logarithm from Arithmetica4, the rectangular residue theorem from PrimeNumberTheoremAnd (Zeta23 port), and a Plancherel identity from LeanClassics.

Author
Ali Uyar
DOI
10.5281/zenodo.24765114
Scope
Direct proof
Status
Merged on Left to Solve
Original theorem
Jerzy Kaczorowski, On the distribution of primes (mod 4), Analysis 15 (1995), no. 2, 159-172: assuming that every zero of L(s, chi_4) with 0 < Re s < 1 has Re s = 1/2, the set {n : pi(n; 4, 3) > pi(n; 4, 1)} does not have natural density 1, contrary to the 1962 conjecture of Knapowski and Turan. The Lean statement assumes GRH for L(s, chi_4) only and concludes exactly this; it does not address the unconditional question.
Statement source
Left to Solve (FormalConjectures / OMA statements)
Source
github.com/aliuyar1234/lean4-landmark-formalizations/tree/main/16-chebyshev-bias-knapowski-turan

Machine-checked in Lean 4 ✓ Accepted and merged on Left to Solve.

Summary

A Lean 4 proof of Jerzy Kaczorowski's 1995 theorem on Chebyshev's bias modulo 4: assuming GRH for L(s, chi_4), the set where pi(n; 4, 3) > pi(n; 4, 1) does not have natural density 1, so the 1962 Knapowski-Turan natural-density conjecture fails under GRH. A single 8,519-line file (PR #49486) proves the formal-conjectures target directly. It derives a triangle-smoothed explicit formula by contour shifting, uses a lower bound for critical-line zeros to show that the resulting zero-sum profile has arbitrarily deep troughs, transfers this to the prime race by Abel summation, and closes with a logarithmic second-moment estimate. Substantial parts of the file are adapted from credited Apache-2.0 code by other authors: the density reduction, character lemmas, the zero count via an annulus-blocked canonical product, a disk factorization, a rectangular residue theorem and a Plancherel identity.

Context

Prime number races tie the zeros of Dirichlet L-functions to biases in the distribution of primes. This proof carries contour shifting, an explicit formula and critical-line zero counting for L(s, chi_4) through to a statement about prime counts, all checked in Lean 4. The GRH hypothesis matters: Ford, Konyagin and Lamzouri showed that hypothetical zeros off the critical line could change the answer.

Root problems on Left to Solve

  • LTS ChebyshevBias.knapowski_turan_natural_density_false closed; Left to Solve credits the solution to aliuyar1234

Credits

Mathematics: J. Kaczorowski (1995), building on Knapowski-Turan (1962) and Rubinstein-Sarnak (1994). Lean proof produced with AI coding agents operated by the author (PR body: agent t3-code, model gpt-6.2-astra). Adapted Apache-2.0 code, as stated in the file header: density reduction from @tkaiman's R1 proof (PR #22748); character lemmas from @mattdorman's proof of ChebyshevBias.littlewood_mod_four_sign_changes.R1.H1.R1.H2 (PR #11424), companion Littlewood proof PR #11425, parameterized zero-multiplicity lower bound and exponential change of variables from the same author's PR #11748; local disk factorization and holomorphic logarithm from @nil-commits' Arithmetica4 via @marcusbuffett's PR #5370; rectangular residue theorem from the Zeta23 port of PrimeNumberTheoremAnd (copyright Anthropic, PBC and the PrimeNumberTheoremAnd contributors); Plancherel identity from LeanClassics.NymanPlancherel by Sky (@ChironTheCentaur) via @senamakel's port. The PR body records no other contributors.

Pull request ledger (1)

  • #49486 ChebyshevBias.knapowski_turan_natural_density_false merged

Cite

@misc{uyar2026_chebyshev_bias_knapowski_turan_lean4,
  author    = {Uyar, Ali},
  title     = {Kaczorowski's Theorem in Lean 4: Under GRH, the Knapowski-Turan Chebyshev Bias Conjecture Fails},
  year      = {2026},
  publisher = {Zenodo},
  doi       = {10.5281/zenodo.24765114},
  url       = {https://doi.org/10.5281/zenodo.24765114},
  note      = {Lean 4 formalization technical note (Jerzy Kaczorowski, On the distribution of primes (mod 4), Analysis 15 (1995), no. 2, 159-172: assuming that every zero of L(s, chi_4) with 0 < Re s < 1 has Re s = 1/2, the set {n : pi(n; 4, 3) > pi(n; 4, 1)} does not have natural density 1, contrary to the 1962 conjecture of Knapowski and Turan. The Lean statement assumes GRH for L(s, chi_4) only and concludes exactly this; it does not address the unconditional question.). Code: https://github.com/aliuyar1234/lean4-landmark-formalizations/tree/main/16-chebyshev-bias-knapowski-turan}
}