Research Atlas

Главная / Что видно из 62 моментов / Рациональная проверка знака формы

Программа · Python

Рациональная проверка знака формы

Что видно из 62 моментов

Программа · Pythonwave11_audit_hankel_root.py
"""Independent rational interval reconstruction from raw theta integrals.
Uses no author Python, numerical guide, author cumulant intervals or fit.
Only the final fixed rational polynomial is read from its certificate.
"""
from fractions import Fraction as F
from pathlib import Path
from math import comb,factorial
import hashlib,json

W=Path(__file__).resolve().parent; P=W/'new_rh_mechanism'
sha=lambda p:hashlib.sha256(Path(p).read_bytes()).hexdigest()
inp=P/'wave11_theta62_certificate.json'; witness=P/'wave11_hankel_obstruction_certificate.json'
t=json.loads(inp.read_text()); cdata=json.loads(witness.read_text())
assert cdata['status'].startswith('PASS') and t['Taylor_degree']==80
assert cdata['source_sha256'][inp.name]==sha(inp)
D=10**120
def rnd(x):
    lo,hi=x
    return (F((lo*D).__floor__(),D),F((hi*D).__ceil__(),D))
def pt(q): q=F(q);return q,q
def add(x,y):return rnd((x[0]+y[0],x[1]+y[1]))
def neg(x):return -x[1],-x[0]
def sub(x,y):return add(x,neg(y))
def mul(x,y):
    q=[a*b for a in x for b in y];return rnd((min(q),max(q)))
def div(x,y):
    assert y[0]>0 or y[1]<0
    return mul(x,(1/y[1],1/y[0]))
def power(x,k):
    assert x[0]>0
    return rnd((x[0]**k,x[1]**k))
def total(xs):
    out=pt(0)
    for x in xs:out=add(out,x)
    return out
def binary(z):
    s,m,e,_=map(int,z);return (-1 if s else 1)*F(m)*F(2)**e
def box(z):
    lo,hi=map(binary,z['exact_binary']);assert lo<=hi;return lo,hi
def frac(z):return F(int(z[0]),int(z[1]))
def serial(x):return [[str(v.numerator),str(v.denominator)] for v in x]

raw={int(k):box(v) for k,v in t['theta_wholeline_integrals'].items()}
assert set(raw)==set(range(0,63,2)) and raw[0][0]>0 and raw[2][0]>0
mu={0:pt(1),2:pt(1)}
for j in range(2,32):
    # Algebraic normalization using RAW integrals, unlike the author's
    # sequential interval mass/variance normalization.
    mu[2*j]=div(mul(raw[2*j],power(raw[0],j-1)),power(raw[2],j))
kap={}; rad={}
for j in range(1,32):
    kap[j]=sub(mu[2*j],total(mul(pt(comb(2*j-1,2*l-1)),mul(kap[l],mu[2*(j-l)])) for l in range(1,j)))
    rad[j]=1-sum(comb(2*j-1,2*l-1)*rad[l] for l in range(1,j))
    assert (-1)**(j-1)*rad[j]>0
lam=frac(cdata['scale_lambda_exact_fraction']);assert lam==F(27,100)
q={j:div(kap[j],pt(rad[j]*lam**j)) for j in range(1,32)}
c=list(map(F,cdata['polynomial_coefficients_ascending_exact_decimal']))
assert len(c)==16 and c[-1]==1
alpha=[F(0)]*32
for i in range(16):
    for j in range(16):alpha[i+j+1]+=c[i]*c[j]
assert alpha==list(map(frac,cdata['quadratic_functional_coefficients_exact_fraction']))
T=total(mul(pt(alpha[j]),q[j]) for j in range(1,32))
epsilon=frac(cdata['certified_negative_margin_exact_fraction'])
assert epsilon==F(1,10**36) and T[1]<-epsilon

# Rebuild the exact two-spin distribution without the theta input.
pair={}; pp={}
for j in range(1,7):
    pair[j]=F(2,3)-sum(comb(2*j-1,2*l-1)*pair[l]*F(2,3) for l in range(1,j))
    pp[j]=pair[j]/rad[j]
def determinant(M):
    if len(M)==1:return M[0][0]
    return sum((-1)**j*M[0][j]*determinant([r[:j]+r[j+1:] for r in M[1:]]) for j in range(len(M)))
pairdet={k:determinant([[pp[i+j+k] for j in range(3)] for i in range(3)]) for k in [1,2]}
assert pairdet[1]==-F(325,835982208) and pairdet[2]==-F(11675,3524500988928)

A=[F(0)]+[F(1,2**j*factorial(j)) for j in range(1,32)]
L=[F(0)]
for j in range(1,32):L.append(A[j]+9*sum(A[l]*L[j-l] for l in range(1,j)))
assert L==list(map(frac,cdata['cumulant_Lipschitz_coefficients_exact_fraction']))
C=sum(abs(alpha[j])*factorial(2*j)*L[j]/(abs(rad[j])*lam**j) for j in range(1,32))
assert C==frac(cdata['functional_Lipschitz_constant_exact_fraction'])>0
S=epsilon/(18*C)
assert 0<S<1 and S==frac(cdata['total_interaction_lower_bound_exact_fraction'])
assert F(cdata['coarse_uniform_total_interaction_lower_bound'])<=S

out={'status':'PASS independent rational raw-integral/cumulant/Hankel reconstruction',
     'exact_interval_arithmetic':'Fraction with outward decimal rounding at120places, no floating arithmetic',
     'largest_even_order':62,'matrix_dimension':16,
     'negative_form_exact_rational_enclosure':serial(T),
     'negative_margin_exact_fraction':[str(epsilon.numerator),str(epsilon.denominator)],
     'negative_form_display_only':[float(T[0]),float(T[1])],
     'pair_negative_determinants':{str(k):str(v) for k,v in pairdet.items()},
     'exact_interaction_bound_rebuilt':True,
     'coarse_interaction_lower_bound':cdata['coarse_uniform_total_interaction_lower_bound'],
     'whole_theta_quadrature_replayed':False,
     'analytic_quadrature_error_proof_read_separately':True,
     'guide_author_code_or_author_cumulant_intervals_imported':False,
     'no_general_ferromagnetic_obstruction_or_RH_claim':True,
     'input_sha256':{str(p.relative_to(W)):sha(p) for p in [inp,witness]},
     'audit_script_sha256':sha(Path(__file__))}
p=W/'wave11_hankel_independent_root_audit.json';assert not p.exists()
p.write_text(json.dumps(out,indent=2)+'\n')
print(json.dumps({k:out[k] for k in ['status','negative_form_display_only','coarse_interaction_lower_bound']}))

Исходные технические записи отражают состояние работы на дату их составления. Уточнения и итоговый вывод приведены в статье.

Контрольная сумма оригинала · SHA-256fa457ecafa616f195e892a2ced539251251c902bc3140e0f2da2596509a9bf43