@@ -3,13 +3,15 @@ Copyright (c) 2024 Chris Birkbeck. All rights reserved.
33Released under Apache 2.0 license as described in the file LICENSE.
44Authors: Chris Birkbeck
55-/
6+ import Mathlib.Analysis.Calculus.IteratedDeriv.WithinZpow
67import Mathlib.Analysis.Complex.UpperHalfPlane.Exp
78import Mathlib.Analysis.Complex.IntegerCompl
89import Mathlib.Analysis.Complex.LocallyUniformLimit
910import Mathlib.Analysis.PSeries
1011import Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd
1112import Mathlib.Analysis.NormedSpace.MultipliableUniformlyOn
1213import Mathlib.NumberTheory.ModularForms.EisensteinSeries.Summable
14+ import Mathlib.Topology.Algebra.InfiniteSum.TsumUniformlyOn
1315
1416/-!
1517# Cotangent
@@ -18,13 +20,17 @@ This file contains lemmas about the cotangent function, including useful series
1820In particular, we prove that
1921`π * cot (π * z) = π * I - 2 * π * I * ∑' n : ℕ, Complex.exp (2 * π * I * z) ^ n`
2022as well as the infinite sum representation of cotangent (also known as the Mittag-Leffler
21- expansion): `π * cot (π * z) = 1 / z + ∑' n : ℕ+, (1 / ((z : ℂ) - n) + 1 / (z + n))`.
23+ expansion): `π * cot (π * z) = 1 / z + ∑' n : ℕ+, (1 / (z - n) + 1 / (z + n))`.
2224-/
2325
2426open Real Complex
2527
2628open scoped UpperHalfPlane
2729
30+ local notation "ℂ_ℤ" => integerComplement
31+
32+ local notation "ℍₒ" => UpperHalfPlane.upperHalfPlaneSet
33+
2834lemma Complex.cot_eq_exp_ratio (z : ℂ) :
2935 cot z = (Complex.exp (2 * I * z) + 1 ) / (I * (1 - Complex.exp (2 * I * z))) := by
3036 rw [Complex.cot, Complex.sin, Complex.cos]
@@ -63,8 +69,6 @@ open Filter Function
6369
6470open scoped Topology BigOperators Nat Complex
6571
66- local notation "ℂ_ℤ" => integerComplement
67-
6872variable {x : ℂ} {Z : Set ℂ}
6973
7074/-- The main term in the infinite product for sine. -/
@@ -77,14 +81,14 @@ lemma sineTerm_ne_zero {x : ℂ} (hx : x ∈ ℂ_ℤ) (n : ℕ) : 1 + sineTerm x
7781 aesop
7882 · simp [Nat.cast_add_one_ne_zero n]
7983
80- theorem tendsto_euler_sin_prod' (h0 : x ≠ 0 ) :
84+ lemma tendsto_euler_sin_prod' (h0 : x ≠ 0 ) :
8185 Tendsto (fun n : ℕ ↦ ∏ i ∈ Finset.range n, (1 + sineTerm x i)) atTop
8286 (𝓝 (sin (π * x) / (π * x))) := by
8387 rw [show (sin (π * x) / (π * x)) = sin (π * x) * (1 / (π * x)) by ring]
8488 apply (Filter.Tendsto.mul_const (b := 1 / (π * x)) (tendsto_euler_sin_prod x)).congr
8589 exact fun n ↦ by field_simp; rfl
8690
87- theorem multipliable_sineTerm (x : ℂ) : Multipliable fun i ↦ (1 + sineTerm x i) := by
91+ lemma multipliable_sineTerm (x : ℂ) : Multipliable fun i ↦ (1 + sineTerm x i) := by
8892 apply multipliable_one_add_of_summable
8993 have := summable_pow_div_add (x ^ 2 ) 2 1 Nat.one_lt_two
9094 simpa [sineTerm] using this
@@ -108,46 +112,52 @@ private lemma sineTerm_bound_aux (hZ : IsCompact Z) :
108112 gcongr
109113 apply le_trans (hs x hx) (le_abs_self s)
110114
111- theorem multipliableUniformlyOn_euler_sin_prod_on_compact (hZC : IsCompact Z) :
115+ lemma multipliableUniformlyOn_euler_sin_prod_on_compact (hZC : IsCompact Z) :
112116 MultipliableUniformlyOn (fun n : ℕ => fun z : ℂ => (1 + sineTerm z n)) {Z} := by
113117 obtain ⟨u, hu, hu2⟩ := sineTerm_bound_aux hZC
114118 refine Summable.multipliableUniformlyOn_nat_one_add hZC hu ?_ ?_
115119 · filter_upwards with n z hz using hu2 n z hz
116120 · fun_prop
117121
118- theorem HasProdUniformlyOn_sineTerm_prod_on_compact (hZ2 : Z ⊆ ℂ_ℤ)
122+ lemma HasProdUniformlyOn_sineTerm_prod_on_compact (hZ2 : Z ⊆ ℂ_ℤ)
119123 (hZC : IsCompact Z) :
120124 HasProdUniformlyOn (fun n : ℕ => fun z : ℂ => (1 + sineTerm z n))
121125 (fun x => (Complex.sin (↑π * x) / (↑π * x))) {Z} := by
122126 apply (multipliableUniformlyOn_euler_sin_prod_on_compact hZC).hasProdUniformlyOn.congr_right
123127 exact fun s hs x hx => euler_sineTerm_tprod (by aesop)
124128
125- theorem HasProdLocallyUniformlyOn_euler_sin_prod :
129+ lemma HasProdLocallyUniformlyOn_euler_sin_prod :
126130 HasProdLocallyUniformlyOn (fun n : ℕ => fun z : ℂ => (1 + sineTerm z n))
127131 (fun x => (Complex.sin (π * x) / (π * x))) ℂ_ℤ := by
128132 apply hasProdLocallyUniformlyOn_of_forall_compact isOpen_compl_range_intCast
129133 exact fun _ hZ hZC => HasProdUniformlyOn_sineTerm_prod_on_compact hZ hZC
130134
131- theorem sin_pi_z_ne_zero (hz : x ∈ ℂ_ℤ) : Complex.sin (π * x) ≠ 0 := by
135+ /-- `sin π z` is non vanishing on the complement of the integers in `ℂ`. -/
136+ theorem sin_pi_mul_ne_zero (hx : x ∈ ℂ_ℤ) : Complex.sin (π * x) ≠ 0 := by
132137 apply Complex.sin_ne_zero_iff.2
133138 intro k
134139 nth_rw 2 [mul_comm]
135140 exact Injective.ne (mul_right_injective₀ (ofReal_ne_zero.mpr Real.pi_ne_zero)) (by aesop)
136141
137- theorem tendsto_logDeriv_euler_sin_div (hx : x ∈ ℂ_ℤ) :
142+ lemma cot_pi_mul_contDiffWithinAt (k : ℕ∞) (hx : x ∈ ℂ_ℤ) :
143+ ContDiffWithinAt ℂ k (fun x ↦ (↑π * x).cot) ℍₒ x := by
144+ simp_rw [Complex.cot, Complex.cos, Complex.sin]
145+ exact ContDiffWithinAt.div (by fun_prop) (by fun_prop) (sin_pi_mul_ne_zero hx)
146+
147+ lemma tendsto_logDeriv_euler_sin_div (hx : x ∈ ℂ_ℤ) :
138148 Tendsto (fun n : ℕ ↦ logDeriv (fun z ↦ ∏ j ∈ Finset.range n, (1 + sineTerm z j)) x)
139149 atTop (𝓝 <| logDeriv (fun t ↦ (Complex.sin (π * t) / (π * t))) x) := by
140150 refine logDeriv_tendsto (isOpen_compl_range_intCast) ⟨x, hx⟩
141151 HasProdLocallyUniformlyOn_euler_sin_prod.tendstoLocallyUniformlyOn_finsetRange ?_ ?_
142152 · filter_upwards with n using by fun_prop
143153 · simp only [ne_eq, div_eq_zero_iff, mul_eq_zero, ofReal_eq_zero, not_or]
144- exact ⟨sin_pi_z_ne_zero hx, Real.pi_ne_zero, integerComplement.ne_zero hx⟩
154+ exact ⟨sin_pi_mul_ne_zero hx, Real.pi_ne_zero, integerComplement.ne_zero hx⟩
145155
146- theorem logDeriv_sin_div_eq_cot (hz : x ∈ ℂ_ℤ) :
156+ lemma logDeriv_sin_div_eq_cot (hz : x ∈ ℂ_ℤ) :
147157 logDeriv (fun t ↦ (Complex.sin (π * t) / (π * t))) x = π * cot (π * x) - 1 / x := by
148158 have : (fun t ↦ (Complex.sin (π * t)/ (π * t))) = fun z ↦
149159 (Complex.sin ∘ fun t ↦ π * t) z / (π * z) := by simp
150- rw [this, logDeriv_div _ (by apply sin_pi_z_ne_zero hz) ?_
160+ rw [this, logDeriv_div _ (by apply sin_pi_mul_ne_zero hz) ?_
151161 (DifferentiableAt.comp _ (Complex.differentiableAt_sin) (by fun_prop)) (by fun_prop),
152162 logDeriv_comp (Complex.differentiableAt_sin) (by fun_prop), Complex.logDeriv_sin,
153163 deriv_const_mul _ (by fun_prop), deriv_id'', logDeriv_const_mul, logDeriv_id']
@@ -159,7 +169,7 @@ theorem logDeriv_sin_div_eq_cot (hz : x ∈ ℂ_ℤ) :
159169/-- The term in the infinite sum expansion of cot. -/
160170noncomputable abbrev cotTerm (x : ℂ) (n : ℕ) : ℂ := 1 / (x - (n + 1 )) + 1 / (x + (n + 1 ))
161171
162- theorem logDeriv_sineTerm_eq_cotTerm (hx : x ∈ ℂ_ℤ) (i : ℕ) :
172+ lemma logDeriv_sineTerm_eq_cotTerm (hx : x ∈ ℂ_ℤ) (i : ℕ) :
163173 logDeriv (fun (z : ℂ) ↦ 1 + sineTerm z i) x = cotTerm x i := by
164174 have h1 := integerComplement_add_ne_zero hx (i + 1 )
165175 have h2 : ((x : ℂ) - (i + 1 )) ≠ 0 := by
@@ -182,7 +192,7 @@ lemma logDeriv_prod_sineTerm_eq_sum_cotTerm (hx : x ∈ ℂ_ℤ) (n : ℕ) :
182192 · exact fun i _ ↦ sineTerm_ne_zero hx i
183193 · fun_prop
184194
185- theorem tendsto_logDeriv_euler_cot_sub (hx : x ∈ ℂ_ℤ) :
195+ lemma tendsto_logDeriv_euler_cot_sub (hx : x ∈ ℂ_ℤ) :
186196 Tendsto (fun n : ℕ => ∑ j ∈ Finset.range n, cotTerm x j) atTop
187197 (𝓝 <| π * cot (π * x)- 1 / x) := by
188198 simp_rw [← logDeriv_sin_div_eq_cot hx, ← logDeriv_prod_sineTerm_eq_sum_cotTerm hx]
@@ -196,7 +206,7 @@ lemma cotTerm_identity (hz : x ∈ ℂ_ℤ) (n : ℕ) :
196206 · simpa [sub_eq_add_neg] using integerComplement_add_ne_zero hz (-(n + 1 ) : ℤ)
197207 · simpa using (integerComplement_add_ne_zero hz ((n : ℤ) + 1 ))
198208
199- theorem Summable_cotTerm (hz : x ∈ ℂ_ℤ) : Summable fun n ↦ cotTerm x n := by
209+ lemma Summable_cotTerm (hz : x ∈ ℂ_ℤ) : Summable fun n ↦ cotTerm x n := by
200210 rw [funext fun n ↦ cotTerm_identity hz n]
201211 apply Summable.mul_left
202212 suffices Summable fun i : ℕ ↦ (x - (↑i : ℂ))⁻¹ * (x + (↑i : ℂ))⁻¹ by
@@ -207,7 +217,7 @@ theorem Summable_cotTerm (hz : x ∈ ℂ_ℤ) : Summable fun n ↦ cotTerm x n :
207217 apply (EisensteinSeries.summable_linear_sub_mul_linear_add x 1 1 ).congr
208218 simp [mul_comm]
209219
210- theorem cot_series_rep' (hz : x ∈ ℂ_ℤ) : π * cot (π * x) - 1 / x =
220+ lemma cot_series_rep' (hz : x ∈ ℂ_ℤ) : π * cot (π * x) - 1 / x =
211221 ∑' n : ℕ, (1 / (x - (n + 1 )) + 1 / (x + (n + 1 ))) := by
212222 rw [HasSum.tsum_eq]
213223 apply (Summable.hasSum_iff_tendsto_nat (Summable_cotTerm hz)).mpr
@@ -223,3 +233,171 @@ theorem cot_series_rep (hz : x ∈ ℂ_ℤ) :
223233 ring
224234
225235end MittagLeffler
236+
237+ section iteratedDeriv
238+
239+ open Set UpperHalfPlane
240+
241+ open scoped Nat
242+
243+ variable (k : ℕ)
244+
245+ private lemma contDiffOn_inv_linear (d : ℤ) : ContDiffOn ℂ k (fun z : ℂ ↦ 1 / (z + d)) ℂ_ℤ := by
246+ simpa using ContDiffOn.inv (by fun_prop) (fun x hx ↦ integerComplement_add_ne_zero hx d)
247+
248+ lemma eqOn_iteratedDeriv_cotTerm (d : ℕ) : EqOn (iteratedDeriv k (fun z ↦ cotTerm z d))
249+ (fun z ↦ (-1 )^ k * k ! * ((z + (d + 1 ))^ (-1 - k : ℤ) + (z - (d + 1 )) ^ (-1 - k : ℤ))) ℂ_ℤ := by
250+ intro z hz
251+ rw [← Pi.add_def, iteratedDeriv_add]
252+ · have h2 := iter_deriv_inv_linear_sub k 1 ((d + 1 : ℂ))
253+ have h3 := iter_deriv_inv_linear k 1 (d + 1 : ℂ)
254+ simp only [one_div, one_mul, one_pow, mul_one, Int.reduceNeg, iteratedDeriv_eq_iterate] at *
255+ rw [h2, h3]
256+ ring
257+ · simpa [sub_eq_add_neg] using (contDiffOn_inv_linear k (-(d + 1 ))).contDiffAt
258+ ((isOpen_compl_range_intCast).mem_nhds hz)
259+ · simpa using (contDiffOn_inv_linear k (d + 1 )).contDiffAt
260+ ((isOpen_compl_range_intCast).mem_nhds hz)
261+
262+ lemma eqOn_iteratedDerivWithin_cotTerm_integerComplement (d : ℕ) :
263+ EqOn (iteratedDerivWithin k (fun z ↦ cotTerm z d) ℂ_ℤ)
264+ (fun z ↦ (-1 ) ^ k * k ! * ((z + (d + 1 )) ^ (-1 - k : ℤ) +
265+ (z - (d + 1 )) ^ (-1 - k : ℤ))) ℂ_ℤ := by
266+ apply Set.EqOn.trans (iteratedDerivWithin_of_isOpen isOpen_compl_range_intCast)
267+ exact eqOn_iteratedDeriv_cotTerm ..
268+
269+ lemma eqOn_iteratedDerivWithin_cotTerm_upperHalfPlaneSet (d : ℕ) :
270+ EqOn (iteratedDerivWithin k (fun z ↦ cotTerm z d) ℍₒ)
271+ (fun z ↦ (-1 ) ^ k * k ! * ((z + (d + 1 )) ^ (-1 - k : ℤ) +
272+ (z - (d + 1 )) ^ (-1 - k : ℤ))) ℍₒ := by
273+ apply Set.EqOn.trans (upperHalfPlane_inter_integerComplement ▸
274+ iteratedDerivWithin_congr_right_of_isOpen (fun z ↦ cotTerm z d) k
275+ isOpen_upperHalfPlaneSet (isOpen_compl_range_intCast))
276+ intro z hz
277+ simpa using eqOn_iteratedDerivWithin_cotTerm_integerComplement k d
278+ (coe_mem_integerComplement ⟨z, hz⟩)
279+
280+ open EisensteinSeries in
281+ private noncomputable abbrev cotTermUpperBound (A B : ℝ) (hB : 0 < B) (a : ℕ) :=
282+ k ! * (2 * (r (⟨⟨A, B⟩, by simp [hB]⟩) ^ (-1 - k : ℤ)) * ‖((a + 1 ) ^ (-1 - k : ℤ) : ℝ)‖)
283+
284+ private lemma summable_cotTermUpperBound (A B : ℝ) (hB : 0 < B) {k : ℕ} (hk : 1 ≤ k) :
285+ Summable fun a : ℕ ↦ cotTermUpperBound k A B hB a := by
286+ simp_rw [← mul_assoc]
287+ apply Summable.mul_left
288+ conv => enter [1 , n]; rw [show (-1 - k : ℤ) = -(1 + k :) by omega, zpow_neg, zpow_natCast];
289+ enter [1 , 1 , 1 ]; norm_cast
290+ rw [summable_norm_iff, summable_nat_add_iff (f := fun n : ℕ ↦ ((n : ℝ) ^ (1 + k))⁻¹)]
291+ exact summable_nat_pow_inv.mpr <| by omega
292+
293+ open EisensteinSeries in
294+ private lemma iteratedDerivWithin_cotTerm_bounded_uniformly
295+ {k : ℕ} (hk : 1 ≤ k) {K : Set ℂ} (hK : K ⊆ ℍₒ) (A B : ℝ) (hB : 0 < B)
296+ (HABK : inclusion hK '' univ ⊆ verticalStrip A B) (n : ℕ) {a : ℂ} (ha : a ∈ K) :
297+ ‖iteratedDerivWithin k (fun z ↦ cotTerm z n) ℍₒ a‖ ≤ cotTermUpperBound k A B hB n := by
298+ simp only [eqOn_iteratedDerivWithin_cotTerm_upperHalfPlaneSet k n (hK ha), Complex.norm_mul,
299+ norm_pow, norm_neg,norm_one, one_pow, Complex.norm_natCast, one_mul, cotTermUpperBound,
300+ Int.reduceNeg, norm_zpow, Real.norm_eq_abs, two_mul, add_mul]
301+ gcongr
302+ have h1 := summand_bound_of_mem_verticalStrip (k := k + 1 ) (by norm_cast; omega) ![1 , n + 1 ] hB
303+ (z := ⟨a, (hK ha)⟩) (A := A) (by aesop)
304+ have h2 := abs_norm_eq_max_natAbs_neg n ▸ (summand_bound_of_mem_verticalStrip (k := k + 1 )
305+ (by norm_cast; omega) ![1 , -(n + 1 )] hB (z := ⟨a, (hK ha)⟩) (A := A) (by aesop))
306+ simp only [Fin.isValue, Matrix.cons_val_zero, Int.cast_one, coe_mk_subtype, one_mul,
307+ Matrix.cons_val_one, Matrix.cons_val_fin_one, Int.cast_add, Int.cast_natCast, neg_add_rev,
308+ abs_norm_eq_max_natAbs, Int.reduceNeg, Int.cast_neg, sub_eq_add_neg, ge_iff_le] at h1 h2 ⊢
309+ refine le_trans (norm_add_le _ _) (add_le_add ?_ ?_) <;>
310+ {simp only [Int.reduceNeg, norm_zpow]; norm_cast at h1 h2 ⊢}
311+
312+ lemma summableLocallyUniformlyOn_iteratedDerivWithin_cotTerm {k : ℕ} (hk : 1 ≤ k) :
313+ SummableLocallyUniformlyOn (fun n ↦ iteratedDerivWithin k (fun z ↦ cotTerm z n) ℍₒ) ℍₒ := by
314+ apply SummableLocallyUniformlyOn_of_locally_bounded isOpen_upperHalfPlaneSet
315+ intro K hK hKc
316+ obtain ⟨A, B, hB, HABK⟩ := subset_verticalStrip_of_isCompact
317+ ((isCompact_iff_isCompact_univ.mp hKc).image_of_continuousOn
318+ (continuous_inclusion hK |>.continuousOn))
319+ exact ⟨cotTermUpperBound k A B hB, summable_cotTermUpperBound A B hB hk,
320+ iteratedDerivWithin_cotTerm_bounded_uniformly hk hK A B hB HABK⟩
321+
322+ lemma differentiableOn_iteratedDerivWithin_cotTerm (n l : ℕ) :
323+ DifferentiableOn ℂ (iteratedDerivWithin l (fun z ↦ cotTerm z n) ℍₒ) ℍₒ := by
324+ suffices DifferentiableOn ℂ (fun z : ℂ ↦ (-1 ) ^ l * l ! * ((z + (n + 1 )) ^ (-1 - l : ℤ) +
325+ (z - (n + 1 )) ^ (-1 - l : ℤ))) ℍₒ by
326+ exact this.congr fun z hz ↦ eqOn_iteratedDerivWithin_cotTerm_upperHalfPlaneSet l n hz
327+ apply DifferentiableOn.const_mul
328+ apply DifferentiableOn.add <;> refine DifferentiableOn.zpow (by fun_prop) <| .inl fun x hx ↦ ?_
329+ · simpa [add_eq_zero_iff_neg_eq'] using (UpperHalfPlane.ne_int ⟨x, hx⟩ (-(n + 1 ))).symm
330+ · simpa [sub_eq_zero] using (UpperHalfPlane.ne_int ⟨x, hx⟩ (n + 1 ))
331+
332+ private lemma aux_summable_add {k : ℕ} (hk : 1 ≤ k) (x : ℂ) :
333+ Summable fun (n : ℕ) ↦ (x + (n + 1 )) ^ (-1 - k : ℤ) := by
334+ apply ((summable_nat_add_iff 1 ).mpr (summable_int_iff_summable_nat_and_neg.mp
335+ (EisensteinSeries.linear_right_summable x 1 (k := k + 1 ) (by omega))).1 ).congr
336+ simp [← zpow_neg, sub_eq_add_neg]
337+
338+ private lemma aux_summable_sub {k : ℕ} (hk : 1 ≤ k) (x : ℂ) :
339+ Summable fun (n : ℕ) ↦ (x - (n + 1 )) ^ (-1 - k : ℤ) := by
340+ apply ((summable_nat_add_iff 1 ).mpr (summable_int_iff_summable_nat_and_neg.mp
341+ (EisensteinSeries.linear_right_summable x 1 (k := k + 1 ) (by omega))).2 ).congr
342+ simp [← zpow_neg, sub_eq_add_neg]
343+
344+ variable {z : ℂ}
345+
346+ -- We have this auxiliary ugly version on the lhs so the the rhs looks nicer.
347+ private lemma aux_iteratedDeriv_tsum_cotTerm {k : ℕ} (hk : 1 ≤ k) (hz : z ∈ ℍₒ) :
348+ (-1 ) ^ k * (k !) * z ^ (-1 - k : ℤ) + iteratedDerivWithin k
349+ (fun z ↦ ∑' n : ℕ, cotTerm z n) ℍₒ z =
350+ (-1 ) ^ k * k ! * ∑' n : ℤ, (z + n) ^ (-1 - k : ℤ) := by
351+ rw [iteratedDerivWithin_tsum k isOpen_upperHalfPlaneSet hz
352+ (fun t ht ↦ Summable_cotTerm (coe_mem_integerComplement ⟨t, ht⟩))
353+ (fun l hl hl2 ↦ summableLocallyUniformlyOn_iteratedDerivWithin_cotTerm hl)
354+ (fun n l z hl hz ↦ (differentiableOn_iteratedDerivWithin_cotTerm n l).differentiableAt
355+ (isOpen_upperHalfPlaneSet.mem_nhds hz))]
356+ conv =>
357+ enter [1 , 2 , 1 , n]
358+ rw [eqOn_iteratedDerivWithin_cotTerm_upperHalfPlaneSet k n (by simp [hz])]
359+ rw [tsum_of_add_one_of_neg_add_one (by simpa using aux_summable_add hk z)
360+ (by simpa [sub_eq_add_neg] using aux_summable_sub hk z),
361+ tsum_mul_left, Summable.tsum_add (aux_summable_add hk z) (aux_summable_sub hk z)]
362+ push_cast
363+ ring_nf
364+
365+ lemma iteratedDerivWithin_cot_sub_inv_eq_add_mul_tsum {k : ℕ} (hk : 1 ≤ k) (hz : z ∈ ℍₒ) :
366+ iteratedDerivWithin k (fun x : ℂ ↦ π * cot (π * x) - 1 / x) ℍₒ z =
367+ -(-1 ) ^ k * k ! * (z ^ (-1 - k : ℤ)) + (-1 ) ^ k * k ! * ∑' n : ℤ, (z + n) ^ (-1 - k : ℤ) := by
368+ simp only [← aux_iteratedDeriv_tsum_cotTerm hk hz, one_div, neg_mul, neg_add_cancel_left]
369+ refine iteratedDerivWithin_congr (fun z hz ↦ ?_) hz
370+ simpa [cotTerm] using (cot_series_rep' (UpperHalfPlane.coe_mem_integerComplement ⟨z, hz⟩))
371+
372+ private lemma iteratedDerivWithin_cot_pi_mul_sub_inv {z : ℂ} (hz : z ∈ ℍₒ) :
373+ iteratedDerivWithin k (fun x : ℂ ↦ π * cot (π * x) - 1 / x) ℍₒ z =
374+ (iteratedDerivWithin k (fun x : ℂ ↦ π * cot (π * x)) ℍₒ z) -
375+ (-1 ) ^ k * k ! * (z ^ (-1 - k : ℤ)) := by
376+ simp_rw [sub_eq_add_neg]
377+ rw [iteratedDerivWithin_fun_add hz isOpen_upperHalfPlaneSet.uniqueDiffOn]
378+ · simpa [iteratedDerivWithin_fun_neg] using iteratedDerivWithin_one_div k
379+ isOpen_upperHalfPlaneSet hz
380+ · exact ContDiffWithinAt.smul (by fun_prop) (cot_pi_mul_contDiffWithinAt k
381+ (UpperHalfPlane.coe_mem_integerComplement ⟨z, hz⟩))
382+ · simp only [one_div]
383+ apply ContDiffWithinAt.neg
384+ exact ContDiffWithinAt.inv (by fun_prop) (ne_zero ⟨z, hz⟩)
385+
386+ lemma iteratedDerivWithin_cot_pi_mul_eq_mul_tsum_zpow {k : ℕ} (hk : 1 ≤ k) {z : ℂ} (hz : z ∈ ℍₒ) :
387+ iteratedDerivWithin k (fun x : ℂ ↦ π * cot (π * x)) ℍₒ z =
388+ (-1 ) ^ k * k ! * ∑' n : ℤ, (z + n) ^ (-1 - k : ℤ):= by
389+ have h0 := iteratedDerivWithin_cot_pi_mul_sub_inv k hz
390+ rw [iteratedDerivWithin_cot_sub_inv_eq_add_mul_tsum hk hz, add_comm] at h0
391+ rw [← add_left_inj (-(-1 ) ^ k * k ! * z ^ (-1 - k : ℤ)), h0]
392+ ring
393+
394+ /-- The series expansion of the iterated derivative of `π cot (π z)`. -/
395+ theorem iteratedDerivWithin_cot_pi_mul_eq_mul_tsum_div_pow {k : ℕ} (hk : 1 ≤ k) {z : ℂ}
396+ (hz : z ∈ ℍₒ) :
397+ iteratedDerivWithin k (fun x : ℂ ↦ π * cot (π * x)) ℍₒ z =
398+ (-1 ) ^ k * k ! * ∑' n : ℤ, 1 / (z + n) ^ (k + 1 ) := by
399+ convert iteratedDerivWithin_cot_pi_mul_eq_mul_tsum_zpow hk hz with n
400+ rw [show (-1 - k : ℤ) = -(k + 1 :) by norm_cast; omega, zpow_neg_coe_of_pos _ (by omega),
401+ one_div]
402+
403+ end iteratedDeriv
0 commit comments