#!/usr/bin/env python3 """The route's exact criterion, checked against the published T_31 maxsum table (#588/#969) and the exact K* anchors (#956/#966, #936), under the two index conventions in play. A = largest m with maxsum_m(T_31) < 4*Ghat (route 23 / #588 / #606 convention) B = least m with maxsum_m(T_31) >= 4*Ghat (the definition WRITTEN in the #2547 report) maxsum_m is nondecreasing in m, so A = B-1 whenever the threshold is crossed. The certificate at fold s is maxsum_{K*(s)+1}(T_{s-1}) <= 4*Ghat(s). """ MS = {1:348,2:408,3:510,4:540,5:552,6:582,7:624,8:660,9:690,10:786,11:852,12:882, 13:912,14:930,15:972,16:1002,17:1050,18:1098,19:1122,20:1170,21:1212,22:1242, 23:1260,24:1302,25:1338,26:1380,27:1428,28:1470,29:1512,30:1590} GHAT = 348 # Ghat(32)=Ghat(34)=Ghat(36)= max gap of T_31 THR = 4*GHAT # 1392 A = max(m for m in MS if MS[m] < THR) B = min(m for m in MS if MS[m] >= THR) print(f"T_31 published maxsum table (#588, reproduced #969): Ghat=348 4*Ghat={THR}") print(f" A (route-23 convention, last index strictly below threshold) = {A} (maxsum_A={MS[A]})") print(f" B (definition written in the #2547 report, first index at/above) = {B} (maxsum_B={MS[B]})") print() print("fold s K*(s) maxsum_{K*+1} actual verdict route23 crit (K* 1590 = MS[30] tag = "" if K+1 in MS else f" (K*+1={K+1} not in the printed table; maxsum_34 > 1590)" lhs_s = f"{lhs:d}" if lhs is not None else ">1590" print(f" {s:3d} {K:3d} {lhs_s:>10s} {str(verdict):14s} {str(c23):20s} {str(crep):25s} {str(corr)}{tag}") print() print("Critical hypothetical for the off-by-one: K*(32)=26 (route 23 states this would fail):") K=26; lhs=MS[K+1] print(f" maxsum_{K+1}={lhs} > {THR} -> verdict FAIL") print(f" route23 criterion K* The proposition 'passes iff K*