#!/usr/bin/env python3 """#1491 — arithmetic check of the two constants the shadow record prints, and of the first-order coefficient implied by its own candidate table. Nothing here is a new measurement of the shadow: every input is a number already printed in the served records. This script only evaluates identities. Gates (must hold, else abort): G1 omega(u) = 1/u on [1,2] gives omega(2) = 1/2 exactly (classical, Buchstab 1937). G2 rho(2) = (e^gamma * omega(2))^2 == e^(2 gamma)/4 to 1e-12 (the record's "point trough"). G3 2 - 1/ln 2 reproduces the record's printed 0.5573049591 to 10 dp. """ import json import math g = 0.57721566490153286060651209008240243104215933593992 # Euler-Mascheroni (A001620) # G1: omega(2) = 1/2 by the classical branch omega(u) = 1/u on 1 <= u <= 2 omega_2 = 1.0 / 2.0 # G2: the two branches of the record's rho agree at u = 2 iff omega(2) = 1/2 rho_2_unified = (math.exp(g) * omega_2) ** 2 rho_2_trough = math.exp(2 * g) / 4.0 assert abs(rho_2_unified - rho_2_trough) < 1e-12, (rho_2_unified, rho_2_trough) # the records print 0.793055 (6 dp: shadow-buchstab.md section 2, shadow-prereg.md table) assert round(rho_2_trough, 6) == 0.793055, rho_2_trough # G3: the record's closed form for the band-average's first-order coefficient c_closed = 2.0 - 1.0 / math.log(2.0) assert round(c_closed, 10) == 0.5573049591, c_closed # The record's own candidate table (shadow-prereg.md "The candidate values"): x-weighted band # average B_x at band [y^2, 2y^2], w = ln2/ln y. Used only to read off the first-order # coefficient these printed values imply: (B_x/0.7930550 - 1) / w. table = [ (23, 0.221065, 0.873491), (97, 0.151517, 0.851659), (401, 0.115641, 0.839217), (997, 0.100387, 0.833670), (2999, 0.086578, 0.828512), (10007, 0.075252, 0.824182), ] implied = [] for y, w, bx in table: ratio = bx / rho_2_trough - 1.0 implied.append({"y": y, "w": w, "B_x": bx, "ratio_minus_1": round(ratio, 6), "implied_c": round(ratio / w, 4)}) # The record's measured column (shadow-buchstab.md section 2) and its predicted column. measured = [0.85004, 0.84124, 0.83285, 0.83212, 0.82830, 0.82690, 0.82741, 0.82325, 0.82315, 0.82279] predicted = [0.83365, 0.82177] resid_vs_trough = [round(m - rho_2_trough, 5) for m in measured] out = { "gates": { "G1_omega_2": omega_2, "G2_rho_2_unified_minus_trough": rho_2_unified - rho_2_trough, "rho_2_trough": rho_2_trough, "G3_two_minus_one_over_ln2": c_closed, }, "record_table_implied_first_order_coefficient": implied, "measured_column_minus_rho_2_trough": resid_vs_trough, "measured_span": [min(measured), max(measured)], "predicted_span": predicted, "note": "All inputs are printed values of served records (shadow-prereg.md, shadow-buchstab.md); no shadow was re-measured.", } print(json.dumps(out, indent=1))