The parity of the prime-counting function in time
Version 1 / Nov 05, 2026 / CC BY 4.0
Abstract
Computing the prime-counting function exactly takes steps by the analytic method of Lagarias and Odlyzko, and to our knowledge its parity is known faster only on short intervals: Tao, Croot and Helfgott decide whether an interval of length at most near contains an odd number of primes in time . However, their identity needs the Mobius function for all , and we know of no bound of the form for the parity, even conditionally. We present deterministic algorithms that output and the parity of the number of primes in any interval in time , where is the input bit length. Our approach replaces by its residue modulo 2, which is the squarefree indicator again: the number of chains , of depth is odd exactly when is squarefree, for . The parity of on is then the parity of one count of tuples satisfying multiplications, which Anthropic's counting engine evaluates through a network whose variables have geometrically shrinking widths. We prove both theorems in Lean 4 (piParity_TM_rate, piIntervalParity_TM_rate; axioms propext, Classical.choice, Quot.sound). The result does not give deterministic prime finding or the exact value of : the parity can be even on every interval one queries, and exact counts seem to need iterated products, for whose product-tree verifiers we prove a lower bound in Lean. The constants are astronomical, and the result rests on Anthropic's Lean development of its claimed refutation of the Exponential Time Hypothesis, which is under review.
Provenance statement
Tools used
- Anthropic
- Claude Opus
- Lean
- Lean
References
- M. Agrawal, N. Kayal, and N. Saxena, PRIMES is in P , Ann. of Math. (2) 160 (2004), no. 2, 781--793.
- Claude (Anthropic), A time algorithm for 3-SAT , preprint dated 26 October 2026. Paper and Lean formalisation in the repository https://github.com/anthropics/formal-math, folder eth ; we use commit 16a5ce41304fcdaea4e0be7c132e1c361dc26da5 .link
- R. C. Baker, G. Harman, and J. Pintz, The difference between consecutive primes, II , Proc. London Math. Soc. (3) 83 (2001), no. 3, 532--562.
- M. Deléglise and J. Rivat, Computing : the M eissel, L ehmer, L agarias, M iller, O dlyzko method , Math. Comp. 65 (1996), no. 213, 235--245.
- 1337isnot1337 (GitHub user) and contributors, integer-factoring: deterministic integer factoring bounds , public repository https://github.com/1337isnot1337/integer-factoring; Lean formalisation in formal-appendix/ (pull request #20, merged 30 October 2026).link
- J. C. Lagarias, V. S. Miller, and A. M. Odlyzko, Computing : the M eissel-- L ehmer method , Math. Comp. 44 (1985), no. 170, 537--560.
- J. C. Lagarias and A. M. Odlyzko, Computing : an analytic method , J. Algorithms 8 (1987), no. 2, 173--191.
- L. de Moura and S. Ullrich, The L ean 4 theorem prover and programming language , Automated Deduction -- CADE 28, Lecture Notes in Comput. Sci., vol. 12699, Springer, 2021, pp. 625--635.
- A. V. Lelechenko, Parity of the number of primes in a given interval and algorithms of the sublinear summation , Visn. Odes. Nats. Univ., Mat. Mekh. 18 (2013), no. 1(17), 104--114; arXiv:1305.1639.arXiv
- The mathlib Community, The L ean mathematical library , Proc. 9th ACM SIGPLAN International Conference on Certified Programs and Proofs (CPP 2020), 2020, pp. 367--381.
Show all 20 referencesShow fewer references
- OpenAI, The E xponential T ime H ypothesis is false , preprint dated 17 October 2026, revised 25 October 2026. Paper and Lean formalisation in the repository https://github.com/openai/math.link
- I. Rudich and L.-M. Rousseau, Deterministic factoring in time , Hexagon preprint hexagon:2610.00600v1, published 29 October 2026, https://hexagonmath.org/2610.00600v1.hexagon
- J. Shunia, An improved subexponential bound for deterministic integer factorization , Hexagon preprint hexagon:2610.00711v1, published 2 November 2026, https://hexagonmath.org/2610.00711v1.hexagon
- R. Sladkey, A successive approximation algorithm for computing the divisor summatory function , arXiv:1206.3369, June 2012.arXiv
- T. Tao, Deterministic way to find primes -- discussion thread , The polymath blog, 28 July 2009, https://polymathprojects.org/2009/07/28/deterministic-way-to-find-primes-discussion-thread/.link
- T. Tao, E. Croot III, and H. Helfgott, Deterministic methods to find primes , Math. Comp. 81 (2012), no. 278, 1233--1246; arXiv:1009.3956 (as D. H. J. Polymath).arXiv
- V. Tulsyan, Counting H amiltonian cycles in sparse graphs in subexponential time, assuming the new SAT algorithms , Hexagon preprint hexagon:2610.00672v1, October 2026; source and Lean development at https://github.com/xennygrimmato/eth-hamiltonicity.hexagon
- V. Tulsyan, Class numbers, square roots and quadratic non-residues in time , assuming the new SAT algorithms , preprint, November 2026; source in the directory classnumber-note/ of TulsyanRepo26 .
- V. Tulsyan, An independent machine-checked proof of deterministic factoring in time , via the new SAT algorithms , preprint, November 2026; source in the directory factoring-note/ of TulsyanRepo26 .
- V. Tulsyan, eth-hamiltonicity: L ean 4 formalisation and research notes , public repository https://github.com/xennygrimmato/eth-hamiltonicity, 2026; Lean sources as of commit f5aad1a .link
Version history
- v1 · 9 pagesSubmitted by Vaibhav TulsyanInitial depositCurrentNov 05, 2026