Current task: —

← Session 22 — ii′-1: liCoeff pairing fix + residue machinery

#1072 assistant 2026-08-22 06:44:37.587 UTC · 1568→5366 tok open ⤢
thinking (14091 chars)
`iteratedDerivWithin_tsum (m) (hs : IsOpen s) (hx : x ∈ s) (hsum : ∀ t ∈ s, Summable (f · t)) (h : ∀ k, 1 ≤ k → k ≤ m → SummableLocallyUniformlyOn (fun n => iteratedDerivWithin k (fun z => f n z) s) s) (hf2 : differentiability) : iteratedDerivWithin m (fun z ↦ ∑' n, f n z) s x = ∑' n, iteratedDerivWithin m (f n) s x`. This is for 𝕜 = ℂ (IsRCLikeNormedField). So the complex side can be done DIRECTLY with this lemma, no real interchange needed for the iterated part! The architecture simplifies dramatically: **Revised piece (A) part 2+ plan (all complex, on a ball around 1/2):** Define the complex series function on a domain U (open, containing 1/2, avoiding poles): D(s) := −γ − 1/s + ∑' m : ℕ, (1/(m+1:ℂ) − 1/(s + m + 1)) [over ℕ with m+1] On U := ball (1/2) (1/2) (say — avoids 0 and all −m... wait |s−1/2| < 1/2 ⟹ re s ∈ (0,1) — avoids 0 and −m ✓ but s could approach 1 — fine, digamma analytic at 1 ✓ hmm — ball(1/2, 1/2) contains points with re up to 1 — 1 not a pole ✓ OK). Lemmas: 1. Summable (fun m => (1/(m+1:ℂ) − 1/(s+m+1))) for s ∈ U: |term| = |s|/(|m+1|·|s+m+1|) ≤ C/m² — via comparison with the complex p-series: Summable (fun m : ℕ => 1/(‖m+1‖...)) — hmm — complex summability via norm comparison with the real p-series: Summable.of_norm_bounded or summable_of_norm_bounded: `Summable (fun m => C/((m+1):ℝ)^2)`-majorant. ✓ 2. The derivative series: iteratedDerivWithin k (fun s => (1/(m+1) − 1/(s+m+1))) U = −iteratedDerivWithin k (fun s => (s+m+1)⁻¹) U = −(−1)^k k! (s+m+1)^{−(k+1)} — the iterated deriv of (s + c)⁻¹: (−1)^k k! (s+c)^{−(k+1)} — provable by induction (deriv of (s+c)^{−n} = −n(s+c)^{−(n+1)}) — a helper lemma `iteratedDerivWithin_inv_add_const` or via zpow: (s+c)⁻¹ = (s+c)^(−1:ℤ) — `iteratedDerivWithin_zpow`? hmm — might not exist Within — prove by induction with derivWithin_zpow? There's `iteratedDeriv_zpow...`? Let me just do an induction: claim iteratedDerivWithin k (fun s => (s + c)⁻¹) U x = (−1)^k·k!·(x+c)^(−(k+1):ℤ) — for x ∈ U (open): derivWithin = deriv (open) — then induction: base k=0: (x+c)^{−1} ✓ (0! = 1, (−1)⁰ = 1); step: deriv of (−1)^k k! (s+c)^{−(k+1)} = (−1)^k k!·(−(k+1))(s+c)^{−(k+2)} = (−1)^{k+1}(k+1)!(s+c)^{−(k+2)} ✓ — via deriv_const_mul + deriv zpow — `hasDerivAt_zpow` (used in LiPrincipal ✓ hasDerivAt_zpow (−(k+1):ℤ) (x+c) (Or.inl ne)) ✓. SummableLocallyUniformlyOn of that: |−(−1)^k k!(s+m+1)^{−(k+1)}| ≤ k!·C/|m+1|^{k+1}·(adjust for |s+m+1| ≥ (m+1)/2 on U) — ≤ C'_k/m^{k+1} — summable for k ≥ 1 ✓ — the SummableLocallyUniformlyOn from `SummableLocallyUniformlyOn_of_locally_bounded` (line 56!) — which needs a locally bounded dominator family — or `SummableLocallyUniformlyOn.of_locally_bounded_eventually` — with the bound u(m) = C_k/(m+1)^{k+1}... — the signature: SummableLocallyUniformlyOn_of_locally_bounded [LocallyCompactSpace β] (hu : ∀ K ⊆ s, IsCompact K → ∃ u, Summable u ∧ ∀ n x ∈ K, ‖f n x‖ ≤ u n)? — something like that (line 56). ℂ is locally compact ✓. So: for each compact K ⊆ U, the bound u(m) := k!·sup_{x∈K}|...| — with |x+m+1| ≥ (m+1)/2 on K (bounded away) ✓ — take u m := k!·C_K/(m+1)^{k+1} — Summable (p-series k+1 ≥ 2 ✓) ✓. 3. Then iteratedDerivWithin_tsum gives: iteratedDerivWithin m D-series-part U x = Σ_m [−(−1)^m m!(x+m+1)^{−(m+1)}] for x ∈ U, m ≥ 1. And the −γ − 1/s part: iteratedDerivWithin m of −γ − 1/s = −(−1)^m m! s^{−(m+1)} — the m = 0-series-term form ✓ (fits: m = −1... the −1/s term = the m+1 = 0 case... hmm — actually combine: D(s) = −γ + Σ_{m≥0} −(s+m)^{−1}·... wait: −1/s + Σ_{m≥1}(1/m − 1/(s+m)) = −γ + Σ_{m≥0}[if m = 0 then −1/s else (1/m − 1/(s+m))] — let me just define D via the m≥0 family directly: D(s) := −γ + ∑' m : ℕ, (if m = 0 then −1/s else (1/(m:ℂ) − 1/(s + m))) — the m = 0 term: −1/s ✓; m ≥ 1: 1/m − 1/(s+m) ✓. Hmm — if-then-else in the summand — the iteratedDerivWithin of the m=0 term is −(−1)^k k! s^{−(k+1)} ✓ and for m ≥ 1: −(−1)^k k!(s+m)^{−(k+1)} — both = −(−1)^k k!(s+m)^{−(k+1)} (for m = 0: the 1/m part's derivative is 0 for k ≥ 1 ✓ since 1/m is a constant — WAIT the m ≥ 1 term's k-th deriv: (1/m const → 0) + (−(s+m)^{−1})'s = −(−1)^k k!(s+m)^{−(k+1)} ✓ and m=0's: (−1/s)'s k-th = −(−1)^k k! s^{−(k+1)} ✓ — uniform: iteratedDerivWithin k (term m) = −(−1)^k k! (s + m)^{−(k+1)} for ALL m ✓✓ clean! So iteratedDerivWithin k D U x = −γ-part (0 for k ≥ 1) + Σ_m [−(−1)^k k!(x+m)^{−(k+1)}] = −(−1)^k k! Σ_{m≥0} (x+m)^{−(k+1)} ✓✓ — EXACTLY the polygamma series, all complex, in one shot. 4. The identity with digamma: D = digamma on U. Hmm — THIS still needs the real seed (logGammaSeq → real series — for the identity). The identity principle needs agreement on a set with a limit point — the real segment (0,1) — so I DO need the real identity on (0,1): digamma(↑x) = D(↑x) for real x ∈ (0,1). Via: digamma(↑x) = ↑(ψ_real x) and D(↑x) = ↑(Dinf-real x) and ψ_real = Dinf-real (the real interchange work). Hmm — so the real deriv-interchange is still needed for the j=0-level identity (ψ_real = Dinf). UNLESS there's a direct way to pin the complex digamma to the series... Alternative for the identity: use digamma_apply_add_one (recurrence, in Mathlib ✓) + the series' recurrence + a decay-at-infinity argument: both digamma and D satisfy f(s+1) = f(s) + 1/s; if their difference has period 1 and tends to 0 on vertical strips as re → ∞... digamma(s) − log s → 0 (needs digamma asymptotics — not in Mathlib)... hmm same asymptotic issue. OR: prove the identity at ONE real point via the series + use the recurrence to extend... no — the identity principle needs agreement on an open set / accumulation set. A single point isn't enough. So the real-side identity IS needed. Its content: for real x > 0: digamma ↑x = D ↑x. Via the real interchange: ψ_real(x) := deriv (log∘Real.Gamma) x = Dinf x (the real series) — that needs hasDerivAt_of_tendstoLocallyUniformlyOn for ℝ (works for ℝ too — it's 𝕜-generic ✓ — wait — IsRCLikeNormedField 𝕜 — ℝ is RCLike ✓). So: Real side (needed only for the j = 0 function identity, not the iterated): - Dinf(x) := −γ + Σ_{m≥0} [if m = 0 then −1/x else (1/m − 1/(x+m))] (real version). - deriv (Real.log ∘ Real.Gamma) x = Dinf x for x > 0 — via logGammaSeq + the interchange lemma. The pieces: logGammaSeq x n = x log n + log n! − Σ_{m=0}^n log(x+m) → log Γ(x) (tendsto_log_gamma ✓); its x-derivative: log n − Σ_{m=0}^n 1/(x+m) → Dinf x locally uniformly — decompose: log n − Σ_{m=0}^n 1/(x+m) = [log n − H_n] + [−1/x + Σ_{m=1}^n (1/m − 1/(x+m))] — wait sign: log n − Σ_{m=0}^n 1/(x+m) = log n − H_n + H_n − Σ_{m=0}^n 1/(x+m) = (log n − H_n) + Σ_{m=1}^n (1/m − 1/(x+m)) − 1/x ✓. And H_n = harmonic n = Σ_{i<n} 1/(i+1) ✓. So the deriv sequence = (log n − harmonic n) + (−1/x + Σ_{m=1}^n (1/m − 1/(x+m))) — first → −γ pointwise (tendsto_harmonic_sub_log ✓ — it's independent of x so locally uniform trivially — TendstoLocallyUniformlyOn of a constant-in-x sequence from pointwise: `TendstoLocallyUniformlyOn.of_const`? — a constant sequence (in x) converging pointwise converges locally uniformly — there should be a trivial lemma); second: −1/x const-in-n + partial sums of the series → locally uniform by M-test. - So the interchange gives HasDerivAt (log ∘ Gamma) (Dinf x) x ⟹ deriv (log∘Gamma) x = Dinf x for x > 0. - ψ_real bridge: deriv (log ∘ Real.Gamma) x = Real.Gamma' x / Real.Gamma x (chain rule) and digamma(↑x) = ↑(Real.Gamma' x / Real.Gamma x) (the ofReal bridges) — so digamma(↑x) = ↑(Dinf x). - And D(↑x) = ↑(Dinf x): the complex tsum of real-cast terms = cast of the real tsum — `Complex.ofReal_tsum`? — `map_tsum` with Complex.ofRealCLM: (ContinuousLinearMap).map_tsum? — there's `ContinuousLinearMap.map_tsum (hf : Summable g)? : L (∑' g) = ∑' L ∘ g`? hmm — `map_tsum (g : E →L[𝕜] F) (hf : Summable f) : g (∑' i, f i) = ∑' i, g (f i)` — I recall `map_tsum` exists in that form (or `ContinuousLinearMap.map_tsum`). For ofRealCLM: ofRealCLM (∑' re) = ∑' (ofReal ∘ ·) ✓. And the ofReal-cast of the real series terms = the complex series terms: ↑(1/m − 1/(x+m)) = 1/↑m − 1/(↑x+↑m) (push_cast) ✓ and ↑(−1/x) = −1/↑x ✓. So D(↑x) = ↑(Dinf x) ✓. - Then digamma(↑x) = D(↑x) for x ∈ (0,1) real ✓. - Identity principle: digamma = D on U (ball around 1/2): both analytic on U; agree on {↑x : x ∈ (0,1)} ∩ U — which has an accumulation point in U ✓ — Mathlib's identity principle: `AnalyticOnNhd.eq_on_of_preconnected_of_frequently_eq`? — the form I need: f, g analytic on open connected U, and f = g on a subset with a limit point in U — `AnalyticOnNhd.eq_of_preconnected_of_frequently_eq (hf : AnalyticOnNhd ℂ f U) (hg : ...) (hU : IsPreconnected U) (hz : z ∈ U) (hfg : ∃ᶠ w in 𝓝[≠] z ∩ U-ish, f w = g w)`? — hmm — there's `AnalyticOnNhd.eq_on_of_preconnected_of_frequently_eq` — I saw `isClopen_setOfPred_analyticOrderAt_eq_top` style stuff in Order.lean; the identity principle should be in Mathlib/Analysis/Analytic/Uniqueness.lean — `AnalyticOnNhd.eq_on_of_preconnected_of_frequently_eq`? or `AnalyticOnNhd.eq_on_of_preconnected_of_mem_nhds` (agree on a nhd of a point) — the latter is easier to use: if I show digamma = D on a whole small real-interval... no — the nhds form needs agreement on a NEIGHBORHOOD (2D open) — I only have the real segment. So the frequently-accumulation form: frequently at a point of U: take z₀ = ↑(1/2): every punctured nhd of 1/2 meets {real points} where they agree — ∃ᶠ w in 𝓝[≠] (↑(1/2)), w ∈ U ∧ ... hmm — the real points ↑(x) with x ∈ (0,1), x ≠ 1/2 accumulate at ↑(1/2) ✓ (frequently in 𝓝[≠]). The exact lemma name — let me find it: `AnalyticOnNhd.eq_on_of_preconnected_of_frequently_eq`? grep at build. - Then iteratedDeriv j digamma (1/2) = iteratedDeriv j D (1/2) (eventual equality on the ball — via a small helper using EventuallyEq.deriv_eq induction — or directly: they're equal on the open ball, so `iteratedDeriv_congr`-ish: functions equal on a nhd have equal iteratedDerivs — `Filter.EventuallyEq.iteratedDeriv_eq`? — let me check for that too). - iteratedDeriv vs iteratedDerivWithin: my tsum lemma gives iteratedDerivWithin on U; for x interior and U open: iteratedDerivWithin m f U x = iteratedDeriv m f x (IsOpen: `iteratedDerivWithin_of_isOpen`? — `iteratedDerivWithin_of_isOpen (hs : IsOpen s) (hx : x ∈ s) : iteratedDerivWithin n f s x = iteratedDeriv n f x`? — hmm — there's `iteratedDerivWithin_of_isOpen` ✓ I believe). So the full piece (A) remaining work: (A2) real series Dinf + summability + the logGammaSeq deriv-sequence locally-uniform convergence + interchange ⟹ deriv (log∘Real.Gamma) = Dinf on (0,∞). (A3) ψ_real bridge: digamma(↑x) = ↑(Dinf x). (A4) complex D: summability + analytic on U + D(↑x) = ↑(Dinf x) ⟹ digamma = D on U (identity principle). (A5) iteratedDerivWithin_tsum for D's iterated derivatives ⟹ iteratedDeriv j digamma (1/2) = (−1)^{j+1} j! Σ_m (1/2 + m)^{−(j+1)} for j ≥ 1. (A6) reindex Σ_{m≥0}(1/2 + m)^{−(j+1)} = 2^{j+1}·lagariasA(j+1): (1/2 + m)^{−(j+1)} = 2^{j+1}/(2m+1)^{j+1} — so Σ = 2^{j+1} Σ_{m≥0} (2m+1)^{−(j+1)} — and Σ_{m≥0}(2m+1)^{−(j+1)} = lagariasA(j+1) — via the equiv ℕ ≃ {odd}: m ↦ 2m+1 + the peel: lagariasA (j+1) = 1 + Σ_{m : {odd ∧ ≥3}} ... — hmm — Σ_{m≥0}(2m+1)^{−(j+1)} is over ℕ with terms at 1, 3, 5... = 1 + Σ_{m≥1}(2m+1)^{−(j+1)} [tsum_eq_zero_add] = 1 + Σ_{m≥0}(2m+3)^{−(j+1)} [reindex m ↦ m+1 — `tsum_eq...`? — the shift: Σ_{m≥1} f(m) = Σ_{m≥0} f(m+1) — `tsum_eq...`? — there's `tsum_eq_zero_add` and the shift equivalence]. Then Σ_{m≥0}(2m+3)^{−(j+1)} = Σ_{m : {odd ∧ ≥3}} m^{−(j+1)} via the equiv m ↦ 2m+3 : ℕ ≃ {m // Odd m ∧ 3 ≤ m} (bespoke, as designed in D-066) + Equiv.tsum_eq ✓. (A7) the (1+s)/2 comp + factorial assembly into the final τ_j statement: iteratedDeriv j (fun s => logDeriv Gammaℝ (1+s)) 0 = (−1)^{j+1} j! lagariasA(j+1): - j = 0: logDeriv_Gammaℝ_one ✓ DONE (the statement there: = −lagariasA1 — the form (−1)^{0+1}·0!·↑lagariasA(0+1) = −↑lagariasA1 — lagariasA 1 = lagariasA1 by if_pos rfl ✓ — bridge lemma). - j ≥ 1: from the split (logDeriv_Gammaℝ_one_add — its iteratedDeriv at 0 — the split is an equality of the FUNCTIONS at a point — I need it as an eventuallyEq on a nhd of 0: logDeriv_Gammaℝ_one_add holds for all s with the two nonvanishing hyps — both hold on a nhd of 0 (Gamma((1+s)/2) ≠ 0 near 0 ✓ since Gamma(1/2) ≠ 0 + continuity; the (1+s)/2 ≠ −m condition: at s near 0, (1+s)/2 near 1/2 — nonzero distance from −m ✓ eventually). So the functions agree on a nhd ⟹ iteratedDerivs equal: iteratedDeriv j (logDeriv Gammaℝ (1+·)) 0 = iteratedDeriv j (fun s => −(log π)/2 + (1/2)·digamma((1+s)/2)) 0 = (1/2)·iteratedDeriv j (digamma((1+·)/2)) 0 (j ≥ 1 kills the constant) = (1/2)·(1/2)^j·iteratedDeriv j digamma (1/2)·... — the comp with the affine map s ↦ (1+s)/2: iteratedDeriv j (digamma ∘ (fun s => (1+s)/2)) 0 = (1/2)^j·iteratedDeriv j digamma (1/2) — the affine comp lemma: iteratedDeriv_comp for s ↦ a + c·s: (1+s)/2 = 1/2 + (1/2)·s — iteratedDeriv_comp_add_const + iteratedDeriv_comp_const_mul... — is there `iteratedDeriv_comp_const_mul`? hmm — for (c·s): iteratedDeriv n (f ∘ (c·)) x = c^n · iteratedDeriv n f (c·x) — there's `iteratedDeriv_comp_smul`? or I derive: f(c·s) — chain rule induction — or maybe there's `iteratedDeriv_comp_mul_const`? — let me search at build. Worst case: induction on j with deriv comp: deriv (f ∘ (c·)) x = c·(deriv f)(c·x) — `deriv_comp_const_mul`? there's `deriv.scomp`? — or `HasDerivAt.comp` with const_mul — then iterate via a small induction — I'll write a bespoke `iteratedDeriv_digamma_half` comp lemma if needed. OK — this is a lot but each piece is now mapped to verified Mathlib machinery. It's late (~23:10). Given the size, I'll continue tomorrow/this-session as far as I get, committing incrementally. Let me start with (A2)'s real-series infrastructure in a new section of LiArchimedean.lean... — actually, let me create a separate file LiDigamma.lean for the series work (cleaner; LiArchimedean.lean stays the assembly file). Actually — before writing, let me quickly verify the two risky names: the identity principle form and map_tsum/iteratedDerivWithin_of_isOpen, and TendstoLocallyUniformlyOn.add / const. Let me batch-grep.
`iteratedDerivWithin_tsum` exists — the complex side gets much cleaner. Verifying the remaining risky names before writing the digamma-series file.
tool: Bash ok
input
{
  "command": "cd \"D:/Python/Quantum/zeta-23-lean/.lake/packages/mathlib\" && grep -rn \"eq_on_of_preconnected\\|eq_of_preconnected_of_frequently\" Mathlib/Analysis/Analytic/Uniqueness.lean | head -6; echo ===; grep -rn \"theorem map_tsum\\|lemma map_tsum\\|ContinuousLinearMap.map_tsum\" Mathlib/Topology/Algebra/InfiniteSum/*.lean | head -4; echo ===; grep -rn \"theorem iteratedDerivWithin_of_isOpen\\|lemma iteratedDerivWithin_of_isOpen\" Mathlib/ -r --include=\"*.lean\" | head -2",
  "description": "Check identity principle, map_tsum, iteratedDerivWithin_of_isOpen"
}
result 2026-08-22 06:44:37Z → 2026-08-26 06:49:56Z
1387:theorem integral_nonneg_of_forall (hab : a ≤ b) (hf : ∀ u, 0 ≤ f u) : 0 ≤ ∫ u in a..b, f u ∂μ :=
1390:theorem integral_nonneg (hab : a ≤ b) (hf : ∀ u, u ∈ Icc a b → 0 ≤ f u) : 0 ≤ ∫ u in a..b, f u ∂μ :=
raw content_json (database row)
[{"type":"thinking","thinking":"`iteratedDerivWithin_tsum (m) (hs : IsOpen s) (hx : x ∈ s) (hsum : ∀ t ∈ s, Summable (f · t)) (h : ∀ k, 1 ≤ k → k ≤ m → SummableLocallyUniformlyOn (fun n => iteratedDerivWithin k (fun z => f n z) s) s) (hf2 : differentiability) : iteratedDerivWithin m (fun z ↦ ∑' n, f n z) s x = ∑' n, iteratedDerivWithin m (f n) s x`.\n\nThis is for 𝕜 = ℂ (IsRCLikeNormedField). So the complex side can be done DIRECTLY with this lemma, no real interchange needed for the iterated part! The architecture simplifies dramatically:\n\n**Revised piece (A) part 2+ plan (all complex, on a ball around 1/2):**\n\nDefine the complex series function on a domain U (open, containing 1/2, avoiding poles):\nD(s) := −γ − 1/s + ∑' m : ℕ, (1/(m+1:ℂ) − 1/(s + m + 1))   [over ℕ with m+1]\n\nOn U := ball (1/2) (1/2) (say — avoids 0 and all −m... wait |s−1/2| < 1/2 ⟹ re s ∈ (0,1) — avoids 0 and −m ✓ but s could approach 1 — fine, digamma analytic at 1 ✓ hmm — ball(1/2, 1/2) contains points with re up to 1 — 1 not a pole ✓ OK).\n\nLemmas:\n1. Summable (fun m => (1/(m+1:ℂ) − 1/(s+m+1))) for s ∈ U: |term| = |s|/(|m+1|·|s+m+1|) ≤ C/m² — via comparison with the complex p-series: Summable (fun m : ℕ => 1/(‖m+1‖...)) — hmm — complex summability via norm comparison with the real p-series: Summable.of_norm_bounded or summable_of_norm_bounded: `Summable (fun m => C/((m+1):ℝ)^2)`-majorant. ✓\n2. The derivative series: iteratedDerivWithin k (fun s => (1/(m+1) − 1/(s+m+1))) U = −iteratedDerivWithin k (fun s => (s+m+1)⁻¹) U = −(−1)^k k! (s+m+1)^{−(k+1)} — the iterated deriv of (s + c)⁻¹: (−1)^k k! (s+c)^{−(k+1)} — provable by induction (deriv of (s+c)^{−n} = −n(s+c)^{−(n+1)}) — a helper lemma `iteratedDerivWithin_inv_add_const` or via zpow: (s+c)⁻¹ = (s+c)^(−1:ℤ) — `iteratedDerivWithin_zpow`? hmm — might not exist Within — prove by induction with derivWithin_zpow? There's `iteratedDeriv_zpow...`? Let me just do an induction: claim iteratedDerivWithin k (fun s => (s + c)⁻¹) U x = (−1)^k·k!·(x+c)^(−(k+1):ℤ) — for x ∈ U (open): derivWithin = deriv (open) — then induction: base k=0: (x+c)^{−1} ✓ (0! = 1, (−1)⁰ = 1); step: deriv of (−1)^k k! (s+c)^{−(k+1)} = (−1)^k k!·(−(k+1))(s+c)^{−(k+2)} = (−1)^{k+1}(k+1)!(s+c)^{−(k+2)} ✓ — via deriv_const_mul + deriv zpow — `hasDerivAt_zpow` (used in LiPrincipal ✓ hasDerivAt_zpow (−(k+1):ℤ) (x+c) (Or.inl ne)) ✓.\n   SummableLocallyUniformlyOn of that: |−(−1)^k k!(s+m+1)^{−(k+1)}| ≤ k!·C/|m+1|^{k+1}·(adjust for |s+m+1| ≥ (m+1)/2 on U) — ≤ C'_k/m^{k+1} — summable for k ≥ 1 ✓ — the SummableLocallyUniformlyOn from `SummableLocallyUniformlyOn_of_locally_bounded` (line 56!) — which needs a locally bounded dominator family — or `SummableLocallyUniformlyOn.of_locally_bounded_eventually` — with the bound u(m) = C_k/(m+1)^{k+1}... — the signature: SummableLocallyUniformlyOn_of_locally_bounded [LocallyCompactSpace β] (hu : ∀ K ⊆ s, IsCompact K → ∃ u, Summable u ∧ ∀ n x ∈ K, ‖f n x‖ ≤ u n)? — something like that (line 56). ℂ is locally compact ✓. So: for each compact K ⊆ U, the bound u(m) := k!·sup_{x∈K}|...| — with |x+m+1| ≥ (m+1)/2 on K (bounded away) ✓ — take u m := k!·C_K/(m+1)^{k+1} — Summable (p-series k+1 ≥ 2 ✓) ✓.\n3. Then iteratedDerivWithin_tsum gives: iteratedDerivWithin m D-series-part U x = Σ_m [−(−1)^m m!(x+m+1)^{−(m+1)}] for x ∈ U, m ≥ 1. And the −γ − 1/s part: iteratedDerivWithin m of −γ − 1/s = −(−1)^m m! s^{−(m+1)} — the m = 0-series-term form ✓ (fits: m = −1... the −1/s term = the m+1 = 0 case... hmm — actually combine: D(s) = −γ + Σ_{m≥0} −(s+m)^{−1}·... wait: −1/s + Σ_{m≥1}(1/m − 1/(s+m)) = −γ + Σ_{m≥0}[if m = 0 then −1/s else (1/m − 1/(s+m))] — let me just define D via the m≥0 family directly:\n   D(s) := −γ + ∑' m : ℕ, (if m = 0 then −1/s else (1/(m:ℂ) − 1/(s + m)))\n   — the m = 0 term: −1/s ✓; m ≥ 1: 1/m − 1/(s+m) ✓. Hmm — if-then-else in the summand — the iteratedDerivWithin of the m=0 term is −(−1)^k k! s^{−(k+1)} ✓ and for m ≥ 1: −(−1)^k k!(s+m)^{−(k+1)} — both = −(−1)^k k!(s+m)^{−(k+1)} (for m = 0: the 1/m part's derivative is 0 for k ≥ 1 ✓ since 1/m is a constant — WAIT the m ≥ 1 term's k-th deriv: (1/m const → 0) + (−(s+m)^{−1})'s = −(−1)^k k!(s+m)^{−(k+1)} ✓ and m=0's: (−1/s)'s k-th = −(−1)^k k! s^{−(k+1)} ✓ — uniform: iteratedDerivWithin k (term m) = −(−1)^k k! (s + m)^{−(k+1)} for ALL m ✓✓ clean!\n   So iteratedDerivWithin k D U x = −γ-part (0 for k ≥ 1) + Σ_m [−(−1)^k k!(x+m)^{−(k+1)}] = −(−1)^k k! Σ_{m≥0} (x+m)^{−(k+1)} ✓✓ — EXACTLY the polygamma series, all complex, in one shot.\n4. The identity with digamma: D = digamma on U. Hmm — THIS still needs the real seed (logGammaSeq → real series — for the identity). The identity principle needs agreement on a set with a limit point — the real segment (0,1) — so I DO need the real identity on (0,1): digamma(↑x) = D(↑x) for real x ∈ (0,1). Via: digamma(↑x) = ↑(ψ_real x) and D(↑x) = ↑(Dinf-real x) and ψ_real = Dinf-real (the real interchange work). Hmm — so the real deriv-interchange is still needed for the j=0-level identity (ψ_real = Dinf). UNLESS there's a direct way to pin the complex digamma to the series...\n\n   Alternative for the identity: use digamma_apply_add_one (recurrence, in Mathlib ✓) + the series' recurrence + a decay-at-infinity argument: both digamma and D satisfy f(s+1) = f(s) + 1/s; if their difference has period 1 and tends to 0 on vertical strips as re → ∞... digamma(s) − log s → 0 (needs digamma asymptotics — not in Mathlib)... hmm same asymptotic issue.\n\n   OR: prove the identity at ONE real point via the series + use the recurrence to extend... no — the identity principle needs agreement on an open set / accumulation set. A single point isn't enough.\n\n   So the real-side identity IS needed. Its content: for real x > 0: digamma ↑x = D ↑x. Via the real interchange: ψ_real(x) := deriv (log∘Real.Gamma) x = Dinf x (the real series) — that needs hasDerivAt_of_tendstoLocallyUniformlyOn for ℝ (works for ℝ too — it's 𝕜-generic ✓ — wait — IsRCLikeNormedField 𝕜 — ℝ is RCLike ✓). So:\n\n   Real side (needed only for the j = 0 function identity, not the iterated):\n   - Dinf(x) := −γ + Σ_{m≥0} [if m = 0 then −1/x else (1/m − 1/(x+m))] (real version).\n   - deriv (Real.log ∘ Real.Gamma) x = Dinf x for x > 0 — via logGammaSeq + the interchange lemma. The pieces: logGammaSeq x n = x log n + log n! − Σ_{m=0}^n log(x+m) → log Γ(x) (tendsto_log_gamma ✓); its x-derivative: log n − Σ_{m=0}^n 1/(x+m) → Dinf x locally uniformly — decompose: log n − Σ_{m=0}^n 1/(x+m) = [log n − H_n] + [−1/x + Σ_{m=1}^n (1/m − 1/(x+m))] — wait sign: log n − Σ_{m=0}^n 1/(x+m) = log n − H_n + H_n − Σ_{m=0}^n 1/(x+m) = (log n − H_n) + Σ_{m=1}^n (1/m − 1/(x+m)) − 1/x ✓. And H_n = harmonic n = Σ_{i<n} 1/(i+1) ✓. So the deriv sequence = (log n − harmonic n) + (−1/x + Σ_{m=1}^n (1/m − 1/(x+m))) — first → −γ pointwise (tendsto_harmonic_sub_log ✓ — it's independent of x so locally uniform trivially — TendstoLocallyUniformlyOn of a constant-in-x sequence from pointwise: `TendstoLocallyUniformlyOn.of_const`? — a constant sequence (in x) converging pointwise converges locally uniformly — there should be a trivial lemma); second: −1/x const-in-n + partial sums of the series → locally uniform by M-test. \n   - So the interchange gives HasDerivAt (log ∘ Gamma) (Dinf x) x ⟹ deriv (log∘Gamma) x = Dinf x for x > 0.\n   - ψ_real bridge: deriv (log ∘ Real.Gamma) x = Real.Gamma' x / Real.Gamma x (chain rule) and digamma(↑x) = ↑(Real.Gamma' x / Real.Gamma x) (the ofReal bridges) — so digamma(↑x) = ↑(Dinf x).\n   - And D(↑x) = ↑(Dinf x): the complex tsum of real-cast terms = cast of the real tsum — `Complex.ofReal_tsum`? — `map_tsum` with Complex.ofRealCLM: (ContinuousLinearMap).map_tsum? — there's `ContinuousLinearMap.map_tsum (hf : Summable g)? : L (∑' g) = ∑' L ∘ g`? hmm — `map_tsum (g : E →L[𝕜] F) (hf : Summable f) : g (∑' i, f i) = ∑' i, g (f i)` — I recall `map_tsum` exists in that form (or `ContinuousLinearMap.map_tsum`). For ofRealCLM: ofRealCLM (∑' re) = ∑' (ofReal ∘ ·) ✓. And the ofReal-cast of the real series terms = the complex series terms: ↑(1/m − 1/(x+m)) = 1/↑m − 1/(↑x+↑m) (push_cast) ✓ and ↑(−1/x) = −1/↑x ✓. So D(↑x) = ↑(Dinf x) ✓.\n   - Then digamma(↑x) = D(↑x) for x ∈ (0,1) real ✓.\n   - Identity principle: digamma = D on U (ball around 1/2): both analytic on U; agree on {↑x : x ∈ (0,1)} ∩ U — which has an accumulation point in U ✓ — Mathlib's identity principle: `AnalyticOnNhd.eq_on_of_preconnected_of_frequently_eq`? — the form I need: f, g analytic on open connected U, and f = g on a subset with a limit point in U — `AnalyticOnNhd.eq_of_preconnected_of_frequently_eq (hf : AnalyticOnNhd ℂ f U) (hg : ...) (hU : IsPreconnected U) (hz : z ∈ U) (hfg : ∃ᶠ w in 𝓝[≠] z ∩ U-ish, f w = g w)`? — hmm — there's `AnalyticOnNhd.eq_on_of_preconnected_of_frequently_eq` — I saw `isClopen_setOfPred_analyticOrderAt_eq_top` style stuff in Order.lean; the identity principle should be in Mathlib/Analysis/Analytic/Uniqueness.lean — `AnalyticOnNhd.eq_on_of_preconnected_of_frequently_eq`? or `AnalyticOnNhd.eq_on_of_preconnected_of_mem_nhds` (agree on a nhd of a point) — the latter is easier to use: if I show digamma = D on a whole small real-interval... no — the nhds form needs agreement on a NEIGHBORHOOD (2D open) — I only have the real segment. So the frequently-accumulation form: frequently at a point of U: take z₀ = ↑(1/2): every punctured nhd of 1/2 meets {real points} where they agree — ∃ᶠ w in 𝓝[≠] (↑(1/2)), w ∈ U ∧ ... hmm — the real points ↑(x) with x ∈ (0,1), x ≠ 1/2 accumulate at ↑(1/2) ✓ (frequently in 𝓝[≠]). The exact lemma name — let me find it: `AnalyticOnNhd.eq_on_of_preconnected_of_frequently_eq`? grep at build.\n\n   - Then iteratedDeriv j digamma (1/2) = iteratedDeriv j D (1/2) (eventual equality on the ball — via a small helper using EventuallyEq.deriv_eq induction — or directly: they're equal on the open ball, so `iteratedDeriv_congr`-ish: functions equal on a nhd have equal iteratedDerivs — `Filter.EventuallyEq.iteratedDeriv_eq`? — let me check for that too).\n   - iteratedDeriv vs iteratedDerivWithin: my tsum lemma gives iteratedDerivWithin on U; for x interior and U open: iteratedDerivWithin m f U x = iteratedDeriv m f x (IsOpen: `iteratedDerivWithin_of_isOpen`? — `iteratedDerivWithin_of_isOpen (hs : IsOpen s) (hx : x ∈ s) : iteratedDerivWithin n f s x = iteratedDeriv n f x`? — hmm — there's `iteratedDerivWithin_of_isOpen` ✓ I believe).\n\nSo the full piece (A) remaining work:\n(A2) real series Dinf + summability + the logGammaSeq deriv-sequence locally-uniform convergence + interchange ⟹ deriv (log∘Real.Gamma) = Dinf on (0,∞).\n(A3) ψ_real bridge: digamma(↑x) = ↑(Dinf x).\n(A4) complex D: summability + analytic on U + D(↑x) = ↑(Dinf x) ⟹ digamma = D on U (identity principle).\n(A5) iteratedDerivWithin_tsum for D's iterated derivatives ⟹ iteratedDeriv j digamma (1/2) = (−1)^{j+1} j! Σ_m (1/2 + m)^{−(j+1)} for j ≥ 1.\n(A6) reindex Σ_{m≥0}(1/2 + m)^{−(j+1)} = 2^{j+1}·lagariasA(j+1): (1/2 + m)^{−(j+1)} = 2^{j+1}/(2m+1)^{j+1} — so Σ = 2^{j+1} Σ_{m≥0} (2m+1)^{−(j+1)} — and Σ_{m≥0}(2m+1)^{−(j+1)} = lagariasA(j+1) — via the equiv ℕ ≃ {odd}: m ↦ 2m+1 + the peel: lagariasA (j+1) = 1 + Σ_{m : {odd ∧ ≥3}} ... — hmm — Σ_{m≥0}(2m+1)^{−(j+1)} is over ℕ with terms at 1, 3, 5... = 1 + Σ_{m≥1}(2m+1)^{−(j+1)} [tsum_eq_zero_add] = 1 + Σ_{m≥0}(2m+3)^{−(j+1)} [reindex m ↦ m+1 — `tsum_eq...`? — the shift: Σ_{m≥1} f(m) = Σ_{m≥0} f(m+1) — `tsum_eq...`? — there's `tsum_eq_zero_add` and the shift equivalence]. Then Σ_{m≥0}(2m+3)^{−(j+1)} = Σ_{m : {odd ∧ ≥3}} m^{−(j+1)} via the equiv m ↦ 2m+3 : ℕ ≃ {m // Odd m ∧ 3 ≤ m} (bespoke, as designed in D-066) + Equiv.tsum_eq ✓.\n(A7) the (1+s)/2 comp + factorial assembly into the final τ_j statement:\n   iteratedDeriv j (fun s => logDeriv Gammaℝ (1+s)) 0 = (−1)^{j+1} j! lagariasA(j+1):\n   - j = 0: logDeriv_Gammaℝ_one ✓ DONE (the statement there: = −lagariasA1 — the form (−1)^{0+1}·0!·↑lagariasA(0+1) = −↑lagariasA1 — lagariasA 1 = lagariasA1 by if_pos rfl ✓ — bridge lemma).\n   - j ≥ 1: from the split (logDeriv_Gammaℝ_one_add — its iteratedDeriv at 0 — the split is an equality of the FUNCTIONS at a point — I need it as an eventuallyEq on a nhd of 0: logDeriv_Gammaℝ_one_add holds for all s with the two nonvanishing hyps — both hold on a nhd of 0 (Gamma((1+s)/2) ≠ 0 near 0 ✓ since Gamma(1/2) ≠ 0 + continuity; the (1+s)/2 ≠ −m condition: at s near 0, (1+s)/2 near 1/2 — nonzero distance from −m ✓ eventually). So the functions agree on a nhd ⟹ iteratedDerivs equal: iteratedDeriv j (logDeriv Gammaℝ (1+·)) 0 = iteratedDeriv j (fun s => −(log π)/2 + (1/2)·digamma((1+s)/2)) 0 = (1/2)·iteratedDeriv j (digamma((1+·)/2)) 0 (j ≥ 1 kills the constant) = (1/2)·(1/2)^j·iteratedDeriv j digamma (1/2)·... — the comp with the affine map s ↦ (1+s)/2: iteratedDeriv j (digamma ∘ (fun s => (1+s)/2)) 0 = (1/2)^j·iteratedDeriv j digamma (1/2) — the affine comp lemma: iteratedDeriv_comp for s ↦ a + c·s: (1+s)/2 = 1/2 + (1/2)·s — iteratedDeriv_comp_add_const + iteratedDeriv_comp_const_mul... — is there `iteratedDeriv_comp_const_mul`? hmm — for (c·s): iteratedDeriv n (f ∘ (c·)) x = c^n · iteratedDeriv n f (c·x) — there's `iteratedDeriv_comp_smul`? or I derive: f(c·s) — chain rule induction — or maybe there's `iteratedDeriv_comp_mul_const`? — let me search at build. Worst case: induction on j with deriv comp: deriv (f ∘ (c·)) x = c·(deriv f)(c·x) — `deriv_comp_const_mul`? there's `deriv.scomp`? — or `HasDerivAt.comp` with const_mul — then iterate via a small induction — I'll write a bespoke `iteratedDeriv_digamma_half` comp lemma if needed.\n\nOK — this is a lot but each piece is now mapped to verified Mathlib machinery. It's late (~23:10). Given the size, I'll continue tomorrow/this-session as far as I get, committing incrementally. Let me start with (A2)'s real-series infrastructure in a new section of LiArchimedean.lean... — actually, let me create a separate file LiDigamma.lean for the series work (cleaner; LiArchimedean.lean stays the assembly file).\n\nActually — before writing, let me quickly verify the two risky names: the identity principle form and map_tsum/iteratedDerivWithin_of_isOpen, and TendstoLocallyUniformlyOn.add / const. Let me batch-grep.","signature":""},{"type":"text","text":"`iteratedDerivWithin_tsum` exists — the complex side gets much cleaner. Verifying the remaining risky names before writing the digamma-series file."},{"type":"tool_use","id":"Bash_294","name":"Bash","input":{"command":"cd \"D:/Python/Quantum/zeta-23-lean/.lake/packages/mathlib\" && grep -rn \"eq_on_of_preconnected\\|eq_of_preconnected_of_frequently\" Mathlib/Analysis/Analytic/Uniqueness.lean | head -6; echo ===; grep -rn \"theorem map_tsum\\|lemma map_tsum\\|ContinuousLinearMap.map_tsum\" Mathlib/Topology/Algebra/InfiniteSum/*.lean | head -4; echo ===; grep -rn \"theorem iteratedDerivWithin_of_isOpen\\|lemma iteratedDerivWithin_of_isOpen\" Mathlib/ -r --include=\"*.lean\" | head -2","description":"Check identity principle, map_tsum, iteratedDerivWithin_of_isOpen"},"extra_content":null}]