|
| 1 | +/- |
| 2 | +Copyright (c) 2025 Chris Birkbeck. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Chris Birkbeck |
| 5 | +-/ |
| 6 | +module |
| 7 | + |
| 8 | +public import Mathlib.Analysis.SpecificLimits.Normed |
| 9 | +public import Mathlib.NumberTheory.ArithmeticFunction.Misc |
| 10 | + |
| 11 | + |
| 12 | +/-! |
| 13 | +# Lemmas on infinite sums over the antidiagonal of the divisors function |
| 14 | +
|
| 15 | +This file contains lemmas about the antidiagonal of the divisors function. It defines the map from |
| 16 | +`Nat.divisorsAntidiagonal n` to `ℕ+ × ℕ+` given by sending `n = a * b` to `(a, b)`. |
| 17 | +
|
| 18 | +We then prove some identities about the infinite sums over this antidiagonal, such as |
| 19 | +`∑' n : ℕ+, n ^ k * r ^ n / (1 - r ^ n) = ∑' n : ℕ+, σ k n * r ^ n` |
| 20 | +which are used for Eisenstein series and their q-expansions. This is also a special case of |
| 21 | +Lambert series. |
| 22 | +
|
| 23 | +-/ |
| 24 | + |
| 25 | +@[expose] public section |
| 26 | + |
| 27 | +open Filter Complex ArithmeticFunction Nat Topology |
| 28 | + |
| 29 | +/-- The map from `Nat.divisorsAntidiagonal n` to `ℕ+ × ℕ+` given by sending `n = a * b` |
| 30 | +to `(a, b)`. -/ |
| 31 | +def divisorsAntidiagonalFactors (n : ℕ+) : Nat.divisorsAntidiagonal n → ℕ+ × ℕ+ := fun x ↦ |
| 32 | + ⟨⟨x.1.1, Nat.pos_of_mem_divisors (Nat.fst_mem_divisors_of_mem_antidiagonal x.2)⟩, |
| 33 | + (⟨x.1.2, Nat.pos_of_mem_divisors (Nat.snd_mem_divisors_of_mem_antidiagonal x.2)⟩ : ℕ+), |
| 34 | + Nat.pos_of_mem_divisors (Nat.snd_mem_divisors_of_mem_antidiagonal x.2)⟩ |
| 35 | + |
| 36 | +lemma divisorsAntidiagonalFactors_eq {n : ℕ+} (x : Nat.divisorsAntidiagonal n) : |
| 37 | + (divisorsAntidiagonalFactors n x).1.1 * (divisorsAntidiagonalFactors n x).2.1 = n := by |
| 38 | + simp [divisorsAntidiagonalFactors, (Nat.mem_divisorsAntidiagonal.mp x.2).1] |
| 39 | + |
| 40 | +lemma divisorsAntidiagonalFactors_one (x : Nat.divisorsAntidiagonal 1) : |
| 41 | + (divisorsAntidiagonalFactors 1 x) = (1, 1) := by |
| 42 | + have h := Nat.mem_divisorsAntidiagonal.mp x.2 |
| 43 | + simp only [mul_eq_one, ne_eq, one_ne_zero, not_false_eq_true, and_true] at h |
| 44 | + simp [divisorsAntidiagonalFactors, h.1, h.2] |
| 45 | + |
| 46 | +/-- The equivalence from the union over `n` of `Nat.divisorsAntidiagonal n` to `ℕ+ × ℕ+` |
| 47 | +given by sending `n = a * b` to `(a, b)`. -/ |
| 48 | +def sigmaAntidiagonalEquivProd : (Σ n : ℕ+, Nat.divisorsAntidiagonal n) ≃ ℕ+ × ℕ+ where |
| 49 | + toFun x := divisorsAntidiagonalFactors x.1 x.2 |
| 50 | + invFun x := |
| 51 | + ⟨⟨x.1.val * x.2.val, mul_pos x.1.2 x.2.2⟩, ⟨x.1, x.2⟩, by simp [Nat.mem_divisorsAntidiagonal]⟩ |
| 52 | + left_inv := by |
| 53 | + rintro ⟨n, ⟨k, l⟩, h⟩ |
| 54 | + rw [Nat.mem_divisorsAntidiagonal] at h |
| 55 | + ext <;> simp [divisorsAntidiagonalFactors, ← PNat.coe_injective.eq_iff, h.1] |
| 56 | + right_inv _ := rfl |
| 57 | + |
| 58 | +lemma sigmaAntidiagonalEquivProd_symm_apply_fst (x : ℕ+ × ℕ+) : |
| 59 | + (sigmaAntidiagonalEquivProd.symm x).1 = x.1.1 * x.2.1 := rfl |
| 60 | + |
| 61 | +lemma sigmaAntidiagonalEquivProd_symm_apply_snd (x : ℕ+ × ℕ+) : |
| 62 | + (sigmaAntidiagonalEquivProd.symm x).2 = (x.1.1, x.2.1) := rfl |
| 63 | + |
| 64 | +section tsum |
| 65 | + |
| 66 | +variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] [CompleteSpace 𝕜] [NormSMulClass ℤ 𝕜] |
| 67 | + |
| 68 | +omit [NormSMulClass ℤ 𝕜] in |
| 69 | +lemma summable_norm_pow_mul_geometric_div_one_sub (k : ℕ) {r : 𝕜} (hr : ‖r‖ < 1) : |
| 70 | + Summable fun n : ℕ ↦ n ^ k * r ^ n / (1 - r ^ n) := by |
| 71 | + simp only [div_eq_mul_one_div (_ * _ ^ _)] |
| 72 | + apply Summable.mul_tendsto_const (c := 1 / (1 - 0)) |
| 73 | + (by simpa using summable_norm_pow_mul_geometric_of_norm_lt_one k hr) |
| 74 | + simpa only [Nat.cofinite_eq_atTop] using |
| 75 | + tendsto_const_nhds.div ((tendsto_pow_atTop_nhds_zero_of_norm_lt_one hr).const_sub 1) (by simp) |
| 76 | + |
| 77 | +private lemma summable_divisorsAntidiagonal_aux (k : ℕ) {r : 𝕜} (hr : ‖r‖ < 1) : |
| 78 | + Summable fun c : (n : ℕ+) × {x // x ∈ (n : ℕ).divisorsAntidiagonal} ↦ |
| 79 | + (c.2.1.2) ^ k * (r ^ (c.2.1.1 * c.2.1.2)) := by |
| 80 | + apply Summable.of_norm |
| 81 | + rw [summable_sigma_of_nonneg (fun a ↦ by positivity)] |
| 82 | + constructor |
| 83 | + · exact fun n ↦ (hasSum_fintype _).summable |
| 84 | + · simp only [norm_mul, norm_pow, tsum_fintype, Finset.univ_eq_attach] |
| 85 | + apply Summable.of_nonneg_of_le (f := fun c : ℕ+ ↦ ‖(c : 𝕜) ^ (k + 1) * r ^ (c : ℕ)‖) |
| 86 | + (fun b ↦ Finset.sum_nonneg (fun _ _ ↦ mul_nonneg (by simp) (by simp))) (fun b ↦ ?_) |
| 87 | + (by apply (summable_norm_pow_mul_geometric_of_norm_lt_one (k + 1) hr).subtype) |
| 88 | + transitivity ∑ _ ∈ (b : ℕ).divisors, ‖(b : 𝕜)‖ ^ k * ‖r ^ (b : ℕ)‖ |
| 89 | + · rw [(b : ℕ).divisorsAntidiagonal.sum_attach (fun x ↦ ‖(x.2 : 𝕜)‖ ^ _ * _ ^ (x.1 * x.2)), |
| 90 | + sum_divisorsAntidiagonal ((fun x y ↦ ‖(y : 𝕜)‖ ^ k * _ ^ (x * y)))] |
| 91 | + gcongr with i hi |
| 92 | + · simpa using le_of_dvd b.2 (div_dvd_of_dvd (dvd_of_mem_divisors hi)) |
| 93 | + · rw [norm_pow, mul_comm, Nat.div_mul_cancel (dvd_of_mem_divisors hi)] |
| 94 | + · simp only [norm_pow, Finset.sum_const, nsmul_eq_mul, ← mul_assoc, add_comm k 1, pow_add, |
| 95 | + pow_one, norm_mul] |
| 96 | + gcongr |
| 97 | + simpa using Nat.card_divisors_le_self b |
| 98 | + |
| 99 | +theorem summable_prod_mul_pow (k : ℕ) {r : 𝕜} (hr : ‖r‖ < 1) : |
| 100 | + Summable fun c : (ℕ+ × ℕ+) ↦ c.2 ^ k * (r ^ (c.1 * c.2 : ℕ)) := by |
| 101 | + simpa [sigmaAntidiagonalEquivProd.summable_iff.symm] using summable_divisorsAntidiagonal_aux k hr |
| 102 | + |
| 103 | +-- access notation `σ` |
| 104 | +open scoped sigma |
| 105 | + |
| 106 | +theorem tsum_prod_pow_eq_tsum_sigma (k : ℕ) {r : 𝕜} (hr : ‖r‖ < 1) : |
| 107 | + ∑' d : ℕ+, ∑' c : ℕ+, c ^ k * r ^ (d * c : ℕ) = ∑' e : ℕ+, σ k e * r ^ (e : ℕ) := by |
| 108 | + suffices ∑' c : ℕ+ × ℕ+, c.2 ^ k * r ^ (c.1 * c.2 : ℕ) = |
| 109 | + ∑' e : ℕ+, σ k e * r ^ (e : ℕ) by rwa [← (summable_prod_mul_pow k hr).tsum_prod] |
| 110 | + simp only [← sigmaAntidiagonalEquivProd.tsum_eq, sigmaAntidiagonalEquivProd, |
| 111 | + divisorsAntidiagonalFactors, PNat.mk_coe, Equiv.coe_fn_mk, sigma_eq_sum_div, cast_sum, |
| 112 | + cast_pow, Summable.tsum_sigma (summable_divisorsAntidiagonal_aux k hr)] |
| 113 | + refine tsum_congr fun n ↦ ?_ |
| 114 | + simpa [tsum_fintype, Finset.sum_mul, |
| 115 | + (n : ℕ).divisorsAntidiagonal.sum_attach fun x : ℕ × ℕ ↦ x.2 ^ k * r ^ (x.1 * x.2), |
| 116 | + sum_divisorsAntidiagonal fun x y ↦ y ^ k * r ^ (x * y)] |
| 117 | + using Finset.sum_congr rfl fun i hi ↦ by rw [Nat.mul_div_cancel' (dvd_of_mem_divisors hi)] |
| 118 | + |
| 119 | +lemma tsum_pow_div_one_sub_eq_tsum_sigma {r : 𝕜} (hr : ‖r‖ < 1) (k : ℕ) : |
| 120 | + ∑' n : ℕ+, n ^ k * r ^ (n : ℕ) / (1 - r ^ (n : ℕ)) = ∑' n : ℕ+, σ k n * r ^ (n : ℕ) := by |
| 121 | + have (m : ℕ) [NeZero m] := tsum_geometric_of_norm_lt_one (ξ := r ^ m) |
| 122 | + (by simpa using pow_lt_one₀ (by simp) hr (NeZero.ne _)) |
| 123 | + simp only [div_eq_mul_inv, ← this, ← tsum_mul_left, mul_assoc, ← _root_.pow_succ', |
| 124 | + ← fun (n : ℕ) ↦ tsum_pnat_eq_tsum_succ (f := fun m ↦ n ^ k * (r ^ n) ^ m)] |
| 125 | + have h00 := tsum_prod_pow_eq_tsum_sigma k hr |
| 126 | + rw [Summable.tsum_comm (by apply (summable_prod_mul_pow k hr).prod_symm)] at h00 |
| 127 | + rw [← h00] |
| 128 | + exact tsum_congr₂ <| fun b c ↦ by simp [mul_comm c.val b.val, pow_mul] |
| 129 | + |
| 130 | +omit [CompleteSpace 𝕜] [NormSMulClass ℤ 𝕜] in |
| 131 | +lemma tendsto_zero_geometric_tsum_pnat {r : 𝕜} (hr : ‖r‖ < 1) : |
| 132 | + Tendsto (fun m : ℕ+ ↦ ∑' n : ℕ+, r ^ (n * m : ℕ)) atTop (𝓝 0) := by |
| 133 | + have h1 (m : ℕ+) : ‖r ^ (m : ℕ)‖ < 1 := by |
| 134 | + rwa [norm_pow, pow_lt_one_iff_of_nonneg (norm_nonneg _) (NeZero.ne _)] |
| 135 | + have h2 (m : ℕ+) : ∑' n : ℕ+, r ^ (n * m : ℕ) = (1 - r ^ (m : ℕ))⁻¹ - 1 := by |
| 136 | + have := tsum_geometric_of_norm_lt_one (h1 m) |
| 137 | + rw [← tsum_zero_pnat_eq_tsum_nat (summable_geometric_of_norm_lt_one (h1 m))] at this |
| 138 | + simp_rw [← this, pow_zero, add_sub_cancel_left, mul_comm, pow_mul] |
| 139 | + rw [funext h2, (by simp : 𝓝 (0 : 𝕜) = 𝓝 ((1 - 0)⁻¹ - 1)), tendsto_sub_const_iff, |
| 140 | + tendsto_inv_iff₀ (by simp), tendsto_const_sub_iff] |
| 141 | + exact (tendsto_pow_atTop_nhds_zero_of_norm_lt_one hr).comp <| tendsto_PNat_val_atTop_atTop |
| 142 | + |
| 143 | +end tsum |
0 commit comments