analysis.special_functions.gaussianMathlib.Analysis.SpecialFunctions.Gaussian

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)

(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)

(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)

(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
@@ -412,7 +412,7 @@ theorem Real.Gamma_one_half_eq : Real.Gamma (1 / 2) = sqrt π :=
     rw [smul_eq_mul, this]
     field_simp [(ne_of_lt hx).symm]
     norm_num; ring
-  · rw [div_one, ← mul_div_assoc, mul_comm, mul_div_cancel _ (two_ne_zero' ℝ)]
+  · rw [div_one, ← mul_div_assoc, mul_comm, mul_div_cancel_right₀ _ (two_ne_zero' ℝ)]
 #align real.Gamma_one_half_eq Real.Gamma_one_half_eq
 -/
 
Diff
@@ -355,10 +355,10 @@ theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
   by
   have full_integral := integral_gaussian_complex hb
   have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
-  rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral 
+  rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral
   suffices ∫ x : ℝ in Iic 0, cexp (-b * x ^ 2) = ∫ x : ℝ in Ioi 0, cexp (-b * x ^ 2)
     by
-    rw [this, ← mul_two] at full_integral 
+    rw [this, ← mul_two] at full_integral
     rwa [eq_div_iff]; exact two_ne_zero
   have : ∀ c : ℝ, ∫ x in 0 ..c, cexp (-b * x ^ 2) = ∫ x in -c..0, cexp (-b * x ^ 2) :=
     by
@@ -507,15 +507,15 @@ theorem verticalIntegral_norm_le (hb : 0 < b.re) (c : ℝ) {T : ℝ} (hT : 0 ≤
   · intro y hy
     have absy : |y| ≤ |c| := by
       rcases le_or_lt 0 c with ⟨⟩
-      · rw [uIoc_of_le h] at hy 
+      · rw [uIoc_of_le h] at hy
         rw [abs_of_nonneg h, abs_of_pos hy.1]
         exact hy.2
-      · rw [uIoc_of_lt h] at hy 
+      · rw [uIoc_of_lt h] at hy
         rw [abs_of_neg h, abs_of_nonpos hy.2, neg_le_neg_iff]
         exact hy.1.le
     rw [norm_mul, Complex.norm_eq_abs, abs_I, one_mul, two_mul]
     refine' (norm_sub_le _ _).trans (add_le_add (vert_norm_bound hT absy) _)
-    rw [← abs_neg y] at absy 
+    rw [← abs_neg y] at absy
     simpa only [neg_mul, of_real_neg] using vert_norm_bound hT absy
 #align gaussian_fourier.vertical_integral_norm_le GaussianFourier.verticalIntegral_norm_le
 -/
@@ -589,7 +589,7 @@ theorem integral_cexp_neg_mul_sq_add_real_mul_I (hb : 0 < b.re) (c : ℝ) :
     by
     ext1 T
     specialize C T
-    rw [sub_eq_zero] at C 
+    rw [sub_eq_zero] at C
     unfold vertical_integral
     rw [integral_const_mul, intervalIntegral.integral_sub]
     · simp_rw [(fun a b => by rw [sq]; ring_nf : ∀ a b : ℂ, (a - b * I) ^ 2 = (-a + b * I) ^ 2)]
@@ -615,8 +615,8 @@ theorem integral_cexp_neg_hMul_sq_add_const (hb : 0 < b.re) (c : ℂ) :
   · infer_instance
 #align integral_cexp_neg_mul_sq_add_const integral_cexp_neg_hMul_sq_add_const
 
-#print fourier_transform_gaussian /-
-theorem fourier_transform_gaussian (hb : 0 < b.re) (t : ℂ) :
+#print fourierIntegral_gaussian /-
+theorem fourierIntegral_gaussian (hb : 0 < b.re) (t : ℂ) :
     ∫ x : ℝ, cexp (I * t * x) * cexp (-b * x ^ 2) =
       cexp (-t ^ 2 / (4 * b)) * (π / b) ^ (1 / 2 : ℂ) :=
   by
@@ -629,11 +629,11 @@ theorem fourier_transform_gaussian (hb : 0 < b.re) (t : ℂ) :
     rw [I_sq]
     field_simp; ring
   simp_rw [this, Complex.exp_add, integral_mul_left, integral_cexp_neg_hMul_sq_add_const hb]
-#align fourier_transform_gaussian fourier_transform_gaussian
+#align fourier_transform_gaussian fourierIntegral_gaussian
 -/
 
-#print fourier_transform_gaussian_pi /-
-theorem fourier_transform_gaussian_pi (hb : 0 < b.re) :
+#print fourierIntegral_gaussian_pi /-
+theorem fourierIntegral_gaussian_pi (hb : 0 < b.re) :
     (𝓕 fun x : ℝ => cexp (-π * b * x ^ 2)) = fun t : ℝ =>
       1 / b ^ (1 / 2 : ℂ) * cexp (-π / b * t ^ 2) :=
   by
@@ -651,7 +651,7 @@ theorem fourier_transform_gaussian_pi (hb : 0 < b.re) :
     · rw [← div_div, div_self (of_real_ne_zero.mpr pi_ne_zero), one_div, one_div b, inv_cpow]
       rw [Ne.def, arg_eq_pi_iff, not_and_or, not_lt]
       exact Or.inl hb.le
-#align fourier_transform_gaussian_pi fourier_transform_gaussian_pi
+#align fourier_transform_gaussian_pi fourierIntegral_gaussian_pi
 -/
 
 end GaussianFourier
@@ -720,12 +720,12 @@ theorem Complex.tsum_exp_neg_mul_int_sq {a : ℂ} (ha : 0 < a.re) :
     ring
   have Ff_bd : 𝓕 f =O[cocompact ℝ] fun x => |x| ^ (-2 : ℝ) :=
     by
-    rw [fourier_transform_gaussian_pi ha]
+    rw [fourierIntegral_gaussian_pi ha]
     convert (isLittleO_exp_neg_mul_sq_cocompact h2 _).IsBigO.const_mul_left _
     ext1 x
     congr 1
     ring_nf
-  simpa only [fourier_transform_gaussian_pi ha, tsum_mul_left] using
+  simpa only [fourierIntegral_gaussian_pi ha, tsum_mul_left] using
     Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay
       (complex.continuous_exp.comp (continuous_const.mul (continuous_of_real.pow 2)) : Continuous f)
       one_lt_two f_bd Ff_bd
Diff
@@ -218,7 +218,7 @@ theorem integral_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
   convert
     integral_Ioi_of_has_deriv_at_of_tendsto' (fun x hx => (A ↑x).comp_ofReal)
       (integrable_mul_cexp_neg_mul_sq hb).IntegrableOn B
-  simp only [MulZeroClass.mul_zero, of_real_zero, zero_pow', Ne.def, bit0_eq_zero, Nat.one_ne_zero,
+  simp only [MulZeroClass.mul_zero, of_real_zero, zero_pow, Ne.def, bit0_eq_zero, Nat.one_ne_zero,
     not_false_iff, Complex.exp_zero, mul_one, sub_neg_eq_add, zero_add]
 #align integral_mul_cexp_neg_mul_sq integral_mul_cexp_neg_mul_sq
 -/
Diff
@@ -605,8 +605,7 @@ theorem integral_cexp_neg_mul_sq_add_real_mul_I (hb : 0 < b.re) (c : ℝ) :
 #align gaussian_fourier.integral_cexp_neg_mul_sq_add_real_mul_I GaussianFourier.integral_cexp_neg_mul_sq_add_real_mul_I
 -/
 
-#print integral_cexp_neg_mul_sq_add_const /-
-theorem integral_cexp_neg_mul_sq_add_const (hb : 0 < b.re) (c : ℂ) :
+theorem integral_cexp_neg_hMul_sq_add_const (hb : 0 < b.re) (c : ℂ) :
     ∫ x : ℝ, cexp (-b * (x + c) ^ 2) = (π / b) ^ (1 / 2 : ℂ) :=
   by
   rw [← re_add_im c]
@@ -614,8 +613,7 @@ theorem integral_cexp_neg_mul_sq_add_const (hb : 0 < b.re) (c : ℂ) :
   rw [integral_add_right_eq_self fun x : ℝ => cexp (-b * (↑x + ↑c.im * I) ^ 2)]
   · apply integral_cexp_neg_mul_sq_add_real_mul_I hb
   · infer_instance
-#align integral_cexp_neg_mul_sq_add_const integral_cexp_neg_mul_sq_add_const
--/
+#align integral_cexp_neg_mul_sq_add_const integral_cexp_neg_hMul_sq_add_const
 
 #print fourier_transform_gaussian /-
 theorem fourier_transform_gaussian (hb : 0 < b.re) (t : ℂ) :
@@ -630,7 +628,7 @@ theorem fourier_transform_gaussian (hb : 0 < b.re) (t : ℂ) :
     ring_nf
     rw [I_sq]
     field_simp; ring
-  simp_rw [this, Complex.exp_add, integral_mul_left, integral_cexp_neg_mul_sq_add_const hb]
+  simp_rw [this, Complex.exp_add, integral_mul_left, integral_cexp_neg_hMul_sq_add_const hb]
 #align fourier_transform_gaussian fourier_transform_gaussian
 -/
 
Diff
@@ -85,7 +85,7 @@ theorem integrableOn_rpow_mul_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) {s : ℝ} (h
   constructor
   · rw [← integrableOn_Icc_iff_integrableOn_Ioc]
     refine' integrable_on.mul_continuous_on _ _ is_compact_Icc
-    · refine' (intervalIntegrable_iff_integrable_Icc_of_le zero_le_one).mp _
+    · refine' (intervalIntegrable_iff_integrableOn_Icc_of_le zero_le_one).mp _
       exact intervalIntegral.intervalIntegrable_rpow' hs
     · exact (continuous_exp.comp (continuous_const.mul (continuous_pow 2))).ContinuousOn
   · have B : (0 : ℝ) < 1 / 2 := by norm_num
Diff
@@ -134,7 +134,7 @@ theorem integrableOn_Ioi_exp_neg_mul_sq_iff {b : ℝ} :
     IntegrableOn (fun x : ℝ => exp (-b * x ^ 2)) (Ioi 0) ↔ 0 < b :=
   by
   refine' ⟨fun h => _, fun h => (integrable_exp_neg_mul_sq h).IntegrableOn⟩
-  by_contra' hb
+  by_contra! hb
   have : ∫⁻ x : ℝ in Ioi 0, 1 ≤ ∫⁻ x : ℝ in Ioi 0, ‖NormedSpace.exp (-b * x ^ 2)‖₊ :=
     by
     apply lintegral_mono fun x => _
Diff
@@ -135,7 +135,7 @@ theorem integrableOn_Ioi_exp_neg_mul_sq_iff {b : ℝ} :
   by
   refine' ⟨fun h => _, fun h => (integrable_exp_neg_mul_sq h).IntegrableOn⟩
   by_contra' hb
-  have : ∫⁻ x : ℝ in Ioi 0, 1 ≤ ∫⁻ x : ℝ in Ioi 0, ‖exp (-b * x ^ 2)‖₊ :=
+  have : ∫⁻ x : ℝ in Ioi 0, 1 ≤ ∫⁻ x : ℝ in Ioi 0, ‖NormedSpace.exp (-b * x ^ 2)‖₊ :=
     by
     apply lintegral_mono fun x => _
     simp only [neg_mul, ENNReal.one_le_coe_iff, ← to_nnreal_one, to_nnreal_le_iff_le_coe,
@@ -293,7 +293,7 @@ theorem continuousAt_gaussian_integral (b : ℂ) (hb : 0 < re b) :
     exact integrable_exp_neg_mul_sq hb
   have f_cts : ∀ x : ℝ, ContinuousAt (fun c => f c x) b := fun x =>
     (complex.continuous_exp.comp (continuous_id'.neg.mul continuous_const)).ContinuousAt
-  have f_le_bd : ∀ᶠ c : ℂ in 𝓝 b, ∀ᵐ x : ℝ, ‖f c x‖ ≤ exp (-d * x ^ 2) :=
+  have f_le_bd : ∀ᶠ c : ℂ in 𝓝 b, ∀ᵐ x : ℝ, ‖f c x‖ ≤ NormedSpace.exp (-d * x ^ 2) :=
     by
     refine' eventually_of_mem ((continuous_re.is_open_preimage _ isOpen_Ioi).mem_nhds hd') _
     refine' fun c hc => ae_of_all _ fun x => _
@@ -331,7 +331,7 @@ theorem integral_gaussian_complex {b : ℂ} (hb : 0 < re b) :
     rw [Ne.def, cpow_eq_zero_iff, not_and_or]
     exact Or.inl (div_ne_zero (of_real_ne_zero.mpr pi_ne_zero) (nv hc))
   · -- equality at 1
-    have : ∀ x : ℝ, cexp (-1 * x ^ 2) = exp (-1 * x ^ 2) :=
+    have : ∀ x : ℝ, cexp (-1 * x ^ 2) = NormedSpace.exp (-1 * x ^ 2) :=
       by
       intro x
       simp only [of_real_exp, neg_mul, one_mul, of_real_neg, of_real_pow]
@@ -483,7 +483,7 @@ theorem verticalIntegral_norm_le (hb : 0 < b.re) (c : ℝ) {T : ℝ} (hT : 0 ≤
         ∀ {c y : ℝ},
           |y| ≤ |c| →
             ‖cexp (-b * (T + y * I) ^ 2)‖ ≤
-              exp (-(b.re * T ^ 2 - 2 * |b.im| * |c| * T - b.re * c ^ 2)) :=
+              NormedSpace.exp (-(b.re * T ^ 2 - 2 * |b.im| * |c| * T - b.re * c ^ 2)) :=
     by
     intro T hT c y hy
     rw [norm_cexp_neg_mul_sq_add_mul_I b, exp_le_exp, neg_le_neg_iff]
@@ -552,7 +552,7 @@ theorem integrable_cexp_neg_mul_sq_add_real_mul_I (hb : 0 < b.re) (c : ℝ) :
   rw [← has_finite_integral_norm_iff]
   simp_rw [norm_cexp_neg_mul_sq_add_mul_I' hb.ne', neg_sub _ (c ^ 2 * _),
     sub_eq_add_neg _ (b.re * _), Real.exp_add]
-  suffices integrable fun x : ℝ => exp (-(b.re * x ^ 2)) by
+  suffices integrable fun x : ℝ => NormedSpace.exp (-(b.re * x ^ 2)) by
     exact (integrable.comp_sub_right this (b.im * c / b.re)).HasFiniteIntegral.const_mul _
   simp_rw [← neg_mul]
   apply integrable_exp_neg_mul_sq hb
@@ -646,7 +646,7 @@ theorem fourier_transform_gaussian_pi (hb : 0 < b.re) :
   convert _root_.fourier_transform_gaussian h1 (-2 * π * t) using 1
   · congr 1 with x : 1
     congr 2
-    all_goals push_cast ; ring
+    all_goals push_cast; ring
   · conv_lhs => rw [mul_comm]
     congr 2
     · field_simp [of_real_ne_zero.mpr pi_ne_zero]; ring
Diff
@@ -3,11 +3,11 @@ Copyright (c) 2022 Sébastien Gouëzel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
 -/
-import Mathbin.Analysis.SpecialFunctions.Gamma.Basic
-import Mathbin.Analysis.SpecialFunctions.PolarCoord
-import Mathbin.Analysis.Convex.Complex
-import Mathbin.Analysis.Complex.CauchyIntegral
-import Mathbin.Analysis.Fourier.PoissonSummation
+import Analysis.SpecialFunctions.Gamma.Basic
+import Analysis.SpecialFunctions.PolarCoord
+import Analysis.Convex.Complex
+import Analysis.Complex.CauchyIntegral
+import Analysis.Fourier.PoissonSummation
 
 #align_import analysis.special_functions.gaussian from "leanprover-community/mathlib"@"08b63ab58a6ec1157ebeafcbbe6c7a3fb3c9f6d5"
 
Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2022 Sébastien Gouëzel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
-
-! This file was ported from Lean 3 source module analysis.special_functions.gaussian
-! leanprover-community/mathlib commit 08b63ab58a6ec1157ebeafcbbe6c7a3fb3c9f6d5
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.SpecialFunctions.Gamma.Basic
 import Mathbin.Analysis.SpecialFunctions.PolarCoord
@@ -14,6 +9,8 @@ import Mathbin.Analysis.Convex.Complex
 import Mathbin.Analysis.Complex.CauchyIntegral
 import Mathbin.Analysis.Fourier.PoissonSummation
 
+#align_import analysis.special_functions.gaussian from "leanprover-community/mathlib"@"08b63ab58a6ec1157ebeafcbbe6c7a3fb3c9f6d5"
+
 /-!
 # Gaussian integral
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
 
 ! This file was ported from Lean 3 source module analysis.special_functions.gaussian
-! leanprover-community/mathlib commit 7982767093ae38cba236487f9c9dd9cd99f63c16
+! leanprover-community/mathlib commit 08b63ab58a6ec1157ebeafcbbe6c7a3fb3c9f6d5
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -17,6 +17,9 @@ import Mathbin.Analysis.Fourier.PoissonSummation
 /-!
 # Gaussian integral
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 We prove various versions of the formula for the Gaussian integral:
 * `integral_gaussian`: for real `b` we have `∫ x:ℝ, exp (-b * x^2) = sqrt (π / b)`.
 * `integral_gaussian_complex`: for complex `b` with `0 < re b` we have
Diff
@@ -53,6 +53,7 @@ notation "cexp" => Complex.exp
 
 notation "rexp" => Real.exp
 
+#print exp_neg_mul_sq_isLittleO_exp_neg /-
 theorem exp_neg_mul_sq_isLittleO_exp_neg {b : ℝ} (hb : 0 < b) :
     (fun x : ℝ => exp (-b * x ^ 2)) =o[atTop] fun x : ℝ => exp (-x) :=
   by
@@ -62,7 +63,9 @@ theorem exp_neg_mul_sq_isLittleO_exp_neg {b : ℝ} (hb : 0 < b) :
   apply tendsto_at_top_add_const_right at_top (-1 : ℝ)
   exact tendsto.const_mul_at_top hb tendsto_id
 #align exp_neg_mul_sq_is_o_exp_neg exp_neg_mul_sq_isLittleO_exp_neg
+-/
 
+#print rpow_mul_exp_neg_mul_sq_isLittleO_exp_neg /-
 theorem rpow_mul_exp_neg_mul_sq_isLittleO_exp_neg {b : ℝ} (hb : 0 < b) (s : ℝ) :
     (fun x : ℝ => x ^ s * exp (-b * x ^ 2)) =o[atTop] fun x : ℝ => exp (-(1 / 2) * x) :=
   by
@@ -72,7 +75,9 @@ theorem rpow_mul_exp_neg_mul_sq_isLittleO_exp_neg {b : ℝ} (hb : 0 < b) (s : 
   convert Gamma_integrand_is_o s
   simp_rw [mul_comm]
 #align rpow_mul_exp_neg_mul_sq_is_o_exp_neg rpow_mul_exp_neg_mul_sq_isLittleO_exp_neg
+-/
 
+#print integrableOn_rpow_mul_exp_neg_mul_sq /-
 theorem integrableOn_rpow_mul_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : -1 < s) :
     IntegrableOn (fun x : ℝ => x ^ s * exp (-b * x ^ 2)) (Ioi 0) :=
   by
@@ -91,7 +96,9 @@ theorem integrableOn_rpow_mul_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) {s : ℝ} (h
     apply ((continuous_at_rpow_const _ _ (Or.inl N)).mul _).ContinuousWithinAt
     exact (continuous_exp.comp (continuous_const.mul (continuous_pow 2))).ContinuousAt
 #align integrable_on_rpow_mul_exp_neg_mul_sq integrableOn_rpow_mul_exp_neg_mul_sq
+-/
 
+#print integrable_rpow_mul_exp_neg_mul_sq /-
 theorem integrable_rpow_mul_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : -1 < s) :
     Integrable fun x : ℝ => x ^ s * exp (-b * x ^ 2) :=
   by
@@ -114,11 +121,15 @@ theorem integrable_rpow_mul_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) {s : ℝ} (hs
     apply mul_le_mul_of_nonneg_right _ (exp_pos _).le
     simpa [abs_of_nonneg h'x] using abs_rpow_le_abs_rpow (-x) s
 #align integrable_rpow_mul_exp_neg_mul_sq integrable_rpow_mul_exp_neg_mul_sq
+-/
 
+#print integrable_exp_neg_mul_sq /-
 theorem integrable_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) : Integrable fun x : ℝ => exp (-b * x ^ 2) :=
   by simpa using integrable_rpow_mul_exp_neg_mul_sq hb (by norm_num : (-1 : ℝ) < 0)
 #align integrable_exp_neg_mul_sq integrable_exp_neg_mul_sq
+-/
 
+#print integrableOn_Ioi_exp_neg_mul_sq_iff /-
 theorem integrableOn_Ioi_exp_neg_mul_sq_iff {b : ℝ} :
     IntegrableOn (fun x : ℝ => exp (-b * x ^ 2)) (Ioi 0) ↔ 0 < b :=
   by
@@ -132,23 +143,31 @@ theorem integrableOn_Ioi_exp_neg_mul_sq_iff {b : ℝ} :
     exact mul_nonpos_of_nonpos_of_nonneg hb (sq_nonneg _)
   simpa using this.trans_lt h.2
 #align integrable_on_Ioi_exp_neg_mul_sq_iff integrableOn_Ioi_exp_neg_mul_sq_iff
+-/
 
+#print integrable_exp_neg_mul_sq_iff /-
 theorem integrable_exp_neg_mul_sq_iff {b : ℝ} :
     (Integrable fun x : ℝ => exp (-b * x ^ 2)) ↔ 0 < b :=
   ⟨fun h => integrableOn_Ioi_exp_neg_mul_sq_iff.mp h.IntegrableOn, integrable_exp_neg_mul_sq⟩
 #align integrable_exp_neg_mul_sq_iff integrable_exp_neg_mul_sq_iff
+-/
 
+#print integrable_mul_exp_neg_mul_sq /-
 theorem integrable_mul_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) :
     Integrable fun x : ℝ => x * exp (-b * x ^ 2) := by
   simpa using integrable_rpow_mul_exp_neg_mul_sq hb (by norm_num : (-1 : ℝ) < 1)
 #align integrable_mul_exp_neg_mul_sq integrable_mul_exp_neg_mul_sq
+-/
 
+#print norm_cexp_neg_mul_sq /-
 theorem norm_cexp_neg_mul_sq (b : ℂ) (x : ℝ) : ‖Complex.exp (-b * x ^ 2)‖ = exp (-b.re * x ^ 2) :=
   by
   rw [Complex.norm_eq_abs, Complex.abs_exp, ← of_real_pow, mul_comm (-b) _, of_real_mul_re, neg_re,
     mul_comm]
 #align norm_cexp_neg_mul_sq norm_cexp_neg_mul_sq
+-/
 
+#print integrable_cexp_neg_mul_sq /-
 theorem integrable_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
     Integrable fun x : ℝ => cexp (-b * x ^ 2) :=
   by
@@ -160,7 +179,9 @@ theorem integrable_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
   simp_rw [norm_cexp_neg_mul_sq]
   exact (integrable_exp_neg_mul_sq hb).2
 #align integrable_cexp_neg_mul_sq integrable_cexp_neg_mul_sq
+-/
 
+#print integrable_mul_cexp_neg_mul_sq /-
 theorem integrable_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
     Integrable fun x : ℝ => ↑x * cexp (-b * x ^ 2) :=
   by
@@ -173,7 +194,9 @@ theorem integrable_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
   rw [norm_mul, norm_mul, norm_cexp_neg_mul_sq b, Complex.norm_eq_abs, abs_of_real,
     Real.norm_eq_abs, norm_of_nonneg (exp_pos _).le]
 #align integrable_mul_cexp_neg_mul_sq integrable_mul_cexp_neg_mul_sq
+-/
 
+#print integral_mul_cexp_neg_mul_sq /-
 theorem integral_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
     ∫ r : ℝ in Ioi 0, (r : ℂ) * cexp (-b * r ^ 2) = (2 * b)⁻¹ :=
   by
@@ -198,7 +221,9 @@ theorem integral_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
   simp only [MulZeroClass.mul_zero, of_real_zero, zero_pow', Ne.def, bit0_eq_zero, Nat.one_ne_zero,
     not_false_iff, Complex.exp_zero, mul_one, sub_neg_eq_add, zero_add]
 #align integral_mul_cexp_neg_mul_sq integral_mul_cexp_neg_mul_sq
+-/
 
+#print integral_gaussian_sq_complex /-
 /-- The *square* of the Gaussian integral `∫ x:ℝ, exp (-b * x^2)` is equal to `π / b`. -/
 theorem integral_gaussian_sq_complex {b : ℂ} (hb : 0 < b.re) :
     (∫ x : ℝ, cexp (-b * x ^ 2)) ^ 2 = π / b :=
@@ -232,7 +257,9 @@ theorem integral_gaussian_sq_complex {b : ℂ} (hb : 0 < b.re) :
       field_simp [(by contrapose! hb; rw [hb, zero_re] : b ≠ 0)]
       ring
 #align integral_gaussian_sq_complex integral_gaussian_sq_complex
+-/
 
+#print integral_gaussian /-
 theorem integral_gaussian (b : ℝ) : ∫ x, exp (-b * x ^ 2) = sqrt (π / b) :=
   by
   -- First we deal with the crazy case where `b ≤ 0`: then both sides vanish.
@@ -248,7 +275,9 @@ theorem integral_gaussian (b : ℝ) : ∫ x, exp (-b * x ^ 2) = sqrt (π / b) :=
   ext1 x
   rw [of_real_exp, of_real_mul, of_real_pow, of_real_neg]
 #align integral_gaussian integral_gaussian
+-/
 
+#print continuousAt_gaussian_integral /-
 theorem continuousAt_gaussian_integral (b : ℂ) (hb : 0 < re b) :
     ContinuousAt (fun c : ℂ => ∫ x : ℝ, cexp (-c * x ^ 2)) b :=
   by
@@ -274,7 +303,9 @@ theorem continuousAt_gaussian_integral (b : ℂ) (hb : 0 < re b) :
     continuous_at_of_dominated (eventually_of_forall f_meas) f_le_bd (integrable_exp_neg_mul_sq hd)
       (ae_of_all _ f_cts)
 #align continuous_at_gaussian_integral continuousAt_gaussian_integral
+-/
 
+#print integral_gaussian_complex /-
 theorem integral_gaussian_complex {b : ℂ} (hb : 0 < re b) :
     ∫ x : ℝ, cexp (-b * x ^ 2) = (π / b) ^ (1 / 2 : ℂ) :=
   by
@@ -315,7 +346,9 @@ theorem integral_gaussian_complex {b : ℂ} (hb : 0 < re b) :
     · rwa [sqrt_eq_rpow]
     · rw [div_one]; exact pi_pos.le
 #align integral_gaussian_complex integral_gaussian_complex
+-/
 
+#print integral_gaussian_complex_Ioi /-
 -- The Gaussian integral on the half-line, `∫ x in Ioi 0, exp (-b * x^2)`, for complex `b`.
 theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
     ∫ x : ℝ in Ioi 0, cexp (-b * x ^ 2) = (π / b) ^ (1 / 2 : ℂ) / 2 :=
@@ -343,7 +376,9 @@ theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
     apply (integrable_cexp_neg_mul_sq hb).IntegrableOn
   exact tendsto_nhds_unique t2 t1
 #align integral_gaussian_complex_Ioi integral_gaussian_complex_Ioi
+-/
 
+#print integral_gaussian_Ioi /-
 -- The Gaussian integral on the half-line, `∫ x in Ioi 0, exp (-b * x^2)`, for real `b`.
 theorem integral_gaussian_Ioi (b : ℝ) : ∫ x in Ioi 0, exp (-b * x ^ 2) = sqrt (π / b) / 2 :=
   by
@@ -358,9 +393,11 @@ theorem integral_gaussian_Ioi (b : ℝ) : ∫ x in Ioi 0, exp (-b * x ^ 2) = sqr
     norm_num
     exact (div_pos pi_pos hb).le
 #align integral_gaussian_Ioi integral_gaussian_Ioi
+-/
 
+#print Real.Gamma_one_half_eq /-
 /-- The special-value formula `Γ(1/2) = √π`, which is equivalent to the Gaussian integral. -/
-theorem Real.gamma_one_half_eq : Real.Gamma (1 / 2) = sqrt π :=
+theorem Real.Gamma_one_half_eq : Real.Gamma (1 / 2) = sqrt π :=
   by
   rw [Gamma_eq_integral one_half_pos, ← integral_comp_rpow_Ioi_of_pos zero_lt_two]
   convert congr_arg (fun x : ℝ => 2 * x) (integral_gaussian_Ioi 1)
@@ -376,15 +413,18 @@ theorem Real.gamma_one_half_eq : Real.Gamma (1 / 2) = sqrt π :=
     field_simp [(ne_of_lt hx).symm]
     norm_num; ring
   · rw [div_one, ← mul_div_assoc, mul_comm, mul_div_cancel _ (two_ne_zero' ℝ)]
-#align real.Gamma_one_half_eq Real.gamma_one_half_eq
+#align real.Gamma_one_half_eq Real.Gamma_one_half_eq
+-/
 
+#print Complex.Gamma_one_half_eq /-
 /-- The special-value formula `Γ(1/2) = √π`, which is equivalent to the Gaussian integral. -/
-theorem Complex.gamma_one_half_eq : Complex.Gamma (1 / 2) = π ^ (1 / 2 : ℂ) :=
+theorem Complex.Gamma_one_half_eq : Complex.Gamma (1 / 2) = π ^ (1 / 2 : ℂ) :=
   by
-  convert congr_arg coe Real.gamma_one_half_eq
+  convert congr_arg coe Real.Gamma_one_half_eq
   · simpa only [one_div, of_real_inv, of_real_bit0] using Gamma_of_real (1 / 2)
   · rw [sqrt_eq_rpow, of_real_cpow pi_pos.le, of_real_div, of_real_bit0, of_real_one]
-#align complex.Gamma_one_half_eq Complex.gamma_one_half_eq
+#align complex.Gamma_one_half_eq Complex.Gamma_one_half_eq
+-/
 
 namespace GaussianFourier
 
@@ -398,22 +438,27 @@ open scoped Real
 
 variable {b : ℂ}
 
+#print GaussianFourier.verticalIntegral /-
 /-- The integral of the Gaussian function over the vertical edges of a rectangle
 with vertices at `(±T, 0)` and `(±T, c)`.  -/
 def verticalIntegral (b : ℂ) (c T : ℝ) : ℂ :=
   ∫ y : ℝ in 0 ..c, I * (cexp (-b * (T + y * I) ^ 2) - cexp (-b * (T - y * I) ^ 2))
 #align gaussian_fourier.vertical_integral GaussianFourier.verticalIntegral
+-/
 
+#print GaussianFourier.norm_cexp_neg_mul_sq_add_mul_I /-
 /-- Explicit formula for the norm of the Gaussian function along the vertical
 edges. -/
-theorem norm_cexp_neg_mul_sq_add_mul_i (b : ℂ) (c T : ℝ) :
+theorem norm_cexp_neg_mul_sq_add_mul_I (b : ℂ) (c T : ℝ) :
     ‖cexp (-b * (T + c * I) ^ 2)‖ = exp (-(b.re * T ^ 2 - 2 * b.im * c * T - b.re * c ^ 2)) :=
   by
   rw [Complex.norm_eq_abs, Complex.abs_exp, neg_mul, neg_re, ← re_add_im b]
   simp only [sq, re_add_im, mul_re, mul_im, add_re, add_im, of_real_re, of_real_im, I_re, I_im]
   ring_nf
-#align gaussian_fourier.norm_cexp_neg_mul_sq_add_mul_I GaussianFourier.norm_cexp_neg_mul_sq_add_mul_i
+#align gaussian_fourier.norm_cexp_neg_mul_sq_add_mul_I GaussianFourier.norm_cexp_neg_mul_sq_add_mul_I
+-/
 
+#print GaussianFourier.norm_cexp_neg_mul_sq_add_mul_I' /-
 theorem norm_cexp_neg_mul_sq_add_mul_I' (hb : b.re ≠ 0) (c T : ℝ) :
     ‖cexp (-b * (T + c * I) ^ 2)‖ =
       exp (-(b.re * (T - b.im * c / b.re) ^ 2 - c ^ 2 * (b.im ^ 2 / b.re + b.re))) :=
@@ -424,7 +469,9 @@ theorem norm_cexp_neg_mul_sq_add_mul_I' (hb : b.re ≠ 0) (c T : ℝ) :
     by field_simp; ring
   rw [norm_cexp_neg_mul_sq_add_mul_I, this]
 #align gaussian_fourier.norm_cexp_neg_mul_sq_add_mul_I' GaussianFourier.norm_cexp_neg_mul_sq_add_mul_I'
+-/
 
+#print GaussianFourier.verticalIntegral_norm_le /-
 theorem verticalIntegral_norm_le (hb : 0 < b.re) (c : ℝ) {T : ℝ} (hT : 0 ≤ T) :
     ‖verticalIntegral b c T‖ ≤
       2 * |c| * exp (-(b.re * T ^ 2 - 2 * |b.im| * |c| * T - b.re * c ^ 2)) :=
@@ -471,7 +518,9 @@ theorem verticalIntegral_norm_le (hb : 0 < b.re) (c : ℝ) {T : ℝ} (hT : 0 ≤
     rw [← abs_neg y] at absy 
     simpa only [neg_mul, of_real_neg] using vert_norm_bound hT absy
 #align gaussian_fourier.vertical_integral_norm_le GaussianFourier.verticalIntegral_norm_le
+-/
 
+#print GaussianFourier.tendsto_verticalIntegral /-
 theorem tendsto_verticalIntegral (hb : 0 < b.re) (c : ℝ) :
     Tendsto (verticalIntegral b c) atTop (𝓝 0) :=
   by
@@ -489,8 +538,10 @@ theorem tendsto_verticalIntegral (hb : 0 < b.re) (c : ℝ) :
   refine' tendsto.at_top_mul_at_top (tendsto_at_top_add_const_right _ _ _) tendsto_id
   exact (tendsto_const_mul_at_top_of_pos hb).mpr tendsto_id
 #align gaussian_fourier.tendsto_vertical_integral GaussianFourier.tendsto_verticalIntegral
+-/
 
-theorem integrable_cexp_neg_mul_sq_add_real_mul_i (hb : 0 < b.re) (c : ℝ) :
+#print GaussianFourier.integrable_cexp_neg_mul_sq_add_real_mul_I /-
+theorem integrable_cexp_neg_mul_sq_add_real_mul_I (hb : 0 < b.re) (c : ℝ) :
     Integrable fun x : ℝ => cexp (-b * (x + c * I) ^ 2) :=
   by
   refine'
@@ -505,9 +556,11 @@ theorem integrable_cexp_neg_mul_sq_add_real_mul_i (hb : 0 < b.re) (c : ℝ) :
     exact (integrable.comp_sub_right this (b.im * c / b.re)).HasFiniteIntegral.const_mul _
   simp_rw [← neg_mul]
   apply integrable_exp_neg_mul_sq hb
-#align gaussian_fourier.integrable_cexp_neg_mul_sq_add_real_mul_I GaussianFourier.integrable_cexp_neg_mul_sq_add_real_mul_i
+#align gaussian_fourier.integrable_cexp_neg_mul_sq_add_real_mul_I GaussianFourier.integrable_cexp_neg_mul_sq_add_real_mul_I
+-/
 
-theorem integral_cexp_neg_mul_sq_add_real_mul_i (hb : 0 < b.re) (c : ℝ) :
+#print GaussianFourier.integral_cexp_neg_mul_sq_add_real_mul_I /-
+theorem integral_cexp_neg_mul_sq_add_real_mul_I (hb : 0 < b.re) (c : ℝ) :
     ∫ x : ℝ, cexp (-b * (x + c * I) ^ 2) = (π / b) ^ (1 / 2 : ℂ) :=
   by
   refine'
@@ -549,8 +602,10 @@ theorem integral_cexp_neg_mul_sq_add_real_mul_i (hb : 0 < b.re) (c : ℝ) :
   exact
     interval_integral_tendsto_integral (integrable_cexp_neg_mul_sq hb) tendsto_neg_at_top_at_bot
       tendsto_id
-#align gaussian_fourier.integral_cexp_neg_mul_sq_add_real_mul_I GaussianFourier.integral_cexp_neg_mul_sq_add_real_mul_i
+#align gaussian_fourier.integral_cexp_neg_mul_sq_add_real_mul_I GaussianFourier.integral_cexp_neg_mul_sq_add_real_mul_I
+-/
 
+#print integral_cexp_neg_mul_sq_add_const /-
 theorem integral_cexp_neg_mul_sq_add_const (hb : 0 < b.re) (c : ℂ) :
     ∫ x : ℝ, cexp (-b * (x + c) ^ 2) = (π / b) ^ (1 / 2 : ℂ) :=
   by
@@ -560,7 +615,9 @@ theorem integral_cexp_neg_mul_sq_add_const (hb : 0 < b.re) (c : ℂ) :
   · apply integral_cexp_neg_mul_sq_add_real_mul_I hb
   · infer_instance
 #align integral_cexp_neg_mul_sq_add_const integral_cexp_neg_mul_sq_add_const
+-/
 
+#print fourier_transform_gaussian /-
 theorem fourier_transform_gaussian (hb : 0 < b.re) (t : ℂ) :
     ∫ x : ℝ, cexp (I * t * x) * cexp (-b * x ^ 2) =
       cexp (-t ^ 2 / (4 * b)) * (π / b) ^ (1 / 2 : ℂ) :=
@@ -575,7 +632,9 @@ theorem fourier_transform_gaussian (hb : 0 < b.re) (t : ℂ) :
     field_simp; ring
   simp_rw [this, Complex.exp_add, integral_mul_left, integral_cexp_neg_mul_sq_add_const hb]
 #align fourier_transform_gaussian fourier_transform_gaussian
+-/
 
+#print fourier_transform_gaussian_pi /-
 theorem fourier_transform_gaussian_pi (hb : 0 < b.re) :
     (𝓕 fun x : ℝ => cexp (-π * b * x ^ 2)) = fun t : ℝ =>
       1 / b ^ (1 / 2 : ℂ) * cexp (-π / b * t ^ 2) :=
@@ -595,6 +654,7 @@ theorem fourier_transform_gaussian_pi (hb : 0 < b.re) :
       rw [Ne.def, arg_eq_pi_iff, not_and_or, not_lt]
       exact Or.inl hb.le
 #align fourier_transform_gaussian_pi fourier_transform_gaussian_pi
+-/
 
 end GaussianFourier
 
@@ -605,6 +665,7 @@ section GaussianPoisson
 
 variable {E : Type _} [NormedAddCommGroup E]
 
+#print tendsto_rpow_abs_mul_exp_neg_mul_sq_cocompact /-
 theorem tendsto_rpow_abs_mul_exp_neg_mul_sq_cocompact {a : ℝ} (ha : 0 < a) (s : ℝ) :
     Tendsto (fun x : ℝ => |x| ^ s * rexp (-a * x ^ 2)) (cocompact ℝ) (𝓝 0) :=
   by
@@ -616,7 +677,9 @@ theorem tendsto_rpow_abs_mul_exp_neg_mul_sq_cocompact {a : ℝ} (ha : 0 < a) (s
     (rpow_mul_exp_neg_mul_sq_isLittleO_exp_neg ha s).tendsto_zero_of_tendsto
       (tendsto_exp_at_bot.comp <| tendsto_id.neg_const_mul_at_top (neg_lt_zero.mpr one_half_pos))
 #align tendsto_rpow_abs_mul_exp_neg_mul_sq_cocompact tendsto_rpow_abs_mul_exp_neg_mul_sq_cocompact
+-/
 
+#print isLittleO_exp_neg_mul_sq_cocompact /-
 theorem isLittleO_exp_neg_mul_sq_cocompact {a : ℂ} (ha : 0 < a.re) (s : ℝ) :
     (fun x : ℝ => Complex.exp (-a * x ^ 2)) =o[cocompact ℝ] fun x : ℝ => |x| ^ s :=
   by
@@ -634,7 +697,9 @@ theorem isLittleO_exp_neg_mul_sq_cocompact {a : ℂ} (ha : 0 < a.re) (s : ℝ) :
     rw [norm_mul, norm_of_nonneg (rpow_nonneg_of_nonneg (abs_nonneg _) _), mul_comm,
       rpow_neg (abs_nonneg x), div_eq_mul_inv, norm_of_nonneg (exp_pos _).le]
 #align is_o_exp_neg_mul_sq_cocompact isLittleO_exp_neg_mul_sq_cocompact
+-/
 
+#print Complex.tsum_exp_neg_mul_int_sq /-
 theorem Complex.tsum_exp_neg_mul_int_sq {a : ℂ} (ha : 0 < a.re) :
     ∑' n : ℤ, cexp (-π * a * n ^ 2) = 1 / a ^ (1 / 2 : ℂ) * ∑' n : ℤ, cexp (-π / a * n ^ 2) :=
   by
@@ -667,13 +732,16 @@ theorem Complex.tsum_exp_neg_mul_int_sq {a : ℂ} (ha : 0 < a.re) :
       (complex.continuous_exp.comp (continuous_const.mul (continuous_of_real.pow 2)) : Continuous f)
       one_lt_two f_bd Ff_bd
 #align complex.tsum_exp_neg_mul_int_sq Complex.tsum_exp_neg_mul_int_sq
+-/
 
+#print Real.tsum_exp_neg_mul_int_sq /-
 theorem Real.tsum_exp_neg_mul_int_sq {a : ℝ} (ha : 0 < a) :
     ∑' n : ℤ, exp (-π * a * n ^ 2) = 1 / a ^ (1 / 2 : ℝ) * ∑' n : ℤ, exp (-π / a * n ^ 2) := by
   simpa only [← of_real_inj, of_real_mul, of_real_tsum, of_real_exp, of_real_div, of_real_pow,
     of_real_int_cast, of_real_neg, of_real_cpow ha.le, of_real_bit0, of_real_one] using
     Complex.tsum_exp_neg_mul_int_sq (by rwa [of_real_re] : 0 < (a : ℂ).re)
 #align real.tsum_exp_neg_mul_int_sq Real.tsum_exp_neg_mul_int_sq
+-/
 
 end GaussianPoisson
 
Diff
@@ -360,7 +360,7 @@ theorem integral_gaussian_Ioi (b : ℝ) : ∫ x in Ioi 0, exp (-b * x ^ 2) = sqr
 #align integral_gaussian_Ioi integral_gaussian_Ioi
 
 /-- The special-value formula `Γ(1/2) = √π`, which is equivalent to the Gaussian integral. -/
-theorem Real.gamma_one_half_eq : Real.gamma (1 / 2) = sqrt π :=
+theorem Real.gamma_one_half_eq : Real.Gamma (1 / 2) = sqrt π :=
   by
   rw [Gamma_eq_integral one_half_pos, ← integral_comp_rpow_Ioi_of_pos zero_lt_two]
   convert congr_arg (fun x : ℝ => 2 * x) (integral_gaussian_Ioi 1)
@@ -379,7 +379,7 @@ theorem Real.gamma_one_half_eq : Real.gamma (1 / 2) = sqrt π :=
 #align real.Gamma_one_half_eq Real.gamma_one_half_eq
 
 /-- The special-value formula `Γ(1/2) = √π`, which is equivalent to the Gaussian integral. -/
-theorem Complex.gamma_one_half_eq : Complex.gamma (1 / 2) = π ^ (1 / 2 : ℂ) :=
+theorem Complex.gamma_one_half_eq : Complex.Gamma (1 / 2) = π ^ (1 / 2 : ℂ) :=
   by
   convert congr_arg coe Real.gamma_one_half_eq
   · simpa only [one_div, of_real_inv, of_real_bit0] using Gamma_of_real (1 / 2)
Diff
@@ -49,10 +49,8 @@ open scoped Real Topology FourierTransform
 
 open Complex hiding exp continuous_exp abs_of_nonneg sq_abs
 
--- mathport name: exprcexp
 notation "cexp" => Complex.exp
 
--- mathport name: exprrexp
 notation "rexp" => Real.exp
 
 theorem exp_neg_mul_sq_isLittleO_exp_neg {b : ℝ} (hb : 0 < b) :
Diff
@@ -126,7 +126,7 @@ theorem integrableOn_Ioi_exp_neg_mul_sq_iff {b : ℝ} :
   by
   refine' ⟨fun h => _, fun h => (integrable_exp_neg_mul_sq h).IntegrableOn⟩
   by_contra' hb
-  have : (∫⁻ x : ℝ in Ioi 0, 1) ≤ ∫⁻ x : ℝ in Ioi 0, ‖exp (-b * x ^ 2)‖₊ :=
+  have : ∫⁻ x : ℝ in Ioi 0, 1 ≤ ∫⁻ x : ℝ in Ioi 0, ‖exp (-b * x ^ 2)‖₊ :=
     by
     apply lintegral_mono fun x => _
     simp only [neg_mul, ENNReal.one_le_coe_iff, ← to_nnreal_one, to_nnreal_le_iff_le_coe,
@@ -177,7 +177,7 @@ theorem integrable_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
 #align integrable_mul_cexp_neg_mul_sq integrable_mul_cexp_neg_mul_sq
 
 theorem integral_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
-    (∫ r : ℝ in Ioi 0, (r : ℂ) * cexp (-b * r ^ 2)) = (2 * b)⁻¹ :=
+    ∫ r : ℝ in Ioi 0, (r : ℂ) * cexp (-b * r ^ 2) = (2 * b)⁻¹ :=
   by
   have hb' : b ≠ 0 := by contrapose! hb; rw [hb, zero_re]
   have A :
@@ -235,7 +235,7 @@ theorem integral_gaussian_sq_complex {b : ℂ} (hb : 0 < b.re) :
       ring
 #align integral_gaussian_sq_complex integral_gaussian_sq_complex
 
-theorem integral_gaussian (b : ℝ) : (∫ x, exp (-b * x ^ 2)) = sqrt (π / b) :=
+theorem integral_gaussian (b : ℝ) : ∫ x, exp (-b * x ^ 2) = sqrt (π / b) :=
   by
   -- First we deal with the crazy case where `b ≤ 0`: then both sides vanish.
   rcases le_or_lt b 0 with (hb | hb)
@@ -278,7 +278,7 @@ theorem continuousAt_gaussian_integral (b : ℂ) (hb : 0 < re b) :
 #align continuous_at_gaussian_integral continuousAt_gaussian_integral
 
 theorem integral_gaussian_complex {b : ℂ} (hb : 0 < re b) :
-    (∫ x : ℝ, cexp (-b * x ^ 2)) = (π / b) ^ (1 / 2 : ℂ) :=
+    ∫ x : ℝ, cexp (-b * x ^ 2) = (π / b) ^ (1 / 2 : ℂ) :=
   by
   have nv : ∀ {b : ℂ}, 0 < re b → b ≠ 0 := by intro b hb; contrapose! hb; rw [hb]; simp
   refine'
@@ -320,16 +320,16 @@ theorem integral_gaussian_complex {b : ℂ} (hb : 0 < re b) :
 
 -- The Gaussian integral on the half-line, `∫ x in Ioi 0, exp (-b * x^2)`, for complex `b`.
 theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
-    (∫ x : ℝ in Ioi 0, cexp (-b * x ^ 2)) = (π / b) ^ (1 / 2 : ℂ) / 2 :=
+    ∫ x : ℝ in Ioi 0, cexp (-b * x ^ 2) = (π / b) ^ (1 / 2 : ℂ) / 2 :=
   by
   have full_integral := integral_gaussian_complex hb
   have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
   rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral 
-  suffices (∫ x : ℝ in Iic 0, cexp (-b * x ^ 2)) = ∫ x : ℝ in Ioi 0, cexp (-b * x ^ 2)
+  suffices ∫ x : ℝ in Iic 0, cexp (-b * x ^ 2) = ∫ x : ℝ in Ioi 0, cexp (-b * x ^ 2)
     by
     rw [this, ← mul_two] at full_integral 
     rwa [eq_div_iff]; exact two_ne_zero
-  have : ∀ c : ℝ, (∫ x in 0 ..c, cexp (-b * x ^ 2)) = ∫ x in -c..0, cexp (-b * x ^ 2) :=
+  have : ∀ c : ℝ, ∫ x in 0 ..c, cexp (-b * x ^ 2) = ∫ x in -c..0, cexp (-b * x ^ 2) :=
     by
     intro c
     have := @intervalIntegral.integral_comp_sub_left _ _ _ _ 0 c (fun x => cexp (-b * x ^ 2)) 0
@@ -347,7 +347,7 @@ theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
 #align integral_gaussian_complex_Ioi integral_gaussian_complex_Ioi
 
 -- The Gaussian integral on the half-line, `∫ x in Ioi 0, exp (-b * x^2)`, for real `b`.
-theorem integral_gaussian_Ioi (b : ℝ) : (∫ x in Ioi 0, exp (-b * x ^ 2)) = sqrt (π / b) / 2 :=
+theorem integral_gaussian_Ioi (b : ℝ) : ∫ x in Ioi 0, exp (-b * x ^ 2) = sqrt (π / b) / 2 :=
   by
   rcases le_or_lt b 0 with (hb | hb)
   · rw [integral_undef, sqrt_eq_zero_of_nonpos, zero_div]
@@ -510,7 +510,7 @@ theorem integrable_cexp_neg_mul_sq_add_real_mul_i (hb : 0 < b.re) (c : ℝ) :
 #align gaussian_fourier.integrable_cexp_neg_mul_sq_add_real_mul_I GaussianFourier.integrable_cexp_neg_mul_sq_add_real_mul_i
 
 theorem integral_cexp_neg_mul_sq_add_real_mul_i (hb : 0 < b.re) (c : ℝ) :
-    (∫ x : ℝ, cexp (-b * (x + c * I) ^ 2)) = (π / b) ^ (1 / 2 : ℂ) :=
+    ∫ x : ℝ, cexp (-b * (x + c * I) ^ 2) = (π / b) ^ (1 / 2 : ℂ) :=
   by
   refine'
     tendsto_nhds_unique
@@ -554,7 +554,7 @@ theorem integral_cexp_neg_mul_sq_add_real_mul_i (hb : 0 < b.re) (c : ℝ) :
 #align gaussian_fourier.integral_cexp_neg_mul_sq_add_real_mul_I GaussianFourier.integral_cexp_neg_mul_sq_add_real_mul_i
 
 theorem integral_cexp_neg_mul_sq_add_const (hb : 0 < b.re) (c : ℂ) :
-    (∫ x : ℝ, cexp (-b * (x + c) ^ 2)) = (π / b) ^ (1 / 2 : ℂ) :=
+    ∫ x : ℝ, cexp (-b * (x + c) ^ 2) = (π / b) ^ (1 / 2 : ℂ) :=
   by
   rw [← re_add_im c]
   simp_rw [← add_assoc, ← of_real_add]
@@ -564,7 +564,7 @@ theorem integral_cexp_neg_mul_sq_add_const (hb : 0 < b.re) (c : ℂ) :
 #align integral_cexp_neg_mul_sq_add_const integral_cexp_neg_mul_sq_add_const
 
 theorem fourier_transform_gaussian (hb : 0 < b.re) (t : ℂ) :
-    (∫ x : ℝ, cexp (I * t * x) * cexp (-b * x ^ 2)) =
+    ∫ x : ℝ, cexp (I * t * x) * cexp (-b * x ^ 2) =
       cexp (-t ^ 2 / (4 * b)) * (π / b) ^ (1 / 2 : ℂ) :=
   by
   have : b ≠ 0 := by contrapose! hb; rw [hb, zero_re]
@@ -638,7 +638,7 @@ theorem isLittleO_exp_neg_mul_sq_cocompact {a : ℂ} (ha : 0 < a.re) (s : ℝ) :
 #align is_o_exp_neg_mul_sq_cocompact isLittleO_exp_neg_mul_sq_cocompact
 
 theorem Complex.tsum_exp_neg_mul_int_sq {a : ℂ} (ha : 0 < a.re) :
-    (∑' n : ℤ, cexp (-π * a * n ^ 2)) = 1 / a ^ (1 / 2 : ℂ) * ∑' n : ℤ, cexp (-π / a * n ^ 2) :=
+    ∑' n : ℤ, cexp (-π * a * n ^ 2) = 1 / a ^ (1 / 2 : ℂ) * ∑' n : ℤ, cexp (-π / a * n ^ 2) :=
   by
   let f := fun x : ℝ => cexp (-π * a * x ^ 2)
   have h1 : 0 < (↑π * a).re := by
@@ -671,7 +671,7 @@ theorem Complex.tsum_exp_neg_mul_int_sq {a : ℂ} (ha : 0 < a.re) :
 #align complex.tsum_exp_neg_mul_int_sq Complex.tsum_exp_neg_mul_int_sq
 
 theorem Real.tsum_exp_neg_mul_int_sq {a : ℝ} (ha : 0 < a) :
-    (∑' n : ℤ, exp (-π * a * n ^ 2)) = 1 / a ^ (1 / 2 : ℝ) * ∑' n : ℤ, exp (-π / a * n ^ 2) := by
+    ∑' n : ℤ, exp (-π * a * n ^ 2) = 1 / a ^ (1 / 2 : ℝ) * ∑' n : ℤ, exp (-π / a * n ^ 2) := by
   simpa only [← of_real_inj, of_real_mul, of_real_tsum, of_real_exp, of_real_div, of_real_pow,
     of_real_int_cast, of_real_neg, of_real_cpow ha.le, of_real_bit0, of_real_one] using
     Complex.tsum_exp_neg_mul_int_sq (by rwa [of_real_re] : 0 < (a : ℂ).re)
Diff
@@ -195,7 +195,7 @@ theorem integral_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
       tendsto_exp_at_bot.comp
         (tendsto.neg_const_mul_at_top (neg_lt_zero.2 hb) (tendsto_pow_at_top two_ne_zero))
   convert
-    integral_Ioi_of_has_deriv_at_of_tendsto' (fun x hx => (A ↑x).comp_of_real)
+    integral_Ioi_of_has_deriv_at_of_tendsto' (fun x hx => (A ↑x).comp_ofReal)
       (integrable_mul_cexp_neg_mul_sq hb).IntegrableOn B
   simp only [MulZeroClass.mul_zero, of_real_zero, zero_pow', Ne.def, bit0_eq_zero, Nat.one_ne_zero,
     not_false_iff, Complex.exp_zero, mul_one, sub_neg_eq_add, zero_add]
Diff
@@ -233,7 +233,6 @@ theorem integral_gaussian_sq_complex {b : ℂ} (hb : 0 < b.re) :
         integral_mul_cexp_neg_mul_sq hb]
       field_simp [(by contrapose! hb; rw [hb, zero_re] : b ≠ 0)]
       ring
-    
 #align integral_gaussian_sq_complex integral_gaussian_sq_complex
 
 theorem integral_gaussian (b : ℝ) : (∫ x, exp (-b * x ^ 2)) = sqrt (π / b) :=
Diff
@@ -246,7 +246,7 @@ theorem integral_gaussian (b : ℝ) : (∫ x, exp (-b * x ^ 2)) = sqrt (π / b)
   -- Assume now `b > 0`. Then both sides are non-negative and their squares agree.
   refine' (sq_eq_sq _ (sqrt_nonneg _)).1 _
   · exact integral_nonneg fun x => (exp_pos _).le
-  rw [← of_real_inj, of_real_pow, ← integral_of_real, sq_sqrt (div_pos pi_pos hb).le, of_real_div]
+  rw [← of_real_inj, of_real_pow, ← integral_ofReal, sq_sqrt (div_pos pi_pos hb).le, of_real_div]
   convert integral_gaussian_sq_complex (by rwa [of_real_re] : 0 < (b : ℂ).re)
   ext1 x
   rw [of_real_exp, of_real_mul, of_real_pow, of_real_neg]
@@ -307,7 +307,7 @@ theorem integral_gaussian_complex {b : ℂ} (hb : 0 < re b) :
       by
       intro x
       simp only [of_real_exp, neg_mul, one_mul, of_real_neg, of_real_pow]
-    simp_rw [this, integral_of_real]
+    simp_rw [this, integral_ofReal]
     conv_rhs =>
       congr
       rw [← of_real_one, ← of_real_div]
@@ -354,7 +354,7 @@ theorem integral_gaussian_Ioi (b : ℝ) : (∫ x in Ioi 0, exp (-b * x ^ 2)) = s
   · rw [integral_undef, sqrt_eq_zero_of_nonpos, zero_div]
     exact div_nonpos_of_nonneg_of_nonpos pi_pos.le hb
     rwa [← integrable_on, integrableOn_Ioi_exp_neg_mul_sq_iff, not_lt]
-  rw [← of_real_inj, ← integral_of_real]
+  rw [← of_real_inj, ← integral_ofReal]
   convert integral_gaussian_complex_Ioi (by rwa [of_real_re] : 0 < (b : ℂ).re)
   · ext1 x; simp
   · rw [sqrt_eq_rpow, ← of_real_div, of_real_div, of_real_cpow]
Diff
@@ -110,7 +110,7 @@ theorem integrable_rpow_mul_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) {s : ℝ} (hs
       (measurable_id'.neg.pow measurable_const).mul
         ((measurable_id'.pow measurable_const).const_mul (-b)).exp
   · have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
-    filter_upwards [ae_restrict_mem this]with x hx
+    filter_upwards [ae_restrict_mem this] with x hx
     have h'x : 0 ≤ x := le_of_lt hx
     rw [Real.norm_eq_abs, abs_mul, abs_of_nonneg (exp_pos _).le]
     apply mul_le_mul_of_nonneg_right _ (exp_pos _).le
@@ -184,7 +184,7 @@ theorem integral_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
     ∀ x : ℂ, HasDerivAt (fun x => -(2 * b)⁻¹ * cexp (-b * x ^ 2)) (x * cexp (-b * x ^ 2)) x :=
     by
     intro x
-    convert((hasDerivAt_pow 2 x).const_mul (-b)).cexp.const_mul (-(2 * b)⁻¹) using 1
+    convert ((hasDerivAt_pow 2 x).const_mul (-b)).cexp.const_mul (-(2 * b)⁻¹) using 1
     field_simp [hb']
     ring
   have B : tendsto (fun y : ℝ => -(2 * b)⁻¹ * cexp (-b * ↑y ^ 2)) at_top (𝓝 (-(2 * b)⁻¹ * 0)) :=
@@ -194,7 +194,8 @@ theorem integral_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
     exact
       tendsto_exp_at_bot.comp
         (tendsto.neg_const_mul_at_top (neg_lt_zero.2 hb) (tendsto_pow_at_top two_ne_zero))
-  convert integral_Ioi_of_has_deriv_at_of_tendsto' (fun x hx => (A ↑x).comp_of_real)
+  convert
+    integral_Ioi_of_has_deriv_at_of_tendsto' (fun x hx => (A ↑x).comp_of_real)
       (integrable_mul_cexp_neg_mul_sq hb).IntegrableOn B
   simp only [MulZeroClass.mul_zero, of_real_zero, zero_pow', Ne.def, bit0_eq_zero, Nat.one_ne_zero,
     not_false_iff, Complex.exp_zero, mul_one, sub_neg_eq_add, zero_add]
@@ -652,7 +653,7 @@ theorem Complex.tsum_exp_neg_mul_int_sq {a : ℂ} (ha : 0 < a.re) :
     rw [ha, zero_re]
   have f_bd : f =O[cocompact ℝ] fun x => |x| ^ (-2 : ℝ) :=
     by
-    convert(isLittleO_exp_neg_mul_sq_cocompact h1 _).IsBigO
+    convert (isLittleO_exp_neg_mul_sq_cocompact h1 _).IsBigO
     ext1 x
     dsimp only [f]
     congr 1
@@ -660,7 +661,7 @@ theorem Complex.tsum_exp_neg_mul_int_sq {a : ℂ} (ha : 0 < a.re) :
   have Ff_bd : 𝓕 f =O[cocompact ℝ] fun x => |x| ^ (-2 : ℝ) :=
     by
     rw [fourier_transform_gaussian_pi ha]
-    convert(isLittleO_exp_neg_mul_sq_cocompact h2 _).IsBigO.const_mul_left _
+    convert (isLittleO_exp_neg_mul_sq_cocompact h2 _).IsBigO.const_mul_left _
     ext1 x
     congr 1
     ring_nf
Diff
@@ -169,7 +169,7 @@ theorem integrable_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
   refine' ⟨(continuous_of_real.mul (complex.continuous_exp.comp _)).AEStronglyMeasurable, _⟩
   · exact continuous_const.mul (continuous_of_real.pow 2)
   have := (integrable_mul_exp_neg_mul_sq hb).HasFiniteIntegral
-  rw [← has_finite_integral_norm_iff] at this⊢
+  rw [← has_finite_integral_norm_iff] at this ⊢
   convert this
   ext1 x
   rw [norm_mul, norm_mul, norm_cexp_neg_mul_sq b, Complex.norm_eq_abs, abs_of_real,
@@ -210,7 +210,7 @@ theorem integral_gaussian_sq_complex {b : ℂ} (hb : 0 < b.re) :
     (∫ x : ℝ, cexp (-b * (x : ℂ) ^ 2)) ^ 2 =
         ∫ p : ℝ × ℝ, cexp (-b * (p.1 : ℂ) ^ 2) * cexp (-b * (p.2 : ℂ) ^ 2) :=
       by rw [pow_two, ← integral_prod_mul]; rfl
-    _ = ∫ p : ℝ × ℝ, cexp (-b * (p.1 ^ 2 + p.2 ^ 2)) := by congr ; ext1 p;
+    _ = ∫ p : ℝ × ℝ, cexp (-b * (p.1 ^ 2 + p.2 ^ 2)) := by congr; ext1 p;
       rw [← Complex.exp_add, mul_add]
     _ = ∫ p in polar_coord.target, p.1 • cexp (-b * ((p.1 * cos p.2) ^ 2 + (p.1 * sin p.2) ^ 2)) :=
       by
@@ -324,10 +324,10 @@ theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
   by
   have full_integral := integral_gaussian_complex hb
   have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
-  rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral
+  rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral 
   suffices (∫ x : ℝ in Iic 0, cexp (-b * x ^ 2)) = ∫ x : ℝ in Ioi 0, cexp (-b * x ^ 2)
     by
-    rw [this, ← mul_two] at full_integral
+    rw [this, ← mul_two] at full_integral 
     rwa [eq_div_iff]; exact two_ne_zero
   have : ∀ c : ℝ, (∫ x in 0 ..c, cexp (-b * x ^ 2)) = ∫ x in -c..0, cexp (-b * x ^ 2) :=
     by
@@ -462,15 +462,15 @@ theorem verticalIntegral_norm_le (hb : 0 < b.re) (c : ℝ) {T : ℝ} (hT : 0 ≤
   · intro y hy
     have absy : |y| ≤ |c| := by
       rcases le_or_lt 0 c with ⟨⟩
-      · rw [uIoc_of_le h] at hy
+      · rw [uIoc_of_le h] at hy 
         rw [abs_of_nonneg h, abs_of_pos hy.1]
         exact hy.2
-      · rw [uIoc_of_lt h] at hy
+      · rw [uIoc_of_lt h] at hy 
         rw [abs_of_neg h, abs_of_nonpos hy.2, neg_le_neg_iff]
         exact hy.1.le
     rw [norm_mul, Complex.norm_eq_abs, abs_I, one_mul, two_mul]
     refine' (norm_sub_le _ _).trans (add_le_add (vert_norm_bound hT absy) _)
-    rw [← abs_neg y] at absy
+    rw [← abs_neg y] at absy 
     simpa only [neg_mul, of_real_neg] using vert_norm_bound hT absy
 #align gaussian_fourier.vertical_integral_norm_le GaussianFourier.verticalIntegral_norm_le
 
@@ -538,7 +538,7 @@ theorem integral_cexp_neg_mul_sq_add_real_mul_i (hb : 0 < b.re) (c : ℝ) :
     by
     ext1 T
     specialize C T
-    rw [sub_eq_zero] at C
+    rw [sub_eq_zero] at C 
     unfold vertical_integral
     rw [integral_const_mul, intervalIntegral.integral_sub]
     · simp_rw [(fun a b => by rw [sq]; ring_nf : ∀ a b : ℂ, (a - b * I) ^ 2 = (-a + b * I) ^ 2)]
@@ -592,7 +592,7 @@ theorem fourier_transform_gaussian_pi (hb : 0 < b.re) :
     all_goals push_cast ; ring
   · conv_lhs => rw [mul_comm]
     congr 2
-    · field_simp [of_real_ne_zero.mpr pi_ne_zero] ; ring
+    · field_simp [of_real_ne_zero.mpr pi_ne_zero]; ring
     · rw [← div_div, div_self (of_real_ne_zero.mpr pi_ne_zero), one_div, one_div b, inv_cpow]
       rw [Ne.def, arg_eq_pi_iff, not_and_or, not_lt]
       exact Or.inl hb.le
Diff
@@ -45,7 +45,7 @@ noncomputable section
 
 open Real Set MeasureTheory Filter Asymptotics
 
-open Real Topology FourierTransform
+open scoped Real Topology FourierTransform
 
 open Complex hiding exp continuous_exp abs_of_nonneg sq_abs
 
@@ -396,7 +396,7 @@ namespace GaussianFourier
 
 open intervalIntegral
 
-open Real
+open scoped Real
 
 variable {b : ℂ}
 
Diff
@@ -58,10 +58,7 @@ notation "rexp" => Real.exp
 theorem exp_neg_mul_sq_isLittleO_exp_neg {b : ℝ} (hb : 0 < b) :
     (fun x : ℝ => exp (-b * x ^ 2)) =o[atTop] fun x : ℝ => exp (-x) :=
   by
-  have A : (fun x : ℝ => -x - -b * x ^ 2) = fun x => x * (b * x + -1) :=
-    by
-    ext x
-    ring
+  have A : (fun x : ℝ => -x - -b * x ^ 2) = fun x => x * (b * x + -1) := by ext x; ring
   rw [is_o_exp_comp_exp_comp, A]
   apply tendsto.at_top_mul_at_top tendsto_id
   apply tendsto_at_top_add_const_right at_top (-1 : ℝ)
@@ -92,9 +89,7 @@ theorem integrableOn_rpow_mul_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) {s : ℝ} (h
     apply
       integrable_of_isBigO_exp_neg B _ (is_o.is_O (rpow_mul_exp_neg_mul_sq_isLittleO_exp_neg hb _))
     intro x hx
-    have N : x ≠ 0 := by
-      refine' (zero_lt_one.trans_le _).ne'
-      exact hx
+    have N : x ≠ 0 := by refine' (zero_lt_one.trans_le _).ne'; exact hx
     apply ((continuous_at_rpow_const _ _ (Or.inl N)).mul _).ContinuousWithinAt
     exact (continuous_exp.comp (continuous_const.mul (continuous_pow 2))).ContinuousAt
 #align integrable_on_rpow_mul_exp_neg_mul_sq integrableOn_rpow_mul_exp_neg_mul_sq
@@ -184,9 +179,7 @@ theorem integrable_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
 theorem integral_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
     (∫ r : ℝ in Ioi 0, (r : ℂ) * cexp (-b * r ^ 2)) = (2 * b)⁻¹ :=
   by
-  have hb' : b ≠ 0 := by
-    contrapose! hb
-    rw [hb, zero_re]
+  have hb' : b ≠ 0 := by contrapose! hb; rw [hb, zero_re]
   have A :
     ∀ x : ℂ, HasDerivAt (fun x => -(2 * b)⁻¹ * cexp (-b * x ^ 2)) (x * cexp (-b * x ^ 2)) x :=
     by
@@ -216,13 +209,8 @@ theorem integral_gaussian_sq_complex {b : ℂ} (hb : 0 < b.re) :
   calc
     (∫ x : ℝ, cexp (-b * (x : ℂ) ^ 2)) ^ 2 =
         ∫ p : ℝ × ℝ, cexp (-b * (p.1 : ℂ) ^ 2) * cexp (-b * (p.2 : ℂ) ^ 2) :=
-      by
-      rw [pow_two, ← integral_prod_mul]
-      rfl
-    _ = ∫ p : ℝ × ℝ, cexp (-b * (p.1 ^ 2 + p.2 ^ 2)) :=
-      by
-      congr
-      ext1 p
+      by rw [pow_two, ← integral_prod_mul]; rfl
+    _ = ∫ p : ℝ × ℝ, cexp (-b * (p.1 ^ 2 + p.2 ^ 2)) := by congr ; ext1 p;
       rw [← Complex.exp_add, mul_add]
     _ = ∫ p in polar_coord.target, p.1 • cexp (-b * ((p.1 * cos p.2) ^ 2 + (p.1 * sin p.2) ^ 2)) :=
       by
@@ -242,9 +230,7 @@ theorem integral_gaussian_sq_complex {b : ℂ} (hb : 0 < b.re) :
         sub_neg_eq_add, ENNReal.toReal_ofReal, this]
       rw [← two_mul, real_smul, mul_one, of_real_mul, of_real_bit0, of_real_one,
         integral_mul_cexp_neg_mul_sq hb]
-      field_simp [(by
-          contrapose! hb
-          rw [hb, zero_re] : b ≠ 0)]
+      field_simp [(by contrapose! hb; rw [hb, zero_re] : b ≠ 0)]
       ring
     
 #align integral_gaussian_sq_complex integral_gaussian_sq_complex
@@ -294,11 +280,7 @@ theorem continuousAt_gaussian_integral (b : ℂ) (hb : 0 < re b) :
 theorem integral_gaussian_complex {b : ℂ} (hb : 0 < re b) :
     (∫ x : ℝ, cexp (-b * x ^ 2)) = (π / b) ^ (1 / 2 : ℂ) :=
   by
-  have nv : ∀ {b : ℂ}, 0 < re b → b ≠ 0 := by
-    intro b hb
-    contrapose! hb
-    rw [hb]
-    simp
+  have nv : ∀ {b : ℂ}, 0 < re b → b ≠ 0 := by intro b hb; contrapose! hb; rw [hb]; simp
   refine'
     (convex_halfspace_re_gt 0).IsPreconnected.eq_of_sq_eq _ _ (fun c hc => _) (fun c hc => _)
       (by simp : 0 < re (1 : ℂ)) _ hb
@@ -333,8 +315,7 @@ theorem integral_gaussian_complex {b : ℂ} (hb : 0 < re b) :
     rw [← of_real_cpow, of_real_inj]
     convert integral_gaussian (1 : ℝ)
     · rwa [sqrt_eq_rpow]
-    · rw [div_one]
-      exact pi_pos.le
+    · rw [div_one]; exact pi_pos.le
 #align integral_gaussian_complex integral_gaussian_complex
 
 -- The Gaussian integral on the half-line, `∫ x in Ioi 0, exp (-b * x^2)`, for complex `b`.
@@ -347,8 +328,7 @@ theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
   suffices (∫ x : ℝ in Iic 0, cexp (-b * x ^ 2)) = ∫ x : ℝ in Ioi 0, cexp (-b * x ^ 2)
     by
     rw [this, ← mul_two] at full_integral
-    rwa [eq_div_iff]
-    exact two_ne_zero
+    rwa [eq_div_iff]; exact two_ne_zero
   have : ∀ c : ℝ, (∫ x in 0 ..c, cexp (-b * x ^ 2)) = ∫ x in -c..0, cexp (-b * x ^ 2) :=
     by
     intro c
@@ -375,8 +355,7 @@ theorem integral_gaussian_Ioi (b : ℝ) : (∫ x in Ioi 0, exp (-b * x ^ 2)) = s
     rwa [← integrable_on, integrableOn_Ioi_exp_neg_mul_sq_iff, not_lt]
   rw [← of_real_inj, ← integral_of_real]
   convert integral_gaussian_complex_Ioi (by rwa [of_real_re] : 0 < (b : ℂ).re)
-  · ext1 x
-    simp
+  · ext1 x; simp
   · rw [sqrt_eq_rpow, ← of_real_div, of_real_div, of_real_cpow]
     norm_num
     exact (div_pos pi_pos hb).le
@@ -397,8 +376,7 @@ theorem Real.gamma_one_half_eq : Real.gamma (1 / 2) = sqrt π :=
       rw [rpow_neg (le_of_lt hx), rpow_one]
     rw [smul_eq_mul, this]
     field_simp [(ne_of_lt hx).symm]
-    norm_num
-    ring
+    norm_num; ring
   · rw [div_one, ← mul_div_assoc, mul_comm, mul_div_cancel _ (two_ne_zero' ℝ)]
 #align real.Gamma_one_half_eq Real.gamma_one_half_eq
 
@@ -445,9 +423,7 @@ theorem norm_cexp_neg_mul_sq_add_mul_I' (hb : b.re ≠ 0) (c T : ℝ) :
   have :
     b.re * T ^ 2 - 2 * b.im * c * T - b.re * c ^ 2 =
       b.re * (T - b.im * c / b.re) ^ 2 - c ^ 2 * (b.im ^ 2 / b.re + b.re) :=
-    by
-    field_simp
-    ring
+    by field_simp; ring
   rw [norm_cexp_neg_mul_sq_add_mul_I, this]
 #align gaussian_fourier.norm_cexp_neg_mul_sq_add_mul_I' GaussianFourier.norm_cexp_neg_mul_sq_add_mul_I'
 
@@ -467,8 +443,7 @@ theorem verticalIntegral_norm_le (hb : 0 < b.re) (c : ℝ) {T : ℝ} (hT : 0 ≤
     intro T hT c y hy
     rw [norm_cexp_neg_mul_sq_add_mul_I b, exp_le_exp, neg_le_neg_iff]
     refine' sub_le_sub (sub_le_sub (le_refl _) (mul_le_mul_of_nonneg_right _ hT)) _
-    · conv_lhs => rw [mul_assoc]
-      conv_rhs => rw [mul_assoc]
+    · conv_lhs => rw [mul_assoc]; conv_rhs => rw [mul_assoc]
       refine' mul_le_mul_of_nonneg_left ((le_abs_self _).trans _) zero_le_two
       rw [abs_mul]
       exact mul_le_mul_of_nonneg_left hy (abs_nonneg _)
@@ -566,9 +541,7 @@ theorem integral_cexp_neg_mul_sq_add_real_mul_i (hb : 0 < b.re) (c : ℝ) :
     rw [sub_eq_zero] at C
     unfold vertical_integral
     rw [integral_const_mul, intervalIntegral.integral_sub]
-    · simp_rw [(fun a b => by
-          rw [sq]
-          ring_nf : ∀ a b : ℂ, (a - b * I) ^ 2 = (-a + b * I) ^ 2)]
+    · simp_rw [(fun a b => by rw [sq]; ring_nf : ∀ a b : ℂ, (a - b * I) ^ 2 = (-a + b * I) ^ 2)]
       change I₁ T = I₂ T + I * (I₄ T - I₅ T)
       rw [mul_sub, ← C]
       abel
@@ -594,17 +567,14 @@ theorem fourier_transform_gaussian (hb : 0 < b.re) (t : ℂ) :
     (∫ x : ℝ, cexp (I * t * x) * cexp (-b * x ^ 2)) =
       cexp (-t ^ 2 / (4 * b)) * (π / b) ^ (1 / 2 : ℂ) :=
   by
-  have : b ≠ 0 := by
-    contrapose! hb
-    rw [hb, zero_re]
+  have : b ≠ 0 := by contrapose! hb; rw [hb, zero_re]
   simp_rw [← Complex.exp_add]
   have : ∀ x : ℂ, I * t * x + -b * x ^ 2 = -t ^ 2 / (4 * b) + -b * (x + -I * t / 2 / b) ^ 2 :=
     by
     intro x
     ring_nf
     rw [I_sq]
-    field_simp
-    ring
+    field_simp; ring
   simp_rw [this, Complex.exp_add, integral_mul_left, integral_cexp_neg_mul_sq_add_const hb]
 #align fourier_transform_gaussian fourier_transform_gaussian
 
@@ -614,20 +584,15 @@ theorem fourier_transform_gaussian_pi (hb : 0 < b.re) :
   by
   ext1 t
   simp_rw [fourier_integral_eq_integral_exp_smul, smul_eq_mul]
-  have h1 : 0 < re (π * b) := by
-    rw [of_real_mul_re]
-    exact mul_pos pi_pos hb
-  have h2 : b ≠ 0 := by
-    contrapose! hb
-    rw [hb, zero_re]
+  have h1 : 0 < re (π * b) := by rw [of_real_mul_re]; exact mul_pos pi_pos hb
+  have h2 : b ≠ 0 := by contrapose! hb; rw [hb, zero_re]
   convert _root_.fourier_transform_gaussian h1 (-2 * π * t) using 1
   · congr 1 with x : 1
     congr 2
     all_goals push_cast ; ring
   · conv_lhs => rw [mul_comm]
     congr 2
-    · field_simp [of_real_ne_zero.mpr pi_ne_zero]
-      ring
+    · field_simp [of_real_ne_zero.mpr pi_ne_zero] ; ring
     · rw [← div_div, div_self (of_real_ne_zero.mpr pi_ne_zero), one_div, one_div b, inv_cpow]
       rw [Ne.def, arg_eq_pi_iff, not_and_or, not_lt]
       exact Or.inl hb.le
Diff
@@ -110,7 +110,7 @@ theorem integrable_rpow_mul_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) {s : ℝ} (hs
       (Homeomorph.neg ℝ).toMeasurableEquiv.MeasurableEmbedding]
   simp only [Function.comp, neg_sq, neg_preimage, preimage_neg_Iio, neg_neg, neg_zero]
   apply integrable.mono' (integrableOn_rpow_mul_exp_neg_mul_sq hb hs)
-  · apply Measurable.aeStronglyMeasurable
+  · apply Measurable.aestronglyMeasurable
     exact
       (measurable_id'.neg.pow measurable_const).mul
         ((measurable_id'.pow measurable_const).const_mul (-b)).exp
@@ -161,7 +161,7 @@ theorem integrable_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
   by
   refine'
     ⟨(complex.continuous_exp.comp
-          (continuous_const.mul (continuous_of_real.pow 2))).AeStronglyMeasurable,
+          (continuous_const.mul (continuous_of_real.pow 2))).AEStronglyMeasurable,
       _⟩
   rw [← has_finite_integral_norm_iff]
   simp_rw [norm_cexp_neg_mul_sq]
@@ -171,7 +171,7 @@ theorem integrable_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
 theorem integrable_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
     Integrable fun x : ℝ => ↑x * cexp (-b * x ^ 2) :=
   by
-  refine' ⟨(continuous_of_real.mul (complex.continuous_exp.comp _)).AeStronglyMeasurable, _⟩
+  refine' ⟨(continuous_of_real.mul (complex.continuous_exp.comp _)).AEStronglyMeasurable, _⟩
   · exact continuous_const.mul (continuous_of_real.pow 2)
   have := (integrable_mul_exp_neg_mul_sq hb).HasFiniteIntegral
   rw [← has_finite_integral_norm_iff] at this⊢
@@ -272,7 +272,7 @@ theorem continuousAt_gaussian_integral (b : ℂ) (hb : 0 < re b) :
   obtain ⟨d, hd, hd'⟩ := exists_between hb
   have f_meas : ∀ c : ℂ, ae_strongly_measurable (f c) volume := fun c =>
     by
-    apply Continuous.aeStronglyMeasurable
+    apply Continuous.aestronglyMeasurable
     exact complex.continuous_exp.comp (continuous_const.mul (continuous_of_real.pow 2))
   have f_int : integrable (f b) volume :=
     by
@@ -523,7 +523,7 @@ theorem integrable_cexp_neg_mul_sq_add_real_mul_i (hb : 0 < b.re) (c : ℝ) :
   refine'
     ⟨(complex.continuous_exp.comp
           (continuous_const.mul
-            ((continuous_of_real.add continuous_const).pow 2))).AeStronglyMeasurable,
+            ((continuous_of_real.add continuous_const).pow 2))).AEStronglyMeasurable,
       _⟩
   rw [← has_finite_integral_norm_iff]
   simp_rw [norm_cexp_neg_mul_sq_add_mul_I' hb.ne', neg_sub _ (c ^ 2 * _),
Diff
@@ -4,11 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
 
 ! This file was ported from Lean 3 source module analysis.special_functions.gaussian
-! leanprover-community/mathlib commit 2c1d8ca2812b64f88992a5294ea3dba144755cd1
+! leanprover-community/mathlib commit 7982767093ae38cba236487f9c9dd9cd99f63c16
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
-import Mathbin.Analysis.SpecialFunctions.Gamma
+import Mathbin.Analysis.SpecialFunctions.Gamma.Basic
 import Mathbin.Analysis.SpecialFunctions.PolarCoord
 import Mathbin.Analysis.Convex.Complex
 import Mathbin.Analysis.Complex.CauchyIntegral
Diff
@@ -78,7 +78,7 @@ theorem rpow_mul_exp_neg_mul_sq_isLittleO_exp_neg {b : ℝ} (hb : 0 < b) (s : 
   simp_rw [mul_comm]
 #align rpow_mul_exp_neg_mul_sq_is_o_exp_neg rpow_mul_exp_neg_mul_sq_isLittleO_exp_neg
 
-theorem integrableOnRpowMulExpNegMulSq {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : -1 < s) :
+theorem integrableOn_rpow_mul_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : -1 < s) :
     IntegrableOn (fun x : ℝ => x ^ s * exp (-b * x ^ 2)) (Ioi 0) :=
   by
   rw [← Ioc_union_Ioi_eq_Ioi (zero_le_one : (0 : ℝ) ≤ 1), integrable_on_union]
@@ -86,29 +86,30 @@ theorem integrableOnRpowMulExpNegMulSq {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : -1
   · rw [← integrableOn_Icc_iff_integrableOn_Ioc]
     refine' integrable_on.mul_continuous_on _ _ is_compact_Icc
     · refine' (intervalIntegrable_iff_integrable_Icc_of_le zero_le_one).mp _
-      exact intervalIntegral.intervalIntegrableRpow' hs
+      exact intervalIntegral.intervalIntegrable_rpow' hs
     · exact (continuous_exp.comp (continuous_const.mul (continuous_pow 2))).ContinuousOn
   · have B : (0 : ℝ) < 1 / 2 := by norm_num
-    apply integrableOfIsOExpNeg B _ (is_o.is_O (rpow_mul_exp_neg_mul_sq_isLittleO_exp_neg hb _))
+    apply
+      integrable_of_isBigO_exp_neg B _ (is_o.is_O (rpow_mul_exp_neg_mul_sq_isLittleO_exp_neg hb _))
     intro x hx
     have N : x ≠ 0 := by
       refine' (zero_lt_one.trans_le _).ne'
       exact hx
     apply ((continuous_at_rpow_const _ _ (Or.inl N)).mul _).ContinuousWithinAt
     exact (continuous_exp.comp (continuous_const.mul (continuous_pow 2))).ContinuousAt
-#align integrable_on_rpow_mul_exp_neg_mul_sq integrableOnRpowMulExpNegMulSq
+#align integrable_on_rpow_mul_exp_neg_mul_sq integrableOn_rpow_mul_exp_neg_mul_sq
 
-theorem integrableRpowMulExpNegMulSq {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : -1 < s) :
+theorem integrable_rpow_mul_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : -1 < s) :
     Integrable fun x : ℝ => x ^ s * exp (-b * x ^ 2) :=
   by
   rw [← integrable_on_univ, ← @Iio_union_Ici _ _ (0 : ℝ), integrable_on_union,
     integrableOn_Ici_iff_integrableOn_Ioi]
-  refine' ⟨_, integrableOnRpowMulExpNegMulSq hb hs⟩
+  refine' ⟨_, integrableOn_rpow_mul_exp_neg_mul_sq hb hs⟩
   rw [←
     (measure.measure_preserving_neg (volume : Measure ℝ)).integrableOn_comp_preimage
       (Homeomorph.neg ℝ).toMeasurableEquiv.MeasurableEmbedding]
   simp only [Function.comp, neg_sq, neg_preimage, preimage_neg_Iio, neg_neg, neg_zero]
-  apply integrable.mono' (integrableOnRpowMulExpNegMulSq hb hs)
+  apply integrable.mono' (integrableOn_rpow_mul_exp_neg_mul_sq hb hs)
   · apply Measurable.aeStronglyMeasurable
     exact
       (measurable_id'.neg.pow measurable_const).mul
@@ -119,16 +120,16 @@ theorem integrableRpowMulExpNegMulSq {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : -1 <
     rw [Real.norm_eq_abs, abs_mul, abs_of_nonneg (exp_pos _).le]
     apply mul_le_mul_of_nonneg_right _ (exp_pos _).le
     simpa [abs_of_nonneg h'x] using abs_rpow_le_abs_rpow (-x) s
-#align integrable_rpow_mul_exp_neg_mul_sq integrableRpowMulExpNegMulSq
+#align integrable_rpow_mul_exp_neg_mul_sq integrable_rpow_mul_exp_neg_mul_sq
 
-theorem integrableExpNegMulSq {b : ℝ} (hb : 0 < b) : Integrable fun x : ℝ => exp (-b * x ^ 2) := by
-  simpa using integrableRpowMulExpNegMulSq hb (by norm_num : (-1 : ℝ) < 0)
-#align integrable_exp_neg_mul_sq integrableExpNegMulSq
+theorem integrable_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) : Integrable fun x : ℝ => exp (-b * x ^ 2) :=
+  by simpa using integrable_rpow_mul_exp_neg_mul_sq hb (by norm_num : (-1 : ℝ) < 0)
+#align integrable_exp_neg_mul_sq integrable_exp_neg_mul_sq
 
 theorem integrableOn_Ioi_exp_neg_mul_sq_iff {b : ℝ} :
     IntegrableOn (fun x : ℝ => exp (-b * x ^ 2)) (Ioi 0) ↔ 0 < b :=
   by
-  refine' ⟨fun h => _, fun h => (integrableExpNegMulSq h).IntegrableOn⟩
+  refine' ⟨fun h => _, fun h => (integrable_exp_neg_mul_sq h).IntegrableOn⟩
   by_contra' hb
   have : (∫⁻ x : ℝ in Ioi 0, 1) ≤ ∫⁻ x : ℝ in Ioi 0, ‖exp (-b * x ^ 2)‖₊ :=
     by
@@ -141,13 +142,13 @@ theorem integrableOn_Ioi_exp_neg_mul_sq_iff {b : ℝ} :
 
 theorem integrable_exp_neg_mul_sq_iff {b : ℝ} :
     (Integrable fun x : ℝ => exp (-b * x ^ 2)) ↔ 0 < b :=
-  ⟨fun h => integrableOn_Ioi_exp_neg_mul_sq_iff.mp h.IntegrableOn, integrableExpNegMulSq⟩
+  ⟨fun h => integrableOn_Ioi_exp_neg_mul_sq_iff.mp h.IntegrableOn, integrable_exp_neg_mul_sq⟩
 #align integrable_exp_neg_mul_sq_iff integrable_exp_neg_mul_sq_iff
 
-theorem integrableMulExpNegMulSq {b : ℝ} (hb : 0 < b) :
+theorem integrable_mul_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) :
     Integrable fun x : ℝ => x * exp (-b * x ^ 2) := by
-  simpa using integrableRpowMulExpNegMulSq hb (by norm_num : (-1 : ℝ) < 1)
-#align integrable_mul_exp_neg_mul_sq integrableMulExpNegMulSq
+  simpa using integrable_rpow_mul_exp_neg_mul_sq hb (by norm_num : (-1 : ℝ) < 1)
+#align integrable_mul_exp_neg_mul_sq integrable_mul_exp_neg_mul_sq
 
 theorem norm_cexp_neg_mul_sq (b : ℂ) (x : ℝ) : ‖Complex.exp (-b * x ^ 2)‖ = exp (-b.re * x ^ 2) :=
   by
@@ -155,7 +156,7 @@ theorem norm_cexp_neg_mul_sq (b : ℂ) (x : ℝ) : ‖Complex.exp (-b * x ^ 2)
     mul_comm]
 #align norm_cexp_neg_mul_sq norm_cexp_neg_mul_sq
 
-theorem integrableCexpNegMulSq {b : ℂ} (hb : 0 < b.re) :
+theorem integrable_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
     Integrable fun x : ℝ => cexp (-b * x ^ 2) :=
   by
   refine'
@@ -164,21 +165,21 @@ theorem integrableCexpNegMulSq {b : ℂ} (hb : 0 < b.re) :
       _⟩
   rw [← has_finite_integral_norm_iff]
   simp_rw [norm_cexp_neg_mul_sq]
-  exact (integrableExpNegMulSq hb).2
-#align integrable_cexp_neg_mul_sq integrableCexpNegMulSq
+  exact (integrable_exp_neg_mul_sq hb).2
+#align integrable_cexp_neg_mul_sq integrable_cexp_neg_mul_sq
 
-theorem integrableMulCexpNegMulSq {b : ℂ} (hb : 0 < b.re) :
+theorem integrable_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
     Integrable fun x : ℝ => ↑x * cexp (-b * x ^ 2) :=
   by
   refine' ⟨(continuous_of_real.mul (complex.continuous_exp.comp _)).AeStronglyMeasurable, _⟩
   · exact continuous_const.mul (continuous_of_real.pow 2)
-  have := (integrableMulExpNegMulSq hb).HasFiniteIntegral
+  have := (integrable_mul_exp_neg_mul_sq hb).HasFiniteIntegral
   rw [← has_finite_integral_norm_iff] at this⊢
   convert this
   ext1 x
   rw [norm_mul, norm_mul, norm_cexp_neg_mul_sq b, Complex.norm_eq_abs, abs_of_real,
     Real.norm_eq_abs, norm_of_nonneg (exp_pos _).le]
-#align integrable_mul_cexp_neg_mul_sq integrableMulCexpNegMulSq
+#align integrable_mul_cexp_neg_mul_sq integrable_mul_cexp_neg_mul_sq
 
 theorem integral_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
     (∫ r : ℝ in Ioi 0, (r : ℂ) * cexp (-b * r ^ 2)) = (2 * b)⁻¹ :=
@@ -201,7 +202,7 @@ theorem integral_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
       tendsto_exp_at_bot.comp
         (tendsto.neg_const_mul_at_top (neg_lt_zero.2 hb) (tendsto_pow_at_top two_ne_zero))
   convert integral_Ioi_of_has_deriv_at_of_tendsto' (fun x hx => (A ↑x).comp_of_real)
-      (integrableMulCexpNegMulSq hb).IntegrableOn B
+      (integrable_mul_cexp_neg_mul_sq hb).IntegrableOn B
   simp only [MulZeroClass.mul_zero, of_real_zero, zero_pow', Ne.def, bit0_eq_zero, Nat.one_ne_zero,
     not_false_iff, Complex.exp_zero, mul_one, sub_neg_eq_add, zero_add]
 #align integral_mul_cexp_neg_mul_sq integral_mul_cexp_neg_mul_sq
@@ -276,7 +277,7 @@ theorem continuousAt_gaussian_integral (b : ℂ) (hb : 0 < re b) :
   have f_int : integrable (f b) volume :=
     by
     simp_rw [← integrable_norm_iff (f_meas b), norm_cexp_neg_mul_sq b]
-    exact integrableExpNegMulSq hb
+    exact integrable_exp_neg_mul_sq hb
   have f_cts : ∀ x : ℝ, ContinuousAt (fun c => f c x) b := fun x =>
     (complex.continuous_exp.comp (continuous_id'.neg.mul continuous_const)).ContinuousAt
   have f_le_bd : ∀ᶠ c : ℂ in 𝓝 b, ∀ᵐ x : ℝ, ‖f c x‖ ≤ exp (-d * x ^ 2) :=
@@ -286,7 +287,7 @@ theorem continuousAt_gaussian_integral (b : ℂ) (hb : 0 < re b) :
     rw [norm_cexp_neg_mul_sq, exp_le_exp]
     exact mul_le_mul_of_nonneg_right (neg_le_neg (le_of_lt hc)) (sq_nonneg _)
   exact
-    continuous_at_of_dominated (eventually_of_forall f_meas) f_le_bd (integrableExpNegMulSq hd)
+    continuous_at_of_dominated (eventually_of_forall f_meas) f_le_bd (integrable_exp_neg_mul_sq hd)
       (ae_of_all _ f_cts)
 #align continuous_at_gaussian_integral continuousAt_gaussian_integral
 
@@ -342,7 +343,7 @@ theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
   by
   have full_integral := integral_gaussian_complex hb
   have : MeasurableSet (Ioi (0 : ℝ)) := measurableSet_Ioi
-  rw [← integral_add_compl this (integrableCexpNegMulSq hb), compl_Ioi] at full_integral
+  rw [← integral_add_compl this (integrable_cexp_neg_mul_sq hb), compl_Ioi] at full_integral
   suffices (∫ x : ℝ in Iic 0, cexp (-b * x ^ 2)) = ∫ x : ℝ in Ioi 0, cexp (-b * x ^ 2)
     by
     rw [this, ← mul_two] at full_integral
@@ -354,14 +355,14 @@ theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
     have := @intervalIntegral.integral_comp_sub_left _ _ _ _ 0 c (fun x => cexp (-b * x ^ 2)) 0
     simpa [zero_sub, neg_sq, neg_zero] using this
   have t1 :=
-    interval_integral_tendsto_integral_Ioi _ (integrableCexpNegMulSq hb).IntegrableOn tendsto_id
+    interval_integral_tendsto_integral_Ioi _ (integrable_cexp_neg_mul_sq hb).IntegrableOn tendsto_id
   have t2 :
     tendsto (fun c : ℝ => ∫ x : ℝ in 0 ..c, cexp (-b * x ^ 2)) at_top
       (𝓝 (∫ x : ℝ in Iic 0, cexp (-b * x ^ 2))) :=
     by
     simp_rw [this]
     refine' interval_integral_tendsto_integral_Iic _ _ tendsto_neg_at_top_at_bot
-    apply (integrableCexpNegMulSq hb).IntegrableOn
+    apply (integrable_cexp_neg_mul_sq hb).IntegrableOn
   exact tendsto_nhds_unique t2 t1
 #align integral_gaussian_complex_Ioi integral_gaussian_complex_Ioi
 
@@ -516,7 +517,7 @@ theorem tendsto_verticalIntegral (hb : 0 < b.re) (c : ℝ) :
   exact (tendsto_const_mul_at_top_of_pos hb).mpr tendsto_id
 #align gaussian_fourier.tendsto_vertical_integral GaussianFourier.tendsto_verticalIntegral
 
-theorem integrableCexpNegMulSqAddRealMulI (hb : 0 < b.re) (c : ℝ) :
+theorem integrable_cexp_neg_mul_sq_add_real_mul_i (hb : 0 < b.re) (c : ℝ) :
     Integrable fun x : ℝ => cexp (-b * (x + c * I) ^ 2) :=
   by
   refine'
@@ -530,8 +531,8 @@ theorem integrableCexpNegMulSqAddRealMulI (hb : 0 < b.re) (c : ℝ) :
   suffices integrable fun x : ℝ => exp (-(b.re * x ^ 2)) by
     exact (integrable.comp_sub_right this (b.im * c / b.re)).HasFiniteIntegral.const_mul _
   simp_rw [← neg_mul]
-  apply integrableExpNegMulSq hb
-#align gaussian_fourier.integrable_cexp_neg_mul_sq_add_real_mul_I GaussianFourier.integrableCexpNegMulSqAddRealMulI
+  apply integrable_exp_neg_mul_sq hb
+#align gaussian_fourier.integrable_cexp_neg_mul_sq_add_real_mul_I GaussianFourier.integrable_cexp_neg_mul_sq_add_real_mul_i
 
 theorem integral_cexp_neg_mul_sq_add_real_mul_i (hb : 0 < b.re) (c : ℝ) :
     (∫ x : ℝ, cexp (-b * (x + c * I) ^ 2)) = (π / b) ^ (1 / 2 : ℂ) :=
@@ -575,7 +576,7 @@ theorem integral_cexp_neg_mul_sq_add_real_mul_i (hb : 0 < b.re) (c : ℝ) :
   rw [this, ← add_zero ((π / b : ℂ) ^ (1 / 2 : ℂ)), ← integral_gaussian_complex hb]
   refine' tendsto.add _ (tendsto_vertical_integral hb c)
   exact
-    interval_integral_tendsto_integral (integrableCexpNegMulSq hb) tendsto_neg_at_top_at_bot
+    interval_integral_tendsto_integral (integrable_cexp_neg_mul_sq hb) tendsto_neg_at_top_at_bot
       tendsto_id
 #align gaussian_fourier.integral_cexp_neg_mul_sq_add_real_mul_I GaussianFourier.integral_cexp_neg_mul_sq_add_real_mul_i
 
Diff
@@ -4,16 +4,14 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
 
 ! This file was ported from Lean 3 source module analysis.special_functions.gaussian
-! leanprover-community/mathlib commit d4817f8867c368d6c5571f7379b3888aaec1d95a
+! leanprover-community/mathlib commit 2c1d8ca2812b64f88992a5294ea3dba144755cd1
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.SpecialFunctions.Gamma
 import Mathbin.Analysis.SpecialFunctions.PolarCoord
 import Mathbin.Analysis.Convex.Complex
-import Mathbin.Analysis.Normed.Group.Basic
 import Mathbin.Analysis.Complex.CauchyIntegral
-import Mathbin.MeasureTheory.Group.Integration
 import Mathbin.Analysis.Fourier.PoissonSummation
 
 /-!
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
 
 ! This file was ported from Lean 3 source module analysis.special_functions.gaussian
-! leanprover-community/mathlib commit 34d3797325d202bd7250431275bb871133cdb611
+! leanprover-community/mathlib commit d4817f8867c368d6c5571f7379b3888aaec1d95a
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -188,11 +188,6 @@ theorem integral_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
   have hb' : b ≠ 0 := by
     contrapose! hb
     rw [hb, zero_re]
-  refine'
-    tendsto_nhds_unique
-      (interval_integral_tendsto_integral_Ioi _ (integrableMulCexpNegMulSq hb).IntegrableOn
-        Filter.tendsto_id)
-      _
   have A :
     ∀ x : ℂ, HasDerivAt (fun x => -(2 * b)⁻¹ * cexp (-b * x ^ 2)) (x * cexp (-b * x ^ 2)) x :=
     by
@@ -200,24 +195,17 @@ theorem integral_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
     convert((hasDerivAt_pow 2 x).const_mul (-b)).cexp.const_mul (-(2 * b)⁻¹) using 1
     field_simp [hb']
     ring
-  have :
-    ∀ y : ℝ,
-      (∫ x in 0 ..id y, ↑x * cexp (-b * x ^ 2)) =
-        -(2 * b)⁻¹ * cexp (-b * y ^ 2) - -(2 * b)⁻¹ * cexp (-b * 0 ^ 2) :=
-    fun y =>
-    intervalIntegral.integral_eq_sub_of_hasDerivAt (fun x hx => (A x).comp_of_real)
-      (integrableMulCexpNegMulSq hb).IntervalIntegrable
-  simp_rw [this]
-  have L :
-    tendsto (fun x : ℝ => (2 * b)⁻¹ - (2 * b)⁻¹ * cexp (-b * x ^ 2)) at_top
-      (𝓝 ((2 * b)⁻¹ - (2 * b)⁻¹ * 0)) :=
+  have B : tendsto (fun y : ℝ => -(2 * b)⁻¹ * cexp (-b * ↑y ^ 2)) at_top (𝓝 (-(2 * b)⁻¹ * 0)) :=
     by
-    refine' tendsto_const_nhds.sub (tendsto.const_mul _ <| tendsto_zero_iff_norm_tendsto_zero.mpr _)
+    refine' tendsto.const_mul _ (tendsto_zero_iff_norm_tendsto_zero.mpr _)
     simp_rw [norm_cexp_neg_mul_sq b]
     exact
       tendsto_exp_at_bot.comp
         (tendsto.neg_const_mul_at_top (neg_lt_zero.2 hb) (tendsto_pow_at_top two_ne_zero))
-  simpa using L
+  convert integral_Ioi_of_has_deriv_at_of_tendsto' (fun x hx => (A ↑x).comp_of_real)
+      (integrableMulCexpNegMulSq hb).IntegrableOn B
+  simp only [MulZeroClass.mul_zero, of_real_zero, zero_pow', Ne.def, bit0_eq_zero, Nat.one_ne_zero,
+    not_false_iff, Complex.exp_zero, mul_one, sub_neg_eq_add, zero_add]
 #align integral_mul_cexp_neg_mul_sq integral_mul_cexp_neg_mul_sq
 
 /-- The *square* of the Gaussian integral `∫ x:ℝ, exp (-b * x^2)` is equal to `π / b`. -/
Diff
@@ -57,7 +57,7 @@ notation "cexp" => Complex.exp
 -- mathport name: exprrexp
 notation "rexp" => Real.exp
 
-theorem exp_neg_mul_sq_isOCat_exp_neg {b : ℝ} (hb : 0 < b) :
+theorem exp_neg_mul_sq_isLittleO_exp_neg {b : ℝ} (hb : 0 < b) :
     (fun x : ℝ => exp (-b * x ^ 2)) =o[atTop] fun x : ℝ => exp (-x) :=
   by
   have A : (fun x : ℝ => -x - -b * x ^ 2) = fun x => x * (b * x + -1) :=
@@ -68,16 +68,17 @@ theorem exp_neg_mul_sq_isOCat_exp_neg {b : ℝ} (hb : 0 < b) :
   apply tendsto.at_top_mul_at_top tendsto_id
   apply tendsto_at_top_add_const_right at_top (-1 : ℝ)
   exact tendsto.const_mul_at_top hb tendsto_id
-#align exp_neg_mul_sq_is_o_exp_neg exp_neg_mul_sq_isOCat_exp_neg
+#align exp_neg_mul_sq_is_o_exp_neg exp_neg_mul_sq_isLittleO_exp_neg
 
-theorem rpow_mul_exp_neg_mul_sq_isOCat_exp_neg {b : ℝ} (hb : 0 < b) (s : ℝ) :
+theorem rpow_mul_exp_neg_mul_sq_isLittleO_exp_neg {b : ℝ} (hb : 0 < b) (s : ℝ) :
     (fun x : ℝ => x ^ s * exp (-b * x ^ 2)) =o[atTop] fun x : ℝ => exp (-(1 / 2) * x) :=
   by
   apply
-    ((is_O_refl (fun x : ℝ => x ^ s) at_top).mul_isOCat (exp_neg_mul_sq_isOCat_exp_neg hb)).trans
+    ((is_O_refl (fun x : ℝ => x ^ s) at_top).mul_isLittleO
+        (exp_neg_mul_sq_isLittleO_exp_neg hb)).trans
   convert Gamma_integrand_is_o s
   simp_rw [mul_comm]
-#align rpow_mul_exp_neg_mul_sq_is_o_exp_neg rpow_mul_exp_neg_mul_sq_isOCat_exp_neg
+#align rpow_mul_exp_neg_mul_sq_is_o_exp_neg rpow_mul_exp_neg_mul_sq_isLittleO_exp_neg
 
 theorem integrableOnRpowMulExpNegMulSq {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : -1 < s) :
     IntegrableOn (fun x : ℝ => x ^ s * exp (-b * x ^ 2)) (Ioi 0) :=
@@ -90,7 +91,7 @@ theorem integrableOnRpowMulExpNegMulSq {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : -1
       exact intervalIntegral.intervalIntegrableRpow' hs
     · exact (continuous_exp.comp (continuous_const.mul (continuous_pow 2))).ContinuousOn
   · have B : (0 : ℝ) < 1 / 2 := by norm_num
-    apply integrableOfIsOExpNeg B _ (is_o.is_O (rpow_mul_exp_neg_mul_sq_isOCat_exp_neg hb _))
+    apply integrableOfIsOExpNeg B _ (is_o.is_O (rpow_mul_exp_neg_mul_sq_isLittleO_exp_neg hb _))
     intro x hx
     have N : x ≠ 0 := by
       refine' (zero_lt_one.trans_le _).ne'
@@ -662,11 +663,11 @@ theorem tendsto_rpow_abs_mul_exp_neg_mul_sq_cocompact {a : ℝ} (ha : 0 < a) (s
     @tendsto_comap'_iff _ _ _ (fun y => y ^ s * rexp (-a * y ^ 2)) _ _ _
       (mem_at_top_sets.mpr ⟨0, fun b hb => ⟨b, abs_of_nonneg hb⟩⟩)]
   exact
-    (rpow_mul_exp_neg_mul_sq_isOCat_exp_neg ha s).tendsto_zero_of_tendsto
+    (rpow_mul_exp_neg_mul_sq_isLittleO_exp_neg ha s).tendsto_zero_of_tendsto
       (tendsto_exp_at_bot.comp <| tendsto_id.neg_const_mul_at_top (neg_lt_zero.mpr one_half_pos))
 #align tendsto_rpow_abs_mul_exp_neg_mul_sq_cocompact tendsto_rpow_abs_mul_exp_neg_mul_sq_cocompact
 
-theorem isOCat_exp_neg_mul_sq_cocompact {a : ℂ} (ha : 0 < a.re) (s : ℝ) :
+theorem isLittleO_exp_neg_mul_sq_cocompact {a : ℂ} (ha : 0 < a.re) (s : ℝ) :
     (fun x : ℝ => Complex.exp (-a * x ^ 2)) =o[cocompact ℝ] fun x : ℝ => |x| ^ s :=
   by
   rw [← is_o_norm_left]
@@ -682,7 +683,7 @@ theorem isOCat_exp_neg_mul_sq_cocompact {a : ℂ} (ha : 0 < a.re) (s : ℝ) :
     refine' (eventually_cofinite_ne 0).mp (eventually_of_forall fun x hx => _)
     rw [norm_mul, norm_of_nonneg (rpow_nonneg_of_nonneg (abs_nonneg _) _), mul_comm,
       rpow_neg (abs_nonneg x), div_eq_mul_inv, norm_of_nonneg (exp_pos _).le]
-#align is_o_exp_neg_mul_sq_cocompact isOCat_exp_neg_mul_sq_cocompact
+#align is_o_exp_neg_mul_sq_cocompact isLittleO_exp_neg_mul_sq_cocompact
 
 theorem Complex.tsum_exp_neg_mul_int_sq {a : ℂ} (ha : 0 < a.re) :
     (∑' n : ℤ, cexp (-π * a * n ^ 2)) = 1 / a ^ (1 / 2 : ℂ) * ∑' n : ℤ, cexp (-π / a * n ^ 2) :=
@@ -699,7 +700,7 @@ theorem Complex.tsum_exp_neg_mul_int_sq {a : ℂ} (ha : 0 < a.re) :
     rw [ha, zero_re]
   have f_bd : f =O[cocompact ℝ] fun x => |x| ^ (-2 : ℝ) :=
     by
-    convert(isOCat_exp_neg_mul_sq_cocompact h1 _).IsO
+    convert(isLittleO_exp_neg_mul_sq_cocompact h1 _).IsBigO
     ext1 x
     dsimp only [f]
     congr 1
@@ -707,7 +708,7 @@ theorem Complex.tsum_exp_neg_mul_int_sq {a : ℂ} (ha : 0 < a.re) :
   have Ff_bd : 𝓕 f =O[cocompact ℝ] fun x => |x| ^ (-2 : ℝ) :=
     by
     rw [fourier_transform_gaussian_pi ha]
-    convert(isOCat_exp_neg_mul_sq_cocompact h2 _).IsO.const_mul_left _
+    convert(isLittleO_exp_neg_mul_sq_cocompact h2 _).IsBigO.const_mul_left _
     ext1 x
     congr 1
     ring_nf
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
 
 ! This file was ported from Lean 3 source module analysis.special_functions.gaussian
-! leanprover-community/mathlib commit d90e4e186f1d18e375dcd4e5b5f6364b01cb3e46
+! leanprover-community/mathlib commit 34d3797325d202bd7250431275bb871133cdb611
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,7 @@ import Mathbin.Analysis.Convex.Complex
 import Mathbin.Analysis.Normed.Group.Basic
 import Mathbin.Analysis.Complex.CauchyIntegral
 import Mathbin.MeasureTheory.Group.Integration
+import Mathbin.Analysis.Fourier.PoissonSummation
 
 /-!
 # Gaussian integral
@@ -25,16 +26,20 @@ We prove various versions of the formula for the Gaussian integral:
 * `integral_gaussian_Ioi` and `integral_gaussian_complex_Ioi`: variants for integrals over `Ioi 0`.
 * `complex.Gamma_one_half_eq`: the formula `Γ (1 / 2) = √π`.
 
-We also prove, more generally, that the Fourier transform of the Gaussian
-is another Gaussian:
+We also prove, more generally, that the Fourier transform of the Gaussian is another Gaussian:
 
 * `integral_cexp_neg_mul_sq_add_const`: for all complex `b` and `c` with `0 < re b` we have
   `∫ (x : ℝ), exp (-b * (x + c) ^ 2) = (π / b) ^ (1 / 2)`.
 * `fourier_transform_gaussian`: for all complex `b` and `t` with `0 < re b`, we have
   `∫ x:ℝ, exp (I * t * x) * exp (-b * x^2) = (π / b) ^ (1 / 2) * exp (-t ^ 2 / (4 * b))`.
 * `fourier_transform_gaussian_pi`: a variant with `b` and `t` scaled to give a more symmetric
-  statement, `∫ x:ℝ, exp (2 * π * I * t * x) * exp (-π * b * x^2) =
-  (1 / b) ^ (1 / 2) * exp (-π * (1 / b) * t ^ 2)`.
+  statement, and formulated in terms of the Fourier transform operator `𝓕`.
+
+As an application, in `real.tsum_exp_neg_mul_int_sq` and `complex.tsum_exp_neg_mul_int_sq`, we use
+Poisson summation to prove the identity
+`∑' (n : ℤ), exp (-π * a * n ^ 2) = 1 / a ^ (1 / 2) * ∑' (n : ℤ), exp (-π / a * n ^ 2)`
+for positive real `a`, or complex `a` with positive real part. (See also
+`number_theory.modular_forms.jacobi_theta`.)
 -/
 
 
@@ -42,13 +47,16 @@ noncomputable section
 
 open Real Set MeasureTheory Filter Asymptotics
 
-open Real Topology
+open Real Topology FourierTransform
 
-open Complex hiding exp continuous_exp abs_of_nonneg
+open Complex hiding exp continuous_exp abs_of_nonneg sq_abs
 
 -- mathport name: exprcexp
 notation "cexp" => Complex.exp
 
+-- mathport name: exprrexp
+notation "rexp" => Real.exp
+
 theorem exp_neg_mul_sq_isOCat_exp_neg {b : ℝ} (hb : 0 < b) :
     (fun x : ℝ => exp (-b * x ^ 2)) =o[atTop] fun x : ℝ => exp (-x) :=
   by
@@ -612,32 +620,109 @@ theorem fourier_transform_gaussian (hb : 0 < b.re) (t : ℂ) :
   simp_rw [this, Complex.exp_add, integral_mul_left, integral_cexp_neg_mul_sq_add_const hb]
 #align fourier_transform_gaussian fourier_transform_gaussian
 
-theorem fourier_transform_gaussian_pi (hb : 0 < b.re) (t : ℂ) :
-    (∫ x : ℝ, cexp (2 * π * I * t * x) * cexp (-π * b * x ^ 2)) =
-      1 / b ^ (1 / 2 : ℂ) * cexp (-π * (1 / b) * t ^ 2) :=
+theorem fourier_transform_gaussian_pi (hb : 0 < b.re) :
+    (𝓕 fun x : ℝ => cexp (-π * b * x ^ 2)) = fun t : ℝ =>
+      1 / b ^ (1 / 2 : ℂ) * cexp (-π / b * t ^ 2) :=
   by
+  ext1 t
+  simp_rw [fourier_integral_eq_integral_exp_smul, smul_eq_mul]
   have h1 : 0 < re (π * b) := by
     rw [of_real_mul_re]
     exact mul_pos pi_pos hb
   have h2 : b ≠ 0 := by
     contrapose! hb
     rw [hb, zero_re]
-  convert _root_.fourier_transform_gaussian h1 (2 * π * t) using 1
-  · congr 1
-    ext1 x
+  convert _root_.fourier_transform_gaussian h1 (-2 * π * t) using 1
+  · congr 1 with x : 1
     congr 2
-    all_goals ring
+    all_goals push_cast ; ring
   · conv_lhs => rw [mul_comm]
     congr 2
     · field_simp [of_real_ne_zero.mpr pi_ne_zero]
       ring
-    · rw [← div_div, div_self (of_real_ne_zero.mpr pi_ne_zero), cpow_def_of_ne_zero h2,
-        cpow_def_of_ne_zero (one_div_ne_zero h2), one_div, ← Complex.exp_neg, ← neg_mul]
-      congr 2
-      rw [one_div, Complex.log_inv]
+    · rw [← div_div, div_self (of_real_ne_zero.mpr pi_ne_zero), one_div, one_div b, inv_cpow]
       rw [Ne.def, arg_eq_pi_iff, not_and_or, not_lt]
       exact Or.inl hb.le
 #align fourier_transform_gaussian_pi fourier_transform_gaussian_pi
 
 end GaussianFourier
 
+section GaussianPoisson
+
+/-! ## Poisson summation applied to the Gaussian -/
+
+
+variable {E : Type _} [NormedAddCommGroup E]
+
+theorem tendsto_rpow_abs_mul_exp_neg_mul_sq_cocompact {a : ℝ} (ha : 0 < a) (s : ℝ) :
+    Tendsto (fun x : ℝ => |x| ^ s * rexp (-a * x ^ 2)) (cocompact ℝ) (𝓝 0) :=
+  by
+  conv in rexp _ => rw [← sq_abs]
+  rw [cocompact_eq, ← comap_abs_at_top,
+    @tendsto_comap'_iff _ _ _ (fun y => y ^ s * rexp (-a * y ^ 2)) _ _ _
+      (mem_at_top_sets.mpr ⟨0, fun b hb => ⟨b, abs_of_nonneg hb⟩⟩)]
+  exact
+    (rpow_mul_exp_neg_mul_sq_isOCat_exp_neg ha s).tendsto_zero_of_tendsto
+      (tendsto_exp_at_bot.comp <| tendsto_id.neg_const_mul_at_top (neg_lt_zero.mpr one_half_pos))
+#align tendsto_rpow_abs_mul_exp_neg_mul_sq_cocompact tendsto_rpow_abs_mul_exp_neg_mul_sq_cocompact
+
+theorem isOCat_exp_neg_mul_sq_cocompact {a : ℂ} (ha : 0 < a.re) (s : ℝ) :
+    (fun x : ℝ => Complex.exp (-a * x ^ 2)) =o[cocompact ℝ] fun x : ℝ => |x| ^ s :=
+  by
+  rw [← is_o_norm_left]
+  simp_rw [norm_cexp_neg_mul_sq]
+  apply is_o_of_tendsto'
+  · refine' eventually.filter_mono cocompact_le_cofinite _
+    refine' (eventually_cofinite_ne 0).mp (eventually_of_forall fun x hx h => _)
+    exact ((rpow_pos_of_pos (abs_pos.mpr hx) _).ne' h).elim
+  · refine'
+      tendsto.congr' (eventually.filter_mono cocompact_le_cofinite _)
+        (tendsto_zero_iff_norm_tendsto_zero.mp <|
+          tendsto_rpow_abs_mul_exp_neg_mul_sq_cocompact ha (-s))
+    refine' (eventually_cofinite_ne 0).mp (eventually_of_forall fun x hx => _)
+    rw [norm_mul, norm_of_nonneg (rpow_nonneg_of_nonneg (abs_nonneg _) _), mul_comm,
+      rpow_neg (abs_nonneg x), div_eq_mul_inv, norm_of_nonneg (exp_pos _).le]
+#align is_o_exp_neg_mul_sq_cocompact isOCat_exp_neg_mul_sq_cocompact
+
+theorem Complex.tsum_exp_neg_mul_int_sq {a : ℂ} (ha : 0 < a.re) :
+    (∑' n : ℤ, cexp (-π * a * n ^ 2)) = 1 / a ^ (1 / 2 : ℂ) * ∑' n : ℤ, cexp (-π / a * n ^ 2) :=
+  by
+  let f := fun x : ℝ => cexp (-π * a * x ^ 2)
+  have h1 : 0 < (↑π * a).re := by
+    rw [of_real_mul_re]
+    exact mul_pos pi_pos ha
+  have h2 : 0 < (↑π / a).re :=
+    by
+    rw [div_eq_mul_inv, of_real_mul_re, inv_re]
+    refine' mul_pos pi_pos (div_pos ha <| norm_sq_pos.mpr _)
+    contrapose! ha
+    rw [ha, zero_re]
+  have f_bd : f =O[cocompact ℝ] fun x => |x| ^ (-2 : ℝ) :=
+    by
+    convert(isOCat_exp_neg_mul_sq_cocompact h1 _).IsO
+    ext1 x
+    dsimp only [f]
+    congr 1
+    ring
+  have Ff_bd : 𝓕 f =O[cocompact ℝ] fun x => |x| ^ (-2 : ℝ) :=
+    by
+    rw [fourier_transform_gaussian_pi ha]
+    convert(isOCat_exp_neg_mul_sq_cocompact h2 _).IsO.const_mul_left _
+    ext1 x
+    congr 1
+    ring_nf
+  simpa only [fourier_transform_gaussian_pi ha, tsum_mul_left] using
+    Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay
+      (complex.continuous_exp.comp (continuous_const.mul (continuous_of_real.pow 2)) : Continuous f)
+      one_lt_two f_bd Ff_bd
+#align complex.tsum_exp_neg_mul_int_sq Complex.tsum_exp_neg_mul_int_sq
+
+theorem Real.tsum_exp_neg_mul_int_sq {a : ℝ} (ha : 0 < a) :
+    (∑' n : ℤ, exp (-π * a * n ^ 2)) = 1 / a ^ (1 / 2 : ℝ) * ∑' n : ℤ, exp (-π / a * n ^ 2) := by
+  simpa only [← of_real_inj, of_real_mul, of_real_tsum, of_real_exp, of_real_div, of_real_pow,
+    of_real_int_cast, of_real_neg, of_real_cpow ha.le, of_real_bit0, of_real_one] using
+    Complex.tsum_exp_neg_mul_int_sq (by rwa [of_real_re] : 0 < (a : ℂ).re)
+#align real.tsum_exp_neg_mul_int_sq Real.tsum_exp_neg_mul_int_sq
+
+end GaussianPoisson
+
Diff
@@ -188,7 +188,7 @@ theorem integral_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
     ∀ x : ℂ, HasDerivAt (fun x => -(2 * b)⁻¹ * cexp (-b * x ^ 2)) (x * cexp (-b * x ^ 2)) x :=
     by
     intro x
-    convert ((hasDerivAt_pow 2 x).const_mul (-b)).cexp.const_mul (-(2 * b)⁻¹) using 1
+    convert((hasDerivAt_pow 2 x).const_mul (-b)).cexp.const_mul (-(2 * b)⁻¹) using 1
     field_simp [hb']
     ring
   have :
Diff
@@ -312,7 +312,7 @@ theorem integral_gaussian_complex {b : ℂ} (hb : 0 < re b) :
     refine'
       ContinuousAt.continuousOn fun b hb =>
         (continuousAt_cpow_const (Or.inl _)).comp (continuous_at_const.div continuousAt_id (nv hb))
-    rw [div_re, of_real_im, of_real_re, zero_mul, zero_div, add_zero]
+    rw [div_re, of_real_im, of_real_re, MulZeroClass.zero_mul, zero_div, add_zero]
     exact div_pos (mul_pos pi_pos hb) (norm_sq_pos.mpr (nv hb))
   · -- squares of both sides agree
     dsimp only [Pi.pow_apply]
@@ -559,9 +559,9 @@ theorem integral_cexp_neg_mul_sq_add_real_mul_i (hb : 0 < b.re) (c : ℝ) :
         (by
           refine' Differentiable.differentiableOn (Differentiable.const_mul _ _).cexp
           exact differentiable_pow 2)
-    simpa only [neg_im, of_real_im, neg_zero, of_real_zero, zero_mul, add_zero, neg_re, of_real_re,
-      add_re, mul_re, I_re, mul_zero, I_im, tsub_zero, add_im, mul_im, mul_one, zero_add,
-      Algebra.id.smul_eq_mul, of_real_neg] using this
+    simpa only [neg_im, of_real_im, neg_zero, of_real_zero, MulZeroClass.zero_mul, add_zero, neg_re,
+      of_real_re, add_re, mul_re, I_re, MulZeroClass.mul_zero, I_im, tsub_zero, add_im, mul_im,
+      mul_one, zero_add, Algebra.id.smul_eq_mul, of_real_neg] using this
   simp_rw [id.def, ← HI₁]
   have : I₁ = fun T : ℝ => I₂ T + vertical_integral b c T :=
     by
Diff
@@ -429,13 +429,13 @@ variable {b : ℂ}
 /-- The integral of the Gaussian function over the vertical edges of a rectangle
 with vertices at `(±T, 0)` and `(±T, c)`.  -/
 def verticalIntegral (b : ℂ) (c T : ℝ) : ℂ :=
-  ∫ y : ℝ in 0 ..c, i * (cexp (-b * (T + y * i) ^ 2) - cexp (-b * (T - y * i) ^ 2))
+  ∫ y : ℝ in 0 ..c, I * (cexp (-b * (T + y * I) ^ 2) - cexp (-b * (T - y * I) ^ 2))
 #align gaussian_fourier.vertical_integral GaussianFourier.verticalIntegral
 
 /-- Explicit formula for the norm of the Gaussian function along the vertical
 edges. -/
 theorem norm_cexp_neg_mul_sq_add_mul_i (b : ℂ) (c T : ℝ) :
-    ‖cexp (-b * (T + c * i) ^ 2)‖ = exp (-(b.re * T ^ 2 - 2 * b.im * c * T - b.re * c ^ 2)) :=
+    ‖cexp (-b * (T + c * I) ^ 2)‖ = exp (-(b.re * T ^ 2 - 2 * b.im * c * T - b.re * c ^ 2)) :=
   by
   rw [Complex.norm_eq_abs, Complex.abs_exp, neg_mul, neg_re, ← re_add_im b]
   simp only [sq, re_add_im, mul_re, mul_im, add_re, add_im, of_real_re, of_real_im, I_re, I_im]
@@ -443,7 +443,7 @@ theorem norm_cexp_neg_mul_sq_add_mul_i (b : ℂ) (c T : ℝ) :
 #align gaussian_fourier.norm_cexp_neg_mul_sq_add_mul_I GaussianFourier.norm_cexp_neg_mul_sq_add_mul_i
 
 theorem norm_cexp_neg_mul_sq_add_mul_I' (hb : b.re ≠ 0) (c T : ℝ) :
-    ‖cexp (-b * (T + c * i) ^ 2)‖ =
+    ‖cexp (-b * (T + c * I) ^ 2)‖ =
       exp (-(b.re * (T - b.im * c / b.re) ^ 2 - c ^ 2 * (b.im ^ 2 / b.re + b.re))) :=
   by
   have :
@@ -522,7 +522,7 @@ theorem tendsto_verticalIntegral (hb : 0 < b.re) (c : ℝ) :
 #align gaussian_fourier.tendsto_vertical_integral GaussianFourier.tendsto_verticalIntegral
 
 theorem integrableCexpNegMulSqAddRealMulI (hb : 0 < b.re) (c : ℝ) :
-    Integrable fun x : ℝ => cexp (-b * (x + c * i) ^ 2) :=
+    Integrable fun x : ℝ => cexp (-b * (x + c * I) ^ 2) :=
   by
   refine'
     ⟨(complex.continuous_exp.comp
@@ -539,7 +539,7 @@ theorem integrableCexpNegMulSqAddRealMulI (hb : 0 < b.re) (c : ℝ) :
 #align gaussian_fourier.integrable_cexp_neg_mul_sq_add_real_mul_I GaussianFourier.integrableCexpNegMulSqAddRealMulI
 
 theorem integral_cexp_neg_mul_sq_add_real_mul_i (hb : 0 < b.re) (c : ℝ) :
-    (∫ x : ℝ, cexp (-b * (x + c * i) ^ 2)) = (π / b) ^ (1 / 2 : ℂ) :=
+    (∫ x : ℝ, cexp (-b * (x + c * I) ^ 2)) = (π / b) ^ (1 / 2 : ℂ) :=
   by
   refine'
     tendsto_nhds_unique
@@ -595,7 +595,7 @@ theorem integral_cexp_neg_mul_sq_add_const (hb : 0 < b.re) (c : ℂ) :
 #align integral_cexp_neg_mul_sq_add_const integral_cexp_neg_mul_sq_add_const
 
 theorem fourier_transform_gaussian (hb : 0 < b.re) (t : ℂ) :
-    (∫ x : ℝ, cexp (i * t * x) * cexp (-b * x ^ 2)) =
+    (∫ x : ℝ, cexp (I * t * x) * cexp (-b * x ^ 2)) =
       cexp (-t ^ 2 / (4 * b)) * (π / b) ^ (1 / 2 : ℂ) :=
   by
   have : b ≠ 0 := by
@@ -613,7 +613,7 @@ theorem fourier_transform_gaussian (hb : 0 < b.re) (t : ℂ) :
 #align fourier_transform_gaussian fourier_transform_gaussian
 
 theorem fourier_transform_gaussian_pi (hb : 0 < b.re) (t : ℂ) :
-    (∫ x : ℝ, cexp (2 * π * i * t * x) * cexp (-π * b * x ^ 2)) =
+    (∫ x : ℝ, cexp (2 * π * I * t * x) * cexp (-π * b * x ^ 2)) =
       1 / b ^ (1 / 2 : ℂ) * cexp (-π * (1 / b) * t ^ 2) :=
   by
   have h1 : 0 < re (π * b) := by
Diff
@@ -126,7 +126,7 @@ theorem integrableOn_Ioi_exp_neg_mul_sq_iff {b : ℝ} :
   have : (∫⁻ x : ℝ in Ioi 0, 1) ≤ ∫⁻ x : ℝ in Ioi 0, ‖exp (-b * x ^ 2)‖₊ :=
     by
     apply lintegral_mono fun x => _
-    simp only [neg_mul, Ennreal.one_le_coe_iff, ← to_nnreal_one, to_nnreal_le_iff_le_coe,
+    simp only [neg_mul, ENNReal.one_le_coe_iff, ← to_nnreal_one, to_nnreal_le_iff_le_coe,
       Real.norm_of_nonneg (exp_pos _).le, coe_nnnorm, one_le_exp_iff, Right.nonneg_neg_iff]
     exact mul_nonpos_of_nonpos_of_nonneg hb (sq_nonneg _)
   simpa using this.trans_lt h.2
@@ -243,7 +243,7 @@ theorem integral_gaussian_sq_complex {b : ℂ} (hb : 0 < b.re) :
     _ = ↑π / b := by
       have : 0 ≤ π + π := by linarith [Real.pi_pos]
       simp only [integral_const, measure.restrict_apply', measurableSet_Ioo, univ_inter, volume_Ioo,
-        sub_neg_eq_add, Ennreal.toReal_ofReal, this]
+        sub_neg_eq_add, ENNReal.toReal_ofReal, this]
       rw [← two_mul, real_smul, mul_one, of_real_mul, of_real_bit0, of_real_one,
         integral_mul_cexp_neg_mul_sq hb]
       field_simp [(by

Changes in mathlib4

mathlib3
mathlib4
chore: adapt to multiple goal linter 2 (#12361)

A PR analogous to #12338: reformatting proofs following the multiple goals linter of #12339.

Diff
@@ -293,8 +293,8 @@ theorem integral_gaussian_complex {b : ℂ} (hb : 0 < re b) :
       · rw [← ofReal_one, ← ofReal_div]
       · rw [← ofReal_one, ← ofReal_ofNat, ← ofReal_div]
     rw [← ofReal_cpow, ofReal_inj]
-    convert integral_gaussian (1 : ℝ) using 1
-    · rw [sqrt_eq_rpow]
+    · convert integral_gaussian (1 : ℝ) using 1
+      rw [sqrt_eq_rpow]
     · rw [div_one]; exact pi_pos.le
   · -- squares of both sides agree
     dsimp only [Pi.pow_apply]
@@ -338,15 +338,15 @@ theorem integral_gaussian_Ioi (b : ℝ) :
     ∫ x in Ioi (0 : ℝ), exp (-b * x ^ 2) = √(π / b) / 2 := by
   rcases le_or_lt b 0 with (hb | hb)
   · rw [integral_undef, sqrt_eq_zero_of_nonpos, zero_div]
-    exact div_nonpos_of_nonneg_of_nonpos pi_pos.le hb
-    rwa [← IntegrableOn, integrableOn_Ioi_exp_neg_mul_sq_iff, not_lt]
+    · exact div_nonpos_of_nonneg_of_nonpos pi_pos.le hb
+    · rwa [← IntegrableOn, integrableOn_Ioi_exp_neg_mul_sq_iff, not_lt]
   rw [← RCLike.ofReal_inj (K := ℂ), ← integral_ofReal, ← RCLike.algebraMap_eq_ofReal,
     coe_algebraMap]
   convert integral_gaussian_complex_Ioi (by rwa [ofReal_re] : 0 < (b : ℂ).re)
   · simp
   · rw [sqrt_eq_rpow, ← ofReal_div, ofReal_div, ofReal_cpow]
-    norm_num
-    exact (div_pos pi_pos hb).le
+    · norm_num
+    · exact (div_pos pi_pos hb).le
 #align integral_gaussian_Ioi integral_gaussian_Ioi
 
 /-- The special-value formula `Γ(1/2) = √π`, which is equivalent to the Gaussian integral. -/
chore: replace set_integral with setIntegral (#12215)

Done with a global search and replace, and then (to fix the #align lines), replace (#align \S*)setIntegral with $1set_integral.

Diff
@@ -219,7 +219,7 @@ theorem integral_gaussian_sq_complex {b : ℂ} (hb : 0 < b.re) :
       rw [← integral_comp_polarCoord_symm]
       simp only [polarCoord_symm_apply, ofReal_mul, ofReal_cos, ofReal_sin]
     _ = (∫ r in Ioi (0 : ℝ), r * cexp (-b * (r : ℂ) ^ 2)) * ∫ θ in Ioo (-π) π, 1 := by
-      rw [← set_integral_prod_mul]
+      rw [← setIntegral_prod_mul]
       congr with p : 1
       rw [mul_one]
       congr
@@ -354,7 +354,7 @@ theorem Real.Gamma_one_half_eq : Real.Gamma (1 / 2) = √π := by
   rw [Gamma_eq_integral one_half_pos, ← integral_comp_rpow_Ioi_of_pos zero_lt_two]
   convert congr_arg (fun x : ℝ => 2 * x) (integral_gaussian_Ioi 1) using 1
   · rw [← integral_mul_left]
-    refine' set_integral_congr measurableSet_Ioi fun x hx => _
+    refine' setIntegral_congr measurableSet_Ioi fun x hx => _
     dsimp only
     have : (x ^ (2 : ℝ)) ^ (1 / (2 : ℝ) - 1) = x⁻¹ := by
       rw [← rpow_mul (le_of_lt hx)]
refactor(SpecialFunctions/Gaussian): shorten long pole (#12104)

This splits up Analysis/SpecialFunctions/Gaussian.lean into three pieces, with the heaviest imports only needed in the later chunks. As only the first chunk is needed for many applications, including those on the critical path towards NumberTheory/Cyclotomic/PID.lean, this should improve overall build parallelism and shorten mathlib's overall compilation time.

feat: add notation for Real.sqrt (#12056)

This adds the notation √r for Real.sqrt r. The precedence is such that √x⁻¹ is parsed as √(x⁻¹); not because this is particularly desirable, but because it's the default and the choice doesn't really matter.

This is extracted from #7907, which adds a more general nth root typeclass. The idea is to perform all the boring substitutions downstream quickly, so that we can play around with custom elaborators with a much slower rate of code-rot. This PR also won't rot as quickly, as it does not forbid writing x.sqrt as that PR does.

While perhaps claiming for Real.sqrt is greedy; it:

  • Is far more common thatn NNReal.sqrt and Nat.sqrt
  • Is far more interesting to mathlib than sqrt on Float
  • Can be overloaded anyway, so this does not prevent downstream code using the notation on their own types.
  • Will be replaced by a more general typeclass in a future PR.

Zulip

Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>

Diff
@@ -16,7 +16,7 @@ import Mathlib.MeasureTheory.Integral.Pi
 # Gaussian integral
 
 We prove various versions of the formula for the Gaussian integral:
-* `integral_gaussian`: for real `b` we have `∫ x:ℝ, exp (-b * x^2) = sqrt (π / b)`.
+* `integral_gaussian`: for real `b` we have `∫ x:ℝ, exp (-b * x^2) = √(π / b)`.
 * `integral_gaussian_complex`: for complex `b` with `0 < re b` we have
   `∫ x:ℝ, exp (-b * x^2) = (π / b) ^ (1 / 2)`.
 * `integral_gaussian_Ioi` and `integral_gaussian_complex_Ioi`: variants for integrals over `Ioi 0`.
@@ -254,7 +254,7 @@ theorem integral_gaussian_sq_complex {b : ℂ} (hb : 0 < b.re) :
       ring
 #align integral_gaussian_sq_complex integral_gaussian_sq_complex
 
-theorem integral_gaussian (b : ℝ) : ∫ x : ℝ, exp (-b * x ^ 2) = sqrt (π / b) := by
+theorem integral_gaussian (b : ℝ) : ∫ x : ℝ, exp (-b * x ^ 2) = √(π / b) := by
   -- First we deal with the crazy case where `b ≤ 0`: then both sides vanish.
   rcases le_or_lt b 0 with (hb | hb)
   · rw [integral_undef, sqrt_eq_zero_of_nonpos]
@@ -355,7 +355,7 @@ theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
 
 -- The Gaussian integral on the half-line, `∫ x in Ioi 0, exp (-b * x^2)`, for real `b`.
 theorem integral_gaussian_Ioi (b : ℝ) :
-    ∫ x in Ioi (0 : ℝ), exp (-b * x ^ 2) = sqrt (π / b) / 2 := by
+    ∫ x in Ioi (0 : ℝ), exp (-b * x ^ 2) = √(π / b) / 2 := by
   rcases le_or_lt b 0 with (hb | hb)
   · rw [integral_undef, sqrt_eq_zero_of_nonpos, zero_div]
     exact div_nonpos_of_nonneg_of_nonpos pi_pos.le hb
@@ -370,7 +370,7 @@ theorem integral_gaussian_Ioi (b : ℝ) :
 #align integral_gaussian_Ioi integral_gaussian_Ioi
 
 /-- The special-value formula `Γ(1/2) = √π`, which is equivalent to the Gaussian integral. -/
-theorem Real.Gamma_one_half_eq : Real.Gamma (1 / 2) = sqrt π := by
+theorem Real.Gamma_one_half_eq : Real.Gamma (1 / 2) = √π := by
   rw [Gamma_eq_integral one_half_pos, ← integral_comp_rpow_Ioi_of_pos zero_lt_two]
   convert congr_arg (fun x : ℝ => 2 * x) (integral_gaussian_Ioi 1) using 1
   · rw [← integral_mul_left]
chore: avoid Ne.def (adaptation for nightly-2024-03-27) (#11801)
Diff
@@ -216,7 +216,7 @@ theorem integral_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
         (tendsto_pow_atTop two_ne_zero))
   convert integral_Ioi_of_hasDerivAt_of_tendsto' (fun x _ => (A ↑x).comp_ofReal)
     (integrable_mul_cexp_neg_mul_sq hb).integrableOn B using 1
-  simp only [mul_zero, ofReal_zero, zero_pow, Ne.def, bit0_eq_zero, Nat.one_ne_zero,
+  simp only [mul_zero, ofReal_zero, zero_pow, Ne, bit0_eq_zero, Nat.one_ne_zero,
     not_false_iff, Complex.exp_zero, mul_one, sub_neg_eq_add, zero_add]
 #align integral_mul_cexp_neg_mul_sq integral_mul_cexp_neg_mul_sq
 
@@ -323,7 +323,7 @@ theorem integral_gaussian_complex {b : ℂ} (hb : 0 < re b) :
     rw [← cpow_add _ _ (div_ne_zero (ofReal_ne_zero.mpr pi_ne_zero) (nv hc))]
     norm_num
   · -- RHS doesn't vanish
-    rw [Ne.def, cpow_eq_zero_iff, not_and_or]
+    rw [Ne, cpow_eq_zero_iff, not_and_or]
     exact Or.inl (div_ne_zero (ofReal_ne_zero.mpr pi_ne_zero) (nv hc))
 #align integral_gaussian_complex integral_gaussian_complex
 
@@ -606,7 +606,7 @@ theorem _root_.fourierIntegral_gaussian_pi' (hb : 0 < b.re) (c : ℂ) :
   simp_rw [this, integral_cexp_quadratic h, neg_mul, neg_neg]
   congr 2
   · rw [← div_div, div_self <| ofReal_ne_zero.mpr pi_ne_zero, one_div, inv_cpow, ← one_div]
-    rw [Ne.def, arg_eq_pi_iff, not_and_or, not_lt]
+    rw [Ne, arg_eq_pi_iff, not_and_or, not_lt]
     exact Or.inl hb.le
   · field_simp [ofReal_ne_zero.mpr pi_ne_zero]
     ring_nf
chore: Rename IsROrC to RCLike (#10819)

IsROrC contains data, which goes against the expectation that classes prefixed with Is are prop-valued. People have been complaining about this on and off, so this PR renames IsROrC to RCLike.

Diff
@@ -262,8 +262,8 @@ theorem integral_gaussian (b : ℝ) : ∫ x : ℝ, exp (-b * x ^ 2) = sqrt (π /
     · simpa only [not_lt, integrable_exp_neg_mul_sq_iff] using hb
   -- Assume now `b > 0`. Then both sides are non-negative and their squares agree.
   refine' (sq_eq_sq (by positivity) (by positivity)).1 _
-  rw [← ofReal_inj, ofReal_pow, ← coe_algebraMap, IsROrC.algebraMap_eq_ofReal, ← integral_ofReal,
-    sq_sqrt (div_pos pi_pos hb).le, ← IsROrC.algebraMap_eq_ofReal, coe_algebraMap, ofReal_div]
+  rw [← ofReal_inj, ofReal_pow, ← coe_algebraMap, RCLike.algebraMap_eq_ofReal, ← integral_ofReal,
+    sq_sqrt (div_pos pi_pos hb).le, ← RCLike.algebraMap_eq_ofReal, coe_algebraMap, ofReal_div]
   convert integral_gaussian_sq_complex (by rwa [ofReal_re] : 0 < (b : ℂ).re) with _ x
   rw [ofReal_exp, ofReal_mul, ofReal_pow, ofReal_neg]
 #align integral_gaussian integral_gaussian
@@ -306,8 +306,8 @@ theorem integral_gaussian_complex {b : ℂ} (hb : 0 < re b) :
     have : ∀ x : ℝ, cexp (-(1 : ℂ) * (x : ℂ) ^ 2) = exp (-(1 : ℝ) * x ^ 2) := by
       intro x
       simp only [ofReal_exp, neg_mul, one_mul, ofReal_neg, ofReal_pow]
-    simp_rw [this, ← coe_algebraMap, IsROrC.algebraMap_eq_ofReal, integral_ofReal,
-      ← IsROrC.algebraMap_eq_ofReal, coe_algebraMap]
+    simp_rw [this, ← coe_algebraMap, RCLike.algebraMap_eq_ofReal, integral_ofReal,
+      ← RCLike.algebraMap_eq_ofReal, coe_algebraMap]
     conv_rhs =>
       congr
       · rw [← ofReal_one, ← ofReal_div]
@@ -360,7 +360,7 @@ theorem integral_gaussian_Ioi (b : ℝ) :
   · rw [integral_undef, sqrt_eq_zero_of_nonpos, zero_div]
     exact div_nonpos_of_nonneg_of_nonpos pi_pos.le hb
     rwa [← IntegrableOn, integrableOn_Ioi_exp_neg_mul_sq_iff, not_lt]
-  rw [← IsROrC.ofReal_inj (K := ℂ), ← integral_ofReal, ← IsROrC.algebraMap_eq_ofReal,
+  rw [← RCLike.ofReal_inj (K := ℂ), ← integral_ofReal, ← RCLike.algebraMap_eq_ofReal,
     coe_algebraMap]
   convert integral_gaussian_complex_Ioi (by rwa [ofReal_re] : 0 < (b : ℂ).re)
   · simp
@@ -654,7 +654,7 @@ theorem integrable_cexp_neg_mul_sq_norm_add_of_euclideanSpace
   convert integrable_cexp_neg_mul_sum_add hb (fun i ↦ c * w i) using 3 with v
   simp only [EuclideanSpace.measurableEquiv, MeasurableEquiv.symm_mk, MeasurableEquiv.coe_mk,
     EuclideanSpace.norm_eq, WithLp.equiv_symm_pi_apply, Real.norm_eq_abs, sq_abs, PiLp.inner_apply,
-    IsROrC.inner_apply, conj_trivial, ofReal_sum, ofReal_mul, Finset.mul_sum, neg_mul,
+    RCLike.inner_apply, conj_trivial, ofReal_sum, ofReal_mul, Finset.mul_sum, neg_mul,
     Finset.sum_neg_distrib, mul_assoc, add_left_inj, neg_inj]
   norm_cast
   rw [sq_sqrt]
chore: remove unnecessary @[eqns] attributes (#11460)

These attributes are unused in Mathlib.

Many of them were workarounds for the now-resolved leanprover/lean4#2243; this also allows the lemmas themselves (hasFiniteIntegral_def, integrable_def, memℒp_def, and integrableOn_def) to be deleted.

We are currently experiencing problems with the @[eqns] attribute on the Lean nightlies. I'm uncertain yet what the outcome is going to be there, but it seems prudent to reduce our unnecessary exposure to a language feature added in Mathlib.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -118,7 +118,7 @@ theorem integrableOn_rpow_mul_exp_neg_mul_rpow {p s b : ℝ} (hs : -1 < s) (hp :
       rpow_neg_one, mul_inv_cancel_left₀]
     all_goals linarith [mem_Ioi.mp hx]
   refine Integrable.const_mul ?_ _
-  rw [← integrableOn_def]
+  rw [← IntegrableOn]
   exact integrableOn_rpow_mul_exp_neg_rpow hs hp
 
 theorem integrableOn_rpow_mul_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : -1 < s) :
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
@@ -106,7 +106,7 @@ theorem integrableOn_rpow_mul_exp_neg_rpow {p s : ℝ} (hs : -1 < s) (hp : 1 ≤
         rw [neg_mul, one_mul]
   · simp_rw [← hp, Real.rpow_one]
     convert Real.GammaIntegral_convergent (by linarith : 0 < s + 1) using 2
-    rw [add_sub_cancel, mul_comm]
+    rw [add_sub_cancel_right, mul_comm]
 
 theorem integrableOn_rpow_mul_exp_neg_mul_rpow {p s b : ℝ} (hs : -1 < s) (hp : 1 ≤ p) (hb : 0 < b) :
     IntegrableOn (fun x : ℝ => x ^ s * exp (- b * x ^ p)) (Ioi 0) := by
@@ -383,7 +383,7 @@ theorem Real.Gamma_one_half_eq : Real.Gamma (1 / 2) = sqrt π := by
     rw [smul_eq_mul, this]
     field_simp [(ne_of_lt (show 0 < x from hx)).symm]
     norm_num; ring
-  · rw [div_one, ← mul_div_assoc, mul_comm, mul_div_cancel _ (two_ne_zero' ℝ)]
+  · rw [div_one, ← mul_div_assoc, mul_comm, mul_div_cancel_right₀ _ (two_ne_zero' ℝ)]
 set_option linter.uppercaseLean3 false in
 #align real.Gamma_one_half_eq Real.Gamma_one_half_eq
 
feat: Positivity extension for Bochner integral (#10661)

Inspired by #10538 add a positivity extension for Bochner integrals.

Diff
@@ -261,8 +261,7 @@ theorem integral_gaussian (b : ℝ) : ∫ x : ℝ, exp (-b * x ^ 2) = sqrt (π /
     · exact div_nonpos_of_nonneg_of_nonpos pi_pos.le hb
     · simpa only [not_lt, integrable_exp_neg_mul_sq_iff] using hb
   -- Assume now `b > 0`. Then both sides are non-negative and their squares agree.
-  refine' (sq_eq_sq _ (sqrt_nonneg _)).1 _
-  · exact integral_nonneg fun x => (exp_pos _).le
+  refine' (sq_eq_sq (by positivity) (by positivity)).1 _
   rw [← ofReal_inj, ofReal_pow, ← coe_algebraMap, IsROrC.algebraMap_eq_ofReal, ← integral_ofReal,
     sq_sqrt (div_pos pi_pos hb).le, ← IsROrC.algebraMap_eq_ofReal, coe_algebraMap, ofReal_div]
   convert integral_gaussian_sq_complex (by rwa [ofReal_re] : 0 < (b : ℂ).re) with _ x
chore: golf using filter_upwards (#11208)

This is presumably not exhaustive, but covers about a hundred instances.

Style opinions (e.g., why a particular change is great/not a good idea) are very welcome; I'm still forming my own.

Diff
@@ -280,7 +280,7 @@ theorem continuousAt_gaussian_integral (b : ℂ) (hb : 0 < re b) :
     (Complex.continuous_exp.comp (continuous_id'.neg.mul continuous_const)).continuousAt
   have f_le_bd : ∀ᶠ c : ℂ in 𝓝 b, ∀ᵐ x : ℝ, ‖f c x‖ ≤ exp (-d * x ^ 2) := by
     refine' eventually_of_mem ((continuous_re.isOpen_preimage _ isOpen_Ioi).mem_nhds hd') _
-    refine' fun c hc => ae_of_all _ fun x => _
+    intro c hc; filter_upwards with x
     rw [norm_cexp_neg_mul_sq]
     gcongr
     exact le_of_lt hc
feat: Fourier integral of Gaussians on inner product spaces (#11035)

Also rename (and deprecate) a few statements by changing fourierTransform to fourierIntegral: the Fourier transform for general L^2 functions is not given by the Fourier integral, so we should separate cleanly the two of them.

Diff
@@ -8,6 +8,7 @@ import Mathlib.Analysis.SpecialFunctions.PolarCoord
 import Mathlib.Analysis.Convex.Complex
 import Mathlib.Analysis.Complex.CauchyIntegral
 import Mathlib.Analysis.Fourier.PoissonSummation
+import Mathlib.MeasureTheory.Integral.Pi
 
 #align_import analysis.special_functions.gaussian from "leanprover-community/mathlib"@"7982767093ae38cba236487f9c9dd9cd99f63c16"
 
@@ -24,11 +25,14 @@ We prove various versions of the formula for the Gaussian integral:
 We also prove, more generally, that the Fourier transform of the Gaussian is another Gaussian:
 
 * `integral_cexp_quadratic`: general formula for `∫ (x : ℝ), exp (b * x ^ 2 + c * x + d)`
-* `fourier_transform_gaussian`: for all complex `b` and `t` with `0 < re b`, we have
+* `fourierIntegral_gaussian`: for all complex `b` and `t` with `0 < re b`, we have
   `∫ x:ℝ, exp (I * t * x) * exp (-b * x^2) = (π / b) ^ (1 / 2) * exp (-t ^ 2 / (4 * b))`.
-* `fourier_transform_gaussian_pi`: a variant with `b` and `t` scaled to give a more symmetric
+* `fourierIntegral_gaussian_pi`: a variant with `b` and `t` scaled to give a more symmetric
   statement, and formulated in terms of the Fourier transform operator `𝓕`.
 
+We also give versions of these formulas in finite-dimensional inner product spaces, see
+`integral_cexp_neg_mul_sq_norm_add` and `fourierIntegral_gaussian_innerProductSpace`.
+
 As an application, in `Real.tsum_exp_neg_mul_int_sq` and `Complex.tsum_exp_neg_mul_int_sq`, we use
 Poisson summation to prove the identity
 `∑' (n : ℤ), exp (-π * a * n ^ 2) = 1 / a ^ (1 / 2) * ∑' (n : ℤ), exp (-π / a * n ^ 2)`
@@ -40,7 +44,7 @@ noncomputable section
 
 open Real Set MeasureTheory Filter Asymptotics
 
-open scoped Real Topology FourierTransform
+open scoped Real Topology FourierTransform RealInnerProductSpace BigOperators
 
 open Complex hiding exp continuous_exp abs_of_nonneg sq_abs
 
@@ -394,10 +398,10 @@ set_option linter.uppercaseLean3 false in
 
 namespace GaussianFourier
 
-/-! ## Fourier transform of the Gaussian integral
+/-!
+## Fourier integral of Gaussian functions
 -/
 
-
 open intervalIntegral
 
 open scoped Real
@@ -567,15 +571,30 @@ theorem _root_.integral_cexp_quadratic (hb : b.re < 0) (c d : ℂ) :
   rw [integral_add_right_eq_self fun a : ℝ ↦ cexp (- -b * (↑a + ↑(c / (2 * b)).im * I) ^ 2),
     integral_cexp_neg_mul_sq_add_real_mul_I ((neg_re b).symm ▸ (neg_pos.mpr hb))]
 
-theorem _root_.fourier_transform_gaussian (hb : 0 < b.re) (t : ℂ) :
+lemma _root_.integrable_cexp_quadratic' (hb : b.re < 0) (c d : ℂ) :
+    Integrable (fun (x : ℝ) ↦ cexp (b * x ^ 2 + c * x + d)) := by
+  have hb' : b ≠ 0 := by contrapose! hb; rw [hb, zero_re]
+  by_contra H
+  simpa [hb', pi_ne_zero, Complex.exp_ne_zero, integral_undef H]
+    using integral_cexp_quadratic hb c d
+
+lemma _root_.integrable_cexp_quadratic (hb : 0 < b.re) (c d : ℂ) :
+    Integrable (fun (x : ℝ) ↦ cexp (-b * x ^ 2 + c * x + d)) := by
+  have : (-b).re < 0 := by simpa using hb
+  exact integrable_cexp_quadratic' this c d
+
+theorem _root_.fourierIntegral_gaussian (hb : 0 < b.re) (t : ℂ) :
     ∫ x : ℝ, cexp (I * t * x) * cexp (-b * x ^ 2) =
     (π / b) ^ (1 / 2 : ℂ) * cexp (-t ^ 2 / (4 * b)) := by
   conv => enter [1, 2, x]; rw [← Complex.exp_add, add_comm, ← add_zero (-b * x ^ 2 + I * t * x)]
   rw [integral_cexp_quadratic (show (-b).re < 0 by rwa [neg_re, neg_lt_zero]), neg_neg, zero_sub,
     mul_neg, div_neg, neg_neg, mul_pow, I_sq, neg_one_mul, mul_comm]
-#align fourier_transform_gaussian fourier_transform_gaussian
+#align fourier_transform_gaussian fourierIntegral_gaussian
 
-theorem _root_.fourier_transform_gaussian_pi' (hb : 0 < b.re) (c : ℂ) :
+@[deprecated] alias _root_.fourier_transform_gaussian :=
+  fourierIntegral_gaussian -- deprecated on 2024-02-21
+
+theorem _root_.fourierIntegral_gaussian_pi' (hb : 0 < b.re) (c : ℂ) :
     (𝓕 fun x : ℝ => cexp (-π * b * x ^ 2 + 2 * π * c * x)) = fun t : ℝ =>
     1 / b ^ (1 / 2 : ℂ) * cexp (-π / b * (t + I * c) ^ 2) := by
   haveI : b ≠ 0 := by contrapose! hb; rw [hb, zero_re]
@@ -595,11 +614,148 @@ theorem _root_.fourier_transform_gaussian_pi' (hb : 0 < b.re) (c : ℂ) :
     simp only [I_sq]
     ring
 
-theorem _root_.fourier_transform_gaussian_pi (hb : 0 < b.re) :
+@[deprecated] alias _root_.fourier_transform_gaussian_pi' :=
+  _root_.fourierIntegral_gaussian_pi' -- deprecated on 2024-02-21
+
+theorem _root_.fourierIntegral_gaussian_pi (hb : 0 < b.re) :
     (𝓕 fun (x : ℝ) ↦ cexp (-π * b * x ^ 2)) =
     fun t : ℝ ↦ 1 / b ^ (1 / 2 : ℂ) * cexp (-π / b * t ^ 2) := by
-  simpa only [mul_zero, zero_mul, add_zero] using fourier_transform_gaussian_pi' hb 0
-#align fourier_transform_gaussian_pi fourier_transform_gaussian_pi
+  simpa only [mul_zero, zero_mul, add_zero] using fourierIntegral_gaussian_pi' hb 0
+#align fourier_transform_gaussian_pi fourierIntegral_gaussian_pi
+
+@[deprecated] alias root_.fourier_transform_gaussian_pi :=
+  _root_.fourierIntegral_gaussian_pi   -- deprecated on 2024-02-21
+
+section InnerProductSpace
+
+variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [FiniteDimensional ℝ V]
+  [MeasurableSpace V] [BorelSpace V]
+
+open scoped BigOperators
+
+theorem integrable_cexp_neg_sum_mul_add {ι : Type*} [Fintype ι] {b : ι → ℂ}
+    (hb : ∀ i, 0 < (b i).re) (c : ι → ℂ) :
+    Integrable (fun (v : ι → ℝ) ↦ cexp (- ∑ i, b i * (v i : ℂ) ^ 2 + ∑ i, c i * v i)) := by
+  simp_rw [← Finset.sum_neg_distrib, ← Finset.sum_add_distrib, Complex.exp_sum, ← neg_mul]
+  apply Integrable.fintype_prod (f := fun i (v : ℝ) ↦ cexp (-b i * v^2 + c i * v)) (fun i ↦ ?_)
+  convert integrable_cexp_quadratic (hb i) (c i) 0 using 3 with x
+  simp only [add_zero]
+
+theorem integrable_cexp_neg_mul_sum_add {ι : Type*} [Fintype ι] (hb : 0 < b.re) (c : ι → ℂ) :
+    Integrable (fun (v : ι → ℝ) ↦ cexp (- b * ∑ i, (v i : ℂ) ^ 2 + ∑ i, c i * v i)) := by
+  simp_rw [neg_mul, Finset.mul_sum]
+  exact integrable_cexp_neg_sum_mul_add (fun _ ↦ hb) c
+
+theorem integrable_cexp_neg_mul_sq_norm_add_of_euclideanSpace
+    {ι : Type*} [Fintype ι] (hb : 0 < b.re) (c : ℂ) (w : EuclideanSpace ℝ ι) :
+    Integrable (fun (v : EuclideanSpace ℝ ι) ↦ cexp (- b * ‖v‖^2 + c * ⟪w, v⟫)) := by
+  have := EuclideanSpace.volume_preserving_measurableEquiv ι
+  rw [← MeasurePreserving.integrable_comp_emb this.symm (MeasurableEquiv.measurableEmbedding _)]
+  simp only [neg_mul, Function.comp_def]
+  convert integrable_cexp_neg_mul_sum_add hb (fun i ↦ c * w i) using 3 with v
+  simp only [EuclideanSpace.measurableEquiv, MeasurableEquiv.symm_mk, MeasurableEquiv.coe_mk,
+    EuclideanSpace.norm_eq, WithLp.equiv_symm_pi_apply, Real.norm_eq_abs, sq_abs, PiLp.inner_apply,
+    IsROrC.inner_apply, conj_trivial, ofReal_sum, ofReal_mul, Finset.mul_sum, neg_mul,
+    Finset.sum_neg_distrib, mul_assoc, add_left_inj, neg_inj]
+  norm_cast
+  rw [sq_sqrt]
+  · simp [Finset.mul_sum]
+  · exact Finset.sum_nonneg (fun i _hi ↦ by positivity)
+
+/-- In a real inner product space, the complex exponential of minus the square of the norm plus
+a scalar product is integrable. Useful when discussing the Fourier transform of a Gaussian. -/
+theorem integrable_cexp_neg_mul_sq_norm_add (hb : 0 < b.re) (c : ℂ) (w : V) :
+    Integrable (fun (v : V) ↦ cexp (-b * ‖v‖^2 + c * ⟪w, v⟫)) := by
+  let e := (stdOrthonormalBasis ℝ V).repr.symm
+  rw [← e.measurePreserving.integrable_comp_emb e.toHomeomorph.measurableEmbedding]
+  convert integrable_cexp_neg_mul_sq_norm_add_of_euclideanSpace
+    hb c (e.symm w) with v
+  simp only [neg_mul, Function.comp_apply, LinearIsometryEquiv.norm_map,
+    LinearIsometryEquiv.symm_symm, conj_trivial, ofReal_sum,
+    ofReal_mul, LinearIsometryEquiv.inner_map_eq_flip]
+
+theorem integral_cexp_neg_sum_mul_add {ι : Type*} [Fintype ι] {b : ι → ℂ}
+    (hb : ∀ i, 0 < (b i).re) (c : ι → ℂ) :
+    ∫ v : ι → ℝ, cexp (- ∑ i, b i * (v i : ℂ) ^ 2 + ∑ i, c i * v i)
+      = ∏ i, (π / b i) ^ (1 / 2 : ℂ) * cexp (c i ^ 2 / (4 * b i)) := by
+  simp_rw [← Finset.sum_neg_distrib, ← Finset.sum_add_distrib, Complex.exp_sum, ← neg_mul]
+  rw [integral_fintype_prod_eq_prod (f := fun i (v : ℝ) ↦ cexp (-b i * v ^ 2 + c i * v))]
+  congr with i
+  have : (-b i).re < 0 := by simpa using hb i
+  convert integral_cexp_quadratic this (c i) 0 using 1 <;> simp [div_neg]
+
+theorem integral_cexp_neg_mul_sum_add {ι : Type*} [Fintype ι] (hb : 0 < b.re) (c : ι → ℂ) :
+    ∫ v : ι → ℝ, cexp (- b * ∑ i, (v i : ℂ) ^ 2 + ∑ i, c i * v i)
+      = (π / b) ^ (Fintype.card ι / 2 : ℂ) * cexp ((∑ i, c i ^ 2) / (4 * b)) := by
+  simp_rw [neg_mul, Finset.mul_sum, integral_cexp_neg_sum_mul_add (fun _ ↦ hb) c]
+  simp only [one_div, Finset.prod_mul_distrib, Finset.prod_const, ← cpow_nat_mul, ← Complex.exp_sum,
+    Fintype.card, Finset.sum_div]
+  rfl
+
+theorem integral_cexp_neg_mul_sq_norm_add_of_euclideanSpace
+    {ι : Type*} [Fintype ι] (hb : 0 < b.re) (c : ℂ) (w : EuclideanSpace ℝ ι) :
+    ∫ v : EuclideanSpace ℝ ι, cexp (- b * ‖v‖^2 + c * ⟪w, v⟫) =
+      (π / b) ^ (Fintype.card ι / 2 : ℂ) * cexp (c ^ 2 * ‖w‖^2 / (4 * b)) := by
+  have := (EuclideanSpace.volume_preserving_measurableEquiv ι).symm
+  rw [← this.integral_comp (MeasurableEquiv.measurableEmbedding _)]
+  simp only [neg_mul, Function.comp_def]
+  convert integral_cexp_neg_mul_sum_add hb (fun i ↦ c * w i) using 5 with _x y
+  · simp only [EuclideanSpace.measurableEquiv, MeasurableEquiv.symm_mk, MeasurableEquiv.coe_mk,
+      EuclideanSpace.norm_eq, WithLp.equiv_symm_pi_apply, Real.norm_eq_abs, sq_abs, neg_mul,
+      neg_inj, mul_eq_mul_left_iff]
+    norm_cast
+    left
+    rw [sq_sqrt]
+    exact Finset.sum_nonneg (fun i _hi ↦ by positivity)
+  · simp [PiLp.inner_apply, EuclideanSpace.measurableEquiv, Finset.mul_sum, mul_assoc]
+  · simp only [EuclideanSpace.norm_eq, Real.norm_eq_abs, sq_abs, mul_pow, ← Finset.mul_sum]
+    congr
+    norm_cast
+    rw [sq_sqrt]
+    exact Finset.sum_nonneg (fun i _hi ↦ by positivity)
+
+theorem integral_cexp_neg_mul_sq_norm_add
+    (hb : 0 < b.re) (c : ℂ) (w : V) :
+    ∫ v : V, cexp (- b * ‖v‖^2 + c * ⟪w, v⟫) =
+      (π / b) ^ (FiniteDimensional.finrank ℝ V / 2 : ℂ) * cexp (c ^ 2 * ‖w‖^2 / (4 * b)) := by
+  let e := (stdOrthonormalBasis ℝ V).repr.symm
+  rw [← e.measurePreserving.integral_comp e.toHomeomorph.measurableEmbedding]
+  convert integral_cexp_neg_mul_sq_norm_add_of_euclideanSpace
+    hb c (e.symm w) <;> simp [LinearIsometryEquiv.inner_map_eq_flip]
+
+theorem integral_cexp_neg_mul_sq_norm (hb : 0 < b.re) :
+    ∫ v : V, cexp (- b * ‖v‖^2) = (π / b) ^ (FiniteDimensional.finrank ℝ V / 2 : ℂ) := by
+  simpa using integral_cexp_neg_mul_sq_norm_add hb 0 (0 : V)
+
+theorem integral_rexp_neg_mul_sq_norm {b : ℝ} (hb : 0 < b) :
+    ∫ v : V, rexp (- b * ‖v‖^2) = (π / b) ^ (FiniteDimensional.finrank ℝ V / 2 : ℝ) := by
+  rw [← ofReal_inj]
+  convert integral_cexp_neg_mul_sq_norm (show 0 < (b : ℂ).re from hb) (V := V)
+  · change ofRealLI (∫ (v : V), rexp (-b * ‖v‖ ^ 2)) = ∫ (v : V), cexp (-↑b * ↑‖v‖ ^ 2)
+    rw [← ofRealLI.integral_comp_comm]
+    simp [ofRealLI]
+  · rw [← ofReal_div, ofReal_cpow (by positivity)]
+    simp
+
+theorem _root_.fourierIntegral_gaussian_innerProductSpace' (hb : 0 < b.re) (x w : V) :
+    𝓕 (fun v ↦ cexp (- b * ‖v‖^2 + 2 * π * Complex.I * ⟪x, v⟫)) w =
+      (π / b) ^ (FiniteDimensional.finrank ℝ V / 2 : ℂ) * cexp (-π ^ 2 * ‖x - w‖ ^ 2 / b) := by
+  simp only [neg_mul, fourierIntegral_eq', ofReal_neg, ofReal_mul, ofReal_ofNat,
+    smul_eq_mul, ← Complex.exp_add, real_inner_comm w]
+  convert integral_cexp_neg_mul_sq_norm_add hb (2 * π * Complex.I) (x - w) using 3 with v
+  · congr 1
+    simp [inner_sub_left]
+    ring
+  · have : b ≠ 0 := by contrapose! hb; rw [hb, zero_re]
+    field_simp [mul_pow]
+    ring
+
+theorem _root_.fourierIntegral_gaussian_innerProductSpace (hb : 0 < b.re) (w : V) :
+    𝓕 (fun v ↦ cexp (- b * ‖v‖^2)) w =
+      (π / b) ^ (FiniteDimensional.finrank ℝ V / 2 : ℂ) * cexp (-π ^ 2 * ‖w‖^2 / b) := by
+  simpa using fourierIntegral_gaussian_innerProductSpace' hb 0 w
+
+end InnerProductSpace
 
 end GaussianFourier
 
@@ -672,7 +828,7 @@ theorem Complex.tsum_exp_neg_quadratic {a : ℂ} (ha : 0 < a.re) (b : ℂ) :
     · exact continuous_const.mul (Complex.continuous_ofReal.pow 2)
     · exact continuous_const.mul Complex.continuous_ofReal
   have hFf : 𝓕 f = fun x : ℝ ↦ 1 / a ^ (1 / 2 : ℂ) * cexp (-π / a * (x + I * b) ^ 2) :=
-    fourier_transform_gaussian_pi' ha b
+    fourierIntegral_gaussian_pi' ha b
   have h1 : 0 < (↑π * a).re := by
     rw [re_ofReal_mul]
     exact mul_pos pi_pos ha
feat: the Fourier transform is self-adjoint (#10833)

Also extend the notation 𝓕 for the Fourier transform to inner product spaces, introduce a notation 𝓕⁻ for the inverse Fourier transform, and generalize a few results from the real line to inner product spaces.

Diff
@@ -582,7 +582,7 @@ theorem _root_.fourier_transform_gaussian_pi' (hb : 0 < b.re) (c : ℂ) :
   have h : (-↑π * b).re < 0 := by
     simpa only [neg_mul, neg_re, re_ofReal_mul, neg_lt_zero] using mul_pos pi_pos hb
   ext1 t
-  simp_rw [fourierIntegral_eq_integral_exp_smul, smul_eq_mul, ← Complex.exp_add, ← add_assoc]
+  simp_rw [fourierIntegral_real_eq_integral_exp_smul, smul_eq_mul, ← Complex.exp_add, ← add_assoc]
   have (x : ℝ) : ↑(-2 * π * x * t) * I + -π * b * x ^ 2 + 2 * π * c * x =
     -π * b * x ^ 2 + (-2 * π * I * t + 2 * π * c) * x + 0 := by push_cast; ring
   simp_rw [this, integral_cexp_quadratic h, neg_mul, neg_neg]
@@ -596,7 +596,7 @@ theorem _root_.fourier_transform_gaussian_pi' (hb : 0 < b.re) (c : ℂ) :
     ring
 
 theorem _root_.fourier_transform_gaussian_pi (hb : 0 < b.re) :
-    (𝓕 fun x ↦ cexp (-π * b * x ^ 2)) =
+    (𝓕 fun (x : ℝ) ↦ cexp (-π * b * x ^ 2)) =
     fun t : ℝ ↦ 1 / b ^ (1 / 2 : ℂ) * cexp (-π / b * t ^ 2) := by
   simpa only [mul_zero, zero_mul, add_zero] using fourier_transform_gaussian_pi' hb 0
 #align fourier_transform_gaussian_pi fourier_transform_gaussian_pi
chore: prepare Lean version bump with explicit simp (#10999)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -695,7 +695,7 @@ theorem Complex.tsum_exp_neg_quadratic {a : ℂ} (ha : 0 < a.re) (b : ℂ) :
       (?_) (-2 * ↑π * I * b / a) (-2)).isBigO.const_mul_left _).const_mul_left _
     rwa [neg_div, neg_re, neg_lt_zero]
   convert Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay hCf one_lt_two f_bd Ff_bd 0 using 1
-  · simp only [zero_add, ofReal_int_cast]
+  · simp only [f, zero_add, ofReal_int_cast]
   · rw [← tsum_mul_left]
     simp only [QuotientAddGroup.mk_zero, fourier_eval_zero, mul_one, hFf, ofReal_int_cast]
 
chore: remove stream-of-consciousness uses of have, replace and suffices (#10640)

No changes to tactic file, it's just boring fixes throughout the library.

This follows on from #6964.

Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -556,8 +556,8 @@ theorem _root_.integral_cexp_quadratic (hb : b.re < 0) (c d : ℂ) :
     ∫ x : ℝ, cexp (b * x ^ 2 + c * x + d) = (π / -b) ^ (1 / 2 : ℂ) * cexp (d - c^2 / (4 * b)) := by
   have hb' : b ≠ 0 := by contrapose! hb; rw [hb, zero_re]
   have h (x : ℝ) : cexp (b * x ^ 2 + c * x + d) =
-      cexp (- -b * (x + c / (2 * b)) ^ 2) * cexp (d - c ^ 2 / (4 * b))
-  · simp_rw [← Complex.exp_add]
+      cexp (- -b * (x + c / (2 * b)) ^ 2) * cexp (d - c ^ 2 / (4 * b)) := by
+    simp_rw [← Complex.exp_add]
     congr 1
     field_simp
     ring_nf
@@ -579,13 +579,12 @@ theorem _root_.fourier_transform_gaussian_pi' (hb : 0 < b.re) (c : ℂ) :
     (𝓕 fun x : ℝ => cexp (-π * b * x ^ 2 + 2 * π * c * x)) = fun t : ℝ =>
     1 / b ^ (1 / 2 : ℂ) * cexp (-π / b * (t + I * c) ^ 2) := by
   haveI : b ≠ 0 := by contrapose! hb; rw [hb, zero_re]
-  have h : (-↑π * b).re < 0
-  · simpa only [neg_mul, neg_re, re_ofReal_mul, neg_lt_zero] using mul_pos pi_pos hb
+  have h : (-↑π * b).re < 0 := by
+    simpa only [neg_mul, neg_re, re_ofReal_mul, neg_lt_zero] using mul_pos pi_pos hb
   ext1 t
   simp_rw [fourierIntegral_eq_integral_exp_smul, smul_eq_mul, ← Complex.exp_add, ← add_assoc]
   have (x : ℝ) : ↑(-2 * π * x * t) * I + -π * b * x ^ 2 + 2 * π * c * x =
-    -π * b * x ^ 2 + (-2 * π * I * t + 2 * π * c) * x + 0
-  · push_cast; ring
+    -π * b * x ^ 2 + (-2 * π * I * t + 2 * π * c) * x + 0 := by push_cast; ring
   simp_rw [this, integral_cexp_quadratic h, neg_mul, neg_neg]
   congr 2
   · rw [← div_div, div_self <| ofReal_ne_zero.mpr pi_ne_zero, one_div, inv_cpow, ← one_div]
@@ -614,12 +613,12 @@ variable {E : Type*} [NormedAddCommGroup E]
 
 lemma rexp_neg_quadratic_isLittleO_rpow_atTop {a : ℝ} (ha : a < 0) (b s : ℝ) :
     (fun x ↦ rexp (a * x ^ 2 + b * x)) =o[atTop] (· ^ s) := by
-  suffices : (fun x ↦ rexp (a * x ^ 2 + b * x)) =o[atTop] (fun x ↦ rexp (-x))
-  · refine this.trans ?_
+  suffices (fun x ↦ rexp (a * x ^ 2 + b * x)) =o[atTop] (fun x ↦ rexp (-x)) by
+    refine this.trans ?_
     simpa only [neg_one_mul] using isLittleO_exp_neg_mul_rpow_atTop zero_lt_one s
   rw [isLittleO_exp_comp_exp_comp]
-  have : (fun x ↦ -x - (a * x ^ 2 + b * x)) = fun x ↦ x * (-a * x - (b + 1))
-  · ext1 x; ring_nf
+  have : (fun x ↦ -x - (a * x ^ 2 + b * x)) = fun x ↦ x * (-a * x - (b + 1)) := by
+    ext1 x; ring_nf
   rw [this]
   exact tendsto_id.atTop_mul_atTop <|
     Filter.tendsto_atTop_add_const_right _ _ <| tendsto_id.const_mul_atTop (neg_pos.mpr ha)
@@ -668,12 +667,12 @@ theorem Complex.tsum_exp_neg_quadratic {a : ℂ} (ha : 0 < a.re) (b : ℂ) :
     (∑' n : ℤ, cexp (-π * a * n ^ 2 + 2 * π * b * n)) =
       1 / a ^ (1 / 2 : ℂ) * ∑' n : ℤ, cexp (-π / a * (n + I * b) ^ 2) := by
   let f : ℝ → ℂ := fun x ↦ cexp (-π * a * x ^ 2 + 2 * π * b * x)
-  have hCf : Continuous f
-  · refine Complex.continuous_exp.comp (Continuous.add ?_ ?_)
+  have hCf : Continuous f := by
+    refine Complex.continuous_exp.comp (Continuous.add ?_ ?_)
     · exact continuous_const.mul (Complex.continuous_ofReal.pow 2)
     · exact continuous_const.mul Complex.continuous_ofReal
-  have hFf : 𝓕 f = fun x : ℝ ↦ 1 / a ^ (1 / 2 : ℂ) * cexp (-π / a * (x + I * b) ^ 2)
-  · exact fourier_transform_gaussian_pi' ha b
+  have hFf : 𝓕 f = fun x : ℝ ↦ 1 / a ^ (1 / 2 : ℂ) * cexp (-π / a * (x + I * b) ^ 2) :=
+    fourier_transform_gaussian_pi' ha b
   have h1 : 0 < (↑π * a).re := by
     rw [re_ofReal_mul]
     exact mul_pos pi_pos ha
@@ -685,11 +684,11 @@ theorem Complex.tsum_exp_neg_quadratic {a : ℂ} (ha : 0 < a.re) (b : ℂ) :
   have f_bd : f =O[cocompact ℝ] (fun x => |x| ^ (-2 : ℝ)) := by
     convert (cexp_neg_quadratic_isLittleO_abs_rpow_cocompact ?_ _ (-2)).isBigO
     rwa [neg_mul, neg_re, neg_lt_zero]
-  have Ff_bd : (𝓕 f) =O[cocompact ℝ] (fun x => |x| ^ (-2 : ℝ))
-  · rw [hFf]
+  have Ff_bd : (𝓕 f) =O[cocompact ℝ] (fun x => |x| ^ (-2 : ℝ)) := by
+    rw [hFf]
     have : ∀ (x : ℝ), -↑π / a * (↑x + I * b) ^ 2 =
-      -↑π / a * x ^ 2 + (-2 * π * I * b) / a * x + π * b ^ 2 / a
-    · intro x; ring_nf; rw [I_sq]; ring
+        -↑π / a * x ^ 2 + (-2 * π * I * b) / a * x + π * b ^ 2 / a := by
+      intro x; ring_nf; rw [I_sq]; ring
     simp_rw [this]
     conv => enter [2, x]; rw [Complex.exp_add, ← mul_assoc _ _ (Complex.exp _), mul_comm]
     refine ((cexp_neg_quadratic_isLittleO_abs_rpow_cocompact
feat: generalize cocompact_eq (#10285)

example use case: cocompact_le with integrable_iff_integrableAtFilter_cocompact from #10248 becomes a way to prove integrability from big-O estimates (e.g. #10258)

Co-authored-by: L Lllvvuu <git@llllvvuu.dev>

Diff
@@ -633,7 +633,7 @@ lemma cexp_neg_quadratic_isLittleO_rpow_atTop {a : ℂ} (ha : a.re < 0) (b : ℂ
 
 lemma cexp_neg_quadratic_isLittleO_abs_rpow_cocompact {a : ℂ} (ha : a.re < 0) (b : ℂ) (s : ℝ) :
     (fun x : ℝ ↦ cexp (a * x ^ 2 + b * x)) =o[cocompact ℝ] (|·| ^ s) := by
-  rw [Real.cocompact_eq, isLittleO_sup]
+  rw [cocompact_eq_atBot_atTop, isLittleO_sup]
   constructor
   · refine ((cexp_neg_quadratic_isLittleO_rpow_atTop ha (-b) s).comp_tendsto
       Filter.tendsto_neg_atBot_atTop).congr' (eventually_of_forall fun x ↦ ?_) ?_
@@ -647,7 +647,7 @@ lemma cexp_neg_quadratic_isLittleO_abs_rpow_cocompact {a : ℂ} (ha : a.re < 0)
 theorem tendsto_rpow_abs_mul_exp_neg_mul_sq_cocompact {a : ℝ} (ha : 0 < a) (s : ℝ) :
     Tendsto (fun x : ℝ => |x| ^ s * rexp (-a * x ^ 2)) (cocompact ℝ) (𝓝 0) := by
   conv in rexp _ => rw [← sq_abs]
-  erw [cocompact_eq, ← comap_abs_atTop,
+  erw [cocompact_eq_atBot_atTop, ← comap_abs_atTop,
     @tendsto_comap'_iff _ _ _ (fun y => y ^ s * rexp (-a * y ^ 2)) _ _ _
       (mem_atTop_sets.mpr ⟨0, fun b hb => ⟨b, abs_of_nonneg hb⟩⟩)]
   exact
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
@@ -212,7 +212,7 @@ theorem integral_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
         (tendsto_pow_atTop two_ne_zero))
   convert integral_Ioi_of_hasDerivAt_of_tendsto' (fun x _ => (A ↑x).comp_ofReal)
     (integrable_mul_cexp_neg_mul_sq hb).integrableOn B using 1
-  simp only [mul_zero, ofReal_zero, zero_pow', Ne.def, bit0_eq_zero, Nat.one_ne_zero,
+  simp only [mul_zero, ofReal_zero, zero_pow, Ne.def, bit0_eq_zero, Nat.one_ne_zero,
     not_false_iff, Complex.exp_zero, mul_one, sub_neg_eq_add, zero_add]
 #align integral_mul_cexp_neg_mul_sq integral_mul_cexp_neg_mul_sq
 
chore: tidy various files (#9903)
Diff
@@ -665,8 +665,8 @@ theorem isLittleO_exp_neg_mul_sq_cocompact {a : ℂ} (ha : 0 < a.re) (s : ℝ) :
 /-- Jacobi's theta-function transformation formula for the sum of `exp -Q(x)`, where `Q` is a
 negative definite quadratic form. -/
 theorem Complex.tsum_exp_neg_quadratic {a : ℂ} (ha : 0 < a.re) (b : ℂ) :
-    (∑' n : ℤ, cexp (-π * a * n ^ 2 + 2 * π * b * n)) = 1 / a ^ (1 / 2 : ℂ) *
-    ∑' n : ℤ, cexp (-π / a * (n + I * b) ^ 2) := by
+    (∑' n : ℤ, cexp (-π * a * n ^ 2 + 2 * π * b * n)) =
+      1 / a ^ (1 / 2 : ℂ) * ∑' n : ℤ, cexp (-π / a * (n + I * b) ^ 2) := by
   let f : ℝ → ℂ := fun x ↦ cexp (-π * a * x ^ 2 + 2 * π * b * x)
   have hCf : Continuous f
   · refine Complex.continuous_exp.comp (Continuous.add ?_ ?_)
@@ -691,8 +691,7 @@ theorem Complex.tsum_exp_neg_quadratic {a : ℂ} (ha : 0 < a.re) (b : ℂ) :
       -↑π / a * x ^ 2 + (-2 * π * I * b) / a * x + π * b ^ 2 / a
     · intro x; ring_nf; rw [I_sq]; ring
     simp_rw [this]
-    conv => enter [2, x]; rw [Complex.exp_add, ← mul_assoc _ _ (Complex.exp _),
-      mul_comm]
+    conv => enter [2, x]; rw [Complex.exp_add, ← mul_assoc _ _ (Complex.exp _), mul_comm]
     refine ((cexp_neg_quadratic_isLittleO_abs_rpow_cocompact
       (?_) (-2 * ↑π * I * b / a) (-2)).isBigO.const_mul_left _).const_mul_left _
     rwa [neg_div, neg_re, neg_lt_zero]
@@ -704,8 +703,7 @@ theorem Complex.tsum_exp_neg_quadratic {a : ℂ} (ha : 0 < a.re) (b : ℂ) :
 theorem Complex.tsum_exp_neg_mul_int_sq {a : ℂ} (ha : 0 < a.re) :
     (∑' n : ℤ, cexp (-π * a * (n : ℂ) ^ 2)) =
       1 / a ^ (1 / 2 : ℂ) * ∑' n : ℤ, cexp (-π / a * (n : ℂ) ^ 2) := by
-  simpa only [mul_zero, zero_mul, add_zero] using
-    Complex.tsum_exp_neg_quadratic ha 0
+  simpa only [mul_zero, zero_mul, add_zero] using Complex.tsum_exp_neg_quadratic ha 0
 #align complex.tsum_exp_neg_mul_int_sq Complex.tsum_exp_neg_mul_int_sq
 
 theorem Real.tsum_exp_neg_mul_int_sq {a : ℝ} (ha : 0 < a) :
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
@@ -23,14 +23,13 @@ We prove various versions of the formula for the Gaussian integral:
 
 We also prove, more generally, that the Fourier transform of the Gaussian is another Gaussian:
 
-* `integral_cexp_neg_mul_sq_add_const`: for all complex `b` and `c` with `0 < re b` we have
-  `∫ (x : ℝ), exp (-b * (x + c) ^ 2) = (π / b) ^ (1 / 2)`.
+* `integral_cexp_quadratic`: general formula for `∫ (x : ℝ), exp (b * x ^ 2 + c * x + d)`
 * `fourier_transform_gaussian`: for all complex `b` and `t` with `0 < re b`, we have
   `∫ x:ℝ, exp (I * t * x) * exp (-b * x^2) = (π / b) ^ (1 / 2) * exp (-t ^ 2 / (4 * b))`.
 * `fourier_transform_gaussian_pi`: a variant with `b` and `t` scaled to give a more symmetric
   statement, and formulated in terms of the Fourier transform operator `𝓕`.
 
-As an application, in `Real.tsum_exp_neg_mul_int_sq` and `cCmplex.tsum_exp_neg_mul_int_sq`, we use
+As an application, in `Real.tsum_exp_neg_mul_int_sq` and `Complex.tsum_exp_neg_mul_int_sq`, we use
 Poisson summation to prove the identity
 `∑' (n : ℤ), exp (-π * a * n ^ 2) = 1 / a ^ (1 / 2) * ∑' (n : ℤ), exp (-π / a * n ^ 2)`
 for positive real `a`, or complex `a` with positive real part. (See also
@@ -553,45 +552,54 @@ theorem integral_cexp_neg_mul_sq_add_real_mul_I (hb : 0 < b.re) (c : ℝ) :
 set_option linter.uppercaseLean3 false in
 #align gaussian_fourier.integral_cexp_neg_mul_sq_add_real_mul_I GaussianFourier.integral_cexp_neg_mul_sq_add_real_mul_I
 
-theorem _root_.integral_cexp_neg_mul_sq_add_const (hb : 0 < b.re) (c : ℂ) :
-    ∫ x : ℝ, cexp (-b * (x + c) ^ 2) = (π / b) ^ (1 / 2 : ℂ) := by
-  rw [← re_add_im c]
+theorem _root_.integral_cexp_quadratic (hb : b.re < 0) (c d : ℂ) :
+    ∫ x : ℝ, cexp (b * x ^ 2 + c * x + d) = (π / -b) ^ (1 / 2 : ℂ) * cexp (d - c^2 / (4 * b)) := by
+  have hb' : b ≠ 0 := by contrapose! hb; rw [hb, zero_re]
+  have h (x : ℝ) : cexp (b * x ^ 2 + c * x + d) =
+      cexp (- -b * (x + c / (2 * b)) ^ 2) * cexp (d - c ^ 2 / (4 * b))
+  · simp_rw [← Complex.exp_add]
+    congr 1
+    field_simp
+    ring_nf
+  simp_rw [h, integral_mul_right]
+  rw [← re_add_im (c / (2 * b))]
   simp_rw [← add_assoc, ← ofReal_add]
-  rw [integral_add_right_eq_self fun x : ℝ => cexp (-b * (↑x + ↑c.im * I) ^ 2)]
-  · apply integral_cexp_neg_mul_sq_add_real_mul_I hb
-#align integral_cexp_neg_mul_sq_add_const integral_cexp_neg_mul_sq_add_const
+  rw [integral_add_right_eq_self fun a : ℝ ↦ cexp (- -b * (↑a + ↑(c / (2 * b)).im * I) ^ 2),
+    integral_cexp_neg_mul_sq_add_real_mul_I ((neg_re b).symm ▸ (neg_pos.mpr hb))]
 
 theorem _root_.fourier_transform_gaussian (hb : 0 < b.re) (t : ℂ) :
-    ∫ x : ℝ, cexp (I * t * x) * cexp (-b * (x : ℂ) ^ 2) =
-      cexp (-t ^ 2 / (4 * b)) * (π / b) ^ (1 / 2 : ℂ) := by
-  have : b ≠ 0 := by contrapose! hb; rw [hb, zero_re]
-  simp_rw [← Complex.exp_add]
-  have : ∀ x : ℂ,
-      I * t * x + -b * x ^ 2 = -t ^ 2 / ((4 : ℂ) * b) + -b * (x + -I * t / 2 / b) ^ 2 := by
-    intro x
-    ring_nf
-    rw [I_sq]
-    field_simp; ring
-  simp_rw [this, Complex.exp_add, integral_mul_left, integral_cexp_neg_mul_sq_add_const hb]
+    ∫ x : ℝ, cexp (I * t * x) * cexp (-b * x ^ 2) =
+    (π / b) ^ (1 / 2 : ℂ) * cexp (-t ^ 2 / (4 * b)) := by
+  conv => enter [1, 2, x]; rw [← Complex.exp_add, add_comm, ← add_zero (-b * x ^ 2 + I * t * x)]
+  rw [integral_cexp_quadratic (show (-b).re < 0 by rwa [neg_re, neg_lt_zero]), neg_neg, zero_sub,
+    mul_neg, div_neg, neg_neg, mul_pow, I_sq, neg_one_mul, mul_comm]
 #align fourier_transform_gaussian fourier_transform_gaussian
 
-theorem _root_.fourier_transform_gaussian_pi (hb : 0 < b.re) :
-    (𝓕 fun x : ℝ => cexp (-π * b * (x : ℂ) ^ 2)) = fun t : ℝ =>
-      (1 : ℂ) / b ^ (1 / 2 : ℂ) * cexp (-π / b * (t : ℂ) ^ 2) := by
+theorem _root_.fourier_transform_gaussian_pi' (hb : 0 < b.re) (c : ℂ) :
+    (𝓕 fun x : ℝ => cexp (-π * b * x ^ 2 + 2 * π * c * x)) = fun t : ℝ =>
+    1 / b ^ (1 / 2 : ℂ) * cexp (-π / b * (t + I * c) ^ 2) := by
+  haveI : b ≠ 0 := by contrapose! hb; rw [hb, zero_re]
+  have h : (-↑π * b).re < 0
+  · simpa only [neg_mul, neg_re, re_ofReal_mul, neg_lt_zero] using mul_pos pi_pos hb
   ext1 t
-  simp_rw [fourierIntegral_eq_integral_exp_smul, smul_eq_mul]
-  have h1 : 0 < re (π * b) := by rw [re_ofReal_mul]; exact mul_pos pi_pos hb
-  have h2 : b ≠ 0 := by contrapose! hb; rw [hb, zero_re]
-  convert _root_.fourier_transform_gaussian h1 (-2 * π * t) using 1
-  · congr 1 with x : 1
-    congr 2
-    any_goals push_cast; ring
-  · conv_lhs => rw [mul_comm]
-    congr 2
-    · field_simp [ofReal_ne_zero.mpr pi_ne_zero]; ring
-    · rw [← div_div, div_self (ofReal_ne_zero.mpr pi_ne_zero), one_div, one_div b, inv_cpow]
-      rw [Ne.def, arg_eq_pi_iff, not_and_or, not_lt]
-      exact Or.inl hb.le
+  simp_rw [fourierIntegral_eq_integral_exp_smul, smul_eq_mul, ← Complex.exp_add, ← add_assoc]
+  have (x : ℝ) : ↑(-2 * π * x * t) * I + -π * b * x ^ 2 + 2 * π * c * x =
+    -π * b * x ^ 2 + (-2 * π * I * t + 2 * π * c) * x + 0
+  · push_cast; ring
+  simp_rw [this, integral_cexp_quadratic h, neg_mul, neg_neg]
+  congr 2
+  · rw [← div_div, div_self <| ofReal_ne_zero.mpr pi_ne_zero, one_div, inv_cpow, ← one_div]
+    rw [Ne.def, arg_eq_pi_iff, not_and_or, not_lt]
+    exact Or.inl hb.le
+  · field_simp [ofReal_ne_zero.mpr pi_ne_zero]
+    ring_nf
+    simp only [I_sq]
+    ring
+
+theorem _root_.fourier_transform_gaussian_pi (hb : 0 < b.re) :
+    (𝓕 fun x ↦ cexp (-π * b * x ^ 2)) =
+    fun t : ℝ ↦ 1 / b ^ (1 / 2 : ℂ) * cexp (-π / b * t ^ 2) := by
+  simpa only [mul_zero, zero_mul, add_zero] using fourier_transform_gaussian_pi' hb 0
 #align fourier_transform_gaussian_pi fourier_transform_gaussian_pi
 
 end GaussianFourier
@@ -600,9 +608,42 @@ section GaussianPoisson
 
 /-! ## Poisson summation applied to the Gaussian -/
 
-
 variable {E : Type*} [NormedAddCommGroup E]
 
+/-! First we show that Gaussian-type functions have rapid decay along `cocompact ℝ`. -/
+
+lemma rexp_neg_quadratic_isLittleO_rpow_atTop {a : ℝ} (ha : a < 0) (b s : ℝ) :
+    (fun x ↦ rexp (a * x ^ 2 + b * x)) =o[atTop] (· ^ s) := by
+  suffices : (fun x ↦ rexp (a * x ^ 2 + b * x)) =o[atTop] (fun x ↦ rexp (-x))
+  · refine this.trans ?_
+    simpa only [neg_one_mul] using isLittleO_exp_neg_mul_rpow_atTop zero_lt_one s
+  rw [isLittleO_exp_comp_exp_comp]
+  have : (fun x ↦ -x - (a * x ^ 2 + b * x)) = fun x ↦ x * (-a * x - (b + 1))
+  · ext1 x; ring_nf
+  rw [this]
+  exact tendsto_id.atTop_mul_atTop <|
+    Filter.tendsto_atTop_add_const_right _ _ <| tendsto_id.const_mul_atTop (neg_pos.mpr ha)
+
+lemma cexp_neg_quadratic_isLittleO_rpow_atTop {a : ℂ} (ha : a.re < 0) (b : ℂ) (s : ℝ) :
+    (fun x : ℝ ↦ cexp (a * x ^ 2 + b * x)) =o[atTop] (· ^ s) := by
+  apply Asymptotics.IsLittleO.of_norm_left
+  convert rexp_neg_quadratic_isLittleO_rpow_atTop ha b.re s with x
+  simp_rw [Complex.norm_eq_abs, Complex.abs_exp, add_re, ← ofReal_pow, mul_comm (_ : ℂ) ↑(_ : ℝ),
+      re_ofReal_mul, mul_comm _ (re _)]
+
+lemma cexp_neg_quadratic_isLittleO_abs_rpow_cocompact {a : ℂ} (ha : a.re < 0) (b : ℂ) (s : ℝ) :
+    (fun x : ℝ ↦ cexp (a * x ^ 2 + b * x)) =o[cocompact ℝ] (|·| ^ s) := by
+  rw [Real.cocompact_eq, isLittleO_sup]
+  constructor
+  · refine ((cexp_neg_quadratic_isLittleO_rpow_atTop ha (-b) s).comp_tendsto
+      Filter.tendsto_neg_atBot_atTop).congr' (eventually_of_forall fun x ↦ ?_) ?_
+    · simp only [neg_mul, Function.comp_apply, ofReal_neg, neg_sq, mul_neg, neg_neg]
+    · refine (eventually_lt_atBot 0).mp (eventually_of_forall fun x hx ↦ ?_)
+      simp only [Function.comp_apply, abs_of_neg hx]
+  · refine (cexp_neg_quadratic_isLittleO_rpow_atTop ha b s).congr' EventuallyEq.rfl ?_
+    refine (eventually_gt_atTop 0).mp (eventually_of_forall fun x hx ↦ ?_)
+    simp_rw [abs_of_pos hx]
+
 theorem tendsto_rpow_abs_mul_exp_neg_mul_sq_cocompact {a : ℝ} (ha : 0 < a) (s : ℝ) :
     Tendsto (fun x : ℝ => |x| ^ s * rexp (-a * x ^ 2)) (cocompact ℝ) (𝓝 0) := by
   conv in rexp _ => rw [← sq_abs]
@@ -615,27 +656,24 @@ theorem tendsto_rpow_abs_mul_exp_neg_mul_sq_cocompact {a : ℝ} (ha : 0 < a) (s
 #align tendsto_rpow_abs_mul_exp_neg_mul_sq_cocompact tendsto_rpow_abs_mul_exp_neg_mul_sq_cocompact
 
 theorem isLittleO_exp_neg_mul_sq_cocompact {a : ℂ} (ha : 0 < a.re) (s : ℝ) :
-    (fun x : ℝ => Complex.exp (-a * (x : ℂ) ^ 2)) =o[cocompact ℝ] fun x : ℝ => |x| ^ s := by
-  rw [← isLittleO_norm_left]
-  simp_rw [norm_cexp_neg_mul_sq]
-  apply isLittleO_of_tendsto'
-  · refine' Eventually.filter_mono cocompact_le_cofinite _
-    refine' (eventually_cofinite_ne 0).mp (eventually_of_forall fun x hx h => _)
-    exact ((rpow_pos_of_pos (abs_pos.mpr hx) _).ne' h).elim
-  · refine'
-      Tendsto.congr' (Eventually.filter_mono cocompact_le_cofinite _)
-        (tendsto_zero_iff_norm_tendsto_zero.mp <|
-          tendsto_rpow_abs_mul_exp_neg_mul_sq_cocompact ha (-s))
-    refine' (eventually_cofinite_ne 0).mp (eventually_of_forall fun x _ => _)
-    dsimp only
-    rw [norm_mul, norm_of_nonneg (rpow_nonneg (abs_nonneg _) _), mul_comm,
-      rpow_neg (abs_nonneg x), div_eq_mul_inv, norm_of_nonneg (exp_pos _).le]
+    (fun x : ℝ => Complex.exp (-a * x ^ 2)) =o[cocompact ℝ] fun x : ℝ => |x| ^ s := by
+  convert cexp_neg_quadratic_isLittleO_abs_rpow_cocompact (?_ : (-a).re < 0) 0 s using 1
+  · simp_rw [zero_mul, add_zero]
+  · rwa [neg_re, neg_lt_zero]
 #align is_o_exp_neg_mul_sq_cocompact isLittleO_exp_neg_mul_sq_cocompact
 
-theorem Complex.tsum_exp_neg_mul_int_sq {a : ℂ} (ha : 0 < a.re) :
-    (∑' n : ℤ, cexp (-π * a * (n : ℂ) ^ 2)) =
-      (1 : ℂ) / a ^ (1 / 2 : ℂ) * ∑' n : ℤ, cexp (-π / a * (n : ℂ) ^ 2) := by
-  let f := fun x : ℝ => cexp (-π * a * (x : ℂ) ^ 2)
+/-- Jacobi's theta-function transformation formula for the sum of `exp -Q(x)`, where `Q` is a
+negative definite quadratic form. -/
+theorem Complex.tsum_exp_neg_quadratic {a : ℂ} (ha : 0 < a.re) (b : ℂ) :
+    (∑' n : ℤ, cexp (-π * a * n ^ 2 + 2 * π * b * n)) = 1 / a ^ (1 / 2 : ℂ) *
+    ∑' n : ℤ, cexp (-π / a * (n + I * b) ^ 2) := by
+  let f : ℝ → ℂ := fun x ↦ cexp (-π * a * x ^ 2 + 2 * π * b * x)
+  have hCf : Continuous f
+  · refine Complex.continuous_exp.comp (Continuous.add ?_ ?_)
+    · exact continuous_const.mul (Complex.continuous_ofReal.pow 2)
+    · exact continuous_const.mul Complex.continuous_ofReal
+  have hFf : 𝓕 f = fun x : ℝ ↦ 1 / a ^ (1 / 2 : ℂ) * cexp (-π / a * (x + I * b) ^ 2)
+  · exact fourier_transform_gaussian_pi' ha b
   have h1 : 0 < (↑π * a).re := by
     rw [re_ofReal_mul]
     exact mul_pos pi_pos ha
@@ -644,29 +682,38 @@ theorem Complex.tsum_exp_neg_mul_int_sq {a : ℂ} (ha : 0 < a.re) :
     refine' mul_pos pi_pos (div_pos ha <| normSq_pos.mpr _)
     contrapose! ha
     rw [ha, zero_re]
-  have f_bd : f =O[cocompact ℝ] fun x => |x| ^ (-2 : ℝ) := by
-    convert (isLittleO_exp_neg_mul_sq_cocompact h1 (-2)).isBigO using 2
-    dsimp only
-    congr 1
-    ring
-  have Ff_bd : 𝓕 f =O[cocompact ℝ] fun x => |x| ^ (-2 : ℝ) := by
-    rw [fourier_transform_gaussian_pi ha]
-    convert (isLittleO_exp_neg_mul_sq_cocompact h2 (-2)).isBigO.const_mul_left
-      ((1 : ℂ) / a ^ (1 / 2 : ℂ)) using 2
-    congr 1
-    ring_nf
-  simpa only [fourier_transform_gaussian_pi ha, tsum_mul_left, Function.comp] using
-    Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay
-      (Complex.continuous_exp.comp (continuous_const.mul (continuous_ofReal.pow 2)) : Continuous f)
-      one_lt_two f_bd Ff_bd
+  have f_bd : f =O[cocompact ℝ] (fun x => |x| ^ (-2 : ℝ)) := by
+    convert (cexp_neg_quadratic_isLittleO_abs_rpow_cocompact ?_ _ (-2)).isBigO
+    rwa [neg_mul, neg_re, neg_lt_zero]
+  have Ff_bd : (𝓕 f) =O[cocompact ℝ] (fun x => |x| ^ (-2 : ℝ))
+  · rw [hFf]
+    have : ∀ (x : ℝ), -↑π / a * (↑x + I * b) ^ 2 =
+      -↑π / a * x ^ 2 + (-2 * π * I * b) / a * x + π * b ^ 2 / a
+    · intro x; ring_nf; rw [I_sq]; ring
+    simp_rw [this]
+    conv => enter [2, x]; rw [Complex.exp_add, ← mul_assoc _ _ (Complex.exp _),
+      mul_comm]
+    refine ((cexp_neg_quadratic_isLittleO_abs_rpow_cocompact
+      (?_) (-2 * ↑π * I * b / a) (-2)).isBigO.const_mul_left _).const_mul_left _
+    rwa [neg_div, neg_re, neg_lt_zero]
+  convert Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay hCf one_lt_two f_bd Ff_bd 0 using 1
+  · simp only [zero_add, ofReal_int_cast]
+  · rw [← tsum_mul_left]
+    simp only [QuotientAddGroup.mk_zero, fourier_eval_zero, mul_one, hFf, ofReal_int_cast]
+
+theorem Complex.tsum_exp_neg_mul_int_sq {a : ℂ} (ha : 0 < a.re) :
+    (∑' n : ℤ, cexp (-π * a * (n : ℂ) ^ 2)) =
+      1 / a ^ (1 / 2 : ℂ) * ∑' n : ℤ, cexp (-π / a * (n : ℂ) ^ 2) := by
+  simpa only [mul_zero, zero_mul, add_zero] using
+    Complex.tsum_exp_neg_quadratic ha 0
 #align complex.tsum_exp_neg_mul_int_sq Complex.tsum_exp_neg_mul_int_sq
 
 theorem Real.tsum_exp_neg_mul_int_sq {a : ℝ} (ha : 0 < a) :
     (∑' n : ℤ, exp (-π * a * (n : ℝ) ^ 2)) =
       (1 : ℝ) / a ^ (1 / 2 : ℝ) * (∑' n : ℤ, exp (-π / a * (n : ℝ) ^ 2)) := by
-  simpa only [← ofReal_inj, ofReal_mul, ofReal_tsum, ofReal_exp, ofReal_div, ofReal_pow,
-    ofReal_int_cast, ofReal_neg, ofReal_cpow ha.le, ofReal_ofNat, ofReal_one] using
-    Complex.tsum_exp_neg_mul_int_sq (by rwa [ofReal_re] : 0 < (a : ℂ).re)
+  simpa only [← ofReal_inj, ofReal_tsum, ofReal_exp, ofReal_mul, ofReal_neg, ofReal_pow,
+    ofReal_int_cast, ofReal_div, ofReal_one, ofReal_cpow ha.le, ofReal_ofNat, mul_zero, zero_mul,
+    add_zero] using Complex.tsum_exp_neg_quadratic (by rwa [ofReal_re] : 0 < (a : ℂ).re) 0
 #align real.tsum_exp_neg_mul_int_sq Real.tsum_exp_neg_mul_int_sq
 
 end GaussianPoisson
feat: Basic Complex lemmas (#9527)

and rename ofReal_mul_re → re_mul_ofReal, ofReal_mul_im → im_mul_ofReal.

From LeanAPAP

Diff
@@ -172,7 +172,7 @@ theorem integrable_mul_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) :
 
 theorem norm_cexp_neg_mul_sq (b : ℂ) (x : ℝ) :
     ‖Complex.exp (-b * (x : ℂ) ^ 2)‖ = exp (-b.re * x ^ 2) := by
-  rw [Complex.norm_eq_abs, Complex.abs_exp, ← ofReal_pow, mul_comm (-b) _, ofReal_mul_re, neg_re,
+  rw [Complex.norm_eq_abs, Complex.abs_exp, ← ofReal_pow, mul_comm (-b) _, re_ofReal_mul, neg_re,
     mul_comm]
 #align norm_cexp_neg_mul_sq norm_cexp_neg_mul_sq
 
@@ -580,7 +580,7 @@ theorem _root_.fourier_transform_gaussian_pi (hb : 0 < b.re) :
       (1 : ℂ) / b ^ (1 / 2 : ℂ) * cexp (-π / b * (t : ℂ) ^ 2) := by
   ext1 t
   simp_rw [fourierIntegral_eq_integral_exp_smul, smul_eq_mul]
-  have h1 : 0 < re (π * b) := by rw [ofReal_mul_re]; exact mul_pos pi_pos hb
+  have h1 : 0 < re (π * b) := by rw [re_ofReal_mul]; exact mul_pos pi_pos hb
   have h2 : b ≠ 0 := by contrapose! hb; rw [hb, zero_re]
   convert _root_.fourier_transform_gaussian h1 (-2 * π * t) using 1
   · congr 1 with x : 1
@@ -637,10 +637,10 @@ theorem Complex.tsum_exp_neg_mul_int_sq {a : ℂ} (ha : 0 < a.re) :
       (1 : ℂ) / a ^ (1 / 2 : ℂ) * ∑' n : ℤ, cexp (-π / a * (n : ℂ) ^ 2) := by
   let f := fun x : ℝ => cexp (-π * a * (x : ℂ) ^ 2)
   have h1 : 0 < (↑π * a).re := by
-    rw [ofReal_mul_re]
+    rw [re_ofReal_mul]
     exact mul_pos pi_pos ha
   have h2 : 0 < (↑π / a).re := by
-    rw [div_eq_mul_inv, ofReal_mul_re, inv_re]
+    rw [div_eq_mul_inv, re_ofReal_mul, inv_re]
     refine' mul_pos pi_pos (div_pos ha <| normSq_pos.mpr _)
     contrapose! ha
     rw [ha, zero_re]
chore: Rename rpow_nonneg_of_nonneg to rpow_nonneg (#9518)

This better matches other lemma names.

From LeanAPAP

Diff
@@ -628,7 +628,7 @@ theorem isLittleO_exp_neg_mul_sq_cocompact {a : ℂ} (ha : 0 < a.re) (s : ℝ) :
           tendsto_rpow_abs_mul_exp_neg_mul_sq_cocompact ha (-s))
     refine' (eventually_cofinite_ne 0).mp (eventually_of_forall fun x _ => _)
     dsimp only
-    rw [norm_mul, norm_of_nonneg (rpow_nonneg_of_nonneg (abs_nonneg _) _), mul_comm,
+    rw [norm_mul, norm_of_nonneg (rpow_nonneg (abs_nonneg _) _), mul_comm,
       rpow_neg (abs_nonneg x), div_eq_mul_inv, norm_of_nonneg (exp_pos _).le]
 #align is_o_exp_neg_mul_sq_cocompact isLittleO_exp_neg_mul_sq_cocompact
 
feat: non-integrability results of derivatives on [a, +oo) (#8712)

We have in the library the lemma not_intervalIntegrable_of_tendsto_norm_atTop_of_deriv_isBigO_filter, saying that if a function tends to infinity at a point in an interval [a, b], then its derivative is not interval-integrable on [a, b]. We generalize this result to allow for any set instead of [a, b], and apply it to half-infinite intervals.

In particular, we characterize integrability of x^s on [a, +oo), and deduce that x^s is never integrable on [0, +oo). This makes it possible to remove one assumption in Lemma mellin_comp_rpow on the Mellin transform.

Diff
@@ -85,7 +85,7 @@ theorem integrableOn_rpow_mul_exp_neg_rpow {p s : ℝ} (hs : -1 < s) (hp : 1 ≤
     constructor
     · rw [← integrableOn_Icc_iff_integrableOn_Ioc]
       refine IntegrableOn.mul_continuousOn ?_ ?_ isCompact_Icc
-      · refine (intervalIntegrable_iff_integrable_Icc_of_le zero_le_one).mp ?_
+      · refine (intervalIntegrable_iff_integrableOn_Icc_of_le zero_le_one).mp ?_
         exact intervalIntegral.intervalIntegrable_rpow' hs
       · intro x _
         change ContinuousWithinAt ((fun x => exp (- x)) ∘ (fun x => x ^ p)) (Icc 0 1) x
chore: tidy various files (#8818)
Diff
@@ -51,8 +51,9 @@ theorem exp_neg_mul_rpow_isLittleO_exp_neg {p b : ℝ} (hb : 0 < b) (hp : 1 < p)
   suffices Tendsto (fun x => x * (b * x ^ (p - 1) + -1)) atTop atTop by
     refine Tendsto.congr' ?_ this
     refine eventuallyEq_of_mem (Ioi_mem_atTop (0 : ℝ)) (fun x hx => ?_)
-    rw [rpow_sub_one (ne_of_gt hx)]
-    field_simp [(by exact ne_of_gt hx : x ≠ 0)]
+    rw [mem_Ioi] at hx
+    rw [rpow_sub_one hx.ne']
+    field_simp [hx.ne']
     ring
   apply Tendsto.atTop_mul_atTop tendsto_id
   refine tendsto_atTop_add_const_right atTop (-1 : ℝ) ?_
@@ -79,9 +80,8 @@ theorem rpow_mul_exp_neg_mul_sq_isLittleO_exp_neg {b : ℝ} (hb : 0 < b) (s : 
 theorem integrableOn_rpow_mul_exp_neg_rpow {p s : ℝ} (hs : -1 < s) (hp : 1 ≤ p) :
     IntegrableOn (fun x : ℝ => x ^ s * exp (- x ^ p)) (Ioi 0) := by
   obtain hp | hp := le_iff_lt_or_eq.mp hp
-  · have h_exp : ∀ x, ContinuousAt (fun x => exp (- x)) x :=
-        fun x => (by exact continuousAt_neg : ContinuousAt (fun x => -x) x).exp
-    rw [← Ioc_union_Ioi_eq_Ioi (zero_le_one : (0 : ℝ) ≤ 1), integrableOn_union]
+  · have h_exp : ∀ x, ContinuousAt (fun x => exp (- x)) x := fun x => continuousAt_neg.exp
+    rw [← Ioc_union_Ioi_eq_Ioi zero_le_one, integrableOn_union]
     constructor
     · rw [← integrableOn_Icc_iff_integrableOn_Ioc]
       refine IntegrableOn.mul_continuousOn ?_ ?_ isCompact_Icc
chore: rename by_contra' to by_contra! (#8797)

To fit with the "please try harder" convention of ! tactics.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -151,7 +151,7 @@ theorem integrable_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) : Integrable fun x : 
 theorem integrableOn_Ioi_exp_neg_mul_sq_iff {b : ℝ} :
     IntegrableOn (fun x : ℝ => exp (-b * x ^ 2)) (Ioi 0) ↔ 0 < b := by
   refine' ⟨fun h => _, fun h => (integrable_exp_neg_mul_sq h).integrableOn⟩
-  by_contra' hb
+  by_contra! hb
   have : ∫⁻ _ : ℝ in Ioi 0, 1 ≤ ∫⁻ x : ℝ in Ioi 0, ‖exp (-b * x ^ 2)‖₊ := by
     apply lintegral_mono (fun x ↦ _)
     simp only [neg_mul, ENNReal.one_le_coe_iff, ← toNNReal_one, toNNReal_le_iff_le_coe,
chore: space after (#8178)

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

Diff
@@ -172,7 +172,7 @@ theorem integrable_mul_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) :
 
 theorem norm_cexp_neg_mul_sq (b : ℂ) (x : ℝ) :
     ‖Complex.exp (-b * (x : ℂ) ^ 2)‖ = exp (-b.re * x ^ 2) := by
-  rw [Complex.norm_eq_abs, Complex.abs_exp, ←ofReal_pow, mul_comm (-b) _, ofReal_mul_re, neg_re,
+  rw [Complex.norm_eq_abs, Complex.abs_exp, ← ofReal_pow, mul_comm (-b) _, ofReal_mul_re, neg_re,
     mul_comm]
 #align norm_cexp_neg_mul_sq norm_cexp_neg_mul_sq
 
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
@@ -278,8 +278,9 @@ theorem continuousAt_gaussian_integral (b : ℂ) (hb : 0 < re b) :
   have f_le_bd : ∀ᶠ c : ℂ in 𝓝 b, ∀ᵐ x : ℝ, ‖f c x‖ ≤ exp (-d * x ^ 2) := by
     refine' eventually_of_mem ((continuous_re.isOpen_preimage _ isOpen_Ioi).mem_nhds hd') _
     refine' fun c hc => ae_of_all _ fun x => _
-    rw [norm_cexp_neg_mul_sq, exp_le_exp]
-    exact mul_le_mul_of_nonneg_right (neg_le_neg (le_of_lt hc)) (sq_nonneg _)
+    rw [norm_cexp_neg_mul_sq]
+    gcongr
+    exact le_of_lt hc
   exact
     continuousAt_of_dominated (eventually_of_forall f_meas) f_le_bd (integrable_exp_neg_mul_sq hd)
       (ae_of_all _ f_cts)
@@ -443,14 +444,14 @@ theorem verticalIntegral_norm_le (hb : 0 < b.re) (c : ℝ) {T : ℝ} (hT : 0 ≤
             ‖cexp (-b * (T + y * I) ^ 2)‖ ≤
               exp (-(b.re * T ^ 2 - (2 : ℝ) * |b.im| * |c| * T - b.re * c ^ 2)) := by
     intro T hT c y hy
-    rw [norm_cexp_neg_mul_sq_add_mul_I b, exp_le_exp, neg_le_neg_iff]
-    refine' sub_le_sub (sub_le_sub (le_refl _) (mul_le_mul_of_nonneg_right _ hT)) _
+    rw [norm_cexp_neg_mul_sq_add_mul_I b]
+    gcongr exp (- (_ - ?_ * _ - _ * ?_))
     · (conv_lhs => rw [mul_assoc]); (conv_rhs => rw [mul_assoc])
-      refine' mul_le_mul_of_nonneg_left ((le_abs_self _).trans _) zero_le_two
+      gcongr _ * ?_
+      refine' (le_abs_self _).trans _
       rw [abs_mul]
-      exact mul_le_mul_of_nonneg_left hy (abs_nonneg _)
-    · refine' mul_le_mul_of_nonneg_left _ hb.le
-      rwa [sq_le_sq]
+      gcongr
+    · rwa [sq_le_sq]
   -- now main proof
   refine' (intervalIntegral.norm_integral_le_of_norm_le_const _).trans _
   pick_goal 3
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
@@ -37,8 +37,6 @@ for positive real `a`, or complex `a` with positive real part. (See also
 `NumberTheory.ModularForms.JacobiTheta`.)
 -/
 
-local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
-
 noncomputable section
 
 open Real Set MeasureTheory Filter Asymptotics
feat: Generalize results around the Gaussian integrals to powers other than two (#8033)

These are straight generalisations of results related to Gauss integrals to real positive powers other than 2. They will be useful for #8030

Diff
@@ -47,37 +47,83 @@ open scoped Real Topology FourierTransform
 
 open Complex hiding exp continuous_exp abs_of_nonneg sq_abs
 
+theorem exp_neg_mul_rpow_isLittleO_exp_neg {p b : ℝ} (hb : 0 < b) (hp : 1 < p) :
+    (fun x : ℝ => exp (- b * x ^ p)) =o[atTop] fun x : ℝ => exp (-x) := by
+  rw [isLittleO_exp_comp_exp_comp]
+  suffices Tendsto (fun x => x * (b * x ^ (p - 1) + -1)) atTop atTop by
+    refine Tendsto.congr' ?_ this
+    refine eventuallyEq_of_mem (Ioi_mem_atTop (0 : ℝ)) (fun x hx => ?_)
+    rw [rpow_sub_one (ne_of_gt hx)]
+    field_simp [(by exact ne_of_gt hx : x ≠ 0)]
+    ring
+  apply Tendsto.atTop_mul_atTop tendsto_id
+  refine tendsto_atTop_add_const_right atTop (-1 : ℝ) ?_
+  exact Tendsto.const_mul_atTop hb (tendsto_rpow_atTop (by linarith))
+
 theorem exp_neg_mul_sq_isLittleO_exp_neg {b : ℝ} (hb : 0 < b) :
     (fun x : ℝ => exp (-b * x ^ 2)) =o[atTop] fun x : ℝ => exp (-x) := by
-  have A : (fun x : ℝ => -x - -b * x ^ 2) = fun x => x * (b * x + -1) := by ext x; ring
-  rw [isLittleO_exp_comp_exp_comp, A]
-  apply Tendsto.atTop_mul_atTop tendsto_id
-  exact tendsto_atTop_add_const_right atTop (-1 : ℝ) (Tendsto.const_mul_atTop hb tendsto_id)
+  simp_rw [← rpow_two]
+  exact exp_neg_mul_rpow_isLittleO_exp_neg hb one_lt_two
 #align exp_neg_mul_sq_is_o_exp_neg exp_neg_mul_sq_isLittleO_exp_neg
 
+theorem rpow_mul_exp_neg_mul_rpow_isLittleO_exp_neg (s : ℝ) {b p : ℝ} (hp : 1 < p) (hb : 0 < b) :
+    (fun x : ℝ => x ^ s * exp (- b * x ^ p)) =o[atTop] fun x : ℝ => exp (-(1 / 2) * x) := by
+  apply ((isBigO_refl (fun x : ℝ => x ^ s) atTop).mul_isLittleO
+      (exp_neg_mul_rpow_isLittleO_exp_neg hb hp)).trans
+  simpa only [mul_comm] using Real.Gamma_integrand_isLittleO s
+
 theorem rpow_mul_exp_neg_mul_sq_isLittleO_exp_neg {b : ℝ} (hb : 0 < b) (s : ℝ) :
     (fun x : ℝ => x ^ s * exp (-b * x ^ 2)) =o[atTop] fun x : ℝ => exp (-(1 / 2) * x) := by
-  apply ((isBigO_refl (fun x : ℝ => x ^ s) atTop).mul_isLittleO
-      (exp_neg_mul_sq_isLittleO_exp_neg hb)).trans
-  simpa only [mul_comm] using Gamma_integrand_isLittleO s
+  simp_rw [← rpow_two]
+  exact rpow_mul_exp_neg_mul_rpow_isLittleO_exp_neg s one_lt_two hb
 #align rpow_mul_exp_neg_mul_sq_is_o_exp_neg rpow_mul_exp_neg_mul_sq_isLittleO_exp_neg
 
+theorem integrableOn_rpow_mul_exp_neg_rpow {p s : ℝ} (hs : -1 < s) (hp : 1 ≤ p) :
+    IntegrableOn (fun x : ℝ => x ^ s * exp (- x ^ p)) (Ioi 0) := by
+  obtain hp | hp := le_iff_lt_or_eq.mp hp
+  · have h_exp : ∀ x, ContinuousAt (fun x => exp (- x)) x :=
+        fun x => (by exact continuousAt_neg : ContinuousAt (fun x => -x) x).exp
+    rw [← Ioc_union_Ioi_eq_Ioi (zero_le_one : (0 : ℝ) ≤ 1), integrableOn_union]
+    constructor
+    · rw [← integrableOn_Icc_iff_integrableOn_Ioc]
+      refine IntegrableOn.mul_continuousOn ?_ ?_ isCompact_Icc
+      · refine (intervalIntegrable_iff_integrable_Icc_of_le zero_le_one).mp ?_
+        exact intervalIntegral.intervalIntegrable_rpow' hs
+      · intro x _
+        change ContinuousWithinAt ((fun x => exp (- x)) ∘ (fun x => x ^ p)) (Icc 0 1) x
+        refine ContinuousAt.comp_continuousWithinAt (h_exp _) ?_
+        exact continuousWithinAt_id.rpow_const (Or.inr (le_of_lt (lt_trans zero_lt_one hp)))
+    · have h_rpow : ∀ (x r : ℝ), x ∈ Ici 1 → ContinuousWithinAt (fun x => x ^ r) (Ici 1) x := by
+        intro _ _ hx
+        refine continuousWithinAt_id.rpow_const (Or.inl ?_)
+        exact ne_of_gt (lt_of_lt_of_le zero_lt_one hx)
+      refine integrable_of_isBigO_exp_neg (by norm_num : (0:ℝ) < 1 / 2)
+        (ContinuousOn.mul (fun x hx => h_rpow x s hx) (fun x hx => ?_)) (IsLittleO.isBigO ?_)
+      · change ContinuousWithinAt ((fun x => exp (- x)) ∘ (fun x => x ^ p)) (Ici 1) x
+        exact ContinuousAt.comp_continuousWithinAt (h_exp _) (h_rpow x p hx)
+      · convert rpow_mul_exp_neg_mul_rpow_isLittleO_exp_neg s hp (by norm_num : (0:ℝ) < 1) using 3
+        rw [neg_mul, one_mul]
+  · simp_rw [← hp, Real.rpow_one]
+    convert Real.GammaIntegral_convergent (by linarith : 0 < s + 1) using 2
+    rw [add_sub_cancel, mul_comm]
+
+theorem integrableOn_rpow_mul_exp_neg_mul_rpow {p s b : ℝ} (hs : -1 < s) (hp : 1 ≤ p) (hb : 0 < b) :
+    IntegrableOn (fun x : ℝ => x ^ s * exp (- b * x ^ p)) (Ioi 0) := by
+  have hib : 0 < b ^ (-p⁻¹) := rpow_pos_of_pos hb _
+  suffices IntegrableOn (fun x ↦ (b ^ (-p⁻¹)) ^ s * (x ^ s * exp (-x ^ p))) (Ioi 0) by
+    rw [show 0 = b ^ (-p⁻¹) * 0 by rw [mul_zero], ← integrableOn_Ioi_comp_mul_left_iff _ _ hib]
+    refine this.congr_fun (fun _ hx => ?_) measurableSet_Ioi
+    rw [← mul_assoc, mul_rpow, mul_rpow, ← rpow_mul (z := p), neg_mul, neg_mul, inv_mul_cancel,
+      rpow_neg_one, mul_inv_cancel_left₀]
+    all_goals linarith [mem_Ioi.mp hx]
+  refine Integrable.const_mul ?_ _
+  rw [← integrableOn_def]
+  exact integrableOn_rpow_mul_exp_neg_rpow hs hp
+
 theorem integrableOn_rpow_mul_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : -1 < s) :
     IntegrableOn (fun x : ℝ => x ^ s * exp (-b * x ^ 2)) (Ioi 0) := by
-  rw [← Ioc_union_Ioi_eq_Ioi (zero_le_one : (0 : ℝ) ≤ 1), integrableOn_union]
-  constructor
-  · rw [← integrableOn_Icc_iff_integrableOn_Ioc]
-    refine' IntegrableOn.mul_continuousOn _ _ isCompact_Icc
-    · refine' (intervalIntegrable_iff_integrable_Icc_of_le zero_le_one).mp _
-      exact intervalIntegral.intervalIntegrable_rpow' hs
-    · exact (continuous_exp.comp (continuous_const.mul (continuous_pow 2))).continuousOn
-  · have B : (0 : ℝ) < 1 / 2 := by norm_num
-    apply integrable_of_isBigO_exp_neg
-      B _ (IsLittleO.isBigO (rpow_mul_exp_neg_mul_sq_isLittleO_exp_neg hb _))
-    intro x hx
-    have N : x ≠ 0 := by refine' (zero_lt_one.trans_le _).ne'; exact hx
-    apply ((continuousAt_rpow_const _ _ (Or.inl N)).mul _).continuousWithinAt
-    exact (continuous_exp.comp (continuous_const.mul (continuous_pow 2))).continuousAt
+  simp_rw [← rpow_two]
+  exact integrableOn_rpow_mul_exp_neg_mul_rpow hs one_le_two hb
 #align integrable_on_rpow_mul_exp_neg_mul_sq integrableOn_rpow_mul_exp_neg_mul_sq
 
 theorem integrable_rpow_mul_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) {s : ℝ} (hs : -1 < s) :
chore: add Homeomorph.measurableEmbedding (#7689)
Diff
@@ -86,7 +86,7 @@ theorem integrable_rpow_mul_exp_neg_mul_sq {b : ℝ} (hb : 0 < b) {s : ℝ} (hs
     integrableOn_Ici_iff_integrableOn_Ioi]
   refine' ⟨_, integrableOn_rpow_mul_exp_neg_mul_sq hb hs⟩
   rw [← (Measure.measurePreserving_neg (volume : Measure ℝ)).integrableOn_comp_preimage
-      (Homeomorph.neg ℝ).toMeasurableEquiv.measurableEmbedding]
+      (Homeomorph.neg ℝ).measurableEmbedding]
   simp only [Function.comp, neg_sq, neg_preimage, preimage_neg_Iio, neg_neg, neg_zero]
   apply Integrable.mono' (integrableOn_rpow_mul_exp_neg_mul_sq hb hs)
   · apply Measurable.aestronglyMeasurable
fix: deduplicate and make exp notation scoped (#7297)

Zulip

Diff
@@ -47,10 +47,6 @@ open scoped Real Topology FourierTransform
 
 open Complex hiding exp continuous_exp abs_of_nonneg sq_abs
 
-notation "cexp" => Complex.exp
-
-notation "rexp" => Real.exp
-
 theorem exp_neg_mul_sq_isLittleO_exp_neg {b : ℝ} (hb : 0 < b) :
     (fun x : ℝ => exp (-b * x ^ 2)) =o[atTop] fun x : ℝ => exp (-x) := by
   have A : (fun x : ℝ => -x - -b * x ^ 2) = fun x => x * (b * x + -1) := by ext x; ring
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
@@ -173,7 +173,7 @@ theorem integral_mul_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
         (tendsto_pow_atTop two_ne_zero))
   convert integral_Ioi_of_hasDerivAt_of_tendsto' (fun x _ => (A ↑x).comp_ofReal)
     (integrable_mul_cexp_neg_mul_sq hb).integrableOn B using 1
-  simp only [MulZeroClass.mul_zero, ofReal_zero, zero_pow', Ne.def, bit0_eq_zero, Nat.one_ne_zero,
+  simp only [mul_zero, ofReal_zero, zero_pow', Ne.def, bit0_eq_zero, Nat.one_ne_zero,
     not_false_iff, Complex.exp_zero, mul_one, sub_neg_eq_add, zero_add]
 #align integral_mul_cexp_neg_mul_sq integral_mul_cexp_neg_mul_sq
 
@@ -257,7 +257,7 @@ theorem integral_gaussian_complex {b : ℂ} (hb : 0 < re b) :
     refine'
       ContinuousAt.continuousOn fun b hb =>
         (continuousAt_cpow_const (Or.inl _)).comp (continuousAt_const.div continuousAt_id (nv hb))
-    rw [div_re, ofReal_im, ofReal_re, MulZeroClass.zero_mul, zero_div, add_zero]
+    rw [div_re, ofReal_im, ofReal_re, zero_mul, zero_div, add_zero]
     exact div_pos (mul_pos pi_pos hb) (normSq_pos.mpr (nv hb))
   · -- equality at 1
     have : ∀ x : ℝ, cexp (-(1 : ℂ) * (x : ℂ) ^ 2) = exp (-(1 : ℝ) * x ^ 2) := by
@@ -489,8 +489,8 @@ theorem integral_cexp_neg_mul_sq_add_real_mul_I (hb : 0 < b.re) (c : ℝ) :
         (by
           refine' Differentiable.differentiableOn (Differentiable.const_mul _ _).cexp
           exact differentiable_pow 2)
-    simpa only [neg_im, ofReal_im, neg_zero, ofReal_zero, MulZeroClass.zero_mul, add_zero, neg_re,
-      ofReal_re, add_re, mul_re, I_re, MulZeroClass.mul_zero, I_im, tsub_zero, add_im, mul_im,
+    simpa only [neg_im, ofReal_im, neg_zero, ofReal_zero, zero_mul, add_zero, neg_re,
+      ofReal_re, add_re, mul_re, I_re, mul_zero, I_im, tsub_zero, add_im, mul_im,
       mul_one, zero_add, Algebra.id.smul_eq_mul, ofReal_neg] using this
   simp_rw [id.def, ← HI₁]
   have : I₁ = fun T : ℝ => I₂ T + verticalIntegral b c T := by
chore: remove unused simps (#6632)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -544,7 +544,7 @@ theorem _root_.fourier_transform_gaussian_pi (hb : 0 < b.re) :
   convert _root_.fourier_transform_gaussian h1 (-2 * π * t) using 1
   · congr 1 with x : 1
     congr 2
-    all_goals push_cast; ring
+    any_goals push_cast; ring
   · conv_lhs => rw [mul_comm]
     congr 2
     · field_simp [ofReal_ne_zero.mpr pi_ne_zero]; ring
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -560,7 +560,7 @@ section GaussianPoisson
 /-! ## Poisson summation applied to the Gaussian -/
 
 
-variable {E : Type _} [NormedAddCommGroup E]
+variable {E : Type*} [NormedAddCommGroup E]
 
 theorem tendsto_rpow_abs_mul_exp_neg_mul_sq_cocompact {a : ℝ} (ha : 0 < a) (s : ℝ) :
     Tendsto (fun x : ℝ => |x| ^ s * rexp (-a * x ^ 2)) (cocompact ℝ) (𝓝 0) := by
chore: regularize HPow.hPow porting notes (#6465)
Diff
@@ -37,7 +37,7 @@ for positive real `a`, or complex `a` with positive real part. (See also
 `NumberTheory.ModularForms.JacobiTheta`.)
 -/
 
-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
 
 noncomputable section
 
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,11 +2,6 @@
 Copyright (c) 2022 Sébastien Gouëzel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
-
-! This file was ported from Lean 3 source module analysis.special_functions.gaussian
-! leanprover-community/mathlib commit 7982767093ae38cba236487f9c9dd9cd99f63c16
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Analysis.SpecialFunctions.Gamma.Basic
 import Mathlib.Analysis.SpecialFunctions.PolarCoord
@@ -14,6 +9,8 @@ import Mathlib.Analysis.Convex.Complex
 import Mathlib.Analysis.Complex.CauchyIntegral
 import Mathlib.Analysis.Fourier.PoissonSummation
 
+#align_import analysis.special_functions.gaussian from "leanprover-community/mathlib"@"7982767093ae38cba236487f9c9dd9cd99f63c16"
+
 /-!
 # Gaussian integral
 
feat(MeasureTheory.Integral.Bochner): drop completeness requirement from the definition (#5910)

The notion of Bochner integral of a function taking values in a normed space E requires that E is complete. This means that whenever we write down an integral, the term contains the assertion that E is complete.

In this PR, we remove the completeness requirement from the definition, using the junk value 0 when the space is not complete. Mathematically this does not make any difference, as all reasonable applications will be with a complete E. But it means that terms involving integrals become a little bit simpler and that completeness will not have to be checked by the system when applying a bunch of basic lemmas on integrals.

Diff
@@ -299,8 +299,8 @@ theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
   have : ∀ c : ℝ, ∫ x in (0 : ℝ)..c, cexp (-b * (x : ℂ) ^ 2) =
       ∫ x in -c..0, cexp (-b * (x : ℂ) ^ 2) := by
     intro c
-    have :=
-      @intervalIntegral.integral_comp_sub_left _ _ _ _ 0 c (fun x => cexp (-b * (x : ℂ) ^ 2)) 0
+    have := intervalIntegral.integral_comp_sub_left (a := 0) (b := c)
+      (fun x => cexp (-b * (x : ℂ) ^ 2)) 0
     simpa [zero_sub, neg_sq, neg_zero] using this
   have t1 :=
     intervalIntegral_tendsto_integral_Ioi 0 (integrable_cexp_neg_mul_sq hb).integrableOn tendsto_id
chore: remove occurrences of semicolon after space (#5713)

This is the second half of the changes originally in #5699, removing all occurrences of ; after a space and implementing a linter rule to enforce it.

In most cases this 2-character substring has a space after it, so the following command was run first:

find . -type f -name "*.lean" -exec sed -i -E 's/ ; /; /g' {} \;

The remaining cases were few enough in number that they were done manually.

Diff
@@ -547,7 +547,7 @@ theorem _root_.fourier_transform_gaussian_pi (hb : 0 < b.re) :
   convert _root_.fourier_transform_gaussian h1 (-2 * π * t) using 1
   · congr 1 with x : 1
     congr 2
-    all_goals push_cast ; ring
+    all_goals push_cast; ring
   · conv_lhs => rw [mul_comm]
     congr 2
     · field_simp [ofReal_ne_zero.mpr pi_ne_zero]; ring
fix: precedence of , and abs (#5619)
Diff
@@ -418,7 +418,7 @@ theorem verticalIntegral_norm_le (hb : 0 < b.re) (c : ℝ) {T : ℝ} (hT : 0 ≤
   refine' (intervalIntegral.norm_integral_le_of_norm_le_const _).trans _
   pick_goal 3
   · rw [sub_zero]
-    conv_lhs => simp only [mul_comm _ (|c|)]
+    conv_lhs => simp only [mul_comm _ |c|]
     conv_rhs =>
       conv =>
         congr
feat: port Analysis.SpecialFunctions.Gaussian (#5370)

Co-authored-by: Komyyy <pol_tta@outlook.jp>

Dependencies 12 + 1162

1163 files ported (99.0%)
521545 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