back to table · edit · history · where entries came from · files · download
2449 bytes, as of the version from 2026-11-02 01:06 (current). Recorded here, not run.
"""T664 presentation repair checks. Run with Sage and the unchanged generate.py.
sage -python repair_checks.py
Set NUMBERDB_API_KEY for access to this private draft. For the campaign wrapper,
pipe the key on stdin with NUMBERDB_KEY_FROM_STDIN=1.
Skill manifest: agents/runs/20261102T005728Z-repair-skills/manifest.json.
Both archived versions have SHA-256:
a2b28d9953264d7b0ca62663785c2952190c5be6d6d3597fd695d9a54d606278.
The generator is verified without rewriting it. No values are sent.
"""
import os,sys,json,decimal,hashlib
import numberdb.sage as numberdb
from sage.rings.rational_field import QQ
from sage.rings.real_arb import RealBallField
from sage.rings.polynomial.laurent_polynomial_ring import LaurentPolynomialRing
from sage.version import version
from generate import BertinQ
if os.environ.get('NUMBERDB_KEY_FROM_STDIN')=='1':
numberdb.configure(api_key=sys.stdin.read().strip())
doc=numberdb.table('T664')
g=BertinQ()
assert list(doc['Numbers'])==[p['k'] for p in g.enumerate()]
assert g.digits==100
for entry in doc['Numbers'].values():
assert len(decimal.Decimal(entry['number']).as_tuple().digits)==100
print('Sage',version,'Python',sys.version.split()[0],flush=True)
print('All 26 stored identities match default enumeration; all have 100 significant digits.',flush=True)
R=LaurentPolynomialRing(QQ,names=('x','y','z','k')); x,y,z,k=R.gens()
def Q(x,y,z,k):
return x+1/x+y+1/y+z+1/z+x*y+1/(x*y)+y*z+1/(y*z)+x*y*z+1/(x*y*z)-k
assert Q(x,y,z,k)==(1+x+x*y+x*y*z)*(1+z+z*y+z*y*x)/(x*y*z)-(k+4)
assert Q(x*z,y/z,z/x,k)==(x+1/x)*(y+1/y)+(x+1/x)*(z+1/z)+(y+1/y)*(z+1/z)-k
print('Both unchanged Laurent-polynomial identities hold exactly.',flush=True)
def decimal_rational(s):
t=decimal.Decimal(s).as_tuple(); n=int(''.join(map(str,t.digits)))*(-1 if t.sign else 1)
return QQ(n)*QQ(10)**t.exponent
B=RealBallField(640)
value=7*B(3).zeta()/B.pi()**2
stored=decimal_rational(doc['Numbers']['-4']['number'])
ulp=QQ(10)**decimal.Decimal(doc['Numbers']['-4']['number']).as_tuple().exponent
assert value.is_finite() and B(value.rad())<B(10)**-180
assert value.lower()>B(stored-ulp).upper() and value.upper()<B(stored+ulp).lower()
print('Independent Arb evaluation of 7*zeta(3)/pi^2 lies strictly inside the stored k=-4 interval.',flush=True)
report=g.verify(sample=None)
print(report,flush=True)
assert report.ok
print('All repair checks passed. Mathematical claims and numeric values were not changed.',flush=True)