#!/usr/bin/env python3 """Job 2920 (route 78): does the served kk-lower-bound (version 3) already carry the four repairs route 78 asked for in return #49's manuscript? Usage: python3 check2920.py paper.md [rev2.md] paper.md : /../files/ab7534f85b903cf55b1f152d16efb32ae55dd627f93b985397c00486f9e89b74 rev2.md : optional, #1538's kk-lower-bound.rev2.md (sha d1f4661b...), for the contrast column Stdlib only; deterministic stdout. """ import hashlib, json, re, sys V3 = "ab7534f85b903cf55b1f152d16efb32ae55dd627f93b985397c00486f9e89b74" # (item, description, regex, expected presence in version 3) ANCHORS = [ ("1-ledger", "withdrawn phrase 'g(2)=2 and g(3)=2 counted'", r"g\(2\)\s*=\s*2 and g\(3\)\s*=\s*2", False), ("1-ledger", "ledger constant -2.529967 (C_excl)", r"2\.5299", False), ("1-ledger", "ledger constant 1.3633 (C_actual)", r"1\.3633", False), ("1-ledger", "g(2)=1, g(3)=2 stated", r"g\(2\)=1\$?, \$?g\(3\)=2", True), ("1-ledger", "product stated as asymptotic comparability (asymp)", r"V\(\\sqrt y\)\\asymp", True), ("1-ledger", "'exponentiating an O(1) ... does not remove it'", r"exponentiating an \$O\(1\)\$", True), ("2-interface", "divisibility-form weights w_t over D(n) (Lemma 2)", r"w_t=\\#\\{1\\leq n\\leq X:D\(n\)=t\\}", True), ("2-interface", "|r_d| <= g(d) for every d | P(z)", r"\|r_d\|\\leq g\(d\)", True), ("2-interface", "printed polynomial encoding not used", r"does not use it or an unstated", True), ("2-interface", "kappa=4 applied in section 6.1", r"applies with \$\\kappa=4\$", True), ("3-rows", "OEIS A072753 row", r"A072753", False), ("3-rows", "OEIS A288815 row", r"A288815", False), ("3-rows", "identity G2(P(p_k)) - 1 = A144311(k)", r"G_2\(P\(p_k\)\)-1=\\mathrm\{A144311\}\(k\)", True), ("3-rows", "old-cutoff greedy value 2.0123", r"2\.0123", False), ("4-calibration", "'provably biased'", r"provably biased", False), ("4-calibration", "Maier-Pomerance exponent calibration", r"Maier", False), ("4-calibration", "10^134.1 called not a certificate", r"10\^\{134\.1\}\$ calculation with constants set to 1 is not such a certificate", True), ("theorems", "Theorem B form: y(log y)^3(logloglog y)^2/(loglog y)^4", r"y\(\\log y\)\^3\(\\log\\log\\log y\)\^2\}\{\(\\log\\log y\)\^4\}", True), ("theorems", "Theorem A form: G2 >> y log y (27)", r"G_2\(P\(y\)\)\\gg y\\log y", True), ] def scan(text): return {i: bool(re.search(a[2], text)) for i, a in enumerate(ANCHORS)} def main(): raw = open(sys.argv[1], "rb").read() sha = hashlib.sha256(raw).hexdigest() v3 = scan(raw.decode("utf-8")) rev2 = None if len(sys.argv) > 2: r = open(sys.argv[2], "rb").read() rev2 = {"sha256": hashlib.sha256(r).hexdigest(), "hits": scan(r.decode("utf-8"))} rows, ok = [], sha == V3 for i, (item, desc, _, want) in enumerate(ANCHORS): passed = v3[i] == want ok &= passed row = {"item": item, "anchor": desc, "expected_in_v3": want, "found_in_v3": v3[i], "pass": passed} if rev2: row["found_in_rev2"] = rev2["hits"][i] rows.append(row) out = {"paper_sha256": sha, "paper_is_v3": sha == V3, "rows": rows, "n_pass": sum(r["pass"] for r in rows), "n": len(rows), "all_pass": ok} if rev2: out["rev2_sha256"] = rev2["sha256"] print(json.dumps(out, indent=1, sort_keys=True)) if __name__ == "__main__": main()