Current task: —

← Session 33 — ii′-3b/3c crux + F-D finding; Lagarias letter package

#2014 assistant 2026-08-25 08:01:28.917 UTC · 2593→2596 tok open ⤢
thinking (1549 chars)
The user wants to pause here, save the work, and come back with a clearer head. I should: 1. Document Finding F-D thoroughly in the archive (this is a major finding — it needs a proper record: a new findings doc or an update to D-071, plus the journal, STATE.md, NGUYEN.md). 2. Commit everything cleanly so the session ends in a resumable state. 3. NOT commit to any direction yet (the user wants to think). Let me write the finding up properly — this deserves its own derivation file (D-072) since it's a major documented finding with numerical evidence (E-030-adjacent; actually let me register the envelope-integral computation as an experiment, E-031, since it's the key numerical evidence). Then update journal/STATE/NGUYEN and commit. Plan: 1. E-031 script + data (the product-profile scan + envelope integral at T = √n and the repair scan at T = c√n) — deterministic, cached. 2. D-072 (the F-D finding doc): the bug, the evidence, the mechanism, the impact, the repair options, the literature status, the open questions. 3. Journal append (session-038's final section). 4. STATE.md: NEXT ACTION = "return to F-D with a clearer head; the repair sketch is in D-072 §R". 5. NGUYEN.md: session log + a prominent note in the checklist (ii′-6 blocked by F-D; R-004's analytic chain status flagged). 6. Commit. The session end protocol (§8.4) applies: journal, files, indexes, db, STATE.md last with NEXT ACTION, commit. Let me write E-031 first (it consolidates the product scans + envelope integrals + repair verification I ran interactively).
Understood — pausing here so you can think it over. Saving everything cleanly: the finding documented with its numerical evidence, and the session closed in a fully resumable state.
tool: Write ok
input
{
  "file_path": "D:\\Python\\Quantum\\research\\numerics\\scripts\\E-031-right-tail-stepping.py",
  "content": "#!/usr/bin/env python3\n\"\"\"E-031 \u2014 Finding F-D: the right-tail of the horizontals in Lagarias's\nThm 6.1 contour (the (6.12) stepping). Session 038.\n\nCLAIM CHECKED: Lagarias (6.12) asserts that |k_n(s)\u00b7L\u2032/L(s)| decreases\ngeometrically per unit step right from \u03c3 = 3 (zeta halves via (6.10),\nkernel ratio \u2264 e via (6.12)) \u27f9 right part of the horizontals is O(\u221an).\n\nFINDING: the per-step product ratio is e/2 > 1 \u2014 the product GROWS\nfrom \u03c3 = 3 to \u03c3 \u2248 0.36\u221an, peaking at ~e^{0.066\u221an}. The stepping is\nbroken as written at T = \u221an; the right-tail envelope integral is\n~5.9\u00d710\u00b9\u2070 at n = 10\u2075 (vs the ~3.3 charged in D-036/D-037).\n\nREPAIR CHECK: at T = c\u221an with c = 1.5, 2 the product DECREASES from\n\u03c3 = 3 (kernel ratio \u2264 e^{1/c\u00b2} < 2) \u2014 the stepping then works.\n\nComputations (direct, no contour-modeling):\n  V1: product profile |k_n(w\u22121)|\u00b7|\u03a3_{k<300} \u039b(k)/k^w| at w = \u03c3+i\u221an\n      for \u03c3 \u2208 grid, n \u2208 {10\u00b3, 10\u2074, 10\u2075} \u2014 peak position ~0.36\u221an,\n      peak height ~e^{0.066\u221an}.\n  V2: the right-tail envelope integral \u222b_{3}^{2\u221an} (step 2) at\n      n = 10\u2074, 10\u2075.\n  V3: the same profile at T = c\u221an, c \u2208 {1, 1.5, 2}, n = 10\u2075 \u2014 the\n      product decreases from \u03c3 = 3 for c \u2265 1.5.\n\"\"\"\nimport json\nimport sys\nfrom pathlib import Path\n\nimport mpmath as mp\n\nmp.mp.dps = 25\n\nDATA = Path(__file__).resolve().parent.parent / \"data\"\nCSV = DATA / \"E-031-right-tail-stepping.csv\"\nJSON = DATA / \"E-031-right-tail-stepping.json\"\n\n_PRIMES = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]\n\n\ndef vonM(k):\n    k = int(k)\n    for p in _PRIMES:\n        if k == p:\n            return mp.log(p)\n        if k % p == 0:\n            m = k\n            while m % p == 0:\n                m //= p\n            if m == 1:\n                return mp.log(p)\n            return mp.mpf(0)\n    return mp.mpf(0)\n\n\ndef product(n, sig, c=1.0):\n    \"\"\"|k_n(w\u22121)| \u00b7 |\u03a3_{k<300} \u039b(k)/k^w| at w = sig + i\u00b7c\u221an.\"\"\"\n    T = c * mp.sqrt(n)\n    w = sig + T * 1j\n    kn = abs(1 + 1 / (w - 1)) ** n\n    z = mp.mpc(0)\n    for k in range(2, 300):\n        z += vonM(k) / k ** w\n    return kn * abs(z)\n\n\ndef envelope_integral(n):\n    \"\"\"\u222b_{3}^{2\u221an} product d\u03c3 (step 2), T = \u221an.\"\"\"\n    T = mp.sqrt(n)\n    tot = mp.mpf(0)\n    peak = (mp.mpf(0), mp.mpf(0))\n    sig = mp.mpf(3)\n    while sig < 2 * T:\n        v = product(n, sig)\n        if v > peak[0]:\n            peak = (v, sig)\n        tot += v * 2\n        sig += 2\n    return tot, peak\n\n\ndef main() -> int:\n    if JSON.exists() and \"--force\" not in sys.argv:\n        print(f\"cached: {JSON} (use --force to recompute)\")\n        return 0\n\n    rows = []\n    # V1: peak profile across n (T = \u221an)\n    v1 = {}\n    for n in [10 ** 3, 10 ** 4, 10 ** 5]:\n        T = mp.sqrt(n)\n        best = (mp.mpf(0), mp.mpf(0))\n        sig = mp.mpf(3)\n        while sig < 2 * T:\n            v = product(n, sig)\n            if v > best[0]:\n                best = (v, sig)\n            sig += 2\n        v1[n] = (best, T)\n        rows.append({\"check\": \"V1_peak\", \"n\": mp.nstr(n, 6), \"c\": \"1.0\",\n                     \"peak_product\": mp.nstr(best[0], 6),\n                     \"peak_sigma\": mp.nstr(best[1], 6),\n                     \"peak_sigma_over_sqrt\": mp.nstr(best[1] / T, 4),\n                     \"log_peak_over_sqrt\": mp.nstr(mp.log(best[0]) / T, 5)})\n    # V2: envelope integral\n    v2 = {}\n    for n in [10 ** 4, 10 ** 5]:\n        tot, peak = envelope_integral(n)\n        v2[n] = (tot, peak)\n        rows.append({\"check\": \"V2_envelope_integral\", \"n\": mp.nstr(n, 6), \"c\": \"1.0\",\n                     \"envelope_integral\": mp.nstr(tot, 6),\n                     \"peak_product\": mp.nstr(peak[0], 6),\n                     \"peak_sigma\": mp.nstr(peak[1], 6),\n                     \"peak_sigma_over_sqrt\": \"\",\n                     \"log_peak_over_sqrt\": \"\"})\n    # V3: the repair (product decreases from \u03c3 = 3 for c \u2265 1.5)\n    n = 10 ** 5\n    repair_ok = {}\n    for c in [1.0, 1.5, 2.0]:\n        vals = [product(n, sig, c) for sig in [3, 10, 30, 60, 100, 200]]\n        decreasing = all(vals[i + 1] < vals[i] for i in range(len(vals) - 1))\n        repair_ok[c] = decreasing\n        rows.append({\"check\": \"V3_repair_decreases\", \"n\": mp.nstr(n, 6), \"c\": mp.nstr(c, 3),\n                     \"logP_at_3\": mp.nstr(mp.log(vals[0]), 6),\n                     \"logP_at_100\": mp.nstr(mp.log(vals[4]), 6),\n                     \"monotone_decrease\": str(decreasing),\n                     \"peak_sigma_over_sqrt\": \"\", \"envelope_integral\": \"\",\n                     \"peak_product\": \"\", \"peak_sigma\": \"\", \"log_peak_over_sqrt\": \"\"})\n\n    v1_ok = all(v1[n][0][0] > 1 and mp.mpf(\"0.2\") < v1[n][0][1] / v1[n][1] < mp.mpf(\"0.6\")\n                for n in v1)\n    v2_ok = v2[10 ** 5][0] > 10 ** 9  # the envelope really is ~10\u00b9\u2070 at 1e5\n    v3_ok = repair_ok[1.5] and repair_ok[2.0] and not repair_ok[1.0]\n\n    DATA.mkdir(exist_ok=True)\n    with CSV.open(\"w\") as f:\n        f.write(\",\".join(rows[0].keys()) + \"\\n\")\n        for r in rows:\n            f.write(\",\".join(r.values()) + \"\\n\")\n    sidecar = {\n        \"experiment\": \"E-031\",\n        \"title\": \"Finding F-D: the right-tail of Lagarias's Thm 6.1 horizontals ((6.12) stepping broken)\",\n        \"session\": \"038\",\n        \"design_doc\": \"D-072\",\n        \"checks\": {\"V1_peak_tracks_0.36sqrt_e^{0.066sqrt}\": v1_ok,\n                   \"V2_envelope_~6e10_at_1e5\": v2_ok,\n                   \"V3_repair_works_for_c>=1.5\": v3_ok},\n        \"all_checks_pass\": v1_ok and v2_ok and v3_ok,\n        \"dps\": 25,\n        \"notes\": \"The (6.12) product ratio is e/2 > 1: the right-tail grows to \"\n                 \"~e^{0.066\u221an} at \u03c3 \u2248 0.36\u221an (5.9e10 envelope at n=1e5). \"\n                 \"Repair: T = c\u221an with c \u2265 ~1.25 makes the product decrease per step.\",\n    }\n    with JSON.open(\"w\") as f:\n        json.dump(sidecar, f, indent=2)\n    print(f\"V1 peak profile: {v1_ok} | V2 envelope ~6e10: {v2_ok} | V3 repair: {v3_ok}\")\n    print(f\"wrote {CSV} + {JSON}\")\n    return 0 if sidecar[\"all_checks_pass\"] else 1\n\n\nif __name__ == \"__main__\":\n    sys.exit(main())\n"
}
result 2026-08-25 08:01:29Z → 2026-08-26 22:46:38Z
{
  "type": "create",
  "filePath": "D:\\Python\\Quantum\\research\\journal\\session-042.md",
  "content": "# Session 042 (2026-08-26) \u2014 REVIEW REVISION: the user's Paper-A review fully actioned\n\n## Mission\nThe user returned a detailed expert review of the ii\u2032-7 Paper A (\"the\nrevised Paper A is dramatically stronger ... but I would not submit this\nexact PDF yet\") with six required fixes. Action all of them, with\nverification where the review flagged a factual vulnerability.\n\n## 1. THE CERTIFICATE RETRACTION (the review's top finding \u2014 REAL)\nThe review: Step 5's \"\u03bb_n > 0 to 5\u00d710\u2075 by Misguich\u2013Voros\" could not be\nallowed to carry the finite splice unless checked theorem-by-theorem,\nsince the cited reference is explicitly *Discretized* Keiper/Li.\nVerification performed (not assumed):\n- The bib entry is Voros alone, Exp. Math. 29(4):452\u2013469, 2020\n  (arXiv:1703.02844).\n- Fetched and read the paper (pypdf extraction of the full text):\n  Misguich computed the DEFORMED sequence {\u039b_n} (Voros's eq. 36), not\n  the ordinary \u03bb_n \u2014 and the source is \"G. Misguich, calculations ...\n  (private communications, 2017)\" [their ref. 25]. Doubly unsuitable:\n  wrong sequence AND not a checkable published source.\n- The same read surfaced the **sound replacement**: \"n = 10\u2075 attained by\n  Johansson [18, \u00a7 4.2]\" \u2014 F. Johansson, \"Rigorous high-precision\n  computation of the Hurwitz zeta function and its derivatives\", Numer.\n  Algor. 69 (2015) 253\u2013270 (arXiv:1309.2877). Verified in that paper's\n  \u00a7 4.2 (\"Computing the Keiper\u2013Li coefficients\"): the ORDINARY\n  coefficients \u03bb_0\u2026\u03bb_{100000} computed with rigorous interval-arithmetic\n  error bounds, all positive (\"shows agreement with Keiper's conjecture\n  (and the Riemann hypothesis)\"), \u03bb_100000 certified to ~2900 digits.\n- AND the novelty-relevant precursor: Oesterl\u00e9 [26, prop. 2] (typescript\n  2000, revised 2001, uncirculated, cited in Voros): RH-to-T\u2080 \u27f9\n  \u03bb_n \u2265 0 for n \u2264 T\u2080\u00b2 \u2014 the finite-height STATEMENT exists unpublished.\nAction: Lean perimeter `LiVerifiedUpTo` reduced (5\u00b710\u2075) \u2192 (10\u2075) (three\ntheorem sites + docstrings; the assembly's hfinite branch uses exactly\nn < 10\u2075, so nothing else changes; rebuild GREEN 8775 jobs; audit\nre-run: 29 decls, 3 standard axioms only). Paper Step 5 rewritten as\nthe declared certificate `LiVerifiedUpTo($10^5$)` with the honest\ntwo-leg evidence (Johansson to 10\u2075 + E-011/E-015 to 3000) and a\nfootnote recording the retraction. Archive: R-004, D-037 erratum\nADDENDUM, NGUYEN.md (3.2 + ii\u2032-7 + Ledger #6), STATE.md.\n\n## 2. Hypothesis count (user-caught arithmetic error)\n\"Eight named hypotheses\" was wrong: 2 computational + 5 analytic =\nSEVEN (the analytic list itself names five: ZeroCountProp,\nZeroCountProp2, ZeroCountGlobalProp, NoLowZeros, MZeroProp). Fixed\neverywhere; per the review's advice, Appendix B now carries the final\nLean signature copied verbatim (tt-quote form, unicode via math) and\nthe count is taken from the signature, not from memory.\n\n## 3. Theorem statement \u2194 trust boundary\nBoth Theorem environments now assume (i) RH verified to T\u2080\n(Platt\u2013Trudgian, interval arithmetic) and (ii) \u03bb_n > 0 for n \u2264 10\u2075\n(Step 5) \u2014 the abstract's \"conditional on RH verification and finite Li\ncomputations\" and the formal theorem's hypotheses now agree. Appendix B\ngains the instantiation list mapping each of the seven hypotheses to\nits cited source (Platt\u2013Trudgian also discharges NoLowZeros via the\nlowest zero at 14.134\u2026; Trudgian 2014 discharges the three counting\nProps; E-023 discharges MZeroProp).\n\n## 4. Novelty hedged\n\"first assembled explicit chain\" \u2192 \"we have found no previous explicit\nassembly\"; \"maximal content of the Li route short of RH\" \u2192 the narrow\nVoros form (eventual positivity of all large \u03bb_n \u27f9 RH, so no result\nshort of RH asserts an infinite positive tail). Oesterl\u00e9's unpublished\nprecursor (n \u2264 T\u2080\u00b2) explicitly noted with a new bib entry\n(oesterle2000); Lagarias 2007's published weaker window\n(n \u2264 T\u00b2/(4 log\u00b2 T)) already in Remark (i).\n\n## 5. F-D dog-leg promoted to \u00a73.1\n\"Repair of the right-horizontal estimate\": the failed implication\n(e/2 > 1), the exact deformation H_low = H_high \u2212 V_right + V_left, the\nsafe high-tail contraction (q = e^{4/9}/2 < 1), the precise Lagarias\nwording (\"the geometric-decrease conclusion following (6.12) is not\nimplied by the displayed bounds when T \u224d \u221an\" \u2014 proof-gap framing, not\ntheorem-false), and the open hidden-cancellation question (E-032)\nrecorded but not relied on. The Step-2 footnote now carries only\nF-A/F-B/F-E and points at \u00a73.1.\n\n## 6. Appendix B additions\nThe verbatim signature, the instantiation list, and the review's\ndependency-chain display (partial fractions \u2192 S_f = Res\u2081 \u2192 rectangle\nidentity \u2192 four side bounds \u2192 sfBoundProp \u2192\nlambda_pos_finite_height_closed). Plus Section 2 compressed to one\nparagraph (certificate method; R(\u03c8) detail deferred to the companion\nnote) and the revision date 2026-08-20 \u2192 2026-08-26.\n\n## Verification + side effects\n- pdflatex + bibtex cycle: compiles clean, **11 pp**, zero undefined\n  refs; both new bib entries (johansson2015, oesterle2000) resolve.\n  One LaTeX issue hit and fixed (unicode \u2200/\u2115/\u2264/\u211d in the verbatim block\n  \u2192 tt-quote with math).\n- cover-letter.md + referee-list.md Misguich mentions corrected to\n  Johansson. draft.tex (FROZEN), paperB.tex, and the user's\n  correspondence package untouched.\n\n## Commits\n79c96f2 (Lean certificate reduction + audit) + this one (paper revision\n+ archive closure).\n\n## Status at close\nPaper A is at the revised state the review describes. NEXT: the user's\nread-through of the REVISED paperA.pdf + the submission decision\n(cover-letter.md + referee-list.md updated, target Experimental\nMathematics).\n",
  "structuredPatch": [],
  "originalFile": null
}
raw content_json (database row)
[{"type":"thinking","thinking":"The user wants to pause here, save the work, and come back with a clearer head. I should:\n1. Document Finding F-D thoroughly in the archive (this is a major finding — it needs a proper record: a new findings doc or an update to D-071, plus the journal, STATE.md, NGUYEN.md).\n2. Commit everything cleanly so the session ends in a resumable state.\n3. NOT commit to any direction yet (the user wants to think).\n\nLet me write the finding up properly — this deserves its own derivation file (D-072) since it's a major documented finding with numerical evidence (E-030-adjacent; actually let me register the envelope-integral computation as an experiment, E-031, since it's the key numerical evidence). Then update journal/STATE/NGUYEN and commit.\n\nPlan:\n1. E-031 script + data (the product-profile scan + envelope integral at T = √n and the repair scan at T = c√n) — deterministic, cached.\n2. D-072 (the F-D finding doc): the bug, the evidence, the mechanism, the impact, the repair options, the literature status, the open questions.\n3. Journal append (session-038's final section).\n4. STATE.md: NEXT ACTION = \"return to F-D with a clearer head; the repair sketch is in D-072 §R\".\n5. NGUYEN.md: session log + a prominent note in the checklist (ii′-6 blocked by F-D; R-004's analytic chain status flagged).\n6. Commit.\n\nThe session end protocol (§8.4) applies: journal, files, indexes, db, STATE.md last with NEXT ACTION, commit.\n\nLet me write E-031 first (it consolidates the product scans + envelope integrals + repair verification I ran interactively).","signature":""},{"type":"text","text":"Understood — pausing here so you can think it over. Saving everything cleanly: the finding documented with its numerical evidence, and the session closed in a fully resumable state."},{"type":"tool_use","id":"Write_342","name":"Write","input":{"file_path":"D:\\Python\\Quantum\\research\\numerics\\scripts\\E-031-right-tail-stepping.py","content":"#!/usr/bin/env python3\n\"\"\"E-031 — Finding F-D: the right-tail of the horizontals in Lagarias's\nThm 6.1 contour (the (6.12) stepping). Session 038.\n\nCLAIM CHECKED: Lagarias (6.12) asserts that |k_n(s)·L′/L(s)| decreases\ngeometrically per unit step right from σ = 3 (zeta halves via (6.10),\nkernel ratio ≤ e via (6.12)) ⟹ right part of the horizontals is O(√n).\n\nFINDING: the per-step product ratio is e/2 > 1 — the product GROWS\nfrom σ = 3 to σ ≈ 0.36√n, peaking at ~e^{0.066√n}. The stepping is\nbroken as written at T = √n; the right-tail envelope integral is\n~5.9×10¹⁰ at n = 10⁵ (vs the ~3.3 charged in D-036/D-037).\n\nREPAIR CHECK: at T = c√n with c = 1.5, 2 the product DECREASES from\nσ = 3 (kernel ratio ≤ e^{1/c²} < 2) — the stepping then works.\n\nComputations (direct, no contour-modeling):\n  V1: product profile |k_n(w−1)|·|Σ_{k<300} Λ(k)/k^w| at w = σ+i√n\n      for σ ∈ grid, n ∈ {10³, 10⁴, 10⁵} — peak position ~0.36√n,\n      peak height ~e^{0.066√n}.\n  V2: the right-tail envelope integral ∫_{3}^{2√n} (step 2) at\n      n = 10⁴, 10⁵.\n  V3: the same profile at T = c√n, c ∈ {1, 1.5, 2}, n = 10⁵ — the\n      product decreases from σ = 3 for c ≥ 1.5.\n\"\"\"\nimport json\nimport sys\nfrom pathlib import Path\n\nimport mpmath as mp\n\nmp.mp.dps = 25\n\nDATA = Path(__file__).resolve().parent.parent / \"data\"\nCSV = DATA / \"E-031-right-tail-stepping.csv\"\nJSON = DATA / \"E-031-right-tail-stepping.json\"\n\n_PRIMES = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]\n\n\ndef vonM(k):\n    k = int(k)\n    for p in _PRIMES:\n        if k == p:\n            return mp.log(p)\n        if k % p == 0:\n            m = k\n            while m % p == 0:\n                m //= p\n            if m == 1:\n                return mp.log(p)\n            return mp.mpf(0)\n    return mp.mpf(0)\n\n\ndef product(n, sig, c=1.0):\n    \"\"\"|k_n(w−1)| · |Σ_{k<300} Λ(k)/k^w| at w = sig + i·c√n.\"\"\"\n    T = c * mp.sqrt(n)\n    w = sig + T * 1j\n    kn = abs(1 + 1 / (w - 1)) ** n\n    z = mp.mpc(0)\n    for k in range(2, 300):\n        z += vonM(k) / k ** w\n    return kn * abs(z)\n\n\ndef envelope_integral(n):\n    \"\"\"∫_{3}^{2√n} product dσ (step 2), T = √n.\"\"\"\n    T = mp.sqrt(n)\n    tot = mp.mpf(0)\n    peak = (mp.mpf(0), mp.mpf(0))\n    sig = mp.mpf(3)\n    while sig < 2 * T:\n        v = product(n, sig)\n        if v > peak[0]:\n            peak = (v, sig)\n        tot += v * 2\n        sig += 2\n    return tot, peak\n\n\ndef main() -> int:\n    if JSON.exists() and \"--force\" not in sys.argv:\n        print(f\"cached: {JSON} (use --force to recompute)\")\n        return 0\n\n    rows = []\n    # V1: peak profile across n (T = √n)\n    v1 = {}\n    for n in [10 ** 3, 10 ** 4, 10 ** 5]:\n        T = mp.sqrt(n)\n        best = (mp.mpf(0), mp.mpf(0))\n        sig = mp.mpf(3)\n        while sig < 2 * T:\n            v = product(n, sig)\n            if v > best[0]:\n                best = (v, sig)\n            sig += 2\n        v1[n] = (best, T)\n        rows.append({\"check\": \"V1_peak\", \"n\": mp.nstr(n, 6), \"c\": \"1.0\",\n                     \"peak_product\": mp.nstr(best[0], 6),\n                     \"peak_sigma\": mp.nstr(best[1], 6),\n                     \"peak_sigma_over_sqrt\": mp.nstr(best[1] / T, 4),\n                     \"log_peak_over_sqrt\": mp.nstr(mp.log(best[0]) / T, 5)})\n    # V2: envelope integral\n    v2 = {}\n    for n in [10 ** 4, 10 ** 5]:\n        tot, peak = envelope_integral(n)\n        v2[n] = (tot, peak)\n        rows.append({\"check\": \"V2_envelope_integral\", \"n\": mp.nstr(n, 6), \"c\": \"1.0\",\n                     \"envelope_integral\": mp.nstr(tot, 6),\n                     \"peak_product\": mp.nstr(peak[0], 6),\n                     \"peak_sigma\": mp.nstr(peak[1], 6),\n                     \"peak_sigma_over_sqrt\": \"\",\n                     \"log_peak_over_sqrt\": \"\"})\n    # V3: the repair (product decreases from σ = 3 for c ≥ 1.5)\n    n = 10 ** 5\n    repair_ok = {}\n    for c in [1.0, 1.5, 2.0]:\n        vals = [product(n, sig, c) for sig in [3, 10, 30, 60, 100, 200]]\n        decreasing = all(vals[i + 1] < vals[i] for i in range(len(vals) - 1))\n        repair_ok[c] = decreasing\n        rows.append({\"check\": \"V3_repair_decreases\", \"n\": mp.nstr(n, 6), \"c\": mp.nstr(c, 3),\n                     \"logP_at_3\": mp.nstr(mp.log(vals[0]), 6),\n                     \"logP_at_100\": mp.nstr(mp.log(vals[4]), 6),\n                     \"monotone_decrease\": str(decreasing),\n                     \"peak_sigma_over_sqrt\": \"\", \"envelope_integral\": \"\",\n                     \"peak_product\": \"\", \"peak_sigma\": \"\", \"log_peak_over_sqrt\": \"\"})\n\n    v1_ok = all(v1[n][0][0] > 1 and mp.mpf(\"0.2\") < v1[n][0][1] / v1[n][1] < mp.mpf(\"0.6\")\n                for n in v1)\n    v2_ok = v2[10 ** 5][0] > 10 ** 9  # the envelope really is ~10¹⁰ at 1e5\n    v3_ok = repair_ok[1.5] and repair_ok[2.0] and not repair_ok[1.0]\n\n    DATA.mkdir(exist_ok=True)\n    with CSV.open(\"w\") as f:\n        f.write(\",\".join(rows[0].keys()) + \"\\n\")\n        for r in rows:\n            f.write(\",\".join(r.values()) + \"\\n\")\n    sidecar = {\n        \"experiment\": \"E-031\",\n        \"title\": \"Finding F-D: the right-tail of Lagarias's Thm 6.1 horizontals ((6.12) stepping broken)\",\n        \"session\": \"038\",\n        \"design_doc\": \"D-072\",\n        \"checks\": {\"V1_peak_tracks_0.36sqrt_e^{0.066sqrt}\": v1_ok,\n                   \"V2_envelope_~6e10_at_1e5\": v2_ok,\n                   \"V3_repair_works_for_c>=1.5\": v3_ok},\n        \"all_checks_pass\": v1_ok and v2_ok and v3_ok,\n        \"dps\": 25,\n        \"notes\": \"The (6.12) product ratio is e/2 > 1: the right-tail grows to \"\n                 \"~e^{0.066√n} at σ ≈ 0.36√n (5.9e10 envelope at n=1e5). \"\n                 \"Repair: T = c√n with c ≥ ~1.25 makes the product decrease per step.\",\n    }\n    with JSON.open(\"w\") as f:\n        json.dump(sidecar, f, indent=2)\n    print(f\"V1 peak profile: {v1_ok} | V2 envelope ~6e10: {v2_ok} | V3 repair: {v3_ok}\")\n    print(f\"wrote {CSV} + {JSON}\")\n    return 0 if sidecar[\"all_checks_pass\"] else 1\n\n\nif __name__ == \"__main__\":\n    sys.exit(main())\n"},"extra_content":null}]