Current task: —

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

#932 assistant 2026-08-21 20:47:13.155 UTC · 1467→2723 tok open ⤢
thinking (7982 chars)
All key APIs confirmed: - `iteratedDeriv_mul` : iteratedDeriv n (f*g) x = Σ_{i ∈ range(n+1)} C(n,i)·iteratedDeriv i f x·iteratedDeriv (n−i) g x (needs ContDiffAt). - `iteratedDeriv_pow (m k : ℕ) : iteratedDeriv k (· ^ m) x = m.descFactorial k * x ^ (m - k)` — SIMP lemma! For (· ^ m) the identity function power — I'll need it for w ↦ w^n and w ↦ (w−1)^n (the latter via composition/sub). - `HolomorphicOn.vanishesOnRectangle (f_holo : HolomorphicOn f U) (hU : Rectangle z w ⊆ U) : RectangleIntegral f z w = 0` — holomorphic ⟹ zero integral. For the i ≥ 2 principal terms: A_i/(w−1)^i is NOT holomorphic at 1, so I can't use this directly on the rectangle containing 1 — but I use the pull-to-small-square + primitive-vanishing... hmm, actually for the i ≥ 2 terms: A_i/(w−1)^i has a GLOBAL primitive −A_i/((i−1)(w−1)^{i−1}) meromorphic off {1}. The rectangle integral of G' where G is single-valued: on the boundary (which avoids 1), G is differentiable; FTC per side gives telescoping = 0. Is there a ready lemma "RectangleIntegral of a derivative = 0 when the primitive is differentiable on the rectangle minus an interior point"? The vendored `ResidueTheoremOnRectangleWithSimplePole` machinery handles the simple-pole case. For higher powers, the standard trick: A_i/(w−1)^i = deriv(−A_i/((i−1)(w−1)^{i−1})) — and the rectangle integral of a derivative of a function holomorphic on a NEIGHBORHOOD of the boundary (minus nothing) — boundary avoids 1 ✓. Is there a Mathlib lemma: integral of deriv over a closed loop = 0? `RectangleIntegral` is a sum of interval integrals; each side: ∫ G'(σ + it) dt = G(end) − G(start) by `intervalIntegral.integral_deriv_eq_sub` (needs G' integrable + G differentiable at all points of the interval ✓ boundary avoids 1). Summing the four sides telescopes to 0. This is mechanical but needs care. Alternatively — realize the whole principal part evaluation differently: pull to a small square (RectanglePullToNhdOfPole''), then on the small square compute each term: A_1/(w−1) via ResidueTheoremInRectangle ✓ and A_i/(w−1)^i (i ≥ 2) — STILL needs the primitive-vanishing on the small square. Alternatively, bypass: prove "RectangleIntegral' (fun s => A/(s−p)^i) z w = 0 for i ≥ 2" via the derivative-primitive argument once, generically. That's a clean standalone lemma: ``` lemma rectInt'_inv_pow_eq_zero {z w p : ℂ} {A : ℂ} {i : ℕ} (hi : 2 ≤ i) (hp : p ∉ RectangleBorder z w) : RectangleIntegral' (fun s => A / (s - p) ^ i) z w = 0 ``` proof: A/(s−p)^i = deriv(G)(s) with G(s) = −A/((i−1)(s−p)^{i−1}); G differentiable on RectangleBorder-neighborhood (p off border ✓); per-side FTC; telescope. For FTC on segments: HIntegral (G') x₁ x₂ y = ∫_{x₁}^{x₂} G'(x + iy) dx = G(x₂+iy) − G(x₁+iy): `intervalIntegral.integral_deriv_eq_sub (h : ∀ x ∈ [[x₁,x₂]], HasDerivAt G (G' x) x) (h' : IntervalIntegrable G' ...)`. The vendored Rectangle.lean defines HIntegral as the plain interval integral of f(·+iy). So per side this works with the parametrization x ↦ G(x+iy) — chain rule: HasDerivAt (x ↦ G(x+iy)) (G'(x+iy)·1) ✓. This is all standard machinery — a few hundred lines total for ii′-1b(ii). OK. Now — one more design consideration for ii′-1b(iii) (the R side): rather than proving R = J − P holomorphic at 1 via order bookkeeping, use `HolomorphicOn` directly: R is holomorphic on Rectangle \ {zeros ∪ {−2}} — at w=1: R = J − P with P the FULL principal part, so R extends holomorphically (removable singularity). The cleanest Lean: show meromorphicOrderAt R 1 ≥ 0 via (w−1)^{n+1}·R = F − TaylorPoly_n(F) vanishing to order n+1 — hmm. Alternative: use the vendored pattern: they define the function with a Function.update at the pole... Actually — simpler: R(w) := J(w) − P(w) is meromorphic on the rectangle (difference of meromorphic) with poles only at zeros/trivial −2 — because P kills the (n+1)-order pole at 1 EXACTLY. Order bookkeeping: meromorphicOrderAt R 1 = meromorphicOrderAt (J − P) 1 ≥ min(order J, order P) but generically ≥ 0 since the principal parts match. Proving "≥ 0": (w−1)^{n+1}·R = F − Σ_{i=1}^{n+1} A_i (w−1)^{n+1−i} = F − [F^{(0)}(1)(w−1)^{n+1}/0!... wait A_i = F^{(n+1−i)}(1)/(n+1−i)! — so Σ_i A_i (w−1)^{n+1−i} = Σ_{k=0}^n [F^{(k)}(1)/k!]·(w−1)^k (k = n+1−i) — the Taylor polynomial of F of degree n at 1. So (w−1)^{n+1}R = F − Tayl_n F — vanishes to order n+1 at 1 — i.e., analyticOrderAt (F − Tayl_n F) 1 ≥ n+1 ⟹ meromorphicOrderAt R 1 ≥ 0. The Taylor-remainder order fact: for analytic F, F − its degree-n Taylor polynomial at 1 vanishes to order ≥ n+1: provable via `HasFPowerSeriesAt` (F has power series Σ a_k (w−1)^k; F − Tayl_n = Σ_{k≥n+1} a_k (w−1)^k = (w−1)^{n+1}·(Σ_{k≥0} a_{n+1+k}(w−1)^k) — the inner is analytic ✓). Mathlib: `HasFPowerSeriesAt` API — `HasFPowerSeriesAt.exists_...`; there's `AnalyticAt.exists_...`... The `analyticOrderAt` API: `AnalyticAt.analyticOrderAt_eq_...`... This might take some digging but it's standard. OK — the plan is solid. Let me now check two more API areas quickly: (1) meromorphicOrderAt of R bookkeeping isn't even needed if I can show `HolomorphicOn R (Rectangle \ poles)` differently — hmm, the vendored rectangle theorem needs `MeromorphicOn R (Rectangle)` + `HasSimplePolesOn R (Rectangle)` + poles finite + no boundary poles. MeromorphicOn R: R = J − P: J = k_n(w−1)·(−ζ′/ζ): meromorphic wherever ζ′/ζ is (Mathlib: ζ′/ζ meromorphic? ζ is analytic off 1 (vendored analyticAt_riemannZeta), deriv of analytic is analytic, quotient by nonvanishing analytic... ζ′/ζ meromorphic on ℂ: ζ analytic off {1}; at zeros of ζ, 1/ζ is meromorphic ✓ so ζ′/ζ meromorphic off {1}; at 1, ζ has a simple pole ⟹ ζ′/ζ meromorphic ✓. So J meromorphic on the rectangle ✓; P rational ✓; R meromorphic ✓. HasSimplePolesOn R (Rectangle): at zeros ρ: order = −1 (logDeriv simple pole regardless of mult ✓); at −2: order −1 ✓; at 1: order ≥ 0 (the order computation above); everywhere else: analytic ✓. So the only real work is the order-at-1 ≥ 0. (2) The poles-finite: {poles of R in Rectangle} ⊆ {nontrivial zeros in Rectangle} ∪ {−2}: nontrivial zeros in the rectangle are finite (compact ∩ discrete — Mathlib `IsCompact.inter_riemannZetaZeros_finite` — the rectangle is compact ✓ but IsNontrivialZero ⊆ riemannZetaZeros needs re∈(0,1)... the rectangle also contains trivial zeros −2 (and possibly ζ's zero at other points? riemannZetaZeros includes ALL zeros: trivial −2k and nontrivial. In the rectangle [−2.5, 2√n]×[−T,T]: trivial zeros: −2 only; nontrivial: finite ✓; also potential zeros at... ζ(0) = −1/2 ≠ 0 ✓; so riemannZetaZeros ∩ Rectangle = {−2} ∪ {nontrivial} — finite ✓). Alright — let me now also plan the residue VALUE computation at zeros for R (iii): R = J − P; near a zero ρ (≠ 1), P is analytic, so Res(R, ρ) = Res(J, ρ) = k_n(ρ−1)·(−mult). The vendored rectangle theorem gives ∮ R = Σ Res(R, ρ) via the `residue` placeholder (simple-pole limit): residue R ρ = lim (s−ρ)R(s) = lim (s−ρ)J(s) = k_n(ρ−1)·lim (s−ρ)(−ζ′/ζ(s)) = k_n(ρ−1)·(−zeroMult ρ) — via `logDerivResidue` (vendored: for f with simple pole... actually the vendored logDerivResidue is about f'/f of a function f with a SIMPLE pole; our need: −ζ′/ζ at a ZERO ρ of order m: ζ'/ζ has simple pole with residue +m: the vendored ZetaBounds has... the right lemma: for f analytic near ρ with f(ρ) = 0 and f not locally 0: f'/f − m/(s−ρ) bounded — that's `logDerivResidue`-family? The vendored ones are stated for SIMPLE poles of f (residue A ≠ 0)... Let me check what's available for zeros of higher multiplicity — the analyticOrderAt API: meromorphicOrderAt (f'/f) ρ = −1 and residue = analyticOrderAt f ρ — Mathlib may have `MeromorphicAt.logDeriv_...`? There IS API: `MeromorphicAt.meromorphicOrderAt_logDeriv`? or the trailing-coefficient: `meromorphicTrailingCoeffAt (deriv f / f) x = meromorphicOrderAt f x`? Hmm — Mathlib's TrailingCoefficient.lean: `meromorphicTrailingCoeffAt (logDeriv f) x = meromorphicOrderAt f x` — something like that would give residue = order directly. Let me grep.
All APIs confirmed. One more check — the log-derivative residue at zeros of arbitrary multiplicity.
tool: Bash
input
{
  "command": "cd /d/Python/Quantum/zeta-23-lean/.lake/packages/mathlib && grep -rn \"logDeriv\" Mathlib/Analysis/Meromorphic/TrailingCoefficient.lean | head -8; grep -rn \"meromorphicTrailingCoeffAt.*logDeriv\\|logDeriv.*meromorphicOrderAt\\|residue.*logDeriv\" Mathlib/Analysis/Meromorphic/*.lean | head -8",
  "description": "Check logDeriv trailing coefficient API"
}
raw content_json (database row)
[{"type":"thinking","thinking":"All key APIs confirmed:\n- `iteratedDeriv_mul` : iteratedDeriv n (f*g) x = Σ_{i ∈ range(n+1)} C(n,i)·iteratedDeriv i f x·iteratedDeriv (n−i) g x (needs ContDiffAt).\n- `iteratedDeriv_pow (m k : ℕ) : iteratedDeriv k (· ^ m) x = m.descFactorial k * x ^ (m - k)` — SIMP lemma! For (· ^ m) the identity function power — I'll need it for w ↦ w^n and w ↦ (w−1)^n (the latter via composition/sub).\n- `HolomorphicOn.vanishesOnRectangle (f_holo : HolomorphicOn f U) (hU : Rectangle z w ⊆ U) : RectangleIntegral f z w = 0` — holomorphic ⟹ zero integral. For the i ≥ 2 principal terms: A_i/(w−1)^i is NOT holomorphic at 1, so I can't use this directly on the rectangle containing 1 — but I use the pull-to-small-square + primitive-vanishing... hmm, actually for the i ≥ 2 terms: A_i/(w−1)^i has a GLOBAL primitive −A_i/((i−1)(w−1)^{i−1}) meromorphic off {1}. The rectangle integral of G' where G is single-valued: on the boundary (which avoids 1), G is differentiable; FTC per side gives telescoping = 0. Is there a ready lemma \"RectangleIntegral of a derivative = 0 when the primitive is differentiable on the rectangle minus an interior point\"? The vendored `ResidueTheoremOnRectangleWithSimplePole` machinery handles the simple-pole case. For higher powers, the standard trick: A_i/(w−1)^i = deriv(−A_i/((i−1)(w−1)^{i−1})) — and the rectangle integral of a derivative of a function holomorphic on a NEIGHBORHOOD of the boundary (minus nothing) — boundary avoids 1 ✓. Is there a Mathlib lemma: integral of deriv over a closed loop = 0? `RectangleIntegral` is a sum of interval integrals; each side: ∫ G'(σ + it) dt = G(end) − G(start) by `intervalIntegral.integral_deriv_eq_sub` (needs G' integrable + G differentiable at all points of the interval ✓ boundary avoids 1). Summing the four sides telescopes to 0. This is mechanical but needs care. Alternatively — realize the whole principal part evaluation differently: pull to a small square (RectanglePullToNhdOfPole''), then on the small square compute each term: A_1/(w−1) via ResidueTheoremInRectangle ✓ and A_i/(w−1)^i (i ≥ 2) — STILL needs the primitive-vanishing on the small square.\n\nAlternatively, bypass: prove \"RectangleIntegral' (fun s => A/(s−p)^i) z w = 0 for i ≥ 2\" via the derivative-primitive argument once, generically. That's a clean standalone lemma:\n```\nlemma rectInt'_inv_pow_eq_zero {z w p : ℂ} {A : ℂ} {i : ℕ} (hi : 2 ≤ i) (hp : p ∉ RectangleBorder z w) :\n    RectangleIntegral' (fun s => A / (s - p) ^ i) z w = 0\n```\nproof: A/(s−p)^i = deriv(G)(s) with G(s) = −A/((i−1)(s−p)^{i−1}); G differentiable on RectangleBorder-neighborhood (p off border ✓); per-side FTC; telescope.\n\nFor FTC on segments: HIntegral (G') x₁ x₂ y = ∫_{x₁}^{x₂} G'(x + iy) dx = G(x₂+iy) − G(x₁+iy): `intervalIntegral.integral_deriv_eq_sub (h : ∀ x ∈ [[x₁,x₂]], HasDerivAt G (G' x) x) (h' : IntervalIntegrable G' ...)`. The vendored Rectangle.lean defines HIntegral as the plain interval integral of f(·+iy). So per side this works with the parametrization x ↦ G(x+iy) — chain rule: HasDerivAt (x ↦ G(x+iy)) (G'(x+iy)·1) ✓.\n\nThis is all standard machinery — a few hundred lines total for ii′-1b(ii). OK.\n\nNow — one more design consideration for ii′-1b(iii) (the R side): rather than proving R = J − P holomorphic at 1 via order bookkeeping, use `HolomorphicOn` directly: R is holomorphic on Rectangle \\ {zeros ∪ {−2}} — at w=1: R = J − P with P the FULL principal part, so R extends holomorphically (removable singularity). The cleanest Lean: show meromorphicOrderAt R 1 ≥ 0 via (w−1)^{n+1}·R = F − TaylorPoly_n(F) vanishing to order n+1 — hmm. Alternative: use the vendored pattern: they define the function with a Function.update at the pole... \n\nActually — simpler: R(w) := J(w) − P(w) is meromorphic on the rectangle (difference of meromorphic) with poles only at zeros/trivial −2 — because P kills the (n+1)-order pole at 1 EXACTLY. Order bookkeeping: meromorphicOrderAt R 1 = meromorphicOrderAt (J − P) 1 ≥ min(order J, order P) but generically ≥ 0 since the principal parts match. Proving \"≥ 0\": (w−1)^{n+1}·R = F − Σ_{i=1}^{n+1} A_i (w−1)^{n+1−i} = F − [F^{(0)}(1)(w−1)^{n+1}/0!... wait A_i = F^{(n+1−i)}(1)/(n+1−i)! — so Σ_i A_i (w−1)^{n+1−i} = Σ_{k=0}^n [F^{(k)}(1)/k!]·(w−1)^k (k = n+1−i) — the Taylor polynomial of F of degree n at 1. So (w−1)^{n+1}R = F − Tayl_n F — vanishes to order n+1 at 1 — i.e., analyticOrderAt (F − Tayl_n F) 1 ≥ n+1 ⟹ meromorphicOrderAt R 1 ≥ 0. The Taylor-remainder order fact: for analytic F, F − its degree-n Taylor polynomial at 1 vanishes to order ≥ n+1: provable via `HasFPowerSeriesAt` (F has power series Σ a_k (w−1)^k; F − Tayl_n = Σ_{k≥n+1} a_k (w−1)^k = (w−1)^{n+1}·(Σ_{k≥0} a_{n+1+k}(w−1)^k) — the inner is analytic ✓). Mathlib: `HasFPowerSeriesAt` API — `HasFPowerSeriesAt.exists_...`; there's `AnalyticAt.exists_...`... The `analyticOrderAt` API: `AnalyticAt.analyticOrderAt_eq_...`... This might take some digging but it's standard.\n\nOK — the plan is solid. Let me now check two more API areas quickly: (1) meromorphicOrderAt of R bookkeeping isn't even needed if I can show `HolomorphicOn R (Rectangle \\ poles)` differently — hmm, the vendored rectangle theorem needs `MeromorphicOn R (Rectangle)` + `HasSimplePolesOn R (Rectangle)` + poles finite + no boundary poles. MeromorphicOn R: R = J − P: J = k_n(w−1)·(−ζ′/ζ): meromorphic wherever ζ′/ζ is (Mathlib: ζ′/ζ meromorphic? ζ is analytic off 1 (vendored analyticAt_riemannZeta), deriv of analytic is analytic, quotient by nonvanishing analytic... ζ′/ζ meromorphic on ℂ: ζ analytic off {1}; at zeros of ζ, 1/ζ is meromorphic ✓ so ζ′/ζ meromorphic off {1}; at 1, ζ has a simple pole ⟹ ζ′/ζ meromorphic ✓. So J meromorphic on the rectangle ✓; P rational ✓; R meromorphic ✓.\nHasSimplePolesOn R (Rectangle): at zeros ρ: order = −1 (logDeriv simple pole regardless of mult ✓); at −2: order −1 ✓; at 1: order ≥ 0 (the order computation above); everywhere else: analytic ✓. So the only real work is the order-at-1 ≥ 0.\n\n(2) The poles-finite: {poles of R in Rectangle} ⊆ {nontrivial zeros in Rectangle} ∪ {−2}: nontrivial zeros in the rectangle are finite (compact ∩ discrete — Mathlib `IsCompact.inter_riemannZetaZeros_finite` — the rectangle is compact ✓ but IsNontrivialZero ⊆ riemannZetaZeros needs re∈(0,1)... the rectangle also contains trivial zeros −2 (and possibly ζ's zero at other points? riemannZetaZeros includes ALL zeros: trivial −2k and nontrivial. In the rectangle [−2.5, 2√n]×[−T,T]: trivial zeros: −2 only; nontrivial: finite ✓; also potential zeros at... ζ(0) = −1/2 ≠ 0 ✓; so riemannZetaZeros ∩ Rectangle = {−2} ∪ {nontrivial} — finite ✓).\n\nAlright — let me now also plan the residue VALUE computation at zeros for R (iii): R = J − P; near a zero ρ (≠ 1), P is analytic, so Res(R, ρ) = Res(J, ρ) = k_n(ρ−1)·(−mult). The vendored rectangle theorem gives ∮ R = Σ Res(R, ρ) via the `residue` placeholder (simple-pole limit): residue R ρ = lim (s−ρ)R(s) = lim (s−ρ)J(s) = k_n(ρ−1)·lim (s−ρ)(−ζ′/ζ(s)) = k_n(ρ−1)·(−zeroMult ρ) — via `logDerivResidue` (vendored: for f with simple pole... actually the vendored logDerivResidue is about f'/f of a function f with a SIMPLE pole; our need: −ζ′/ζ at a ZERO ρ of order m: ζ'/ζ has simple pole with residue +m: the vendored ZetaBounds has... the right lemma: for f analytic near ρ with f(ρ) = 0 and f not locally 0: f'/f − m/(s−ρ) bounded — that's `logDerivResidue`-family? The vendored ones are stated for SIMPLE poles of f (residue A ≠ 0)... Let me check what's available for zeros of higher multiplicity — the analyticOrderAt API: meromorphicOrderAt (f'/f) ρ = −1 and residue = analyticOrderAt f ρ — Mathlib may have `MeromorphicAt.logDeriv_...`? There IS API: `MeromorphicAt.meromorphicOrderAt_logDeriv`? or the trailing-coefficient: `meromorphicTrailingCoeffAt (deriv f / f) x = meromorphicOrderAt f x`? Hmm — Mathlib's TrailingCoefficient.lean: `meromorphicTrailingCoeffAt (logDeriv f) x = meromorphicOrderAt f x` — something like that would give residue = order directly. Let me grep.","signature":""},{"type":"text","text":"All APIs confirmed. One more check — the log-derivative residue at zeros of arbitrary multiplicity."},{"type":"tool_use","id":"Bash_176","name":"Bash","input":{"command":"cd /d/Python/Quantum/zeta-23-lean/.lake/packages/mathlib && grep -rn \"logDeriv\" Mathlib/Analysis/Meromorphic/TrailingCoefficient.lean | head -8; grep -rn \"meromorphicTrailingCoeffAt.*logDeriv\\|logDeriv.*meromorphicOrderAt\\|residue.*logDeriv\" Mathlib/Analysis/Meromorphic/*.lean | head -8","description":"Check logDeriv trailing coefficient API"},"extra_content":null}]