repair-20261109-check.py

back to table · edit · history · where entries came from · files · download

2652 bytes, as of the version from 2026-11-09 14:49 (current). Recorded here, not run.

"""Check the weight-24 a_2 intervals in numberdb.org/T690.
Run: sage -python repair-check.py
This checks the repaired comment only; it does not recompute L-values.
"""
import hashlib
import json
from pathlib import Path
import numberdb.sage as numberdb
from sage.symbolic.ring import SR  # Initialize symbolic functions used by lazy power series.
from sage.modular.modform.constructor import CuspForms
from sage.rings.rational_field import QQ
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.rings.real_arb import RealBallField
from sage.env import SAGE_VERSION

R = PolynomialRing(QQ, 'X')
X = R.gen()
control = R(CuspForms(1, 12).hecke_matrix(2).charpoly())
assert control == X + 24
space = CuspForms(1, 24)
assert space.dimension() == 2
actual = R(space.hecke_matrix(2).charpoly())
expected = X**2 - 1080*X - 20468736
assert actual == expected
assert expected.is_irreducible()
B = RealBallField(512)
root_offset = B(20760336).sqrt()
roots = [B(540) - root_offset, B(540) + root_offset]
intervals = [(-4017,-4016), (5096,5097)]
records = []
for index, (root, (left, right)) in enumerate(zip(roots, intervals), 1):
    assert root.is_finite()
    assert root > left and root < right
    assert B(root.rad()) < B(2)**(-490)
    assert expected(left) * expected(right) < 0
    derivative = expected.derivative()
    assert derivative(left) * derivative(right) > 0
    records.append({'i': index, 'a2_enclosure': str(root), 'isolating_interval': [left, right],
                    'P_at_endpoints': [str(expected(left)), str(expected(right))],
                    'derivative_at_endpoints': [str(derivative(left)), str(derivative(right))],
                    'radius_less_than_2_power_minus_490': True})
assert roots[0] < roots[1]
print(json.dumps({'table':'T690', 'scope':'Independent exact and ball checks for comment-roster only; no L-values recomputed or altered.',
                  'skill_manifest':'agents/runs/20261109T131410Z-repair-skills/manifest.json',
                  'skill_sha256': {'local':'886390324dd1971e381a43cf3b46b822ab0bc67d62f31d8481e29ec79556746b', 'live':'886390324dd1971e381a43cf3b46b822ab0bc67d62f31d8481e29ec79556746b'},
                  'sage_version':SAGE_VERSION,'working_bits':512,'weight_12_control':str(control),
                  'weight_24_dimension':int(space.dimension()), 'hecke_T2_characteristic_polynomial':str(actual),
                  'irreducible':True, 'roots':records, 'ordering':'increasing a_2, as in the live parameter definition',
                  'script_sha256':hashlib.sha256(Path(__file__).read_bytes()).hexdigest(), 'all_checks_passed':True}, indent=2))