number_theory.modular_forms.jacobi_theta.basicMathlib.NumberTheory.ModularForms.JacobiTheta.OneVariable

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -3,7 +3,7 @@ Copyright (c) 2023 David Loeffler. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: David Loeffler
 -/
-import Analysis.SpecialFunctions.Gaussian
+import Analysis.SpecialFunctions.Gaussian.GaussianIntegral
 import Analysis.Complex.LocallyUniformLimit
 import Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty
 import Analysis.Complex.UpperHalfPlane.Topology
Diff
@@ -57,8 +57,7 @@ theorem norm_exp_mul_sq_le {z : ℂ} (hz : 0 < z.im) (n : ℤ) :
 #align norm_exp_mul_sq_le norm_exp_mul_sq_le
 -/
 
-#print exists_summable_bound_exp_mul_sq /-
-theorem exists_summable_bound_exp_mul_sq {R : ℝ} (hR : 0 < R) :
+theorem exists_summable_bound_exp_hMul_sq {R : ℝ} (hR : 0 < R) :
     ∃ bd : ℤ → ℝ,
       Summable bd ∧ ∀ {τ : ℂ} (hτ : R ≤ τ.im) (n : ℤ), ‖cexp (π * I * n ^ 2 * τ)‖ ≤ bd n :=
   by
@@ -71,16 +70,13 @@ theorem exists_summable_bound_exp_mul_sq {R : ℝ} (hR : 0 < R) :
   all_goals
     simpa only [Int.natAbs_neg, Int.natAbs_ofNat] using
       summable_geometric_of_lt_one (Real.exp_pos _).le h
-#align exists_summable_bound_exp_mul_sq exists_summable_bound_exp_mul_sq
--/
+#align exists_summable_bound_exp_mul_sq exists_summable_bound_exp_hMul_sq
 
-#print summable_exp_mul_sq /-
-theorem summable_exp_mul_sq {z : ℂ} (hz : 0 < z.im) :
+theorem summable_exp_hMul_sq {z : ℂ} (hz : 0 < z.im) :
     Summable fun n : ℤ => cexp (π * I * n ^ 2 * z) :=
