research/lab/py/totient-constant
0 directories and 2 files in research/lab/py/totient-constant.
totient-constant
- The node count of the spun stacks is a totient sum over ideals, and this study proves its constant instead of fitting it.
- It serves
lab/py/spun-stack(the Gaussian stack, node count 672, 10608, 168088 at norm bounds 50, 200, 800) andlab/py/eisenstein-stack(the hexagonal stack, 630, 9606, 151020, 337026, 945486, 2419950 at 50, 200, 800, 1200, 2000, 3200), whose limit constants were Conjecture and are now Proved. - Everything is recounted from scratch here, twice: once by enumerating associate classes and factoring norms, once by the norm-indexed Dirichlet series, which is the route that also carries class number above one.
THE THEOREM
- Let
Kbe an imaginary quadratic field with ring of integersO_K, class numberh, unit group of orderw, and discriminantD_K. WriteNfor the ideal norm andPhi(a) = |(O_K/a)^*| = N(a) prod_{p | a} (1 - 1/N(p)). - Proved:
sum_{N(a) <= N} Phi(a) = (rho_K/(2 zeta_K(2))) N^2 + O(N^(3/2))withrho_K = 2 pi h/(w sqrt |D_K|)the ideal density, the sum running over nonzero ideals. - At
h = 1nonzero ideals are nonzero associate classes, which is the spun stacks' index set. - Proved: for
K = Q(i),h = 1,w = 4,|D_K| = 4, the constant ispi/(8 zeta(2) G) = 0.260634696495withGCatalan's constant. - Proved: for
K = Q(sqrt -3),h = 1,w = 6,|D_K| = 3, the constant ispi/(6 sqrt 3 zeta(2) L(2, chi_-3)) = 0.235217881630. - The error
O(N^(3/2))is the one derived below and is weaker than the two-signed deviations the two studies print, which are of sizeN log N; those deviations sit inside the theorem and are not claimed to be its true order.
CONVENTIONS
- The sum is over nonzero integral ideals throughout; at class number one the unit group acts freely on nonzero elements, each class holds exactly
welements, and ideals and associate classes are the same monoid. Phiis the ideal totient, the order of the unit group ofO_K/a, and it is multiplicative because the Chinese remainder theorem splitsO_K/a.mu_Kis the ideal Mobius function,(-1)^kon a squarefree product ofkprime ideals and0otherwise.- The Gaussian window is
a + b iwitha >= 1andb >= 0, one representative per class; the Eisenstein window isa + b omegaminimal in its orbit under the six units,omegaacting as(a, b) -> (-b, a - b)and-1as(a, b) -> (-a, -b). - Norm bound
Nthroughout, never a radius: the height|q| <= Tof a complex Farey fraction is the norm boundN = T^2.
THE IDEAL COUNT
- Lemma, Proved:
A(t) = #{a : N(a) <= t} = rho_K t + E(t)with|E(t)| = O(sqrt t)andrho_K = 2 pi h/(w sqrt |D_K|). - First the principal ideals.
O_Kis a rank two lattice inCof covolumesqrt |D_K|/2, so counting its points in the disc of radiusR = sqrt tby attaching to each point its fundamental cell, of diameterdelta, gives cells contained in the disc of radiusR + deltaand covering the disc of radiusR - delta; dividing the two areas by the covolume gives2 pi t/sqrt |D_K| + O(sqrt t)lattice points, and removing the origin and dividing bywgives2 pi t/(w sqrt |D_K|) + O(sqrt t)principal ideals, with an effective implied constant,4 pi delta/(w sqrt |D_K|)at leading order. - Then one class at a time. Fix an ideal class
Cand an integral idealainC^-1; the mapb -> a b = (x)is a bijection from the integral ideals ofCof norm at mosttto the nonzero elements ofaof norm at mostt N(a), taken up to units, since(x) a^-1is integral exactly whenxlies ina. ais a lattice of covolumeN(a) sqrt |D_K|/2, so the same cell argument gives2 pi t/(w sqrt |D_K|) + O(sqrt t)ideals in every class alike, and summing thehclasses gives the lemma.- This is the Gauss circle count for
Z[i]and the hexagonal count forZ[omega], whose closed formssum_j (floor(t/(4j+1)) - floor(t/(4j+3)))andsum_j (floor(t/(3j+1)) - floor(t/(3j+2)))are Verified inlab/py/spun-stackandlab/py/eisenstein-stack; the lemma above is derived here from the lattice and cites neither. rho_Kis also the residue ofzeta_Kats = 1given by the class number formula, which is the cross-check:pi/4forQ(i)andpi/(3 sqrt 3)forQ(sqrt -3).
THE CONVOLUTION STEP
- The method is Dirichlet convolution followed by Abel summation, not a hyperbola split: the whole range of the ideal
bis summed and the inner sum is estimated uniformly. - Proved:
Phi = N * mu_Kas a Dirichlet convolution on ideals, since both sides are multiplicative and on a prime power(N * mu_K)(p^k) = N(p)^k - N(p)^(k-1) = Phi(p^k); equivalentlysum_a Phi(a) N(a)^-s = zeta_K(s - 1)/zeta_K(s). - Hence
S(N) = sum_{N(a) <= N} Phi(a) = sum_{N(b) <= N} mu_K(b) T(N/N(b))withT(X) = sum_{N(c) <= X} N(c). - Abel summation on the lemma gives
T(X) = X A(X) - int_0^X A(u) du = (rho_K/2) X^2 + X E(X) - int_0^X E(u) du, so|T(X) - (rho_K/2) X^2| <= (5/3) C X^(3/2)withCthe constant of the lemma. - The main term is
(rho_K/2) N^2 sum_{N(b) <= N} mu_K(b) N(b)^-2, and the tailsum_{N(b) > N} N(b)^-2 = O(1/N)by Abel summation onA(u) = O(u), so the main term is(rho_K/(2 zeta_K(2))) N^2 + O(N). - The error term is at most
(5/3) C N^(3/2) sum_{N(b) <= N} N(b)^(-3/2) <= (5/3) C zeta_K(3/2) N^(3/2), finite becausezeta_K(s)converges fors > 1. - Adding the two gives the theorem, with an effective implied constant
(5/3) C zeta_K(3/2) + O(1). - Proved, conditional refinement: if the lemma holds with
E(t) = O(t^theta)for some0 < theta < 1, the same three steps give errorO(N^(1 + theta)); the elementarytheta = 1/2is the one derived here, and no sharper circle exponent is claimed. The lower constraint is not decoration: attheta = 0the error layer needszeta_K(1), which diverges, and the conclusion drops toO(N log N).
THE CONSTANTS
zeta_K(s) = zeta(s) L(s, chi_D)for a quadratic field,chi_Dthe Kronecker symbol of the discriminant, sozeta_K(2) = zeta(2) GforQ(i)andzeta(2) L(2, chi_-3)forQ(sqrt -3).c = rho_K/(2 zeta_K(2)) = pi h/(w sqrt |D_K| zeta(2) L(2, chi_D)), which ispi/(8 zeta(2) G)andpi/(6 sqrt 3 zeta(2) L(2, chi_-3)).mainprints, at 50 working digits through the Hurwitz formL(2, chi_D) = |D_K|^-2 sum_a chi_D(a) zeta(2, a/|D_K|)with Euler-Maclaurin andpiby Machin:zeta(2) = 1.644934066848,G = 0.915965594177,L(2, chi_-3) = 0.781302412896,zeta_K(2) = 1.506703009923and1.285190955484,rho_K = 0.785398163397and0.604599788078, and the constants0.260634696495and0.235217881630.- Those two agree with the values
lab/py/spun-stackandlab/py/eisenstein-stackprint,0.260635and0.235217881630015, which are now derived rather than fitted. class_numberderiveshfrom the finite character sumh = w (-sum_a chi_D(a) a)/(2 |D_K|), returning 1, 1, 2 and 3 atD_K = -4, -3, -20, -23, so the constant is assembled fromw,|D_K|,handL(2, chi_D)alone.
THE GENERAL FIELD
- Proved: the theorem holds for every imaginary quadratic field, of any class number. The convolution step never sees the class number, and the lemma is proved above one ideal class at a time.
- Verified: at
D_K = -20,h = 2, the constant is0.378582556790and the count at norm bound 102400 is 3969730264, ratio1.000001116781; atD_K = -23,h = 3, the constant is0.425700255391and the count is 4463281160, ratio0.999885848149(norm_totient_sum). - Proved as an implication only: for a general number field, with ideals throughout, the convolution step is unchanged and gives
(rho_K/(2 zeta_K(2))) N^2 + O(N^(1 + theta))for any ideal countA(t) = rho_K t + O(t^theta)with0 < theta < 1; that ideal count is not derived here, so nothing about degree above two is claimed outright.
THE FAREY CONVENTION
- The lit set of the spun stack is the complex Farey set: Sayous arXiv:2407.04380 Section 2 defines
F_t = {pr_{O_K}(p/q) : p, q in O_K, p O_K + q O_K = O_K, 0 < |q| <= e^(t/2)}insideC/O_Kand statescard F_t ~ c_K e^(2t)withc_K = pi/(sqrt |D_K| zeta_K(2)), attributed there to Cosentino, Ergodic Theory Dynam. Systems 19 (1999) 1437-1484, Theorem 4. - Since
|q| <= e^(t/2)is the norm boundN = e^t, the two conventions are: counting denominators as ideals givespi/(w sqrt |D_K| zeta_K(2)) = rho_K/(2 zeta_K(2)), and counting them as elements givespi/(sqrt |D_K| zeta_K(2)), exactlywtimes larger,w = 4forZ[i]and6forZ[omega]. - Verified:
farey_setbuilds the setF_titself, layer by layer as the union of the latticesq^-1 O_KmoduloO_Kover all classes of norm at mostN, deduplicating points in exact integer coordinates, and returns 672, 10608, 168088 forZ[i]and 630, 9606, 151020 forZ[omega]at norm bounds 50, 200, 800, equal in all six cases to the totient sum. F_tis written as a set of points of the torus, so its cardinality is the ideal one; the factorwis inherited from the cited Cosentino statement rather than chosen, andc_K e^(2t)is the size of the family indexed by element denominators, in which each point repeats once per associate of its denominator.
WHAT IT PRINTS
classesenumerates one representative per nonzero associate class in each field, 80414 Gaussian and 61914 Eisenstein classes of norm at most 102400.totientcomputesPhifrom the factorisation of the norm alone, splitting rational primes into ramified, inert and split, a splitpcontributing(1 - 1/p)^2exactly whenpdivides both coordinates.totient_sumreads the prefix array built bytablesand returns 672, 10608, 168088, 372872, 1045088, 2663864, 42663808, 683283504, 2732257376 forQ(i)and 630, 9606, 151020, 337026, 945486, 2419950, 38560362, 616981926, 2466558234 forQ(sqrt -3)at norm bounds 50, 200, 800, 1200, 2000, 3200, 12800, 51200, 102400, matching the published counts oflab/py/spun-stackandlab/py/eisenstein-stackat all nine bounds where they overlap.mainprintscount/(c N^2)at those bounds:1.031329, 1.017516, 1.007684, 0.993494, 1.002445, 0.998113, 0.999097, 1.000066, 0.999746forQ(i)and1.071347, 1.020968, 1.003192, 0.995017, 1.004904, 1.004699, 1.000578, 1.000604, 1.000049forQ(sqrt -3), oscillating about 1 rather than approaching it from one side.mainprints the deviation scaled by the derived error,(count - c N^2)/N^(3/2), never larger than0.119in absolute value across both fields and all nine bounds, and the same deviation scaled byN log N, which reproduces the+0.214, +0.186, +0.090, -0.198, +0.304, +0.438oflab/py/eisenstein-stack.convolution_sumre-evaluates the same totient sum assum_{N(b) N(c) <= N} mu_K(b) N(c)from an independently computedmu_K, agreeing at all nine bounds in both fields, which is the numerical form ofPhi = N * mu_K.farey_setcounts the complex Farey set directly, 672, 10608, 168088 and 630, 9606, 151020 at norm bounds 50, 200, 800.norm_arraysandnorm_totient_sumrecount by norm alone, with no lattice: the ideals of normnnumbersum_{d | n} chi_D(d), the ideal Mobius function by norm ismu * (mu chi_D)from1/zeta_K = (1/zeta)(1/L), andS(N) = sum_k m(k) T(N/k). This agrees with the class route at all eighteen bounds of the two class-number-one fields and supplies the tables atD_K = -20and-23.
RUN
uv run python research/lab/py/totient-constant/totient_constant.py- From the repo root. One core, about a second, standard library only.
- Domain is norm bounds up to 102400 for the counts, up to 800 for the direct Farey set, four discriminants for the general statement, and the constants at 50 working digits.
- Writes nothing.
WITNESSES
- The theorem's constant:
mainagainst the counts oftotient_sumat nine norm bounds in both fields, with the ratio and both scaled deviations. - The recount:
totient_sumagainst the published counts oflab/py/spun-stackandlab/py/eisenstein-stack, nine matches, no mismatch. - The convolution
Phi = N * mu_K:convolution_sumagainsttotient_sum, eighteen agreements. - Class number above one:
norm_totient_sumatD_K = -20and-23, ratios1.000001116781and0.999885848149at norm bound 102400, withclass_numberderivingh = 2and3. - The Farey convention:
farey_setagainsttotient_sum, six agreements, settling that the set convention carriesrho_K/(2 zeta_K(2))and the element conventionwtimes that.
- README.md12.3 kB
- totient_constant.py9.5 kB