#!/usr/bin/env python3 """ REAL EXTENSION CLASSIFICATION FOR THE FIXED 30-POINT SIDON WITNESS Devin Wright / NIGHTFALL research, 2026-11-30. AI-assisted proof and checker. Run with Python 3.10+ (standard library only): python sidon-real-extension-certificate.txt Let h be maximum Sidon-subset size (sums with repetition). The array B0 below is the 30-integer witness from Cairn C-71 and d3lefts/d3lefts pull request 72. All real one-point extensions preserving weak Sidon have h=18. Among real two-point weak-Sidon extensions, exactly the five unordered pairs printed below (and in 'expected') have h=18. Every other such pair gives h=19. The five exceptions fail the (4,5) condition, so every real two-point extension preserving (4,5) has h=19. No claim about other base sets is made. Proof reduction: * In a weak Sidon set, ordinary Sidon subsets are exactly the subsets with no three-term arithmetic progression (Ma–Tang, arXiv:2602.23282v2, Lemma 2.3). The checker covers the old 28-edge hypergraph by branching on an uncovered edge; its disjoint-edge pruning is a lower bound on the remaining number of deletions. It enumerates all 26,923 old maximum subsets of size 17, and excludes a cover of size at most 12. * A new point x belongs to an old-old-new progression exactly when x is 2a-b, 2b-a or (a+b)/2 for distinct old a,b. If none exists, any old maximum subset works. For a pair x,y there are three finite cases: both are old-pair completions; exactly one is and a mixed progression exists; or neither is and at least two mixed progressions exist. * Each mixed progression is one of x+y=2b, 2x-y=b, 2y-x=b for old b. Distinct mixed progressions have distinct equation types (unless x=y, excluded). Two types have determinant of absolute value 3. Thus the first finite case has denominators dividing 2, the second dividing 4, the third dividing 3; scaling the old witness by 12 lets all finite cases be enumerated as integers. Generic cases have either a single individual completion and no mixed progression, or no individual completion and at most one mixed progression. These follow from the one-point result or from existence of an old maximum Sidon subset omitting any named old mark. * A finite pair is weak Sidon precisely when neither new point completes a four-distinct old sum collision and neither their sum nor their absolute difference collides with an old pair sum or positive difference. To add both new points to an old maximum Sidon subset, omit at least one old vertex from each newly created three-term progression. This test uses bitsets of old solutions. Failure makes h<=18; the one-point theorem gives h>=18. A separate cover search on each enlarged exceptional hypergraph verifies exact h=18, and all four-point distance counts can be checked directly. Sources: https://cairn-commons.com/claims/C-71 (base witness) https://github.com/d3lefts/d3lefts/pull/72 (prior INTEGER extension result) https://arxiv.org/html/2602.23282v2 (weak Sidon / AP framework and general bounds) """ from itertools import combinations from fractions import Fraction B0=(-19465109,0,3545689,5427075,6005963,7091378,7308461,7545719,7671611,7710347,7782977,7797503,7813379,7821803,7824395,7829255,7830227,7835411,7836059,7836707,7849019,7874975,7884659,7894343,8078339,8466237,8610959,8755681,11505399,19465109) B=tuple(12*a for a in B0) I={b:i for i,b in enumerate(B)} E=[(1<=5 for q in combinations(B,4)) seen=set(); maxima=set(); universe=(1<<30)-1 def enumerate_covers(M): if M in seen:return seen.add(M) rem=13-M.bit_count() edges=[e for e in E if not M&e] if not edges: assert rem==0, "A Sidon set of size at least 18 exists" maxima.add(universe^M); return if rem==0:return used=0 for e in edges: if not e&used:used|=e;rem-=1 if rem<0:return e=max(edges,key=lambda e:sum((e&f).bit_count() for f in edges)) for i in range(30): if e>>i&1:enumerate_covers(M|(1<=2 case3.add(tuple(sorted((x,y)))) cases.extend(sorted(case3)) fail=[(str(Fraction(x,12)),str(Fraction(y,12))) for x,y in cases if not verify_pair(x,y)] print('maxima',len(maxima),'singleton AP',len(A),'cases',n1,n2,len(case3),'fail',len(fail),fail[:12]) assert len(fail)==5 assert (len(A),n1,n2,len(case3)) == (361,62626,12536,57) expected={frozenset((Fraction(x),Fraction(y))) for x,y in [ ("19465109/2","-97325545/2"),("19465109/2","-19465109/4"), ("-97325545/3","-19465109/3"),("-77860436/3","-38930218/3"), ("19465109/3","97325545/3")]} assert {frozenset(map(Fraction,v)) for v in fail}==expected # Additional exact check: test all distinct-pair sums and all four-point distance # conditions on the five exceptions directly, without using the affine filters. for u,v in sorted(map(sorted,expected)): T=tuple(sorted(B0+(u,v))) sums=[a+b for a,b in combinations(T,2)] assert len(sums)==len(set(sums)) q=next((q for q in combinations(T,4) if len({b-a for a,b in combinations(q,2)})<5),None) print(u,v,'is (4,5)' if q is None else 'fails (4,5) at '+str(q)) from functools import lru_cache # Second check of h=18 on each exception: solve the enlarged progression # hypergraph directly, without the old-maximum portfolio. def has_cover(edges,k): @lru_cache(None) def search(unhit,r): if not unhit:return True if not r:return False target=unhit[0] return any(search(tuple(e for e in unhit if not e&v),r-1) for v in (1<