# bounds2538.py -- a priori bounds for the remainders B (fixed-endpoint-discrepancy (2.8)) and D_y (moving-cutoff-parity (12)) # from the sieve upper bound on the dyadic twin sum S, against the measured rows of return #165 (j<=34) and the embedded # block of research/centered-discrepancy-measurement.js (j<=38). import re C2 = 0.6601618158468696 # the note's constant (twin prime constant, prod_{p>2} (1 - 1/(p-1)^2)) A2 = 2 * 0.3740 # from the thresholds line "M bound A2/2 = 0.3740" (A2 = prod_{p>2}(1 - 1/(p(p-1)))) print(f"C2 = {C2:.6f}, A2 = {A2:.4f}") # Sieve upper bound, dyadic interval J = (x/2, x]: S(x) = sum_J Lambda(n)Lambda(n-2) <= (4 + o(1)) C2 x [pi_2(x) <= (8+o(1)) C2 x/log^2 x] # Identity (2.8): S = C2 x + B + o(x) => -C2 x + o(x) <= B <= 3 C2 x + o(x) # Identity (12): S = C2 x - 2 C2 M + D_y + o(x), |M| <= V = A2 x/2 + o(x) => -C2(1+A2) x <= D_y <= (3 C2 + C2 A2) x + o(x) print(f"B/x in [{-C2:.4f}, {3*C2:.4f}] (required lower bound -(C2 - 1/200) = {-(C2-1/200):.4f}, i.e. S >= x/200)") print(f"D_y/x in [{-C2*(1+A2):.4f}, {3*C2 + C2*A2:.4f}] (required lower bound -4/25 = {-4/25:.4f})") print(f"K for the lemma of #1217: K_B = {3*C2:.4f}, K_D = {3*C2 + C2*A2:.4f}; any finite K suffices (K enters the proof additively)") # measured rows: S/x - C2 (= B/x up to o(x)) and D_y/x, W1grid/x from the embedded block (rows 16..38) rows_main, rows_id = {}, {} for line in open('centered-discrepancy-measurement.js', encoding='utf-8'): m = re.match(r'// (\d+) \| (\d+) \| \d+ \| \d+ \| \d+ \| \d+ \| (\S+) \| (\S+) \| (\S+) \| (\S+) \| (\S+) \| (\S+) \| (\S+) \| [\d.]+$', line) if m: rows_main[int(m.group(1))] = dict(x=int(m.group(2)), M=float(m.group(3)), Dy=float(m.group(4)), W1=float(m.group(7))) m = re.match(r'// (\d+) \| (\S+) \| (\S+) \| (\S+) \| (\S+) \| (\S+) \| (\S+) \| \S+ \| \S+$', line) if m and int(m.group(1)) in rows_main and int(m.group(1)) not in rows_id: rows_id[int(m.group(1))] = dict(S=float(m.group(2)), T1=float(m.group(3)), r=float(m.group(7))) print(f"\nembedded rows parsed: main {len(rows_main)}, identity {len(rows_id)}") print(" j | B/x = S/x - C2 | D_y/x | W1grid/x | (D_y + (T1-C2 x))/x") for j in sorted(rows_main): if j in rows_id: B = rows_id[j]['S'] - C2 print(f"{j:2d} | {B:+.6f} | {rows_main[j]['Dy']:+.6f} | {rows_main[j]['W1']:.6f} | {rows_main[j]['Dy'] + rows_id[j]['T1']:+.2e}") js = [j for j in rows_main if j in rows_id] print(f"\nmax |B/x| over j>=30: {max(abs(rows_id[j]['S']-C2) for j in js if j>=30):.2e}; max D_y/x (all rows): {max(rows_main[j]['Dy'] for j in rows_main):+.6f} at j={max(rows_main, key=lambda j: rows_main[j]['Dy'])}; min D_y/x: {min(rows_main[j]['Dy'] for j in rows_main):+.6f}") print(f"the sieve K_D = {3*C2 + C2*A2:.3f} exceeds the largest measured D_y/x by a factor {(3*C2 + C2*A2)/max(rows_main[j]['Dy'] for j in rows_main):.0f}") # log-power fit of |D_y|/x ~ c / (log x)^a over j>=26 (the note says a between 2 and 3 fits; here fitted with signs ignored) import math pts = [(math.log(math.log(rows_main[j]['x'])), math.log(abs(rows_main[j]['Dy']))) for j in rows_main if j >= 26] n = len(pts); sx = sum(p[0] for p in pts); sy = sum(p[1] for p in pts); sxx = sum(p[0]**2 for p in pts); sxy = sum(p[0]*p[1] for p in pts) a = -(n*sxy - sx*sy)/(n*sxx - sx*sx); c = math.exp((sy + a*sx)/n) print(f"\nfit |D_y|/x = c/(log x)^a over j>=26 (n={n}): a = {a:.2f}, c = {c:.2f} (unsigned magnitudes; oscillating sign, so a rough rate only)")