# Exact symbolic part of the proof: the shell-2 main terms (deficit + shell energy) and P1. # All cancellations at orders s^0, s^1 are verified exactly here; the remaining polynomials are # exported (with exact rational/log2/sqrt2 coefficients) for interval evaluation. import sympy as sp, pickle s,v,mu,kap = sp.symbols('s v mu kap') l = sp.log(2); r2=sp.sqrt(2) def Qser(sig,n): # z e^z E1(z) = sum_{k= exp(-1/s)/2 Plo = sp.expand(1 - (1+ww)**2*(1+l*s+2*ww*s)) # need Plo >= delta*(1+l s+2 w s) for name,P in [('Pup',Pup),('Plo',Plo)]: q=sp.Poly(P,s); print(name, [sp.nsimplify(q.coeff_monomial(s**k)) for k in range(3)]) pickle.dump({'Pup':sp.srepr(sp.expand(sp.cancel(Pup/s**2))),'Plo':sp.srepr(sp.expand(sp.cancel(Plo/s**2)))},open('lemma.pkl','wb')) print("asymptotic v* =", sp.N((l+sp.Rational(3,4)*l**2)/2))