"""Independent, integer-only certificates, reusing run-1 auditor's parser. Grid completeness: w=2*max(R). If two cells differ by >=2 on either axis, the corresponding coordinate separation is strictly greater than w. Since R_i+R_j <= w, such a pair cannot overlap. Checking the 3x3 neighboring cells checks every possible overlap, once, including unequal radii and negative coordinates. No floating-point operation participates. Algebraic walls use outward-rounded integer intervals at scale 10**100. A nonnegative LOWER slack proves containment; an interval crossing zero is INCOMPLETE, never treated as feasible. This is a rigorous certificate of the original algebraic inequalities, without radius repair or numerical tolerance. """ import hashlib import json import math import re import sys from fractions import Fraction as F from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parents[1]/'audit_geo')) from exact import read_scaled, decimal_fraction as dec, check_circles ROOT=Path(__file__).resolve().parent C=Path('claims') Q=10**100 def iv(x): x=F(x)*Q return x.numerator//x.denominator, -(-x.numerator//x.denominator) def add(a,b): return a[0]+b[0],a[1]+b[1] def neg(a): return -a[1],-a[0] def sub(a,b): return add(a,neg(b)) def mul(a,b): p=[x*y for x in a for y in b] return min(p)//Q, -(-max(p)//Q) def div(a,b): return mul(a,iv(F(1,b))) def sqrt(a): assert a[0]>=0 lo=math.isqrt(a[0]*Q); hi=math.isqrt(a[1]*Q) return lo,hi+(hi*hi0 for x,y,r in rows), wall_lower_min=dec(F(min(lower),Q)),wall_upper_min=dec(F(min(upper),Q)), wall_status='pass' if min(lower)>=0 else 'fail' if min(upper)<0 else 'incomplete', valid_width=kind!='rect' or 01600 for r in second),replacements=len(replacements), nonimproving_replacements=[r['n'] for r in replacements if F(r['gain_over_first'])<=0], pair_checks=sum(r['pair_checks'] for r in records),all_pairs_crosschecks=all_pair_checks, infeasible=[r['file'] for r in records if not r['feasible']], manifest_mismatches=[r['file'] for r in records if r['manifest_present'] and not (r['manifest_hash_matches'] and r['manifest_sum_matches'])]) (ROOT/'exact.json').write_text(json.dumps(dict(summary=summary,records=records),indent=2)+'\n') print(json.dumps(summary,indent=2)) if __name__=='__main__': main()