-  let ⟨bd, h, h'⟩ := exists_summable_bound_exp_mul_sq hz
+  let ⟨bd, h, h'⟩ := exists_summable_bound_exp_hMul_sq hz
   summable_norm_iff.mp (Summable.of_nonneg_of_le (fun n => norm_nonneg _) (h' <| le_refl _) h)
-#align summable_exp_mul_sq summable_exp_mul_sq
--/
+#align summable_exp_mul_sq summable_exp_hMul_sq
 
 #print jacobiTheta_two_add /-
 theorem jacobiTheta_two_add (z : ℂ) : jacobiTheta (2 + z) = jacobiTheta z :=
@@ -136,7 +132,7 @@ theorem jacobiTheta_S_smul (τ : ℍ) :
 theorem hasSum_nat_jacobiTheta {z : ℂ} (hz : 0 < im z) :
     HasSum (fun n : ℕ => cexp (π * I * (n + 1) ^ 2 * z)) ((jacobiTheta z - 1) / 2) :=
   by
-  have := (summable_exp_mul_sq hz).HasSum.nat_add_neg
+  have := (summable_exp_hMul_sq hz).HasSum.nat_add_neg
   rw [← @hasSum_nat_add_iff' ℂ _ _ _ _ 1] at this
   simp_rw [Finset.sum_range_one, Int.cast_neg, Int.cast_natCast, Nat.cast_zero, neg_zero,
     Int.cast_zero, sq (0 : ℂ), MulZeroClass.mul_zero, MulZeroClass.zero_mul, neg_sq, ← mul_two,
@@ -225,7 +221,7 @@ theorem differentiableAt_jacobiTheta {z : ℂ} (hz : 0 < im z) : DifferentiableA
       DifferentiableWithinAt ℂ (fun v : ℂ => cexp (↑π * I * ↑n ^ 2 * v)) {z : ℂ | y < im z} w :=
     fun n w hw => (differentiable_at_id.const_mul _).cexp.DifferentiableWithinAt
   have h2 : IsOpen {w : ℂ | y < im w} := continuous_im.is_open_preimage _ isOpen_Ioi
-  obtain ⟨bd, bd_s, le_bd⟩ := exists_summable_bound_exp_mul_sq hy
+  obtain ⟨bd, bd_s, le_bd⟩ := exists_summable_bound_exp_hMul_sq hy
   exact differentiable_on_tsum_of_summable_norm bd_s h1 h2 fun i w hw => le_bd (le_of_lt hw) i
 #align differentiable_at_jacobi_theta differentiableAt_jacobiTheta
 -/
Diff
@@ -138,7 +138,7 @@ theorem hasSum_nat_jacobiTheta {z : ℂ} (hz : 0 < im z) :
   by
   have := (summable_exp_mul_sq hz).HasSum.nat_add_neg
   rw [← @hasSum_nat_add_iff' ℂ _ _ _ _ 1] at this
-  simp_rw [Finset.sum_range_one, Int.cast_neg, Int.cast_ofNat, Nat.cast_zero, neg_zero,
+  simp_rw [Finset.sum_range_one, Int.cast_neg, Int.cast_natCast, Nat.cast_zero, neg_zero,
     Int.cast_zero, sq (0 : ℂ), MulZeroClass.mul_zero, MulZeroClass.zero_mul, neg_sq, ← mul_two,
     Complex.exp_zero, add_sub_assoc, (by norm_num : (1 : ℂ) - 1 * 2 = -1), ← sub_eq_add_neg,
     Nat.cast_add, Nat.cast_one] at this
Diff
@@ -50,9 +50,9 @@ theorem norm_exp_mul_sq_le {z : ℂ} (hz : 0 < z.im) (n : ℤ) :
         mul_I_re]
       ring
     obtain ⟨m, hm⟩ := Int.eq_ofNat_of_zero_le (sq_nonneg n)
-    rw [this, exp_mul, ← Int.cast_pow, rpow_int_cast, hm, zpow_coe_nat]
+    rw [this, exp_mul, ← Int.cast_pow, rpow_int_cast, hm, zpow_natCast]
   · have : n ^ 2 = ↑(n.nat_abs ^ 2) := by rw [Nat.cast_pow, Int.natAbs_sq]
-    rw [this, zpow_coe_nat]
+    rw [this, zpow_natCast]
     exact pow_le_pow_of_le_one (exp_pos _).le h.le ((sq n.nat_abs).symm ▸ n.nat_abs.le_mul_self)
 #align norm_exp_mul_sq_le norm_exp_mul_sq_le
 -/
@@ -143,15 +143,15 @@ theorem hasSum_nat_jacobiTheta {z : ℂ} (hz : 0 < im z) :
     Complex.exp_zero, add_sub_assoc, (by norm_num : (1 : ℂ) - 1 * 2 = -1), ← sub_eq_add_neg,
     Nat.cast_add, Nat.cast_one] at this
   convert this.div_const 2
-  simp_rw [mul_div_cancel _ two_ne_zero]
+  simp_rw [mul_div_cancel_right₀ _ two_ne_zero]
 #align has_sum_nat_jacobi_theta hasSum_nat_jacobiTheta
 -/
 
 #print jacobiTheta_eq_tsum_nat /-
 theorem jacobiTheta_eq_tsum_nat {z : ℂ} (hz : 0 < im z) :
     jacobiTheta z = 1 + 2 * ∑' n : ℕ, cexp (π * I * (n + 1) ^ 2 * z) := by
-  rw [(hasSum_nat_jacobiTheta hz).tsum_eq, mul_div_cancel' _ (two_ne_zero' ℂ), ← add_sub_assoc,
-    add_sub_cancel']
+  rw [(hasSum_nat_jacobiTheta hz).tsum_eq, mul_div_cancel₀ _ (two_ne_zero' ℂ), ← add_sub_assoc,
+    add_sub_cancel_left]
 #align jacobi_theta_eq_tsum_nat jacobiTheta_eq_tsum_nat
 -/
 
@@ -179,7 +179,7 @@ theorem norm_jacobiTheta_sub_one_le {z : ℂ} (hz : 0 < im z) :
     HasSum (fun n : ℕ => rexp (-π * z.im) ^ (n + 1))
       (NormedSpace.exp (-π * z.im) / (1 - NormedSpace.exp (-π * z.im))) :=
     by
-    simp_rw [pow_succ, div_eq_mul_inv, hasSum_mul_left_iff (Real.exp_ne_zero _)]
+    simp_rw [pow_succ', div_eq_mul_inv, hasSum_mul_left_iff (Real.exp_ne_zero _)]
     exact
       hasSum_geometric_of_lt_one (exp_pos (-π * z.im)).le
         (exp_lt_one_iff.mpr <| mul_neg_of_neg_of_pos (neg_lt_zero.mpr pi_pos) hz)
Diff
@@ -64,7 +64,7 @@ theorem exists_summable_bound_exp_mul_sq {R : ℝ} (hR : 0 < R) :
   by
   let y := rexp (-π * R)
   have h : y < 1 := exp_lt_one_iff.mpr (mul_neg_of_neg_of_pos (neg_lt_zero.mpr pi_pos) hR)
-  refine' ⟨fun n => y ^ n.natAbs, summable_int_of_summable_nat _ _, fun τ hτ n => _⟩; pick_goal 3
+  refine' ⟨fun n => y ^ n.natAbs, Summable.of_nat_of_neg _ _, fun τ hτ n => _⟩; pick_goal 3
   · refine' (norm_exp_mul_sq_le (hR.trans_le hτ) n).trans _
     refine' pow_le_pow_left (exp_pos _).le (real.exp_le_exp.mpr _) _
     rwa [mul_le_mul_left_of_neg (neg_lt_zero.mpr pi_pos)]
@@ -136,7 +136,7 @@ theorem jacobiTheta_S_smul (τ : ℍ) :
 theorem hasSum_nat_jacobiTheta {z : ℂ} (hz : 0 < im z) :
     HasSum (fun n : ℕ => cexp (π * I * (n + 1) ^ 2 * z)) ((jacobiTheta z - 1) / 2) :=
   by
-  have := (summable_exp_mul_sq hz).HasSum.sum_nat_of_sum_int
+  have := (summable_exp_mul_sq hz).HasSum.nat_add_neg
   rw [← @hasSum_nat_add_iff' ℂ _ _ _ _ 1] at this
   simp_rw [Finset.sum_range_one, Int.cast_neg, Int.cast_ofNat, Nat.cast_zero, neg_zero,
     Int.cast_zero, sq (0 : ℂ), MulZeroClass.mul_zero, MulZeroClass.zero_mul, neg_sq, ← mul_two,
Diff
@@ -119,7 +119,7 @@ theorem jacobiTheta_S_smul (τ : ℍ) :
     rw [ha.1, zero_re]
   have hτ : (τ : ℂ) ≠ 0 := τ.ne_zero
   have := Complex.tsum_exp_neg_mul_int_sq ha
-  rw [mul_comm ((1 : ℂ) / _) _, mul_one_div, eq_div_iff ha', mul_comm _ (_ ^ _), eq_comm] at this 
+  rw [mul_comm ((1 : ℂ) / _) _, mul_one_div, eq_div_iff ha', mul_comm _ (_ ^ _), eq_comm] at this
   convert this using 3
   · ext1 n
     congr 1
@@ -137,11 +137,11 @@ theorem hasSum_nat_jacobiTheta {z : ℂ} (hz : 0 < im z) :
     HasSum (fun n : ℕ => cexp (π * I * (n + 1) ^ 2 * z)) ((jacobiTheta z - 1) / 2) :=
   by
   have := (summable_exp_mul_sq hz).HasSum.sum_nat_of_sum_int
-  rw [← @hasSum_nat_add_iff' ℂ _ _ _ _ 1] at this 
+  rw [← @hasSum_nat_add_iff' ℂ _ _ _ _ 1] at this
   simp_rw [Finset.sum_range_one, Int.cast_neg, Int.cast_ofNat, Nat.cast_zero, neg_zero,
     Int.cast_zero, sq (0 : ℂ), MulZeroClass.mul_zero, MulZeroClass.zero_mul, neg_sq, ← mul_two,
     Complex.exp_zero, add_sub_assoc, (by norm_num : (1 : ℂ) - 1 * 2 = -1), ← sub_eq_add_neg,
-    Nat.cast_add, Nat.cast_one] at this 
+    Nat.cast_add, Nat.cast_one] at this
   convert this.div_const 2
   simp_rw [mul_div_cancel _ two_ne_zero]
 #align has_sum_nat_jacobi_theta hasSum_nat_jacobiTheta
Diff
@@ -50,9 +50,9 @@ theorem norm_exp_mul_sq_le {z : ℂ} (hz : 0 < z.im) (n : ℤ) :
         mul_I_re]
       ring
     obtain ⟨m, hm⟩ := Int.eq_ofNat_of_zero_le (sq_nonneg n)
-    rw [this, exp_mul, ← Int.cast_pow, rpow_int_cast, hm, zpow_ofNat]
+    rw [this, exp_mul, ← Int.cast_pow, rpow_int_cast, hm, zpow_coe_nat]
   · have : n ^ 2 = ↑(n.nat_abs ^ 2) := by rw [Nat.cast_pow, Int.natAbs_sq]
-    rw [this, zpow_ofNat]
+    rw [this, zpow_coe_nat]
     exact pow_le_pow_of_le_one (exp_pos _).le h.le ((sq n.nat_abs).symm ▸ n.nat_abs.le_mul_self)
 #align norm_exp_mul_sq_le norm_exp_mul_sq_le
 -/
Diff
@@ -70,7 +70,7 @@ theorem exists_summable_bound_exp_mul_sq {R : ℝ} (hR : 0 < R) :
     rwa [mul_le_mul_left_of_neg (neg_lt_zero.mpr pi_pos)]
   all_goals
     simpa only [Int.natAbs_neg, Int.natAbs_ofNat] using
-      summable_geometric_of_lt_1 (Real.exp_pos _).le h
+      summable_geometric_of_lt_one (Real.exp_pos _).le h
 #align exists_summable_bound_exp_mul_sq exists_summable_bound_exp_mul_sq
 -/
 
@@ -181,7 +181,7 @@ theorem norm_jacobiTheta_sub_one_le {z : ℂ} (hz : 0 < im z) :
     by
     simp_rw [pow_succ, div_eq_mul_inv, hasSum_mul_left_iff (Real.exp_ne_zero _)]
     exact
-      hasSum_geometric_of_lt_1 (exp_pos (-π * z.im)).le
+      hasSum_geometric_of_lt_one (exp_pos (-π * z.im)).le
         (exp_lt_one_iff.mpr <| mul_neg_of_neg_of_pos (neg_lt_zero.mpr pi_pos) hz)
   have aux : Summable fun n : ℕ => ‖cexp (↑π * I * (↑n + 1) ^ 2 * z)‖ :=
     Summable.of_nonneg_of_le (fun n => norm_nonneg _) this s.summable
Diff
@@ -66,7 +66,7 @@ theorem exists_summable_bound_exp_mul_sq {R : ℝ} (hR : 0 < R) :
   have h : y < 1 := exp_lt_one_iff.mpr (mul_neg_of_neg_of_pos (neg_lt_zero.mpr pi_pos) hR)
   refine' ⟨fun n => y ^ n.natAbs, summable_int_of_summable_nat _ _, fun τ hτ n => _⟩; pick_goal 3
   · refine' (norm_exp_mul_sq_le (hR.trans_le hτ) n).trans _
-    refine' pow_le_pow_of_le_left (exp_pos _).le (real.exp_le_exp.mpr _) _
+    refine' pow_le_pow_left (exp_pos _).le (real.exp_le_exp.mpr _) _
     rwa [mul_le_mul_left_of_neg (neg_lt_zero.mpr pi_pos)]
   all_goals
     simpa only [Int.natAbs_neg, Int.natAbs_ofNat] using
Diff
@@ -46,7 +46,7 @@ theorem norm_exp_mul_sq_le {z : ℂ} (hz : 0 < z.im) (n : ℤ) :
   · rw [Complex.norm_eq_abs, Complex.abs_exp]
     have : (↑π * I * n ^ 2 * z).re = -π * z.im * n ^ 2 :=
       by
-      rw [(by push_cast ; ring : ↑π * I * n ^ 2 * z = ↑(π * n ^ 2) * (z * I)), of_real_mul_re,
+      rw [(by push_cast; ring : ↑π * I * n ^ 2 * z = ↑(π * n ^ 2) * (z * I)), of_real_mul_re,
         mul_I_re]
       ring
     obtain ⟨m, hm⟩ := Int.eq_ofNat_of_zero_le (sq_nonneg n)
@@ -87,7 +87,7 @@ theorem jacobiTheta_two_add (z : ℂ) : jacobiTheta (2 + z) = jacobiTheta z :=
   by
   refine' tsum_congr fun n => _
   suffices cexp (↑π * I * ↑n ^ 2 * 2) = 1 by rw [mul_add, Complex.exp_add, this, one_mul]
-  rw [(by push_cast ; ring : ↑π * I * ↑n ^ 2 * 2 = ↑(n ^ 2) * (2 * π * I)), Complex.exp_int_mul,
+  rw [(by push_cast; ring : ↑π * I * ↑n ^ 2 * 2 = ↑(n ^ 2) * (2 * π * I)), Complex.exp_int_mul,
     Complex.exp_two_pi_mul_I, one_zpow]
 #align jacobi_theta_two_add jacobiTheta_two_add
 -/
@@ -160,7 +160,10 @@ theorem jacobiTheta_eq_tsum_nat {z : ℂ} (hz : 0 < im z) :
 theorem norm_jacobiTheta_sub_one_le {z : ℂ} (hz : 0 < im z) :
     ‖jacobiTheta z - 1‖ ≤ 2 / (1 - exp (-π * z.im)) * exp (-π * z.im) :=
   by
-  suffices ‖∑' n : ℕ, cexp (π * I * (n + 1) ^ 2 * z)‖ ≤ exp (-π * z.im) / (1 - exp (-π * z.im)) by
+  suffices
+    ‖∑' n : ℕ, cexp (π * I * (n + 1) ^ 2 * z)‖ ≤
+      NormedSpace.exp (-π * z.im) / (1 - NormedSpace.exp (-π * z.im))
+    by
     calc
       ‖jacobiTheta z - 1‖ = 2 * ‖∑' n : ℕ, cexp (π * I * (n + 1) ^ 2 * z)‖ := by
         rw [sub_eq_iff_eq_add'.mpr (jacobiTheta_eq_tsum_nat hz), norm_mul, Complex.norm_eq_abs,
@@ -168,12 +171,13 @@ theorem norm_jacobiTheta_sub_one_le {z : ℂ} (hz : 0 < im z) :
       _ ≤ 2 * (rexp (-π * z.im) / (1 - rexp (-π * z.im))) := by
         rwa [mul_le_mul_left (zero_lt_two' ℝ)]
       _ = 2 / (1 - rexp (-π * z.im)) * rexp (-π * z.im) := by rw [div_mul_comm, mul_comm]
-  have : ∀ n : ℕ, ‖cexp (π * I * (n + 1) ^ 2 * z)‖ ≤ exp (-π * z.im) ^ (n + 1) :=
+  have : ∀ n : ℕ, ‖cexp (π * I * (n + 1) ^ 2 * z)‖ ≤ NormedSpace.exp (-π * z.im) ^ (n + 1) :=
     by
     intro n
     simpa only [Int.cast_add, Int.cast_one] using norm_exp_mul_sq_le hz (n + 1)
   have s :
-    HasSum (fun n : ℕ => rexp (-π * z.im) ^ (n + 1)) (exp (-π * z.im) / (1 - exp (-π * z.im))) :=
+    HasSum (fun n : ℕ => rexp (-π * z.im) ^ (n + 1))
+      (NormedSpace.exp (-π * z.im) / (1 - NormedSpace.exp (-π * z.im))) :=
     by
     simp_rw [pow_succ, div_eq_mul_inv, hasSum_mul_left_iff (Real.exp_ne_zero _)]
     exact
Diff
@@ -78,7 +78,7 @@ theorem exists_summable_bound_exp_mul_sq {R : ℝ} (hR : 0 < R) :
 theorem summable_exp_mul_sq {z : ℂ} (hz : 0 < z.im) :
     Summable fun n : ℤ => cexp (π * I * n ^ 2 * z) :=
   let ⟨bd, h, h'⟩ := exists_summable_bound_exp_mul_sq hz
-  summable_norm_iff.mp (summable_of_nonneg_of_le (fun n => norm_nonneg _) (h' <| le_refl _) h)
+  summable_norm_iff.mp (Summable.of_nonneg_of_le (fun n => norm_nonneg _) (h' <| le_refl _) h)
 #align summable_exp_mul_sq summable_exp_mul_sq
 -/
 
@@ -180,7 +180,7 @@ theorem norm_jacobiTheta_sub_one_le {z : ℂ} (hz : 0 < im z) :
       hasSum_geometric_of_lt_1 (exp_pos (-π * z.im)).le
         (exp_lt_one_iff.mpr <| mul_neg_of_neg_of_pos (neg_lt_zero.mpr pi_pos) hz)
   have aux : Summable fun n : ℕ => ‖cexp (↑π * I * (↑n + 1) ^ 2 * z)‖ :=
-    summable_of_nonneg_of_le (fun n => norm_nonneg _) this s.summable
+    Summable.of_nonneg_of_le (fun n => norm_nonneg _) this s.summable
   exact
     (norm_tsum_le_tsum_norm aux).trans ((tsum_mono aux s.summable this).trans (le_of_eq s.tsum_eq))
 #align norm_jacobi_theta_sub_one_le norm_jacobiTheta_sub_one_le
Diff
@@ -3,10 +3,10 @@ Copyright (c) 2023 David Loeffler. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: David Loeffler
 -/
-import Mathbin.Analysis.SpecialFunctions.Gaussian
-import Mathbin.Analysis.Complex.LocallyUniformLimit
-import Mathbin.Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty
-import Mathbin.Analysis.Complex.UpperHalfPlane.Topology
+import Analysis.SpecialFunctions.Gaussian
+import Analysis.Complex.LocallyUniformLimit
+import Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty
+import Analysis.Complex.UpperHalfPlane.Topology
 
 #align_import number_theory.modular_forms.jacobi_theta.basic from "leanprover-community/mathlib"@"9240e8be927a0955b9a82c6c85ef499ee3a626b8"
 
Diff
@@ -2,17 +2,14 @@
 Copyright (c) 2023 David Loeffler. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: David Loeffler
-
-! This file was ported from Lean 3 source module number_theory.modular_forms.jacobi_theta.basic
-! leanprover-community/mathlib commit 9240e8be927a0955b9a82c6c85ef499ee3a626b8
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.SpecialFunctions.Gaussian
 import Mathbin.Analysis.Complex.LocallyUniformLimit
 import Mathbin.Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty
 import Mathbin.Analysis.Complex.UpperHalfPlane.Topology
 
+#align_import number_theory.modular_forms.jacobi_theta.basic from "leanprover-community/mathlib"@"9240e8be927a0955b9a82c6c85ef499ee3a626b8"
+
 /-! # Jacobi's theta function
 
 > THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: David Loeffler
 
 ! This file was ported from Lean 3 source module number_theory.modular_forms.jacobi_theta.basic
-! leanprover-community/mathlib commit 57f9349f2fe19d2de7207e99b0341808d977cdcf
+! leanprover-community/mathlib commit 9240e8be927a0955b9a82c6c85ef499ee3a626b8
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -15,6 +15,9 @@ import Mathbin.Analysis.Complex.UpperHalfPlane.Topology
 
 /-! # Jacobi's theta function
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file defines the Jacobi theta function
 
 $$\theta(\tau) = \sum_{n \in \mathbb{Z}} \exp (i \pi n ^ 2 \tau),$$
Diff
@@ -29,11 +29,14 @@ open Complex Real Asymptotics Filter
 
 open scoped Real BigOperators UpperHalfPlane
 
+#print jacobiTheta /-
 /-- Jacobi's theta function `∑' (n : ℤ), exp (π * I * n ^ 2 * τ)`. -/
 noncomputable def jacobiTheta (z : ℂ) : ℂ :=
   ∑' n : ℤ, cexp (π * I * n ^ 2 * z)
 #align jacobi_theta jacobiTheta
+-/
 
+#print norm_exp_mul_sq_le /-
 theorem norm_exp_mul_sq_le {z : ℂ} (hz : 0 < z.im) (n : ℤ) :
     ‖cexp (π * I * n ^ 2 * z)‖ ≤ exp (-π * z.im) ^ n.natAbs :=
   by
@@ -52,7 +55,9 @@ theorem norm_exp_mul_sq_le {z : ℂ} (hz : 0 < z.im) (n : ℤ) :
     rw [this, zpow_ofNat]
     exact pow_le_pow_of_le_one (exp_pos _).le h.le ((sq n.nat_abs).symm ▸ n.nat_abs.le_mul_self)
 #align norm_exp_mul_sq_le norm_exp_mul_sq_le
+-/
 
+#print exists_summable_bound_exp_mul_sq /-
 theorem exists_summable_bound_exp_mul_sq {R : ℝ} (hR : 0 < R) :
     ∃ bd : ℤ → ℝ,
       Summable bd ∧ ∀ {τ : ℂ} (hτ : R ≤ τ.im) (n : ℤ), ‖cexp (π * I * n ^ 2 * τ)‖ ≤ bd n :=
@@ -67,13 +72,17 @@ theorem exists_summable_bound_exp_mul_sq {R : ℝ} (hR : 0 < R) :
     simpa only [Int.natAbs_neg, Int.natAbs_ofNat] using
       summable_geometric_of_lt_1 (Real.exp_pos _).le h
 #align exists_summable_bound_exp_mul_sq exists_summable_bound_exp_mul_sq
+-/
 
+#print summable_exp_mul_sq /-
 theorem summable_exp_mul_sq {z : ℂ} (hz : 0 < z.im) :
     Summable fun n : ℤ => cexp (π * I * n ^ 2 * z) :=
   let ⟨bd, h, h'⟩ := exists_summable_bound_exp_mul_sq hz
   summable_norm_iff.mp (summable_of_nonneg_of_le (fun n => norm_nonneg _) (h' <| le_refl _) h)
 #align summable_exp_mul_sq summable_exp_mul_sq
+-/
 
+#print jacobiTheta_two_add /-
 theorem jacobiTheta_two_add (z : ℂ) : jacobiTheta (2 + z) = jacobiTheta z :=
   by
   refine' tsum_congr fun n => _
@@ -81,16 +90,20 @@ theorem jacobiTheta_two_add (z : ℂ) : jacobiTheta (2 + z) = jacobiTheta z :=
   rw [(by push_cast ; ring : ↑π * I * ↑n ^ 2 * 2 = ↑(n ^ 2) * (2 * π * I)), Complex.exp_int_mul,
     Complex.exp_two_pi_mul_I, one_zpow]
 #align jacobi_theta_two_add jacobiTheta_two_add
+-/
 
-theorem jacobiTheta_t_sq_smul (τ : ℍ) : jacobiTheta ↑(ModularGroup.T ^ 2 • τ) = jacobiTheta τ :=
+#print jacobiTheta_T_sq_smul /-
+theorem jacobiTheta_T_sq_smul (τ : ℍ) : jacobiTheta ↑(ModularGroup.T ^ 2 • τ) = jacobiTheta τ :=
   by
   suffices ↑(ModularGroup.T ^ 2 • τ) = (2 : ℂ) + ↑τ by simp_rw [this, jacobiTheta_two_add]
   have : ModularGroup.T ^ (2 : ℕ) = ModularGroup.T ^ (2 : ℤ) := by rfl
   simp_rw [this, UpperHalfPlane.modular_T_zpow_smul, UpperHalfPlane.coe_vadd]
   push_cast
-#align jacobi_theta_T_sq_smul jacobiTheta_t_sq_smul
+#align jacobi_theta_T_sq_smul jacobiTheta_T_sq_smul
+-/
 
-theorem jacobiTheta_s_smul (τ : ℍ) :
+#print jacobiTheta_S_smul /-
+theorem jacobiTheta_S_smul (τ : ℍ) :
     jacobiTheta ↑(ModularGroup.S • τ) = (-I * τ) ^ (1 / 2 : ℂ) * jacobiTheta τ :=
   by
   unfold jacobiTheta
@@ -116,8 +129,10 @@ theorem jacobiTheta_s_smul (τ : ℍ) :
   · ext1 n
     congr 1
     ring_nf
-#align jacobi_theta_S_smul jacobiTheta_s_smul
+#align jacobi_theta_S_smul jacobiTheta_S_smul
+-/
 
+#print hasSum_nat_jacobiTheta /-
 theorem hasSum_nat_jacobiTheta {z : ℂ} (hz : 0 < im z) :
     HasSum (fun n : ℕ => cexp (π * I * (n + 1) ^ 2 * z)) ((jacobiTheta z - 1) / 2) :=
   by
@@ -130,13 +145,17 @@ theorem hasSum_nat_jacobiTheta {z : ℂ} (hz : 0 < im z) :
   convert this.div_const 2
   simp_rw [mul_div_cancel _ two_ne_zero]
 #align has_sum_nat_jacobi_theta hasSum_nat_jacobiTheta
+-/
 
+#print jacobiTheta_eq_tsum_nat /-
 theorem jacobiTheta_eq_tsum_nat {z : ℂ} (hz : 0 < im z) :
     jacobiTheta z = 1 + 2 * ∑' n : ℕ, cexp (π * I * (n + 1) ^ 2 * z) := by
   rw [(hasSum_nat_jacobiTheta hz).tsum_eq, mul_div_cancel' _ (two_ne_zero' ℂ), ← add_sub_assoc,
     add_sub_cancel']
 #align jacobi_theta_eq_tsum_nat jacobiTheta_eq_tsum_nat
+-/
 
+#print norm_jacobiTheta_sub_one_le /-
 /-- An explicit upper bound for `‖jacobi_theta τ - 1‖`. -/
 theorem norm_jacobiTheta_sub_one_le {z : ℂ} (hz : 0 < im z) :
     ‖jacobiTheta z - 1‖ ≤ 2 / (1 - exp (-π * z.im)) * exp (-π * z.im) :=
@@ -165,7 +184,9 @@ theorem norm_jacobiTheta_sub_one_le {z : ℂ} (hz : 0 < im z) :
   exact
     (norm_tsum_le_tsum_norm aux).trans ((tsum_mono aux s.summable this).trans (le_of_eq s.tsum_eq))
 #align norm_jacobi_theta_sub_one_le norm_jacobiTheta_sub_one_le
+-/
 
+#print isBigO_at_im_infty_jacobiTheta_sub_one /-
 /-- The norm of `jacobi_theta τ - 1` decays exponentially as `im τ → ∞`. -/
 theorem isBigO_at_im_infty_jacobiTheta_sub_one :
     (fun τ => jacobiTheta τ - 1) =O[comap im atTop] fun τ => rexp (-π * τ.im) :=
@@ -182,7 +203,9 @@ theorem isBigO_at_im_infty_jacobiTheta_sub_one :
     exact mul_pos pi_pos (hz.symm ▸ zero_lt_one.trans_le hy)
   · rw [sub_pos, exp_lt_one_iff, neg_lt_zero]; exact pi_pos
 #align is_O_at_im_infty_jacobi_theta_sub_one isBigO_at_im_infty_jacobiTheta_sub_one
+-/
 
+#print differentiableAt_jacobiTheta /-
 theorem differentiableAt_jacobiTheta {z : ℂ} (hz : 0 < im z) : DifferentiableAt ℂ jacobiTheta z :=
   by
   suffices :
@@ -201,8 +224,11 @@ theorem differentiableAt_jacobiTheta {z : ℂ} (hz : 0 < im z) : DifferentiableA
   obtain ⟨bd, bd_s, le_bd⟩ := exists_summable_bound_exp_mul_sq hy
   exact differentiable_on_tsum_of_summable_norm bd_s h1 h2 fun i w hw => le_bd (le_of_lt hw) i
 #align differentiable_at_jacobi_theta differentiableAt_jacobiTheta
+-/
 
+#print continuousAt_jacobiTheta /-
 theorem continuousAt_jacobiTheta {z : ℂ} (hz : 0 < im z) : ContinuousAt jacobiTheta z :=
   (differentiableAt_jacobiTheta hz).ContinuousAt
 #align continuous_at_jacobi_theta continuousAt_jacobiTheta
+-/
 
Diff
@@ -86,7 +86,7 @@ theorem jacobiTheta_t_sq_smul (τ : ℍ) : jacobiTheta ↑(ModularGroup.T ^ 2 
   by
   suffices ↑(ModularGroup.T ^ 2 • τ) = (2 : ℂ) + ↑τ by simp_rw [this, jacobiTheta_two_add]
   have : ModularGroup.T ^ (2 : ℕ) = ModularGroup.T ^ (2 : ℤ) := by rfl
-  simp_rw [this, UpperHalfPlane.modular_t_zpow_smul, UpperHalfPlane.coe_vadd]
+  simp_rw [this, UpperHalfPlane.modular_T_zpow_smul, UpperHalfPlane.coe_vadd]
   push_cast
 #align jacobi_theta_T_sq_smul jacobiTheta_t_sq_smul
 
@@ -94,7 +94,7 @@ theorem jacobiTheta_s_smul (τ : ℍ) :
     jacobiTheta ↑(ModularGroup.S • τ) = (-I * τ) ^ (1 / 2 : ℂ) * jacobiTheta τ :=
   by
   unfold jacobiTheta
-  rw [UpperHalfPlane.modular_s_smul, UpperHalfPlane.coe_mk]
+  rw [UpperHalfPlane.modular_S_smul, UpperHalfPlane.coe_mk]
   have ha : 0 < (-I * τ).re :=
     by
     rw [neg_mul, neg_re, mul_re, I_re, I_im, MulZeroClass.zero_mul, one_mul, zero_sub, neg_neg]
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2023 David Loeffler. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: David Loeffler
 
-! This file was ported from Lean 3 source module number_theory.modular_forms.jacobi_theta
-! leanprover-community/mathlib commit c720ca1664115159ac610a74e079287d052cf8d0
+! This file was ported from Lean 3 source module number_theory.modular_forms.jacobi_theta.basic
+! leanprover-community/mathlib commit 57f9349f2fe19d2de7207e99b0341808d977cdcf
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -25,9 +25,9 @@ show that `θ` is differentiable on `ℍ`, and `θ(τ) - 1` has exponential deca
 -/
 
 
-open Complex Real Asymptotics
+open Complex Real Asymptotics Filter
 
-open scoped Real BigOperators UpperHalfPlane Manifold
+open scoped Real BigOperators UpperHalfPlane
 
 /-- Jacobi's theta function `∑' (n : ℤ), exp (π * I * n ^ 2 * τ)`. -/
 noncomputable def jacobiTheta (z : ℂ) : ℂ :=
@@ -168,7 +168,7 @@ theorem norm_jacobiTheta_sub_one_le {z : ℂ} (hz : 0 < im z) :
 
 /-- The norm of `jacobi_theta τ - 1` decays exponentially as `im τ → ∞`. -/
 theorem isBigO_at_im_infty_jacobiTheta_sub_one :
-    IsBigO (Filter.comap im Filter.atTop) (fun τ => jacobiTheta τ - 1) fun τ => rexp (-π * τ.im) :=
+    (fun τ => jacobiTheta τ - 1) =O[comap im atTop] fun τ => rexp (-π * τ.im) :=
   by
   simp_rw [is_O, is_O_with, Filter.eventually_comap, Filter.eventually_atTop]
   refine'
@@ -202,10 +202,6 @@ theorem differentiableAt_jacobiTheta {z : ℂ} (hz : 0 < im z) : DifferentiableA
   exact differentiable_on_tsum_of_summable_norm bd_s h1 h2 fun i w hw => le_bd (le_of_lt hw) i
 #align differentiable_at_jacobi_theta differentiableAt_jacobiTheta
 
-theorem mdifferentiable_jacobiTheta : Mdifferentiable 𝓘(ℂ) 𝓘(ℂ) (jacobiTheta ∘ coe : ℍ → ℂ) :=
-  fun τ => (differentiableAt_jacobiTheta τ.2).MdifferentiableAt.comp τ τ.mdifferentiable_coe
-#align mdifferentiable_jacobi_theta mdifferentiable_jacobiTheta
-
 theorem continuousAt_jacobiTheta {z : ℂ} (hz : 0 < im z) : ContinuousAt jacobiTheta z :=
   (differentiableAt_jacobiTheta hz).ContinuousAt
 #align continuous_at_jacobi_theta continuousAt_jacobiTheta

Changes in mathlib4

mathlib3
mathlib4
feat: Axiomatise b ≠ 0 → a * b / b = a (#12424)

This lets us unify a few lemmas between GroupWithZero and EuclideanDomain and two lemmas that were previously proved separately for Nat, Int, Polynomial.

Diff
@@ -83,7 +83,7 @@ theorem hasSum_nat_jacobiTheta {τ : ℂ} (hτ : 0 < im τ) :
     Complex.exp_zero, add_sub_assoc, (by norm_num : (1 : ℂ) - 1 * 2 = -1), ← sub_eq_add_neg,
     Nat.cast_add, Nat.cast_one] at this
   convert this.div_const 2 using 1
-  simp_rw [mul_div_cancel_right₀ (G₀ := ℂ) _ two_ne_zero]
+  simp_rw [mul_div_cancel_right₀ _ (two_ne_zero' ℂ)]
 #align has_sum_nat_jacobi_theta hasSum_nat_jacobiTheta
 
 theorem jacobiTheta_eq_tsum_nat {τ : ℂ} (hτ : 0 < im τ) :
chore: Rename nat_cast/int_cast/rat_cast to natCast/intCast/ratCast (#11486)

Now that I am defining NNRat.cast, I want a definitive answer to this naming issue. Plenty of lemmas in mathlib already use natCast/intCast/ratCast over nat_cast/int_cast/rat_cast, and this matches with the general expectation that underscore-separated name parts correspond to a single declaration.

Diff
@@ -66,7 +66,7 @@ theorem norm_exp_mul_sq_le {τ : ℂ} (hτ : 0 < τ.im) (n : ℤ) :
         re_ofReal_mul, mul_I_re]
       ring
     obtain ⟨m, hm⟩ := Int.eq_ofNat_of_zero_le (sq_nonneg n)
-    rw [this, exp_mul, ← Int.cast_pow, rpow_int_cast, hm, zpow_natCast]
+    rw [this, exp_mul, ← Int.cast_pow, rpow_intCast, hm, zpow_natCast]
   · have : n ^ 2 = (n.natAbs ^ 2 :) := by rw [Nat.cast_pow, Int.natAbs_sq]
     rw [this, zpow_natCast]
     exact pow_le_pow_of_le_one (exp_pos _).le h.le ((sq n.natAbs).symm ▸ n.natAbs.le_mul_self)
feat(ModularForms/JacobiTheta): derivative of theta function (#11824)

This is a rewrite of JacobiTheta/TwoVariable.lean, adding a number of new results needed for Hurwitz and Dirichlet L-series.

The main addition is developing the theory of the z-derivative of the theta function, as an object of study in its own right (functional equations, periodicity, holomorphy etc) – this is needed to prove analytic continuation + functional equations for odd Dirichlet characters.

We also add a number of new results about the existing jacobiTheta2 function:

  • converses of all the convergence statements (showing the series are never convergent if tau is outside the upper half-plane), which allows hypotheses to be removed from several results further downstream
  • differentiability in both variables jointly, not just each variable separately as before.
Diff
@@ -27,7 +27,8 @@ open scoped Real BigOperators UpperHalfPlane
 noncomputable def jacobiTheta (τ : ℂ) : ℂ := ∑' n : ℤ, cexp (π * I * (n : ℂ) ^ 2 * τ)
 #align jacobi_theta jacobiTheta
 
-lemma jacobiTheta_eq_jacobiTheta₂ (τ : ℂ) : jacobiTheta τ = jacobiTheta₂ 0 τ := tsum_congr (by simp)
+lemma jacobiTheta_eq_jacobiTheta₂ (τ : ℂ) : jacobiTheta τ = jacobiTheta₂ 0 τ :=
+  tsum_congr (by simp [jacobiTheta₂_term])
 
 theorem jacobiTheta_two_add (τ : ℂ) : jacobiTheta (2 + τ) = jacobiTheta τ := by
   simp_rw [jacobiTheta_eq_jacobiTheta₂, add_comm, jacobiTheta₂_add_right]
@@ -44,14 +45,13 @@ set_option linter.uppercaseLean3 false in
 theorem jacobiTheta_S_smul (τ : ℍ) :
     jacobiTheta ↑(ModularGroup.S • τ) = (-I * τ) ^ (1 / 2 : ℂ) * jacobiTheta τ := by
   have h0 : (τ : ℂ) ≠ 0 := ne_of_apply_ne im (zero_im.symm ▸ ne_of_gt τ.2)
-  simp_rw [UpperHalfPlane.modular_S_smul, jacobiTheta_eq_jacobiTheta₂]
-  conv_rhs => erw [← ofReal_zero, jacobiTheta₂_functional_equation 0 τ.2]
-  rw [zero_pow two_ne_zero, mul_zero, zero_div, Complex.exp_zero, mul_one, ← mul_assoc, mul_one_div]
-  erw [div_self]
-  rw [one_mul, UpperHalfPlane.coe_mk, inv_neg, neg_div, one_div]
-  · rfl
-  · rw [Ne, cpow_eq_zero_iff, not_and_or]
+  have h1 : (-I * τ) ^ (1 / 2 : ℂ) ≠ 0 := by
+    rw [Ne, cpow_eq_zero_iff, not_and_or]
     exact Or.inl <| mul_ne_zero (neg_ne_zero.mpr I_ne_zero) h0
+  simp_rw [UpperHalfPlane.modular_S_smul, jacobiTheta_eq_jacobiTheta₂]
+  conv_rhs => erw [← ofReal_zero, jacobiTheta₂_functional_equation 0 τ]
+  rw [zero_pow two_ne_zero, mul_zero, zero_div, Complex.exp_zero, mul_one, ← mul_assoc, mul_one_div,
+    div_self h1, one_mul, UpperHalfPlane.coe_mk, inv_neg, neg_div, one_div]
 set_option linter.uppercaseLean3 false in
 #align jacobi_theta_S_smul jacobiTheta_S_smul
 
@@ -72,30 +72,11 @@ theorem norm_exp_mul_sq_le {τ : ℂ} (hτ : 0 < τ.im) (n : ℤ) :
     exact pow_le_pow_of_le_one (exp_pos _).le h.le ((sq n.natAbs).symm ▸ n.natAbs.le_mul_self)
 #align norm_exp_mul_sq_le norm_exp_mul_sq_le
 
-theorem exists_summable_bound_exp_mul_sq {R : ℝ} (hR : 0 < R) :
-    ∃ bd : ℤ → ℝ, Summable bd ∧ ∀ {τ : ℂ} (_ : R ≤ τ.im) (n : ℤ),
-      ‖cexp (π * I * (n : ℂ) ^ 2 * τ)‖ ≤ bd n := by
-  let y := rexp (-π * R)
-  have h : y < 1 := exp_lt_one_iff.mpr (mul_neg_of_neg_of_pos (neg_lt_zero.mpr pi_pos) hR)
-  refine ⟨fun n ↦ y ^ n.natAbs, .of_nat_of_neg ?_ ?_, fun hτ n ↦ ?_⟩; pick_goal 3
-  · refine' (norm_exp_mul_sq_le (hR.trans_le hτ) n).trans _
-    dsimp [y]
-    gcongr rexp ?_ ^ _
-    rwa [mul_le_mul_left_of_neg (neg_lt_zero.mpr pi_pos)]
-  all_goals
-    simpa only [Int.natAbs_neg, Int.natAbs_ofNat] using
-      summable_geometric_of_lt_one (Real.exp_pos _).le h
-#align exists_summable_bound_exp_mul_sq exists_summable_bound_exp_mul_sq
-
-theorem summable_exp_mul_sq {τ : ℂ} (hτ : 0 < τ.im) :
-    Summable fun n : ℤ => cexp (π * I * (n : ℂ) ^ 2 * τ) :=
-  let ⟨_, h, h'⟩ := exists_summable_bound_exp_mul_sq hτ
-  .of_norm_bounded _ h (h' <| le_refl _)
-#align summable_exp_mul_sq summable_exp_mul_sq
-
 theorem hasSum_nat_jacobiTheta {τ : ℂ} (hτ : 0 < im τ) :
     HasSum (fun n : ℕ => cexp (π * I * ((n : ℂ) + 1) ^ 2 * τ)) ((jacobiTheta τ - 1) / 2) := by
-  have := (summable_exp_mul_sq hτ).hasSum.sum_nat_of_sum_int
+  have := hasSum_jacobiTheta₂_term 0 hτ
+  simp_rw [jacobiTheta₂_term, mul_zero, zero_add, ← jacobiTheta_eq_jacobiTheta₂] at this
+  have := this.sum_nat_of_sum_int
   rw [← hasSum_nat_add_iff' 1] at this
   simp_rw [Finset.sum_range_one, Int.cast_neg, Int.cast_natCast, Nat.cast_zero, neg_zero,
     Int.cast_zero, sq (0 : ℂ), mul_zero, zero_mul, neg_sq, ← mul_two,
@@ -154,7 +135,7 @@ set_option linter.uppercaseLean3 false in
 theorem differentiableAt_jacobiTheta {τ : ℂ} (hτ : 0 < im τ) :
     DifferentiableAt ℂ jacobiTheta τ := by
   simp_rw [funext jacobiTheta_eq_jacobiTheta₂]
-  exact differentiableAt_jacobiTheta₂ 0 hτ
+  exact differentiableAt_jacobiTheta₂_snd 0 hτ
 #align differentiable_at_jacobi_theta differentiableAt_jacobiTheta
 
 theorem continuousAt_jacobiTheta {τ : ℂ} (hτ : 0 < im τ) : ContinuousAt jacobiTheta τ :=
chore(Data/Int/Cast): fix confusion between OfNat and Nat.cast lemmas (#11861)

This renames

  • Int.cast_ofNat to Int.cast_natCast
  • Int.int_cast_ofNat to Int.cast_ofNat

I think the history here is that this lemma was previously about Int.ofNat, before we globally fixed the simp-normal form to be Nat.cast.

Since the Int.cast_ofNat name is repurposed, it can't be deprecated. Int.int_cast_ofNat is such a wonky name that it was probably never used.

Diff
@@ -97,7 +97,7 @@ theorem hasSum_nat_jacobiTheta {τ : ℂ} (hτ : 0 < im τ) :
     HasSum (fun n : ℕ => cexp (π * I * ((n : ℂ) + 1) ^ 2 * τ)) ((jacobiTheta τ - 1) / 2) := by
   have := (summable_exp_mul_sq hτ).hasSum.sum_nat_of_sum_int
   rw [← hasSum_nat_add_iff' 1] at this
-  simp_rw [Finset.sum_range_one, Int.cast_neg, Int.cast_ofNat, Nat.cast_zero, neg_zero,
+  simp_rw [Finset.sum_range_one, Int.cast_neg, Int.cast_natCast, Nat.cast_zero, neg_zero,
     Int.cast_zero, sq (0 : ℂ), mul_zero, zero_mul, neg_sq, ← mul_two,
     Complex.exp_zero, add_sub_assoc, (by norm_num : (1 : ℂ) - 1 * 2 = -1), ← sub_eq_add_neg,
     Nat.cast_add, Nat.cast_one] at this
chore: avoid Ne.def (adaptation for nightly-2024-03-27) (#11813)
Diff
@@ -50,7 +50,7 @@ theorem jacobiTheta_S_smul (τ : ℍ) :
   erw [div_self]
   rw [one_mul, UpperHalfPlane.coe_mk, inv_neg, neg_div, one_div]
   · rfl
-  · rw [Ne.def, cpow_eq_zero_iff, not_and_or]
+  · rw [Ne, cpow_eq_zero_iff, not_and_or]
     exact Or.inl <| mul_ne_zero (neg_ne_zero.mpr I_ne_zero) h0
 set_option linter.uppercaseLean3 false in
 #align jacobi_theta_S_smul jacobiTheta_S_smul
change the order of operation in zsmulRec and nsmulRec (#11451)

We change the following field in the definition of an additive commutative monoid:

 nsmul_succ : ∀ (n : ℕ) (x : G),
-  AddMonoid.nsmul (n + 1) x = x + AddMonoid.nsmul n x
+  AddMonoid.nsmul (n + 1) x = AddMonoid.nsmul n x + x

where the latter is more natural

We adjust the definitions of ^ in monoids, groups, etc. Originally there was a warning comment about why this natural order was preferred

use x * npowRec n x and not npowRec n x * x in the definition to make sure that definitional unfolding of npowRec is blocked, to avoid deep recursion issues.

but it seems to no longer apply.

Remarks on the PR :

  • pow_succ and pow_succ' have switched their meanings.
  • Most of the time, the proofs were adjusted by priming/unpriming one lemma, or exchanging left and right; a few proofs were more complicated to adjust.
  • In particular, [Mathlib/NumberTheory/RamificationInertia.lean] used Ideal.IsPrime.mul_mem_pow which is defined in [Mathlib/RingTheory/DedekindDomain/Ideal.lean]. Changing the order of operation forced me to add the symmetric lemma Ideal.IsPrime.mem_pow_mul.
  • the docstring for Cauchy condensation test in [Mathlib/Analysis/PSeries.lean] was mathematically incorrect, I added the mention that the function is antitone.
Diff
@@ -127,7 +127,7 @@ theorem norm_jacobiTheta_sub_one_le {τ : ℂ} (hτ : 0 < im τ) :
     simpa only [Int.cast_add, Int.cast_one] using norm_exp_mul_sq_le hτ (n + 1)
   have s : HasSum (fun n : ℕ =>
       rexp (-π * τ.im) ^ (n + 1)) (rexp (-π * τ.im) / (1 - rexp (-π * τ.im))) := by
-    simp_rw [pow_succ, div_eq_mul_inv, hasSum_mul_left_iff (Real.exp_ne_zero _)]
+    simp_rw [pow_succ', div_eq_mul_inv, hasSum_mul_left_iff (Real.exp_ne_zero _)]
     exact hasSum_geometric_of_lt_one (exp_pos (-π * τ.im)).le
       (exp_lt_one_iff.mpr <| mul_neg_of_neg_of_pos (neg_lt_zero.mpr pi_pos) hτ)
   have aux : Summable fun n : ℕ => ‖cexp (π * I * ((n : ℂ) + 1) ^ 2 * τ)‖ :=
chore: Rename mul-div cancellation lemmas (#11530)

Lemma names around cancellation of multiplication and division are a mess.

This PR renames a handful of them according to the following table (each big row contains the multiplicative statement, then the three rows contain the GroupWithZero lemma name, the Group lemma, the AddGroup lemma name).

| Statement | New name | Old name | |

Diff
@@ -102,13 +102,13 @@ theorem hasSum_nat_jacobiTheta {τ : ℂ} (hτ : 0 < im τ) :
     Complex.exp_zero, add_sub_assoc, (by norm_num : (1 : ℂ) - 1 * 2 = -1), ← sub_eq_add_neg,
     Nat.cast_add, Nat.cast_one] at this
   convert this.div_const 2 using 1
-  simp_rw [mul_div_cancel (G₀ := ℂ) _ two_ne_zero]
+  simp_rw [mul_div_cancel_right₀ (G₀ := ℂ) _ two_ne_zero]
 #align has_sum_nat_jacobi_theta hasSum_nat_jacobiTheta
 
 theorem jacobiTheta_eq_tsum_nat {τ : ℂ} (hτ : 0 < im τ) :
     jacobiTheta τ = ↑1 + ↑2 * ∑' n : ℕ, cexp (π * I * ((n : ℂ) + 1) ^ 2 * τ) := by
-  rw [(hasSum_nat_jacobiTheta hτ).tsum_eq, mul_div_cancel' _ (two_ne_zero' ℂ), ← add_sub_assoc,
-    add_sub_cancel']
+  rw [(hasSum_nat_jacobiTheta hτ).tsum_eq, mul_div_cancel₀ _ (two_ne_zero' ℂ), ← add_sub_assoc,
+    add_sub_cancel_left]
 #align jacobi_theta_eq_tsum_nat jacobiTheta_eq_tsum_nat
 
 /-- An explicit upper bound for `‖jacobiTheta τ - 1‖`. -/
chore: Rename zpow_coe_nat to zpow_natCast (#11528)

... and add a deprecated alias for the old name. This is mostly just me discovering the power of F2

Diff
@@ -66,9 +66,9 @@ theorem norm_exp_mul_sq_le {τ : ℂ} (hτ : 0 < τ.im) (n : ℤ) :
         re_ofReal_mul, mul_I_re]
       ring
     obtain ⟨m, hm⟩ := Int.eq_ofNat_of_zero_le (sq_nonneg n)
-    rw [this, exp_mul, ← Int.cast_pow, rpow_int_cast, hm, zpow_coe_nat]
+    rw [this, exp_mul, ← Int.cast_pow, rpow_int_cast, hm, zpow_natCast]
   · have : n ^ 2 = (n.natAbs ^ 2 :) := by rw [Nat.cast_pow, Int.natAbs_sq]
-    rw [this, zpow_coe_nat]
+    rw [this, zpow_natCast]
     exact pow_le_pow_of_le_one (exp_pos _).le h.le ((sq n.natAbs).symm ▸ n.natAbs.le_mul_self)
 #align norm_exp_mul_sq_le norm_exp_mul_sq_le
 
feat(InfiniteSum/NatInt): lemmas on sums over ℤ (#11069)

This PR combines several results involving topological sums over . These results are used in #10011 (Hurwitz zeta functions) where sums over feature heavily.

  • Fill in tsum and Summable variants for lemmas proved for HasSum

  • Rename some lemmas (with deprecated aliases) to impose a consistent naming scheme

  • Generalise several lemmas to allow the target space to be a topological monoid rather than a group.

  • Speed up some slow proofs (the old summable_int_of_summable_nat took about 10s to compile on my machine, its replacement Summable.of_nat_of_neg is 1000 times faster)

Diff
@@ -77,7 +77,7 @@ theorem exists_summable_bound_exp_mul_sq {R : ℝ} (hR : 0 < R) :
       ‖cexp (π * I * (n : ℂ) ^ 2 * τ)‖ ≤ bd n := by
   let y := rexp (-π * R)
   have h : y < 1 := exp_lt_one_iff.mpr (mul_neg_of_neg_of_pos (neg_lt_zero.mpr pi_pos) hR)
-  refine' ⟨fun n => y ^ n.natAbs, summable_int_of_summable_nat _ _, fun hτ n => _⟩; pick_goal 3
+  refine ⟨fun n ↦ y ^ n.natAbs, .of_nat_of_neg ?_ ?_, fun hτ n ↦ ?_⟩; pick_goal 3
   · refine' (norm_exp_mul_sq_le (hR.trans_le hτ) n).trans _
     dsimp [y]
     gcongr rexp ?_ ^ _
@@ -96,7 +96,7 @@ theorem summable_exp_mul_sq {τ : ℂ} (hτ : 0 < τ.im) :
 theorem hasSum_nat_jacobiTheta {τ : ℂ} (hτ : 0 < im τ) :
     HasSum (fun n : ℕ => cexp (π * I * ((n : ℂ) + 1) ^ 2 * τ)) ((jacobiTheta τ - 1) / 2) := by
   have := (summable_exp_mul_sq hτ).hasSum.sum_nat_of_sum_int
-  rw [← @hasSum_nat_add_iff' ℂ _ _ _ _ 1] at this
+  rw [← hasSum_nat_add_iff' 1] at this
   simp_rw [Finset.sum_range_one, Int.cast_neg, Int.cast_ofNat, Nat.cast_zero, neg_zero,
     Int.cast_zero, sq (0 : ℂ), mul_zero, zero_mul, neg_sq, ← mul_two,
     Complex.exp_zero, add_sub_assoc, (by norm_num : (1 : ℂ) - 1 * 2 = -1), ← sub_eq_add_neg,
fix: correct statement of zpow_ofNat and ofNat_zsmul (#10969)

Previously these were syntactically identical to the corresponding zpow_coe_nat and coe_nat_zsmul lemmas, now they are about OfNat.ofNat.

Unfortunately, almost every call site uses the ofNat name to refer to Nat.cast, so the downstream proofs had to be adjusted too.

Diff
@@ -66,9 +66,9 @@ theorem norm_exp_mul_sq_le {τ : ℂ} (hτ : 0 < τ.im) (n : ℤ) :
         re_ofReal_mul, mul_I_re]
       ring
     obtain ⟨m, hm⟩ := Int.eq_ofNat_of_zero_le (sq_nonneg n)
-    rw [this, exp_mul, ← Int.cast_pow, rpow_int_cast, hm, zpow_ofNat]
+    rw [this, exp_mul, ← Int.cast_pow, rpow_int_cast, hm, zpow_coe_nat]
   · have : n ^ 2 = (n.natAbs ^ 2 :) := by rw [Nat.cast_pow, Int.natAbs_sq]
-    rw [this, zpow_ofNat]
+    rw [this, zpow_coe_nat]
     exact pow_le_pow_of_le_one (exp_pos _).le h.le ((sq n.natAbs).symm ▸ n.natAbs.le_mul_self)
 #align norm_exp_mul_sq_le norm_exp_mul_sq_le
 
chore: more backporting of simp changes from #10995 (#11001)

Co-authored-by: Patrick Massot <patrickmassot@free.fr> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -79,7 +79,7 @@ theorem exists_summable_bound_exp_mul_sq {R : ℝ} (hR : 0 < R) :
   have h : y < 1 := exp_lt_one_iff.mpr (mul_neg_of_neg_of_pos (neg_lt_zero.mpr pi_pos) hR)
   refine' ⟨fun n => y ^ n.natAbs, summable_int_of_summable_nat _ _, fun hτ n => _⟩; pick_goal 3
   · refine' (norm_exp_mul_sq_le (hR.trans_le hτ) n).trans _
-    dsimp
+    dsimp [y]
     gcongr rexp ?_ ^ _
     rwa [mul_le_mul_left_of_neg (neg_lt_zero.mpr pi_pos)]
   all_goals
chore(Analysis/SpecificLimits/* and others): rename _0 -> _zero, _1 -> _one (#10077)

See here on Zulip.

This PR changes a bunch of names containing nhds_0 or/and lt_1 to nhds_zero or/and lt_one.

Diff
@@ -84,7 +84,7 @@ theorem exists_summable_bound_exp_mul_sq {R : ℝ} (hR : 0 < R) :
     rwa [mul_le_mul_left_of_neg (neg_lt_zero.mpr pi_pos)]
   all_goals
     simpa only [Int.natAbs_neg, Int.natAbs_ofNat] using
-      summable_geometric_of_lt_1 (Real.exp_pos _).le h
+      summable_geometric_of_lt_one (Real.exp_pos _).le h
 #align exists_summable_bound_exp_mul_sq exists_summable_bound_exp_mul_sq
 
 theorem summable_exp_mul_sq {τ : ℂ} (hτ : 0 < τ.im) :
@@ -128,7 +128,7 @@ theorem norm_jacobiTheta_sub_one_le {τ : ℂ} (hτ : 0 < im τ) :
   have s : HasSum (fun n : ℕ =>
       rexp (-π * τ.im) ^ (n + 1)) (rexp (-π * τ.im) / (1 - rexp (-π * τ.im))) := by
     simp_rw [pow_succ, div_eq_mul_inv, hasSum_mul_left_iff (Real.exp_ne_zero _)]
-    exact hasSum_geometric_of_lt_1 (exp_pos (-π * τ.im)).le
+    exact hasSum_geometric_of_lt_one (exp_pos (-π * τ.im)).le
       (exp_lt_one_iff.mpr <| mul_neg_of_neg_of_pos (neg_lt_zero.mpr pi_pos) hτ)
   have aux : Summable fun n : ℕ => ‖cexp (π * I * ((n : ℂ) + 1) ^ 2 * τ)‖ :=
     .of_nonneg_of_le (fun n => norm_nonneg _) this s.summable
feat: The support of f ^ n (#9617)

This involves moving lemmas from Algebra.GroupPower.Ring to Algebra.GroupWithZero.Basic and changing some 0 < n assumptions to n ≠ 0.

From LeanAPAP

Diff
@@ -46,8 +46,7 @@ theorem jacobiTheta_S_smul (τ : ℍ) :
   have h0 : (τ : ℂ) ≠ 0 := ne_of_apply_ne im (zero_im.symm ▸ ne_of_gt τ.2)
   simp_rw [UpperHalfPlane.modular_S_smul, jacobiTheta_eq_jacobiTheta₂]
   conv_rhs => erw [← ofReal_zero, jacobiTheta₂_functional_equation 0 τ.2]
-  rw [zero_pow two_pos, mul_zero, zero_div, Complex.exp_zero, mul_one, ← mul_assoc,
-    mul_one_div]
+  rw [zero_pow two_ne_zero, mul_zero, zero_div, Complex.exp_zero, mul_one, ← mul_assoc, mul_one_div]
   erw [div_self]
   rw [one_mul, UpperHalfPlane.coe_mk, inv_neg, neg_div, one_div]
   · rfl
chore: tidy various files (#9903)
Diff
@@ -46,8 +46,10 @@ theorem jacobiTheta_S_smul (τ : ℍ) :
   have h0 : (τ : ℂ) ≠ 0 := ne_of_apply_ne im (zero_im.symm ▸ ne_of_gt τ.2)
   simp_rw [UpperHalfPlane.modular_S_smul, jacobiTheta_eq_jacobiTheta₂]
   conv_rhs => erw [← ofReal_zero, jacobiTheta₂_functional_equation 0 τ.2]
-  erw [zero_pow two_pos, mul_zero, zero_div, Complex.exp_zero, mul_one, ← mul_assoc,
-    mul_one_div, div_self, one_mul, UpperHalfPlane.coe_mk, inv_neg, neg_div, one_div]
+  rw [zero_pow two_pos, mul_zero, zero_div, Complex.exp_zero, mul_one, ← mul_assoc,
+    mul_one_div]
+  erw [div_self]
+  rw [one_mul, UpperHalfPlane.coe_mk, inv_neg, neg_div, one_div]
   · rfl
   · rw [Ne.def, cpow_eq_zero_iff, not_and_or]
     exact Or.inl <| mul_ne_zero (neg_ne_zero.mpr I_ne_zero) h0
feat(NumberTheory/ModularForms): two-variable Jacobi theta (#9666)

Add a more general version of the Jacobi theta function with a second variable, and prove the transformation law for this more general function rather than just for the one-variable version. Preparatory to functional equations for Dirichlet L-functions.

Diff
@@ -3,16 +3,14 @@ Copyright (c) 2023 David Loeffler. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: David Loeffler
 -/
-import Mathlib.Analysis.SpecialFunctions.Gaussian
-import Mathlib.Analysis.Complex.LocallyUniformLimit
-import Mathlib.Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty
-import Mathlib.Analysis.Complex.UpperHalfPlane.Topology
+import Mathlib.NumberTheory.ModularForms.JacobiTheta.TwoVariable
+import Mathlib.Analysis.Complex.UpperHalfPlane.Basic
 
 #align_import number_theory.modular_forms.jacobi_theta.basic from "leanprover-community/mathlib"@"57f9349f2fe19d2de7207e99b0341808d977cdcf"
 
 /-! # Jacobi's theta function
 
-This file defines the Jacobi theta function
+This file defines the one-variable Jacobi theta function
 
 $$\theta(\tau) = \sum_{n \in \mathbb{Z}} \exp (i \pi n ^ 2 \tau),$$
 
@@ -21,24 +19,49 @@ and proves the modular transformation properties `θ (τ + 2) = θ τ` and
 show that `θ` is differentiable on `ℍ`, and `θ(τ) - 1` has exponential decay as `im τ → ∞`.
 -/
 
-
-open Complex Real Asymptotics Filter
+open Complex Real Asymptotics Filter Topology
 
 open scoped Real BigOperators UpperHalfPlane
 
-/-- Jacobi's theta function `∑' (n : ℤ), exp (π * I * n ^ 2 * τ)`. -/
-noncomputable def jacobiTheta (z : ℂ) : ℂ :=
-  ∑' n : ℤ, cexp (π * I * (n : ℂ) ^ 2 * z)
+/-- Jacobi's one-variable theta function `∑' (n : ℤ), exp (π * I * n ^ 2 * τ)`. -/
+noncomputable def jacobiTheta (τ : ℂ) : ℂ := ∑' n : ℤ, cexp (π * I * (n : ℂ) ^ 2 * τ)
 #align jacobi_theta jacobiTheta
 
-theorem norm_exp_mul_sq_le {z : ℂ} (hz : 0 < z.im) (n : ℤ) :
-    ‖cexp (π * I * (n : ℂ) ^ 2 * z)‖ ≤ rexp (-π * z.im) ^ n.natAbs := by
-  let y := rexp (-π * z.im)
-  have h : y < 1 := exp_lt_one_iff.mpr (mul_neg_of_neg_of_pos (neg_lt_zero.mpr pi_pos) hz)
+lemma jacobiTheta_eq_jacobiTheta₂ (τ : ℂ) : jacobiTheta τ = jacobiTheta₂ 0 τ := tsum_congr (by simp)
+
+theorem jacobiTheta_two_add (τ : ℂ) : jacobiTheta (2 + τ) = jacobiTheta τ := by
+  simp_rw [jacobiTheta_eq_jacobiTheta₂, add_comm, jacobiTheta₂_add_right]
+#align jacobi_theta_two_add jacobiTheta_two_add
+
+theorem jacobiTheta_T_sq_smul (τ : ℍ) : jacobiTheta (ModularGroup.T ^ 2 • τ :) = jacobiTheta τ := by
+  suffices (ModularGroup.T ^ 2 • τ :) = (2 : ℂ) + ↑τ by simp_rw [this, jacobiTheta_two_add]
+  have : ModularGroup.T ^ (2 : ℕ) = ModularGroup.T ^ (2 : ℤ) := rfl
+  simp_rw [this, UpperHalfPlane.modular_T_zpow_smul, UpperHalfPlane.coe_vadd]
+  norm_cast
+set_option linter.uppercaseLean3 false in
+#align jacobi_theta_T_sq_smul jacobiTheta_T_sq_smul
+
+theorem jacobiTheta_S_smul (τ : ℍ) :
+    jacobiTheta ↑(ModularGroup.S • τ) = (-I * τ) ^ (1 / 2 : ℂ) * jacobiTheta τ := by
+  have h0 : (τ : ℂ) ≠ 0 := ne_of_apply_ne im (zero_im.symm ▸ ne_of_gt τ.2)
+  simp_rw [UpperHalfPlane.modular_S_smul, jacobiTheta_eq_jacobiTheta₂]
+  conv_rhs => erw [← ofReal_zero, jacobiTheta₂_functional_equation 0 τ.2]
+  erw [zero_pow two_pos, mul_zero, zero_div, Complex.exp_zero, mul_one, ← mul_assoc,
+    mul_one_div, div_self, one_mul, UpperHalfPlane.coe_mk, inv_neg, neg_div, one_div]
+  · rfl
+  · rw [Ne.def, cpow_eq_zero_iff, not_and_or]
+    exact Or.inl <| mul_ne_zero (neg_ne_zero.mpr I_ne_zero) h0
+set_option linter.uppercaseLean3 false in
+#align jacobi_theta_S_smul jacobiTheta_S_smul
+
+theorem norm_exp_mul_sq_le {τ : ℂ} (hτ : 0 < τ.im) (n : ℤ) :
+    ‖cexp (π * I * (n : ℂ) ^ 2 * τ)‖ ≤ rexp (-π * τ.im) ^ n.natAbs := by
+  let y := rexp (-π * τ.im)
+  have h : y < 1 := exp_lt_one_iff.mpr (mul_neg_of_neg_of_pos (neg_lt_zero.mpr pi_pos) hτ)
   refine' (le_of_eq _).trans (_ : y ^ n ^ 2 ≤ _)
   · rw [Complex.norm_eq_abs, Complex.abs_exp]
-    have : (π * I * n ^ 2 * z : ℂ).re = -π * z.im * (n : ℝ) ^ 2 := by
-      rw [(by push_cast; ring : (π * I * n ^ 2 * z : ℂ) = (π * n ^ 2 : ℝ) * (z * I)),
+    have : (π * I * n ^ 2 * τ : ℂ).re = -π * τ.im * (n : ℝ) ^ 2 := by
+      rw [(by push_cast; ring : (π * I * n ^ 2 * τ : ℂ) = (π * n ^ 2 : ℝ) * (τ * I)),
         re_ofReal_mul, mul_I_re]
       ring
     obtain ⟨m, hm⟩ := Int.eq_ofNat_of_zero_le (sq_nonneg n)
@@ -63,60 +86,15 @@ theorem exists_summable_bound_exp_mul_sq {R : ℝ} (hR : 0 < R) :
       summable_geometric_of_lt_1 (Real.exp_pos _).le h
 #align exists_summable_bound_exp_mul_sq exists_summable_bound_exp_mul_sq
 
-theorem summable_exp_mul_sq {z : ℂ} (hz : 0 < z.im) :
-    Summable fun n : ℤ => cexp (π * I * (n : ℂ) ^ 2 * z) :=
-  let ⟨_, h, h'⟩ := exists_summable_bound_exp_mul_sq hz
+theorem summable_exp_mul_sq {τ : ℂ} (hτ : 0 < τ.im) :
+    Summable fun n : ℤ => cexp (π * I * (n : ℂ) ^ 2 * τ) :=
+  let ⟨_, h, h'⟩ := exists_summable_bound_exp_mul_sq hτ
   .of_norm_bounded _ h (h' <| le_refl _)
 #align summable_exp_mul_sq summable_exp_mul_sq
 
-theorem jacobiTheta_two_add (z : ℂ) : jacobiTheta (2 + z) = jacobiTheta z := by
-  refine' tsum_congr fun n => _
-  suffices cexp (π * I * n ^ 2 * 2 : ℂ) = 1 by rw [mul_add, Complex.exp_add, this, one_mul]
-  rw [(by push_cast; ring : (π * I * n ^ 2 * 2 : ℂ) = (n ^ 2 :) * (2 * π * I)), Complex.exp_int_mul,
-    Complex.exp_two_pi_mul_I, one_zpow]
-#align jacobi_theta_two_add jacobiTheta_two_add
-
-theorem jacobiTheta_T_sq_smul (τ : ℍ) : jacobiTheta (ModularGroup.T ^ 2 • τ :) = jacobiTheta τ := by
-  suffices (ModularGroup.T ^ 2 • τ :) = (2 : ℂ) + ↑τ by simp_rw [this, jacobiTheta_two_add]
-  have : ModularGroup.T ^ (2 : ℕ) = ModularGroup.T ^ (2 : ℤ) := rfl
-  simp_rw [this, UpperHalfPlane.modular_T_zpow_smul, UpperHalfPlane.coe_vadd]
-  norm_cast
-set_option linter.uppercaseLean3 false in
-#align jacobi_theta_T_sq_smul jacobiTheta_T_sq_smul
-
-theorem jacobiTheta_S_smul (τ : ℍ) :
-    jacobiTheta ↑(ModularGroup.S • τ) = (-I * τ) ^ (1 / 2 : ℂ) * jacobiTheta τ := by
-  unfold jacobiTheta
-  rw [UpperHalfPlane.modular_S_smul, UpperHalfPlane.coe_mk]
-  have ha : 0 < (-I * τ).re := by
-    rw [neg_mul, neg_re, mul_re, I_re, I_im, zero_mul, one_mul, zero_sub, neg_neg]
-    exact τ.im_pos
-  have ha' : (-I * τ) ^ (1 / 2 : ℂ) ≠ 0 := by
-    rw [Ne.def, cpow_eq_zero_iff]
-    contrapose! ha
-    rw [ha.1, zero_re]
-  have hτ : (τ : ℂ) ≠ 0 := τ.ne_zero
-  have := Complex.tsum_exp_neg_mul_int_sq ha
-  rw [mul_comm ((1 : ℂ) / _) _, mul_one_div, eq_div_iff ha', mul_comm _ (_ ^ _), eq_comm] at this
-  have expo1 : ∀ n : ℤ, -↑π / (-I * ↑τ) * (n : ℂ) ^ 2 = ↑π * I * (n : ℂ) ^ 2 * (-↑τ)⁻¹ := by
-    intro n
-    simp only [neg_mul, neg_div_neg_eq, div_mul_eq_mul_div, inv_eq_one_div, mul_div_assoc', mul_one,
-      ne_eq, neg_eq_zero, hτ, not_false_eq_true, eq_div_iff, I_ne_zero,
-      mul_ne_zero, div_eq_iff]
-    ring_nf
-    rw [I_sq, mul_neg, mul_one]
-  simp_rw [expo1] at this
-  have expo2 : ∀ n : ℤ, -↑π * (-I * ↑τ) * (n : ℂ) ^ 2 = ↑π * I * (n : ℂ) ^ 2 * ↑τ := by
-    intro n
-    ring_nf
-  simp_rw [expo2] at this
-  exact this
-set_option linter.uppercaseLean3 false in
-#align jacobi_theta_S_smul jacobiTheta_S_smul
-
-theorem hasSum_nat_jacobiTheta {z : ℂ} (hz : 0 < im z) :
-    HasSum (fun n : ℕ => cexp (π * I * ((n : ℂ) + 1) ^ 2 * z)) ((jacobiTheta z - 1) / 2) := by
-  have := (summable_exp_mul_sq hz).hasSum.sum_nat_of_sum_int
+theorem hasSum_nat_jacobiTheta {τ : ℂ} (hτ : 0 < im τ) :
+    HasSum (fun n : ℕ => cexp (π * I * ((n : ℂ) + 1) ^ 2 * τ)) ((jacobiTheta τ - 1) / 2) := by
+  have := (summable_exp_mul_sq hτ).hasSum.sum_nat_of_sum_int
   rw [← @hasSum_nat_add_iff' ℂ _ _ _ _ 1] at this
   simp_rw [Finset.sum_range_one, Int.cast_neg, Int.cast_ofNat, Nat.cast_zero, neg_zero,
     Int.cast_zero, sq (0 : ℂ), mul_zero, zero_mul, neg_sq, ← mul_two,
@@ -126,32 +104,32 @@ theorem hasSum_nat_jacobiTheta {z : ℂ} (hz : 0 < im z) :
   simp_rw [mul_div_cancel (G₀ := ℂ) _ two_ne_zero]
 #align has_sum_nat_jacobi_theta hasSum_nat_jacobiTheta
 
-theorem jacobiTheta_eq_tsum_nat {z : ℂ} (hz : 0 < im z) :
-    jacobiTheta z = ↑1 + ↑2 * ∑' n : ℕ, cexp (π * I * ((n : ℂ) + 1) ^ 2 * z) := by
-  rw [(hasSum_nat_jacobiTheta hz).tsum_eq, mul_div_cancel' _ (two_ne_zero' ℂ), ← add_sub_assoc,
+theorem jacobiTheta_eq_tsum_nat {τ : ℂ} (hτ : 0 < im τ) :
+    jacobiTheta τ = ↑1 + ↑2 * ∑' n : ℕ, cexp (π * I * ((n : ℂ) + 1) ^ 2 * τ) := by
+  rw [(hasSum_nat_jacobiTheta hτ).tsum_eq, mul_div_cancel' _ (two_ne_zero' ℂ), ← add_sub_assoc,
     add_sub_cancel']
 #align jacobi_theta_eq_tsum_nat jacobiTheta_eq_tsum_nat
 
 /-- An explicit upper bound for `‖jacobiTheta τ - 1‖`. -/
-theorem norm_jacobiTheta_sub_one_le {z : ℂ} (hz : 0 < im z) :
-    ‖jacobiTheta z - 1‖ ≤ 2 / (1 - rexp (-π * z.im)) * rexp (-π * z.im) := by
-  suffices ‖∑' n : ℕ, cexp (π * I * ((n : ℂ) + 1) ^ 2 * z)‖ ≤
-      rexp (-π * z.im) / (1 - rexp (-π * z.im)) by
+theorem norm_jacobiTheta_sub_one_le {τ : ℂ} (hτ : 0 < im τ) :
+    ‖jacobiTheta τ - 1‖ ≤ 2 / (1 - rexp (-π * τ.im)) * rexp (-π * τ.im) := by
+  suffices ‖∑' n : ℕ, cexp (π * I * ((n : ℂ) + 1) ^ 2 * τ)‖ ≤
+      rexp (-π * τ.im) / (1 - rexp (-π * τ.im)) by
     calc
-      ‖jacobiTheta z - 1‖ = ↑2 * ‖∑' n : ℕ, cexp (π * I * ((n : ℂ) + 1) ^ 2 * z)‖ := by
-        rw [sub_eq_iff_eq_add'.mpr (jacobiTheta_eq_tsum_nat hz), norm_mul, Complex.norm_eq_abs,
+      ‖jacobiTheta τ - 1‖ = ↑2 * ‖∑' n : ℕ, cexp (π * I * ((n : ℂ) + 1) ^ 2 * τ)‖ := by
+        rw [sub_eq_iff_eq_add'.mpr (jacobiTheta_eq_tsum_nat hτ), norm_mul, Complex.norm_eq_abs,
           Complex.abs_two]
-      _ ≤ 2 * (rexp (-π * z.im) / (1 - rexp (-π * z.im))) := by gcongr
-      _ = 2 / (1 - rexp (-π * z.im)) * rexp (-π * z.im) := by rw [div_mul_comm, mul_comm]
-  have : ∀ n : ℕ, ‖cexp (π * I * ((n : ℂ) + 1) ^ 2 * z)‖ ≤ rexp (-π * z.im) ^ (n + 1) := by
+      _ ≤ 2 * (rexp (-π * τ.im) / (1 - rexp (-π * τ.im))) := by gcongr
+      _ = 2 / (1 - rexp (-π * τ.im)) * rexp (-π * τ.im) := by rw [div_mul_comm, mul_comm]
+  have : ∀ n : ℕ, ‖cexp (π * I * ((n : ℂ) + 1) ^ 2 * τ)‖ ≤ rexp (-π * τ.im) ^ (n + 1) := by
     intro n
-    simpa only [Int.cast_add, Int.cast_one] using norm_exp_mul_sq_le hz (n + 1)
+    simpa only [Int.cast_add, Int.cast_one] using norm_exp_mul_sq_le hτ (n + 1)
   have s : HasSum (fun n : ℕ =>
-      rexp (-π * z.im) ^ (n + 1)) (rexp (-π * z.im) / (1 - rexp (-π * z.im))) := by
+      rexp (-π * τ.im) ^ (n + 1)) (rexp (-π * τ.im) / (1 - rexp (-π * τ.im))) := by
     simp_rw [pow_succ, div_eq_mul_inv, hasSum_mul_left_iff (Real.exp_ne_zero _)]
-    exact hasSum_geometric_of_lt_1 (exp_pos (-π * z.im)).le
-      (exp_lt_one_iff.mpr <| mul_neg_of_neg_of_pos (neg_lt_zero.mpr pi_pos) hz)
-  have aux : Summable fun n : ℕ => ‖cexp (π * I * ((n : ℂ) + 1) ^ 2 * z)‖ :=
+    exact hasSum_geometric_of_lt_1 (exp_pos (-π * τ.im)).le
+      (exp_lt_one_iff.mpr <| mul_neg_of_neg_of_pos (neg_lt_zero.mpr pi_pos) hτ)
+  have aux : Summable fun n : ℕ => ‖cexp (π * I * ((n : ℂ) + 1) ^ 2 * τ)‖ :=
     .of_nonneg_of_le (fun n => norm_nonneg _) this s.summable
   exact (norm_tsum_le_tsum_norm aux).trans ((tsum_mono aux s.summable this).trans_eq s.tsum_eq)
 #align norm_jacobi_theta_sub_one_le norm_jacobiTheta_sub_one_le
@@ -160,34 +138,24 @@ theorem norm_jacobiTheta_sub_one_le {z : ℂ} (hz : 0 < im z) :
 theorem isBigO_at_im_infty_jacobiTheta_sub_one :
     (fun τ => jacobiTheta τ - 1) =O[comap im atTop] fun τ => rexp (-π * τ.im) := by
   simp_rw [IsBigO, IsBigOWith, Filter.eventually_comap, Filter.eventually_atTop]
-  refine' ⟨2 / (1 - rexp (-π)), 1, fun y hy z hz =>
-    (norm_jacobiTheta_sub_one_le (hz.symm ▸ zero_lt_one.trans_le hy : 0 < im z)).trans _⟩
+  refine' ⟨2 / (1 - rexp (-π)), 1, fun y hy τ hτ =>
+    (norm_jacobiTheta_sub_one_le (hτ.symm ▸ zero_lt_one.trans_le hy : 0 < im τ)).trans _⟩
   rw [Real.norm_eq_abs, Real.abs_exp]
   refine' mul_le_mul_of_nonneg_right _ (exp_pos _).le
   rw [div_le_div_left (zero_lt_two' ℝ), sub_le_sub_iff_left, exp_le_exp, neg_mul, neg_le_neg_iff]
-  · exact le_mul_of_one_le_right pi_pos.le (hz.symm ▸ hy)
+  · exact le_mul_of_one_le_right pi_pos.le (hτ.symm ▸ hy)
   · rw [sub_pos, exp_lt_one_iff, neg_mul, neg_lt_zero]
-    exact mul_pos pi_pos (hz.symm ▸ zero_lt_one.trans_le hy)
+    exact mul_pos pi_pos (hτ.symm ▸ zero_lt_one.trans_le hy)
   · rw [sub_pos, exp_lt_one_iff, neg_lt_zero]; exact pi_pos
 set_option linter.uppercaseLean3 false in
 #align is_O_at_im_infty_jacobi_theta_sub_one isBigO_at_im_infty_jacobiTheta_sub_one
 
-theorem differentiableAt_jacobiTheta {z : ℂ} (hz : 0 < im z) :
-    DifferentiableAt ℂ jacobiTheta z := by
-  suffices ∀ (y : ℝ) (_ : 0 < y),
-      DifferentiableOn ℂ (fun z => ∑' n : ℤ, cexp (π * I * (n : ℂ) ^ 2 * z)) {w : ℂ | y < im w} by
-    let ⟨y, hy, hy'⟩ := exists_between hz
-    exact (this y hy).differentiableAt
-      ((Complex.continuous_im.isOpen_preimage _ isOpen_Ioi).mem_nhds hy')
-  intro y hy
-  have h1 : ∀ (n : ℤ) (w : ℂ) (_ : y < im w),
-      DifferentiableWithinAt ℂ (fun v : ℂ => cexp (π * I * (n : ℂ) ^ 2 * v)) {z : ℂ | y < im z} w :=
-    fun n w _ => (differentiableAt_id.const_mul _).cexp.differentiableWithinAt
-  have h2 : IsOpen {w : ℂ | y < im w} := continuous_im.isOpen_preimage _ isOpen_Ioi
-  obtain ⟨bd, bd_s, le_bd⟩ := exists_summable_bound_exp_mul_sq hy
-  exact differentiableOn_tsum_of_summable_norm bd_s h1 h2 fun i w hw => le_bd (le_of_lt hw) i
+theorem differentiableAt_jacobiTheta {τ : ℂ} (hτ : 0 < im τ) :
+    DifferentiableAt ℂ jacobiTheta τ := by
+  simp_rw [funext jacobiTheta_eq_jacobiTheta₂]
+  exact differentiableAt_jacobiTheta₂ 0 hτ
 #align differentiable_at_jacobi_theta differentiableAt_jacobiTheta
 
-theorem continuousAt_jacobiTheta {z : ℂ} (hz : 0 < im z) : ContinuousAt jacobiTheta z :=
-  (differentiableAt_jacobiTheta hz).continuousAt
+theorem continuousAt_jacobiTheta {τ : ℂ} (hτ : 0 < im τ) : ContinuousAt jacobiTheta τ :=
+  (differentiableAt_jacobiTheta hτ).continuousAt
 #align continuous_at_jacobi_theta continuousAt_jacobiTheta
feat: Basic Complex lemmas (#9527)

and rename ofReal_mul_re → re_mul_ofReal, ofReal_mul_im → im_mul_ofReal.

From LeanAPAP

Diff
@@ -39,7 +39,7 @@ theorem norm_exp_mul_sq_le {z : ℂ} (hz : 0 < z.im) (n : ℤ) :
   · rw [Complex.norm_eq_abs, Complex.abs_exp]
     have : (π * I * n ^ 2 * z : ℂ).re = -π * z.im * (n : ℝ) ^ 2 := by
       rw [(by push_cast; ring : (π * I * n ^ 2 * z : ℂ) = (π * n ^ 2 : ℝ) * (z * I)),
-        ofReal_mul_re, mul_I_re]
+        re_ofReal_mul, mul_I_re]
       ring
     obtain ⟨m, hm⟩ := Int.eq_ofNat_of_zero_le (sq_nonneg n)
     rw [this, exp_mul, ← Int.cast_pow, rpow_int_cast, hm, zpow_ofNat]
chore: mark neg_div_neg_eq as simp (#9332)
Diff
@@ -100,9 +100,11 @@ theorem jacobiTheta_S_smul (τ : ℍ) :
   rw [mul_comm ((1 : ℂ) / _) _, mul_one_div, eq_div_iff ha', mul_comm _ (_ ^ _), eq_comm] at this
   have expo1 : ∀ n : ℤ, -↑π / (-I * ↑τ) * (n : ℂ) ^ 2 = ↑π * I * (n : ℂ) ^ 2 * (-↑τ)⁻¹ := by
     intro n
-    field_simp [hτ, I_ne_zero]
+    simp only [neg_mul, neg_div_neg_eq, div_mul_eq_mul_div, inv_eq_one_div, mul_div_assoc', mul_one,
+      ne_eq, neg_eq_zero, hτ, not_false_eq_true, eq_div_iff, I_ne_zero,
+      mul_ne_zero, div_eq_iff]
     ring_nf
-    rw [I_sq, mul_neg, mul_one, neg_neg]
+    rw [I_sq, mul_neg, mul_one]
   simp_rw [expo1] at this
   have expo2 : ∀ n : ℤ, -↑π * (-I * ↑τ) * (n : ℂ) ^ 2 = ↑π * I * (n : ℂ) ^ 2 * ↑τ := by
     intro n
feat: golf using gcongr throughout the library (#8752)

Following on from previous gcongr golfing PRs #4702 and #4784.

This is a replacement for #7901: this round of golfs, first introduced there, there exposed some performance issues in gcongr, hopefully fixed by #8731, and I am opening a new PR so that the performance can be checked against current master rather than master at the time of #7901.

Diff
@@ -55,7 +55,8 @@ theorem exists_summable_bound_exp_mul_sq {R : ℝ} (hR : 0 < R) :
   have h : y < 1 := exp_lt_one_iff.mpr (mul_neg_of_neg_of_pos (neg_lt_zero.mpr pi_pos) hR)
   refine' ⟨fun n => y ^ n.natAbs, summable_int_of_summable_nat _ _, fun hτ n => _⟩; pick_goal 3
   · refine' (norm_exp_mul_sq_le (hR.trans_le hτ) n).trans _
-    refine' pow_le_pow_of_le_left (exp_pos _).le (Real.exp_le_exp.mpr _) _
+    dsimp
+    gcongr rexp ?_ ^ _
     rwa [mul_le_mul_left_of_neg (neg_lt_zero.mpr pi_pos)]
   all_goals
     simpa only [Int.natAbs_neg, Int.natAbs_ofNat] using
@@ -138,8 +139,7 @@ theorem norm_jacobiTheta_sub_one_le {z : ℂ} (hz : 0 < im z) :
       ‖jacobiTheta z - 1‖ = ↑2 * ‖∑' n : ℕ, cexp (π * I * ((n : ℂ) + 1) ^ 2 * z)‖ := by
         rw [sub_eq_iff_eq_add'.mpr (jacobiTheta_eq_tsum_nat hz), norm_mul, Complex.norm_eq_abs,
           Complex.abs_two]
-      _ ≤ 2 * (rexp (-π * z.im) / (1 - rexp (-π * z.im))) := by
-        rwa [mul_le_mul_left (zero_lt_two' ℝ)]
+      _ ≤ 2 * (rexp (-π * z.im) / (1 - rexp (-π * z.im))) := by gcongr
       _ = 2 / (1 - rexp (-π * z.im)) * rexp (-π * z.im) := by rw [div_mul_comm, mul_comm]
   have : ∀ n : ℕ, ‖cexp (π * I * ((n : ℂ) + 1) ^ 2 * z)‖ ≤ rexp (-π * z.im) ^ (n + 1) := by
     intro n
chore: bump to v4.3.0-rc2 (#8366)

PR contents

This is the supremum of

along with some minor fixes from failures on nightly-testing as Mathlib master is merged into it.

Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.

I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0 branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.

Lean PRs involved in this bump

In particular this includes adjustments for the Lean PRs

leanprover/lean4#2778

We can get rid of all the

local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)

macros across Mathlib (and in any projects that want to write natural number powers of reals).

leanprover/lean4#2722

Changes the default behaviour of simp to (config := {decide := false}). This makes simp (and consequentially norm_num) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp or norm_num to decide or rfl, or adding (config := {decide := true}).

leanprover/lean4#2783

This changed the behaviour of simp so that simp [f] will only unfold "fully applied" occurrences of f. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true }). We may in future add a syntax for this, e.g. simp [!f]; please provide feedback! In the meantime, we have made the following changes:

  • switching to using explicit lemmas that have the intended level of application
  • (config := { unfoldPartialApp := true }) in some places, to recover the old behaviour
  • Using @[eqns] to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp and Function.flip.

This change in Lean may require further changes down the line (e.g. adding the !f syntax, and/or upstreaming the special treatment for Function.comp and Function.flip, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!

Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>

Diff
@@ -26,8 +26,6 @@ open Complex Real Asymptotics Filter
 
 open scoped Real BigOperators UpperHalfPlane
 
-local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
-
 /-- Jacobi's theta function `∑' (n : ℤ), exp (π * I * n ^ 2 * τ)`. -/
 noncomputable def jacobiTheta (z : ℂ) : ℂ :=
   ∑' n : ℤ, cexp (π * I * (n : ℂ) ^ 2 * z)
@@ -39,13 +37,13 @@ theorem norm_exp_mul_sq_le {z : ℂ} (hz : 0 < z.im) (n : ℤ) :
   have h : y < 1 := exp_lt_one_iff.mpr (mul_neg_of_neg_of_pos (neg_lt_zero.mpr pi_pos) hz)
   refine' (le_of_eq _).trans (_ : y ^ n ^ 2 ≤ _)
   · rw [Complex.norm_eq_abs, Complex.abs_exp]
-    have : (↑π * I * (n : ℂ) ^ 2 * z).re = -π * z.im * (n : ℝ) ^ 2 := by
-      rw [(by push_cast; ring : ↑π * I * (n : ℂ) ^ 2 * z = ↑(π * (n : ℝ) ^ 2) * (z * I)),
+    have : (π * I * n ^ 2 * z : ℂ).re = -π * z.im * (n : ℝ) ^ 2 := by
+      rw [(by push_cast; ring : (π * I * n ^ 2 * z : ℂ) = (π * n ^ 2 : ℝ) * (z * I)),
         ofReal_mul_re, mul_I_re]
       ring
     obtain ⟨m, hm⟩ := Int.eq_ofNat_of_zero_le (sq_nonneg n)
     rw [this, exp_mul, ← Int.cast_pow, rpow_int_cast, hm, zpow_ofNat]
-  · have : n ^ 2 = ↑(n.natAbs ^ 2) := by rw [Nat.cast_pow, Int.natAbs_sq]
+  · have : n ^ 2 = (n.natAbs ^ 2 :) := by rw [Nat.cast_pow, Int.natAbs_sq]
     rw [this, zpow_ofNat]
     exact pow_le_pow_of_le_one (exp_pos _).le h.le ((sq n.natAbs).symm ▸ n.natAbs.le_mul_self)
 #align norm_exp_mul_sq_le norm_exp_mul_sq_le
@@ -72,13 +70,13 @@ theorem summable_exp_mul_sq {z : ℂ} (hz : 0 < z.im) :
 
 theorem jacobiTheta_two_add (z : ℂ) : jacobiTheta (2 + z) = jacobiTheta z := by
   refine' tsum_congr fun n => _
-  suffices cexp (↑π * I * (n : ℂ) ^ 2 * 2) = 1 by rw [mul_add, Complex.exp_add, this, one_mul]
-  rw [(by push_cast; ring : ↑π * I * ↑n ^ 2 * 2 = ↑(n ^ 2) * (2 * π * I)), Complex.exp_int_mul,
+  suffices cexp (π * I * n ^ 2 * 2 : ℂ) = 1 by rw [mul_add, Complex.exp_add, this, one_mul]
+  rw [(by push_cast; ring : (π * I * n ^ 2 * 2 : ℂ) = (n ^ 2 :) * (2 * π * I)), Complex.exp_int_mul,
     Complex.exp_two_pi_mul_I, one_zpow]
 #align jacobi_theta_two_add jacobiTheta_two_add
 
-theorem jacobiTheta_T_sq_smul (τ : ℍ) : jacobiTheta ↑(ModularGroup.T ^ 2 • τ) = jacobiTheta τ := by
-  suffices ↑(ModularGroup.T ^ 2 • τ) = (2 : ℂ) + ↑τ by simp_rw [this, jacobiTheta_two_add]
+theorem jacobiTheta_T_sq_smul (τ : ℍ) : jacobiTheta (ModularGroup.T ^ 2 • τ :) = jacobiTheta τ := by
+  suffices (ModularGroup.T ^ 2 • τ :) = (2 : ℂ) + ↑τ by simp_rw [this, jacobiTheta_two_add]
   have : ModularGroup.T ^ (2 : ℕ) = ModularGroup.T ^ (2 : ℤ) := rfl
   simp_rw [this, UpperHalfPlane.modular_T_zpow_smul, UpperHalfPlane.coe_vadd]
   norm_cast
chore(InfiniteSum): use dot notation (#8358)

Rename

  • summable_of_norm_bounded -> Summable.of_norm_bounded;
  • summable_of_norm_bounded_eventually -> Summable.of_norm_bounded_eventually;
  • summable_of_nnnorm_bounded -> Summable.of_nnnorm_bounded;
  • summable_of_summable_norm -> Summable.of_norm;
  • summable_of_summable_nnnorm -> Summable.of_nnnorm;

New lemmas

  • Summable.of_norm_bounded_eventually_nat
  • Summable.norm

Misc changes

  • Golf a few proofs.
Diff
@@ -67,7 +67,7 @@ theorem exists_summable_bound_exp_mul_sq {R : ℝ} (hR : 0 < R) :
 theorem summable_exp_mul_sq {z : ℂ} (hz : 0 < z.im) :
     Summable fun n : ℤ => cexp (π * I * (n : ℂ) ^ 2 * z) :=
   let ⟨_, h, h'⟩ := exists_summable_bound_exp_mul_sq hz
-  summable_norm_iff.mp (summable_of_nonneg_of_le (fun _ => norm_nonneg _) (h' <| le_refl _) h)
+  .of_norm_bounded _ h (h' <| le_refl _)
 #align summable_exp_mul_sq summable_exp_mul_sq
 
 theorem jacobiTheta_two_add (z : ℂ) : jacobiTheta (2 + z) = jacobiTheta z := by
@@ -152,9 +152,8 @@ theorem norm_jacobiTheta_sub_one_le {z : ℂ} (hz : 0 < im z) :
     exact hasSum_geometric_of_lt_1 (exp_pos (-π * z.im)).le
       (exp_lt_one_iff.mpr <| mul_neg_of_neg_of_pos (neg_lt_zero.mpr pi_pos) hz)
   have aux : Summable fun n : ℕ => ‖cexp (π * I * ((n : ℂ) + 1) ^ 2 * z)‖ :=
-    summable_of_nonneg_of_le (fun n => norm_nonneg _) this s.summable
-  exact
-    (norm_tsum_le_tsum_norm aux).trans ((tsum_mono aux s.summable this).trans (le_of_eq s.tsum_eq))
+    .of_nonneg_of_le (fun n => norm_nonneg _) this s.summable
+  exact (norm_tsum_le_tsum_norm aux).trans ((tsum_mono aux s.summable this).trans_eq s.tsum_eq)
 #align norm_jacobi_theta_sub_one_le norm_jacobiTheta_sub_one_le
 
 /-- The norm of `jacobiTheta τ - 1` decays exponentially as `im τ → ∞`. -/
chore: simplify by rfl (#7039)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -79,7 +79,7 @@ theorem jacobiTheta_two_add (z : ℂ) : jacobiTheta (2 + z) = jacobiTheta z := b
 
 theorem jacobiTheta_T_sq_smul (τ : ℍ) : jacobiTheta ↑(ModularGroup.T ^ 2 • τ) = jacobiTheta τ := by
   suffices ↑(ModularGroup.T ^ 2 • τ) = (2 : ℂ) + ↑τ by simp_rw [this, jacobiTheta_two_add]
-  have : ModularGroup.T ^ (2 : ℕ) = ModularGroup.T ^ (2 : ℤ) := by rfl
+  have : ModularGroup.T ^ (2 : ℕ) = ModularGroup.T ^ (2 : ℤ) := rfl
   simp_rw [this, UpperHalfPlane.modular_T_zpow_smul, UpperHalfPlane.coe_vadd]
   norm_cast
 set_option linter.uppercaseLean3 false in
chore: drop MulZeroClass. in mul_zero/zero_mul (#6682)

Search&replace MulZeroClass.mul_zero -> mul_zero, MulZeroClass.zero_mul -> zero_mul.

These were introduced by Mathport, as the full name of mul_zero is actually MulZeroClass.mul_zero (it's exported with the short name).

Diff
@@ -90,7 +90,7 @@ theorem jacobiTheta_S_smul (τ : ℍ) :
   unfold jacobiTheta
   rw [UpperHalfPlane.modular_S_smul, UpperHalfPlane.coe_mk]
   have ha : 0 < (-I * τ).re := by
-    rw [neg_mul, neg_re, mul_re, I_re, I_im, MulZeroClass.zero_mul, one_mul, zero_sub, neg_neg]
+    rw [neg_mul, neg_re, mul_re, I_re, I_im, zero_mul, one_mul, zero_sub, neg_neg]
     exact τ.im_pos
   have ha' : (-I * τ) ^ (1 / 2 : ℂ) ≠ 0 := by
     rw [Ne.def, cpow_eq_zero_iff]
@@ -118,7 +118,7 @@ theorem hasSum_nat_jacobiTheta {z : ℂ} (hz : 0 < im z) :
   have := (summable_exp_mul_sq hz).hasSum.sum_nat_of_sum_int
   rw [← @hasSum_nat_add_iff' ℂ _ _ _ _ 1] at this
   simp_rw [Finset.sum_range_one, Int.cast_neg, Int.cast_ofNat, Nat.cast_zero, neg_zero,
-    Int.cast_zero, sq (0 : ℂ), MulZeroClass.mul_zero, MulZeroClass.zero_mul, neg_sq, ← mul_two,
+    Int.cast_zero, sq (0 : ℂ), mul_zero, zero_mul, neg_sq, ← mul_two,
     Complex.exp_zero, add_sub_assoc, (by norm_num : (1 : ℂ) - 1 * 2 = -1), ← sub_eq_add_neg,
     Nat.cast_add, Nat.cast_one] at this
   convert this.div_const 2 using 1
chore: regularize HPow.hPow porting notes (#6465)
Diff
@@ -26,7 +26,7 @@ open Complex Real Asymptotics Filter
 
 open scoped Real BigOperators UpperHalfPlane
 
-local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue #2220
+local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
 
 /-- Jacobi's theta function `∑' (n : ℤ), exp (π * I * n ^ 2 * τ)`. -/
 noncomputable def jacobiTheta (z : ℂ) : ℂ :=
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,17 +2,14 @@
 Copyright (c) 2023 David Loeffler. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: David Loeffler
-
-! This file was ported from Lean 3 source module number_theory.modular_forms.jacobi_theta.basic
-! leanprover-community/mathlib commit 57f9349f2fe19d2de7207e99b0341808d977cdcf
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Analysis.SpecialFunctions.Gaussian
 import Mathlib.Analysis.Complex.LocallyUniformLimit
 import Mathlib.Analysis.Complex.UpperHalfPlane.FunctionsBoundedAtInfty
 import Mathlib.Analysis.Complex.UpperHalfPlane.Topology
 
+#align_import number_theory.modular_forms.jacobi_theta.basic from "leanprover-community/mathlib"@"57f9349f2fe19d2de7207e99b0341808d977cdcf"
+
 /-! # Jacobi's theta function
 
 This file defines the Jacobi theta function
feat: port NumberTheory.ModularForms.JacobiTheta.Basic (#5547)

Dependencies 12 + 1181

1182 files ported (99.0%)
525418 lines ported (98.9%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file