"""Job #4577 (first look, route 36 rev 5): a directed exact-rational certificate for the theta = 1 test at the step's cell u = 5, for BOTH F_2 = 1 and F_2 = 1/sigma_2 (Ankeny-Onishi), in the job-#4460 (#1986) reduction. INEQUALITY. R_1(u) = f_1(u)^2 rho_odd(u) / (F_2(u)(rho_odd(u) - 1)) > c_eff = 2 at u = 5 (theta = 1: f_1(theta u) = f_1(u), c_eff = 2/theta). INPUTS (served fold-arithmetic-bridge.md lines 69-75 and section 4b; #1986 item 3): - f_1 is nondecreasing on [2, inf) ((s f_1)' = F_1(s-1) >= 1 >= f_1), so f_1(5) >= f_1(4) = 2 e^gamma log(3) / 4. - D_3(u) = int_2^{u-1} log(v-1) dv/v; D_5(5) = int_4^4 ... = 0 and D_k = 0 for odd k >= 5 at u = 5, so rho_odd(5) - 1 = D_3(5) EXACTLY and rho_odd/(rho_odd - 1) = 1 + 1/D_3(5). k(v) = log(v-1)/v is increasing on [2,4] (k'(v) = (v/(v-1) - log(v-1))/v^2 > 0 there since v/(v-1) >= 4/3 > log 3 >= log(v-1)), so the right-endpoint Riemann sum is an UPPER bound on D_3(5). - sigma_2 (Ankeny-Onishi, kappa = 2): sigma(s) = c s^2 on (0,2], c = e^{-2 gamma}/8 (the note's check sigma_2(2) = e^{-2gamma}/2), and (s^-2 sigma(s))' = -2 s^-3 sigma(s-2) for s > 2. Integrating on [2,4] with sigma(t-2) = c (t-2)^2 gives the closed form sigma(s) = c h(s), h(s) = 4 s^2 - 2 s^2 log(s/2) - 8 s + 4 on [2,4] (h(2) = 4, h(4) = 36 - 32 log 2), and on [4,5] sigma(5) = 25 [ sigma(4)/16 - 2 c int_4^5 t^-3 h(t-2) dt ]. h is increasing on [2,3] (h'(w) = 6w - 4w log(w/2) - 8 >= 4 > 0 there, since h'' = 2 - 4 log(w/2) > 0 for w < 2 e^{1/2}), so int_4^5 t^-3 h(t-2) dt <= sum over cells [a,b] of a^-3 h(b-2) (b-a): an UPPER bound, hence a LOWER bound on sigma(5). - gamma: Young's inequality 1/(2(n+1)) < H_n - log n - gamma < 1/(2n) at n = 1000. log by the atanh series (z reduced to [1,2) by powers of 2; partial sums are lower bounds, plus the tail 2 t^{2N+1}/((2N+1)(1-t^2)) for upper bounds); exp by Taylor partial sums (lower) plus a geometric tail (upper). Every bound is an exact Fraction. PRE-REGISTERED. G1: the closed form reproduces #1787's published sigma_2(4) = 0.5445435199263368 (within the enclosure width) and sigma_2(2) e^{2gamma} = 1/2 exactly. G2: the float centres of the two bounds reproduce #1986's 3.3142224 (F_2 = 1) and 2.3794796 (F_2 = 1/sigma_2). C1: the directed rational lower bound of f_1(4)^2 (1 + 1/D_3(5)) exceeds 2. C2: times the directed lower bound of sigma_2(5), it still exceeds 2. FALSIFIER: either rational lower bound <= 2 at the stated precision. Deterministic; stdout is the artifact.""" from fractions import Fraction as F import math, sys, hashlib out = [] def log_bounds(q, N=40): q = F(q); assert q > 0 k = 0 while q >= 2: q /= 2; k += 1 while q < 1: q *= 2; k -= 1 def atanh_bounds(z): t = (z - 1) / (z + 1); s = F(0); tp = t for j in range(N): s += tp / (2 * j + 1); tp *= t * t lo = 2 * s; hi = 2 * s + 2 * tp / ((2 * N + 1) * (1 - t * t)) return lo, hi l2lo, l2hi = atanh_bounds(F(2)); zlo, zhi = atanh_bounds(q) if k >= 0: return k * l2lo + zlo, k * l2hi + zhi return k * l2hi + zlo, k * l2lo + zhi def exp_bounds(x, K=40): x = F(x); assert 0 <= x < 1 s = F(0); term = F(1) for j in range(K + 1): s += term; term = term * x / (j + 1) return s, s + term / (1 - x / (K + 2)) # term is x^(K+1)/(K+1)! # gamma via Young at n = 1000 n = 1000; Hn = sum(F(1, j) for j in range(1, n + 1)); lnlo, lnhi = log_bounds(n) g_lo = Hn - lnhi - F(1, 2 * n); g_hi = Hn - lnlo - F(1, 2 * (n + 1)) eg_lo = exp_bounds(g_lo)[0]; eg_hi = exp_bounds(g_hi)[1] out.append(f'gamma in [{float(g_lo):.12f}, {float(g_hi):.12f}] (width {float(g_hi - g_lo):.2e}); e^gamma in [{float(eg_lo):.12f}, {float(eg_hi):.12f}]') l3lo, l3hi = log_bounds(3) f14_lo = eg_lo * l3lo / 2; f14_hi = eg_hi * l3hi / 2 # f_1(4) = 2 e^g log 3 / 4 # D_3(5) upper bound: right-endpoint Riemann sum on [2,4] with M cells, log upper bounds M = 400 D3_hi = F(0); D3_lo = F(0) for i in range(M): a = 2 + F(2 * i, M); b = 2 + F(2 * (i + 1), M) D3_hi += log_bounds(b - 1)[1] / b * (b - a) D3_lo += (log_bounds(a - 1)[0] if a > 2 else F(0)) / a * (b - a) R1_lo = f14_lo ** 2 * (1 + 1 / D3_hi) out.append(f'f_1(4) in [{float(f14_lo):.12f}, {float(f14_hi):.12f}]; D_3(5) in [{float(D3_lo):.9f}, {float(D3_hi):.9f}] (M = {M} cells)') # sigma_2 c_lo = 1 / (8 * eg_hi ** 2); c_hi = 1 / (8 * eg_lo ** 2) l2lo, l2hi = log_bounds(2) def h_lo(w): w = F(w); return 4 * w * w - 2 * w * w * log_bounds(w / 2)[1] - 8 * w + 4 def h_hi(w): w = F(w); return 4 * w * w - 2 * w * w * log_bounds(w / 2)[0] - 8 * w + 4 sig4_lo = c_lo * (36 - 32 * l2hi); sig4_hi = c_hi * (36 - 32 * l2lo) Kc = 400; Iup = F(0); Ilo = F(0) for i in range(Kc): a = 4 + F(i, Kc); b = 4 + F(i + 1, Kc) Iup += h_hi(b - 2) / a ** 3 * (b - a) Ilo += h_lo(a - 2) / b ** 3 * (b - a) # sigma(5) = 25 [ sigma(4)/16 - 2 c I ]; lower bound uses sigma4_lo, c_hi * Iup -- careful: sigma(4) = c (36 - 32 log 2) shares c; write sigma(5) = 25 c [ (36 - 32 log2)/16 - 2 I ] bracket_lo = (36 - 32 * l2hi) / 16 - 2 * Iup; bracket_hi = (36 - 32 * l2lo) / 16 - 2 * Ilo assert bracket_lo > 0 sig5_lo = 25 * c_lo * bracket_lo; sig5_hi = 25 * c_hi * bracket_hi out.append(f'sigma_2(4) in [{float(sig4_lo):.12f}, {float(sig4_hi):.12f}]; sigma_2(5) in [{float(sig5_lo):.9f}, {float(sig5_hi):.9f}]') led = [] def check(tag, ok, detail): led.append(f"{'PASS' if ok else 'FAIL'} {tag} :: {detail}") pub_s4 = 0.5445435199263368 check('G1_sigma2_closed_form', float(sig4_lo) - 1e-12 <= pub_s4 <= float(sig4_hi) + 1e-12 and 4 * c_lo * eg_lo ** 2 <= F(1, 2) <= 4 * c_hi * eg_hi ** 2, f'#1787 sigma_2(4) = {pub_s4} lies in [{float(sig4_lo):.13f}, {float(sig4_hi):.13f}]; sigma_2(2) e^(2 gamma) = 4 c e^(2 gamma) = 1/2 by construction') import mpmath as mp mp.mp.dps = 30 D3q = mp.quad(lambda v: mp.log(v - 1) / v, [2, 4]) cq = mp.e ** (-2 * mp.euler) / 8 hq = lambda w: 4 * w * w - 2 * w * w * mp.log(w / 2) - 8 * w + 4 s5q = 25 * cq * ((36 - 32 * mp.log(2)) / 16 - 2 * mp.quad(lambda t: hq(t - 2) / t ** 3, [4, 5])) f14q = mp.e ** mp.euler * mp.log(3) / 2 b1c = float(f14q ** 2 * (1 + 1 / D3q)); b2c = float(f14q ** 2 * (1 + 1 / D3q) * s5q) out.append(f'float centres (mpmath quad, 30 digits, not part of the certificate): D_3(5) = {mp.nstr(D3q, 12)}, sigma_2(5) = {mp.nstr(s5q, 12)}, inside the directed enclosures: {float(D3_lo) <= float(D3q) <= float(D3_hi) and float(sig5_lo) <= float(s5q) <= float(sig5_hi)}') check('G2_reproduces_1986_bounds', abs(b1c - 3.3142224) < 5e-7 and abs(b2c - 2.3794796) < 5e-7, f'centres {b1c:.7f} (#1986 3.3142224) and {b2c:.7f} (#1986 2.3794796)') R2_lo = R1_lo * sig5_lo check('C1_theta1_F2eq1_u5_certified', R1_lo > 2, f'f_1(4)^2 (1 + 1/D_3(5)) >= {float(R1_lo):.9f} > 2 (exact Fraction lower bound; margin {float(R1_lo / 2 - 1):.4f})') check('C2_theta1_F2eq1oversigma2_u5_certified', R2_lo > 2, f'f_1(4)^2 (1 + 1/D_3(5)) sigma_2(5) >= {float(R2_lo):.9f} > 2 (margin {float(R2_lo / 2 - 1):.4f})') import math as _m for nm, v in (('R1_lo', R1_lo), ('R2_lo', R2_lo)): r = F(_m.floor(v * 10 ** 9), 10 ** 9) # rounded DOWN: still a lower bound assert r <= v out.append(f'{nm} >= {r} (a rational rounded down from the exact bound, whose numerator has {v.numerator.bit_length()} bits)') print('\n'.join(out)); print('\n'.join(led)) print('VERDICT all_pass=' + str(all(l.startswith('PASS') for l in led)))