Skip to content

Commit 611298f

Browse files
CBirkbeckrobertmaxton42
authored andcommitted
feat(NumberTheory/Divisors): divisors antidiagonal tsum (leanprover-community#28690)
1 parent 0a47e8f commit 611298f

File tree

10 files changed

+99
-9
lines changed

10 files changed

+99
-9
lines changed

Mathlib/Analysis/Asymptotics/Lemmas.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,12 @@ lemma Asymptotics.IsBigO.comp_summable_norm {ι E F : Type*}
672672
summable_of_isBigO hg <| hf.norm_norm.comp_tendsto <|
673673
tendsto_zero_iff_norm_tendsto_zero.2 hg.tendsto_cofinite_zero
674674

675+
lemma Summable.mul_tendsto_const {F ι : Type*} [NormedRing F] [NormMulClass F] [NormOneClass F]
676+
[CompleteSpace F] {f g : ι → F} (hf : Summable fun n ↦ ‖f n‖) {c : F}
677+
(hg : Tendsto g cofinite (𝓝 c)) : Summable fun n ↦ f n * g n := by
678+
apply summable_of_isBigO hf
679+
simpa using (isBigO_const_mul_self 1 f _).mul (hg.isBigO_one F)
680+
675681
namespace PartialHomeomorph
676682

677683
variable {α : Type*} {β : Type*} [TopologicalSpace α] [TopologicalSpace β]

Mathlib/Analysis/Complex/Exponential.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ lemma norm_exp_sub_sum_le_exp_norm_sub_sum (x : ℂ) (n : ℕ) :
455455
rw [sum_range_sub_sum_range hj, sum_range_sub_sum_range hj]
456456
refine (IsAbsoluteValue.abv_sum norm ..).trans_eq ?_
457457
congr with i
458-
simp [Complex.norm_pow]
458+
simp [Complex.norm_pow, Complex.norm_natCast]
459459
_ ≤ Real.exp ‖x‖ - ∑ m ∈ range n, ‖x‖ ^ m / m.factorial := by
460460
gcongr
461461
exact Real.sum_le_exp_of_nonneg (norm_nonneg _) _

Mathlib/Analysis/Complex/Norm.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ protected theorem norm_of_nonneg {r : ℝ} (h : 0 ≤ r) : ‖(r : ℂ)‖ = r :
104104
@[simp, norm_cast]
105105
lemma nnnorm_real (r : ℝ) : ‖(r : ℂ)‖₊ = ‖r‖₊ := by ext; exact norm_real _
106106

107-
@[simp 1100, norm_cast]
107+
@[norm_cast]
108108
lemma norm_natCast (n : ℕ) : ‖(n : ℂ)‖ = n := Complex.norm_of_nonneg n.cast_nonneg
109109

110110
@[simp 1100]
@@ -114,7 +114,7 @@ lemma norm_ofNat (n : ℕ) [n.AtLeastTwo] :
114114
protected lemma norm_two : ‖(2 : ℂ)‖ = 2 := norm_ofNat 2
115115

116116
@[simp 1100, norm_cast]
117-
lemma nnnorm_natCast (n : ℕ) : ‖(n : ℂ)‖₊ = n := Subtype.ext <| by simp
117+
lemma nnnorm_natCast (n : ℕ) : ‖(n : ℂ)‖₊ = n := Subtype.ext <| by simp [norm_natCast]
118118

119119
@[simp 1100]
120120
lemma nnnorm_ofNat (n : ℕ) [n.AtLeastTwo] :

Mathlib/Analysis/Normed/Group/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ theorem norm_of_nonpos (hr : r ≤ 0) : ‖r‖ = -r :=
10811081
theorem le_norm_self (r : ℝ) : r ≤ ‖r‖ :=
10821082
le_abs_self r
10831083

1084-
@[simp 1100] lemma norm_natCast (n : ℕ) : ‖(n : ℝ)‖ = n := abs_of_nonneg n.cast_nonneg
1084+
lemma norm_natCast (n : ℕ) : ‖(n : ℝ)‖ = n := abs_of_nonneg n.cast_nonneg
10851085
@[simp 1100] lemma nnnorm_natCast (n : ℕ) : ‖(n : ℝ)‖₊ = n := NNReal.eq <| norm_natCast _
10861086
@[simp 1100] lemma enorm_natCast (n : ℕ) : ‖(n : ℝ)‖ₑ = n := by simp [enorm]
10871087

Mathlib/Analysis/Normed/Group/Int.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ theorem norm_cast_real (m : ℤ) : ‖(m : ℝ)‖ = ‖m‖ :=
2525
theorem norm_eq_abs (n : ℤ) : ‖n‖ = |(n : ℝ)| :=
2626
rfl
2727

28-
@[simp]
2928
theorem norm_natCast (n : ℕ) : ‖(n : ℤ)‖ = n := by simp [Int.norm_eq_abs]
3029

3130
theorem _root_.NNReal.natCast_natAbs (n : ℤ) : (n.natAbs : ℝ≥0) = ‖n‖₊ :=
@@ -48,7 +47,7 @@ variable [SeminormedCommGroup α]
4847

4948
@[to_additive norm_zsmul_le]
5049
theorem norm_zpow_le_mul_norm (n : ℤ) (a : α) : ‖a ^ n‖ ≤ ‖n‖ * ‖a‖ := by
51-
rcases n.eq_nat_or_neg with ⟨n, rfl | rfl⟩ <;> simpa using norm_pow_le_mul_norm
50+
rcases n.eq_nat_or_neg with ⟨n, rfl | rfl⟩ <;> simpa [Int.norm_natCast] using norm_pow_le_mul_norm
5251

5352
@[to_additive nnnorm_zsmul_le]
5453
theorem nnnorm_zpow_le_mul_norm (n : ℤ) (a : α) : ‖a ^ n‖₊ ≤ ‖n‖₊ * ‖a‖₊ := by

Mathlib/Analysis/Normed/Module/Basic.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ theorem norm_natCast_eq_mul_norm_one (α) [SeminormedRing α] [NormSMulClass ℤ
7171
‖(n : α)‖ = n * ‖(1 : α)‖ := by
7272
simpa using norm_intCast_eq_abs_mul_norm_one α n
7373

74+
@[simp]
75+
lemma norm_natCast {α : Type*} [SeminormedRing α] [NormOneClass α] [NormSMulClass ℤ α]
76+
(a : ℕ) : ‖(a : α)‖ = a := by
77+
simpa using norm_natCast_eq_mul_norm_one α a
78+
7479
theorem eventually_nhds_norm_smul_sub_lt (c : 𝕜) (x : E) {ε : ℝ} (h : 0 < ε) :
7580
∀ᶠ y in 𝓝 x, ‖c • (y - x)‖ < ε :=
7681
have : Tendsto (fun y ↦ ‖c • (y - x)‖) (𝓝 x) (𝓝 0) :=

Mathlib/Analysis/RCLike/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ theorem ratCast_im (q : ℚ) : im (q : K) = 0 := by rw [← ofReal_ratCast, ofRe
611611
theorem norm_of_nonneg {r : ℝ} (h : 0 ≤ r) : ‖(r : K)‖ = r :=
612612
(norm_ofReal _).trans (abs_of_nonneg h)
613613

614-
@[simp, rclike_simps, norm_cast]
614+
@[simp 1100, rclike_simps, norm_cast]
615615
theorem norm_natCast (n : ℕ) : ‖(n : K)‖ = n := by
616616
rw [← ofReal_natCast]
617617
exact norm_of_nonneg (Nat.cast_nonneg n)

Mathlib/NumberTheory/ArithmeticFunction.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,9 @@ theorem sigma_one_apply_prime_pow {p i : ℕ} (hp : p.Prime) :
831831
σ 1 (p ^ i) = ∑ k ∈ .range (i + 1), p ^ k := by
832832
simp [sigma_apply_prime_pow hp]
833833

834+
theorem sigma_eq_sum_div (k n : ℕ) : sigma k n = ∑ d ∈ Nat.divisors n, (n / d) ^ k := by
835+
rw [sigma_apply, ← Nat.sum_div_divisors]
836+
834837
theorem sigma_zero_apply (n : ℕ) : σ 0 n = #n.divisors := by simp [sigma_apply]
835838

836839
theorem sigma_zero_apply_prime_pow {p i : ℕ} (hp : p.Prime) : σ 0 (p ^ i) = i + 1 := by

Mathlib/NumberTheory/TsumDivsorsAntidiagonal.lean

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,24 @@ Copyright (c) 2025 Chris Birkbeck. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Chris Birkbeck
55
-/
6-
import Mathlib.NumberTheory.Divisors
7-
import Mathlib.Data.PNat.Defs
6+
import Mathlib.Analysis.SpecificLimits.Normed
7+
import Mathlib.NumberTheory.ArithmeticFunction
88

99
/-!
1010
# Lemmas on infinite sums over the antidiagonal of the divisors function
1111
1212
This file contains lemmas about the antidiagonal of the divisors function. It defines the map from
1313
`Nat.divisorsAntidiagonal n` to `ℕ+ × ℕ+` given by sending `n = a * b` to `(a, b)`.
1414
15+
We then prove some identities about the infinite sums over this antidiagonal, such as
16+
`∑' n : ℕ+, n ^ k * r ^ n / (1 - r ^ n) = ∑' n : ℕ+, σ k n * r ^ n`
17+
which are used for Eisenstein series and their q-expansions. This is also a special case of
18+
Lambert series.
19+
1520
-/
1621

22+
open Filter Complex ArithmeticFunction Nat Topology
23+
1724
/-- The map from `Nat.divisorsAntidiagonal n` to `ℕ+ × ℕ+` given by sending `n = a * b`
1825
to `(a, b)`. -/
1926
def divisorsAntidiagonalFactors (n : ℕ+) : Nat.divisorsAntidiagonal n → ℕ+ × ℕ+ := fun x ↦
@@ -48,3 +55,68 @@ lemma sigmaAntidiagonalEquivProd_symm_apply_fst (x : ℕ+ × ℕ+) :
4855

4956
lemma sigmaAntidiagonalEquivProd_symm_apply_snd (x : ℕ+ × ℕ+) :
5057
(sigmaAntidiagonalEquivProd.symm x).2 = (x.1.1, x.2.1) := rfl
58+
59+
section tsum
60+
61+
variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] [CompleteSpace 𝕜] [NormSMulClass ℤ 𝕜]
62+
63+
omit [NormSMulClass ℤ 𝕜] in
64+
lemma summable_norm_pow_mul_geometric_div_one_sub (k : ℕ) {r : 𝕜} (hr : ‖r‖ < 1) :
65+
Summable fun n : ℕ ↦ n ^ k * r ^ n / (1 - r ^ n) := by
66+
simp only [div_eq_mul_one_div ( _ * _ ^ _)]
67+
apply Summable.mul_tendsto_const (c := 1 / (1 - 0))
68+
(by simpa using summable_norm_pow_mul_geometric_of_norm_lt_one k hr)
69+
simpa only [Nat.cofinite_eq_atTop] using
70+
tendsto_const_nhds.div ((tendsto_pow_atTop_nhds_zero_of_norm_lt_one hr).const_sub 1) (by simp)
71+
72+
private lemma summable_divisorsAntidiagonal_aux (k : ℕ) {r : 𝕜} (hr : ‖r‖ < 1) :
73+
Summable fun c : (n : ℕ+) × {x // x ∈ (n : ℕ).divisorsAntidiagonal} ↦
74+
(c.2.1.2) ^ k * (r ^ (c.2.1.1 * c.2.1.2)) := by
75+
apply Summable.of_norm
76+
rw [summable_sigma_of_nonneg (fun a ↦ by positivity)]
77+
constructor
78+
· exact fun n ↦ (hasSum_fintype _).summable
79+
· simp only [norm_mul, norm_pow, tsum_fintype, Finset.univ_eq_attach]
80+
apply Summable.of_nonneg_of_le (f := fun c : ℕ+ ↦ ‖(c : 𝕜) ^ (k + 1) * r ^ (c : ℕ)‖)
81+
(fun b ↦ Finset.sum_nonneg (fun _ _ ↦ mul_nonneg (by simp) (by simp))) (fun b ↦ ?_)
82+
(by apply (summable_norm_pow_mul_geometric_of_norm_lt_one (k + 1) hr).subtype)
83+
transitivity ∑ _ ∈ (b : ℕ).divisors, ‖(b : 𝕜)‖ ^ k * ‖r ^ (b : ℕ)‖
84+
· rw [(b : ℕ).divisorsAntidiagonal.sum_attach (fun x ↦ ‖(x.2 : 𝕜)‖ ^ _ * _ ^ (x.1 * x.2)),
85+
sum_divisorsAntidiagonal ((fun x y ↦ ‖(y : 𝕜)‖ ^ k * _ ^ (x * y)))]
86+
gcongr with i hi
87+
· simpa using le_of_dvd b.2 (div_dvd_of_dvd (dvd_of_mem_divisors hi))
88+
· rw [norm_pow, mul_comm, Nat.div_mul_cancel (dvd_of_mem_divisors hi)]
89+
· simp only [norm_pow, Finset.sum_const, nsmul_eq_mul, ← mul_assoc, add_comm k 1, pow_add,
90+
pow_one, norm_mul]
91+
gcongr
92+
simpa using Nat.card_divisors_le_self b
93+
94+
theorem summable_prod_mul_pow (k : ℕ) {r : 𝕜} (hr : ‖r‖ < 1) :
95+
Summable fun c : (ℕ+ × ℕ+) ↦ c.2 ^ k * (r ^ (c.1 * c.2 : ℕ)) := by
96+
simpa [sigmaAntidiagonalEquivProd.summable_iff.symm] using summable_divisorsAntidiagonal_aux k hr
97+
98+
theorem tsum_prod_pow_eq_tsum_sigma (k : ℕ) {r : 𝕜} (hr : ‖r‖ < 1) :
99+
∑' d : ℕ+, ∑' c : ℕ+, c ^ k * r ^ (d * c : ℕ) = ∑' e : ℕ+, σ k e * r ^ (e : ℕ) := by
100+
suffices ∑' c : ℕ+ × ℕ+, c.2 ^ k * r ^ (c.1 * c.2 : ℕ) =
101+
∑' e : ℕ+, σ k e * r ^ (e : ℕ) by rwa [← (summable_prod_mul_pow k hr).tsum_prod]
102+
simp only [← sigmaAntidiagonalEquivProd.tsum_eq, sigmaAntidiagonalEquivProd,
103+
divisorsAntidiagonalFactors, PNat.mk_coe, Equiv.coe_fn_mk, sigma_eq_sum_div, cast_sum,
104+
cast_pow, Summable.tsum_sigma (summable_divisorsAntidiagonal_aux k hr)]
105+
refine tsum_congr fun n ↦ ?_
106+
simpa [tsum_fintype, Finset.sum_mul,
107+
(n : ℕ).divisorsAntidiagonal.sum_attach fun x : ℕ × ℕ ↦ x.2 ^ k * r ^ (x.1 * x.2),
108+
sum_divisorsAntidiagonal fun x y ↦ y ^ k * r ^ (x * y)]
109+
using Finset.sum_congr rfl fun i hi ↦ by rw [Nat.mul_div_cancel' (dvd_of_mem_divisors hi)]
110+
111+
lemma tsum_pow_div_one_sub_eq_tsum_sigma {r : 𝕜} (hr : ‖r‖ < 1) (k : ℕ) :
112+
∑' n : ℕ+, n ^ k * r ^ (n : ℕ) / (1 - r ^ (n : ℕ)) = ∑' n : ℕ+, σ k n * r ^ (n : ℕ) := by
113+
have (m : ℕ) [NeZero m] := tsum_geometric_of_norm_lt_one (ξ := r ^ m)
114+
(by simpa using pow_lt_one₀ (by simp) hr (NeZero.ne _))
115+
simp only [div_eq_mul_inv, ← this, ← tsum_mul_left, mul_assoc, ← _root_.pow_succ',
116+
fun (n : ℕ) ↦ tsum_pnat_eq_tsum_succ (fun m ↦ n ^ k * (r ^ n) ^ m)]
117+
have h00 := tsum_prod_pow_eq_tsum_sigma k hr
118+
rw [Summable.tsum_comm (by apply (summable_prod_mul_pow k hr).prod_symm)] at h00
119+
rw [← h00]
120+
exact tsum_congr₂ <| fun b c ↦ by simp [mul_comm b.val c.val, pow_mul]
121+
122+
end tsum

Mathlib/Topology/Algebra/InfiniteSum/Basic.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,11 @@ theorem tprod_congr {f g : β → α}
386386
(hfg : ∀ b, f b = g b) : ∏' b, f b = ∏' b, g b :=
387387
congr_arg tprod (funext hfg)
388388

389+
@[to_additive]
390+
theorem tprod_congr₂ {f g : γ → β → α}
391+
(hfg : ∀ b c, f b c = g b c) : ∏' c, ∏' b, f b c = ∏' c, ∏' b, g b c :=
392+
tprod_congr fun c ↦ tprod_congr fun b ↦ hfg b c
393+
389394
@[to_additive]
390395
theorem tprod_fintype [Fintype β] (f : β → α) : ∏' b, f b = ∏ b, f b := by
391396
apply tprod_eq_prod; simp

0 commit comments

Comments
 (0)