#!/usr/bin/env python3 """Job #963 (rescue of route 5): check the literal physical support of the exact N66 weighted sign witness published as return #370's `witness-66.out`. What it does, and what it deliberately does not: * DOES re-derive the frozen reference's support: the slots of the admissible set of the old primes (p <= 97) in the half-open interval [9409, 13722) -- these are the columns the witness's weights attach to. * DOES re-check the trivial arithmetic of the published witness: the weights and per-prime maxima quoted in #370 sum to the quoted totals. * DOES NOT re-derive the maximiser, does not re-run the min-max loop, does not regenerate the fractional-cover count matrix. Those are #370's published computations and the brief forbids rerunning published work here. usage: python support.py """ import json OLD_PRIMES = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97] Q = [101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193] LO, HI = 9409, 13722 N = 66 # quoted from #370's witness-66.out (files/ of witness-66.out is in the # return; these are the published numbers, transcribed, not recomputed) WEIGHTS = [20387, 17919, 22729, 9472, 4106, 10449, 20296, 7126, 20595, 13909, 22033, 23966, 15363, 11605, 14166, 4664, 4424, 7729, 19279, 14299, 0, 16222, 20951, 21997, 3620, 21972, 20728, 19092, 11092, 22133, 22667, 22762, 7078, 25114, 20072, 23471, 20847, 6726, 7310, 12383, 19968, 20847, 19143, 8029, 23725, 13387, 21174, 6701, 11199, 18261, 13468, 15574, 21115, 6259, 18280, 13216, 22603, 13895, 2903, 10319, 9468, 11901, 9864, 18937, 18244, 20733] MAXIMA = {101: 42418, 103: 55659, 107: 56821, 109: 50798, 113: 53975, 127: 47781, 131: 47086, 137: 43540, 139: 48690, 149: 40934, 151: 47136, 157: 42260, 163: 45767, 167: 50256, 173: 41812, 179: 46984, 181: 41872, 191: 44464, 193: 43109} QUOTED_W = 999966 QUOTED_SUM_M = 891362 def admissible(a, lo, hi): """Slots s in [lo, hi) with s not = 0, -2 mod p for every p <= 97.""" alive = [] for s in range(lo, hi): if all(s % p not in (0, p - 2) for p in OLD_PRIMES): alive.append(s) return alive def kill_reps(s, q): """The two residues of s that the twin-slot rule deletes mod q.""" return (s % q, (s + 2) % q) def main(): print("== the frozen reference (route 5, from #357 and #364's obstacle)") print(" p = 97, support a = 9409, half-open [%d, %d), Q = %d primes %d..%d" % (LO, HI, len(Q), Q[0], Q[-1])) slots = admissible(97, LO, HI) print(" that interval contains %d admissible slots (first %d, last %d)" % (len(slots), slots[0], slots[-1])) # the n = 66 reference prefix: the first 66 admissible slots from a = 9409 allslots = admissible(97, LO, LO + 4400) pre = allslots[:N] print(" the first %d admissible slots from a = 9409 run %d..%d (span L = %d)" % (N, pre[0], pre[-1], pre[-1] - pre[0])) print(" matches #370's 'n = 66: L = 4313, slots 9419..13721': %s" % (pre[0] == 9419 and pre[-1] == 13721)) print(" all %d slots are 6-divisible offsets from an odd base? gaps: %s" % (len(pre), sorted(set(pre[i + 1] - pre[i] for i in range(len(pre) - 1))))) print() print("== the witness quoted from #370 (witness-66.out)") print(" weights transcribed: %d values (one zero, at slot index %d)" % (len(WEIGHTS), WEIGHTS.index(0))) print(" they attach to the %d slots above, in order" % N) wsum = sum(WEIGHTS) print(" sum of weights x 10^6 = %d (quoted %d, match %s)" % (wsum, QUOTED_W, wsum == QUOTED_W)) msum = sum(MAXIMA[q] for q in Q) print(" sum of per-prime maxima = %d (quoted %d, match %s)" % (msum, QUOTED_SUM_M, msum == QUOTED_SUM_M)) print(" strict deficit = %d of %d (%.2f%% of W(D))" % (wsum - msum, wsum, 100.0 * (wsum - msum) / wsum)) print(" the certificate is the inequality sum_q max_b W(q,b) = %d < %d = sum_s w_s" % (msum, wsum)) print() print("== the per-slot support of the weights (slot value, residue pair mod q for") print(" the first three primes, weight x 10^6) -- the arithmetic the weights sit on") for i, (s, w) in enumerate(zip(pre, WEIGHTS)): if i < 8 or i >= N - 4: print(" slot %2d s = %5d mod 101/103/107 reps %s w = %d" % (i, s, [kill_reps(s, q) for q in Q[:3]], w)) print(" (full table in support.out: all %d slots)" % N) print() print("== dead slot at this prefix (the construction that fails here)") print(" x = 9719, present among the %d slots: %s" % (N, 9719 in pre)) print(" @mikecann's w(x) = 3, others 2 gives sum_q max_b W(q,b) = 134 > 133 = W(D)") print(" so the N66 reference is NOT witnessed by the dead-slot 3/2 mechanism;") print(" it needs the genuine 66-weight vector, which is what #370 exhibits.") out = {"slots": pre, "weights": WEIGHTS, "per_prime_maxima": MAXIMA, "sum_w": wsum, "sum_maxima": msum, "deficit": wsum - msum, "dead_slot_9719_present": 9719 in pre} with open("job963/support.json", "w", encoding="utf-8", newline="\n") as f: json.dump(out, f, indent=1) if __name__ == "__main__": main()