Главная / Что видно из 62 моментов / Сертификация моментов до порядка 62
"""NEW directed theta moments0,2,...,62; no old fit or file is rerun.
The analytic error proof is in wave11_independent_obstruction.txt.
Finite Phi8 Taylor quadrature on[0,2], exact rational uniform remainder
bounds, and separate positive theta-series/infinite-t tails.
"""
from pathlib import Path
from fractions import Fraction as Q
from math import comb,factorial
import mpmath as mp
import hashlib,json,time
PTH=Path(__file__).resolve().parent
mp.mp.dps=110;mp.iv.dps=95;iv=mp.iv
DEG=80;CELLS=256;MAX=62;TERMS=8
h=iv.mpf(1)/CELLS
radius=Q(1,8);ratio=Q(1,32);M=10**46
integer_bound=3**62*(32*sum(m**4 for m in range(1,9))*3**20+
12*sum(m*m for m in range(1,9))*3**11)
assert integer_bound<M
taylor=4*Q(M)*ratio**81/(1-ratio)
theta_tail=Q(4*2**62*32*2*9**4)*Q(3,8)**243
real_tail=Q(32*3**142,2**6000)
assert taylor<Q(5,10**76)
assert theta_tail<Q(1,10**78)
assert real_tail<Q(1,10**1700)
padding=Q(1,10**74)
assert taylor+theta_tail+real_tail<padding
orders=list(range(0,MAX+1,2))
acc={k:iv.mpf(0) for k in orders}
pow4=[iv.mpf(4)**j/factorial(j) for j in range(DEG+1)]
h_powers=[h**j for j in range(DEG+2)]
zero=iv.mpf(0)
start=time.monotonic()
for cell in range(CELLS):
c=iv.mpf(2*cell+1)/CELLS
ex4=iv.exp(4*c)
xs=[ex4*x for x in pow4]
ph=[iv.mpf(0) for _ in range(DEG+1)]
for m in range(1,TERMS+1):
a=iv.pi*m*m
g=[-a*x for x in xs]
g[0]+=5*c;g[1]+=5
hs=[iv.exp(g[0])]
for j in range(1,DEG+1):
hs.append(sum((l*g[l]*hs[j-l] for l in range(1,j+1)),zero)/j)
fac=[2*a*x for x in xs];fac[0]-=3
for j in range(DEG+1):
ph[j]+=a*sum((fac[l]*hs[j-l] for l in range(j+1)),zero)
# Integrate centered monomials, retaining total degree<=DEG. This is
# exactly degree-DEG Taylor integration of t^k*Phi8(t), regrouped.
A=[]
for l in range(MAX+1):
A.append(sum((ph[r]*2*h_powers[l+r+1]/(l+r+1)
for r in range(l%2,DEG-l+1,2)),zero))
cp=[c**j for j in range(MAX+1)]
for k in orders:
acc[k]+=2*sum((comb(k,l)*cp[k-l]*A[l] for l in range(k+1)),zero)
if (cell+1)%64==0:
print(json.dumps({'cells':cell+1,'elapsed_seconds':round(time.monotonic()-start,2)}),flush=True)
pad=iv.mpf(['-1e-74','1e-74'])
acc={k:x+pad for k,x in acc.items()}
assert acc[0].a>0 and acc[2].a>0
variance=acc[2]/acc[0]
mu={k:(acc[k]/acc[0])/variance**(k//2) for k in orders if k}
mu[2]=iv.mpf(1)
def ends(x):return {'display_approximation':[mp.nstr(mp.mpf(x.a),80),mp.nstr(mp.mpf(x.b),80)],
'exact_binary':[[int(y) for y in z] for z in x._mpi_]}
def fraction(q):return [str(q.numerator),str(q.denominator)]
def exact(raw):return iv.make_mpf(tuple(tuple(map(int,z)) for z in raw))
old=PTH/'direct_fit_certificate.json'
olddata=json.loads(old.read_text())
contained={}
for k in [4,6,8,10,12]:
prev=exact(olddata['theta_standardized_moments_exact_binary'][str(k)])
contained[str(k)]=bool(prev.a<mu[k].a and mu[k].b<prev.b)
assert all(contained.values())
out={
'status':'directed actual theta whole-line moments0..62 with explicit Taylor/series/real-tail bounds',
'scope':'new theta inputs only; no finite model fit, zero-location or RH assumption',
'interval_dps':iv.dps,'Taylor_degree':DEG,'cells':CELLS,'theta_terms':TERMS,'positive_cutoff':2,
'wholeline_absolute_padding':'1e-74','Cauchy_radius_exact_fraction':fraction(radius),
'Cauchy_uniform_M_integer':str(M),'Cauchy_M_crude_integer_bound':str(integer_bound),
'Taylor_wholeline_error_bound_exact_fraction':fraction(taylor),
'omitted_theta_terms_bound_exact_fraction':fraction(theta_tail),
'real_tail_bound_exact_fraction':fraction(real_tail),
'theta_wholeline_integrals':{str(k):ends(v) for k,v in acc.items()},
'theta_variance':ends(variance),
'theta_standardized_moments':{str(k):ends(v) for k,v in mu.items()},
'strictly_inside_old_standardized_intervals_through12':contained,
'old_certificate_sha256':hashlib.sha256(old.read_bytes()).hexdigest(),
'source_sha256':hashlib.sha256(Path(__file__).read_bytes()).hexdigest()}
dest=PTH/'wave11_theta62_certificate.json'
dest.write_text(json.dumps(out,indent=2)+'\n')
print(json.dumps({'status':out['status'],'certificate':dest.name,
'elapsed_seconds':round(time.monotonic()-start,2)}),flush=True)
Исходные технические записи отражают состояние работы на дату их составления. Уточнения и итоговый вывод приведены в статье.
Контрольная сумма оригинала · SHA-256
1ee897d095db45cf207df2f3759285bc427acc8c89f1522edf47646078eb8dfa