"""Independent rank-three exceptional-row certificate using the half-sum.""" from fractions import Fraction as F from itertools import product from math import isqrt if not __debug__: raise RuntimeError("Use ordinary Python execution so the exact checks run.") def sextic_margins(Q,a,b,c): d, e=b-3*Q,c-2*Q*a return (a*a*d*d-4*d**3-4*a**3*e-27*e*e+18*a*d*e,36*Q-a*a, b+Q,(b+9*Q)**2-16*Q*a*a,4*Q*(b+Q)**2-(c+2*Q*a)**2) def rank3(P): q,g,Q=2,3,8 evaluate=lambda t:sum(c*t**i for i,c in enumerate(P)) lam=F(1,2**(g+1))*evaluate(F(1,2))/evaluate(F(1,4)) U=[F(0)]*(2*g+3) for j,c in enumerate(P): U[j]+=c*(1-lam) U[j+1]-=c*(q*q*(1-q*lam)+F(q**j*(q*q-1),2*q**(g-1))*lam) full=[U[j]+F(Q)**(j-g-1)*U[-j-1] for j in range(len(U))] result=[F(0)]*(2*g+1) for j in range(len(result)): result[j]=full[j] full[j]-=result[j] full[j+1]+=(q+q*q)*result[j] full[j+2]-=Q*result[j] assert not any(full) scale=result[0] assert scale>0 result=[a/scale for a in result] assert all(result[2*g-j]==Q**(g-j)*result[j] for j in range(g+1)) return result[1:4] def check(): count=0;minimum=[None]*5 for a,b,c in product(range(-isqrt(72),isqrt(72)+1),range(-2,31), range(-isqrt(3200),isqrt(3200)+1)): P=(1,a,b,c,2*b,4*a,8) if sum(P)<=0 or min(sextic_margins(2,a,b,c))<0: continue m=sextic_margins(8,*rank3(P)) scaled=[v/F(k) for v,k in zip(m,(512,8,8,64,512))] assert all(v>b for v,b in zip(scaled,(2,26,F(4,5),47,2))) minimum=[v if u is None else min(u,v) for u,v in zip(minimum,scaled)] count+=1 assert count==215 print('Rank three, genus three, field order two:',count,'sextics pass.') print('Exact component minima:',*(str(u) for u in minimum)) if __name__=='__main__': if not __debug__: raise RuntimeError("Assertions are required.") check()