back to table · edit · history · where entries came from · files · download
3522 bytes, as of the version from 2026-10-26 23:22 (current). Recorded here, not run.
"""Read-only T531 repair check. Run: sage -python repair_check.py
Keep generate.py and repair-20261026T231411Z-document.json beside this file.
Instruction manifest: agents/runs/20261026T231411Z-repair-skills/manifest.json.
All skill versions have SHA-256 b4d51ded0d52cfe3dcc0859de0845c3879b0c2363273ba7e809a7e06ded40b18.
This is repair evidence, not an independent argument-selection verdict.
"""
import json, pathlib, hashlib, importlib.metadata
from sage.env import SAGE_VERSION
from fractions import Fraction
import numberdb.sage as numberdb
from sage.rings.rational_field import QQ
from sage.rings.real_arb import RealBallField
from sage.rings.complex_arb import ComplexBallField
import generate
base=pathlib.Path(__file__).resolve().parent
doc=json.loads((base/'repair-20261026T231411Z-document.json').read_text())
gen=generate.AiryZeta()
assert gen.digits==100
assert [p['n'] for p in gen.enumerate()]==list(doc['Numbers'])==[str(n) for n in range(2,21)]
# Independent Taylor division of Ai'/Ai using Ai''=z Ai and direct
# Arb initial values. No Gamma ratios or Riccati recurrence are imported.
B=RealBallField(700)
C=ComplexBallField(700)
ai=C(0).airy_ai(); aip=C(0).airy_ai_prime()
assert ai.imag().is_zero() and aip.imag().is_zero()
a=[ai.real(), aip.real(), B(0)]
for k in range(1,19):
a.append(a[k-1]/B((k+2)*(k+1)))
q=[]
for m in range(20):
rhs=B(m+1)*a[m+1]
rhs-=sum((a[j]*q[m-j] for j in range(1,m+1)),B(0))
q.append(rhs/a[0])
# Same division algorithm control, 1/(3-z), has known coefficients.
control=[]
for m in range(20):
rhs=B(1 if m==0 else 0)+(control[m-1] if m else B(0))
control.append(rhs/B(3))
assert B(control[-1].rad()) < B('1e-200')
assert control[-1].is_finite() and (control[-1] - B(QQ(1)/QQ(3)**(m+1))).contains_zero()
results=[]
for n in range(2,21):
s=doc['Numbers'][str(n)]
mantissa,_,exponent=s.lower().partition('e'); exponent=int(exponent or 0)
places=len(mantissa.partition('.')[2]);ulp=QQ(10)**(exponent-places)
fraction=Fraction(s);center=QQ(fraction.numerator)/QQ(fraction.denominator)
low,high=center-ulp,center+ulp
g=gen.value({'n':str(n)},gen.digits)
ind=(-1)**(n-1)*q[n-1]
assert g.is_finite() and ind.is_finite() and g>0 and ind>0
assert g>low and g<high and ind>low and ind<high
assert g.overlaps(ind)
assert B(g.rad())/B(abs(g.center()))<B('4.3e-122')
assert B(ind.rad())/B(abs(ind.center()))<B('1e-190')
results.append({'n':n,'generator_inside_stored_interval':True,'independent_inside_stored_interval':True,'overlap':True,'generator_relative_radius':str(g.rad()/abs(g.center())),'independent_relative_radius':str(ind.rad()/abs(ind.center()))})
print(json.dumps({'table':'T531','instruction_manifest':'agents/runs/20261026T231411Z-repair-skills/manifest.json','skill_sha256':'b4d51ded0d52cfe3dcc0859de0845c3879b0c2363273ba7e809a7e06ded40b18','generate_sha256':hashlib.sha256((base/'generate.py').read_bytes()).hexdigest(),'sage_version':SAGE_VERSION,'numberdb_version':importlib.metadata.version('numberdb'),'entries_checked':len(results),'selection':'integers 2 through 20','new_values':False,'argument_uncertainty':'Exact integer orders; no rounded root arguments. Arb encloses Ai(0), Ai prime(0), exact rational Gamma arguments and cube-root exponent, and propagates all uncertainty.','independent_method':'700-bit Taylor division of Ai prime / Ai, direct Arb Airy initial values','control':'1/(3-z): all coefficients through degree 19 enclose 3^(-m-1)','results':results},indent=2))