#!/usr/bin/env python3 """Exact checks for the 29 November 2026 three-connections note. The note names a Julia program. That program was not supplied with the PDF, so it was not executed. This script is an independent integer/rational check. It does not rerun the 671,232,310-node exclusion of cut 442, and it does not review the note's prose as a written proof. """ from __future__ import annotations import hashlib import json from collections import deque from fractions import Fraction from pathlib import Path ROOT = Path(__file__).resolve().parents[2] FIXTURE = ROOT / "supplements/genesis-tick-cuts/graph-fixture.json" WITNESS = ROOT / "supplements/genesis-tick-cuts/witness-440.json" PUBLISHED_FIXTURE = ROOT / "dynamics/600cell/graph-fixture.json" Q = 339949771344778 S = 10**15 D = 25 * S N = 120 def sha256(path: Path) -> str: digest = hashlib.sha256() with path.open("rb") as handle: for chunk in iter(lambda: handle.read(1 << 20), b""): digest.update(chunk) return digest.hexdigest() def fail(message: str) -> None: raise SystemExit(f"FAIL: {message}") def check(name: str, ok: bool, detail: str) -> None: print(f"{'PASS' if ok else 'FAIL'} {name}: {detail}") if not ok: fail(name) def cut_and_forms(neighbors: list[list[int]], signs: list[int]) -> tuple[int, int, int]: cut = 0 quad_a = 0 for i, row in enumerate(neighbors): for j in row: if j < i: continue agree = signs[i] * signs[j] quad_a += 2 * agree if agree < 0: cut += 1 quad_m = 13 * N + quad_a return cut, quad_a, quad_m def neighbor_sign_counts(neighbors: list[list[int]], signs: list[int], vertex: int) -> tuple[int, int]: plus = minus = 0 for j in neighbors[vertex]: if signs[j] > 0: plus += 1 else: minus += 1 return plus, minus def bareiss_leading_minors(matrix: list[list[int]]) -> list[int]: size = len(matrix) work = [row[:] for row in matrix] minors = [work[0][0]] previous = 1 for k in range(size - 1): pivot = work[k][k] if pivot == 0: fail(f"zero Bareiss pivot at order {k + 1}") for i in range(k + 1, size): row_i = work[i] row_k = work[k] factor_i = row_i[k] for j in range(k + 1, size): row_i[j] = (pivot * row_i[j] - factor_i * row_k[j]) // previous previous = pivot minors.append(work[k + 1][k + 1]) return minors def fraction_leading_minor(matrix: list[list[int]], order: int) -> Fraction: work = [[Fraction(matrix[i][j]) for j in range(order)] for i in range(order)] det = Fraction(1) for k in range(order): pivot = work[k][k] if pivot == 0: fail(f"zero fraction pivot at {k}") det *= pivot for i in range(k + 1, order): factor = work[i][k] / pivot for j in range(k, order): work[i][j] -= factor * work[k][j] return det def main() -> None: fixture_hash = sha256(FIXTURE) published_hash = sha256(PUBLISHED_FIXTURE) check( "fixture-hash", fixture_hash == published_hash == "40bc6a1d52efab3d75cf343e65ac06b314f9c9c375fc02bf6d45bf6bb21f9529", fixture_hash, ) graph = json.loads(FIXTURE.read_text()) witness = json.loads(WITNESS.read_text()) neighbors = graph["neighbors"] check("order", len(neighbors) == N and all(len(row) == 12 for row in neighbors), "120 vertices, degree 12") edges = sum(len(row) for row in neighbors) // 2 check("edges", edges == 720, str(edges)) symmetric = all(i in neighbors[j] for i, row in enumerate(neighbors) for j in row) loops = any(i in row for i, row in enumerate(neighbors)) check("simple-symmetric", symmetric and not loops, "symmetric adjacency, no loops") bits = witness["label_bits"] check("bit-length", len(bits) == N and set(bits) <= {"0", "1"}, str(len(bits))) signs = [1 if bit == "1" else -1 for bit in bits] ones = signs.count(1) check("published-balance", ones == 62 and signs.count(-1) == 58, f"ones={ones}") cut, quad_a, quad_m = cut_and_forms(neighbors, signs) check("published-cut", cut == 440 and witness["cut_edges"] == 440, str(cut)) expected_m = 4 * (750 - cut) check("published-quadratic", quad_m == expected_m == 1240, f"sTMs={quad_m} sTAs={quad_a}") quad_p = Fraction(quad_m, 25) check("published-P", quad_p == Fraction(248, 5), str(quad_p)) check("published-rayleigh", quad_p / N == Fraction(31, 75), str(quad_p / N)) sign_sum = sum(signs) centered = quad_p - 2 * sign_sum + N identity = Fraction(240) - Fraction(4 * cut, 25) - 2 * sign_sum check("centered-identity", centered == identity, str(centered)) for vertex in (2, 35): plus, minus = neighbor_sign_counts(neighbors, signs, vertex) check(f"vertex-{vertex}", signs[vertex] == 1 and plus == 6 and minus == 6, f"+{plus}/-{minus}") check("nonadjacent-2-35", 35 not in neighbors[2] and 2 not in neighbors[35], "distinct nonadjacent") balanced = signs[:] balanced[2] *= -1 balanced[35] *= -1 b_cut, _, b_m = cut_and_forms(neighbors, balanced) b_sum = sum(balanced) b_centered = Fraction(b_m, 25) - 2 * b_sum + N check( "balanced-witness", b_cut == 440 and balanced.count(1) == 60 and b_sum == 0 and b_m == 1240 and b_centered == Fraction(848, 5), f"cut={b_cut} ones={balanced.count(1)} K/λ={b_centered}", ) # Golden form and transport, integer matrices only. B = ((1, 1), (1, 2)) H = ((2, 1), (1, -2)) def matmul(left, right): return tuple( tuple(sum(left[i][k] * right[k][j] for k in range(2)) for j in range(2)) for i in range(2) ) def transpose(matrix): return tuple(tuple(matrix[j][i] for j in range(2)) for i in range(2)) bt_h_b = matmul(matmul(transpose(B), H), B) check("transport-conjugation", bt_h_b == H and B[0][0] * B[1][1] - B[0][1] * B[1][0] == 1, str(bt_h_b)) samples = ((1, 0), (0, 1), (2, -3), (5, 8), (-4, 7)) preserved = True for x, y in samples: value = x * x + x * y - y * y half = (2 * x * x + 2 * x * y - 2 * y * y) // 2 bx, by = x + y, x + 2 * y preserved = preserved and half == value and (bx * bx + bx * by - by * by) == value lx, ly = y, x + y preserved = preserved and (lx * lx + lx * ly - ly * ly) == -value check("norm-samples", preserved, "N, H, L, and B on five integer vectors") # Coefficient identity: (1-t)^2 + (1-t)t - t^2 = 1 - t - t^2. poly_ok = (1, -1, -1) == (1, -2 + 1, 1 - 1 - 1) check("normalized-polynomial", poly_ok, "1 - t - t^2") print(f"INFO published-sign-sum {sign_sum}") print(f"INFO published-centered {centered}") # 1-λ-λ^2 at the positive root of 1-t-t^2 is zero; φ^{-1} = (√5-1)/2 satisfies it. # Exact: (√5-1)/2 is the root because t^2+t-1=0 has discriminant 5. disc = 5 root_ok = (1 * 1 - 4 * 1 * -1) == disc check("golden-root", root_ok, "positive root of 1-t-t^2 is (√5-1)/2") check("threshold-73-74", 73 * Q < D < 74 * Q and (D + Q - 1) // Q == 74, f"D={D}") check("threshold-147", 147 * Q < 2 * D and 74 * Q > D, "1 < 74Q/D and 147Q/D < 2") check("threshold-80", 80 * Q > D, "80Q > D") bip = [[] for _ in range(N)] for i in range(60): for j in range(12): a = i b = 60 + ((i + j) % 60) bip[a].append(b) bip[b].append(a) degrees = {len(row) for row in bip} simple = all(len(row) == len(set(row)) and i not in row for i, row in enumerate(bip)) seen = {0} queue = deque([0]) while queue: vertex = queue.popleft() for nxt in bip[vertex]: if nxt not in seen: seen.add(nxt) queue.append(nxt) check("bipartite-graph", degrees == {12} and simple and len(seen) == N, f"component={len(seen)}") u = [1] * 60 + [-1] * 60 # Mu = u on this signing: each vertex meets 12 opposite signs. mu_ok = True for i, row in enumerate(bip): mixed = 13 * u[i] + sum(u[j] for j in row) mu_ok = mu_ok and mixed == u[i] check("bipartite-eigenvector", mu_ok, "Mu=u") def floors(scale: int) -> list[int]: out = [] for value in u: # floor(scale * Q * value / D); value is ±1 numerator = scale * Q * value out.append(numerator // D) return out terminal = floors(74) expected_terminal = [1] * 60 + [-2] * 60 same_terminal = all(floors(k) == expected_terminal for k in range(74, 148)) check("bipartite-terminal", terminal == expected_terminal and same_terminal, "k=74..147 share one terminal") collisions = 0 for modulus in range(1, 74): start = [74 * value for value in u] other = [(74 + modulus) * value for value in u] residues_agree = all((start[i] - other[i]) % modulus == 0 for i in range(N)) floors_agree = floors(74) == floors(74 + modulus) if residues_agree and floors_agree: collisions += 1 else: fail(f"missing collision at m={modulus}") check("bipartite-collisions", collisions == 73, "m=1..73") lifted = [[4 if i == j else (1 if j in neighbors[i] else 0) for j in range(N)] for i in range(N)] for order in range(1, 6): bare = bareiss_leading_minors([row[:order] for row in lifted[:order]])[-1] frac = fraction_leading_minor(lifted, order) check(f"minor-crosscheck-{order}", bare == frac and frac > 0, str(bare)) minors = bareiss_leading_minors(lifted) check( "leading-minors", len(minors) == N and all(value > 0 for value in minors), f"orders=120 last-minor-bits={minors[-1].bit_length()}", ) print(f"INFO determinant {minors[-1]}") print("PASS three-connections") print("NOT-RUN julia-program-named-in-the-note") print("NOT-RUN 442-exclusion") print("NOT-RUN lean") print("NOT-REVIEWED written-argument") if __name__ == "__main__": main()