← Session 21 — Tier ii′ planning + launch: close SfBoundProp in Lean (D-064)
thinking (7777 chars)
`natCast_le_analyticOrderAt_iff_iteratedDeriv_eq_zero` (line 333): n ≤ analyticOrderAt f p ⟺ iteratedDeriv k f p = 0 for all k < n — exactly what I need for the R-at-1 computation:
- Show (F − Tayl_n F) has iteratedDeriv k = 0 at 1 for k ≤ n (k < n+1): iteratedDeriv k (Tayl_n F) 1 = iteratedDeriv k F 1 for k ≤ n (Taylor poly reproduces derivatives) ✓ standard.
- Then analyticOrderAt (F − Tayl_n F) 1 ≥ n+1 ⟹ F − Tayl_n F = (w−1)^{n+1}·G with G analytic at 1 (via analyticOrderAt_eq_nat_iff + the NF: analyticOrderAt_eq_natCast_iff? there should be a lemma: analyticOrderAt f p = (n : ℕ∞) → ∃ g analytic, f = (z−p)^n·g — `analyticOrderAt_eq_natCast` in Analytic/Order.lean).
Then R = G punctured near 1 ⟹ R holomorphic at 1 (extend by G) — for the HolomorphicOn R (Rectangle \ S) claim: at 1, R agrees with G on punctured nhd; G analytic at 1; so R is "holomorphic on (Rectangle \ S) ∪ {1}-punctured"... for residueTheorem_finset I need fHolo : HolomorphicOn R (Rectangle \ (S:Set)) where S = zeros ∪ {−2} — and 1 ∉ S — so R must be holomorphic AT 1 in the sense of HolomorphicOn at points of Rectangle \ S near 1: R = G on a punctured neighborhood; replace R by G there — holomorphicity is local: at 1, R agrees with G punctured — but R itself might be defined weirdly AT 1 (R(1) = J(1) − P(1) — both singular... in Lean they're total functions with junk values at the pole). Hmm — HolomorphicOn R (Rectangle \ S) requires differentiability AT 1 (since 1 ∈ Rectangle \ S). R at 1: R(1) = J(1) − P(1): J(1) = k_n(0)·(−ζ′/ζ(1)): ζ(1) is... riemannZeta 1 in Mathlib is DEFINED as (γ − log(4π))/2 (riemannZeta_one — the finite value, from the Hurwitz def)! And P(1) = Σ A_i/(1−1)^i = Σ A_i/0 — junk (division by zero = 0 in Lean fields). So R(1) = junk. The fix used by the vendored code: Function.update R 1 G(1) — or define R as the updated function from the start and prove EqOn with J − P off {1}. The vendored `differentiableOn_update_limUnder_of_bddAbove` (in the snippet I saw at the end of vanishesOnRectangle area — "HolomorphicOn g s ∧ Set.EqOn f g (s \ {c}) := ⟨Function.update f c (limUnder ...)...") — there's machinery for this update pattern ✓.
OK — this is all doable. Given the amount of machinery, ii′-1b will likely span 2 sessions (016 + 017). Let me structure session 016 to deliver ii′-1b(i) + (ii) at minimum, ideally start (iii).
Actually — let me reconsider the overall ii′-1b structure to minimize risk:
**ii′-1b(i): the w=1 residue value.** Define:
- `hLi (w : ℂ) : ℂ := (w - 1) * (-deriv riemannZeta w / riemannZeta w)` — h(w) = (w−1)(−ζ′/ζ(w)).
- Prove `AnalyticAt ℂ hLi 1` and `hLi 1 = 1`?? — h(1) = 0·(−ζ′/ζ(1)): as written it's 0·something = 0 — the VALUE at 1 is junk! The analytic continuation value is 1 (residue), but the function as defined evaluates to 0 at 1. For iteratedDeriv computations I need h to be literally analytic at 1 — so define hLi via the analytic extension: hLi := Function.update (fun w => (w−1)*...) 1 1?? or define via the meromorphic normal form... The clean way: h(w) = (w−1)·(−ζ′/ζ(w)) for w ≠ 1, h(1) := 1 — analytic at 1 because −ζ′/ζ has a simple pole with residue 1 (from Mathlib's riemannZeta_residue_one... wait — need: (s−1)·(−ζ′/ζ(s)) → 1 as s→1. From ζ(s) = a(s)/(s−1) with a analytic, a(1) = 1: ζ′/ζ = a′/a − 1/(s−1): −ζ′/ζ = 1/(s−1) − a′/a: (s−1)(−ζ′/ζ) = 1 − (s−1)a′/a → 1 ✓. The a(s) := (s−1)ζ(s) analytic at 1 — Mathlib: riemannZeta has a simple pole at 1 with residue 1: is there `MeromorphicAt riemannZeta 1` + order −1? Mathlib has the pole API for riemannZeta? There's `riemannZeta_residue_one : Tendsto (fun s => (s - 1) * riemannZeta s) (𝓝[≠] 1) (𝓝 1)` ✓ (agent confirmed). From that: a(s) := (s−1)ζ(s) → 1; a is analytic at 1: a(s) = (s−1)·ζ(s) — ζ analytic off 1 (Mathlib differentiableAt_riemannZeta) so a analytic off 1 with limit 1 ⟹ removable singularity ⟹ extends analytically with a(1) = 1 — via `AnalyticAt.removableSingularity`? or the differentiableOn_update machinery. Then ζ′/ζ = a′/a − 1/(s−1): near 1, a(s) ≠ 0 (a(1) = 1) ✓ a′/a analytic at 1 ✓. So h(w) := 1 − (w−1)·(a′/a)(w) analytic at 1 with h(1) = 1 ✓ — this DEFINES h analytically! hLi := fun w => 1 - (w-1) * (deriv aZeta w / aZeta w) where aZeta w := (w-1)·riemannZeta w... but then proving h(w) = (w−1)(−ζ′/ζ(w)) for w ≠ 1 needs ζ′/ζ = a′/a − 1/(s−1) — log deriv of product: deriv a = ζ + (s−1)ζ′: a′/a = 1/(s−1) + ζ′/ζ ✓ algebra.
This is the cleanest foundation: define
```
def zetaA (w : ℂ) : ℂ := (w - 1) * riemannZeta w -- analytic at 1, value 1
def hLi (w : ℂ) : ℂ := 1 - (w - 1) * (deriv zetaA w / zetaA w) -- analytic at 1, h(1) = 1
```
Prove: zetaA analytic at 1 (removable), zetaA 1 = 1, zetaA ≠ 0 near 1, and hLi_eq : ∀ w ≠ 1, hLi w = (w - 1) * (-deriv riemannZeta w / riemannZeta w).
Hmm — zetaA's analyticity at 1: zetaA = (w−1)ζ(w): analytic off 1 ✓ (product), and tends to 1 — removable singularity extension: `AnalyticAt` of the UPDATE function (Function.update zetaA 1 1). But for algebra it's easier to define zetaA with the update built in:
```
def zetaA : ℂ → ℂ := Function.update (fun w => (w - 1) * riemannZeta w) 1 1
```
Then prove AnalyticAt zetaA 1 via the bounded-removable-singularity lemma (vendored has `differentiableOn_update_limUnder_of_bddAbove` — from the snippet earlier ✓ it exists in ResidueCalcOnRectangles? The snippet showed `⟨Function.update f c (limUnder (𝓝[{c}ᶜ) c) f), differentiableOn_update_limUnder_of_bddAbove hc hd hb, ...⟩` — so `differentiableOn_update_limUnder_of_bddAbove` exists ✓).
And the lcoeff definition: lcoeff k := iteratedDeriv (k+1) hLi 1 / (k+1)! — clean, no Laurent series needed.
Then ResW1 computation: F(w) = (wⁿ − (w−1)ⁿ)·hLi w: analytic at 1 ✓ (product of analytics: wⁿ−(w−1)ⁿ polynomial, hLi analytic at 1).
F^{(n)}(1) = Σ_{i=0}^n C(n,i) A^{(i)}(1) h^{(n−i)}(1) with A(w) = wⁿ−(w−1)ⁿ:
- A^{(i)}(1) = n.descFactorial i·1 − [iteratedDeriv i (w ↦ (w−1)^n) at 1]: for i < n: descFactorial i − 0 = descFactorial i; for i = n: n! − n! = 0.
iteratedDeriv i (· ^ n) x = n.descFactorial i * x^(n−i) ✓ (simp lemma). For (w−1)^n: iteratedDeriv i (fun w => (w−1)^n) 1 = iteratedDeriv i (·^n) evaluated at 0 — the shift: (fun w => (w−1)^n) = (·^n) ∘ (fun w => w−1): iteratedDeriv of a composition with a translation: `iteratedDeriv_comp_...`? — there might be `iteratedDeriv_comp_sub`? Hmm — simpler: (w−1)^n = (fun w => w + (-1))^n: use `iteratedDeriv_add_const`? Hmm — from the STATE handoff gotchas: "HasDerivAt.add_const adds to VALUE (use .comp for precomposition)". For iteratedDeriv there's likely `iteratedDeriv_comp_add_const`? Let me handle via: (fun w => (w−1)^n) = (fun w => w^n) ∘ (fun w => w − 1) and the iterated derivative at 1 equals iteratedDeriv i (·^n) 0 via a translation-invariance lemma — find or prove: `iteratedDeriv_comp_sub_const`? I'll grep for comp lemmas. Alternative: avoid the shift entirely — expand (w−1)^n via binomial: (w−1)^n = Σ_j C(n,j)(−1)^{n−j} w^j: then iteratedDeriv i at 1 = Σ_j C(n,j)(−1)^{n−j} j.descFactorial i·1 = ... equals descFactorial i·(1−1)^{n−i} = 0 for i < n (binomial: Σ_j C(n,j)(−1)^{n−j}j^{(i)} = (n)_i·(1−1)^{n−i} = 0 ✓ (n)_i·0 = 0 for n−i ≥ 1) and for i = n: n!. The binomial identity Σ_j C(n,j)(−1)^{n−j}·j.descFactorial i = n.descFactorial i·(1−1)^{n-i}·... — provable but annoying. The shift lemma is cleaner. Let me grep for iteratedDeriv_comp.
Actually — simplest robust approach for A^{(i)}(1): A(w) = wⁿ − (w−1)ⁿ: note A(w) = (w−(w−1))·Σ_{j<n} w^j(w−1)^{n−1−j} = Σ_{j=0}^{n−1} w^j(w−1)^{n−1−j} — each term has a (w−1) factor except... term j: w^j(w−1)^{n−1−j}: at w=1: all terms with n−1−j ≥ 1 vanish; j = n−1 term: w^{n−1} = 1. So A(1) = 1 ✓. For derivatives it's still messy. The shift approach is cleanest IF a lemma exists.
Let me grep for iteratedDeriv composition/shift lemmas.
The design is fully settled. Checking the iteratedDeriv shift/composition lemmas for the (w−1)ⁿ derivative.
tool: Bash
input
{
"command": "cd /d/Python/Quantum/zeta-23-lean/.lake/packages/mathlib && grep -rn \"iteratedDeriv_comp\" Mathlib/Analysis/Calculus/IteratedDeriv/*.lean | head -10",
"description": "Find iteratedDeriv composition lemmas"
}
raw content_json (database row)
[{"type":"thinking","thinking":"`natCast_le_analyticOrderAt_iff_iteratedDeriv_eq_zero` (line 333): n ≤ analyticOrderAt f p ⟺ iteratedDeriv k f p = 0 for all k < n — exactly what I need for the R-at-1 computation:\n- Show (F − Tayl_n F) has iteratedDeriv k = 0 at 1 for k ≤ n (k < n+1): iteratedDeriv k (Tayl_n F) 1 = iteratedDeriv k F 1 for k ≤ n (Taylor poly reproduces derivatives) ✓ standard.\n- Then analyticOrderAt (F − Tayl_n F) 1 ≥ n+1 ⟹ F − Tayl_n F = (w−1)^{n+1}·G with G analytic at 1 (via analyticOrderAt_eq_nat_iff + the NF: analyticOrderAt_eq_natCast_iff? there should be a lemma: analyticOrderAt f p = (n : ℕ∞) → ∃ g analytic, f = (z−p)^n·g — `analyticOrderAt_eq_natCast` in Analytic/Order.lean).\n\nThen R = G punctured near 1 ⟹ R holomorphic at 1 (extend by G) — for the HolomorphicOn R (Rectangle \\ S) claim: at 1, R agrees with G on punctured nhd; G analytic at 1; so R is \"holomorphic on (Rectangle \\ S) ∪ {1}-punctured\"... for residueTheorem_finset I need fHolo : HolomorphicOn R (Rectangle \\ (S:Set)) where S = zeros ∪ {−2} — and 1 ∉ S — so R must be holomorphic AT 1 in the sense of HolomorphicOn at points of Rectangle \\ S near 1: R = G on a punctured neighborhood; replace R by G there — holomorphicity is local: at 1, R agrees with G punctured — but R itself might be defined weirdly AT 1 (R(1) = J(1) − P(1) — both singular... in Lean they're total functions with junk values at the pole). Hmm — HolomorphicOn R (Rectangle \\ S) requires differentiability AT 1 (since 1 ∈ Rectangle \\ S). R at 1: R(1) = J(1) − P(1): J(1) = k_n(0)·(−ζ′/ζ(1)): ζ(1) is... riemannZeta 1 in Mathlib is DEFINED as (γ − log(4π))/2 (riemannZeta_one — the finite value, from the Hurwitz def)! And P(1) = Σ A_i/(1−1)^i = Σ A_i/0 — junk (division by zero = 0 in Lean fields). So R(1) = junk. The fix used by the vendored code: Function.update R 1 G(1) — or define R as the updated function from the start and prove EqOn with J − P off {1}. The vendored `differentiableOn_update_limUnder_of_bddAbove` (in the snippet I saw at the end of vanishesOnRectangle area — \"HolomorphicOn g s ∧ Set.EqOn f g (s \\ {c}) := ⟨Function.update f c (limUnder ...)...\") — there's machinery for this update pattern ✓.\n\nOK — this is all doable. Given the amount of machinery, ii′-1b will likely span 2 sessions (016 + 017). Let me structure session 016 to deliver ii′-1b(i) + (ii) at minimum, ideally start (iii).\n\nActually — let me reconsider the overall ii′-1b structure to minimize risk:\n\n**ii′-1b(i): the w=1 residue value.** Define:\n- `hLi (w : ℂ) : ℂ := (w - 1) * (-deriv riemannZeta w / riemannZeta w)` — h(w) = (w−1)(−ζ′/ζ(w)).\n- Prove `AnalyticAt ℂ hLi 1` and `hLi 1 = 1`?? — h(1) = 0·(−ζ′/ζ(1)): as written it's 0·something = 0 — the VALUE at 1 is junk! The analytic continuation value is 1 (residue), but the function as defined evaluates to 0 at 1. For iteratedDeriv computations I need h to be literally analytic at 1 — so define hLi via the analytic extension: hLi := Function.update (fun w => (w−1)*...) 1 1?? or define via the meromorphic normal form... The clean way: h(w) = (w−1)·(−ζ′/ζ(w)) for w ≠ 1, h(1) := 1 — analytic at 1 because −ζ′/ζ has a simple pole with residue 1 (from Mathlib's riemannZeta_residue_one... wait — need: (s−1)·(−ζ′/ζ(s)) → 1 as s→1. From ζ(s) = a(s)/(s−1) with a analytic, a(1) = 1: ζ′/ζ = a′/a − 1/(s−1): −ζ′/ζ = 1/(s−1) − a′/a: (s−1)(−ζ′/ζ) = 1 − (s−1)a′/a → 1 ✓. The a(s) := (s−1)ζ(s) analytic at 1 — Mathlib: riemannZeta has a simple pole at 1 with residue 1: is there `MeromorphicAt riemannZeta 1` + order −1? Mathlib has the pole API for riemannZeta? There's `riemannZeta_residue_one : Tendsto (fun s => (s - 1) * riemannZeta s) (𝓝[≠] 1) (𝓝 1)` ✓ (agent confirmed). From that: a(s) := (s−1)ζ(s) → 1; a is analytic at 1: a(s) = (s−1)·ζ(s) — ζ analytic off 1 (Mathlib differentiableAt_riemannZeta) so a analytic off 1 with limit 1 ⟹ removable singularity ⟹ extends analytically with a(1) = 1 — via `AnalyticAt.removableSingularity`? or the differentiableOn_update machinery. Then ζ′/ζ = a′/a − 1/(s−1): near 1, a(s) ≠ 0 (a(1) = 1) ✓ a′/a analytic at 1 ✓. So h(w) := 1 − (w−1)·(a′/a)(w) analytic at 1 with h(1) = 1 ✓ — this DEFINES h analytically! hLi := fun w => 1 - (w-1) * (deriv aZeta w / aZeta w) where aZeta w := (w-1)·riemannZeta w... but then proving h(w) = (w−1)(−ζ′/ζ(w)) for w ≠ 1 needs ζ′/ζ = a′/a − 1/(s−1) — log deriv of product: deriv a = ζ + (s−1)ζ′: a′/a = 1/(s−1) + ζ′/ζ ✓ algebra.\n\nThis is the cleanest foundation: define\n```\ndef zetaA (w : ℂ) : ℂ := (w - 1) * riemannZeta w -- analytic at 1, value 1\ndef hLi (w : ℂ) : ℂ := 1 - (w - 1) * (deriv zetaA w / zetaA w) -- analytic at 1, h(1) = 1\n```\nProve: zetaA analytic at 1 (removable), zetaA 1 = 1, zetaA ≠ 0 near 1, and hLi_eq : ∀ w ≠ 1, hLi w = (w - 1) * (-deriv riemannZeta w / riemannZeta w).\n\nHmm — zetaA's analyticity at 1: zetaA = (w−1)ζ(w): analytic off 1 ✓ (product), and tends to 1 — removable singularity extension: `AnalyticAt` of the UPDATE function (Function.update zetaA 1 1). But for algebra it's easier to define zetaA with the update built in:\n```\ndef zetaA : ℂ → ℂ := Function.update (fun w => (w - 1) * riemannZeta w) 1 1\n```\nThen prove AnalyticAt zetaA 1 via the bounded-removable-singularity lemma (vendored has `differentiableOn_update_limUnder_of_bddAbove` — from the snippet earlier ✓ it exists in ResidueCalcOnRectangles? The snippet showed `⟨Function.update f c (limUnder (𝓝[{c}ᶜ) c) f), differentiableOn_update_limUnder_of_bddAbove hc hd hb, ...⟩` — so `differentiableOn_update_limUnder_of_bddAbove` exists ✓).\n\nAnd the lcoeff definition: lcoeff k := iteratedDeriv (k+1) hLi 1 / (k+1)! — clean, no Laurent series needed.\n\nThen ResW1 computation: F(w) = (wⁿ − (w−1)ⁿ)·hLi w: analytic at 1 ✓ (product of analytics: wⁿ−(w−1)ⁿ polynomial, hLi analytic at 1).\nF^{(n)}(1) = Σ_{i=0}^n C(n,i) A^{(i)}(1) h^{(n−i)}(1) with A(w) = wⁿ−(w−1)ⁿ:\n- A^{(i)}(1) = n.descFactorial i·1 − [iteratedDeriv i (w ↦ (w−1)^n) at 1]: for i < n: descFactorial i − 0 = descFactorial i; for i = n: n! − n! = 0.\n iteratedDeriv i (· ^ n) x = n.descFactorial i * x^(n−i) ✓ (simp lemma). For (w−1)^n: iteratedDeriv i (fun w => (w−1)^n) 1 = iteratedDeriv i (·^n) evaluated at 0 — the shift: (fun w => (w−1)^n) = (·^n) ∘ (fun w => w−1): iteratedDeriv of a composition with a translation: `iteratedDeriv_comp_...`? — there might be `iteratedDeriv_comp_sub`? Hmm — simpler: (w−1)^n = (fun w => w + (-1))^n: use `iteratedDeriv_add_const`? Hmm — from the STATE handoff gotchas: \"HasDerivAt.add_const adds to VALUE (use .comp for precomposition)\". For iteratedDeriv there's likely `iteratedDeriv_comp_add_const`? Let me handle via: (fun w => (w−1)^n) = (fun w => w^n) ∘ (fun w => w − 1) and the iterated derivative at 1 equals iteratedDeriv i (·^n) 0 via a translation-invariance lemma — find or prove: `iteratedDeriv_comp_sub_const`? I'll grep for comp lemmas. Alternative: avoid the shift entirely — expand (w−1)^n via binomial: (w−1)^n = Σ_j C(n,j)(−1)^{n−j} w^j: then iteratedDeriv i at 1 = Σ_j C(n,j)(−1)^{n−j} j.descFactorial i·1 = ... equals descFactorial i·(1−1)^{n−i} = 0 for i < n (binomial: Σ_j C(n,j)(−1)^{n−j}j^{(i)} = (n)_i·(1−1)^{n−i} = 0 ✓ (n)_i·0 = 0 for n−i ≥ 1) and for i = n: n!. The binomial identity Σ_j C(n,j)(−1)^{n−j}·j.descFactorial i = n.descFactorial i·(1−1)^{n-i}·... — provable but annoying. The shift lemma is cleaner. Let me grep for iteratedDeriv_comp.\n\nActually — simplest robust approach for A^{(i)}(1): A(w) = wⁿ − (w−1)ⁿ: note A(w) = (w−(w−1))·Σ_{j<n} w^j(w−1)^{n−1−j} = Σ_{j=0}^{n−1} w^j(w−1)^{n−1−j} — each term has a (w−1) factor except... term j: w^j(w−1)^{n−1−j}: at w=1: all terms with n−1−j ≥ 1 vanish; j = n−1 term: w^{n−1} = 1. So A(1) = 1 ✓. For derivatives it's still messy. The shift approach is cleanest IF a lemma exists.\n\nLet me grep for iteratedDeriv composition/shift lemmas.","signature":""},{"type":"text","text":"The design is fully settled. Checking the iteratedDeriv shift/composition lemmas for the (w−1)ⁿ derivative."},{"type":"tool_use","id":"Bash_183","name":"Bash","input":{"command":"cd /d/Python/Quantum/zeta-23-lean/.lake/packages/mathlib && grep -rn \"iteratedDeriv_comp\" Mathlib/Analysis/Calculus/IteratedDeriv/*.lean | head -10","description":"Find iteratedDeriv composition lemmas"},"extra_content":null}]