back to table · edit · history · where entries came from · files · download
3663 bytes, as of the version from 2026-10-24 20:04 (current). Recorded here, not run.
"""Check the retained normalization and zig-zag formula -- numberdb.org/T464.
Run with SageMath and the numberdb package installed:
sage -python check_t464_repair.py T464-before.json
In the campaign:
agents/sage.sh check_t464_repair.py T464-before.json
With no argument the adjacent T464-before.json is read. No credentials or
network access are needed. Brown--Schnetz, arXiv:1208.1890v2, Theorem 1.1,
gives the zig-zag formula; the paper also identifies Z_3 with the wheel with
three spokes. This checks nine stored decimal intervals using 512-bit Arb,
independent of the original generator's PARI evaluations. It does not
reintegrate the graphs or certify the other 843 entries.
"""
import json
import sys
from decimal import Decimal
from math import factorial
from pathlib import Path
import numberdb.sage as numberdb
from sage.rings.rational_field import QQ
from sage.rings.real_arb import RealBallField
def exact_decimal(text):
decimal = Decimal(text)
numerator, denominator = decimal.as_integer_ratio()
midpoint = QQ(numerator) / QQ(denominator)
ulp = QQ(10) ** int(decimal.as_tuple().exponent)
return midpoint, ulp
def check(document):
field = RealBallField(512)
control = field(2).zeta() - field.pi() ** 2 / 6
assert control.is_finite() and control.contains_zero()
assert field(control.rad()) < field(10) ** -140
assert not (field(2).zeta() - field.pi() ** 2 / 5).contains_zero()
assert list(document['Parameters']) == ['loops', 'index']
count = sum(len(group) for group in document['Numbers'].values())
assert count == 852
entry = document['Numbers']['3']['1']
assert '$6\\zeta(3)$' in entry['comment']
assert 'zigzag' in document['Formulas']
results = []
for loops in range(3, 12):
coefficient = (
QQ(4 * factorial(2 * loops - 2))
/ QQ(factorial(loops) * factorial(loops - 1))
* (1 - QQ(1 - (-1) ** loops) / QQ(2 ** (2 * loops - 3)))
)
if loops == 3:
assert coefficient == 6
computed = field(coefficient) * field(2 * loops - 3).zeta()
stored = document['Numbers'][str(loops)]['1']
text = stored['number'] if isinstance(stored, dict) else stored
midpoint, ulp = exact_decimal(text)
assert computed.is_finite()
assert field(computed.rad()) < field(ulp) * field(10) ** -40
assert computed > field(midpoint - ulp)
assert computed < field(midpoint + ulp)
discrepancy = (computed - field(midpoint)) / field(ulp)
assert abs(discrepancy) < field(QQ(1) / 2)
if loops == 3:
assert computed + 2 * field(ulp) > field(midpoint + ulp)
results.append({
'entry': [loops, 1],
'exact_zeta_coefficient': str(coefficient),
'discrepancy_in_last_place_units': str(discrepancy),
'ball_radius_in_last_place_units': str(field(computed.rad()) / field(ulp)),
'strictly_inside_stored_interval': True,
})
return {
'table': 'T464',
'checked_entries': len(results),
'total_entries': count,
'working_bits': 512,
'control_zeta_2': 'passed',
'negative_controls': 'passed',
'P_3_1_coefficient': 6,
'P_3_1_entry_comment_retains_identity': True,
'limitation': 'Checks the nine zig-zag evaluations, not all graph integrals or all 852 entries.',
'results': results,
}
if __name__ == '__main__':
path = Path(sys.argv[1]) if len(sys.argv) > 1 else Path(__file__).with_name('T464-before.json')
print(json.dumps(check(json.loads(path.read_text())), indent=2))