back to table · edit · history · where entries came from · files · download
1926 bytes, as of the version from 2026-11-27 09:27 (current). Recorded here, not run.
"""Consistency with live companion snapshots, not independent evidence."""
import json
from pathlib import Path
from fractions import Fraction
from decimal import Decimal
import numberdb.sage as numberdb
from sage.rings.rational_field import QQ
from sage.rings.real_arb import RealBallField
R = RealBallField(640)
root = Path(__file__).resolve().parent
def interval(text):
if isinstance(text, dict):
text = text['number']
f = Fraction(text)
u = Fraction(Decimal(1).scaleb(Decimal(text).as_tuple().exponent))
return R(QQ(f.numerator)/f.denominator).add_error(R(QQ(u.numerator)/u.denominator))
def main():
volumes = json.loads((root/'T822-document.json').read_text())['Numbers']
heights = json.loads((root/'T823-document.json').read_text())['Numbers']
entries = json.loads((root/'stored-entries.json').read_text())
count = 0
for e in entries:
cell, p = str(e['params']['cell']), str(e['params']['p'])
q, N, M = {'tetrahedron':(3,4,24), 'cube':(3,8,48), 'octahedron':(4,6,48)}[cell]
assert set(volumes[cell][p]) == {'cell','chamber'}
V = interval(volumes[cell][p]['cell'])
v = interval(volumes[cell][p]['chamber'])
h = interval(heights[cell][p])
assert V.overlaps(M*v)
A = (q-2)*R.pi()-2*q*R.pi()/int(p)
d = N*A*((2*h).sinh()+2*h)/(4*V)
assert d.is_finite() and d.accuracy() > 300
assert d.overlaps(interval(e['number']))
count += 1
for cell, first in [('tetrahedron',7),('cube',7),('octahedron',5)]:
assert list(volumes[cell]) == list(heights[cell]) == [str(p) for p in range(first,31)]
print('FAMILY_JSON='+json.dumps({'table':'T824','companion_inputs':['T822','T823'],
'entries_checked':count,'same_arguments':True,'density_intervals_overlap':True,
'independent_evidence':False,'siblings_edited':False}))
if __name__ == '__main__':
main()