Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
130bd35
Eisenstein E2
CBirkbeck May 12, 2025
3659155
save
CBirkbeck May 12, 2025
7ac9441
save
CBirkbeck May 13, 2025
e761796
save
CBirkbeck May 13, 2025
d53f78e
feat(Analysis/NormedSpace/FunctionSeries): Add SummableUniformlyOn ve…
CBirkbeck May 21, 2025
9a0f6cc
update
CBirkbeck May 21, 2025
23902bd
Merge remote-tracking branch 'origin/master' into CB_Eisenstein_E2
CBirkbeck Jun 17, 2025
89ad73f
Merge remote-tracking branch 'origin/master' into derivwithin_tsum
CBirkbeck Jun 17, 2025
4102288
mk_all
CBirkbeck Jun 17, 2025
8cebcb8
Merge branch 'CB_Eisenstein_E2' of https://github.com/CBirkbeck/mathl…
CBirkbeck Jun 17, 2025
d4df7b6
Merge remote-tracking branch 'origin/master' into derivwithin_tsum
CBirkbeck Jul 7, 2025
7311794
move files
CBirkbeck Jul 7, 2025
2f47769
imports
CBirkbeck Jul 7, 2025
5a4f0f3
mk_all
CBirkbeck Jul 7, 2025
da64063
fix name
CBirkbeck Jul 7, 2025
8802150
fix name
CBirkbeck Jul 7, 2025
f78e869
name fix again
CBirkbeck Jul 7, 2025
991df02
fix
CBirkbeck Jul 7, 2025
5311723
merge
CBirkbeck Jul 16, 2025
aaf9ca4
updates
CBirkbeck Jul 16, 2025
612c83a
updates
CBirkbeck Jul 16, 2025
9a292d7
updates2
CBirkbeck Jul 16, 2025
141652a
fix build
CBirkbeck Jul 16, 2025
89406e3
fix
CBirkbeck Jul 16, 2025
8f1c4a3
Add itereatedDerivWithin version of zpow lemmas
CBirkbeck Jul 16, 2025
df2bf4a
add file!
CBirkbeck Jul 16, 2025
217237c
fix build
CBirkbeck Jul 16, 2025
db2fc70
open
CBirkbeck Jul 16, 2025
17a3282
add content
CBirkbeck Jul 16, 2025
96a4c69
space
CBirkbeck Jul 16, 2025
d385050
fix
CBirkbeck Jul 16, 2025
cd79ab4
fix name
CBirkbeck Jul 16, 2025
6d05eb4
add doc string
CBirkbeck Jul 16, 2025
4fca1af
add eventually version
CBirkbeck Jul 17, 2025
b06ce35
update
CBirkbeck Jul 17, 2025
98009c7
merge fix
CBirkbeck Jul 28, 2025
513cd68
golf
CBirkbeck Jul 28, 2025
9e6816d
small fixes
CBirkbeck Jul 28, 2025
fa5c3ad
merge fix
CBirkbeck Jul 28, 2025
b05c86d
Merge remote-tracking branch 'origin/derivwithin_tsum' into cot_serie…
CBirkbeck Jul 28, 2025
deab207
open
CBirkbeck Jul 28, 2025
738c91f
imports£
CBirkbeck Jul 28, 2025
72b220e
cleanup
CBirkbeck Jul 29, 2025
f1185b7
lint fix
CBirkbeck Jul 29, 2025
7ec21bf
add q_exp
CBirkbeck Aug 1, 2025
3e5f7fd
open pr
CBirkbeck Aug 1, 2025
626a3c6
open pr correctly
CBirkbeck Aug 1, 2025
970ef6b
docstrings
CBirkbeck Aug 1, 2025
1874f54
space
CBirkbeck Aug 1, 2025
ae866f9
doc string
CBirkbeck Aug 1, 2025
62a78b1
docstring
CBirkbeck Aug 1, 2025
f686b78
implicit
CBirkbeck Aug 1, 2025
7297e01
fix
CBirkbeck Aug 1, 2025
9a3aed3
tidy
CBirkbeck Aug 1, 2025
4845a6e
save
CBirkbeck Aug 1, 2025
ec590ca
save
CBirkbeck Aug 2, 2025
2aa9666
Merge remote-tracking branch 'origin/master' into Eisenstein_q_exp_id…
CBirkbeck Aug 2, 2025
8bdec7c
rev updates
CBirkbeck Aug 11, 2025
f85293c
test
CBirkbeck Aug 11, 2025
5e63b97
updates
CBirkbeck Aug 11, 2025
0d564a9
fix
CBirkbeck Aug 11, 2025
5be61ee
doc string
CBirkbeck Aug 11, 2025
6ef7e2b
name update
CBirkbeck Aug 12, 2025
ec398e2
update
CBirkbeck Aug 12, 2025
d4da6e8
merge
CBirkbeck Aug 12, 2025
bcf0fe5
save
CBirkbeck Aug 12, 2025
9cea5b8
Merge remote-tracking branch 'origin/master' into CB_Eisenstein_E2
CBirkbeck Aug 12, 2025
ba4978b
save
CBirkbeck Aug 12, 2025
329520f
merge
CBirkbeck Aug 12, 2025
39f4595
save
CBirkbeck Aug 12, 2025
ea92785
save
CBirkbeck Aug 13, 2025
e397df0
doc string
CBirkbeck Aug 13, 2025
ed2eb15
open
CBirkbeck Aug 14, 2025
dc50298
save
CBirkbeck Aug 14, 2025
d6c2526
Merge remote-tracking branch 'upstream/master' into Dedekind_eta
CBirkbeck Aug 14, 2025
64bf79f
update
CBirkbeck Aug 14, 2025
f80072a
save
CBirkbeck Aug 14, 2025
c006f61
open
CBirkbeck Aug 14, 2025
c35e7a3
open
CBirkbeck Aug 14, 2025
62bae65
open
CBirkbeck Aug 14, 2025
6c8f169
remove logderiv stuff
CBirkbeck Aug 14, 2025
d0416ab
remove logderiv stuff
CBirkbeck Aug 14, 2025
e7eed91
remove logderiv stuff
CBirkbeck Aug 14, 2025
abb1bf6
docs
CBirkbeck Aug 14, 2025
46f2afa
remove stuff
CBirkbeck Aug 14, 2025
4ed6485
save
CBirkbeck Aug 14, 2025
07bb88d
update with complexupperhalfplane
CBirkbeck Aug 14, 2025
6ed01ba
clean
CBirkbeck Aug 14, 2025
0804f62
clean more
CBirkbeck Aug 14, 2025
7266763
clean more
CBirkbeck Aug 14, 2025
8a1fb21
mk_all
CBirkbeck Aug 14, 2025
d310781
arrows
CBirkbeck Aug 14, 2025
e9066a7
arrows
CBirkbeck Aug 14, 2025
2c159e1
add file
CBirkbeck Aug 14, 2025
76ff43e
Merge remote-tracking branch 'upstream/master' into LogDeriv_lemmas
CBirkbeck Aug 18, 2025
2155c2e
save
CBirkbeck Aug 18, 2025
87ed893
some api
CBirkbeck Aug 18, 2025
a533427
more api
CBirkbeck Aug 18, 2025
c7bfd97
fix
CBirkbeck Aug 18, 2025
698704c
Merge remote-tracking branch 'upstream/master' into divisiorsAntidiag…
CBirkbeck Aug 18, 2025
eec7f0d
Merge remote-tracking branch 'upstream/master' into Dedekind_eta
CBirkbeck Aug 18, 2025
5e81cc0
golf
CBirkbeck Aug 18, 2025
5670931
Merge remote-tracking branch 'origin/CB_Eisenstein_E2' into Dedekind_…
CBirkbeck Aug 18, 2025
b517086
Merge remote-tracking branch 'origin/LogDeriv_lemmas' into Dedekind_e…
CBirkbeck Aug 18, 2025
14ee635
feat(RingTheory): `IsTensorProduct` versions of the lemmas about tens…
mbkybky Aug 18, 2025
138c026
feat(Analysis/NormedSpace/...): `Algebra.IsCentral R (V →L[R] V)` (#2…
themathqueen Aug 18, 2025
2b3e07d
merge
CBirkbeck Aug 18, 2025
5fa040a
some cleanup
CBirkbeck Aug 18, 2025
437ce03
save
CBirkbeck Aug 18, 2025
a04f2ca
save
CBirkbeck Aug 19, 2025
b1b02a0
save
CBirkbeck Aug 20, 2025
60c9701
move to sep file
CBirkbeck Aug 20, 2025
593940f
move to sep file
CBirkbeck Aug 20, 2025
d2ae6f9
open
CBirkbeck Aug 20, 2025
071e81a
open
CBirkbeck Aug 20, 2025
99658a2
open2
CBirkbeck Aug 20, 2025
f86617f
open3
CBirkbeck Aug 20, 2025
b3dc880
open4
CBirkbeck Aug 20, 2025
8b71aa7
open
CBirkbeck Aug 20, 2025
6003544
save
CBirkbeck Aug 20, 2025
0f800da
fix name
CBirkbeck Aug 20, 2025
9ea51fb
fix imports
CBirkbeck Aug 20, 2025
bd0e958
fix
CBirkbeck Aug 20, 2025
a6598d0
Merge remote-tracking branch 'origin/divisorsAntidiagonal_tsum' into …
CBirkbeck Aug 20, 2025
b7fe8c9
fix
CBirkbeck Aug 20, 2025
d862dfe
save
CBirkbeck Aug 20, 2025
e63f93c
weird mixup
CBirkbeck Aug 20, 2025
2215702
weird mixup2
CBirkbeck Aug 20, 2025
5b9de1a
weird mixup3
CBirkbeck Aug 20, 2025
3044c07
weird mixup4
CBirkbeck Aug 20, 2025
67200a9
cleanup
CBirkbeck Aug 20, 2025
21ac9cb
updates
CBirkbeck Aug 20, 2025
7497e3e
Merge remote-tracking branch 'upstream/master' into Dedekind_eta_E2
CBirkbeck Aug 20, 2025
4501ce6
name updates
CBirkbeck Aug 20, 2025
a145d41
rev updates
CBirkbeck Aug 20, 2025
4b99d29
typo
CBirkbeck Aug 20, 2025
532866d
typo
CBirkbeck Aug 20, 2025
434f0f6
save
CBirkbeck Aug 20, 2025
0a387e5
update
CBirkbeck Aug 20, 2025
55e3f1f
save
CBirkbeck Aug 20, 2025
955c18d
move
CBirkbeck Aug 20, 2025
622ba3b
updates
CBirkbeck Aug 20, 2025
81baf95
I cleanup
CBirkbeck Aug 21, 2025
8354138
I cleanup
CBirkbeck Aug 21, 2025
0e80d68
I cleanup
CBirkbeck Aug 21, 2025
9ea6ccb
merge
CBirkbeck Aug 21, 2025
e624e65
updates
CBirkbeck Aug 21, 2025
e3205d0
merge updates
CBirkbeck Aug 27, 2025
c730baf
fix
CBirkbeck Aug 27, 2025
2bb764f
fix
CBirkbeck Aug 27, 2025
5a526e3
save
CBirkbeck Aug 27, 2025
10c9ece
fix
CBirkbeck Aug 27, 2025
af28cc1
merge fixes
CBirkbeck Aug 27, 2025
2effe21
merge fix
CBirkbeck Jan 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,778 changes: 6,778 additions & 0 deletions Mathlib.lean

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions Mathlib/Analysis/Complex/Exponential.lean
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ lemma exp_nsmul' (x a p : ℂ) (n : ℕ) : exp (a * n * x / p) = exp (a * x / p)
rw [← Complex.exp_nsmul]
ring_nf

lemma exp_nsmul' (x a p : ℂ) (n : ℕ) : exp (a * n * x / p) = exp (a * x / p) ^ n := by
rw [← Complex.exp_nsmul]
ring_nf

theorem exp_nat_mul (x : ℂ) : ∀ n : ℕ, exp (n * x) = exp x ^ n
| 0 => by rw [Nat.cast_zero, zero_mul, exp_zero, pow_zero]
| Nat.succ n => by rw [pow_succ, Nat.cast_add_one, add_mul, exp_add, ← exp_nat_mul _ n, one_mul]
Expand Down
8 changes: 8 additions & 0 deletions Mathlib/Analysis/SpecialFunctions/Log/Summable.lean
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ lemma summable_log_one_add_of_summable {f : ι → ℂ} (hf : Summable f) :
filter_upwards [hf.norm.tendsto_cofinite_zero.eventually_le_const one_half_pos] with i hi
using norm_log_one_add_half_le_self hi

lemma tprod_one_add_ne_zero_of_summable {α : Type*} (x : α) {f : ι → α → ℂ}
(hf : ∀ i x, 1 + f i x ≠ 0) (hu : ∀ x : α, Summable fun n => f n x) :
(∏' i : ι, (1 + f i) x) ≠ 0 := by
simp only [Pi.add_apply, Pi.one_apply, ne_eq]
rw [← Complex.cexp_tsum_eq_tprod (f := fun n => 1 + f n x) (fun n => hf n x)]
· simp only [exp_ne_zero, not_false_eq_true]
· exact Complex.summable_log_one_add_of_summable (hu x)

protected lemma multipliable_one_add_of_summable (hf : Summable f) :
Multipliable (fun i ↦ 1 + f i) :=
multipliable_of_summable_log (summable_log_one_add_of_summable hf)
Expand Down
62 changes: 53 additions & 9 deletions Mathlib/NumberTheory/ModularForms/DedekindEta.lean
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ differentiable on the upper half-plane.
open TopologicalSpace Set MeasureTheory intervalIntegral
Metric Filter Function Complex

open UpperHalfPlane hiding I

open scoped Interval Real NNReal ENNReal Topology BigOperators Nat

local notation "𝕢" => Periodic.qParam
Expand Down Expand Up @@ -80,13 +78,15 @@ lemma multipliableLocallyUniformlyOn_eta :
· rw [hasProdUniformlyOn_iff_tendstoUniformlyOn]
simpa [not_nonempty_iff_eq_empty.mp hN] using tendstoUniformlyOn_empty

/-- Eta is non-vanishing on the upper half plane. -/
lemma eta_ne_zero {z : ℂ} (hz : z ∈ ℍₒ) : η z ≠ 0 := by
apply mul_ne_zero (Periodic.qParam_ne_zero z)
lemma eta_tprod_ne_zero {z : ℂ} (hz : z ∈ ℍₒ) : (∏' n, (1 - eta_q n z)) ≠ 0 := by
refine tprod_one_add_ne_zero_of_summable (f := fun n ↦ -eta_q n z) ?_ ?_
· exact fun i ↦ by simpa using one_sub_eta_q_ne_zero i hz
· simpa [eta_q, ← summable_norm_iff] using summable_eta_q ⟨z, hz⟩

/-- Eta is non-vanishing on the upper half plane. -/
lemma eta_ne_zero {z : ℂ} (hz : z ∈ ℍₒ) : η z ≠ 0 := by
apply mul_ne_zero (Periodic.qParam_ne_zero z) (eta_tprod_ne_zero hz)

lemma logDeriv_one_sub_cexp (r : ℂ) : logDeriv (fun z ↦ 1 - r * cexp z) =
fun z ↦ -r * cexp z / (1 - r * cexp z) := by
ext z
Expand Down Expand Up @@ -116,12 +116,56 @@ lemma tsum_logDeriv_eta_q (z : ℂ) : ∑' n, logDeriv (fun x ↦ 1 - eta_q n x)
rw [tsum_congr (one_sub_eta_logDeriv_eq z), ← tsum_mul_left]
grind

theorem differentiableAt_eta_of_mem_upperHalfPlaneSet {z : ℂ} (hz : z ∈ ℍₒ) :
DifferentiableAt ℂ eta z := by
apply DifferentiableAt.mul (by fun_prop)
refine (multipliableLocallyUniformlyOn_eta.hasProdLocallyUniformlyOn.differentiableOn ?_
lemma differentiableAt_eta_tprod {z : ℂ} (hz : z ∈ ℍₒ) :
DifferentiableAt ℂ (fun x ↦ ∏' n, (1 - eta_q n x)) z := by
apply (multipliableLocallyUniformlyOn_eta.hasProdLocallyUniformlyOn.differentiableOn ?_
isOpen_upperHalfPlaneSet z hz).differentiableAt (isOpen_upperHalfPlaneSet.mem_nhds hz)
filter_upwards with b
simpa [Finset.prod_fn] using DifferentiableOn.finset_prod (by fun_prop)

theorem differentiableAt_eta_of_mem_upperHalfPlaneSet {z : ℂ} (hz : z ∈ ℍₒ) :
DifferentiableAt ℂ eta z := by
apply DifferentiableAt.mul (by fun_prop) (differentiableAt_eta_tprod hz)

lemma summable_log_deriv_one_sub_eta_q {z : ℂ} (hz : z ∈ ℍₒ) :
Summable fun i ↦ logDeriv (fun x ↦ 1 - eta_q i x) z := by
simp only [one_sub_eta_logDeriv_eq]
apply ((summable_nat_add_iff 1).mpr ((summable_norm_pow_mul_geometric_div_one_sub (r := 𝕢 1 z) 1
(by simpa [Periodic.qParam] using UpperHalfPlane.norm_exp_two_pi_I_lt_one ⟨z, hz⟩)).mul_left
(-2 * π * I))).congr
intro b
field_simp [one_sub_eta_q_ne_zero b hz]
ring

lemma logDeriv_q_term (z : ℍ) : logDeriv (𝕢 24) ↑z = 2 * ↑π * I / 24 := by
have : (𝕢 24) = (fun z ↦ cexp (z)) ∘ (fun z => (2 * ↑π * I / 24) * z) := by
ext y
simp only [Periodic.qParam, ofReal_ofNat, comp_apply]
ring_nf
rw [this, logDeriv_comp (by fun_prop) (by fun_prop), deriv_const_mul _ (by fun_prop)]
simp only [LogDeriv_exp, Pi.one_apply, deriv_id'', mul_one, one_mul]

lemma eta_logDeriv (z : ℍ) : logDeriv ModularForm.eta z = (π * I / 12) * E2 z := by
unfold ModularForm.eta
rw [logDeriv_mul (UpperHalfPlane.coe z) (by simp [ne_eq, exp_ne_zero, not_false_eq_true,
Periodic.qParam]) (eta_tprod_ne_zero z.2) (by fun_prop) (differentiableAt_eta_tprod z.2)]
have HG := logDeriv_tprod_eq_tsum isOpen_upperHalfPlaneSet (x := z)
(f := fun n x => 1 - eta_q n x) (fun i ↦ one_sub_eta_q_ne_zero i z.2)
(by simp_rw [eta_q_eq_pow]; fun_prop) (summable_log_deriv_one_sub_eta_q z.2)
(multipliableLocallyUniformlyOn_eta ) (eta_tprod_ne_zero z.2)
rw [show z.1 = UpperHalfPlane.coe z by rfl] at HG
simp only [logDeriv_q_term z, HG, tsum_logDeriv_eta_q z, E2, one_div,
mul_inv_rev, Pi.smul_apply, smul_eq_mul]
rw [G2_q_exp, riemannZeta_two, ← tsum_pow_div_one_sub_eq_tsum_sigma
(by apply UpperHalfPlane.norm_exp_two_pi_I_lt_one z), mul_sub, sub_eq_add_neg, mul_add]
congr 1
· field_simp
ring
· field_simp [tsum_pnat_eq_tsum_succ (f := fun n ↦ n * cexp (2 * π * I * z) ^ n
/ (1 - cexp (2 * π * I * z) ^ n )), eta_q_eq_pow]
simp_rw [← tsum_mul_left, ← tsum_mul_right, ← tsum_neg]
congr
ext n
ring_nf

end ModularForm
62 changes: 62 additions & 0 deletions Mathlib/NumberTheory/ModularForms/EisensteinSeries/Defs.lean
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,68 @@ def gammaSetDivGcdSigmaEquiv : (Fin 2 → ℤ) ≃ (Σ r : ℕ, gammaSet 1 r 0)
lemma gammaSetDivGcdSigmaEquiv_symm_eq (v : Σ r : ℕ, gammaSet 1 r 0) :
(gammaSetDivGcdSigmaEquiv.symm v) = v.2 := rfl

/-- The map from `Fin 2 → ℤ` sending `![a,b]` to `a.gcd b`. -/
def fin_to_gcd_map (v : Fin 2 → ℤ) : ℕ := (v 0).gcd (v 1)

/-- The set of pairs of integers whose gcd is `N`, defined as the fiber of
`fin_to_gcd_map` at `N`. -/
def gammaSetN (N : ℕ) : Set (Fin 2 → ℤ) := fin_to_gcd_map ⁻¹' {N}

/-- An abbreviation of the map which divides a integer vector by an integer. -/
abbrev div_N_map (N : ℤ) {m : ℕ} (v : Fin m → ℤ) : Fin m → ℤ := fun i => v i / N

lemma gammaSet_top_mem (v : Fin 2 → ℤ) : v ∈ gammaSet 1 0 ↔ IsCoprime (v 0) (v 1) := by
simpa [gammaSet] using fun h ↦ Subsingleton.eq_zero (Int.cast ∘ v)

lemma gammaSetN_div_N {N : ℕ} {v : Fin 2 → ℤ} (hv : v ∈ gammaSetN N) (i : Fin 2) :
(N : ℤ) ∣ v i := by
simp only [gammaSetN, mem_preimage, fin_to_gcd_map, Fin.isValue, mem_singleton_iff] at *
fin_cases i <;> simp [← hv, Int.gcd_dvd_left, Int.gcd_dvd_right]

lemma gammaSetN_to_gammaSet10_bijection {N : ℕ} (hN : N ≠ 0) :
Set.BijOn (div_N_map N) (gammaSetN N) (gammaSet 1 0) := by
refine ⟨?_, ?_, ?_⟩
· intro x hx
simp only [ne_eq, gammaSetN, mem_preimage, fin_to_gcd_map, Fin.isValue, mem_singleton_iff,
gammaSet_top_mem] at *
rw [← hx] at hN ⊢
apply isCoprime_div_gcd_div_gcd' (by simpa using hN)
· intro x hx v hv hv2
ext i
· apply (Int.ediv_left_inj (gammaSetN_div_N hx i) (gammaSetN_div_N hv i)).mp (congr_fun hv2 i)
· intro x hx
use N • x
simp only [gammaSetN, nsmul_eq_mul, mem_preimage, fin_to_gcd_map, Fin.isValue, Pi.mul_apply,
Pi.natCast_apply, mem_singleton_iff]
constructor
· rw [gammaSet_top_mem, Int.isCoprime_iff_gcd_eq_one] at hx
simp [Int.gcd_mul_left, hx]
· ext i
simp_all [div_N_map]

lemma gammaSetN_map_eq {N : ℕ} (v : gammaSetN N) : v.1 = N • (div_N_map N v) := by
by_cases hN : N = 0
· have hv := v.2
simp only [hN, gammaSetN, mem_preimage, fin_to_gcd_map, Fin.isValue, mem_singleton_iff,
Int.gcd_eq_zero_iff, CharP.cast_eq_zero, zero_nsmul] at *
ext i
fin_cases i <;> simp [hv]
· ext i
simp_all [Pi.smul_apply, div_N_map, ← Int.mul_ediv_assoc _ (gammaSetN_div_N v.2 i)]

/-- The equivalence between `gammaSetN` and `gammaSet` for non-zero `N`. -/
def gammaSetN_Equiv {N : ℕ} (hN : N ≠ 0) : gammaSetN N ≃ gammaSet 1 0 := by
apply Set.BijOn.equiv _ (gammaSetN_to_gammaSet10_bijection hN)

/-- The equivalence between `(Fin 2 → ℤ)` and `Σ n : ℕ, gammaSetN n)` . -/
def GammaSet_top_Equiv : (Fin 2 → ℤ) ≃ (Σ n : ℕ, gammaSetN n) :=
(Equiv.sigmaFiberEquiv fin_to_gcd_map).symm

@[simp]
lemma GammaSet_top_Equiv_symm_eq (v : Σ n : ℕ, gammaSetN n) :
(GammaSet_top_Equiv.symm v) = v.2 := by
simp [GammaSet_top_Equiv, fin_to_gcd_map, Equiv.sigmaFiberEquiv]

end gammaSet_def

variable {N a r} [NeZero r]
Expand Down
173 changes: 173 additions & 0 deletions Mathlib/NumberTheory/ModularForms/EisensteinSeries/E2.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
/-
Copyright (c) 2025 Chris Birkbeck. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Birkbeck
-/
import Mathlib.Algebra.Order.Ring.Star
import Mathlib.Analysis.CStarAlgebra.Classes
import Mathlib.Data.Int.Star
import Mathlib.NumberTheory.LSeries.RiemannZeta
import Mathlib.NumberTheory.ModularForms.EisensteinSeries.UniformConvergence
import Mathlib.NumberTheory.ModularForms.EisensteinSeries.QExpansion

/-!
# Eisenstein Series E2

We define the Eisenstein series `E2` of weight `2` and level `1` as a limit of partial sums
over non-symmetric intervals.

-/

open ModularForm EisensteinSeries TopologicalSpace intervalIntegral
Metric Filter Function Complex MatrixGroups Finset ArithmeticFunction

open _root_.UpperHalfPlane hiding I

open scoped Interval Real Topology BigOperators Nat

noncomputable section


/-- This is an auxilary summand used to define the Eisenstein serires `G2`. -/
def e2Summand (m : ℤ) (z : ℍ) : ℂ := ∑' (n : ℤ), eisSummand 2 ![m, n] z

lemma e2Summand_summable (m : ℤ) (z : ℍ) : Summable (fun n => eisSummand 2 ![m, n] z) := by
apply (linear_right_summable z m (k := 2) (by omega)).congr
simp [eisSummand]

@[simp]
lemma e2Summand_zero_eq_riemannZeta_two (z : ℍ) : e2Summand 0 z = 2 * riemannZeta 2 := by
simpa [e2Summand, eisSummand] using
(two_riemannZeta_eq_tsum_int_inv_even_pow (k := 2) (by omega) (by simp)).symm

/-- The Eisenstein series of weight `2` and level `1` defined as the limit as `N` tends to
infinity of the partial sum of `m` in `[N,N)` of `e2Summand m`. This sum over symmetric
intervals is handy in showing it is Cauchy. -/
def G2 : ℍ → ℂ := fun z => limUnder atTop (fun N : ℕ => ∑ m ∈ Icc (-N : ℤ) N, e2Summand m z)

/-- The normalised Eisenstein series of weight `2` and level `1`. -/
def E2 : ℍ → ℂ := (1 / (2 * riemannZeta 2)) • G2

/-- This function measures the defect in `E2` being a modular form. -/
def D2 (γ : SL(2, ℤ)) : ℍ → ℂ := fun z => (2 * π * I * γ 1 0) / (denom γ z)

--moves these two elsewhere
lemma Icc_succ_succ (n : ℕ) : Finset.Icc (-(n + 1) : ℤ) (n + 1) = Finset.Icc (-n : ℤ) n ∪
{(-(n + 1) : ℤ), (n + 1 : ℤ)} := by
refine Finset.ext_iff.mpr ?_
intro a
simp only [neg_add_rev, Int.reduceNeg, Finset.mem_Icc, add_neg_le_iff_le_add, Finset.union_insert,
Finset.mem_insert, Finset.mem_union, Finset.mem_singleton]
omega

lemma sum_Icc_of_even_eq_range {α : Type*} [CommRing α] (f : ℤ → α) (hf : ∀ n, f n = f (-n))
(N : ℕ) : ∑ m ∈ Finset.Icc (-N : ℤ) N, f m = 2 * ∑ m ∈ Finset.range (N + 1), f m - f 0 := by
induction' N with N ih
· simp [two_mul]
· have := Icc_succ_succ N
simp only [neg_add_rev, Int.reduceNeg, Nat.cast_add, Nat.cast_one] at *
rw [this, Finset.sum_union (by simp), Finset.sum_pair (by omega), ih]
nth_rw 2 [Finset.sum_range_succ]
have HF := hf (N + 1)
simp only [neg_add_rev, Int.reduceNeg] at HF
rw [← HF]
ring_nf
norm_cast

lemma G2_partial_sum_eq (z : ℍ) (N : ℕ) : (∑ m ∈ Icc (-N : ℤ) N, e2Summand m z) =
(2 * riemannZeta 2) + (∑ m ∈ Finset.range N, 2 * (-2 * ↑π * I) ^ 2 *
∑' n : ℕ+, n * cexp (2 * ↑π * I * (m + 1) * z) ^ (n : ℕ)) := by
rw [sum_Icc_of_even_eq_range, Finset.sum_range_succ', mul_add]
· nth_rw 2 [two_mul]
ring_nf
have (a : ℕ):= EisensteinSeries.qExpansion_identity_pnat (k := 1) (by omega) ⟨(a + 1) * z, by
have ha : 0 < a + (1 : ℝ) := by linarith
simpa [ha] using z.2⟩
simp only [coe_mk_subtype, add_comm, Nat.reduceAdd, one_div, mul_comm, mul_neg, even_two,
Even.neg_pow, Nat.factorial_one, Nat.cast_one, div_one, pow_one, e2Summand, eisSummand,
Nat.cast_add, Fin.isValue, Matrix.cons_val_zero, Int.cast_add, Int.cast_natCast, Int.cast_one,
Matrix.cons_val_one, Matrix.cons_val_fin_one, Int.reduceNeg, zpow_neg, mul_sum, Int.cast_zero,
zero_mul, add_zero, I_sq, neg_mul, one_mul] at *
congr
· simpa using (two_riemannZeta_eq_tsum_int_inv_even_pow (k := 2) (by omega) (by simp)).symm
· ext a
norm_cast at *
simp_rw [this a, ← tsum_mul_left, ← tsum_neg,ofReal_mul, ofReal_ofNat, mul_pow, I_sq, neg_mul,
one_mul, Nat.cast_add, Nat.cast_one, mul_neg, ofReal_pow]
apply tsum_congr
intro b
ring_nf
· intro n
simp only [e2Summand, eisSummand, Fin.isValue, Matrix.cons_val_zero, Matrix.cons_val_one,
Matrix.cons_val_fin_one, Int.reduceNeg, zpow_neg, Int.cast_neg, neg_mul]
nth_rw 2 [← tsum_int_eq_tsum_neg]
apply tsum_congr
intro b
norm_cast
ring_nf
aesop

private lemma aux_tsum_identity (z : ℍ) : ∑' m : ℕ, (2 * (-2 * ↑π * I) ^ 2 *
∑' n : ℕ+, n * cexp (2 * ↑π * I * (m + 1) * z) ^ (n : ℕ)) =
-8 * π ^ 2 * ∑' (n : ℕ+), (sigma 1 n) * cexp (2 * π * I * z) ^ (n : ℕ) := by
have := tsum_prod_pow_cexp_eq_tsum_sigma 1 z
rw [tsum_pnat_eq_tsum_succ (fun d =>
∑' (c : ℕ+), (c ^ 1 : ℂ) * cexp (2 * ↑π * I * d * z) ^ (c : ℕ))] at this
simp only [neg_mul, even_two, Even.neg_pow, ← tsum_mul_left, ← this, Nat.cast_add, Nat.cast_one]
apply tsum_congr2
intro b c
rw [mul_pow, I_sq, mul_neg, mul_one]
ring

theorem G2_tendsto (z : ℍ) : Tendsto (fun N ↦ ∑ x ∈ range N, 2 * (2 * ↑π * I) ^ 2 *
∑' (n : ℕ+), n * cexp (2 * ↑π * I * (↑x + 1) * ↑z) ^ (n : ℕ)) atTop
(𝓝 (-8 * ↑π ^ 2 * ∑' (n : ℕ+), ↑((σ 1) ↑n) * cexp (2 * ↑π * I * ↑z) ^ (n : ℕ))) := by
rw [← aux_tsum_identity]
have hf : Summable fun m : ℕ => ( 2 * (-2 * ↑π * I) ^ 2 *
∑' n : ℕ+, n ^ ((2 - 1)) * Complex.exp (2 * ↑π * I * (m + 1) * z) ^ (n : ℕ)) := by
apply Summable.mul_left
have := (summable_prod_aux 1 z).prod_symm.prod
have h0 := pnat_summable_iff_summable_succ
(f := fun b ↦ ∑' (c : ℕ+), c * cexp (2 * ↑π * I * ↑↑b * ↑z) ^ (c : ℕ))
simp at *
rw [← h0]
apply this
simpa using (hf.hasSum).comp tendsto_finset_range

lemma G2_cauchy (z : ℍ) : CauchySeq (fun N : ℕ => ∑ m ∈ Icc (-N : ℤ) N, e2Summand m z) := by
conv =>
enter [1]
ext n
rw [G2_partial_sum_eq]
apply CauchySeq.const_add
apply Filter.Tendsto.cauchySeq (x := -8 * π ^ 2 *
∑' (n : ℕ+), (σ 1 n) * cexp (2 * π * I * z) ^ (n : ℕ))
simpa using G2_tendsto z

lemma G2_q_exp (z : ℍ) : G2 z = (2 * riemannZeta 2) - 8 * π ^ 2 *
∑' n : ℕ+, sigma 1 n * cexp (2 * π * I * z) ^ (n : ℕ) := by
rw [G2, Filter.Tendsto.limUnder_eq, sub_eq_add_neg]
conv =>
enter [1]
ext N
rw [G2_partial_sum_eq z N]
exact Filter.Tendsto.add (by simp) (by simpa using G2_tendsto z)



/- lemma Asymptotics.IsBigO.map {α β ι γ : Type*} [Norm α] [Norm β] {f : ι → α} {g : ι → β}
{p : Filter ι} (hf : f =O[p] g) (c : γ → ι) :
(fun (n : γ) => f (c n)) =O[p.comap c] fun n => g (c n) := by
rw [isBigO_iff] at *
obtain ⟨C, hC⟩ := hf
refine ⟨C, ?_⟩
simp only [eventually_comap] at *
filter_upwards [hC] with n hn
exact fun a ha ↦ Eq.mpr (id (congrArg (fun _a ↦ ‖f _a‖ ≤ C * ‖g _a‖) ha)) hn

lemma Asymptotics.IsBigO.nat_of_int {α β : Type*} [Norm α] [SeminormedAddCommGroup β] {f : ℤ → α}
{g : ℤ → β} (hf : f =O[cofinite] g) : (fun (n : ℕ) => f n) =O[cofinite] fun n => g n := by
have := Asymptotics.IsBigO.map hf Nat.cast
simp only [Int.cofinite_eq, isBigO_sup, comap_sup, Asymptotics.isBigO_sup] at *
rw [Nat.cofinite_eq_atTop]
simpa using this.2 -/
16 changes: 16 additions & 0 deletions Mathlib/NumberTheory/ModularForms/EisensteinSeries/Summable.lean
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,22 @@ lemma abs_norm_eq_max_natAbs_neg (n : ℕ) : ‖![1, -(n + 1 : ℤ)]‖ = n + 1
Matrix.cons_val_fin_one]
norm_cast

lemma abs_norm_eq_max_natAbs (n : ℕ) :
‖![1, (n + 1 : ℤ)]‖ = n + 1 := by
simp only [Nat.succ_eq_add_one, Nat.reduceAdd, EisensteinSeries.norm_eq_max_natAbs, Fin.isValue,
Matrix.cons_val_zero, isUnit_one, Int.natAbs_of_isUnit, Matrix.cons_val_one,
Matrix.cons_val_fin_one, Nat.cast_max, Nat.cast_one]
norm_cast
simp

lemma abs_norm_eq_max_natAbs_neg (n : ℕ) :
‖![1, -(n + 1 : ℤ)]‖ = n + 1 := by
simp only [EisensteinSeries.norm_eq_max_natAbs, Fin.isValue, Matrix.cons_val_zero, isUnit_one,
Int.natAbs_of_isUnit, Matrix.cons_val_one, Matrix.cons_val_fin_one, Nat.cast_max,
Int.natAbs_neg]
norm_cast
simp

section bounding_functions

/-- Auxiliary function used for bounding Eisenstein series, defined as
Expand Down
7 changes: 7 additions & 0 deletions Mathlib/Topology/Algebra/InfiniteSum/NatInt.lean
Original file line number Diff line number Diff line change
Expand Up @@ -527,10 +527,17 @@ theorem Summable.alternating {α} [Ring α]

end IsUniformGroup

theorem tsum_int_eq_tsum_neg {α : Type*} [AddCommMonoid α] [TopologicalSpace α] (f : ℤ → α) :
∑' d, f (-d) = ∑' d, f d := by
rw [show (fun d => f (-d)) = (fun d => f d) ∘ (Equiv.neg ℤ) by ext; simp]
apply (Equiv.neg ℤ).tsum_eq

end Int

section PNat

variable {R : Type*} {α : Type*} [AddMonoidWithOne R] [TopologicalSpace α] [CommMonoid α]

@[to_additive]
theorem multipliable_pnat_iff_multipliable_succ {f : ℕ → M} :
Multipliable (fun x : ℕ+ ↦ f x) ↔ Multipliable fun x ↦ f (x + 1) :=
Expand Down
Loading