Class numbers, square roots and quadratic non-residues in time , assuming the new #SAT algorithms
Version 1 / Nov 05, 2026 / CC BY 4.0
Abstract
Basic problems of computational number theory have proven deterministic bounds that are fixed powers of the input. The class number of an imaginary quadratic discriminant takes steps unconditionally and under the generalised Riemann hypothesis (GRH); the least quadratic non-residue modulo a prime takes by Burgess's 1957 bound, polynomial only under GRH; exact divisor sums take . However, none of these bounds is of the form , even conditionally. We present deterministic algorithms in time , where is the input bit length, for six such problems: the number of reduced forms of discriminant , for fundamental discriminants ; the least square root of modulo any ; the least quadratic non-residue modulo a prime; and , and the Gauss circle count. Our approach writes each answer as a count of solutions of equations with one or two products and evaluates it with Anthropic's counting engine through one network library: products by a two-dimensional Schönhage-Strassen network, sums by signed carry chains, inequalities by comparison chains, with shared bits. We prove the seven resulting theorems in Lean 4 (for example hForm_TM_rate; axioms propext, Classical.choice, Quot.sound): a finite-alphabet Mathlib Turing machine outputs the answer within steps on every input. Lean proves the count of Gauss's reduced forms; its equality with the ideal class number of is classical and not formalised. The constants are astronomical, the machines use exponential space, and every 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
- N. C. Ankeny, The least quadratic non residue , Ann. of Math. (2) 55 (1952), 65--72.
- 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
- E. Bach, Explicit bounds for primality testing and related problems , Math. Comp. 55 (1990), no. 191, 355--380.
- E. Bach and J. Shallit, Algorithmic Number Theory, Vol. 1: Efficient Algorithms , MIT Press, Cambridge, MA, 1996.
- D. A. Buell, Binary Quadratic Forms: Classical Theory and Modern Computations , Springer-Verlag, New York, 1989.
- D. A. Burgess, The distribution of quadratic residues and non-residues , Mathematika 4 (1957), 106--112.
- D. A. Burgess, On character sums and primitive roots , Proc. London Math. Soc. (3) 12 (1962), 179--192.
- M. Cipolla, Un metodo per la risoluzione della congruenza di secondo grado , Rend. Accad. Sci. Fis. Mat. Napoli (3) 9 (1903), 154--163.
- H. Cohen, A Course in Computational Algebraic Number Theory , Graduate Texts in Mathematics, vol. 138, Springer-Verlag, Berlin, 1993.
- D. A. Cox, Primes of the Form : Fermat, Class Field Theory, and Complex Multiplication , 2nd ed., John Wiley & Sons, Hoboken, NJ, 2013.
Show all 33 referencesShow fewer references
- D. Harvey, An exponent one-fifth algorithm for deterministic integer factorisation , Math. Comp. 90 (2021), no. 332, 2937--2950.
- J. L. Hafner and K. S. McCurley, A rigorous subexponential algorithm for computation of class groups , J. Amer. Math. Soc. 2 (1989), no. 4, 837--850.
- 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
- Y. Lamzouri, X. Li, and K. Soundararajan, Conditional bounds for the least quadratic non-residue and related problems , Math. Comp. 84 (2015), no. 295, 2391--2412; corrigendum, Math. Comp. 86 (2017), 2551--2554.
- 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.
- H. W. Lenstra, Jr., On the calculation of regulators and class numbers of quadratic fields , Journées Arithmétiques 1980 (J. V. Armitage, ed.), London Math. Soc. Lecture Note Ser., vol. 56, Cambridge Univ. Press, 1982, pp. 123--150.
- H. W. Lenstra, Jr., Algorithms in algebraic number theory , Bull. Amer. Math. Soc. (N.S.) 26 (1992), no. 2, 211--244.
- D. Li, Computing the divisor summatory function in , arXiv:2609.29949, September 2026.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.
- A. S. Mosunov and M. J. Jacobson, Jr., Unconditional class group tabulation of imaginary quadratic fields to , Math. Comp. 85 (2016), no. 300, 1983--2009.
- 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
- M. O. Rabin, Digitalized signatures and public-key functions as intractable as factorization , Technical Report MIT/LCS/TR-212, MIT Laboratory for Computer Science, January 1979.
- 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
- R. J. Schoof, Quadratic fields and factorization , Computational Methods in Number Theory, Part II (H. W. Lenstra, Jr. and R. Tijdeman, eds.), Mathematical Centre Tracts, vol. 155, Mathematisch Centrum, Amsterdam, 1982, pp. 235--286.
- R. Schoof, Elliptic curves over finite fields and the computation of square roots mod , Math. Comp. 44 (1985), no. 170, 483--494.
- D. Shanks, Five number-theoretic algorithms , Proc. Second Manitoba Conference on Numerical Mathematics (Winnipeg, 1972), Congressus Numerantium VII, Utilitas Math., 1973, pp. 51--70.
- 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, E. Croot III, and H. Helfgott, Deterministic methods to find primes , Math. Comp. 81 (2012), no. 278, 1233--1246.
- A. Tonelli, Bemerkung über die Auflösung quadratischer Congruenzen , Nachr. Königl. Ges. Wiss. Göttingen (1891), 344--346.
- 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, 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 b9ea3f1 .link
Version history
- v1 · 11 pagesSubmitted by Vaibhav TulsyanInitial depositCurrentNov 05, 2026