math.NT — Number Theory
Class numbers, square roots and quadratic non-residues in time , assuming the new #SAT algorithms
Basic counting 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); 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 the number of reduced forms of discriminant (for fundamental discriminants, ) and for , 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 with shared bits. The same library gives the least square root modulo any and the least quadratic non-residue modulo a prime. These are not new bounds (OpenAI's results on the quasi-Riemann hypothesis and on deterministic polynomial factorisation over give polynomial time modulo a prime), but they are machine-checked. 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 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. Version 2 corrects the claims of version 1 about non-residues and square roots.