Current task: —

← Session 21 — Tier ii′ planning + launch: close SfBoundProp in Lean (D-064)

#968 assistant 2026-08-21 21:58:45.310 UTC · 1047→1484 tok open ⤢
thinking (3323 chars)
LiPrincipal.lean compiles clean! The FTC vanishing lemma `rectInt_deriv_eq_zero` is proved, plus the linearity and side-FTC machinery. Now the remaining piece of ii′-1b(ii): the Acoeff/ppart definitions and the assembly `rectInt'_ppart : RectangleIntegral' (ppart n) z w = ResW1 n` (when 1 interior). Let me write that now: ``` def Acoeff (n i : ℕ) : ℂ := iteratedDeriv (n + 1 - i) (fun w : ℂ => (w ^ n - (w - 1) ^ n) * hLi w) 1 / (n + 1 - i)! lemma Acoeff_one (n : ℕ) : Acoeff n 1 = ResW1 n := by rw [Acoeff, ResW1] have : n + 1 - 1 = n := by omega rw [this] /-- The principal part of J at w = 1. -/ def ppart (n : ℕ) (w : ℂ) : ℂ := ∑ i ∈ Finset.Icc 1 (n + 1), Acoeff n i / (w - 1) ^ i /-- The tail primitive: G(w) = −Σ_{i=2}^{n+1} A_i/((i−1)(w−1)^{i−1}). -/ def Gprim (n : ℕ) (w : ℂ) : ℂ := ∑ i ∈ Finset.Icc 2 (n + 1), -(Acoeff n i / ((i : ℂ) - 1)) * (w - 1) ^ (-((i : ℤ) - 1)) lemma deriv_Gprim {n : ℕ} {w : ℂ} (hw : w ≠ 1) : deriv (Gprim n) w = ∑ i ∈ Finset.Icc 2 (n + 1), Acoeff n i / (w - 1) ^ i := by -- deriv of sum; deriv of (w−1)^{−(i−1)} = −(i−1)(w−1)^{−i} ... lemma ppart_eq (n : ℕ) {w : ℂ} (hw : w ≠ 1) : ppart n w = Acoeff n 1 / (w - 1) + deriv (Gprim n) w := ... ``` For deriv_Gprim: deriv of each term: f_i(w) = −(A_i/(i−1))·(w−1)^{−(i−1)} (zpow). deriv f_i = −(A_i/(i−1))·(−(i−1))(w−1)^{−(i−1)−1} = A_i·(w−1)^{−i}. Need: deriv (fun w => (w − 1) ^ (m : ℤ)) w = m·(w−1)^(m−1) — `deriv_zpow`? Let me check: `deriv_zpow (m : ℤ) (x) : deriv (fun x => x ^ m) x = m * x ^ (m - 1)`? For complex with zpow: I think `deriv_zpow` exists ✓. And (w−1)^m: composition — deriv ((w−1)^m) = m·(w−1)^{m−1}·1 ✓ via deriv_zpow + comp or directly `deriv_pow_sub...`? There might be `deriv_sub_pow_zpow`? Or compute via HasDerivAt.zpow + comp. Mechanical. Then the final assembly: ``` theorem rectInt'_ppart {n : ℕ} {z w : ℂ} (hre : z.re ≤ w.re) (him : z.im ≤ w.im) (h1 : Rectangle z w ∈ 𝓝 (1 : ℂ)) : RectangleIntegral' (ppart n) z w = ResW1 n := by -- ppart = (fun w => Acoeff n 1 / (w - 1)) + deriv (Gprim n) [EqOn off {1}, but as functions they're equal off {1}; the integral only sees the border + we can use congr] have hdecomp : Set.EqOn (ppart n) (fun w => Acoeff n 1 / (w - 1) + deriv (Gprim n) w) (RectangleBorder z w) := by intro s hs have hs1 : s ≠ 1 := not_mem_rectangleBorder_of_rectangle_mem_nhds h1 hs rw [ppart_eq _ hs1] rw [RectangleIntegral'_congr hdecomp] rw [RectangleIntegral'_add _ _ (integrability of A/(w−1)) (integrability of deriv Gprim)] · rw [ResidueTheoremInRectangle hre him h1] -- gives Acoeff n 1 rw [rectInt_deriv_eq_zero ...] -- gives 0 rw [Acoeff_one, add_zero] ``` Integrabilities: - (fun s => Acoeff n 1 / (s−1)): holomorphic off {1} ⟹ continuous on border (1 interior ⟹ border avoids 1) ⟹ RectangleBorderIntegrable via ContinuousOn.rectangleBorderIntegrable (vendored: `ContinuousOn.rectangleBorderIntegrable (hf : ContinuousOn f (Rectangle z w))` — needs continuity on the whole Rectangle (interior included — but A/(s−1) is singular at 1 INSIDE!). Hmm — the vendored `ContinuousOn.rectangleBorderNoPIntegrable` (from the agent list: exists!) — continuity on Rectangle \ {p} presumably. Let me check. - deriv (Gprim n): also singular at 1 — same treatment. Let me check `ContinuousOn.rectangleBorderNoPIntegrable`.
LiPrincipal.lean compiles clean. Now the final assembly of ii′-1b(ii) — checking the punctured-rectangle integrability helper.
tool: Bash
input
{
  "command": "grep -n \"rectangleBorderNoPIntegrable\\|rectangleBorderIntegrable\" /d/Python/Quantum/zeta-23-lean/Zeta23/FromPNTPlus/ResidueCalcOnRectangles.lean | head -8; sed -n \"$(grep -n 'theorem ContinuousOn.rectangleBorderNoPIntegrable' /d/Python/Quantum/zeta-23-lean/Zeta23/FromPNTPlus/ResidueCalcOnRectangles.lean | head -1 | cut -d: -f1),+8p\" /d/Python/Quantum/zeta-23-lean/Zeta23/FromPNTPlus/ResidueCalcOnRectangles.lean",
  "description": "Check punctured border integrability helper"
}
raw content_json (database row)
[{"type":"thinking","thinking":"LiPrincipal.lean compiles clean! The FTC vanishing lemma `rectInt_deriv_eq_zero` is proved, plus the linearity and side-FTC machinery.\n\nNow the remaining piece of ii′-1b(ii): the Acoeff/ppart definitions and the assembly `rectInt'_ppart : RectangleIntegral' (ppart n) z w = ResW1 n` (when 1 interior). Let me write that now:\n\n```\ndef Acoeff (n i : ℕ) : ℂ :=\n  iteratedDeriv (n + 1 - i) (fun w : ℂ => (w ^ n - (w - 1) ^ n) * hLi w) 1 / (n + 1 - i)!\n\nlemma Acoeff_one (n : ℕ) : Acoeff n 1 = ResW1 n := by\n  rw [Acoeff, ResW1]\n  have : n + 1 - 1 = n := by omega\n  rw [this]\n\n/-- The principal part of J at w = 1. -/\ndef ppart (n : ℕ) (w : ℂ) : ℂ :=\n  ∑ i ∈ Finset.Icc 1 (n + 1), Acoeff n i / (w - 1) ^ i\n\n/-- The tail primitive: G(w) = −Σ_{i=2}^{n+1} A_i/((i−1)(w−1)^{i−1}). -/\ndef Gprim (n : ℕ) (w : ℂ) : ℂ :=\n  ∑ i ∈ Finset.Icc 2 (n + 1), -(Acoeff n i / ((i : ℂ) - 1)) * (w - 1) ^ (-((i : ℤ) - 1))\n\nlemma deriv_Gprim {n : ℕ} {w : ℂ} (hw : w ≠ 1) :\n    deriv (Gprim n) w = ∑ i ∈ Finset.Icc 2 (n + 1), Acoeff n i / (w - 1) ^ i := by\n  -- deriv of sum; deriv of (w−1)^{−(i−1)} = −(i−1)(w−1)^{−i}\n  ...\n\nlemma ppart_eq (n : ℕ) {w : ℂ} (hw : w ≠ 1) :\n    ppart n w = Acoeff n 1 / (w - 1) + deriv (Gprim n) w := ...\n```\n\nFor deriv_Gprim: deriv of each term: f_i(w) = −(A_i/(i−1))·(w−1)^{−(i−1)} (zpow). deriv f_i = −(A_i/(i−1))·(−(i−1))(w−1)^{−(i−1)−1} = A_i·(w−1)^{−i}. Need: deriv (fun w => (w − 1) ^ (m : ℤ)) w = m·(w−1)^(m−1) — `deriv_zpow`? Let me check: `deriv_zpow (m : ℤ) (x) : deriv (fun x => x ^ m) x = m * x ^ (m - 1)`? For complex with zpow: I think `deriv_zpow` exists ✓. And (w−1)^m: composition — deriv ((w−1)^m) = m·(w−1)^{m−1}·1 ✓ via deriv_zpow + comp or directly `deriv_pow_sub...`? There might be `deriv_sub_pow_zpow`? Or compute via HasDerivAt.zpow + comp. Mechanical.\n\nThen the final assembly:\n```\ntheorem rectInt'_ppart {n : ℕ} {z w : ℂ}\n    (hre : z.re ≤ w.re) (him : z.im ≤ w.im) (h1 : Rectangle z w ∈ 𝓝 (1 : ℂ)) :\n    RectangleIntegral' (ppart n) z w = ResW1 n := by\n  -- ppart = (fun w => Acoeff n 1 / (w - 1)) + deriv (Gprim n) [EqOn off {1}, but as functions they're equal off {1}; the integral only sees the border + we can use congr]\n  have hdecomp : Set.EqOn (ppart n) (fun w => Acoeff n 1 / (w - 1) + deriv (Gprim n) w) (RectangleBorder z w) := by\n    intro s hs\n    have hs1 : s ≠ 1 := not_mem_rectangleBorder_of_rectangle_mem_nhds h1 hs\n    rw [ppart_eq _ hs1]\n  rw [RectangleIntegral'_congr hdecomp]\n  rw [RectangleIntegral'_add _ _ (integrability of A/(w−1)) (integrability of deriv Gprim)]\n  · rw [ResidueTheoremInRectangle hre him h1]  -- gives Acoeff n 1\n    rw [rectInt_deriv_eq_zero ...]  -- gives 0\n    rw [Acoeff_one, add_zero]\n```\n\nIntegrabilities:\n- (fun s => Acoeff n 1 / (s−1)): holomorphic off {1} ⟹ continuous on border (1 interior ⟹ border avoids 1) ⟹ RectangleBorderIntegrable via ContinuousOn.rectangleBorderIntegrable (vendored: `ContinuousOn.rectangleBorderIntegrable (hf : ContinuousOn f (Rectangle z w))` — needs continuity on the whole Rectangle (interior included — but A/(s−1) is singular at 1 INSIDE!). Hmm — the vendored `ContinuousOn.rectangleBorderNoPIntegrable` (from the agent list: exists!) — continuity on Rectangle \\ {p} presumably. Let me check.\n- deriv (Gprim n): also singular at 1 — same treatment.\n\nLet me check `ContinuousOn.rectangleBorderNoPIntegrable`.","signature":""},{"type":"text","text":"LiPrincipal.lean compiles clean. Now the final assembly of ii′-1b(ii) — checking the punctured-rectangle integrability helper."},{"type":"tool_use","id":"Bash_257","name":"Bash","input":{"command":"grep -n \"rectangleBorderNoPIntegrable\\|rectangleBorderIntegrable\" /d/Python/Quantum/zeta-23-lean/Zeta23/FromPNTPlus/ResidueCalcOnRectangles.lean | head -8; sed -n \"$(grep -n 'theorem ContinuousOn.rectangleBorderNoPIntegrable' /d/Python/Quantum/zeta-23-lean/Zeta23/FromPNTPlus/ResidueCalcOnRectangles.lean | head -1 | cut -d: -f1),+8p\" /d/Python/Quantum/zeta-23-lean/Zeta23/FromPNTPlus/ResidueCalcOnRectangles.lean","description":"Check punctured border integrability helper"},"extra_content":null}]