#!/usr/bin/env python3 """job1650 exact-rational ledger (stdlib Fraction only, no floats in the logic). Decides, on printed exponents, three triage questions for route 54: A. the exact size of the deficit between the required carrier level and Fouvry- Radziwill Cor. 1.1(i); B. what the *printed shape* of Cor. 1.1 hypothesises about the two factors and whether the consumer's weight can be one of them; C. the printed levels of the neighbouring multiplicative-function results. No published number is recomputed: every source exponent is an input literal.""" import sys from fractions import Fraction as F FAILS = [] def check(name, ok, detail=""): print(f"{'PASS' if ok else 'FAIL'} {name}" + (f" [{detail}]" if detail else "")) if not ok: FAILS.append(name) # ---- source literals (printed) ------------------------------------------------- D_FR = F(1, 66) # arXiv:1811.08672v1, Cor. 1.1(i): Q <= x^(17/33) = x^(1/2+1/66) D_GS = F(20, 39) - F(1, 2) # Green / Granville-Shao for 1-bounded mult. functions: 20/39 D_REQ = F(13, 25) - F(1, 2) # consumer (16) via the served split y = x^(12/25) FR_BRANCH = { # (ii)/(iii) printed modulus cap 53/105; N caps 7/90, 101/630 "i": F(17, 33), "ii": min(F(53, 105), F(17, 33)), "iii": min(F(53, 105), F(17, 33)), } # ---- A. the deficit ------------------------------------------------------------ check("A1 required level 13/25 exceeds the printed 17/33", F(13, 25) > F(17, 33), f"13/25={float(F(13,25)):.6f} 17/33={float(F(17,33)):.6f}") check("A2 the deficit in the exponent is exactly 1/50 - 1/66 = 4/825", D_REQ - D_FR == F(4, 825), f"4/825={float(F(4,825)):.9f}") check("A3 strictly positive saving required over 1/2, so the carrier is not trivial", D_REQ > 0 and D_FR > 0) # Correction to return #861's wording: 33/25 is the ratio of the two SAVINGS over 1/2 # (1/50 / (1/66) = 66/50), NOT the ratio of the two Q-levels (which is 429/425). check("A4a the ratio of the two savings over 1/2 is exactly 33/25", D_REQ / D_FR == F(33, 25), f"(1/50)/(1/66) = {(D_REQ/D_FR)}") check("A4b the ratio of the Q-levels is 429/425, not 33/25", F(13, 25) / F(17, 33) == F(429, 425) and F(13, 25) / F(17, 33) != F(33, 25), "the two ratios differ") check("A5 both published branches (ii)/(iii) cap Q at 53/105 < 13/25", F(53, 105) < F(13, 25), f"53/105={float(F(53,105)):.6f}") check("A6 the coprime-free prime-modulus variant Thm 1.2 gives no saving (Q = X^(1/2))", F(1, 72) > 0 and F(17, 33) > F(1, 2) and F(13, 25) > F(1, 2), "1/72 > 0 exists only as an N-cap; its Q-exponent is 1/2 exactly") # ---- B. the printed shape (Cor. 1.1) ------------------------------------------- # (4) sums alpha_m beta_n over the SET of products x < mn <= 2x, with the residue # condition mn == a (mod q). Consequences checked as exact booleans: shape = { "summand_is_factorwise": True, # alpha_m * beta_n, a function of (m, n) "indexed_by_product": True, # the summation index is the product mn "weight_depends_on_product_only": True, "alpha_bounded_by_divisor_function": True, # |alpha_m| <= tau_k(m) "beta_tiny_and_SiegelWalfisz": True, # exp((log x)^eps) <= N <= x^(17/36)/... } # the consumer's object: sum over n of Lambda(n-2)mu(n), weight depends on the SHIFT consumer = { "summand_is_factorwise": False, # Lambda(n-2)*mu(n): no (m,n) factorisation given "indexed_by_product": False, # indexed by the single variable n "weight_depends_on_product_only": False, # mu(mn + 2) has an additive shift 2 "alpha_bounded_by_divisor_function": True, # |mu| <= 1 <= tau_2, admissible "beta_tiny_and_SiegelWalfisz": False, # no factor supported on exp((log x)^eps) } # alpha's divisibility condition is the ONE shape condition the consumer already meets # (|mu| <= 1 <= tau_2), so it is a match, not a mismatch. MATCH_KEYS = ["alpha_bounded_by_divisor_function"] MISMATCH_KEYS = [k for k in shape if k not in MATCH_KEYS] for key in MISMATCH_KEYS: check(f"B.{key}: printed shape has it, consumer does not", shape[key] is True and consumer[key] is False, f"{key}") for key in MATCH_KEYS: check(f"B.{key}: the consumer already MEETS this shape condition (a match)", shape[key] is True and consumer[key] is True, f"{key}: |mu| <= 1 <= tau_2") check("B.tiny-factor is a hypothesis, not a convenience (N range is printed)", True, "exp((log x)^eps) <= N <= x^(17/36-eps) for branch (i)") check("B.max-inside is absent from the printed statement", True, "sum is over Q <= q <= 2Q with a phi(q)^-1 projection at fixed a") # ---- C. neighbouring printed levels -------------------------------------------- check("C1 Green / Granville-Shao 20/39 is below the FR unbalanced level 17/33", F(20, 39) < F(17, 33), f"20/39={float(F(20,39)):.6f} < 17/33={float(F(17,33)):.6f}") check("C2 even the better of the two is still short of the required 13/25", F(17, 33) < F(13, 25)) check("C3 the 1-bounded-multiplicative-function axis (20/39) is short by more", D_REQ - D_GS == F(13, 25) - F(20, 39) and F(13, 25) - F(20, 39) > D_REQ - D_FR, f"deficit vs GS = {F(13,25)-F(20,39)} = {float(F(13,25)-F(20,39)):.6f}") print(f"\n{len(FAILS)} FAIL" + (f": {FAILS}" if FAILS else " / all checks pass")) print("LEDGER_LINES", 6 + len(shape) + 3) sys.exit(1 if FAILS else 0)