"""Interval certificates for the odd-profile estimate. The first part bounds the spectral majorant: the blocks [0,19/8], [19/8,22] and [22,128] and the dyadic tail beyond 128 have total below 11.27. The second part bounds the mean support length of the translated intervals and the upper relative error for the four-tent odd profile with the small prime cutoff at each listed h=2^-p, using the value 11.27 of the first part. Run with Python 3 and mpmath: python3 odd_profile_certificate.py""" from fractions import Fraction as Q from mpmath import iv I=iv.mpf # Constants of the support calculation, at 28 digits. iv.dps = 28 lam_support=iv.sqrt(I(2)) mu=lam_support*iv.ln(2) # Shared outward-rounded constants for the Fourier block certificates, at 29 digits. iv.dps = 29 lam_block = I(2)**I('.5') aa = 1+lam_block bb = lam_block cc = iv.exp((aa-1+bb)/2) / iv.sqrt(aa*iv.pi) / (aa**(lam_block/2)*bb**(1/lam_block)) def ivq(x): return I(x.numerator)/x.denominator # Everything below runs at 33 digits. iv.dps=33 # Part 1. Certified spectral majorant for four rational tent widths and variable blocks. params=((2,Q(3,10)),(3,Q(3,10)),(4,Q(1,5)),(6,Q(1,5))) ystar=I(1)/32 def sinc(x): if x.a <= 0: # The arguments here are nonnegative, and the zero-touching cell is small. return I([float((1-x.b**2/6).a)-1e-14,1]) if x.b<1 else I([-1,1]) return iv.sin(x)/x def profile(x): total=I(0) for a,weight in params: total+=ivq(weight)*8*a**2*iv.sin(a*x)*sinc(a*x/2)**2*sinc((a-I('.5'))*x) return total def bound_block(left,right,width,steps): lo,hi,W=map(ivq,(left,right,width)) gap=(hi-lo)/steps total=I(0) for k in range(steps): a=lo+gap*k b=a+gap x=I([a.a,b.b]) p=abs(profile(x)).b z=iv.pi*b/W # For the first cell z>0 at its right endpoint. Both weights are increasing. f=(((iv.exp(z)-iv.exp(-z))/(2*z))**(1/lam_block)).b total+=(p**2*max(b.b,ystar)**(2/lam_block)*f*gap).b return (cc*W**(lam_block/2)*iv.sqrt(total)).b def spectral_certificate(): high=Q(128) blocks=[(Q(0),Q(19,8),Q(3,5),2200), (Q(19,8),Q(22),Q(27,4),5200), (Q(22),high,Q(42),8200)] val=I(0) for a,b,w,n in blocks: y=bound_block(a,b,w,n) val+=y print(f'block [{a},{b}] W*h={w}, cells={n}, upper={y}',flush=True) # On a dyadic tail [B,2B], W=1.5 B and |P(y)| <= C/y^3. const=sum(ivq(weight)*32/(a-I('.5')) for a,weight in params) Wratio=I('1.5') z=2*iv.pi/Wratio f=((iv.exp(z)-iv.exp(-z))/(2*z))**(1/lam_block) # Integrate y^(-6) from B to infinity; other factors maximized at 2B. leading=cc*Wratio**(lam_block/2)*const*I(2)**(1/lam_block)*iv.sqrt(f/5) power=I('2.5')-lam_block tail=leading*ivq(high)**(-power)/(1-I(2)**(-power)) print('high dyadic tail upper',tail.b,'total incl. tail',(val+tail).b,flush=True) assert (val+tail).b < I('11.27') # Part 2. Outward-arithmetic upper bound for the mean length of translated intervals. def probability_table(n, mean): values=[iv.exp(-mean)] for i in range(n): values.append(values[-1]*mean/(i+1)) return values def walk_tables(depth, prob): # pre[t] counts a strict earliest minimum at the right end of a prefix # after reversing it. Its weight is 2 raised to the prefix count. low=[I(1)] prefix=[I(1)] for d in range(1,depth+1): low=[sum(low[i]*prob[k-i] for i in range(min(len(low),k+1))) for k in range(d)] prefix.append(sum((2**k)*v for k,v in enumerate(low))) # For a suffix record first violation at d and its weighted arrivals. # Larger totals than depth can never first violate later in the table. p=[I(1)]+[I(0)]*depth weighted=[I(0)]*(depth+1) fail=[] excess=[] unmarked=[I(1)] correction=[I(0)] for d in range(1,depth+1): rate_weight=I(2)**(-d) after=[I(0)]*depth marked=[I(0)]*depth for k in range(d-1,depth): reach=range(d-1,k+1) after[k]=sum(p[j]*prob[k-j] for j in reach) marked[k]=sum((weighted[j]+p[j]*(k-j)*rate_weight)*prob[k-j] for j in reach) fail.append(after[d-1]) excess.append(marked[d-1]) after[d-1]=marked[d-1]=I(0) p,weighted=after,marked unmarked.append(1-sum(fail)) loss=sum(excess[i]/mu+f*(I(2)**(-i-1)-rate_weight) for i,f in enumerate(fail)) correction.append(1-rate_weight-loss) return prefix,unmarked,correction def length_bound(ratio, max_depth): # Express every length in units of the large cutoff b, with H/b = ratio. prob=probability_table(max_depth+1,mu) pre,unmarked,correction=walk_tables(max_depth,prob) by_depth=[] for J in range(max_depth+1): floor_mean=lam_support*I(2)**(-J) value=sum(pre[t]*((ratio+floor_mean)*unmarked[J-t]+lam_support*I(2)**(-t)*correction[J-t]) for t in range(J+1)) by_depth.append(value) j=min(range(len(by_depth)),key=lambda k:float(by_depth[k].b)) return j,by_depth[j].b # Full interval certificate for the odd profile and the small prime cutoff. lam=iv.sqrt(I(2)) sigma=I('1.5')-lam b=I(1)/32 eta=I(43)/100 a=1+lam d=lam pi=iv.pi E=iv.exp(1) gamma_upper=I('.577216') # Half the parity-projected pair of Buchstab densities on the regular domain. omega_product=(I('.57')**2+1/(I(2)*9*40320))/2 spectral=I('11.27') exception_error=iv.exp(2-eta/b+(lam+7/lam)*(E-1)/2) def price(p): width=I(2)**(1-p) Wmin=I('.6')/width cutoff=I(1)/32/width BW=b*Wmin assert I('.5')-I('17.5')*width-eta > 2*b and (1-eta)/2>9*b depth,length=length_bound(35*width/b,p-5) finite_good=iv.exp(lam*iv.exp(-BW)/(2*BW)+2/(lam*b*cutoff)) good=omega_product*iv.exp(lam*gamma_upper)*b**(lam-I('1.5'))*iv.sqrt(length) good*=finite_good/(4*iv.sqrt(pi)*cc) extra=(I('.5')+4*iv.ln(4*BW))/BW exceptional=iv.exp(2-eta/b+(lam+(4+extra)/lam)*(E-1)/2) exceptional*=(1+a/Wmin)**(lam/2)*(1+(d/cutoff)**2)**(1/(2*lam)) scalar=2*width**sigma*((good+exceptional)*spectral+10**8*width**2*exception_error) return depth,length,scalar def support_certificate(): for p in (14,15,16,17,18,19,20,38,39,40,41,42,43,44): j,L,val=price(p) print(f'h=2^-{p} J={j} length/b<={float(L.b)+1e-12:.11f} ' f'upper relative error {val.b}',flush=True) if __name__=='__main__': spectral_certificate() support_certificate()