"""Job #4487 (pursue route 46, BRIDGE-W): the y-sweep of #1998's next_step, under #1998's own pre-registration (PREREG-job4156.md, sha256 checked below): decision rule sec. 2, falsifiers F1-F4 sec. 3, fixed sets y in {1/20, 1/24, 1/30, 1/40}, w in {6/25, 1/5, 1/8}. Exact rationals, stdlib only, offline once the inputs are downloaded. The strip cut nu_max(y). The step says "the strip cut in force at that y". The cut 9/20 originates in return #1814 sec. 3, quoted: "The large sieve at level 1/2 ... controls the discrepancy for e*l <= x^{1/2-eps}, that is nu < 9/20", where l <= Z = x^y is the second modulus (C_{Y,Z}'s piece 2, prime-detection-spec sec. 4: beta_Z(t) = log t - sum_{l|t, l<=Z} Lambda(l)). So the cut in force at split y is nu_max(y) = 1/2 - y (this is what makes 9/20 at y = 1/20). The literal number 9/20 is ALSO evaluated at every y and labelled as the corpus's fixed named box (19/25, 9/20) of reachability-coverage sec. 4.2, not the strip cut. Inputs reused unchanged (sha256 checked): #1998 verify-bridge-w-dedge.py + route46-dedge.json (the y = 1/20 anchor, 32 checks), #1998 PREREG-job4156.md, #1408 bridge1531.py (regions, threshold: the union's uniform product threshold T(w, v, y)). Coordinates (reachability-coverage sec. 1, parameterised as in #1408/#737): a = delta + w, b = nu + y (Y = Z = x^y, so v = y), p = (1 - w) - delta, q = (1 - y) - nu; budgets right 2 - p - 3q, left 2 - 3p - q; right eligible iff p >= 2 eta0, left iff q >= 2 eta0 (#1998's rule), eta0 = 1/100. d-edge: p = 0. """ import sys, os, json, hashlib, subprocess, importlib.util from fractions import Fraction as F HERE = os.path.dirname(os.path.abspath(__file__)) HASH = {'s1998/verify-bridge-w-dedge.py': None, 's1998/route46-dedge.json': None, 's1998/PREREG-job4156.md': None, 's1408/bridge1531.py': None} r1998 = json.load(open(os.path.join(HERE, 'r1998.json'), encoding='utf-8')); r1408 = json.load(open(os.path.join(HERE, 'r1408.json'), encoding='utf-8')) served = {f['name']: f['sha256'] for f in r1998['files']}; served.update({f['name']: f['sha256'] for f in r1408['files']}) for k in HASH: b = open(os.path.join(HERE, k), 'rb').read() HASH[k] = hashlib.sha256(b).hexdigest() assert HASH[k] == served[os.path.basename(k)], k spec = importlib.util.spec_from_file_location('b1531', os.path.join(HERE, 's1408', 'bridge1531.py')) B = importlib.util.module_from_spec(spec); spec.loader.exec_module(B) YS = [F(1, 20), F(1, 24), F(1, 30), F(1, 40)] WS = [F(6, 25), F(1, 5), F(1, 8)] ETA0 = F(1, 100); HALF = F(1, 2); KAPPA, LAMBDA = F(151, 200), F(321, 200) led = []; rows = [] def s(x): return str(x) # anchor: #1998's verifier, unchanged, in compare mode against its published target anc = subprocess.run([sys.executable, os.path.join(HERE, 's1998', 'verify-bridge-w-dedge.py'), os.path.join(HERE, 's1998', 'route46-dedge.json')], capture_output=True, text=True) anc_ok = anc.returncode == 0 and anc.stdout.strip().endswith('ROUTE46-DEDGE PASS') led.append(f"{'PASS' if anc_ok else 'FAIL'} A0_anchor_y_1_20 :: #1998 verify-bridge-w-dedge.py unchanged, compare mode: " f"{[l for l in anc.stdout.splitlines() if l.startswith('target check') or l.startswith('--- checks')]}") # F4: the served reachability-coverage.md is the version #1998 read, and sec. 4.2 is quoted at (w, y) = (6/25, 1/20) rc = open(os.path.join(HERE, 'reachability-coverage.md'), 'rb').read() rc = rc[:-1] if hashlib.sha256(rc[:-1]).hexdigest().startswith('ffc0ae86900a6cf5') else rc rc_sha = hashlib.sha256(rc).hexdigest(); txt = rc.decode('utf-8') f4_same = ('a=delta+6/25, b=nu+1/20' in txt and 'delta+3nu-161/100 and 3delta+nu-123/100' in txt and '| (19/25, 9/20) | (0, 1/2) | right unusable | 3/2 | 3/2 |' in txt) led.append(f"{'PASS' if f4_same else 'FAIL'} F4_not_triggered :: reachability-coverage.md sha256 {rc_sha[:16]}... (the version #1998 read: " f"{rc_sha.startswith('ffc0ae86900a6cf5')}); sec. 1 uses a = delta + 6/25, b = nu + 1/20 and sec. 4.2 quotes 161/100, 123/100 and the " f"row (19/25, 9/20) at (p, q) = (0, 1/2), gamma_req 3/2, i.e. at (w, y) = (6/25, 1/20)") T_cache = {} for y in YS: nu_max = HALF - y # the strip cut in force at y (#1814's derivation, e*l <= x^{1/2}) for w in WS: regs = B.regions(w, y, y); lo, hi = B.threshold(w, y, y, regs) # #1408's closed form min(max(1-w, (2B+3A)/13), 1-v) was verified only at y = v = 1/20 and does not hold at every y here # (first run: it failed at (w, y) = (1/8, 1/40)); so T is pinned as the simplest rational in the exact bisection bracket and # checked one-sidedly: the segment delta+nu = T - 10^-9 is covered, T + 10^-9 is not. Tcf = next(c for c in (lo.limit_denominator(d) for d in (10, 100, 1000, 10 ** 4, 10 ** 5, 10 ** 6)) if lo <= c <= hi) assert B.covered(w, y, y, Tcf - F(1, 10 ** 9), regs)[0] and not B.covered(w, y, y, Tcf + F(1, 10 ** 9), regs)[0], (w, y, Tcf) A_ = 2 - w - 3 * y; B_ = 4 - 6 * w - 2 * y T1408 = min(max(1 - w, (2 * B_ + 3 * A_) / 13), 1 - y) T_cache[(w, y)] = Tcf # d-edge gamma_req at named nu (p = 0: right ineligible, left eligible iff q >= 2 eta0): gamma_req = max(0, 2 - q) def greq(nu): q = (1 - y) - nu return max(F(0), 2 - q) if q >= 2 * ETA0 else None row = {'y': s(y), 'w': s(w), '(1) budget_1-w': s(1 - w), '(1) budget_2-w-3y': s(2 - w - 3 * y), '(1) T(w,y)': s(Tcf), '(1) T_float': float(Tcf), '(1) T_1408_closed_form': s(T1408), '(1) closed_form_holds': T1408 == Tcf, '(1) T_above_19/25': Tcf > F(19, 25), '(2) gamma_req_d-edge_cheapest_nu=y': s(greq(y)), '(2) gamma_req_d-edge_endpoint_nu=1/2-y': s(greq(nu_max)), '(2) gamma_req_d-edge_literal_nu=9/20': s(greq(F(9, 20))), '(2) gamma_req_d-edge_nu=1/2': s(greq(HALF)), '(3) nu_max': s(nu_max), '(3) piece1_margin_1/2-nu_max': s(HALF - nu_max), '(3) piece2_margin_1/2-nu_max-y': s(HALF - nu_max - y), '(3c) literal_box_nu=9/20_piece2_margin': s(HALF - F(9, 20) - y), '(3d) covered_fraction_of_nu_range': s((nu_max - y) / (1 - 2 * y)), '(4) C_margin_1-w-kappa': s(1 - w - KAPPA), '(4) C_margin_2-w-3y-lambda': s(2 - w - 3 * y - LAMBDA), '(4) C_margin_kappa-w': s(KAPPA - w), '(4) C_margin_lambda-w-3y': s(LAMBDA - w - 3 * y)} row['(4) C_all_positive'] = all(F(row[k]) > 0 for k in row if k.startswith('(4) C_margin')) rows.append(row) print('y w T(w,y) 2-w-3y gamma_req endpoint | literal 9/20 | piece2 margin endpoint | literal-box margin | C margins (1-w-k, 2-w-3y-l)') for r in rows: print(f"{r['y']:<6} {r['w']:<6} {r['(1) T(w,y)']:<11} {r['(1) budget_2-w-3y']:<8} {r['(2) gamma_req_d-edge_endpoint_nu=1/2-y']:<18} | " f"{r['(2) gamma_req_d-edge_literal_nu=9/20']:<12} | {r['(3) piece2_margin_1/2-nu_max-y']:<22} | {r['(3c) literal_box_nu=9/20_piece2_margin']:<18} | " f"{r['(4) C_margin_1-w-kappa']}, {r['(4) C_margin_2-w-3y-lambda']}") zero_all = all(F(r['(3) piece2_margin_1/2-nu_max-y']) == 0 for r in rows) # F1 as a statement about the construction, not only the grid: nu_max(y) = 1/2 - y for every y, so 1/2 - nu_max(y) - y = 0 identically. f1 = zero_all and all(F(r['(3) nu_max']) == HALF - F(r['y']) for r in rows) T_ok = all(T_cache[(w, y)] > F(19, 25) for y in YS for w in (F(1, 5), F(1, 8))) C_ok = all(r['(4) C_all_positive'] for r in rows) end_g = sorted({r['(2) gamma_req_d-edge_endpoint_nu=1/2-y'] for r in rows}) led.append(f"INFO T closed form of #1408 (verified there at y = 1/20 only) holds at {sum(r['(1) closed_form_holds'] for r in rows)}/{len(rows)} (w, y); " f"fails at {[(r['w'], r['y'], r['(1) T_1408_closed_form'], r['(1) T(w,y)']) for r in rows if not r['(1) closed_form_holds']]}") led.append(f"{'PASS' if T_ok else 'FAIL'} S2_T_above_19/25 :: T(w, y) > 19/25 at w = 1/5 and 1/8 for every y in the set: " + ', '.join(f"T({w},{y}) = {T_cache[(w, y)]}" for y in YS for w in (F(1, 5), F(1, 8)))) led.append(f"{'PASS' if C_ok else 'FAIL'} S3_C_margins_positive :: all four C_(151/200, 321/200) non-emptiness margins > 0 at every (w, y); " f"smallest 1-w-kappa = {min(F(r['(4) C_margin_1-w-kappa']) for r in rows)}, 2-w-3y-lambda = {min(F(r['(4) C_margin_2-w-3y-lambda']) for r in rows)}") led.append(f"{'FAIL' if zero_all else 'PASS'} S1_endpoint_margin_positive :: piece-2 margin 1/2 - nu_max(y) - y at the closed endpoint = " f"{sorted({r['(3) piece2_margin_1/2-nu_max-y'] for r in rows})} at every (w, y) of the pre-registered set") led.append(f"{'FIRES' if f1 else 'does not fire'} F1 :: nu_max(y) = 1/2 - y identically (#1814: e*l <= x^(1/2-eps) with l <= Z = x^y), so the " f"endpoint margin is 0 by construction; gamma_req at the moving endpoint (19/25, 1/2 - y) is {end_g} at every y (q = 1/2 there)") led.append(f"INFO F2 :: not reached (no positive endpoint margin anywhere). F3 :: two independent runs compared by stdout sha256 (see recipe).") led.append(f"INFO literal box :: the corpus's named row (19/25, 9/20) has piece-2 margin 1/20 - y = " f"{[r['(3c) literal_box_nu=9/20_piece2_margin'] for r in rows if r['w'] == '6/25']} at y = {[r['y'] for r in rows if r['w'] == '6/25']}: " f"it is level-1/2 covered for every y < 1/20, but it is then interior to the moved strip; the uncovered d-edge band is " f"[1/2 - y, 1 - y], of length 1/2 at every y; the covered share of the nu-range is (1/2 - 2y)/(1 - 2y) = " f"{[r['(3d) covered_fraction_of_nu_range'] for r in rows if r['w'] == '6/25']}") verdict = 'FAILURE (pre-registered sec. 2: endpoint margin identically zero; F1 fires)' if f1 else ('SUCCESS' if (not zero_all and T_ok and C_ok) else 'INCONCLUSIVE') print('\n'.join(led)) print('VERDICT ' + json.dumps({'decision': verdict, 'anchor_ok': anc_ok, 'F4_not_triggered': f4_same, 'T_ok': T_ok, 'C_ok': C_ok, 'endpoint_margin_identically_zero': zero_all, 'F1_fires': f1})) json.dump({'inputs_sha256': HASH, 'reachability_sha256': rc_sha, 'rows': rows, 'ledger': led, 'decision': verdict}, open(os.path.join(HERE, 'sweep4487.json'), 'w', encoding='utf-8', newline='\n'), indent=1, sort_keys=True)