back to table · edit · history · where entries came from · files · download
2483 bytes, as of the version from 2026-10-30 08:47 (current). Recorded here, not run.
"""Check T620's scale factors and companion relationships; no website writes.
Run: sage -python family_checks.py (alongside generate.py and checks.py).
"""
import json
import numberdb.sage as numberdb
from sage.rings.rational_field import QQ
from sage.rings.real_arb import RealBallField
from sage.env import SAGE_VERSION
from checks import contains_ball,decimal_interval
from generate import polygon_logdet
R=RealBallField(750)
conformal=numberdb.table('T554')['Numbers']['euclidean']
areas=numberdb.table('T17')['Numbers']['unit-R']
eta=numberdb.table('T506')['Numbers']['1']['number']
zeta=numberdb.table('T228')['Numbers']['-1']['number']
from sage.rings.complex_arb import ComplexBallField
assert contains_ball(zeta,ComplexBallField(750)(-1).zetaderiv(1).real())
for n in range(3,31):
a=QQ(n-2)/n;c=QQ(n-1)/(6*(n-2))
assert n*(1/a-a)/24==c
h=QQ(1)/n
logR=R(1+h).log_gamma()+R(a).log_gamma()-R(1-h).log_gamma()
assert contains_ball(conformal[str(n)],(-logR).exp())
area=n*R(2*R.pi()/n).sin()/2
text=areas[str(n)]
if isinstance(text,dict):text=text['number']
if '.' not in text:
assert area.overlaps(R(QQ(text)))
else:
assert contains_ball(text,area)
# Compare two ways to specify a dilated polygon: use physical R=t in
# A-S equation (24), or apply the zeta scaling law to the unit-radius value.
for t in [R(2),1/(2*(R.pi()/n).sin()),1/area.sqrt()]:
direct=2*c*(logR-t.log())+R(n).log()/(3*(n-2))
from generate import corner
direct-=n*corner(a,750)
scaled=polygon_logdet(n,750)-2*c*t.log()
assert direct.overlaps(scaled) and direct.is_finite() and direct.accuracy()>680
sq=polygon_logdet(4,750).exp()*R(2)**(QQ(3)/4)
assert contains_ball(eta,sq)
# Exact rational comparison of the two special-case closed forms with
# the integral-free finite computation.
for n,expected in [(3,R(QQ(1)/3).log_gamma()-QQ(2)/3*R.pi().log()-QQ(11)/12*R(3).log()),
(4,R(QQ(1)/4).log_gamma()-QQ(7)/4*R(2).log()-QQ(3)/4*R.pi().log())]:
assert expected.overlaps(polygon_logdet(n,750))
# Uniform bound for the small-x omitted Bernoulli-series terms.
a=R(QQ(1)/3);delta=R(QQ(1)/8);ratio=delta/(2*R.pi()*a)
remainder=8*a/delta**2*ratio**224/((1-ratio**2)*222)
assert remainder<R(QQ(1)/10**269)
print(json.dumps({'table':'T620','polygon_scale_and_heat_checks':28,'T554_checks':28,
'T17_checks':28,'T506_square_check':True,'T228_zeta_check':True,'closed_forms':2,
'small_x_remainder_bound':str(remainder),'sage':SAGE_VERSION,'numberdb':numberdb.__version__}))