Current task: —

Session 32 — ii′-3b start: capstone axiom audit + moments

08-24-2026 → 08-25-2026 · kimi-k3 · 26 messages · 143.3k tokens · $10.1066

Summary

Focus: ii′-3b start — audit + moments (research session 037).

What happened:

  • Capstone dependency audit (user-requested): the tight R-bound uses the 3 standard axioms only; exact perimeter recorded.
  • Route revision (D-070): the moments come from the partial-fraction identity by pure algebra — no contours.
  • LiMoments §1–4: gFun machinery, summability budget, reindex machinery, k = 1 case proved.

Outcome: moments program half done; state saved at user log-off.

26 message(s) shown — click any card's “open ⤢” for line-by-line navigation
#1847 user 2026-08-24 22:44:12.259 UTC open ⤢
Please check the NGUYEN-RH-1 project and let me know what is next on the list to work on.
#1848 assistant 2026-08-24 22:44:31.784 UTC · 5073→274 tok open ⤢
thinking (803 chars)
The state file is clear. Let me also skim the latest journal entry per the protocol to confirm. Actually, STATE.md is quite explicit about the NEXT ACTION. The user just wants to know what's next. Let me give a concise answer based on STATE.md, maybe quickly verify the journal-036 exists for consistency. A quick skim of the latest journal would be per protocol, but the user's question is simple — I can answer from STATE.md directly. To be faithful to the protocol, let me skim journal-036 briefly. Actually, the protocol says to read STATE.md first and skim latest journal + results/index.md. The question is informational; a quick check is fine. Let me do a quick glob to confirm journal-036 exists and skim its tail briefly — but that may be overkill. I'll do a light check to confirm consistency.
Per the session-start protocol I read STATE.md. Quick check of the latest journal to confirm consistency.
tool: Bash
input
{
  "command": "ls D:/Python/Quantum/research/journal/ | tail -5",
  "description": "List most recent journal files"
}
#1849 assistant 2026-08-24 22:44:47.862 UTC · 534→571 tok open ⤢
thinking (86 chars)
Journal-036 exists, matching STATE.md. Everything is consistent. Now answer concisely.
Archive is consistent (session-036 journal matches STATE.md). Here's where things stand: ## Next on the list: **Session 037 — ii′-3b (contour moments)** The immediate task is proving the **contour moment evaluations** in Lean: $$\sigma_k = -\frac{g^{(k-1)}(0)}{(k-1)!}$$ per design **D-066 route β4** — the R2(iii) Lagarias (4.10) moments, using the ii′-1b residue machinery plus the tight R-bound that was just completed in session 036 (`logDeriv_riemannZeta_sub_nearZeros_le_tight`, the 10.5·log(|t|+2) + 48 bound — this is what unblocks the moment estimates). **Remaining tier ii′ pipeline after that:** 1. **ii′-3b** — contour moments ← *next* 2. **ii′-3c** — assemble Lagarias (4.10): τ_j = c_j + (−1)ʲσ_{j+1} − (−1)ʲ, yielding the crux identity Sf(n) = Res₁(n) 3. **ii′-6** — L0 assembly: sides identity + bridge |λ_n(T)| ≤ 2·FAlt(T) (hRH) + |Sf n| ≤ Bn FAlt n on [10⁵, N₁]; includes D-069 Finding 2's H(T) near-sum repair 4. **ii′-7** — closure: `sfBoundProp : SfBoundProp` proved, final `lambda_pos_finite_height_closed` with only the 3 perimeter hypotheses, full axiom audit, paper Appendix B + tag upgrade, archive closure **Context:** Phase 5B is the active phase — closing `SfBoundProp` in Lean before Paper A submission (user directive, option (a)). ii′-5f just finished (session 036, 8 commits, ~4300-line LiTightR.lean, full build green at 8762 jobs, audits clean: 3 standard axioms only). No blockers. **Prep reading for ii′-3b** (from STATE.md): journal-036 + journal-035 banked Lean gotchas, and the D-066 design doc. One housekeeping note: LiTightR.lean is not yet root-imported — it should be imported from the root at ii′-3b or ii′-6. Ready to start ii′-3b whenever you are.
#1850 user 2026-08-24 22:46:25.493 UTC open ⤢
Before we start on ii′-3b, please run a very explicit dependency audit on the capstone theorem and record: \texttt{#print axioms logDeriv\_riemannZeta\_sub\_nearZeros\_le\_tight} plus the exact perimeter parameters.
#1851 assistant 2026-08-24 22:46:48.820 UTC · 667→840 tok open ⤢
thinking (2340 chars)
The user wants an explicit dependency audit on the capstone theorem `logDeriv_riemannZeta_sub_nearZeros_le_tight`: 1. Run `#print axioms logDeriv_riemannZeta_sub_nearZeros_le_tight` 2. Record the exact perimeter parameters. Per STATE.md handoff notes: - LEAN: elan 4.2.3 at ~/.elan/bin (export PATH per shell); toolchain v4.33.0-rc2; NguyenRH1 at research/lean/NguyenRH1 with path requires. - Iterate single-file with `lake env lean NguyenRH1/LiTightR.lean` from the package dir; `lake build NguyenRH1.LiTightR` to produce the olean for cross-file imports. - LONG RUNS: DETACHED + sandbox DISABLED + log file; poll. For lake: SINGLE command per detached spawn; short PrintAxioms in foreground. So a short PrintAxioms script can run in foreground. LiTightR.lean is NOT yet root-imported (per STATE.md), so the print-axioms script needs to import NguyenRH1.LiTightR directly. Since the olean exists (build is green at 8762 jobs — but was LiTightR built as part of that? STATE.md says "full build GREEN (8762 jobs)" and "LiTightR.lean (~4300 lines, NOT yet root-imported — import it from the root at ii′-3b or ii′-6)". The audits session036/036b were run, so presumably the olean for LiTightR exists via `lake build NguyenRH1.LiTightR` or via `lake env lean`. Let me first look at how previous audit scripts were set up. There are files like audit-session036-axioms.txt mentioned. Let me check the lean directory structure to find the pattern used for audits. Plan: 1. Look at the NguyenRH1 package directory to find existing audit scripts (e.g., PrintAxioms.lean or similar). 2. Create a small audit file (or use existing pattern) with `#print axioms logDeriv_riemannZeta_sub_nearZeros_le_tight` and also print the statement/type to record the exact perimeter parameters. 3. Run it with `lake env lean` in foreground. 4. Record the output to a file (e.g., research/lean audits folder) and report to the user. Also "record ... the exact perimeter parameters" — the perimeter hypotheses are: - (hZC : ZeroCountProp) - (hZC2 : ZeroCountProp2) - (hNLZ : NoLowZeros) I should print the exact definitions of these too — ZeroCountProp, ZeroCountProp2, NoLowZeros — so the audit records their exact statements. Perhaps use `#print` on those definitions or `#check` the theorem to show its full signature. Let me explore the Lean package first.
I'll audit the capstone. First, let me check the existing audit script pattern in the Lean package.
tool: Bash
input
{
  "command": "ls D:/Python/Quantum/research/lean/NguyenRH1/ && ls D:/Python/Quantum/research/lean/NguyenRH1/NguyenRH1/ 2>/dev/null | head -30",
  "description": "List Lean package structure"
}
tool: Grep
input
{
  "pattern": "logDeriv_riemannZeta_sub_nearZeros_le_tight",
  "path": "D:\\Python\\Quantum\\research\\lean\\NguyenRH1",
  "output_mode": "files_with_matches"
}
#1852 assistant 2026-08-24 22:48:03.108 UTC · 1905→1929 tok open ⤢
thinking (6216 chars)
I now have all three perimeter definitions verbatim from the source. Next: write an audit script that: 1. `#print axioms logDeriv_riemannZeta_sub_nearZeros_le_tight` 2. `#check` the capstone (full signature) 3. `#print` the three perimeter definitions (ZeroCountProp, ZeroCountProp2, NoLowZeros) so the output records their exact statements 4. Also print axioms of the three perimeter props? They're defs (Props), printing axioms of them would show what they depend on — propext etc. Actually the props themselves are definitions; `#print axioms ZeroCountProp` shows axioms used in its definition. Not strictly needed but harmless. The main asks: `#print axioms logDeriv_riemannZeta_sub_nearZeros_le_tight` + record the exact perimeter parameters. Also should I print `C0hat` since ZeroCountProp references it? The "exact perimeter parameters" — the user wants the exact perimeter recorded. C0hat is defined in LiSkeleton. Printing it would make the record self-contained. Let me include `#print C0hat` too, plus `zeroWindow_finite`, `zeroAbsWindow`, `zeroMult`? That could get deep. A reasonable audit record: the capstone statement, its axioms, the three perimeter def printouts, and C0hat (the majorant appearing in ZeroCountProp). Also `nearZerosSub` and `zeroMult` appear in the capstone statement — printing those makes the record fully self-contained. Let me include them. Let me check where C0hat, nearZerosSub, zeroMult are defined to make sure `#print` will resolve. They're all in the NguyenRH1 namespace presumably. `#print` with open NguyenRH1 should work. The audit file: create AuditSession037.lean following the established pattern. Note: LiTightR is NOT root-imported, so the audit must `import NguyenRH1.LiTightR` (previous session-036 audit must have done the same — let me check what audit-session036 used. Actually there's no AuditSession036.lean file listed... The ls showed AuditSession034.lean and AuditSession035.lean only, but audit-session036-axioms.txt exists. Maybe the 036 audit was a temporary script that got deleted, or it was named differently. Let me check the head of audit-session036-axioms.txt and how it was generated — actually not critical. I'll create AuditSession037.lean importing NguyenRH1.LiTightR. Wait — but is the olean for LiTightR built? STATE.md says full build GREEN 8762 jobs and LiTightR NOT root-imported; `lake build NguyenRH1.LiTightR` produces the olean. The session-036 audits ran `#print axioms` on the capstone, so the olean exists (or they used `lake env lean` on a script which builds the import). Running `lake env lean AuditSession037.lean` will compile LiTightR if the olean is stale — that could take a while in foreground. Handoff says: "For lake: SINGLE command per detached spawn; short PrintAxioms in foreground." The audits were run before, so the olean should be cached. I'll run in foreground with a generous timeout (e.g., 10 min max). If it's too slow, go detached. Environment: Windows, shell is "unknown (use Unix shell syntax)". PATH: elan at ~/.elan/bin, need `export PATH="$HOME/.elan/bin:$PATH"` per handoff. Working dir: research/lean/NguyenRH1. Plan: 1. Write AuditSession037.lean. 2. Run: `cd research/lean/NguyenRH1 && export PATH="$HOME/.elan/bin:$PATH" && lake env lean AuditSession037.lean > audit-session037-axioms.txt 2>&1` — actually better to capture output via tee so I can see it. But Bash tool returns output anyway. I'll redirect to the file and then read the file. Note: `#print` output goes to stdout (info messages) — with `lake env lean` the info diagnostics appear on stderr? In Lean 4, `#print`/`#check` outputs are info-level messages, which lean prints to stdout... Actually Lean 4 command-line prints info messages to stderr I believe. Previous audits captured them in .txt files. Safest: redirect both stdout and stderr to the file. Let me write the audit script now. Content: ```lean /- AuditSession037.lean — explicit dependency audit of the ii′-5f capstone `logDeriv_riemannZeta_sub_nearZeros_le_tight` (user-requested, pre-ii′-3b). Records: full capstone signature, #print axioms, and the exact perimeter definitions (ZeroCountProp, ZeroCountProp2, NoLowZeros) with the C0hat majorant and the statement-level constructs (nearZerosSub, zeroMult). Expected: [propext, Classical.choice, Quot.sound] only. -/ import NguyenRH1.LiTightR open NguyenRH1 /- ## 1. The capstone statement (full signature) -/ #check @logDeriv_riemannZeta_sub_nearZeros_le_tight /- ## 2. The dependency audit -/ #print axioms logDeriv_riemannZeta_sub_nearZeros_le_tight /- ## 3. The exact perimeter parameters (verbatim definitions) -/ #print ZeroCountProp #print ZeroCountProp2 #print NoLowZeros /- ## 4. Statement-level constructs appearing in the capstone/perimeter -/ #print C0hat #print nearZerosSub #print zeroMult #print zeroAbsWindow ``` Hmm, `#print axioms` inside with `open` — previous scripts used unqualified names fine. Also `#check @...` gives the full type with all hypotheses. One concern: `#print zeroMult` — zeroMult is a def; fine. nearZerosSub — def in LiTightR. C0hat in LiSkeleton. All under namespace NguyenRH1 presumably; open handles it. Do I want axioms of the perimeter props too? They're just defs (Prop-valued); `#print axioms ZeroCountProp` would show axioms in its definition chain (likely propext/choice/Quot.sound). Not requested. Keep it lean but it's cheap to add. The user asked specifically: "#print axioms logDeriv_riemannZeta_sub_nearZeros_le_tight plus the exact perimeter parameters." I'll stick to the request + minimal context constructs. Also worth recording: the nearZerosSub definition since it's in the statement. And zeroWindow_finite used in ZeroCountProp. Let me add `#print zeroWindow_finite`? zeroWindow_finite is a theorem (finiteness proof), printing it prints its type. Hmm — ZeroCountProp's def body references (zeroWindow_finite t).toFinset. `#print ZeroCountProp` will print the body including that reference, which is enough. Let me write the file and run it. Foreground with timeout 600000 (10 min) max — LiTightR is ~4300 lines; if olean is cached, the script runs in seconds. The olean should exist since session-036 audits ran. Try foreground first.
All three perimeter definitions located verbatim in LiContour.lean. Now I'll write the audit script following the established pattern and run it.
tool: Write
input
{
  "file_path": "D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\AuditSession037.lean",
  "content": "/-\nAuditSession037.lean \u2014 explicit dependency audit of the ii\u2032-5f capstone\n`logDeriv_riemannZeta_sub_nearZeros_le_tight` (user-requested, pre-ii\u2032-3b).\nRecords: (1) the full capstone signature, (2) `#print axioms` on the\ncapstone, (3) the exact perimeter definitions it takes as hypotheses\n(ZeroCountProp, ZeroCountProp2, NoLowZeros), (4) the statement-level\nconstructs appearing in the capstone/perimeter (C0hat, nearZerosSub,\nzeroMult, zeroAbsWindow).\nExpected: [propext, Classical.choice, Quot.sound] only.\n-/\nimport NguyenRH1.LiTightR\n\nopen NguyenRH1\n\n/- ## 1. The capstone statement (full signature, all hypotheses explicit) -/\n#check @logDeriv_riemannZeta_sub_nearZeros_le_tight\n\n/- ## 2. The dependency audit -/\n#print axioms logDeriv_riemannZeta_sub_nearZeros_le_tight\n\n/- ## 3. The exact perimeter parameters (verbatim definitions) -/\n#print ZeroCountProp\n#print ZeroCountProp2\n#print NoLowZeros\n\n/- ## 4. Statement-level constructs in the capstone/perimeter statements -/\n#print C0hat\n#print nearZerosSub\n#print zeroMult\n#print zeroAbsWindow\n"
}
#1853 assistant 2026-08-24 22:49:54.091 UTC · 891→1106 tok open ⤢
thinking (1657 chars)
Clean run, EXIT 0. The audit file audit-session037-axioms.txt is recorded. Now report to the user concisely. Results: 1. **Axiom dependency**: `[propext, Classical.choice, Quot.sound]` — the 3 standard axioms only. No sorryAx, no new axioms. This matches the project rule (§5.2: only propext, Classical.choice, Quot.sound permitted). 2. **Exact perimeter parameters** — the capstone takes exactly three perimeter hypotheses: - `hZC : ZeroCountProp` — unit-window mult-weighted zero count: ∀ t ≥ 2, Σ_{ρ ∈ zeroWindow(t)} zeroMult(ρ) ≤ C0hat(t+1), where C0hat t = 0.433·log(t+2) + 0.886·log log(t+2) + 2.9. [Trudgian 2014 N(T)/S(T), D-062 §4; strengthened to mult-weighted in session 035] - `hZC2 : ZeroCountProp2` — two-unit window: ∀ t ≥ 10, Σ_{|γ−t|≤1} zeroMult(ρ) ≤ 0.6·log(t+2) + 0.886·log log(t+2) + 2.7. [Trudgian two-unit specialization, D-069] - `hNLZ : NoLowZeros` — ∀ nontrivial zero ρ, 14 ≤ |Im ρ|. [Platt-class zero-location certificate, D-069] Also the theorem's other parameters: t ≥ 10, s with −5/2 ≤ Re s ≤ 3, Im s = t, ζ(s) ≠ 0. Should I commit this? The freeze protocol says commit at every sub-stage, but this is an audit, not a sub-stage. The session-end protocol handles commits. The user asked to "run" and "record" — the record is the txt file + the audit script. I won't commit without being asked (git protocol: only commit when user explicitly asks). I'll mention the files are written. Note the audit script AuditSession037.lean is a new file at the package root like AuditSession034/035 — consistent with the established pattern, and it's not imported by the root so it doesn't affect the build. Concise report now.
Audit complete, EXIT 0, recorded to `research/lean/NguyenRH1/audit-session037-axioms.txt` (script: `AuditSession037.lean`). ## 1. Axiom dependency ``` 'NguyenRH1.logDeriv_riemannZeta_sub_nearZeros_le_tight' depends on axioms: [propext, Classical.choice, Quot.sound] ``` The 3 standard axioms only — no `sorryAx`, nothing else. Compliant with the §5.2 rule. ## 2. Exact perimeter parameters (3 hypotheses, verbatim from the audit) **`hZC : ZeroCountProp`** — Trudgian 2014 N(T)/S(T), unit window (D-062 §4; mult-weighted form, session-035 strengthening): ``` ∀ (t : ℝ), 2 ≤ t → ∑ ρ ∈ (zeroWindow_finite t).toFinset, ↑(zeroMult ρ) ≤ C0hat (t + 1) ``` **`hZC2 : ZeroCountProp2`** — Trudgian two-unit specialization (D-069, Finding 1): ``` ∀ (t : ℝ), 10 ≤ t → ∑ ρ ∈ (zeroAbsWindow_finite t).toFinset, ↑(zeroMult ρ) ≤ 0.6 * log (t + 2) + 0.886 * log (log (t + 2)) + 2.7 ``` **`hNLZ : NoLowZeros`** — Platt-class zero-location certificate (D-069, P2): ``` ∀ (ρ : ℂ), IsNontrivialZero ρ → 14 ≤ |ρ.im| ``` Supporting constructs also recorded: `C0hat t = 0.433·log(t+2) + 0.886·log log(t+2) + 2.9`, `zeroMult ρ = (analyticOrderAt riemannZeta ρ).toNat`, `nearZerosSub t = {ρ | |Im ρ − t| < 1}`, `zeroAbsWindow t = {ρ | |Im ρ − t| ≤ 1}`. ## 3. Full capstone signature ``` ZeroCountProp → ZeroCountProp2 → NoLowZeros → ∀ {t : ℝ}, 10 ≤ t → ∀ {s : ℂ}, -5/2 ≤ s.re → s.re ≤ 3 → s.im = t → riemannZeta s ≠ 0 → ‖logDeriv ζ s − ∑ ρ ∈ nearZerosSub t, m_ρ/(s − ρ)‖ ≤ 10.5 * log (|t| + 2) + 48 ``` Everything checks out — the tight R-bound rests on exactly the declared perimeter and nothing else. Ready for ii′-3b on your word.
#1854 user 2026-08-24 22:51:17.898 UTC open ⤢
let's work on ii′-3b
#1855 assistant 2026-08-24 22:51:33.168 UTC · 1256→503 tok open ⤢
thinking (596 chars)
The user wants to start ii′-3b. Per STATE.md's NEXT ACTION: > Session 037: **ii′-3b** — the contour moments σ_k = −g^{(k−1)}(0)/(k−1)! (D-066 route β4: the R2(iii) Lagarias (4.10) moment evaluations via the ii′-1b residue machinery + the now-proved tight R-bound for the moment estimates). Read first: journal-036 banked gotchas + journal-035 gotchas + the D-066 design. So first I need to read the D-066 design doc to understand exactly what ii′-3b requires. Let me find and read it, plus skim the journal-036 gotchas. This is a big task. Let me set up a task list and plan. First read D-066.
Starting ii′-3b. Per the resume protocol I need the D-066 design (route β4) and the banked gotchas first.
tool: Glob
input
{
  "pattern": "research/derivations/D-066*",
  "path": "D:\\Python\\Quantum"
}
tool: TodoWrite ok
input
{
  "todos": [
    {
      "content": "Read D-066 design + journal-035/036 gotchas",
      "status": "in_progress",
      "activeForm": "Reading D-066 design + banked gotchas"
    },
    {
      "content": "Scope ii\u2032-3b: exact statement + proof skeleton of the contour moments",
      "status": "pending",
      "activeForm": "Scoping ii\u2032-3b moment theorem"
    },
    {
      "content": "Implement ii\u2032-3b in Lean",
      "status": "pending",
      "activeForm": "Implementing ii\u2032-3b in Lean"
    },
    {
      "content": "Axiom audit + full build green",
      "status": "pending",
      "activeForm": "Running axiom audit + full build"
    },
    {
      "content": "Session-037 archive closure (journal, db, STATE, commit)",
      "status": "pending",
      "activeForm": "Closing session 037 archive"
    }
  ]
}
result 2026-08-24 22:51:34Z → 2026-08-24 22:51:34Z
{
  "oldTodos": [],
  "newTodos": [
    "content='Read D-066 design + journal-035/036 gotchas' status='in_progress' active_form='Reading D-066 design + banked gotchas'",
    "content='Scope ii\u2032-3b: exact statement + proof skeleton of the contour moments' status='pending' active_form='Scoping ii\u2032-3b moment theorem'",
    "content='Implement ii\u2032-3b in Lean' status='pending' active_form='Implementing ii\u2032-3b in Lean'",
    "content='Axiom audit + full build green' status='pending' active_form='Running axiom audit + full build'",
    "content='Session-037 archive closure (journal, db, STATE, commit)' status='pending' active_form='Closing session 037 archive'"
  ],
  "cleared": false
}
#1856 assistant 2026-08-24 23:11:49.723 UTC · 11581→4530 tok open ⤢
thinking (9117 chars)
Everything's mapped. The re/conj tsum bridges aren't used in the project yet, so I'll need to find them in Mathlib. Standard names: - `Complex.ofReal_tsum`? or generic `ofReal_tsum` — in Mathlib it's `ofReal_tsum` (Mathlib.Analysis.RCLike?). Actually I recall: `RCLike.ofReal_tsum`? Hmm. There's `Complex.ofReal_tsum : ↑(∑' i, f i) = ∑' i, ↑(f i)` — let me search Mathlib quickly. - re: `Complex.reCLM` exists (used LiRBound:471 as ℂ →ₗ[ℝ] ℝ — that's reLM? it says Complex.reCLM : ℂ →ₗ[ℝ] ℝ — a LINEAR map, not CLM). For map_tsum: `ContinuousLinearMap.map_tsum`? Hmm — reCLM as →ₗ needs continuity wrapped. There's `Complex.reCLM : ℂ →L[ℝ] ℝ`?? The LiRBound usage shows `Complex.reCLM : ℂ →ₗ[ℝ] ℝ` (linear). For tsum: use `ContinuousLinearMap.map_tsum` with... or simpler: HasSum-based: `(Summable.hasSum hf).map`? Actually the cleanest: `Summable.map_tsum`? Let me just probe Mathlib. Standard: `ContinuousLinearMap.map_tsum (hf : Summable f) : φ (∑' i, f i) = ∑' i, φ (f i)`? Hmm I believe it's `(φ : F →L[𝕜] G).map_tsum : φ (∑' i, f i) = ∑' i, φ (f i)` requiring Summable f. And Complex.reCLM might be both — in Mathlib, `Complex.reCLM : ℂ →L[ℝ] ℝ` IS a continuous linear map ("CLM"). The LiRBound usage wrote (Complex.reCLM : ℂ →ₗ[ℝ] ℝ) — coercing CLM to LM. OK so Complex.reCLM is →L ✓. For conj: `Complex.conjLIE : ℂ ≃L[ℝ] ℂ`? or conjCLE. `starRingEnd ℂ` is a ring equiv + continuous. For the conj-of-tsum: I'll actually AVOID needing conj-of-tsum entirely by the double-sum trick (sigmaP k = ½(S + S) with the second S reindexed). Let me re-examine: sigmaP k = ∑' ρ (mult/2)((1/ρ)^k + (1/conjρ)^k). Write as (1/2)·[∑ mult(1/ρ)^k + ∑ mult(1/conjρ)^k]? Careful: ∑' ρ (mult/2)(A_ρ + B_ρ) = (1/2)∑' (mult·A_ρ + mult·B_ρ) [tsum const mul] = (1/2)[∑ mult A + ∑ mult B] [tsum_add — needs both summable ✓]. Then ∑ mult B = ∑ mult A via conjEquiv (per-term: mult(conjρ)·(1/conj(conjρ))^k = mult(ρ)(1/ρ)^k — zeroMult_conj + conj conj ✓). So sigmaP k = (1/2)(S + S) = S where S = ∑' mult(1/ρ)^k. NO conj-of-tsum or re bridges! ✓✓ And for k=1 step (e) I needed ∑' mult·(w.re:ℂ) = ∑' mult·w (the conj-reality of S'). Avoid re bridges here too: 2·sigmaP 1 = ∑' mult·((1/ρ).re + (1/(1−ρ)).re : ℂ)... hmm this has .re inside. Alternative k=1 path avoiding .re entirely: sigmaP 1 = ∑' ρ (mult/2)(1/ρ + 1/conjρ) = (1/2)[∑ mult/ρ?? — NOT summable. Dead end (that's why the design used re). Alternative: express via T = ∑' mult/(ρ(1−ρ)) directly: per term: (mult/2)(1/ρ + 1/conjρ) vs (mult/2)(1/ρ + 1/(1−ρ)) = mult/(2ρ(1−ρ)) ✓ summable. So if I can show ∑' ρ (mult/2)(1/ρ + 1/conjρ) = ∑' ρ (mult/2)(1/ρ + 1/(1−ρ)), i.e. ∑' ρ mult·(1/conjρ − 1/(1−ρ)) = 0?? Hmm: 1/conjρ − 1/(1−ρ): not obviously summable either (each ~1/γ). But the DIFFERENCE: 1/conjρ − 1/(1−ρ) = (1−ρ−conjρ)/(conjρ(1−ρ)) = (1−2re)/(conjρ(1−ρ)) — O(1/γ²) ✓ SUMMABLE! And its tsum: reindex by the COMPOSED equiv ρ ↦ conj(1−ρ)?? hmm: consider S'' := ∑' ρ mult·(1/conjρ − 1/(1−ρ)). Under conjEquiv: ∑' ρ mult·(1/ρ − 1/(1−conjρ)); under oneSubEquiv applied to that: ... hmm messy. Cleaner: 2·sigmaP 1 − T = ∑' ρ mult·[(1/ρ + 1/conjρ) − (1/ρ + 1/(1−ρ))] = ∑' ρ mult·[1/conjρ − 1/(1−ρ)] (tsum_sub: needs both summable — sigmaP 1 summable ✓ sigmaSlice_summable; T-family summable ✓). Then ∑' ρ mult·[1/conjρ − 1/(1−ρ)] = 0 by... reindex via conjEquiv: ↦ ∑' ρ mult·[1/ρ − 1/(1−conjρ)] =: U. Reindex via oneSubEquiv: ↦ ∑' ρ mult·[1/(1−ρ) − 1/conjρ] = −(original). So the original = U = −original ⟹ original = 0 ✓!! And each reindex is valid since the family is summable (O(1/γ²): |1−2re| ≤ 1, |conjρ(1−ρ)| = ‖ρ‖‖1−ρ‖ — via the AM-GM split 1/(‖ρ‖‖1−ρ‖) ≤ ½(‖ρ‖⁻² + ‖1−ρ‖⁻²) ✓ summable). Wait — check the reindex computations carefully: V := ∑' ρ, mult(ρ)·[1/conjρ − 1/(1−ρ)]. (i) conjEquiv e₁ (ρ ↦ conjρ): ∑' ρ, f ρ = ∑' ρ, f (e₁ ρ) where f(e₁ ρ) = mult(conjρ)·[1/conj(conjρ) − 1/(1−conjρ)] = mult(ρ)·[1/ρ − 1/(1−conjρ)] (zeroMult_conj, conj conj). So V = ∑' ρ mult·[1/ρ − 1/(1−conjρ)]. (ii) oneSubEquiv e₂ (ρ ↦ 1−ρ): V = ∑' ρ, mult(1−ρ)·[1/(1−ρ) − 1/(1−conj(1−ρ))] = ∑' ρ, mult(ρ)·[1/(1−ρ) − 1/conjρ] (zeroMult_one_sub; 1−conj(1−ρ) = 1−(1−conjρ) = conjρ). = −V's summand... the summand is mult·[1/(1−ρ) − 1/conjρ] = −mult·[1/conjρ − 1/(1−ρ)] ✓ so V = ∑' (−(that)) = −V ⟹ V = 0 ✓ (tsum_neg). Great — V = 0 with only equiv reindexes, no re/conj-of-tsum bridges anywhere. Then: 2·sigmaP 1 = T (from V = 0: 2·sigmaP 1 − T = V·... wait: 2·sigmaP 1 = ∑' mult(1/ρ + 1/conjρ); T = ∑' mult(1/ρ + 1/(1−ρ)); 2·sigmaP 1 − T = V ✓ = 0 ⟹ 2·sigmaP 1 = T). And T = seriesFun 1 − seriesFun 0 = seriesFun 1 (seriesFun 0 = 0; seriesFun 1 = T by tsum_congr per-term ✓). sigmaP 1 = T/2 = seriesFun 1/2 = (gFun 1 − B)/2 where gFun 1 = B + seriesFun 1 (§3 continuity). gFun 1 = −gFun 0 (FE) and gFun 0 = B (§3) ⟹ seriesFun 1 = −2B ⟹ sigmaP 1 = −B = −gFun 0. ✓✓ NO re bridges AT ALL. For k ≥ 2, step (f) per-term at 0 and (g): ∑' ρ, mult·(−1)^{k−1}(k−1)!·(0−ρ)^{−k} = −(k−1)!·sigmaP k: per-term: mult·(−1)^{k−1}(k−1)!·(−ρ)^{−k} = −(k−1)!·mult·ρ^{−k}·[sign check]: (−ρ)^{−k} = (−1)^k·ρ^{−k} (zpow of neg: (−ρ)^{m:ℤ}: use `neg_zpow`: (−a)^(n:ℤ) = (−1)^n·a^n — hmm `neg_zpow` signature: for monoid with... it exists: neg_zpow (a : G) (n : ℤ) : (-a)^n = (-1)^n * a^n? For n negative, (−1)^n = ((−1)^{|n|})^{±1} = (−1)^{|n|} since −1 self-inverse ✓. In ℂ: (−1)^(−k:ℤ) = ((−1)^k)⁻¹ = (−1)^k ✓.) So term = mult·(k−1)!·(−1)^{k−1}·(−1)^k·ρ^{−k} = −mult·(k−1)!·ρ^{−k} ((−1)^{2k−1} = −1 ✓ pow_add/neg_one_pow...). Then ∑' = −(k−1)!·∑' mult·ρ^{−k} [tsum of −(k−1)!·(mult·ρ^{−k}): Summable.mul_left → tsum_mul_left: ∑' (c·f) = c·∑' f ✓] = −(k−1)!·sigmaP k [via the ½(S+S) lemma ✓]. Everything avoids re/conj-of-tsum. The only tsum utilities: tsum_add, tsum_sub, tsum_mul_left (const), tsum_congr, tsum_zero, tsum_neg, Equiv.tsum_eq, Summable.of_norm_bounded/of_norm, Summable.mul_left, Equiv.summable_iff. One more check — the M-test dominator summability for the derivative families: dominator family u ρ := mult(ρ)·C_j/‖ρ‖²... wait actually SummableLocallyUniformlyOn_of_locally_bounded wants a summable ℝ-family bounding ‖term‖. I'll prove `summable_mult_div_normSq : Summable (fun ρ => (zeroMult ρ : ℝ)/‖(ρ:ℂ)‖^2)` once (comparison (9/4)·mult/(1+γ²) + zero_sum_inv_sq — the sigmaSlice_summable pattern at LiSwaps:213-216 shows the base: (WeilEF.zero_sum_inv_sq zetaSeam).mul_left (9/4)). Then everything else mul_left's constants. And for the ‖ρ‖ ≥ δ₀ lower bound: exists_ball_avoid_nontrivialZeros 0 (not IsNontrivialZero 0 — re 0 > 0 fails: ¬ IsNontrivialZero 0: h.2.1 : 0 < (0:ℂ).re = 0 contradiction ✓). Also `summable_mult_inv_pow (k ≥ 2)`: ‖mult·(1/ρ)^k‖ = mult·‖ρ‖^{−k} ≤ mult·δ₀^{2−k}·‖ρ‖^{−2}: since ‖ρ‖ ≥ δ₀ > 0: ‖ρ‖^{2−k} ≤ δ₀^{2−k} (k ≥ 2, pow_le_pow_of_nonpos?? for real: ‖ρ‖^{−(k−2)} ≤ δ₀^{−(k−2)} via one_div_le_one_div_of_le / pow_le_pow_left₀ on inverses ✓). ✓ For the k=1 summability lemmas: - `summable_mult_wTerm` : Summable (fun ρ => (zeroMult ρ:ℂ)·(1/((ρ:ℂ)·(1−(ρ:ℂ))))): ‖·‖ = mult/(‖ρ‖‖1−ρ‖) ≤ (mult/2)(‖ρ‖⁻²+‖1−ρ‖⁻²): AM-GM: 1/(ab) ≤ (a⁻²+b⁻²)/2 ✓; summability of the two: first ✓ (summable_mult_div_normSq); second: Summable (fun ρ => mult/‖1−ρ‖²) via oneSubEquiv transfer: Equiv.summable_iff: Summable (f ∘ e₂) ⟺ Summable f with f σ = mult(σ)/‖σ‖²: (f∘e₂) ρ = mult(1−ρ)/‖1−ρ‖² = mult(ρ)/‖1−ρ‖² (zeroMult_one_sub ✓). ✓ - `summable_mult_vTerm` : Summable (fun ρ => (zeroMult ρ:ℂ)·(1/conjρ − 1/(1−ρ))): norm ≤ mult·|1−2re|/(‖ρ‖‖1−ρ‖) ≤ mult/(‖ρ‖‖1−ρ‖) — via the field identity 1/conjρ − 1/(1−ρ) = (1−ρ−conjρ)/(conjρ(1−ρ)) and |1−ρ−conjρ| = |1−2re| ≤ 1... 1−ρ−conjρ = 1−2re(ρ) ✓ (re conj = re). |1−2re| ≤ 1 since re ∈ (0,1) ✓. Then the AM-GM dominator ✓. OK — design is complete and tight. Estimated file ~700–1000 lines. Sub-chunks: - §0 header + imports. - §1 xiL + basic facts (differentiable, xiL_eq, xiL_zero/one, xiL_one_sub, xiL_ne_zero) + isNontrivialZero_one_sub + conjEquiv/oneSubEquiv. - §2 gFun_eq (the B + seriesFun identity at good points). - §3 values at 0,1: seriesFun_zero, seriesFun_one, gFun_zero, gFun_one, gFun_FE (gFun 1 = −gFun 0). - §4 summability lemmas + the reindex lemmas (sigmaP_eq_unpaired for k≥2, sigmaP_one_eq_half_T). - §5 the zpow derivative lemma + per-term derivatives + M-test + termwise iteratedDeriv at 0 (k ≥ 2 main). - §6 capstone unified. Now — IMPORTANT process point: per §8.4/8.5, commit at sub-stage boundaries; write artifacts immediately. I'll iterate the file with `lake env lean NguyenRH1/LiMoments.lean` (needs the imports' oleans — LiTightR olean exists? STATE says build green 8762 jobs WITH LiTightR not root-imported — but the audits ran on it, so `lake build NguyenRH1.LiTightR` was run and its olean exists ✓). Also per the todo: mark task 1 complete, task 2 (scope) — essentially done now (this design). Let me record the design as a short derivation note? The route change should be documented (D-070) — I'll do that at closure, but actually per "save artifacts IMMEDIATELY" I could write the design note now. I'll fold it into the closure journal + D-070. Actually — the design IS substantial (route change from D-066's contour plan). Write D-070 NOW (short), then implement. Update todos and go.
Design is complete and tight. Key findings from the API sweep: - **No re/conj-of-tsum bridges needed anywhere**: the k≥2 case reduces to sigmaP k = ½(S+S) via the conj-equiv reindex; the k=1 case to V = ∑' mult·(1/conjρ − 1/(1−ρ)) = 0 via the *composed* conj/reflect reindexes (V = −V), with the mixed terms O(1/γ²) hence absolutely summable - **xiL entire closed form**: xiL(s) := (s(s−1)/2)·Λ₀(s) − (s−1)/2 + s/2 via Mathlib's `completedRiemannZeta_eq` (Λ₀ entire) — sidesteps removable-singularity proofs; xiL(0) = xiL(1) = 1/2 for free - All reindex machinery exists: `isNontrivialZero_conj`, `zeroMult_conj` (LiTightR), `zeroMult_one_sub` (LiReflect), `zeta_reflect_zero` (Zeta23) - The termwise-iterated-deriv pattern (`iteratedDerivWithin_tsum` + `SummableLocallyUniformlyOn_of_locally_bounded`) clones from LiDigamma §7–8 Let me file the route-change design note (D-070) first, then implement.
tool: TodoWrite ok
input
{
  "todos": [
    {
      "content": "Read D-066 design + journal-035/036 gotchas",
      "status": "completed",
      "activeForm": "Reading D-066 design + banked gotchas"
    },
    {
      "content": "Scope ii\u2032-3b: exact statement + proof skeleton of the contour moments",
      "status": "completed",
      "activeForm": "Scoping ii\u2032-3b moment theorem"
    },
    {
      "content": "File D-070 route-change design note",
      "status": "in_progress",
      "activeForm": "Filing D-070 route-change note"
    },
    {
      "content": "LiMoments \u00a71: xiL + equivs + basic facts",
      "status": "pending",
      "activeForm": "Building LiMoments \u00a71 (xiL)"
    },
    {
      "content": "LiMoments \u00a72: gFun = B + seriesFun at good points",
      "status": "pending",
      "activeForm": "Building LiMoments \u00a72 (gFun identity)"
    },
    {
      "content": "LiMoments \u00a73: values at 0,1 + FE sign",
      "status": "pending",
      "activeForm": "Building LiMoments \u00a73 (evaluations)"
    },
    {
      "content": "LiMoments \u00a74: summability + reindex lemmas (k=1)",
      "status": "pending",
      "activeForm": "Building LiMoments \u00a74 (k=1 rearrangement)"
    },
    {
      "content": "LiMoments \u00a75: termwise iterated deriv at 0 (k\u22652)",
      "status": "pending",
      "activeForm": "Building LiMoments \u00a75 (k\u22652 termwise)"
    },
    {
      "content": "LiMoments \u00a76: unified capstone sigmaP_eq",
      "status": "pending",
      "activeForm": "Building LiMoments \u00a76 (capstone)"
    },
    {
      "content": "Axiom audit + full build green + root import",
      "status": "pending",
      "activeForm": "Running axiom audit + full build"
    },
    {
      "content": "Session-037 archive closure (journal, db, STATE, commit)",
      "status": "pending",
      "activeForm": "Closing session 037 archive"
    }
  ]
}
result 2026-08-24 23:11:49Z → 2026-08-24 23:11:49Z
{
  "oldTodos": [
    "content='Read D-066 design + journal-035/036 gotchas' status='in_progress' active_form='Reading D-066 design + banked gotchas'",
    "content='Scope ii\u2032-3b: exact statement + proof skeleton of the contour moments' status='pending' active_form='Scoping ii\u2032-3b moment theorem'",
    "content='Implement ii\u2032-3b in Lean' status='pending' active_form='Implementing ii\u2032-3b in Lean'",
    "content='Axiom audit + full build green' status='pending' active_form='Running axiom audit + full build'",
    "content='Session-037 archive closure (journal, db, STATE, commit)' status='pending' active_form='Closing session 037 archive'"
  ],
  "newTodos": [
    "content='Read D-066 design + journal-035/036 gotchas' status='completed' active_form='Reading D-066 design + banked gotchas'",
    "content='Scope ii\u2032-3b: exact statement + proof skeleton of the contour moments' status='completed' active_form='Scoping ii\u2032-3b moment theorem'",
    "content='File D-070 route-change design note' status='in_progress' active_form='Filing D-070 route-change note'",
    "content='LiMoments \u00a71: xiL + equivs + basic facts' status='pending' active_form='Building LiMoments \u00a71 (xiL)'",
    "content='LiMoments \u00a72: gFun = B + seriesFun at good points' status='pending' active_form='Building LiMoments \u00a72 (gFun identity)'",
    "content='LiMoments \u00a73: values at 0,1 + FE sign' status='pending' active_form='Building LiMoments \u00a73 (evaluations)'",
    "content='LiMoments \u00a74: summability + reindex lemmas (k=1)' status='pending' active_form='Building LiMoments \u00a74 (k=1 rearrangement)'",
    "content='LiMoments \u00a75: termwise iterated deriv at 0 (k\u22652)' status='pending' active_form='Building LiMoments \u00a75 (k\u22652 termwise)'",
    "content='LiMoments \u00a76: unified capstone sigmaP_eq' status='pending' active_form='Building LiMoments \u00a76 (capstone)'",
    "content='Axiom audit + full build green + root import' status='pending' active_form='Running axiom audit + full build'",
    "content='Session-037 archive closure (journal, db, STATE, commit)' status='pending' active_form='Closing session 037 archive'"
  ],
  "cleared": false
}
#1857 assistant 2026-08-24 23:26:52.500 UTC · 2710→14358 tok open ⤢
thinking (22366 chars)
`logDeriv_mul (f := ...) (g := ...) _ hne1 hne2 h1 h2` — signature: logDeriv_mul (x?) (hf0 : f x ≠ 0) (hg0 : g x ≠ 0) (hdf : DifferentiableAt f x) (hdg : DifferentiableAt g x). The first `_` is probably the point x implicit or an explicit arg... `logDeriv_mul _ hne1 hne2 h1 h2` — with f,g pinned, then `_`, then the two nonzeros, then two differentiabilities. The `_` might be the `x` explicit. OK — I'll mirror this call shape exactly: `logDeriv_mul (f := ...) (g := ...) _ hne_f hne_g hdf hdg`. Now write LiMoments.lean §0–§3. I'll be careful about: - namespace/open: mirror LiSqueeze: `open Zeta23 Complex Filter Topology`, `noncomputable section`, `namespace NguyenRH1`. - The file end: `end NguyenRH1` then... session-028 gotcha: "file ends `end NguyenRH1` then `end`" — that was for a file with two namespaces. LiSqueeze ends with just `end NguyenRH1`? Let me not worry — single namespace: end NguyenRH1. For the good-set at 1 within 𝓝[≠]: I need ζ s ≠ 0 from zetaA. Also for gFun at 1 continuity. Also `differentiableAt_riemannZeta (hs' : s ≠ 1)` ✓. xiL differentiability — write with function-level Differentiable combinators: ```lean lemma differentiable_xiL : Differentiable ℂ xiL := by have h1 : Differentiable ℂ (fun s : ℂ => s * (s - 1) / 2) := (differentiable_id.mul (differentiable_id.sub_const 1)).div_const 2 have h2 : Differentiable ℂ (fun s : ℂ => (s - 1) / 2) := (differentiable_id.sub_const 1).div_const 2 have h3 : Differentiable ℂ (fun s : ℂ => s / 2) := differentiable_id.div_const 2 exact (h1.mul differentiable_completedZeta₀).sub h2 |>.add h3 ``` Hmm — xiL s := (s*(s−1)/2)·Λ₀(s) − (s−1)/2 + s/2: as functions: (fun s => (s*(s−1)/2)*Λ₀ s) − (fun s => (s−1)/2) + (fun s => s/2) — the combinators produce Differentiable ℂ of the lambda; the def xiL must unfold to match — since xiL is a def, `Differentiable ℂ xiL` — the exact lambda after unfolding: `show Differentiable ℂ (fun s => ...)`? def xiL (s : ℂ) : ℂ := ... so xiL = fun s => ... definitionally; the combinators' lambda is syntactically fun s => (s*(s−1)/2)*Λ₀ s − (s−1)/2 + s/2 — same term shape? `exact` will unify up to defeq — should work since it's the same expression tree modulo beta. If not: `unfold xiL; exact ...`. - analyticAt_xiL : ∀ s, AnalyticAt ℂ xiL s: ```lean lemma analyticAt_xiL (s : ℂ) : AnalyticAt ℂ xiL s := (differentiable_xiL.differentiableOn.analyticOnNhd isOpen_univ) s (Set.mem_univ s) ``` Check: DifferentiableOn.analyticOnNhd (h : DifferentiableOn ℂ f s) (hs : IsOpen s) : AnalyticOnNhd ℂ f s ✓ (used in LiSeries). AnalyticOnNhd f univ s (mem) : AnalyticAt f s ✓ def of AnalyticOnNhd. - xiL_eq_mul: careful with completedRiemannZeta_eq: Λ s = Λ₀ s − 1/s − 1/(1−s). Goal: xiL s = (s*(s−1)/2)*Λ s. rw [xiL, completedRiemannZeta_eq]: goal: (s*(s−1)/2)*(Λ₀ s − 1/s − 1/(1−s)) − (s−1)/2 + s/2 = (s*(s−1)/2)*(Λ₀ s − 1/s − 1/(1−s)). field_simp; ring. Hmm field_simp on goal with divisions: should normalize both sides. Let me instead prove: (s*(s−1)/2)*(Λ₀ s − 1/s − 1/(1−s)) = (s*(s−1)/2)*Λ₀ s − (s−1)/2 + s/2 by field_simp + ring, then the xiL eq follows. Write: ```lean lemma xiL_eq_mul {s : ℂ} (h0 : s ≠ 0) (h1 : s ≠ 1) : xiL s = (s * (s - 1) / 2) * completedRiemannZeta s := by rw [xiL, completedRiemannZeta_eq] have hs1 : s - 1 ≠ 0 := sub_ne_zero.mpr h1 field_simp ring ``` field_simp needs the denominators: s, 1−s, and 2 (nonzero literals fine). 1−s ≠ 0: neg_sub... sub_ne_zero.mpr (Ne.symm h1)? 1−s ≠ 0 ⟺ 1 ≠ s. Provide h1s : (1:ℂ) − s ≠ 0 := sub_ne_zero.mpr (Ne.symm h1). OK. - xiL_zero: `by rw [xiL]; simp` — terms: (0*(0−1)/2)*Λ₀ 0 − (0−1)/2 + 0/2: simp should evaluate 0*x = 0, −(0−1)/2 = 1/2: `by simp [xiL]` maybe; fallback norm_num [xiL]. There might be an issue: completedRiemannZeta₀ 0 remains as an atom multiplied by 0 ✓ simp handles zero_mul. - xiL_one: similar: (1*0/2)*Λ₀ 1 − 0/2 + 1/2 = 1/2 ✓ simp [xiL]. - xiL_one_sub: ```lean lemma xiL_one_sub (s : ℂ) : xiL (1 - s) = xiL s := by by_cases h0 : s = 0 · subst h0 show xiL (1 - 0) = xiL 0 rw [sub_zero, xiL_one, xiL_zero] by_cases h1 : s = 1 · subst h1 show xiL (1 - 1) = xiL 1 rw [sub_self, xiL_zero, xiL_one] · have h10 : (1:ℂ) - s ≠ 0 := sub_ne_zero.mpr (Ne.symm h0) have h11 : (1:ℂ) - s ≠ 1 := by intro h; apply h0; have := congrArg (fun t => (1:ℂ) - t) h; simpa using this rw [xiL_eq_mul h10 h11, xiL_eq_mul h0 h1, completedRiemannZeta_one_sub] congr 1 ring ``` Check: xiL (1−s) = ((1−s)((1−s)−1)/2)·Λ(1−s) = ((1−s)(−s)/2)·Λ(s); xiL s = (s(s−1)/2)Λ(s). congr 1 reduces to (1−s)(1−s−1)/2 = s(s−1)/2 ✓ ring. Hmm — (1−s)−1 vs −s: ring handles. - xiL_ne_zero: ```lean lemma xiL_ne_zero {s : ℂ} (h0 : s ≠ 0) (h1 : s ≠ 1) (hζ : riemannZeta s ≠ 0) : xiL s ≠ 0 := by rw [xiL_eq_mul h0 h1] apply mul_ne_zero · -- s(s−1)/2 ≠ 0 have hs1 : s - 1 ≠ 0 := sub_ne_zero.mpr h1 exact div_ne_zero (mul_ne_zero h0 hs1) two_ne_zero · -- Λ s ≠ 0 intro hΛ rw [completedRiemannZeta_eq_zero_iff] at hΛ exact hζ hΛ.1 ``` completedRiemannZeta_eq_zero_iff's namespace: check — it's in Zeta23/RvM/CountByIntegral.lean; namespace there? The grep showed `lemma completedRiemannZeta_eq_zero_iff {s : ℂ} :` at :65 — need the namespace context. LiFEntire used it — grep LiFEntire for how it's referenced (Zeta23. prefix or open). I'll check quickly. - not_isNontrivialZero_zero/one ✓ as planned. - isNontrivialZero_one_sub: ```lean lemma isNontrivialZero_one_sub {ρ : ℂ} (hρ : IsNontrivialZero ρ) : IsNontrivialZero (1 - ρ) := by have h := Zeta23.zeta_reflect_zero ρ (isNontrivialZero_conj hρ) -- reflect (conj ρ) = 1 − conj(conj ρ) = 1 − ρ have e : Zeta23.reflect ((starRingEnd ℂ) ρ) = 1 - ρ := by rw [Zeta23.reflect] -- unfold def: 1 − starRingEnd (starRingEnd ρ) simp rwa [e] at h ``` zeta_reflect_zero namespace: it's in Zeta23/ZetaReflect.lean — namespace Zeta23? presumably `theorem zeta_reflect_zero` inside namespace Zeta23 ✓ (the grep showed `theorem zeta_reflect_zero` — with `open Zeta23` plain `zeta_reflect_zero` works). reflect def: Zeta23.Defs.lean:108 `def reflect (ρ : ℂ) : ℂ := 1 - (starRingEnd ℂ) ρ` — namespace Zeta23 presumably; with open Zeta23, `reflect` might conflict with... let me qualify Zeta23.reflect. e: reflect (conj ρ) = 1 − starRingEnd (starRingEnd ℂ ρ) = 1 − ρ: rw [Zeta23.reflect] unfolds (if it's a plain def, rw works with the equation lemma reflect.eq... or `show (1 : ℂ) - (starRingEnd ℂ) ((starRingEnd ℂ) ρ) = 1 - ρ`; simp [starRingEnd_apply]... starRingEnd (starRingEnd x) = x: simp lemma `starRingEnd_self_apply`?? I believe `starRingEnd_self_apply : starRingEnd R (starRingEnd R x) = x` hmm or via `RingHom... ` — simp [Zeta23.reflect] might fully reduce. Fallback: rw [Zeta23.reflect]; congr 1; exact starRingEnd_self_apply... I'll write simp [Zeta23.reflect] and adjust. - conjZeroEquiv/oneSubZeroEquiv ✓ as planned with `by simp` for involutivity (conj conj; 1−(1−ρ)): for oneSub: Subtype.ext (by simp : (1:ℂ) − (1 − ρ.1) = ρ.1): simp [sub_sub_cancel]... `sub_sub_cancel : a − (a − b) = b` ✓ simp lemma. For conj: starRingEnd involutive ✓. - good_half_ne_neg_nat ✓. - momentB + spec: ```lean noncomputable def momentB (hZC : ZeroCountProp) : ℂ := Classical.choose (partialFraction_identity hZC) lemma momentB_spec (hZC : ZeroCountProp) (s : ℂ) (hζ : riemannZeta s ≠ 0) (h0 : s ≠ 0) (h1 : s ≠ 1) (hn : ∀ n : ℕ, 1 ≤ n → s ≠ -2 * (n : ℂ)) : logDeriv riemannZeta s = momentB hZC + seriesFun s - 1 / s - 1 / (s - 1) + (Real.log Real.pi : ℂ) / 2 - Complex.digamma (s / 2) / 2 := Classical.choose_spec (partialFraction_identity hZC) s hζ h0 h1 hn ``` - gFun: ```lean noncomputable def gFun (s : ℂ) : ℂ := logDeriv xiL s ``` - gFun_eq_momentB (hZC) at good s — the §2 chain. Let me be careful about the eventuallyEq Λ = ΓR·ζ: ```lean have hΓ0 : Complex.Gammaℝ s ≠ 0 := by rw [Ne, Complex.Gammaℝ_eq_zero_iff] push_neg intro m rcases Nat.eq_zero_or_pos m with hm | hm · subst hm; simp; exact h0 -- s ≠ −2·0 = 0 · exact hn m hm ``` Gammaℝ_eq_zero_iff exact form — check: `Complex.Gammaℝ_eq_zero_iff {s : ℂ} : Complex.Gammaℝ s = 0 ↔ ∃ m : ℕ, s = -2 * (m : ℂ)`? From session-029 note "Gammaℝ_eq_zero_iff gives −(2*↑m)" — the existential witness form s = −2·↑m with the cast pattern −(2*↑m)? Need to check the exact literal form to match hn's `-2 * (n:ℂ)`. Grep Mathlib when writing. If forms mismatch (e.g. -(2*(m:ℂ)) vs -2*(m:ℂ)), small conversions. Also hΓ near s: `(differentiableAt_Gammaℝ_of_not_neg_nat hhalf).continuousAt.eventually_ne hΓ0` : ∀ᶠ t in 𝓝 s, Gammaℝ t ≠ 0 ✓. eventuallyEq Λ = ΓR·ζ: ```lean have hΛeq : ∀ᶠ t in 𝓝 s, completedRiemannZeta t = Complex.Gammaℝ t * riemannZeta t := by filter_upwards [(differentiableAt_Gammaℝ_of_not_neg_nat hhalf).continuousAt.eventually_ne hΓ0, eventually_ne_nhds h0] with t ht t0 -- ζ t = Λ t / ΓR t (riemannZeta_def_of_ne_zero t0); Λ t = ΓR t · ζ t rw [riemannZeta_def_of_ne_zero t0] field_simp [ht] ``` riemannZeta_def_of_ne_zero ht : riemannZeta t = completedRiemannZeta t / Gammaℝ t. Goal: Λ t = ΓR t · (Λ t / ΓR t) = Λ t ✓: rw then field_simp [ht] or exact (mul_div_cancel₀ ...).symm: (mul_div_cancel_left₀? `mul_div_cancel_left₀ (h : b ≠ 0) : b * (a / b) = a`? hmm — mul_div_cancel_left₀ : a * (b / a) = b? — `mul_div_cancel_left₀ (ha : a ≠ 0) : a * (b / a) = b`? I think `mul_div_cancel_left₀` exists with that shape... use field_simp robustly.) Then: ```lean theorem gFun_eq_momentB (hZC : ZeroCountProp) {s : ℂ} (hζ : riemannZeta s ≠ 0) (h0 : s ≠ 0) (h1 : s ≠ 1) (hn : ∀ n : ℕ, 1 ≤ n → s ≠ -2 * (n : ℂ)) : gFun s = momentB hZC + seriesFun s := by have hhalf : ∀ m : ℕ, s / 2 ≠ -(m : ℂ) := good_half_ne_neg_nat h0 hn -- eventuallyEq xiL = product form have hopen : IsOpen ({0}ᶜ ∩ {1}ᶜ : Set ℂ) := isOpen_compl_singleton.inter isOpen_compl_singleton have hexp : ∀ᶠ t in 𝓝 s, xiL t = (t * (t - 1) / 2) * completedRiemannZeta t := by filter_upwards [hopen.mem_nhds ⟨h0, h1⟩] with t ht exact xiL_eq_mul ht.1 ht.2 have hlog : logDeriv xiL s = logDeriv (fun t => (t * (t - 1) / 2) * completedRiemannZeta t) s := by have h1' : deriv xiL s = deriv (fun t => (t * (t - 1) / 2) * completedRiemannZeta t) s := hexp.deriv_eq have h2' : xiL s = (s * (s - 1) / 2) * completedRiemannZeta s := hexp.eq_of_nhds rw [gFun, logDeriv, logDeriv, h1', h2'] -- hmm logDeriv is a def: `logDeriv f x = deriv f x / f x`; rw [logDeriv] may not unfold — use `show` or `simp only [logDeriv]` ... ``` Hmm — logDeriv: `def logDeriv (f : 𝕜 → 𝕜) (x : 𝕜) := deriv f x / f x`? In Mathlib: `logDeriv f x := deriv f x / f x` — there's `logDeriv_apply : logDeriv f x = deriv f x / f x`?? The LiCircleBound usage: `rw [logDeriv_apply]` at :2929 — so `logDeriv_apply` is the unfolding equation ✓ use that: rw [gFun, logDeriv_apply, logDeriv_apply, h1', h2']. Continue: ```lean rw [gFun, hlog] have hP : DifferentiableAt ℂ (fun t : ℂ => t * (t - 1) / 2) s := ((differentiableAt_id.mul (differentiableAt_id.sub_const 1)).div_const 2) have hΛ : DifferentiableAt ℂ completedRiemannZeta s := differentiableAt_completedZeta h0 h1 have hP0 : s * (s - 1) / 2 ≠ 0 := div_ne_zero (mul_ne_zero h0 (sub_ne_zero.mpr h1)) two_ne_zero have hΛ0 : completedRiemannZeta s ≠ 0 := by rw [Ne, completedRiemannZeta_eq_zero_iff]; rintro h; exact hζ h.1 rw [logDeriv_mul (f := fun t : ℂ => t * (t - 1) / 2) (g := completedRiemannZeta) _ hP0 hΛ0 hP hΛ] -- logDeriv P = 1/s + 1/(s−1) have hPlog : logDeriv (fun t : ℂ => t * (t - 1) / 2) s = 1 / s + 1 / (s - 1) := by rw [logDeriv_apply] have hderiv : deriv (fun t : ℂ => t * (t - 1) / 2) s = s - 1 / 2 := by have hh : HasDerivAt (fun t : ℂ => t * (t - 1) / 2) (s - 1 / 2) s := by have h1' := (hasDerivAt_id' s).mul ((hasDerivAt_id' s).sub_const 1) -- (t·(t−1))' = (t−1) + t = 2t−1... then /2 have h2' := h1'.div_const 2 convert h2' using 1 ring exact hh.deriv rw [hderiv] have hs1 : s - 1 ≠ 0 := sub_ne_zero.mpr h1 field_simp ring rw [hPlog] -- logDeriv Λ = logDeriv ΓR + logDeriv ζ have hlogΛ : logDeriv completedRiemannZeta s = logDeriv Complex.Gammaℝ s + logDeriv riemannZeta s := by have heq : logDeriv completedRiemannZeta s = logDeriv (fun t => Complex.Gammaℝ t * riemannZeta t) s := by rw [logDeriv_apply, logDeriv_apply, hΛeq.deriv_eq, hΛeq.eq_of_nhds] rw [heq, logDeriv_mul (f := Complex.Gammaℝ) (g := riemannZeta) _ hΓ0 hζ (differentiableAt_Gammaℝ_of_not_neg_nat hhalf) (differentiableAt_riemannZeta h1)] rw [hlogΛ, logDeriv_Gammaℝ_eq_of_not_neg_nat hhalf, momentB_spec hZC s hζ h0 h1 hn] ring ``` Wait — HasDerivAt for t·(t−1): (hasDerivAt_id' s).mul (hasDerivAt (t−1)): HasDerivAt.mul : HasDerivAt f a x → HasDerivAt g b x → HasDerivAt (f·g) (a·g x + f x·b) x: with f = id (a = 1), g = t−1 (b = 1): derivative = 1·(s−1) + s·1 = 2s−1. Then div_const 2: (2s−1)/2 = s − 1/2: the convert+ring aligns the derivative value forms. Careful: HasDerivAt.mul's value form might be `1 * (s - 1) + s * 1` — convert via ring ✓. hasDerivAt_id' : HasDerivAt id 1 s? `hasDerivAt_id' (x) : HasDerivAt id 1 x`? hmm — (hasDerivAt_id' s).sub_const 1 : HasDerivAt (fun t => t − 1) (1 − 0) s ✓. The `.mul` — signature HasDerivAt.mul (ha : HasDerivAt f f' x) (hb : HasDerivAt g g' x) : HasDerivAt (fun x => f x * g x) (f' * g x + f x * g') x? (the product rule form). Then div_const: (f'*g + f*g')/2. convert+ring handles. Also note: deriv of P written as fun t => t*(t−1)/2 — parses as (t*(t−1))/2 ✓. - §3 bridges: ```lean lemma eq_of_eventuallyEq_nhd_ne {F G : ℂ → ℂ} {s₀ : ℂ} (hF : ContinuousAt F s₀) (hG : ContinuousAt G s₀) (h : F =ᶠ[𝓝[≠] s₀] G) : F s₀ = G s₀ := tendsto_nhds_unique (hF.tendsto.mono_left nhdsWithin_le_nhds) ((hG.tendsto.mono_left nhdsWithin_le_nhds).congr' h.symm) ``` Check: Tendsto.congr' : f₁ =ᶠ[l] f₂ → Tendsto f₁ l L → Tendsto f₂ l L. hG' : Tendsto G (𝓝[≠] s₀) (𝓝 (G s₀)); h.symm : G =ᶠ[𝓝[≠]] F; hG'.congr' h.symm : Tendsto F (𝓝[≠]) (𝓝 (G s₀)) ✓. tendsto_nhds_unique : [NeBot l] → Tendsto f l (𝓝 a) → Tendsto f l (𝓝 b) → a = b ✓ (NeBot (𝓝[≠] s₀) instance ✓). - gFun continuousAt: ```lean lemma gFun_continuousAt (s : ℂ) (hs : xiL s ≠ 0) : ContinuousAt gFun s := (((analyticAt_xiL s).deriv).div (analyticAt_xiL s) hs).continuousAt ``` gFun = logDeriv xiL = fun s => deriv xiL s / xiL s — the AnalyticAt.div produces AnalyticAt (deriv xiL / xiL) s — needs gFun s =ᶠ or defeq: gFun s := logDeriv xiL s = deriv xiL s / xiL s — the function logDeriv xiL vs (deriv xiL / xiL): Pi.div: (f/g) x = f x / g x ✓ defeq with logDeriv_apply. AnalyticAt.div : AnalyticAt f → AnalyticAt g → g x ≠ 0 → AnalyticAt (f / g) — target function (deriv xiL / xiL) = logDeriv xiL: defeq but the statement needs show: `show ContinuousAt (fun s => deriv xiL s / xiL s) s`? gFun s — ContinuousAt gFun s — unfold: `by show ContinuousAt (fun s => deriv xiL s / xiL s) s; exact ...`? gFun is a def: ContinuousAt gFun s where gFun = fun s => logDeriv xiL s = fun s => deriv xiL s / xiL s: the div on functions: deriv xiL s / xiL s = (deriv xiL / xiL) s by Pi.div_apply ✓ defeq. `exact` should unify. I'll write it with a show bridge if needed. - seriesFun continuousAt: (seriesFun_analyticAt hs₀).continuousAt ✓. - good-eventually at 0 and 1: ```lean lemma good_eventually_zero : ∀ᶠ s in 𝓝[≠] (0:ℂ), riemannZeta s ≠ 0 ∧ s ≠ 1 ∧ (∀ n : ℕ, 1 ≤ n → s ≠ -2 * (n : ℂ)) := by have hζ : ∀ᶠ s in 𝓝 (0:ℂ), riemannZeta s ≠ 0 := (analyticAt_riemannZeta (by norm_num : (0:ℂ) ≠ 1)).continuousAt.eventually_ne (by rw [riemannZeta_zero]; norm_num) have h1 : ∀ᶠ s in 𝓝 (0:ℂ), s ≠ 1 := eventually_ne_nhds (by norm_num : (0:ℂ) ≠ 1) have hnorm : ∀ᶠ s in 𝓝 (0:ℂ), ‖s‖ < 2 := by have h : Metric.ball (0:ℂ) 2 ∈ 𝓝 (0:ℂ) := Metric.ball_mem_nhds _ (by norm_num) filter_upwards [h] with s hs rw [Metric.mem_ball, dist_zero_right] at hs exact hs filter_upwards [hζ.filter_mono nhdsWithin_le_nhds, h1.filter_mono nhdsWithin_le_nhds, hnorm.filter_mono nhdsWithin_le_nhds] with s hζs h1s hsn refine ⟨hζs, h1s, fun n hn1 => ?_⟩ intro h rw [h] at hsn have : (2:ℝ) ≤ ‖(-2 : ℂ) * (n : ℂ)‖ := by rw [norm_mul, norm_neg, norm_two??] -- ‖(−2:ℂ)‖ = 2; ‖(n:ℂ)‖ = n ≥ 1 ... linarith [this, hsn] -- 2 ≤ ‖s‖ < 2 contradiction ``` norm computations: ‖(−2:ℂ)‖ = 2: `norm_neg` then norm of (2:ℂ): `Complex.norm_two`? hmm — norm_num can: ‖(-2:ℂ)‖ via `by norm_num`? For casts: ‖((−2:ℕ...)): careful the term is -2 * (n:ℂ) — norm_mul: ‖−2‖·‖(n:ℂ)‖ = 2·n (n ≥ 1): ≥ 2. norm_num [norm_mul, Complex.norm_natCast]? There's `Complex.norm_natCast : ‖(n:ℂ)‖ = n` ✓ and ‖(−2:ℂ)‖: rw [norm_neg]; norm_num? `Complex.norm_ofNat`? I'll do: have : ‖(-2 : ℂ)‖ = 2 := by norm_num [norm_neg]... robust: (show ‖(-2:ℂ)‖ = 2 by rw [norm_neg]; exact norm_ofNat...). Simpler: push through: ‖(−2:ℂ)‖ = ‖((2:ℝ):ℂ)‖ = 2 by norm_num1? I'll write `by norm_num [norm_neg, Complex.norm_natCast]` and fix at build. Then n ≥ 1: (1:ℝ) ≤ n: Nat.one_le_cast.mpr hn1. So 2·n ≥ 2 ✓ linarith. - good_eventually_one: at 1: hζ via zetaA: ```lean lemma good_eventually_one : ∀ᶠ s in 𝓝[≠] (1:ℂ), riemannZeta s ≠ 0 ∧ s ≠ 0 ∧ (∀ n : ℕ, 1 ≤ n → s ≠ -2 * (n : ℂ)) := by have hA : ∀ᶠ s in 𝓝 (1:ℂ), zetaA s ≠ 0 := zetaA_ne_zero_near_one have h0 : ∀ᶠ s in 𝓝 (1:ℂ), s ≠ 0 := eventually_ne_nhds (by norm_num : (1:ℂ) ≠ 0) have hnorm : ∀ᶠ s in 𝓝 (1:ℂ), ‖s‖ < 2 := ... ball_mem_nhds 1 (2) — ball centered 1 radius 2: ‖s−1‖ < 2... hmm I want ‖s‖ < 2? s near 1: ‖s‖ ≤ ‖s−1‖+1 < 3... use radius 1: ‖s−1‖ < 1 ⟹ if s = −2n: ‖−2n − 1‖ ≥ |2n − 1| ≥ 1: for n ≥ 1: |−2n−1| = 2n+1 ≥ 3 > 1 ✓. So radius 1: s = −2n ⟹ ‖s − 1‖ = ‖−2n − 1‖ = 2n+1 ≥ 3 ✗. filter_upwards [hA.filter_mono nhdsWithin_le_nhds, self_mem_nhdsWithin, h0.filter_mono nhdsWithin_le_nhds, hnorm...] with s hAs hs1 h0s hsn -- ζ s ≠ 0: if ζ s = 0 then zetaA s = (s−1)·ζ s = 0 (zetaA_apply hs1) contradiction refine ⟨?_, h0s, fun n hn1 => ?_⟩ · intro hζ rw [zetaA_apply hs1, hζ, mul_zero] at hAs exact hAs rfl · intro h; rw [h] at hsn; -- ‖−2n − 1‖ < 1 contradiction ... ``` self_mem_nhdsWithin : s ∈ 𝓝[≠] s₀ → s ≠ s₀ ✓ (self_mem_nhdsWithin : {x}ᶜ ∈... : ∀ᶠ y in 𝓝[≠] x, y ≠ x ✓). Wait hnorm at 1: Metric.ball (1:ℂ) 1 ∈ 𝓝 1 ✓; s ∈ ball ⟹ ‖s − 1‖ < 1 (Metric.mem_ball, dist_eq_norm: dist s 1 = ‖s − 1‖ ✓). s = −2·n: ‖(−2n) − 1‖ = ‖−(2n+1)‖ = 2n+1 ≥ 3: compute: (−2:ℂ)·(n:ℂ) − 1 = −(2·n+1): norm = 2n+1 (norm_neg; norm of (2n+1 : ℂ)... via push_cast to real: ‖(−(2*(n:ℝ)+1):ℂ)‖ = |−(2n+1)| = 2n+1). Then 3 ≤ 2n+1 < 1 ✗ linarith. The cast juggling: ‖(-2:ℂ)*(n:ℂ) − 1‖: show = 2*n+1: have e : (-2:ℂ)*(n:ℂ) − 1 = ((−(2*n+1):ℝ):ℂ) := by push_cast; ring; rw [e, Complex.norm_real, Real.norm_eq_abs, abs_neg, abs_of_nonneg (by positivity...)] — n:ℝ ≥ 0: 2n+1 > 0 ✓. - gFun_zero (hZC): ```lean lemma gFun_zero (hZC : ZeroCountProp) : gFun 0 = momentB hZC := by have hgood : ∀ᶠ s in 𝓝[≠] (0:ℂ), gFun s = momentB hZC + seriesFun s := by filter_upwards [good_eventually_zero, self_mem_nhdsWithin] with s ⟨hζ, h1, hn⟩ h0 exact gFun_eq_momentB hZC hζ h0 h1 hn have hF : ContinuousAt gFun 0 := gFun_continuousAt 0 (by rw [xiL_zero]; norm_num) have hG : ContinuousAt (fun s => momentB hZC + seriesFun s) 0 := continuousAt_const.add (seriesFun_analyticAt not_isNontrivialZero_zero).continuousAt have := eq_of_eventuallyEq_nhd_ne hF hG hgood -- this : gFun 0 = momentB hZC + seriesFun 0; seriesFun 0 = 0 rwa [seriesFun_zero, add_zero] at this ``` - gFun_one (hZC): gFun 1 = momentB hZC + seriesFun 1 — same shape with good_eventually_one, self (s ≠ 1), xiL_one. - gFun_one_eq_neg: as planned. - seriesFun_zero, seriesFun_one as planned. That's §1–§3 (~400 lines). Write it now. Note: file header comment + imports: import Mathlib import NguyenRH1.LiTightR import NguyenRH1.LiSwaps import NguyenRH1.LiResidue import NguyenRH1.LiDigamma import NguyenRH1.LiReflect Wait — LiTightR imports LiSqueeze which imports LiCircleBound which imports LiFEntire (→ LiSeries presumably), LiGapCircles, LiDisc. Does anything import LiReflect in that chain? LiTightR needs sum_nearZeros_neg_reflect? Actually maybe not. Import LiReflect explicitly ✓. LiSwaps (sigmaP) — is it in LiTightR's chain? LiSqueeze→LiCircleBound→LiFEntire→LiSeries→? LiSeries imports (from the head): Mathlib, Zeta23.Statement, Zeta23.FromPNTPlus.ZetaBounds — no LiSwaps. So import LiSwaps ✓. LiDigamma for eventuallyEq_iteratedDeriv/iteratedDeriv_congr_of_eventuallyEq ✓ (needed §5/§6). LiResidue for zetaA ✓. open: `open Zeta23 Complex Filter Topology` (mirror LiSqueeze) — also need `open Metric`? LiSeries uses Metric.ball qualified — keep qualified. `open scoped`? The big operators fine. noncomputable section + namespace NguyenRH1. Let me now write the file §0–§3. I'll write the whole thing in one go, then iterate on build errors. Given length constraints, write §0–§3 first (~420 lines), build, fix, then continue with §4–§6. One more check: `eventually_ne_nhds` exists? `eventually_ne_nhds (h : a ≠ b) : ∀ᶠ x in 𝓝 a, x ≠ b` ✓ exists (used LiResidue:87). `Complex.norm_two`? For ‖(−2:ℂ)·(n:ℂ)‖: norm_mul → ‖−2‖·‖n‖: ‖((−2):ℂ)‖: I'll compute via: have h2 : ‖(-2 : ℂ)‖ = 2 := by rw [show (-2:ℂ) = ((-2:ℝ):ℂ) by norm_cast... hmm push_cast: ((-2:ℝ):ℂ) = -2 ✓ by push_cast; ring? norm_num should know: `by norm_num [norm_neg]`? Let me just: ‖(-2:ℂ)‖ = ‖(-(2:ℂ))‖ = ‖(2:ℂ)‖ = 2: norm_neg + Complex.norm_ofNat? `Complex.norm_ofNat : ‖(OfNat.ofNat n : ℂ)‖ = OfNat.ofNat n`? hmm norm_num extension handles norms of numerals ✓ `by norm_num` likely closes ‖(-2:ℂ)‖ = 2 directly (norm_num knows Complex.normSq... risky). Robust: rw [← Complex.ofReal_neg, ← Complex.ofReal_two]?? ofReal_two exists? `Complex.ofReal_ofNat`? Use: ((-2:ℂ)) = ((-2:ℝ):ℂ): by norm_cast; then Complex.norm_real, Real.norm_eq_abs, abs_neg, abs_two... I'll write the robust version: ```lean have h2 : ‖(-2 : ℂ)‖ = 2 := by rw [show (-2 : ℂ) = ((-2 : ℝ) : ℂ) by push_cast; ring, Complex.norm_real, Real.norm_eq_abs, abs_neg] norm_num ``` And ‖(n:ℂ)‖ = (n:ℝ): Complex.norm_natCast? — `Complex.norm_natCast (n : ℕ) : ‖(n : ℂ)‖ = n` ✓ exists (RCLike.norm_natCast general — earlier code used RCLike.norm_natCast ✓). Also for good_eventually_zero's last step: this : 2 ≤ ‖(-2:ℂ)*(n:ℂ)‖: rw [norm_mul, h2, RCLike.norm_natCast]: 2·(n:ℝ) with n ≥ 1: ≥ 2 ✓ linarith [Nat.one_le_cast.mpr hn1...]. hn1 : 1 ≤ n (ℕ): (1:ℝ) ≤ (n:ℝ) := Nat.one_le_cast.mpr hn1 ✓. Write it.
`logDeriv_mul` call-shape confirmed. Now writing LiMoments.lean §0–§3 (xiL, the gFun = B + seriesFun identity, and the evaluations at 0/1).
tool: Write
input
{
  "file_path": "D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\NguyenRH1\\LiMoments.lean",
  "content": "/-\nLiMoments.lean \u2014 tier ii\u2032-3b: the contour moments (M) via the 5e\npartial-fraction identity (D-070 route revision; D-066 \u00a73's rectangle\nplan superseded).\n\nTarget (D-066 \u00a72 piece (M)): for all k \u2265 1,\n  sigmaP k = \u2212(iteratedDeriv (k\u22121) gFun 0)/(k\u22121)!,\nwhere gFun = logDeriv xiL and xiL = (s(s\u22121)/2)\u00b7completedRiemannZeta is\nthe entire \u03be. The whole argument is the identity\n\n  (G)  gFun s = B + seriesFun s\n\nat every good point (\u03b6 s \u2260 0, s \u2260 0, s \u2260 1, s \u2260 \u22122n for n \u2265 1) \u2014 pure\nlogDeriv algebra from 5e's `partialFraction_identity` \u2014 plus termwise\nseries calculus: k \u2265 2 by iterated derivation of the absolutely\nsummable zero series at 0 (the LiDigamma \u00a77\u20138 `iteratedDerivWithin_tsum`\npattern), k = 1 by the conj/reflect reindex V = \u03a3 mult\u00b7(1/\u03c1\u0304 \u2212 1/(1\u2212\u03c1))\n= \u2212V = 0 (zeroMult_conj + zeroMult_one_sub).\n\n\u00a71: xiL (entire closed form via completedRiemannZeta\u2080) + basic facts +\n    the two zero-subtype equivs.\n\u00a72: the good-set lemmas + (G) (`gFun_eq_momentB`).\n\u00a73: evaluation at 0 and 1 (punctured-continuity bridges) + the FE sign\n    (`gFun_one_eq_neg`).\n\u00a74: summability budget + the k = 1 rearrangement (`two_mul_sigmaP_one`).\n\u00a75: the per-term derivative machine + termwise iterated derivation at 0\n    (`iteratedDeriv_seriesFun_zero`).\n\u00a76: the capstone `sigmaP_eq_neg_iteratedDeriv_gFun_div`.\n\nPerimeter: `ZeroCountProp` only (inherited from 5e's gap circles).\nArchive references: D-066 \u00a72, D-068 \u00a75, D-070.\n-/\nimport Mathlib\nimport NguyenRH1.LiTightR\nimport NguyenRH1.LiSwaps\nimport NguyenRH1.LiResidue\nimport NguyenRH1.LiDigamma\nimport NguyenRH1.LiReflect\n\nopen Zeta23 Complex Filter Topology\n\nnoncomputable section\n\nnamespace NguyenRH1\n\n/-! ## 1. The entire \u03be and the zero-subtype equivs -/\n\n/-- The entire \u03be in closed form: (s(s\u22121)/2)\u00b7\u039b\u2080(s) \u2212 (s\u22121)/2 + s/2 with\n\u039b\u2080 = `completedRiemannZeta\u2080` entire (Mathlib `differentiable_completedZeta\u2080`).\nEquals (s(s\u22121)/2)\u00b7\u039b(s) off {0, 1} (`xiL_eq_mul`); xiL(0) = xiL(1) = 1/2. -/\ndef xiL (s : \u2102) : \u2102 :=\n  (s * (s - 1) / 2) * completedRiemannZeta\u2080 s - (s - 1) / 2 + s / 2\n\nlemma differentiable_xiL : Differentiable \u2102 xiL := by\n  have h1 : Differentiable \u2102 (fun s : \u2102 => s * (s - 1) / 2) :=\n    (differentiable_id.mul (differentiable_id.sub_const 1)).div_const 2\n  have h2 : Differentiable \u2102 (fun s : \u2102 => (s - 1) / 2) :=\n    (differentiable_id.sub_const 1).div_const 2\n  have h3 : Differentiable \u2102 (fun s : \u2102 => s / 2) := differentiable_id.div_const 2\n  exact ((h1.mul differentiable_completedZeta\u2080).sub h2).add h3\n\nlemma analyticAt_xiL (s : \u2102) : AnalyticAt \u2102 xiL s :=\n  (differentiable_xiL.differentiableOn.analyticOnNhd isOpen_univ) s (Set.mem_univ s)\n\n/-- The defining equation off {0, 1}: xiL s = (s(s\u22121)/2)\u00b7\u039b(s). -/\nlemma xiL_eq_mul {s : \u2102} (h0 : s \u2260 0) (h1 : s \u2260 1) :\n    xiL s = (s * (s - 1) / 2) * completedRiemannZeta s := by\n  rw [xiL, completedRiemannZeta_eq]\n  have h1s : (1 : \u2102) - s \u2260 0 := sub_ne_zero.mpr (Ne.symm h1)\n  field_simp\n  ring\n\nlemma xiL_zero : xiL 0 = 1 / 2 := by simp [xiL]\n\nlemma xiL_one : xiL 1 = 1 / 2 := by simp [xiL]\n\n/-- The functional equation xiL(1\u2212s) = xiL(s), all s. -/\nlemma xiL_one_sub (s : \u2102) : xiL (1 - s) = xiL s := by\n  by_cases h0 : s = 0\n  \u00b7 subst h0\n    show xiL (1 - 0) = xiL 0\n    rw [sub_zero, xiL_one, xiL_zero]\n  by_cases h1 : s = 1\n  \u00b7 subst h1\n    show xiL (1 - 1) = xiL 1\n    rw [sub_self, xiL_zero, xiL_one]\n  \u00b7 have h10 : (1 : \u2102) - s \u2260 0 := sub_ne_zero.mpr (Ne.symm h0)\n    have h11 : (1 : \u2102) - s \u2260 1 := by\n      intro h\n      apply h0\n      have h2 := congrArg (fun t : \u2102 => (1 : \u2102) - t) h\n      simp at h2\n      exact h2\n    rw [xiL_eq_mul h10 h11, xiL_eq_mul h0 h1, completedRiemannZeta_one_sub]\n    congr 1\n    ring\n\n/-- xiL vanishes nowhere off {0, 1} where \u03b6 \u2260 0. -/\nlemma xiL_ne_zero {s : \u2102} (h0 : s \u2260 0) (h1 : s \u2260 1) (h\u03b6 : riemannZeta s \u2260 0) :\n    xiL s \u2260 0 := by\n  rw [xiL_eq_mul h0 h1]\n  apply mul_ne_zero\n  \u00b7 exact div_ne_zero (mul_ne_zero h0 (sub_ne_zero.mpr h1)) two_ne_zero\n  \u00b7 intro h\u039b\n    rw [completedRiemannZeta_eq_zero_iff] at h\u039b\n    exact h\u03b6 h\u039b.1\n\nlemma not_isNontrivialZero_zero : \u00ac IsNontrivialZero (0 : \u2102) := by\n  intro h\n  have h2 := h.2.1\n  rw [Complex.zero_re] at h2\n  exact lt_irrefl 0 h2\n\nlemma not_isNontrivialZero_one : \u00ac IsNontrivialZero (1 : \u2102) := by\n  intro h\n  have h2 := h.2.2\n  rw [Complex.one_re] at h2\n  exact lt_irrefl 1 h2\n\n/-- Reflection of a nontrivial zero: 1 \u2212 \u03c1 is a nontrivial zero\n(conj then Zeta23 reflect). -/\nlemma isNontrivialZero_one_sub {\u03c1 : \u2102} (h\u03c1 : IsNontrivialZero \u03c1) :\n    IsNontrivialZero (1 - \u03c1) := by\n  have h := zeta_reflect_zero \u03c1 (isNontrivialZero_conj h\u03c1)\n  have e : Zeta23.reflect ((starRingEnd \u2102) \u03c1) = 1 - \u03c1 := by\n    simp [Zeta23.reflect]\n  rwa [e] at h\n\n/-- The conjugation involution on the nontrivial-zero subtype. -/\ndef conjZeroEquiv : {\u03c1 : \u2102 // IsNontrivialZero \u03c1} \u2243 {\u03c1 : \u2102 // IsNontrivialZero \u03c1} where\n  toFun \u03c1 := \u27e8(starRingEnd \u2102) \u03c1, isNontrivialZero_conj \u03c1.2\u27e9\n  invFun \u03c1 := \u27e8(starRingEnd \u2102) \u03c1, isNontrivialZero_conj \u03c1.2\u27e9\n  left_inv \u03c1 := Subtype.ext (by simp)\n  right_inv \u03c1 := Subtype.ext (by simp)\n\n/-- The reflection involution \u03c1 \u21a6 1 \u2212 \u03c1 on the nontrivial-zero subtype. -/\ndef oneSubZeroEquiv : {\u03c1 : \u2102 // IsNontrivialZero \u03c1} \u2243 {\u03c1 : \u2102 // IsNontrivialZero \u03c1} where\n  toFun \u03c1 := \u27e81 - \u03c1, isNontrivialZero_one_sub \u03c1.2\u27e9\n  invFun \u03c1 := \u27e81 - \u03c1, isNontrivialZero_one_sub \u03c1.2\u27e9\n  left_inv \u03c1 := Subtype.ext (by simp)\n  right_inv \u03c1 := Subtype.ext (by simp)\n\n/-! ## 2. The good set and the identity (G) -/\n\n/-- The chosen constant from the 5e partial-fraction identity. -/\nnoncomputable def momentB (hZC : ZeroCountProp) : \u2102 :=\n  Classical.choose (partialFraction_identity hZC)\n\nlemma momentB_spec (hZC : ZeroCountProp) (s : \u2102) (h\u03b6 : riemannZeta s \u2260 0)\n    (h0 : s \u2260 0) (h1 : s \u2260 1) (hn : \u2200 n : \u2115, 1 \u2264 n \u2192 s \u2260 -2 * (n : \u2102)) :\n    logDeriv riemannZeta s = momentB hZC + seriesFun s - 1 / s - 1 / (s - 1) +\n      (Real.log Real.pi : \u2102) / 2 - Complex.digamma (s / 2) / 2 :=\n  Classical.choose_spec (partialFraction_identity hZC) s h\u03b6 h0 h1 hn\n\n/-- The log-derivative of \u03be. -/\nnoncomputable def gFun (s : \u2102) : \u2102 := logDeriv xiL s\n\n/-- The good-set half-shift condition for the \u0393R identity: s/2 \u2209 \u2212\u2115. -/\nlemma good_half_ne_neg_nat {s : \u2102} (h0 : s \u2260 0)\n    (hn : \u2200 n : \u2115, 1 \u2264 n \u2192 s \u2260 -2 * (n : \u2102)) :\n    \u2200 m : \u2115, s / 2 \u2260 -(m : \u2102) := by\n  intro m hm\n  rcases Nat.eq_zero_or_pos m with hm0 | hm0\n  \u00b7 subst hm0\n    simp only [Nat.cast_zero, neg_zero] at hm\n    exact h0 (by linarith [hm])\n  \u00b7 apply hn m hm0\n    have h2 : s = -2 * (s / 2) := by ring\n    rw [h2, hm]\n    ring\n\n/-- **The identity (G)**: off the excluded set, gFun = B + seriesFun.\nPure logDeriv algebra: logDeriv of xiL = (s(s\u22121)/2)\u00b7\u039b splits as\n1/s + 1/(s\u22121) + [\u2212(log \u03c0)/2 + \u03c8(s/2)/2] + \u03b6\u2032/\u03b6, and 5e's\npartial-fraction identity collapses everything to B + seriesFun. -/\ntheorem gFun_eq_momentB (hZC : ZeroCountProp) {s : \u2102} (h\u03b6 : riemannZeta s \u2260 0)\n    (h0 : s \u2260 0) (h1 : s \u2260 1) (hn : \u2200 n : \u2115, 1 \u2264 n \u2192 s \u2260 -2 * (n : \u2102)) :\n    gFun s = momentB hZC + seriesFun s := by\n  have hhalf : \u2200 m : \u2115, s / 2 \u2260 -(m : \u2102) := good_half_ne_neg_nat h0 hn\n  have h\u03930 : Complex.Gamma\u211d s \u2260 0 := by\n    rw [Ne, Complex.Gamma\u211d_eq_zero_iff]\n    push_neg\n    intro m\n    rcases Nat.eq_zero_or_pos m with hm | hm\n    \u00b7 subst hm\n      simp only [Nat.cast_zero, mul_zero, neg_zero]\n      exact h0\n    \u00b7 exact hn m hm\n  have h\u0393diff : DifferentiableAt \u2102 Complex.Gamma\u211d s :=\n    differentiableAt_Gamma\u211d_of_not_neg_nat hhalf\n  -- xiL agrees with the product form on a neighbourhood of s\n  have hopen : IsOpen ({0}\u1d9c \u2229 {1}\u1d9c : Set \u2102) :=\n    isOpen_compl_singleton.inter isOpen_compl_singleton\n  have hexp : \u2200\u1da0 t in \ud835\udcdd s, xiL t = (t * (t - 1) / 2) * completedRiemannZeta t := by\n    filter_upwards [hopen.mem_nhds \u27e8h0, h1\u27e9] with t ht\n    exact xiL_eq_mul ht.1 ht.2\n  -- \u039b agrees with \u0393R\u00b7\u03b6 on a neighbourhood of s\n  have h\u039beq : \u2200\u1da0 t in \ud835\udcdd s, completedRiemannZeta t = Complex.Gamma\u211d t * riemannZeta t := by\n    filter_upwards [h\u0393diff.continuousAt.eventually_ne h\u03930, eventually_ne_nhds h0]\n      with t ht\u0393 ht0\n    rw [riemannZeta_def_of_ne_zero ht0]\n    field_simp [ht\u0393]\n  have hlog : logDeriv xiL s =\n      logDeriv (fun t => (t * (t - 1) / 2) * completedRiemannZeta t) s := by\n    rw [logDeriv_apply, logDeriv_apply, hexp.deriv_eq, hexp.eq_of_nhds]\n  rw [gFun, hlog]\n  have hP : DifferentiableAt \u2102 (fun t : \u2102 => t * (t - 1) / 2) s :=\n    (differentiableAt_id.mul (differentiableAt_id.sub_const 1)).div_const 2\n  have h\u039b : DifferentiableAt \u2102 completedRiemannZeta s := differentiableAt_completedZeta h0 h1\n  have hP0 : s * (s - 1) / 2 \u2260 0 :=\n    div_ne_zero (mul_ne_zero h0 (sub_ne_zero.mpr h1)) two_ne_zero\n  have h\u039b0 : completedRiemannZeta s \u2260 0 := by\n    rw [Ne, completedRiemannZeta_eq_zero_iff]\n    rintro h\n    exact h\u03b6 h.1\n  rw [logDeriv_mul (f := fun t : \u2102 => t * (t - 1) / 2) (g := completedRiemannZeta) _\n    hP0 h\u039b0 hP h\u039b]\n  have hPlog : logDeriv (fun t : \u2102 => t * (t - 1) / 2) s = 1 / s + 1 / (s - 1) := by\n    rw [logDeriv_apply]\n    have hderiv : deriv (fun t : \u2102 => t * (t - 1) / 2) s = s - 1 / 2 := by\n      have hh : HasDerivAt (fun t : \u2102 => t * (t - 1) / 2) (s - 1 / 2) s := by\n        have h1' := (hasDerivAt_id' s).mul ((hasDerivAt_id' s).sub_const 1)\n        have h2' := h1'.div_const 2\n        convert h2' using 1\n        ring\n      exact hh.deriv\n    rw [hderiv]\n    have hs1 : s - 1 \u2260 0 := sub_ne_zero.mpr h1\n    field_simp\n    ring\n  rw [hPlog]\n  have hlog\u039b : logDeriv completedRiemannZeta s =\n      logDeriv Complex.Gamma\u211d s + logDeriv riemannZeta s := by\n    have heq : logDeriv completedRiemannZeta s =\n        logDeriv (fun t => Complex.Gamma\u211d t * riemannZeta t) s := by\n      rw [logDeriv_apply, logDeriv_apply, h\u039beq.deriv_eq, h\u039beq.eq_of_nhds]\n    rw [heq, logDeriv_mul (f := Complex.Gamma\u211d) (g := riemannZeta) _ h\u03930 h\u03b6\n      (differentiableAt_Gamma\u211d_of_not_neg_nat hhalf) (differentiableAt_riemannZeta h1)]\n  rw [hlog\u039b, logDeriv_Gamma\u211d_eq_of_not_neg_nat hhalf, momentB_spec hZC s h\u03b6 h0 h1 hn]\n  ring\n\n/-! ## 3. Evaluation at 0 and 1 -/\n\n/-- Functions continuous at s\u2080 that agree on the punctured neighbourhood\nagree at s\u2080. -/\nlemma eq_of_eventuallyEq_nhd_ne {F G : \u2102 \u2192 \u2102} {s\u2080 : \u2102} (hF : ContinuousAt F s\u2080)\n    (hG : ContinuousAt G s\u2080) (h : F =\u1da0[\ud835\udcdd[\u2260] s\u2080] G) : F s\u2080 = G s\u2080 :=\n  tendsto_nhds_unique (hF.tendsto.mono_left nhdsWithin_le_nhds)\n    ((hG.tendsto.mono_left nhdsWithin_le_nhds).congr' h.symm)\n\n/-- gFun is continuous wherever xiL \u2260 0. -/\nlemma gFun_continuousAt (s : \u2102) (hs : xiL s \u2260 0) : ContinuousAt gFun s :=\n  (((analyticAt_xiL s).deriv).div (analyticAt_xiL s) hs).continuousAt\n\n/-- The good conditions hold eventually in the punctured neighbourhood of 0. -/\nlemma good_eventually_zero :\n    \u2200\u1da0 s in \ud835\udcdd[\u2260] (0 : \u2102), riemannZeta s \u2260 0 \u2227 s \u2260 1 \u2227\n      (\u2200 n : \u2115, 1 \u2264 n \u2192 s \u2260 -2 * (n : \u2102)) := by\n  have h\u03b6 : \u2200\u1da0 s in \ud835\udcdd (0 : \u2102), riemannZeta s \u2260 0 :=\n    (analyticAt_riemannZeta (by norm_num : (0 : \u2102) \u2260 1)).continuousAt.eventually_ne\n      (by rw [riemannZeta_zero]; norm_num)\n  have h1 : \u2200\u1da0 s in \ud835\udcdd (0 : \u2102), s \u2260 1 := eventually_ne_nhds (by norm_num : (0 : \u2102) \u2260 1)\n  have hnorm : \u2200\u1da0 s in \ud835\udcdd (0 : \u2102), \u2016s\u2016 < 2 := by\n    have h : Metric.ball (0 : \u2102) 2 \u2208 \ud835\udcdd (0 : \u2102) := Metric.ball_mem_nhds _ (by norm_num)\n    filter_upwards [h] with s hs\n    rw [Metric.mem_ball, dist_zero_right] at hs\n    exact hs\n  filter_upwards [h\u03b6.filter_mono nhdsWithin_le_nhds, h1.filter_mono nhdsWithin_le_nhds,\n    hnorm.filter_mono nhdsWithin_le_nhds] with s h\u03b6s h1s hsn\n  refine \u27e8h\u03b6s, h1s, fun n hn1 habs => ?_\u27e9\n  rw [habs] at hsn\n  have h2 : \u2016(-2 : \u2102)\u2016 = 2 := by\n    rw [show (-2 : \u2102) = ((-2 : \u211d) : \u2102) by push_cast; ring, Complex.norm_real,\n      Real.norm_eq_abs, abs_neg]\n    norm_num\n  have hbig : (2 : \u211d) \u2264 \u2016(-2 : \u2102) * (n : \u2102)\u2016 := by\n    rw [norm_mul, h2, RCLike.norm_natCast]\n    have hn1' : (1 : \u211d) \u2264 (n : \u211d) := Nat.one_le_cast.mpr hn1\n    linarith\n  linarith\n\n/-- The good conditions hold eventually in the punctured neighbourhood of 1. -/\nlemma good_eventually_one :\n    \u2200\u1da0 s in \ud835\udcdd[\u2260] (1 : \u2102), riemannZeta s \u2260 0 \u2227 s \u2260 0 \u2227\n      (\u2200 n : \u2115, 1 \u2264 n \u2192 s \u2260 -2 * (n : \u2102)) := by\n  have hA : \u2200\u1da0 s in \ud835\udcdd (1 : \u2102), zetaA s \u2260 0 := zetaA_ne_zero_near_one\n  have h0 : \u2200\u1da0 s in \ud835\udcdd (1 : \u2102), s \u2260 0 := eventually_ne_nhds (by norm_num : (1 : \u2102) \u2260 0)\n  have hnorm : \u2200\u1da0 s in \ud835\udcdd (1 : \u2102), \u2016s - 1\u2016 < 1 := by\n    have h : Metric.ball (1 : \u2102) 1 \u2208 \ud835\udcdd (1 : \u2102) := Metric.ball_mem_nhds _ (by norm_num)\n    filter_upwards [h] with s hs\n    rw [Metric.mem_ball, dist_eq_norm] at hs\n    exact hs\n  filter_upwards [hA.filter_mono nhdsWithin_le_nhds, self_mem_nhdsWithin,\n    h0.filter_mono nhdsWithin_le_nhds, hnorm.filter_mono nhdsWithin_le_nhds]\n    with s hAs hs1 h0s hsn\n  refine \u27e8?_, h0s, fun n hn1 habs => ?_\u27e9\n  \u00b7 intro h\u03b6\n    rw [zetaA_apply hs1, h\u03b6, mul_zero] at hAs\n    exact hAs rfl\n  \u00b7 rw [habs] at hsn\n    have hnorm2 : \u2016(-2 : \u2102) * (n : \u2102) - 1\u2016 = 2 * (n : \u211d) + 1 := by\n      have e : (-2 : \u2102) * (n : \u2102) - 1 = ((- (2 * (n : \u211d) + 1) : \u211d) : \u2102) := by\n        push_cast\n        ring\n      rw [e, Complex.norm_real, Real.norm_eq_abs, abs_neg, abs_of_nonneg (by\n        have hn0 : (0 : \u211d) \u2264 (n : \u211d) := Nat.cast_nonneg _\n        linarith)]\n      ring\n    rw [hnorm2] at hsn\n    have hn1' : (1 : \u211d) \u2264 (n : \u211d) := Nat.one_le_cast.mpr hn1\n    linarith\n\n/-- gFun(0) = B (punctured continuity; seriesFun(0) = 0). -/\nlemma gFun_zero (hZC : ZeroCountProp) : gFun 0 = momentB hZC := by\n  have hgood : \u2200\u1da0 s in \ud835\udcdd[\u2260] (0 : \u2102), gFun s = momentB hZC + seriesFun s := by\n    filter_upwards [good_eventually_zero, self_mem_nhdsWithin] with s \u27e8h\u03b6, h1, hn\u27e9 h0\n    exact gFun_eq_momentB hZC h\u03b6 h0 h1 hn\n  have hF : ContinuousAt gFun 0 := gFun_continuousAt 0 (by rw [xiL_zero]; norm_num)\n  have hG : ContinuousAt (fun s => momentB hZC + seriesFun s) 0 :=\n    continuousAt_const.add (seriesFun_analyticAt not_isNontrivialZero_zero).continuousAt\n  have h := eq_of_eventuallyEq_nhd_ne hF hG hgood\n  rwa [seriesFun_zero, add_zero] at h\n\n/-- gFun(1) = B + seriesFun(1) (punctured continuity). -/\nlemma gFun_one (hZC : ZeroCountProp) : gFun 1 = momentB hZC + seriesFun 1 := by\n  have hgood : \u2200\u1da0 s in \ud835\udcdd[\u2260] (1 : \u2102), gFun s = momentB hZC + seriesFun s := by\n    filter_upwards [good_eventually_one, self_mem_nhdsWithin] with s \u27e8h\u03b6, h0, hn\u27e9 h1\n    exact gFun_eq_momentB hZC h\u03b6 h0 h1 hn\n  have hF : ContinuousAt gFun 1 := gFun_continuousAt 1 (by rw [xiL_one]; norm_num)\n  have hG : ContinuousAt (fun s => momentB hZC + seriesFun s) 1 :=\n    continuousAt_const.add (seriesFun_analyticAt not_isNontrivialZero_one).continuousAt\n  exact eq_of_eventuallyEq_nhd_ne hF hG hgood\n\n/-- The FE sign: gFun(1) = \u2212gFun(0) (xiL(1\u2212s) = xiL(s), chain rule). -/\nlemma gFun_one_eq_neg : gFun 1 = -gFun 0 := by\n  have hfun : (fun s : \u2102 => xiL (1 - s)) = xiL := funext xiL_one_sub\n  have hderiv : deriv (fun s : \u2102 => xiL (1 - s)) 0 = -deriv xiL 1 := by\n    have h1 : DifferentiableAt \u2102 xiL ((fun s : \u2102 => 1 - s) 0) := by\n      simpa using differentiable_xiL 1\n    have h2 : DifferentiableAt \u2102 (fun s : \u2102 => 1 - s) 0 :=\n      (differentiableAt_const (1 : \u2102)).sub differentiableAt_id\n    have hcomp : deriv (xiL \u2218 fun s : \u2102 => 1 - s) 0 =\n        deriv (fun s : \u2102 => 1 - s) 0 * deriv xiL ((fun s : \u2102 => 1 - s) 0) :=\n      deriv.comp 0 h1 h2\n    have heq : (xiL \u2218 fun s : \u2102 => 1 - s) = fun s : \u2102 => xiL (1 - s) := rfl\n    rw [heq] at hcomp\n    have hinner : deriv (fun s : \u2102 => 1 - s) 0 = -1 := by\n      rw [deriv_const_sub differentiableAt_id]\n      simp\n    rw [hinner] at hcomp\n    simp at hcomp\n    exact hcomp\n  have h0 : deriv xiL 0 = -deriv xiL 1 := by\n    rw [\u2190 hfun]\n    exact hderiv\n  rw [gFun, gFun, logDeriv_apply, logDeriv_apply, xiL_zero, xiL_one, h0]\n  field_simp\n  ring\n\nend NguyenRH1\n"
}
#1858 assistant 2026-08-24 23:38:45.108 UTC · 1955→1931 tok open ⤢
thinking (3571 chars)
Line 226 is the `ring` in the `convert h2' using 1` block. The convert goal: s − 1/2 = (derivative value of h2'). HasDerivAt.mul's value: `1 * (s - 1) + s * 1` — then div_const 2: `(1 * (s - 1) + s * 1) / 2`. convert using 1: goal s − 1/2 = (1*(s−1)+s*1)/2 — ring should close... "ring_nf made no progress"?! That means the goal ISN'T a plain equality in a commutative ring — maybe the convert produced a HasDerivAt-valued goal?? convert h2' using 1 where the types differ only in the derivative value: if the proof-term types are both `HasDerivAt F v s` with different v, convert using 1 should produce v = v'. But maybe the FUNCTIONS differ too (fun t => t*(t−1)/2 vs the combinator-built lambda) and convert produced weird metavalue goals. The value of h2' might contain metavariables or the mul rule's value form `1 * (s - 1) + s * (1 - 0)`?? sub_const: HasDerivAt.sub_const : HasDerivAt f f' x → HasDerivAt (fun x => f x − c) f' x — value unchanged = 1. So mul value: 1*(s−1) + s*1; div_const: (1*(s−1)+s*1)/2. ring normalizes (1*(s−1)+s*1)/2 = s − 1/2 ✓ should close. Hmm "ring_nf made no progress" — maybe the convert goal is actually `(s - 1/2) = (1 * (s - 1) + s * 1) / 2`?? ring closes that. Unless... the convert produced goal in terms of a DIFFERENT variable name or the value has form `(1 * (s - 1) + s * (1 - 0)) / 2`? still ring-closable. OR — the convert using 1 may have produced the goal with the FUNCTIONS: `fun t => t * (t - 1) / 2 = fun t => ...` (function equality!) — ring can't handle (ring_nf no progress ✓ matches!). Why would convert produce function equality? If the two HasDerivAt types differ in the FUNCTION argument: my target has fun t => t*(t−1)/2; h2' has (fun t => t*(t−1)) / 2?? — div_const : HasDerivAt f a x → HasDerivAt (fun x => f x / c) (a / c) x — function fun x => (t*(t−1)) x / 2 — i.e. fun t => (t*(t−1))/2 — SAME as t*(t−1)/2 ✓ parses identically ((a*b)/2 = a*(b)/2? NO! `t * (t - 1) / 2` parses as (t*(t−1))/2 ✓ same). Hmm. Let me not guess — replace the whole hderiv with a cleaner computation avoiding convert: ```lean have hderiv : deriv (fun t : ℂ => t * (t - 1) / 2) s = s - 1 / 2 := by have h1' : HasDerivAt (fun t : ℂ => t * (t - 1)) (1 * (s - 1) + s * 1) s := (hasDerivAt_id' s).mul ((hasDerivAt_id' s).sub_const 1) have h2' : HasDerivAt (fun t : ℂ => t * (t - 1) / 2) ((1 * (s - 1) + s * 1) / 2) s := h1'.div_const 2 have h3' : HasDerivAt (fun t : ℂ => t * (t - 1) / 2) (s - 1 / 2) s := by convert h2' using 1 ring exact h3'.deriv ``` Same convert issue possibly. Alternative — the value assertion: HasDerivAt ... ((1*(s−1)+s*1)/2) — prove deriv = (1*(s−1)+s*1)/2 then ring_nf it: ```lean have hderiv : deriv (fun t : ℂ => t * (t - 1) / 2) s = s - 1 / 2 := by have h2' : HasDerivAt (fun t : ℂ => t * (t - 1) / 2) ((1 * (s - 1) + s * 1) / 2) s := ((hasDerivAt_id' s).mul ((hasDerivAt_id' s).sub_const 1)).div_const 2 rw [h2'.deriv] ring ``` After rw [h2'.deriv]: goal (1*(s−1)+s*1)/2 = s − 1/2: ring ✓. The type ascription on h2' forces the function to match (defeq) ✓ and the value is explicit. This avoids convert. The div_const value form: (1*(s−1)+s*1)/2 — HasDerivAt.div_const : HasDerivAt f f' x → HasDerivAt (fun x => f x / c) (f' / c) x ✓ value f'/c = (1*(s−1)+s*1)/2 ✓ matches the ascription. BUT the mul value form: HasDerivAt.mul : HasDerivAt f a x → HasDerivAt g b x → HasDerivAt (fun x => f x * g x) (a * g x + f x * b) x — value: 1*(s−1) + s*1 ✓ as ascribed. Apply: hderiv replacement + hinner replacement.
Line 226 is the `ring` inside the `convert` — I'll restructure to explicit HasDerivAt values (no convert), and fix hinner with HasDerivAt.sub.
tool: Edit
input
{
  "file_path": "D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\NguyenRH1\\LiMoments.lean",
  "old_string": "    have hderiv : deriv (fun t : \u2102 => t * (t - 1) / 2) s = s - 1 / 2 := by\n      have hh : HasDerivAt (fun t : \u2102 => t * (t - 1) / 2) (s - 1 / 2) s := by\n        have h1' := (hasDerivAt_id' s).mul ((hasDerivAt_id' s).sub_const 1)\n        have h2' := h1'.div_const 2\n        convert h2' using 1\n        ring\n      exact hh.deriv",
  "new_string": "    have hderiv : deriv (fun t : \u2102 => t * (t - 1) / 2) s = s - 1 / 2 := by\n      have h2' : HasDerivAt (fun t : \u2102 => t * (t - 1) / 2) ((1 * (s - 1) + s * 1) / 2) s :=\n        ((hasDerivAt_id' s).mul ((hasDerivAt_id' s).sub_const 1)).div_const 2\n      rw [h2'.deriv]\n      ring"
}
tool: Edit
input
{
  "file_path": "D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\NguyenRH1\\LiMoments.lean",
  "old_string": "    have hinner : deriv (fun s : \u2102 => 1 - s) 0 = -1 := by\n      rw [deriv_const_sub differentiableAt_id, deriv_id'']",
  "new_string": "    have hinner : deriv (fun s : \u2102 => 1 - s) 0 = -1 := by\n      have h0' : HasDerivAt (fun s : \u2102 => 1 - s) (0 - 1) 0 :=\n        (hasDerivAt_const (0 : \u2102) (1 : \u2102)).sub (hasDerivAt_id' 0)\n      rw [h0'.deriv]\n      norm_num"
}
#1859 assistant 2026-08-24 23:39:29.566 UTC · 331→337 tok open ⤢
thinking (632 chars)
§1–§3 elaborate clean. Now write §4 (summability + k=1 rearrangement), §5 (termwise iterated deriv), §6 (capstone). §4 plan (detailed earlier): ```lean /-! ## 4. The summability budget and the k = 1 rearrangement -/ /-- Master summability: Σ mult/‖ρ‖² over the zeros. -/ lemma summable_mult_div_norm_sq : Summable (fun ρ : {ρ : ℂ // IsNontrivialZero ρ} => (zeroMult ρ : ℝ) / ‖(ρ : ℂ)‖ ^ 2) := by -- comparison with (9/4)·mult/(1+‖γ‖²) on 2 ≤ ‖ρ‖, finite ball otherwise ... ``` Clone the sigmaSlice_summable skeleton — let me look at it (LiSwaps:213-260ish) to copy the finite/comparison assembly. Let me read that region.
§1–§3 elaborate clean. Now §4 — let me clone the `sigmaSlice_summable` skeleton for the master summability lemma.
tool: Read
input
{
  "file_path": "D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\NguyenRH1\\LiSwaps.lean",
  "offset": 205,
  "limit": 60
}
#1860 assistant 2026-08-24 23:46:22.639 UTC · 1539→17842 tok open ⤢
thinking (44089 chars)
The skeleton is clear. For summable_mult_div_norm_sq I need the comparison: mult/‖ρ‖² ≤ (9/4)·mult/(1+‖γ‖²) for ‖ρ‖ ≥ 2 — that's normSq_gammaOf_le_mul_norm_sq inverted: 1+‖γ‖² ≤ (9/4)‖ρ‖² ⟹ 1/‖ρ‖² ≤ (9/4)/(1+‖γ‖²) ⟹ mult/‖ρ‖² ≤ (9/4)mult/(1+‖γ‖²). From LiSwaps:205-208: the exact algebra heq: mult/‖ρ‖²·((9/4)‖ρ‖²) = (9/4)mult. The comparison: hbound : mult/‖ρ‖² ≤ ... — let me write directly: ```lean lemma summable_mult_div_norm_sq : Summable (fun ρ : {ρ : ℂ // IsNontrivialZero ρ} => (zeroMult ρ : ℝ) / ‖(ρ : ℂ)‖ ^ 2) := by have hbase : Summable (fun ρ : {ρ : ℂ // IsNontrivialZero ρ} => (9 / 4) * ((zeroMult ρ : ℝ) / (1 + Complex.normSq (gammaOf ρ)))) := (WeilEF.zero_sum_inv_sq zetaSeam).mul_left (9 / 4) set D : {ρ : ℂ // IsNontrivialZero ρ} → ℝ := fun ρ => if (2 : ℝ) ≤ ‖(ρ : ℂ)‖ then (9 / 4) * (zeroMult ρ : ℝ) / (1 + Complex.normSq (gammaOf ρ)) else (zeroMult ρ : ℝ) / ‖(ρ : ℂ)‖ ^ 2 with hDdef ... (same finite/E/hD assembly) refine Summable.of_norm_bounded hD (fun ρ => ?_) by_cases hρ : (2 : ℝ) ≤ ‖(ρ : ℂ)‖ · simp only [D, if_pos hρ] -- ‖mult/‖ρ‖²‖ ≤ (9/4)mult/(1+‖γ‖²): from normSq_gammaOf_le_mul_norm_sq ... · simp only [D, if_neg hρ] -- ‖mult/‖ρ‖²‖ = mult/‖ρ‖² (nonneg): le_refl after Real.norm_of_nonneg ``` The comparison per-term: for ‖ρ‖ ≥ 2: normSq_gammaOf_le_mul_norm_sq (n := 1) le_rfl (re nonneg) (re ≤ 1) hρ2 — signature check from LiSwaps:134: `normSq_gammaOf_le_mul_norm_sq (n := 1) le_rfl hre0 hre1 (by simpa using hρ)` — args: (n)(h : 1 ≤ n)(hre0 : 0 ≤ re)(hre1 : re ≤ 1)(hρ : n ≤ ‖ρ‖)?? with n := 1, the last is 1 ≤ ‖ρ‖ (by simpa using hρ : 2 ≤ ‖ρ‖). Result: 1 + normSq γ ≤ (9/4)·‖ρ‖²... wait with n := 1: the statement at ii′-1a: (9/4)‖ρ‖² comparison — from LiSwaps:134: `hcomp : 1 + Complex.normSq (gammaOf ρ) ≤ 9 / 4 * ‖(ρ : ℂ)‖ ^ 2`. ✓ Then: mult/‖ρ‖² ≤ (9/4)·mult/(1+‖γ‖²): ```lean have hz := ρ.2 have hρpos : (0 : ℝ) < ‖(ρ : ℂ)‖ := lt_of_lt_of_le (by norm_num) hρ have hgpos : (0 : ℝ) < 1 + Complex.normSq (gammaOf (ρ : ℂ)) := by have := Complex.normSq_nonneg (gammaOf (ρ : ℂ)); linarith -- mult/‖ρ‖² ≤ (9/4)mult/(1+‖γ‖²) ⟺ mult·(1+‖γ‖²) ≤ (9/4)mult·‖ρ‖² rw [div_le_div_iff_of_pos_right?? hmm ``` Use: div_le_div (h : a ≤ b)? — div_le_div_of_nonneg? The clean way: ```lean have key : (zeroMult ρ : ℝ) / ‖(ρ : ℂ)‖ ^ 2 ≤ (9 / 4) * (zeroMult ρ : ℝ) / (1 + Complex.normSq (gammaOf ρ)) := by rw [div_le_div_iff₀ (pow_pos hρpos 2) hgpos] -- goal: mult·(1+‖γ‖²) ≤ ((9/4)·mult)·‖ρ‖² have hcomp : 1 + Complex.normSq (gammaOf (ρ : ℂ)) ≤ 9 / 4 * ‖(ρ : ℂ)‖ ^ 2 := normSq_gammaOf_le_mul_norm_sq (n := 1) le_rfl hz.2.1.le hz.2.2.le (by simpa using hρ) calc (zeroMult ρ : ℝ) * (1 + Complex.normSq (gammaOf ρ)) ≤ (zeroMult ρ : ℝ) * (9 / 4 * ‖(ρ : ℂ)‖ ^ 2) := mul_le_mul_of_nonneg_left hcomp (Nat.cast_nonneg _) _ = (9 / 4 * (zeroMult ρ : ℝ)) * ‖(ρ : ℂ)‖ ^ 2 := by ring rw [Real.norm_of_nonneg (by positivity)] -- ‖mult/‖ρ‖²‖ = itself exact key ``` Wait — div_le_div_iff₀ signature: `div_le_div_iff₀ (hb : 0 < b) (hd : 0 < d) : a / b ≤ c / d ↔ a * d ≤ c * b`. In this Mathlib version, from session-033 banked: "div_lt_iff₀ is a/c<b here (lt_div_iff₀ for a<b/c)" — so div_le_div_iff₀ (hb : 0 < b) (hd : 0 < d) : a/b ≤ c/d ↔ a*d ≤ c*b ✓ plausibly. My goal: mult/‖ρ‖² ≤ (9/4·mult)/(1+‖γ‖²) — a = mult, b = ‖ρ‖², c = 9/4·mult, d = 1+‖γ‖²: ↔ mult·(1+‖γ‖²) ≤ (9/4·mult)·‖ρ‖² ✓ my calc matches. norm target: ‖(mult:ℝ)/‖ρ‖²‖ — Real.norm_of_nonneg (div_nonneg (Nat.cast_nonneg _) (pow_nonneg (norm_nonneg _) _)) — positivity should handle: `by positivity`. For the if_neg branch: D ρ = mult/‖ρ‖²: goal ‖mult/‖ρ‖²‖ ≤ D ρ = mult/‖ρ‖²: rw [Real.norm_of_nonneg (by positivity)] → le_refl ✓. Now — since this is ℝ-valued, note the summability conclusion is for the ℝ family ✓ (used as dominator). Next: ```lean lemma summable_mult_inv_pow {k : ℕ} (hk : 2 ≤ k) : Summable (fun ρ : {ρ : ℂ // IsNontrivialZero ρ} => (zeroMult ρ : ℂ) * (1 / (ρ : ℂ)) ^ k) := by obtain ⟨m, rfl⟩ := Nat.exists_eq_add_of_le hk -- k = 2 + m obtain ⟨δ, hδ, hball⟩ := exists_ball_avoid_nontrivialZeros 0 not_isNontrivialZero_zero have hδle : ∀ ρ : {ρ : ℂ // IsNontrivialZero ρ}, δ ≤ ‖(ρ : ℂ)‖ := by intro ρ by_contra h exact hball ρ (by rw [Metric.mem_ball, dist_zero_right]; exact lt_of_not_ge h) apply Summable.of_norm_bounded (summable_mult_div_norm_sq.mul_left ((1 / δ) ^ m)) intro ρ have hρpos : (0 : ℝ) < ‖(ρ : ℂ)‖ := lt_of_lt_of_le hδ (hδle ρ) have hle : ‖(zeroMult ρ : ℂ) * (1 / (ρ : ℂ)) ^ (2 + m)‖ ≤ (1 / δ) ^ m * ((zeroMult ρ : ℝ) / ‖(ρ : ℂ)‖ ^ 2) := by rw [norm_mul, norm_pow, norm_div, norm_one, RCLike.norm_natCast] -- mult·(1/‖ρ‖)^{2+m} ≤ (1/δ)^m·mult/‖ρ‖² rw [div_pow, one_pow] -- = mult·(1/‖ρ‖^{2+m}) = mult·(1/(‖ρ‖²·‖ρ‖^m)) ≤ mult·((1/δ^m)/‖ρ‖²) have hpow : (1 : ℝ) / ‖(ρ : ℂ)‖ ^ (2 + m) ≤ (1 / δ ^ m) / ‖(ρ : ℂ)‖ ^ 2 := by rw [pow_add] rw [one_div_mul_eq... ] hmm ``` algebra: 1/‖ρ‖^{2+m} = 1/(‖ρ‖²·‖ρ‖^m) = (1/‖ρ‖²)·(1/‖ρ‖^m) ≤ (1/‖ρ‖²)·(1/δ^m) since 1/‖ρ‖^m ≤ 1/δ^m (pow_le_pow_left₀ δ≤‖ρ‖ then one_div_le_one_div_of_le (pow_pos hδ m) that). Then mult·(...) ≤ mult·(...) (mult nonneg) and (1/δ)^m = 1/δ^m ✓ (div_pow, one_pow). Assemble: ```lean rw [pow_add, one_div (‖ρ‖² * ‖ρ‖^m)?...] ``` Let me structure: goal after rw [div_pow, one_pow]: (zeroMult ρ:ℝ)·(1/‖ρ‖^{2+m}) ≤ (1/δ)^m·(mult/‖ρ‖²). Write: ```lean calc (zeroMult ρ : ℝ) * (1 / ‖(ρ : ℂ)‖ ^ (2 + m)) = (zeroMult ρ : ℝ) * ((1 / ‖(ρ : ℂ)‖ ^ 2) * (1 / ‖(ρ : ℂ)‖ ^ m)) := by rw [pow_add] rw [one_div_mul_one_div??]... ``` one_div_mul: `one_div_mul_one_div (a b) : (1/a)*(1/b) = 1/(a*b)`? — `one_div_mul_one_div : 1 / a * (1 / b) = 1 / (a * b)` ✓ exists (symm direction). So: ```lean = (zeroMult ρ : ℝ) * ((1 / ‖(ρ : ℂ)‖ ^ 2) * (1 / ‖(ρ : ℂ)‖ ^ m)) := by rw [pow_add, ← one_div_mul_one_div] _ ≤ (zeroMult ρ : ℝ) * ((1 / ‖(ρ : ℂ)‖ ^ 2) * (1 / δ ^ m)) := by apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _) apply mul_le_mul_of_nonneg_left _ (by positivity : (0:ℝ) ≤ 1/‖(ρ:ℂ)‖^2) exact one_div_le_one_div_of_le (pow_pos hδ m) (pow_le_pow_left₀ hδ.le (hδle ρ) m) _ = (1 / δ) ^ m * ((zeroMult ρ : ℝ) / ‖(ρ : ℂ)‖ ^ 2) := by rw [div_pow, one_pow] ring ``` pow_le_pow_left₀ (ha : 0 ≤ a) (hab : a ≤ b) (n) : a^n ≤ b^n ✓ (signature from LiDigamma:746: pow_le_pow_left₀ (by positivity) hnormS (k+1) ✓). one_div_le_one_div_of_le (ha : 0 < a) (hab : a ≤ b) : 1/b ≤ 1/a ✓ (session-033 banked: "one_div_le_one_div_of_le takes the small side's positivity first" ✓ matches (pow_pos hδ m) then (pow_le...)). Then 1/δ > 0: hδ : 0 < δ ✓ from exists_ball_avoid. pow_pos hδ m ✓. Hmm wait — Nat.exists_eq_add_of_le : a ≤ b → ∃ c, b = a + c — with hk : 2 ≤ k: ∃ m, k = 2 + m ✓ obtain ⟨m, rfl⟩. Dominant form note: the of_norm_bounded dominator family: ((1/δ)^m)·(mult/‖ρ‖²) — summable_mult_div_norm_sq.mul_left ((1/δ)^m) : Summable (fun ρ => (1/δ)^m * (mult/‖ρ‖²)) ✓ matches my calc final form ✓. Next: sigmaP_eq_unpaired (k ≥ 2): ```lean lemma sigmaP_eq_unpaired {k : ℕ} (hk : 2 ≤ k) : sigmaP k = ∑' ρ : {ρ : ℂ // IsNontrivialZero ρ}, (zeroMult ρ : ℂ) * (1 / (ρ : ℂ)) ^ k := by have hs1 := summable_mult_inv_pow hk have hs2 : Summable (fun ρ : {ρ : ℂ // IsNontrivialZero ρ} => (zeroMult ρ : ℂ) * (1 / ((starRingEnd ℂ) (ρ : ℂ))) ^ k) := by -- transfer via conjZeroEquiv have e : (fun ρ : {ρ : ℂ // IsNontrivialZero ρ} => (zeroMult ρ : ℂ) * (1 / ((starRingEnd ℂ) (ρ : ℂ))) ^ k) = (fun σ : {ρ : ℂ // IsNontrivialZero ρ} => (zeroMult σ : ℂ) * (1 / (σ : ℂ)) ^ k) ∘ conjZeroEquiv := by funext ρ simp only [Function.comp_apply, conjZeroEquiv] rw [zeroMult_conj ρ.2] rw [e] exact hs1.comp_injective?? no — Summable of f ∘ e for equiv e: `Equiv.summable_iff e : Summable (f ∘ e) ↔ Summable f` — use (conjZeroEquiv.summable_iff).mpr hs1 -- main: have hre : ∑' ρ, (zeroMult ρ : ℂ) * (1 / ((starRingEnd ℂ) (ρ : ℂ))) ^ k = ∑' ρ, (zeroMult ρ : ℂ) * (1 / (ρ : ℂ)) ^ k := by have h := Equiv.tsum_eq conjZeroEquiv (fun σ => (zeroMult σ : ℂ) * (1 / (σ : ℂ)) ^ k) -- h : ∑' a, f (conjZeroEquiv a) = ∑' b, f b rw [← h] apply tsum_congr intro ρ simp only [conjZeroEquiv, Function.comp?? ] -- f (conjZeroEquiv ρ) = mult(conjρ)(1/conjρ)^k → mult(ρ)(1/conjρ)^k via zeroMult_conj ... -- sigmaP k = (1/2)(S + S) rw [sigmaP] -- sigmaSlice k ρ = (mult/2)(A + B); split the tsum have hsplit : ∑' ρ, sigmaSlice k ρ = (1 / 2 : ℂ) * (∑' ρ, (zeroMult ρ : ℂ) * (1 / (ρ:ℂ)) ^ k + ∑' ρ, (zeroMult ρ : ℂ) * (1 / ((starRingEnd ℂ) (ρ:ℂ))) ^ k) := by rw [← tsum_add hs1 hs2, ← tsum_mul_left] -- forms apply tsum_congr intro ρ rw [sigmaSlice] ring rw [hsplit, hre] ring ``` Careful with tsum forms (banked gotcha: "Summable.mul_left/add lambda forms; tsum_add beta-rfl bridges"). `tsum_add hs1 hs2 : ∑' (f + g)?? ` — tsum_add : ∑' i, (f i + g i) = ∑' f + ∑' g with Summable hyps? Signature: `tsum_add (hf : Summable f) (hg : Summable g) : ∑' i, (f i + g i) = ∑' i, f i + ∑' i, g i` ✓. And `tsum_mul_left : ∑' i, c * f i = c * ∑' i, f i` (no summability needed? tsum_mul_left works unconditionally? I recall tsum_mul_left : ∑' (c * f) = c * ∑' f — unconditional ✓ (both sides 0 if nonsummable)). The summand in hsplit's goal after ← rw: (1/2)·(mult·A + mult·B) vs (mult/2)(A+B): per-term ring ✓ but the lambda forms must match for rw ← — the ← tsum_add produces ∑' ρ, (f ρ + g ρ) — then ← tsum_mul_left : pattern c * f i... my target summand after apply tsum_congr — hmm order: I want to transform the GOAL ∑' sigmaSlice = (1/2)(S1+S2) into per-term. Direction: conv on RHS? Let me instead: ```lean have step : ∑' ρ, sigmaSlice k ρ = ∑' ρ, (1/2 : ℂ) * ((zeroMult ρ : ℂ) * (1 / (ρ:ℂ)) ^ k + (zeroMult ρ : ℂ) * (1 / ((starRingEnd ℂ) (ρ:ℂ))) ^ k) := by apply tsum_congr intro ρ rw [sigmaSlice] ring rw [step, tsum_mul_left, tsum_add hs1 hs2] ``` ✓ cleaner: after rw [step]: goal (1/2)·∑'(...) = ... — rw [tsum_mul_left]: ∑' ((1/2)·g) = (1/2)·∑' g: matches LHS ✓; rw [tsum_add hs1 hs2]: ∑' (fρ + gρ) = S1+S2 — the summand form (mult·A + mult·B) matches f+g lambda ✓. Then hre. For hre: after rw [← h]?? — h : ∑' a, f(conjZeroEquiv a) = ∑' b, f b. Goal: ∑' ρ, mult·(1/conjρ)^k = ∑' ρ, mult·(1/ρ)^k. Rewrite goal LHS to ∑' ρ, f(conjZeroEquiv ρ): tsum_congr: per-term: f(conjZeroEquiv ρ) = mult(conj ρ)·(1/conj ρ)^k: need = mult(ρ)·(1/conjρ)^k: zeroMult_conj ρ.2 : zeroMult (conj ρ) = zeroMult ρ — cast. So: ```lean have hre : ... := by have h := Equiv.tsum_eq conjZeroEquiv (fun σ : {ρ : ℂ // IsNontrivialZero ρ} => (zeroMult σ : ℂ) * (1 / (σ : ℂ)) ^ k) rw [← h] apply tsum_congr intro ρ simp only [conjZeroEquiv, Equiv.coe_fn_mk] rw [zeroMult_conj ρ.2] ``` Equiv.tsum_eq signature check: `Equiv.tsum_eq (e : α ≃ β) (f : β → M) : ∑' a, f (e a) = ∑' b, f b` ✓ I'm fairly confident. simp [conjZeroEquiv] to expose the application: conjZeroEquiv ρ = ⟨conj ρ, _⟩: its coercion to ℂ: ((conjZeroEquiv ρ : {ρ // IsNontrivialZero ρ}) : ℂ) = conj ρ — via Equiv.coe_fn_mk + Subtype coe simp. `simp only [conjZeroEquiv, Equiv.coe_fn_mk, Coe.coe]`? Fragile — alternative: show the equality of the CASTS first: ```lean intro ρ have e1 : ((conjZeroEquiv ρ : {ρ : ℂ // IsNontrivialZero ρ}) : ℂ) = (starRingEnd ℂ) (ρ : ℂ) := rfl rw [e1, zeroMult_conj ρ.2] ``` e1 by rfl: conjZeroEquiv ρ = ⟨conj ρ, _⟩ so its .1 = conj ρ ✓ rfl should hold (defeq through the structure). zeroMult_conj ρ.2 : zeroMult (conj ρ) = zeroMult ρ — the LHS term is zeroMult ((conjZeroEquiv ρ : subtype)) — after rw [e1]: zeroMult (conj ρ) — matches ✓. But zeroMult takes ℂ (zeroMult (ρ:ℂ) vs zeroMult of the subtype — in the summand it's (zeroMult ρ : ℂ) with ρ the SUBTYPE — zeroMult applied to the subtype's coerced value: zeroMult (ρ:ℂ)? In sigmaSlice def: (zeroMult ρ : ℂ) — ρ : subtype, zeroMult ρ means zeroMult (ρ:ℂ) via coe ✓. So rw [e1] changes the argument ✓. Then hs2's e : function equality: funext ρ: goal mult·(1/conjρ)^k = (f ∘ conjZeroEquiv) ρ = f(conjZeroEquiv ρ): same e1 rewrite: ```lean funext ρ show (zeroMult ρ : ℂ) * (1 / ((starRingEnd ℂ) (ρ:ℂ))) ^ k = (zeroMult (conjZeroEquiv ρ) : ℂ) * (1 / ((conjZeroEquiv ρ : {ρ // _}) : ℂ)) ^ k rw [e1??, zeroMult_conj ρ.2] ``` Hmm the RHS after Function.comp_apply simp. Let me write hs2 via: ```lean rw [← conjZeroEquiv.summable_iff] at hs1 ⊢?? ``` Cleaner: `Equiv.summable_iff (e) : Summable (fun a => f (e a)) ↔ Summable f`?? or (f ∘ e)? Signature: `Equiv.summable_iff (e : α ≃ β) : Summable (f ∘ e) ↔ Summable f`?? Hmm — there's `Equiv.summable_iff (e : α ≃ β) (f : β → M) : (Summable fun a => f (e a)) ↔ Summable f` I think. So: ```lean have hs2 : Summable (fun ρ : {ρ : ℂ // IsNontrivialZero ρ} => (zeroMult ρ : ℂ) * (1 / ((starRingEnd ℂ) (ρ : ℂ))) ^ k) := by rw [show (fun ρ : {ρ : ℂ // IsNontrivialZero ρ} => (zeroMult ρ : ℂ) * (1 / ((starRingEnd ℂ) (ρ : ℂ))) ^ k) = fun ρ => (fun σ : {ρ : ℂ // IsNontrivialZero ρ} => (zeroMult σ : ℂ) * (1 / (σ : ℂ)) ^ k) (conjZeroEquiv ρ) from ?_] · exact (Equiv.summable_iff conjZeroEquiv _).mpr hs1 -- hmm direction · funext ρ ...per-term... ``` Direction: Equiv.summable_iff e f : Summable (fun a => f (e a)) ↔ Summable f — .mpr takes Summable f → Summable (f∘e) ✓. Per-term for the show: goal fun-family equality — funext ρ: mult(ρ)·(1/conjρ)^k = mult(conjZeroEquiv ρ)·(1/(conjZeroEquiv ρ:ℂ))^k: rw [e1, zeroMult_conj] as before ✓. Next k=1 pieces: ```lean /-- The reflected master summability: Σ mult/‖1−ρ‖². -/ lemma summable_mult_div_norm_sq_one_sub : Summable (fun ρ : {ρ : ℂ // IsNontrivialZero ρ} => (zeroMult ρ : ℝ) / ‖(1 : ℂ) - (ρ : ℂ)‖ ^ 2) := by have e : (fun ρ : {ρ : ℂ // IsNontrivialZero ρ} => (zeroMult ρ : ℝ) / ‖(1 : ℂ) - (ρ : ℂ)‖ ^ 2) = fun ρ => (fun σ : {ρ : ℂ // IsNontrivialZero ρ} => (zeroMult σ : ℝ) / ‖(σ : ℂ)‖ ^ 2) (oneSubZeroEquiv ρ) := by funext ρ have e1 : ((oneSubZeroEquiv ρ : {ρ : ℂ // IsNontrivialZero ρ}) : ℂ) = 1 - (ρ : ℂ) := rfl rw [e1, zeroMult_one_sub ρ.2.2.1 ρ.2.2.2] rw [e] exact (Equiv.summable_iff oneSubZeroEquiv _).mpr summable_mult_div_norm_sq ``` zeroMult_one_sub {ρ} (h0 : 0 < ρ.re) (h1 : ρ.re < 1) : zeroMult (1−ρ) = zeroMult ρ ✓ (LiReflect:388) — with ρ.2.2.1/ρ.2.2.2 (subtype access) ✓. ```lean /-- The mixed term family Σ mult/(ρ(1−ρ)) is absolutely summable (AM-GM). -/ lemma summable_mult_one_div_mul_one_sub : Summable (fun ρ : {ρ : ℂ // IsNontrivialZero ρ} => (zeroMult ρ : ℂ) * (1 / ((ρ : ℂ) * (1 - (ρ : ℂ))))) := by have hsum := summable_mult_div_norm_sq.add summable_mult_div_norm_sq_one_sub apply Summable.of_norm_bounded (hsum.mul_left (1 / 2)) intro ρ have hρ0 : (0 : ℝ) < ‖(ρ : ℂ)‖ := by have h2 := ρ.2.2.1 -- 0 < re ≤ ‖ρ‖ have hre : (ρ:ℂ).re ≤ ‖(ρ:ℂ)‖ := Complex.re_le_norm _ linarith have h1ρ0 : (0 : ℝ) < ‖(1 : ℂ) - (ρ : ℂ)‖ := by have h2 := ρ.2.2.2 have hre : (1 - (ρ:ℂ)).re ≤ ‖1 - (ρ:ℂ)‖ := Complex.re_le_norm _ have : (1 - (ρ:ℂ)).re = 1 - (ρ:ℂ).re := by simp [Complex.sub_re, Complex.one_re] linarith rw [norm_mul, norm_div, norm_one, RCLike.norm_natCast, norm_mul] -- mult/(‖ρ‖‖1−ρ‖) ≤ (1/2)(mult/‖ρ‖² + mult/‖1−ρ‖²) have hbound : (zeroMult ρ : ℝ) / (‖(ρ : ℂ)‖ * ‖(1 : ℂ) - (ρ : ℂ)‖) ≤ (1 / 2) * ((zeroMult ρ : ℝ) / ‖(ρ : ℂ)‖ ^ 2 + (zeroMult ρ : ℝ) / ‖(1 : ℂ) - (ρ : ℂ)‖ ^ 2) := by -- AM-GM: 1/(ab) ≤ (1/2)(1/a² + 1/b²) have hmul : (0 : ℝ) ≤ (zeroMult ρ : ℝ) := Nat.cast_nonneg _ rw [div_le_iff₀ (mul_pos hρ0 h1ρ0)] -- mult ≤ (1/2)(mult/‖ρ‖² + mult/‖1−ρ‖²)·(‖ρ‖‖1−ρ‖) rw [mul_assoc] -- expand RHS: (1/2)·mult·(‖1−ρ‖/‖ρ‖ + ‖ρ‖/‖1−ρ‖) — messy; alternative: use two_mul_div_add... ... ``` AM-GM form: for a,b > 0: 1/(ab) ≤ (a⁻² + b⁻²)/2 ⟺ 2ab ≤ ... multiply both sides by 2·a²b²·... Let me use the standard inequality: (1/a)² + (1/b)² ≥ 2/(ab) — from (1/a − 1/b)² ≥ 0: 1/a² + 1/b² ≥ 2/(ab) ✓. In Lean: ```lean have key : 2 / (‖(ρ : ℂ)‖ * ‖(1 : ℂ) - (ρ : ℂ)‖) ≤ 1 / ‖(ρ : ℂ)‖ ^ 2 + 1 / ‖(1 : ℂ) - (ρ : ℂ)‖ ^ 2 := by have h1 : (0 : ℝ) ≤ (1 / ‖(ρ : ℂ)‖ - 1 / ‖(1 : ℂ) - (ρ : ℂ)‖) ^ 2 := sq_nonneg _ -- expand: 1/‖ρ‖² − 2/(‖ρ‖‖1−ρ‖) + 1/‖1−ρ‖² ≥ 0 have hexp : (1 / ‖(ρ : ℂ)‖ - 1 / ‖(1 : ℂ) - (ρ : ℂ)‖) ^ 2 = 1 / ‖(ρ : ℂ)‖ ^ 2 - 2 / (‖(ρ : ℂ)‖ * ‖(1 : ℂ) - (ρ : ℂ)‖) + 1 / ‖(1 : ℂ) - (ρ : ℂ)‖ ^ 2 := by field_simp [ne_of_gt hρ0, ne_of_gt h1ρ0] ring rw [hexp] at h1 linarith calc (zeroMult ρ : ℝ) / (‖(ρ : ℂ)‖ * ‖(1 : ℂ) - (ρ : ℂ)‖) = (zeroMult ρ : ℝ) / 2 * (2 / (‖(ρ : ℂ)‖ * ‖(1 : ℂ) - (ρ : ℂ)‖)) := by ring _ ≤ (zeroMult ρ : ℝ) / 2 * (1 / ‖(ρ : ℂ)‖ ^ 2 + 1 / ‖(1 : ℂ) - (ρ : ℂ)‖ ^ 2) := mul_le_mul_of_nonneg_left key (div_nonneg (Nat.cast_nonneg _) (by norm_num)) _ = (1 / 2) * ((zeroMult ρ : ℝ) / ‖(ρ : ℂ)‖ ^ 2 + (zeroMult ρ : ℝ) / ‖(1 : ℂ) - (ρ : ℂ)‖ ^ 2) := by ring exact hbound ``` Note: div_le_iff₀ not needed in this version. field_simp with the ne facts then ring for hexp ✓ (or field_simp closes; add ring guarded — if field_simp closes, ring errors... risk. Write hexp differently: rw [sub_sq, ...]: (a−b)² = a² − 2ab + b²: a = 1/‖ρ‖: a² = 1/‖ρ‖² (div_pow, one_pow); 2ab = 2·(1/‖ρ‖)·(1/‖1−ρ‖) = 2/(‖ρ‖‖1−ρ‖) (one_div_mul_one_div): pure rw chain: ```lean have hexp : (1 / ‖(ρ : ℂ)‖ - 1 / ‖(1 : ℂ) - (ρ : ℂ)‖) ^ 2 = 1 / ‖(ρ : ℂ)‖ ^ 2 - 2 / (‖(ρ : ℂ)‖ * ‖(1 : ℂ) - (ρ : ℂ)‖) + 1 / ‖(1 : ℂ) - (ρ : ℂ)‖ ^ 2 := by rw [sub_sq, div_pow, div_pow, one_pow, one_pow] rw [mul_sub, mul_comm (2:ℝ)...] hmm ``` sub_sq : (a−b)² = a² − 2ab + b² ✓. Then 2·(1/‖ρ‖)·(1/‖1−ρ‖): show = 2/(‖ρ‖·‖1−ρ‖): rw [one_div_mul_one_div]?? one_div_mul_one_div : (1/a)·(1/b) = 1/(a·b): then 2·(1/(‖ρ‖‖1−ρ‖)) = 2/(‖ρ‖‖1−ρ‖): mul_one_div: 2·(1/x) = 2/x ✓ `mul_one_div`. So: ```lean rw [sub_sq, div_pow, div_pow, one_pow, one_pow, one_div_mul_one_div, mul_one_div] ``` Result: 1/‖ρ‖² − 2/(‖ρ‖‖1−ρ‖) + 1/‖1−ρ‖² = RHS ✓ — but wait the goal RHS has 1/‖ρ‖^2 with ^2 — div_pow gives (1/‖ρ‖)² = 1²/‖ρ‖²... after one_pow: 1/‖ρ‖^2 ✓ but the LHS sub_sq's a² is (1/‖ρ‖)^2 — div_pow turns (1/‖ρ‖)^2 into 1^2/‖ρ‖^2 ✓ then one_pow → 1/‖ρ‖^2 ✓ matches. Careful: div_pow : (a/b)^n = a^n/b^n ✓. Then the vTerm (for V = 0): ```lean /-- The V-family: mult·(1/ρ̄ − 1/(1−ρ)), absolutely summable (O(‖ρ‖^{-1}‖1−ρ‖^{-1})). -/ lemma summable_mult_vTerm : Summable (fun ρ : {ρ : ℂ // IsNontrivialZero ρ} => (zeroMult ρ : ℂ) * (1 / ((starRingEnd ℂ) (ρ : ℂ)) - 1 / (1 - (ρ : ℂ)))) := by have hsum := summable_mult_div_norm_sq.add summable_mult_div_norm_sq_one_sub apply Summable.of_norm_bounded (hsum.mul_left (1 / 2)) intro ρ -- 1/conjρ − 1/(1−ρ) = (1−ρ−conjρ)/(conjρ(1−ρ)); ‖1−ρ−conjρ‖ = |1−2re| ≤ 1 have hρ0 : (0:ℝ) < ‖(ρ:ℂ)‖ := ... (as above) have h1ρ0 : (0:ℝ) < ‖(1:ℂ)−(ρ:ℂ)‖ := ... have hconj0 : (0:ℝ) < ‖((starRingEnd ℂ) (ρ:ℂ))‖ := by rw [starRingEnd_apply, norm_conj?? ...] — ‖conj ρ‖ = ‖ρ‖: `Complex.norm_conj`? hmm: RCLike.norm_conj? `norm_conj : ‖conj z‖ = ‖z‖`? For ℂ: `Complex.abs_conj`? or norm_star: ‖star z‖ = ‖z‖: `norm_star` ✓ (used LiSwaps:174: norm_star ✓). So rw [starRingEnd_apply, norm_star, ...] or norm_conj. Use: have : ‖((starRingEnd ℂ) (ρ:ℂ))‖ = ‖(ρ:ℂ)‖ := by rw [starRingEnd_apply, Complex.norm_conj]?? — starRingEnd_apply : starRingEnd ℂ z = conj z? it's rfl: starRingEnd ℂ z = star z = conj z: `starRingEnd_apply` simp lemma ✓; norm_conj : ‖conj z‖ = ‖z‖ ✓ `Complex.norm_conj`? hmm — safer `norm_star : ‖star z‖ = ‖z‖` ✓ exists. starRingEnd ℂ z = star z definitionally? starRingEnd_apply gives conj — and norm_conj — let me just: simp [starRingEnd_apply, Complex.norm_conj]... I'll use norm_star after starRingEnd_apply... The cleanest: ‖((starRingEnd ℂ) (ρ:ℂ))‖ = ‖(ρ:ℂ)‖ := norm_star _?? — starRingEnd ℂ ρ = star ρ (defeq?): starRingEnd is defined as star for RCLike: (starRingEnd ℂ) z = star z ✓ rfl? I think `starRingEnd_apply : (starRingEnd R) x = star x` is rfl-lemma ✓. So norm_star _ : ‖star ρ‖ = ‖ρ‖ — with the starRingEnd application defeq star — `exact norm_star _` might work by defeq. Fallback simp. -- the identity: have hid : 1 / ((starRingEnd ℂ) (ρ:ℂ)) - 1 / (1 - (ρ:ℂ)) = ((1 : ℂ) - (ρ:ℂ) - (starRingEnd ℂ) (ρ:ℂ)) / (((starRingEnd ℂ) (ρ:ℂ)) * (1 - (ρ:ℂ))) := by field_simp [ne_of_gt hconj0-as-ℂ-ne, ne_of_gt h1ρ0-as-ℂ-ne] ring -- ‖num‖ = |1 − 2re| ≤ 1: have hnum : ‖(1 : ℂ) - (ρ:ℂ) - (starRingEnd ℂ) (ρ:ℂ)‖ ≤ 1 := by have e : (1 : ℂ) - (ρ:ℂ) - (starRingEnd ℂ) (ρ:ℂ) = ((1 - 2 * (ρ:ℂ).re : ℝ) : ℂ) := by rw [starRingEnd_apply] -- 1 − ρ − conj ρ = 1 − (ρ + conjρ) = 1 − 2re have h := Complex.add_conj (ρ:ℂ) -- ρ + conjρ = 2re ... push_cast ring_nf?? rw [e, Complex.norm_real, Real.norm_eq_abs] have hre0 := ρ.2.2.1; have hre1 := ρ.2.2.2 rw [abs_le] constructor <;> linarith rw [hid, norm_div, norm_mul, norm_mul, RCLike.norm_natCast] -- mult·‖num‖/(‖conjρ‖‖1−ρ‖) ≤ mult·1/(‖ρ‖‖1−ρ‖) ≤ (1/2)(...) via the AM-GM hbound machinery ... ``` Reuse: factor the AM-GM bound as a separate lemma to avoid duplication: ```lean lemma mult_div_norm_mul_norm_le (ρ : {ρ : ℂ // IsNontrivialZero ρ}) : (zeroMult ρ : ℝ) / (‖(ρ : ℂ)‖ * ‖(1 : ℂ) - (ρ : ℂ)‖) ≤ (1 / 2) * ((zeroMult ρ : ℝ) / ‖(ρ : ℂ)‖ ^ 2 + (zeroMult ρ : ℝ) / ‖(1 : ℂ) - (ρ : ℂ)‖ ^ 2) ``` (As designed above.) Then: - summable_mult_one_div_mul_one_sub: term norm = mult/(‖ρ‖‖1−ρ‖) (norm computations) ≤ the AM-GM bound ✓ dominator ((1/2)·sum) summable ✓. - summable_mult_vTerm: term norm = mult·‖num‖/(‖conjρ‖‖1−ρ‖) ≤ mult·1/(‖ρ‖‖1−ρ‖) ≤ AM-GM bound ✓. For e : 1 − ρ − conjρ = ((1 − 2re : ℝ):ℂ): ```lean have e : (1 : ℂ) - (ρ:ℂ) - (starRingEnd ℂ) (ρ:ℂ) = ((1 - 2 * (ρ:ℂ).re : ℝ) : ℂ) := by have h2 : (starRingEnd ℂ) (ρ:ℂ) = ((2 * (ρ:ℂ).re : ℝ) : ℂ) - (ρ:ℂ) := by have h := Complex.add_conj (ρ:ℂ) -- ρ + conj ρ = ↑(2·re) -- conj ρ = 2re − ρ rw [starRingEnd_apply] -- goal conjρ = 2re − ρ have h2 : (ρ:ℂ) + (starRingEnd ℂ) (ρ:ℂ) = ((2 * (ρ:ℂ).re : ℝ) : ℂ) := h -- solve have h3 := congrArg (fun z => z - (ρ:ℂ)) h2 simp at h3 -- h3 : conjρ = 2re − ρ?? add_sub: ρ + conjρ − ρ = conjρ convert h3 using 1 ring rw [h2] push_cast ring ``` Complex.add_conj : z + conj z = ↑(2·z.re)? — from LiSwaps:150: `hac : ∀ z : ℂ, z + (starRingEnd ℂ) z = ((2 * z.re : ℝ) : ℂ) := fun z => Complex.add_conj z` ✓ exact form confirmed. Then ρ + conjρ = 2re ⟹ conjρ = 2re − ρ: h3 = congrArg (· − ρ) h2: (ρ + conjρ) − ρ = 2re − ρ: LHS = conjρ (add_sub_cancel?? ρ + conjρ − ρ = conjρ: `add_sub_cancel_left`? ρ + w − ρ = w: `add_sub_cancel_left : a + b − a = b` ✓). simp might do it; or rw [add_sub_cancel_left] at h3. Then 1 − ρ − (2re − ρ) = 1 − 2re: push_cast; ring ✓ (h2 substitution then ring). Hmm — but actually maybe simpler: directly: 1 − ρ − conjρ = 1 − (ρ + conjρ) = 1 − 2re: rw [← sub_sub, hac...]: 1 − ρ − conjρ = 1 − (ρ + conjρ) via `sub_sub : a − b − c = a − (b + c)` ✓: rw [sub_sub, Complex.add_conj]; push_cast; ring? After sub_sub: 1 − (ρ + conjρ): rw [Complex.add_conj]: 1 − ((2·re:ℝ):ℂ): goal: 1 − ↑(2·re) = ↑(1−2·re): push_cast; ring ✓. Cleaner! abs_le: |1−2re| ≤ 1 ⟺ −1 ≤ 1−2re ∧ 1−2re ≤ 1: from 0 < re < 1: 1−2re ∈ (−1, 1) ✓ linarith with re0 re1. Now the V = 0 lemma: ```lean /-- The V-sum vanishes: the conj and reflect reindexes give V = −V. -/ lemma vTerm_tsum_eq_zero : ∑' ρ : {ρ : ℂ // IsNontrivialZero ρ}, (zeroMult ρ : ℂ) * (1 / ((starRingEnd ℂ) (ρ : ℂ)) - 1 / (1 - (ρ : ℂ))) = 0 := by set V := ∑' ρ : {ρ : ℂ // IsNontrivialZero ρ}, (zeroMult ρ : ℂ) * (1 / ((starRingEnd ℂ) (ρ : ℂ)) - 1 / (1 - (ρ : ℂ))) with hV have h1 : V = ∑' ρ : {ρ : ℂ // IsNontrivialZero ρ}, (zeroMult ρ : ℂ) * (1 / (ρ : ℂ) - 1 / (1 - (starRingEnd ℂ) (ρ : ℂ))) := by rw [hV] have h := Equiv.tsum_eq conjZeroEquiv (fun σ : {σ : ℂ // IsNontrivialZero σ} => (zeroMult σ : ℂ) * (1 / (σ : ℂ) - 1 / (1 - (starRingEnd ℂ) (σ : ℂ)))) -- h : ∑' a, f (conjZeroEquiv a) = ∑' b, f b rw [← h] apply tsum_congr intro ρ have e1 : ((conjZeroEquiv ρ : {ρ : ℂ // IsNontrivialZero ρ}) : ℂ) = (starRingEnd ℂ) (ρ : ℂ) := rfl rw [e1, zeroMult_conj ρ.2] -- mult·(1/conjρ − 1/(1−conj(conjρ))) = mult·(1/conjρ − 1/(1−ρ))?? ``` WAIT — check the algebra direction. h1's RHS family at the conjZeroEquiv image: f(⟨conjρ, _⟩) = mult(conjρ)·(1/conjρ − 1/(1−conj(conjρ))) = mult(ρ)·(1/conjρ − 1/(1−ρ)) (zeroMult_conj; conj(conjρ) = ρ). Hmm — that gives V = ∑' mult·(1/conjρ − 1/(1−ρ)) = V — trivially. WRONG choice of f. Let me redo. V = ∑' ρ, mult·v(ρ) where v(ρ) = 1/conjρ − 1/(1−ρ). Reindex by conjEquiv e₁: V = ∑' ρ, mult(e₁ρ)·v'(e₁ρ)... Equiv.tsum_eq e₁ g : ∑' a, g(e₁ a) = ∑' b, g b. To get V on the RHS: choose g = the v-family: g σ = mult(σ)·(1/conjσ − 1/(1−σ)): ∑' ρ, g(e₁ρ) = V. g(e₁ρ) = mult(conjρ)·(1/conj(conjρ) − 1/(1−conjρ)) = mult(ρ)·(1/ρ − 1/(1−conjρ)). So: W := ∑' ρ, mult·(1/ρ − 1/(1−conjρ)) = V. (I) Reindex W by oneSubEquiv e₂: W = ∑' ρ, g'(e₂ρ) with g' τ = mult(τ)·(1/τ − 1/(1−conjτ)): g'(e₂ρ) = mult(1−ρ)·(1/(1−ρ) − 1/(1−conj(1−ρ))) = mult(ρ)·(1/(1−ρ) − 1/conjρ) (zeroMult_one_sub; 1−conj(1−ρ) = 1−(1−conjρ) = conjρ). = −mult·v(ρ). So W = ∑' ρ, −mult·v(ρ) = −V (tsum_neg). (II) From (I),(II): V = −V ⟹ V = 0 ✓. So h1 : V = W (via conjZeroEquiv with g = v-family) and h2 : W = −V (via oneSubEquiv with g = w-family). Then V = 0. In Lean: ```lean have h1 : V = ∑' ρ : {ρ : ℂ // IsNontrivialZero ρ}, (zeroMult ρ : ℂ) * (1 / (ρ : ℂ) - 1 / (1 - (starRingEnd ℂ) (ρ : ℂ))) := by have h := Equiv.tsum_eq conjZeroEquiv (fun σ : {σ : ℂ // IsNontrivialZero σ} => (zeroMult σ : ℂ) * (1 / ((starRingEnd ℂ) (σ : ℂ)) - 1 / (1 - (σ : ℂ)))) -- h : ∑' ρ, vFam(conjZeroEquiv ρ) = V rw [hV, ← h] apply tsum_congr intro ρ have e1 : ((conjZeroEquiv ρ : {ρ : ℂ // IsNontrivialZero ρ}) : ℂ) = (starRingEnd ℂ) (ρ : ℂ) := rfl rw [e1, zeroMult_conj ρ.2] congr 2 -- goal: 1/conjρ − 1/(1−ρ) = 1/conjρ − 1/(1−conj(conjρ)): conj conj rw [starRingEnd_apply, starRingEnd_apply, Complex.conj_conj] ``` Hmm — the goal after rw [e1, zeroMult_conj]: LHS (V's summand at ρ): mult·(1/conjρ − 1/(1−ρ)); RHS: mult·(1/ρ?? — wait let me redo. h1 claims V = W where W's summand is mult·(1/ρ − 1/(1−conjρ)). The proof: V = ∑' vFam = [Equiv.tsum_eq conjZeroEquiv vFam : ∑' ρ, vFam(conjEquiv ρ) = ∑' vFam] — so ∑' vFam = ∑' ρ, vFam(conjEquiv ρ) (.symm). vFam(conjEquiv ρ) = mult(conjρ)·(1/conj(conjρ) − 1/(1−conjρ)) = mult(ρ)·(1/ρ − 1/(1−conjρ)) = W's summand ✓. So: ```lean have h1 : V = W := by have h := Equiv.tsum_eq conjZeroEquiv vFam -- h : ∑' ρ, vFam (conjZeroEquiv ρ) = V rw [hV, ← h] apply tsum_congr intro ρ -- goal: vFam ρ = vFam (conjZeroEquiv ρ) rw [e1, zeroMult_conj ρ.2] -- LHS: mult·(1/conjρ − 1/(1−ρ)); RHS: mult·(1/conj(conjρ) − 1/(1−conjρ)) rw [starRingEnd_apply, Complex.conj_conj] ``` the last rw: conj(conjρ) → ρ: starRingEnd_apply rewrites starRingEnd ℂ z → conj z (if it's the simp form) then Complex.conj_conj : conj (conj z) = z ✓. Might need to target: the RHS has 1/((starRingEnd ℂ) ((starRingEnd ℂ) ρ)) — rw [starRingEnd_apply] turns into 1/(conj (conj ρ))... starRingEnd_apply : starRingEnd R x = star x?? and conj = star for ℂ — the outer form: after e1, the term is 1 / ((starRingEnd ℂ) ((starRingEnd ℂ) (ρ:ℂ))). simp [starRingEnd_apply]: starRingEnd ℂ z = conj z? Hmm — actually starRingEnd_apply is `starRingEnd_apply : starRingEnd R x = star x`?? or is it an rfl-lemma about application? In Mathlib: `starRingEnd_apply : (starRingEnd R) x = star x` — rfl. And for ℂ: star x = conj x: `RCLike.star_def`? or Complex.star_def : star z = conj z ✓. So simp only [starRingEnd_apply, Complex.star_def, Complex.conj_conj] should reduce starRingEnd (starRingEnd ρ) → conj(conj ρ) → ρ ✓. I'll use a small simp call and fix at build. Where does W = −V come from: ```lean have h2 : (∑' ρ : {ρ : ℂ // IsNontrivialZero ρ}, (zeroMult ρ : ℂ) * (1 / (ρ : ℂ) - 1 / (1 - (starRingEnd ℂ) (ρ : ℂ)))) = -V := by have h := Equiv.tsum_eq oneSubZeroEquiv (fun σ : {σ : ℂ // IsNontrivialZero σ} => (zeroMult σ : ℂ) * (1 / (σ : ℂ) - 1 / (1 - (starRingEnd ℂ) (σ : ℂ)))) -- h : ∑' ρ, wFam(oneSubZeroEquiv ρ) = W rw [← h] -- goal: ∑' ρ, wFam(oneSubZeroEquiv ρ) = -V: per-term = −vFam ρ; tsum_neg rw [show (fun ρ => (zeroMult (oneSubZeroEquiv ρ) : ℂ) * (1 / ((oneSubZeroEquiv ρ : {ρ // _}) : ℂ) - 1 / (1 - (starRingEnd ℂ) ((oneSubZeroEquiv ρ : {ρ // _}) : ℂ)))) = fun ρ => -((zeroMult ρ : ℂ) * (1 / ((starRingEnd ℂ) (ρ : ℂ)) - 1 / (1 - (ρ : ℂ)))) from ?_] · rw [tsum_neg, hV] · funext ρ have e1 : ((oneSubZeroEquiv ρ : {ρ : ℂ // IsNontrivialZero ρ}) : ℂ) = 1 - (ρ : ℂ) := rfl rw [e1, zeroMult_one_sub ρ.2.2.1 ρ.2.2.2] -- mult·(1/(1−ρ) − 1/(1−conj(1−ρ))) = −mult·(1/conjρ − 1/(1−ρ)) have e2 : (1 : ℂ) - (starRingEnd ℂ) (1 - (ρ : ℂ)) = (starRingEnd ℂ) (ρ : ℂ) := by simp [starRingEnd_apply, Complex.star_def?? map_sub, map_one] -- conj(1−ρ) = 1 − conjρ: map_sub, map_one; 1 − (1−conjρ) = conjρ: sub_sub_cancel rw [e2] ring -- V = −V have h3 : V = -V := h1.trans h2 -- ⟹ V = 0 have h4 : V + V = V + (-V) := congrArg (V + ·) h3 -- hmm simpler: eq_zero_of_neg_eq ... ``` For V = −V ⟹ V = 0 in ℂ: `eq_zero_of_neg_eq : -a = a → a = 0`? or: from h3 : V = −V: two_mul: 2V = 0: ```lean have : V = 0 := by have h4 : V + V = 0 := by calc V + V = V + (-V) := by rw [h3] _ = 0 := add_neg_cancel V -- V + V = 0 ⟹ V = 0 have h5 : (2 : ℂ) * V = 0 := by linear_combination h4 exact (mul_eq_zero.mp h5).resolve_left (by norm_num) ``` Or `eq_zero_of_neg_eq h3.symm`?? eq_zero_of_neg_eq : -a = a → a = 0 — h3 : V = −V: h3.symm : −V = V ✓ `exact eq_zero_of_neg_eq h3.symm` ✓ cleaner (if the lemma name is right — `eq_zero_of_neg_eq` exists in Mathlib.Algebra... ✓ I'm fairly confident). e2: 1 − conj(1−ρ) = conjρ: conj(1−ρ) = conj 1 − conj ρ = 1 − conjρ (map_sub, map_one/starRingEnd): then 1 − (1 − conjρ) = conjρ (sub_sub_cancel). simp [starRingEnd_apply, map_sub, map_one, sub_sub_cancel]?? — starRingEnd is a ring hom: (starRingEnd ℂ) (1−ρ) = 1 − (starRingEnd ℂ)ρ via map_sub/map_one ✓ simp lemmas. So: rw [map_sub, map_one, starRingEnd_apply??] — careful with the conj forms: starRingEnd_apply : starRingEnd ℂ x = star x? hmm — earlier code: (starRingEnd ℂ) ρ used directly with Complex.add_conj — LiSwaps:147: `hconj : (1 / ((starRingEnd ℂ) (ρ:ℂ))) = (starRingEnd ℂ) (1 / (ρ:ℂ)) := by rw [map_div₀, map_one]` — so they rw with map_* directly on starRingEnd applications ✓. For e2: ```lean have e2 : (1 : ℂ) - (starRingEnd ℂ) (1 - (ρ : ℂ)) = (starRingEnd ℂ) (ρ : ℂ) := by rw [map_sub, map_one] -- 1 − (1 − starRingEnd ρ) = starRingEnd ρ rw [sub_sub_cancel] ``` map_sub : f (a−b) = f a − f b ✓ (starRingEnd is ring hom); map_one ✓; sub_sub_cancel : a − (a − b) = b ✓. Also in h2's `show ... from ?_`: the lambda with oneSubZeroEquiv applications inside — messy. Alternative formulation avoiding the show: ```lean have h2 : W = -V := by rw [← tsum_neg] -- goal: W = ∑' ρ, −(vFam ρ) rw [← h] -- h : ∑' ρ, wFam(oneSubZeroEquiv ρ) = W; ← rewrites W → that tsum apply tsum_congr intro ρ -- per-term: wFam(oneSubZeroEquiv ρ) = −(vFam ρ) ... ``` Hmm rw [← tsum_neg] on goal W = −V: −V = −(∑' vFam): tsum_neg : ∑' (−f) = −∑' f: ← turns −∑' vFam into ∑' (−vFam) ✓ — but −V where V is `set` variable — the set makes V a local def; −V vs −∑' vFam: rw [hV] first to expose. Order: ```lean have h2 : W = -V := by rw [hV, ← tsum_neg, ← h] apply tsum_congr ... ``` Wait — rw [hV] rewrites V → ∑' vFam EVERYWHERE in goal W = −V → W = −∑' vFam ✓; ← tsum_neg: −∑' vFam → ∑' ρ, −vFam ρ ✓; ← h: W → ∑' wFam(oneSubZeroEquiv ρ)?? h : ∑' ρ, wFam(oneSubZeroEquiv ρ) = W: ← h rewrites W → ∑' ρ, wFam(oneSubZeroEquiv ρ) ✓. Goal: ∑' ρ, wFam(e₂ρ) = ∑' ρ, −vFam ρ ✓ tsum_congr. But h's W must be stated with the explicit tsum (not the set-V). Let me NOT use `set` for W; write both families explicitly. OK. Similarly h1: goal V = Wtsum: rw [hV, ← h]: hV : V = ∑' vFam (the set definition — hV is the set equation: `set V := ∑' ... with hV` gives hV : V = ∑' ...). rw [hV]: goal ∑' vFam = Wtsum; ← h : h : ∑' ρ, vFam(conjEquiv ρ) = ∑' vFam: ← h rewrites the LHS ∑' vFam → ∑' ρ, vFam(conjEquiv ρ) ✓. Goal: ∑' ρ, vFam(conjEquiv ρ) = Wtsum: tsum_congr per-term: vFam(conjEquiv ρ) = wFam ρ ✓ as computed. Per-term h1: vFam(conjZeroEquiv ρ) = mult(conjρ)·(1/conj(conjρ) − 1/(1−conjρ)): after e1/zeroMult_conj/simp-conj-conj: = mult·(1/ρ − 1/(1−conjρ)) ✓ = wFam ρ ✓ — the congr: after rw [e1, zeroMult_conj ρ.2]: goal mult·(1/conjρ − 1/(1−ρ))?? NO WAIT — LHS is vFam(conjZeroEquiv ρ): with e1 the zeroMult argument becomes conjρ → zeroMult_conj turns to mult(ρ); the rest: (1/((starRingEnd ℂ)((conjZeroEquiv ρ):ℂ)) − 1/(1−((conjZeroEquiv ρ):ℂ))): e1 rewrites the casts: (1/(starRingEnd (starRingEnd ρ)) − 1/(1−starRingEnd ρ)) = (1/ρ − 1/(1−conjρ)) after conj-conj simp. So goal after rws: mult·(1/ρ − 1/(1−conjρ)) = wFam ρ ✓ — need conj-conj rewrite BEFORE matching: order: rw [e1] (casts), then the starRingEnd-double: simp only [starRingEnd_apply, Complex.star_def, Complex.conj_conj]... hmm the (starRingEnd ℂ) ((starRingEnd ℂ) ρ) — after starRingEnd_apply twice: conj (conj ρ) → ρ via Complex.conj_conj ✓. But careful starRingEnd_apply might rewrite ALL instances including the outer ones I want to keep (1−starRingEnd ρ) — that's fine: (1 − conj ρ) ✓ same thing, then tsum_congr closes by rfl. The final RHS form must match W's declared family EXACTLY: W family := mult·(1/ρ − 1/(1−starRingEnd ρ)). After simp: LHS: mult·(1/ρ − 1/(1−conj ρ)) — star vs conj: starRingEnd_apply would also turn the RHS pattern... in tsum_congr the goal is vFam(e₁ρ) = wFam(ρ): RHS wFam(ρ) = mult·(1/ρ − 1/(1−starRingEnd ρ)): after simp [starRingEnd_apply, Complex.star_def]: RHS → mult·(1/ρ − 1/(1−conjρ))?? wait starRingEnd_apply turns starRingEnd→star, then star_def: star z = conj z. Ugh — actually for ℂ: starRingEnd ℂ = conj as functions? `RCLike.starRingEnd_eq_conj`? Hmm — in Mathlib, for RCLike types: `starRingEnd_apply : starRingEnd R x = star x` and Complex: star = conj (`Complex.star_def : star z = conj z`? or it's rfl). LiSwaps:150 used Complex.add_conj : z + starRingEnd ℂ z = 2re — so starRingEnd ℂ z IS conj z for the lemma. OK — I'll normalize with simp only [starRingEnd_apply] which should leave `star`, and both sides will have star — matching. Let me not over-plan: use `simp` per-term and see. Now two_mul_sigmaP_one: ```lean /-- Twice σ₁ is the mixed series: 2·sigmaP 1 = Σ mult/(ρ(1−ρ)). -/ lemma two_mul_sigmaP_one : (2 : ℂ) * sigmaP 1 = ∑' ρ : {ρ : ℂ // IsNontrivialZero ρ}, (zeroMult ρ : ℂ) * (1 / ((ρ : ℂ) * (1 - (ρ : ℂ)))) := by have hT : Summable ... := summable_mult_one_div_mul_one_sub have hσ : Summable (sigmaSlice 1) := sigmaSlice_summable 1 le_rfl -- per-term: 2·sigmaSlice 1 ρ = mult·(1/ρ + 1/conjρ) have h1 : (2 : ℂ) * sigmaP 1 = ∑' ρ : {ρ : ℂ // IsNontrivialZero ρ}, (zeroMult ρ : ℂ) * (1 / (ρ : ℂ) + 1 / ((starRingEnd ℂ) (ρ : ℂ))) := by rw [sigmaP, ← tsum_mul_left] apply tsum_congr intro ρ rw [sigmaSlice, pow_one, pow_one] ring -- per-term: mult·(1/(ρ(1−ρ))) = mult·(1/ρ + 1/(1−ρ)) have h2 : (∑' ρ : {ρ : ℂ // IsNontrivialZero ρ}, (zeroMult ρ : ℂ) * (1 / ((ρ : ℂ) * (1 - (ρ : ℂ))))) = ∑' ρ : {ρ : ℂ // IsNontrivialZero ρ}, (zeroMult ρ : ℂ) * (1 / (ρ : ℂ) + 1 / (1 - (ρ : ℂ))) := by apply tsum_congr intro ρ have hρ0 : (ρ : ℂ) ≠ 0 := ... have h1ρ : (1 : ℂ) - (ρ : ℂ) ≠ 0 := ... congr 1 field_simp [hρ0, h1ρ] ring rw [h1, h2] -- difference is V = 0 have h3 : (∑' ρ, mult·(1/ρ + 1/conjρ)) - (∑' ρ, mult·(1/ρ + 1/(1−ρ))) = ∑' ρ, mult·(1/conjρ − 1/(1−ρ)) := by rw [← tsum_sub ??] · apply tsum_congr intro ρ ring · -- summable of first family ... · -- summable of second family ... -- the second family summable: from hT via per-term rewrite have hsnd : Summable (fun ρ => (zeroMult ρ : ℂ) * (1 / (ρ : ℂ) + 1 / (1 - (ρ : ℂ)))) := by apply hT.congr intro ρ ... per-term field identity ... -- the first family summable: sigmaSlice_summable 1 via per-term rewrite have hfst : Summable (fun ρ => (zeroMult ρ : ℂ) * (1 / (ρ : ℂ) + 1 / ((starRingEnd ℂ) (ρ : ℂ)))) := by apply (sigmaSlice_summable 1 le_rfl).congr intro ρ rw [sigmaSlice, pow_one, pow_one] ring rw [h3, vTerm_tsum_eq_zero] at *?? ``` Assemble: h1 : 2σ₁ = Fst; h2 : T = Snd; h3 : Fst − Snd = V = 0 ⟹ Fst = Snd = T: so 2σ₁ = T ✓: ```lean have hFst : Fst = Snd := sub_eq_zero.mp (by rw [h3]; exact vTerm_tsum_eq_zero) rw [h1, hFst, ← h2] ``` Summable.congr : Summable f → (∀ i, f i = g i) → Summable g ✓ exists (`Summable.congr`). tsum_sub : ∑' (f − g) = ∑' f − ∑' g with summabilities: `tsum_sub (hf : Summable f) (hg : Summable g)` ✓. For h1's ← tsum_mul_left: goal (2)·∑' sigmaSlice = ∑' (2·sigmaSlice)?? tsum_mul_left : ∑' (c * f) = c * ∑' f: ← turns (2)·∑' → ∑' (2·sigmaSlice)?? the pattern: (2:ℂ) * sigmaP 1 where sigmaP 1 = ∑' sigmaSlice 1 — rw [sigmaP] exposes; ← tsum_mul_left: rewrites (2:ℂ) * ∑' sigmaSlice 1 → ∑' ρ, 2 * sigmaSlice 1 ρ ✓ then tsum_congr: 2·sigmaSlice 1 ρ = mult·(1/ρ + 1/conjρ): rw [sigmaSlice, pow_one, pow_one]: 2·((mult/2)(1/ρ + 1/conjρ)) = ...: ring ✓. h2's per-term: 1/(ρ(1−ρ)) = 1/ρ + 1/(1−ρ): field_simp [hρ0, h1ρ]; ring — wait direction: goal after congr 1: 1/((ρ)*(1−ρ)) = 1/ρ + 1/(1−ρ): field_simp; ring ✓ (if field_simp closes, ring errors — the banked gotcha... write field_simp [hρ0, h1ρ] then ring only if needed — I'll include ring and remove if "no goals" error appears). Hmm — congr 1: goal mult·(1/(ρ(1−ρ))) = mult·(1/ρ + 1/(1−ρ)): congr 1 reduces to 1/(ρ(1−ρ)) = 1/ρ + 1/(1−ρ) ✓. Then the k=1 capstone: ```lean /-- (M) at k = 1: σ₁ = −gFun(0). -/ lemma sigmaP_one_eq_neg_gFun_zero (hZC : ZeroCountProp) : sigmaP 1 = -gFun 0 := by have h2 := two_mul_sigmaP_one rw [← seriesFun_one] at h2 -- 2·σ₁ = seriesFun 1 have hg1 := gFun_one hZC -- gFun 1 = B + seriesFun 1 have hg0 := gFun_zero hZC -- gFun 0 = B have hfe := gFun_one_eq_neg -- gFun 1 = −gFun 0 -- seriesFun 1 = gFun 1 − B = −2B -- 2σ₁ = −2·gFun 0 ⟹ σ₁ = −gFun 0 linear_combination h2 + hg1 - hg0 - hfe ``` linear_combination over ℂ ✓ works (it's for commutative rings ✓). Check: goal σ₁ = −gFun 0: coeffs: h2 : 2σ₁ = seriesFun 1; hg1 : gFun 1 = B + seriesFun 1; hg0 : gFun 0 = B; hfe : gFun 1 = −gFun 0. goal−LHS combos: 2σ₁ − (−gFun0)?? Let me verify: h2 + hg1 − hg0 − hfe: LHS: 2σ₁ + gFun1 − gFun0 − gFun1 = 2σ₁ − gFun0; RHS: seriesFun1 + (B + seriesFun1) − B − (−gFun0) = 2·seriesFun1 + gFun0. So 2σ₁ − gFun0 = 2·seriesFun1 + gFun0 — that's not the goal form... linear_combination checks goal LHS − combo LHS = goal RHS − combo RHS as ring identity? linear_combination e : proves goal a = b when a − (LHS e) = b − (RHS e) by ring. e = h2 + hg1 − hg0 − hfe: LHS e = 2σ₁+gFun1−gFun0−gFun1 = 2σ₁ − gFun0; RHS e = seriesFun1 + B + seriesFun1 − B + gFun0 = 2·seriesFun1 + gFun0. Goal: σ₁ = −gFun0: check σ₁ − (2σ₁ − gFun0) = −σ₁ + gFun0 vs −gFun0 − (2seriesFun1 + gFun0) = −2seriesFun1 − 2gFun0: ring identity?? −σ₁+gFun0 ≠ −2seriesFun1−2gFun0 in general ✗. Wrong combo. Solve: want σ₁ = −g0 given 2σ₁ = SF1, g1 = B+SF1, g0 = B, g1 = −g0: 2σ₁ = SF1 = g1 − B = −g0 − g0 = −2g0 ✓. e should satisfy: LHS e = 2·(goal LHS), i.e. take e = h2 − hg1 + hg0 + hfe: LHS: 2σ₁ − g1 + g0 + g1 = 2σ₁ + g0; RHS: SF1 − (B+SF1) + B + (−g0) = −g0. So e: 2σ₁+g0 = −g0: goal σ₁ = −g0: σ₁ − (2σ₁+g0)/2... linear_combination e/2: linear_combination (h2 - hg1 + hg0 + hfe)/2: check: goal − e/2: σ₁ − (2σ₁+g0)/2 = −g0/2... and −g0 − (−g0)/2 = −g0/2 ✓ ring ✓. So `linear_combination (h2 - hg1 + hg0 + hfe) / 2` ✓. §5 — the derivative machine: ```lean /-! ## 5. Termwise iterated derivation at 0 (k ≥ 2) -/ /-- The zpow derivative lemma (no leading minus; c := −ρ). -/ lemma iteratedDeriv_zpow_neg_one (k : ℕ) (c : ℂ) {s : ℂ} (hs : s + c ≠ 0) : iteratedDeriv k (fun s : ℂ => (s + c) ^ (-1 : ℤ)) s = (-1 : ℂ) ^ k * (k ! : ℂ) * (s + c) ^ (-(k : ℤ) - 1) := by have h := iteratedDeriv_neg_zpow_neg_one_add k c hs have e : (fun s : ℂ => (s + c) ^ (-1 : ℤ)) = fun s => -(-((s + c) ^ (-1 : ℤ))) := by funext s rw [neg_neg] rw [e, ← iteratedDeriv_neg, h] ring ``` iteratedDeriv_neg : iteratedDeriv n (−f) = −iteratedDeriv n f — `iteratedDeriv_neg`?? hmm — check: iteratedDerivWithin_neg exists? There's `iteratedDeriv_neg`?? not sure. Fallback: iteratedDeriv n (−f) x = −(iteratedDeriv n f x) via `iteratedDerivWithin_neg` on univ + Within-of-isOpen... Or avoid: my per-term: 1/(s−ρ) = (s+(−ρ))^{−1} — use LiDigamma's lemma with the negation INSIDE: (s+(−ρ))^{−1} = −(−((s+(−ρ))^{−1})): so iteratedDeriv k (that) = −(−(−1)^k k! (s+(−ρ))^{−k−1}) = (−1)^k k! (s+(−ρ))^{−k−1} ✓ same. The iteratedDeriv_neg name: Mathlib has `iteratedDeriv_neg : iteratedDeriv n (-f) = -iteratedDeriv n f`?? — grep Mathlib quickly at build. If missing: use iteratedDeriv_const_mul with c = −1: −g = (−1)·g: `iteratedDeriv_const_mul`?? also uncertain. Hmm — safest: use Filter.EventuallyEq: (−f) — or just prove via deriv induction... Actually simplest: note our per-term function is mult·((s+c)^{−1} + 1/ρ) and the closed-form lemma iteratedDeriv_neg_zpow_neg_one_add proves iteratedDeriv k (fun s => −((s+c)^{−1})) = −(−1)^k k! (s+c)^{−k−1}. Our function (s+c)^{−1} = −(−((s+c)^{−1})) — define g := fun s => −((s+c)^{−1}): our f = −g: iteratedDeriv k (−g) — STILL need neg. OK just check existence of iteratedDeriv_neg at build; alternatives iteratedDerivWithin_neg (univ) + transfer: iteratedDeriv n f x = iteratedDerivWithin n f univ x (symm of Within_of_isOpen) — then iteratedDerivWithin_neg exists? `iteratedDerivWithin_neg`? also uncertain. Mathlib search needed. Actually — I recall Mathlib has `iteratedDeriv_neg`? In Mathlib.Analysis.Calculus.IteratedDeriv.DefConvergence... there's iteratedDerivWithin_neg : iteratedDerivWithin n (−f) s = −iteratedDerivWithin n f s? Hmm — there ARE iteratedDerivWithin_const_mul, iteratedDerivWithin_add, iteratedDerivWithin_sub... `iteratedDerivWithin_neg` probably exists, and global `iteratedDeriv_neg`? Let me just probe with #check in a scratch. I'll include a probe run. Per-term derivative: ```lean lemma iteratedDeriv_seriesTerm (j : ℕ) (hj : 1 ≤ j) (ρ : {ρ : ℂ // IsNontrivialZero ρ}) {s : ℂ} (hs : s - (ρ : ℂ) ≠ 0) : iteratedDeriv j (fun s => seriesTerm s ρ) s = (zeroMult ρ : ℂ) * ((-1 : ℂ) ^ j * (j ! : ℂ) * (s - (ρ : ℂ)) ^ (-(j : ℤ) - 1)) := by have hρ0 : (ρ : ℂ) ≠ 0 := ... have e : (fun s => seriesTerm s ρ) = fun s => (zeroMult ρ : ℂ) * ((s + -(ρ : ℂ)) ^ (-1 : ℤ) + 1 / (ρ : ℂ)) := by funext t rw [seriesTerm, zpow_neg_one] congr 2 · congr 1 ring · rfl?? — hmm: 1/(t−ρ) = (t+(−ρ))^{−1}: zpow_neg_one: (t+(−ρ))^{(−1:ℤ)} = (t+(−ρ))⁻¹: congr 1: t−ρ = t+(−ρ): ring ✓ rw [e] -- iteratedDeriv j (mult·(f + const)) = mult·(iteratedDeriv j f + 0) have hscf : ContDiffAt ℂ (j : ℕ∞)?? for iteratedDeriv_add — check the exact requirement rw [iteratedDeriv_const_mul?...] ``` iteratedDeriv_const_mul : iteratedDeriv n (fun x => c * f x) x = c * iteratedDeriv n f x — check existence. iteratedDeriv_add (hf : ContDiffAt ...) — from LiDigamma:702 usage: `rw [iteratedDeriv_add hcf hcg]` — hcf/hcg : ContDiffAt?? Let me grep LiDigamma for "hcf" to see their exact forms. Let me check those two things in LiDigamma before writing §5: (i) the hcf/hcg ContDiff forms near line 700; (ii) whether iteratedDeriv_const_mul/iteratedDeriv_neg exist (probe Mathlib via grep on the package source — faster than a Lean probe: grep Mathlib/Mathlib/Analysis/Calculus/IteratedDeriv* for theorem names).
§4 needs two name checks first — the `ContDiff` side-condition forms in `iteratedDeriv_add` and whether `iteratedDeriv_neg`/`iteratedDeriv_const_mul` exist.
tool: Bash
input
{
  "command": "cd D:/Python/Quantum/zeta-23-lean/.lake/packages/mathlib && grep -rn \"theorem iteratedDeriv_neg\\|theorem iteratedDeriv_const_mul\\|theorem iteratedDeriv_add\" Mathlib/Analysis/Calculus/ | head -10",
  "description": "Check iteratedDeriv lemma names in Mathlib"
}
tool: Grep ok
input
{
  "pattern": "hcf|hcg|ContDiff",
  "path": "D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\NguyenRH1\\LiDigamma.lean",
  "output_mode": "content",
  "-n": true,
  "head_limit": 20
}
result 2026-08-24 23:46:23Z → 2026-08-26 18:10:59Z
mode='content' num_files=0 filenames=[] content='research\\lean\\NguyenRH1\\NguyenRH1\\LiContour.lean:503:theorem kFun_shift_norm_le_exp_four_add_one {n : ℕ} {s : ℂ}\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiContour.lean-504-    (hσ: s.re ≤ 3) (hT : (n : ℝ) ≤ s.im ^ 2) :\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiContour.lean-505-    ‖kFun n (s + 1)‖ ≤ Real.exp 4 + 1:= by\nD:\\Python\\Quantum\\research\\lean\\NguyenRH1\\NguyenRH1\\LiContour.lean-506-  rcases Nat.eq_zero_or_pos n with hn | hn\nD:\\Python\\Quantum\\research\\lean\\NguyenRH1\\NguyenRH1\\LiContour.lean-507-  · subst hn\nD:\\Python\\Quantum\\research\\lean\\NguyenRH1\\NguyenRH1\\LiContour.lean-508-    simp only [kFun, pow_zero, sub_self, norm_zero]\nD:\\Python\\Quantum\\research\\lean\\NguyenRH1\\NguyenRH1\\LiContour.lean-509-    positivity\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiContour.lean-510-  · have hnR: (1:ℝ) ≤ (n : ℝ) := by exact_mod_cast hn\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiContour.lean-511-    have hTim: 0 < s.im ^ 2 := by nlinarith [hT, hnR]\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiContour.lean-512-    have hs0: s ≠ 0 := by\nD:\\Python\\Quantum\\research\\lean\\NguyenRH1\\NguyenRH1\\LiContour.lean-513-      rintro h\n--\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean:1300:theorem hIntegral_Jlag_low_le_dogLegUpper {n : ℕ} {T : ℝ}\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean-1301-    (hn: 16 ≤ n) (hTn : Real.sqrt (n : ℝ) ≤ T) (hTn1 : T ≤ Real.sqrt (n : ℝ) + 1) :\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean-1302-    ‖HIntegral (Jlag n) 3 (2 * Real.sqrt (n: ℝ)) T‖ ≤\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean-1303-      ((Real.sqrt (n: ℝ) + 1) / 2) * (Real.exp (5 / 2) + 1) / 2 + (8.38 : ℝ) +\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean-1304-        IIMaj (n: ℝ) / 4 := by\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean-1305-  have hnR: (16 : ℝ) ≤ (n : ℝ) := by exact_mod_cast hn\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean-1306-  have hsqrt4: (4 : ℝ) ≤ Real.sqrt (n : ℝ) := by\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean-1307-    have h1: Real.sqrt 16 ≤ Real.sqrt (n : ℝ) :=\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean-1308-      Real.sqrt_le_sqrt (by exact_mod_cast hn: (16 : ℝ) ≤ (n : ℝ))\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean-1309-    have h2: Real.sqrt 16 = 4 := by\nD:\\Python\\Quantum\\research\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean-1310-      rw [Real.sqrt_eq_iff_eq_sq (by norm_num) (by norm_num)]; norm_num\n--\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean:1367:theorem hIntegral_Jlag_low_neg_norm_le_dogLegUpper {n : ℕ} {T : ℝ}\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean-1368-    (hn: 16 ≤ n) (hTn : Real.sqrt (n : ℝ) ≤ T) (hTn1 : T ≤ Real.sqrt (n : ℝ) + 1) :\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean-1369-    ‖HIntegral (Jlag n) 3 (2 * Real.sqrt (n: ℝ)) (-T)‖ ≤\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean-1370-      ((Real.sqrt (n: ℝ) + 1) / 2) * (Real.exp (5 / 2) + 1) / 2 + (8.38 : ℝ) +\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean-1371-        IIMaj (n: ℝ) / 4 := by\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean-1372-  have hT0: (0 : ℝ) < T := by\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean-1373-    have hnR: (16 : ℝ) ≤ (n : ℝ) := by exact_mod_cast hn\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean-1374-    have hsqrt4: (4 : ℝ) ≤ Real.sqrt (n : ℝ) := by\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean-1375-      have h1: Real.sqrt 16 ≤ Real.sqrt (n : ℝ) :=\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean-1376-        Real.sqrt_le_sqrt (by exact_mod_cast hn: (16 : ℝ) ≤ (n : ℝ))\nresearch\\lean\\NguyenRH1\\NguyenRH1\\LiDogLeg.lean-1377-      have h2: Real.sqrt 16 = 4 := by' num_lines=35 num_matches=None applied_limit=None applied_offset=None
#1861 assistant 2026-08-24 23:54:41.270 UTC · 1910→21048 tok open ⤢
thinking (37464 chars)
The ContDiffAt pattern: AnalyticAt → .contDiffAt. For my zpow term: AnalyticAt (fun t => (t + c)^{−1})? Via analyticAt_const.div (analyticAt_id.add analyticAt_const) hs — for (t+c)^{(−1:ℤ)} — write as 1/(t+c): the zpow_neg_one conversion. So: ```lean have hF1 : ContDiffAt ℂ j (fun t : ℂ => (t + -(ρ : ℂ)) ^ (-1 : ℤ)) s := by have h2 : AnalyticAt ℂ (fun t : ℂ => t + -(ρ : ℂ)) s := analyticAt_id.add analyticAt_const have h3 : AnalyticAt ℂ (fun t : ℂ => 1 / (t + -(ρ : ℂ))) s := analyticAt_const.div h2 hs' have e : (fun t : ℂ => (t + -(ρ : ℂ)) ^ (-1 : ℤ)) = fun t => 1 / (t + -(ρ : ℂ)) := by funext t rw [zpow_neg_one, one_div] rw [e] exact h3.contDiffAt ``` Hmm — wait, zpow_neg_one : a^{−1} = a⁻¹; one_div : 1/a = a⁻¹: so (t+c)^{−1} = (t+c)⁻¹ = 1/(t+c): rw [zpow_neg_one] gives (t+c)⁻¹; goal RHS 1/(t+c): one_div says 1/(t+c) = (t+c)⁻¹: after rw [zpow_neg_one] the goal is (t+c)⁻¹ = 1/(t+c) — close by rw [one_div] (turns RHS into ⁻¹ ✓) or rfl (1/a and a⁻¹ are defeq — HDiv.hDiv 1 a vs Inv.inv a — not syntactically equal but defeq via one_div? they're NOT defeq — 1/a = 1 * a⁻¹? no: instDiv: a/b = a * b⁻¹: so 1/a = 1 * a⁻¹ — defeq to a⁻¹ by one_mul ✓ rfl-check might work; the rw [zpow_neg_one, one_div] makes both sides a⁻¹ ✓ safe). Now §5 main lemma — the M-test on ball(0, δ/2). The SummableLocallyUniformlyOn_of_locally_bounded signature from LiDigamma:720-722: ```lean apply SummableLocallyUniformlyOn_of_locally_bounded dpsiDomain_isOpen intro K hK hKc refine ⟨bound, summable_bound, fun m s hs => ?_⟩ ``` where hK : K ⊆ domain, hKc : IsCompact K, hs : s ∈ K. So it wants: for every compact K ⊆ u, a summable bound valid on K. My domain u := Metric.ball 0 (δ/2); K ⊆ u ⟹ ∀ s ∈ K, ‖s‖ < δ/2. The bound family for the j-th derivative family: u_j ρ := mult·j!·2^{j+1}·δ^{1−j}·... — wait it must be a REAL summable family: u_j ρ := (j ! : ℝ) * 2^{j+1} * δ^{1-j}?? δ^{1−j} with j ≥ 1 — δ < 1 maybe; δ^{1−j} = δ^{-(j−1)}: as (1/δ)^{j−1}. Let me define: u ρ := ((j ! : ℝ) * 2 ^ (j + 1) * (1 / δ) ^ (j - 1)) * ((zeroMult ρ : ℝ) / ‖(ρ : ℂ)‖ ^ 2)? — from my earlier estimate: term ≤ mult·j!·2^{j+1}·‖ρ‖^{−2}·δ^{1−j} where δ^{1−j} = (1/δ)^{j−1} ✓ (j ≥ 1). So C_j := j!·2^{j+1}·(1/δ)^{j−1}, u ρ := C_j·(mult/‖ρ‖²) — summable via summable_mult_div_norm_sq.mul_left ✓. Per-term bound for s ∈ K: ‖iteratedDerivWithin j (seriesTerm · ρ) u s‖ = ‖iteratedDeriv j (seriesTerm · ρ) s‖ (Within_of_isOpen isOpen_ball (hK hs)) = ‖mult·(−1)^j j! (s−ρ)^{−j−1}‖ = mult·j!·‖s−ρ‖^{−(j+1)} [norm computations] ≤ mult·j!·2^{j+1}·‖ρ‖^{−(j+1)} [‖s−ρ‖ ≥ ‖ρ‖/2] ≤ mult·j!·2^{j+1}·‖ρ‖^{−2}·(1/δ)^{j−1} [‖ρ‖^{−(j−1)} ≤ (1/δ)^{j−1}... wait: ‖ρ‖^{−(j+1)} = ‖ρ‖^{−2}·‖ρ‖^{−(j−1)} ≤ ‖ρ‖^{−2}·δ^{−(j−1)} ✓ since ‖ρ‖ ≥ δ]. Norm of the closed form: ‖mult·(−1)^j·j!·(s−ρ)^{−j−1}‖ = mult·1·j!·‖s−ρ‖^{−(j+1)}: norm_mul chain: ‖(−1:ℂ)^j‖ = 1 (the LiDigamma:736-738 hsign pattern ✓); RCLike.norm_natCast for j!; norm_zpow + the exponent rewrite (−(j:ℤ)−1 = −((j+1:ℕ):ℤ), zpow_neg, zpow_natCast) → ‖s−ρ‖^{j+1}⁻¹ (the LiDigamma:740 pattern ✓ exactly clone). The steps: ```lean lemma seriesTerm_deriv_summableLocallyUniformlyOn (j : ℕ) (hj : 1 ≤ j) {δ : ℝ} (hδ : 0 < δ) (hball : ∀ ρ : {ρ : ℂ // IsNontrivialZero ρ}, (ρ : ℂ) ∉ Metric.ball 0 δ) : SummableLocallyUniformlyOn (fun ρ => iteratedDerivWithin j (fun s => seriesTerm s ρ) (Metric.ball 0 (δ / 2))) (Metric.ball 0 (δ / 2)) := by apply SummableLocallyUniformlyOn_of_locally_bounded isOpen_ball intro K hK hKc set C : ℝ := (j ! : ℝ) * 2 ^ (j + 1) * (1 / δ) ^ (j - 1) with hC refine ⟨fun ρ => C * ((zeroMult ρ : ℝ) / ‖(ρ : ℂ)‖ ^ 2), summable_mult_div_norm_sq.mul_left C, fun ρ s hs => ?_⟩ have hsu : s ∈ Metric.ball (0 : ℂ) (δ / 2) := hK hs have hsnorm : ‖s‖ < δ / 2 := by rw [Metric.mem_ball, dist_zero_right] at hsu exact hsu have hρδ : δ ≤ ‖(ρ : ℂ)‖ := by by_contra h exact hball ρ (by rw [Metric.mem_ball, dist_zero_right]; exact lt_of_not_ge h) have hρpos : (0 : ℝ) < ‖(ρ : ℂ)‖ := lt_of_lt_of_le hδ hρδ have hsρ : s - (ρ : ℂ) ≠ 0 := by intro h rw [h] at hsnorm?? hmm: s = ρ ⟹ ‖ρ‖ < δ/2 contradicts δ ≤ ‖ρ‖: have : (ρ:ℂ) = s := sub_eq_zero.mp h ▸ ... -- s − ρ = 0 ⟹ s = ρ: sub_eq_zero.mp h : s = ρ rw [sub_eq_zero.mp h] at hsnorm linarith [hρδ, hsnorm] rw [iteratedDerivWithin_of_isOpen isOpen_ball hsu, iteratedDeriv_seriesTerm j hj ρ hsρ] -- norm of the closed form rw [norm_mul, norm_mul] have hsign : ‖(-1 : ℂ) ^ j‖ = 1 := by have h7 : ‖((-1 : ℂ))‖ = 1 := by rw [norm_neg, norm_one] rw [norm_pow, h7, one_pow] rw [RCLike.norm_natCast, hsign, one_mul, norm_zpow] rw [show (-(j : ℤ) - 1 : ℤ) = -(((j + 1 : ℕ) : ℤ)) by push_cast; ring, zpow_neg, zpow_natCast] -- goal: mult * (j! * (‖s−ρ‖^{j+1})⁻¹) ≤ C * (mult/‖ρ‖²) have hnormsρ : ‖(ρ : ℂ)‖ / 2 ≤ ‖s - (ρ : ℂ)‖ := by have h1 : ‖(ρ : ℂ)‖ - ‖s‖ ≤ ‖s - (ρ : ℂ)‖ := by have := norm_sub_norm_le (ρ : ℂ) s -- ‖ρ‖ − ‖s‖ ≤ ‖ρ − s‖ rw [norm_sub_rev] at this?? — norm_sub_rev : ‖a − b‖ = ‖b − a‖ ... have h2 : ‖(ρ : ℂ)‖ / 2 ≤ ‖(ρ : ℂ)‖ - ‖s‖ := by have : ‖s‖ ≤ ‖(ρ : ℂ)‖ / 2 := by linarith [hsnorm, hρδ] linarith [norm_nonneg s] exact h2.trans h1 -- assemble have hfact : (1 : ℝ) ≤ j ! := Nat.one_le_cast.mpr (Nat.one_le_iff_ne_zero.mpr (Nat.factorial_ne_zero j))?? -- for absorbing: mult·j!·(‖s−ρ‖^{j+1})⁻¹ ≤ mult·j!·(‖ρ‖/2)^{j+1}⁻¹·... calc (zeroMult ρ : ℝ) * ((j ! : ℝ) * (‖s - (ρ : ℂ)‖ ^ (j + 1))⁻¹) ≤ (zeroMult ρ : ℝ) * ((j ! : ℝ) * ((‖(ρ : ℂ)‖ / 2) ^ (j + 1))⁻¹) := by apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _) apply mul_le_mul_of_nonneg_left _ (by positivity : (0:ℝ) ≤ (j ! : ℝ)) exact inv_le_inv₀ (pow_pos (by positivity... ) ...) hmm inv direction: ‖s−ρ‖ ≥ ‖ρ‖/2 ⟹ (‖s−ρ‖^{j+1})⁻¹ ≤ ((‖ρ‖/2)^{j+1})⁻¹: `inv_le_inv₀ (ha : 0 < a) (hab : a ≤ b) : b⁻¹ ≤ a⁻¹`? signature: inv_le_inv₀ : 0 < a → a ≤ b → b⁻¹ ≤ a⁻¹ ✓ I think. With a = (‖ρ‖/2)^{j+1}, b = ‖s−ρ‖^{j+1}: pow_le_pow_left₀ (by linarith : 0 ≤ ‖ρ‖/2) hnormsρ (j+1) : a ≤ b ✓; pow_pos (by linarith : 0 < ‖ρ‖/2) : 0 < a ✓. _ = (zeroMult ρ : ℝ) * ((j ! : ℝ) * (2 / ‖(ρ : ℂ)‖) ^ (j + 1)) := by rw [div_pow, inv_div??] — ((‖ρ‖/2)^{j+1})⁻¹ = (2/‖ρ‖)^{j+1}: inv_div: (a/b)⁻¹ = b/a: ((‖ρ‖/2)^{j+1})⁻¹ = ((‖ρ‖/2)⁻¹)^{j+1} (inv_pow) = (2/‖ρ‖)^{j+1} (inv_div : (a/b)⁻¹ = b/a ✓). rw [inv_pow, inv_div] _ ≤ (zeroMult ρ : ℝ) * ((j ! : ℝ) * ((2 ^ (j + 1)) * ((1 / δ) ^ (j - 1)) * (1 / ‖(ρ : ℂ)‖ ^ 2))) := by apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _) apply mul_le_mul_of_nonneg_left _ (by positivity) -- (2/‖ρ‖)^{j+1} = 2^{j+1}/‖ρ‖^{j+1} = 2^{j+1}·(1/‖ρ‖²)·(1/‖ρ‖^{j−1}) ≤ 2^{j+1}·(1/‖ρ‖²)·(1/δ)^{j−1} rw [div_pow] rw [show (2 : ℝ) ^ (j + 1) / ‖(ρ : ℂ)‖ ^ (j + 1) = 2 ^ (j + 1) * (1 / ‖(ρ : ℂ)‖ ^ 2) * (1 / ‖(ρ : ℂ)‖ ^ (j - 1)) by rw [one_div_mul_one_div?? ...] — algebra: 1/‖ρ‖^{j+1} = (1/‖ρ‖²)(1/‖ρ‖^{j−1}): pow: ‖ρ‖^{j+1} = ‖ρ‖²·‖ρ‖^{j−1}: pow: j+1 = 2+(j−1) (j ≥ 1: Nat... careful: j − 1 for j : ℕ, j ≥ 1: j − 1 + 2 = j + 1 ✓ omega. rw [← pow_add]; congr: omega] apply mul_le_mul_of_nonneg_left _ (by positivity : (0:ℝ) ≤ 2^(j+1)) apply mul_le_mul_of_nonneg_left _ (by positivity) exact one_div_le_one_div_of_le (pow_pos hδ (j-1)) (pow_le_pow_left₀ hδ.le hρδ (j-1)) _ = C * ((zeroMult ρ : ℝ) / ‖(ρ : ℂ)‖ ^ 2) := by rw [hC] ring ``` The last ring: C·(mult/‖ρ‖²) = j!·2^{j+1}·(1/δ)^{j−1}·mult/‖ρ‖² vs mult·(j!·(2^{j+1}·((1/δ)^{j−1}·(1/‖ρ‖²)))) — ring ✓ (division forms: ·(1/‖ρ‖²) vs /‖ρ‖² — ring handles). pow: j+1 = 2+(j−1): `have : j + 1 = 2 + (j - 1) := by omega` then rw [← pow_add, this]. ✓ Wait — one_detail: the goal after the Within/global/zpow rewrites: the term form. iteratedDeriv_seriesTerm gives: mult·((−1)^j·j!·(s−ρ)^{−j−1}) — after norm_mul ×2: ‖mult‖·‖(−1)^j‖·‖j!‖·‖(s−ρ)^{−j−1}‖ — hmm the bracket is ((−1)^j * j! * (s−ρ)^z): norm_mul twice: ‖(−1)^j‖·‖j!·(s−ρ)^z‖ → then need another norm_mul for j!·(s−ρ)^z. LiDigamma did: rw [norm_mul, norm_mul] on mult·((−1)^k·k!·z) — the outer split: mult · (X) and X = (−1)^k · (k! · z)?: their closed form: -((-1))^k * k! * z parses as ((−(−1)^k)·k!)·z: norm_mul, norm_mul: ‖−(−1)^k‖·‖k!·z‖ → ‖−(−1)^k‖·(‖k!‖·‖z‖)?? norm_mul on ‖k!·z‖... they did rw [norm_mul, norm_mul] then hsign rw then one_mul, RCLike.norm_natCast, norm_zpow — sequence at 735-739: `rw [norm_mul, norm_mul]; rw [hsign, one_mul, RCLike.norm_natCast, norm_zpow]` — so after two norm_mul: ‖−(−1)^k‖ · (‖↑k!‖ · ‖z‖)?? — norm_mul twice: ‖a·b·c‖ = ‖a‖·‖b·c‖ = ‖a‖·(‖b‖·‖c‖) ✓. Their a = −(−1)^k (hsign: ‖−(−1)^k‖ = 1), b = k! (natCast), c = z. Mine: a = (−1)^j (hsign), b = j!, c = z — and the OUTER mult·(closed form): seriesTerm's value mult·(X): one more norm_mul: total three. My plan wrote rw [norm_mul, norm_mul] — need one more for the outer mult: order: mult·((−1)^j·j!·z): norm_mul → ‖mult‖·‖(−1)^j·j!·z‖; norm_mul → ‖mult‖·(‖(−1)^j‖·‖j!·z‖); norm_mul → ‖mult‖·(‖(−1)^j‖·(‖j!‖·‖z‖)). So THREE norm_mul. Then RCLike.norm_natCast on ‖(zeroMult ρ:ℂ)‖ = mult (ℝ) ✓, hsign, one_mul, RCLike.norm_natCast on j!, norm_zpow on z. Write rw [norm_mul, norm_mul, norm_mul, RCLike.norm_natCast, hsign, one_mul, RCLike.norm_natCast, norm_zpow] — careful RCLike.norm_natCast might rewrite both casts at once (rw rewrites first match only? rw rewrites ALL matches of the first unifier — banked gotcha "rw first-unifier-only"... RCLike.norm_natCast : ‖(↑n)‖ = ↑n — two instances (zeroMult and j!): rw rewrites all occurrences matching the first found pattern... first unifier: probably zeroMult; need it twice for j!. Use simp only [RCLike.norm_natCast] to rewrite all ✓ or rw twice. Then the show-exponent rewrite + zpow_neg + zpow_natCast (clone LiDigamma:740) → c-part becomes (‖s−ρ‖^{j+1})⁻¹. Goal: mult·(1·(j!·(‖s−ρ‖^{j+1})⁻¹)) ≤ C·(mult/‖ρ‖²) — after one_mul. Then the calc. In the calc I assumed the goal form mult·(j!·(‖s−ρ‖^{j+1})⁻¹) ≤ ... — write the calc's first line to match (with 1· removed — include `one_mul` to clean). norm_sub_norm_le: ‖a‖ − ‖b‖ ≤ ‖a − b‖: `norm_sub_norm_le (a b) : ‖a‖ - ‖b‖ ≤ ‖a - b‖` ✓ exists. With norm_sub_rev : ‖a − b‖ = ‖b − a‖ ✓. So ‖ρ‖ − ‖s‖ ≤ ‖ρ − s‖ = ‖s − ρ‖ ✓. inv_le_inv₀ signature: `inv_le_inv₀ (ha : 0 < a) (h : a ≤ b) : b⁻¹ ≤ a⁻¹` — hmm in current Mathlib: inv_le_inv₀ : a ≤ b → 0 < a → b⁻¹ ≤ a⁻¹?? arg order uncertain. Alternative: `one_div_le_one_div_of_le (ha : 0 < a) (h : a ≤ b) : 1/b ≤ 1/a` ✓ (session-033 confirmed "one_div_le_one_div_of_le takes the small side's positivity first" ✓). Use that with 1/x forms instead of ⁻¹ — the zpow_neg gives (‖s−ρ‖^{j+1})⁻¹ — convert ⁻¹ to 1/x: `inv_eq_one_div : a⁻¹ = 1/a` ✓. rw [inv_eq_one_div] then one_div_le_one_div_of_le. Hmm wait — actually simpler: skip the inv form: from the calc, rewrite ((‖ρ‖/2)^{j+1})⁻¹ → 1/(‖ρ‖/2)^{j+1}, use one_div_le_one_div_of_le directly. And ((‖ρ‖/2)^{j+1}) → (2/‖ρ‖)^{j+1}: one_div_div: 1/(a/b) = b/a: (‖ρ‖/2)^{j+1} = ‖ρ‖^{j+1}/2^{j+1}: 1/(that) = 2^{j+1}/‖ρ‖^{j+1} — maybe cleaner to go through: (2/‖ρ‖)^{j+1} = 2^{j+1}/‖ρ‖^{j+1} (div_pow) ✓ as planned. OK. Then the main termwise lemma: ```lean lemma iteratedDeriv_seriesFun_zero (j : ℕ) (hj : 1 ≤ j) : iteratedDeriv j seriesFun 0 = ∑' ρ : {ρ : ℂ // IsNontrivialZero ρ}, (zeroMult ρ : ℂ) * ((-1 : ℂ) ^ j * (j ! : ℂ) * ((0 : ℂ) - (ρ : ℂ)) ^ (-(j : ℤ) - 1)) := by obtain ⟨δ, hδ, hball⟩ := exists_ball_avoid_nontrivialZeros 0 not_isNontrivialZero_zero have hmem : (0 : ℂ) ∈ Metric.ball (0 : ℂ) (δ / 2) := by rw [Metric.mem_ball, dist_zero_right, norm_zero] exact half_pos hδ have hmain : iteratedDerivWithin j seriesFun (Metric.ball 0 (δ / 2)) 0 = ∑' ρ : {ρ : ℂ // IsNontrivialZero ρ}, iteratedDerivWithin j (fun s => seriesTerm s ρ) (Metric.ball 0 (δ / 2)) 0 := by rw [iteratedDerivWithin_tsum j isOpen_ball hmem (fun s _ => seriesSummable s) (fun j' hj'1 _ => seriesTerm_deriv_summableLocallyUniformlyOn j' hj'1 hδ hball) ?_] · intro ρ j' r hjm hr -- differentiability side condition, clone LiDigamma:759-785 rcases Nat.eq_zero_or_pos j' with hj0 | hj0 · subst hj0 rw [iteratedDerivWithin_zero] -- seriesTerm differentiable in s at r (r − ρ ≠ 0 since r ∈ ball) have hrρ : r - (ρ : ℂ) ≠ 0 := by intro h have hrn : ‖r‖ < δ / 2 := by rw [Metric.mem_ball, dist_zero_right] at hr exact hr have hρδ : δ ≤ ‖(ρ : ℂ)‖ := by by_contra hc exact hball ρ (by rw [Metric.mem_ball, dist_zero_right]; exact lt_of_not_ge hc) rw [sub_eq_zero.mp h] at hrn linarith rw [seriesTerm] apply DifferentiableAt.const_mul apply DifferentiableAt.add · exact (differentiableAt_const (1 : ℂ)).div (differentiableAt_id.sub differentiableAt_const) hrρ · exact differentiableAt_const _ · have h5 : (fun t => iteratedDerivWithin j' (fun z => seriesTerm z ρ) (Metric.ball 0 (δ/2)) t) =ᶠ[𝓝 r] fun t => (zeroMult ρ : ℂ) * ((-1 : ℂ) ^ j' * (j' ! : ℂ) * (t - (ρ : ℂ)) ^ (-(j' : ℤ) - 1)) := by filter_upwards [isOpen_ball.mem_nhds hr] with t ht have htρ : t - (ρ : ℂ) ≠ 0 := ... rw [iteratedDerivWithin_of_isOpen isOpen_ball ht, iteratedDeriv_seriesTerm j' hj0 ρ htρ] apply h5.differentiableAt_iff.mpr -- the closed form is differentiable (zpow, r − ρ ≠ 0) have hrρ : r - (ρ : ℂ) ≠ 0 := ... apply DifferentiableAt.const_mul apply DifferentiableAt.const_mul -- (t−ρ)^{−j'−1} differentiable have h4 : DifferentiableAt ℂ (fun t : ℂ => t - (ρ : ℂ)) r := differentiableAt_id.sub differentiableAt_const exact ((hasDerivAt_zpow (-(j' : ℤ) - 1) (r - (ρ : ℂ)) (Or.inl hrρ)).differentiableAt).comp r h4 -- ↑ but the ∘ defeq bridge needed: ((fun x => x^z) ∘ fun t => t−ρ) = fun t => (t−ρ)^z := rfl -- convert Within → global rw [← iteratedDerivWithin_of_isOpen isOpen_ball hmem] rw [hmain] apply tsum_congr intro ρ have h0ρ : (0 : ℂ) - (ρ : ℂ) ≠ 0 := by intro h have : (ρ:ℂ) = 0 := by have := congrArg Neg.neg h; simpa using this have h2 := ρ.2.2.1 rw [this, Complex.zero_re] at h2 exact lt_irrefl 0 h2 rw [iteratedDerivWithin_of_isOpen isOpen_ball hmem, iteratedDeriv_seriesTerm j hj ρ h0ρ] ``` Notes: - iteratedDerivWithin_tsum's conclusion: iteratedDerivWithin k (∑' f) u x = ∑' n, iteratedDerivWithin k (f n) u x — with seriesFun = ∑' seriesTerm ✓ — rw [iteratedDerivWithin_tsum ...] rewrites the LHS; but the hypothesis-side goals: the pattern from LiDigamma:752-755: `rw [iteratedDerivWithin_tsum k dpsiDomain_isOpen dpsiDomain_half (fun s hs => ...) (fun j hj1 _ => ...) ?_]` — the last ?_ is the differentiability condition, discharged after with the two bullets (· apply tsum_congr ... wait no — in LiDigamma, after the rw there were TWO goals: the main (tsum_congr per-term) and ?_ (differentiability). They structured: ```lean rw [iteratedDerivWithin_tsum k ... ?_] · apply tsum_congr intro m exact iteratedDerivWithin_dpsiTermC ... · intro n j r hjm hr ... ``` So the rw generates: goal1 = the resulting equation (needs tsum_congr), goal2 = the differentiability side condition. I'll mirror: rw [...]; · tsum_congr per-term (within→global→seriesTerm closed form); · the differentiability intro. Hmm wait — in my hmain I wrote the equation directly as the target with the per-term Within forms — so after rw [iteratedDerivWithin_tsum ...], the goal becomes ∑' ρ, iteratedDerivWithin j (seriesTerm · ρ) u 0 = ∑' ρ, iteratedDerivWithin j (seriesTerm · ρ) u 0 (rfl) — no. Let me restructure hmain to produce EXACTLY the tsum-lemma's output, then do the per-term conversion separately: ```lean have hmain : iteratedDerivWithin j seriesFun (Metric.ball 0 (δ / 2)) 0 = ∑' ρ : {ρ : ℂ // IsNontrivialZero ρ}, iteratedDerivWithin j (fun s => seriesTerm s ρ) (Metric.ball 0 (δ / 2)) 0 := by rw [seriesFun] rw [iteratedDerivWithin_tsum j isOpen_ball hmem (fun s _ => seriesSummable s) (fun j' hj'1 _ => seriesTerm_deriv_summableLocallyUniformlyOn j' hj'1 hδ hball) ?_] · intro ρ j' r hjm hr (differentiability side condition) ``` Wait — does the rw [iteratedDerivWithin_tsum] leave the tsum_congr goal? In LiDigamma the target was the VALUE equation (they needed the per-term closed form at 1/2, hence the first bullet). For hmain, the target is EXACTLY the tsum-lemma's conclusion shape — after rw, goal closes by rfl?? No — rw [iteratedDerivWithin_tsum ...] rewrites instances of the LHS pattern (iteratedDerivWithin k (∑' f) u x) in the goal — the goal IS that equation; the rw rewrites the LHS to the RHS form, leaving `∑' ... = ∑' ...` rfl — closed automatically by rw ✓ plus the side-condition goal remains. But the ?_ placeholder in the rw args: supplying ?_ as the last arg means the side condition becomes a NEW goal instead of being unified — with two goals: (1) rfl-closed main? Actually with ?_ in the rw, after rewriting the main goal is closed; the ?_ goal is the side condition. Order of goals: the ?_ comes as a new goal. So: ```lean rw [iteratedDerivWithin_tsum j isOpen_ball hmem ... ?_] intro ρ j' r hjm hr (discharge) ``` But careful — if the main goal closes by rfl during rw, the remaining goal is the side condition ✓. Hmm — but does `seriesFun` need unfolding first? seriesFun 0 vs ∑' seriesTerm: the tsum-lemma's LHS pattern: iteratedDerivWithin j (fun s => ∑' ρ, seriesTerm s ρ) — goal's function is seriesFun (a def) — the pattern fun s => ∑' ρ, seriesTerm s ρ vs seriesFun — rw needs syntactic match: unfold seriesFun first: rw [seriesFun] — but seriesFun is a def — rw [seriesFun] (the Fexpr-pattern ✓ works). BUT it rewrites seriesFun EVERYWHERE including inside hmem?? no — hmem is a hypothesis, rw [seriesFun] only at goal ✓. Goal after: iteratedDerivWithin j (fun s => ∑' ρ, seriesTerm s ρ) u 0 = ... ✓ then the tsum-rw matches. Wait — actually does iteratedDerivWithin_tsum's LHS have the form with the LAMBDA (fun s => ∑' n, f n s)? The lemma: iteratedDerivWithin k (fun x => ∑' n, f n x) u x = ∑' n, iteratedDerivWithin k (f n) u x presumably. After rw [seriesFun], goal LHS: iteratedDerivWithin j (fun s => ∑' ρ, seriesTerm s ρ) (ball) 0 ✓ matches. Then final: ```lean rw [← iteratedDerivWithin_of_isOpen isOpen_ball hmem, hmain] apply tsum_congr intro ρ rw [iteratedDerivWithin_of_isOpen isOpen_ball hmem, iteratedDeriv_seriesTerm j hj ρ h0ρ] ``` ✓ (with h0ρ proved before). Side-condition (j' = 0 case): after rw [iteratedDerivWithin_zero]: goal DifferentiableAt ℂ (fun s => seriesTerm s ρ) r — rw [seriesTerm]: function fun s => mult·(1/(s−ρ) + 1/ρ): DifferentiableAt.const_mul _ (hr-diff): DifferentiableAt (fun s => 1/(s−ρ) + 1/ρ) r: .add of: (differentiableAt_const 1).div (differentiableAt_id.sub differentiableAt_const) hrρ + differentiableAt_const ✓. Then const_mul needs DifferentiableAt of the inner: `DifferentiableAt.const_mul (hg : DifferentiableAt g x) (c) : DifferentiableAt (fun x => c * g x) x`? signature: DifferentiableAt.const_mul (hd : DifferentiableAt 𝕜 f x) (c : 𝔸')?? Hmm — for ℂ: `DifferentiableAt.const_mul (hf : DifferentiableAt 𝕜 f x) (c : 𝕜) : DifferentiableAt 𝕜 (fun x => c * f x) x`? arg order — from LiDigamma:785: `exact (differentiableAt_const _).mul h6` — they used .mul with the const on the LEFT: (differentiableAt_const _).mul h6 : DifferentiableAt (fun r => const · h6-fun) ✓ — const_mul via mul with const first ✓. My term mult·(X): (differentiableAt_const (zeroMult ρ : ℂ)).mul hX ✓ same pattern. For the j' ≥ 1 case: h5 eventuallyEq — the closed-form differentiability: const_mul·const_mul·zpow-comp: ((hasDerivAt_zpow ...).differentiableAt).comp r h4 — produces DifferentiableAt ((fun x => x^z) ∘ (fun t => t−ρ)) r — vs needed (fun t => (t−ρ)^z): the rfl bridge (LiDigamma:781-783 pattern ✓): ```lean have h6 : DifferentiableAt ℂ (fun t : ℂ => (t - (ρ : ℂ)) ^ (-(j' : ℤ) - 1)) r := by have h7 := ((hasDerivAt_zpow (-(j' : ℤ) - 1) (r - (ρ : ℂ)) (Or.inl hrρ)).differentiableAt).comp r h4 have heq : ((fun x : ℂ => x ^ (-(j' : ℤ) - 1)) ∘ fun t : ℂ => t - (ρ : ℂ)) = fun t : ℂ => (t - (ρ : ℂ)) ^ (-(j' : ℤ) - 1) := rfl rw [heq] at h7 exact h7 exact (differentiableAt_const _).mul ((differentiableAt_const _).mul h6) ``` ✓ clone. - htρ/hrρ for r, t ∈ ball: ‖t‖ < δ/2, ‖ρ‖ ≥ δ ⟹ t − ρ ≠ 0 (as shown: if t = ρ then ‖ρ‖ < δ/2 < δ ✗). §6 capstone: ```lean /-! ## 6. The capstone -/ /-- gFun agrees with B + seriesFun on a full neighbourhood of 0. -/ lemma gFun_eventuallyEq_zero (hZC : ZeroCountProp) : gFun =ᶠ[𝓝 0] (fun s => momentB hZC + seriesFun s) := by -- from the punctured version + the value at 0 have hp : ∀ᶠ s in 𝓝[≠] (0 : ℂ), gFun s = momentB hZC + seriesFun s := by filter_upwards [good_eventually_zero, self_mem_nhdsWithin] with s ⟨hζ, h1, hn⟩ h0 exact gFun_eq_momentB hZC hζ h0 h1 hn -- upgrade: 𝓝 0 = 𝓝[≠] 0 ⊔ pure 0 ... ``` For the upgrade — look for the lemma: `Filter.EventuallyEq.insert`? Hmm. There's: `nhdsWithin_union`? The clean one: `Filter.EventuallyEq.of_nhdsWithin_punctured`? Let me think of the standard: (𝓝[≠] a) and f a = g a gives f =ᶠ[𝓝 a] g: prove via: 𝓝 a = 𝓝[{a}ᶜ] a ⊔ 𝓝[{a}] a?? Hmm. Standard lemma: `eventually_nhdsWithin_iff`? The insert fact: {a} ∈ 𝓝 a... Write manually: ```lean rw [Filter.EventuallyEq] at hp ⊢ rw [eventually_nhds_iff] -- ?? does eventually_nhds_iff exist: (∀ᶠ x in 𝓝 a, p x) ↔ p a ∨ ∀ᶠ x in 𝓝[≠] a, p x — hmm name... ``` Mathlib: `eventually_nhdsWithin_iff` is about s. For nhds: there IS `Filter.eventually_nhds_iff_eventually_nhdsWithin`? not sure. There's `eventually_nhds_iff` : (∀ᶠ x in 𝓝 a, p x) ↔ ∀ ε > 0... no that's metric. Robust manual: use Metric.eventually_nhds_iff_ball both ways: ```lean rw [Metric.eventually_nhdsWithin_iff_ball?? no... ``` Alternative — the punctured-to-full upgrade: ```lean have h0 : gFun 0 = momentB hZC + seriesFun 0 := by rw [gFun_zero hZC, seriesFun_zero, add_zero] -- ∀ᶠ s in 𝓝 0: use that 𝓝[≠] 0 ≤ 𝓝 0 and {0}ᶜ ∪ {0}: filter_upwards [hp.filter_mono (nhdsWithin_le_nhds?? wrong direction]... ``` Hmm: hp : ∀ᶠ s in 𝓝[≠] 0, P s. Want ∀ᶠ s in 𝓝 0, P' s where P' accounts for s = 0. Trick: ∀ᶠ s in 𝓝 0, s ∈ {0}ᶜ → P s?? Use: eventually_nhdsWithin_iff : (∀ᶠ x in 𝓝[s] a, p x) ↔ ∀ᶠ x in 𝓝 a, x ∈ s → p x: hp ↔ ∀ᶠ s in 𝓝 0, s ≠ 0 → P s. Then filter_upwards [that] with s hs: cases s = 0: if s = 0 use h0; else hs h. So: ```lean rw [eventually_nhdsWithin_iff] at hp filter_upwards [hp] with s hs by_cases h : s = 0 · subst h exact h0 · exact hs h ``` eventually_nhdsWithin_iff : (∀ᶠ x in 𝓝[s] a, p x) ↔ ∀ᶠ x in 𝓝 a, x ∈ s → p x ✓ exists (I'm fairly confident). With s = {0}ᶜ: 𝓝[{0}ᶜ] 0 = 𝓝[≠] 0 — is hp stated with 𝓝[≠]? 𝓝[≠] a is notation for 𝓝[{a}ᶜ] a ✓ same. ✓ Then: ```lean theorem sigmaP_eq_neg_iteratedDeriv_gFun_div (hZC : ZeroCountProp) {k : ℕ} (hk : 1 ≤ k) : sigmaP k = -(iteratedDeriv (k - 1) gFun 0) / ((k - 1)! : ℂ) := by rcases Nat.lt_or_ge k 2 with hk1 | hk2 · have hk1' : k = 1 := by omega subst hk1' rw [Nat.sub_self, iteratedDeriv_zero, Nat.factorial_zero, Nat.cast_one, div_one] exact sigmaP_one_eq_neg_gFun_zero hZC · -- k ≥ 2 have hcong := iteratedDeriv_congr_of_eventuallyEq (gFun_eventuallyEq_zero hZC) (k - 1) rw [hcong] -- iteratedDeriv (k−1) (B + seriesFun) 0 = iteratedDeriv (k−1) seriesFun 0 have hcf : ContDiffAt ℂ (k - 1 : ℕ∞)?? ... ``` Hmm — iteratedDeriv_add's ContDiffAt requirement: `iteratedDeriv_add (hf : ContDiffAt 𝕜 n f x) (hg : ContDiffAt 𝕜 n g x)` — with n : ℕ (the same n as the iteratedDeriv order). The LiDigamma usage: `iteratedDeriv_add hcf hcg` with hcf : ContDiffAt ℂ k ... — k : ℕ (the order) — ContDiffAt ℂ k — the k coerces to ℕ∞ ✓ (ContDiffAt takes ℕ∞). So: ```lean have hcf : ContDiffAt ℂ (k - 1 : ℕ) (fun _ : ℂ => momentB hZC) 0 := contDiff_const.contDiffAt have hcg : ContDiffAt ℂ (k - 1 : ℕ) seriesFun 0 := (seriesFun_analyticAt not_isNontrivialZero_zero).contDiffAt rw [iteratedDeriv_add hcf hcg, iteratedDeriv_const, if_neg (by omega : k - 1 ≠ 0), zero_add] ``` Hmm — ContDiffAt ℂ (k−1 : ℕ) — the coercion: ContDiffAt's smoothness parameter type ℕ∞ (WithTop ℕ∞?): in current Mathlib ContDiffAt 𝕜 (n : ℕ∞)?? — actually `ContDiffAt 𝕜 n` with n : ℕ∞ = WithTop ℕ∞? — plain ℕ works via coercion: LiDigamma:695 wrote ContDiffAt ℂ k with k : ℕ ✓ (coercion inserted). For k−1 : write (k - 1 : ℕ) — the iteratedDeriv (k−1) has k−1 : ℕ — the coercion matches automatically. AnalyticAt.contDiffAt : AnalyticAt ℂ f x → ContDiffAt ℂ n f x? — signature: `AnalyticAt.contDiffAt (h : AnalyticAt ℂ f x) : ContDiffAt ℂ n f x`? — for ANY n (analytic ⟹ C^∞) ✓ I believe `AnalyticAt.contDiffAt` exists (analyticAt.contDiff? hmm). LiDigamma:701: `exact h3.neg.contDiffAt` — AnalyticAt.neg then .contDiffAt ✓ — so AnalyticAt.contDiffAt exists ✓ and the n is implicit/inferred ✓. Then: ```lean -- = ∑' ρ, mult·(−1)^{k−1}(k−1)!·(0−ρ)^{−k} = −(k−1)!·sigmaP k rw [iteratedDeriv_seriesFun_zero (k - 1) (by omega)] -- exponent: −(k−1:ℤ)−1 = −(k:ℤ) have hexp : (-(k - 1 : ℤ) - 1 : ℤ) = -(k : ℤ) := by have : ((k : ℤ) - 1 : ℤ) = ((k - 1 : ℕ) : ℤ) := by rw [Int.ofNat_sub (by omega : 1 ≤ k)] ... push_cast [this]... ``` Hmm — careful: (k − 1 : ℤ) with k : ℕ: the iteratedDeriv_seriesFun_zero's exponent is −(j:ℤ)−1 with j := k−1 (ℕ sub!): −((k−1:ℕ):ℤ)−1. Want = −(k:ℤ): ((k−1:ℕ):ℤ) = (k:ℤ)−1 (Int.ofNat_sub hk : ((k−1:ℕ):ℤ) = (k:ℤ)−1 ✓ `Int.ofNat_sub (h : m ≤ n) : (↑(n − m) : ℤ) = ↑n − ↑m` ✓). So −((k−1:ℕ):ℤ)−1 = −((k:ℤ)−1)−1 = −(k:ℤ) ✓: ```lean have hexp : (-(((k - 1 : ℕ) : ℤ)) - 1 : ℤ) = -(k : ℤ) := by rw [Int.ofNat_sub hk] push_cast ring ``` push_cast for the (↑k : ℤ) forms... ((k:ℤ)−1) — fine: rw [Int.ofNat_sub hk]: goal -(↑k − 1) − 1 = -↑k: ring ✓ (no push_cast needed). Then per-term evaluation at 0: ```lean -- ∑' ρ, mult·((−1)^{k−1}(k−1)!·(0−ρ)^{−(k:ℤ)}) = −(k−1)!·sigmaP k have heval : (∑' ρ : {ρ : ℂ // IsNontrivialZero ρ}, (zeroMult ρ : ℂ) * ((-1 : ℂ) ^ (k - 1) * ((k - 1)! : ℂ) * ((0 : ℂ) - (ρ : ℂ)) ^ (-(k - 1 : ℤ) - 1))) = -(((k - 1)! : ℂ)) * sigmaP k := by rw [hexp] -- per-term: mult·((−1)^{k−1}(k−1)!·(0−ρ)^{−k}) = −(k−1)!·mult·(1/ρ)^k have hper : ∀ ρ : {ρ : ℂ // IsNontrivialZero ρ}, (zeroMult ρ : ℂ) * ((-1 : ℂ) ^ (k - 1) * ((k - 1)! : ℂ) * ((0 : ℂ) - (ρ : ℂ)) ^ (-(k : ℤ))) = -(((k - 1)! : ℂ)) * ((zeroMult ρ : ℂ) * (1 / (ρ : ℂ)) ^ k) := by intro ρ have hρ0 : (ρ : ℂ) ≠ 0 := ... -- (0−ρ)^{−k} = (−ρ)^{−k} = (−1)^k·(ρ^k)⁻¹·... have e1 : ((0 : ℂ) - (ρ : ℂ)) ^ (-(k : ℤ)) = (-1 : ℂ) ^ k * (1 / (ρ : ℂ)) ^ k := by rw [zero_sub] -- (−ρ)^{(−k:ℤ)} = ((−ρ)^k)⁻¹ = ((−1)^k ρ^k)⁻¹ = (−1)^k (ρ^k)⁻¹ = (−1)^k (1/ρ)^k rw [zpow_neg, zpow_natCast, neg_pow] rw [mul_inv] -- ((−1)^k)⁻¹·(ρ^k)⁻¹ = (−1)^k·(ρ^k)⁻¹: ((−1)^k)⁻¹ = (−1)^k have h2 : ((-1 : ℂ) ^ k)⁻¹ = (-1 : ℂ) ^ k := by apply inv_eq_of_mul_eq_one_right rw [← pow_add, ← two_mul] -- (−1)^{2k} = 1: Even: even (2k): Even.neg_one_pow?? have : ((-1 : ℂ) ^ 2) ^ k = 1 := by rw [show (-1 : ℂ) ^ 2 = 1 by ring] exact one_pow k rwa [← pow_mul, mul_comm 2 k, pow_mul] at this?? rw [h2, ← mul_pow, one_div] -- (−1)^k·(ρ^k)⁻¹ vs (−1)^k·(1/ρ)^k: (1/ρ)^k = (ρ^k)⁻¹: one_div_pow?? inv_pow: (ρ⁻¹)^k = (ρ^k)⁻¹; 1/ρ = ρ⁻¹: one_div... congr 1 rw [one_div, ← inv_pow] rw [e1] -- mult·((−1)^{k−1}(k−1)!·((−1)^k·(1/ρ)^k)) = −(k−1)!·mult·(1/ρ)^k have hsign : (-1 : ℂ) ^ (k - 1) * (-1 : ℂ) ^ k = -1 := by rw [← pow_add] -- (−1)^{k−1+k} = (−1)^{2k−1} = −1 have h2 : k - 1 + k = 2 * k - 1 := by omega rw [h2] -- (−1)^{2k−1} = (−1)^{2k}/(−1) = 1/(−1) = −1: pow_sub?? for ℕ: 2k−1: use: 2k−1 = 2(k−1)+1: have h3 : 2 * k - 1 = 2 * (k - 1) + 1 := by omega rw [h3, pow_add] have h4 : (-1 : ℂ) ^ (2 * (k - 1)) = 1 := by rw [pow_mul, show (-1 : ℂ) ^ 2 = 1 by ring] exact one_pow _ rw [h4, one_mul] -- (−1)^1 = −1 exact pow_one _ -- assemble: mult·((−1)^{k−1}·(k−1)!·((−1)^k·w)) = −(k−1)!·mult·w calc (zeroMult ρ : ℂ) * ((-1 : ℂ) ^ (k - 1) * ((k - 1)! : ℂ) * ((-1 : ℂ) ^ k * (1 / (ρ : ℂ)) ^ k)) = ((zeroMult ρ : ℂ) * ((k - 1)! : ℂ) * (1 / (ρ : ℂ)) ^ k) * ((-1 : ℂ) ^ (k - 1) * (-1 : ℂ) ^ k) := by ring _ = ((zeroMult ρ : ℂ) * ((k - 1)! : ℂ) * (1 / (ρ : ℂ)) ^ k) * (-1) := by rw [hsign] _ = -(((k - 1)! : ℂ)) * ((zeroMult ρ : ℂ) * (1 / (ρ : ℂ)) ^ k) := by ring rw [tsum_congr hper, ← sigmaP_eq_unpaired hk2] -- ∑' ρ, −(k−1)!·(mult·(1/ρ)^k) = −(k−1)!·∑' ... : tsum_mul_left rw [tsum_mul_left] ``` Careful: hper's RHS: −(k−1)!·(mult·(1/ρ)^k) — the unpaired family: mult·(1/ρ)^k: ∑' ρ, −(k−1)!·(mult·(1/ρ)^k) = −(k−1)!·∑' mult·(1/ρ)^k (tsum_mul_left ✓) = −(k−1)!·sigmaP k (sigmaP_eq_unpaired hk2 ✓). zpow manipulations: ((0:ℂ)−ρ)^(−k:ℤ): zero_sub → (−ρ)^(−k:ℤ); zpow_neg : a^{−n} = (a^n)⁻¹ ✓ `zpow_neg (a) (n : ℤ) : a ^ (-n) = (a ^ n)⁻¹`; zpow_natCast : a^{(n:ℤ)} = a^n ✓. So (−ρ)^{(−(k:ℤ))} → wait the exponent is −(k:ℤ) where k : ℕ cast — zpow_neg needs the exponent literally as −x: −(k:ℤ) = −((k:ℕ):ℤ): pattern a ^ (-x) with x := (k:ℤ) ✓. → ((−ρ)^(k:ℤ))⁻¹ → zpow_natCast → ((−ρ)^k)⁻¹ → neg_pow : (−a)^n = (−1)^n·a^n ✓ `neg_pow (a) (n : ℕ)` — used LiSwaps:106 ✓. → ((−1)^k·ρ^k)⁻¹ → mul_inv : (a·b)⁻¹ = a⁻¹·b⁻¹ ✓. → (−1)^k⁻¹·(ρ^k)⁻¹: h2: ((−1)^k)⁻¹ = (−1)^k via inv_eq_of_mul_eq_one_right : a·b = 1 → a⁻¹ = b: with a := (−1)^k, b := (−1)^k: need (−1)^k·(−1)^k = 1: ← pow_add: (−1)^{k+k}: k+k = 2k: ← two_mul: then (−1)^{2k}: pow_mul: ((−1)²)^k = 1^k = 1: ```lean have h2 : ((-1 : ℂ) ^ k)⁻¹ = (-1 : ℂ) ^ k := by apply inv_eq_of_mul_eq_one_right rw [← pow_add, ← two_mul, pow_mul] rw [show (-1 : ℂ) ^ 2 = 1 by ring] exact one_pow k ``` inv_eq_of_mul_eq_one_right : a * b = 1 → a⁻¹ = b ✓ exists (session-033-ish? `inv_eq_of_mul_eq_one_right` ✓ I'm fairly confident; else `inv_eq_of_mul_eq_one_left`). The a here is (−1)^k (the thing being inverted) and b = (−1)^k: goal a·b = 1 ✓. Then: (−1)^k·(ρ^k)⁻¹ = (−1)^k·(1/ρ)^k: (1/ρ)^k = (ρ^k)⁻¹: `one_div_pow`? or inv_pow: (ρ⁻¹)^k = (ρ^k)⁻¹ ✓ `inv_pow (a) (n)`; 1/ρ = ρ⁻¹: one_div. So congr 1; rw [one_div, ← inv_pow] — goal (−1)^k·(ρ^k)⁻¹ = (−1)^k·(ρ⁻¹)^k?? wait — my e1's RHS is (−1)^k·(1/ρ)^k: after rw [h2] on LHS: (−1)^k·(ρ^k)⁻¹ = (−1)^k·(1/ρ)^k: congr 1 → (ρ^k)⁻¹ = (1/ρ)^k: rw [one_div]: (ρ^k)⁻¹ = (ρ⁻¹)^k: ← inv_pow ✓. Hold on — e1's statement: ((0:ℂ)−ρ)^(−k:ℤ) = (−1)^k·(1/ρ)^k. Let me re-derive: (−ρ)^{−k} = ((−ρ)^k)⁻¹ = ((−1)^k·ρ^k)⁻¹ = ((−1)^k)⁻¹·(ρ^k)⁻¹ = (−1)^k·(ρ^k)⁻¹ = (−1)^k·(1/ρ)^k ✓ (since (1/ρ)^k = 1/ρ^k = (ρ^k)⁻¹ ✓). Hmm — and zpow_neg signature: `zpow_neg (a : α) (n : ℤ) : a ^ (-n) = (a ^ n)⁻¹` ✓ exists. zpow_natCast : `zpow_natCast (a : α) (n : ℕ) : a ^ (n : ℤ) = a ^ n` ✓. hsign: (−1)^{k−1}·(−1)^k = −1: ← pow_add: (−1)^{(k−1)+k}: k−1+k = 2k−1 (omega, k ≥ 2 — hmm Nat: k−1+k with k ≥ 2 ✓ omega): then 2k−1 = 2(k−1)+1 (omega k ≥ 2 ✓): pow_add: (−1)^{2(k−1)}·(−1)^1: h4: (−1)^{2(k−1)} = ((−1)²)^{k−1} = 1: pow_mul : a^{m·n} = (a^m)^n ✓ `pow_mul (a) (m n) : a ^ (m * n) = (a ^ m) ^ n`. 2·(k−1) — pow_mul with m = 2, n = k−1 ✓. one_mul; pow_one ✓. pow_add : a^{m+n} = a^m·a^n ✓. The final capstone assembly: ```lean rw [heval] -- goal: sigmaP k = −(−(k−1)!·sigmaP k)/(k−1)! -- = sigmaP k: field have hfact : ((k - 1)! : ℂ) ≠ 0 := by rw [Ne, Nat.cast_eq_zero] exact Nat.factorial_ne_zero (k - 1) field_simp [hfact] ring ``` goal after heval: sigmaP k = −(−(k−1)!·sigmaP k)/((k−1)!) : field_simp [hfact]; ring ✓ (−(−X)/Y = X/Y = ... : −(−(k−1)!·σ)/(k−1)! = σ·((k−1)!/(k−1)!) = σ ✓ ring after clearing). Hmm wait — the goal after rw [hcong, ..., heval]: sigmaP k = -(iteratedDeriv...)/... where the iteratedDeriv was rewritten to the tsum and then heval replaced the tsum with −(k−1)!·sigmaP k — the rw chain: hcong rewrites iteratedDeriv (k−1) gFun 0 → iteratedDeriv (k−1) (B+seriesFun) 0 ✓; then iteratedDeriv_add etc rewrite; iteratedDeriv_seriesFun_zero rewrites iteratedDeriv (k−1) seriesFun 0 → the tsum ✓; heval is a standalone — rw [heval] rewrites the tsum → −(k−1)!·sigmaP k ✓. Goal: sigmaP k = −(−(k−1)!·sigmaP k)/(k−1)! ✓ field_simp+ring. One concern — the rw [hcong]: hcong : iteratedDeriv (k−1) gFun 0 = iteratedDeriv (k−1) (fun s => B + seriesFun s) 0 — iteratedDeriv_congr_of_eventuallyEq (h : f =ᶠ[𝓝 x] g) (n) : iteratedDeriv n f x = iteratedDeriv n g x ✓ (LiDigamma:568). ✓ And iteratedDeriv_add's function form: fun s => B + seriesFun s — the lemma iteratedDeriv_add (hf : ContDiffAt 𝕜 n f x) (hg : ContDiffAt 𝕜 n g x) : iteratedDeriv n (f + g) x = ...?? or pointwise fun x => f x + g x? From LiDigamma:702 the rw worked on their lambda with pointwise mix (1/(m+1) + −(1/(s+m+1)))?? They had heq-rewritten to a Pi.add form: line 688-693: `(fun s => dpsiTermC s m) = (fun s => 1/...) + fun s => -(1/...)` — note the FIRST is a bare function and `+ fun s => ...` — so it's HAdd of functions with a lambda — mixed. iteratedDeriv_add hcf hcg rewrote iteratedDeriv k ((fun s => 1/...) + fun s => ...) — so the lemma's LHS is iteratedDeriv n (f + g) x with Pi.add? or the pointwise lambda? Their form: (fun s => ...) + fun s => ... — that IS Pi.add (HAdd.hAdd of two functions). So iteratedDeriv_add : iteratedDeriv n (f + g) x = iteratedDeriv n f x + iteratedDeriv n g x with Pi.add ✓. My function: fun s => B + seriesFun s — LAMBDA with pointwise add — NOT syntactically (fun _ => B) + seriesFun. The rw [iteratedDeriv_add hcf hcg] would need the goal's function to match (f + g): MISMATCH. Fix: bridge: have : (fun s => momentB hZC + seriesFun s) = (fun _ : ℂ => momentB hZC) + seriesFun := by funext s; rfl?? — Pi.add_apply: ((f+g) s = f s + g s) rfl ✓ so funext s; rfl works? (fun _ => B) + seriesFun applied at s = B + seriesFun s ✓ rfl. So: ```lean have eadd : (fun s => momentB hZC + seriesFun s) = (fun _ : ℂ => momentB hZC) + seriesFun := by funext s rfl rw [eadd, iteratedDeriv_add hcf hcg, ...] ``` ✓ (the Pi.add_apply gotcha again). Similarly iteratedDeriv_const : iteratedDeriv n (fun _ => c) x = if n = 0 then c else 0 — from LiDigamma:703 `rw [iteratedDeriv_const, if_neg (by omega : k ≠ 0)]` ✓. OK — also `sigmaP_one_eq_neg_gFun_zero` and the k=1 branch: after subst hk1' (k := 1): goal sigmaP 1 = −(iteratedDeriv (1−1) gFun 0)/((1−1)!:ℂ): rw [Nat.sub_self?? 1−1 = 0: `Nat.sub_self 1 : 1 − 1 = 0`? hmm Nat.sub_self : n − n = 0 ✓; but the term is (1 − 1 : ℕ) — reduces to 0 definitionally — `show sigmaP 1 = -(iteratedDeriv 0 gFun 0)/((0)!:ℂ)`?? Nat subtraction 1−1 computes ✓ — simp [iteratedDeriv_zero]: simplest: `simp only [Nat.sub_self?..., iteratedDeriv_zero, Nat.factorial_zero, Nat.cast_one, div_one]`— Nat.sub_self needs the literal n − n form: (1 − 1) — simp only [Nat.sub_self] might not fire on numerals (1 − 1 is OfNat−OfNat — simp would compute via Nat.reduceSub? just use `norm_num`?? risky on the goal shape. Alternative: change k−1 to 0 via `show`: sigmaP 1 = −(iteratedDeriv (1−1) gFun 0)/...: `conv_rhs => rw [show (1 : ℕ) - 1 = 0 from rfl]`?? 1−1 = 0 is rfl ✓ (Nat sub computes). So: `show sigmaP 1 = -(iteratedDeriv 0 gFun 0) / ((0)! : ℂ)` — is the goal defeq? (1−1) ≡ 0 ✓ defeq: `show` with defeq target ✓ should work. Then rw [iteratedDeriv_zero, Nat.factorial_zero, Nat.cast_one, div_one] → sigmaP 1 = −gFun 0 ✓ exact sigmaP_one_eq_neg_gFun_zero hZC. Hmm — (0)! vs Nat.factorial 0 — the goal's form: ((1 - 1)! : ℂ) — after show: ((0)!:ℂ) — Nat.factorial 0 = 1: rw [Nat.factorial_zero]?? Nat.factorial_zero : (0)! = 1 ✓ then Nat.cast_one, div_one ✓. Wait — actually there's subtlety: after `subst hk1'`, k is replaced by 1 everywhere: goal sigmaP 1 = −(iteratedDeriv (1−1) gFun 0)/(((1−1))!:ℂ). `show sigmaP 1 = -(iteratedDeriv 0 gFun 0) / ((0)! : ℂ)`: defeq check: (1−1:ℕ) ≡ 0 ✓, ((1−1)!:ℂ) ≡ ((0)!:ℂ) ✓ — should pass. Alright — write §4–§6 now. It's a lot; let me write carefully. Also need in §4: hρ0/h1ρ helpers — reuse the ones from seriesFun_one (write once as private-ish lemmas? They're used repeatedly: ρ ≠ 0, 1−ρ ≠ 0, ‖ρ‖ > 0, ‖1−ρ‖ > 0). Make small lemmas: ```lean lemma nontrivialZero_ne_zero (ρ : {ρ : ℂ // IsNontrivialZero ρ}) : (ρ : ℂ) ≠ 0 := by intro h0 have h2 := ρ.2.2.1 rw [h0, Complex.zero_re] at h2 exact lt_irrefl 0 h2 lemma one_sub_nontrivialZero_ne_zero (ρ : {ρ : ℂ // IsNontrivialZero ρ}) : (1 : ℂ) - (ρ : ℂ) ≠ 0 := by intro h have h3 : (1 : ℂ) = (ρ : ℂ) := sub_eq_zero.mp h have h4 := ρ.2.2.2 rw [← h3, Complex.one_re] at h4 exact lt_irrefl 1 h4 lemma norm_nontrivialZero_pos (ρ : {ρ : ℂ // IsNontrivialZero ρ}) : (0 : ℝ) < ‖(ρ : ℂ)‖ := norm_pos_iff.mpr (nontrivialZero_ne_zero ρ) lemma norm_one_sub_nontrivialZero_pos (ρ : {ρ : ℂ // IsNontrivialZero ρ}) : (0 : ℝ) < ‖(1 : ℂ) - (ρ : ℂ)‖ := norm_pos_iff.mpr (one_sub_nontrivialZero_ne_zero ρ) ``` ✓ (norm_pos_iff : 0 < ‖x‖ ↔ x ≠ 0 ✓). Let me write the whole §4–§6 block now, appending before `end NguyenRH1`. This is big — I'll write it in two Write/Edit operations (§4, then §5+§6).
Patterns confirmed. Writing §4 (summability budget + k=1 rearrangement) now.
tool: Edit
input
{
  "file_path": "D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\NguyenRH1\\LiMoments.lean",
  "old_string": "end NguyenRH1",
  "new_string": "/-! ## 4. The summability budget and the k = 1 rearrangement -/\n\nlemma nontrivialZero_ne_zero (\u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1}) : (\u03c1 : \u2102) \u2260 0 := by\n  intro h0\n  have h2 := \u03c1.2.2.1\n  rw [h0, Complex.zero_re] at h2\n  exact lt_irrefl 0 h2\n\nlemma one_sub_nontrivialZero_ne_zero (\u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1}) :\n    (1 : \u2102) - (\u03c1 : \u2102) \u2260 0 := by\n  intro h\n  have h3 : (1 : \u2102) = (\u03c1 : \u2102) := sub_eq_zero.mp h\n  have h4 := \u03c1.2.2.2\n  rw [\u2190 h3, Complex.one_re] at h4\n  exact lt_irrefl 1 h4\n\nlemma norm_nontrivialZero_pos (\u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1}) : (0 : \u211d) < \u2016(\u03c1 : \u2102)\u2016 :=\n  norm_pos_iff.mpr (nontrivialZero_ne_zero \u03c1)\n\nlemma norm_one_sub_nontrivialZero_pos (\u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1}) :\n    (0 : \u211d) < \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016 :=\n  norm_pos_iff.mpr (one_sub_nontrivialZero_ne_zero \u03c1)\n\n/-- **Master summability**: \u03a3 mult/\u2016\u03c1\u2016\u00b2 over the zeros (the ii\u2032-2\nfinite-ball + (9/4)-comparison skeleton). -/\nlemma summable_mult_div_norm_sq :\n    Summable (fun \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1} => (zeroMult \u03c1 : \u211d) / \u2016(\u03c1 : \u2102)\u2016 ^ 2) := by\n  have hbase : Summable (fun \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1} =>\n      (9 / 4) * ((zeroMult \u03c1 : \u211d) / (1 + Complex.normSq (gammaOf \u03c1)))) :=\n    (WeilEF.zero_sum_inv_sq zetaSeam).mul_left (9 / 4)\n  set D : {\u03c1 : \u2102 // IsNontrivialZero \u03c1} \u2192 \u211d := fun \u03c1 =>\n    if (2 : \u211d) \u2264 \u2016(\u03c1 : \u2102)\u2016 then\n      (9 / 4) * (zeroMult \u03c1 : \u211d) / (1 + Complex.normSq (gammaOf \u03c1))\n    else (zeroMult \u03c1 : \u211d) / \u2016(\u03c1 : \u2102)\u2016 ^ 2 with hDdef\n  have hfin : {\u03c1 : {\u03c1 // IsNontrivialZero \u03c1} | \u00ac ((2 : \u211d) \u2264 \u2016(\u03c1 : \u2102)\u2016)}.Finite := by\n    have hcomp : IsCompact (Metric.closedBall (0 : \u2102) 2) := isCompact_closedBall _ _\n    have hzeros : (Metric.closedBall (0 : \u2102) 2) \u2229 {\u03c1 : \u2102 | IsNontrivialZero \u03c1}\n        \u2286 (Metric.closedBall (0 : \u2102) 2) \u2229 riemannZetaZeros := by\n      intro z hz\n      exact \u27e8hz.1, hz.2.1\u27e9\n    have hfin2 := (hcomp.inter_riemannZetaZeros_finite).subset hzeros\n    have himg : (Subtype.val '' {\u03c1 : {\u03c1 // IsNontrivialZero \u03c1} |\n        \u00ac ((2 : \u211d) \u2264 \u2016(\u03c1 : \u2102)\u2016)}).Finite := by\n      apply hfin2.subset\n      rintro z \u27e8\u03c1, h\u03c1, rfl\u27e9\n      refine \u27e8?_, \u03c1.2\u27e9\n      simp only [Metric.mem_closedBall, dist_zero_right]\n      exact le_of_lt (lt_of_not_ge h\u03c1)\n    exact Set.Finite.of_finite_image himg (Subtype.val_injective.injOn)\n  have hE : Summable (fun \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1} =>\n      D \u03c1 - (9 / 4) * ((zeroMult \u03c1 : \u211d) / (1 + Complex.normSq (gammaOf \u03c1)))) := by\n    apply summable_of_hasFiniteSupport\n    apply hfin.subset\n    intro \u03c1 h\u03c1\n    simp only [Function.mem_support, ne_eq] at h\u03c1\n    by_contra hball\n    apply h\u03c1\n    have hball' : (2 : \u211d) \u2264 \u2016(\u03c1 : \u2102)\u2016 := not_not.mp hball\n    simp only [D, if_pos hball']\n    ring\n  have hD : Summable D := by\n    have hsum := hbase.add hE\n    have heq : (fun \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1} =>\n        (9 / 4) * ((zeroMult \u03c1 : \u211d) / (1 + Complex.normSq (gammaOf \u03c1))) +\n          (D \u03c1 - (9 / 4) * ((zeroMult \u03c1 : \u211d) / (1 + Complex.normSq (gammaOf \u03c1))))) = D := by\n      funext \u03c1\n      ring\n    rw [heq] at hsum\n    exact hsum\n  refine Summable.of_norm_bounded hD (fun \u03c1 => ?_)\n  by_cases h\u03c1 : (2 : \u211d) \u2264 \u2016(\u03c1 : \u2102)\u2016\n  \u00b7 simp only [D, if_pos h\u03c1]\n    have hz := \u03c1.2\n    have h\u03c1pos : (0 : \u211d) < \u2016(\u03c1 : \u2102)\u2016 := lt_of_lt_of_le (by norm_num) h\u03c1\n    have hgpos : (0 : \u211d) < 1 + Complex.normSq (gammaOf (\u03c1 : \u2102)) := by\n      have hnn := Complex.normSq_nonneg (gammaOf (\u03c1 : \u2102))\n      linarith\n    have hcomp : 1 + Complex.normSq (gammaOf (\u03c1 : \u2102)) \u2264 9 / 4 * \u2016(\u03c1 : \u2102)\u2016 ^ 2 :=\n      normSq_gammaOf_le_mul_norm_sq (n := 1) le_rfl hz.2.1.le hz.2.2.le (by simpa using h\u03c1)\n    have key : (zeroMult \u03c1 : \u211d) / \u2016(\u03c1 : \u2102)\u2016 ^ 2 \u2264\n        (9 / 4) * (zeroMult \u03c1 : \u211d) / (1 + Complex.normSq (gammaOf \u03c1)) := by\n      rw [div_le_div_iff\u2080 (pow_pos h\u03c1pos 2) hgpos]\n      calc (zeroMult \u03c1 : \u211d) * (1 + Complex.normSq (gammaOf \u03c1))\n          \u2264 (zeroMult \u03c1 : \u211d) * (9 / 4 * \u2016(\u03c1 : \u2102)\u2016 ^ 2) :=\n            mul_le_mul_of_nonneg_left hcomp (Nat.cast_nonneg _)\n        _ = (9 / 4 * (zeroMult \u03c1 : \u211d)) * \u2016(\u03c1 : \u2102)\u2016 ^ 2 := by ring\n    rw [Real.norm_of_nonneg (by positivity)]\n    exact key\n  \u00b7 simp only [D, if_neg h\u03c1]\n    rw [Real.norm_of_nonneg (by positivity)]\n\n/-- The avoiding-ball lower bound: every zero has \u03b4 \u2264 \u2016\u03c1\u2016. -/\nlemma exists_norm_lower_bound :\n    \u2203 \u03b4 : \u211d, 0 < \u03b4 \u2227 \u2200 \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1}, \u03b4 \u2264 \u2016(\u03c1 : \u2102)\u2016 := by\n  obtain \u27e8\u03b4, h\u03b4, hball\u27e9 := exists_ball_avoid_nontrivialZeros 0 not_isNontrivialZero_zero\n  refine \u27e8\u03b4, h\u03b4, fun \u03c1 => ?_\u27e9\n  by_contra h\n  exact hball \u03c1 (by rw [Metric.mem_ball, dist_zero_right]; exact lt_of_not_ge h)\n\n/-- \u03a3 mult\u00b7\u03c1^{\u2212k} is absolutely summable for k \u2265 2. -/\nlemma summable_mult_inv_pow {k : \u2115} (hk : 2 \u2264 k) :\n    Summable (fun \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1} => (zeroMult \u03c1 : \u2102) * (1 / (\u03c1 : \u2102)) ^ k) := by\n  obtain \u27e8m, rfl\u27e9 := Nat.exists_eq_add_of_le hk\n  obtain \u27e8\u03b4, h\u03b4, h\u03b4le\u27e9 := exists_norm_lower_bound\n  apply Summable.of_norm_bounded (summable_mult_div_norm_sq.mul_left ((1 / \u03b4) ^ m))\n  intro \u03c1\n  have h\u03c1\u03b4 := h\u03b4le \u03c1\n  have h\u03c1pos : (0 : \u211d) < \u2016(\u03c1 : \u2102)\u2016 := lt_of_lt_of_le h\u03b4 h\u03c1\u03b4\n  rw [norm_mul, norm_pow, norm_div, norm_one, RCLike.norm_natCast, div_pow, one_pow]\n  calc (zeroMult \u03c1 : \u211d) * (1 / \u2016(\u03c1 : \u2102)\u2016 ^ (2 + m))\n      = (zeroMult \u03c1 : \u211d) * ((1 / \u2016(\u03c1 : \u2102)\u2016 ^ 2) * (1 / \u2016(\u03c1 : \u2102)\u2016 ^ m)) := by\n        rw [pow_add, \u2190 one_div_mul_one_div]\n    _ \u2264 (zeroMult \u03c1 : \u211d) * ((1 / \u2016(\u03c1 : \u2102)\u2016 ^ 2) * (1 / \u03b4 ^ m)) := by\n        apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _)\n        apply mul_le_mul_of_nonneg_left _ (by positivity : (0 : \u211d) \u2264 1 / \u2016(\u03c1 : \u2102)\u2016 ^ 2)\n        exact one_div_le_one_div_of_le (pow_pos h\u03b4 m) (pow_le_pow_left\u2080 h\u03b4.le h\u03c1\u03b4 m)\n    _ = (1 / \u03b4) ^ m * ((zeroMult \u03c1 : \u211d) / \u2016(\u03c1 : \u2102)\u2016 ^ 2) := by\n        rw [div_pow, one_pow]\n        ring\n\n/-- The conjugation reindex: \u03a3 mult\u00b7\u03c1\u0304^{\u2212k} = \u03a3 mult\u00b7\u03c1^{\u2212k}. -/\nlemma tsum_mult_inv_pow_conj (k : \u2115) :\n    (\u2211' \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1}, (zeroMult \u03c1 : \u2102) * (1 / ((starRingEnd \u2102) (\u03c1 : \u2102))) ^ k) =\n      \u2211' \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1}, (zeroMult \u03c1 : \u2102) * (1 / (\u03c1 : \u2102)) ^ k := by\n  have h := Equiv.tsum_eq conjZeroEquiv\n    (fun \u03c3 : {\u03c3 : \u2102 // IsNontrivialZero \u03c3} => (zeroMult \u03c3 : \u2102) * (1 / (\u03c3 : \u2102)) ^ k)\n  rw [\u2190 h]\n  apply tsum_congr\n  intro \u03c1\n  have e1 : ((conjZeroEquiv \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1}) : \u2102) = (starRingEnd \u2102) (\u03c1 : \u2102) :=\n    rfl\n  rw [e1, zeroMult_conj \u03c1.2]\n\n/-- The conj-summability transfer. -/\nlemma summable_mult_inv_pow_conj {k : \u2115} (hk : 2 \u2264 k) :\n    Summable (fun \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1} =>\n      (zeroMult \u03c1 : \u2102) * (1 / ((starRingEnd \u2102) (\u03c1 : \u2102))) ^ k) := by\n  have e : (fun \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1} =>\n      (zeroMult \u03c1 : \u2102) * (1 / ((starRingEnd \u2102) (\u03c1 : \u2102))) ^ k) =\n      fun \u03c1 => (fun \u03c3 : {\u03c3 : \u2102 // IsNontrivialZero \u03c3} => (zeroMult \u03c3 : \u2102) * (1 / (\u03c3 : \u2102)) ^ k)\n        (conjZeroEquiv \u03c1) := by\n    funext \u03c1\n    have e1 : ((conjZeroEquiv \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1}) : \u2102) = (starRingEnd \u2102) (\u03c1 : \u2102) :=\n      rfl\n    rw [e1, zeroMult_conj \u03c1.2]\n  rw [e]\n  exact (Equiv.summable_iff conjZeroEquiv _).mpr (summable_mult_inv_pow hk)\n\n/-- **The unpaired form** (k \u2265 2): the paired sum collapses to the\nunpaired sum by conj-invariance: sigmaP k = \u00bd(S + S) = S. -/\nlemma sigmaP_eq_unpaired {k : \u2115} (hk : 2 \u2264 k) :\n    sigmaP k = \u2211' \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1}, (zeroMult \u03c1 : \u2102) * (1 / (\u03c1 : \u2102)) ^ k := by\n  have hs1 := summable_mult_inv_pow hk\n  have hs2 := summable_mult_inv_pow_conj hk\n  have step : \u2211' \u03c1, sigmaSlice k \u03c1 = \u2211' \u03c1, (1 / 2 : \u2102) *\n      ((zeroMult \u03c1 : \u2102) * (1 / (\u03c1 : \u2102)) ^ k +\n        (zeroMult \u03c1 : \u2102) * (1 / ((starRingEnd \u2102) (\u03c1 : \u2102))) ^ k) := by\n    apply tsum_congr\n    intro \u03c1\n    rw [sigmaSlice]\n    ring\n  rw [sigmaP, step, tsum_mul_left, tsum_add hs1 hs2, tsum_mult_inv_pow_conj k]\n  ring\n\n/-- The reflected master summability: \u03a3 mult/\u20161\u2212\u03c1\u2016\u00b2 (reindex transfer). -/\nlemma summable_mult_div_norm_sq_one_sub :\n    Summable (fun \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1} =>\n      (zeroMult \u03c1 : \u211d) / \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016 ^ 2) := by\n  have e : (fun \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1} =>\n      (zeroMult \u03c1 : \u211d) / \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016 ^ 2) =\n      fun \u03c1 => (fun \u03c3 : {\u03c3 : \u2102 // IsNontrivialZero \u03c3} => (zeroMult \u03c3 : \u211d) / \u2016(\u03c3 : \u2102)\u2016 ^ 2)\n        (oneSubZeroEquiv \u03c1) := by\n    funext \u03c1\n    have e1 : ((oneSubZeroEquiv \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1}) : \u2102) = 1 - (\u03c1 : \u2102) := rfl\n    rw [e1, zeroMult_one_sub \u03c1.2.2.1 \u03c1.2.2.2]\n  rw [e]\n  exact (Equiv.summable_iff oneSubZeroEquiv _).mpr summable_mult_div_norm_sq\n\n/-- The AM-GM bound: mult/(\u2016\u03c1\u2016\u20161\u2212\u03c1\u2016) \u2264 \u00bd(mult/\u2016\u03c1\u2016\u00b2 + mult/\u20161\u2212\u03c1\u2016\u00b2). -/\nlemma mult_div_norm_mul_norm_le (\u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1}) :\n    (zeroMult \u03c1 : \u211d) / (\u2016(\u03c1 : \u2102)\u2016 * \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016) \u2264\n      (1 / 2) * ((zeroMult \u03c1 : \u211d) / \u2016(\u03c1 : \u2102)\u2016 ^ 2 +\n        (zeroMult \u03c1 : \u211d) / \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016 ^ 2) := by\n  have h\u03c10 := norm_nontrivialZero_pos \u03c1\n  have h1\u03c10 := norm_one_sub_nontrivialZero_pos \u03c1\n  have key : 2 / (\u2016(\u03c1 : \u2102)\u2016 * \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016) \u2264\n      1 / \u2016(\u03c1 : \u2102)\u2016 ^ 2 + 1 / \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016 ^ 2 := by\n    have h1 : (0 : \u211d) \u2264 (1 / \u2016(\u03c1 : \u2102)\u2016 - 1 / \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016) ^ 2 := sq_nonneg _\n    have hexp : (1 / \u2016(\u03c1 : \u2102)\u2016 - 1 / \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016) ^ 2 =\n        1 / \u2016(\u03c1 : \u2102)\u2016 ^ 2 - 2 / (\u2016(\u03c1 : \u2102)\u2016 * \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016) +\n          1 / \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016 ^ 2 := by\n      rw [sub_sq, div_pow, div_pow, one_pow, one_pow, one_div_mul_one_div, mul_one_div]\n    rw [hexp] at h1\n    linarith\n  calc (zeroMult \u03c1 : \u211d) / (\u2016(\u03c1 : \u2102)\u2016 * \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016)\n      = (zeroMult \u03c1 : \u211d) / 2 * (2 / (\u2016(\u03c1 : \u2102)\u2016 * \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016)) := by ring\n    _ \u2264 (zeroMult \u03c1 : \u211d) / 2 * (1 / \u2016(\u03c1 : \u2102)\u2016 ^ 2 + 1 / \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016 ^ 2) :=\n        mul_le_mul_of_nonneg_left key (div_nonneg (Nat.cast_nonneg _) (by norm_num))\n    _ = (1 / 2) * ((zeroMult \u03c1 : \u211d) / \u2016(\u03c1 : \u2102)\u2016 ^ 2 +\n        (zeroMult \u03c1 : \u211d) / \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016 ^ 2) := by ring\n\n/-- The mixed family \u03a3 mult/(\u03c1(1\u2212\u03c1)) is absolutely summable. -/\nlemma summable_mult_one_div_mul_one_sub :\n    Summable (fun \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1} =>\n      (zeroMult \u03c1 : \u2102) * (1 / ((\u03c1 : \u2102) * (1 - (\u03c1 : \u2102))))) := by\n  have hsum := summable_mult_div_norm_sq.add summable_mult_div_norm_sq_one_sub\n  apply Summable.of_norm_bounded (hsum.mul_left (1 / 2))\n  intro \u03c1\n  rw [norm_mul, norm_div, norm_one, RCLike.norm_natCast, norm_mul]\n  exact mult_div_norm_mul_norm_le \u03c1\n\n/-- The V-family is absolutely summable (1/\u03c1\u0304 \u2212 1/(1\u2212\u03c1) = O(\u2016\u03c1\u2016\u207b\u00b9\u20161\u2212\u03c1\u2016\u207b\u00b9)). -/\nlemma summable_mult_vTerm :\n    Summable (fun \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1} =>\n      (zeroMult \u03c1 : \u2102) * (1 / ((starRingEnd \u2102) (\u03c1 : \u2102)) - 1 / (1 - (\u03c1 : \u2102)))) := by\n  have hsum := summable_mult_div_norm_sq.add summable_mult_div_norm_sq_one_sub\n  apply Summable.of_norm_bounded (hsum.mul_left (1 / 2))\n  intro \u03c1\n  have h\u03c10 := norm_nontrivialZero_pos \u03c1\n  have h1\u03c10 := norm_one_sub_nontrivialZero_pos \u03c1\n  have hconj : \u2016((starRingEnd \u2102) (\u03c1 : \u2102))\u2016 = \u2016(\u03c1 : \u2102)\u2016 := by\n    rw [starRingEnd_apply, Complex.norm_conj]\n  have hid : 1 / ((starRingEnd \u2102) (\u03c1 : \u2102)) - 1 / (1 - (\u03c1 : \u2102)) =\n      ((1 : \u2102) - (\u03c1 : \u2102) - (starRingEnd \u2102) (\u03c1 : \u2102)) /\n        (((starRingEnd \u2102) (\u03c1 : \u2102)) * (1 - (\u03c1 : \u2102))) := by\n    field_simp [ne_of_gt h\u03c10, ne_of_gt h1\u03c10]\n    ring\n  have hnum : \u2016(1 : \u2102) - (\u03c1 : \u2102) - (starRingEnd \u2102) (\u03c1 : \u2102)\u2016 \u2264 1 := by\n    have e : (1 : \u2102) - (\u03c1 : \u2102) - (starRingEnd \u2102) (\u03c1 : \u2102) = ((1 - 2 * (\u03c1 : \u2102).re : \u211d) : \u2102) := by\n      rw [sub_sub, Complex.add_conj]\n      push_cast\n      ring\n    rw [e, Complex.norm_real, Real.norm_eq_abs, abs_le]\n    have hre0 := \u03c1.2.2.1\n    have hre1 := \u03c1.2.2.2\n    constructor <;> linarith\n  rw [norm_mul, hid, norm_div, norm_mul, hconj, RCLike.norm_natCast]\n  calc (zeroMult \u03c1 : \u211d) * (\u2016(1 : \u2102) - (\u03c1 : \u2102) - (starRingEnd \u2102) (\u03c1 : \u2102)\u2016 /\n        (\u2016(\u03c1 : \u2102)\u2016 * \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016))\n      \u2264 (zeroMult \u03c1 : \u211d) * (1 / (\u2016(\u03c1 : \u2102)\u2016 * \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016)) := by\n        apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _)\n        exact div_le_div_of_nonneg_right hnum\n          (mul_pos h\u03c10 h1\u03c10) |>.trans_eq (one_div _) |>.trans_eq' rfl\n    _ = (zeroMult \u03c1 : \u211d) / (\u2016(\u03c1 : \u2102)\u2016 * \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016) := by ring\n    _ \u2264 (1 / 2) * ((zeroMult \u03c1 : \u211d) / \u2016(\u03c1 : \u2102)\u2016 ^ 2 +\n          (zeroMult \u03c1 : \u211d) / \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016 ^ 2) := mult_div_norm_mul_norm_le \u03c1\n\n/-- **The V-sum vanishes**: the conj reindex gives V = W and the reflect\nreindex gives W = \u2212V. -/\nlemma vTerm_tsum_eq_zero :\n    (\u2211' \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1},\n      (zeroMult \u03c1 : \u2102) * (1 / ((starRingEnd \u2102) (\u03c1 : \u2102)) - 1 / (1 - (\u03c1 : \u2102)))) = 0 := by\n  set V := \u2211' \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1},\n      (zeroMult \u03c1 : \u2102) * (1 / ((starRingEnd \u2102) (\u03c1 : \u2102)) - 1 / (1 - (\u03c1 : \u2102))) with hV\n  have h1 : V = \u2211' \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1},\n      (zeroMult \u03c1 : \u2102) * (1 / (\u03c1 : \u2102) - 1 / (1 - (starRingEnd \u2102) (\u03c1 : \u2102))) := by\n    have h := Equiv.tsum_eq conjZeroEquiv (fun \u03c3 : {\u03c3 : \u2102 // IsNontrivialZero \u03c3} =>\n      (zeroMult \u03c3 : \u2102) * (1 / ((starRingEnd \u2102) (\u03c3 : \u2102)) - 1 / (1 - (\u03c3 : \u2102))))\n    rw [hV, \u2190 h]\n    apply tsum_congr\n    intro \u03c1\n    have e1 : ((conjZeroEquiv \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1}) : \u2102) = (starRingEnd \u2102) (\u03c1 : \u2102) :=\n      rfl\n    rw [e1, zeroMult_conj \u03c1.2]\n    congr 1\n    simp [starRingEnd_apply]\n  have h2 : (\u2211' \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1},\n      (zeroMult \u03c1 : \u2102) * (1 / (\u03c1 : \u2102) - 1 / (1 - (starRingEnd \u2102) (\u03c1 : \u2102)))) = -V := by\n    have h := Equiv.tsum_eq oneSubZeroEquiv (fun \u03c3 : {\u03c3 : \u2102 // IsNontrivialZero \u03c3} =>\n      (zeroMult \u03c3 : \u2102) * (1 / (\u03c3 : \u2102) - 1 / (1 - (starRingEnd \u2102) (\u03c3 : \u2102))))\n    rw [\u2190 h]\n    rw [hV, \u2190 tsum_neg]\n    apply tsum_congr\n    intro \u03c1\n    have e1 : ((oneSubZeroEquiv \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1}) : \u2102) = 1 - (\u03c1 : \u2102) := rfl\n    rw [e1, zeroMult_one_sub \u03c1.2.2.1 \u03c1.2.2.2]\n    have e2 : (1 : \u2102) - (starRingEnd \u2102) (1 - (\u03c1 : \u2102)) = (starRingEnd \u2102) (\u03c1 : \u2102) := by\n      rw [map_sub, map_one, sub_sub_cancel]\n    rw [e2]\n    ring\n  have h3 : V = -V := h1.trans h2\n  exact eq_zero_of_neg_eq h3.symm\n\n/-- The first family (1/\u03c1 + 1/\u03c1\u0304) is summable (the sigmaSlice 1 form). -/\nlemma summable_mult_fst :\n    Summable (fun \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1} =>\n      (zeroMult \u03c1 : \u2102) * (1 / (\u03c1 : \u2102) + 1 / ((starRingEnd \u2102) (\u03c1 : \u2102)))) := by\n  apply (sigmaSlice_summable 1 le_rfl).congr\n  intro \u03c1\n  rw [sigmaSlice, pow_one, pow_one]\n  ring\n\n/-- The second family (1/\u03c1 + 1/(1\u2212\u03c1)) is summable (the mixed form). -/\nlemma summable_mult_snd :\n    Summable (fun \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1} =>\n      (zeroMult \u03c1 : \u2102) * (1 / (\u03c1 : \u2102) + 1 / (1 - (\u03c1 : \u2102)))) := by\n  apply summable_mult_one_div_mul_one_sub.congr\n  intro \u03c1\n  have h\u03c10 := nontrivialZero_ne_zero \u03c1\n  have h1\u03c1 := one_sub_nontrivialZero_ne_zero \u03c1\n  congr 1\n  field_simp [h\u03c10, h1\u03c1]\n  ring\n\n/-- **Twice \u03c3\u2081 is the mixed series**: 2\u00b7sigmaP 1 = \u03a3 mult/(\u03c1(1\u2212\u03c1)).\nThe two pairings differ by V = 0. -/\nlemma two_mul_sigmaP_one :\n    (2 : \u2102) * sigmaP 1 = \u2211' \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1},\n      (zeroMult \u03c1 : \u2102) * (1 / ((\u03c1 : \u2102) * (1 - (\u03c1 : \u2102)))) := by\n  have h1 : (2 : \u2102) * sigmaP 1 = \u2211' \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1},\n      (zeroMult \u03c1 : \u2102) * (1 / (\u03c1 : \u2102) + 1 / ((starRingEnd \u2102) (\u03c1 : \u2102))) := by\n    rw [sigmaP, \u2190 tsum_mul_left]\n    apply tsum_congr\n    intro \u03c1\n    rw [sigmaSlice, pow_one, pow_one]\n    ring\n  have h2 : (\u2211' \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1},\n      (zeroMult \u03c1 : \u2102) * (1 / ((\u03c1 : \u2102) * (1 - (\u03c1 : \u2102))))) =\n      \u2211' \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1},\n        (zeroMult \u03c1 : \u2102) * (1 / (\u03c1 : \u2102) + 1 / (1 - (\u03c1 : \u2102))) := by\n    apply tsum_congr\n    intro \u03c1\n    have h\u03c10 := nontrivialZero_ne_zero \u03c1\n    have h1\u03c1 := one_sub_nontrivialZero_ne_zero \u03c1\n    congr 1\n    field_simp [h\u03c10, h1\u03c1]\n    ring\n  have h3 : (\u2211' \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1},\n      (zeroMult \u03c1 : \u2102) * (1 / (\u03c1 : \u2102) + 1 / ((starRingEnd \u2102) (\u03c1 : \u2102)))) -\n        (\u2211' \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1},\n          (zeroMult \u03c1 : \u2102) * (1 / (\u03c1 : \u2102) + 1 / (1 - (\u03c1 : \u2102)))) =\n      \u2211' \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1},\n        (zeroMult \u03c1 : \u2102) * (1 / ((starRingEnd \u2102) (\u03c1 : \u2102)) - 1 / (1 - (\u03c1 : \u2102))) := by\n    rw [\u2190 tsum_sub summable_mult_fst summable_mult_snd]\n    apply tsum_congr\n    intro \u03c1\n    ring\n  have hFst : (\u2211' \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1},\n      (zeroMult \u03c1 : \u2102) * (1 / (\u03c1 : \u2102) + 1 / ((starRingEnd \u2102) (\u03c1 : \u2102)))) =\n      \u2211' \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1},\n        (zeroMult \u03c1 : \u2102) * (1 / (\u03c1 : \u2102) + 1 / (1 - (\u03c1 : \u2102))) :=\n    sub_eq_zero.mp (by rw [h3]; exact vTerm_tsum_eq_zero)\n  rw [h1, hFst, \u2190 h2]\n\n/-- **(M) at k = 1**: \u03c3\u2081 = \u2212gFun(0). Via 2\u03c3\u2081 = seriesFun(1) =\ngFun(1) \u2212 B = \u22122\u00b7gFun(0). -/\nlemma sigmaP_one_eq_neg_gFun_zero (hZC : ZeroCountProp) : sigmaP 1 = -gFun 0 := by\n  have h2 := two_mul_sigmaP_one\n  rw [\u2190 seriesFun_one] at h2\n  have hg1 := gFun_one hZC\n  have hg0 := gFun_zero hZC\n  have hfe := gFun_one_eq_neg\n  linear_combination (h2 - hg1 + hg0 + hfe) / 2\n\nend NguyenRH1"
}
#1862 assistant 2026-08-24 23:55:18.277 UTC · 21224→1477 tok open ⤢
thinking (2381 chars)
Wait — in summable_mult_vTerm I wrote a strange calc step: `div_le_div_of_nonneg_right hnum (mul_pos hρ0 h1ρ0) |>.trans_eq (one_div _) |>.trans_eq' rfl` — that's garbled (trans_eq' probably doesn't exist, and div_le_div_of_nonneg_right may not be the right lemma). Let me fix that calc step: goal there: mult·(‖num‖/(‖ρ‖‖1−ρ‖)) ≤ mult·(1/(‖ρ‖‖1−ρ‖)): ```lean apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _) exact div_le_div_of_le_left?? ``` For ‖num‖/D ≤ 1/D with D > 0 and ‖num‖ ≤ 1: div_le_div_of_nonneg_right? The right lemma: `div_le_div_right (hD : 0 < D) : a / D ≤ b / D ↔ a ≤ b`? or `div_le_div_of_le_left`? Use: div_le_div_of_nonneg_right?? hmm — simplest: rw [div_le_iff₀ (mul_pos hρ0 h1ρ0)]: goal ‖num‖ ≤ 1·D?? then: ‖num‖ ≤ 1 ≤ D?? NO — D = ‖ρ‖‖1−ρ‖ could be small. WRONG DIRECTION? ‖num‖/D ≤ 1/D ⟺ ‖num‖ ≤ 1 (D > 0) ✓ right direction: `div_le_div_right (hD : 0 < D) : a / D ≤ b / D ↔ a ≤ b` — session-032 banked: "div_le_div_of_nonneg_right exists / div_le_div_right does NOT"! So: div_le_div_of_nonneg_right — signature? From the banked note it EXISTS: `div_le_div_of_nonneg_right : a ≤ b → 0 ≤ c → a / c ≤ b / c`? presumably. So: ```lean apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _) exact div_le_div_of_nonneg_right hnum (mul_pos hρ0 h1ρ0).le ``` Hmm — signature guess: (h : a ≤ b) (hc : 0 ≤ c) : a / c ≤ b / c. If arg order differs, fix at build. Let me simplify that whole step: ```lean calc (zeroMult ρ : ℝ) * (‖(1 : ℂ) - (ρ : ℂ) - (starRingEnd ℂ) (ρ : ℂ)‖ / (‖(ρ : ℂ)‖ * ‖(1 : ℂ) - (ρ : ℂ)‖)) ≤ (zeroMult ρ : ℝ) * (1 / (‖(ρ : ℂ)‖ * ‖(1 : ℂ) - (ρ : ℂ)‖)) := mul_le_mul_of_nonneg_left (div_le_div_of_nonneg_right hnum (mul_pos hρ0 h1ρ0).le) (Nat.cast_nonneg _) _ = ... ``` Fix it via edit. Also check the `hid` field_simp;ring — gotcha risk (field_simp might close → ring errors "no goals"). I'll see the build errors. Also in `two_mul_sigmaP_one`'s h3: `rw [← tsum_sub summable_mult_fst summable_mult_snd]` — tsum_sub signature: tsum_sub (hf : Summable f) (hg : Summable g) : ∑' (f − g) = ∑' f − ∑' g ✓. ← direction: ∑' f − ∑' g → ∑' (f − g) — pattern in goal: (tsum fstFam) − (tsum sndFam): ← tsum_sub rewrites to ∑' ρ, (fstFam ρ − sndFam ρ) ✓ then tsum_congr per-term: mult·(1/ρ + 1/conjρ) − mult·(1/ρ + 1/(1−ρ)) = mult·(1/conjρ − 1/(1−ρ)): ring ✓. Fix the vTerm calc step.
Fixing the garbled calc step in `summable_mult_vTerm` before building.
tool: Edit
input
{
  "file_path": "D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\NguyenRH1\\LiMoments.lean",
  "old_string": "  calc (zeroMult \u03c1 : \u211d) * (\u2016(1 : \u2102) - (\u03c1 : \u2102) - (starRingEnd \u2102) (\u03c1 : \u2102)\u2016 /\n        (\u2016(\u03c1 : \u2102)\u2016 * \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016))\n      \u2264 (zeroMult \u03c1 : \u211d) * (1 / (\u2016(\u03c1 : \u2102)\u2016 * \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016)) := by\n        apply mul_le_mul_of_nonneg_left _ (Nat.cast_nonneg _)\n        exact div_le_div_of_nonneg_right hnum\n          (mul_pos h\u03c10 h1\u03c10) |>.trans_eq (one_div _) |>.trans_eq' rfl\n    _ = (zeroMult \u03c1 : \u211d) / (\u2016(\u03c1 : \u2102)\u2016 * \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016) := by ring\n    _ \u2264 (1 / 2) * ((zeroMult \u03c1 : \u211d) / \u2016(\u03c1 : \u2102)\u2016 ^ 2 +\n          (zeroMult \u03c1 : \u211d) / \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016 ^ 2) := mult_div_norm_mul_norm_le \u03c1",
  "new_string": "  calc (zeroMult \u03c1 : \u211d) * (\u2016(1 : \u2102) - (\u03c1 : \u2102) - (starRingEnd \u2102) (\u03c1 : \u2102)\u2016 /\n        (\u2016(\u03c1 : \u2102)\u2016 * \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016))\n      \u2264 (zeroMult \u03c1 : \u211d) * (1 / (\u2016(\u03c1 : \u2102)\u2016 * \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016)) :=\n        mul_le_mul_of_nonneg_left (div_le_div_of_nonneg_right hnum (mul_pos h\u03c10 h1\u03c10).le)\n          (Nat.cast_nonneg _)\n    _ = (zeroMult \u03c1 : \u211d) / (\u2016(\u03c1 : \u2102)\u2016 * \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016) := by ring\n    _ \u2264 (1 / 2) * ((zeroMult \u03c1 : \u211d) / \u2016(\u03c1 : \u2102)\u2016 ^ 2 +\n          (zeroMult \u03c1 : \u211d) / \u2016(1 : \u2102) - (\u03c1 : \u2102)\u2016 ^ 2) := mult_div_norm_mul_norm_le \u03c1"
}
#1863 assistant 2026-08-25 00:00:34.374 UTC · 615→425 tok open ⤢
thinking (977 chars)
My greps keep returning nothing — something's off with the search. Ring.lean:351 uses `← tsum_neg` in simp_rw — so tsum_neg exists SOMEWHERE in scope. Let me grep the whole Mathlib directory for "tsum_neg" as a declaration differently — maybe it's `theorem tsum_neg` in Mathlib/Topology/Algebra/InfiniteSum/Group.lean but my grep of Group.lean found nothing... Actually wait — my earlier grep `grep -n "tsum_add\|tsum_sub\|tsum_neg" .../Group.lean` returned NOTHING but also no error. Weird. Maybe the file doesn't exist at that path? `ls` earlier showed Group.lean exists. Let me grep Group.lean for "neg" loosely. Actually — maybe these are in `Mathlib/Topology/Algebra/InfiniteSum/Basic.lean`? Let me grep for "tsum_neg" in the entire Mathlib tree without path restrictions (the earlier tree-wide greps might have failed silently due to path issues — I was cd'd into mathlib and grepped Mathlib/ — should work...). Let me try ripgrep-style via the Grep tool instead of bash.
Shell greps are misbehaving — switching to the Grep tool.
tool: Grep ok
input
{
  "pattern": "theorem tsum_neg|theorem tsum_zero|theorem Summable\\.tsum_add|theorem tsum_add |protected theorem tsum_add",
  "path": "D:\\Python\\Quantum\\zeta-23-lean\\.lake\\packages\\mathlib\\Mathlib",
  "output_mode": "content",
  "-n": true,
  "head_limit": 15
}
result 2026-08-25 00:00:34Z → 2026-08-25 00:00:34Z
mode='content' num_files=0 filenames=[] content="Mathlib\\Topology\\Algebra\\InfiniteSum\\ENNReal.lean:107:protected theorem tsum_add : ∑' a, (f a + g a) = ∑' a, f a + ∑' a, g a :=" num_lines=1 num_matches=None applied_limit=None applied_offset=None
#1864 assistant 2026-08-25 00:01:43.146 UTC · 261→463 tok open ⤢
thinking (230 chars)
Not there either. Where is `Summable.tsum_add` declared?! Let me just ask Lean: write a tiny probe file with `#check @Summable.tsum_add` and `#check @tsum_neg` etc. That's definitive. Quick foreground lean run on the Scratch file.
Let me just ask Lean directly with a probe file.
tool: Write
input
{
  "file_path": "D:\\Python\\Quantum\\research\\lean\\NguyenRH1\\Scratch.lean",
  "content": "import Mathlib\n\n#check @Summable.tsum_add\n#check @Summable.tsum_sub\n#check @tsum_neg\n#check @tsum_zero\n#check @tsum_congr\n#check @tsum_mul_left\n#check @Equiv.tsum_eq\n#check @Equiv.summable_iff\n#check @div_le_div_of_nonneg_right\n#check @Complex.norm_conj\n#check @starRingEnd_apply\n#check @norm_star\n#check @one_div_mul_one_div\n#check @mul_one_div\n#check @inv_le_inv\u2080\n#check @one_div_le_one_div_of_le\n#check @eventually_nhdsWithin_iff\n#check @iteratedDeriv_neg\n#check @Filter.EventuallyEq.of_eq\n#check @eq_zero_of_neg_eq\n#check @summable_of_hasFiniteSupport\n#check @inv_eq_of_mul_eq_one_right\n#check @Complex.add_conj\n#check @AnalyticAt.contDiffAt\n#check @contDiff_const\n#check @iteratedDerivWithin_tsum\n#check @SummableLocallyUniformlyOn_of_locally_bounded\n#check @Complex.Gamma\u211d_eq_zero_iff\n#check @zpow_neg\n#check @zpow_natCast\n#check @neg_pow\n#check @mul_inv\n#check @pow_mul\n#check @sub_sq\n#check @div_pow\n#check @iteratedDeriv_const\n#check @iteratedDerivWithin_neg\n#check @inv_pow\n"
}
#1865 user 2026-08-25 00:11:54.549 UTC open ⤢
[Request interrupted by user]
#1866 user 2026-08-25 00:12:34.100 UTC open ⤢
Sorry, but I need to log off. Please save the current status so we can continue where we left off at a later time.
#1867 assistant 2026-08-25 00:13:44.575 UTC · 197→2675 tok open ⤢
thinking (8452 chars)
The user needs to log off. Per the session END protocol (§8.4 — before any shutdown, no exceptions): 1. Write journal/session-NNN.md (work, decisions, outcomes) — session 037. 2. File every result/dead end/derivation in its own file; update index.md files; register in research.db. 3. Update NGUYEN.md checklist (§5), Graveyard (§6), Result Ledger (§7). 4. Update STATE.md LAST with an explicit "NEXT ACTION:" line. 5. git add + commit with session number in the message. Current state of work: - The last build (§1–§4, round 4) came back CLEAN (no output) — so LiMoments.lean §1–§4 all elaborate, including the k=1 capstone `sigmaP_one_eq_neg_gFun_zero`! - §5 (termwise iterated deriv at 0, k≥2) and §6 (unified capstone) are NOT yet written. I had the full design ready (documented in my plan + D-070). - The audit from earlier (user-requested) was completed and recorded: audit-session037-axioms.txt + AuditSession037.lean. - D-070 route-change design note was filed. - Scratch.lean was overwritten with the lemma probe (it was an old session-029 audit file — hmm, I overwrote Scratch.lean which previously contained a session-029 axiom audit! That's a concern: the previous content was "Session 029 axiom audit: LiFEntire.lean" — its output was presumably saved to audit-session029-axioms.txt, so the probe overwrite is acceptable but I should note it. Actually better: the audit scripts AuditSession034/035 exist as separate files; the session-029 one was apparently named Scratch.lean and its output recorded. The probe content is ephemeral. I should probably restore a proper file state — the cleanest: rename my probe to Probe.lean (which exists already per the earlier ls — Probe.lean exists!). Hmm — ls showed Probe.lean AND Scratch.lean both exist in the package root. I overwrote Scratch.lean (session-029 audit). To be safe and honest, I'll note this in the journal — the session-029 axiom AUDIT RESULTS are preserved in audit-session029-axioms.txt, so nothing is lost; the Scratch.lean file was a scratchpad by name. Actually let me check if audit-session029-axioms.txt exists — earlier ls showed audit-session029-axioms.txt ✓ yes it exists. Good. Wait — should I restore Scratch.lean to the session-029 audit? The audit file content was partially shown in the system reminder ("/- Session 029 axiom audit: LiFEntire.lean (ii′-5e-iv COMPLETE). -/ import Mathlib import NguyenRH1.LiFEntire open NguyenRH1"). The audit results are in audit-session029-axioms.txt. The scratch file itself is a scratchpad — Probe.lean also exists for this purpose. I'll restore Scratch.lean to the session-029 audit content? I only saw the first 3 lines + the note "36 lines". I can't fully restore it — I only have the header. Hmm. The audit output is preserved. The header comment is known. Being pragmatic: keep my probe in Scratch.lean (it IS a scratchpad), note it in the journal, and move on. Actually — better citizenship: move my probe into Probe.lean? Probe.lean also existed with unknown content — overwriting it too would compound the issue. Leave Scratch.lean as the probe; document the change in the journal (the session-029 audit results are safe in audit-session029-axioms.txt). Hmm — actually, let me reconsider: the system note said "the file existed and had not been read in this session — its previous content (36 lines) was read automatically before overwriting. Previous content began: /- Session 029 axiom audit: LiFEntire.lean (ii′-5e-iv COMPLETE). -/". The auto-read means the full content was captured somewhere? No — it says previous content "began" with those lines. I can't restore the full 36 lines. It's fine — the audit OUTPUT is archived; the script is re-derivable from AuditSession034/035 patterns. Journal note it. Now — what to do RIGHT NOW for closure. The build state: §1–§4 elaborate clean (last run: no output). §5/§6 not written. The file compiles standalone (`lake env lean` green). It's NOT root-imported yet — that's fine (LiTightR also wasn't until now). Per §8.4 and 8.5 (sub-stage rule: each sub-stage ends in a clean, committed, resumable state): 1. Journal session-037.md — document: the user-requested capstone audit (audit-session037-axioms.txt: 3 standard axioms only; perimeter parameters recorded verbatim); ii′-3b LAUNCHED with the D-070 route revision (moments via the 5e partial-fraction identity — no contours); LiMoments.lean §1–§4 complete (~700 lines, builds green): xiL entire closed form, gFun = B + seriesFun identity (G), evaluations at 0/1 + FE sign, summability budget, k=1 rearrangement sigmaP_one_eq_neg_gFun_zero PROVED; §5/§6 designed (termwise iterated deriv + unified capstone) with the full proof skeleton in the design; banked gotchas (Summable.tsum_add method form, SummationFilter-parameterized tsum lemmas in this Mathlib, eq_zero_of_neg_eq needs LinearOrder (ℂ N/A → 2V=0 route), Complex.norm_conj takes starRingEnd directly, iteratedDeriv_neg exists with explicit args, Equiv.summable_iff/Equiv.tsum_eq signatures, the beta-redex show-before-rw pattern, AnalyticAt.contDiffAt exists, field_simp closes goals (trailing ring errors ×3), tsum binder ascriptions mandatory (zeroMult ρ coerces to ℂ otherwise), Scratch.lean overwritten with the probe (session-029 audit script superseded — output preserved in audit-session029-axioms.txt)). 2. D-070 already filed ✓ (route revision design). Update derivations/index.md + register D-070 in research.db. 3. NGUYEN.md: update the ii′-3b checklist line — from [~] design to "§1–§4 COMPLETE (session 037): LiMoments.lean xiL/(G)/evaluations/k=1; §5/§6 remaining". Also the session log §8.6 needs a session-037 entry. Also STATE.md. 4. STATE.md — update with the current position + NEXT ACTION: Session 038: LiMoments §5 (termwise iterated derivation at 0 — iteratedDeriv_seriesTerm + the M-test SummableLocallyUniformlyOn + iteratedDeriv_seriesFun_zero) → §6 (gFun_eventuallyEq_zero + the capstone sigmaP_eq_neg_iteratedDeriv_gFun_div) → root-import LiTightR + LiMoments → audit → ii′-3c. 5. Commit with session number. Also — §8.4 item 2: "register in research.db" — D-070 needs registration. db.py add-derivation: positional id, --title --task --status --file (NO --date flag). And session registration via direct sqlite3 insert (journal_file column) — per handoff notes. Let me also double check the current build state is really green including all of §1-§4 — the last run had NO output which means clean (no errors, no warnings). ✓ One question: should I also write the §5/§6 design into a file so it's not lost? The full §5/§6 proof skeleton is substantial. It's in the conversation; D-070 §5 has the deliverable statement; the journal should carry the detailed remaining-work plan (that's the archive convention — journal-036 did the same for 5f's remaining pieces). I'll put the detailed §5/§6 skeleton in the journal entry. Let me also update the todo list to reflect reality before closing (§5/§6 pending). Order of operations: 1. Write journal/session-037.md. 2. Update research/derivations/index.md (add D-070). 3. Register D-070 in research.db (db.py add-derivation) + register session 037 (sqlite3 insert). 4. Update NGUYEN.md (ii′-3b line + session log). 5. Update STATE.md (position + next action). 6. git add specific files + commit. Files to commit: - research/lean/NguyenRH1/NguyenRH1/LiMoments.lean (new) - research/lean/NguyenRH1/AuditSession037.lean (new) - research/lean/NguyenRH1/audit-session037-axioms.txt (new) - research/lean/NguyenRH1/Scratch.lean (modified — probe) - research/derivations/D-070-ii-prime-3b-route-revision.md (new) - research/derivations/index.md (modified) - research/journal/session-037.md (new) - research/research.db (modified — binary; do we commit the db? Check git status convention — the db is tracked? Handoff says db.py registrations; the repo likely tracks research.db. Check git status.) - NGUYEN.md (modified) - STATE.md (modified) Wait — also there were untracked LaTeX build artifacts at conversation start (draft.bbl etc., paperA.pdf, submit/) — NOT ours to commit (leave them). Let me check the derivations/index.md format first, then write everything. Also check research.db is tracked by git. Journal content — let me draft it carefully but efficiently. Also need the session-registration SQL: "Session registration via direct sqlite3 insert (journal_file column)" — schema in numerics/scripts/schema.sql. Let me check the sessions table shape quickly.
The last build came back clean — §1–§4 of LiMoments.lean all elaborate, including the k=1 capstone. Perfect boundary for closure. Running the §8.4 end protocol now.
tool: TodoWrite ok
input
{
  "todos": [
    {
      "content": "Read D-066 design + journal-035/036 gotchas",
      "status": "completed",
      "activeForm": "Reading D-066 design + banked gotchas"
    },
    {
      "content": "Scope ii\u2032-3b + file D-070 route-change design note",
      "status": "completed",
      "activeForm": "Scoping ii\u2032-3b + filing D-070"
    },
    {
      "content": "LiMoments \u00a71\u2013\u00a74 (xiL, (G), evaluations, k=1) \u2014 BUILD GREEN",
      "status": "completed",
      "activeForm": "Building LiMoments \u00a71\u2013\u00a74"
    },
    {
      "content": "LiMoments \u00a75: termwise iterated deriv at 0 (k\u22652)",
      "status": "pending",
      "activeForm": "Building LiMoments \u00a75 (k\u22652 termwise)"
    },
    {
      "content": "LiMoments \u00a76: unified capstone sigmaP_eq",
      "status": "pending",
      "activeForm": "Building LiMoments \u00a76 (capstone)"
    },
    {
      "content": "Session-037 closure: journal, index, db, NGUYEN.md, STATE, commit",
      "status": "in_progress",
      "activeForm": "Closing session 037 (journal/db/STATE/commit)"
    }
  ]
}
result 2026-08-25 00:13:44Z → 2026-08-25 00:13:44Z
{
  "oldTodos": [
    "content='Read D-066 design + journal-035/036 gotchas' status='completed' active_form='Reading D-066 design + banked gotchas'",
    "content='Scope ii\u2032-3b: exact statement + proof skeleton of the contour moments' status='completed' active_form='Scoping ii\u2032-3b moment theorem'",
    "content='File D-070 route-change design note' status='completed' active_form='Filing D-070 route-change note'",
    "content='LiMoments \u00a71: xiL + equivs + basic facts' status='in_progress' active_form='Building LiMoments \u00a71 (xiL)'",
    "content='LiMoments \u00a72: gFun = B + seriesFun at good points' status='pending' active_form='Building LiMoments \u00a72 (gFun identity)'",
    "content='LiMoments \u00a73: values at 0,1 + FE sign' status='pending' active_form='Building LiMoments \u00a73 (evaluations)'",
    "content='LiMoments \u00a74: summability + reindex lemmas (k=1)' status='pending' active_form='Building LiMoments \u00a74 (k=1 rearrangement)'",
    "content='LiMoments \u00a75: termwise iterated deriv at 0 (k\u22652)' status='pending' active_form='Building LiMoments \u00a75 (k\u22652 termwise)'",
    "content='LiMoments \u00a76: unified capstone sigmaP_eq' status='pending' active_form='Building LiMoments \u00a76 (capstone)'",
    "content='Axiom audit + full build green + root import' status='pending' active_form='Running axiom audit + full build'",
    "content='Session-037 archive closure (journal, db, STATE, commit)' status='pending' active_form='Closing session 037 archive'"
  ],
  "newTodos": [
    "content='Read D-066 design + journal-035/036 gotchas' status='completed' active_form='Reading D-066 design + banked gotchas'",
    "content='Scope ii\u2032-3b + file D-070 route-change design note' status='completed' active_form='Scoping ii\u2032-3b + filing D-070'",
    "content='LiMoments \u00a71\u2013\u00a74 (xiL, (G), evaluations, k=1) \u2014 BUILD GREEN' status='completed' active_form='Building LiMoments \u00a71\u2013\u00a74'",
    "content='LiMoments \u00a75: termwise iterated deriv at 0 (k\u22652)' status='pending' active_form='Building LiMoments \u00a75 (k\u22652 termwise)'",
    "content='LiMoments \u00a76: unified capstone sigmaP_eq' status='pending' active_form='Building LiMoments \u00a76 (capstone)'",
    "content='Session-037 closure: journal, index, db, NGUYEN.md, STATE, commit' status='in_progress' active_form='Closing session 037 (journal/db/STATE/commit)'"
  ],
  "cleared": false
}
tool: Bash
input
{
  "command": "cd D:/Python/Quantum && git status --short | head -20 && sqlite3 research/research.db \".schema sessions\" 2>/dev/null || ./.venv/Scripts/python.exe -c \"import sqlite3; db = sqlite3.connect('research/research.db'); print(db.execute(\\\"SELECT sql FROM sqlite_master WHERE name='sessions'\\\").fetchone()[0])\"",
  "description": "Check git status and sessions table schema"
}
#1868 assistant 2026-08-25 00:15:37.036 UTC · 1377→4075 tok open ⤢
thinking (722 chars)
All formats confirmed. The derivations table has a date column but db.py add-derivation has no --date flag (handoff said so — the tool handles it). Sessions: max id 36. Now write the journal entry first (it carries the detailed §5/§6 skeleton so no work is lost), then index.md, db registrations, NGUYEN.md, STATE.md, commit. The journal needs: 1. What happened: capstone audit (user-requested), D-070 route revision, LiMoments §1–§4 complete green, §5/§6 designed. 2. The detailed §5/§6 proof skeleton (so next session can execute without re-deriving). 3. Banked gotchas (this session's hard-won Lean facts). 4. Housekeeping notes (Scratch.lean overwritten, etc.) Let me write it now. Keep it thorough but not bloated.
All formats confirmed. Writing the session-037 journal with the complete §5/§6 skeleton so nothing is lost.
tool: Write ok
input
{
  "file_path": "D:\\Python\\Quantum\\research\\journal\\session-037.md",
  "content": "# Session 037 (2026-08-24) \u2014 ii\u2032-3b STARTED: capstone dependency audit + LiMoments \u00a71\u2013\u00a74 COMPLETE (k=1 moment PROVED)\n\n## What happened\n\n1. **User-requested dependency audit of the ii\u2032-5f capstone** (pre-ii\u2032-3b).\n   New file `AuditSession037.lean` + output `audit-session037-axioms.txt`:\n   - `#print axioms logDeriv_riemannZeta_sub_nearZeros_le_tight` \u2192\n     **[propext, Classical.choice, Quot.sound] only** (no sorryAx, nothing else).\n   - The exact perimeter recorded verbatim from the elaborator:\n     `ZeroCountProp` (unit window, mult-weighted, \u2264 C0hat(t+1), t \u2265 2;\n     C0hat t = 0.433\u00b7log(t+2) + 0.886\u00b7log log(t+2) + 2.9),\n     `ZeroCountProp2` (two-unit window, \u2264 0.6\u00b7L + 0.886\u00b7LL + 2.7, t \u2265 10),\n     `NoLowZeros` (\u2200 \u03c1 nontrivial, 14 \u2264 |Im \u03c1|); plus the statement-level\n     constructs `nearZerosSub`, `Zeta23.zeroMult` (= analyticOrderAt.toNat),\n     `zeroAbsWindow`. One fix during the audit: `zeroMult` is `Zeta23.zeroMult`\n     (not NguyenRH1) \u2014 the first script run caught it.\n\n2. **ii\u2032-3b LAUNCHED with a route revision (D-070).** D-066 \u00a73's plan was\n   rectangle contours (zero-avoiding T, horizontal decay from the R-bound,\n   vertical push-off). But 5e's `partialFraction_identity (hZC)` IS the\n   contour work done once: with gFun := logDeriv xiL, xiL := (s(s\u22121)/2)\u00b7\u039b,\n   the identity **(G) gFun s = B + seriesFun s** at every good point is pure\n   logDeriv algebra, and the moments (M) sigmaP k = \u2212gFun^{(k\u22121)}(0)/(k\u22121)!\n   follow by termwise series calculus. Perimeter carried: ZeroCountProp ONLY\n   (the 5f tight bound's hZC2/hNLZ are NOT needed for the moments). D-070\n   filed with the full argument + sanity gate (\u03c3\u2081 = \u2212gFun(0) = \u2212B =\n   1 + \u03b3/2 \u2212 \u00bdlog 4\u03c0 \u2248 0.0230957, the Davenport value; B = log 2\u03c0 \u2212 1 \u2212\n   (log \u03c0)/2 \u2212 \u03b3/2 \u2248 \u22120.0230957 numerically).\n\n3. **LiMoments.lean \u00a71\u2013\u00a74 COMPLETE, build GREEN** (~730 lines, new file,\n   not yet root-imported; imports NguyenRH1.LiTightR + LiSwaps + LiResidue +\n   LiDigamma + LiReflect):\n   - \u00a71: `xiL` entire via the CLOSED FORM xiL s := (s(s\u22121)/2)\u00b7\u039b\u2080(s) \u2212 (s\u22121)/2\n     + s/2 (Mathlib `completedRiemannZeta_eq`: \u039b = \u039b\u2080 \u2212 1/s \u2212 1/(1\u2212s), \u039b\u2080\n     entire \u2014 sidesteps removable-singularity proofs; D-066's \"\u039b\u2080 wrong\n     object\" warning is about \u039b\u2080's ZEROS, never used). `xiL_eq_mul` (off\n     {0,1}), `xiL_zero`/`xiL_one` (= 1/2), `xiL_one_sub` (FE, by cases),\n     `xiL_ne_zero` (via RvM.completedRiemannZeta_eq_zero_iff),\n     `isNontrivialZero_one_sub` (conj then Zeta23 zeta_reflect_zero),\n     `conjZeroEquiv`/`oneSubZeroEquiv` (the two subtype involutions).\n   - \u00a72: `momentB` (Classical.choose of partialFraction_identity) +\n     **`gFun_eq_momentB`** \u2014 (G) at good points: logDeriv_mul chains\n     (xiL = (s(s\u22121)/2)\u00b7\u039b eventuallyEq; \u039b = \u0393R\u00b7\u03b6 eventuallyEq;\n     logDeriv \u0393R via logDeriv_Gamma\u211d_eq_of_not_neg_nat; the good-set\n     half-shift `good_half_ne_neg_nat`); final collapse by `ring`.\n   - \u00a73: `eq_of_eventuallyEq_nhd_ne` (punctured-continuity bridge,\n     tendsto_nhds_unique), `gFun_continuousAt`, the good-eventually sets at\n     0 (\u03b6(0) = \u22121/2 continuity) and 1 (zetaA factor), `seriesFun_zero` (= 0\n     termwise), `seriesFun_one` (= \u03a3 mult/(\u03c1(1\u2212\u03c1))), **`gFun_zero`**\n     (gFun 0 = B), **`gFun_one`** (gFun 1 = B + seriesFun 1),\n     **`gFun_one_eq_neg`** (FE sign: xiL(1\u2212s) = xiL(s) + deriv_comp chain\n     rule + EventuallEq.of_eq.deriv_eq).\n   - \u00a74: the summability budget + the k=1 rearrangement:\n     `summable_mult_div_norm_sq` (master, the ii\u2032-2 (9/4)-comparison\n     skeleton cloned), `exists_norm_lower_bound` (\u03b4-ball at 0),\n     `summable_mult_inv_pow` (k \u2265 2), `tsum_mult_inv_pow_conj` +\n     `summable_mult_inv_pow_conj` (conjEquiv reindex, zeroMult_conj),\n     **`sigmaP_eq_unpaired`** (k \u2265 2: sigmaP k = \u00bd(S+S) = S),\n     `summable_mult_div_norm_sq_one_sub` (oneSubEquiv transfer),\n     `mult_div_norm_mul_norm_le` (AM-GM: 1/(\u2016\u03c1\u2016\u20161\u2212\u03c1\u2016) \u2264 \u00bd(\u2016\u03c1\u2016\u207b\u00b2+\u20161\u2212\u03c1\u2016\u207b\u00b2),\n     via (1/a\u22121/b)\u00b2 \u2265 0 \u2014 NO im-lower-bound needed),\n     `summable_mult_one_div_mul_one_sub`, `summable_mult_vTerm` (the\n     1/\u03c1\u0304\u22121/(1\u2212\u03c1) = (1\u22122re)/(\u03c1\u0304(1\u2212\u03c1)) identity; |1\u22122re| \u2264 1),\n     **`vTerm_tsum_eq_zero`** (V = W by conj reindex, W = \u2212V by reflect\n     reindex, so 2V = 0), `summable_mult_fst/snd`, **`two_mul_sigmaP_one`**\n     (2\u03c3\u2081 = \u03a3 mult/(\u03c1(1\u2212\u03c1)) = seriesFun 1), and the k=1 capstone\n     **`sigmaP_one_eq_neg_gFun_zero`** (2\u03c3\u2081 = seriesFun 1 = gFun 1 \u2212 B =\n     \u22122\u00b7gFun 0 by the FE sign; linear_combination combo (h2 \u2212 hg1 + hg0 +\n     hfe)/2). NO re/conj-of-tsum bridges anywhere \u2014 all reality arguments\n     are subtype-equiv reindexes.\n\n## REMAINING for ii\u2032-3b (\u00a75/\u00a76) \u2014 full skeleton (design verified against Mathlib)\n\n**\u00a75 (termwise iterated derivation at 0, k \u2265 2):**\n- `iteratedDeriv_zpow_neg_one (k c) (hs : s+c \u2260 0)`: iteratedDeriv k\n  (fun s => (s+c)^(\u22121:\u2124)) s = (\u22121)^k\u00b7k!\u00b7(s+c)^(\u2212k\u22121) \u2014 from LiDigamma's\n  `iteratedDeriv_neg_zpow_neg_one_add` via e : f = \u2212(\u2212f) + **iteratedDeriv_neg\n  (EXISTS, explicit args (n f a), probed)**. (iteratedDeriv_const_mul (c)\n  (hf : ContDiffAt) also exists, Lemmas.lean:368.)\n- `iteratedDeriv_seriesTerm (j \u2265 1) \u03c1 (hs : s\u2212\u03c1 \u2260 0)`: seriesTerm s \u03c1 =\n  mult\u00b7((s+(\u2212\u03c1))^(\u22121:\u2124) + 1/\u03c1); rw [e, iteratedDeriv_const_mul,\n  iteratedDeriv_add hF1 hF2, iteratedDeriv_const, if_neg j\u22600, add_zero,\n  zpow lemma]. ContDiffAt proofs via AnalyticAt \u2192 **AnalyticAt.contDiffAt\n  (EXISTS, probed)**; constant via contDiff_const.contDiffAt.\n- `seriesTerm_deriv_summableLocallyUniformlyOn (j \u2265 1) h\u03b4 hball`: on\n  u := ball 0 (\u03b4/2) via **SummableLocallyUniformlyOn_of_locally_bounded\n  (probed: (IsOpen s) \u2192 (\u2200 K \u2286 s, IsCompact K \u2192 \u2203 u, Summable u \u2227 \u2200 n k \u2208 K,\n  \u2016f n k\u2016 \u2264 u n))**. Bound: \u2016s\u2212\u03c1\u2016 \u2265 \u2016\u03c1\u2016/2 (\u2016s\u2016 < \u03b4/2 \u2264 \u2016\u03c1\u2016/2), term \u2264\n  mult\u00b7j!\u00b72^{j+1}\u00b7(1/\u03b4)^{j\u22121}\u00b7\u2016\u03c1\u2016\u207b\u00b2 =: C_j\u00b7(mult/\u2016\u03c1\u2016\u00b2) (master lemma\n  mul_left). Norm chain: 3\u00d7 norm_mul + RCLike.norm_natCast \u00d72 + hsign\n  (\u2016(\u22121)^j\u2016=1) + norm_zpow + exponent rewrite (\u2212(j:\u2124)\u22121 = \u2212((j+1:\u2115):\u2124),\n  zpow_neg, zpow_natCast) \u2014 the LiDigamma:735\u2013746 pattern EXACTLY.\n  one_div_le_one_div_of_le (probed: 0<a \u2192 a\u2264b \u2192 1/b \u2264 1/a).\n- `iteratedDeriv_seriesFun_zero (j \u2265 1)`: obtain \u03b4 from\n  exists_ball_avoid_nontrivialZeros 0; **iteratedDerivWithin_tsum (probed\n  signature: (m) (IsOpen s) (x\u2208s) (\u2200 t\u2208s, Summable) (\u2200 k, 1\u2264k\u2192k\u2264m \u2192\n  SummableLocallyUniformlyOn ...) (\u2200 n k r, k\u2264m\u2192r\u2208s \u2192 DifferentiableAt\n  (iteratedDerivWithin k (f n) s) r))** \u2014 the LiDigamma:749\u2013785 call pattern\n  verbatim (side condition: j'=0 \u2192 seriesTerm differentiable (s\u2212\u03c1\u22600 on the\n  ball); j'\u22651 \u2192 eventuallyEq with the closed form, zpow differentiability\n  via hasDerivAt_zpow + rfl-bridge on \u2218). Then iteratedDerivWithin_of_isOpen\n  conversions + per-term iteratedDeriv_seriesTerm at 0.\n\n**\u00a76 (capstone):**\n- `gFun_eventuallyEq_zero (hZC)`: gFun =\u1da0[\ud835\udcdd 0] (B + seriesFun) \u2014 upgrade\n  the punctured version via **eventually_nhdsWithin_iff (probed \u2713)** +\n  gFun_zero/seriesFun_zero at the point.\n- `sigmaP_eq_neg_iteratedDeriv_gFun_div (hZC) (hk : 1 \u2264 k)`:\n  k=1: show (1\u22121)\u22610 defeq; sigmaP_one_eq_neg_gFun_zero.\n  k\u22652: iteratedDeriv_congr_of_eventuallyEq (LiDigamma:568) \u2192\n  (fun _ => B) + seriesFun via funext/Pi.add bridge \u2192 iteratedDeriv_add\n  hcf hcg (ContDiffAt: const + seriesFun analytic) \u2192 iteratedDeriv_const\n  if_neg (k\u22121\u22600) \u2192 iteratedDeriv_seriesFun_zero (k\u22121) \u2192 per-term at 0:\n  (0\u2212\u03c1)^(\u2212k:\u2124) = (\u22121)^k\u00b7(1/\u03c1)^k (zero_sub, zpow_neg, zpow_natCast, neg_pow,\n  mul_inv, ((\u22121)^k)\u207b\u00b9 = (\u22121)^k via inv_eq_of_mul_eq_one_right +\n  (\u22121)^{2k}=1, one_div/inv_pow) \u2192 sign (\u22121)^{k\u22121}\u00b7(\u22121)^k = \u22121 (pow_add,\n  2k\u22121 = 2(k\u22121)+1, pow_mul, (\u22121)\u00b2=1) \u2192 tsum = \u2212(k\u22121)!\u00b7sigmaP k\n  (tsum_congr, tsum_mul_left, sigmaP_eq_unpaired) \u2192 field_simp with\n  (k\u22121)! \u2260 0 (Nat.cast_eq_zero, Nat.factorial_ne_zero).\n- Then: root-import LiTightR + LiMoments in NguyenRH1.lean (STATE.md plan),\n  full build, axiom audit (expect 3 standard axioms; hZC-only dependency),\n  journal/db/STATE/NGUYEN updates, commit. **ii\u2032-3b \u2192 done; next is ii\u2032-3c**\n  ((4.10-a) assembly, D-066 \u00a72: needs also the FE derivative relation\n  gFun^{(k\u22121)}(0) = (\u22121)^k\u00b7gFun^{(k\u22121)}(1) \u2014 new but small from xiL_one_sub\n  + iteratedDeriv comp machinery).\n\n## Banked gotchas (this session)\n\n- **SummationFilter refactor**: tsum lemmas are SummationFilter-parameterized\n  in this Mathlib; `tsum_add`/`tsum_sub` exist ONLY as method forms\n  `Summable.tsum_add hf hg` / `Summable.tsum_sub` (plain `tsum_add` is\n  UNKNOWN); `tsum_neg`, `tsum_zero`, `tsum_congr`, `tsum_mul_left` are plain.\n- `eq_zero_of_neg_eq` needs LinearOrder \u2014 N/A for \u2102; use 2V = 0 via\n  linear_combination + mul_eq_zero.resolve_left.\n- `Complex.norm_conj : \u2016(starRingEnd \u2102) z\u2016 = \u2016z\u2016` \u2014 takes the starRingEnd\n  form DIRECTLY (don't rw [starRingEnd_apply] first; the star form breaks\n  rw matching).\n- `iteratedDeriv_neg (n) (f) (a)` EXISTS (explicit args);\n  `iteratedDeriv_const_mul (c) (hf : ContDiffAt \ud835\udd5c n f x)`;\n  `AnalyticAt.contDiffAt` exists (CompleteSpace needed).\n- `Equiv.tsum_eq e f : \u2211' a, f (e a) = \u2211' b, f b`;\n  `Equiv.summable_iff e : Summable (f \u2218 e) \u2194 Summable f` (f implicit \u2014 NO\n  second argument; state the family equation with `\u2218` and funext).\n- Beta-redex goals (families applied to equiv images): **show-before-rw**\n  (state the beta-reduced form with `show`, then rw) \u2014 plain rw can't find\n  the cast patterns inside redexes. (Recurred 5\u00d7.)\n- **Ascribe every tsum binder**: `\u2211' \u03c1, ... (zeroMult \u03c1 : \u2102) ...` elaborates\n  \u03c1 : \u2102 (zeroMult expects \u2102) \u2014 silently produces a tsum over the WRONG\n  domain. Always `\u2211' \u03c1 : {\u03c1 : \u2102 // IsNontrivialZero \u03c1}, ...`.\n- field_simp closes goals outright (trailing `ring` then errors \"no goals\" \u2014\n  3\u00d7 this session); but field_simp given \u2016x\u2016 \u2260 0 instead of x \u2260 0 normalizes\n  without clearing \u2014 pass the COMPLEX nonzeros (x \u2260 0, 1\u2212x \u2260 0, conj x \u2260 0).\n- `convert h using 1; ring` on HasDerivAt values: convert can produce\n  non-equality goals (\"ring_nf made no progress\") \u2014 instead ASCRIBE the\n  derivative value in the HasDerivAt statement and `rw [h.deriv]; ring`.\n- `deriv.comp` / `deriv_comp`: point arg x is EXPLICIT first\n  (`deriv_comp 0 h1 h2`); numeral-as-function error otherwise.\n- `ContinuousAt.add` on `continuousAt_const`: produces Pi.add functions \u2014\n  the defeq assignment `have hG : ContinuousAt (fun s => c + f s) x := hG0`\n  works (simpa [Pi.add_apply] does NOT).\n- `linear_combination` works over \u2102 (use it for \u2102 equalities; linarith does\n  NOT).\n- Housekeeping: `Scratch.lean` (previously the session-029 audit script) was\n  overwritten with this session's lemma probe \u2014 the session-029 audit RESULTS\n  are preserved in audit-session029-axioms.txt (script re-derivable from the\n  AuditSession03X pattern).\n\n## Files\n\n- research/lean/NguyenRH1/NguyenRH1/LiMoments.lean (NEW, ~730 lines, GREEN)\n- research/lean/NguyenRH1/AuditSession037.lean + audit-session037-axioms.txt\n- research/lean/NguyenRH1/Scratch.lean (lemma probe; see housekeeping)\n- research/derivations/D-070-ii-prime-3b-route-revision.md (NEW)\n"
}
result 2026-08-25 00:15:37Z → 2026-08-27 18:20:07Z
{
  "type": "create",
  "filePath": "D:\\Python\\Quantum\\web\\dashboard\\templates\\dashboard\\lean_detail.html",
  "content": "{% extends \"dashboard/base.html\" %}\n{% block title %}{{ item.file }}{% endblock %}\n{% block nav_lean %}active{% endblock %}\n{% block content %}\n<p><a href=\"{% url 'lean' %}\">\u2190 Lean Proofs</a></p>\n<h1>{{ item.file }}</h1>\n<p class=\"muted\">{{ item.lines }} lines \u00b7 {{ item.decls|length }} declarations \u00b7\n  {{ item.sorries }} {{ item.sorries|pluralize:\"sorry,sorries\" }} \u00b7\n  updated {{ item.mtime|slice:\":10\" }}</p>\n\n{% if item.decls %}\n<section class=\"card\">\n  <h2>Declarations</h2>\n  <table class=\"tbl\">\n    <thead><tr><th>Kind</th><th>Name</th><th>Line</th></tr></thead>\n    <tbody>\n    {% for d in item.decls %}\n      <tr><td>{{ d.kind }}</td><td><code>{{ d.name }}</code></td><td>{{ d.line }}</td></tr>\n    {% endfor %}\n    </tbody>\n  </table>\n</section>\n{% endif %}\n\n<section class=\"card\">\n  <h2>Source</h2>\n  <pre class=\"json-box code-box\">{{ item.source }}</pre>\n</section>\n{% endblock %}\n",
  "structuredPatch": [],
  "originalFile": null
}
#1869 assistant 2026-08-25 00:16:25.170 UTC · 453→624 tok open ⤢
thinking (199 chars)
The index.md append is clean (D-070 on its own line). Now update NGUYEN.md — the ii′-3b checklist line and the session log (§8.6). Let me find the exact current text of the ii′-3b entry in NGUYEN.md.
Index clean. Now NGUYEN.md — the ii′-3b checklist line and the session log.
tool: Edit
input
{
  "file_path": "D:\\Python\\Quantum\\NGUYEN.md",
  "old_string": "      Build GREEN (8762 jobs); 18 key decls audited: 3 standard axioms.\n- [ ] ii\u2032-3b R2(iii) moments (contour \u03c3_k = \u2212g^{(k\u22121)}(0)/(k\u22121)!) \u2192\n      ii\u2032-3c (assembly \u2192 crux Sf = Res\u2081).",
  "new_string": "      Build GREEN (8762 jobs); 18 key decls audited: 3 standard axioms.\n- [~] ii\u2032-3b R2(iii) moments (\u03c3_k = \u2212g^{(k\u22121)}(0)/(k\u22121)!) \u2192 ii\u2032-3c\n      (assembly \u2192 crux Sf = Res\u2081).\n      \u2192 **ROUTE REVISION (session 037, D-070)**: the moments come from 5e's\n      partialFraction_identity by PURE ALGEBRA + series calculus (no\n      contours \u2014 the contour work was 5e's): gFun := logDeriv xiL =\n      B + seriesFun at good points (xiL entire via the \u039b\u2080 closed form;\n      perimeter ZeroCountProp ONLY \u2014 5f's hZC2/hNLZ not needed).\n      **\u00a71\u2013\u00a74 COMPLETE (session 037)**: LiMoments.lean (~730 lines,\n      build green) \u2014 xiL + the two subtype equivs, (G) gFun_eq_momentB,\n      evaluations gFun_zero/gFun_one/gFun_one_eq_neg (FE sign), the\n      summability budget (master \u03a3 mult/\u2016\u03c1\u2016\u00b2 + AM-GM mixed bound), the\n      conj/reflect reindex machinery (sigmaP_eq_unpaired k \u2265 2,\n      vTerm_tsum_eq_zero), **k = 1 PROVED:\n      sigmaP_one_eq_neg_gFun_zero**. Remaining: \u00a75 (termwise iterated\n      derivation at 0, k \u2265 2 \u2014 full skeleton banked in journal-037) \u2192\n      \u00a76 (capstone sigmaP_eq_neg_iteratedDeriv_gFun_div) \u2192 root import\n      (with LiTightR) \u2192 audit."
}
#1870 assistant 2026-08-25 00:20:29.907 UTC · 1180→5425 tok open ⤢
thinking (155 chars)
Now update STATE.md (LAST, per protocol) with the current position + NEXT ACTION. Rewrite the header block, current position, active plan, and next action.
Now STATE.md (last, per protocol).
tool: Write
input
{
  "file_path": "D:\\Python\\Quantum\\STATE.md",
  "content": "# STATE.md \u2014 NGUYEN-RH-1 RESUME POINT\n# \u2b50 READ THIS FIRST at the start of every session.\nLast updated: 2026-08-24 | Session 037 COMPLETE at a clean boundary (user\nlog-off) \u2014 **ii\u2032-3b STARTED: \u00a71\u2013\u00a74 DONE, k=1 moment PROVED; \u00a75/\u00a76 remain.**\n\n## SESSION 037 HEADLINES\n1. **Capstone dependency audit** (user-requested, pre-ii\u2032-3b):\n   `AuditSession037.lean` + `audit-session037-axioms.txt` \u2014\n   `#print axioms logDeriv_riemannZeta_sub_nearZeros_le_tight` =\n   **[propext, Classical.choice, Quot.sound] ONLY**; the exact perimeter\n   recorded verbatim from the elaborator: `ZeroCountProp` (unit window,\n   mult-weighted, \u2264 C0hat(t+1), t \u2265 2; C0hat t = 0.433\u00b7log(t+2) +\n   0.886\u00b7log log(t+2) + 2.9), `ZeroCountProp2` (two-unit, \u2264 0.6\u00b7L +\n   0.886\u00b7LL + 2.7, t \u2265 10), `NoLowZeros` (\u2200 \u03c1 nontrivial, 14 \u2264 |Im \u03c1|);\n   constructs nearZerosSub / Zeta23.zeroMult / zeroAbsWindow also printed.\n2. **ii\u2032-3b ROUTE REVISION (D-070)**: the moments (M)\n   sigmaP k = \u2212gFun^{(k\u22121)}(0)/(k\u22121)! come from 5e's\n   `partialFraction_identity (hZC : ZeroCountProp)` by PURE ALGEBRA +\n   series calculus \u2014 NO contours (D-066 \u00a73's rectangle plan superseded;\n   the contour work was 5e's). The identity (G): gFun := logDeriv xiL =\n   B + seriesFun at every good point; xiL := (s(s\u22121)/2)\u00b7\u039b entire via the\n   \u039b\u2080 closed form xiL s := (s(s\u22121)/2)\u00b7\u039b\u2080(s) \u2212 (s\u22121)/2 + s/2 (Mathlib\n   `completedRiemannZeta_eq`). Perimeter: ZeroCountProp ONLY (5f's\n   hZC2/hNLZ NOT needed for the moments).\n3. **LiMoments.lean \u00a71\u2013\u00a74 COMPLETE, build GREEN** (~730 lines; new file,\n   NOT yet root-imported; imports NguyenRH1.LiTightR + LiSwaps + LiResidue\n   + LiDigamma + LiReflect):\n   \u00a71 xiL (differentiable/analytic everywhere, xiL_eq_mul off {0,1},\n   xiL_zero/xiL_one = 1/2, xiL_one_sub FE, xiL_ne_zero) + the subtype\n   involutions conjZeroEquiv/oneSubZeroEquiv + isNontrivialZero_one_sub;\n   \u00a72 `gFun_eq_momentB` \u2014 (G) at good points (logDeriv_mul chains +\n   logDeriv_Gamma\u211d_eq_of_not_neg_nat + momentB_spec);\n   \u00a73 `eq_of_eventuallyEq_nhd_ne`, good-eventually sets at 0 (\u03b6(0) = \u22121/2)\n   and 1 (zetaA), `seriesFun_zero` (= 0), `seriesFun_one` (= \u03a3\n   mult/(\u03c1(1\u2212\u03c1))), `gFun_zero` (gFun 0 = B), `gFun_one` (gFun 1 = B +\n   seriesFun 1), `gFun_one_eq_neg` (FE sign, deriv_comp chain rule);\n   \u00a74 summability budget (master `summable_mult_div_norm_sq`,\n   `exists_norm_lower_bound` \u03b4-ball, `summable_mult_inv_pow` k \u2265 2, AM-GM\n   `mult_div_norm_mul_norm_le`) + reindex machinery\n   (`tsum_mult_inv_pow_conj`, `sigmaP_eq_unpaired` k \u2265 2,\n   `summable_mult_div_norm_sq_one_sub`, `vTerm_tsum_eq_zero` via V = W =\n   \u2212V) and **the k = 1 capstone `sigmaP_one_eq_neg_gFun_zero` PROVED**\n   (2\u03c3\u2081 = seriesFun 1 = gFun 1 \u2212 B = \u22122\u00b7gFun 0 by the FE sign).\n\n## CURRENT POSITION\n\u2714 PHASE 0, 1, 4 COMPLETE. PHASE 3 (Track C): 3.1\u20133.8 CLOSED (R-004,\nfull tag). PHASE 2 (Track B): mapped to exhaustion at current\ntechnology (2.6\u20132.13). PHASE 5: 5.3 \u2714, 5.4 \u2714, 5.2 \u2714 (live);\n5.1 skeleton \u2714 + tier (i) \u2714 (session 011) + tier (ii) STEP 1 \u2714\n(session 012). PHASE 5B (tier ii\u2032, user decision: option (a) \u2014 close\nSfBoundProp in Lean BEFORE submission; Paper A frozen/submittable\nthroughout): DONE: ii\u2032-0 (D-064 design + liCoeff defect + crux Sf =\nRes\u2081 found), ii\u2032-1a (liCoeff defect REPAIRED), ii\u2032-1b (R1 residue\nmachinery: rectInt'_Jlag), ii\u2032-2 (elementary swaps), ii\u2032-3-DESIGN\n(D-066, \u03b24), ii\u2032-3a (pieces A+B: LiZetaCoeff, LiArchimedean, LiDigamma),\nii\u2032-4 (LiContour.lean: L3 exists_zero_avoiding_T + L1 kernel bounds +\nzeroMult_neg_two), ii\u2032-5a (D-067 design), ii\u2032-5b (LiRBound.lean:\nlevel-2 \u03b6 representation + norm_riemannZeta_le_disc \u2016\u03b6\u2016 \u2264 (3/4)|t|\u00b2),\nii\u2032-5c (LiDisc.lean: the loose disc R-bound \u2264 100000\u00b7(log|t|)\u00b2 on\n\u03c3 \u2208 [1/2, 7/2] via R-gap + Blaschke + BC, Jensen count, NO perimeter),\nii\u2032-5d (LiReflect.lean: FE-reflection + left loose bound \u2264\n200000\u00b7(log|t|)\u00b2 on \u03c3 \u2208 [\u22125/2, 1/2] + the 5e digamma input), ii\u2032-5e\n(LiTrivialZeros, LiGapCircles, LiDigammaLeft, LiSeries, LiFEntire,\nLiCircleBound (~3928 lines), LiSqueeze \u2014 **the partial-fraction identity\n`partialFraction_identity (hZC : ZeroCountProp)` PROVED**), ii\u2032-5f\n(LiTightR.lean ~4300 lines \u2014 **the tight R-bound\n`logDeriv_riemannZeta_sub_nearZeros_le_tight (hZC) (hZC2) (hNLZ)` \u2264\n10.5\u00b7log(|t|+2) + 48 PROVED**; capstone dependency-audited session 037:\n3 standard axioms only, perimeter verbatim). **ii\u2032-3b STARTED (session\n037 \u2014 this state file's header): \u00a71\u2013\u00a74 done, k = 1 PROVED.**\n\n**Theorem status (session 012 Lean upgrade + session 036):**\n- T-1 (R-004): [PROVED-CONDITIONAL(computational RH-to-T\u2080;\n  computational finite verification)] \u2014 **Lean-verified modulo\n  SfBoundProp + the declared computational perimeter only**:\n  `lambda_pos_finite_height_verified` (LiBasePoints.lean) PROVED from\n  (hRH : RHUpTo 3\u00d710\u00b9\u00b2) (hfinite : LiVerifiedUpTo 5\u00d710\u2075)\n  (hSf : SfBoundProp). PrintAxioms = 3 standard axioms, no sorryAx.\n  The two margin evaluations are discharged by certified interval\n  bounds (margin\u0303(8\u00d710\u2074) \u2265 8001 certified / 15 764 true; margin\u0303(10\u2075)\n  \u2265 85 501 certified). LiSkeleton + LiBasePoints both sorry-free.\n- T-2 (R-003 + D-041): factorization + (\u2605) \u27fa (1.12) [PROVED modulo\n  Phase-5 formalities]; (1.12) \u27f9 spec(D) \u2282 \u211d [PROVED via Suzuki + D1];\n  \u21d0 [SKELETON L3/L4].\n- T-3 (valley, D-049 + D-058): [PROVED-CONDITIONAL(RH)].\n\n**Paper:** research/paper/paperA.tex \u2014 Paper A (finite-height Li +\nmachine-verified assembly), 8 pp, compiles clean, zero undefined refs.\npaperB.tex \u2014 spectral-line research note (skeleton, standing items in\n\u00a70), 6 pp. draft.tex \u2014 FROZEN combined archive copy (12 pp). No\nfigures yet.\n\n**Lean:** research/lean/NguyenRH1/ \u2014 full build GREEN (8762 jobs);\nLiSqueeze + LiCircleBound root-imported (session 034); LiTightR.lean\n(~4300 lines, NOT yet root-imported \u2014 import it from the root together\nwith LiMoments at the end of ii\u2032-3b); **LiMoments.lean NEW (~730 lines,\n\u00a71\u2013\u00a74, single-file green, NOT yet root-imported)**. sorryAx remains\nONLY on: R003_exact_factorization (tier iv) + 4 valley statements\n(tier iii).\n\n## ACTIVE PLAN (tier ii\u2032, per D-064 \u00a76)\nFreeze protocol in force (user directive 2026-08-21): no edits to\npaperA.tex/paperB.tex/draft.tex/references.bib until ii\u2032-7; no edits\nto existing Lean proofs except the liCoeff correctness fix (ii\u2032-1a);\ncommit at every sub-stage. Fallback integrity: D-064 \u00a78.\nRemaining sub-stages: **ii\u2032-3b \u00a75/\u00a76** (the k \u2265 2 moments by termwise\niterated derivation at 0 + the unified capstone\nsigmaP_eq_neg_iteratedDeriv_gFun_div; full skeleton banked in\njournal-037, all Mathlib signatures probed) \u2192 root-import LiTightR +\nLiMoments \u2192 audit \u2192 **ii\u2032-3c** (assembly of Lagarias (4.10):\n\u03c4_j = c_j + (\u22121)\u02b2\u03c3_{j+1} \u2212 (\u22121)\u02b2 \u2014 the crux identity Sf(n) = Res\u2081(n);\nneeds also the FE derivative relation gFun^{(k\u22121)}(0) =\n(\u22121)^k\u00b7gFun^{(k\u22121)}(1), small from xiL_one_sub) \u2192 **ii\u2032-6** (L0\nassembly: sides identity + bridge |\u03bb_n(T)| \u2264 2\u00b7FAlt(T) (hRH) +\n|Sf n| \u2264 Bn FAlt n on [10\u2075, N\u2081]; D-069 Finding 2's H(T) near-sum\nrepair map (honest \u2248 7\u00b7\u0108\u2080\u00b2 vs baked 3\u00b7\u0108\u2080\u00b2, margin survives via E-028's\n26\u00d7 slack) lives here) \u2192 **ii\u2032-7** (closure: theorem sfBoundProp :\nSfBoundProp; final lambda_pos_finite_height_closed with the 3 perimeter\nhypotheses only; full axiom audit; paper Appendix B + tag upgrade\n(D-062 \u00a74 endpoint); archive closure + D-037 line-63 erratum pointer).\nDeprioritized: a=13+ push; adversary-ceiling LP; T4b; \u03bb-channel\n(G-004); \u03b8-channel (dead, E-024); Paper B Task 1 (R-003 bookkeeping)\nholds as queued after ii\u2032; user read-through of paperA.pdf still open\n(nothing blocks it); repo-publication prep still open.\n\n## NEXT ACTION\nSession 038: **LiMoments \u00a75 then \u00a76** (ii\u2032-3b back half). Read first:\njournal-037's \"REMAINING for ii\u2032-3b (\u00a75/\u00a76) \u2014 full skeleton\" (every\nlemma + proof step + probed Mathlib signature) and the banked-gotchas\nlist (SummationFilter refactor: `Summable.tsum_add`/`Summable.tsum_sub`\nmethod-form ONLY, tsum_neg/tsum_zero/tsum_congr/tsum_mul_left plain;\neq_zero_of_neg_eq needs LinearOrder (\u2102 N/A \u2014 use 2V = 0);\nComplex.norm_conj takes starRingEnd directly; iteratedDeriv_neg EXISTS\n(explicit args); AnalyticAt.contDiffAt exists; Equiv.tsum_eq/\nEquiv.summable_iff signatures; ascribe EVERY tsum binder; beta-redex\nshow-before-rw; field_simp's trailing-ring errors; deriv_comp's point\narg explicit). \u00a75 targets: iteratedDeriv_zpow_neg_one \u2192\niteratedDeriv_seriesTerm \u2192 seriesTerm_deriv_summableLocallyUniformlyOn\n(M-test on ball(0, \u03b4/2), dominator C_j\u00b7mult/\u2016\u03c1\u2016\u00b2) \u2192\niteratedDeriv_seriesFun_zero (iteratedDerivWithin_tsum, the\nLiDigamma:749\u2013785 call pattern verbatim). \u00a76 targets:\ngFun_eventuallyEq_zero (eventually_nhdsWithin_iff upgrade) \u2192 the\ncapstone sigmaP_eq_neg_iteratedDeriv_gFun_div (k=1 defeq branch +\nk\u22652: iteratedDeriv_congr_of_eventuallyEq \u2192 add/const split \u2192\niteratedDeriv_seriesFun_zero \u2192 per-term sign algebra \u2192\nsigmaP_eq_unpaired \u2192 field_simp (k\u22121)! \u2260 0). Then: root-import\nNguyenRH1.LiTightR + NguyenRH1.LiMoments, full build, axiom audit\n(expect 3 standard; hZC-only), journal/db/STATE/NGUYEN updates, commit.\nii\u2032-3b THEN DONE \u2192 ii\u2032-3c (the (4.10-a) assembly; also needs the FE\nderivative relation gFun^{(k\u22121)}(0) = (\u22121)^k\u00b7gFun^{(k\u22121)}(1)).\n\n## COMPLETED (Sessions 001\u2013010)\n- [x] Phase 0, Phase 1 (Track A \u2192 monitoring mode, D-013).\n- [x] 2.6 V3 root-cause + repair (E-016b/c, D-025).\n- [x] 2.7 R-003 exact factorization (D-026, E-017/D-027, ledger #5).\n- [x] 2.8 a=12 no transition (E-018/D-028, backend v2, E-019/D-029).\n- [x] 1.6 \u03be\u2032-world saturated (E-020b/D-030); 1.7 T4b closed (D-031).\n- [x] 3.3 \u2192 G-003; 3.4 (Suzuki line spawned); 3.5 design (D-032/D-033).\n- [x] (\u2605) design (D-034/D-035); new tasks 2.9/2.10/2.11.\n- [x] 3.6 D-036 explicit contour constants (session 006 cont.9).\n- [x] 3.7 E-021 (session 007): S_\u221e exact + c\u2080, |S_f| curve, A/B\u2080\n      measured; 6-bug saga documented.\n- [x] Session 008: regroup; R7 resources atlas registered; 3.8\n      COMPLETE (D-037, E-023, R-004 ledger #6); 2.10 COMPLETE\n      (E-022/E-022b + D-040, valley observable); 2.9-D1 COMPLETE\n      (D-041); 2.11 COMPLETE (D-038); 2.12 COMPLETE (E-024 + D-042,\n      \u03b8-independence); 2.13 COMPLETE (E-025 + D-043, discretization\n      floor; quadratic locking correction).\n- [x] Session 009: PHASE 4 COMPLETE (D-052/D-053/D-054, E-027 + D-055,\n      repairs 4.5a\u2013d: D-056\u2013D-059; R-004 tag restored).\n- [x] Session 010: 5.3 paper draft complete; 5.4 honesty audit (D-060);\n      5.1/5.2 skeleton stage (D-061).\n- [x] Session 011: Lean proof tier (i) COMPLETE \u2014 sInfty_lower_bound,\n      marginTilde_convex, chain_rule_sqrt_shift PROVED (journal-011;\n      10 commits; D-061 \u00a75 updated).\n\n## OPEN CONJECTURES / THREADS\n- (\u2605) (R-003): central conjectural target (task 2.9).\n- Q-S1 (D-019 \u00a73): L\u00b2\u2192uniform lifting. Q-S2: \u210b(T_a) de Branges (2.4).\n  \u03b8(a) theory: must explain both metrics (D-028 F3) + z\u2081\u00b7a\u22484.5 law.\n- Q6 (D-001); Q14 Gutzwiller (Phase 2); T2 Christoffel/CMS (D-006).\nCLOSED: T1, T3, T4, T4b (D-031), T5 (\u2192G-001), 3.4a/b/c, 3.3 (\u2192G-003),\n2.8 (D-029), 1.6 (D-030), 1.7 (D-031), 3.5-design (D-033), (\u2605)-design\n(D-035), 3.6 (D-036), 3.7 (E-021), 3.8 (D-037/R-004), 5.3, 5.4,\n5.1-tier-(i), ii\u2032-5f (D-056's tight R-bound, session 036),\nii\u2032-3b \u00a71\u2013\u00a74 + k=1 (session 037).\n\n## BLOCKERS\n(none)\n\n## HANDOFF NOTES\n- db.py add-derivation/log-experiment use INSERT OR REPLACE keyed by\n  id \u2014 a mistyped re-register OVERWRITES the row.\n- db.py: init, log-experiment, add-result, add-derivation, add-graveyard,\n  list. add-derivation signature: positional id, --title --task\n  --status --file (NO --date flag). Session registration via direct\n  sqlite3 insert (journal_file column).\n- venv: ./.venv/Scripts/python.exe. git: git -c user.name=\"NGUYEN-RH-1\"\n  -c user.email=\"research@local\" commit (config NOT modified).\n- LONG RUNS: DETACHED + sandbox DISABLED + log file; poll. For lake:\n  SINGLE command per detached spawn; short PrintAxioms in foreground.\n- LEAN: elan 4.2.3 at ~/.elan/bin (export PATH per shell); toolchain\n  v4.33.0-rc2; zeta-23-lean fully built (9010 jobs) + cache ~7 GB;\n  NguyenRH1 at research/lean/NguyenRH1 with path requires. Iterate\n  single-file with `lake env lean NguyenRH1/LiMoments.lean` (or\n  LiSkeleton.lean, LiTightR.lean) from the package dir;\n  `lake build NguyenRH1.LiTightR` to produce the olean for cross-file\n  imports.\n- LEAN 4 gotchas (session 037 additions \u2014 full list in journal-037):\n  SummationFilter refactor \u2014 `Summable.tsum_add`/`Summable.tsum_sub`\n  method-form ONLY (plain tsum_add UNKNOWN), tsum_neg/tsum_zero/\n  tsum_congr/tsum_mul_left plain; eq_zero_of_neg_eq needs LinearOrder\n  (\u2102 N/A \u2014 2V = 0 via linear_combination + mul_eq_zero.resolve_left);\n  Complex.norm_conj takes starRingEnd DIRECTLY (don't starRingEnd_apply\n  first); iteratedDeriv_neg EXISTS (explicit args); AnalyticAt.contDiffAt\n  exists; Equiv.tsum_eq e f : \u2211' a, f (e a) = \u2211' b, f b;\n  Equiv.summable_iff e : Summable (f\u2218e) \u2194 Summable f (f implicit);\n  ASCRIBE every tsum binder (zeroMult \u03c1 coerces \u03c1 to \u2102 \u2192 wrong domain);\n  beta-redex show-before-rw; field_simp closes goals (trailing ring\n  errors) but needs the COMPLEX nonzeros (x \u2260 0, not \u2016x\u2016 \u2260 0);\n  deriv_comp point arg EXPLICIT first; ContinuousAt.add on\n  continuousAt_const \u2192 use defeq assignment, not simpa [Pi.add_apply];\n  linear_combination works over \u2102, linarith does NOT.\n- LEAN 4 gotchas (session 011, hard-won \u2014 full list in journal-011):\n  HasDerivAt.add_const adds to VALUE (use .comp for precomposition);\n  Pi.mul_apply/Pi.add_apply/Pi.sub_apply simp after .mul/.add/.sub;\n  convert leaves instance side-goals \u2192 `first | rfl | ring`;\n  field_simp often closes goals (trailing ring errors \u2014 banked 4\u00d7\n  this session);\n  Finset.sum_image takes Set.InjOn, map = g, summand = f;\n  deriv^[2] \u2260 deriv (deriv \u00b7) syntactically (show bridges);\n  subtype coercions (m : \u211d) vs (m.1 : \u211d) can explode isDefEq \u2014 pin\n  families explicitly; -a*b vs -(a*b) breaks Real.exp_neg rewrites;\n  check norm_num digit-bounds by hand (two tight ones failed);\n  set_option maxHeartbeats goes BEFORE the doc comment;\n  iimaj_bracket_bound needs maxHeartbeats 800000.\n- flint for ALL \u03b6/Stieltjes >16 digits; mp.zetazero safe; mpmath\n  complex-\u03b6 OK to ~1e-10; mpmath zeta (integer+Hurwitz)\n  UNTRUSTWORTHY beyond ~57 digits at any dps.\n- PRECISION RULES (session 007): (1) mp.mp.dps = X BEFORE every\n  mp.mpf(string) parse; (2) long decimal constants as STRINGS;\n  (3) float64 zero ordinates insufficient for \u03c3_m; (4) Li binomial\n  truncation boundary error ~C(n,M)\u00b714^{\u2212M} peaks at M = n/15.\n- prime_backend_v2: blockwise \u039b to e\u00b2\u2074, cache E-019-backend-cache.npz;\n  monkeypatch E16.prime_sum_vec + E16._BUILD.clear().\n- Winding diagnostic: \u22654000 pts/edge near real zeros.\n- E-016/E-016b FROZEN; correct machinery: E-016c, E-017/E-018.\n- \u03b3-locking claim protocol: D-029 \u00a73.\n- Lagarias paper math/0404394 (research/paper/): \u00a75\u20136 read in full.\n- research/resources/: 43-note RH-equivalence atlas = R7.\n- E-021 caches: E-021-zeta-cache.json, E-021-zeros100-hi-cache.json,\n  E-021-zeros-cache.npy (4624 zeros float64 \u2014 P1 use ONLY).\n- E-023: E-023-assembly.csv + .json (M\u2080, N\u2080, N\u2081, margins).\n- E-027: detector stress test; zeros cache E-027-zeros-cache.npy;\n  rerun 16 s with cache (--force).\n- PAPER: build with pdflatex+bibtex in research/paper/ (MiKTeX);\n  draft.pdf is gitignored. Audit rule (D-060 \u00a75): any edit to\n  draft.tex re-opens the audit for the edited lines.\n- Housekeeping (session 037): Scratch.lean (previously the session-029\n  audit script) was overwritten with the session-037 lemma probe \u2014\n  session-029 audit RESULTS preserved in audit-session029-axioms.txt.\n"
}
#1871 assistant 2026-08-25 00:20:55.571 UTC · 5622→380 tok open ⤢
thinking (891 chars)
Now commit. Per git protocol: stage specific files by name (never git add -A/.). Files: - research/lean/NguyenRH1/NguyenRH1/LiMoments.lean (new) - research/lean/NguyenRH1/AuditSession037.lean (new) - research/lean/NguyenRH1/audit-session037-axioms.txt (new) - research/lean/NguyenRH1/Scratch.lean (modified) - research/derivations/D-070-ii-prime-3b-route-revision.md (new) - research/derivations/index.md (modified) - research/journal/session-037.md (new) - research/research.db (modified — it's tracked? Let me check: git status didn't show it modified BEFORE my db writes; now it should show M. It was registered in past sessions so it's tracked.) - NGUYEN.md (modified) - STATE.md (modified) NOT the paper artifacts (draft.bbl etc. — untracked build artifacts, leave). git diff check + commit with the prescribed identity (git -c user.name="NGUYEN-RH-1" -c user.email="research@local").
All archive files updated. Committing with the session-037 message.
tool: Bash
input
{
  "command": "cd D:/Python/Quantum && git status --short | grep -v \"research/paper/\" && git diff --stat NGUYEN.md STATE.md research/derivations/index.md research/lean/NguyenRH1/Scratch.lean",
  "description": "Review changes before staging"
}
#1872 assistant 2026-08-25 00:21:45.306 UTC · 776→426 tok open ⤢
All saved — commit `aaa2988`, clean boundary, nothing lives only in conversation. **Session 037 state (committed):** - **Capstone audit** (your request): `logDeriv_riemannZeta_sub_nearZeros_le_tight` depends on `[propext, Classical.choice, Quot.sound]` only; the exact perimeter (ZeroCountProp / ZeroCountProp2 / NoLowZeros) recorded verbatim in `audit-session037-axioms.txt`. - **ii′-3b route revision (D-070)**: the moments come from 5e's partial-fraction identity by pure algebra + series calculus — no contours needed. gFun = logDeriv xiL = B + seriesFun at good points; perimeter is ZeroCountProp only. - **LiMoments.lean §1–§4 COMPLETE, build green** (~730 lines): xiL (entire), the identity (G), evaluations at 0/1 + the FE sign, the full summability budget, the conj/reflect reindex machinery, and **k=1 PROVED** (`sigmaP_one_eq_neg_gFun_zero`). - **§5/§6 fully designed and Mathlib-probed** — the complete proof skeleton with every lemma name and signature confirmed is banked in journal-037, so next session can execute directly. **Resume point (STATE.md NEXT ACTION):** Session 038 → LiMoments §5 (termwise iterated derivation at 0, k≥2) → §6 (capstone `sigmaP_eq_neg_iteratedDeriv_gFun_div`) → root-import LiTightR + LiMoments → audit → ii′-3c. One housekeeping note: `Scratch.lean` (the old session-029 audit script) was overwritten with this session's lemma probe — the session-029 audit *results* are preserved in `audit-session029-axioms.txt`. Logged in the journal and STATE.md. Safe to shut down. See you next session.