/- Released under Apache 2.0 license as described in the file LICENSE. SPDX-License-Identifier: Apache-2.0 The majority of this file, including the proof and its supporting developments, is original work by OpenAI. Some sphere-packing fundamentals were adapted from Sphere Packing in Lean and Math, Inc.'s related fork: https://github.com/thefundamentaltheor3m/Sphere-Packing-Lean https://github.com/math-inc/Sphere-Packing-Lean The reused upstream materials were released under the Apache License, Version 2.0. The original files were modified and adapted for this formalization; their copyright and attribution notices are retained below. Copyright (c) 2024 Sidharth Hariharan. All rights reserved. Original authors of those definitions: Sidharth Hariharan and Gareth Ma. Upstream project authors: Christopher Birkbeck, Sidharth Hariharan, Seewoo Lee, Gareth Ma, Bhavik Mehta, and Maryna Viazovska. The Math, Inc. fork includes additional formalization work by its Gauss agent. -/ import Mathlib namespace CohnElkies set_option backward.isDefEq.respectTransparency false set_option backward.defeqAttrib.useBackward true set_option maxHeartbeats 800000 noncomputable section open Filter MeasureTheory open scoped FourierTransform SchwartzMap Topology abbrev Euclidean (d : ℕ) := EuclideanSpace ℝ (Fin d) abbrev TestFunction (d : ℕ) := 𝓢(Euclidean d, ℂ) def IsRealValued {d : ℕ} (f : TestFunction d) : Prop := ∀ x : Euclidean d, (f x).im = 0 def IsRadial {d : ℕ} (f : TestFunction d) : Prop := ∀ x y : Euclidean d, ‖x‖ = ‖y‖ → f x = f y structure Admissible (d : ℕ) where function : TestFunction d real : IsRealValued function radial : IsRadial function fourier_real : IsRealValued (𝓕 function) fourier_nonneg : ∀ ξ : Euclidean d, 0 ≤ ((𝓕 function) ξ).re fourier_zero_pos : 0 < ((𝓕 function) (0 : Euclidean d)).re outside_nonpos : ∀ x : Euclidean d, 1 ≤ ‖x‖ → (function x).re ≤ 0 def unitBallVolume (d : ℕ) : ℝ := Real.pi ^ ((d : ℝ) / 2) / Real.Gamma ((d : ℝ) / 2 + 1) theorem unitBallVolume_pos (d : ℕ) : 0 < unitBallVolume d := by unfold unitBallVolume exact div_pos (Real.rpow_pos_of_pos Real.pi_pos _) (Real.Gamma_pos_of_pos (by positivity)) def quotient {d : ℕ} (f : Admissible d) : ℝ := (f.function (0 : Euclidean d)).re / ((𝓕 f.function) (0 : Euclidean d)).re def quotientSet (d : ℕ) : Set ℝ := Set.range (quotient (d := d)) def linearProgram (d : ℕ) : ℝ := unitBallVolume d / (2 : ℝ) ^ d * sInf (quotientSet d) theorem geometricFactor_pos (d : ℕ) : 0 < unitBallVolume d / (2 : ℝ) ^ d := by exact div_pos (unitBallVolume_pos d) (by positivity) def normalizedCost {d : ℕ} (f : Admissible d) : ℝ := quotient f ^ ((d : ℝ)⁻¹) / Real.sqrt (d : ℝ) def normalizedProgram (d : ℕ) : ℝ := sInf (Set.range (normalizedCost (d := d))) def criticalRadius : ℝ := (Real.pi)⁻¹ def criticalPackingBase : ℝ := Real.sqrt (Real.exp 1 / (2 * Real.pi)) def criticalBinaryExponent : ℝ := (1 / 2 : ℝ) * Real.logb 2 (2 * Real.pi / Real.exp 1) theorem criticalRadius_pos : 0 < criticalRadius := by exact inv_pos.mpr Real.pi_pos theorem criticalPackingBase_pos : 0 < criticalPackingBase := by unfold criticalPackingBase positivity def SharpQuotientAsymptotic : Prop := Tendsto normalizedProgram atTop (nhds criticalRadius) def SharpLogAsymptotic : Prop := Tendsto (fun d : ℕ => Real.log (linearProgram d) / (d : ℝ)) atTop (nhds ((1 / 2 : ℝ) * Real.log (Real.exp 1 / (2 * Real.pi)))) def SharpPackingRootAsymptotic : Prop := Tendsto (fun d : ℕ => (linearProgram d) ^ ((d : ℝ)⁻¹)) atTop (nhds criticalPackingBase) end noncomputable section def shortCutoff (ε : ℝ) : ℝ := ε ^ 3 def shortEndpoint (ε : ℝ) : ℝ := 10 * Real.log (1 / ε) def shellLocation (ε : ℝ) : ℝ := ε⁻¹ ^ 3 def shellWeight (ε : ℝ) : ℝ := Real.exp (-(3 : ℝ) * ε * shellLocation ε / 8) def shortMargin (ε a : ℝ) : ℝ := 1 - 10 * ε * (1 + a) def beta (ε : ℝ) : ℝ := ε / 4 def plusPolynomial (ε : ℝ) (z : ℂ) : ℂ := 1 + z ^ 2 + (beta ε : ℂ) + Complex.I * z * (1 + z ^ 2) def minusPolynomial (ε : ℝ) (z : ℂ) : ℂ := 1 + z ^ 2 + (beta ε : ℂ) - Complex.I * z * (1 + z ^ 2) theorem shellWeight_pos (ε : ℝ) : 0 < shellWeight ε := by exact Real.exp_pos _ theorem beta_pos {ε : ℝ} (hε : 0 < ε) : 0 < beta ε := by exact div_pos hε (by norm_num) theorem plusPolynomial_imaginary (ε u : ℝ) : plusPolynomial ε (Complex.I * (u : ℂ)) = ((beta ε + (1 - u) ^ 2 * (1 + u) : ℝ) : ℂ) := by push_cast try dsimp [plusPolynomial] ring_nf simp [Complex.I_sq]; ring theorem minusPolynomial_imaginary (ε u : ℝ) : minusPolynomial ε (Complex.I * (u : ℂ)) = ((beta ε + (1 - u) * (1 + u) ^ 2 : ℝ) : ℂ) := by push_cast try dsimp [minusPolynomial] ring_nf simp [Complex.I_sq]; ring theorem plusPolynomial_imaginary_re_pos {ε u : ℝ} (hε : 0 < ε) (hu : -1 < u) : 0 < (plusPolynomial ε (Complex.I * (u : ℂ))).re := by have hs : 0 ≤ (1 - u) ^ 2 * (1 + u) := mul_nonneg (sq_nonneg _) (by linarith) rw [plusPolynomial_imaginary, Complex.ofReal_re] exact add_pos_of_pos_of_nonneg (beta_pos hε) hs theorem minusPolynomial_imaginary_re_neg {ε u : ℝ} (hε : 0 < ε) (hu : 1 + ε / 4 ≤ u) : (minusPolynomial ε (Complex.I * (u : ℂ))).re < 0 := by rw [minusPolynomial_imaginary, Complex.ofReal_re] have huone : 1 ≤ u := by linarith have hs : (4 : ℝ) ≤ (1 + u) ^ 2 := by nlinarith [sq_nonneg (u - 1)] have ht : ε / 4 ≤ u - 1 := by linarith have hproduct : ε ≤ (u - 1) * (1 + u) ^ 2 := by calc ε = (ε / 4) * 4 := by ring _ ≤ (u - 1) * (1 + u) ^ 2 := mul_le_mul ht hs (by norm_num) (by linarith) unfold beta nlinarith end noncomputable section open MeasureTheory open scoped FourierTransform def mellinFrequency (ℓ : ℝ) (profile : ℝ → ℂ) (t : ℝ) : ℂ := mellin profile ((ℓ : ℂ) - Complex.I * (t : ℂ)) theorem mellinFrequency_eq_fourier (ℓ : ℝ) (profile : ℝ → ℂ) (t : ℝ) : mellinFrequency ℓ profile t = (𝓕 (fun u : ℝ => Real.exp (-ℓ * u) • profile (Real.exp (-u)))) (-t / (2 * Real.pi)) := by unfold mellinFrequency simpa using! (mellin_eq_fourier profile (s := (ℓ : ℂ) - Complex.I * (t : ℂ))) def mellinMultiplier (ℓ t : ℝ) : ℂ := Complex.exp (Complex.I * (t : ℂ) * (Real.log Real.pi : ℂ)) * Complex.Gamma (((ℓ : ℂ) - Complex.I * (t : ℂ)) / 2) / Complex.Gamma (((ℓ : ℂ) + Complex.I * (t : ℂ)) / 2) theorem mellinDenominator_re_pos {ℓ : ℝ} (hℓ : 0 < ℓ) (t : ℝ) : 0 < (((ℓ : ℂ) + Complex.I * (t : ℂ)) / 2).re := by simpa using! (half_pos hℓ) theorem mellinMultiplier_denominator_ne_zero {ℓ : ℝ} (hℓ : 0 < ℓ) (t : ℝ) : Complex.Gamma (((ℓ : ℂ) + Complex.I * (t : ℂ)) / 2) ≠ 0 := Complex.Gamma_ne_zero_of_re_pos (mellinDenominator_re_pos hℓ t) theorem gamma_add_nat_eq_product (z : ℂ) (hz : ∀ j : ℕ, z + (j : ℂ) ≠ 0) (k : ℕ) : Complex.Gamma (z + (k : ℂ)) = Complex.Gamma z * ∏ j ∈ Finset.range k, (z + (j : ℂ)) := by induction k with | zero => simp | succ k ih => rw [Nat.cast_succ, ← add_assoc, Complex.Gamma_add_one (z + (k : ℂ)) (hz k), ih, Finset.prod_range_succ] ring theorem integer_gamma_product (k : ℕ) {y : ℝ} (hy : y ≠ 0) : Complex.Gamma ((k : ℂ) + Complex.I * (y : ℂ) / 2) = Complex.Gamma (Complex.I * (y : ℂ) / 2) * ∏ j ∈ Finset.range k, ((j : ℂ) + Complex.I * (y : ℂ) / 2) := by let z : ℂ := Complex.I * (y : ℂ) / 2 have hz : ∀ j : ℕ, z + (j : ℂ) ≠ 0 := by intro j hj have him := congrArg Complex.im hj try dsimp [z] at him norm_num at him exact hy (by linarith) simpa [z, add_comm] using! gamma_add_nat_eq_product z hz k theorem half_integer_gamma_product (k : ℕ) (y : ℝ) : Complex.Gamma ((k : ℂ) + (1 / 2 : ℂ) + Complex.I * (y : ℂ) / 2) = Complex.Gamma ((1 / 2 : ℂ) + Complex.I * (y : ℂ) / 2) * ∏ j ∈ Finset.range k, ((j : ℂ) + (1 / 2 : ℂ) + Complex.I * (y : ℂ) / 2) := by let z : ℂ := (1 / 2 : ℂ) + Complex.I * (y : ℂ) / 2 have hz : ∀ j : ℕ, z + (j : ℂ) ≠ 0 := by intro j hj have hre := congrArg Complex.re hj try dsimp [z] at hre norm_num at hre have hjnonneg : 0 ≤ (j : ℝ) := Nat.cast_nonneg j linarith simpa [z, add_comm, add_left_comm, add_assoc] using! gamma_add_nat_eq_product z hz k end noncomputable section open Filter MeasureTheory open scoped FourierTransform SchwartzMap def IsEven {d : ℕ} (f : TestFunction d) : Prop := ∀ x : Euclidean d, f (-x) = f x theorem IsRadial.even {d : ℕ} {f : TestFunction d} (hf : IsRadial f) : IsEven f := by intro x exact hf (-x) x (by simp) theorem fourierInv_apply_zero {d : ℕ} (f : TestFunction d) : (𝓕⁻ f : TestFunction d) (0 : Euclidean d) = ∫ x : Euclidean d, f x := by calc (𝓕⁻ f : TestFunction d) (0 : Euclidean d) = (𝓕⁻ (f : Euclidean d → ℂ)) (0 : Euclidean d) := congrFun (SchwartzMap.fourierInv_coe f) 0 _ = ∫ x : Euclidean d, f x := by rw [Real.fourierInv_eq] simp theorem admissible_zero_pos {d : ℕ} (f : Admissible d) : 0 < (f.function (0 : Euclidean d)).re := by have hpositive : 0 < ∫ x : Euclidean d, ((𝓕 f.function) x).re := by exact integral_pos_of_integrable_nonneg_nonzero (Complex.continuous_re.comp (𝓕 f.function).continuous) (𝓕 f.function).integrable.re f.fourier_nonneg f.fourier_zero_pos.ne' have hinversion : (∫ x : Euclidean d, (𝓕 f.function) x) = f.function (0 : Euclidean d) := by have h := congrArg (fun g : TestFunction d => g (0 : Euclidean d)) (show (𝓕⁻ (𝓕 f.function) : TestFunction d) = f.function from FourierTransform.fourierInv_fourier_eq f.function) simpa only [fourierInv_apply_zero] using! h calc (0 : ℝ) < (∫ x : Euclidean d, ((𝓕 f.function) x).re) := hpositive _ = (∫ x : Euclidean d, (𝓕 f.function) x).re := integral_re (𝓕 f.function).integrable _ = (f.function (0 : Euclidean d)).re := congrArg Complex.re hinversion theorem quotient_pos {d : ℕ} (f : Admissible d) : 0 < quotient f := by exact div_pos (admissible_zero_pos f) f.fourier_zero_pos theorem quotientSet_bddBelow (d : ℕ) : BddBelow (quotientSet d) := by refine ⟨0, ?_⟩ rintro y ⟨f, rfl⟩ exact (quotient_pos f).le theorem normalizedCost_nonneg {d : ℕ} (f : Admissible d) : 0 ≤ normalizedCost f := by exact div_nonneg (Real.rpow_nonneg (quotient_pos f).le _) (Real.sqrt_nonneg _) theorem normalizedCostSet_bddBelow (d : ℕ) : BddBelow (Set.range (normalizedCost (d := d))) := by refine ⟨0, ?_⟩ rintro y ⟨f, rfl⟩ exact normalizedCost_nonneg f theorem fourier_sq_apply {d : ℕ} (f : TestFunction d) (x : Euclidean d) : ((𝓕 (𝓕 f) : TestFunction d) x) = f (-x) := by have hinv := congrArg (fun g : TestFunction d => g (-x)) (show (𝓕⁻ (𝓕 f) : TestFunction d) = f from FourierTransform.fourierInv_fourier_eq f) have hchange : ((𝓕⁻ (𝓕 f) : TestFunction d) (-x)) = ((𝓕 (𝓕 f) : TestFunction d) x) := by calc ((𝓕⁻ (𝓕 f) : TestFunction d) (-x)) = (𝓕⁻ ((𝓕 f : TestFunction d) : Euclidean d → ℂ)) (-x) := congrFun (SchwartzMap.fourierInv_coe (𝓕 f)) (-x) _ = (𝓕 ((𝓕 f : TestFunction d) : Euclidean d → ℂ)) x := by rw [Real.fourierInv_eq_fourier_neg] simp _ = ((𝓕 (𝓕 f) : TestFunction d) x) := (congrFun (SchwartzMap.fourier_coe (𝓕 f)) x).symm exact hchange ▸ hinv theorem fourier_sq_of_radial {d : ℕ} (f : TestFunction d) (hf : IsRadial f) : (𝓕 (𝓕 f) : TestFunction d) = f := by ext x rw [fourier_sq_apply] exact hf.even x def antiFourierPart {d : ℕ} (f : TestFunction d) : TestFunction d := 𝓕 f - f theorem fourier_antiFourierPart {d : ℕ} (f : TestFunction d) (hf : IsRadial f) : (𝓕 (antiFourierPart f) : TestFunction d) = -antiFourierPart f := by rw [antiFourierPart, sub_eq_add_neg, FourierTransform.fourier_add, FourierTransform.fourier_neg, fourier_sq_of_radial f hf] simp theorem antiFourierPart_zero {d : ℕ} (f : TestFunction d) (hbalance : (𝓕 f : TestFunction d) (0 : Euclidean d) = f 0) : antiFourierPart f (0 : Euclidean d) = 0 := by change (𝓕 f : TestFunction d) 0 - f 0 = 0 exact sub_eq_zero.mpr hbalance theorem antiFourierPart_nonneg_of_signs {d : ℕ} (f : TestFunction d) (R : ℝ) (hfourier : ∀ x : Euclidean d, 0 ≤ ((𝓕 f) x).re) (houtside : ∀ x : Euclidean d, R ≤ ‖x‖ → (f x).re ≤ 0) (x : Euclidean d) (hx : R ≤ ‖x‖) : 0 ≤ (antiFourierPart f x).re := by change 0 ≤ ((𝓕 f) x).re - (f x).re linarith [hfourier x, houtside x hx] structure AntiFourierWitness (d : ℕ) (R : ℝ) where function : TestFunction d real : IsRealValued function radial : IsRadial function nonzero : function ≠ 0 anti_fourier : (𝓕 function : TestFunction d) = -function zero_value : function (0 : Euclidean d) = 0 eventually_nonneg : ∀ x : Euclidean d, R ≤ ‖x‖ → 0 ≤ (function x).re def UniformAntiFourierSignRadius : Prop := ∀ c : ℝ, 0 < c → c < criticalRadius → ∀ᶠ d : ℕ in atTop, IsEmpty (AntiFourierWitness d (c * Real.sqrt (d : ℝ))) end noncomputable section open Filter MeasureTheory Set open scoped FourierTransform SchwartzMap Topology RealInnerProductSpace ENNReal NNReal def dilationEquiv (d : ℕ) (a : ℝ) (ha : a ≠ 0) : Euclidean d ≃L[ℝ] Euclidean d := (LinearEquiv.smulOfNeZero ℝ (Euclidean d) a ha).toContinuousLinearEquiv @[simp] theorem dilationEquiv_apply (d : ℕ) (a : ℝ) (ha : a ≠ 0) (x : Euclidean d) : dilationEquiv d a ha x = a • x := by rfl def dilate {d : ℕ} (f : TestFunction d) (a : ℝ) (ha : 0 < a) : TestFunction d := SchwartzMap.compCLMOfContinuousLinearEquiv ℂ (dilationEquiv d a ha.ne') f @[simp] theorem dilate_apply {d : ℕ} (f : TestFunction d) (a : ℝ) (ha : 0 < a) (x : Euclidean d) : dilate f a ha x = f (a • x) := by rfl @[simp] theorem dilate_zero {d : ℕ} (f : TestFunction d) (a : ℝ) (ha : 0 < a) : dilate f a ha (0 : Euclidean d) = f 0 := by simp theorem IsRealValued.dilate {d : ℕ} {f : TestFunction d} (hf : IsRealValued f) (a : ℝ) (ha : 0 < a) : IsRealValued (dilate f a ha) := by intro x exact hf (a • x) theorem IsRadial.dilate {d : ℕ} {f : TestFunction d} (hf : IsRadial f) (a : ℝ) (ha : 0 < a) : IsRadial (dilate f a ha) := by intro x y hxy apply hf simp [norm_smul, hxy] theorem fourier_dilate_apply {d : ℕ} (f : TestFunction d) (a : ℝ) (ha : 0 < a) (ξ : Euclidean d) : ((𝓕 (dilate f a ha) : TestFunction d) ξ) = (a ^ d)⁻¹ • ((𝓕 f : TestFunction d) (a⁻¹ • ξ)) := by have hinner (x : Euclidean d) : @inner ℝ (Euclidean d) _ (a • x) (a⁻¹ • ξ) = @inner ℝ (Euclidean d) _ x ξ := by rw [real_inner_smul_left, real_inner_smul_right] field_simp calc ((𝓕 (dilate f a ha) : TestFunction d) ξ) = (𝓕 ((dilate f a ha : TestFunction d) : Euclidean d → ℂ)) ξ := congrFun (SchwartzMap.fourier_coe (dilate f a ha)) ξ _ = ∫ x : Euclidean d, Complex.exp ((↑(-2 * Real.pi * @inner ℝ (Euclidean d) _ x ξ) : ℂ) * Complex.I) • f (a • x) := by rw [Real.fourier_eq'] rfl _ = ∫ x : Euclidean d, (fun y : Euclidean d => Complex.exp ((↑(-2 * Real.pi * @inner ℝ (Euclidean d) _ y (a⁻¹ • ξ)) : ℂ) * Complex.I) • f y) (a • x) := by congr 1 funext x simp only [hinner x] _ = (a ^ d)⁻¹ • ∫ y : Euclidean d, Complex.exp ((↑(-2 * Real.pi * @inner ℝ (Euclidean d) _ y (a⁻¹ • ξ)) : ℂ) * Complex.I) • f y := by simpa [finrank_euclideanSpace] using! (MeasureTheory.Measure.integral_comp_smul_of_nonneg (volume : Measure (Euclidean d)) (fun y : Euclidean d => Complex.exp ((↑(-2 * Real.pi * @inner ℝ (Euclidean d) _ y (a⁻¹ • ξ)) : ℂ) * Complex.I) • f y) a (hR := ha.le)) _ = (a ^ d)⁻¹ • ((𝓕 f : TestFunction d) (a⁻¹ • ξ)) := by rw [← Real.fourier_eq'] rw [SchwartzMap.fourier_coe] theorem fourier_dilate_zero {d : ℕ} (f : TestFunction d) (a : ℝ) (ha : 0 < a) : ((𝓕 (dilate f a ha) : TestFunction d) (0 : Euclidean d)) = (a ^ d)⁻¹ • ((𝓕 f : TestFunction d) (0 : Euclidean d)) := by simpa using! fourier_dilate_apply f a ha 0 def balancingScale {d : ℕ} (f : Admissible d) : ℝ := (((𝓕 f.function : TestFunction d) (0 : Euclidean d)).re / (f.function (0 : Euclidean d)).re) ^ ((d : ℝ)⁻¹) theorem balancingScale_pos {d : ℕ} (f : Admissible d) : 0 < balancingScale f := by unfold balancingScale exact Real.rpow_pos_of_pos (div_pos f.fourier_zero_pos (admissible_zero_pos f)) _ theorem balancingScale_pow {d : ℕ} (f : Admissible d) (hd : 0 < d) : balancingScale f ^ d = ((𝓕 f.function : TestFunction d) (0 : Euclidean d)).re / (f.function (0 : Euclidean d)).re := by unfold balancingScale exact Real.rpow_inv_natCast_pow (div_pos f.fourier_zero_pos (admissible_zero_pos f)).le (Nat.ne_of_gt hd) theorem balancingScale_inv_eq_quotient_rpow {d : ℕ} (f : Admissible d) : (balancingScale f)⁻¹ = quotient f ^ ((d : ℝ)⁻¹) := by unfold balancingScale quotient rw [← Real.inv_rpow (div_pos f.fourier_zero_pos (admissible_zero_pos f)).le] rw [inv_div] theorem balancingScale_inv_eq_normalizedCost_mul_sqrt {d : ℕ} (f : Admissible d) (hd : 0 < d) : (balancingScale f)⁻¹ = normalizedCost f * Real.sqrt (d : ℝ) := by rw [balancingScale_inv_eq_quotient_rpow] unfold normalizedCost have hsqrt : Real.sqrt (d : ℝ) ≠ 0 := (Real.sqrt_pos.2 (by exact_mod_cast hd)).ne' field_simp def balancedFunction {d : ℕ} (f : Admissible d) : TestFunction d := dilate f.function (balancingScale f) (balancingScale_pos f) @[simp] theorem balancedFunction_apply {d : ℕ} (f : Admissible d) (x : Euclidean d) : balancedFunction f x = f.function (balancingScale f • x) := by rfl theorem balancedFunction_real {d : ℕ} (f : Admissible d) : IsRealValued (balancedFunction f) := f.real.dilate (balancingScale f) (balancingScale_pos f) theorem balancedFunction_radial {d : ℕ} (f : Admissible d) : IsRadial (balancedFunction f) := f.radial.dilate (balancingScale f) (balancingScale_pos f) theorem balancedFunction_fourier_real {d : ℕ} (f : Admissible d) : IsRealValued (𝓕 (balancedFunction f) : TestFunction d) := by intro ξ unfold balancedFunction rw [fourier_dilate_apply, Complex.smul_im, f.fourier_real ((balancingScale f)⁻¹ • ξ)] simp theorem balancedFunction_fourier_nonneg {d : ℕ} (f : Admissible d) (ξ : Euclidean d) : 0 ≤ ((𝓕 (balancedFunction f) : TestFunction d) ξ).re := by unfold balancedFunction rw [fourier_dilate_apply, Complex.smul_re] simpa [smul_eq_mul] using! mul_nonneg (inv_nonneg.mpr (pow_nonneg (balancingScale_pos f).le d)) (f.fourier_nonneg ((balancingScale f)⁻¹ • ξ)) theorem balancedFunction_fourier_radial {d : ℕ} (f : Admissible d) : IsRadial (𝓕 (balancedFunction f) : TestFunction d) := by intro x y hxy let A : Euclidean d ≃ₗᵢ[ℝ] Euclidean d := Submodule.reflection (ℝ ∙ (x - y))ᗮ have hA : A x = y := Submodule.reflection_sub hxy have hcomp : (balancedFunction f : Euclidean d → ℂ) ∘ A = balancedFunction f := by funext z exact balancedFunction_radial f (A z) z (A.norm_map z) change (𝓕 (balancedFunction f : Euclidean d → ℂ)) x = (𝓕 (balancedFunction f : Euclidean d → ℂ)) y calc (𝓕 (balancedFunction f : Euclidean d → ℂ)) x = (𝓕 ((balancedFunction f : Euclidean d → ℂ) ∘ A)) x := by rw [hcomp] _ = (𝓕 (balancedFunction f : Euclidean d → ℂ)) (A x) := Real.fourier_comp_linearIsometry A (balancedFunction f : Euclidean d → ℂ) x _ = (𝓕 (balancedFunction f : Euclidean d → ℂ)) y := by rw [hA] theorem balancedFunction_fourier_zero {d : ℕ} (f : Admissible d) (hd : 0 < d) : ((𝓕 (balancedFunction f) : TestFunction d) (0 : Euclidean d)) = balancedFunction f 0 := by unfold balancedFunction rw [fourier_dilate_zero, balancingScale_pow f hd, dilate_zero] apply Complex.ext · rw [Complex.smul_re] change (((𝓕 f.function : TestFunction d) (0 : Euclidean d)).re / (f.function (0 : Euclidean d)).re)⁻¹ * ((𝓕 f.function : TestFunction d) (0 : Euclidean d)).re = (f.function (0 : Euclidean d)).re field_simp [f.fourier_zero_pos.ne', (admissible_zero_pos f).ne'] · rw [Complex.smul_im] change (((𝓕 f.function : TestFunction d) (0 : Euclidean d)).re / (f.function (0 : Euclidean d)).re)⁻¹ * ((𝓕 f.function : TestFunction d) (0 : Euclidean d)).im = (f.function (0 : Euclidean d)).im rw [f.fourier_real, f.real] simp theorem balancedFunction_outside_nonpos {d : ℕ} (f : Admissible d) (x : Euclidean d) (hx : (balancingScale f)⁻¹ ≤ ‖x‖) : (balancedFunction f x).re ≤ 0 := by apply f.outside_nonpos (balancingScale f • x) have h := mul_le_mul_of_nonneg_left hx (balancingScale_pos f).le rw [mul_inv_cancel₀ (balancingScale_pos f).ne'] at h simpa [norm_smul, Real.norm_eq_abs, abs_of_pos (balancingScale_pos f)] using! h def balancedAntiFourierPart {d : ℕ} (f : Admissible d) : TestFunction d := antiFourierPart (balancedFunction f) theorem fourier_balancedAntiFourierPart {d : ℕ} (f : Admissible d) : (𝓕 (balancedAntiFourierPart f) : TestFunction d) = -balancedAntiFourierPart f := by exact fourier_antiFourierPart (balancedFunction f) (balancedFunction_radial f) theorem balancedAntiFourierPart_zero {d : ℕ} (f : Admissible d) (hd : 0 < d) : balancedAntiFourierPart f (0 : Euclidean d) = 0 := by exact antiFourierPart_zero (balancedFunction f) (balancedFunction_fourier_zero f hd) theorem balancedAntiFourierPart_real {d : ℕ} (f : Admissible d) : IsRealValued (balancedAntiFourierPart f) := by intro x change (((𝓕 (balancedFunction f) : TestFunction d) x) - balancedFunction f x).im = 0 rw [Complex.sub_im, balancedFunction_fourier_real f x, balancedFunction_real f x] norm_num theorem balancedAntiFourierPart_radial {d : ℕ} (f : Admissible d) : IsRadial (balancedAntiFourierPart f) := by intro x y hxy change ((𝓕 (balancedFunction f) : TestFunction d) x) - balancedFunction f x = ((𝓕 (balancedFunction f) : TestFunction d) y) - balancedFunction f y rw [balancedFunction_fourier_radial f x y hxy, balancedFunction_radial f x y hxy] theorem balancedAntiFourierPart_nonneg {d : ℕ} (f : Admissible d) (x : Euclidean d) (hx : (balancingScale f)⁻¹ ≤ ‖x‖) : 0 ≤ (balancedAntiFourierPart f x).re := by exact antiFourierPart_nonneg_of_signs (balancedFunction f) ((balancingScale f)⁻¹) (balancedFunction_fourier_nonneg f) (balancedFunction_outside_nonpos f) x hx theorem balancedAntiFourierPart_eq_zero_iff {d : ℕ} (f : Admissible d) : balancedAntiFourierPart f = 0 ↔ (𝓕 (balancedFunction f) : TestFunction d) = balancedFunction f := by change (𝓕 (balancedFunction f) : TestFunction d) - balancedFunction f = 0 ↔ _ exact sub_eq_zero theorem balancedFunction_support_subset_of_anti_zero {d : ℕ} (f : Admissible d) (hzero : balancedAntiFourierPart f = 0) : Function.support (balancedFunction f : Euclidean d → ℂ) ⊆ Metric.closedBall (0 : Euclidean d) (balancingScale f)⁻¹ := by intro x hx rw [Metric.mem_closedBall, dist_zero_right] by_contra hnot have hlarge : (balancingScale f)⁻¹ < ‖x‖ := lt_of_not_ge hnot have hself := (balancedAntiFourierPart_eq_zero_iff f).mp hzero have hnonneg : 0 ≤ (balancedFunction f x).re := by have hpoint : ((𝓕 (balancedFunction f) : TestFunction d) x) = balancedFunction f x := congrArg (fun g : TestFunction d => g x) hself calc 0 ≤ ((𝓕 (balancedFunction f) : TestFunction d) x).re := balancedFunction_fourier_nonneg f x _ = (balancedFunction f x).re := congrArg Complex.re hpoint have hnonpos : (balancedFunction f x).re ≤ 0 := balancedFunction_outside_nonpos f x hlarge.le have hre : (balancedFunction f x).re = 0 := le_antisymm hnonpos hnonneg apply hx apply Complex.ext · simpa using! hre · simpa using! balancedFunction_real f x theorem balancedFunction_hasCompactSupport_of_anti_zero {d : ℕ} (f : Admissible d) (hzero : balancedAntiFourierPart f = 0) : HasCompactSupport (balancedFunction f : Euclidean d → ℂ) := by exact HasCompactSupport.of_support_subset_isCompact (isCompact_closedBall (0 : Euclidean d) (balancingScale f)⁻¹) (balancedFunction_support_subset_of_anti_zero f hzero) def nonnegativeSchwartzDensity {d : ℕ} (g : TestFunction d) (hg : ∀ x : Euclidean d, 0 ≤ (g x).re) : Euclidean d → ℝ≥0 := fun x => ⟨(g x).re, hg x⟩ theorem nonnegativeSchwartzDensity_continuous {d : ℕ} (g : TestFunction d) (hg : ∀ x : Euclidean d, 0 ≤ (g x).re) : Continuous (nonnegativeSchwartzDensity g hg) := by exact (Complex.continuous_re.comp g.continuous).subtype_mk hg def nonnegativeSchwartzMeasure {d : ℕ} (g : TestFunction d) (hg : ∀ x : Euclidean d, 0 ≤ (g x).re) : Measure (Euclidean d) := (volume : Measure (Euclidean d)).withDensity (fun x => (nonnegativeSchwartzDensity g hg x : ℝ≥0∞)) theorem integrableExpSet_nonnegativeSchwartzMeasure_eq_univ {d : ℕ} (g : TestFunction d) (hg : ∀ x : Euclidean d, 0 ≤ (g x).re) (hcompact : HasCompactSupport (g : Euclidean d → ℂ)) (X : Euclidean d → ℝ) (hX : Continuous X) : ProbabilityTheory.integrableExpSet X (nonnegativeSchwartzMeasure g hg) = Set.univ := by ext t simp only [ProbabilityTheory.integrableExpSet, Set.mem_setOf_eq, Set.mem_univ, iff_true] unfold nonnegativeSchwartzMeasure rw [integrable_withDensity_iff_integrable_smul (nonnegativeSchwartzDensity_continuous g hg).measurable] simp_rw [NNReal.smul_def, smul_eq_mul] have hrealcompact : HasCompactSupport (fun x : Euclidean d => (g x).re) := by change HasCompactSupport (Complex.re ∘ (g : Euclidean d → ℂ)) exact hcompact.comp_left (by simp) have hcontinuous : Continuous (fun x : Euclidean d => (g x).re * Real.exp (t * X x)) := by exact (Complex.continuous_re.comp g.continuous).mul (Real.continuous_exp.comp (continuous_const.mul hX)) exact hcontinuous.integrable_of_hasCompactSupport hrealcompact.mul_right theorem nonnegativeSchwartz_complexMGF_analytic {d : ℕ} (g : TestFunction d) (hg : ∀ x : Euclidean d, 0 ≤ (g x).re) (hcompact : HasCompactSupport (g : Euclidean d → ℂ)) (X : Euclidean d → ℝ) (hX : Continuous X) : AnalyticOnNhd ℂ (ProbabilityTheory.complexMGF X (nonnegativeSchwartzMeasure g hg)) Set.univ := by have hset := integrableExpSet_nonnegativeSchwartzMeasure_eq_univ g hg hcompact X hX simpa [hset] using! (ProbabilityTheory.analyticOnNhd_complexMGF (X := X) (μ := nonnegativeSchwartzMeasure g hg)) theorem nonnegativeSchwartz_complexMGF_mul_I {d : ℕ} (g : TestFunction d) (hreal : IsRealValued g) (hg : ∀ x : Euclidean d, 0 ≤ (g x).re) (e : Euclidean d) (t : ℝ) : ProbabilityTheory.complexMGF (fun x : Euclidean d => -2 * Real.pi * @inner ℝ (Euclidean d) _ x e) (nonnegativeSchwartzMeasure g hg) ((t : ℂ) * Complex.I) = ((𝓕 g : TestFunction d) (t • e)) := by calc ProbabilityTheory.complexMGF (fun x : Euclidean d => -2 * Real.pi * @inner ℝ (Euclidean d) _ x e) (nonnegativeSchwartzMeasure g hg) ((t : ℂ) * Complex.I) = ∫ x : Euclidean d, nonnegativeSchwartzDensity g hg x • Complex.exp (((t : ℂ) * Complex.I) * (↑(-2 * Real.pi * @inner ℝ (Euclidean d) _ x e) : ℂ)) := by unfold ProbabilityTheory.complexMGF nonnegativeSchwartzMeasure rw [integral_withDensity_eq_integral_smul (nonnegativeSchwartzDensity_continuous g hg).measurable] _ = (𝓕 (g : Euclidean d → ℂ)) (t • e) := by rw [Real.fourier_eq'] apply integral_congr_ae filter_upwards [] with x have hvalue : (↑((g x).re) : ℂ) = g x := by apply Complex.ext · simp · simpa using! (hreal x).symm have hexponent : ((t : ℂ) * Complex.I) * (↑(-2 * Real.pi * @inner ℝ (Euclidean d) _ x e) : ℂ) = (↑(-2 * Real.pi * @inner ℝ (Euclidean d) _ x (t • e)) : ℂ) * Complex.I := by rw [real_inner_smul_right] push_cast ring rw [NNReal.smul_def, Complex.real_smul, hexponent] change (↑((g x).re) : ℂ) * _ = _ * g x rw [hvalue, mul_comm] _ = ((𝓕 g : TestFunction d) (t • e)) := (congrFun (SchwartzMap.fourier_coe g) (t • e)).symm theorem analytic_eq_zero_of_imaginary_ray (F : ℂ → ℂ) (hF : AnalyticOnNhd ℂ F Set.univ) (T : ℝ) (hvanish : ∀ t : ℝ, T < t → F ((t : ℂ) * Complex.I) = 0) : F = 0 := by let t₀ : ℝ := T + 1 let z₀ : ℂ := (t₀ : ℂ) * Complex.I have hclosure : z₀ ∈ closure ({z : ℂ | F z = 0} \ {z₀}) := by apply Metric.mem_closure_iff.mpr intro ε hε let u : ℝ := t₀ + ε / 2 let z : ℂ := (u : ℂ) * Complex.I refine ⟨z, ⟨?_, ?_⟩, ?_⟩ · apply hvanish u try dsimp [u, t₀] linarith · intro hz have hu : u = t₀ := by have him := congrArg Complex.im hz simpa [z, z₀] using! him try dsimp [u] at hu linarith · dsimp [z₀, z, u] rw [dist_eq_norm, ← sub_mul, ← Complex.ofReal_sub, norm_mul, Complex.norm_real, Complex.norm_I, mul_one, Real.norm_eq_abs] rw [show t₀ - (t₀ + ε / 2) = -(ε / 2) by ring, abs_neg, abs_of_pos (half_pos hε)] exact half_lt_self hε have heq := hF.eqOn_zero_of_preconnected_of_mem_closure isPreconnected_univ (Set.mem_univ z₀) hclosure funext z exact heq (Set.mem_univ z) theorem nonnegative_compact_fourier_fixed_eq_zero {d : ℕ} (hd : 0 < d) (g : TestFunction d) (hreal : IsRealValued g) (hg : ∀ x : Euclidean d, 0 ≤ (g x).re) (hcompact : HasCompactSupport (g : Euclidean d → ℂ)) (hfixed : (𝓕 g : TestFunction d) = g) : g = 0 := by classical letI : Nontrivial (Euclidean d) := Module.nontrivial_of_finrank_pos (R := ℝ) (M := Euclidean d) (by simpa [finrank_euclideanSpace] using! hd) obtain ⟨e, he⟩ := exists_norm_eq (Euclidean d) (by norm_num : (0 : ℝ) ≤ 1) obtain ⟨R, hR⟩ := hcompact.isBounded.subset_closedBall (0 : Euclidean d) let X : Euclidean d → ℝ := fun x => -2 * Real.pi * @inner ℝ (Euclidean d) _ x e have hX : Continuous X := by try dsimp [X] fun_prop let μ : Measure (Euclidean d) := nonnegativeSchwartzMeasure g hg let F : ℂ → ℂ := ProbabilityTheory.complexMGF X μ have hanalytic : AnalyticOnNhd ℂ F Set.univ := by try dsimp [F, μ] exact nonnegativeSchwartz_complexMGF_analytic g hg hcompact X hX have hvanish : ∀ t : ℝ, max R 0 < t → F ((t : ℂ) * Complex.I) = 0 := by intro t ht change ProbabilityTheory.complexMGF (fun x : Euclidean d => -2 * Real.pi * @inner ℝ (Euclidean d) _ x e) (nonnegativeSchwartzMeasure g hg) ((t : ℂ) * Complex.I) = 0 rw [nonnegativeSchwartz_complexMGF_mul_I g hreal hg e t, hfixed] by_contra hnonzero have hsupp : t • e ∈ Function.support (g : Euclidean d → ℂ) := by exact hnonzero have hbound : ‖t • e‖ ≤ R := by have hball := hR (subset_tsupport (g : Euclidean d → ℂ) hsupp) simpa only [Metric.mem_closedBall, dist_zero_right] using! hball have htpos : 0 < t := (le_max_right R 0).trans_lt ht have hnorm : ‖t • e‖ = t := by rw [norm_smul, Real.norm_eq_abs, abs_of_pos htpos, he, mul_one] rw [hnorm] at hbound exact (not_le_of_gt ((le_max_left R 0).trans_lt ht)) hbound have hFzero : F = 0 := analytic_eq_zero_of_imaginary_ray F hanalytic (max R 0) hvanish have hFzero_at_zero : F 0 = 0 := by simpa using! congrFun hFzero (0 : ℂ) have hfourierzero : ((𝓕 g : TestFunction d) (0 : Euclidean d)) = 0 := by have hmomentzero : ProbabilityTheory.complexMGF (fun x : Euclidean d => -2 * Real.pi * @inner ℝ (Euclidean d) _ x e) (nonnegativeSchwartzMeasure g hg) 0 = 0 := by exact hFzero_at_zero calc ((𝓕 g : TestFunction d) (0 : Euclidean d)) = ProbabilityTheory.complexMGF (fun x : Euclidean d => -2 * Real.pi * @inner ℝ (Euclidean d) _ x e) (nonnegativeSchwartzMeasure g hg) ((0 : ℂ) * Complex.I) := by simpa using! (nonnegativeSchwartz_complexMGF_mul_I g hreal hg e 0).symm _ = 0 := by simpa using! hmomentzero have hfourier_integral : ((𝓕 g : TestFunction d) (0 : Euclidean d)) = ∫ x : Euclidean d, g x := by change (𝓕 (g : Euclidean d → ℂ)) 0 = _ rw [Real.fourier_eq'] simp have hintegral : (∫ x : Euclidean d, (g x).re) = 0 := by calc (∫ x : Euclidean d, (g x).re) = (∫ x : Euclidean d, g x).re := integral_re g.integrable _ = ((𝓕 g : TestFunction d) (0 : Euclidean d)).re := by rw [hfourier_integral] _ = 0 := by rw [hfourierzero]; rfl by_contra hnonzero have hreal_nonzero : (fun x : Euclidean d => (g x).re) ≠ 0 := by intro hzero apply hnonzero ext x apply Complex.ext · simpa using! congrFun hzero x · simpa using! hreal x obtain ⟨x, hx⟩ : ∃ x : Euclidean d, (g x).re ≠ 0 := by by_contra hnone push Not at hnone apply hreal_nonzero funext x simpa using! hnone x have hpositive : 0 < ∫ x : Euclidean d, (g x).re := integral_pos_of_integrable_nonneg_nonzero (Complex.continuous_re.comp g.continuous) g.integrable.re hg hx exact (ne_of_gt hpositive) hintegral theorem balancedAntiFourierPart_ne_zero {d : ℕ} (f : Admissible d) (hd : 0 < d) : balancedAntiFourierPart f ≠ 0 := by intro hzero have hself := (balancedAntiFourierPart_eq_zero_iff f).mp hzero have hcompact := balancedFunction_hasCompactSupport_of_anti_zero f hzero have hnonneg : ∀ x : Euclidean d, 0 ≤ (balancedFunction f x).re := by intro x rw [← hself] exact balancedFunction_fourier_nonneg f x have hvanish := nonnegative_compact_fourier_fixed_eq_zero hd (balancedFunction f) (balancedFunction_real f) hnonneg hcompact hself have horigin := congrArg (fun g : TestFunction d => (g (0 : Euclidean d)).re) hvanish have hpos : 0 < (balancedFunction f (0 : Euclidean d)).re := by simpa using! admissible_zero_pos f simpa using! hpos.ne' horigin def AntiFourierWitness.monoRadius {d : ℕ} {R S : ℝ} (w : AntiFourierWitness d R) (hRS : R ≤ S) : AntiFourierWitness d S where function := w.function real := w.real radial := w.radial nonzero := w.nonzero anti_fourier := w.anti_fourier zero_value := w.zero_value eventually_nonneg := fun x hx => w.eventually_nonneg x (hRS.trans hx) def balancedAntiFourierWitness {d : ℕ} (f : Admissible d) (hd : 0 < d) : AntiFourierWitness d (balancingScale f)⁻¹ where function := balancedAntiFourierPart f real := balancedAntiFourierPart_real f radial := balancedAntiFourierPart_radial f nonzero := balancedAntiFourierPart_ne_zero f hd anti_fourier := fourier_balancedAntiFourierPart f zero_value := balancedAntiFourierPart_zero f hd eventually_nonneg := balancedAntiFourierPart_nonneg f theorem normalizedCost_ge_of_no_antiFourierWitness {d : ℕ} (f : Admissible d) (hd : 0 < d) (c : ℝ) (hno : IsEmpty (AntiFourierWitness d (c * Real.sqrt (d : ℝ)))) : c ≤ normalizedCost f := by by_contra hnot have hcost : normalizedCost f < c := lt_of_not_ge hnot have hradius : (balancingScale f)⁻¹ ≤ c * Real.sqrt (d : ℝ) := by rw [balancingScale_inv_eq_normalizedCost_mul_sqrt f hd] exact mul_le_mul_of_nonneg_right hcost.le (Real.sqrt_nonneg _) exact hno.false ((balancedAntiFourierWitness f hd).monoRadius hradius) end noncomputable section open MeasureTheory Metric open scoped ENNReal theorem sqrt_pi_pow_eq_rpow (d : ℕ) : Real.sqrt Real.pi ^ d = Real.pi ^ ((d : ℝ) / 2) := by rw [Real.sqrt_eq_rpow, ← Real.rpow_natCast, ← Real.rpow_mul Real.pi_nonneg] congr 1 ring theorem volume_unitBall {d : ℕ} (hd : 0 < d) : volume (ball (0 : Euclidean d) (1 : ℝ)) = ENNReal.ofReal (unitBallVolume d) := by letI : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd simpa [Fintype.card_fin, unitBallVolume, sqrt_pi_pow_eq_rpow] using! (EuclideanSpace.volume_ball (Fin d) (0 : Euclidean d) (1 : ℝ)) theorem unitBallVolume_even (k : ℕ) : unitBallVolume (2 * k) = Real.pi ^ k / (k.factorial : ℝ) := by unfold unitBallVolume have hhalf : ((↑(2 * k) : ℝ) / 2) = (k : ℝ) := by push_cast ring rw [hhalf, Real.rpow_natCast, Real.Gamma_nat_eq_factorial] end noncomputable section open Filter MeasureTheory Metric Set open scoped FourierTransform SchwartzMap Topology ENNReal def radialUnitDirection {d : ℕ} (hd : 0 < d) : Euclidean d := (EuclideanSpace.basisFun (Fin d) ℝ) ⟨0, hd⟩ theorem norm_radialUnitDirection {d : ℕ} (hd : 0 < d) : ‖radialUnitDirection hd‖ = 1 := by unfold radialUnitDirection exact (EuclideanSpace.basisFun (Fin d) ℝ).norm_eq_one _ def radialProfile {d : ℕ} (hd : 0 < d) (f : TestFunction d) (r : ℝ) : ℂ := f (r • radialUnitDirection hd) theorem radialProfile_norm {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (x : Euclidean d) : radialProfile hd f ‖x‖ = f x := by unfold radialProfile apply hf simp [norm_smul, norm_radialUnitDirection hd] theorem radialProfile_neg {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (r : ℝ) : radialProfile hd f (-r) = radialProfile hd f r := by unfold radialProfile apply hf simp [norm_smul, norm_radialUnitDirection hd] theorem radialProfile_continuous {d : ℕ} (hd : 0 < d) (f : TestFunction d) : Continuous (radialProfile hd f) := by unfold radialProfile exact f.continuous.comp (continuous_id.smul continuous_const) @[simp] theorem radialProfile_zero {d : ℕ} (hd : 0 < d) (f : TestFunction d) : radialProfile hd f 0 = f (0 : Euclidean d) := by simp [radialProfile] theorem radialProfile_real {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRealValued f) (r : ℝ) : (radialProfile hd f r).im = 0 := hf (r • radialUnitDirection hd) theorem volume_real_unitBall {d : ℕ} (hd : 0 < d) : volume.real (ball (0 : Euclidean d) (1 : ℝ)) = unitBallVolume d := by change (volume (ball (0 : Euclidean d) (1 : ℝ))).toReal = unitBallVolume d rw [volume_unitBall hd, ENNReal.toReal_ofReal (unitBallVolume_pos d).le] def radialSurfaceArea (d : ℕ) : ℝ := (d : ℝ) * unitBallVolume d theorem radialSurfaceArea_pos {d : ℕ} (hd : 0 < d) : 0 < radialSurfaceArea d := by unfold radialSurfaceArea exact mul_pos (by exact_mod_cast hd) (unitBallVolume_pos d) theorem integral_radialProfile_mul {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (w : ℝ → ℂ) : (∫ x : Euclidean d, f x * w ‖x‖) = radialSurfaceArea d • ∫ r : ℝ in Ioi 0, r ^ (d - 1) • (radialProfile hd f r * w r) := by letI : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd calc (∫ x : Euclidean d, f x * w ‖x‖) = ∫ x : Euclidean d, radialProfile hd f ‖x‖ * w ‖x‖ := by apply integral_congr_ae filter_upwards [] with x rw [radialProfile_norm hd f hf x] _ = radialSurfaceArea d • ∫ r : ℝ in Ioi 0, r ^ (d - 1) • (radialProfile hd f r * w r) := by simpa [radialSurfaceArea, volume_real_unitBall hd, nsmul_eq_mul, finrank_euclideanSpace_fin, mul_assoc] using! (integral_fun_norm_addHaar (volume : Measure (Euclidean d)) (fun r : ℝ => radialProfile hd f r * w r)) theorem integral_radialProfile_cpow {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (s : ℂ) : (∫ x : Euclidean d, f x * (‖x‖ : ℂ) ^ (s - (d : ℂ))) = radialSurfaceArea d • mellin (radialProfile hd f) s := by rw [integral_radialProfile_mul hd f hf (fun r : ℝ => (r : ℂ) ^ (s - (d : ℂ)))] congr 1 unfold mellin apply setIntegral_congr_fun measurableSet_Ioi intro r hr have hrzero : (r : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (ne_of_gt hr) have hcast : (((r ^ (d - 1) : ℝ) : ℂ)) = (r : ℂ) ^ ((d - 1 : ℕ) : ℂ) := by rw [Complex.cpow_natCast] norm_cast have hexponent : (((d - 1 : ℕ) : ℂ)) + (s - (d : ℂ)) = s - 1 := by rw [Nat.cast_sub hd] norm_num change (((r ^ (d - 1) : ℝ) : ℂ)) * (radialProfile hd f r * (r : ℂ) ^ (s - (d : ℂ))) = (r : ℂ) ^ (s - 1) * radialProfile hd f r rw [hcast] have hpower : (r : ℂ) ^ ((d - 1 : ℕ) : ℂ) * (r : ℂ) ^ (s - (d : ℂ)) = (r : ℂ) ^ (s - 1) := by rw [← Complex.cpow_add _ _ hrzero, hexponent] calc (r : ℂ) ^ ((d - 1 : ℕ) : ℂ) * (radialProfile hd f r * (r : ℂ) ^ (s - (d : ℂ))) = ((r : ℂ) ^ ((d - 1 : ℕ) : ℂ) * (r : ℂ) ^ (s - (d : ℂ))) * radialProfile hd f r := by ring _ = (r : ℂ) ^ (s - 1) * radialProfile hd f r := by rw [hpower] def radialMellinFrequency {d : ℕ} (hd : 0 < d) (f : TestFunction d) (t : ℝ) : ℂ := mellinFrequency ((d : ℝ) / 2) (radialProfile hd f) t theorem radialMellinFrequency_eq_fourier {d : ℕ} (hd : 0 < d) (f : TestFunction d) (t : ℝ) : radialMellinFrequency hd f t = (𝓕 (fun u : ℝ => Real.exp (-((d : ℝ) / 2) * u) • radialProfile hd f (Real.exp (-u)))) (-t / (2 * Real.pi)) := by exact mellinFrequency_eq_fourier ((d : ℝ) / 2) (radialProfile hd f) t end noncomputable section open Filter MeasureTheory Set open scoped FourierTransform SchwartzMap Topology RealInnerProductSpace def gaussianMellinWeight (d : ℕ) (a : ℝ) (x : Euclidean d) : ℂ := Complex.exp (-((a : ℂ) * (‖x‖ : ℂ) ^ 2)) theorem gaussianMellin_fourier_radial {d : ℕ} {f : TestFunction d} (hf : IsRadial f) : IsRadial (𝓕 f : TestFunction d) := by intro x y hxy let A : Euclidean d ≃ₗᵢ[ℝ] Euclidean d := Submodule.reflection (ℝ ∙ (x - y))ᗮ have hA : A x = y := Submodule.reflection_sub hxy have hcomp : (f : Euclidean d → ℂ) ∘ A = f := by funext z exact hf (A z) z (A.norm_map z) change (𝓕 (f : Euclidean d → ℂ)) x = (𝓕 (f : Euclidean d → ℂ)) y calc (𝓕 (f : Euclidean d → ℂ)) x = (𝓕 ((f : Euclidean d → ℂ) ∘ A)) x := by rw [hcomp] _ = (𝓕 (f : Euclidean d → ℂ)) (A x) := Real.fourier_comp_linearIsometry A (f : Euclidean d → ℂ) x _ = (𝓕 (f : Euclidean d → ℂ)) y := by rw [hA] theorem gaussianMellinWeight_integrable {d : ℕ} (a : ℝ) (ha : 0 < a) : Integrable (gaussianMellinWeight d a) (volume : Measure (Euclidean d)) := by have hcomplex : 0 < (a : ℂ).re := by simpa using! ha simpa [gaussianMellinWeight] using! (GaussianFourier.integrable_cexp_neg_mul_sq_norm_add (V := Euclidean d) hcomplex (0 : ℂ) (0 : Euclidean d)) theorem fourier_gaussianMellinWeight {d : ℕ} (a : ℝ) (ha : 0 < a) (ξ : Euclidean d) : (𝓕 (gaussianMellinWeight d a) : Euclidean d → ℂ) ξ = ((Real.pi : ℂ) / (a : ℂ)) ^ ((d : ℂ) / 2) * Complex.exp (-((Real.pi : ℂ) ^ 2) * (‖ξ‖ : ℂ) ^ 2 / (a : ℂ)) := by have hcomplex : 0 < (a : ℂ).re := by simpa using! ha simpa [gaussianMellinWeight, finrank_euclideanSpace] using! (fourier_gaussian_innerProductSpace (V := Euclidean d) hcomplex ξ) theorem fourier_gaussianMellin_pairing {d : ℕ} (f : TestFunction d) (a : ℝ) (ha : 0 < a) : (∫ ξ : Euclidean d, ((𝓕 f : TestFunction d) ξ) * gaussianMellinWeight d a ξ) = ∫ x : Euclidean d, f x * (((Real.pi : ℂ) / (a : ℂ)) ^ ((d : ℂ) / 2) * Complex.exp (-((Real.pi : ℂ) ^ 2) * (‖x‖ : ℂ) ^ 2 / (a : ℂ))) := by have hflip : (innerₗ (Euclidean d)).flip = innerₗ (Euclidean d) := by ext x y change @inner ℝ (Euclidean d) _ y x = @inner ℝ (Euclidean d) _ x y exact real_inner_comm x y calc (∫ ξ : Euclidean d, ((𝓕 f : TestFunction d) ξ) * gaussianMellinWeight d a ξ) = ∫ ξ : Euclidean d, (𝓕 (f : Euclidean d → ℂ)) ξ * gaussianMellinWeight d a ξ := by apply integral_congr_ae filter_upwards [] with ξ exact congrArg (fun z : ℂ => z * gaussianMellinWeight d a ξ) (congrFun (SchwartzMap.fourier_coe f) ξ) _ = ∫ x : Euclidean d, f x * (𝓕 (gaussianMellinWeight d a) : Euclidean d → ℂ) x := by simpa only [smul_eq_mul, hflip] using! (VectorFourier.integral_fourierIntegral_smul_eq_flip (L := innerₗ (Euclidean d)) (μ := (volume : Measure (Euclidean d))) (ν := (volume : Measure (Euclidean d))) (f := (f : Euclidean d → ℂ)) (g := gaussianMellinWeight d a) Real.continuous_fourierChar continuous_inner f.integrable (gaussianMellinWeight_integrable a ha)) _ = ∫ x : Euclidean d, f x * (((Real.pi : ℂ) / (a : ℂ)) ^ ((d : ℂ) / 2) * Complex.exp (-((Real.pi : ℂ) ^ 2) * (‖x‖ : ℂ) ^ 2 / (a : ℂ))) := by apply integral_congr_ae filter_upwards [] with x rw [fourier_gaussianMellinWeight a ha x] theorem schwartz_mul_norm_cpow_integrable {d : ℕ} (hd : 0 < d) (f : TestFunction d) (z : ℂ) (hlower : -(d : ℝ) < z.re) (hupper : z.re ≤ 0) : Integrable (fun x : Euclidean d => f x * (‖x‖ : ℂ) ^ z) (volume : Measure (Euclidean d)) := by letI : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd have hpow : Measurable (fun x : Euclidean d => (‖x‖ : ℂ) ^ z) := by apply measurable_of_continuousOn_compl_singleton (0 : Euclidean d) apply continuousOn_of_forall_continuousAt intro x hx have hxzero : x ≠ 0 := by simpa only [mem_compl_iff, mem_singleton_iff] using! hx exact (Complex.continuousAt_ofReal_cpow_const ‖x‖ z (Or.inr (norm_ne_zero_iff.mpr hxzero))).comp continuous_norm.continuousAt have hmeas : AEStronglyMeasurable (fun x : Euclidean d => f x * (‖x‖ : ℂ) ^ z) (volume : Measure (Euclidean d)) := (f.continuous.measurable.mul hpow).aestronglyMeasurable have hdim : 1 ≤ Module.finrank ℝ (Euclidean d) := by rw [finrank_euclideanSpace_fin] omega have hexponent : -z.re < (Module.finrank ℝ (Euclidean d) : ℝ) := by rw [finrank_euclideanSpace_fin] exact (neg_lt_of_neg_lt hlower) have hinner : IntegrableOn (fun x : Euclidean d => f x * (‖x‖ : ℂ) ^ z) (Metric.ball 0 1) (volume : Measure (Euclidean d)) := by apply MeasureTheory.integrableOn_ball_of_norm_le_rpow hdim hexponent (C := SchwartzMap.seminorm ℝ 0 0 f) (r := 1) · filter_upwards [ae_restrict_of_ae ((volume : Measure (Euclidean d)).ae_ne (0 : Euclidean d))] with x hx rw [norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos (norm_pos_iff.mpr hx), neg_neg] exact mul_le_mul_of_nonneg_right (SchwartzMap.norm_le_seminorm ℝ f x) (Real.rpow_nonneg (norm_nonneg x) z.re) · exact hmeas have houter : IntegrableOn (fun x : Euclidean d => f x * (‖x‖ : ℂ) ^ z) (Metric.ball (0 : Euclidean d) 1)ᶜ (volume : Measure (Euclidean d)) := by refine (f.integrable.norm.restrict).mono' hmeas.restrict ?_ filter_upwards [ae_restrict_mem (Metric.isOpen_ball.measurableSet.compl)] with x hx have hnorm : 1 ≤ ‖x‖ := by have hnot : ¬ ‖x‖ < (1 : ℝ) := by simpa [Metric.mem_ball, dist_zero_right] using! hx exact le_of_not_gt hnot rw [norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos (lt_of_lt_of_le zero_lt_one hnorm)] calc ‖f x‖ * ‖x‖ ^ z.re ≤ ‖f x‖ * 1 := mul_le_mul_of_nonneg_left (Real.rpow_le_one_of_one_le_of_nonpos hnorm hupper) (norm_nonneg _) _ = ‖f x‖ := mul_one _ have hglobal := hinner.union houter rwa [union_compl_self, integrableOn_univ] at hglobal theorem gaussianMellinParameter_integrable (b : ℂ) (hb : 0 < b.re) (r : ℝ) (hr : 0 < r) : IntegrableOn (fun a : ℝ => (a : ℂ) ^ (b - 1) * Complex.exp (-((r : ℂ) * (a : ℂ)))) (Ioi 0) := by have hmeas : AEStronglyMeasurable (fun a : ℝ => (a : ℂ) ^ (b - 1) * Complex.exp (-((r : ℂ) * (a : ℂ)))) (volume.restrict (Ioi (0 : ℝ))) := by apply ContinuousOn.aestronglyMeasurable _ measurableSet_Ioi apply continuousOn_of_forall_continuousAt intro a ha apply (Complex.continuousAt_ofReal_cpow_const a (b - 1) (Or.inr (ne_of_gt ha))).mul fun_prop have hreal : IntegrableOn (fun a : ℝ => a ^ (b.re - 1) * Real.exp (-(r * a))) (Ioi 0) := by simpa only [Real.rpow_one, neg_mul] using! (integrableOn_rpow_mul_exp_neg_mul_rpow (p := (1 : ℝ)) (s := b.re - 1) (b := r) (by linarith) (by norm_num) hr) apply (integrable_norm_iff hmeas).mp apply hreal.congr_fun _ measurableSet_Ioi intro a ha try dsimp rw [norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos ha, Complex.norm_exp] simp theorem gaussianMellinParameter_norm_integral (b : ℂ) (hb : 0 < b.re) (r : ℝ) (hr : 0 < r) : (∫ a : ℝ in Ioi 0, ‖(a : ℂ) ^ (b - 1) * Complex.exp (-((r : ℂ) * (a : ℂ)))‖) = (1 / r) ^ b.re * Real.Gamma b.re := by calc (∫ a : ℝ in Ioi 0, ‖(a : ℂ) ^ (b - 1) * Complex.exp (-((r : ℂ) * (a : ℂ)))‖) = ∫ a : ℝ in Ioi 0, a ^ (b.re - 1) * Real.exp (-(r * a)) := by apply setIntegral_congr_fun measurableSet_Ioi intro a ha try dsimp rw [norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos ha, Complex.norm_exp] simp _ = (1 / r) ^ b.re * Real.Gamma b.re := Real.integral_rpow_mul_exp_neg_mul_Ioi hb hr theorem gaussianMellin_inv_sq_rpow (r b : ℝ) (hr : 0 ≤ r) : (1 / r ^ 2) ^ b = r ^ (-(2 * b)) := by calc (1 / r ^ 2) ^ b = (r ^ 2) ^ (-b) := by rw [one_div, Real.rpow_neg_eq_inv_rpow] _ = r ^ ((2 : ℝ) * (-b)) := by simpa using! (Real.rpow_natCast_mul hr 2 (-b)).symm _ = r ^ (-(2 * b)) := by congr 1 ring theorem gaussianMellin_inv_sq_cpow (r : ℝ) (hr : 0 ≤ r) (b : ℂ) : (1 / (((r ^ 2 : ℝ) : ℂ))) ^ b = (r : ℂ) ^ (-(2 * b)) := by calc (1 / (((r ^ 2 : ℝ) : ℂ))) ^ b = (((r ^ (-2 : ℝ) : ℝ) : ℂ)) ^ b := by rw [Real.rpow_neg hr, Real.rpow_two, Complex.ofReal_inv] simp only [one_div] _ = (r : ℂ) ^ (((-2 : ℝ) : ℂ) * b) := (Complex.cpow_mul_ofReal_nonneg hr (-2) b).symm _ = (r : ℂ) ^ (-(2 * b)) := by congr 1 push_cast ring theorem gaussianMellin_div_cpow (p a : ℝ) (hp : 0 < p) (ha : 0 < a) (b : ℂ) : ((p : ℂ) / (a : ℂ)) ^ b = (p : ℂ) ^ b * (a : ℂ) ^ (-b) := by have hinv : (((a⁻¹ : ℝ) : ℂ)) ^ b = (a : ℂ) ^ (-b) := by simpa [Real.rpow_neg_one] using! (Complex.cpow_mul_ofReal_nonneg ha.le (-1) b).symm calc ((p : ℂ) / (a : ℂ)) ^ b = ((p : ℂ) * (((a⁻¹ : ℝ) : ℂ))) ^ b := by rw [Complex.ofReal_inv] rfl _ = (p : ℂ) ^ b * (((a⁻¹ : ℝ) : ℂ)) ^ b := Complex.mul_cpow_ofReal_nonneg hp.le (inv_nonneg.mpr ha.le) b _ = (p : ℂ) ^ b * (a : ℂ) ^ (-b) := by rw [hinv] theorem gaussianMellin_pi_coefficient (b q : ℂ) : (Real.pi : ℂ) ^ q * (((Real.pi ^ 2 : ℝ) : ℂ) ^ (b - q)) = (Real.pi : ℂ) ^ (2 * b - q) := by have hsquare : (((Real.pi ^ 2 : ℝ) : ℂ) ^ (b - q)) = (Real.pi : ℂ) ^ (2 * (b - q)) := by simpa [Real.rpow_two] using! (Complex.cpow_mul_ofReal_nonneg Real.pi_pos.le (2 : ℝ) (b - q)).symm rw [hsquare, ← Complex.cpow_add _ _ (Complex.ofReal_ne_zero.mpr Real.pi_pos.ne')] congr 1 ring def gaussianMellinMixture {d : ℕ} (f : TestFunction d) (b : ℂ) (x : Euclidean d) (a : ℝ) : ℂ := f x * ((a : ℂ) ^ (b - 1) * Complex.exp (-((‖x‖ : ℂ) ^ 2 * (a : ℂ)))) theorem gaussianMellinMixture_integrable {d : ℕ} (hd : 0 < d) (f : TestFunction d) (b : ℂ) (hb : 0 < b.re) (hbd : 2 * b.re < (d : ℝ)) : Integrable (Function.uncurry (gaussianMellinMixture f b)) ((volume : Measure (Euclidean d)).prod (volume.restrict (Ioi (0 : ℝ)))) := by letI : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd have hpow : Measurable (fun a : ℝ => (a : ℂ) ^ (b - 1)) := by apply measurable_of_continuousOn_compl_singleton (0 : ℝ) apply continuousOn_of_forall_continuousAt intro a ha have hane : a ≠ 0 := by simpa only [mem_compl_iff, mem_singleton_iff] using! ha exact Complex.continuousAt_ofReal_cpow_const a (b - 1) (Or.inr hane) have hexp : Measurable (fun p : Euclidean d × ℝ => Complex.exp (-((‖p.1‖ : ℂ) ^ 2 * (p.2 : ℂ)))) := by fun_prop have hmeas : AEStronglyMeasurable (Function.uncurry (gaussianMellinMixture f b)) ((volume : Measure (Euclidean d)).prod (volume.restrict (Ioi (0 : ℝ)))) := by change AEStronglyMeasurable (fun p : Euclidean d × ℝ => f p.1 * ((p.2 : ℂ) ^ (b - 1) * Complex.exp (-((‖p.1‖ : ℂ) ^ 2 * (p.2 : ℂ))))) _ exact ((f.continuous.measurable.comp measurable_fst).mul ((hpow.comp measurable_snd).mul hexp)).aestronglyMeasurable apply (integrable_prod_iff hmeas).2 constructor · filter_upwards [(volume : Measure (Euclidean d)).ae_ne (0 : Euclidean d)] with x hx have hnorm : 0 < ‖x‖ := norm_pos_iff.mpr hx have hsquare : 0 < ‖x‖ ^ 2 := sq_pos_of_pos hnorm simpa only [gaussianMellinMixture, Complex.ofReal_pow] using! (gaussianMellinParameter_integrable b hb (‖x‖ ^ 2) hsquare).const_mul (f x) · have hnegative : -(d : ℝ) < ((-(2 * b.re) : ℝ) : ℂ).re := by simpa using! (show -(d : ℝ) < -(2 * b.re) by linarith) have hnonpositive : ((-(2 * b.re) : ℝ) : ℂ).re ≤ 0 := by simpa using! (show -(2 * b.re) ≤ 0 by linarith) have hrieszComplex := schwartz_mul_norm_cpow_integrable hd f ((-(2 * b.re) : ℝ) : ℂ) hnegative hnonpositive have hriesz : Integrable (fun x : Euclidean d => ‖f x‖ * ‖x‖ ^ (-(2 * b.re))) (volume : Measure (Euclidean d)) := by apply hrieszComplex.norm.congr filter_upwards [(volume : Measure (Euclidean d)).ae_ne (0 : Euclidean d)] with x hx rw [norm_mul, Complex.norm_cpow_eq_rpow_re_of_pos (norm_pos_iff.mpr hx)] simp apply (hriesz.mul_const (Real.Gamma b.re)).congr filter_upwards [(volume : Measure (Euclidean d)).ae_ne (0 : Euclidean d)] with x hx have hnorm : 0 < ‖x‖ := norm_pos_iff.mpr hx have hsquare : 0 < ‖x‖ ^ 2 := sq_pos_of_pos hnorm change (‖f x‖ * ‖x‖ ^ (-(2 * b.re))) * Real.Gamma b.re = ∫ a : ℝ in Ioi 0, ‖gaussianMellinMixture f b x a‖ calc (‖f x‖ * ‖x‖ ^ (-(2 * b.re))) * Real.Gamma b.re = ‖f x‖ * ((1 / ‖x‖ ^ 2) ^ b.re * Real.Gamma b.re) := by rw [gaussianMellin_inv_sq_rpow ‖x‖ b.re (norm_nonneg x)] ring _ = ‖f x‖ * (∫ a : ℝ in Ioi 0, ‖(a : ℂ) ^ (b - 1) * Complex.exp (-(((‖x‖ ^ 2 : ℝ) : ℂ) * (a : ℂ)))‖) := by rw [gaussianMellinParameter_norm_integral b hb (‖x‖ ^ 2) hsquare] _ = ∫ a : ℝ in Ioi 0, ‖f x‖ * ‖(a : ℂ) ^ (b - 1) * Complex.exp (-(((‖x‖ ^ 2 : ℝ) : ℂ) * (a : ℂ)))‖ := by rw [integral_const_mul] _ = ∫ a : ℝ in Ioi 0, ‖gaussianMellinMixture f b x a‖ := by apply setIntegral_congr_fun measurableSet_Ioi intro a _ simp only [gaussianMellinMixture, norm_mul, Complex.ofReal_pow] theorem gaussianMellinMixture_fubini {d : ℕ} (hd : 0 < d) (f : TestFunction d) (b : ℂ) (hb : 0 < b.re) (hbd : 2 * b.re < (d : ℝ)) : (∫ x : Euclidean d, ∫ a : ℝ in Ioi 0, gaussianMellinMixture f b x a) = ∫ a : ℝ in Ioi 0, ∫ x : Euclidean d, gaussianMellinMixture f b x a := by exact integral_integral_swap (gaussianMellinMixture_integrable hd f b hb hbd) theorem gaussianMellinMixture_parameter_integral {d : ℕ} (f : TestFunction d) (b : ℂ) (hb : 0 < b.re) (x : Euclidean d) (hx : x ≠ 0) : (∫ a : ℝ in Ioi 0, gaussianMellinMixture f b x a) = f x * ((‖x‖ : ℂ) ^ (-(2 * b)) * Complex.Gamma b) := by have hnorm : 0 < ‖x‖ := norm_pos_iff.mpr hx have hsquare : 0 < ‖x‖ ^ 2 := sq_pos_of_pos hnorm change (∫ a : ℝ in Ioi 0, f x * ((a : ℂ) ^ (b - 1) * Complex.exp (-((‖x‖ : ℂ) ^ 2 * (a : ℂ))))) = _ rw [integral_const_mul] have hgamma := Complex.integral_cpow_mul_exp_neg_mul_Ioi hb hsquare have hgamma' : (∫ a : ℝ in Ioi 0, (a : ℂ) ^ (b - 1) * Complex.exp (-((‖x‖ : ℂ) ^ 2 * (a : ℂ)))) = (1 / (((‖x‖ ^ 2 : ℝ) : ℂ))) ^ b * Complex.Gamma b := by simpa only [Complex.ofReal_pow] using! hgamma rw [hgamma', gaussianMellin_inv_sq_cpow ‖x‖ (norm_nonneg x) b] def gaussianMellinPairingProfile {d : ℕ} (f : TestFunction d) (a : ℝ) : ℂ := ∫ x : Euclidean d, f x * gaussianMellinWeight d a x theorem mellin_gaussianMellinPairingProfile {d : ℕ} (hd : 0 < d) (f : TestFunction d) (b : ℂ) (hb : 0 < b.re) (hbd : 2 * b.re < (d : ℝ)) : mellin (gaussianMellinPairingProfile f) b = Complex.Gamma b * (∫ x : Euclidean d, f x * (‖x‖ : ℂ) ^ (-(2 * b))) := by letI : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd unfold mellin simp only [smul_eq_mul] calc (∫ a : ℝ in Ioi 0, (a : ℂ) ^ (b - 1) * gaussianMellinPairingProfile f a) = ∫ a : ℝ in Ioi 0, ∫ x : Euclidean d, gaussianMellinMixture f b x a := by apply setIntegral_congr_fun measurableSet_Ioi intro a _ try dsimp unfold gaussianMellinPairingProfile rw [← integral_const_mul] apply integral_congr_ae filter_upwards [] with x simp only [gaussianMellinWeight, gaussianMellinMixture] have hexp : Complex.exp (-((a : ℂ) * (‖x‖ : ℂ) ^ 2)) = Complex.exp (-((‖x‖ : ℂ) ^ 2 * (a : ℂ))) := by congr 1 ring rw [hexp] ring _ = ∫ x : Euclidean d, ∫ a : ℝ in Ioi 0, gaussianMellinMixture f b x a := (gaussianMellinMixture_fubini hd f b hb hbd).symm _ = ∫ x : Euclidean d, f x * ((‖x‖ : ℂ) ^ (-(2 * b)) * Complex.Gamma b) := by apply integral_congr_ae filter_upwards [(volume : Measure (Euclidean d)).ae_ne (0 : Euclidean d)] with x hx exact gaussianMellinMixture_parameter_integral f b hb x hx _ = Complex.Gamma b * (∫ x : Euclidean d, f x * (‖x‖ : ℂ) ^ (-(2 * b))) := by rw [← integral_const_mul] apply integral_congr_ae filter_upwards [] with x ring theorem gaussianMellinPairingProfile_fourier {d : ℕ} (f : TestFunction d) (a : ℝ) (ha : 0 < a) : gaussianMellinPairingProfile (𝓕 f : TestFunction d) a = ((Real.pi : ℂ) / (a : ℂ)) ^ ((d : ℂ) / 2) * gaussianMellinPairingProfile f (Real.pi ^ 2 / a) := by unfold gaussianMellinPairingProfile rw [fourier_gaussianMellin_pairing f a ha, ← integral_const_mul] apply integral_congr_ae filter_upwards [] with x unfold gaussianMellinWeight push_cast have hexp : Complex.exp (-((Real.pi : ℂ) ^ 2) * (‖x‖ : ℂ) ^ 2 / (a : ℂ)) = Complex.exp (-((Real.pi : ℂ) ^ 2 / (a : ℂ) * (‖x‖ : ℂ) ^ 2)) := by congr 1 ring rw [hexp] ring theorem mellin_gaussianMellinPairingProfile_fourier {d : ℕ} (f : TestFunction d) (b : ℂ) : mellin (gaussianMellinPairingProfile (𝓕 f : TestFunction d)) b = (Real.pi : ℂ) ^ ((d : ℂ) / 2) * (((Real.pi ^ 2 : ℝ) : ℂ) ^ (b - (d : ℂ) / 2) * mellin (gaussianMellinPairingProfile f) ((d : ℂ) / 2 - b)) := by let q : ℂ := (d : ℂ) / 2 let P : ℝ := Real.pi ^ 2 have hP : 0 < P := by try dsimp [P] positivity have hrewrite : mellin (gaussianMellinPairingProfile (𝓕 f : TestFunction d)) b = mellin (fun a : ℝ => (Real.pi : ℂ) ^ q • ((a : ℂ) ^ (-q) • gaussianMellinPairingProfile f (P * a⁻¹))) b := by unfold mellin apply setIntegral_congr_fun measurableSet_Ioi intro a ha simp only [smul_eq_mul] rw [gaussianMellinPairingProfile_fourier f a ha] change (a : ℂ) ^ (b - 1) * (((Real.pi : ℂ) / (a : ℂ)) ^ q * gaussianMellinPairingProfile f (P / a)) = (a : ℂ) ^ (b - 1) * ((Real.pi : ℂ) ^ q * ((a : ℂ) ^ (-q) * gaussianMellinPairingProfile f (P * a⁻¹))) rw [gaussianMellin_div_cpow Real.pi a Real.pi_pos ha q, div_eq_mul_inv] ring calc mellin (gaussianMellinPairingProfile (𝓕 f : TestFunction d)) b = mellin (fun a : ℝ => (Real.pi : ℂ) ^ q • ((a : ℂ) ^ (-q) • gaussianMellinPairingProfile f (P * a⁻¹))) b := hrewrite _ = (Real.pi : ℂ) ^ q * mellin (fun a : ℝ => (a : ℂ) ^ (-q) • gaussianMellinPairingProfile f (P * a⁻¹)) b := by simpa only [smul_eq_mul] using! (mellin_const_smul (fun a : ℝ => (a : ℂ) ^ (-q) • gaussianMellinPairingProfile f (P * a⁻¹)) b ((Real.pi : ℂ) ^ q)) _ = (Real.pi : ℂ) ^ q * mellin (fun a : ℝ => gaussianMellinPairingProfile f (P * a⁻¹)) (b - q) := by rw [mellin_cpow_smul] simp only [sub_eq_add_neg] _ = (Real.pi : ℂ) ^ q * mellin (fun a : ℝ => gaussianMellinPairingProfile f (P * a)) (-(b - q)) := by rw [mellin_comp_inv (fun a : ℝ => gaussianMellinPairingProfile f (P * a)) (b - q)] _ = (Real.pi : ℂ) ^ q * ((P : ℂ) ^ (b - q) * mellin (gaussianMellinPairingProfile f) (q - b)) := by rw [mellin_comp_mul_left (gaussianMellinPairingProfile f) (-(b - q)) hP] simp only [smul_eq_mul, neg_sub] _ = (Real.pi : ℂ) ^ ((d : ℂ) / 2) * (((Real.pi ^ 2 : ℝ) : ℂ) ^ (b - (d : ℂ) / 2) * mellin (gaussianMellinPairingProfile f) ((d : ℂ) / 2 - b)) := by rfl theorem fourier_riesz_pairing {d : ℕ} (hd : 0 < d) (f : TestFunction d) (b : ℂ) (hb : 0 < b.re) (hbd : 2 * b.re < (d : ℝ)) : Complex.Gamma b * (∫ ξ : Euclidean d, (𝓕 f : TestFunction d) ξ * (‖ξ‖ : ℂ) ^ (-(2 * b))) = (Real.pi : ℂ) ^ ((d : ℂ) / 2) * (((Real.pi ^ 2 : ℝ) : ℂ) ^ (b - (d : ℂ) / 2) * (Complex.Gamma ((d : ℂ) / 2 - b) * (∫ x : Euclidean d, f x * (‖x‖ : ℂ) ^ (-(2 * ((d : ℂ) / 2 - b)))))) := by have hdual : 0 < (((d : ℂ) / 2 - b).re) := by norm_num linarith have hdual_dimension : 2 * (((d : ℂ) / 2 - b).re) < (d : ℝ) := by norm_num linarith calc Complex.Gamma b * (∫ ξ : Euclidean d, (𝓕 f : TestFunction d) ξ * (‖ξ‖ : ℂ) ^ (-(2 * b))) = mellin (gaussianMellinPairingProfile (𝓕 f : TestFunction d)) b := (mellin_gaussianMellinPairingProfile hd (𝓕 f : TestFunction d) b hb hbd).symm _ = (Real.pi : ℂ) ^ ((d : ℂ) / 2) * (((Real.pi ^ 2 : ℝ) : ℂ) ^ (b - (d : ℂ) / 2) * mellin (gaussianMellinPairingProfile f) ((d : ℂ) / 2 - b)) := mellin_gaussianMellinPairingProfile_fourier f b _ = (Real.pi : ℂ) ^ ((d : ℂ) / 2) * (((Real.pi ^ 2 : ℝ) : ℂ) ^ (b - (d : ℂ) / 2) * (Complex.Gamma ((d : ℂ) / 2 - b) * (∫ x : Euclidean d, f x * (‖x‖ : ℂ) ^ (-(2 * ((d : ℂ) / 2 - b)))))) := by rw [mellin_gaussianMellinPairingProfile hd f ((d : ℂ) / 2 - b) hdual hdual_dimension] theorem fourier_riesz_pairing_strip {d : ℕ} (hd : 0 < d) (f : TestFunction d) (s : ℂ) (hs : 0 < s.re) (hsd : s.re < (d : ℝ)) : Complex.Gamma (((d : ℂ) - s) / 2) * (∫ ξ : Euclidean d, (𝓕 f : TestFunction d) ξ * (‖ξ‖ : ℂ) ^ (s - (d : ℂ))) = (Real.pi : ℂ) ^ ((d : ℂ) / 2 - s) * (Complex.Gamma (s / 2) * (∫ x : Euclidean d, f x * (‖x‖ : ℂ) ^ (-s))) := by let b : ℂ := ((d : ℂ) - s) / 2 have hb : 0 < b.re := by try dsimp [b] norm_num linarith have hbd : 2 * b.re < (d : ℝ) := by try dsimp [b] norm_num linarith have hleft : -(2 * b) = s - (d : ℂ) := by try dsimp [b] ring have hdual : (d : ℂ) / 2 - b = s / 2 := by try dsimp [b] ring have hpi : 2 * b - (d : ℂ) / 2 = (d : ℂ) / 2 - s := by try dsimp [b] ring have hright : -(2 * (s / 2)) = -s := by ring have h := fourier_riesz_pairing hd f b hb hbd rw [← mul_assoc] at h rw [gaussianMellin_pi_coefficient b ((d : ℂ) / 2), hleft, hdual, hpi, hright] at h simpa only [b] using! h theorem radial_fourier_mellin_strip {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (s : ℂ) (hs : 0 < s.re) (hsd : s.re < (d : ℝ)) : mellin (radialProfile hd (𝓕 f : TestFunction d)) s = ((Real.pi : ℂ) ^ ((d : ℂ) / 2 - s) * Complex.Gamma (s / 2) / Complex.Gamma (((d : ℂ) - s) / 2)) * mellin (radialProfile hd f) ((d : ℂ) - s) := by have hdual : 0 < ((((d : ℂ) - s) / 2).re) := by norm_num linarith have hgamma : Complex.Gamma (((d : ℂ) - s) / 2) ≠ 0 := Complex.Gamma_ne_zero_of_re_pos hdual have hsurface : (radialSurfaceArea d : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (radialSurfaceArea_pos hd).ne' have hhat := integral_radialProfile_cpow hd (𝓕 f : TestFunction d) (gaussianMellin_fourier_radial hf) s have hprimal : (∫ x : Euclidean d, f x * (‖x‖ : ℂ) ^ (-s)) = radialSurfaceArea d • mellin (radialProfile hd f) ((d : ℂ) - s) := by have hexponent : ((d : ℂ) - s) - (d : ℂ) = -s := by ring simpa only [hexponent] using! (integral_radialProfile_cpow hd f hf ((d : ℂ) - s)) have h := fourier_riesz_pairing_strip hd f s hs hsd rw [hhat, hprimal] at h simp only [Complex.real_smul] at h have hcancel : Complex.Gamma (((d : ℂ) - s) / 2) * mellin (radialProfile hd (𝓕 f : TestFunction d)) s = (Real.pi : ℂ) ^ ((d : ℂ) / 2 - s) * (Complex.Gamma (s / 2) * mellin (radialProfile hd f) ((d : ℂ) - s)) := by apply mul_left_cancel₀ hsurface calc (radialSurfaceArea d : ℂ) * (Complex.Gamma (((d : ℂ) - s) / 2) * mellin (radialProfile hd (𝓕 f : TestFunction d)) s) = Complex.Gamma (((d : ℂ) - s) / 2) * ((radialSurfaceArea d : ℂ) * mellin (radialProfile hd (𝓕 f : TestFunction d)) s) := by ring _ = (Real.pi : ℂ) ^ ((d : ℂ) / 2 - s) * (Complex.Gamma (s / 2) * ((radialSurfaceArea d : ℂ) * mellin (radialProfile hd f) ((d : ℂ) - s))) := h _ = (radialSurfaceArea d : ℂ) * ((Real.pi : ℂ) ^ ((d : ℂ) / 2 - s) * (Complex.Gamma (s / 2) * mellin (radialProfile hd f) ((d : ℂ) - s))) := by ring calc mellin (radialProfile hd (𝓕 f : TestFunction d)) s = ((Real.pi : ℂ) ^ ((d : ℂ) / 2 - s) * (Complex.Gamma (s / 2) * mellin (radialProfile hd f) ((d : ℂ) - s))) / Complex.Gamma (((d : ℂ) - s) / 2) := by apply (eq_div_iff hgamma).2 simpa only [mul_comm] using! hcancel _ = ((Real.pi : ℂ) ^ ((d : ℂ) / 2 - s) * Complex.Gamma (s / 2) / Complex.Gamma (((d : ℂ) - s) / 2)) * mellin (radialProfile hd f) ((d : ℂ) - s) := by ring theorem radialMellinMultiplier {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (t : ℝ) : radialMellinFrequency hd (𝓕 f : TestFunction d) t = mellinMultiplier ((d : ℝ) / 2) t * radialMellinFrequency hd f (-t) := by let q : ℂ := (d : ℂ) / 2 let s : ℂ := q - Complex.I * (t : ℂ) have hs : 0 < s.re := by try dsimp [s, q] norm_num exact Nat.cast_pos.mpr hd have hsd : s.re < (d : ℝ) := by try dsimp [s, q] norm_num exact Nat.cast_pos.mpr hd have hphase : (Real.pi : ℂ) ^ ((d : ℂ) / 2 - s) = Complex.exp (Complex.I * (t : ℂ) * (Real.log Real.pi : ℂ)) := by have hexponent : (d : ℂ) / 2 - s = Complex.I * (t : ℂ) := by try dsimp [s, q] ring rw [hexponent, Complex.cpow_def_of_ne_zero (Complex.ofReal_ne_zero.mpr Real.pi_pos.ne'), ← Complex.ofReal_log Real.pi_pos.le] congr 1 ring have hcomplement : (d : ℂ) - s = q + Complex.I * (t : ℂ) := by try dsimp [s, q] ring have h := radial_fourier_mellin_strip hd f hf s hs hsd rw [hphase, hcomplement] at h unfold radialMellinFrequency mellinFrequency mellinMultiplier simpa [s, q, mul_neg, sub_neg_eq_add] using! h end noncomputable section open Filter Set MeasureTheory intervalIntegral open scoped ContDiff FourierTransform Interval RealInnerProductSpace Topology def shellOscillation (B T : ℝ) : ℝ := ∫ a in B..B + 1, (1 - Real.cos (a * T)) theorem shellOscillation_eq_sinc (B T : ℝ) : shellOscillation B T = 1 - Real.sinc (T / 2) * Real.cos ((B + 1 / 2) * T) := by unfold shellOscillation by_cases hT : T = 0 · simp [hT] · have hhalf : T / 2 ≠ 0 := by exact div_ne_zero hT (by norm_num) have hderiv (a : ℝ) : HasDerivAt (fun y : ℝ => y - Real.sin (y * T) / T) (1 - Real.cos (a * T)) a := by convert! (hasDerivAt_id a).sub (((Real.hasDerivAt_sin (a * T)).comp a ((hasDerivAt_id a).mul_const T)).div_const T) using 1 field_simp have hint : IntervalIntegrable (fun a : ℝ => 1 - Real.cos (a * T)) volume B (B + 1) := by have hc : Continuous (fun a : ℝ => 1 - Real.cos (a * T)) := by fun_prop exact hc.intervalIntegrable _ _ rw [intervalIntegral.integral_eq_sub_of_hasDerivAt (fun a _ => hderiv a) hint, Real.sinc_of_ne_zero hhalf] have hsin : Real.sin ((B + 1) * T) - Real.sin (B * T) = 2 * Real.sin (T / 2) * Real.cos ((B + 1 / 2) * T) := by rw [Real.sin_sub_sin] congr 2 <;> congr 1 <;> ring field_simp ring_nf at hsin ⊢ linarith theorem cos_le_quartic {x : ℝ} (hx0 : 0 ≤ x) (hx1 : x ≤ 1) : Real.cos x ≤ 1 - x ^ 2 / 2 + x ^ 4 * (5 / 96 : ℝ) := by have hbound := Real.cos_bound (show |x| ≤ 1 by simpa [abs_of_nonneg hx0] using! hx1) rw [abs_of_nonneg hx0] at hbound linarith [(le_abs_self (Real.cos x - (1 - x ^ 2 / 2)))] theorem sin_le_quintic {x : ℝ} (hx0 : 0 ≤ x) (hx1 : x ≤ 1) : Real.sin x ≤ x - x ^ 3 / 6 + x ^ 5 / 96 := by have hpoly : Continuous (fun t : ℝ => 1 - t ^ 2 / 2 + t ^ 4 * (5 / 96 : ℝ)) := by fun_prop have hmono := intervalIntegral.integral_mono_on (μ := volume) hx0 (Real.continuous_cos.intervalIntegrable 0 x) (hpoly.intervalIntegrable 0 x) (fun t ht => cos_le_quartic ht.1 (ht.2.trans hx1)) simp only [integral_cos, Real.sin_zero, sub_zero] at hmono have hderiv (t : ℝ) : HasDerivAt (fun y : ℝ => y - y ^ 3 / 6 + y ^ 5 / 96) (1 - t ^ 2 / 2 + t ^ 4 * (5 / 96 : ℝ)) t := by convert! ((hasDerivAt_id t).sub (((hasDerivAt_id t).pow 3).div_const 6)).add (((hasDerivAt_id t).pow 5).div_const 96) using 1; simp [id]; ring rw [intervalIntegral.integral_eq_sub_of_hasDerivAt (fun t _ => hderiv t) (hpoly.intervalIntegrable 0 x)] at hmono norm_num at hmono exact hmono theorem sin_le_linear_sub_cubic {x : ℝ} (hx0 : 0 ≤ x) (hxhalf : x ≤ (1 / 2 : ℝ)) : Real.sin x ≤ x - (4 / 25 : ℝ) * x ^ 3 := by have hx1 : x ≤ (1 : ℝ) := by linarith have hsin := sin_le_quintic hx0 hx1 have hsq : x ^ 2 ≤ (1 / 4 : ℝ) := by nlinarith [mul_nonneg hx0 (sub_nonneg.mpr hxhalf)] have hcub : 0 ≤ x ^ 3 := pow_nonneg hx0 _ have hfifth : x ^ 5 ≤ x ^ 3 / 4 := by have hprod := mul_nonneg hcub (sub_nonneg.mpr hsq) nlinarith [show x ^ 5 = x ^ 3 * x ^ 2 by ring] nlinarith theorem sinc_abs (x : ℝ) : Real.sinc |x| = Real.sinc x := by rcases le_total 0 x with hx | hx · rw [abs_of_nonneg hx] · rw [abs_of_nonpos hx, Real.sinc_neg] theorem sinc_quadratic_gap_nonneg {x : ℝ} (hx0 : 0 ≤ x) (hxhalf : x ≤ (1 / 2 : ℝ)) : (4 / 25 : ℝ) * x ^ 2 ≤ 1 - |Real.sinc x| := by rcases hx0.eq_or_lt with rfl | hxpos · norm_num have hxpi : x ≤ Real.pi := by linarith [Real.pi_gt_three] have hsin0 : 0 ≤ Real.sin x := Real.sin_nonneg_of_nonneg_of_le_pi hxpos.le hxpi rw [Real.sinc_of_ne_zero hxpos.ne', abs_of_nonneg (div_nonneg hsin0 hxpos.le)] have hsin := sin_le_linear_sub_cubic hxpos.le hxhalf have hfrac : Real.sin x / x ≤ 1 - (4 / 25 : ℝ) * x ^ 2 := by apply (div_le_iff₀ hxpos).2 nlinarith linarith theorem abs_sinc_le_twentyfour_twentyfive {x : ℝ} (hx : (1 / 2 : ℝ) ≤ x) : |Real.sinc x| ≤ (24 / 25 : ℝ) := by have hxpos : 0 < x := by linarith have hhalf : Real.sin (1 / 2 : ℝ) ≤ (12 / 25 : ℝ) := by have h := sin_le_quintic (x := (1 / 2 : ℝ)) (by norm_num) (by norm_num) norm_num at h ⊢ linarith by_cases hxpi : x ≤ Real.pi · have hsin0 := Real.sin_nonneg_of_nonneg_of_le_pi hxpos.le hxpi rw [Real.sinc_of_ne_zero hxpos.ne', abs_of_nonneg (div_nonneg hsin0 hxpos.le)] have hend : Real.sin (1 / 2 : ℝ) / (1 / 2 : ℝ) ≤ (24 / 25 : ℝ) := by apply (div_le_iff₀ (by norm_num : (0 : ℝ) < 1 / 2)).2 nlinarith rcases hx.eq_or_lt with heq | hlt · subst x exact hend · have hslope := strictConcaveOn_sin_Icc.secant_strict_mono (a := (0 : ℝ)) (x := (1 / 2 : ℝ)) (y := x) ⟨le_rfl, Real.pi_pos.le⟩ ⟨by norm_num, by linarith [Real.pi_gt_three]⟩ ⟨hxpos.le, hxpi⟩ (by norm_num) hxpos.ne' hlt simp only [Real.sin_zero, sub_zero] at hslope exact hslope.le.trans hend · have hbig : Real.pi ≤ x := le_of_not_ge hxpi rw [Real.sinc_of_ne_zero hxpos.ne', abs_div, abs_of_nonneg hxpos.le] apply (div_le_iff₀ hxpos).2 have hsin := Real.abs_sin_le_one x nlinarith [Real.pi_gt_three] theorem sinc_explicit (T : ℝ) : (1 / 25 : ℝ) * min (T ^ 2) 1 ≤ 1 - |Real.sinc (T / 2)| := by have hsinc : Real.sinc (T / 2) = Real.sinc (|T| / 2) := by rw [← sinc_abs (T / 2)] simp [abs_div] by_cases hsmall : |T| ≤ 1 · have hxhalf : |T| / 2 ≤ (1 / 2 : ℝ) := by linarith have hgap := sinc_quadratic_gap_nonneg (x := |T| / 2) (by positivity) hxhalf have hsq : T ^ 2 ≤ (1 : ℝ) := by have habsq : |T| ^ 2 ≤ (1 : ℝ) := by nlinarith [mul_nonneg (abs_nonneg T) (sub_nonneg.mpr hsmall)] simpa only [sq_abs] using! habsq have hscaled : (4 / 25 : ℝ) * (|T| / 2) ^ 2 = (1 / 25 : ℝ) * T ^ 2 := by rw [div_pow, sq_abs] ring rw [min_eq_left hsq, hsinc] rwa [← hscaled] · have hlarge : 1 ≤ |T| := le_of_not_ge hsmall have hsq : (1 : ℝ) ≤ T ^ 2 := by have habsq : (1 : ℝ) ≤ |T| ^ 2 := by nlinarith [sq_nonneg (|T| - 1)] simpa only [sq_abs] using! habsq have hgap := abs_sinc_le_twentyfour_twentyfive (x := |T| / 2) (by linarith) rw [min_eq_right hsq, hsinc] linarith theorem shellOscillation_lower_bound (B T : ℝ) : (1 / 25 : ℝ) * min (T ^ 2) 1 ≤ shellOscillation B T := by rw [shellOscillation_eq_sinc] have hcos := Real.abs_cos_le_one ((B + 1 / 2) * T) have hprod : Real.sinc (T / 2) * Real.cos ((B + 1 / 2) * T) ≤ |Real.sinc (T / 2)| := by calc _ ≤ |Real.sinc (T / 2) * Real.cos ((B + 1 / 2) * T)| := le_abs_self _ _ = |Real.sinc (T / 2)| * |Real.cos ((B + 1 / 2) * T)| := abs_mul _ _ _ ≤ |Real.sinc (T / 2)| := by nlinarith [abs_nonneg (Real.sinc (T / 2))] linarith [sinc_explicit T] theorem cosh_ratio_lower {a δ : ℝ} (ha : 0 ≤ a) (hδ : 0 ≤ δ) : Real.exp (δ * a) / 2 ≤ Real.cosh ((1 + δ) * a) / Real.cosh a := by apply (le_div_iff₀ (Real.cosh_pos a)).2 rw [show (1 + δ) * a = a + δ * a by ring, Real.cosh_add] have hq : Real.exp (δ * a) / 2 ≤ Real.cosh (δ * a) := by rw [Real.cosh_eq] linarith [Real.exp_pos (-(δ * a))] calc Real.exp (δ * a) / 2 * Real.cosh a = Real.cosh a * (Real.exp (δ * a) / 2) := by ring _ ≤ Real.cosh a * Real.cosh (δ * a) := by exact mul_le_mul_of_nonneg_left hq (Real.cosh_pos a).le _ ≤ Real.cosh a * Real.cosh (δ * a) + Real.sinh a * Real.sinh (δ * a) := by apply le_add_of_nonneg_right exact mul_nonneg (Real.sinh_nonneg_iff.mpr ha) (Real.sinh_nonneg_iff.mpr (mul_nonneg hδ ha)) theorem cosh_ratio_upper {a δ : ℝ} (ha : 0 ≤ a) (hδ : 0 ≤ δ) : Real.cosh ((1 + δ) * a) / Real.cosh a ≤ Real.exp (δ * a) := by apply (div_le_iff₀ (Real.cosh_pos a)).2 rw [show (1 + δ) * a = a + δ * a by ring, Real.cosh_add] have hs : Real.sinh a ≤ Real.cosh a := (Real.sinh_lt_cosh (x := a)).le have hq : 0 ≤ Real.sinh (δ * a) := Real.sinh_nonneg_iff.mpr (mul_nonneg hδ ha) calc Real.cosh a * Real.cosh (δ * a) + Real.sinh a * Real.sinh (δ * a) ≤ Real.cosh a * Real.cosh (δ * a) + Real.cosh a * Real.sinh (δ * a) := by gcongr _ = Real.cosh a * (Real.cosh (δ * a) + Real.sinh (δ * a)) := by ring _ = Real.exp (δ * a) * Real.cosh a := by rw [Real.cosh_eq (δ * a), Real.sinh_eq (δ * a)] ring def positiveShellDensity (ε a : ℝ) : ℝ := shellWeight ε / Real.cosh a def positiveShellDamping (ε ℓ δ T : ℝ) : ℝ := ℓ * ∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * Real.cosh ((1 + δ) * a) * (1 - Real.cos (a * T)) theorem positiveShellDamping_lower_bound {ε ℓ δ T : ℝ} (hε : 0 < ε) (hℓ : 0 ≤ ℓ) (hδ : 0 ≤ δ) : ℓ / 50 * shellWeight ε * Real.exp (δ * shellLocation ε) * min (T ^ 2) 1 ≤ positiveShellDamping ε ℓ δ T := by let B : ℝ := shellLocation ε let C : ℝ := shellWeight ε * Real.exp (δ * B) / 2 have hB : 0 ≤ B := by try dsimp [B, shellLocation] positivity have hQ : 0 < shellWeight ε := shellWeight_pos ε have hC : 0 ≤ C := by try dsimp [C] positivity have hden : Continuous (fun a : ℝ => positiveShellDensity ε a) := by unfold positiveShellDensity exact continuous_const.div Real.continuous_cosh (fun a => (Real.cosh_pos a).ne') have hosc : Continuous (fun a : ℝ => 1 - Real.cos (a * T)) := by fun_prop have hleft : Continuous (fun a : ℝ => C * (1 - Real.cos (a * T))) := continuous_const.mul hosc have hcosh : Continuous (fun a : ℝ => Real.cosh ((1 + δ) * a)) := by fun_prop have hright : Continuous (fun a : ℝ => positiveShellDensity ε a * Real.cosh ((1 + δ) * a) * (1 - Real.cos (a * T))) := (hden.mul hcosh).mul hosc have hpoint : ∀ a ∈ Set.Icc B (B + 1), C * (1 - Real.cos (a * T)) ≤ positiveShellDensity ε a * Real.cosh ((1 + δ) * a) * (1 - Real.cos (a * T)) := by intro a ha have ha0 : 0 ≤ a := hB.trans ha.1 have he := Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_left ha.1 hδ) have hratio := cosh_ratio_lower ha0 hδ have hbase : C ≤ positiveShellDensity ε a * Real.cosh ((1 + δ) * a) := by try dsimp [C, positiveShellDensity] calc shellWeight ε * Real.exp (δ * B) / 2 ≤ shellWeight ε * Real.exp (δ * a) / 2 := by gcongr _ ≤ shellWeight ε * (Real.cosh ((1 + δ) * a) / Real.cosh a) := by calc shellWeight ε * Real.exp (δ * a) / 2 = shellWeight ε * (Real.exp (δ * a) / 2) := by ring _ ≤ shellWeight ε * (Real.cosh ((1 + δ) * a) / Real.cosh a) := by exact mul_le_mul_of_nonneg_left hratio hQ.le _ = shellWeight ε / Real.cosh a * Real.cosh ((1 + δ) * a) := by ring exact mul_le_mul_of_nonneg_right hbase (sub_nonneg.mpr (Real.cos_le_one _)) have hmono := intervalIntegral.integral_mono_on (μ := volume) (show B ≤ B + 1 by linarith) (hleft.intervalIntegrable _ _) (hright.intervalIntegrable _ _) hpoint have hleftIntegral : (∫ a in B..B + 1, C * (1 - Real.cos (a * T))) = C * shellOscillation B T := by rw [intervalIntegral.integral_const_mul] rfl rw [hleftIntegral] at hmono change ℓ / 50 * shellWeight ε * Real.exp (δ * B) * min (T ^ 2) 1 ≤ ℓ * ∫ a in B..B + 1, positiveShellDensity ε a * Real.cosh ((1 + δ) * a) * (1 - Real.cos (a * T)) calc ℓ / 50 * shellWeight ε * Real.exp (δ * B) * min (T ^ 2) 1 = ℓ * (C * ((1 / 25 : ℝ) * min (T ^ 2) 1)) := by try dsimp [C] ring _ ≤ ℓ * (C * shellOscillation B T) := by gcongr exact shellOscillation_lower_bound B T _ ≤ ℓ * ∫ a in B..B + 1, positiveShellDensity ε a * Real.cosh ((1 + δ) * a) * (1 - Real.cos (a * T)) := by gcongr def positiveShellRadiusContribution (ε : ℝ) : ℝ := ∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * a * Real.sinh ((1 + ε / 4) * a) theorem positiveShellRadiusContribution_bounds {ε : ℝ} (hε : 0 < ε) : 0 ≤ positiveShellRadiusContribution ε ∧ positiveShellRadiusContribution ε ≤ (shellLocation ε + 1) * shellWeight ε * Real.exp ((ε / 4) * (shellLocation ε + 1)) := by let B : ℝ := shellLocation ε let δ : ℝ := ε / 4 let K : ℝ := (B + 1) * shellWeight ε * Real.exp (δ * (B + 1)) have hB : 0 ≤ B := by try dsimp [B, shellLocation] positivity have hδ : 0 ≤ δ := by try dsimp [δ] positivity have hQ : 0 < shellWeight ε := shellWeight_pos ε have hden : Continuous (fun a : ℝ => positiveShellDensity ε a) := by unfold positiveShellDensity exact continuous_const.div Real.continuous_cosh (fun a => (Real.cosh_pos a).ne') have hright : Continuous (fun a : ℝ => positiveShellDensity ε a * a * Real.sinh ((1 + δ) * a)) := by have hsinh : Continuous (fun a : ℝ => Real.sinh ((1 + δ) * a)) := by fun_prop exact (hden.mul continuous_id).mul hsinh have hnonneg : ∀ a ∈ Set.Icc B (B + 1), 0 ≤ positiveShellDensity ε a * a * Real.sinh ((1 + δ) * a) := by intro a ha have ha0 : 0 ≤ a := hB.trans ha.1 have hden0 : 0 ≤ positiveShellDensity ε a := by unfold positiveShellDensity exact (div_pos hQ (Real.cosh_pos a)).le exact mul_nonneg (mul_nonneg hden0 ha0) (Real.sinh_nonneg_iff.mpr (mul_nonneg (by linarith : 0 ≤ 1 + δ) ha0)) have hpoint : ∀ a ∈ Set.Icc B (B + 1), positiveShellDensity ε a * a * Real.sinh ((1 + δ) * a) ≤ K := by intro a ha have ha0 : 0 ≤ a := hB.trans ha.1 have hden0 : 0 ≤ positiveShellDensity ε a := by unfold positiveShellDensity exact (div_pos hQ (Real.cosh_pos a)).le have hratio := cosh_ratio_upper ha0 hδ have he := Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_left ha.2 hδ) calc positiveShellDensity ε a * a * Real.sinh ((1 + δ) * a) ≤ positiveShellDensity ε a * a * Real.cosh ((1 + δ) * a) := by gcongr exact (Real.sinh_lt_cosh (x := (1 + δ) * a)).le _ = shellWeight ε * a * (Real.cosh ((1 + δ) * a) / Real.cosh a) := by unfold positiveShellDensity ring _ ≤ shellWeight ε * (B + 1) * Real.exp (δ * (B + 1)) := by gcongr · exact ha.2 · exact hratio.trans he _ = K := by try dsimp [K] ring constructor · change 0 ≤ ∫ a in B..B + 1, positiveShellDensity ε a * a * Real.sinh ((1 + δ) * a) exact intervalIntegral.integral_nonneg (by linarith) hnonneg · change (∫ a in B..B + 1, positiveShellDensity ε a * a * Real.sinh ((1 + δ) * a)) ≤ K have hmono := intervalIntegral.integral_mono_on (μ := volume) (show B ≤ B + 1 by linarith) (hright.intervalIntegrable _ _) ((continuous_const : Continuous (fun _ : ℝ => K)).intervalIntegrable _ _) hpoint simpa using! hmono def shortShellDensity (ε a : ℝ) : ℝ := -(shortMargin ε a * Real.exp (-2 * a) / (2 * a ^ 2 * Real.cosh a)) def mellinShellPhase (ε : ℝ) (z : ℂ) : ℂ := (∫ a in shortCutoff ε..shortEndpoint ε, (shortShellDensity ε a : ℂ) * (Complex.cos ((a : ℂ) * z) - 1)) + (∫ a in shellLocation ε..shellLocation ε + 1, (positiveShellDensity ε a : ℂ) * (Complex.cos ((a : ℂ) * z) - 1)) theorem mellinShellPhase_neg (ε : ℝ) (z : ℂ) : mellinShellPhase ε (-z) = mellinShellPhase ε z := by unfold mellinShellPhase congr 1 · apply intervalIntegral.integral_congr intro a _ simp · apply intervalIntegral.integral_congr intro a _ simp def realOscillatoryShellPhase (ε t : ℝ) : ℝ := (∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * (Real.cos (a * t) - 1)) + (∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * (Real.cos (a * t) - 1)) def realHyperbolicShellPhase (ε u : ℝ) : ℝ := (∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * (Real.cosh (a * u) - 1)) + (∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * (Real.cosh (a * u) - 1)) theorem mellinShellPhase_ofReal (ε t : ℝ) : mellinShellPhase ε (t : ℂ) = (realOscillatoryShellPhase ε t : ℂ) := by unfold mellinShellPhase realOscillatoryShellPhase push_cast congr 1 · calc (∫ a in shortCutoff ε..shortEndpoint ε, (shortShellDensity ε a : ℂ) * (Complex.cos ((a : ℂ) * (t : ℂ)) - 1)) = ∫ a in shortCutoff ε..shortEndpoint ε, (↑(shortShellDensity ε a * (Real.cos (a * t) - 1)) : ℂ) := by apply intervalIntegral.integral_congr intro a _ try dsimp rw [show (a : ℂ) * (t : ℂ) = ((a * t : ℝ) : ℂ) by push_cast rfl, ← Complex.ofReal_cos] push_cast rfl _ = (↑(∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * (Real.cos (a * t) - 1)) : ℂ) := intervalIntegral.integral_ofReal · calc (∫ a in shellLocation ε..shellLocation ε + 1, (positiveShellDensity ε a : ℂ) * (Complex.cos ((a : ℂ) * (t : ℂ)) - 1)) = ∫ a in shellLocation ε..shellLocation ε + 1, (↑(positiveShellDensity ε a * (Real.cos (a * t) - 1)) : ℂ) := by apply intervalIntegral.integral_congr intro a _ try dsimp rw [show (a : ℂ) * (t : ℂ) = ((a * t : ℝ) : ℂ) by push_cast rfl, ← Complex.ofReal_cos] push_cast rfl _ = (↑(∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * (Real.cos (a * t) - 1)) : ℂ) := intervalIntegral.integral_ofReal theorem mellinShellPhase_imaginary (ε u : ℝ) : mellinShellPhase ε (Complex.I * (u : ℂ)) = (realHyperbolicShellPhase ε u : ℂ) := by unfold mellinShellPhase realHyperbolicShellPhase push_cast congr 1 · calc (∫ a in shortCutoff ε..shortEndpoint ε, (shortShellDensity ε a : ℂ) * (Complex.cos ((a : ℂ) * (Complex.I * (u : ℂ))) - 1)) = ∫ a in shortCutoff ε..shortEndpoint ε, (↑(shortShellDensity ε a * (Real.cosh (a * u) - 1)) : ℂ) := by apply intervalIntegral.integral_congr intro a _ try dsimp rw [show (a : ℂ) * (Complex.I * (u : ℂ)) = ((a * u : ℝ) : ℂ) * Complex.I by push_cast ring, Complex.cos_mul_I, ← Complex.ofReal_cosh] push_cast rfl _ = (↑(∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * (Real.cosh (a * u) - 1)) : ℂ) := intervalIntegral.integral_ofReal · calc (∫ a in shellLocation ε..shellLocation ε + 1, (positiveShellDensity ε a : ℂ) * (Complex.cos ((a : ℂ) * (Complex.I * (u : ℂ))) - 1)) = ∫ a in shellLocation ε..shellLocation ε + 1, (↑(positiveShellDensity ε a * (Real.cosh (a * u) - 1)) : ℂ) := by apply intervalIntegral.integral_congr intro a _ try dsimp rw [show (a : ℂ) * (Complex.I * (u : ℂ)) = ((a * u : ℝ) : ℂ) * Complex.I by push_cast ring, Complex.cos_mul_I, ← Complex.ofReal_cosh] push_cast rfl _ = (↑(∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * (Real.cosh (a * u) - 1)) : ℂ) := intervalIntegral.integral_ofReal theorem realHyperbolicShellPhase_neg (ε u : ℝ) : realHyperbolicShellPhase ε (-u) = realHyperbolicShellPhase ε u := by unfold realHyperbolicShellPhase congr 1 · apply intervalIntegral.integral_congr intro a _ change shortShellDensity ε a * (Real.cosh (a * (-u)) - 1) = shortShellDensity ε a * (Real.cosh (a * u) - 1) rw [mul_neg, Real.cosh_neg] · apply intervalIntegral.integral_congr intro a _ change positiveShellDensity ε a * (Real.cosh (a * (-u)) - 1) = positiveShellDensity ε a * (Real.cosh (a * u) - 1) rw [mul_neg, Real.cosh_neg] theorem positiveShellDensity_continuous (ε : ℝ) : Continuous (positiveShellDensity ε) := by unfold positiveShellDensity exact continuous_const.div Real.continuous_cosh (fun a => (Real.cosh_pos a).ne') theorem shortShellDensity_intervalIntegrable {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : IntervalIntegrable (shortShellDensity ε) volume (shortCutoff ε) (shortEndpoint ε) := by have hn : Continuous (fun a : ℝ => shortMargin ε a * Real.exp (-2 * a)) := by unfold shortMargin fun_prop have hd : Continuous (fun a : ℝ => 2 * a ^ 2 * Real.cosh a) := by fun_prop apply ContinuousOn.intervalIntegrable_of_Icc horder unfold shortShellDensity apply (hn.continuousOn.div hd.continuousOn ?_).neg intro a ha have hcutoff : 0 < shortCutoff ε := by unfold shortCutoff positivity have ha0 : 0 < a := hcutoff.trans_le ha.1 positivity theorem shortShellOscillatoryIntegral_continuous {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : Continuous (fun t : ℝ => ∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * (Real.cos (a * t) - 1)) := by have hcutoff : 0 < shortCutoff ε := by unfold shortCutoff positivity let w : ℝ → ℝ := fun a => shortShellDensity ε (max a (shortCutoff ε)) have hmax (a : ℝ) : 0 < max a (shortCutoff ε) := hcutoff.trans_le (le_max_right _ _) have hw : Continuous w := by have hn : Continuous (fun a : ℝ => shortMargin ε (max a (shortCutoff ε)) * Real.exp (-2 * max a (shortCutoff ε))) := by unfold shortMargin fun_prop have hd : Continuous (fun a : ℝ => 2 * (max a (shortCutoff ε)) ^ 2 * Real.cosh (max a (shortCutoff ε))) := by fun_prop try dsimp [w] unfold shortShellDensity exact (hn.div hd (fun a => by positivity [hmax a])).neg let F : ℝ → ℝ → ℝ := fun t a => w a * (Real.cos (a * t) - 1) have hF : Continuous (Function.uncurry F) := by try dsimp [F, Function.uncurry] exact (hw.comp continuous_snd).mul (by fun_prop) have hparam : Continuous (fun t : ℝ => ∫ a in Set.Icc (shortCutoff ε) (shortEndpoint ε), F t a) := continuous_parametric_integral_of_continuous (μ := volume) hF isCompact_Icc have hident (t : ℝ) : (∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * (Real.cos (a * t) - 1)) = (∫ a in Set.Icc (shortCutoff ε) (shortEndpoint ε), F t a) := by rw [intervalIntegral.integral_of_le horder, ← integral_Icc_eq_integral_Ioc] apply setIntegral_congr_fun measurableSet_Icc intro a ha try dsimp [F, w] rw [max_eq_left ha.1] exact hparam.congr (fun t => (hident t).symm) theorem positiveShellOscillatoryIntegral_continuous (ε : ℝ) : Continuous (fun t : ℝ => ∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * (Real.cos (a * t) - 1)) := by let F : ℝ → ℝ → ℝ := fun t a => positiveShellDensity ε a * (Real.cos (a * t) - 1) have hF : Continuous (Function.uncurry F) := by try dsimp [F, Function.uncurry] exact ((positiveShellDensity_continuous ε).comp continuous_snd).mul (by fun_prop) have hparam : Continuous (fun t : ℝ => ∫ a in Set.Icc (shellLocation ε) (shellLocation ε + 1), F t a) := continuous_parametric_integral_of_continuous (μ := volume) hF isCompact_Icc have horder : shellLocation ε ≤ shellLocation ε + 1 := by linarith have hident (t : ℝ) : (∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * (Real.cos (a * t) - 1)) = (∫ a in Set.Icc (shellLocation ε) (shellLocation ε + 1), F t a) := by rw [intervalIntegral.integral_of_le horder, ← integral_Icc_eq_integral_Ioc] exact hparam.congr (fun t => (hident t).symm) theorem realOscillatoryShellPhase_continuous {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : Continuous (realOscillatoryShellPhase ε) := by unfold realOscillatoryShellPhase exact (shortShellOscillatoryIntegral_continuous hε horder).add (positiveShellOscillatoryIntegral_continuous ε) theorem complexShellInterval_continuous (w : ℝ → ℝ) (hw : Continuous w) {a b : ℝ} (hab : a ≤ b) : Continuous (fun z : ℂ => ∫ x in a..b, (w x : ℂ) * (Complex.cos ((x : ℂ) * z) - 1)) := by let F : ℂ → ℝ → ℂ := fun z x => (w x : ℂ) * (Complex.cos ((x : ℂ) * z) - 1) have hF : Continuous (Function.uncurry F) := by try dsimp [F, Function.uncurry] exact (Complex.continuous_ofReal.comp (hw.comp continuous_snd)).mul (by fun_prop) have hparam : Continuous (fun z : ℂ => ∫ x in Set.Icc a b, F z x) := continuous_parametric_integral_of_continuous (μ := volume) hF isCompact_Icc have hident (z : ℂ) : (∫ x in a..b, (w x : ℂ) * (Complex.cos ((x : ℂ) * z) - 1)) = (∫ x in Set.Icc a b, F z x) := by rw [intervalIntegral.integral_of_le hab, ← integral_Icc_eq_integral_Ioc] exact hparam.congr (fun z => (hident z).symm) theorem complexShellInterval_differentiable (w : ℝ → ℝ) (hw : Continuous w) {a b : ℝ} (hab : a ≤ b) : Differentiable ℂ (fun z : ℂ => ∫ x in a..b, (w x : ℂ) * (Complex.cos ((x : ℂ) * z) - 1)) := by let F : ℂ → ℝ → ℂ := fun z x => (w x : ℂ) * (Complex.cos ((x : ℂ) * z) - 1) let F' : ℂ → ℝ → ℂ := fun z x => (w x : ℂ) * (-(Complex.sin ((x : ℂ) * z)) * (x : ℂ)) have hF (z : ℂ) : Continuous (F z) := by try dsimp [F] exact (Complex.continuous_ofReal.comp hw).mul (by fun_prop) have hF' (z : ℂ) : Continuous (F' z) := by try dsimp [F'] exact (Complex.continuous_ofReal.comp hw).mul (by fun_prop) have hF'joint : Continuous (Function.uncurry F') := by try dsimp [F', Function.uncurry] exact (Complex.continuous_ofReal.comp (hw.comp continuous_snd)).mul (by fun_prop) have hderiv (x : ℝ) (z : ℂ) : HasDerivAt (fun u : ℂ => F u x) (F' z x) z := by have hlinear : HasDerivAt (fun u : ℂ => (x : ℂ) * u) (x : ℂ) z := by simpa using! (hasDerivAt_id z).const_mul (x : ℂ) have hcos := (Complex.hasDerivAt_cos ((x : ℂ) * z)).comp z hlinear simpa [F, F', mul_assoc] using! (hcos.sub_const (1 : ℂ)).const_mul (w x : ℂ) have hrewrite : (fun z : ℂ => ∫ x in a..b, (w x : ℂ) * (Complex.cos ((x : ℂ) * z) - 1)) = (fun z : ℂ => ∫ x in Set.Icc a b, F z x) := by funext z rw [intervalIntegral.integral_of_le hab, ← integral_Icc_eq_integral_Ioc] rw [hrewrite] intro z₀ have hcompact : IsCompact (Metric.closedBall z₀ 1 ×ˢ Set.Icc a b) := (isCompact_closedBall z₀ 1).prod isCompact_Icc obtain ⟨C, hC⟩ := hcompact.bddAbove_image hF'joint.norm.continuousOn have hbound : ∀ᵐ x ∂volume.restrict (Set.Icc a b), ∀ z ∈ Metric.ball z₀ 1, ‖F' z x‖ ≤ C := by filter_upwards [ae_restrict_mem measurableSet_Icc] with x hx intro z hz have hpair : (z, x) ∈ Metric.closedBall z₀ 1 ×ˢ Set.Icc a b := ⟨Metric.ball_subset_closedBall hz, hx⟩ exact hC (Set.mem_image_of_mem (fun p : ℂ × ℝ => ‖F' p.1 p.2‖) hpair) have hmeas : ∀ᶠ z in 𝓝 z₀, AEStronglyMeasurable (F z) (volume.restrict (Set.Icc a b)) := Eventually.of_forall (fun z => (hF z).aestronglyMeasurable) have hint : Integrable (F z₀) (volume.restrict (Set.Icc a b)) := (hF z₀).integrableOn_Icc have hderivmeas : AEStronglyMeasurable (F' z₀) (volume.restrict (Set.Icc a b)) := (hF' z₀).aestronglyMeasurable have hconstant : Integrable (fun _ : ℝ => C) (volume.restrict (Set.Icc a b)) := integrableOn_const isCompact_Icc.measure_ne_top have hdifferentiable : ∀ᵐ x ∂volume.restrict (Set.Icc a b), ∀ z ∈ Metric.ball z₀ 1, HasDerivAt (fun u : ℂ => F u x) (F' z x) z := Eventually.of_forall (fun x z _ => hderiv x z) exact (hasDerivAt_integral_of_dominated_loc_of_deriv_le (μ := volume.restrict (Set.Icc a b)) (s := Metric.ball z₀ 1) (bound := fun _ : ℝ => C) (Metric.ball_mem_nhds z₀ zero_lt_one) hmeas hint hderivmeas hbound hconstant hdifferentiable).2.differentiableAt theorem mellinShellPhase_continuous {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : Continuous (mellinShellPhase ε) := by have hcutoff : 0 < shortCutoff ε := by unfold shortCutoff positivity let w : ℝ → ℝ := fun a => shortShellDensity ε (max a (shortCutoff ε)) have hmax (a : ℝ) : 0 < max a (shortCutoff ε) := hcutoff.trans_le (le_max_right _ _) have hw : Continuous w := by have hn : Continuous (fun a : ℝ => shortMargin ε (max a (shortCutoff ε)) * Real.exp (-2 * max a (shortCutoff ε))) := by unfold shortMargin fun_prop have hd : Continuous (fun a : ℝ => 2 * (max a (shortCutoff ε)) ^ 2 * Real.cosh (max a (shortCutoff ε))) := by fun_prop try dsimp [w] unfold shortShellDensity exact (hn.div hd (fun a => by positivity [hmax a])).neg have hshort : Continuous (fun z : ℂ => ∫ a in shortCutoff ε..shortEndpoint ε, (shortShellDensity ε a : ℂ) * (Complex.cos ((a : ℂ) * z) - 1)) := by apply (complexShellInterval_continuous w hw horder).congr intro z apply intervalIntegral.integral_congr intro a ha rw [uIcc_of_le horder] at ha try dsimp [w] rw [max_eq_left ha.1] have hremote : shellLocation ε ≤ shellLocation ε + 1 := by linarith have hpositive : Continuous (fun z : ℂ => ∫ a in shellLocation ε..shellLocation ε + 1, (positiveShellDensity ε a : ℂ) * (Complex.cos ((a : ℂ) * z) - 1)) := complexShellInterval_continuous (positiveShellDensity ε) (positiveShellDensity_continuous ε) hremote exact hshort.add hpositive theorem mellinShellPhase_differentiable {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : Differentiable ℂ (mellinShellPhase ε) := by have hcutoff : 0 < shortCutoff ε := by unfold shortCutoff positivity let w : ℝ → ℝ := fun a => shortShellDensity ε (max a (shortCutoff ε)) have hmax (a : ℝ) : 0 < max a (shortCutoff ε) := hcutoff.trans_le (le_max_right _ _) have hw : Continuous w := by have hn : Continuous (fun a : ℝ => shortMargin ε (max a (shortCutoff ε)) * Real.exp (-2 * max a (shortCutoff ε))) := by unfold shortMargin fun_prop have hd : Continuous (fun a : ℝ => 2 * (max a (shortCutoff ε)) ^ 2 * Real.cosh (max a (shortCutoff ε))) := by fun_prop try dsimp [w] unfold shortShellDensity exact (hn.div hd (fun a => by positivity [hmax a])).neg have hshort_eq : (fun z : ℂ => ∫ a in shortCutoff ε..shortEndpoint ε, (shortShellDensity ε a : ℂ) * (Complex.cos ((a : ℂ) * z) - 1)) = (fun z : ℂ => ∫ a in shortCutoff ε..shortEndpoint ε, (w a : ℂ) * (Complex.cos ((a : ℂ) * z) - 1)) := by funext z apply intervalIntegral.integral_congr intro a ha rw [uIcc_of_le horder] at ha try dsimp [w] rw [max_eq_left ha.1] have hshort : Differentiable ℂ (fun z : ℂ => ∫ a in shortCutoff ε..shortEndpoint ε, (shortShellDensity ε a : ℂ) * (Complex.cos ((a : ℂ) * z) - 1)) := by rw [hshort_eq] exact complexShellInterval_differentiable w hw horder have hremote : shellLocation ε ≤ shellLocation ε + 1 := by linarith have hpositive : Differentiable ℂ (fun z : ℂ => ∫ a in shellLocation ε..shellLocation ε + 1, (positiveShellDensity ε a : ℂ) * (Complex.cos ((a : ℂ) * z) - 1)) := complexShellInterval_differentiable (positiveShellDensity ε) (positiveShellDensity_continuous ε) hremote exact hshort.add hpositive theorem mellinShellPhase_analyticOnNhd {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : AnalyticOnNhd ℂ (mellinShellPhase ε) Set.univ := Complex.analyticOnNhd_univ_iff_differentiable.mpr (mellinShellPhase_differentiable hε horder) def saddleShellTotalVariation (ε : ℝ) : ℝ := (∫ a in shortCutoff ε..shortEndpoint ε, |shortShellDensity ε a|) + (∫ a in shellLocation ε..shellLocation ε + 1, |positiveShellDensity ε a|) theorem abs_realOscillatoryShellPhase_le {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (t : ℝ) : |realOscillatoryShellPhase ε t| ≤ 2 * saddleShellTotalVariation ε := by have hcos (a : ℝ) : |Real.cos (a * t) - 1| ≤ 2 := by apply (abs_le).2 constructor · linarith [Real.neg_one_le_cos (a * t)] · linarith [Real.cos_le_one (a * t)] have hosc : Continuous (fun a : ℝ => Real.cos (a * t) - 1) := by fun_prop have hs := shortShellDensity_intervalIntegrable hε horder have hp : IntervalIntegrable (positiveShellDensity ε) volume (shellLocation ε) (shellLocation ε + 1) := (positiveShellDensity_continuous ε).intervalIntegrable (shellLocation ε) (shellLocation ε + 1) have hshort : |∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * (Real.cos (a * t) - 1)| ≤ 2 * ∫ a in shortCutoff ε..shortEndpoint ε, |shortShellDensity ε a| := by calc |∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * (Real.cos (a * t) - 1)| ≤ ∫ a in shortCutoff ε..shortEndpoint ε, |shortShellDensity ε a * (Real.cos (a * t) - 1)| := intervalIntegral.abs_integral_le_integral_abs horder _ ≤ ∫ a in shortCutoff ε..shortEndpoint ε, 2 * |shortShellDensity ε a| := by apply intervalIntegral.integral_mono_on horder (hs.mul_continuousOn hosc.continuousOn).abs (hs.abs.const_mul 2) intro a _ rw [abs_mul] calc |shortShellDensity ε a| * |Real.cos (a * t) - 1| ≤ |shortShellDensity ε a| * 2 := by gcongr exact hcos a _ = 2 * |shortShellDensity ε a| := by ring _ = 2 * ∫ a in shortCutoff ε..shortEndpoint ε, |shortShellDensity ε a| := by rw [intervalIntegral.integral_const_mul] have hpositive : |∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * (Real.cos (a * t) - 1)| ≤ 2 * ∫ a in shellLocation ε..shellLocation ε + 1, |positiveShellDensity ε a| := by have hB : shellLocation ε ≤ shellLocation ε + 1 := by linarith calc |∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * (Real.cos (a * t) - 1)| ≤ ∫ a in shellLocation ε..shellLocation ε + 1, |positiveShellDensity ε a * (Real.cos (a * t) - 1)| := intervalIntegral.abs_integral_le_integral_abs hB _ ≤ ∫ a in shellLocation ε..shellLocation ε + 1, 2 * |positiveShellDensity ε a| := by apply intervalIntegral.integral_mono_on hB (hp.mul_continuousOn hosc.continuousOn).abs (hp.abs.const_mul 2) intro a _ rw [abs_mul] calc |positiveShellDensity ε a| * |Real.cos (a * t) - 1| ≤ |positiveShellDensity ε a| * 2 := by gcongr exact hcos a _ = 2 * |positiveShellDensity ε a| := by ring _ = 2 * ∫ a in shellLocation ε..shellLocation ε + 1, |positiveShellDensity ε a| := by rw [intervalIntegral.integral_const_mul] unfold realOscillatoryShellPhase saddleShellTotalVariation calc |(∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * (Real.cos (a * t) - 1)) + (∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * (Real.cos (a * t) - 1))| ≤ |∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * (Real.cos (a * t) - 1)| + |∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * (Real.cos (a * t) - 1)| := abs_add_le _ _ _ ≤ 2 * (∫ a in shortCutoff ε..shortEndpoint ε, |shortShellDensity ε a|) + 2 * (∫ a in shellLocation ε..shellLocation ε + 1, |positiveShellDensity ε a|) := add_le_add hshort hpositive _ = 2 * ((∫ a in shortCutoff ε..shortEndpoint ε, |shortShellDensity ε a|) + (∫ a in shellLocation ε..shellLocation ε + 1, |positiveShellDensity ε a|)) := by ring theorem mellinShellPhase_real_conj (ε t : ℝ) : starRingEnd ℂ (mellinShellPhase ε (t : ℂ)) = mellinShellPhase ε (t : ℂ) := by rw [mellinShellPhase_ofReal] exact Complex.conj_ofReal _ def saddleEnvelope (ε ℓ t : ℝ) : ℂ := Complex.exp (Complex.I * (t : ℂ) * (Real.log Real.pi : ℂ) / 2) * Complex.Gamma (((ℓ : ℂ) - Complex.I * (t : ℂ)) / 2) * Complex.exp ((ℓ : ℂ) * mellinShellPhase ε ((t : ℂ) / (ℓ : ℂ))) def plusSaddleSpectrum (ε ℓ t : ℝ) : ℂ := saddleEnvelope ε ℓ t * plusPolynomial ε ((t : ℂ) / (ℓ : ℂ)) def minusSaddleSpectrum (ε ℓ t : ℝ) : ℂ := saddleEnvelope ε ℓ t * minusPolynomial ε ((t : ℂ) / (ℓ : ℂ)) theorem saddleVerticalGamma_continuous {ℓ : ℝ} (hℓ : 0 < ℓ) : Continuous (fun t : ℝ => Complex.Gamma (((ℓ : ℂ) - Complex.I * (t : ℂ)) / 2)) := by apply continuous_iff_continuousAt.mpr intro t let z : ℂ := ((ℓ : ℂ) - Complex.I * (t : ℂ)) / 2 have hz : 0 < z.re := by try dsimp [z] simpa using! half_pos hℓ have hpoles : ∀ m : ℕ, z ≠ -(m : ℂ) := by intro m hm have hre := congrArg Complex.re hm norm_num at hre have hmnonneg : (0 : ℝ) ≤ (m : ℝ) := Nat.cast_nonneg m linarith have harg : ContinuousAt (fun u : ℝ => ((ℓ : ℂ) - Complex.I * (u : ℂ)) / 2) t := by fun_prop simpa [Function.comp_def] using! (Complex.continuousAt_Gamma z hpoles).comp_of_eq harg (by rfl) theorem saddleShellPhase_continuous {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) : Continuous (fun t : ℝ => mellinShellPhase ε ((t : ℂ) / (ℓ : ℂ))) := by have hreal : Continuous (fun t : ℝ => realOscillatoryShellPhase ε (t / ℓ)) := (realOscillatoryShellPhase_continuous hε horder).comp (by fun_prop) have hcomplex : Continuous (fun t : ℝ => (realOscillatoryShellPhase ε (t / ℓ) : ℂ)) := Complex.continuous_ofReal.comp hreal apply hcomplex.congr intro t rw [show (t : ℂ) / (ℓ : ℂ) = ((t / ℓ : ℝ) : ℂ) by push_cast rfl, mellinShellPhase_ofReal] theorem saddleEnvelope_continuous {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) : Continuous (saddleEnvelope ε ℓ) := by have hunit : Continuous (fun t : ℝ => Complex.exp (Complex.I * (t : ℂ) * (Real.log Real.pi : ℂ) / 2)) := by fun_prop have hgamma := saddleVerticalGamma_continuous hℓ have hphase : Continuous (fun t : ℝ => Complex.exp ((ℓ : ℂ) * mellinShellPhase ε ((t : ℂ) / (ℓ : ℂ)))) := Complex.continuous_exp.comp (continuous_const.mul (saddleShellPhase_continuous hε horder ℓ)) exact (hunit.mul hgamma).mul hphase theorem plusSaddleSpectrum_continuous {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) : Continuous (plusSaddleSpectrum ε ℓ) := by have hp : Continuous (fun t : ℝ => plusPolynomial ε ((t : ℂ) / (ℓ : ℂ))) := by unfold plusPolynomial fun_prop exact (saddleEnvelope_continuous hε hℓ horder).mul hp theorem minusSaddleSpectrum_continuous {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) : Continuous (minusSaddleSpectrum ε ℓ) := by have hp : Continuous (fun t : ℝ => minusPolynomial ε ((t : ℂ) / (ℓ : ℂ))) := by unfold minusPolynomial fun_prop exact (saddleEnvelope_continuous hε hℓ horder).mul hp def saddleOriginValue (ε ℓ : ℝ) : ℝ := 2 * Real.pi ^ (ℓ / 2) * Real.exp (ℓ * realHyperbolicShellPhase ε 1) * beta ε theorem saddleOriginValue_pos {ε : ℝ} (hε : 0 < ε) (ℓ : ℝ) : 0 < saddleOriginValue ε ℓ := by unfold saddleOriginValue positivity [beta_pos hε, Real.pi_pos] def saddleMellinEnvelope (ε ℓ : ℝ) (z : ℂ) : ℂ := Complex.exp (((ℓ : ℂ) - z) * (Real.log Real.pi : ℂ) / 2) * Complex.Gamma (z / 2) * Complex.exp ((ℓ : ℂ) * mellinShellPhase ε (Complex.I * (z - (ℓ : ℂ)) / (ℓ : ℂ))) def plusSaddleMellinData (ε ℓ : ℝ) (z : ℂ) : ℂ := saddleMellinEnvelope ε ℓ z * plusPolynomial ε (Complex.I * (z - (ℓ : ℂ)) / (ℓ : ℂ)) def minusSaddleMellinData (ε ℓ : ℝ) (z : ℂ) : ℂ := saddleMellinEnvelope ε ℓ z * minusPolynomial ε (Complex.I * (z - (ℓ : ℂ)) / (ℓ : ℂ)) def saddleRegularMellinFactor (ε ℓ : ℝ) (z : ℂ) : ℂ := Complex.exp (((ℓ : ℂ) - z) * (Real.log Real.pi : ℂ) / 2) * Complex.exp ((ℓ : ℂ) * mellinShellPhase ε (Complex.I * (z - (ℓ : ℂ)) / (ℓ : ℂ))) def plusSaddleRegularMellinFactor (ε ℓ : ℝ) (z : ℂ) : ℂ := saddleRegularMellinFactor ε ℓ z * plusPolynomial ε (Complex.I * (z - (ℓ : ℂ)) / (ℓ : ℂ)) def minusSaddleRegularMellinFactor (ε ℓ : ℝ) (z : ℂ) : ℂ := saddleRegularMellinFactor ε ℓ z * minusPolynomial ε (Complex.I * (z - (ℓ : ℂ)) / (ℓ : ℂ)) theorem plusSaddleMellinData_eq_gamma_mul_regular (ε ℓ : ℝ) (z : ℂ) : plusSaddleMellinData ε ℓ z = Complex.Gamma (z / 2) * plusSaddleRegularMellinFactor ε ℓ z := by unfold plusSaddleMellinData saddleMellinEnvelope plusSaddleRegularMellinFactor saddleRegularMellinFactor ring theorem minusSaddleMellinData_eq_gamma_mul_regular (ε ℓ : ℝ) (z : ℂ) : minusSaddleMellinData ε ℓ z = Complex.Gamma (z / 2) * minusSaddleRegularMellinFactor ε ℓ z := by unfold minusSaddleMellinData saddleMellinEnvelope minusSaddleRegularMellinFactor saddleRegularMellinFactor ring theorem saddleRegularMellinFactor_continuous {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) : Continuous (saddleRegularMellinFactor ε ℓ) := by have hpi : Continuous (fun z : ℂ => Complex.exp (((ℓ : ℂ) - z) * (Real.log Real.pi : ℂ) / 2)) := by fun_prop have harg : Continuous (fun z : ℂ => Complex.I * (z - (ℓ : ℂ)) / (ℓ : ℂ)) := by fun_prop have hphase : Continuous (fun z : ℂ => Complex.exp ((ℓ : ℂ) * mellinShellPhase ε (Complex.I * (z - (ℓ : ℂ)) / (ℓ : ℂ)))) := Complex.continuous_exp.comp (continuous_const.mul ((mellinShellPhase_continuous hε horder).comp harg)) exact hpi.mul hphase theorem saddleRegularMellinFactor_differentiable {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) : Differentiable ℂ (saddleRegularMellinFactor ε ℓ) := by have hpi : Differentiable ℂ (fun z : ℂ => Complex.exp (((ℓ : ℂ) - z) * (Real.log Real.pi : ℂ) / 2)) := by fun_prop have harg : Differentiable ℂ (fun z : ℂ => Complex.I * (z - (ℓ : ℂ)) / (ℓ : ℂ)) := by fun_prop have hphase : Differentiable ℂ (fun z : ℂ => Complex.exp ((ℓ : ℂ) * mellinShellPhase ε (Complex.I * (z - (ℓ : ℂ)) / (ℓ : ℂ)))) := Complex.differentiable_exp.comp (((mellinShellPhase_differentiable hε horder).comp harg).const_mul (ℓ : ℂ)) exact hpi.mul hphase theorem plusSaddleRegularMellinFactor_differentiable {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) : Differentiable ℂ (plusSaddleRegularMellinFactor ε ℓ) := by have hp : Differentiable ℂ (fun z : ℂ => plusPolynomial ε (Complex.I * (z - (ℓ : ℂ)) / (ℓ : ℂ))) := by unfold plusPolynomial fun_prop exact (saddleRegularMellinFactor_differentiable hε horder ℓ).mul hp theorem minusSaddleRegularMellinFactor_differentiable {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) : Differentiable ℂ (minusSaddleRegularMellinFactor ε ℓ) := by have hp : Differentiable ℂ (fun z : ℂ => minusPolynomial ε (Complex.I * (z - (ℓ : ℂ)) / (ℓ : ℂ))) := by unfold minusPolynomial fun_prop exact (saddleRegularMellinFactor_differentiable hε horder ℓ).mul hp theorem plusSaddleRegularMellinFactor_analyticOnNhd {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) : AnalyticOnNhd ℂ (plusSaddleRegularMellinFactor ε ℓ) Set.univ := Complex.analyticOnNhd_univ_iff_differentiable.mpr (plusSaddleRegularMellinFactor_differentiable hε horder ℓ) theorem minusSaddleRegularMellinFactor_analyticOnNhd {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) : AnalyticOnNhd ℂ (minusSaddleRegularMellinFactor ε ℓ) Set.univ := Complex.analyticOnNhd_univ_iff_differentiable.mpr (minusSaddleRegularMellinFactor_differentiable hε horder ℓ) theorem saddleMellinGamma_meromorphic : Meromorphic (fun z : ℂ => Complex.Gamma (z / 2)) := by intro z have hg : MeromorphicAt Complex.Gamma (z / 2) := Meromorphic.Gamma (z / 2) have ha : AnalyticAt ℂ (fun u : ℂ => u / 2) z := by fun_prop simpa [Function.comp_def] using! (MeromorphicAt.comp_analyticAt (g := fun u : ℂ => u / 2) (x := z) hg ha) theorem plusSaddleMellinData_meromorphic {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) : Meromorphic (plusSaddleMellinData ε ℓ) := by have hregular : Meromorphic (plusSaddleRegularMellinFactor ε ℓ) := meromorphicOn_univ.mp (plusSaddleRegularMellinFactor_analyticOnNhd hε horder ℓ).meromorphicOn have hproduct := saddleMellinGamma_meromorphic.mul hregular intro z rw [show plusSaddleMellinData ε ℓ = (fun w : ℂ => Complex.Gamma (w / 2) * plusSaddleRegularMellinFactor ε ℓ w) by funext w exact plusSaddleMellinData_eq_gamma_mul_regular ε ℓ w] exact hproduct z theorem minusSaddleMellinData_meromorphic {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) : Meromorphic (minusSaddleMellinData ε ℓ) := by have hregular : Meromorphic (minusSaddleRegularMellinFactor ε ℓ) := meromorphicOn_univ.mp (minusSaddleRegularMellinFactor_analyticOnNhd hε horder ℓ).meromorphicOn have hproduct := saddleMellinGamma_meromorphic.mul hregular intro z rw [show minusSaddleMellinData ε ℓ = (fun w : ℂ => Complex.Gamma (w / 2) * minusSaddleRegularMellinFactor ε ℓ w) by funext w exact minusSaddleMellinData_eq_gamma_mul_regular ε ℓ w] exact hproduct z theorem saddleMellinGamma_differentiableAt_of_re_pos {z : ℂ} (hz : 0 < z.re) : DifferentiableAt ℂ (fun w : ℂ => Complex.Gamma (w / 2)) z := by have hhalf : 0 < (z / 2).re := by simpa using! half_pos hz have hg : DifferentiableAt ℂ Complex.Gamma (z / 2) := Complex.differentiableAt_Gamma (z / 2) (by intro n hn have hnonpositive : (-(n : ℂ)).re ≤ 0 := by simp exact (not_lt_of_ge hnonpositive) (hn ▸ hhalf)) exact hg.comp z (by fun_prop) theorem saddleMellinGamma_differentiableOn_rightHalfPlane : DifferentiableOn ℂ (fun z : ℂ => Complex.Gamma (z / 2)) {z : ℂ | 0 < z.re} := by intro z hz exact (saddleMellinGamma_differentiableAt_of_re_pos hz).differentiableWithinAt theorem plusSaddleMellinData_differentiableOn_rightHalfPlane {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) : DifferentiableOn ℂ (plusSaddleMellinData ε ℓ) {z : ℂ | 0 < z.re} := by rw [show plusSaddleMellinData ε ℓ = (fun z : ℂ => Complex.Gamma (z / 2) * plusSaddleRegularMellinFactor ε ℓ z) by funext z exact plusSaddleMellinData_eq_gamma_mul_regular ε ℓ z] exact saddleMellinGamma_differentiableOn_rightHalfPlane.mul (plusSaddleRegularMellinFactor_differentiable hε horder ℓ).differentiableOn theorem minusSaddleMellinData_differentiableOn_rightHalfPlane {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) : DifferentiableOn ℂ (minusSaddleMellinData ε ℓ) {z : ℂ | 0 < z.re} := by rw [show minusSaddleMellinData ε ℓ = (fun z : ℂ => Complex.Gamma (z / 2) * minusSaddleRegularMellinFactor ε ℓ z) by funext z exact minusSaddleMellinData_eq_gamma_mul_regular ε ℓ z] exact saddleMellinGamma_differentiableOn_rightHalfPlane.mul (minusSaddleRegularMellinFactor_differentiable hε horder ℓ).differentiableOn theorem saddleMellinShellArgument_zero {ℓ : ℝ} (hℓ : 0 < ℓ) : Complex.I * ((0 : ℂ) - (ℓ : ℂ)) / (ℓ : ℂ) = -Complex.I := by have hc : (ℓ : ℂ) ≠ 0 := by exact_mod_cast hℓ.ne' field_simp [hc]; ring theorem saddleMellinShellArgument_neg_even {ℓ : ℝ} (hℓ : 0 < ℓ) (n : ℕ) : Complex.I * ((-((2 * n : ℕ) : ℂ)) - (ℓ : ℂ)) / (ℓ : ℂ) = Complex.I * ((-(1 + 2 * (n : ℝ) / ℓ) : ℝ) : ℂ) := by have hc : (ℓ : ℂ) ≠ 0 := by exact_mod_cast hℓ.ne' push_cast field_simp [hc]; ring theorem mellinShellPhase_neg_I (ε : ℝ) : mellinShellPhase ε (-Complex.I) = (realHyperbolicShellPhase ε 1 : ℂ) := by calc mellinShellPhase ε (-Complex.I) = mellinShellPhase ε Complex.I := mellinShellPhase_neg ε Complex.I _ = (realHyperbolicShellPhase ε 1 : ℂ) := by simpa using! mellinShellPhase_imaginary ε 1 theorem plusPolynomial_neg_I (ε : ℝ) : plusPolynomial ε (-Complex.I) = (beta ε : ℂ) := by simpa using! plusPolynomial_imaginary ε (-1) theorem minusPolynomial_neg_I (ε : ℝ) : minusPolynomial ε (-Complex.I) = (beta ε : ℂ) := by simpa using! minusPolynomial_imaginary ε (-1) theorem saddleRegularMellinFactor_zero {ε ℓ : ℝ} (hℓ : 0 < ℓ) : saddleRegularMellinFactor ε ℓ 0 = ((Real.pi ^ (ℓ / 2) * Real.exp (ℓ * realHyperbolicShellPhase ε 1) : ℝ) : ℂ) := by have hpi : Complex.exp (((ℓ : ℂ) - (0 : ℂ)) * (Real.log Real.pi : ℂ) / 2) = ((Real.pi ^ (ℓ / 2) : ℝ) : ℂ) := by rw [Real.rpow_def_of_pos Real.pi_pos, Complex.ofReal_exp] congr 1 push_cast ring have hphase : Complex.exp ((ℓ : ℂ) * mellinShellPhase ε (-Complex.I)) = (Real.exp (ℓ * realHyperbolicShellPhase ε 1) : ℂ) := by rw [mellinShellPhase_neg_I, ← Complex.ofReal_mul, ← Complex.ofReal_exp] unfold saddleRegularMellinFactor rw [saddleMellinShellArgument_zero hℓ, hpi, hphase, ← Complex.ofReal_mul] theorem saddleRegularMellinFactor_neg_even {ε ℓ : ℝ} (hℓ : 0 < ℓ) (n : ℕ) : saddleRegularMellinFactor ε ℓ (-((2 * n : ℕ) : ℂ)) = ((Real.pi ^ (ℓ / 2 + (n : ℝ)) * Real.exp (ℓ * realHyperbolicShellPhase ε (1 + 2 * (n : ℝ) / ℓ)) : ℝ) : ℂ) := by have hpi : Complex.exp (((ℓ : ℂ) - (-((2 * n : ℕ) : ℂ))) * (Real.log Real.pi : ℂ) / 2) = ((Real.pi ^ (ℓ / 2 + (n : ℝ)) : ℝ) : ℂ) := by rw [Real.rpow_def_of_pos Real.pi_pos, Complex.ofReal_exp] congr 1 push_cast ring have hphase : Complex.exp ((ℓ : ℂ) * mellinShellPhase ε (Complex.I * ((-((2 * n : ℕ) : ℂ)) - (ℓ : ℂ)) / (ℓ : ℂ))) = (Real.exp (ℓ * realHyperbolicShellPhase ε (1 + 2 * (n : ℝ) / ℓ)) : ℂ) := by rw [saddleMellinShellArgument_neg_even hℓ n, mellinShellPhase_imaginary, realHyperbolicShellPhase_neg, ← Complex.ofReal_mul, ← Complex.ofReal_exp] unfold saddleRegularMellinFactor rw [hpi, hphase, ← Complex.ofReal_mul] theorem plusSaddleRegularMellinFactor_neg_even {ε ℓ : ℝ} (hℓ : 0 < ℓ) (n : ℕ) : plusSaddleRegularMellinFactor ε ℓ (-((2 * n : ℕ) : ℂ)) = ((Real.pi ^ (ℓ / 2 + (n : ℝ)) * Real.exp (ℓ * realHyperbolicShellPhase ε (1 + 2 * (n : ℝ) / ℓ)) : ℝ) : ℂ) * plusPolynomial ε (Complex.I * ((-(1 + 2 * (n : ℝ) / ℓ) : ℝ) : ℂ)) := by unfold plusSaddleRegularMellinFactor rw [saddleRegularMellinFactor_neg_even hℓ n, saddleMellinShellArgument_neg_even hℓ n] theorem two_mul_plusSaddleRegularMellinFactor_zero {ε ℓ : ℝ} (hℓ : 0 < ℓ) : (2 : ℂ) * plusSaddleRegularMellinFactor ε ℓ 0 = (saddleOriginValue ε ℓ : ℂ) := by unfold plusSaddleRegularMellinFactor saddleOriginValue rw [saddleRegularMellinFactor_zero hℓ, saddleMellinShellArgument_zero hℓ, plusPolynomial_neg_I] push_cast ring theorem two_mul_minusSaddleRegularMellinFactor_zero {ε ℓ : ℝ} (hℓ : 0 < ℓ) : (2 : ℂ) * minusSaddleRegularMellinFactor ε ℓ 0 = (saddleOriginValue ε ℓ : ℂ) := by unfold minusSaddleRegularMellinFactor saddleOriginValue rw [saddleRegularMellinFactor_zero hℓ, saddleMellinShellArgument_zero hℓ, minusPolynomial_neg_I] push_cast ring theorem complexGamma_residue_neg_nat (n : ℕ) : Tendsto (fun z : ℂ => (z + (n : ℂ)) * Complex.Gamma z) (𝓝[≠] (-(n : ℂ))) (𝓝 (((-1 : ℂ) ^ n) / (n.factorial : ℂ))) := by induction n with | zero => simpa using! Complex.tendsto_self_mul_Gamma_nhds_zero | succ n ih => have hshift : Tendsto (fun z : ℂ => z + 1) (𝓝[≠] (-((n + 1 : ℕ) : ℂ))) (𝓝[≠] (-(n : ℂ))) := by rw [tendsto_nhdsWithin_iff] constructor · convert! ((tendsto_id.add_const (1 : ℂ)).mono_left nhdsWithin_le_nhds) using 1; simp [Nat.cast_add, Nat.cast_one] · filter_upwards [self_mem_nhdsWithin] with z hz simp only [Set.mem_compl_iff, Set.mem_singleton_iff] at hz ⊢ intro heq apply hz simp only [Nat.cast_add, Nat.cast_one] linear_combination heq have hnonzero : (-((n + 1 : ℕ) : ℂ)) ≠ 0 := by exact neg_ne_zero.mpr (by exact_mod_cast Nat.succ_ne_zero n) have hden : Tendsto (fun z : ℂ => z) (𝓝[≠] (-((n + 1 : ℕ) : ℂ))) (𝓝 (-((n + 1 : ℕ) : ℂ))) := tendsto_id.mono_left nhdsWithin_le_nhds have hquot := (ih.comp hshift).div hden hnonzero have hne : ∀ᶠ z in (𝓝[≠] (-((n + 1 : ℕ) : ℂ))), z ≠ (0 : ℂ) := ((continuousAt_id : ContinuousAt (fun z : ℂ => z) (-((n + 1 : ℕ) : ℂ))).eventually_ne hnonzero).filter_mono nhdsWithin_le_nhds have htarget : (((-1 : ℂ) ^ n / (n.factorial : ℂ)) / (-((n + 1 : ℕ) : ℂ))) = ((-1 : ℂ) ^ (n + 1)) / ((n + 1).factorial : ℂ) := by have hn : ((n : ℂ) + 1) ≠ 0 := by exact_mod_cast Nat.succ_ne_zero n have hf : (n.factorial : ℂ) ≠ 0 := by exact_mod_cast Nat.factorial_ne_zero n rw [Nat.factorial_succ, Nat.cast_mul, Nat.cast_succ, pow_succ] field_simp [hn, hf] rw [← htarget] refine hquot.congr' ?_ filter_upwards [hne] with z hz change ((z + 1 + (n : ℂ)) * Complex.Gamma (z + 1)) / z = (z + ((n + 1 : ℕ) : ℂ)) * Complex.Gamma z rw [Complex.Gamma_add_one z hz] simp only [Nat.cast_add, Nat.cast_one] field_simp [hz]; ring theorem saddleGamma_residue_neg_even (n : ℕ) : Tendsto (fun z : ℂ => (z + ((2 * n : ℕ) : ℂ)) * Complex.Gamma (z / 2)) (𝓝[≠] (-((2 * n : ℕ) : ℂ))) (𝓝 ((2 : ℂ) * (-1 : ℂ) ^ n / (n.factorial : ℂ))) := by have hscale : Tendsto (fun z : ℂ => z / 2) (𝓝[≠] (-((2 * n : ℕ) : ℂ))) (𝓝[≠] (-(n : ℂ))) := by rw [tendsto_nhdsWithin_iff] constructor · convert! ((tendsto_id.div_const (2 : ℂ)).mono_left nhdsWithin_le_nhds) using 1; simp [Nat.cast_mul]; ring · filter_upwards [self_mem_nhdsWithin] with z hz simp only [Set.mem_compl_iff, Set.mem_singleton_iff] at hz ⊢ intro heq apply hz simp only [Nat.cast_mul, Nat.cast_ofNat] linear_combination 2 * heq have hresidue := ((complexGamma_residue_neg_nat n).comp hscale).const_mul (2 : ℂ) convert! hresidue using 1 · funext z change (z + ((2 * n : ℕ) : ℂ)) * Complex.Gamma (z / 2) = 2 * ((z / 2 + (n : ℂ)) * Complex.Gamma (z / 2)) simp only [Nat.cast_mul, Nat.cast_ofNat] ring · ring_nf theorem gamma_add_nat_eq_product_of_lt (z : ℂ) (k : ℕ) (hz : ∀ j : ℕ, j < k → z + (j : ℂ) ≠ 0) : Complex.Gamma (z + (k : ℂ)) = Complex.Gamma z * ∏ j ∈ Finset.range k, (z + (j : ℂ)) := by induction k generalizing z with | zero => simp | succ k ih => have hprevious : ∀ j : ℕ, j < k → z + (j : ℂ) ≠ 0 := by intro j hj exact hz j (Nat.lt_succ_of_lt hj) have hlast : z + (k : ℂ) ≠ 0 := hz k (Nat.lt_succ_self k) rw [Nat.cast_succ, ← add_assoc, Complex.Gamma_add_one (z + (k : ℂ)) hlast, ih z hprevious, Finset.prod_range_succ] ring def saddlePoleStrip (n : ℕ) : Set ℂ := {z : ℂ | -(2 * ((n : ℝ) + 1)) < z.re ∧ z.re < -(2 * (n : ℝ)) + 1} theorem saddlePole_mem_strip (n : ℕ) : (-((2 * n : ℕ) : ℂ)) ∈ saddlePoleStrip n := by change -(2 * ((n : ℝ) + 1)) < (-((2 * n : ℕ) : ℂ)).re ∧ (-((2 * n : ℕ) : ℂ)).re < -(2 * (n : ℝ)) + 1 constructor <;> norm_num [Nat.cast_mul, Complex.mul_re] theorem isOpen_saddlePoleStrip (n : ℕ) : IsOpen (saddlePoleStrip n) := by exact (isOpen_lt continuous_const Complex.continuous_re).inter (isOpen_lt Complex.continuous_re continuous_const) def saddlePoleLowerProduct (n : ℕ) (z : ℂ) : ℂ := ∏ j ∈ Finset.range n, (z / 2 + (j : ℂ)) theorem saddlePoleLowerProduct_ne_zero {n : ℕ} {z : ℂ} (hz : z ∈ saddlePoleStrip n) : saddlePoleLowerProduct n z ≠ 0 := by unfold saddlePoleLowerProduct apply Finset.prod_ne_zero_iff.mpr intro j hj have hjn : j < n := Finset.mem_range.mp hj have hjreal : (j : ℝ) + 1 ≤ (n : ℝ) := by exact_mod_cast Nat.succ_le_of_lt hjn intro hzero have hre := congrArg Complex.re hzero norm_num at hre change -(2 * ((n : ℝ) + 1)) < z.re ∧ z.re < -(2 * (n : ℝ)) + 1 at hz linarith def saddleNthGammaPoleNumerator (n : ℕ) (z : ℂ) : ℂ := (2 : ℂ) * Complex.Gamma (z / 2 + ((n + 1 : ℕ) : ℂ)) / saddlePoleLowerProduct n z theorem saddlePoleLowerProduct_differentiable (n : ℕ) : Differentiable ℂ (saddlePoleLowerProduct n) := by unfold saddlePoleLowerProduct fun_prop theorem saddleGamma_eq_nthPoleNumerator_div {n : ℕ} {z : ℂ} (hstrip : z ∈ saddlePoleStrip n) (hpole : z ≠ (-((2 * n : ℕ) : ℂ))) : Complex.Gamma (z / 2) = saddleNthGammaPoleNumerator n z / (z + ((2 * n : ℕ) : ℂ)) := by have hden : saddlePoleLowerProduct n z ≠ 0 := saddlePoleLowerProduct_ne_zero hstrip have hterms : ∀ j : ℕ, j < n → z / 2 + (j : ℂ) ≠ 0 := by have hproduct : (∏ j ∈ Finset.range n, (z / 2 + (j : ℂ))) ≠ 0 := by simpa [saddlePoleLowerProduct] using! hden intro j hj exact (Finset.prod_ne_zero_iff.mp hproduct) j (Finset.mem_range.mpr hj) have hfinite : ∀ j : ℕ, j < n + 1 → z / 2 + (j : ℂ) ≠ 0 := by intro j hj by_cases heq : j = n · subst j intro hzero apply hpole push_cast at hzero ⊢ linear_combination 2 * hzero · exact hterms j (by omega) have hrec := gamma_add_nat_eq_product_of_lt (z / 2) (n + 1) hfinite rw [Finset.prod_range_succ] at hrec have hcoordinate : z + ((2 * n : ℕ) : ℂ) ≠ 0 := by intro hzero apply hpole push_cast at hzero ⊢ linear_combination hzero unfold saddleNthGammaPoleNumerator rw [hrec] change Complex.Gamma (z / 2) = 2 * (Complex.Gamma (z / 2) * ((∏ j ∈ Finset.range n, (z / 2 + (j : ℂ))) * (z / 2 + (n : ℂ)))) / saddlePoleLowerProduct n z / (z + ((2 * n : ℕ) : ℂ)) rw [show saddlePoleLowerProduct n z = ∏ j ∈ Finset.range n, (z / 2 + (j : ℂ)) by rfl] have hproduct : (∏ j ∈ Finset.range n, (z / 2 + (j : ℂ))) ≠ 0 := by simpa [saddlePoleLowerProduct] using! hden have hcancel : 2 * (Complex.Gamma (z / 2) * ((∏ j ∈ Finset.range n, (z / 2 + (j : ℂ))) * (z / 2 + (n : ℂ)))) / (∏ j ∈ Finset.range n, (z / 2 + (j : ℂ))) = 2 * Complex.Gamma (z / 2) * (z / 2 + (n : ℂ)) := by calc _ = (2 * Complex.Gamma (z / 2) * (z / 2 + (n : ℂ))) * (∏ j ∈ Finset.range n, (z / 2 + (j : ℂ))) / (∏ j ∈ Finset.range n, (z / 2 + (j : ℂ))) := by congr 1 ring _ = _ := mul_div_cancel_right₀ _ hproduct rw [hcancel] field_simp [hcoordinate]; push_cast; ring theorem saddleNthGammaPoleNumerator_differentiableOn (n : ℕ) : DifferentiableOn ℂ (saddleNthGammaPoleNumerator n) (saddlePoleStrip n) := by intro z hz have hpositive : 0 < (z / 2 + ((n + 1 : ℕ) : ℂ)).re := by norm_num [Nat.cast_add] change -(2 * ((n : ℝ) + 1)) < z.re ∧ z.re < -(2 * (n : ℝ)) + 1 at hz linarith [hz.1] have hgamma : DifferentiableAt ℂ Complex.Gamma (z / 2 + ((n + 1 : ℕ) : ℂ)) := Complex.differentiableAt_Gamma _ (by intro m hm have hnonpositive : (-(m : ℂ)).re ≤ 0 := by simp exact (not_lt_of_ge hnonpositive) (hm ▸ hpositive)) have hcompose : DifferentiableAt ℂ (fun w : ℂ => Complex.Gamma (w / 2 + ((n + 1 : ℕ) : ℂ))) z := hgamma.comp z (by fun_prop) have hnumerator := hcompose.const_mul (2 : ℂ) have hdenominator := saddlePoleLowerProduct_differentiable n z exact (hnumerator.div hdenominator (saddlePoleLowerProduct_ne_zero hz)).differentiableWithinAt theorem saddleNthGammaPoleNumerator_at_pole (n : ℕ) : saddleNthGammaPoleNumerator n (-((2 * n : ℕ) : ℂ)) = (2 : ℂ) * (-1 : ℂ) ^ n / (n.factorial : ℂ) := by have hpole : (-((2 * n : ℕ) : ℂ)) ∈ saddlePoleStrip n := saddlePole_mem_strip n have hanalytic : DifferentiableAt ℂ (saddleNthGammaPoleNumerator n) (-((2 * n : ℕ) : ℂ)) := (saddleNthGammaPoleNumerator_differentiableOn n).differentiableAt ((isOpen_saddlePoleStrip n).mem_nhds hpole) have hcontinuous : Tendsto (saddleNthGammaPoleNumerator n) (𝓝[≠] (-((2 * n : ℕ) : ℂ))) (𝓝 (saddleNthGammaPoleNumerator n (-((2 * n : ℕ) : ℂ)))) := hanalytic.continuousAt.tendsto.mono_left nhdsWithin_le_nhds have hstrip : ∀ᶠ z in (𝓝[≠] (-((2 * n : ℕ) : ℂ))), z ∈ saddlePoleStrip n := nhdsWithin_le_nhds ((isOpen_saddlePoleStrip n).mem_nhds hpole) have heventual : (fun z : ℂ => (z + ((2 * n : ℕ) : ℂ)) * Complex.Gamma (z / 2)) =ᶠ[𝓝[≠] (-((2 * n : ℕ) : ℂ))] saddleNthGammaPoleNumerator n := by filter_upwards [hstrip, self_mem_nhdsWithin] with z hz hne simp only [Set.mem_compl_iff, Set.mem_singleton_iff] at hne rw [saddleGamma_eq_nthPoleNumerator_div hz hne] have hcoordinate : z + ((2 * n : ℕ) : ℂ) ≠ 0 := by intro hzero apply hne linear_combination hzero rw [← mul_div_assoc] exact mul_div_cancel_left₀ _ hcoordinate exact (tendsto_nhds_unique_of_eventuallyEq (saddleGamma_residue_neg_even n) hcontinuous heventual).symm def plusSaddleNthPoleNumerator (ε ℓ : ℝ) (n : ℕ) (z : ℂ) : ℂ := saddleNthGammaPoleNumerator n z * plusSaddleRegularMellinFactor ε ℓ z def minusSaddleNthPoleNumerator (ε ℓ : ℝ) (n : ℕ) (z : ℂ) : ℂ := saddleNthGammaPoleNumerator n z * minusSaddleRegularMellinFactor ε ℓ z theorem plusSaddleNthPoleNumerator_differentiableOn {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (n : ℕ) : DifferentiableOn ℂ (plusSaddleNthPoleNumerator ε ℓ n) (saddlePoleStrip n) := by unfold plusSaddleNthPoleNumerator exact (saddleNthGammaPoleNumerator_differentiableOn n).mul (plusSaddleRegularMellinFactor_differentiable hε horder ℓ).differentiableOn theorem minusSaddleNthPoleNumerator_differentiableOn {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (n : ℕ) : DifferentiableOn ℂ (minusSaddleNthPoleNumerator ε ℓ n) (saddlePoleStrip n) := by unfold minusSaddleNthPoleNumerator exact (saddleNthGammaPoleNumerator_differentiableOn n).mul (minusSaddleRegularMellinFactor_differentiable hε horder ℓ).differentiableOn theorem plusSaddleMellinData_eq_nthPoleNumerator_div (ε ℓ : ℝ) {n : ℕ} {z : ℂ} (hstrip : z ∈ saddlePoleStrip n) (hpole : z ≠ (-((2 * n : ℕ) : ℂ))) : plusSaddleMellinData ε ℓ z = plusSaddleNthPoleNumerator ε ℓ n z / (z + ((2 * n : ℕ) : ℂ)) := by rw [plusSaddleMellinData_eq_gamma_mul_regular, saddleGamma_eq_nthPoleNumerator_div hstrip hpole] unfold plusSaddleNthPoleNumerator ring theorem minusSaddleMellinData_eq_nthPoleNumerator_div (ε ℓ : ℝ) {n : ℕ} {z : ℂ} (hstrip : z ∈ saddlePoleStrip n) (hpole : z ≠ (-((2 * n : ℕ) : ℂ))) : minusSaddleMellinData ε ℓ z = minusSaddleNthPoleNumerator ε ℓ n z / (z + ((2 * n : ℕ) : ℂ)) := by rw [minusSaddleMellinData_eq_gamma_mul_regular, saddleGamma_eq_nthPoleNumerator_div hstrip hpole] unfold minusSaddleNthPoleNumerator ring theorem plusSaddleNthPoleNumerator_at_pole (ε ℓ : ℝ) (n : ℕ) : plusSaddleNthPoleNumerator ε ℓ n (-((2 * n : ℕ) : ℂ)) = (2 : ℂ) * (-1 : ℂ) ^ n / (n.factorial : ℂ) * plusSaddleRegularMellinFactor ε ℓ (-((2 * n : ℕ) : ℂ)) := by unfold plusSaddleNthPoleNumerator rw [saddleNthGammaPoleNumerator_at_pole] theorem minusSaddleNthPoleNumerator_at_pole (ε ℓ : ℝ) (n : ℕ) : minusSaddleNthPoleNumerator ε ℓ n (-((2 * n : ℕ) : ℂ)) = (2 : ℂ) * (-1 : ℂ) ^ n / (n.factorial : ℂ) * minusSaddleRegularMellinFactor ε ℓ (-((2 * n : ℕ) : ℂ)) := by unfold minusSaddleNthPoleNumerator rw [saddleNthGammaPoleNumerator_at_pole] def plusSaddlePoleResidue (ε ℓ : ℝ) (n : ℕ) : ℂ := (2 : ℂ) * (-1 : ℂ) ^ n / (n.factorial : ℂ) * plusSaddleRegularMellinFactor ε ℓ (-((2 * n : ℕ) : ℂ)) def minusSaddlePoleResidue (ε ℓ : ℝ) (n : ℕ) : ℂ := (2 : ℂ) * (-1 : ℂ) ^ n / (n.factorial : ℂ) * minusSaddleRegularMellinFactor ε ℓ (-((2 * n : ℕ) : ℂ)) theorem plusSaddleNthPoleNumerator_poleResidue (ε ℓ : ℝ) (n : ℕ) : plusSaddleNthPoleNumerator ε ℓ n (-((2 * n : ℕ) : ℂ)) = plusSaddlePoleResidue ε ℓ n := by exact plusSaddleNthPoleNumerator_at_pole ε ℓ n theorem minusSaddleNthPoleNumerator_poleResidue (ε ℓ : ℝ) (n : ℕ) : minusSaddleNthPoleNumerator ε ℓ n (-((2 * n : ℕ) : ℂ)) = minusSaddlePoleResidue ε ℓ n := by exact minusSaddleNthPoleNumerator_at_pole ε ℓ n def plusSaddleNthPoleRegularPart (ε ℓ : ℝ) (n : ℕ) : ℂ → ℂ := dslope (plusSaddleNthPoleNumerator ε ℓ n) (-((2 * n : ℕ) : ℂ)) def minusSaddleNthPoleRegularPart (ε ℓ : ℝ) (n : ℕ) : ℂ → ℂ := dslope (minusSaddleNthPoleNumerator ε ℓ n) (-((2 * n : ℕ) : ℂ)) theorem plusSaddleNthPoleRegularPart_differentiableOn {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (n : ℕ) : DifferentiableOn ℂ (plusSaddleNthPoleRegularPart ε ℓ n) (saddlePoleStrip n) := by unfold plusSaddleNthPoleRegularPart exact (Complex.differentiableOn_dslope ((isOpen_saddlePoleStrip n).mem_nhds (saddlePole_mem_strip n))).mpr (plusSaddleNthPoleNumerator_differentiableOn hε horder ℓ n) theorem minusSaddleNthPoleRegularPart_differentiableOn {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (n : ℕ) : DifferentiableOn ℂ (minusSaddleNthPoleRegularPart ε ℓ n) (saddlePoleStrip n) := by unfold minusSaddleNthPoleRegularPart exact (Complex.differentiableOn_dslope ((isOpen_saddlePoleStrip n).mem_nhds (saddlePole_mem_strip n))).mpr (minusSaddleNthPoleNumerator_differentiableOn hε horder ℓ n) theorem plusSaddleMellinData_nthPole_decomposition (ε ℓ : ℝ) {n : ℕ} {z : ℂ} (hstrip : z ∈ saddlePoleStrip n) (hpole : z ≠ (-((2 * n : ℕ) : ℂ))) : plusSaddleMellinData ε ℓ z = plusSaddlePoleResidue ε ℓ n / (z + ((2 * n : ℕ) : ℂ)) + plusSaddleNthPoleRegularPart ε ℓ n z := by have hslope : (z + ((2 * n : ℕ) : ℂ)) * plusSaddleNthPoleRegularPart ε ℓ n z = plusSaddleNthPoleNumerator ε ℓ n z - plusSaddlePoleResidue ε ℓ n := by have hbase := sub_smul_dslope (plusSaddleNthPoleNumerator ε ℓ n) (-((2 * n : ℕ) : ℂ)) z rw [plusSaddleNthPoleNumerator_poleResidue ε ℓ n] at hbase simpa only [plusSaddleNthPoleRegularPart, sub_neg_eq_add, smul_eq_mul] using! hbase have hnumerator : plusSaddleNthPoleNumerator ε ℓ n z = plusSaddlePoleResidue ε ℓ n + (z + ((2 * n : ℕ) : ℂ)) * plusSaddleNthPoleRegularPart ε ℓ n z := by rw [hslope] ring rw [plusSaddleMellinData_eq_nthPoleNumerator_div ε ℓ hstrip hpole, hnumerator] have hcoordinate : z + ((2 * n : ℕ) : ℂ) ≠ 0 := by intro hzero apply hpole linear_combination hzero field_simp [hcoordinate] theorem minusSaddleMellinData_nthPole_decomposition (ε ℓ : ℝ) {n : ℕ} {z : ℂ} (hstrip : z ∈ saddlePoleStrip n) (hpole : z ≠ (-((2 * n : ℕ) : ℂ))) : minusSaddleMellinData ε ℓ z = minusSaddlePoleResidue ε ℓ n / (z + ((2 * n : ℕ) : ℂ)) + minusSaddleNthPoleRegularPart ε ℓ n z := by have hslope : (z + ((2 * n : ℕ) : ℂ)) * minusSaddleNthPoleRegularPart ε ℓ n z = minusSaddleNthPoleNumerator ε ℓ n z - minusSaddlePoleResidue ε ℓ n := by have hbase := sub_smul_dslope (minusSaddleNthPoleNumerator ε ℓ n) (-((2 * n : ℕ) : ℂ)) z rw [minusSaddleNthPoleNumerator_poleResidue ε ℓ n] at hbase simpa only [minusSaddleNthPoleRegularPart, sub_neg_eq_add, smul_eq_mul] using! hbase have hnumerator : minusSaddleNthPoleNumerator ε ℓ n z = minusSaddlePoleResidue ε ℓ n + (z + ((2 * n : ℕ) : ℂ)) * minusSaddleNthPoleRegularPart ε ℓ n z := by rw [hslope] ring rw [minusSaddleMellinData_eq_nthPoleNumerator_div ε ℓ hstrip hpole, hnumerator] have hcoordinate : z + ((2 * n : ℕ) : ℂ) ≠ 0 := by intro hzero apply hpole linear_combination hzero field_simp [hcoordinate] def saddleFinitePoleHalfPlane (N : ℕ) : Set ℂ := {z : ℂ | -(2 * ((N : ℝ) + 1)) < z.re} theorem saddlePole_mem_finiteHalfPlane_iff (N n : ℕ) : (-((2 * n : ℕ) : ℂ)) ∈ saddleFinitePoleHalfPlane N ↔ n ≤ N := by change -(2 * ((N : ℝ) + 1)) < (-((2 * n : ℕ) : ℂ)).re ↔ n ≤ N norm_num [Nat.cast_mul, Complex.mul_re] constructor · intro hreal have hstrict : (n : ℝ) < (N : ℝ) + 1 := by linarith have hn : n < N + 1 := by exact_mod_cast hstrict omega · intro hn have hreal : (n : ℝ) ≤ (N : ℝ) := by exact_mod_cast hn linarith theorem saddleMellinGamma_differentiableAt_of_not_pole {z : ℂ} (hz : ∀ n : ℕ, z ≠ (-((2 * n : ℕ) : ℂ))) : DifferentiableAt ℂ (fun w : ℂ => Complex.Gamma (w / 2)) z := by have hhalf : ∀ n : ℕ, z / 2 ≠ -(n : ℂ) := by intro n hzero apply hz n push_cast at hzero ⊢ linear_combination 2 * hzero exact (Complex.differentiableAt_Gamma (z / 2) hhalf).comp z (by fun_prop) theorem plusSaddleMellinData_differentiableAt_of_not_pole {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) {z : ℂ} (hz : ∀ n : ℕ, z ≠ (-((2 * n : ℕ) : ℂ))) : DifferentiableAt ℂ (plusSaddleMellinData ε ℓ) z := by rw [show plusSaddleMellinData ε ℓ = (fun w : ℂ => Complex.Gamma (w / 2) * plusSaddleRegularMellinFactor ε ℓ w) by funext w exact plusSaddleMellinData_eq_gamma_mul_regular ε ℓ w] exact (saddleMellinGamma_differentiableAt_of_not_pole hz).mul (plusSaddleRegularMellinFactor_differentiable hε horder ℓ z) theorem minusSaddleMellinData_differentiableAt_of_not_pole {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) {z : ℂ} (hz : ∀ n : ℕ, z ≠ (-((2 * n : ℕ) : ℂ))) : DifferentiableAt ℂ (minusSaddleMellinData ε ℓ) z := by rw [show minusSaddleMellinData ε ℓ = (fun w : ℂ => Complex.Gamma (w / 2) * minusSaddleRegularMellinFactor ε ℓ w) by funext w exact minusSaddleMellinData_eq_gamma_mul_regular ε ℓ w] exact (saddleMellinGamma_differentiableAt_of_not_pole hz).mul (minusSaddleRegularMellinFactor_differentiable hε horder ℓ z) def plusSaddleFinitePoleSubtraction (ε ℓ : ℝ) (N : ℕ) (z : ℂ) : ℂ := plusSaddleMellinData ε ℓ z - ∑ n ∈ Finset.range (N + 1), plusSaddlePoleResidue ε ℓ n / (z + ((2 * n : ℕ) : ℂ)) def minusSaddleFinitePoleSubtraction (ε ℓ : ℝ) (N : ℕ) (z : ℂ) : ℂ := minusSaddleMellinData ε ℓ z - ∑ n ∈ Finset.range (N + 1), minusSaddlePoleResidue ε ℓ n / (z + ((2 * n : ℕ) : ℂ)) theorem plusSaddleFinitePoleSubtraction_meromorphic {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) : Meromorphic (plusSaddleFinitePoleSubtraction ε ℓ N) := by have hsum : Meromorphic (fun z : ℂ => ∑ n ∈ Finset.range (N + 1), plusSaddlePoleResidue ε ℓ n / (z + ((2 * n : ℕ) : ℂ))) := by intro z exact MeromorphicAt.fun_sum (fun n _ => by fun_prop) exact (plusSaddleMellinData_meromorphic hε horder ℓ).sub hsum theorem minusSaddleFinitePoleSubtraction_meromorphic {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) : Meromorphic (minusSaddleFinitePoleSubtraction ε ℓ N) := by have hsum : Meromorphic (fun z : ℂ => ∑ n ∈ Finset.range (N + 1), minusSaddlePoleResidue ε ℓ n / (z + ((2 * n : ℕ) : ℂ))) := by intro z exact MeromorphicAt.fun_sum (fun n _ => by fun_prop) exact (minusSaddleMellinData_meromorphic hε horder ℓ).sub hsum def plusSaddleFinitePoleRegularPart (ε ℓ : ℝ) (N : ℕ) : ℂ → ℂ := toMeromorphicNFOn (plusSaddleFinitePoleSubtraction ε ℓ N) (saddleFinitePoleHalfPlane N) def minusSaddleFinitePoleRegularPart (ε ℓ : ℝ) (N : ℕ) : ℂ → ℂ := toMeromorphicNFOn (minusSaddleFinitePoleSubtraction ε ℓ N) (saddleFinitePoleHalfPlane N) theorem plusSaddleFinitePoleRegularPart_meromorphicNFOn (ε ℓ : ℝ) (N : ℕ) : MeromorphicNFOn (plusSaddleFinitePoleRegularPart ε ℓ N) (saddleFinitePoleHalfPlane N) := by unfold plusSaddleFinitePoleRegularPart exact meromorphicNFOn_toMeromorphicNFOn _ _ theorem minusSaddleFinitePoleRegularPart_meromorphicNFOn (ε ℓ : ℝ) (N : ℕ) : MeromorphicNFOn (minusSaddleFinitePoleRegularPart ε ℓ N) (saddleFinitePoleHalfPlane N) := by unfold minusSaddleFinitePoleRegularPart exact meromorphicNFOn_toMeromorphicNFOn _ _ theorem plusSaddleFinitePoleRegularPart_eq_on_punctured {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) {z : ℂ} (hz : z ∈ saddleFinitePoleHalfPlane N) : plusSaddleFinitePoleRegularPart ε ℓ N =ᶠ[𝓝[≠] z] plusSaddleFinitePoleSubtraction ε ℓ N := by unfold plusSaddleFinitePoleRegularPart exact (plusSaddleFinitePoleSubtraction_meromorphic hε horder ℓ N).meromorphicOn |>.toMeromorphicNFOn_eq_self_on_nhdsNE hz theorem minusSaddleFinitePoleRegularPart_eq_on_punctured {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) {z : ℂ} (hz : z ∈ saddleFinitePoleHalfPlane N) : minusSaddleFinitePoleRegularPart ε ℓ N =ᶠ[𝓝[≠] z] minusSaddleFinitePoleSubtraction ε ℓ N := by unfold minusSaddleFinitePoleRegularPart exact (minusSaddleFinitePoleSubtraction_meromorphic hε horder ℓ N).meromorphicOn |>.toMeromorphicNFOn_eq_self_on_nhdsNE hz theorem saddlePoleCoordinate_ne_zero_at_other {m n : ℕ} (hmn : m ≠ n) : -((2 * n : ℕ) : ℂ) + ((2 * m : ℕ) : ℂ) ≠ 0 := by intro hzero apply hmn have hreal := congrArg Complex.re hzero norm_num [Nat.cast_mul, Complex.mul_re] at hreal have heq : (m : ℝ) = (n : ℝ) := by linarith exact_mod_cast heq def plusSaddleFinitePoleRemaining (ε ℓ : ℝ) (N n : ℕ) (z : ℂ) : ℂ := ∑ m ∈ (Finset.range (N + 1)).erase n, plusSaddlePoleResidue ε ℓ m / (z + ((2 * m : ℕ) : ℂ)) def minusSaddleFinitePoleRemaining (ε ℓ : ℝ) (N n : ℕ) (z : ℂ) : ℂ := ∑ m ∈ (Finset.range (N + 1)).erase n, minusSaddlePoleResidue ε ℓ m / (z + ((2 * m : ℕ) : ℂ)) theorem plusSaddleFinitePoleRemaining_differentiableAt_pole (ε ℓ : ℝ) (N n : ℕ) : DifferentiableAt ℂ (plusSaddleFinitePoleRemaining ε ℓ N n) (-((2 * n : ℕ) : ℂ)) := by unfold plusSaddleFinitePoleRemaining apply DifferentiableAt.fun_sum intro m hm have hdistinct : m ≠ n := (Finset.mem_erase.mp hm).1 have hcoordinate := saddlePoleCoordinate_ne_zero_at_other hdistinct have hconstant : DifferentiableAt ℂ (fun _ : ℂ => plusSaddlePoleResidue ε ℓ m) (-((2 * n : ℕ) : ℂ)) := by fun_prop have hdenominator : DifferentiableAt ℂ (fun z : ℂ => z + ((2 * m : ℕ) : ℂ)) (-((2 * n : ℕ) : ℂ)) := by fun_prop exact hconstant.div hdenominator hcoordinate theorem minusSaddleFinitePoleRemaining_differentiableAt_pole (ε ℓ : ℝ) (N n : ℕ) : DifferentiableAt ℂ (minusSaddleFinitePoleRemaining ε ℓ N n) (-((2 * n : ℕ) : ℂ)) := by unfold minusSaddleFinitePoleRemaining apply DifferentiableAt.fun_sum intro m hm have hdistinct : m ≠ n := (Finset.mem_erase.mp hm).1 have hcoordinate := saddlePoleCoordinate_ne_zero_at_other hdistinct have hconstant : DifferentiableAt ℂ (fun _ : ℂ => minusSaddlePoleResidue ε ℓ m) (-((2 * n : ℕ) : ℂ)) := by fun_prop have hdenominator : DifferentiableAt ℂ (fun z : ℂ => z + ((2 * m : ℕ) : ℂ)) (-((2 * n : ℕ) : ℂ)) := by fun_prop exact hconstant.div hdenominator hcoordinate theorem plusSaddleFinitePoleSubtraction_differentiableAt_of_not_pole {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) {z : ℂ} (hz : ∀ n : ℕ, z ≠ (-((2 * n : ℕ) : ℂ))) : DifferentiableAt ℂ (plusSaddleFinitePoleSubtraction ε ℓ N) z := by unfold plusSaddleFinitePoleSubtraction apply (plusSaddleMellinData_differentiableAt_of_not_pole hε horder ℓ hz).sub apply DifferentiableAt.fun_sum intro n _ have hcoordinate : z + ((2 * n : ℕ) : ℂ) ≠ 0 := by intro hzero apply hz n linear_combination hzero have hconstant : DifferentiableAt ℂ (fun _ : ℂ => plusSaddlePoleResidue ε ℓ n) z := by fun_prop have hdenominator : DifferentiableAt ℂ (fun w : ℂ => w + ((2 * n : ℕ) : ℂ)) z := by fun_prop exact hconstant.div hdenominator hcoordinate theorem minusSaddleFinitePoleSubtraction_differentiableAt_of_not_pole {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) {z : ℂ} (hz : ∀ n : ℕ, z ≠ (-((2 * n : ℕ) : ℂ))) : DifferentiableAt ℂ (minusSaddleFinitePoleSubtraction ε ℓ N) z := by unfold minusSaddleFinitePoleSubtraction apply (minusSaddleMellinData_differentiableAt_of_not_pole hε horder ℓ hz).sub apply DifferentiableAt.fun_sum intro n _ have hcoordinate : z + ((2 * n : ℕ) : ℂ) ≠ 0 := by intro hzero apply hz n linear_combination hzero have hconstant : DifferentiableAt ℂ (fun _ : ℂ => minusSaddlePoleResidue ε ℓ n) z := by fun_prop have hdenominator : DifferentiableAt ℂ (fun w : ℂ => w + ((2 * n : ℕ) : ℂ)) z := by fun_prop exact hconstant.div hdenominator hcoordinate theorem plusSaddleFinitePoleSubtraction_eventually_eq_poleRegular (ε ℓ : ℝ) (N n : ℕ) (hn : n ≤ N) : plusSaddleFinitePoleSubtraction ε ℓ N =ᶠ[𝓝[≠] (-((2 * n : ℕ) : ℂ))] (fun z : ℂ => plusSaddleNthPoleRegularPart ε ℓ n z - plusSaddleFinitePoleRemaining ε ℓ N n z) := by have hmem : n ∈ Finset.range (N + 1) := Finset.mem_range.mpr (by omega) have hstrip : ∀ᶠ z in (𝓝[≠] (-((2 * n : ℕ) : ℂ))), z ∈ saddlePoleStrip n := nhdsWithin_le_nhds ((isOpen_saddlePoleStrip n).mem_nhds (saddlePole_mem_strip n)) filter_upwards [hstrip, self_mem_nhdsWithin] with z hz hne simp only [Set.mem_compl_iff, Set.mem_singleton_iff] at hne have hsum : (∑ m ∈ (Finset.range (N + 1)).erase n, plusSaddlePoleResidue ε ℓ m / (z + ((2 * m : ℕ) : ℂ))) + plusSaddlePoleResidue ε ℓ n / (z + ((2 * n : ℕ) : ℂ)) = ∑ m ∈ Finset.range (N + 1), plusSaddlePoleResidue ε ℓ m / (z + ((2 * m : ℕ) : ℂ)) := (Finset.range (N + 1)).sum_erase_add (fun m : ℕ => plusSaddlePoleResidue ε ℓ m / (z + ((2 * m : ℕ) : ℂ))) hmem unfold plusSaddleFinitePoleSubtraction plusSaddleFinitePoleRemaining rw [plusSaddleMellinData_nthPole_decomposition ε ℓ hz hne, ← hsum] ring theorem minusSaddleFinitePoleSubtraction_eventually_eq_poleRegular (ε ℓ : ℝ) (N n : ℕ) (hn : n ≤ N) : minusSaddleFinitePoleSubtraction ε ℓ N =ᶠ[𝓝[≠] (-((2 * n : ℕ) : ℂ))] (fun z : ℂ => minusSaddleNthPoleRegularPart ε ℓ n z - minusSaddleFinitePoleRemaining ε ℓ N n z) := by have hmem : n ∈ Finset.range (N + 1) := Finset.mem_range.mpr (by omega) have hstrip : ∀ᶠ z in (𝓝[≠] (-((2 * n : ℕ) : ℂ))), z ∈ saddlePoleStrip n := nhdsWithin_le_nhds ((isOpen_saddlePoleStrip n).mem_nhds (saddlePole_mem_strip n)) filter_upwards [hstrip, self_mem_nhdsWithin] with z hz hne simp only [Set.mem_compl_iff, Set.mem_singleton_iff] at hne have hsum : (∑ m ∈ (Finset.range (N + 1)).erase n, minusSaddlePoleResidue ε ℓ m / (z + ((2 * m : ℕ) : ℂ))) + minusSaddlePoleResidue ε ℓ n / (z + ((2 * n : ℕ) : ℂ)) = ∑ m ∈ Finset.range (N + 1), minusSaddlePoleResidue ε ℓ m / (z + ((2 * m : ℕ) : ℂ)) := (Finset.range (N + 1)).sum_erase_add (fun m : ℕ => minusSaddlePoleResidue ε ℓ m / (z + ((2 * m : ℕ) : ℂ))) hmem unfold minusSaddleFinitePoleSubtraction minusSaddleFinitePoleRemaining rw [minusSaddleMellinData_nthPole_decomposition ε ℓ hz hne, ← hsum] ring theorem plusSaddleFinitePoleSubtraction_tendsto_at_pole {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N n : ℕ) (hn : n ≤ N) : Tendsto (plusSaddleFinitePoleSubtraction ε ℓ N) (𝓝[≠] (-((2 * n : ℕ) : ℂ))) (𝓝 (plusSaddleNthPoleRegularPart ε ℓ n (-((2 * n : ℕ) : ℂ)) - plusSaddleFinitePoleRemaining ε ℓ N n (-((2 * n : ℕ) : ℂ)))) := by have hregular : DifferentiableAt ℂ (plusSaddleNthPoleRegularPart ε ℓ n) (-((2 * n : ℕ) : ℂ)) := (plusSaddleNthPoleRegularPart_differentiableOn hε horder ℓ n).differentiableAt ((isOpen_saddlePoleStrip n).mem_nhds (saddlePole_mem_strip n)) have hremaining := plusSaddleFinitePoleRemaining_differentiableAt_pole ε ℓ N n have hlimit : Tendsto (fun z : ℂ => plusSaddleNthPoleRegularPart ε ℓ n z - plusSaddleFinitePoleRemaining ε ℓ N n z) (𝓝[≠] (-((2 * n : ℕ) : ℂ))) (𝓝 (plusSaddleNthPoleRegularPart ε ℓ n (-((2 * n : ℕ) : ℂ)) - plusSaddleFinitePoleRemaining ε ℓ N n (-((2 * n : ℕ) : ℂ)))) := (hregular.sub hremaining).continuousAt.tendsto.mono_left nhdsWithin_le_nhds exact hlimit.congr' (plusSaddleFinitePoleSubtraction_eventually_eq_poleRegular ε ℓ N n hn).symm theorem minusSaddleFinitePoleSubtraction_tendsto_at_pole {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N n : ℕ) (hn : n ≤ N) : Tendsto (minusSaddleFinitePoleSubtraction ε ℓ N) (𝓝[≠] (-((2 * n : ℕ) : ℂ))) (𝓝 (minusSaddleNthPoleRegularPart ε ℓ n (-((2 * n : ℕ) : ℂ)) - minusSaddleFinitePoleRemaining ε ℓ N n (-((2 * n : ℕ) : ℂ)))) := by have hregular : DifferentiableAt ℂ (minusSaddleNthPoleRegularPart ε ℓ n) (-((2 * n : ℕ) : ℂ)) := (minusSaddleNthPoleRegularPart_differentiableOn hε horder ℓ n).differentiableAt ((isOpen_saddlePoleStrip n).mem_nhds (saddlePole_mem_strip n)) have hremaining := minusSaddleFinitePoleRemaining_differentiableAt_pole ε ℓ N n have hlimit : Tendsto (fun z : ℂ => minusSaddleNthPoleRegularPart ε ℓ n z - minusSaddleFinitePoleRemaining ε ℓ N n z) (𝓝[≠] (-((2 * n : ℕ) : ℂ))) (𝓝 (minusSaddleNthPoleRegularPart ε ℓ n (-((2 * n : ℕ) : ℂ)) - minusSaddleFinitePoleRemaining ε ℓ N n (-((2 * n : ℕ) : ℂ)))) := (hregular.sub hremaining).continuousAt.tendsto.mono_left nhdsWithin_le_nhds exact hlimit.congr' (minusSaddleFinitePoleSubtraction_eventually_eq_poleRegular ε ℓ N n hn).symm theorem plusSaddleFinitePoleSubtraction_tendsto_of_mem {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) {z : ℂ} (hz : z ∈ saddleFinitePoleHalfPlane N) : ∃ c : ℂ, Tendsto (plusSaddleFinitePoleSubtraction ε ℓ N) (𝓝[≠] z) (𝓝 c) := by by_cases hpole : ∃ n : ℕ, z = (-((2 * n : ℕ) : ℂ)) · obtain ⟨n, hn⟩ := hpole subst z have hindex : n ≤ N := (saddlePole_mem_finiteHalfPlane_iff N n).mp hz exact ⟨plusSaddleNthPoleRegularPart ε ℓ n (-((2 * n : ℕ) : ℂ)) - plusSaddleFinitePoleRemaining ε ℓ N n (-((2 * n : ℕ) : ℂ)), plusSaddleFinitePoleSubtraction_tendsto_at_pole hε horder ℓ N n hindex⟩ · have hnot : ∀ n : ℕ, z ≠ (-((2 * n : ℕ) : ℂ)) := by intro n hn exact hpole ⟨n, hn⟩ refine ⟨plusSaddleFinitePoleSubtraction ε ℓ N z, ?_⟩ exact (plusSaddleFinitePoleSubtraction_differentiableAt_of_not_pole hε horder ℓ N hnot).continuousAt.tendsto.mono_left nhdsWithin_le_nhds theorem minusSaddleFinitePoleSubtraction_tendsto_of_mem {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) {z : ℂ} (hz : z ∈ saddleFinitePoleHalfPlane N) : ∃ c : ℂ, Tendsto (minusSaddleFinitePoleSubtraction ε ℓ N) (𝓝[≠] z) (𝓝 c) := by by_cases hpole : ∃ n : ℕ, z = (-((2 * n : ℕ) : ℂ)) · obtain ⟨n, hn⟩ := hpole subst z have hindex : n ≤ N := (saddlePole_mem_finiteHalfPlane_iff N n).mp hz exact ⟨minusSaddleNthPoleRegularPart ε ℓ n (-((2 * n : ℕ) : ℂ)) - minusSaddleFinitePoleRemaining ε ℓ N n (-((2 * n : ℕ) : ℂ)), minusSaddleFinitePoleSubtraction_tendsto_at_pole hε horder ℓ N n hindex⟩ · have hnot : ∀ n : ℕ, z ≠ (-((2 * n : ℕ) : ℂ)) := by intro n hn exact hpole ⟨n, hn⟩ refine ⟨minusSaddleFinitePoleSubtraction ε ℓ N z, ?_⟩ exact (minusSaddleFinitePoleSubtraction_differentiableAt_of_not_pole hε horder ℓ N hnot).continuousAt.tendsto.mono_left nhdsWithin_le_nhds theorem plusSaddleFinitePoleRegularPart_analyticOnNhd {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) : AnalyticOnNhd ℂ (plusSaddleFinitePoleRegularPart ε ℓ N) (saddleFinitePoleHalfPlane N) := by intro z hz have hnormal := plusSaddleFinitePoleRegularPart_meromorphicNFOn ε ℓ N hz obtain ⟨c, hlimit⟩ := plusSaddleFinitePoleSubtraction_tendsto_of_mem hε horder ℓ N hz have hregular : Tendsto (plusSaddleFinitePoleRegularPart ε ℓ N) (𝓝[≠] z) (𝓝 c) := hlimit.congr' (plusSaddleFinitePoleRegularPart_eq_on_punctured hε horder ℓ N hz).symm exact hnormal.meromorphicOrderAt_nonneg_iff_analyticAt.mp ((tendsto_nhds_iff_meromorphicOrderAt_nonneg hnormal.meromorphicAt).mp ⟨c, hregular⟩) theorem minusSaddleFinitePoleRegularPart_analyticOnNhd {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) : AnalyticOnNhd ℂ (minusSaddleFinitePoleRegularPart ε ℓ N) (saddleFinitePoleHalfPlane N) := by intro z hz have hnormal := minusSaddleFinitePoleRegularPart_meromorphicNFOn ε ℓ N hz obtain ⟨c, hlimit⟩ := minusSaddleFinitePoleSubtraction_tendsto_of_mem hε horder ℓ N hz have hregular : Tendsto (minusSaddleFinitePoleRegularPart ε ℓ N) (𝓝[≠] z) (𝓝 c) := hlimit.congr' (minusSaddleFinitePoleRegularPart_eq_on_punctured hε horder ℓ N hz).symm exact hnormal.meromorphicOrderAt_nonneg_iff_analyticAt.mp ((tendsto_nhds_iff_meromorphicOrderAt_nonneg hnormal.meromorphicAt).mp ⟨c, hregular⟩) theorem plusSaddleFinitePoleRegularPart_eq_subtraction_of_not_pole {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) {z : ℂ} (hz : z ∈ saddleFinitePoleHalfPlane N) (hpole : ∀ n : ℕ, z ≠ (-((2 * n : ℕ) : ℂ))) : plusSaddleFinitePoleRegularPart ε ℓ N z = plusSaddleFinitePoleSubtraction ε ℓ N z := by have hregular := (plusSaddleFinitePoleRegularPart_analyticOnNhd hε horder ℓ N z hz).continuousAt have hsubtraction := (plusSaddleFinitePoleSubtraction_differentiableAt_of_not_pole hε horder ℓ N hpole).continuousAt have hpunctured := plusSaddleFinitePoleRegularPart_eq_on_punctured hε horder ℓ N hz exact ((hregular.eventuallyEq_nhds_iff_eventuallyEq_nhdsNE hsubtraction).mp hpunctured).eq_of_nhds theorem minusSaddleFinitePoleRegularPart_eq_subtraction_of_not_pole {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) {z : ℂ} (hz : z ∈ saddleFinitePoleHalfPlane N) (hpole : ∀ n : ℕ, z ≠ (-((2 * n : ℕ) : ℂ))) : minusSaddleFinitePoleRegularPart ε ℓ N z = minusSaddleFinitePoleSubtraction ε ℓ N z := by have hregular := (minusSaddleFinitePoleRegularPart_analyticOnNhd hε horder ℓ N z hz).continuousAt have hsubtraction := (minusSaddleFinitePoleSubtraction_differentiableAt_of_not_pole hε horder ℓ N hpole).continuousAt have hpunctured := minusSaddleFinitePoleRegularPart_eq_on_punctured hε horder ℓ N hz exact ((hregular.eventuallyEq_nhds_iff_eventuallyEq_nhdsNE hsubtraction).mp hpunctured).eq_of_nhds theorem plusSaddleFinitePoleRegularPart_differentiableOn {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) : DifferentiableOn ℂ (plusSaddleFinitePoleRegularPart ε ℓ N) (saddleFinitePoleHalfPlane N) := (plusSaddleFinitePoleRegularPart_analyticOnNhd hε horder ℓ N).differentiableOn theorem minusSaddleFinitePoleRegularPart_differentiableOn {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) : DifferentiableOn ℂ (minusSaddleFinitePoleRegularPart ε ℓ N) (saddleFinitePoleHalfPlane N) := (minusSaddleFinitePoleRegularPart_analyticOnNhd hε horder ℓ N).differentiableOn theorem saddleFinitePoleHalfPlane_reProdIm_subset {N : ℕ} {z w : ℂ} (hz : z ∈ saddleFinitePoleHalfPlane N) (hw : w ∈ saddleFinitePoleHalfPlane N) : ([[z.re, w.re]] ×ℂ [[z.im, w.im]]) ⊆ saddleFinitePoleHalfPlane N := by intro u hu have hre : u.re ∈ [[z.re, w.re]] := (Complex.mem_reProdIm.mp hu).1 change -(2 * ((N : ℝ) + 1)) < z.re at hz change -(2 * ((N : ℝ) + 1)) < w.re at hw change -(2 * ((N : ℝ) + 1)) < u.re rcases Set.mem_uIcc.mp hre with hleft | hright · exact hz.trans_le hleft.1 · exact hw.trans_le hright.1 def saddleMellinInversePower (r : ℝ) (z : ℂ) : ℂ := (r : ℂ) ^ (-z) theorem saddleMellinInversePower_differentiable {r : ℝ} (hr : 0 < r) : Differentiable ℂ (saddleMellinInversePower r) := by have hnonzero : (r : ℂ) ≠ 0 := by exact_mod_cast hr.ne' have hform : (fun z : ℂ => (r : ℂ) ^ (-z)) = (fun z : ℂ => Complex.exp (Complex.log (r : ℂ) * (-z))) := by funext z exact Complex.cpow_def_of_ne_zero hnonzero (-z) change Differentiable ℂ (fun z : ℂ => (r : ℂ) ^ (-z)) rw [hform] fun_prop def saddleGaussianPoleSlope (z : ℂ) : ℂ := dslope (fun w : ℂ => Complex.exp (w ^ 2)) 0 z theorem saddleGaussianPoleSlope_differentiable : Differentiable ℂ saddleGaussianPoleSlope := by have hgaussian : Differentiable ℂ (fun w : ℂ => Complex.exp (w ^ 2)) := by fun_prop unfold saddleGaussianPoleSlope exact differentiableOn_univ.mp ((Complex.differentiableOn_dslope (s := Set.univ) (c := (0 : ℂ)) (show Set.univ ∈ 𝓝 (0 : ℂ) from univ_mem)).mpr hgaussian.differentiableOn) theorem saddleGaussianPoleSlope_mul (z : ℂ) : z * saddleGaussianPoleSlope z = Complex.exp (z ^ 2) - 1 := by have h := sub_smul_dslope (fun w : ℂ => Complex.exp (w ^ 2)) 0 z simpa [saddleGaussianPoleSlope, smul_eq_mul] using! h theorem saddleGaussianPoleSlope_eq_of_ne {z : ℂ} (hz : z ≠ 0) : saddleGaussianPoleSlope z = (Complex.exp (z ^ 2) - 1) / z := by apply (eq_div_iff hz).2 simpa [mul_comm] using! saddleGaussianPoleSlope_mul z def saddleGaussianPoleRepresentative (n : ℕ) (z : ℂ) : ℂ := Complex.exp ((z + ((2 * n : ℕ) : ℂ)) ^ 2) / (z + ((2 * n : ℕ) : ℂ)) def plusSaddleFiniteRapidPoleSubtraction (ε ℓ : ℝ) (N : ℕ) (z : ℂ) : ℂ := plusSaddleMellinData ε ℓ z - ∑ n ∈ Finset.range (N + 1), plusSaddlePoleResidue ε ℓ n * saddleGaussianPoleRepresentative n z def minusSaddleFiniteRapidPoleSubtraction (ε ℓ : ℝ) (N : ℕ) (z : ℂ) : ℂ := minusSaddleMellinData ε ℓ z - ∑ n ∈ Finset.range (N + 1), minusSaddlePoleResidue ε ℓ n * saddleGaussianPoleRepresentative n z def plusSaddleFiniteRapidPoleRegularPart (ε ℓ : ℝ) (N : ℕ) (z : ℂ) : ℂ := plusSaddleFinitePoleRegularPart ε ℓ N z - ∑ n ∈ Finset.range (N + 1), plusSaddlePoleResidue ε ℓ n * saddleGaussianPoleSlope (z + ((2 * n : ℕ) : ℂ)) def minusSaddleFiniteRapidPoleRegularPart (ε ℓ : ℝ) (N : ℕ) (z : ℂ) : ℂ := minusSaddleFinitePoleRegularPart ε ℓ N z - ∑ n ∈ Finset.range (N + 1), minusSaddlePoleResidue ε ℓ n * saddleGaussianPoleSlope (z + ((2 * n : ℕ) : ℂ)) theorem plusSaddleFiniteRapidPoleRegularPart_differentiableOn {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) : DifferentiableOn ℂ (plusSaddleFiniteRapidPoleRegularPart ε ℓ N) (saddleFinitePoleHalfPlane N) := by unfold plusSaddleFiniteRapidPoleRegularPart apply (plusSaddleFinitePoleRegularPart_differentiableOn hε horder ℓ N).sub apply DifferentiableOn.fun_sum intro n _ have hconstant : DifferentiableOn ℂ (fun _ : ℂ => plusSaddlePoleResidue ε ℓ n) (saddleFinitePoleHalfPlane N) := by fun_prop have hslope : Differentiable ℂ (fun z : ℂ => saddleGaussianPoleSlope (z + ((2 * n : ℕ) : ℂ))) := saddleGaussianPoleSlope_differentiable.comp (by fun_prop) exact hconstant.mul hslope.differentiableOn theorem minusSaddleFiniteRapidPoleRegularPart_differentiableOn {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) : DifferentiableOn ℂ (minusSaddleFiniteRapidPoleRegularPart ε ℓ N) (saddleFinitePoleHalfPlane N) := by unfold minusSaddleFiniteRapidPoleRegularPart apply (minusSaddleFinitePoleRegularPart_differentiableOn hε horder ℓ N).sub apply DifferentiableOn.fun_sum intro n _ have hconstant : DifferentiableOn ℂ (fun _ : ℂ => minusSaddlePoleResidue ε ℓ n) (saddleFinitePoleHalfPlane N) := by fun_prop have hslope : Differentiable ℂ (fun z : ℂ => saddleGaussianPoleSlope (z + ((2 * n : ℕ) : ℂ))) := saddleGaussianPoleSlope_differentiable.comp (by fun_prop) exact hconstant.mul hslope.differentiableOn theorem plusSaddleFiniteRapidPoleRegularPart_eq_subtraction_of_not_pole {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) {z : ℂ} (hz : z ∈ saddleFinitePoleHalfPlane N) (hpole : ∀ n : ℕ, z ≠ (-((2 * n : ℕ) : ℂ))) : plusSaddleFiniteRapidPoleRegularPart ε ℓ N z = plusSaddleFiniteRapidPoleSubtraction ε ℓ N z := by unfold plusSaddleFiniteRapidPoleRegularPart plusSaddleFiniteRapidPoleSubtraction rw [plusSaddleFinitePoleRegularPart_eq_subtraction_of_not_pole hε horder ℓ N hz hpole] unfold plusSaddleFinitePoleSubtraction have hsum : (∑ n ∈ Finset.range (N + 1), plusSaddlePoleResidue ε ℓ n / (z + ((2 * n : ℕ) : ℂ))) + (∑ n ∈ Finset.range (N + 1), plusSaddlePoleResidue ε ℓ n * saddleGaussianPoleSlope (z + ((2 * n : ℕ) : ℂ))) = ∑ n ∈ Finset.range (N + 1), plusSaddlePoleResidue ε ℓ n * saddleGaussianPoleRepresentative n z := by rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro n _ have hcoordinate : z + ((2 * n : ℕ) : ℂ) ≠ 0 := by intro hzero apply hpole n linear_combination hzero rw [saddleGaussianPoleSlope_eq_of_ne hcoordinate] unfold saddleGaussianPoleRepresentative field_simp [hcoordinate] ring linear_combination -hsum theorem minusSaddleFiniteRapidPoleRegularPart_eq_subtraction_of_not_pole {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) {z : ℂ} (hz : z ∈ saddleFinitePoleHalfPlane N) (hpole : ∀ n : ℕ, z ≠ (-((2 * n : ℕ) : ℂ))) : minusSaddleFiniteRapidPoleRegularPart ε ℓ N z = minusSaddleFiniteRapidPoleSubtraction ε ℓ N z := by unfold minusSaddleFiniteRapidPoleRegularPart minusSaddleFiniteRapidPoleSubtraction rw [minusSaddleFinitePoleRegularPart_eq_subtraction_of_not_pole hε horder ℓ N hz hpole] unfold minusSaddleFinitePoleSubtraction have hsum : (∑ n ∈ Finset.range (N + 1), minusSaddlePoleResidue ε ℓ n / (z + ((2 * n : ℕ) : ℂ))) + (∑ n ∈ Finset.range (N + 1), minusSaddlePoleResidue ε ℓ n * saddleGaussianPoleSlope (z + ((2 * n : ℕ) : ℂ))) = ∑ n ∈ Finset.range (N + 1), minusSaddlePoleResidue ε ℓ n * saddleGaussianPoleRepresentative n z := by rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro n _ have hcoordinate : z + ((2 * n : ℕ) : ℂ) ≠ 0 := by intro hzero apply hpole n linear_combination hzero rw [saddleGaussianPoleSlope_eq_of_ne hcoordinate] unfold saddleGaussianPoleRepresentative field_simp [hcoordinate] ring linear_combination -hsum def plusSaddleFiniteRapidContourIntegrand (ε ℓ : ℝ) (N : ℕ) (r : ℝ) (z : ℂ) : ℂ := saddleMellinInversePower r z * plusSaddleFiniteRapidPoleRegularPart ε ℓ N z def minusSaddleFiniteRapidContourIntegrand (ε ℓ : ℝ) (N : ℕ) (r : ℝ) (z : ℂ) : ℂ := saddleMellinInversePower r z * minusSaddleFiniteRapidPoleRegularPart ε ℓ N z theorem plusSaddleFiniteRapidContourIntegrand_differentiableOn {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) {r : ℝ} (hr : 0 < r) : DifferentiableOn ℂ (plusSaddleFiniteRapidContourIntegrand ε ℓ N r) (saddleFinitePoleHalfPlane N) := by unfold plusSaddleFiniteRapidContourIntegrand exact (saddleMellinInversePower_differentiable hr).differentiableOn.mul (plusSaddleFiniteRapidPoleRegularPart_differentiableOn hε horder ℓ N) theorem minusSaddleFiniteRapidContourIntegrand_differentiableOn {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) {r : ℝ} (hr : 0 < r) : DifferentiableOn ℂ (minusSaddleFiniteRapidContourIntegrand ε ℓ N r) (saddleFinitePoleHalfPlane N) := by unfold minusSaddleFiniteRapidContourIntegrand exact (saddleMellinInversePower_differentiable hr).differentiableOn.mul (minusSaddleFiniteRapidPoleRegularPart_differentiableOn hε horder ℓ N) theorem plusSaddleFiniteRapidContourIntegrand_boundary_rectangle {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) {r : ℝ} (hr : 0 < r) (z w : ℂ) (hz : z ∈ saddleFinitePoleHalfPlane N) (hw : w ∈ saddleFinitePoleHalfPlane N) : (∫ x : ℝ in z.re..w.re, plusSaddleFiniteRapidContourIntegrand ε ℓ N r (x + z.im * Complex.I)) - (∫ x : ℝ in z.re..w.re, plusSaddleFiniteRapidContourIntegrand ε ℓ N r (x + w.im * Complex.I)) + Complex.I • (∫ y : ℝ in z.im..w.im, plusSaddleFiniteRapidContourIntegrand ε ℓ N r (w.re + y * Complex.I)) - Complex.I • (∫ y : ℝ in z.im..w.im, plusSaddleFiniteRapidContourIntegrand ε ℓ N r (z.re + y * Complex.I)) = 0 := by refine Complex.integral_boundary_rect_eq_zero_of_differentiableOn (plusSaddleFiniteRapidContourIntegrand ε ℓ N r) z w ?_ exact (plusSaddleFiniteRapidContourIntegrand_differentiableOn hε horder ℓ N hr).mono (saddleFinitePoleHalfPlane_reProdIm_subset hz hw) theorem minusSaddleFiniteRapidContourIntegrand_boundary_rectangle {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (N : ℕ) {r : ℝ} (hr : 0 < r) (z w : ℂ) (hz : z ∈ saddleFinitePoleHalfPlane N) (hw : w ∈ saddleFinitePoleHalfPlane N) : (∫ x : ℝ in z.re..w.re, minusSaddleFiniteRapidContourIntegrand ε ℓ N r (x + z.im * Complex.I)) - (∫ x : ℝ in z.re..w.re, minusSaddleFiniteRapidContourIntegrand ε ℓ N r (x + w.im * Complex.I)) + Complex.I • (∫ y : ℝ in z.im..w.im, minusSaddleFiniteRapidContourIntegrand ε ℓ N r (w.re + y * Complex.I)) - Complex.I • (∫ y : ℝ in z.im..w.im, minusSaddleFiniteRapidContourIntegrand ε ℓ N r (z.re + y * Complex.I)) = 0 := by refine Complex.integral_boundary_rect_eq_zero_of_differentiableOn (minusSaddleFiniteRapidContourIntegrand ε ℓ N r) z w ?_ exact (minusSaddleFiniteRapidContourIntegrand_differentiableOn hε horder ℓ N hr).mono (saddleFinitePoleHalfPlane_reProdIm_subset hz hw) theorem saddleMellinEnvelope_vertical (ε ℓ t : ℝ) : saddleMellinEnvelope ε ℓ ((ℓ : ℂ) - Complex.I * (t : ℂ)) = saddleEnvelope ε ℓ t := by have hfrequency : Complex.I * (((ℓ : ℂ) - Complex.I * (t : ℂ)) - (ℓ : ℂ)) / (ℓ : ℂ) = (t : ℂ) / (ℓ : ℂ) := by congr 1 ring_nf simp [Complex.I_sq] have hpi : (((ℓ : ℂ) - ((ℓ : ℂ) - Complex.I * (t : ℂ))) * (Real.log Real.pi : ℂ) / 2) = Complex.I * (t : ℂ) * (Real.log Real.pi : ℂ) / 2 := by ring unfold saddleMellinEnvelope saddleEnvelope rw [hfrequency, hpi] theorem plusSaddleMellinData_vertical (ε ℓ t : ℝ) : plusSaddleMellinData ε ℓ ((ℓ : ℂ) - Complex.I * (t : ℂ)) = plusSaddleSpectrum ε ℓ t := by have hfrequency : Complex.I * (((ℓ : ℂ) - Complex.I * (t : ℂ)) - (ℓ : ℂ)) / (ℓ : ℂ) = (t : ℂ) / (ℓ : ℂ) := by congr 1 ring_nf simp [Complex.I_sq] unfold plusSaddleMellinData plusSaddleSpectrum rw [saddleMellinEnvelope_vertical, hfrequency] theorem minusSaddleMellinData_vertical (ε ℓ t : ℝ) : minusSaddleMellinData ε ℓ ((ℓ : ℂ) - Complex.I * (t : ℂ)) = minusSaddleSpectrum ε ℓ t := by have hfrequency : Complex.I * (((ℓ : ℂ) - Complex.I * (t : ℂ)) - (ℓ : ℂ)) / (ℓ : ℂ) = (t : ℂ) / (ℓ : ℂ) := by congr 1 ring_nf simp [Complex.I_sq] unfold minusSaddleMellinData minusSaddleSpectrum rw [saddleMellinEnvelope_vertical, hfrequency] def plusSaddleProfile (ε ℓ r : ℝ) : ℂ := if r = 0 then (saddleOriginValue ε ℓ : ℂ) else mellinInv ℓ (plusSaddleMellinData ε ℓ) r def minusSaddleProfile (ε ℓ r : ℝ) : ℂ := if r = 0 then (saddleOriginValue ε ℓ : ℂ) else mellinInv ℓ (minusSaddleMellinData ε ℓ) r def plusSaddleFunction (ε : ℝ) (d : ℕ) (x : Euclidean d) : ℂ := plusSaddleProfile ε ((d : ℝ) / 2) ‖x‖ def minusSaddleFunction (ε : ℝ) (d : ℕ) (x : Euclidean d) : ℂ := minusSaddleProfile ε ((d : ℝ) / 2) ‖x‖ theorem plusSaddleFunction_radial (ε : ℝ) (d : ℕ) (x y : Euclidean d) (hxy : ‖x‖ = ‖y‖) : plusSaddleFunction ε d x = plusSaddleFunction ε d y := by simp only [plusSaddleFunction, hxy] theorem minusSaddleFunction_radial (ε : ℝ) (d : ℕ) (x y : Euclidean d) (hxy : ‖x‖ = ‖y‖) : minusSaddleFunction ε d x = minusSaddleFunction ε d y := by simp only [minusSaddleFunction, hxy] @[simp] theorem plusSaddleFunction_zero (ε : ℝ) (d : ℕ) : plusSaddleFunction ε d (0 : Euclidean d) = (saddleOriginValue ε ((d : ℝ) / 2) : ℂ) := by simp [plusSaddleFunction, plusSaddleProfile] @[simp] theorem minusSaddleFunction_zero (ε : ℝ) (d : ℕ) : minusSaddleFunction ε d (0 : Euclidean d) = (saddleOriginValue ε ((d : ℝ) / 2) : ℂ) := by simp [minusSaddleFunction, minusSaddleProfile] theorem saddleFunction_zero_pos {ε : ℝ} (hε : 0 < ε) (d : ℕ) : 0 < (plusSaddleFunction ε d (0 : Euclidean d)).re ∧ 0 < (minusSaddleFunction ε d (0 : Euclidean d)).re := by constructor · simpa using! saddleOriginValue_pos hε ((d : ℝ) / 2) · simpa using! saddleOriginValue_pos hε ((d : ℝ) / 2) theorem minusPolynomial_neg (ε : ℝ) (z : ℂ) : minusPolynomial ε (-z) = plusPolynomial ε z := by unfold minusPolynomial plusPolynomial ring theorem plusPolynomial_conj (ε : ℝ) (z : ℂ) : starRingEnd ℂ (plusPolynomial ε z) = minusPolynomial ε (starRingEnd ℂ z) := by unfold plusPolynomial minusPolynomial simp only [map_add, map_mul, map_pow, map_one, Complex.conj_ofReal, Complex.conj_I] ring theorem minusPolynomial_conj (ε : ℝ) (z : ℂ) : starRingEnd ℂ (minusPolynomial ε z) = plusPolynomial ε (starRingEnd ℂ z) := by unfold minusPolynomial plusPolynomial simp only [map_add, map_sub, map_mul, map_pow, map_one, Complex.conj_ofReal, Complex.conj_I] ring theorem norm_plusPolynomial_le (ε : ℝ) (z : ℂ) : ‖plusPolynomial ε z‖ ≤ (1 + |beta ε|) * (1 + ‖z‖) ^ 3 := by have hz : 0 ≤ ‖z‖ := norm_nonneg _ have hbase : ‖(1 : ℂ) + z ^ 2‖ ≤ 1 + ‖z‖ ^ 2 := by calc ‖(1 : ℂ) + z ^ 2‖ ≤ ‖(1 : ℂ)‖ + ‖z ^ 2‖ := norm_add_le _ _ _ = 1 + ‖z‖ ^ 2 := by simp [norm_pow] have hsq : 1 + ‖z‖ ^ 2 ≤ (1 + ‖z‖) ^ 2 := by nlinarith have hcube : (1 : ℝ) ≤ (1 + ‖z‖) ^ 3 := one_le_pow₀ (by linarith) unfold plusPolynomial calc ‖1 + z ^ 2 + (beta ε : ℂ) + Complex.I * z * (1 + z ^ 2)‖ ≤ ‖1 + z ^ 2 + (beta ε : ℂ)‖ + ‖Complex.I * z * (1 + z ^ 2)‖ := norm_add_le _ _ _ ≤ (1 + ‖z‖ ^ 2 + |beta ε|) + ‖z‖ * (1 + ‖z‖ ^ 2) := by have hfirst : ‖1 + z ^ 2 + (beta ε : ℂ)‖ ≤ 1 + ‖z‖ ^ 2 + |beta ε| := by calc ‖1 + z ^ 2 + (beta ε : ℂ)‖ ≤ ‖1 + z ^ 2‖ + ‖(beta ε : ℂ)‖ := norm_add_le _ _ _ ≤ 1 + ‖z‖ ^ 2 + |beta ε| := by simpa using! add_le_add_right hbase |beta ε| have hsecond : ‖Complex.I * z * (1 + z ^ 2)‖ ≤ ‖z‖ * (1 + ‖z‖ ^ 2) := by rw [norm_mul, norm_mul, Complex.norm_I, one_mul] gcongr exact add_le_add hfirst hsecond _ ≤ (1 + ‖z‖) ^ 2 + |beta ε| + ‖z‖ * (1 + ‖z‖) ^ 2 := by gcongr _ = (1 + ‖z‖) ^ 3 + |beta ε| := by ring _ ≤ (1 + |beta ε|) * (1 + ‖z‖) ^ 3 := by nlinarith [mul_le_mul_of_nonneg_left hcube (abs_nonneg (beta ε))] theorem norm_minusPolynomial_le (ε : ℝ) (z : ℂ) : ‖minusPolynomial ε z‖ ≤ (1 + |beta ε|) * (1 + ‖z‖) ^ 3 := by have h := norm_plusPolynomial_le ε (starRingEnd ℂ z) rw [RCLike.norm_conj] at h have hconj := plusPolynomial_conj ε (starRingEnd ℂ z) rw [Complex.conj_conj] at hconj rw [← hconj, RCLike.norm_conj] exact h theorem norm_complexGamma_le_realGamma {z : ℂ} (hz : 0 < z.re) : ‖Complex.Gamma z‖ ≤ Real.Gamma z.re := by rw [Complex.Gamma_eq_integral hz, Complex.GammaIntegral, Real.Gamma_eq_integral hz] calc ‖∫ x in Set.Ioi (0 : ℝ), (Real.exp (-x) : ℂ) * (x : ℂ) ^ (z - 1)‖ ≤ ∫ x in Set.Ioi (0 : ℝ), ‖(Real.exp (-x) : ℂ) * (x : ℂ) ^ (z - 1)‖ := norm_integral_le_integral_norm _ _ = ∫ x in Set.Ioi (0 : ℝ), Real.exp (-x) * x ^ (z.re - 1) := by apply setIntegral_congr_fun measurableSet_Ioi intro x hx try dsimp rw [norm_mul, Complex.norm_of_nonneg (Real.exp_pos (-x)).le, Complex.norm_cpow_eq_rpow_re_of_pos hx] simp theorem complexGamma_vertical_polynomial_bound {z : ℂ} (hz : 0 < z.re) (k : ℕ) : |z.im| ^ k * ‖Complex.Gamma z‖ ≤ Real.Gamma (z.re + k) := by have hnonzero : ∀ j : ℕ, z + (j : ℂ) ≠ 0 := by intro j hzero have hre := congrArg Complex.re hzero norm_num at hre have hj : 0 ≤ (j : ℝ) := Nat.cast_nonneg j linarith have hprod : |z.im| ^ k ≤ ∏ j ∈ Finset.range k, ‖z + (j : ℂ)‖ := by simpa using! (Finset.prod_le_prod (s := Finset.range k) (f := fun _ : ℕ => |z.im|) (g := fun j : ℕ => ‖z + (j : ℂ)‖) (fun _ _ => abs_nonneg _) (fun j _ => by simpa using! Complex.abs_im_le_norm (z + (j : ℂ)))) have hshift : 0 < (z + (k : ℂ)).re := by simpa using! add_pos_of_pos_of_nonneg hz (Nat.cast_nonneg k) calc |z.im| ^ k * ‖Complex.Gamma z‖ ≤ (∏ j ∈ Finset.range k, ‖z + (j : ℂ)‖) * ‖Complex.Gamma z‖ := by gcongr _ = ‖Complex.Gamma z * ∏ j ∈ Finset.range k, (z + (j : ℂ))‖ := by rw [norm_mul, norm_prod] ring _ = ‖Complex.Gamma (z + (k : ℂ))‖ := by rw [gamma_add_nat_eq_product z hnonzero k] _ ≤ Real.Gamma (z.re + k) := by simpa using! norm_complexGamma_le_realGamma hshift theorem complexGamma_shifted_vertical_polynomial_bound {z : ℂ} (hz : z.im ≠ 0) (k : ℕ) (hshift : 0 < z.re + k) : |z.im| ^ k * ‖Complex.Gamma z‖ ≤ Real.Gamma (z.re + k) := by have hnonzero : ∀ j : ℕ, z + (j : ℂ) ≠ 0 := by intro j hzero apply hz have him := congrArg Complex.im hzero simpa using! him have hprod : |z.im| ^ k ≤ ∏ j ∈ Finset.range k, ‖z + (j : ℂ)‖ := by simpa using! (Finset.prod_le_prod (s := Finset.range k) (f := fun _ : ℕ => |z.im|) (g := fun j : ℕ => ‖z + (j : ℂ)‖) (fun _ _ => abs_nonneg _) (fun j _ => by simpa using! Complex.abs_im_le_norm (z + (j : ℂ)))) have hpositive : 0 < (z + (k : ℂ)).re := by simpa using! hshift calc |z.im| ^ k * ‖Complex.Gamma z‖ ≤ (∏ j ∈ Finset.range k, ‖z + (j : ℂ)‖) * ‖Complex.Gamma z‖ := by gcongr _ = ‖Complex.Gamma z * ∏ j ∈ Finset.range k, (z + (j : ℂ))‖ := by rw [norm_mul, norm_prod] ring _ = ‖Complex.Gamma (z + (k : ℂ))‖ := by rw [gamma_add_nat_eq_product z hnonzero k] _ ≤ Real.Gamma (z.re + k) := by simpa using! norm_complexGamma_le_realGamma hpositive theorem saddleGamma_shiftedLine_polynomial_bound (a : ℝ) {t : ℝ} (ht : 1 ≤ |t|) (k m : ℕ) (hshift : 0 < a / 2 + (k : ℝ)) : |t| ^ m * ‖Complex.Gamma (((a : ℂ) + (t : ℂ) * Complex.I) / 2)‖ ≤ (2 : ℝ) ^ (k + m) * Real.Gamma (a / 2 + ((k + m : ℕ) : ℝ)) := by let z : ℂ := ((a : ℂ) + (t : ℂ) * Complex.I) / 2 have hre : z.re = a / 2 := by try dsimp [z] norm_num [Complex.mul_re, Complex.mul_im] have him : z.im = t / 2 := by try dsimp [z] norm_num [Complex.mul_re, Complex.mul_im] have htzero : t ≠ 0 := by intro hzero have himpossible : (1 : ℝ) ≤ 0 := by simpa [hzero] using! ht norm_num at himpossible have hnonzero : z.im ≠ 0 := by rw [him] exact div_ne_zero htzero (by norm_num) have hpositive : 0 < z.re + ((k + m : ℕ) : ℝ) := by rw [hre, Nat.cast_add] have hm : (0 : ℝ) ≤ (m : ℝ) := Nat.cast_nonneg m linarith have hgamma : (|t| / 2) ^ (k + m) * ‖Complex.Gamma z‖ ≤ Real.Gamma (a / 2 + ((k + m : ℕ) : ℝ)) := by simpa [hre, him, abs_div] using! (complexGamma_shifted_vertical_polynomial_bound hnonzero (k + m) hpositive) have hpow : |t| ^ m ≤ |t| ^ (k + m) := pow_le_pow_right₀ ht (by omega) change |t| ^ m * ‖Complex.Gamma z‖ ≤ _ calc |t| ^ m * ‖Complex.Gamma z‖ ≤ |t| ^ (k + m) * ‖Complex.Gamma z‖ := by gcongr _ = (2 : ℝ) ^ (k + m) * ((|t| / 2) ^ (k + m) * ‖Complex.Gamma z‖) := by rw [div_pow] field_simp _ ≤ (2 : ℝ) ^ (k + m) * Real.Gamma (a / 2 + ((k + m : ℕ) : ℝ)) := by gcongr theorem norm_complexCos_le_cosh_im (z : ℂ) : ‖Complex.cos z‖ ≤ Real.cosh z.im := by change ‖(Complex.exp (z * Complex.I) + Complex.exp (-z * Complex.I)) / 2‖ ≤ Real.cosh z.im calc ‖(Complex.exp (z * Complex.I) + Complex.exp (-z * Complex.I)) / 2‖ = ‖Complex.exp (z * Complex.I) + Complex.exp (-z * Complex.I)‖ / 2 := by rw [norm_div] norm_num _ ≤ (‖Complex.exp (z * Complex.I)‖ + ‖Complex.exp (-z * Complex.I)‖) / 2 := by gcongr exact norm_add_le _ _ _ = Real.cosh z.im := by rw [Complex.norm_exp, Complex.norm_exp, Real.cosh_eq] simp [Complex.mul_re, add_comm] def saddleHorizontalShellVariation (ε H : ℝ) : ℝ := (∫ a in shortCutoff ε..shortEndpoint ε, |shortShellDensity ε a| * (Real.cosh (a * H) + 1)) + (∫ a in shellLocation ε..shellLocation ε + 1, |positiveShellDensity ε a| * (Real.cosh (a * H) + 1)) theorem saddleHorizontalShellVariation_mono {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) {H K : ℝ} (hH : 0 ≤ H) (hHK : H ≤ K) : saddleHorizontalShellVariation ε H ≤ saddleHorizontalShellVariation ε K := by have hK : 0 ≤ K := hH.trans hHK have hcosH : Continuous (fun a : ℝ => Real.cosh (a * H) + 1) := by fun_prop have hcosK : Continuous (fun a : ℝ => Real.cosh (a * K) + 1) := by fun_prop have hcos (a : ℝ) : Real.cosh (a * H) ≤ Real.cosh (a * K) := by apply Real.cosh_le_cosh.mpr rw [abs_mul, abs_mul, abs_of_nonneg hH, abs_of_nonneg hK] exact mul_le_mul_of_nonneg_left hHK (abs_nonneg a) have hshort : (∫ a in shortCutoff ε..shortEndpoint ε, |shortShellDensity ε a| * (Real.cosh (a * H) + 1)) ≤ (∫ a in shortCutoff ε..shortEndpoint ε, |shortShellDensity ε a| * (Real.cosh (a * K) + 1)) := by apply intervalIntegral.integral_mono_on horder ((shortShellDensity_intervalIntegrable hε horder).abs |>.mul_continuousOn hcosH.continuousOn) ((shortShellDensity_intervalIntegrable hε horder).abs |>.mul_continuousOn hcosK.continuousOn) intro a _ gcongr exact hcos a have hB : shellLocation ε ≤ shellLocation ε + 1 := by linarith have hp : IntervalIntegrable (positiveShellDensity ε) volume (shellLocation ε) (shellLocation ε + 1) := (positiveShellDensity_continuous ε).intervalIntegrable (shellLocation ε) (shellLocation ε + 1) have hpositive : (∫ a in shellLocation ε..shellLocation ε + 1, |positiveShellDensity ε a| * (Real.cosh (a * H) + 1)) ≤ (∫ a in shellLocation ε..shellLocation ε + 1, |positiveShellDensity ε a| * (Real.cosh (a * K) + 1)) := by apply intervalIntegral.integral_mono_on hB (hp.abs.mul_continuousOn hcosH.continuousOn) (hp.abs.mul_continuousOn hcosK.continuousOn) intro a _ gcongr exact hcos a exact add_le_add hshort hpositive theorem norm_mellinShellPhase_le_horizontalVariation {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) {z : ℂ} {H : ℝ} (hstrip : |z.im| ≤ H) : ‖mellinShellPhase ε z‖ ≤ saddleHorizontalShellVariation ε H := by have hH : 0 ≤ H := (abs_nonneg z.im).trans hstrip have hcutoff : 0 < shortCutoff ε := by unfold shortCutoff positivity have hlocation : 0 < shellLocation ε := by unfold shellLocation positivity have hcosh : Continuous (fun a : ℝ => Real.cosh (a * H) + 1) := by fun_prop have hcos (a : ℝ) (ha : 0 ≤ a) : ‖Complex.cos ((a : ℂ) * z) - 1‖ ≤ Real.cosh (a * H) + 1 := by have him : |((a : ℂ) * z).im| ≤ |a * H| := by simp only [Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, zero_mul, add_zero, abs_mul, abs_of_nonneg ha, abs_of_nonneg hH] exact mul_le_mul_of_nonneg_left hstrip ha calc ‖Complex.cos ((a : ℂ) * z) - 1‖ ≤ ‖Complex.cos ((a : ℂ) * z)‖ + ‖(1 : ℂ)‖ := norm_sub_le _ _ _ = ‖Complex.cos ((a : ℂ) * z)‖ + 1 := by norm_num _ ≤ Real.cosh ((a : ℂ) * z).im + 1 := by gcongr exact norm_complexCos_le_cosh_im ((a : ℂ) * z) _ ≤ Real.cosh (a * H) + 1 := by gcongr exact Real.cosh_le_cosh.mpr him have hshort : ‖∫ a in shortCutoff ε..shortEndpoint ε, (shortShellDensity ε a : ℂ) * (Complex.cos ((a : ℂ) * z) - 1)‖ ≤ ∫ a in shortCutoff ε..shortEndpoint ε, |shortShellDensity ε a| * (Real.cosh (a * H) + 1) := by apply intervalIntegral.norm_integral_le_of_norm_le horder · exact Filter.Eventually.of_forall (fun a ha => by rw [norm_mul, Complex.norm_real, Real.norm_eq_abs] exact mul_le_mul_of_nonneg_left (hcos a (hcutoff.le.trans ha.1.le)) (abs_nonneg (shortShellDensity ε a))) · exact (shortShellDensity_intervalIntegrable hε horder).abs.mul_continuousOn hcosh.continuousOn have hB : shellLocation ε ≤ shellLocation ε + 1 := by linarith have hpositive : ‖∫ a in shellLocation ε..shellLocation ε + 1, (positiveShellDensity ε a : ℂ) * (Complex.cos ((a : ℂ) * z) - 1)‖ ≤ ∫ a in shellLocation ε..shellLocation ε + 1, |positiveShellDensity ε a| * (Real.cosh (a * H) + 1) := by apply intervalIntegral.norm_integral_le_of_norm_le hB · exact Filter.Eventually.of_forall (fun a ha => by rw [norm_mul, Complex.norm_real, Real.norm_eq_abs] exact mul_le_mul_of_nonneg_left (hcos a (hlocation.le.trans ha.1.le)) (abs_nonneg (positiveShellDensity ε a))) · exact ((positiveShellDensity_continuous ε).intervalIntegrable (shellLocation ε) (shellLocation ε + 1)).abs.mul_continuousOn hcosh.continuousOn unfold mellinShellPhase saddleHorizontalShellVariation exact (norm_add_le _ _).trans (add_le_add hshort hpositive) theorem norm_saddleShellExponential_horizontal_le {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (z : ℂ) : ‖Complex.exp ((ℓ : ℂ) * mellinShellPhase ε z)‖ ≤ Real.exp (|ℓ| * saddleHorizontalShellVariation ε |z.im|) := by rw [Complex.norm_exp] apply Real.exp_le_exp.mpr calc (((ℓ : ℂ) * mellinShellPhase ε z)).re ≤ ‖(ℓ : ℂ) * mellinShellPhase ε z‖ := Complex.re_le_norm _ _ = |ℓ| * ‖mellinShellPhase ε z‖ := by rw [norm_mul, Complex.norm_real, Real.norm_eq_abs] _ ≤ |ℓ| * saddleHorizontalShellVariation ε |z.im| := by gcongr exact norm_mellinShellPhase_le_horizontalVariation hε horder (le_refl |z.im|) theorem saddleMellinShellArgument_shiftedLine {ℓ : ℝ} (hℓ : 0 < ℓ) (a t : ℝ) : Complex.I * (((a : ℂ) + (t : ℂ) * Complex.I) - (ℓ : ℂ)) / (ℓ : ℂ) = ((-t / ℓ : ℝ) : ℂ) + Complex.I * (((a - ℓ) / ℓ : ℝ) : ℂ) := by have hnonzero : (ℓ : ℂ) ≠ 0 := by exact_mod_cast hℓ.ne' push_cast field_simp [hnonzero] ring_nf simp [Complex.I_sq]; ring theorem saddleMellinPiFactor_shiftedLine_norm (ℓ a t : ℝ) : ‖Complex.exp (((ℓ : ℂ) - ((a : ℂ) + (t : ℂ) * Complex.I)) * (Real.log Real.pi : ℂ) / 2)‖ = Real.exp ((ℓ - a) * Real.log Real.pi / 2) := by rw [Complex.norm_exp] congr 1 simp [Complex.mul_re, Complex.mul_im] theorem norm_saddleShellExponential_shiftedLine_le {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (a t : ℝ) : ‖Complex.exp ((ℓ : ℂ) * mellinShellPhase ε (Complex.I * (((a : ℂ) + (t : ℂ) * Complex.I) - (ℓ : ℂ)) / (ℓ : ℂ)))‖ ≤ Real.exp (ℓ * saddleHorizontalShellVariation ε |(a - ℓ) / ℓ|) := by calc _ ≤ Real.exp (|ℓ| * saddleHorizontalShellVariation ε |(Complex.I * (((a : ℂ) + (t : ℂ) * Complex.I) - (ℓ : ℂ)) / (ℓ : ℂ)).im|) := norm_saddleShellExponential_horizontal_le hε horder ℓ _ _ = _ := by rw [saddleMellinShellArgument_shiftedLine hℓ a t] simp [Complex.mul_im, abs_of_pos hℓ] theorem saddleMellinShellArgument_shiftedLine_norm_le {ℓ : ℝ} (hℓ : 0 < ℓ) (a t : ℝ) : ‖Complex.I * (((a : ℂ) + (t : ℂ) * Complex.I) - (ℓ : ℂ)) / (ℓ : ℂ)‖ ≤ |t| / ℓ + |(a - ℓ) / ℓ| := by rw [saddleMellinShellArgument_shiftedLine hℓ a t] calc ‖((-t / ℓ : ℝ) : ℂ) + Complex.I * (((a - ℓ) / ℓ : ℝ) : ℂ)‖ ≤ ‖((-t / ℓ : ℝ) : ℂ)‖ + ‖Complex.I * (((a - ℓ) / ℓ : ℝ) : ℂ)‖ := norm_add_le _ _ _ = |t| / ℓ + |(a - ℓ) / ℓ| := by simp [Complex.norm_real, Real.norm_eq_abs, abs_div, abs_of_pos hℓ] rw [← Complex.ofReal_sub, Complex.norm_real, Real.norm_eq_abs] theorem saddleMellinShellArgument_shiftedLine_linear_le {ℓ : ℝ} (hℓ : 0 < ℓ) (a : ℝ) {t : ℝ} (ht : 1 ≤ |t|) : 1 + ‖Complex.I * (((a : ℂ) + (t : ℂ) * Complex.I) - (ℓ : ℂ)) / (ℓ : ℂ)‖ ≤ (1 + ℓ⁻¹ + |(a - ℓ) / ℓ|) * |t| := by have hargument := saddleMellinShellArgument_shiftedLine_norm_le hℓ a t have hoffset := mul_le_mul_of_nonneg_left ht (abs_nonneg ((a - ℓ) / ℓ)) calc _ ≤ 1 + (|t| / ℓ + |(a - ℓ) / ℓ|) := by gcongr _ ≤ |t| + |t| / ℓ + |(a - ℓ) / ℓ| * |t| := by linarith _ = _ := by rw [div_eq_mul_inv] ring theorem norm_plusPolynomial_shiftedLine_le {ε ℓ : ℝ} (hℓ : 0 < ℓ) (a : ℝ) {t : ℝ} (ht : 1 ≤ |t|) : ‖plusPolynomial ε (Complex.I * (((a : ℂ) + (t : ℂ) * Complex.I) - (ℓ : ℂ)) / (ℓ : ℂ))‖ ≤ (1 + |beta ε|) * (1 + ℓ⁻¹ + |(a - ℓ) / ℓ|) ^ 3 * |t| ^ 3 := by calc _ ≤ (1 + |beta ε|) * (1 + ‖Complex.I * (((a : ℂ) + (t : ℂ) * Complex.I) - (ℓ : ℂ)) / (ℓ : ℂ)‖) ^ 3 := norm_plusPolynomial_le ε _ _ ≤ (1 + |beta ε|) * ((1 + ℓ⁻¹ + |(a - ℓ) / ℓ|) * |t|) ^ 3 := by gcongr exact saddleMellinShellArgument_shiftedLine_linear_le hℓ a ht _ = _ := by rw [mul_pow] ring theorem norm_minusPolynomial_shiftedLine_le {ε ℓ : ℝ} (hℓ : 0 < ℓ) (a : ℝ) {t : ℝ} (ht : 1 ≤ |t|) : ‖minusPolynomial ε (Complex.I * (((a : ℂ) + (t : ℂ) * Complex.I) - (ℓ : ℂ)) / (ℓ : ℂ))‖ ≤ (1 + |beta ε|) * (1 + ℓ⁻¹ + |(a - ℓ) / ℓ|) ^ 3 * |t| ^ 3 := by calc _ ≤ (1 + |beta ε|) * (1 + ‖Complex.I * (((a : ℂ) + (t : ℂ) * Complex.I) - (ℓ : ℂ)) / (ℓ : ℂ)‖) ^ 3 := norm_minusPolynomial_le ε _ _ ≤ (1 + |beta ε|) * ((1 + ℓ⁻¹ + |(a - ℓ) / ℓ|) * |t|) ^ 3 := by gcongr exact saddleMellinShellArgument_shiftedLine_linear_le hℓ a ht _ = _ := by rw [mul_pow] ring def saddleShiftedLineMajorant (ε ℓ a : ℝ) (k m : ℕ) : ℝ := ((1 + |beta ε|) * (1 + ℓ⁻¹ + |(a - ℓ) / ℓ|) ^ 3) * ((2 : ℝ) ^ (k + (m + 3)) * Real.Gamma (a / 2 + ((k + (m + 3) : ℕ) : ℝ))) * Real.exp ((ℓ - a) * Real.log Real.pi / 2) * Real.exp (ℓ * saddleHorizontalShellVariation ε |(a - ℓ) / ℓ|) theorem saddleShiftedLineMajorant_nonneg {ε ℓ a : ℝ} (hℓ : 0 < ℓ) (k m : ℕ) (hshift : 0 < a / 2 + (k : ℝ)) : 0 ≤ saddleShiftedLineMajorant ε ℓ a k m := by have hgammaarg : 0 < a / 2 + ((k + (m + 3) : ℕ) : ℝ) := by rw [Nat.cast_add] have hm : (0 : ℝ) ≤ ((m + 3 : ℕ) : ℝ) := Nat.cast_nonneg _ linarith unfold saddleShiftedLineMajorant positivity [Real.Gamma_pos_of_pos hgammaarg] theorem plusSaddleMellinData_shiftedLine_polynomial_bound {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (a : ℝ) {t : ℝ} (ht : 1 ≤ |t|) (k m : ℕ) (hshift : 0 < a / 2 + (k : ℝ)) : |t| ^ m * ‖plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)‖ ≤ saddleShiftedLineMajorant ε ℓ a k m := by let z : ℂ := (a : ℂ) + (t : ℂ) * Complex.I let q : ℂ := Complex.I * (z - (ℓ : ℂ)) / (ℓ : ℂ) let C : ℝ := (1 + |beta ε|) * (1 + ℓ⁻¹ + |(a - ℓ) / ℓ|) ^ 3 let G : ℝ := (2 : ℝ) ^ (k + (m + 3)) * Real.Gamma (a / 2 + ((k + (m + 3) : ℕ) : ℝ)) have hC : 0 ≤ C := by try dsimp [C] positivity have hgammaarg : 0 < a / 2 + ((k + (m + 3) : ℕ) : ℝ) := by rw [Nat.cast_add] have hm : (0 : ℝ) ≤ ((m + 3 : ℕ) : ℝ) := Nat.cast_nonneg _ linarith have hG : 0 ≤ G := by try dsimp [G] positivity [Real.Gamma_pos_of_pos hgammaarg] have hgamma : |t| ^ (m + 3) * ‖Complex.Gamma (z / 2)‖ ≤ G := by simpa [z, G] using! (saddleGamma_shiftedLine_polynomial_bound a ht k (m + 3) hshift) have hpoly : ‖plusPolynomial ε q‖ ≤ C * |t| ^ 3 := by simpa [q, z, C] using! (norm_plusPolynomial_shiftedLine_le (ε := ε) hℓ a ht) have hpi : ‖Complex.exp (((ℓ : ℂ) - z) * (Real.log Real.pi : ℂ) / 2)‖ = Real.exp ((ℓ - a) * Real.log Real.pi / 2) := by simpa [z] using! saddleMellinPiFactor_shiftedLine_norm ℓ a t have hshell : ‖Complex.exp ((ℓ : ℂ) * mellinShellPhase ε q)‖ ≤ Real.exp (ℓ * saddleHorizontalShellVariation ε |(a - ℓ) / ℓ|) := by simpa [q, z] using! norm_saddleShellExponential_shiftedLine_le hε hℓ horder a t change |t| ^ m * ‖plusSaddleMellinData ε ℓ z‖ ≤ _ calc |t| ^ m * ‖plusSaddleMellinData ε ℓ z‖ = |t| ^ m * ‖Complex.Gamma (z / 2)‖ * ‖Complex.exp (((ℓ : ℂ) - z) * (Real.log Real.pi : ℂ) / 2)‖ * ‖Complex.exp ((ℓ : ℂ) * mellinShellPhase ε q)‖ * ‖plusPolynomial ε q‖ := by unfold plusSaddleMellinData saddleMellinEnvelope try dsimp [q] rw [norm_mul, norm_mul, norm_mul] ring _ ≤ |t| ^ m * ‖Complex.Gamma (z / 2)‖ * ‖Complex.exp (((ℓ : ℂ) - z) * (Real.log Real.pi : ℂ) / 2)‖ * ‖Complex.exp ((ℓ : ℂ) * mellinShellPhase ε q)‖ * (C * |t| ^ 3) := by gcongr _ = C * (|t| ^ (m + 3) * ‖Complex.Gamma (z / 2)‖) * ‖Complex.exp (((ℓ : ℂ) - z) * (Real.log Real.pi : ℂ) / 2)‖ * ‖Complex.exp ((ℓ : ℂ) * mellinShellPhase ε q)‖ := by rw [pow_add] ring _ ≤ C * G * ‖Complex.exp (((ℓ : ℂ) - z) * (Real.log Real.pi : ℂ) / 2)‖ * ‖Complex.exp ((ℓ : ℂ) * mellinShellPhase ε q)‖ := by gcongr _ = C * G * Real.exp ((ℓ - a) * Real.log Real.pi / 2) * ‖Complex.exp ((ℓ : ℂ) * mellinShellPhase ε q)‖ := by rw [hpi] _ ≤ C * G * Real.exp ((ℓ - a) * Real.log Real.pi / 2) * Real.exp (ℓ * saddleHorizontalShellVariation ε |(a - ℓ) / ℓ|) := by gcongr _ = saddleShiftedLineMajorant ε ℓ a k m := by rfl theorem minusSaddleMellinData_shiftedLine_polynomial_bound {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (a : ℝ) {t : ℝ} (ht : 1 ≤ |t|) (k m : ℕ) (hshift : 0 < a / 2 + (k : ℝ)) : |t| ^ m * ‖minusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)‖ ≤ saddleShiftedLineMajorant ε ℓ a k m := by let z : ℂ := (a : ℂ) + (t : ℂ) * Complex.I let q : ℂ := Complex.I * (z - (ℓ : ℂ)) / (ℓ : ℂ) let C : ℝ := (1 + |beta ε|) * (1 + ℓ⁻¹ + |(a - ℓ) / ℓ|) ^ 3 let G : ℝ := (2 : ℝ) ^ (k + (m + 3)) * Real.Gamma (a / 2 + ((k + (m + 3) : ℕ) : ℝ)) have hC : 0 ≤ C := by try dsimp [C] positivity have hgammaarg : 0 < a / 2 + ((k + (m + 3) : ℕ) : ℝ) := by rw [Nat.cast_add] have hm : (0 : ℝ) ≤ ((m + 3 : ℕ) : ℝ) := Nat.cast_nonneg _ linarith have hG : 0 ≤ G := by try dsimp [G] positivity [Real.Gamma_pos_of_pos hgammaarg] have hgamma : |t| ^ (m + 3) * ‖Complex.Gamma (z / 2)‖ ≤ G := by simpa [z, G] using! (saddleGamma_shiftedLine_polynomial_bound a ht k (m + 3) hshift) have hpoly : ‖minusPolynomial ε q‖ ≤ C * |t| ^ 3 := by simpa [q, z, C] using! (norm_minusPolynomial_shiftedLine_le (ε := ε) hℓ a ht) have hpi : ‖Complex.exp (((ℓ : ℂ) - z) * (Real.log Real.pi : ℂ) / 2)‖ = Real.exp ((ℓ - a) * Real.log Real.pi / 2) := by simpa [z] using! saddleMellinPiFactor_shiftedLine_norm ℓ a t have hshell : ‖Complex.exp ((ℓ : ℂ) * mellinShellPhase ε q)‖ ≤ Real.exp (ℓ * saddleHorizontalShellVariation ε |(a - ℓ) / ℓ|) := by simpa [q, z] using! norm_saddleShellExponential_shiftedLine_le hε hℓ horder a t change |t| ^ m * ‖minusSaddleMellinData ε ℓ z‖ ≤ _ calc |t| ^ m * ‖minusSaddleMellinData ε ℓ z‖ = |t| ^ m * ‖Complex.Gamma (z / 2)‖ * ‖Complex.exp (((ℓ : ℂ) - z) * (Real.log Real.pi : ℂ) / 2)‖ * ‖Complex.exp ((ℓ : ℂ) * mellinShellPhase ε q)‖ * ‖minusPolynomial ε q‖ := by unfold minusSaddleMellinData saddleMellinEnvelope try dsimp [q] rw [norm_mul, norm_mul, norm_mul] ring _ ≤ |t| ^ m * ‖Complex.Gamma (z / 2)‖ * ‖Complex.exp (((ℓ : ℂ) - z) * (Real.log Real.pi : ℂ) / 2)‖ * ‖Complex.exp ((ℓ : ℂ) * mellinShellPhase ε q)‖ * (C * |t| ^ 3) := by gcongr _ = C * (|t| ^ (m + 3) * ‖Complex.Gamma (z / 2)‖) * ‖Complex.exp (((ℓ : ℂ) - z) * (Real.log Real.pi : ℂ) / 2)‖ * ‖Complex.exp ((ℓ : ℂ) * mellinShellPhase ε q)‖ := by rw [pow_add] ring _ ≤ C * G * ‖Complex.exp (((ℓ : ℂ) - z) * (Real.log Real.pi : ℂ) / 2)‖ * ‖Complex.exp ((ℓ : ℂ) * mellinShellPhase ε q)‖ := by gcongr _ = C * G * Real.exp ((ℓ - a) * Real.log Real.pi / 2) * ‖Complex.exp ((ℓ : ℂ) * mellinShellPhase ε q)‖ := by rw [hpi] _ ≤ C * G * Real.exp ((ℓ - a) * Real.log Real.pi / 2) * Real.exp (ℓ * saddleHorizontalShellVariation ε |(a - ℓ) / ℓ|) := by gcongr _ = saddleShiftedLineMajorant ε ℓ a k m := by rfl def saddleHorizontalStripHeight (ℓ A B : ℝ) : ℝ := max |(A - ℓ) / ℓ| |(B - ℓ) / ℓ| theorem saddleHorizontalStripHeight_bound {ℓ A B x : ℝ} (hℓ : 0 < ℓ) (hx : x ∈ Set.Icc A B) : |(x - ℓ) / ℓ| ≤ saddleHorizontalStripHeight ℓ A B := by have hleft : (A - ℓ) / ℓ ≤ (x - ℓ) / ℓ := (div_le_div_iff_of_pos_right hℓ).2 (sub_le_sub_right hx.1 ℓ) have hright : (x - ℓ) / ℓ ≤ (B - ℓ) / ℓ := (div_le_div_iff_of_pos_right hℓ).2 (sub_le_sub_right hx.2 ℓ) unfold saddleHorizontalStripHeight apply (abs_le).2 constructor · calc -(max |(A - ℓ) / ℓ| |(B - ℓ) / ℓ|) ≤ -|(A - ℓ) / ℓ| := neg_le_neg (le_max_left _ _) _ ≤ (A - ℓ) / ℓ := neg_abs_le _ _ ≤ (x - ℓ) / ℓ := hleft · calc (x - ℓ) / ℓ ≤ (B - ℓ) / ℓ := hright _ ≤ |(B - ℓ) / ℓ| := le_abs_self _ _ ≤ max |(A - ℓ) / ℓ| |(B - ℓ) / ℓ| := le_max_right _ _ def saddleFixedStripMajorant (ε ℓ H a : ℝ) (k m : ℕ) : ℝ := ((1 + |beta ε|) * (1 + ℓ⁻¹ + |(a - ℓ) / ℓ|) ^ 3) * ((2 : ℝ) ^ (k + (m + 3)) * Real.Gamma (a / 2 + ((k + (m + 3) : ℕ) : ℝ))) * Real.exp ((ℓ - a) * Real.log Real.pi / 2) * Real.exp (ℓ * saddleHorizontalShellVariation ε H) theorem saddleShiftedLineMajorant_le_fixedStrip {ε ℓ a H : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hH : |(a - ℓ) / ℓ| ≤ H) (k m : ℕ) (hshift : 0 < a / 2 + (k : ℝ)) : saddleShiftedLineMajorant ε ℓ a k m ≤ saddleFixedStripMajorant ε ℓ H a k m := by have hgammaarg : 0 < a / 2 + ((k + (m + 3) : ℕ) : ℝ) := by rw [Nat.cast_add] have hm : (0 : ℝ) ≤ ((m + 3 : ℕ) : ℝ) := Nat.cast_nonneg _ linarith have hgamma : 0 ≤ Real.Gamma (a / 2 + ((k + (m + 3) : ℕ) : ℝ)) := (Real.Gamma_pos_of_pos hgammaarg).le unfold saddleShiftedLineMajorant saddleFixedStripMajorant gcongr exact saddleHorizontalShellVariation_mono hε horder (abs_nonneg _) hH theorem saddleShiftedGamma_continuousOn {A B : ℝ} (k m : ℕ) (hshift : 0 < A / 2 + (k : ℝ)) : ContinuousOn (fun a : ℝ => Real.Gamma (a / 2 + ((k + (m + 3) : ℕ) : ℝ))) (Set.Icc A B) := by have harg : ContinuousOn (fun a : ℝ => a / 2 + ((k + (m + 3) : ℕ) : ℝ)) (Set.Icc A B) := by fun_prop apply Real.differentiableOn_Gamma_Ioi.continuousOn.comp harg intro a ha change 0 < a / 2 + ((k + (m + 3) : ℕ) : ℝ) have ha' : A / 2 ≤ a / 2 := by linarith [ha.1] rw [Nat.cast_add] have hm : (0 : ℝ) ≤ ((m + 3 : ℕ) : ℝ) := Nat.cast_nonneg _ linarith theorem saddleFixedStripMajorant_continuousOn {A B : ℝ} (ε ℓ H : ℝ) (k m : ℕ) (hshift : 0 < A / 2 + (k : ℝ)) : ContinuousOn (fun a : ℝ => saddleFixedStripMajorant ε ℓ H a k m) (Set.Icc A B) := by have hpoly : ContinuousOn (fun a : ℝ => (1 + |beta ε|) * (1 + ℓ⁻¹ + |(a - ℓ) / ℓ|) ^ 3) (Set.Icc A B) := by fun_prop have hgamma : ContinuousOn (fun a : ℝ => (2 : ℝ) ^ (k + (m + 3)) * Real.Gamma (a / 2 + ((k + (m + 3) : ℕ) : ℝ))) (Set.Icc A B) := continuousOn_const.mul (saddleShiftedGamma_continuousOn k m hshift) have hpi : ContinuousOn (fun a : ℝ => Real.exp ((ℓ - a) * Real.log Real.pi / 2)) (Set.Icc A B) := by fun_prop have hshell : ContinuousOn (fun _ : ℝ => Real.exp (ℓ * saddleHorizontalShellVariation ε H)) (Set.Icc A B) := continuousOn_const exact ((hpoly.mul hgamma).mul hpi).mul hshell theorem plusSaddleMellinData_horizontalStrip_polynomial_bound {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) {A B : ℝ} (hAB : A ≤ B) (m : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ a ∈ Set.Icc A B, ∀ t : ℝ, 1 ≤ |t| → |t| ^ m * ‖plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)‖ ≤ C := by obtain ⟨k, hk⟩ := exists_nat_gt (-(A / 2)) have hshiftA : 0 < A / 2 + (k : ℝ) := by linarith let H : ℝ := saddleHorizontalStripHeight ℓ A B have hcont : ContinuousOn (fun a : ℝ => saddleFixedStripMajorant ε ℓ H a k m) (Set.Icc A B) := saddleFixedStripMajorant_continuousOn ε ℓ H k m hshiftA obtain ⟨C, hC⟩ := isCompact_Icc.bddAbove_image hcont have hAmem : A ∈ Set.Icc A B := ⟨le_rfl, hAB⟩ have hAnonneg : 0 ≤ saddleFixedStripMajorant ε ℓ H A k m := by have hgammaarg : 0 < A / 2 + ((k + (m + 3) : ℕ) : ℝ) := by rw [Nat.cast_add] have hm : (0 : ℝ) ≤ ((m + 3 : ℕ) : ℝ) := Nat.cast_nonneg _ linarith unfold saddleFixedStripMajorant positivity [Real.Gamma_pos_of_pos hgammaarg] refine ⟨C, hAnonneg.trans (hC (Set.mem_image_of_mem _ hAmem)), ?_⟩ intro a ha t ht have hshifta : 0 < a / 2 + (k : ℝ) := by linarith [ha.1] calc |t| ^ m * ‖plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)‖ ≤ saddleShiftedLineMajorant ε ℓ a k m := plusSaddleMellinData_shiftedLine_polynomial_bound hε hℓ horder a ht k m hshifta _ ≤ saddleFixedStripMajorant ε ℓ H a k m := saddleShiftedLineMajorant_le_fixedStrip hε hℓ horder (saddleHorizontalStripHeight_bound hℓ ha) k m hshifta _ ≤ C := hC (Set.mem_image_of_mem _ ha) theorem minusSaddleMellinData_horizontalStrip_polynomial_bound {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) {A B : ℝ} (hAB : A ≤ B) (m : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ a ∈ Set.Icc A B, ∀ t : ℝ, 1 ≤ |t| → |t| ^ m * ‖minusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)‖ ≤ C := by obtain ⟨k, hk⟩ := exists_nat_gt (-(A / 2)) have hshiftA : 0 < A / 2 + (k : ℝ) := by linarith let H : ℝ := saddleHorizontalStripHeight ℓ A B have hcont : ContinuousOn (fun a : ℝ => saddleFixedStripMajorant ε ℓ H a k m) (Set.Icc A B) := saddleFixedStripMajorant_continuousOn ε ℓ H k m hshiftA obtain ⟨C, hC⟩ := isCompact_Icc.bddAbove_image hcont have hAmem : A ∈ Set.Icc A B := ⟨le_rfl, hAB⟩ have hAnonneg : 0 ≤ saddleFixedStripMajorant ε ℓ H A k m := by have hgammaarg : 0 < A / 2 + ((k + (m + 3) : ℕ) : ℝ) := by rw [Nat.cast_add] have hm : (0 : ℝ) ≤ ((m + 3 : ℕ) : ℝ) := Nat.cast_nonneg _ linarith unfold saddleFixedStripMajorant positivity [Real.Gamma_pos_of_pos hgammaarg] refine ⟨C, hAnonneg.trans (hC (Set.mem_image_of_mem _ hAmem)), ?_⟩ intro a ha t ht have hshifta : 0 < a / 2 + (k : ℝ) := by linarith [ha.1] calc |t| ^ m * ‖minusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)‖ ≤ saddleShiftedLineMajorant ε ℓ a k m := minusSaddleMellinData_shiftedLine_polynomial_bound hε hℓ horder a ht k m hshifta _ ≤ saddleFixedStripMajorant ε ℓ H a k m := saddleShiftedLineMajorant_le_fixedStrip hε hℓ horder (saddleHorizontalStripHeight_bound hℓ ha) k m hshifta _ ≤ C := hC (Set.mem_image_of_mem _ ha) theorem saddleEnvelope_conj (ε ℓ t : ℝ) : starRingEnd ℂ (saddleEnvelope ε ℓ t) = saddleEnvelope ε ℓ (-t) := by have harg : (t : ℂ) / (ℓ : ℂ) = ((t / ℓ : ℝ) : ℂ) := by push_cast rfl have hneg : ((-t : ℝ) : ℂ) / (ℓ : ℂ) = -((t : ℂ) / (ℓ : ℂ)) := by push_cast ring have hphase : starRingEnd ℂ (mellinShellPhase ε ((t : ℂ) / (ℓ : ℂ))) = mellinShellPhase ε (((-t : ℝ) : ℂ) / (ℓ : ℂ)) := by calc starRingEnd ℂ (mellinShellPhase ε ((t : ℂ) / (ℓ : ℂ))) = mellinShellPhase ε ((t : ℂ) / (ℓ : ℂ)) := by rw [harg, mellinShellPhase_real_conj] _ = mellinShellPhase ε (((-t : ℝ) : ℂ) / (ℓ : ℂ)) := by rw [hneg, mellinShellPhase_neg] unfold saddleEnvelope simp only [map_mul, ← Complex.exp_conj, ← Complex.Gamma_conj, map_div₀, map_sub, Complex.conj_ofReal, Complex.conj_I, map_ofNat] rw [hphase] push_cast congr 2 <;> congr 1 <;> ring theorem norm_saddleShellExponential_le {ε ℓ : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (t : ℝ) : ‖Complex.exp ((ℓ : ℂ) * mellinShellPhase ε ((t : ℂ) / (ℓ : ℂ)))‖ ≤ Real.exp (2 * |ℓ| * saddleShellTotalVariation ε) := by have harg : (t : ℂ) / (ℓ : ℂ) = ((t / ℓ : ℝ) : ℂ) := by push_cast rfl rw [harg, mellinShellPhase_ofReal, Complex.norm_exp] simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, mul_zero, sub_zero] apply Real.exp_le_exp.mpr calc ℓ * realOscillatoryShellPhase ε (t / ℓ) ≤ |ℓ * realOscillatoryShellPhase ε (t / ℓ)| := le_abs_self _ _ = |ℓ| * |realOscillatoryShellPhase ε (t / ℓ)| := abs_mul _ _ _ ≤ |ℓ| * (2 * saddleShellTotalVariation ε) := by gcongr exact abs_realOscillatoryShellPhase_le hε horder (t / ℓ) _ = 2 * |ℓ| * saddleShellTotalVariation ε := by ring theorem saddleEnvelope_vertical_polynomial_bound {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (t : ℝ) (k : ℕ) : |t| ^ k * ‖saddleEnvelope ε ℓ t‖ ≤ (2 : ℝ) ^ k * Real.Gamma (ℓ / 2 + k) * Real.exp (2 * |ℓ| * saddleShellTotalVariation ε) := by let z : ℂ := ((ℓ : ℂ) - Complex.I * (t : ℂ)) / 2 have hz : 0 < z.re := by try dsimp [z] simpa using! half_pos hℓ have hgamma : (|t| / 2) ^ k * ‖Complex.Gamma z‖ ≤ Real.Gamma (ℓ / 2 + k) := by simpa [z, abs_div] using! complexGamma_vertical_polynomial_bound hz k have hscaled : |t| ^ k * ‖Complex.Gamma z‖ ≤ (2 : ℝ) ^ k * Real.Gamma (ℓ / 2 + k) := by calc |t| ^ k * ‖Complex.Gamma z‖ = (2 : ℝ) ^ k * ((|t| / 2) ^ k * ‖Complex.Gamma z‖) := by rw [div_pow] field_simp _ ≤ (2 : ℝ) ^ k * Real.Gamma (ℓ / 2 + k) := by gcongr have hunit : ‖Complex.exp (Complex.I * (t : ℂ) * (Real.log Real.pi : ℂ) / 2)‖ = 1 := by rw [Complex.norm_exp] simp calc |t| ^ k * ‖saddleEnvelope ε ℓ t‖ = (|t| ^ k * ‖Complex.Gamma z‖) * ‖Complex.exp ((ℓ : ℂ) * mellinShellPhase ε ((t : ℂ) / (ℓ : ℂ)))‖ := by unfold saddleEnvelope rw [norm_mul, norm_mul, hunit] try dsimp [z] ring _ ≤ ((2 : ℝ) ^ k * Real.Gamma (ℓ / 2 + k)) * Real.exp (2 * |ℓ| * saddleShellTotalVariation ε) := by gcongr exact norm_saddleShellExponential_le hε horder t theorem norm_plusPolynomial_scaled_le {ε ℓ t : ℝ} (hℓ : 0 < ℓ) (ht : 1 ≤ |t|) : ‖plusPolynomial ε ((t : ℂ) / (ℓ : ℂ))‖ ≤ (1 + |beta ε|) * (1 + ℓ⁻¹) ^ 3 * |t| ^ 3 := by have hnorm : ‖(t : ℂ) / (ℓ : ℂ)‖ = |t| / ℓ := by rw [norm_div] simp [abs_of_pos hℓ] have hlinear : 1 + |t| / ℓ ≤ (1 + ℓ⁻¹) * |t| := by rw [inv_eq_one_div] field_simp [hℓ.ne'] nlinarith calc ‖plusPolynomial ε ((t : ℂ) / (ℓ : ℂ))‖ ≤ (1 + |beta ε|) * (1 + ‖(t : ℂ) / (ℓ : ℂ)‖) ^ 3 := norm_plusPolynomial_le ε _ _ = (1 + |beta ε|) * (1 + |t| / ℓ) ^ 3 := by rw [hnorm] _ ≤ (1 + |beta ε|) * ((1 + ℓ⁻¹) * |t|) ^ 3 := by gcongr _ = (1 + |beta ε|) * (1 + ℓ⁻¹) ^ 3 * |t| ^ 3 := by ring theorem norm_minusPolynomial_scaled_le {ε ℓ t : ℝ} (hℓ : 0 < ℓ) (ht : 1 ≤ |t|) : ‖minusPolynomial ε ((t : ℂ) / (ℓ : ℂ))‖ ≤ (1 + |beta ε|) * (1 + ℓ⁻¹) ^ 3 * |t| ^ 3 := by have hnorm : ‖(t : ℂ) / (ℓ : ℂ)‖ = |t| / ℓ := by rw [norm_div] simp [abs_of_pos hℓ] have hlinear : 1 + |t| / ℓ ≤ (1 + ℓ⁻¹) * |t| := by rw [inv_eq_one_div] field_simp [hℓ.ne'] nlinarith calc ‖minusPolynomial ε ((t : ℂ) / (ℓ : ℂ))‖ ≤ (1 + |beta ε|) * (1 + ‖(t : ℂ) / (ℓ : ℂ)‖) ^ 3 := norm_minusPolynomial_le ε _ _ = (1 + |beta ε|) * (1 + |t| / ℓ) ^ 3 := by rw [hnorm] _ ≤ (1 + |beta ε|) * ((1 + ℓ⁻¹) * |t|) ^ 3 := by gcongr _ = (1 + |beta ε|) * (1 + ℓ⁻¹) ^ 3 * |t| ^ 3 := by ring theorem plusSaddleSpectrum_vertical_polynomial_bound {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) {t : ℝ} (ht : 1 ≤ |t|) (k : ℕ) : |t| ^ k * ‖plusSaddleSpectrum ε ℓ t‖ ≤ ((1 + |beta ε|) * (1 + ℓ⁻¹) ^ 3) * ((2 : ℝ) ^ (k + 3) * Real.Gamma (ℓ / 2 + (k + 3)) * Real.exp (2 * |ℓ| * saddleShellTotalVariation ε)) := by have hpoly := norm_plusPolynomial_scaled_le (ε := ε) hℓ ht have hgamma := saddleEnvelope_vertical_polynomial_bound hε hℓ horder t (k + 3) calc |t| ^ k * ‖plusSaddleSpectrum ε ℓ t‖ = |t| ^ k * ‖saddleEnvelope ε ℓ t‖ * ‖plusPolynomial ε ((t : ℂ) / (ℓ : ℂ))‖ := by unfold plusSaddleSpectrum rw [norm_mul] ring _ ≤ |t| ^ k * ‖saddleEnvelope ε ℓ t‖ * ((1 + |beta ε|) * (1 + ℓ⁻¹) ^ 3 * |t| ^ 3) := by gcongr _ = ((1 + |beta ε|) * (1 + ℓ⁻¹) ^ 3) * (|t| ^ (k + 3) * ‖saddleEnvelope ε ℓ t‖) := by rw [pow_add] ring _ ≤ ((1 + |beta ε|) * (1 + ℓ⁻¹) ^ 3) * ((2 : ℝ) ^ (k + 3) * Real.Gamma (ℓ / 2 + (k + 3)) * Real.exp (2 * |ℓ| * saddleShellTotalVariation ε)) := by simpa only [Nat.cast_add, Nat.cast_ofNat] using! (mul_le_mul_of_nonneg_left hgamma (show 0 ≤ (1 + |beta ε|) * (1 + ℓ⁻¹) ^ 3 by positivity)) theorem minusSaddleSpectrum_vertical_polynomial_bound {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) {t : ℝ} (ht : 1 ≤ |t|) (k : ℕ) : |t| ^ k * ‖minusSaddleSpectrum ε ℓ t‖ ≤ ((1 + |beta ε|) * (1 + ℓ⁻¹) ^ 3) * ((2 : ℝ) ^ (k + 3) * Real.Gamma (ℓ / 2 + (k + 3)) * Real.exp (2 * |ℓ| * saddleShellTotalVariation ε)) := by have hpoly := norm_minusPolynomial_scaled_le (ε := ε) hℓ ht have hgamma := saddleEnvelope_vertical_polynomial_bound hε hℓ horder t (k + 3) calc |t| ^ k * ‖minusSaddleSpectrum ε ℓ t‖ = |t| ^ k * ‖saddleEnvelope ε ℓ t‖ * ‖minusPolynomial ε ((t : ℂ) / (ℓ : ℂ))‖ := by unfold minusSaddleSpectrum rw [norm_mul] ring _ ≤ |t| ^ k * ‖saddleEnvelope ε ℓ t‖ * ((1 + |beta ε|) * (1 + ℓ⁻¹) ^ 3 * |t| ^ 3) := by gcongr _ = ((1 + |beta ε|) * (1 + ℓ⁻¹) ^ 3) * (|t| ^ (k + 3) * ‖saddleEnvelope ε ℓ t‖) := by rw [pow_add] ring _ ≤ ((1 + |beta ε|) * (1 + ℓ⁻¹) ^ 3) * ((2 : ℝ) ^ (k + 3) * Real.Gamma (ℓ / 2 + (k + 3)) * Real.exp (2 * |ℓ| * saddleShellTotalVariation ε)) := by simpa only [Nat.cast_add, Nat.cast_ofNat] using! (mul_le_mul_of_nonneg_left hgamma (show 0 ≤ (1 + |beta ε|) * (1 + ℓ⁻¹) ^ 3 by positivity)) theorem integrable_of_continuous_polynomial_decay {F : ℝ → ℂ} (hF : Continuous F) (hdecay : ∀ j : ℕ, ∃ C : ℝ, 0 ≤ C ∧ ∀ t : ℝ, 1 ≤ |t| → |t| ^ j * ‖F t‖ ≤ C) (k : ℕ) : Integrable (fun t : ℝ => (t : ℂ) ^ k * F t) := by have hcompact : IsCompact (Set.Icc (-1 : ℝ) 1) := isCompact_Icc obtain ⟨M, hM⟩ := hcompact.bddAbove_image hF.norm.continuousOn have hzero : (0 : ℝ) ∈ Set.Icc (-1 : ℝ) 1 := by constructor <;> norm_num have hMnonneg : 0 ≤ M := (norm_nonneg (F 0)).trans (hM (Set.mem_image_of_mem (fun t : ℝ => ‖F t‖) hzero)) obtain ⟨C, hC, htail⟩ := hdecay (k + 2) have hmajor : Integrable (fun t : ℝ => (2 * (M + C)) * (1 + t ^ 2)⁻¹) := integrable_inv_one_add_sq.const_mul (2 * (M + C)) have hmoment : Continuous (fun t : ℝ => (t : ℂ) ^ k * F t) := by exact ((Complex.continuous_ofReal.comp continuous_id).pow k).mul hF apply hmajor.mono' hmoment.aestronglyMeasurable filter_upwards [] with t have hden : 0 < 1 + t ^ 2 := by positivity change ‖(t : ℂ) ^ k * F t‖ ≤ 2 * (M + C) / (1 + t ^ 2) apply (le_div_iff₀ hden).2 rw [norm_mul, norm_pow, Complex.norm_real, Real.norm_eq_abs] by_cases ht : |t| ≤ (1 : ℝ) · have htmem : t ∈ Set.Icc (-1 : ℝ) 1 := by constructor · linarith [neg_abs_le t] · linarith [le_abs_self t] have hnorm : ‖F t‖ ≤ M := hM (Set.mem_image_of_mem (fun u : ℝ => ‖F u‖) htmem) have hpow : |t| ^ k ≤ 1 := pow_le_one₀ (abs_nonneg t) ht have hsquare : t ^ 2 ≤ 1 := by have habs : |t| ^ 2 ≤ (1 : ℝ) := by nlinarith [mul_nonneg (abs_nonneg t) (sub_nonneg.mpr ht)] simpa only [sq_abs] using! habs have hweighted : |t| ^ k * ‖F t‖ ≤ M := by calc |t| ^ k * ‖F t‖ ≤ 1 * ‖F t‖ := by gcongr _ = ‖F t‖ := one_mul _ _ ≤ M := hnorm calc (|t| ^ k * ‖F t‖) * (1 + t ^ 2) ≤ M * 2 := mul_le_mul hweighted (by linarith) (by positivity) hMnonneg _ ≤ 2 * (M + C) := by nlinarith · have htlarge : 1 ≤ |t| := (lt_of_not_ge ht).le have hsquare : (1 : ℝ) ≤ t ^ 2 := by have habs : (1 : ℝ) ≤ |t| ^ 2 := by nlinarith [mul_nonneg (abs_nonneg t) (sub_nonneg.mpr htlarge)] simpa only [sq_abs] using! habs calc (|t| ^ k * ‖F t‖) * (1 + t ^ 2) ≤ (|t| ^ k * ‖F t‖) * (2 * t ^ 2) := by gcongr linarith _ = 2 * (|t| ^ (k + 2) * ‖F t‖) := by rw [pow_add, sq_abs] ring _ ≤ 2 * C := by gcongr exact htail t htlarge _ ≤ 2 * (M + C) := by nlinarith theorem saddleShiftedLine_ne_pole {a : ℝ} (hpole : ∀ n : ℕ, a ≠ -((2 * n : ℕ) : ℝ)) (t : ℝ) (n : ℕ) : (a : ℂ) + (t : ℂ) * Complex.I ≠ (-((2 * n : ℕ) : ℂ)) := by intro heq apply hpole n have hre := congrArg Complex.re heq simpa using! hre theorem plusSaddleMellinData_shiftedLine_continuous {ε a : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (hpole : ∀ n : ℕ, a ≠ -((2 * n : ℕ) : ℝ)) : Continuous (fun t : ℝ => plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)) := by apply continuous_iff_continuousAt.mpr intro t have hcomplex : DifferentiableAt ℂ (plusSaddleMellinData ε ℓ) ((a : ℂ) + (t : ℂ) * Complex.I) := plusSaddleMellinData_differentiableAt_of_not_pole hε horder ℓ (saddleShiftedLine_ne_pole hpole t) have hline : ContinuousAt (fun u : ℝ => (a : ℂ) + (u : ℂ) * Complex.I) t := by fun_prop simpa [Function.comp_def] using! hcomplex.continuousAt.comp_of_eq hline (by rfl) theorem minusSaddleMellinData_shiftedLine_continuous {ε a : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ : ℝ) (hpole : ∀ n : ℕ, a ≠ -((2 * n : ℕ) : ℝ)) : Continuous (fun t : ℝ => minusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)) := by apply continuous_iff_continuousAt.mpr intro t have hcomplex : DifferentiableAt ℂ (minusSaddleMellinData ε ℓ) ((a : ℂ) + (t : ℂ) * Complex.I) := minusSaddleMellinData_differentiableAt_of_not_pole hε horder ℓ (saddleShiftedLine_ne_pole hpole t) have hline : ContinuousAt (fun u : ℝ => (a : ℂ) + (u : ℂ) * Complex.I) t := by fun_prop simpa [Function.comp_def] using! hcomplex.continuousAt.comp_of_eq hline (by rfl) theorem plusSaddleMellinData_shiftedLine_moment_integrable {ε ℓ a : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hpole : ∀ n : ℕ, a ≠ -((2 * n : ℕ) : ℝ)) (j : ℕ) : Integrable (fun t : ℝ => (t : ℂ) ^ j * plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)) := by apply integrable_of_continuous_polynomial_decay (plusSaddleMellinData_shiftedLine_continuous hε horder ℓ hpole) intro m obtain ⟨k, hk⟩ := exists_nat_gt (-(a / 2)) have hshift : 0 < a / 2 + (k : ℝ) := by linarith refine ⟨saddleShiftedLineMajorant ε ℓ a k m, saddleShiftedLineMajorant_nonneg hℓ k m hshift, ?_⟩ intro t ht exact plusSaddleMellinData_shiftedLine_polynomial_bound hε hℓ horder a ht k m hshift theorem minusSaddleMellinData_shiftedLine_moment_integrable {ε ℓ a : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hpole : ∀ n : ℕ, a ≠ -((2 * n : ℕ) : ℝ)) (j : ℕ) : Integrable (fun t : ℝ => (t : ℂ) ^ j * minusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)) := by apply integrable_of_continuous_polynomial_decay (minusSaddleMellinData_shiftedLine_continuous hε horder ℓ hpole) intro m obtain ⟨k, hk⟩ := exists_nat_gt (-(a / 2)) have hshift : 0 < a / 2 + (k : ℝ) := by linarith refine ⟨saddleShiftedLineMajorant ε ℓ a k m, saddleShiftedLineMajorant_nonneg hℓ k m hshift, ?_⟩ intro t ht exact minusSaddleMellinData_shiftedLine_polynomial_bound hε hℓ horder a ht k m hshift theorem saddleMellinInversePower_shiftedLine_norm {r : ℝ} (hr : 0 < r) (a t : ℝ) : ‖saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I)‖ = r ^ (-a) := by unfold saddleMellinInversePower rw [Complex.norm_cpow_eq_rpow_re_of_pos hr] simp theorem saddleMellinInversePower_shiftedLine_continuous {r : ℝ} (hr : 0 < r) (a : ℝ) : Continuous (fun t : ℝ => saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I)) := by exact (saddleMellinInversePower_differentiable hr).continuous.comp (by fun_prop) theorem plusSaddleMellinData_shiftedLine_weighted_moment_integrable {ε ℓ a r : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hpole : ∀ n : ℕ, a ≠ -((2 * n : ℕ) : ℝ)) (hr : 0 < r) (j : ℕ) : Integrable (fun t : ℝ => saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * ((t : ℂ) ^ j * plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I))) := by have hmoment := plusSaddleMellinData_shiftedLine_moment_integrable hε hℓ horder hpole j have hweight := saddleMellinInversePower_shiftedLine_continuous hr a apply (hmoment.norm.const_mul (r ^ (-a))).mono' · exact hweight.aestronglyMeasurable.mul hmoment.aestronglyMeasurable · filter_upwards [] with t rw [norm_mul, saddleMellinInversePower_shiftedLine_norm hr a t] theorem minusSaddleMellinData_shiftedLine_weighted_moment_integrable {ε ℓ a r : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hpole : ∀ n : ℕ, a ≠ -((2 * n : ℕ) : ℝ)) (hr : 0 < r) (j : ℕ) : Integrable (fun t : ℝ => saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * ((t : ℂ) ^ j * minusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I))) := by have hmoment := minusSaddleMellinData_shiftedLine_moment_integrable hε hℓ horder hpole j have hweight := saddleMellinInversePower_shiftedLine_continuous hr a apply (hmoment.norm.const_mul (r ^ (-a))).mono' · exact hweight.aestronglyMeasurable.mul hmoment.aestronglyMeasurable · filter_upwards [] with t rw [norm_mul, saddleMellinInversePower_shiftedLine_norm hr a t] theorem plusSaddleMellinData_shiftedLine_weighted_integrable {ε ℓ a r : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hpole : ∀ n : ℕ, a ≠ -((2 * n : ℕ) : ℝ)) (hr : 0 < r) : Integrable (fun t : ℝ => saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)) := by simpa using! plusSaddleMellinData_shiftedLine_weighted_moment_integrable hε hℓ horder hpole hr 0 theorem minusSaddleMellinData_shiftedLine_weighted_integrable {ε ℓ a r : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hpole : ∀ n : ℕ, a ≠ -((2 * n : ℕ) : ℝ)) (hr : 0 < r) : Integrable (fun t : ℝ => saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * minusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)) := by simpa using! minusSaddleMellinData_shiftedLine_weighted_moment_integrable hε hℓ horder hpole hr 0 theorem saddleGaussianPoleRepresentative_shiftedLine_norm (a t : ℝ) (n : ℕ) : ‖saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)‖ = Real.exp ((a + ((2 * n : ℕ) : ℝ)) ^ 2 - t ^ 2) / ‖(a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ)‖ := by unfold saddleGaussianPoleRepresentative rw [norm_div, Complex.norm_exp] congr 1 simp [pow_two, Complex.mul_re, Complex.mul_im] theorem saddleGaussianPoleRepresentative_shiftedLine_continuous {a : ℝ} (n : ℕ) (ha : a ≠ -((2 * n : ℕ) : ℝ)) : Continuous (fun t : ℝ => saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) := by have hline : Continuous (fun t : ℝ => (a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ)) := by fun_prop have hnonzero : ∀ t : ℝ, (a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ) ≠ 0 := by intro t hzero apply ha have hre := congrArg Complex.re hzero norm_num [Complex.mul_re] at hre push_cast linarith unfold saddleGaussianPoleRepresentative exact (Complex.continuous_exp.comp (hline.pow 2)).div hline hnonzero theorem saddleGaussianPoleRepresentative_shiftedLine_bound {a : ℝ} (n : ℕ) (ha : a ≠ -((2 * n : ℕ) : ℝ)) (t : ℝ) : ‖saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)‖ ≤ (Real.exp ((a + ((2 * n : ℕ) : ℝ)) ^ 2) / |a + ((2 * n : ℕ) : ℝ)|) * Real.exp (-t ^ 2) := by have hreal : a + ((2 * n : ℕ) : ℝ) ≠ 0 := by intro hzero apply ha linarith have habs : 0 < |a + ((2 * n : ℕ) : ℝ)| := abs_pos.mpr hreal have hden : |a + ((2 * n : ℕ) : ℝ)| ≤ ‖(a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ)‖ := by simpa [Complex.mul_re] using! (Complex.abs_re_le_norm ((a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ))) rw [saddleGaussianPoleRepresentative_shiftedLine_norm, sub_eq_add_neg, Real.exp_add] calc Real.exp ((a + ((2 * n : ℕ) : ℝ)) ^ 2) * Real.exp (-t ^ 2) / ‖(a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ)‖ ≤ Real.exp ((a + ((2 * n : ℕ) : ℝ)) ^ 2) * Real.exp (-t ^ 2) / |a + ((2 * n : ℕ) : ℝ)| := by gcongr _ = (Real.exp ((a + ((2 * n : ℕ) : ℝ)) ^ 2) / |a + ((2 * n : ℕ) : ℝ)|) * Real.exp (-t ^ 2) := by ring theorem saddleGaussianPoleRepresentative_shiftedLine_integrable {a : ℝ} (n : ℕ) (ha : a ≠ -((2 * n : ℕ) : ℝ)) : Integrable (fun t : ℝ => saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) := by have hgaussian : Integrable (fun t : ℝ => Real.exp (-t ^ 2)) := by simpa using! (integrable_exp_neg_mul_sq (b := (1 : ℝ)) (by norm_num : (0 : ℝ) < 1)) let C : ℝ := Real.exp ((a + ((2 * n : ℕ) : ℝ)) ^ 2) / |a + ((2 * n : ℕ) : ℝ)| apply (hgaussian.const_mul C).mono' · exact (saddleGaussianPoleRepresentative_shiftedLine_continuous n ha).aestronglyMeasurable · filter_upwards [] with t exact saddleGaussianPoleRepresentative_shiftedLine_bound n ha t theorem saddleGaussianPoleRepresentative_shiftedLine_weighted_integrable {a r : ℝ} (n : ℕ) (ha : a ≠ -((2 * n : ℕ) : ℝ)) (hr : 0 < r) : Integrable (fun t : ℝ => saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) := by have hrepresentative := saddleGaussianPoleRepresentative_shiftedLine_integrable n ha have hweight := saddleMellinInversePower_shiftedLine_continuous hr a apply (hrepresentative.norm.const_mul (r ^ (-a))).mono' · exact hweight.aestronglyMeasurable.mul hrepresentative.aestronglyMeasurable · filter_upwards [] with t rw [norm_mul, saddleMellinInversePower_shiftedLine_norm hr a t] theorem plusSaddleFiniteRapidContourIntegrand_shiftedLine_integrable {ε ℓ a r : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (N : ℕ) (hhalf : -(2 * ((N : ℝ) + 1)) < a) (hpole : ∀ n : ℕ, a ≠ -((2 * n : ℕ) : ℝ)) (hr : 0 < r) : Integrable (fun t : ℝ => plusSaddleFiniteRapidContourIntegrand ε ℓ N r ((a : ℂ) + (t : ℂ) * Complex.I)) := by have hdata := plusSaddleMellinData_shiftedLine_weighted_integrable hε hℓ horder hpole hr have hsum : Integrable (fun t : ℝ => ∑ n ∈ Finset.range (N + 1), saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * (plusSaddlePoleResidue ε ℓ n * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I))) := by apply integrable_finsetSum intro n _ have hterm := (saddleGaussianPoleRepresentative_shiftedLine_weighted_integrable n (hpole n) hr).const_mul (plusSaddlePoleResidue ε ℓ n) exact hterm.congr (Filter.Eventually.of_forall (fun t => by ring)) apply (hdata.sub hsum).congr filter_upwards [] with t have hz : (a : ℂ) + (t : ℂ) * Complex.I ∈ saddleFinitePoleHalfPlane N := by change -(2 * ((N : ℝ) + 1)) < ((a : ℂ) + (t : ℂ) * Complex.I).re simpa [Complex.mul_re] using! hhalf unfold plusSaddleFiniteRapidContourIntegrand rw [plusSaddleFiniteRapidPoleRegularPart_eq_subtraction_of_not_pole hε horder ℓ N hz (saddleShiftedLine_ne_pole hpole t)] unfold plusSaddleFiniteRapidPoleSubtraction rw [mul_sub, Finset.mul_sum] rfl theorem minusSaddleFiniteRapidContourIntegrand_shiftedLine_integrable {ε ℓ a r : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (N : ℕ) (hhalf : -(2 * ((N : ℝ) + 1)) < a) (hpole : ∀ n : ℕ, a ≠ -((2 * n : ℕ) : ℝ)) (hr : 0 < r) : Integrable (fun t : ℝ => minusSaddleFiniteRapidContourIntegrand ε ℓ N r ((a : ℂ) + (t : ℂ) * Complex.I)) := by have hdata := minusSaddleMellinData_shiftedLine_weighted_integrable hε hℓ horder hpole hr have hsum : Integrable (fun t : ℝ => ∑ n ∈ Finset.range (N + 1), saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * (minusSaddlePoleResidue ε ℓ n * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I))) := by apply integrable_finsetSum intro n _ have hterm := (saddleGaussianPoleRepresentative_shiftedLine_weighted_integrable n (hpole n) hr).const_mul (minusSaddlePoleResidue ε ℓ n) exact hterm.congr (Filter.Eventually.of_forall (fun t => by ring)) apply (hdata.sub hsum).congr filter_upwards [] with t have hz : (a : ℂ) + (t : ℂ) * Complex.I ∈ saddleFinitePoleHalfPlane N := by change -(2 * ((N : ℝ) + 1)) < ((a : ℂ) + (t : ℂ) * Complex.I).re simpa [Complex.mul_re] using! hhalf unfold minusSaddleFiniteRapidContourIntegrand rw [minusSaddleFiniteRapidPoleRegularPart_eq_subtraction_of_not_pole hε horder ℓ N hz (saddleShiftedLine_ne_pole hpole t)] unfold minusSaddleFiniteRapidPoleSubtraction rw [mul_sub, Finset.mul_sum] rfl theorem saddleMellinInversePower_horizontalStrip_bounded {r A B : ℝ} (hr : 0 < r) (hAB : A ≤ B) : ∃ C : ℝ, 0 ≤ C ∧ ∀ a ∈ Set.Icc A B, ∀ t : ℝ, ‖saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I)‖ ≤ C := by have hpower : Continuous (fun a : ℝ => r ^ (-a)) := (Real.continuous_const_rpow hr.ne').comp (by fun_prop) obtain ⟨C, hC⟩ := isCompact_Icc.bddAbove_image hpower.continuousOn have hAmem : A ∈ Set.Icc A B := ⟨le_rfl, hAB⟩ have hnonneg : 0 ≤ C := (Real.rpow_nonneg hr.le (-A)).trans (hC (Set.mem_image_of_mem _ hAmem)) refine ⟨C, hnonneg, ?_⟩ intro a ha t rw [saddleMellinInversePower_shiftedLine_norm hr a t] exact hC (Set.mem_image_of_mem _ ha) theorem plusSaddleMellinData_weighted_horizontalStrip_polynomial_bound {ε ℓ r : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) {A B : ℝ} (hAB : A ≤ B) (m : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ a ∈ Set.Icc A B, ∀ t : ℝ, 1 ≤ |t| → |t| ^ m * ‖saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)‖ ≤ C := by obtain ⟨R, hR, hweight⟩ := saddleMellinInversePower_horizontalStrip_bounded hr hAB obtain ⟨C, hC, hdata⟩ := plusSaddleMellinData_horizontalStrip_polynomial_bound hε hℓ horder hAB m refine ⟨R * C, mul_nonneg hR hC, ?_⟩ intro a ha t ht calc |t| ^ m * ‖saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)‖ = ‖saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I)‖ * (|t| ^ m * ‖plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)‖) := by rw [norm_mul] ring _ ≤ R * C := by gcongr · exact hweight a ha t · exact hdata a ha t ht theorem minusSaddleMellinData_weighted_horizontalStrip_polynomial_bound {ε ℓ r : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) {A B : ℝ} (hAB : A ≤ B) (m : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ a ∈ Set.Icc A B, ∀ t : ℝ, 1 ≤ |t| → |t| ^ m * ‖saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * minusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)‖ ≤ C := by obtain ⟨R, hR, hweight⟩ := saddleMellinInversePower_horizontalStrip_bounded hr hAB obtain ⟨C, hC, hdata⟩ := minusSaddleMellinData_horizontalStrip_polynomial_bound hε hℓ horder hAB m refine ⟨R * C, mul_nonneg hR hC, ?_⟩ intro a ha t ht calc |t| ^ m * ‖saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * minusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)‖ = ‖saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I)‖ * (|t| ^ m * ‖minusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)‖) := by rw [norm_mul] ring _ ≤ R * C := by gcongr · exact hweight a ha t · exact hdata a ha t ht theorem saddleHorizontalIntegral_tendsto_zero {F : ℂ → ℂ} {A B C : ℝ} (hAB : A ≤ B) (hdecay : ∀ a ∈ Set.Icc A B, ∀ t : ℝ, 1 ≤ |t| → |t| * ‖F ((a : ℂ) + (t : ℂ) * Complex.I)‖ ≤ C) (s : ℝ) (hs : |s| = 1) : Tendsto (fun T : ℝ => ∫ a in A..B, F ((a : ℂ) + ((s * T : ℝ) : ℂ) * Complex.I)) Filter.atTop (𝓝 0) := by have hdiv : Tendsto (fun T : ℝ => C / T) Filter.atTop (𝓝 0) := tendsto_const_nhds.div_atTop tendsto_id have hmajor : Tendsto (fun T : ℝ => C / T * |B - A|) Filter.atTop (𝓝 0) := by simpa using! hdiv.mul_const |B - A| apply squeeze_zero_norm' (a := fun T : ℝ => C / T * |B - A|) ?_ hmajor filter_upwards [eventually_ge_atTop (1 : ℝ)] with T hT have hTpos : 0 < T := lt_of_lt_of_le zero_lt_one hT apply intervalIntegral.norm_integral_le_of_norm_le_const intro a ha rw [uIoc_of_le hAB] at ha have ha' : a ∈ Set.Icc A B := ⟨ha.1.le, ha.2⟩ have habs : |s * T| = T := by rw [abs_mul, hs, one_mul, abs_of_nonneg hTpos.le] have htail := hdecay a ha' (s * T) (by rw [habs]; exact hT) rw [habs] at htail apply (le_div_iff₀ hTpos).2 simpa [mul_comm] using! htail theorem plusSaddleMellinData_weighted_horizontalIntegral_tendsto_zero {ε ℓ r : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) {A B : ℝ} (hAB : A ≤ B) (s : ℝ) (hs : |s| = 1) : Tendsto (fun T : ℝ => ∫ a in A..B, saddleMellinInversePower r ((a : ℂ) + ((s * T : ℝ) : ℂ) * Complex.I) * plusSaddleMellinData ε ℓ ((a : ℂ) + ((s * T : ℝ) : ℂ) * Complex.I)) Filter.atTop (𝓝 0) := by obtain ⟨C, hC, hbound⟩ := plusSaddleMellinData_weighted_horizontalStrip_polynomial_bound hε hℓ horder hr hAB 1 apply saddleHorizontalIntegral_tendsto_zero (F := fun z : ℂ => saddleMellinInversePower r z * plusSaddleMellinData ε ℓ z) hAB (C := C) ?_ s hs simpa using! hbound theorem minusSaddleMellinData_weighted_horizontalIntegral_tendsto_zero {ε ℓ r : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) {A B : ℝ} (hAB : A ≤ B) (s : ℝ) (hs : |s| = 1) : Tendsto (fun T : ℝ => ∫ a in A..B, saddleMellinInversePower r ((a : ℂ) + ((s * T : ℝ) : ℂ) * Complex.I) * minusSaddleMellinData ε ℓ ((a : ℂ) + ((s * T : ℝ) : ℂ) * Complex.I)) Filter.atTop (𝓝 0) := by obtain ⟨C, hC, hbound⟩ := minusSaddleMellinData_weighted_horizontalStrip_polynomial_bound hε hℓ horder hr hAB 1 apply saddleHorizontalIntegral_tendsto_zero (F := fun z : ℂ => saddleMellinInversePower r z * minusSaddleMellinData ε ℓ z) hAB (C := C) ?_ s hs simpa using! hbound theorem saddleGaussianPoleRepresentative_weighted_horizontalStrip_bound {r A B : ℝ} (hr : 0 < r) (hAB : A ≤ B) (n : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ a ∈ Set.Icc A B, ∀ t : ℝ, 1 ≤ |t| → |t| * ‖saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)‖ ≤ C := by have hpower : Continuous (fun a : ℝ => r ^ (-a)) := (Real.continuous_const_rpow hr.ne').comp (by fun_prop) have hgaussian : Continuous (fun a : ℝ => Real.exp ((a + ((2 * n : ℕ) : ℝ)) ^ 2)) := by fun_prop have hcoefficient : Continuous (fun a : ℝ => r ^ (-a) * Real.exp ((a + ((2 * n : ℕ) : ℝ)) ^ 2)) := hpower.mul hgaussian obtain ⟨C, hC⟩ := isCompact_Icc.bddAbove_image hcoefficient.continuousOn have hAmem : A ∈ Set.Icc A B := ⟨le_rfl, hAB⟩ have hnonneg : 0 ≤ C := (show 0 ≤ r ^ (-A) * Real.exp ((A + ((2 * n : ℕ) : ℝ)) ^ 2) by positivity).trans (hC (Set.mem_image_of_mem _ hAmem)) refine ⟨C, hnonneg, ?_⟩ intro a ha t ht have hden : |t| ≤ ‖(a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ)‖ := by simpa [Complex.mul_im] using! (Complex.abs_im_le_norm ((a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ))) have hdenpos : 0 < ‖(a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ)‖ := (lt_of_lt_of_le zero_lt_one ht).trans_le hden have hfrac : |t| / ‖(a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ)‖ ≤ 1 := (div_le_one hdenpos).2 hden have hexp : Real.exp (-t ^ 2) ≤ 1 := Real.exp_le_one_iff.mpr (neg_nonpos.mpr (sq_nonneg t)) rw [norm_mul, saddleMellinInversePower_shiftedLine_norm hr a t, saddleGaussianPoleRepresentative_shiftedLine_norm, sub_eq_add_neg, Real.exp_add] calc |t| * (r ^ (-a) * (Real.exp ((a + ((2 * n : ℕ) : ℝ)) ^ 2) * Real.exp (-t ^ 2) / ‖(a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ)‖)) = (r ^ (-a) * Real.exp ((a + ((2 * n : ℕ) : ℝ)) ^ 2)) * (Real.exp (-t ^ 2) * (|t| / ‖(a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ)‖)) := by ring _ ≤ (r ^ (-a) * Real.exp ((a + ((2 * n : ℕ) : ℝ)) ^ 2)) * 1 := by apply mul_le_mul_of_nonneg_left (mul_le_one₀ hexp (div_nonneg (abs_nonneg t) (norm_nonneg _)) hfrac) positivity _ = r ^ (-a) * Real.exp ((a + ((2 * n : ℕ) : ℝ)) ^ 2) := mul_one _ _ ≤ C := hC (Set.mem_image_of_mem _ ha) theorem saddleFiniteGaussianPoleWeighted_horizontalStrip_bound {r A B : ℝ} (hr : 0 < r) (hAB : A ≤ B) (c : ℕ → ℂ) (N : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ a ∈ Set.Icc A B, ∀ t : ℝ, 1 ≤ |t| → |t| * ‖saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * (∑ n ∈ Finset.range (N + 1), c n * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I))‖ ≤ C := by choose G hG hbound using (fun n : ℕ => saddleGaussianPoleRepresentative_weighted_horizontalStrip_bound hr hAB n) let C : ℝ := ∑ n ∈ Finset.range (N + 1), ‖c n‖ * G n have hC : 0 ≤ C := by unfold C exact Finset.sum_nonneg (fun n _ => mul_nonneg (norm_nonneg _) (hG n)) refine ⟨C, hC, ?_⟩ intro a ha t ht let z : ℂ := (a : ℂ) + (t : ℂ) * Complex.I change |t| * ‖saddleMellinInversePower r z * (∑ n ∈ Finset.range (N + 1), c n * saddleGaussianPoleRepresentative n z)‖ ≤ C calc |t| * ‖saddleMellinInversePower r z * (∑ n ∈ Finset.range (N + 1), c n * saddleGaussianPoleRepresentative n z)‖ = |t| * ‖∑ n ∈ Finset.range (N + 1), saddleMellinInversePower r z * (c n * saddleGaussianPoleRepresentative n z)‖ := by rw [Finset.mul_sum] _ ≤ |t| * ∑ n ∈ Finset.range (N + 1), ‖saddleMellinInversePower r z * (c n * saddleGaussianPoleRepresentative n z)‖ := by gcongr exact norm_sum_le _ _ _ = ∑ n ∈ Finset.range (N + 1), ‖c n‖ * (|t| * ‖saddleMellinInversePower r z * saddleGaussianPoleRepresentative n z‖) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro n _ rw [norm_mul, norm_mul, norm_mul] ring _ ≤ ∑ n ∈ Finset.range (N + 1), ‖c n‖ * G n := by apply Finset.sum_le_sum intro n _ exact mul_le_mul_of_nonneg_left (by simpa [z] using! hbound n a ha t ht) (norm_nonneg _) _ = C := rfl theorem saddleNonzeroFrequency_ne_pole (a : ℝ) {t : ℝ} (ht : t ≠ 0) (n : ℕ) : (a : ℂ) + (t : ℂ) * Complex.I ≠ (-((2 * n : ℕ) : ℂ)) := by intro heq have him := congrArg Complex.im heq norm_num [Complex.mul_im] at him exact ht him theorem plusSaddleFiniteRapidContourIntegrand_horizontalStrip_bound {ε ℓ r A B : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (N : ℕ) (hhalf : -(2 * ((N : ℝ) + 1)) < A) (hAB : A ≤ B) : ∃ C : ℝ, 0 ≤ C ∧ ∀ a ∈ Set.Icc A B, ∀ t : ℝ, 1 ≤ |t| → |t| * ‖plusSaddleFiniteRapidContourIntegrand ε ℓ N r ((a : ℂ) + (t : ℂ) * Complex.I)‖ ≤ C := by obtain ⟨D, hD, hdata⟩ := plusSaddleMellinData_weighted_horizontalStrip_polynomial_bound hε hℓ horder hr hAB 1 obtain ⟨G, hG, hgaussian⟩ := saddleFiniteGaussianPoleWeighted_horizontalStrip_bound hr hAB (plusSaddlePoleResidue ε ℓ) N refine ⟨D + G, add_nonneg hD hG, ?_⟩ intro a ha t ht have htne : t ≠ 0 := by intro hzero norm_num [hzero] at ht let z : ℂ := (a : ℂ) + (t : ℂ) * Complex.I have hz : z ∈ saddleFinitePoleHalfPlane N := by change -(2 * ((N : ℝ) + 1)) < z.re try dsimp [z] simpa [Complex.mul_re] using! hhalf.trans_le ha.1 have hpoles : ∀ n : ℕ, z ≠ (-((2 * n : ℕ) : ℂ)) := by intro n exact saddleNonzeroFrequency_ne_pole a htne n change |t| * ‖plusSaddleFiniteRapidContourIntegrand ε ℓ N r z‖ ≤ D + G unfold plusSaddleFiniteRapidContourIntegrand rw [plusSaddleFiniteRapidPoleRegularPart_eq_subtraction_of_not_pole hε horder ℓ N hz hpoles] unfold plusSaddleFiniteRapidPoleSubtraction rw [mul_sub] calc |t| * ‖saddleMellinInversePower r z * plusSaddleMellinData ε ℓ z - saddleMellinInversePower r z * (∑ n ∈ Finset.range (N + 1), plusSaddlePoleResidue ε ℓ n * saddleGaussianPoleRepresentative n z)‖ ≤ |t| * (‖saddleMellinInversePower r z * plusSaddleMellinData ε ℓ z‖ + ‖saddleMellinInversePower r z * (∑ n ∈ Finset.range (N + 1), plusSaddlePoleResidue ε ℓ n * saddleGaussianPoleRepresentative n z)‖) := by gcongr exact norm_sub_le _ _ _ = |t| * ‖saddleMellinInversePower r z * plusSaddleMellinData ε ℓ z‖ + |t| * ‖saddleMellinInversePower r z * (∑ n ∈ Finset.range (N + 1), plusSaddlePoleResidue ε ℓ n * saddleGaussianPoleRepresentative n z)‖ := by ring _ ≤ D + G := by apply add_le_add · simpa [z] using! hdata a ha t ht · simpa [z] using! hgaussian a ha t ht theorem minusSaddleFiniteRapidContourIntegrand_horizontalStrip_bound {ε ℓ r A B : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (N : ℕ) (hhalf : -(2 * ((N : ℝ) + 1)) < A) (hAB : A ≤ B) : ∃ C : ℝ, 0 ≤ C ∧ ∀ a ∈ Set.Icc A B, ∀ t : ℝ, 1 ≤ |t| → |t| * ‖minusSaddleFiniteRapidContourIntegrand ε ℓ N r ((a : ℂ) + (t : ℂ) * Complex.I)‖ ≤ C := by obtain ⟨D, hD, hdata⟩ := minusSaddleMellinData_weighted_horizontalStrip_polynomial_bound hε hℓ horder hr hAB 1 obtain ⟨G, hG, hgaussian⟩ := saddleFiniteGaussianPoleWeighted_horizontalStrip_bound hr hAB (minusSaddlePoleResidue ε ℓ) N refine ⟨D + G, add_nonneg hD hG, ?_⟩ intro a ha t ht have htne : t ≠ 0 := by intro hzero norm_num [hzero] at ht let z : ℂ := (a : ℂ) + (t : ℂ) * Complex.I have hz : z ∈ saddleFinitePoleHalfPlane N := by change -(2 * ((N : ℝ) + 1)) < z.re try dsimp [z] simpa [Complex.mul_re] using! hhalf.trans_le ha.1 have hpoles : ∀ n : ℕ, z ≠ (-((2 * n : ℕ) : ℂ)) := by intro n exact saddleNonzeroFrequency_ne_pole a htne n change |t| * ‖minusSaddleFiniteRapidContourIntegrand ε ℓ N r z‖ ≤ D + G unfold minusSaddleFiniteRapidContourIntegrand rw [minusSaddleFiniteRapidPoleRegularPart_eq_subtraction_of_not_pole hε horder ℓ N hz hpoles] unfold minusSaddleFiniteRapidPoleSubtraction rw [mul_sub] calc |t| * ‖saddleMellinInversePower r z * minusSaddleMellinData ε ℓ z - saddleMellinInversePower r z * (∑ n ∈ Finset.range (N + 1), minusSaddlePoleResidue ε ℓ n * saddleGaussianPoleRepresentative n z)‖ ≤ |t| * (‖saddleMellinInversePower r z * minusSaddleMellinData ε ℓ z‖ + ‖saddleMellinInversePower r z * (∑ n ∈ Finset.range (N + 1), minusSaddlePoleResidue ε ℓ n * saddleGaussianPoleRepresentative n z)‖) := by gcongr exact norm_sub_le _ _ _ = |t| * ‖saddleMellinInversePower r z * minusSaddleMellinData ε ℓ z‖ + |t| * ‖saddleMellinInversePower r z * (∑ n ∈ Finset.range (N + 1), minusSaddlePoleResidue ε ℓ n * saddleGaussianPoleRepresentative n z)‖ := by ring _ ≤ D + G := by apply add_le_add · simpa [z] using! hdata a ha t ht · simpa [z] using! hgaussian a ha t ht theorem plusSaddleFiniteRapidContourIntegrand_horizontalIntegral_tendsto_zero {ε ℓ r A B : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (N : ℕ) (hhalf : -(2 * ((N : ℝ) + 1)) < A) (hAB : A ≤ B) (s : ℝ) (hs : |s| = 1) : Tendsto (fun T : ℝ => ∫ a in A..B, plusSaddleFiniteRapidContourIntegrand ε ℓ N r ((a : ℂ) + ((s * T : ℝ) : ℂ) * Complex.I)) Filter.atTop (𝓝 0) := by obtain ⟨C, hC, hbound⟩ := plusSaddleFiniteRapidContourIntegrand_horizontalStrip_bound hε hℓ horder hr N hhalf hAB exact saddleHorizontalIntegral_tendsto_zero (F := plusSaddleFiniteRapidContourIntegrand ε ℓ N r) hAB hbound s hs theorem minusSaddleFiniteRapidContourIntegrand_horizontalIntegral_tendsto_zero {ε ℓ r A B : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (N : ℕ) (hhalf : -(2 * ((N : ℝ) + 1)) < A) (hAB : A ≤ B) (s : ℝ) (hs : |s| = 1) : Tendsto (fun T : ℝ => ∫ a in A..B, minusSaddleFiniteRapidContourIntegrand ε ℓ N r ((a : ℂ) + ((s * T : ℝ) : ℂ) * Complex.I)) Filter.atTop (𝓝 0) := by obtain ⟨C, hC, hbound⟩ := minusSaddleFiniteRapidContourIntegrand_horizontalStrip_bound hε hℓ horder hr N hhalf hAB exact saddleHorizontalIntegral_tendsto_zero (F := minusSaddleFiniteRapidContourIntegrand ε ℓ N r) hAB hbound s hs def saddleCauchyPolePrimitive (a t : ℝ) : ℂ := (Real.arctan (t / a) : ℂ) - ((Real.log (a ^ 2 + t ^ 2) / 2 : ℝ) : ℂ) * Complex.I theorem saddleCauchyPolePrimitive_hasDerivAt {a : ℝ} (ha : a ≠ 0) (t : ℝ) : HasDerivAt (saddleCauchyPolePrimitive a) (((a : ℂ) + (t : ℂ) * Complex.I)⁻¹) t := by have hden : a ^ 2 + t ^ 2 ≠ 0 := by have ha2 : 0 < a ^ 2 := sq_pos_of_ne_zero ha nlinarith [sq_nonneg t] have hatan : HasDerivAt (fun y : ℝ => Real.arctan (y / a)) (a / (a ^ 2 + t ^ 2)) t := by convert! (Real.hasDerivAt_arctan (t / a)).comp t ((hasDerivAt_id t).div_const a) using 1 field_simp [ha, hden] have hquadratic : HasDerivAt (fun y : ℝ => a ^ 2 + y ^ 2) (2 * t) t := by convert! ((hasDerivAt_id t).pow 2).const_add (a ^ 2) using 1; simp [id] have hlog : HasDerivAt (fun y : ℝ => Real.log (a ^ 2 + y ^ 2) / 2) (t / (a ^ 2 + t ^ 2)) t := by convert! ((Real.hasDerivAt_log hden).comp t hquadratic).div_const 2 using 1 field_simp [hden] have hvalue : ((a / (a ^ 2 + t ^ 2) : ℝ) : ℂ) - ((t / (a ^ 2 + t ^ 2) : ℝ) : ℂ) * Complex.I = ((a : ℂ) + (t : ℂ) * Complex.I)⁻¹ := by have hz : (a : ℂ) + (t : ℂ) * Complex.I ≠ 0 := by intro hz apply ha have hre := congrArg Complex.re hz simpa [Complex.mul_re] using! hre have hcden : ((a ^ 2 + t ^ 2 : ℝ) : ℂ) ≠ 0 := by exact_mod_cast hden have hcden' : (a : ℂ) ^ 2 + (t : ℂ) ^ 2 ≠ 0 := by simpa using! hcden apply (mul_eq_one_iff_eq_inv₀ hz).mp push_cast field_simp [hcden', Complex.I_sq]; ring_nf; simp [Complex.I_sq] rw [← hvalue] exact hatan.ofReal_comp.sub (hlog.ofReal_comp.mul_const Complex.I) theorem saddleCauchyPole_symmetric_intervalIntegral {a : ℝ} (ha : a ≠ 0) (T : ℝ) : (∫ t in -T..T, ((a : ℂ) + (t : ℂ) * Complex.I)⁻¹) = ((2 * Real.arctan (T / a) : ℝ) : ℂ) := by have hline : Continuous (fun t : ℝ => (a : ℂ) + (t : ℂ) * Complex.I) := by fun_prop have hnonzero : ∀ t : ℝ, (a : ℂ) + (t : ℂ) * Complex.I ≠ 0 := by intro t hzero apply ha have hre := congrArg Complex.re hzero simpa [Complex.mul_re] using! hre have hint : IntervalIntegrable (fun t : ℝ => ((a : ℂ) + (t : ℂ) * Complex.I)⁻¹) volume (-T) T := (hline.inv₀ hnonzero).intervalIntegrable _ _ rw [intervalIntegral.integral_eq_sub_of_hasDerivAt (fun t _ => saddleCauchyPolePrimitive_hasDerivAt ha t) hint] unfold saddleCauchyPolePrimitive simp [neg_div, Real.arctan_neg, pow_two]; ring theorem saddleInfiniteRectangle_vertical_integral_eq {F : ℂ → ℂ} {A B : ℝ} (hA : Integrable (fun t : ℝ => F ((A : ℂ) + (t : ℂ) * Complex.I))) (hB : Integrable (fun t : ℝ => F ((B : ℂ) + (t : ℂ) * Complex.I))) (hlower : Tendsto (fun T : ℝ => ∫ a in A..B, F ((a : ℂ) + ((-T : ℝ) : ℂ) * Complex.I)) Filter.atTop (𝓝 0)) (hupper : Tendsto (fun T : ℝ => ∫ a in A..B, F ((a : ℂ) + (T : ℂ) * Complex.I)) Filter.atTop (𝓝 0)) (hrectangle : ∀ T : ℝ, (∫ a in A..B, F ((a : ℂ) + ((-T : ℝ) : ℂ) * Complex.I)) - (∫ a in A..B, F ((a : ℂ) + (T : ℂ) * Complex.I)) + Complex.I * (∫ t in -T..T, F ((B : ℂ) + (t : ℂ) * Complex.I)) - Complex.I * (∫ t in -T..T, F ((A : ℂ) + (t : ℂ) * Complex.I)) = 0) : (∫ t : ℝ, F ((B : ℂ) + (t : ℂ) * Complex.I)) = (∫ t : ℝ, F ((A : ℂ) + (t : ℂ) * Complex.I)) := by have hright : Tendsto (fun T : ℝ => ∫ t in -T..T, F ((B : ℂ) + (t : ℂ) * Complex.I)) Filter.atTop (𝓝 (∫ t : ℝ, F ((B : ℂ) + (t : ℂ) * Complex.I))) := intervalIntegral_tendsto_integral hB tendsto_neg_atTop_atBot tendsto_id have hleft : Tendsto (fun T : ℝ => ∫ t in -T..T, F ((A : ℂ) + (t : ℂ) * Complex.I)) Filter.atTop (𝓝 (∫ t : ℝ, F ((A : ℂ) + (t : ℂ) * Complex.I))) := intervalIntegral_tendsto_integral hA tendsto_neg_atTop_atBot tendsto_id have hlimit : Tendsto (fun T : ℝ => (∫ a in A..B, F ((a : ℂ) + ((-T : ℝ) : ℂ) * Complex.I)) - (∫ a in A..B, F ((a : ℂ) + (T : ℂ) * Complex.I)) + Complex.I * (∫ t in -T..T, F ((B : ℂ) + (t : ℂ) * Complex.I)) - Complex.I * (∫ t in -T..T, F ((A : ℂ) + (t : ℂ) * Complex.I))) Filter.atTop (𝓝 (Complex.I * (∫ t : ℝ, F ((B : ℂ) + (t : ℂ) * Complex.I)) - Complex.I * (∫ t : ℝ, F ((A : ℂ) + (t : ℂ) * Complex.I)))) := by simpa using! (((hlower.sub hupper).add (tendsto_const_nhds.mul hright)).sub (tendsto_const_nhds.mul hleft)) have hzero : Tendsto (fun T : ℝ => (∫ a in A..B, F ((a : ℂ) + ((-T : ℝ) : ℂ) * Complex.I)) - (∫ a in A..B, F ((a : ℂ) + (T : ℂ) * Complex.I)) + Complex.I * (∫ t in -T..T, F ((B : ℂ) + (t : ℂ) * Complex.I)) - Complex.I * (∫ t in -T..T, F ((A : ℂ) + (t : ℂ) * Complex.I))) Filter.atTop (𝓝 0) := (tendsto_const_nhds : Tendsto (fun _ : ℝ => (0 : ℂ)) Filter.atTop (𝓝 0)).congr' (Filter.Eventually.of_forall (fun T : ℝ => (hrectangle T).symm)) have hidentity : Complex.I * ((∫ t : ℝ, F ((B : ℂ) + (t : ℂ) * Complex.I)) - (∫ t : ℝ, F ((A : ℂ) + (t : ℂ) * Complex.I))) = 0 := by simpa [mul_sub] using! (tendsto_nhds_unique hlimit hzero) exact sub_eq_zero.mp ((mul_eq_zero.mp hidentity).resolve_left Complex.I_ne_zero) theorem plusSaddleFiniteRapidContourIntegrand_vertical_integral_eq {ε ℓ r A B : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (N : ℕ) (hhalf : -(2 * ((N : ℝ) + 1)) < A) (hAB : A ≤ B) (hApole : ∀ n : ℕ, A ≠ -((2 * n : ℕ) : ℝ)) (hBpole : ∀ n : ℕ, B ≠ -((2 * n : ℕ) : ℝ)) : (∫ t : ℝ, plusSaddleFiniteRapidContourIntegrand ε ℓ N r ((B : ℂ) + (t : ℂ) * Complex.I)) = (∫ t : ℝ, plusSaddleFiniteRapidContourIntegrand ε ℓ N r ((A : ℂ) + (t : ℂ) * Complex.I)) := by have hhalfB : -(2 * ((N : ℝ) + 1)) < B := hhalf.trans_le hAB have hleft := plusSaddleFiniteRapidContourIntegrand_shiftedLine_integrable hε hℓ horder N hhalf hApole hr have hright := plusSaddleFiniteRapidContourIntegrand_shiftedLine_integrable hε hℓ horder N hhalfB hBpole hr have hlower : Tendsto (fun T : ℝ => ∫ a in A..B, plusSaddleFiniteRapidContourIntegrand ε ℓ N r ((a : ℂ) + ((-T : ℝ) : ℂ) * Complex.I)) Filter.atTop (𝓝 0) := by simpa using! plusSaddleFiniteRapidContourIntegrand_horizontalIntegral_tendsto_zero hε hℓ horder hr N hhalf hAB (-1 : ℝ) (by norm_num) have hupper : Tendsto (fun T : ℝ => ∫ a in A..B, plusSaddleFiniteRapidContourIntegrand ε ℓ N r ((a : ℂ) + (T : ℂ) * Complex.I)) Filter.atTop (𝓝 0) := by simpa using! plusSaddleFiniteRapidContourIntegrand_horizontalIntegral_tendsto_zero hε hℓ horder hr N hhalf hAB (1 : ℝ) (by norm_num) apply saddleInfiniteRectangle_vertical_integral_eq hleft hright hlower hupper intro T let z : ℂ := (A : ℂ) + ((-T : ℝ) : ℂ) * Complex.I let w : ℂ := (B : ℂ) + (T : ℂ) * Complex.I have hz : z ∈ saddleFinitePoleHalfPlane N := by change -(2 * ((N : ℝ) + 1)) < z.re simpa [z, Complex.mul_re] using! hhalf have hw : w ∈ saddleFinitePoleHalfPlane N := by change -(2 * ((N : ℝ) + 1)) < w.re simpa [w, Complex.mul_re] using! hhalfB simpa [z, w, Complex.mul_re, Complex.mul_im, smul_eq_mul] using! plusSaddleFiniteRapidContourIntegrand_boundary_rectangle hε horder ℓ N hr z w hz hw theorem minusSaddleFiniteRapidContourIntegrand_vertical_integral_eq {ε ℓ r A B : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (N : ℕ) (hhalf : -(2 * ((N : ℝ) + 1)) < A) (hAB : A ≤ B) (hApole : ∀ n : ℕ, A ≠ -((2 * n : ℕ) : ℝ)) (hBpole : ∀ n : ℕ, B ≠ -((2 * n : ℕ) : ℝ)) : (∫ t : ℝ, minusSaddleFiniteRapidContourIntegrand ε ℓ N r ((B : ℂ) + (t : ℂ) * Complex.I)) = (∫ t : ℝ, minusSaddleFiniteRapidContourIntegrand ε ℓ N r ((A : ℂ) + (t : ℂ) * Complex.I)) := by have hhalfB : -(2 * ((N : ℝ) + 1)) < B := hhalf.trans_le hAB have hleft := minusSaddleFiniteRapidContourIntegrand_shiftedLine_integrable hε hℓ horder N hhalf hApole hr have hright := minusSaddleFiniteRapidContourIntegrand_shiftedLine_integrable hε hℓ horder N hhalfB hBpole hr have hlower : Tendsto (fun T : ℝ => ∫ a in A..B, minusSaddleFiniteRapidContourIntegrand ε ℓ N r ((a : ℂ) + ((-T : ℝ) : ℂ) * Complex.I)) Filter.atTop (𝓝 0) := by simpa using! minusSaddleFiniteRapidContourIntegrand_horizontalIntegral_tendsto_zero hε hℓ horder hr N hhalf hAB (-1 : ℝ) (by norm_num) have hupper : Tendsto (fun T : ℝ => ∫ a in A..B, minusSaddleFiniteRapidContourIntegrand ε ℓ N r ((a : ℂ) + (T : ℂ) * Complex.I)) Filter.atTop (𝓝 0) := by simpa using! minusSaddleFiniteRapidContourIntegrand_horizontalIntegral_tendsto_zero hε hℓ horder hr N hhalf hAB (1 : ℝ) (by norm_num) apply saddleInfiniteRectangle_vertical_integral_eq hleft hright hlower hupper intro T let z : ℂ := (A : ℂ) + ((-T : ℝ) : ℂ) * Complex.I let w : ℂ := (B : ℂ) + (T : ℂ) * Complex.I have hz : z ∈ saddleFinitePoleHalfPlane N := by change -(2 * ((N : ℝ) + 1)) < z.re simpa [z, Complex.mul_re] using! hhalf have hw : w ∈ saddleFinitePoleHalfPlane N := by change -(2 * ((N : ℝ) + 1)) < w.re simpa [w, Complex.mul_re] using! hhalfB simpa [z, w, Complex.mul_re, Complex.mul_im, smul_eq_mul] using! minusSaddleFiniteRapidContourIntegrand_boundary_rectangle hε horder ℓ N hr z w hz hw theorem plusSaddleSpectrum_moment_integrable {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (k : ℕ) : Integrable (fun t : ℝ => (t : ℂ) ^ k * plusSaddleSpectrum ε ℓ t) := by apply integrable_of_continuous_polynomial_decay (plusSaddleSpectrum_continuous hε hℓ horder) intro j refine ⟨((1 + |beta ε|) * (1 + ℓ⁻¹) ^ 3) * ((2 : ℝ) ^ (j + 3) * Real.Gamma (ℓ / 2 + (j + 3)) * Real.exp (2 * |ℓ| * saddleShellTotalVariation ε)), ?_, ?_⟩ · have hgamma : 0 < Real.Gamma (ℓ / 2 + (j + 3)) := Real.Gamma_pos_of_pos (by positivity) positivity · intro t ht exact plusSaddleSpectrum_vertical_polynomial_bound hε hℓ horder ht j theorem minusSaddleSpectrum_moment_integrable {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (k : ℕ) : Integrable (fun t : ℝ => (t : ℂ) ^ k * minusSaddleSpectrum ε ℓ t) := by apply integrable_of_continuous_polynomial_decay (minusSaddleSpectrum_continuous hε hℓ horder) intro j refine ⟨((1 + |beta ε|) * (1 + ℓ⁻¹) ^ 3) * ((2 : ℝ) ^ (j + 3) * Real.Gamma (ℓ / 2 + (j + 3)) * Real.exp (2 * |ℓ| * saddleShellTotalVariation ε)), ?_, ?_⟩ · have hgamma : 0 < Real.Gamma (ℓ / 2 + (j + 3)) := Real.Gamma_pos_of_pos (by positivity) positivity · intro t ht exact minusSaddleSpectrum_vertical_polynomial_bound hε hℓ horder ht j theorem plusSaddleSpectrum_norm_moment_integrable {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (k : ℕ) : Integrable (fun t : ℝ => |t| ^ k * ‖plusSaddleSpectrum ε ℓ t‖) := by simpa [norm_mul, norm_pow, Complex.norm_real, Real.norm_eq_abs] using! (plusSaddleSpectrum_moment_integrable hε hℓ horder k).norm theorem minusSaddleSpectrum_norm_moment_integrable {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (k : ℕ) : Integrable (fun t : ℝ => |t| ^ k * ‖minusSaddleSpectrum ε ℓ t‖) := by simpa [norm_mul, norm_pow, Complex.norm_real, Real.norm_eq_abs] using! (minusSaddleSpectrum_moment_integrable hε hℓ horder k).norm def plusSaddleFourierData (ε ℓ y : ℝ) : ℂ := plusSaddleSpectrum ε ℓ (-(2 * Real.pi * y)) def minusSaddleFourierData (ε ℓ y : ℝ) : ℂ := minusSaddleSpectrum ε ℓ (-(2 * Real.pi * y)) theorem integrable_scaled_norm_moment {F : ℝ → ℂ} (hF : Continuous F) (hmom : ∀ j : ℕ, Integrable (fun t : ℝ => |t| ^ j * ‖F t‖)) {c : ℝ} (hc : c ≠ 0) (hclarge : 1 ≤ |c|) (k : ℕ) : Integrable (fun y : ℝ => ‖y‖ ^ k * ‖F (c * y)‖) := by have hbase : Integrable (fun y : ℝ => |c * y| ^ k * ‖F (c * y)‖) := (hmom k).comp_mul_left' hc have hcomp : Continuous (fun y : ℝ => F (c * y)) := hF.comp (by fun_prop) have hmeas : AEStronglyMeasurable (fun y : ℝ => |y| ^ k * ‖F (c * y)‖) := ((continuous_abs.pow k).mul hcomp.norm).aestronglyMeasurable have hresult : Integrable (fun y : ℝ => |y| ^ k * ‖F (c * y)‖) := by apply hbase.mono' hmeas filter_upwards [] with y rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (pow_nonneg (abs_nonneg y) k) (norm_nonneg _))] apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) rw [abs_mul] gcongr calc |y| = 1 * |y| := by ring _ ≤ |c| * |y| := by gcongr simpa only [Real.norm_eq_abs] using! hresult theorem plusSaddleFourierData_norm_moment_integrable {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (k : ℕ) : Integrable (fun y : ℝ => ‖y‖ ^ k * ‖plusSaddleFourierData ε ℓ y‖) := by let c : ℝ := -(2 * Real.pi) have hc : c ≠ 0 := by try dsimp [c] exact neg_ne_zero.mpr (mul_ne_zero (by norm_num) Real.pi_ne_zero) have hclarge : 1 ≤ |c| := by try dsimp [c] rw [abs_neg, abs_of_pos (mul_pos (by norm_num) Real.pi_pos)] nlinarith [Real.pi_gt_three] have h := integrable_scaled_norm_moment (plusSaddleSpectrum_continuous hε hℓ horder) (fun j => plusSaddleSpectrum_norm_moment_integrable hε hℓ horder j) hc hclarge k simpa [plusSaddleFourierData, c, neg_mul, mul_assoc] using! h theorem minusSaddleFourierData_norm_moment_integrable {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (k : ℕ) : Integrable (fun y : ℝ => ‖y‖ ^ k * ‖minusSaddleFourierData ε ℓ y‖) := by let c : ℝ := -(2 * Real.pi) have hc : c ≠ 0 := by try dsimp [c] exact neg_ne_zero.mpr (mul_ne_zero (by norm_num) Real.pi_ne_zero) have hclarge : 1 ≤ |c| := by try dsimp [c] rw [abs_neg, abs_of_pos (mul_pos (by norm_num) Real.pi_pos)] nlinarith [Real.pi_gt_three] have h := integrable_scaled_norm_moment (minusSaddleSpectrum_continuous hε hℓ horder) (fun j => minusSaddleSpectrum_norm_moment_integrable hε hℓ horder j) hc hclarge k simpa [minusSaddleFourierData, c, neg_mul, mul_assoc] using! h theorem plusSaddleFourierData_fourier_contDiff {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) : ContDiff ℝ ∞ (𝓕 (plusSaddleFourierData ε ℓ)) := by exact Real.contDiff_fourier (N := ⊤) (fun n _ => plusSaddleFourierData_norm_moment_integrable hε hℓ horder n) theorem minusSaddleFourierData_fourier_contDiff {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) : ContDiff ℝ ∞ (𝓕 (minusSaddleFourierData ε ℓ)) := by exact Real.contDiff_fourier (N := ⊤) (fun n _ => minusSaddleFourierData_norm_moment_integrable hε hℓ horder n) theorem plusSaddleMellinData_fourier_vertical (ε ℓ y : ℝ) : plusSaddleMellinData ε ℓ ((ℓ : ℂ) + (2 * Real.pi * y : ℝ) * Complex.I) = plusSaddleFourierData ε ℓ y := by have harg : ((ℓ : ℂ) + (2 * Real.pi * y : ℝ) * Complex.I) = ((ℓ : ℂ) - Complex.I * ((-(2 * Real.pi * y) : ℝ) : ℂ)) := by push_cast ring rw [harg, plusSaddleMellinData_vertical] rfl theorem minusSaddleMellinData_fourier_vertical (ε ℓ y : ℝ) : minusSaddleMellinData ε ℓ ((ℓ : ℂ) + (2 * Real.pi * y : ℝ) * Complex.I) = minusSaddleFourierData ε ℓ y := by have harg : ((ℓ : ℂ) + (2 * Real.pi * y : ℝ) * Complex.I) = ((ℓ : ℂ) - Complex.I * ((-(2 * Real.pi * y) : ℝ) : ℂ)) := by push_cast ring rw [harg, minusSaddleMellinData_vertical] rfl theorem plusSaddleProfile_eq_fourier (ε ℓ : ℝ) {r : ℝ} (hr : 0 < r) : plusSaddleProfile ε ℓ r = (r ^ (-ℓ) : ℝ) * (𝓕 (plusSaddleFourierData ε ℓ)) (Real.log r) := by have hline : (fun y : ℝ => plusSaddleMellinData ε ℓ ((ℓ : ℂ) + 2 * (Real.pi : ℂ) * (y : ℂ) * Complex.I)) = plusSaddleFourierData ε ℓ := by funext y simpa only [Complex.ofReal_mul, Complex.ofReal_ofNat] using! plusSaddleMellinData_fourier_vertical ε ℓ y unfold plusSaddleProfile rw [if_neg hr.ne', mellinInv_eq_fourierInv ℓ (plusSaddleMellinData ε ℓ) hr, hline, Real.fourierInv_eq_fourier_neg] simp only [neg_neg, smul_eq_mul] have hpow : (r : ℂ) ^ (-(ℓ : ℂ)) = ((r ^ (-ℓ) : ℝ) : ℂ) := by simpa using! (Complex.ofReal_cpow hr.le (-ℓ)).symm rw [hpow] theorem minusSaddleProfile_eq_fourier (ε ℓ : ℝ) {r : ℝ} (hr : 0 < r) : minusSaddleProfile ε ℓ r = (r ^ (-ℓ) : ℝ) * (𝓕 (minusSaddleFourierData ε ℓ)) (Real.log r) := by have hline : (fun y : ℝ => minusSaddleMellinData ε ℓ ((ℓ : ℂ) + 2 * (Real.pi : ℂ) * (y : ℂ) * Complex.I)) = minusSaddleFourierData ε ℓ := by funext y simpa only [Complex.ofReal_mul, Complex.ofReal_ofNat] using! minusSaddleMellinData_fourier_vertical ε ℓ y unfold minusSaddleProfile rw [if_neg hr.ne', mellinInv_eq_fourierInv ℓ (minusSaddleMellinData ε ℓ) hr, hline, Real.fourierInv_eq_fourier_neg] simp only [neg_neg, smul_eq_mul] have hpow : (r : ℂ) ^ (-(ℓ : ℂ)) = ((r ^ (-ℓ) : ℝ) : ℂ) := by simpa using! (Complex.ofReal_cpow hr.le (-ℓ)).symm rw [hpow] theorem plusSaddleProfile_contDiffOn {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) : ContDiffOn ℝ ∞ (plusSaddleProfile ε ℓ) (Set.Ioi 0) := by have hpow : ContDiffOn ℝ ∞ (fun r : ℝ => r ^ (-ℓ)) (Set.Ioi 0) := contDiff_id.contDiffOn.rpow_const_of_ne (fun r hr => (show 0 < r from hr).ne') have hweight : ContDiffOn ℝ ∞ (fun r : ℝ => ((r ^ (-ℓ) : ℝ) : ℂ)) (Set.Ioi 0) := Complex.ofRealCLM.contDiff.fun_comp_contDiffOn hpow have hlog : ContDiffOn ℝ ∞ Real.log (Set.Ioi 0) := contDiff_id.contDiffOn.log (fun r hr => (show 0 < r from hr).ne') have hfourier : ContDiffOn ℝ ∞ (fun r : ℝ => (𝓕 (plusSaddleFourierData ε ℓ)) (Real.log r)) (Set.Ioi 0) := (plusSaddleFourierData_fourier_contDiff hε hℓ horder).fun_comp_contDiffOn hlog exact (hweight.mul hfourier).congr (fun r hr => (plusSaddleProfile_eq_fourier ε ℓ (show 0 < r from hr))) theorem minusSaddleProfile_contDiffOn {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) : ContDiffOn ℝ ∞ (minusSaddleProfile ε ℓ) (Set.Ioi 0) := by have hpow : ContDiffOn ℝ ∞ (fun r : ℝ => r ^ (-ℓ)) (Set.Ioi 0) := contDiff_id.contDiffOn.rpow_const_of_ne (fun r hr => (show 0 < r from hr).ne') have hweight : ContDiffOn ℝ ∞ (fun r : ℝ => ((r ^ (-ℓ) : ℝ) : ℂ)) (Set.Ioi 0) := Complex.ofRealCLM.contDiff.fun_comp_contDiffOn hpow have hlog : ContDiffOn ℝ ∞ Real.log (Set.Ioi 0) := contDiff_id.contDiffOn.log (fun r hr => (show 0 < r from hr).ne') have hfourier : ContDiffOn ℝ ∞ (fun r : ℝ => (𝓕 (minusSaddleFourierData ε ℓ)) (Real.log r)) (Set.Ioi 0) := (minusSaddleFourierData_fourier_contDiff hε hℓ horder).fun_comp_contDiffOn hlog exact (hweight.mul hfourier).congr (fun r hr => (minusSaddleProfile_eq_fourier ε ℓ (show 0 < r from hr))) theorem plusSaddleFunction_contDiffOn {ε : ℝ} (hε : 0 < ε) {d : ℕ} (hd : 0 < d) (horder : shortCutoff ε ≤ shortEndpoint ε) : ContDiffOn ℝ ∞ (plusSaddleFunction ε d) ({0}ᶜ : Set (Euclidean d)) := by have hdimension : 0 < (d : ℝ) / 2 := by exact div_pos (by exact_mod_cast hd) (by norm_num) have hnorm : ContDiffOn ℝ ∞ (fun x : Euclidean d => ‖x‖) ({0}ᶜ : Set (Euclidean d)) := by apply ContDiffOn.norm ℝ · exact contDiff_id.contDiffOn · intro x hx simpa only [Set.mem_compl_iff, Set.mem_singleton_iff] using! hx have hmaps : Set.MapsTo (fun x : Euclidean d => ‖x‖) ({0}ᶜ : Set (Euclidean d)) (Set.Ioi 0) := by intro x hx apply norm_pos_iff.mpr simpa only [Set.mem_compl_iff, Set.mem_singleton_iff] using! hx simpa only [plusSaddleFunction, Function.comp_apply] using! (plusSaddleProfile_contDiffOn hε hdimension horder).comp hnorm hmaps theorem minusSaddleFunction_contDiffOn {ε : ℝ} (hε : 0 < ε) {d : ℕ} (hd : 0 < d) (horder : shortCutoff ε ≤ shortEndpoint ε) : ContDiffOn ℝ ∞ (minusSaddleFunction ε d) ({0}ᶜ : Set (Euclidean d)) := by have hdimension : 0 < (d : ℝ) / 2 := by exact div_pos (by exact_mod_cast hd) (by norm_num) have hnorm : ContDiffOn ℝ ∞ (fun x : Euclidean d => ‖x‖) ({0}ᶜ : Set (Euclidean d)) := by apply ContDiffOn.norm ℝ · exact contDiff_id.contDiffOn · intro x hx simpa only [Set.mem_compl_iff, Set.mem_singleton_iff] using! hx have hmaps : Set.MapsTo (fun x : Euclidean d => ‖x‖) ({0}ᶜ : Set (Euclidean d)) (Set.Ioi 0) := by intro x hx apply norm_pos_iff.mpr simpa only [Set.mem_compl_iff, Set.mem_singleton_iff] using! hx simpa only [minusSaddleFunction, Function.comp_apply] using! (minusSaddleProfile_contDiffOn hε hdimension horder).comp hnorm hmaps theorem plusSaddleSpectrum_conj (ε ℓ t : ℝ) : starRingEnd ℂ (plusSaddleSpectrum ε ℓ t) = plusSaddleSpectrum ε ℓ (-t) := by unfold plusSaddleSpectrum rw [map_mul, saddleEnvelope_conj, plusPolynomial_conj] congr 1 simp only [map_div₀, Complex.conj_ofReal] have hneg : ((-t : ℝ) : ℂ) / (ℓ : ℂ) = -((t : ℂ) / (ℓ : ℂ)) := by push_cast ring rw [hneg] simpa using! (minusPolynomial_neg ε (-((t : ℂ) / (ℓ : ℂ)))) theorem minusSaddleSpectrum_conj (ε ℓ t : ℝ) : starRingEnd ℂ (minusSaddleSpectrum ε ℓ t) = minusSaddleSpectrum ε ℓ (-t) := by unfold minusSaddleSpectrum rw [map_mul, saddleEnvelope_conj, minusPolynomial_conj] congr 1 simp only [map_div₀, Complex.conj_ofReal] have hneg : ((-t : ℝ) : ℂ) / (ℓ : ℂ) = -((t : ℂ) / (ℓ : ℂ)) := by push_cast ring rw [hneg] exact (minusPolynomial_neg ε ((t : ℂ) / (ℓ : ℂ))).symm theorem mellinInversePower_conj {r : ℝ} (hr : 0 < r) (σ t : ℝ) : starRingEnd ℂ ((r : ℂ) ^ (-((σ : ℂ) + (t : ℂ) * Complex.I))) = (r : ℂ) ^ (-((σ : ℂ) + ((-t : ℝ) : ℂ) * Complex.I)) := by have harg : (r : ℂ).arg ≠ Real.pi := by rw [Complex.arg_ofReal_of_nonneg hr.le] exact Real.pi_ne_zero.symm have hpower := (Complex.cpow_conj (r : ℂ) (-((σ : ℂ) + (t : ℂ) * Complex.I)) harg).symm simpa [map_neg, map_add, map_mul, Complex.conj_ofReal, Complex.conj_I] using! hpower theorem mellinInv_real_of_hermitian (σ : ℝ) (F : ℂ → ℂ) (hF : ∀ t : ℝ, starRingEnd ℂ (F ((σ : ℂ) + (t : ℂ) * Complex.I)) = F ((σ : ℂ) + ((-t : ℝ) : ℂ) * Complex.I)) {r : ℝ} (hr : 0 < r) : (mellinInv σ F r).im = 0 := by let g : ℝ → ℂ := fun t => (r : ℂ) ^ (-((σ : ℂ) + (t : ℂ) * Complex.I)) * F ((σ : ℂ) + (t : ℂ) * Complex.I) have hsym (t : ℝ) : starRingEnd ℂ (g t) = g (-t) := by try dsimp [g] rw [map_mul, mellinInversePower_conj hr σ t, hF t] have hintegral : starRingEnd ℂ (∫ t : ℝ, g t) = ∫ t : ℝ, g t := by calc starRingEnd ℂ (∫ t : ℝ, g t) = ∫ t : ℝ, starRingEnd ℂ (g t) := (integral_conj (f := g)).symm _ = ∫ t : ℝ, g (-t) := by apply MeasureTheory.integral_congr_ae filter_upwards [] with t exact hsym t _ = ∫ t : ℝ, g t := by rw [integral_neg_eq_self] have hrewrite : mellinInv σ F r = (1 / (2 * Real.pi) : ℝ) • ∫ t : ℝ, g t := by unfold mellinInv simp only [g, smul_eq_mul] apply Complex.conj_eq_iff_im.mp rw [hrewrite] simp only [Complex.real_smul, map_mul, Complex.conj_ofReal, hintegral] theorem plusSaddleMellinData_conj_vertical (ε ℓ t : ℝ) : starRingEnd ℂ (plusSaddleMellinData ε ℓ ((ℓ : ℂ) + (t : ℂ) * Complex.I)) = plusSaddleMellinData ε ℓ ((ℓ : ℂ) + ((-t : ℝ) : ℂ) * Complex.I) := by have hleft : ((ℓ : ℂ) + (t : ℂ) * Complex.I) = ((ℓ : ℂ) - Complex.I * ((-t : ℝ) : ℂ)) := by push_cast ring have hright : ((ℓ : ℂ) + ((-t : ℝ) : ℂ) * Complex.I) = ((ℓ : ℂ) - Complex.I * (t : ℂ)) := by push_cast ring rw [hleft, plusSaddleMellinData_vertical, hright, plusSaddleMellinData_vertical] simpa using! plusSaddleSpectrum_conj ε ℓ (-t) theorem minusSaddleMellinData_conj_vertical (ε ℓ t : ℝ) : starRingEnd ℂ (minusSaddleMellinData ε ℓ ((ℓ : ℂ) + (t : ℂ) * Complex.I)) = minusSaddleMellinData ε ℓ ((ℓ : ℂ) + ((-t : ℝ) : ℂ) * Complex.I) := by have hleft : ((ℓ : ℂ) + (t : ℂ) * Complex.I) = ((ℓ : ℂ) - Complex.I * ((-t : ℝ) : ℂ)) := by push_cast ring have hright : ((ℓ : ℂ) + ((-t : ℝ) : ℂ) * Complex.I) = ((ℓ : ℂ) - Complex.I * (t : ℂ)) := by push_cast ring rw [hleft, minusSaddleMellinData_vertical, hright, minusSaddleMellinData_vertical] simpa using! minusSaddleSpectrum_conj ε ℓ (-t) theorem plusSaddleProfile_real (ε ℓ : ℝ) {r : ℝ} (hr : 0 ≤ r) : (plusSaddleProfile ε ℓ r).im = 0 := by by_cases hzero : r = 0 · simp [plusSaddleProfile, hzero] · have hpos : 0 < r := lt_of_le_of_ne hr (Ne.symm hzero) simp only [plusSaddleProfile, if_neg hzero] exact mellinInv_real_of_hermitian ℓ (plusSaddleMellinData ε ℓ) (plusSaddleMellinData_conj_vertical ε ℓ) hpos theorem minusSaddleProfile_real (ε ℓ : ℝ) {r : ℝ} (hr : 0 ≤ r) : (minusSaddleProfile ε ℓ r).im = 0 := by by_cases hzero : r = 0 · simp [minusSaddleProfile, hzero] · have hpos : 0 < r := lt_of_le_of_ne hr (Ne.symm hzero) simp only [minusSaddleProfile, if_neg hzero] exact mellinInv_real_of_hermitian ℓ (minusSaddleMellinData ε ℓ) (minusSaddleMellinData_conj_vertical ε ℓ) hpos theorem plusSaddleFunction_real (ε : ℝ) (d : ℕ) (x : Euclidean d) : (plusSaddleFunction ε d x).im = 0 := by exact plusSaddleProfile_real ε ((d : ℝ) / 2) (norm_nonneg x) theorem minusSaddleFunction_real (ε : ℝ) (d : ℕ) (x : Euclidean d) : (minusSaddleFunction ε d x).im = 0 := by exact minusSaddleProfile_real ε ((d : ℝ) / 2) (norm_nonneg x) theorem mellinMultiplier_mul_saddleEnvelope_neg {ε ℓ : ℝ} (hℓ : 0 < ℓ) (t : ℝ) : mellinMultiplier ℓ t * saddleEnvelope ε ℓ (-t) = saddleEnvelope ε ℓ t := by have hgamma := mellinMultiplier_denominator_ne_zero hℓ t have harg : ((-t : ℝ) : ℂ) / (ℓ : ℂ) = -((t : ℂ) / (ℓ : ℂ)) := by push_cast ring have hgammaarg : (((ℓ : ℂ) - Complex.I * ((-t : ℝ) : ℂ)) / 2) = (((ℓ : ℂ) + Complex.I * (t : ℂ)) / 2) := by push_cast ring have hphase : Complex.exp (Complex.I * (t : ℂ) * (Real.log Real.pi : ℂ)) * Complex.exp (Complex.I * ((-t : ℝ) : ℂ) * (Real.log Real.pi : ℂ) / 2) = Complex.exp (Complex.I * (t : ℂ) * (Real.log Real.pi : ℂ) / 2) := by rw [← Complex.exp_add] congr 1 push_cast ring unfold mellinMultiplier saddleEnvelope rw [harg, mellinShellPhase_neg, hgammaarg] calc _ = (Complex.exp (Complex.I * (t : ℂ) * (Real.log Real.pi : ℂ)) * Complex.exp (Complex.I * ((-t : ℝ) : ℂ) * (Real.log Real.pi : ℂ) / 2)) * Complex.Gamma (((ℓ : ℂ) - Complex.I * (t : ℂ)) / 2) * Complex.exp ((ℓ : ℂ) * mellinShellPhase ε ((t : ℂ) / (ℓ : ℂ))) := by field_simp [hgamma] _ = _ := by rw [hphase] theorem mellinMultiplier_mul_minusSaddleSpectrum_neg {ε ℓ : ℝ} (hℓ : 0 < ℓ) (t : ℝ) : mellinMultiplier ℓ t * minusSaddleSpectrum ε ℓ (-t) = plusSaddleSpectrum ε ℓ t := by have harg : ((-t : ℝ) : ℂ) / (ℓ : ℂ) = -((t : ℂ) / (ℓ : ℂ)) := by push_cast ring unfold minusSaddleSpectrum plusSaddleSpectrum rw [harg, minusPolynomial_neg] rw [← mul_assoc, mellinMultiplier_mul_saddleEnvelope_neg hℓ t] end noncomputable section open Filter Set MeasureTheory intervalIntegral open scoped Interval Topology theorem saddleCauchyPole_symmetric_intervalIntegral_tendsto_pos {a : ℝ} (ha : 0 < a) : Tendsto (fun T : ℝ => ∫ t in -T..T, ((a : ℂ) + (t : ℂ) * Complex.I)⁻¹) Filter.atTop (𝓝 (Real.pi : ℂ)) := by have hdiv : Tendsto (fun T : ℝ => T / a) Filter.atTop Filter.atTop := (tendsto_div_const_atTop_of_pos ha).2 tendsto_id have hatan : Tendsto (fun T : ℝ => Real.arctan (T / a)) Filter.atTop (𝓝 (Real.pi / 2)) := (tendsto_nhds_of_tendsto_nhdsWithin Real.tendsto_arctan_atTop).comp hdiv have hreal : Tendsto (fun T : ℝ => 2 * Real.arctan (T / a)) Filter.atTop (𝓝 Real.pi) := by convert! (tendsto_const_nhds.mul hatan) using 1 all_goals ring_nf have hcomplex : Tendsto (fun T : ℝ => ((2 * Real.arctan (T / a) : ℝ) : ℂ)) Filter.atTop (𝓝 (Real.pi : ℂ)) := Complex.continuous_ofReal.continuousAt.tendsto.comp hreal exact hcomplex.congr' (Filter.Eventually.of_forall (fun T : ℝ => (saddleCauchyPole_symmetric_intervalIntegral ha.ne' T).symm)) theorem saddleCauchyPole_symmetric_intervalIntegral_tendsto_neg {a : ℝ} (ha : a < 0) : Tendsto (fun T : ℝ => ∫ t in -T..T, ((a : ℂ) + (t : ℂ) * Complex.I)⁻¹) Filter.atTop (𝓝 (-(Real.pi : ℂ))) := by have hdiv : Tendsto (fun T : ℝ => T / a) Filter.atTop Filter.atBot := (tendsto_div_const_atBot_of_neg ha).2 tendsto_id have hatan : Tendsto (fun T : ℝ => Real.arctan (T / a)) Filter.atTop (𝓝 (-(Real.pi / 2))) := (tendsto_nhds_of_tendsto_nhdsWithin Real.tendsto_arctan_atBot).comp hdiv have hreal : Tendsto (fun T : ℝ => 2 * Real.arctan (T / a)) Filter.atTop (𝓝 (-Real.pi)) := by convert! (tendsto_const_nhds.mul hatan) using 1 all_goals ring_nf have hcomplex : Tendsto (fun T : ℝ => ((2 * Real.arctan (T / a) : ℝ) : ℂ)) Filter.atTop (𝓝 (-(Real.pi : ℂ))) := by simpa only [Function.comp_apply, Complex.ofReal_neg] using! (Complex.continuous_ofReal.continuousAt.tendsto.comp hreal) exact hcomplex.congr' (Filter.Eventually.of_forall (fun T : ℝ => (saddleCauchyPole_symmetric_intervalIntegral ha.ne T).symm)) theorem saddleShiftedCauchyPole_symmetric_intervalIntegral_tendsto_pos (n : ℕ) {a : ℝ} (ha : -((2 * n : ℕ) : ℝ) < a) : Tendsto (fun T : ℝ => ∫ t in -T..T, (((a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ))⁻¹)) Filter.atTop (𝓝 (Real.pi : ℂ)) := by have hshift : 0 < a + ((2 * n : ℕ) : ℝ) := by linarith have hlimit := saddleCauchyPole_symmetric_intervalIntegral_tendsto_pos hshift apply hlimit.congr' filter_upwards [] with T apply intervalIntegral.integral_congr intro t _ push_cast ring theorem saddleShiftedCauchyPole_symmetric_intervalIntegral_tendsto_neg (n : ℕ) {a : ℝ} (ha : a < -((2 * n : ℕ) : ℝ)) : Tendsto (fun T : ℝ => ∫ t in -T..T, (((a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ))⁻¹)) Filter.atTop (𝓝 (-(Real.pi : ℂ))) := by have hshift : a + ((2 * n : ℕ) : ℝ) < 0 := by linarith have hlimit := saddleCauchyPole_symmetric_intervalIntegral_tendsto_neg hshift apply hlimit.congr' filter_upwards [] with T apply intervalIntegral.integral_congr intro t _ push_cast ring theorem saddleGaussianPoleRepresentative_eq_inv_add_slope (n : ℕ) {z : ℂ} (hz : z + ((2 * n : ℕ) : ℂ) ≠ 0) : saddleGaussianPoleRepresentative n z = (z + ((2 * n : ℕ) : ℂ))⁻¹ + saddleGaussianPoleSlope (z + ((2 * n : ℕ) : ℂ)) := by rw [saddleGaussianPoleSlope_eq_of_ne hz] unfold saddleGaussianPoleRepresentative field_simp [hz] all_goals ring theorem saddleGaussianPoleShiftedSlope_differentiable (n : ℕ) : Differentiable ℂ (fun z : ℂ => saddleGaussianPoleSlope (z + ((2 * n : ℕ) : ℂ))) := saddleGaussianPoleSlope_differentiable.comp (by fun_prop) theorem saddleGaussianPoleShiftedSlope_boundary_rectangle (n : ℕ) (A B T : ℝ) : (∫ a in A..B, saddleGaussianPoleSlope ((a : ℂ) + ((-T : ℝ) : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ))) - (∫ a in A..B, saddleGaussianPoleSlope ((a : ℂ) + (T : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ))) + Complex.I * (∫ t in -T..T, saddleGaussianPoleSlope ((B : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ))) - Complex.I * (∫ t in -T..T, saddleGaussianPoleSlope ((A : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ))) = 0 := by have hrectangle := Complex.integral_boundary_rect_eq_zero_of_differentiableOn (fun z : ℂ => saddleGaussianPoleSlope (z + ((2 * n : ℕ) : ℂ))) ((A : ℂ) + ((-T : ℝ) : ℂ) * Complex.I) ((B : ℂ) + (T : ℂ) * Complex.I) (saddleGaussianPoleShiftedSlope_differentiable n).differentiableOn simpa [Complex.mul_re, Complex.mul_im, smul_eq_mul] using! hrectangle theorem saddleGaussianPoleShiftedSlope_horizontalIntegral_tendsto_zero {A B : ℝ} (hAB : A ≤ B) (n : ℕ) (s : ℝ) (hs : |s| = 1) : Tendsto (fun T : ℝ => ∫ a in A..B, saddleGaussianPoleSlope ((a : ℂ) + ((s * T : ℝ) : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ))) Filter.atTop (𝓝 0) := by obtain ⟨C, hC, hgaussian⟩ := saddleGaussianPoleRepresentative_weighted_horizontalStrip_bound (r := 1) (by norm_num : (0 : ℝ) < 1) hAB n apply saddleHorizontalIntegral_tendsto_zero (F := fun z : ℂ => saddleGaussianPoleSlope (z + ((2 * n : ℕ) : ℂ))) hAB (C := C + 1) ?_ s hs intro a ha t ht let z : ℂ := (a : ℂ) + (t : ℂ) * Complex.I let q : ℂ := z + ((2 * n : ℕ) : ℂ) have hden : |t| ≤ ‖q‖ := by try dsimp [q, z] simpa [Complex.mul_im] using! (Complex.abs_im_le_norm ((a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ))) have hqpos : 0 < ‖q‖ := (lt_of_lt_of_le zero_lt_one ht).trans_le hden have hq : q ≠ 0 := norm_pos_iff.mp hqpos have hpole : |t| * ‖q⁻¹‖ ≤ 1 := by rw [norm_inv, ← div_eq_mul_inv] exact (div_le_one hqpos).2 hden have hgaussian' : |t| * ‖saddleGaussianPoleRepresentative n z‖ ≤ C := by simpa [saddleMellinInversePower, z] using! hgaussian a ha t ht have hslope : saddleGaussianPoleSlope q = saddleGaussianPoleRepresentative n z - q⁻¹ := by have hsplit := saddleGaussianPoleRepresentative_eq_inv_add_slope n (z := z) (show z + ((2 * n : ℕ) : ℂ) ≠ 0 from hq) change saddleGaussianPoleRepresentative n z = q⁻¹ + saddleGaussianPoleSlope q at hsplit apply (eq_sub_iff_add_eq).2 simpa [add_comm, q, z] using! hsplit.symm change |t| * ‖saddleGaussianPoleSlope q‖ ≤ C + 1 rw [hslope] calc |t| * ‖saddleGaussianPoleRepresentative n z - q⁻¹‖ ≤ |t| * (‖saddleGaussianPoleRepresentative n z‖ + ‖q⁻¹‖) := by gcongr exact norm_sub_le _ _ _ = |t| * ‖saddleGaussianPoleRepresentative n z‖ + |t| * ‖q⁻¹‖ := by ring _ ≤ C + 1 := add_le_add hgaussian' hpole theorem saddleInfiniteRectangle_vertical_limit_eq {F : ℂ → ℂ} {A B : ℝ} {u v : ℂ} (hleft : Tendsto (fun T : ℝ => ∫ t in -T..T, F ((A : ℂ) + (t : ℂ) * Complex.I)) Filter.atTop (𝓝 u)) (hright : Tendsto (fun T : ℝ => ∫ t in -T..T, F ((B : ℂ) + (t : ℂ) * Complex.I)) Filter.atTop (𝓝 v)) (hlower : Tendsto (fun T : ℝ => ∫ a in A..B, F ((a : ℂ) + ((-T : ℝ) : ℂ) * Complex.I)) Filter.atTop (𝓝 0)) (hupper : Tendsto (fun T : ℝ => ∫ a in A..B, F ((a : ℂ) + (T : ℂ) * Complex.I)) Filter.atTop (𝓝 0)) (hrectangle : ∀ T : ℝ, (∫ a in A..B, F ((a : ℂ) + ((-T : ℝ) : ℂ) * Complex.I)) - (∫ a in A..B, F ((a : ℂ) + (T : ℂ) * Complex.I)) + Complex.I * (∫ t in -T..T, F ((B : ℂ) + (t : ℂ) * Complex.I)) - Complex.I * (∫ t in -T..T, F ((A : ℂ) + (t : ℂ) * Complex.I)) = 0) : v = u := by have hlimit : Tendsto (fun T : ℝ => (∫ a in A..B, F ((a : ℂ) + ((-T : ℝ) : ℂ) * Complex.I)) - (∫ a in A..B, F ((a : ℂ) + (T : ℂ) * Complex.I)) + Complex.I * (∫ t in -T..T, F ((B : ℂ) + (t : ℂ) * Complex.I)) - Complex.I * (∫ t in -T..T, F ((A : ℂ) + (t : ℂ) * Complex.I))) Filter.atTop (𝓝 (Complex.I * v - Complex.I * u)) := by simpa using! (((hlower.sub hupper).add (tendsto_const_nhds.mul hright)).sub (tendsto_const_nhds.mul hleft)) have hzero : Tendsto (fun T : ℝ => (∫ a in A..B, F ((a : ℂ) + ((-T : ℝ) : ℂ) * Complex.I)) - (∫ a in A..B, F ((a : ℂ) + (T : ℂ) * Complex.I)) + Complex.I * (∫ t in -T..T, F ((B : ℂ) + (t : ℂ) * Complex.I)) - Complex.I * (∫ t in -T..T, F ((A : ℂ) + (t : ℂ) * Complex.I))) Filter.atTop (𝓝 0) := (tendsto_const_nhds : Tendsto (fun _ : ℝ => (0 : ℂ)) Filter.atTop (𝓝 0)).congr' (Filter.Eventually.of_forall (fun T : ℝ => (hrectangle T).symm)) have hidentity : Complex.I * (v - u) = 0 := by simpa [mul_sub] using! (tendsto_nhds_unique hlimit hzero) exact sub_eq_zero.mp ((mul_eq_zero.mp hidentity).resolve_left Complex.I_ne_zero) theorem saddleGaussianPoleShiftedSlope_symmetric_intervalIntegral (n : ℕ) {a : ℝ} (ha : a ≠ -((2 * n : ℕ) : ℝ)) (T : ℝ) : (∫ t in -T..T, saddleGaussianPoleSlope ((a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ))) = (∫ t in -T..T, saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) - (∫ t in -T..T, (((a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ))⁻¹)) := by have hline : Continuous (fun t : ℝ => (a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ)) := by fun_prop have hnonzero : ∀ t : ℝ, (a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ) ≠ 0 := by intro t hzero apply ha have hre := congrArg Complex.re hzero norm_num [Complex.mul_re] at hre push_cast linarith have hgaussian : IntervalIntegrable (fun t : ℝ => saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) volume (-T) T := (saddleGaussianPoleRepresentative_shiftedLine_continuous n ha).intervalIntegrable _ _ have hpole : IntervalIntegrable (fun t : ℝ => (((a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ))⁻¹)) volume (-T) T := (hline.inv₀ hnonzero).intervalIntegrable _ _ rw [← intervalIntegral.integral_sub hgaussian hpole] apply intervalIntegral.integral_congr intro t _ have hsplit := saddleGaussianPoleRepresentative_eq_inv_add_slope n (hnonzero t) apply (eq_sub_iff_add_eq).2 simpa [add_comm] using! hsplit.symm theorem saddleGaussianPoleShiftedSlope_symmetric_intervalIntegral_tendsto_pos (n : ℕ) {a : ℝ} (ha : -((2 * n : ℕ) : ℝ) < a) : Tendsto (fun T : ℝ => ∫ t in -T..T, saddleGaussianPoleSlope ((a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ))) Filter.atTop (𝓝 ((∫ t : ℝ, saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) - (Real.pi : ℂ))) := by have hane : a ≠ -((2 * n : ℕ) : ℝ) := ne_of_gt ha have hgaussian : Tendsto (fun T : ℝ => ∫ t in -T..T, saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) Filter.atTop (𝓝 (∫ t : ℝ, saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I))) := intervalIntegral_tendsto_integral (saddleGaussianPoleRepresentative_shiftedLine_integrable n hane) tendsto_neg_atTop_atBot tendsto_id have hpole := saddleShiftedCauchyPole_symmetric_intervalIntegral_tendsto_pos n ha exact (hgaussian.sub hpole).congr' (Filter.Eventually.of_forall (fun T : ℝ => (saddleGaussianPoleShiftedSlope_symmetric_intervalIntegral n hane T).symm)) theorem saddleGaussianPoleShiftedSlope_symmetric_intervalIntegral_tendsto_neg (n : ℕ) {a : ℝ} (ha : a < -((2 * n : ℕ) : ℝ)) : Tendsto (fun T : ℝ => ∫ t in -T..T, saddleGaussianPoleSlope ((a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ))) Filter.atTop (𝓝 ((∫ t : ℝ, saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) - (-(Real.pi : ℂ)))) := by have hane : a ≠ -((2 * n : ℕ) : ℝ) := ne_of_lt ha have hgaussian : Tendsto (fun T : ℝ => ∫ t in -T..T, saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) Filter.atTop (𝓝 (∫ t : ℝ, saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I))) := intervalIntegral_tendsto_integral (saddleGaussianPoleRepresentative_shiftedLine_integrable n hane) tendsto_neg_atTop_atBot tendsto_id have hpole := saddleShiftedCauchyPole_symmetric_intervalIntegral_tendsto_neg n ha exact (hgaussian.sub hpole).congr' (Filter.Eventually.of_forall (fun T : ℝ => (saddleGaussianPoleShiftedSlope_symmetric_intervalIntegral n hane T).symm)) theorem saddleGaussianPoleRepresentative_vertical_integral_jump (n : ℕ) {A B : ℝ} (hA : A < -((2 * n : ℕ) : ℝ)) (hB : -((2 * n : ℕ) : ℝ) < B) : (∫ t : ℝ, saddleGaussianPoleRepresentative n ((B : ℂ) + (t : ℂ) * Complex.I)) - (∫ t : ℝ, saddleGaussianPoleRepresentative n ((A : ℂ) + (t : ℂ) * Complex.I)) = ((2 * Real.pi : ℝ) : ℂ) := by have hAB : A ≤ B := (hA.trans hB).le have hleft := saddleGaussianPoleShiftedSlope_symmetric_intervalIntegral_tendsto_neg n hA have hright := saddleGaussianPoleShiftedSlope_symmetric_intervalIntegral_tendsto_pos n hB have hlower : Tendsto (fun T : ℝ => ∫ a in A..B, saddleGaussianPoleSlope ((a : ℂ) + ((-T : ℝ) : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ))) Filter.atTop (𝓝 0) := by simpa using! saddleGaussianPoleShiftedSlope_horizontalIntegral_tendsto_zero hAB n (-1) (by norm_num) have hupper : Tendsto (fun T : ℝ => ∫ a in A..B, saddleGaussianPoleSlope ((a : ℂ) + (T : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ))) Filter.atTop (𝓝 0) := by simpa using! saddleGaussianPoleShiftedSlope_horizontalIntegral_tendsto_zero hAB n 1 (by norm_num) have hidentity := saddleInfiniteRectangle_vertical_limit_eq (F := fun z : ℂ => saddleGaussianPoleSlope (z + ((2 * n : ℕ) : ℂ))) hleft hright hlower hupper (fun T : ℝ => saddleGaussianPoleShiftedSlope_boundary_rectangle n A B T) push_cast linear_combination hidentity theorem saddleMellinInversePower_negativeEvenPole (r : ℝ) (n : ℕ) : saddleMellinInversePower r (-((2 * n : ℕ) : ℂ)) = ((r ^ (2 * n) : ℝ) : ℂ) := by unfold saddleMellinInversePower rw [neg_neg, Complex.cpow_natCast] exact (Complex.ofReal_pow r (2 * n)).symm def saddleMellinInversePowerPoleSlope (r : ℝ) (n : ℕ) (z : ℂ) : ℂ := dslope (saddleMellinInversePower r) (-((2 * n : ℕ) : ℂ)) z theorem saddleMellinInversePowerPoleSlope_differentiable {r : ℝ} (hr : 0 < r) (n : ℕ) : Differentiable ℂ (saddleMellinInversePowerPoleSlope r n) := by unfold saddleMellinInversePowerPoleSlope exact differentiableOn_univ.mp ((Complex.differentiableOn_dslope (s := Set.univ) (c := -((2 * n : ℕ) : ℂ)) (show Set.univ ∈ 𝓝 (-((2 * n : ℕ) : ℂ)) from univ_mem)).mpr (saddleMellinInversePower_differentiable hr).differentiableOn) def saddleGaussianPoleWeightedCorrection (r : ℝ) (n : ℕ) (z : ℂ) : ℂ := Complex.exp ((z + ((2 * n : ℕ) : ℂ)) ^ 2) * saddleMellinInversePowerPoleSlope r n z theorem saddleGaussianPoleWeightedCorrection_differentiable {r : ℝ} (hr : 0 < r) (n : ℕ) : Differentiable ℂ (saddleGaussianPoleWeightedCorrection r n) := by unfold saddleGaussianPoleWeightedCorrection have hgaussian : Differentiable ℂ (fun z : ℂ => Complex.exp ((z + ((2 * n : ℕ) : ℂ)) ^ 2)) := by fun_prop exact hgaussian.mul (saddleMellinInversePowerPoleSlope_differentiable hr n) theorem saddleGaussianPoleWeightedRepresentative_eq_pole_add_correction {r : ℝ} (n : ℕ) {z : ℂ} (hz : z + ((2 * n : ℕ) : ℂ) ≠ 0) : saddleMellinInversePower r z * saddleGaussianPoleRepresentative n z = saddleMellinInversePower r (-((2 * n : ℕ) : ℂ)) * saddleGaussianPoleRepresentative n z + saddleGaussianPoleWeightedCorrection r n z := by let p : ℂ := -((2 * n : ℕ) : ℂ) let q : ℂ := z + ((2 * n : ℕ) : ℂ) have hslope := sub_smul_dslope (saddleMellinInversePower r) p z have hcoordinate : z - p = q := by try dsimp [p, q] ring rw [hcoordinate, smul_eq_mul] at hslope have hdiv : saddleMellinInversePowerPoleSlope r n z = (saddleMellinInversePower r z - saddleMellinInversePower r p) / q := by apply (eq_div_iff (show q ≠ 0 from hz)).2 unfold saddleMellinInversePowerPoleSlope change dslope (saddleMellinInversePower r) p z * q = saddleMellinInversePower r z - saddleMellinInversePower r p simpa [mul_comm] using! hslope unfold saddleGaussianPoleRepresentative saddleGaussianPoleWeightedCorrection change saddleMellinInversePower r z * (Complex.exp (q ^ 2) / q) = saddleMellinInversePower r p * (Complex.exp (q ^ 2) / q) + Complex.exp (q ^ 2) * saddleMellinInversePowerPoleSlope r n z rw [hdiv] field_simp [hz] all_goals ring theorem saddleGaussianPole_shiftedLine_ne_zero (n : ℕ) {a : ℝ} (ha : a ≠ -((2 * n : ℕ) : ℝ)) (t : ℝ) : (a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ) ≠ 0 := by intro hzero apply ha have hre := congrArg Complex.re hzero norm_num [Complex.mul_re] at hre push_cast linarith theorem saddleGaussianPoleWeightedCorrection_eq_sub {r : ℝ} (n : ℕ) {z : ℂ} (hz : z + ((2 * n : ℕ) : ℂ) ≠ 0) : saddleGaussianPoleWeightedCorrection r n z = saddleMellinInversePower r z * saddleGaussianPoleRepresentative n z - saddleMellinInversePower r (-((2 * n : ℕ) : ℂ)) * saddleGaussianPoleRepresentative n z := by have hsplit := saddleGaussianPoleWeightedRepresentative_eq_pole_add_correction (r := r) n hz apply (eq_sub_iff_add_eq).2 simpa [add_comm] using! hsplit.symm theorem saddleGaussianPoleWeightedCorrection_shiftedLine_integrable {r a : ℝ} (hr : 0 < r) (n : ℕ) (ha : a ≠ -((2 * n : ℕ) : ℝ)) : Integrable (fun t : ℝ => saddleGaussianPoleWeightedCorrection r n ((a : ℂ) + (t : ℂ) * Complex.I)) := by have hweighted := saddleGaussianPoleRepresentative_shiftedLine_weighted_integrable n ha hr have hunweighted := saddleGaussianPoleRepresentative_shiftedLine_integrable n ha have hconstant := hunweighted.const_mul (saddleMellinInversePower r (-((2 * n : ℕ) : ℂ))) apply (hweighted.sub hconstant).congr filter_upwards [] with t exact (saddleGaussianPoleWeightedCorrection_eq_sub n (saddleGaussianPole_shiftedLine_ne_zero n ha t)).symm theorem saddleGaussianPoleWeightedCorrection_horizontalStrip_bound {r A B : ℝ} (hr : 0 < r) (hAB : A ≤ B) (n : ℕ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ a ∈ Set.Icc A B, ∀ t : ℝ, 1 ≤ |t| → |t| * ‖saddleGaussianPoleWeightedCorrection r n ((a : ℂ) + (t : ℂ) * Complex.I)‖ ≤ C := by obtain ⟨Cw, hCw, hweighted⟩ := saddleGaussianPoleRepresentative_weighted_horizontalStrip_bound hr hAB n obtain ⟨Cu, hCu, hunweighted⟩ := saddleGaussianPoleRepresentative_weighted_horizontalStrip_bound (r := 1) (by norm_num : (0 : ℝ) < 1) hAB n let p : ℂ := -((2 * n : ℕ) : ℂ) refine ⟨Cw + ‖saddleMellinInversePower r p‖ * Cu, by positivity, ?_⟩ intro a ha t ht let z : ℂ := (a : ℂ) + (t : ℂ) * Complex.I let q : ℂ := z + ((2 * n : ℕ) : ℂ) have hden : |t| ≤ ‖q‖ := by try dsimp [q, z] simpa [Complex.mul_im] using! (Complex.abs_im_le_norm ((a : ℂ) + (t : ℂ) * Complex.I + ((2 * n : ℕ) : ℂ))) have hqpos : 0 < ‖q‖ := (lt_of_lt_of_le zero_lt_one ht).trans_le hden have hq : q ≠ 0 := norm_pos_iff.mp hqpos have hweighted' : |t| * ‖saddleMellinInversePower r z * saddleGaussianPoleRepresentative n z‖ ≤ Cw := by simpa [z] using! hweighted a ha t ht have hunweighted' : |t| * ‖saddleGaussianPoleRepresentative n z‖ ≤ Cu := by simpa [saddleMellinInversePower, z] using! hunweighted a ha t ht have hscaled : |t| * ‖saddleMellinInversePower r p * saddleGaussianPoleRepresentative n z‖ ≤ ‖saddleMellinInversePower r p‖ * Cu := by rw [norm_mul] calc |t| * (‖saddleMellinInversePower r p‖ * ‖saddleGaussianPoleRepresentative n z‖) = ‖saddleMellinInversePower r p‖ * (|t| * ‖saddleGaussianPoleRepresentative n z‖) := by ring _ ≤ ‖saddleMellinInversePower r p‖ * Cu := mul_le_mul_of_nonneg_left hunweighted' (norm_nonneg _) have hcorrection := saddleGaussianPoleWeightedCorrection_eq_sub (r := r) n (z := z) (show z + ((2 * n : ℕ) : ℂ) ≠ 0 from hq) change |t| * ‖saddleGaussianPoleWeightedCorrection r n z‖ ≤ Cw + ‖saddleMellinInversePower r p‖ * Cu rw [hcorrection] change |t| * ‖saddleMellinInversePower r z * saddleGaussianPoleRepresentative n z - saddleMellinInversePower r p * saddleGaussianPoleRepresentative n z‖ ≤ Cw + ‖saddleMellinInversePower r p‖ * Cu calc |t| * ‖saddleMellinInversePower r z * saddleGaussianPoleRepresentative n z - saddleMellinInversePower r p * saddleGaussianPoleRepresentative n z‖ ≤ |t| * (‖saddleMellinInversePower r z * saddleGaussianPoleRepresentative n z‖ + ‖saddleMellinInversePower r p * saddleGaussianPoleRepresentative n z‖) := by gcongr exact norm_sub_le _ _ _ = |t| * ‖saddleMellinInversePower r z * saddleGaussianPoleRepresentative n z‖ + |t| * ‖saddleMellinInversePower r p * saddleGaussianPoleRepresentative n z‖ := by ring _ ≤ Cw + ‖saddleMellinInversePower r p‖ * Cu := add_le_add hweighted' hscaled theorem saddleGaussianPoleWeightedCorrection_horizontalIntegral_tendsto_zero {r A B : ℝ} (hr : 0 < r) (hAB : A ≤ B) (n : ℕ) (s : ℝ) (hs : |s| = 1) : Tendsto (fun T : ℝ => ∫ a in A..B, saddleGaussianPoleWeightedCorrection r n ((a : ℂ) + ((s * T : ℝ) : ℂ) * Complex.I)) Filter.atTop (𝓝 0) := by obtain ⟨C, hC, hbound⟩ := saddleGaussianPoleWeightedCorrection_horizontalStrip_bound hr hAB n exact saddleHorizontalIntegral_tendsto_zero (F := saddleGaussianPoleWeightedCorrection r n) hAB hbound s hs theorem saddleGaussianPoleWeightedCorrection_boundary_rectangle {r : ℝ} (hr : 0 < r) (n : ℕ) (A B T : ℝ) : (∫ a in A..B, saddleGaussianPoleWeightedCorrection r n ((a : ℂ) + ((-T : ℝ) : ℂ) * Complex.I)) - (∫ a in A..B, saddleGaussianPoleWeightedCorrection r n ((a : ℂ) + (T : ℂ) * Complex.I)) + Complex.I * (∫ t in -T..T, saddleGaussianPoleWeightedCorrection r n ((B : ℂ) + (t : ℂ) * Complex.I)) - Complex.I * (∫ t in -T..T, saddleGaussianPoleWeightedCorrection r n ((A : ℂ) + (t : ℂ) * Complex.I)) = 0 := by have hrectangle := Complex.integral_boundary_rect_eq_zero_of_differentiableOn (saddleGaussianPoleWeightedCorrection r n) ((A : ℂ) + ((-T : ℝ) : ℂ) * Complex.I) ((B : ℂ) + (T : ℂ) * Complex.I) (saddleGaussianPoleWeightedCorrection_differentiable hr n).differentiableOn simpa [Complex.mul_re, Complex.mul_im, smul_eq_mul] using! hrectangle theorem saddleGaussianPoleWeightedCorrection_vertical_integral_eq {r A B : ℝ} (hr : 0 < r) (n : ℕ) (hAB : A ≤ B) (hA : A ≠ -((2 * n : ℕ) : ℝ)) (hB : B ≠ -((2 * n : ℕ) : ℝ)) : (∫ t : ℝ, saddleGaussianPoleWeightedCorrection r n ((B : ℂ) + (t : ℂ) * Complex.I)) = (∫ t : ℝ, saddleGaussianPoleWeightedCorrection r n ((A : ℂ) + (t : ℂ) * Complex.I)) := by have hleft := saddleGaussianPoleWeightedCorrection_shiftedLine_integrable hr n hA have hright := saddleGaussianPoleWeightedCorrection_shiftedLine_integrable hr n hB have hlower : Tendsto (fun T : ℝ => ∫ a in A..B, saddleGaussianPoleWeightedCorrection r n ((a : ℂ) + ((-T : ℝ) : ℂ) * Complex.I)) Filter.atTop (𝓝 0) := by simpa using! saddleGaussianPoleWeightedCorrection_horizontalIntegral_tendsto_zero hr hAB n (-1) (by norm_num) have hupper : Tendsto (fun T : ℝ => ∫ a in A..B, saddleGaussianPoleWeightedCorrection r n ((a : ℂ) + (T : ℂ) * Complex.I)) Filter.atTop (𝓝 0) := by simpa using! saddleGaussianPoleWeightedCorrection_horizontalIntegral_tendsto_zero hr hAB n 1 (by norm_num) exact saddleInfiniteRectangle_vertical_integral_eq hleft hright hlower hupper (fun T : ℝ => saddleGaussianPoleWeightedCorrection_boundary_rectangle hr n A B T) theorem saddleGaussianPoleWeightedRepresentative_shiftedLine_integral_eq {r a : ℝ} (hr : 0 < r) (n : ℕ) (ha : a ≠ -((2 * n : ℕ) : ℝ)) : (∫ t : ℝ, saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) = saddleMellinInversePower r (-((2 * n : ℕ) : ℂ)) * (∫ t : ℝ, saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) + (∫ t : ℝ, saddleGaussianPoleWeightedCorrection r n ((a : ℂ) + (t : ℂ) * Complex.I)) := by have hrepresentative := saddleGaussianPoleRepresentative_shiftedLine_integrable n ha have hconstant := hrepresentative.const_mul (saddleMellinInversePower r (-((2 * n : ℕ) : ℂ))) have hcorrection := saddleGaussianPoleWeightedCorrection_shiftedLine_integrable hr n ha calc (∫ t : ℝ, saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) = ∫ t : ℝ, saddleMellinInversePower r (-((2 * n : ℕ) : ℂ)) * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I) + saddleGaussianPoleWeightedCorrection r n ((a : ℂ) + (t : ℂ) * Complex.I) := by apply MeasureTheory.integral_congr_ae filter_upwards [] with t exact saddleGaussianPoleWeightedRepresentative_eq_pole_add_correction (r := r) n (saddleGaussianPole_shiftedLine_ne_zero n ha t) _ = (∫ t : ℝ, saddleMellinInversePower r (-((2 * n : ℕ) : ℂ)) * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) + (∫ t : ℝ, saddleGaussianPoleWeightedCorrection r n ((a : ℂ) + (t : ℂ) * Complex.I)) := integral_add hconstant hcorrection _ = saddleMellinInversePower r (-((2 * n : ℕ) : ℂ)) * (∫ t : ℝ, saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) + (∫ t : ℝ, saddleGaussianPoleWeightedCorrection r n ((a : ℂ) + (t : ℂ) * Complex.I)) := by rw [integral_const_mul_of_integrable hrepresentative] theorem saddleGaussianPoleWeightedRepresentative_vertical_integral_jump {r A B : ℝ} (hr : 0 < r) (n : ℕ) (hA : A < -((2 * n : ℕ) : ℝ)) (hB : -((2 * n : ℕ) : ℝ) < B) : (∫ t : ℝ, saddleMellinInversePower r ((B : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((B : ℂ) + (t : ℂ) * Complex.I)) - (∫ t : ℝ, saddleMellinInversePower r ((A : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((A : ℂ) + (t : ℂ) * Complex.I)) = ((2 * Real.pi : ℝ) : ℂ) * ((r ^ (2 * n) : ℝ) : ℂ) := by have hAB : A ≤ B := (hA.trans hB).le have hAne : A ≠ -((2 * n : ℕ) : ℝ) := ne_of_lt hA have hBne : B ≠ -((2 * n : ℕ) : ℝ) := ne_of_gt hB rw [saddleGaussianPoleWeightedRepresentative_shiftedLine_integral_eq hr n hBne, saddleGaussianPoleWeightedRepresentative_shiftedLine_integral_eq hr n hAne] have hcorrection := saddleGaussianPoleWeightedCorrection_vertical_integral_eq hr n hAB hAne hBne have hgaussian := saddleGaussianPoleRepresentative_vertical_integral_jump n hA hB calc saddleMellinInversePower r (-((2 * n : ℕ) : ℂ)) * (∫ t : ℝ, saddleGaussianPoleRepresentative n ((B : ℂ) + (t : ℂ) * Complex.I)) + (∫ t : ℝ, saddleGaussianPoleWeightedCorrection r n ((B : ℂ) + (t : ℂ) * Complex.I)) - (saddleMellinInversePower r (-((2 * n : ℕ) : ℂ)) * (∫ t : ℝ, saddleGaussianPoleRepresentative n ((A : ℂ) + (t : ℂ) * Complex.I)) + (∫ t : ℝ, saddleGaussianPoleWeightedCorrection r n ((A : ℂ) + (t : ℂ) * Complex.I))) = saddleMellinInversePower r (-((2 * n : ℕ) : ℂ)) * ((∫ t : ℝ, saddleGaussianPoleRepresentative n ((B : ℂ) + (t : ℂ) * Complex.I)) - (∫ t : ℝ, saddleGaussianPoleRepresentative n ((A : ℂ) + (t : ℂ) * Complex.I))) := by rw [hcorrection] ring _ = saddleMellinInversePower r (-((2 * n : ℕ) : ℂ)) * ((2 * Real.pi : ℝ) : ℂ) := by rw [hgaussian] _ = ((2 * Real.pi : ℝ) : ℂ) * ((r ^ (2 * n) : ℝ) : ℂ) := by rw [saddleMellinInversePower_negativeEvenPole] ring theorem saddleFiniteGaussianPoleWeighted_shiftedLine_integrable {r a : ℝ} (hr : 0 < r) (c : ℕ → ℂ) (N : ℕ) (ha : ∀ n : ℕ, a ≠ -((2 * n : ℕ) : ℝ)) : Integrable (fun t : ℝ => ∑ n ∈ Finset.range (N + 1), saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * (c n * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I))) := by apply integrable_finsetSum intro n _ have hterm := (saddleGaussianPoleRepresentative_shiftedLine_weighted_integrable n (ha n) hr).const_mul (c n) exact hterm.congr (Filter.Eventually.of_forall (fun t : ℝ => by ring)) theorem saddleFiniteGaussianPoleWeighted_shiftedLine_integral {r a : ℝ} (hr : 0 < r) (c : ℕ → ℂ) (N : ℕ) (ha : ∀ n : ℕ, a ≠ -((2 * n : ℕ) : ℝ)) : (∫ t : ℝ, ∑ n ∈ Finset.range (N + 1), saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * (c n * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I))) = ∑ n ∈ Finset.range (N + 1), c n * (∫ t : ℝ, saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) := by have hterm (n : ℕ) : Integrable (fun t : ℝ => saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * (c n * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I))) := by have h := (saddleGaussianPoleRepresentative_shiftedLine_weighted_integrable n (ha n) hr).const_mul (c n) exact h.congr (Filter.Eventually.of_forall (fun t : ℝ => by ring)) rw [MeasureTheory.integral_finsetSum (Finset.range (N + 1)) (fun n _ => hterm n)] apply Finset.sum_congr rfl intro n _ have hweighted := saddleGaussianPoleRepresentative_shiftedLine_weighted_integrable n (ha n) hr calc (∫ t : ℝ, saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * (c n * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I))) = ∫ t : ℝ, c n * (saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) := by apply MeasureTheory.integral_congr_ae filter_upwards [] with t ring _ = c n * (∫ t : ℝ, saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) := integral_const_mul_of_integrable hweighted theorem plusSaddleFiniteRapidContourIntegrand_shiftedLine_integral_eq {ε ℓ a r : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (N : ℕ) (hhalf : -(2 * ((N : ℝ) + 1)) < a) (hpole : ∀ n : ℕ, a ≠ -((2 * n : ℕ) : ℝ)) : (∫ t : ℝ, plusSaddleFiniteRapidContourIntegrand ε ℓ N r ((a : ℂ) + (t : ℂ) * Complex.I)) = (∫ t : ℝ, saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)) - ∑ n ∈ Finset.range (N + 1), plusSaddlePoleResidue ε ℓ n * (∫ t : ℝ, saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) := by have hdata := plusSaddleMellinData_shiftedLine_weighted_integrable hε hℓ horder hpole hr have hsum := saddleFiniteGaussianPoleWeighted_shiftedLine_integrable hr (plusSaddlePoleResidue ε ℓ) N hpole calc (∫ t : ℝ, plusSaddleFiniteRapidContourIntegrand ε ℓ N r ((a : ℂ) + (t : ℂ) * Complex.I)) = ∫ t : ℝ, saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I) - ∑ n ∈ Finset.range (N + 1), saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * (plusSaddlePoleResidue ε ℓ n * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) := by apply MeasureTheory.integral_congr_ae filter_upwards [] with t have hz : (a : ℂ) + (t : ℂ) * Complex.I ∈ saddleFinitePoleHalfPlane N := by change -(2 * ((N : ℝ) + 1)) < ((a : ℂ) + (t : ℂ) * Complex.I).re simpa [Complex.mul_re] using! hhalf unfold plusSaddleFiniteRapidContourIntegrand rw [plusSaddleFiniteRapidPoleRegularPart_eq_subtraction_of_not_pole hε horder ℓ N hz (saddleShiftedLine_ne_pole hpole t)] unfold plusSaddleFiniteRapidPoleSubtraction rw [mul_sub, Finset.mul_sum] _ = (∫ t : ℝ, saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)) - (∫ t : ℝ, ∑ n ∈ Finset.range (N + 1), saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * (plusSaddlePoleResidue ε ℓ n * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I))) := MeasureTheory.integral_sub hdata hsum _ = (∫ t : ℝ, saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)) - ∑ n ∈ Finset.range (N + 1), plusSaddlePoleResidue ε ℓ n * (∫ t : ℝ, saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) := by rw [saddleFiniteGaussianPoleWeighted_shiftedLine_integral hr (plusSaddlePoleResidue ε ℓ) N hpole] theorem minusSaddleFiniteRapidContourIntegrand_shiftedLine_integral_eq {ε ℓ a r : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (N : ℕ) (hhalf : -(2 * ((N : ℝ) + 1)) < a) (hpole : ∀ n : ℕ, a ≠ -((2 * n : ℕ) : ℝ)) : (∫ t : ℝ, minusSaddleFiniteRapidContourIntegrand ε ℓ N r ((a : ℂ) + (t : ℂ) * Complex.I)) = (∫ t : ℝ, saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * minusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)) - ∑ n ∈ Finset.range (N + 1), minusSaddlePoleResidue ε ℓ n * (∫ t : ℝ, saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) := by have hdata := minusSaddleMellinData_shiftedLine_weighted_integrable hε hℓ horder hpole hr have hsum := saddleFiniteGaussianPoleWeighted_shiftedLine_integrable hr (minusSaddlePoleResidue ε ℓ) N hpole calc (∫ t : ℝ, minusSaddleFiniteRapidContourIntegrand ε ℓ N r ((a : ℂ) + (t : ℂ) * Complex.I)) = ∫ t : ℝ, saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * minusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I) - ∑ n ∈ Finset.range (N + 1), saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * (minusSaddlePoleResidue ε ℓ n * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) := by apply MeasureTheory.integral_congr_ae filter_upwards [] with t have hz : (a : ℂ) + (t : ℂ) * Complex.I ∈ saddleFinitePoleHalfPlane N := by change -(2 * ((N : ℝ) + 1)) < ((a : ℂ) + (t : ℂ) * Complex.I).re simpa [Complex.mul_re] using! hhalf unfold minusSaddleFiniteRapidContourIntegrand rw [minusSaddleFiniteRapidPoleRegularPart_eq_subtraction_of_not_pole hε horder ℓ N hz (saddleShiftedLine_ne_pole hpole t)] unfold minusSaddleFiniteRapidPoleSubtraction rw [mul_sub, Finset.mul_sum] _ = (∫ t : ℝ, saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * minusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)) - (∫ t : ℝ, ∑ n ∈ Finset.range (N + 1), saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * (minusSaddlePoleResidue ε ℓ n * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I))) := MeasureTheory.integral_sub hdata hsum _ = (∫ t : ℝ, saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * minusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)) - ∑ n ∈ Finset.range (N + 1), minusSaddlePoleResidue ε ℓ n * (∫ t : ℝ, saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((a : ℂ) + (t : ℂ) * Complex.I)) := by rw [saddleFiniteGaussianPoleWeighted_shiftedLine_integral hr (minusSaddlePoleResidue ε ℓ) N hpole] theorem saddleFiniteGaussianPoleWeighted_vertical_integral_jump {r A B : ℝ} (hr : 0 < r) (c : ℕ → ℂ) (N : ℕ) (hcross : ∀ n ∈ Finset.range (N + 1), A < -((2 * n : ℕ) : ℝ) ∧ -((2 * n : ℕ) : ℝ) < B) : (∑ n ∈ Finset.range (N + 1), c n * (∫ t : ℝ, saddleMellinInversePower r ((B : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((B : ℂ) + (t : ℂ) * Complex.I))) - (∑ n ∈ Finset.range (N + 1), c n * (∫ t : ℝ, saddleMellinInversePower r ((A : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((A : ℂ) + (t : ℂ) * Complex.I))) = ((2 * Real.pi : ℝ) : ℂ) * ∑ n ∈ Finset.range (N + 1), c n * ((r ^ (2 * n) : ℝ) : ℂ) := by rw [← Finset.sum_sub_distrib] calc (∑ n ∈ Finset.range (N + 1), (c n * (∫ t : ℝ, saddleMellinInversePower r ((B : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((B : ℂ) + (t : ℂ) * Complex.I)) - c n * (∫ t : ℝ, saddleMellinInversePower r ((A : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((A : ℂ) + (t : ℂ) * Complex.I)))) = ∑ n ∈ Finset.range (N + 1), c n * ((∫ t : ℝ, saddleMellinInversePower r ((B : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((B : ℂ) + (t : ℂ) * Complex.I)) - (∫ t : ℝ, saddleMellinInversePower r ((A : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((A : ℂ) + (t : ℂ) * Complex.I))) := by apply Finset.sum_congr rfl intro n _ ring _ = ∑ n ∈ Finset.range (N + 1), c n * (((2 * Real.pi : ℝ) : ℂ) * ((r ^ (2 * n) : ℝ) : ℂ)) := by apply Finset.sum_congr rfl intro n hn rw [saddleGaussianPoleWeightedRepresentative_vertical_integral_jump hr n (hcross n hn).1 (hcross n hn).2] _ = ((2 * Real.pi : ℝ) : ℂ) * ∑ n ∈ Finset.range (N + 1), c n * ((r ^ (2 * n) : ℝ) : ℂ) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro n _ ring theorem plusSaddleMellinData_vertical_integral_residue_expansion {ε ℓ r A B : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (N : ℕ) (hhalf : -(2 * ((N : ℝ) + 1)) < A) (hAB : A ≤ B) (hApole : ∀ n : ℕ, A ≠ -((2 * n : ℕ) : ℝ)) (hBpole : ∀ n : ℕ, B ≠ -((2 * n : ℕ) : ℝ)) (hcross : ∀ n ∈ Finset.range (N + 1), A < -((2 * n : ℕ) : ℝ) ∧ -((2 * n : ℕ) : ℝ) < B) : (∫ t : ℝ, saddleMellinInversePower r ((B : ℂ) + (t : ℂ) * Complex.I) * plusSaddleMellinData ε ℓ ((B : ℂ) + (t : ℂ) * Complex.I)) = (∫ t : ℝ, saddleMellinInversePower r ((A : ℂ) + (t : ℂ) * Complex.I) * plusSaddleMellinData ε ℓ ((A : ℂ) + (t : ℂ) * Complex.I)) + ((2 * Real.pi : ℝ) : ℂ) * ∑ n ∈ Finset.range (N + 1), plusSaddlePoleResidue ε ℓ n * ((r ^ (2 * n) : ℝ) : ℂ) := by have hhalfB : -(2 * ((N : ℝ) + 1)) < B := hhalf.trans_le hAB have hcontour := plusSaddleFiniteRapidContourIntegrand_vertical_integral_eq hε hℓ horder hr N hhalf hAB hApole hBpole rw [plusSaddleFiniteRapidContourIntegrand_shiftedLine_integral_eq hε hℓ horder hr N hhalfB hBpole, plusSaddleFiniteRapidContourIntegrand_shiftedLine_integral_eq hε hℓ horder hr N hhalf hApole] at hcontour have hsum := saddleFiniteGaussianPoleWeighted_vertical_integral_jump hr (plusSaddlePoleResidue ε ℓ) N hcross calc (∫ t : ℝ, saddleMellinInversePower r ((B : ℂ) + (t : ℂ) * Complex.I) * plusSaddleMellinData ε ℓ ((B : ℂ) + (t : ℂ) * Complex.I)) = (∫ t : ℝ, saddleMellinInversePower r ((A : ℂ) + (t : ℂ) * Complex.I) * plusSaddleMellinData ε ℓ ((A : ℂ) + (t : ℂ) * Complex.I)) + ((∑ n ∈ Finset.range (N + 1), plusSaddlePoleResidue ε ℓ n * (∫ t : ℝ, saddleMellinInversePower r ((B : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((B : ℂ) + (t : ℂ) * Complex.I))) - (∑ n ∈ Finset.range (N + 1), plusSaddlePoleResidue ε ℓ n * (∫ t : ℝ, saddleMellinInversePower r ((A : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((A : ℂ) + (t : ℂ) * Complex.I)))) := by linear_combination hcontour _ = (∫ t : ℝ, saddleMellinInversePower r ((A : ℂ) + (t : ℂ) * Complex.I) * plusSaddleMellinData ε ℓ ((A : ℂ) + (t : ℂ) * Complex.I)) + ((2 * Real.pi : ℝ) : ℂ) * ∑ n ∈ Finset.range (N + 1), plusSaddlePoleResidue ε ℓ n * ((r ^ (2 * n) : ℝ) : ℂ) := by rw [hsum] theorem minusSaddleMellinData_vertical_integral_residue_expansion {ε ℓ r A B : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (N : ℕ) (hhalf : -(2 * ((N : ℝ) + 1)) < A) (hAB : A ≤ B) (hApole : ∀ n : ℕ, A ≠ -((2 * n : ℕ) : ℝ)) (hBpole : ∀ n : ℕ, B ≠ -((2 * n : ℕ) : ℝ)) (hcross : ∀ n ∈ Finset.range (N + 1), A < -((2 * n : ℕ) : ℝ) ∧ -((2 * n : ℕ) : ℝ) < B) : (∫ t : ℝ, saddleMellinInversePower r ((B : ℂ) + (t : ℂ) * Complex.I) * minusSaddleMellinData ε ℓ ((B : ℂ) + (t : ℂ) * Complex.I)) = (∫ t : ℝ, saddleMellinInversePower r ((A : ℂ) + (t : ℂ) * Complex.I) * minusSaddleMellinData ε ℓ ((A : ℂ) + (t : ℂ) * Complex.I)) + ((2 * Real.pi : ℝ) : ℂ) * ∑ n ∈ Finset.range (N + 1), minusSaddlePoleResidue ε ℓ n * ((r ^ (2 * n) : ℝ) : ℂ) := by have hhalfB : -(2 * ((N : ℝ) + 1)) < B := hhalf.trans_le hAB have hcontour := minusSaddleFiniteRapidContourIntegrand_vertical_integral_eq hε hℓ horder hr N hhalf hAB hApole hBpole rw [minusSaddleFiniteRapidContourIntegrand_shiftedLine_integral_eq hε hℓ horder hr N hhalfB hBpole, minusSaddleFiniteRapidContourIntegrand_shiftedLine_integral_eq hε hℓ horder hr N hhalf hApole] at hcontour have hsum := saddleFiniteGaussianPoleWeighted_vertical_integral_jump hr (minusSaddlePoleResidue ε ℓ) N hcross calc (∫ t : ℝ, saddleMellinInversePower r ((B : ℂ) + (t : ℂ) * Complex.I) * minusSaddleMellinData ε ℓ ((B : ℂ) + (t : ℂ) * Complex.I)) = (∫ t : ℝ, saddleMellinInversePower r ((A : ℂ) + (t : ℂ) * Complex.I) * minusSaddleMellinData ε ℓ ((A : ℂ) + (t : ℂ) * Complex.I)) + ((∑ n ∈ Finset.range (N + 1), minusSaddlePoleResidue ε ℓ n * (∫ t : ℝ, saddleMellinInversePower r ((B : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((B : ℂ) + (t : ℂ) * Complex.I))) - (∑ n ∈ Finset.range (N + 1), minusSaddlePoleResidue ε ℓ n * (∫ t : ℝ, saddleMellinInversePower r ((A : ℂ) + (t : ℂ) * Complex.I) * saddleGaussianPoleRepresentative n ((A : ℂ) + (t : ℂ) * Complex.I)))) := by linear_combination hcontour _ = (∫ t : ℝ, saddleMellinInversePower r ((A : ℂ) + (t : ℂ) * Complex.I) * minusSaddleMellinData ε ℓ ((A : ℂ) + (t : ℂ) * Complex.I)) + ((2 * Real.pi : ℝ) : ℂ) * ∑ n ∈ Finset.range (N + 1), minusSaddlePoleResidue ε ℓ n * ((r ^ (2 * n) : ℝ) : ℂ) := by rw [hsum] def saddleTaylorContour (N : ℕ) : ℝ := -((2 * N + 1 : ℕ) : ℝ) theorem saddleTaylorContour_mem_halfPlane (N : ℕ) : -(2 * ((N : ℝ) + 1)) < saddleTaylorContour N := by unfold saddleTaylorContour push_cast linarith theorem saddleTaylorContour_ne_pole (N n : ℕ) : saddleTaylorContour N ≠ -((2 * n : ℕ) : ℝ) := by intro heq unfold saddleTaylorContour at heq have hcast : ((2 * N + 1 : ℕ) : ℝ) = ((2 * n : ℕ) : ℝ) := neg_injective heq have hnat : 2 * N + 1 = 2 * n := by exact_mod_cast hcast omega theorem saddlePositiveContour_ne_pole {ℓ : ℝ} (hℓ : 0 < ℓ) (n : ℕ) : ℓ ≠ -((2 * n : ℕ) : ℝ) := by have hnonpos : -((2 * n : ℕ) : ℝ) ≤ 0 := by exact neg_nonpos.mpr (Nat.cast_nonneg (2 * n)) exact ne_of_gt (hnonpos.trans_lt hℓ) theorem saddleTaylorContour_crosses_poles {ℓ : ℝ} (hℓ : 0 < ℓ) (N : ℕ) : ∀ n ∈ Finset.range (N + 1), saddleTaylorContour N < -((2 * n : ℕ) : ℝ) ∧ -((2 * n : ℕ) : ℝ) < ℓ := by intro n hn have hnle : n ≤ N := by have hnlt := Finset.mem_range.mp hn omega constructor · unfold saddleTaylorContour apply neg_lt_neg exact_mod_cast (show 2 * n < 2 * N + 1 by omega) · have hnonpos : -((2 * n : ℕ) : ℝ) ≤ 0 := by exact neg_nonpos.mpr (Nat.cast_nonneg (2 * n)) exact hnonpos.trans_lt hℓ theorem saddleTaylorContour_le_positive {ℓ : ℝ} (hℓ : 0 < ℓ) (N : ℕ) : saddleTaylorContour N ≤ ℓ := by have hnonpos : saddleTaylorContour N ≤ 0 := by unfold saddleTaylorContour exact neg_nonpos.mpr (Nat.cast_nonneg (2 * N + 1)) exact hnonpos.trans hℓ.le theorem plusSaddleProfile_eq_normalized_vertical_integral {ε ℓ r : ℝ} (hr : 0 < r) : plusSaddleProfile ε ℓ r = ((1 / (2 * Real.pi) : ℝ) : ℂ) * (∫ t : ℝ, saddleMellinInversePower r ((ℓ : ℂ) + (t : ℂ) * Complex.I) * plusSaddleMellinData ε ℓ ((ℓ : ℂ) + (t : ℂ) * Complex.I)) := by unfold plusSaddleProfile rw [if_neg hr.ne'] unfold mellinInv simp only [smul_eq_mul, Complex.real_smul] rfl theorem minusSaddleProfile_eq_normalized_vertical_integral {ε ℓ r : ℝ} (hr : 0 < r) : minusSaddleProfile ε ℓ r = ((1 / (2 * Real.pi) : ℝ) : ℂ) * (∫ t : ℝ, saddleMellinInversePower r ((ℓ : ℂ) + (t : ℂ) * Complex.I) * minusSaddleMellinData ε ℓ ((ℓ : ℂ) + (t : ℂ) * Complex.I)) := by unfold minusSaddleProfile rw [if_neg hr.ne'] unfold mellinInv simp only [smul_eq_mul, Complex.real_smul] rfl def plusSaddleTaylorRemainder (ε ℓ : ℝ) (N : ℕ) (r : ℝ) : ℂ := ((1 / (2 * Real.pi) : ℝ) : ℂ) * (∫ t : ℝ, saddleMellinInversePower r ((saddleTaylorContour N : ℂ) + (t : ℂ) * Complex.I) * plusSaddleMellinData ε ℓ ((saddleTaylorContour N : ℂ) + (t : ℂ) * Complex.I)) def minusSaddleTaylorRemainder (ε ℓ : ℝ) (N : ℕ) (r : ℝ) : ℂ := ((1 / (2 * Real.pi) : ℝ) : ℂ) * (∫ t : ℝ, saddleMellinInversePower r ((saddleTaylorContour N : ℂ) + (t : ℂ) * Complex.I) * minusSaddleMellinData ε ℓ ((saddleTaylorContour N : ℂ) + (t : ℂ) * Complex.I)) theorem plusSaddlePoleResidue_zero {ε ℓ : ℝ} (hℓ : 0 < ℓ) : plusSaddlePoleResidue ε ℓ 0 = (saddleOriginValue ε ℓ : ℂ) := by simpa [plusSaddlePoleResidue] using! (two_mul_plusSaddleRegularMellinFactor_zero (ε := ε) hℓ) theorem minusSaddlePoleResidue_zero {ε ℓ : ℝ} (hℓ : 0 < ℓ) : minusSaddlePoleResidue ε ℓ 0 = (saddleOriginValue ε ℓ : ℂ) := by simpa [minusSaddlePoleResidue] using! (two_mul_minusSaddleRegularMellinFactor_zero (ε := ε) hℓ) theorem plusSaddleProfile_eq_residue_sum_add_remainder {ε ℓ r : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (N : ℕ) : plusSaddleProfile ε ℓ r = (∑ n ∈ Finset.range (N + 1), plusSaddlePoleResidue ε ℓ n * ((r ^ (2 * n) : ℝ) : ℂ)) + plusSaddleTaylorRemainder ε ℓ N r := by have hcontour := plusSaddleMellinData_vertical_integral_residue_expansion hε hℓ horder hr N (saddleTaylorContour_mem_halfPlane N) (saddleTaylorContour_le_positive hℓ N) (fun n : ℕ => saddleTaylorContour_ne_pole N n) (fun n : ℕ => saddlePositiveContour_ne_pole hℓ n) (saddleTaylorContour_crosses_poles hℓ N) have hnormal : ((1 / (2 * Real.pi) : ℝ) : ℂ) * ((2 * Real.pi : ℝ) : ℂ) = 1 := by push_cast field_simp [Real.pi_ne_zero] rw [plusSaddleProfile_eq_normalized_vertical_integral hr, hcontour] unfold plusSaddleTaylorRemainder rw [mul_add, ← mul_assoc, hnormal, one_mul] ring theorem minusSaddleProfile_eq_residue_sum_add_remainder {ε ℓ r : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (N : ℕ) : minusSaddleProfile ε ℓ r = (∑ n ∈ Finset.range (N + 1), minusSaddlePoleResidue ε ℓ n * ((r ^ (2 * n) : ℝ) : ℂ)) + minusSaddleTaylorRemainder ε ℓ N r := by have hcontour := minusSaddleMellinData_vertical_integral_residue_expansion hε hℓ horder hr N (saddleTaylorContour_mem_halfPlane N) (saddleTaylorContour_le_positive hℓ N) (fun n : ℕ => saddleTaylorContour_ne_pole N n) (fun n : ℕ => saddlePositiveContour_ne_pole hℓ n) (saddleTaylorContour_crosses_poles hℓ N) have hnormal : ((1 / (2 * Real.pi) : ℝ) : ℂ) * ((2 * Real.pi : ℝ) : ℂ) = 1 := by push_cast field_simp [Real.pi_ne_zero] rw [minusSaddleProfile_eq_normalized_vertical_integral hr, hcontour] unfold minusSaddleTaylorRemainder rw [mul_add, ← mul_assoc, hnormal, one_mul] ring theorem saddleMellinInversePower_shiftedLine_integral_norm {r a : ℝ} (hr : 0 < r) (F : ℂ → ℂ) (hF : Integrable (fun t : ℝ => F ((a : ℂ) + (t : ℂ) * Complex.I))) : (∫ t : ℝ, ‖saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * F ((a : ℂ) + (t : ℂ) * Complex.I)‖) = r ^ (-a) * (∫ t : ℝ, ‖F ((a : ℂ) + (t : ℂ) * Complex.I)‖) := by calc (∫ t : ℝ, ‖saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * F ((a : ℂ) + (t : ℂ) * Complex.I)‖) = ∫ t : ℝ, r ^ (-a) * ‖F ((a : ℂ) + (t : ℂ) * Complex.I)‖ := by apply MeasureTheory.integral_congr_ae filter_upwards [] with t rw [norm_mul, saddleMellinInversePower_shiftedLine_norm hr a t] _ = r ^ (-a) * (∫ t : ℝ, ‖F ((a : ℂ) + (t : ℂ) * Complex.I)‖) := integral_const_mul_of_integrable hF.norm theorem saddleTaylorContour_rpow (r : ℝ) (N : ℕ) : r ^ (-(saddleTaylorContour N)) = r ^ (2 * N + 1) := by unfold saddleTaylorContour rw [neg_neg, Real.rpow_natCast] end noncomputable section open Filter open scoped Topology def wallisProduct (n : ℕ) : ℝ := Real.Wallis.W n theorem wallisProduct_pos (n : ℕ) : 0 < wallisProduct n := Real.Wallis.W_pos n theorem tendsto_wallisProduct : Tendsto wallisProduct atTop (nhds (Real.pi / 2)) := Real.Wallis.tendsto_W_nhds_pi_div_two theorem tendsto_log_wallisProduct : Tendsto (fun n : ℕ => Real.log (wallisProduct n)) atTop (nhds (Real.log (Real.pi / 2))) := by exact (Real.continuousAt_log (by positivity)).tendsto.comp tendsto_wallisProduct end noncomputable section open Filter MeasureTheory Set open scoped Topology def frullaniKernel (a b x : ℝ) : ℝ := (Real.exp (-a * x) - Real.exp (-b * x)) / x theorem laplaceKernel_integrable {a : ℝ} (ha : 0 < a) : IntegrableOn (fun x : ℝ => Real.exp (-a * x)) (Ioi 0) := by exact integrableOn_exp_mul_Ioi (by linarith : -a < 0) 0 theorem integral_laplaceKernel {a : ℝ} (ha : 0 < a) : (∫ x : ℝ in Ioi 0, Real.exp (-a * x)) = a⁻¹ := by simpa using! (integral_exp_mul_Ioi (by linarith : -a < 0) 0) theorem intervalIntegral_laplaceKernel {x : ℝ} (hx : x ≠ 0) (a b : ℝ) : (∫ s in a..b, Real.exp (-s * x)) = frullaniKernel a b x := by have hderiv (s : ℝ) : HasDerivAt (fun u : ℝ => -Real.exp (-u * x) / x) (Real.exp (-s * x)) s := by convert! (((Real.hasDerivAt_exp (-s * x)).comp s ((hasDerivAt_id s).neg.mul_const x)).neg.div_const x) using 1; field_simp [hx] have hint : IntervalIntegrable (fun s : ℝ => Real.exp (-s * x)) volume a b := ((Real.continuous_exp.comp (continuous_id.neg.mul continuous_const)).intervalIntegrable a b) rw [intervalIntegral.integral_eq_sub_of_hasDerivAt (fun s _ => hderiv s) hint] unfold frullaniKernel ring theorem laplaceParameter_integrable {a b : ℝ} (ha : 0 < a) (hab : a ≤ b) : Integrable (Function.uncurry (fun s x : ℝ => Real.exp (-s * x))) ((volume.restrict (Set.uIoc a b)).prod (volume.restrict (Ioi 0))) := by have hmeas : AEStronglyMeasurable (Function.uncurry (fun s x : ℝ => Real.exp (-s * x))) ((volume.restrict (Set.uIoc a b)).prod (volume.restrict (Ioi 0))) := by fun_prop apply (integrable_prod_iff hmeas).2 constructor · filter_upwards [ae_restrict_mem measurableSet_uIoc] with s hs have hspos : 0 < s := by rw [Set.uIoc_of_le hab] at hs linarith [hs.1] exact laplaceKernel_integrable hspos · have hnonzero : ∀ s ∈ Set.uIcc a b, s ≠ 0 := by intro s hs rw [Set.uIcc_of_le hab] at hs exact ne_of_gt (lt_of_lt_of_le ha hs.1) have hcont : ContinuousOn (fun s : ℝ => s⁻¹) (Set.uIcc a b) := continuousOn_id.inv₀ hnonzero have hinv : Integrable (fun s : ℝ => s⁻¹) (volume.restrict (Set.uIoc a b)) := intervalIntegrable_iff.mp hcont.intervalIntegrable apply hinv.congr filter_upwards [ae_restrict_mem measurableSet_uIoc] with s hs have hspos : 0 < s := by rw [Set.uIoc_of_le hab] at hs linarith [hs.1] symm change (∫ y : ℝ in Ioi 0, ‖Real.exp (-s * y)‖) = s⁻¹ simpa only [Real.norm_eq_abs, abs_of_pos (Real.exp_pos _)] using! integral_laplaceKernel hspos theorem integral_frullaniKernel {a b : ℝ} (ha : 0 < a) (hab : a ≤ b) : (∫ x : ℝ in Ioi 0, frullaniKernel a b x) = Real.log (b / a) := by have hb : 0 < b := lt_of_lt_of_le ha hab calc (∫ x : ℝ in Ioi 0, frullaniKernel a b x) = ∫ x : ℝ in Ioi 0, ∫ s in a..b, Real.exp (-s * x) := by apply setIntegral_congr_fun measurableSet_Ioi intro x hx exact (intervalIntegral_laplaceKernel (ne_of_gt hx) a b).symm _ = ∫ s in a..b, ∫ x : ℝ in Ioi 0, Real.exp (-s * x) := (intervalIntegral_integral_swap (laplaceParameter_integrable ha hab)).symm _ = ∫ s in a..b, s⁻¹ := by apply intervalIntegral.integral_congr intro s hs have hspos : 0 < s := by rw [Set.uIcc_of_le hab] at hs exact lt_of_lt_of_le ha hs.1 exact integral_laplaceKernel hspos _ = Real.log (b / a) := integral_inv_of_pos ha hb theorem frullaniKernel_integrable {a b : ℝ} (ha : 0 < a) (hab : a ≤ b) : IntegrableOn (frullaniKernel a b) (Ioi 0) := by have hprod := (laplaceParameter_integrable ha hab).integral_prod_right apply hprod.congr filter_upwards [ae_restrict_mem measurableSet_Ioi] with x hx change (∫ s in Set.uIoc a b, Real.exp (-s * x)) = frullaniKernel a b x rw [Set.uIoc_of_le hab, ← intervalIntegral.integral_of_le hab] exact intervalIntegral_laplaceKernel (ne_of_gt hx) a b def wallisPairKernel (n : ℕ) (x : ℝ) : ℝ := frullaniKernel (2 * (n : ℝ) + 1) (2 * (n : ℝ) + 2) x - frullaniKernel (2 * (n : ℝ) + 2) (2 * (n : ℝ) + 3) x theorem wallisPairKernel_eq (n : ℕ) (x : ℝ) : wallisPairKernel n x = Real.exp (-(2 * (n : ℝ) + 1) * x) * (1 - Real.exp (-x)) ^ 2 / x := by have htwo : Real.exp (-(2 * (n : ℝ) + 2) * x) = Real.exp (-(2 * (n : ℝ) + 1) * x) * Real.exp (-x) := by rw [show -(2 * (n : ℝ) + 2) * x = -(2 * (n : ℝ) + 1) * x + -x by ring, Real.exp_add] have hthree : Real.exp (-(2 * (n : ℝ) + 3) * x) = Real.exp (-(2 * (n : ℝ) + 1) * x) * Real.exp (-x) ^ 2 := by rw [show -(2 * (n : ℝ) + 3) * x = (-(2 * (n : ℝ) + 1) * x + -x) + -x by ring, Real.exp_add, Real.exp_add] ring unfold wallisPairKernel frullaniKernel rw [htwo, hthree] ring theorem wallisPairKernel_integrable (n : ℕ) : IntegrableOn (wallisPairKernel n) (Ioi 0) := by unfold wallisPairKernel apply Integrable.sub · exact frullaniKernel_integrable (by positivity) (by linarith) · exact frullaniKernel_integrable (by positivity) (by linarith) def wallisPairFactor (n : ℕ) : ℝ := ((2 * (n : ℝ) + 2) / (2 * (n : ℝ) + 1)) * ((2 * (n : ℝ) + 2) / (2 * (n : ℝ) + 3)) theorem integral_wallisPairKernel (n : ℕ) : (∫ x : ℝ in Ioi 0, wallisPairKernel n x) = Real.log (wallisPairFactor n) := by unfold wallisPairKernel rw [integral_sub (frullaniKernel_integrable (by positivity) (by linarith)) (frullaniKernel_integrable (by positivity) (by linarith)), integral_frullaniKernel (by positivity) (by linarith), integral_frullaniKernel (by positivity) (by linarith)] unfold wallisPairFactor rw [Real.log_mul (by positivity) (by positivity), Real.log_div (by positivity) (by positivity), Real.log_div (by positivity) (by positivity), Real.log_div (by positivity) (by positivity)] ring theorem wallisPairFactor_pos (n : ℕ) : 0 < wallisPairFactor n := by unfold wallisPairFactor positivity theorem wallisProduct_succ (n : ℕ) : wallisProduct (n + 1) = wallisProduct n * wallisPairFactor n := by simpa [wallisProduct, wallisPairFactor] using! Real.Wallis.W_succ n def wallisPartialKernel (n : ℕ) (x : ℝ) : ℝ := ∑ k ∈ Finset.range n, wallisPairKernel k x theorem wallisPartialKernel_integrable (n : ℕ) : IntegrableOn (wallisPartialKernel n) (Ioi 0) := by unfold wallisPartialKernel exact integrable_finsetSum _ fun k _ => wallisPairKernel_integrable k theorem integral_wallisPartialKernel (n : ℕ) : (∫ x : ℝ in Ioi 0, wallisPartialKernel n x) = Real.log (wallisProduct n) := by induction n with | zero => simp [wallisPartialKernel, wallisProduct, Real.Wallis.W] | succ n ih => have hpartial : (fun x : ℝ => wallisPartialKernel (n + 1) x) = fun x : ℝ => wallisPartialKernel n x + wallisPairKernel n x := by funext x simp [wallisPartialKernel, Finset.sum_range_succ] rw [hpartial, integral_add (wallisPartialKernel_integrable n) (wallisPairKernel_integrable n), ih, integral_wallisPairKernel, wallisProduct_succ, Real.log_mul (wallisProduct_pos n).ne' (wallisPairFactor_pos n).ne'] def wallisLaplaceKernel (x : ℝ) : ℝ := Real.exp (-x) * (1 - Real.exp (-x)) / (x * (1 + Real.exp (-x))) theorem wallisPartialKernel_eq (n : ℕ) {x : ℝ} (hx : x ≠ 0) : wallisPartialKernel n x = wallisLaplaceKernel x * (1 - Real.exp (-(2 * (n : ℝ)) * x)) := by induction n with | zero => simp [wallisPartialKernel] | succ n ih => rw [show wallisPartialKernel (n + 1) x = wallisPartialKernel n x + wallisPairKernel n x by simp [wallisPartialKernel, Finset.sum_range_succ], ih, wallisPairKernel_eq] have htwo : Real.exp (-(2 * ((n + 1 : ℕ) : ℝ)) * x) = Real.exp (-(2 * (n : ℝ)) * x) * Real.exp (-x) ^ 2 := by push_cast rw [show -(2 * ((n : ℝ) + 1)) * x = (-(2 * (n : ℝ)) * x + -x) + -x by ring, Real.exp_add, Real.exp_add] ring have hone : Real.exp (-(2 * (n : ℝ) + 1) * x) = Real.exp (-(2 * (n : ℝ)) * x) * Real.exp (-x) := by rw [show -(2 * (n : ℝ) + 1) * x = -(2 * (n : ℝ)) * x + -x by ring, Real.exp_add] rw [htwo, hone] unfold wallisLaplaceKernel have hden : 1 + Real.exp (-x) ≠ 0 := by positivity field_simp [hx, hden] ring theorem wallisLaplaceKernel_nonneg {x : ℝ} (hx : 0 < x) : 0 ≤ wallisLaplaceKernel x := by unfold wallisLaplaceKernel have hq : Real.exp (-x) ≤ 1 := (Real.exp_le_one_iff).2 (neg_nonpos.mpr hx.le) exact div_nonneg (mul_nonneg (Real.exp_pos _).le (sub_nonneg.mpr hq)) (mul_nonneg hx.le (by positivity)) theorem wallisLaplaceKernel_abs_le {x : ℝ} (hx : 0 < x) : |wallisLaplaceKernel x| ≤ Real.exp (-x) := by rw [abs_of_nonneg (wallisLaplaceKernel_nonneg hx)] unfold wallisLaplaceKernel have hq : 0 < Real.exp (-x) := Real.exp_pos _ have hsub : 1 - Real.exp (-x) ≤ x := by linarith [Real.add_one_le_exp (-x)] have hden : 0 < x * (1 + Real.exp (-x)) := by positivity apply (div_le_iff₀ hden).2 have hmul : 0 ≤ x * Real.exp (-x) := mul_nonneg hx.le hq.le nlinarith theorem wallisLaplaceKernel_integrable : IntegrableOn wallisLaplaceKernel (Ioi 0) := by have hbound : IntegrableOn (fun x : ℝ => Real.exp (-x)) (Ioi 0) := by simpa using! laplaceKernel_integrable (a := (1 : ℝ)) zero_lt_one refine hbound.mono' ?_ ?_ · unfold wallisLaplaceKernel exact (by fun_prop : Measurable (fun x : ℝ => Real.exp (-x) * (1 - Real.exp (-x)) / (x * (1 + Real.exp (-x))))).aestronglyMeasurable filter_upwards [ae_restrict_mem measurableSet_Ioi] with x hx simpa only [Real.norm_eq_abs] using! wallisLaplaceKernel_abs_le hx theorem wallisPartialKernel_abs_le (n : ℕ) {x : ℝ} (hx : 0 < x) : |wallisPartialKernel n x| ≤ wallisLaplaceKernel x := by rw [wallisPartialKernel_eq n hx.ne'] have hexp : Real.exp (-(2 * (n : ℝ)) * x) ≤ 1 := by apply Real.exp_le_one_iff.mpr have hn : 0 ≤ (n : ℝ) := Nat.cast_nonneg _ nlinarith have hfactor : 0 ≤ 1 - Real.exp (-(2 * (n : ℝ)) * x) := sub_nonneg.mpr hexp have hfactor_le : 1 - Real.exp (-(2 * (n : ℝ)) * x) ≤ 1 := by linarith [Real.exp_pos (-(2 * (n : ℝ)) * x)] rw [abs_of_nonneg (mul_nonneg (wallisLaplaceKernel_nonneg hx) hfactor)] exact mul_le_of_le_one_right (wallisLaplaceKernel_nonneg hx) hfactor_le theorem tendsto_wallisPartialKernel {x : ℝ} (hx : 0 < x) : Tendsto (fun n : ℕ => wallisPartialKernel n x) atTop (nhds (wallisLaplaceKernel x)) := by have hlinear : Tendsto (fun n : ℕ => (2 * x) * (n : ℝ)) atTop atTop := tendsto_natCast_atTop_atTop.const_mul_atTop (by positivity) have hexp : Tendsto (fun n : ℕ => Real.exp (-(2 * (n : ℝ)) * x)) atTop (nhds 0) := by convert! Real.tendsto_exp_neg_atTop_nhds_zero.comp hlinear using 1 funext n congr 1 ring have hfactor : Tendsto (fun n : ℕ => 1 - Real.exp (-(2 * (n : ℝ)) * x)) atTop (nhds 1) := by simpa using! tendsto_const_nhds.sub hexp have hproduct := (tendsto_const_nhds (x := wallisLaplaceKernel x)).mul hfactor simpa only [mul_one, wallisPartialKernel_eq _ hx.ne'] using! hproduct theorem tendsto_integral_wallisPartialKernel : Tendsto (fun n : ℕ => ∫ x : ℝ in Ioi 0, wallisPartialKernel n x) atTop (nhds (∫ x : ℝ in Ioi 0, wallisLaplaceKernel x)) := by apply tendsto_integral_of_dominated_convergence wallisLaplaceKernel (fun n => (wallisPartialKernel_integrable n).aestronglyMeasurable) wallisLaplaceKernel_integrable · intro n filter_upwards [ae_restrict_mem measurableSet_Ioi] with x hx simpa only [Real.norm_eq_abs] using! wallisPartialKernel_abs_le n hx · filter_upwards [ae_restrict_mem measurableSet_Ioi] with x hx exact tendsto_wallisPartialKernel hx theorem integral_wallisLaplaceKernel : (∫ x : ℝ in Ioi 0, wallisLaplaceKernel x) = Real.log (Real.pi / 2) := by have hproduct : Tendsto (fun n : ℕ => ∫ x : ℝ in Ioi 0, wallisPartialKernel n x) atTop (nhds (Real.log (Real.pi / 2))) := by simpa only [integral_wallisPartialKernel] using! tendsto_log_wallisProduct exact tendsto_nhds_unique tendsto_integral_wallisPartialKernel hproduct end noncomputable section open Filter MeasureTheory open scoped Topology theorem tendsto_cubic_gaussian_atTop : Tendsto (fun x : ℝ => (x ^ 3 + 1) * Real.exp (-(x ^ 2) / 8)) atTop (nhds 0) := by have hpoly : Tendsto (fun x : ℝ => x ^ 3 * Real.exp (-(1 / 8 : ℝ) * x)) atTop (nhds 0) := by simpa [Real.rpow_natCast] using! (tendsto_rpow_mul_exp_neg_mul_atTop_nhds_zero (3 : ℝ) (1 / 8 : ℝ) (by norm_num)) have hone : Tendsto (fun x : ℝ => Real.exp (-(1 / 8 : ℝ) * x)) atTop (nhds 0) := by simpa using! (tendsto_rpow_mul_exp_neg_mul_atTop_nhds_zero (0 : ℝ) (1 / 8 : ℝ) (by norm_num)) have hlinear : Tendsto (fun x : ℝ => (x ^ 3 + 1) * Real.exp (-(1 / 8 : ℝ) * x)) atTop (nhds 0) := by convert! hpoly.add hone using 1 · ext x ring · norm_num refine tendsto_of_tendsto_of_tendsto_of_le_of_le' (tendsto_const_nhds (x := (0 : ℝ))) hlinear ?_ ?_ · filter_upwards [eventually_ge_atTop (1 : ℝ)] with x hx positivity · filter_upwards [eventually_ge_atTop (1 : ℝ)] with x hx have hxpoly : 0 ≤ x ^ 3 + 1 := by positivity apply mul_le_mul_of_nonneg_left _ hxpoly apply Real.exp_le_exp.mpr nlinarith [mul_nonneg (by linarith : 0 ≤ x) (by linarith : 0 ≤ x - 1)] def shellRadiusMajorant (ε : ℝ) : ℝ := (shellLocation ε + 1) * shellWeight ε * Real.exp ((ε / 4) * (shellLocation ε + 1)) theorem shellRadiusMajorant_inv {x : ℝ} (hx : x ≠ 0) : shellRadiusMajorant x⁻¹ = ((x ^ 3 + 1) * Real.exp (-(x ^ 2) / 8)) * Real.exp (x⁻¹ / 4) := by unfold shellRadiusMajorant shellWeight shellLocation simp only [inv_inv] simp only [mul_assoc] congr 1 rw [← Real.exp_add, ← Real.exp_add] congr 1 field_simp ring theorem tendsto_shellRadiusMajorant : Tendsto shellRadiusMajorant (𝓝[>] (0 : ℝ)) (nhds 0) := by apply tendsto_nhdsGT_zero_of_comp_inv_tendsto_atTop have hsmall : Tendsto (fun x : ℝ => x⁻¹ / 4) atTop (nhds 0) := by convert! tendsto_inv_atTop_zero.div_const (4 : ℝ) using 1; norm_num have hexp : Tendsto (fun x : ℝ => Real.exp (x⁻¹ / 4)) atTop (nhds 1) := by simpa using! hsmall.rexp have hproduct := tendsto_cubic_gaussian_atTop.mul hexp have hzero : Tendsto (fun x : ℝ => ((x ^ 3 + 1) * Real.exp (-(x ^ 2) / 8)) * Real.exp (x⁻¹ / 4)) atTop (nhds 0) := by simpa using! hproduct refine hzero.congr' ?_ filter_upwards [eventually_ne_atTop (0 : ℝ)] with x hx exact (shellRadiusMajorant_inv hx).symm theorem tendsto_positiveShellRadiusContribution : Tendsto positiveShellRadiusContribution (𝓝[>] (0 : ℝ)) (nhds 0) := by refine tendsto_of_tendsto_of_tendsto_of_le_of_le' (tendsto_const_nhds (x := (0 : ℝ))) tendsto_shellRadiusMajorant ?_ ?_ · filter_upwards [self_mem_nhdsWithin] with ε hε exact (positiveShellRadiusContribution_bounds hε).1 · filter_upwards [self_mem_nhdsWithin] with ε hε exact (positiveShellRadiusContribution_bounds hε).2 theorem sinh_le_mul_cosh {a : ℝ} (ha : 0 ≤ a) : Real.sinh a ≤ a * Real.cosh a := by let f : ℝ → ℝ := fun x => x * Real.cosh x - Real.sinh x have hderiv (x : ℝ) : HasDerivAt f (x * Real.sinh x) x := by try dsimp [f] convert! ((hasDerivAt_id x).mul (Real.hasDerivAt_cosh x)).sub (Real.hasDerivAt_sinh x) using 1; simp [id] have hdiff : Differentiable ℝ f := fun x => (hderiv x).differentiableAt have hmono : MonotoneOn f (Set.Ici (0 : ℝ)) := by apply monotoneOn_of_deriv_nonneg (convex_Ici (0 : ℝ)) hdiff.continuous.continuousOn hdiff.differentiableOn intro x hx rw [interior_Ici] at hx rw [(hderiv x).deriv] exact mul_nonneg hx.le (Real.sinh_nonneg_iff.mpr hx.le) have h := hmono (show (0 : ℝ) ∈ Set.Ici 0 by simp) (show a ∈ Set.Ici 0 from ha) ha try dsimp [f] at h norm_num at h linarith def shortShellRadiusIntegrand (ε a : ℝ) : ℝ := shortShellDensity ε a * a * Real.sinh ((1 + ε / 4) * a) def wallisRadiusIntegrand (a : ℝ) : ℝ := -(Real.exp (-2 * a) * Real.tanh a / (2 * a)) theorem tendsto_shortShellRadiusIntegrand {a : ℝ} (ha : 0 < a) : Tendsto (fun ε : ℝ => shortShellRadiusIntegrand ε a) (𝓝[>] (0 : ℝ)) (nhds (wallisRadiusIntegrand a)) := by have hc : Continuous (fun ε : ℝ => shortShellRadiusIntegrand ε a) := by unfold shortShellRadiusIntegrand shortShellDensity shortMargin fun_prop have ht : Tendsto (fun ε : ℝ => shortShellRadiusIntegrand ε a) (𝓝[>] (0 : ℝ)) (nhds (shortShellRadiusIntegrand 0 a)) := (hc.continuousAt (x := (0 : ℝ))).tendsto.mono_left (nhdsWithin_le_nhds (s := Set.Ioi (0 : ℝ))) have hvalue : shortShellRadiusIntegrand 0 a = wallisRadiusIntegrand a := by unfold shortShellRadiusIntegrand shortShellDensity shortMargin wallisRadiusIntegrand rw [Real.tanh_eq_sinh_div_cosh] field_simp [ha.ne', (Real.cosh_pos a).ne'] ring_nf simpa [hvalue] using! ht theorem shortMargin_abs_le_exp {ε a : ℝ} (hε0 : 0 ≤ ε) (hε1 : ε ≤ 1) (ha : 0 ≤ a) : |shortMargin ε a| ≤ 11 * Real.exp a := by have hterm : 0 ≤ 10 * ε * (1 + a) := by positivity calc |shortMargin ε a| = |1 - 10 * ε * (1 + a)| := rfl _ ≤ |(1 : ℝ)| + |10 * ε * (1 + a)| := abs_sub _ _ _ = 1 + 10 * ε * (1 + a) := by rw [abs_of_pos (by norm_num : (0 : ℝ) < 1), abs_of_nonneg hterm] _ ≤ 11 * (1 + a) := by nlinarith [mul_le_mul_of_nonneg_right hε1 (show 0 ≤ 1 + a by linarith)] _ ≤ 11 * Real.exp a := by gcongr nlinarith [Real.add_one_le_exp a] theorem shortShellHyperbolicRatio_le {ε a : ℝ} (hε0 : 0 ≤ ε) (hε1 : ε ≤ 1) (ha : 0 ≤ a) : Real.sinh ((1 + ε / 4) * a) / Real.cosh a ≤ (5 / 4 : ℝ) * a * Real.exp (a / 4) := by have hδ : 0 ≤ ε / 4 := by positivity have harg : 0 ≤ (1 + ε / 4) * a := by positivity calc Real.sinh ((1 + ε / 4) * a) / Real.cosh a ≤ ((1 + ε / 4) * a) * (Real.cosh ((1 + ε / 4) * a) / Real.cosh a) := by rw [← mul_div_assoc] exact (div_le_div_iff_of_pos_right (Real.cosh_pos a)).2 (sinh_le_mul_cosh harg) _ ≤ ((5 / 4 : ℝ) * a) * Real.exp ((ε / 4) * a) := by gcongr · nlinarith · exact cosh_ratio_upper ha hδ _ ≤ ((5 / 4 : ℝ) * a) * Real.exp (a / 4) := by gcongr nlinarith [mul_le_mul_of_nonneg_right hε1 ha] theorem shortShellRadiusIntegrand_eq_ratio {ε a : ℝ} (ha : a ≠ 0) : shortShellRadiusIntegrand ε a = -(shortMargin ε a * Real.exp (-2 * a) * (Real.sinh ((1 + ε / 4) * a) / Real.cosh a) / (2 * a)) := by unfold shortShellRadiusIntegrand shortShellDensity field_simp [ha, (Real.cosh_pos a).ne'] theorem shortShellRadiusIntegrand_abs_le {ε a : ℝ} (hε0 : 0 ≤ ε) (hε1 : ε ≤ 1) (ha : 0 < a) : |shortShellRadiusIntegrand ε a| ≤ 7 * Real.exp (-(3 / 4 : ℝ) * a) := by have harg : 0 ≤ (1 + ε / 4) * a := by positivity have hratio0 : 0 ≤ Real.sinh ((1 + ε / 4) * a) / Real.cosh a := div_nonneg (Real.sinh_nonneg_iff.mpr harg) (Real.cosh_pos a).le rw [shortShellRadiusIntegrand_eq_ratio ha.ne', abs_neg, abs_div, abs_mul, abs_mul, abs_of_pos (Real.exp_pos (-2 * a)), abs_of_nonneg hratio0, abs_of_pos (by positivity : 0 < (2 : ℝ) * a)] calc |shortMargin ε a| * Real.exp (-2 * a) * (Real.sinh ((1 + ε / 4) * a) / Real.cosh a) / (2 * a) ≤ (11 * Real.exp a) * Real.exp (-2 * a) * ((5 / 4 : ℝ) * a * Real.exp (a / 4)) / (2 * a) := by gcongr · exact shortMargin_abs_le_exp hε0 hε1 ha.le · exact shortShellHyperbolicRatio_le hε0 hε1 ha.le _ = (55 / 8 : ℝ) * Real.exp (-(3 / 4 : ℝ) * a) := by rw [show -(3 / 4 : ℝ) * a = (a + -2 * a) + a / 4 by ring, Real.exp_add, Real.exp_add] field_simp [ha.ne'] ring _ ≤ 7 * Real.exp (-(3 / 4 : ℝ) * a) := mul_le_mul_of_nonneg_right (by norm_num) (Real.exp_pos _).le def shortShellRadiusMajorant (a : ℝ) : ℝ := 7 * Real.exp (-(3 / 4 : ℝ) * a) theorem shortShellRadiusMajorant_integrable : IntegrableOn shortShellRadiusMajorant (Set.Ioi (0 : ℝ)) := by change Integrable (fun a : ℝ => 7 * Real.exp (-(3 / 4 : ℝ) * a)) (volume.restrict (Set.Ioi (0 : ℝ))) simpa only [neg_div] using! (integrableOn_exp_mul_Ioi (a := (-3 / 4 : ℝ)) (by norm_num) 0).const_mul 7 theorem shortShellRadiusIntegrand_measurable (ε : ℝ) : Measurable (shortShellRadiusIntegrand ε) := by have hn : Measurable (fun a : ℝ => shortMargin ε a * Real.exp (-2 * a)) := by unfold shortMargin fun_prop have hd : Measurable (fun a : ℝ => 2 * a ^ 2 * Real.cosh a) := by fun_prop have hs : Measurable (fun a : ℝ => Real.sinh ((1 + ε / 4) * a)) := by fun_prop exact ((hn.div hd).neg.mul measurable_id).mul hs theorem tendsto_shortCutoff : Tendsto shortCutoff (𝓝[>] (0 : ℝ)) (nhds 0) := by have ht : Tendsto (fun ε : ℝ => ε) (𝓝[>] (0 : ℝ)) (nhds 0) := tendsto_id.mono_left (nhdsWithin_le_nhds (s := Set.Ioi (0 : ℝ))) simpa [shortCutoff] using! ht.pow 3 theorem tendsto_shortEndpoint : Tendsto shortEndpoint (𝓝[>] (0 : ℝ)) atTop := by have ht : Tendsto (fun ε : ℝ => Real.log ε⁻¹) (𝓝[>] (0 : ℝ)) atTop := Real.tendsto_log_atTop.comp tendsto_inv_nhdsGT_zero change Tendsto (fun ε : ℝ => 10 * Real.log (1 / ε)) (𝓝[>] (0 : ℝ)) atTop simpa only [one_div] using! ht.const_mul_atTop (by norm_num : (0 : ℝ) < 10) def shortShellRadiusContribution (ε : ℝ) : ℝ := ∫ a in shortCutoff ε..shortEndpoint ε, shortShellRadiusIntegrand ε a def supportedShortShellRadiusIntegrand (ε a : ℝ) : ℝ := (Set.Ioc (shortCutoff ε) (shortEndpoint ε)).indicator (shortShellRadiusIntegrand ε) a theorem supportedShortShellRadiusIntegrand_measurable (ε : ℝ) : Measurable (supportedShortShellRadiusIntegrand ε) := by exact (shortShellRadiusIntegrand_measurable ε).indicator measurableSet_Ioc theorem tendsto_supportedShortShellRadiusIntegrand {a : ℝ} (ha : 0 < a) : Tendsto (fun ε : ℝ => supportedShortShellRadiusIntegrand ε a) (𝓝[>] (0 : ℝ)) (nhds (wallisRadiusIntegrand a)) := by refine (tendsto_shortShellRadiusIntegrand ha).congr' ?_ filter_upwards [tendsto_shortCutoff.eventually (Iio_mem_nhds ha), tendsto_shortEndpoint.eventually_ge_atTop a] with ε hlower hupper have hmem : a ∈ Set.Ioc (shortCutoff ε) (shortEndpoint ε) := ⟨hlower, hupper⟩ simp [supportedShortShellRadiusIntegrand, Set.indicator_of_mem hmem] theorem tendsto_supportedShortShellRadiusIntegral : Tendsto (fun ε : ℝ => ∫ a in Set.Ioi (0 : ℝ), supportedShortShellRadiusIntegrand ε a) (𝓝[>] (0 : ℝ)) (nhds (∫ a in Set.Ioi (0 : ℝ), wallisRadiusIntegrand a)) := by apply tendsto_integral_filter_of_dominated_convergence (μ := volume.restrict (Set.Ioi (0 : ℝ))) shortShellRadiusMajorant · exact Eventually.of_forall fun ε => (supportedShortShellRadiusIntegrand_measurable ε).aestronglyMeasurable · filter_upwards [self_mem_nhdsWithin, mem_nhdsWithin_of_mem_nhds (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1))] with ε hε hsmall filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha by_cases hmem : a ∈ Set.Ioc (shortCutoff ε) (shortEndpoint ε) · rw [show supportedShortShellRadiusIntegrand ε a = shortShellRadiusIntegrand ε a by exact Set.indicator_of_mem hmem (shortShellRadiusIntegrand ε)] rw [Real.norm_eq_abs] exact shortShellRadiusIntegrand_abs_le hε.le hsmall.le ha · rw [show supportedShortShellRadiusIntegrand ε a = 0 by exact Set.indicator_of_notMem hmem (shortShellRadiusIntegrand ε), norm_zero] unfold shortShellRadiusMajorant positivity · exact shortShellRadiusMajorant_integrable · filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha exact tendsto_supportedShortShellRadiusIntegrand ha theorem shortShellRadiusContribution_eq_supported {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : shortShellRadiusContribution ε = ∫ a in Set.Ioi (0 : ℝ), supportedShortShellRadiusIntegrand ε a := by have hcutoff : 0 ≤ shortCutoff ε := by unfold shortCutoff positivity have hsubset : Set.Ioc (shortCutoff ε) (shortEndpoint ε) ⊆ Set.Ioi (0 : ℝ) := by intro a ha exact lt_of_le_of_lt hcutoff ha.1 unfold shortShellRadiusContribution supportedShortShellRadiusIntegrand rw [intervalIntegral.integral_of_le horder, MeasureTheory.integral_indicator measurableSet_Ioc, Measure.restrict_restrict_of_subset hsubset] theorem tendsto_shortShellRadiusContribution : Tendsto shortShellRadiusContribution (𝓝[>] (0 : ℝ)) (nhds (∫ a in Set.Ioi (0 : ℝ), wallisRadiusIntegrand a)) := by refine tendsto_supportedShortShellRadiusIntegral.congr' ?_ filter_upwards [self_mem_nhdsWithin, tendsto_shortCutoff.eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1)), tendsto_shortEndpoint.eventually_ge_atTop (1 : ℝ)] with ε hε hcutoff hendpoint have horder : shortCutoff ε ≤ shortEndpoint ε := hcutoff.le.trans hendpoint exact (shortShellRadiusContribution_eq_supported hε horder).symm theorem wallisRadiusIntegrand_eq_laplace (a : ℝ) : wallisRadiusIntegrand a = -wallisLaplaceKernel (2 * a) := by by_cases ha : a = 0 · simp [wallisRadiusIntegrand, wallisLaplaceKernel, ha] · have hexp : Real.exp (-2 * a) = Real.exp (-a) / Real.exp a := by rw [← Real.exp_sub] congr 1 ring have hplus : Real.exp a + Real.exp (-a) ≠ 0 := by positivity have hratio : 1 + Real.exp (-a) / Real.exp a ≠ 0 := by positivity unfold wallisRadiusIntegrand wallisLaplaceKernel rw [Real.tanh_eq a] simp only [show -(2 * a) = -2 * a by ring] rw [hexp] field_simp [ha, (Real.exp_pos a).ne', hplus, hratio] theorem integral_wallisRadiusIntegrand : (∫ a in Set.Ioi (0 : ℝ), wallisRadiusIntegrand a) = -(1 / 2 : ℝ) * Real.log (Real.pi / 2) := by have hscale : (∫ a in Set.Ioi (0 : ℝ), wallisLaplaceKernel (2 * a)) = (2 : ℝ)⁻¹ * Real.log (Real.pi / 2) := by simpa [smul_eq_mul, integral_wallisLaplaceKernel] using! (integral_comp_mul_left_Ioi wallisLaplaceKernel 0 (by norm_num : (0 : ℝ) < 2)) calc (∫ a in Set.Ioi (0 : ℝ), wallisRadiusIntegrand a) = ∫ a in Set.Ioi (0 : ℝ), -wallisLaplaceKernel (2 * a) := by apply setIntegral_congr_fun measurableSet_Ioi intro a _ exact wallisRadiusIntegrand_eq_laplace a _ = -(∫ a in Set.Ioi (0 : ℝ), wallisLaplaceKernel (2 * a)) := by rw [integral_neg] _ = -(1 / 2 : ℝ) * Real.log (Real.pi / 2) := by rw [hscale] ring def limitingSaddleRadius (ε : ℝ) : ℝ := Real.sqrt ((2 + ε / 4) / (4 * Real.pi)) * Real.exp (shortShellRadiusContribution ε + positiveShellRadiusContribution ε) theorem tendsto_limitingSaddleRadius_wallisIntegral : Tendsto limitingSaddleRadius (𝓝[>] (0 : ℝ)) (nhds (Real.sqrt (1 / (2 * Real.pi)) * Real.exp (∫ a in Set.Ioi (0 : ℝ), wallisRadiusIntegrand a))) := by have hε : Tendsto (fun ε : ℝ => ε) (𝓝[>] (0 : ℝ)) (nhds 0) := tendsto_id.mono_left (nhdsWithin_le_nhds (s := Set.Ioi (0 : ℝ))) have hnum : Tendsto (fun ε : ℝ => 2 + ε / 4) (𝓝[>] (0 : ℝ)) (nhds (2 : ℝ)) := by simpa using! (tendsto_const_nhds (x := (2 : ℝ))).add (hε.div_const 4) have hratio : Tendsto (fun ε : ℝ => (2 + ε / 4) / (4 * Real.pi)) (𝓝[>] (0 : ℝ)) (nhds (1 / (2 * Real.pi))) := by have hvalue : (2 : ℝ) / (4 * Real.pi) = 1 / (2 * Real.pi) := by field_simp [Real.pi_ne_zero] norm_num simpa only [hvalue] using! hnum.div_const (4 * Real.pi) have hfactor : Tendsto (fun ε : ℝ => Real.sqrt ((2 + ε / 4) / (4 * Real.pi))) (𝓝[>] (0 : ℝ)) (nhds (Real.sqrt (1 / (2 * Real.pi)))) := Real.continuous_sqrt.continuousAt.tendsto.comp hratio have hshell : Tendsto (fun ε : ℝ => shortShellRadiusContribution ε + positiveShellRadiusContribution ε) (𝓝[>] (0 : ℝ)) (nhds (∫ a in Set.Ioi (0 : ℝ), wallisRadiusIntegrand a)) := by simpa using! tendsto_shortShellRadiusContribution.add tendsto_positiveShellRadiusContribution exact hfactor.mul hshell.rexp theorem saddleRadius_wallis_constant : Real.sqrt (1 / (2 * Real.pi)) * Real.exp (-(1 / 2 : ℝ) * Real.log (Real.pi / 2)) = criticalRadius := by have hhalfpi : 0 < Real.pi / 2 := by positivity have hexpsq : (Real.exp (-(1 / 2 : ℝ) * Real.log (Real.pi / 2))) ^ 2 = (Real.pi / 2)⁻¹ := by calc (Real.exp (-(1 / 2 : ℝ) * Real.log (Real.pi / 2))) ^ 2 = Real.exp (-(1 / 2 : ℝ) * Real.log (Real.pi / 2) + -(1 / 2 : ℝ) * Real.log (Real.pi / 2)) := by rw [Real.exp_add] ring _ = Real.exp (-Real.log (Real.pi / 2)) := by congr 1 ring _ = (Real.pi / 2)⁻¹ := by rw [Real.exp_neg, Real.exp_log hhalfpi] have hsquare : (Real.sqrt (1 / (2 * Real.pi)) * Real.exp (-(1 / 2 : ℝ) * Real.log (Real.pi / 2))) ^ 2 = (Real.pi⁻¹) ^ 2 := by rw [mul_pow, Real.sq_sqrt (by positivity), hexpsq] field_simp [Real.pi_ne_zero] have hleft : 0 ≤ Real.sqrt (1 / (2 * Real.pi)) * Real.exp (-(1 / 2 : ℝ) * Real.log (Real.pi / 2)) := by positivity have hright : 0 ≤ Real.pi⁻¹ := (inv_pos.mpr Real.pi_pos).le unfold criticalRadius nlinarith theorem tendsto_limitingSaddleRadius : Tendsto limitingSaddleRadius (𝓝[>] (0 : ℝ)) (nhds criticalRadius) := by have h := tendsto_limitingSaddleRadius_wallisIntegral rw [integral_wallisRadiusIntegrand] at h simpa only [saddleRadius_wallis_constant] using! h end noncomputable section open Filter Function MeasureTheory Metric Set open scoped FourierTransform SchwartzMap Topology ENNReal def radialL1Mass {d : ℕ} (g : TestFunction d) : ℝ := ∫ x : Euclidean d, ‖g x‖ theorem radialL1Mass_pos {d : ℕ} (g : TestFunction d) (hg : g ≠ 0) : 0 < radialL1Mass g := by obtain ⟨x, hx⟩ : ∃ x : Euclidean d, g x ≠ 0 := by by_contra h push Not at h apply hg ext x simpa using! h x unfold radialL1Mass exact integral_pos_of_integrable_nonneg_nonzero g.continuous.norm g.integrable.norm (fun _ => norm_nonneg _) (norm_ne_zero_iff.mpr hx) theorem integral_scaled_exp_change_Ioi {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {R : ℝ} (hR : 0 < R) (f : ℝ → E) : (∫ r : ℝ in Ioi 0, f r) = ∫ v : ℝ, (R * Real.exp v) • f (R * Real.exp v) := by let F : ℝ → ℝ := fun v => R * Real.exp v have himage : F '' (Set.univ : Set ℝ) = Ioi 0 := by ext r constructor · rintro ⟨v, _, rfl⟩ exact mul_pos hR (Real.exp_pos v) · intro hr refine ⟨Real.log (r / R), Set.mem_univ _, ?_⟩ try dsimp [F] rw [Real.exp_log (div_pos hr hR)] field_simp have hderiv : ∀ x ∈ (Set.univ : Set ℝ), HasDerivWithinAt F (R * Real.exp x) Set.univ x := by intro x _ exact ((Real.hasDerivAt_exp x).const_mul R).hasDerivWithinAt have hinj : Set.InjOn F (Set.univ : Set ℝ) := by intro x _ y _ hxy exact Real.exp_injective (mul_left_cancel₀ hR.ne' hxy) have h := integral_image_eq_integral_abs_deriv_smul (f := F) (f' := fun x => R * Real.exp x) MeasurableSet.univ hderiv hinj f simpa [himage, F, abs_of_pos (mul_pos hR (Real.exp_pos _))] using! h theorem integrable_scaled_exp_change_Ioi {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {R : ℝ} (hR : 0 < R) (f : ℝ → E) : IntegrableOn f (Ioi 0) ↔ Integrable (fun v : ℝ => (R * Real.exp v) • f (R * Real.exp v)) := by let F : ℝ → ℝ := fun v => R * Real.exp v have himage : F '' (Set.univ : Set ℝ) = Ioi 0 := by ext r constructor · rintro ⟨v, _, rfl⟩ exact mul_pos hR (Real.exp_pos v) · intro hr refine ⟨Real.log (r / R), Set.mem_univ _, ?_⟩ try dsimp [F] rw [Real.exp_log (div_pos hr hR)] field_simp have hderiv : ∀ x ∈ (Set.univ : Set ℝ), HasDerivWithinAt F (R * Real.exp x) Set.univ x := by intro x _ exact ((Real.hasDerivAt_exp x).const_mul R).hasDerivWithinAt have hinj : Set.InjOn F (Set.univ : Set ℝ) := by intro x _ y _ hxy exact Real.exp_injective (mul_left_cancel₀ hR.ne' hxy) simpa [himage, F, abs_of_pos (mul_pos hR (Real.exp_pos _))] using! (integrableOn_image_iff_integrableOn_abs_deriv_smul (f := F) (f' := fun x => R * Real.exp x) MeasurableSet.univ hderiv hinj f) theorem radialL1Mass_eq {d : ℕ} (hd : 0 < d) (g : TestFunction d) (hg : IsRadial g) : radialL1Mass g = radialSurfaceArea d * ∫ r : ℝ in Ioi 0, r ^ (d - 1) * ‖radialProfile hd g r‖ := by letI : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd unfold radialL1Mass calc (∫ x : Euclidean d, ‖g x‖) = ∫ x : Euclidean d, ‖radialProfile hd g ‖x‖‖ := by apply integral_congr_ae filter_upwards [] with x rw [radialProfile_norm hd g hg x] _ = radialSurfaceArea d * ∫ r : ℝ in Ioi 0, r ^ (d - 1) * ‖radialProfile hd g r‖ := by simpa [radialSurfaceArea, volume_real_unitBall hd, nsmul_eq_mul, finrank_euclideanSpace_fin, mul_assoc, smul_eq_mul] using! (integral_fun_norm_addHaar (volume : Measure (Euclidean d)) (fun r : ℝ => ‖radialProfile hd g r‖)) def normalizedRadialLogProfile {d : ℕ} (hd : 0 < d) (g : TestFunction d) (R v : ℝ) : ℝ := radialSurfaceArea d / radialL1Mass g * (R * Real.exp v) ^ d * (radialProfile hd g (R * Real.exp v)).re theorem norm_radialProfile_eq_abs_re {d : ℕ} (hd : 0 < d) (g : TestFunction d) (hg : IsRealValued g) (r : ℝ) : ‖radialProfile hd g r‖ = |(radialProfile hd g r).re| := by have hvalue : radialProfile hd g r = ((radialProfile hd g r).re : ℂ) := by apply Complex.ext · simp · simpa using! radialProfile_real hd g hg r calc ‖radialProfile hd g r‖ = ‖((radialProfile hd g r).re : ℂ)‖ := congrArg Norm.norm hvalue _ = |(radialProfile hd g r).re| := by simp [Complex.norm_real, Real.norm_eq_abs] theorem radialProfile_re_weight_integrable {d : ℕ} (hd : 0 < d) (g : TestFunction d) (hg : IsRadial g) : IntegrableOn (fun r : ℝ => r ^ (d - 1) * (radialProfile hd g r).re) (Ioi 0) := by letI : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd have hre : Integrable (fun x : Euclidean d => (radialProfile hd g ‖x‖).re) := by apply g.integrable.re.congr filter_upwards [] with x change (g x).re = (radialProfile hd g ‖x‖).re rw [radialProfile_norm hd g hg x] simpa [finrank_euclideanSpace_fin, smul_eq_mul] using! (integrable_fun_norm_addHaar (volume : Measure (Euclidean d)) (f := fun r : ℝ => (radialProfile hd g r).re)).mp hre theorem integral_radialProfile_re {d : ℕ} (hd : 0 < d) (g : TestFunction d) (hg : IsRadial g) : (∫ x : Euclidean d, (g x).re) = radialSurfaceArea d * ∫ r : ℝ in Ioi 0, r ^ (d - 1) * (radialProfile hd g r).re := by letI : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd calc (∫ x : Euclidean d, (g x).re) = ∫ x : Euclidean d, (radialProfile hd g ‖x‖).re := by apply integral_congr_ae filter_upwards [] with x rw [radialProfile_norm hd g hg x] _ = radialSurfaceArea d * ∫ r : ℝ in Ioi 0, r ^ (d - 1) * (radialProfile hd g r).re := by simpa [radialSurfaceArea, volume_real_unitBall hd, nsmul_eq_mul, finrank_euclideanSpace_fin, mul_assoc, smul_eq_mul] using! (integral_fun_norm_addHaar (volume : Measure (Euclidean d)) (fun r : ℝ => (radialProfile hd g r).re)) theorem radialLogRadius_pow {d : ℕ} (hd : 0 < d) (r : ℝ) : r ^ d = r * r ^ (d - 1) := by have hindex : d - 1 + 1 = d := Nat.sub_add_cancel hd conv_lhs => rw [← hindex, pow_succ] ring theorem normalizedRadialLogProfile_eq {d : ℕ} (hd : 0 < d) (g : TestFunction d) (R v : ℝ) : normalizedRadialLogProfile hd g R v = (radialSurfaceArea d / radialL1Mass g) * ((R * Real.exp v) * ((R * Real.exp v) ^ (d - 1) * (radialProfile hd g (R * Real.exp v)).re)) := by unfold normalizedRadialLogProfile rw [radialLogRadius_pow hd] ring theorem normalizedRadialLogProfile_integrable {d : ℕ} (hd : 0 < d) (g : TestFunction d) (hg : IsRadial g) {R : ℝ} (hR : 0 < R) : Integrable (normalizedRadialLogProfile hd g R) := by have hweight := radialProfile_re_weight_integrable hd g hg have hexp := (integrable_scaled_exp_change_Ioi hR (fun r : ℝ => r ^ (d - 1) * (radialProfile hd g r).re)).mp hweight have hscaled := hexp.const_mul (radialSurfaceArea d / radialL1Mass g) apply hscaled.congr filter_upwards [] with v simpa [smul_eq_mul] using! (normalizedRadialLogProfile_eq hd g R v).symm theorem integral_normalizedRadialLogProfile {d : ℕ} (hd : 0 < d) (g : TestFunction d) (hg : IsRadial g) {R : ℝ} (hR : 0 < R) : (∫ v : ℝ, normalizedRadialLogProfile hd g R v) = (∫ x : Euclidean d, (g x).re) / radialL1Mass g := by calc (∫ v : ℝ, normalizedRadialLogProfile hd g R v) = ∫ v : ℝ, (radialSurfaceArea d / radialL1Mass g) * ((R * Real.exp v) * ((R * Real.exp v) ^ (d - 1) * (radialProfile hd g (R * Real.exp v)).re)) := by apply integral_congr_ae filter_upwards [] with v exact normalizedRadialLogProfile_eq hd g R v _ = (radialSurfaceArea d / radialL1Mass g) * ∫ v : ℝ, (R * Real.exp v) * ((R * Real.exp v) ^ (d - 1) * (radialProfile hd g (R * Real.exp v)).re) := by rw [integral_const_mul] _ = (radialSurfaceArea d / radialL1Mass g) * ∫ r : ℝ in Ioi 0, r ^ (d - 1) * (radialProfile hd g r).re := by rw [integral_scaled_exp_change_Ioi hR (fun r : ℝ => r ^ (d - 1) * (radialProfile hd g r).re)] simp [smul_eq_mul] _ = (∫ x : Euclidean d, (g x).re) / radialL1Mass g := by rw [integral_radialProfile_re hd g hg] ring theorem abs_normalizedRadialLogProfile {d : ℕ} (hd : 0 < d) (g : TestFunction d) (hreal : IsRealValued g) (hnonzero : g ≠ 0) {R : ℝ} (hR : 0 < R) (v : ℝ) : |normalizedRadialLogProfile hd g R v| = (radialSurfaceArea d / radialL1Mass g) * ((R * Real.exp v) * ((R * Real.exp v) ^ (d - 1) * ‖radialProfile hd g (R * Real.exp v)‖)) := by have hcoefficient : 0 < radialSurfaceArea d / radialL1Mass g := div_pos (radialSurfaceArea_pos hd) (radialL1Mass_pos g hnonzero) have hradius : 0 < R * Real.exp v := mul_pos hR (Real.exp_pos v) calc |normalizedRadialLogProfile hd g R v| = |radialSurfaceArea d / radialL1Mass g| * |(R * Real.exp v) ^ d| * |(radialProfile hd g (R * Real.exp v)).re| := by simp [normalizedRadialLogProfile, abs_mul, mul_assoc] _ = (radialSurfaceArea d / radialL1Mass g) * ((R * Real.exp v) * ((R * Real.exp v) ^ (d - 1) * ‖radialProfile hd g (R * Real.exp v)‖)) := by rw [abs_of_pos hcoefficient, abs_pow, abs_of_pos hradius, ← norm_radialProfile_eq_abs_re hd g hreal, radialLogRadius_pow hd] ring theorem integral_abs_normalizedRadialLogProfile {d : ℕ} (hd : 0 < d) (g : TestFunction d) (hradial : IsRadial g) (hreal : IsRealValued g) (hnonzero : g ≠ 0) {R : ℝ} (hR : 0 < R) : (∫ v : ℝ, |normalizedRadialLogProfile hd g R v|) = 1 := by have hmass : 0 < radialL1Mass g := radialL1Mass_pos g hnonzero calc (∫ v : ℝ, |normalizedRadialLogProfile hd g R v|) = ∫ v : ℝ, (radialSurfaceArea d / radialL1Mass g) * ((R * Real.exp v) * ((R * Real.exp v) ^ (d - 1) * ‖radialProfile hd g (R * Real.exp v)‖)) := by apply integral_congr_ae filter_upwards [] with v exact abs_normalizedRadialLogProfile hd g hreal hnonzero hR v _ = (radialSurfaceArea d / radialL1Mass g) * ∫ v : ℝ, (R * Real.exp v) * ((R * Real.exp v) ^ (d - 1) * ‖radialProfile hd g (R * Real.exp v)‖) := by rw [integral_const_mul] _ = (radialSurfaceArea d / radialL1Mass g) * ∫ r : ℝ in Ioi 0, r ^ (d - 1) * ‖radialProfile hd g r‖ := by rw [integral_scaled_exp_change_Ioi hR (fun r : ℝ => r ^ (d - 1) * ‖radialProfile hd g r‖)] simp [smul_eq_mul] _ = (radialSurfaceArea d * ∫ r : ℝ in Ioi 0, r ^ (d - 1) * ‖radialProfile hd g r‖) / radialL1Mass g := by ring _ = 1 := by rw [← radialL1Mass_eq hd g hradial] exact div_self hmass.ne' theorem integral_re_eq_zero_of_antiFourier {d : ℕ} (g : TestFunction d) (hanti : (𝓕 g : TestFunction d) = -g) (hzero : g (0 : Euclidean d) = 0) : (∫ x : Euclidean d, (g x).re) = 0 := by have hfourierzero : ((𝓕 g : TestFunction d) (0 : Euclidean d)) = 0 := by rw [hanti] simpa using! hzero have hfourier_integral : ((𝓕 g : TestFunction d) (0 : Euclidean d)) = ∫ x : Euclidean d, g x := by change (𝓕 (g : Euclidean d → ℂ)) 0 = _ rw [Real.fourier_eq'] simp calc (∫ x : Euclidean d, (g x).re) = (∫ x : Euclidean d, g x).re := integral_re g.integrable _ = ((𝓕 g : TestFunction d) (0 : Euclidean d)).re := by rw [hfourier_integral] _ = 0 := by rw [hfourierzero] rfl theorem integral_normalizedRadialLogProfile_eq_zero_of_antiFourier {d : ℕ} (hd : 0 < d) (g : TestFunction d) (hradial : IsRadial g) (hanti : (𝓕 g : TestFunction d) = -g) (hzero : g (0 : Euclidean d) = 0) {R : ℝ} (hR : 0 < R) : (∫ v : ℝ, normalizedRadialLogProfile hd g R v) = 0 := by rw [integral_normalizedRadialLogProfile hd g hradial hR, integral_re_eq_zero_of_antiFourier g hanti hzero] simp theorem normalizedRadialLogProfile_nonneg_of_exterior {d : ℕ} (hd : 0 < d) (g : TestFunction d) (hnonzero : g ≠ 0) {R : ℝ} (hR : 0 < R) (houtside : ∀ x : Euclidean d, R ≤ ‖x‖ → 0 ≤ (g x).re) (v : ℝ) (hv : 0 ≤ v) : 0 ≤ normalizedRadialLogProfile hd g R v := by have hexp : 1 ≤ Real.exp v := Real.one_le_exp_iff.mpr hv have hradius : 0 < R * Real.exp v := mul_pos hR (Real.exp_pos v) have hpoint : R ≤ ‖(R * Real.exp v) • radialUnitDirection hd‖ := by rw [norm_smul, norm_radialUnitDirection hd, mul_one, Real.norm_eq_abs, abs_of_pos hradius] calc R = R * 1 := (mul_one R).symm _ ≤ R * Real.exp v := mul_le_mul_of_nonneg_left hexp hR.le unfold normalizedRadialLogProfile refine mul_nonneg (mul_nonneg ?_ (pow_nonneg hradius.le _)) ?_ · exact (div_pos (radialSurfaceArea_pos hd) (radialL1Mass_pos g hnonzero)).le · exact houtside _ hpoint theorem antiFourierWitness_normalizedRadialLogProfile {d : ℕ} (hd : 0 < d) {R : ℝ} (hR : 0 < R) (w : AntiFourierWitness d R) : let φ := normalizedRadialLogProfile hd w.function R Integrable φ ∧ (∫ v : ℝ, φ v) = 0 ∧ (∫ v : ℝ, |φ v|) = 1 ∧ (∀ v : ℝ, 0 ≤ v → 0 ≤ φ v) := by try dsimp refine ⟨normalizedRadialLogProfile_integrable hd w.function w.radial hR, ?_, ?_, ?_⟩ · exact integral_normalizedRadialLogProfile_eq_zero_of_antiFourier hd w.function w.radial w.anti_fourier w.zero_value hR · exact integral_abs_normalizedRadialLogProfile hd w.function w.radial w.real w.nonzero hR · intro v hv exact normalizedRadialLogProfile_nonneg_of_exterior hd w.function w.nonzero hR w.eventually_nonneg v hv end noncomputable section open Asymptotics Filter Function MeasureTheory Metric Set open scoped FourierTransform SchwartzMap Topology def radialLineIsometry {d : ℕ} (hd : 0 < d) : ℝ →ₗᵢ[ℝ] Euclidean d := LinearIsometry.toSpanSingleton ℝ (Euclidean d) (norm_radialUnitDirection hd) def radialSchwartzProfile {d : ℕ} (hd : 0 < d) (f : TestFunction d) : 𝓢(ℝ, ℂ) := SchwartzMap.compCLMOfAntilipschitz ℂ (radialLineIsometry hd).toContinuousLinearMap.hasTemperateGrowth (radialLineIsometry hd).isometry.antilipschitz f @[simp] theorem radialSchwartzProfile_apply {d : ℕ} (hd : 0 < d) (f : TestFunction d) (r : ℝ) : radialSchwartzProfile hd f r = radialProfile hd f r := by rfl theorem radialProfile_smooth {d : ℕ} (hd : 0 < d) (f : TestFunction d) (n : ℕ∞) : ContDiff ℝ n (radialProfile hd f) := by simpa using! (radialSchwartzProfile hd f).smooth n theorem radialProfile_deriv_zero {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) : deriv (radialProfile hd f) 0 = 0 := by have heven : (fun r : ℝ => radialProfile hd f (-r)) = radialProfile hd f := by funext r exact radialProfile_neg hd f hf r have hderiv := congrArg (fun h : ℝ → ℂ => deriv h 0) heven rw [deriv_comp_neg] at hderiv simp only [neg_zero] at hderiv linear_combination -hderiv / 2 theorem radialProfile_quadratic_bound {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (hzero : f (0 : Euclidean d) = 0) : ∃ C : ℝ, ∀ r : ℝ, 0 ≤ r → r ≤ 1 → ‖radialProfile hd f r‖ ≤ C * r ^ 2 := by have hsmooth : ContDiffOn ℝ (2 : ℕ∞) (radialProfile hd f) (Icc (0 : ℝ) 1) := (radialProfile_smooth hd f 2).contDiffOn obtain ⟨C, hC⟩ := exists_taylor_mean_remainder_bound (f := radialProfile hd f) (a := (0 : ℝ)) (b := (1 : ℝ)) (n := 1) zero_le_one hsmooth refine ⟨C, ?_⟩ intro r hr hrone have hderivWithin : derivWithin (radialProfile hd f) (Icc (0 : ℝ) 1) 0 = 0 := by rw [DifferentiableAt.derivWithin ((radialProfile_smooth hd f 1).differentiable one_ne_zero 0) (uniqueDiffOn_Icc_zero_one 0 (by simp))] exact radialProfile_deriv_zero hd f hf have htaylor : taylorWithinEval (radialProfile hd f) 1 (Icc (0 : ℝ) 1) 0 r = 0 := by rw [show (1 : ℕ) = 0 + 1 by rfl, taylorWithinEval_succ] simp [radialProfile_zero, hzero, iteratedDerivWithin_one, hderivWithin] calc ‖radialProfile hd f r‖ = ‖radialProfile hd f r - taylorWithinEval (radialProfile hd f) 1 (Icc (0 : ℝ) 1) 0 r‖ := by rw [htaylor, sub_zero] _ ≤ C * r ^ 2 := by simpa only [sub_zero, Nat.reduceAdd] using! hC r ⟨hr, hrone⟩ theorem radialProfile_isBigO_rpow_two_zero {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (hzero : f (0 : Euclidean d) = 0) : radialProfile hd f =O[𝓝[>] (0 : ℝ)] (fun r : ℝ => r ^ (2 : ℝ)) := by obtain ⟨C, hC⟩ := radialProfile_quadratic_bound hd f hf hzero apply IsBigO.of_bound C filter_upwards [eventually_mem_nhdsWithin, (eventually_lt_nhds (show (0 : ℝ) < 1 by norm_num)).filter_mono nhdsWithin_le_nhds] with r hr hrone rw [Real.norm_eq_abs, abs_of_nonneg (Real.rpow_nonneg hr.le 2), Real.rpow_two] exact hC r hr.le hrone.le theorem radialProfile_isBigO_rpow_atTop {d : ℕ} (hd : 0 < d) (f : TestFunction d) (a : ℝ) : radialProfile hd f =O[atTop] (fun r : ℝ => r ^ (-a)) := by have hschwartz := (radialSchwartzProfile hd f).isBigO_cocompact_rpow (-a) have htop := hschwartz.mono atTop_le_cocompact refine htop.congr' (Eventually.of_forall (fun r : ℝ => radialSchwartzProfile_apply hd f r)) ?_ filter_upwards [eventually_gt_atTop (0 : ℝ)] with r hr simp [Real.norm_eq_abs, abs_of_pos hr] theorem radialProfile_locallyIntegrableOn {d : ℕ} (hd : 0 < d) (f : TestFunction d) : LocallyIntegrableOn (radialProfile hd f) (Ioi (0 : ℝ)) := (radialProfile_continuous hd f).locallyIntegrable.locallyIntegrableOn _ theorem radialProfile_mellinConvergent {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (hzero : f (0 : Euclidean d) = 0) (s : ℂ) (hs : -2 < s.re) : MellinConvergent (radialProfile hd f) s := by apply mellinConvergent_of_isBigO_rpow (a := s.re + 1) (b := (-2 : ℝ)) (radialProfile_locallyIntegrableOn hd f) (radialProfile_isBigO_rpow_atTop hd f (s.re + 1)) (by linarith) · simpa using! radialProfile_isBigO_rpow_two_zero hd f hf hzero · exact hs theorem radialProfile_mellin_differentiableAt {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (hzero : f (0 : Euclidean d) = 0) (s : ℂ) (hs : -2 < s.re) : DifferentiableAt ℂ (mellin (radialProfile hd f)) s := by apply mellin_differentiableAt_of_isBigO_rpow (a := s.re + 1) (b := (-2 : ℝ)) (radialProfile_locallyIntegrableOn hd f) (radialProfile_isBigO_rpow_atTop hd f (s.re + 1)) (by linarith) · simpa using! radialProfile_isBigO_rpow_two_zero hd f hf hzero · exact hs def radialMellinStrip {d : ℕ} (hd : 0 < d) (f : TestFunction d) (z : ℂ) : ℂ := mellin (radialProfile hd f) ((d : ℂ) / 2 - Complex.I * z) theorem radialMellinStrip_differentiableAt {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (hzero : f (0 : Euclidean d) = 0) (z : ℂ) (hz : -(d : ℝ) / 2 - 2 < z.im) : DifferentiableAt ℂ (radialMellinStrip hd f) z := by have hs : -2 < (((d : ℂ) / 2 - Complex.I * z).re) := by norm_num linarith change DifferentiableAt ℂ (fun w : ℂ => mellin (radialProfile hd f) ((d : ℂ) / 2 - Complex.I * w)) z let F : ℂ → ℂ := mellin (radialProfile hd f) let A : ℂ → ℂ := fun w => (d : ℂ) / 2 - Complex.I * w have houter : DifferentiableAt ℂ F (A z) := radialProfile_mellin_differentiableAt hd f hf hzero ((d : ℂ) / 2 - Complex.I * z) hs have hinner : DifferentiableAt ℂ A z := by try dsimp [A] fun_prop have hcomp : DifferentiableAt ℂ (F ∘ A) z := houter.comp z hinner exact hcomp theorem radialMellinStrip_diffContOnCl {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (hzero : f (0 : Euclidean d) = 0) : DiffContOnCl ℂ (radialMellinStrip hd f) (Complex.im ⁻¹' Ioo (-((d : ℝ) / 2)) ((d : ℝ) / 2)) := by have hhalf : 0 < (d : ℝ) / 2 := by exact half_pos (Nat.cast_pos.mpr hd) apply DifferentiableOn.diffContOnCl intro z hz rw [Complex.closure_preimage_im, closure_Ioo (ne_of_lt (neg_lt_self hhalf))] at hz apply (radialMellinStrip_differentiableAt hd f hf hzero z (by linarith [hz.1])).differentiableWithinAt def normalizedRadialMellinStrip {d : ℕ} (hd : 0 < d) (f : TestFunction d) (R : ℝ) (z : ℂ) : ℂ := (radialSurfaceArea d / radialL1Mass f : ℝ) * Complex.exp (((d : ℂ) / 2 + Complex.I * z) * (Real.log R : ℂ)) * radialMellinStrip hd f z theorem normalizedRadialMellinStrip_diffContOnCl {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (hzero : f (0 : Euclidean d) = 0) (R : ℝ) : DiffContOnCl ℂ (normalizedRadialMellinStrip hd f R) (Complex.im ⁻¹' Ioo (-((d : ℝ) / 2)) ((d : ℝ) / 2)) := by have hstrip := radialMellinStrip_diffContOnCl hd f hf hzero have hfactor : Differentiable ℂ (fun z : ℂ => (radialSurfaceArea d / radialL1Mass f : ℝ) * Complex.exp (((d : ℂ) / 2 + Complex.I * z) * (Real.log R : ℂ))) := by fun_prop exact ⟨hfactor.differentiableOn.mul hstrip.differentiableOn, hfactor.continuous.continuousOn.mul hstrip.continuousOn⟩ theorem norm_nonnegative_imaginary_cpow_le_one (r t : ℝ) (hr : 0 ≤ r) : ‖(r : ℂ) ^ (-(Complex.I * (t : ℂ)))‖ ≤ 1 := by rcases eq_or_lt_of_le hr with rfl | hrpos · by_cases ht : t = 0 · simp [ht] · have hexponent : -(Complex.I * (t : ℂ)) ≠ 0 := by exact neg_ne_zero.mpr (mul_ne_zero Complex.I_ne_zero (Complex.ofReal_ne_zero.mpr ht)) change ‖(0 : ℂ) ^ (-(Complex.I * (t : ℂ)))‖ ≤ 1 rw [Complex.zero_cpow hexponent] simp · rw [Complex.norm_cpow_eq_rpow_re_of_pos hrpos] norm_num theorem schwartz_imaginaryRiesz_integrable {d : ℕ} (hd : 0 < d) (f : TestFunction d) (t : ℝ) : Integrable (fun x : Euclidean d => f x * (‖x‖ : ℂ) ^ (-(Complex.I * (t : ℂ)))) := by apply schwartz_mul_norm_cpow_integrable hd f (-(Complex.I * (t : ℂ))) · norm_num exact Nat.cast_pos.mpr hd · norm_num theorem norm_schwartz_imaginaryRiesz_integral_le_L1 {d : ℕ} (hd : 0 < d) (f : TestFunction d) (t : ℝ) : ‖∫ x : Euclidean d, f x * (‖x‖ : ℂ) ^ (-(Complex.I * (t : ℂ)))‖ ≤ radialL1Mass f := by calc ‖∫ x : Euclidean d, f x * (‖x‖ : ℂ) ^ (-(Complex.I * (t : ℂ)))‖ ≤ ∫ x : Euclidean d, ‖f x * (‖x‖ : ℂ) ^ (-(Complex.I * (t : ℂ)))‖ := norm_integral_le_integral_norm _ _ ≤ ∫ x : Euclidean d, ‖f x‖ := by apply integral_mono (schwartz_imaginaryRiesz_integrable hd f t).norm f.integrable.norm intro x try dsimp rw [norm_mul] calc ‖f x‖ * ‖(‖x‖ : ℂ) ^ (-(Complex.I * (t : ℂ)))‖ ≤ ‖f x‖ * 1 := mul_le_mul_of_nonneg_left (norm_nonnegative_imaginary_cpow_le_one ‖x‖ t (norm_nonneg x)) (norm_nonneg _) _ = ‖f x‖ := mul_one _ _ = radialL1Mass f := rfl theorem normalizedRadialMellinStrip_top_norm_le_one {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (hnonzero : f ≠ 0) (R : ℝ) (y : ℝ) : ‖normalizedRadialMellinStrip hd f R ((y : ℂ) + Complex.I * (((d : ℝ) / 2 : ℝ) : ℂ))‖ ≤ 1 := by let z : ℂ := (y : ℂ) + Complex.I * (((d : ℝ) / 2 : ℝ) : ℂ) let s : ℂ := (d : ℂ) - Complex.I * (y : ℂ) have hmass : 0 < radialL1Mass f := radialL1Mass_pos f hnonzero have hsurface : 0 < radialSurfaceArea d := radialSurfaceArea_pos hd have hmellin : (d : ℂ) / 2 - Complex.I * z = s := by try dsimp [z, s] push_cast simp [mul_add, ← mul_assoc, Complex.I_mul_I]; ring have hphase : ((((d : ℂ) / 2 + Complex.I * z) * (Real.log R : ℂ))).re = 0 := by try dsimp [z] push_cast norm_num have hpolar : (∫ x : Euclidean d, f x * (‖x‖ : ℂ) ^ (-(Complex.I * (y : ℂ)))) = radialSurfaceArea d • mellin (radialProfile hd f) s := by have hexponent : s - (d : ℂ) = -(Complex.I * (y : ℂ)) := by try dsimp [s] ring simpa only [hexponent] using! integral_radialProfile_cpow hd f hf s have hbound : radialSurfaceArea d * ‖mellin (radialProfile hd f) s‖ ≤ radialL1Mass f := by calc radialSurfaceArea d * ‖mellin (radialProfile hd f) s‖ = ‖radialSurfaceArea d • mellin (radialProfile hd f) s‖ := by rw [norm_smul, Real.norm_eq_abs, abs_of_pos hsurface] _ = ‖∫ x : Euclidean d, f x * (‖x‖ : ℂ) ^ (-(Complex.I * (y : ℂ)))‖ := by rw [hpolar] _ ≤ radialL1Mass f := norm_schwartz_imaginaryRiesz_integral_le_L1 hd f y change ‖normalizedRadialMellinStrip hd f R z‖ ≤ 1 calc ‖normalizedRadialMellinStrip hd f R z‖ = (radialSurfaceArea d / radialL1Mass f) * ‖mellin (radialProfile hd f) s‖ := by unfold normalizedRadialMellinStrip radialMellinStrip rw [norm_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos (div_pos hsurface hmass), Complex.norm_exp, hphase, Real.exp_zero, hmellin] ring _ = (radialSurfaceArea d * ‖mellin (radialProfile hd f) s‖) / radialL1Mass f := by ring _ ≤ 1 := (div_le_one hmass).mpr hbound theorem radial_fourier_mellin_regularized_closed {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (hzero : f (0 : Euclidean d) = 0) (hhatZero : (𝓕 f : TestFunction d) (0 : Euclidean d) = 0) (s : ℂ) (hs : 0 ≤ s.re) (hsd : s.re ≤ (d : ℝ)) : mellin (radialProfile hd (𝓕 f : TestFunction d)) s * (Complex.Gamma (s / 2))⁻¹ = (Real.pi : ℂ) ^ ((d : ℂ) / 2 - s) * (mellin (radialProfile hd f) ((d : ℂ) - s) * (Complex.Gamma (((d : ℂ) - s) / 2))⁻¹) := by let U : Set ℂ := Complex.re ⁻¹' Ioo (0 : ℝ) (d : ℝ) let T : Set ℂ := Complex.re ⁻¹' Icc (0 : ℝ) (d : ℝ) let L : ℂ → ℂ := fun w => mellin (radialProfile hd (𝓕 f : TestFunction d)) w * (Complex.Gamma (w / 2))⁻¹ let G : ℂ → ℂ := fun w => (Real.pi : ℂ) ^ ((d : ℂ) / 2 - w) * (mellin (radialProfile hd f) ((d : ℂ) - w) * (Complex.Gamma (((d : ℂ) - w) / 2))⁻¹) have hinv : Continuous (fun w : ℂ => (Complex.Gamma w)⁻¹) := Complex.differentiable_one_div_Gamma.continuous have hhat : ContinuousOn (fun w : ℂ => mellin (radialProfile hd (𝓕 f : TestFunction d)) w) T := by intro w hw change 0 ≤ w.re ∧ w.re ≤ (d : ℝ) at hw exact (radialProfile_mellin_differentiableAt hd (𝓕 f : TestFunction d) (gaussianMellin_fourier_radial hf) hhatZero w (by linarith [hw.1])).continuousAt.continuousWithinAt have hprimal : ContinuousOn (fun w : ℂ => mellin (radialProfile hd f) ((d : ℂ) - w)) T := by intro w hw change 0 ≤ w.re ∧ w.re ≤ (d : ℝ) at hw have hinner : ContinuousAt (fun v : ℂ => (d : ℂ) - v) w := by fun_prop have hre : -2 < (((d : ℂ) - w).re) := by norm_num linarith [hw.2] exact ((radialProfile_mellin_differentiableAt hd f hf hzero ((d : ℂ) - w) hre).continuousAt.comp hinner).continuousWithinAt have hL : ContinuousOn L T := by try dsimp [L] exact hhat.mul (hinv.comp (continuous_id.div_const (2 : ℂ))).continuousOn have hpi : Continuous (fun w : ℂ => (Real.pi : ℂ) ^ ((d : ℂ) / 2 - w)) := by exact (continuous_const.sub continuous_id).const_cpow (Or.inl (Complex.ofReal_ne_zero.mpr Real.pi_ne_zero)) have hG : ContinuousOn G T := by try dsimp [G] exact hpi.continuousOn.mul (hprimal.mul (hinv.comp ((continuous_const.sub continuous_id).div_const (2 : ℂ))).continuousOn) have heq : Set.EqOn L G U := by intro w hw change 0 < w.re ∧ w.re < (d : ℝ) at hw have hg₁ : Complex.Gamma (w / 2) ≠ 0 := by apply Complex.Gamma_ne_zero_of_re_pos norm_num linarith [hw.1] have hg₂ : Complex.Gamma (((d : ℂ) - w) / 2) ≠ 0 := by apply Complex.Gamma_ne_zero_of_re_pos norm_num linarith [hw.2] try dsimp [L, G] rw [radial_fourier_mellin_strip hd f hf w hw.1 hw.2] field_simp have hUT : U ⊆ T := by intro w hw exact ⟨hw.1.le, hw.2.le⟩ have hdreal : (0 : ℝ) < (d : ℝ) := Nat.cast_pos.mpr hd have hTU : T ⊆ closure U := by try dsimp [T, U] rw [Complex.closure_preimage_re, closure_Ioo (ne_of_lt hdreal)] exact heq.of_subset_closure hL hG hUT hTU ⟨hs, hsd⟩ theorem radial_fourier_mellin_antifourier_boundary {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (hzero : f (0 : Euclidean d) = 0) (hanti : (𝓕 f : TestFunction d) = -f) (y : ℝ) (hy : y ≠ 0) : Complex.Gamma (((d : ℝ) / 2 : ℝ) + Complex.I * (y : ℂ) / 2) * mellin (radialProfile hd f) (-(Complex.I * (y : ℂ))) = -((Real.pi : ℂ) ^ (((d : ℂ) / 2) + Complex.I * (y : ℂ)) * Complex.Gamma (-(Complex.I * (y : ℂ)) / 2) * mellin (radialProfile hd f) ((d : ℂ) + Complex.I * (y : ℂ))) := by let s : ℂ := -(Complex.I * (y : ℂ)) have hhatZero : (𝓕 f : TestFunction d) (0 : Euclidean d) = 0 := by rw [hanti] simpa using! congrArg Neg.neg hzero have hs : 0 ≤ s.re := by try dsimp [s] norm_num have hsd : s.re ≤ (d : ℝ) := by try dsimp [s] norm_num have hnum : Complex.Gamma (s / 2) ≠ 0 := by apply Complex.Gamma_ne_zero intro n hn have him := congrArg Complex.im hn try dsimp [s] at him norm_num at him apply hy linarith have hden : Complex.Gamma (((d : ℂ) - s) / 2) ≠ 0 := by apply Complex.Gamma_ne_zero_of_re_pos try dsimp [s] norm_num exact Nat.cast_pos.mpr hd have heq := radial_fourier_mellin_regularized_closed hd f hf hzero hhatZero s hs hsd have hprofile : mellin (radialProfile hd (𝓕 f : TestFunction d)) s = -(mellin (radialProfile hd f) s) := by rw [hanti] simp [radialProfile, mellin, integral_neg] rw [hprofile] at heq have hcross : Complex.Gamma (((d : ℂ) - s) / 2) * mellin (radialProfile hd f) s = -((Real.pi : ℂ) ^ ((d : ℂ) / 2 - s) * Complex.Gamma (s / 2) * mellin (radialProfile hd f) ((d : ℂ) - s)) := by field_simp [hnum, hden] at heq ⊢ linear_combination -heq convert! hcross using 1 <;> dsimp [s] <;> push_cast <;> ring_nf theorem radial_fourier_mellin_antifourier_boundary_norm {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (hzero : f (0 : Euclidean d) = 0) (hanti : (𝓕 f : TestFunction d) = -f) (y : ℝ) (hy : y ≠ 0) : ‖mellin (radialProfile hd f) (-(Complex.I * (y : ℂ)))‖ = Real.pi ^ ((d : ℝ) / 2) * (‖Complex.Gamma (-(Complex.I * (y : ℂ)) / 2)‖ / ‖Complex.Gamma (((d : ℝ) / 2 : ℝ) + Complex.I * (y : ℂ) / 2)‖) * ‖mellin (radialProfile hd f) ((d : ℂ) + Complex.I * (y : ℂ))‖ := by have hdenGamma : Complex.Gamma (((d : ℝ) / 2 : ℝ) + Complex.I * (y : ℂ) / 2) ≠ 0 := by apply Complex.Gamma_ne_zero_of_re_pos norm_num exact Nat.cast_pos.mpr hd have hden : ‖Complex.Gamma (((d : ℝ) / 2 : ℝ) + Complex.I * (y : ℂ) / 2)‖ ≠ 0 := norm_ne_zero_iff.mpr hdenGamma have hnorm := congrArg norm (radial_fourier_mellin_antifourier_boundary hd f hf hzero hanti y hy) simp only [norm_mul, norm_neg, Complex.norm_cpow_eq_rpow_re_of_pos Real.pi_pos] at hnorm norm_num at hnorm calc ‖mellin (radialProfile hd f) (-(Complex.I * (y : ℂ)))‖ = (Real.pi ^ ((d : ℝ) / 2) * ‖Complex.Gamma (-(Complex.I * (y : ℂ)) / 2)‖ * ‖mellin (radialProfile hd f) ((d : ℂ) + Complex.I * (y : ℂ))‖) / ‖Complex.Gamma (((d : ℝ) / 2 : ℝ) + Complex.I * (y : ℂ) / 2)‖ := by apply (eq_div_iff hden).2 push_cast convert! hnorm using 1; ring _ = Real.pi ^ ((d : ℝ) / 2) * (‖Complex.Gamma (-(Complex.I * (y : ℂ)) / 2)‖ / ‖Complex.Gamma (((d : ℝ) / 2 : ℝ) + Complex.I * (y : ℂ) / 2)‖) * ‖mellin (radialProfile hd f) ((d : ℂ) + Complex.I * (y : ℂ))‖ := by ring theorem normalizedRadialMellinStrip_top_norm_eq {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hnonzero : f ≠ 0) (R : ℝ) (y : ℝ) : ‖normalizedRadialMellinStrip hd f R ((y : ℂ) + Complex.I * (((d : ℝ) / 2 : ℝ) : ℂ))‖ = (radialSurfaceArea d / radialL1Mass f) * ‖mellin (radialProfile hd f) ((d : ℂ) - Complex.I * (y : ℂ))‖ := by let z : ℂ := (y : ℂ) + Complex.I * (((d : ℝ) / 2 : ℝ) : ℂ) have hmass : 0 < radialL1Mass f := radialL1Mass_pos f hnonzero have hsurface : 0 < radialSurfaceArea d := radialSurfaceArea_pos hd have hmellin : (d : ℂ) / 2 - Complex.I * z = (d : ℂ) - Complex.I * (y : ℂ) := by try dsimp [z] push_cast simp [mul_add, ← mul_assoc, Complex.I_mul_I]; ring have hphase : ((((d : ℂ) / 2 + Complex.I * z) * (Real.log R : ℂ))).re = 0 := by try dsimp [z] push_cast norm_num change ‖normalizedRadialMellinStrip hd f R z‖ = _ unfold normalizedRadialMellinStrip radialMellinStrip rw [norm_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos (div_pos hsurface hmass), Complex.norm_exp, hphase, Real.exp_zero, hmellin] ring theorem normalizedRadialMellinStrip_bottom_norm_eq {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hnonzero : f ≠ 0) (R : ℝ) (y : ℝ) : ‖normalizedRadialMellinStrip hd f R ((y : ℂ) - Complex.I * (((d : ℝ) / 2 : ℝ) : ℂ))‖ = (radialSurfaceArea d / radialL1Mass f) * Real.exp ((d : ℝ) * Real.log R) * ‖mellin (radialProfile hd f) (-(Complex.I * (y : ℂ)))‖ := by let z : ℂ := (y : ℂ) - Complex.I * (((d : ℝ) / 2 : ℝ) : ℂ) have hmass : 0 < radialL1Mass f := radialL1Mass_pos f hnonzero have hsurface : 0 < radialSurfaceArea d := radialSurfaceArea_pos hd have hmellin : (d : ℂ) / 2 - Complex.I * z = -(Complex.I * (y : ℂ)) := by try dsimp [z] push_cast simp [mul_sub, ← mul_assoc, Complex.I_mul_I] have hphase : ((((d : ℂ) / 2 + Complex.I * z) * (Real.log R : ℂ))).re = (d : ℝ) * Real.log R := by try dsimp [z] push_cast norm_num change ‖normalizedRadialMellinStrip hd f R z‖ = _ unfold normalizedRadialMellinStrip radialMellinStrip rw [norm_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos (div_pos hsurface hmass), Complex.norm_exp, hphase, hmellin] theorem radialGammaBoundaryExponent_exp (d : ℕ) (R A B : ℝ) (hR : 0 < R) (hA : 0 < A) (hB : 0 < B) : Real.exp (((d : ℝ) / 2) * Real.log (Real.pi * R ^ 2) + Real.log A - Real.log B) = Real.exp ((d : ℝ) * Real.log R) * Real.pi ^ ((d : ℝ) / 2) * (A / B) := by have hlog : Real.log (Real.pi * R ^ 2) = Real.log Real.pi + 2 * Real.log R := by rw [Real.log_mul Real.pi_ne_zero (pow_ne_zero 2 hR.ne'), Real.log_pow] norm_num have hscale : Real.exp (((d : ℝ) / 2) * Real.log (Real.pi * R ^ 2)) = Real.exp ((d : ℝ) * Real.log R) * Real.pi ^ ((d : ℝ) / 2) := by rw [hlog, mul_add, Real.exp_add, Real.rpow_def_of_pos Real.pi_pos] have hdouble : ((d : ℝ) / 2) * (2 * Real.log R) = (d : ℝ) * Real.log R := by ring rw [hdouble] rw [show ((d : ℝ) / 2) * Real.log Real.pi = Real.log Real.pi * ((d : ℝ) / 2) by ring] ring rw [Real.exp_sub, Real.exp_add, Real.exp_log hA, Real.exp_log hB, hscale] ring theorem normalizedRadialMellinStrip_bottom_norm_le_gamma {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (hzero : f (0 : Euclidean d) = 0) (hanti : (𝓕 f : TestFunction d) = -f) (hnonzero : f ≠ 0) (R : ℝ) (hR : 0 < R) (y : ℝ) (hy : y ≠ 0) : ‖normalizedRadialMellinStrip hd f R ((y : ℂ) - Complex.I * (((d : ℝ) / 2 : ℝ) : ℂ))‖ ≤ Real.exp (((d : ℝ) / 2) * Real.log (Real.pi * R ^ 2) + Real.log ‖Complex.Gamma (-Complex.I * (y : ℂ) / 2)‖ - Real.log ‖Complex.Gamma (((d : ℝ) / 2 : ℝ) + Complex.I * (y : ℂ) / 2)‖) := by have hnumGamma : Complex.Gamma (-Complex.I * (y : ℂ) / 2) ≠ 0 := by apply Complex.Gamma_ne_zero intro n hn have him := congrArg Complex.im hn norm_num at him apply hy linarith have hdenGamma : Complex.Gamma (((d : ℝ) / 2 : ℝ) + Complex.I * (y : ℂ) / 2) ≠ 0 := by apply Complex.Gamma_ne_zero_of_re_pos norm_num exact Nat.cast_pos.mpr hd have hnum : 0 < ‖Complex.Gamma (-Complex.I * (y : ℂ) / 2)‖ := norm_pos_iff.mpr hnumGamma have hden : 0 < ‖Complex.Gamma (((d : ℝ) / 2 : ℝ) + Complex.I * (y : ℂ) / 2)‖ := norm_pos_iff.mpr hdenGamma have htop := normalizedRadialMellinStrip_top_norm_le_one hd f hf hnonzero R (-y) rw [normalizedRadialMellinStrip_top_norm_eq hd f hnonzero R (-y)] at htop have hdual : (radialSurfaceArea d / radialL1Mass f) * ‖mellin (radialProfile hd f) ((d : ℂ) + Complex.I * (y : ℂ))‖ ≤ 1 := by simpa using! htop have hboundary := radial_fourier_mellin_antifourier_boundary_norm hd f hf hzero hanti y hy have harg : -(Complex.I * (y : ℂ)) / 2 = -Complex.I * (y : ℂ) / 2 := by ring rw [harg] at hboundary have hfactor : 0 ≤ Real.exp ((d : ℝ) * Real.log R) * Real.pi ^ ((d : ℝ) / 2) * (‖Complex.Gamma (-Complex.I * (y : ℂ) / 2)‖ / ‖Complex.Gamma (((d : ℝ) / 2 : ℝ) + Complex.I * (y : ℂ) / 2)‖) := by positivity calc ‖normalizedRadialMellinStrip hd f R ((y : ℂ) - Complex.I * (((d : ℝ) / 2 : ℝ) : ℂ))‖ = (radialSurfaceArea d / radialL1Mass f) * Real.exp ((d : ℝ) * Real.log R) * ‖mellin (radialProfile hd f) (-(Complex.I * (y : ℂ)))‖ := normalizedRadialMellinStrip_bottom_norm_eq hd f hnonzero R y _ = (Real.exp ((d : ℝ) * Real.log R) * Real.pi ^ ((d : ℝ) / 2) * (‖Complex.Gamma (-Complex.I * (y : ℂ) / 2)‖ / ‖Complex.Gamma (((d : ℝ) / 2 : ℝ) + Complex.I * (y : ℂ) / 2)‖)) * ((radialSurfaceArea d / radialL1Mass f) * ‖mellin (radialProfile hd f) ((d : ℂ) + Complex.I * (y : ℂ))‖) := by rw [hboundary] ring _ ≤ (Real.exp ((d : ℝ) * Real.log R) * Real.pi ^ ((d : ℝ) / 2) * (‖Complex.Gamma (-Complex.I * (y : ℂ) / 2)‖ / ‖Complex.Gamma (((d : ℝ) / 2 : ℝ) + Complex.I * (y : ℂ) / 2)‖)) * 1 := mul_le_mul_of_nonneg_left hdual hfactor _ = Real.exp (((d : ℝ) / 2) * Real.log (Real.pi * R ^ 2) + Real.log ‖Complex.Gamma (-Complex.I * (y : ℂ) / 2)‖ - Real.log ‖Complex.Gamma (((d : ℝ) / 2 : ℝ) + Complex.I * (y : ℂ) / 2)‖) := by rw [mul_one] exact (radialGammaBoundaryExponent_exp d R ‖Complex.Gamma (-Complex.I * (y : ℂ) / 2)‖ ‖Complex.Gamma (((d : ℝ) / 2 : ℝ) + Complex.I * (y : ℂ) / 2)‖ hR hnum hden).symm theorem radialProfile_mellin_uniform_strip_bound {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (hzero : f (0 : Euclidean d) = 0) : ∃ C : ℝ, 0 ≤ C ∧ ∀ s : ℂ, 0 ≤ s.re → s.re ≤ (d : ℝ) → ‖mellin (radialProfile hd f) s‖ ≤ C := by have hmeas : AEStronglyMeasurable (radialProfile hd f) (volume.restrict (Ioi (0 : ℝ))) := (radialProfile_continuous hd f).aestronglyMeasurable have hzeroWeight : IntegrableOn (fun r : ℝ => r ^ (-(1 : ℝ)) * ‖radialProfile hd f r‖) (Ioi (0 : ℝ)) := by have hconv := radialProfile_mellinConvergent hd f hf hzero (0 : ℂ) (by norm_num) simpa using! (mellin_convergent_iff_norm (T := Ioi (0 : ℝ)) Subset.rfl measurableSet_Ioi hmeas).mp hconv have hdimensionWeight : IntegrableOn (fun r : ℝ => r ^ ((d : ℝ) - 1) * ‖radialProfile hd f r‖) (Ioi (0 : ℝ)) := by have hre : -2 < ((d : ℂ).re) := by norm_num linarith [show (0 : ℝ) ≤ (d : ℝ) from Nat.cast_nonneg d] have hconv := radialProfile_mellinConvergent hd f hf hzero (d : ℂ) hre simpa using! (mellin_convergent_iff_norm (T := Ioi (0 : ℝ)) Subset.rfl measurableSet_Ioi hmeas).mp hconv have hmajor : IntegrableOn (fun r : ℝ => (r ^ (-(1 : ℝ)) + r ^ ((d : ℝ) - 1)) * ‖radialProfile hd f r‖) (Ioi (0 : ℝ)) := by simpa [Pi.add_apply, add_mul] using! hzeroWeight.add hdimensionWeight let B : ℝ := ∫ r : ℝ in Ioi (0 : ℝ), (r ^ (-(1 : ℝ)) + r ^ ((d : ℝ) - 1)) * ‖radialProfile hd f r‖ refine ⟨max 0 B, le_max_left _ _, ?_⟩ intro s hs hsd have hconv : MellinConvergent (radialProfile hd f) s := radialProfile_mellinConvergent hd f hf hzero s (by linarith) have hbound : ‖mellin (radialProfile hd f) s‖ ≤ B := by calc ‖mellin (radialProfile hd f) s‖ ≤ ∫ r : ℝ in Ioi (0 : ℝ), ‖(r : ℂ) ^ (s - 1) • radialProfile hd f r‖ := norm_integral_le_integral_norm _ _ ≤ ∫ r : ℝ in Ioi (0 : ℝ), (r ^ (-(1 : ℝ)) + r ^ ((d : ℝ) - 1)) * ‖radialProfile hd f r‖ := by apply integral_mono_ae hconv.norm hmajor filter_upwards [ae_restrict_mem measurableSet_Ioi] with r hr change 0 < r at hr rw [norm_smul, Complex.norm_cpow_eq_rpow_re_of_pos hr] norm_num apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) by_cases hone : r ≤ 1 · calc r ^ (s.re - 1) ≤ r ^ (-(1 : ℝ)) := Real.rpow_le_rpow_of_exponent_ge hr hone (by linarith) _ ≤ r ^ (-(1 : ℝ)) + r ^ ((d : ℝ) - 1) := by exact le_add_of_nonneg_right (Real.rpow_nonneg hr.le _) · have hlarge : 1 ≤ r := le_of_not_ge hone calc r ^ (s.re - 1) ≤ r ^ ((d : ℝ) - 1) := Real.rpow_le_rpow_of_exponent_le hlarge (by linarith) _ ≤ r ^ (-(1 : ℝ)) + r ^ ((d : ℝ) - 1) := by exact le_add_of_nonneg_left (Real.rpow_nonneg hr.le _) _ = B := rfl exact hbound.trans (le_max_right _ _) theorem normalizedRadialMellinStrip_uniform_bound {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (hzero : f (0 : Euclidean d) = 0) (R : ℝ) : ∃ C : ℝ, 0 ≤ C ∧ ∀ z : ℂ, -((d : ℝ) / 2) ≤ z.im → z.im ≤ (d : ℝ) / 2 → ‖normalizedRadialMellinStrip hd f R z‖ ≤ C := by obtain ⟨C, hC, hbound⟩ := radialProfile_mellin_uniform_strip_bound hd f hf hzero let B : ℝ := |radialSurfaceArea d / radialL1Mass f| * Real.exp ((d : ℝ) * |Real.log R|) * C refine ⟨B, by dsimp [B]; positivity, ?_⟩ intro z hzlower hzupper have hsnonneg : 0 ≤ (((d : ℂ) / 2 - Complex.I * z).re) := by norm_num linarith have hsupper : (((d : ℂ) / 2 - Complex.I * z).re) ≤ (d : ℝ) := by norm_num linarith have hphase : ((((d : ℂ) / 2 + Complex.I * z) * (Real.log R : ℂ))).re ≤ (d : ℝ) * |Real.log R| := by norm_num have hcoefnonneg : 0 ≤ (d : ℝ) / 2 - z.im := by linarith have hcoefupper : (d : ℝ) / 2 - z.im ≤ (d : ℝ) := by linarith calc ((d : ℝ) / 2 - z.im) * Real.log R ≤ ((d : ℝ) / 2 - z.im) * |Real.log R| := mul_le_mul_of_nonneg_left (le_abs_self _) hcoefnonneg _ ≤ (d : ℝ) * |Real.log R| := mul_le_mul_of_nonneg_right hcoefupper (abs_nonneg _) change ‖normalizedRadialMellinStrip hd f R z‖ ≤ B calc ‖normalizedRadialMellinStrip hd f R z‖ = |radialSurfaceArea d / radialL1Mass f| * Real.exp ((((d : ℂ) / 2 + Complex.I * z) * (Real.log R : ℂ))).re * ‖mellin (radialProfile hd f) ((d : ℂ) / 2 - Complex.I * z)‖ := by unfold normalizedRadialMellinStrip radialMellinStrip rw [norm_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs, Complex.norm_exp] _ ≤ |radialSurfaceArea d / radialL1Mass f| * Real.exp ((d : ℝ) * |Real.log R|) * C := by gcongr exact hbound _ hsnonneg hsupper _ = B := rfl theorem normalizedRadialLogProfile_ofReal {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hreal : IsRealValued f) (R v : ℝ) : (normalizedRadialLogProfile hd f R v : ℂ) = ((radialSurfaceArea d / radialL1Mass f : ℝ) : ℂ) * (((R * Real.exp v) ^ d : ℝ) : ℂ) * radialProfile hd f (R * Real.exp v) := by have hvalue : radialProfile hd f (R * Real.exp v) = (((radialProfile hd f (R * Real.exp v)).re : ℝ) : ℂ) := by apply Complex.ext · simp · simpa using! radialProfile_real hd f hreal (R * Real.exp v) unfold normalizedRadialLogProfile rw [hvalue] simp only [Complex.ofReal_re] push_cast ring theorem normalizedRadialLogProfile_weighted_ofReal {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hreal : IsRealValued f) (R a v : ℝ) : (Real.exp (-a * v) : ℂ) * (normalizedRadialLogProfile hd f R v : ℂ) = ((radialSurfaceArea d / radialL1Mass f * R ^ d : ℝ) : ℂ) * (Real.exp (((d : ℝ) - a) * v) : ℂ) * radialProfile hd f (R * Real.exp v) := by have hexp : Real.exp (-a * v) * (R * Real.exp v) ^ d = R ^ d * Real.exp (((d : ℝ) - a) * v) := by rw [mul_pow, ← Real.exp_nat_mul] calc Real.exp (-a * v) * (R ^ d * Real.exp ((d : ℝ) * v)) = R ^ d * (Real.exp (-a * v) * Real.exp ((d : ℝ) * v)) := by ring _ = R ^ d * Real.exp (-a * v + (d : ℝ) * v) := by rw [← Real.exp_add] _ = R ^ d * Real.exp (((d : ℝ) - a) * v) := by congr 1 ring_nf rw [normalizedRadialLogProfile_ofReal hd f hreal R v] have hcomplex := congrArg (fun x : ℝ => (x : ℂ)) hexp push_cast at hcomplex ⊢ linear_combination (((radialSurfaceArea d : ℝ) : ℂ) / ((radialL1Mass f : ℝ) : ℂ) * radialProfile hd f (R * Real.exp v)) * hcomplex theorem normalizedRadialMellinStrip_shifted_eq_fourier {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hreal : IsRealValued f) (R : ℝ) (hR : 0 < R) (a t : ℝ) : normalizedRadialMellinStrip hd f R ((t : ℂ) + Complex.I * ((((d : ℝ) / 2 - a : ℝ) : ℂ))) = (𝓕 (fun v : ℝ => (Real.exp (-a * v) : ℂ) * (normalizedRadialLogProfile hd f R v : ℂ)) : ℝ → ℂ) (t / (2 * Real.pi)) := by let s : ℂ := (((d : ℝ) - a : ℝ) : ℂ) - Complex.I * (t : ℂ) let g : ℝ → ℂ := fun u => Real.exp (-((d : ℝ) - a) * u) • radialProfile hd f (R * Real.exp (-u)) let c : ℂ := ((radialSurfaceArea d / radialL1Mass f * R ^ d : ℝ) : ℂ) have hweight : (fun v : ℝ => (Real.exp (-a * v) : ℂ) * (normalizedRadialLogProfile hd f R v : ℂ)) = c • (fun v : ℝ => g (-v)) := by funext v have hv := normalizedRadialLogProfile_weighted_ofReal hd f hreal R a v change _ = c * g (-v) calc (Real.exp (-a * v) : ℂ) * (normalizedRadialLogProfile hd f R v : ℂ) = ((radialSurfaceArea d / radialL1Mass f * R ^ d : ℝ) : ℂ) * (Real.exp (((d : ℝ) - a) * v) : ℂ) * radialProfile hd f (R * Real.exp v) := hv _ = c * g (-v) := by simp [c, g, Complex.real_smul, mul_neg] ring_nf have hmellin : mellin (fun r : ℝ => radialProfile hd f (R * r)) s = (𝓕 g : ℝ → ℂ) (-(t / (2 * Real.pi))) := by simpa [s, g, neg_div] using! (mellin_eq_fourier (fun r : ℝ => radialProfile hd f (R * r)) (s := s)) have hscalar (F : ℝ → ℂ) (x : ℝ) : (𝓕 (c • F) : ℝ → ℂ) x = c * (𝓕 F : ℝ → ℂ) x := by rw [Real.fourier_real_eq_integral_exp_smul, Real.fourier_real_eq_integral_exp_smul] simp only [Pi.smul_apply, smul_eq_mul] rw [← integral_const_mul] apply integral_congr_ae filter_upwards [] with v ring have hfourier : (𝓕 (fun v : ℝ => (Real.exp (-a * v) : ℂ) * (normalizedRadialLogProfile hd f R v : ℂ)) : ℝ → ℂ) (t / (2 * Real.pi)) = c * mellin (fun r : ℝ => radialProfile hd f (R * r)) s := by calc (𝓕 (fun v : ℝ => (Real.exp (-a * v) : ℂ) * (normalizedRadialLogProfile hd f R v : ℂ)) : ℝ → ℂ) (t / (2 * Real.pi)) = c * (𝓕 (fun v : ℝ => g (-v)) : ℝ → ℂ) (t / (2 * Real.pi)) := by rw [hweight, hscalar (fun v : ℝ => g (-v))] _ = c * (𝓕 g : ℝ → ℂ) (-(t / (2 * Real.pi))) := by congr 1 rw [← Real.fourierInv_eq_fourier_comp_neg g, Real.fourierInv_eq_fourier_neg] _ = c * mellin (fun r : ℝ => radialProfile hd f (R * r)) s := by rw [hmellin] have hRcomplex : (R : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hR.ne' have hRpow : ((R ^ d : ℝ) : ℂ) = (R : ℂ) ^ (d : ℂ) := by push_cast rw [Complex.cpow_natCast] have hpower : ((R ^ d : ℝ) : ℂ) * (R : ℂ) ^ (-s) = Complex.exp ((((a : ℂ) + Complex.I * (t : ℂ)) * (Real.log R : ℂ))) := by rw [hRpow, ← Complex.cpow_add _ _ hRcomplex, Complex.cpow_def_of_ne_zero hRcomplex, ← Complex.ofReal_log hR.le] congr 1 try dsimp [s] push_cast ring have hscale : c * mellin (fun r : ℝ => radialProfile hd f (R * r)) s = ((radialSurfaceArea d / radialL1Mass f : ℝ) : ℂ) * Complex.exp ((((a : ℂ) + Complex.I * (t : ℂ)) * (Real.log R : ℂ))) * mellin (radialProfile hd f) s := by rw [mellin_comp_mul_left (radialProfile hd f) s hR] simp only [smul_eq_mul] try dsimp [c] push_cast have hc := hpower push_cast at hc linear_combination (((radialSurfaceArea d : ℝ) : ℂ) / ((radialL1Mass f : ℝ) : ℂ) * mellin (radialProfile hd f) s) * hc have harg : (d : ℂ) / 2 - Complex.I * ((t : ℂ) + Complex.I * ((((d : ℝ) / 2 - a : ℝ) : ℂ))) = s := by try dsimp [s] push_cast simp [mul_add, ← mul_assoc, Complex.I_mul_I]; ring have hphase : (d : ℂ) / 2 + Complex.I * ((t : ℂ) + Complex.I * ((((d : ℝ) / 2 - a : ℝ) : ℂ))) = (a : ℂ) + Complex.I * (t : ℂ) := by push_cast simp [mul_add, ← mul_assoc, Complex.I_mul_I]; ring unfold normalizedRadialMellinStrip radialMellinStrip rw [harg, hphase] exact hscale.symm.trans hfourier.symm theorem normalizedRadialLogProfile_weighted_integrable {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (hreal : IsRealValued f) (hzero : f (0 : Euclidean d) = 0) {R : ℝ} (hR : 0 < R) {a : ℝ} (ha : a < (d : ℝ) + 2) : Integrable (fun v : ℝ => (Real.exp (-a * v) : ℂ) * (normalizedRadialLogProfile hd f R v : ℂ)) := by let κ : ℝ := (d : ℝ) - a have hκ : -2 < κ := by try dsimp [κ] linarith have hconv : MellinConvergent (radialProfile hd f) (κ : ℂ) := by apply radialProfile_mellinConvergent hd f hf hzero simpa using! hκ have hscaled : MellinConvergent (fun r : ℝ => radialProfile hd f (R * r)) (κ : ℂ) := (MellinConvergent.comp_mul_left hR).mpr hconv have hchange : Integrable (fun v : ℝ => (1 * Real.exp v) • (((1 * Real.exp v : ℝ) : ℂ) ^ ((κ : ℂ) - 1) • radialProfile hd f (R * (1 * Real.exp v)))) := by apply (integrable_scaled_exp_change_Ioi (R := (1 : ℝ)) (by norm_num) (fun r : ℝ => (r : ℂ) ^ ((κ : ℂ) - 1) • radialProfile hd f (R * r))).mp exact hscaled have hpower (v : ℝ) : (Real.exp v : ℂ) * (Real.exp v : ℂ) ^ ((κ : ℂ) - 1) = (Real.exp (κ * v) : ℂ) := by have hbase : (Real.exp v : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (Real.exp_ne_zero v) calc (Real.exp v : ℂ) * (Real.exp v : ℂ) ^ ((κ : ℂ) - 1) = (Real.exp v : ℂ) ^ (1 : ℂ) * (Real.exp v : ℂ) ^ ((κ : ℂ) - 1) := by rw [Complex.cpow_one] _ = (Real.exp v : ℂ) ^ ((1 : ℂ) + ((κ : ℂ) - 1)) := by rw [Complex.cpow_add _ _ hbase] _ = (Real.exp v : ℂ) ^ (κ : ℂ) := by congr 1 ring _ = (Real.exp (κ * v) : ℂ) := by rw [Complex.cpow_def_of_ne_zero hbase, ← Complex.ofReal_log (Real.exp_pos v).le, Real.log_exp, Complex.ofReal_exp] congr 1 push_cast ring have hplus : Integrable (fun v : ℝ => (Real.exp (κ * v) : ℂ) * radialProfile hd f (R * Real.exp v)) := by apply hchange.congr filter_upwards [] with v simp only [one_mul, smul_eq_mul, Complex.real_smul] rw [← mul_assoc, hpower] have hfactor := hplus.const_mul ((radialSurfaceArea d / radialL1Mass f * R ^ d : ℝ) : ℂ) apply hfactor.congr filter_upwards [] with v rw [normalizedRadialLogProfile_weighted_ofReal hd f hreal R a v] try dsimp [κ] ring theorem integrable_fourier_of_integrable_two_derivatives (g : ℝ → ℂ) (hg : Integrable g) (hgdiff : Differentiable ℝ g) (hg' : Integrable (deriv g)) (hg'diff : Differentiable ℝ (deriv g)) (hg'' : Integrable (deriv (deriv g))) : Integrable (𝓕 g : ℝ → ℂ) := by let A : ℝ := ∫ v : ℝ, ‖g v‖ let D : ℝ := ∫ v : ℝ, ‖deriv (deriv g) v‖ let p : ℝ := 2 * Real.pi have hp : 0 < p := by try dsimp [p] positivity have hA : 0 ≤ A := by try dsimp [A] exact integral_nonneg (fun v => norm_nonneg _) have hD : 0 ≤ D := by try dsimp [D] exact integral_nonneg (fun v => norm_nonneg _) have hcont : Continuous (𝓕 g : ℝ → ℂ) := by exact VectorFourier.fourierIntegral_continuous Real.continuous_fourierChar (innerSL ℝ).continuous₂ hg have hzero (t : ℝ) : ‖(𝓕 g : ℝ → ℂ) t‖ ≤ A := by exact VectorFourier.norm_fourierIntegral_le_integral_norm Real.fourierChar volume (innerₗ ℝ) g t have hident (t : ℝ) : (𝓕 (deriv (deriv g)) : ℝ → ℂ) t = (2 * (Real.pi : ℂ) * Complex.I * (t : ℂ)) ^ 2 * (𝓕 g : ℝ → ℂ) t := by rw [congrFun (Real.fourier_deriv hg' hg'diff hg'') t, congrFun (Real.fourier_deriv hg hgdiff hg') t] simp only [smul_eq_mul] ring have hcoef (t : ℝ) : ‖(2 * (Real.pi : ℂ) * Complex.I * (t : ℂ)) ^ 2‖ = p ^ 2 * t ^ 2 := by try dsimp [p] simp [norm_pow, Complex.norm_real, Real.norm_eq_abs, abs_of_pos Real.pi_pos] rw [mul_pow, sq_abs] have hsecond (t : ℝ) : p ^ 2 * t ^ 2 * ‖(𝓕 g : ℝ → ℂ) t‖ ≤ D := by calc p ^ 2 * t ^ 2 * ‖(𝓕 g : ℝ → ℂ) t‖ = ‖(𝓕 (deriv (deriv g)) : ℝ → ℂ) t‖ := by rw [hident, norm_mul, hcoef] _ ≤ D := VectorFourier.norm_fourierIntegral_le_integral_norm Real.fourierChar volume (innerₗ ℝ) (deriv (deriv g)) t have hquadratic (t : ℝ) : t ^ 2 * ‖(𝓕 g : ℝ → ℂ) t‖ ≤ D / p ^ 2 := by apply (le_div_iff₀ (sq_pos_of_pos hp)).2 nlinarith [hsecond t] have hmajor : Integrable (fun t : ℝ => (A + D / p ^ 2) * (1 + t ^ 2)⁻¹) := integrable_inv_one_add_sq.const_mul (A + D / p ^ 2) apply hmajor.mono' hcont.aestronglyMeasurable filter_upwards [] with t have hden : 0 < 1 + t ^ 2 := by positivity have hconstant : 0 ≤ A + D / p ^ 2 := by positivity change ‖(𝓕 g : ℝ → ℂ) t‖ ≤ (A + D / p ^ 2) / (1 + t ^ 2) apply (le_div_iff₀ hden).2 nlinarith [hzero t, hquadratic t, norm_nonneg ((𝓕 g : ℝ → ℂ) t)] theorem schwartzRealLine_mellinConvergent_of_re_pos (g : 𝓢(ℝ, ℂ)) (s : ℂ) (hs : 0 < s.re) : MellinConvergent (g : ℝ → ℂ) s := by have hlocal : LocallyIntegrableOn (g : ℝ → ℂ) (Ioi (0 : ℝ)) := g.continuous.locallyIntegrable.locallyIntegrableOn _ have htop : (g : ℝ → ℂ) =O[atTop] (fun r : ℝ => r ^ (-(s.re + 1))) := by have h := (g.isBigO_cocompact_rpow (-(s.re + 1))).mono atTop_le_cocompact refine h.congr' (Eventually.of_forall (fun _ => rfl)) ?_ filter_upwards [eventually_gt_atTop (0 : ℝ)] with r hr simp [Real.norm_eq_abs, abs_of_pos hr] obtain ⟨C, _hC, hdecay⟩ := g.decay 0 0 have hbounded (r : ℝ) : ‖g r‖ ≤ C := by simpa using! hdecay r have hzero : (g : ℝ → ℂ) =O[𝓝[>] (0 : ℝ)] (fun r : ℝ => r ^ (-(0 : ℝ))) := by apply IsBigO.of_bound C filter_upwards [] with r simpa using! hbounded r exact mellinConvergent_of_isBigO_rpow (a := s.re + 1) (b := (0 : ℝ)) hlocal htop (by linarith) hzero hs def schwartzExponentialTilt (g : 𝓢(ℝ, ℂ)) (κ R v : ℝ) : ℂ := (Real.exp (κ * v) : ℂ) * g (R * Real.exp v) theorem schwartzExponentialTilt_integrable (g : 𝓢(ℝ, ℂ)) {κ R : ℝ} (hκ : 0 < κ) (hR : 0 < R) : Integrable (schwartzExponentialTilt g κ R) := by have hconv : MellinConvergent (g : ℝ → ℂ) (κ : ℂ) := by apply schwartzRealLine_mellinConvergent_of_re_pos simpa using! hκ have hscaled : MellinConvergent (fun r : ℝ => g (R * r)) (κ : ℂ) := (MellinConvergent.comp_mul_left hR).mpr hconv have hchange : Integrable (fun v : ℝ => (1 * Real.exp v) • (((1 * Real.exp v : ℝ) : ℂ) ^ ((κ : ℂ) - 1) • g (R * (1 * Real.exp v)))) := by apply (integrable_scaled_exp_change_Ioi (R := (1 : ℝ)) (by norm_num) (fun r : ℝ => (r : ℂ) ^ ((κ : ℂ) - 1) • g (R * r))).mp exact hscaled have hpower (v : ℝ) : (Real.exp v : ℂ) * (Real.exp v : ℂ) ^ ((κ : ℂ) - 1) = (Real.exp (κ * v) : ℂ) := by have hbase : (Real.exp v : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (Real.exp_ne_zero v) calc (Real.exp v : ℂ) * (Real.exp v : ℂ) ^ ((κ : ℂ) - 1) = (Real.exp v : ℂ) ^ (1 : ℂ) * (Real.exp v : ℂ) ^ ((κ : ℂ) - 1) := by rw [Complex.cpow_one] _ = (Real.exp v : ℂ) ^ ((1 : ℂ) + ((κ : ℂ) - 1)) := by rw [Complex.cpow_add _ _ hbase] _ = (Real.exp v : ℂ) ^ (κ : ℂ) := by congr 1 ring _ = (Real.exp (κ * v) : ℂ) := by rw [Complex.cpow_def_of_ne_zero hbase, ← Complex.ofReal_log (Real.exp_pos v).le, Real.log_exp, Complex.ofReal_exp] congr 1 push_cast ring apply hchange.congr filter_upwards [] with v simp only [one_mul, smul_eq_mul, Complex.real_smul, schwartzExponentialTilt] rw [← mul_assoc, hpower] theorem schwartzExponentialTilt_differentiable (g : 𝓢(ℝ, ℂ)) (κ R : ℝ) : Differentiable ℝ (schwartzExponentialTilt g κ R) := by unfold schwartzExponentialTilt have hexpreal : Differentiable ℝ (fun v : ℝ => Real.exp (κ * v)) := by fun_prop have hexp : Differentiable ℝ (fun v : ℝ => (Real.exp (κ * v) : ℂ)) := Complex.ofRealCLM.differentiable.comp hexpreal have hg : Differentiable ℝ (g : ℝ → ℂ) := (g.smooth 1).differentiable (by norm_num) have hradius : Differentiable ℝ (fun v : ℝ => R * Real.exp v) := by fun_prop exact hexp.mul (hg.comp hradius) theorem schwartzExponentialTilt_deriv (g : 𝓢(ℝ, ℂ)) (κ R v : ℝ) : deriv (schwartzExponentialTilt g κ R) v = (κ : ℂ) * schwartzExponentialTilt g κ R v + (R : ℂ) * schwartzExponentialTilt ((SchwartzMap.derivCLM ℂ ℂ) g) (κ + 1) R v := by have hlinear : HasDerivAt (fun u : ℝ => κ * u) κ v := by simpa using! (hasDerivAt_id v).const_mul κ have hexpreal : HasDerivAt (fun u : ℝ => Real.exp (κ * u)) (κ * Real.exp (κ * v)) v := by convert! (Real.hasDerivAt_exp (κ * v)).comp v hlinear using 1; simp [mul_comm] have hexp : HasDerivAt (fun u : ℝ => (Real.exp (κ * u) : ℂ)) ((κ * Real.exp (κ * v) : ℝ) : ℂ) v := hexpreal.ofReal_comp have hradius : HasDerivAt (fun u : ℝ => R * Real.exp u) (R * Real.exp v) v := (Real.hasDerivAt_exp v).const_mul R have hprofile : HasDerivAt (fun u : ℝ => g (R * Real.exp u)) ((R * Real.exp v) • deriv (g : ℝ → ℂ) (R * Real.exp v)) v := by simpa [Function.comp_def] using! (g.hasDerivAt (R * Real.exp v)).scomp v hradius have hder := (hexp.mul hprofile).deriv change deriv ((fun u : ℝ => (Real.exp (κ * u) : ℂ)) * (fun u : ℝ => g (R * Real.exp u))) v = _ rw [hder] have hexpadd : Real.exp ((κ + 1) * v) = Real.exp (κ * v) * Real.exp v := by rw [← Real.exp_add] congr 1 ring simp [schwartzExponentialTilt, SchwartzMap.derivCLM_apply, Complex.real_smul, hexpadd] ring theorem schwartzExponentialTilt_deriv_integrable (g : 𝓢(ℝ, ℂ)) {κ R : ℝ} (hκ : 0 < κ) (hR : 0 < R) : Integrable (deriv (schwartzExponentialTilt g κ R)) := by let g' : 𝓢(ℝ, ℂ) := (SchwartzMap.derivCLM ℂ ℂ) g have hzero := schwartzExponentialTilt_integrable g hκ hR have hone := schwartzExponentialTilt_integrable g' (show 0 < κ + 1 by linarith) hR have hsum := (hzero.const_mul (κ : ℂ)).add (hone.const_mul (R : ℂ)) apply hsum.congr filter_upwards [] with v exact (schwartzExponentialTilt_deriv g κ R v).symm theorem schwartzExponentialTilt_deriv_deriv (g : 𝓢(ℝ, ℂ)) (κ R v : ℝ) : deriv (deriv (schwartzExponentialTilt g κ R)) v = (κ : ℂ) * deriv (schwartzExponentialTilt g κ R) v + (R : ℂ) * deriv (schwartzExponentialTilt ((SchwartzMap.derivCLM ℂ ℂ) g) (κ + 1) R) v := by let g' : 𝓢(ℝ, ℂ) := (SchwartzMap.derivCLM ℂ ℂ) g have hderivfun : deriv (schwartzExponentialTilt g κ R) = (fun u : ℝ => (κ : ℂ) * schwartzExponentialTilt g κ R u + (R : ℂ) * schwartzExponentialTilt g' (κ + 1) R u) := by funext u exact schwartzExponentialTilt_deriv g κ R u conv_lhs => rw [hderivfun] have hfirst : Differentiable ℝ (fun u : ℝ => (κ : ℂ) * schwartzExponentialTilt g κ R u) := (schwartzExponentialTilt_differentiable g κ R).const_mul (κ : ℂ) have hsecond : Differentiable ℝ (fun u : ℝ => (R : ℂ) * schwartzExponentialTilt g' (κ + 1) R u) := (schwartzExponentialTilt_differentiable g' (κ + 1) R).const_mul (R : ℂ) change deriv ((fun u : ℝ => (κ : ℂ) * schwartzExponentialTilt g κ R u) + (fun u : ℝ => (R : ℂ) * schwartzExponentialTilt g' (κ + 1) R u)) v = _ rw [deriv_add hfirst.differentiableAt hsecond.differentiableAt, deriv_const_mul_field (κ : ℂ), deriv_const_mul_field (R : ℂ)] theorem schwartzExponentialTilt_deriv_deriv_integrable (g : 𝓢(ℝ, ℂ)) {κ R : ℝ} (hκ : 0 < κ) (hR : 0 < R) : Integrable (deriv (deriv (schwartzExponentialTilt g κ R))) := by let g' : 𝓢(ℝ, ℂ) := (SchwartzMap.derivCLM ℂ ℂ) g have hzero := schwartzExponentialTilt_deriv_integrable g hκ hR have hone := schwartzExponentialTilt_deriv_integrable g' (show 0 < κ + 1 by linarith) hR have hsum := (hzero.const_mul (κ : ℂ)).add (hone.const_mul (R : ℂ)) apply hsum.congr filter_upwards [] with v exact (schwartzExponentialTilt_deriv_deriv g κ R v).symm theorem schwartzExponentialTilt_deriv_differentiable (g : 𝓢(ℝ, ℂ)) (κ R : ℝ) : Differentiable ℝ (deriv (schwartzExponentialTilt g κ R)) := by let g' : 𝓢(ℝ, ℂ) := (SchwartzMap.derivCLM ℂ ℂ) g have hderivfun : deriv (schwartzExponentialTilt g κ R) = (fun u : ℝ => (κ : ℂ) * schwartzExponentialTilt g κ R u + (R : ℂ) * schwartzExponentialTilt g' (κ + 1) R u) := by funext u exact schwartzExponentialTilt_deriv g κ R u rw [hderivfun] exact ((schwartzExponentialTilt_differentiable g κ R).const_mul (κ : ℂ)).add ((schwartzExponentialTilt_differentiable g' (κ + 1) R).const_mul (R : ℂ)) theorem schwartzExponentialTilt_fourier_integrable (g : 𝓢(ℝ, ℂ)) {κ R : ℝ} (hκ : 0 < κ) (hR : 0 < R) : Integrable (𝓕 (schwartzExponentialTilt g κ R) : ℝ → ℂ) := integrable_fourier_of_integrable_two_derivatives (schwartzExponentialTilt g κ R) (schwartzExponentialTilt_integrable g hκ hR) (schwartzExponentialTilt_differentiable g κ R) (schwartzExponentialTilt_deriv_integrable g hκ hR) (schwartzExponentialTilt_deriv_differentiable g κ R) (schwartzExponentialTilt_deriv_deriv_integrable g hκ hR) theorem normalizedRadialLogProfile_weighted_fourier_integrable {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hreal : IsRealValued f) {R : ℝ} (hR : 0 < R) {a : ℝ} (ha : a < (d : ℝ)) : Integrable (𝓕 (fun v : ℝ => (Real.exp (-a * v) : ℂ) * (normalizedRadialLogProfile hd f R v : ℂ)) : ℝ → ℂ) := by let κ : ℝ := (d : ℝ) - a let g : 𝓢(ℝ, ℂ) := radialSchwartzProfile hd f let c : ℂ := ((radialSurfaceArea d / radialL1Mass f * R ^ d : ℝ) : ℂ) have hκ : 0 < κ := by try dsimp [κ] linarith have hweight : (fun v : ℝ => (Real.exp (-a * v) : ℂ) * (normalizedRadialLogProfile hd f R v : ℂ)) = (fun v : ℝ => c * schwartzExponentialTilt g κ R v) := by funext v rw [normalizedRadialLogProfile_weighted_ofReal hd f hreal R a v] simp [c, g, κ, schwartzExponentialTilt] ring have hfourier := (schwartzExponentialTilt_fourier_integrable g hκ hR).const_mul c have hscalar (t : ℝ) : (𝓕 (fun v : ℝ => c * schwartzExponentialTilt g κ R v) : ℝ → ℂ) t = c * (𝓕 (schwartzExponentialTilt g κ R) : ℝ → ℂ) t := by rw [Real.fourier_real_eq_integral_exp_smul, Real.fourier_real_eq_integral_exp_smul] simp only [smul_eq_mul] rw [← integral_const_mul] apply integral_congr_ae filter_upwards [] with v ring apply hfourier.congr filter_upwards [] with t rw [hweight] exact (hscalar t).symm theorem normalizedRadialMellinStrip_shifted_integrable {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hreal : IsRealValued f) {R : ℝ} (hR : 0 < R) {a : ℝ} (ha : a < (d : ℝ)) : Integrable (fun t : ℝ => normalizedRadialMellinStrip hd f R ((t : ℂ) + Complex.I * ((((d : ℝ) / 2 - a : ℝ) : ℂ)))) := by have hfourier := normalizedRadialLogProfile_weighted_fourier_integrable hd f hreal hR ha have hscale : (2 * Real.pi)⁻¹ ≠ 0 := by exact inv_ne_zero (mul_ne_zero (by norm_num) Real.pi_ne_zero) have hscaled := hfourier.comp_mul_right' hscale apply hscaled.congr filter_upwards [] with t simpa [div_eq_mul_inv] using! (normalizedRadialMellinStrip_shifted_eq_fourier hd f hreal R hR a t).symm theorem normalizedRadialMellinStrip_shifted_fourier_inversion {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : IsRadial f) (hreal : IsRealValued f) (hzero : f (0 : Euclidean d) = 0) {R : ℝ} (hR : 0 < R) {a : ℝ} (ha : a < (d : ℝ)) (v : ℝ) : (normalizedRadialLogProfile hd f R v : ℂ) = (Real.exp (a * v) : ℂ) * ((𝓕⁻ (fun ξ : ℝ => normalizedRadialMellinStrip hd f R (((2 * Real.pi * ξ : ℝ) : ℂ) + Complex.I * ((((d : ℝ) / 2 - a : ℝ) : ℂ)))) : ℝ → ℂ) v) := by let W : ℝ → ℂ := fun u => (Real.exp (-a * u) : ℂ) * (normalizedRadialLogProfile hd f R u : ℂ) let κ : ℝ := (d : ℝ) - a let g : 𝓢(ℝ, ℂ) := radialSchwartzProfile hd f let c : ℂ := ((radialSurfaceArea d / radialL1Mass f * R ^ d : ℝ) : ℂ) have hW : Integrable W := by try dsimp [W] apply normalizedRadialLogProfile_weighted_integrable hd f hf hreal hzero hR linarith have hFW : Integrable (𝓕 W : ℝ → ℂ) := by try dsimp [W] exact normalizedRadialLogProfile_weighted_fourier_integrable hd f hreal hR ha have hweight : W = (fun u : ℝ => c * schwartzExponentialTilt g κ R u) := by funext u try dsimp [W] rw [normalizedRadialLogProfile_weighted_ofReal hd f hreal R a u] simp [c, g, κ, schwartzExponentialTilt] ring have hcontinuous : Continuous W := by rw [hweight] exact (schwartzExponentialTilt_differentiable g κ R).continuous.const_mul c have hfrequency : (fun ξ : ℝ => normalizedRadialMellinStrip hd f R (((2 * Real.pi * ξ : ℝ) : ℂ) + Complex.I * ((((d : ℝ) / 2 - a : ℝ) : ℂ)))) = (𝓕 W : ℝ → ℂ) := by funext ξ rw [normalizedRadialMellinStrip_shifted_eq_fourier hd f hreal R hR a (2 * Real.pi * ξ)] change (𝓕 W : ℝ → ℂ) ((2 * Real.pi * ξ) / (2 * Real.pi)) = (𝓕 W : ℝ → ℂ) ξ field_simp [Real.pi_ne_zero] have hinversion : (𝓕⁻ (𝓕 W : ℝ → ℂ) : ℝ → ℂ) v = W v := hW.fourierInv_fourier_eq hFW hcontinuous.continuousAt have hcancel : (Real.exp (a * v) : ℂ) * W v = (normalizedRadialLogProfile hd f R v : ℂ) := by try dsimp [W] rw [← mul_assoc, ← Complex.ofReal_mul, ← Real.exp_add] have hsum : a * v + -a * v = 0 := by ring rw [hsum, Real.exp_zero] norm_num calc (normalizedRadialLogProfile hd f R v : ℂ) = (Real.exp (a * v) : ℂ) * W v := hcancel.symm _ = (Real.exp (a * v) : ℂ) * ((𝓕⁻ (fun ξ : ℝ => normalizedRadialMellinStrip hd f R (((2 * Real.pi * ξ : ℝ) : ℂ) + Complex.I * ((((d : ℝ) / 2 - a : ℝ) : ℂ)))) : ℝ → ℂ) v) := by rw [hfrequency, hinversion] end noncomputable section def stripAngle (σ : ℝ) : ℝ := Real.pi * (1 + σ) / 2 def stripPoissonKernel (σ T : ℝ) : ℝ := Real.sin (stripAngle σ) / (4 * (Real.cosh (Real.pi * T / 2) - Real.cos (stripAngle σ))) def stripBottomMass (σ : ℝ) : ℝ := (1 - σ) / 2 theorem stripAngle_mem_Ioo {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) : 0 < stripAngle σ ∧ stripAngle σ < Real.pi := by unfold stripAngle constructor · exact div_pos (mul_pos Real.pi_pos (by linarith)) (by norm_num) · calc Real.pi * (1 + σ) / 2 < Real.pi * 2 / 2 := by gcongr linarith _ = Real.pi := by ring theorem stripBottomMass_pos {σ : ℝ} (hσ : σ < 1) : 0 < stripBottomMass σ := by unfold stripBottomMass linarith theorem stripBottomMass_lt_one {σ : ℝ} (hσ : -1 < σ) : stripBottomMass σ < 1 := by unfold stripBottomMass linarith theorem stripPoissonKernel_pos {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) (T : ℝ) : 0 < stripPoissonKernel σ T := by obtain ⟨hangle, hangle'⟩ := stripAngle_mem_Ioo hbelow habove have hsin : 0 < Real.sin (stripAngle σ) := Real.sin_pos_of_pos_of_lt_pi hangle hangle' have hcos : Real.cos (stripAngle σ) < 1 := by have h := Real.cos_lt_cos_of_nonneg_of_le_pi (x := 0) (y := stripAngle σ) (by norm_num) hangle'.le hangle simpa using! h have hden : 0 < Real.cosh (Real.pi * T / 2) - Real.cos (stripAngle σ) := by linarith [Real.one_le_cosh (Real.pi * T / 2)] exact div_pos hsin (mul_pos (by norm_num) hden) end noncomputable section open Filter MeasureTheory Set open scoped Interval Topology def stripPoissonPrimitive (σ T : ℝ) : ℝ := Real.arctan ((Real.exp (Real.pi * T / 2) - Real.cos (stripAngle σ)) / Real.sin (stripAngle σ)) / Real.pi theorem stripPoissonKernel_neg (σ T : ℝ) : stripPoissonKernel σ (-T) = stripPoissonKernel σ T := by unfold stripPoissonKernel have hneg : Real.pi * (-T) / 2 = -(Real.pi * T / 2) := by ring rw [hneg, Real.cosh_neg] theorem stripPoissonKernel_abs (σ T : ℝ) : stripPoissonKernel σ |T| = stripPoissonKernel σ T := by rcases le_total 0 T with h | h · rw [abs_of_nonneg h] · rw [abs_of_nonpos h, stripPoissonKernel_neg] theorem stripPoissonPrimitive_hasDerivAt {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) (T : ℝ) : HasDerivAt (stripPoissonPrimitive σ) (stripPoissonKernel σ T) T := by obtain ⟨hangle, hangle'⟩ := stripAngle_mem_Ioo hbelow habove have hsin : 0 < Real.sin (stripAngle σ) := Real.sin_pos_of_pos_of_lt_pi hangle hangle' have hsin0 : Real.sin (stripAngle σ) ≠ 0 := hsin.ne' have hpi : Real.pi ≠ 0 := Real.pi_ne_zero have hexp : 0 < Real.exp (Real.pi * T / 2) := Real.exp_pos _ have hderiv : HasDerivAt (fun x : ℝ => (Real.exp (Real.pi * x / 2) - Real.cos (stripAngle σ)) / Real.sin (stripAngle σ)) ((Real.exp (Real.pi * T / 2) * (Real.pi / 2)) / Real.sin (stripAngle σ)) T := by convert! (((Real.hasDerivAt_exp (Real.pi * T / 2)).comp T ((hasDerivAt_id T).const_mul Real.pi |>.div_const 2)).sub_const (Real.cos (stripAngle σ))).div_const (Real.sin (stripAngle σ)) using 1 all_goals simp [mul_comm] convert! ((Real.hasDerivAt_arctan _).comp T hderiv).div_const Real.pi using 1 unfold stripPoissonKernel rw [Real.cosh_eq, Real.exp_neg] have htrig := Real.sin_sq_add_cos_sq (stripAngle σ) have hden : 0 < Real.exp (Real.pi * T / 2) ^ 2 + 1 - 2 * Real.exp (Real.pi * T / 2) * Real.cos (stripAngle σ) := by nlinarith [sq_nonneg (Real.exp (Real.pi * T / 2) - Real.cos (stripAngle σ)), sq_pos_of_pos hsin] field_simp [hsin0, hpi, hexp.ne', hden.ne'] nlinarith theorem stripPoissonPrimitive_zero {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) : stripPoissonPrimitive σ 0 = stripAngle σ / (2 * Real.pi) := by obtain ⟨hangle, hangle'⟩ := stripAngle_mem_Ioo hbelow habove have hhalf : 0 < stripAngle σ / 2 := half_pos hangle have hhalf' : stripAngle σ / 2 < Real.pi / 2 := by linarith have hcos : 0 < Real.cos (stripAngle σ / 2) := Real.cos_pos_of_mem_Ioo ⟨by linarith [Real.pi_pos], hhalf'⟩ have hsin : 0 < Real.sin (stripAngle σ / 2) := Real.sin_pos_of_pos_of_lt_pi hhalf (by linarith [Real.pi_pos]) have hratio : (1 - Real.cos (stripAngle σ)) / Real.sin (stripAngle σ) = Real.tan (stripAngle σ / 2) := by conv_lhs => arg 1 arg 2 rw [show stripAngle σ = 2 * (stripAngle σ / 2) by ring, Real.cos_two_mul_eq_one_sub] conv_lhs => arg 2 rw [show stripAngle σ = 2 * (stripAngle σ / 2) by ring, Real.sin_two_mul] rw [Real.tan_eq_sin_div_cos] field_simp [hsin.ne', hcos.ne'] ring unfold stripPoissonPrimitive simp only [mul_zero, zero_div, Real.exp_zero] rw [hratio, Real.arctan_tan (by linarith [Real.pi_pos]) hhalf'] ring theorem stripPoissonPrimitive_tendsto_atTop {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) : Tendsto (stripPoissonPrimitive σ) atTop (nhds (1 / 2 : ℝ)) := by obtain ⟨hangle, hangle'⟩ := stripAngle_mem_Ioo hbelow habove have hsin : 0 < Real.sin (stripAngle σ) := Real.sin_pos_of_pos_of_lt_pi hangle hangle' have hscale : Tendsto (fun T : ℝ => Real.pi * T / 2) atTop atTop := by convert! tendsto_id.atTop_mul_const (half_pos Real.pi_pos) using 1 ext T change Real.pi * T / 2 = T * (Real.pi / 2) ring have hexp : Tendsto (fun T : ℝ => Real.exp (Real.pi * T / 2)) atTop atTop := Real.tendsto_exp_atTop.comp hscale have hshift : Tendsto (fun T : ℝ => Real.exp (Real.pi * T / 2) - Real.cos (stripAngle σ)) atTop atTop := by simpa [sub_eq_add_neg] using! (tendsto_atTop_add_const_right atTop (-Real.cos (stripAngle σ)) hexp) have hratio : Tendsto (fun T : ℝ => (Real.exp (Real.pi * T / 2) - Real.cos (stripAngle σ)) / Real.sin (stripAngle σ)) atTop atTop := (tendsto_div_const_atTop_of_pos hsin).2 hshift have hatan : Tendsto (fun T : ℝ => Real.arctan ((Real.exp (Real.pi * T / 2) - Real.cos (stripAngle σ)) / Real.sin (stripAngle σ))) atTop (nhds (Real.pi / 2)) := (tendsto_nhds_of_tendsto_nhdsWithin Real.tendsto_arctan_atTop).comp hratio unfold stripPoissonPrimitive convert! hatan.div_const Real.pi using 1 field_simp [Real.pi_ne_zero] theorem stripPoissonKernel_integrableOn_Ioi {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) : IntegrableOn (stripPoissonKernel σ) (Ioi (0 : ℝ)) := by exact integrableOn_Ioi_deriv_of_nonneg' (fun T _ => stripPoissonPrimitive_hasDerivAt hbelow habove T) (fun T _ => (stripPoissonKernel_pos hbelow habove T).le) (stripPoissonPrimitive_tendsto_atTop hbelow habove) theorem stripPoissonKernel_integral_Ioi {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) : (∫ T in Ioi (0 : ℝ), stripPoissonKernel σ T) = 1 / 2 - stripAngle σ / (2 * Real.pi) := by calc (∫ T in Ioi (0 : ℝ), stripPoissonKernel σ T) = (1 / 2 : ℝ) - stripPoissonPrimitive σ 0 := by exact integral_Ioi_of_hasDerivAt_of_nonneg' (fun T _ => stripPoissonPrimitive_hasDerivAt hbelow habove T) (fun T _ => (stripPoissonKernel_pos hbelow habove T).le) (stripPoissonPrimitive_tendsto_atTop hbelow habove) _ = 1 / 2 - stripAngle σ / (2 * Real.pi) := by rw [stripPoissonPrimitive_zero hbelow habove] theorem stripPoissonKernel_integrable {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) : Integrable (stripPoissonKernel σ) := by rw [← integrableOn_univ, ← @Iio_union_Ici _ _ (0 : ℝ), integrableOn_union, integrableOn_Ici_iff_integrableOn_Ioi] have hright := stripPoissonKernel_integrableOn_Ioi hbelow habove refine ⟨?_, hright⟩ have hreflected : IntegrableOn ((stripPoissonKernel σ) ∘ (fun T : ℝ => -T)) ((fun T : ℝ => -T) ⁻¹' Iio (0 : ℝ)) := by simpa only [Function.comp_def, neg_preimage, neg_Iio, neg_zero, stripPoissonKernel_neg] using! hright exact ((Measure.measurePreserving_neg (volume : Measure ℝ)).integrableOn_comp_preimage (Homeomorph.neg ℝ).measurableEmbedding).mp hreflected theorem integral_stripPoissonKernel {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) : (∫ T : ℝ, stripPoissonKernel σ T) = stripBottomMass σ := by calc (∫ T : ℝ, stripPoissonKernel σ T) = ∫ T : ℝ, stripPoissonKernel σ |T| := by apply integral_congr_ae exact Filter.Eventually.of_forall (fun T => (stripPoissonKernel_abs σ T).symm) _ = 2 * ∫ T in Ioi (0 : ℝ), stripPoissonKernel σ T := integral_comp_abs _ = 2 * (1 / 2 - stripAngle σ / (2 * Real.pi)) := by rw [stripPoissonKernel_integral_Ioi hbelow habove] _ = stripBottomMass σ := by unfold stripAngle stripBottomMass field_simp [Real.pi_ne_zero] ring theorem stripPoissonKernel_antitone_abs {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) {x y : ℝ} (hxy : |x| ≤ |y|) : stripPoissonKernel σ y ≤ stripPoissonKernel σ x := by obtain ⟨hangle, hangle'⟩ := stripAngle_mem_Ioo hbelow habove have hsin : 0 < Real.sin (stripAngle σ) := Real.sin_pos_of_pos_of_lt_pi hangle hangle' have hcos : Real.cos (stripAngle σ) < 1 := by have h := Real.cos_lt_cos_of_nonneg_of_le_pi (x := 0) (y := stripAngle σ) (by norm_num) hangle'.le hangle simpa using! h have hxden : 0 < 4 * (Real.cosh (Real.pi * x / 2) - Real.cos (stripAngle σ)) := by have hxcosh := Real.one_le_cosh (Real.pi * x / 2) nlinarith have hcosh : Real.cosh (Real.pi * x / 2) ≤ Real.cosh (Real.pi * y / 2) := by apply Real.cosh_le_cosh.mpr rw [abs_div, abs_div, abs_mul, abs_mul] gcongr have hden : 4 * (Real.cosh (Real.pi * x / 2) - Real.cos (stripAngle σ)) ≤ 4 * (Real.cosh (Real.pi * y / 2) - Real.cos (stripAngle σ)) := by linarith unfold stripPoissonKernel exact div_le_div_of_nonneg_left hsin.le hxden hden theorem stripPoissonPrimitive_centered_hasDerivAt {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) (r x : ℝ) : HasDerivAt (fun s : ℝ => stripPoissonPrimitive σ (s + r) - stripPoissonPrimitive σ (s - r)) (stripPoissonKernel σ (x + r) - stripPoissonKernel σ (x - r)) x := by have hplus := (stripPoissonPrimitive_hasDerivAt hbelow habove (x + r)).comp x ((hasDerivAt_id x).add_const r) have hminus := (stripPoissonPrimitive_hasDerivAt hbelow habove (x - r)).comp x ((hasDerivAt_id x).sub_const r) convert! hplus.sub hminus using 1 all_goals simp theorem stripPoissonPrimitive_centered_antitoneOn {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) {r : ℝ} (hr : 0 ≤ r) : AntitoneOn (fun s : ℝ => stripPoissonPrimitive σ (s + r) - stripPoissonPrimitive σ (s - r)) (Ici (0 : ℝ)) := by apply antitoneOn_of_deriv_nonpos (convex_Ici 0) · intro x hx exact (stripPoissonPrimitive_centered_hasDerivAt hbelow habove r x).continuousAt.continuousWithinAt · intro x hx exact (stripPoissonPrimitive_centered_hasDerivAt hbelow habove r x).differentiableAt.differentiableWithinAt · intro x hx have hxpos : 0 ≤ x := by have hx' : 0 < x := by simpa using! hx exact hx'.le rw [(stripPoissonPrimitive_centered_hasDerivAt hbelow habove r x).deriv] apply sub_nonpos.mpr apply stripPoissonKernel_antitone_abs hbelow habove apply (sq_le_sq₀ (abs_nonneg _) (abs_nonneg _)).mp rw [sq_abs, sq_abs] nlinarith [mul_nonneg hxpos hr] theorem intervalIntegral_stripPoissonKernel {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) (a b : ℝ) : (∫ x in a..b, stripPoissonKernel σ x) = stripPoissonPrimitive σ b - stripPoissonPrimitive σ a := by apply intervalIntegral.integral_eq_sub_of_hasDerivAt · intro x hx exact stripPoissonPrimitive_hasDerivAt hbelow habove x · exact (stripPoissonKernel_integrable hbelow habove).intervalIntegrable theorem stripPoissonPrimitive_centered_neg {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) (r s : ℝ) : stripPoissonPrimitive σ (-s + r) - stripPoissonPrimitive σ (-s - r) = stripPoissonPrimitive σ (s + r) - stripPoissonPrimitive σ (s - r) := by have hneg := intervalIntegral.integral_comp_neg (f := stripPoissonKernel σ) (a := s - r) (b := s + r) simp_rw [stripPoissonKernel_neg] at hneg rw [intervalIntegral_stripPoissonKernel hbelow habove, intervalIntegral_stripPoissonKernel hbelow habove] at hneg convert! hneg.symm using 1 all_goals ring_nf theorem stripPoissonPrimitive_centered_le {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) {r : ℝ} (hr : 0 ≤ r) (s : ℝ) : stripPoissonPrimitive σ (s + r) - stripPoissonPrimitive σ (s - r) ≤ stripPoissonPrimitive σ r - stripPoissonPrimitive σ (-r) := by have hanti := stripPoissonPrimitive_centered_antitoneOn hbelow habove hr by_cases hs : 0 ≤ s · convert! hanti (show (0 : ℝ) ∈ Ici 0 by simp) (show s ∈ Ici 0 from hs) hs using 1 all_goals ring_nf · have hsneg : 0 ≤ -s := by linarith rw [← stripPoissonPrimitive_centered_neg hbelow habove r s] convert! hanti (show (0 : ℝ) ∈ Ici 0 by simp) (show -s ∈ Ici 0 from hsneg) hsneg using 1 all_goals ring_nf theorem stripPoissonKernel_centered_interval_max {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) {r : ℝ} (hr : 0 ≤ r) (s : ℝ) : (∫ x in Icc (s - r) (s + r), stripPoissonKernel σ x) ≤ ∫ x in Icc (-r) r, stripPoissonKernel σ x := by rw [integral_Icc_eq_integral_Ioc, integral_Icc_eq_integral_Ioc, ← intervalIntegral.integral_of_le (by linarith : s - r ≤ s + r), ← intervalIntegral.integral_of_le (by linarith : -r ≤ r), intervalIntegral_stripPoissonKernel hbelow habove, intervalIntegral_stripPoissonKernel hbelow habove] exact stripPoissonPrimitive_centered_le hbelow habove hr s def stripComplexPoissonKernel (σ T : ℝ) : ℂ := Complex.I * ((Complex.exp (((Real.pi * T / 2 : ℝ) : ℂ) + Complex.I * ((stripAngle σ : ℝ) : ℂ)) + 1) / (Complex.exp (((Real.pi * T / 2 : ℝ) : ℂ) + Complex.I * ((stripAngle σ : ℝ) : ℂ)) - 1)) / 4 theorem stripComplexPoissonKernel_re {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) (T : ℝ) : (stripComplexPoissonKernel σ T).re = stripPoissonKernel σ T := by obtain ⟨hangle, hangle'⟩ := stripAngle_mem_Ioo hbelow habove have hsin : 0 < Real.sin (stripAngle σ) := Real.sin_pos_of_pos_of_lt_pi hangle hangle' have hexp : 0 < Real.exp (Real.pi * T / 2) := Real.exp_pos _ have htrig := Real.sin_sq_add_cos_sq (stripAngle σ) have hden : 0 < Real.exp (Real.pi * T / 2) ^ 2 + 1 - 2 * Real.exp (Real.pi * T / 2) * Real.cos (stripAngle σ) := by nlinarith [sq_nonneg (Real.exp (Real.pi * T / 2) - Real.cos (stripAngle σ)), sq_pos_of_pos hsin] unfold stripComplexPoissonKernel stripPoissonKernel rw [Real.cosh_eq, Real.exp_neg] simp only [Complex.div_re, Complex.div_im, Complex.mul_re, Complex.I_re, Complex.I_im, zero_mul, one_mul, Complex.add_re, Complex.sub_re, Complex.add_im, Complex.sub_im, Complex.one_re, Complex.one_im, Complex.ofReal_re, Complex.ofReal_im, Complex.exp_re, Complex.exp_im, Complex.mul_im, sub_self, add_zero, zero_add, mul_zero, Complex.normSq_apply] norm_num field_simp [hexp.ne', hden.ne'] nlinarith def stripSchwarzExponential (ℓ : ℝ) (z : ℂ) (y : ℝ) : ℂ := Complex.exp (((Real.pi : ℂ) * (z - (y : ℂ) + Complex.I * (ℓ : ℂ))) / (2 * (ℓ : ℂ))) theorem stripSchwarzExponential_continuous (ℓ : ℝ) (z : ℂ) : Continuous (fun y : ℝ => stripSchwarzExponential ℓ z y) := by unfold stripSchwarzExponential fun_prop theorem stripSchwarzExponential_hasDerivAt (ℓ : ℝ) (z : ℂ) (y : ℝ) : HasDerivAt (fun w : ℂ => stripSchwarzExponential ℓ w y) (stripSchwarzExponential ℓ z y * ((Real.pi : ℂ) / (2 * (ℓ : ℂ)))) z := by have haffine := ((((hasDerivAt_id z).sub_const (y : ℂ)).add_const (Complex.I * (ℓ : ℂ))).const_mul (Real.pi : ℂ)).div_const (2 * (ℓ : ℂ)) unfold stripSchwarzExponential convert! haffine.cexp using 1 all_goals simp theorem norm_stripSchwarzExponential (ℓ : ℝ) (z : ℂ) (y : ℝ) : ‖stripSchwarzExponential ℓ z y‖ = Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) := by unfold stripSchwarzExponential rw [Complex.norm_exp, show (2 * (ℓ : ℂ)) = ((2 * ℓ : ℝ) : ℂ) by push_cast; rfl, Complex.div_ofReal_re] congr 1 simp [Complex.mul_re] theorem stripSchwarzExponential_re (ℓ : ℝ) (z : ℂ) (y : ℝ) : (stripSchwarzExponential ℓ z y).re = Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) * Real.cos (Real.pi * (z.im + ℓ) / (2 * ℓ)) := by unfold stripSchwarzExponential rw [Complex.exp_re, show (2 * (ℓ : ℂ)) = ((2 * ℓ : ℝ) : ℂ) by push_cast; rfl, Complex.div_ofReal_re, Complex.div_ofReal_im] congr 1 <;> simp [Complex.mul_re, Complex.mul_im] theorem stripSchwarzExponential_im (ℓ : ℝ) (z : ℂ) (y : ℝ) : (stripSchwarzExponential ℓ z y).im = Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) * Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ)) := by unfold stripSchwarzExponential rw [Complex.exp_im, show (2 * (ℓ : ℂ)) = ((2 * ℓ : ℝ) : ℂ) by push_cast; rfl, Complex.div_ofReal_re, Complex.div_ofReal_im] congr 1 <;> simp [Complex.mul_re, Complex.mul_im] theorem stripSchwarzAngle_mem_Ioo {ℓ : ℝ} (hℓ : 0 < ℓ) {z : ℂ} (hz : z ∈ Complex.im ⁻¹' Ioo (-ℓ) ℓ) : 0 < Real.pi * (z.im + ℓ) / (2 * ℓ) ∧ Real.pi * (z.im + ℓ) / (2 * ℓ) < Real.pi := by change -ℓ < z.im ∧ z.im < ℓ at hz constructor · exact div_pos (mul_pos Real.pi_pos (by linarith)) (mul_pos (by norm_num) hℓ) · apply (div_lt_iff₀ (mul_pos (by norm_num) hℓ)).2 nlinarith [mul_pos Real.pi_pos (show 0 < ℓ - z.im by linarith)] theorem stripSchwarzExponential_sub_one_norm_ge_sin {ℓ : ℝ} (hℓ : 0 < ℓ) {z : ℂ} (hz : z ∈ Complex.im ⁻¹' Ioo (-ℓ) ℓ) (y : ℝ) : Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ)) ≤ ‖stripSchwarzExponential ℓ z y - 1‖ := by obtain ⟨hangle, hangle'⟩ := stripSchwarzAngle_mem_Ioo hℓ hz have hsin : 0 < Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ)) := Real.sin_pos_of_pos_of_lt_pi hangle hangle' have htrig := Real.sin_sq_add_cos_sq (Real.pi * (z.im + ℓ) / (2 * ℓ)) have hsquare : Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ)) ^ 2 ≤ ‖stripSchwarzExponential ℓ z y - 1‖ ^ 2 := by rw [← Complex.normSq_eq_norm_sq, Complex.normSq_apply, Complex.sub_re, Complex.sub_im, Complex.one_re, Complex.one_im, sub_zero, stripSchwarzExponential_re, stripSchwarzExponential_im] nlinarith [sq_nonneg (Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) - Real.cos (Real.pi * (z.im + ℓ) / (2 * ℓ)))] nlinarith [norm_nonneg (stripSchwarzExponential ℓ z y - 1)] theorem stripSchwarzExponential_sub_one_norm_ge_exp_mul_sin {ℓ : ℝ} (hℓ : 0 < ℓ) {z : ℂ} (hz : z ∈ Complex.im ⁻¹' Ioo (-ℓ) ℓ) (y : ℝ) : Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) * Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ)) ≤ ‖stripSchwarzExponential ℓ z y - 1‖ := by obtain ⟨hangle, hangle'⟩ := stripSchwarzAngle_mem_Ioo hℓ hz have hsin : 0 < Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ)) := Real.sin_pos_of_pos_of_lt_pi hangle hangle' calc Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) * Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ)) = |(stripSchwarzExponential ℓ z y - 1).im| := by rw [Complex.sub_im, Complex.one_im, sub_zero, stripSchwarzExponential_im, abs_of_pos (mul_pos (Real.exp_pos _) hsin)] _ ≤ ‖stripSchwarzExponential ℓ z y - 1‖ := Complex.abs_im_le_norm _ def stripHolomorphicPoissonKernel (ℓ : ℝ) (z : ℂ) (y : ℝ) : ℂ := (Complex.I * ((Complex.exp (((Real.pi : ℂ) * (z - (y : ℂ) + Complex.I * (ℓ : ℂ))) / (2 * (ℓ : ℂ))) + 1) / (Complex.exp (((Real.pi : ℂ) * (z - (y : ℂ) + Complex.I * (ℓ : ℂ))) / (2 * (ℓ : ℂ))) - 1)) / 4) / (ℓ : ℂ) theorem stripHolomorphicPoissonKernel_denominator_ne_zero {ℓ : ℝ} (hℓ : 0 < ℓ) {z : ℂ} (hz : z ∈ Complex.im ⁻¹' Ioo (-ℓ) ℓ) (y : ℝ) : Complex.exp (((Real.pi : ℂ) * (z - (y : ℂ) + Complex.I * (ℓ : ℂ))) / (2 * (ℓ : ℂ))) - 1 ≠ 0 := by change -ℓ < z.im ∧ z.im < ℓ at hz have hargument : (((Real.pi : ℂ) * (z - (y : ℂ) + Complex.I * (ℓ : ℂ))) / (2 * (ℓ : ℂ))).im = Real.pi * (z.im + ℓ) / (2 * ℓ) := by rw [show (2 * (ℓ : ℂ)) = ((2 * ℓ : ℝ) : ℂ) by push_cast; rfl, Complex.div_ofReal_im] simp [Complex.mul_im] have hpositive : 0 < Real.pi * (z.im + ℓ) / (2 * ℓ) := by exact div_pos (mul_pos Real.pi_pos (by linarith)) (mul_pos (by norm_num) hℓ) have hless : Real.pi * (z.im + ℓ) / (2 * ℓ) < Real.pi := by apply (div_lt_iff₀ (mul_pos (by norm_num) hℓ)).2 nlinarith [mul_pos Real.pi_pos (show 0 < ℓ - z.im by linarith)] have hsin := Real.sin_pos_of_pos_of_lt_pi hpositive hless intro hzero have him := congrArg Complex.im hzero simp only [Complex.sub_im, Complex.one_im, sub_zero, Complex.exp_im, hargument] at him exact (mul_pos (Real.exp_pos _) hsin).ne' him theorem stripHolomorphicPoissonKernel_eq_scaled {ℓ : ℝ} (hℓ : 0 < ℓ) (σ s y : ℝ) : stripHolomorphicPoissonKernel ℓ ((s : ℂ) + Complex.I * ((σ * ℓ : ℝ) : ℂ)) y = stripComplexPoissonKernel σ ((s - y) / ℓ) / (ℓ : ℂ) := by have hℓc : (ℓ : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hℓ.ne' have hargument : ((Real.pi : ℂ) * (((s : ℂ) + Complex.I * ((σ * ℓ : ℝ) : ℂ)) - (y : ℂ) + Complex.I * (ℓ : ℂ))) / (2 * (ℓ : ℂ)) = ((Real.pi * ((s - y) / ℓ) / 2 : ℝ) : ℂ) + Complex.I * ((stripAngle σ : ℝ) : ℂ) := by unfold stripAngle push_cast field_simp [hℓc] ring unfold stripHolomorphicPoissonKernel stripComplexPoissonKernel rw [hargument] theorem stripHolomorphicPoissonKernel_re {ℓ σ : ℝ} (hℓ : 0 < ℓ) (hbelow : -1 < σ) (habove : σ < 1) (s y : ℝ) : (stripHolomorphicPoissonKernel ℓ ((s : ℂ) + Complex.I * ((σ * ℓ : ℝ) : ℂ)) y).re = stripPoissonKernel σ ((s - y) / ℓ) / ℓ := by rw [stripHolomorphicPoissonKernel_eq_scaled hℓ, Complex.div_ofReal_re, stripComplexPoissonKernel_re hbelow habove] def stripRegularizedHolomorphicPoissonKernel (ℓ : ℝ) (z : ℂ) (y : ℝ) : ℂ := stripHolomorphicPoissonKernel ℓ z y + (if 0 ≤ y then Complex.I else -Complex.I) / ((4 * ℓ : ℝ) : ℂ) theorem stripRegularizedHolomorphicPoissonKernel_hasDerivAt {ℓ : ℝ} (hℓ : 0 < ℓ) {z : ℂ} (hz : z ∈ Complex.im ⁻¹' Ioo (-ℓ) ℓ) (y : ℝ) : HasDerivAt (fun w : ℂ => stripRegularizedHolomorphicPoissonKernel ℓ w y) (-(Complex.I * (Real.pi : ℂ) * stripSchwarzExponential ℓ z y) / (4 * (ℓ : ℂ) ^ 2 * (stripSchwarzExponential ℓ z y - 1) ^ 2)) z := by have hℓc : (ℓ : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hℓ.ne' have hden : stripSchwarzExponential ℓ z y - 1 ≠ 0 := by simpa [stripSchwarzExponential] using! stripHolomorphicPoissonKernel_denominator_ne_zero hℓ hz y have hexp := stripSchwarzExponential_hasDerivAt ℓ z y have hratio := (hexp.add_const 1).div (hexp.sub_const 1) hden have hkernel := ((((hratio.const_mul Complex.I).div_const (4 : ℂ)).div_const (ℓ : ℂ))).add_const ((if 0 ≤ y then Complex.I else -Complex.I) / ((4 * ℓ : ℝ) : ℂ)) unfold stripRegularizedHolomorphicPoissonKernel stripHolomorphicPoissonKernel convert! hkernel using 1 field_simp [hℓc, hden] ring def stripRegularizedHolomorphicPoissonKernelDeriv (ℓ : ℝ) (z : ℂ) (y : ℝ) : ℂ := -(Complex.I * (Real.pi : ℂ) * stripSchwarzExponential ℓ z y) / (4 * (ℓ : ℂ) ^ 2 * (stripSchwarzExponential ℓ z y - 1) ^ 2) theorem stripRegularizedHolomorphicPoissonKernel_hasDerivAt_deriv {ℓ : ℝ} (hℓ : 0 < ℓ) {z : ℂ} (hz : z ∈ Complex.im ⁻¹' Ioo (-ℓ) ℓ) (y : ℝ) : HasDerivAt (fun w : ℂ => stripRegularizedHolomorphicPoissonKernel ℓ w y) (stripRegularizedHolomorphicPoissonKernelDeriv ℓ z y) z := by simpa [stripRegularizedHolomorphicPoissonKernelDeriv] using! stripRegularizedHolomorphicPoissonKernel_hasDerivAt hℓ hz y theorem norm_stripRegularizedHolomorphicPoissonKernelDeriv_pos {ℓ : ℝ} (hℓ : 0 < ℓ) {z : ℂ} (hz : z ∈ Complex.im ⁻¹' Ioo (-ℓ) ℓ) (y : ℝ) : ‖stripRegularizedHolomorphicPoissonKernelDeriv ℓ z y‖ ≤ Real.pi * Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) / (4 * ℓ ^ 2 * Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ)) ^ 2) := by obtain ⟨hangle, hangle'⟩ := stripSchwarzAngle_mem_Ioo hℓ hz have hsin : 0 < Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ)) := Real.sin_pos_of_pos_of_lt_pi hangle hangle' have hden := stripSchwarzExponential_sub_one_norm_ge_sin hℓ hz y have hsq : Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ)) ^ 2 ≤ ‖stripSchwarzExponential ℓ z y - 1‖ ^ 2 := by nlinarith [norm_nonneg (stripSchwarzExponential ℓ z y - 1)] calc ‖stripRegularizedHolomorphicPoissonKernelDeriv ℓ z y‖ = Real.pi * Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) / (4 * ℓ ^ 2 * ‖stripSchwarzExponential ℓ z y - 1‖ ^ 2) := by unfold stripRegularizedHolomorphicPoissonKernelDeriv rw [norm_div, norm_neg, norm_mul, norm_mul, norm_mul, norm_mul, norm_pow, norm_pow, norm_stripSchwarzExponential] simp [Real.norm_eq_abs, abs_of_pos hℓ, abs_of_pos Real.pi_pos] _ ≤ Real.pi * Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) / (4 * ℓ ^ 2 * Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ)) ^ 2) := by apply div_le_div_of_nonneg_left (mul_nonneg Real.pi_pos.le (Real.exp_pos _).le) (by positivity) exact mul_le_mul_of_nonneg_left hsq (by positivity) theorem norm_stripRegularizedHolomorphicPoissonKernelDeriv_neg {ℓ : ℝ} (hℓ : 0 < ℓ) {z : ℂ} (hz : z ∈ Complex.im ⁻¹' Ioo (-ℓ) ℓ) (y : ℝ) : ‖stripRegularizedHolomorphicPoissonKernelDeriv ℓ z y‖ ≤ Real.pi * Real.exp (-(Real.pi * (z.re - y) / (2 * ℓ))) / (4 * ℓ ^ 2 * Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ)) ^ 2) := by obtain ⟨hangle, hangle'⟩ := stripSchwarzAngle_mem_Ioo hℓ hz have hsin : 0 < Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ)) := Real.sin_pos_of_pos_of_lt_pi hangle hangle' have hexp : 0 < Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) := Real.exp_pos _ have hden := stripSchwarzExponential_sub_one_norm_ge_exp_mul_sin hℓ hz y have hsq : (Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) * Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ))) ^ 2 ≤ ‖stripSchwarzExponential ℓ z y - 1‖ ^ 2 := by exact (sq_le_sq₀ (mul_pos hexp hsin).le (norm_nonneg (stripSchwarzExponential ℓ z y - 1))).2 hden calc ‖stripRegularizedHolomorphicPoissonKernelDeriv ℓ z y‖ = Real.pi * Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) / (4 * ℓ ^ 2 * ‖stripSchwarzExponential ℓ z y - 1‖ ^ 2) := by unfold stripRegularizedHolomorphicPoissonKernelDeriv rw [norm_div, norm_neg, norm_mul, norm_mul, norm_mul, norm_mul, norm_pow, norm_pow, norm_stripSchwarzExponential] simp [Real.norm_eq_abs, abs_of_pos hℓ, abs_of_pos Real.pi_pos] _ ≤ Real.pi * Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) / (4 * ℓ ^ 2 * (Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) * Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ))) ^ 2) := by apply div_le_div_of_nonneg_left (mul_nonneg Real.pi_pos.le (Real.exp_pos _).le) (by positivity) exact mul_le_mul_of_nonneg_left hsq (by positivity) _ = Real.pi * Real.exp (-(Real.pi * (z.re - y) / (2 * ℓ))) / (4 * ℓ ^ 2 * Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ)) ^ 2) := by rw [Real.exp_neg] field_simp [hℓ.ne', hexp.ne', hsin.ne'] theorem stripRegularizedHolomorphicPoissonKernelDeriv_continuous {ℓ : ℝ} (hℓ : 0 < ℓ) {z : ℂ} (hz : z ∈ Complex.im ⁻¹' Ioo (-ℓ) ℓ) : Continuous (fun y : ℝ => stripRegularizedHolomorphicPoissonKernelDeriv ℓ z y) := by have hcoordinate := stripSchwarzExponential_continuous ℓ z unfold stripRegularizedHolomorphicPoissonKernelDeriv apply Continuous.div · exact ((continuous_const.mul continuous_const).mul hcoordinate).neg · exact continuous_const.mul ((hcoordinate.sub continuous_const).pow 2) · intro y apply mul_ne_zero · exact mul_ne_zero (by norm_num) (pow_ne_zero 2 (Complex.ofReal_ne_zero.mpr hℓ.ne')) · apply pow_ne_zero simpa [stripSchwarzExponential] using! stripHolomorphicPoissonKernel_denominator_ne_zero hℓ hz y theorem stripRegularizedHolomorphicPoissonKernelDeriv_local_bound {ℓ : ℝ} (hℓ : 0 < ℓ) {z : ℂ} (hz : z ∈ Complex.im ⁻¹' Ioo (-ℓ) ℓ) : ∃ S ∈ 𝓝 z, ∃ C : ℝ, 0 ≤ C ∧ ∀ w ∈ S, ∀ y : ℝ, ‖stripRegularizedHolomorphicPoissonKernelDeriv ℓ w y‖ ≤ C * Real.exp (-(Real.pi / (2 * ℓ)) * |y|) := by obtain ⟨hangle, hangle'⟩ := stripSchwarzAngle_mem_Ioo hℓ hz let a : ℝ := Real.pi / (2 * ℓ) let A : ℂ → ℝ := fun w => Real.sin (Real.pi * (w.im + ℓ) / (2 * ℓ)) let sin0 : ℝ := A z let D : ℝ := 4 * ℓ ^ 2 * (sin0 / 2) ^ 2 let Cpos : ℝ := Real.pi * Real.exp (a * (z.re + 1)) / D let Cneg : ℝ := Real.pi * Real.exp (-a * (z.re - 1)) / D have ha : 0 < a := by try dsimp [a] exact div_pos Real.pi_pos (mul_pos (by norm_num) hℓ) have hsin0 : 0 < sin0 := by try dsimp [sin0, A] exact Real.sin_pos_of_pos_of_lt_pi hangle hangle' have hD : 0 < D := by try dsimp [D] positivity have hA : Continuous A := by try dsimp [A] fun_prop have hstrip : Complex.im ⁻¹' Ioo (-ℓ) ℓ ∈ 𝓝 z := by have him : Continuous (fun w : ℂ => w.im) := by fun_prop exact (isOpen_Ioo.preimage him).mem_nhds hz have hsinset : A ⁻¹' Ioi (sin0 / 2) ∈ 𝓝 z := by apply (isOpen_Ioi.preimage hA).mem_nhds change sin0 / 2 < sin0 linarith have hCpos : 0 ≤ Cpos := by try dsimp [Cpos] positivity have hCneg : 0 ≤ Cneg := by try dsimp [Cneg] positivity refine ⟨Metric.ball z 1 ∩ (Complex.im ⁻¹' Ioo (-ℓ) ℓ) ∩ (A ⁻¹' Ioi (sin0 / 2)), inter_mem (inter_mem (Metric.ball_mem_nhds z (by norm_num)) hstrip) hsinset, Cpos + Cneg, add_nonneg hCpos hCneg, ?_⟩ intro w hw y obtain ⟨⟨hwball, hwstrip⟩, hwsin⟩ := hw have hdist : ‖w - z‖ < (1 : ℝ) := by simpa [Metric.mem_ball, dist_eq_norm, norm_sub_rev] using! hwball have hreabs := Complex.abs_re_le_norm (w - z) simp only [Complex.sub_re] at hreabs have hreupper : w.re ≤ z.re + 1 := by linarith [le_abs_self (w.re - z.re)] have hrelower : z.re - 1 ≤ w.re := by linarith [neg_le_abs (w.re - z.re)] have hsinw : sin0 / 2 < Real.sin (Real.pi * (w.im + ℓ) / (2 * ℓ)) := by exact hwsin have hden : D ≤ 4 * ℓ ^ 2 * Real.sin (Real.pi * (w.im + ℓ) / (2 * ℓ)) ^ 2 := by try dsimp [D] apply mul_le_mul_of_nonneg_left _ (by positivity) exact (sq_le_sq₀ (by positivity) (le_trans (by positivity : 0 ≤ sin0 / 2) hsinw.le)).2 hsinw.le rcases le_total 0 y with hy | hy · have hnum : Real.pi * Real.exp (Real.pi * (w.re - y) / (2 * ℓ)) ≤ Real.pi * Real.exp (a * (z.re + 1 - y)) := by apply mul_le_mul_of_nonneg_left _ Real.pi_pos.le apply Real.exp_le_exp.mpr calc Real.pi * (w.re - y) / (2 * ℓ) = a * (w.re - y) := by try dsimp [a] ring _ ≤ a * (z.re + 1 - y) := mul_le_mul_of_nonneg_left (by linarith) ha.le calc ‖stripRegularizedHolomorphicPoissonKernelDeriv ℓ w y‖ ≤ Real.pi * Real.exp (Real.pi * (w.re - y) / (2 * ℓ)) / (4 * ℓ ^ 2 * Real.sin (Real.pi * (w.im + ℓ) / (2 * ℓ)) ^ 2) := norm_stripRegularizedHolomorphicPoissonKernelDeriv_pos hℓ hwstrip y _ ≤ Real.pi * Real.exp (a * (z.re + 1 - y)) / D := by exact div_le_div₀ (by positivity) hnum hD hden _ = Cpos * Real.exp ((-a) * y) := by have hsplit : Real.exp (a * (z.re + 1 - y)) = Real.exp (a * (z.re + 1)) * Real.exp ((-a) * y) := by rw [← Real.exp_add] congr 1 ring rw [hsplit] try dsimp [Cpos] ring _ ≤ (Cpos + Cneg) * Real.exp (-(Real.pi / (2 * ℓ)) * |y|) := by rw [abs_of_nonneg hy] change Cpos * Real.exp ((-a) * y) ≤ (Cpos + Cneg) * Real.exp ((-a) * y) exact mul_le_mul_of_nonneg_right (by linarith) (Real.exp_pos _).le · have hnum : Real.pi * Real.exp (-(Real.pi * (w.re - y) / (2 * ℓ))) ≤ Real.pi * Real.exp (-a * (z.re - 1 - y)) := by apply mul_le_mul_of_nonneg_left _ Real.pi_pos.le apply Real.exp_le_exp.mpr calc -(Real.pi * (w.re - y) / (2 * ℓ)) = -(a * (w.re - y)) := by try dsimp [a] ring _ ≤ -(a * (z.re - 1 - y)) := by apply neg_le_neg exact mul_le_mul_of_nonneg_left (by linarith) ha.le _ = -a * (z.re - 1 - y) := by ring calc ‖stripRegularizedHolomorphicPoissonKernelDeriv ℓ w y‖ ≤ Real.pi * Real.exp (-(Real.pi * (w.re - y) / (2 * ℓ))) / (4 * ℓ ^ 2 * Real.sin (Real.pi * (w.im + ℓ) / (2 * ℓ)) ^ 2) := norm_stripRegularizedHolomorphicPoissonKernelDeriv_neg hℓ hwstrip y _ ≤ Real.pi * Real.exp (-a * (z.re - 1 - y)) / D := by exact div_le_div₀ (by positivity) hnum hD hden _ = Cneg * Real.exp (a * y) := by have hsplit : Real.exp (-a * (z.re - 1 - y)) = Real.exp (-a * (z.re - 1)) * Real.exp (a * y) := by rw [← Real.exp_add] congr 1 ring rw [hsplit] try dsimp [Cneg] ring _ ≤ (Cpos + Cneg) * Real.exp (-(Real.pi / (2 * ℓ)) * |y|) := by rw [abs_of_nonpos hy] change Cneg * Real.exp (a * y) ≤ (Cpos + Cneg) * Real.exp ((-a) * (-y)) have hexp : Real.exp ((-a) * (-y)) = Real.exp (a * y) := by congr 1 ring rw [hexp] exact mul_le_mul_of_nonneg_right (by linarith) (Real.exp_pos _).le theorem stripRegularizedHolomorphicPoissonKernel_of_nonneg {ℓ : ℝ} (hℓ : 0 < ℓ) {z : ℂ} (hz : z ∈ Complex.im ⁻¹' Ioo (-ℓ) ℓ) {y : ℝ} (hy : 0 ≤ y) : stripRegularizedHolomorphicPoissonKernel ℓ z y = Complex.I * stripSchwarzExponential ℓ z y / (2 * (ℓ : ℂ) * (stripSchwarzExponential ℓ z y - 1)) := by have hℓc : (ℓ : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hℓ.ne' have hden := stripHolomorphicPoissonKernel_denominator_ne_zero hℓ hz y let w := stripSchwarzExponential ℓ z y have hw : w - 1 ≠ 0 := by simpa [w, stripSchwarzExponential] using! hden unfold stripRegularizedHolomorphicPoissonKernel stripHolomorphicPoissonKernel rw [if_pos hy] change (Complex.I * ((w + 1) / (w - 1)) / 4) / (ℓ : ℂ) + Complex.I / ((4 * ℓ : ℝ) : ℂ) = Complex.I * w / (2 * (ℓ : ℂ) * (w - 1)) rw [show ((4 * ℓ : ℝ) : ℂ) = 4 * (ℓ : ℂ) by push_cast; rfl] field_simp [hℓc, hw] ring theorem stripRegularizedHolomorphicPoissonKernel_of_neg {ℓ : ℝ} (hℓ : 0 < ℓ) {z : ℂ} (hz : z ∈ Complex.im ⁻¹' Ioo (-ℓ) ℓ) {y : ℝ} (hy : y < 0) : stripRegularizedHolomorphicPoissonKernel ℓ z y = Complex.I / (2 * (ℓ : ℂ) * (stripSchwarzExponential ℓ z y - 1)) := by have hℓc : (ℓ : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hℓ.ne' have hden := stripHolomorphicPoissonKernel_denominator_ne_zero hℓ hz y let w := stripSchwarzExponential ℓ z y have hw : w - 1 ≠ 0 := by simpa [w, stripSchwarzExponential] using! hden unfold stripRegularizedHolomorphicPoissonKernel stripHolomorphicPoissonKernel rw [if_neg (not_le.mpr hy)] change (Complex.I * ((w + 1) / (w - 1)) / 4) / (ℓ : ℂ) + (-Complex.I) / ((4 * ℓ : ℝ) : ℂ) = Complex.I / (2 * (ℓ : ℂ) * (w - 1)) rw [show ((4 * ℓ : ℝ) : ℂ) = 4 * (ℓ : ℂ) by push_cast; rfl] field_simp [hℓc, hw] ring theorem norm_stripRegularizedHolomorphicPoissonKernel_of_nonneg {ℓ : ℝ} (hℓ : 0 < ℓ) {z : ℂ} (hz : z ∈ Complex.im ⁻¹' Ioo (-ℓ) ℓ) {y : ℝ} (hy : 0 ≤ y) : ‖stripRegularizedHolomorphicPoissonKernel ℓ z y‖ ≤ Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) / (2 * ℓ * Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ))) := by obtain ⟨hangle, hangle'⟩ := stripSchwarzAngle_mem_Ioo hℓ hz have hsin : 0 < Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ)) := Real.sin_pos_of_pos_of_lt_pi hangle hangle' have hden := stripSchwarzExponential_sub_one_norm_ge_sin hℓ hz y calc ‖stripRegularizedHolomorphicPoissonKernel ℓ z y‖ = Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) / (2 * ℓ * ‖stripSchwarzExponential ℓ z y - 1‖) := by rw [stripRegularizedHolomorphicPoissonKernel_of_nonneg hℓ hz hy, norm_div, norm_mul, norm_mul, norm_stripSchwarzExponential] simp [abs_of_pos hℓ] _ ≤ Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) / (2 * ℓ * Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ))) := by apply div_le_div_of_nonneg_left (Real.exp_pos _).le (mul_pos (mul_pos (by norm_num) hℓ) hsin) exact mul_le_mul_of_nonneg_left hden (mul_pos (by norm_num) hℓ).le theorem norm_stripRegularizedHolomorphicPoissonKernel_of_neg {ℓ : ℝ} (hℓ : 0 < ℓ) {z : ℂ} (hz : z ∈ Complex.im ⁻¹' Ioo (-ℓ) ℓ) {y : ℝ} (hy : y < 0) : ‖stripRegularizedHolomorphicPoissonKernel ℓ z y‖ ≤ Real.exp (-(Real.pi * (z.re - y) / (2 * ℓ))) / (2 * ℓ * Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ))) := by obtain ⟨hangle, hangle'⟩ := stripSchwarzAngle_mem_Ioo hℓ hz have hsin : 0 < Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ)) := Real.sin_pos_of_pos_of_lt_pi hangle hangle' have hexp : 0 < Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) := Real.exp_pos _ have hden := stripSchwarzExponential_sub_one_norm_ge_exp_mul_sin hℓ hz y calc ‖stripRegularizedHolomorphicPoissonKernel ℓ z y‖ = 1 / (2 * ℓ * ‖stripSchwarzExponential ℓ z y - 1‖) := by rw [stripRegularizedHolomorphicPoissonKernel_of_neg hℓ hz hy, norm_div, norm_mul, norm_mul] simp [abs_of_pos hℓ] _ ≤ 1 / (2 * ℓ * (Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) * Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ)))) := by apply div_le_div_of_nonneg_left (by norm_num) (mul_pos (mul_pos (by norm_num) hℓ) (mul_pos hexp hsin)) exact mul_le_mul_of_nonneg_left hden (mul_pos (by norm_num) hℓ).le _ = Real.exp (-(Real.pi * (z.re - y) / (2 * ℓ))) / (2 * ℓ * Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ))) := by rw [Real.exp_neg] field_simp [hℓ.ne', hexp.ne', hsin.ne'] theorem stripRegularizedHolomorphicPoissonKernel_continuousOn_Ioi {ℓ : ℝ} (hℓ : 0 < ℓ) {z : ℂ} (hz : z ∈ Complex.im ⁻¹' Ioo (-ℓ) ℓ) : ContinuousOn (fun y : ℝ => stripRegularizedHolomorphicPoissonKernel ℓ z y) (Ioi (0 : ℝ)) := by have hcoordinate := stripSchwarzExponential_continuous ℓ z have hden : ∀ y : ℝ, stripSchwarzExponential ℓ z y - 1 ≠ 0 := by intro y simpa [stripSchwarzExponential] using! stripHolomorphicPoissonKernel_denominator_ne_zero hℓ hz y have hform : Continuous (fun y : ℝ => Complex.I * stripSchwarzExponential ℓ z y / (2 * (ℓ : ℂ) * (stripSchwarzExponential ℓ z y - 1))) := by apply (continuous_const.mul hcoordinate).div (continuous_const.mul (hcoordinate.sub continuous_const)) intro y exact mul_ne_zero (mul_ne_zero (by norm_num : (2 : ℂ) ≠ 0) (Complex.ofReal_ne_zero.mpr hℓ.ne')) (hden y) refine hform.continuousOn.congr ?_ intro y hy exact stripRegularizedHolomorphicPoissonKernel_of_nonneg hℓ hz (mem_Ioi.mp hy).le theorem stripRegularizedHolomorphicPoissonKernel_continuousOn_Iio {ℓ : ℝ} (hℓ : 0 < ℓ) {z : ℂ} (hz : z ∈ Complex.im ⁻¹' Ioo (-ℓ) ℓ) : ContinuousOn (fun y : ℝ => stripRegularizedHolomorphicPoissonKernel ℓ z y) (Iio (0 : ℝ)) := by have hcoordinate := stripSchwarzExponential_continuous ℓ z have hden : ∀ y : ℝ, stripSchwarzExponential ℓ z y - 1 ≠ 0 := by intro y simpa [stripSchwarzExponential] using! stripHolomorphicPoissonKernel_denominator_ne_zero hℓ hz y have hform : Continuous (fun y : ℝ => Complex.I / (2 * (ℓ : ℂ) * (stripSchwarzExponential ℓ z y - 1))) := by apply continuous_const.div (continuous_const.mul (hcoordinate.sub continuous_const)) intro y exact mul_ne_zero (mul_ne_zero (by norm_num : (2 : ℂ) ≠ 0) (Complex.ofReal_ne_zero.mpr hℓ.ne')) (hden y) refine hform.continuousOn.congr ?_ intro y hy exact stripRegularizedHolomorphicPoissonKernel_of_neg hℓ hz (mem_Iio.mp hy) theorem strip_exp_abs_integrable {a : ℝ} (ha : 0 < a) : Integrable (fun y : ℝ => Real.exp ((-a) * |y|)) := by have hright : IntegrableOn (fun y : ℝ => Real.exp ((-a) * |y|)) (Ioi (0 : ℝ)) := by refine (integrableOn_exp_mul_Ioi (neg_lt_zero.mpr ha) 0).congr_fun ?_ measurableSet_Ioi intro y hy try dsimp rw [abs_of_pos (mem_Ioi.mp hy)] have hreflected : IntegrableOn ((fun y : ℝ => Real.exp ((-a) * |y|)) ∘ (fun y : ℝ => -y)) ((fun y : ℝ => -y) ⁻¹' Iio (0 : ℝ)) := by simpa [Function.comp_def, neg_preimage, neg_Iio, abs_neg] using! hright have hleft : IntegrableOn (fun y : ℝ => Real.exp ((-a) * |y|)) (Iio (0 : ℝ)) := ((Measure.measurePreserving_neg (volume : Measure ℝ)).integrableOn_comp_preimage (Homeomorph.neg ℝ).measurableEmbedding).mp hreflected rw [← integrableOn_univ, ← @Iio_union_Ici _ _ (0 : ℝ), integrableOn_union, integrableOn_Ici_iff_integrableOn_Ioi] exact ⟨hleft, hright⟩ theorem strip_abs_log_le_add_rpow {x : ℝ} (hx : 0 < x) : |Real.log x| ≤ x + 2 * x ^ (-(1 / 2 : ℝ)) := by by_cases hlarge : 1 ≤ x · rw [abs_of_nonneg (Real.log_nonneg hlarge)] have hlog := Real.log_le_sub_one_of_pos hx have hpower := Real.rpow_pos_of_pos hx (-(1 / 2 : ℝ)) nlinarith · have hsmall : x ≤ 1 := le_of_not_ge hlarge rw [abs_of_nonpos (Real.log_nonpos hx.le hsmall)] have hpower := Real.rpow_pos_of_pos hx (-(1 / 2 : ℝ)) have hlog := Real.log_le_sub_one_of_pos hpower rw [Real.log_rpow hx] at hlog nlinarith theorem strip_exp_abs_log_integrableOn_Ioi {a : ℝ} (ha : 0 < a) : IntegrableOn (fun x : ℝ => Real.exp ((-a) * x) * |Real.log x|) (Ioi (0 : ℝ)) := by have hlinear : IntegrableOn (fun x : ℝ => x * Real.exp ((-a) * x)) (Ioi (0 : ℝ)) := by simpa [Real.rpow_one] using! (integrableOn_rpow_mul_exp_neg_mul_rpow (p := (1 : ℝ)) (s := (1 : ℝ)) (b := a) (by norm_num) (by norm_num) ha) have hhalf : IntegrableOn (fun x : ℝ => x ^ (-(1 / 2 : ℝ)) * Real.exp ((-a) * x)) (Ioi (0 : ℝ)) := by simpa [Real.rpow_one] using! (integrableOn_rpow_mul_exp_neg_mul_rpow (p := (1 : ℝ)) (s := -(1 / 2 : ℝ)) (b := a) (by norm_num) (by norm_num) ha) have hmajorant : IntegrableOn (fun x : ℝ => x * Real.exp ((-a) * x) + 2 * (x ^ (-(1 / 2 : ℝ)) * Real.exp ((-a) * x))) (Ioi (0 : ℝ)) := hlinear.add (hhalf.const_mul 2) have hlogcontinuous : ContinuousOn (fun x : ℝ => Real.log x) (Ioi (0 : ℝ)) := continuousOn_id.log (fun x hx => (mem_Ioi.mp hx).ne') have hexpcontinuous : ContinuousOn (fun x : ℝ => Real.exp ((-a) * x)) (Ioi (0 : ℝ)) := by fun_prop apply hmajorant.mono' ((hexpcontinuous.mul hlogcontinuous.abs).aestronglyMeasurable measurableSet_Ioi) filter_upwards [ae_restrict_mem measurableSet_Ioi] with x hx have hlog := strip_abs_log_le_add_rpow (mem_Ioi.mp hx) change ‖Real.exp ((-a) * x) * |Real.log x|‖ ≤ _ rw [Real.norm_eq_abs, abs_mul, abs_of_pos (Real.exp_pos _), abs_abs] calc Real.exp ((-a) * x) * |Real.log x| ≤ Real.exp ((-a) * x) * (x + 2 * x ^ (-(1 / 2 : ℝ))) := mul_le_mul_of_nonneg_left hlog (Real.exp_pos _).le _ = x * Real.exp ((-a) * x) + 2 * (x ^ (-(1 / 2 : ℝ)) * Real.exp ((-a) * x)) := by ring theorem strip_exp_abs_log_integrableOn_Iio {a : ℝ} (ha : 0 < a) : IntegrableOn (fun x : ℝ => Real.exp (a * x) * |Real.log (-x)|) (Iio (0 : ℝ)) := by have hright := strip_exp_abs_log_integrableOn_Ioi ha have hreflected : IntegrableOn ((fun x : ℝ => Real.exp (a * x) * |Real.log (-x)|) ∘ (fun x : ℝ => -x)) ((fun x : ℝ => -x) ⁻¹' Iio (0 : ℝ)) := by simpa [Function.comp_def, neg_preimage, neg_Iio, mul_neg, neg_mul] using! hright exact ((Measure.measurePreserving_neg (volume : Measure ℝ)).integrableOn_comp_preimage (Homeomorph.neg ℝ).measurableEmbedding).mp hreflected theorem strip_exp_abs_log_abs_integrable {a : ℝ} (ha : 0 < a) : Integrable (fun x : ℝ => Real.exp ((-a) * |x|) * |Real.log (|x|)|) := by have hright : IntegrableOn (fun x : ℝ => Real.exp ((-a) * |x|) * |Real.log (|x|)|) (Ioi (0 : ℝ)) := by refine (strip_exp_abs_log_integrableOn_Ioi ha).congr_fun ?_ measurableSet_Ioi intro x hx try dsimp rw [abs_of_pos (mem_Ioi.mp hx)] have hleft : IntegrableOn (fun x : ℝ => Real.exp ((-a) * |x|) * |Real.log (|x|)|) (Iio (0 : ℝ)) := by refine (strip_exp_abs_log_integrableOn_Iio ha).congr_fun ?_ measurableSet_Iio intro x hx try dsimp rw [abs_of_neg (mem_Iio.mp hx)] simp [mul_neg, neg_mul] rw [← integrableOn_univ, ← @Iio_union_Ici _ _ (0 : ℝ), integrableOn_union, integrableOn_Ici_iff_integrableOn_Ioi] exact ⟨hleft, hright⟩ theorem stripRegularizedHolomorphicPoissonKernel_re {ℓ σ : ℝ} (hℓ : 0 < ℓ) (hbelow : -1 < σ) (habove : σ < 1) (s y : ℝ) : (stripRegularizedHolomorphicPoissonKernel ℓ ((s : ℂ) + Complex.I * ((σ * ℓ : ℝ) : ℂ)) y).re = stripPoissonKernel σ ((s - y) / ℓ) / ℓ := by unfold stripRegularizedHolomorphicPoissonKernel rw [Complex.add_re, Complex.div_ofReal_re, stripHolomorphicPoissonKernel_re hℓ hbelow habove] split <;> simp end noncomputable section open Filter MeasureTheory Set open scoped FourierTransform Interval RealInnerProductSpace Topology def profileNegativePart (φ : ℝ → ℝ) (v : ℝ) : ℝ := max (-φ v) 0 theorem profileNegativePart_integrable {φ : ℝ → ℝ} (hφ : Integrable φ) : Integrable (profileNegativePart φ) := by change Integrable ((-φ) ⊔ (0 : ℝ → ℝ)) exact hφ.neg.sup (integrable_zero ℝ ℝ volume) theorem abs_sub_eq_two_profileNegativePart (φ : ℝ → ℝ) (v : ℝ) : |φ v| - φ v = 2 * profileNegativePart φ v := by unfold profileNegativePart rcases le_total 0 (φ v) with h | h · rw [abs_of_nonneg h, max_eq_right (by linarith)] ring · rw [abs_of_nonpos h, max_eq_left (by linarith)] ring theorem integral_profileNegativePart_eq_half {φ : ℝ → ℝ} (hφ : Integrable φ) (hmean : (∫ v : ℝ, φ v) = 0) (hmass : (∫ v : ℝ, |φ v|) = 1) : (∫ v : ℝ, profileNegativePart φ v) = (1 / 2 : ℝ) := by have hsigned : (∫ v : ℝ, (|φ v| - φ v)) = 1 := by rw [integral_sub hφ.abs hφ, hmass, hmean] norm_num have htwice : (∫ v : ℝ, (|φ v| - φ v)) = 2 * ∫ v : ℝ, profileNegativePart φ v := by calc (∫ v : ℝ, (|φ v| - φ v)) = ∫ v : ℝ, 2 * profileNegativePart φ v := by apply integral_congr_ae exact Filter.Eventually.of_forall (abs_sub_eq_two_profileNegativePart φ) _ = 2 * ∫ v : ℝ, profileNegativePart φ v := by rw [integral_const_mul] linarith theorem profileNegativePart_setIntegral_Iic_eq_integral {φ : ℝ → ℝ} (hsign : ∀ v : ℝ, 0 ≤ v → 0 ≤ φ v) : (∫ v in Iic (0 : ℝ), profileNegativePart φ v) = ∫ v : ℝ, profileNegativePart φ v := by apply setIntegral_eq_integral_of_forall_compl_eq_zero intro v hv have hvpos : 0 < v := by simpa using! hv unfold profileNegativePart exact max_eq_right (by linarith [hsign v hvpos.le]) theorem normalizedProfile_negativeHalfline_mass_ge_half {φ : ℝ → ℝ} (hφ : Integrable φ) (hmean : (∫ v : ℝ, φ v) = 0) (hmass : (∫ v : ℝ, |φ v|) = 1) (hsign : ∀ v : ℝ, 0 ≤ v → 0 ≤ φ v) : (1 / 2 : ℝ) ≤ ∫ v in Iic (0 : ℝ), |φ v| := by have hneg := profileNegativePart_integrable hφ calc (1 / 2 : ℝ) = ∫ v : ℝ, profileNegativePart φ v := (integral_profileNegativePart_eq_half hφ hmean hmass).symm _ = ∫ v in Iic (0 : ℝ), profileNegativePart φ v := (profileNegativePart_setIntegral_Iic_eq_integral hsign).symm _ ≤ ∫ v in Iic (0 : ℝ), |φ v| := by refine setIntegral_mono_on hneg.integrableOn hφ.abs.integrableOn measurableSet_Iic ?_ intro v _ unfold profileNegativePart exact max_le (neg_le_abs _) (abs_nonneg _) theorem normalizedProfile_negativeHalfline_le_of_exp_majorant {φ : ℝ → ℝ} (hφ : Integrable φ) {a B : ℝ} (ha : 0 < a) (hbound : ∀ v : ℝ, v ≤ 0 → |φ v| ≤ B * Real.exp (a * v)) : (∫ v in Iic (0 : ℝ), |φ v|) ≤ B / a := by have hexp : IntegrableOn (fun v : ℝ => Real.exp (a * v)) (Iic (0 : ℝ)) := integrableOn_exp_mul_Iic ha 0 have hmajorant : IntegrableOn (fun v : ℝ => B * Real.exp (a * v)) (Iic (0 : ℝ)) := hexp.const_mul B calc (∫ v in Iic (0 : ℝ), |φ v|) ≤ ∫ v in Iic (0 : ℝ), B * Real.exp (a * v) := by exact setIntegral_mono_on hφ.abs.integrableOn hmajorant measurableSet_Iic (fun v hv => hbound v hv) _ = B / a := by rw [integral_const_mul, integral_exp_mul_Iic ha 0] simp [div_eq_mul_inv] theorem norm_fourierInv_le_integral_norm (F : ℝ → ℂ) (v : ℝ) : ‖((𝓕⁻ F : ℝ → ℂ) v)‖ ≤ ∫ s : ℝ, ‖F s‖ := by exact VectorFourier.norm_fourierIntegral_le_integral_norm Real.fourierChar volume (-innerₗ ℝ) F v theorem norm_scaled_fourierInv_le_integral_norm (Z : ℝ → ℂ) (v : ℝ) : ‖((𝓕⁻ (fun ξ : ℝ => Z (2 * Real.pi * ξ)) : ℝ → ℂ) v)‖ ≤ (2 * Real.pi)⁻¹ * ∫ s : ℝ, ‖Z s‖ := by calc ‖((𝓕⁻ (fun ξ : ℝ => Z (2 * Real.pi * ξ)) : ℝ → ℂ) v)‖ ≤ ∫ ξ : ℝ, ‖Z (2 * Real.pi * ξ)‖ := norm_fourierInv_le_integral_norm (fun ξ : ℝ => Z (2 * Real.pi * ξ)) v _ = (2 * Real.pi)⁻¹ * ∫ s : ℝ, ‖Z s‖ := by rw [Measure.integral_comp_mul_left (fun s : ℝ => ‖Z s‖) (2 * Real.pi)] change |(2 * Real.pi)⁻¹| * (∫ s : ℝ, ‖Z s‖) = (2 * Real.pi)⁻¹ * (∫ s : ℝ, ‖Z s‖) rw [abs_of_pos (inv_pos.mpr (mul_pos (by norm_num) Real.pi_pos))] theorem negativeHalfline_le_of_fourierInversion {φ : ℝ → ℝ} (hφ : Integrable φ) {a : ℝ} (ha : 0 < a) (Z : ℝ → ℂ) (hinversion : ∀ v : ℝ, (φ v : ℂ) = (Real.exp (a * v) : ℂ) * ((𝓕⁻ (fun ξ : ℝ => Z (2 * Real.pi * ξ)) : ℝ → ℂ) v)) : (∫ v in Iic (0 : ℝ), |φ v|) ≤ ((2 * Real.pi)⁻¹ * ∫ s : ℝ, ‖Z s‖) / a := by apply normalizedProfile_negativeHalfline_le_of_exp_majorant hφ ha intro v _ calc |φ v| = ‖(φ v : ℂ)‖ := by simp _ = ‖(Real.exp (a * v) : ℂ) * ((𝓕⁻ (fun ξ : ℝ => Z (2 * Real.pi * ξ)) : ℝ → ℂ) v)‖ := by rw [hinversion v] _ = Real.exp (a * v) * ‖((𝓕⁻ (fun ξ : ℝ => Z (2 * Real.pi * ξ)) : ℝ → ℂ) v)‖ := by rw [norm_mul, Complex.norm_of_nonneg (Real.exp_pos _).le] _ ≤ Real.exp (a * v) * ((2 * Real.pi)⁻¹ * ∫ s : ℝ, ‖Z s‖) := by exact mul_le_mul_of_nonneg_left (norm_scaled_fourierInv_le_integral_norm Z v) (Real.exp_pos _).le _ = ((2 * Real.pi)⁻¹ * ∫ s : ℝ, ‖Z s‖) * Real.exp (a * v) := by ring theorem no_normalizedProfile_of_fourierInversion_lt_half {φ : ℝ → ℝ} (hφ : Integrable φ) (hmean : (∫ v : ℝ, φ v) = 0) (hmass : (∫ v : ℝ, |φ v|) = 1) (hsign : ∀ v : ℝ, 0 ≤ v → 0 ≤ φ v) {a : ℝ} (ha : 0 < a) (Z : ℝ → ℂ) (hinversion : ∀ v : ℝ, (φ v : ℂ) = (Real.exp (a * v) : ℂ) * ((𝓕⁻ (fun ξ : ℝ => Z (2 * Real.pi * ξ)) : ℝ → ℂ) v)) (hsmall : ((2 * Real.pi)⁻¹ * ∫ s : ℝ, ‖Z s‖) / a < (1 / 2 : ℝ)) : False := by have hlower := normalizedProfile_negativeHalfline_mass_ge_half hφ hmean hmass hsign have hupper := negativeHalfline_le_of_fourierInversion hφ ha Z hinversion linarith theorem no_antiFourierWitness_of_fourierInversion_lt_half {d : ℕ} (hd : 0 < d) {R : ℝ} (hR : 0 < R) (w : AntiFourierWitness d R) {a : ℝ} (ha : 0 < a) (Z : ℝ → ℂ) (hinversion : ∀ v : ℝ, (normalizedRadialLogProfile hd w.function R v : ℂ) = (Real.exp (a * v) : ℂ) * ((𝓕⁻ (fun ξ : ℝ => Z (2 * Real.pi * ξ)) : ℝ → ℂ) v)) (hsmall : ((2 * Real.pi)⁻¹ * ∫ s : ℝ, ‖Z s‖) / a < (1 / 2 : ℝ)) : False := by obtain ⟨hintegrable, hmean, hmass, hsign⟩ := antiFourierWitness_normalizedRadialLogProfile hd hR w exact no_normalizedProfile_of_fourierInversion_lt_half hintegrable hmean hmass hsign ha Z hinversion hsmall theorem antiFourierWitness_normalizedMellinStrip_diffContOnCl {d : ℕ} (hd : 0 < d) {R : ℝ} (w : AntiFourierWitness d R) : DiffContOnCl ℂ (normalizedRadialMellinStrip hd w.function R) (Complex.im ⁻¹' Ioo (-((d : ℝ) / 2)) ((d : ℝ) / 2)) := normalizedRadialMellinStrip_diffContOnCl hd w.function w.radial w.zero_value R theorem antiFourierWitness_normalizedMellinStrip_top_norm_le_one {d : ℕ} (hd : 0 < d) {R : ℝ} (w : AntiFourierWitness d R) (y : ℝ) : ‖normalizedRadialMellinStrip hd w.function R ((y : ℂ) + Complex.I * (((d : ℝ) / 2 : ℝ) : ℂ))‖ ≤ 1 := normalizedRadialMellinStrip_top_norm_le_one hd w.function w.radial w.nonzero R y theorem antiFourierWitness_normalizedMellinStrip_uniform_bound {d : ℕ} (hd : 0 < d) {R : ℝ} (w : AntiFourierWitness d R) : ∃ C : ℝ, 0 ≤ C ∧ ∀ z : ℂ, -((d : ℝ) / 2) ≤ z.im → z.im ≤ (d : ℝ) / 2 → ‖normalizedRadialMellinStrip hd w.function R z‖ ≤ C := normalizedRadialMellinStrip_uniform_bound hd w.function w.radial w.zero_value R theorem antiFourierWitness_normalizedMellinStrip_shifted_integrable {d : ℕ} (hd : 0 < d) {R : ℝ} (hR : 0 < R) (w : AntiFourierWitness d R) {a : ℝ} (ha : a < (d : ℝ)) : Integrable (fun t : ℝ => normalizedRadialMellinStrip hd w.function R ((t : ℂ) + Complex.I * ((((d : ℝ) / 2 - a : ℝ) : ℂ)))) := normalizedRadialMellinStrip_shifted_integrable hd w.function w.real hR ha theorem antiFourierWitness_normalizedMellinStrip_shifted_fourier_inversion {d : ℕ} (hd : 0 < d) {R : ℝ} (hR : 0 < R) (w : AntiFourierWitness d R) {a : ℝ} (ha : a < (d : ℝ)) (v : ℝ) : (normalizedRadialLogProfile hd w.function R v : ℂ) = (Real.exp (a * v) : ℂ) * ((𝓕⁻ (fun ξ : ℝ => normalizedRadialMellinStrip hd w.function R (((2 * Real.pi * ξ : ℝ) : ℂ) + Complex.I * ((((d : ℝ) / 2 - a : ℝ) : ℂ)))) : ℝ → ℂ) v) := normalizedRadialMellinStrip_shifted_fourier_inversion hd w.function w.radial w.real w.zero_value hR ha v theorem no_antiFourierWitness_of_shiftedMellinL1_lt_half {d : ℕ} (hd : 0 < d) {R : ℝ} (hR : 0 < R) (w : AntiFourierWitness d R) {a : ℝ} (hapos : 0 < a) (haless : a < (d : ℝ)) (hsmall : ((2 * Real.pi)⁻¹ * ∫ s : ℝ, ‖normalizedRadialMellinStrip hd w.function R ((s : ℂ) + Complex.I * ((((d : ℝ) / 2 - a : ℝ) : ℂ)))‖) / a < (1 / 2 : ℝ)) : False := by apply no_antiFourierWitness_of_fourierInversion_lt_half hd hR w hapos (fun s : ℝ => normalizedRadialMellinStrip hd w.function R ((s : ℂ) + Complex.I * ((((d : ℝ) / 2 - a : ℝ) : ℂ)))) · intro v exact antiFourierWitness_normalizedMellinStrip_shifted_fourier_inversion hd hR w haless v · exact hsmall theorem no_antiFourierWitness_of_interiorMellinL1_lt_half {d : ℕ} (hd : 0 < d) {R σ : ℝ} (hR : 0 < R) (hσbelow : -1 < σ) (hσabove : σ < 1) (w : AntiFourierWitness d R) (hsmall : ((2 * Real.pi)⁻¹ * ∫ s : ℝ, ‖normalizedRadialMellinStrip hd w.function R ((s : ℂ) + Complex.I * (((σ * ((d : ℝ) / 2) : ℝ) : ℂ)))‖) / ((1 - σ) * ((d : ℝ) / 2)) < (1 / 2 : ℝ)) : False := by have hℓ : 0 < (d : ℝ) / 2 := half_pos (Nat.cast_pos.mpr hd) have ha : 0 < (1 - σ) * ((d : ℝ) / 2) := mul_pos (sub_pos.mpr hσabove) hℓ have haless : (1 - σ) * ((d : ℝ) / 2) < (d : ℝ) := by nlinarith [mul_pos (by linarith : 0 < 1 + σ) hℓ] have hheight : (d : ℝ) / 2 - (1 - σ) * ((d : ℝ) / 2) = σ * ((d : ℝ) / 2) := by ring apply no_antiFourierWitness_of_shiftedMellinL1_lt_half hd hR w ha haless simpa [hheight] using! hsmall def lowerGammaBoundaryLog (ℓ R y : ℝ) : ℝ := ℓ * Real.log (Real.pi * R ^ 2) + Real.log ‖Complex.Gamma (-Complex.I * (y : ℂ) / 2)‖ - Real.log ‖Complex.Gamma ((ℓ : ℂ) + Complex.I * (y : ℂ) / 2)‖ theorem lowerGammaBoundaryLog_continuousOn {ℓ : ℝ} (hℓ : 0 < ℓ) (R : ℝ) {S : Set ℝ} (hS : ∀ y ∈ S, y ≠ 0) : ContinuousOn (lowerGammaBoundaryLog ℓ R) S := by have hnumPole (y : ℝ) (hy : y ∈ S) : ∀ m : ℕ, -Complex.I * (y : ℂ) / 2 ≠ -(m : ℂ) := by intro m hm have him := congrArg Complex.im hm norm_num at him exact hS y hy (by linarith) have hdenPole (y : ℝ) : ∀ m : ℕ, (ℓ : ℂ) + Complex.I * (y : ℂ) / 2 ≠ -(m : ℂ) := by intro m hm have hre := congrArg Complex.re hm norm_num at hre have hmnonneg : 0 ≤ (m : ℝ) := Nat.cast_nonneg m linarith have hnum : ContinuousOn (fun y : ℝ => Complex.Gamma (-Complex.I * (y : ℂ) / 2)) S := by intro y hy have harg : ContinuousAt (fun u : ℝ => -Complex.I * (u : ℂ) / 2) y := by fun_prop apply ContinuousAt.continuousWithinAt simpa [Function.comp_def] using! (Complex.continuousAt_Gamma (-Complex.I * (y : ℂ) / 2) (hnumPole y hy)).comp_of_eq harg (by rfl) have hden : ContinuousOn (fun y : ℝ => Complex.Gamma ((ℓ : ℂ) + Complex.I * (y : ℂ) / 2)) S := by intro y hy have harg : ContinuousAt (fun u : ℝ => (ℓ : ℂ) + Complex.I * (u : ℂ) / 2) y := by fun_prop apply ContinuousAt.continuousWithinAt simpa [Function.comp_def] using! (Complex.continuousAt_Gamma ((ℓ : ℂ) + Complex.I * (y : ℂ) / 2) (hdenPole y)).comp_of_eq harg (by rfl) have hnumlog : ContinuousOn (fun y : ℝ => Real.log ‖Complex.Gamma (-Complex.I * (y : ℂ) / 2)‖) S := by apply hnum.norm.log intro y hy exact norm_ne_zero_iff.mpr (Complex.Gamma_ne_zero (hnumPole y hy)) have hdenlog : ContinuousOn (fun y : ℝ => Real.log ‖Complex.Gamma ((ℓ : ℂ) + Complex.I * (y : ℂ) / 2)‖) S := by apply hden.norm.log intro y hy exact norm_ne_zero_iff.mpr (Complex.Gamma_ne_zero (hdenPole y)) change ContinuousOn (fun y : ℝ => ℓ * Real.log (Real.pi * R ^ 2) + Real.log ‖Complex.Gamma (-Complex.I * (y : ℂ) / 2)‖ - Real.log ‖Complex.Gamma ((ℓ : ℂ) + Complex.I * (y : ℂ) / 2)‖) S exact (continuousOn_const.add hnumlog).sub hdenlog theorem lowerGammaBoundaryLog_measurable {ℓ : ℝ} (hℓ : 0 < ℓ) (R : ℝ) : Measurable (lowerGammaBoundaryLog ℓ R) := by apply measurable_of_continuousOn_compl_singleton (0 : ℝ) apply lowerGammaBoundaryLog_continuousOn hℓ R intro y hy simpa using! hy theorem antiFourierWitness_normalizedMellinStrip_bottom_norm_le_gamma {d : ℕ} (hd : 0 < d) {R : ℝ} (hR : 0 < R) (w : AntiFourierWitness d R) (y : ℝ) (hy : y ≠ 0) : ‖normalizedRadialMellinStrip hd w.function R ((y : ℂ) - Complex.I * (((d : ℝ) / 2 : ℝ) : ℂ))‖ ≤ Real.exp (lowerGammaBoundaryLog ((d : ℝ) / 2) R y) := by simpa [lowerGammaBoundaryLog] using! normalizedRadialMellinStrip_bottom_norm_le_gamma hd w.function w.radial w.zero_value w.anti_fourier w.nonzero R hR y hy def lowerStripPoissonMajorant (ℓ R σ s : ℝ) : ℝ := ∫ T : ℝ, stripPoissonKernel σ T * lowerGammaBoundaryLog ℓ R (s - ℓ * T) theorem stripPoisson_integral_changeVariables {ℓ : ℝ} (hℓ : 0 < ℓ) (σ s : ℝ) (h : ℝ → ℝ) : (∫ y : ℝ, stripPoissonKernel σ ((s - y) / ℓ) / ℓ * h y) = ∫ T : ℝ, stripPoissonKernel σ T * h (s - ℓ * T) := by let G : ℝ → ℝ := fun y => stripPoissonKernel σ ((s - y) / ℓ) / ℓ * h y have hscale : (∫ T : ℝ, G (s - ℓ * T)) = ℓ⁻¹ * ∫ y : ℝ, G y := by have hraw := Measure.integral_comp_mul_left (fun u : ℝ => G (s + u)) (-ℓ) rw [integral_add_left_eq_self G s] at hraw simpa [sub_eq_add_neg, neg_mul, inv_neg, abs_neg, abs_of_pos (inv_pos.mpr hℓ), smul_eq_mul] using! hraw have hrewrite : (∫ T : ℝ, G (s - ℓ * T)) = ℓ⁻¹ * ∫ T : ℝ, stripPoissonKernel σ T * h (s - ℓ * T) := by calc (∫ T : ℝ, G (s - ℓ * T)) = ∫ T : ℝ, ℓ⁻¹ * (stripPoissonKernel σ T * h (s - ℓ * T)) := by apply integral_congr_ae refine Filter.Eventually.of_forall (fun T => ?_) have hargument : (s - (s - ℓ * T)) / ℓ = T := by field_simp [hℓ.ne'] ring try dsimp [G] rw [hargument] ring _ = ℓ⁻¹ * ∫ T : ℝ, stripPoissonKernel σ T * h (s - ℓ * T) := by rw [integral_const_mul] change (∫ y : ℝ, G y) = ∫ T : ℝ, stripPoissonKernel σ T * h (s - ℓ * T) exact mul_left_cancel₀ (inv_ne_zero hℓ.ne') (hscale.symm.trans hrewrite) theorem norm_integerGammaFactor (j : ℕ) (y : ℝ) : ‖(j : ℂ) + Complex.I * (y : ℂ) / 2‖ = Real.sqrt ((j : ℝ) ^ 2 + (y / 2) ^ 2) := by rw [Complex.norm_def, Complex.normSq_apply] congr 1 simp ring theorem integerGammaFactor_ne_zero (j : ℕ) {y : ℝ} (hy : y ≠ 0) : (j : ℂ) + Complex.I * (y : ℂ) / 2 ≠ 0 := by intro hz have him := congrArg Complex.im hz norm_num at him exact hy (by linarith) theorem gamma_imaginary_ne_zero {y : ℝ} (hy : y ≠ 0) : Complex.Gamma (Complex.I * (y : ℂ) / 2) ≠ 0 := by apply Complex.Gamma_ne_zero intro j hj have him := congrArg Complex.im hj norm_num at him exact hy (by linarith) theorem norm_gamma_neg_imaginary (y : ℝ) : ‖Complex.Gamma (-Complex.I * (y : ℂ) / 2)‖ = ‖Complex.Gamma (Complex.I * (y : ℂ) / 2)‖ := by have harg : -Complex.I * (y : ℂ) / 2 = starRingEnd ℂ (Complex.I * (y : ℂ) / 2) := by simp only [map_div₀, map_mul, Complex.conj_ofReal, Complex.conj_I, Complex.conj_ofNat] rw [harg, Complex.Gamma_conj, RCLike.norm_conj] theorem lowerGammaBoundaryLog_integer (k : ℕ) (R : ℝ) {y : ℝ} (hy : y ≠ 0) : lowerGammaBoundaryLog (k : ℝ) R y = (k : ℝ) * Real.log (Real.pi * R ^ 2) - ∑ j ∈ Finset.range k, Real.log (Real.sqrt ((j : ℝ) ^ 2 + (y / 2) ^ 2)) := by have hbase : ‖Complex.Gamma (Complex.I * (y : ℂ) / 2)‖ ≠ 0 := norm_ne_zero_iff.mpr (gamma_imaginary_ne_zero hy) have hproduct : (∏ j ∈ Finset.range k, ((j : ℂ) + Complex.I * (y : ℂ) / 2)) ≠ 0 := by exact Finset.prod_ne_zero_iff.mpr (fun j _ => integerGammaFactor_ne_zero j hy) have hproductnorm : ‖∏ j ∈ Finset.range k, ((j : ℂ) + Complex.I * (y : ℂ) / 2)‖ ≠ 0 := norm_ne_zero_iff.mpr hproduct have hlogproduct : Real.log ‖∏ j ∈ Finset.range k, ((j : ℂ) + Complex.I * (y : ℂ) / 2)‖ = ∑ j ∈ Finset.range k, Real.log (Real.sqrt ((j : ℝ) ^ 2 + (y / 2) ^ 2)) := by rw [Complex.norm_prod] rw [Real.log_prod] · apply Finset.sum_congr rfl intro j _ rw [norm_integerGammaFactor] · intro j _ exact norm_ne_zero_iff.mpr (integerGammaFactor_ne_zero j hy) have hcast : ((k : ℝ) : ℂ) = (k : ℂ) := by norm_cast unfold lowerGammaBoundaryLog rw [hcast, integer_gamma_product k hy, norm_mul, Real.log_mul hbase hproductnorm, norm_gamma_neg_imaginary, hlogproduct] ring theorem lower_sqrtFactor_ge_abs_half (c y : ℝ) : |y| / 2 ≤ Real.sqrt (c ^ 2 + (y / 2) ^ 2) := by apply (Real.le_sqrt (by positivity) (by positivity)).2 nlinarith [sq_nonneg c, sq_abs y] theorem lowerGammaBoundaryLog_integer_log_tail (k : ℕ) {R y : ℝ} (hR : 0 < R) (hy : y ≠ 0) : lowerGammaBoundaryLog (k : ℝ) R y ≤ (k : ℝ) * Real.log (2 * Real.pi * R ^ 2 / |y|) := by have hyhalf : 0 < |y| / 2 := by positivity have hsum : (k : ℝ) * Real.log (|y| / 2) ≤ ∑ j ∈ Finset.range k, Real.log (Real.sqrt ((j : ℝ) ^ 2 + (y / 2) ^ 2)) := by calc (k : ℝ) * Real.log (|y| / 2) = ∑ j ∈ Finset.range k, Real.log (|y| / 2) := by simp _ ≤ ∑ j ∈ Finset.range k, Real.log (Real.sqrt ((j : ℝ) ^ 2 + (y / 2) ^ 2)) := by apply Finset.sum_le_sum intro j hj exact Real.log_le_log hyhalf (lower_sqrtFactor_ge_abs_half (j : ℝ) y) have hlogratio : Real.log (Real.pi * R ^ 2) - Real.log (|y| / 2) = Real.log (2 * Real.pi * R ^ 2 / |y|) := by rw [← Real.log_div (mul_ne_zero Real.pi_ne_zero (pow_ne_zero 2 hR.ne')) hyhalf.ne'] congr 1 field_simp [abs_ne_zero.mpr hy] rw [lowerGammaBoundaryLog_integer k R hy] calc (k : ℝ) * Real.log (Real.pi * R ^ 2) - ∑ j ∈ Finset.range k, Real.log (Real.sqrt ((j : ℝ) ^ 2 + (y / 2) ^ 2)) ≤ (k : ℝ) * Real.log (Real.pi * R ^ 2) - (k : ℝ) * Real.log (|y| / 2) := by linarith _ = (k : ℝ) * (Real.log (Real.pi * R ^ 2) - Real.log (|y| / 2)) := by ring _ = (k : ℝ) * Real.log (2 * Real.pi * R ^ 2 / |y|) := by rw [hlogratio] theorem lower_abs_log_sqrtFactor_le {c y : ℝ} (hc : 0 ≤ c) (hy : 0 < y) : |Real.log (Real.sqrt (c ^ 2 + (y / 2) ^ 2))| ≤ c + y / 2 + |Real.log (y / 2)| := by have ht : 0 < y / 2 := by positivity have hinside : 0 < c ^ 2 + (y / 2) ^ 2 := by nlinarith [sq_nonneg c, sq_pos_of_pos ht] have hsqrt : 0 < Real.sqrt (c ^ 2 + (y / 2) ^ 2) := Real.sqrt_pos.2 hinside have hlower : y / 2 ≤ Real.sqrt (c ^ 2 + (y / 2) ^ 2) := by apply (Real.le_sqrt ht.le hinside.le).2 nlinarith [sq_nonneg c] have hupper : Real.sqrt (c ^ 2 + (y / 2) ^ 2) ≤ c + y / 2 := by apply Real.sqrt_le_iff.mpr constructor · positivity · nlinarith [mul_nonneg hc ht.le] by_cases hlarge : 1 ≤ Real.sqrt (c ^ 2 + (y / 2) ^ 2) · rw [abs_of_nonneg (Real.log_nonneg hlarge)] have hlog := Real.log_le_sub_one_of_pos hsqrt have habs := abs_nonneg (Real.log (y / 2)) linarith · rw [abs_of_nonpos (Real.log_nonpos hsqrt.le (le_of_not_ge hlarge))] have hlog := Real.log_le_log ht hlower have habs := neg_le_abs (Real.log (y / 2)) have hnonneg : 0 ≤ c + y / 2 := by positivity linarith theorem lower_exp_abs_log_div_two_integrableOn_Ioi {a : ℝ} (ha : 0 < a) : IntegrableOn (fun y : ℝ => Real.exp ((-a) * y) * |Real.log (y / 2)|) (Ioi (0 : ℝ)) := by have hexponential : IntegrableOn (fun y : ℝ => Real.exp ((-a) * y)) (Ioi (0 : ℝ)) := integrableOn_exp_mul_Ioi (neg_lt_zero.mpr ha) 0 have hmajorant : IntegrableOn (fun y : ℝ => Real.exp ((-a) * y) * |Real.log y| + |Real.log (2 : ℝ)| * Real.exp ((-a) * y)) (Ioi (0 : ℝ)) := (strip_exp_abs_log_integrableOn_Ioi ha).add (hexponential.const_mul |Real.log (2 : ℝ)|) have hcontinuous : ContinuousOn (fun y : ℝ => Real.exp ((-a) * y) * |Real.log (y / 2)|) (Ioi (0 : ℝ)) := by apply ContinuousOn.mul · fun_prop · apply ContinuousOn.abs apply ContinuousOn.log · fun_prop · intro y hy exact div_ne_zero (mem_Ioi.mp hy).ne' (by norm_num) apply hmajorant.mono' (hcontinuous.aestronglyMeasurable measurableSet_Ioi) filter_upwards [ae_restrict_mem measurableSet_Ioi] with y hy have hypos := mem_Ioi.mp hy have hlog : |Real.log (y / 2)| ≤ |Real.log y| + |Real.log (2 : ℝ)| := by rw [Real.log_div hypos.ne' (by norm_num)] exact abs_sub _ _ change ‖Real.exp ((-a) * y) * |Real.log (y / 2)|‖ ≤ _ rw [Real.norm_eq_abs, abs_mul, abs_of_pos (Real.exp_pos _), abs_abs] calc Real.exp ((-a) * y) * |Real.log (y / 2)| ≤ Real.exp ((-a) * y) * (|Real.log y| + |Real.log (2 : ℝ)|) := mul_le_mul_of_nonneg_left hlog (Real.exp_pos _).le _ = Real.exp ((-a) * y) * |Real.log y| + |Real.log (2 : ℝ)| * Real.exp ((-a) * y) := by ring theorem lower_exp_log_sqrtFactor_integrableOn_Ioi {a c : ℝ} (ha : 0 < a) (hc : 0 ≤ c) : IntegrableOn (fun y : ℝ => Real.exp ((-a) * y) * Real.log (Real.sqrt (c ^ 2 + (y / 2) ^ 2))) (Ioi (0 : ℝ)) := by have hexponential : IntegrableOn (fun y : ℝ => Real.exp ((-a) * y)) (Ioi (0 : ℝ)) := integrableOn_exp_mul_Ioi (neg_lt_zero.mpr ha) 0 have hlinear : IntegrableOn (fun y : ℝ => y * Real.exp ((-a) * y)) (Ioi (0 : ℝ)) := by simpa [Real.rpow_one] using! (integrableOn_rpow_mul_exp_neg_mul_rpow (p := (1 : ℝ)) (s := (1 : ℝ)) (b := a) (by norm_num) (by norm_num) ha) have hmajorant : IntegrableOn (fun y : ℝ => c * Real.exp ((-a) * y) + (1 / 2 : ℝ) * (y * Real.exp ((-a) * y)) + Real.exp ((-a) * y) * |Real.log (y / 2)|) (Ioi (0 : ℝ)) := ((hexponential.const_mul c).add (hlinear.const_mul (1 / 2))).add (lower_exp_abs_log_div_two_integrableOn_Ioi ha) have hcontinuous : ContinuousOn (fun y : ℝ => Real.exp ((-a) * y) * Real.log (Real.sqrt (c ^ 2 + (y / 2) ^ 2))) (Ioi (0 : ℝ)) := by apply ContinuousOn.mul · fun_prop · apply ContinuousOn.log · fun_prop · intro y hy apply (Real.sqrt_pos.2 ?_).ne' have ht : 0 < y / 2 := by exact half_pos (mem_Ioi.mp hy) nlinarith [sq_nonneg c, sq_pos_of_pos ht] apply hmajorant.mono' (hcontinuous.aestronglyMeasurable measurableSet_Ioi) filter_upwards [ae_restrict_mem measurableSet_Ioi] with y hy have hlog := lower_abs_log_sqrtFactor_le hc (mem_Ioi.mp hy) change ‖Real.exp ((-a) * y) * Real.log (Real.sqrt (c ^ 2 + (y / 2) ^ 2))‖ ≤ _ rw [Real.norm_eq_abs, abs_mul, abs_of_pos (Real.exp_pos _)] calc Real.exp ((-a) * y) * |Real.log (Real.sqrt (c ^ 2 + (y / 2) ^ 2))| ≤ Real.exp ((-a) * y) * (c + y / 2 + |Real.log (y / 2)|) := mul_le_mul_of_nonneg_left hlog (Real.exp_pos _).le _ = c * Real.exp ((-a) * y) + (1 / 2 : ℝ) * (y * Real.exp ((-a) * y)) + Real.exp ((-a) * y) * |Real.log (y / 2)| := by ring theorem lower_exp_log_sqrtFactor_integrable {a c : ℝ} (ha : 0 < a) (hc : 0 ≤ c) : Integrable (fun y : ℝ => Real.exp ((-a) * |y|) * Real.log (Real.sqrt (c ^ 2 + (y / 2) ^ 2))) := by have hright : IntegrableOn (fun y : ℝ => Real.exp ((-a) * |y|) * Real.log (Real.sqrt (c ^ 2 + (y / 2) ^ 2))) (Ioi (0 : ℝ)) := by refine (lower_exp_log_sqrtFactor_integrableOn_Ioi ha hc).congr_fun ?_ measurableSet_Ioi intro y hy try dsimp rw [abs_of_pos (mem_Ioi.mp hy)] have hreflected : IntegrableOn ((fun y : ℝ => Real.exp ((-a) * |y|) * Real.log (Real.sqrt (c ^ 2 + (y / 2) ^ 2))) ∘ (fun y : ℝ => -y)) ((fun y : ℝ => -y) ⁻¹' Iio (0 : ℝ)) := by simpa [Function.comp_def, neg_preimage, neg_Iio, abs_neg, neg_div] using! hright have hleft : IntegrableOn (fun y : ℝ => Real.exp ((-a) * |y|) * Real.log (Real.sqrt (c ^ 2 + (y / 2) ^ 2))) (Iio (0 : ℝ)) := ((Measure.measurePreserving_neg (volume : Measure ℝ)).integrableOn_comp_preimage (Homeomorph.neg ℝ).measurableEmbedding).mp hreflected rw [← integrableOn_univ, ← @Iio_union_Ici _ _ (0 : ℝ), integrableOn_union, integrableOn_Ici_iff_integrableOn_Ioi] exact ⟨hleft, hright⟩ theorem lowerGammaBoundaryLog_integer_exp_integrable {a : ℝ} (ha : 0 < a) (k : ℕ) (R : ℝ) : Integrable (fun y : ℝ => Real.exp ((-a) * |y|) * lowerGammaBoundaryLog (k : ℝ) R y) := by have hconstant : Integrable (fun y : ℝ => ((k : ℝ) * Real.log (Real.pi * R ^ 2)) * Real.exp ((-a) * |y|)) := (strip_exp_abs_integrable ha).const_mul ((k : ℝ) * Real.log (Real.pi * R ^ 2)) have hsum : Integrable (fun y : ℝ => ∑ j ∈ Finset.range k, Real.exp ((-a) * |y|) * Real.log (Real.sqrt ((j : ℝ) ^ 2 + (y / 2) ^ 2))) := by exact integrable_finsetSum (Finset.range k) (fun j _ => lower_exp_log_sqrtFactor_integrable ha (Nat.cast_nonneg j)) have hmodel : Integrable (fun y : ℝ => Real.exp ((-a) * |y|) * ((k : ℝ) * Real.log (Real.pi * R ^ 2) - ∑ j ∈ Finset.range k, Real.log (Real.sqrt ((j : ℝ) ^ 2 + (y / 2) ^ 2)))) := by simpa only [mul_sub, Finset.mul_sum, mul_comm] using! hconstant.sub hsum refine hmodel.congr ?_ filter_upwards [Measure.ae_ne (volume : Measure ℝ) 0] with y hy rw [lowerGammaBoundaryLog_integer k R hy] theorem lowerStripGammaOuter_integrable_of_exp_integrable {ℓ R : ℝ} (hℓ : 0 < ℓ) {z : ℂ} (hz : z ∈ Complex.im ⁻¹' Ioo (-ℓ) ℓ) (hgamma : Integrable (fun y : ℝ => Real.exp (-(Real.pi / (2 * ℓ)) * |y|) * lowerGammaBoundaryLog ℓ R y)) : Integrable (fun y : ℝ => stripRegularizedHolomorphicPoissonKernel ℓ z y * (lowerGammaBoundaryLog ℓ R y : ℂ)) := by obtain ⟨hangle, hangle'⟩ := stripSchwarzAngle_mem_Ioo hℓ hz have hsin : 0 < Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ)) := Real.sin_pos_of_pos_of_lt_pi hangle hangle' let a : ℝ := Real.pi / (2 * ℓ) let D : ℝ := 2 * ℓ * Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ)) let Cpos : ℝ := Real.exp (a * z.re) / D let Cneg : ℝ := Real.exp (-a * z.re) / D have ha : 0 < a := by try dsimp [a] exact div_pos Real.pi_pos (mul_pos (by norm_num) hℓ) change Integrable (fun y : ℝ => Real.exp ((-a) * |y|) * lowerGammaBoundaryLog ℓ R y) at hgamma have hgammaabs : Integrable (fun y : ℝ => Real.exp ((-a) * |y|) * |lowerGammaBoundaryLog ℓ R y|) := by simpa [Real.norm_eq_abs, abs_mul, abs_of_pos (Real.exp_pos _)] using! hgamma.norm have hposfactor (y : ℝ) : Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) / D = Cpos * Real.exp ((-a) * y) := by have hsplit : Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) = Real.exp (a * z.re) * Real.exp ((-a) * y) := by rw [← Real.exp_add] congr 1 try dsimp [a] ring rw [hsplit] try dsimp [Cpos] ring have hnegfactor (y : ℝ) : Real.exp (-(Real.pi * (z.re - y) / (2 * ℓ))) / D = Cneg * Real.exp (a * y) := by have hsplit : Real.exp (-(Real.pi * (z.re - y) / (2 * ℓ))) = Real.exp (-a * z.re) * Real.exp (a * y) := by rw [← Real.exp_add] congr 1 try dsimp [a] ring rw [hsplit] try dsimp [Cneg] ring have hgammaRight : ContinuousOn (lowerGammaBoundaryLog ℓ R) (Ioi (0 : ℝ)) := lowerGammaBoundaryLog_continuousOn hℓ R (fun y hy => (mem_Ioi.mp hy).ne') have hcastRight : ContinuousOn (fun y : ℝ => (lowerGammaBoundaryLog ℓ R y : ℂ)) (Ioi (0 : ℝ)) := by simpa [Function.comp_def] using! Complex.continuous_ofReal.comp_continuousOn hgammaRight have hcontinuousRight : ContinuousOn (fun y : ℝ => stripRegularizedHolomorphicPoissonKernel ℓ z y * (lowerGammaBoundaryLog ℓ R y : ℂ)) (Ioi (0 : ℝ)) := (stripRegularizedHolomorphicPoissonKernel_continuousOn_Ioi hℓ hz).mul hcastRight have hrightmajorant : IntegrableOn (fun y : ℝ => Cpos * (Real.exp ((-a) * |y|) * |lowerGammaBoundaryLog ℓ R y|)) (Ioi (0 : ℝ)) := hgammaabs.integrableOn.const_mul Cpos have hright : IntegrableOn (fun y : ℝ => stripRegularizedHolomorphicPoissonKernel ℓ z y * (lowerGammaBoundaryLog ℓ R y : ℂ)) (Ioi (0 : ℝ)) := by apply hrightmajorant.mono' (hcontinuousRight.aestronglyMeasurable measurableSet_Ioi) filter_upwards [ae_restrict_mem measurableSet_Ioi] with y hy change ‖stripRegularizedHolomorphicPoissonKernel ℓ z y * (lowerGammaBoundaryLog ℓ R y : ℂ)‖ ≤ Cpos * (Real.exp ((-a) * |y|) * |lowerGammaBoundaryLog ℓ R y|) rw [norm_mul, Complex.norm_real, Real.norm_eq_abs] have hbound := norm_stripRegularizedHolomorphicPoissonKernel_of_nonneg hℓ hz (mem_Ioi.mp hy).le change ‖stripRegularizedHolomorphicPoissonKernel ℓ z y‖ ≤ Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) / D at hbound calc ‖stripRegularizedHolomorphicPoissonKernel ℓ z y‖ * |lowerGammaBoundaryLog ℓ R y| ≤ (Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) / D) * |lowerGammaBoundaryLog ℓ R y| := mul_le_mul_of_nonneg_right hbound (abs_nonneg _) _ = Cpos * (Real.exp ((-a) * |y|) * |lowerGammaBoundaryLog ℓ R y|) := by rw [abs_of_pos (mem_Ioi.mp hy), hposfactor] ring have hgammaLeft : ContinuousOn (lowerGammaBoundaryLog ℓ R) (Iio (0 : ℝ)) := lowerGammaBoundaryLog_continuousOn hℓ R (fun y hy => (mem_Iio.mp hy).ne) have hcastLeft : ContinuousOn (fun y : ℝ => (lowerGammaBoundaryLog ℓ R y : ℂ)) (Iio (0 : ℝ)) := by simpa [Function.comp_def] using! Complex.continuous_ofReal.comp_continuousOn hgammaLeft have hcontinuousLeft : ContinuousOn (fun y : ℝ => stripRegularizedHolomorphicPoissonKernel ℓ z y * (lowerGammaBoundaryLog ℓ R y : ℂ)) (Iio (0 : ℝ)) := (stripRegularizedHolomorphicPoissonKernel_continuousOn_Iio hℓ hz).mul hcastLeft have hleftmajorant : IntegrableOn (fun y : ℝ => Cneg * (Real.exp ((-a) * |y|) * |lowerGammaBoundaryLog ℓ R y|)) (Iio (0 : ℝ)) := hgammaabs.integrableOn.const_mul Cneg have hleft : IntegrableOn (fun y : ℝ => stripRegularizedHolomorphicPoissonKernel ℓ z y * (lowerGammaBoundaryLog ℓ R y : ℂ)) (Iio (0 : ℝ)) := by apply hleftmajorant.mono' (hcontinuousLeft.aestronglyMeasurable measurableSet_Iio) filter_upwards [ae_restrict_mem measurableSet_Iio] with y hy change ‖stripRegularizedHolomorphicPoissonKernel ℓ z y * (lowerGammaBoundaryLog ℓ R y : ℂ)‖ ≤ Cneg * (Real.exp ((-a) * |y|) * |lowerGammaBoundaryLog ℓ R y|) rw [norm_mul, Complex.norm_real, Real.norm_eq_abs] have hbound := norm_stripRegularizedHolomorphicPoissonKernel_of_neg hℓ hz (mem_Iio.mp hy) change ‖stripRegularizedHolomorphicPoissonKernel ℓ z y‖ ≤ Real.exp (-(Real.pi * (z.re - y) / (2 * ℓ))) / D at hbound calc ‖stripRegularizedHolomorphicPoissonKernel ℓ z y‖ * |lowerGammaBoundaryLog ℓ R y| ≤ (Real.exp (-(Real.pi * (z.re - y) / (2 * ℓ))) / D) * |lowerGammaBoundaryLog ℓ R y| := mul_le_mul_of_nonneg_right hbound (abs_nonneg _) _ = Cneg * (Real.exp ((-a) * |y|) * |lowerGammaBoundaryLog ℓ R y|) := by rw [abs_of_neg (mem_Iio.mp hy), hnegfactor] simp [mul_neg, neg_mul] ring rw [← integrableOn_univ, ← @Iio_union_Ici _ _ (0 : ℝ), integrableOn_union, integrableOn_Ici_iff_integrableOn_Ioi] exact ⟨hleft, hright⟩ theorem norm_halfIntegerGammaFactor (j : ℕ) (y : ℝ) : ‖(j : ℂ) + (1 / 2 : ℂ) + Complex.I * (y : ℂ) / 2‖ = Real.sqrt (((j : ℝ) + 1 / 2) ^ 2 + (y / 2) ^ 2) := by rw [Complex.norm_def, Complex.normSq_apply] congr 1 simp ring theorem norm_gamma_half_add_imaginary_sq (x : ℝ) : ‖Complex.Gamma ((1 / 2 : ℂ) + Complex.I * (x : ℂ))‖ ^ 2 = Real.pi / Real.cosh (Real.pi * x) := by let z : ℂ := (1 / 2 : ℂ) + Complex.I * (x : ℂ) have harg : 1 - z = starRingEnd ℂ z := by try dsimp [z] simp only [map_add, map_div₀, Complex.conj_ofReal, Complex.conj_I, Complex.conj_ofNat, map_mul, map_one] ring have hsin : Complex.sin ((Real.pi : ℂ) * z) = (Real.cosh (Real.pi * x) : ℂ) := by have hinput : (Real.pi : ℂ) * z = (Real.pi / 2 : ℝ) + (Real.pi * x : ℝ) * Complex.I := by try dsimp [z] push_cast ring have hsinhalf : Complex.sin ((Real.pi / 2 : ℝ) : ℂ) = 1 := by rw [← Complex.ofReal_sin, Real.sin_pi_div_two] norm_num have hcoshalf : Complex.cos ((Real.pi / 2 : ℝ) : ℂ) = 0 := by rw [← Complex.ofReal_cos, Real.cos_pi_div_two] norm_num rw [hinput, Complex.sin_add_mul_I, hsinhalf, hcoshalf] simp only [one_mul, zero_mul, add_zero] exact (Complex.ofReal_cosh (Real.pi * x)).symm have href := Complex.Gamma_mul_Gamma_one_sub z rw [harg, Complex.Gamma_conj, hsin] at href have hnorm : Complex.Gamma z * starRingEnd ℂ (Complex.Gamma z) = (‖Complex.Gamma z‖ ^ 2 : ℝ) := by rw [mul_comm, ← Complex.normSq_eq_conj_mul_self, Complex.normSq_eq_norm_sq] rw [hnorm] at href have hre := congrArg Complex.re href change ‖Complex.Gamma ((1 / 2 : ℂ) + Complex.I * (x : ℂ))‖ ^ 2 = (((Real.pi : ℝ) : ℂ) / (Real.cosh (Real.pi * x) : ℂ)).re at hre simpa only [Complex.div_ofReal_re] using! hre theorem norm_gamma_imaginary_sq {x : ℝ} (hx : x ≠ 0) : ‖Complex.Gamma (Complex.I * (x : ℂ))‖ ^ 2 = Real.pi / (x * Real.sinh (Real.pi * x)) := by let z : ℂ := Complex.I * (x : ℂ) have hz : -z ≠ 0 := by try dsimp [z] exact neg_ne_zero.mpr (mul_ne_zero Complex.I_ne_zero (Complex.ofReal_ne_zero.mpr hx)) have hrec : Complex.Gamma (1 - z) = (-z) * Complex.Gamma (-z) := by convert! Complex.Gamma_add_one (-z) hz using 1; ring_nf have hconjarg : -z = starRingEnd ℂ z := by try dsimp [z] simp only [map_mul, Complex.conj_I, Complex.conj_ofReal] ring have hconj : Complex.Gamma (-z) = starRingEnd ℂ (Complex.Gamma z) := by rw [hconjarg, Complex.Gamma_conj] have hsin : Complex.sin ((Real.pi : ℂ) * z) = (Real.sinh (Real.pi * x) : ℂ) * Complex.I := by have hinput : (Real.pi : ℂ) * z = ((Real.pi * x : ℝ) : ℂ) * Complex.I := by try dsimp [z] push_cast ring rw [hinput, Complex.sin_mul_I, ← Complex.ofReal_sinh] have hsinh : Real.sinh (Real.pi * x) ≠ 0 := Real.sinh_ne_zero.mpr (mul_ne_zero Real.pi_ne_zero hx) have hden : (Real.sinh (Real.pi * x) : ℂ) * Complex.I ≠ 0 := mul_ne_zero (Complex.ofReal_ne_zero.mpr hsinh) Complex.I_ne_zero have hprod : Complex.Gamma z * starRingEnd ℂ (Complex.Gamma z) = (‖Complex.Gamma z‖ ^ 2 : ℝ) := by rw [mul_comm, ← Complex.normSq_eq_conj_mul_self, Complex.normSq_eq_norm_sq] have href := Complex.Gamma_mul_Gamma_one_sub z rw [hrec, hconj, hsin] at href have hidentity : ((‖Complex.Gamma z‖ ^ 2 * (x * Real.sinh (Real.pi * x)) : ℝ) : ℂ) = (Real.pi : ℂ) := by calc ((‖Complex.Gamma z‖ ^ 2 * (x * Real.sinh (Real.pi * x)) : ℝ) : ℂ) = (Complex.Gamma z * starRingEnd ℂ (Complex.Gamma z)) * ((x * Real.sinh (Real.pi * x) : ℝ) : ℂ) := by rw [hprod] push_cast rfl _ = (Complex.Gamma z * (-z * starRingEnd ℂ (Complex.Gamma z))) * ((Real.sinh (Real.pi * x) : ℂ) * Complex.I) := by try dsimp [z] rw [Complex.ofReal_mul] ring_nf simp [Complex.I_sq] _ = ((Real.pi : ℂ) / ((Real.sinh (Real.pi * x) : ℂ) * Complex.I)) * ((Real.sinh (Real.pi * x) : ℂ) * Complex.I) := by rw [href] _ = (Real.pi : ℂ) := div_mul_cancel₀ _ hden have hmul : ‖Complex.Gamma z‖ ^ 2 * (x * Real.sinh (Real.pi * x)) = Real.pi := by exact_mod_cast hidentity exact (eq_div_iff (mul_ne_zero hx hsinh)).2 hmul theorem halfIntegerGammaFactor_ne_zero (j : ℕ) (y : ℝ) : (j : ℂ) + (1 / 2 : ℂ) + Complex.I * (y : ℂ) / 2 ≠ 0 := by intro hz have hre := congrArg Complex.re hz norm_num at hre have hj : 0 ≤ (j : ℝ) := Nat.cast_nonneg j linarith theorem lowerGammaBoundaryLog_halfInteger_factorized (k : ℕ) (R : ℝ) {y : ℝ} (hy : y ≠ 0) : lowerGammaBoundaryLog ((k : ℝ) + 1 / 2) R y = ((k : ℝ) + 1 / 2) * Real.log (Real.pi * R ^ 2) - ∑ j ∈ Finset.range k, Real.log (Real.sqrt (((j : ℝ) + 1 / 2) ^ 2 + (y / 2) ^ 2)) + (Real.log ‖Complex.Gamma (Complex.I * (y : ℂ) / 2)‖ - Real.log ‖Complex.Gamma ((1 / 2 : ℂ) + Complex.I * (y : ℂ) / 2)‖) := by have himaginary : ‖Complex.Gamma (Complex.I * (y : ℂ) / 2)‖ ≠ 0 := norm_ne_zero_iff.mpr (gamma_imaginary_ne_zero hy) have hreflection : ‖Complex.Gamma (-Complex.I * (y : ℂ) / 2)‖ = ‖Complex.Gamma (Complex.I * (y : ℂ) / 2)‖ := by apply (div_eq_one_iff_eq himaginary).mp rw [norm_gamma_neg_imaginary, div_self himaginary] have hbase : Complex.Gamma ((1 / 2 : ℂ) + Complex.I * (y : ℂ) / 2) ≠ 0 := by apply Complex.Gamma_ne_zero_of_re_pos norm_num have hbasenorm : ‖Complex.Gamma ((1 / 2 : ℂ) + Complex.I * (y : ℂ) / 2)‖ ≠ 0 := norm_ne_zero_iff.mpr hbase have hproduct : (∏ j ∈ Finset.range k, ((j : ℂ) + (1 / 2 : ℂ) + Complex.I * (y : ℂ) / 2)) ≠ 0 := by exact Finset.prod_ne_zero_iff.mpr (fun j _ => halfIntegerGammaFactor_ne_zero j y) have hproductnorm : ‖∏ j ∈ Finset.range k, ((j : ℂ) + (1 / 2 : ℂ) + Complex.I * (y : ℂ) / 2)‖ ≠ 0 := norm_ne_zero_iff.mpr hproduct have hlogproduct : Real.log ‖∏ j ∈ Finset.range k, ((j : ℂ) + (1 / 2 : ℂ) + Complex.I * (y : ℂ) / 2)‖ = ∑ j ∈ Finset.range k, Real.log (Real.sqrt (((j : ℝ) + 1 / 2) ^ 2 + (y / 2) ^ 2)) := by rw [Complex.norm_prod] rw [Real.log_prod] · apply Finset.sum_congr rfl intro j _ rw [norm_halfIntegerGammaFactor] · intro j _ exact norm_ne_zero_iff.mpr (halfIntegerGammaFactor_ne_zero j y) have hcast : (((k : ℝ) + 1 / 2 : ℝ) : ℂ) = (k : ℂ) + (1 / 2 : ℂ) := by push_cast rfl unfold lowerGammaBoundaryLog rw [hcast, half_integer_gamma_product k y, norm_mul, Real.log_mul hbasenorm hproductnorm, hreflection, hlogproduct] ring def lowerCoth (x : ℝ) : ℝ := Real.cosh x / Real.sinh x theorem lowerCoth_pos {x : ℝ} (hx : 0 < x) : 0 < lowerCoth x := by unfold lowerCoth exact div_pos (Real.cosh_pos x) (Real.sinh_pos_iff.mpr hx) theorem lowerCoth_one_le {x : ℝ} (hx : 0 < x) : 1 ≤ lowerCoth x := by have hsinh : 0 < Real.sinh x := Real.sinh_pos_iff.mpr hx unfold lowerCoth apply (le_div_iff₀ hsinh).2 rw [one_mul, Real.sinh_eq, Real.cosh_eq] linarith [Real.exp_pos (-x)] theorem lowerCoth_log_nonneg {x : ℝ} (hx : 0 < x) : 0 ≤ Real.log (lowerCoth x) := Real.log_nonneg (lowerCoth_one_le hx) theorem lowerCoth_hasDerivAt {x : ℝ} (hx : 0 < x) : HasDerivAt lowerCoth (-(Real.sinh x)⁻¹ ^ 2) x := by have hsinh : Real.sinh x ≠ 0 := (Real.sinh_pos_iff.mpr hx).ne' have hderiv := (Real.hasDerivAt_cosh x).div (Real.hasDerivAt_sinh x) hsinh unfold lowerCoth convert! hderiv using 1 rw [div_eq_mul_inv] have hidentity := Real.cosh_sq_sub_sinh_sq x field_simp [hsinh] nlinarith theorem lowerCoth_antitoneOn : AntitoneOn lowerCoth (Ioi (0 : ℝ)) := by apply antitoneOn_of_deriv_nonpos (convex_Ioi 0) · intro x hx exact (lowerCoth_hasDerivAt hx).continuousAt.continuousWithinAt · intro x hx have hx' : 0 < x := by simpa using! hx exact (lowerCoth_hasDerivAt hx').differentiableAt.differentiableWithinAt · intro x hx have hx' : 0 < x := by simpa using! hx rw [(lowerCoth_hasDerivAt hx').deriv] exact neg_nonpos.mpr (sq_nonneg _) theorem lowerCoth_log_antitoneOn : AntitoneOn (fun x : ℝ => Real.log (lowerCoth x)) (Ioi (0 : ℝ)) := by intro x hx y hy hxy exact Real.log_le_log (lowerCoth_pos hy) (lowerCoth_antitoneOn hx hy hxy) theorem lower_cosh_le_exp {x : ℝ} (hx : 0 ≤ x) : Real.cosh x ≤ Real.exp x := by have hnegative : Real.exp (-x) ≤ Real.exp x := Real.exp_le_exp.mpr (by linarith) rw [Real.cosh_eq] linarith theorem lower_sinh_le_exp (x : ℝ) : Real.sinh x ≤ Real.exp x := by have hpositive := Real.exp_pos (-x) have hpositive' := Real.exp_pos x rw [Real.sinh_eq] linarith theorem lower_abs_log_cosh_le {x : ℝ} (hx : 0 ≤ x) : |Real.log (Real.cosh x)| ≤ x := by rw [abs_of_nonneg (Real.log_nonneg (Real.one_le_cosh x))] have hlog := Real.log_le_log (Real.cosh_pos x) (lower_cosh_le_exp hx) simpa using! hlog theorem lower_abs_log_sinh_le {x : ℝ} (hx : 0 < x) : |Real.log (Real.sinh x)| ≤ x + |Real.log x| := by have hlower : x ≤ Real.sinh x := Real.self_le_sinh_iff.mpr hx.le have hsinh : 0 < Real.sinh x := hx.trans_le hlower by_cases hlarge : 1 ≤ Real.sinh x · rw [abs_of_nonneg (Real.log_nonneg hlarge)] have hlog := Real.log_le_log hsinh (lower_sinh_le_exp x) have habs := abs_nonneg (Real.log x) rw [Real.log_exp] at hlog linarith · rw [abs_of_nonpos (Real.log_nonpos hsinh.le (le_of_not_ge hlarge))] have hlog := Real.log_le_log hx hlower have habs := neg_le_abs (Real.log x) linarith theorem lower_abs_log_coth_div_le {x : ℝ} (hx : 0 < x) : |Real.log (lowerCoth (Real.pi * x) / x)| ≤ 2 * (Real.pi * x) + |Real.log Real.pi| + 2 * |Real.log x| := by have ht : 0 < Real.pi * x := mul_pos Real.pi_pos hx have hsinh : Real.sinh (Real.pi * x) ≠ 0 := Real.sinh_ne_zero.mpr ht.ne' have hcosh : Real.cosh (Real.pi * x) ≠ 0 := (Real.cosh_pos _).ne' have hlogpi : |Real.log (Real.pi * x)| ≤ |Real.log Real.pi| + |Real.log x| := by rw [Real.log_mul Real.pi_ne_zero hx.ne'] simpa [sub_neg_eq_add] using! (abs_sub (Real.log Real.pi) (-(Real.log x))) have hcoshbound := lower_abs_log_cosh_le ht.le have hsinhbound := lower_abs_log_sinh_le ht unfold lowerCoth rw [Real.log_div (div_ne_zero hcosh hsinh) hx.ne', Real.log_div hcosh hsinh] calc |(Real.log (Real.cosh (Real.pi * x)) - Real.log (Real.sinh (Real.pi * x))) - Real.log x| ≤ (|Real.log (Real.cosh (Real.pi * x))| + |Real.log (Real.sinh (Real.pi * x))|) + |Real.log x| := by have hfirst := abs_sub (Real.log (Real.cosh (Real.pi * x))) (Real.log (Real.sinh (Real.pi * x))) have hsecond := abs_sub (Real.log (Real.cosh (Real.pi * x)) - Real.log (Real.sinh (Real.pi * x))) (Real.log x) linarith _ ≤ 2 * (Real.pi * x) + |Real.log Real.pi| + 2 * |Real.log x| := by linarith theorem lowerCoth_sub_one_eq {x : ℝ} (hx : 0 < x) : lowerCoth x - 1 = Real.exp (-x) / Real.sinh x := by have hsinh : Real.sinh x ≠ 0 := (Real.sinh_pos_iff.mpr hx).ne' unfold lowerCoth field_simp [hsinh] rw [Real.cosh_eq, Real.sinh_eq] ring theorem lower_sinh_ge_exp_quarter {x : ℝ} (hx : 1 ≤ x) : Real.exp x / 4 ≤ Real.sinh x := by have hbig : 2 ≤ Real.exp x := by nlinarith [Real.add_one_le_exp x] have hsmall : Real.exp (-x) ≤ 1 := Real.exp_le_one_iff.mpr (by linarith) rw [Real.sinh_eq] linarith theorem lowerCoth_log_le_four_exp_neg_two {x : ℝ} (hx : 1 ≤ x) : Real.log (lowerCoth x) ≤ 4 * Real.exp (-2 * x) := by have hxpos : 0 < x := by linarith have hsinh : 0 < Real.sinh x := Real.sinh_pos_iff.mpr hxpos calc Real.log (lowerCoth x) ≤ lowerCoth x - 1 := Real.log_le_sub_one_of_pos (lowerCoth_pos hxpos) _ = Real.exp (-x) / Real.sinh x := lowerCoth_sub_one_eq hxpos _ ≤ Real.exp (-x) / (Real.exp x / 4) := div_le_div_of_nonneg_left (Real.exp_pos _).le (by positivity) (lower_sinh_ge_exp_quarter hx) _ = 4 * Real.exp (-2 * x) := by rw [show -2 * x = -x - x by ring, Real.exp_sub] field_simp [Real.exp_ne_zero x] theorem lowerCoth_log_small_abs_bound {y : ℝ} (hy : y ≠ 0) (hsmall : |y| ≤ 1) : Real.log (lowerCoth (Real.pi * |y| / 2)) ≤ Real.pi + |Real.log Real.pi| + 3 * (|Real.log (|y|)| + |Real.log (2 : ℝ)|) := by have hu : 0 < |y| / 2 := by positivity have hpiu : 0 < Real.pi * (|y| / 2) := mul_pos Real.pi_pos hu have hcoth : 0 < lowerCoth (Real.pi * (|y| / 2)) := lowerCoth_pos hpiu have hloghalf : |Real.log (|y| / 2)| ≤ |Real.log (|y|)| + |Real.log (2 : ℝ)| := by rw [Real.log_div (abs_ne_zero.mpr hy) (by norm_num)] exact abs_sub _ _ have hbase := lower_abs_log_coth_div_le hu have hdecomp : Real.log (lowerCoth (Real.pi * (|y| / 2))) = Real.log (lowerCoth (Real.pi * (|y| / 2)) / (|y| / 2)) + Real.log (|y| / 2) := by rw [Real.log_div hcoth.ne' hu.ne'] ring rw [show Real.pi * |y| / 2 = Real.pi * (|y| / 2) by ring] rw [hdecomp] have hlogdiv := le_abs_self (Real.log (lowerCoth (Real.pi * (|y| / 2)) / (|y| / 2))) have hlogu := le_abs_self (Real.log (|y| / 2)) have hpibound : 2 * (Real.pi * (|y| / 2)) ≤ Real.pi := by nlinarith [mul_nonneg Real.pi_pos.le (sub_nonneg.mpr hsmall)] linarith theorem lowerCoth_log_abs_integrable : Integrable (fun y : ℝ => Real.log (lowerCoth (Real.pi * |y| / 2))) := by let A : ℝ := Real.pi + |Real.log Real.pi| + 3 * |Real.log (2 : ℝ)| have hA : 0 ≤ A := by try dsimp [A] positivity have hbase := strip_exp_abs_integrable (by norm_num : 0 < (1 : ℝ)) have hlog := strip_exp_abs_log_abs_integrable (by norm_num : 0 < (1 : ℝ)) have hnear : Integrable (fun y : ℝ => A * Real.exp ((-1 : ℝ) * |y|) + 3 * (Real.exp ((-1 : ℝ) * |y|) * |Real.log (|y|)|)) := (hbase.const_mul A).add (hlog.const_mul 3) have hfar : Integrable (fun y : ℝ => 4 * Real.exp ((-Real.pi) * |y|)) := (strip_exp_abs_integrable Real.pi_pos).const_mul 4 have hmajor : Integrable (fun y : ℝ => Real.exp 1 * (A * Real.exp ((-1 : ℝ) * |y|) + 3 * (Real.exp ((-1 : ℝ) * |y|) * |Real.log (|y|)|)) + 4 * Real.exp ((-Real.pi) * |y|)) := (hnear.const_mul (Real.exp 1)).add hfar apply hmajor.mono' · have harg : Measurable (fun y : ℝ => Real.pi * |y| / 2) := by fun_prop have hcoth : Measurable (fun y : ℝ => lowerCoth (Real.pi * |y| / 2)) := by unfold lowerCoth exact (Real.continuous_cosh.measurable.comp harg).div (Real.continuous_sinh.measurable.comp harg) exact hcoth.log.aestronglyMeasurable · filter_upwards [] with y by_cases hy : y = 0 · subst y simp [lowerCoth, A] positivity · have hlognonneg : 0 ≤ Real.log (lowerCoth (Real.pi * |y| / 2)) := lowerCoth_log_nonneg (by positivity) rw [Real.norm_eq_abs, abs_of_nonneg hlognonneg] have hfar_nonneg : 0 ≤ 4 * Real.exp ((-Real.pi) * |y|) := by positivity have hnear_nonneg : 0 ≤ Real.exp 1 * (A * Real.exp ((-1 : ℝ) * |y|) + 3 * (Real.exp ((-1 : ℝ) * |y|) * |Real.log (|y|)|)) := by positivity by_cases hsmall : |y| ≤ 1 · have hsmallbound := lowerCoth_log_small_abs_bound hy hsmall have hfactor : 1 ≤ Real.exp 1 * Real.exp ((-1 : ℝ) * |y|) := by rw [← Real.exp_add] exact (Real.one_le_exp_iff).2 (by linarith) have hpolynonneg : 0 ≤ A + 3 * |Real.log (|y|)| := by positivity have hproduct : A + 3 * |Real.log (|y|)| ≤ (Real.exp 1 * Real.exp ((-1 : ℝ) * |y|)) * (A + 3 * |Real.log (|y|)|) := by nlinarith [mul_nonneg (sub_nonneg.mpr hfactor) hpolynonneg] have hrewrite : (Real.exp 1 * Real.exp ((-1 : ℝ) * |y|)) * (A + 3 * |Real.log (|y|)|) = Real.exp 1 * (A * Real.exp ((-1 : ℝ) * |y|) + 3 * (Real.exp ((-1 : ℝ) * |y|) * |Real.log (|y|)|)) := by ring try dsimp [A] at hsmallbound ⊢ try dsimp [A] at hproduct hrewrite linarith · have hylarge : 1 < |y| := lt_of_not_ge hsmall have harg : 1 ≤ Real.pi * |y| / 2 := by nlinarith [Real.pi_gt_three, mul_nonneg (by linarith [Real.pi_gt_three] : 0 ≤ Real.pi - 2) (sub_nonneg.mpr hylarge.le)] have hbound := lowerCoth_log_le_four_exp_neg_two harg have hexp : Real.exp (-2 * (Real.pi * |y| / 2)) = Real.exp ((-Real.pi) * |y|) := by congr 1 ring rw [hexp] at hbound linarith theorem lower_exp_log_coth_div_integrableOn_Ioi {a : ℝ} (ha : 0 < a) : IntegrableOn (fun y : ℝ => Real.exp ((-a) * y) * Real.log (lowerCoth (Real.pi * y / 2) / (y / 2))) (Ioi (0 : ℝ)) := by have hexponential : IntegrableOn (fun y : ℝ => Real.exp ((-a) * y)) (Ioi (0 : ℝ)) := integrableOn_exp_mul_Ioi (neg_lt_zero.mpr ha) 0 have hlinear : IntegrableOn (fun y : ℝ => y * Real.exp ((-a) * y)) (Ioi (0 : ℝ)) := by simpa [Real.rpow_one] using! (integrableOn_rpow_mul_exp_neg_mul_rpow (p := (1 : ℝ)) (s := (1 : ℝ)) (b := a) (by norm_num) (by norm_num) ha) have hmajorant : IntegrableOn (fun y : ℝ => Real.pi * (y * Real.exp ((-a) * y)) + |Real.log Real.pi| * Real.exp ((-a) * y) + 2 * (Real.exp ((-a) * y) * |Real.log (y / 2)|)) (Ioi (0 : ℝ)) := ((hlinear.const_mul Real.pi).add (hexponential.const_mul |Real.log Real.pi|)).add ((lower_exp_abs_log_div_two_integrableOn_Ioi ha).const_mul 2) have hargument : ContinuousOn (fun y : ℝ => lowerCoth (Real.pi * y / 2) / (y / 2)) (Ioi (0 : ℝ)) := by unfold lowerCoth apply ContinuousOn.div · apply ContinuousOn.div · fun_prop · fun_prop · intro y hy apply Real.sinh_ne_zero.mpr have hypos := mem_Ioi.mp hy positivity · fun_prop · intro y hy have hypos := mem_Ioi.mp hy positivity have hargument_nonzero : ∀ y ∈ Ioi (0 : ℝ), lowerCoth (Real.pi * y / 2) / (y / 2) ≠ 0 := by intro y hy have hypos := mem_Ioi.mp hy unfold lowerCoth apply div_ne_zero · apply div_ne_zero · exact (Real.cosh_pos _).ne' · apply Real.sinh_ne_zero.mpr positivity · positivity have hcontinuous : ContinuousOn (fun y : ℝ => Real.exp ((-a) * y) * Real.log (lowerCoth (Real.pi * y / 2) / (y / 2))) (Ioi (0 : ℝ)) := by apply ContinuousOn.mul · fun_prop · exact hargument.log hargument_nonzero apply hmajorant.mono' (hcontinuous.aestronglyMeasurable measurableSet_Ioi) filter_upwards [ae_restrict_mem measurableSet_Ioi] with y hy have hypos := mem_Ioi.mp hy have hlog : |Real.log (lowerCoth (Real.pi * y / 2) / (y / 2))| ≤ Real.pi * y + |Real.log Real.pi| + 2 * |Real.log (y / 2)| := by convert! lower_abs_log_coth_div_le (half_pos hypos) using 1 <;> ring_nf change ‖Real.exp ((-a) * y) * Real.log (lowerCoth (Real.pi * y / 2) / (y / 2))‖ ≤ _ rw [Real.norm_eq_abs, abs_mul, abs_of_pos (Real.exp_pos _)] calc Real.exp ((-a) * y) * |Real.log (lowerCoth (Real.pi * y / 2) / (y / 2))| ≤ Real.exp ((-a) * y) * (Real.pi * y + |Real.log Real.pi| + 2 * |Real.log (y / 2)|) := mul_le_mul_of_nonneg_left hlog (Real.exp_pos _).le _ = Real.pi * (y * Real.exp ((-a) * y)) + |Real.log Real.pi| * Real.exp ((-a) * y) + 2 * (Real.exp ((-a) * y) * |Real.log (y / 2)|) := by ring theorem lower_exp_log_coth_div_integrable {a : ℝ} (ha : 0 < a) : Integrable (fun y : ℝ => Real.exp ((-a) * |y|) * Real.log (lowerCoth (Real.pi * |y| / 2) / (|y| / 2))) := by have hright : IntegrableOn (fun y : ℝ => Real.exp ((-a) * |y|) * Real.log (lowerCoth (Real.pi * |y| / 2) / (|y| / 2))) (Ioi (0 : ℝ)) := by refine (lower_exp_log_coth_div_integrableOn_Ioi ha).congr_fun ?_ measurableSet_Ioi intro y hy try dsimp rw [abs_of_pos (mem_Ioi.mp hy)] have hreflected : IntegrableOn ((fun y : ℝ => Real.exp ((-a) * |y|) * Real.log (lowerCoth (Real.pi * |y| / 2) / (|y| / 2))) ∘ (fun y : ℝ => -y)) ((fun y : ℝ => -y) ⁻¹' Iio (0 : ℝ)) := by simpa [Function.comp_def, neg_preimage, neg_Iio, abs_neg] using! hright have hleft : IntegrableOn (fun y : ℝ => Real.exp ((-a) * |y|) * Real.log (lowerCoth (Real.pi * |y| / 2) / (|y| / 2))) (Iio (0 : ℝ)) := ((Measure.measurePreserving_neg (volume : Measure ℝ)).integrableOn_comp_preimage (Homeomorph.neg ℝ).measurableEmbedding).mp hreflected rw [← integrableOn_univ, ← @Iio_union_Ici _ _ (0 : ℝ), integrableOn_union, integrableOn_Ici_iff_integrableOn_Ioi] exact ⟨hleft, hright⟩ theorem gamma_log_coth_ratio {x : ℝ} (hx : x ≠ 0) : Real.log ‖Complex.Gamma (Complex.I * (x : ℂ))‖ - Real.log ‖Complex.Gamma ((1 / 2 : ℂ) + Complex.I * (x : ℂ))‖ = (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * |x|) / |x|) := by have hsinh : Real.sinh (Real.pi * x) ≠ 0 := Real.sinh_ne_zero.mpr (mul_ne_zero Real.pi_ne_zero hx) have hden : x * Real.sinh (Real.pi * x) ≠ 0 := mul_ne_zero hx hsinh have hcosh : Real.cosh (Real.pi * x) ≠ 0 := (Real.cosh_pos _).ne' have himaginary : 2 * Real.log ‖Complex.Gamma (Complex.I * (x : ℂ))‖ = Real.log Real.pi - Real.log (x * Real.sinh (Real.pi * x)) := by calc 2 * Real.log ‖Complex.Gamma (Complex.I * (x : ℂ))‖ = Real.log (‖Complex.Gamma (Complex.I * (x : ℂ))‖ ^ 2) := by rw [Real.log_pow] norm_num _ = Real.log (Real.pi / (x * Real.sinh (Real.pi * x))) := by rw [norm_gamma_imaginary_sq hx] _ = Real.log Real.pi - Real.log (x * Real.sinh (Real.pi * x)) := Real.log_div Real.pi_ne_zero hden have hhalf : 2 * Real.log ‖Complex.Gamma ((1 / 2 : ℂ) + Complex.I * (x : ℂ))‖ = Real.log Real.pi - Real.log (Real.cosh (Real.pi * x)) := by calc 2 * Real.log ‖Complex.Gamma ((1 / 2 : ℂ) + Complex.I * (x : ℂ))‖ = Real.log (‖Complex.Gamma ((1 / 2 : ℂ) + Complex.I * (x : ℂ))‖ ^ 2) := by rw [Real.log_pow] norm_num _ = Real.log (Real.pi / Real.cosh (Real.pi * x)) := by rw [norm_gamma_half_add_imaginary_sq] _ = Real.log Real.pi - Real.log (Real.cosh (Real.pi * x)) := Real.log_div Real.pi_ne_zero hcosh have hcoth : lowerCoth (Real.pi * |x|) / |x| = Real.cosh (Real.pi * x) / (x * Real.sinh (Real.pi * x)) := by rcases lt_or_gt_of_ne hx with hnegative | hpositive · rw [abs_of_neg hnegative] unfold lowerCoth have harg : Real.pi * -x = -(Real.pi * x) := by ring rw [harg, Real.cosh_neg, Real.sinh_neg] field_simp [hx, hsinh] · rw [abs_of_pos hpositive] unfold lowerCoth field_simp [hx, hsinh] have hlogcoth : Real.log (Real.cosh (Real.pi * x)) - Real.log (x * Real.sinh (Real.pi * x)) = Real.log (lowerCoth (Real.pi * |x|) / |x|) := by rw [hcoth, Real.log_div hcosh hden] calc Real.log ‖Complex.Gamma (Complex.I * (x : ℂ))‖ - Real.log ‖Complex.Gamma ((1 / 2 : ℂ) + Complex.I * (x : ℂ))‖ = (1 / 2 : ℝ) * ((Real.log Real.pi - Real.log (x * Real.sinh (Real.pi * x))) - (Real.log Real.pi - Real.log (Real.cosh (Real.pi * x)))) := by linarith _ = (1 / 2 : ℝ) * (Real.log (Real.cosh (Real.pi * x)) - Real.log (x * Real.sinh (Real.pi * x))) := by ring _ = (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * |x|) / |x|) := by rw [hlogcoth] theorem lowerGammaBoundaryLog_halfInteger (k : ℕ) (R : ℝ) {y : ℝ} (hy : y ≠ 0) : lowerGammaBoundaryLog ((k : ℝ) + 1 / 2) R y = ((k : ℝ) + 1 / 2) * Real.log (Real.pi * R ^ 2) - ∑ j ∈ Finset.range k, Real.log (Real.sqrt (((j : ℝ) + 1 / 2) ^ 2 + (y / 2) ^ 2)) + (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * |y| / 2) / (|y| / 2)) := by calc lowerGammaBoundaryLog ((k : ℝ) + 1 / 2) R y = ((k : ℝ) + 1 / 2) * Real.log (Real.pi * R ^ 2) - ∑ j ∈ Finset.range k, Real.log (Real.sqrt (((j : ℝ) + 1 / 2) ^ 2 + (y / 2) ^ 2)) + (Real.log ‖Complex.Gamma (Complex.I * (y : ℂ) / 2)‖ - Real.log ‖Complex.Gamma ((1 / 2 : ℂ) + Complex.I * (y : ℂ) / 2)‖) := lowerGammaBoundaryLog_halfInteger_factorized k R hy _ = ((k : ℝ) + 1 / 2) * Real.log (Real.pi * R ^ 2) - ∑ j ∈ Finset.range k, Real.log (Real.sqrt (((j : ℝ) + 1 / 2) ^ 2 + (y / 2) ^ 2)) + (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * |y| / 2) / (|y| / 2)) := by congr 1 simpa [abs_div, mul_div_assoc] using! (gamma_log_coth_ratio (x := y / 2) (div_ne_zero hy (by norm_num))) theorem lowerGammaBoundaryLog_halfInteger_log_tail (k : ℕ) {R y : ℝ} (hR : 0 < R) (hy : y ≠ 0) : lowerGammaBoundaryLog ((k : ℝ) + 1 / 2) R y ≤ ((k : ℝ) + 1 / 2) * Real.log (2 * Real.pi * R ^ 2 / |y|) + (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * |y| / 2)) := by have hyhalf : 0 < |y| / 2 := by positivity have hsum : (k : ℝ) * Real.log (|y| / 2) ≤ ∑ j ∈ Finset.range k, Real.log (Real.sqrt (((j : ℝ) + 1 / 2) ^ 2 + (y / 2) ^ 2)) := by calc (k : ℝ) * Real.log (|y| / 2) = ∑ j ∈ Finset.range k, Real.log (|y| / 2) := by simp _ ≤ ∑ j ∈ Finset.range k, Real.log (Real.sqrt (((j : ℝ) + 1 / 2) ^ 2 + (y / 2) ^ 2)) := by apply Finset.sum_le_sum intro j hj exact Real.log_le_log hyhalf (lower_sqrtFactor_ge_abs_half ((j : ℝ) + 1 / 2) y) have hlogratio : Real.log (Real.pi * R ^ 2) - Real.log (|y| / 2) = Real.log (2 * Real.pi * R ^ 2 / |y|) := by rw [← Real.log_div (mul_ne_zero Real.pi_ne_zero (pow_ne_zero 2 hR.ne')) hyhalf.ne'] congr 1 field_simp [abs_ne_zero.mpr hy] have hcoth : 0 < lowerCoth (Real.pi * |y| / 2) := by apply lowerCoth_pos positivity have hlogcoth : Real.log (lowerCoth (Real.pi * |y| / 2) / (|y| / 2)) = Real.log (lowerCoth (Real.pi * |y| / 2)) - Real.log (|y| / 2) := Real.log_div hcoth.ne' hyhalf.ne' rw [lowerGammaBoundaryLog_halfInteger k R hy, hlogcoth] calc ((k : ℝ) + 1 / 2) * Real.log (Real.pi * R ^ 2) - ∑ j ∈ Finset.range k, Real.log (Real.sqrt (((j : ℝ) + 1 / 2) ^ 2 + (y / 2) ^ 2)) + (1 / 2 : ℝ) * (Real.log (lowerCoth (Real.pi * |y| / 2)) - Real.log (|y| / 2)) ≤ ((k : ℝ) + 1 / 2) * Real.log (Real.pi * R ^ 2) - (k : ℝ) * Real.log (|y| / 2) + (1 / 2 : ℝ) * (Real.log (lowerCoth (Real.pi * |y| / 2)) - Real.log (|y| / 2)) := by linarith _ = ((k : ℝ) + 1 / 2) * (Real.log (Real.pi * R ^ 2) - Real.log (|y| / 2)) + (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * |y| / 2)) := by ring _ = ((k : ℝ) + 1 / 2) * Real.log (2 * Real.pi * R ^ 2 / |y|) + (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * |y| / 2)) := by rw [hlogratio] theorem lowerGammaBoundaryLog_dimension_log_tail {d : ℕ} (_hd : 0 < d) {R y : ℝ} (hR : 0 < R) (hy : y ≠ 0) : lowerGammaBoundaryLog ((d : ℝ) / 2) R y ≤ ((d : ℝ) / 2) * Real.log (2 * Real.pi * R ^ 2 / |y|) + (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * |y| / 2)) := by have hcoth : 0 ≤ Real.log (lowerCoth (Real.pi * |y| / 2)) := by apply lowerCoth_log_nonneg positivity rcases d.even_or_odd with ⟨k, rfl⟩ | ⟨k, rfl⟩ · have hq : ((↑(k + k) : ℝ) / 2) = (k : ℝ) := by push_cast ring rw [hq] have htail := lowerGammaBoundaryLog_integer_log_tail k hR hy linarith · have hq : ((↑(2 * k + 1) : ℝ) / 2) = (k : ℝ) + 1 / 2 := by push_cast ring rw [hq] exact lowerGammaBoundaryLog_halfInteger_log_tail k hR hy theorem lowerGammaBoundaryLog_dimension_scaled_log_tail {d : ℕ} (hd : 0 < d) {c Y : ℝ} (hc : 0 < c) (hY : Y ≠ 0) : lowerGammaBoundaryLog ((d : ℝ) / 2) (c * Real.sqrt d) (((d : ℝ) / 2) * Y) ≤ ((d : ℝ) / 2) * Real.log (4 * Real.pi * c ^ 2 / |Y|) + (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * |((d : ℝ) / 2) * Y| / 2)) := by have hdreal : 0 < (d : ℝ) := Nat.cast_pos.mpr hd have hℓ : 0 < (d : ℝ) / 2 := half_pos hdreal have hR : 0 < c * Real.sqrt d := mul_pos hc (Real.sqrt_pos.2 hdreal) have hy : ((d : ℝ) / 2) * Y ≠ 0 := mul_ne_zero hℓ.ne' hY have htail := lowerGammaBoundaryLog_dimension_log_tail hd hR hy have hratio : 2 * Real.pi * (c * Real.sqrt d) ^ 2 / |((d : ℝ) / 2) * Y| = 4 * Real.pi * c ^ 2 / |Y| := by rw [abs_mul, abs_of_pos hℓ, mul_pow, Real.sq_sqrt hdreal.le] field_simp [hℓ.ne', abs_ne_zero.mpr hY, hdreal.ne'] ring rw [hratio] at htail exact htail theorem lowerGammaBoundaryLog_dimension_scaled_log_tail_uniform {d : ℕ} (hd : 2 ≤ d) {c Y : ℝ} (hc : 0 < c) (hY : Y ≠ 0) : lowerGammaBoundaryLog ((d : ℝ) / 2) (c * Real.sqrt d) (((d : ℝ) / 2) * Y) ≤ ((d : ℝ) / 2) * Real.log (4 * Real.pi * c ^ 2 / |Y|) + (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * |Y| / 2)) := by have hdpos : 0 < d := lt_of_lt_of_le (by norm_num) hd have hℓ : 1 ≤ (d : ℝ) / 2 := by exact (le_div_iff₀ (by norm_num : (0 : ℝ) < 2)).2 (by exact_mod_cast hd) have ht : 0 < Real.pi * |Y| / 2 := by positivity have ht' : 0 < Real.pi * |((d : ℝ) / 2) * Y| / 2 := by positivity have hcompare : Real.pi * |Y| / 2 ≤ Real.pi * |((d : ℝ) / 2) * Y| / 2 := by rw [abs_mul, abs_of_nonneg (by linarith : 0 ≤ (d : ℝ) / 2)] nlinarith [mul_nonneg Real.pi_pos.le (abs_nonneg Y), mul_nonneg (sub_nonneg.mpr hℓ) (mul_nonneg Real.pi_pos.le (abs_nonneg Y))] have hcoth := lowerCoth_log_antitoneOn ht ht' hcompare have htail := lowerGammaBoundaryLog_dimension_scaled_log_tail hdpos hc hY linarith theorem lower_positiveLogRatio_integrable {A : ℝ} (hA : 0 < A) : Integrable (fun y : ℝ => max (Real.log (A / |y|)) 0) := by let B : ℝ := max 1 A have hB : 0 ≤ B := le_trans (by norm_num) (le_max_left 1 A) have hbase := strip_exp_abs_integrable (by norm_num : 0 < (1 : ℝ)) have hlog := strip_exp_abs_log_abs_integrable (by norm_num : 0 < (1 : ℝ)) have hnear : Integrable (fun y : ℝ => |Real.log A| * Real.exp ((-1 : ℝ) * |y|) + Real.exp ((-1 : ℝ) * |y|) * |Real.log (|y|)|) := (hbase.const_mul |Real.log A|).add hlog have hmajor : Integrable (fun y : ℝ => Real.exp B * (|Real.log A| * Real.exp ((-1 : ℝ) * |y|) + Real.exp ((-1 : ℝ) * |y|) * |Real.log (|y|)|)) := hnear.const_mul (Real.exp B) apply hmajor.mono' · have harg : Measurable (fun y : ℝ => A / |y|) := by fun_prop exact (harg.log.max measurable_const).aestronglyMeasurable · filter_upwards [] with y rw [Real.norm_eq_abs, abs_of_nonneg (le_max_right _ _)] by_cases hy : y = 0 · subst y simp positivity · by_cases hsmall : |y| ≤ B · have habslog : Real.log (A / |y|) ≤ |Real.log A| + |Real.log (|y|)| := by rw [Real.log_div hA.ne' (abs_ne_zero.mpr hy)] linarith [le_abs_self (Real.log A), neg_le_abs (Real.log (|y|))] have hpoly : 0 ≤ |Real.log A| + |Real.log (|y|)| := by positivity have hmax : max (Real.log (A / |y|)) 0 ≤ |Real.log A| + |Real.log (|y|)| := max_le habslog hpoly have hfactor : 1 ≤ Real.exp B * Real.exp ((-1 : ℝ) * |y|) := by rw [← Real.exp_add] exact (Real.one_le_exp_iff).2 (by linarith) have hproduct : |Real.log A| + |Real.log (|y|)| ≤ (Real.exp B * Real.exp ((-1 : ℝ) * |y|)) * (|Real.log A| + |Real.log (|y|)|) := by nlinarith [mul_nonneg (sub_nonneg.mpr hfactor) hpoly] calc max (Real.log (A / |y|)) 0 ≤ |Real.log A| + |Real.log (|y|)| := hmax _ ≤ (Real.exp B * Real.exp ((-1 : ℝ) * |y|)) * (|Real.log A| + |Real.log (|y|)|) := hproduct _ = Real.exp B * (|Real.log A| * Real.exp ((-1 : ℝ) * |y|) + Real.exp ((-1 : ℝ) * |y|) * |Real.log (|y|)|) := by ring · have hylarge : B < |y| := lt_of_not_ge hsmall have hyle : A ≤ |y| := le_trans (le_max_right 1 A) hylarge.le have hratio : A / |y| ≤ 1 := (div_le_one (abs_pos.mpr hy)).2 hyle have hlognonpos : Real.log (A / |y|) ≤ 0 := Real.log_nonpos (div_nonneg hA.le (abs_nonneg y)) hratio rw [max_eq_right hlognonpos] positivity def lowerGammaScaledPositivePart (d : ℕ) (c Y : ℝ) : ℝ := max (lowerGammaBoundaryLog ((d : ℝ) / 2) (c * Real.sqrt d) (((d : ℝ) / 2) * Y)) 0 theorem lowerGammaScaledPositivePart_le {d : ℕ} (hd : 2 ≤ d) {c Y : ℝ} (hc : 0 < c) (hY : Y ≠ 0) : lowerGammaScaledPositivePart d c Y ≤ ((d : ℝ) / 2) * max (Real.log (4 * Real.pi * c ^ 2 / |Y|)) 0 + (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * |Y| / 2)) := by have hℓ : 0 ≤ (d : ℝ) / 2 := by positivity have hcoth : 0 ≤ Real.log (lowerCoth (Real.pi * |Y| / 2)) := lowerCoth_log_nonneg (by positivity) have hlog : ((d : ℝ) / 2) * Real.log (4 * Real.pi * c ^ 2 / |Y|) ≤ ((d : ℝ) / 2) * max (Real.log (4 * Real.pi * c ^ 2 / |Y|)) 0 := mul_le_mul_of_nonneg_left (le_max_left _ _) hℓ have htail := lowerGammaBoundaryLog_dimension_scaled_log_tail_uniform hd hc hY unfold lowerGammaScaledPositivePart apply max_le · linarith · positivity theorem lowerGammaScaledPositivePart_integrable {d : ℕ} (hd : 2 ≤ d) {c : ℝ} (hc : 0 < c) : Integrable (lowerGammaScaledPositivePart d c) := by have hA : 0 < 4 * Real.pi * c ^ 2 := by positivity have hpositive := lower_positiveLogRatio_integrable hA have hmajor : Integrable (fun Y : ℝ => ((d : ℝ) / 2) * max (Real.log (4 * Real.pi * c ^ 2 / |Y|)) 0 + (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * |Y| / 2))) := (hpositive.const_mul ((d : ℝ) / 2)).add (lowerCoth_log_abs_integrable.const_mul (1 / 2 : ℝ)) apply hmajor.mono' · have hdpos : 0 < d := lt_of_lt_of_le (by norm_num) hd have hℓ : 0 < (d : ℝ) / 2 := half_pos (Nat.cast_pos.mpr hdpos) have harg : Measurable (fun Y : ℝ => ((d : ℝ) / 2) * Y) := by fun_prop have hgamma : Measurable (fun Y : ℝ => lowerGammaBoundaryLog ((d : ℝ) / 2) (c * Real.sqrt d) (((d : ℝ) / 2) * Y)) := (lowerGammaBoundaryLog_measurable hℓ (c * Real.sqrt d)).comp harg exact (hgamma.max measurable_const).aestronglyMeasurable · filter_upwards [Measure.ae_ne (volume : Measure ℝ) 0] with Y hY rw [Real.norm_eq_abs, abs_of_nonneg (show 0 ≤ lowerGammaScaledPositivePart d c Y by exact le_max_right _ _)] exact lowerGammaScaledPositivePart_le hd hc hY theorem lowerGammaScaledPositivePart_integral_le {d : ℕ} (hd : 2 ≤ d) {c : ℝ} (hc : 0 < c) : (∫ Y : ℝ, lowerGammaScaledPositivePart d c Y) ≤ ((d : ℝ) / 2) * (∫ Y : ℝ, max (Real.log (4 * Real.pi * c ^ 2 / |Y|)) 0) + (1 / 2 : ℝ) * (∫ Y : ℝ, Real.log (lowerCoth (Real.pi * |Y| / 2))) := by have hA : 0 < 4 * Real.pi * c ^ 2 := by positivity have hpositive := lower_positiveLogRatio_integrable hA have hcoth := lowerCoth_log_abs_integrable have hmajor : Integrable (fun Y : ℝ => ((d : ℝ) / 2) * max (Real.log (4 * Real.pi * c ^ 2 / |Y|)) 0 + (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * |Y| / 2))) := (hpositive.const_mul ((d : ℝ) / 2)).add (hcoth.const_mul (1 / 2 : ℝ)) calc (∫ Y : ℝ, lowerGammaScaledPositivePart d c Y) ≤ ∫ Y : ℝ, (((d : ℝ) / 2) * max (Real.log (4 * Real.pi * c ^ 2 / |Y|)) 0 + (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * |Y| / 2))) := by apply integral_mono_ae (lowerGammaScaledPositivePart_integrable hd hc) hmajor filter_upwards [Measure.ae_ne (volume : Measure ℝ) 0] with Y hY exact lowerGammaScaledPositivePart_le hd hc hY _ = ((d : ℝ) / 2) * (∫ Y : ℝ, max (Real.log (4 * Real.pi * c ^ 2 / |Y|)) 0) + (1 / 2 : ℝ) * (∫ Y : ℝ, Real.log (lowerCoth (Real.pi * |Y| / 2))) := by rw [integral_add (hpositive.const_mul ((d : ℝ) / 2)) (hcoth.const_mul (1 / 2 : ℝ)), integral_const_mul, integral_const_mul] theorem lowerGammaBoundaryLog_dimension_scaled_nonpos_of_large {d : ℕ} (hd : 2 ≤ d) {c Y : ℝ} (hc : 0 < c) (hlarge : max 1 (8 * Real.pi * c ^ 2) ≤ |Y|) : lowerGammaBoundaryLog ((d : ℝ) / 2) (c * Real.sqrt d) (((d : ℝ) / 2) * Y) ≤ 0 := by have hyone : 1 ≤ |Y| := le_trans (le_max_left 1 _) hlarge have hY : Y ≠ 0 := by intro h norm_num [h] at hyone have hA : 0 < 4 * Real.pi * c ^ 2 := by positivity have hden : 0 < |Y| := abs_pos.mpr hY have hradius : 8 * Real.pi * c ^ 2 ≤ |Y| := le_trans (le_max_right 1 _) hlarge have hratio : 4 * Real.pi * c ^ 2 / |Y| ≤ (1 / 2 : ℝ) := by apply (div_le_iff₀ hden).2 nlinarith have hratio_pos : 0 < 4 * Real.pi * c ^ 2 / |Y| := div_pos hA hden have hlogratio : Real.log (4 * Real.pi * c ^ 2 / |Y|) ≤ -(Real.log (2 : ℝ)) := by calc Real.log (4 * Real.pi * c ^ 2 / |Y|) ≤ Real.log (1 / 2 : ℝ) := Real.log_le_log hratio_pos hratio _ = -(Real.log (2 : ℝ)) := by rw [one_div, Real.log_inv] have hlogtwo : (1 / 2 : ℝ) ≤ Real.log (2 : ℝ) := by have h := Real.one_sub_inv_le_log_of_pos (by norm_num : (0 : ℝ) < 2) norm_num at h ⊢ exact h have hpiabs : 3 ≤ Real.pi * |Y| := by nlinarith [Real.pi_gt_three, mul_nonneg (by linarith [Real.pi_gt_three] : 0 ≤ Real.pi - 3) (sub_nonneg.mpr hyone)] have harg : 1 ≤ Real.pi * |Y| / 2 := by linarith have hexpthree : 4 ≤ Real.exp (3 : ℝ) := by nlinarith [Real.add_one_le_exp (3 : ℝ)] have hexpsmall : Real.exp ((-Real.pi) * |Y|) ≤ (1 / 4 : ℝ) := by calc Real.exp ((-Real.pi) * |Y|) ≤ Real.exp (-3 : ℝ) := by apply Real.exp_le_exp.mpr nlinarith _ = (Real.exp (3 : ℝ))⁻¹ := Real.exp_neg 3 _ ≤ (1 / 4 : ℝ) := by simpa [one_div] using! (one_div_le_one_div_of_le (by norm_num : (0 : ℝ) < 4) hexpthree) have hcoth := lowerCoth_log_le_four_exp_neg_two harg have hexp : Real.exp (-2 * (Real.pi * |Y| / 2)) = Real.exp ((-Real.pi) * |Y|) := by congr 1 ring rw [hexp] at hcoth have hcorrection : (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * |Y| / 2)) ≤ (1 / 2 : ℝ) := by nlinarith have hℓ : 1 ≤ (d : ℝ) / 2 := by apply (le_div_iff₀ (by norm_num : (0 : ℝ) < 2)).2 exact_mod_cast hd have hmain : ((d : ℝ) / 2) * Real.log (4 * Real.pi * c ^ 2 / |Y|) ≤ -(Real.log (2 : ℝ)) := by calc ((d : ℝ) / 2) * Real.log (4 * Real.pi * c ^ 2 / |Y|) ≤ ((d : ℝ) / 2) * (-(Real.log (2 : ℝ))) := mul_le_mul_of_nonneg_left hlogratio (by positivity) _ ≤ -(Real.log (2 : ℝ)) := by nlinarith [mul_nonneg (sub_nonneg.mpr hℓ) (show 0 ≤ Real.log (2 : ℝ) by linarith)] have htail := lowerGammaBoundaryLog_dimension_scaled_log_tail_uniform hd hc hY linarith theorem lowerGammaScaledPositivePart_support {d : ℕ} (hd : 2 ≤ d) {c : ℝ} (hc : 0 < c) : Function.support (lowerGammaScaledPositivePart d c) ⊆ Icc (-(max 1 (8 * Real.pi * c ^ 2))) (max 1 (8 * Real.pi * c ^ 2)) := by intro Y hY change lowerGammaScaledPositivePart d c Y ≠ 0 at hY have hsmall : |Y| < max 1 (8 * Real.pi * c ^ 2) := by by_contra hnot have hlarge : max 1 (8 * Real.pi * c ^ 2) ≤ |Y| := le_of_not_gt hnot have hnonpos := lowerGammaBoundaryLog_dimension_scaled_nonpos_of_large hd hc hlarge apply hY unfold lowerGammaScaledPositivePart exact max_eq_right hnonpos exact ⟨(neg_lt_of_abs_lt hsmall).le, (lt_of_abs_lt hsmall).le⟩ theorem exists_lowerGammaScaledPositivePart_uniform_bound {c : ℝ} (hc : 0 < c) : ∃ C : ℝ, 0 < C ∧ ∀ d : ℕ, 2 ≤ d → Function.support (lowerGammaScaledPositivePart d c) ⊆ Icc (-C) C ∧ (∫ Y : ℝ, lowerGammaScaledPositivePart d c Y) ≤ C * ((d : ℝ) / 2) := by let J : ℝ := ∫ Y : ℝ, max (Real.log (4 * Real.pi * c ^ 2 / |Y|)) 0 let K : ℝ := ∫ Y : ℝ, Real.log (lowerCoth (Real.pi * |Y| / 2)) let B : ℝ := max 1 (8 * Real.pi * c ^ 2) let C : ℝ := max B (J + (1 / 2 : ℝ) * K) have hB : 1 ≤ B := le_max_left 1 _ have hC : B ≤ C := le_max_left _ _ have hK : 0 ≤ K := by try dsimp [K] apply integral_nonneg intro Y by_cases hY : Y = 0 · simp [hY, lowerCoth] · exact lowerCoth_log_nonneg (by positivity) refine ⟨C, by linarith, ?_⟩ intro d hd constructor · intro Y hY have hsupport := lowerGammaScaledPositivePart_support hd hc hY exact ⟨le_trans (neg_le_neg hC) hsupport.1, le_trans hsupport.2 hC⟩ · have hℓ : 1 ≤ (d : ℝ) / 2 := by apply (le_div_iff₀ (by norm_num : (0 : ℝ) < 2)).2 exact_mod_cast hd have hmain := lowerGammaScaledPositivePart_integral_le hd hc change (∫ Y : ℝ, lowerGammaScaledPositivePart d c Y) ≤ ((d : ℝ) / 2) * J + (1 / 2 : ℝ) * K at hmain have hphase : ((d : ℝ) / 2) * J + (1 / 2 : ℝ) * K ≤ ((d : ℝ) / 2) * (J + (1 / 2 : ℝ) * K) := by nlinarith [mul_nonneg (sub_nonneg.mpr hℓ) hK] have hconstant : J + (1 / 2 : ℝ) * K ≤ C := le_max_right B _ calc (∫ Y : ℝ, lowerGammaScaledPositivePart d c Y) ≤ ((d : ℝ) / 2) * J + (1 / 2 : ℝ) * K := hmain _ ≤ ((d : ℝ) / 2) * (J + (1 / 2 : ℝ) * K) := hphase _ ≤ ((d : ℝ) / 2) * C := mul_le_mul_of_nonneg_left hconstant (by positivity) _ = C * ((d : ℝ) / 2) := by ring theorem lowerGammaBoundaryLog_integer_neg (k : ℕ) (R : ℝ) {y : ℝ} (hy : y ≠ 0) : lowerGammaBoundaryLog (k : ℝ) R (-y) = lowerGammaBoundaryLog (k : ℝ) R y := by rw [lowerGammaBoundaryLog_integer k R (neg_ne_zero.mpr hy), lowerGammaBoundaryLog_integer k R hy] simp [div_pow] theorem lowerGammaBoundaryLog_halfInteger_neg (k : ℕ) (R : ℝ) {y : ℝ} (hy : y ≠ 0) : lowerGammaBoundaryLog ((k : ℝ) + 1 / 2) R (-y) = lowerGammaBoundaryLog ((k : ℝ) + 1 / 2) R y := by rw [lowerGammaBoundaryLog_halfInteger k R (neg_ne_zero.mpr hy), lowerGammaBoundaryLog_halfInteger k R hy] simp [div_pow] theorem lowerGammaBoundaryLog_dimension_neg {d : ℕ} (R : ℝ) {y : ℝ} (hy : y ≠ 0) : lowerGammaBoundaryLog ((d : ℝ) / 2) R (-y) = lowerGammaBoundaryLog ((d : ℝ) / 2) R y := by rcases d.even_or_odd with ⟨k, rfl⟩ | ⟨k, rfl⟩ · have hq : ((↑(k + k) : ℝ) / 2) = (k : ℝ) := by push_cast ring rw [hq] exact lowerGammaBoundaryLog_integer_neg k R hy · have hq : ((↑(2 * k + 1) : ℝ) / 2) = (k : ℝ) + 1 / 2 := by push_cast ring rw [hq] exact lowerGammaBoundaryLog_halfInteger_neg k R hy theorem lowerGammaBoundaryLog_integer_antitoneOn (k : ℕ) (R : ℝ) : AntitoneOn (lowerGammaBoundaryLog (k : ℝ) R) (Ioi (0 : ℝ)) := by intro x hx y hy hxy change 0 < x at hx change 0 < y at hy rw [lowerGammaBoundaryLog_integer k R hy.ne', lowerGammaBoundaryLog_integer k R hx.ne'] have hsum : (∑ j ∈ Finset.range k, Real.log (Real.sqrt ((j : ℝ) ^ 2 + (x / 2) ^ 2))) ≤ ∑ j ∈ Finset.range k, Real.log (Real.sqrt ((j : ℝ) ^ 2 + (y / 2) ^ 2)) := by apply Finset.sum_le_sum intro j hj have hradx : 0 < (j : ℝ) ^ 2 + (x / 2) ^ 2 := by nlinarith [sq_nonneg (j : ℝ), sq_pos_of_pos (half_pos hx)] apply Real.log_le_log (Real.sqrt_pos.mpr hradx) apply Real.sqrt_le_sqrt nlinarith [sq_nonneg (y / 2 - x / 2), mul_nonneg (half_pos hx).le (show 0 ≤ y / 2 - x / 2 by linarith)] linarith theorem lowerGammaBoundaryLog_halfInteger_antitoneOn (k : ℕ) (R : ℝ) : AntitoneOn (lowerGammaBoundaryLog ((k : ℝ) + 1 / 2) R) (Ioi (0 : ℝ)) := by intro x hx y hy hxy change 0 < x at hx change 0 < y at hy rw [lowerGammaBoundaryLog_halfInteger k R hy.ne', lowerGammaBoundaryLog_halfInteger k R hx.ne'] simp only [abs_of_pos hx, abs_of_pos hy] have hsum : (∑ j ∈ Finset.range k, Real.log (Real.sqrt (((j : ℝ) + 1 / 2) ^ 2 + (x / 2) ^ 2))) ≤ ∑ j ∈ Finset.range k, Real.log (Real.sqrt (((j : ℝ) + 1 / 2) ^ 2 + (y / 2) ^ 2)) := by apply Finset.sum_le_sum intro j hj have hradx : 0 < ((j : ℝ) + 1 / 2) ^ 2 + (x / 2) ^ 2 := by nlinarith [sq_nonneg ((j : ℝ) + 1 / 2), sq_pos_of_pos (half_pos hx)] apply Real.log_le_log (Real.sqrt_pos.mpr hradx) apply Real.sqrt_le_sqrt nlinarith [sq_nonneg (y / 2 - x / 2), mul_nonneg (half_pos hx).le (show 0 ≤ y / 2 - x / 2 by linarith)] have hxarg : 0 < Real.pi * x / 2 := by positivity have hyarg : 0 < Real.pi * y / 2 := by positivity have harg : Real.pi * x / 2 ≤ Real.pi * y / 2 := by gcongr have hcoth : lowerCoth (Real.pi * y / 2) ≤ lowerCoth (Real.pi * x / 2) := lowerCoth_antitoneOn hxarg hyarg harg have hratio : lowerCoth (Real.pi * y / 2) / (y / 2) ≤ lowerCoth (Real.pi * x / 2) / (x / 2) := by calc lowerCoth (Real.pi * y / 2) / (y / 2) ≤ lowerCoth (Real.pi * x / 2) / (y / 2) := div_le_div_of_nonneg_right hcoth (half_pos hy).le _ ≤ lowerCoth (Real.pi * x / 2) / (x / 2) := div_le_div_of_nonneg_left (lowerCoth_pos hxarg).le (half_pos hx) (by linarith) have hcorr : Real.log (lowerCoth (Real.pi * y / 2) / (y / 2)) ≤ Real.log (lowerCoth (Real.pi * x / 2) / (x / 2)) := Real.log_le_log (div_pos (lowerCoth_pos hyarg) (half_pos hy)) hratio linarith theorem lowerGammaBoundaryLog_dimension_antitoneOn {d : ℕ} (R : ℝ) : AntitoneOn (lowerGammaBoundaryLog ((d : ℝ) / 2) R) (Ioi (0 : ℝ)) := by rcases d.even_or_odd with ⟨k, rfl⟩ | ⟨k, rfl⟩ · have hq : ((↑(k + k) : ℝ) / 2) = (k : ℝ) := by push_cast ring rw [hq] exact lowerGammaBoundaryLog_integer_antitoneOn k R · have hq : ((↑(2 * k + 1) : ℝ) / 2) = (k : ℝ) + 1 / 2 := by push_cast ring rw [hq] exact lowerGammaBoundaryLog_halfInteger_antitoneOn k R theorem even_antitone_superlevel_interval {f : ℝ → ℝ} {B t : ℝ} (heven : ∀ x : ℝ, f (-x) = f x) (hanti : AntitoneOn f (Ici (0 : ℝ))) (hsupport : Function.support f ⊆ Icc (-B) B) (ht : 0 < t) : ∃ r : ℝ, 0 ≤ r ∧ Ioo (-r) r ⊆ {x : ℝ | t < f x} ∧ {x : ℝ | t < f x} ⊆ Icc (-r) r := by have habs (x : ℝ) : f |x| = f x := by rcases le_total 0 x with hx | hx · rw [abs_of_nonneg hx] · rw [abs_of_nonpos hx, heven] let S : Set ℝ := {u : ℝ | 0 ≤ u ∧ t < f u} by_cases hS : S.Nonempty · have hbdd : BddAbove S := by refine ⟨B, ?_⟩ intro u hu change 0 ≤ u ∧ t < f u at hu have hunonzero : f u ≠ 0 := by intro hzero rw [hzero] at hu linarith [hu.2] exact (hsupport hunonzero).2 let r : ℝ := sSup S have hr : 0 ≤ r := by obtain ⟨u, hu⟩ := hS have hu' : 0 ≤ u ∧ t < f u := hu exact le_trans hu'.1 (le_csSup hbdd hu) refine ⟨r, hr, ?_, ?_⟩ · intro x hx have hxabs : |x| < r := abs_lt.mpr hx obtain ⟨u, hu, hxu⟩ := exists_lt_of_lt_csSup hS hxabs have hu' : 0 ≤ u ∧ t < f u := hu have horder : f u ≤ f |x| := hanti (show |x| ∈ Ici 0 from abs_nonneg x) (show u ∈ Ici 0 from hu'.1) hxu.le change t < f x rw [← habs] exact lt_of_lt_of_le hu'.2 horder · intro x hx have hxS : |x| ∈ S := by change 0 ≤ |x| ∧ t < f |x| refine ⟨abs_nonneg x, ?_⟩ rw [habs] exact hx have hxle : |x| ≤ r := le_csSup hbdd hxS exact (abs_le.mp hxle) · refine ⟨0, le_rfl, ?_, ?_⟩ · simp · intro x hx exfalso apply hS refine ⟨|x|, ?_⟩ change 0 ≤ |x| ∧ t < f |x| refine ⟨abs_nonneg x, ?_⟩ rw [habs] exact hx theorem lowerGammaBoundaryLog_halfInteger_exp_integrable {a : ℝ} (ha : 0 < a) (k : ℕ) (R : ℝ) : Integrable (fun y : ℝ => Real.exp ((-a) * |y|) * lowerGammaBoundaryLog ((k : ℝ) + 1 / 2) R y) := by have hconstant : Integrable (fun y : ℝ => (((k : ℝ) + 1 / 2) * Real.log (Real.pi * R ^ 2)) * Real.exp ((-a) * |y|)) := (strip_exp_abs_integrable ha).const_mul (((k : ℝ) + 1 / 2) * Real.log (Real.pi * R ^ 2)) have hsum : Integrable (fun y : ℝ => ∑ j ∈ Finset.range k, Real.exp ((-a) * |y|) * Real.log (Real.sqrt (((j : ℝ) + 1 / 2) ^ 2 + (y / 2) ^ 2))) := by exact integrable_finsetSum (Finset.range k) (fun j _ => lower_exp_log_sqrtFactor_integrable ha (by have hj : 0 ≤ (j : ℝ) := Nat.cast_nonneg j; linarith)) have hcorrection : Integrable (fun y : ℝ => (1 / 2 : ℝ) * (Real.exp ((-a) * |y|) * Real.log (lowerCoth (Real.pi * |y| / 2) / (|y| / 2)))) := (lower_exp_log_coth_div_integrable ha).const_mul (1 / 2) have hbase := (hconstant.sub hsum).add hcorrection refine hbase.congr ?_ filter_upwards [Measure.ae_ne (volume : Measure ℝ) 0] with y hy change ((((k : ℝ) + 1 / 2) * Real.log (Real.pi * R ^ 2)) * Real.exp ((-a) * |y|) - ∑ j ∈ Finset.range k, Real.exp ((-a) * |y|) * Real.log (Real.sqrt (((j : ℝ) + 1 / 2) ^ 2 + (y / 2) ^ 2))) + (1 / 2 : ℝ) * (Real.exp ((-a) * |y|) * Real.log (lowerCoth (Real.pi * |y| / 2) / (|y| / 2))) = Real.exp ((-a) * |y|) * lowerGammaBoundaryLog ((k : ℝ) + 1 / 2) R y rw [lowerGammaBoundaryLog_halfInteger k R hy] simp only [mul_add, mul_sub, Finset.mul_sum] ring theorem lowerGammaBoundaryLog_dimension_exp_integrable {d : ℕ} (hd : 0 < d) {a : ℝ} (ha : 0 < a) (R : ℝ) : Integrable (fun y : ℝ => Real.exp ((-a) * |y|) * lowerGammaBoundaryLog ((d : ℝ) / 2) R y) := by rcases d.even_or_odd with ⟨k, rfl⟩ | ⟨k, rfl⟩ · have hq : ((↑(k + k) : ℝ) / 2) = (k : ℝ) := by push_cast ring rw [hq] exact lowerGammaBoundaryLog_integer_exp_integrable ha k R · have hq : ((↑(2 * k + 1) : ℝ) / 2) = (k : ℝ) + 1 / 2 := by push_cast ring rw [hq] exact lowerGammaBoundaryLog_halfInteger_exp_integrable ha k R theorem lowerStripGammaOuter_integrable_dimension {d : ℕ} (hd : 0 < d) {R : ℝ} {z : ℂ} (hz : z ∈ Complex.im ⁻¹' Ioo (-((d : ℝ) / 2)) ((d : ℝ) / 2)) : Integrable (fun y : ℝ => stripRegularizedHolomorphicPoissonKernel ((d : ℝ) / 2) z y * (lowerGammaBoundaryLog ((d : ℝ) / 2) R y : ℂ)) := by have hℓ : 0 < (d : ℝ) / 2 := half_pos (Nat.cast_pos.mpr hd) apply lowerStripGammaOuter_integrable_of_exp_integrable hℓ hz exact lowerGammaBoundaryLog_dimension_exp_integrable hd (div_pos Real.pi_pos (mul_pos (by norm_num) hℓ)) R def lowerRiemannLog (T x : ℝ) : ℝ := Real.log (Real.sqrt (x ^ 2 + T ^ 2 / 4)) theorem lowerRiemannLog_monotoneOn {T : ℝ} (hT : T ≠ 0) : MonotoneOn (lowerRiemannLog T) (Ici (0 : ℝ)) := by intro x hx y hy hxy have hrad : 0 < x ^ 2 + T ^ 2 / 4 := by nlinarith [sq_nonneg x, sq_pos_of_ne_zero hT] have hsquares : x ^ 2 ≤ y ^ 2 := (sq_le_sq₀ hx hy).2 hxy unfold lowerRiemannLog exact Real.log_le_log (Real.sqrt_pos.2 hrad) (Real.sqrt_le_sqrt (by linarith)) theorem monotone_leftRiemann_error (f : ℝ → ℝ) {k : ℕ} (hk : 0 < k) (hf : MonotoneOn f (Icc (0 : ℝ) 1)) : 0 ≤ (k : ℝ) * (∫ x in (0 : ℝ)..1, f x) - ∑ j ∈ Finset.range k, f ((j : ℝ) / (k : ℝ)) ∧ (k : ℝ) * (∫ x in (0 : ℝ)..1, f x) - ∑ j ∈ Finset.range k, f ((j : ℝ) / (k : ℝ)) ≤ f 1 - f 0 := by have hkpos : 0 < (k : ℝ) := by exact_mod_cast hk have hkne : (k : ℝ) ≠ 0 := hkpos.ne' have hscaled : MonotoneOn (fun x : ℝ => f (x / (k : ℝ))) (Icc (0 : ℝ) (k : ℝ)) := by intro x hx y hy hxy apply hf · exact ⟨div_nonneg hx.1 hkpos.le, (div_le_one hkpos).2 hx.2⟩ · exact ⟨div_nonneg hy.1 hkpos.le, (div_le_one hkpos).2 hy.2⟩ · exact div_le_div_of_nonneg_right hxy hkpos.le have hscaled' : MonotoneOn (fun x : ℝ => f (x / (k : ℝ))) (Icc (0 : ℝ) (0 + (k : ℝ))) := by simpa using! hscaled have hleft : (∑ j ∈ Finset.range k, f ((j : ℝ) / (k : ℝ))) ≤ ∫ x in (0 : ℝ)..(k : ℝ), f (x / (k : ℝ)) := by simpa using! (MonotoneOn.sum_le_integral (x₀ := (0 : ℝ)) (a := k) hscaled') have hright : (∫ x in (0 : ℝ)..(k : ℝ), f (x / (k : ℝ))) ≤ ∑ j ∈ Finset.range k, f (((j : ℝ) + 1) / (k : ℝ)) := by simpa [Nat.cast_add, Nat.cast_one] using! (MonotoneOn.integral_le_sum (x₀ := (0 : ℝ)) (a := k) hscaled') have hintegral : (∫ x in (0 : ℝ)..(k : ℝ), f (x / (k : ℝ))) = (k : ℝ) * ∫ x in (0 : ℝ)..1, f x := by simp [hkne] have hshift : (∑ j ∈ Finset.range k, f (((j : ℝ) + 1) / (k : ℝ))) - (∑ j ∈ Finset.range k, f ((j : ℝ) / (k : ℝ))) = f 1 - f 0 := by rw [← Finset.sum_sub_distrib] convert! Finset.sum_range_sub (fun j : ℕ => f ((j : ℝ) / (k : ℝ))) k using 1 · apply Finset.sum_congr rfl intro j _ simp [Nat.cast_add, Nat.cast_one] · simp [hkne] constructor · rw [← hintegral] linarith · rw [← hintegral] linarith theorem lower_integer_leftRiemann_error {T : ℝ} (hT : T ≠ 0) {k : ℕ} (hk : 0 < k) : 0 ≤ (k : ℝ) * (∫ x in (0 : ℝ)..1, lowerRiemannLog T x) - ∑ j ∈ Finset.range k, lowerRiemannLog T ((j : ℝ) / (k : ℝ)) ∧ (k : ℝ) * (∫ x in (0 : ℝ)..1, lowerRiemannLog T x) - ∑ j ∈ Finset.range k, lowerRiemannLog T ((j : ℝ) / (k : ℝ)) ≤ lowerRiemannLog T 1 - lowerRiemannLog T 0 := by exact monotone_leftRiemann_error (lowerRiemannLog T) hk ((lowerRiemannLog_monotoneOn hT).mono (by intro x hx; exact hx.1)) theorem monotone_midpointIntegral_error (f : ℝ → ℝ) (k : ℕ) (hf : MonotoneOn f (Icc (0 : ℝ) (k : ℝ))) : |(∫ x in (0 : ℝ)..(k : ℝ), f x) - ∑ j ∈ Finset.range k, f ((j : ℝ) + 1 / 2)| ≤ f (k : ℝ) - f 0 := by have hf' : MonotoneOn f (Icc (0 : ℝ) (0 + (k : ℝ))) := by simpa using! hf have hleft : (∑ j ∈ Finset.range k, f (j : ℝ)) ≤ ∫ x in (0 : ℝ)..(k : ℝ), f x := by simpa using! (MonotoneOn.sum_le_integral (x₀ := (0 : ℝ)) (a := k) hf') have hright : (∫ x in (0 : ℝ)..(k : ℝ), f x) ≤ ∑ j ∈ Finset.range k, f ((j : ℝ) + 1) := by simpa [Nat.cast_add, Nat.cast_one] using! (MonotoneOn.integral_le_sum (x₀ := (0 : ℝ)) (a := k) hf') have hmidleft : (∑ j ∈ Finset.range k, f (j : ℝ)) ≤ ∑ j ∈ Finset.range k, f ((j : ℝ) + 1 / 2) := by apply Finset.sum_le_sum intro j hj have hjk : j < k := Finset.mem_range.mp hj have hjnonneg : 0 ≤ (j : ℝ) := Nat.cast_nonneg j have hjlast : (j : ℝ) + 1 ≤ (k : ℝ) := by exact_mod_cast (Nat.succ_le_of_lt hjk) exact hf ⟨hjnonneg, by linarith⟩ ⟨by linarith, by linarith⟩ (by linarith) have hmidright : (∑ j ∈ Finset.range k, f ((j : ℝ) + 1 / 2)) ≤ ∑ j ∈ Finset.range k, f ((j : ℝ) + 1) := by apply Finset.sum_le_sum intro j hj have hjk : j < k := Finset.mem_range.mp hj have hjnonneg : 0 ≤ (j : ℝ) := Nat.cast_nonneg j have hjlast : (j : ℝ) + 1 ≤ (k : ℝ) := by exact_mod_cast (Nat.succ_le_of_lt hjk) exact hf ⟨by linarith, by linarith⟩ ⟨by linarith, hjlast⟩ (by linarith) have hshift : (∑ j ∈ Finset.range k, f ((j : ℝ) + 1)) - (∑ j ∈ Finset.range k, f (j : ℝ)) = f (k : ℝ) - f 0 := by rw [← Finset.sum_sub_distrib] convert! Finset.sum_range_sub (fun j : ℕ => f (j : ℝ)) k using 1 · apply Finset.sum_congr rfl intro j _ simp [Nat.cast_add, Nat.cast_one] · simp apply (abs_le).2 constructor <;> linarith theorem lower_halfInteger_midpointRiemann_error {T : ℝ} (hT : T ≠ 0) {ℓ : ℝ} (hℓ : 0 < ℓ) (k : ℕ) : |ℓ * (∫ x in (0 : ℝ)..((k : ℝ) / ℓ), lowerRiemannLog T x) - ∑ j ∈ Finset.range k, lowerRiemannLog T (((j : ℝ) + 1 / 2) / ℓ)| ≤ lowerRiemannLog T ((k : ℝ) / ℓ) - lowerRiemannLog T 0 := by have hscaled : MonotoneOn (fun x : ℝ => lowerRiemannLog T (x / ℓ)) (Icc (0 : ℝ) (k : ℝ)) := by intro x hx y hy hxy apply lowerRiemannLog_monotoneOn hT · exact div_nonneg hx.1 hℓ.le · exact div_nonneg hy.1 hℓ.le · exact div_le_div_of_nonneg_right hxy hℓ.le have hmid := monotone_midpointIntegral_error (fun x : ℝ => lowerRiemannLog T (x / ℓ)) k hscaled have hscale : (∫ x in (0 : ℝ)..(k : ℝ), lowerRiemannLog T (x / ℓ)) = ℓ * ∫ x in (0 : ℝ)..((k : ℝ) / ℓ), lowerRiemannLog T x := by simpa using! (intervalIntegral.integral_comp_div (a := (0 : ℝ)) (b := (k : ℝ)) (lowerRiemannLog T) hℓ.ne') rw [hscale] at hmid simpa using! hmid def lowerEndpointPhase (T : ℝ) : ℝ := -Real.pi * |T| / 4 - (1 / 2 : ℝ) * Real.log (1 + T ^ 2 / 4) + |T| / 2 * Real.arctan (|T| / 2) def lowerRiemannLogPrimitive (T x : ℝ) : ℝ := x / 2 * Real.log (x ^ 2 + T ^ 2 / 4) - x + (|T| / 2) * Real.arctan (x / (|T| / 2)) theorem lowerRiemannLogPrimitive_hasDerivAt {T : ℝ} (hT : T ≠ 0) (x : ℝ) : HasDerivAt (lowerRiemannLogPrimitive T) (lowerRiemannLog T x) x := by have hrad : 0 < x ^ 2 + T ^ 2 / 4 := by nlinarith [sq_nonneg x, sq_pos_of_ne_zero hT] have ha : 0 < |T| / 2 := half_pos (abs_pos.mpr hT) have hquad : HasDerivAt (fun u : ℝ => u ^ 2 + T ^ 2 / 4) (2 * x) x := by convert! ((hasDerivAt_id x).pow 2).add_const (T ^ 2 / 4) using 1; simp [id_eq] have hlog := hquad.log hrad.ne' have hfirst := ((hasDerivAt_id x).div_const 2).mul hlog have hatan := (Real.hasDerivAt_arctan (x / (|T| / 2))).comp x ((hasDerivAt_id x).div_const (|T| / 2)) convert! (hfirst.sub (hasDerivAt_id x)).add (hatan.const_mul (|T| / 2)) using 1 unfold lowerRiemannLog simp only [id_eq] rw [Real.log_sqrt hrad.le] have habs : |T| ^ 2 = T ^ 2 := sq_abs T field_simp [hrad.ne', ha.ne'] nlinarith theorem integral_lowerRiemannLog {T : ℝ} (hT : T ≠ 0) : -(∫ x in (0 : ℝ)..1, lowerRiemannLog T x) = 1 + lowerEndpointPhase T := by have hmono : MonotoneOn (lowerRiemannLog T) (Icc (0 : ℝ) 1) := (lowerRiemannLog_monotoneOn hT).mono (by intro x hx; exact hx.1) have hmono' : MonotoneOn (lowerRiemannLog T) ([[0, 1]] : Set ℝ) := by simpa using! hmono have hint : IntervalIntegrable (lowerRiemannLog T) volume (0 : ℝ) 1 := hmono'.intervalIntegrable have hFTC : (∫ x in (0 : ℝ)..1, lowerRiemannLog T x) = lowerRiemannLogPrimitive T 1 - lowerRiemannLogPrimitive T 0 := by exact intervalIntegral.integral_eq_sub_of_hasDerivAt (fun x _ => lowerRiemannLogPrimitive_hasDerivAt hT x) hint have ha : 0 < |T| / 2 := half_pos (abs_pos.mpr hT) have hatan : Real.arctan (1 / (|T| / 2)) = Real.pi / 2 - Real.arctan (|T| / 2) := by simpa [one_div] using! Real.arctan_inv_of_pos ha rw [hFTC] unfold lowerRiemannLogPrimitive lowerEndpointPhase simp only [one_pow, zero_pow (by norm_num : 2 ≠ 0), zero_add, zero_div, zero_mul, sub_zero, Real.arctan_zero] rw [hatan] ring end noncomputable section open Filter MeasureTheory Set open scoped Topology theorem complexLaplaceKernel_integrable {z : ℂ} (hz : 0 < z.re) : IntegrableOn (fun x : ℝ => Complex.exp (-z * (x : ℂ))) (Ioi 0) := by have hneg : (-z).re < 0 := by simpa using! hz simpa only [neg_mul] using! (integrableOn_exp_mul_complex_Ioi (a := -z) hneg 0) theorem integral_complexLaplaceKernel {z : ℂ} (hz : 0 < z.re) : (∫ x : ℝ in Ioi 0, Complex.exp (-z * (x : ℂ))) = z⁻¹ := by have hneg : (-z).re < 0 := by simpa using! hz simpa [div_eq_mul_inv] using! (integral_exp_mul_complex_Ioi (a := -z) hneg 0) def complexFrullaniSegment (z w : ℂ) (s : ℝ) : ℂ := z + (s : ℂ) * (w - z) theorem complexFrullaniSegment_re_pos {z w : ℂ} (hz : 0 < z.re) (hw : 0 < w.re) {s : ℝ} (hs : s ∈ Icc (0 : ℝ) 1) : 0 < (complexFrullaniSegment z w s).re := by simp only [complexFrullaniSegment, Complex.add_re, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, Complex.sub_re, zero_mul, sub_zero] by_cases hzero : s = 0 · simpa [hzero] using! hz · have hspos : 0 < s := lt_of_le_of_ne hs.1 (Ne.symm hzero) have hfirst : 0 ≤ (1 - s) * z.re := mul_nonneg (sub_nonneg.mpr hs.2) hz.le have hsecond : 0 < s * w.re := mul_pos hspos hw nlinarith def complexFrullaniKernel (z w : ℂ) (x : ℝ) : ℂ := (Complex.exp (-z * (x : ℂ)) - Complex.exp (-w * (x : ℂ))) / (x : ℂ) theorem complexFrullaniSegment_hasDerivAt (z w : ℂ) (s : ℝ) : HasDerivAt (complexFrullaniSegment z w) (w - z) s := by have hcomplex : HasDerivAt (fun q : ℂ => z + q * (w - z)) (w - z) (s : ℂ) := by convert! (hasDerivAt_const (s : ℂ) z).add ((hasDerivAt_id (s : ℂ)).mul_const (w - z)) using 1 all_goals simp change HasDerivAt (fun r : ℝ => z + (r : ℂ) * (w - z)) (w - z) s exact hcomplex.comp_ofReal theorem intervalIntegral_complexLaplaceSegment (z w : ℂ) {x : ℝ} (hx : x ≠ 0) : (∫ s in (0 : ℝ)..1, (w - z) * Complex.exp (-complexFrullaniSegment z w s * (x : ℂ))) = complexFrullaniKernel z w x := by have hxc : (x : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hx have hderiv (s : ℝ) : HasDerivAt (fun r : ℝ => -Complex.exp (-complexFrullaniSegment z w r * (x : ℂ)) / (x : ℂ)) ((w - z) * Complex.exp (-complexFrullaniSegment z w s * (x : ℂ))) s := by have hinner := (complexFrullaniSegment_hasDerivAt z w s).neg.mul_const (x : ℂ) convert! hinner.cexp.neg.div_const (x : ℂ) using 1 · simp only [Pi.neg_apply] field_simp [hxc] have hcontinuous : Continuous (fun s : ℝ => (w - z) * Complex.exp (-complexFrullaniSegment z w s * (x : ℂ))) := by unfold complexFrullaniSegment fun_prop rw [intervalIntegral.integral_eq_sub_of_hasDerivAt (fun s _ => hderiv s) (hcontinuous.intervalIntegrable 0 1)] unfold complexFrullaniSegment complexFrullaniKernel push_cast simp only [zero_mul, one_mul, add_zero] ring_nf theorem norm_complexLaplaceKernel (z : ℂ) (x : ℝ) : ‖Complex.exp (-z * (x : ℂ))‖ = Real.exp (-z.re * x) := by rw [Complex.norm_exp] congr 1 simp [Complex.mul_re] theorem complexFrullaniSegment_min_re_le (z w : ℂ) {s : ℝ} (hs : s ∈ Icc (0 : ℝ) 1) : min z.re w.re ≤ (complexFrullaniSegment z w s).re := by simp only [complexFrullaniSegment, Complex.add_re, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, Complex.sub_re, zero_mul, sub_zero] have hzmin := min_le_left z.re w.re have hwmin := min_le_right z.re w.re have hfirst : 0 ≤ (1 - s) * (z.re - min z.re w.re) := mul_nonneg (sub_nonneg.mpr hs.2) (sub_nonneg.mpr hzmin) have hsecond : 0 ≤ s * (w.re - min z.re w.re) := mul_nonneg hs.1 (sub_nonneg.mpr hwmin) nlinarith theorem complexFrullaniKernel_norm_le_exp (z w : ℂ) {x : ℝ} (hx : 0 < x) : ‖complexFrullaniKernel z w x‖ ≤ ‖w - z‖ * Real.exp (-(min z.re w.re) * x) := by rw [← intervalIntegral_complexLaplaceSegment z w hx.ne'] have hbound : ‖∫ s in (0 : ℝ)..1, (w - z) * Complex.exp (-complexFrullaniSegment z w s * (x : ℂ))‖ ≤ (‖w - z‖ * Real.exp (-(min z.re w.re) * x)) * |(1 : ℝ) - 0| := by apply intervalIntegral.norm_integral_le_of_norm_le_const intro s hs rw [Set.uIoc_of_le (show (0 : ℝ) ≤ 1 by norm_num)] at hs have hclosed : s ∈ Icc (0 : ℝ) 1 := ⟨hs.1.le, hs.2⟩ rw [norm_mul, norm_complexLaplaceKernel] apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) apply Real.exp_le_exp.mpr have hminimum := complexFrullaniSegment_min_re_le z w hclosed nlinarith simpa using! hbound theorem integral_norm_complexFrullaniSegment {z w : ℂ} (hz : 0 < z.re) (hw : 0 < w.re) {s : ℝ} (hs : s ∈ Icc (0 : ℝ) 1) : (∫ x : ℝ in Ioi 0, ‖(w - z) * Complex.exp (-complexFrullaniSegment z w s * (x : ℂ))‖) = ‖w - z‖ * (complexFrullaniSegment z w s).re⁻¹ := by have hpositive := complexFrullaniSegment_re_pos hz hw hs calc (∫ x : ℝ in Ioi 0, ‖(w - z) * Complex.exp (-complexFrullaniSegment z w s * (x : ℂ))‖) = ∫ x : ℝ in Ioi 0, ‖w - z‖ * Real.exp (-(complexFrullaniSegment z w s).re * x) := by apply setIntegral_congr_fun measurableSet_Ioi intro x _ change ‖(w - z) * Complex.exp (-complexFrullaniSegment z w s * (x : ℂ))‖ = ‖w - z‖ * Real.exp (-(complexFrullaniSegment z w s).re * x) rw [norm_mul, norm_complexLaplaceKernel] _ = ‖w - z‖ * (∫ x : ℝ in Ioi 0, Real.exp (-(complexFrullaniSegment z w s).re * x)) := by rw [integral_const_mul] _ = ‖w - z‖ * (complexFrullaniSegment z w s).re⁻¹ := by rw [integral_laplaceKernel hpositive] theorem complexFrullaniParameter_integrable {z w : ℂ} (hz : 0 < z.re) (hw : 0 < w.re) : Integrable (Function.uncurry (fun s x : ℝ => (w - z) * Complex.exp (-complexFrullaniSegment z w s * (x : ℂ)))) ((volume.restrict (Set.uIoc (0 : ℝ) 1)).prod (volume.restrict (Ioi 0))) := by have hmeas : AEStronglyMeasurable (Function.uncurry (fun s x : ℝ => (w - z) * Complex.exp (-complexFrullaniSegment z w s * (x : ℂ)))) ((volume.restrict (Set.uIoc (0 : ℝ) 1)).prod (volume.restrict (Ioi 0))) := by unfold complexFrullaniSegment fun_prop apply (integrable_prod_iff hmeas).2 constructor · filter_upwards [ae_restrict_mem measurableSet_uIoc] with s hs rw [Set.uIoc_of_le (show (0 : ℝ) ≤ 1 by norm_num)] at hs have hclosed : s ∈ Icc (0 : ℝ) 1 := ⟨hs.1.le, hs.2⟩ exact (complexLaplaceKernel_integrable (complexFrullaniSegment_re_pos hz hw hclosed)).const_mul (w - z) · have hsegment : Continuous (fun s : ℝ => (complexFrullaniSegment z w s).re) := by unfold complexFrullaniSegment fun_prop have hnonzero : ∀ s ∈ Set.uIcc (0 : ℝ) 1, (complexFrullaniSegment z w s).re ≠ 0 := by intro s hs rw [Set.uIcc_of_le (show (0 : ℝ) ≤ 1 by norm_num)] at hs exact (complexFrullaniSegment_re_pos hz hw hs).ne' have hcontinuous : ContinuousOn (fun s : ℝ => ‖w - z‖ * (complexFrullaniSegment z w s).re⁻¹) (Set.uIcc (0 : ℝ) 1) := continuousOn_const.mul (hsegment.continuousOn.inv₀ hnonzero) have hintegrable : Integrable (fun s : ℝ => ‖w - z‖ * (complexFrullaniSegment z w s).re⁻¹) (volume.restrict (Set.uIoc (0 : ℝ) 1)) := intervalIntegrable_iff.mp (hcontinuous.intervalIntegrable) apply hintegrable.congr filter_upwards [ae_restrict_mem measurableSet_uIoc] with s hs rw [Set.uIoc_of_le (show (0 : ℝ) ≤ 1 by norm_num)] at hs have hclosed : s ∈ Icc (0 : ℝ) 1 := ⟨hs.1.le, hs.2⟩ exact (integral_norm_complexFrullaniSegment hz hw hclosed).symm theorem complexFrullaniKernel_integrable {z w : ℂ} (hz : 0 < z.re) (hw : 0 < w.re) : IntegrableOn (complexFrullaniKernel z w) (Ioi 0) := by have hproduct := (complexFrullaniParameter_integrable hz hw).integral_prod_right apply hproduct.congr filter_upwards [ae_restrict_mem measurableSet_Ioi] with x hx change (∫ s in Set.uIoc (0 : ℝ) 1, (w - z) * Complex.exp (-complexFrullaniSegment z w s * (x : ℂ))) = complexFrullaniKernel z w x rw [Set.uIoc_of_le (show (0 : ℝ) ≤ 1 by norm_num), ← intervalIntegral.integral_of_le (show (0 : ℝ) ≤ 1 by norm_num)] exact intervalIntegral_complexLaplaceSegment z w (ne_of_gt hx) theorem intervalIntegral_complexFrullaniLogDerivative {z w : ℂ} (hz : 0 < z.re) (hw : 0 < w.re) : (∫ s in (0 : ℝ)..1, (w - z) * (complexFrullaniSegment z w s)⁻¹) = Complex.log w - Complex.log z := by have hsegment : Continuous (fun s : ℝ => complexFrullaniSegment z w s) := by unfold complexFrullaniSegment fun_prop have hnonzero : ∀ s ∈ Set.uIcc (0 : ℝ) 1, complexFrullaniSegment z w s ≠ 0 := by intro s hs rw [Set.uIcc_of_le (show (0 : ℝ) ≤ 1 by norm_num)] at hs exact ne_of_apply_ne Complex.re (complexFrullaniSegment_re_pos hz hw hs).ne' have hcontinuous : ContinuousOn (fun s : ℝ => (w - z) * (complexFrullaniSegment z w s)⁻¹) (Set.uIcc (0 : ℝ) 1) := continuousOn_const.mul (hsegment.continuousOn.inv₀ hnonzero) have hderiv (s : ℝ) (hs : s ∈ Set.uIcc (0 : ℝ) 1) : HasDerivAt (fun r : ℝ => Complex.log (complexFrullaniSegment z w r)) ((w - z) * (complexFrullaniSegment z w s)⁻¹) s := by rw [Set.uIcc_of_le (show (0 : ℝ) ≤ 1 by norm_num)] at hs have hslit : complexFrullaniSegment z w s ∈ Complex.slitPlane := Complex.mem_slitPlane_iff.mpr (Or.inl (complexFrullaniSegment_re_pos hz hw hs)) simpa [div_eq_mul_inv] using! (complexFrullaniSegment_hasDerivAt z w s).clog_real hslit rw [intervalIntegral.integral_eq_sub_of_hasDerivAt hderiv hcontinuous.intervalIntegrable] simp [complexFrullaniSegment] theorem integral_complexFrullaniKernel {z w : ℂ} (hz : 0 < z.re) (hw : 0 < w.re) : (∫ x : ℝ in Ioi 0, complexFrullaniKernel z w x) = Complex.log w - Complex.log z := by calc (∫ x : ℝ in Ioi 0, complexFrullaniKernel z w x) = ∫ x : ℝ in Ioi 0, ∫ s in (0 : ℝ)..1, (w - z) * Complex.exp (-complexFrullaniSegment z w s * (x : ℂ)) := by apply setIntegral_congr_fun measurableSet_Ioi intro x hx exact (intervalIntegral_complexLaplaceSegment z w (ne_of_gt hx)).symm _ = ∫ s in (0 : ℝ)..1, ∫ x : ℝ in Ioi 0, (w - z) * Complex.exp (-complexFrullaniSegment z w s * (x : ℂ)) := (intervalIntegral_integral_swap (complexFrullaniParameter_integrable hz hw)).symm _ = ∫ s in (0 : ℝ)..1, (w - z) * (complexFrullaniSegment z w s)⁻¹ := by apply intervalIntegral.integral_congr intro s hs rw [Set.uIcc_of_le (show (0 : ℝ) ≤ 1 by norm_num)] at hs change (∫ x : ℝ in Ioi 0, (w - z) * Complex.exp (-complexFrullaniSegment z w s * (x : ℂ))) = (w - z) * (complexFrullaniSegment z w s)⁻¹ rw [integral_const_mul, integral_complexLaplaceKernel (complexFrullaniSegment_re_pos hz hw hs)] _ = Complex.log w - Complex.log z := intervalIntegral_complexFrullaniLogDerivative hz hw theorem complexFrullaniShiftKernel_norm_le_exp (z : ℂ) {s x : ℝ} (hs : s ∈ Icc (0 : ℝ) 1) (hx : 0 < x) : ‖complexFrullaniKernel (z + (s : ℂ)) 1 x‖ ≤ (‖(1 : ℂ) - z‖ + 1) * Real.exp (-(min z.re 1) * x) := by have hnorm : ‖(1 : ℂ) - (z + (s : ℂ))‖ ≤ ‖(1 : ℂ) - z‖ + 1 := by calc ‖(1 : ℂ) - (z + (s : ℂ))‖ = ‖((1 : ℂ) - z) - (s : ℂ)‖ := by congr 1 ring _ ≤ ‖(1 : ℂ) - z‖ + ‖(s : ℂ)‖ := norm_sub_le _ _ _ ≤ ‖(1 : ℂ) - z‖ + 1 := by rw [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hs.1] linarith [hs.2] have hmin : min z.re 1 ≤ min (z + (s : ℂ)).re (1 : ℂ).re := by apply le_min · simp only [Complex.add_re, Complex.ofReal_re] linarith [min_le_left z.re (1 : ℝ), hs.1] · exact min_le_right z.re (1 : ℝ) calc ‖complexFrullaniKernel (z + (s : ℂ)) 1 x‖ ≤ ‖(1 : ℂ) - (z + (s : ℂ))‖ * Real.exp (-(min (z + (s : ℂ)).re (1 : ℂ).re) * x) := complexFrullaniKernel_norm_le_exp (z + (s : ℂ)) 1 hx _ ≤ (‖(1 : ℂ) - z‖ + 1) * Real.exp (-(min (z + (s : ℂ)).re (1 : ℂ).re) * x) := mul_le_mul_of_nonneg_right hnorm (Real.exp_pos _).le _ ≤ (‖(1 : ℂ) - z‖ + 1) * Real.exp (-(min z.re 1) * x) := by apply mul_le_mul_of_nonneg_left _ (by positivity) apply Real.exp_le_exp.mpr nlinarith theorem complexFrullaniShiftParameter_integrable {z : ℂ} (hz : 0 < z.re) : Integrable (Function.uncurry (fun s x : ℝ => complexFrullaniKernel (z + (s : ℂ)) 1 x)) ((volume.restrict (Set.uIoc (0 : ℝ) 1)).prod (volume.restrict (Ioi 0))) := by have hm : 0 < min z.re 1 := lt_min hz (by norm_num) let C : ℝ := ‖(1 : ℂ) - z‖ + 1 have hC : 0 ≤ C := by try dsimp [C] positivity have hmeas : AEStronglyMeasurable (Function.uncurry (fun s x : ℝ => complexFrullaniKernel (z + (s : ℂ)) 1 x)) ((volume.restrict (Set.uIoc (0 : ℝ) 1)).prod (volume.restrict (Ioi 0))) := by change AEStronglyMeasurable (fun p : ℝ × ℝ => (Complex.exp (-(z + (p.1 : ℂ)) * (p.2 : ℂ)) - Complex.exp (-(1 : ℂ) * (p.2 : ℂ))) / (p.2 : ℂ)) ((volume.restrict (Set.uIoc (0 : ℝ) 1)).prod (volume.restrict (Ioi 0))) apply Measurable.aestronglyMeasurable fun_prop apply (integrable_prod_iff hmeas).2 constructor · filter_upwards [ae_restrict_mem measurableSet_uIoc] with s hs rw [Set.uIoc_of_le (show (0 : ℝ) ≤ 1 by norm_num)] at hs have hspositive : 0 < (z + (s : ℂ)).re := by simp only [Complex.add_re, Complex.ofReal_re] linarith [hs.1] change IntegrableOn (complexFrullaniKernel (z + (s : ℂ)) 1) (Ioi 0) exact complexFrullaniKernel_integrable hspositive (by norm_num : 0 < (1 : ℂ).re) · have hconstant : Integrable (fun _ : ℝ => C * (min z.re 1)⁻¹) (volume.restrict (Set.uIoc (0 : ℝ) 1)) := intervalIntegrable_iff.mp (continuous_const.intervalIntegrable (a := (0 : ℝ)) (b := 1)) apply hconstant.mono' · simpa only [Function.uncurry_apply_pair] using! hmeas.norm.integral_prod_right' filter_upwards [ae_restrict_mem measurableSet_uIoc] with s hs rw [Set.uIoc_of_le (show (0 : ℝ) ≤ 1 by norm_num)] at hs have hclosed : s ∈ Icc (0 : ℝ) 1 := ⟨hs.1.le, hs.2⟩ have hspositive : 0 < (z + (s : ℂ)).re := by simp only [Complex.add_re, Complex.ofReal_re] linarith [hs.1] have hkernel := complexFrullaniKernel_integrable hspositive (by norm_num : 0 < (1 : ℂ).re) have hmajor : IntegrableOn (fun x : ℝ => C * Real.exp (-(min z.re 1) * x)) (Ioi 0) := (laplaceKernel_integrable hm).const_mul C change ‖∫ x : ℝ in Ioi 0, ‖complexFrullaniKernel (z + (s : ℂ)) 1 x‖‖ ≤ C * (min z.re 1)⁻¹ rw [Real.norm_eq_abs, abs_of_nonneg (integral_nonneg fun x => norm_nonneg (complexFrullaniKernel (z + (s : ℂ)) 1 x))] calc (∫ x : ℝ in Ioi 0, ‖complexFrullaniKernel (z + (s : ℂ)) 1 x‖) ≤ ∫ x : ℝ in Ioi 0, C * Real.exp (-(min z.re 1) * x) := by apply integral_mono_ae hkernel.norm hmajor filter_upwards [ae_restrict_mem measurableSet_Ioi] with x hx change ‖complexFrullaniKernel (z + (s : ℂ)) 1 x‖ ≤ C * Real.exp (-(min z.re 1) * x) exact complexFrullaniShiftKernel_norm_le_exp z hclosed hx _ = C * (min z.re 1)⁻¹ := by rw [integral_const_mul, integral_laplaceKernel hm] def complexWallisPhaseKernel (z : ℂ) (x : ℝ) : ℂ := ((1 - Complex.exp (-(x : ℂ))) * Complex.exp (-z * (x : ℂ)) - (x : ℂ) * Complex.exp (-(x : ℂ))) / (x : ℂ) ^ 2 theorem intervalIntegral_complexFrullaniShift (z : ℂ) {x : ℝ} (hx : x ≠ 0) : (∫ s in (0 : ℝ)..1, complexFrullaniKernel (z + (s : ℂ)) 1 x) = complexWallisPhaseKernel z x := by have hxc : (x : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hx have hfirst : (∫ s in (0 : ℝ)..1, Complex.exp (-(z + (s : ℂ)) * (x : ℂ))) = complexFrullaniKernel z (z + 1) x := by convert! intervalIntegral_complexLaplaceSegment z (z + 1) hx using 1 apply intervalIntegral.integral_congr intro s _ unfold complexFrullaniSegment push_cast ring_nf have hfirstContinuous : Continuous (fun s : ℝ => Complex.exp (-(z + (s : ℂ)) * (x : ℂ))) := by fun_prop have hconstantContinuous : Continuous (fun _ : ℝ => Complex.exp (-(x : ℂ))) := continuous_const have hexponential : Complex.exp (-(z + 1) * (x : ℂ)) = Complex.exp (-z * (x : ℂ)) * Complex.exp (-(x : ℂ)) := by rw [show -(z + 1) * (x : ℂ) = -z * (x : ℂ) + -(x : ℂ) by ring, Complex.exp_add] unfold complexFrullaniKernel simp only [neg_one_mul] rw [intervalIntegral.integral_div, intervalIntegral.integral_sub (hfirstContinuous.intervalIntegrable 0 1) (hconstantContinuous.intervalIntegrable 0 1), hfirst, intervalIntegral.integral_const] unfold complexFrullaniKernel complexWallisPhaseKernel simp only [sub_zero, one_smul] rw [hexponential] field_simp [hxc] theorem complexWallisPhaseKernel_integrable {z : ℂ} (hz : 0 < z.re) : IntegrableOn (complexWallisPhaseKernel z) (Ioi 0) := by have hproduct := (complexFrullaniShiftParameter_integrable hz).integral_prod_right apply hproduct.congr filter_upwards [ae_restrict_mem measurableSet_Ioi] with x hx change (∫ s in Set.uIoc (0 : ℝ) 1, complexFrullaniKernel (z + (s : ℂ)) 1 x) = complexWallisPhaseKernel z x rw [Set.uIoc_of_le (show (0 : ℝ) ≤ 1 by norm_num), ← intervalIntegral.integral_of_le (show (0 : ℝ) ≤ 1 by norm_num)] exact intervalIntegral_complexFrullaniShift z hx.ne' theorem complexWallisTranslatedSegment_hasDerivAt (z : ℂ) (s : ℝ) : HasDerivAt (fun r : ℝ => z + (r : ℂ)) (1 : ℂ) s := by have hreal : HasDerivAt (fun r : ℝ => (r : ℂ)) (1 : ℂ) s := by simpa using! Complex.ofRealCLM.hasDerivAt simpa using! hreal.const_add z theorem complexWallisLogPrimitive_hasDerivAt {z : ℂ} (hz : 0 < z.re) (s : ℝ) (hs : s ∈ Icc (0 : ℝ) 1) : HasDerivAt (fun r : ℝ => (z + (r : ℂ)) * Complex.log (z + (r : ℂ)) - (z + (r : ℂ))) (Complex.log (z + (s : ℂ))) s := by have hline := complexWallisTranslatedSegment_hasDerivAt z s have hpositive : 0 < (z + (s : ℂ)).re := by simp only [Complex.add_re, Complex.ofReal_re] linarith [hs.1] have hslit : z + (s : ℂ) ∈ Complex.slitPlane := Complex.mem_slitPlane_iff.mpr (Or.inl hpositive) have hnonzero : z + (s : ℂ) ≠ 0 := Complex.slitPlane_ne_zero hslit have hlog := hline.clog_real hslit convert! (hline.mul hlog).sub hline using 1 simp [div_eq_mul_inv, hnonzero] theorem intervalIntegral_complexWallisLog {z : ℂ} (hz : 0 < z.re) : (∫ s in (0 : ℝ)..1, Complex.log (z + (s : ℂ))) = (z + 1) * Complex.log (z + 1) - z * Complex.log z - 1 := by have hline : Continuous (fun s : ℝ => z + (s : ℂ)) := by fun_prop have hlog : ContinuousOn (fun s : ℝ => Complex.log (z + (s : ℂ))) (Set.uIcc (0 : ℝ) 1) := by apply hline.continuousOn.clog intro s hs rw [Set.uIcc_of_le (show (0 : ℝ) ≤ 1 by norm_num)] at hs apply Complex.mem_slitPlane_iff.mpr left simp only [Complex.add_re, Complex.ofReal_re] linarith [hs.1] rw [intervalIntegral.integral_eq_sub_of_hasDerivAt (fun s hs => by rw [Set.uIcc_of_le (show (0 : ℝ) ≤ 1 by norm_num)] at hs exact complexWallisLogPrimitive_hasDerivAt hz s hs) hlog.intervalIntegrable] push_cast simp only [add_zero] ring theorem integral_complexWallisPhaseKernel {z : ℂ} (hz : 0 < z.re) : (∫ x : ℝ in Ioi 0, complexWallisPhaseKernel z x) = 1 + z * Complex.log z - (z + 1) * Complex.log (z + 1) := by calc (∫ x : ℝ in Ioi 0, complexWallisPhaseKernel z x) = ∫ x : ℝ in Ioi 0, ∫ s in (0 : ℝ)..1, complexFrullaniKernel (z + (s : ℂ)) 1 x := by apply setIntegral_congr_fun measurableSet_Ioi intro x hx exact (intervalIntegral_complexFrullaniShift z hx.ne').symm _ = ∫ s in (0 : ℝ)..1, ∫ x : ℝ in Ioi 0, complexFrullaniKernel (z + (s : ℂ)) 1 x := (intervalIntegral_integral_swap (complexFrullaniShiftParameter_integrable hz)).symm _ = ∫ s in (0 : ℝ)..1, -Complex.log (z + (s : ℂ)) := by apply intervalIntegral.integral_congr intro s hs rw [Set.uIcc_of_le (show (0 : ℝ) ≤ 1 by norm_num)] at hs have hspositive : 0 < (z + (s : ℂ)).re := by simp only [Complex.add_re, Complex.ofReal_re] linarith [hs.1] change (∫ x : ℝ in Ioi 0, complexFrullaniKernel (z + (s : ℂ)) 1 x) = -Complex.log (z + (s : ℂ)) rw [integral_complexFrullaniKernel hspositive (by norm_num : 0 < (1 : ℂ).re)] simp _ = -(∫ s in (0 : ℝ)..1, Complex.log (z + (s : ℂ))) := by rw [intervalIntegral.integral_neg] _ = 1 + z * Complex.log z - (z + 1) * Complex.log (z + 1) := by rw [intervalIntegral_complexWallisLog hz] ring end noncomputable section open Filter MeasureTheory Set open scoped Interval Topology def stripNormalizedPoissonKernel (σ T : ℝ) : ℝ := stripPoissonKernel σ T / stripBottomMass σ def stripNormalizedPoissonExtension (σ T : ℝ) : ℝ := (Real.pi / 4) * Real.sinc (Real.pi * (1 - σ) / 2) / (Real.cosh (Real.pi * T / 2) + Real.cos (Real.pi * (1 - σ) / 2)) def limitingStripPoissonDensity (T : ℝ) : ℝ := Real.pi / (4 * (Real.cosh (Real.pi * T / 2) + 1)) theorem stripAngle_eq_pi_sub (σ : ℝ) : stripAngle σ = Real.pi - Real.pi * (1 - σ) / 2 := by unfold stripAngle ring theorem stripNormalizedPoissonKernel_eq_extension {σ : ℝ} (_hbelow : -1 < σ) (habove : σ < 1) (T : ℝ) : stripNormalizedPoissonKernel σ T = stripNormalizedPoissonExtension σ T := by have hsmall : Real.pi * (1 - σ) / 2 ≠ 0 := by exact ne_of_gt (div_pos (mul_pos Real.pi_pos (sub_pos.mpr habove)) (by norm_num)) have hmass : 1 - σ ≠ 0 := (sub_pos.mpr habove).ne' have hden : Real.cosh (Real.pi * T / 2) + Real.cos (Real.pi * (1 - σ) / 2) ≠ 0 := by have hangle := stripAngle_mem_Ioo _hbelow habove have horiginal : 0 < Real.cosh (Real.pi * T / 2) - Real.cos (stripAngle σ) := by have hcos : Real.cos (stripAngle σ) < 1 := by have h := Real.cos_lt_cos_of_nonneg_of_le_pi (x := 0) (y := stripAngle σ) (by norm_num) hangle.2.le hangle.1 simpa using! h linarith [Real.one_le_cosh (Real.pi * T / 2)] rw [stripAngle_eq_pi_sub, Real.cos_pi_sub] at horiginal have hpositive : 0 < Real.cosh (Real.pi * T / 2) + Real.cos (Real.pi * (1 - σ) / 2) := by simpa only [sub_neg_eq_add] using! horiginal exact hpositive.ne' unfold stripNormalizedPoissonKernel stripPoissonKernel stripBottomMass stripNormalizedPoissonExtension rw [stripAngle_eq_pi_sub, Real.sin_pi_sub, Real.cos_pi_sub, Real.sinc_of_ne_zero hsmall] field_simp [hmass, hsmall, hden, Real.pi_ne_zero]; ring theorem stripNormalizedPoissonExtension_one (T : ℝ) : stripNormalizedPoissonExtension 1 T = limitingStripPoissonDensity T := by have hden : Real.cosh (Real.pi * T / 2) + 1 ≠ 0 := by linarith [Real.one_le_cosh (Real.pi * T / 2)] unfold stripNormalizedPoissonExtension limitingStripPoissonDensity simp only [sub_self, mul_zero, zero_div, Real.sinc_zero, Real.cos_zero, mul_one] field_simp [hden] theorem stripNormalizedPoissonExtension_continuousAt_one (T : ℝ) : ContinuousAt (fun σ : ℝ => stripNormalizedPoissonExtension σ T) 1 := by unfold stripNormalizedPoissonExtension have hangle : Continuous (fun σ : ℝ => Real.pi * (1 - σ) / 2) := by fun_prop have hden : Real.cosh (Real.pi * T / 2) + Real.cos (Real.pi * (1 - (1 : ℝ)) / 2) ≠ 0 := by simp only [sub_self, mul_zero, zero_div, Real.cos_zero] have hcosh := Real.one_le_cosh (Real.pi * T / 2) linarith exact ((continuous_const.mul (Real.continuous_sinc.comp hangle)).continuousAt.div ((continuous_const.add (Real.continuous_cos.comp hangle)).continuousAt) hden) theorem tendsto_stripNormalizedPoissonKernel (T : ℝ) : Tendsto (fun σ : ℝ => stripNormalizedPoissonKernel σ T) (𝓝[<] 1) (𝓝 (limitingStripPoissonDensity T)) := by have hpos : ∀ᶠ σ : ℝ in 𝓝[<] (1 : ℝ), 0 < σ := Filter.Eventually.filter_mono nhdsWithin_le_nhds (eventually_gt_nhds (show (0 : ℝ) < 1 by norm_num)) have hlt : ∀ᶠ σ : ℝ in 𝓝[<] (1 : ℝ), σ < 1 := self_mem_nhdsWithin have heq : (fun σ : ℝ => stripNormalizedPoissonKernel σ T) =ᶠ[𝓝[<] 1] (fun σ : ℝ => stripNormalizedPoissonExtension σ T) := by filter_upwards [hpos, hlt] with σ hσpos hσlt exact stripNormalizedPoissonKernel_eq_extension (by linarith) hσlt T have hext : Tendsto (fun σ : ℝ => stripNormalizedPoissonExtension σ T) (𝓝[<] 1) (𝓝 (limitingStripPoissonDensity T)) := by rw [← stripNormalizedPoissonExtension_one T] exact (stripNormalizedPoissonExtension_continuousAt_one T).tendsto.mono_left nhdsWithin_le_nhds exact hext.congr' heq.symm theorem stripNormalizedPoissonKernel_integrable {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) : Integrable (stripNormalizedPoissonKernel σ) := by unfold stripNormalizedPoissonKernel exact (stripPoissonKernel_integrable hbelow habove).div_const _ def stripPoissonExponentialMajorant (T : ℝ) : ℝ := (Real.pi / 2) * Real.exp (-(Real.pi / 2) * |T|) theorem inv_cosh_le_two_exp_neg_abs (u : ℝ) : (Real.cosh u)⁻¹ ≤ 2 * Real.exp (-|u|) := by have hhalf : Real.exp |u| / 2 ≤ Real.cosh u := by rw [← Real.cosh_abs, Real.cosh_eq] have hpositive := (Real.exp_pos (-|u|)).le linarith rw [← one_div, div_le_iff₀ (Real.cosh_pos u)] calc (1 : ℝ) = (2 * Real.exp (-|u|)) * (Real.exp |u| / 2) := by calc (1 : ℝ) = Real.exp (-|u|) * Real.exp |u| := by rw [← Real.exp_add] simp _ = (2 * Real.exp (-|u|)) * (Real.exp |u| / 2) := by ring _ ≤ (2 * Real.exp (-|u|)) * Real.cosh u := mul_le_mul_of_nonneg_left hhalf (by positivity) theorem stripNormalizedPoissonExtension_le_majorant {σ : ℝ} (hzero : 0 ≤ σ) (hone : σ ≤ 1) (T : ℝ) : 0 ≤ stripNormalizedPoissonExtension σ T ∧ stripNormalizedPoissonExtension σ T ≤ stripPoissonExponentialMajorant T := by let u : ℝ := Real.pi * T / 2 let q : ℝ := Real.pi * (1 - σ) / 2 have hqzero : 0 ≤ q := by try dsimp [q] exact div_nonneg (mul_nonneg Real.pi_pos.le (sub_nonneg.mpr hone)) (by norm_num) have hqlarge : q ≤ Real.pi / 2 := by try dsimp [q] nlinarith [mul_nonneg Real.pi_pos.le hzero] have hqpi : q ≤ Real.pi := by linarith [Real.pi_pos] have hcos : 0 ≤ Real.cos q := Real.cos_nonneg_of_mem_Icc ⟨by linarith [Real.pi_pos], hqlarge⟩ have hsinc : 0 ≤ Real.sinc q := by by_cases hq : q = 0 · simp [hq] · rw [Real.sinc_of_ne_zero hq] exact div_nonneg (Real.sin_nonneg_of_nonneg_of_le_pi hqzero hqpi) hqzero have hden : 0 < Real.cosh u + Real.cos q := add_pos_of_pos_of_nonneg (Real.cosh_pos u) hcos have hcoefficient : 0 < Real.pi / 4 := div_pos Real.pi_pos (by norm_num) have habsu : |u| = (Real.pi / 2) * |T| := by try dsimp [u] rw [abs_div, abs_mul, abs_of_pos Real.pi_pos] norm_num ring constructor · unfold stripNormalizedPoissonExtension change 0 ≤ (Real.pi / 4) * Real.sinc q / (Real.cosh u + Real.cos q) exact div_nonneg (mul_nonneg hcoefficient.le hsinc) hden.le · unfold stripNormalizedPoissonExtension stripPoissonExponentialMajorant change (Real.pi / 4) * Real.sinc q / (Real.cosh u + Real.cos q) ≤ (Real.pi / 2) * Real.exp (-(Real.pi / 2) * |T|) calc (Real.pi / 4) * Real.sinc q / (Real.cosh u + Real.cos q) ≤ (Real.pi / 4) * 1 / Real.cosh u := by gcongr · exact Real.sinc_le_one q · exact le_add_of_nonneg_right hcos _ = (Real.pi / 4) * (Real.cosh u)⁻¹ := by simp [div_eq_mul_inv] _ ≤ (Real.pi / 4) * (2 * Real.exp (-|u|)) := mul_le_mul_of_nonneg_left (inv_cosh_le_two_exp_neg_abs u) hcoefficient.le _ = (Real.pi / 2) * Real.exp (-(Real.pi / 2) * |T|) := by rw [habsu] ring_nf theorem integrable_exp_neg_mul_abs {a : ℝ} (ha : 0 < a) : Integrable (fun T : ℝ => Real.exp (-a * |T|)) := by have hright : IntegrableOn (fun T : ℝ => Real.exp (-a * |T|)) (Ioi (0 : ℝ)) := by have h := integrableOn_exp_mul_Ioi (neg_lt_zero.mpr ha) 0 apply h.congr_fun _ measurableSet_Ioi intro T hT change Real.exp (-a * T) = Real.exp (-a * |T|) rw [abs_of_pos hT] have hleft : IntegrableOn (fun T : ℝ => Real.exp (-a * |T|)) (Iio (0 : ℝ)) := by have h := (integrableOn_exp_mul_Iic ha 0).mono_set (show Iio (0 : ℝ) ⊆ Iic (0 : ℝ) from fun _ hT => (mem_Iio.mp hT).le) apply h.congr_fun _ measurableSet_Iio intro T hT change Real.exp (a * T) = Real.exp (-a * |T|) rw [abs_of_neg hT] congr 1 ring rw [← integrableOn_univ, ← @Iio_union_Ici _ _ (0 : ℝ), integrableOn_union, integrableOn_Ici_iff_integrableOn_Ioi] exact ⟨hleft, hright⟩ theorem stripPoissonExponentialMajorant_integrable : Integrable stripPoissonExponentialMajorant := by exact (integrable_exp_neg_mul_abs (half_pos Real.pi_pos)).const_mul (Real.pi / 2) theorem integrable_abs_pow_mul_exp_neg_mul_abs (n : ℕ) {a : ℝ} (ha : 0 < a) : Integrable (fun T : ℝ => |T| ^ n * Real.exp (-a * |T|)) := by have hbase : IntegrableOn (fun T : ℝ => T ^ n * Real.exp (-a * T)) (Ioi (0 : ℝ)) := by have h := integrableOn_rpow_mul_exp_neg_mul_rpow (p := (1 : ℝ)) (s := (n : ℝ)) (b := a) (by exact_mod_cast (show (-(1 : ℤ) < (n : ℤ)) by omega)) (by norm_num) ha simpa [Real.rpow_natCast, Real.rpow_one] using! h have hright : IntegrableOn (fun T : ℝ => |T| ^ n * Real.exp (-a * |T|)) (Ioi (0 : ℝ)) := by apply hbase.congr_fun _ measurableSet_Ioi intro T hT change T ^ n * Real.exp (-a * T) = |T| ^ n * Real.exp (-a * |T|) rw [abs_of_pos hT] have hreflected : IntegrableOn ((fun T : ℝ => |T| ^ n * Real.exp (-a * |T|)) ∘ (fun T : ℝ => -T)) ((fun T : ℝ => -T) ⁻¹' Iio (0 : ℝ)) := by simpa only [Function.comp_def, neg_preimage, neg_Iio, neg_zero, abs_neg] using! hright have hleft : IntegrableOn (fun T : ℝ => |T| ^ n * Real.exp (-a * |T|)) (Iio (0 : ℝ)) := ((Measure.measurePreserving_neg (volume : Measure ℝ)).integrableOn_comp_preimage (Homeomorph.neg ℝ).measurableEmbedding).mp hreflected rw [← integrableOn_univ, ← @Iio_union_Ici _ _ (0 : ℝ), integrableOn_union, integrableOn_Ici_iff_integrableOn_Ioi] exact ⟨hleft, hright⟩ theorem limitingStripPoissonDensity_integrable : Integrable limitingStripPoissonDensity := by have hcontinuous : Continuous limitingStripPoissonDensity := by unfold limitingStripPoissonDensity apply Continuous.div continuous_const · fun_prop · intro T have hcosh := Real.one_le_cosh (Real.pi * T / 2) positivity apply stripPoissonExponentialMajorant_integrable.mono' hcontinuous.aestronglyMeasurable filter_upwards [] with T have h := stripNormalizedPoissonExtension_le_majorant (σ := (1 : ℝ)) (by norm_num) (by norm_num) T rw [stripNormalizedPoissonExtension_one] at h rw [Real.norm_eq_abs, abs_of_nonneg h.1] exact h.2 def poissonLogistic (u : ℝ) : ℝ := Real.exp (Real.pi * u) / (1 + Real.exp (Real.pi * u)) def poissonLogisticDensity (u : ℝ) : ℝ := Real.pi * Real.exp (Real.pi * u) / (1 + Real.exp (Real.pi * u)) ^ 2 theorem poissonLogisticDensity_eq_limitingStripPoissonDensity (u : ℝ) : poissonLogisticDensity u = 2 * limitingStripPoissonDensity (2 * u) := by have he : Real.exp (Real.pi * u) ≠ 0 := (Real.exp_pos _).ne' unfold poissonLogisticDensity limitingStripPoissonDensity have harg : Real.pi * (2 * u) / 2 = Real.pi * u := by ring rw [harg, Real.cosh_eq, Real.exp_neg] field_simp [he]; ring theorem poissonLogistic_image_univ : poissonLogistic '' (Set.univ : Set ℝ) = Ioo (0 : ℝ) 1 := by ext x constructor · rintro ⟨u, _, rfl⟩ have he : 0 < Real.exp (Real.pi * u) := Real.exp_pos _ unfold poissonLogistic constructor · positivity · apply (div_lt_one (by positivity)).2 linarith · intro hx have hratio : 0 < x / (1 - x) := div_pos hx.1 (sub_pos.mpr hx.2) refine ⟨Real.log (x / (1 - x)) / Real.pi, Set.mem_univ _, ?_⟩ unfold poissonLogistic rw [mul_div_cancel₀ _ Real.pi_ne_zero, Real.exp_log hratio] field_simp [(sub_pos.mpr hx.2).ne'] ring theorem poissonLogistic_hasDerivAt (u : ℝ) : HasDerivAt poissonLogistic (poissonLogisticDensity u) u := by have he := (Real.hasDerivAt_exp (Real.pi * u)).comp u ((hasDerivAt_id u).const_mul Real.pi) have hden : 1 + Real.exp (Real.pi * u) ≠ 0 := by positivity have hquot := he.div ((hasDerivAt_const u 1).add he) hden convert! hquot using 1 unfold poissonLogisticDensity simp only [Function.comp_apply, Pi.add_apply, mul_one, zero_add] field_simp [hden] ring theorem poissonLogistic_injective : Function.Injective poissonLogistic := by intro u v huv have heu : 1 + Real.exp (Real.pi * u) ≠ 0 := by positivity have hev : 1 + Real.exp (Real.pi * v) ≠ 0 := by positivity unfold poissonLogistic at huv have hexp : Real.exp (Real.pi * u) = Real.exp (Real.pi * v) := by apply (div_eq_div_iff heu hev).mp at huv nlinarith have harg : Real.pi * u = Real.pi * v := Real.exp_injective hexp exact mul_left_cancel₀ Real.pi_ne_zero harg theorem poissonLogistic_mem_Ioo (u : ℝ) : poissonLogistic u ∈ Ioo (0 : ℝ) 1 := by rw [← poissonLogistic_image_univ] exact ⟨u, Set.mem_univ _, rfl⟩ theorem poissonLogistic_odds (u : ℝ) : poissonLogistic u / (1 - poissonLogistic u) = Real.exp (Real.pi * u) := by have hden : 1 + Real.exp (Real.pi * u) ≠ 0 := by positivity unfold poissonLogistic field_simp [hden] ring theorem poissonLogistic_cpow_ratio (u : ℝ) (w : ℂ) : ((poissonLogistic u : ℝ) : ℂ) ^ w * (((1 - poissonLogistic u : ℝ) : ℂ) ^ (-w)) = Complex.exp (((Real.pi * u : ℝ) : ℂ) * w) := by have hx := poissonLogistic_mem_Ioo u have hfirst : (poissonLogistic u : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (ne_of_gt hx.1) have hsecond : ((1 - poissonLogistic u : ℝ) : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (ne_of_gt (sub_pos.mpr hx.2)) have hlog : Real.log (poissonLogistic u) - Real.log (1 - poissonLogistic u) = Real.pi * u := by rw [← Real.log_div (ne_of_gt hx.1) (ne_of_gt (sub_pos.mpr hx.2)), poissonLogistic_odds, Real.log_exp] rw [Complex.cpow_def_of_ne_zero hfirst, Complex.cpow_def_of_ne_zero hsecond, ← Complex.exp_add, ← Complex.ofReal_log hx.1.le, ← Complex.ofReal_log (sub_pos.mpr hx.2).le] congr 1 calc ((Real.log (poissonLogistic u) : ℝ) : ℂ) * w + ((Real.log (1 - poissonLogistic u) : ℝ) : ℂ) * (-w) = ((Real.log (poissonLogistic u) - Real.log (1 - poissonLogistic u) : ℝ) : ℂ) * w := by push_cast ring _ = ((Real.pi * u : ℝ) : ℂ) * w := by rw [hlog] theorem integral_poissonLogistic_change_Ioo {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] (f : ℝ → E) : (∫ x : ℝ in Ioo 0 1, f x) = ∫ u : ℝ, poissonLogisticDensity u • f (poissonLogistic u) := by have hderiv : ∀ x ∈ (Set.univ : Set ℝ), HasDerivWithinAt poissonLogistic (poissonLogisticDensity x) Set.univ x := by intro x _ exact (poissonLogistic_hasDerivAt x).hasDerivWithinAt have hpositive (u : ℝ) : 0 < poissonLogisticDensity u := by unfold poissonLogisticDensity positivity have hrange : Set.range poissonLogistic = Ioo (0 : ℝ) 1 := by simpa only [Set.image_univ] using! poissonLogistic_image_univ have h := integral_image_eq_integral_abs_deriv_smul (f := poissonLogistic) (f' := poissonLogisticDensity) MeasurableSet.univ hderiv poissonLogistic_injective.injOn f simpa [hrange, abs_of_pos (hpositive _)] using! h theorem poissonLogisticDensity_integrable : Integrable poissonLogisticDensity := by have hscaled := limitingStripPoissonDensity_integrable.comp_mul_left' (by norm_num : (2 : ℝ) ≠ 0) apply (hscaled.const_mul (2 : ℝ)).congr filter_upwards [] with u exact (poissonLogisticDensity_eq_limitingStripPoissonDensity u).symm theorem integral_poissonLogisticDensity : (∫ u : ℝ, poissonLogisticDensity u) = 1 := by have h := integral_poissonLogistic_change_Ioo (fun _ : ℝ => (1 : ℝ)) simpa [smul_eq_mul] using! h.symm theorem poissonLogistic_betaIntegral (w : ℂ) : Complex.betaIntegral (1 + w) (1 - w) = ∫ u : ℝ, (poissonLogisticDensity u : ℂ) * Complex.exp (((Real.pi * u : ℝ) : ℂ) * w) := by calc Complex.betaIntegral (1 + w) (1 - w) = ∫ x : ℝ in Ioo 0 1, (x : ℂ) ^ w * (((1 - x : ℝ) : ℂ) ^ (-w)) := by unfold Complex.betaIntegral rw [intervalIntegral.integral_of_le (show (0 : ℝ) ≤ 1 by norm_num), integral_Ioc_eq_integral_Ioo] apply setIntegral_congr_fun measurableSet_Ioo intro x _ push_cast congr 1 <;> ring_nf _ = ∫ u : ℝ, poissonLogisticDensity u • (((poissonLogistic u : ℝ) : ℂ) ^ w * (((1 - poissonLogistic u : ℝ) : ℂ) ^ (-w))) := integral_poissonLogistic_change_Ioo (fun x : ℝ => (x : ℂ) ^ w * (((1 - x : ℝ) : ℂ) ^ (-w))) _ = ∫ u : ℝ, (poissonLogisticDensity u : ℂ) * Complex.exp (((Real.pi * u : ℝ) : ℂ) * w) := by apply integral_congr_ae filter_upwards [] with u change (poissonLogisticDensity u : ℂ) * (((poissonLogistic u : ℝ) : ℂ) ^ w * (((1 - poissonLogistic u : ℝ) : ℂ) ^ (-w))) = (poissonLogisticDensity u : ℂ) * Complex.exp (((Real.pi * u : ℝ) : ℂ) * w) rw [poissonLogistic_cpow_ratio] theorem gamma_one_add_imaginary_mul_gamma_one_sub {x : ℝ} (hx : x ≠ 0) : Complex.Gamma (1 + Complex.I * (x : ℂ)) * Complex.Gamma (1 - Complex.I * (x : ℂ)) = ((Real.pi * x / Real.sinh (Real.pi * x) : ℝ) : ℂ) := by let z : ℂ := Complex.I * (x : ℂ) have hz : z ≠ 0 := by try dsimp [z] exact mul_ne_zero Complex.I_ne_zero (Complex.ofReal_ne_zero.mpr hx) have hnegz : -z ≠ 0 := neg_ne_zero.mpr hz have hplus : Complex.Gamma (1 + z) = z * Complex.Gamma z := by convert! Complex.Gamma_add_one z hz using 1; ring_nf have hminus : Complex.Gamma (1 - z) = (-z) * Complex.Gamma (-z) := by convert! Complex.Gamma_add_one (-z) hnegz using 1; ring_nf have hconjarg : -z = starRingEnd ℂ z := by try dsimp [z] simp only [map_mul, Complex.conj_I, Complex.conj_ofReal] ring have hgammaprod : Complex.Gamma z * Complex.Gamma (-z) = (‖Complex.Gamma z‖ ^ 2 : ℝ) := by rw [hconjarg, Complex.Gamma_conj, mul_comm, ← Complex.normSq_eq_conj_mul_self, Complex.normSq_eq_norm_sq] have hsinh : Real.sinh (Real.pi * x) ≠ 0 := Real.sinh_ne_zero.mpr (mul_ne_zero Real.pi_ne_zero hx) change Complex.Gamma (1 + z) * Complex.Gamma (1 - z) = _ rw [hplus, hminus] calc (z * Complex.Gamma z) * ((-z) * Complex.Gamma (-z)) = ((x ^ 2 : ℝ) : ℂ) * (Complex.Gamma z * Complex.Gamma (-z)) := by try dsimp [z] ring_nf simp [Complex.I_sq] ring _ = ((x ^ 2 * ‖Complex.Gamma z‖ ^ 2 : ℝ) : ℂ) := by rw [hgammaprod] push_cast ring _ = ((Real.pi * x / Real.sinh (Real.pi * x) : ℝ) : ℂ) := by try dsimp [z] rw [norm_gamma_imaginary_sq hx] congr 1 field_simp [hx, hsinh] theorem poissonLogistic_characteristic_of_ne_zero {t : ℝ} (ht : t ≠ 0) : (∫ u : ℝ, (poissonLogisticDensity u : ℂ) * Complex.exp (Complex.I * (t : ℂ) * (u : ℂ))) = ((t / Real.sinh t : ℝ) : ℂ) := by let x : ℝ := t / Real.pi have hx : x ≠ 0 := by try dsimp [x] exact div_ne_zero ht Real.pi_ne_zero let w : ℂ := Complex.I * (x : ℂ) have hwplus : 0 < (1 + w).re := by try dsimp [w] norm_num have hwminus : 0 < (1 - w).re := by try dsimp [w] norm_num have hphase (u : ℝ) : ((Real.pi * u : ℝ) : ℂ) * w = Complex.I * (t : ℂ) * (u : ℂ) := by try dsimp [w, x] push_cast field_simp [Real.pi_ne_zero] have hbeta : Complex.betaIntegral (1 + w) (1 - w) = Complex.Gamma (1 + w) * Complex.Gamma (1 - w) := by rw [Complex.betaIntegral_eq_Gamma_mul_div (1 + w) (1 - w) hwplus hwminus] have hsum : (1 + w) + (1 - w) = (2 : ℂ) := by ring rw [hsum] norm_num have hscale : Real.pi * x = t := by try dsimp [x] field_simp [Real.pi_ne_zero] calc (∫ u : ℝ, (poissonLogisticDensity u : ℂ) * Complex.exp (Complex.I * (t : ℂ) * (u : ℂ))) = Complex.betaIntegral (1 + w) (1 - w) := by rw [poissonLogistic_betaIntegral w] apply integral_congr_ae filter_upwards [] with u rw [hphase] _ = Complex.Gamma (1 + w) * Complex.Gamma (1 - w) := hbeta _ = ((Real.pi * x / Real.sinh (Real.pi * x) : ℝ) : ℂ) := by exact gamma_one_add_imaginary_mul_gamma_one_sub hx _ = ((t / Real.sinh t : ℝ) : ℂ) := by rw [hscale] theorem poissonLogistic_characteristic (t : ℝ) : (∫ u : ℝ, (poissonLogisticDensity u : ℂ) * Complex.exp (Complex.I * (t : ℂ) * (u : ℂ))) = if t = 0 then 1 else ((t / Real.sinh t : ℝ) : ℂ) := by by_cases ht : t = 0 · subst t simp only [Complex.ofReal_zero, mul_zero, zero_mul, Complex.exp_zero, mul_one, ↓reduceIte] let m : ℝ := ∫ u : ℝ, poissonLogisticDensity u have hm : m = 1 := integral_poissonLogisticDensity calc (∫ u : ℝ, (poissonLogisticDensity u : ℂ)) = (m : ℂ) := by try dsimp [m] exact integral_ofReal _ = 1 := by rw [hm] norm_num · simpa [ht] using! poissonLogistic_characteristic_of_ne_zero ht theorem poissonLogistic_characteristic_integrable (t : ℝ) : Integrable (fun u : ℝ => (poissonLogisticDensity u : ℂ) * Complex.exp (Complex.I * (t : ℂ) * (u : ℂ))) := by have hcontinuous : Continuous (fun u : ℝ => Complex.exp (Complex.I * (t : ℂ) * (u : ℂ))) := by fun_prop apply poissonLogisticDensity_integrable.mono' (poissonLogisticDensity_integrable.ofReal.aestronglyMeasurable.mul hcontinuous.aestronglyMeasurable) filter_upwards [] with u have hdensity : 0 < poissonLogisticDensity u := by unfold poissonLogisticDensity positivity change ‖(poissonLogisticDensity u : ℂ) * Complex.exp (Complex.I * (t : ℂ) * (u : ℂ))‖ ≤ poissonLogisticDensity u rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hdensity] have hphase : Complex.I * (t : ℂ) * (u : ℂ) = Complex.I * ((t * u : ℝ) : ℂ) := by push_cast ring rw [hphase, Complex.norm_exp_I_mul_ofReal] simp theorem poissonLogistic_cosine_transform (t : ℝ) : (∫ u : ℝ, poissonLogisticDensity u * Real.cos (t * u)) = if t = 0 then 1 else t / Real.sinh t := by calc (∫ u : ℝ, poissonLogisticDensity u * Real.cos (t * u)) = ∫ u : ℝ, ((poissonLogisticDensity u : ℂ) * Complex.exp (Complex.I * (t : ℂ) * (u : ℂ))).re := by apply integral_congr_ae filter_upwards [] with u have hphase : Complex.I * (t : ℂ) * (u : ℂ) = ((t * u : ℝ) : ℂ) * Complex.I := by push_cast ring rw [hphase, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, Complex.exp_ofReal_mul_I_re] ring _ = (∫ u : ℝ, (poissonLogisticDensity u : ℂ) * Complex.exp (Complex.I * (t : ℂ) * (u : ℂ))).re := integral_re (poissonLogistic_characteristic_integrable t) _ = if t = 0 then 1 else t / Real.sinh t := by rw [poissonLogistic_characteristic t] split · simp · exact Complex.ofReal_re (t / Real.sinh t) theorem lowerEndpointPhase_continuous : Continuous lowerEndpointPhase := by have hargument : Continuous (fun T : ℝ => 1 + T ^ 2 / 4) := by fun_prop have hlog : Continuous (fun T : ℝ => Real.log (1 + T ^ 2 / 4)) := hargument.log (fun T => by have hsq : 0 ≤ T ^ 2 := sq_nonneg T positivity) have hfirst : Continuous (fun T : ℝ => -Real.pi * |T| / 4) := by fun_prop have hsecond : Continuous (fun T : ℝ => (1 / 2 : ℝ) * Real.log (1 + T ^ 2 / 4)) := continuous_const.mul hlog have hthird : Continuous (fun T : ℝ => |T| / 2 * Real.arctan (|T| / 2)) := (continuous_abs.div_const 2).mul (Real.continuous_arctan.comp (continuous_abs.div_const 2)) exact (hfirst.sub hsecond).add hthird theorem abs_lowerEndpointPhase_le (T : ℝ) : |lowerEndpointPhase T| ≤ Real.pi * |T| + T ^ 2 := by have hnonneg : 0 ≤ T ^ 2 / 4 := by positivity have hlogzero : 0 ≤ Real.log (1 + T ^ 2 / 4) := Real.log_nonneg (by linarith) have hlogupper : Real.log (1 + T ^ 2 / 4) ≤ T ^ 2 / 4 := by have h := Real.log_le_sub_one_of_pos (show 0 < 1 + T ^ 2 / 4 by positivity) linarith have hatanzero : 0 ≤ Real.arctan (|T| / 2) := Real.arctan_nonneg.mpr (by positivity) have hatanupper : Real.arctan (|T| / 2) ≤ Real.pi / 2 := (Real.arctan_lt_pi_div_two _).le have hmulzero : 0 ≤ |T| / 2 * Real.arctan (|T| / 2) := mul_nonneg (by positivity) hatanzero have hmulupper : |T| / 2 * Real.arctan (|T| / 2) ≤ |T| / 2 * (Real.pi / 2) := mul_le_mul_of_nonneg_left hatanupper (by positivity) have hpimagnitude : 0 ≤ Real.pi * |T| := mul_nonneg Real.pi_pos.le (abs_nonneg T) unfold lowerEndpointPhase apply (abs_le).2 constructor · nlinarith [sq_nonneg T] · nlinarith [sq_nonneg T] theorem stripPoissonExponentialMajorant_mul_lowerEndpointPhase_integrable : Integrable (fun T : ℝ => stripPoissonExponentialMajorant T * ‖lowerEndpointPhase T‖) := by have ha : 0 < Real.pi / 2 := half_pos Real.pi_pos have hfirst : Integrable (fun T : ℝ => ((Real.pi / 2) * Real.pi) * (|T| ^ (1 : ℕ) * Real.exp (-(Real.pi / 2) * |T|))) := (integrable_abs_pow_mul_exp_neg_mul_abs 1 ha).const_mul ((Real.pi / 2) * Real.pi) have hsecond : Integrable (fun T : ℝ => (Real.pi / 2) * (|T| ^ (2 : ℕ) * Real.exp (-(Real.pi / 2) * |T|))) := (integrable_abs_pow_mul_exp_neg_mul_abs 2 ha).const_mul (Real.pi / 2) apply (hfirst.add hsecond).mono' (by unfold stripPoissonExponentialMajorant exact ((continuous_const.mul (Real.continuous_exp.comp (continuous_const.mul continuous_abs))).mul lowerEndpointPhase_continuous.norm).aestronglyMeasurable) filter_upwards [] with T have hphase := abs_lowerEndpointPhase_le T have hfactor : 0 ≤ (Real.pi / 2) * Real.exp (-(Real.pi / 2) * |T|) := by positivity change |((Real.pi / 2) * Real.exp (-(Real.pi / 2) * |T|)) * ‖lowerEndpointPhase T‖| ≤ ((Real.pi / 2) * Real.pi) * (|T| ^ (1 : ℕ) * Real.exp (-(Real.pi / 2) * |T|)) + (Real.pi / 2) * (|T| ^ (2 : ℕ) * Real.exp (-(Real.pi / 2) * |T|)) rw [abs_of_nonneg (mul_nonneg hfactor (norm_nonneg _))] calc (Real.pi / 2) * Real.exp (-(Real.pi / 2) * |T|) * ‖lowerEndpointPhase T‖ ≤ ((Real.pi / 2) * Real.exp (-(Real.pi / 2) * |T|)) * (Real.pi * |T| + T ^ 2) := by rw [Real.norm_eq_abs] exact mul_le_mul_of_nonneg_left hphase hfactor _ = ((Real.pi / 2) * Real.pi) * (|T| ^ (1 : ℕ) * Real.exp (-(Real.pi / 2) * |T|)) + (Real.pi / 2) * (|T| ^ (2 : ℕ) * Real.exp (-(Real.pi / 2) * |T|)) := by rw [pow_one, sq_abs] ring theorem tendsto_integral_stripNormalizedPoissonKernel_mul (f : ℝ → ℝ) (hf : AEStronglyMeasurable f volume) (hmajor : Integrable (fun T : ℝ => stripPoissonExponentialMajorant T * ‖f T‖)) : Tendsto (fun σ : ℝ => ∫ T : ℝ, stripNormalizedPoissonKernel σ T * f T) (𝓝[<] 1) (𝓝 (∫ T : ℝ, limitingStripPoissonDensity T * f T)) := by have hpos : ∀ᶠ σ : ℝ in 𝓝[<] (1 : ℝ), 0 < σ := Filter.Eventually.filter_mono nhdsWithin_le_nhds (eventually_gt_nhds (show (0 : ℝ) < 1 by norm_num)) have hlt : ∀ᶠ σ : ℝ in 𝓝[<] (1 : ℝ), σ < 1 := self_mem_nhdsWithin apply tendsto_integral_filter_of_dominated_convergence (fun T : ℝ => stripPoissonExponentialMajorant T * ‖f T‖) · filter_upwards [hpos, hlt] with σ hσpos hσlt exact (stripNormalizedPoissonKernel_integrable (by linarith) hσlt).aestronglyMeasurable.mul hf · filter_upwards [hpos, hlt] with σ hσpos hσlt filter_upwards [] with T have hext := stripNormalizedPoissonKernel_eq_extension (by linarith : -1 < σ) hσlt T have hbound := stripNormalizedPoissonExtension_le_majorant hσpos.le hσlt.le T rw [norm_mul, Real.norm_eq_abs, hext, abs_of_nonneg hbound.1] exact mul_le_mul_of_nonneg_right hbound.2 (norm_nonneg _) · exact hmajor · filter_upwards [] with T exact (tendsto_stripNormalizedPoissonKernel T).mul tendsto_const_nhds def lowerPoissonEndpointExpectation (σ : ℝ) : ℝ := ∫ T : ℝ, stripNormalizedPoissonKernel σ T * lowerEndpointPhase T def limitingPoissonEndpointExpectation : ℝ := ∫ T : ℝ, limitingStripPoissonDensity T * lowerEndpointPhase T theorem tendsto_lowerPoissonEndpointExpectation : Tendsto lowerPoissonEndpointExpectation (𝓝[<] 1) (𝓝 limitingPoissonEndpointExpectation) := by exact tendsto_integral_stripNormalizedPoissonKernel_mul lowerEndpointPhase lowerEndpointPhase_continuous.aestronglyMeasurable stripPoissonExponentialMajorant_mul_lowerEndpointPhase_integrable theorem poissonLogistic_cosine_integrable (t : ℝ) : Integrable (fun u : ℝ => poissonLogisticDensity u * Real.cos (t * u)) := by have hcontinuous : Continuous (fun u : ℝ => Real.cos (t * u)) := by fun_prop apply poissonLogisticDensity_integrable.mono' (poissonLogisticDensity_integrable.aestronglyMeasurable.mul hcontinuous.aestronglyMeasurable) filter_upwards [] with u have hpositive : 0 < poissonLogisticDensity u := by unfold poissonLogisticDensity positivity change |poissonLogisticDensity u * Real.cos (t * u)| ≤ poissonLogisticDensity u rw [abs_mul, abs_of_pos hpositive] exact mul_le_of_le_one_right hpositive.le (Real.abs_cos_le_one _) theorem poissonLogisticDensity_le_pi_exp (u : ℝ) : poissonLogisticDensity u ≤ Real.pi * Real.exp (-Real.pi * |u|) := by have hbound := stripNormalizedPoissonExtension_le_majorant (σ := (1 : ℝ)) (by norm_num) (by norm_num) (2 * u) rw [stripNormalizedPoissonExtension_one] at hbound calc poissonLogisticDensity u = 2 * limitingStripPoissonDensity (2 * u) := poissonLogisticDensity_eq_limitingStripPoissonDensity u _ ≤ 2 * stripPoissonExponentialMajorant (2 * u) := mul_le_mul_of_nonneg_left hbound.2 (by norm_num) _ = Real.pi * Real.exp (-Real.pi * |u|) := by unfold stripPoissonExponentialMajorant rw [abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 2)] ring_nf theorem poissonLogisticDensity_abs_moment_integrable (n : ℕ) : Integrable (fun u : ℝ => poissonLogisticDensity u * |u| ^ n) := by have hmajor := (integrable_abs_pow_mul_exp_neg_mul_abs n Real.pi_pos).const_mul Real.pi apply hmajor.mono' (poissonLogisticDensity_integrable.aestronglyMeasurable.mul ((continuous_abs.pow n).aestronglyMeasurable)) filter_upwards [] with u have hdensity : 0 < poissonLogisticDensity u := by unfold poissonLogisticDensity positivity have hmoment : 0 ≤ |u| ^ n := pow_nonneg (abs_nonneg _) _ change |poissonLogisticDensity u * |u| ^ n| ≤ Real.pi * (|u| ^ n * Real.exp (-Real.pi * |u|)) rw [abs_of_nonneg (mul_nonneg hdensity.le hmoment)] calc poissonLogisticDensity u * |u| ^ n ≤ (Real.pi * Real.exp (-Real.pi * |u|)) * |u| ^ n := mul_le_mul_of_nonneg_right (poissonLogisticDensity_le_pi_exp u) hmoment _ = Real.pi * (|u| ^ n * Real.exp (-Real.pi * |u|)) := by ring def lowerWallisPhaseKernel (u t : ℝ) : ℝ := ((1 - Real.exp (-t)) * Real.cos (u * t) - t * Real.exp (-t)) / t ^ 2 theorem lowerWallisPhaseKernel_abs_le_moment (u : ℝ) {t : ℝ} (ht : 0 < t) : |lowerWallisPhaseKernel u t| ≤ |u| + 1 := by let q : ℝ := Real.exp (-t) have hqpos : 0 < q := by try dsimp [q] positivity have hqone : q ≤ 1 := by try dsimp [q] exact Real.exp_le_one_iff.mpr (by linarith) have hone : 0 ≤ 1 - q := by linarith have hone_le : 1 - q ≤ t := by try dsimp [q] linarith [Real.add_one_le_exp (-t)] have hcos : |Real.cos (u * t) - 1| ≤ |u| * t := by have h := Real.abs_cos_sub_cos_le (u * t) 0 simpa [abs_mul, abs_of_pos ht] using! h have hqproduct : (1 + t) * q ≤ 1 := by calc (1 + t) * q ≤ Real.exp t * q := by apply mul_le_mul_of_nonneg_right _ hqpos.le simpa [add_comm] using! Real.add_one_le_exp t _ = 1 := by try dsimp [q] rw [← Real.exp_add] simp have hcancel_nonneg : 0 ≤ 1 - q - t * q := by nlinarith have hcancel_upper : 1 - q - t * q ≤ t ^ 2 := by calc 1 - q - t * q ≤ t * (1 - q) := by nlinarith [hone_le] _ ≤ t * t := mul_le_mul_of_nonneg_left hone_le ht.le _ = t ^ 2 := by ring have hdecomp : (1 - q) * Real.cos (u * t) - t * q = (1 - q) * (Real.cos (u * t) - 1) + (1 - q - t * q) := by ring have hsq : 0 < t ^ 2 := sq_pos_of_pos ht unfold lowerWallisPhaseKernel change |((1 - q) * Real.cos (u * t) - t * q) / t ^ 2| ≤ |u| + 1 rw [hdecomp, abs_div, abs_of_pos hsq] apply (div_le_iff₀ hsq).2 calc |(1 - q) * (Real.cos (u * t) - 1) + (1 - q - t * q)| ≤ |(1 - q) * (Real.cos (u * t) - 1)| + |1 - q - t * q| := abs_add_le _ _ _ = (1 - q) * |Real.cos (u * t) - 1| + (1 - q - t * q) := by rw [abs_mul, abs_of_nonneg hone, abs_of_nonneg hcancel_nonneg] _ ≤ (1 - q) * (|u| * t) + t ^ 2 := add_le_add (mul_le_mul_of_nonneg_left hcos hone) hcancel_upper _ ≤ t * (|u| * t) + t ^ 2 := by nlinarith [mul_le_mul_of_nonneg_right hone_le (mul_nonneg (abs_nonneg u) ht.le)] _ = (|u| + 1) * t ^ 2 := by ring theorem lowerWallisPhaseKernel_abs_le_tail (u : ℝ) {t : ℝ} (ht : 1 ≤ t) : |lowerWallisPhaseKernel u t| ≤ 1 / t ^ 2 + Real.exp (-t) := by have htpos : 0 < t := lt_of_lt_of_le zero_lt_one ht let q : ℝ := Real.exp (-t) have hqpos : 0 < q := by try dsimp [q] positivity have hqone : q ≤ 1 := by try dsimp [q] exact Real.exp_le_one_iff.mpr (by linarith) have hone : 0 ≤ 1 - q := by linarith have hone_upper : 1 - q ≤ 1 := by linarith have ht_sq : t ≤ t ^ 2 := by nlinarith have hsq : 0 < t ^ 2 := sq_pos_of_pos htpos unfold lowerWallisPhaseKernel change |((1 - q) * Real.cos (u * t) - t * q) / t ^ 2| ≤ 1 / t ^ 2 + q rw [abs_div, abs_of_pos hsq] apply (div_le_iff₀ hsq).2 calc |(1 - q) * Real.cos (u * t) - t * q| ≤ |(1 - q) * Real.cos (u * t)| + |t * q| := abs_sub _ _ _ = (1 - q) * |Real.cos (u * t)| + t * q := by rw [abs_mul, abs_of_nonneg hone, abs_mul, abs_of_pos htpos, abs_of_pos hqpos] _ ≤ 1 + t * q := by have hcos : |Real.cos (u * t)| ≤ 1 := Real.abs_cos_le_one _ have hfactor : (1 - q) * |Real.cos (u * t)| ≤ 1 := by calc (1 - q) * |Real.cos (u * t)| ≤ (1 - q) * 1 := mul_le_mul_of_nonneg_left hcos hone _ ≤ 1 := by simpa using! hone_upper linarith _ ≤ 1 + q * t ^ 2 := by nlinarith [mul_nonneg hqpos.le (sub_nonneg.mpr ht_sq)] _ = (1 / t ^ 2 + q) * t ^ 2 := by field_simp [htpos.ne'] theorem lowerWallisPhaseTail_integrable : IntegrableOn (fun t : ℝ => 1 / t ^ 2 + Real.exp (-t)) (Ioi 1) := by have hpower : IntegrableOn (fun t : ℝ => t ^ (-(2 : ℝ))) (Ioi 1) := integrableOn_Ioi_rpow_of_lt (by norm_num : (-(2 : ℝ)) < -1) (by norm_num : (0 : ℝ) < 1) have hinverse : IntegrableOn (fun t : ℝ => 1 / t ^ 2) (Ioi 1) := by apply hpower.congr_fun _ measurableSet_Ioi intro t ht have htpos : 0 < t := lt_trans zero_lt_one (show 1 < t from ht) change t ^ (-(2 : ℝ)) = 1 / t ^ 2 rw [Real.rpow_neg htpos.le, Real.rpow_ofNat] simp [one_div] have hexponential : IntegrableOn (fun t : ℝ => Real.exp (-t)) (Ioi 1) := by have h := laplaceKernel_integrable (a := (1 : ℝ)) zero_lt_one have hrestrict := h.mono_set (show Ioi (1 : ℝ) ⊆ Ioi 0 from fun t ht => by change 0 < t exact lt_trans zero_lt_one (show 1 < t from ht)) simpa using! hrestrict exact hinverse.add hexponential theorem poissonLogistic_lowerWallisPhase_product_integrable : Integrable (fun p : ℝ × ℝ => poissonLogisticDensity p.1 * lowerWallisPhaseKernel p.1 p.2) (volume.prod (volume.restrict (Ioi 0))) := by let F : ℝ × ℝ → ℝ := fun p => poissonLogisticDensity p.1 * lowerWallisPhaseKernel p.1 p.2 have hmeas : Measurable F := by try dsimp [F] unfold poissonLogisticDensity lowerWallisPhaseKernel fun_prop have hfrequency : Integrable (fun u : ℝ => poissonLogisticDensity u * (|u| + 1)) := by have h := (poissonLogisticDensity_abs_moment_integrable 1).add poissonLogisticDensity_integrable simpa [Pi.add_apply, pow_one, mul_add] using! h have hnearConstant : Integrable (fun _ : ℝ => (1 : ℝ)) (volume.restrict (Ioc (0 : ℝ) 1)) := integrableOn_const measure_Ioc_lt_top.ne have hnearMajor := hfrequency.mul_prod hnearConstant have hnearMembership : ∀ᵐ p : ℝ × ℝ ∂volume.prod (volume.restrict (Ioc (0 : ℝ) 1)), p.2 ∈ Ioc (0 : ℝ) 1 := by apply (Measure.ae_prod_iff_ae_ae (measurableSet_Ioc.preimage measurable_snd)).2 exact Filter.Eventually.of_forall (fun _ => ae_restrict_mem measurableSet_Ioc) have hnear : Integrable F (volume.prod (volume.restrict (Ioc (0 : ℝ) 1))) := by apply hnearMajor.mono' hmeas.aestronglyMeasurable filter_upwards [hnearMembership] with p hp have hdensity : 0 < poissonLogisticDensity p.1 := by unfold poissonLogisticDensity positivity change |poissonLogisticDensity p.1 * lowerWallisPhaseKernel p.1 p.2| ≤ (poissonLogisticDensity p.1 * (|p.1| + 1)) * 1 rw [abs_mul, abs_of_pos hdensity, mul_one] exact mul_le_mul_of_nonneg_left (lowerWallisPhaseKernel_abs_le_moment p.1 hp.1) hdensity.le have hfarMajor := poissonLogisticDensity_integrable.mul_prod lowerWallisPhaseTail_integrable have hfarMembership : ∀ᵐ p : ℝ × ℝ ∂volume.prod (volume.restrict (Ioi (1 : ℝ))), p.2 ∈ Ioi (1 : ℝ) := by apply (Measure.ae_prod_iff_ae_ae (measurableSet_Ioi.preimage measurable_snd)).2 exact Filter.Eventually.of_forall (fun _ => ae_restrict_mem measurableSet_Ioi) have hfar : Integrable F (volume.prod (volume.restrict (Ioi (1 : ℝ)))) := by apply hfarMajor.mono' hmeas.aestronglyMeasurable filter_upwards [hfarMembership] with p hp have hdensity : 0 < poissonLogisticDensity p.1 := by unfold poissonLogisticDensity positivity change |poissonLogisticDensity p.1 * lowerWallisPhaseKernel p.1 p.2| ≤ poissonLogisticDensity p.1 * (1 / p.2 ^ 2 + Real.exp (-p.2)) rw [abs_mul, abs_of_pos hdensity] exact mul_le_mul_of_nonneg_left (lowerWallisPhaseKernel_abs_le_tail p.1 hp.le) hdensity.le have hnearOn : IntegrableOn F ((Set.univ : Set ℝ) ×ˢ Ioc (0 : ℝ) 1) (volume.prod volume) := by change Integrable F ((volume.prod volume).restrict ((Set.univ : Set ℝ) ×ˢ Ioc (0 : ℝ) 1)) rw [← Measure.prod_restrict] simpa only [Measure.restrict_univ] using! hnear have hfarOn : IntegrableOn F ((Set.univ : Set ℝ) ×ˢ Ioi (1 : ℝ)) (volume.prod volume) := by change Integrable F ((volume.prod volume).restrict ((Set.univ : Set ℝ) ×ˢ Ioi (1 : ℝ))) rw [← Measure.prod_restrict] simpa only [Measure.restrict_univ] using! hfar have hsets : (((Set.univ : Set ℝ) ×ˢ Ioc (0 : ℝ) 1) ∪ ((Set.univ : Set ℝ) ×ˢ Ioi (1 : ℝ))) = (Set.univ : Set ℝ) ×ˢ Ioi (0 : ℝ) := by rw [← Set.prod_union, Ioc_union_Ioi_eq_Ioi (show (0 : ℝ) ≤ 1 by norm_num)] have hfull : IntegrableOn F ((Set.univ : Set ℝ) ×ˢ Ioi (0 : ℝ)) (volume.prod volume) := by rw [← hsets] exact hnearOn.union hfarOn change Integrable F (volume.prod (volume.restrict (Ioi 0))) have hproduct := hfull change Integrable F ((volume.prod volume).restrict ((Set.univ : Set ℝ) ×ˢ Ioi (0 : ℝ))) at hproduct rw [← Measure.prod_restrict] at hproduct simpa only [Measure.restrict_univ] using! hproduct theorem integral_poissonLogistic_mul_lowerWallisPhaseKernel {t : ℝ} (ht : 0 < t) : (∫ u : ℝ, poissonLogisticDensity u * lowerWallisPhaseKernel u t) = wallisLaplaceKernel t := by have htne : t ≠ 0 := ht.ne' have hcos := poissonLogistic_cosine_integrable t have hfirst : Integrable (fun u : ℝ => (1 - Real.exp (-t)) * (poissonLogisticDensity u * Real.cos (t * u))) := hcos.const_mul (1 - Real.exp (-t)) have hsecond : Integrable (fun u : ℝ => (t * Real.exp (-t)) * poissonLogisticDensity u) := poissonLogisticDensity_integrable.const_mul (t * Real.exp (-t)) calc (∫ u : ℝ, poissonLogisticDensity u * lowerWallisPhaseKernel u t) = ∫ u : ℝ, ((1 - Real.exp (-t)) * (poissonLogisticDensity u * Real.cos (t * u)) - (t * Real.exp (-t)) * poissonLogisticDensity u) / t ^ 2 := by apply integral_congr_ae filter_upwards [] with u unfold lowerWallisPhaseKernel rw [mul_comm u t] ring _ = ((1 - Real.exp (-t)) * (∫ u : ℝ, poissonLogisticDensity u * Real.cos (t * u)) - (t * Real.exp (-t)) * (∫ u : ℝ, poissonLogisticDensity u)) / t ^ 2 := by rw [integral_div, integral_sub hfirst hsecond, integral_const_mul, integral_const_mul] _ = ((1 - Real.exp (-t)) * (t / Real.sinh t) - t * Real.exp (-t)) / t ^ 2 := by rw [poissonLogistic_cosine_transform t, if_neg htne, integral_poissonLogisticDensity] ring _ = wallisLaplaceKernel t := by have hsinh : Real.sinh t ≠ 0 := Real.sinh_ne_zero.mpr htne have hpositive : Real.exp (-t) ≠ 0 := (Real.exp_pos _).ne' have hdiff : Real.exp t - Real.exp (-t) ≠ 0 := by intro hzero apply hsinh rw [Real.sinh_eq, hzero] norm_num have hden : 1 + Real.exp (-t) ≠ 0 := by positivity rw [Real.sinh_eq] have hexp : Real.exp t * Real.exp (-t) = 1 := by rw [← Real.exp_add] simp unfold wallisLaplaceKernel field_simp [htne, hpositive, hdiff, hden]; nlinarith [hexp] def lowerWallisRegularizedPhaseKernel (a u t : ℝ) : ℝ := ((1 - Real.exp (-t)) * Real.exp (-a * t) * Real.cos (u * t) - t * Real.exp (-t)) / t ^ 2 theorem complexWallisPhaseKernel_re (a u t : ℝ) : (complexWallisPhaseKernel ((a : ℂ) - Complex.I * (u : ℂ)) t).re = lowerWallisRegularizedPhaseKernel a u t := by unfold complexWallisPhaseKernel lowerWallisRegularizedPhaseKernel rw [← Complex.ofReal_pow] rw [Complex.div_ofReal_re] simp [Complex.mul_re, Complex.exp_re, Complex.exp_im] ring theorem lowerWallisRegularizedPhaseKernel_eq_add (a u t : ℝ) : lowerWallisRegularizedPhaseKernel a u t = lowerWallisPhaseKernel u t + ((1 - Real.exp (-t)) * (Real.exp (-a * t) - 1) * Real.cos (u * t)) / t ^ 2 := by unfold lowerWallisRegularizedPhaseKernel lowerWallisPhaseKernel ring theorem lowerWallisRegularizedPhaseKernel_abs_le_moment {a : ℝ} (hazero : 0 ≤ a) (haone : a ≤ 1) (u : ℝ) {t : ℝ} (ht : 0 < t) : |lowerWallisRegularizedPhaseKernel a u t| ≤ |u| + 2 := by let q : ℝ := Real.exp (-t) let r : ℝ := Real.exp (-a * t) have hqpos : 0 < q := by try dsimp [q] positivity have hqone : q ≤ 1 := by try dsimp [q] exact Real.exp_le_one_iff.mpr (by linarith) have hrpos : 0 < r := by try dsimp [r] positivity have hrone : r ≤ 1 := by try dsimp [r] apply Real.exp_le_one_iff.mpr nlinarith [mul_nonneg hazero ht.le] have hqnonneg : 0 ≤ 1 - q := by linarith have hrnonneg : 0 ≤ 1 - r := by linarith have hqbound : 1 - q ≤ t := by try dsimp [q] linarith [Real.add_one_le_exp (-t)] have hrbound : 1 - r ≤ t := by have hfirst : 1 - r ≤ a * t := by try dsimp [r] linarith [Real.add_one_le_exp (-a * t)] have hsecond : a * t ≤ t := by nlinarith [mul_nonneg (sub_nonneg.mpr haone) ht.le] exact hfirst.trans hsecond have hsq : 0 < t ^ 2 := sq_pos_of_pos ht have hcorrection : |((1 - q) * (r - 1) * Real.cos (u * t)) / t ^ 2| ≤ 1 := by rw [abs_div, abs_of_pos hsq, abs_mul, abs_mul, abs_of_nonneg hqnonneg, abs_of_nonpos (show r - 1 ≤ 0 by linarith)] apply (div_le_iff₀ hsq).2 have hcos := Real.abs_cos_le_one (u * t) calc (1 - q) * (-(r - 1)) * |Real.cos (u * t)| ≤ (1 - q) * (1 - r) := by have hfactor : 0 ≤ (1 - q) * (1 - r) := mul_nonneg hqnonneg hrnonneg nlinarith [mul_le_mul_of_nonneg_left hcos hfactor] _ ≤ t * t := mul_le_mul hqbound hrbound hrnonneg ht.le _ = 1 * t ^ 2 := by ring rw [lowerWallisRegularizedPhaseKernel_eq_add] change |lowerWallisPhaseKernel u t + ((1 - q) * (r - 1) * Real.cos (u * t)) / t ^ 2| ≤ |u| + 2 calc |lowerWallisPhaseKernel u t + ((1 - q) * (r - 1) * Real.cos (u * t)) / t ^ 2| ≤ |lowerWallisPhaseKernel u t| + |((1 - q) * (r - 1) * Real.cos (u * t)) / t ^ 2| := abs_add_le _ _ _ ≤ (|u| + 1) + 1 := add_le_add (lowerWallisPhaseKernel_abs_le_moment u ht) hcorrection _ = |u| + 2 := by ring theorem lowerWallisRegularizedPhaseKernel_abs_le_tail {a : ℝ} (hazero : 0 ≤ a) (u : ℝ) {t : ℝ} (ht : 1 ≤ t) : |lowerWallisRegularizedPhaseKernel a u t| ≤ 1 / t ^ 2 + Real.exp (-t) := by have htpos : 0 < t := lt_of_lt_of_le zero_lt_one ht let q : ℝ := Real.exp (-t) let r : ℝ := Real.exp (-a * t) have hqpos : 0 < q := by try dsimp [q] positivity have hqone : q ≤ 1 := by try dsimp [q] exact Real.exp_le_one_iff.mpr (by linarith) have hrpos : 0 < r := by try dsimp [r] positivity have hrone : r ≤ 1 := by try dsimp [r] apply Real.exp_le_one_iff.mpr nlinarith [mul_nonneg hazero htpos.le] have hqnonneg : 0 ≤ 1 - q := by linarith have hsq : 0 < t ^ 2 := sq_pos_of_pos htpos have htsq : t ≤ t ^ 2 := by nlinarith unfold lowerWallisRegularizedPhaseKernel change |((1 - q) * r * Real.cos (u * t) - t * q) / t ^ 2| ≤ 1 / t ^ 2 + q rw [abs_div, abs_of_pos hsq] apply (div_le_iff₀ hsq).2 calc |(1 - q) * r * Real.cos (u * t) - t * q| ≤ |(1 - q) * r * Real.cos (u * t)| + |t * q| := abs_sub _ _ _ = (1 - q) * r * |Real.cos (u * t)| + t * q := by rw [abs_mul, abs_mul, abs_of_nonneg hqnonneg, abs_of_pos hrpos, abs_mul, abs_of_pos htpos, abs_of_pos hqpos] _ ≤ 1 + t * q := by have hcos := Real.abs_cos_le_one (u * t) have hfirst : (1 - q) * r ≤ 1 := by calc (1 - q) * r ≤ (1 - q) * 1 := mul_le_mul_of_nonneg_left hrone hqnonneg _ ≤ 1 := by linarith have hfactor : 0 ≤ (1 - q) * r := mul_nonneg hqnonneg hrpos.le nlinarith [mul_le_mul_of_nonneg_left hcos hfactor] _ ≤ 1 + q * t ^ 2 := by nlinarith [mul_nonneg hqpos.le (sub_nonneg.mpr htsq)] _ = (1 / t ^ 2 + q) * t ^ 2 := by field_simp [htpos.ne'] def lowerWallisRegularizedPhaseMajorant (u t : ℝ) : ℝ := if t ≤ 1 then |u| + 2 else 1 / t ^ 2 + Real.exp (-t) theorem lowerWallisRegularizedPhaseMajorant_integrable (u : ℝ) : IntegrableOn (lowerWallisRegularizedPhaseMajorant u) (Ioi 0) := by have hnear : IntegrableOn (lowerWallisRegularizedPhaseMajorant u) (Ioc (0 : ℝ) 1) := by have hconstant : IntegrableOn (fun _ : ℝ => |u| + 2) (Ioc (0 : ℝ) 1) := integrableOn_const measure_Ioc_lt_top.ne apply hconstant.congr_fun _ measurableSet_Ioc intro t ht simp [lowerWallisRegularizedPhaseMajorant, ht.2] have hfar : IntegrableOn (lowerWallisRegularizedPhaseMajorant u) (Ioi (1 : ℝ)) := by apply lowerWallisPhaseTail_integrable.congr_fun _ measurableSet_Ioi intro t ht simp [lowerWallisRegularizedPhaseMajorant, not_le.mpr (show 1 < t from ht)] rw [← Ioc_union_Ioi_eq_Ioi (show (0 : ℝ) ≤ 1 by norm_num)] exact hnear.union hfar theorem tendsto_integral_lowerWallisRegularizedPhaseKernel (u : ℝ) : Tendsto (fun n : ℕ => ∫ t : ℝ in Ioi 0, lowerWallisRegularizedPhaseKernel (1 / ((n : ℝ) + 1)) u t) atTop (𝓝 (∫ t : ℝ in Ioi 0, lowerWallisPhaseKernel u t)) := by apply tendsto_integral_of_dominated_convergence (lowerWallisRegularizedPhaseMajorant u) · intro n exact (show Measurable (fun t : ℝ => lowerWallisRegularizedPhaseKernel (1 / ((n : ℝ) + 1)) u t) by unfold lowerWallisRegularizedPhaseKernel fun_prop).aestronglyMeasurable · exact lowerWallisRegularizedPhaseMajorant_integrable u · intro n filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht have hapos : 0 < 1 / ((n : ℝ) + 1) := by positivity have haone : 1 / ((n : ℝ) + 1) ≤ 1 := by apply (div_le_iff₀ (show 0 < (n : ℝ) + 1 by positivity)).2 have hn : 0 ≤ (n : ℝ) := Nat.cast_nonneg n nlinarith rw [Real.norm_eq_abs] by_cases htone : t ≤ 1 · simp only [lowerWallisRegularizedPhaseMajorant, if_pos htone] exact lowerWallisRegularizedPhaseKernel_abs_le_moment hapos.le haone u ht · simp only [lowerWallisRegularizedPhaseMajorant, if_neg htone] exact lowerWallisRegularizedPhaseKernel_abs_le_tail hapos.le u (le_of_not_ge htone) · filter_upwards [] with t have hcontinuous : Continuous (fun a : ℝ => lowerWallisRegularizedPhaseKernel a u t) := by unfold lowerWallisRegularizedPhaseKernel fun_prop have hzero : lowerWallisRegularizedPhaseKernel 0 u t = lowerWallisPhaseKernel u t := by unfold lowerWallisRegularizedPhaseKernel lowerWallisPhaseKernel simp rw [← hzero] exact hcontinuous.continuousAt.tendsto.comp tendsto_one_div_add_atTop_nhds_zero_nat theorem integral_lowerWallisRegularizedPhaseKernel {a : ℝ} (ha : 0 < a) (u : ℝ) : (∫ t : ℝ in Ioi 0, lowerWallisRegularizedPhaseKernel a u t) = (1 + ((a : ℂ) - Complex.I * (u : ℂ)) * Complex.log ((a : ℂ) - Complex.I * (u : ℂ)) - (((a : ℂ) - Complex.I * (u : ℂ)) + 1) * Complex.log (((a : ℂ) - Complex.I * (u : ℂ)) + 1)).re := by let z : ℂ := (a : ℂ) - Complex.I * (u : ℂ) have hz : 0 < z.re := by try dsimp [z] simpa using! ha calc (∫ t : ℝ in Ioi 0, lowerWallisRegularizedPhaseKernel a u t) = ∫ t : ℝ in Ioi 0, (complexWallisPhaseKernel z t).re := by apply setIntegral_congr_fun measurableSet_Ioi intro t _ exact (complexWallisPhaseKernel_re a u t).symm _ = (∫ t : ℝ in Ioi 0, complexWallisPhaseKernel z t).re := by exact integral_re (complexWallisPhaseKernel_integrable hz) _ = (1 + z * Complex.log z - (z + 1) * Complex.log (z + 1)).re := by rw [integral_complexWallisPhaseKernel hz] theorem lowerWallis_arg_one_sub_I_mul (u : ℝ) : Complex.arg (1 - Complex.I * (u : ℂ)) = -Real.arctan u := by let z : ℂ := 1 - Complex.I * (u : ℂ) have hre : 0 < z.re := by try dsimp [z] simp have hrange : |Complex.arg z| < Real.pi / 2 := Complex.abs_arg_lt_pi_div_two_iff.mpr (Or.inl hre) have htan : Real.tan (Complex.arg z) = -u := by simp [z] calc Complex.arg (1 - Complex.I * (u : ℂ)) = Real.arctan (Real.tan (Complex.arg z)) := by change Complex.arg z = Real.arctan (Real.tan (Complex.arg z)) exact (Real.arctan_tan (abs_lt.mp hrange).1 (abs_lt.mp hrange).2).symm _ = Real.arctan (-u) := by rw [htan] _ = -Real.arctan u := Real.arctan_neg u theorem lowerWallis_imaginary_log_mul_re (u : ℝ) : ((-Complex.I * (u : ℂ)) * Complex.log (-Complex.I * (u : ℂ))).re = -Real.pi * |u| / 2 := by by_cases hzero : u = 0 · subst u simp rcases lt_or_gt_of_ne hzero with hnegative | hpositive · have harg : Complex.arg (-Complex.I * (u : ℂ)) = Real.pi / 2 := by apply Complex.arg_eq_pi_div_two_iff.mpr constructor · simp · simpa using! (neg_pos.mpr hnegative) rw [Complex.mul_re, Complex.log_im, harg, abs_of_neg hnegative] simp ring · have harg : Complex.arg (-Complex.I * (u : ℂ)) = -(Real.pi / 2) := by apply Complex.arg_eq_neg_pi_div_two_iff.mpr constructor · simp · simpa using! (neg_neg_of_pos hpositive) rw [Complex.mul_re, Complex.log_im, harg, abs_of_pos hpositive] simp ring theorem lowerWallis_norm_one_sub_I_mul (u : ℝ) : ‖1 - Complex.I * (u : ℂ)‖ = Real.sqrt (1 + u ^ 2) := by rw [Complex.norm_def, Complex.normSq_apply] congr 1 simp ring theorem lowerWallis_shifted_log_mul_re (u : ℝ) : ((1 - Complex.I * (u : ℂ)) * Complex.log (1 - Complex.I * (u : ℂ))).re = Real.log (1 + u ^ 2) / 2 - u * Real.arctan u := by rw [Complex.mul_re, Complex.log_re, Complex.log_im, lowerWallis_norm_one_sub_I_mul, lowerWallis_arg_one_sub_I_mul, Real.log_sqrt (show 0 ≤ 1 + u ^ 2 by positivity)] simp theorem lowerWallis_abs_mul_arctan_abs (u : ℝ) : |u| * Real.arctan |u| = u * Real.arctan u := by by_cases hu : 0 ≤ u · simp [abs_of_nonneg hu] · have hnegative : u < 0 := lt_of_not_ge hu rw [abs_of_neg hnegative, Real.arctan_neg] ring theorem lowerWallis_complexEndpointPhase_re (u : ℝ) : (1 + (-Complex.I * (u : ℂ)) * Complex.log (-Complex.I * (u : ℂ)) - ((-Complex.I * (u : ℂ)) + 1) * Complex.log ((-Complex.I * (u : ℂ)) + 1)).re = 1 + lowerEndpointPhase (2 * u) := by have hshift : (-Complex.I * (u : ℂ)) + 1 = 1 - Complex.I * (u : ℂ) := by ring rw [hshift, Complex.sub_re, Complex.add_re, lowerWallis_imaginary_log_mul_re, lowerWallis_shifted_log_mul_re] simp only [Complex.one_re] unfold lowerEndpointPhase have habs : |(2 : ℝ) * u| = 2 * |u| := by rw [abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 2)] rw [habs] have hquad : 1 + (2 * u) ^ 2 / 4 = 1 + u ^ 2 := by ring rw [hquad] have harg : 2 * |u| / 2 = |u| := by ring rw [harg, lowerWallis_abs_mul_arctan_abs] ring def lowerWallisComplexLogPhase (z : ℂ) : ℝ := (1 + z * Complex.log z - (z + 1) * Complex.log (z + 1)).re theorem lowerWallisComplexLogPhase_ofReal {a : ℝ} (ha : 0 ≤ a) : lowerWallisComplexLogPhase (a : ℂ) = 1 + a * Real.log a - (a + 1) * Real.log (a + 1) := by have hcast : (a : ℂ) + 1 = ((a + 1 : ℝ) : ℂ) := by push_cast rfl have hnorm : ‖(a : ℂ) + 1‖ = a + 1 := by rw [hcast, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (show 0 ≤ a + 1 by linarith)] unfold lowerWallisComplexLogPhase simp [Complex.mul_re, Complex.log_re, hnorm, abs_of_nonneg ha] theorem tendsto_lowerWallisComplexLogPhase_regularized (u : ℝ) : Tendsto (fun n : ℕ => lowerWallisComplexLogPhase (((1 / ((n : ℝ) + 1) : ℝ) : ℂ) - Complex.I * (u : ℂ))) atTop (𝓝 (1 + lowerEndpointPhase (2 * u))) := by have hparameter : Tendsto (fun n : ℕ => (1 / ((n : ℝ) + 1) : ℝ)) atTop (𝓝 0) := tendsto_one_div_add_atTop_nhds_zero_nat by_cases hzero : u = 0 · subst u have hreal : Continuous (fun a : ℝ => 1 + a * Real.log a - (a + 1) * Real.log (a + 1)) := by have hshift : Continuous (fun a : ℝ => a + 1) := by fun_prop exact (continuous_const.add Real.continuous_mul_log).sub (Real.continuous_mul_log.comp hshift) have hlimit := hreal.continuousAt.tendsto.comp hparameter have hcomputed : Tendsto (fun n : ℕ => lowerWallisComplexLogPhase (((1 / ((n : ℝ) + 1) : ℝ) : ℂ))) atTop (𝓝 (1 : ℝ)) := by have hrealLimit : Tendsto (fun n : ℕ => 1 + (1 / ((n : ℝ) + 1) : ℝ) * Real.log (1 / ((n : ℝ) + 1)) - ((1 / ((n : ℝ) + 1) : ℝ) + 1) * Real.log ((1 / ((n : ℝ) + 1) : ℝ) + 1)) atTop (𝓝 (1 : ℝ)) := by simpa only [Function.comp_apply, zero_mul, mul_zero, zero_add, add_zero, one_mul, Real.log_one, sub_zero] using! hlimit apply hrealLimit.congr' filter_upwards [] with n exact (lowerWallisComplexLogPhase_ofReal (show 0 ≤ (1 / ((n : ℝ) + 1) : ℝ) by positivity)).symm simpa [lowerEndpointPhase] using! hcomputed · let z : ℂ := -Complex.I * (u : ℂ) have hcast : Tendsto (fun n : ℕ => ((1 / ((n : ℝ) + 1) : ℝ) : ℂ)) atTop (𝓝 (0 : ℂ)) := Complex.continuous_ofReal.continuousAt.tendsto.comp hparameter have hz : Tendsto (fun n : ℕ => (((1 / ((n : ℝ) + 1) : ℝ) : ℂ) - Complex.I * (u : ℂ))) atTop (𝓝 z) := by try dsimp [z] simpa using! hcast.sub (tendsto_const_nhds (x := Complex.I * (u : ℂ))) have hslit : z ∈ Complex.slitPlane := by apply Complex.mem_slitPlane_iff.mpr right try dsimp [z] simpa using! hzero have hshift : z + 1 ∈ Complex.slitPlane := by apply Complex.mem_slitPlane_iff.mpr left try dsimp [z] simp let w : ℕ → ℂ := fun n => (((1 / ((n : ℝ) + 1) : ℝ) : ℂ) - Complex.I * (u : ℂ)) have hw : Tendsto w atTop (𝓝 z) := by exact hz have hzlog := hw.clog hslit have htranslate := hw.add_const (1 : ℂ) have htranslatedLog := htranslate.clog hshift have hcomplex : Tendsto (fun n : ℕ => (1 : ℂ) + w n * Complex.log (w n) - (w n + 1) * Complex.log (w n + 1)) atTop (𝓝 ((1 : ℂ) + z * Complex.log z - (z + 1) * Complex.log (z + 1))) := by exact ((tendsto_const_nhds.add (hw.mul hzlog)).sub (htranslate.mul htranslatedLog)) have hreal : Tendsto (fun n : ℕ => lowerWallisComplexLogPhase (w n)) atTop (𝓝 (lowerWallisComplexLogPhase z)) := by simpa only [lowerWallisComplexLogPhase, Function.comp_apply] using! (Complex.continuous_re.continuousAt.tendsto.comp hcomplex) have hendpoint : lowerWallisComplexLogPhase z = 1 + lowerEndpointPhase (2 * u) := by exact lowerWallis_complexEndpointPhase_re u rw [hendpoint] at hreal exact hreal theorem integral_lowerWallisPhaseKernel (u : ℝ) : (∫ t : ℝ in Ioi 0, lowerWallisPhaseKernel u t) = 1 + lowerEndpointPhase (2 * u) := by have hdominated := tendsto_integral_lowerWallisRegularizedPhaseKernel u have hcomputed : Tendsto (fun n : ℕ => ∫ t : ℝ in Ioi 0, lowerWallisRegularizedPhaseKernel (1 / ((n : ℝ) + 1)) u t) atTop (𝓝 (1 + lowerEndpointPhase (2 * u))) := by have hidentity (n : ℕ) : (∫ t : ℝ in Ioi 0, lowerWallisRegularizedPhaseKernel (1 / ((n : ℝ) + 1)) u t) = lowerWallisComplexLogPhase (((1 / ((n : ℝ) + 1) : ℝ) : ℂ) - Complex.I * (u : ℂ)) := by exact integral_lowerWallisRegularizedPhaseKernel (by positivity) u simp_rw [hidentity] exact tendsto_lowerWallisComplexLogPhase_regularized u exact tendsto_nhds_unique hdominated hcomputed theorem integral_poissonLogistic_one_add_lowerEndpointPhase : (∫ u : ℝ, poissonLogisticDensity u * (1 + lowerEndpointPhase (2 * u))) = Real.log (Real.pi / 2) := by calc (∫ u : ℝ, poissonLogisticDensity u * (1 + lowerEndpointPhase (2 * u))) = ∫ u : ℝ, ∫ t : ℝ in Ioi 0, poissonLogisticDensity u * lowerWallisPhaseKernel u t := by apply integral_congr_ae filter_upwards [] with u rw [integral_const_mul, integral_lowerWallisPhaseKernel] _ = ∫ t : ℝ in Ioi 0, ∫ u : ℝ, poissonLogisticDensity u * lowerWallisPhaseKernel u t := by exact integral_integral_swap poissonLogistic_lowerWallisPhase_product_integrable _ = ∫ t : ℝ in Ioi 0, wallisLaplaceKernel t := by apply setIntegral_congr_fun measurableSet_Ioi intro t ht exact integral_poissonLogistic_mul_lowerWallisPhaseKernel ht _ = Real.log (Real.pi / 2) := integral_wallisLaplaceKernel theorem poissonLogistic_lowerEndpointPhase_integrable : Integrable (fun u : ℝ => poissonLogisticDensity u * lowerEndpointPhase (2 * u)) := by have hproduct := poissonLogistic_lowerWallisPhase_product_integrable.integral_prod_left have hone : Integrable (fun u : ℝ => poissonLogisticDensity u * (1 + lowerEndpointPhase (2 * u))) := by apply hproduct.congr filter_upwards [] with u rw [integral_const_mul, integral_lowerWallisPhaseKernel] have hdifference := hone.sub poissonLogisticDensity_integrable apply hdifference.congr filter_upwards [] with u change poissonLogisticDensity u * (1 + lowerEndpointPhase (2 * u)) - poissonLogisticDensity u = poissonLogisticDensity u * lowerEndpointPhase (2 * u) ring theorem integral_poissonLogistic_lowerEndpointPhase : (∫ u : ℝ, poissonLogisticDensity u * lowerEndpointPhase (2 * u)) = Real.log (Real.pi / 2) - 1 := by have hsplit : (∫ u : ℝ, poissonLogisticDensity u * (1 + lowerEndpointPhase (2 * u))) = (∫ u : ℝ, poissonLogisticDensity u) + ∫ u : ℝ, poissonLogisticDensity u * lowerEndpointPhase (2 * u) := by calc (∫ u : ℝ, poissonLogisticDensity u * (1 + lowerEndpointPhase (2 * u))) = ∫ u : ℝ, poissonLogisticDensity u + poissonLogisticDensity u * lowerEndpointPhase (2 * u) := by apply integral_congr_ae filter_upwards [] with u ring _ = (∫ u : ℝ, poissonLogisticDensity u) + ∫ u : ℝ, poissonLogisticDensity u * lowerEndpointPhase (2 * u) := integral_add poissonLogisticDensity_integrable poissonLogistic_lowerEndpointPhase_integrable have hwallis := integral_poissonLogistic_one_add_lowerEndpointPhase rw [hsplit, integral_poissonLogisticDensity] at hwallis linarith theorem limitingPoissonEndpointExpectation_eq_log_pi_div_two_sub_one : limitingPoissonEndpointExpectation = Real.log (Real.pi / 2) - 1 := by have hscale : (∫ u : ℝ, limitingStripPoissonDensity (2 * u) * lowerEndpointPhase (2 * u)) = (1 / 2 : ℝ) * limitingPoissonEndpointExpectation := by unfold limitingPoissonEndpointExpectation have h := Measure.integral_comp_mul_left (fun T : ℝ => limitingStripPoissonDensity T * lowerEndpointPhase T) (2 : ℝ) simpa [smul_eq_mul, abs_of_pos (show (0 : ℝ) < (2 : ℝ)⁻¹ by positivity)] using! h have hlogistic : (∫ u : ℝ, poissonLogisticDensity u * lowerEndpointPhase (2 * u)) = 2 * (∫ u : ℝ, limitingStripPoissonDensity (2 * u) * lowerEndpointPhase (2 * u)) := by calc (∫ u : ℝ, poissonLogisticDensity u * lowerEndpointPhase (2 * u)) = ∫ u : ℝ, 2 * (limitingStripPoissonDensity (2 * u) * lowerEndpointPhase (2 * u)) := by apply integral_congr_ae filter_upwards [] with u rw [poissonLogisticDensity_eq_limitingStripPoissonDensity] ring _ = 2 * (∫ u : ℝ, limitingStripPoissonDensity (2 * u) * lowerEndpointPhase (2 * u)) := by rw [integral_const_mul] have hphase := integral_poissonLogistic_lowerEndpointPhase linarith theorem lowerPoissonEndpointSharpCoefficient_eq {c : ℝ} (hc : 0 < c) : Real.log (2 * Real.pi * Real.exp 1 * c ^ 2) + limitingPoissonEndpointExpectation = Real.log (Real.pi ^ 2 * c ^ 2) := by rw [limitingPoissonEndpointExpectation_eq_log_pi_div_two_sub_one] have hleft : 2 * Real.pi * Real.exp 1 * c ^ 2 ≠ 0 := by positivity have hright : Real.pi / 2 ≠ 0 := by positivity have hfactor : (2 * Real.pi * Real.exp 1 * c ^ 2) * (Real.pi / 2) = (Real.pi ^ 2 * c ^ 2) * Real.exp 1 := by ring calc Real.log (2 * Real.pi * Real.exp 1 * c ^ 2) + (Real.log (Real.pi / 2) - 1) = Real.log ((2 * Real.pi * Real.exp 1 * c ^ 2) * (Real.pi / 2)) - 1 := by rw [Real.log_mul hleft hright] ring _ = Real.log (Real.pi ^ 2 * c ^ 2) := by rw [hfactor, Real.log_mul (show Real.pi ^ 2 * c ^ 2 ≠ 0 by positivity) (show Real.exp (1 : ℝ) ≠ 0 by positivity), Real.log_exp] ring theorem lowerPoissonEndpointSharpCoefficient_neg {c : ℝ} (hc : 0 < c) (hsharp : c < Real.pi⁻¹) : Real.log (2 * Real.pi * Real.exp 1 * c ^ 2) + limitingPoissonEndpointExpectation < 0 := by rw [lowerPoissonEndpointSharpCoefficient_eq hc] have hproduct : Real.pi * c < 1 := by have hdiv : c < 1 / Real.pi := by simpa [one_div] using! hsharp have h := (lt_div_iff₀ Real.pi_pos).mp hdiv nlinarith have hpositive : 0 < Real.pi * c := mul_pos Real.pi_pos hc have hbelow : Real.pi ^ 2 * c ^ 2 < 1 := by have hfactor : 0 < (1 - Real.pi * c) * (1 + Real.pi * c) := mul_pos (sub_pos.mpr hproduct) (by linarith) nlinarith exact Real.log_neg (by positivity) hbelow theorem tendsto_lowerPoissonEndpointSharpCoefficient {c : ℝ} (hc : 0 < c) : Tendsto (fun σ : ℝ => Real.log (2 * Real.pi * Real.exp 1 * c ^ 2) + lowerPoissonEndpointExpectation σ) (𝓝[<] 1) (𝓝 (Real.log (Real.pi ^ 2 * c ^ 2))) := by rw [← lowerPoissonEndpointSharpCoefficient_eq hc] exact tendsto_const_nhds.add tendsto_lowerPoissonEndpointExpectation theorem eventually_lowerPoissonEndpointSharpCoefficient_neg {c : ℝ} (hc : 0 < c) (hsharp : c < Real.pi⁻¹) : ∀ᶠ σ : ℝ in 𝓝[<] 1, Real.log (2 * Real.pi * Real.exp 1 * c ^ 2) + lowerPoissonEndpointExpectation σ < 0 := by have hlimit := tendsto_lowerPoissonEndpointSharpCoefficient hc have hnegative : Real.log (Real.pi ^ 2 * c ^ 2) < 0 := by rw [← lowerPoissonEndpointSharpCoefficient_eq hc] exact lowerPoissonEndpointSharpCoefficient_neg hc hsharp exact hlimit (Iio_mem_nhds hnegative) end noncomputable section open Filter MeasureTheory Set open scoped Topology theorem saddle_one_add_abs_cube_le (T : ℝ) : (1 + |T|) ^ 3 ≤ 4 * (1 + |T| ^ 3) := by have hfactor : 0 ≤ (|T| - 1) ^ 2 * (|T| + 1) := mul_nonneg (sq_nonneg _) (by positivity) nlinarith theorem plusPolynomial_imaginary_norm_ge_beta {ε u : ℝ} (hε : 0 < ε) (hu : -1 ≤ u) : beta ε ≤ ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hb : 0 < beta ε := beta_pos hε have hterm : 0 ≤ (1 - u) ^ 2 * (1 + u) := mul_nonneg (sq_nonneg _) (by linarith) have hvalue : 0 < beta ε + (1 - u) ^ 2 * (1 + u) := add_pos_of_pos_of_nonneg hb hterm rw [plusPolynomial_imaginary, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hvalue] linarith theorem plusPolynomial_imaginary_cubic_growth_le {ε u : ℝ} (hε : 0 < ε) (hu : -1 ≤ u) : (1 + |u|) ^ 3 ≤ (27 / beta ε + 9) * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hb : 0 < beta ε := beta_pos hε have hnorm : beta ε ≤ ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := plusPolynomial_imaginary_norm_ge_beta hε hu by_cases hbounded : u ≤ 2 · have habs : |u| ≤ 2 := by exact (abs_le).mpr ⟨by linarith, hbounded⟩ have hcube : (1 + |u|) ^ 3 ≤ 27 := by have hbase : 1 + |u| ≤ (3 : ℝ) := by linarith have hpow := pow_le_pow_left₀ (show 0 ≤ 1 + |u| by positivity) hbase 3 norm_num at hpow ⊢ exact hpow calc (1 + |u|) ^ 3 ≤ 27 := hcube _ = (27 / beta ε) * beta ε := by field_simp [hb.ne'] _ ≤ (27 / beta ε) * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := mul_le_mul_of_nonneg_left hnorm (by positivity) _ ≤ (27 / beta ε + 9) * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hnonnegative := norm_nonneg (plusPolynomial ε (Complex.I * (u : ℂ))) nlinarith · have hlarge : 2 < u := lt_of_not_ge hbounded have habs : |u| = u := abs_of_pos (by linarith) have hvalue : ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ = beta ε + (1 - u) ^ 2 * (1 + u) := by rw [plusPolynomial_imaginary, Complex.norm_real, Real.norm_eq_abs] apply abs_of_pos exact add_pos_of_pos_of_nonneg hb (mul_nonneg (sq_nonneg _) (by linarith)) have hsq : (1 + u) ^ 2 ≤ 9 * (1 - u) ^ 2 := by have hfactor : 0 ≤ (2 * u - 1) * (u - 2) := mul_nonneg (by linarith) (by linarith) nlinarith have hcube : (1 + u) ^ 3 ≤ 9 * ((1 - u) ^ 2 * (1 + u)) := by have hproduct := mul_le_mul_of_nonneg_right hsq (show 0 ≤ 1 + u by linarith) nlinarith rw [habs] calc (1 + u) ^ 3 ≤ 9 * ((1 - u) ^ 2 * (1 + u)) := hcube _ ≤ 9 * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := by rw [hvalue] nlinarith _ ≤ (27 / beta ε + 9) * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hnonnegative := norm_nonneg (plusPolynomial ε (Complex.I * (u : ℂ))) have hcoefficient : 0 ≤ 27 / beta ε := by positivity nlinarith [mul_nonneg hcoefficient hnonnegative] theorem minusPolynomial_imaginary_norm_ge_three_beta {ε u : ℝ} (hε : 0 < ε) (hu : 1 + ε / 4 ≤ u) : 3 * beta ε ≤ ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hb : 0 < beta ε := beta_pos hε have hone : 1 ≤ u := by linarith have hbeta : beta ε ≤ u - 1 := by unfold beta linarith have hsquare : (4 : ℝ) ≤ (1 + u) ^ 2 := by nlinarith [sq_nonneg (u - 1)] have hproduct : 4 * beta ε ≤ (u - 1) * (1 + u) ^ 2 := by calc 4 * beta ε = beta ε * 4 := by ring _ ≤ (u - 1) * (1 + u) ^ 2 := mul_le_mul hbeta hsquare (by norm_num) (by linarith) have hnegative := minusPolynomial_imaginary_re_neg hε hu rw [minusPolynomial_imaginary, Complex.norm_real, Real.norm_eq_abs] have harg : beta ε + (1 - u) * (1 + u) ^ 2 < 0 := by rw [minusPolynomial_imaginary, Complex.ofReal_re] at hnegative exact hnegative rw [abs_of_neg harg] nlinarith theorem minusPolynomial_imaginary_cubic_growth_le {ε u : ℝ} (hε : 0 < ε) (hu : 1 + ε / 4 ≤ u) : (1 + |u|) ^ 3 ≤ (9 / beta ε + 6) * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hb : 0 < beta ε := beta_pos hε have hone : 1 ≤ u := by linarith have hbeta : beta ε ≤ u - 1 := by unfold beta linarith have habs : |u| = u := abs_of_pos (by linarith) have hnorm := minusPolynomial_imaginary_norm_ge_three_beta hε hu by_cases hbounded : u ≤ 2 · have hcube : (1 + |u|) ^ 3 ≤ 27 := by have hbase : 1 + |u| ≤ (3 : ℝ) := by rw [habs] linarith have hpow := pow_le_pow_left₀ (show 0 ≤ 1 + |u| by positivity) hbase 3 norm_num at hpow ⊢ exact hpow calc (1 + |u|) ^ 3 ≤ 27 := hcube _ = (9 / beta ε) * (3 * beta ε) := by field_simp [hb.ne']; norm_num _ ≤ (9 / beta ε) * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := mul_le_mul_of_nonneg_left hnorm (by positivity) _ ≤ (9 / beta ε + 6) * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hnonnegative := norm_nonneg (minusPolynomial ε (Complex.I * (u : ℂ))) nlinarith · have hlarge : 2 < u := lt_of_not_ge hbounded have hnegative := minusPolynomial_imaginary_re_neg hε hu have hvalue : ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ = (u - 1) * (1 + u) ^ 2 - beta ε := by rw [minusPolynomial_imaginary, Complex.norm_real, Real.norm_eq_abs] have harg : beta ε + (1 - u) * (1 + u) ^ 2 < 0 := by rw [minusPolynomial_imaginary, Complex.ofReal_re] at hnegative exact hnegative rw [abs_of_neg harg] ring have hsquare : (4 : ℝ) ≤ (1 + u) ^ 2 := by nlinarith [sq_nonneg (u - 1)] have hterm : 2 * beta ε ≤ (u - 1) * (1 + u) ^ 2 := by calc 2 * beta ε ≤ 4 * beta ε := by nlinarith _ = beta ε * 4 := by ring _ ≤ (u - 1) * (1 + u) ^ 2 := mul_le_mul hbeta hsquare (by norm_num) (by linarith) have hlinear : 1 + u ≤ 3 * (u - 1) := by linarith have hcubic : (1 + u) ^ 3 ≤ 3 * ((u - 1) * (1 + u) ^ 2) := by have hproduct := mul_le_mul_of_nonneg_right hlinear (sq_nonneg (1 + u)) nlinarith rw [habs] calc (1 + u) ^ 3 ≤ 3 * ((u - 1) * (1 + u) ^ 2) := hcubic _ ≤ 6 * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by rw [hvalue] nlinarith _ ≤ (9 / beta ε + 6) * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hnonnegative := norm_nonneg (minusPolynomial ε (Complex.I * (u : ℂ))) have hcoefficient : 0 ≤ 9 / beta ε := by positivity nlinarith [mul_nonneg hcoefficient hnonnegative] theorem saddle_complex_frequency_norm_le (T u : ℝ) : ‖(T : ℂ) + Complex.I * (u : ℂ)‖ ≤ |T| + |u| := by calc ‖(T : ℂ) + Complex.I * (u : ℂ)‖ ≤ ‖(T : ℂ)‖ + ‖Complex.I * (u : ℂ)‖ := norm_add_le _ _ _ = |T| + |u| := by simp [Complex.norm_real, Real.norm_eq_abs] theorem exists_plusPolynomial_uniform_norm_ratio {ε : ℝ} (hε : 0 < ε) : ∃ C : ℝ, 0 < C ∧ ∀ u : ℝ, -1 ≤ u → ∀ T : ℝ, ‖plusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ))‖ / ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ C * (1 + |T| ^ 3) := by have hb : 0 < beta ε := beta_pos hε refine ⟨4 * (1 + beta ε) * (27 / beta ε + 9), by positivity, ?_⟩ intro u hu T let z : ℂ := (T : ℂ) + Complex.I * (u : ℂ) let D : ℝ := ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ have hD : 0 < D := lt_of_lt_of_le hb (plusPolynomial_imaginary_norm_ge_beta hε hu) have htriangle : 1 + ‖z‖ ≤ (1 + |T|) * (1 + |u|) := by have hz := saddle_complex_frequency_norm_le T u change ‖z‖ ≤ |T| + |u| at hz nlinarith [mul_nonneg (abs_nonneg T) (abs_nonneg u)] have hpower : (1 + ‖z‖) ^ 3 ≤ ((1 + |T|) * (1 + |u|)) ^ 3 := pow_le_pow_left₀ (by positivity) htriangle 3 have hbase := norm_plusPolynomial_le ε z rw [abs_of_pos hb] at hbase have hfrequency := saddle_one_add_abs_cube_le T have hheight := plusPolynomial_imaginary_cubic_growth_le hε hu change ‖plusPolynomial ε z‖ / D ≤ (4 * (1 + beta ε) * (27 / beta ε + 9)) * (1 + |T| ^ 3) apply (div_le_iff₀ hD).2 calc ‖plusPolynomial ε z‖ ≤ (1 + beta ε) * (1 + ‖z‖) ^ 3 := hbase _ ≤ (1 + beta ε) * ((1 + |T|) * (1 + |u|)) ^ 3 := by gcongr _ = (1 + beta ε) * (1 + |T|) ^ 3 * (1 + |u|) ^ 3 := by ring _ ≤ (1 + beta ε) * (4 * (1 + |T| ^ 3)) * ((27 / beta ε + 9) * D) := by gcongr _ = ((4 * (1 + beta ε) * (27 / beta ε + 9)) * (1 + |T| ^ 3)) * D := by ring theorem exists_minusPolynomial_uniform_norm_ratio {ε : ℝ} (hε : 0 < ε) : ∃ C : ℝ, 0 < C ∧ ∀ u : ℝ, 1 + ε / 4 ≤ u → ∀ T : ℝ, ‖minusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ))‖ / ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ C * (1 + |T| ^ 3) := by have hb : 0 < beta ε := beta_pos hε refine ⟨4 * (1 + beta ε) * (9 / beta ε + 6), by positivity, ?_⟩ intro u hu T let z : ℂ := (T : ℂ) + Complex.I * (u : ℂ) let D : ℝ := ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ have hD : 0 < D := by have h := minusPolynomial_imaginary_norm_ge_three_beta hε hu change 3 * beta ε ≤ D at h nlinarith have htriangle : 1 + ‖z‖ ≤ (1 + |T|) * (1 + |u|) := by have hz := saddle_complex_frequency_norm_le T u change ‖z‖ ≤ |T| + |u| at hz nlinarith [mul_nonneg (abs_nonneg T) (abs_nonneg u)] have hpower : (1 + ‖z‖) ^ 3 ≤ ((1 + |T|) * (1 + |u|)) ^ 3 := pow_le_pow_left₀ (by positivity) htriangle 3 have hbase := norm_minusPolynomial_le ε z rw [abs_of_pos hb] at hbase have hfrequency := saddle_one_add_abs_cube_le T have hheight := minusPolynomial_imaginary_cubic_growth_le hε hu change ‖minusPolynomial ε z‖ / D ≤ (4 * (1 + beta ε) * (9 / beta ε + 6)) * (1 + |T| ^ 3) apply (div_le_iff₀ hD).2 calc ‖minusPolynomial ε z‖ ≤ (1 + beta ε) * (1 + ‖z‖) ^ 3 := hbase _ ≤ (1 + beta ε) * ((1 + |T|) * (1 + |u|)) ^ 3 := by gcongr _ = (1 + beta ε) * (1 + |T|) ^ 3 * (1 + |u|) ^ 3 := by ring _ ≤ (1 + beta ε) * (4 * (1 + |T| ^ 3)) * ((9 / beta ε + 6) * D) := by gcongr _ = ((4 * (1 + beta ε) * (9 / beta ε + 6)) * (1 + |T| ^ 3)) * D := by ring theorem plusPolynomial_add_sub (ε : ℝ) (z w : ℂ) : plusPolynomial ε (z + w) - plusPolynomial ε z = w * (2 * z + Complex.I * (1 + 3 * z ^ 2)) + w ^ 2 * (1 + 3 * Complex.I * z) + Complex.I * w ^ 3 := by unfold plusPolynomial ring theorem minusPolynomial_add_sub (ε : ℝ) (z w : ℂ) : minusPolynomial ε (z + w) - minusPolynomial ε z = w * (2 * z - Complex.I * (1 + 3 * z ^ 2)) + w ^ 2 * (1 - 3 * Complex.I * z) - Complex.I * w ^ 3 := by unfold minusPolynomial ring theorem plusSaddleLinearCoefficient_norm_le (z : ℂ) : ‖2 * z + Complex.I * (1 + 3 * z ^ 2)‖ ≤ 3 * (1 + ‖z‖) ^ 2 := by have hinner : ‖(1 : ℂ) + 3 * z ^ 2‖ ≤ 1 + 3 * ‖z‖ ^ 2 := by calc ‖(1 : ℂ) + 3 * z ^ 2‖ ≤ ‖(1 : ℂ)‖ + ‖(3 : ℂ) * z ^ 2‖ := norm_add_le _ _ _ = 1 + 3 * ‖z‖ ^ 2 := by simp [norm_pow] calc ‖2 * z + Complex.I * (1 + 3 * z ^ 2)‖ ≤ ‖(2 : ℂ) * z‖ + ‖Complex.I * (1 + 3 * z ^ 2)‖ := norm_add_le _ _ _ = 2 * ‖z‖ + ‖(1 : ℂ) + 3 * z ^ 2‖ := by simp _ ≤ 2 * ‖z‖ + (1 + 3 * ‖z‖ ^ 2) := by gcongr _ ≤ 3 * (1 + ‖z‖) ^ 2 := by nlinarith [norm_nonneg z] theorem minusSaddleLinearCoefficient_norm_le (z : ℂ) : ‖2 * z - Complex.I * (1 + 3 * z ^ 2)‖ ≤ 3 * (1 + ‖z‖) ^ 2 := by have hinner : ‖(1 : ℂ) + 3 * z ^ 2‖ ≤ 1 + 3 * ‖z‖ ^ 2 := by calc ‖(1 : ℂ) + 3 * z ^ 2‖ ≤ ‖(1 : ℂ)‖ + ‖(3 : ℂ) * z ^ 2‖ := norm_add_le _ _ _ = 1 + 3 * ‖z‖ ^ 2 := by simp [norm_pow] calc ‖2 * z - Complex.I * (1 + 3 * z ^ 2)‖ ≤ ‖(2 : ℂ) * z‖ + ‖Complex.I * (1 + 3 * z ^ 2)‖ := norm_sub_le _ _ _ = 2 * ‖z‖ + ‖(1 : ℂ) + 3 * z ^ 2‖ := by simp _ ≤ 2 * ‖z‖ + (1 + 3 * ‖z‖ ^ 2) := by gcongr _ ≤ 3 * (1 + ‖z‖) ^ 2 := by nlinarith [norm_nonneg z] theorem plusSaddleQuadraticCoefficient_norm_le (z : ℂ) : ‖1 + 3 * Complex.I * z‖ ≤ 3 * (1 + ‖z‖) ^ 2 := by calc ‖1 + 3 * Complex.I * z‖ ≤ ‖(1 : ℂ)‖ + ‖(3 : ℂ) * Complex.I * z‖ := norm_add_le _ _ _ = 1 + 3 * ‖z‖ := by simp _ ≤ 3 * (1 + ‖z‖) ^ 2 := by nlinarith [norm_nonneg z, sq_nonneg ‖z‖] theorem minusSaddleQuadraticCoefficient_norm_le (z : ℂ) : ‖1 - 3 * Complex.I * z‖ ≤ 3 * (1 + ‖z‖) ^ 2 := by calc ‖1 - 3 * Complex.I * z‖ ≤ ‖(1 : ℂ)‖ + ‖(3 : ℂ) * Complex.I * z‖ := norm_sub_le _ _ _ = 1 + 3 * ‖z‖ := by simp _ ≤ 3 * (1 + ‖z‖) ^ 2 := by nlinarith [norm_nonneg z, sq_nonneg ‖z‖] theorem saddle_abs_sq_le_add_cube (T : ℝ) : |T| ^ 2 ≤ |T| + |T| ^ 3 := by have hfactor : 0 ≤ |T| * (|T| - (1 / 2 : ℝ)) ^ 2 := mul_nonneg (abs_nonneg T) (sq_nonneg _) nlinarith [abs_nonneg T] theorem saddle_cubic_translation_norm_le (u T : ℝ) (A B C : ℂ) (hA : ‖A‖ ≤ 3 * (1 + |u|) ^ 2) (hB : ‖B‖ ≤ 3 * (1 + |u|) ^ 2) (hC : ‖C‖ ≤ 1) : ‖(T : ℂ) * A + (T : ℂ) ^ 2 * B + C * (T : ℂ) ^ 3‖ ≤ 9 * (1 + |u|) ^ 2 * (|T| + |T| ^ 3) := by let H : ℝ := (1 + |u|) ^ 2 let S : ℝ := |T| + |T| ^ 3 have hH : 1 ≤ H := by try dsimp [H] nlinarith [abs_nonneg u, sq_nonneg |u|] have hS : 0 ≤ S := by try dsimp [S] positivity have hT : |T| ≤ S := by try dsimp [S] nlinarith [pow_nonneg (abs_nonneg T) 3] have hT2 : |T| ^ 2 ≤ S := by exact saddle_abs_sq_le_add_cube T have hT3 : |T| ^ 3 ≤ S := by try dsimp [S] linarith [abs_nonneg T] have hfirst : ‖(T : ℂ) * A‖ ≤ |T| * (3 * H) := by rw [norm_mul, Complex.norm_real, Real.norm_eq_abs] exact mul_le_mul_of_nonneg_left hA (abs_nonneg T) have hsecond : ‖(T : ℂ) ^ 2 * B‖ ≤ |T| ^ 2 * (3 * H) := by rw [norm_mul, norm_pow, Complex.norm_real, Real.norm_eq_abs] exact mul_le_mul_of_nonneg_left hB (sq_nonneg |T|) have hthird : ‖C * (T : ℂ) ^ 3‖ ≤ |T| ^ 3 := by rw [norm_mul, norm_pow, Complex.norm_real, Real.norm_eq_abs] nlinarith [mul_le_mul_of_nonneg_right hC (pow_nonneg (abs_nonneg T) 3)] have hfirst' : |T| * (3 * H) ≤ 3 * H * S := by nlinarith [mul_le_mul_of_nonneg_left hT (show 0 ≤ 3 * H by positivity)] have hsecond' : |T| ^ 2 * (3 * H) ≤ 3 * H * S := by nlinarith [mul_le_mul_of_nonneg_left hT2 (show 0 ≤ 3 * H by positivity)] have hthird' : |T| ^ 3 ≤ H * S := by have hraise : S ≤ H * S := by nlinarith [mul_nonneg (sub_nonneg.mpr hH) hS] exact hT3.trans hraise calc ‖(T : ℂ) * A + (T : ℂ) ^ 2 * B + C * (T : ℂ) ^ 3‖ ≤ ‖(T : ℂ) * A + (T : ℂ) ^ 2 * B‖ + ‖C * (T : ℂ) ^ 3‖ := norm_add_le _ _ _ ≤ (‖(T : ℂ) * A‖ + ‖(T : ℂ) ^ 2 * B‖) + ‖C * (T : ℂ) ^ 3‖ := by gcongr exact norm_add_le _ _ _ ≤ (|T| * (3 * H) + |T| ^ 2 * (3 * H)) + |T| ^ 3 := by gcongr _ ≤ 9 * H * S := by nlinarith [mul_nonneg (show 0 ≤ H by positivity) hS] _ = 9 * (1 + |u|) ^ 2 * (|T| + |T| ^ 3) := by rfl theorem plusPolynomial_translation_norm_le (ε u T : ℝ) : ‖plusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) - plusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ 9 * (1 + |u|) ^ 2 * (|T| + |T| ^ 3) := by let z : ℂ := Complex.I * (u : ℂ) have hz : ‖z‖ = |u| := by try dsimp [z] simp [Complex.norm_real, Real.norm_eq_abs] have hA : ‖2 * z + Complex.I * (1 + 3 * z ^ 2)‖ ≤ 3 * (1 + |u|) ^ 2 := by simpa [hz] using! plusSaddleLinearCoefficient_norm_le z have hB : ‖1 + 3 * Complex.I * z‖ ≤ 3 * (1 + |u|) ^ 2 := by simpa [hz] using! plusSaddleQuadraticCoefficient_norm_le z have hidentity : plusPolynomial ε ((T : ℂ) + z) - plusPolynomial ε z = (T : ℂ) * (2 * z + Complex.I * (1 + 3 * z ^ 2)) + (T : ℂ) ^ 2 * (1 + 3 * Complex.I * z) + Complex.I * (T : ℂ) ^ 3 := by rw [add_comm (T : ℂ) z, plusPolynomial_add_sub] change ‖plusPolynomial ε ((T : ℂ) + z) - plusPolynomial ε z‖ ≤ _ rw [hidentity] exact saddle_cubic_translation_norm_le u T (2 * z + Complex.I * (1 + 3 * z ^ 2)) (1 + 3 * Complex.I * z) Complex.I hA hB (by simp) theorem minusPolynomial_translation_norm_le (ε u T : ℝ) : ‖minusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) - minusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ 9 * (1 + |u|) ^ 2 * (|T| + |T| ^ 3) := by let z : ℂ := Complex.I * (u : ℂ) have hz : ‖z‖ = |u| := by try dsimp [z] simp [Complex.norm_real, Real.norm_eq_abs] have hA : ‖2 * z - Complex.I * (1 + 3 * z ^ 2)‖ ≤ 3 * (1 + |u|) ^ 2 := by simpa [hz] using! minusSaddleLinearCoefficient_norm_le z have hB : ‖1 - 3 * Complex.I * z‖ ≤ 3 * (1 + |u|) ^ 2 := by simpa [hz] using! minusSaddleQuadraticCoefficient_norm_le z have hidentity : minusPolynomial ε ((T : ℂ) + z) - minusPolynomial ε z = (T : ℂ) * (2 * z - Complex.I * (1 + 3 * z ^ 2)) + (T : ℂ) ^ 2 * (1 - 3 * Complex.I * z) + (-Complex.I) * (T : ℂ) ^ 3 := by rw [add_comm (T : ℂ) z, minusPolynomial_add_sub] ring change ‖minusPolynomial ε ((T : ℂ) + z) - minusPolynomial ε z‖ ≤ _ rw [hidentity] exact saddle_cubic_translation_norm_le u T (2 * z - Complex.I * (1 + 3 * z ^ 2)) (1 - 3 * Complex.I * z) (-Complex.I) hA hB (by simp) theorem exists_plusPolynomial_uniform_difference_ratio {ε : ℝ} (hε : 0 < ε) : ∃ C : ℝ, 0 < C ∧ ∀ u : ℝ, -1 ≤ u → ∀ T : ℝ, ‖plusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) - plusPolynomial ε (Complex.I * (u : ℂ))‖ / ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ C * (|T| + |T| ^ 3) := by have hb : 0 < beta ε := beta_pos hε refine ⟨9 * (27 / beta ε + 9), by positivity, ?_⟩ intro u hu T let D : ℝ := ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ let S : ℝ := |T| + |T| ^ 3 have hD : 0 < D := lt_of_lt_of_le hb (plusPolynomial_imaginary_norm_ge_beta hε hu) have hS : 0 ≤ S := by try dsimp [S] positivity have hsquare : (1 + |u|) ^ 2 ≤ (1 + |u|) ^ 3 := by have hfactor : 0 ≤ |u| * (1 + |u|) ^ 2 := mul_nonneg (abs_nonneg u) (sq_nonneg _) nlinarith have hgrowth := plusPolynomial_imaginary_cubic_growth_le hε hu have hquadratic : (1 + |u|) ^ 2 ≤ (27 / beta ε + 9) * D := hsquare.trans hgrowth change ‖plusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) - plusPolynomial ε (Complex.I * (u : ℂ))‖ / D ≤ (9 * (27 / beta ε + 9)) * S apply (div_le_iff₀ hD).2 calc ‖plusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) - plusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ 9 * (1 + |u|) ^ 2 * S := plusPolynomial_translation_norm_le ε u T _ ≤ 9 * ((27 / beta ε + 9) * D) * S := by gcongr _ = ((9 * (27 / beta ε + 9)) * S) * D := by ring theorem exists_minusPolynomial_uniform_difference_ratio {ε : ℝ} (hε : 0 < ε) : ∃ C : ℝ, 0 < C ∧ ∀ u : ℝ, 1 + ε / 4 ≤ u → ∀ T : ℝ, ‖minusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) - minusPolynomial ε (Complex.I * (u : ℂ))‖ / ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ C * (|T| + |T| ^ 3) := by have hb : 0 < beta ε := beta_pos hε refine ⟨9 * (9 / beta ε + 6), by positivity, ?_⟩ intro u hu T let D : ℝ := ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ let S : ℝ := |T| + |T| ^ 3 have hD : 0 < D := by have h := minusPolynomial_imaginary_norm_ge_three_beta hε hu change 3 * beta ε ≤ D at h nlinarith have hS : 0 ≤ S := by try dsimp [S] positivity have hsquare : (1 + |u|) ^ 2 ≤ (1 + |u|) ^ 3 := by have hfactor : 0 ≤ |u| * (1 + |u|) ^ 2 := mul_nonneg (abs_nonneg u) (sq_nonneg _) nlinarith have hgrowth := minusPolynomial_imaginary_cubic_growth_le hε hu have hquadratic : (1 + |u|) ^ 2 ≤ (9 / beta ε + 6) * D := hsquare.trans hgrowth change ‖minusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) - minusPolynomial ε (Complex.I * (u : ℂ))‖ / D ≤ (9 * (9 / beta ε + 6)) * S apply (div_le_iff₀ hD).2 calc ‖minusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) - minusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ 9 * (1 + |u|) ^ 2 * S := minusPolynomial_translation_norm_le ε u T _ ≤ 9 * ((9 / beta ε + 6) * D) * S := by gcongr _ = ((9 * (9 / beta ε + 6)) * S) * D := by ring def upperNegativeHalfGammaArgument (N : ℕ) (s : ℝ) : ℂ := -((N : ℂ) + (1 / 2 : ℂ)) - Complex.I * ((s / 2 : ℝ) : ℂ) theorem upperNegativeHalfGammaArgument_ne_zero (N : ℕ) (s : ℝ) : upperNegativeHalfGammaArgument N s ≠ 0 := by intro hzero have hre := congrArg Complex.re hzero simp [upperNegativeHalfGammaArgument] at hre have hN : 0 ≤ (N : ℝ) := Nat.cast_nonneg N linarith theorem upperNegativeHalfGammaArgument_succ_add_one (N : ℕ) (s : ℝ) : upperNegativeHalfGammaArgument (N + 1) s + 1 = upperNegativeHalfGammaArgument N s := by unfold upperNegativeHalfGammaArgument simp only [Nat.cast_add, Nat.cast_one] ring theorem tendsto_upper_shortEndpoint_scaled : Tendsto (fun ε : ℝ => ε * shortEndpoint ε) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := by have hlog := tendsto_log_mul_rpow_nhdsGT_zero (by norm_num : (0 : ℝ) < 1) simp only [Real.rpow_one] at hlog have hscaled := hlog.const_mul (-10 : ℝ) convert! hscaled using 1 · ext ε unfold shortEndpoint rw [one_div, Real.log_inv] ring · norm_num theorem tendsto_upper_one_add_shortEndpoint_scaled : Tendsto (fun ε : ℝ => ε * (1 + shortEndpoint ε)) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := by have hid : Tendsto (fun ε : ℝ => ε) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := tendsto_id.mono_left nhdsWithin_le_nhds convert! hid.add tendsto_upper_shortEndpoint_scaled using 1 · ext ε ring · norm_num theorem eventually_upper_shortMargin_positive : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ a ∈ Set.Icc (shortCutoff ε) (shortEndpoint ε), (1 / 2 : ℝ) ≤ shortMargin ε a := by have hscaled : Tendsto (fun ε : ℝ => 10 * (ε * (1 + shortEndpoint ε))) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := by convert! tendsto_upper_one_add_shortEndpoint_scaled.const_mul (10 : ℝ) using 1; norm_num have hsmall := hscaled.eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1 / 2)) filter_upwards [self_mem_nhdsWithin, hsmall] with ε hε hbound a ha change 0 < ε at hε unfold shortMargin have hcompare : ε * (1 + a) ≤ ε * (1 + shortEndpoint ε) := mul_le_mul_of_nonneg_left (by linarith [ha.2]) hε.le change 10 * (ε * (1 + shortEndpoint ε)) < 1 / 2 at hbound nlinarith theorem eventually_upper_shellLocation_gt_shortEndpoint : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), shortEndpoint ε + 1 < shellLocation ε := by have hid : Tendsto (fun ε : ℝ => ε) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := tendsto_id.mono_left nhdsWithin_le_nhds have hpow : Tendsto (fun ε : ℝ => ε ^ 2 * (ε * (1 + shortEndpoint ε))) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := by simpa using! (hid.pow 2).mul tendsto_upper_one_add_shortEndpoint_scaled have hsmall : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ε ^ 3 * (shortEndpoint ε + 1) < 1 := by have hevent := hpow.eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1)) filter_upwards [hevent] with ε hε change ε ^ 2 * (ε * (1 + shortEndpoint ε)) < 1 at hε nlinarith filter_upwards [self_mem_nhdsWithin, hsmall] with ε hε hbound change 0 < ε at hε have hcube : 0 < ε ^ 3 := pow_pos hε 3 have hinv : ε ^ 3 * shellLocation ε = 1 := by unfold shellLocation field_simp [hε.ne'] have hmul : ε ^ 3 * (shortEndpoint ε + 1) < ε ^ 3 * shellLocation ε := by rw [hinv] exact hbound nlinarith [hmul] def upperShellShortCoefficient (ε : ℝ) : ℝ := shortEndpoint ε + (shortCutoff ε)⁻¹ def upperShellMarginRatio (ε : ℝ) : ℝ := 5000 * upperShellShortCoefficient ε * Real.exp ((ε / 2) * shortEndpoint ε) / (shellWeight ε * Real.exp ((ε / 2) * shellLocation ε)) theorem upperShellMarginRatio_inv {x : ℝ} (hx : x ≠ 0) : upperShellMarginRatio x⁻¹ = 5000 * (10 * Real.log x + x ^ 3) * Real.exp (-(x ^ 2) / 8) * Real.exp (5 * Real.log x / x) := by have hshort : shortEndpoint x⁻¹ = 10 * Real.log x := by simp [shortEndpoint] have hcutoff : (shortCutoff x⁻¹)⁻¹ = x ^ 3 := by simp [shortCutoff] have hlocation : shellLocation x⁻¹ = x ^ 3 := by simp [shellLocation] have hweight : shellWeight x⁻¹ = Real.exp (-(3 : ℝ) * x ^ 2 / 8) := by unfold shellWeight rw [hlocation] congr 1 field_simp [hx] have hexp : Real.exp ((x⁻¹ / 2) * (10 * Real.log x)) / (Real.exp (-(3 : ℝ) * x ^ 2 / 8) * Real.exp ((x⁻¹ / 2) * x ^ 3)) = Real.exp (-(x ^ 2) / 8) * Real.exp (5 * Real.log x / x) := by rw [← Real.exp_add, ← Real.exp_sub, ← Real.exp_add] congr 1 field_simp [hx]; ring unfold upperShellMarginRatio upperShellShortCoefficient rw [hshort, hcutoff, hlocation, hweight] calc 5000 * (10 * Real.log x + x ^ 3) * Real.exp (x⁻¹ / 2 * (10 * Real.log x)) / (Real.exp (-(3 : ℝ) * x ^ 2 / 8) * Real.exp (x⁻¹ / 2 * x ^ 3)) = 5000 * (10 * Real.log x + x ^ 3) * (Real.exp (x⁻¹ / 2 * (10 * Real.log x)) / (Real.exp (-(3 : ℝ) * x ^ 2 / 8) * Real.exp (x⁻¹ / 2 * x ^ 3))) := by ring _ = 5000 * (10 * Real.log x + x ^ 3) * (Real.exp (-(x ^ 2) / 8) * Real.exp (5 * Real.log x / x)) := by rw [hexp] _ = 5000 * (10 * Real.log x + x ^ 3) * Real.exp (-(x ^ 2) / 8) * Real.exp (5 * Real.log x / x) := by ring theorem tendsto_upper_log_cubic_gaussian_atTop : Tendsto (fun x : ℝ => (10 * Real.log x + x ^ 3) * Real.exp (-(x ^ 2) / 8)) atTop (𝓝 (0 : ℝ)) := by have hupper : Tendsto (fun x : ℝ => 11 * ((x ^ 3 + 1) * Real.exp (-(x ^ 2) / 8))) atTop (𝓝 (0 : ℝ)) := by simpa using! tendsto_cubic_gaussian_atTop.const_mul (11 : ℝ) refine tendsto_of_tendsto_of_tendsto_of_le_of_le' (tendsto_const_nhds (x := (0 : ℝ))) hupper ?_ ?_ · filter_upwards [eventually_ge_atTop (1 : ℝ)] with x hx have hlog : 0 ≤ Real.log x := Real.log_nonneg hx have hcube : 0 ≤ x ^ 3 := by positivity exact mul_nonneg (by nlinarith) (Real.exp_pos _).le · filter_upwards [eventually_ge_atTop (1 : ℝ)] with x hx have hxpos : 0 < x := by linarith have hlog := Real.log_le_sub_one_of_pos hxpos have hsquare : 0 ≤ x ^ 2 - 1 := by nlinarith [sq_nonneg (x - 1)] have hcube : x ≤ x ^ 3 := by nlinarith [mul_nonneg hxpos.le hsquare] have hfactor : 10 * Real.log x + x ^ 3 ≤ 11 * (x ^ 3 + 1) := by nlinarith calc (10 * Real.log x + x ^ 3) * Real.exp (-(x ^ 2) / 8) ≤ (11 * (x ^ 3 + 1)) * Real.exp (-(x ^ 2) / 8) := mul_le_mul_of_nonneg_right hfactor (Real.exp_pos _).le _ = 11 * ((x ^ 3 + 1) * Real.exp (-(x ^ 2) / 8)) := by ring theorem tendsto_upper_shell_log_correction_atTop : Tendsto (fun x : ℝ => Real.exp (5 * Real.log x / x)) atTop (𝓝 (1 : ℝ)) := by have hlog : Tendsto (fun x : ℝ => Real.log x / x) atTop (𝓝 (0 : ℝ)) := by simpa using! Real.tendsto_pow_log_div_mul_add_atTop 1 0 1 (by norm_num : (1 : ℝ) ≠ 0) have hscaled : Tendsto (fun x : ℝ => 5 * Real.log x / x) atTop (𝓝 (0 : ℝ)) := by convert! hlog.const_mul (5 : ℝ) using 1 · ext x ring · norm_num simpa using! hscaled.rexp theorem tendsto_upperShellMarginRatio : Tendsto upperShellMarginRatio (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := by apply tendsto_nhdsGT_zero_of_comp_inv_tendsto_atTop have hproduct : Tendsto (fun x : ℝ => (5000 * ((10 * Real.log x + x ^ 3) * Real.exp (-(x ^ 2) / 8))) * Real.exp (5 * Real.log x / x)) atTop (𝓝 (0 : ℝ)) := by simpa using! (tendsto_upper_log_cubic_gaussian_atTop.const_mul (5000 : ℝ)).mul tendsto_upper_shell_log_correction_atTop refine hproduct.congr' ?_ filter_upwards [eventually_ne_atTop (0 : ℝ)] with x hx rw [upperShellMarginRatio_inv hx] ring theorem eventually_upper_shell_parameter_margin : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), upperShellShortCoefficient ε * Real.exp ((ε / 2) * shortEndpoint ε) ≤ (1 / 5000 : ℝ) * shellWeight ε * Real.exp ((ε / 2) * shellLocation ε) := by have hratio := tendsto_upperShellMarginRatio.eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1)) filter_upwards [hratio] with ε hε unfold upperShellMarginRatio at hε have hden : 0 < shellWeight ε * Real.exp ((ε / 2) * shellLocation ε) := mul_pos (shellWeight_pos ε) (Real.exp_pos _) have hscaled : 5000 * upperShellShortCoefficient ε * Real.exp ((ε / 2) * shortEndpoint ε) < shellWeight ε * Real.exp ((ε / 2) * shellLocation ε) := by exact (div_lt_one hden).mp hε nlinarith theorem upper_one_sub_cos_le_min (x : ℝ) : 1 - Real.cos x ≤ min (x ^ 2 / 2) 2 := by apply le_min · nlinarith [Real.one_sub_sq_div_two_le_cos (x := x)] · nlinarith [Real.neg_one_le_cos x] theorem upper_min_frequency_inverse_sq_le {a : ℝ} (ha : 0 < a) (T : ℝ) : min (T ^ 2) ((a ^ 2)⁻¹) ≤ min (T ^ 2) 1 * (1 + (a ^ 2)⁻¹) := by have hinv : 0 ≤ (a ^ 2)⁻¹ := by positivity by_cases hsmall : T ^ 2 ≤ 1 · rw [min_eq_left hsmall] have hmin := min_le_left (T ^ 2) ((a ^ 2)⁻¹) nlinarith [mul_nonneg (sq_nonneg T) hinv] · rw [min_eq_right (le_of_not_ge hsmall)] have hmin := min_le_right (T ^ 2) ((a ^ 2)⁻¹) nlinarith def upperShortShellDamping (ε ℓ δ T : ℝ) : ℝ := ℓ * ∫ a in shortCutoff ε..shortEndpoint ε, (-shortShellDensity ε a) * Real.cosh ((1 + δ) * a) * (1 - Real.cos (a * T)) theorem upper_shortShell_oscillation_div_sq_le {a : ℝ} (ha : 0 < a) (T : ℝ) : (1 - Real.cos (a * T)) / (2 * a ^ 2) ≤ min (T ^ 2) ((a ^ 2)⁻¹) := by have hden : 0 < 2 * a ^ 2 := by positivity have hcos := upper_one_sub_cos_le_min (a * T) apply le_min · calc (1 - Real.cos (a * T)) / (2 * a ^ 2) ≤ ((a * T) ^ 2 / 2) / (2 * a ^ 2) := div_le_div_of_nonneg_right (hcos.trans (min_le_left _ _)) hden.le _ = T ^ 2 / 4 := by field_simp [ha.ne']; ring _ ≤ T ^ 2 := by nlinarith [sq_nonneg T] · calc (1 - Real.cos (a * T)) / (2 * a ^ 2) ≤ 2 / (2 * a ^ 2) := div_le_div_of_nonneg_right (hcos.trans (min_le_right _ _)) hden.le _ = (a ^ 2)⁻¹ := by field_simp [ha.ne'] theorem upper_shortShellDensity_damping_le {ε δ a A : ℝ} (hε : 0 < ε) (hδ : 0 ≤ δ) (ha : 0 < a) (haA : a ≤ A) (hmargin : 0 ≤ shortMargin ε a) (T : ℝ) : (-shortShellDensity ε a) * Real.cosh ((1 + δ) * a) * (1 - Real.cos (a * T)) ≤ Real.exp (δ * A) * min (T ^ 2) 1 * (1 + (a ^ 2)⁻¹) := by have hmarginone : shortMargin ε a ≤ 1 := by unfold shortMargin at hmargin ⊢ nlinarith [mul_nonneg hε.le (show 0 ≤ 1 + a by linarith)] have hnegativeexp : Real.exp (-2 * a) ≤ 1 := by exact Real.exp_le_one_iff.mpr (by linarith) have hratio : Real.cosh ((1 + δ) * a) / Real.cosh a ≤ Real.exp (δ * A) := by exact (cosh_ratio_upper ha.le hδ).trans (Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_left haA hδ)) have hosc := upper_shortShell_oscillation_div_sq_le ha T have hosc_nonneg : 0 ≤ (1 - Real.cos (a * T)) / (2 * a ^ 2) := by exact div_nonneg (sub_nonneg.mpr (Real.cos_le_one _)) (by positivity) have hratio_scaled : shortMargin ε a * Real.exp (-2 * a) * (Real.cosh ((1 + δ) * a) / Real.cosh a) ≤ shortMargin ε a * Real.exp (-2 * a) * Real.exp (δ * A) := mul_le_mul_of_nonneg_left hratio (mul_nonneg hmargin (Real.exp_pos _).le) have hidentity : (-shortShellDensity ε a) * Real.cosh ((1 + δ) * a) * (1 - Real.cos (a * T)) = shortMargin ε a * Real.exp (-2 * a) * (Real.cosh ((1 + δ) * a) / Real.cosh a) * ((1 - Real.cos (a * T)) / (2 * a ^ 2)) := by unfold shortShellDensity field_simp [ha.ne', (Real.cosh_pos a).ne'] rw [hidentity] calc shortMargin ε a * Real.exp (-2 * a) * (Real.cosh ((1 + δ) * a) / Real.cosh a) * ((1 - Real.cos (a * T)) / (2 * a ^ 2)) ≤ (shortMargin ε a * Real.exp (-2 * a) * Real.exp (δ * A)) * ((1 - Real.cos (a * T)) / (2 * a ^ 2)) := mul_le_mul_of_nonneg_right hratio_scaled hosc_nonneg _ ≤ (1 : ℝ) * 1 * Real.exp (δ * A) * min (T ^ 2) ((a ^ 2)⁻¹) := by gcongr _ = Real.exp (δ * A) * min (T ^ 2) ((a ^ 2)⁻¹) := by ring _ ≤ Real.exp (δ * A) * (min (T ^ 2) 1 * (1 + (a ^ 2)⁻¹)) := mul_le_mul_of_nonneg_left (upper_min_frequency_inverse_sq_le ha T) (Real.exp_pos _).le _ = Real.exp (δ * A) * min (T ^ 2) 1 * (1 + (a ^ 2)⁻¹) := by ring theorem upper_intervalIntegral_one_add_inv_sq {a b : ℝ} (ha : 0 < a) (hab : a ≤ b) : (∫ x in a..b, 1 + (x ^ 2)⁻¹) = b - a + a⁻¹ - b⁻¹ := by have hcont : ContinuousOn (fun x : ℝ => 1 + (x ^ 2)⁻¹) (Set.Icc a b) := by apply continuousOn_const.add ((continuous_id.pow 2).continuousOn.inv₀ ?_) intro x hx have hxpos : 0 < x := ha.trans_le hx.1 exact (sq_pos_of_pos hxpos).ne' have hderiv (x : ℝ) (hx : x ∈ Set.Icc a b) : HasDerivAt (fun y : ℝ => y - y⁻¹) (1 + (x ^ 2)⁻¹) x := by have hxpos : 0 < x := ha.trans_le hx.1 convert! (hasDerivAt_id x).sub (hasDerivAt_inv hxpos.ne') using 1; ring rw [intervalIntegral.integral_eq_sub_of_hasDerivAt (fun x hx => hderiv x (by simpa [Set.uIcc_of_le hab] using! hx)) (hcont.intervalIntegrable_of_Icc hab)] ring theorem upperShortShellDamping_global_bound {ε ℓ δ T : ℝ} (hε : 0 < ε) (hℓ : 0 ≤ ℓ) (hδ : 0 ≤ δ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Set.Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) : upperShortShellDamping ε ℓ δ T ≤ ℓ * upperShellShortCoefficient ε * Real.exp (δ * shortEndpoint ε) * min (T ^ 2) 1 := by let a₀ : ℝ := shortCutoff ε let A : ℝ := shortEndpoint ε let K : ℝ := Real.exp (δ * A) * min (T ^ 2) 1 have ha₀ : 0 < a₀ := by try dsimp [a₀, shortCutoff] positivity have hA : 0 < A := ha₀.trans_le horder have hK : 0 ≤ K := by try dsimp [K] exact mul_nonneg (Real.exp_pos _).le (le_min (sq_nonneg T) (by norm_num)) have hshort : ContinuousOn (shortShellDensity ε) (Set.Icc a₀ A) := by have hn : Continuous (fun a : ℝ => shortMargin ε a * Real.exp (-2 * a)) := by unfold shortMargin fun_prop have hd : Continuous (fun a : ℝ => 2 * a ^ 2 * Real.cosh a) := by fun_prop unfold shortShellDensity apply (hn.continuousOn.div hd.continuousOn ?_).neg intro a ha have hapos : 0 < a := ha₀.trans_le ha.1 exact (mul_pos (mul_pos (by norm_num) (sq_pos_of_pos hapos)) (Real.cosh_pos a)).ne' have hcosh : Continuous (fun a : ℝ => Real.cosh ((1 + δ) * a)) := by fun_prop have hosc : Continuous (fun a : ℝ => 1 - Real.cos (a * T)) := by fun_prop have hleft : ContinuousOn (fun a : ℝ => (-shortShellDensity ε a) * Real.cosh ((1 + δ) * a) * (1 - Real.cos (a * T))) (Set.Icc a₀ A) := (hshort.neg.mul hcosh.continuousOn).mul hosc.continuousOn have hinv : ContinuousOn (fun a : ℝ => (a ^ 2)⁻¹) (Set.Icc a₀ A) := by apply (continuous_id.pow 2).continuousOn.inv₀ intro a ha have hapos : 0 < a := ha₀.trans_le ha.1 exact (sq_pos_of_pos hapos).ne' have hright : ContinuousOn (fun a : ℝ => K * (1 + (a ^ 2)⁻¹)) (Set.Icc a₀ A) := continuousOn_const.mul (continuousOn_const.add hinv) have hpoint : ∀ a ∈ Set.Icc a₀ A, (-shortShellDensity ε a) * Real.cosh ((1 + δ) * a) * (1 - Real.cos (a * T)) ≤ K * (1 + (a ^ 2)⁻¹) := by intro a ha have hapos : 0 < a := ha₀.trans_le ha.1 exact upper_shortShellDensity_damping_le hε hδ hapos ha.2 (hmargin a ha) T have hmono := intervalIntegral.integral_mono_on (μ := volume) horder (hleft.intervalIntegrable_of_Icc horder) (hright.intervalIntegrable_of_Icc horder) hpoint have hevaluate : (∫ a in a₀..A, K * (1 + (a ^ 2)⁻¹)) = K * (A - a₀ + a₀⁻¹ - A⁻¹) := by rw [intervalIntegral.integral_const_mul, upper_intervalIntegral_one_add_inv_sq ha₀ horder] rw [hevaluate] at hmono have hcoefficient : A - a₀ + a₀⁻¹ - A⁻¹ ≤ A + a₀⁻¹ := by have hAinv : 0 ≤ A⁻¹ := (inv_pos.mpr hA).le nlinarith change ℓ * (∫ a in a₀..A, (-shortShellDensity ε a) * Real.cosh ((1 + δ) * a) * (1 - Real.cos (a * T))) ≤ ℓ * upperShellShortCoefficient ε * Real.exp (δ * A) * min (T ^ 2) 1 calc ℓ * (∫ a in a₀..A, (-shortShellDensity ε a) * Real.cosh ((1 + δ) * a) * (1 - Real.cos (a * T))) ≤ ℓ * (K * (A - a₀ + a₀⁻¹ - A⁻¹)) := mul_le_mul_of_nonneg_left hmono hℓ _ ≤ ℓ * (K * (A + a₀⁻¹)) := by gcongr _ = ℓ * upperShellShortCoefficient ε * Real.exp (δ * A) * min (T ^ 2) 1 := by unfold upperShellShortCoefficient try dsimp [a₀, A, K] ring theorem eventually_upper_shortCutoff_le_shortEndpoint : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), shortCutoff ε ≤ shortEndpoint ε := by have hlower := tendsto_shortCutoff.eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1)) have hupper := tendsto_shortEndpoint.eventually_ge_atTop (1 : ℝ) filter_upwards [hlower, hupper] with ε hl hu linarith theorem upper_shell_parameter_margin_propagate {ε δ : ℝ} (hδ : ε / 2 ≤ δ) (hseparation : shortEndpoint ε ≤ shellLocation ε) (hmargin : upperShellShortCoefficient ε * Real.exp ((ε / 2) * shortEndpoint ε) ≤ (1 / 5000 : ℝ) * shellWeight ε * Real.exp ((ε / 2) * shellLocation ε)) : upperShellShortCoefficient ε * Real.exp (δ * shortEndpoint ε) ≤ (1 / 5000 : ℝ) * shellWeight ε * Real.exp (δ * shellLocation ε) := by let q : ℝ := δ - ε / 2 have hq : 0 ≤ q := by try dsimp [q] linarith have hexp : Real.exp (q * shortEndpoint ε) ≤ Real.exp (q * shellLocation ε) := Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_left hseparation hq) have hfactor : 0 ≤ (1 / 5000 : ℝ) * shellWeight ε * Real.exp ((ε / 2) * shellLocation ε) := by exact mul_nonneg (mul_nonneg (by norm_num) (shellWeight_pos ε).le) (Real.exp_pos _).le calc upperShellShortCoefficient ε * Real.exp (δ * shortEndpoint ε) = (upperShellShortCoefficient ε * Real.exp ((ε / 2) * shortEndpoint ε)) * Real.exp (q * shortEndpoint ε) := by rw [mul_assoc, ← Real.exp_add] congr 2 try dsimp [q] ring _ ≤ ((1 / 5000 : ℝ) * shellWeight ε * Real.exp ((ε / 2) * shellLocation ε)) * Real.exp (q * shortEndpoint ε) := mul_le_mul_of_nonneg_right hmargin (Real.exp_pos _).le _ ≤ ((1 / 5000 : ℝ) * shellWeight ε * Real.exp ((ε / 2) * shellLocation ε)) * Real.exp (q * shellLocation ε) := mul_le_mul_of_nonneg_left hexp hfactor _ = (1 / 5000 : ℝ) * shellWeight ε * Real.exp (δ * shellLocation ε) := by rw [mul_assoc, ← Real.exp_add] congr 2 try dsimp [q] ring theorem eventually_upper_shortShell_domination : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ ℓ : ℝ, 0 ≤ ℓ → ∀ δ : ℝ, ε / 2 ≤ δ → ∀ T : ℝ, upperShortShellDamping ε ℓ δ T ≤ (1 / 100 : ℝ) * positiveShellDamping ε ℓ δ T := by filter_upwards [self_mem_nhdsWithin, eventually_upper_shortCutoff_le_shortEndpoint, eventually_upper_shortMargin_positive, eventually_upper_shellLocation_gt_shortEndpoint, eventually_upper_shell_parameter_margin] with ε hε horder hshortmargin hseparation hmargin change 0 < ε at hε intro ℓ hℓ δ hδ T have hδnonneg : 0 ≤ δ := by nlinarith have hshort : upperShortShellDamping ε ℓ δ T ≤ ℓ * upperShellShortCoefficient ε * Real.exp (δ * shortEndpoint ε) * min (T ^ 2) 1 := upperShortShellDamping_global_bound hε hℓ hδnonneg horder (fun a ha => by have h := hshortmargin a ha nlinarith) have hpropagate := upper_shell_parameter_margin_propagate hδ (le_of_lt (by linarith [hseparation])) hmargin have hpositive := positiveShellDamping_lower_bound (ε := ε) (ℓ := ℓ) (δ := δ) (T := T) hε hℓ hδnonneg have hfreq : 0 ≤ min (T ^ 2) 1 := le_min (sq_nonneg T) (by norm_num) calc upperShortShellDamping ε ℓ δ T ≤ ℓ * upperShellShortCoefficient ε * Real.exp (δ * shortEndpoint ε) * min (T ^ 2) 1 := hshort _ ≤ ℓ * ((1 / 5000 : ℝ) * shellWeight ε * Real.exp (δ * shellLocation ε)) * min (T ^ 2) 1 := by convert! mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hpropagate hℓ) hfreq using 1; ring _ = (1 / 100 : ℝ) * (ℓ / 50 * shellWeight ε * Real.exp (δ * shellLocation ε) * min (T ^ 2) 1) := by ring _ ≤ (1 / 100 : ℝ) * positiveShellDamping ε ℓ δ T := mul_le_mul_of_nonneg_left hpositive (by norm_num) def upperPositiveShellVariance (ε δ : ℝ) : ℝ := ∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * a ^ 2 * Real.cosh ((1 + δ) * a) theorem upperPositiveShellVariance_bounds {ε δ : ℝ} (hε : 0 < ε) (hδ : 0 ≤ δ) : (1 / 2 : ℝ) * (shellLocation ε) ^ 2 * shellWeight ε * Real.exp (δ * shellLocation ε) ≤ upperPositiveShellVariance ε δ ∧ upperPositiveShellVariance ε δ ≤ (shellLocation ε + 1) ^ 2 * shellWeight ε * Real.exp (δ * (shellLocation ε + 1)) := by let B : ℝ := shellLocation ε let lo : ℝ := (1 / 2 : ℝ) * B ^ 2 * shellWeight ε * Real.exp (δ * B) let hi : ℝ := (B + 1) ^ 2 * shellWeight ε * Real.exp (δ * (B + 1)) have hB : 0 ≤ B := by try dsimp [B, shellLocation] positivity have hQ : 0 < shellWeight ε := shellWeight_pos ε have horder : B ≤ B + 1 := by linarith have hcont : Continuous (fun a : ℝ => positiveShellDensity ε a * a ^ 2 * Real.cosh ((1 + δ) * a)) := by have hdensity := positiveShellDensity_continuous ε fun_prop have hlopoint : ∀ a ∈ Set.Icc B (B + 1), lo ≤ positiveShellDensity ε a * a ^ 2 * Real.cosh ((1 + δ) * a) := by intro a ha have ha0 : 0 ≤ a := hB.trans ha.1 have hsquare : B ^ 2 ≤ a ^ 2 := by exact pow_le_pow_left₀ hB ha.1 2 have hratio : Real.exp (δ * B) / 2 ≤ Real.cosh ((1 + δ) * a) / Real.cosh a := by calc Real.exp (δ * B) / 2 ≤ Real.exp (δ * a) / 2 := by apply div_le_div_of_nonneg_right (Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_left ha.1 hδ)) (by norm_num) _ ≤ Real.cosh ((1 + δ) * a) / Real.cosh a := cosh_ratio_lower ha0 hδ calc lo = shellWeight ε * B ^ 2 * (Real.exp (δ * B) / 2) := by try dsimp [lo] ring _ ≤ shellWeight ε * a ^ 2 * (Real.cosh ((1 + δ) * a) / Real.cosh a) := by gcongr _ = positiveShellDensity ε a * a ^ 2 * Real.cosh ((1 + δ) * a) := by unfold positiveShellDensity ring have hhipoint : ∀ a ∈ Set.Icc B (B + 1), positiveShellDensity ε a * a ^ 2 * Real.cosh ((1 + δ) * a) ≤ hi := by intro a ha have ha0 : 0 ≤ a := hB.trans ha.1 have hsquare : a ^ 2 ≤ (B + 1) ^ 2 := by exact pow_le_pow_left₀ ha0 ha.2 2 have hratio : Real.cosh ((1 + δ) * a) / Real.cosh a ≤ Real.exp (δ * (B + 1)) := (cosh_ratio_upper ha0 hδ).trans (Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_left ha.2 hδ)) calc positiveShellDensity ε a * a ^ 2 * Real.cosh ((1 + δ) * a) = shellWeight ε * a ^ 2 * (Real.cosh ((1 + δ) * a) / Real.cosh a) := by unfold positiveShellDensity ring _ ≤ shellWeight ε * (B + 1) ^ 2 * Real.exp (δ * (B + 1)) := by gcongr _ = hi := by try dsimp [hi] ring have hlower := intervalIntegral.integral_mono_on (μ := volume) horder ((continuous_const : Continuous (fun _ : ℝ => lo)).intervalIntegrable _ _) (hcont.intervalIntegrable _ _) hlopoint have hupper := intervalIntegral.integral_mono_on (μ := volume) horder (hcont.intervalIntegrable _ _) ((continuous_const : Continuous (fun _ : ℝ => hi)).intervalIntegrable _ _) hhipoint change lo ≤ upperPositiveShellVariance ε δ ∧ upperPositiveShellVariance ε δ ≤ hi constructor · simpa [upperPositiveShellVariance, B] using! hlower · simpa [upperPositiveShellVariance, B] using! hupper def upperShortShellVariance (ε δ : ℝ) : ℝ := ∫ a in shortCutoff ε..shortEndpoint ε, (-shortShellDensity ε a) * a ^ 2 * Real.cosh ((1 + δ) * a) theorem upper_shortShellDensity_variance_le {ε δ a A : ℝ} (hε : 0 < ε) (hδ : 0 ≤ δ) (ha : 0 < a) (haA : a ≤ A) : (-shortShellDensity ε a) * a ^ 2 * Real.cosh ((1 + δ) * a) ≤ (1 / 2 : ℝ) * Real.exp (δ * A) := by have hmargin : shortMargin ε a ≤ 1 := by unfold shortMargin nlinarith [mul_nonneg hε.le (show 0 ≤ 1 + a by linarith)] have hexp : Real.exp (-2 * a) ≤ 1 := Real.exp_le_one_iff.mpr (by linarith) have hratio : Real.cosh ((1 + δ) * a) / Real.cosh a ≤ Real.exp (δ * A) := (cosh_ratio_upper ha.le hδ).trans (Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_left haA hδ)) have hidentity : (-shortShellDensity ε a) * a ^ 2 * Real.cosh ((1 + δ) * a) = (1 / 2 : ℝ) * shortMargin ε a * Real.exp (-2 * a) * (Real.cosh ((1 + δ) * a) / Real.cosh a) := by unfold shortShellDensity field_simp [ha.ne', (Real.cosh_pos a).ne'] rw [hidentity] calc (1 / 2 : ℝ) * shortMargin ε a * Real.exp (-2 * a) * (Real.cosh ((1 + δ) * a) / Real.cosh a) ≤ (1 / 2 : ℝ) * 1 * 1 * Real.exp (δ * A) := by gcongr _ = (1 / 2 : ℝ) * Real.exp (δ * A) := by ring theorem upperShortShellVariance_global_bound {ε δ : ℝ} (hε : 0 < ε) (hδ : 0 ≤ δ) (horder : shortCutoff ε ≤ shortEndpoint ε) : upperShortShellVariance ε δ ≤ (1 / 2 : ℝ) * upperShellShortCoefficient ε * Real.exp (δ * shortEndpoint ε) := by let a₀ : ℝ := shortCutoff ε let A : ℝ := shortEndpoint ε let K : ℝ := (1 / 2 : ℝ) * Real.exp (δ * A) have ha₀ : 0 < a₀ := by try dsimp [a₀, shortCutoff] positivity have hA : 0 < A := ha₀.trans_le horder have hK : 0 ≤ K := by try dsimp [K] positivity have hshort : ContinuousOn (shortShellDensity ε) (Set.Icc a₀ A) := by have hn : Continuous (fun a : ℝ => shortMargin ε a * Real.exp (-2 * a)) := by unfold shortMargin fun_prop have hd : Continuous (fun a : ℝ => 2 * a ^ 2 * Real.cosh a) := by fun_prop unfold shortShellDensity apply (hn.continuousOn.div hd.continuousOn ?_).neg intro a ha have hapos : 0 < a := ha₀.trans_le ha.1 positivity have hcosh : Continuous (fun a : ℝ => Real.cosh ((1 + δ) * a)) := by fun_prop have hleft : ContinuousOn (fun a : ℝ => (-shortShellDensity ε a) * a ^ 2 * Real.cosh ((1 + δ) * a)) (Set.Icc a₀ A) := (hshort.neg.mul (continuous_id.pow 2).continuousOn).mul hcosh.continuousOn have hpoint : ∀ a ∈ Set.Icc a₀ A, (-shortShellDensity ε a) * a ^ 2 * Real.cosh ((1 + δ) * a) ≤ K := by intro a ha exact upper_shortShellDensity_variance_le hε hδ (ha₀.trans_le ha.1) ha.2 have hmono := intervalIntegral.integral_mono_on (μ := volume) horder (hleft.intervalIntegrable_of_Icc horder) ((continuous_const : Continuous (fun _ : ℝ => K)).intervalIntegrable _ _) hpoint have hinv : 0 ≤ a₀⁻¹ := (inv_pos.mpr ha₀).le change (∫ a in a₀..A, (-shortShellDensity ε a) * a ^ 2 * Real.cosh ((1 + δ) * a)) ≤ (1 / 2 : ℝ) * upperShellShortCoefficient ε * Real.exp (δ * A) calc (∫ a in a₀..A, (-shortShellDensity ε a) * a ^ 2 * Real.cosh ((1 + δ) * a)) ≤ (A - a₀) * K := by simpa using! hmono _ ≤ (A + a₀⁻¹) * K := by apply mul_le_mul_of_nonneg_right _ hK nlinarith _ = (1 / 2 : ℝ) * upperShellShortCoefficient ε * Real.exp (δ * A) := by unfold upperShellShortCoefficient try dsimp [A, a₀, K] ring theorem upperShortShellVariance_nonneg {ε δ : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Set.Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) : 0 ≤ upperShortShellVariance ε δ := by unfold upperShortShellVariance apply intervalIntegral.integral_nonneg horder intro a ha have ha₀ : 0 < shortCutoff ε := by unfold shortCutoff positivity have hapos : 0 < a := ha₀.trans_le ha.1 have hdensity : 0 ≤ -shortShellDensity ε a := by unfold shortShellDensity have hn : 0 ≤ shortMargin ε a * Real.exp (-2 * a) := mul_nonneg (hmargin a ha) (Real.exp_pos _).le have hd : 0 < 2 * a ^ 2 * Real.cosh a := by positivity simpa using! div_nonneg hn hd.le exact mul_nonneg (mul_nonneg hdensity (sq_nonneg a)) (Real.cosh_pos _).le theorem upper_shellLocation_one_le {ε : ℝ} (hε : 0 < ε) (hεone : ε ≤ 1) : 1 ≤ shellLocation ε := by have hinv : 1 ≤ ε⁻¹ := (one_le_inv₀ hε).mpr hεone unfold shellLocation convert! pow_le_pow_left₀ (show (0 : ℝ) ≤ 1 by norm_num) hinv 3 using 1; norm_num theorem eventually_upper_shortShellVariance_domination : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ δ : ℝ, ε / 2 ≤ δ → upperShortShellVariance ε δ ≤ (1 / 100 : ℝ) * upperPositiveShellVariance ε δ := by have hsmall : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ε < 1 := (tendsto_id.mono_left (nhdsWithin_le_nhds (s := Set.Ioi (0 : ℝ)))).eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1)) filter_upwards [self_mem_nhdsWithin, hsmall, eventually_upper_shortCutoff_le_shortEndpoint, eventually_upper_shellLocation_gt_shortEndpoint, eventually_upper_shell_parameter_margin] with ε hε hεone horder hseparation hmargin change 0 < ε at hε intro δ hδ have hδnonneg : 0 ≤ δ := by nlinarith have hB : 1 ≤ shellLocation ε := upper_shellLocation_one_le hε hεone.le have hBsq : 1 ≤ (shellLocation ε) ^ 2 := by nlinarith [sq_nonneg (shellLocation ε - 1)] have hpropagate := upper_shell_parameter_margin_propagate hδ (by linarith [hseparation]) hmargin have hvariance := upperShortShellVariance_global_bound hε hδnonneg horder have hpositive := (upperPositiveShellVariance_bounds hε hδnonneg).1 have hqexp : 0 ≤ shellWeight ε * Real.exp (δ * shellLocation ε) := mul_nonneg (shellWeight_pos ε).le (Real.exp_pos _).le calc upperShortShellVariance ε δ ≤ (1 / 2 : ℝ) * upperShellShortCoefficient ε * Real.exp (δ * shortEndpoint ε) := hvariance _ ≤ (1 / 2 : ℝ) * ((1 / 5000 : ℝ) * shellWeight ε * Real.exp (δ * shellLocation ε)) := by convert! mul_le_mul_of_nonneg_left hpropagate (by norm_num : (0 : ℝ) ≤ 1 / 2) using 1; ring _ ≤ (1 / 100 : ℝ) * ((1 / 2 : ℝ) * (shellLocation ε) ^ 2 * shellWeight ε * Real.exp (δ * shellLocation ε)) := by have hscaled := mul_le_mul_of_nonneg_right hBsq hqexp nlinarith _ ≤ (1 / 100 : ℝ) * upperPositiveShellVariance ε δ := mul_le_mul_of_nonneg_left hpositive (by norm_num) def upperNetShellVariance (ε δ : ℝ) : ℝ := upperPositiveShellVariance ε δ - upperShortShellVariance ε δ theorem eventually_upper_netShellVariance_bounds : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ δ : ℝ, ε / 2 ≤ δ → (99 / 100 : ℝ) * upperPositiveShellVariance ε δ ≤ upperNetShellVariance ε δ ∧ upperNetShellVariance ε δ ≤ upperPositiveShellVariance ε δ := by filter_upwards [self_mem_nhdsWithin, eventually_upper_shortCutoff_le_shortEndpoint, eventually_upper_shortMargin_positive, eventually_upper_shortShellVariance_domination] with ε hε horder hmargin hdom change 0 < ε at hε intro δ hδ have hnonneg := upperShortShellVariance_nonneg (δ := δ) hε horder (fun a ha => by have h := hmargin a ha nlinarith) have hupper := hdom δ hδ unfold upperNetShellVariance constructor <;> nlinarith def upperPositiveShellThirdMoment (ε δ : ℝ) : ℝ := ∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * a ^ 3 * Real.cosh ((1 + δ) * a) theorem upperPositiveShellThirdMoment_le {ε δ : ℝ} (hε : 0 < ε) : upperPositiveShellThirdMoment ε δ ≤ (shellLocation ε + 1) * upperPositiveShellVariance ε δ := by let B : ℝ := shellLocation ε have hB : 0 ≤ B := by try dsimp [B, shellLocation] positivity have horder : B ≤ B + 1 := by linarith have hdensity := positiveShellDensity_continuous ε have hbase : Continuous (fun a : ℝ => positiveShellDensity ε a * a ^ 2 * Real.cosh ((1 + δ) * a)) := by fun_prop have hthird : Continuous (fun a : ℝ => positiveShellDensity ε a * a ^ 3 * Real.cosh ((1 + δ) * a)) := by fun_prop have hright : Continuous (fun a : ℝ => (B + 1) * (positiveShellDensity ε a * a ^ 2 * Real.cosh ((1 + δ) * a))) := continuous_const.mul hbase have hpoint : ∀ a ∈ Set.Icc B (B + 1), positiveShellDensity ε a * a ^ 3 * Real.cosh ((1 + δ) * a) ≤ (B + 1) * (positiveShellDensity ε a * a ^ 2 * Real.cosh ((1 + δ) * a)) := by intro a ha have hdensitynonneg : 0 ≤ positiveShellDensity ε a := by unfold positiveShellDensity exact div_nonneg (shellWeight_pos ε).le (Real.cosh_pos a).le have hbasenonneg : 0 ≤ positiveShellDensity ε a * a ^ 2 * Real.cosh ((1 + δ) * a) := mul_nonneg (mul_nonneg hdensitynonneg (sq_nonneg a)) (Real.cosh_pos _).le calc positiveShellDensity ε a * a ^ 3 * Real.cosh ((1 + δ) * a) = a * (positiveShellDensity ε a * a ^ 2 * Real.cosh ((1 + δ) * a)) := by ring _ ≤ (B + 1) * (positiveShellDensity ε a * a ^ 2 * Real.cosh ((1 + δ) * a)) := mul_le_mul_of_nonneg_right ha.2 hbasenonneg have hmono := intervalIntegral.integral_mono_on (μ := volume) horder (hthird.intervalIntegrable _ _) (hright.intervalIntegrable _ _) hpoint simpa [upperPositiveShellThirdMoment, upperPositiveShellVariance, B, intervalIntegral.integral_const_mul] using! hmono def upperShortShellThirdMoment (ε δ : ℝ) : ℝ := ∫ a in shortCutoff ε..shortEndpoint ε, (-shortShellDensity ε a) * a ^ 3 * Real.cosh ((1 + δ) * a) theorem upperShortShellThirdMoment_le {ε δ : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Set.Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) : upperShortShellThirdMoment ε δ ≤ shortEndpoint ε * upperShortShellVariance ε δ := by let a₀ : ℝ := shortCutoff ε let A : ℝ := shortEndpoint ε have ha₀ : 0 < a₀ := by try dsimp [a₀, shortCutoff] positivity have hshort : ContinuousOn (shortShellDensity ε) (Set.Icc a₀ A) := by have hn : Continuous (fun a : ℝ => shortMargin ε a * Real.exp (-2 * a)) := by unfold shortMargin fun_prop have hd : Continuous (fun a : ℝ => 2 * a ^ 2 * Real.cosh a) := by fun_prop unfold shortShellDensity apply (hn.continuousOn.div hd.continuousOn ?_).neg intro a ha have hapos : 0 < a := ha₀.trans_le ha.1 positivity have hcosh : Continuous (fun a : ℝ => Real.cosh ((1 + δ) * a)) := by fun_prop have hbase : ContinuousOn (fun a : ℝ => (-shortShellDensity ε a) * a ^ 2 * Real.cosh ((1 + δ) * a)) (Set.Icc a₀ A) := (hshort.neg.mul (continuous_id.pow 2).continuousOn).mul hcosh.continuousOn have hthird : ContinuousOn (fun a : ℝ => (-shortShellDensity ε a) * a ^ 3 * Real.cosh ((1 + δ) * a)) (Set.Icc a₀ A) := (hshort.neg.mul (continuous_id.pow 3).continuousOn).mul hcosh.continuousOn have hright : ContinuousOn (fun a : ℝ => A * ((-shortShellDensity ε a) * a ^ 2 * Real.cosh ((1 + δ) * a))) (Set.Icc a₀ A) := continuousOn_const.mul hbase have hpoint : ∀ a ∈ Set.Icc a₀ A, (-shortShellDensity ε a) * a ^ 3 * Real.cosh ((1 + δ) * a) ≤ A * ((-shortShellDensity ε a) * a ^ 2 * Real.cosh ((1 + δ) * a)) := by intro a ha have hapos : 0 < a := ha₀.trans_le ha.1 have hmargin' : 0 ≤ shortMargin ε a := by apply hmargin exact ha have hdensity : 0 ≤ -shortShellDensity ε a := by unfold shortShellDensity have hn : 0 ≤ shortMargin ε a * Real.exp (-2 * a) := mul_nonneg hmargin' (Real.exp_pos _).le have hd : 0 < 2 * a ^ 2 * Real.cosh a := by positivity simpa using! div_nonneg hn hd.le have hbasenonneg : 0 ≤ (-shortShellDensity ε a) * a ^ 2 * Real.cosh ((1 + δ) * a) := mul_nonneg (mul_nonneg hdensity (sq_nonneg a)) (Real.cosh_pos _).le calc (-shortShellDensity ε a) * a ^ 3 * Real.cosh ((1 + δ) * a) = a * ((-shortShellDensity ε a) * a ^ 2 * Real.cosh ((1 + δ) * a)) := by ring _ ≤ A * ((-shortShellDensity ε a) * a ^ 2 * Real.cosh ((1 + δ) * a)) := mul_le_mul_of_nonneg_right ha.2 hbasenonneg have hmono := intervalIntegral.integral_mono_on (μ := volume) horder (hthird.intervalIntegrable_of_Icc horder) (hright.intervalIntegrable_of_Icc horder) hpoint simpa [upperShortShellThirdMoment, upperShortShellVariance, a₀, A, intervalIntegral.integral_const_mul] using! hmono theorem eventually_upper_shortShellThirdMoment_domination : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ δ : ℝ, ε / 2 ≤ δ → upperShortShellThirdMoment ε δ ≤ (shortEndpoint ε / 100) * upperPositiveShellVariance ε δ := by filter_upwards [self_mem_nhdsWithin, eventually_upper_shortCutoff_le_shortEndpoint, eventually_upper_shortMargin_positive, eventually_upper_shortShellVariance_domination] with ε hε horder hmargin hdom change 0 < ε at hε intro δ hδ have ha₀ : 0 < shortCutoff ε := by unfold shortCutoff positivity have hA : 0 ≤ shortEndpoint ε := (ha₀.trans_le horder).le have hthird := upperShortShellThirdMoment_le (δ := δ) hε horder (fun a ha => by have h := hmargin a ha linarith) calc upperShortShellThirdMoment ε δ ≤ shortEndpoint ε * upperShortShellVariance ε δ := hthird _ ≤ shortEndpoint ε * ((1 / 100 : ℝ) * upperPositiveShellVariance ε δ) := mul_le_mul_of_nonneg_left (hdom δ hδ) hA _ = (shortEndpoint ε / 100) * upperPositiveShellVariance ε δ := by ring def upperNetShellThirdMoment (ε δ : ℝ) : ℝ := upperPositiveShellThirdMoment ε δ + upperShortShellThirdMoment ε δ theorem eventually_upper_netShellThirdMoment_bound : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ δ : ℝ, ε / 2 ≤ δ → upperNetShellThirdMoment ε δ ≤ (shellLocation ε + 1 + shortEndpoint ε / 100) * upperPositiveShellVariance ε δ := by filter_upwards [self_mem_nhdsWithin, eventually_upper_shortShellThirdMoment_domination] with ε hε hshort change 0 < ε at hε intro δ hδ have hpositive := upperPositiveShellThirdMoment_le (δ := δ) hε have hnegative := hshort δ hδ unfold upperNetShellThirdMoment nlinarith theorem upper_inv_one_sub_exp_neg_bounds {x : ℝ} (hx : 0 < x) : x⁻¹ ≤ (1 - Real.exp (-x))⁻¹ ∧ (1 - Real.exp (-x))⁻¹ ≤ 1 + x⁻¹ := by have hden : 0 < 1 - Real.exp (-x) := by have he : Real.exp (-x) < 1 := Real.exp_lt_one_iff.mpr (by linarith) linarith have hlower : 1 - Real.exp (-x) ≤ x := by nlinarith [Real.add_one_le_exp (-x)] have hplus : 0 < 1 + x := by linarith have hexp : Real.exp (-x) ≤ (1 + x)⁻¹ := by rw [Real.exp_neg] apply (inv_le_inv₀ (Real.exp_pos x) hplus).2 nlinarith [Real.add_one_le_exp x] constructor · exact (inv_le_inv₀ hx hden).2 hlower · have hgoal : 1 / (1 - Real.exp (-x)) ≤ 1 + x⁻¹ := by apply (div_le_iff₀ hden).2 have hfactor : 0 ≤ 1 + x⁻¹ := by positivity calc (1 : ℝ) = (1 + x⁻¹) * (1 - (1 + x)⁻¹) := by field_simp [hx.ne', hplus.ne']; ring _ ≤ (1 + x⁻¹) * (1 - Real.exp (-x)) := mul_le_mul_of_nonneg_left (sub_le_sub_left hexp 1) hfactor simpa [one_div] using! hgoal def upperGammaMeasureDensity (ℓ η a : ℝ) : ℝ := Real.exp (-η * a) / (a * (1 - Real.exp (-(2 * a / ℓ)))) theorem upper_laplace_monomial_integrable {η : ℝ} (hη : 0 < η) (k : ℕ) : IntegrableOn (fun a : ℝ => a ^ k * Real.exp (-η * a)) (Set.Ioi 0) := by have h := integrableOn_rpow_mul_exp_neg_mul_rpow (p := (1 : ℝ)) (s := (k : ℝ)) (b := η) (by exact_mod_cast (show (-(1 : ℤ) < (k : ℤ)) by omega)) (by norm_num) hη apply h.congr_fun _ measurableSet_Ioi intro a ha simp [Real.rpow_natCast] theorem upper_laplace_monomial_integral {η : ℝ} (hη : 0 < η) (k : ℕ) : (∫ a : ℝ in Set.Ioi 0, a ^ k * Real.exp (-η * a)) = (k.factorial : ℝ) / η ^ (k + 1) := by have hk : (0 : ℝ) < (k : ℝ) + 1 := by positivity calc (∫ a : ℝ in Set.Ioi 0, a ^ k * Real.exp (-η * a)) = ∫ a : ℝ in Set.Ioi 0, a ^ ((k : ℝ) + 1 - 1) * Real.exp (-(η * a)) := by apply setIntegral_congr_fun measurableSet_Ioi intro a ha change a ^ k * Real.exp (-η * a) = a ^ ((k : ℝ) + 1 - 1) * Real.exp (-(η * a)) rw [show (k : ℝ) + 1 - 1 = (k : ℝ) by ring, Real.rpow_natCast] congr 1 ring_nf _ = (1 / η) ^ ((k : ℝ) + 1) * Real.Gamma ((k : ℝ) + 1) := Real.integral_rpow_mul_exp_neg_mul_Ioi hk hη _ = (k.factorial : ℝ) / η ^ (k + 1) := by rw [show (k : ℝ) + 1 = ((k + 1 : ℕ) : ℝ) by norm_num, Real.rpow_natCast] rw [show ((k + 1 : ℕ) : ℝ) = (k : ℝ) + 1 by push_cast; ring, Real.Gamma_nat_eq_factorial] simp [inv_pow, div_eq_mul_inv, mul_comm] theorem upperGammaVarianceDensity_pointwise_bounds {ℓ η a : ℝ} (hℓ : 0 < ℓ) (ha : 0 < a) : (ℓ / 2) * Real.exp (-η * a) ≤ a ^ 2 * upperGammaMeasureDensity ℓ η a ∧ a ^ 2 * upperGammaMeasureDensity ℓ η a ≤ (a + ℓ / 2) * Real.exp (-η * a) := by let x : ℝ := 2 * a / ℓ have hx : 0 < x := by try dsimp [x] positivity have hkernel := upper_inv_one_sub_exp_neg_bounds hx have hden : 0 < 1 - Real.exp (-x) := by have he : Real.exp (-x) < 1 := Real.exp_lt_one_iff.mpr (by linarith) linarith have hfactor : 0 ≤ a * Real.exp (-η * a) := by positivity have hidentity : a ^ 2 * upperGammaMeasureDensity ℓ η a = a * Real.exp (-η * a) * (1 - Real.exp (-x))⁻¹ := by unfold upperGammaMeasureDensity try dsimp [x] field_simp [ha.ne', hℓ.ne', hden.ne'] constructor · calc (ℓ / 2) * Real.exp (-η * a) = a * Real.exp (-η * a) * x⁻¹ := by try dsimp [x] field_simp [ha.ne', hℓ.ne'] _ ≤ a * Real.exp (-η * a) * (1 - Real.exp (-x))⁻¹ := mul_le_mul_of_nonneg_left hkernel.1 hfactor _ = a ^ 2 * upperGammaMeasureDensity ℓ η a := hidentity.symm · calc a ^ 2 * upperGammaMeasureDensity ℓ η a = a * Real.exp (-η * a) * (1 - Real.exp (-x))⁻¹ := hidentity _ ≤ a * Real.exp (-η * a) * (1 + x⁻¹) := mul_le_mul_of_nonneg_left hkernel.2 hfactor _ = (a + ℓ / 2) * Real.exp (-η * a) := by try dsimp [x] field_simp [ha.ne', hℓ.ne'] theorem upperGammaThirdMomentDensity_pointwise_bounds {ℓ η a : ℝ} (hℓ : 0 < ℓ) (ha : 0 < a) : (ℓ / 2) * a * Real.exp (-η * a) ≤ a ^ 3 * upperGammaMeasureDensity ℓ η a ∧ a ^ 3 * upperGammaMeasureDensity ℓ η a ≤ (a ^ 2 + (ℓ / 2) * a) * Real.exp (-η * a) := by obtain ⟨hlower, hupper⟩ := upperGammaVarianceDensity_pointwise_bounds (η := η) hℓ ha have hlow := mul_le_mul_of_nonneg_left hlower ha.le have hupp := mul_le_mul_of_nonneg_left hupper ha.le constructor <;> nlinarith theorem upperGammaVarianceDensity_integrable {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) : IntegrableOn (fun a : ℝ => a ^ 2 * upperGammaMeasureDensity ℓ η a) (Set.Ioi 0) := by have hzero := upper_laplace_monomial_integrable hη 0 have hone := upper_laplace_monomial_integrable hη 1 have hsum := hone.add (hzero.const_mul (ℓ / 2)) have hmajor : IntegrableOn (fun a : ℝ => (a + ℓ / 2) * Real.exp (-η * a)) (Set.Ioi 0) := by apply hsum.congr_fun _ measurableSet_Ioi intro a ha change a ^ 1 * Real.exp (-η * a) + (ℓ / 2) * (a ^ 0 * Real.exp (-η * a)) = (a + ℓ / 2) * Real.exp (-η * a) simp ring have hmeas : Measurable (fun a : ℝ => a ^ 2 * upperGammaMeasureDensity ℓ η a) := by unfold upperGammaMeasureDensity fun_prop apply hmajor.mono' hmeas.aestronglyMeasurable filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha have hbounds := upperGammaVarianceDensity_pointwise_bounds (η := η) hℓ ha have hpositive : 0 ≤ a ^ 2 * upperGammaMeasureDensity ℓ η a := (show 0 ≤ (ℓ / 2) * Real.exp (-η * a) by positivity).trans hbounds.1 rw [Real.norm_eq_abs, abs_of_nonneg hpositive] exact hbounds.2 theorem upperGammaThirdMomentDensity_integrable {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) : IntegrableOn (fun a : ℝ => a ^ 3 * upperGammaMeasureDensity ℓ η a) (Set.Ioi 0) := by have hone := upper_laplace_monomial_integrable hη 1 have htwo := upper_laplace_monomial_integrable hη 2 have hsum := htwo.add (hone.const_mul (ℓ / 2)) have hmajor : IntegrableOn (fun a : ℝ => (a ^ 2 + (ℓ / 2) * a) * Real.exp (-η * a)) (Set.Ioi 0) := by apply hsum.congr_fun _ measurableSet_Ioi intro a ha change a ^ 2 * Real.exp (-η * a) + (ℓ / 2) * (a ^ 1 * Real.exp (-η * a)) = (a ^ 2 + (ℓ / 2) * a) * Real.exp (-η * a) simp ring have hmeas : Measurable (fun a : ℝ => a ^ 3 * upperGammaMeasureDensity ℓ η a) := by unfold upperGammaMeasureDensity fun_prop apply hmajor.mono' hmeas.aestronglyMeasurable filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha have hapos : 0 < a := ha have hbounds := upperGammaThirdMomentDensity_pointwise_bounds (η := η) hℓ hapos have hpositive : 0 ≤ a ^ 3 * upperGammaMeasureDensity ℓ η a := (show 0 ≤ (ℓ / 2) * a * Real.exp (-η * a) by positivity).trans hbounds.1 rw [Real.norm_eq_abs, abs_of_nonneg hpositive] exact hbounds.2 def upperGammaVariance (ℓ η : ℝ) : ℝ := ℓ⁻¹ * ∫ a : ℝ in Set.Ioi 0, a ^ 2 * upperGammaMeasureDensity ℓ η a def upperGammaThirdMoment (ℓ η : ℝ) : ℝ := ℓ⁻¹ * ∫ a : ℝ in Set.Ioi 0, a ^ 3 * upperGammaMeasureDensity ℓ η a theorem upperGammaVariance_bounds {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) : 1 / (2 * η) ≤ upperGammaVariance ℓ η ∧ upperGammaVariance ℓ η ≤ 1 / (2 * η) + 1 / (ℓ * η ^ 2) := by have hzero : IntegrableOn (fun a : ℝ => Real.exp (-η * a)) (Set.Ioi 0) := by simpa using! upper_laplace_monomial_integrable hη 0 have hline : IntegrableOn (fun a : ℝ => a * Real.exp (-η * a)) (Set.Ioi 0) := by simpa using! upper_laplace_monomial_integrable hη 1 have hconst : IntegrableOn (fun a : ℝ => (ℓ / 2) * Real.exp (-η * a)) (Set.Ioi 0) := hzero.const_mul (ℓ / 2) have hactual := upperGammaVarianceDensity_integrable hℓ hη have hmajor : IntegrableOn (fun a : ℝ => (a + ℓ / 2) * Real.exp (-η * a)) (Set.Ioi 0) := by apply (hline.add hconst).congr_fun _ measurableSet_Ioi intro a ha change a * Real.exp (-η * a) + (ℓ / 2) * Real.exp (-η * a) = (a + ℓ / 2) * Real.exp (-η * a) ring have hlowerIntegral : (∫ a : ℝ in Set.Ioi 0, (ℓ / 2) * Real.exp (-η * a)) ≤ ∫ a : ℝ in Set.Ioi 0, a ^ 2 * upperGammaMeasureDensity ℓ η a := by apply integral_mono_ae hconst hactual filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha exact (upperGammaVarianceDensity_pointwise_bounds (η := η) hℓ ha).1 have hupperIntegral : (∫ a : ℝ in Set.Ioi 0, a ^ 2 * upperGammaMeasureDensity ℓ η a) ≤ ∫ a : ℝ in Set.Ioi 0, (a + ℓ / 2) * Real.exp (-η * a) := by apply integral_mono_ae hactual hmajor filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha exact (upperGammaVarianceDensity_pointwise_bounds (η := η) hℓ ha).2 have hzerovalue : (∫ a : ℝ in Set.Ioi 0, Real.exp (-η * a)) = η⁻¹ := integral_laplaceKernel hη have hlinevalue : (∫ a : ℝ in Set.Ioi 0, a * Real.exp (-η * a)) = 1 / η ^ 2 := by simpa using! upper_laplace_monomial_integral hη 1 have hconstvalue : (∫ a : ℝ in Set.Ioi 0, (ℓ / 2) * Real.exp (-η * a)) = (ℓ / 2) * η⁻¹ := by rw [integral_const_mul, hzerovalue] have hmajorvalue : (∫ a : ℝ in Set.Ioi 0, (a + ℓ / 2) * Real.exp (-η * a)) = 1 / η ^ 2 + (ℓ / 2) * η⁻¹ := by calc (∫ a : ℝ in Set.Ioi 0, (a + ℓ / 2) * Real.exp (-η * a)) = ∫ a : ℝ in Set.Ioi 0, (a * Real.exp (-η * a) + (ℓ / 2) * Real.exp (-η * a)) := by apply setIntegral_congr_fun measurableSet_Ioi intro a ha ring _ = (∫ a : ℝ in Set.Ioi 0, a * Real.exp (-η * a)) + ∫ a : ℝ in Set.Ioi 0, (ℓ / 2) * Real.exp (-η * a) := integral_add hline hconst _ = 1 / η ^ 2 + (ℓ / 2) * η⁻¹ := by rw [hlinevalue, hconstvalue] have hℓinv : 0 ≤ ℓ⁻¹ := (inv_pos.mpr hℓ).le unfold upperGammaVariance constructor · calc 1 / (2 * η) = ℓ⁻¹ * ((ℓ / 2) * η⁻¹) := by field_simp [hℓ.ne', hη.ne'] _ = ℓ⁻¹ * (∫ a : ℝ in Set.Ioi 0, (ℓ / 2) * Real.exp (-η * a)) := by rw [hconstvalue] _ ≤ ℓ⁻¹ * (∫ a : ℝ in Set.Ioi 0, a ^ 2 * upperGammaMeasureDensity ℓ η a) := mul_le_mul_of_nonneg_left hlowerIntegral hℓinv · calc ℓ⁻¹ * (∫ a : ℝ in Set.Ioi 0, a ^ 2 * upperGammaMeasureDensity ℓ η a) ≤ ℓ⁻¹ * (∫ a : ℝ in Set.Ioi 0, (a + ℓ / 2) * Real.exp (-η * a)) := mul_le_mul_of_nonneg_left hupperIntegral hℓinv _ = ℓ⁻¹ * (1 / η ^ 2 + (ℓ / 2) * η⁻¹) := by rw [hmajorvalue] _ = 1 / (2 * η) + 1 / (ℓ * η ^ 2) := by field_simp [hℓ.ne', hη.ne']; ring theorem upperGammaThirdMoment_bounds {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) : 1 / (2 * η ^ 2) ≤ upperGammaThirdMoment ℓ η ∧ upperGammaThirdMoment ℓ η ≤ 1 / (2 * η ^ 2) + 2 / (ℓ * η ^ 3) := by have hline : IntegrableOn (fun a : ℝ => a * Real.exp (-η * a)) (Set.Ioi 0) := by simpa using! upper_laplace_monomial_integrable hη 1 have hquadratic : IntegrableOn (fun a : ℝ => a ^ 2 * Real.exp (-η * a)) (Set.Ioi 0) := upper_laplace_monomial_integrable hη 2 have hconst : IntegrableOn (fun a : ℝ => (ℓ / 2) * a * Real.exp (-η * a)) (Set.Ioi 0) := by have h : IntegrableOn (fun a : ℝ => (ℓ / 2) * (a * Real.exp (-η * a))) (Set.Ioi 0) := hline.const_mul (ℓ / 2) apply h.congr_fun _ measurableSet_Ioi intro a ha change (ℓ / 2) * (a * Real.exp (-η * a)) = (ℓ / 2) * a * Real.exp (-η * a) ring have hactual := upperGammaThirdMomentDensity_integrable hℓ hη have hmajor : IntegrableOn (fun a : ℝ => (a ^ 2 + (ℓ / 2) * a) * Real.exp (-η * a)) (Set.Ioi 0) := by apply (hquadratic.add hconst).congr_fun _ measurableSet_Ioi intro a ha change a ^ 2 * Real.exp (-η * a) + (ℓ / 2) * a * Real.exp (-η * a) = (a ^ 2 + (ℓ / 2) * a) * Real.exp (-η * a) ring have hlowerIntegral : (∫ a : ℝ in Set.Ioi 0, (ℓ / 2) * a * Real.exp (-η * a)) ≤ ∫ a : ℝ in Set.Ioi 0, a ^ 3 * upperGammaMeasureDensity ℓ η a := by apply integral_mono_ae hconst hactual filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha exact (upperGammaThirdMomentDensity_pointwise_bounds (η := η) hℓ ha).1 have hupperIntegral : (∫ a : ℝ in Set.Ioi 0, a ^ 3 * upperGammaMeasureDensity ℓ η a) ≤ ∫ a : ℝ in Set.Ioi 0, (a ^ 2 + (ℓ / 2) * a) * Real.exp (-η * a) := by apply integral_mono_ae hactual hmajor filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha exact (upperGammaThirdMomentDensity_pointwise_bounds (η := η) hℓ ha).2 have hlinevalue : (∫ a : ℝ in Set.Ioi 0, a * Real.exp (-η * a)) = 1 / η ^ 2 := by simpa using! upper_laplace_monomial_integral hη 1 have hquadraticvalue : (∫ a : ℝ in Set.Ioi 0, a ^ 2 * Real.exp (-η * a)) = 2 / η ^ 3 := by simpa using! upper_laplace_monomial_integral hη 2 have hconstvalue : (∫ a : ℝ in Set.Ioi 0, (ℓ / 2) * a * Real.exp (-η * a)) = (ℓ / 2) * (1 / η ^ 2) := by calc (∫ a : ℝ in Set.Ioi 0, (ℓ / 2) * a * Real.exp (-η * a)) = ∫ a : ℝ in Set.Ioi 0, (ℓ / 2) * (a * Real.exp (-η * a)) := by apply setIntegral_congr_fun measurableSet_Ioi intro a ha ring _ = (ℓ / 2) * (∫ a : ℝ in Set.Ioi 0, a * Real.exp (-η * a)) := by rw [integral_const_mul] _ = (ℓ / 2) * (1 / η ^ 2) := by rw [hlinevalue] have hmajorvalue : (∫ a : ℝ in Set.Ioi 0, (a ^ 2 + (ℓ / 2) * a) * Real.exp (-η * a)) = 2 / η ^ 3 + (ℓ / 2) * (1 / η ^ 2) := by calc (∫ a : ℝ in Set.Ioi 0, (a ^ 2 + (ℓ / 2) * a) * Real.exp (-η * a)) = ∫ a : ℝ in Set.Ioi 0, (a ^ 2 * Real.exp (-η * a) + (ℓ / 2) * a * Real.exp (-η * a)) := by apply setIntegral_congr_fun measurableSet_Ioi intro a ha ring _ = (∫ a : ℝ in Set.Ioi 0, a ^ 2 * Real.exp (-η * a)) + ∫ a : ℝ in Set.Ioi 0, (ℓ / 2) * a * Real.exp (-η * a) := integral_add hquadratic hconst _ = 2 / η ^ 3 + (ℓ / 2) * (1 / η ^ 2) := by rw [hquadraticvalue, hconstvalue] have hℓinv : 0 ≤ ℓ⁻¹ := (inv_pos.mpr hℓ).le unfold upperGammaThirdMoment constructor · calc 1 / (2 * η ^ 2) = ℓ⁻¹ * ((ℓ / 2) * (1 / η ^ 2)) := by field_simp [hℓ.ne', hη.ne'] _ = ℓ⁻¹ * (∫ a : ℝ in Set.Ioi 0, (ℓ / 2) * a * Real.exp (-η * a)) := by rw [hconstvalue] _ ≤ ℓ⁻¹ * (∫ a : ℝ in Set.Ioi 0, a ^ 3 * upperGammaMeasureDensity ℓ η a) := mul_le_mul_of_nonneg_left hlowerIntegral hℓinv · calc ℓ⁻¹ * (∫ a : ℝ in Set.Ioi 0, a ^ 3 * upperGammaMeasureDensity ℓ η a) ≤ ℓ⁻¹ * (∫ a : ℝ in Set.Ioi 0, (a ^ 2 + (ℓ / 2) * a) * Real.exp (-η * a)) := mul_le_mul_of_nonneg_left hupperIntegral hℓinv _ = ℓ⁻¹ * (2 / η ^ 3 + (ℓ / 2) * (1 / η ^ 2)) := by rw [hmajorvalue] _ = 1 / (2 * η ^ 2) + 2 / (ℓ * η ^ 3) := by field_simp [hℓ.ne', hη.ne']; ring theorem plusPolynomial_negative_imaginary_residue (ε s : ℝ) : plusPolynomial ε (Complex.I * ((-(1 + s) : ℝ) : ℂ)) = ((beta ε - s * (2 + s) ^ 2 : ℝ) : ℂ) := by rw [plusPolynomial_imaginary] push_cast ring def saddleShellDerivativeOne (ε : ℝ) : ℝ := (∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * a * Real.sinh a) + (∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * a * Real.sinh a) def saddleSmallRadiusVariable (ε r : ℝ) : ℝ := Real.pi * Real.exp (2 * saddleShellDerivativeOne ε) * r ^ 2 def plusSaddleSmallRadiusCoefficient (ε ℓ : ℝ) (n : ℕ) : ℝ := Real.exp (ℓ * (realHyperbolicShellPhase ε (1 + 2 * (n : ℝ) / ℓ) - realHyperbolicShellPhase ε 1) - 2 * (n : ℝ) * saddleShellDerivativeOne ε) * ((beta ε - (2 * (n : ℝ) / ℓ) * (2 + 2 * (n : ℝ) / ℓ) ^ 2) / beta ε) theorem plusSaddlePoleResidue_explicit_real {ε ℓ : ℝ} (hℓ : 0 < ℓ) (n : ℕ) : plusSaddlePoleResidue ε ℓ n = ((2 * (-1 : ℝ) ^ n / (n.factorial : ℝ) * (Real.pi ^ (ℓ / 2 + (n : ℝ)) * Real.exp (ℓ * realHyperbolicShellPhase ε (1 + 2 * (n : ℝ) / ℓ))) * (beta ε - (2 * (n : ℝ) / ℓ) * (2 + 2 * (n : ℝ) / ℓ) ^ 2) : ℝ) : ℂ) := by unfold plusSaddlePoleResidue rw [plusSaddleRegularMellinFactor_neg_even hℓ n, plusPolynomial_negative_imaginary_residue] push_cast ring theorem saddleSmallRadiusVariable_nonneg (ε r : ℝ) : 0 ≤ saddleSmallRadiusVariable ε r := by unfold saddleSmallRadiusVariable positivity theorem saddleSmallRadiusVariable_neg_pow (ε r : ℝ) (n : ℕ) : (-saddleSmallRadiusVariable ε r) ^ n = (-1 : ℝ) ^ n * Real.pi ^ n * Real.exp (2 * saddleShellDerivativeOne ε) ^ n * r ^ (2 * n) := by calc (-saddleSmallRadiusVariable ε r) ^ n = ((-1 : ℝ) * Real.pi * Real.exp (2 * saddleShellDerivativeOne ε) * r ^ 2) ^ n := by congr 1 unfold saddleSmallRadiusVariable ring _ = (-1 : ℝ) ^ n * Real.pi ^ n * Real.exp (2 * saddleShellDerivativeOne ε) ^ n * (r ^ 2) ^ n := by simp only [mul_pow] _ = (-1 : ℝ) ^ n * Real.pi ^ n * Real.exp (2 * saddleShellDerivativeOne ε) ^ n * r ^ (2 * n) := by rw [← pow_mul] theorem saddleSmallRadiusPhase_pole_factorization (ε ℓ : ℝ) (n : ℕ) : Real.exp (ℓ * realHyperbolicShellPhase ε (1 + 2 * (n : ℝ) / ℓ)) = Real.exp (ℓ * realHyperbolicShellPhase ε 1) * Real.exp (2 * saddleShellDerivativeOne ε) ^ n * Real.exp (ℓ * (realHyperbolicShellPhase ε (1 + 2 * (n : ℝ) / ℓ) - realHyperbolicShellPhase ε 1) - 2 * (n : ℝ) * saddleShellDerivativeOne ε) := by let H : ℝ := saddleShellDerivativeOne ε let p : ℝ := realHyperbolicShellPhase ε (1 + 2 * (n : ℝ) / ℓ) let p₀ : ℝ := realHyperbolicShellPhase ε 1 have harg : ℓ * p = ℓ * p₀ + (n : ℝ) * (2 * H) + (ℓ * (p - p₀) - 2 * (n : ℝ) * H) := by ring change Real.exp (ℓ * p) = Real.exp (ℓ * p₀) * Real.exp (2 * H) ^ n * Real.exp (ℓ * (p - p₀) - 2 * (n : ℝ) * H) rw [harg, Real.exp_add, Real.exp_add, Real.exp_nat_mul] theorem plusSaddlePoleResidue_mul_pow_eq_smallCoefficient {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (n : ℕ) (r : ℝ) : plusSaddlePoleResidue ε ℓ n * ((r ^ (2 * n) : ℝ) : ℂ) = ((saddleOriginValue ε ℓ * ((-saddleSmallRadiusVariable ε r) ^ n / (n.factorial : ℝ)) * plusSaddleSmallRadiusCoefficient ε ℓ n : ℝ) : ℂ) := by have hb : beta ε ≠ 0 := (beta_pos hε).ne' have hfac : (n.factorial : ℝ) ≠ 0 := by exact_mod_cast (Nat.factorial_ne_zero n) have hpi : Real.pi ^ (ℓ / 2 + (n : ℝ)) = Real.pi ^ (ℓ / 2) * Real.pi ^ n := Real.rpow_add_natCast Real.pi_ne_zero (ℓ / 2) n have hphase := saddleSmallRadiusPhase_pole_factorization ε ℓ n have hy := saddleSmallRadiusVariable_neg_pow ε r n rw [plusSaddlePoleResidue_explicit_real hℓ n, ← Complex.ofReal_mul] apply congrArg Complex.ofReal unfold saddleOriginValue plusSaddleSmallRadiusCoefficient rw [hpi, hphase, hy] field_simp [hb, hfac] theorem plusSaddleProfile_eq_small_radius_residue_series {ε ℓ r : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (N : ℕ) : plusSaddleProfile ε ℓ r = (saddleOriginValue ε ℓ : ℂ) * ((∑ n ∈ Finset.range (N + 1), (-saddleSmallRadiusVariable ε r) ^ n / (n.factorial : ℝ) * plusSaddleSmallRadiusCoefficient ε ℓ n : ℝ) : ℂ) + plusSaddleTaylorRemainder ε ℓ N r := by rw [plusSaddleProfile_eq_residue_sum_add_remainder hε hℓ horder hr N] congr 1 push_cast rw [Finset.mul_sum] apply Finset.sum_congr rfl intro n hn have hterm := plusSaddlePoleResidue_mul_pow_eq_smallCoefficient hε hℓ n r push_cast at hterm simpa only [mul_assoc] using! hterm theorem plusSaddleProfile_div_origin_eq_small_radius_residue_series {ε ℓ r : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (N : ℕ) : plusSaddleProfile ε ℓ r / (saddleOriginValue ε ℓ : ℂ) = ((∑ n ∈ Finset.range (N + 1), (-saddleSmallRadiusVariable ε r) ^ n / (n.factorial : ℝ) * plusSaddleSmallRadiusCoefficient ε ℓ n : ℝ) : ℂ) + plusSaddleTaylorRemainder ε ℓ N r / (saddleOriginValue ε ℓ : ℂ) := by have hzero : (saddleOriginValue ε ℓ : ℂ) ≠ 0 := by exact_mod_cast (saddleOriginValue_pos hε ℓ).ne' rw [plusSaddleProfile_eq_small_radius_residue_series hε hℓ horder hr N] field_simp [hzero] theorem realHyperbolicShellPhase_contDiff {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (n : WithTop ℕ∞) : ContDiff ℝ n (realHyperbolicShellPhase ε) := by have hcomplex : ContDiff ℝ n (mellinShellPhase ε) := ((mellinShellPhase_analyticOnNhd hε horder).restrictScalars (𝕜 := ℝ)).contDiff have harg : ContDiff ℝ n (fun u : ℝ => Complex.I * (u : ℂ)) := by exact contDiff_const.mul Complex.ofRealCLM.contDiff have hphase : ContDiff ℝ n (fun u : ℝ => mellinShellPhase ε (Complex.I * (u : ℂ))) := by simpa only [Function.comp_apply] using! hcomplex.comp harg have hre : ContDiff ℝ n (fun u : ℝ => (mellinShellPhase ε (Complex.I * (u : ℂ))).re) := by simpa only [Function.comp_apply] using! Complex.reCLM.contDiff.comp hphase simpa only [mellinShellPhase_imaginary, Complex.ofReal_re] using! hre theorem realHyperbolicShellInterval_hasDerivAt (w : ℝ → ℝ) (hw : Continuous w) {a b : ℝ} (hab : a ≤ b) (u : ℝ) : HasDerivAt (fun v : ℝ => ∫ x in a..b, w x * (Real.cosh (x * v) - 1)) (∫ x in a..b, w x * x * Real.sinh (x * u)) u := by let F : ℝ → ℝ → ℝ := fun v x => w x * (Real.cosh (x * v) - 1) let F' : ℝ → ℝ → ℝ := fun v x => w x * x * Real.sinh (x * v) have hF (v : ℝ) : Continuous (F v) := by try dsimp [F] exact hw.mul ((Real.continuous_cosh.comp (continuous_id.mul continuous_const)).sub continuous_const) have hF' (v : ℝ) : Continuous (F' v) := by try dsimp [F'] exact (hw.mul continuous_id).mul (Real.continuous_sinh.comp (continuous_id.mul continuous_const)) have hF'joint : Continuous (Function.uncurry F') := by try dsimp [F', Function.uncurry] exact ((hw.comp continuous_snd).mul continuous_snd).mul (Real.continuous_sinh.comp (continuous_snd.mul continuous_fst)) have hderiv (x v : ℝ) : HasDerivAt (fun z : ℝ => F z x) (F' v x) v := by have hlinear : HasDerivAt (fun z : ℝ => x * z) x v := by simpa using! (hasDerivAt_id v).const_mul x have hcosh := (Real.hasDerivAt_cosh (x * v)).comp v hlinear simpa [F, F', mul_assoc, mul_left_comm, mul_comm] using! (hcosh.sub_const (1 : ℝ)).const_mul (w x) have hrewrite : (fun v : ℝ => ∫ x in a..b, w x * (Real.cosh (x * v) - 1)) = (fun v : ℝ => ∫ x in Set.Icc a b, F v x) := by funext v rw [intervalIntegral.integral_of_le hab, ← integral_Icc_eq_integral_Ioc] have hderivrewrite : (∫ x in a..b, w x * x * Real.sinh (x * u)) = (∫ x in Set.Icc a b, F' u x) := by rw [intervalIntegral.integral_of_le hab, ← integral_Icc_eq_integral_Ioc] rw [hrewrite, hderivrewrite] have hcompact : IsCompact (Metric.closedBall u 1 ×ˢ Set.Icc a b) := (isCompact_closedBall u 1).prod isCompact_Icc obtain ⟨C, hC⟩ := hcompact.bddAbove_image hF'joint.norm.continuousOn have hbound : ∀ᵐ x ∂volume.restrict (Set.Icc a b), ∀ v ∈ Metric.ball u 1, ‖F' v x‖ ≤ C := by filter_upwards [ae_restrict_mem measurableSet_Icc] with x hx intro v hv have hpair : (v, x) ∈ Metric.closedBall u 1 ×ˢ Set.Icc a b := ⟨Metric.ball_subset_closedBall hv, hx⟩ exact hC (Set.mem_image_of_mem (fun p : ℝ × ℝ => ‖F' p.1 p.2‖) hpair) have hmeas : ∀ᶠ v in 𝓝 u, AEStronglyMeasurable (F v) (volume.restrict (Set.Icc a b)) := Eventually.of_forall (fun v => (hF v).aestronglyMeasurable) have hint : Integrable (F u) (volume.restrict (Set.Icc a b)) := (hF u).integrableOn_Icc have hderivmeas : AEStronglyMeasurable (F' u) (volume.restrict (Set.Icc a b)) := (hF' u).aestronglyMeasurable have hconstant : Integrable (fun _ : ℝ => C) (volume.restrict (Set.Icc a b)) := integrableOn_const isCompact_Icc.measure_ne_top have hdifferentiable : ∀ᵐ x ∂volume.restrict (Set.Icc a b), ∀ v ∈ Metric.ball u 1, HasDerivAt (fun z : ℝ => F z x) (F' v x) v := Eventually.of_forall (fun x v _ => hderiv x v) exact (hasDerivAt_integral_of_dominated_loc_of_deriv_le (μ := volume.restrict (Set.Icc a b)) (s := Metric.ball u 1) (bound := fun _ : ℝ => C) (Metric.ball_mem_nhds u zero_lt_one) hmeas hint hderivmeas hbound hconstant hdifferentiable).2 theorem realHyperbolicShellPhase_hasDerivAt {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (u : ℝ) : HasDerivAt (realHyperbolicShellPhase ε) ((∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * a * Real.sinh (a * u)) + (∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * a * Real.sinh (a * u))) u := by have hcutoff : 0 < shortCutoff ε := by unfold shortCutoff positivity let w : ℝ → ℝ := fun a => shortShellDensity ε (max a (shortCutoff ε)) have hmax (a : ℝ) : 0 < max a (shortCutoff ε) := hcutoff.trans_le (le_max_right _ _) have hw : Continuous w := by have hn : Continuous (fun a : ℝ => shortMargin ε (max a (shortCutoff ε)) * Real.exp (-2 * max a (shortCutoff ε))) := by unfold shortMargin fun_prop have hd : Continuous (fun a : ℝ => 2 * (max a (shortCutoff ε)) ^ 2 * Real.cosh (max a (shortCutoff ε))) := by fun_prop try dsimp [w] unfold shortShellDensity exact (hn.div hd (fun a => by positivity [hmax a])).neg have hshortfun : (fun v : ℝ => ∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * (Real.cosh (a * v) - 1)) = (fun v : ℝ => ∫ a in shortCutoff ε..shortEndpoint ε, w a * (Real.cosh (a * v) - 1)) := by funext v apply intervalIntegral.integral_congr intro a ha rw [uIcc_of_le horder] at ha try dsimp [w] rw [max_eq_left ha.1] have hshortderiv : (∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * a * Real.sinh (a * u)) = (∫ a in shortCutoff ε..shortEndpoint ε, w a * a * Real.sinh (a * u)) := by apply intervalIntegral.integral_congr intro a ha rw [uIcc_of_le horder] at ha try dsimp [w] rw [max_eq_left ha.1] have hshort : HasDerivAt (fun v : ℝ => ∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * (Real.cosh (a * v) - 1)) (∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * a * Real.sinh (a * u)) u := by rw [hshortfun, hshortderiv] exact realHyperbolicShellInterval_hasDerivAt w hw horder u have hremote : shellLocation ε ≤ shellLocation ε + 1 := by linarith have hpositive := realHyperbolicShellInterval_hasDerivAt (positiveShellDensity ε) (positiveShellDensity_continuous ε) hremote u exact hshort.add hpositive theorem realHyperbolicShellPhase_hasDerivAt_one {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : HasDerivAt (realHyperbolicShellPhase ε) (saddleShellDerivativeOne ε) 1 := by simpa [saddleShellDerivativeOne] using! realHyperbolicShellPhase_hasDerivAt hε horder 1 theorem exists_realHyperbolicShellPhase_quadratic_remainder {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : ∃ C : ℝ, 0 ≤ C ∧ ∀ x ∈ Set.Icc (1 : ℝ) 2, |realHyperbolicShellPhase ε x - realHyperbolicShellPhase ε 1 - (x - 1) * saddleShellDerivativeOne ε| ≤ C * (x - 1) ^ 2 := by have hcont : ContDiffOn ℝ (2 : WithTop ℕ∞) (realHyperbolicShellPhase ε) (Set.Icc 1 2) := (realHyperbolicShellPhase_contDiff hε horder (2 : WithTop ℕ∞)).contDiffOn obtain ⟨C, hC⟩ := exists_taylor_mean_remainder_bound (f := realHyperbolicShellPhase ε) (n := 1) (by norm_num : (1 : ℝ) ≤ 2) hcont have hwithin : derivWithin (realHyperbolicShellPhase ε) (Set.Icc (1 : ℝ) 2) 1 = saddleShellDerivativeOne ε := by have hdwithin : HasDerivWithinAt (realHyperbolicShellPhase ε) (saddleShellDerivativeOne ε) (Set.Icc (1 : ℝ) 2) 1 := HasDerivAt.hasDerivWithinAt (realHyperbolicShellPhase_hasDerivAt_one hε horder) exact HasDerivWithinAt.derivWithin hdwithin ((uniqueDiffOn_Icc (by norm_num : (1 : ℝ) < 2)) 1 (by constructor <;> norm_num)) have htaylor (x : ℝ) : taylorWithinEval (realHyperbolicShellPhase ε) 1 (Set.Icc (1 : ℝ) 2) 1 x = realHyperbolicShellPhase ε 1 + (x - 1) * saddleShellDerivativeOne ε := by simp [taylorWithinEval_succ, iteratedDerivWithin_one, hwithin, smul_eq_mul] refine ⟨max C 0, le_max_right _ _, ?_⟩ intro x hx have hxbound := hC x hx rw [htaylor x, Real.norm_eq_abs] at hxbound calc |realHyperbolicShellPhase ε x - realHyperbolicShellPhase ε 1 - (x - 1) * saddleShellDerivativeOne ε| = |realHyperbolicShellPhase ε x - (realHyperbolicShellPhase ε 1 + (x - 1) * saddleShellDerivativeOne ε)| := by congr 1 ring _ ≤ C * (x - 1) ^ 2 := hxbound _ ≤ max C 0 * (x - 1) ^ 2 := mul_le_mul_of_nonneg_right (le_max_left _ _) (sq_nonneg _) theorem exists_plusSaddleSmallRadiusPhase_error {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : ∃ C : ℝ, 0 ≤ C ∧ ∀ (ℓ : ℝ), 0 < ℓ → ∀ n : ℕ, 2 * (n : ℝ) ≤ ℓ → |ℓ * (realHyperbolicShellPhase ε (1 + 2 * (n : ℝ) / ℓ) - realHyperbolicShellPhase ε 1) - 2 * (n : ℝ) * saddleShellDerivativeOne ε| ≤ C * (n : ℝ) ^ 2 / ℓ := by obtain ⟨C, hCnonneg, hC⟩ := exists_realHyperbolicShellPhase_quadratic_remainder hε horder refine ⟨4 * C, by positivity, ?_⟩ intro ℓ hℓ n hn let x : ℝ := 1 + 2 * (n : ℝ) / ℓ have hratio : 0 ≤ 2 * (n : ℝ) / ℓ := by positivity have hratioupper : 2 * (n : ℝ) / ℓ ≤ 1 := (div_le_iff₀ hℓ).mpr (by simpa using! hn) have hx : x ∈ Set.Icc (1 : ℝ) 2 := by constructor <;> dsimp [x] <;> linarith have hscale : ℓ * (x - 1) = 2 * (n : ℝ) := by try dsimp [x] field_simp; ring have hidentity : ℓ * (realHyperbolicShellPhase ε x - realHyperbolicShellPhase ε 1) - 2 * (n : ℝ) * saddleShellDerivativeOne ε = ℓ * (realHyperbolicShellPhase ε x - realHyperbolicShellPhase ε 1 - (x - 1) * saddleShellDerivativeOne ε) := by rw [← hscale] ring change |ℓ * (realHyperbolicShellPhase ε x - realHyperbolicShellPhase ε 1) - 2 * (n : ℝ) * saddleShellDerivativeOne ε| ≤ (4 * C) * (n : ℝ) ^ 2 / ℓ calc |ℓ * (realHyperbolicShellPhase ε x - realHyperbolicShellPhase ε 1) - 2 * (n : ℝ) * saddleShellDerivativeOne ε| = ℓ * |realHyperbolicShellPhase ε x - realHyperbolicShellPhase ε 1 - (x - 1) * saddleShellDerivativeOne ε| := by rw [hidentity, abs_mul, abs_of_pos hℓ] _ ≤ ℓ * (C * (x - 1) ^ 2) := mul_le_mul_of_nonneg_left (hC x hx) hℓ.le _ = (4 * C) * (n : ℝ) ^ 2 / ℓ := by try dsimp [x] field_simp; ring theorem plusSaddleSmallRadiusPolynomial_error {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (n : ℕ) (hn : 2 * (n : ℝ) ≤ ℓ) : |((beta ε - (2 * (n : ℝ) / ℓ) * (2 + 2 * (n : ℝ) / ℓ) ^ 2) / beta ε) - 1| ≤ (18 / beta ε) * ((n : ℝ) / ℓ) := by have hb : 0 < beta ε := beta_pos hε let s : ℝ := 2 * (n : ℝ) / ℓ have hs : 0 ≤ s := by try dsimp [s] positivity have hsone : s ≤ 1 := by try dsimp [s] exact (div_le_iff₀ hℓ).mpr (by simpa using! hn) have hsquare : (2 + s) ^ 2 ≤ 9 := by nlinarith [mul_nonneg (show 0 ≤ 3 - (2 + s) by linarith) (show 0 ≤ 3 + (2 + s) by linarith)] have hnumerator : 0 ≤ s * (2 + s) ^ 2 := mul_nonneg hs (sq_nonneg _) change |(beta ε - s * (2 + s) ^ 2) / beta ε - 1| ≤ (18 / beta ε) * ((n : ℝ) / ℓ) have hid : (beta ε - s * (2 + s) ^ 2) / beta ε - 1 = -(s * (2 + s) ^ 2) / beta ε := by field_simp; ring rw [hid, abs_div, abs_neg, abs_of_nonneg hnumerator, abs_of_pos hb] calc s * (2 + s) ^ 2 / beta ε ≤ s * 9 / beta ε := by gcongr _ = (18 / beta ε) * ((n : ℝ) / ℓ) := by try dsimp [s] field_simp; ring theorem abs_exp_sub_one_le_abs_mul_exp_abs (t : ℝ) : |Real.exp t - 1| ≤ |t| * Real.exp |t| := by rcases le_total 0 t with ht | ht · have hexp : 1 ≤ Real.exp t := by simpa using! Real.exp_le_exp.mpr ht rw [abs_of_nonneg (sub_nonneg.mpr hexp), abs_of_nonneg ht] have hsupport := Real.add_one_le_exp (-t) have hmul := mul_le_mul_of_nonneg_left hsupport (Real.exp_pos t).le have hcancel : Real.exp t * Real.exp (-t) = 1 := by rw [← Real.exp_add] simp rw [hcancel] at hmul nlinarith · have hexp : Real.exp t ≤ 1 := by simpa using! Real.exp_le_exp.mpr ht have hnegt : 0 ≤ -t := neg_nonneg.mpr ht have hexpneg : 1 ≤ Real.exp (-t) := by simpa using! Real.exp_le_exp.mpr hnegt rw [abs_of_nonpos (sub_nonpos.mpr hexp), abs_of_nonpos ht] have hsupport := Real.add_one_le_exp t have hlinear : 1 - Real.exp t ≤ -t := by linarith calc -(Real.exp t - 1) = 1 - Real.exp t := by ring _ ≤ -t := hlinear _ ≤ -t * Real.exp (-t) := by nlinarith [mul_nonneg hnegt (sub_nonneg.mpr hexpneg)] theorem plusSaddleSmallRadiusCoefficient_error_of_phase {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (n : ℕ) (hn : 2 * (n : ℝ) ≤ ℓ) (C : ℝ) (hC : 0 ≤ C) (hphase : |ℓ * (realHyperbolicShellPhase ε (1 + 2 * (n : ℝ) / ℓ) - realHyperbolicShellPhase ε 1) - 2 * (n : ℝ) * saddleShellDerivativeOne ε| ≤ C * (n : ℝ) ^ 2 / ℓ) : |plusSaddleSmallRadiusCoefficient ε ℓ n - 1| ≤ (C * (n : ℝ) ^ 2 / ℓ + (18 / beta ε) * ((n : ℝ) / ℓ)) * Real.exp (C * (n : ℝ) ^ 2 / ℓ) := by let E : ℝ := ℓ * (realHyperbolicShellPhase ε (1 + 2 * (n : ℝ) / ℓ) - realHyperbolicShellPhase ε 1) - 2 * (n : ℝ) * saddleShellDerivativeOne ε let P : ℝ := (beta ε - (2 * (n : ℝ) / ℓ) * (2 + 2 * (n : ℝ) / ℓ) ^ 2) / beta ε let q : ℝ := C * (n : ℝ) ^ 2 / ℓ let k : ℝ := (18 / beta ε) * ((n : ℝ) / ℓ) have hq : 0 ≤ q := by try dsimp [q] positivity have hk : 0 ≤ k := by try dsimp [k] positivity [beta_pos hε] have hE : |E| ≤ q := by simpa [E, q] using! hphase have hP : |P - 1| ≤ k := by simpa [P, k] using! plusSaddleSmallRadiusPolynomial_error hε hℓ n hn have hexp : Real.exp E ≤ Real.exp q := Real.exp_le_exp.mpr ((le_abs_self E).trans hE) have hexpabs : Real.exp |E| ≤ Real.exp q := Real.exp_le_exp.mpr hE have htermP : |Real.exp E * (P - 1)| ≤ Real.exp q * k := by rw [abs_mul, abs_of_pos (Real.exp_pos E)] exact mul_le_mul hexp hP (abs_nonneg _) (Real.exp_pos q).le have htermE : |Real.exp E - 1| ≤ q * Real.exp q := (abs_exp_sub_one_le_abs_mul_exp_abs E).trans (mul_le_mul hE hexpabs (Real.exp_pos |E|).le hq) change |Real.exp E * P - 1| ≤ (q + k) * Real.exp q calc |Real.exp E * P - 1| = |Real.exp E * (P - 1) + (Real.exp E - 1)| := by congr 1 ring _ ≤ |Real.exp E * (P - 1)| + |Real.exp E - 1| := abs_add_le _ _ _ ≤ Real.exp q * k + q * Real.exp q := add_le_add htermP htermE _ = (q + k) * Real.exp q := by ring theorem exists_plusSaddleSmallRadiusCoefficient_error {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : ∃ C : ℝ, 0 ≤ C ∧ ∀ (ℓ : ℝ), 0 < ℓ → ∀ n : ℕ, 2 * (n : ℝ) ≤ ℓ → |plusSaddleSmallRadiusCoefficient ε ℓ n - 1| ≤ (C * ((n : ℝ) + (n : ℝ) ^ 2) / ℓ) * Real.exp (C * (n : ℝ) ^ 2 / ℓ) := by obtain ⟨C, hC, hphase⟩ := exists_plusSaddleSmallRadiusPhase_error hε horder let K : ℝ := 18 / beta ε have hK : 0 ≤ K := by try dsimp [K] positivity [beta_pos hε] refine ⟨C + K, add_nonneg hC hK, ?_⟩ intro ℓ hℓ n hn have hsource := plusSaddleSmallRadiusCoefficient_error_of_phase hε hℓ n hn C hC (hphase ℓ hℓ n hn) have hnreal : 0 ≤ (n : ℝ) := by positivity have hpoly : C * (n : ℝ) ^ 2 / ℓ + K * ((n : ℝ) / ℓ) ≤ (C + K) * ((n : ℝ) + (n : ℝ) ^ 2) / ℓ := by rw [show C * (n : ℝ) ^ 2 / ℓ + K * ((n : ℝ) / ℓ) = (C * (n : ℝ) ^ 2 + K * (n : ℝ)) / ℓ by ring] apply (div_le_div_iff_of_pos_right hℓ).mpr nlinarith [mul_nonneg hC hnreal, mul_nonneg hK (sq_nonneg (n : ℝ))] have hq : C * (n : ℝ) ^ 2 / ℓ ≤ (C + K) * (n : ℝ) ^ 2 / ℓ := by gcongr exact le_add_of_nonneg_right hK have hright : 0 ≤ (C + K) * ((n : ℝ) + (n : ℝ) ^ 2) / ℓ := by positivity calc |plusSaddleSmallRadiusCoefficient ε ℓ n - 1| ≤ (C * (n : ℝ) ^ 2 / ℓ + K * ((n : ℝ) / ℓ)) * Real.exp (C * (n : ℝ) ^ 2 / ℓ) := by simpa [K] using! hsource _ ≤ ((C + K) * ((n : ℝ) + (n : ℝ) ^ 2) / ℓ) * Real.exp ((C + K) * (n : ℝ) ^ 2 / ℓ) := mul_le_mul hpoly (Real.exp_le_exp.mpr hq) (Real.exp_pos _).le hright theorem saddleExpSeries_hasSum (y : ℝ) : HasSum (fun n : ℕ => y ^ n / (n.factorial : ℝ)) (Real.exp y) := by rw [Real.exp_eq_exp_ℝ] exact NormedSpace.expSeries_div_hasSum_exp y theorem saddleExpSeries_firstMoment_hasSum (y : ℝ) : HasSum (fun n : ℕ => (n : ℝ) * (y ^ n / (n.factorial : ℝ))) (y * Real.exp y) := by let f : ℕ → ℝ := fun n => (n : ℝ) * (y ^ n / (n.factorial : ℝ)) have hshift : (fun n : ℕ => f (n + 1)) = (fun n : ℕ => y * (y ^ n / (n.factorial : ℝ))) := by funext n try dsimp [f] rw [Nat.factorial_succ, pow_succ] push_cast have hn : (n : ℝ) + 1 ≠ 0 := by positivity have hfact : (n.factorial : ℝ) ≠ 0 := by exact_mod_cast Nat.factorial_ne_zero n field_simp have htail : HasSum (fun n : ℕ => f (n + 1)) (y * Real.exp y) := by rw [hshift] exact (saddleExpSeries_hasSum y).mul_left y simpa [f] using! htail.zero_add theorem saddleExpSeries_secondFallingMoment_hasSum (y : ℝ) : HasSum (fun n : ℕ => (n : ℝ) * ((n : ℝ) - 1) * (y ^ n / (n.factorial : ℝ))) (y ^ 2 * Real.exp y) := by let f : ℕ → ℝ := fun n => (n : ℝ) * ((n : ℝ) - 1) * (y ^ n / (n.factorial : ℝ)) have hshift : (fun n : ℕ => f (n + 2)) = (fun n : ℕ => y ^ 2 * (y ^ n / (n.factorial : ℝ))) := by funext n try dsimp [f] rw [show n + 2 = (n + 1) + 1 by omega, Nat.factorial_succ, Nat.factorial_succ, pow_succ, pow_succ] push_cast have hn : (n : ℝ) + 1 ≠ 0 := by positivity have hn' : (n : ℝ) + 1 + 1 ≠ 0 := by positivity have hfact : (n.factorial : ℝ) ≠ 0 := by exact_mod_cast Nat.factorial_ne_zero n field_simp; ring have htail : HasSum (fun n : ℕ => f (n + 2)) (y ^ 2 * Real.exp y) := by rw [hshift] exact (saddleExpSeries_hasSum y).mul_left (y ^ 2) have hfull := htail.sum_range_add simpa [f, Finset.sum_range_succ] using! hfull theorem saddleExpSeries_polynomialMoment_hasSum (y : ℝ) : HasSum (fun n : ℕ => ((n : ℝ) + (n : ℝ) ^ 2) * (y ^ n / (n.factorial : ℝ))) ((2 * y + y ^ 2) * Real.exp y) := by have hfirst := (saddleExpSeries_firstMoment_hasSum y).mul_left 2 have hsecond := saddleExpSeries_secondFallingMoment_hasSum y have hcombined := hfirst.add hsecond convert! hcombined using 1 · funext n ring · ring theorem saddleExpSeries_polynomialMoment_sum_range_le {y : ℝ} (hy : 0 ≤ y) (N : ℕ) : (∑ n ∈ Finset.range N, ((n : ℝ) + (n : ℝ) ^ 2) * (y ^ n / (n.factorial : ℝ))) ≤ (2 * y + y ^ 2) * Real.exp y := by exact sum_le_hasSum (Finset.range N) (fun n _ => by positivity) (saddleExpSeries_polynomialMoment_hasSum y) theorem exists_plusSaddleSmallRadius_weightedCoefficient_error {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : ∃ C : ℝ, 0 ≤ C ∧ ∀ (ℓ : ℝ), 0 < ℓ → ∀ N : ℕ, 2 * (N : ℝ) ≤ ℓ → ∀ y : ℝ, 0 ≤ y → (∑ n ∈ Finset.range (N + 1), (y ^ n / (n.factorial : ℝ)) * |plusSaddleSmallRadiusCoefficient ε ℓ n - 1|) ≤ (C / ℓ) * Real.exp (C * (N : ℝ) ^ 2 / ℓ) * (2 * y + y ^ 2) * Real.exp y := by obtain ⟨C, hC, hcoeff⟩ := exists_plusSaddleSmallRadiusCoefficient_error hε horder refine ⟨C, hC, ?_⟩ intro ℓ hℓ N hN y hy have hnonneg : 0 ≤ (C / ℓ) * Real.exp (C * (N : ℝ) ^ 2 / ℓ) := by positivity calc (∑ n ∈ Finset.range (N + 1), (y ^ n / (n.factorial : ℝ)) * |plusSaddleSmallRadiusCoefficient ε ℓ n - 1|) ≤ ∑ n ∈ Finset.range (N + 1), ((C / ℓ) * Real.exp (C * (N : ℝ) ^ 2 / ℓ)) * (((n : ℝ) + (n : ℝ) ^ 2) * (y ^ n / (n.factorial : ℝ))) := by apply Finset.sum_le_sum intro n hn have hnN : n ≤ N := Nat.lt_succ_iff.mp (Finset.mem_range.mp hn) have hnNreal : (n : ℝ) ≤ (N : ℝ) := by exact_mod_cast hnN have hnpole : 2 * (n : ℝ) ≤ ℓ := (mul_le_mul_of_nonneg_left hnNreal (by norm_num)).trans hN have hbound := hcoeff ℓ hℓ n hnpole have hterm : 0 ≤ y ^ n / (n.factorial : ℝ) := by positivity have hq : C * (n : ℝ) ^ 2 / ℓ ≤ C * (N : ℝ) ^ 2 / ℓ := by gcongr have hbase : 0 ≤ C * ((n : ℝ) + (n : ℝ) ^ 2) / ℓ := by positivity calc (y ^ n / (n.factorial : ℝ)) * |plusSaddleSmallRadiusCoefficient ε ℓ n - 1| ≤ (y ^ n / (n.factorial : ℝ)) * ((C * ((n : ℝ) + (n : ℝ) ^ 2) / ℓ) * Real.exp (C * (n : ℝ) ^ 2 / ℓ)) := mul_le_mul_of_nonneg_left hbound hterm _ ≤ (y ^ n / (n.factorial : ℝ)) * ((C * ((n : ℝ) + (n : ℝ) ^ 2) / ℓ) * Real.exp (C * (N : ℝ) ^ 2 / ℓ)) := by gcongr _ = ((C / ℓ) * Real.exp (C * (N : ℝ) ^ 2 / ℓ)) * (((n : ℝ) + (n : ℝ) ^ 2) * (y ^ n / (n.factorial : ℝ))) := by ring _ = ((C / ℓ) * Real.exp (C * (N : ℝ) ^ 2 / ℓ)) * (∑ n ∈ Finset.range (N + 1), ((n : ℝ) + (n : ℝ) ^ 2) * (y ^ n / (n.factorial : ℝ))) := by rw [Finset.mul_sum] _ ≤ ((C / ℓ) * Real.exp (C * (N : ℝ) ^ 2 / ℓ)) * ((2 * y + y ^ 2) * Real.exp y) := mul_le_mul_of_nonneg_left (saddleExpSeries_polynomialMoment_sum_range_le hy (N + 1)) hnonneg _ = (C / ℓ) * Real.exp (C * (N : ℝ) ^ 2 / ℓ) * (2 * y + y ^ 2) * Real.exp y := by ring theorem saddleExpSeries_tail_term_le_geometric {y : ℝ} (hy : 0 ≤ y) (m : ℕ) (hym : 2 * y ≤ (m : ℝ) + 1) (k : ℕ) : y ^ (m + k) / ((m + k).factorial : ℝ) ≤ (y ^ m / (m.factorial : ℝ)) * ((1 / 2 : ℝ) ^ k) := by induction k with | zero => simp | succ k ih => have hden : 0 < ((m + k + 1 : ℕ) : ℝ) := by exact_mod_cast (show 0 < m + k + 1 by omega) have hdenlarge : (m : ℝ) + 1 ≤ ((m + k + 1 : ℕ) : ℝ) := by exact_mod_cast (show m + 1 ≤ m + k + 1 by omega) have hratio : y / ((m + k + 1 : ℕ) : ℝ) ≤ (1 / 2 : ℝ) := by apply (div_le_iff₀ hden).mpr nlinarith have hstep : y ^ (m + (k + 1)) / ((m + (k + 1)).factorial : ℝ) = (y ^ (m + k) / ((m + k).factorial : ℝ)) * (y / ((m + k + 1 : ℕ) : ℝ)) := by rw [show m + (k + 1) = (m + k) + 1 by omega, Nat.factorial_succ, pow_succ] push_cast have hfact : ((m + k).factorial : ℝ) ≠ 0 := by exact_mod_cast Nat.factorial_ne_zero (m + k) field_simp calc y ^ (m + (k + 1)) / ((m + (k + 1)).factorial : ℝ) = (y ^ (m + k) / ((m + k).factorial : ℝ)) * (y / ((m + k + 1 : ℕ) : ℝ)) := hstep _ ≤ ((y ^ m / (m.factorial : ℝ)) * ((1 / 2 : ℝ) ^ k)) * (1 / 2 : ℝ) := by exact mul_le_mul ih hratio (by positivity) (by positivity) _ = (y ^ m / (m.factorial : ℝ)) * ((1 / 2 : ℝ) ^ (k + 1)) := by rw [pow_succ] ring theorem saddleExpSeries_alternating_tail_bound {y : ℝ} (hy : 0 ≤ y) (m : ℕ) (hym : 2 * y ≤ (m : ℝ) + 1) : |Real.exp (-y) - (∑ n ∈ Finset.range m, (-y) ^ n / (n.factorial : ℝ))| ≤ 2 * (y ^ m / (m.factorial : ℝ)) := by let f : ℕ → ℝ := fun n => (-y) ^ n / (n.factorial : ℝ) have hwhole : HasSum f (Real.exp (-y)) := saddleExpSeries_hasSum (-y) have htail : Summable (fun n : ℕ => f (n + m)) := (summable_nat_add_iff m).mpr hwhole.summable have hnorm : Summable (fun n : ℕ => ‖f (n + m)‖) := htail.norm have hgeometric : Summable (fun n : ℕ => (1 / 2 : ℝ) ^ n) := by apply summable_geometric_of_norm_lt_one norm_num have hmajor : Summable (fun n : ℕ => (y ^ m / (m.factorial : ℝ)) * ((1 / 2 : ℝ) ^ n)) := hgeometric.mul_left (y ^ m / (m.factorial : ℝ)) have hdecomp : (∑ n ∈ Finset.range m, f n) + (∑' n : ℕ, f (n + m)) = Real.exp (-y) := HasSum.unique htail.hasSum.sum_range_add hwhole have htermnorm (n : ℕ) : ‖f (n + m)‖ = y ^ (m + n) / ((m + n).factorial : ℝ) := by try dsimp [f] rw [abs_div, abs_pow, abs_neg, abs_of_nonneg hy] have hfact : 0 < ((n + m).factorial : ℝ) := by exact_mod_cast Nat.factorial_pos (n + m) rw [abs_of_pos hfact] simp [Nat.add_comm] have hterms (n : ℕ) : ‖f (n + m)‖ ≤ (y ^ m / (m.factorial : ℝ)) * ((1 / 2 : ℝ) ^ n) := by rw [htermnorm n] exact saddleExpSeries_tail_term_le_geometric hy m hym n change |Real.exp (-y) - (∑ n ∈ Finset.range m, f n)| ≤ 2 * (y ^ m / (m.factorial : ℝ)) have hidentity : Real.exp (-y) - (∑ n ∈ Finset.range m, f n) = ∑' n : ℕ, f (n + m) := by linarith calc |Real.exp (-y) - (∑ n ∈ Finset.range m, f n)| = ‖∑' n : ℕ, f (n + m)‖ := by rw [Real.norm_eq_abs, hidentity] _ ≤ ∑' n : ℕ, ‖f (n + m)‖ := norm_tsum_le_tsum_norm hnorm _ ≤ ∑' n : ℕ, (y ^ m / (m.factorial : ℝ)) * ((1 / 2 : ℝ) ^ n) := Summable.tsum_le_tsum hterms hnorm hmajor _ = (y ^ m / (m.factorial : ℝ)) * (∑' n : ℕ, (1 / 2 : ℝ) ^ n) := tsum_mul_left _ = 2 * (y ^ m / (m.factorial : ℝ)) := by rw [tsum_geometric_of_lt_one (by norm_num : (0 : ℝ) ≤ 1 / 2) (by norm_num : (1 / 2 : ℝ) < 1)] norm_num; ring theorem exists_plusSaddleSmallRadius_finiteResidue_error {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : ∃ C : ℝ, 0 ≤ C ∧ ∀ (ℓ : ℝ), 0 < ℓ → ∀ N : ℕ, 2 * (N : ℝ) ≤ ℓ → ∀ y : ℝ, 0 ≤ y → 2 * y ≤ (N : ℝ) + 2 → |(∑ n ∈ Finset.range (N + 1), ((-y) ^ n / (n.factorial : ℝ)) * plusSaddleSmallRadiusCoefficient ε ℓ n) - Real.exp (-y)| ≤ (C / ℓ) * Real.exp (C * (N : ℝ) ^ 2 / ℓ) * (2 * y + y ^ 2) * Real.exp y + 2 * (y ^ (N + 1) / ((N + 1).factorial : ℝ)) := by obtain ⟨C, hC, hweight⟩ := exists_plusSaddleSmallRadius_weightedCoefficient_error hε horder refine ⟨C, hC, ?_⟩ intro ℓ hℓ N hN y hy hyratio have hmoment := hweight ℓ hℓ N hN y hy have htail := saddleExpSeries_alternating_tail_bound hy (N + 1) (by push_cast linarith) have hsplit : (∑ n ∈ Finset.range (N + 1), ((-y) ^ n / (n.factorial : ℝ)) * plusSaddleSmallRadiusCoefficient ε ℓ n) = (∑ n ∈ Finset.range (N + 1), ((-y) ^ n / (n.factorial : ℝ)) * (plusSaddleSmallRadiusCoefficient ε ℓ n - 1)) + (∑ n ∈ Finset.range (N + 1), (-y) ^ n / (n.factorial : ℝ)) := by rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro n hn ring have hcoefficient : |∑ n ∈ Finset.range (N + 1), ((-y) ^ n / (n.factorial : ℝ)) * (plusSaddleSmallRadiusCoefficient ε ℓ n - 1)| ≤ ∑ n ∈ Finset.range (N + 1), (y ^ n / (n.factorial : ℝ)) * |plusSaddleSmallRadiusCoefficient ε ℓ n - 1| := by calc |∑ n ∈ Finset.range (N + 1), ((-y) ^ n / (n.factorial : ℝ)) * (plusSaddleSmallRadiusCoefficient ε ℓ n - 1)| ≤ ∑ n ∈ Finset.range (N + 1), |((-y) ^ n / (n.factorial : ℝ)) * (plusSaddleSmallRadiusCoefficient ε ℓ n - 1)| := Finset.abs_sum_le_sum_abs _ _ _ = ∑ n ∈ Finset.range (N + 1), (y ^ n / (n.factorial : ℝ)) * |plusSaddleSmallRadiusCoefficient ε ℓ n - 1| := by apply Finset.sum_congr rfl intro n hn have hfact : 0 < (n.factorial : ℝ) := by exact_mod_cast Nat.factorial_pos n rw [abs_mul, abs_div, abs_pow, abs_neg, abs_of_nonneg hy, abs_of_pos hfact] rw [hsplit] calc |(∑ n ∈ Finset.range (N + 1), ((-y) ^ n / (n.factorial : ℝ)) * (plusSaddleSmallRadiusCoefficient ε ℓ n - 1)) + (∑ n ∈ Finset.range (N + 1), (-y) ^ n / (n.factorial : ℝ)) - Real.exp (-y)| = |(∑ n ∈ Finset.range (N + 1), ((-y) ^ n / (n.factorial : ℝ)) * (plusSaddleSmallRadiusCoefficient ε ℓ n - 1)) + ((∑ n ∈ Finset.range (N + 1), (-y) ^ n / (n.factorial : ℝ)) - Real.exp (-y))| := by congr 1 ring _ ≤ |∑ n ∈ Finset.range (N + 1), ((-y) ^ n / (n.factorial : ℝ)) * (plusSaddleSmallRadiusCoefficient ε ℓ n - 1)| + |(∑ n ∈ Finset.range (N + 1), (-y) ^ n / (n.factorial : ℝ)) - Real.exp (-y)| := abs_add_le _ _ _ ≤ (∑ n ∈ Finset.range (N + 1), (y ^ n / (n.factorial : ℝ)) * |plusSaddleSmallRadiusCoefficient ε ℓ n - 1|) + 2 * (y ^ (N + 1) / ((N + 1).factorial : ℝ)) := by apply add_le_add hcoefficient rw [abs_sub_comm] exact htail _ ≤ (C / ℓ) * Real.exp (C * (N : ℝ) ^ 2 / ℓ) * (2 * y + y ^ 2) * Real.exp y + 2 * (y ^ (N + 1) / ((N + 1).factorial : ℝ)) := add_le_add hmoment (le_refl _) theorem exists_plusSaddleSmallRadius_relativeFiniteResidue_error {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : ∃ C : ℝ, 0 ≤ C ∧ ∀ (ℓ : ℝ), 0 < ℓ → ∀ N : ℕ, 2 * (N : ℝ) ≤ ℓ → ∀ y : ℝ, 0 ≤ y → 2 * y ≤ (N : ℝ) + 2 → Real.exp y * |(∑ n ∈ Finset.range (N + 1), ((-y) ^ n / (n.factorial : ℝ)) * plusSaddleSmallRadiusCoefficient ε ℓ n) - Real.exp (-y)| ≤ (C / ℓ) * Real.exp (C * (N : ℝ) ^ 2 / ℓ) * (2 * y + y ^ 2) * Real.exp (2 * y) + 2 * Real.exp y * (y ^ (N + 1) / ((N + 1).factorial : ℝ)) := by obtain ⟨C, hC, hfinite⟩ := exists_plusSaddleSmallRadius_finiteResidue_error hε horder refine ⟨C, hC, ?_⟩ intro ℓ hℓ N hN y hy hyratio have hbound := hfinite ℓ hℓ N hN y hy hyratio have hexp : 0 ≤ Real.exp y := (Real.exp_pos y).le calc Real.exp y * |(∑ n ∈ Finset.range (N + 1), ((-y) ^ n / (n.factorial : ℝ)) * plusSaddleSmallRadiusCoefficient ε ℓ n) - Real.exp (-y)| ≤ Real.exp y * ((C / ℓ) * Real.exp (C * (N : ℝ) ^ 2 / ℓ) * (2 * y + y ^ 2) * Real.exp y + 2 * (y ^ (N + 1) / ((N + 1).factorial : ℝ))) := mul_le_mul_of_nonneg_left hbound hexp _ = (C / ℓ) * Real.exp (C * (N : ℝ) ^ 2 / ℓ) * (2 * y + y ^ 2) * Real.exp (2 * y) + 2 * Real.exp y * (y ^ (N + 1) / ((N + 1).factorial : ℝ)) := by rw [show Real.exp (2 * y) = Real.exp y * Real.exp y by rw [show 2 * y = y + y by ring, Real.exp_add]] ring theorem upperGammaMeasureDensity_pos {ℓ η a : ℝ} (hℓ : 0 < ℓ) (ha : 0 < a) : 0 < upperGammaMeasureDensity ℓ η a := by have hx : 0 < 2 * a / ℓ := by positivity have hden : 0 < 1 - Real.exp (-(2 * a / ℓ)) := by have he := Real.exp_lt_one_iff.mpr (show -(2 * a / ℓ) < 0 by linarith) linarith unfold upperGammaMeasureDensity exact div_pos (Real.exp_pos _) (mul_pos ha hden) theorem upper_one_sub_cos_quadratic_lower {x : ℝ} (hx : |x| ≤ 1) : x ^ 2 / 4 ≤ 1 - Real.cos x := by have hnonnegative : 0 ≤ |x| := abs_nonneg x have hquartic := cos_le_quartic hnonnegative hx rw [Real.cos_abs] at hquartic have hsquare : |x| ^ 2 = x ^ 2 := by exact sq_abs x have hfourth : |x| ^ 4 = x ^ 4 := by calc |x| ^ 4 = (|x| ^ 2) ^ 2 := by ring _ = (x ^ 2) ^ 2 := by rw [hsquare] _ = x ^ 4 := by ring rw [hsquare, hfourth] at hquartic have hx2 : x ^ 2 ≤ 1 := by have h := pow_le_pow_left₀ hnonnegative hx 2 simpa [hsquare] using! h have hx4 : x ^ 4 ≤ x ^ 2 := by nlinarith [mul_nonneg (sq_nonneg x) (sub_nonneg.mpr hx2)] nlinarith def upperGammaDampingIntegrand (ℓ η T a : ℝ) : ℝ := (1 - Real.cos (a * T)) * upperGammaMeasureDensity ℓ η a def upperGammaDamping (ℓ η T : ℝ) : ℝ := ∫ a : ℝ in Ioi 0, upperGammaDampingIntegrand ℓ η T a theorem upperGammaDampingIntegrand_integrable {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (T : ℝ) : IntegrableOn (upperGammaDampingIntegrand ℓ η T) (Ioi 0) := by have hvariance := upperGammaVarianceDensity_integrable hℓ hη have hmajor : IntegrableOn (fun a : ℝ => (T ^ 2 / 2) * (a ^ 2 * upperGammaMeasureDensity ℓ η a)) (Ioi 0) := hvariance.const_mul (T ^ 2 / 2) have hmeas : Measurable (upperGammaDampingIntegrand ℓ η T) := by unfold upperGammaDampingIntegrand upperGammaMeasureDensity fun_prop apply hmajor.mono' hmeas.aestronglyMeasurable filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha have hdensity := upperGammaMeasureDensity_pos (η := η) hℓ ha have hcos : 0 ≤ 1 - Real.cos (a * T) := sub_nonneg.mpr (Real.cos_le_one _) have hquad : 1 - Real.cos (a * T) ≤ (a * T) ^ 2 / 2 := by nlinarith [Real.one_sub_sq_div_two_le_cos (x := a * T)] unfold upperGammaDampingIntegrand rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg hcos hdensity.le)] calc (1 - Real.cos (a * T)) * upperGammaMeasureDensity ℓ η a ≤ ((a * T) ^ 2 / 2) * upperGammaMeasureDensity ℓ η a := mul_le_mul_of_nonneg_right hquad hdensity.le _ = (T ^ 2 / 2) * (a ^ 2 * upperGammaMeasureDensity ℓ η a) := by ring theorem upperGammaDamping_nonneg {ℓ η : ℝ} (hℓ : 0 < ℓ) (T : ℝ) : 0 ≤ upperGammaDamping ℓ η T := by unfold upperGammaDamping apply setIntegral_nonneg measurableSet_Ioi intro a ha unfold upperGammaDampingIntegrand exact mul_nonneg (sub_nonneg.mpr (Real.cos_le_one _)) (upperGammaMeasureDensity_pos (η := η) hℓ ha).le theorem upperGammaDampingIntegrand_lower_on_window {ℓ η T a : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (ha : 0 < a) (haη : a ≤ η⁻¹) (haT : a ≤ |T|⁻¹) (hT : T ≠ 0) : (ℓ / (8 * Real.exp 1)) * T ^ 2 ≤ upperGammaDampingIntegrand ℓ η T a := by have hTa : |a * T| ≤ 1 := by rw [abs_mul, abs_of_pos ha] calc a * |T| ≤ |T|⁻¹ * |T| := mul_le_mul_of_nonneg_right haT (abs_nonneg T) _ = 1 := inv_mul_cancel₀ (abs_ne_zero.mpr hT) have heta : η * a ≤ 1 := by calc η * a ≤ η * η⁻¹ := mul_le_mul_of_nonneg_left haη hη.le _ = 1 := mul_inv_cancel₀ hη.ne' have hexp : (Real.exp 1)⁻¹ ≤ Real.exp (-η * a) := by rw [← Real.exp_neg] exact Real.exp_le_exp.mpr (by linarith) have hvariance := (upperGammaVarianceDensity_pointwise_bounds (η := η) hℓ ha).1 have hcos := upper_one_sub_cos_quadratic_lower hTa have hdensity := upperGammaMeasureDensity_pos (η := η) hℓ ha have hquarter : 0 ≤ T ^ 2 / 4 := by positivity calc (ℓ / (8 * Real.exp 1)) * T ^ 2 = (T ^ 2 / 4) * ((ℓ / 2) * (Real.exp 1)⁻¹) := by field_simp [(Real.exp_pos 1).ne'] ring _ ≤ (T ^ 2 / 4) * ((ℓ / 2) * Real.exp (-η * a)) := by gcongr _ ≤ (T ^ 2 / 4) * (a ^ 2 * upperGammaMeasureDensity ℓ η a) := mul_le_mul_of_nonneg_left hvariance hquarter _ = ((a * T) ^ 2 / 4) * upperGammaMeasureDensity ℓ η a := by ring _ ≤ (1 - Real.cos (a * T)) * upperGammaMeasureDensity ℓ η a := mul_le_mul_of_nonneg_right hcos hdensity.le _ = upperGammaDampingIntegrand ℓ η T a := rfl theorem upperGammaDamping_lower_bound {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (T : ℝ) : (ℓ / (8 * Real.exp 1)) * min (T ^ 2 / η) |T| ≤ upperGammaDamping ℓ η T := by by_cases hT : T = 0 · subst T simp [upperGammaDamping, upperGammaDampingIntegrand] · let q : ℝ := min η⁻¹ |T|⁻¹ let c : ℝ := (ℓ / (8 * Real.exp 1)) * T ^ 2 have hq : 0 < q := by try dsimp [q] exact lt_min (inv_pos.mpr hη) (inv_pos.mpr (abs_pos.mpr hT)) have hsubset : Ioc (0 : ℝ) q ⊆ Ioi 0 := by intro a ha exact ha.1 have hfull := upperGammaDampingIntegrand_integrable hℓ hη T have hsmall := hfull.mono_set hsubset have hconstant : IntegrableOn (fun _ : ℝ => c) (Ioc 0 q) := integrableOn_const (by rw [Real.volume_Ioc] exact ENNReal.ofReal_ne_top) have hpoint : ∀ a ∈ Ioc (0 : ℝ) q, c ≤ upperGammaDampingIntegrand ℓ η T a := by intro a ha apply upperGammaDampingIntegrand_lower_on_window hℓ hη ha.1 · exact ha.2.trans (min_le_left _ _) · exact ha.2.trans (min_le_right _ _) · exact hT have hmono := setIntegral_mono_on hconstant hsmall measurableSet_Ioc hpoint have hnonnegative : 0 ≤ᵐ[volume.restrict (Ioi (0 : ℝ))] upperGammaDampingIntegrand ℓ η T := by filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha unfold upperGammaDampingIntegrand exact mul_nonneg (sub_nonneg.mpr (Real.cos_le_one _)) (upperGammaMeasureDensity_pos (η := η) hℓ ha).le have haesubset : Ioc (0 : ℝ) q ≤ᶠ[ae (volume : Measure ℝ)] Ioi 0 := Filter.Eventually.of_forall fun a ha => hsubset ha have hrestrict := setIntegral_mono_set hfull hnonnegative haesubset have hmeasure : (volume : Measure ℝ).real (Ioc (0 : ℝ) q) = q := by change ((volume : Measure ℝ) (Ioc (0 : ℝ) q)).toReal = q rw [Real.volume_Ioc, ENNReal.toReal_ofReal (by linarith)] simp have hconstintegral : (∫ a : ℝ in Ioc (0 : ℝ) q, c) = q * c := by rw [setIntegral_const, hmeasure] rfl have hmin : q * T ^ 2 = min (T ^ 2 / η) |T| := by try dsimp [q] rw [min_mul_of_nonneg η⁻¹ |T|⁻¹ (sq_nonneg T)] congr 1 · simp [div_eq_mul_inv, mul_comm] · have hTabs : |T| ≠ 0 := abs_ne_zero.mpr hT calc |T|⁻¹ * T ^ 2 = |T|⁻¹ * |T| ^ 2 := by rw [sq_abs] _ = |T| := by field_simp [hTabs] calc (ℓ / (8 * Real.exp 1)) * min (T ^ 2 / η) |T| = q * c := by try dsimp [c] rw [← hmin] ring _ = ∫ a : ℝ in Ioc (0 : ℝ) q, c := hconstintegral.symm _ ≤ ∫ a : ℝ in Ioc (0 : ℝ) q, upperGammaDampingIntegrand ℓ η T a := hmono _ ≤ ∫ a : ℝ in Ioi 0, upperGammaDampingIntegrand ℓ η T a := hrestrict _ = upperGammaDamping ℓ η T := rfl def upperSaddleDamping (ε ℓ δ T : ℝ) : ℝ := upperGammaDamping ℓ (2 + δ) T + positiveShellDamping ε ℓ δ T - upperShortShellDamping ε ℓ δ T def upperSaddleVariance (ε ℓ δ : ℝ) : ℝ := upperGammaVariance ℓ (2 + δ) + upperNetShellVariance ε δ def upperSaddleThirdMoment (ε ℓ δ : ℝ) : ℝ := upperGammaThirdMoment ℓ (2 + δ) + upperNetShellThirdMoment ε δ theorem eventually_upperSaddleDamping_gamma_add_shell : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ ℓ : ℝ, 0 < ℓ → ∀ δ : ℝ, ε / 2 ≤ δ → ∀ T : ℝ, upperGammaDamping ℓ (2 + δ) T + (99 / 100 : ℝ) * positiveShellDamping ε ℓ δ T ≤ upperSaddleDamping ε ℓ δ T := by filter_upwards [eventually_upper_shortShell_domination] with ε hdom intro ℓ hℓ δ hδ T have hshort := hdom ℓ hℓ.le δ hδ T unfold upperSaddleDamping linarith theorem eventually_upperSaddleVariance_bounds : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ ℓ : ℝ, 0 < ℓ → ∀ δ : ℝ, ε / 2 ≤ δ → 1 / (2 * (2 + δ)) + (99 / 100 : ℝ) * upperPositiveShellVariance ε δ ≤ upperSaddleVariance ε ℓ δ ∧ upperSaddleVariance ε ℓ δ ≤ (1 / (2 * (2 + δ)) + 1 / (ℓ * (2 + δ) ^ 2)) + upperPositiveShellVariance ε δ := by filter_upwards [self_mem_nhdsWithin, eventually_upper_netShellVariance_bounds] with ε hε hnet change 0 < ε at hε intro ℓ hℓ δ hδ have hη : 0 < 2 + δ := by nlinarith obtain ⟨hγlow, hγhigh⟩ := upperGammaVariance_bounds hℓ hη obtain ⟨hslow, hshigh⟩ := hnet δ hδ unfold upperSaddleVariance exact ⟨add_le_add hγlow hslow, add_le_add hγhigh hshigh⟩ theorem upperPositiveShellVariance_pos {ε δ : ℝ} (hε : 0 < ε) (hδ : 0 ≤ δ) : 0 < upperPositiveShellVariance ε δ := by have hB : 0 < shellLocation ε := by unfold shellLocation positivity have hlower := (upperPositiveShellVariance_bounds hε hδ).1 have hpositive : 0 < (1 / 2 : ℝ) * (shellLocation ε) ^ 2 * shellWeight ε * Real.exp (δ * shellLocation ε) := by exact mul_pos (mul_pos (mul_pos (by norm_num) (sq_pos_of_pos hB)) (shellWeight_pos ε)) (Real.exp_pos _) exact hpositive.trans_le hlower theorem eventually_upperSaddleVariance_pos : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ ℓ : ℝ, 0 < ℓ → ∀ δ : ℝ, ε / 2 ≤ δ → 0 < upperSaddleVariance ε ℓ δ := by filter_upwards [self_mem_nhdsWithin, eventually_upperSaddleVariance_bounds] with ε hε hbound change 0 < ε at hε intro ℓ hℓ δ hδ have hδnonnegative : 0 ≤ δ := by nlinarith have hη : 0 < 2 + δ := by linarith have hshell := upperPositiveShellVariance_pos hε hδnonnegative have hpositive : 0 < 1 / (2 * (2 + δ)) + (99 / 100 : ℝ) * upperPositiveShellVariance ε δ := by positivity exact hpositive.trans_le (hbound ℓ hℓ δ hδ).1 theorem upperGammaThirdMoment_le_two_mul_variance {ℓ η : ℝ} (hℓ : 1 ≤ ℓ) (hη : 2 ≤ η) : upperGammaThirdMoment ℓ η ≤ 2 * upperGammaVariance ℓ η := by have hℓpositive : 0 < ℓ := by linarith have hηpositive : 0 < η := by linarith have hγthird := (upperGammaThirdMoment_bounds hℓpositive hηpositive).2 have hγvariance := (upperGammaVariance_bounds hℓpositive hηpositive).1 have hfirst : 1 / (2 * η ^ 2) ≤ 1 / (2 * η) := by apply (div_le_div_iff₀ (show 0 < 2 * η ^ 2 by positivity) (show 0 < 2 * η by positivity)).2 nlinarith [mul_nonneg hηpositive.le (show 0 ≤ η - 1 by linarith)] have hηsquare : 4 ≤ η ^ 2 := by nlinarith [sq_nonneg (η - 2)] have hsquare : 4 ≤ ℓ * η ^ 2 := by calc (4 : ℝ) ≤ η ^ 2 := hηsquare _ ≤ ℓ * η ^ 2 := by nlinarith [mul_nonneg (show 0 ≤ ℓ - 1 by linarith) (sq_nonneg η)] have hsecond : 2 / (ℓ * η ^ 3) ≤ 1 / (2 * η) := by apply (div_le_div_iff₀ (show 0 < ℓ * η ^ 3 by positivity) (show 0 < 2 * η by positivity)).2 have hscaled := mul_le_mul_of_nonneg_right hsquare hηpositive.le nlinarith calc upperGammaThirdMoment ℓ η ≤ 1 / (2 * η ^ 2) + 2 / (ℓ * η ^ 3) := hγthird _ ≤ 2 * (1 / (2 * η)) := by linarith _ ≤ 2 * upperGammaVariance ℓ η := by linarith def upperSaddleShellThirdCoefficient (ε : ℝ) : ℝ := shellLocation ε + 1 + shortEndpoint ε / 100 theorem eventually_upperSaddleThirdMoment_le_variance : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ ℓ : ℝ, 1 ≤ ℓ → ∀ δ : ℝ, ε / 2 ≤ δ → upperSaddleThirdMoment ε ℓ δ ≤ (2 + (100 / 99 : ℝ) * upperSaddleShellThirdCoefficient ε) * upperSaddleVariance ε ℓ δ := by filter_upwards [self_mem_nhdsWithin, eventually_upper_shortCutoff_le_shortEndpoint, eventually_upper_netShellVariance_bounds, eventually_upper_netShellThirdMoment_bound] with ε hε horder hnet hthird change 0 < ε at hε intro ℓ hℓ δ hδ have hℓpositive : 0 < ℓ := by linarith have hδnonnegative : 0 ≤ δ := by nlinarith have hη : 2 ≤ 2 + δ := by linarith have hηpositive : 0 < 2 + δ := by linarith have hgamma := upperGammaThirdMoment_le_two_mul_variance hℓ hη obtain ⟨hnetlower, hnetupper⟩ := hnet δ hδ have hpositiveShell := upperPositiveShellVariance_pos hε hδnonnegative have hnetnonnegative : 0 ≤ upperNetShellVariance ε δ := by nlinarith have hgammavariance : 0 ≤ upperGammaVariance ℓ (2 + δ) := by have h := (upperGammaVariance_bounds hℓpositive hηpositive).1 have hpositive : 0 < 1 / (2 * (2 + δ)) := by positivity exact hpositive.le.trans h have hshortEndpoint : 0 ≤ shortEndpoint ε := by have hcutoff : 0 < shortCutoff ε := by unfold shortCutoff positivity exact (hcutoff.trans_le horder).le have hB : 0 ≤ shellLocation ε := by unfold shellLocation positivity have hC : 0 ≤ upperSaddleShellThirdCoefficient ε := by unfold upperSaddleShellThirdCoefficient positivity have htransfer : upperPositiveShellVariance ε δ ≤ (100 / 99 : ℝ) * upperNetShellVariance ε δ := by nlinarith have hthirdshell : upperNetShellThirdMoment ε δ ≤ (100 / 99 : ℝ) * upperSaddleShellThirdCoefficient ε * upperNetShellVariance ε δ := by calc upperNetShellThirdMoment ε δ ≤ upperSaddleShellThirdCoefficient ε * upperPositiveShellVariance ε δ := by simpa [upperSaddleShellThirdCoefficient] using! hthird δ hδ _ ≤ upperSaddleShellThirdCoefficient ε * ((100 / 99 : ℝ) * upperNetShellVariance ε δ) := mul_le_mul_of_nonneg_left htransfer hC _ = (100 / 99 : ℝ) * upperSaddleShellThirdCoefficient ε * upperNetShellVariance ε δ := by ring unfold upperSaddleThirdMoment upperSaddleVariance nlinarith [mul_nonneg hC hgammavariance, mul_nonneg hC hnetnonnegative] theorem upperShortMargin_mul_exp_antitone {ε : ℝ} (hε : 0 < ε) : AntitoneOn (fun a : ℝ => shortMargin ε a * Real.exp (ε * a)) (Ici (0 : ℝ)) := by let f : ℝ → ℝ := fun a => shortMargin ε a * Real.exp (ε * a) have hderiv (a : ℝ) : HasDerivAt f (ε * Real.exp (ε * a) * (shortMargin ε a - 10)) a := by have hmargin : HasDerivAt (fun x : ℝ => shortMargin ε x) (-(10 * ε)) a := by have h := (hasDerivAt_const a (1 : ℝ)).sub ((hasDerivAt_const a (10 * ε)).mul ((hasDerivAt_const a (1 : ℝ)).add (hasDerivAt_id a))) convert! h using 1; simp [Pi.add_apply, id] have hexp : HasDerivAt (fun x : ℝ => Real.exp (ε * x)) (Real.exp (ε * a) * ε) a := by convert! ((hasDerivAt_id a).const_mul ε).exp using 1; simp [id] have h := hmargin.mul hexp convert! h using 1; simp; ring apply antitoneOn_of_deriv_nonpos (convex_Ici (0 : ℝ)) · have hc : Continuous f := by try dsimp [f] unfold shortMargin fun_prop exact hc.continuousOn · intro a ha exact (hderiv a).differentiableAt.differentiableWithinAt · intro a ha rw [(hderiv a).deriv] have ha0 : 0 ≤ a := by have h := interior_subset ha exact h have hmargin : shortMargin ε a ≤ 1 := by unfold shortMargin nlinarith [mul_nonneg hε.le (show 0 ≤ 1 + a by linarith)] exact mul_nonpos_of_nonneg_of_nonpos (mul_nonneg hε.le (Real.exp_pos _).le) (by linarith) theorem upperShortMargin_mul_exp_le_zero_value {ε a : ℝ} (hε : 0 < ε) (ha : 0 ≤ a) : shortMargin ε a * Real.exp (ε * a) ≤ 1 - 10 * ε := by have h := upperShortMargin_mul_exp_antitone hε (show (0 : ℝ) ∈ Ici 0 by simp) (show a ∈ Ici 0 from ha) ha simpa [shortMargin] using! h theorem upperFirstBranch_shortRatio_le {ε u a : ℝ} (hε : 0 < ε) (ha : 0 ≤ a) (hulower : -1 ≤ u) (huupper : u ≤ 1 + ε / 2) (hmargin : 0 ≤ shortMargin ε a) : shortMargin ε a * Real.exp ((u - 1) * a) * (Real.cosh (u * a) / Real.cosh a) ≤ 1 - 4 * ε := by have hmarginupper : shortMargin ε a ≤ 1 - 10 * ε := by unfold shortMargin nlinarith [mul_nonneg hε.le ha] by_cases hubounded : u ≤ 1 · have huexp : Real.exp ((u - 1) * a) ≤ 1 := by apply Real.exp_le_one_iff.mpr exact mul_nonpos_of_nonpos_of_nonneg (sub_nonpos.mpr hubounded) ha have huabs : |u| ≤ 1 := (abs_le).mpr ⟨hulower, hubounded⟩ have hcosh : Real.cosh (u * a) ≤ Real.cosh a := by apply Real.cosh_le_cosh.mpr rw [abs_mul, abs_of_nonneg ha] exact (mul_le_mul_of_nonneg_right huabs ha).trans (by simp) have hratio : Real.cosh (u * a) / Real.cosh a ≤ 1 := by exact (div_le_one (Real.cosh_pos a)).mpr hcosh calc shortMargin ε a * Real.exp ((u - 1) * a) * (Real.cosh (u * a) / Real.cosh a) ≤ shortMargin ε a * 1 * 1 := by gcongr _ = shortMargin ε a := by ring _ ≤ 1 - 10 * ε := hmarginupper _ ≤ 1 - 4 * ε := by linarith · have hugreater : 1 ≤ u := (le_of_not_ge hubounded) have hδ : 0 ≤ u - 1 := by linarith have hratio : Real.cosh (u * a) / Real.cosh a ≤ Real.exp ((u - 1) * a) := by convert! cosh_ratio_upper ha hδ using 1; ring_nf have hdouble : Real.exp (2 * (u - 1) * a) ≤ Real.exp (ε * a) := by apply Real.exp_le_exp.mpr nlinarith [mul_nonneg (show 0 ≤ ε - 2 * (u - 1) by linarith) ha] calc shortMargin ε a * Real.exp ((u - 1) * a) * (Real.cosh (u * a) / Real.cosh a) ≤ shortMargin ε a * Real.exp ((u - 1) * a) * Real.exp ((u - 1) * a) := by gcongr _ = shortMargin ε a * Real.exp (2 * (u - 1) * a) := by rw [mul_assoc, ← Real.exp_add] congr 1 ring_nf _ ≤ shortMargin ε a * Real.exp (ε * a) := mul_le_mul_of_nonneg_left hdouble hmargin _ ≤ 1 - 10 * ε := upperShortMargin_mul_exp_le_zero_value hε ha _ ≤ 1 - 4 * ε := by linarith theorem upperFirstBranch_shortMeasure_pointwise {ε ℓ u a : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (hℓ : 0 < ℓ) (ha : 0 < a) (hulower : -1 ≤ u) (huupper : u ≤ 1 + ε / 2) (hmargin : 0 ≤ shortMargin ε a) : ℓ * (-shortShellDensity ε a) * Real.cosh (u * a) ≤ (1 - 4 * ε) * upperGammaMeasureDensity ℓ (1 + u) a := by have hfactor : 0 ≤ 1 - 4 * ε := by linarith have hratio := upperFirstBranch_shortRatio_le hε ha.le hulower huupper hmargin have hvariance := (upperGammaVarianceDensity_pointwise_bounds (η := 1 + u) hℓ ha).1 have hbase : (ℓ / 2) * Real.exp (-(1 + u) * a) / a ^ 2 ≤ upperGammaMeasureDensity ℓ (1 + u) a := by apply (div_le_iff₀ (sq_pos_of_pos ha)).2 nlinarith have hbasepositive : 0 ≤ (ℓ / 2) * Real.exp (-(1 + u) * a) / a ^ 2 := by positivity have hidentity : ℓ * (-shortShellDensity ε a) * Real.cosh (u * a) = (shortMargin ε a * Real.exp ((u - 1) * a) * (Real.cosh (u * a) / Real.cosh a)) * ((ℓ / 2) * Real.exp (-(1 + u) * a) / a ^ 2) := by have hexp : Real.exp (a * (u - 1)) * Real.exp (-(a * (1 + u))) = Real.exp (-(2 * a)) := by rw [← Real.exp_add] congr 1 ring unfold shortShellDensity field_simp [ha.ne', (Real.cosh_pos a).ne'] rw [← hexp] ring rw [hidentity] calc (shortMargin ε a * Real.exp ((u - 1) * a) * (Real.cosh (u * a) / Real.cosh a)) * ((ℓ / 2) * Real.exp (-(1 + u) * a) / a ^ 2) ≤ (1 - 4 * ε) * ((ℓ / 2) * Real.exp (-(1 + u) * a) / a ^ 2) := mul_le_mul_of_nonneg_right hratio hbasepositive _ ≤ (1 - 4 * ε) * upperGammaMeasureDensity ℓ (1 + u) a := mul_le_mul_of_nonneg_left hbase hfactor theorem upperFirstBranch_shortDamping_le_gamma {ε ℓ u : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (hℓ : 0 < ℓ) (hulower : -1 < u) (huupper : u ≤ 1 + ε / 2) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) (T : ℝ) : upperShortShellDamping ε ℓ (u - 1) T ≤ (1 - 4 * ε) * upperGammaDamping ℓ (1 + u) T := by let a₀ : ℝ := shortCutoff ε let A : ℝ := shortEndpoint ε let η : ℝ := 1 + u have hη : 0 < η := by try dsimp [η] linarith have ha₀ : 0 < a₀ := by try dsimp [a₀, shortCutoff] positivity have hfactor : 0 ≤ 1 - 4 * ε := by linarith have hsubset : Ioc a₀ A ⊆ Ioi (0 : ℝ) := by intro a ha exact ha₀.trans ha.1 have hgamma := upperGammaDampingIntegrand_integrable hℓ hη T have hgammaOn : IntegrableOn (upperGammaDampingIntegrand ℓ η T) (Ioc a₀ A) := hgamma.mono_set hsubset have hscaledOn : IntegrableOn (fun a : ℝ => (1 - 4 * ε) * upperGammaDampingIntegrand ℓ η T a) (Ioc a₀ A) := hgammaOn.const_mul (1 - 4 * ε) have hs := shortShellDensity_intervalIntegrable hε horder have hcosh : Continuous (fun a : ℝ => Real.cosh (u * a)) := by fun_prop have hosc : Continuous (fun a : ℝ => 1 - Real.cos (a * T)) := by fun_prop have hshortInterval : IntervalIntegrable (fun a : ℝ => ℓ * (-shortShellDensity ε a) * Real.cosh (u * a) * (1 - Real.cos (a * T))) volume a₀ A := by have hneg : IntervalIntegrable (fun a : ℝ => -shortShellDensity ε a) volume a₀ A := by simpa [a₀, A, Pi.neg_apply] using! hs.neg have hconst := hneg.const_mul ℓ have hwithCosh := hconst.mul_continuousOn hcosh.continuousOn exact hwithCosh.mul_continuousOn hosc.continuousOn have hshortOn : IntegrableOn (fun a : ℝ => ℓ * (-shortShellDensity ε a) * Real.cosh (u * a) * (1 - Real.cos (a * T))) (Ioc a₀ A) := (intervalIntegrable_iff_integrableOn_Ioc_of_le (show a₀ ≤ A by exact horder)).mp hshortInterval have hpoint (a : ℝ) (ha : a ∈ Ioc a₀ A) : ℓ * (-shortShellDensity ε a) * Real.cosh (u * a) * (1 - Real.cos (a * T)) ≤ (1 - 4 * ε) * upperGammaDampingIntegrand ℓ η T a := by have hcomparison := upperFirstBranch_shortMeasure_pointwise hε hεsmall hℓ (ha₀.trans ha.1) hulower.le huupper (hmargin a ⟨ha.1.le, ha.2⟩) have hoscNonneg : 0 ≤ 1 - Real.cos (a * T) := sub_nonneg.mpr (Real.cos_le_one _) have hmul := mul_le_mul_of_nonneg_right hcomparison hoscNonneg simpa [upperGammaDampingIntegrand, η, mul_assoc, mul_left_comm, mul_comm] using! hmul have hmono := setIntegral_mono_on hshortOn hscaledOn measurableSet_Ioc hpoint have hnonnegative : 0 ≤ᵐ[volume.restrict (Ioi (0 : ℝ))] upperGammaDampingIntegrand ℓ η T := by filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha unfold upperGammaDampingIntegrand exact mul_nonneg (sub_nonneg.mpr (Real.cos_le_one _)) (upperGammaMeasureDensity_pos hℓ ha).le have haesubset : Ioc a₀ A ≤ᶠ[ae (volume : Measure ℝ)] Ioi 0 := Filter.Eventually.of_forall fun a ha => hsubset ha have hrestrict := setIntegral_mono_set hgamma hnonnegative haesubset have hscaleRestrict := mul_le_mul_of_nonneg_left hrestrict hfactor have hshortEq : upperShortShellDamping ε ℓ (u - 1) T = ∫ a : ℝ in Ioc a₀ A, ℓ * (-shortShellDensity ε a) * Real.cosh (u * a) * (1 - Real.cos (a * T)) := by unfold upperShortShellDamping have hu : 1 + (u - 1) = u := by ring rw [hu, ← intervalIntegral.integral_const_mul, intervalIntegral.integral_of_le horder] apply setIntegral_congr_fun measurableSet_Ioc intro a ha ring calc upperShortShellDamping ε ℓ (u - 1) T = ∫ a : ℝ in Ioc a₀ A, ℓ * (-shortShellDensity ε a) * Real.cosh (u * a) * (1 - Real.cos (a * T)) := hshortEq _ ≤ ∫ a : ℝ in Ioc a₀ A, (1 - 4 * ε) * upperGammaDampingIntegrand ℓ η T a := hmono _ = (1 - 4 * ε) * ∫ a : ℝ in Ioc a₀ A, upperGammaDampingIntegrand ℓ η T a := by rw [integral_const_mul] _ ≤ (1 - 4 * ε) * ∫ a : ℝ in Ioi 0, upperGammaDampingIntegrand ℓ η T a := hscaleRestrict _ = (1 - 4 * ε) * upperGammaDamping ℓ (1 + u) T := by rfl theorem positiveShellDamping_nonneg {ε ℓ δ T : ℝ} (hℓ : 0 ≤ ℓ) : 0 ≤ positiveShellDamping ε ℓ δ T := by unfold positiveShellDamping apply mul_nonneg hℓ apply intervalIntegral.integral_nonneg (show shellLocation ε ≤ shellLocation ε + 1 by linarith) intro a ha unfold positiveShellDensity exact mul_nonneg (mul_nonneg (div_nonneg (shellWeight_pos ε).le (Real.cosh_pos a).le) (Real.cosh_pos _).le) (sub_nonneg.mpr (Real.cos_le_one _)) def upperFirstBranchSaddleDamping (ε ℓ u T : ℝ) : ℝ := upperGammaDamping ℓ (1 + u) T + positiveShellDamping ε ℓ (u - 1) T - upperShortShellDamping ε ℓ (u - 1) T theorem upperFirstBranchSaddleDamping_lower_bound {ε ℓ u : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (hℓ : 0 < ℓ) (hulower : -1 < u) (huupper : u ≤ 1 + ε / 2) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) (T : ℝ) : 4 * ε * upperGammaDamping ℓ (1 + u) T ≤ upperFirstBranchSaddleDamping ε ℓ u T := by have hshort := upperFirstBranch_shortDamping_le_gamma hε hεsmall hℓ hulower huupper horder hmargin T have hpositive := positiveShellDamping_nonneg (ε := ε) (δ := u - 1) (T := T) hℓ.le unfold upperFirstBranchSaddleDamping nlinarith theorem saddle_shifted_complexCos_re (a T u : ℝ) : (Complex.cos ((a : ℂ) * ((T : ℂ) + Complex.I * (u : ℂ)))).re = Real.cos (a * T) * Real.cosh (a * u) := by have harg : (a : ℂ) * ((T : ℂ) + Complex.I * (u : ℂ)) = ((a * T : ℝ) : ℂ) + ((a * u : ℝ) : ℂ) * Complex.I := by push_cast ring rw [harg, Complex.cos_add, Complex.cos_mul_I, Complex.sin_mul_I, ← Complex.ofReal_cos, ← Complex.ofReal_cosh, ← Complex.ofReal_sin, ← Complex.ofReal_sinh] simp only [Complex.sub_re, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_zero, zero_mul, sub_zero, mul_one] theorem saddle_complexShellInterval_re (w : ℝ → ℝ) {a b : ℝ} (hab : a ≤ b) (hw : ContinuousOn w (Icc a b)) (T u : ℝ) : (∫ x in a..b, (w x : ℂ) * (Complex.cos ((x : ℂ) * ((T : ℂ) + Complex.I * (u : ℂ))) - 1)).re = ∫ x in a..b, w x * (Real.cos (x * T) * Real.cosh (x * u) - 1) := by let F : ℝ → ℂ := fun x => (w x : ℂ) * (Complex.cos ((x : ℂ) * ((T : ℂ) + Complex.I * (u : ℂ))) - 1) have hwcomplex : ContinuousOn (fun x : ℝ => (w x : ℂ)) (Icc a b) := Complex.ofRealCLM.continuous.comp_continuousOn hw have hkernel : Continuous (fun x : ℝ => Complex.cos ((x : ℂ) * ((T : ℂ) + Complex.I * (u : ℂ))) - 1) := by fun_prop have hF : IntervalIntegrable F volume a b := by exact (hwcomplex.mul hkernel.continuousOn).intervalIntegrable_of_Icc hab calc (∫ x in a..b, (w x : ℂ) * (Complex.cos ((x : ℂ) * ((T : ℂ) + Complex.I * (u : ℂ))) - 1)).re = ∫ x in a..b, (F x).re := by exact (Complex.reCLM.intervalIntegral_comp_comm hF).symm _ = ∫ x in a..b, w x * (Real.cos (x * T) * Real.cosh (x * u) - 1) := by apply intervalIntegral.integral_congr intro x hx try dsimp [F] rw [Complex.mul_re, Complex.sub_re, saddle_shifted_complexCos_re] simp theorem shortShellDensity_continuousOn_support {ε : ℝ} (hε : 0 < ε) : ContinuousOn (shortShellDensity ε) (Icc (shortCutoff ε) (shortEndpoint ε)) := by have hn : Continuous (fun a : ℝ => shortMargin ε a * Real.exp (-2 * a)) := by unfold shortMargin fun_prop have hd : Continuous (fun a : ℝ => 2 * a ^ 2 * Real.cosh a) := by fun_prop unfold shortShellDensity exact (hn.continuousOn.div hd.continuousOn (fun a ha => by have hcutoff : 0 < shortCutoff ε := by unfold shortCutoff positivity have ha0 : 0 < a := hcutoff.trans_le ha.1 positivity)).neg theorem mellinShellPhase_shifted_re {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (T u : ℝ) : (mellinShellPhase ε ((T : ℂ) + Complex.I * (u : ℂ))).re = (∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * (Real.cos (a * T) * Real.cosh (a * u) - 1)) + (∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * (Real.cos (a * T) * Real.cosh (a * u) - 1)) := by unfold mellinShellPhase rw [Complex.add_re] congr 1 · exact saddle_complexShellInterval_re (shortShellDensity ε) horder (shortShellDensity_continuousOn_support hε) T u · exact saddle_complexShellInterval_re (positiveShellDensity ε) (show shellLocation ε ≤ shellLocation ε + 1 by linarith) (positiveShellDensity_continuous ε).continuousOn T u theorem saddle_shellInterval_hyperbolic_sub_oscillatory (w : ℝ → ℝ) {a b : ℝ} (hab : a ≤ b) (hw : ContinuousOn w (Icc a b)) (T u : ℝ) : (∫ x in a..b, w x * (Real.cosh (x * u) - 1)) - (∫ x in a..b, w x * (Real.cos (x * T) * Real.cosh (x * u) - 1)) = ∫ x in a..b, w x * Real.cosh (x * u) * (1 - Real.cos (x * T)) := by have hhyper : ContinuousOn (fun x : ℝ => w x * (Real.cosh (x * u) - 1)) (Icc a b) := by apply hw.mul exact (by fun_prop : Continuous (fun x : ℝ => Real.cosh (x * u) - 1)).continuousOn have hosc : ContinuousOn (fun x : ℝ => w x * (Real.cos (x * T) * Real.cosh (x * u) - 1)) (Icc a b) := by apply hw.mul exact (by fun_prop : Continuous (fun x : ℝ => Real.cos (x * T) * Real.cosh (x * u) - 1)).continuousOn rw [← intervalIntegral.integral_sub (hhyper.intervalIntegrable_of_Icc hab) (hosc.intervalIntegrable_of_Icc hab)] apply intervalIntegral.integral_congr intro x hx ring theorem saddleShellPhase_damping_identity {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ T u : ℝ) : ℓ * (realHyperbolicShellPhase ε u - (mellinShellPhase ε ((T : ℂ) + Complex.I * (u : ℂ))).re) = positiveShellDamping ε ℓ (u - 1) T - upperShortShellDamping ε ℓ (u - 1) T := by have hshort := saddle_shellInterval_hyperbolic_sub_oscillatory (shortShellDensity ε) horder (shortShellDensity_continuousOn_support hε) T u have hpositive := saddle_shellInterval_hyperbolic_sub_oscillatory (positiveShellDensity ε) (show shellLocation ε ≤ shellLocation ε + 1 by linarith) (positiveShellDensity_continuous ε).continuousOn T u rw [mellinShellPhase_shifted_re hε horder T u] unfold realHyperbolicShellPhase positiveShellDamping upperShortShellDamping have hu : 1 + (u - 1) = u := by ring simp only [hu] have hshortNormalized : (∫ a in shortCutoff ε..shortEndpoint ε, (-shortShellDensity ε a) * Real.cosh (u * a) * (1 - Real.cos (a * T))) = -(∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * Real.cosh (a * u) * (1 - Real.cos (a * T))) := by rw [← intervalIntegral.integral_neg] apply intervalIntegral.integral_congr intro a ha change -shortShellDensity ε a * Real.cosh (u * a) * (1 - Real.cos (a * T)) = -(shortShellDensity ε a * Real.cosh (a * u) * (1 - Real.cos (a * T))) rw [mul_comm u a] ring have hpositiveNormalized : (∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * Real.cosh (u * a) * (1 - Real.cos (a * T))) = ∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * Real.cosh (a * u) * (1 - Real.cos (a * T)) := by apply intervalIntegral.integral_congr intro a ha change positiveShellDensity ε a * Real.cosh (u * a) * (1 - Real.cos (a * T)) = positiveShellDensity ε a * Real.cosh (a * u) * (1 - Real.cos (a * T)) rw [mul_comm u a] rw [hshortNormalized, hpositiveNormalized] linear_combination ℓ * hshort + ℓ * hpositive end noncomputable section open Filter MeasureTheory Set open scoped FourierTransform SchwartzMap Topology def radialCriticalLogProfile {d : ℕ} (hd : 0 < d) (f : TestFunction d) (u : ℝ) : ℂ := Real.exp (-((d : ℝ) / 2) * u) • radialProfile hd f (Real.exp (-u)) theorem radialCriticalLogProfile_eq_reflected_tilt {d : ℕ} (hd : 0 < d) (f : TestFunction d) (u : ℝ) : radialCriticalLogProfile hd f u = schwartzExponentialTilt (radialSchwartzProfile hd f) ((d : ℝ) / 2) 1 (-u) := by simp [radialCriticalLogProfile, schwartzExponentialTilt, radialSchwartzProfile_apply, mul_neg] theorem radialCriticalLogProfile_integrable {d : ℕ} (hd : 0 < d) (f : TestFunction d) : Integrable (radialCriticalLogProfile hd f) := by have hdimension : 0 < (d : ℝ) / 2 := div_pos (by exact_mod_cast hd) (by norm_num) have h := (schwartzExponentialTilt_integrable (radialSchwartzProfile hd f) hdimension (show (0 : ℝ) < 1 by norm_num)).comp_neg apply h.congr filter_upwards [] with u exact (radialCriticalLogProfile_eq_reflected_tilt hd f u).symm theorem radialCriticalLogProfile_continuous {d : ℕ} (hd : 0 < d) (f : TestFunction d) : Continuous (radialCriticalLogProfile hd f) := by unfold radialCriticalLogProfile exact (by fun_prop : Continuous (fun u : ℝ => Real.exp (-((d : ℝ) / 2) * u))).smul ((radialProfile_continuous hd f).comp (by fun_prop : Continuous (fun u : ℝ => Real.exp (-u)))) theorem radialCriticalLogProfile_fourier_integrable {d : ℕ} (hd : 0 < d) (f : TestFunction d) : Integrable (𝓕 (radialCriticalLogProfile hd f) : ℝ → ℂ) := by have hdimension : 0 < (d : ℝ) / 2 := div_pos (by exact_mod_cast hd) (by norm_num) let G : ℝ → ℂ := schwartzExponentialTilt (radialSchwartzProfile hd f) ((d : ℝ) / 2) 1 have hG : Integrable (𝓕 G : ℝ → ℂ) := schwartzExponentialTilt_fourier_integrable (radialSchwartzProfile hd f) hdimension (show (0 : ℝ) < 1 by norm_num) have hneg := hG.comp_neg apply hneg.congr filter_upwards [] with u have hprofile : radialCriticalLogProfile hd f = (fun v : ℝ => G (-v)) := by funext v exact radialCriticalLogProfile_eq_reflected_tilt hd f v rw [hprofile] simpa [Function.comp_def, G] using! (Real.fourier_comp_linearIsometry (LinearIsometryEquiv.neg ℝ) G u).symm theorem radialMellinFrequency_eq_criticalLogFourier {d : ℕ} (hd : 0 < d) (f : TestFunction d) (t : ℝ) : radialMellinFrequency hd f t = (𝓕 (radialCriticalLogProfile hd f) : ℝ → ℂ) (-t / (2 * Real.pi)) := by exact radialMellinFrequency_eq_fourier hd f t theorem plusSaddleFourierData_continuous {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) : Continuous (plusSaddleFourierData ε ℓ) := by unfold plusSaddleFourierData exact (plusSaddleSpectrum_continuous hε hℓ horder).comp (by fun_prop) theorem minusSaddleFourierData_continuous {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) : Continuous (minusSaddleFourierData ε ℓ) := by unfold minusSaddleFourierData exact (minusSaddleSpectrum_continuous hε hℓ horder).comp (by fun_prop) theorem plusSaddleFourierData_integrable {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) : Integrable (plusSaddleFourierData ε ℓ) := by have hnorm : Integrable (fun y : ℝ => ‖plusSaddleFourierData ε ℓ y‖) := by simpa using! plusSaddleFourierData_norm_moment_integrable hε hℓ horder 0 exact (integrable_norm_iff (plusSaddleFourierData_continuous hε hℓ horder).aestronglyMeasurable).mp hnorm theorem minusSaddleFourierData_integrable {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) : Integrable (minusSaddleFourierData ε ℓ) := by have hnorm : Integrable (fun y : ℝ => ‖minusSaddleFourierData ε ℓ y‖) := by simpa using! minusSaddleFourierData_norm_moment_integrable hε hℓ horder 0 exact (integrable_norm_iff (minusSaddleFourierData_continuous hε hℓ horder).aestronglyMeasurable).mp hnorm theorem radialProfile_eq_plusSaddleProfile_of_source {ε : ℝ} {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : ∀ x : Euclidean d, f x = plusSaddleFunction ε d x) {r : ℝ} (hr : 0 ≤ r) : radialProfile hd f r = plusSaddleProfile ε ((d : ℝ) / 2) r := by unfold radialProfile rw [hf] simp [plusSaddleFunction, norm_smul, norm_radialUnitDirection hd, abs_of_nonneg hr] theorem radialProfile_eq_minusSaddleProfile_of_source {ε : ℝ} {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : ∀ x : Euclidean d, f x = minusSaddleFunction ε d x) {r : ℝ} (hr : 0 ≤ r) : radialProfile hd f r = minusSaddleProfile ε ((d : ℝ) / 2) r := by unfold radialProfile rw [hf] simp [minusSaddleFunction, norm_smul, norm_radialUnitDirection hd, abs_of_nonneg hr] theorem exp_neg_rpow_neg_half_dimension {d : ℕ} (u : ℝ) : (Real.exp (-u)) ^ (-((d : ℝ) / 2)) = Real.exp (((d : ℝ) / 2) * u) := by rw [Real.rpow_def_of_pos (Real.exp_pos (-u)), Real.log_exp] congr 1 ring theorem plusSaddleCriticalLogProfile_eq_fourierInv {ε : ℝ} {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : ∀ x : Euclidean d, f x = plusSaddleFunction ε d x) : radialCriticalLogProfile hd f = (𝓕⁻ (plusSaddleFourierData ε ((d : ℝ) / 2)) : ℝ → ℂ) := by funext u unfold radialCriticalLogProfile rw [radialProfile_eq_plusSaddleProfile_of_source hd f hf (Real.exp_pos (-u)).le] rw [plusSaddleProfile_eq_fourier ε ((d : ℝ) / 2) (Real.exp_pos (-u))] rw [exp_neg_rpow_neg_half_dimension, Real.log_exp, Real.fourierInv_eq_fourier_neg] simp only [Complex.real_smul] rw [← mul_assoc, ← Complex.ofReal_mul, ← Real.exp_add] simp theorem minusSaddleCriticalLogProfile_eq_fourierInv {ε : ℝ} {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : ∀ x : Euclidean d, f x = minusSaddleFunction ε d x) : radialCriticalLogProfile hd f = (𝓕⁻ (minusSaddleFourierData ε ((d : ℝ) / 2)) : ℝ → ℂ) := by funext u unfold radialCriticalLogProfile rw [radialProfile_eq_minusSaddleProfile_of_source hd f hf (Real.exp_pos (-u)).le] rw [minusSaddleProfile_eq_fourier ε ((d : ℝ) / 2) (Real.exp_pos (-u))] rw [exp_neg_rpow_neg_half_dimension, Real.log_exp, Real.fourierInv_eq_fourier_neg] simp only [Complex.real_smul] rw [← mul_assoc, ← Complex.ofReal_mul, ← Real.exp_add] simp theorem plusSaddleFourierData_fourier_integrable_of_source {ε : ℝ} {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : ∀ x : Euclidean d, f x = plusSaddleFunction ε d x) : Integrable (𝓕 (plusSaddleFourierData ε ((d : ℝ) / 2)) : ℝ → ℂ) := by have hlog := (radialCriticalLogProfile_integrable hd f).comp_neg apply hlog.congr filter_upwards [] with u have h := congrFun (plusSaddleCriticalLogProfile_eq_fourierInv hd f hf) (-u) simpa [Real.fourierInv_eq_fourier_neg] using! h theorem minusSaddleFourierData_fourier_integrable_of_source {ε : ℝ} {d : ℕ} (hd : 0 < d) (f : TestFunction d) (hf : ∀ x : Euclidean d, f x = minusSaddleFunction ε d x) : Integrable (𝓕 (minusSaddleFourierData ε ((d : ℝ) / 2)) : ℝ → ℂ) := by have hlog := (radialCriticalLogProfile_integrable hd f).comp_neg apply hlog.congr filter_upwards [] with u have h := congrFun (minusSaddleCriticalLogProfile_eq_fourierInv hd f hf) (-u) simpa [Real.fourierInv_eq_fourier_neg] using! h theorem plusSaddle_radialMellinFrequency_of_source {ε : ℝ} (hε : 0 < ε) {d : ℕ} (hd : 0 < d) (horder : shortCutoff ε ≤ shortEndpoint ε) (f : TestFunction d) (hf : ∀ x : Euclidean d, f x = plusSaddleFunction ε d x) (t : ℝ) : radialMellinFrequency hd f t = plusSaddleSpectrum ε ((d : ℝ) / 2) t := by have hdimension : 0 < (d : ℝ) / 2 := div_pos (by exact_mod_cast hd) (by norm_num) have hdata := plusSaddleFourierData_integrable hε hdimension horder have hfourier := plusSaddleFourierData_fourier_integrable_of_source hd f hf have hcontinuous := plusSaddleFourierData_continuous hε hdimension horder rw [radialMellinFrequency_eq_criticalLogFourier, plusSaddleCriticalLogProfile_eq_fourierInv hd f hf] rw [hdata.fourier_fourierInv_eq hfourier hcontinuous.continuousAt] unfold plusSaddleFourierData congr 1 field_simp [Real.pi_ne_zero] theorem minusSaddle_radialMellinFrequency_of_source {ε : ℝ} (hε : 0 < ε) {d : ℕ} (hd : 0 < d) (horder : shortCutoff ε ≤ shortEndpoint ε) (f : TestFunction d) (hf : ∀ x : Euclidean d, f x = minusSaddleFunction ε d x) (t : ℝ) : radialMellinFrequency hd f t = minusSaddleSpectrum ε ((d : ℝ) / 2) t := by have hdimension : 0 < (d : ℝ) / 2 := div_pos (by exact_mod_cast hd) (by norm_num) have hdata := minusSaddleFourierData_integrable hε hdimension horder have hfourier := minusSaddleFourierData_fourier_integrable_of_source hd f hf have hcontinuous := minusSaddleFourierData_continuous hε hdimension horder rw [radialMellinFrequency_eq_criticalLogFourier, minusSaddleCriticalLogProfile_eq_fourierInv hd f hf] rw [hdata.fourier_fourierInv_eq hfourier hcontinuous.continuousAt] unfold minusSaddleFourierData congr 1 field_simp [Real.pi_ne_zero] theorem radialMellinFrequency_injective {d : ℕ} (hd : 0 < d) {f g : TestFunction d} (hf : IsRadial f) (hg : IsRadial g) (hfrequency : ∀ t : ℝ, radialMellinFrequency hd f t = radialMellinFrequency hd g t) : f = g := by have hfourier : (𝓕 (radialCriticalLogProfile hd f) : ℝ → ℂ) = (𝓕 (radialCriticalLogProfile hd g) : ℝ → ℂ) := by funext ξ have h := hfrequency (-(2 * Real.pi * ξ)) rw [radialMellinFrequency_eq_criticalLogFourier, radialMellinFrequency_eq_criticalLogFourier] at h convert! h using 1 <;> field_simp [Real.pi_ne_zero] have hlog : radialCriticalLogProfile hd f = radialCriticalLogProfile hd g := by funext u calc radialCriticalLogProfile hd f u = (𝓕⁻ (𝓕 (radialCriticalLogProfile hd f) : ℝ → ℂ) : ℝ → ℂ) u := ((radialCriticalLogProfile_integrable hd f).fourierInv_fourier_eq (radialCriticalLogProfile_fourier_integrable hd f) (radialCriticalLogProfile_continuous hd f).continuousAt).symm _ = (𝓕⁻ (𝓕 (radialCriticalLogProfile hd g) : ℝ → ℂ) : ℝ → ℂ) u := by rw [hfourier] _ = radialCriticalLogProfile hd g u := (radialCriticalLogProfile_integrable hd g).fourierInv_fourier_eq (radialCriticalLogProfile_fourier_integrable hd g) (radialCriticalLogProfile_continuous hd g).continuousAt have hpositive (r : ℝ) (hr : 0 < r) : radialProfile hd f r = radialProfile hd g r := by have h := congrFun hlog (-Real.log r) simp only [radialCriticalLogProfile, neg_neg, Real.exp_log hr, Complex.real_smul] at h apply mul_left_cancel₀ (Complex.ofReal_ne_zero.mpr (Real.exp_ne_zero (-((d : ℝ) / 2) * -Real.log r))) exact h have heventually : radialProfile hd f =ᶠ[𝓝[>] (0 : ℝ)] radialProfile hd g := by filter_upwards [self_mem_nhdsWithin] with r hr exact hpositive r hr have hleft : Tendsto (radialProfile hd f) (𝓝[>] (0 : ℝ)) (𝓝 (radialProfile hd f 0)) := (radialProfile_continuous hd f).continuousAt.tendsto.mono_left nhdsWithin_le_nhds have hright : Tendsto (radialProfile hd f) (𝓝[>] (0 : ℝ)) (𝓝 (radialProfile hd g 0)) := ((radialProfile_continuous hd g).continuousAt.tendsto.mono_left nhdsWithin_le_nhds).congr' heventually.symm have hzero : radialProfile hd f 0 = radialProfile hd g 0 := tendsto_nhds_unique hleft hright apply SchwartzMap.ext intro x by_cases hx : x = 0 · subst x simpa using! hzero · have hr : 0 < ‖x‖ := norm_pos_iff.mpr hx calc f x = radialProfile hd f ‖x‖ := (radialProfile_norm hd f hf x).symm _ = radialProfile hd g ‖x‖ := hpositive ‖x‖ hr _ = g x := radialProfile_norm hd g hg x theorem plusSaddle_radial_of_source {ε : ℝ} {d : ℕ} (f : TestFunction d) (hf : ∀ x : Euclidean d, f x = plusSaddleFunction ε d x) : IsRadial f := by intro x y hxy rw [hf x, hf y] exact plusSaddleFunction_radial ε d x y hxy theorem minusSaddle_radial_of_source {ε : ℝ} {d : ℕ} (f : TestFunction d) (hf : ∀ x : Euclidean d, f x = minusSaddleFunction ε d x) : IsRadial f := by intro x y hxy rw [hf x, hf y] exact minusSaddleFunction_radial ε d x y hxy theorem plusSaddle_real_of_source {ε : ℝ} {d : ℕ} (f : TestFunction d) (hf : ∀ x : Euclidean d, f x = plusSaddleFunction ε d x) : IsRealValued f := by intro x rw [hf x] exact plusSaddleFunction_real ε d x theorem minusSaddle_real_of_source {ε : ℝ} {d : ℕ} (f : TestFunction d) (hf : ∀ x : Euclidean d, f x = minusSaddleFunction ε d x) : IsRealValued f := by intro x rw [hf x] exact minusSaddleFunction_real ε d x theorem saddleSource_fourier_minus_eq_plus {ε : ℝ} (hε : 0 < ε) {d : ℕ} (hd : 0 < d) (horder : shortCutoff ε ≤ shortEndpoint ε) (fminus fplus : TestFunction d) (hminus : ∀ x : Euclidean d, fminus x = minusSaddleFunction ε d x) (hplus : ∀ x : Euclidean d, fplus x = plusSaddleFunction ε d x) : (𝓕 fminus : TestFunction d) = fplus := by have hdimension : 0 < (d : ℝ) / 2 := div_pos (by exact_mod_cast hd) (by norm_num) have hrminus : IsRadial fminus := minusSaddle_radial_of_source fminus hminus have hrplus : IsRadial fplus := plusSaddle_radial_of_source fplus hplus apply radialMellinFrequency_injective hd (gaussianMellin_fourier_radial hrminus) hrplus intro t calc radialMellinFrequency hd (𝓕 fminus : TestFunction d) t = mellinMultiplier ((d : ℝ) / 2) t * radialMellinFrequency hd fminus (-t) := radialMellinMultiplier hd fminus hrminus t _ = mellinMultiplier ((d : ℝ) / 2) t * minusSaddleSpectrum ε ((d : ℝ) / 2) (-t) := by rw [minusSaddle_radialMellinFrequency_of_source hε hd horder fminus hminus] _ = plusSaddleSpectrum ε ((d : ℝ) / 2) t := mellinMultiplier_mul_minusSaddleSpectrum_neg hdimension t _ = radialMellinFrequency hd fplus t := (plusSaddle_radialMellinFrequency_of_source hε hd horder fplus hplus t).symm theorem saddleSource_zero_pos {ε : ℝ} (hε : 0 < ε) {d : ℕ} (fminus fplus : TestFunction d) (hminus : ∀ x : Euclidean d, fminus x = minusSaddleFunction ε d x) (hplus : ∀ x : Euclidean d, fplus x = plusSaddleFunction ε d x) : 0 < (fminus (0 : Euclidean d)).re ∧ 0 < (fplus (0 : Euclidean d)).re := by rw [hminus, hplus] exact (saddleFunction_zero_pos hε d).symm theorem saddleSource_zero_eq {ε : ℝ} {d : ℕ} (fminus fplus : TestFunction d) (hminus : ∀ x : Euclidean d, fminus x = minusSaddleFunction ε d x) (hplus : ∀ x : Euclidean d, fplus x = plusSaddleFunction ε d x) : fminus (0 : Euclidean d) = fplus (0 : Euclidean d) := by rw [hminus, hplus, minusSaddleFunction_zero, plusSaddleFunction_zero] def saddleSourceAdmissible {ε : ℝ} (hε : 0 < ε) {d : ℕ} (hd : 0 < d) (horder : shortCutoff ε ≤ shortEndpoint ε) {R : ℝ} (hR : 0 < R) (fminus fplus : TestFunction d) (hminus : ∀ x : Euclidean d, fminus x = minusSaddleFunction ε d x) (hplus : ∀ x : Euclidean d, fplus x = plusSaddleFunction ε d x) (hplusnonneg : ∀ x : Euclidean d, 0 ≤ (plusSaddleFunction ε d x).re) (hminusoutside : ∀ x : Euclidean d, R ≤ ‖x‖ → (minusSaddleFunction ε d x).re ≤ 0) : Admissible d := by have hfourier : (𝓕 fminus : TestFunction d) = fplus := saddleSource_fourier_minus_eq_plus hε hd horder fminus fplus hminus hplus have hrealplus : IsRealValued fplus := plusSaddle_real_of_source fplus hplus have hnonneg (ξ : Euclidean d) : 0 ≤ (fplus ξ).re := by rw [hplus ξ] exact hplusnonneg ξ have hzero : 0 < (fplus (0 : Euclidean d)).re := (saddleSource_zero_pos hε fminus fplus hminus hplus).2 refine { function := dilate fminus R hR real := (minusSaddle_real_of_source fminus hminus).dilate R hR radial := (minusSaddle_radial_of_source fminus hminus).dilate R hR fourier_real := ?_ fourier_nonneg := ?_ fourier_zero_pos := ?_ outside_nonpos := ?_ } · intro ξ rw [fourier_dilate_apply, hfourier, Complex.smul_im, hrealplus (R⁻¹ • ξ)] simp · intro ξ rw [fourier_dilate_apply, hfourier, Complex.smul_re] simpa [smul_eq_mul] using! mul_nonneg (inv_nonneg.mpr (pow_nonneg hR.le d)) (hnonneg (R⁻¹ • ξ)) · rw [fourier_dilate_zero, hfourier, Complex.smul_re] simpa [smul_eq_mul] using! mul_pos (inv_pos.mpr (pow_pos hR d)) hzero · intro x hx change (fminus (R • x)).re ≤ 0 rw [hminus] apply hminusoutside have hscaled := mul_le_mul_of_nonneg_left hx hR.le simpa [norm_smul, Real.norm_eq_abs, abs_of_pos hR] using! hscaled @[simp] theorem saddleSourceAdmissible_function {ε : ℝ} (hε : 0 < ε) {d : ℕ} (hd : 0 < d) (horder : shortCutoff ε ≤ shortEndpoint ε) {R : ℝ} (hR : 0 < R) (fminus fplus : TestFunction d) (hminus : ∀ x : Euclidean d, fminus x = minusSaddleFunction ε d x) (hplus : ∀ x : Euclidean d, fplus x = plusSaddleFunction ε d x) (hplusnonneg : ∀ x : Euclidean d, 0 ≤ (plusSaddleFunction ε d x).re) (hminusoutside : ∀ x : Euclidean d, R ≤ ‖x‖ → (minusSaddleFunction ε d x).re ≤ 0) : (saddleSourceAdmissible hε hd horder hR fminus fplus hminus hplus hplusnonneg hminusoutside).function = dilate fminus R hR := by rfl theorem saddleSourceAdmissible_quotient {ε : ℝ} (hε : 0 < ε) {d : ℕ} (hd : 0 < d) (horder : shortCutoff ε ≤ shortEndpoint ε) {R : ℝ} (hR : 0 < R) (fminus fplus : TestFunction d) (hminus : ∀ x : Euclidean d, fminus x = minusSaddleFunction ε d x) (hplus : ∀ x : Euclidean d, fplus x = plusSaddleFunction ε d x) (hplusnonneg : ∀ x : Euclidean d, 0 ≤ (plusSaddleFunction ε d x).re) (hminusoutside : ∀ x : Euclidean d, R ≤ ‖x‖ → (minusSaddleFunction ε d x).re ≤ 0) : quotient (saddleSourceAdmissible hε hd horder hR fminus fplus hminus hplus hplusnonneg hminusoutside) = R ^ d := by have hfourier : (𝓕 fminus : TestFunction d) = fplus := saddleSource_fourier_minus_eq_plus hε hd horder fminus fplus hminus hplus have hzero : 0 < (fplus (0 : Euclidean d)).re := (saddleSource_zero_pos hε fminus fplus hminus hplus).2 have hpow : R ^ d ≠ 0 := pow_ne_zero d hR.ne' unfold quotient rw [saddleSourceAdmissible_function hε hd horder hR fminus fplus hminus hplus hplusnonneg hminusoutside] rw [dilate_zero] change (fminus (0 : Euclidean d)).re / ((𝓕 (dilate fminus R hR) : TestFunction d) (0 : Euclidean d)).re = R ^ d rw [fourier_dilate_zero, hfourier, saddleSource_zero_eq fminus fplus hminus hplus, Complex.smul_re] simp only [smul_eq_mul] field_simp [hpow, hzero.ne'] theorem saddleSourceAdmissible_normalizedCost {ε : ℝ} (hε : 0 < ε) {d : ℕ} (hd : 0 < d) (horder : shortCutoff ε ≤ shortEndpoint ε) {R : ℝ} (hR : 0 < R) (fminus fplus : TestFunction d) (hminus : ∀ x : Euclidean d, fminus x = minusSaddleFunction ε d x) (hplus : ∀ x : Euclidean d, fplus x = plusSaddleFunction ε d x) (hplusnonneg : ∀ x : Euclidean d, 0 ≤ (plusSaddleFunction ε d x).re) (hminusoutside : ∀ x : Euclidean d, R ≤ ‖x‖ → (minusSaddleFunction ε d x).re ≤ 0) : normalizedCost (saddleSourceAdmissible hε hd horder hR fminus fplus hminus hplus hplusnonneg hminusoutside) = R / Real.sqrt (d : ℝ) := by calc normalizedCost (saddleSourceAdmissible hε hd horder hR fminus fplus hminus hplus hplusnonneg hminusoutside) = (R ^ d : ℝ) ^ ((d : ℝ)⁻¹) / Real.sqrt (d : ℝ) := by unfold normalizedCost rw [saddleSourceAdmissible_quotient hε hd horder hR fminus fplus hminus hplus hplusnonneg hminusoutside] _ = R / Real.sqrt (d : ℝ) := by congr 1 rw [← Real.rpow_natCast_mul hR.le] rw [mul_inv_cancel₀ (by exact_mod_cast hd.ne'), Real.rpow_one] def saddleDigamma (x : ℝ) : ℝ := deriv (Real.log ∘ Real.Gamma) x def saddleLogRadius (ε : ℝ) (d : ℕ) (u : ℝ) : ℝ := -(Real.log Real.pi) / 2 + saddleDigamma (((d : ℝ) / 2) * (1 + u) / 2) / 2 + (∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * a * Real.sinh (u * a)) + (∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * a * Real.sinh (u * a)) def saddleSourceRadius (ε : ℝ) (d : ℕ) : ℝ := Real.exp (saddleLogRadius ε d (1 + ε / 4)) theorem saddleSourceRadius_pos (ε : ℝ) (d : ℕ) : 0 < saddleSourceRadius ε d := by exact Real.exp_pos _ theorem saddleLogGamma_add_one {x : ℝ} (hx : 0 < x) : (Real.log ∘ Real.Gamma) (x + 1) = (Real.log ∘ Real.Gamma) x + Real.log x := by simp only [Function.comp_apply, Real.Gamma_add_one hx.ne', Real.log_mul hx.ne' (Real.Gamma_pos_of_pos hx).ne'] ring theorem saddleLogGamma_differentiableAt {x : ℝ} (hx : 0 < x) : DifferentiableAt ℝ (Real.log ∘ Real.Gamma) x := by exact (Real.differentiableAt_Gamma (fun n => ne_of_gt (by have hn : 0 ≤ (n : ℝ) := Nat.cast_nonneg n linarith))).log (Real.Gamma_pos_of_pos hx).ne' theorem saddleDigamma_bounds {x : ℝ} (hx : 1 < x) : Real.log (x - 1) ≤ saddleDigamma x ∧ saddleDigamma x ≤ Real.log x := by have hxpositive : 0 < x := by linarith have hxprevious : 0 < x - 1 := by linarith have hnext : 0 < x + 1 := by linarith have hdiff := saddleLogGamma_differentiableAt hxpositive constructor · have hconv := Real.convexOn_log_Gamma.slope_le_deriv (show x - 1 ∈ Ioi (0 : ℝ) from hxprevious) (show x ∈ Ioi (0 : ℝ) from hxpositive) (show x - 1 < x by linarith) hdiff have hrec := saddleLogGamma_add_one hxprevious have hshift : (x - 1) + 1 = x := by ring rw [hshift] at hrec unfold saddleDigamma rw [slope_def_field] at hconv have hden : x - (x - 1) = (1 : ℝ) := by ring rw [hden, div_one, hrec] at hconv simpa using! hconv · have hconv := Real.convexOn_log_Gamma.deriv_le_slope (show x ∈ Ioi (0 : ℝ) from hxpositive) (show x + 1 ∈ Ioi (0 : ℝ) from hnext) (show x < x + 1 by linarith) hdiff have hrec := saddleLogGamma_add_one hxpositive unfold saddleDigamma rw [slope_def_field] at hconv have hden : (x + 1) - x = (1 : ℝ) := by ring rw [hden, div_one, hrec] at hconv simpa using! hconv theorem tendsto_saddleDigamma_sub_log : Tendsto (fun x : ℝ => saddleDigamma x - Real.log x) atTop (𝓝 (0 : ℝ)) := by have hinv : Tendsto (fun x : ℝ => x⁻¹) atTop (𝓝 (0 : ℝ)) := tendsto_inv_atTop_zero have hargument : Tendsto (fun x : ℝ => 1 - x⁻¹) atTop (𝓝 (1 : ℝ)) := by simpa using! (tendsto_const_nhds.sub hinv) have hlog : Tendsto (fun x : ℝ => Real.log (1 - x⁻¹)) atTop (𝓝 (0 : ℝ)) := by convert! (Real.continuousAt_log (show (1 : ℝ) ≠ 0 by norm_num)).tendsto.comp hargument using 1 all_goals simp have hlower : Tendsto (fun x : ℝ => Real.log (x - 1) - Real.log x) atTop (𝓝 (0 : ℝ)) := by refine hlog.congr' ?_ filter_upwards [eventually_gt_atTop (1 : ℝ)] with x hx have hxzero : x ≠ 0 := by linarith have hxprevious : x - 1 ≠ 0 := by linarith rw [← Real.log_div hxprevious hxzero] congr 1 field_simp refine tendsto_of_tendsto_of_tendsto_of_le_of_le' hlower (tendsto_const_nhds (x := (0 : ℝ))) ?_ ?_ · filter_upwards [eventually_gt_atTop (1 : ℝ)] with x hx exact sub_le_sub_right (saddleDigamma_bounds hx).1 _ · filter_upwards [eventually_gt_atTop (1 : ℝ)] with x hx exact sub_nonpos.mpr (saddleDigamma_bounds hx).2 theorem saddle_exp_half_log_eq_sqrt {x : ℝ} (hx : 0 < x) : Real.exp (Real.log x / 2) = Real.sqrt x := by rw [← Real.log_sqrt hx.le, Real.exp_log (Real.sqrt_pos.2 hx)] def saddleCriticalGammaArgument (ε : ℝ) (d : ℕ) : ℝ := ((d : ℝ) / 2) * (2 + ε / 4) / 2 theorem saddleCriticalGammaArgument_pos {ε : ℝ} (hε : 0 < ε) {d : ℕ} (hd : 0 < d) : 0 < saddleCriticalGammaArgument ε d := by unfold saddleCriticalGammaArgument positivity theorem tendsto_saddleCriticalGammaArgument_atTop {ε : ℝ} (hε : 0 < ε) : Tendsto (saddleCriticalGammaArgument ε) atTop atTop := by have hc : 0 < (2 + ε / 4) / 4 := by positivity have h := (tendsto_natCast_atTop_atTop (R := ℝ)).atTop_mul_const hc refine h.congr' ?_ filter_upwards [] with d unfold saddleCriticalGammaArgument ring theorem saddleLogRadius_critical_eq (ε : ℝ) (d : ℕ) : saddleLogRadius ε d (1 + ε / 4) = -(Real.log Real.pi) / 2 + saddleDigamma (saddleCriticalGammaArgument ε d) / 2 + shortShellRadiusContribution ε + positiveShellRadiusContribution ε := by unfold saddleLogRadius saddleCriticalGammaArgument shortShellRadiusContribution shortShellRadiusIntegrand positiveShellRadiusContribution congr 2 ring_nf theorem saddleSourceRadius_div_sqrt_eq {ε : ℝ} (hε : 0 < ε) {d : ℕ} (hd : 0 < d) : saddleSourceRadius ε d / Real.sqrt (d : ℝ) = Real.exp ((saddleDigamma (saddleCriticalGammaArgument ε d) - Real.log (saddleCriticalGammaArgument ε d)) / 2) * limitingSaddleRadius ε := by let a : ℝ := 2 + ε / 4 let m : ℝ := saddleCriticalGammaArgument ε d let S : ℝ := shortShellRadiusContribution ε + positiveShellRadiusContribution ε have ha : 0 < a := by try dsimp [a] positivity have hdreal : 0 < (d : ℝ) := by exact_mod_cast hd have hm : 0 < m := saddleCriticalGammaArgument_pos hε hd have hquotient : 0 < a / (4 * Real.pi) := by positivity have hmformula : m = (d : ℝ) * a / 4 := by try dsimp [m, a, saddleCriticalGammaArgument] ring have hlogm : Real.log m = Real.log (d : ℝ) + Real.log a - Real.log (4 : ℝ) := by rw [hmformula, Real.log_div (mul_ne_zero hdreal.ne' ha.ne') (by norm_num : (4 : ℝ) ≠ 0), Real.log_mul hdreal.ne' ha.ne'] have hlogquotient : Real.log (a / (4 * Real.pi)) = Real.log a - Real.log (4 : ℝ) - Real.log Real.pi := by rw [Real.log_div ha.ne' (mul_ne_zero (by norm_num : (4 : ℝ) ≠ 0) Real.pi_ne_zero), Real.log_mul (by norm_num : (4 : ℝ) ≠ 0) Real.pi_ne_zero] ring have hv : saddleLogRadius ε d (1 + ε / 4) = -(Real.log Real.pi) / 2 + saddleDigamma m / 2 + S := by rw [saddleLogRadius_critical_eq] try dsimp [m, S] ring calc saddleSourceRadius ε d / Real.sqrt (d : ℝ) = Real.exp (-(Real.log Real.pi) / 2 + saddleDigamma m / 2 + S - Real.log (d : ℝ) / 2) := by unfold saddleSourceRadius rw [hv, ← saddle_exp_half_log_eq_sqrt hdreal, ← Real.exp_sub] _ = Real.exp ((saddleDigamma m - Real.log m) / 2 + Real.log (a / (4 * Real.pi)) / 2 + S) := by congr 1 rw [hlogm, hlogquotient] ring _ = Real.exp ((saddleDigamma m - Real.log m) / 2) * Real.sqrt (a / (4 * Real.pi)) * Real.exp S := by rw [Real.exp_add, Real.exp_add, saddle_exp_half_log_eq_sqrt hquotient] _ = Real.exp ((saddleDigamma (saddleCriticalGammaArgument ε d) - Real.log (saddleCriticalGammaArgument ε d)) / 2) * limitingSaddleRadius ε := by unfold limitingSaddleRadius try dsimp [m, a, S] ring theorem tendsto_saddleSourceRadius_normalized {ε : ℝ} (hε : 0 < ε) : Tendsto (fun d : ℕ => saddleSourceRadius ε d / Real.sqrt (d : ℝ)) atTop (𝓝 (limitingSaddleRadius ε)) := by have hargument := tendsto_saddleDigamma_sub_log.comp (tendsto_saddleCriticalGammaArgument_atTop hε) have hhalf : Tendsto (fun d : ℕ => (saddleDigamma (saddleCriticalGammaArgument ε d) - Real.log (saddleCriticalGammaArgument ε d)) / 2) atTop (𝓝 (0 : ℝ)) := by simpa using! hargument.div_const (2 : ℝ) have hcorrection : Tendsto (fun d : ℕ => Real.exp ((saddleDigamma (saddleCriticalGammaArgument ε d) - Real.log (saddleCriticalGammaArgument ε d)) / 2)) atTop (𝓝 (1 : ℝ)) := by simpa using! hhalf.rexp have htarget : Tendsto (fun d : ℕ => Real.exp ((saddleDigamma (saddleCriticalGammaArgument ε d) - Real.log (saddleCriticalGammaArgument ε d)) / 2) * limitingSaddleRadius ε) atTop (𝓝 (limitingSaddleRadius ε)) := by simpa using! hcorrection.mul_const (limitingSaddleRadius ε) refine htarget.congr' ?_ filter_upwards [eventually_gt_atTop (0 : ℕ)] with d hd exact (saddleSourceRadius_div_sqrt_eq hε hd).symm end noncomputable section open Filter MeasureTheory Set open scoped Topology def saddleSourceMellinContour (ℓ u T : ℝ) : ℂ := ((ℓ * (1 + u) : ℝ) : ℂ) - Complex.I * ((ℓ * T : ℝ) : ℂ) theorem saddleSourceMellinContour_shellArgument {ℓ : ℝ} (hℓ : 0 < ℓ) (u T : ℝ) : Complex.I * (saddleSourceMellinContour ℓ u T - (ℓ : ℂ)) / (ℓ : ℂ) = (T : ℂ) + Complex.I * (u : ℂ) := by have hℓcomplex : (ℓ : ℂ) ≠ 0 := by exact_mod_cast hℓ.ne' unfold saddleSourceMellinContour push_cast field_simp ring_nf simp [Complex.I_sq] theorem saddleSourceMellinContour_gammaArgument (ℓ u T : ℝ) : saddleSourceMellinContour ℓ u T / 2 = ((ℓ * (1 + u) / 2 : ℝ) : ℂ) - Complex.I * ((ℓ * T / 2 : ℝ) : ℂ) := by unfold saddleSourceMellinContour push_cast ring theorem norm_saddleShellExponential_eq_exp_neg_damping {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (ℓ T u : ℝ) : ‖Complex.exp ((ℓ : ℂ) * mellinShellPhase ε ((T : ℂ) + Complex.I * (u : ℂ)))‖ = Real.exp (ℓ * realHyperbolicShellPhase ε u) * Real.exp (-(positiveShellDamping ε ℓ (u - 1) T - upperShortShellDamping ε ℓ (u - 1) T)) := by rw [Complex.norm_exp] simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero] have hphase := saddleShellPhase_damping_identity hε horder ℓ T u rw [← Real.exp_add] congr 1 linarith def saddleSourceShellDerivative (ε u : ℝ) : ℝ := (∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * a * Real.sinh (u * a)) + (∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * a * Real.sinh (u * a)) theorem saddleSourceShellDerivative_one (ε : ℝ) : saddleSourceShellDerivative ε 1 = saddleShellDerivativeOne ε := by simp [saddleSourceShellDerivative, saddleShellDerivativeOne] theorem saddleSourceShellDerivative_neg (ε u : ℝ) : saddleSourceShellDerivative ε (-u) = -saddleSourceShellDerivative ε u := by unfold saddleSourceShellDerivative have hshort : (∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * a * Real.sinh (-u * a)) = -(∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * a * Real.sinh (u * a)) := by rw [← intervalIntegral.integral_neg] apply intervalIntegral.integral_congr intro a ha change shortShellDensity ε a * a * Real.sinh (-u * a) = -(shortShellDensity ε a * a * Real.sinh (u * a)) rw [neg_mul, Real.sinh_neg] ring have hpositive : (∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * a * Real.sinh (-u * a)) = -(∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * a * Real.sinh (u * a)) := by rw [← intervalIntegral.integral_neg] apply intervalIntegral.integral_congr intro a ha change positiveShellDensity ε a * a * Real.sinh (-u * a) = -(positiveShellDensity ε a * a * Real.sinh (u * a)) rw [neg_mul, Real.sinh_neg] ring rw [hshort, hpositive] ring theorem saddleLogRadius_eq_digamma_add_shellDerivative (ε : ℝ) (d : ℕ) (u : ℝ) : saddleLogRadius ε d u = -(Real.log Real.pi) / 2 + saddleDigamma (((d : ℝ) / 2) * (1 + u) / 2) / 2 + saddleSourceShellDerivative ε u := by unfold saddleLogRadius saddleSourceShellDerivative ring def saddleSmallRadiusStarOrdinate (ε : ℝ) (d : ℕ) : ℝ := let _sourceParameter : ℝ := ε show ℝ from -1 + Real.log ((d : ℝ) / 2) / (4 * ((d : ℝ) / 2)) def saddleSmallRadiusStar (ε : ℝ) (d : ℕ) : ℝ := Real.exp (saddleLogRadius ε d (saddleSmallRadiusStarOrdinate ε d)) theorem saddleSmallRadiusStar_pos (ε : ℝ) (d : ℕ) : 0 < saddleSmallRadiusStar ε d := by unfold saddleSmallRadiusStar exact Real.exp_pos _ theorem saddleSmallRadiusStar_gammaArgument {d : ℕ} (hd : 0 < d) (ε : ℝ) : ((d : ℝ) / 2) * (1 + saddleSmallRadiusStarOrdinate ε d) / 2 = Real.log ((d : ℝ) / 2) / 8 := by have hdreal : (d : ℝ) ≠ 0 := by exact_mod_cast hd.ne' unfold saddleSmallRadiusStarOrdinate field_simp ring theorem saddleSourceShellDerivative_eq_deriv {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (u : ℝ) : saddleSourceShellDerivative ε u = deriv (realHyperbolicShellPhase ε) u := by have h := (realHyperbolicShellPhase_hasDerivAt hε horder u).deriv unfold saddleSourceShellDerivative simpa [mul_comm] using! h.symm theorem saddleSourceShellDerivative_contDiff_one {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : ContDiff ℝ (1 : WithTop ℕ∞) (saddleSourceShellDerivative ε) := by have hphase : ContDiff ℝ ((1 : WithTop ℕ∞) + 1) (realHyperbolicShellPhase ε) := by convert! realHyperbolicShellPhase_contDiff hε horder (2 : WithTop ℕ∞) using 1 have hderiv : ContDiff ℝ (1 : WithTop ℕ∞) (deriv (realHyperbolicShellPhase ε)) := (contDiff_succ_iff_deriv.mp hphase).2.2 have heq : saddleSourceShellDerivative ε = deriv (realHyperbolicShellPhase ε) := by funext u exact saddleSourceShellDerivative_eq_deriv hε horder u rw [heq] exact hderiv theorem saddleSmallRadiusVariable_star_eq {ε : ℝ} {d : ℕ} (hd : 0 < d) : saddleSmallRadiusVariable ε (saddleSmallRadiusStar ε d) = Real.exp (saddleDigamma (Real.log ((d : ℝ) / 2) / 8) + 2 * (saddleShellDerivativeOne ε + saddleSourceShellDerivative ε (saddleSmallRadiusStarOrdinate ε d))) := by have hpi : Real.pi = Real.exp (Real.log Real.pi) := (Real.exp_log Real.pi_pos).symm unfold saddleSmallRadiusVariable saddleSmallRadiusStar rw [saddleLogRadius_eq_digamma_add_shellDerivative, saddleSmallRadiusStar_gammaArgument hd ε] nth_rw 1 [hpi] rw [show (Real.exp (-(Real.log Real.pi) / 2 + saddleDigamma (Real.log ((d : ℝ) / 2) / 8) / 2 + saddleSourceShellDerivative ε (saddleSmallRadiusStarOrdinate ε d))) ^ 2 = Real.exp (2 * (-(Real.log Real.pi) / 2 + saddleDigamma (Real.log ((d : ℝ) / 2) / 8) / 2 + saddleSourceShellDerivative ε (saddleSmallRadiusStarOrdinate ε d))) by rw [pow_two, ← Real.exp_add] congr 1 ring] rw [← Real.exp_add, ← Real.exp_add] congr 1 ring theorem saddleSourceShellDerivative_neg_one (ε : ℝ) : saddleSourceShellDerivative ε (-1) = -saddleShellDerivativeOne ε := by simpa [saddleSourceShellDerivative_one] using! saddleSourceShellDerivative_neg ε 1 theorem exists_saddleSourceShellDerivative_endpoint_bound {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : ∃ C : ℝ, 0 ≤ C ∧ ∀ u ∈ Icc (-1 : ℝ) 0, |saddleShellDerivativeOne ε + saddleSourceShellDerivative ε u| ≤ C * (u + 1) := by have hcont : ContDiffOn ℝ ((0 : WithTop ℕ∞) + 1) (saddleSourceShellDerivative ε) (Icc (-1 : ℝ) 0) := by convert! (saddleSourceShellDerivative_contDiff_one hε horder).contDiffOn using 1 obtain ⟨C, hC⟩ := exists_taylor_mean_remainder_bound (f := saddleSourceShellDerivative ε) (n := 0) (by norm_num : (-1 : ℝ) ≤ 0) hcont refine ⟨max C 0, le_max_right _ _, ?_⟩ intro u hu have hbound := hC u hu simp only [taylor_within_zero_eval, Real.norm_eq_abs, Nat.zero_add, pow_one] at hbound rw [saddleSourceShellDerivative_neg_one] at hbound have hidentity : saddleShellDerivativeOne ε + saddleSourceShellDerivative ε u = saddleSourceShellDerivative ε u - -saddleShellDerivativeOne ε := by ring rw [hidentity] calc |saddleSourceShellDerivative ε u - -saddleShellDerivativeOne ε| ≤ C * (u - -1) := hbound _ ≤ max C 0 * (u + 1) := by have hnonneg : 0 ≤ u + 1 := by linarith [hu.1] calc C * (u - -1) = C * (u + 1) := by ring _ ≤ max C 0 * (u + 1) := mul_le_mul_of_nonneg_right (le_max_left _ _) hnonneg theorem saddle_log_sq_le_four_mul {x : ℝ} (hx : 1 ≤ x) : (Real.log x) ^ 2 ≤ 4 * x := by have hxpos : 0 < x := by linarith have hspos : 0 < Real.sqrt x := Real.sqrt_pos.2 hxpos have hsquare := Real.sq_sqrt hxpos.le have hlogsplit : Real.log x = 2 * Real.log (Real.sqrt x) := by rw [← hsquare, Real.log_pow] norm_num have hslog := Real.log_le_sub_one_of_pos hspos have hlognonnegative : 0 ≤ Real.log x := Real.log_nonneg hx have hupper : Real.log x ≤ 2 * Real.sqrt x := by rw [hlogsplit] nlinarith have hfactor := mul_nonneg (sub_nonneg.mpr hupper) (add_nonneg (mul_nonneg (by norm_num : (0 : ℝ) ≤ 2) (Real.sqrt_nonneg x)) hlognonnegative) nlinarith theorem exists_saddleSmallRadiusStar_coordinate_bound {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : ∃ C : ℝ, 0 ≤ C ∧ ∀ d : ℕ, 8 < Real.log ((d : ℝ) / 2) → saddleSmallRadiusVariable ε (saddleSmallRadiusStar ε d) ≤ Real.log ((d : ℝ) / 2) / 8 + C := by obtain ⟨K, hK, hKbound⟩ := exists_saddleSourceShellDerivative_endpoint_bound hε horder let C : ℝ := K / 4 * Real.exp (K / 2) have hC : 0 ≤ C := by try dsimp [C] positivity refine ⟨C, hC, ?_⟩ intro d hloglarge let ℓ : ℝ := (d : ℝ) / 2 let m : ℝ := Real.log ℓ / 8 let q : ℝ := Real.log ℓ / (4 * ℓ) let z : ℝ := 2 * K * q have hℓnonnegative : 0 ≤ ℓ := by try dsimp [ℓ] positivity have hlogpositive : 0 < Real.log ℓ := by try dsimp [ℓ] linarith have hℓone : 1 < ℓ := (Real.log_pos_iff hℓnonnegative).mp hlogpositive have hℓ : 0 < ℓ := by linarith have hdreal : 0 < (d : ℝ) := by try dsimp [ℓ] at hℓ linarith have hd : 0 < d := by exact_mod_cast hdreal have hm : 1 < m := by try dsimp [m, ℓ] linarith have hmpositive : 0 < m := by linarith have hqnonnegative : 0 ≤ q := by try dsimp [q] positivity have hlogupper : Real.log ℓ ≤ ℓ := by linarith [Real.log_le_sub_one_of_pos hℓ] have hqbound : q ≤ 1 / 4 := by try dsimp [q] apply (div_le_iff₀ (show 0 < 4 * ℓ by positivity)).mpr nlinarith have hstar : saddleSmallRadiusStarOrdinate ε d = -1 + q := by rfl have huinterval : saddleSmallRadiusStarOrdinate ε d ∈ Icc (-1 : ℝ) 0 := by rw [hstar] constructor <;> linarith have hshell : saddleShellDerivativeOne ε + saddleSourceShellDerivative ε (saddleSmallRadiusStarOrdinate ε d) ≤ K * q := by calc saddleShellDerivativeOne ε + saddleSourceShellDerivative ε (saddleSmallRadiusStarOrdinate ε d) ≤ |saddleShellDerivativeOne ε + saddleSourceShellDerivative ε (saddleSmallRadiusStarOrdinate ε d)| := le_abs_self _ _ ≤ K * (saddleSmallRadiusStarOrdinate ε d + 1) := hKbound _ huinterval _ = K * q := by rw [hstar] ring have hznonnegative : 0 ≤ z := by try dsimp [z] positivity have hzupper : z ≤ K / 2 := by try dsimp [z] calc 2 * K * q ≤ 2 * K * (1 / 4 : ℝ) := by gcongr _ = K / 2 := by ring have hlogquad := saddle_log_sq_le_four_mul hℓone.le have hmz : m * z ≤ K / 4 := by have hid : m * z = K * (Real.log ℓ) ^ 2 / (16 * ℓ) := by try dsimp [m, z, q] field_simp ring rw [hid] apply (div_le_iff₀ (show 0 < 16 * ℓ by positivity)).mpr nlinarith [mul_nonneg hK (sub_nonneg.mpr hlogquad)] have hexpdifference : Real.exp z - 1 ≤ z * Real.exp z := by have hsource := abs_exp_sub_one_le_abs_mul_exp_abs z rw [abs_of_nonneg (sub_nonneg.mpr (by simpa using! Real.exp_le_exp.mpr hznonnegative)), abs_of_nonneg hznonnegative] at hsource exact hsource have hproduct : m * Real.exp z ≤ m + K / 4 * Real.exp (K / 2) := by have hdifference := mul_le_mul_of_nonneg_left hexpdifference hmpositive.le have hexpbound := Real.exp_le_exp.mpr hzupper have hscaled : m * z * Real.exp z ≤ (K / 4) * Real.exp (K / 2) := by exact mul_le_mul hmz hexpbound (Real.exp_pos z).le (by positivity) nlinarith calc saddleSmallRadiusVariable ε (saddleSmallRadiusStar ε d) = Real.exp (saddleDigamma m + 2 * (saddleShellDerivativeOne ε + saddleSourceShellDerivative ε (saddleSmallRadiusStarOrdinate ε d))) := by simpa [m, ℓ] using! saddleSmallRadiusVariable_star_eq (ε := ε) hd _ ≤ Real.exp (Real.log m + z) := by apply Real.exp_le_exp.mpr have hdigamma := (saddleDigamma_bounds hm).2 try dsimp [z] linarith _ = m * Real.exp z := by rw [Real.exp_add, Real.exp_log hmpositive] _ ≤ m + K / 4 * Real.exp (K / 2) := hproduct _ = Real.log ((d : ℝ) / 2) / 8 + C := by rfl theorem exists_eventually_y_star_le_log_eighth_add {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : ∃ C : ℝ, 0 ≤ C ∧ ∀ᶠ d : ℕ in atTop, ∀ r : ℝ, 0 ≤ r → r ≤ saddleSmallRadiusStar ε d → saddleSmallRadiusVariable ε r ≤ Real.log ((d : ℝ) / 2) / 8 + C := by obtain ⟨C, hC, hstar⟩ := exists_saddleSmallRadiusStar_coordinate_bound hε horder refine ⟨C, hC, ?_⟩ have hcast : Tendsto (fun d : ℕ => (d : ℝ)) atTop atTop := tendsto_natCast_atTop_atTop have hlarge : ∀ᶠ d : ℕ in atTop, 2 * Real.exp 8 < (d : ℝ) := hcast.eventually (eventually_gt_atTop (2 * Real.exp 8)) filter_upwards [hlarge] with d hd intro r hr hrstar have hℓ : 0 < (d : ℝ) / 2 := by have he := Real.exp_pos (8 : ℝ) linarith have hlog : 8 < Real.log ((d : ℝ) / 2) := by apply (Real.lt_log_iff_exp_lt hℓ).mpr linarith have hstarpositive : 0 < saddleSmallRadiusStar ε d := saddleSmallRadiusStar_pos ε d have hsquare : r ^ 2 ≤ (saddleSmallRadiusStar ε d) ^ 2 := by nlinarith [mul_nonneg (sub_nonneg.mpr hrstar) (add_nonneg hstarpositive.le hr)] calc saddleSmallRadiusVariable ε r ≤ saddleSmallRadiusVariable ε (saddleSmallRadiusStar ε d) := by unfold saddleSmallRadiusVariable gcongr _ ≤ Real.log ((d : ℝ) / 2) / 8 + C := hstar d hlog def saddleSmallResidueTruncation (ℓ : ℝ) : ℕ := Nat.ceil (20 * Real.log ℓ) theorem saddleSmallResidueTruncation_lower (ℓ : ℝ) : 20 * Real.log ℓ ≤ (saddleSmallResidueTruncation ℓ : ℝ) := by exact Nat.le_ceil (20 * Real.log ℓ) theorem saddleSmallResidueTruncation_upper {ℓ : ℝ} (hℓ : 1 ≤ ℓ) : (saddleSmallResidueTruncation ℓ : ℝ) ≤ 20 * Real.log ℓ + 1 := by exact (Nat.ceil_lt_add_one (mul_nonneg (by norm_num) (Real.log_nonneg hℓ))).le theorem tendsto_logLinear_div_atTop : Tendsto (fun ℓ : ℝ => (20 * Real.log ℓ + 1) / ℓ) atTop (𝓝 0) := by have hlog : Tendsto (fun ℓ : ℝ => Real.log ℓ / ℓ) atTop (𝓝 0) := by simpa using! Real.tendsto_pow_log_div_mul_add_atTop 1 0 1 (by norm_num : (1 : ℝ) ≠ 0) have hinv : Tendsto (fun ℓ : ℝ => (1 : ℝ) / ℓ) atTop (𝓝 0) := by simpa [one_div] using! (tendsto_inv_atTop_zero : Tendsto (fun ℓ : ℝ => ℓ⁻¹) atTop (𝓝 0)) convert! (hlog.const_mul 20).add hinv using 1 · funext ℓ ring · norm_num theorem tendsto_logLinear_sq_div_atTop : Tendsto (fun ℓ : ℝ => (20 * Real.log ℓ + 1) ^ 2 / ℓ) atTop (𝓝 0) := by have hlog1 : Tendsto (fun ℓ : ℝ => Real.log ℓ / ℓ) atTop (𝓝 0) := by simpa using! Real.tendsto_pow_log_div_mul_add_atTop 1 0 1 (by norm_num : (1 : ℝ) ≠ 0) have hlog2 : Tendsto (fun ℓ : ℝ => Real.log ℓ ^ 2 / ℓ) atTop (𝓝 0) := by simpa using! Real.tendsto_pow_log_div_mul_add_atTop 1 0 2 (by norm_num : (1 : ℝ) ≠ 0) have hinv : Tendsto (fun ℓ : ℝ => (1 : ℝ) / ℓ) atTop (𝓝 0) := by simpa [one_div] using! (tendsto_inv_atTop_zero : Tendsto (fun ℓ : ℝ => ℓ⁻¹) atTop (𝓝 0)) convert! ((hlog2.const_mul 400).add (hlog1.const_mul 40)).add hinv using 1 · funext ℓ ring · norm_num theorem tendsto_saddleSmallResidueTruncation_div : Tendsto (fun ℓ : ℝ => (saddleSmallResidueTruncation ℓ : ℝ) / ℓ) atTop (𝓝 0) := by apply squeeze_zero' (f := fun ℓ : ℝ => (saddleSmallResidueTruncation ℓ : ℝ) / ℓ) (g := fun ℓ : ℝ => (20 * Real.log ℓ + 1) / ℓ) · filter_upwards [eventually_gt_atTop (0 : ℝ)] with ℓ hℓ positivity · filter_upwards [eventually_ge_atTop (1 : ℝ)] with ℓ hℓ exact div_le_div_of_nonneg_right (saddleSmallResidueTruncation_upper hℓ) (by linarith) · exact tendsto_logLinear_div_atTop theorem tendsto_saddleSmallResidueTruncation_sq_div : Tendsto (fun ℓ : ℝ => (saddleSmallResidueTruncation ℓ : ℝ) ^ 2 / ℓ) atTop (𝓝 0) := by apply squeeze_zero' (f := fun ℓ : ℝ => (saddleSmallResidueTruncation ℓ : ℝ) ^ 2 / ℓ) (g := fun ℓ : ℝ => (20 * Real.log ℓ + 1) ^ 2 / ℓ) · filter_upwards [eventually_gt_atTop (0 : ℝ)] with ℓ hℓ positivity · filter_upwards [eventually_ge_atTop (1 : ℝ)] with ℓ hℓ apply div_le_div_of_nonneg_right _ (by linarith) exact (sq_le_sq₀ (by exact_mod_cast (Nat.zero_le (saddleSmallResidueTruncation ℓ))) (by nlinarith [Real.log_nonneg hℓ])).mpr (saddleSmallResidueTruncation_upper hℓ) · exact tendsto_logLinear_sq_div_atTop theorem eventually_saddleSmallResidueTruncation_double_le : ∀ᶠ ℓ : ℝ in atTop, 2 * (saddleSmallResidueTruncation ℓ : ℝ) ≤ ℓ := by have hsmall := tendsto_saddleSmallResidueTruncation_div.eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1 / 2)) filter_upwards [hsmall, eventually_gt_atTop (0 : ℝ)] with ℓ hratio hℓ have h := (div_lt_iff₀ hℓ).mp hratio linarith theorem eventually_saddleSmallResidueTruncation_succ_double_le : ∀ᶠ ℓ : ℝ in atTop, 2 * ((saddleSmallResidueTruncation ℓ + 1 : ℕ) : ℝ) ≤ ℓ := by have hsmall := tendsto_saddleSmallResidueTruncation_div.eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1 / 4)) filter_upwards [hsmall, eventually_ge_atTop (4 : ℝ)] with ℓ hratio hℓ have hℓpos : 0 < ℓ := by linarith have h := (div_lt_iff₀ hℓpos).mp hratio push_cast linarith theorem eventually_saddleSmallResidueTruncation_dominates_window {C : ℝ} (hC : 0 ≤ C) : ∀ᶠ ℓ : ℝ in atTop, ∀ y : ℝ, 0 ≤ y → y ≤ Real.log ℓ / 8 + C → 2 * y ≤ (saddleSmallResidueTruncation ℓ : ℝ) + 2 := by filter_upwards [Real.tendsto_log_atTop.eventually (eventually_ge_atTop (max C 0))] with ℓ hlog intro y hy hyupper have hlogC : C ≤ Real.log ℓ := by simpa [max_eq_left hC] using! hlog have hN := saddleSmallResidueTruncation_lower ℓ nlinarith [hlogC] theorem saddleExpSeries_term_le_exp_mul_half_pow {y : ℝ} (hy : 0 ≤ y) (m : ℕ) : y ^ m / (m.factorial : ℝ) ≤ Real.exp (2 * y) * (1 / 2 : ℝ) ^ m := by have hterm : (2 * y) ^ m / (m.factorial : ℝ) ≤ Real.exp (2 * y) := by simpa using! (sum_le_hasSum ({m} : Finset ℕ) (fun n hn => by positivity) (saddleExpSeries_hasSum (2 * y))) have hpower : (2 * y) ^ m * (1 / 2 : ℝ) ^ m = y ^ m := by rw [← mul_pow] congr 1 ring calc y ^ m / (m.factorial : ℝ) = ((2 * y) ^ m / (m.factorial : ℝ)) * (1 / 2 : ℝ) ^ m := by rw [div_mul_eq_mul_div, hpower] _ ≤ Real.exp (2 * y) * (1 / 2 : ℝ) ^ m := mul_le_mul_of_nonneg_right hterm (by positivity) theorem saddleSmallResidue_half_log_le : Real.log (1 / 2 : ℝ) ≤ -(1 / 2 : ℝ) := by have h := Real.log_le_sub_one_of_pos (by norm_num : (0 : ℝ) < 1 / 2) linarith theorem saddleSmallResidueTruncation_half_pow_le (ℓ : ℝ) : (1 / 2 : ℝ) ^ (saddleSmallResidueTruncation ℓ + 1) ≤ Real.exp (-10 * Real.log ℓ) := by let m : ℕ := saddleSmallResidueTruncation ℓ + 1 have hmlower : 20 * Real.log ℓ ≤ (m : ℝ) := by try dsimp [m] push_cast linarith [saddleSmallResidueTruncation_lower ℓ] have hhalf := saddleSmallResidue_half_log_le have hproduct := mul_le_mul_of_nonneg_left hhalf (show 0 ≤ (m : ℝ) by positivity) have hexponent : (m : ℝ) * Real.log (1 / 2 : ℝ) ≤ -10 * Real.log ℓ := by nlinarith change (1 / 2 : ℝ) ^ m ≤ _ calc (1 / 2 : ℝ) ^ m = Real.exp ((m : ℝ) * Real.log (1 / 2 : ℝ)) := by rw [Real.exp_nat_mul, Real.exp_log (by norm_num : (0 : ℝ) < 1 / 2)] _ ≤ Real.exp (-10 * Real.log ℓ) := Real.exp_le_exp.mpr hexponent def saddleSmallResidueTailMajorant (C ℓ : ℝ) : ℝ := Real.exp (3 * C - (77 / 8 : ℝ) * Real.log ℓ) theorem saddleSmallResidue_tail_le_majorant {C ℓ y : ℝ} (hy : 0 ≤ y) (hyupper : y ≤ Real.log ℓ / 8 + C) : Real.exp y * (y ^ (saddleSmallResidueTruncation ℓ + 1) / ((saddleSmallResidueTruncation ℓ + 1).factorial : ℝ)) ≤ saddleSmallResidueTailMajorant C ℓ := by let m : ℕ := saddleSmallResidueTruncation ℓ + 1 have hterm := saddleExpSeries_term_le_exp_mul_half_pow hy m have hgeo := saddleSmallResidueTruncation_half_pow_le ℓ change Real.exp y * (y ^ m / (m.factorial : ℝ)) ≤ _ calc Real.exp y * (y ^ m / (m.factorial : ℝ)) ≤ Real.exp y * (Real.exp (2 * y) * (1 / 2 : ℝ) ^ m) := mul_le_mul_of_nonneg_left hterm (Real.exp_pos _).le _ = Real.exp (3 * y) * (1 / 2 : ℝ) ^ m := by rw [← mul_assoc, ← Real.exp_add] congr 1 ring_nf _ ≤ Real.exp (3 * (Real.log ℓ / 8 + C)) * Real.exp (-10 * Real.log ℓ) := by apply mul_le_mul · exact Real.exp_le_exp.mpr (by linarith) · exact hgeo · positivity · positivity _ = saddleSmallResidueTailMajorant C ℓ := by rw [← Real.exp_add] unfold saddleSmallResidueTailMajorant congr 1 ring theorem tendsto_saddleSmallResidueTailMajorant (C : ℝ) : Tendsto (saddleSmallResidueTailMajorant C) atTop (𝓝 0) := by have hneg : Tendsto (fun ℓ : ℝ => (-(77 / 8 : ℝ)) * Real.log ℓ) atTop atBot := Real.tendsto_log_atTop.const_mul_atTop_of_neg (by norm_num : (-(77 / 8 : ℝ)) < 0) have hsmall := (Real.tendsto_exp_atBot.comp hneg).const_mul (Real.exp (3 * C)) convert! hsmall using 1 · funext ℓ unfold saddleSmallResidueTailMajorant rw [show 3 * C - (77 / 8 : ℝ) * Real.log ℓ = 3 * C + (-(77 / 8 : ℝ)) * Real.log ℓ by ring, Real.exp_add] rfl · simp def saddleSmallResidueCoefficientMajorant (K C ℓ : ℝ) : ℝ := K * Real.exp (K * (saddleSmallResidueTruncation ℓ : ℝ) ^ 2 / ℓ) * (2 * (Real.log ℓ / 8 + C) + (Real.log ℓ / 8 + C) ^ 2) * Real.exp (2 * C - (3 / 4 : ℝ) * Real.log ℓ) theorem saddleSmallResidue_coefficient_le_majorant {K C ℓ y : ℝ} (hK : 0 ≤ K) (hC : 0 ≤ C) (hℓ : 1 ≤ ℓ) (hy : 0 ≤ y) (hyupper : y ≤ Real.log ℓ / 8 + C) : (K / ℓ) * Real.exp (K * (saddleSmallResidueTruncation ℓ : ℝ) ^ 2 / ℓ) * (2 * y + y ^ 2) * Real.exp (2 * y) ≤ saddleSmallResidueCoefficientMajorant K C ℓ := by let Y : ℝ := Real.log ℓ / 8 + C have hℓpos : 0 < ℓ := lt_of_lt_of_le zero_lt_one hℓ have hY : 0 ≤ Y := by try dsimp [Y] exact add_nonneg (div_nonneg (Real.log_nonneg hℓ) (by norm_num)) hC have hpoly : 2 * y + y ^ 2 ≤ 2 * Y + Y ^ 2 := by have hproduct : 0 ≤ (Y - y) * (Y + y) := mul_nonneg (sub_nonneg.mpr hyupper) (add_nonneg hY hy) nlinarith have hrat : Real.exp (2 * Y) / ℓ = Real.exp (2 * C - (3 / 4 : ℝ) * Real.log ℓ) := by calc Real.exp (2 * Y) / ℓ = Real.exp (2 * Y) / Real.exp (Real.log ℓ) := by rw [Real.exp_log hℓpos] _ = Real.exp (2 * Y - Real.log ℓ) := by rw [Real.exp_sub] _ = Real.exp (2 * C - (3 / 4 : ℝ) * Real.log ℓ) := by congr 1 try dsimp [Y] ring calc (K / ℓ) * Real.exp (K * (saddleSmallResidueTruncation ℓ : ℝ) ^ 2 / ℓ) * (2 * y + y ^ 2) * Real.exp (2 * y) ≤ (K / ℓ) * Real.exp (K * (saddleSmallResidueTruncation ℓ : ℝ) ^ 2 / ℓ) * (2 * Y + Y ^ 2) * Real.exp (2 * Y) := by gcongr _ = K * Real.exp (K * (saddleSmallResidueTruncation ℓ : ℝ) ^ 2 / ℓ) * (2 * Y + Y ^ 2) * (Real.exp (2 * Y) / ℓ) := by ring _ = saddleSmallResidueCoefficientMajorant K C ℓ := by rw [hrat] rfl theorem tendsto_saddleLogWindowPolynomial_exp_neg (C : ℝ) : Tendsto (fun t : ℝ => (2 * (t / 8 + C) + (t / 8 + C) ^ 2) * Real.exp (-(3 / 4 : ℝ) * t)) atTop (𝓝 0) := by have hscale : Tendsto (fun t : ℝ => (3 / 4 : ℝ) * t) atTop atTop := tendsto_id.const_mul_atTop (by norm_num : (0 : ℝ) < 3 / 4) have h2base := (Real.tendsto_pow_mul_exp_neg_atTop_nhds_zero 2).comp hscale have h2 : Tendsto (fun t : ℝ => t ^ 2 * Real.exp (-(3 / 4 : ℝ) * t)) atTop (𝓝 0) := by convert! h2base.const_mul ((4 / 3 : ℝ) ^ 2) using 1 · funext t try dsimp have ha : -((3 / 4 : ℝ) * t) = (-(3 / 4 : ℝ)) * t := by ring rw [ha] ring · norm_num have h1base := (Real.tendsto_pow_mul_exp_neg_atTop_nhds_zero 1).comp hscale have h1 : Tendsto (fun t : ℝ => t * Real.exp (-(3 / 4 : ℝ) * t)) atTop (𝓝 0) := by convert! h1base.const_mul (4 / 3 : ℝ) using 1 · funext t try dsimp have ha : -((3 / 4 : ℝ) * t) = (-(3 / 4 : ℝ)) * t := by ring rw [ha] ring · norm_num have h0 : Tendsto (fun t : ℝ => Real.exp (-(3 / 4 : ℝ) * t)) atTop (𝓝 0) := by simpa only [Function.comp_apply] using! (Real.tendsto_exp_atBot.comp (tendsto_id.const_mul_atTop_of_neg (by norm_num : (-(3 / 4 : ℝ)) < 0))) have hpoly := ((h2.const_mul (1 / 64 : ℝ)).add (h1.const_mul (C / 4 + 1 / 4))).add (h0.const_mul (C ^ 2 + 2 * C)) convert! hpoly using 1 · funext t ring · norm_num theorem tendsto_saddleSmallResidueCoefficientMajorant (K C : ℝ) : Tendsto (saddleSmallResidueCoefficientMajorant K C) atTop (𝓝 0) := by have hscaled : Tendsto (fun ℓ : ℝ => K * (saddleSmallResidueTruncation ℓ : ℝ) ^ 2 / ℓ) atTop (𝓝 0) := by convert! tendsto_saddleSmallResidueTruncation_sq_div.const_mul K using 1 · funext ℓ ring · norm_num have hfactor : Tendsto (fun ℓ : ℝ => Real.exp (K * (saddleSmallResidueTruncation ℓ : ℝ) ^ 2 / ℓ)) atTop (𝓝 1) := by simpa using! hscaled.rexp have hwindow := (tendsto_saddleLogWindowPolynomial_exp_neg C).comp Real.tendsto_log_atTop have hwindowScaled := hwindow.const_mul (Real.exp (2 * C)) have htotal := (hfactor.const_mul K).mul hwindowScaled convert! htotal using 1 · funext ℓ unfold saddleSmallResidueCoefficientMajorant rw [show 2 * C - (3 / 4 : ℝ) * Real.log ℓ = 2 * C + (-(3 / 4 : ℝ)) * Real.log ℓ by ring, Real.exp_add] simp only [Function.comp_apply] ring · norm_num def saddleSmallResidueRelativeErrorMajorant (K C ℓ : ℝ) : ℝ := saddleSmallResidueCoefficientMajorant K C ℓ + 2 * saddleSmallResidueTailMajorant C ℓ theorem tendsto_saddleSmallResidueRelativeErrorMajorant (K C : ℝ) : Tendsto (saddleSmallResidueRelativeErrorMajorant K C) atTop (𝓝 0) := by have h := (tendsto_saddleSmallResidueCoefficientMajorant K C).add ((tendsto_saddleSmallResidueTailMajorant C).const_mul 2) simpa [saddleSmallResidueRelativeErrorMajorant] using! h theorem eventually_plusSaddleSmallRadius_relativeFiniteResidue_lt_half {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) {C : ℝ} (hC : 0 ≤ C) : ∀ᶠ ℓ : ℝ in atTop, ∀ y : ℝ, 0 ≤ y → y ≤ Real.log ℓ / 8 + C → Real.exp y * |(∑ n ∈ Finset.range (saddleSmallResidueTruncation ℓ + 1), ((-y) ^ n / (n.factorial : ℝ)) * plusSaddleSmallRadiusCoefficient ε ℓ n) - Real.exp (-y)| < 1 / 2 := by obtain ⟨K, hK, hfinite⟩ := exists_plusSaddleSmallRadius_relativeFiniteResidue_error hε horder have hmajor := (tendsto_saddleSmallResidueRelativeErrorMajorant K C).eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1 / 2)) filter_upwards [hmajor, eventually_saddleSmallResidueTruncation_double_le, eventually_saddleSmallResidueTruncation_dominates_window hC, eventually_ge_atTop (1 : ℝ)] with ℓ hsmall hN hwindow hℓ intro y hy hyupper have hℓpos : 0 < ℓ := lt_of_lt_of_le zero_lt_one hℓ have hratio := hwindow y hy hyupper have hbound := hfinite ℓ hℓpos (saddleSmallResidueTruncation ℓ) hN y hy hratio have hcoeff := saddleSmallResidue_coefficient_le_majorant hK hC hℓ hy hyupper have htail := saddleSmallResidue_tail_le_majorant hy hyupper have htailtwo : 2 * Real.exp y * (y ^ (saddleSmallResidueTruncation ℓ + 1) / ((saddleSmallResidueTruncation ℓ + 1).factorial : ℝ)) ≤ 2 * saddleSmallResidueTailMajorant C ℓ := by calc 2 * Real.exp y * (y ^ (saddleSmallResidueTruncation ℓ + 1) / ((saddleSmallResidueTruncation ℓ + 1).factorial : ℝ)) = 2 * (Real.exp y * (y ^ (saddleSmallResidueTruncation ℓ + 1) / ((saddleSmallResidueTruncation ℓ + 1).factorial : ℝ))) := by ring _ ≤ 2 * saddleSmallResidueTailMajorant C ℓ := mul_le_mul_of_nonneg_left htail (by norm_num : (0 : ℝ) ≤ 2) calc Real.exp y * |(∑ n ∈ Finset.range (saddleSmallResidueTruncation ℓ + 1), ((-y) ^ n / (n.factorial : ℝ)) * plusSaddleSmallRadiusCoefficient ε ℓ n) - Real.exp (-y)| ≤ (K / ℓ) * Real.exp (K * (saddleSmallResidueTruncation ℓ : ℝ) ^ 2 / ℓ) * (2 * y + y ^ 2) * Real.exp (2 * y) + 2 * Real.exp y * (y ^ (saddleSmallResidueTruncation ℓ + 1) / ((saddleSmallResidueTruncation ℓ + 1).factorial : ℝ)) := hbound _ ≤ saddleSmallResidueCoefficientMajorant K C ℓ + 2 * saddleSmallResidueTailMajorant C ℓ := by exact add_le_add hcoeff htailtwo _ < 1 / 2 := by exact hsmall theorem tendsto_saddleResidue_dimension_half : Tendsto (fun d : ℕ => (d : ℝ) / 2) atTop atTop := by have hcast := tendsto_natCast_atTop_atTop (R := ℝ) have hmul := hcast.atTop_mul_const (by norm_num : (0 : ℝ) < 1 / 2) convert! hmul using 1 funext d ring theorem eventually_plusSaddleSmallRadius_relativeFiniteResidue_lt_half_on_star {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : ∀ᶠ d : ℕ in atTop, ∀ r : ℝ, 0 ≤ r → r ≤ saddleSmallRadiusStar ε d → let ℓ : ℝ := (d : ℝ) / 2 let y : ℝ := saddleSmallRadiusVariable ε r Real.exp y * |(∑ n ∈ Finset.range (saddleSmallResidueTruncation ℓ + 1), ((-y) ^ n / (n.factorial : ℝ)) * plusSaddleSmallRadiusCoefficient ε ℓ n) - Real.exp (-y)| < 1 / 2 := by obtain ⟨C, hC, hstar⟩ := exists_eventually_y_star_le_log_eighth_add hε horder have hrelative := eventually_plusSaddleSmallRadius_relativeFiniteResidue_lt_half hε horder hC have hdimension := tendsto_saddleResidue_dimension_half.eventually hrelative filter_upwards [hdimension, hstar] with d hres hcut intro r hr hrstar try dsimp exact hres (saddleSmallRadiusVariable ε r) (saddleSmallRadiusVariable_nonneg ε r) (hcut r hr hrstar) end noncomputable section open Filter Set MeasureTheory open scoped Topology BigOperators theorem gamma_half_factorial_lower (N : ℕ) : Real.Gamma (3 / 2 : ℝ) * (N.factorial : ℝ) ≤ Real.Gamma ((N : ℝ) + 3 / 2) := by induction N with | zero => simp | succ N ih => have hq : 0 < (N : ℝ) + 3 / 2 := by positivity have hrec : Real.Gamma (((N + 1 : ℕ) : ℝ) + 3 / 2) = ((N : ℝ) + 3 / 2) * Real.Gamma ((N : ℝ) + 3 / 2) := by convert! Real.Gamma_add_one hq.ne' using 1 all_goals push_cast ring_nf calc Real.Gamma (3 / 2 : ℝ) * (((N + 1).factorial : ℕ) : ℝ) = ((N : ℝ) + 1) * (Real.Gamma (3 / 2 : ℝ) * (N.factorial : ℝ)) := by rw [Nat.factorial_succ] push_cast ring _ ≤ ((N : ℝ) + 1) * Real.Gamma ((N : ℝ) + 3 / 2) := mul_le_mul_of_nonneg_left ih (by positivity) _ ≤ ((N : ℝ) + 3 / 2) * Real.Gamma ((N : ℝ) + 3 / 2) := by apply mul_le_mul_of_nonneg_right (by norm_num : (N : ℝ) + 1 ≤ (N : ℝ) + 3 / 2) (Real.Gamma_pos_of_pos hq).le _ = Real.Gamma (((N + 1 : ℕ) : ℝ) + 3 / 2) := hrec.symm theorem saddleNegativeTruncation_half_pow_le (ℓ : ℝ) : (1 / 2 : ℝ) ^ saddleSmallResidueTruncation ℓ ≤ 2 * Real.exp (-10 * Real.log ℓ) := by have hnext := saddleSmallResidueTruncation_half_pow_le ℓ calc (1 / 2 : ℝ) ^ saddleSmallResidueTruncation ℓ = 2 * (1 / 2 : ℝ) ^ (saddleSmallResidueTruncation ℓ + 1) := by rw [pow_succ] ring _ ≤ 2 * Real.exp (-10 * Real.log ℓ) := mul_le_mul_of_nonneg_left hnext (by norm_num) theorem saddleNegative_factorialTail_le_majorant {C ℓ y : ℝ} (hy : 0 ≤ y) (hyupper : y ≤ Real.log ℓ / 8 + C) : Real.exp y * (y ^ saddleSmallResidueTruncation ℓ / ((saddleSmallResidueTruncation ℓ).factorial : ℝ)) ≤ 2 * saddleSmallResidueTailMajorant C ℓ := by let N : ℕ := saddleSmallResidueTruncation ℓ have hterm := saddleExpSeries_term_le_exp_mul_half_pow hy N have hgeo := saddleNegativeTruncation_half_pow_le ℓ change Real.exp y * (y ^ N / (N.factorial : ℝ)) ≤ _ calc Real.exp y * (y ^ N / (N.factorial : ℝ)) ≤ Real.exp y * (Real.exp (2 * y) * (1 / 2 : ℝ) ^ N) := mul_le_mul_of_nonneg_left hterm (Real.exp_pos _).le _ = Real.exp (3 * y) * (1 / 2 : ℝ) ^ N := by rw [← mul_assoc, ← Real.exp_add] congr 1 ring_nf _ ≤ Real.exp (3 * (Real.log ℓ / 8 + C)) * (2 * Real.exp (-10 * Real.log ℓ)) := by apply mul_le_mul · exact Real.exp_le_exp.mpr (by linarith) · exact hgeo · positivity · positivity _ = 2 * saddleSmallResidueTailMajorant C ℓ := by unfold saddleSmallResidueTailMajorant calc Real.exp (3 * (Real.log ℓ / 8 + C)) * (2 * Real.exp (-10 * Real.log ℓ)) = 2 * (Real.exp (3 * (Real.log ℓ / 8 + C)) * Real.exp (-10 * Real.log ℓ)) := by ring _ = 2 * Real.exp (3 * (Real.log ℓ / 8 + C) + (-10 * Real.log ℓ)) := by rw [← Real.exp_add] _ = 2 * Real.exp (3 * C - (77 / 8 : ℝ) * Real.log ℓ) := by congr 2 ring theorem saddleNegative_sqrt_le_one_add {y : ℝ} (hy : 0 ≤ y) : Real.sqrt y ≤ 1 + y := by have hs := Real.sqrt_nonneg y have hsq := Real.sq_sqrt hy nlinarith [sq_nonneg (Real.sqrt y - 1)] def saddleNegativeRelativeGammaTailMajorant (C K Kε ℓ : ℝ) : ℝ := (2 * Kε / Real.Gamma (3 / 2 : ℝ)) * (1 + (Real.log ℓ / 8 + C)) * saddleSmallResidueTailMajorant C ℓ * Real.exp (K * (2 * (saddleSmallResidueTruncation ℓ : ℝ) + 1) ^ 2 / ℓ) theorem saddleNegative_relativeGammaTail_le_majorant {C K Kε ℓ y : ℝ} (hKε : 0 ≤ Kε) (hC : 0 ≤ C) (hℓ : 1 ≤ ℓ) (hy : 0 ≤ y) (hyupper : y ≤ Real.log ℓ / 8 + C) : Real.exp y * (Kε * Real.sqrt y * y ^ saddleSmallResidueTruncation ℓ / Real.Gamma ((saddleSmallResidueTruncation ℓ : ℝ) + 3 / 2) * Real.exp (K * (2 * (saddleSmallResidueTruncation ℓ : ℝ) + 1) ^ 2 / ℓ)) ≤ saddleNegativeRelativeGammaTailMajorant C K Kε ℓ := by let N : ℕ := saddleSmallResidueTruncation ℓ let Y : ℝ := Real.log ℓ / 8 + C have hY : 0 ≤ Y := by try dsimp [Y] exact add_nonneg (div_nonneg (Real.log_nonneg hℓ) (by norm_num)) hC have hΓ : 0 < Real.Gamma (3 / 2 : ℝ) := Real.Gamma_pos_of_pos (by norm_num) have hfactorial : 0 < (N.factorial : ℝ) := by exact_mod_cast Nat.factorial_pos N have hq : 0 < Real.Gamma ((N : ℝ) + 3 / 2) := Real.Gamma_pos_of_pos (by positivity) have hfrac : y ^ N / Real.Gamma ((N : ℝ) + 3 / 2) ≤ (y ^ N / (N.factorial : ℝ)) / Real.Gamma (3 / 2 : ℝ) := by calc y ^ N / Real.Gamma ((N : ℝ) + 3 / 2) ≤ y ^ N / (Real.Gamma (3 / 2 : ℝ) * (N.factorial : ℝ)) := div_le_div_of_nonneg_left (pow_nonneg hy N) (mul_pos hΓ hfactorial) (gamma_half_factorial_lower N) _ = (y ^ N / (N.factorial : ℝ)) / Real.Gamma (3 / 2 : ℝ) := by field_simp [hΓ.ne', hfactorial.ne'] have hsqrt := saddleNegative_sqrt_le_one_add hy have hsqrtY : Real.sqrt y ≤ 1 + Y := by calc Real.sqrt y ≤ 1 + y := hsqrt _ ≤ 1 + Y := by dsimp [Y]; linarith have htail := saddleNegative_factorialTail_le_majorant hy hyupper have hbase : 0 ≤ y ^ N / (N.factorial : ℝ) := by positivity have hmajor : 0 ≤ saddleSmallResidueTailMajorant C ℓ := by unfold saddleSmallResidueTailMajorant positivity let E : ℝ := Real.exp (K * (2 * (N : ℝ) + 1) ^ 2 / ℓ) have hE : 0 ≤ E := (Real.exp_pos _).le change Real.exp y * (Kε * Real.sqrt y * y ^ N / Real.Gamma ((N : ℝ) + 3 / 2) * E) ≤ _ calc Real.exp y * (Kε * Real.sqrt y * y ^ N / Real.Gamma ((N : ℝ) + 3 / 2) * E) = Kε * Real.sqrt y * (Real.exp y * (y ^ N / Real.Gamma ((N : ℝ) + 3 / 2))) * E := by ring _ ≤ Kε * Real.sqrt y * (Real.exp y * ((y ^ N / (N.factorial : ℝ)) / Real.Gamma (3 / 2 : ℝ))) * E := by gcongr _ = (Kε / Real.Gamma (3 / 2 : ℝ)) * Real.sqrt y * (Real.exp y * (y ^ N / (N.factorial : ℝ))) * E := by ring _ ≤ (Kε / Real.Gamma (3 / 2 : ℝ)) * (1 + Y) * (2 * saddleSmallResidueTailMajorant C ℓ) * E := by gcongr _ = saddleNegativeRelativeGammaTailMajorant C K Kε ℓ := by unfold saddleNegativeRelativeGammaTailMajorant try dsimp [N, Y, E] ring theorem tendsto_saddleNegativeTruncation_odd_sq_div : Tendsto (fun ℓ : ℝ => (2 * (saddleSmallResidueTruncation ℓ : ℝ) + 1) ^ 2 / ℓ) atTop (𝓝 0) := by have hinv : Tendsto (fun ℓ : ℝ => (1 : ℝ) / ℓ) atTop (𝓝 0) := by simpa [one_div] using! (tendsto_inv_atTop_zero : Tendsto (fun ℓ : ℝ => ℓ⁻¹) atTop (𝓝 0)) have h := ((tendsto_saddleSmallResidueTruncation_sq_div.const_mul 4).add (tendsto_saddleSmallResidueTruncation_div.const_mul 4)).add hinv convert! h using 1 · funext ℓ ring · norm_num theorem tendsto_saddleNegativeLogWindowTailMajorant (C : ℝ) : Tendsto (fun ℓ : ℝ => (1 + (Real.log ℓ / 8 + C)) * saddleSmallResidueTailMajorant C ℓ) atTop (𝓝 0) := by have hscale : Tendsto (fun t : ℝ => (77 / 8 : ℝ) * t) atTop atTop := tendsto_id.const_mul_atTop (by norm_num : (0 : ℝ) < 77 / 8) have h1base := (Real.tendsto_pow_mul_exp_neg_atTop_nhds_zero 1).comp hscale have h1 : Tendsto (fun t : ℝ => t * Real.exp (-(77 / 8 : ℝ) * t)) atTop (𝓝 0) := by convert! h1base.const_mul (8 / 77 : ℝ) using 1 · funext t try dsimp ring_nf · norm_num have h0 : Tendsto (fun t : ℝ => Real.exp (-(77 / 8 : ℝ) * t)) atTop (𝓝 0) := by simpa only [Function.comp_apply] using! (Real.tendsto_exp_atBot.comp (tendsto_id.const_mul_atTop_of_neg (by norm_num : (-(77 / 8 : ℝ)) < 0))) have hpoly := (h1.const_mul (1 / 8 : ℝ)).add (h0.const_mul (1 + C)) have hlog := hpoly.comp Real.tendsto_log_atTop have hscaled := hlog.const_mul (Real.exp (3 * C)) convert! hscaled using 1 · funext ℓ unfold saddleSmallResidueTailMajorant rw [show 3 * C - (77 / 8 : ℝ) * Real.log ℓ = 3 * C + (-(77 / 8 : ℝ)) * Real.log ℓ by ring, Real.exp_add] simp only [Function.comp_apply] ring · norm_num theorem tendsto_saddleNegativeRelativeGammaTailMajorant (C K Kε : ℝ) : Tendsto (saddleNegativeRelativeGammaTailMajorant C K Kε) atTop (𝓝 0) := by have hsmall := tendsto_saddleNegativeLogWindowTailMajorant C have herror := (tendsto_saddleNegativeTruncation_odd_sq_div.const_mul K).rexp have htotal := (hsmall.const_mul (2 * Kε / Real.Gamma (3 / 2 : ℝ))).mul herror convert! htotal using 1 · funext ℓ unfold saddleNegativeRelativeGammaTailMajorant ring_nf · norm_num theorem eventually_saddleNegative_relativeGammaTail_lt_half {ε : ℝ} (hε : 0 < ε) (C K Kε : ℝ) (hC : 0 ≤ C) (hK : 0 ≤ K) (hKε : 0 ≤ Kε) : ∀ᶠ ℓ : ℝ in atTop, ∀ y : ℝ, 0 ≤ y → y ≤ Real.log ℓ / 8 + C → Real.exp y * (Kε * Real.sqrt y * y ^ saddleSmallResidueTruncation ℓ / Real.Gamma ((saddleSmallResidueTruncation ℓ : ℝ) + 3 / 2) * Real.exp (K * (2 * (saddleSmallResidueTruncation ℓ : ℝ) + 1) ^ 2 / ℓ)) < 1 / 2 := by have _hε : 0 < ε := hε have _hK : 0 ≤ K := hK have hmajor := (tendsto_saddleNegativeRelativeGammaTailMajorant C K Kε).eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1 / 2)) filter_upwards [hmajor, eventually_ge_atTop (1 : ℝ)] with ℓ hsmall hℓ intro y hy hyupper exact (saddleNegative_relativeGammaTail_le_majorant hKε hC hℓ hy hyupper).trans_lt hsmall end noncomputable section open Filter MeasureTheory Set open scoped Topology BigOperators def upperCosLaplaceKernel (c T a : ℝ) : ℝ := (1 - Real.cos (a * T)) * Real.exp (-c * a) / a theorem upperCosLaplaceKernel_eq_frullani_re (c T a : ℝ) : upperCosLaplaceKernel c T a = (complexFrullaniKernel (c : ℂ) ((c : ℂ) + Complex.I * (T : ℂ)) a).re := by simp [upperCosLaplaceKernel, complexFrullaniKernel, Complex.exp_re, Real.cos_neg] ring_nf theorem upperCosLaplaceKernel_integrable {c : ℝ} (hc : 0 < c) (T : ℝ) : IntegrableOn (upperCosLaplaceKernel c T) (Ioi 0) := by have hw : 0 < ((c : ℂ) + Complex.I * (T : ℂ)).re := by simpa using! hc have h := complexFrullaniKernel_integrable (z := (c : ℂ)) (w := (c : ℂ) + Complex.I * (T : ℂ)) (by simpa using! hc) hw have hr := h.re exact hr.congr (Filter.Eventually.of_forall (fun a => (upperCosLaplaceKernel_eq_frullani_re c T a).symm)) theorem integral_upperCosLaplaceKernel {c : ℝ} (hc : 0 < c) (T : ℝ) : (∫ a : ℝ in Ioi 0, upperCosLaplaceKernel c T a) = Real.log (‖((c : ℂ) + Complex.I * (T : ℂ))‖ / c) := by let z : ℂ := (c : ℂ) let w : ℂ := (c : ℂ) + Complex.I * (T : ℂ) have hz : 0 < z.re := by simpa [z] using! hc have hw : 0 < w.re := by simpa [w] using! hc have hi := complexFrullaniKernel_integrable hz hw calc (∫ a : ℝ in Ioi 0, upperCosLaplaceKernel c T a) = ∫ a : ℝ in Ioi 0, (complexFrullaniKernel z w a).re := by apply setIntegral_congr_fun measurableSet_Ioi intro a ha exact upperCosLaplaceKernel_eq_frullani_re c T a _ = (∫ a : ℝ in Ioi 0, complexFrullaniKernel z w a).re := integral_re hi _ = (Complex.log w - Complex.log z).re := by rw [integral_complexFrullaniKernel hz hw] _ = Real.log (‖((c : ℂ) + Complex.I * (T : ℂ))‖ / c) := by rw [Complex.sub_re, Complex.log_re, Complex.log_re, Real.log_div] · simp [z, w, abs_of_pos hc] · exact (norm_pos_iff.mpr (ne_of_apply_ne Complex.re (by simpa [w] using! hc.ne'))).ne' · exact hc.ne' def upperGammaTruncatedDampingIntegrand (ℓ η T : ℝ) (n : ℕ) (a : ℝ) : ℝ := upperCosLaplaceKernel η T a * ∑ k ∈ Finset.range (n + 1), Real.exp (-(2 * a / ℓ)) ^ k theorem upperGammaTruncatedDampingIntegrand_eq_sum (ℓ η T : ℝ) (n : ℕ) (a : ℝ) : upperGammaTruncatedDampingIntegrand ℓ η T n a = ∑ k ∈ Finset.range (n + 1), upperCosLaplaceKernel (η + 2 * (k : ℝ) / ℓ) T a := by classical unfold upperGammaTruncatedDampingIntegrand rw [Finset.mul_sum] apply Finset.sum_congr rfl intro k hk have he : Real.exp (-η * a) * Real.exp (-(2 * a / ℓ)) ^ k = Real.exp (-(η + 2 * (k : ℝ) / ℓ) * a) := by rw [← Real.exp_nat_mul, ← Real.exp_add] congr 1 ring unfold upperCosLaplaceKernel calc ((1 - Real.cos (a * T)) * Real.exp (-η * a) / a) * Real.exp (-(2 * a / ℓ)) ^ k = (1 - Real.cos (a * T)) * (Real.exp (-η * a) * Real.exp (-(2 * a / ℓ)) ^ k) / a := by ring _ = (1 - Real.cos (a * T)) * Real.exp (-(η + 2 * (k : ℝ) / ℓ) * a) / a := by rw [he] theorem upperGammaGeometricLimit_eq_integrand (ℓ η T a : ℝ) : upperCosLaplaceKernel η T a * (1 - Real.exp (-(2 * a / ℓ)))⁻¹ = upperGammaDampingIntegrand ℓ η T a := by simp [upperCosLaplaceKernel, upperGammaDampingIntegrand, upperGammaMeasureDensity, div_eq_mul_inv, mul_comm, mul_left_comm, mul_assoc] theorem tendsto_integral_upperGammaTruncatedDampingIntegrand {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (T : ℝ) : Tendsto (fun n : ℕ => ∫ a : ℝ in Ioi 0, upperGammaTruncatedDampingIntegrand ℓ η T n a) atTop (𝓝 (upperGammaDamping ℓ η T)) := by unfold upperGammaDamping refine tendsto_integral_of_dominated_convergence (upperGammaDampingIntegrand ℓ η T) ?_ (upperGammaDampingIntegrand_integrable hℓ hη T) ?_ ?_ · intro n apply Measurable.aestronglyMeasurable unfold upperGammaTruncatedDampingIntegrand upperCosLaplaceKernel fun_prop · intro n filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha have hq0 : 0 ≤ Real.exp (-(2 * a / ℓ)) := (Real.exp_pos _).le have hq1 : Real.exp (-(2 * a / ℓ)) < 1 := by apply Real.exp_lt_one_iff.mpr have : 0 < 2 * a / ℓ := div_pos (mul_pos (by norm_num) ha) hℓ linarith have hbase : 0 ≤ upperCosLaplaceKernel η T a := by unfold upperCosLaplaceKernel exact div_nonneg (mul_nonneg (sub_nonneg.mpr (Real.cos_le_one _)) (Real.exp_pos _).le) ha.le have hsum : (∑ k ∈ Finset.range (n + 1), Real.exp (-(2 * a / ℓ)) ^ k) ≤ (1 - Real.exp (-(2 * a / ℓ)))⁻¹ := by exact sum_le_hasSum (Finset.range (n + 1)) (fun k hk => pow_nonneg hq0 k) (hasSum_geometric_of_lt_one hq0 hq1) have hpartial : 0 ≤ upperGammaTruncatedDampingIntegrand ℓ η T n a := by unfold upperGammaTruncatedDampingIntegrand exact mul_nonneg hbase (Finset.sum_nonneg (fun k hk => pow_nonneg hq0 k)) rw [Real.norm_eq_abs, abs_of_nonneg hpartial] calc upperGammaTruncatedDampingIntegrand ℓ η T n a = upperCosLaplaceKernel η T a * ∑ k ∈ Finset.range (n + 1), Real.exp (-(2 * a / ℓ)) ^ k := rfl _ ≤ upperCosLaplaceKernel η T a * (1 - Real.exp (-(2 * a / ℓ)))⁻¹ := mul_le_mul_of_nonneg_left hsum hbase _ = upperGammaDampingIntegrand ℓ η T a := upperGammaGeometricLimit_eq_integrand ℓ η T a · filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha have hq0 : 0 ≤ Real.exp (-(2 * a / ℓ)) := (Real.exp_pos _).le have hq1 : Real.exp (-(2 * a / ℓ)) < 1 := by apply Real.exp_lt_one_iff.mpr have : 0 < 2 * a / ℓ := div_pos (mul_pos (by norm_num) ha) hℓ linarith have hgeo := (hasSum_geometric_of_lt_one hq0 hq1).tendsto_sum_nat have hshift := hgeo.comp (tendsto_add_atTop_nat 1) have hlimit := Filter.Tendsto.mul (tendsto_const_nhds (x := upperCosLaplaceKernel η T a)) hshift simpa [upperGammaTruncatedDampingIntegrand, upperGammaGeometricLimit_eq_integrand] using! hlimit theorem upperGammaLaplaceRate_pos {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (k : ℕ) : 0 < η + 2 * (k : ℝ) / ℓ := by exact add_pos_of_pos_of_nonneg hη (div_nonneg (mul_nonneg (by norm_num) (Nat.cast_nonneg k)) hℓ.le) theorem integral_upperGammaTruncatedDampingIntegrand {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (T : ℝ) (n : ℕ) : (∫ a : ℝ in Ioi 0, upperGammaTruncatedDampingIntegrand ℓ η T n a) = ∑ k ∈ Finset.range (n + 1), Real.log (‖((η + 2 * (k : ℝ) / ℓ : ℝ) : ℂ) + Complex.I * (T : ℂ)‖ / (η + 2 * (k : ℝ) / ℓ)) := by classical calc (∫ a : ℝ in Ioi 0, upperGammaTruncatedDampingIntegrand ℓ η T n a) = ∫ a : ℝ in Ioi 0, ∑ k ∈ Finset.range (n + 1), upperCosLaplaceKernel (η + 2 * (k : ℝ) / ℓ) T a := by apply setIntegral_congr_fun measurableSet_Ioi intro a ha exact upperGammaTruncatedDampingIntegrand_eq_sum ℓ η T n a _ = ∑ k ∈ Finset.range (n + 1), ∫ a : ℝ in Ioi 0, upperCosLaplaceKernel (η + 2 * (k : ℝ) / ℓ) T a := by apply integral_finsetSum intro k hk exact upperCosLaplaceKernel_integrable (upperGammaLaplaceRate_pos hℓ hη k) T _ = ∑ k ∈ Finset.range (n + 1), Real.log (‖((η + 2 * (k : ℝ) / ℓ : ℝ) : ℂ) + Complex.I * (T : ℂ)‖ / (η + 2 * (k : ℝ) / ℓ)) := by apply Finset.sum_congr rfl intro k hk exact integral_upperCosLaplaceKernel (upperGammaLaplaceRate_pos hℓ hη k) T theorem upperComplex_norm_ratio_scale {s c : ℝ} (hs : 0 < s) (hc : 0 < c) (T : ℝ) : ‖((s * c : ℝ) : ℂ) + Complex.I * ((s * T : ℝ) : ℂ)‖ / (s * c) = ‖(c : ℂ) + Complex.I * (T : ℂ)‖ / c := by have he : ((s * c : ℝ) : ℂ) + Complex.I * ((s * T : ℝ) : ℂ) = (s : ℂ) * ((c : ℂ) + Complex.I * (T : ℂ)) := by push_cast ring rw [he, norm_mul, Complex.norm_of_nonneg hs.le] field_simp [hs.ne', hc.ne'] theorem upperGammaLaplaceRate_log_ratio {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (T : ℝ) (k : ℕ) : Real.log (‖((η + 2 * (k : ℝ) / ℓ : ℝ) : ℂ) + Complex.I * (T : ℂ)‖ / (η + 2 * (k : ℝ) / ℓ)) = Real.log (‖((ℓ * η / 2 : ℝ) : ℂ) + Complex.I * ((ℓ * T / 2 : ℝ) : ℂ) + (k : ℂ)‖ / (ℓ * η / 2 + (k : ℝ))) := by have hs : 0 < ℓ / 2 := by positivity have hc := upperGammaLaplaceRate_pos hℓ hη k have hreal : ℓ / 2 * (η + 2 * (k : ℝ) / ℓ) = ℓ * η / 2 + (k : ℝ) := by field_simp [hℓ.ne'] have himag : ℓ / 2 * T = ℓ * T / 2 := by ring have harg : (((ℓ * η / 2 + (k : ℝ) : ℝ) : ℂ) + Complex.I * ((ℓ * T / 2 : ℝ) : ℂ)) = ((ℓ * η / 2 : ℝ) : ℂ) + Complex.I * ((ℓ * T / 2 : ℝ) : ℂ) + (k : ℂ) := by push_cast ring have hscale := upperComplex_norm_ratio_scale (s := ℓ / 2) (c := η + 2 * (k : ℝ) / ℓ) hs hc T rw [hreal, himag, harg] at hscale exact congrArg Real.log hscale.symm theorem upperGammaEuler_real_factor_norm {m : ℝ} (hm : 0 < m) (k : ℕ) : ‖(m : ℂ) + (k : ℂ)‖ = m + (k : ℝ) := by have hp : 0 ≤ m + (k : ℝ) := by positivity convert! Complex.norm_of_nonneg hp using 1; push_cast; ring theorem upperGammaEuler_complex_factor_pos {m : ℝ} (hm : 0 < m) (b : ℝ) (k : ℕ) : 0 < ‖(m : ℂ) + Complex.I * (b : ℂ) + (k : ℂ)‖ := by apply norm_pos_iff.mpr apply ne_of_apply_ne Complex.re simp exact (add_pos_of_pos_of_nonneg hm (Nat.cast_nonneg k)).ne' theorem upperGammaEuler_log_norm_ratio {m : ℝ} (hm : 0 < m) (b : ℝ) {n : ℕ} (hn : 0 < n) : Real.log (‖Complex.GammaSeq ((m : ℂ) + Complex.I * (b : ℂ)) n‖ / ‖Complex.GammaSeq (m : ℂ) n‖) = -(∑ k ∈ Finset.range (n + 1), Real.log (‖(m : ℂ) + Complex.I * (b : ℂ) + (k : ℂ)‖ / (m + (k : ℝ)))) := by classical let z : ℂ := (m : ℂ) + Complex.I * (b : ℂ) have hpow : ‖(n : ℂ) ^ z‖ = ‖(n : ℂ) ^ (m : ℂ)‖ := by rw [Complex.norm_natCast_cpow_of_pos hn, Complex.norm_natCast_cpow_of_pos hn] simp [z] have hpown : ‖(n : ℂ) ^ (m : ℂ)‖ ≠ 0 := (Complex.norm_natCast_cpow_pos_of_pos hn (m : ℂ)).ne' have hfactorial : (n.factorial : ℝ) ≠ 0 := by exact_mod_cast Nat.factorial_ne_zero n have hreal (k : ℕ) : 0 < m + (k : ℝ) := by positivity have hcomplex (k : ℕ) : 0 < ‖z + (k : ℂ)‖ := by simpa [z] using! upperGammaEuler_complex_factor_pos hm b k have hprodreal : (∏ k ∈ Finset.range (n + 1), (m + (k : ℝ))) ≠ 0 := by exact Finset.prod_ne_zero_iff.mpr (fun k hk => (hreal k).ne') have hprodcomplex : (∏ k ∈ Finset.range (n + 1), ‖z + (k : ℂ)‖) ≠ 0 := by exact Finset.prod_ne_zero_iff.mpr (fun k hk => (hcomplex k).ne') have hratio : ‖Complex.GammaSeq z n‖ / ‖Complex.GammaSeq (m : ℂ) n‖ = (∏ k ∈ Finset.range (n + 1), (‖z + (k : ℂ)‖ / (m + (k : ℝ))))⁻¹ := by rw [Complex.GammaSeq, Complex.GammaSeq, norm_div, norm_div, norm_mul, norm_mul, norm_prod, norm_prod, hpow] simp_rw [upperGammaEuler_real_factor_norm hm] rw [Finset.prod_div_distrib] simp only [norm_natCast] field_simp [hpown, hfactorial, hprodreal, hprodcomplex] change Real.log (‖Complex.GammaSeq z n‖ / ‖Complex.GammaSeq (m : ℂ) n‖) = _ rw [hratio, Real.log_inv, Real.log_prod] intro k hk exact div_ne_zero (hcomplex k).ne' (hreal k).ne' theorem tendsto_upperGammaEuler_log_norm_ratio {m : ℝ} (hm : 0 < m) (b : ℝ) : Tendsto (fun n : ℕ => Real.log (‖Complex.GammaSeq ((m : ℂ) + Complex.I * (b : ℂ)) n‖ / ‖Complex.GammaSeq (m : ℂ) n‖)) atTop (𝓝 (Real.log (‖Complex.Gamma ((m : ℂ) + Complex.I * (b : ℂ))‖ / ‖Complex.Gamma (m : ℂ)‖))) := by let z : ℂ := (m : ℂ) + Complex.I * (b : ℂ) have hzre : 0 < z.re := by simpa [z] using! hm have hnum : ‖Complex.Gamma z‖ ≠ 0 := norm_ne_zero_iff.mpr (Complex.Gamma_ne_zero_of_re_pos hzre) have hden : ‖Complex.Gamma (m : ℂ)‖ ≠ 0 := norm_ne_zero_iff.mpr (Complex.Gamma_ne_zero_of_re_pos (by simpa using! hm)) have hratio := (Complex.GammaSeq_tendsto_Gamma z).norm.div (Complex.GammaSeq_tendsto_Gamma (m : ℂ)).norm hden exact hratio.log (div_ne_zero hnum hden) theorem upperGammaPositiveShifted_log_norm_eq_neg_damping {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (T : ℝ) : Real.log (‖Complex.Gamma (((ℓ * η / 2 : ℝ) : ℂ) + Complex.I * ((ℓ * T / 2 : ℝ) : ℂ))‖ / Real.Gamma (ℓ * η / 2)) = -upperGammaDamping ℓ η T := by let m : ℝ := ℓ * η / 2 let b : ℝ := ℓ * T / 2 have hm : 0 < m := by try dsimp [m] positivity have hfinite : (fun n : ℕ => Real.log (‖Complex.GammaSeq ((m : ℂ) + Complex.I * (b : ℂ)) n‖ / ‖Complex.GammaSeq (m : ℂ) n‖)) =ᶠ[atTop] (fun n : ℕ => -(∫ a : ℝ in Ioi 0, upperGammaTruncatedDampingIntegrand ℓ η T n a)) := by filter_upwards [eventually_gt_atTop (0 : ℕ)] with n hn calc Real.log (‖Complex.GammaSeq ((m : ℂ) + Complex.I * (b : ℂ)) n‖ / ‖Complex.GammaSeq (m : ℂ) n‖) = -(∑ k ∈ Finset.range (n + 1), Real.log (‖(m : ℂ) + Complex.I * (b : ℂ) + (k : ℂ)‖ / (m + (k : ℝ)))) := upperGammaEuler_log_norm_ratio hm b hn _ = -(∑ k ∈ Finset.range (n + 1), Real.log (‖((η + 2 * (k : ℝ) / ℓ : ℝ) : ℂ) + Complex.I * (T : ℂ)‖ / (η + 2 * (k : ℝ) / ℓ))) := by congr 1 apply Finset.sum_congr rfl intro k hk simpa [m, b] using! (upperGammaLaplaceRate_log_ratio hℓ hη T k).symm _ = -(∫ a : ℝ in Ioi 0, upperGammaTruncatedDampingIntegrand ℓ η T n a) := by rw [integral_upperGammaTruncatedDampingIntegrand hℓ hη T n] have hlog := tendsto_upperGammaEuler_log_norm_ratio hm b have hdamping := tendsto_integral_upperGammaTruncatedDampingIntegrand hℓ hη T have hmatch := Filter.Tendsto.congr' hfinite.symm hdamping.neg have hidentity := tendsto_nhds_unique hlog hmatch have hdennorm : ‖Complex.Gamma (m : ℂ)‖ = Real.Gamma m := by rw [Complex.Gamma_ofReal] exact Complex.norm_of_nonneg (Real.Gamma_pos_of_pos hm).le rw [hdennorm] at hidentity change Real.log (‖Complex.Gamma ((m : ℂ) + Complex.I * (b : ℂ))‖ / Real.Gamma m) = -upperGammaDamping ℓ η T exact hidentity theorem upperGammaShifted_log_norm_eq_neg_damping {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (T : ℝ) : Real.log (‖Complex.Gamma (((ℓ * η / 2 : ℝ) : ℂ) - Complex.I * ((ℓ * T / 2 : ℝ) : ℂ))‖ / Real.Gamma (ℓ * η / 2)) = -upperGammaDamping ℓ η T := by have hconj : ‖Complex.Gamma (((ℓ * η / 2 : ℝ) : ℂ) - Complex.I * ((ℓ * T / 2 : ℝ) : ℂ))‖ = ‖Complex.Gamma (((ℓ * η / 2 : ℝ) : ℂ) + Complex.I * ((ℓ * T / 2 : ℝ) : ℂ))‖ := by have harg (m b : ℝ) : starRingEnd ℂ ((m : ℂ) + Complex.I * (b : ℂ)) = ((m : ℂ) - Complex.I * (b : ℂ)) := by simp [sub_eq_add_neg] rw [← harg (ℓ * η / 2) (ℓ * T / 2), Complex.Gamma_conj, Complex.norm_conj] rw [hconj] exact upperGammaPositiveShifted_log_norm_eq_neg_damping hℓ hη T theorem upperGammaShifted_modulus_eq_exp_neg_damping {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (T : ℝ) : ‖Complex.Gamma (((ℓ * η / 2 : ℝ) : ℂ) - Complex.I * ((ℓ * T / 2 : ℝ) : ℂ))‖ = Real.Gamma (ℓ * η / 2) * Real.exp (-upperGammaDamping ℓ η T) := by let m : ℝ := ℓ * η / 2 let b : ℝ := ℓ * T / 2 have hm : 0 < m := by try dsimp [m] positivity have hΓ : 0 < Real.Gamma m := Real.Gamma_pos_of_pos hm have hz : Complex.Gamma ((m : ℂ) - Complex.I * (b : ℂ)) ≠ 0 := by apply Complex.Gamma_ne_zero_of_re_pos simpa using! hm have hratio : 0 < ‖Complex.Gamma ((m : ℂ) - Complex.I * (b : ℂ))‖ / Real.Gamma m := div_pos (norm_pos_iff.mpr hz) hΓ have hlog := upperGammaShifted_log_norm_eq_neg_damping hℓ hη T change Real.log (‖Complex.Gamma ((m : ℂ) - Complex.I * (b : ℂ))‖ / Real.Gamma m) = -upperGammaDamping ℓ η T at hlog have hexp := congrArg Real.exp hlog rw [Real.exp_log hratio] at hexp change ‖Complex.Gamma ((m : ℂ) - Complex.I * (b : ℂ))‖ = Real.Gamma m * Real.exp (-upperGammaDamping ℓ η T) calc ‖Complex.Gamma ((m : ℂ) - Complex.I * (b : ℂ))‖ = (‖Complex.Gamma ((m : ℂ) - Complex.I * (b : ℂ))‖ / Real.Gamma m) * Real.Gamma m := by rw [div_mul_cancel₀ _ hΓ.ne'] _ = Real.exp (-upperGammaDamping ℓ η T) * Real.Gamma m := by rw [hexp] _ = Real.Gamma m * Real.exp (-upperGammaDamping ℓ η T) := by ring end noncomputable section open Filter MeasureTheory Set open scoped Topology theorem plusSaddleProfile_re_pos_of_relative_residue_bounds {ε ℓ r : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (N : ℕ) (hfinite : Real.exp (saddleSmallRadiusVariable ε r) * |(∑ n ∈ Finset.range (N + 1), (-saddleSmallRadiusVariable ε r) ^ n / (n.factorial : ℝ) * plusSaddleSmallRadiusCoefficient ε ℓ n) - Real.exp (-(saddleSmallRadiusVariable ε r))| < (1 / 2 : ℝ)) (hremainder : Real.exp (saddleSmallRadiusVariable ε r) * ‖plusSaddleTaylorRemainder ε ℓ N r / (saddleOriginValue ε ℓ : ℂ)‖ < (1 / 2 : ℝ)) : 0 < (plusSaddleProfile ε ℓ r).re := by let y : ℝ := saddleSmallRadiusVariable ε r let S : ℝ := ∑ n ∈ Finset.range (N + 1), (-y) ^ n / (n.factorial : ℝ) * plusSaddleSmallRadiusCoefficient ε ℓ n let Q : ℂ := plusSaddleTaylorRemainder ε ℓ N r / (saddleOriginValue ε ℓ : ℂ) have hO : 0 < saddleOriginValue ε ℓ := saddleOriginValue_pos hε ℓ have hnormal : (plusSaddleProfile ε ℓ r).re / saddleOriginValue ε ℓ = S + Q.re := by have h := congrArg Complex.re (plusSaddleProfile_div_origin_eq_small_radius_residue_series hε hℓ horder hr N) simpa [S, Q, y, Complex.div_ofReal_re, ← Complex.ofReal_neg, ← Complex.ofReal_pow] using! h have hexp : 0 < Real.exp y := Real.exp_pos y have hone : Real.exp y * Real.exp (-y) = 1 := by rw [← Real.exp_add] simp have hfinite' : Real.exp y * |S - Real.exp (-y)| < (1 / 2 : ℝ) := by simpa [S, y] using! hfinite have hremainder' : Real.exp y * ‖Q‖ < (1 / 2 : ℝ) := by simpa [Q, y] using! hremainder have hSabs : -|S - Real.exp (-y)| ≤ S - Real.exp (-y) := neg_abs_le _ have hSlower : (1 / 2 : ℝ) < Real.exp y * S := by have hscaled := mul_le_mul_of_nonneg_left hSabs hexp.le nlinarith have hQabs := Complex.abs_re_le_norm Q have hQneg : -‖Q‖ ≤ Q.re := by nlinarith [neg_abs_le Q.re] have hQlower : -(1 / 2 : ℝ) < Real.exp y * Q.re := by have hscaled := mul_le_mul_of_nonneg_left hQneg hexp.le nlinarith have hsum : 0 < S + Q.re := by have hscaled : 0 < Real.exp y * (S + Q.re) := by nlinarith exact (mul_pos_iff_of_pos_left hexp).mp hscaled exact (div_pos_iff_of_pos_right hO).mp (hnormal.symm ▸ hsum) end noncomputable section open Filter MeasureTheory Set open scoped Topology BigOperators theorem upperPositiveHalfGamma_scaled_sq_le (n : ℕ) (x : ℝ) : Real.Gamma ((n : ℝ) + 1 / 2) ^ 2 ≤ ‖Complex.Gamma (((((n : ℝ) + 1 / 2) : ℝ) : ℂ) + Complex.I * (x : ℂ))‖ ^ 2 * Real.cosh (Real.pi * x) := by induction n with | zero => norm_num only [Nat.cast_zero, zero_add] have hhalf : ‖Complex.Gamma (((1 / 2 : ℝ) : ℂ) + Complex.I * (x : ℂ))‖ ^ 2 = Real.pi / Real.cosh (Real.pi * x) := by convert! norm_gamma_half_add_imaginary_sq x using 1; norm_num rw [hhalf, Real.Gamma_one_half_eq, Real.sq_sqrt Real.pi_pos.le] field_simp [(Real.cosh_pos (Real.pi * x)).ne']; norm_num | succ n ih => let q : ℝ := (n : ℝ) + 1 / 2 have hq : 0 < q := by try dsimp [q] positivity have hreal : Real.Gamma (((n + 1 : ℕ) : ℝ) + 1 / 2) = q * Real.Gamma q := by convert! Real.Gamma_add_one hq.ne' using 1 · simp [q, Nat.cast_add, Nat.cast_one] ring_nf let z : ℂ := (q : ℂ) + Complex.I * (x : ℂ) have hz : z ≠ 0 := by intro hzero have h := congrArg Complex.re hzero have hqzero : q = 0 := by simpa [z] using! h exact hq.ne' hqzero have hcomplex : Complex.Gamma (((((n + 1 : ℕ) : ℝ) + 1 / 2 : ℝ) : ℂ) + Complex.I * (x : ℂ)) = z * Complex.Gamma z := by convert! Complex.Gamma_add_one z hz using 1 · simp [z, q, Nat.cast_add, Nat.cast_one] ring_nf have hzlower : q ≤ ‖z‖ := by have h := Complex.abs_re_le_norm z simpa [z, abs_of_pos hq] using! h have hcosh : 0 ≤ Real.cosh (Real.pi * x) := (Real.cosh_pos _).le have hqnorm : 0 ≤ ‖Complex.Gamma z‖ ^ 2 := sq_nonneg _ rw [hreal, hcomplex, norm_mul] have ih' : Real.Gamma q ^ 2 ≤ ‖Complex.Gamma z‖ ^ 2 * Real.cosh (Real.pi * x) := by simpa [q, z] using! ih calc (q * Real.Gamma q) ^ 2 = q ^ 2 * Real.Gamma q ^ 2 := by ring _ ≤ q ^ 2 * (‖Complex.Gamma z‖ ^ 2 * Real.cosh (Real.pi * x)) := mul_le_mul_of_nonneg_left ih' (sq_nonneg q) _ ≤ ‖z‖ ^ 2 * (‖Complex.Gamma z‖ ^ 2 * Real.cosh (Real.pi * x)) := by gcongr _ = (‖z‖ * ‖Complex.Gamma z‖) ^ 2 * Real.cosh (Real.pi * x) := by ring theorem upperNegativeContour_shortMeasure_pointwise {ε ℓ κ η a : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (hℓ : 0 < ℓ) (hκ : 1 ≤ κ) (hη : 0 < η) (hκη : κ + η ≤ 3) (ha : 0 < a) (hmargin : 0 ≤ shortMargin ε a) : ℓ * (-shortShellDensity ε a) * Real.cosh (κ * a) ≤ (1 - 4 * ε) * upperGammaMeasureDensity ℓ η a := by have hfactor : 0 ≤ 1 - 4 * ε := by apply (mul_nonneg_iff_of_pos_right hη).mp exact mul_nonneg (by linarith [hεsmall]) hη.le have hmargintop : shortMargin ε a ≤ 1 - 10 * ε := by unfold shortMargin nlinarith [mul_nonneg hε.le ha.le] have hbase : (ℓ / 2) * Real.exp (-η * a) / a ^ 2 ≤ upperGammaMeasureDensity ℓ η a := by have hvariance := (upperGammaVarianceDensity_pointwise_bounds (η := η) hℓ ha).1 apply (div_le_iff₀ (sq_pos_of_pos ha)).2 nlinarith have hbasepos : 0 ≤ (ℓ / 2) * Real.exp (-η * a) / a ^ 2 := by positivity have hratio : Real.cosh (κ * a) / Real.cosh a ≤ Real.exp ((κ - 1) * a) := by convert! cosh_ratio_upper ha.le (sub_nonneg.mpr hκ) using 1; ring_nf have hexp : Real.exp ((η - 2) * a) * Real.exp ((κ - 1) * a) ≤ 1 := by rw [← Real.exp_add, Real.exp_le_one_iff] nlinarith [mul_nonneg (show 0 ≤ 3 - (κ + η) by linarith) ha.le] have hcoefficient : shortMargin ε a * Real.exp ((η - 2) * a) * (Real.cosh (κ * a) / Real.cosh a) ≤ 1 - 4 * ε := by calc shortMargin ε a * Real.exp ((η - 2) * a) * (Real.cosh (κ * a) / Real.cosh a) ≤ shortMargin ε a * Real.exp ((η - 2) * a) * Real.exp ((κ - 1) * a) := by gcongr _ = shortMargin ε a * (Real.exp ((η - 2) * a) * Real.exp ((κ - 1) * a)) := by ring _ ≤ shortMargin ε a := by simpa using! mul_le_mul_of_nonneg_left hexp hmargin _ ≤ 1 - 10 * ε := hmargintop _ ≤ 1 - 4 * ε := by linarith have hidentity : ℓ * (-shortShellDensity ε a) * Real.cosh (κ * a) = (shortMargin ε a * Real.exp ((η - 2) * a) * (Real.cosh (κ * a) / Real.cosh a)) * ((ℓ / 2) * Real.exp (-η * a) / a ^ 2) := by have he : Real.exp ((η - 2) * a) * Real.exp (-η * a) = Real.exp (-2 * a) := by rw [← Real.exp_add] congr 1 ring unfold shortShellDensity field_simp [ha.ne', (Real.cosh_pos a).ne'] calc shortMargin ε a * Real.exp (-(2 * a)) = shortMargin ε a * (Real.exp ((η - 2) * a) * Real.exp (-η * a)) := by rw [he] congr 1 ring_nf _ = shortMargin ε a * Real.exp (a * (η - 2)) * Real.exp (-(a * η)) := by rw [show a * (η - 2) = (η - 2) * a by ring, show -(a * η) = -η * a by ring] ring rw [hidentity] calc (shortMargin ε a * Real.exp ((η - 2) * a) * (Real.cosh (κ * a) / Real.cosh a)) * ((ℓ / 2) * Real.exp (-η * a) / a ^ 2) ≤ (1 - 4 * ε) * ((ℓ / 2) * Real.exp (-η * a) / a ^ 2) := mul_le_mul_of_nonneg_right hcoefficient hbasepos _ ≤ (1 - 4 * ε) * upperGammaMeasureDensity ℓ η a := mul_le_mul_of_nonneg_left hbase hfactor theorem upperNegativeContour_shortDamping_le_gamma {ε ℓ κ η : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (hℓ : 0 < ℓ) (hκ : 1 ≤ κ) (hη : 0 < η) (hκη : κ + η ≤ 3) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) (T : ℝ) : upperShortShellDamping ε ℓ (-κ - 1) T ≤ (1 - 4 * ε) * upperGammaDamping ℓ η T := by let a₀ : ℝ := shortCutoff ε let A : ℝ := shortEndpoint ε have ha₀ : 0 < a₀ := by try dsimp [a₀, shortCutoff] positivity have hfactor : 0 ≤ 1 - 4 * ε := by linarith have hsubset : Ioc a₀ A ⊆ Ioi (0 : ℝ) := by intro a ha exact ha₀.trans ha.1 have hgamma := upperGammaDampingIntegrand_integrable hℓ hη T have hgammaOn : IntegrableOn (upperGammaDampingIntegrand ℓ η T) (Ioc a₀ A) := hgamma.mono_set hsubset have hscaledOn : IntegrableOn (fun a : ℝ => (1 - 4 * ε) * upperGammaDampingIntegrand ℓ η T a) (Ioc a₀ A) := hgammaOn.const_mul (1 - 4 * ε) have hs := shortShellDensity_intervalIntegrable hε horder have hcosh : Continuous (fun a : ℝ => Real.cosh (κ * a)) := by fun_prop have hosc : Continuous (fun a : ℝ => 1 - Real.cos (a * T)) := by fun_prop have hshortInterval : IntervalIntegrable (fun a : ℝ => ℓ * (-shortShellDensity ε a) * Real.cosh (κ * a) * (1 - Real.cos (a * T))) volume a₀ A := by have hneg : IntervalIntegrable (fun a : ℝ => -shortShellDensity ε a) volume a₀ A := by simpa [a₀, A, Pi.neg_apply] using! hs.neg exact ((hneg.const_mul ℓ).mul_continuousOn hcosh.continuousOn).mul_continuousOn hosc.continuousOn have hshortOn : IntegrableOn (fun a : ℝ => ℓ * (-shortShellDensity ε a) * Real.cosh (κ * a) * (1 - Real.cos (a * T))) (Ioc a₀ A) := (intervalIntegrable_iff_integrableOn_Ioc_of_le (show a₀ ≤ A by exact horder)).mp hshortInterval have hpoint (a : ℝ) (ha : a ∈ Ioc a₀ A) : ℓ * (-shortShellDensity ε a) * Real.cosh (κ * a) * (1 - Real.cos (a * T)) ≤ (1 - 4 * ε) * upperGammaDampingIntegrand ℓ η T a := by have hcomparison := upperNegativeContour_shortMeasure_pointwise hε hεsmall hℓ hκ hη hκη (ha₀.trans ha.1) (hmargin a ⟨ha.1.le, ha.2⟩) have hoscNonneg : 0 ≤ 1 - Real.cos (a * T) := sub_nonneg.mpr (Real.cos_le_one _) have hmul := mul_le_mul_of_nonneg_right hcomparison hoscNonneg simpa [upperGammaDampingIntegrand, mul_assoc, mul_left_comm, mul_comm] using! hmul have hmono := setIntegral_mono_on hshortOn hscaledOn measurableSet_Ioc hpoint have hnonnegative : 0 ≤ᵐ[volume.restrict (Ioi (0 : ℝ))] upperGammaDampingIntegrand ℓ η T := by filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha unfold upperGammaDampingIntegrand exact mul_nonneg (sub_nonneg.mpr (Real.cos_le_one _)) (upperGammaMeasureDensity_pos hℓ ha).le have haesubset : Ioc a₀ A ≤ᶠ[ae (volume : Measure ℝ)] Ioi 0 := Filter.Eventually.of_forall fun a ha => hsubset ha have hrestrict := setIntegral_mono_set hgamma hnonnegative haesubset have hscaleRestrict := mul_le_mul_of_nonneg_left hrestrict hfactor have hshortEq : upperShortShellDamping ε ℓ (-κ - 1) T = ∫ a : ℝ in Ioc a₀ A, ℓ * (-shortShellDensity ε a) * Real.cosh (κ * a) * (1 - Real.cos (a * T)) := by unfold upperShortShellDamping rw [show 1 + (-κ - 1) = -κ by ring, ← intervalIntegral.integral_const_mul, intervalIntegral.integral_of_le horder] apply setIntegral_congr_fun measurableSet_Ioc intro a ha change ℓ * ((-shortShellDensity ε a) * Real.cosh ((-κ) * a) * (1 - Real.cos (a * T))) = ℓ * (-shortShellDensity ε a) * Real.cosh (κ * a) * (1 - Real.cos (a * T)) rw [show (-κ) * a = -(κ * a) by ring, Real.cosh_neg] ring calc upperShortShellDamping ε ℓ (-κ - 1) T = ∫ a : ℝ in Ioc a₀ A, ℓ * (-shortShellDensity ε a) * Real.cosh (κ * a) * (1 - Real.cos (a * T)) := hshortEq _ ≤ ∫ a : ℝ in Ioc a₀ A, (1 - 4 * ε) * upperGammaDampingIntegrand ℓ η T a := hmono _ = (1 - 4 * ε) * ∫ a : ℝ in Ioc a₀ A, upperGammaDampingIntegrand ℓ η T a := by rw [integral_const_mul] _ ≤ (1 - 4 * ε) * ∫ a : ℝ in Ioi 0, upperGammaDampingIntegrand ℓ η T a := hscaleRestrict _ = (1 - 4 * ε) * upperGammaDamping ℓ η T := by rfl def saddleNegativeContourOrdinate (ℓ : ℝ) (N : ℕ) : ℝ := 1 + (2 * (N : ℝ) + 1) / ℓ def saddleNegativeGammaRate (ℓ : ℝ) (N : ℕ) : ℝ := (2 * (N : ℝ) + 3) / ℓ theorem saddleNegativeGammaRate_pos {ℓ : ℝ} (hℓ : 0 < ℓ) (N : ℕ) : 0 < saddleNegativeGammaRate ℓ N := by unfold saddleNegativeGammaRate positivity theorem one_le_saddleNegativeContourOrdinate {ℓ : ℝ} (hℓ : 0 < ℓ) (N : ℕ) : 1 ≤ saddleNegativeContourOrdinate ℓ N := by unfold saddleNegativeContourOrdinate have hN : 0 ≤ (N : ℝ) := Nat.cast_nonneg N have hq : 0 ≤ (2 * (N : ℝ) + 1) / ℓ := by positivity linarith theorem saddleNegativeContourOrdinate_add_rate_le_three {ℓ : ℝ} (hℓ : 0 < ℓ) (N : ℕ) (hN : 2 * (((N + 1 : ℕ) : ℝ)) ≤ ℓ) : saddleNegativeContourOrdinate ℓ N + saddleNegativeGammaRate ℓ N ≤ 3 := by unfold saddleNegativeContourOrdinate saddleNegativeGammaRate have hratio : (4 * (N : ℝ) + 4) / ℓ ≤ 2 := by apply (div_le_iff₀ hℓ).2 norm_num [Nat.cast_add, Nat.cast_one] at hN nlinarith calc 1 + (2 * (N : ℝ) + 1) / ℓ + (2 * (N : ℝ) + 3) / ℓ = 1 + (4 * (N : ℝ) + 4) / ℓ := by ring _ ≤ 1 + 2 := by simpa [add_comm] using! add_le_add_left hratio 1 _ = 3 := by norm_num theorem upperNegativeContour_reflectedGamma_damping_exp_le_cosh {ℓ : ℝ} (hℓ : 0 < ℓ) (N : ℕ) (s : ℝ) : Real.exp (2 * upperGammaDamping ℓ (saddleNegativeGammaRate ℓ N) (-s / ℓ)) ≤ Real.cosh (Real.pi * (s / 2)) := by let η : ℝ := saddleNegativeGammaRate ℓ N let D : ℝ := upperGammaDamping ℓ η (-s / ℓ) let q : ℝ := (N : ℝ) + 3 / 2 have hη : 0 < η := saddleNegativeGammaRate_pos hℓ N have hq : 0 < q := by try dsimp [q] positivity have hΓ : 0 < Real.Gamma q := Real.Gamma_pos_of_pos hq have hmod : ‖Complex.Gamma ((q : ℂ) + Complex.I * (((s / 2 : ℝ) : ℂ)))‖ = Real.Gamma q * Real.exp (-D) := by have h := upperGammaShifted_modulus_eq_exp_neg_damping hℓ hη (-s / ℓ) have hmass : ℓ * η / 2 = q := by try dsimp [η, q, saddleNegativeGammaRate] field_simp [hℓ.ne'] have hfreq : ℓ * (-s / ℓ) / 2 = -s / 2 := by field_simp [hℓ.ne'] rw [hmass, hfreq] at h have harg : ((q : ℂ) - Complex.I * (((-s / 2 : ℝ) : ℂ))) = (q : ℂ) + Complex.I * (((s / 2 : ℝ) : ℂ)) := by push_cast ring rw [harg] at h exact h have hhalf := upperPositiveHalfGamma_scaled_sq_le (N + 1) (s / 2) have hhalfnormal : Real.Gamma q ^ 2 ≤ ‖Complex.Gamma ((q : ℂ) + Complex.I * (((s / 2 : ℝ) : ℂ)))‖ ^ 2 * Real.cosh (Real.pi * (s / 2)) := by have hcast : ((N + 1 : ℕ) : ℝ) + 1 / 2 = q := by try dsimp [q] norm_num [Nat.cast_add, Nat.cast_one]; ring rw [hcast] at hhalf exact hhalf rw [hmod, mul_pow] at hhalfnormal have hcancel : 1 ≤ Real.exp (-D) ^ 2 * Real.cosh (Real.pi * (s / 2)) := by have hscaled : Real.Gamma q ^ 2 * 1 ≤ Real.Gamma q ^ 2 * (Real.exp (-D) ^ 2 * Real.cosh (Real.pi * (s / 2))) := by simpa [mul_assoc] using! hhalfnormal exact le_of_mul_le_mul_left hscaled (sq_pos_of_pos hΓ) have hinverse : Real.exp (2 * D) * Real.exp (-D) ^ 2 = 1 := by rw [pow_two, ← Real.exp_add, ← Real.exp_add] convert! Real.exp_zero using 1; ring_nf change Real.exp (2 * D) ≤ Real.cosh (Real.pi * (s / 2)) calc Real.exp (2 * D) = Real.exp (2 * D) * 1 := by ring _ ≤ Real.exp (2 * D) * (Real.exp (-D) ^ 2 * Real.cosh (Real.pi * (s / 2))) := mul_le_mul_of_nonneg_left hcancel (Real.exp_pos _).le _ = Real.cosh (Real.pi * (s / 2)) := by rw [show Real.exp (2 * D) * (Real.exp (-D) ^ 2 * Real.cosh (Real.pi * (s / 2))) = (Real.exp (2 * D) * Real.exp (-D) ^ 2) * Real.cosh (Real.pi * (s / 2)) by ring, hinverse, one_mul] theorem upperNegativeHalfGamma_reflection_norm (N : ℕ) (s : ℝ) : ‖Complex.Gamma (upperNegativeHalfGammaArgument N s)‖ * ‖Complex.Gamma (((((N : ℝ) + 3 / 2) : ℝ) : ℂ) + Complex.I * (((s / 2 : ℝ) : ℂ)))‖ = Real.pi / Real.cosh (Real.pi * (s / 2)) := by induction N with | zero => let z : ℂ := (1 / 2 : ℂ) + Complex.I * (((s / 2 : ℝ) : ℂ)) have hz : z ≠ 0 := by intro hz0 have h := congrArg Complex.re hz0 norm_num [z] at h have hneg : -z ≠ 0 := neg_ne_zero.mpr hz have hargneg : upperNegativeHalfGammaArgument 0 s = -z := by simp [upperNegativeHalfGammaArgument, z] ring have hargpos : (((((0 : ℕ) : ℝ) + 3 / 2 : ℝ) : ℂ) + Complex.I * (((s / 2 : ℝ) : ℂ))) = z + 1 := by simp [z] ring have hconjarg : -z + 1 = starRingEnd ℂ z := by try dsimp [z] simp only [map_add, map_div₀, Complex.conj_ofReal, Complex.conj_I, Complex.conj_ofNat, map_mul, map_one] push_cast ring have hnegRec := Complex.Gamma_add_one (-z) hneg rw [hconjarg, Complex.Gamma_conj] at hnegRec have hnegNorm : ‖Complex.Gamma z‖ = ‖z‖ * ‖Complex.Gamma (-z)‖ := by have h := congrArg norm hnegRec simpa [norm_mul] using! h have hposRec := Complex.Gamma_add_one z hz have hposNorm : ‖Complex.Gamma (z + 1)‖ = ‖z‖ * ‖Complex.Gamma z‖ := by simpa [norm_mul] using! congrArg norm hposRec rw [hargneg, hargpos, hposNorm] calc ‖Complex.Gamma (-z)‖ * (‖z‖ * ‖Complex.Gamma z‖) = (‖z‖ * ‖Complex.Gamma (-z)‖) * ‖Complex.Gamma z‖ := by ring _ = ‖Complex.Gamma z‖ ^ 2 := by rw [← hnegNorm] ring _ = Real.pi / Real.cosh (Real.pi * (s / 2)) := by try dsimp [z] convert! norm_gamma_half_add_imaginary_sq (s / 2) using 1 | succ N ih => let z : ℂ := (((((N : ℝ) + 3 / 2) : ℝ) : ℂ) + Complex.I * (((s / 2 : ℝ) : ℂ))) have hz : z ≠ 0 := by intro hz0 have h := congrArg Complex.re hz0 simp [z] at h have hN : 0 ≤ (N : ℝ) := Nat.cast_nonneg N linarith have harg : upperNegativeHalfGammaArgument (N + 1) s = -z := by unfold upperNegativeHalfGammaArgument simp [z, Nat.cast_add, Nat.cast_one] ring have hpos : (((((N + 1 : ℕ) : ℝ) + 3 / 2 : ℝ) : ℂ) + Complex.I * (((s / 2 : ℝ) : ℂ))) = z + 1 := by simp [z, Nat.cast_add, Nat.cast_one] ring have hnegRec := Complex.Gamma_add_one (upperNegativeHalfGammaArgument (N + 1) s) (upperNegativeHalfGammaArgument_ne_zero (N + 1) s) rw [upperNegativeHalfGammaArgument_succ_add_one] at hnegRec have hnegNorm : ‖Complex.Gamma (upperNegativeHalfGammaArgument N s)‖ = ‖z‖ * ‖Complex.Gamma (upperNegativeHalfGammaArgument (N + 1) s)‖ := by have h := congrArg norm hnegRec rw [norm_mul, harg, norm_neg] at h simpa only [harg] using! h have hposRec := Complex.Gamma_add_one z hz have hposNorm : ‖Complex.Gamma (z + 1)‖ = ‖z‖ * ‖Complex.Gamma z‖ := by simpa [norm_mul] using! congrArg norm hposRec rw [hpos, hposNorm] calc ‖Complex.Gamma (upperNegativeHalfGammaArgument (N + 1) s)‖ * (‖z‖ * ‖Complex.Gamma z‖) = (‖z‖ * ‖Complex.Gamma (upperNegativeHalfGammaArgument (N + 1) s)‖) * ‖Complex.Gamma z‖ := by ring _ = ‖Complex.Gamma (upperNegativeHalfGammaArgument N s)‖ * ‖Complex.Gamma z‖ := by rw [← hnegNorm] _ = Real.pi / Real.cosh (Real.pi * (s / 2)) := by simpa [z] using! ih theorem upperNegativeHalfGamma_norm_eq_reflected_damping {ℓ : ℝ} (hℓ : 0 < ℓ) (N : ℕ) (s : ℝ) : ‖Complex.Gamma (upperNegativeHalfGammaArgument N s)‖ = (Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp (upperGammaDamping ℓ (saddleNegativeGammaRate ℓ N) (-s / ℓ)) / Real.cosh (Real.pi * (s / 2)) := by let η : ℝ := saddleNegativeGammaRate ℓ N let D : ℝ := upperGammaDamping ℓ η (-s / ℓ) let q : ℝ := (N : ℝ) + 3 / 2 have hη : 0 < η := saddleNegativeGammaRate_pos hℓ N have hq : 0 < q := by try dsimp [q] positivity have hΓ : 0 < Real.Gamma q := Real.Gamma_pos_of_pos hq have hmass : ℓ * η / 2 = q := by try dsimp [η, q, saddleNegativeGammaRate] field_simp [hℓ.ne'] have hfreq : ℓ * (-s / ℓ) / 2 = -s / 2 := by field_simp [hℓ.ne'] have hmod := upperGammaShifted_modulus_eq_exp_neg_damping hℓ hη (-s / ℓ) rw [hmass, hfreq] at hmod have harg : ((q : ℂ) - Complex.I * (((-s / 2 : ℝ) : ℂ))) = (q : ℂ) + Complex.I * (((s / 2 : ℝ) : ℂ)) := by push_cast ring rw [harg] at hmod have href := upperNegativeHalfGamma_reflection_norm N s change ‖Complex.Gamma (upperNegativeHalfGammaArgument N s)‖ * ‖Complex.Gamma ((q : ℂ) + Complex.I * (((s / 2 : ℝ) : ℂ)))‖ = Real.pi / Real.cosh (Real.pi * (s / 2)) at href rw [hmod] at href change ‖Complex.Gamma (upperNegativeHalfGammaArgument N s)‖ = (Real.pi / Real.Gamma q) * Real.exp D / Real.cosh (Real.pi * (s / 2)) rw [Real.exp_neg] at href field_simp [hΓ.ne', (Real.exp_pos D).ne', (Real.cosh_pos (Real.pi * (s / 2))).ne'] at href ⊢ simpa [D, neg_div, mul_comm, mul_left_comm, mul_assoc] using! href theorem upper_log_cosh_ge_abs_sub_log_two (x : ℝ) : |x| - Real.log 2 ≤ Real.log (Real.cosh x) := by have hhalf : Real.exp |x| / 2 ≤ Real.cosh x := by rw [← Real.cosh_abs, Real.cosh_eq] have hp := (Real.exp_pos (-|x|)).le linarith apply Real.exp_le_exp.mp rw [Real.exp_log (Real.cosh_pos x), Real.exp_sub, Real.exp_log (by norm_num : (0 : ℝ) < 2)] exact hhalf theorem upperNegativeContour_gamma_mul_exp_short_le {ε ℓ : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (hℓ : 0 < ℓ) (N : ℕ) (hN : 2 * (((N + 1 : ℕ) : ℝ)) ≤ ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) (s : ℝ) : ‖Complex.Gamma (upperNegativeHalfGammaArgument N s)‖ * Real.exp (upperShortShellDamping ε ℓ (-saddleNegativeContourOrdinate ℓ N - 1) (-s / ℓ)) ≤ (Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp (2 * ε * Real.log 2) * Real.exp (-ε * Real.pi * |s|) := by let κ : ℝ := saddleNegativeContourOrdinate ℓ N let η : ℝ := saddleNegativeGammaRate ℓ N let T : ℝ := -s / ℓ let D : ℝ := upperGammaDamping ℓ η T let C : ℝ := Real.cosh (Real.pi * (s / 2)) have hκ : 1 ≤ κ := one_le_saddleNegativeContourOrdinate hℓ N have hη : 0 < η := saddleNegativeGammaRate_pos hℓ N have hκη : κ + η ≤ 3 := saddleNegativeContourOrdinate_add_rate_le_three hℓ N hN have hshort := upperNegativeContour_shortDamping_le_gamma hε hεsmall hℓ hκ hη hκη horder hmargin T have hD : 0 ≤ D := upperGammaDamping_nonneg hℓ T have hC : 0 < C := Real.cosh_pos _ have hreflect := upperNegativeContour_reflectedGamma_damping_exp_le_cosh hℓ N s have hDlog : 2 * D ≤ Real.log C := by apply Real.exp_le_exp.mp rw [Real.exp_log hC] exact hreflect have hlog := upper_log_cosh_ge_abs_sub_log_two (Real.pi * (s / 2)) have hfactor : 0 ≤ 2 - 4 * ε := by linarith have hphase : (2 - 4 * ε) * D - Real.log C ≤ -(2 * ε) * Real.log C := by nlinarith [mul_nonneg hfactor (show 0 ≤ Real.log C - 2 * D by linarith)] have hlogphase : -(2 * ε) * Real.log C ≤ 2 * ε * Real.log 2 - ε * Real.pi * |s| := by have habs : |Real.pi * (s / 2)| = Real.pi * |s| / 2 := by rw [abs_mul, abs_of_pos Real.pi_pos, abs_div, abs_of_pos (by norm_num : (0 : ℝ) < 2)] ring rw [habs] at hlog nlinarith [mul_nonneg (show 0 ≤ 2 * ε by positivity) (show 0 ≤ Real.log C - (Real.pi * |s| / 2 - Real.log 2) by try dsimp [C] linarith)] have hΓ : 0 < Real.Gamma ((N : ℝ) + 3 / 2) := by apply Real.Gamma_pos_of_pos positivity have hpref : 0 ≤ Real.pi / Real.Gamma ((N : ℝ) + 3 / 2) := by positivity rw [upperNegativeHalfGamma_norm_eq_reflected_damping hℓ N s] change ((Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp D / C) * Real.exp (upperShortShellDamping ε ℓ (-κ - 1) T) ≤ (Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp (2 * ε * Real.log 2) * Real.exp (-ε * Real.pi * |s|) have hshortexp : Real.exp (upperShortShellDamping ε ℓ (-κ - 1) T) ≤ Real.exp ((1 - 4 * ε) * D) := Real.exp_le_exp.mpr hshort calc ((Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp D / C) * Real.exp (upperShortShellDamping ε ℓ (-κ - 1) T) ≤ ((Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp D / C) * Real.exp ((1 - 4 * ε) * D) := by gcongr _ = (Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp ((2 - 4 * ε) * D - Real.log C) := by have he : Real.exp D * Real.exp ((1 - 4 * ε) * D) = Real.exp ((2 - 4 * ε) * D) := by rw [← Real.exp_add] congr 1 ring rw [Real.exp_sub, Real.exp_log hC] calc ((Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp D / C) * Real.exp ((1 - 4 * ε) * D) = (Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * (Real.exp D * Real.exp ((1 - 4 * ε) * D)) / C := by ring _ = (Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp ((2 - 4 * ε) * D) / C := by rw [he] _ = (Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * (Real.exp ((2 - 4 * ε) * D) / C) := by ring _ ≤ (Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp (-(2 * ε) * Real.log C) := by gcongr _ ≤ (Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp (2 * ε * Real.log 2 - ε * Real.pi * |s|) := by gcongr _ = (Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp (2 * ε * Real.log 2) * Real.exp (-ε * Real.pi * |s|) := by rw [show 2 * ε * Real.log 2 - ε * Real.pi * |s| = (2 * ε * Real.log 2) + (-ε * Real.pi * |s|) by ring, Real.exp_add] ring theorem upperShortShellDamping_neg_frequency (ε ℓ δ T : ℝ) : upperShortShellDamping ε ℓ δ (-T) = upperShortShellDamping ε ℓ δ T := by unfold upperShortShellDamping congr 1 apply intervalIntegral.integral_congr intro a ha change (-shortShellDensity ε a) * Real.cosh ((1 + δ) * a) * (1 - Real.cos (a * (-T))) = (-shortShellDensity ε a) * Real.cosh ((1 + δ) * a) * (1 - Real.cos (a * T)) rw [show a * (-T) = -(a * T) by ring, Real.cos_neg] theorem saddleTaylorContour_gammaArgument (N : ℕ) (s : ℝ) : (((saddleTaylorContour N : ℂ) + (s : ℂ) * Complex.I) / 2) = upperNegativeHalfGammaArgument N (-s) := by unfold saddleTaylorContour upperNegativeHalfGammaArgument push_cast ring theorem saddleTaylorContour_shellArgument {ℓ : ℝ} (hℓ : 0 < ℓ) (N : ℕ) (s : ℝ) : Complex.I * (((saddleTaylorContour N : ℂ) + (s : ℂ) * Complex.I) - (ℓ : ℂ)) / (ℓ : ℂ) = ((-s / ℓ : ℝ) : ℂ) + Complex.I * (((-saddleNegativeContourOrdinate ℓ N : ℝ) : ℂ)) := by unfold saddleTaylorContour saddleNegativeContourOrdinate push_cast field_simp [hℓ.ne'] ring_nf simp [Complex.I_sq]; ring theorem saddleNegativeContourOrdinate_le_two {ℓ : ℝ} (hℓ : 0 < ℓ) (N : ℕ) (hN : 2 * (((N + 1 : ℕ) : ℝ)) ≤ ℓ) : saddleNegativeContourOrdinate ℓ N ≤ 2 := by unfold saddleNegativeContourOrdinate have hratio : (2 * (N : ℝ) + 1) / ℓ ≤ 1 := by apply (div_le_iff₀ hℓ).2 norm_num [Nat.cast_add, Nat.cast_one] at hN nlinarith linarith theorem upperNegativeContour_gamma_mul_shellExponential_le {ε ℓ : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (hℓ : 0 < ℓ) (N : ℕ) (hN : 2 * (((N + 1 : ℕ) : ℝ)) ≤ ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) (s : ℝ) : ‖Complex.Gamma (((saddleTaylorContour N : ℂ) + (s : ℂ) * Complex.I) / 2) * Complex.exp ((ℓ : ℂ) * mellinShellPhase ε (Complex.I * (((saddleTaylorContour N : ℂ) + (s : ℂ) * Complex.I) - (ℓ : ℂ)) / (ℓ : ℂ)))‖ ≤ Real.exp (ℓ * realHyperbolicShellPhase ε (saddleNegativeContourOrdinate ℓ N)) * ((Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp (2 * ε * Real.log 2) * Real.exp (-ε * Real.pi * |s|)) := by let κ : ℝ := saddleNegativeContourOrdinate ℓ N let T : ℝ := -s / ℓ let δ : ℝ := -κ - 1 let S : ℝ := upperShortShellDamping ε ℓ δ T let P : ℝ := positiveShellDamping ε ℓ δ T have hP : 0 ≤ P := positiveShellDamping_nonneg hℓ.le have hgamma := upperNegativeContour_gamma_mul_exp_short_le hε hεsmall hℓ N hN horder hmargin (-s) have heven : upperShortShellDamping ε ℓ δ (-(-s) / ℓ) = S := by have h := upperShortShellDamping_neg_frequency ε ℓ δ T have hfreq : -T = -(-s) / ℓ := by try dsimp [T] ring rw [hfreq] at h exact h have hgamma' : ‖Complex.Gamma (upperNegativeHalfGammaArgument N (-s))‖ * Real.exp S ≤ (Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp (2 * ε * Real.log 2) * Real.exp (-ε * Real.pi * |s|) := by have h : ‖Complex.Gamma (upperNegativeHalfGammaArgument N (-s))‖ * Real.exp (upperShortShellDamping ε ℓ δ (s / ℓ)) ≤ (Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp (2 * ε * Real.log 2) * Real.exp (-ε * Real.pi * |s|) := by simpa [κ, δ, abs_neg] using! hgamma have hfreq : s / ℓ = -T := by try dsimp [T] ring rw [hfreq, upperShortShellDamping_neg_frequency] at h exact h have hshell := norm_saddleShellExponential_eq_exp_neg_damping hε horder ℓ T (-κ) have hshell' : ‖Complex.exp ((ℓ : ℂ) * mellinShellPhase ε ((T : ℂ) + Complex.I * ((-κ : ℝ) : ℂ)))‖ = Real.exp (ℓ * realHyperbolicShellPhase ε κ) * Real.exp (-(P - S)) := by rw [realHyperbolicShellPhase_neg] at hshell convert! hshell using 1 have hexp : Real.exp (-(P - S)) ≤ Real.exp S := by apply Real.exp_le_exp.mpr linarith rw [saddleTaylorContour_gammaArgument, saddleTaylorContour_shellArgument hℓ N s, norm_mul, hshell'] calc ‖Complex.Gamma (upperNegativeHalfGammaArgument N (-s))‖ * (Real.exp (ℓ * realHyperbolicShellPhase ε κ) * Real.exp (-(P - S))) ≤ ‖Complex.Gamma (upperNegativeHalfGammaArgument N (-s))‖ * (Real.exp (ℓ * realHyperbolicShellPhase ε κ) * Real.exp S) := by gcongr _ = Real.exp (ℓ * realHyperbolicShellPhase ε κ) * (‖Complex.Gamma (upperNegativeHalfGammaArgument N (-s))‖ * Real.exp S) := by ring _ ≤ Real.exp (ℓ * realHyperbolicShellPhase ε κ) * ((Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp (2 * ε * Real.log 2) * Real.exp (-ε * Real.pi * |s|)) := mul_le_mul_of_nonneg_left hgamma' (Real.exp_pos _).le def saddleNegativeFrequencyMajorant (ε s : ℝ) : ℝ := (1 + |s|) ^ 3 * Real.exp (-ε * Real.pi * |s|) theorem saddleNegativeFrequencyMajorant_integrable {ε : ℝ} (hε : 0 < ε) : Integrable (saddleNegativeFrequencyMajorant ε) := by have hrate : 0 < ε * Real.pi := mul_pos hε Real.pi_pos have h0 := integrable_abs_pow_mul_exp_neg_mul_abs 0 hrate have h1 := integrable_abs_pow_mul_exp_neg_mul_abs 1 hrate have h2 := integrable_abs_pow_mul_exp_neg_mul_abs 2 hrate have h3 := integrable_abs_pow_mul_exp_neg_mul_abs 3 hrate have hsum := h0.add ((h1.const_mul 3).add ((h2.const_mul 3).add h3)) apply hsum.congr filter_upwards [] with s unfold saddleNegativeFrequencyMajorant simp only [Pi.add_apply, pow_zero, pow_one] ring_nf theorem norm_plusPolynomial_negativeContour_le {ε ℓ : ℝ} (hℓ : 0 < ℓ) (N : ℕ) (hN : 2 * (((N + 1 : ℕ) : ℝ)) ≤ ℓ) (s : ℝ) : ‖plusPolynomial ε (Complex.I * (((saddleTaylorContour N : ℂ) + (s : ℂ) * Complex.I) - (ℓ : ℂ)) / (ℓ : ℂ))‖ ≤ 27 * (1 + |beta ε|) * (1 + |s|) ^ 3 := by let κ : ℝ := saddleNegativeContourOrdinate ℓ N have hκ : 1 ≤ κ := one_le_saddleNegativeContourOrdinate hℓ N have hκtop : κ ≤ 2 := saddleNegativeContourOrdinate_le_two hℓ N hN have hℓone : 1 ≤ ℓ := by norm_num [Nat.cast_add, Nat.cast_one] at hN have hcast : 0 ≤ (N : ℝ) := Nat.cast_nonneg N linarith have hdivide : |s| / ℓ ≤ |s| := (div_le_self (abs_nonneg s) hℓone) have hnorm : ‖((-s / ℓ : ℝ) : ℂ) + Complex.I * (((-κ : ℝ) : ℂ))‖ ≤ |s| / ℓ + κ := by calc ‖((-s / ℓ : ℝ) : ℂ) + Complex.I * (((-κ : ℝ) : ℂ))‖ ≤ ‖((-s / ℓ : ℝ) : ℂ)‖ + ‖Complex.I * (((-κ : ℝ) : ℂ))‖ := norm_add_le _ _ _ = |s| / ℓ + κ := by simp [Complex.norm_real, Real.norm_eq_abs, abs_of_pos hℓ, abs_of_nonneg (show 0 ≤ κ by linarith)] have hbase : 1 + ‖((-s / ℓ : ℝ) : ℂ) + Complex.I * (((-κ : ℝ) : ℂ))‖ ≤ 3 * (1 + |s|) := by nlinarith [abs_nonneg s] rw [saddleTaylorContour_shellArgument hℓ N s] calc ‖plusPolynomial ε (((-s / ℓ : ℝ) : ℂ) + Complex.I * (((-κ : ℝ) : ℂ)))‖ ≤ (1 + |beta ε|) * (1 + ‖((-s / ℓ : ℝ) : ℂ) + Complex.I * (((-κ : ℝ) : ℂ))‖) ^ 3 := norm_plusPolynomial_le ε _ _ ≤ (1 + |beta ε|) * (3 * (1 + |s|)) ^ 3 := by gcongr _ = 27 * (1 + |beta ε|) * (1 + |s|) ^ 3 := by ring theorem saddleNegativeContour_piExponential_norm (ℓ : ℝ) (N : ℕ) (s : ℝ) : ‖Complex.exp ((((ℓ : ℂ) - ((saddleTaylorContour N : ℂ) + (s : ℂ) * Complex.I)) * (Real.log Real.pi : ℂ) / 2))‖ = Real.exp ((ℓ - saddleTaylorContour N) * Real.log Real.pi / 2) := by rw [Complex.norm_exp] congr 1 simp [Complex.mul_re] def saddleNegativeMellinMajorantCoefficient (ε ℓ : ℝ) (N : ℕ) : ℝ := 27 * (1 + |beta ε|) * Real.exp (2 * ε * Real.log 2) * (Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp ((ℓ - saddleTaylorContour N) * Real.log Real.pi / 2) * Real.exp (ℓ * realHyperbolicShellPhase ε (saddleNegativeContourOrdinate ℓ N)) theorem plusSaddleMellinData_negativeContour_norm_le {ε ℓ : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (hℓ : 0 < ℓ) (N : ℕ) (hN : 2 * (((N + 1 : ℕ) : ℝ)) ≤ ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) (s : ℝ) : ‖plusSaddleMellinData ε ℓ ((saddleTaylorContour N : ℂ) + (s : ℂ) * Complex.I)‖ ≤ saddleNegativeMellinMajorantCoefficient ε ℓ N * saddleNegativeFrequencyMajorant ε s := by let z : ℂ := (saddleTaylorContour N : ℂ) + (s : ℂ) * Complex.I let q : ℂ := Complex.I * (z - (ℓ : ℂ)) / (ℓ : ℂ) have hfactor := upperNegativeContour_gamma_mul_shellExponential_le hε hεsmall hℓ N hN horder hmargin s have hpoly := norm_plusPolynomial_negativeContour_le (ε := ε) hℓ N hN s have hpi := saddleNegativeContour_piExponential_norm ℓ N s change ‖plusSaddleMellinData ε ℓ z‖ ≤ _ unfold plusSaddleMellinData saddleMellinEnvelope change ‖(Complex.exp (((ℓ : ℂ) - z) * (Real.log Real.pi : ℂ) / 2) * Complex.Gamma (z / 2) * Complex.exp ((ℓ : ℂ) * mellinShellPhase ε q)) * plusPolynomial ε q‖ ≤ _ calc ‖(Complex.exp (((ℓ : ℂ) - z) * (Real.log Real.pi : ℂ) / 2) * Complex.Gamma (z / 2) * Complex.exp ((ℓ : ℂ) * mellinShellPhase ε q)) * plusPolynomial ε q‖ = ‖Complex.exp (((ℓ : ℂ) - z) * (Real.log Real.pi : ℂ) / 2)‖ * ‖Complex.Gamma (z / 2) * Complex.exp ((ℓ : ℂ) * mellinShellPhase ε q)‖ * ‖plusPolynomial ε q‖ := by rw [norm_mul, norm_mul, norm_mul, norm_mul] ring _ ≤ Real.exp ((ℓ - saddleTaylorContour N) * Real.log Real.pi / 2) * (Real.exp (ℓ * realHyperbolicShellPhase ε (saddleNegativeContourOrdinate ℓ N)) * ((Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp (2 * ε * Real.log 2) * Real.exp (-ε * Real.pi * |s|))) * (27 * (1 + |beta ε|) * (1 + |s|) ^ 3) := by have hfactor' : ‖Complex.Gamma (z / 2) * Complex.exp ((ℓ : ℂ) * mellinShellPhase ε q)‖ ≤ Real.exp (ℓ * realHyperbolicShellPhase ε (saddleNegativeContourOrdinate ℓ N)) * ((Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp (2 * ε * Real.log 2) * Real.exp (-ε * Real.pi * |s|)) := by simpa [z, q] using! hfactor have hpoly' : ‖plusPolynomial ε q‖ ≤ 27 * (1 + |beta ε|) * (1 + |s|) ^ 3 := by simpa [z, q] using! hpoly have hpi' : ‖Complex.exp (((ℓ : ℂ) - z) * (Real.log Real.pi : ℂ) / 2)‖ = Real.exp ((ℓ - saddleTaylorContour N) * Real.log Real.pi / 2) := by simpa [z] using! hpi rw [hpi'] gcongr _ = saddleNegativeMellinMajorantCoefficient ε ℓ N * saddleNegativeFrequencyMajorant ε s := by unfold saddleNegativeMellinMajorantCoefficient saddleNegativeFrequencyMajorant ring def saddleNegativeFrequencyMass (ε : ℝ) : ℝ := ∫ s : ℝ, saddleNegativeFrequencyMajorant ε s theorem saddleNegativeFrequencyMass_nonneg (ε : ℝ) : 0 ≤ saddleNegativeFrequencyMass ε := by unfold saddleNegativeFrequencyMass apply integral_nonneg intro s unfold saddleNegativeFrequencyMajorant positivity theorem plusSaddleMellinData_negativeContour_integral_norm_le {ε ℓ : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (hℓ : 0 < ℓ) (N : ℕ) (hN : 2 * (((N + 1 : ℕ) : ℝ)) ≤ ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) : (∫ s : ℝ, ‖plusSaddleMellinData ε ℓ ((saddleTaylorContour N : ℂ) + (s : ℂ) * Complex.I)‖) ≤ saddleNegativeMellinMajorantCoefficient ε ℓ N * saddleNegativeFrequencyMass ε := by have hdata : Integrable (fun s : ℝ => plusSaddleMellinData ε ℓ ((saddleTaylorContour N : ℂ) + (s : ℂ) * Complex.I)) := by simpa using! plusSaddleMellinData_shiftedLine_moment_integrable hε hℓ horder (fun n : ℕ => saddleTaylorContour_ne_pole N n) 0 have hmajor : Integrable (fun s : ℝ => saddleNegativeMellinMajorantCoefficient ε ℓ N * saddleNegativeFrequencyMajorant ε s) := (saddleNegativeFrequencyMajorant_integrable hε).const_mul (saddleNegativeMellinMajorantCoefficient ε ℓ N) calc (∫ s : ℝ, ‖plusSaddleMellinData ε ℓ ((saddleTaylorContour N : ℂ) + (s : ℂ) * Complex.I)‖) ≤ ∫ s : ℝ, saddleNegativeMellinMajorantCoefficient ε ℓ N * saddleNegativeFrequencyMajorant ε s := by apply integral_mono hdata.norm hmajor intro s exact plusSaddleMellinData_negativeContour_norm_le hε hεsmall hℓ N hN horder hmargin s _ = saddleNegativeMellinMajorantCoefficient ε ℓ N * saddleNegativeFrequencyMass ε := by rw [integral_const_mul] rfl theorem plusSaddleTaylorRemainder_negativeContour_bound {ε ℓ : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (hℓ : 0 < ℓ) (N : ℕ) (hN : 2 * (((N + 1 : ℕ) : ℝ)) ≤ ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) {r : ℝ} (hr : 0 < r) : ‖plusSaddleTaylorRemainder ε ℓ N r‖ ≤ (1 / (2 * Real.pi)) * r ^ (2 * N + 1) * saddleNegativeMellinMajorantCoefficient ε ℓ N * saddleNegativeFrequencyMass ε := by let a : ℝ := saddleTaylorContour N let c : ℂ := ((1 / (2 * Real.pi) : ℝ) : ℂ) have hdata : Integrable (fun t : ℝ => plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)) := by simpa [a] using! plusSaddleMellinData_shiftedLine_moment_integrable hε hℓ horder (fun n : ℕ => saddleTaylorContour_ne_pole N n) 0 have hline := plusSaddleMellinData_negativeContour_integral_norm_le hε hεsmall hℓ N hN horder hmargin have hc : ‖c‖ = 1 / (2 * Real.pi) := by try dsimp [c] rw [Complex.norm_real, Real.norm_eq_abs, abs_of_pos (by positivity : 0 < 1 / (2 * Real.pi))] unfold plusSaddleTaylorRemainder change ‖c * (∫ t : ℝ, saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I))‖ ≤ _ rw [norm_mul, hc] calc (1 / (2 * Real.pi)) * ‖∫ t : ℝ, saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)‖ ≤ (1 / (2 * Real.pi)) * (∫ t : ℝ, ‖saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)‖) := by gcongr exact MeasureTheory.norm_integral_le_integral_norm _ _ = (1 / (2 * Real.pi)) * (r ^ (2 * N + 1) * (∫ t : ℝ, ‖plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)‖)) := by rw [saddleMellinInversePower_shiftedLine_integral_norm hr (plusSaddleMellinData ε ℓ) hdata] change (1 / (2 * Real.pi)) * (r ^ (-(saddleTaylorContour N)) * _) = _ rw [saddleTaylorContour_rpow] _ ≤ (1 / (2 * Real.pi)) * (r ^ (2 * N + 1) * (saddleNegativeMellinMajorantCoefficient ε ℓ N * saddleNegativeFrequencyMass ε)) := by gcongr _ = (1 / (2 * Real.pi)) * r ^ (2 * N + 1) * saddleNegativeMellinMajorantCoefficient ε ℓ N * saddleNegativeFrequencyMass ε := by ring theorem saddleSmallRadiusVariable_sqrt_eq_source (ε : ℝ) {r : ℝ} (hr : 0 ≤ r) : Real.sqrt (saddleSmallRadiusVariable ε r) = r * Real.exp (Real.log Real.pi / 2 + saddleShellDerivativeOne ε) := by let q : ℝ := r * Real.exp (Real.log Real.pi / 2 + saddleShellDerivativeOne ε) have hq : 0 ≤ q := by try dsimp [q] positivity have he : Real.exp (Real.log Real.pi / 2 + saddleShellDerivativeOne ε) ^ 2 = Real.pi * Real.exp (2 * saddleShellDerivativeOne ε) := by rw [pow_two, ← Real.exp_add] rw [show (Real.log Real.pi / 2 + saddleShellDerivativeOne ε) + (Real.log Real.pi / 2 + saddleShellDerivativeOne ε) = Real.log Real.pi + 2 * saddleShellDerivativeOne ε by ring, Real.exp_add, Real.exp_log Real.pi_pos] have hsq : q ^ 2 = saddleSmallRadiusVariable ε r := by try dsimp [q] rw [mul_pow, he] unfold saddleSmallRadiusVariable ring have hsqrt := Real.sq_sqrt (saddleSmallRadiusVariable_nonneg ε r) have hsqrtpos := Real.sqrt_nonneg (saddleSmallRadiusVariable ε r) change Real.sqrt (saddleSmallRadiusVariable ε r) = q nlinarith theorem saddleSmallRadiusVariable_halfIntegerFactor (ε : ℝ) {r : ℝ} (hr : 0 ≤ r) (N : ℕ) : r ^ (2 * N + 1) * Real.exp (((2 * N + 1 : ℕ) : ℝ) * (Real.log Real.pi / 2 + saddleShellDerivativeOne ε)) = Real.sqrt (saddleSmallRadiusVariable ε r) * saddleSmallRadiusVariable ε r ^ N := by let q : ℝ := r * Real.exp (Real.log Real.pi / 2 + saddleShellDerivativeOne ε) have hsqrt := saddleSmallRadiusVariable_sqrt_eq_source ε hr have hq : q ^ 2 = saddleSmallRadiusVariable ε r := by have he : Real.exp (Real.log Real.pi / 2 + saddleShellDerivativeOne ε) ^ 2 = Real.pi * Real.exp (2 * saddleShellDerivativeOne ε) := by rw [pow_two, ← Real.exp_add] rw [show (Real.log Real.pi / 2 + saddleShellDerivativeOne ε) + (Real.log Real.pi / 2 + saddleShellDerivativeOne ε) = Real.log Real.pi + 2 * saddleShellDerivativeOne ε by ring, Real.exp_add, Real.exp_log Real.pi_pos] try dsimp [q] rw [mul_pow, he] unfold saddleSmallRadiusVariable ring rw [Real.exp_nat_mul] rw [← mul_pow] change q ^ (2 * N + 1) = Real.sqrt (saddleSmallRadiusVariable ε r) * saddleSmallRadiusVariable ε r ^ N rw [hsqrt, ← hq] change q ^ (2 * N + 1) = q * (q ^ 2) ^ N rw [← pow_mul, pow_succ] ring def saddleNegativeContourPhaseError (ε ℓ : ℝ) (N : ℕ) : ℝ := ℓ * (realHyperbolicShellPhase ε (saddleNegativeContourOrdinate ℓ N) - realHyperbolicShellPhase ε 1) - (((2 * N + 1 : ℕ) : ℝ) * saddleShellDerivativeOne ε) theorem saddleNegativeContour_sourceNormalizationFactor (ε ℓ : ℝ) (N : ℕ) {r : ℝ} (hr : 0 ≤ r) : r ^ (2 * N + 1) * Real.exp ((ℓ - saddleTaylorContour N) * Real.log Real.pi / 2) * Real.exp (ℓ * realHyperbolicShellPhase ε (saddleNegativeContourOrdinate ℓ N)) / (Real.exp ((ℓ / 2) * Real.log Real.pi) * Real.exp (ℓ * realHyperbolicShellPhase ε 1)) = Real.sqrt (saddleSmallRadiusVariable ε r) * saddleSmallRadiusVariable ε r ^ N * Real.exp (saddleNegativeContourPhaseError ε ℓ N) := by have hrad := saddleSmallRadiusVariable_halfIntegerFactor ε hr N have hden : Real.exp ((ℓ / 2) * Real.log Real.pi) * Real.exp (ℓ * realHyperbolicShellPhase ε 1) ≠ 0 := by positivity field_simp [hden] rw [show ℓ * Real.log Real.pi / 2 = (ℓ / 2) * Real.log Real.pi by ring] rw [show Real.exp ((ℓ / 2) * Real.log Real.pi) * Real.exp (ℓ * realHyperbolicShellPhase ε 1) * Real.sqrt (saddleSmallRadiusVariable ε r) * saddleSmallRadiusVariable ε r ^ N * Real.exp (saddleNegativeContourPhaseError ε ℓ N) = (Real.sqrt (saddleSmallRadiusVariable ε r) * saddleSmallRadiusVariable ε r ^ N) * (Real.exp ((ℓ / 2) * Real.log Real.pi) * Real.exp (ℓ * realHyperbolicShellPhase ε 1) * Real.exp (saddleNegativeContourPhaseError ε ℓ N)) by ring] rw [← hrad] unfold saddleNegativeContourPhaseError saddleTaylorContour push_cast have hexponents : Real.exp ((ℓ - -(2 * (N : ℝ) + 1)) * Real.log Real.pi / 2) * Real.exp (ℓ * realHyperbolicShellPhase ε (saddleNegativeContourOrdinate ℓ N)) = Real.exp ((2 * (N : ℝ) + 1) * (Real.log Real.pi / 2 + saddleShellDerivativeOne ε)) * (Real.exp ((ℓ / 2) * Real.log Real.pi) * Real.exp (ℓ * realHyperbolicShellPhase ε 1) * Real.exp (ℓ * (realHyperbolicShellPhase ε (saddleNegativeContourOrdinate ℓ N) - realHyperbolicShellPhase ε 1) - (2 * (N : ℝ) + 1) * saddleShellDerivativeOne ε)) := by rw [← Real.exp_add, ← Real.exp_add, ← Real.exp_add, ← Real.exp_add] congr 1 ring calc r ^ (2 * N + 1) * Real.exp ((ℓ - -(2 * (N : ℝ) + 1)) * Real.log Real.pi / 2) * Real.exp (ℓ * realHyperbolicShellPhase ε (saddleNegativeContourOrdinate ℓ N)) = r ^ (2 * N + 1) * (Real.exp ((ℓ - -(2 * (N : ℝ) + 1)) * Real.log Real.pi / 2) * Real.exp (ℓ * realHyperbolicShellPhase ε (saddleNegativeContourOrdinate ℓ N))) := by ring _ = r ^ (2 * N + 1) * (Real.exp ((2 * (N : ℝ) + 1) * (Real.log Real.pi / 2 + saddleShellDerivativeOne ε)) * (Real.exp ((ℓ / 2) * Real.log Real.pi) * Real.exp (ℓ * realHyperbolicShellPhase ε 1) * Real.exp (ℓ * (realHyperbolicShellPhase ε (saddleNegativeContourOrdinate ℓ N) - realHyperbolicShellPhase ε 1) - (2 * (N : ℝ) + 1) * saddleShellDerivativeOne ε))) := by rw [hexponents] _ = _ := by ring def saddleNegativeRelativeCoefficient (ε : ℝ) : ℝ := 27 * (1 + |beta ε|) * Real.exp (2 * ε * Real.log 2) * saddleNegativeFrequencyMass ε / (4 * beta ε) theorem saddleNegativeRelativeCoefficient_nonneg {ε : ℝ} (hε : 0 < ε) : 0 ≤ saddleNegativeRelativeCoefficient ε := by unfold saddleNegativeRelativeCoefficient exact div_nonneg (mul_nonneg (mul_nonneg (mul_nonneg (by positivity) (by positivity)) (Real.exp_pos _).le) (saddleNegativeFrequencyMass_nonneg ε)) (mul_pos (by norm_num) (beta_pos hε)).le theorem saddleNegativeContour_normalizedMajorant_eq {ε : ℝ} (hε : 0 < ε) (ℓ : ℝ) (N : ℕ) {r : ℝ} (hr : 0 ≤ r) : ((1 / (2 * Real.pi)) * r ^ (2 * N + 1) * saddleNegativeMellinMajorantCoefficient ε ℓ N * saddleNegativeFrequencyMass ε) / saddleOriginValue ε ℓ = saddleNegativeRelativeCoefficient ε * Real.sqrt (saddleSmallRadiusVariable ε r) * saddleSmallRadiusVariable ε r ^ N / Real.Gamma ((N : ℝ) + 3 / 2) * Real.exp (saddleNegativeContourPhaseError ε ℓ N) := by have hb : beta ε ≠ 0 := (beta_pos hε).ne' have hΓ : Real.Gamma ((N : ℝ) + 3 / 2) ≠ 0 := by apply (Real.Gamma_pos_of_pos (by positivity)).ne' have horigin : saddleOriginValue ε ℓ = 2 * (Real.exp ((ℓ / 2) * Real.log Real.pi) * Real.exp (ℓ * realHyperbolicShellPhase ε 1)) * beta ε := by unfold saddleOriginValue rw [Real.rpow_def_of_pos Real.pi_pos] rw [show Real.log Real.pi * (ℓ / 2) = (ℓ / 2) * Real.log Real.pi by ring] ring have hphase := saddleNegativeContour_sourceNormalizationFactor ε ℓ N hr calc ((1 / (2 * Real.pi)) * r ^ (2 * N + 1) * saddleNegativeMellinMajorantCoefficient ε ℓ N * saddleNegativeFrequencyMass ε) / saddleOriginValue ε ℓ = saddleNegativeRelativeCoefficient ε * (r ^ (2 * N + 1) * Real.exp ((ℓ - saddleTaylorContour N) * Real.log Real.pi / 2) * Real.exp (ℓ * realHyperbolicShellPhase ε (saddleNegativeContourOrdinate ℓ N)) / (Real.exp ((ℓ / 2) * Real.log Real.pi) * Real.exp (ℓ * realHyperbolicShellPhase ε 1))) / Real.Gamma ((N : ℝ) + 3 / 2) := by rw [horigin] unfold saddleNegativeMellinMajorantCoefficient saddleNegativeRelativeCoefficient field_simp [Real.pi_pos.ne', hb, hΓ, (Real.exp_pos ((ℓ / 2) * Real.log Real.pi)).ne', (Real.exp_pos (ℓ * realHyperbolicShellPhase ε 1)).ne']; ring _ = saddleNegativeRelativeCoefficient ε * (Real.sqrt (saddleSmallRadiusVariable ε r) * saddleSmallRadiusVariable ε r ^ N * Real.exp (saddleNegativeContourPhaseError ε ℓ N)) / Real.Gamma ((N : ℝ) + 3 / 2) := by rw [hphase] _ = saddleNegativeRelativeCoefficient ε * Real.sqrt (saddleSmallRadiusVariable ε r) * saddleSmallRadiusVariable ε r ^ N / Real.Gamma ((N : ℝ) + 3 / 2) * Real.exp (saddleNegativeContourPhaseError ε ℓ N) := by ring theorem plusSaddleTaylorRemainder_negativeContour_relative_bound {ε ℓ : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (hℓ : 0 < ℓ) (N : ℕ) (hN : 2 * (((N + 1 : ℕ) : ℝ)) ≤ ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) {r : ℝ} (hr : 0 < r) : ‖plusSaddleTaylorRemainder ε ℓ N r / (saddleOriginValue ε ℓ : ℂ)‖ ≤ saddleNegativeRelativeCoefficient ε * Real.sqrt (saddleSmallRadiusVariable ε r) * saddleSmallRadiusVariable ε r ^ N / Real.Gamma ((N : ℝ) + 3 / 2) * Real.exp (saddleNegativeContourPhaseError ε ℓ N) := by have hO := saddleOriginValue_pos hε ℓ have hraw := plusSaddleTaylorRemainder_negativeContour_bound hε hεsmall hℓ N hN horder hmargin hr rw [norm_div, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hO] calc ‖plusSaddleTaylorRemainder ε ℓ N r‖ / saddleOriginValue ε ℓ ≤ ((1 / (2 * Real.pi)) * r ^ (2 * N + 1) * saddleNegativeMellinMajorantCoefficient ε ℓ N * saddleNegativeFrequencyMass ε) / saddleOriginValue ε ℓ := by exact (div_le_div_iff_of_pos_right hO).mpr hraw _ = saddleNegativeRelativeCoefficient ε * Real.sqrt (saddleSmallRadiusVariable ε r) * saddleSmallRadiusVariable ε r ^ N / Real.Gamma ((N : ℝ) + 3 / 2) * Real.exp (saddleNegativeContourPhaseError ε ℓ N) := saddleNegativeContour_normalizedMajorant_eq hε ℓ N hr.le theorem exists_saddleNegativeContourPhaseError_bound {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : ∃ K : ℝ, 0 ≤ K ∧ ∀ (ℓ : ℝ), 0 < ℓ → ∀ N : ℕ, 2 * (((N + 1 : ℕ) : ℝ)) ≤ ℓ → |saddleNegativeContourPhaseError ε ℓ N| ≤ K * (2 * (N : ℝ) + 1) ^ 2 / ℓ := by obtain ⟨K, hK, hTaylor⟩ := exists_realHyperbolicShellPhase_quadratic_remainder hε horder refine ⟨K, hK, ?_⟩ intro ℓ hℓ N hN let κ : ℝ := saddleNegativeContourOrdinate ℓ N have hκlow : 1 ≤ κ := one_le_saddleNegativeContourOrdinate hℓ N have hκhigh : κ ≤ 2 := saddleNegativeContourOrdinate_le_two hℓ N hN have hκmem : κ ∈ Icc (1 : ℝ) 2 := ⟨hκlow, hκhigh⟩ have ht := hTaylor κ hκmem have hscale : ℓ * (κ - 1) = 2 * (N : ℝ) + 1 := by try dsimp [κ, saddleNegativeContourOrdinate] field_simp [hℓ.ne']; ring have hidentity : saddleNegativeContourPhaseError ε ℓ N = ℓ * (realHyperbolicShellPhase ε κ - realHyperbolicShellPhase ε 1 - (κ - 1) * saddleShellDerivativeOne ε) := by unfold saddleNegativeContourPhaseError push_cast change ℓ * (realHyperbolicShellPhase ε κ - realHyperbolicShellPhase ε 1) - (2 * (N : ℝ) + 1) * saddleShellDerivativeOne ε = _ rw [← hscale] ring rw [hidentity, abs_mul, abs_of_pos hℓ] calc ℓ * |realHyperbolicShellPhase ε κ - realHyperbolicShellPhase ε 1 - (κ - 1) * saddleShellDerivativeOne ε| ≤ ℓ * (K * (κ - 1) ^ 2) := mul_le_mul_of_nonneg_left ht hℓ.le _ = K * (2 * (N : ℝ) + 1) ^ 2 / ℓ := by rw [← hscale] field_simp [hℓ.ne'] theorem eventually_plusSaddleTaylorRemainder_relative_lt_half_on_star {ε : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) : ∀ᶠ d : ℕ in atTop, ∀ r : ℝ, 0 < r → r ≤ saddleSmallRadiusStar ε d → let ℓ : ℝ := (d : ℝ) / 2 let N : ℕ := saddleSmallResidueTruncation ℓ let y : ℝ := saddleSmallRadiusVariable ε r Real.exp y * ‖plusSaddleTaylorRemainder ε ℓ N r / (saddleOriginValue ε ℓ : ℂ)‖ < 1 / 2 := by obtain ⟨C, hC, hstar⟩ := exists_eventually_y_star_le_log_eighth_add hε horder obtain ⟨K, hK, hphase⟩ := exists_saddleNegativeContourPhaseError_bound hε horder let Kε : ℝ := saddleNegativeRelativeCoefficient ε have hKε : 0 ≤ Kε := saddleNegativeRelativeCoefficient_nonneg hε have htail := eventually_saddleNegative_relativeGammaTail_lt_half hε C K Kε hC hK hKε have htaildim := tendsto_saddleResidue_dimension_half.eventually htail have hdepth := tendsto_saddleResidue_dimension_half.eventually eventually_saddleSmallResidueTruncation_succ_double_le filter_upwards [hstar, htaildim, hdepth, eventually_gt_atTop (0 : ℕ)] with d hcut htaild hNd hd intro r hr hrstar try dsimp let ℓ : ℝ := (d : ℝ) / 2 let N : ℕ := saddleSmallResidueTruncation ℓ let y : ℝ := saddleSmallRadiusVariable ε r have hℓ : 0 < ℓ := by try dsimp [ℓ] positivity have hy : 0 ≤ y := saddleSmallRadiusVariable_nonneg ε r have hyupper : y ≤ Real.log ℓ / 8 + C := by exact hcut r hr.le hrstar have hN : 2 * (((N + 1 : ℕ) : ℝ)) ≤ ℓ := hNd have hrelative := plusSaddleTaylorRemainder_negativeContour_relative_bound hε hεsmall hℓ N hN horder hmargin hr have herr := hphase ℓ hℓ N hN have herror : saddleNegativeContourPhaseError ε ℓ N ≤ K * (2 * (N : ℝ) + 1) ^ 2 / ℓ := by exact (le_abs_self _).trans herr have htarget := htaild y hy hyupper change Real.exp y * ‖plusSaddleTaylorRemainder ε ℓ N r / (saddleOriginValue ε ℓ : ℂ)‖ < 1 / 2 calc Real.exp y * ‖plusSaddleTaylorRemainder ε ℓ N r / (saddleOriginValue ε ℓ : ℂ)‖ ≤ Real.exp y * (Kε * Real.sqrt y * y ^ N / Real.Gamma ((N : ℝ) + 3 / 2) * Real.exp (saddleNegativeContourPhaseError ε ℓ N)) := by gcongr _ ≤ Real.exp y * (Kε * Real.sqrt y * y ^ N / Real.Gamma ((N : ℝ) + 3 / 2) * Real.exp (K * (2 * (N : ℝ) + 1) ^ 2 / ℓ)) := by gcongr _ < 1 / 2 := htarget theorem eventually_plusSaddleProfile_re_pos_on_star_fixed {ε : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) : ∀ᶠ d : ℕ in atTop, ∀ r : ℝ, 0 ≤ r → r ≤ saddleSmallRadiusStar ε d → 0 < (plusSaddleProfile ε ((d : ℝ) / 2) r).re := by have hfinite := eventually_plusSaddleSmallRadius_relativeFiniteResidue_lt_half_on_star hε horder have hremainder := eventually_plusSaddleTaylorRemainder_relative_lt_half_on_star hε hεsmall horder hmargin filter_upwards [hfinite, hremainder, eventually_gt_atTop (0 : ℕ)] with d hfinite_d hrem_d hd intro r hr hrstar by_cases hzero : r = 0 · subst r simpa [plusSaddleProfile] using! (saddleOriginValue_pos hε ((d : ℝ) / 2)) · have hrpos : 0 < r := lt_of_le_of_ne hr (Ne.symm hzero) have hℓ : 0 < (d : ℝ) / 2 := by positivity exact plusSaddleProfile_re_pos_of_relative_residue_bounds hε hℓ horder hrpos (saddleSmallResidueTruncation ((d : ℝ) / 2)) (by simpa using! hfinite_d r hr hrstar) (by simpa using! hrem_d r hrpos hrstar) theorem eventually_plusSaddleProfile_re_pos_on_star : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ᶠ d : ℕ in atTop, ∀ r : ℝ, 0 ≤ r → r ≤ saddleSmallRadiusStar ε d → 0 < (plusSaddleProfile ε ((d : ℝ) / 2) r).re := by have hsmall := (tendsto_id.mono_left (nhdsWithin_le_nhds : 𝓝[>] (0 : ℝ) ≤ 𝓝 (0 : ℝ))).eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1 / 4)) filter_upwards [self_mem_nhdsWithin, hsmall, eventually_upper_shortCutoff_le_shortEndpoint, eventually_upper_shortMargin_positive] with ε hε hεsmall horder hmargin change 0 < ε at hε apply eventually_plusSaddleProfile_re_pos_on_star_fixed hε (le_of_lt hεsmall) horder intro a ha have h := hmargin a ha linarith end noncomputable section open Filter Set MeasureTheory intervalIntegral open scoped ContDiff FourierTransform Interval RealInnerProductSpace Topology theorem saddleRealCpow_hasDerivAt_zero {z : ℂ} (hz : 1 < z.re) : HasDerivAt (fun x : ℝ => (x : ℂ) ^ z) (0 : ℂ) (0 : ℝ) := by have hz0 : z ≠ 0 := by intro heq subst z norm_num at hz have hsub : 0 < (z - 1).re := by simpa using! sub_pos.mpr hz have hsub0 : z - 1 ≠ 0 := by intro heq have := congrArg Complex.re heq simpa using! (ne_of_gt hsub) this rw [hasDerivAt_iff_tendsto_slope_zero] have htend : Tendsto (fun t : ℝ => (t : ℂ) ^ (z - 1)) (𝓝[≠] (0 : ℝ)) (𝓝 (0 : ℂ)) := by have hcontinuous := Complex.continuousAt_ofReal_cpow_const (0 : ℝ) (z - 1) (Or.inl hsub) simpa [Complex.zero_cpow hsub0] using! hcontinuous.tendsto.mono_left nhdsWithin_le_nhds apply htend.congr' filter_upwards [self_mem_nhdsWithin] with t ht have ht0 : t ≠ 0 := by simpa using! ht have htc : (t : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr ht0 simp [hz0, Complex.real_smul, Complex.cpow_sub z 1 htc, div_eq_mul_inv, mul_comm] theorem saddleRealCpow_hasDerivAt {z : ℂ} (hz : 1 < z.re) (x : ℝ) : HasDerivAt (fun y : ℝ => (y : ℂ) ^ z) (z * (x : ℂ) ^ (z - 1)) x := by have hz0 : z ≠ 0 := by intro heq subst z norm_num at hz by_cases hx : x = 0 · subst x have hsub : z - 1 ≠ 0 := by intro heq have hre := congrArg Complex.re heq norm_num at hre linarith simpa [Complex.zero_cpow hsub] using! saddleRealCpow_hasDerivAt_zero hz · exact hasDerivAt_ofReal_cpow_const hx hz0 def saddlePositiveCpow (z : ℂ) (x : ℝ) : ℂ := ((max x 0 : ℝ) : ℂ) ^ z theorem saddlePositiveCpow_continuous {z : ℂ} (hz : 0 < z.re) : Continuous (saddlePositiveCpow z) := by unfold saddlePositiveCpow exact (Complex.continuous_ofReal_cpow_const hz).comp (continuous_id.max continuous_const) theorem saddlePositiveCpow_hasDerivAt_zero {z : ℂ} (hz : 1 < z.re) : HasDerivAt (saddlePositiveCpow z) (0 : ℂ) (0 : ℝ) := by have hz0 : z ≠ 0 := by intro heq subst z norm_num at hz have hsub : 0 < (z - 1).re := by change 0 < z.re - 1 linarith have hsub0 : z - 1 ≠ 0 := by intro heq have hre := congrArg Complex.re heq norm_num at hre linarith rw [hasDerivAt_iff_tendsto_slope_zero] have htend : Tendsto (saddlePositiveCpow (z - 1)) (𝓝[≠] (0 : ℝ)) (𝓝 (0 : ℂ)) := by have hcontinuous := (saddlePositiveCpow_continuous hsub).continuousAt (x := (0 : ℝ)) simpa [saddlePositiveCpow, Complex.zero_cpow hsub0] using! hcontinuous.tendsto.mono_left nhdsWithin_le_nhds apply htend.congr' filter_upwards [self_mem_nhdsWithin] with t ht have ht0 : t ≠ 0 := by simpa using! ht rcases lt_or_gt_of_ne ht0 with hneg | hpos · have hmax : max t 0 = 0 := max_eq_right hneg.le simp [saddlePositiveCpow, hmax, Complex.zero_cpow hz0, Complex.zero_cpow hsub0] · have hmax : max t 0 = t := max_eq_left hpos.le have htc : (t : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr ht0 simp [saddlePositiveCpow, hmax, hz0, Complex.real_smul, Complex.cpow_sub z 1 htc, div_eq_mul_inv, mul_comm] theorem saddlePositiveCpow_hasDerivAt {z : ℂ} (hz : 1 < z.re) (x : ℝ) : HasDerivAt (saddlePositiveCpow z) (z * saddlePositiveCpow (z - 1) x) x := by have hz0 : z ≠ 0 := by intro heq subst z norm_num at hz have hsub0 : z - 1 ≠ 0 := by intro heq have hre := congrArg Complex.re heq norm_num at hre linarith rcases lt_trichotomy x 0 with hneg | hzero | hpos · have hevent : saddlePositiveCpow z =ᶠ[𝓝 x] (fun _ : ℝ => (0 : ℂ)) := by filter_upwards [Iio_mem_nhds hneg] with y hy change y < 0 at hy simp [saddlePositiveCpow, max_eq_right hy.le, Complex.zero_cpow hz0] have hvalue : saddlePositiveCpow (z - 1) x = 0 := by simp [saddlePositiveCpow, max_eq_right hneg.le, Complex.zero_cpow hsub0] simpa [hvalue] using! (hasDerivAt_const x (0 : ℂ)).congr_of_eventuallyEq hevent · subst x simp [saddlePositiveCpow, Complex.zero_cpow hsub0, saddlePositiveCpow_hasDerivAt_zero hz] · have hevent : saddlePositiveCpow z =ᶠ[𝓝 x] (fun y : ℝ => (y : ℂ) ^ z) := by filter_upwards [Ioi_mem_nhds hpos] with y hy change 0 < y at hy simp [saddlePositiveCpow, max_eq_left hy.le] have hvalue : saddlePositiveCpow (z - 1) x = (x : ℂ) ^ (z - 1) := by simp [saddlePositiveCpow, max_eq_left hpos.le] rw [hvalue] exact (saddleRealCpow_hasDerivAt hz x).congr_of_eventuallyEq hevent def saddleContourExponent (a t : ℝ) : ℂ := -(((a : ℂ) + (t : ℂ) * Complex.I) / 2) @[simp] theorem saddleContourExponent_re (a t : ℝ) : (saddleContourExponent a t).re = -a / 2 := by simp [saddleContourExponent, Complex.mul_re] ring def saddleContourExponentPolynomial (a : ℝ) : Polynomial ℂ := Polynomial.C (-(a : ℂ) / 2) - Polynomial.C (Complex.I / 2) * Polynomial.X theorem saddleContourExponentPolynomial_eval (a t : ℝ) : (saddleContourExponentPolynomial a).eval (t : ℂ) = saddleContourExponent a t := by simp [saddleContourExponentPolynomial, saddleContourExponent] ring def saddleContourFallingPolynomial (a : ℝ) (j : ℕ) : Polynomial ℂ := ∏ i ∈ Finset.range j, (saddleContourExponentPolynomial a - Polynomial.C (i : ℂ)) theorem saddleContourFallingPolynomial_eval_succ (a t : ℝ) (j : ℕ) : (saddleContourFallingPolynomial a (j + 1)).eval (t : ℂ) = (saddleContourFallingPolynomial a j).eval (t : ℂ) * (saddleContourExponent a t - (j : ℂ)) := by simp [saddleContourFallingPolynomial, Finset.prod_range_succ, saddleContourExponentPolynomial_eval] theorem saddlePolynomialWeightedData_integrable {D : ℝ → ℂ} (hD : ∀ j : ℕ, Integrable (fun t : ℝ => (t : ℂ) ^ j * D t)) (P : Polynomial ℂ) : Integrable (fun t : ℝ => P.eval (t : ℂ) * D t) := by have hsum : Integrable (fun t : ℝ => ∑ j ∈ Finset.range (P.natDegree + 1), P.coeff j * ((t : ℂ) ^ j * D t)) := by apply integrable_finsetSum intro j _ exact (hD j).const_mul (P.coeff j) exact hsum.congr (Filter.Eventually.of_forall (fun t : ℝ => by change (∑ j ∈ Finset.range (P.natDegree + 1), P.coeff j * ((t : ℂ) ^ j * D t)) = P.eval (t : ℂ) * D t rw [Polynomial.eval_eq_sum_range] simp_rw [Finset.sum_mul] apply Finset.sum_congr rfl intro j _ ring)) def saddlePositiveContourMoment (a : ℝ) (j : ℕ) (D : ℝ → ℂ) (u : ℝ) : ℂ := ∫ t : ℝ, saddlePositiveCpow (saddleContourExponent a t - (j : ℂ)) u * ((saddleContourFallingPolynomial a j).eval (t : ℂ) * D t) @[simp] theorem saddleContourExponent_sub_nat_re (a t : ℝ) (j : ℕ) : (saddleContourExponent a t - (j : ℂ)).re = -a / 2 - (j : ℝ) := by simp [saddleContourExponent_re] theorem saddlePositiveCpow_norm_le_one {z : ℂ} (hz : 0 < z.re) {u : ℝ} (hu : u ∈ Set.Ioo (-1 : ℝ) 1) : ‖saddlePositiveCpow z u‖ ≤ 1 := by have hbase : 0 ≤ max u 0 := le_max_right _ _ have hbaseone : max u 0 ≤ 1 := max_le hu.2.le (by norm_num) unfold saddlePositiveCpow rw [Complex.norm_cpow_eq_rpow_re_of_nonneg hbase (ne_of_gt hz)] exact Real.rpow_le_one hbase hbaseone hz.le theorem saddlePositiveContourPower_frequency_continuous {a : ℝ} (j : ℕ) (ha : (j : ℝ) < -a / 2) (u : ℝ) : Continuous (fun t : ℝ => saddlePositiveCpow (saddleContourExponent a t - (j : ℂ)) u) := by have hfrequency : Continuous (fun t : ℝ => saddleContourExponent a t - (j : ℂ)) := by unfold saddleContourExponent fun_prop unfold saddlePositiveCpow apply hfrequency.const_cpow right intro t apply ne_of_apply_ne Complex.re have hpositive : 0 < (saddleContourExponent a t - (j : ℂ)).re := by rw [saddleContourExponent_sub_nat_re] linarith simpa using! hpositive.ne' theorem saddlePositiveContourMoment_hasDerivAt {D : ℝ → ℂ} (hD : ∀ k : ℕ, Integrable (fun t : ℝ => (t : ℂ) ^ k * D t)) {a : ℝ} (j : ℕ) (ha : (j : ℝ) + 1 < -a / 2) {u : ℝ} (hu : u ∈ Set.Ioo (-1 : ℝ) 1) : HasDerivAt (saddlePositiveContourMoment a j D) (saddlePositiveContourMoment a (j + 1) D u) u := by let W : ℕ → ℝ → ℂ := fun k t => (saddleContourFallingPolynomial a k).eval (t : ℂ) * D t have hW (k : ℕ) : Integrable (W k) := by try dsimp [W] exact saddlePolynomialWeightedData_integrable hD (saddleContourFallingPolynomial a k) have hjpos : (j : ℝ) < -a / 2 := by linarith have hsuccpos : ((j + 1 : ℕ) : ℝ) < -a / 2 := by push_cast linarith have hkernel (k : ℕ) (hk : (k : ℝ) < -a / 2) (v : ℝ) : AEStronglyMeasurable (fun t : ℝ => saddlePositiveCpow (saddleContourExponent a t - (k : ℂ)) v * W k t) := (saddlePositiveContourPower_frequency_continuous k hk v).aestronglyMeasurable.mul (hW k).aestronglyMeasurable have hpoint (v : ℝ) (hv : v ∈ Set.Ioo (-1 : ℝ) 1) : Integrable (fun t : ℝ => saddlePositiveCpow (saddleContourExponent a t - (j : ℂ)) v * W j t) := by apply (hW j).norm.mono' (hkernel j hjpos v) filter_upwards [] with t rw [norm_mul] calc ‖saddlePositiveCpow (saddleContourExponent a t - (j : ℂ)) v‖ * ‖W j t‖ ≤ 1 * ‖W j t‖ := by gcongr apply saddlePositiveCpow_norm_le_one · rw [saddleContourExponent_sub_nat_re] linarith · exact hv _ = ‖W j t‖ := one_mul _ have hdiff (t v : ℝ) (hv : v ∈ Set.Ioo (-1 : ℝ) 1) : HasDerivAt (fun x : ℝ => saddlePositiveCpow (saddleContourExponent a t - (j : ℂ)) x * W j t) (saddlePositiveCpow (saddleContourExponent a t - ((j + 1 : ℕ) : ℂ)) v * W (j + 1) t) v := by have hreal : 1 < (saddleContourExponent a t - (j : ℂ)).re := by rw [saddleContourExponent_sub_nat_re] linarith have hderiv := (saddlePositiveCpow_hasDerivAt hreal v).mul_const (W j t) have harg : saddleContourExponent a t - ((j + 1 : ℕ) : ℂ) = saddleContourExponent a t - (j : ℂ) - 1 := by push_cast ring have hfall : W (j + 1) t = W j t * (saddleContourExponent a t - (j : ℂ)) := by try dsimp [W] rw [saddleContourFallingPolynomial_eval_succ] ring rw [harg, hfall] convert! hderiv using 1 all_goals ring have hresult := _root_.hasDerivAt_integral_of_dominated_loc_of_deriv_le (μ := MeasureTheory.volume) (F := fun (v : ℝ) (t : ℝ) => saddlePositiveCpow (saddleContourExponent a t - (j : ℂ)) v * W j t) (F' := fun (v : ℝ) (t : ℝ) => saddlePositiveCpow (saddleContourExponent a t - ((j + 1 : ℕ) : ℂ)) v * W (j + 1) t) (bound := fun t : ℝ => ‖W (j + 1) t‖) (isOpen_Ioo.mem_nhds hu) (Filter.Eventually.of_forall (fun v => hkernel j hjpos v)) (hpoint u hu) (hkernel (j + 1) hsuccpos u) (Filter.Eventually.of_forall (fun t => by intro v hv rw [norm_mul] calc ‖saddlePositiveCpow (saddleContourExponent a t - ((j + 1 : ℕ) : ℂ)) v‖ * ‖W (j + 1) t‖ ≤ 1 * ‖W (j + 1) t‖ := by gcongr apply saddlePositiveCpow_norm_le_one · rw [saddleContourExponent_sub_nat_re] exact sub_pos.mpr hsuccpos · exact hv _ = ‖W (j + 1) t‖ := one_mul _)) ((hW (j + 1)).norm) (Filter.Eventually.of_forall (fun t => by intro v hv exact hdiff t v hv)) change HasDerivAt (fun v : ℝ => ∫ t : ℝ, saddlePositiveCpow (saddleContourExponent a t - (j : ℂ)) v * W j t) (∫ t : ℝ, saddlePositiveCpow (saddleContourExponent a t - ((j + 1 : ℕ) : ℂ)) u * W (j + 1) t) u exact hresult.2 theorem saddlePositiveContourMoment_contDiffOn {D : ℝ → ℂ} (hD : ∀ k : ℕ, Integrable (fun t : ℝ => (t : ℂ) ^ k * D t)) {a : ℝ} (n j : ℕ) (ha : (n : ℝ) + (j : ℝ) + 1 < -a / 2) : ContDiffOn ℝ n (saddlePositiveContourMoment a j D) (Set.Ioo (-1 : ℝ) 1) := by induction n generalizing j with | zero => change ContDiffOn ℝ 0 (saddlePositiveContourMoment a j D) (Set.Ioo (-1 : ℝ) 1) rw [contDiffOn_zero] intro u hu have hj : (j : ℝ) + 1 < -a / 2 := by simpa using! ha exact (saddlePositiveContourMoment_hasDerivAt hD j hj hu).continuousAt.continuousWithinAt | succ n ih => have hj : (j : ℝ) + 1 < -a / 2 := by push_cast at ha have hn : (0 : ℝ) ≤ (n : ℝ) := Nat.cast_nonneg n linarith have hnext : (n : ℝ) + ((j + 1 : ℕ) : ℝ) + 1 < -a / 2 := by push_cast at ha ⊢ linarith rw [show (↑(n + 1) : WithTop ℕ∞) = (↑n : WithTop ℕ∞) + 1 by simp, contDiffOn_succ_iff_deriv_of_isOpen isOpen_Ioo] refine ⟨?_, ?_, ?_⟩ · intro u hu exact (saddlePositiveContourMoment_hasDerivAt hD j hj hu).differentiableAt.differentiableWithinAt · simp · exact (ih (j + 1) hnext).congr (fun u hu => (saddlePositiveContourMoment_hasDerivAt hD j hj hu).deriv) theorem saddleMellinInversePower_eq_squaredPositiveCpow {r : ℝ} (hr : 0 < r) (z : ℂ) : saddleMellinInversePower r z = saddlePositiveCpow (-z / 2) (r ^ 2) := by unfold saddleMellinInversePower calc (r : ℂ) ^ (-z) = (r : ℂ) ^ (((2 : ℝ) : ℂ) * (-z / 2)) := by congr 1 push_cast ring _ = (((r ^ (2 : ℝ) : ℝ) : ℂ)) ^ (-z / 2) := Complex.cpow_mul_ofReal_nonneg hr.le 2 (-z / 2) _ = saddlePositiveCpow (-z / 2) (r ^ 2) := by simp [saddlePositiveCpow, max_eq_left (sq_nonneg r)] @[simp] theorem saddlePositiveContourMoment_zero {a : ℝ} (j : ℕ) (ha : (j : ℝ) < -a / 2) (D : ℝ → ℂ) : saddlePositiveContourMoment a j D 0 = 0 := by unfold saddlePositiveContourMoment have hzero : (fun t : ℝ => saddlePositiveCpow (saddleContourExponent a t - (j : ℂ)) 0 * ((saddleContourFallingPolynomial a j).eval (t : ℂ) * D t)) = fun _ : ℝ => (0 : ℂ) := by funext t have hexp : saddleContourExponent a t - (j : ℂ) ≠ 0 := by apply ne_of_apply_ne Complex.re have hpositive : 0 < (saddleContourExponent a t - (j : ℂ)).re := by rw [saddleContourExponent_sub_nat_re] linarith simpa using! hpositive.ne' simp [saddlePositiveCpow, Complex.zero_cpow hexp] rw [hzero, integral_zero] def plusSaddleSquaredRemainder (ε ℓ : ℝ) (N : ℕ) (u : ℝ) : ℂ := ((1 / (2 * Real.pi) : ℝ) : ℂ) * saddlePositiveContourMoment (saddleTaylorContour N) 0 (fun t : ℝ => plusSaddleMellinData ε ℓ ((saddleTaylorContour N : ℂ) + (t : ℂ) * Complex.I)) u def minusSaddleSquaredRemainder (ε ℓ : ℝ) (N : ℕ) (u : ℝ) : ℂ := ((1 / (2 * Real.pi) : ℝ) : ℂ) * saddlePositiveContourMoment (saddleTaylorContour N) 0 (fun t : ℝ => minusSaddleMellinData ε ℓ ((saddleTaylorContour N : ℂ) + (t : ℂ) * Complex.I)) u theorem plusSaddleTaylorRemainder_eq_squared (ε ℓ : ℝ) (N : ℕ) {r : ℝ} (hr : 0 < r) : plusSaddleTaylorRemainder ε ℓ N r = plusSaddleSquaredRemainder ε ℓ N (r ^ 2) := by unfold plusSaddleTaylorRemainder plusSaddleSquaredRemainder saddlePositiveContourMoment congr 1 apply MeasureTheory.integral_congr_ae filter_upwards [] with t rw [saddleMellinInversePower_eq_squaredPositiveCpow hr ((saddleTaylorContour N : ℂ) + (t : ℂ) * Complex.I)] have hq : -((saddleTaylorContour N : ℂ) + (t : ℂ) * Complex.I) / 2 = saddleContourExponent (saddleTaylorContour N) t := by unfold saddleContourExponent ring rw [hq] simp [saddleContourFallingPolynomial] theorem minusSaddleTaylorRemainder_eq_squared (ε ℓ : ℝ) (N : ℕ) {r : ℝ} (hr : 0 < r) : minusSaddleTaylorRemainder ε ℓ N r = minusSaddleSquaredRemainder ε ℓ N (r ^ 2) := by unfold minusSaddleTaylorRemainder minusSaddleSquaredRemainder saddlePositiveContourMoment congr 1 apply MeasureTheory.integral_congr_ae filter_upwards [] with t rw [saddleMellinInversePower_eq_squaredPositiveCpow hr ((saddleTaylorContour N : ℂ) + (t : ℂ) * Complex.I)] have hq : -((saddleTaylorContour N : ℂ) + (t : ℂ) * Complex.I) / 2 = saddleContourExponent (saddleTaylorContour N) t := by unfold saddleContourExponent ring rw [hq] simp [saddleContourFallingPolynomial] theorem plusSaddleSquaredRemainder_contDiffOn {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (n N : ℕ) (hshift : (n : ℝ) + 1 < -(saddleTaylorContour N) / 2) : ContDiffOn ℝ n (plusSaddleSquaredRemainder ε ℓ N) (Set.Ioo (-1 : ℝ) 1) := by have hmoment : ∀ k : ℕ, Integrable (fun t : ℝ => (t : ℂ) ^ k * plusSaddleMellinData ε ℓ ((saddleTaylorContour N : ℂ) + (t : ℂ) * Complex.I)) := by intro k exact plusSaddleMellinData_shiftedLine_moment_integrable hε hℓ horder (fun j : ℕ => saddleTaylorContour_ne_pole N j) k have hsmooth := saddlePositiveContourMoment_contDiffOn hmoment n 0 (by simpa using! hshift) exact (contDiff_const.contDiffOn.mul hsmooth) theorem minusSaddleSquaredRemainder_contDiffOn {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (n N : ℕ) (hshift : (n : ℝ) + 1 < -(saddleTaylorContour N) / 2) : ContDiffOn ℝ n (minusSaddleSquaredRemainder ε ℓ N) (Set.Ioo (-1 : ℝ) 1) := by have hmoment : ∀ k : ℕ, Integrable (fun t : ℝ => (t : ℂ) ^ k * minusSaddleMellinData ε ℓ ((saddleTaylorContour N : ℂ) + (t : ℂ) * Complex.I)) := by intro k exact minusSaddleMellinData_shiftedLine_moment_integrable hε hℓ horder (fun j : ℕ => saddleTaylorContour_ne_pole N j) k have hsmooth := saddlePositiveContourMoment_contDiffOn hmoment n 0 (by simpa using! hshift) exact (contDiff_const.contDiffOn.mul hsmooth) def saddleSquaredResiduePolynomial (c : ℕ → ℂ) (N : ℕ) (u : ℝ) : ℂ := ∑ j ∈ Finset.range (N + 1), c j * ((u : ℂ) ^ j) theorem saddleTaylorContour_negativeHalf_pos (N : ℕ) : 0 < -(saddleTaylorContour N) / 2 := by simp only [saddleTaylorContour, neg_neg] positivity @[simp] theorem saddleSquaredResiduePolynomial_zero (c : ℕ → ℂ) (N : ℕ) : saddleSquaredResiduePolynomial c N 0 = c 0 := by classical unfold saddleSquaredResiduePolynomial rw [Finset.sum_eq_single 0] · simp · intro j _ hj simp [zero_pow hj] · simp theorem saddleSquaredResiduePolynomial_contDiff (c : ℕ → ℂ) (N n : ℕ) : ContDiff ℝ n (saddleSquaredResiduePolynomial c N) := by unfold saddleSquaredResiduePolynomial apply ContDiff.sum intro j _ exact contDiff_const.mul (Complex.ofRealCLM.contDiff.pow j) @[simp] theorem plusSaddleSquaredRemainder_zero (ε ℓ : ℝ) (N : ℕ) : plusSaddleSquaredRemainder ε ℓ N 0 = 0 := by unfold plusSaddleSquaredRemainder rw [saddlePositiveContourMoment_zero 0 (by simpa using! saddleTaylorContour_negativeHalf_pos N)] simp @[simp] theorem minusSaddleSquaredRemainder_zero (ε ℓ : ℝ) (N : ℕ) : minusSaddleSquaredRemainder ε ℓ N 0 = 0 := by unfold minusSaddleSquaredRemainder rw [saddlePositiveContourMoment_zero 0 (by simpa using! saddleTaylorContour_negativeHalf_pos N)] simp theorem plusSaddleProfile_eq_squaredTaylor {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (N : ℕ) {r : ℝ} (hr : 0 ≤ r) : plusSaddleProfile ε ℓ r = saddleSquaredResiduePolynomial (plusSaddlePoleResidue ε ℓ) N (r ^ 2) + plusSaddleSquaredRemainder ε ℓ N (r ^ 2) := by rcases hr.eq_or_lt with hzero | hpositive · subst r simp [plusSaddleProfile, plusSaddlePoleResidue_zero hℓ] · rw [plusSaddleProfile_eq_residue_sum_add_remainder hε hℓ horder hpositive N, plusSaddleTaylorRemainder_eq_squared ε ℓ N hpositive] congr 1 unfold saddleSquaredResiduePolynomial apply Finset.sum_congr rfl intro j _ congr 1 push_cast rw [← pow_mul] theorem minusSaddleProfile_eq_squaredTaylor {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (N : ℕ) {r : ℝ} (hr : 0 ≤ r) : minusSaddleProfile ε ℓ r = saddleSquaredResiduePolynomial (minusSaddlePoleResidue ε ℓ) N (r ^ 2) + minusSaddleSquaredRemainder ε ℓ N (r ^ 2) := by rcases hr.eq_or_lt with hzero | hpositive · subst r simp [minusSaddleProfile, minusSaddlePoleResidue_zero hℓ] · rw [minusSaddleProfile_eq_residue_sum_add_remainder hε hℓ horder hpositive N, minusSaddleTaylorRemainder_eq_squared ε ℓ N hpositive] congr 1 unfold saddleSquaredResiduePolynomial apply Finset.sum_congr rfl intro j _ congr 1 push_cast rw [← pow_mul] theorem saddleTaylorContour_smoothShift (n : ℕ) : (n : ℝ) + 1 < -(saddleTaylorContour (n + 2)) / 2 := by simp only [saddleTaylorContour, neg_neg] push_cast linarith theorem plusSaddleFunction_contDiff_nat {ε : ℝ} (hε : 0 < ε) {d : ℕ} (hd : 0 < d) (horder : shortCutoff ε ≤ shortEndpoint ε) (n : ℕ) : ContDiff ℝ n (plusSaddleFunction ε d) := by have hdimension : 0 < (d : ℝ) / 2 := div_pos (by exact_mod_cast hd) (by norm_num) apply contDiff_iff_contDiffAt.mpr intro x by_cases hx : x = 0 · subst x let N : ℕ := n + 2 have hshift : (n : ℝ) + 1 < -(saddleTaylorContour N) / 2 := by exact saddleTaylorContour_smoothShift n have hremScalar : ContDiffAt ℝ n (plusSaddleSquaredRemainder ε ((d : ℝ) / 2) N) (‖(0 : Euclidean d)‖ ^ 2) := by simpa using! (plusSaddleSquaredRemainder_contDiffOn hε hdimension horder n N hshift).contDiffAt (isOpen_Ioo.mem_nhds (show (0 : ℝ) ∈ Set.Ioo (-1 : ℝ) 1 by constructor <;> norm_num)) have hrem : ContDiffAt ℝ n (fun y : Euclidean d => plusSaddleSquaredRemainder ε ((d : ℝ) / 2) N (‖y‖ ^ 2)) (0 : Euclidean d) := hremScalar.fun_comp (f := fun y : Euclidean d => ‖y‖ ^ 2) (0 : Euclidean d) (contDiff_norm_sq ℝ).contDiffAt have hpoly : ContDiffAt ℝ n (fun y : Euclidean d => saddleSquaredResiduePolynomial (plusSaddlePoleResidue ε ((d : ℝ) / 2)) N (‖y‖ ^ 2)) (0 : Euclidean d) := (saddleSquaredResiduePolynomial_contDiff (plusSaddlePoleResidue ε ((d : ℝ) / 2)) N n).contDiffAt.fun_comp (f := fun y : Euclidean d => ‖y‖ ^ 2) (0 : Euclidean d) (contDiff_norm_sq ℝ).contDiffAt refine (hpoly.add hrem).congr_of_eventuallyEq (Filter.Eventually.of_forall (fun y : Euclidean d => ?_)) exact plusSaddleProfile_eq_squaredTaylor hε hdimension horder N (norm_nonneg y) · exact ((plusSaddleFunction_contDiffOn hε hd horder).contDiffAt ((isOpen_compl_singleton (x := (0 : Euclidean d))).mem_nhds (by simpa using! hx))).of_le (mod_cast le_top) theorem minusSaddleFunction_contDiff_nat {ε : ℝ} (hε : 0 < ε) {d : ℕ} (hd : 0 < d) (horder : shortCutoff ε ≤ shortEndpoint ε) (n : ℕ) : ContDiff ℝ n (minusSaddleFunction ε d) := by have hdimension : 0 < (d : ℝ) / 2 := div_pos (by exact_mod_cast hd) (by norm_num) apply contDiff_iff_contDiffAt.mpr intro x by_cases hx : x = 0 · subst x let N : ℕ := n + 2 have hshift : (n : ℝ) + 1 < -(saddleTaylorContour N) / 2 := by exact saddleTaylorContour_smoothShift n have hremScalar : ContDiffAt ℝ n (minusSaddleSquaredRemainder ε ((d : ℝ) / 2) N) (‖(0 : Euclidean d)‖ ^ 2) := by simpa using! (minusSaddleSquaredRemainder_contDiffOn hε hdimension horder n N hshift).contDiffAt (isOpen_Ioo.mem_nhds (show (0 : ℝ) ∈ Set.Ioo (-1 : ℝ) 1 by constructor <;> norm_num)) have hrem : ContDiffAt ℝ n (fun y : Euclidean d => minusSaddleSquaredRemainder ε ((d : ℝ) / 2) N (‖y‖ ^ 2)) (0 : Euclidean d) := hremScalar.fun_comp (f := fun y : Euclidean d => ‖y‖ ^ 2) (0 : Euclidean d) (contDiff_norm_sq ℝ).contDiffAt have hpoly : ContDiffAt ℝ n (fun y : Euclidean d => saddleSquaredResiduePolynomial (minusSaddlePoleResidue ε ((d : ℝ) / 2)) N (‖y‖ ^ 2)) (0 : Euclidean d) := (saddleSquaredResiduePolynomial_contDiff (minusSaddlePoleResidue ε ((d : ℝ) / 2)) N n).contDiffAt.fun_comp (f := fun y : Euclidean d => ‖y‖ ^ 2) (0 : Euclidean d) (contDiff_norm_sq ℝ).contDiffAt refine (hpoly.add hrem).congr_of_eventuallyEq (Filter.Eventually.of_forall (fun y : Euclidean d => ?_)) exact minusSaddleProfile_eq_squaredTaylor hε hdimension horder N (norm_nonneg y) · exact ((minusSaddleFunction_contDiffOn hε hd horder).contDiffAt ((isOpen_compl_singleton (x := (0 : Euclidean d))).mem_nhds (by simpa using! hx))).of_le (mod_cast le_top) theorem plusSaddleFunction_contDiff {ε : ℝ} (hε : 0 < ε) {d : ℕ} (hd : 0 < d) (horder : shortCutoff ε ≤ shortEndpoint ε) : ContDiff ℝ ∞ (plusSaddleFunction ε d) := by exact contDiff_infty.mpr (fun n => plusSaddleFunction_contDiff_nat hε hd horder n) theorem minusSaddleFunction_contDiff {ε : ℝ} (hε : 0 < ε) {d : ℕ} (hd : 0 < d) (horder : shortCutoff ε ≤ shortEndpoint ε) : ContDiff ℝ ∞ (minusSaddleFunction ε d) := by exact contDiff_infty.mpr (fun n => minusSaddleFunction_contDiff_nat hε hd horder n) end noncomputable section open Filter Set MeasureTheory intervalIntegral open scoped ContDiff FourierTransform Interval RealInnerProductSpace SchwartzMap Topology theorem saddleRightHalfPlane_boundary_rectangle {F : ℂ → ℂ} (hF : DifferentiableOn ℂ F {z : ℂ | 0 < z.re}) {A B : ℝ} (hA : 0 < A) (hB : 0 < B) (T : ℝ) : (∫ a in A..B, F ((a : ℂ) + ((-T : ℝ) : ℂ) * Complex.I)) - (∫ a in A..B, F ((a : ℂ) + (T : ℂ) * Complex.I)) + Complex.I * (∫ t in -T..T, F ((B : ℂ) + (t : ℂ) * Complex.I)) - Complex.I * (∫ t in -T..T, F ((A : ℂ) + (t : ℂ) * Complex.I)) = 0 := by let z : ℂ := (A : ℂ) + ((-T : ℝ) : ℂ) * Complex.I let w : ℂ := (B : ℂ) + (T : ℂ) * Complex.I have hrect : DifferentiableOn ℂ F (Complex.reProdIm [[z.re, w.re]] [[z.im, w.im]]) := by apply hF.mono intro u hu have hre : u.re ∈ [[z.re, w.re]] := (Complex.mem_reProdIm.mp hu).1 rcases Set.mem_uIcc.mp hre with hleft | hright · have hza : z.re = A := by simp [z, Complex.mul_re] rw [hza] at hleft exact hA.trans_le hleft.1 · have hwb : w.re = B := by simp [w, Complex.mul_re] rw [hwb] at hright exact hB.trans_le hright.1 have h := Complex.integral_boundary_rect_eq_zero_of_differentiableOn F z w hrect simpa [z, w, Complex.mul_re, Complex.mul_im, smul_eq_mul] using! h theorem plusSaddleMellinData_positive_vertical_integral_eq {ε ℓ r A B : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (hA : 0 < A) (hB : 0 < B) (hAB : A ≤ B) : (∫ t : ℝ, saddleMellinInversePower r ((B : ℂ) + (t : ℂ) * Complex.I) * plusSaddleMellinData ε ℓ ((B : ℂ) + (t : ℂ) * Complex.I)) = (∫ t : ℝ, saddleMellinInversePower r ((A : ℂ) + (t : ℂ) * Complex.I) * plusSaddleMellinData ε ℓ ((A : ℂ) + (t : ℂ) * Complex.I)) := by let F : ℂ → ℂ := fun z => saddleMellinInversePower r z * plusSaddleMellinData ε ℓ z have hhol : DifferentiableOn ℂ F {z : ℂ | 0 < z.re} := (saddleMellinInversePower_differentiable hr).differentiableOn.mul (plusSaddleMellinData_differentiableOn_rightHalfPlane hε horder ℓ) have hleft : Integrable (fun t : ℝ => F ((A : ℂ) + (t : ℂ) * Complex.I)) := plusSaddleMellinData_shiftedLine_weighted_integrable hε hℓ horder (fun n => saddlePositiveContour_ne_pole hA n) hr have hright : Integrable (fun t : ℝ => F ((B : ℂ) + (t : ℂ) * Complex.I)) := plusSaddleMellinData_shiftedLine_weighted_integrable hε hℓ horder (fun n => saddlePositiveContour_ne_pole hB n) hr have hlower : Tendsto (fun T : ℝ => ∫ a in A..B, F ((a : ℂ) + ((-T : ℝ) : ℂ) * Complex.I)) Filter.atTop (𝓝 0) := by simpa [F] using! plusSaddleMellinData_weighted_horizontalIntegral_tendsto_zero hε hℓ horder hr hAB (-1) (by norm_num) have hupper : Tendsto (fun T : ℝ => ∫ a in A..B, F ((a : ℂ) + (T : ℂ) * Complex.I)) Filter.atTop (𝓝 0) := by simpa [F] using! plusSaddleMellinData_weighted_horizontalIntegral_tendsto_zero hε hℓ horder hr hAB 1 (by norm_num) exact saddleInfiniteRectangle_vertical_integral_eq hleft hright hlower hupper (fun T => saddleRightHalfPlane_boundary_rectangle hhol hA hB T) theorem minusSaddleMellinData_positive_vertical_integral_eq {ε ℓ r A B : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (hA : 0 < A) (hB : 0 < B) (hAB : A ≤ B) : (∫ t : ℝ, saddleMellinInversePower r ((B : ℂ) + (t : ℂ) * Complex.I) * minusSaddleMellinData ε ℓ ((B : ℂ) + (t : ℂ) * Complex.I)) = (∫ t : ℝ, saddleMellinInversePower r ((A : ℂ) + (t : ℂ) * Complex.I) * minusSaddleMellinData ε ℓ ((A : ℂ) + (t : ℂ) * Complex.I)) := by let F : ℂ → ℂ := fun z => saddleMellinInversePower r z * minusSaddleMellinData ε ℓ z have hhol : DifferentiableOn ℂ F {z : ℂ | 0 < z.re} := (saddleMellinInversePower_differentiable hr).differentiableOn.mul (minusSaddleMellinData_differentiableOn_rightHalfPlane hε horder ℓ) have hleft : Integrable (fun t : ℝ => F ((A : ℂ) + (t : ℂ) * Complex.I)) := minusSaddleMellinData_shiftedLine_weighted_integrable hε hℓ horder (fun n => saddlePositiveContour_ne_pole hA n) hr have hright : Integrable (fun t : ℝ => F ((B : ℂ) + (t : ℂ) * Complex.I)) := minusSaddleMellinData_shiftedLine_weighted_integrable hε hℓ horder (fun n => saddlePositiveContour_ne_pole hB n) hr have hlower : Tendsto (fun T : ℝ => ∫ a in A..B, F ((a : ℂ) + ((-T : ℝ) : ℂ) * Complex.I)) Filter.atTop (𝓝 0) := by simpa [F] using! minusSaddleMellinData_weighted_horizontalIntegral_tendsto_zero hε hℓ horder hr hAB (-1) (by norm_num) have hupper : Tendsto (fun T : ℝ => ∫ a in A..B, F ((a : ℂ) + (T : ℂ) * Complex.I)) Filter.atTop (𝓝 0) := by simpa [F] using! minusSaddleMellinData_weighted_horizontalIntegral_tendsto_zero hε hℓ horder hr hAB 1 (by norm_num) exact saddleInfiniteRectangle_vertical_integral_eq hleft hright hlower hupper (fun T => saddleRightHalfPlane_boundary_rectangle hhol hA hB T) theorem plusSaddleProfile_eq_positive_contour {ε ℓ r a : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (ha : 0 < a) : plusSaddleProfile ε ℓ r = ((1 / (2 * Real.pi) : ℝ) : ℂ) * (∫ t : ℝ, saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)) := by rw [plusSaddleProfile_eq_normalized_vertical_integral hr] congr 1 rcases le_total ℓ a with hleft | hright · exact (plusSaddleMellinData_positive_vertical_integral_eq hε hℓ horder hr hℓ ha hleft).symm · exact plusSaddleMellinData_positive_vertical_integral_eq hε hℓ horder hr ha hℓ hright theorem minusSaddleProfile_eq_positive_contour {ε ℓ r a : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (ha : 0 < a) : minusSaddleProfile ε ℓ r = ((1 / (2 * Real.pi) : ℝ) : ℂ) * (∫ t : ℝ, saddleMellinInversePower r ((a : ℂ) + (t : ℂ) * Complex.I) * minusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)) := by rw [minusSaddleProfile_eq_normalized_vertical_integral hr] congr 1 rcases le_total ℓ a with hleft | hright · exact (minusSaddleMellinData_positive_vertical_integral_eq hε hℓ horder hr hℓ ha hleft).symm · exact minusSaddleMellinData_positive_vertical_integral_eq hε hℓ horder hr ha hℓ hright def plusSaddlePositiveSquaredContour (ε ℓ a u : ℝ) : ℂ := ((1 / (2 * Real.pi) : ℝ) : ℂ) * saddlePositiveContourMoment a 0 (fun t : ℝ => plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)) u def minusSaddlePositiveSquaredContour (ε ℓ a u : ℝ) : ℂ := ((1 / (2 * Real.pi) : ℝ) : ℂ) * saddlePositiveContourMoment a 0 (fun t : ℝ => minusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)) u theorem plusSaddleProfile_eq_positive_squaredContour {ε ℓ r a : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (ha : 0 < a) : plusSaddleProfile ε ℓ r = plusSaddlePositiveSquaredContour ε ℓ a (r ^ 2) := by rw [plusSaddleProfile_eq_positive_contour hε hℓ horder hr ha] unfold plusSaddlePositiveSquaredContour saddlePositiveContourMoment congr 1 apply MeasureTheory.integral_congr_ae filter_upwards [] with t rw [saddleMellinInversePower_eq_squaredPositiveCpow hr ((a : ℂ) + (t : ℂ) * Complex.I)] have hq : -((a : ℂ) + (t : ℂ) * Complex.I) / 2 = saddleContourExponent a t := by unfold saddleContourExponent ring rw [hq] simp [saddleContourFallingPolynomial] theorem minusSaddleProfile_eq_positive_squaredContour {ε ℓ r a : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (ha : 0 < a) : minusSaddleProfile ε ℓ r = minusSaddlePositiveSquaredContour ε ℓ a (r ^ 2) := by rw [minusSaddleProfile_eq_positive_contour hε hℓ horder hr ha] unfold minusSaddlePositiveSquaredContour saddlePositiveContourMoment congr 1 apply MeasureTheory.integral_congr_ae filter_upwards [] with t rw [saddleMellinInversePower_eq_squaredPositiveCpow hr ((a : ℂ) + (t : ℂ) * Complex.I)] have hq : -((a : ℂ) + (t : ℂ) * Complex.I) / 2 = saddleContourExponent a t := by unfold saddleContourExponent ring rw [hq] simp [saddleContourFallingPolynomial] theorem saddlePositiveCpow_hasDerivAt_of_pos {z : ℂ} (hz : z ≠ 0) {u : ℝ} (hu : 0 < u) : HasDerivAt (saddlePositiveCpow z) (z * saddlePositiveCpow (z - 1) u) u := by have hevent : saddlePositiveCpow z =ᶠ[𝓝 u] (fun v : ℝ => (v : ℂ) ^ z) := by filter_upwards [Ioi_mem_nhds hu] with v hv change 0 < v at hv simp [saddlePositiveCpow, max_eq_left hv.le] have hvalue : saddlePositiveCpow (z - 1) u = (u : ℂ) ^ (z - 1) := by simp [saddlePositiveCpow, max_eq_left hu.le] rw [hvalue] exact (hasDerivAt_ofReal_cpow_const hu.ne' hz).congr_of_eventuallyEq hevent theorem saddlePositiveContourPower_frequency_continuous_of_pos (a : ℝ) (j : ℕ) {u : ℝ} (hu : 0 < u) : Continuous (fun t : ℝ => saddlePositiveCpow (saddleContourExponent a t - (j : ℂ)) u) := by have hfrequency : Continuous (fun t : ℝ => saddleContourExponent a t - (j : ℂ)) := by unfold saddleContourExponent fun_prop unfold saddlePositiveCpow apply hfrequency.const_cpow left rw [max_eq_left hu.le] exact Complex.ofReal_ne_zero.mpr hu.ne' theorem saddlePositiveCpow_norm_le_one_of_nonpos {z : ℂ} (hz : z.re ≤ 0) {u : ℝ} (hu : u ∈ Set.Ioi (1 : ℝ)) : ‖saddlePositiveCpow z u‖ ≤ 1 := by have hupos : 0 < u := lt_trans zero_lt_one hu unfold saddlePositiveCpow rw [max_eq_left hupos.le, Complex.norm_cpow_eq_rpow_re_of_pos hupos] exact Real.rpow_le_one_of_one_le_of_nonpos hu.le hz theorem saddlePositiveContourMoment_hasDerivAt_of_positiveContour {D : ℝ → ℂ} (hD : ∀ k : ℕ, Integrable (fun t : ℝ => (t : ℂ) ^ k * D t)) {a : ℝ} (ha : 0 < a) (j : ℕ) {u : ℝ} (hu : u ∈ Set.Ioi (1 : ℝ)) : HasDerivAt (saddlePositiveContourMoment a j D) (saddlePositiveContourMoment a (j + 1) D u) u := by let W : ℕ → ℝ → ℂ := fun k t => (saddleContourFallingPolynomial a k).eval (t : ℂ) * D t have hW (k : ℕ) : Integrable (W k) := by try dsimp [W] exact saddlePolynomialWeightedData_integrable hD (saddleContourFallingPolynomial a k) have hupos : 0 < u := lt_trans zero_lt_one hu have hkernel (k : ℕ) (v : ℝ) (hv : 0 < v) : AEStronglyMeasurable (fun t : ℝ => saddlePositiveCpow (saddleContourExponent a t - (k : ℂ)) v * W k t) := (saddlePositiveContourPower_frequency_continuous_of_pos a k hv).aestronglyMeasurable.mul (hW k).aestronglyMeasurable have hpower (k : ℕ) (t : ℝ) : (saddleContourExponent a t - (k : ℂ)).re ≤ 0 := by rw [saddleContourExponent_sub_nat_re] have hk : (0 : ℝ) ≤ k := Nat.cast_nonneg k linarith have hpoint (v : ℝ) (hv : v ∈ Set.Ioi (1 : ℝ)) : Integrable (fun t : ℝ => saddlePositiveCpow (saddleContourExponent a t - (j : ℂ)) v * W j t) := by apply (hW j).norm.mono' (hkernel j v (lt_trans zero_lt_one hv)) filter_upwards [] with t rw [norm_mul] calc ‖saddlePositiveCpow (saddleContourExponent a t - (j : ℂ)) v‖ * ‖W j t‖ ≤ 1 * ‖W j t‖ := by gcongr exact saddlePositiveCpow_norm_le_one_of_nonpos (hpower j t) hv _ = ‖W j t‖ := one_mul _ have hdiff (t v : ℝ) (hv : v ∈ Set.Ioi (1 : ℝ)) : HasDerivAt (fun x : ℝ => saddlePositiveCpow (saddleContourExponent a t - (j : ℂ)) x * W j t) (saddlePositiveCpow (saddleContourExponent a t - ((j + 1 : ℕ) : ℂ)) v * W (j + 1) t) v := by have hnonzero : saddleContourExponent a t - (j : ℂ) ≠ 0 := by apply ne_of_apply_ne Complex.re rw [saddleContourExponent_sub_nat_re] have hk : (0 : ℝ) ≤ j := Nat.cast_nonneg j have hneg : -a / 2 - (j : ℝ) < 0 := by linarith simpa using! hneg.ne have hderiv := (saddlePositiveCpow_hasDerivAt_of_pos hnonzero (lt_trans zero_lt_one hv)).mul_const (W j t) have harg : saddleContourExponent a t - ((j + 1 : ℕ) : ℂ) = saddleContourExponent a t - (j : ℂ) - 1 := by push_cast ring have hfall : W (j + 1) t = W j t * (saddleContourExponent a t - (j : ℂ)) := by try dsimp [W] rw [saddleContourFallingPolynomial_eval_succ] ring rw [harg, hfall] convert! hderiv using 1 all_goals ring have hmeas : ∀ᶠ v in 𝓝 u, AEStronglyMeasurable (fun t : ℝ => saddlePositiveCpow (saddleContourExponent a t - (j : ℂ)) v * W j t) := by filter_upwards [Ioi_mem_nhds hupos] with v hv exact hkernel j v hv have hresult := _root_.hasDerivAt_integral_of_dominated_loc_of_deriv_le (μ := MeasureTheory.volume) (F := fun (v : ℝ) (t : ℝ) => saddlePositiveCpow (saddleContourExponent a t - (j : ℂ)) v * W j t) (F' := fun (v : ℝ) (t : ℝ) => saddlePositiveCpow (saddleContourExponent a t - ((j + 1 : ℕ) : ℂ)) v * W (j + 1) t) (bound := fun t : ℝ => ‖W (j + 1) t‖) (isOpen_Ioi.mem_nhds hu) hmeas (hpoint u hu) (hkernel (j + 1) u hupos) (Filter.Eventually.of_forall (fun t => by intro v hv rw [norm_mul] calc ‖saddlePositiveCpow (saddleContourExponent a t - ((j + 1 : ℕ) : ℂ)) v‖ * ‖W (j + 1) t‖ ≤ 1 * ‖W (j + 1) t‖ := by gcongr exact saddlePositiveCpow_norm_le_one_of_nonpos (hpower (j + 1) t) hv _ = ‖W (j + 1) t‖ := one_mul _)) ((hW (j + 1)).norm) (Filter.Eventually.of_forall (fun t => by intro v hv exact hdiff t v hv)) change HasDerivAt (fun v : ℝ => ∫ t : ℝ, saddlePositiveCpow (saddleContourExponent a t - (j : ℂ)) v * W j t) (∫ t : ℝ, saddlePositiveCpow (saddleContourExponent a t - ((j + 1 : ℕ) : ℂ)) u * W (j + 1) t) u exact hresult.2 theorem saddlePositiveContourMoment_contDiffOn_of_positiveContour {D : ℝ → ℂ} (hD : ∀ k : ℕ, Integrable (fun t : ℝ => (t : ℂ) ^ k * D t)) {a : ℝ} (ha : 0 < a) (n j : ℕ) : ContDiffOn ℝ n (saddlePositiveContourMoment a j D) (Set.Ioi (1 : ℝ)) := by induction n generalizing j with | zero => change ContDiffOn ℝ 0 (saddlePositiveContourMoment a j D) (Set.Ioi (1 : ℝ)) rw [contDiffOn_zero] intro u hu exact (saddlePositiveContourMoment_hasDerivAt_of_positiveContour hD ha j hu).continuousAt.continuousWithinAt | succ n ih => rw [show (↑(n + 1) : WithTop ℕ∞) = (↑n : WithTop ℕ∞) + 1 by simp, contDiffOn_succ_iff_deriv_of_isOpen isOpen_Ioi] refine ⟨?_, ?_, ?_⟩ · intro u hu exact (saddlePositiveContourMoment_hasDerivAt_of_positiveContour hD ha j hu).differentiableAt.differentiableWithinAt · simp · exact (ih (j + 1)).congr (fun u hu => (saddlePositiveContourMoment_hasDerivAt_of_positiveContour hD ha j hu).deriv) theorem saddlePositiveContourMoment_contDiffOn_infty_of_positiveContour {D : ℝ → ℂ} (hD : ∀ k : ℕ, Integrable (fun t : ℝ => (t : ℂ) ^ k * D t)) {a : ℝ} (ha : 0 < a) (j : ℕ) : ContDiffOn ℝ ∞ (saddlePositiveContourMoment a j D) (Set.Ioi (1 : ℝ)) := by rw [contDiffOn_infty] exact fun n => saddlePositiveContourMoment_contDiffOn_of_positiveContour hD ha n j theorem saddlePositiveContourMoment_iteratedDeriv_of_positiveContour {D : ℝ → ℂ} (hD : ∀ k : ℕ, Integrable (fun t : ℝ => (t : ℂ) ^ k * D t)) {a : ℝ} (ha : 0 < a) (n j : ℕ) {u : ℝ} (hu : u ∈ Set.Ioi (1 : ℝ)) : iteratedDeriv n (saddlePositiveContourMoment a j D) u = saddlePositiveContourMoment a (j + n) D u := by induction n generalizing j u with | zero => simp | succ n ih => rw [iteratedDeriv_succ'] have hevent : deriv (saddlePositiveContourMoment a j D) =ᶠ[𝓝 u] saddlePositiveContourMoment a (j + 1) D := by filter_upwards [isOpen_Ioi.mem_nhds hu] with v hv exact (saddlePositiveContourMoment_hasDerivAt_of_positiveContour hD ha j hv).deriv rw [hevent.iteratedDeriv_eq n] simpa [Nat.add_assoc, Nat.add_comm, Nat.add_left_comm] using! ih (j + 1) hu def saddleContourMomentL1 (a : ℝ) (j : ℕ) (D : ℝ → ℂ) : ℝ := ∫ t : ℝ, ‖(saddleContourFallingPolynomial a j).eval (t : ℂ) * D t‖ theorem saddlePositiveContourMoment_norm_le {D : ℝ → ℂ} (hD : ∀ k : ℕ, Integrable (fun t : ℝ => (t : ℂ) ^ k * D t)) (a : ℝ) (j : ℕ) {u : ℝ} (hu : 0 < u) : ‖saddlePositiveContourMoment a j D u‖ ≤ u ^ (-a / 2 - (j : ℝ)) * saddleContourMomentL1 a j D := by let W : ℝ → ℂ := fun t => (saddleContourFallingPolynomial a j).eval (t : ℂ) * D t have hW : Integrable W := by exact saddlePolynomialWeightedData_integrable hD (saddleContourFallingPolynomial a j) unfold saddlePositiveContourMoment saddleContourMomentL1 calc ‖∫ t : ℝ, saddlePositiveCpow (saddleContourExponent a t - (j : ℂ)) u * ((saddleContourFallingPolynomial a j).eval (t : ℂ) * D t)‖ ≤ ∫ t : ℝ, ‖saddlePositiveCpow (saddleContourExponent a t - (j : ℂ)) u * ((saddleContourFallingPolynomial a j).eval (t : ℂ) * D t)‖ := MeasureTheory.norm_integral_le_integral_norm _ _ = ∫ t : ℝ, u ^ (-a / 2 - (j : ℝ)) * ‖(saddleContourFallingPolynomial a j).eval (t : ℂ) * D t‖ := by apply MeasureTheory.integral_congr_ae filter_upwards [] with t rw [norm_mul] congr 1 unfold saddlePositiveCpow rw [max_eq_left hu.le, Complex.norm_cpow_eq_rpow_re_of_pos hu, saddleContourExponent_sub_nat_re] _ = u ^ (-a / 2 - (j : ℝ)) * (∫ t : ℝ, ‖(saddleContourFallingPolynomial a j).eval (t : ℂ) * D t‖) := by exact integral_const_mul_of_integrable hW.norm theorem plusSaddlePositiveSquaredContour_contDiffOn {ε ℓ a : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (ha : 0 < a) : ContDiffOn ℝ ∞ (plusSaddlePositiveSquaredContour ε ℓ a) (Set.Ioi (1 : ℝ)) := by unfold plusSaddlePositiveSquaredContour apply contDiffOn_const.mul apply saddlePositiveContourMoment_contDiffOn_infty_of_positiveContour (a := a) (j := 0) _ ha intro k exact plusSaddleMellinData_shiftedLine_moment_integrable hε hℓ horder (fun n => saddlePositiveContour_ne_pole ha n) k theorem minusSaddlePositiveSquaredContour_contDiffOn {ε ℓ a : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (ha : 0 < a) : ContDiffOn ℝ ∞ (minusSaddlePositiveSquaredContour ε ℓ a) (Set.Ioi (1 : ℝ)) := by unfold minusSaddlePositiveSquaredContour apply contDiffOn_const.mul apply saddlePositiveContourMoment_contDiffOn_infty_of_positiveContour (a := a) (j := 0) _ ha intro k exact minusSaddleMellinData_shiftedLine_moment_integrable hε hℓ horder (fun n => saddlePositiveContour_ne_pole ha n) k theorem plusSaddlePositiveSquaredContour_eq_of_pos {ε ℓ a b u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (ha : 0 < a) (hb : 0 < b) (hu : 0 < u) : plusSaddlePositiveSquaredContour ε ℓ a u = plusSaddlePositiveSquaredContour ε ℓ b u := by have hroot : 0 < Real.sqrt u := Real.sqrt_pos.2 hu have hsquare : (Real.sqrt u) ^ 2 = u := Real.sq_sqrt hu.le calc plusSaddlePositiveSquaredContour ε ℓ a u = plusSaddlePositiveSquaredContour ε ℓ a ((Real.sqrt u) ^ 2) := by rw [hsquare] _ = plusSaddleProfile ε ℓ (Real.sqrt u) := (plusSaddleProfile_eq_positive_squaredContour hε hℓ horder hroot ha).symm _ = plusSaddlePositiveSquaredContour ε ℓ b ((Real.sqrt u) ^ 2) := plusSaddleProfile_eq_positive_squaredContour hε hℓ horder hroot hb _ = plusSaddlePositiveSquaredContour ε ℓ b u := by rw [hsquare] theorem minusSaddlePositiveSquaredContour_eq_of_pos {ε ℓ a b u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (ha : 0 < a) (hb : 0 < b) (hu : 0 < u) : minusSaddlePositiveSquaredContour ε ℓ a u = minusSaddlePositiveSquaredContour ε ℓ b u := by have hroot : 0 < Real.sqrt u := Real.sqrt_pos.2 hu have hsquare : (Real.sqrt u) ^ 2 = u := Real.sq_sqrt hu.le calc minusSaddlePositiveSquaredContour ε ℓ a u = minusSaddlePositiveSquaredContour ε ℓ a ((Real.sqrt u) ^ 2) := by rw [hsquare] _ = minusSaddleProfile ε ℓ (Real.sqrt u) := (minusSaddleProfile_eq_positive_squaredContour hε hℓ horder hroot ha).symm _ = minusSaddlePositiveSquaredContour ε ℓ b ((Real.sqrt u) ^ 2) := minusSaddleProfile_eq_positive_squaredContour hε hℓ horder hroot hb _ = minusSaddlePositiveSquaredContour ε ℓ b u := by rw [hsquare] def saddleOuterCutoff (u : ℝ) : ℂ := (Real.smoothTransition (u - 2) : ℂ) theorem saddleOuterCutoff_contDiff : ContDiff ℝ ∞ saddleOuterCutoff := by unfold saddleOuterCutoff exact Complex.ofRealCLM.contDiff.comp (Real.smoothTransition.contDiff.comp (contDiff_id.sub contDiff_const)) def plusSaddleOuterSquaredProfile (ε ℓ u : ℝ) : ℂ := saddleOuterCutoff u * plusSaddlePositiveSquaredContour ε ℓ 2 u def minusSaddleOuterSquaredProfile (ε ℓ u : ℝ) : ℂ := saddleOuterCutoff u * minusSaddlePositiveSquaredContour ε ℓ 2 u theorem plusSaddleOuterSquaredProfile_contDiff {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) : ContDiff ℝ ∞ (plusSaddleOuterSquaredProfile ε ℓ) := by apply contDiff_iff_contDiffAt.mpr intro u by_cases hu : u < (2 : ℝ) · have hevent : plusSaddleOuterSquaredProfile ε ℓ =ᶠ[𝓝 u] (fun _ : ℝ => (0 : ℂ)) := by filter_upwards [Iio_mem_nhds hu] with v hv change v < 2 at hv have hvzero : Real.smoothTransition (v - 2) = 0 := Real.smoothTransition.zero_of_nonpos (by linarith) simp [plusSaddleOuterSquaredProfile, saddleOuterCutoff, hvzero] exact contDiffAt_const.congr_of_eventuallyEq hevent · have hone : u ∈ Set.Ioi (1 : ℝ) := by change 1 < u linarith have hcontour : ContDiffAt ℝ ∞ (plusSaddlePositiveSquaredContour ε ℓ 2) u := (plusSaddlePositiveSquaredContour_contDiffOn hε hℓ horder (by norm_num)).contDiffAt (isOpen_Ioi.mem_nhds hone) exact saddleOuterCutoff_contDiff.contDiffAt.mul hcontour theorem minusSaddleOuterSquaredProfile_contDiff {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) : ContDiff ℝ ∞ (minusSaddleOuterSquaredProfile ε ℓ) := by apply contDiff_iff_contDiffAt.mpr intro u by_cases hu : u < (2 : ℝ) · have hevent : minusSaddleOuterSquaredProfile ε ℓ =ᶠ[𝓝 u] (fun _ : ℝ => (0 : ℂ)) := by filter_upwards [Iio_mem_nhds hu] with v hv change v < 2 at hv have hvzero : Real.smoothTransition (v - 2) = 0 := Real.smoothTransition.zero_of_nonpos (by linarith) simp [minusSaddleOuterSquaredProfile, saddleOuterCutoff, hvzero] exact contDiffAt_const.congr_of_eventuallyEq hevent · have hone : u ∈ Set.Ioi (1 : ℝ) := by change 1 < u linarith have hcontour : ContDiffAt ℝ ∞ (minusSaddlePositiveSquaredContour ε ℓ 2) u := (minusSaddlePositiveSquaredContour_contDiffOn hε hℓ horder (by norm_num)).contDiffAt (isOpen_Ioi.mem_nhds hone) exact saddleOuterCutoff_contDiff.contDiffAt.mul hcontour theorem plusSaddleOuterSquaredProfile_eq_zero (ε ℓ : ℝ) {u : ℝ} (hu : u < 2) : plusSaddleOuterSquaredProfile ε ℓ u = 0 := by have hcut : Real.smoothTransition (u - 2) = 0 := Real.smoothTransition.zero_of_nonpos (by linarith) simp [plusSaddleOuterSquaredProfile, saddleOuterCutoff, hcut] theorem minusSaddleOuterSquaredProfile_eq_zero (ε ℓ : ℝ) {u : ℝ} (hu : u < 2) : minusSaddleOuterSquaredProfile ε ℓ u = 0 := by have hcut : Real.smoothTransition (u - 2) = 0 := Real.smoothTransition.zero_of_nonpos (by linarith) simp [minusSaddleOuterSquaredProfile, saddleOuterCutoff, hcut] theorem plusSaddleOuterSquaredProfile_eq_positiveContour {ε ℓ a u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (ha : 0 < a) (hu : 3 < u) : plusSaddleOuterSquaredProfile ε ℓ u = plusSaddlePositiveSquaredContour ε ℓ a u := by have hcut : Real.smoothTransition (u - 2) = 1 := Real.smoothTransition.one_of_one_le (by linarith) unfold plusSaddleOuterSquaredProfile saddleOuterCutoff rw [hcut] norm_num exact plusSaddlePositiveSquaredContour_eq_of_pos hε hℓ horder (by norm_num) ha (by linarith) theorem minusSaddleOuterSquaredProfile_eq_positiveContour {ε ℓ a u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (ha : 0 < a) (hu : 3 < u) : minusSaddleOuterSquaredProfile ε ℓ u = minusSaddlePositiveSquaredContour ε ℓ a u := by have hcut : Real.smoothTransition (u - 2) = 1 := Real.smoothTransition.one_of_one_le (by linarith) unfold minusSaddleOuterSquaredProfile saddleOuterCutoff rw [hcut] norm_num exact minusSaddlePositiveSquaredContour_eq_of_pos hε hℓ horder (by norm_num) ha (by linarith) theorem saddleOuterSquaredProfile_schwartz_decay {G : ℝ → ℂ} (hG : ContDiff ℝ ∞ G) (hzero : ∀ u : ℝ, u < 2 → G u = 0) (D : ℝ → ℝ → ℂ) (hD : ∀ a : ℝ, 0 < a → ∀ j : ℕ, Integrable (fun t : ℝ => (t : ℂ) ^ j * D a t)) (htail : ∀ a : ℝ, 0 < a → ∀ u : ℝ, 3 < u → G u = ((1 / (2 * Real.pi) : ℝ) : ℂ) * saddlePositiveContourMoment a 0 (D a) u) (k n : ℕ) : ∃ C : ℝ, ∀ u : ℝ, ‖u‖ ^ k * ‖iteratedFDeriv ℝ n G u‖ ≤ C := by let c : ℂ := ((1 / (2 * Real.pi) : ℝ) : ℂ) let a : ℝ := 2 * ((k + 1 : ℕ) : ℝ) have ha : 0 < a := by try dsimp [a] positivity have hcontinuous : Continuous (fun u : ℝ => ‖u‖ ^ k * ‖iteratedFDeriv ℝ n G u‖) := by apply Continuous.mul (by fun_prop) exact (hG.of_le (mod_cast le_top)).continuous_iteratedFDeriv'.norm have hbounded : BddAbove ((fun u : ℝ => ‖u‖ ^ k * ‖iteratedFDeriv ℝ n G u‖) '' Set.Icc (2 : ℝ) 4) := isCompact_Icc.bddAbove_image hcontinuous.continuousOn obtain ⟨B, hB⟩ := hbounded let L : ℝ := saddleContourMomentL1 a n (D a) have hL : 0 ≤ L := by unfold L saddleContourMomentL1 exact integral_nonneg (fun _ => norm_nonneg _) refine ⟨max 0 (max B (‖c‖ * L)), ?_⟩ intro u by_cases hlow : u < (2 : ℝ) · have hevent : G =ᶠ[𝓝 u] (fun _ : ℝ => (0 : ℂ)) := by filter_upwards [Iio_mem_nhds hlow] with v hv exact hzero v hv have hiter := (hevent.iteratedFDeriv ℝ n).eq_of_nhds rw [hiter] simpa only [iteratedFDeriv_fun_zero, Pi.zero_apply, norm_zero, mul_zero] using! (le_max_left (0 : ℝ) (max B (‖c‖ * L))) · by_cases hupper : u ≤ (4 : ℝ) · have hmem : u ∈ Set.Icc (2 : ℝ) 4 := ⟨le_of_not_gt hlow, hupper⟩ have hinner : ‖u‖ ^ k * ‖iteratedFDeriv ℝ n G u‖ ≤ B := hB ⟨u, hmem, rfl⟩ exact hinner.trans ((le_max_left B (‖c‖ * L)).trans (le_max_right 0 _)) · have hu4 : (4 : ℝ) < u := lt_of_not_ge hupper have hu3 : (3 : ℝ) < u := by linarith have hu0 : (0 : ℝ) < u := by linarith have hu1 : (1 : ℝ) ≤ u := by linarith have huoi : u ∈ Set.Ioi (1 : ℝ) := by change 1 < u linarith have hevent : G =ᶠ[𝓝 u] (fun v : ℝ => c * saddlePositiveContourMoment a 0 (D a) v) := by filter_upwards [Ioi_mem_nhds hu3] with v hv exact htail a ha v hv have hiter : iteratedDeriv n G u = c * saddlePositiveContourMoment a n (D a) u := by rw [hevent.iteratedDeriv_eq n, iteratedDeriv_const_mul_field, saddlePositiveContourMoment_iteratedDeriv_of_positiveContour (hD a ha) ha n 0 huoi] simp have hmoment : ‖saddlePositiveContourMoment a n (D a) u‖ ≤ u ^ (-a / 2 - (n : ℝ)) * L := by exact saddlePositiveContourMoment_norm_le (hD a ha) a n hu0 have hexponent : -a / 2 - (n : ℝ) ≤ -(k : ℝ) := by try dsimp [a] push_cast have hn : (0 : ℝ) ≤ (n : ℝ) := Nat.cast_nonneg n linarith have hpower : u ^ (-a / 2 - (n : ℝ)) ≤ u ^ (-(k : ℝ)) := Real.rpow_le_rpow_of_exponent_le hu1 hexponent have hcancel : u ^ k * u ^ (-(k : ℝ)) = 1 := by rw [Real.rpow_neg hu0.le, Real.rpow_natCast] exact mul_inv_cancel₀ (pow_ne_zero _ hu0.ne') have htailbound : ‖u‖ ^ k * ‖iteratedFDeriv ℝ n G u‖ ≤ ‖c‖ * L := by calc ‖u‖ ^ k * ‖iteratedFDeriv ℝ n G u‖ = u ^ k * (‖c‖ * ‖saddlePositiveContourMoment a n (D a) u‖) := by rw [norm_iteratedFDeriv_eq_norm_iteratedDeriv, hiter, norm_mul, Real.norm_of_nonneg hu0.le] _ ≤ u ^ k * (‖c‖ * (u ^ (-a / 2 - (n : ℝ)) * L)) := by gcongr _ ≤ u ^ k * (‖c‖ * (u ^ (-(k : ℝ)) * L)) := by gcongr _ = (u ^ k * u ^ (-(k : ℝ))) * (‖c‖ * L) := by ring _ = ‖c‖ * L := by rw [hcancel, one_mul] exact htailbound.trans ((le_max_right B (‖c‖ * L)).trans (le_max_right 0 _)) theorem plusSaddleOuterSquaredProfile_schwartz_decay {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (k n : ℕ) : ∃ C : ℝ, ∀ u : ℝ, ‖u‖ ^ k * ‖iteratedFDeriv ℝ n (plusSaddleOuterSquaredProfile ε ℓ) u‖ ≤ C := by apply saddleOuterSquaredProfile_schwartz_decay (plusSaddleOuterSquaredProfile_contDiff hε hℓ horder) (fun u hu => plusSaddleOuterSquaredProfile_eq_zero ε ℓ hu) (fun a t => plusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)) _ _ k n · intro a ha j exact plusSaddleMellinData_shiftedLine_moment_integrable hε hℓ horder (fun m => saddlePositiveContour_ne_pole ha m) j · intro a ha u hu simpa [plusSaddlePositiveSquaredContour] using! plusSaddleOuterSquaredProfile_eq_positiveContour hε hℓ horder ha hu theorem minusSaddleOuterSquaredProfile_schwartz_decay {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (k n : ℕ) : ∃ C : ℝ, ∀ u : ℝ, ‖u‖ ^ k * ‖iteratedFDeriv ℝ n (minusSaddleOuterSquaredProfile ε ℓ) u‖ ≤ C := by apply saddleOuterSquaredProfile_schwartz_decay (minusSaddleOuterSquaredProfile_contDiff hε hℓ horder) (fun u hu => minusSaddleOuterSquaredProfile_eq_zero ε ℓ hu) (fun a t => minusSaddleMellinData ε ℓ ((a : ℂ) + (t : ℂ) * Complex.I)) _ _ k n · intro a ha j exact minusSaddleMellinData_shiftedLine_moment_integrable hε hℓ horder (fun m => saddlePositiveContour_ne_pole ha m) j · intro a ha u hu simpa [minusSaddlePositiveSquaredContour] using! minusSaddleOuterSquaredProfile_eq_positiveContour hε hℓ horder ha hu def plusSaddleOuterScalarSchwartz {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) : 𝓢(ℝ, ℂ) where toFun := plusSaddleOuterSquaredProfile ε ℓ smooth' := plusSaddleOuterSquaredProfile_contDiff hε hℓ horder decay' := plusSaddleOuterSquaredProfile_schwartz_decay hε hℓ horder def minusSaddleOuterScalarSchwartz {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) : 𝓢(ℝ, ℂ) where toFun := minusSaddleOuterSquaredProfile ε ℓ smooth' := minusSaddleOuterSquaredProfile_contDiff hε hℓ horder decay' := minusSaddleOuterSquaredProfile_schwartz_decay hε hℓ horder def saddleSquaredSchwartzPullback (d : ℕ) : 𝓢(ℝ, ℂ) →L[ℂ] TestFunction d := by apply SchwartzMap.compCLM ℂ (Function.hasTemperateGrowth_norm_sq (Euclidean d)) refine ⟨1, 1, ?_⟩ intro x change ‖x‖ ≤ 1 * (1 + ‖‖x‖ ^ 2‖) ^ 1 rw [one_mul, pow_one, Real.norm_of_nonneg (sq_nonneg _)] nlinarith [sq_nonneg (‖x‖ - (1 / 2 : ℝ))] def plusSaddleOuterSchwartz {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (d : ℕ) : TestFunction d := saddleSquaredSchwartzPullback d (plusSaddleOuterScalarSchwartz hε hℓ horder) def minusSaddleOuterSchwartz {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (d : ℕ) : TestFunction d := saddleSquaredSchwartzPullback d (minusSaddleOuterScalarSchwartz hε hℓ horder) @[simp] theorem plusSaddleOuterSchwartz_apply {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (d : ℕ) (x : Euclidean d) : plusSaddleOuterSchwartz hε hℓ horder d x = plusSaddleOuterSquaredProfile ε ℓ (‖x‖ ^ 2) := rfl @[simp] theorem minusSaddleOuterSchwartz_apply {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (d : ℕ) (x : Euclidean d) : minusSaddleOuterSchwartz hε hℓ horder d x = minusSaddleOuterSquaredProfile ε ℓ (‖x‖ ^ 2) := rfl theorem plusSaddleOuterDifference_hasCompactSupport {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (d : ℕ) : HasCompactSupport (fun x : Euclidean d => plusSaddleProfile ε ℓ ‖x‖ - plusSaddleOuterSchwartz hε hℓ horder d x) := by apply HasCompactSupport.of_support_subset_isCompact (isCompact_closedBall (0 : Euclidean d) 2) intro x hx by_contra houtside have hr2 : (2 : ℝ) < ‖x‖ := by by_contra hnot apply houtside exact mem_closedBall_zero_iff.mpr (le_of_not_gt hnot) have hr : 0 < ‖x‖ := by linarith have hsquare : (3 : ℝ) < ‖x‖ ^ 2 := by nlinarith [sq_nonneg (‖x‖ - 2)] change plusSaddleProfile ε ℓ ‖x‖ - plusSaddleOuterSchwartz hε hℓ horder d x ≠ 0 at hx have houter : plusSaddleOuterSchwartz hε hℓ horder d x = plusSaddlePositiveSquaredContour ε ℓ 2 (‖x‖ ^ 2) := by rw [plusSaddleOuterSchwartz_apply] exact plusSaddleOuterSquaredProfile_eq_positiveContour (a := (2 : ℝ)) hε hℓ horder (by norm_num) hsquare have hsource : plusSaddleProfile ε ℓ ‖x‖ = plusSaddlePositiveSquaredContour ε ℓ 2 (‖x‖ ^ 2) := plusSaddleProfile_eq_positive_squaredContour (a := (2 : ℝ)) hε hℓ horder hr (by norm_num) exact hx (by rw [hsource, houter, sub_self]) theorem minusSaddleOuterDifference_hasCompactSupport {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (d : ℕ) : HasCompactSupport (fun x : Euclidean d => minusSaddleProfile ε ℓ ‖x‖ - minusSaddleOuterSchwartz hε hℓ horder d x) := by apply HasCompactSupport.of_support_subset_isCompact (isCompact_closedBall (0 : Euclidean d) 2) intro x hx by_contra houtside have hr2 : (2 : ℝ) < ‖x‖ := by by_contra hnot apply houtside exact mem_closedBall_zero_iff.mpr (le_of_not_gt hnot) have hr : 0 < ‖x‖ := by linarith have hsquare : (3 : ℝ) < ‖x‖ ^ 2 := by nlinarith [sq_nonneg (‖x‖ - 2)] change minusSaddleProfile ε ℓ ‖x‖ - minusSaddleOuterSchwartz hε hℓ horder d x ≠ 0 at hx have houter : minusSaddleOuterSchwartz hε hℓ horder d x = minusSaddlePositiveSquaredContour ε ℓ 2 (‖x‖ ^ 2) := by rw [minusSaddleOuterSchwartz_apply] exact minusSaddleOuterSquaredProfile_eq_positiveContour (a := (2 : ℝ)) hε hℓ horder (by norm_num) hsquare have hsource : minusSaddleProfile ε ℓ ‖x‖ = minusSaddlePositiveSquaredContour ε ℓ 2 (‖x‖ ^ 2) := minusSaddleProfile_eq_positive_squaredContour (a := (2 : ℝ)) hε hℓ horder hr (by norm_num) exact hx (by rw [hsource, houter, sub_self]) def plusSaddleSchwartz {ε : ℝ} (hε : 0 < ε) {d : ℕ} (hd : 0 < d) (horder : shortCutoff ε ≤ shortEndpoint ε) : TestFunction d where toFun := plusSaddleFunction ε d smooth' := plusSaddleFunction_contDiff hε hd horder decay' := by intro k n let ℓ : ℝ := (d : ℝ) / 2 have hℓ : 0 < ℓ := by try dsimp [ℓ] exact div_pos (by exact_mod_cast hd) (by norm_num) let tail : TestFunction d := plusSaddleOuterSchwartz hε hℓ horder d have hcompact : HasCompactSupport (fun x : Euclidean d => plusSaddleFunction ε d x - tail x) := by simpa [plusSaddleFunction, ℓ, tail] using! plusSaddleOuterDifference_hasCompactSupport hε hℓ horder d have hsmooth : ContDiff ℝ ∞ (fun x : Euclidean d => plusSaddleFunction ε d x - tail x) := (plusSaddleFunction_contDiff hε hd horder).sub (tail.smooth ⊤) let correction : TestFunction d := hcompact.toSchwartzMap hsmooth let full : TestFunction d := tail + correction have hfun : plusSaddleFunction ε d = (fun x : Euclidean d => full x) := by funext x change plusSaddleFunction ε d x = tail x + (plusSaddleFunction ε d x - tail x) ring rw [hfun] exact full.decay' k n def minusSaddleSchwartz {ε : ℝ} (hε : 0 < ε) {d : ℕ} (hd : 0 < d) (horder : shortCutoff ε ≤ shortEndpoint ε) : TestFunction d where toFun := minusSaddleFunction ε d smooth' := minusSaddleFunction_contDiff hε hd horder decay' := by intro k n let ℓ : ℝ := (d : ℝ) / 2 have hℓ : 0 < ℓ := by try dsimp [ℓ] exact div_pos (by exact_mod_cast hd) (by norm_num) let tail : TestFunction d := minusSaddleOuterSchwartz hε hℓ horder d have hcompact : HasCompactSupport (fun x : Euclidean d => minusSaddleFunction ε d x - tail x) := by simpa [minusSaddleFunction, ℓ, tail] using! minusSaddleOuterDifference_hasCompactSupport hε hℓ horder d have hsmooth : ContDiff ℝ ∞ (fun x : Euclidean d => minusSaddleFunction ε d x - tail x) := (minusSaddleFunction_contDiff hε hd horder).sub (tail.smooth ⊤) let correction : TestFunction d := hcompact.toSchwartzMap hsmooth let full : TestFunction d := tail + correction have hfun : minusSaddleFunction ε d = (fun x : Euclidean d => full x) := by funext x change minusSaddleFunction ε d x = tail x + (minusSaddleFunction ε d x - tail x) ring rw [hfun] exact full.decay' k n def saddleSourceContourEnvelopeScale (ε ℓ u : ℝ) : ℝ := Real.exp (-(ℓ * u) * Real.log Real.pi / 2) * Real.Gamma (ℓ * (1 + u) / 2) * Real.exp (ℓ * realHyperbolicShellPhase ε u) def saddleSourceContourDamping (ε ℓ u T : ℝ) : ℝ := upperGammaDamping ℓ (1 + u) T + positiveShellDamping ε ℓ (u - 1) T - upperShortShellDamping ε ℓ (u - 1) T theorem saddleSourceContourEnvelopeScale_pos {ε ℓ u : ℝ} (hℓ : 0 < ℓ) (hu : -1 < u) : 0 < saddleSourceContourEnvelopeScale ε ℓ u := by have hη : 0 < 1 + u := by linarith unfold saddleSourceContourEnvelopeScale exact mul_pos (mul_pos (Real.exp_pos _) (Real.Gamma_pos_of_pos (by positivity))) (Real.exp_pos _) theorem saddleSourceContour_piExponential_norm (ℓ u T : ℝ) : ‖Complex.exp (((ℓ : ℂ) - saddleSourceMellinContour ℓ u T) * (Real.log Real.pi : ℂ) / 2)‖ = Real.exp (-(ℓ * u) * Real.log Real.pi / 2) := by rw [Complex.norm_exp] congr 1 simp [saddleSourceMellinContour, Complex.mul_re] ring theorem saddleSourceContour_gamma_norm {ℓ u : ℝ} (hℓ : 0 < ℓ) (hu : -1 < u) (T : ℝ) : ‖Complex.Gamma (saddleSourceMellinContour ℓ u T / 2)‖ = Real.Gamma (ℓ * (1 + u) / 2) * Real.exp (-upperGammaDamping ℓ (1 + u) T) := by rw [saddleSourceMellinContour_gammaArgument] exact upperGammaShifted_modulus_eq_exp_neg_damping hℓ (by linarith) T theorem saddleSourceContour_shellExponential_norm {ε ℓ u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (T : ℝ) : ‖Complex.exp ((ℓ : ℂ) * mellinShellPhase ε (Complex.I * (saddleSourceMellinContour ℓ u T - (ℓ : ℂ)) / (ℓ : ℂ)))‖ = Real.exp (ℓ * realHyperbolicShellPhase ε u) * Real.exp (-(positiveShellDamping ε ℓ (u - 1) T - upperShortShellDamping ε ℓ (u - 1) T)) := by rw [saddleSourceMellinContour_shellArgument hℓ] exact norm_saddleShellExponential_eq_exp_neg_damping hε horder ℓ T u theorem saddleSourceContour_mellinEnvelope_norm {ε ℓ u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (hu : -1 < u) (horder : shortCutoff ε ≤ shortEndpoint ε) (T : ℝ) : ‖saddleMellinEnvelope ε ℓ (saddleSourceMellinContour ℓ u T)‖ = saddleSourceContourEnvelopeScale ε ℓ u * Real.exp (-saddleSourceContourDamping ε ℓ u T) := by have hπ := saddleSourceContour_piExponential_norm ℓ u T have hΓ := saddleSourceContour_gamma_norm hℓ hu T have hshell := saddleSourceContour_shellExponential_norm hε hℓ horder (u := u) T have hexp : Real.exp (-upperGammaDamping ℓ (1 + u) T) * Real.exp (-(positiveShellDamping ε ℓ (u - 1) T - upperShortShellDamping ε ℓ (u - 1) T)) = Real.exp (-saddleSourceContourDamping ε ℓ u T) := by rw [← Real.exp_add] congr 1 unfold saddleSourceContourDamping ring unfold saddleMellinEnvelope rw [norm_mul, norm_mul, hπ, hΓ, hshell] unfold saddleSourceContourEnvelopeScale rw [← hexp] ring def saddleSourceNormalizedEnvelope (ε ℓ u T : ℝ) : ℂ := saddleMellinEnvelope ε ℓ (saddleSourceMellinContour ℓ u T) / (saddleSourceContourEnvelopeScale ε ℓ u : ℂ) theorem saddleSourceNormalizedEnvelope_norm {ε ℓ u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (hu : -1 < u) (horder : shortCutoff ε ≤ shortEndpoint ε) (T : ℝ) : ‖saddleSourceNormalizedEnvelope ε ℓ u T‖ = Real.exp (-saddleSourceContourDamping ε ℓ u T) := by unfold saddleSourceNormalizedEnvelope rw [norm_div, saddleSourceContour_mellinEnvelope_norm hε hℓ hu horder T, Complex.norm_of_nonneg (saddleSourceContourEnvelopeScale_pos (ε := ε) hℓ hu).le, mul_div_cancel_left₀ _ (saddleSourceContourEnvelopeScale_pos (ε := ε) hℓ hu).ne'] def saddleSourceCenteredEnvelope (ε ℓ u v T : ℝ) : ℂ := saddleSourceNormalizedEnvelope ε ℓ u T * Complex.exp (Complex.I * ((ℓ * T * v : ℝ) : ℂ)) theorem saddleSourceCenteredEnvelope_norm {ε ℓ u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (hu : -1 < u) (horder : shortCutoff ε ≤ shortEndpoint ε) (v T : ℝ) : ‖saddleSourceCenteredEnvelope ε ℓ u v T‖ = Real.exp (-saddleSourceContourDamping ε ℓ u T) := by unfold saddleSourceCenteredEnvelope rw [norm_mul, saddleSourceNormalizedEnvelope_norm hε hℓ hu horder T, Complex.norm_exp_I_mul_ofReal, mul_one] def saddleSourceCenteredPlusIntegrand (ε ℓ u v T : ℝ) : ℂ := saddleSourceCenteredEnvelope ε ℓ u v T * plusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) def saddleSourceCenteredMinusIntegrand (ε ℓ u v T : ℝ) : ℂ := saddleSourceCenteredEnvelope ε ℓ u v T * minusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) theorem saddleSourceCenteredPlusIntegrand_norm {ε ℓ u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (hu : -1 < u) (horder : shortCutoff ε ≤ shortEndpoint ε) (v T : ℝ) : ‖saddleSourceCenteredPlusIntegrand ε ℓ u v T‖ = Real.exp (-saddleSourceContourDamping ε ℓ u T) * ‖plusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ))‖ := by unfold saddleSourceCenteredPlusIntegrand rw [norm_mul, saddleSourceCenteredEnvelope_norm hε hℓ hu horder] theorem saddleSourceCenteredMinusIntegrand_norm {ε ℓ u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (hu : -1 < u) (horder : shortCutoff ε ≤ shortEndpoint ε) (v T : ℝ) : ‖saddleSourceCenteredMinusIntegrand ε ℓ u v T‖ = Real.exp (-saddleSourceContourDamping ε ℓ u T) * ‖minusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ))‖ := by unfold saddleSourceCenteredMinusIntegrand rw [norm_mul, saddleSourceCenteredEnvelope_norm hε hℓ hu horder] @[simp] theorem saddleSourceContourDamping_eq_firstBranch (ε ℓ u T : ℝ) : saddleSourceContourDamping ε ℓ u T = upperFirstBranchSaddleDamping ε ℓ u T := rfl @[simp] theorem saddleSourceContourDamping_eq_secondBranch (ε ℓ δ T : ℝ) : saddleSourceContourDamping ε ℓ (1 + δ) T = upperSaddleDamping ε ℓ δ T := by have hη : 1 + (1 + δ) = 2 + δ := by ring have hδ : (1 + δ) - 1 = δ := by ring simp [saddleSourceContourDamping, upperSaddleDamping, hη, hδ] theorem saddleSourceMellinContour_integral_change {ℓ : ℝ} (hℓ : 0 < ℓ) (u : ℝ) (F : ℂ → ℂ) : (∫ t : ℝ, F (((ℓ * (1 + u) : ℝ) : ℂ) + (t : ℂ) * Complex.I)) = (ℓ : ℂ) * (∫ T : ℝ, F (saddleSourceMellinContour ℓ u T)) := by let a : ℝ := ℓ * (1 + u) let G : ℝ → ℂ := fun t => F ((a : ℂ) + (t : ℂ) * Complex.I) have harg (T : ℝ) : (a : ℂ) + (((-ℓ) * T : ℝ) : ℂ) * Complex.I = saddleSourceMellinContour ℓ u T := by try dsimp [a] unfold saddleSourceMellinContour push_cast ring have habs : |(-ℓ)⁻¹| = ℓ⁻¹ := by rw [inv_neg, abs_neg, abs_of_pos (inv_pos.mpr hℓ)] have hchange : (∫ T : ℝ, F (saddleSourceMellinContour ℓ u T)) = ((ℓ⁻¹ : ℝ) : ℂ) * (∫ t : ℝ, F ((a : ℂ) + (t : ℂ) * Complex.I)) := by calc (∫ T : ℝ, F (saddleSourceMellinContour ℓ u T)) = ∫ T : ℝ, G ((-ℓ) * T) := by apply MeasureTheory.integral_congr_ae filter_upwards [] with T try dsimp [G] rw [harg] _ = |(-ℓ)⁻¹| • ∫ t : ℝ, G t := MeasureTheory.Measure.integral_comp_mul_left G (-ℓ) _ = ((ℓ⁻¹ : ℝ) : ℂ) * (∫ t : ℝ, F ((a : ℂ) + (t : ℂ) * Complex.I)) := by rw [habs] simp [G, Complex.real_smul] change (∫ t : ℝ, F ((a : ℂ) + (t : ℂ) * Complex.I)) = (ℓ : ℂ) * (∫ T : ℝ, F (saddleSourceMellinContour ℓ u T)) rw [hchange] push_cast rw [← mul_assoc, mul_inv_cancel₀ (by exact_mod_cast hℓ.ne'), one_mul] theorem plusSaddleProfile_eq_sourceContourIntegral {ε ℓ r u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (hu : -1 < u) : plusSaddleProfile ε ℓ r = ((ℓ / (2 * Real.pi) : ℝ) : ℂ) * (∫ T : ℝ, saddleMellinInversePower r (saddleSourceMellinContour ℓ u T) * plusSaddleMellinData ε ℓ (saddleSourceMellinContour ℓ u T)) := by have ha : 0 < ℓ * (1 + u) := by have hη : 0 < 1 + u := by linarith positivity rw [plusSaddleProfile_eq_positive_contour (a := ℓ * (1 + u)) hε hℓ horder hr ha] rw [saddleSourceMellinContour_integral_change hℓ u (fun z : ℂ => saddleMellinInversePower r z * plusSaddleMellinData ε ℓ z)] push_cast ring theorem minusSaddleProfile_eq_sourceContourIntegral {ε ℓ r u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hr : 0 < r) (hu : -1 < u) : minusSaddleProfile ε ℓ r = ((ℓ / (2 * Real.pi) : ℝ) : ℂ) * (∫ T : ℝ, saddleMellinInversePower r (saddleSourceMellinContour ℓ u T) * minusSaddleMellinData ε ℓ (saddleSourceMellinContour ℓ u T)) := by have ha : 0 < ℓ * (1 + u) := by have hη : 0 < 1 + u := by linarith positivity rw [minusSaddleProfile_eq_positive_contour (a := ℓ * (1 + u)) hε hℓ horder hr ha] rw [saddleSourceMellinContour_integral_change hℓ u (fun z : ℂ => saddleMellinInversePower r z * minusSaddleMellinData ε ℓ z)] push_cast ring theorem saddleSourceContour_inversePower_exp (ℓ u v T : ℝ) : saddleMellinInversePower (Real.exp v) (saddleSourceMellinContour ℓ u T) = ((Real.exp (-(ℓ * (1 + u) * v)) : ℝ) : ℂ) * Complex.exp (Complex.I * ((ℓ * T * v : ℝ) : ℂ)) := by unfold saddleMellinInversePower rw [Complex.cpow_def_of_ne_zero (Complex.ofReal_ne_zero.mpr (Real.exp_pos v).ne'), ← Complex.ofReal_log (Real.exp_pos v).le, Real.log_exp, Complex.ofReal_exp, ← Complex.exp_add] congr 1 unfold saddleSourceMellinContour push_cast ring def saddleSourceCenteredPrefactor (ε ℓ u v : ℝ) : ℝ := (ℓ / (2 * Real.pi)) * Real.exp (-(ℓ * (1 + u) * v)) * saddleSourceContourEnvelopeScale ε ℓ u theorem saddleSourceCenteredPrefactor_pos {ε ℓ u : ℝ} (hℓ : 0 < ℓ) (hu : -1 < u) (v : ℝ) : 0 < saddleSourceCenteredPrefactor ε ℓ u v := by unfold saddleSourceCenteredPrefactor exact mul_pos (mul_pos (div_pos hℓ (by positivity)) (Real.exp_pos _)) (saddleSourceContourEnvelopeScale_pos (ε := ε) hℓ hu) theorem saddleSourceContour_envelope_eq_scale_mul_normalized {ε ℓ u : ℝ} (hℓ : 0 < ℓ) (hu : -1 < u) (T : ℝ) : saddleMellinEnvelope ε ℓ (saddleSourceMellinContour ℓ u T) = (saddleSourceContourEnvelopeScale ε ℓ u : ℂ) * saddleSourceNormalizedEnvelope ε ℓ u T := by unfold saddleSourceNormalizedEnvelope have hn : (saddleSourceContourEnvelopeScale ε ℓ u : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (saddleSourceContourEnvelopeScale_pos (ε := ε) hℓ hu).ne' field_simp [hn] theorem plusSaddleProfile_exp_eq_centeredIntegral {ε ℓ u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (hu : -1 < u) (horder : shortCutoff ε ≤ shortEndpoint ε) (v : ℝ) : plusSaddleProfile ε ℓ (Real.exp v) = (saddleSourceCenteredPrefactor ε ℓ u v : ℂ) * (∫ T : ℝ, saddleSourceCenteredPlusIntegrand ε ℓ u v T) := by rw [plusSaddleProfile_eq_sourceContourIntegral hε hℓ horder (Real.exp_pos v) hu] have hpoint (T : ℝ) : saddleMellinInversePower (Real.exp v) (saddleSourceMellinContour ℓ u T) * plusSaddleMellinData ε ℓ (saddleSourceMellinContour ℓ u T) = ((Real.exp (-(ℓ * (1 + u) * v)) * saddleSourceContourEnvelopeScale ε ℓ u : ℝ) : ℂ) * saddleSourceCenteredPlusIntegrand ε ℓ u v T := by rw [saddleSourceContour_inversePower_exp, plusSaddleMellinData, saddleSourceMellinContour_shellArgument hℓ, saddleSourceContour_envelope_eq_scale_mul_normalized hℓ hu T] unfold saddleSourceCenteredPlusIntegrand saddleSourceCenteredEnvelope push_cast ring have hintegral : (∫ T : ℝ, saddleMellinInversePower (Real.exp v) (saddleSourceMellinContour ℓ u T) * plusSaddleMellinData ε ℓ (saddleSourceMellinContour ℓ u T)) = ((Real.exp (-(ℓ * (1 + u) * v)) * saddleSourceContourEnvelopeScale ε ℓ u : ℝ) : ℂ) * (∫ T : ℝ, saddleSourceCenteredPlusIntegrand ε ℓ u v T) := by calc (∫ T : ℝ, saddleMellinInversePower (Real.exp v) (saddleSourceMellinContour ℓ u T) * plusSaddleMellinData ε ℓ (saddleSourceMellinContour ℓ u T)) = ∫ T : ℝ, ((Real.exp (-(ℓ * (1 + u) * v)) * saddleSourceContourEnvelopeScale ε ℓ u : ℝ) : ℂ) * saddleSourceCenteredPlusIntegrand ε ℓ u v T := by apply MeasureTheory.integral_congr_ae filter_upwards [] with T exact hpoint T _ = _ := integral_const_mul _ _ rw [hintegral] unfold saddleSourceCenteredPrefactor push_cast ring theorem minusSaddleProfile_exp_eq_centeredIntegral {ε ℓ u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (hu : -1 < u) (horder : shortCutoff ε ≤ shortEndpoint ε) (v : ℝ) : minusSaddleProfile ε ℓ (Real.exp v) = (saddleSourceCenteredPrefactor ε ℓ u v : ℂ) * (∫ T : ℝ, saddleSourceCenteredMinusIntegrand ε ℓ u v T) := by rw [minusSaddleProfile_eq_sourceContourIntegral hε hℓ horder (Real.exp_pos v) hu] have hpoint (T : ℝ) : saddleMellinInversePower (Real.exp v) (saddleSourceMellinContour ℓ u T) * minusSaddleMellinData ε ℓ (saddleSourceMellinContour ℓ u T) = ((Real.exp (-(ℓ * (1 + u) * v)) * saddleSourceContourEnvelopeScale ε ℓ u : ℝ) : ℂ) * saddleSourceCenteredMinusIntegrand ε ℓ u v T := by rw [saddleSourceContour_inversePower_exp, minusSaddleMellinData, saddleSourceMellinContour_shellArgument hℓ, saddleSourceContour_envelope_eq_scale_mul_normalized hℓ hu T] unfold saddleSourceCenteredMinusIntegrand saddleSourceCenteredEnvelope push_cast ring have hintegral : (∫ T : ℝ, saddleMellinInversePower (Real.exp v) (saddleSourceMellinContour ℓ u T) * minusSaddleMellinData ε ℓ (saddleSourceMellinContour ℓ u T)) = ((Real.exp (-(ℓ * (1 + u) * v)) * saddleSourceContourEnvelopeScale ε ℓ u : ℝ) : ℂ) * (∫ T : ℝ, saddleSourceCenteredMinusIntegrand ε ℓ u v T) := by calc (∫ T : ℝ, saddleMellinInversePower (Real.exp v) (saddleSourceMellinContour ℓ u T) * minusSaddleMellinData ε ℓ (saddleSourceMellinContour ℓ u T)) = ∫ T : ℝ, ((Real.exp (-(ℓ * (1 + u) * v)) * saddleSourceContourEnvelopeScale ε ℓ u : ℝ) : ℂ) * saddleSourceCenteredMinusIntegrand ε ℓ u v T := by apply MeasureTheory.integral_congr_ae filter_upwards [] with T exact hpoint T _ = _ := integral_const_mul _ _ rw [hintegral] unfold saddleSourceCenteredPrefactor push_cast ring def saddleSourceGaussianVariance (ε ℓ u : ℝ) : ℝ := upperSaddleVariance ε ℓ (u - 1) def saddleSourceGaussianKernel (ε ℓ u T : ℝ) : ℝ := Real.exp (-(ℓ * saddleSourceGaussianVariance ε ℓ u / 2) * T ^ 2) def saddleSourceGaussianPlusIntegrand (ε ℓ u T : ℝ) : ℂ := (saddleSourceGaussianKernel ε ℓ u T : ℂ) * plusPolynomial ε (Complex.I * (u : ℂ)) def saddleSourceGaussianMinusIntegrand (ε ℓ u T : ℝ) : ℂ := (saddleSourceGaussianKernel ε ℓ u T : ℂ) * minusPolynomial ε (Complex.I * (u : ℂ)) theorem saddleSourceGaussianKernel_integrable {ε ℓ u : ℝ} (hℓ : 0 < ℓ) (hV : 0 < saddleSourceGaussianVariance ε ℓ u) : Integrable (saddleSourceGaussianKernel ε ℓ u) := by unfold saddleSourceGaussianKernel exact integrable_exp_neg_mul_sq (by positivity) theorem saddleSourceGaussianKernel_integral (ε ℓ u : ℝ) : (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) = Real.sqrt (Real.pi / (ℓ * saddleSourceGaussianVariance ε ℓ u / 2)) := by exact integral_gaussian (ℓ * saddleSourceGaussianVariance ε ℓ u / 2) theorem saddleSourceGaussianKernel_integral_pos {ε ℓ u : ℝ} (hℓ : 0 < ℓ) (hV : 0 < saddleSourceGaussianVariance ε ℓ u) : 0 < ∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T := by rw [saddleSourceGaussianKernel_integral] positivity theorem saddleSourceGaussianPlusIntegrand_integrable {ε ℓ u : ℝ} (hℓ : 0 < ℓ) (hV : 0 < saddleSourceGaussianVariance ε ℓ u) : Integrable (saddleSourceGaussianPlusIntegrand ε ℓ u) := by unfold saddleSourceGaussianPlusIntegrand exact (saddleSourceGaussianKernel_integrable hℓ hV).ofReal.mul_const _ theorem saddleSourceGaussianMinusIntegrand_integrable {ε ℓ u : ℝ} (hℓ : 0 < ℓ) (hV : 0 < saddleSourceGaussianVariance ε ℓ u) : Integrable (saddleSourceGaussianMinusIntegrand ε ℓ u) := by unfold saddleSourceGaussianMinusIntegrand exact (saddleSourceGaussianKernel_integrable hℓ hV).ofReal.mul_const _ theorem saddleSourceGaussianPlusIntegrand_integral (ε ℓ u : ℝ) : (∫ T : ℝ, saddleSourceGaussianPlusIntegrand ε ℓ u T) = (Real.sqrt (Real.pi / (ℓ * saddleSourceGaussianVariance ε ℓ u / 2)) : ℂ) * plusPolynomial ε (Complex.I * (u : ℂ)) := by unfold saddleSourceGaussianPlusIntegrand rw [MeasureTheory.integral_mul_const, integral_complex_ofReal, saddleSourceGaussianKernel_integral] theorem saddleSourceGaussianMinusIntegrand_integral (ε ℓ u : ℝ) : (∫ T : ℝ, saddleSourceGaussianMinusIntegrand ε ℓ u T) = (Real.sqrt (Real.pi / (ℓ * saddleSourceGaussianVariance ε ℓ u / 2)) : ℂ) * minusPolynomial ε (Complex.I * (u : ℂ)) := by unfold saddleSourceGaussianMinusIntegrand rw [MeasureTheory.integral_mul_const, integral_complex_ofReal, saddleSourceGaussianKernel_integral] theorem eventually_saddleSourceGaussianVariance_secondBranch_pos : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ ℓ : ℝ, 0 < ℓ → ∀ δ : ℝ, ε / 2 ≤ δ → 0 < saddleSourceGaussianVariance ε ℓ (1 + δ) := by filter_upwards [eventually_upperSaddleVariance_pos] with ε hpositive intro ℓ hℓ δ hδ convert! hpositive ℓ hℓ δ hδ using 1 all_goals simp [saddleSourceGaussianVariance] theorem plusSaddleProfile_exp_re_pos_of_gaussian_error {ε ℓ u v : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (hu : -1 < u) (horder : shortCutoff ε ≤ shortEndpoint ε) (hV : 0 < saddleSourceGaussianVariance ε ℓ u) (herror : ‖(∫ T : ℝ, saddleSourceCenteredPlusIntegrand ε ℓ u v T) - (∫ T : ℝ, saddleSourceGaussianPlusIntegrand ε ℓ u T)‖ < (∫ T : ℝ, saddleSourceGaussianPlusIntegrand ε ℓ u T).re) : 0 < (plusSaddleProfile ε ℓ (Real.exp v)).re := by have _hV : 0 < saddleSourceGaussianVariance ε ℓ u := hV let J : ℂ := ∫ T : ℝ, saddleSourceCenteredPlusIntegrand ε ℓ u v T let G : ℂ := ∫ T : ℝ, saddleSourceGaussianPlusIntegrand ε ℓ u T have hreal : |(J - G).re| ≤ ‖J - G‖ := Complex.abs_re_le_norm _ have hpositive : 0 < J.re := by change ‖J - G‖ < G.re at herror have hlower : -‖J - G‖ ≤ (J - G).re := by have := (neg_le_of_abs_le hreal) exact this rw [Complex.sub_re] at hlower linarith rw [plusSaddleProfile_exp_eq_centeredIntegral hε hℓ hu horder v] change 0 < ((saddleSourceCenteredPrefactor ε ℓ u v : ℂ) * J).re simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero] exact mul_pos (saddleSourceCenteredPrefactor_pos hℓ hu v) hpositive theorem minusSaddleProfile_exp_re_neg_of_gaussian_error {ε ℓ u v : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (hu : -1 < u) (horder : shortCutoff ε ≤ shortEndpoint ε) (hV : 0 < saddleSourceGaussianVariance ε ℓ u) (herror : ‖(∫ T : ℝ, saddleSourceCenteredMinusIntegrand ε ℓ u v T) - (∫ T : ℝ, saddleSourceGaussianMinusIntegrand ε ℓ u T)‖ < -(∫ T : ℝ, saddleSourceGaussianMinusIntegrand ε ℓ u T).re) : (minusSaddleProfile ε ℓ (Real.exp v)).re < 0 := by have _hV : 0 < saddleSourceGaussianVariance ε ℓ u := hV let J : ℂ := ∫ T : ℝ, saddleSourceCenteredMinusIntegrand ε ℓ u v T let G : ℂ := ∫ T : ℝ, saddleSourceGaussianMinusIntegrand ε ℓ u T have hreal : |(J - G).re| ≤ ‖J - G‖ := Complex.abs_re_le_norm _ have hnegative : J.re < 0 := by change ‖J - G‖ < -G.re at herror have hupper : (J - G).re ≤ ‖J - G‖ := (le_abs_self _).trans hreal rw [Complex.sub_re] at hupper linarith rw [minusSaddleProfile_exp_eq_centeredIntegral hε hℓ hu horder v] change ((saddleSourceCenteredPrefactor ε ℓ u v : ℂ) * J).re < 0 simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero] exact mul_neg_of_pos_of_neg (saddleSourceCenteredPrefactor_pos hℓ hu v) hnegative theorem saddleSourcePositiveShellVariance_nonneg (ε δ : ℝ) : 0 ≤ upperPositiveShellVariance ε δ := by unfold upperPositiveShellVariance apply intervalIntegral.integral_nonneg (show shellLocation ε ≤ shellLocation ε + 1 by linarith) intro a ha unfold positiveShellDensity exact mul_nonneg (mul_nonneg (div_nonneg (shellWeight_pos ε).le (Real.cosh_pos a).le) (sq_nonneg a)) (Real.cosh_pos _).le theorem upperFirstBranch_shortVariance_le_gamma {ε ℓ u : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (hℓ : 0 < ℓ) (hulower : -1 < u) (huupper : u ≤ 1 + ε / 2) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) : upperShortShellVariance ε (u - 1) ≤ (1 - 4 * ε) * upperGammaVariance ℓ (1 + u) := by let a₀ : ℝ := shortCutoff ε let A : ℝ := shortEndpoint ε let η : ℝ := 1 + u let γ : ℝ → ℝ := fun a => a ^ 2 * upperGammaMeasureDensity ℓ η a have hη : 0 < η := by try dsimp [η] linarith have ha₀ : 0 < a₀ := by try dsimp [a₀, shortCutoff] positivity have hfactor : 0 ≤ 1 - 4 * ε := by linarith have hsubset : Ioc a₀ A ⊆ Ioi (0 : ℝ) := by intro a ha exact ha₀.trans ha.1 have hgamma : IntegrableOn γ (Ioi (0 : ℝ)) := by exact upperGammaVarianceDensity_integrable hℓ hη have hgammaOn : IntegrableOn γ (Ioc a₀ A) := hgamma.mono_set hsubset have hscaledOn : IntegrableOn (fun a : ℝ => (1 - 4 * ε) * γ a) (Ioc a₀ A) := hgammaOn.const_mul (1 - 4 * ε) have hs := shortShellDensity_intervalIntegrable hε horder have hcosh : Continuous (fun a : ℝ => Real.cosh (u * a)) := by fun_prop have hsquare : Continuous (fun a : ℝ => a ^ 2) := by fun_prop have hshortInterval : IntervalIntegrable (fun a : ℝ => ℓ * (-shortShellDensity ε a) * Real.cosh (u * a) * a ^ 2) volume a₀ A := by have hneg : IntervalIntegrable (fun a : ℝ => -shortShellDensity ε a) volume a₀ A := by simpa [a₀, A, Pi.neg_apply] using! hs.neg exact ((hneg.const_mul ℓ).mul_continuousOn hcosh.continuousOn).mul_continuousOn hsquare.continuousOn have hshortOn : IntegrableOn (fun a : ℝ => ℓ * (-shortShellDensity ε a) * Real.cosh (u * a) * a ^ 2) (Ioc a₀ A) := (intervalIntegrable_iff_integrableOn_Ioc_of_le (show a₀ ≤ A by exact horder)).mp hshortInterval have hpoint (a : ℝ) (ha : a ∈ Ioc a₀ A) : ℓ * (-shortShellDensity ε a) * Real.cosh (u * a) * a ^ 2 ≤ (1 - 4 * ε) * γ a := by have hcomparison := upperFirstBranch_shortMeasure_pointwise hε hεsmall hℓ (ha₀.trans ha.1) hulower.le huupper (hmargin a ⟨ha.1.le, ha.2⟩) have hmul := mul_le_mul_of_nonneg_right hcomparison (sq_nonneg a) simpa [γ, η, mul_assoc, mul_left_comm, mul_comm] using! hmul have hmono := setIntegral_mono_on hshortOn hscaledOn measurableSet_Ioc hpoint have hnonnegative : 0 ≤ᵐ[volume.restrict (Ioi (0 : ℝ))] γ := by filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha try dsimp [γ] exact mul_nonneg (sq_nonneg a) (upperGammaMeasureDensity_pos hℓ ha).le have haesubset : Ioc a₀ A ≤ᶠ[ae (volume : Measure ℝ)] Ioi 0 := Filter.Eventually.of_forall fun a ha => hsubset ha have hrestrict := setIntegral_mono_set hgamma hnonnegative haesubset have hscaleRestrict := mul_le_mul_of_nonneg_left hrestrict hfactor have hshortEq : ℓ * upperShortShellVariance ε (u - 1) = ∫ a : ℝ in Ioc a₀ A, ℓ * (-shortShellDensity ε a) * Real.cosh (u * a) * a ^ 2 := by unfold upperShortShellVariance have hu : 1 + (u - 1) = u := by ring rw [hu, ← intervalIntegral.integral_const_mul, intervalIntegral.integral_of_le horder] apply setIntegral_congr_fun measurableSet_Ioc intro a ha ring have hmain : ℓ * upperShortShellVariance ε (u - 1) ≤ (1 - 4 * ε) * ∫ a : ℝ in Ioi 0, γ a := by calc ℓ * upperShortShellVariance ε (u - 1) = ∫ a : ℝ in Ioc a₀ A, ℓ * (-shortShellDensity ε a) * Real.cosh (u * a) * a ^ 2 := hshortEq _ ≤ ∫ a : ℝ in Ioc a₀ A, (1 - 4 * ε) * γ a := hmono _ = (1 - 4 * ε) * ∫ a : ℝ in Ioc a₀ A, γ a := by rw [MeasureTheory.integral_const_mul] _ ≤ (1 - 4 * ε) * ∫ a : ℝ in Ioi 0, γ a := hscaleRestrict calc upperShortShellVariance ε (u - 1) = ℓ⁻¹ * (ℓ * upperShortShellVariance ε (u - 1)) := by field_simp [hℓ.ne'] _ ≤ ℓ⁻¹ * ((1 - 4 * ε) * ∫ a : ℝ in Ioi 0, γ a) := mul_le_mul_of_nonneg_left hmain (inv_pos.mpr hℓ).le _ = (1 - 4 * ε) * upperGammaVariance ℓ (1 + u) := by unfold upperGammaVariance try dsimp [γ, η] ring theorem upperFirstBranch_saddleSourceGaussianVariance_lower_bound {ε ℓ u : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (hℓ : 0 < ℓ) (hulower : -1 < u) (huupper : u ≤ 1 + ε / 2) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) : 4 * ε * upperGammaVariance ℓ (1 + u) ≤ saddleSourceGaussianVariance ε ℓ u := by have hshort := upperFirstBranch_shortVariance_le_gamma hε hεsmall hℓ hulower huupper horder hmargin have hpositive := saddleSourcePositiveShellVariance_nonneg ε (u - 1) unfold saddleSourceGaussianVariance upperSaddleVariance upperNetShellVariance have hη : 2 + (u - 1) = 1 + u := by ring rw [hη] nlinarith theorem eventually_saddleSourceGaussianVariance_firstBranch_pos : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ ℓ : ℝ, 0 < ℓ → ∀ u : ℝ, -1 < u → u ≤ 1 + ε / 2 → 0 < saddleSourceGaussianVariance ε ℓ u := by have hsmall : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ε ≤ 1 / 4 := by have htendsto : Tendsto (fun ε : ℝ => ε) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := tendsto_id.mono_left nhdsWithin_le_nhds filter_upwards [htendsto.eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1 / 4))] with ε hε exact hε.le filter_upwards [self_mem_nhdsWithin, hsmall, eventually_upper_shortCutoff_le_shortEndpoint, eventually_upper_shortMargin_positive] with ε hε hεsmall horder hmargin change 0 < ε at hε intro ℓ hℓ u hulower huupper have hη : 0 < 1 + u := by linarith have hgamma := (upperGammaVariance_bounds hℓ hη).1 have hgammaPos : 0 < upperGammaVariance ℓ (1 + u) := (show 0 < 1 / (2 * (1 + u)) by positivity).trans_le hgamma have hbound := upperFirstBranch_saddleSourceGaussianVariance_lower_bound hε hεsmall hℓ hulower huupper horder (fun a ha => (show (0 : ℝ) ≤ 1 / 2 by norm_num).trans (hmargin a ha)) exact (mul_pos (by positivity : 0 < 4 * ε) hgammaPos).trans_le hbound theorem saddleSourceCenteredPlusIntegrand_sourcePointwise {ε ℓ u : ℝ} (hℓ : 0 < ℓ) (hu : -1 < u) (v T : ℝ) : saddleMellinInversePower (Real.exp v) (saddleSourceMellinContour ℓ u T) * plusSaddleMellinData ε ℓ (saddleSourceMellinContour ℓ u T) = ((Real.exp (-(ℓ * (1 + u) * v)) * saddleSourceContourEnvelopeScale ε ℓ u : ℝ) : ℂ) * saddleSourceCenteredPlusIntegrand ε ℓ u v T := by rw [saddleSourceContour_inversePower_exp, plusSaddleMellinData, saddleSourceMellinContour_shellArgument hℓ, saddleSourceContour_envelope_eq_scale_mul_normalized hℓ hu T] unfold saddleSourceCenteredPlusIntegrand saddleSourceCenteredEnvelope push_cast ring theorem saddleSourceCenteredMinusIntegrand_sourcePointwise {ε ℓ u : ℝ} (hℓ : 0 < ℓ) (hu : -1 < u) (v T : ℝ) : saddleMellinInversePower (Real.exp v) (saddleSourceMellinContour ℓ u T) * minusSaddleMellinData ε ℓ (saddleSourceMellinContour ℓ u T) = ((Real.exp (-(ℓ * (1 + u) * v)) * saddleSourceContourEnvelopeScale ε ℓ u : ℝ) : ℂ) * saddleSourceCenteredMinusIntegrand ε ℓ u v T := by rw [saddleSourceContour_inversePower_exp, minusSaddleMellinData, saddleSourceMellinContour_shellArgument hℓ, saddleSourceContour_envelope_eq_scale_mul_normalized hℓ hu T] unfold saddleSourceCenteredMinusIntegrand saddleSourceCenteredEnvelope push_cast ring theorem saddleSourceCenteredPlusIntegrand_integrable {ε ℓ u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (hu : -1 < u) (horder : shortCutoff ε ≤ shortEndpoint ε) (v : ℝ) : Integrable (saddleSourceCenteredPlusIntegrand ε ℓ u v) := by let a : ℝ := ℓ * (1 + u) let c : ℂ := ((Real.exp (-(ℓ * (1 + u) * v)) * saddleSourceContourEnvelopeScale ε ℓ u : ℝ) : ℂ) have ha : 0 < a := by try dsimp [a] have : 0 < 1 + u := by linarith positivity have hline := plusSaddleMellinData_shiftedLine_weighted_integrable (a := a) (r := Real.exp v) hε hℓ horder (fun n => saddlePositiveContour_ne_pole ha n) (Real.exp_pos v) have hcomp := hline.comp_mul_left' (neg_ne_zero.mpr hℓ.ne') have hcontour : Integrable (fun T : ℝ => saddleMellinInversePower (Real.exp v) (saddleSourceMellinContour ℓ u T) * plusSaddleMellinData ε ℓ (saddleSourceMellinContour ℓ u T)) := by apply hcomp.congr filter_upwards [] with T have harg : (a : ℂ) + (((-ℓ) * T : ℝ) : ℂ) * Complex.I = saddleSourceMellinContour ℓ u T := by try dsimp [a] unfold saddleSourceMellinContour push_cast ring rw [harg] have hscaled : Integrable (fun T : ℝ => c * saddleSourceCenteredPlusIntegrand ε ℓ u v T) := by apply hcontour.congr filter_upwards [] with T exact saddleSourceCenteredPlusIntegrand_sourcePointwise hℓ hu v T have hc : c ≠ 0 := by try dsimp [c] apply Complex.ofReal_ne_zero.mpr exact (mul_pos (Real.exp_pos _) (saddleSourceContourEnvelopeScale_pos (ε := ε) hℓ hu)).ne' have hinverse := hscaled.const_mul c⁻¹ apply hinverse.congr filter_upwards [] with T rw [← mul_assoc, inv_mul_cancel₀ hc, one_mul] theorem saddleSourceCenteredMinusIntegrand_integrable {ε ℓ u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (hu : -1 < u) (horder : shortCutoff ε ≤ shortEndpoint ε) (v : ℝ) : Integrable (saddleSourceCenteredMinusIntegrand ε ℓ u v) := by let a : ℝ := ℓ * (1 + u) let c : ℂ := ((Real.exp (-(ℓ * (1 + u) * v)) * saddleSourceContourEnvelopeScale ε ℓ u : ℝ) : ℂ) have ha : 0 < a := by try dsimp [a] have : 0 < 1 + u := by linarith positivity have hline := minusSaddleMellinData_shiftedLine_weighted_integrable (a := a) (r := Real.exp v) hε hℓ horder (fun n => saddlePositiveContour_ne_pole ha n) (Real.exp_pos v) have hcomp := hline.comp_mul_left' (neg_ne_zero.mpr hℓ.ne') have hcontour : Integrable (fun T : ℝ => saddleMellinInversePower (Real.exp v) (saddleSourceMellinContour ℓ u T) * minusSaddleMellinData ε ℓ (saddleSourceMellinContour ℓ u T)) := by apply hcomp.congr filter_upwards [] with T have harg : (a : ℂ) + (((-ℓ) * T : ℝ) : ℂ) * Complex.I = saddleSourceMellinContour ℓ u T := by try dsimp [a] unfold saddleSourceMellinContour push_cast ring rw [harg] have hscaled : Integrable (fun T : ℝ => c * saddleSourceCenteredMinusIntegrand ε ℓ u v T) := by apply hcontour.congr filter_upwards [] with T exact saddleSourceCenteredMinusIntegrand_sourcePointwise hℓ hu v T have hc : c ≠ 0 := by try dsimp [c] apply Complex.ofReal_ne_zero.mpr exact (mul_pos (Real.exp_pos _) (saddleSourceContourEnvelopeScale_pos (ε := ε) hℓ hu)).ne' have hinverse := hscaled.const_mul c⁻¹ apply hinverse.congr filter_upwards [] with T rw [← mul_assoc, inv_mul_cancel₀ hc, one_mul] end noncomputable section open Filter MeasureTheory Set intervalIntegral open scoped Topology def upperImaginaryExp (x : ℝ) : ℂ := Complex.exp (Complex.I * (x : ℂ)) theorem upperImaginaryExp_hasDerivAt (x : ℝ) : HasDerivAt upperImaginaryExp (Complex.I * upperImaginaryExp x) x := by have hreal : HasDerivAt (fun t : ℝ => (t : ℂ)) (1 : ℂ) x := by simpa using! Complex.ofRealCLM.hasDerivAt have hlinear : HasDerivAt (fun t : ℝ => Complex.I * (t : ℂ)) Complex.I x := by convert! hreal.const_mul Complex.I using 1 all_goals simp convert! hlinear.cexp using 1 all_goals simp [upperImaginaryExp, mul_comm] theorem upperImaginaryExp_iteratedDeriv (n : ℕ) (x : ℝ) : iteratedDeriv n upperImaginaryExp x = Complex.I ^ n * upperImaginaryExp x := by induction n generalizing x with | zero => simp | succ n ih => rw [iteratedDeriv_succ] have heq : iteratedDeriv n upperImaginaryExp = fun t : ℝ => Complex.I ^ n * upperImaginaryExp t := by funext t exact ih t rw [heq] have hderiv := (upperImaginaryExp_hasDerivAt x).const_mul (Complex.I ^ n) rw [hderiv.deriv] rw [pow_succ] ring theorem upperImaginaryExp_norm (x : ℝ) : ‖upperImaginaryExp x‖ = 1 := by exact Complex.norm_exp_I_mul_ofReal x theorem upperImaginaryExp_contDiff : ContDiff ℝ (⊤ : WithTop ℕ∞) upperImaginaryExp := by unfold upperImaginaryExp have hreal : ContDiff ℝ (⊤ : WithTop ℕ∞) (fun x : ℝ => (x : ℂ)) := Complex.ofRealCLM.contDiff exact (contDiff_const.mul hreal).cexp theorem upperImaginaryExp_iteratedDeriv_norm (n : ℕ) (x : ℝ) : ‖iteratedDeriv n upperImaginaryExp x‖ = 1 := by rw [upperImaginaryExp_iteratedDeriv, norm_mul, norm_pow, upperImaginaryExp_norm] simp theorem upperImaginaryExp_iteratedDerivWithin_Icc {a b x : ℝ} (hab : a < b) (hx : x ∈ Icc a b) (n : ℕ) : iteratedDerivWithin n upperImaginaryExp (Icc a b) x = Complex.I ^ n * upperImaginaryExp x := by have hdiff : ContDiffAt ℝ (n : WithTop ℕ∞) upperImaginaryExp x := upperImaginaryExp_contDiff.contDiffAt.of_le le_top rw [iteratedDerivWithin_eq_iteratedDeriv (uniqueDiffOn_Icc hab) hdiff hx, upperImaginaryExp_iteratedDeriv] theorem upperImaginaryExp_taylorWithinEval_two {x : ℝ} (hx : 0 < x) : taylorWithinEval upperImaginaryExp 2 (Icc (0 : ℝ) x) 0 x = 1 + Complex.I * (x : ℂ) - ((x ^ 2 / 2 : ℝ) : ℂ) := by have hzero : (0 : ℝ) ∈ Icc (0 : ℝ) x := ⟨le_rfl, hx.le⟩ rw [show (2 : ℕ) = 1 + 1 by norm_num, taylorWithinEval_succ, taylorWithinEval_succ, taylor_within_zero_eval, upperImaginaryExp_iteratedDerivWithin_Icc hx hzero 1, upperImaginaryExp_iteratedDerivWithin_Icc hx hzero 2] simp [upperImaginaryExp, Complex.real_smul] ring theorem upperImaginaryExp_cubicIntegral_norm_le {x : ℝ} (hx : 0 ≤ x) : ‖∫ t in (0 : ℝ)..x, ((x - t) ^ 2 / 2 : ℝ) • iteratedDeriv 3 upperImaginaryExp t‖ ≤ x ^ 3 / 6 := by have hcont : Continuous (fun t : ℝ => (x - t) ^ 2 / 2) := by fun_prop have hint : IntervalIntegrable (fun t : ℝ => (x - t) ^ 2 / 2) volume 0 x := hcont.intervalIntegrable 0 x have hnorm : ‖∫ t in (0 : ℝ)..x, ((x - t) ^ 2 / 2 : ℝ) • iteratedDeriv 3 upperImaginaryExp t‖ ≤ ∫ t in (0 : ℝ)..x, (x - t) ^ 2 / 2 := by apply intervalIntegral.norm_integral_le_of_norm_le hx · filter_upwards [] with t ht rw [norm_smul, Real.norm_eq_abs, upperImaginaryExp_iteratedDeriv_norm, mul_one, abs_of_nonneg (by positivity)] · exact hint have hprimitive (t : ℝ) : HasDerivAt (fun z : ℝ => -(x - z) ^ 3 / 6) ((x - t) ^ 2 / 2) t := by convert! (((hasDerivAt_const t x).sub (hasDerivAt_id t)).pow 3).neg.div_const 6 using 1 all_goals simp [Pi.sub_apply, id] ring calc ‖∫ t in (0 : ℝ)..x, ((x - t) ^ 2 / 2 : ℝ) • iteratedDeriv 3 upperImaginaryExp t‖ ≤ ∫ t in (0 : ℝ)..x, (x - t) ^ 2 / 2 := hnorm _ = x ^ 3 / 6 := by rw [intervalIntegral.integral_eq_sub_of_hasDerivAt (fun t _ => hprimitive t) hint] ring theorem upperImaginaryExp_neg (x : ℝ) : upperImaginaryExp (-x) = starRingEnd ℂ (upperImaginaryExp x) := by apply Complex.ext <;> simp [upperImaginaryExp, Complex.exp_re, Complex.exp_im, Real.cos_neg, Real.sin_neg] theorem upperImaginaryExp_quadratic_remainder_norm_le_of_nonneg {x : ℝ} (hx : 0 ≤ x) : ‖upperImaginaryExp x - 1 - Complex.I * (x : ℂ) + ((x ^ 2 / 2 : ℝ) : ℂ)‖ ≤ x ^ 3 / 6 := by rcases hx.eq_or_lt with rfl | hxpos · simp [upperImaginaryExp] have hcont : ContDiffOn ℝ (3 : ℕ) upperImaginaryExp (Set.uIcc 0 x) := (upperImaginaryExp_contDiff.of_le (by simp : (3 : WithTop ℕ∞) ≤ ⊤)).contDiffOn have htaylor := taylor_integral_remainder (f := upperImaginaryExp) (x := x) (x₀ := 0) (n := 2) hcont rw [Set.uIcc_of_le hx, upperImaginaryExp_taylorWithinEval_two hxpos] at htaylor have hremainder : upperImaginaryExp x - 1 - Complex.I * (x : ℂ) + ((x ^ 2 / 2 : ℝ) : ℂ) = ∫ t in (0 : ℝ)..x, ((x - t) ^ 2 / 2 : ℝ) • iteratedDeriv 3 upperImaginaryExp t := by calc upperImaginaryExp x - 1 - Complex.I * (x : ℂ) + ((x ^ 2 / 2 : ℝ) : ℂ) = upperImaginaryExp x - (1 + Complex.I * (x : ℂ) - ((x ^ 2 / 2 : ℝ) : ℂ)) := by ring _ = ∫ t in (0 : ℝ)..x, ((x - t) ^ 2 / (Nat.factorial 2 : ℝ)) • iteratedDerivWithin 3 upperImaginaryExp (Icc (0 : ℝ) x) t := htaylor _ = ∫ t in (0 : ℝ)..x, ((x - t) ^ 2 / 2 : ℝ) • iteratedDeriv 3 upperImaginaryExp t := by apply intervalIntegral.integral_congr intro t ht rw [Set.uIcc_of_le hx] at ht change ((x - t) ^ 2 / (Nat.factorial 2 : ℝ)) • iteratedDerivWithin 3 upperImaginaryExp (Icc (0 : ℝ) x) t = ((x - t) ^ 2 / 2 : ℝ) • iteratedDeriv 3 upperImaginaryExp t rw [upperImaginaryExp_iteratedDerivWithin_Icc hxpos ht 3, ← upperImaginaryExp_iteratedDeriv 3 t] norm_num rw [hremainder] exact upperImaginaryExp_cubicIntegral_norm_le hx theorem upperImaginaryExp_quadratic_remainder_norm_le (x : ℝ) : ‖upperImaginaryExp x - 1 - Complex.I * (x : ℂ) + ((x ^ 2 / 2 : ℝ) : ℂ)‖ ≤ |x| ^ 3 / 6 := by by_cases hx : 0 ≤ x · simpa [abs_of_nonneg hx] using! upperImaginaryExp_quadratic_remainder_norm_le_of_nonneg hx · have hxnegative : x < 0 := lt_of_not_ge hx have hf : upperImaginaryExp x = starRingEnd ℂ (upperImaginaryExp (-x)) := by simpa using! upperImaginaryExp_neg (-x) have hconj : upperImaginaryExp x - 1 - Complex.I * (x : ℂ) + ((x ^ 2 / 2 : ℝ) : ℂ) = starRingEnd ℂ (upperImaginaryExp (-x) - 1 - Complex.I * ((-x : ℝ) : ℂ) + (((-x) ^ 2 / 2 : ℝ) : ℂ)) := by have htwo : starRingEnd ℂ (2 : ℂ) = 2 := by simpa using! Complex.conj_ofReal (2 : ℝ) rw [hf] simp [htwo] ring calc ‖upperImaginaryExp x - 1 - Complex.I * (x : ℂ) + ((x ^ 2 / 2 : ℝ) : ℂ)‖ = ‖upperImaginaryExp (-x) - 1 - Complex.I * ((-x : ℝ) : ℂ) + (((-x) ^ 2 / 2 : ℝ) : ℂ)‖ := by rw [hconj, Complex.norm_conj] _ ≤ (-x) ^ 3 / 6 := upperImaginaryExp_quadratic_remainder_norm_le_of_nonneg (by linarith) _ = |x| ^ 3 / 6 := by rw [abs_of_neg hxnegative] def upperGammaCenteredKernel (ℓ η T a : ℝ) : ℂ := (upperImaginaryExp (a * T) - 1 - Complex.I * ((a * T : ℝ) : ℂ)) * (upperGammaMeasureDensity ℓ η a : ℂ) def upperGammaCenteredPhase (ℓ η T : ℝ) : ℂ := ∫ a : ℝ in Ioi 0, upperGammaCenteredKernel ℓ η T a end noncomputable section open Filter Set MeasureTheory intervalIntegral open scoped Topology theorem saddleSourceShiftedCosine_eq_imaginaryExponentials (a u T : ℝ) : Complex.cos ((a : ℂ) * ((T : ℂ) + Complex.I * (u : ℂ))) = ((Real.exp (-(u * a)) / 2 : ℝ) : ℂ) * upperImaginaryExp (a * T) + ((Real.exp (u * a) / 2 : ℝ) : ℂ) * upperImaginaryExp (-(a * T)) := by have hfirst : Complex.exp (((a : ℂ) * ((T : ℂ) + Complex.I * (u : ℂ))) * Complex.I) = (Real.exp (-(u * a)) : ℂ) * upperImaginaryExp (a * T) := by unfold upperImaginaryExp rw [Complex.ofReal_exp, ← Complex.exp_add] congr 1 push_cast ring_nf simp [Complex.I_sq] ring have hsecond : Complex.exp (-((a : ℂ) * ((T : ℂ) + Complex.I * (u : ℂ))) * Complex.I) = (Real.exp (u * a) : ℂ) * upperImaginaryExp (-(a * T)) := by unfold upperImaginaryExp rw [Complex.ofReal_exp, ← Complex.exp_add] congr 1 push_cast ring_nf simp [Complex.I_sq] unfold Complex.cos rw [hfirst, hsecond] push_cast ring def saddleSourceCosineQuadraticRemainder (a u T : ℝ) : ℂ := Complex.cos ((a : ℂ) * ((T : ℂ) + Complex.I * (u : ℂ))) - (Real.cosh (u * a) : ℂ) + Complex.I * ((a * T * Real.sinh (u * a) : ℝ) : ℂ) + ((a ^ 2 * T ^ 2 / 2 * Real.cosh (u * a) : ℝ) : ℂ) theorem saddleSourceCosineQuadraticRemainder_eq (a u T : ℝ) : saddleSourceCosineQuadraticRemainder a u T = ((Real.exp (-(u * a)) / 2 : ℝ) : ℂ) * (upperImaginaryExp (a * T) - 1 - Complex.I * ((a * T : ℝ) : ℂ) + (((a * T) ^ 2 / 2 : ℝ) : ℂ)) + ((Real.exp (u * a) / 2 : ℝ) : ℂ) * (upperImaginaryExp (-(a * T)) - 1 - Complex.I * ((-(a * T) : ℝ) : ℂ) + (((-(a * T)) ^ 2 / 2 : ℝ) : ℂ)) := by unfold saddleSourceCosineQuadraticRemainder rw [saddleSourceShiftedCosine_eq_imaginaryExponentials, Real.cosh_eq, Real.sinh_eq] push_cast ring theorem saddleSourceCosineQuadraticRemainder_norm_le (a u T : ℝ) : ‖saddleSourceCosineQuadraticRemainder a u T‖ ≤ Real.cosh (u * a) * |a * T| ^ 3 / 6 := by rw [saddleSourceCosineQuadraticRemainder_eq] have hfirst := upperImaginaryExp_quadratic_remainder_norm_le (a * T) have hsecond := upperImaginaryExp_quadratic_remainder_norm_le (-(a * T)) have hwfirst : 0 ≤ Real.exp (-(u * a)) / 2 := by positivity have hwsecond : 0 ≤ Real.exp (u * a) / 2 := by positivity calc ‖((Real.exp (-(u * a)) / 2 : ℝ) : ℂ) * (upperImaginaryExp (a * T) - 1 - Complex.I * ((a * T : ℝ) : ℂ) + (((a * T) ^ 2 / 2 : ℝ) : ℂ)) + ((Real.exp (u * a) / 2 : ℝ) : ℂ) * (upperImaginaryExp (-(a * T)) - 1 - Complex.I * ((-(a * T) : ℝ) : ℂ) + (((-(a * T)) ^ 2 / 2 : ℝ) : ℂ))‖ ≤ ‖((Real.exp (-(u * a)) / 2 : ℝ) : ℂ) * (upperImaginaryExp (a * T) - 1 - Complex.I * ((a * T : ℝ) : ℂ) + (((a * T) ^ 2 / 2 : ℝ) : ℂ))‖ + ‖((Real.exp (u * a) / 2 : ℝ) : ℂ) * (upperImaginaryExp (-(a * T)) - 1 - Complex.I * ((-(a * T) : ℝ) : ℂ) + (((-(a * T)) ^ 2 / 2 : ℝ) : ℂ))‖ := norm_add_le _ _ _ = (Real.exp (-(u * a)) / 2) * ‖upperImaginaryExp (a * T) - 1 - Complex.I * ((a * T : ℝ) : ℂ) + (((a * T) ^ 2 / 2 : ℝ) : ℂ)‖ + (Real.exp (u * a) / 2) * ‖upperImaginaryExp (-(a * T)) - 1 - Complex.I * ((-(a * T) : ℝ) : ℂ) + (((-(a * T)) ^ 2 / 2 : ℝ) : ℂ)‖ := by simp only [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hwfirst, abs_of_nonneg hwsecond] _ ≤ (Real.exp (-(u * a)) / 2) * (|a * T| ^ 3 / 6) + (Real.exp (u * a) / 2) * (|a * T| ^ 3 / 6) := by have hsecond' : ‖upperImaginaryExp (-(a * T)) - 1 - Complex.I * ((-(a * T) : ℝ) : ℂ) + (((-(a * T)) ^ 2 / 2 : ℝ) : ℂ)‖ ≤ |a * T| ^ 3 / 6 := by simpa [abs_neg] using! hsecond gcongr _ = Real.cosh (u * a) * |a * T| ^ 3 / 6 := by rw [Real.cosh_eq] ring theorem saddleSourceWeightedCosineQuadraticRemainder_norm_le (w : ℝ → ℝ) {b c : ℝ} (hbc : b ≤ c) (hb : 0 ≤ b) (hw : ContinuousOn w (Icc b c)) (hwnonneg : ∀ a ∈ Icc b c, 0 ≤ w a) (u T : ℝ) : ‖∫ a in b..c, (w a : ℂ) * saddleSourceCosineQuadraticRemainder a u T‖ ≤ (|T| ^ 3 / 6) * ∫ a in b..c, w a * a ^ 3 * Real.cosh (u * a) := by let g : ℝ → ℝ := fun a => (|T| ^ 3 / 6) * (w a * a ^ 3 * Real.cosh (u * a)) have hbase : ContinuousOn (fun a : ℝ => w a * a ^ 3 * Real.cosh (u * a)) (Icc b c) := (hw.mul (continuous_id.pow 3).continuousOn).mul (by fun_prop) have hg : IntervalIntegrable g volume b c := by try dsimp [g] exact (continuousOn_const.mul hbase).intervalIntegrable_of_Icc hbc have hpoint (a : ℝ) (ha : a ∈ Ioc b c) : ‖(w a : ℂ) * saddleSourceCosineQuadraticRemainder a u T‖ ≤ g a := by have hmem : a ∈ Icc b c := ⟨ha.1.le, ha.2⟩ have hwa : 0 ≤ w a := hwnonneg a hmem have haa : 0 ≤ a := hb.trans ha.1.le rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hwa] calc w a * ‖saddleSourceCosineQuadraticRemainder a u T‖ ≤ w a * (Real.cosh (u * a) * |a * T| ^ 3 / 6) := mul_le_mul_of_nonneg_left (saddleSourceCosineQuadraticRemainder_norm_le a u T) hwa _ = g a := by try dsimp [g] rw [abs_mul, abs_of_nonneg haa] ring calc ‖∫ a in b..c, (w a : ℂ) * saddleSourceCosineQuadraticRemainder a u T‖ ≤ ∫ a in b..c, g a := by apply intervalIntegral.norm_integral_le_of_norm_le hbc _ hg filter_upwards [] with a ha exact hpoint a ha _ = (|T| ^ 3 / 6) * ∫ a in b..c, w a * a ^ 3 * Real.cosh (u * a) := by try dsimp [g] rw [intervalIntegral.integral_const_mul] theorem saddleSourcePositiveShellQuadraticRemainder_norm_le {ε : ℝ} (hε : 0 < ε) (u T : ℝ) : ‖∫ a in shellLocation ε..shellLocation ε + 1, (positiveShellDensity ε a : ℂ) * saddleSourceCosineQuadraticRemainder a u T‖ ≤ (|T| ^ 3 / 6) * upperPositiveShellThirdMoment ε (u - 1) := by have hB : 0 ≤ shellLocation ε := by unfold shellLocation positivity have hbound := saddleSourceWeightedCosineQuadraticRemainder_norm_le (positiveShellDensity ε) (show shellLocation ε ≤ shellLocation ε + 1 by linarith) hB (positiveShellDensity_continuous ε).continuousOn (fun a ha => by unfold positiveShellDensity exact div_nonneg (shellWeight_pos ε).le (Real.cosh_pos a).le) u T convert! hbound using 1 unfold upperPositiveShellThirdMoment congr 1 apply intervalIntegral.integral_congr intro a ha ring_nf theorem saddleSourceShortShellQuadraticRemainder_norm_le {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) (u T : ℝ) : ‖∫ a in shortCutoff ε..shortEndpoint ε, (shortShellDensity ε a : ℂ) * saddleSourceCosineQuadraticRemainder a u T‖ ≤ (|T| ^ 3 / 6) * upperShortShellThirdMoment ε (u - 1) := by have ha₀ : 0 ≤ shortCutoff ε := by unfold shortCutoff positivity have hnegative : ContinuousOn (fun a : ℝ => -shortShellDensity ε a) (Icc (shortCutoff ε) (shortEndpoint ε)) := (shortShellDensity_continuousOn_support hε).neg have hnonnegative (a : ℝ) (ha : a ∈ Icc (shortCutoff ε) (shortEndpoint ε)) : 0 ≤ -shortShellDensity ε a := by have hapos : 0 < a := by have : 0 < shortCutoff ε := by unfold shortCutoff positivity exact this.trans_le ha.1 unfold shortShellDensity have hm : 0 ≤ shortMargin ε a := hmargin a ha have hd : 0 < 2 * a ^ 2 * Real.cosh a := by positivity simpa using! div_nonneg (mul_nonneg hm (Real.exp_pos _).le) hd.le have hbound := saddleSourceWeightedCosineQuadraticRemainder_norm_le (fun a : ℝ => -shortShellDensity ε a) horder ha₀ hnegative hnonnegative u T have hnorm : ‖∫ a in shortCutoff ε..shortEndpoint ε, (shortShellDensity ε a : ℂ) * saddleSourceCosineQuadraticRemainder a u T‖ = ‖∫ a in shortCutoff ε..shortEndpoint ε, ((-shortShellDensity ε a : ℝ) : ℂ) * saddleSourceCosineQuadraticRemainder a u T‖ := by have heq : (∫ a in shortCutoff ε..shortEndpoint ε, ((-shortShellDensity ε a : ℝ) : ℂ) * saddleSourceCosineQuadraticRemainder a u T) = -(∫ a in shortCutoff ε..shortEndpoint ε, (shortShellDensity ε a : ℂ) * saddleSourceCosineQuadraticRemainder a u T) := by rw [← intervalIntegral.integral_neg] apply intervalIntegral.integral_congr intro a ha push_cast ring rw [heq, norm_neg] rw [hnorm] convert! hbound using 1 unfold upperShortShellThirdMoment congr 1 apply intervalIntegral.integral_congr intro a ha ring_nf theorem saddleSourceWeightedCosineQuadraticRemainder_integral_eq (w : ℝ → ℝ) {b c : ℝ} (hbc : b ≤ c) (hw : ContinuousOn w (Icc b c)) (u T : ℝ) : (∫ a in b..c, (w a : ℂ) * saddleSourceCosineQuadraticRemainder a u T) = (∫ a in b..c, (w a : ℂ) * (Complex.cos ((a : ℂ) * ((T : ℂ) + Complex.I * (u : ℂ))) - 1)) - (∫ a in b..c, (w a : ℂ) * ((Real.cosh (u * a) : ℂ) - 1)) + Complex.I * ((T * ∫ a in b..c, w a * a * Real.sinh (u * a) : ℝ) : ℂ) + ((T ^ 2 / 2 * ∫ a in b..c, w a * a ^ 2 * Real.cosh (u * a) : ℝ) : ℂ) := by let F : ℝ → ℂ := fun a => (w a : ℂ) * (Complex.cos ((a : ℂ) * ((T : ℂ) + Complex.I * (u : ℂ))) - 1) let H : ℝ → ℝ := fun a => w a * (Real.cosh (u * a) - 1) let L : ℝ → ℝ := fun a => w a * a * Real.sinh (u * a) let V : ℝ → ℝ := fun a => w a * a ^ 2 * Real.cosh (u * a) have hwc : ContinuousOn (fun a : ℝ => (w a : ℂ)) (Icc b c) := Complex.ofRealCLM.continuous.comp_continuousOn hw have hkernel : Continuous (fun a : ℝ => Complex.cos ((a : ℂ) * ((T : ℂ) + Complex.I * (u : ℂ))) - 1) := by fun_prop have hF : IntervalIntegrable F volume b c := (hwc.mul hkernel.continuousOn).intervalIntegrable_of_Icc hbc have hHreal : ContinuousOn H (Icc b c) := by try dsimp [H] exact hw.mul (by fun_prop) have hLreal : ContinuousOn L (Icc b c) := by try dsimp [L] exact (hw.mul continuous_id.continuousOn).mul (by fun_prop) have hVreal : ContinuousOn V (Icc b c) := by try dsimp [V] exact (hw.mul (continuous_id.pow 2).continuousOn).mul (by fun_prop) have hH : IntervalIntegrable (fun a : ℝ => (H a : ℂ)) volume b c := (Complex.ofRealCLM.continuous.comp_continuousOn hHreal).intervalIntegrable_of_Icc hbc have hL : IntervalIntegrable (fun a : ℝ => (L a : ℂ)) volume b c := (Complex.ofRealCLM.continuous.comp_continuousOn hLreal).intervalIntegrable_of_Icc hbc have hV : IntervalIntegrable (fun a : ℝ => (V a : ℂ)) volume b c := (Complex.ofRealCLM.continuous.comp_continuousOn hVreal).intervalIntegrable_of_Icc hbc have hlinear := hL.const_mul (Complex.I * (T : ℂ)) have hquadratic := hV.const_mul (((T ^ 2 / 2 : ℝ) : ℂ)) have hHcomplex : (∫ a in b..c, (H a : ℂ)) = ∫ a in b..c, (w a : ℂ) * ((Real.cosh (u * a) : ℂ) - 1) := by apply intervalIntegral.integral_congr intro a ha try dsimp [H] push_cast ring calc (∫ a in b..c, (w a : ℂ) * saddleSourceCosineQuadraticRemainder a u T) = ∫ a in b..c, (F a - (H a : ℂ) + (Complex.I * (T : ℂ)) * (L a : ℂ) + ((T ^ 2 / 2 : ℝ) : ℂ) * (V a : ℂ)) := by apply intervalIntegral.integral_congr intro a ha try dsimp [F, H, L, V] unfold saddleSourceCosineQuadraticRemainder push_cast ring _ = ((∫ a in b..c, F a) - (∫ a in b..c, (H a : ℂ)) + (Complex.I * (T : ℂ)) * (∫ a in b..c, (L a : ℂ))) + ((T ^ 2 / 2 : ℝ) : ℂ) * (∫ a in b..c, (V a : ℂ)) := by rw [intervalIntegral.integral_add ((hF.sub hH).add hlinear) hquadratic] rw [intervalIntegral.integral_add (hF.sub hH) hlinear] rw [intervalIntegral.integral_sub hF hH] rw [intervalIntegral.integral_const_mul, intervalIntegral.integral_const_mul] _ = _ := by rw [hHcomplex] conv_lhs => rw [intervalIntegral.integral_ofReal, intervalIntegral.integral_ofReal] try dsimp only [F, L, V] simp only [Complex.ofReal_mul, Complex.ofReal_div, Complex.ofReal_pow, Complex.ofReal_ofNat] ring def saddleSourceShellCenteredPhase (ε ℓ u T : ℝ) : ℂ := (ℓ : ℂ) * (mellinShellPhase ε ((T : ℂ) + Complex.I * (u : ℂ)) - (realHyperbolicShellPhase ε u : ℂ) + Complex.I * ((T * saddleSourceShellDerivative ε u : ℝ) : ℂ)) def saddleSourceShellQuadraticRemainder (ε u T : ℝ) : ℂ := (∫ a in shortCutoff ε..shortEndpoint ε, (shortShellDensity ε a : ℂ) * saddleSourceCosineQuadraticRemainder a u T) + (∫ a in shellLocation ε..shellLocation ε + 1, (positiveShellDensity ε a : ℂ) * saddleSourceCosineQuadraticRemainder a u T) theorem saddleSourceShellQuadraticRemainder_eq {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (u T : ℝ) : saddleSourceShellQuadraticRemainder ε u T = mellinShellPhase ε ((T : ℂ) + Complex.I * (u : ℂ)) - (realHyperbolicShellPhase ε u : ℂ) + Complex.I * ((T * saddleSourceShellDerivative ε u : ℝ) : ℂ) + ((T ^ 2 / 2 * upperNetShellVariance ε (u - 1) : ℝ) : ℂ) := by let Fs : ℂ := ∫ a in shortCutoff ε..shortEndpoint ε, (shortShellDensity ε a : ℂ) * (Complex.cos ((a : ℂ) * ((T : ℂ) + Complex.I * (u : ℂ))) - 1) let Fp : ℂ := ∫ a in shellLocation ε..shellLocation ε + 1, (positiveShellDensity ε a : ℂ) * (Complex.cos ((a : ℂ) * ((T : ℂ) + Complex.I * (u : ℂ))) - 1) let Hs : ℂ := ∫ a in shortCutoff ε..shortEndpoint ε, (shortShellDensity ε a : ℂ) * ((Real.cosh (u * a) : ℂ) - 1) let Hp : ℂ := ∫ a in shellLocation ε..shellLocation ε + 1, (positiveShellDensity ε a : ℂ) * ((Real.cosh (u * a) : ℂ) - 1) let Ls : ℝ := ∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * a * Real.sinh (u * a) let Lp : ℝ := ∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * a * Real.sinh (u * a) let Vs : ℝ := upperShortShellVariance ε (u - 1) let Vp : ℝ := upperPositiveShellVariance ε (u - 1) have hshort := saddleSourceWeightedCosineQuadraticRemainder_integral_eq (shortShellDensity ε) horder (shortShellDensity_continuousOn_support hε) u T have hpositive := saddleSourceWeightedCosineQuadraticRemainder_integral_eq (positiveShellDensity ε) (show shellLocation ε ≤ shellLocation ε + 1 by linarith) (positiveShellDensity_continuous ε).continuousOn u T have hvariance : (∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * a ^ 2 * Real.cosh (u * a)) = -Vs := by change (∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * a ^ 2 * Real.cosh (u * a)) = -(∫ a in shortCutoff ε..shortEndpoint ε, (-shortShellDensity ε a) * a ^ 2 * Real.cosh ((1 + (u - 1)) * a)) rw [← intervalIntegral.integral_neg] apply intervalIntegral.integral_congr intro a ha ring_nf have hpositivevariance : (∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * a ^ 2 * Real.cosh (u * a)) = Vp := by change (∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * a ^ 2 * Real.cosh (u * a)) = (∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * a ^ 2 * Real.cosh ((1 + (u - 1)) * a)) apply intervalIntegral.integral_congr intro a ha ring_nf have hhyperbolic : (realHyperbolicShellPhase ε u : ℂ) = Hs + Hp := by rw [← mellinShellPhase_imaginary] unfold mellinShellPhase try dsimp [Hs, Hp] congr 1 · apply intervalIntegral.integral_congr intro a ha change (shortShellDensity ε a : ℂ) * (Complex.cos ((a : ℂ) * (Complex.I * (u : ℂ))) - 1) = (shortShellDensity ε a : ℂ) * ((Real.cosh (u * a) : ℂ) - 1) congr 1 have harg : (a : ℂ) * (Complex.I * (u : ℂ)) = ((u * a : ℝ) : ℂ) * Complex.I := by push_cast ring rw [harg, Complex.cos_mul_I, ← Complex.ofReal_cosh] · apply intervalIntegral.integral_congr intro a ha change (positiveShellDensity ε a : ℂ) * (Complex.cos ((a : ℂ) * (Complex.I * (u : ℂ))) - 1) = (positiveShellDensity ε a : ℂ) * ((Real.cosh (u * a) : ℂ) - 1) congr 1 have harg : (a : ℂ) * (Complex.I * (u : ℂ)) = ((u * a : ℝ) : ℂ) * Complex.I := by push_cast ring rw [harg, Complex.cos_mul_I, ← Complex.ofReal_cosh] have hs : (∫ a in shortCutoff ε..shortEndpoint ε, (shortShellDensity ε a : ℂ) * saddleSourceCosineQuadraticRemainder a u T) = Fs - Hs + Complex.I * ((T * Ls : ℝ) : ℂ) - ((T ^ 2 / 2 * Vs : ℝ) : ℂ) := by rw [hshort] change Fs - Hs + Complex.I * ((T * Ls : ℝ) : ℂ) + ((T ^ 2 / 2 * (∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * a ^ 2 * Real.cosh (u * a)) : ℝ) : ℂ) = Fs - Hs + Complex.I * ((T * Ls : ℝ) : ℂ) - ((T ^ 2 / 2 * Vs : ℝ) : ℂ) rw [hvariance] push_cast ring have hp : (∫ a in shellLocation ε..shellLocation ε + 1, (positiveShellDensity ε a : ℂ) * saddleSourceCosineQuadraticRemainder a u T) = Fp - Hp + Complex.I * ((T * Lp : ℝ) : ℂ) + ((T ^ 2 / 2 * Vp : ℝ) : ℂ) := by rw [hpositive] change Fp - Hp + Complex.I * ((T * Lp : ℝ) : ℂ) + ((T ^ 2 / 2 * (∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * a ^ 2 * Real.cosh (u * a)) : ℝ) : ℂ) = Fp - Hp + Complex.I * ((T * Lp : ℝ) : ℂ) + ((T ^ 2 / 2 * Vp : ℝ) : ℂ) rw [hpositivevariance] unfold saddleSourceShellQuadraticRemainder rw [hs, hp, hhyperbolic] change (Fs - Hs + Complex.I * ((T * Ls : ℝ) : ℂ) - ((T ^ 2 / 2 * Vs : ℝ) : ℂ)) + (Fp - Hp + Complex.I * ((T * Lp : ℝ) : ℂ) + ((T ^ 2 / 2 * Vp : ℝ) : ℂ)) = (Fs + Fp) - (Hs + Hp) + Complex.I * ((T * (Ls + Lp) : ℝ) : ℂ) + ((T ^ 2 / 2 * (Vp - Vs) : ℝ) : ℂ) push_cast ring theorem saddleSourceShellCenteredPhase_cubic_remainder_norm_le {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 ≤ ℓ) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) (u T : ℝ) : ‖saddleSourceShellCenteredPhase ε ℓ u T + ((ℓ * upperNetShellVariance ε (u - 1) / 2 * T ^ 2 : ℝ) : ℂ)‖ ≤ (ℓ * upperNetShellThirdMoment ε (u - 1) / 6) * |T| ^ 3 := by have hshort := saddleSourceShortShellQuadraticRemainder_norm_le hε horder hmargin u T have hpositive := saddleSourcePositiveShellQuadraticRemainder_norm_le hε u T have hsum : ‖saddleSourceShellQuadraticRemainder ε u T‖ ≤ (|T| ^ 3 / 6) * upperNetShellThirdMoment ε (u - 1) := by unfold saddleSourceShellQuadraticRemainder upperNetShellThirdMoment calc ‖(∫ a in shortCutoff ε..shortEndpoint ε, (shortShellDensity ε a : ℂ) * saddleSourceCosineQuadraticRemainder a u T) + (∫ a in shellLocation ε..shellLocation ε + 1, (positiveShellDensity ε a : ℂ) * saddleSourceCosineQuadraticRemainder a u T)‖ ≤ ‖∫ a in shortCutoff ε..shortEndpoint ε, (shortShellDensity ε a : ℂ) * saddleSourceCosineQuadraticRemainder a u T‖ + ‖∫ a in shellLocation ε..shellLocation ε + 1, (positiveShellDensity ε a : ℂ) * saddleSourceCosineQuadraticRemainder a u T‖ := norm_add_le _ _ _ ≤ (|T| ^ 3 / 6) * upperShortShellThirdMoment ε (u - 1) + (|T| ^ 3 / 6) * upperPositiveShellThirdMoment ε (u - 1) := add_le_add hshort hpositive _ = (|T| ^ 3 / 6) * (upperPositiveShellThirdMoment ε (u - 1) + upperShortShellThirdMoment ε (u - 1)) := by ring have heq : saddleSourceShellCenteredPhase ε ℓ u T + ((ℓ * upperNetShellVariance ε (u - 1) / 2 * T ^ 2 : ℝ) : ℂ) = (ℓ : ℂ) * saddleSourceShellQuadraticRemainder ε u T := by rw [saddleSourceShellQuadraticRemainder_eq hε horder u T] unfold saddleSourceShellCenteredPhase push_cast ring rw [heq, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hℓ] calc ℓ * ‖saddleSourceShellQuadraticRemainder ε u T‖ ≤ ℓ * ((|T| ^ 3 / 6) * upperNetShellThirdMoment ε (u - 1)) := mul_le_mul_of_nonneg_left hsum hℓ _ = (ℓ * upperNetShellThirdMoment ε (u - 1) / 6) * |T| ^ 3 := by ring end noncomputable section open Filter MeasureTheory Set open scoped Topology theorem upperImaginaryExp_centered_norm_le (x : ℝ) : ‖upperImaginaryExp x - 1 - Complex.I * (x : ℂ)‖ ≤ x ^ 2 / 2 + |x| ^ 3 / 6 := by let q : ℂ := ((x ^ 2 / 2 : ℝ) : ℂ) have hq : ‖q‖ = x ^ 2 / 2 := by try dsimp [q] rw [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (by positivity)] calc ‖upperImaginaryExp x - 1 - Complex.I * (x : ℂ)‖ = ‖(upperImaginaryExp x - 1 - Complex.I * (x : ℂ) + q) - q‖ := by congr 1 ring _ ≤ ‖upperImaginaryExp x - 1 - Complex.I * (x : ℂ) + q‖ + ‖q‖ := norm_sub_le _ _ _ ≤ |x| ^ 3 / 6 + x ^ 2 / 2 := by rw [hq] try dsimp [q] exact add_le_add (upperImaginaryExp_quadratic_remainder_norm_le x) (le_refl _) _ = x ^ 2 / 2 + |x| ^ 3 / 6 := by ring theorem upperGammaCenteredKernel_integrable {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (T : ℝ) : IntegrableOn (upperGammaCenteredKernel ℓ η T) (Ioi 0) := by have hvariance := upperGammaVarianceDensity_integrable hℓ hη have hthird := upperGammaThirdMomentDensity_integrable hℓ hη have hmajor : IntegrableOn (fun a : ℝ => (T ^ 2 / 2) * (a ^ 2 * upperGammaMeasureDensity ℓ η a) + (|T| ^ 3 / 6) * (a ^ 3 * upperGammaMeasureDensity ℓ η a)) (Ioi 0) := (hvariance.const_mul (T ^ 2 / 2)).add (hthird.const_mul (|T| ^ 3 / 6)) have hmeas : Measurable (upperGammaCenteredKernel ℓ η T) := by unfold upperGammaCenteredKernel upperImaginaryExp upperGammaMeasureDensity fun_prop apply hmajor.mono' hmeas.aestronglyMeasurable filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha have hdensity := upperGammaMeasureDensity_pos (η := η) hℓ ha unfold upperGammaCenteredKernel rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hdensity] calc ‖upperImaginaryExp (a * T) - 1 - Complex.I * ((a * T : ℝ) : ℂ)‖ * upperGammaMeasureDensity ℓ η a ≤ ((a * T) ^ 2 / 2 + |a * T| ^ 3 / 6) * upperGammaMeasureDensity ℓ η a := mul_le_mul_of_nonneg_right (upperImaginaryExp_centered_norm_le (a * T)) hdensity.le _ = (T ^ 2 / 2) * (a ^ 2 * upperGammaMeasureDensity ℓ η a) + (|T| ^ 3 / 6) * (a ^ 3 * upperGammaMeasureDensity ℓ η a) := by rw [abs_mul, abs_of_pos ha] ring def upperGammaQuadraticKernel (ℓ η T a : ℝ) : ℂ := (((a * T) ^ 2 / 2 * upperGammaMeasureDensity ℓ η a : ℝ) : ℂ) theorem upperGammaQuadraticKernel_integrable {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (T : ℝ) : IntegrableOn (upperGammaQuadraticKernel ℓ η T) (Ioi 0) := by have hvariance := upperGammaVarianceDensity_integrable hℓ hη have hreal : IntegrableOn (fun a : ℝ => (T ^ 2 / 2) * (a ^ 2 * upperGammaMeasureDensity ℓ η a)) (Ioi 0) := hvariance.const_mul (T ^ 2 / 2) have hcomplex : IntegrableOn (fun a : ℝ => (((T ^ 2 / 2) * (a ^ 2 * upperGammaMeasureDensity ℓ η a) : ℝ) : ℂ)) (Ioi 0) := hreal.ofReal apply hcomplex.congr_fun _ measurableSet_Ioi intro a ha unfold upperGammaQuadraticKernel apply congrArg Complex.ofReal ring theorem integral_upperGammaQuadraticKernel {ℓ η : ℝ} (hℓ : 0 < ℓ) (T : ℝ) : (∫ a : ℝ in Ioi 0, upperGammaQuadraticKernel ℓ η T a) = ((ℓ * upperGammaVariance ℓ η / 2 * T ^ 2 : ℝ) : ℂ) := by calc (∫ a : ℝ in Ioi 0, upperGammaQuadraticKernel ℓ η T a) = ∫ a : ℝ in Ioi 0, (((T ^ 2 / 2) * (a ^ 2 * upperGammaMeasureDensity ℓ η a) : ℝ) : ℂ) := by apply setIntegral_congr_fun measurableSet_Ioi intro a ha unfold upperGammaQuadraticKernel apply congrArg Complex.ofReal ring _ = ((∫ a : ℝ in Ioi 0, (T ^ 2 / 2) * (a ^ 2 * upperGammaMeasureDensity ℓ η a) : ℝ) : ℂ) := integral_ofReal (𝕜 := ℂ) _ = (((T ^ 2 / 2) * (∫ a : ℝ in Ioi 0, a ^ 2 * upperGammaMeasureDensity ℓ η a) : ℝ) : ℂ) := by rw [MeasureTheory.integral_const_mul] _ = ((ℓ * upperGammaVariance ℓ η / 2 * T ^ 2 : ℝ) : ℂ) := by congr 1 unfold upperGammaVariance field_simp [hℓ.ne'] def upperGammaCubicRemainderKernel (ℓ η T a : ℝ) : ℂ := (upperImaginaryExp (a * T) - 1 - Complex.I * ((a * T : ℝ) : ℂ) + (((a * T) ^ 2 / 2 : ℝ) : ℂ)) * (upperGammaMeasureDensity ℓ η a : ℂ) theorem upperGammaCubicRemainderKernel_norm_le {ℓ η a : ℝ} (hℓ : 0 < ℓ) (ha : 0 < a) (T : ℝ) : ‖upperGammaCubicRemainderKernel ℓ η T a‖ ≤ (|T| ^ 3 / 6) * (a ^ 3 * upperGammaMeasureDensity ℓ η a) := by have hdensity := upperGammaMeasureDensity_pos (η := η) hℓ ha unfold upperGammaCubicRemainderKernel rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hdensity] calc ‖upperImaginaryExp (a * T) - 1 - Complex.I * ((a * T : ℝ) : ℂ) + (((a * T) ^ 2 / 2 : ℝ) : ℂ)‖ * upperGammaMeasureDensity ℓ η a ≤ (|a * T| ^ 3 / 6) * upperGammaMeasureDensity ℓ η a := mul_le_mul_of_nonneg_right (upperImaginaryExp_quadratic_remainder_norm_le (a * T)) hdensity.le _ = (|T| ^ 3 / 6) * (a ^ 3 * upperGammaMeasureDensity ℓ η a) := by rw [abs_mul, abs_of_pos ha] ring theorem upperGammaCenteredPhase_add_quadratic_eq_integral {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (T : ℝ) : upperGammaCenteredPhase ℓ η T + ((ℓ * upperGammaVariance ℓ η / 2 * T ^ 2 : ℝ) : ℂ) = ∫ a : ℝ in Ioi 0, upperGammaCubicRemainderKernel ℓ η T a := by have hcenter := upperGammaCenteredKernel_integrable hℓ hη T have hquad := upperGammaQuadraticKernel_integrable hℓ hη T rw [← integral_upperGammaQuadraticKernel hℓ T] unfold upperGammaCenteredPhase rw [← MeasureTheory.integral_add hcenter hquad] apply setIntegral_congr_fun measurableSet_Ioi intro a ha unfold upperGammaCenteredKernel upperGammaQuadraticKernel upperGammaCubicRemainderKernel push_cast ring theorem upperGammaCenteredPhase_cubic_remainder_norm_le {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (T : ℝ) : ‖upperGammaCenteredPhase ℓ η T + ((ℓ * upperGammaVariance ℓ η / 2 * T ^ 2 : ℝ) : ℂ)‖ ≤ (ℓ * upperGammaThirdMoment ℓ η / 6) * |T| ^ 3 := by have hmajor : IntegrableOn (fun a : ℝ => (|T| ^ 3 / 6) * (a ^ 3 * upperGammaMeasureDensity ℓ η a)) (Ioi 0) := (upperGammaThirdMomentDensity_integrable hℓ hη).const_mul (|T| ^ 3 / 6) have hpoint : ∀ᵐ a : ℝ ∂volume.restrict (Ioi 0), ‖upperGammaCubicRemainderKernel ℓ η T a‖ ≤ (|T| ^ 3 / 6) * (a ^ 3 * upperGammaMeasureDensity ℓ η a) := by filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha exact upperGammaCubicRemainderKernel_norm_le hℓ ha T calc ‖upperGammaCenteredPhase ℓ η T + ((ℓ * upperGammaVariance ℓ η / 2 * T ^ 2 : ℝ) : ℂ)‖ = ‖∫ a : ℝ in Ioi 0, upperGammaCubicRemainderKernel ℓ η T a‖ := by rw [upperGammaCenteredPhase_add_quadratic_eq_integral hℓ hη T] _ ≤ ∫ a : ℝ in Ioi 0, (|T| ^ 3 / 6) * (a ^ 3 * upperGammaMeasureDensity ℓ η a) := MeasureTheory.norm_integral_le_of_norm_le hmajor hpoint _ = (|T| ^ 3 / 6) * (∫ a : ℝ in Ioi 0, a ^ 3 * upperGammaMeasureDensity ℓ η a) := by rw [MeasureTheory.integral_const_mul] _ = (ℓ * upperGammaThirdMoment ℓ η / 6) * |T| ^ 3 := by unfold upperGammaThirdMoment field_simp [hℓ.ne'] end noncomputable section open Filter MeasureTheory Set open scoped Topology BigOperators theorem saddleDigamma_add_one {m : ℝ} (hm : 0 < m) : saddleDigamma (m + 1) = saddleDigamma m + m⁻¹ := by unfold saddleDigamma rw [← deriv_comp_add_const, ← Real.deriv_log, ← deriv_add (saddleLogGamma_differentiableAt hm) (Real.differentiableAt_log hm.ne')] apply Filter.EventuallyEq.deriv_eq filter_upwards [eventually_gt_nhds hm] with x hx exact saddleLogGamma_add_one hx theorem saddleDigamma_add_nat {m : ℝ} (hm : 0 < m) (n : ℕ) : saddleDigamma (m + (n : ℝ)) = saddleDigamma m + ∑ k ∈ Finset.range n, (m + (k : ℝ))⁻¹ := by induction n with | zero => simp | succ n ih => rw [Nat.cast_succ, ← add_assoc, saddleDigamma_add_one (by positivity), ih, Finset.sum_range_succ] ring theorem tendsto_saddleEulerHarmonicCorrection {m : ℝ} (hm : 0 < m) : Tendsto (fun n : ℕ => Real.log (n : ℝ) - ∑ k ∈ Finset.range (n + 1), (m + (k : ℝ))⁻¹) atTop (𝓝 (saddleDigamma m)) := by have hcast := tendsto_natCast_atTop_atTop (R := ℝ) have hscale : Tendsto (fun n : ℕ => m + (n : ℝ) + 1) atTop atTop := by have h := hcast.atTop_add (tendsto_const_nhds (x := m + 1)) convert! h using 1 funext n ring have hdigamma := tendsto_saddleDigamma_sub_log.comp hscale have hinv := (tendsto_inv_atTop_nhds_zero_nat (𝕜 := ℝ)).const_mul (m + 1) have hratio : Tendsto (fun n : ℕ => (m + (n : ℝ) + 1) / (n : ℝ)) atTop (𝓝 (1 : ℝ)) := by have h := (tendsto_const_nhds (x := (1 : ℝ))).add hinv have h' : Tendsto (fun n : ℕ => 1 + (m + 1) * (n : ℝ)⁻¹) atTop (𝓝 (1 : ℝ)) := by simpa using! h apply h'.congr' filter_upwards [eventually_gt_atTop (0 : ℕ)] with n hn have hnreal : (n : ℝ) ≠ 0 := by exact_mod_cast hn.ne' field_simp [hnreal] ring have hlogratio := hratio.log (by norm_num : (1 : ℝ) ≠ 0) have hlogdiff : Tendsto (fun n : ℕ => Real.log (m + (n : ℝ) + 1) - Real.log (n : ℝ)) atTop (𝓝 0) := by have h : Tendsto (fun n : ℕ => Real.log ((m + (n : ℝ) + 1) / (n : ℝ))) atTop (𝓝 0) := by simpa using! hlogratio apply h.congr' filter_upwards [eventually_gt_atTop (0 : ℕ)] with n hn have hnreal : (n : ℝ) ≠ 0 := by exact_mod_cast hn.ne' have hmreal : m + (n : ℝ) + 1 ≠ 0 := by have : 0 < m + (n : ℝ) + 1 := by positivity exact this.ne' rw [Real.log_div hmreal hnreal] have hzero := (hdigamma.add hlogdiff).neg have hlimit := hzero.add_const (saddleDigamma m) have hlimit' : Tendsto (fun n : ℕ => -((saddleDigamma (m + (n : ℝ) + 1) - Real.log (m + (n : ℝ) + 1)) + (Real.log (m + (n : ℝ) + 1) - Real.log (n : ℝ))) + saddleDigamma m) atTop (𝓝 (saddleDigamma m)) := by simpa [Function.comp_apply] using! hlimit apply hlimit'.congr' filter_upwards [] with n have hrec := saddleDigamma_add_nat hm (n + 1) push_cast at hrec rw [show m + ((n : ℝ) + 1) = m + (n : ℝ) + 1 by ring] at hrec linarith def upperCenteredLaplaceKernel (c T a : ℝ) : ℂ := (upperImaginaryExp (a * T) - 1 - Complex.I * ((a * T : ℝ) : ℂ)) * ((Real.exp (-c * a) / a : ℝ) : ℂ) theorem upperCenteredLaplaceKernel_eq_frullani_sub_laplace (c T : ℝ) {a : ℝ} (ha : a ≠ 0) : upperCenteredLaplaceKernel c T a = complexFrullaniKernel ((c : ℂ) - Complex.I * (T : ℂ)) (c : ℂ) a - Complex.I * (T : ℂ) * Complex.exp (-(c : ℂ) * (a : ℂ)) := by have hbase : Complex.exp (-(c : ℂ) * (a : ℂ)) = (Real.exp (-c * a) : ℂ) := by calc Complex.exp (-(c : ℂ) * (a : ℂ)) = Complex.exp ((-c * a : ℝ) : ℂ) := by congr 1 push_cast ring _ = (Real.exp (-c * a) : ℂ) := by exact (Complex.ofReal_exp (-c * a)).symm have hosc : Complex.exp (-((c : ℂ) - Complex.I * (T : ℂ)) * (a : ℂ)) = (Real.exp (-c * a) : ℂ) * upperImaginaryExp (a * T) := by have harg : -((c : ℂ) - Complex.I * (T : ℂ)) * (a : ℂ) = ((-c * a : ℝ) : ℂ) + Complex.I * ((a * T : ℝ) : ℂ) := by push_cast ring unfold upperImaginaryExp rw [harg, Complex.exp_add, ← Complex.ofReal_exp] unfold upperCenteredLaplaceKernel complexFrullaniKernel rw [hosc, hbase] push_cast have hac : (a : ℂ) ≠ 0 := by exact_mod_cast ha field_simp [hac] theorem upperCenteredLaplaceKernel_integrable {c : ℝ} (hc : 0 < c) (T : ℝ) : IntegrableOn (upperCenteredLaplaceKernel c T) (Ioi 0) := by let z : ℂ := (c : ℂ) - Complex.I * (T : ℂ) let w : ℂ := (c : ℂ) have hz : 0 < z.re := by simpa [z] using! hc have hw : 0 < w.re := by simpa [w] using! hc have hfrullani := complexFrullaniKernel_integrable hz hw have hlaplace := (complexLaplaceKernel_integrable hw).const_mul (Complex.I * (T : ℂ)) apply (hfrullani.sub hlaplace).congr filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha exact (upperCenteredLaplaceKernel_eq_frullani_sub_laplace c T ha.ne').symm theorem integral_upperCenteredLaplaceKernel {c : ℝ} (hc : 0 < c) (T : ℝ) : (∫ a : ℝ in Ioi 0, upperCenteredLaplaceKernel c T a) = Complex.log (c : ℂ) - Complex.log ((c : ℂ) - Complex.I * (T : ℂ)) - Complex.I * (T : ℂ) * (c : ℂ)⁻¹ := by let z : ℂ := (c : ℂ) - Complex.I * (T : ℂ) let w : ℂ := (c : ℂ) have hz : 0 < z.re := by simpa [z] using! hc have hw : 0 < w.re := by simpa [w] using! hc have hfrullani := complexFrullaniKernel_integrable hz hw have hlaplace := complexLaplaceKernel_integrable hw calc (∫ a : ℝ in Ioi 0, upperCenteredLaplaceKernel c T a) = ∫ a : ℝ in Ioi 0, (complexFrullaniKernel z w a - Complex.I * (T : ℂ) * Complex.exp (-w * (a : ℂ))) := by apply setIntegral_congr_fun measurableSet_Ioi intro a ha exact upperCenteredLaplaceKernel_eq_frullani_sub_laplace c T ha.ne' _ = (∫ a : ℝ in Ioi 0, complexFrullaniKernel z w a) - Complex.I * (T : ℂ) * (∫ a : ℝ in Ioi 0, Complex.exp (-w * (a : ℂ))) := by rw [integral_sub hfrullani (hlaplace.const_mul (Complex.I * (T : ℂ))), integral_const_mul] _ = Complex.log (c : ℂ) - Complex.log ((c : ℂ) - Complex.I * (T : ℂ)) - Complex.I * (T : ℂ) * (c : ℂ)⁻¹ := by rw [integral_complexFrullaniKernel hz hw, integral_complexLaplaceKernel hw] def upperGammaCenteredTruncatedKernel (ℓ η T : ℝ) (n : ℕ) (a : ℝ) : ℂ := upperCenteredLaplaceKernel η T a * ((∑ k ∈ Finset.range (n + 1), Real.exp (-(2 * a / ℓ)) ^ k : ℝ) : ℂ) theorem upperGammaCenteredTruncatedKernel_eq_sum (ℓ η T : ℝ) (n : ℕ) (a : ℝ) : upperGammaCenteredTruncatedKernel ℓ η T n a = ∑ k ∈ Finset.range (n + 1), upperCenteredLaplaceKernel (η + 2 * (k : ℝ) / ℓ) T a := by classical unfold upperGammaCenteredTruncatedKernel push_cast rw [Finset.mul_sum] apply Finset.sum_congr rfl intro k hk have he : Complex.exp (-(η : ℂ) * (a : ℂ)) * Complex.exp (-(2 * (a : ℂ) / (ℓ : ℂ))) ^ k = Complex.exp (-((η : ℂ) + 2 * (k : ℂ) / (ℓ : ℂ)) * (a : ℂ)) := by rw [← Complex.exp_nat_mul, ← Complex.exp_add] congr 1 ring unfold upperCenteredLaplaceKernel push_cast rw [← he] ring theorem upperGammaCenteredGeometricLimit_eq_kernel (ℓ η T a : ℝ) : upperCenteredLaplaceKernel η T a * (((1 - Real.exp (-(2 * a / ℓ)))⁻¹ : ℝ) : ℂ) = upperGammaCenteredKernel ℓ η T a := by simp [upperCenteredLaplaceKernel, upperGammaCenteredKernel, upperGammaMeasureDensity, div_eq_mul_inv, mul_comm, mul_left_comm, mul_assoc] theorem tendsto_integral_upperGammaCenteredTruncatedKernel {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (T : ℝ) : Tendsto (fun n : ℕ => ∫ a : ℝ in Ioi 0, upperGammaCenteredTruncatedKernel ℓ η T n a) atTop (𝓝 (upperGammaCenteredPhase ℓ η T)) := by unfold upperGammaCenteredPhase refine tendsto_integral_of_dominated_convergence (fun a => ‖upperGammaCenteredKernel ℓ η T a‖) ?_ ((upperGammaCenteredKernel_integrable hℓ hη T).norm) ?_ ?_ · intro n apply Measurable.aestronglyMeasurable unfold upperGammaCenteredTruncatedKernel upperCenteredLaplaceKernel upperImaginaryExp fun_prop · intro n filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha have hq0 : 0 ≤ Real.exp (-(2 * a / ℓ)) := (Real.exp_pos _).le have hq1 : Real.exp (-(2 * a / ℓ)) < 1 := by apply Real.exp_lt_one_iff.mpr have hp : 0 < 2 * a / ℓ := div_pos (mul_pos (by norm_num) ha) hℓ linarith have hsum : (∑ k ∈ Finset.range (n + 1), Real.exp (-(2 * a / ℓ)) ^ k) ≤ (1 - Real.exp (-(2 * a / ℓ)))⁻¹ := sum_le_hasSum (Finset.range (n + 1)) (fun k hk => pow_nonneg hq0 k) (hasSum_geometric_of_lt_one hq0 hq1) have hsum0 : 0 ≤ ∑ k ∈ Finset.range (n + 1), Real.exp (-(2 * a / ℓ)) ^ k := Finset.sum_nonneg (fun k hk => pow_nonneg hq0 k) have hinv0 : 0 ≤ (1 - Real.exp (-(2 * a / ℓ)))⁻¹ := inv_nonneg.mpr (sub_nonneg.mpr hq1.le) change ‖upperCenteredLaplaceKernel η T a * ((∑ k ∈ Finset.range (n + 1), Real.exp (-(2 * a / ℓ)) ^ k : ℝ) : ℂ)‖ ≤ ‖upperGammaCenteredKernel ℓ η T a‖ rw [← upperGammaCenteredGeometricLimit_eq_kernel, norm_mul, norm_mul, Complex.norm_of_nonneg hsum0, Complex.norm_of_nonneg hinv0] exact mul_le_mul_of_nonneg_left hsum (norm_nonneg _) · filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha have hq0 : 0 ≤ Real.exp (-(2 * a / ℓ)) := (Real.exp_pos _).le have hq1 : Real.exp (-(2 * a / ℓ)) < 1 := by apply Real.exp_lt_one_iff.mpr have hp : 0 < 2 * a / ℓ := div_pos (mul_pos (by norm_num) ha) hℓ linarith have hgeo := (hasSum_geometric_of_lt_one hq0 hq1).tendsto_sum_nat have hshift := hgeo.comp (tendsto_add_atTop_nat 1) have hlimit := (tendsto_const_nhds (x := upperCenteredLaplaceKernel η T a)).mul hshift.ofReal simpa only [upperGammaCenteredTruncatedKernel, upperGammaCenteredGeometricLimit_eq_kernel, Function.comp_apply] using! hlimit theorem exp_integral_upperCenteredLaplaceKernel {c : ℝ} (hc : 0 < c) (T : ℝ) : Complex.exp (∫ a : ℝ in Ioi 0, upperCenteredLaplaceKernel c T a) = ((c : ℂ) / ((c : ℂ) - Complex.I * (T : ℂ))) * Complex.exp (-Complex.I * ((T / c : ℝ) : ℂ)) := by have hcn : (c : ℂ) ≠ 0 := by exact_mod_cast hc.ne' have hzn : (c : ℂ) - Complex.I * (T : ℂ) ≠ 0 := by apply ne_of_apply_ne Complex.re simpa using! hc.ne' have hphase : -(Complex.I * (T : ℂ) * (c : ℂ)⁻¹) = -Complex.I * ((T / c : ℝ) : ℂ) := by push_cast ring rw [integral_upperCenteredLaplaceKernel hc T] calc Complex.exp (Complex.log (c : ℂ) - Complex.log ((c : ℂ) - Complex.I * (T : ℂ)) - Complex.I * (T : ℂ) * (c : ℂ)⁻¹) = Complex.exp (Complex.log (c : ℂ) - Complex.log ((c : ℂ) - Complex.I * (T : ℂ))) * Complex.exp (-Complex.I * ((T / c : ℝ) : ℂ)) := by rw [← Complex.exp_add] congr 1 rw [← hphase] ring _ = ((c : ℂ) / ((c : ℂ) - Complex.I * (T : ℂ))) * Complex.exp (-Complex.I * ((T / c : ℝ) : ℂ)) := by rw [Complex.exp_sub, Complex.exp_log hcn, Complex.exp_log hzn] theorem upperGammaEuler_centered_cpow_ratio (m b : ℝ) {n : ℕ} (hn : 0 < n) : (n : ℂ) ^ ((m : ℂ) - Complex.I * (b : ℂ)) / (n : ℂ) ^ (m : ℂ) = Complex.exp (-Complex.I * ((b * Real.log (n : ℝ) : ℝ) : ℂ)) := by have hncomplex : (n : ℂ) ≠ 0 := by exact_mod_cast hn.ne' rw [Complex.cpow_def_of_ne_zero hncomplex, Complex.cpow_def_of_ne_zero hncomplex, ← Complex.exp_sub] rw [← Complex.natCast_log] congr 1 push_cast ring theorem exp_integral_upperCenteredLaplaceKernel_scale {c s : ℝ} (hc : 0 < c) (hs : 0 < s) (T : ℝ) : Complex.exp (∫ a : ℝ in Ioi 0, upperCenteredLaplaceKernel c T a) = (((s * c : ℝ) : ℂ) / (((s * c : ℝ) : ℂ) - Complex.I * ((s * T : ℝ) : ℂ))) * Complex.exp (-Complex.I * (((s * T / (s * c) : ℝ) : ℂ))) := by have hcn : (c : ℂ) ≠ 0 := by exact_mod_cast hc.ne' have hsn : (s : ℂ) ≠ 0 := by exact_mod_cast hs.ne' have hzn : (c : ℂ) - Complex.I * (T : ℂ) ≠ 0 := by apply ne_of_apply_ne Complex.re simpa using! hc.ne' have hratio : (c : ℂ) / ((c : ℂ) - Complex.I * (T : ℂ)) = (((s * c : ℝ) : ℂ) / (((s * c : ℝ) : ℂ) - Complex.I * ((s * T : ℝ) : ℂ))) := by push_cast field_simp [hcn, hsn, hzn] have hphase : T / c = s * T / (s * c) := by field_simp [hc.ne', hs.ne'] rw [exp_integral_upperCenteredLaplaceKernel hc T, hratio, hphase] theorem exp_integral_upperGammaCenteredLaplaceRate {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (T : ℝ) (k : ℕ) : Complex.exp (∫ a : ℝ in Ioi 0, upperCenteredLaplaceKernel (η + 2 * (k : ℝ) / ℓ) T a) = ((((ℓ * η / 2 + (k : ℝ) : ℝ) : ℂ) / (((ℓ * η / 2 : ℝ) : ℂ) - Complex.I * ((ℓ * T / 2 : ℝ) : ℂ) + (k : ℂ)))) * Complex.exp (-Complex.I * (((ℓ * T / 2 / (ℓ * η / 2 + (k : ℝ)) : ℝ) : ℂ))) := by have hs : 0 < ℓ / 2 := by positivity have hc := upperGammaLaplaceRate_pos hℓ hη k have hreal : ℓ / 2 * (η + 2 * (k : ℝ) / ℓ) = ℓ * η / 2 + (k : ℝ) := by field_simp [hℓ.ne'] have himag : ℓ / 2 * T = ℓ * T / 2 := by ring have harg : (((ℓ * η / 2 + (k : ℝ) : ℝ) : ℂ) - Complex.I * ((ℓ * T / 2 : ℝ) : ℂ)) = ((ℓ * η / 2 : ℝ) : ℂ) - Complex.I * ((ℓ * T / 2 : ℝ) : ℂ) + (k : ℂ) := by push_cast ring have h := exp_integral_upperCenteredLaplaceKernel_scale hc hs T rw [hreal, himag, harg] at h exact h theorem upperGammaEuler_centered_ratio {m : ℝ} (hm : 0 < m) (b : ℝ) {n : ℕ} (hn : 0 < n) : Complex.GammaSeq ((m : ℂ) - Complex.I * (b : ℂ)) n / Complex.GammaSeq (m : ℂ) n = Complex.exp (-Complex.I * ((b * Real.log (n : ℝ) : ℝ) : ℂ)) * ∏ k ∈ Finset.range (n + 1), (((m : ℂ) + (k : ℂ)) / ((m : ℂ) - Complex.I * (b : ℂ) + (k : ℂ))) := by classical let z : ℂ := (m : ℂ) - Complex.I * (b : ℂ) have hncomplex : (n : ℂ) ≠ 0 := by exact_mod_cast hn.ne' have hpow : (n : ℂ) ^ (m : ℂ) ≠ 0 := by rw [Complex.cpow_def_of_ne_zero hncomplex] exact Complex.exp_ne_zero _ have hfactorial : (n.factorial : ℂ) ≠ 0 := by exact_mod_cast Nat.factorial_ne_zero n have hreal (k : ℕ) : (m : ℂ) + (k : ℂ) ≠ 0 := by apply ne_of_apply_ne Complex.re simp exact (add_pos_of_pos_of_nonneg hm (Nat.cast_nonneg k)).ne' have hcomplex (k : ℕ) : z + (k : ℂ) ≠ 0 := by apply ne_of_apply_ne Complex.re simp [z] exact (add_pos_of_pos_of_nonneg hm (Nat.cast_nonneg k)).ne' have hprodreal : (∏ k ∈ Finset.range (n + 1), ((m : ℂ) + (k : ℂ))) ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun k hk => hreal k) have hprodcomplex : (∏ k ∈ Finset.range (n + 1), (z + (k : ℂ))) ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun k hk => hcomplex k) change Complex.GammaSeq z n / Complex.GammaSeq (m : ℂ) n = _ rw [← upperGammaEuler_centered_cpow_ratio m b hn, Finset.prod_div_distrib, Complex.GammaSeq, Complex.GammaSeq] change ((n : ℂ) ^ z * (n.factorial : ℂ) / (∏ k ∈ Finset.range (n + 1), (z + (k : ℂ)))) / ((n : ℂ) ^ (m : ℂ) * (n.factorial : ℂ) / (∏ k ∈ Finset.range (n + 1), ((m : ℂ) + (k : ℂ)))) = ((n : ℂ) ^ z / (n : ℂ) ^ (m : ℂ)) * ((∏ k ∈ Finset.range (n + 1), ((m : ℂ) + (k : ℂ))) / (∏ k ∈ Finset.range (n + 1), (z + (k : ℂ)))) field_simp [hpow, hfactorial, hprodreal, hprodcomplex] theorem integral_upperGammaCenteredTruncatedKernel_eq_shell_sum {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (T : ℝ) (n : ℕ) : (∫ a : ℝ in Ioi 0, upperGammaCenteredTruncatedKernel ℓ η T n a) = ∑ k ∈ Finset.range (n + 1), (∫ a : ℝ in Ioi 0, upperCenteredLaplaceKernel (η + 2 * (k : ℝ) / ℓ) T a) := by classical calc (∫ a : ℝ in Ioi 0, upperGammaCenteredTruncatedKernel ℓ η T n a) = ∫ a : ℝ in Ioi 0, ∑ k ∈ Finset.range (n + 1), upperCenteredLaplaceKernel (η + 2 * (k : ℝ) / ℓ) T a := by apply setIntegral_congr_fun measurableSet_Ioi intro a ha exact upperGammaCenteredTruncatedKernel_eq_sum ℓ η T n a _ = ∑ k ∈ Finset.range (n + 1), (∫ a : ℝ in Ioi 0, upperCenteredLaplaceKernel (η + 2 * (k : ℝ) / ℓ) T a) := by apply integral_finsetSum intro k hk exact upperCenteredLaplaceKernel_integrable (upperGammaLaplaceRate_pos hℓ hη k) T theorem exp_integral_upperGammaCenteredTruncatedKernel_eq_product {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (T : ℝ) (n : ℕ) : Complex.exp (∫ a : ℝ in Ioi 0, upperGammaCenteredTruncatedKernel ℓ η T n a) = (∏ k ∈ Finset.range (n + 1), ((((ℓ * η / 2 + (k : ℝ) : ℝ) : ℂ) / (((ℓ * η / 2 : ℝ) : ℂ) - Complex.I * ((ℓ * T / 2 : ℝ) : ℂ) + (k : ℂ))))) * Complex.exp (-Complex.I * (((ℓ * T / 2 * (∑ k ∈ Finset.range (n + 1), (ℓ * η / 2 + (k : ℝ))⁻¹) : ℝ) : ℂ))) := by classical rw [integral_upperGammaCenteredTruncatedKernel_eq_shell_sum hℓ hη T n, Complex.exp_sum] simp_rw [exp_integral_upperGammaCenteredLaplaceRate hℓ hη T] rw [Finset.prod_mul_distrib, ← Complex.exp_sum] congr 1 congr 1 push_cast simp_rw [div_eq_mul_inv] rw [Finset.mul_sum] simp_rw [Finset.mul_sum] theorem exp_integral_upperGammaCenteredTruncatedKernel {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (T : ℝ) {n : ℕ} (hn : 0 < n) : Complex.exp (∫ a : ℝ in Ioi 0, upperGammaCenteredTruncatedKernel ℓ η T n a) = (Complex.GammaSeq (((ℓ * η / 2 : ℝ) : ℂ) - Complex.I * ((ℓ * T / 2 : ℝ) : ℂ)) n / Complex.GammaSeq ((ℓ * η / 2 : ℝ) : ℂ) n) * Complex.exp (Complex.I * (((ℓ * T / 2 * (Real.log (n : ℝ) - ∑ k ∈ Finset.range (n + 1), (ℓ * η / 2 + (k : ℝ))⁻¹) : ℝ) : ℂ))) := by classical let m : ℝ := ℓ * η / 2 let b : ℝ := ℓ * T / 2 have hm : 0 < m := by try dsimp [m] positivity have hproduct : Complex.exp (∫ a : ℝ in Ioi 0, upperGammaCenteredTruncatedKernel ℓ η T n a) = (∏ k ∈ Finset.range (n + 1), (((m : ℂ) + (k : ℂ)) / ((m : ℂ) - Complex.I * (b : ℂ) + (k : ℂ)))) * Complex.exp (-Complex.I * (((b * (∑ k ∈ Finset.range (n + 1), (m + (k : ℝ))⁻¹) : ℝ) : ℂ))) := by simpa [m, b] using! exp_integral_upperGammaCenteredTruncatedKernel_eq_product hℓ hη T n have hphase : Complex.exp (-Complex.I * (((b * (∑ k ∈ Finset.range (n + 1), (m + (k : ℝ))⁻¹) : ℝ) : ℂ))) = Complex.exp (-Complex.I * ((b * Real.log (n : ℝ) : ℝ) : ℂ)) * Complex.exp (Complex.I * (((b * (Real.log (n : ℝ) - ∑ k ∈ Finset.range (n + 1), (m + (k : ℝ))⁻¹) : ℝ) : ℂ))) := by rw [← Complex.exp_add] congr 1 push_cast ring change Complex.exp (∫ a : ℝ in Ioi 0, upperGammaCenteredTruncatedKernel ℓ η T n a) = (Complex.GammaSeq ((m : ℂ) - Complex.I * (b : ℂ)) n / Complex.GammaSeq (m : ℂ) n) * Complex.exp (Complex.I * (((b * (Real.log (n : ℝ) - ∑ k ∈ Finset.range (n + 1), (m + (k : ℝ))⁻¹) : ℝ) : ℂ))) calc Complex.exp (∫ a : ℝ in Ioi 0, upperGammaCenteredTruncatedKernel ℓ η T n a) = (∏ k ∈ Finset.range (n + 1), (((m : ℂ) + (k : ℂ)) / ((m : ℂ) - Complex.I * (b : ℂ) + (k : ℂ)))) * Complex.exp (-Complex.I * (((b * (∑ k ∈ Finset.range (n + 1), (m + (k : ℝ))⁻¹) : ℝ) : ℂ))) := hproduct _ = (Complex.exp (-Complex.I * ((b * Real.log (n : ℝ) : ℝ) : ℂ)) * (∏ k ∈ Finset.range (n + 1), (((m : ℂ) + (k : ℂ)) / ((m : ℂ) - Complex.I * (b : ℂ) + (k : ℂ))))) * Complex.exp (Complex.I * (((b * (Real.log (n : ℝ) - ∑ k ∈ Finset.range (n + 1), (m + (k : ℝ))⁻¹) : ℝ) : ℂ))) := by rw [hphase] ring _ = (Complex.GammaSeq ((m : ℂ) - Complex.I * (b : ℂ)) n / Complex.GammaSeq (m : ℂ) n) * Complex.exp (Complex.I * (((b * (Real.log (n : ℝ) - ∑ k ∈ Finset.range (n + 1), (m + (k : ℝ))⁻¹) : ℝ) : ℂ))) := by rw [upperGammaEuler_centered_ratio hm b hn] theorem exp_upperGammaCenteredPhase {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (T : ℝ) : Complex.exp (upperGammaCenteredPhase ℓ η T) = (Complex.Gamma (((ℓ * η / 2 : ℝ) : ℂ) - Complex.I * ((ℓ * T / 2 : ℝ) : ℂ)) / (Real.Gamma (ℓ * η / 2) : ℂ)) * Complex.exp (Complex.I * ((ℓ * T / 2 * saddleDigamma (ℓ * η / 2) : ℝ) : ℂ)) := by classical let m : ℝ := ℓ * η / 2 let b : ℝ := ℓ * T / 2 have hm : 0 < m := by try dsimp [m] positivity have hden : Complex.Gamma (m : ℂ) ≠ 0 := Complex.Gamma_ne_zero_of_re_pos (by simpa using! hm) have hgamma : Tendsto (fun n : ℕ => Complex.GammaSeq ((m : ℂ) - Complex.I * (b : ℂ)) n / Complex.GammaSeq (m : ℂ) n) atTop (𝓝 (Complex.Gamma ((m : ℂ) - Complex.I * (b : ℂ)) / Complex.Gamma (m : ℂ))) := by exact (Complex.GammaSeq_tendsto_Gamma ((m : ℂ) - Complex.I * (b : ℂ))).div (Complex.GammaSeq_tendsto_Gamma (m : ℂ)) hden have hcorrection : Tendsto (fun n : ℕ => Complex.exp (Complex.I * (((b * (Real.log (n : ℝ) - ∑ k ∈ Finset.range (n + 1), (m + (k : ℝ))⁻¹) : ℝ) : ℂ)))) atTop (𝓝 (Complex.exp (Complex.I * ((b * saddleDigamma m : ℝ) : ℂ)))) := by have hreal := (tendsto_saddleEulerHarmonicCorrection hm).const_mul b have hcomplex := hreal.ofReal have himag := hcomplex.const_mul Complex.I simpa only [Function.comp_apply] using! himag.cexp have hright := hgamma.mul hcorrection have hleft := (tendsto_integral_upperGammaCenteredTruncatedKernel hℓ hη T).cexp have hfinite : (fun n : ℕ => Complex.exp (∫ a : ℝ in Ioi 0, upperGammaCenteredTruncatedKernel ℓ η T n a)) =ᶠ[atTop] (fun n : ℕ => (Complex.GammaSeq ((m : ℂ) - Complex.I * (b : ℂ)) n / Complex.GammaSeq (m : ℂ) n) * Complex.exp (Complex.I * (((b * (Real.log (n : ℝ) - ∑ k ∈ Finset.range (n + 1), (m + (k : ℝ))⁻¹) : ℝ) : ℂ)))) := by filter_upwards [eventually_gt_atTop (0 : ℕ)] with n hn simpa [m, b] using! exp_integral_upperGammaCenteredTruncatedKernel hℓ hη T hn have hmatch := Filter.Tendsto.congr' hfinite.symm hright have hidentity := tendsto_nhds_unique hleft hmatch rw [Complex.Gamma_ofReal] at hidentity exact hidentity end noncomputable section open Filter Set MeasureTheory intervalIntegral open scoped Topology def saddleSourceStationaryLogRadius (ε ℓ u : ℝ) : ℝ := -(Real.log Real.pi) / 2 + saddleDigamma (ℓ * (1 + u) / 2) / 2 + saddleSourceShellDerivative ε u theorem saddleSourceStationaryLogRadius_eq_saddleLogRadius (ε : ℝ) (d : ℕ) (u : ℝ) : saddleSourceStationaryLogRadius ε ((d : ℝ) / 2) u = saddleLogRadius ε d u := by rw [saddleLogRadius_eq_digamma_add_shellDerivative] rfl def saddleSourceCenteredPhase (ε ℓ u T : ℝ) : ℂ := upperGammaCenteredPhase ℓ (1 + u) T + saddleSourceShellCenteredPhase ε ℓ u T theorem saddleSourceCenteredPhase_cubic_remainder_norm_le {ε ℓ u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (hu : -1 < u) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) (T : ℝ) : ‖saddleSourceCenteredPhase ε ℓ u T + ((ℓ * saddleSourceGaussianVariance ε ℓ u / 2 * T ^ 2 : ℝ) : ℂ)‖ ≤ (ℓ * upperSaddleThirdMoment ε ℓ (u - 1) / 6) * |T| ^ 3 := by have hη : 0 < 1 + u := by linarith have hgamma := upperGammaCenteredPhase_cubic_remainder_norm_le hℓ hη T have hshell := saddleSourceShellCenteredPhase_cubic_remainder_norm_le hε hℓ.le horder hmargin u T have heq : saddleSourceCenteredPhase ε ℓ u T + ((ℓ * saddleSourceGaussianVariance ε ℓ u / 2 * T ^ 2 : ℝ) : ℂ) = (upperGammaCenteredPhase ℓ (1 + u) T + ((ℓ * upperGammaVariance ℓ (1 + u) / 2 * T ^ 2 : ℝ) : ℂ)) + (saddleSourceShellCenteredPhase ε ℓ u T + ((ℓ * upperNetShellVariance ε (u - 1) / 2 * T ^ 2 : ℝ) : ℂ)) := by unfold saddleSourceCenteredPhase saddleSourceGaussianVariance upperSaddleVariance have harg : 2 + (u - 1) = 1 + u := by ring rw [harg] push_cast ring rw [heq] calc ‖(upperGammaCenteredPhase ℓ (1 + u) T + ((ℓ * upperGammaVariance ℓ (1 + u) / 2 * T ^ 2 : ℝ) : ℂ)) + (saddleSourceShellCenteredPhase ε ℓ u T + ((ℓ * upperNetShellVariance ε (u - 1) / 2 * T ^ 2 : ℝ) : ℂ))‖ ≤ ‖upperGammaCenteredPhase ℓ (1 + u) T + ((ℓ * upperGammaVariance ℓ (1 + u) / 2 * T ^ 2 : ℝ) : ℂ)‖ + ‖saddleSourceShellCenteredPhase ε ℓ u T + ((ℓ * upperNetShellVariance ε (u - 1) / 2 * T ^ 2 : ℝ) : ℂ)‖ := norm_add_le _ _ _ ≤ (ℓ * upperGammaThirdMoment ℓ (1 + u) / 6) * |T| ^ 3 + (ℓ * upperNetShellThirdMoment ε (u - 1) / 6) * |T| ^ 3 := add_le_add hgamma hshell _ = (ℓ * upperSaddleThirdMoment ε ℓ (u - 1) / 6) * |T| ^ 3 := by unfold upperSaddleThirdMoment have harg : 2 + (u - 1) = 1 + u := by ring rw [harg] ring theorem saddleSourceContour_piExponential_eq (ℓ u T : ℝ) : Complex.exp (((ℓ : ℂ) - saddleSourceMellinContour ℓ u T) * (Real.log Real.pi : ℂ) / 2) = (Real.exp (-(ℓ * u) * Real.log Real.pi / 2) : ℂ) * Complex.exp (Complex.I * ((ℓ * T * Real.log Real.pi / 2 : ℝ) : ℂ)) := by rw [Complex.ofReal_exp, ← Complex.exp_add] congr 1 unfold saddleSourceMellinContour push_cast ring theorem saddleSourceContour_shellExponential_eq (ε ℓ u T : ℝ) : Complex.exp ((ℓ : ℂ) * mellinShellPhase ε ((T : ℂ) + Complex.I * (u : ℂ))) = (Real.exp (ℓ * realHyperbolicShellPhase ε u) : ℂ) * Complex.exp ((ℓ : ℂ) * (mellinShellPhase ε ((T : ℂ) + Complex.I * (u : ℂ)) - (realHyperbolicShellPhase ε u : ℂ))) := by rw [Complex.ofReal_exp, ← Complex.exp_add] congr 1 push_cast ring theorem saddleSourceCenteredEnvelope_eq_gamma_shell {ε ℓ u : ℝ} (hℓ : 0 < ℓ) (hu : -1 < u) (v T : ℝ) : saddleSourceCenteredEnvelope ε ℓ u v T = (Complex.Gamma (((ℓ * (1 + u) / 2 : ℝ) : ℂ) - Complex.I * ((ℓ * T / 2 : ℝ) : ℂ)) / (Real.Gamma (ℓ * (1 + u) / 2) : ℂ)) * Complex.exp ((ℓ : ℂ) * (mellinShellPhase ε ((T : ℂ) + Complex.I * (u : ℂ)) - (realHyperbolicShellPhase ε u : ℂ))) * (Complex.exp (Complex.I * ((ℓ * T * Real.log Real.pi / 2 : ℝ) : ℂ)) * Complex.exp (Complex.I * ((ℓ * T * v : ℝ) : ℂ))) := by have hη : 0 < 1 + u := by linarith have hm : 0 < ℓ * (1 + u) / 2 := by positivity have hG : (Real.Gamma (ℓ * (1 + u) / 2) : ℂ) ≠ 0 := by exact Complex.ofReal_ne_zero.mpr (Real.Gamma_pos_of_pos hm).ne' have hπ : (Real.exp (-(ℓ * u) * Real.log Real.pi / 2) : ℂ) ≠ 0 := by exact Complex.ofReal_ne_zero.mpr (Real.exp_pos _).ne' have hs : (Real.exp (ℓ * realHyperbolicShellPhase ε u) : ℂ) ≠ 0 := by exact Complex.ofReal_ne_zero.mpr (Real.exp_pos _).ne' unfold saddleSourceCenteredEnvelope saddleSourceNormalizedEnvelope saddleMellinEnvelope saddleSourceContourEnvelopeScale rw [saddleSourceMellinContour_shellArgument hℓ, saddleSourceMellinContour_gammaArgument, saddleSourceContour_piExponential_eq, saddleSourceContour_shellExponential_eq] push_cast field_simp [hπ, hG, hs] theorem saddleSourceStationaryFrequencyPhase_eq (ε ℓ u T : ℝ) : Complex.exp (Complex.I * ((ℓ * T * Real.log Real.pi / 2 : ℝ) : ℂ)) * Complex.exp (Complex.I * ((ℓ * T * saddleSourceStationaryLogRadius ε ℓ u : ℝ) : ℂ)) = Complex.exp (Complex.I * ((ℓ * T / 2 * saddleDigamma (ℓ * (1 + u) / 2) : ℝ) : ℂ)) * Complex.exp (Complex.I * ((ℓ * T * saddleSourceShellDerivative ε u : ℝ) : ℂ)) := by rw [← Complex.exp_add, ← Complex.exp_add] congr 1 unfold saddleSourceStationaryLogRadius push_cast ring theorem exp_saddleSourceShellCenteredPhase (ε ℓ u T : ℝ) : Complex.exp (saddleSourceShellCenteredPhase ε ℓ u T) = Complex.exp ((ℓ : ℂ) * (mellinShellPhase ε ((T : ℂ) + Complex.I * (u : ℂ)) - (realHyperbolicShellPhase ε u : ℂ))) * Complex.exp (Complex.I * ((ℓ * T * saddleSourceShellDerivative ε u : ℝ) : ℂ)) := by rw [← Complex.exp_add] congr 1 unfold saddleSourceShellCenteredPhase push_cast ring theorem saddleSourceCenteredEnvelope_stationary_eq_exp_phase {ε ℓ u : ℝ} (hℓ : 0 < ℓ) (hu : -1 < u) (T : ℝ) : saddleSourceCenteredEnvelope ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T = Complex.exp (saddleSourceCenteredPhase ε ℓ u T) := by have hη : 0 < 1 + u := by linarith rw [saddleSourceCenteredEnvelope_eq_gamma_shell hℓ hu] rw [saddleSourceStationaryFrequencyPhase_eq] unfold saddleSourceCenteredPhase rw [Complex.exp_add, exp_upperGammaCenteredPhase hℓ hη T, exp_saddleSourceShellCenteredPhase] ring def saddleSourceGaussianPhaseRemainder (ε ℓ u T : ℝ) : ℂ := saddleSourceCenteredPhase ε ℓ u T + ((ℓ * saddleSourceGaussianVariance ε ℓ u / 2 * T ^ 2 : ℝ) : ℂ) theorem exp_saddleSourceCenteredPhase_eq_gaussian_mul (ε ℓ u T : ℝ) : Complex.exp (saddleSourceCenteredPhase ε ℓ u T) = (saddleSourceGaussianKernel ε ℓ u T : ℂ) * Complex.exp (saddleSourceGaussianPhaseRemainder ε ℓ u T) := by unfold saddleSourceGaussianKernel saddleSourceGaussianPhaseRemainder rw [Complex.ofReal_exp, ← Complex.exp_add] congr 1 push_cast ring theorem saddleSourceCenteredEnvelope_stationary_gaussian_error_le {ε ℓ u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (hu : -1 < u) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) (T : ℝ) (hsmall : (ℓ * upperSaddleThirdMoment ε ℓ (u - 1) / 6) * |T| ^ 3 ≤ 1) : ‖saddleSourceCenteredEnvelope ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T - (saddleSourceGaussianKernel ε ℓ u T : ℂ)‖ ≤ 2 * saddleSourceGaussianKernel ε ℓ u T * ((ℓ * upperSaddleThirdMoment ε ℓ (u - 1) / 6) * |T| ^ 3) := by let R : ℂ := saddleSourceGaussianPhaseRemainder ε ℓ u T let q : ℝ := (ℓ * upperSaddleThirdMoment ε ℓ (u - 1) / 6) * |T| ^ 3 have hR : ‖R‖ ≤ q := by exact saddleSourceCenteredPhase_cubic_remainder_norm_le hε hℓ hu horder hmargin T have hRone : ‖R‖ ≤ 1 := hR.trans hsmall have hg : 0 < saddleSourceGaussianKernel ε ℓ u T := by unfold saddleSourceGaussianKernel exact Real.exp_pos _ rw [saddleSourceCenteredEnvelope_stationary_eq_exp_phase hℓ hu T, exp_saddleSourceCenteredPhase_eq_gaussian_mul] have hfactor : (saddleSourceGaussianKernel ε ℓ u T : ℂ) * Complex.exp R - (saddleSourceGaussianKernel ε ℓ u T : ℂ) = (saddleSourceGaussianKernel ε ℓ u T : ℂ) * (Complex.exp R - 1) := by ring change ‖(saddleSourceGaussianKernel ε ℓ u T : ℂ) * Complex.exp R - (saddleSourceGaussianKernel ε ℓ u T : ℂ)‖ ≤ 2 * saddleSourceGaussianKernel ε ℓ u T * q rw [hfactor, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hg] calc saddleSourceGaussianKernel ε ℓ u T * ‖Complex.exp R - 1‖ ≤ saddleSourceGaussianKernel ε ℓ u T * (2 * ‖R‖) := mul_le_mul_of_nonneg_left (Complex.norm_exp_sub_one_le hRone) hg.le _ ≤ saddleSourceGaussianKernel ε ℓ u T * (2 * q) := by gcongr _ = 2 * saddleSourceGaussianKernel ε ℓ u T * q := by ring end noncomputable section open Filter MeasureTheory Set open scoped Topology theorem saddleSourceCenteredPolynomial_centralGaussianError_le {ε ℓ u R q p : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (hu : -1 < u) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) (hV : 0 < saddleSourceGaussianVariance ε ℓ u) (hR : 0 ≤ R) (hq : 0 ≤ q) (hqone : q ≤ 1) (hp : 0 ≤ p) (P : ℂ → ℂ) (hsource : Integrable (fun T : ℝ => saddleSourceCenteredEnvelope ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T * P ((T : ℂ) + Complex.I * (u : ℂ)))) (hcubic : ∀ T : ℝ, |T| ≤ R → (ℓ * upperSaddleThirdMoment ε ℓ (u - 1) / 6) * |T| ^ 3 ≤ q) (hpoly : ∀ T : ℝ, |T| ≤ R → ‖P ((T : ℂ) + Complex.I * (u : ℂ)) - P (Complex.I * (u : ℂ))‖ ≤ p * ‖P (Complex.I * (u : ℂ))‖) : ‖∫ T : ℝ in Icc (-R) R, (saddleSourceCenteredEnvelope ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T * P ((T : ℂ) + Complex.I * (u : ℂ)) - (saddleSourceGaussianKernel ε ℓ u T : ℂ) * P (Complex.I * (u : ℂ)))‖ ≤ (2 * q + (1 + 2 * q) * p) * ‖P (Complex.I * (u : ℂ))‖ * ∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T := by have _hR : 0 ≤ R := hR let z : ℂ := Complex.I * (u : ℂ) let c : ℝ := (2 * q + (1 + 2 * q) * p) * ‖P z‖ have hc : 0 ≤ c := by try dsimp [c] positivity have hgaussian := saddleSourceGaussianKernel_integrable hℓ hV have hgaussianPoly : Integrable (fun T : ℝ => (saddleSourceGaussianKernel ε ℓ u T : ℂ) * P z) := hgaussian.ofReal.mul_const (P z) have hintegrable : Integrable (fun T : ℝ => saddleSourceCenteredEnvelope ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T * P ((T : ℂ) + z) - (saddleSourceGaussianKernel ε ℓ u T : ℂ) * P z) := by exact hsource.sub hgaussianPoly have hmajor : Integrable (fun T : ℝ => c * saddleSourceGaussianKernel ε ℓ u T) := hgaussian.const_mul c have hpoint : ∀ T ∈ Icc (-R) R, ‖saddleSourceCenteredEnvelope ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T * P ((T : ℂ) + z) - (saddleSourceGaussianKernel ε ℓ u T : ℂ) * P z‖ ≤ c * saddleSourceGaussianKernel ε ℓ u T := by intro T hT have hTabs : |T| ≤ R := (abs_le).mpr ⟨hT.1, hT.2⟩ have hthird := hcubic T hTabs have hsmall : (ℓ * upperSaddleThirdMoment ε ℓ (u - 1) / 6) * |T| ^ 3 ≤ 1 := hthird.trans hqone have henv := saddleSourceCenteredEnvelope_stationary_gaussian_error_le hε hℓ hu horder hmargin T hsmall have henvq : ‖saddleSourceCenteredEnvelope ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T - (saddleSourceGaussianKernel ε ℓ u T : ℂ)‖ ≤ 2 * saddleSourceGaussianKernel ε ℓ u T * q := by calc ‖saddleSourceCenteredEnvelope ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T - (saddleSourceGaussianKernel ε ℓ u T : ℂ)‖ ≤ 2 * saddleSourceGaussianKernel ε ℓ u T * ((ℓ * upperSaddleThirdMoment ε ℓ (u - 1) / 6) * |T| ^ 3) := henv _ ≤ 2 * saddleSourceGaussianKernel ε ℓ u T * q := by exact mul_le_mul_of_nonneg_left hthird (by unfold saddleSourceGaussianKernel positivity) have hpolyT : ‖P ((T : ℂ) + z) - P z‖ ≤ p * ‖P z‖ := by exact hpoly T hTabs have hpolynorm : ‖P ((T : ℂ) + z)‖ ≤ (1 + p) * ‖P z‖ := by calc ‖P ((T : ℂ) + z)‖ = ‖(P ((T : ℂ) + z) - P z) + P z‖ := by rw [sub_add_cancel] _ ≤ ‖P ((T : ℂ) + z) - P z‖ + ‖P z‖ := norm_add_le _ _ _ ≤ p * ‖P z‖ + ‖P z‖ := by gcongr _ = (1 + p) * ‖P z‖ := by ring have hg : 0 ≤ saddleSourceGaussianKernel ε ℓ u T := by unfold saddleSourceGaussianKernel exact (Real.exp_pos _).le have hdecomp : saddleSourceCenteredEnvelope ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T * P ((T : ℂ) + z) - (saddleSourceGaussianKernel ε ℓ u T : ℂ) * P z = (saddleSourceCenteredEnvelope ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T - (saddleSourceGaussianKernel ε ℓ u T : ℂ)) * P ((T : ℂ) + z) + (saddleSourceGaussianKernel ε ℓ u T : ℂ) * (P ((T : ℂ) + z) - P z) := by ring rw [hdecomp] calc ‖(saddleSourceCenteredEnvelope ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T - (saddleSourceGaussianKernel ε ℓ u T : ℂ)) * P ((T : ℂ) + z) + (saddleSourceGaussianKernel ε ℓ u T : ℂ) * (P ((T : ℂ) + z) - P z)‖ ≤ ‖(saddleSourceCenteredEnvelope ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T - (saddleSourceGaussianKernel ε ℓ u T : ℂ)) * P ((T : ℂ) + z)‖ + ‖(saddleSourceGaussianKernel ε ℓ u T : ℂ) * (P ((T : ℂ) + z) - P z)‖ := norm_add_le _ _ _ = ‖saddleSourceCenteredEnvelope ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T - (saddleSourceGaussianKernel ε ℓ u T : ℂ)‖ * ‖P ((T : ℂ) + z)‖ + saddleSourceGaussianKernel ε ℓ u T * ‖P ((T : ℂ) + z) - P z‖ := by rw [norm_mul, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hg] _ ≤ (2 * saddleSourceGaussianKernel ε ℓ u T * q) * ((1 + p) * ‖P z‖) + saddleSourceGaussianKernel ε ℓ u T * (p * ‖P z‖) := by gcongr _ = c * saddleSourceGaussianKernel ε ℓ u T := by try dsimp [c] ring have hcomparison := setIntegral_mono_on hintegrable.norm.integrableOn hmajor.integrableOn measurableSet_Icc hpoint have hnonnegative : 0 ≤ᵐ[(volume : Measure ℝ)] (fun T : ℝ => c * saddleSourceGaussianKernel ε ℓ u T) := by exact Filter.Eventually.of_forall (fun T => mul_nonneg hc (Real.exp_pos _).le) calc ‖∫ T : ℝ in Icc (-R) R, (saddleSourceCenteredEnvelope ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T * P ((T : ℂ) + Complex.I * (u : ℂ)) - (saddleSourceGaussianKernel ε ℓ u T : ℂ) * P (Complex.I * (u : ℂ)))‖ ≤ ∫ T : ℝ in Icc (-R) R, ‖saddleSourceCenteredEnvelope ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T * P ((T : ℂ) + z) - (saddleSourceGaussianKernel ε ℓ u T : ℂ) * P z‖ := by exact MeasureTheory.norm_integral_le_integral_norm _ _ ≤ ∫ T : ℝ in Icc (-R) R, c * saddleSourceGaussianKernel ε ℓ u T := hcomparison _ ≤ ∫ T : ℝ, c * saddleSourceGaussianKernel ε ℓ u T := setIntegral_le_integral hmajor hnonnegative _ = (2 * q + (1 + 2 * q) * p) * ‖P (Complex.I * (u : ℂ))‖ * ∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T := by rw [integral_const_mul] theorem saddleSourceCenteredPlusIntegrand_centralGaussianError_le {ε ℓ u R q p : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (hu : -1 < u) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) (hV : 0 < saddleSourceGaussianVariance ε ℓ u) (hR : 0 ≤ R) (hq : 0 ≤ q) (hqone : q ≤ 1) (hp : 0 ≤ p) (hcubic : ∀ T : ℝ, |T| ≤ R → (ℓ * upperSaddleThirdMoment ε ℓ (u - 1) / 6) * |T| ^ 3 ≤ q) (hpoly : ∀ T : ℝ, |T| ≤ R → ‖plusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) - plusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ p * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖) : ‖∫ T : ℝ in Icc (-R) R, (saddleSourceCenteredPlusIntegrand ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T - saddleSourceGaussianPlusIntegrand ε ℓ u T)‖ ≤ (2 * q + (1 + 2 * q) * p) * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * ∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T := by exact saddleSourceCenteredPolynomial_centralGaussianError_le hε hℓ hu horder hmargin hV hR hq hqone hp (plusPolynomial ε) (saddleSourceCenteredPlusIntegrand_integrable hε hℓ hu horder (saddleSourceStationaryLogRadius ε ℓ u)) hcubic hpoly theorem saddleSourceCenteredMinusIntegrand_centralGaussianError_le {ε ℓ u R q p : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (hu : -1 < u) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) (hV : 0 < saddleSourceGaussianVariance ε ℓ u) (hR : 0 ≤ R) (hq : 0 ≤ q) (hqone : q ≤ 1) (hp : 0 ≤ p) (hcubic : ∀ T : ℝ, |T| ≤ R → (ℓ * upperSaddleThirdMoment ε ℓ (u - 1) / 6) * |T| ^ 3 ≤ q) (hpoly : ∀ T : ℝ, |T| ≤ R → ‖minusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) - minusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ p * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖) : ‖∫ T : ℝ in Icc (-R) R, (saddleSourceCenteredMinusIntegrand ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T - saddleSourceGaussianMinusIntegrand ε ℓ u T)‖ ≤ (2 * q + (1 + 2 * q) * p) * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * ∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T := by exact saddleSourceCenteredPolynomial_centralGaussianError_le hε hℓ hu horder hmargin hV hR hq hqone hp (minusPolynomial ε) (saddleSourceCenteredMinusIntegrand_integrable hε hℓ hu horder (saddleSourceStationaryLogRadius ε ℓ u)) hcubic hpoly end noncomputable section open Filter Set MeasureTheory open scoped Topology def saddleGaussianTailWeight (T : ℝ) : ℝ := 1 + |T| ^ 3 theorem saddleGaussianTailWeight_nonneg (T : ℝ) : 0 ≤ saddleGaussianTailWeight T := by unfold saddleGaussianTailWeight positivity theorem saddle_abs_le_exp_sq (T : ℝ) : |T| ≤ Real.exp (T ^ 2) := by have hsquare : (|T| - 1) ^ 2 ≥ 0 := sq_nonneg _ have habs : |T| ^ 2 = T ^ 2 := sq_abs T have hlinear : |T| ≤ 1 + T ^ 2 := by nlinarith [abs_nonneg T, sq_nonneg T] exact hlinear.trans (by simpa [add_comm] using! Real.add_one_le_exp (T ^ 2)) theorem saddleGaussianTailWeight_le_two_exp_three_sq (T : ℝ) : saddleGaussianTailWeight T ≤ 2 * Real.exp (3 * T ^ 2) := by have habs := saddle_abs_le_exp_sq T have hcube : |T| ^ 3 ≤ (Real.exp (T ^ 2)) ^ 3 := pow_le_pow_left₀ (abs_nonneg T) habs 3 have hexpcube : (Real.exp (T ^ 2)) ^ 3 = Real.exp (3 * T ^ 2) := by rw [← Real.exp_nat_mul] norm_num have hone : 1 ≤ Real.exp (3 * T ^ 2) := by exact (Real.one_le_exp_iff).mpr (by positivity) unfold saddleGaussianTailWeight rw [hexpcube] at hcube linarith theorem saddleGaussianTailWeight_le_two_exp_three_abs (T : ℝ) : saddleGaussianTailWeight T ≤ 2 * Real.exp (3 * |T|) := by have hlinear : |T| ≤ Real.exp |T| := by calc |T| ≤ 1 + |T| := by linarith _ ≤ Real.exp |T| := by simpa [add_comm] using! Real.add_one_le_exp |T| have hcube : |T| ^ 3 ≤ (Real.exp |T|) ^ 3 := pow_le_pow_left₀ (abs_nonneg T) hlinear 3 have hexpcube : (Real.exp |T|) ^ 3 = Real.exp (3 * |T|) := by rw [← Real.exp_nat_mul] norm_num have hone : 1 ≤ Real.exp (3 * |T|) := by exact (Real.one_le_exp_iff).mpr (by positivity) unfold saddleGaussianTailWeight rw [hexpcube] at hcube linarith theorem saddle_integral_exp_neg_mul_abs {a : ℝ} (ha : 0 < a) : (∫ T : ℝ, Real.exp (-a * |T|)) = 2 / a := by have hhalf := integral_exp_mul_Ioi (neg_lt_zero.mpr ha) (0 : ℝ) calc (∫ T : ℝ, Real.exp (-a * |T|)) = 2 * ∫ T : ℝ in Ioi (0 : ℝ), Real.exp (-a * T) := (integral_comp_abs (f := fun T : ℝ => Real.exp (-a * T))) _ = 2 / a := by rw [hhalf] simp [div_eq_mul_inv] theorem saddleGaussianTailWeight_mul_gaussian_integrable {k : ℝ} (hk : 0 < k) : Integrable (fun T : ℝ => saddleGaussianTailWeight T * Real.exp (-k * T ^ 2)) := by have hzero := integrable_exp_neg_mul_sq hk have hthree := integrable_rpow_mul_exp_neg_mul_sq hk (s := (3 : ℝ)) (by norm_num) have hpolynomial : Integrable (fun T : ℝ => T ^ 3 * Real.exp (-k * T ^ 2)) := by simpa [Real.rpow_natCast] using! hthree have hsum := hzero.add hpolynomial.norm apply hsum.congr filter_upwards [] with T simp [saddleGaussianTailWeight, Real.norm_eq_abs, abs_of_pos (Real.exp_pos _), add_mul] theorem saddleGaussianTailWeight_mul_exp_abs_integrable {k : ℝ} (hk : 0 < k) : Integrable (fun T : ℝ => saddleGaussianTailWeight T * Real.exp (-k * |T|)) := by have hzero := integrable_exp_neg_mul_abs hk have hthree := integrable_abs_pow_mul_exp_neg_mul_abs 3 hk have hsum := hzero.add hthree apply hsum.congr filter_upwards [] with T simp [saddleGaussianTailWeight, add_mul] def saddleGaussianTailSet (R : ℝ) : Set ℝ := {T : ℝ | R ≤ |T|} theorem saddleGaussianTailSet_measurable (R : ℝ) : MeasurableSet (saddleGaussianTailSet R) := by unfold saddleGaussianTailSet exact measurableSet_le measurable_const measurable_abs theorem saddleGaussian_cubic_tail_integral_le {k R : ℝ} (hk : 6 ≤ k) (hR : 0 ≤ R) : (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-k * T ^ 2)) ≤ 2 * Real.exp (-(k / 4) * R ^ 2) * Real.sqrt (Real.pi / (k / 4)) := by have hkpos : 0 < k := by linarith have hquarter : 0 < k / 4 := by positivity let c : ℝ := 2 * Real.exp (-(k / 4) * R ^ 2) have hc : 0 ≤ c := by try dsimp [c] positivity have hsource := saddleGaussianTailWeight_mul_gaussian_integrable hkpos have hgaussian := integrable_exp_neg_mul_sq hquarter have hmajor : Integrable (fun T : ℝ => c * Real.exp (-(k / 4) * T ^ 2)) := hgaussian.const_mul c have hpoint : ∀ T ∈ saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-k * T ^ 2) ≤ c * Real.exp (-(k / 4) * T ^ 2) := by intro T hT change R ≤ |T| at hT have hsq : R ^ 2 ≤ T ^ 2 := by have h := pow_le_pow_left₀ hR hT 2 simpa [sq_abs] using! h have hexponent : 3 * T ^ 2 + (-k * T ^ 2) ≤ (-(k / 4) * R ^ 2) + (-(k / 4) * T ^ 2) := by nlinarith [ mul_nonneg (show 0 ≤ k - 6 by linarith) (sq_nonneg T), mul_nonneg (show 0 ≤ k by linarith) (show 0 ≤ T ^ 2 - R ^ 2 by linarith)] calc saddleGaussianTailWeight T * Real.exp (-k * T ^ 2) ≤ (2 * Real.exp (3 * T ^ 2)) * Real.exp (-k * T ^ 2) := by gcongr exact saddleGaussianTailWeight_le_two_exp_three_sq T _ = 2 * Real.exp (3 * T ^ 2 + (-k * T ^ 2)) := by rw [Real.exp_add] ring _ ≤ 2 * Real.exp (-(k / 4) * R ^ 2 + (-(k / 4) * T ^ 2)) := by gcongr _ = c * Real.exp (-(k / 4) * T ^ 2) := by try dsimp [c] rw [Real.exp_add] ring have hcompare := setIntegral_mono_on hsource.integrableOn hmajor.integrableOn (saddleGaussianTailSet_measurable R) hpoint have hnonnegative : 0 ≤ᵐ[(volume : Measure ℝ)] (fun T : ℝ => c * Real.exp (-(k / 4) * T ^ 2)) := Filter.Eventually.of_forall fun T => mul_nonneg hc (Real.exp_pos _).le calc (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-k * T ^ 2)) ≤ ∫ T : ℝ in saddleGaussianTailSet R, c * Real.exp (-(k / 4) * T ^ 2) := hcompare _ ≤ ∫ T : ℝ, c * Real.exp (-(k / 4) * T ^ 2) := setIntegral_le_integral hmajor hnonnegative _ = 2 * Real.exp (-(k / 4) * R ^ 2) * Real.sqrt (Real.pi / (k / 4)) := by rw [integral_const_mul, integral_gaussian] theorem saddleExponential_cubic_tail_integral_le {k R : ℝ} (hk : 6 ≤ k) (hR : 0 ≤ R) : (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-k * |T|)) ≤ 2 * Real.exp (-(k / 4) * R) * (2 / (k / 4)) := by have hkpos : 0 < k := by linarith have hquarter : 0 < k / 4 := by positivity let c : ℝ := 2 * Real.exp (-(k / 4) * R) have hc : 0 ≤ c := by try dsimp [c] positivity have hsource := saddleGaussianTailWeight_mul_exp_abs_integrable hkpos have habs := integrable_exp_neg_mul_abs hquarter have hmajor : Integrable (fun T : ℝ => c * Real.exp (-(k / 4) * |T|)) := habs.const_mul c have hpoint : ∀ T ∈ saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-k * |T|) ≤ c * Real.exp (-(k / 4) * |T|) := by intro T hT change R ≤ |T| at hT have hTabs : 0 ≤ |T| := hR.trans hT have hexponent : 3 * |T| + (-k * |T|) ≤ (-(k / 4) * R) + (-(k / 4) * |T|) := by nlinarith [ mul_nonneg (show 0 ≤ k - 6 by linarith) hTabs, mul_nonneg (show 0 ≤ k by linarith) (show 0 ≤ |T| - R by linarith)] calc saddleGaussianTailWeight T * Real.exp (-k * |T|) ≤ (2 * Real.exp (3 * |T|)) * Real.exp (-k * |T|) := by gcongr exact saddleGaussianTailWeight_le_two_exp_three_abs T _ = 2 * Real.exp (3 * |T| + (-k * |T|)) := by rw [Real.exp_add] ring _ ≤ 2 * Real.exp (-(k / 4) * R + (-(k / 4) * |T|)) := by gcongr _ = c * Real.exp (-(k / 4) * |T|) := by try dsimp [c] rw [Real.exp_add] ring have hcompare := setIntegral_mono_on hsource.integrableOn hmajor.integrableOn (saddleGaussianTailSet_measurable R) hpoint have hnonnegative : 0 ≤ᵐ[(volume : Measure ℝ)] (fun T : ℝ => c * Real.exp (-(k / 4) * |T|)) := Filter.Eventually.of_forall fun T => mul_nonneg hc (Real.exp_pos _).le calc (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-k * |T|)) ≤ ∫ T : ℝ in saddleGaussianTailSet R, c * Real.exp (-(k / 4) * |T|) := hcompare _ ≤ ∫ T : ℝ, c * Real.exp (-(k / 4) * |T|) := setIntegral_le_integral hmajor hnonnegative _ = 2 * Real.exp (-(k / 4) * R) * (2 / (k / 4)) := by rw [integral_const_mul, saddle_integral_exp_neg_mul_abs hquarter] def saddleGaussianOuterPhi (B Q c ℓ δ : ℝ) : ℝ := (B + 1) / 2 * δ + 4 * Real.log (2 + δ) - c * ℓ * Q * Real.exp (B * δ) theorem saddleGaussianOuterPhi_le_endpointBarrier {B Q c ℓ δ₀ δ : ℝ} (hB : 0 < B) (hQ : 0 < Q) (hc : 0 < c) (hℓ : 0 ≤ ℓ) (hδ₀ : 0 ≤ δ₀) (hδ : δ₀ ≤ δ) (hscale : (B + 1) / 2 + 4 ≤ c * ℓ * Q * B * Real.exp (B * δ₀)) : saddleGaussianOuterPhi B Q c ℓ δ ≤ ((B + 1) / 2 + 4) * δ₀ + 4 - c * ℓ * Q * Real.exp (B * δ₀) := by have hδnonneg : 0 ≤ δ := hδ₀.trans hδ have hlog := Real.log_le_sub_one_of_pos (show 0 < 2 + δ by linarith) have hexpstep : Real.exp (B * δ₀) * (1 + B * (δ - δ₀)) ≤ Real.exp (B * δ) := by calc Real.exp (B * δ₀) * (1 + B * (δ - δ₀)) ≤ Real.exp (B * δ₀) * Real.exp (B * (δ - δ₀)) := by gcongr simpa [add_comm] using! Real.add_one_le_exp (B * (δ - δ₀)) _ = Real.exp (B * δ) := by rw [← Real.exp_add] congr 1 ring have hdifference : Real.exp (B * δ₀) * (B * (δ - δ₀)) ≤ Real.exp (B * δ) - Real.exp (B * δ₀) := by nlinarith have hcoefficient : 0 ≤ c * ℓ * Q := by apply (mul_nonneg_iff_of_pos_right hB).mp exact mul_nonneg (mul_nonneg (mul_nonneg hc.le hℓ) hQ.le) hB.le have hexpscaled := mul_le_mul_of_nonneg_left hdifference hcoefficient have hlinearscaled := mul_le_mul_of_nonneg_right hscale (show 0 ≤ δ - δ₀ by linarith) unfold saddleGaussianOuterPhi nlinarith theorem eventually_saddleGaussianOuterPhi_uniform {B Q c δ₀ : ℝ} (hB : 0 < B) (hQ : 0 < Q) (hc : 0 < c) (hδ₀ : 0 ≤ δ₀) : ∀ κ : ℝ, 0 < κ → ∀ᶠ ℓ : ℝ in atTop, ∀ δ : ℝ, δ₀ ≤ δ → Real.sqrt ℓ * Real.exp (saddleGaussianOuterPhi B Q c ℓ δ) < κ := by let s : ℝ := c * Q * Real.exp (B * δ₀) let A : ℝ := (B + 1) / 2 + 4 have hs : 0 < s := by try dsimp [s] positivity have htendsto : Tendsto (fun ℓ : ℝ => Real.sqrt ℓ * Real.exp (A * δ₀ + 4 - s * ℓ)) atTop (𝓝 (0 : ℝ)) := by have hbase := tendsto_rpow_mul_exp_neg_mul_atTop_nhds_zero (1 / 2 : ℝ) s hs have hscaled : Tendsto (fun ℓ : ℝ => Real.exp (A * δ₀ + 4) * (ℓ ^ (1 / 2 : ℝ) * Real.exp (-s * ℓ))) atTop (𝓝 (0 : ℝ)) := by convert! (tendsto_const_nhds (x := Real.exp (A * δ₀ + 4))).mul hbase using 1; simp apply hscaled.congr' filter_upwards [] with ℓ symm rw [Real.sqrt_eq_rpow] have hexp : Real.exp (A * δ₀ + 4 - s * ℓ) = Real.exp (A * δ₀ + 4) * Real.exp (-s * ℓ) := by rw [← Real.exp_add] congr 1 ring rw [hexp] ring intro κ hκ have hsmall := htendsto.eventually (Iio_mem_nhds hκ) have hthreshold : ∀ᶠ ℓ : ℝ in atTop, A ≤ c * ℓ * Q * B * Real.exp (B * δ₀) := by have hfactor : 0 < c * Q * B * Real.exp (B * δ₀) := by positivity filter_upwards [eventually_ge_atTop (A / (c * Q * B * Real.exp (B * δ₀)))] with ℓ hℓ apply (div_le_iff₀ hfactor).mp at hℓ nlinarith filter_upwards [eventually_ge_atTop (0 : ℝ), hthreshold, hsmall] with ℓ hℓ hscale hbound intro δ hδ have hphi := saddleGaussianOuterPhi_le_endpointBarrier hB hQ hc hℓ hδ₀ hδ hscale have hcompare : Real.sqrt ℓ * Real.exp (saddleGaussianOuterPhi B Q c ℓ δ) ≤ Real.sqrt ℓ * Real.exp (A * δ₀ + 4 - s * ℓ) := by apply mul_le_mul_of_nonneg_left _ (Real.sqrt_nonneg ℓ) apply Real.exp_le_exp.mpr try dsimp [A, s] nlinarith exact hcompare.trans_lt hbound theorem upperPositiveShellVariance_firstBranch_le {ε u : ℝ} (hε : 0 < ε) (hulower : -1 < u) (huupper : u ≤ 1 + ε / 2) : upperPositiveShellVariance ε (u - 1) ≤ upperPositiveShellVariance ε (ε / 2) := by let B : ℝ := shellLocation ε have hB : 0 ≤ B := by try dsimp [B, shellLocation] positivity have horder : B ≤ B + 1 := by linarith have huabs : |u| ≤ 1 + ε / 2 := by apply (abs_le).mpr constructor <;> linarith have hcont (v : ℝ) : Continuous (fun a : ℝ => positiveShellDensity ε a * a ^ 2 * Real.cosh (v * a)) := by have hdensity := positiveShellDensity_continuous ε fun_prop have hpoint : ∀ a ∈ Icc B (B + 1), positiveShellDensity ε a * a ^ 2 * Real.cosh (u * a) ≤ positiveShellDensity ε a * a ^ 2 * Real.cosh ((1 + ε / 2) * a) := by intro a ha have ha0 : 0 ≤ a := hB.trans ha.1 have hdensity : 0 ≤ positiveShellDensity ε a := by unfold positiveShellDensity exact div_nonneg (shellWeight_pos ε).le (Real.cosh_pos a).le have habs : |u * a| ≤ |(1 + ε / 2) * a| := by rw [abs_mul, abs_mul, abs_of_nonneg ha0, abs_of_pos (by positivity : 0 < 1 + ε / 2)] exact mul_le_mul_of_nonneg_right huabs ha0 exact mul_le_mul_of_nonneg_left (Real.cosh_le_cosh.mpr habs) (mul_nonneg hdensity (sq_nonneg a)) have hmono := intervalIntegral.integral_mono_on (μ := volume) horder ((hcont u).intervalIntegrable _ _) ((hcont (1 + ε / 2)).intervalIntegrable _ _) hpoint simpa [upperPositiveShellVariance, B] using! hmono theorem upperFirstBranch_saddleSourceGaussianVariance_upper_bound {ε ℓ u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (hulower : -1 < u) (huupper : u ≤ 1 + ε / 2) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) (hscale : 1 ≤ ℓ * (1 + u)) : saddleSourceGaussianVariance ε ℓ u ≤ ((3 / 2 : ℝ) + (2 + ε / 2) * upperPositiveShellVariance ε (ε / 2)) / (1 + u) := by let η : ℝ := 1 + u have hη : 0 < η := by try dsimp [η] linarith have hηupper : η ≤ 2 + ε / 2 := by try dsimp [η] linarith have hgammabound := (upperGammaVariance_bounds hℓ hη).2 have hsmallterm : 1 / (ℓ * η ^ 2) ≤ 1 / η := by rw [div_le_div_iff₀ (by positivity : 0 < ℓ * η ^ 2) hη] try dsimp [η] at hscale ⊢ nlinarith [hscale] have hgamma : upperGammaVariance ℓ η ≤ (3 / 2 : ℝ) / η := by calc upperGammaVariance ℓ η ≤ 1 / (2 * η) + 1 / (ℓ * η ^ 2) := hgammabound _ ≤ 1 / (2 * η) + 1 / η := by gcongr _ = (3 / 2 : ℝ) / η := by ring_nf have hshort := upperShortShellVariance_nonneg (δ := u - 1) hε horder hmargin have hremote := upperPositiveShellVariance_firstBranch_le hε hulower huupper have hpositive := saddleSourcePositiveShellVariance_nonneg ε (ε / 2) have hvariance : saddleSourceGaussianVariance ε ℓ u ≤ (3 / 2 : ℝ) / η + upperPositiveShellVariance ε (ε / 2) := by unfold saddleSourceGaussianVariance upperSaddleVariance upperNetShellVariance have hargument : 2 + (u - 1) = η := by try dsimp [η] ring rw [hargument] linarith calc saddleSourceGaussianVariance ε ℓ u ≤ (3 / 2 : ℝ) / η + upperPositiveShellVariance ε (ε / 2) := hvariance _ ≤ ((3 / 2 : ℝ) + (2 + ε / 2) * upperPositiveShellVariance ε (ε / 2)) / η := by apply (le_div_iff₀ hη).mpr field_simp nlinarith [ mul_nonneg hpositive (show 0 ≤ (2 + ε / 2) - η by linarith)] _ = ((3 / 2 : ℝ) + (2 + ε / 2) * upperPositiveShellVariance ε (ε / 2)) / (1 + u) := by rfl theorem saddle_exp_neg_mul_min_le_add {a x y : ℝ} (ha : 0 ≤ a) : Real.exp (-a * min x y) ≤ Real.exp (-a * x) + Real.exp (-a * y) := by have hmax : Real.exp (-a * min x y) = max (Real.exp (-a * x)) (Real.exp (-a * y)) := by rcases le_total x y with hxy | hyx · rw [min_eq_left hxy, max_eq_left] apply Real.exp_le_exp.mpr nlinarith [mul_nonneg ha (sub_nonneg.mpr hxy)] · rw [min_eq_right hyx, max_eq_right] apply Real.exp_le_exp.mpr nlinarith [mul_nonneg ha (sub_nonneg.mpr hyx)] rw [hmax] exact max_le_add_of_nonneg (Real.exp_pos (-a * x)).le (Real.exp_pos (-a * y)).le theorem saddleSourceNormalizedEnvelope_continuous {ε ℓ u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (hu : -1 < u) (horder : shortCutoff ε ≤ shortEndpoint ε) : Continuous (saddleSourceNormalizedEnvelope ε ℓ u) := by have harg : Continuous (fun T : ℝ => saddleSourceMellinContour ℓ u T) := by unfold saddleSourceMellinContour fun_prop have hgamma : Continuous (fun T : ℝ => Complex.Gamma (saddleSourceMellinContour ℓ u T / 2)) := by apply continuous_iff_continuousAt.mpr intro T have hre : 0 < (saddleSourceMellinContour ℓ u T).re := by unfold saddleSourceMellinContour simp nlinarith [mul_pos hℓ (show 0 < 1 + u by linarith)] exact (saddleMellinGamma_differentiableAt_of_re_pos hre).continuousAt.comp_of_eq harg.continuousAt (by rfl) have hregular : Continuous (fun T : ℝ => saddleRegularMellinFactor ε ℓ (saddleSourceMellinContour ℓ u T)) := (saddleRegularMellinFactor_continuous hε horder ℓ).comp harg have henvelope : Continuous (fun T : ℝ => saddleMellinEnvelope ε ℓ (saddleSourceMellinContour ℓ u T)) := by apply (hgamma.mul hregular).congr intro T change Complex.Gamma (saddleSourceMellinContour ℓ u T / 2) * saddleRegularMellinFactor ε ℓ (saddleSourceMellinContour ℓ u T) = saddleMellinEnvelope ε ℓ (saddleSourceMellinContour ℓ u T) unfold saddleMellinEnvelope saddleRegularMellinFactor ring unfold saddleSourceNormalizedEnvelope exact henvelope.div_const _ theorem saddleSourceDampingExponential_continuous {ε ℓ u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (hu : -1 < u) (horder : shortCutoff ε ≤ shortEndpoint ε) : Continuous (fun T : ℝ => Real.exp (-saddleSourceContourDamping ε ℓ u T)) := by have hnorm := (saddleSourceNormalizedEnvelope_continuous hε hℓ hu horder).norm apply hnorm.congr intro T exact saddleSourceNormalizedEnvelope_norm hε hℓ hu horder T theorem saddleSourceTailIntegrand_continuous {ε ℓ u : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) (hu : -1 < u) (horder : shortCutoff ε ≤ shortEndpoint ε) : Continuous (fun T : ℝ => saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T)) := by have hweight : Continuous saddleGaussianTailWeight := by unfold saddleGaussianTailWeight fun_prop exact hweight.mul (saddleSourceDampingExponential_continuous hε hℓ hu horder) theorem saddleSourceContourDamping_firstBranch_min_lower_bound {ε ℓ u : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (hℓ : 0 < ℓ) (hulower : -1 < u) (huupper : u ≤ 1 + ε / 2) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) (T : ℝ) : (ε * ℓ / (2 * Real.exp 1)) * min (T ^ 2 / (1 + u)) |T| ≤ saddleSourceContourDamping ε ℓ u T := by have hη : 0 < 1 + u := by linarith have hgamma := upperGammaDamping_lower_bound hℓ hη T have hfirst := upperFirstBranchSaddleDamping_lower_bound hε hεsmall hℓ hulower huupper horder hmargin T rw [saddleSourceContourDamping_eq_firstBranch] calc (ε * ℓ / (2 * Real.exp 1)) * min (T ^ 2 / (1 + u)) |T| = 4 * ε * ((ℓ / (8 * Real.exp 1)) * min (T ^ 2 / (1 + u)) |T|) := by ring _ ≤ 4 * ε * upperGammaDamping ℓ (1 + u) T := by exact mul_le_mul_of_nonneg_left hgamma (by positivity) _ ≤ upperFirstBranchSaddleDamping ε ℓ u T := hfirst theorem saddleSource_firstBranch_weighted_integrable {ε ℓ u : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (hℓ : 0 < ℓ) (hulower : -1 < u) (huupper : u ≤ 1 + ε / 2) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) : Integrable (fun T : ℝ => saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T)) := by let η : ℝ := 1 + u let a : ℝ := ε * ℓ / (2 * Real.exp 1) have hη : 0 < η := by try dsimp [η] linarith have ha : 0 < a := by try dsimp [a] positivity have hgaussian := saddleGaussianTailWeight_mul_gaussian_integrable (div_pos ha hη) have hlinear := saddleGaussianTailWeight_mul_exp_abs_integrable ha have hmajor := hgaussian.add hlinear apply hmajor.mono' (saddleSourceTailIntegrand_continuous hε hℓ hulower horder).aestronglyMeasurable filter_upwards [] with T rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (saddleGaussianTailWeight_nonneg T) (Real.exp_pos _).le)] have hcoercive := saddleSourceContourDamping_firstBranch_min_lower_bound hε hεsmall hℓ hulower huupper horder hmargin T have hmin := saddle_exp_neg_mul_min_le_add (a := a) (x := T ^ 2 / η) (y := |T|) ha.le have hexp : Real.exp (-saddleSourceContourDamping ε ℓ u T) ≤ Real.exp (-a * (T ^ 2 / η)) + Real.exp (-a * |T|) := by calc Real.exp (-saddleSourceContourDamping ε ℓ u T) ≤ Real.exp (-a * min (T ^ 2 / η) |T|) := by apply Real.exp_le_exp.mpr simpa [a, η] using! neg_le_neg hcoercive _ ≤ _ := hmin change saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T) ≤ saddleGaussianTailWeight T * Real.exp (-(a / η) * T ^ 2) + saddleGaussianTailWeight T * Real.exp (-a * |T|) have hrearrange : -a * (T ^ 2 / η) = -(a / η) * T ^ 2 := by ring rw [hrearrange] at hexp nlinarith [mul_le_mul_of_nonneg_left hexp (saddleGaussianTailWeight_nonneg T)] theorem saddleSource_firstBranch_weighted_tail_le {ε ℓ u R : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (hℓ : 0 < ℓ) (hulower : -1 < u) (huupper : u ≤ 1 + ε / 2) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) (hR : 0 ≤ R) (hquadratic : 6 ≤ (ε * ℓ / (2 * Real.exp 1)) / (1 + u)) (hlinear : 6 ≤ ε * ℓ / (2 * Real.exp 1)) : (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T)) ≤ 2 * Real.exp (-(((ε * ℓ / (2 * Real.exp 1)) / (1 + u)) / 4) * R ^ 2) * Real.sqrt (Real.pi / (((ε * ℓ / (2 * Real.exp 1)) / (1 + u)) / 4)) + 2 * Real.exp (-((ε * ℓ / (2 * Real.exp 1)) / 4) * R) * (2 / ((ε * ℓ / (2 * Real.exp 1)) / 4)) := by let η : ℝ := 1 + u let a : ℝ := ε * ℓ / (2 * Real.exp 1) have hη : 0 < η := by try dsimp [η] linarith have ha : 0 < a := by try dsimp [a] positivity have hsource := saddleSource_firstBranch_weighted_integrable hε hεsmall hℓ hulower huupper horder hmargin have hgaussian := saddleGaussianTailWeight_mul_gaussian_integrable (div_pos ha hη) have hlinearIntegrable := saddleGaussianTailWeight_mul_exp_abs_integrable ha have hmajor := hgaussian.add hlinearIntegrable have hpoint : ∀ T ∈ saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T) ≤ saddleGaussianTailWeight T * Real.exp (-(a / η) * T ^ 2) + saddleGaussianTailWeight T * Real.exp (-a * |T|) := by intro T hT have hcoercive := saddleSourceContourDamping_firstBranch_min_lower_bound hε hεsmall hℓ hulower huupper horder hmargin T have hmin := saddle_exp_neg_mul_min_le_add (a := a) (x := T ^ 2 / η) (y := |T|) ha.le have hexp : Real.exp (-saddleSourceContourDamping ε ℓ u T) ≤ Real.exp (-(a / η) * T ^ 2) + Real.exp (-a * |T|) := by calc Real.exp (-saddleSourceContourDamping ε ℓ u T) ≤ Real.exp (-a * min (T ^ 2 / η) |T|) := by apply Real.exp_le_exp.mpr simpa [a, η] using! neg_le_neg hcoercive _ ≤ Real.exp (-a * (T ^ 2 / η)) + Real.exp (-a * |T|) := hmin _ = Real.exp (-(a / η) * T ^ 2) + Real.exp (-a * |T|) := by have hrearrange : -a * (T ^ 2 / η) = -(a / η) * T ^ 2 := by ring rw [hrearrange] nlinarith [mul_le_mul_of_nonneg_left hexp (saddleGaussianTailWeight_nonneg T)] have hcompare := setIntegral_mono_on hsource.integrableOn hmajor.integrableOn (saddleGaussianTailSet_measurable R) hpoint have hsplit : (∫ T : ℝ in saddleGaussianTailSet R, (saddleGaussianTailWeight T * Real.exp (-(a / η) * T ^ 2) + saddleGaussianTailWeight T * Real.exp (-a * |T|))) = (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-(a / η) * T ^ 2)) + ∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-a * |T|) := by rw [integral_add hgaussian.integrableOn hlinearIntegrable.integrableOn] calc (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T)) ≤ ∫ T : ℝ in saddleGaussianTailSet R, (saddleGaussianTailWeight T * Real.exp (-(a / η) * T ^ 2) + saddleGaussianTailWeight T * Real.exp (-a * |T|)) := hcompare _ = (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-(a / η) * T ^ 2)) + ∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-a * |T|) := hsplit _ ≤ 2 * Real.exp (-(a / η / 4) * R ^ 2) * Real.sqrt (Real.pi / (a / η / 4)) + 2 * Real.exp (-(a / 4) * R) * (2 / (a / 4)) := by gcongr · apply saddleGaussian_cubic_tail_integral_le · exact hquadratic · exact hR · apply saddleExponential_cubic_tail_integral_le · exact hlinear · exact hR _ = _ := by rfl theorem saddleFirstBranch_normalizedGaussian_prefactor_le {ℓ V η c C : ℝ} (hℓ : 0 < ℓ) (hV : 0 < V) (hη : 0 < η) (hc : 0 < c) (hupper : η * V ≤ C) : Real.sqrt (ℓ * V) * Real.sqrt (Real.pi / ((c * ℓ / η) / 4)) ≤ 2 * Real.sqrt (Real.pi * C / c) := by have hinside : (ℓ * V) * (Real.pi / ((c * ℓ / η) / 4)) ≤ 4 * (Real.pi * C / c) := by calc (ℓ * V) * (Real.pi / ((c * ℓ / η) / 4)) = 4 * Real.pi * (η * V) / c := by field_simp [hc.ne', hℓ.ne', hη.ne'] _ ≤ 4 * Real.pi * C / c := by gcongr _ = 4 * (Real.pi * C / c) := by ring rw [← Real.sqrt_mul (mul_nonneg hℓ.le hV.le)] calc Real.sqrt ((ℓ * V) * (Real.pi / ((c * ℓ / η) / 4))) ≤ Real.sqrt (4 * (Real.pi * C / c)) := Real.sqrt_le_sqrt hinside _ = 2 * Real.sqrt (Real.pi * C / c) := by rw [Real.sqrt_mul (by norm_num : (0 : ℝ) ≤ 4)] norm_num theorem saddleFirstBranch_normalizedGaussian_exponent_le {ℓ V η c C z : ℝ} (hℓ : 0 < ℓ) (hV : 0 < V) (hη : 0 < η) (hc : 0 < c) (hC : 0 < C) (hupper : η * V ≤ C) : (c / (4 * C)) * z ^ 2 ≤ ((c * ℓ / η) / 4) * (z / Real.sqrt (ℓ * V)) ^ 2 := by have hLV : 0 < ℓ * V := mul_pos hℓ hV have hinverse : 1 / C ≤ 1 / (η * V) := by exact (one_div_le_one_div hC (mul_pos hη hV)).mpr hupper have hscaled := mul_le_mul_of_nonneg_left hinverse (show 0 ≤ c * z ^ 2 / 4 by positivity) have hsquare : (z / Real.sqrt (ℓ * V)) ^ 2 = z ^ 2 / (ℓ * V) := by rw [div_pow, Real.sq_sqrt hLV.le] rw [hsquare] calc (c / (4 * C)) * z ^ 2 = (c * z ^ 2 / 4) * (1 / C) := by ring _ ≤ (c * z ^ 2 / 4) * (1 / (η * V)) := hscaled _ = ((c * ℓ / η) / 4) * (z ^ 2 / (ℓ * V)) := by field_simp [hℓ.ne', hV.ne', hη.ne'] theorem saddleFirstBranch_normalizedLinear_prefactor_le {ℓ V η C : ℝ} (hℓ : 0 < ℓ) (hV : 0 < V) (hη : 0 < η) (hC : 0 < C) (hupper : η * V ≤ C) : Real.sqrt (ℓ * V) / ℓ ≤ Real.sqrt (C / (ℓ * η)) := by have hfrac : V / ℓ ≤ C / (ℓ * η) := by apply (div_le_div_iff₀ hℓ (mul_pos hℓ hη)).mpr have hscaled := mul_le_mul_of_nonneg_left hupper hℓ.le nlinarith have hidentity : Real.sqrt (ℓ * V) / ℓ = Real.sqrt (V / ℓ) := by calc Real.sqrt (ℓ * V) / ℓ = Real.sqrt ((ℓ * V) / ℓ ^ 2) := by rw [Real.sqrt_div (mul_nonneg hℓ.le hV.le), Real.sqrt_sq_eq_abs, abs_of_pos hℓ] _ = Real.sqrt (V / ℓ) := by congr 1 field_simp [hℓ.ne'] rw [hidentity] exact (Real.sqrt_le_sqrt_iff (div_pos hC (mul_pos hℓ hη)).le).mpr hfrac theorem saddleSource_firstBranch_normalized_tail_bound {ε ℓ u z C : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (hℓ : 0 < ℓ) (hulower : -1 < u) (huupper : u ≤ 1 + ε / 2) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) (hV : 0 < saddleSourceGaussianVariance ε ℓ u) (hC : 0 < C) (hupper : (1 + u) * saddleSourceGaussianVariance ε ℓ u ≤ C) (hz : 0 ≤ z) (hquadratic : 6 ≤ (ε * ℓ / (2 * Real.exp 1)) / (1 + u)) (hlinear : 6 ≤ ε * ℓ / (2 * Real.exp 1)) : Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) * (∫ T : ℝ in saddleGaussianTailSet (z / Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u)), saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T)) ≤ 4 * Real.sqrt (Real.pi * C / (ε / (2 * Real.exp 1))) * Real.exp (-(ε / (2 * Real.exp 1) / (4 * C)) * z ^ 2) + (16 / (ε / (2 * Real.exp 1))) * Real.sqrt (C / (ℓ * (1 + u))) := by let V : ℝ := saddleSourceGaussianVariance ε ℓ u let η : ℝ := 1 + u let c : ℝ := ε / (2 * Real.exp 1) let R : ℝ := z / Real.sqrt (ℓ * V) have hη : 0 < η := by try dsimp [η] linarith have hc : 0 < c := by try dsimp [c] positivity have hR : 0 ≤ R := by try dsimp [R] positivity have htail := saddleSource_firstBranch_weighted_tail_le hε hεsmall hℓ hulower huupper horder hmargin hR hquadratic hlinear have hscale : ε * ℓ / (2 * Real.exp 1) = c * ℓ := by try dsimp [c] ring have hpref := saddleFirstBranch_normalizedGaussian_prefactor_le hℓ hV hη hc hupper have hexponent := saddleFirstBranch_normalizedGaussian_exponent_le (z := z) hℓ hV hη hc hC hupper have hlinearPref := saddleFirstBranch_normalizedLinear_prefactor_le hℓ hV hη hC hupper have hsqrt : 0 ≤ Real.sqrt (ℓ * V) := Real.sqrt_nonneg _ have hscaled := mul_le_mul_of_nonneg_left htail hsqrt have hexpgaussian : Real.exp (-((c * ℓ / η) / 4) * R ^ 2) ≤ Real.exp (-(c / (4 * C)) * z ^ 2) := by apply Real.exp_le_exp.mpr try dsimp [R] nlinarith [hexponent] have hexplinear : Real.exp (-((c * ℓ) / 4) * R) ≤ 1 := by rw [← Real.exp_zero] apply Real.exp_le_exp.mpr have hcl : 0 ≤ c * ℓ := (mul_pos hc hℓ).le nlinarith change Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T)) ≤ 4 * Real.sqrt (Real.pi * C / c) * Real.exp (-(c / (4 * C)) * z ^ 2) + (16 / c) * Real.sqrt (C / (ℓ * η)) rw [hscale] at hscaled change Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T)) ≤ Real.sqrt (ℓ * V) * (2 * Real.exp (-((c * ℓ / η) / 4) * R ^ 2) * Real.sqrt (Real.pi / ((c * ℓ / η) / 4)) + 2 * Real.exp (-((c * ℓ) / 4) * R) * (2 / ((c * ℓ) / 4))) at hscaled calc Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T)) ≤ Real.sqrt (ℓ * V) * (2 * Real.exp (-((c * ℓ / η) / 4) * R ^ 2) * Real.sqrt (Real.pi / ((c * ℓ / η) / 4)) + 2 * Real.exp (-((c * ℓ) / 4) * R) * (2 / ((c * ℓ) / 4))) := hscaled _ ≤ 4 * Real.sqrt (Real.pi * C / c) * Real.exp (-(c / (4 * C)) * z ^ 2) + (16 / c) * Real.sqrt (C / (ℓ * η)) := by have hfirst : Real.sqrt (ℓ * V) * (2 * Real.exp (-((c * ℓ / η) / 4) * R ^ 2) * Real.sqrt (Real.pi / ((c * ℓ / η) / 4))) ≤ 4 * Real.sqrt (Real.pi * C / c) * Real.exp (-(c / (4 * C)) * z ^ 2) := by calc Real.sqrt (ℓ * V) * (2 * Real.exp (-((c * ℓ / η) / 4) * R ^ 2) * Real.sqrt (Real.pi / ((c * ℓ / η) / 4))) = 2 * (Real.sqrt (ℓ * V) * Real.sqrt (Real.pi / ((c * ℓ / η) / 4))) * Real.exp (-((c * ℓ / η) / 4) * R ^ 2) := by ring _ ≤ 2 * (2 * Real.sqrt (Real.pi * C / c)) * Real.exp (-(c / (4 * C)) * z ^ 2) := by gcongr _ = _ := by ring have hsecond : Real.sqrt (ℓ * V) * (2 * Real.exp (-((c * ℓ) / 4) * R) * (2 / ((c * ℓ) / 4))) ≤ (16 / c) * Real.sqrt (C / (ℓ * η)) := by calc Real.sqrt (ℓ * V) * (2 * Real.exp (-((c * ℓ) / 4) * R) * (2 / ((c * ℓ) / 4))) = (16 / c) * (Real.sqrt (ℓ * V) / ℓ) * Real.exp (-((c * ℓ) / 4) * R) := by field_simp [hc.ne', hℓ.ne']; ring _ ≤ (16 / c) * Real.sqrt (C / (ℓ * η)) * 1 := by gcongr _ = _ := by ring nlinarith [hfirst, hsecond] def saddleSourceFirstBranchVarianceCoefficient (ε : ℝ) : ℝ := (3 / 2 : ℝ) + (2 + ε / 2) * upperPositiveShellVariance ε (ε / 2) theorem saddleSourceFirstBranchVarianceCoefficient_pos {ε : ℝ} (hε : 0 < ε) : 0 < saddleSourceFirstBranchVarianceCoefficient ε := by have hshell := saddleSourcePositiveShellVariance_nonneg ε (ε / 2) unfold saddleSourceFirstBranchVarianceCoefficient nlinarith [mul_nonneg (show 0 ≤ 2 + ε / 2 by positivity) hshell] def saddleFirstBranchTailLogMajorant (c C ℓ : ℝ) : ℝ := 4 * Real.sqrt (Real.pi * C / c) * Real.exp (-(c / (4 * C)) * (Real.log ℓ / 4) ^ (1 / 6 : ℝ)) + (16 / c) * Real.sqrt (C / (Real.log ℓ / 4)) theorem tendsto_saddleFirstBranchTailLogMajorant {c C : ℝ} (hc : 0 < c) (hC : 0 < C) : Tendsto (saddleFirstBranchTailLogMajorant c C) atTop (𝓝 (0 : ℝ)) := by have hx : Tendsto (fun ℓ : ℝ => Real.log ℓ / 4) atTop atTop := Real.tendsto_log_atTop.atTop_div_const (by norm_num : (0 : ℝ) < 4) have hpower : Tendsto (fun ℓ : ℝ => (Real.log ℓ / 4) ^ (1 / 6 : ℝ)) atTop atTop := (tendsto_rpow_atTop (by norm_num : (0 : ℝ) < 1 / 6)).comp hx have hrate : 0 < c / (4 * C) := by positivity have hnegative : Tendsto (fun ℓ : ℝ => -(c / (4 * C)) * (Real.log ℓ / 4) ^ (1 / 6 : ℝ)) atTop atBot := hpower.const_mul_atTop_of_neg (by linarith) have hexp : Tendsto (fun ℓ : ℝ => Real.exp (-(c / (4 * C)) * (Real.log ℓ / 4) ^ (1 / 6 : ℝ))) atTop (𝓝 (0 : ℝ)) := Real.tendsto_exp_atBot.comp hnegative have hratio : Tendsto (fun ℓ : ℝ => C / (Real.log ℓ / 4)) atTop (𝓝 (0 : ℝ)) := tendsto_const_nhds.div_atTop hx have hsqrt : Tendsto (fun ℓ : ℝ => Real.sqrt (C / (Real.log ℓ / 4))) atTop (𝓝 (0 : ℝ)) := by convert! hratio.sqrt using 1; simp have hfirst := hexp.const_mul (4 * Real.sqrt (Real.pi * C / c)) have hsecond := hsqrt.const_mul (16 / c) change Tendsto (fun ℓ : ℝ => 4 * Real.sqrt (Real.pi * C / c) * Real.exp (-(c / (4 * C)) * (Real.log ℓ / 4) ^ (1 / 6 : ℝ)) + (16 / c) * Real.sqrt (C / (Real.log ℓ / 4))) atTop (𝓝 (0 : ℝ)) simpa using! hfirst.add hsecond theorem eventually_saddleSource_firstBranch_uniform_tail : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ κ : ℝ, 0 < κ → ∀ᶠ ℓ : ℝ in atTop, ∀ u : ℝ, -1 < u → u ≤ 1 + ε / 2 → Real.log ℓ / 4 ≤ ℓ * (1 + u) → Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) * (∫ T : ℝ in saddleGaussianTailSet (((ℓ * (1 + u)) ^ (1 / 12 : ℝ)) / Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u)), saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T)) < κ := by have hsmall : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ε ≤ 1 / 4 := by have hnear : Tendsto (fun ε : ℝ => ε) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := tendsto_id.mono_left nhdsWithin_le_nhds filter_upwards [hnear.eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1 / 4))] with ε hε exact hε.le filter_upwards [self_mem_nhdsWithin, hsmall, eventually_upper_shortCutoff_le_shortEndpoint, eventually_upper_shortMargin_positive, eventually_saddleSourceGaussianVariance_firstBranch_pos] with ε hε hεsmall horder hmargin hVbranch change 0 < ε at hε intro κ hκ let c : ℝ := ε / (2 * Real.exp 1) let C : ℝ := saddleSourceFirstBranchVarianceCoefficient ε let U : ℝ := 2 + ε / 2 have hc : 0 < c := by try dsimp [c] positivity have hC : 0 < C := saddleSourceFirstBranchVarianceCoefficient_pos hε have hU : 0 < U := by try dsimp [U] positivity have hlogtop : Tendsto (fun ℓ : ℝ => Real.log ℓ / 4) atTop atTop := Real.tendsto_log_atTop.atTop_div_const (by norm_num : (0 : ℝ) < 4) have hlogone := hlogtop.eventually (eventually_ge_atTop (1 : ℝ)) have htail := (tendsto_saddleFirstBranchTailLogMajorant hc hC).eventually (Iio_mem_nhds hκ) filter_upwards [eventually_gt_atTop (0 : ℝ), hlogone, eventually_ge_atTop (6 / c), eventually_ge_atTop (6 * U / c), htail] with ℓ hℓ hlogoneℓ hlinbase hquadbase htailℓ intro u hulower huupper hlogscale let η : ℝ := 1 + u let V : ℝ := saddleSourceGaussianVariance ε ℓ u let z : ℝ := (ℓ * η) ^ (1 / 12 : ℝ) have hη : 0 < η := by try dsimp [η] linarith have hηU : η ≤ U := by try dsimp [η, U] linarith have hscale : 1 ≤ ℓ * η := hlogoneℓ.trans hlogscale have hV : 0 < V := by try dsimp [V] exact hVbranch ℓ hℓ u hulower huupper have hmargin' : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a := by intro a ha have h := hmargin a ha linarith have hvariance := upperFirstBranch_saddleSourceGaussianVariance_upper_bound hε hℓ hulower huupper horder hmargin' hscale have hupper : η * V ≤ C := by have hbound : V ≤ C / η := by simpa [V, η, C, saddleSourceFirstBranchVarianceCoefficient] using! hvariance calc η * V ≤ η * (C / η) := mul_le_mul_of_nonneg_left hbound hη.le _ = C := by field_simp [hη.ne'] have hlinear : 6 ≤ c * ℓ := by have h := (div_le_iff₀ hc).mp hlinbase nlinarith have hquadratic : 6 ≤ (c * ℓ) / η := by apply (le_div_iff₀ hη).mpr have h := (div_le_iff₀ hc).mp hquadbase nlinarith [mul_le_mul_of_nonneg_left hηU (by norm_num : (0 : ℝ) ≤ 6)] have hz : 0 ≤ z := by try dsimp [z] positivity have hsource := saddleSource_firstBranch_normalized_tail_bound (z := z) (C := C) hε hεsmall hℓ hulower huupper horder hmargin' hV hC hupper hz (by convert! hquadratic using 1; dsimp [c, η]; ring) (by convert! hlinear using 1; dsimp [c]; ring) have hlognonneg : 0 ≤ Real.log ℓ / 4 := by linarith have hpower : (Real.log ℓ / 4) ^ (1 / 6 : ℝ) ≤ z ^ 2 := by have hmono := Real.rpow_le_rpow hlognonneg hlogscale (by norm_num : (0 : ℝ) ≤ 1 / 6) have hsquare : z ^ 2 = (ℓ * η) ^ (1 / 6 : ℝ) := by try dsimp [z] rw [← Real.rpow_natCast, ← Real.rpow_mul (mul_nonneg hℓ.le hη.le)] congr 1 norm_num rw [hsquare] exact hmono have hrate : 0 < c / (4 * C) := by positivity have hexponential : Real.exp (-(c / (4 * C)) * z ^ 2) ≤ Real.exp (-(c / (4 * C)) * (Real.log ℓ / 4) ^ (1 / 6 : ℝ)) := by apply Real.exp_le_exp.mpr nlinarith [mul_nonneg hrate.le (show 0 ≤ z ^ 2 - (Real.log ℓ / 4) ^ (1 / 6 : ℝ) by linarith)] have hsqrt : Real.sqrt (C / (ℓ * η)) ≤ Real.sqrt (C / (Real.log ℓ / 4)) := by apply Real.sqrt_le_sqrt apply div_le_div_of_nonneg_left hC.le (by linarith : 0 < Real.log ℓ / 4) hlogscale change Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet (z / Real.sqrt (ℓ * V)), saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T)) < κ calc Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet (z / Real.sqrt (ℓ * V)), saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T)) ≤ 4 * Real.sqrt (Real.pi * C / c) * Real.exp (-(c / (4 * C)) * z ^ 2) + (16 / c) * Real.sqrt (C / (ℓ * η)) := by simpa [c, η, V] using! hsource _ ≤ saddleFirstBranchTailLogMajorant c C ℓ := by unfold saddleFirstBranchTailLogMajorant gcongr _ < κ := htailℓ theorem eventually_saddleGaussianOuterPhi_uniform_polynomial {B Q c δ₀ K : ℝ} (hB : 0 < B) (hQ : 0 < Q) (hc : 0 < c) (hδ₀ : 0 ≤ δ₀) (hK : 0 ≤ K) : ∀ κ : ℝ, 0 < κ → ∀ᶠ ℓ : ℝ in atTop, ∀ δ : ℝ, δ₀ ≤ δ → K * Real.sqrt ℓ * Real.exp (((B + 1) / 2) * δ) * (2 + δ) ^ 4 * Real.exp (-c * ℓ * Q * Real.exp (B * δ)) < κ := by intro κ hκ rcases hK.eq_or_lt with hKzero | hKpos · subst K filter_upwards [] with ℓ intro δ hδ simpa using! hκ · have hlimit := eventually_saddleGaussianOuterPhi_uniform hB hQ hc hδ₀ (κ / K) (div_pos hκ hKpos) filter_upwards [hlimit] with ℓ hℓ intro δ hδ have hδnonnegative : 0 ≤ δ := hδ₀.trans hδ have hη : 0 < 2 + δ := by linarith have hpower : (2 + δ) ^ 4 = Real.exp (4 * Real.log (2 + δ)) := by calc (2 + δ) ^ 4 = (Real.exp (Real.log (2 + δ))) ^ 4 := by rw [Real.exp_log hη] _ = Real.exp (4 * Real.log (2 + δ)) := by rw [← Real.exp_nat_mul] norm_num have hproduct : Real.exp (((B + 1) / 2) * δ) * Real.exp (4 * Real.log (2 + δ)) * Real.exp (-c * ℓ * Q * Real.exp (B * δ)) = Real.exp (saddleGaussianOuterPhi B Q c ℓ δ) := by rw [← Real.exp_add, ← Real.exp_add] congr 1 unfold saddleGaussianOuterPhi ring have hrewrite : K * Real.sqrt ℓ * Real.exp (((B + 1) / 2) * δ) * (2 + δ) ^ 4 * Real.exp (-c * ℓ * Q * Real.exp (B * δ)) = K * (Real.sqrt ℓ * Real.exp (saddleGaussianOuterPhi B Q c ℓ δ)) := by rw [hpower] calc K * Real.sqrt ℓ * Real.exp (((B + 1) / 2) * δ) * Real.exp (4 * Real.log (2 + δ)) * Real.exp (-c * ℓ * Q * Real.exp (B * δ)) = K * Real.sqrt ℓ * (Real.exp (((B + 1) / 2) * δ) * Real.exp (4 * Real.log (2 + δ)) * Real.exp (-c * ℓ * Q * Real.exp (B * δ))) := by ring _ = K * (Real.sqrt ℓ * Real.exp (saddleGaussianOuterPhi B Q c ℓ δ)) := by rw [hproduct] ring rw [hrewrite] calc K * (Real.sqrt ℓ * Real.exp (saddleGaussianOuterPhi B Q c ℓ δ)) < K * (κ / K) := mul_lt_mul_of_pos_left (hℓ δ hδ) hKpos _ = κ := by field_simp end noncomputable section open Filter Set MeasureTheory intervalIntegral open scoped Topology theorem saddleSourcePositiveShellThirdMoment_nonneg {ε : ℝ} (hε : 0 < ε) (δ : ℝ) : 0 ≤ upperPositiveShellThirdMoment ε δ := by have hB : 0 ≤ shellLocation ε := by unfold shellLocation positivity unfold upperPositiveShellThirdMoment apply intervalIntegral.integral_nonneg (by linarith) intro a ha have ha : 0 ≤ a := hB.trans ha.1 have hdensity : 0 ≤ positiveShellDensity ε a := by unfold positiveShellDensity exact div_nonneg (shellWeight_pos ε).le (Real.cosh_pos a).le exact mul_nonneg (mul_nonneg hdensity (pow_nonneg ha 3)) (Real.cosh_pos _).le theorem upperPositiveShellThirdMoment_firstBranch_le {ε u : ℝ} (hε : 0 < ε) (hulower : -1 < u) (huupper : u ≤ 1 + ε / 2) : upperPositiveShellThirdMoment ε (u - 1) ≤ upperPositiveShellThirdMoment ε (ε / 2) := by let B : ℝ := shellLocation ε have hB : 0 ≤ B := by try dsimp [B, shellLocation] positivity have horder : B ≤ B + 1 := by linarith have huabs : |u| ≤ 1 + ε / 2 := by apply (abs_le).mpr constructor <;> linarith have hcont (v : ℝ) : Continuous (fun a : ℝ => positiveShellDensity ε a * a ^ 3 * Real.cosh (v * a)) := by have hdensity := positiveShellDensity_continuous ε fun_prop have hpoint : ∀ a ∈ Icc B (B + 1), positiveShellDensity ε a * a ^ 3 * Real.cosh (u * a) ≤ positiveShellDensity ε a * a ^ 3 * Real.cosh ((1 + ε / 2) * a) := by intro a ha have ha0 : 0 ≤ a := hB.trans ha.1 have hdensity : 0 ≤ positiveShellDensity ε a := by unfold positiveShellDensity exact div_nonneg (shellWeight_pos ε).le (Real.cosh_pos a).le have habs : |u * a| ≤ |(1 + ε / 2) * a| := by rw [abs_mul, abs_mul, abs_of_nonneg ha0, abs_of_pos (by positivity : 0 < 1 + ε / 2)] exact mul_le_mul_of_nonneg_right huabs ha0 exact mul_le_mul_of_nonneg_left (Real.cosh_le_cosh.mpr habs) (mul_nonneg hdensity (pow_nonneg ha0 3)) have hmono := intervalIntegral.integral_mono_on (μ := volume) horder ((hcont u).intervalIntegrable _ _) ((hcont (1 + ε / 2)).intervalIntegrable _ _) hpoint simpa [upperPositiveShellThirdMoment, B] using! hmono theorem upperGammaVariance_firstBranch_scaled_le {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (hscale : 1 ≤ ℓ * η) : η * upperGammaVariance ℓ η ≤ (3 / 2 : ℝ) := by have hone : 1 / (ℓ * η) ≤ (1 : ℝ) := by apply (div_le_iff₀ (mul_pos hℓ hη)).2 simpa using! hscale calc η * upperGammaVariance ℓ η ≤ η * (1 / (2 * η) + 1 / (ℓ * η ^ 2)) := mul_le_mul_of_nonneg_left (upperGammaVariance_bounds hℓ hη).2 hη.le _ = 1 / 2 + 1 / (ℓ * η) := by field_simp [hℓ.ne', hη.ne'] _ ≤ (3 / 2 : ℝ) := by linarith theorem upperGammaThirdMoment_firstBranch_scaled_le {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (hscale : 1 ≤ ℓ * η) : η ^ 2 * upperGammaThirdMoment ℓ η ≤ (5 / 2 : ℝ) := by have hone : 1 / (ℓ * η) ≤ (1 : ℝ) := by apply (div_le_iff₀ (mul_pos hℓ hη)).2 simpa using! hscale have htwo : 2 / (ℓ * η) ≤ (2 : ℝ) := by calc 2 / (ℓ * η) = 2 * (1 / (ℓ * η)) := by ring _ ≤ 2 * (1 : ℝ) := by gcongr _ = 2 := by ring calc η ^ 2 * upperGammaThirdMoment ℓ η ≤ η ^ 2 * (1 / (2 * η ^ 2) + 2 / (ℓ * η ^ 3)) := mul_le_mul_of_nonneg_left (upperGammaThirdMoment_bounds hℓ hη).2 (sq_nonneg η) _ = 1 / 2 + 2 / (ℓ * η) := by field_simp [hℓ.ne', hη.ne'] _ ≤ (5 / 2 : ℝ) := by linarith def saddleSourceFirstBranchThirdMomentCoefficient (ε : ℝ) : ℝ := (5 / 2 : ℝ) + (3 / 2 : ℝ) * shortEndpoint ε * (2 + ε / 2) + (2 + ε / 2) ^ 2 * upperPositiveShellThirdMoment ε (ε / 2) theorem upperFirstBranch_saddleSourceThirdMoment_scaled_le {ε ℓ u : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (hℓ : 0 < ℓ) (hulower : -1 < u) (huupper : u ≤ 1 + ε / 2) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) (hscale : 1 ≤ ℓ * (1 + u)) : (1 + u) ^ 2 * upperSaddleThirdMoment ε ℓ (u - 1) ≤ saddleSourceFirstBranchThirdMomentCoefficient ε := by let η : ℝ := 1 + u let U : ℝ := 2 + ε / 2 have hη : 0 < η := by try dsimp [η] linarith have hU : 0 < U := by try dsimp [U] positivity have hηU : η ≤ U := by try dsimp [η, U] linarith have hA : 0 ≤ shortEndpoint ε := by have hcut : 0 < shortCutoff ε := by unfold shortCutoff positivity exact (hcut.trans_le horder).le have hgamma := upperGammaVariance_firstBranch_scaled_le hℓ hη (by simpa [η] using! hscale) have hthirdgamma := upperGammaThirdMoment_firstBranch_scaled_le hℓ hη (by simpa [η] using! hscale) have hgammanonneg : 0 ≤ upperGammaVariance ℓ η := (show 0 ≤ 1 / (2 * η) by positivity).trans (upperGammaVariance_bounds hℓ hη).1 have hshortvariance := upperFirstBranch_shortVariance_le_gamma hε hεsmall hℓ hulower huupper horder hmargin have hshortvariance' : upperShortShellVariance ε (u - 1) ≤ upperGammaVariance ℓ η := by try dsimp [η] nlinarith [mul_nonneg hε.le hgammanonneg] have hshortthird := upperShortShellThirdMoment_le (δ := u - 1) hε horder hmargin have hshort : η ^ 2 * upperShortShellThirdMoment ε (u - 1) ≤ (3 / 2 : ℝ) * shortEndpoint ε * U := by calc η ^ 2 * upperShortShellThirdMoment ε (u - 1) ≤ η ^ 2 * (shortEndpoint ε * upperShortShellVariance ε (u - 1)) := mul_le_mul_of_nonneg_left hshortthird (sq_nonneg η) _ ≤ η ^ 2 * (shortEndpoint ε * upperGammaVariance ℓ η) := by gcongr _ = shortEndpoint ε * η * (η * upperGammaVariance ℓ η) := by ring _ ≤ shortEndpoint ε * η * (3 / 2 : ℝ) := by gcongr _ ≤ shortEndpoint ε * U * (3 / 2 : ℝ) := by gcongr _ = (3 / 2 : ℝ) * shortEndpoint ε * U := by ring have hremote := upperPositiveShellThirdMoment_firstBranch_le hε hulower huupper have hremote0 := saddleSourcePositiveShellThirdMoment_nonneg hε (ε / 2) have hremoteScaled : η ^ 2 * upperPositiveShellThirdMoment ε (u - 1) ≤ U ^ 2 * upperPositiveShellThirdMoment ε (ε / 2) := by calc η ^ 2 * upperPositiveShellThirdMoment ε (u - 1) ≤ η ^ 2 * upperPositiveShellThirdMoment ε (ε / 2) := mul_le_mul_of_nonneg_left hremote (sq_nonneg η) _ ≤ U ^ 2 * upperPositiveShellThirdMoment ε (ε / 2) := by gcongr unfold saddleSourceFirstBranchThirdMomentCoefficient unfold upperSaddleThirdMoment upperNetShellThirdMoment have hargument : 2 + (u - 1) = η := by try dsimp [η] ring rw [hargument] change η ^ 2 * (upperGammaThirdMoment ℓ η + (upperPositiveShellThirdMoment ε (u - 1) + upperShortShellThirdMoment ε (u - 1))) ≤ (5 / 2 : ℝ) + (3 / 2 : ℝ) * shortEndpoint ε * U + U ^ 2 * upperPositiveShellThirdMoment ε (ε / 2) nlinarith def saddleSourceSecondBranchVarianceFloor (ε : ℝ) : ℝ := (99 / 200 : ℝ) * (shellLocation ε) ^ 2 * shellWeight ε * Real.exp ((ε / 2) * shellLocation ε) theorem saddleSourceSecondBranchVarianceFloor_pos {ε : ℝ} (hε : 0 < ε) : 0 < saddleSourceSecondBranchVarianceFloor ε := by unfold saddleSourceSecondBranchVarianceFloor shellLocation have hweight := shellWeight_pos ε positivity theorem eventually_saddleSourceGaussianVariance_secondBranch_floor : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ ℓ : ℝ, 0 < ℓ → ∀ δ : ℝ, ε / 2 ≤ δ → saddleSourceSecondBranchVarianceFloor ε ≤ saddleSourceGaussianVariance ε ℓ (1 + δ) := by filter_upwards [self_mem_nhdsWithin, eventually_upperSaddleVariance_bounds] with ε hε hvariance change 0 < ε at hε intro ℓ hℓ δ hδ have hδ0 : 0 ≤ δ := by linarith have hB : 0 ≤ shellLocation ε := by unfold shellLocation positivity have hfactor : 0 ≤ (1 / 2 : ℝ) * (shellLocation ε) ^ 2 * shellWeight ε := by have hweight := shellWeight_pos ε positivity have hpositive := (upperPositiveShellVariance_bounds hε hδ0).1 have hfull := (hvariance ℓ hℓ δ hδ).1 have hmono : Real.exp ((ε / 2) * shellLocation ε) ≤ Real.exp (δ * shellLocation ε) := Real.exp_le_exp.mpr (mul_le_mul_of_nonneg_right hδ hB) have hfloor : saddleSourceSecondBranchVarianceFloor ε ≤ (99 / 100 : ℝ) * upperPositiveShellVariance ε δ := by calc saddleSourceSecondBranchVarianceFloor ε = (99 / 100 : ℝ) * ((1 / 2 : ℝ) * (shellLocation ε) ^ 2 * shellWeight ε * Real.exp ((ε / 2) * shellLocation ε)) := by unfold saddleSourceSecondBranchVarianceFloor ring _ ≤ (99 / 100 : ℝ) * ((1 / 2 : ℝ) * (shellLocation ε) ^ 2 * shellWeight ε * Real.exp (δ * shellLocation ε)) := by gcongr _ ≤ (99 / 100 : ℝ) * upperPositiveShellVariance ε δ := by gcongr have hη : 0 < 2 + δ := by linarith have hgamma : 0 ≤ 1 / (2 * (2 + δ)) := by positivity unfold saddleSourceGaussianVariance have hargument : 1 + δ - 1 = δ := by ring rw [hargument] linarith theorem saddleSource_cubic_window_le {ℓ V M C z T : ℝ} (hℓ : 0 < ℓ) (hV : 0 < V) (hC : 0 ≤ C) (hz : 0 ≤ z) (hM : M ≤ C * V) (hT : |T| ≤ z / Real.sqrt (ℓ * V)) : (ℓ * M / 6) * |T| ^ 3 ≤ (C / 6) * z ^ 3 / Real.sqrt (ℓ * V) := by have _hz : 0 ≤ z := hz have hs : 0 < Real.sqrt (ℓ * V) := Real.sqrt_pos.2 (mul_pos hℓ hV) calc (ℓ * M / 6) * |T| ^ 3 ≤ (ℓ * (C * V) / 6) * |T| ^ 3 := by gcongr _ ≤ (ℓ * (C * V) / 6) * (z / Real.sqrt (ℓ * V)) ^ 3 := by gcongr _ = (C / 6) * z ^ 3 / Real.sqrt (ℓ * V) := by field_simp [hs.ne'] rw [Real.sq_sqrt (mul_nonneg hℓ.le hV.le)] ring theorem saddleSource_cubic_window_le_of_variance_floor {ℓ V M C V₀ z T : ℝ} (hℓ : 0 < ℓ) (hV₀ : 0 < V₀) (hfloor : V₀ ≤ V) (hC : 0 ≤ C) (hz : 0 ≤ z) (hM : M ≤ C * V) (hT : |T| ≤ z / Real.sqrt (ℓ * V)) : (ℓ * M / 6) * |T| ^ 3 ≤ (C / 6) * z ^ 3 / (Real.sqrt ℓ * Real.sqrt V₀) := by have hV : 0 < V := hV₀.trans_le hfloor have hbase := saddleSource_cubic_window_le hℓ hV hC hz hM hT calc (ℓ * M / 6) * |T| ^ 3 ≤ (C / 6) * z ^ 3 / Real.sqrt (ℓ * V) := hbase _ ≤ (C / 6) * z ^ 3 / Real.sqrt (ℓ * V₀) := by gcongr _ = (C / 6) * z ^ 3 / (Real.sqrt ℓ * Real.sqrt V₀) := by rw [Real.sqrt_mul hℓ.le] end noncomputable section open Filter Set open scoped Topology theorem exists_plusPolynomial_uniform_weighted_bound {ε : ℝ} (hε : 0 < ε) : ∃ C : ℝ, 0 < C ∧ ∀ u : ℝ, -1 ≤ u → ∀ T : ℝ, ‖plusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ))‖ ≤ C * (1 + |T| ^ 3) * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := by obtain ⟨C, hC, hbound⟩ := exists_plusPolynomial_uniform_norm_ratio hε refine ⟨C, hC, ?_⟩ intro u hu T have hden : 0 < ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := (beta_pos hε).trans_le (plusPolynomial_imaginary_norm_ge_beta hε hu) exact (div_le_iff₀ hden).mp (hbound u hu T) theorem exists_minusPolynomial_uniform_weighted_bound {ε : ℝ} (hε : 0 < ε) : ∃ C : ℝ, 0 < C ∧ ∀ u : ℝ, 1 + ε / 4 ≤ u → ∀ T : ℝ, ‖minusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ))‖ ≤ C * (1 + |T| ^ 3) * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by obtain ⟨C, hC, hbound⟩ := exists_minusPolynomial_uniform_norm_ratio hε refine ⟨C, hC, ?_⟩ intro u hu T have hden : 0 < ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hbeta := beta_pos hε have hnorm := minusPolynomial_imaginary_norm_ge_three_beta hε hu nlinarith exact (div_le_iff₀ hden).mp (hbound u hu T) theorem exists_plusPolynomial_uniform_difference_bound {ε : ℝ} (hε : 0 < ε) : ∃ C : ℝ, 0 < C ∧ ∀ u : ℝ, -1 ≤ u → ∀ T : ℝ, ‖plusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) - plusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ C * (|T| + |T| ^ 3) * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := by obtain ⟨C, hC, hbound⟩ := exists_plusPolynomial_uniform_difference_ratio hε refine ⟨C, hC, ?_⟩ intro u hu T have hden : 0 < ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := (beta_pos hε).trans_le (plusPolynomial_imaginary_norm_ge_beta hε hu) exact (div_le_iff₀ hden).mp (hbound u hu T) theorem exists_minusPolynomial_uniform_difference_bound {ε : ℝ} (hε : 0 < ε) : ∃ C : ℝ, 0 < C ∧ ∀ u : ℝ, 1 + ε / 4 ≤ u → ∀ T : ℝ, ‖minusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) - minusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ C * (|T| + |T| ^ 3) * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by obtain ⟨C, hC, hbound⟩ := exists_minusPolynomial_uniform_difference_ratio hε refine ⟨C, hC, ?_⟩ intro u hu T have hden : 0 < ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hbeta := beta_pos hε have hnorm := minusPolynomial_imaginary_norm_ge_three_beta hε hu nlinarith exact (div_le_iff₀ hden).mp (hbound u hu T) theorem exists_plusPolynomial_uniform_central_window {ε κ : ℝ} (hε : 0 < ε) (hκ : 0 < κ) : ∃ R : ℝ, 0 < R ∧ ∀ u : ℝ, -1 ≤ u → ∀ T : ℝ, |T| ≤ R → ‖plusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) - plusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ κ * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := by obtain ⟨C, hC, hbound⟩ := exists_plusPolynomial_uniform_difference_bound hε let R : ℝ := min 1 (κ / (2 * C)) have hR : 0 < R := by try dsimp [R] positivity refine ⟨R, hR, ?_⟩ intro u hu T hT have hTunit : |T| ≤ 1 := hT.trans (min_le_left _ _) have hcube : |T| ^ 3 ≤ |T| := by have hfactor : 0 ≤ |T| * (1 - |T|) * (1 + |T|) := by exact mul_nonneg (mul_nonneg (abs_nonneg T) (sub_nonneg.mpr hTunit)) (by positivity) nlinarith have hscale : 2 * C * R ≤ κ := by have hmin : R ≤ κ / (2 * C) := min_le_right _ _ have hfactor : 0 < 2 * C := by positivity nlinarith [(le_div_iff₀ hfactor).mp hmin] calc ‖plusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) - plusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ C * (|T| + |T| ^ 3) * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := hbound u hu T _ ≤ (2 * C * R) * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := by apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) calc C * (|T| + |T| ^ 3) ≤ C * (2 * R) := by apply mul_le_mul_of_nonneg_left _ hC.le linarith _ = 2 * C * R := by ring _ ≤ κ * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := by exact mul_le_mul_of_nonneg_right hscale (norm_nonneg _) theorem exists_minusPolynomial_uniform_central_window {ε κ : ℝ} (hε : 0 < ε) (hκ : 0 < κ) : ∃ R : ℝ, 0 < R ∧ ∀ u : ℝ, 1 + ε / 4 ≤ u → ∀ T : ℝ, |T| ≤ R → ‖minusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) - minusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ κ * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by obtain ⟨C, hC, hbound⟩ := exists_minusPolynomial_uniform_difference_bound hε let R : ℝ := min 1 (κ / (2 * C)) have hR : 0 < R := by try dsimp [R] positivity refine ⟨R, hR, ?_⟩ intro u hu T hT have hTunit : |T| ≤ 1 := hT.trans (min_le_left _ _) have hcube : |T| ^ 3 ≤ |T| := by have hfactor : 0 ≤ |T| * (1 - |T|) * (1 + |T|) := by exact mul_nonneg (mul_nonneg (abs_nonneg T) (sub_nonneg.mpr hTunit)) (by positivity) nlinarith have hscale : 2 * C * R ≤ κ := by have hmin : R ≤ κ / (2 * C) := min_le_right _ _ have hfactor : 0 < 2 * C := by positivity nlinarith [(le_div_iff₀ hfactor).mp hmin] calc ‖minusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) - minusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ C * (|T| + |T| ^ 3) * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := hbound u hu T _ ≤ (2 * C * R) * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) calc C * (|T| + |T| ^ 3) ≤ C * (2 * R) := by apply mul_le_mul_of_nonneg_left _ hC.le linarith _ = 2 * C * R := by ring _ ≤ κ * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by exact mul_le_mul_of_nonneg_right hscale (norm_nonneg _) end noncomputable section open Filter Set MeasureTheory intervalIntegral open scoped Topology def saddleSourceFirstBranchCentralRadius (ε ℓ u : ℝ) : ℝ := (ℓ * (1 + u)) ^ (1 / 12 : ℝ) / Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) def saddleSourceSecondBranchCentralRadius (ε ℓ u : ℝ) : ℝ := ℓ ^ (1 / 12 : ℝ) / Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) theorem saddleSource_central_rpow_cube_div_sqrt {x : ℝ} (hx : 0 < x) : (x ^ (1 / 12 : ℝ)) ^ 3 / Real.sqrt x = x ^ (-(1 / 4 : ℝ)) := by have hcube : (x ^ (1 / 12 : ℝ)) ^ 3 = x ^ (1 / 4 : ℝ) := by rw [← Real.rpow_natCast, ← Real.rpow_mul hx.le] norm_num rw [hcube, Real.sqrt_eq_rpow, ← Real.rpow_sub hx] norm_num theorem saddleSource_central_rpow_div_sqrt {x : ℝ} (hx : 0 < x) : x ^ (1 / 12 : ℝ) / Real.sqrt x = x ^ (-(5 / 12 : ℝ)) := by rw [Real.sqrt_eq_rpow, ← Real.rpow_sub hx] norm_num theorem saddleSource_scaled_cubic_window_le {ℓ η V M K c z T : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (hc : 0 < c) (hK : 0 ≤ K) (hz : 0 ≤ z) (hmoment : η ^ 2 * M ≤ K) (hvariance : c ≤ η * V) (hT : |T| ≤ z / Real.sqrt (ℓ * V)) : (ℓ * M / 6) * |T| ^ 3 ≤ (K / (6 * c * Real.sqrt c)) * (z ^ 3 / Real.sqrt (ℓ * η)) := by have hV : 0 < V := by nlinarith [hvariance, mul_pos hη hc] have hs : 0 < Real.sqrt (ℓ * V) := Real.sqrt_pos.2 (mul_pos hℓ hV) have ht : 0 < Real.sqrt (ℓ * η) := Real.sqrt_pos.2 (mul_pos hℓ hη) have hw : 0 < Real.sqrt (η * V) := Real.sqrt_pos.2 (mul_pos hη hV) have hcroot : 0 < Real.sqrt c := Real.sqrt_pos.2 hc have hm : M ≤ K / η ^ 2 := by apply (le_div_iff₀ (sq_pos_of_pos hη)).2 nlinarith have hcross : Real.sqrt (ℓ * V) * η = Real.sqrt (ℓ * η) * Real.sqrt (η * V) := by have heq : (Real.sqrt (ℓ * V) * η) ^ 2 = (Real.sqrt (ℓ * η) * Real.sqrt (η * V)) ^ 2 := by rw [mul_pow, mul_pow, Real.sq_sqrt (mul_nonneg hℓ.le hV.le), Real.sq_sqrt (mul_nonneg hℓ.le hη.le), Real.sq_sqrt (mul_nonneg hη.le hV.le)] ring nlinarith [mul_pos hs hη, mul_pos ht hw] have hwlower : Real.sqrt c ≤ Real.sqrt (η * V) := Real.sqrt_le_sqrt hvariance have hratio : ℓ * Real.sqrt (ℓ * η) * (Real.sqrt (η * V)) ^ 3 = η ^ 2 * (Real.sqrt (ℓ * V)) ^ 3 := by have htsquare : (Real.sqrt (ℓ * η)) ^ 2 = ℓ * η := Real.sq_sqrt (mul_nonneg hℓ.le hη.le) calc ℓ * Real.sqrt (ℓ * η) * (Real.sqrt (η * V)) ^ 3 = (((Real.sqrt (ℓ * η)) ^ 2 / η) * Real.sqrt (ℓ * η) * (Real.sqrt (η * V)) ^ 3) := by rw [htsquare] field_simp [hη.ne'] _ = (Real.sqrt (ℓ * η) * Real.sqrt (η * V)) ^ 3 / η := by ring _ = (Real.sqrt (ℓ * V) * η) ^ 3 / η := by rw [hcross] _ = η ^ 2 * (Real.sqrt (ℓ * V)) ^ 3 := by field_simp [hη.ne'] calc (ℓ * M / 6) * |T| ^ 3 ≤ (ℓ * (K / η ^ 2) / 6) * (z / Real.sqrt (ℓ * V)) ^ 3 := by gcongr _ = (K / 6) * z ^ 3 / (Real.sqrt (ℓ * η) * (Real.sqrt (η * V)) ^ 3) := by field_simp [hη.ne', hs.ne', ht.ne', hw.ne'] calc ℓ * K * z ^ 3 * Real.sqrt (ℓ * η) * (Real.sqrt (η * V)) ^ 3 = K * z ^ 3 * (ℓ * Real.sqrt (ℓ * η) * (Real.sqrt (η * V)) ^ 3) := by ring _ = K * z ^ 3 * (η ^ 2 * (Real.sqrt (ℓ * V)) ^ 3) := by rw [hratio] _ = K * η ^ 2 * z ^ 3 * (Real.sqrt (ℓ * V)) ^ 3 := by ring _ ≤ (K / 6) * z ^ 3 / (Real.sqrt (ℓ * η) * (Real.sqrt c) ^ 3) := by gcongr _ = (K / (6 * c * Real.sqrt c)) * (z ^ 3 / Real.sqrt (ℓ * η)) := by have hcsquare : (Real.sqrt c) ^ 2 = c := Real.sq_sqrt hc.le field_simp [ht.ne', hc.ne', hcroot.ne'] rw [hcsquare] theorem upperFirstBranch_saddleSourceGaussianVariance_scaled_lower_bound {ε ℓ u : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (hℓ : 0 < ℓ) (hulower : -1 < u) (huupper : u ≤ 1 + ε / 2) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) : 2 * ε ≤ (1 + u) * saddleSourceGaussianVariance ε ℓ u := by have hη : 0 < 1 + u := by linarith have hgamma := (upperGammaVariance_bounds hℓ hη).1 have hsource := upperFirstBranch_saddleSourceGaussianVariance_lower_bound hε hεsmall hℓ hulower huupper horder hmargin calc 2 * ε = (1 + u) * (4 * ε * (1 / (2 * (1 + u)))) := by field_simp [hη.ne'] norm_num _ ≤ (1 + u) * (4 * ε * upperGammaVariance ℓ (1 + u)) := by gcongr _ ≤ (1 + u) * saddleSourceGaussianVariance ε ℓ u := by gcongr theorem saddleSourceFirstBranchThirdMomentCoefficient_pos {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : 0 < saddleSourceFirstBranchThirdMomentCoefficient ε := by have hcut : 0 < shortCutoff ε := by unfold shortCutoff positivity have hA : 0 ≤ shortEndpoint ε := (hcut.trans_le horder).le have hremote := saddleSourcePositiveShellThirdMoment_nonneg hε (ε / 2) unfold saddleSourceFirstBranchThirdMomentCoefficient positivity theorem saddleSourceFirstBranch_cubic_central_window_le {ε ℓ u T : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (hℓ : 0 < ℓ) (hulower : -1 < u) (huupper : u ≤ 1 + ε / 2) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) (hscale : 1 ≤ ℓ * (1 + u)) (hT : |T| ≤ saddleSourceFirstBranchCentralRadius ε ℓ u) : (ℓ * upperSaddleThirdMoment ε ℓ (u - 1) / 6) * |T| ^ 3 ≤ (saddleSourceFirstBranchThirdMomentCoefficient ε / (12 * ε * Real.sqrt (2 * ε))) * (ℓ * (1 + u)) ^ (-(1 / 4 : ℝ)) := by have hη : 0 < 1 + u := by linarith have hx : 0 < ℓ * (1 + u) := mul_pos hℓ hη have hK := saddleSourceFirstBranchThirdMomentCoefficient_pos hε horder have hmoment := upperFirstBranch_saddleSourceThirdMoment_scaled_le hε hεsmall hℓ hulower huupper horder hmargin hscale have hvariance := upperFirstBranch_saddleSourceGaussianVariance_scaled_lower_bound hε hεsmall hℓ hulower huupper horder hmargin have hcentral := saddleSource_scaled_cubic_window_le (ℓ := ℓ) (η := 1 + u) (V := saddleSourceGaussianVariance ε ℓ u) (M := upperSaddleThirdMoment ε ℓ (u - 1)) (K := saddleSourceFirstBranchThirdMomentCoefficient ε) (c := 2 * ε) (z := (ℓ * (1 + u)) ^ (1 / 12 : ℝ)) (T := T) hℓ hη (by positivity) hK.le (Real.rpow_nonneg hx.le _) hmoment hvariance (by simpa [saddleSourceFirstBranchCentralRadius] using! hT) calc (ℓ * upperSaddleThirdMoment ε ℓ (u - 1) / 6) * |T| ^ 3 ≤ (saddleSourceFirstBranchThirdMomentCoefficient ε / (6 * (2 * ε) * Real.sqrt (2 * ε))) * (((ℓ * (1 + u)) ^ (1 / 12 : ℝ)) ^ 3 / Real.sqrt (ℓ * (1 + u))) := hcentral _ = (saddleSourceFirstBranchThirdMomentCoefficient ε / (12 * ε * Real.sqrt (2 * ε))) * (ℓ * (1 + u)) ^ (-(1 / 4 : ℝ)) := by rw [saddleSource_central_rpow_cube_div_sqrt hx] ring theorem eventually_saddleSourceSecondBranch_cubic_central_window_le : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ ℓ : ℝ, 1 ≤ ℓ → ∀ δ : ℝ, ε / 2 ≤ δ → ∀ T : ℝ, |T| ≤ saddleSourceSecondBranchCentralRadius ε ℓ (1 + δ) → (ℓ * upperSaddleThirdMoment ε ℓ δ / 6) * |T| ^ 3 ≤ ((2 + (100 / 99 : ℝ) * upperSaddleShellThirdCoefficient ε) / (6 * Real.sqrt (saddleSourceSecondBranchVarianceFloor ε))) * ℓ ^ (-(1 / 4 : ℝ)) := by filter_upwards [self_mem_nhdsWithin, eventually_upper_shortCutoff_le_shortEndpoint, eventually_saddleSourceGaussianVariance_secondBranch_floor, eventually_upperSaddleThirdMoment_le_variance] with ε hε horder hfloor hmoment change 0 < ε at hε intro ℓ hℓ δ hδ T hT have hℓpositive : 0 < ℓ := by linarith have hfloorpositive := saddleSourceSecondBranchVarianceFloor_pos hε have hvariance := hfloor ℓ hℓpositive δ hδ have hcut : 0 < shortCutoff ε := by unfold shortCutoff positivity have hA : 0 ≤ shortEndpoint ε := (hcut.trans_le horder).le have hB : 0 ≤ shellLocation ε := by unfold shellLocation positivity have hC : 0 ≤ 2 + (100 / 99 : ℝ) * upperSaddleShellThirdCoefficient ε := by unfold upperSaddleShellThirdCoefficient positivity have hthird := hmoment ℓ hℓ δ hδ have hargument : 1 + δ - 1 = δ := by ring have hthird' : upperSaddleThirdMoment ε ℓ δ ≤ (2 + (100 / 99 : ℝ) * upperSaddleShellThirdCoefficient ε) * saddleSourceGaussianVariance ε ℓ (1 + δ) := by simpa [saddleSourceGaussianVariance, hargument] using! hthird have hbase := saddleSource_cubic_window_le_of_variance_floor (ℓ := ℓ) (V := saddleSourceGaussianVariance ε ℓ (1 + δ)) (M := upperSaddleThirdMoment ε ℓ δ) (C := 2 + (100 / 99 : ℝ) * upperSaddleShellThirdCoefficient ε) (V₀ := saddleSourceSecondBranchVarianceFloor ε) (z := ℓ ^ (1 / 12 : ℝ)) (T := T) hℓpositive hfloorpositive hvariance hC (Real.rpow_nonneg hℓpositive.le _) hthird' (by simpa [saddleSourceSecondBranchCentralRadius] using! hT) calc (ℓ * upperSaddleThirdMoment ε ℓ δ / 6) * |T| ^ 3 ≤ ((2 + (100 / 99 : ℝ) * upperSaddleShellThirdCoefficient ε) / 6) * (ℓ ^ (1 / 12 : ℝ)) ^ 3 / (Real.sqrt ℓ * Real.sqrt (saddleSourceSecondBranchVarianceFloor ε)) := hbase _ = ((2 + (100 / 99 : ℝ) * upperSaddleShellThirdCoefficient ε) / (6 * Real.sqrt (saddleSourceSecondBranchVarianceFloor ε))) * (((ℓ ^ (1 / 12 : ℝ)) ^ 3) / Real.sqrt ℓ) := by ring _ = ((2 + (100 / 99 : ℝ) * upperSaddleShellThirdCoefficient ε) / (6 * Real.sqrt (saddleSourceSecondBranchVarianceFloor ε))) * ℓ ^ (-(1 / 4 : ℝ)) := by rw [saddleSource_central_rpow_cube_div_sqrt hℓpositive] theorem saddleSource_scaled_central_radius_le {ℓ η V c U z : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (hc : 0 < c) (hηU : η ≤ U) (hz : 0 ≤ z) (hvariance : c ≤ η * V) : z / Real.sqrt (ℓ * V) ≤ (U / Real.sqrt c) * (z / Real.sqrt (ℓ * η)) := by have hV : 0 < V := by nlinarith [hvariance, mul_pos hη hc] have hs : 0 < Real.sqrt (ℓ * V) := Real.sqrt_pos.2 (mul_pos hℓ hV) have ht : 0 < Real.sqrt (ℓ * η) := Real.sqrt_pos.2 (mul_pos hℓ hη) have hw : 0 < Real.sqrt (η * V) := Real.sqrt_pos.2 (mul_pos hη hV) have hcroot : 0 < Real.sqrt c := Real.sqrt_pos.2 hc have hcross : Real.sqrt (ℓ * V) * η = Real.sqrt (ℓ * η) * Real.sqrt (η * V) := by have heq : (Real.sqrt (ℓ * V) * η) ^ 2 = (Real.sqrt (ℓ * η) * Real.sqrt (η * V)) ^ 2 := by rw [mul_pow, mul_pow, Real.sq_sqrt (mul_nonneg hℓ.le hV.le), Real.sq_sqrt (mul_nonneg hℓ.le hη.le), Real.sq_sqrt (mul_nonneg hη.le hV.le)] ring nlinarith [mul_pos hs hη, mul_pos ht hw] have hwlower : Real.sqrt c ≤ Real.sqrt (η * V) := Real.sqrt_le_sqrt hvariance have hU : 0 ≤ U := hη.le.trans hηU calc z / Real.sqrt (ℓ * V) = η * z / (Real.sqrt (ℓ * η) * Real.sqrt (η * V)) := by field_simp [hs.ne', ht.ne', hw.ne'] calc z * Real.sqrt (ℓ * η) * Real.sqrt (V * η) = z * (Real.sqrt (ℓ * η) * Real.sqrt (η * V)) := by rw [mul_comm V η] ring _ = z * (Real.sqrt (ℓ * V) * η) := by rw [hcross] _ = z * Real.sqrt (ℓ * V) * η := by ring _ ≤ U * z / (Real.sqrt (ℓ * η) * Real.sqrt c) := by gcongr _ = (U / Real.sqrt c) * (z / Real.sqrt (ℓ * η)) := by ring theorem saddleSourceFirstBranch_central_radius_le {ε ℓ u : ℝ} (hε : 0 < ε) (hεsmall : ε ≤ 1 / 4) (hℓ : 0 < ℓ) (hulower : -1 < u) (huupper : u ≤ 1 + ε / 2) (horder : shortCutoff ε ≤ shortEndpoint ε) (hmargin : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a) : saddleSourceFirstBranchCentralRadius ε ℓ u ≤ ((2 + ε / 2) / Real.sqrt (2 * ε)) * (ℓ * (1 + u)) ^ (-(5 / 12 : ℝ)) := by have hη : 0 < 1 + u := by linarith have hx : 0 < ℓ * (1 + u) := mul_pos hℓ hη have hvariance := upperFirstBranch_saddleSourceGaussianVariance_scaled_lower_bound hε hεsmall hℓ hulower huupper horder hmargin have hbase := saddleSource_scaled_central_radius_le (ℓ := ℓ) (η := 1 + u) (V := saddleSourceGaussianVariance ε ℓ u) (c := 2 * ε) (U := 2 + ε / 2) (z := (ℓ * (1 + u)) ^ (1 / 12 : ℝ)) hℓ hη (by positivity) (by linarith) (Real.rpow_nonneg hx.le _) hvariance calc saddleSourceFirstBranchCentralRadius ε ℓ u ≤ ((2 + ε / 2) / Real.sqrt (2 * ε)) * ((ℓ * (1 + u)) ^ (1 / 12 : ℝ) / Real.sqrt (ℓ * (1 + u))) := by simpa [saddleSourceFirstBranchCentralRadius] using! hbase _ = ((2 + ε / 2) / Real.sqrt (2 * ε)) * (ℓ * (1 + u)) ^ (-(5 / 12 : ℝ)) := by rw [saddleSource_central_rpow_div_sqrt hx] theorem saddleSourceSecondBranch_central_radius_le {ε ℓ u : ℝ} (hℓ : 0 < ℓ) (hfloor : saddleSourceSecondBranchVarianceFloor ε ≤ saddleSourceGaussianVariance ε ℓ u) (hfloorpos : 0 < saddleSourceSecondBranchVarianceFloor ε) : saddleSourceSecondBranchCentralRadius ε ℓ u ≤ (1 / Real.sqrt (saddleSourceSecondBranchVarianceFloor ε)) * ℓ ^ (-(5 / 12 : ℝ)) := by have hV : 0 < saddleSourceGaussianVariance ε ℓ u := hfloorpos.trans_le hfloor have hz : 0 ≤ ℓ ^ (1 / 12 : ℝ) := Real.rpow_nonneg hℓ.le _ calc saddleSourceSecondBranchCentralRadius ε ℓ u = ℓ ^ (1 / 12 : ℝ) / Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) := rfl _ ≤ ℓ ^ (1 / 12 : ℝ) / Real.sqrt (ℓ * saddleSourceSecondBranchVarianceFloor ε) := by gcongr _ = (1 / Real.sqrt (saddleSourceSecondBranchVarianceFloor ε)) * (ℓ ^ (1 / 12 : ℝ) / Real.sqrt ℓ) := by rw [Real.sqrt_mul hℓ.le] ring _ = (1 / Real.sqrt (saddleSourceSecondBranchVarianceFloor ε)) * ℓ ^ (-(5 / 12 : ℝ)) := by rw [saddleSource_central_rpow_div_sqrt hℓ] theorem eventually_saddleSourceFirstBranch_cubic_window : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ κ : ℝ, 0 < κ → ∀ᶠ ℓ : ℝ in atTop, ∀ u : ℝ, -1 < u → u ≤ 1 + ε / 2 → Real.log ℓ / 4 ≤ ℓ * (1 + u) → ∀ T : ℝ, |T| ≤ saddleSourceFirstBranchCentralRadius ε ℓ u → (ℓ * upperSaddleThirdMoment ε ℓ (u - 1) / 6) * |T| ^ 3 < κ := by have heps : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ε ≤ 1 / 4 := by have hnear := (tendsto_id.mono_left (nhdsWithin_le_nhds : 𝓝[>] (0 : ℝ) ≤ 𝓝 (0 : ℝ))).eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1 / 4)) filter_upwards [hnear] with ε hε exact hε.le filter_upwards [self_mem_nhdsWithin, heps, eventually_upper_shortCutoff_le_shortEndpoint, eventually_upper_shortMargin_positive] with ε hε hεsmall horder hmargin change 0 < ε at hε have hmargin' : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a := by intro a ha have h := hmargin a ha nlinarith intro κ hκ let A : ℝ := saddleSourceFirstBranchThirdMomentCoefficient ε / (12 * ε * Real.sqrt (2 * ε)) have htendsto : Tendsto (fun x : ℝ => A * x ^ (-(1 / 4 : ℝ))) atTop (𝓝 (0 : ℝ)) := by convert! tendsto_const_nhds.mul (tendsto_rpow_neg_atTop (by norm_num : (0 : ℝ) < 1 / 4)) using 1 all_goals simp obtain ⟨N, hN⟩ := Filter.eventually_atTop.1 (htendsto.eventually (Iio_mem_nhds hκ)) filter_upwards [eventually_gt_atTop (0 : ℝ), Real.tendsto_log_atTop.eventually_ge_atTop (4 * N), Real.tendsto_log_atTop.eventually_ge_atTop (4 : ℝ)] with ℓ hℓ hlog hlogone intro u hu huupper hstar T hT have hxN : N ≤ ℓ * (1 + u) := by nlinarith have hxone : 1 ≤ ℓ * (1 + u) := by nlinarith have hbound := saddleSourceFirstBranch_cubic_central_window_le hε hεsmall hℓ hu huupper horder hmargin' hxone hT exact hbound.trans_lt (hN (ℓ * (1 + u)) hxN) theorem eventually_saddleSourceSecondBranch_cubic_window : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ κ : ℝ, 0 < κ → ∀ᶠ ℓ : ℝ in atTop, ∀ δ : ℝ, ε / 2 ≤ δ → ∀ T : ℝ, |T| ≤ saddleSourceSecondBranchCentralRadius ε ℓ (1 + δ) → (ℓ * upperSaddleThirdMoment ε ℓ δ / 6) * |T| ^ 3 < κ := by filter_upwards [ eventually_saddleSourceSecondBranch_cubic_central_window_le] with ε hquant intro κ hκ let A : ℝ := (2 + (100 / 99 : ℝ) * upperSaddleShellThirdCoefficient ε) / (6 * Real.sqrt (saddleSourceSecondBranchVarianceFloor ε)) have htendsto : Tendsto (fun ℓ : ℝ => A * ℓ ^ (-(1 / 4 : ℝ))) atTop (𝓝 (0 : ℝ)) := by convert! tendsto_const_nhds.mul (tendsto_rpow_neg_atTop (by norm_num : (0 : ℝ) < 1 / 4)) using 1 all_goals simp filter_upwards [eventually_ge_atTop (1 : ℝ), htendsto.eventually (Iio_mem_nhds hκ)] with ℓ hℓ hsmall intro δ hδ T hT exact (hquant ℓ hℓ δ hδ T hT).trans_lt hsmall theorem eventually_saddleSourceFirstBranch_central_radius_lt : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ κ : ℝ, 0 < κ → ∀ᶠ ℓ : ℝ in atTop, ∀ u : ℝ, -1 < u → u ≤ 1 + ε / 2 → Real.log ℓ / 4 ≤ ℓ * (1 + u) → saddleSourceFirstBranchCentralRadius ε ℓ u < κ := by have heps : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ε ≤ 1 / 4 := by have hnear := (tendsto_id.mono_left (nhdsWithin_le_nhds : 𝓝[>] (0 : ℝ) ≤ 𝓝 (0 : ℝ))).eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1 / 4)) filter_upwards [hnear] with ε hε exact hε.le filter_upwards [self_mem_nhdsWithin, heps, eventually_upper_shortCutoff_le_shortEndpoint, eventually_upper_shortMargin_positive] with ε hε hεsmall horder hmargin change 0 < ε at hε have hmargin' : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a := by intro a ha have h := hmargin a ha nlinarith intro κ hκ let A : ℝ := (2 + ε / 2) / Real.sqrt (2 * ε) have htendsto : Tendsto (fun x : ℝ => A * x ^ (-(5 / 12 : ℝ))) atTop (𝓝 (0 : ℝ)) := by convert! tendsto_const_nhds.mul (tendsto_rpow_neg_atTop (by norm_num : (0 : ℝ) < 5 / 12)) using 1 all_goals simp obtain ⟨N, hN⟩ := Filter.eventually_atTop.1 (htendsto.eventually (Iio_mem_nhds hκ)) filter_upwards [eventually_gt_atTop (0 : ℝ), Real.tendsto_log_atTop.eventually_ge_atTop (4 * N)] with ℓ hℓ hlog intro u hu huupper hstar have hxN : N ≤ ℓ * (1 + u) := by nlinarith exact (saddleSourceFirstBranch_central_radius_le hε hεsmall hℓ hu huupper horder hmargin').trans_lt (hN (ℓ * (1 + u)) hxN) theorem eventually_saddleSourceSecondBranch_central_radius_lt : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ κ : ℝ, 0 < κ → ∀ᶠ ℓ : ℝ in atTop, ∀ δ : ℝ, ε / 2 ≤ δ → saddleSourceSecondBranchCentralRadius ε ℓ (1 + δ) < κ := by filter_upwards [self_mem_nhdsWithin, eventually_saddleSourceGaussianVariance_secondBranch_floor] with ε hε hfloor change 0 < ε at hε have hfloorpos := saddleSourceSecondBranchVarianceFloor_pos hε intro κ hκ let A : ℝ := 1 / Real.sqrt (saddleSourceSecondBranchVarianceFloor ε) have htendsto : Tendsto (fun ℓ : ℝ => A * ℓ ^ (-(5 / 12 : ℝ))) atTop (𝓝 (0 : ℝ)) := by convert! tendsto_const_nhds.mul (tendsto_rpow_neg_atTop (by norm_num : (0 : ℝ) < 5 / 12)) using 1 all_goals simp filter_upwards [eventually_gt_atTop (0 : ℝ), htendsto.eventually (Iio_mem_nhds hκ)] with ℓ hℓ hsmall intro δ hδ exact (saddleSourceSecondBranch_central_radius_le hℓ (hfloor ℓ hℓ δ hδ) hfloorpos).trans_lt hsmall theorem exists_saddleSource_central_error_tolerance {κ : ℝ} (hκ : 0 < κ) : ∃ q : ℝ, 0 < q ∧ q ≤ 1 ∧ 2 * q + (1 + 2 * q) * q < κ := by let q : ℝ := min (1 / 4 : ℝ) (κ / 8) have hq : 0 < q := by try dsimp [q] positivity have hquarter : q ≤ (1 / 4 : ℝ) := min_le_left _ _ have hk : q ≤ κ / 8 := min_le_right _ _ refine ⟨q, hq, by linarith, ?_⟩ nlinarith [mul_nonneg hq.le (sub_nonneg.mpr hquarter)] theorem eventually_saddleSourceFirstBranch_centralGaussianErrors : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ κ : ℝ, 0 < κ → ∀ᶠ ℓ : ℝ in atTop, ∀ u : ℝ, -1 < u → u ≤ 1 + ε / 2 → Real.log ℓ / 4 ≤ ℓ * (1 + u) → (‖∫ T : ℝ in Icc (-(saddleSourceFirstBranchCentralRadius ε ℓ u)) (saddleSourceFirstBranchCentralRadius ε ℓ u), (saddleSourceCenteredPlusIntegrand ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T - saddleSourceGaussianPlusIntegrand ε ℓ u T)‖ < κ * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T)) ∧ (1 + ε / 4 ≤ u → ‖∫ T : ℝ in Icc (-(saddleSourceFirstBranchCentralRadius ε ℓ u)) (saddleSourceFirstBranchCentralRadius ε ℓ u), (saddleSourceCenteredMinusIntegrand ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T - saddleSourceGaussianMinusIntegrand ε ℓ u T)‖ < κ * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T)) := by filter_upwards [self_mem_nhdsWithin, eventually_upper_shortCutoff_le_shortEndpoint, eventually_upper_shortMargin_positive, eventually_saddleSourceGaussianVariance_firstBranch_pos, eventually_saddleSourceFirstBranch_cubic_window, eventually_saddleSourceFirstBranch_central_radius_lt] with ε hε horder hmargin hvariance hcubic hradius change 0 < ε at hε have hmargin' : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a := by intro a ha have h := hmargin a ha nlinarith intro κ hκ obtain ⟨q, hq, hqone, hfactor⟩ := exists_saddleSource_central_error_tolerance hκ obtain ⟨Rp, hRp, hplus⟩ := exists_plusPolynomial_uniform_central_window hε hq obtain ⟨Rm, hRm, hminus⟩ := exists_minusPolynomial_uniform_central_window hε hq filter_upwards [eventually_gt_atTop (0 : ℝ), hcubic q hq, hradius Rp hRp, hradius Rm hRm] with ℓ hℓ hqc hsmallplus hsmallminus intro u hu huupper hstar let R : ℝ := saddleSourceFirstBranchCentralRadius ε ℓ u have hV := hvariance ℓ hℓ u hu huupper have hR : 0 ≤ R := by have hη : 0 ≤ 1 + u := by linarith try dsimp [R, saddleSourceFirstBranchCentralRadius] exact div_nonneg (Real.rpow_nonneg (mul_nonneg hℓ.le hη) _) (Real.sqrt_nonneg _) have hphase : ∀ T : ℝ, |T| ≤ R → (ℓ * upperSaddleThirdMoment ε ℓ (u - 1) / 6) * |T| ^ 3 ≤ q := by intro T hT exact (hqc u hu huupper hstar T hT).le have hG : 0 < ∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T := saddleSourceGaussianKernel_integral_pos hℓ hV constructor · have hpoly : ∀ T : ℝ, |T| ≤ R → ‖plusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) - plusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ q * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := by intro T hT exact hplus u hu.le T (hT.trans (hsmallplus u hu huupper hstar).le) have hden : 0 < ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := (beta_pos hε).trans_le (plusPolynomial_imaginary_norm_ge_beta hε hu.le) have hcentral := saddleSourceCenteredPlusIntegrand_centralGaussianError_le hε hℓ hu horder hmargin' hV hR hq.le hqone hq.le hphase hpoly calc ‖∫ T : ℝ in Icc (-R) R, (saddleSourceCenteredPlusIntegrand ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T - saddleSourceGaussianPlusIntegrand ε ℓ u T)‖ ≤ (2 * q + (1 + 2 * q) * q) * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := hcentral _ < κ * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by gcongr · intro huminus have hpoly : ∀ T : ℝ, |T| ≤ R → ‖minusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) - minusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ q * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by intro T hT exact hminus u huminus T (hT.trans (hsmallminus u hu huupper hstar).le) have hden : 0 < ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hbeta := beta_pos hε have hbound := minusPolynomial_imaginary_norm_ge_three_beta hε huminus nlinarith have hcentral := saddleSourceCenteredMinusIntegrand_centralGaussianError_le hε hℓ hu horder hmargin' hV hR hq.le hqone hq.le hphase hpoly calc ‖∫ T : ℝ in Icc (-R) R, (saddleSourceCenteredMinusIntegrand ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T - saddleSourceGaussianMinusIntegrand ε ℓ u T)‖ ≤ (2 * q + (1 + 2 * q) * q) * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := hcentral _ < κ * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by gcongr theorem eventually_saddleSourceSecondBranch_centralGaussianErrors : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ κ : ℝ, 0 < κ → ∀ᶠ ℓ : ℝ in atTop, ∀ δ : ℝ, ε / 2 ≤ δ → (‖∫ T : ℝ in Icc (-(saddleSourceSecondBranchCentralRadius ε ℓ (1 + δ))) (saddleSourceSecondBranchCentralRadius ε ℓ (1 + δ)), (saddleSourceCenteredPlusIntegrand ε ℓ (1 + δ) (saddleSourceStationaryLogRadius ε ℓ (1 + δ)) T - saddleSourceGaussianPlusIntegrand ε ℓ (1 + δ) T)‖ < κ * ‖plusPolynomial ε (Complex.I * ((1 + δ : ℝ) : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ (1 + δ) T)) ∧ (‖∫ T : ℝ in Icc (-(saddleSourceSecondBranchCentralRadius ε ℓ (1 + δ))) (saddleSourceSecondBranchCentralRadius ε ℓ (1 + δ)), (saddleSourceCenteredMinusIntegrand ε ℓ (1 + δ) (saddleSourceStationaryLogRadius ε ℓ (1 + δ)) T - saddleSourceGaussianMinusIntegrand ε ℓ (1 + δ) T)‖ < κ * ‖minusPolynomial ε (Complex.I * ((1 + δ : ℝ) : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ (1 + δ) T)) := by filter_upwards [self_mem_nhdsWithin, eventually_upper_shortCutoff_le_shortEndpoint, eventually_upper_shortMargin_positive, eventually_saddleSourceGaussianVariance_secondBranch_pos, eventually_saddleSourceSecondBranch_cubic_window, eventually_saddleSourceSecondBranch_central_radius_lt] with ε hε horder hmargin hvariance hcubic hradius change 0 < ε at hε have hmargin' : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a := by intro a ha have h := hmargin a ha nlinarith intro κ hκ obtain ⟨q, hq, hqone, hfactor⟩ := exists_saddleSource_central_error_tolerance hκ obtain ⟨Rp, hRp, hplus⟩ := exists_plusPolynomial_uniform_central_window hε hq obtain ⟨Rm, hRm, hminus⟩ := exists_minusPolynomial_uniform_central_window hε hq filter_upwards [eventually_gt_atTop (0 : ℝ), hcubic q hq, hradius Rp hRp, hradius Rm hRm] with ℓ hℓ hqc hsmallplus hsmallminus intro δ hδ let u : ℝ := 1 + δ let R : ℝ := saddleSourceSecondBranchCentralRadius ε ℓ u have hδzero : 0 ≤ δ := by linarith have hu : -1 < u := by try dsimp [u] linarith have huminus : 1 + ε / 4 ≤ u := by try dsimp [u] linarith have hV : 0 < saddleSourceGaussianVariance ε ℓ u := by try dsimp [u] exact hvariance ℓ hℓ δ hδ have hR : 0 ≤ R := by try dsimp [R, saddleSourceSecondBranchCentralRadius] positivity have hphase : ∀ T : ℝ, |T| ≤ R → (ℓ * upperSaddleThirdMoment ε ℓ (u - 1) / 6) * |T| ^ 3 ≤ q := by intro T hT have h := hqc δ hδ T hT have huarg : u - 1 = δ := by try dsimp [u] ring rw [huarg] exact h.le have hG : 0 < ∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T := saddleSourceGaussianKernel_integral_pos hℓ hV constructor · have hpoly : ∀ T : ℝ, |T| ≤ R → ‖plusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) - plusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ q * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := by intro T hT exact hplus u hu.le T (hT.trans (hsmallplus δ hδ).le) have hden : 0 < ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := (beta_pos hε).trans_le (plusPolynomial_imaginary_norm_ge_beta hε hu.le) have hcentral := saddleSourceCenteredPlusIntegrand_centralGaussianError_le hε hℓ hu horder hmargin' hV hR hq.le hqone hq.le hphase hpoly change ‖∫ T : ℝ in Icc (-R) R, (saddleSourceCenteredPlusIntegrand ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T - saddleSourceGaussianPlusIntegrand ε ℓ u T)‖ < κ * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) exact hcentral.trans_lt (by gcongr) · have hpoly : ∀ T : ℝ, |T| ≤ R → ‖minusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) - minusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ q * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by intro T hT exact hminus u huminus T (hT.trans (hsmallminus δ hδ).le) have hden : 0 < ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hbeta := beta_pos hε have hbound := minusPolynomial_imaginary_norm_ge_three_beta hε huminus nlinarith have hcentral := saddleSourceCenteredMinusIntegrand_centralGaussianError_le hε hℓ hu horder hmargin' hV hR hq.le hqone hq.le hphase hpoly change ‖∫ T : ℝ in Icc (-R) R, (saddleSourceCenteredMinusIntegrand ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T - saddleSourceGaussianMinusIntegrand ε ℓ u T)‖ < κ * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) exact hcentral.trans_lt (by gcongr) theorem upperPositiveShellDamping_local_variance_lower {ε ℓ δ T : ℝ} (hε : 0 < ε) (hℓ : 0 ≤ ℓ) (hT : |T| ≤ 1 / (2 * (shellLocation ε + 1))) : (ℓ / 4) * upperPositiveShellVariance ε δ * T ^ 2 ≤ positiveShellDamping ε ℓ δ T := by let B : ℝ := shellLocation ε have hB : 0 ≤ B := by try dsimp [B, shellLocation] positivity have hB1 : 0 < B + 1 := by linarith have horder : B ≤ B + 1 := by linarith have hwindow : (B + 1) * |T| ≤ 1 / 2 := by calc (B + 1) * |T| ≤ (B + 1) * (1 / (2 * (B + 1))) := by apply mul_le_mul_of_nonneg_left _ (by linarith) simpa [B] using! hT _ = 1 / 2 := by field_simp [hB1.ne'] have hdensity : Continuous (positiveShellDensity ε) := positiveShellDensity_continuous ε have hcosh : Continuous (fun a : ℝ => Real.cosh ((1 + δ) * a)) := by fun_prop have hosc : Continuous (fun a : ℝ => 1 - Real.cos (a * T)) := by fun_prop have hleft : Continuous (fun a : ℝ => (positiveShellDensity ε a * a ^ 2 * Real.cosh ((1 + δ) * a)) * (T ^ 2 / 4)) := ((hdensity.mul (continuous_id.pow 2)).mul hcosh).mul continuous_const have hright : Continuous (fun a : ℝ => positiveShellDensity ε a * Real.cosh ((1 + δ) * a) * (1 - Real.cos (a * T))) := (hdensity.mul hcosh).mul hosc have hpoint : ∀ a ∈ Icc B (B + 1), (positiveShellDensity ε a * a ^ 2 * Real.cosh ((1 + δ) * a)) * (T ^ 2 / 4) ≤ positiveShellDensity ε a * Real.cosh ((1 + δ) * a) * (1 - Real.cos (a * T)) := by intro a ha have ha0 : 0 ≤ a := hB.trans ha.1 have haT : |a * T| ≤ 1 := by rw [abs_mul, abs_of_nonneg ha0] calc a * |T| ≤ (B + 1) * |T| := mul_le_mul_of_nonneg_right ha.2 (abs_nonneg T) _ ≤ 1 / 2 := hwindow _ ≤ 1 := by norm_num have hquadratic := upper_one_sub_cos_quadratic_lower haT have hw : 0 ≤ positiveShellDensity ε a * Real.cosh ((1 + δ) * a) := by unfold positiveShellDensity positivity [shellWeight_pos ε] calc (positiveShellDensity ε a * a ^ 2 * Real.cosh ((1 + δ) * a)) * (T ^ 2 / 4) = (positiveShellDensity ε a * Real.cosh ((1 + δ) * a)) * ((a * T) ^ 2 / 4) := by ring _ ≤ (positiveShellDensity ε a * Real.cosh ((1 + δ) * a)) * (1 - Real.cos (a * T)) := mul_le_mul_of_nonneg_left hquadratic hw _ = positiveShellDensity ε a * Real.cosh ((1 + δ) * a) * (1 - Real.cos (a * T)) := by ring have hmono := intervalIntegral.integral_mono_on (μ := volume) horder (hleft.intervalIntegrable _ _) (hright.intervalIntegrable _ _) hpoint have hleftvalue : (∫ a in B..B + 1, (positiveShellDensity ε a * a ^ 2 * Real.cosh ((1 + δ) * a)) * (T ^ 2 / 4)) = upperPositiveShellVariance ε δ * (T ^ 2 / 4) := by rw [intervalIntegral.integral_mul_const] rfl rw [hleftvalue] at hmono unfold positiveShellDamping change (ℓ / 4) * upperPositiveShellVariance ε δ * T ^ 2 ≤ ℓ * ∫ a in B..B + 1, positiveShellDensity ε a * Real.cosh ((1 + δ) * a) * (1 - Real.cos (a * T)) calc (ℓ / 4) * upperPositiveShellVariance ε δ * T ^ 2 = ℓ * (upperPositiveShellVariance ε δ * (T ^ 2 / 4)) := by ring _ ≤ ℓ * ∫ a in B..B + 1, positiveShellDensity ε a * Real.cosh ((1 + δ) * a) * (1 - Real.cos (a * T)) := mul_le_mul_of_nonneg_left hmono hℓ theorem upperGammaVarianceDensity_laplace_linear_lower {ℓ η a : ℝ} (hℓ : 0 < ℓ) (ha : 0 < a) : a * Real.exp (-η * a) ≤ a ^ 2 * upperGammaMeasureDensity ℓ η a := by let x : ℝ := 2 * a / ℓ have hx : 0 < x := by try dsimp [x] positivity have hden : 0 < 1 - Real.exp (-x) := by have h := Real.exp_lt_one_iff.mpr (show -x < 0 by linarith) linarith have hdenone : 1 - Real.exp (-x) ≤ 1 := by linarith [Real.exp_pos (-x)] have hinv : 1 ≤ (1 - Real.exp (-x))⁻¹ := by rw [inv_eq_one_div] apply (le_div_iff₀ hden).2 simpa using! hdenone have hfactor : 0 ≤ a * Real.exp (-η * a) := by positivity calc a * Real.exp (-η * a) = (a * Real.exp (-η * a)) * 1 := by ring _ ≤ (a * Real.exp (-η * a)) * (1 - Real.exp (-x))⁻¹ := mul_le_mul_of_nonneg_left hinv hfactor _ = a ^ 2 * upperGammaMeasureDensity ℓ η a := by unfold upperGammaMeasureDensity try dsimp [x] field_simp [ha.ne', hden.ne'] theorem upperGammaDamping_local_variance_lower {ℓ η T : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (hT : |T| ≤ η) : (ℓ / (32 * Real.exp 1)) * upperGammaVariance ℓ η * T ^ 2 ≤ upperGammaDamping ℓ η T := by let p : ℝ := 1 / (2 * η) let q : ℝ := 1 / η let C : ℝ := ((ℓ / 4 + 1 / (4 * η)) * (Real.exp 1)⁻¹) * (T ^ 2 / 4) have hp : 0 < p := by try dsimp [p] positivity have hq : 0 < q := by try dsimp [q] positivity have hpq : p ≤ q := by try dsimp [p, q] calc 1 / (2 * η) = (1 / η) / 2 := by ring _ ≤ 1 / η := by nlinarith [inv_pos.mpr hη] have hsubset : Ioc p q ⊆ Ioi (0 : ℝ) := by intro a ha exact hp.trans ha.1 have hfull := upperGammaDampingIntegrand_integrable hℓ hη T have hsmall := hfull.mono_set hsubset have hconstant : IntegrableOn (fun _ : ℝ => C) (Ioc p q) := by exact integrableOn_const (by rw [Real.volume_Ioc] exact ENNReal.ofReal_ne_top) have hpoint : ∀ a ∈ Ioc p q, C ≤ upperGammaDampingIntegrand ℓ η T a := by intro a ha have ha0 : 0 < a := hp.trans ha.1 have halower : 1 / (2 * η) ≤ a := by simpa [p] using! ha.1.le have haupper : a ≤ 1 / η := by simpa [q] using! ha.2 have hquarter : 1 / (4 * η) ≤ a / 2 := by calc 1 / (4 * η) = (1 / (2 * η)) / 2 := by ring _ ≤ a / 2 := by gcongr have heta : η * a ≤ 1 := by calc η * a ≤ η * (1 / η) := mul_le_mul_of_nonneg_left haupper hη.le _ = 1 := by field_simp have hexp : (Real.exp 1)⁻¹ ≤ Real.exp (-η * a) := by rw [← Real.exp_neg] apply Real.exp_le_exp.mpr linarith have hmoment : (ℓ / 4 + 1 / (4 * η)) * (Real.exp 1)⁻¹ ≤ a ^ 2 * upperGammaMeasureDensity ℓ η a := by have hbase : 0 ≤ ℓ / 4 + 1 / (4 * η) := by positivity have hgamma := (upperGammaVarianceDensity_pointwise_bounds (η := η) hℓ ha0).1 have hlinear := upperGammaVarianceDensity_laplace_linear_lower (η := η) hℓ ha0 calc (ℓ / 4 + 1 / (4 * η)) * (Real.exp 1)⁻¹ ≤ (ℓ / 4 + 1 / (4 * η)) * Real.exp (-η * a) := mul_le_mul_of_nonneg_left hexp hbase _ ≤ (ℓ / 4 + a / 2) * Real.exp (-η * a) := by gcongr _ ≤ a ^ 2 * upperGammaMeasureDensity ℓ η a := by nlinarith have haT : |a * T| ≤ 1 := by rw [abs_mul, abs_of_pos ha0] calc a * |T| ≤ a * η := mul_le_mul_of_nonneg_left hT ha0.le _ = η * a := by ring _ ≤ 1 := heta have hcos := upper_one_sub_cos_quadratic_lower haT have hdensity := upperGammaMeasureDensity_pos (η := η) hℓ ha0 calc C = (T ^ 2 / 4) * ((ℓ / 4 + 1 / (4 * η)) * (Real.exp 1)⁻¹) := by try dsimp [C] ring _ ≤ (T ^ 2 / 4) * (a ^ 2 * upperGammaMeasureDensity ℓ η a) := mul_le_mul_of_nonneg_left hmoment (by positivity) _ = ((a * T) ^ 2 / 4) * upperGammaMeasureDensity ℓ η a := by ring _ ≤ (1 - Real.cos (a * T)) * upperGammaMeasureDensity ℓ η a := mul_le_mul_of_nonneg_right hcos hdensity.le _ = upperGammaDampingIntegrand ℓ η T a := rfl have hmono := MeasureTheory.setIntegral_mono_on hconstant hsmall measurableSet_Ioc hpoint have hnonnegative : 0 ≤ᶠ[ae (volume.restrict (Ioi (0 : ℝ)))] upperGammaDampingIntegrand ℓ η T := by filter_upwards [ae_restrict_mem measurableSet_Ioi] with a ha unfold upperGammaDampingIntegrand exact mul_nonneg (sub_nonneg.mpr (Real.cos_le_one _)) (upperGammaMeasureDensity_pos (η := η) hℓ ha).le have haesubset : Ioc p q ≤ᶠ[ae (volume : Measure ℝ)] Ioi 0 := Filter.Eventually.of_forall (fun a ha => hsubset ha) have hrestrict := MeasureTheory.setIntegral_mono_set hfull hnonnegative haesubset have hmeasure : (volume : Measure ℝ).real (Ioc p q) = q - p := by change ((volume : Measure ℝ) (Ioc p q)).toReal = q - p rw [Real.volume_Ioc, ENNReal.toReal_ofReal (sub_nonneg.mpr hpq)] have hconstintegral : (∫ a : ℝ in Ioc p q, C) = (q - p) * C := by rw [setIntegral_const, hmeasure] rfl have hγupper := (upperGammaVariance_bounds hℓ hη).2 have hscaled : ℓ * upperGammaVariance ℓ η ≤ ℓ / η + 1 / η ^ 2 := by calc ℓ * upperGammaVariance ℓ η ≤ ℓ * (1 / (2 * η) + 1 / (ℓ * η ^ 2)) := mul_le_mul_of_nonneg_left hγupper hℓ.le _ = ℓ / (2 * η) + 1 / η ^ 2 := by field_simp [hℓ.ne', hη.ne'] _ ≤ ℓ / η + 1 / η ^ 2 := by gcongr linarith have hidentity : (q - p) * C = ((ℓ / η + 1 / η ^ 2) / (32 * Real.exp 1)) * T ^ 2 := by try dsimp [p, q, C] field_simp [hη.ne', (Real.exp_pos 1).ne']; ring calc (ℓ / (32 * Real.exp 1)) * upperGammaVariance ℓ η * T ^ 2 = (ℓ * upperGammaVariance ℓ η / (32 * Real.exp 1)) * T ^ 2 := by ring _ ≤ ((ℓ / η + 1 / η ^ 2) / (32 * Real.exp 1)) * T ^ 2 := by gcongr _ = (q - p) * C := hidentity.symm _ = ∫ a : ℝ in Ioc p q, C := hconstintegral.symm _ ≤ ∫ a : ℝ in Ioc p q, upperGammaDampingIntegrand ℓ η T a := hmono _ ≤ ∫ a : ℝ in Ioi 0, upperGammaDampingIntegrand ℓ η T a := hrestrict _ = upperGammaDamping ℓ η T := rfl theorem eventually_saddleSourceContourDamping_secondBranch_local_coercivity : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ ℓ : ℝ, 0 < ℓ → ∀ δ : ℝ, ε / 2 ≤ δ → ∀ T : ℝ, |T| ≤ 1 / (2 * (shellLocation ε + 1)) → (ℓ / (100 * Real.exp 1)) * saddleSourceGaussianVariance ε ℓ (1 + δ) * T ^ 2 ≤ saddleSourceContourDamping ε ℓ (1 + δ) T := by filter_upwards [self_mem_nhdsWithin, eventually_upperSaddleDamping_gamma_add_shell, eventually_upper_netShellVariance_bounds] with ε hε hdom hnet change 0 < ε at hε intro ℓ hℓ δ hδ T hT have hδnonnegative : 0 ≤ δ := by nlinarith have hη : 0 < 2 + δ := by linarith have hB : 0 ≤ shellLocation ε := by unfold shellLocation positivity have hhalf : 1 / (2 * (shellLocation ε + 1)) ≤ (1 / 2 : ℝ) := by have hb : 0 < 2 * (shellLocation ε + 1) := by positivity apply (div_le_iff₀ hb).2 nlinarith have hTgamma : |T| ≤ 2 + δ := by have hsmall := hT.trans hhalf linarith have hgamma := upperGammaDamping_local_variance_lower hℓ hη hTgamma have hshell := upperPositiveShellDamping_local_variance_lower (δ := δ) hε hℓ.le hT have hS : 0 ≤ upperPositiveShellVariance ε δ := (upperPositiveShellVariance_pos hε hδnonnegative).le have hG : 0 ≤ upperGammaVariance ℓ (2 + δ) := by have h := (upperGammaVariance_bounds hℓ hη).1 have hpositive : 0 < 1 / (2 * (2 + δ)) := by positivity exact hpositive.le.trans h have he : 0 < Real.exp 1 := Real.exp_pos 1 have hγcoefficient : (1 / (100 * Real.exp 1) : ℝ) ≤ 1 / (32 * Real.exp 1) := by gcongr norm_num have hγbase : 0 ≤ ℓ * upperGammaVariance ℓ (2 + δ) * T ^ 2 := by positivity have hγscaled : (ℓ / (100 * Real.exp 1)) * upperGammaVariance ℓ (2 + δ) * T ^ 2 ≤ upperGammaDamping ℓ (2 + δ) T := by calc (ℓ / (100 * Real.exp 1)) * upperGammaVariance ℓ (2 + δ) * T ^ 2 ≤ (ℓ / (32 * Real.exp 1)) * upperGammaVariance ℓ (2 + δ) * T ^ 2 := by convert! mul_le_mul_of_nonneg_right hγcoefficient hγbase using 1 <;> ring _ ≤ upperGammaDamping ℓ (2 + δ) T := hgamma have heone : 1 ≤ Real.exp 1 := (Real.one_le_exp_iff).mpr (by norm_num) have hscoefficient : (1 / (100 * Real.exp 1) : ℝ) ≤ (99 / 100 : ℝ) * (1 / 4) := by calc (1 / (100 * Real.exp 1) : ℝ) ≤ 1 / 100 := by apply (div_le_iff₀ (by positivity : (0 : ℝ) < 100 * Real.exp 1)).2 nlinarith _ ≤ (99 / 100 : ℝ) * (1 / 4) := by norm_num have hsbase : 0 ≤ ℓ * upperPositiveShellVariance ε δ * T ^ 2 := by positivity have hsscaled : (ℓ / (100 * Real.exp 1)) * upperPositiveShellVariance ε δ * T ^ 2 ≤ (99 / 100 : ℝ) * positiveShellDamping ε ℓ δ T := by calc (ℓ / (100 * Real.exp 1)) * upperPositiveShellVariance ε δ * T ^ 2 ≤ (99 / 100 : ℝ) * ((ℓ / 4) * upperPositiveShellVariance ε δ * T ^ 2) := by convert! mul_le_mul_of_nonneg_right hscoefficient hsbase using 1 <;> ring _ ≤ (99 / 100 : ℝ) * positiveShellDamping ε ℓ δ T := mul_le_mul_of_nonneg_left hshell (by norm_num) have hvariance : upperSaddleVariance ε ℓ δ ≤ upperGammaVariance ℓ (2 + δ) + upperPositiveShellVariance ε δ := by unfold upperSaddleVariance linarith [(hnet δ hδ).2] have hfactor : 0 ≤ (ℓ / (100 * Real.exp 1)) * T ^ 2 := by positivity calc (ℓ / (100 * Real.exp 1)) * saddleSourceGaussianVariance ε ℓ (1 + δ) * T ^ 2 = (ℓ / (100 * Real.exp 1)) * upperSaddleVariance ε ℓ δ * T ^ 2 := by simp [saddleSourceGaussianVariance] _ ≤ (ℓ / (100 * Real.exp 1)) * upperGammaVariance ℓ (2 + δ) * T ^ 2 + (ℓ / (100 * Real.exp 1)) * upperPositiveShellVariance ε δ * T ^ 2 := by convert! mul_le_mul_of_nonneg_left hvariance hfactor using 1 <;> ring _ ≤ upperGammaDamping ℓ (2 + δ) T + (99 / 100 : ℝ) * positiveShellDamping ε ℓ δ T := add_le_add hγscaled hsscaled _ ≤ upperSaddleDamping ε ℓ δ T := hdom ℓ hℓ δ hδ T _ = saddleSourceContourDamping ε ℓ (1 + δ) T := (saddleSourceContourDamping_eq_secondBranch ε ℓ δ T).symm theorem eventually_saddleSourceContourDamping_secondBranch_min_lower_bound : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ ℓ : ℝ, 0 < ℓ → ∀ δ : ℝ, ε / 2 ≤ δ → ∀ T : ℝ, (ℓ / (8 * Real.exp 1)) * min (T ^ 2 / (2 + δ)) |T| ≤ saddleSourceContourDamping ε ℓ (1 + δ) T := by filter_upwards [self_mem_nhdsWithin, eventually_upperSaddleDamping_gamma_add_shell] with ε hε hdom change 0 < ε at hε intro ℓ hℓ δ hδ T have hδ0 : 0 ≤ δ := by nlinarith have hη : 0 < 2 + δ := by linarith have hgamma := upperGammaDamping_lower_bound hℓ hη T have hshell : 0 ≤ (99 / 100 : ℝ) * positiveShellDamping ε ℓ δ T := by positivity [positiveShellDamping_nonneg (ε := ε) (δ := δ) (T := T) hℓ.le] rw [saddleSourceContourDamping_eq_secondBranch] linarith [hdom ℓ hℓ δ hδ T] theorem eventually_saddleSource_secondBranch_weighted_integrable : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ ℓ : ℝ, 0 < ℓ → ∀ δ : ℝ, ε / 2 ≤ δ → Integrable (fun T : ℝ => saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ (1 + δ) T)) := by filter_upwards [self_mem_nhdsWithin, eventually_upper_shortCutoff_le_shortEndpoint, eventually_saddleSourceContourDamping_secondBranch_min_lower_bound] with ε hε horder hcoercive change 0 < ε at hε intro ℓ hℓ δ hδ let η : ℝ := 2 + δ let a : ℝ := ℓ / (8 * Real.exp 1) have hδ0 : 0 ≤ δ := by nlinarith have hη : 0 < η := by try dsimp [η] linarith have ha : 0 < a := by try dsimp [a] positivity have hu : -1 < 1 + δ := by linarith have hgaussian := saddleGaussianTailWeight_mul_gaussian_integrable (div_pos ha hη) have hlinear := saddleGaussianTailWeight_mul_exp_abs_integrable ha have hmajor := hgaussian.add hlinear apply hmajor.mono' (saddleSourceTailIntegrand_continuous hε hℓ hu horder).aestronglyMeasurable filter_upwards [] with T rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (saddleGaussianTailWeight_nonneg T) (Real.exp_pos _).le)] have hsource := hcoercive ℓ hℓ δ hδ T have hmin := saddle_exp_neg_mul_min_le_add (a := a) (x := T ^ 2 / η) (y := |T|) ha.le have hexp : Real.exp (-saddleSourceContourDamping ε ℓ (1 + δ) T) ≤ Real.exp (-(a / η) * T ^ 2) + Real.exp (-a * |T|) := by calc Real.exp (-saddleSourceContourDamping ε ℓ (1 + δ) T) ≤ Real.exp (-a * min (T ^ 2 / η) |T|) := by apply Real.exp_le_exp.mpr simpa [a, η] using! neg_le_neg hsource _ ≤ Real.exp (-a * (T ^ 2 / η)) + Real.exp (-a * |T|) := hmin _ = Real.exp (-(a / η) * T ^ 2) + Real.exp (-a * |T|) := by congr 2 ring change saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ (1 + δ) T) ≤ saddleGaussianTailWeight T * Real.exp (-(a / η) * T ^ 2) + saddleGaussianTailWeight T * Real.exp (-a * |T|) nlinarith [mul_le_mul_of_nonneg_left hexp (saddleGaussianTailWeight_nonneg T)] theorem saddleGaussian_weighted_integral_le_rescaled {k : ℝ} (hk : 0 < k) : (∫ T : ℝ, saddleGaussianTailWeight T * Real.exp (-k * T ^ 2)) ≤ 2 * max (1 : ℝ) ((Real.sqrt (k / 6) ^ 3)⁻¹) * Real.sqrt (Real.pi / (k / 2)) := by let s : ℝ := Real.sqrt (k / 6) let C : ℝ := max (1 : ℝ) (s ^ 3)⁻¹ have hs : 0 < s := by try dsimp [s] positivity have hC : 0 ≤ C := by try dsimp [C] positivity have hCone : 1 ≤ C := le_max_left _ _ have hCinv : (s ^ 3)⁻¹ ≤ C := le_max_right _ _ have hCproduct : 1 ≤ C * s ^ 3 := by calc (1 : ℝ) = (s ^ 3)⁻¹ * s ^ 3 := by field_simp [hs.ne'] _ ≤ C * s ^ 3 := mul_le_mul_of_nonneg_right hCinv (by positivity) have hsquare : s ^ 2 = k / 6 := by try dsimp [s] rw [Real.sq_sqrt (by positivity)] have hweight (T : ℝ) : saddleGaussianTailWeight T ≤ C * saddleGaussianTailWeight (s * T) := by unfold saddleGaussianTailWeight rw [abs_mul, abs_of_pos hs] have hcube : 0 ≤ |T| ^ 3 := by positivity have hscaled := mul_le_mul_of_nonneg_right hCproduct hcube nlinarith have hpoint (T : ℝ) : saddleGaussianTailWeight T * Real.exp (-k * T ^ 2) ≤ (2 * C) * Real.exp (-(k / 2) * T ^ 2) := by calc saddleGaussianTailWeight T * Real.exp (-k * T ^ 2) ≤ (C * saddleGaussianTailWeight (s * T)) * Real.exp (-k * T ^ 2) := by exact mul_le_mul_of_nonneg_right (hweight T) (Real.exp_pos _).le _ ≤ (C * (2 * Real.exp (3 * (s * T) ^ 2))) * Real.exp (-k * T ^ 2) := by gcongr exact saddleGaussianTailWeight_le_two_exp_three_sq (s * T) _ = (2 * C) * Real.exp (-(k / 2) * T ^ 2) := by have hargument : 3 * (s * T) ^ 2 + -k * T ^ 2 = -(k / 2) * T ^ 2 := by rw [mul_pow, hsquare] ring calc (C * (2 * Real.exp (3 * (s * T) ^ 2))) * Real.exp (-k * T ^ 2) = (2 * C) * (Real.exp (3 * (s * T) ^ 2) * Real.exp (-k * T ^ 2)) := by ring _ = (2 * C) * Real.exp (-(k / 2) * T ^ 2) := by rw [← Real.exp_add, hargument] have hsource := saddleGaussianTailWeight_mul_gaussian_integrable hk have hmajor := (integrable_exp_neg_mul_sq (show 0 < k / 2 by positivity)).const_mul (2 * C) have hmono := integral_mono_ae hsource hmajor (Filter.Eventually.of_forall hpoint) calc (∫ T : ℝ, saddleGaussianTailWeight T * Real.exp (-k * T ^ 2)) ≤ ∫ T : ℝ, (2 * C) * Real.exp (-(k / 2) * T ^ 2) := hmono _ = 2 * max (1 : ℝ) ((Real.sqrt (k / 6) ^ 3)⁻¹) * Real.sqrt (Real.pi / (k / 2)) := by rw [MeasureTheory.integral_const_mul, integral_gaussian] theorem saddleExponential_weighted_integral_le_rescaled {k : ℝ} (hk : 0 < k) : (∫ T : ℝ, saddleGaussianTailWeight T * Real.exp (-k * |T|)) ≤ 2 * max (1 : ℝ) (((k / 6) ^ 3)⁻¹) * (2 / (k / 2)) := by let s : ℝ := k / 6 let C : ℝ := max (1 : ℝ) (s ^ 3)⁻¹ have hs : 0 < s := by try dsimp [s] positivity have hC : 0 ≤ C := by try dsimp [C] positivity have hCone : 1 ≤ C := le_max_left _ _ have hCinv : (s ^ 3)⁻¹ ≤ C := le_max_right _ _ have hCproduct : 1 ≤ C * s ^ 3 := by calc (1 : ℝ) = (s ^ 3)⁻¹ * s ^ 3 := by field_simp [hs.ne'] _ ≤ C * s ^ 3 := mul_le_mul_of_nonneg_right hCinv (by positivity) have hweight (T : ℝ) : saddleGaussianTailWeight T ≤ C * saddleGaussianTailWeight (s * T) := by unfold saddleGaussianTailWeight rw [abs_mul, abs_of_pos hs] have hcube : 0 ≤ |T| ^ 3 := by positivity have hscaled := mul_le_mul_of_nonneg_right hCproduct hcube nlinarith have hpoint (T : ℝ) : saddleGaussianTailWeight T * Real.exp (-k * |T|) ≤ (2 * C) * Real.exp (-(k / 2) * |T|) := by calc saddleGaussianTailWeight T * Real.exp (-k * |T|) ≤ (C * saddleGaussianTailWeight (s * T)) * Real.exp (-k * |T|) := by exact mul_le_mul_of_nonneg_right (hweight T) (Real.exp_pos _).le _ ≤ (C * (2 * Real.exp (3 * |s * T|))) * Real.exp (-k * |T|) := by gcongr exact saddleGaussianTailWeight_le_two_exp_three_abs (s * T) _ = (2 * C) * Real.exp (-(k / 2) * |T|) := by have hargument : 3 * |s * T| + -k * |T| = -(k / 2) * |T| := by rw [abs_mul, abs_of_pos hs] try dsimp [s] ring calc (C * (2 * Real.exp (3 * |s * T|))) * Real.exp (-k * |T|) = (2 * C) * (Real.exp (3 * |s * T|) * Real.exp (-k * |T|)) := by ring _ = (2 * C) * Real.exp (-(k / 2) * |T|) := by rw [← Real.exp_add, hargument] have hsource := saddleGaussianTailWeight_mul_exp_abs_integrable hk have hmajor := (integrable_exp_neg_mul_abs (show 0 < k / 2 by positivity)).const_mul (2 * C) have hmono := integral_mono_ae hsource hmajor (Filter.Eventually.of_forall hpoint) calc (∫ T : ℝ, saddleGaussianTailWeight T * Real.exp (-k * |T|)) ≤ ∫ T : ℝ, (2 * C) * Real.exp (-(k / 2) * |T|) := hmono _ = 2 * max (1 : ℝ) (((k / 6) ^ 3)⁻¹) * (2 / (k / 2)) := by rw [MeasureTheory.integral_const_mul, saddle_integral_exp_neg_mul_abs (show 0 < k / 2 by positivity)] def saddleSourceSecondBranchLocalFrequency (ε : ℝ) : ℝ := 1 / (2 * (shellLocation ε + 1)) def saddleSourceSecondBranchGaussianRate (ε ℓ δ : ℝ) : ℝ := (ℓ / (100 * Real.exp 1)) * saddleSourceGaussianVariance ε ℓ (1 + δ) def saddleSourceSecondBranchGammaGaussianRate (ℓ δ : ℝ) : ℝ := (ℓ / (8 * Real.exp 1)) / (2 + δ) def saddleSourceSecondBranchGammaLinearRate (ℓ : ℝ) : ℝ := ℓ / (8 * Real.exp 1) def saddleSourceSecondBranchOuterBarrier (ε ℓ δ : ℝ) : ℝ := (99 / 5000 : ℝ) * ℓ * shellWeight ε * Real.exp (δ * shellLocation ε) * saddleSourceSecondBranchLocalFrequency ε ^ 2 theorem eventually_saddleSource_secondBranch_pointwise_gaussian_plus_outer : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ ℓ : ℝ, 0 < ℓ → ∀ δ : ℝ, ε / 2 ≤ δ → ∀ T : ℝ, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ (1 + δ) T) ≤ saddleGaussianTailWeight T * Real.exp (-saddleSourceSecondBranchGaussianRate ε ℓ δ * T ^ 2) + Real.exp (-saddleSourceSecondBranchOuterBarrier ε ℓ δ) * (saddleGaussianTailWeight T * Real.exp (-saddleSourceSecondBranchGammaGaussianRate ℓ δ * T ^ 2) + saddleGaussianTailWeight T * Real.exp (-saddleSourceSecondBranchGammaLinearRate ℓ * |T|)) := by filter_upwards [self_mem_nhdsWithin, eventually_saddleSourceContourDamping_secondBranch_local_coercivity, eventually_upperSaddleDamping_gamma_add_shell] with ε hε hlocal hdom change 0 < ε at hε intro ℓ hℓ δ hδ T let t₀ : ℝ := saddleSourceSecondBranchLocalFrequency ε let a : ℝ := ℓ / (8 * Real.exp 1) let η : ℝ := 2 + δ have hδ0 : 0 ≤ δ := by nlinarith have hη : 0 < η := by try dsimp [η] linarith have ha : 0 < a := by try dsimp [a] positivity have hB : 0 ≤ shellLocation ε := by unfold shellLocation positivity have ht₀ : 0 < t₀ := by try dsimp [t₀, saddleSourceSecondBranchLocalFrequency] positivity have ht₀one : t₀ ≤ 1 := by try dsimp [t₀, saddleSourceSecondBranchLocalFrequency] apply (div_le_iff₀ (show (0 : ℝ) < 2 * (shellLocation ε + 1) by positivity)).2 nlinarith have hw : 0 ≤ saddleGaussianTailWeight T := saddleGaussianTailWeight_nonneg T by_cases hinside : |T| ≤ t₀ · have hquadratic := hlocal ℓ hℓ δ hδ T (by simpa [t₀, saddleSourceSecondBranchLocalFrequency] using! hinside) have hlocalexp : Real.exp (-saddleSourceContourDamping ε ℓ (1 + δ) T) ≤ Real.exp (-saddleSourceSecondBranchGaussianRate ε ℓ δ * T ^ 2) := by apply Real.exp_le_exp.mpr unfold saddleSourceSecondBranchGaussianRate linarith have hfirst := mul_le_mul_of_nonneg_left hlocalexp hw have houter : 0 ≤ Real.exp (-saddleSourceSecondBranchOuterBarrier ε ℓ δ) * (saddleGaussianTailWeight T * Real.exp (-saddleSourceSecondBranchGammaGaussianRate ℓ δ * T ^ 2) + saddleGaussianTailWeight T * Real.exp (-saddleSourceSecondBranchGammaLinearRate ℓ * |T|)) := by positivity linarith · have houtside : t₀ ≤ |T| := le_of_not_ge hinside have hsquare : t₀ ^ 2 ≤ T ^ 2 := by have h := pow_le_pow_left₀ ht₀.le houtside 2 simpa [sq_abs] using! h have hone : t₀ ^ 2 ≤ (1 : ℝ) := by nlinarith [sq_nonneg (1 - t₀)] have hminimum : t₀ ^ 2 ≤ min (T ^ 2) 1 := le_min hsquare hone have hshell := positiveShellDamping_lower_bound (ε := ε) (ℓ := ℓ) (δ := δ) (T := T) hε hℓ.le hδ0 have hbarrier : saddleSourceSecondBranchOuterBarrier ε ℓ δ ≤ (99 / 100 : ℝ) * positiveShellDamping ε ℓ δ T := by calc saddleSourceSecondBranchOuterBarrier ε ℓ δ = (99 / 100 : ℝ) * ((ℓ / 50) * shellWeight ε * Real.exp (δ * shellLocation ε) * t₀ ^ 2) := by try dsimp [saddleSourceSecondBranchOuterBarrier, t₀] ring _ ≤ (99 / 100 : ℝ) * ((ℓ / 50) * shellWeight ε * Real.exp (δ * shellLocation ε) * min (T ^ 2) 1) := by apply mul_le_mul_of_nonneg_left _ (by norm_num) exact mul_le_mul_of_nonneg_left hminimum (by positivity [shellWeight_pos ε]) _ ≤ (99 / 100 : ℝ) * positiveShellDamping ε ℓ δ T := by exact mul_le_mul_of_nonneg_left hshell (by norm_num) have hgamma := upperGammaDamping_lower_bound hℓ hη T have hcombined : saddleSourceSecondBranchOuterBarrier ε ℓ δ + a * min (T ^ 2 / η) |T| ≤ saddleSourceContourDamping ε ℓ (1 + δ) T := by rw [saddleSourceContourDamping_eq_secondBranch] have hfull := hdom ℓ hℓ δ hδ T try dsimp [a, η] at hgamma ⊢ linarith have hmin := saddle_exp_neg_mul_min_le_add (a := a) (x := T ^ 2 / η) (y := |T|) ha.le have hexp : Real.exp (-saddleSourceContourDamping ε ℓ (1 + δ) T) ≤ Real.exp (-saddleSourceSecondBranchOuterBarrier ε ℓ δ) * (Real.exp (-saddleSourceSecondBranchGammaGaussianRate ℓ δ * T ^ 2) + Real.exp (-saddleSourceSecondBranchGammaLinearRate ℓ * |T|)) := by calc Real.exp (-saddleSourceContourDamping ε ℓ (1 + δ) T) ≤ Real.exp (-(saddleSourceSecondBranchOuterBarrier ε ℓ δ + a * min (T ^ 2 / η) |T|)) := by apply Real.exp_le_exp.mpr linarith _ = Real.exp (-saddleSourceSecondBranchOuterBarrier ε ℓ δ) * Real.exp (-a * min (T ^ 2 / η) |T|) := by rw [← Real.exp_add] congr 1 ring _ ≤ Real.exp (-saddleSourceSecondBranchOuterBarrier ε ℓ δ) * (Real.exp (-a * (T ^ 2 / η)) + Real.exp (-a * |T|)) := by gcongr _ = Real.exp (-saddleSourceSecondBranchOuterBarrier ε ℓ δ) * (Real.exp (-saddleSourceSecondBranchGammaGaussianRate ℓ δ * T ^ 2) + Real.exp (-saddleSourceSecondBranchGammaLinearRate ℓ * |T|)) := by congr 2 unfold saddleSourceSecondBranchGammaGaussianRate try dsimp [a, η] congr 1 ring have hweighted := mul_le_mul_of_nonneg_left hexp hw have hfirst : 0 ≤ saddleGaussianTailWeight T * Real.exp (-saddleSourceSecondBranchGaussianRate ε ℓ δ * T ^ 2) := by positivity nlinarith theorem eventually_saddleSource_secondBranch_weighted_tail_explicit : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ ℓ : ℝ, 0 < ℓ → ∀ δ : ℝ, ε / 2 ≤ δ → ∀ R : ℝ, 0 ≤ R → 6 ≤ saddleSourceSecondBranchGaussianRate ε ℓ δ → (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ (1 + δ) T)) ≤ 2 * Real.exp (-(saddleSourceSecondBranchGaussianRate ε ℓ δ / 4) * R ^ 2) * Real.sqrt (Real.pi / (saddleSourceSecondBranchGaussianRate ε ℓ δ / 4)) + Real.exp (-saddleSourceSecondBranchOuterBarrier ε ℓ δ) * (2 * max (1 : ℝ) ((Real.sqrt (saddleSourceSecondBranchGammaGaussianRate ℓ δ / 6) ^ 3)⁻¹) * Real.sqrt (Real.pi / (saddleSourceSecondBranchGammaGaussianRate ℓ δ / 2)) + 2 * max (1 : ℝ) (((saddleSourceSecondBranchGammaLinearRate ℓ / 6) ^ 3)⁻¹) * (2 / (saddleSourceSecondBranchGammaLinearRate ℓ / 2))) := by filter_upwards [self_mem_nhdsWithin, eventually_saddleSource_secondBranch_weighted_integrable, eventually_saddleSource_secondBranch_pointwise_gaussian_plus_outer, eventually_saddleSourceGaussianVariance_secondBranch_pos] with ε hε hsource hpoint hvariance change 0 < ε at hε intro ℓ hℓ δ hδ R hR hk let k : ℝ := saddleSourceSecondBranchGaussianRate ε ℓ δ let q : ℝ := saddleSourceSecondBranchGammaGaussianRate ℓ δ let a : ℝ := saddleSourceSecondBranchGammaLinearRate ℓ let b : ℝ := saddleSourceSecondBranchOuterBarrier ε ℓ δ have hδ0 : 0 ≤ δ := by nlinarith have hη : 0 < 2 + δ := by linarith have hV := hvariance ℓ hℓ δ hδ have hkpos : 0 < k := by try dsimp [k, saddleSourceSecondBranchGaussianRate] positivity have hq : 0 < q := by try dsimp [q, saddleSourceSecondBranchGammaGaussianRate] positivity have ha : 0 < a := by try dsimp [a, saddleSourceSecondBranchGammaLinearRate] positivity have hactual := hsource ℓ hℓ δ hδ have hlocal := saddleGaussianTailWeight_mul_gaussian_integrable hkpos have hgamma := saddleGaussianTailWeight_mul_gaussian_integrable hq have hlinear := saddleGaussianTailWeight_mul_exp_abs_integrable ha have houter : Integrable (fun T : ℝ => Real.exp (-b) * (saddleGaussianTailWeight T * Real.exp (-q * T ^ 2) + saddleGaussianTailWeight T * Real.exp (-a * |T|))) := (hgamma.add hlinear).const_mul (Real.exp (-b)) have hmajor : Integrable (fun T : ℝ => saddleGaussianTailWeight T * Real.exp (-k * T ^ 2) + Real.exp (-b) * (saddleGaussianTailWeight T * Real.exp (-q * T ^ 2) + saddleGaussianTailWeight T * Real.exp (-a * |T|))) := hlocal.add houter have hcompare := MeasureTheory.setIntegral_mono_on hactual.integrableOn hmajor.integrableOn (saddleGaussianTailSet_measurable R) (fun T _ => by simpa [k, q, a, b] using! hpoint ℓ hℓ δ hδ T) have hgaussianTail := saddleGaussian_cubic_tail_integral_le (k := k) (R := R) (by simpa [k] using! hk) hR have hgammanonnegative : 0 ≤ᶠ[ae (volume : Measure ℝ)] (fun T : ℝ => saddleGaussianTailWeight T * Real.exp (-q * T ^ 2)) := Filter.Eventually.of_forall (fun T => mul_nonneg (saddleGaussianTailWeight_nonneg T) (Real.exp_pos _).le) have hlinearnonnegative : 0 ≤ᶠ[ae (volume : Measure ℝ)] (fun T : ℝ => saddleGaussianTailWeight T * Real.exp (-a * |T|)) := Filter.Eventually.of_forall (fun T => mul_nonneg (saddleGaussianTailWeight_nonneg T) (Real.exp_pos _).le) have hgammaTail := MeasureTheory.setIntegral_le_integral (s := saddleGaussianTailSet R) hgamma hgammanonnegative have hlinearTail := MeasureTheory.setIntegral_le_integral (s := saddleGaussianTailSet R) hlinear hlinearnonnegative have hgammaFull := saddleGaussian_weighted_integral_le_rescaled hq have hlinearFull := saddleExponential_weighted_integral_le_rescaled ha calc (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ (1 + δ) T)) ≤ ∫ T : ℝ in saddleGaussianTailSet R, (saddleGaussianTailWeight T * Real.exp (-k * T ^ 2) + Real.exp (-b) * (saddleGaussianTailWeight T * Real.exp (-q * T ^ 2) + saddleGaussianTailWeight T * Real.exp (-a * |T|))) := hcompare _ = (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-k * T ^ 2)) + Real.exp (-b) * ((∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-q * T ^ 2)) + ∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-a * |T|)) := by rw [MeasureTheory.integral_add hlocal.integrableOn houter.integrableOn, MeasureTheory.integral_const_mul, MeasureTheory.integral_add hgamma.integrableOn hlinear.integrableOn] _ ≤ 2 * Real.exp (-(k / 4) * R ^ 2) * Real.sqrt (Real.pi / (k / 4)) + Real.exp (-b) * ((∫ T : ℝ, saddleGaussianTailWeight T * Real.exp (-q * T ^ 2)) + ∫ T : ℝ, saddleGaussianTailWeight T * Real.exp (-a * |T|)) := by gcongr _ ≤ 2 * Real.exp (-(k / 4) * R ^ 2) * Real.sqrt (Real.pi / (k / 4)) + Real.exp (-b) * (2 * max (1 : ℝ) ((Real.sqrt (q / 6) ^ 3)⁻¹) * Real.sqrt (Real.pi / (q / 2)) + 2 * max (1 : ℝ) (((a / 6) ^ 3)⁻¹) * (2 / (a / 2))) := by gcongr _ = _ := by rfl theorem saddleSourceSecondBranch_normalizedGaussian_prefactor {ε ℓ δ : ℝ} (hℓ : 0 < ℓ) (hV : 0 < saddleSourceGaussianVariance ε ℓ (1 + δ)) : Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ)) * Real.sqrt (Real.pi / (saddleSourceSecondBranchGaussianRate ε ℓ δ / 4)) = Real.sqrt (400 * Real.exp 1 * Real.pi) := by let V : ℝ := saddleSourceGaussianVariance ε ℓ (1 + δ) have hLV : 0 < ℓ * V := mul_pos hℓ hV have hVne : V ≠ 0 := by exact hV.ne' rw [← Real.sqrt_mul hLV.le] congr 1 unfold saddleSourceSecondBranchGaussianRate change (ℓ * V) * (Real.pi / (((ℓ / (100 * Real.exp 1)) * V) / 4)) = 400 * Real.exp 1 * Real.pi field_simp [hℓ.ne', hVne, (Real.exp_pos 1).ne']; ring theorem saddleSourceSecondBranch_normalizedGaussian_exponent {ε ℓ δ z : ℝ} (hℓ : 0 < ℓ) (hV : 0 < saddleSourceGaussianVariance ε ℓ (1 + δ)) : (saddleSourceSecondBranchGaussianRate ε ℓ δ / 4) * (z / Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ))) ^ 2 = z ^ 2 / (400 * Real.exp 1) := by let V : ℝ := saddleSourceGaussianVariance ε ℓ (1 + δ) have hLV : 0 < ℓ * V := mul_pos hℓ hV have hVne : V ≠ 0 := by exact hV.ne' unfold saddleSourceSecondBranchGaussianRate change (((ℓ / (100 * Real.exp 1)) * V) / 4) * (z / Real.sqrt (ℓ * V)) ^ 2 = z ^ 2 / (400 * Real.exp 1) rw [div_pow, Real.sq_sqrt hLV.le] field_simp [hℓ.ne', hVne, (Real.exp_pos 1).ne']; ring theorem eventually_saddleSource_secondBranch_normalized_tail_bound : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ ℓ : ℝ, 0 < ℓ → ∀ δ : ℝ, ε / 2 ≤ δ → ∀ z : ℝ, 0 ≤ z → 6 ≤ saddleSourceSecondBranchGaussianRate ε ℓ δ → Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ)) * (∫ T : ℝ in saddleGaussianTailSet (z / Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ))), saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ (1 + δ) T)) ≤ 2 * Real.sqrt (400 * Real.exp 1 * Real.pi) * Real.exp (-(z ^ 2 / (400 * Real.exp 1))) + Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ)) * Real.exp (-saddleSourceSecondBranchOuterBarrier ε ℓ δ) * (2 * max (1 : ℝ) ((Real.sqrt (saddleSourceSecondBranchGammaGaussianRate ℓ δ / 6) ^ 3)⁻¹) * Real.sqrt (Real.pi / (saddleSourceSecondBranchGammaGaussianRate ℓ δ / 2)) + 2 * max (1 : ℝ) (((saddleSourceSecondBranchGammaLinearRate ℓ / 6) ^ 3)⁻¹) * (2 / (saddleSourceSecondBranchGammaLinearRate ℓ / 2))) := by filter_upwards [eventually_saddleSource_secondBranch_weighted_tail_explicit, eventually_saddleSourceGaussianVariance_secondBranch_pos] with ε htail hvariance intro ℓ hℓ δ hδ z hz hk let V : ℝ := saddleSourceGaussianVariance ε ℓ (1 + δ) let R : ℝ := z / Real.sqrt (ℓ * V) have hV : 0 < V := hvariance ℓ hℓ δ hδ have hR : 0 ≤ R := by try dsimp [R] positivity have hsource := htail ℓ hℓ δ hδ R hR hk have hpref := saddleSourceSecondBranch_normalizedGaussian_prefactor hℓ hV have hexponent := saddleSourceSecondBranch_normalizedGaussian_exponent (z := z) hℓ hV have hs : 0 ≤ Real.sqrt (ℓ * V) := Real.sqrt_nonneg _ calc Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ)) * (∫ T : ℝ in saddleGaussianTailSet (z / Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ))), saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ (1 + δ) T)) ≤ Real.sqrt (ℓ * V) * (2 * Real.exp (-(saddleSourceSecondBranchGaussianRate ε ℓ δ / 4) * R ^ 2) * Real.sqrt (Real.pi / (saddleSourceSecondBranchGaussianRate ε ℓ δ / 4)) + Real.exp (-saddleSourceSecondBranchOuterBarrier ε ℓ δ) * (2 * max (1 : ℝ) ((Real.sqrt (saddleSourceSecondBranchGammaGaussianRate ℓ δ / 6) ^ 3)⁻¹) * Real.sqrt (Real.pi / (saddleSourceSecondBranchGammaGaussianRate ℓ δ / 2)) + 2 * max (1 : ℝ) (((saddleSourceSecondBranchGammaLinearRate ℓ / 6) ^ 3)⁻¹) * (2 / (saddleSourceSecondBranchGammaLinearRate ℓ / 2)))) := by change Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ (1 + δ) T)) ≤ _ exact mul_le_mul_of_nonneg_left hsource hs _ = _ := by have hexponent' : (saddleSourceSecondBranchGaussianRate ε ℓ δ / 4) * (z / Real.sqrt (ℓ * V)) ^ 2 = z ^ 2 / (400 * Real.exp 1) := by simpa [V] using! hexponent have hnegative : -(saddleSourceSecondBranchGaussianRate ε ℓ δ / 4) * (z / Real.sqrt (ℓ * V)) ^ 2 = -(z ^ 2 / (400 * Real.exp 1)) := by linarith have hpref' : Real.sqrt (ℓ * V) * Real.sqrt (Real.pi / (saddleSourceSecondBranchGaussianRate ε ℓ δ / 4)) = Real.sqrt (400 * Real.exp 1 * Real.pi) := by simpa [V] using! hpref try dsimp [R] rw [hnegative] have hscaled := congrArg (fun x : ℝ => 2 * Real.exp (-(z ^ 2 / (400 * Real.exp 1))) * x) hpref' nlinarith theorem saddle_sqrt_le_one_add {x : ℝ} (hx : 0 ≤ x) : Real.sqrt x ≤ 1 + x := by apply Real.sqrt_le_iff.mpr constructor · linarith · nlinarith [sq_nonneg x] theorem saddle_inverse_sqrt_cube_le {q : ℝ} (hq : 0 < q) : (Real.sqrt (q / 6) ^ 3)⁻¹ ≤ 1 + (6 / q) ^ 3 := by let s : ℝ := Real.sqrt (q / 6) have hs : 0 < s := by try dsimp [s] positivity have hsquare : s ^ 2 = q / 6 := by try dsimp [s] rw [Real.sq_sqrt (by positivity)] have hcubed : (s ^ 2) ^ 3 = (q / 6) ^ 3 := congrArg (fun x : ℝ => x ^ 3) hsquare have hidentity : ((s ^ 3)⁻¹) ^ 2 = (6 / q) ^ 3 := by field_simp [hq.ne', hs.ne'] nlinarith [hcubed] have hnonnegative : 0 ≤ (s ^ 3)⁻¹ := by positivity change (s ^ 3)⁻¹ ≤ 1 + (6 / q) ^ 3 rw [← hidentity] nlinarith [sq_nonneg ((s ^ 3)⁻¹ - (1 / 2 : ℝ))] theorem saddleSecondBranch_gammaWeightedCoefficient_le {q η C : ℝ} (hq : 0 < q) (hη : 1 ≤ η) (hC : 0 < C) (hrate : 1 / q ≤ C * η) : 2 * max (1 : ℝ) ((Real.sqrt (q / 6) ^ 3)⁻¹) * Real.sqrt (Real.pi / (q / 2)) ≤ (2 * (1 + (6 * C) ^ 3) * (1 + 2 * Real.pi * C)) * η ^ 4 := by have hη0 : 0 ≤ η := by linarith have hηthree : 1 ≤ η ^ 3 := by simpa using! (pow_le_pow_left₀ (show (0 : ℝ) ≤ 1 by norm_num) hη 3) have hinverse := saddle_inverse_sqrt_cube_le hq have hmax : max (1 : ℝ) ((Real.sqrt (q / 6) ^ 3)⁻¹) ≤ 1 + (6 / q) ^ 3 := by apply max_le · have : 0 ≤ (6 / q) ^ 3 := by positivity linarith · exact hinverse have hqscaled : 6 / q ≤ 6 * C * η := by calc 6 / q = 6 * (1 / q) := by ring _ ≤ 6 * (C * η) := by gcongr _ = 6 * C * η := by ring have hmaxpoly : max (1 : ℝ) ((Real.sqrt (q / 6) ^ 3)⁻¹) ≤ (1 + (6 * C) ^ 3) * η ^ 3 := by calc max (1 : ℝ) ((Real.sqrt (q / 6) ^ 3)⁻¹) ≤ 1 + (6 / q) ^ 3 := hmax _ ≤ 1 + (6 * C * η) ^ 3 := by gcongr _ ≤ (1 + (6 * C) ^ 3) * η ^ 3 := by nlinarith [mul_nonneg (show 0 ≤ (6 * C) ^ 3 by positivity) (show 0 ≤ η ^ 3 - 1 by linarith)] have hpiscaled : Real.pi / (q / 2) ≤ 2 * Real.pi * C * η := by calc Real.pi / (q / 2) = (2 * Real.pi) * (1 / q) := by field_simp [hq.ne'] _ ≤ (2 * Real.pi) * (C * η) := by gcongr _ = 2 * Real.pi * C * η := by ring have hsqrt : Real.sqrt (Real.pi / (q / 2)) ≤ (1 + 2 * Real.pi * C) * η := by calc Real.sqrt (Real.pi / (q / 2)) ≤ 1 + Real.pi / (q / 2) := saddle_sqrt_le_one_add (by positivity) _ ≤ 1 + 2 * Real.pi * C * η := by linarith _ ≤ (1 + 2 * Real.pi * C) * η := by nlinarith calc 2 * max (1 : ℝ) ((Real.sqrt (q / 6) ^ 3)⁻¹) * Real.sqrt (Real.pi / (q / 2)) ≤ 2 * ((1 + (6 * C) ^ 3) * η ^ 3) * ((1 + 2 * Real.pi * C) * η) := by gcongr _ = (2 * (1 + (6 * C) ^ 3) * (1 + 2 * Real.pi * C)) * η ^ 4 := by ring theorem saddleSecondBranch_linearWeightedCoefficient_le {a η C : ℝ} (ha : 0 < a) (hη : 1 ≤ η) (hC : 0 < C) (hrate : 1 / a ≤ C) : 2 * max (1 : ℝ) (((a / 6) ^ 3)⁻¹) * (2 / (a / 2)) ≤ (8 * C * (1 + (6 * C) ^ 3)) * η ^ 4 := by have hηfour : 1 ≤ η ^ 4 := by simpa using! (pow_le_pow_left₀ (show (0 : ℝ) ≤ 1 by norm_num) hη 4) have hidentity : ((a / 6) ^ 3)⁻¹ = (6 / a) ^ 3 := by field_simp [ha.ne'] have hbase : 6 / a ≤ 6 * C := by calc 6 / a = 6 * (1 / a) := by ring _ ≤ 6 * C := by gcongr have hmax : max (1 : ℝ) (((a / 6) ^ 3)⁻¹) ≤ 1 + (6 * C) ^ 3 := by rw [hidentity] apply max_le · have : 0 ≤ (6 * C) ^ 3 := by positivity linarith · have hcubes : (6 / a) ^ 3 ≤ (6 * C) ^ 3 := by gcongr linarith have hlinear : 2 / (a / 2) ≤ 4 * C := by calc 2 / (a / 2) = 4 * (1 / a) := by field_simp [ha.ne']; ring _ ≤ 4 * C := by gcongr calc 2 * max (1 : ℝ) (((a / 6) ^ 3)⁻¹) * (2 / (a / 2)) ≤ 2 * (1 + (6 * C) ^ 3) * (4 * C) := by gcongr _ ≤ (8 * C * (1 + (6 * C) ^ 3)) * η ^ 4 := by have hcoefficient : 0 ≤ 8 * C * (1 + (6 * C) ^ 3) := by positivity nlinarith [mul_le_mul_of_nonneg_left hηfour hcoefficient] def saddleSourceSecondBranchMomentCoefficient : ℝ := let C : ℝ := 8 * Real.exp 1 2 * (1 + (6 * C) ^ 3) * (1 + 2 * Real.pi * C) + 8 * C * (1 + (6 * C) ^ 3) theorem saddleSourceSecondBranchMomentCoefficient_pos : 0 < saddleSourceSecondBranchMomentCoefficient := by unfold saddleSourceSecondBranchMomentCoefficient positivity theorem saddleSourceSecondBranch_outerMoment_le {ℓ δ : ℝ} (hℓ : 1 ≤ ℓ) (hδ : 0 ≤ δ) : 2 * max (1 : ℝ) ((Real.sqrt (saddleSourceSecondBranchGammaGaussianRate ℓ δ / 6) ^ 3)⁻¹) * Real.sqrt (Real.pi / (saddleSourceSecondBranchGammaGaussianRate ℓ δ / 2)) + 2 * max (1 : ℝ) (((saddleSourceSecondBranchGammaLinearRate ℓ / 6) ^ 3)⁻¹) * (2 / (saddleSourceSecondBranchGammaLinearRate ℓ / 2)) ≤ saddleSourceSecondBranchMomentCoefficient * (2 + δ) ^ 4 := by let C : ℝ := 8 * Real.exp 1 let η : ℝ := 2 + δ let q : ℝ := saddleSourceSecondBranchGammaGaussianRate ℓ δ let a : ℝ := saddleSourceSecondBranchGammaLinearRate ℓ have hℓpositive : 0 < ℓ := by linarith have hη : 1 ≤ η := by try dsimp [η] linarith have hηpositive : 0 < η := by linarith have hC : 0 < C := by try dsimp [C] positivity have hq : 0 < q := by try dsimp [q, saddleSourceSecondBranchGammaGaussianRate] positivity have ha : 0 < a := by try dsimp [a, saddleSourceSecondBranchGammaLinearRate] positivity have hqrate : 1 / q ≤ C * η := by calc 1 / q = (C * η) / ℓ := by try dsimp [q, C, η, saddleSourceSecondBranchGammaGaussianRate] field_simp [hℓpositive.ne', (Real.exp_pos 1).ne', hηpositive.ne'] _ ≤ C * η := by apply (div_le_iff₀ hℓpositive).2 nlinarith [mul_nonneg (mul_nonneg hC.le hηpositive.le) (show 0 ≤ ℓ - 1 by linarith)] have harate : 1 / a ≤ C := by calc 1 / a = C / ℓ := by try dsimp [a, C, saddleSourceSecondBranchGammaLinearRate] field_simp [hℓpositive.ne', (Real.exp_pos 1).ne'] _ ≤ C := by apply (div_le_iff₀ hℓpositive).2 nlinarith [mul_nonneg hC.le (show 0 ≤ ℓ - 1 by linarith)] have hgamma := saddleSecondBranch_gammaWeightedCoefficient_le hq hη hC hqrate have hlinear := saddleSecondBranch_linearWeightedCoefficient_le ha hη hC harate change 2 * max (1 : ℝ) ((Real.sqrt (q / 6) ^ 3)⁻¹) * Real.sqrt (Real.pi / (q / 2)) + 2 * max (1 : ℝ) (((a / 6) ^ 3)⁻¹) * (2 / (a / 2)) ≤ saddleSourceSecondBranchMomentCoefficient * η ^ 4 unfold saddleSourceSecondBranchMomentCoefficient change 2 * max (1 : ℝ) ((Real.sqrt (q / 6) ^ 3)⁻¹) * Real.sqrt (Real.pi / (q / 2)) + 2 * max (1 : ℝ) (((a / 6) ^ 3)⁻¹) * (2 / (a / 2)) ≤ (2 * (1 + (6 * C) ^ 3) * (1 + 2 * Real.pi * C) + 8 * C * (1 + (6 * C) ^ 3)) * η ^ 4 nlinarith def saddleSourceSecondBranchVarianceCoefficient (ε : ℝ) : ℝ := 2 + (shellLocation ε + 1) ^ 2 * shellWeight ε theorem saddleSourceSecondBranchVarianceCoefficient_pos (ε : ℝ) : 0 < saddleSourceSecondBranchVarianceCoefficient ε := by unfold saddleSourceSecondBranchVarianceCoefficient positivity [shellWeight_pos ε] theorem eventually_saddleSourceGaussianVariance_secondBranch_upper : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ ℓ : ℝ, 1 ≤ ℓ → ∀ δ : ℝ, ε / 2 ≤ δ → saddleSourceGaussianVariance ε ℓ (1 + δ) ≤ saddleSourceSecondBranchVarianceCoefficient ε * Real.exp ((shellLocation ε + 1) * δ) := by filter_upwards [self_mem_nhdsWithin, eventually_upperSaddleVariance_bounds] with ε hε hvariance change 0 < ε at hε intro ℓ hℓ δ hδ have hℓpositive : 0 < ℓ := by linarith have hδ0 : 0 ≤ δ := by nlinarith let η : ℝ := 2 + δ have hηtwo : 2 ≤ η := by try dsimp [η] linarith have hη : 0 < η := by linarith have hB : 0 ≤ shellLocation ε := by unfold shellLocation positivity have hexp : 1 ≤ Real.exp ((shellLocation ε + 1) * δ) := by apply (Real.one_le_exp_iff).2 positivity have hfirst : 1 / (2 * η) ≤ (1 : ℝ) := by apply (div_le_iff₀ (show 0 < 2 * η by positivity)).2 linarith have hden : 0 < ℓ * η ^ 2 := by positivity have hsecond : 1 / (ℓ * η ^ 2) ≤ (1 : ℝ) := by apply (div_le_iff₀ hden).2 have hηsquare : 1 ≤ η ^ 2 := by nlinarith [sq_nonneg (η - 1)] have hscaled := mul_le_mul_of_nonneg_right hℓ (sq_nonneg η) nlinarith have hshell := (upperPositiveShellVariance_bounds hε hδ0).2 have hfull := (hvariance ℓ hℓpositive δ hδ).2 have hsource : saddleSourceGaussianVariance ε ℓ (1 + δ) ≤ 1 / (2 * η) + 1 / (ℓ * η ^ 2) + upperPositiveShellVariance ε δ := by simpa [saddleSourceGaussianVariance, η] using! hfull have hshell' : upperPositiveShellVariance ε δ ≤ (shellLocation ε + 1) ^ 2 * shellWeight ε * Real.exp ((shellLocation ε + 1) * δ) := by convert! hshell using 1; ring_nf unfold saddleSourceSecondBranchVarianceCoefficient nlinarith theorem eventually_saddleSource_secondBranch_sqrtVariance_le : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ ℓ : ℝ, 1 ≤ ℓ → ∀ δ : ℝ, ε / 2 ≤ δ → Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ)) ≤ Real.sqrt (saddleSourceSecondBranchVarianceCoefficient ε) * Real.sqrt ℓ * Real.exp (((shellLocation ε + 1) / 2) * δ) := by filter_upwards [eventually_saddleSourceGaussianVariance_secondBranch_upper] with ε hupper intro ℓ hℓ δ hδ let C : ℝ := saddleSourceSecondBranchVarianceCoefficient ε have hC : 0 < C := saddleSourceSecondBranchVarianceCoefficient_pos ε have hℓpositive : 0 < ℓ := by linarith have hsource := hupper ℓ hℓ δ hδ have hscaled := mul_le_mul_of_nonneg_left hsource hℓpositive.le calc Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ)) ≤ Real.sqrt (ℓ * (C * Real.exp ((shellLocation ε + 1) * δ))) := by apply Real.sqrt_le_sqrt simpa [C] using! hscaled _ = Real.sqrt C * Real.sqrt ℓ * Real.exp (((shellLocation ε + 1) / 2) * δ) := by rw [Real.sqrt_mul hℓpositive.le, Real.sqrt_mul hC.le, ← Real.exp_half] have hargument : ((shellLocation ε + 1) * δ) / 2 = ((shellLocation ε + 1) / 2) * δ := by ring rw [hargument] ring theorem tendsto_saddleSourceSecondBranchLocalTailMajorant : Tendsto (fun ℓ : ℝ => 2 * Real.sqrt (400 * Real.exp 1 * Real.pi) * Real.exp (-(ℓ ^ (1 / 6 : ℝ) / (400 * Real.exp 1)))) atTop (𝓝 (0 : ℝ)) := by have hpower : Tendsto (fun ℓ : ℝ => ℓ ^ (1 / 6 : ℝ)) atTop atTop := tendsto_rpow_atTop (by norm_num) have hnegative : Tendsto (fun ℓ : ℝ => (-(1 / (400 * Real.exp 1))) * ℓ ^ (1 / 6 : ℝ)) atTop atBot := hpower.const_mul_atTop_of_neg (neg_lt_zero.mpr (by positivity : (0 : ℝ) < 1 / (400 * Real.exp 1))) have hexp := Real.tendsto_exp_atBot.comp hnegative have hscaled := hexp.const_mul (2 * Real.sqrt (400 * Real.exp 1 * Real.pi)) convert! hscaled using 1 · funext ℓ congr 2 ring · simp theorem eventually_saddleSource_secondBranch_uniform_tail : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ κ : ℝ, 0 < κ → ∀ᶠ ℓ : ℝ in atTop, ∀ δ : ℝ, ε / 2 ≤ δ → Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ)) * (∫ T : ℝ in saddleGaussianTailSet (ℓ ^ (1 / 12 : ℝ) / Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ))), saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ (1 + δ) T)) < κ := by filter_upwards [self_mem_nhdsWithin, eventually_saddleSource_secondBranch_normalized_tail_bound, eventually_saddleSource_secondBranch_sqrtVariance_le, eventually_saddleSourceGaussianVariance_secondBranch_floor] with ε hε htail hsqrt hfloor change 0 < ε at hε intro κ hκ let B : ℝ := shellLocation ε let Q : ℝ := shellWeight ε let t₀ : ℝ := saddleSourceSecondBranchLocalFrequency ε let c : ℝ := (99 / 5000 : ℝ) * t₀ ^ 2 let V₀ : ℝ := saddleSourceSecondBranchVarianceFloor ε let C : ℝ := saddleSourceSecondBranchVarianceCoefficient ε let K : ℝ := Real.sqrt C * saddleSourceSecondBranchMomentCoefficient have hB : 0 < B := by try dsimp [B, shellLocation] positivity have hQ : 0 < Q := by try dsimp [Q] exact shellWeight_pos ε have ht₀ : 0 < t₀ := by try dsimp [t₀, saddleSourceSecondBranchLocalFrequency, B] positivity have hc : 0 < c := by try dsimp [c] positivity have hV₀ : 0 < V₀ := by try dsimp [V₀] exact saddleSourceSecondBranchVarianceFloor_pos hε have hC : 0 < C := by try dsimp [C] exact saddleSourceSecondBranchVarianceCoefficient_pos ε have hK : 0 < K := by try dsimp [K] exact mul_pos (Real.sqrt_pos.2 hC) saddleSourceSecondBranchMomentCoefficient_pos have hhalf : 0 < κ / 2 := by positivity have houter := eventually_saddleGaussianOuterPhi_uniform_polynomial hB hQ hc (by positivity : 0 ≤ ε / 2) hK.le (κ / 2) hhalf have hlocal := tendsto_saddleSourceSecondBranchLocalTailMajorant.eventually (Iio_mem_nhds hhalf) filter_upwards [eventually_ge_atTop (1 : ℝ), eventually_ge_atTop ((600 * Real.exp 1) / V₀), hlocal, houter] with ℓ hℓ hone hlocalℓ houterℓ intro δ hδ let V : ℝ := saddleSourceGaussianVariance ε ℓ (1 + δ) let z : ℝ := ℓ ^ (1 / 12 : ℝ) let η : ℝ := 2 + δ have hℓpositive : 0 < ℓ := by linarith have hδ0 : 0 ≤ δ := by nlinarith have hη : 1 ≤ η := by try dsimp [η] linarith have hVfloor : V₀ ≤ V := by try dsimp [V₀, V] exact hfloor ℓ hℓpositive δ hδ have hV : 0 < V := hV₀.trans_le hVfloor have hz : 0 ≤ z := by try dsimp [z] positivity have hscale : 600 * Real.exp 1 ≤ ℓ * V₀ := by have h := (div_le_iff₀ hV₀).mp hone nlinarith have hfullscale : 600 * Real.exp 1 ≤ ℓ * V := by have h := mul_le_mul_of_nonneg_left hVfloor hℓpositive.le linarith have hk : 6 ≤ saddleSourceSecondBranchGaussianRate ε ℓ δ := by unfold saddleSourceSecondBranchGaussianRate change 6 ≤ (ℓ / (100 * Real.exp 1)) * V have hden : (0 : ℝ) < 100 * Real.exp 1 := by positivity have hgoal : (6 : ℝ) ≤ (ℓ * V) / (100 * Real.exp 1) := by apply (le_div_iff₀ hden).2 nlinarith convert! hgoal using 1; ring have hsource := htail ℓ hℓpositive δ hδ z hz hk have hpower : z ^ 2 = ℓ ^ (1 / 6 : ℝ) := by try dsimp [z] rw [← Real.rpow_natCast, ← Real.rpow_mul hℓpositive.le] congr 1 norm_num have hlocalterm : 2 * Real.sqrt (400 * Real.exp 1 * Real.pi) * Real.exp (-(z ^ 2 / (400 * Real.exp 1))) < κ / 2 := by rw [hpower] exact hlocalℓ have hsqrtsource : Real.sqrt (ℓ * V) ≤ Real.sqrt C * Real.sqrt ℓ * Real.exp (((B + 1) / 2) * δ) := by simpa [V, C, B] using! hsqrt ℓ hℓ δ hδ have hmoment := saddleSourceSecondBranch_outerMoment_le hℓ hδ0 have hmoment' : 2 * max (1 : ℝ) ((Real.sqrt (saddleSourceSecondBranchGammaGaussianRate ℓ δ / 6) ^ 3)⁻¹) * Real.sqrt (Real.pi / (saddleSourceSecondBranchGammaGaussianRate ℓ δ / 2)) + 2 * max (1 : ℝ) (((saddleSourceSecondBranchGammaLinearRate ℓ / 6) ^ 3)⁻¹) * (2 / (saddleSourceSecondBranchGammaLinearRate ℓ / 2)) ≤ saddleSourceSecondBranchMomentCoefficient * η ^ 4 := by simpa [η] using! hmoment have hqpositive : 0 < saddleSourceSecondBranchGammaGaussianRate ℓ δ := by unfold saddleSourceSecondBranchGammaGaussianRate positivity have hapositive : 0 < saddleSourceSecondBranchGammaLinearRate ℓ := by unfold saddleSourceSecondBranchGammaLinearRate positivity have hmomentnonnegative : 0 ≤ 2 * max (1 : ℝ) ((Real.sqrt (saddleSourceSecondBranchGammaGaussianRate ℓ δ / 6) ^ 3)⁻¹) * Real.sqrt (Real.pi / (saddleSourceSecondBranchGammaGaussianRate ℓ δ / 2)) + 2 * max (1 : ℝ) (((saddleSourceSecondBranchGammaLinearRate ℓ / 6) ^ 3)⁻¹) * (2 / (saddleSourceSecondBranchGammaLinearRate ℓ / 2)) := by positivity have hbarrier : saddleSourceSecondBranchOuterBarrier ε ℓ δ = c * ℓ * Q * Real.exp (B * δ) := by try dsimp [saddleSourceSecondBranchOuterBarrier, c, Q, B, t₀] ring_nf have houterterm : Real.sqrt (ℓ * V) * Real.exp (-saddleSourceSecondBranchOuterBarrier ε ℓ δ) * (2 * max (1 : ℝ) ((Real.sqrt (saddleSourceSecondBranchGammaGaussianRate ℓ δ / 6) ^ 3)⁻¹) * Real.sqrt (Real.pi / (saddleSourceSecondBranchGammaGaussianRate ℓ δ / 2)) + 2 * max (1 : ℝ) (((saddleSourceSecondBranchGammaLinearRate ℓ / 6) ^ 3)⁻¹) * (2 / (saddleSourceSecondBranchGammaLinearRate ℓ / 2))) < κ / 2 := by calc Real.sqrt (ℓ * V) * Real.exp (-saddleSourceSecondBranchOuterBarrier ε ℓ δ) * (2 * max (1 : ℝ) ((Real.sqrt (saddleSourceSecondBranchGammaGaussianRate ℓ δ / 6) ^ 3)⁻¹) * Real.sqrt (Real.pi / (saddleSourceSecondBranchGammaGaussianRate ℓ δ / 2)) + 2 * max (1 : ℝ) (((saddleSourceSecondBranchGammaLinearRate ℓ / 6) ^ 3)⁻¹) * (2 / (saddleSourceSecondBranchGammaLinearRate ℓ / 2))) ≤ (Real.sqrt C * Real.sqrt ℓ * Real.exp (((B + 1) / 2) * δ)) * Real.exp (-saddleSourceSecondBranchOuterBarrier ε ℓ δ) * (saddleSourceSecondBranchMomentCoefficient * η ^ 4) := by gcongr _ = K * Real.sqrt ℓ * Real.exp (((B + 1) / 2) * δ) * (2 + δ) ^ 4 * Real.exp (-c * ℓ * Q * Real.exp (B * δ)) := by rw [hbarrier] try dsimp [K, η] ring_nf _ < κ / 2 := houterℓ δ hδ change Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet (z / Real.sqrt (ℓ * V)), saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ (1 + δ) T)) < κ change Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet (z / Real.sqrt (ℓ * V)), saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ (1 + δ) T)) ≤ _ at hsource nlinarith end noncomputable section open Filter MeasureTheory Set open scoped Topology theorem saddleGaussian_central_compl_subset_tail (R : ℝ) : (Icc (-R) R)ᶜ ⊆ saddleGaussianTailSet R := by intro T hT change R ≤ |T| by_contra hnot have hsmall : |T| < R := lt_of_not_ge hnot have hinterior := (abs_lt).mp hsmall exact hT ⟨hinterior.1.le, hinterior.2.le⟩ theorem saddleGaussian_fullLine_error_le_central_add_tails {F G : ℝ → ℂ} (hF : Integrable F) (hG : Integrable G) (R : ℝ) : ‖(∫ T : ℝ, F T) - (∫ T : ℝ, G T)‖ ≤ ‖∫ T : ℝ in Icc (-R) R, (F T - G T)‖ + (∫ T : ℝ in saddleGaussianTailSet R, ‖F T‖) + (∫ T : ℝ in saddleGaussianTailSet R, ‖G T‖) := by let s : Set ℝ := Icc (-R) R let tail : Set ℝ := saddleGaussianTailSet R have hsub : sᶜ ⊆ tail := saddleGaussian_central_compl_subset_tail R have hsubae : sᶜ ≤ᶠ[ae (volume : Measure ℝ)] tail := Filter.Eventually.of_forall (fun T hT => hsub hT) have hdiff : Integrable (fun T : ℝ => F T - G T) := hF.sub hG have hmonoF : (∫ T : ℝ in sᶜ, ‖F T‖) ≤ ∫ T : ℝ in tail, ‖F T‖ := by apply setIntegral_mono_set hF.norm.integrableOn · exact Filter.Eventually.of_forall (fun T => norm_nonneg (F T)) · exact hsubae have hmonoG : (∫ T : ℝ in sᶜ, ‖G T‖) ≤ ∫ T : ℝ in tail, ‖G T‖ := by apply setIntegral_mono_set hG.norm.integrableOn · exact Filter.Eventually.of_forall (fun T => norm_nonneg (G T)) · exact hsubae have hpoint : ∀ T ∈ sᶜ, ‖F T - G T‖ ≤ ‖F T‖ + ‖G T‖ := by intro T hT exact norm_sub_le _ _ have hcompare := setIntegral_mono_on hdiff.norm.integrableOn (hF.norm.add hG.norm).integrableOn (measurableSet_Icc.compl) hpoint have htailbound : ‖∫ T : ℝ in sᶜ, (F T - G T)‖ ≤ (∫ T : ℝ in tail, ‖F T‖) + (∫ T : ℝ in tail, ‖G T‖) := by calc ‖∫ T : ℝ in sᶜ, (F T - G T)‖ ≤ ∫ T : ℝ in sᶜ, ‖F T - G T‖ := MeasureTheory.norm_integral_le_integral_norm _ _ ≤ ∫ T : ℝ in sᶜ, (‖F T‖ + ‖G T‖) := hcompare _ = (∫ T : ℝ in sᶜ, ‖F T‖) + (∫ T : ℝ in sᶜ, ‖G T‖) := by rw [integral_add hF.norm.integrableOn hG.norm.integrableOn] _ ≤ (∫ T : ℝ in tail, ‖F T‖) + (∫ T : ℝ in tail, ‖G T‖) := add_le_add hmonoF hmonoG have hsplit := integral_add_compl (μ := volume) (f := fun T : ℝ => F T - G T) (s := s) (show MeasurableSet s from measurableSet_Icc) hdiff calc ‖(∫ T : ℝ, F T) - (∫ T : ℝ, G T)‖ = ‖∫ T : ℝ, (F T - G T)‖ := by rw [integral_sub hF hG] _ = ‖(∫ T : ℝ in s, (F T - G T)) + (∫ T : ℝ in sᶜ, (F T - G T))‖ := by rw [hsplit] _ ≤ ‖∫ T : ℝ in s, (F T - G T)‖ + ‖∫ T : ℝ in sᶜ, (F T - G T)‖ := norm_add_le _ _ _ ≤ ‖∫ T : ℝ in s, (F T - G T)‖ + ((∫ T : ℝ in tail, ‖F T‖) + (∫ T : ℝ in tail, ‖G T‖)) := by gcongr _ = ‖∫ T : ℝ in Icc (-R) R, (F T - G T)‖ + (∫ T : ℝ in saddleGaussianTailSet R, ‖F T‖) + (∫ T : ℝ in saddleGaussianTailSet R, ‖G T‖) := by try dsimp [s, tail] ring theorem saddleSourceGaussianKernel_scaled_integral {ε ℓ u : ℝ} (hℓ : 0 < ℓ) (hV : 0 < saddleSourceGaussianVariance ε ℓ u) : Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) = Real.sqrt (2 * Real.pi) := by let V : ℝ := saddleSourceGaussianVariance ε ℓ u have hV' : 0 < V := hV have hproduct : 0 < ℓ * V := mul_pos hℓ hV rw [saddleSourceGaussianKernel_integral] change Real.sqrt (ℓ * V) * Real.sqrt (Real.pi / (ℓ * V / 2)) = Real.sqrt (2 * Real.pi) rw [← Real.sqrt_mul hproduct.le] congr 1 field_simp [hℓ.ne', hV'.ne', hproduct.ne'] theorem saddleSource_scaled_tail_lt_relative_gaussian {ε ℓ u C A κ X W : ℝ} (hℓ : 0 < ℓ) (hV : 0 < saddleSourceGaussianVariance ε ℓ u) (hC : 0 < C) (hA : 0 < A) (hbound : X ≤ C * A * W) (hnormalized : Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) * W < κ) : X < (C * κ / Real.sqrt (2 * Real.pi)) * A * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by have hs : 0 < Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) := by positivity have hg : 0 < Real.sqrt (2 * Real.pi) := by positivity have hmass := saddleSourceGaussianKernel_scaled_integral hℓ hV have hgaussian : (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) = Real.sqrt (2 * Real.pi) / Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) := by apply (eq_div_iff hs.ne').mpr nlinarith have hW : W < κ / Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) := by apply (lt_div_iff₀ hs).mpr nlinarith calc X ≤ C * A * W := hbound _ < C * A * (κ / Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u)) := by exact mul_lt_mul_of_pos_left hW (mul_pos hC hA) _ = (C * κ / Real.sqrt (2 * Real.pi)) * A * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by rw [hgaussian] field_simp [hs.ne', hg.ne'] theorem saddleSource_weighted_tail_integral_le {F : ℝ → ℂ} {W : ℝ → ℝ} {C A R : ℝ} (hF : Integrable F) (hW : Integrable W) (hpoint : ∀ T ∈ saddleGaussianTailSet R, ‖F T‖ ≤ (C * A) * W T) : (∫ T : ℝ in saddleGaussianTailSet R, ‖F T‖) ≤ C * A * (∫ T : ℝ in saddleGaussianTailSet R, W T) := by have hmajor : Integrable (fun T : ℝ => (C * A) * W T) := hW.const_mul (C * A) have hcompare := setIntegral_mono_on hF.norm.integrableOn hmajor.integrableOn (saddleGaussianTailSet_measurable R) hpoint calc (∫ T : ℝ in saddleGaussianTailSet R, ‖F T‖) ≤ ∫ T : ℝ in saddleGaussianTailSet R, (C * A) * W T := hcompare _ = C * A * (∫ T : ℝ in saddleGaussianTailSet R, W T) := by rw [integral_const_mul] theorem exists_saddleSourceCenteredPlusIntegrand_weighted_tail_integral_bound {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : ∃ C : ℝ, 0 < C ∧ ∀ ℓ : ℝ, 0 < ℓ → ∀ u : ℝ, -1 < u → ∀ v R : ℝ, Integrable (fun T : ℝ => saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T)) → (∫ T : ℝ in saddleGaussianTailSet R, ‖saddleSourceCenteredPlusIntegrand ε ℓ u v T‖) ≤ C * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T)) := by obtain ⟨C, hC, hpoly⟩ := exists_plusPolynomial_uniform_weighted_bound hε refine ⟨C, hC, ?_⟩ intro ℓ hℓ u hu v R hweighted apply saddleSource_weighted_tail_integral_le (saddleSourceCenteredPlusIntegrand_integrable hε hℓ hu horder v) hweighted intro T hT rw [saddleSourceCenteredPlusIntegrand_norm hε hℓ hu horder] have hp := hpoly u hu.le T unfold saddleGaussianTailWeight calc Real.exp (-saddleSourceContourDamping ε ℓ u T) * ‖plusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ))‖ ≤ Real.exp (-saddleSourceContourDamping ε ℓ u T) * (C * (1 + |T| ^ 3) * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖) := by gcongr _ = (C * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖) * ((1 + |T| ^ 3) * Real.exp (-saddleSourceContourDamping ε ℓ u T)) := by ring theorem exists_saddleSourceCenteredMinusIntegrand_weighted_tail_integral_bound {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) : ∃ C : ℝ, 0 < C ∧ ∀ ℓ : ℝ, 0 < ℓ → ∀ u : ℝ, 1 + ε / 4 ≤ u → ∀ v R : ℝ, Integrable (fun T : ℝ => saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T)) → (∫ T : ℝ in saddleGaussianTailSet R, ‖saddleSourceCenteredMinusIntegrand ε ℓ u v T‖) ≤ C * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T)) := by obtain ⟨C, hC, hpoly⟩ := exists_minusPolynomial_uniform_weighted_bound hε refine ⟨C, hC, ?_⟩ intro ℓ hℓ u hu v R hweighted have hu' : -1 < u := by linarith apply saddleSource_weighted_tail_integral_le (saddleSourceCenteredMinusIntegrand_integrable hε hℓ hu' horder v) hweighted intro T hT rw [saddleSourceCenteredMinusIntegrand_norm hε hℓ hu' horder] have hp := hpoly u hu T unfold saddleGaussianTailWeight calc Real.exp (-saddleSourceContourDamping ε ℓ u T) * ‖minusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ))‖ ≤ Real.exp (-saddleSourceContourDamping ε ℓ u T) * (C * (1 + |T| ^ 3) * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖) := by gcongr _ = (C * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖) * ((1 + |T| ^ 3) * Real.exp (-saddleSourceContourDamping ε ℓ u T)) := by ring theorem saddleSourceGaussianPlusIntegrand_tail_norm_eq (ε ℓ u R : ℝ) : (∫ T : ℝ in saddleGaussianTailSet R, ‖saddleSourceGaussianPlusIntegrand ε ℓ u T‖) = ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ in saddleGaussianTailSet R, saddleSourceGaussianKernel ε ℓ u T) := by calc (∫ T : ℝ in saddleGaussianTailSet R, ‖saddleSourceGaussianPlusIntegrand ε ℓ u T‖) = ∫ T : ℝ in saddleGaussianTailSet R, saddleSourceGaussianKernel ε ℓ u T * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := by apply MeasureTheory.integral_congr_ae filter_upwards [] with T unfold saddleSourceGaussianPlusIntegrand rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos (show 0 < saddleSourceGaussianKernel ε ℓ u T by unfold saddleSourceGaussianKernel positivity)] _ = ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ in saddleGaussianTailSet R, saddleSourceGaussianKernel ε ℓ u T) := by rw [integral_mul_const] ring theorem saddleSourceGaussianMinusIntegrand_tail_norm_eq (ε ℓ u R : ℝ) : (∫ T : ℝ in saddleGaussianTailSet R, ‖saddleSourceGaussianMinusIntegrand ε ℓ u T‖) = ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ in saddleGaussianTailSet R, saddleSourceGaussianKernel ε ℓ u T) := by calc (∫ T : ℝ in saddleGaussianTailSet R, ‖saddleSourceGaussianMinusIntegrand ε ℓ u T‖) = ∫ T : ℝ in saddleGaussianTailSet R, saddleSourceGaussianKernel ε ℓ u T * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by apply MeasureTheory.integral_congr_ae filter_upwards [] with T unfold saddleSourceGaussianMinusIntegrand rw [norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos (show 0 < saddleSourceGaussianKernel ε ℓ u T by unfold saddleSourceGaussianKernel positivity)] _ = ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ in saddleGaussianTailSet R, saddleSourceGaussianKernel ε ℓ u T) := by rw [integral_mul_const] ring theorem saddleGaussian_fullLine_error_lt_of_central_and_normalized_tails {ε ℓ u R A κcentral κsource κgaussian : ℝ} {F G : ℝ → ℂ} (hF : Integrable F) (hG : Integrable G) (hℓ : 0 < ℓ) (hV : 0 < saddleSourceGaussianVariance ε ℓ u) (hcentral : ‖∫ T : ℝ in Icc (-R) R, (F T - G T)‖ < κcentral * A * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T)) (hsource : Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) * (∫ T : ℝ in saddleGaussianTailSet R, ‖F T‖) < κsource * A) (hgaussian : Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) * (∫ T : ℝ in saddleGaussianTailSet R, ‖G T‖) < κgaussian * A) : ‖(∫ T : ℝ, F T) - (∫ T : ℝ, G T)‖ < (κcentral + (κsource + κgaussian) / Real.sqrt (2 * Real.pi)) * A * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by have hsplit := saddleGaussian_fullLine_error_le_central_add_tails hF hG R have hone : (0 : ℝ) < 1 := by norm_num have hsource' := saddleSource_scaled_tail_lt_relative_gaussian (ε := ε) (u := u) (C := (1 : ℝ)) (A := (1 : ℝ)) (κ := κsource * A) (X := ∫ T : ℝ in saddleGaussianTailSet R, ‖F T‖) (W := ∫ T : ℝ in saddleGaussianTailSet R, ‖F T‖) hℓ hV hone hone (by simp) hsource have hgaussian' := saddleSource_scaled_tail_lt_relative_gaussian (ε := ε) (u := u) (C := (1 : ℝ)) (A := (1 : ℝ)) (κ := κgaussian * A) (X := ∫ T : ℝ in saddleGaussianTailSet R, ‖G T‖) (W := ∫ T : ℝ in saddleGaussianTailSet R, ‖G T‖) hℓ hV hone hone (by simp) hgaussian calc ‖(∫ T : ℝ, F T) - (∫ T : ℝ, G T)‖ ≤ ‖∫ T : ℝ in Icc (-R) R, (F T - G T)‖ + (∫ T : ℝ in saddleGaussianTailSet R, ‖F T‖) + (∫ T : ℝ in saddleGaussianTailSet R, ‖G T‖) := hsplit _ < (κcentral * A * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T)) + ((κsource * A / Real.sqrt (2 * Real.pi)) * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T)) + ((κgaussian * A / Real.sqrt (2 * Real.pi)) * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T)) := by simpa using! add_lt_add (add_lt_add hcentral hsource') hgaussian' _ = (κcentral + (κsource + κgaussian) / Real.sqrt (2 * Real.pi)) * A * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by ring theorem saddleSourceGaussianKernel_normalized_tail_le {ε ℓ u z : ℝ} (hℓ : 0 < ℓ) (hV : 0 < saddleSourceGaussianVariance ε ℓ u) (hz : 0 ≤ z) (hlarge : 12 ≤ ℓ * saddleSourceGaussianVariance ε ℓ u) : Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) * (∫ T : ℝ in saddleGaussianTailSet (z / Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u)), saddleSourceGaussianKernel ε ℓ u T) ≤ 4 * Real.sqrt (2 * Real.pi) * Real.exp (-(z ^ 2) / 8) := by let V : ℝ := saddleSourceGaussianVariance ε ℓ u let k : ℝ := ℓ * V / 2 let s : ℝ := Real.sqrt (ℓ * V) let R : ℝ := z / s have hproduct : 0 < ℓ * V := mul_pos hℓ hV have hs : 0 < s := by try dsimp [s] positivity have hk : 6 ≤ k := by try dsimp [k, V] linarith have hkpos : 0 < k := by linarith have hR : 0 ≤ R := by try dsimp [R] positivity have hgaussian := saddleSourceGaussianKernel_integrable hℓ hV have hweighted := saddleGaussianTailWeight_mul_gaussian_integrable hkpos have hpoint : ∀ T ∈ saddleGaussianTailSet R, saddleSourceGaussianKernel ε ℓ u T ≤ saddleGaussianTailWeight T * Real.exp (-k * T ^ 2) := by intro T hT have hw : 1 ≤ saddleGaussianTailWeight T := by unfold saddleGaussianTailWeight nlinarith [pow_nonneg (abs_nonneg T) 3] unfold saddleSourceGaussianKernel change Real.exp (-k * T ^ 2) ≤ saddleGaussianTailWeight T * Real.exp (-k * T ^ 2) nlinarith [mul_le_mul_of_nonneg_right hw (Real.exp_pos (-k * T ^ 2)).le] have hcompare := setIntegral_mono_on hgaussian.integrableOn hweighted.integrableOn (saddleGaussianTailSet_measurable R) hpoint have htail := saddleGaussian_cubic_tail_integral_le hk hR have hexponent : (k / 4) * R ^ 2 = z ^ 2 / 8 := by have hsquare : s ^ 2 = ℓ * V := by try dsimp [s] exact Real.sq_sqrt hproduct.le try dsimp [k, R] field_simp [hs.ne'] nlinarith [hsquare] have hroot : s * Real.sqrt (Real.pi / (k / 4)) = 2 * Real.sqrt (2 * Real.pi) := by have hkquarter : 0 < k / 4 := by positivity have hratio : 0 ≤ Real.pi / (k / 4) := by positivity have hleft : 0 ≤ s * Real.sqrt (Real.pi / (k / 4)) := by positivity have hright : 0 ≤ 2 * Real.sqrt (2 * Real.pi) := by positivity have hsquare : (s * Real.sqrt (Real.pi / (k / 4))) ^ 2 = (2 * Real.sqrt (2 * Real.pi)) ^ 2 := by rw [mul_pow, mul_pow, Real.sq_sqrt hratio, Real.sq_sqrt (by positivity : 0 ≤ 2 * Real.pi)] have hsquare' : s ^ 2 = ℓ * V := by try dsimp [s] exact Real.sq_sqrt hproduct.le rw [hsquare'] try dsimp [k] have hV' : 0 < V := hV field_simp [hℓ.ne', hV'.ne'] norm_num nlinarith have hexponent' : -(k / 4) * R ^ 2 = -(z ^ 2) / 8 := by nlinarith [hexponent] change s * (∫ T : ℝ in saddleGaussianTailSet R, saddleSourceGaussianKernel ε ℓ u T) ≤ 4 * Real.sqrt (2 * Real.pi) * Real.exp (-(z ^ 2) / 8) calc s * (∫ T : ℝ in saddleGaussianTailSet R, saddleSourceGaussianKernel ε ℓ u T) ≤ s * (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-k * T ^ 2)) := by exact mul_le_mul_of_nonneg_left hcompare hs.le _ ≤ s * (2 * Real.exp (-(k / 4) * R ^ 2) * Real.sqrt (Real.pi / (k / 4))) := by exact mul_le_mul_of_nonneg_left htail hs.le _ = 4 * Real.sqrt (2 * Real.pi) * Real.exp (-(z ^ 2) / 8) := by rw [hexponent'] calc s * (2 * Real.exp (-(z ^ 2) / 8) * Real.sqrt (Real.pi / (k / 4))) = 2 * Real.exp (-(z ^ 2) / 8) * (s * Real.sqrt (Real.pi / (k / 4))) := by ring _ = 2 * Real.exp (-(z ^ 2) / 8) * (2 * Real.sqrt (2 * Real.pi)) := by rw [hroot] _ = _ := by ring def saddleSourceGaussianNormalizedTailMajorant (x : ℝ) : ℝ := 4 * Real.sqrt (2 * Real.pi) * Real.exp (-(x ^ (1 / 6 : ℝ)) / 8) theorem tendsto_saddleSourceGaussianNormalizedTailMajorant : Tendsto saddleSourceGaussianNormalizedTailMajorant atTop (𝓝 (0 : ℝ)) := by have hpower : Tendsto (fun x : ℝ => x ^ (1 / 6 : ℝ)) atTop atTop := tendsto_rpow_atTop (by norm_num : (0 : ℝ) < 1 / 6) have hnegative : Tendsto (fun x : ℝ => -(x ^ (1 / 6 : ℝ)) / 8) atTop atBot := by have h := hpower.const_mul_atTop_of_neg (by norm_num : -(1 / 8 : ℝ) < 0) convert! h using 1 funext x ring have hexp := Real.tendsto_exp_atBot.comp hnegative have h := hexp.const_mul (4 * Real.sqrt (2 * Real.pi)) change Tendsto (fun x : ℝ => 4 * Real.sqrt (2 * Real.pi) * Real.exp (-(x ^ (1 / 6 : ℝ)) / 8)) atTop (𝓝 (0 : ℝ)) simpa only [Function.comp_apply, mul_zero] using! h theorem eventually_saddleSource_firstBranch_uniform_gaussian_tail : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ κ : ℝ, 0 < κ → ∀ᶠ ℓ : ℝ in atTop, ∀ u : ℝ, -1 < u → u ≤ 1 + ε / 2 → Real.log ℓ / 4 ≤ ℓ * (1 + u) → Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) * (∫ T : ℝ in saddleGaussianTailSet (saddleSourceFirstBranchCentralRadius ε ℓ u), saddleSourceGaussianKernel ε ℓ u T) < κ := by have hsmall : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ε ≤ 1 / 4 := by have hnear : Tendsto (fun ε : ℝ => ε) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := tendsto_id.mono_left nhdsWithin_le_nhds filter_upwards [hnear.eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1 / 4))] with ε hε exact hε.le filter_upwards [self_mem_nhdsWithin, hsmall, eventually_upper_shortCutoff_le_shortEndpoint, eventually_upper_shortMargin_positive, eventually_saddleSourceGaussianVariance_firstBranch_pos] with ε hε hεsmall horder hmargin hvariance change 0 < ε at hε intro κ hκ let U : ℝ := 2 + ε / 2 have hU : 0 < U := by try dsimp [U] positivity have hlog : Tendsto (fun ℓ : ℝ => Real.log ℓ / 4) atTop atTop := Real.tendsto_log_atTop.atTop_div_const (by norm_num : (0 : ℝ) < 4) have hdecay := (tendsto_saddleSourceGaussianNormalizedTailMajorant.comp hlog).eventually (Iio_mem_nhds hκ) filter_upwards [eventually_gt_atTop (0 : ℝ), eventually_ge_atTop (6 * U / ε), hlog.eventually (eventually_ge_atTop (0 : ℝ)), hdecay] with ℓ hℓ hthreshold hlognonneg hdecayℓ intro u hulower huupper hlogscale let η : ℝ := 1 + u let V : ℝ := saddleSourceGaussianVariance ε ℓ u let z : ℝ := (ℓ * η) ^ (1 / 12 : ℝ) have hη : 0 < η := by try dsimp [η] linarith have hηupper : η ≤ U := by try dsimp [η, U] linarith have hV : 0 < V := hvariance ℓ hℓ u hulower huupper have hmargin' : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a := by intro a ha have h := hmargin a ha linarith have hvar := upperFirstBranch_saddleSourceGaussianVariance_scaled_lower_bound hε hεsmall hℓ hulower huupper horder hmargin' have hvarupper : 2 * ε ≤ U * V := by have hproduct := mul_le_mul_of_nonneg_right hηupper hV.le change 2 * ε ≤ η * V at hvar exact hvar.trans hproduct have hthreshold' : 6 * U ≤ ℓ * ε := by have h := (div_le_iff₀ hε).mp hthreshold nlinarith have hlarge : 12 ≤ ℓ * V := by have hproduct := mul_le_mul_of_nonneg_left hvarupper hℓ.le have hmain : U * 12 ≤ U * (ℓ * V) := by nlinarith by_contra hnot have hlt : ℓ * V < 12 := lt_of_not_ge hnot have hcontradiction := mul_lt_mul_of_pos_left hlt hU linarith have hz : 0 ≤ z := by try dsimp [z] exact Real.rpow_nonneg (mul_nonneg hℓ.le hη.le) _ have hgaussian := saddleSourceGaussianKernel_normalized_tail_le (ε := ε) (ℓ := ℓ) (u := u) (z := z) hℓ hV hz hlarge have hpower : (Real.log ℓ / 4) ^ (1 / 6 : ℝ) ≤ z ^ 2 := by have hmono := Real.rpow_le_rpow hlognonneg hlogscale (by norm_num : (0 : ℝ) ≤ 1 / 6) have hsquare : z ^ 2 = (ℓ * η) ^ (1 / 6 : ℝ) := by try dsimp [z] rw [← Real.rpow_natCast, ← Real.rpow_mul (mul_nonneg hℓ.le hη.le)] congr 1 norm_num rw [hsquare] exact hmono calc Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) * (∫ T : ℝ in saddleGaussianTailSet (saddleSourceFirstBranchCentralRadius ε ℓ u), saddleSourceGaussianKernel ε ℓ u T) ≤ 4 * Real.sqrt (2 * Real.pi) * Real.exp (-(z ^ 2) / 8) := by simpa [saddleSourceFirstBranchCentralRadius, V, η, z] using! hgaussian _ ≤ saddleSourceGaussianNormalizedTailMajorant (Real.log ℓ / 4) := by unfold saddleSourceGaussianNormalizedTailMajorant gcongr _ < κ := hdecayℓ theorem eventually_saddleSource_secondBranch_uniform_gaussian_tail : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ κ : ℝ, 0 < κ → ∀ᶠ ℓ : ℝ in atTop, ∀ δ : ℝ, ε / 2 ≤ δ → Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ)) * (∫ T : ℝ in saddleGaussianTailSet (saddleSourceSecondBranchCentralRadius ε ℓ (1 + δ)), saddleSourceGaussianKernel ε ℓ (1 + δ) T) < κ := by filter_upwards [self_mem_nhdsWithin, eventually_saddleSourceGaussianVariance_secondBranch_floor] with ε hε hfloor change 0 < ε at hε intro κ hκ let V₀ : ℝ := saddleSourceSecondBranchVarianceFloor ε have hV₀ : 0 < V₀ := saddleSourceSecondBranchVarianceFloor_pos hε have hdecay := tendsto_saddleSourceGaussianNormalizedTailMajorant.eventually (Iio_mem_nhds hκ) filter_upwards [eventually_gt_atTop (0 : ℝ), eventually_ge_atTop (12 / V₀), hdecay] with ℓ hℓ hthreshold hdecayℓ intro δ hδ let V : ℝ := saddleSourceGaussianVariance ε ℓ (1 + δ) let z : ℝ := ℓ ^ (1 / 12 : ℝ) have hVlower : V₀ ≤ V := hfloor ℓ hℓ δ hδ have hV : 0 < V := hV₀.trans_le hVlower have hlarge : 12 ≤ ℓ * V := by have hbase := (div_le_iff₀ hV₀).mp hthreshold calc 12 ≤ ℓ * V₀ := by nlinarith _ ≤ ℓ * V := mul_le_mul_of_nonneg_left hVlower hℓ.le have hz : 0 ≤ z := by try dsimp [z] exact Real.rpow_nonneg hℓ.le _ have hgaussian := saddleSourceGaussianKernel_normalized_tail_le (ε := ε) (ℓ := ℓ) (u := 1 + δ) (z := z) hℓ hV hz hlarge have hsquare : z ^ 2 = ℓ ^ (1 / 6 : ℝ) := by try dsimp [z] rw [← Real.rpow_natCast, ← Real.rpow_mul hℓ.le] congr 1 norm_num calc Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ)) * (∫ T : ℝ in saddleGaussianTailSet (saddleSourceSecondBranchCentralRadius ε ℓ (1 + δ)), saddleSourceGaussianKernel ε ℓ (1 + δ) T) ≤ 4 * Real.sqrt (2 * Real.pi) * Real.exp (-(z ^ 2) / 8) := by simpa [saddleSourceSecondBranchCentralRadius, V, z] using! hgaussian _ = saddleSourceGaussianNormalizedTailMajorant ℓ := by unfold saddleSourceGaussianNormalizedTailMajorant rw [hsquare] _ < κ := hdecayℓ end noncomputable section open Filter Set MeasureTheory intervalIntegral open scoped Topology theorem eventually_saddleSourceFirstBranch_sourceL1Tails : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ κ : ℝ, 0 < κ → ∀ᶠ ℓ : ℝ in atTop, ∀ u : ℝ, -1 < u → u ≤ 1 + ε / 2 → Real.log ℓ / 4 ≤ ℓ * (1 + u) → (Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) * (∫ T : ℝ in saddleGaussianTailSet (saddleSourceFirstBranchCentralRadius ε ℓ u), ‖saddleSourceCenteredPlusIntegrand ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T‖) < κ * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖) ∧ (1 + ε / 4 ≤ u → Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) * (∫ T : ℝ in saddleGaussianTailSet (saddleSourceFirstBranchCentralRadius ε ℓ u), ‖saddleSourceCenteredMinusIntegrand ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T‖) < κ * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖) := by have heps : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ε ≤ 1 / 4 := by have hnear := (tendsto_id.mono_left (nhdsWithin_le_nhds : 𝓝[>] (0 : ℝ) ≤ 𝓝 (0 : ℝ))).eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1 / 4)) filter_upwards [hnear] with ε hε exact hε.le filter_upwards [self_mem_nhdsWithin, heps, eventually_upper_shortCutoff_le_shortEndpoint, eventually_upper_shortMargin_positive, eventually_saddleSourceGaussianVariance_firstBranch_pos, eventually_saddleSource_firstBranch_uniform_tail] with ε hε hεsmall horder hmargin hvariance htail change 0 < ε at hε have hmargin' : ∀ a ∈ Icc (shortCutoff ε) (shortEndpoint ε), 0 ≤ shortMargin ε a := by intro a ha have h := hmargin a ha nlinarith obtain ⟨Cp, hCp, hplus⟩ := exists_saddleSourceCenteredPlusIntegrand_weighted_tail_integral_bound hε horder obtain ⟨Cm, hCm, hminus⟩ := exists_saddleSourceCenteredMinusIntegrand_weighted_tail_integral_bound hε horder intro κ hκ filter_upwards [eventually_gt_atTop (0 : ℝ), htail (κ / Cp) (div_pos hκ hCp), htail (κ / Cm) (div_pos hκ hCm)] with ℓ hℓ hp hm intro u hu huupper hstar let R : ℝ := saddleSourceFirstBranchCentralRadius ε ℓ u let v : ℝ := saddleSourceStationaryLogRadius ε ℓ u let V : ℝ := saddleSourceGaussianVariance ε ℓ u have hV : 0 < V := hvariance ℓ hℓ u hu huupper have hs : 0 < Real.sqrt (ℓ * V) := by positivity have hweighted := saddleSource_firstBranch_weighted_integrable hε hεsmall hℓ hu huupper horder hmargin' have hpnormal : Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T)) < κ / Cp := by simpa [R, V, saddleSourceFirstBranchCentralRadius] using! hp u hu huupper hstar have hmnormal : Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T)) < κ / Cm := by simpa [R, V, saddleSourceFirstBranchCentralRadius] using! hm u hu huupper hstar constructor · have hden : 0 < ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := (beta_pos hε).trans_le (plusPolynomial_imaginary_norm_ge_beta hε hu.le) have hbound := hplus ℓ hℓ u hu v R hweighted change Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, ‖saddleSourceCenteredPlusIntegrand ε ℓ u v T‖) < κ * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ calc Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, ‖saddleSourceCenteredPlusIntegrand ε ℓ u v T‖) ≤ Real.sqrt (ℓ * V) * (Cp * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T))) := by gcongr _ = Cp * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T))) := by ring _ < Cp * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (κ / Cp) := by gcongr _ = κ * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := by field_simp [hCp.ne'] · intro huminus have hden : 0 < ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hb := beta_pos hε have hnorm := minusPolynomial_imaginary_norm_ge_three_beta hε huminus nlinarith have hbound := hminus ℓ hℓ u huminus v R hweighted change Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, ‖saddleSourceCenteredMinusIntegrand ε ℓ u v T‖) < κ * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ calc Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, ‖saddleSourceCenteredMinusIntegrand ε ℓ u v T‖) ≤ Real.sqrt (ℓ * V) * (Cm * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T))) := by gcongr _ = Cm * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T))) := by ring _ < Cm * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (κ / Cm) := by gcongr _ = κ * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by field_simp [hCm.ne'] theorem eventually_saddleSourceFirstBranch_gaussianL1Tails : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ κ : ℝ, 0 < κ → ∀ᶠ ℓ : ℝ in atTop, ∀ u : ℝ, -1 < u → u ≤ 1 + ε / 2 → Real.log ℓ / 4 ≤ ℓ * (1 + u) → (Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) * (∫ T : ℝ in saddleGaussianTailSet (saddleSourceFirstBranchCentralRadius ε ℓ u), ‖saddleSourceGaussianPlusIntegrand ε ℓ u T‖) < κ * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖) ∧ (1 + ε / 4 ≤ u → Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) * (∫ T : ℝ in saddleGaussianTailSet (saddleSourceFirstBranchCentralRadius ε ℓ u), ‖saddleSourceGaussianMinusIntegrand ε ℓ u T‖) < κ * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖) := by filter_upwards [self_mem_nhdsWithin, eventually_saddleSource_firstBranch_uniform_gaussian_tail] with ε hε htail change 0 < ε at hε intro κ hκ filter_upwards [htail κ hκ] with ℓ hℓ intro u hu huupper hstar let R : ℝ := saddleSourceFirstBranchCentralRadius ε ℓ u let s : ℝ := Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) have hkernel : s * (∫ T : ℝ in saddleGaussianTailSet R, saddleSourceGaussianKernel ε ℓ u T) < κ := by simpa [s, R, saddleSourceFirstBranchCentralRadius] using! hℓ u hu huupper hstar constructor · have hden : 0 < ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := (beta_pos hε).trans_le (plusPolynomial_imaginary_norm_ge_beta hε hu.le) change s * (∫ T : ℝ in saddleGaussianTailSet R, ‖saddleSourceGaussianPlusIntegrand ε ℓ u T‖) < κ * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ rw [saddleSourceGaussianPlusIntegrand_tail_norm_eq] nlinarith [mul_lt_mul_of_pos_left hkernel hden] · intro huminus have hden : 0 < ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hb := beta_pos hε have hnorm := minusPolynomial_imaginary_norm_ge_three_beta hε huminus nlinarith change s * (∫ T : ℝ in saddleGaussianTailSet R, ‖saddleSourceGaussianMinusIntegrand ε ℓ u T‖) < κ * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ rw [saddleSourceGaussianMinusIntegrand_tail_norm_eq] nlinarith [mul_lt_mul_of_pos_left hkernel hden] theorem eventually_saddleSourceFirstBranch_fullGaussianErrors : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ᶠ ℓ : ℝ in atTop, ∀ u : ℝ, -1 < u → u ≤ 1 + ε / 2 → Real.log ℓ / 4 ≤ ℓ * (1 + u) → (‖(∫ T : ℝ, saddleSourceCenteredPlusIntegrand ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T) - (∫ T : ℝ, saddleSourceGaussianPlusIntegrand ε ℓ u T)‖ < ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T)) ∧ (1 + ε / 4 ≤ u → ‖(∫ T : ℝ, saddleSourceCenteredMinusIntegrand ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T) - (∫ T : ℝ, saddleSourceGaussianMinusIntegrand ε ℓ u T)‖ < ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T)) := by filter_upwards [self_mem_nhdsWithin, eventually_upper_shortCutoff_le_shortEndpoint, eventually_saddleSourceGaussianVariance_firstBranch_pos, eventually_saddleSourceFirstBranch_centralGaussianErrors, eventually_saddleSourceFirstBranch_sourceL1Tails, eventually_saddleSourceFirstBranch_gaussianL1Tails] with ε hε horder hvariance hcentral hsource hgaussian change 0 < ε at hε let a : ℝ := Real.sqrt (2 * Real.pi) / 8 have ha : 0 < a := by try dsimp [a] positivity filter_upwards [eventually_gt_atTop (0 : ℝ), hcentral (1 / 4 : ℝ) (by norm_num), hsource a ha, hgaussian a ha] with ℓ hℓ hc hs hg intro u hu huupper hstar let R : ℝ := saddleSourceFirstBranchCentralRadius ε ℓ u let v : ℝ := saddleSourceStationaryLogRadius ε ℓ u have hV := hvariance ℓ hℓ u hu huupper have hG := saddleSourceGaussianKernel_integral_pos hℓ hV have hsqrt : 0 < Real.sqrt (2 * Real.pi) := by positivity obtain ⟨hcplus, hcminus⟩ := hc u hu huupper hstar obtain ⟨hsplus, hsminus⟩ := hs u hu huupper hstar obtain ⟨hgplus, hgminus⟩ := hg u hu huupper hstar constructor · have hden : 0 < ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := (beta_pos hε).trans_le (plusPolynomial_imaginary_norm_ge_beta hε hu.le) have hfull := saddleGaussian_fullLine_error_lt_of_central_and_normalized_tails (ε := ε) (ℓ := ℓ) (u := u) (R := R) (A := ‖plusPolynomial ε (Complex.I * (u : ℂ))‖) (κcentral := (1 / 4 : ℝ)) (κsource := a) (κgaussian := a) (F := saddleSourceCenteredPlusIntegrand ε ℓ u v) (G := saddleSourceGaussianPlusIntegrand ε ℓ u) (saddleSourceCenteredPlusIntegrand_integrable hε hℓ hu horder v) (saddleSourceGaussianPlusIntegrand_integrable hℓ hV) hℓ hV hcplus hsplus hgplus calc ‖(∫ T : ℝ, saddleSourceCenteredPlusIntegrand ε ℓ u v T) - (∫ T : ℝ, saddleSourceGaussianPlusIntegrand ε ℓ u T)‖ < ((1 / 4 : ℝ) + (a + a) / Real.sqrt (2 * Real.pi)) * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := hfull _ = (1 / 2 : ℝ) * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by try dsimp [a] field_simp [hsqrt.ne'] ring _ < ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by nlinarith [mul_pos hden hG] · intro huminus have hden : 0 < ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hb := beta_pos hε have hnorm := minusPolynomial_imaginary_norm_ge_three_beta hε huminus nlinarith have hfull := saddleGaussian_fullLine_error_lt_of_central_and_normalized_tails (ε := ε) (ℓ := ℓ) (u := u) (R := R) (A := ‖minusPolynomial ε (Complex.I * (u : ℂ))‖) (κcentral := (1 / 4 : ℝ)) (κsource := a) (κgaussian := a) (F := saddleSourceCenteredMinusIntegrand ε ℓ u v) (G := saddleSourceGaussianMinusIntegrand ε ℓ u) (saddleSourceCenteredMinusIntegrand_integrable hε hℓ hu horder v) (saddleSourceGaussianMinusIntegrand_integrable hℓ hV) hℓ hV (hcminus huminus) (hsminus huminus) (hgminus huminus) calc ‖(∫ T : ℝ, saddleSourceCenteredMinusIntegrand ε ℓ u v T) - (∫ T : ℝ, saddleSourceGaussianMinusIntegrand ε ℓ u T)‖ < ((1 / 4 : ℝ) + (a + a) / Real.sqrt (2 * Real.pi)) * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := hfull _ = (1 / 2 : ℝ) * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by try dsimp [a] field_simp [hsqrt.ne'] ring _ < ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by nlinarith [mul_pos hden hG] theorem eventually_saddleSourceSecondBranch_sourceL1Tails_of_uniform_tail (hweighted : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ ℓ : ℝ, 0 < ℓ → ∀ δ : ℝ, ε / 2 ≤ δ → Integrable (fun T : ℝ => saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ (1 + δ) T))) (htail : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ κ : ℝ, 0 < κ → ∀ᶠ ℓ : ℝ in atTop, ∀ δ : ℝ, ε / 2 ≤ δ → Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ)) * (∫ T : ℝ in saddleGaussianTailSet (saddleSourceSecondBranchCentralRadius ε ℓ (1 + δ)), saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ (1 + δ) T)) < κ) : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ κ : ℝ, 0 < κ → ∀ᶠ ℓ : ℝ in atTop, ∀ δ : ℝ, ε / 2 ≤ δ → (Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ)) * (∫ T : ℝ in saddleGaussianTailSet (saddleSourceSecondBranchCentralRadius ε ℓ (1 + δ)), ‖saddleSourceCenteredPlusIntegrand ε ℓ (1 + δ) (saddleSourceStationaryLogRadius ε ℓ (1 + δ)) T‖) < κ * ‖plusPolynomial ε (Complex.I * ((1 + δ : ℝ) : ℂ))‖) ∧ (Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ)) * (∫ T : ℝ in saddleGaussianTailSet (saddleSourceSecondBranchCentralRadius ε ℓ (1 + δ)), ‖saddleSourceCenteredMinusIntegrand ε ℓ (1 + δ) (saddleSourceStationaryLogRadius ε ℓ (1 + δ)) T‖) < κ * ‖minusPolynomial ε (Complex.I * ((1 + δ : ℝ) : ℂ))‖) := by filter_upwards [self_mem_nhdsWithin, eventually_upper_shortCutoff_le_shortEndpoint, eventually_saddleSourceGaussianVariance_secondBranch_pos, hweighted, htail] with ε hε horder hvariance hweight htail' change 0 < ε at hε obtain ⟨Cp, hCp, hplus⟩ := exists_saddleSourceCenteredPlusIntegrand_weighted_tail_integral_bound hε horder obtain ⟨Cm, hCm, hminus⟩ := exists_saddleSourceCenteredMinusIntegrand_weighted_tail_integral_bound hε horder intro κ hκ filter_upwards [eventually_gt_atTop (0 : ℝ), htail' (κ / Cp) (div_pos hκ hCp), htail' (κ / Cm) (div_pos hκ hCm)] with ℓ hℓ hp hm intro δ hδ let u : ℝ := 1 + δ let R : ℝ := saddleSourceSecondBranchCentralRadius ε ℓ u let v : ℝ := saddleSourceStationaryLogRadius ε ℓ u let V : ℝ := saddleSourceGaussianVariance ε ℓ u have hu : -1 < u := by try dsimp [u] nlinarith have huminus : 1 + ε / 4 ≤ u := by try dsimp [u] nlinarith have hV : 0 < V := by try dsimp [V, u] exact hvariance ℓ hℓ δ hδ have hs : 0 < Real.sqrt (ℓ * V) := by positivity have hweighted' := hweight ℓ hℓ δ hδ have hpnormal : Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T)) < κ / Cp := by simpa [R, V, u] using! hp δ hδ have hmnormal : Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T)) < κ / Cm := by simpa [R, V, u] using! hm δ hδ constructor · have hden : 0 < ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := (beta_pos hε).trans_le (plusPolynomial_imaginary_norm_ge_beta hε hu.le) have hbound := hplus ℓ hℓ u hu v R hweighted' change Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, ‖saddleSourceCenteredPlusIntegrand ε ℓ u v T‖) < κ * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ calc Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, ‖saddleSourceCenteredPlusIntegrand ε ℓ u v T‖) ≤ Real.sqrt (ℓ * V) * (Cp * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T))) := by gcongr _ = Cp * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T))) := by ring _ < Cp * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (κ / Cp) := by gcongr _ = κ * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := by field_simp [hCp.ne'] · have hden : 0 < ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hb := beta_pos hε have hnorm := minusPolynomial_imaginary_norm_ge_three_beta hε huminus nlinarith have hbound := hminus ℓ hℓ u huminus v R hweighted' change Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, ‖saddleSourceCenteredMinusIntegrand ε ℓ u v T‖) < κ * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ calc Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, ‖saddleSourceCenteredMinusIntegrand ε ℓ u v T‖) ≤ Real.sqrt (ℓ * V) * (Cm * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T))) := by gcongr _ = Cm * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T))) := by ring _ < Cm * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (κ / Cm) := by gcongr _ = κ * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by field_simp [hCm.ne'] theorem eventually_saddleSourceSecondBranch_gaussianL1Tails : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ κ : ℝ, 0 < κ → ∀ᶠ ℓ : ℝ in atTop, ∀ δ : ℝ, ε / 2 ≤ δ → (Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ)) * (∫ T : ℝ in saddleGaussianTailSet (saddleSourceSecondBranchCentralRadius ε ℓ (1 + δ)), ‖saddleSourceGaussianPlusIntegrand ε ℓ (1 + δ) T‖) < κ * ‖plusPolynomial ε (Complex.I * ((1 + δ : ℝ) : ℂ))‖) ∧ (Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ)) * (∫ T : ℝ in saddleGaussianTailSet (saddleSourceSecondBranchCentralRadius ε ℓ (1 + δ)), ‖saddleSourceGaussianMinusIntegrand ε ℓ (1 + δ) T‖) < κ * ‖minusPolynomial ε (Complex.I * ((1 + δ : ℝ) : ℂ))‖) := by filter_upwards [self_mem_nhdsWithin, eventually_saddleSource_secondBranch_uniform_gaussian_tail] with ε hε htail change 0 < ε at hε intro κ hκ filter_upwards [htail κ hκ] with ℓ hℓ intro δ hδ let u : ℝ := 1 + δ let R : ℝ := saddleSourceSecondBranchCentralRadius ε ℓ u let s : ℝ := Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) have hu : -1 < u := by try dsimp [u] nlinarith have huminus : 1 + ε / 4 ≤ u := by try dsimp [u] nlinarith have hkernel : s * (∫ T : ℝ in saddleGaussianTailSet R, saddleSourceGaussianKernel ε ℓ u T) < κ := by simpa [s, R, u, saddleSourceSecondBranchCentralRadius] using! hℓ δ hδ constructor · have hden : 0 < ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := (beta_pos hε).trans_le (plusPolynomial_imaginary_norm_ge_beta hε hu.le) change s * (∫ T : ℝ in saddleGaussianTailSet R, ‖saddleSourceGaussianPlusIntegrand ε ℓ u T‖) < κ * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ rw [saddleSourceGaussianPlusIntegrand_tail_norm_eq] nlinarith [mul_lt_mul_of_pos_left hkernel hden] · have hden : 0 < ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hb := beta_pos hε have hnorm := minusPolynomial_imaginary_norm_ge_three_beta hε huminus nlinarith change s * (∫ T : ℝ in saddleGaussianTailSet R, ‖saddleSourceGaussianMinusIntegrand ε ℓ u T‖) < κ * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ rw [saddleSourceGaussianMinusIntegrand_tail_norm_eq] nlinarith [mul_lt_mul_of_pos_left hkernel hden] theorem eventually_saddleSourceSecondBranch_fullGaussianErrors_of_sourceL1 (hsource : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ κ : ℝ, 0 < κ → ∀ᶠ ℓ : ℝ in atTop, ∀ δ : ℝ, ε / 2 ≤ δ → (Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ)) * (∫ T : ℝ in saddleGaussianTailSet (saddleSourceSecondBranchCentralRadius ε ℓ (1 + δ)), ‖saddleSourceCenteredPlusIntegrand ε ℓ (1 + δ) (saddleSourceStationaryLogRadius ε ℓ (1 + δ)) T‖) < κ * ‖plusPolynomial ε (Complex.I * ((1 + δ : ℝ) : ℂ))‖) ∧ (Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ)) * (∫ T : ℝ in saddleGaussianTailSet (saddleSourceSecondBranchCentralRadius ε ℓ (1 + δ)), ‖saddleSourceCenteredMinusIntegrand ε ℓ (1 + δ) (saddleSourceStationaryLogRadius ε ℓ (1 + δ)) T‖) < κ * ‖minusPolynomial ε (Complex.I * ((1 + δ : ℝ) : ℂ))‖)) : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ᶠ ℓ : ℝ in atTop, ∀ δ : ℝ, ε / 2 ≤ δ → (‖(∫ T : ℝ, saddleSourceCenteredPlusIntegrand ε ℓ (1 + δ) (saddleSourceStationaryLogRadius ε ℓ (1 + δ)) T) - (∫ T : ℝ, saddleSourceGaussianPlusIntegrand ε ℓ (1 + δ) T)‖ < ‖plusPolynomial ε (Complex.I * ((1 + δ : ℝ) : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ (1 + δ) T)) ∧ (‖(∫ T : ℝ, saddleSourceCenteredMinusIntegrand ε ℓ (1 + δ) (saddleSourceStationaryLogRadius ε ℓ (1 + δ)) T) - (∫ T : ℝ, saddleSourceGaussianMinusIntegrand ε ℓ (1 + δ) T)‖ < ‖minusPolynomial ε (Complex.I * ((1 + δ : ℝ) : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ (1 + δ) T)) := by filter_upwards [self_mem_nhdsWithin, eventually_upper_shortCutoff_le_shortEndpoint, eventually_saddleSourceGaussianVariance_secondBranch_pos, eventually_saddleSourceSecondBranch_centralGaussianErrors, hsource, eventually_saddleSourceSecondBranch_gaussianL1Tails] with ε hε horder hvariance hcentral hsource' hgaussian change 0 < ε at hε let a : ℝ := Real.sqrt (2 * Real.pi) / 8 have ha : 0 < a := by try dsimp [a] positivity filter_upwards [eventually_gt_atTop (0 : ℝ), hcentral (1 / 4 : ℝ) (by norm_num), hsource' a ha, hgaussian a ha] with ℓ hℓ hc hs hg intro δ hδ let u : ℝ := 1 + δ let R : ℝ := saddleSourceSecondBranchCentralRadius ε ℓ u let v : ℝ := saddleSourceStationaryLogRadius ε ℓ u have hu : -1 < u := by try dsimp [u] nlinarith have huminus : 1 + ε / 4 ≤ u := by try dsimp [u] nlinarith have hV : 0 < saddleSourceGaussianVariance ε ℓ u := by try dsimp [u] exact hvariance ℓ hℓ δ hδ have hG := saddleSourceGaussianKernel_integral_pos hℓ hV have hsqrt : 0 < Real.sqrt (2 * Real.pi) := by positivity obtain ⟨hcplus, hcminus⟩ := hc δ hδ obtain ⟨hsplus, hsminus⟩ := hs δ hδ obtain ⟨hgplus, hgminus⟩ := hg δ hδ constructor · have hden : 0 < ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := (beta_pos hε).trans_le (plusPolynomial_imaginary_norm_ge_beta hε hu.le) have hfull := saddleGaussian_fullLine_error_lt_of_central_and_normalized_tails (ε := ε) (ℓ := ℓ) (u := u) (R := R) (A := ‖plusPolynomial ε (Complex.I * (u : ℂ))‖) (κcentral := (1 / 4 : ℝ)) (κsource := a) (κgaussian := a) (F := saddleSourceCenteredPlusIntegrand ε ℓ u v) (G := saddleSourceGaussianPlusIntegrand ε ℓ u) (saddleSourceCenteredPlusIntegrand_integrable hε hℓ hu horder v) (saddleSourceGaussianPlusIntegrand_integrable hℓ hV) hℓ hV hcplus hsplus hgplus change ‖(∫ T : ℝ, saddleSourceCenteredPlusIntegrand ε ℓ u v T) - (∫ T : ℝ, saddleSourceGaussianPlusIntegrand ε ℓ u T)‖ < ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) calc ‖(∫ T : ℝ, saddleSourceCenteredPlusIntegrand ε ℓ u v T) - (∫ T : ℝ, saddleSourceGaussianPlusIntegrand ε ℓ u T)‖ < ((1 / 4 : ℝ) + (a + a) / Real.sqrt (2 * Real.pi)) * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := hfull _ = (1 / 2 : ℝ) * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by try dsimp [a] field_simp [hsqrt.ne'] ring _ < ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by nlinarith [mul_pos hden hG] · have hden : 0 < ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hb := beta_pos hε have hnorm := minusPolynomial_imaginary_norm_ge_three_beta hε huminus nlinarith have hfull := saddleGaussian_fullLine_error_lt_of_central_and_normalized_tails (ε := ε) (ℓ := ℓ) (u := u) (R := R) (A := ‖minusPolynomial ε (Complex.I * (u : ℂ))‖) (κcentral := (1 / 4 : ℝ)) (κsource := a) (κgaussian := a) (F := saddleSourceCenteredMinusIntegrand ε ℓ u v) (G := saddleSourceGaussianMinusIntegrand ε ℓ u) (saddleSourceCenteredMinusIntegrand_integrable hε hℓ hu horder v) (saddleSourceGaussianMinusIntegrand_integrable hℓ hV) hℓ hV hcminus hsminus hgminus change ‖(∫ T : ℝ, saddleSourceCenteredMinusIntegrand ε ℓ u v T) - (∫ T : ℝ, saddleSourceGaussianMinusIntegrand ε ℓ u T)‖ < ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) calc ‖(∫ T : ℝ, saddleSourceCenteredMinusIntegrand ε ℓ u v T) - (∫ T : ℝ, saddleSourceGaussianMinusIntegrand ε ℓ u T)‖ < ((1 / 4 : ℝ) + (a + a) / Real.sqrt (2 * Real.pi)) * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := hfull _ = (1 / 2 : ℝ) * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by try dsimp [a] field_simp [hsqrt.ne'] ring _ < ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by nlinarith [mul_pos hden hG] theorem eventually_saddleSourceSecondBranch_sourceL1Tails : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ κ : ℝ, 0 < κ → ∀ᶠ ℓ : ℝ in atTop, ∀ δ : ℝ, ε / 2 ≤ δ → (Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ)) * (∫ T : ℝ in saddleGaussianTailSet (saddleSourceSecondBranchCentralRadius ε ℓ (1 + δ)), ‖saddleSourceCenteredPlusIntegrand ε ℓ (1 + δ) (saddleSourceStationaryLogRadius ε ℓ (1 + δ)) T‖) < κ * ‖plusPolynomial ε (Complex.I * ((1 + δ : ℝ) : ℂ))‖) ∧ (Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ (1 + δ)) * (∫ T : ℝ in saddleGaussianTailSet (saddleSourceSecondBranchCentralRadius ε ℓ (1 + δ)), ‖saddleSourceCenteredMinusIntegrand ε ℓ (1 + δ) (saddleSourceStationaryLogRadius ε ℓ (1 + δ)) T‖) < κ * ‖minusPolynomial ε (Complex.I * ((1 + δ : ℝ) : ℂ))‖) := by apply eventually_saddleSourceSecondBranch_sourceL1Tails_of_uniform_tail eventually_saddleSource_secondBranch_weighted_integrable simpa [saddleSourceSecondBranchCentralRadius] using! eventually_saddleSource_secondBranch_uniform_tail theorem eventually_saddleSourceSecondBranch_fullGaussianErrors : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ᶠ ℓ : ℝ in atTop, ∀ δ : ℝ, ε / 2 ≤ δ → (‖(∫ T : ℝ, saddleSourceCenteredPlusIntegrand ε ℓ (1 + δ) (saddleSourceStationaryLogRadius ε ℓ (1 + δ)) T) - (∫ T : ℝ, saddleSourceGaussianPlusIntegrand ε ℓ (1 + δ) T)‖ < ‖plusPolynomial ε (Complex.I * ((1 + δ : ℝ) : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ (1 + δ) T)) ∧ (‖(∫ T : ℝ, saddleSourceCenteredMinusIntegrand ε ℓ (1 + δ) (saddleSourceStationaryLogRadius ε ℓ (1 + δ)) T) - (∫ T : ℝ, saddleSourceGaussianMinusIntegrand ε ℓ (1 + δ) T)‖ < ‖minusPolynomial ε (Complex.I * ((1 + δ : ℝ) : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ (1 + δ) T)) := eventually_saddleSourceSecondBranch_fullGaussianErrors_of_sourceL1 eventually_saddleSourceSecondBranch_sourceL1Tails end noncomputable section open Filter MeasureTheory Set open scoped Topology BigOperators theorem saddleDigamma_eq_complexDigamma_re {x : ℝ} (hx : 0 < x) : saddleDigamma x = (Complex.digamma (x : ℂ)).re := by have hΓ : 0 < Real.Gamma x := Real.Gamma_pos_of_pos hx have hcomplex : DifferentiableAt ℂ Complex.Gamma (x : ℂ) := by apply Complex.differentiableAt_Gamma intro n h have hre := congrArg Complex.re h have hn : 0 ≤ (n : ℝ) := Nat.cast_nonneg n simp at hre linarith have hreal : HasDerivAt Real.Gamma (deriv Complex.Gamma (x : ℂ)).re x := by have h := hcomplex.hasDerivAt.real_of_complex simpa only [Complex.Gamma_ofReal, Complex.ofReal_re] using! h unfold saddleDigamma rw [Real.deriv_log_comp_eq_logDeriv hreal.differentiableAt hΓ.ne', logDeriv_apply, hreal.deriv, Complex.digamma_def, logDeriv_apply, Complex.Gamma_ofReal, Complex.div_ofReal_re] theorem complexGamma_differentiableOn_positiveHalfPlane : DifferentiableOn ℂ Complex.Gamma {z : ℂ | 0 < z.re} := by intro z hz apply DifferentiableAt.differentiableWithinAt apply Complex.differentiableAt_Gamma intro n hn have hre := congrArg Complex.re hn have hnreal : 0 ≤ (n : ℝ) := Nat.cast_nonneg n simp at hre change 0 < z.re at hz linarith theorem complexDigamma_continuousOn_positiveHalfPlane : ContinuousOn Complex.digamma {z : ℂ | 0 < z.re} := by let s : Set ℂ := {z : ℂ | 0 < z.re} have hopen : IsOpen s := by exact Complex.continuous_re.isOpen_preimage _ isOpen_Ioi have hgamma : DifferentiableOn ℂ Complex.Gamma s := complexGamma_differentiableOn_positiveHalfPlane have hderiv : ContinuousOn (deriv Complex.Gamma) s := (hgamma.deriv hopen).continuousOn have hcont : ContinuousOn Complex.Gamma s := hgamma.continuousOn have hratio : ContinuousOn (fun z : ℂ => deriv Complex.Gamma z / Complex.Gamma z) s := hderiv.div hcont (fun z hz => Complex.Gamma_ne_zero_of_re_pos hz) simpa [s, Complex.digamma_def, logDeriv_apply] using! hratio theorem saddleDigamma_continuousOn_Ioi : ContinuousOn saddleDigamma (Ioi (0 : ℝ)) := by have hmap : MapsTo (fun x : ℝ => (x : ℂ)) (Ioi (0 : ℝ)) {z : ℂ | 0 < z.re} := by intro x hx simpa using! hx have hcomplex := complexDigamma_continuousOn_positiveHalfPlane.comp Complex.continuous_ofReal.continuousOn hmap have hre : ContinuousOn (fun x : ℝ => (Complex.digamma (x : ℂ)).re) (Ioi (0 : ℝ)) := Complex.continuous_re.continuousOn.comp hcomplex (fun x hx => Set.mem_univ _) apply hre.congr intro x hx exact saddleDigamma_eq_complexDigamma_re hx theorem tendsto_saddleDigamma_atTop : Tendsto saddleDigamma atTop atTop := by have h := Real.tendsto_log_atTop.atTop_add tendsto_saddleDigamma_sub_log convert! h using 1 funext x ring theorem saddleSinhShellInterval_hasDerivAt (w : ℝ → ℝ) (hw : Continuous w) {a b : ℝ} (hab : a ≤ b) (u : ℝ) : HasDerivAt (fun v : ℝ => ∫ x in a..b, w x * x * Real.sinh (x * v)) (∫ x in a..b, w x * x ^ 2 * Real.cosh (x * u)) u := by let F : ℝ → ℝ → ℝ := fun v x => w x * x * Real.sinh (x * v) let F' : ℝ → ℝ → ℝ := fun v x => w x * x ^ 2 * Real.cosh (x * v) have hF (v : ℝ) : Continuous (F v) := by try dsimp [F] exact (hw.mul continuous_id).mul (Real.continuous_sinh.comp (continuous_id.mul continuous_const)) have hF' (v : ℝ) : Continuous (F' v) := by try dsimp [F'] exact (hw.mul (continuous_id.pow 2)).mul (Real.continuous_cosh.comp (continuous_id.mul continuous_const)) have hF'joint : Continuous (Function.uncurry F') := by try dsimp [F', Function.uncurry] exact ((hw.comp continuous_snd).mul (continuous_snd.pow 2)).mul (Real.continuous_cosh.comp (continuous_snd.mul continuous_fst)) have hderiv (x v : ℝ) : HasDerivAt (fun z : ℝ => F z x) (F' v x) v := by have hlinear : HasDerivAt (fun z : ℝ => x * z) x v := by simpa using! (hasDerivAt_id v).const_mul x have hsinh := (Real.hasDerivAt_sinh (x * v)).comp v hlinear simpa [F, F', pow_two, mul_assoc, mul_left_comm, mul_comm] using! hsinh.const_mul (w x * x) have hrewrite : (fun v : ℝ => ∫ x in a..b, w x * x * Real.sinh (x * v)) = (fun v : ℝ => ∫ x in Set.Icc a b, F v x) := by funext v rw [intervalIntegral.integral_of_le hab, ← integral_Icc_eq_integral_Ioc] have hderivrewrite : (∫ x in a..b, w x * x ^ 2 * Real.cosh (x * u)) = (∫ x in Set.Icc a b, F' u x) := by rw [intervalIntegral.integral_of_le hab, ← integral_Icc_eq_integral_Ioc] rw [hrewrite, hderivrewrite] have hcompact : IsCompact (Metric.closedBall u 1 ×ˢ Set.Icc a b) := (isCompact_closedBall u 1).prod isCompact_Icc obtain ⟨C, hC⟩ := hcompact.bddAbove_image hF'joint.norm.continuousOn have hbound : ∀ᵐ x ∂volume.restrict (Set.Icc a b), ∀ v ∈ Metric.ball u 1, ‖F' v x‖ ≤ C := by filter_upwards [ae_restrict_mem measurableSet_Icc] with x hx intro v hv have hpair : (v, x) ∈ Metric.closedBall u 1 ×ˢ Set.Icc a b := ⟨Metric.ball_subset_closedBall hv, hx⟩ exact hC (Set.mem_image_of_mem (fun p : ℝ × ℝ => ‖F' p.1 p.2‖) hpair) have hmeas : ∀ᶠ v in 𝓝 u, AEStronglyMeasurable (F v) (volume.restrict (Set.Icc a b)) := Eventually.of_forall (fun v => (hF v).aestronglyMeasurable) have hint : Integrable (F u) (volume.restrict (Set.Icc a b)) := (hF u).integrableOn_Icc have hderivmeas : AEStronglyMeasurable (F' u) (volume.restrict (Set.Icc a b)) := (hF' u).aestronglyMeasurable have hconstant : Integrable (fun _ : ℝ => C) (volume.restrict (Set.Icc a b)) := integrableOn_const isCompact_Icc.measure_ne_top have hdifferentiable : ∀ᵐ x ∂volume.restrict (Set.Icc a b), ∀ v ∈ Metric.ball u 1, HasDerivAt (fun z : ℝ => F z x) (F' v x) v := Eventually.of_forall (fun x v _ => hderiv x v) exact (hasDerivAt_integral_of_dominated_loc_of_deriv_le (μ := volume.restrict (Set.Icc a b)) (s := Metric.ball u 1) (bound := fun _ : ℝ => C) (Metric.ball_mem_nhds u zero_lt_one) hmeas hint hderivmeas hbound hconstant hdifferentiable).2 theorem saddleSourceShellDerivative_hasDerivAt {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) (u : ℝ) : HasDerivAt (saddleSourceShellDerivative ε) (upperNetShellVariance ε (u - 1)) u := by have hcutoff : 0 < shortCutoff ε := by unfold shortCutoff positivity let w : ℝ → ℝ := fun a => shortShellDensity ε (max a (shortCutoff ε)) have hmax (a : ℝ) : 0 < max a (shortCutoff ε) := hcutoff.trans_le (le_max_right _ _) have hw : Continuous w := by have hn : Continuous (fun a : ℝ => shortMargin ε (max a (shortCutoff ε)) * Real.exp (-2 * max a (shortCutoff ε))) := by unfold shortMargin fun_prop have hd : Continuous (fun a : ℝ => 2 * (max a (shortCutoff ε)) ^ 2 * Real.cosh (max a (shortCutoff ε))) := by fun_prop try dsimp [w] unfold shortShellDensity exact (hn.div hd (fun a => by positivity [hmax a])).neg have hshort : HasDerivAt (fun v : ℝ => ∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * a * Real.sinh (v * a)) (∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * a ^ 2 * Real.cosh (u * a)) u := by have h := saddleSinhShellInterval_hasDerivAt w hw horder u convert! h using 1 · funext v apply intervalIntegral.integral_congr intro a ha rw [uIcc_of_le horder] at ha try dsimp [w] rw [max_eq_left ha.1] congr 2 ring · apply intervalIntegral.integral_congr intro a ha rw [uIcc_of_le horder] at ha try dsimp [w] rw [max_eq_left ha.1] congr 2 ring have hremote : shellLocation ε ≤ shellLocation ε + 1 := by linarith have hpositive : HasDerivAt (fun v : ℝ => ∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * a * Real.sinh (v * a)) (∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * a ^ 2 * Real.cosh (u * a)) u := by have h := saddleSinhShellInterval_hasDerivAt (positiveShellDensity ε) (positiveShellDensity_continuous ε) hremote u convert! h using 1 · funext v apply intervalIntegral.integral_congr intro a ha ring_nf · apply intervalIntegral.integral_congr intro a ha ring_nf have hshortvariance : (∫ a in shortCutoff ε..shortEndpoint ε, shortShellDensity ε a * a ^ 2 * Real.cosh (u * a)) = -upperShortShellVariance ε (u - 1) := by unfold upperShortShellVariance rw [← intervalIntegral.integral_neg] apply intervalIntegral.integral_congr intro a ha ring_nf have hpositivevariance : (∫ a in shellLocation ε..shellLocation ε + 1, positiveShellDensity ε a * a ^ 2 * Real.cosh (u * a)) = upperPositiveShellVariance ε (u - 1) := by unfold upperPositiveShellVariance apply intervalIntegral.integral_congr intro a ha ring_nf have hsum := hshort.add hpositive unfold saddleSourceShellDerivative convert! hsum using 1 rw [hshortvariance, hpositivevariance] unfold upperNetShellVariance ring theorem eventually_saddleSourceShellDerivative_monotone_secondBranch : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), MonotoneOn (saddleSourceShellDerivative ε) (Ici (1 + ε / 2)) := by filter_upwards [self_mem_nhdsWithin, eventually_upper_shortCutoff_le_shortEndpoint, eventually_upper_netShellVariance_bounds] with ε hε horder hnet change 0 < ε at hε have hcont : ContinuousOn (saddleSourceShellDerivative ε) (Ici (1 + ε / 2)) := (saddleSourceShellDerivative_contDiff_one hε horder).continuous.continuousOn apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Ici (1 + ε / 2)) hcont · intro u hu exact (saddleSourceShellDerivative_hasDerivAt hε horder u).hasDerivWithinAt · intro u hu have hthreshold : 1 + ε / 2 ≤ u := by have hmem : u ∈ Ici (1 + ε / 2) := interior_subset hu exact hmem have hδ : ε / 2 ≤ u - 1 := by linarith have hδnonneg : 0 ≤ u - 1 := by linarith have hvariance := (upperPositiveShellVariance_bounds hε hδnonneg).1 have hpositive : 0 ≤ upperPositiveShellVariance ε (u - 1) := by exact (show 0 ≤ (1 / 2 : ℝ) * shellLocation ε ^ 2 * shellWeight ε * Real.exp ((u - 1) * shellLocation ε) by positivity [shellWeight_pos ε]).trans hvariance have hnetlower := (hnet (u - 1) hδ).1 nlinarith theorem saddleLogRadius_continuousOn_Ici {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) {d : ℕ} (hd : 0 < d) {u₀ : ℝ} (hu₀ : -1 < u₀) : ContinuousOn (saddleLogRadius ε d) (Ici u₀) := by let g : ℝ → ℝ := fun u => ((d : ℝ) / 2) * (1 + u) / 2 have hdreal : 0 < (d : ℝ) := by exact_mod_cast hd have hg : Continuous g := by try dsimp [g] fun_prop have hmap : MapsTo g (Ici u₀) (Ioi (0 : ℝ)) := by intro u hu try dsimp [g] have hu' : u₀ ≤ u := hu have hupositive : 0 < 1 + u := by linarith change 0 < ((d : ℝ) / 2) * (1 + u) / 2 positivity have hdigamma : ContinuousOn (fun u => saddleDigamma (g u)) (Ici u₀) := saddleDigamma_continuousOn_Ioi.comp hg.continuousOn hmap have hshell : ContinuousOn (saddleSourceShellDerivative ε) (Ici u₀) := (saddleSourceShellDerivative_contDiff_one hε horder).continuous.continuousOn have hsum : ContinuousOn (fun u : ℝ => -(Real.log Real.pi) / 2 + saddleDigamma (g u) / 2 + saddleSourceShellDerivative ε u) (Ici u₀) := (continuousOn_const.add (hdigamma.div_const 2)).add hshell apply hsum.congr intro u hu simpa [g] using! saddleLogRadius_eq_digamma_add_shellDerivative ε d u theorem tendsto_saddleGammaArgument_atTop {d : ℕ} (hd : 0 < d) : Tendsto (fun u : ℝ => ((d : ℝ) / 2) * (1 + u) / 2) atTop atTop := by have hdreal : 0 < (d : ℝ) := by exact_mod_cast hd have hslope : 0 < (d : ℝ) / 4 := by positivity have hlinear := tendsto_id.const_mul_atTop hslope have h := hlinear.atTop_add (tendsto_const_nhds (x := (d : ℝ) / 4)) convert! h using 1 funext u simp only [id_eq] ring theorem tendsto_saddleLogRadius_atTop_of_shell_monotone {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) {d : ℕ} (hd : 0 < d) (hmono : MonotoneOn (saddleSourceShellDerivative ε) (Ici (1 + ε / 2))) : Tendsto (saddleLogRadius ε d) atTop atTop := by have _hε : 0 < ε := hε have _horder : shortCutoff ε ≤ shortEndpoint ε := horder let U : ℝ := 1 + ε / 2 let C : ℝ := saddleSourceShellDerivative ε U have hargument := tendsto_saddleDigamma_atTop.comp (tendsto_saddleGammaArgument_atTop hd) have hhalf := hargument.atTop_div_const (by norm_num : (0 : ℝ) < 2) have hbaseline := hhalf.atTop_add (tendsto_const_nhds (x := -(Real.log Real.pi) / 2 + C)) have hcomparison : (fun u : ℝ => saddleDigamma (((d : ℝ) / 2) * (1 + u) / 2) / 2 + (-(Real.log Real.pi) / 2 + C)) ≤ᶠ[atTop] saddleLogRadius ε d := by filter_upwards [eventually_ge_atTop U] with u hu have hshell : C ≤ saddleSourceShellDerivative ε u := by apply hmono · change 1 + ε / 2 ≤ U try dsimp [U] exact le_rfl · simpa [U] using! hu · exact hu rw [saddleLogRadius_eq_digamma_add_shellDerivative] try dsimp [C] linarith exact tendsto_atTop_mono' atTop hcomparison hbaseline theorem eventually_tendsto_saddleLogRadius_atTop : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ d : ℕ, 0 < d → Tendsto (saddleLogRadius ε d) atTop atTop := by filter_upwards [self_mem_nhdsWithin, eventually_upper_shortCutoff_le_shortEndpoint, eventually_saddleSourceShellDerivative_monotone_secondBranch] with ε hε horder hmono change 0 < ε at hε intro d hd exact tendsto_saddleLogRadius_atTop_of_shell_monotone hε horder hd hmono theorem saddleLogRadius_covers_Ici {ε : ℝ} (hε : 0 < ε) (horder : shortCutoff ε ≤ shortEndpoint ε) {d : ℕ} (hd : 0 < d) {u₀ : ℝ} (hu₀ : -1 < u₀) (htop : Tendsto (saddleLogRadius ε d) atTop atTop) {r : ℝ} (hr : Real.exp (saddleLogRadius ε d u₀) ≤ r) : ∃ u : ℝ, u₀ ≤ u ∧ saddleLogRadius ε d u = Real.log r := by have hrpositive : 0 < r := (Real.exp_pos _).trans_le hr have hlog : saddleLogRadius ε d u₀ ≤ Real.log r := by apply Real.exp_le_exp.mp rw [Real.exp_log hrpositive] exact hr have hfilter : (atTop : Filter ℝ) ≤ 𝓟 (Ici u₀) := Filter.le_principal_iff.mpr (eventually_ge_atTop u₀) have himage : Ici (saddleLogRadius ε d u₀) ⊆ saddleLogRadius ε d '' Ici u₀ := (isPreconnected_Ici : IsPreconnected (Ici u₀)).intermediate_value_Ici (show u₀ ∈ Ici u₀ from Set.mem_Ici.mpr (le_refl u₀)) hfilter (saddleLogRadius_continuousOn_Ici hε horder hd hu₀) htop obtain ⟨u, hu, heq⟩ := himage hlog exact ⟨u, hu, heq⟩ theorem eventually_saddleLogRadius_covers_Ici : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ d : ℕ, 0 < d → ∀ u₀ : ℝ, -1 < u₀ → ∀ r : ℝ, Real.exp (saddleLogRadius ε d u₀) ≤ r → ∃ u : ℝ, u₀ ≤ u ∧ saddleLogRadius ε d u = Real.log r := by filter_upwards [self_mem_nhdsWithin, eventually_upper_shortCutoff_le_shortEndpoint, eventually_tendsto_saddleLogRadius_atTop] with ε hε horder htop change 0 < ε at hε intro d hd u₀ hu₀ r hr exact saddleLogRadius_covers_Ici hε horder hd hu₀ (htop d hd) hr theorem eventually_saddleSmallRadiusStarOrdinate_gt_neg_one (ε : ℝ) : ∀ᶠ d : ℕ in atTop, -1 < saddleSmallRadiusStarOrdinate ε d := by filter_upwards [eventually_ge_atTop (3 : ℕ)] with d hd have hdreal : (3 : ℝ) ≤ (d : ℝ) := by exact_mod_cast hd have hdimension : 1 < (d : ℝ) / 2 := by linarith have hlog : 0 < Real.log ((d : ℝ) / 2) := Real.log_pos hdimension have hdenominator : 0 < 4 * ((d : ℝ) / 2) := by positivity have hratio : 0 < Real.log ((d : ℝ) / 2) / (4 * ((d : ℝ) / 2)) := div_pos hlog hdenominator unfold saddleSmallRadiusStarOrdinate linarith theorem eventually_saddleSmallRadiusStar_log_coverage : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ᶠ d : ℕ in atTop, ∀ r : ℝ, saddleSmallRadiusStar ε d ≤ r → ∃ u : ℝ, saddleSmallRadiusStarOrdinate ε d ≤ u ∧ saddleLogRadius ε d u = Real.log r := by filter_upwards [eventually_saddleLogRadius_covers_Ici] with ε hcoverage filter_upwards [eventually_saddleSmallRadiusStarOrdinate_gt_neg_one ε, eventually_gt_atTop (0 : ℕ)] with d hstar hd intro r hr apply hcoverage d hd (saddleSmallRadiusStarOrdinate ε d) hstar r exact hr theorem eventually_saddleSourceRadius_log_coverage : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ d : ℕ, 0 < d → ∀ r : ℝ, saddleSourceRadius ε d ≤ r → ∃ u : ℝ, 1 + ε / 4 ≤ u ∧ saddleLogRadius ε d u = Real.log r := by filter_upwards [self_mem_nhdsWithin, eventually_saddleLogRadius_covers_Ici] with ε hε hcoverage change 0 < ε at hε intro d hd r hr have hu₀ : -1 < 1 + ε / 4 := by linarith apply hcoverage d hd (1 + ε / 4) hu₀ r exact hr end noncomputable section open Filter open scoped Topology def EventualLowerBound : Prop := ∀ c : ℝ, c < criticalRadius → ∀ᶠ d : ℕ in atTop, c ≤ normalizedProgram d def EventualUpperBound : Prop := ∀ c : ℝ, criticalRadius < c → ∀ᶠ d : ℕ in atTop, normalizedProgram d ≤ c def UniformAdmissibleLowerBound : Prop := ∀ c : ℝ, c < criticalRadius → ∀ᶠ d : ℕ in atTop, ∀ f : Admissible d, c ≤ normalizedCost f def ConstructivePrimalUpperBound : Prop := ∀ c : ℝ, criticalRadius < c → ∀ᶠ d : ℕ in atTop, ∃ f : Admissible d, normalizedCost f ≤ c theorem normalizedProgram_le_normalizedCost {d : ℕ} (f : Admissible d) : normalizedProgram d ≤ normalizedCost f := by unfold normalizedProgram exact csInf_le (normalizedCostSet_bddBelow d) ⟨f, rfl⟩ theorem eventualUpperBound_of_constructivePrimal (hupper : ConstructivePrimalUpperBound) : EventualUpperBound := by intro c hc filter_upwards [hupper c hc] with d ⟨f, hf⟩ exact (normalizedProgram_le_normalizedCost f).trans hf theorem eventualLowerBound_of_uniform_and_constructive (hlower : UniformAdmissibleLowerBound) (hupper : ConstructivePrimalUpperBound) : EventualLowerBound := by intro c hc have haux : criticalRadius < criticalRadius + 1 := by linarith filter_upwards [hlower c hc, hupper (criticalRadius + 1) haux] with d hcost ⟨f, _⟩ unfold normalizedProgram refine le_csInf ⟨normalizedCost f, f, rfl⟩ ?_ rintro _ ⟨g, rfl⟩ exact hcost g theorem sharpQuotient_of_eventual_bounds (hlower : EventualLowerBound) (hupper : EventualUpperBound) : SharpQuotientAsymptotic := by unfold SharpQuotientAsymptotic refine tendsto_order.2 ⟨?_, ?_⟩ · intro a ha have hmid : (a + criticalRadius) / 2 < criticalRadius := by linarith filter_upwards [hlower _ hmid] with d hd linarith · intro b hb have hmid : criticalRadius < (criticalRadius + b) / 2 := by linarith filter_upwards [hupper _ hmid] with d hd linarith theorem sharpQuotient_of_uniform_lower_and_constructive_upper (hlower : UniformAdmissibleLowerBound) (hupper : ConstructivePrimalUpperBound) : SharpQuotientAsymptotic := by exact sharpQuotient_of_eventual_bounds (eventualLowerBound_of_uniform_and_constructive hlower hupper) (eventualUpperBound_of_constructivePrimal hupper) structure OrderedEpsilonUpperConstruction where epsilonBound : ℝ epsilonBound_pos : 0 < epsilonBound normalizedRadius : ℝ → ℕ → ℝ limitingRadius : ℝ → ℝ limitingRadius_tendsto : Tendsto limitingRadius (𝓝[>] (0 : ℝ)) (𝓝 criticalRadius) normalizedRadius_tendsto : ∀ ε : ℝ, 0 < ε → ε < epsilonBound → Tendsto (normalizedRadius ε) atTop (𝓝 (limitingRadius ε)) admissibleWitness : ∀ ε : ℝ, 0 < ε → ε < epsilonBound → ∀ᶠ d : ℕ in atTop, ∃ f : Admissible d, normalizedCost f ≤ normalizedRadius ε d theorem constructivePrimal_of_orderedEpsilon (construction : OrderedEpsilonUpperConstruction) : ConstructivePrimalUpperBound := by intro c hc have hclose : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), construction.limitingRadius ε < c := (tendsto_order.1 construction.limitingRadius_tendsto).2 c hc have hpositive : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), 0 < ε := self_mem_nhdsWithin have hsmall : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ε < construction.epsilonBound := by exact (tendsto_id.mono_left nhdsWithin_le_nhds).eventually (gt_mem_nhds construction.epsilonBound_pos) obtain ⟨ε, hεclose, hεpositive, hεsmall⟩ := (hclose.and (hpositive.and hsmall)).exists have hradius : ∀ᶠ d : ℕ in atTop, construction.normalizedRadius ε d < c := (tendsto_order.1 (construction.normalizedRadius_tendsto ε hεpositive hεsmall)).2 c hεclose filter_upwards [construction.admissibleWitness ε hεpositive hεsmall, hradius] with d ⟨f, hf⟩ hr exact ⟨f, hf.trans hr.le⟩ theorem sharpQuotient_of_uniform_lower_and_ordered_upper (hlower : UniformAdmissibleLowerBound) (construction : OrderedEpsilonUpperConstruction) : SharpQuotientAsymptotic := by exact sharpQuotient_of_uniform_lower_and_constructive_upper hlower (constructivePrimal_of_orderedEpsilon construction) end noncomputable section open Filter MeasureTheory Set open scoped FourierTransform SchwartzMap Topology def SaddleSourceSchwartzRealization : Prop := ∀ ε : ℝ, 0 < ε → shortCutoff ε ≤ shortEndpoint ε → ∀ d : ℕ, 0 < d → ∃ fminus fplus : TestFunction d, (∀ x : Euclidean d, fminus x = minusSaddleFunction ε d x) ∧ (∀ x : Euclidean d, fplus x = plusSaddleFunction ε d x) def SaddleSourceEventualSigns : Prop := ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ᶠ d : ℕ in atTop, (∀ x : Euclidean d, 0 ≤ (plusSaddleFunction ε d x).re) ∧ (∀ x : Euclidean d, saddleSourceRadius ε d ≤ ‖x‖ → (minusSaddleFunction ε d x).re ≤ 0) noncomputable def saddleOrderedUpperConstruction (hschwartz : SaddleSourceSchwartzRealization) (hsigns : SaddleSourceEventualSigns) : OrderedEpsilonUpperConstruction := by have heventually : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), shortCutoff ε ≤ shortEndpoint ε ∧ (∀ᶠ d : ℕ in atTop, (∀ x : Euclidean d, 0 ≤ (plusSaddleFunction ε d x).re) ∧ (∀ x : Euclidean d, saddleSourceRadius ε d ≤ ‖x‖ → (minusSaddleFunction ε d x).re ≤ 0)) := eventually_upper_shortCutoff_le_shortEndpoint.and hsigns have hmembership : {ε : ℝ | shortCutoff ε ≤ shortEndpoint ε ∧ (∀ᶠ d : ℕ in atTop, (∀ x : Euclidean d, 0 ≤ (plusSaddleFunction ε d x).re) ∧ (∀ x : Euclidean d, saddleSourceRadius ε d ≤ ‖x‖ → (minusSaddleFunction ε d x).re ≤ 0))} ∈ 𝓝[>] (0 : ℝ) := heventually have hexists := mem_nhdsGT_iff_exists_Ioo_subset.mp hmembership let ε₀ : ℝ := Classical.choose hexists have hchosen := Classical.choose_spec hexists have hε₀ : 0 < ε₀ := hchosen.1 have hinterval := hchosen.2 refine { epsilonBound := ε₀ epsilonBound_pos := hε₀ normalizedRadius := fun ε d => saddleSourceRadius ε d / Real.sqrt (d : ℝ) limitingRadius := limitingSaddleRadius limitingRadius_tendsto := tendsto_limitingSaddleRadius normalizedRadius_tendsto := ?_ admissibleWitness := ?_ } · intro ε hε _hsmall exact tendsto_saddleSourceRadius_normalized hε · intro ε hε hsmall have hproperties := hinterval (show ε ∈ Ioo (0 : ℝ) ε₀ from ⟨hε, hsmall⟩) obtain ⟨horder, hsignε⟩ := hproperties filter_upwards [hsignε, eventually_gt_atTop (0 : ℕ)] with d hsign hd obtain ⟨fminus, fplus, hminus, hplus⟩ := hschwartz ε hε horder d hd let f : Admissible d := saddleSourceAdmissible hε hd horder (saddleSourceRadius_pos ε d) fminus fplus hminus hplus hsign.1 hsign.2 refine ⟨f, ?_⟩ exact le_of_eq (saddleSourceAdmissible_normalizedCost hε hd horder (saddleSourceRadius_pos ε d) fminus fplus hminus hplus hsign.1 hsign.2) end noncomputable section open Asymptotics Filter Function MeasureTheory Metric Set open scoped FourierTransform SchwartzMap Topology def lowerGammaBoundaryCapped (ℓ R D y : ℝ) : ℝ := if y = 0 then D else min (lowerGammaBoundaryLog ℓ R y) D theorem lowerGammaBoundaryLog_pole_decomposition (ℓ R : ℝ) {y : ℝ} (hy : y ≠ 0) : lowerGammaBoundaryLog ℓ R y = ℓ * Real.log (Real.pi * R ^ 2) + Real.log ‖Complex.Gamma (1 - Complex.I * (y : ℂ) / 2)‖ - Real.log ‖Complex.Gamma ((ℓ : ℂ) + Complex.I * (y : ℂ) / 2)‖ - Real.log (|y| / 2) := by let s : ℂ := -Complex.I * (y : ℂ) / 2 have hs : s ≠ 0 := by intro h have him := congrArg Complex.im h try dsimp [s] at him norm_num at him exact hy (by linarith) have hgammas : Complex.Gamma s ≠ 0 := by apply Complex.Gamma_ne_zero intro m hm have him := congrArg Complex.im hm try dsimp [s] at him norm_num at him exact hy (by linarith) have hnorm : ‖Complex.Gamma (s + 1)‖ = ‖s‖ * ‖Complex.Gamma s‖ := by rw [Complex.Gamma_add_one s hs, norm_mul] have hs_norm : ‖s‖ = |y| / 2 := by simp [s, Complex.norm_real, Real.norm_eq_abs] have hlog : Real.log ‖Complex.Gamma s‖ = Real.log ‖Complex.Gamma (s + 1)‖ - Real.log (|y| / 2) := by rw [hnorm, Real.log_mul (norm_ne_zero_iff.mpr hs) (norm_ne_zero_iff.mpr hgammas), hs_norm] ring have harg : s + 1 = 1 - Complex.I * (y : ℂ) / 2 := by try dsimp [s] ring unfold lowerGammaBoundaryLog change ℓ * Real.log (Real.pi * R ^ 2) + Real.log ‖Complex.Gamma s‖ - Real.log ‖Complex.Gamma ((ℓ : ℂ) + Complex.I * (y : ℂ) / 2)‖ = _ rw [hlog, harg] ring theorem lowerGammaBoundaryLog_tendsto_atTop_zero {ℓ : ℝ} (hℓ : 0 < ℓ) (R : ℝ) : Tendsto (lowerGammaBoundaryLog ℓ R) (𝓝[≠] (0 : ℝ)) atTop := by have hlogbot : Tendsto (fun y : ℝ => Real.log (|y| / 2)) (𝓝[≠] (0 : ℝ)) atBot := by have hshift := Real.tendsto_log_nhdsNE_zero.atBot_add (tendsto_const_nhds (x := -(Real.log (2 : ℝ)))) apply hshift.congr' filter_upwards [self_mem_nhdsWithin] with y hy have hyzero : y ≠ 0 := by simpa using! hy rw [Real.log_div (abs_ne_zero.mpr hyzero) (by norm_num), Real.log_abs] ring have hnumPole : ∀ m : ℕ, (1 : ℂ) ≠ -(m : ℂ) := by intro m hm have hre := congrArg Complex.re hm norm_num at hre have hmnonneg : 0 ≤ (m : ℝ) := Nat.cast_nonneg m linarith have hdenPole : ∀ m : ℕ, (ℓ : ℂ) ≠ -(m : ℂ) := by intro m hm have hre := congrArg Complex.re hm norm_num at hre have hmnonneg : 0 ≤ (m : ℝ) := Nat.cast_nonneg m linarith have hnumGamma : ContinuousAt (fun y : ℝ => Complex.Gamma (1 - Complex.I * (y : ℂ) / 2)) 0 := by apply (Complex.continuousAt_Gamma (1 : ℂ) hnumPole).comp_of_eq · fun_prop · norm_num have hdenGamma : ContinuousAt (fun y : ℝ => Complex.Gamma ((ℓ : ℂ) + Complex.I * (y : ℂ) / 2)) 0 := by apply (Complex.continuousAt_Gamma (ℓ : ℂ) hdenPole).comp_of_eq · fun_prop · norm_num have hnumLog : ContinuousAt (fun y : ℝ => Real.log ‖Complex.Gamma (1 - Complex.I * (y : ℂ) / 2)‖) 0 := by apply hnumGamma.norm.log simp have hdenLog : ContinuousAt (fun y : ℝ => Real.log ‖Complex.Gamma ((ℓ : ℂ) + Complex.I * (y : ℂ) / 2)‖) 0 := by apply hdenGamma.norm.log simpa using! norm_ne_zero_iff.mpr (Complex.Gamma_ne_zero hdenPole) have hregular : ContinuousAt (fun y : ℝ => ℓ * Real.log (Real.pi * R ^ 2) + Real.log ‖Complex.Gamma (1 - Complex.I * (y : ℂ) / 2)‖ - Real.log ‖Complex.Gamma ((ℓ : ℂ) + Complex.I * (y : ℂ) / 2)‖) 0 := (continuousAt_const.add hnumLog).sub hdenLog have hreglimit : Tendsto (fun y : ℝ => ℓ * Real.log (Real.pi * R ^ 2) + Real.log ‖Complex.Gamma (1 - Complex.I * (y : ℂ) / 2)‖ - Real.log ‖Complex.Gamma ((ℓ : ℂ) + Complex.I * (y : ℂ) / 2)‖) (𝓝[≠] (0 : ℝ)) (𝓝 (ℓ * Real.log (Real.pi * R ^ 2) + Real.log ‖Complex.Gamma (1 : ℂ)‖ - Real.log ‖Complex.Gamma (ℓ : ℂ)‖)) := by convert! hregular.tendsto.mono_left (nhdsWithin_le_nhds (s := {(0 : ℝ)}ᶜ)) using 1; norm_num have hnegative : Tendsto (fun y : ℝ => -Real.log (|y| / 2)) (𝓝[≠] (0 : ℝ)) atTop := tendsto_neg_atTop_iff.mpr hlogbot have hsum := hnegative.atTop_add hreglimit apply hsum.congr' filter_upwards [self_mem_nhdsWithin] with y hy have hyzero : y ≠ 0 := by simpa using! hy rw [lowerGammaBoundaryLog_pole_decomposition ℓ R hyzero] ring theorem lowerGammaBoundaryCapped_continuous {ℓ : ℝ} (hℓ : 0 < ℓ) (R D : ℝ) : Continuous (lowerGammaBoundaryCapped ℓ R D) := by rw [continuous_iff_continuousAt] intro y by_cases hy : y = 0 · subst y have htail : ∀ᶠ x : ℝ in 𝓝[≠] (0 : ℝ), D ≤ lowerGammaBoundaryLog ℓ R x := (lowerGammaBoundaryLog_tendsto_atTop_zero hℓ R).eventually_ge_atTop D have hnear : ∀ᶠ x : ℝ in 𝓝 (0 : ℝ), x ≠ 0 → D ≤ lowerGammaBoundaryLog ℓ R x := by have h := (eventually_nhdsWithin_iff.mp htail) filter_upwards [h] with x hx intro hxzero apply hx simpa using! hxzero have hconstant : ContinuousAt (fun _ : ℝ => D) (0 : ℝ) := continuousAt_const apply hconstant.congr_of_eventuallyEq filter_upwards [hnear] with x hx unfold lowerGammaBoundaryCapped split_ifs with hzero · rfl · exact min_eq_right (hx hzero) · have hopen : IsOpen ({(0 : ℝ)}ᶜ) := isClosed_singleton.isOpen_compl have hmem : y ∈ ({(0 : ℝ)}ᶜ : Set ℝ) := by simpa using! hy have hregular : ContinuousAt (lowerGammaBoundaryLog ℓ R) y := by apply (lowerGammaBoundaryLog_continuousOn hℓ R (S := {(0 : ℝ)}ᶜ) (by intro x hx simpa using! hx)).continuousAt exact hopen.mem_nhds hmem have hmin : ContinuousAt (fun x : ℝ => min (lowerGammaBoundaryLog ℓ R x) D) y := hregular.min continuousAt_const apply hmin.congr_of_eventuallyEq filter_upwards [eventually_ne_nhds hy] with x hx simp [lowerGammaBoundaryCapped, hx] theorem lowerGammaBoundaryCapped_exp_integrable_of_exp_integrable {ℓ a : ℝ} (hℓ : 0 < ℓ) (ha : 0 < a) (R D : ℝ) (hgamma : Integrable (fun y : ℝ => Real.exp ((-a) * |y|) * lowerGammaBoundaryLog ℓ R y)) : Integrable (fun y : ℝ => Real.exp ((-a) * |y|) * lowerGammaBoundaryCapped ℓ R D y) := by have hgammaabs : Integrable (fun y : ℝ => Real.exp ((-a) * |y|) * |lowerGammaBoundaryLog ℓ R y|) := by simpa [Real.norm_eq_abs, abs_mul, abs_of_pos (Real.exp_pos _)] using! hgamma.norm have hbase := strip_exp_abs_integrable ha have hmajor : Integrable (fun y : ℝ => Real.exp ((-a) * |y|) * |lowerGammaBoundaryLog ℓ R y| + |D| * Real.exp ((-a) * |y|)) := hgammaabs.add (hbase.const_mul |D|) have hweight : Continuous (fun y : ℝ => Real.exp ((-a) * |y|)) := by fun_prop apply hmajor.mono' ((hweight.mul (lowerGammaBoundaryCapped_continuous hℓ R D)).aestronglyMeasurable) filter_upwards [Measure.ae_ne (volume : Measure ℝ) 0] with y hy have hcap : |lowerGammaBoundaryCapped ℓ R D y| ≤ |lowerGammaBoundaryLog ℓ R y| + |D| := by unfold lowerGammaBoundaryCapped rw [if_neg hy] rcases le_total (lowerGammaBoundaryLog ℓ R y) D with hleft | hright · rw [min_eq_left hleft] exact le_add_of_nonneg_right (abs_nonneg D) · rw [min_eq_right hright] exact le_add_of_nonneg_left (abs_nonneg (lowerGammaBoundaryLog ℓ R y)) change |Real.exp ((-a) * |y|) * lowerGammaBoundaryCapped ℓ R D y| ≤ _ rw [abs_mul, abs_of_pos (Real.exp_pos _)] calc Real.exp ((-a) * |y|) * |lowerGammaBoundaryCapped ℓ R D y| ≤ Real.exp ((-a) * |y|) * (|lowerGammaBoundaryLog ℓ R y| + |D|) := mul_le_mul_of_nonneg_left hcap (Real.exp_pos _).le _ = Real.exp ((-a) * |y|) * |lowerGammaBoundaryLog ℓ R y| + |D| * Real.exp ((-a) * |y|) := by ring theorem stripRegularizedOuter_integrable_of_exp_integrable {ℓ : ℝ} (hℓ : 0 < ℓ) {z : ℂ} (hz : z ∈ Complex.im ⁻¹' Ioo (-ℓ) ℓ) (b : ℝ → ℝ) (hb : Continuous b) (hboundary : Integrable (fun y : ℝ => Real.exp (-(Real.pi / (2 * ℓ)) * |y|) * b y)) : Integrable (fun y : ℝ => stripRegularizedHolomorphicPoissonKernel ℓ z y * (b y : ℂ)) := by obtain ⟨hangle, hangle'⟩ := stripSchwarzAngle_mem_Ioo hℓ hz have hsin : 0 < Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ)) := Real.sin_pos_of_pos_of_lt_pi hangle hangle' let a : ℝ := Real.pi / (2 * ℓ) let D : ℝ := 2 * ℓ * Real.sin (Real.pi * (z.im + ℓ) / (2 * ℓ)) let Cpos : ℝ := Real.exp (a * z.re) / D let Cneg : ℝ := Real.exp (-a * z.re) / D have ha : 0 < a := by try dsimp [a] exact div_pos Real.pi_pos (mul_pos (by norm_num) hℓ) change Integrable (fun y : ℝ => Real.exp ((-a) * |y|) * b y) at hboundary have hboundaryabs : Integrable (fun y : ℝ => Real.exp ((-a) * |y|) * |b y|) := by simpa [Real.norm_eq_abs, abs_mul, abs_of_pos (Real.exp_pos _)] using! hboundary.norm have hposfactor (y : ℝ) : Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) / D = Cpos * Real.exp ((-a) * y) := by have hsplit : Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) = Real.exp (a * z.re) * Real.exp ((-a) * y) := by rw [← Real.exp_add] congr 1 try dsimp [a] ring rw [hsplit] try dsimp [Cpos] ring have hnegfactor (y : ℝ) : Real.exp (-(Real.pi * (z.re - y) / (2 * ℓ))) / D = Cneg * Real.exp (a * y) := by have hsplit : Real.exp (-(Real.pi * (z.re - y) / (2 * ℓ))) = Real.exp (-a * z.re) * Real.exp (a * y) := by rw [← Real.exp_add] congr 1 try dsimp [a] ring rw [hsplit] try dsimp [Cneg] ring have hboundaryRight : ContinuousOn b (Ioi (0 : ℝ)) := hb.continuousOn have hcastRight : ContinuousOn (fun y : ℝ => (b y : ℂ)) (Ioi (0 : ℝ)) := by simpa [Function.comp_def] using! Complex.continuous_ofReal.comp_continuousOn hboundaryRight have hcontinuousRight : ContinuousOn (fun y : ℝ => stripRegularizedHolomorphicPoissonKernel ℓ z y * (b y : ℂ)) (Ioi (0 : ℝ)) := (stripRegularizedHolomorphicPoissonKernel_continuousOn_Ioi hℓ hz).mul hcastRight have hrightmajorant : IntegrableOn (fun y : ℝ => Cpos * (Real.exp ((-a) * |y|) * |b y|)) (Ioi (0 : ℝ)) := hboundaryabs.integrableOn.const_mul Cpos have hright : IntegrableOn (fun y : ℝ => stripRegularizedHolomorphicPoissonKernel ℓ z y * (b y : ℂ)) (Ioi (0 : ℝ)) := by apply hrightmajorant.mono' (hcontinuousRight.aestronglyMeasurable measurableSet_Ioi) filter_upwards [ae_restrict_mem measurableSet_Ioi] with y hy change ‖stripRegularizedHolomorphicPoissonKernel ℓ z y * (b y : ℂ)‖ ≤ Cpos * (Real.exp ((-a) * |y|) * |b y|) rw [norm_mul, Complex.norm_real, Real.norm_eq_abs] have hbound := norm_stripRegularizedHolomorphicPoissonKernel_of_nonneg hℓ hz (mem_Ioi.mp hy).le change ‖stripRegularizedHolomorphicPoissonKernel ℓ z y‖ ≤ Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) / D at hbound calc ‖stripRegularizedHolomorphicPoissonKernel ℓ z y‖ * |b y| ≤ (Real.exp (Real.pi * (z.re - y) / (2 * ℓ)) / D) * |b y| := mul_le_mul_of_nonneg_right hbound (abs_nonneg _) _ = Cpos * (Real.exp ((-a) * |y|) * |b y|) := by rw [abs_of_pos (mem_Ioi.mp hy), hposfactor] ring have hboundaryLeft : ContinuousOn b (Iio (0 : ℝ)) := hb.continuousOn have hcastLeft : ContinuousOn (fun y : ℝ => (b y : ℂ)) (Iio (0 : ℝ)) := by simpa [Function.comp_def] using! Complex.continuous_ofReal.comp_continuousOn hboundaryLeft have hcontinuousLeft : ContinuousOn (fun y : ℝ => stripRegularizedHolomorphicPoissonKernel ℓ z y * (b y : ℂ)) (Iio (0 : ℝ)) := (stripRegularizedHolomorphicPoissonKernel_continuousOn_Iio hℓ hz).mul hcastLeft have hleftmajorant : IntegrableOn (fun y : ℝ => Cneg * (Real.exp ((-a) * |y|) * |b y|)) (Iio (0 : ℝ)) := hboundaryabs.integrableOn.const_mul Cneg have hleft : IntegrableOn (fun y : ℝ => stripRegularizedHolomorphicPoissonKernel ℓ z y * (b y : ℂ)) (Iio (0 : ℝ)) := by apply hleftmajorant.mono' (hcontinuousLeft.aestronglyMeasurable measurableSet_Iio) filter_upwards [ae_restrict_mem measurableSet_Iio] with y hy change ‖stripRegularizedHolomorphicPoissonKernel ℓ z y * (b y : ℂ)‖ ≤ Cneg * (Real.exp ((-a) * |y|) * |b y|) rw [norm_mul, Complex.norm_real, Real.norm_eq_abs] have hbound := norm_stripRegularizedHolomorphicPoissonKernel_of_neg hℓ hz (mem_Iio.mp hy) change ‖stripRegularizedHolomorphicPoissonKernel ℓ z y‖ ≤ Real.exp (-(Real.pi * (z.re - y) / (2 * ℓ))) / D at hbound calc ‖stripRegularizedHolomorphicPoissonKernel ℓ z y‖ * |b y| ≤ (Real.exp (-(Real.pi * (z.re - y) / (2 * ℓ))) / D) * |b y| := mul_le_mul_of_nonneg_right hbound (abs_nonneg _) _ = Cneg * (Real.exp ((-a) * |y|) * |b y|) := by rw [abs_of_neg (mem_Iio.mp hy), hnegfactor] simp [mul_neg, neg_mul] ring rw [← integrableOn_univ, ← @Iio_union_Ici _ _ (0 : ℝ), integrableOn_union, integrableOn_Ici_iff_integrableOn_Ioi] exact ⟨hleft, hright⟩ def stripRegularizedOuter (ℓ : ℝ) (b : ℝ → ℝ) (z : ℂ) : ℂ := ∫ y : ℝ, stripRegularizedHolomorphicPoissonKernel ℓ z y * (b y : ℂ) theorem stripRegularizedOuter_differentiableAt_of_exp_integrable {ℓ : ℝ} (hℓ : 0 < ℓ) {z : ℂ} (hz : z ∈ Complex.im ⁻¹' Ioo (-ℓ) ℓ) (b : ℝ → ℝ) (hb : Continuous b) (hboundary : Integrable (fun y : ℝ => Real.exp (-(Real.pi / (2 * ℓ)) * |y|) * b y)) : DifferentiableAt ℂ (stripRegularizedOuter ℓ b) z := by obtain ⟨S, hS, C, hC, hderivbound⟩ := stripRegularizedHolomorphicPoissonKernelDeriv_local_bound hℓ hz have hstrip : Complex.im ⁻¹' Ioo (-ℓ) ℓ ∈ 𝓝 z := by have him : Continuous (fun w : ℂ => w.im) := by fun_prop exact (isOpen_Ioo.preimage him).mem_nhds hz have hneighborhood : S ∩ (Complex.im ⁻¹' Ioo (-ℓ) ℓ) ∈ 𝓝 z := inter_mem hS hstrip have hboundaryabs : Integrable (fun y : ℝ => Real.exp (-(Real.pi / (2 * ℓ)) * |y|) * |b y|) := by simpa [Real.norm_eq_abs, abs_mul, abs_of_pos (Real.exp_pos _)] using! hboundary.norm have hboundintegrable : Integrable (fun y : ℝ => C * (Real.exp (-(Real.pi / (2 * ℓ)) * |y|) * |b y|)) := hboundaryabs.const_mul C have hFmeas : ∀ᶠ w : ℂ in 𝓝 z, AEStronglyMeasurable (fun y : ℝ => stripRegularizedHolomorphicPoissonKernel ℓ w y * (b y : ℂ)) := by filter_upwards [hstrip] with w hw exact (stripRegularizedOuter_integrable_of_exp_integrable hℓ hw b hb hboundary).aestronglyMeasurable have hFint : Integrable (fun y : ℝ => stripRegularizedHolomorphicPoissonKernel ℓ z y * (b y : ℂ)) := stripRegularizedOuter_integrable_of_exp_integrable hℓ hz b hb hboundary have hGmeas : AEStronglyMeasurable (fun y : ℝ => stripRegularizedHolomorphicPoissonKernelDeriv ℓ z y * (b y : ℂ)) := by have hreal := hb.measurable have hcast : Measurable (fun y : ℝ => (b y : ℂ)) := Complex.continuous_ofReal.measurable.comp hreal exact ((stripRegularizedHolomorphicPoissonKernelDeriv_continuous hℓ hz).measurable.mul hcast).aestronglyMeasurable have hdominated : ∀ᵐ y : ℝ, ∀ w ∈ S ∩ (Complex.im ⁻¹' Ioo (-ℓ) ℓ), ‖stripRegularizedHolomorphicPoissonKernelDeriv ℓ w y * (b y : ℂ)‖ ≤ C * (Real.exp (-(Real.pi / (2 * ℓ)) * |y|) * |b y|) := by filter_upwards [] with y intro w hw rw [norm_mul, Complex.norm_real, Real.norm_eq_abs] calc ‖stripRegularizedHolomorphicPoissonKernelDeriv ℓ w y‖ * |b y| ≤ (C * Real.exp (-(Real.pi / (2 * ℓ)) * |y|)) * |b y| := mul_le_mul_of_nonneg_right (hderivbound w hw.1 y) (abs_nonneg _) _ = C * (Real.exp (-(Real.pi / (2 * ℓ)) * |y|) * |b y|) := by ring have hdiff : ∀ᵐ y : ℝ, ∀ w ∈ S ∩ (Complex.im ⁻¹' Ioo (-ℓ) ℓ), HasDerivAt (fun v : ℂ => stripRegularizedHolomorphicPoissonKernel ℓ v y * (b y : ℂ)) (stripRegularizedHolomorphicPoissonKernelDeriv ℓ w y * (b y : ℂ)) w := by filter_upwards [] with y intro w hw exact (stripRegularizedHolomorphicPoissonKernel_hasDerivAt_deriv hℓ hw.2 y).mul_const (b y : ℂ) have hresult := hasDerivAt_integral_of_dominated_loc_of_deriv_le (F := fun w : ℂ => fun y : ℝ => stripRegularizedHolomorphicPoissonKernel ℓ w y * (b y : ℂ)) (F' := fun w : ℂ => fun y : ℝ => stripRegularizedHolomorphicPoissonKernelDeriv ℓ w y * (b y : ℂ)) (bound := fun y : ℝ => C * (Real.exp (-(Real.pi / (2 * ℓ)) * |y|) * |b y|)) hneighborhood hFmeas hFint hGmeas hdominated hboundintegrable hdiff unfold stripRegularizedOuter exact hresult.2.differentiableAt def lowerStripCappedGammaOuter (ℓ R D : ℝ) (z : ℂ) : ℂ := stripRegularizedOuter ℓ (lowerGammaBoundaryCapped ℓ R D) z theorem lowerGammaBoundaryCapped_exp_integrable_dimension {d : ℕ} (hd : 0 < d) {a : ℝ} (ha : 0 < a) (R D : ℝ) : Integrable (fun y : ℝ => Real.exp ((-a) * |y|) * lowerGammaBoundaryCapped ((d : ℝ) / 2) R D y) := by have hℓ : 0 < (d : ℝ) / 2 := half_pos (Nat.cast_pos.mpr hd) apply lowerGammaBoundaryCapped_exp_integrable_of_exp_integrable hℓ ha R D exact lowerGammaBoundaryLog_dimension_exp_integrable hd ha R theorem lowerStripCappedGammaOuter_integrable_dimension {d : ℕ} (hd : 0 < d) {R D : ℝ} {z : ℂ} (hz : z ∈ Complex.im ⁻¹' Ioo (-((d : ℝ) / 2)) ((d : ℝ) / 2)) : Integrable (fun y : ℝ => stripRegularizedHolomorphicPoissonKernel ((d : ℝ) / 2) z y * (lowerGammaBoundaryCapped ((d : ℝ) / 2) R D y : ℂ)) := by have hℓ : 0 < (d : ℝ) / 2 := half_pos (Nat.cast_pos.mpr hd) have ha : 0 < Real.pi / (2 * ((d : ℝ) / 2)) := div_pos Real.pi_pos (mul_pos (by norm_num) hℓ) apply stripRegularizedOuter_integrable_of_exp_integrable hℓ hz (lowerGammaBoundaryCapped ((d : ℝ) / 2) R D) (lowerGammaBoundaryCapped_continuous hℓ R D) exact lowerGammaBoundaryCapped_exp_integrable_dimension hd ha R D theorem lowerStripCappedGammaOuter_differentiableOn_dimension {d : ℕ} (hd : 0 < d) (R D : ℝ) : DifferentiableOn ℂ (lowerStripCappedGammaOuter ((d : ℝ) / 2) R D) (Complex.im ⁻¹' Ioo (-((d : ℝ) / 2)) ((d : ℝ) / 2)) := by have hℓ : 0 < (d : ℝ) / 2 := half_pos (Nat.cast_pos.mpr hd) have ha : 0 < Real.pi / (2 * ((d : ℝ) / 2)) := div_pos Real.pi_pos (mul_pos (by norm_num) hℓ) intro z hz unfold lowerStripCappedGammaOuter exact (stripRegularizedOuter_differentiableAt_of_exp_integrable hℓ hz (lowerGammaBoundaryCapped ((d : ℝ) / 2) R D) (lowerGammaBoundaryCapped_continuous hℓ R D) (lowerGammaBoundaryCapped_exp_integrable_dimension hd ha R D)).differentiableWithinAt theorem stripRegularizedOuter_re {ℓ σ : ℝ} (hℓ : 0 < ℓ) (hσbelow : -1 < σ) (hσabove : σ < 1) (s : ℝ) (b : ℝ → ℝ) (houter : Integrable (fun y : ℝ => stripRegularizedHolomorphicPoissonKernel ℓ ((s : ℂ) + Complex.I * ((σ * ℓ : ℝ) : ℂ)) y * (b y : ℂ))) : (stripRegularizedOuter ℓ b ((s : ℂ) + Complex.I * ((σ * ℓ : ℝ) : ℂ))).re = ∫ T : ℝ, stripPoissonKernel σ T * b (s - ℓ * T) := by unfold stripRegularizedOuter calc (∫ y : ℝ, stripRegularizedHolomorphicPoissonKernel ℓ ((s : ℂ) + Complex.I * ((σ * ℓ : ℝ) : ℂ)) y * (b y : ℂ)).re = ∫ y : ℝ, (stripRegularizedHolomorphicPoissonKernel ℓ ((s : ℂ) + Complex.I * ((σ * ℓ : ℝ) : ℂ)) y * (b y : ℂ)).re := by exact (integral_re houter).symm _ = ∫ y : ℝ, stripPoissonKernel σ ((s - y) / ℓ) / ℓ * b y := by apply integral_congr_ae refine Filter.Eventually.of_forall (fun y => ?_) change (stripRegularizedHolomorphicPoissonKernel ℓ ((s : ℂ) + Complex.I * ((σ * ℓ : ℝ) : ℂ)) y * (b y : ℂ)).re = stripPoissonKernel σ ((s - y) / ℓ) / ℓ * b y rw [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, mul_zero, sub_zero, stripRegularizedHolomorphicPoissonKernel_re hℓ hσbelow hσabove] _ = ∫ T : ℝ, stripPoissonKernel σ T * b (s - ℓ * T) := stripPoisson_integral_changeVariables hℓ σ s b theorem lowerStripCappedGammaOuter_re_dimension {d : ℕ} (hd : 0 < d) {σ R D : ℝ} (hσbelow : -1 < σ) (hσabove : σ < 1) (s : ℝ) : (lowerStripCappedGammaOuter ((d : ℝ) / 2) R D ((s : ℂ) + Complex.I * ((σ * ((d : ℝ) / 2) : ℝ) : ℂ))).re = ∫ T : ℝ, stripPoissonKernel σ T * lowerGammaBoundaryCapped ((d : ℝ) / 2) R D (s - ((d : ℝ) / 2) * T) := by have hℓ : 0 < (d : ℝ) / 2 := half_pos (Nat.cast_pos.mpr hd) have hz : ((s : ℂ) + Complex.I * ((σ * ((d : ℝ) / 2) : ℝ) : ℂ)) ∈ Complex.im ⁻¹' Ioo (-((d : ℝ) / 2)) ((d : ℝ) / 2) := by simp only [Set.mem_preimage, Set.mem_Ioo, Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.ofReal_re, zero_mul, Complex.I_im, one_mul, zero_add] constructor · nlinarith [mul_pos (show 0 < 1 + σ by linarith) hℓ] · nlinarith [mul_pos (show 0 < 1 - σ by linarith) hℓ] unfold lowerStripCappedGammaOuter exact stripRegularizedOuter_re hℓ hσbelow hσabove s (lowerGammaBoundaryCapped ((d : ℝ) / 2) R D) (lowerStripCappedGammaOuter_integrable_dimension hd (R := R) (D := D) hz) theorem stripPoissonKernel_tendsto_zero_bottom_of_ne {T : ℝ} (hT : T ≠ 0) : Tendsto (fun σ : ℝ => stripPoissonKernel σ T) (𝓝 (-1 : ℝ)) (𝓝 (0 : ℝ)) := by have hu : Real.pi * T / 2 ≠ 0 := by exact div_ne_zero (mul_ne_zero Real.pi_ne_zero hT) (by norm_num) have hcosh : 1 < Real.cosh (Real.pi * T / 2) := Real.one_lt_cosh.mpr hu have hangle : Continuous (fun σ : ℝ => stripAngle σ) := by unfold stripAngle fun_prop have hden : 4 * (Real.cosh (Real.pi * T / 2) - Real.cos (stripAngle (-1))) ≠ 0 := by simp only [stripAngle] norm_num linarith have hcontinuous : ContinuousAt (fun σ : ℝ => stripPoissonKernel σ T) (-1 : ℝ) := by unfold stripPoissonKernel exact ((Real.continuous_sin.comp hangle).continuousAt.div (continuousAt_const.mul (continuousAt_const.sub (Real.continuous_cos.comp hangle).continuousAt)) hden) convert! hcontinuous.tendsto using 1 all_goals simp [stripPoissonKernel, stripAngle] theorem stripPoissonKernel_le_center_of_lower_of_abs_ge {σ δ T : ℝ} (hbelow : -1 < σ) (hnonpos : σ ≤ 0) (hδ : 0 < δ) (hT : δ ≤ |T|) : stripPoissonKernel σ T ≤ (1 / (1 - (Real.cosh (Real.pi * δ / 2))⁻¹)) * stripPoissonKernel 0 T := by let A : ℝ := Real.cosh (Real.pi * T / 2) let C : ℝ := Real.cosh (Real.pi * δ / 2) let c : ℝ := 1 - C⁻¹ have hδarg : Real.pi * δ / 2 ≠ 0 := by exact (div_pos (mul_pos Real.pi_pos hδ) (by norm_num)).ne' have hC : 1 < C := by exact Real.one_lt_cosh.mpr hδarg have hCpos : 0 < C := lt_trans (by norm_num) hC have hc : 0 < c := by try dsimp [c] have hrecip : C⁻¹ < 1 := (inv_lt_one₀ hCpos).mpr hC linarith have hA : 0 < A := Real.cosh_pos _ have hCA : C ≤ A := by apply Real.cosh_le_cosh.mpr rw [abs_div, abs_div, abs_mul, abs_mul, abs_of_pos Real.pi_pos, abs_of_pos hδ] norm_num gcongr have hratio : 1 ≤ A / C := by apply (le_div_iff₀ hCpos).2 simpa using! hCA have hangle := stripAngle_mem_Ioo hbelow (show σ < 1 by linarith) have hcoslt : Real.cos (stripAngle σ) < 1 := by have h := Real.cos_lt_cos_of_nonneg_of_le_pi (x := 0) (y := stripAngle σ) (by norm_num) hangle.2.le hangle.1 simpa using! h have hsin : 0 < Real.sin (stripAngle σ) := Real.sin_pos_of_pos_of_lt_pi hangle.1 hangle.2 have hden : 0 < A - Real.cos (stripAngle σ) := by try dsimp [A] linarith [Real.one_le_cosh (Real.pi * T / 2)] have hcompare : c * A ≤ A - Real.cos (stripAngle σ) := by have hcos := Real.cos_le_one (stripAngle σ) try dsimp [c] rw [sub_mul, one_mul, inv_mul_eq_div] linarith have hcA : 0 < 4 * (c * A) := by positivity calc stripPoissonKernel σ T = Real.sin (stripAngle σ) / (4 * (A - Real.cos (stripAngle σ))) := rfl _ ≤ Real.sin (stripAngle σ) / (4 * (c * A)) := by apply div_le_div_of_nonneg_left hsin.le hcA exact mul_le_mul_of_nonneg_left hcompare (by norm_num) _ ≤ 1 / (4 * (c * A)) := by apply div_le_div_of_nonneg_right (Real.sin_le_one (stripAngle σ)) hcA.le _ = (1 / (1 - (Real.cosh (Real.pi * δ / 2))⁻¹)) * stripPoissonKernel 0 T := by simp only [stripPoissonKernel, stripAngle] norm_num try dsimp [A, C, c] field_simp [hc.ne', hA.ne'] theorem stripPoissonKernel_le_center_of_lower {σ : ℝ} (hbelow : -1 < σ) (hnonpos : σ ≤ 0) (T : ℝ) : stripPoissonKernel σ T ≤ (1 / (1 - Real.cos (stripAngle σ))) * stripPoissonKernel 0 T := by let A : ℝ := Real.cosh (Real.pi * T / 2) let q : ℝ := Real.cos (stripAngle σ) let c : ℝ := 1 - q have hangle := stripAngle_mem_Ioo hbelow (show σ < 1 by linarith) have hhalf : stripAngle σ ≤ Real.pi / 2 := by unfold stripAngle nlinarith [mul_nonpos_of_nonneg_of_nonpos Real.pi_pos.le hnonpos] have hq : 0 ≤ q := by try dsimp [q] apply Real.cos_nonneg_of_mem_Icc exact ⟨by linarith [Real.pi_pos], hhalf⟩ have hqlt : q < 1 := by try dsimp [q] have h := Real.cos_lt_cos_of_nonneg_of_le_pi (x := 0) (y := stripAngle σ) (by norm_num) hangle.2.le hangle.1 simpa using! h have hc : 0 < c := by try dsimp [c] linarith have hA : 0 < A := Real.cosh_pos _ have hAone : 1 ≤ A := Real.one_le_cosh _ have hcompare : c * A ≤ A - q := by try dsimp [c] nlinarith [mul_nonneg hq (sub_nonneg.mpr hAone)] have hsin : 0 < Real.sin (stripAngle σ) := Real.sin_pos_of_pos_of_lt_pi hangle.1 hangle.2 have hcA : 0 < 4 * (c * A) := by positivity calc stripPoissonKernel σ T = Real.sin (stripAngle σ) / (4 * (A - q)) := rfl _ ≤ Real.sin (stripAngle σ) / (4 * (c * A)) := by apply div_le_div_of_nonneg_left hsin.le hcA exact mul_le_mul_of_nonneg_left hcompare (by norm_num) _ ≤ 1 / (4 * (c * A)) := by apply div_le_div_of_nonneg_right (Real.sin_le_one (stripAngle σ)) hcA.le _ = (1 / (1 - Real.cos (stripAngle σ))) * stripPoissonKernel 0 T := by have hcenter : stripPoissonKernel 0 T = 1 / (4 * A) := by simp [stripPoissonKernel, stripAngle, A] rw [hcenter] change 1 / (4 * (c * A)) = (1 / c) * (1 / (4 * A)) field_simp [hc.ne', hA.ne'] theorem stripPoissonKernel_lower_product_integrable {σ : ℝ} (hbelow : -1 < σ) (hnonpos : σ ≤ 0) {g : ℝ → ℝ} (hg : Continuous g) (hbase : Integrable (fun T : ℝ => stripPoissonKernel 0 T * g T)) : Integrable (fun T : ℝ => stripPoissonKernel σ T * g T) := by let C : ℝ := 1 / (1 - Real.cos (stripAngle σ)) have hangle := stripAngle_mem_Ioo hbelow (show σ < 1 by linarith) have hqlt : Real.cos (stripAngle σ) < 1 := by have h := Real.cos_lt_cos_of_nonneg_of_le_pi (x := 0) (y := stripAngle σ) (by norm_num) hangle.2.le hangle.1 simpa using! h have hC : 0 < C := by try dsimp [C] exact one_div_pos.mpr (by linarith) have hmajor : Integrable (fun T : ℝ => C * ‖stripPoissonKernel 0 T * g T‖) := hbase.norm.const_mul C have hmeas : Measurable (fun T : ℝ => stripPoissonKernel σ T * g T) := by have hk : Measurable (fun T : ℝ => stripPoissonKernel σ T) := by unfold stripPoissonKernel stripAngle fun_prop exact hk.mul hg.measurable apply hmajor.mono' hmeas.aestronglyMeasurable filter_upwards [] with T have hσpositive := stripPoissonKernel_pos hbelow (show σ < 1 by linarith) T have hzero := stripPoissonKernel_pos (by norm_num : (-1 : ℝ) < 0) (by norm_num : (0 : ℝ) < 1) T have hkernel := stripPoissonKernel_le_center_of_lower hbelow hnonpos T calc ‖stripPoissonKernel σ T * g T‖ = stripPoissonKernel σ T * ‖g T‖ := by rw [norm_mul, Real.norm_eq_abs, abs_of_pos hσpositive] _ ≤ (C * stripPoissonKernel 0 T) * ‖g T‖ := by apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) exact hkernel _ = C * ‖stripPoissonKernel 0 T * g T‖ := by rw [norm_mul, Real.norm_of_nonneg hzero.le] ring theorem lowerGammaBoundaryCapped_central_poisson_shift_integrable {d : ℕ} (hd : 0 < d) (R D s : ℝ) : Integrable (fun T : ℝ => stripPoissonKernel 0 T * lowerGammaBoundaryCapped ((d : ℝ) / 2) R D (s - ((d : ℝ) / 2) * T)) := by let ℓ : ℝ := (d : ℝ) / 2 have hℓ : 0 < ℓ := half_pos (Nat.cast_pos.mpr hd) let z : ℂ := (s : ℂ) + Complex.I * ((0 * ℓ : ℝ) : ℂ) have hz : z ∈ Complex.im ⁻¹' Ioo (-ℓ) ℓ := by try dsimp [z] simp only [Set.mem_preimage, Set.mem_Ioo, Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.I_im, Complex.ofReal_re, zero_mul, one_mul, zero_add] constructor <;> linarith have houter := lowerStripCappedGammaOuter_integrable_dimension hd (R := R) (D := D) hz have hreal := houter.re have htranslated := hreal.comp_sub_left s have hscaled := htranslated.comp_mul_left' hℓ.ne' have hproduct := hscaled.const_mul ℓ convert! hproduct using 1 ext T change stripPoissonKernel 0 T * lowerGammaBoundaryCapped ℓ R D (s - ℓ * T) = ℓ * (stripRegularizedHolomorphicPoissonKernel ℓ z (s - ℓ * T) * (lowerGammaBoundaryCapped ℓ R D (s - ℓ * T) : ℂ)).re rw [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, mul_zero, sub_zero] try dsimp [z] rw [stripRegularizedHolomorphicPoissonKernel_re hℓ (by norm_num : (-1 : ℝ) < 0) (by norm_num : (0 : ℝ) < 1)] have harg : (s - (s - ℓ * T)) / ℓ = T := by field_simp [hℓ.ne'] ring rw [harg] field_simp [hℓ.ne'] end noncomputable section open Asymptotics Bornology Complex Filter Function MeasureTheory Metric Set open scoped Filter FourierTransform Real SchwartzMap Topology theorem norm_extension_le_of_frontier {U : Set ℂ} (hopen : IsOpen U) (hconnected : IsPreconnected U) (hbounded : Bornology.IsBounded U) {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f U) {N : ℂ → ℝ} (hN : ContinuousOn N (closure U)) (hinterior : ∀ z ∈ U, N z = ‖f z‖) {C : ℝ} (hfrontier : ∀ z ∈ frontier U, N z ≤ C) {z : ℂ} (hz : z ∈ closure U) : N z ≤ C := by classical by_cases hnonempty : U.Nonempty · have hproper : U ≠ (Set.univ : Set ℂ) := by intro hu rw [hu] at hbounded exact NormedSpace.unbounded_univ ℂ ℂ hbounded have hcompact : IsCompact (closure U) := hbounded.isCompact_closure obtain ⟨w, hwclosure, hwmax⟩ := hcompact.exists_isMaxOn hnonempty.closure hN have hwcases : w ∈ U ∨ w ∈ frontier U := by rw [closure_eq_interior_union_frontier, hopen.interior_eq, Set.mem_union] at hwclosure exact hwclosure have hwbound : N w ≤ C := by rcases hwcases with hWinterior | hWfrontier · have hmaxnorm : IsMaxOn (norm ∘ f) U w := by intro x hx change ‖f x‖ ≤ ‖f w‖ rw [← hinterior x hx, ← hinterior w hWinterior] exact hwmax (subset_closure hx) have hconstant := Complex.norm_eqOn_of_isPreconnected_of_isMaxOn hconnected hopen hf hWinterior hmaxnorm have hrealconstant : Set.EqOn N (Function.const ℂ (N w)) U := by intro x hx calc N x = ‖f x‖ := hinterior x hx _ = ‖f w‖ := by simpa [Function.comp_def, Function.const] using! hconstant hx _ = N w := (hinterior w hWinterior).symm have hclosedconstant := hrealconstant.of_subset_closure hN continuousOn_const subset_closure Subset.rfl obtain ⟨t, ht⟩ := nonempty_frontier_iff.mpr ⟨hnonempty, hproper⟩ have htclosure : t ∈ closure U := frontier_subset_closure ht calc N w = N t := by symm simpa [Function.const] using! hclosedconstant htclosure _ ≤ C := hfrontier t ht · exact hfrontier w hWfrontier exact le_trans (hwmax hz) hwbound · have hempty : U = ∅ := Set.not_nonempty_iff_eq_empty.mp hnonempty simp [hempty] at hz theorem horizontalStrip_norm_extension_majorization {a b C : ℝ} (hab : a < b) (hC : 0 < C) (f : ℂ → ℂ) (N : ℂ → ℝ) (hf : DifferentiableOn ℂ f (Complex.im ⁻¹' Ioo a b)) (hN : ContinuousOn N (Complex.im ⁻¹' Icc a b)) (hNnonneg : ∀ w : ℂ, w.im ∈ Icc a b → 0 ≤ N w) (hinterior : ∀ w : ℂ, w.im ∈ Ioo a b → N w = ‖f w‖) (hbottom : ∀ w : ℂ, w.im = a → N w ≤ C) (htop : ∀ w : ℂ, w.im = b → N w ≤ C) (hgrowth : ∃ c < Real.pi / (b - a), ∃ B : ℝ, Asymptotics.IsBigO (Filter.comap (fun w : ℂ => |w.re|) Filter.atTop ⊓ Filter.principal (Complex.im ⁻¹' Ioo a b)) f (fun w : ℂ => Real.exp (B * Real.exp (c * |w.re|)))) {z : ℂ} (hza : a ≤ z.im) (hzb : z.im ≤ b) : N z ≤ C := by rw [le_iff_eq_or_lt] at hza hzb rcases hza with hza | hza · exact hbottom z hza.symm rcases hzb with hzb | hzb · exact htop z hzb obtain ⟨m, r, rfl, rfl⟩ : ∃ m r : ℝ, a = m - r ∧ b = m + r := ⟨(a + b) / 2, (b - a) / 2, by ring, by ring⟩ have hr : 0 < r := by linarith have hwidth : m - r < m + r := by linarith rw [add_sub_sub_cancel, ← two_mul, div_mul_eq_div_div] at hgrowth have hπr : 0 < Real.pi / 2 / r := div_pos Real.pi_div_two_pos hr rcases hgrowth with ⟨c, hc, B, hO⟩ obtain ⟨q, ⟨hcq, hq⟩, hqr⟩ : ∃ q : ℝ, (c < q ∧ 0 < q) ∧ q < Real.pi / 2 / r := by simpa only [max_lt_iff] using! exists_between (max_lt hc hπr) have hqr' : q * r < Real.pi / 2 := (lt_div_iff₀ hr).mp hqr let aff : ℂ → ℂ := fun w => q * (w - m * Complex.I) let damp : ℝ → ℂ → ℂ := fun ε w => Complex.exp (ε * (Complex.exp (aff w) + Complex.exp (-aff w))) suffices hevent : ∀ᶠ ε : ℝ in 𝓝[<] (0 : ℝ), ‖damp ε z • f z‖ ≤ C by rw [hinterior z ⟨hza, hzb⟩] refine le_of_tendsto (Filter.Tendsto.mono_left ?_ nhdsWithin_le_nhds) hevent apply ((Complex.continuous_ofReal.mul continuous_const).cexp.smul continuous_const).norm.tendsto' simp filter_upwards [self_mem_nhdsWithin] with ε hε change ε < 0 at hε obtain ⟨δ, hδ, hδbound⟩ : ∃ δ : ℝ, δ < 0 ∧ ∀ ⦃w : ℂ⦄, w.im ∈ Icc (m - r) (m + r) → ‖damp ε w‖ ≤ Real.exp (δ * Real.exp (q * |w.re|)) := by refine ⟨ε * Real.cos (q * r), mul_neg_of_neg_of_pos hε (Real.cos_pos_of_mem_Ioo (abs_lt.mp ((abs_of_pos (mul_pos hq hr)).symm ▸ hqr'))), ?_⟩ intro w hw have hwaff : |(aff w).im| ≤ q * r := by rw [← Real.closedBall_eq_Icc, Metric.mem_closedBall, Real.dist_eq] at hw try dsimp [aff] rw [Complex.im_ofReal_mul, Complex.sub_im, Complex.mul_I_im, Complex.ofReal_re, abs_mul, abs_of_pos hq] gcongr simpa only [aff, Complex.re_ofReal_mul, abs_mul, abs_of_pos hq, Complex.sub_re, Complex.mul_I_re, Complex.ofReal_im, zero_mul, neg_zero, sub_zero, damp] using! norm_exp_mul_exp_add_exp_neg_le_of_abs_im_le hε.le hwaff hqr'.le have hdampedge : ∀ w : ℂ, w.im = m - r ∨ w.im = m + r → ‖damp ε w‖ ≤ 1 := by intro w hw apply le_trans (hδbound (hw.by_cases (fun h => h.symm ▸ left_mem_Icc.mpr hwidth.le) (fun h => h.symm ▸ right_mem_Icc.mpr hwidth.le))) apply Real.exp_le_one_iff.mpr exact mul_nonpos_of_nonpos_of_nonneg hδ.le (Real.exp_pos _).le obtain ⟨R, hzR, hR⟩ : ∃ R : ℝ, |z.re| < R ∧ ∀ w : ℂ, |w.re| = R → w.im ∈ Ioo (m - r) (m + r) → ‖damp ε w • f w‖ ≤ C := by refine ((eventually_gt_atTop |z.re|).and ?_).exists rcases hO.exists_pos with ⟨A, hA, hAmajor⟩ simp only [isBigOWith_iff, eventually_inf_principal, eventually_comap, Set.mem_Ioo, Set.mem_preimage, Real.norm_eq_abs, abs_of_pos (Real.exp_pos _)] at hAmajor suffices hlimit : Tendsto (fun R : ℝ => Real.exp (δ * Real.exp (q * R) + B * Real.exp (c * R) + Real.log A)) Filter.atTop (𝓝 (0 : ℝ)) by filter_upwards [hlimit.eventually (ge_mem_nhds hC), hAmajor] with R hRC hbound w hwre hwim calc ‖damp ε w • f w‖ ≤ Real.exp (δ * Real.exp (q * R) + B * Real.exp (c * R) + Real.log A) := by rw [norm_smul, Real.exp_add, ← hwre, Real.exp_add, Real.exp_log hA, mul_assoc, mul_comm _ A] gcongr · exact hδbound (Set.Ioo_subset_Icc_self hwim) · exact hbound w hwre hwim _ ≤ C := hRC apply Real.tendsto_exp_atBot.comp suffices haux : Tendsto (fun R : ℝ => δ + B * (Real.exp ((q - c) * R))⁻¹) Filter.atTop (𝓝 (δ + B * 0)) by rw [mul_zero, add_zero] at haux refine Filter.Tendsto.atBot_add ?_ tendsto_const_nhds simpa only [id, Function.comp_apply, add_mul, mul_assoc, ← div_eq_inv_mul, ← Real.exp_sub, ← sub_mul, sub_sub_cancel] using! haux.neg_mul_atTop hδ (Real.tendsto_exp_atTop.comp (tendsto_id.const_mul_atTop hq)) exact tendsto_const_nhds.add (tendsto_const_nhds.mul (tendsto_inv_atTop_zero.comp (Real.tendsto_exp_atTop.comp (tendsto_id.const_mul_atTop (sub_pos.mpr hcq))))) have hRpos : 0 < R := (abs_nonneg z.re).trans_lt hzR let U : Set ℂ := Set.Ioo (-R) R ×ℂ Set.Ioo (m - r) (m + r) have hUopen : IsOpen U := IsOpen.reProdIm isOpen_Ioo isOpen_Ioo have hUbounded : Bornology.IsBounded U := Bornology.IsBounded.reProdIm (isBounded_Ioo _ _) (isBounded_Ioo _ _) have hUconvex : Convex ℝ U := by have hset : U = ({w : ℂ | -R < w.re} ∩ {w : ℂ | w.re < R}) ∩ ({w : ℂ | m - r < w.im} ∩ {w : ℂ | w.im < m + r}) := by ext w simp [U, Complex.mem_reProdIm] rw [hset] exact ((convex_halfSpace_re_gt (-R)).inter (convex_halfSpace_re_lt R)).inter ((convex_halfSpace_im_gt (m - r)).inter (convex_halfSpace_im_lt (m + r))) have hdamp : Differentiable ℂ (damp ε) := by exact ((((differentiable_id.sub_const _).const_mul _).cexp.add ((differentiable_id.sub_const _).const_mul _).neg.cexp).const_mul _).cexp have hweighted : DifferentiableOn ℂ (fun w : ℂ => damp ε w • f w) U := by exact (hdamp.differentiableOn.smul hf).mono Set.inter_subset_right have hclosure : closure U ⊆ Complex.im ⁻¹' Icc (m - r) (m + r) := by intro w hw try dsimp [U] at hw rw [Complex.closure_reProdIm, closure_Ioo (neg_lt_self hRpos).ne, closure_Ioo hwidth.ne] at hw exact hw.2 let Next : ℂ → ℝ := fun w => ‖damp ε w‖ * N w have hNext : ContinuousOn Next (closure U) := by try dsimp [Next] exact hdamp.continuous.norm.continuousOn.mul (hN.mono hclosure) have hNextinterior : ∀ w ∈ U, Next w = ‖damp ε w • f w‖ := by intro w hw try dsimp [Next] rw [hinterior w hw.2] exact (norm_mul _ _).symm have hNextfrontier : ∀ w ∈ frontier U, Next w ≤ C := by intro w hw try dsimp [U] at hw rw [Complex.frontier_reProdIm, closure_Ioo (neg_lt_self hRpos).ne, frontier_Ioo hwidth, closure_Ioo hwidth.ne, frontier_Ioo (neg_lt_self hRpos)] at hw by_cases him : w.im = m - r ∨ w.im = m + r · dsimp [Next] calc ‖damp ε w‖ * N w ≤ 1 * N w := by apply mul_le_mul_of_nonneg_right (hdampedge w him) apply hNnonneg w exact him.by_cases (fun h => h.symm ▸ left_mem_Icc.mpr hwidth.le) (fun h => h.symm ▸ right_mem_Icc.mpr hwidth.le) _ = N w := one_mul _ _ ≤ C := him.by_cases (hbottom w) (htop w) · have hvert : w ∈ ({-R, R} : Set ℝ) ×ℂ Icc (m - r) (m + r) := by exact hw.resolve_left (fun h => him h.2) have him' := eq_endpoints_or_mem_Ioo_of_mem_Icc hvert.2 rw [← or_assoc] at him' have himinterior := him'.resolve_left him try dsimp [Next] rw [hinterior w himinterior] simpa [smul_eq_mul, norm_mul] using! hR w ((abs_eq hRpos.le).mpr hvert.1.symm) himinterior have hzU : z ∈ U := by exact ⟨(abs_lt.mp hzR), ⟨hza, hzb⟩⟩ have hmax := norm_extension_le_of_frontier hUopen hUconvex.isPreconnected hUbounded hweighted hNext hNextinterior hNextfrontier (subset_closure hzU) calc ‖damp ε z • f z‖ = Next z := by symm exact hNextinterior z hzU _ ≤ C := hmax theorem harmonic_abs_log_half_le_half {x : ℝ} (hx : 2 ≤ x) : |Real.log (x / 2)| ≤ x / 2 := by have hhalf : 1 ≤ x / 2 := by linarith rw [abs_of_nonneg (Real.log_nonneg hhalf)] have hlog := Real.log_le_sub_one_of_pos (show 0 < x / 2 by linarith) linarith theorem harmonic_abs_log_sqrtFactor_le_linear {c x : ℝ} (hc : 0 ≤ c) (hx : 2 ≤ x) : |Real.log (Real.sqrt (c ^ 2 + (x / 2) ^ 2))| ≤ c + x := by have hfactor := lower_abs_log_sqrtFactor_le hc (show 0 < x by linarith) have hlog := harmonic_abs_log_half_le_half hx linarith theorem harmonic_abs_log_coth_div_le_linear {x : ℝ} (hx : 2 ≤ x) : |Real.log (lowerCoth (Real.pi * (x / 2)) / (x / 2))| ≤ Real.pi * x + |Real.log Real.pi| + x := by have hcorr := lower_abs_log_coth_div_le (show 0 < x / 2 by linarith) have hlog := harmonic_abs_log_half_le_half hx nlinarith theorem harmonic_integerGammaBoundary_abs_le_linear (k : ℕ) (R : ℝ) : ∃ A : ℝ, 0 ≤ A ∧ ∀ x : ℝ, 2 ≤ x → |lowerGammaBoundaryLog (k : ℝ) R x| ≤ A * (1 + x) := by let S : ℝ := ∑ j ∈ Finset.range k, (j : ℝ) let L : ℝ := |(k : ℝ) * Real.log (Real.pi * R ^ 2)| let A : ℝ := L + S + (k : ℝ) + 1 have hS : 0 ≤ S := by try dsimp [S] positivity have hL : 0 ≤ L := abs_nonneg _ have hA : 0 ≤ A := by try dsimp [A] positivity refine ⟨A, hA, ?_⟩ intro x hx have hxzero : x ≠ 0 := by linarith have hsum : |∑ j ∈ Finset.range k, Real.log (Real.sqrt ((j : ℝ) ^ 2 + (x / 2) ^ 2))| ≤ S + (k : ℝ) * x := by calc |∑ j ∈ Finset.range k, Real.log (Real.sqrt ((j : ℝ) ^ 2 + (x / 2) ^ 2))| ≤ ∑ j ∈ Finset.range k, |Real.log (Real.sqrt ((j : ℝ) ^ 2 + (x / 2) ^ 2))| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ j ∈ Finset.range k, ((j : ℝ) + x) := by apply Finset.sum_le_sum intro j hj exact harmonic_abs_log_sqrtFactor_le_linear (Nat.cast_nonneg j) hx _ = S + (k : ℝ) * x := by simp [S, Finset.sum_add_distrib] rw [lowerGammaBoundaryLog_integer k R hxzero] have habs := abs_sub ((k : ℝ) * Real.log (Real.pi * R ^ 2)) (∑ j ∈ Finset.range k, Real.log (Real.sqrt ((j : ℝ) ^ 2 + (x / 2) ^ 2))) have hk : 0 ≤ (k : ℝ) := Nat.cast_nonneg k have hxpos : 0 ≤ x := by linarith try dsimp [A, L] try dsimp [L] at hL nlinarith [mul_nonneg hL hxpos, mul_nonneg hS hxpos, mul_nonneg hk hxpos] theorem harmonic_halfIntegerGammaBoundary_abs_le_linear (k : ℕ) (R : ℝ) : ∃ A : ℝ, 0 ≤ A ∧ ∀ x : ℝ, 2 ≤ x → |lowerGammaBoundaryLog ((k : ℝ) + 1 / 2) R x| ≤ A * (1 + x) := by let S : ℝ := ∑ j ∈ Finset.range k, ((j : ℝ) + 1 / 2) let L : ℝ := |((k : ℝ) + 1 / 2) * Real.log (Real.pi * R ^ 2)| let Q : ℝ := |Real.log Real.pi| let A : ℝ := L + S + (k : ℝ) + Real.pi + Q + 2 have hS : 0 ≤ S := by try dsimp [S] positivity have hL : 0 ≤ L := abs_nonneg _ have hQ : 0 ≤ Q := abs_nonneg _ have hA : 0 ≤ A := by try dsimp [A] positivity refine ⟨A, hA, ?_⟩ intro x hx have hxpos : 0 < x := by linarith have hsum : |∑ j ∈ Finset.range k, Real.log (Real.sqrt (((j : ℝ) + 1 / 2) ^ 2 + (x / 2) ^ 2))| ≤ S + (k : ℝ) * x := by calc |∑ j ∈ Finset.range k, Real.log (Real.sqrt (((j : ℝ) + 1 / 2) ^ 2 + (x / 2) ^ 2))| ≤ ∑ j ∈ Finset.range k, |Real.log (Real.sqrt (((j : ℝ) + 1 / 2) ^ 2 + (x / 2) ^ 2))| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ j ∈ Finset.range k, ((j : ℝ) + 1 / 2 + x) := by apply Finset.sum_le_sum intro j hj apply harmonic_abs_log_sqrtFactor_le_linear (by positivity) hx _ = S + (k : ℝ) * x := by simp [S, Finset.sum_add_distrib] have hcorr := harmonic_abs_log_coth_div_le_linear hx have hcorrhalf : |(1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * (x / 2)) / (x / 2))| ≤ (1 / 2 : ℝ) * (Real.pi * x + Q + x) := by rw [abs_mul, abs_of_nonneg (by norm_num)] exact mul_le_mul_of_nonneg_left (by simpa [Q] using! hcorr) (by norm_num) rw [lowerGammaBoundaryLog_halfInteger k R hxpos.ne'] simp only [abs_of_pos hxpos] rw [show Real.pi * x / 2 = Real.pi * (x / 2) by ring] have hmain := abs_sub (((k : ℝ) + 1 / 2) * Real.log (Real.pi * R ^ 2)) (∑ j ∈ Finset.range k, Real.log (Real.sqrt (((j : ℝ) + 1 / 2) ^ 2 + (x / 2) ^ 2))) have htotal := abs_add_le (((k : ℝ) + 1 / 2) * Real.log (Real.pi * R ^ 2) - ∑ j ∈ Finset.range k, Real.log (Real.sqrt (((j : ℝ) + 1 / 2) ^ 2 + (x / 2) ^ 2))) ((1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * (x / 2)) / (x / 2))) have hk : 0 ≤ (k : ℝ) := Nat.cast_nonneg k have hπ : 0 ≤ Real.pi := Real.pi_pos.le have hxn : 0 ≤ x := hxpos.le try dsimp [A, L, Q] try dsimp [L] at hL try dsimp [Q] at hQ nlinarith [mul_nonneg hL hxn, mul_nonneg hS hxn, mul_nonneg hk hxn, mul_nonneg hπ hxn, mul_nonneg hQ hxn] theorem harmonic_dimensionGammaBoundary_eq_abs {d : ℕ} (R : ℝ) {y : ℝ} (hy : y ≠ 0) : lowerGammaBoundaryLog ((d : ℝ) / 2) R y = lowerGammaBoundaryLog ((d : ℝ) / 2) R |y| := by by_cases hnonneg : 0 ≤ y · rw [abs_of_nonneg hnonneg] · have hneg : y < 0 := lt_of_not_ge hnonneg rw [abs_of_neg hneg] exact (lowerGammaBoundaryLog_dimension_neg (d := d) R hy).symm theorem harmonic_dimensionGammaBoundary_abs_le_linear (d : ℕ) (R : ℝ) : ∃ A : ℝ, 0 ≤ A ∧ ∀ y : ℝ, 2 ≤ |y| → |lowerGammaBoundaryLog ((d : ℝ) / 2) R y| ≤ A * (1 + |y|) := by rcases d.even_or_odd with ⟨k, rfl⟩ | ⟨k, rfl⟩ · have hcast : ((↑(k + k) : ℝ) / 2) = (k : ℝ) := by push_cast ring obtain ⟨A, hA, htail⟩ := harmonic_integerGammaBoundary_abs_le_linear k R refine ⟨A, hA, ?_⟩ intro y hy have hyzero : y ≠ 0 := by intro heq subst y norm_num at hy rw [harmonic_dimensionGammaBoundary_eq_abs R hyzero, hcast] exact htail |y| hy · have hcast : ((↑(2 * k + 1) : ℝ) / 2) = (k : ℝ) + 1 / 2 := by push_cast ring obtain ⟨A, hA, htail⟩ := harmonic_halfIntegerGammaBoundary_abs_le_linear k R refine ⟨A, hA, ?_⟩ intro y hy have hyzero : y ≠ 0 := by intro heq subst y norm_num at hy rw [harmonic_dimensionGammaBoundary_eq_abs R hyzero, hcast] exact htail |y| hy theorem lowerGammaBoundaryCapped_dimension_abs_le_linear {d : ℕ} (hd : 0 < d) (R D : ℝ) : ∃ A : ℝ, 0 ≤ A ∧ ∀ y : ℝ, |lowerGammaBoundaryCapped ((d : ℝ) / 2) R D y| ≤ A * (1 + |y|) := by have hℓ : 0 < (d : ℝ) / 2 := half_pos (Nat.cast_pos.mpr hd) obtain ⟨A₀, hA₀, htail⟩ := harmonic_dimensionGammaBoundary_abs_le_linear d R obtain ⟨K, hK⟩ := (isCompact_Icc : IsCompact (Icc (-2 : ℝ) 2)).exists_bound_of_continuousOn (lowerGammaBoundaryCapped_continuous hℓ R D).continuousOn let A : ℝ := max 0 (max K (max |D| A₀)) have hA : 0 ≤ A := le_max_left _ _ have hKA : K ≤ A := le_trans (le_max_left _ _) (le_max_right _ _) have hDA : |D| ≤ A := le_trans (le_max_left _ _) (le_trans (le_max_right _ _) (le_max_right _ _)) have hA₀A : A₀ ≤ A := le_trans (le_max_right _ _) (le_trans (le_max_right _ _) (le_max_right _ _)) refine ⟨A, hA, ?_⟩ intro y have hfactor : 1 ≤ 1 + |y| := by linarith [abs_nonneg y] by_cases hy : |y| < 2 · have hymem : y ∈ Icc (-2 : ℝ) 2 := by have hbounds := abs_lt.mp hy exact ⟨hbounds.1.le, hbounds.2.le⟩ have hcompact := hK y hymem rw [Real.norm_eq_abs] at hcompact calc |lowerGammaBoundaryCapped ((d : ℝ) / 2) R D y| ≤ K := hcompact _ ≤ A := hKA _ ≤ A * (1 + |y|) := by nlinarith [mul_nonneg hA (abs_nonneg y)] · have hylarge : 2 ≤ |y| := le_of_not_gt hy have hyzero : y ≠ 0 := by intro heq subst y norm_num at hylarge unfold lowerGammaBoundaryCapped rw [if_neg hyzero] by_cases hmin : lowerGammaBoundaryLog ((d : ℝ) / 2) R y ≤ D · rw [min_eq_left hmin] calc |lowerGammaBoundaryLog ((d : ℝ) / 2) R y| ≤ A₀ * (1 + |y|) := htail y hylarge _ ≤ A * (1 + |y|) := mul_le_mul_of_nonneg_right hA₀A (by positivity) · rw [min_eq_right (le_of_not_ge hmin)] calc |D| ≤ A := hDA _ ≤ A * (1 + |y|) := by nlinarith [mul_nonneg hA (abs_nonneg y)] theorem stripPoissonKernel_le_exponentialMajorant_of_nonneg {σ : ℝ} (hσ : 0 ≤ σ) (hσone : σ < 1) (T : ℝ) : stripPoissonKernel σ T ≤ stripPoissonExponentialMajorant T := by have hbelow : -1 < σ := by linarith have hmass := stripBottomMass_pos hσone have hmassone := (stripBottomMass_lt_one hbelow).le have hext := stripNormalizedPoissonExtension_le_majorant hσ hσone.le T have hreconstruct : stripPoissonKernel σ T = stripBottomMass σ * stripNormalizedPoissonExtension σ T := by rw [← stripNormalizedPoissonKernel_eq_extension hbelow hσone T] unfold stripNormalizedPoissonKernel field_simp [hmass.ne'] rw [hreconstruct] calc stripBottomMass σ * stripNormalizedPoissonExtension σ T ≤ 1 * stripNormalizedPoissonExtension σ T := mul_le_mul_of_nonneg_right hmassone hext.1 _ = stripNormalizedPoissonExtension σ T := one_mul _ _ ≤ stripPoissonExponentialMajorant T := hext.2 theorem harmonic_stripPoissonExponentialMajorant_abs_integrable : Integrable (fun T : ℝ => stripPoissonExponentialMajorant T * |T|) := by have hbase := integrable_abs_pow_mul_exp_neg_mul_abs 1 (half_pos Real.pi_pos) have hconstant := hbase.const_mul (Real.pi / 2) convert! hconstant using 1 ext T unfold stripPoissonExponentialMajorant norm_num ring theorem harmonic_stripPoissonKernel_zero_abs_integrable : Integrable (fun T : ℝ => stripPoissonKernel 0 T * |T|) := by have hmajor := harmonic_stripPoissonExponentialMajorant_abs_integrable have hmeas : Measurable (fun T : ℝ => stripPoissonKernel 0 T * |T|) := by unfold stripPoissonKernel stripAngle fun_prop apply hmajor.mono' hmeas.aestronglyMeasurable filter_upwards [] with T have hkernel := stripPoissonKernel_le_exponentialMajorant_of_nonneg (by norm_num : (0 : ℝ) ≤ 0) (by norm_num : (0 : ℝ) < 1) T have hpos := stripPoissonKernel_pos (by norm_num : (-1 : ℝ) < 0) (by norm_num : (0 : ℝ) < 1) T have hmajorpos : 0 ≤ stripPoissonExponentialMajorant T := by unfold stripPoissonExponentialMajorant positivity rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg hpos.le (abs_nonneg T))] exact mul_le_mul_of_nonneg_right hkernel (abs_nonneg T) theorem harmonic_stripPoissonKernel_abs_integrable {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) : Integrable (fun T : ℝ => stripPoissonKernel σ T * |T|) := by by_cases hσ : σ ≤ 0 · exact stripPoissonKernel_lower_product_integrable hbelow hσ continuous_abs harmonic_stripPoissonKernel_zero_abs_integrable · have hpositive : 0 ≤ σ := (le_of_not_ge hσ) have hmajor := harmonic_stripPoissonExponentialMajorant_abs_integrable have hmeas : Measurable (fun T : ℝ => stripPoissonKernel σ T * |T|) := by unfold stripPoissonKernel stripAngle fun_prop apply hmajor.mono' hmeas.aestronglyMeasurable filter_upwards [] with T have hkernel := stripPoissonKernel_le_exponentialMajorant_of_nonneg hpositive habove T have hkpos := stripPoissonKernel_pos hbelow habove T rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg hkpos.le (abs_nonneg T))] exact mul_le_mul_of_nonneg_right hkernel (abs_nonneg T) theorem exists_stripPoissonKernel_uniform_abs_moment : ∃ M : ℝ, 0 ≤ M ∧ ∀ σ : ℝ, -1 < σ → σ < 1 → (∫ T : ℝ, stripPoissonKernel σ T * |T|) ≤ M := by let C : ℝ := 1 / (1 - (Real.cosh (Real.pi / 2))⁻¹) let J : ℝ := ∫ T : ℝ, stripPoissonKernel 0 T * |T| let E : ℝ := ∫ T : ℝ, stripPoissonExponentialMajorant T * |T| let M : ℝ := 1 + C * J + E have harg : Real.pi / 2 ≠ 0 := (half_pos Real.pi_pos).ne' have hcosh : 1 < Real.cosh (Real.pi / 2) := Real.one_lt_cosh.mpr harg have hC : 0 < C := by try dsimp [C] have hpositive := Real.cosh_pos (Real.pi / 2) have hinv := (inv_lt_one₀ hpositive).mpr hcosh exact one_div_pos.mpr (by linarith) have hJ : 0 ≤ J := by try dsimp [J] apply integral_nonneg intro T exact mul_nonneg (stripPoissonKernel_pos (by norm_num : (-1 : ℝ) < 0) (by norm_num : (0 : ℝ) < 1) T).le (abs_nonneg T) have hE : 0 ≤ E := by try dsimp [E] apply integral_nonneg intro T unfold stripPoissonExponentialMajorant positivity have hM : 0 ≤ M := by try dsimp [M] positivity refine ⟨M, hM, ?_⟩ intro σ hbelow habove have hmoment := harmonic_stripPoissonKernel_abs_integrable hbelow habove by_cases hσ : σ ≤ 0 · let S : Set ℝ := {T : ℝ | 1 ≤ |T|} have hS : MeasurableSet S := (isClosed_le continuous_const continuous_abs).measurableSet have hk := stripPoissonKernel_integrable hbelow habove have hcenter := harmonic_stripPoissonKernel_zero_abs_integrable have hscaled : Integrable (fun T : ℝ => C * (stripPoissonKernel 0 T * |T|)) := hcenter.const_mul C have hfar : (∫ T in S, stripPoissonKernel σ T * |T|) ≤ C * J := by calc (∫ T in S, stripPoissonKernel σ T * |T|) ≤ ∫ T in S, C * (stripPoissonKernel 0 T * |T|) := by apply setIntegral_mono_on hmoment.integrableOn hscaled.integrableOn hS intro T hT have hcompare := stripPoissonKernel_le_center_of_lower_of_abs_ge hbelow hσ (by norm_num : (0 : ℝ) < 1) (show (1 : ℝ) ≤ |T| from hT) have hCeq : 1 / (1 - (Real.cosh (Real.pi * (1 : ℝ) / 2))⁻¹) = C := by try dsimp [C] congr 2 ring_nf rw [hCeq] at hcompare nlinarith [mul_nonneg (sub_nonneg.mpr hcompare) (abs_nonneg T)] _ ≤ ∫ T : ℝ, C * (stripPoissonKernel 0 T * |T|) := by apply setIntegral_le_integral hscaled filter_upwards [] with T exact mul_nonneg hC.le (mul_nonneg (stripPoissonKernel_pos (by norm_num : (-1 : ℝ) < 0) (by norm_num : (0 : ℝ) < 1) T).le (abs_nonneg T)) _ = C * J := by rw [integral_const_mul] have hnear : (∫ T in Sᶜ, stripPoissonKernel σ T * |T|) ≤ 1 := by calc (∫ T in Sᶜ, stripPoissonKernel σ T * |T|) ≤ ∫ T in Sᶜ, stripPoissonKernel σ T := by apply setIntegral_mono_on hmoment.integrableOn hk.integrableOn hS.compl intro T hT have hTabs : |T| ≤ 1 := by have hnot : ¬ (1 : ℝ) ≤ |T| := by intro hge exact hT (show T ∈ S from hge) exact (lt_of_not_ge hnot).le have hkpos := stripPoissonKernel_pos hbelow habove T nlinarith [mul_nonneg hkpos.le (sub_nonneg.mpr hTabs)] _ ≤ ∫ T : ℝ, stripPoissonKernel σ T := by apply setIntegral_le_integral hk filter_upwards [] with T exact (stripPoissonKernel_pos hbelow habove T).le _ = stripBottomMass σ := integral_stripPoissonKernel hbelow habove _ ≤ 1 := (stripBottomMass_lt_one hbelow).le have hsplit := integral_add_compl hS hmoment try dsimp [M] nlinarith · have hσnonneg : 0 ≤ σ := le_of_not_ge hσ have hmajor := harmonic_stripPoissonExponentialMajorant_abs_integrable have hineq : (∫ T : ℝ, stripPoissonKernel σ T * |T|) ≤ E := by try dsimp [E] apply integral_mono hmoment hmajor intro T apply mul_le_mul_of_nonneg_right (stripPoissonKernel_le_exponentialMajorant_of_nonneg hσnonneg habove T) (abs_nonneg T) try dsimp [M] nlinarith [mul_nonneg hC.le hJ] theorem lowerGammaBoundaryCapped_poisson_abs_le_linear {d : ℕ} (hd : 0 < d) (R D : ℝ) : ∃ B : ℝ, 0 ≤ B ∧ ∀ σ : ℝ, -1 < σ → σ < 1 → ∀ s : ℝ, |∫ T : ℝ, stripPoissonKernel σ T * lowerGammaBoundaryCapped ((d : ℝ) / 2) R D (s - ((d : ℝ) / 2) * T)| ≤ B * (1 + |s|) := by let ℓ : ℝ := (d : ℝ) / 2 have hℓ : 0 < ℓ := half_pos (Nat.cast_pos.mpr hd) obtain ⟨A, hA, hdatum⟩ := lowerGammaBoundaryCapped_dimension_abs_le_linear hd R D obtain ⟨M, hM, hmomentbound⟩ := exists_stripPoissonKernel_uniform_abs_moment let B : ℝ := A * (1 + ℓ * M) have hB : 0 ≤ B := by try dsimp [B] positivity refine ⟨B, hB, ?_⟩ intro σ hbelow habove s have hk := stripPoissonKernel_integrable hbelow habove have hmoment := harmonic_stripPoissonKernel_abs_integrable hbelow habove have hconstant := hk.const_mul (A * (1 + |s|)) have hlinear := hmoment.const_mul (A * ℓ) have hmajor : Integrable (fun T : ℝ => (A * (1 + |s|)) * stripPoissonKernel σ T + (A * ℓ) * (stripPoissonKernel σ T * |T|)) := by exact hconstant.add hlinear have hpoint : ∀ᵐ T : ℝ, ‖stripPoissonKernel σ T * lowerGammaBoundaryCapped ℓ R D (s - ℓ * T)‖ ≤ (A * (1 + |s|)) * stripPoissonKernel σ T + (A * ℓ) * (stripPoissonKernel σ T * |T|) := by filter_upwards [] with T have hkpos := stripPoissonKernel_pos hbelow habove T have hb := hdatum (s - ℓ * T) have htriangle := abs_sub s (ℓ * T) have hmulabs : |ℓ * T| = ℓ * |T| := by rw [abs_mul, abs_of_pos hℓ] rw [hmulabs] at htriangle rw [norm_mul, Real.norm_eq_abs, abs_of_pos hkpos, Real.norm_eq_abs] have hbig : |lowerGammaBoundaryCapped ℓ R D (s - ℓ * T)| ≤ A * (1 + |s| + ℓ * |T|) := by calc |lowerGammaBoundaryCapped ℓ R D (s - ℓ * T)| ≤ A * (1 + |s - ℓ * T|) := hb _ ≤ A * (1 + |s| + ℓ * |T|) := by apply mul_le_mul_of_nonneg_left _ hA linarith nlinarith [mul_nonneg hkpos.le (sub_nonneg.mpr hbig)] have hmass := (stripBottomMass_lt_one hbelow).le have hmasspos := (stripBottomMass_pos habove).le have hmomentle := hmomentbound σ hbelow habove calc |∫ T : ℝ, stripPoissonKernel σ T * lowerGammaBoundaryCapped ℓ R D (s - ℓ * T)| = ‖∫ T : ℝ, stripPoissonKernel σ T * lowerGammaBoundaryCapped ℓ R D (s - ℓ * T)‖ := by rw [Real.norm_eq_abs] _ ≤ ∫ T : ℝ, ((A * (1 + |s|)) * stripPoissonKernel σ T + (A * ℓ) * (stripPoissonKernel σ T * |T|)) := norm_integral_le_of_norm_le hmajor hpoint _ = (A * (1 + |s|)) * stripBottomMass σ + (A * ℓ) * (∫ T : ℝ, stripPoissonKernel σ T * |T|) := by rw [integral_add hconstant hlinear, integral_const_mul, integral_const_mul, integral_stripPoissonKernel hbelow habove] _ ≤ A * (1 + |s|) + (A * ℓ) * M := by have hfirst := mul_le_mul_of_nonneg_left hmass (by positivity : 0 ≤ A * (1 + |s|)) have hsecond := mul_le_mul_of_nonneg_left hmomentle (by positivity : 0 ≤ A * ℓ) nlinarith _ ≤ B * (1 + |s|) := by try dsimp [B] nlinarith [mul_nonneg (show 0 ≤ A * ℓ * M by positivity) (abs_nonneg s)] theorem lowerStripCappedGammaOuter_abs_re_le_linear {d : ℕ} (hd : 0 < d) (R D : ℝ) : ∃ B : ℝ, 0 ≤ B ∧ ∀ z : ℂ, z ∈ Complex.im ⁻¹' Ioo (-((d : ℝ) / 2)) ((d : ℝ) / 2) → |(lowerStripCappedGammaOuter ((d : ℝ) / 2) R D z).re| ≤ B * (1 + |z.re|) := by let ℓ : ℝ := (d : ℝ) / 2 have hℓ : 0 < ℓ := half_pos (Nat.cast_pos.mpr hd) obtain ⟨B, hB, hbound⟩ := lowerGammaBoundaryCapped_poisson_abs_le_linear hd R D refine ⟨B, hB, ?_⟩ intro z hz have hzbelow : -ℓ < z.im := hz.1 have hzabove : z.im < ℓ := hz.2 let σ : ℝ := z.im / ℓ have hσbelow : -1 < σ := by try dsimp [σ] apply (lt_div_iff₀ hℓ).2 simpa using! hzbelow have hσabove : σ < 1 := by try dsimp [σ] apply (div_lt_iff₀ hℓ).2 simpa using! hzabove have hzrep : (z.re : ℂ) + Complex.I * ((σ * ℓ : ℝ) : ℂ) = z := by apply Complex.ext · simp · simp [σ, hℓ.ne'] have hreal := lowerStripCappedGammaOuter_re_dimension hd hσbelow hσabove z.re (R := R) (D := D) rw [hzrep] at hreal rw [hreal] exact hbound σ hσbelow hσabove z.re theorem antiFourierWitness_cappedWeightedMellinStrip_growth {d : ℕ} (hd : 0 < d) {R : ℝ} (w : AntiFourierWitness d R) (D : ℝ) : ∃ c < Real.pi / (((d : ℝ) / 2) - (-((d : ℝ) / 2))), ∃ B : ℝ, Asymptotics.IsBigO (Filter.comap (fun z : ℂ => |z.re|) Filter.atTop ⊓ Filter.principal (Complex.im ⁻¹' Ioo (-((d : ℝ) / 2)) ((d : ℝ) / 2))) (fun z : ℂ => Complex.exp (-(lowerStripCappedGammaOuter ((d : ℝ) / 2) R D z)) * normalizedRadialMellinStrip hd w.function R z) (fun z : ℂ => Real.exp (B * Real.exp (c * |z.re|))) := by let ℓ : ℝ := (d : ℝ) / 2 have hℓ : 0 < ℓ := half_pos (Nat.cast_pos.mpr hd) obtain ⟨G, hG, houter⟩ := lowerStripCappedGammaOuter_abs_re_le_linear hd R D obtain ⟨K, hK, hwitness⟩ := antiFourierWitness_normalizedMellinStrip_uniform_bound hd w let c : ℝ := Real.pi / (4 * ℓ) have hc : 0 < c := by try dsimp [c] positivity have hclt : c < Real.pi / (ℓ - (-ℓ)) := by try dsimp [c] apply (div_lt_div_iff₀ (by positivity : 0 < 4 * ℓ) (by linarith : 0 < ℓ - (-ℓ))).2 nlinarith [Real.pi_pos, hℓ] let B : ℝ := G * (1 + 1 / c) refine ⟨c, hclt, B, ?_⟩ apply Asymptotics.IsBigO.of_bound (K + 1) apply Filter.eventually_inf_principal.mpr refine Filter.Eventually.of_forall ?_ intro z hz have hzbelow : -ℓ < z.im := hz.1 have hzabove : z.im < ℓ := hz.2 have hZ := hwitness z hzbelow.le hzabove.le have hW := houter z hz have hre : -(lowerStripCappedGammaOuter ℓ R D z).re ≤ G * (1 + |z.re|) := by exact le_trans (neg_le_abs _) hW have hexpcomparison : G * (1 + |z.re|) ≤ B * Real.exp (c * |z.re|) := by have hx : 0 ≤ |z.re| := abs_nonneg _ have hcinv : 0 ≤ 1 / c := by positivity have hsmall : 1 + |z.re| ≤ (1 + 1 / c) * Real.exp (c * |z.re|) := by calc 1 + |z.re| ≤ (1 + 1 / c) * (1 + c * |z.re|) := by have hcx : 0 ≤ c * |z.re| := mul_nonneg hc.le hx have hrecip : (1 / c) * c = 1 := by field_simp [hc.ne'] nlinarith [mul_nonneg hcinv hcx] _ ≤ (1 + 1 / c) * Real.exp (c * |z.re|) := by apply mul_le_mul_of_nonneg_left (show 1 + c * |z.re| ≤ Real.exp (c * |z.re|) by simpa [add_comm] using! Real.add_one_le_exp (c * |z.re|)) (by positivity) try dsimp [B] calc G * (1 + |z.re|) ≤ G * ((1 + 1 / c) * Real.exp (c * |z.re|)) := mul_le_mul_of_nonneg_left hsmall hG _ = G * (1 + 1 / c) * Real.exp (c * |z.re|) := by ring rw [norm_mul, Complex.norm_exp, Complex.neg_re, Real.norm_eq_abs, abs_of_pos (Real.exp_pos _)] calc Real.exp (-(lowerStripCappedGammaOuter ℓ R D z).re) * ‖normalizedRadialMellinStrip hd w.function R z‖ ≤ Real.exp (G * (1 + |z.re|)) * K := by apply mul_le_mul (Real.exp_le_exp.mpr hre) hZ (norm_nonneg _) (Real.exp_pos _).le _ ≤ Real.exp (B * Real.exp (c * |z.re|)) * K := by exact mul_le_mul_of_nonneg_right (Real.exp_le_exp.mpr hexpcomparison) hK _ ≤ (K + 1) * Real.exp (B * Real.exp (c * |z.re|)) := by nlinarith [Real.exp_pos (B * Real.exp (c * |z.re|))] theorem harmonic_bottom_normalized_height_tendsto {ℓ : ℝ} (hℓ : 0 < ℓ) (s : ℝ) : Tendsto (fun z : ℂ => z.im / ℓ) (𝓝[Complex.im ⁻¹' Ioo (-ℓ) ℓ] ((s : ℂ) - Complex.I * (ℓ : ℂ))) (𝓝 (-1 : ℝ)) := by have hcontinuous : Continuous (fun z : ℂ => z.im / ℓ) := by fun_prop convert! hcontinuous.continuousAt.tendsto.mono_left nhdsWithin_le_nhds using 1; simp [hℓ.ne'] theorem harmonic_bottom_real_tendsto {ℓ : ℝ} (s : ℝ) : Tendsto Complex.re (𝓝[Complex.im ⁻¹' Ioo (-ℓ) ℓ] ((s : ℂ) - Complex.I * (ℓ : ℂ))) (𝓝 s) := by convert! Complex.continuous_re.continuousAt.tendsto.mono_left nhdsWithin_le_nhds using 1; simp theorem harmonic_bottom_far_joint_tendsto_zero {ℓ : ℝ} (hℓ : 0 < ℓ) {b : ℝ → ℝ} (hb : Continuous b) {A : ℝ} (hA : 0 ≤ A) (hbound : ∀ y : ℝ, |b y| ≤ A * (1 + |y|)) (s : ℝ) {δ : ℝ} (hδ : 0 < δ) : Tendsto (fun z : ℂ => ∫ T in {T : ℝ | δ ≤ |T|}, stripPoissonKernel (z.im / ℓ) T * b (z.re - ℓ * T)) (𝓝[Complex.im ⁻¹' Ioo (-ℓ) ℓ] ((s : ℂ) - Complex.I * (ℓ : ℂ))) (𝓝 (0 : ℝ)) := by let U : Set ℂ := Complex.im ⁻¹' Ioo (-ℓ) ℓ let z₀ : ℂ := (s : ℂ) - Complex.I * (ℓ : ℂ) let S : Set ℝ := {T : ℝ | δ ≤ |T|} let C : ℝ := 1 / (1 - (Real.cosh (Real.pi * δ / 2))⁻¹) have hS : MeasurableSet S := (isClosed_le continuous_const continuous_abs).measurableSet have hδarg : Real.pi * δ / 2 ≠ 0 := by exact (div_pos (mul_pos Real.pi_pos hδ) (by norm_num)).ne' have hcosh : 1 < Real.cosh (Real.pi * δ / 2) := Real.one_lt_cosh.mpr hδarg have hC : 0 < C := by try dsimp [C] have hpositive := Real.cosh_pos (Real.pi * δ / 2) have hinv := (inv_lt_one₀ hpositive).mpr hcosh exact one_div_pos.mpr (by linarith) have hσ : Tendsto (fun z : ℂ => z.im / ℓ) (𝓝[U] z₀) (𝓝 (-1 : ℝ)) := by exact harmonic_bottom_normalized_height_tendsto hℓ s have hsreal : Tendsto Complex.re (𝓝[U] z₀) (𝓝 s) := harmonic_bottom_real_tendsto s have hlower : ∀ᶠ z : ℂ in 𝓝[U] z₀, -1 < z.im / ℓ := by filter_upwards [self_mem_nhdsWithin] with z hz have hzbelow : -ℓ < z.im := hz.1 apply (lt_div_iff₀ hℓ).2 simpa using! hzbelow have hupper : ∀ᶠ z : ℂ in 𝓝[U] z₀, z.im / ℓ ≤ 0 := by have hneg := hσ.eventually (eventually_lt_nhds (show (-1 : ℝ) < 0 by norm_num)) exact hneg.mono (fun z hz => hz.le) have hrealbound : ∀ᶠ z : ℂ in 𝓝[U] z₀, |z.re| ≤ |s| + 1 := by have hball := hsreal.eventually (Metric.ball_mem_nhds s (show (0 : ℝ) < 1 by norm_num)) filter_upwards [hball] with z hz have hsmall : |z.re - s| < 1 := by simpa [Metric.mem_ball, Real.dist_eq] using! hz have htriangle := abs_add_le (z.re - s) s have heq : z.re - s + s = z.re := by ring rw [heq] at htriangle linarith have hkzero := stripPoissonKernel_integrable (by norm_num : (-1 : ℝ) < 0) (by norm_num : (0 : ℝ) < 1) have hmoment := harmonic_stripPoissonKernel_zero_abs_integrable have hmajor : Integrable (fun T : ℝ => C * ((A * (2 + |s|)) * stripPoissonKernel 0 T + (A * ℓ) * (stripPoissonKernel 0 T * |T|))) := by exact ((hkzero.const_mul (A * (2 + |s|))).add (hmoment.const_mul (A * ℓ))).const_mul C have hmeas : ∀ᶠ z : ℂ in 𝓝[U] z₀, AEStronglyMeasurable (S.indicator (fun T : ℝ => stripPoissonKernel (z.im / ℓ) T * b (z.re - ℓ * T))) := by filter_upwards [] with z have hk : Measurable (fun T : ℝ => stripPoissonKernel (z.im / ℓ) T) := by unfold stripPoissonKernel stripAngle fun_prop have hbT : Measurable (fun T : ℝ => b (z.re - ℓ * T)) := by exact hb.measurable.comp (by fun_prop) exact ((hk.mul hbT).aestronglyMeasurable).indicator hS have hdom : ∀ᶠ z : ℂ in 𝓝[U] z₀, ∀ᵐ T : ℝ, ‖S.indicator (fun T : ℝ => stripPoissonKernel (z.im / ℓ) T * b (z.re - ℓ * T)) T‖ ≤ C * ((A * (2 + |s|)) * stripPoissonKernel 0 T + (A * ℓ) * (stripPoissonKernel 0 T * |T|)) := by filter_upwards [hlower, hupper, hrealbound] with z hzbelow hzupper hzreal filter_upwards [] with T by_cases hT : T ∈ S · rw [Set.indicator_of_mem hT] have hkernel := stripPoissonKernel_le_center_of_lower_of_abs_ge hzbelow hzupper hδ (show δ ≤ |T| from hT) have hkpos := stripPoissonKernel_pos hzbelow (by linarith) T have hzero := stripPoissonKernel_pos (by norm_num : (-1 : ℝ) < 0) (by norm_num : (0 : ℝ) < 1) T have htri := abs_sub z.re (ℓ * T) have hmul : |ℓ * T| = ℓ * |T| := by rw [abs_mul, abs_of_pos hℓ] rw [hmul] at htri have hdata : |b (z.re - ℓ * T)| ≤ A * (2 + |s| + ℓ * |T|) := by calc |b (z.re - ℓ * T)| ≤ A * (1 + |z.re - ℓ * T|) := hbound _ _ ≤ A * (2 + |s| + ℓ * |T|) := by apply mul_le_mul_of_nonneg_left _ hA linarith rw [norm_mul, Real.norm_eq_abs, abs_of_pos hkpos, Real.norm_eq_abs] change stripPoissonKernel (z.im / ℓ) T * |b (z.re - ℓ * T)| ≤ _ calc stripPoissonKernel (z.im / ℓ) T * |b (z.re - ℓ * T)| ≤ (C * stripPoissonKernel 0 T) * (A * (2 + |s| + ℓ * |T|)) := by exact mul_le_mul hkernel hdata (abs_nonneg _) (mul_nonneg hC.le hzero.le) _ = C * ((A * (2 + |s|)) * stripPoissonKernel 0 T + (A * ℓ) * (stripPoissonKernel 0 T * |T|)) := by ring · rw [Set.indicator_of_notMem hT, norm_zero] have hzero := stripPoissonKernel_pos (by norm_num : (-1 : ℝ) < 0) (by norm_num : (0 : ℝ) < 1) T exact mul_nonneg hC.le (add_nonneg (mul_nonneg (by positivity) hzero.le) (mul_nonneg (by positivity) (mul_nonneg hzero.le (abs_nonneg T)))) have hpoint : ∀ᵐ T : ℝ, Tendsto (fun z : ℂ => S.indicator (fun T : ℝ => stripPoissonKernel (z.im / ℓ) T * b (z.re - ℓ * T)) T) (𝓝[U] z₀) (𝓝 (0 : ℝ)) := by filter_upwards [] with T by_cases hT : T ∈ S · have hTne : T ≠ 0 := by intro hzero subst T have hbad : δ ≤ (0 : ℝ) := by simpa [S] using! hT linarith simp_rw [Set.indicator_of_mem hT] have hkernel := (stripPoissonKernel_tendsto_zero_bottom_of_ne hTne).comp hσ have hcont : Continuous (fun z : ℂ => b (z.re - ℓ * T)) := by exact hb.comp (by fun_prop) have hdatum : Tendsto (fun z : ℂ => b (z.re - ℓ * T)) (𝓝[U] z₀) (𝓝 (b (s - ℓ * T))) := by convert! hcont.continuousAt.tendsto.mono_left nhdsWithin_le_nhds using 1; simp [z₀] simpa using! hkernel.mul hdatum · simpa [Set.indicator_of_notMem hT] using! (tendsto_const_nhds : Tendsto (fun _ : ℂ => (0 : ℝ)) (𝓝[U] z₀) (𝓝 (0 : ℝ))) have hDCT := MeasureTheory.tendsto_integral_filter_of_dominated_convergence (f := fun _ : ℝ => (0 : ℝ)) (fun T : ℝ => C * ((A * (2 + |s|)) * stripPoissonKernel 0 T + (A * ℓ) * (stripPoissonKernel 0 T * |T|))) hmeas hdom hmajor hpoint simpa [U, z₀, S, integral_indicator hS] using! hDCT theorem harmonic_bottom_joint_tendsto_zero_of_zero {ℓ : ℝ} (hℓ : 0 < ℓ) {b : ℝ → ℝ} (hb : Continuous b) {A : ℝ} (hA : 0 ≤ A) (hbound : ∀ y : ℝ, |b y| ≤ A * (1 + |y|)) (hcentral : ∀ t : ℝ, Integrable (fun T : ℝ => stripPoissonKernel 0 T * b (t - ℓ * T))) (s : ℝ) (hszero : b s = 0) : Tendsto (fun z : ℂ => ∫ T : ℝ, stripPoissonKernel (z.im / ℓ) T * b (z.re - ℓ * T)) (𝓝[Complex.im ⁻¹' Ioo (-ℓ) ℓ] ((s : ℂ) - Complex.I * (ℓ : ℂ))) (𝓝 (0 : ℝ)) := by let U : Set ℂ := Complex.im ⁻¹' Ioo (-ℓ) ℓ let z₀ : ℂ := (s : ℂ) - Complex.I * (ℓ : ℂ) rw [Metric.tendsto_nhds] intro ε hε have hhalf : 0 < ε / 2 := half_pos hε obtain ⟨η, hη, hcontrol⟩ := (Metric.continuousAt_iff.mp hb.continuousAt) (ε / 2) hhalf let δ : ℝ := η / (2 * ℓ) have hδ : 0 < δ := by try dsimp [δ] positivity let S : Set ℝ := {T : ℝ | δ ≤ |T|} have hS : MeasurableSet S := (isClosed_le continuous_const continuous_abs).measurableSet have hfar := harmonic_bottom_far_joint_tendsto_zero hℓ hb hA hbound s hδ have hfarevent : ∀ᶠ z : ℂ in 𝓝[U] z₀, ‖∫ T in S, stripPoissonKernel (z.im / ℓ) T * b (z.re - ℓ * T)‖ < ε / 2 := by have hmetric := (Metric.tendsto_nhds.mp hfar) (ε / 2) hhalf filter_upwards [hmetric] with z hz simpa [U, z₀, S, dist_zero_right] using! hz have hlower : ∀ᶠ z : ℂ in 𝓝[U] z₀, -1 < z.im / ℓ := by filter_upwards [self_mem_nhdsWithin] with z hz apply (lt_div_iff₀ hℓ).2 simpa using! hz.1 have hσ := harmonic_bottom_normalized_height_tendsto hℓ s have hupper : ∀ᶠ z : ℂ in 𝓝[U] z₀, z.im / ℓ ≤ 0 := by have h := hσ.eventually (eventually_lt_nhds (show (-1 : ℝ) < 0 by norm_num)) exact h.mono (fun z hz => hz.le) have hreal := harmonic_bottom_real_tendsto (ℓ := ℓ) s have hrealclose : ∀ᶠ z : ℂ in 𝓝[U] z₀, |z.re - s| < η / 2 := by have hball := hreal.eventually (Metric.ball_mem_nhds s (half_pos hη)) filter_upwards [hball] with z hz simpa [Metric.mem_ball, Real.dist_eq] using! hz filter_upwards [hlower, hupper, hfarevent, hrealclose] with z hzbelow hzupper hzfar hzreal have hzabove : z.im / ℓ < 1 := by linarith have hg : Continuous (fun T : ℝ => b (z.re - ℓ * T)) := hb.comp (by fun_prop) have hproduct := stripPoissonKernel_lower_product_integrable hzbelow hzupper hg (hcentral z.re) have hk := stripPoissonKernel_integrable hzbelow hzabove have hmajor : Integrable (fun T : ℝ => (ε / 2) * stripPoissonKernel (z.im / ℓ) T) := hk.const_mul (ε / 2) have hpositive : 0 ≤ᵐ[(volume : Measure ℝ)] (fun T : ℝ => (ε / 2) * stripPoissonKernel (z.im / ℓ) T) := by filter_upwards [] with T exact mul_nonneg hhalf.le (stripPoissonKernel_pos hzbelow hzabove T).le have hnear : ‖∫ T in Sᶜ, stripPoissonKernel (z.im / ℓ) T * b (z.re - ℓ * T)‖ ≤ ε / 2 := by calc ‖∫ T in Sᶜ, stripPoissonKernel (z.im / ℓ) T * b (z.re - ℓ * T)‖ ≤ ∫ T in Sᶜ, (ε / 2) * stripPoissonKernel (z.im / ℓ) T := by apply norm_integral_le_of_norm_le hmajor.integrableOn filter_upwards [ae_restrict_mem hS.compl] with T hT have hTsmall : |T| < δ := by have hnot : ¬ δ ≤ |T| := by intro hge exact hT (show T ∈ S from hge) exact lt_of_not_ge hnot have hscaled : ℓ * |T| < η / 2 := by try dsimp [δ] at hTsmall have hm := mul_lt_mul_of_pos_left hTsmall hℓ have heq : ℓ * (η / (2 * ℓ)) = η / 2 := by field_simp [hℓ.ne'] rw [heq] at hm exact hm have htriangle := abs_sub (z.re - s) (ℓ * T) have hmul : |ℓ * T| = ℓ * |T| := by rw [abs_mul, abs_of_pos hℓ] rw [hmul] at htriangle have harg : |(z.re - ℓ * T) - s| < η := by have hring : (z.re - ℓ * T) - s = (z.re - s) - ℓ * T := by ring rw [hring] linarith have hbdist : dist (z.re - ℓ * T) s < η := by rw [Real.dist_eq] exact harg have hbsmall := hcontrol hbdist have hbabs : |b (z.re - ℓ * T)| < ε / 2 := by simpa [Real.dist_eq, hszero] using! hbsmall have hkpos := stripPoissonKernel_pos hzbelow hzabove T rw [norm_mul, Real.norm_eq_abs, abs_of_pos hkpos, Real.norm_eq_abs] nlinarith [mul_nonneg hkpos.le (sub_nonneg.mpr hbabs.le)] _ ≤ ∫ T : ℝ, (ε / 2) * stripPoissonKernel (z.im / ℓ) T := setIntegral_le_integral hmajor hpositive _ = (ε / 2) * stripBottomMass (z.im / ℓ) := by rw [integral_const_mul, integral_stripPoissonKernel hzbelow hzabove] _ ≤ ε / 2 := by have hmass := (stripBottomMass_lt_one hzbelow).le nlinarith [mul_nonneg hhalf.le (sub_nonneg.mpr hmass)] have hsplit := integral_add_compl hS hproduct rw [dist_zero_right] calc ‖∫ T : ℝ, stripPoissonKernel (z.im / ℓ) T * b (z.re - ℓ * T)‖ = ‖(∫ T in S, stripPoissonKernel (z.im / ℓ) T * b (z.re - ℓ * T)) + (∫ T in Sᶜ, stripPoissonKernel (z.im / ℓ) T * b (z.re - ℓ * T))‖ := by rw [hsplit] _ ≤ ‖∫ T in S, stripPoissonKernel (z.im / ℓ) T * b (z.re - ℓ * T)‖ + ‖∫ T in Sᶜ, stripPoissonKernel (z.im / ℓ) T * b (z.re - ℓ * T)‖ := norm_add_le _ _ _ < ε := by linarith theorem lowerGammaBoundaryCapped_bottom_poisson_joint_tendsto {d : ℕ} (hd : 0 < d) (R D s : ℝ) : Tendsto (fun z : ℂ => ∫ T : ℝ, stripPoissonKernel (z.im / ((d : ℝ) / 2)) T * lowerGammaBoundaryCapped ((d : ℝ) / 2) R D (z.re - ((d : ℝ) / 2) * T)) (𝓝[Complex.im ⁻¹' Ioo (-((d : ℝ) / 2)) ((d : ℝ) / 2)] ((s : ℂ) - Complex.I * (((d : ℝ) / 2 : ℝ) : ℂ))) (𝓝 (lowerGammaBoundaryCapped ((d : ℝ) / 2) R D s)) := by let ℓ : ℝ := (d : ℝ) / 2 let b : ℝ → ℝ := lowerGammaBoundaryCapped ℓ R D let b₀ : ℝ → ℝ := fun y => b y - b s let U : Set ℂ := Complex.im ⁻¹' Ioo (-ℓ) ℓ let z₀ : ℂ := (s : ℂ) - Complex.I * (ℓ : ℂ) have hℓ : 0 < ℓ := half_pos (Nat.cast_pos.mpr hd) have hb : Continuous b := lowerGammaBoundaryCapped_continuous hℓ R D have hb₀ : Continuous b₀ := by try dsimp [b₀] fun_prop obtain ⟨A, hA, hbound⟩ := lowerGammaBoundaryCapped_dimension_abs_le_linear hd R D let A₀ : ℝ := A + |b s| have hA₀ : 0 ≤ A₀ := by try dsimp [A₀] positivity have hbound₀ : ∀ y : ℝ, |b₀ y| ≤ A₀ * (1 + |y|) := by intro y have htriangle := abs_sub (b y) (b s) have hbmain : |b y| ≤ A * (1 + |y|) := by exact hbound y have hy : 0 ≤ |y| := abs_nonneg y have hbs : 0 ≤ |b s| := abs_nonneg _ try dsimp [b₀, A₀] nlinarith [mul_nonneg hbs hy] have hcentral : ∀ t : ℝ, Integrable (fun T : ℝ => stripPoissonKernel 0 T * b (t - ℓ * T)) := by intro t exact lowerGammaBoundaryCapped_central_poisson_shift_integrable hd R D t have hkcentral := stripPoissonKernel_integrable (by norm_num : (-1 : ℝ) < 0) (by norm_num : (0 : ℝ) < 1) have hcentral₀ : ∀ t : ℝ, Integrable (fun T : ℝ => stripPoissonKernel 0 T * b₀ (t - ℓ * T)) := by intro t have hsub := (hcentral t).sub (hkcentral.mul_const (b s)) convert! hsub using 1 ext T try dsimp [b₀] ring have hzero := harmonic_bottom_joint_tendsto_zero_of_zero hℓ hb₀ hA₀ hbound₀ hcentral₀ s (show b₀ s = 0 by simp [b₀]) have hσ := harmonic_bottom_normalized_height_tendsto hℓ s have hmasscontinuous : Continuous stripBottomMass := by unfold stripBottomMass fun_prop have hmass : Tendsto (fun z : ℂ => stripBottomMass (z.im / ℓ)) (𝓝[U] z₀) (𝓝 (1 : ℝ)) := by convert! hmasscontinuous.continuousAt.tendsto.comp hσ using 1; norm_num [stripBottomMass] have hsum := hzero.add (hmass.mul_const (b s)) have hσupper : ∀ᶠ z : ℂ in 𝓝[U] z₀, z.im / ℓ ≤ 0 := by have hevent := hσ.eventually (eventually_lt_nhds (show (-1 : ℝ) < 0 by norm_num)) exact hevent.mono fun z hz => hz.le have heq : (fun z : ℂ => ∫ T : ℝ, stripPoissonKernel (z.im / ℓ) T * b (z.re - ℓ * T)) =ᶠ[𝓝[U] z₀] (fun z : ℂ => (∫ T : ℝ, stripPoissonKernel (z.im / ℓ) T * b₀ (z.re - ℓ * T)) + stripBottomMass (z.im / ℓ) * b s) := by filter_upwards [self_mem_nhdsWithin, hσupper] with z hz hzupper have hzlower : -1 < z.im / ℓ := by apply (lt_div_iff₀ hℓ).2 simpa using! hz.1 have hzabove : z.im / ℓ < 1 := by linarith have hg₀ : Continuous (fun T : ℝ => b₀ (z.re - ℓ * T)) := by exact hb₀.comp (by fun_prop) have hprod₀ := stripPoissonKernel_lower_product_integrable hzlower hzupper hg₀ (hcentral₀ z.re) have hk := stripPoissonKernel_integrable hzlower hzabove have hconst := hk.mul_const (b s) calc (∫ T : ℝ, stripPoissonKernel (z.im / ℓ) T * b (z.re - ℓ * T)) = ∫ T : ℝ, (stripPoissonKernel (z.im / ℓ) T * b₀ (z.re - ℓ * T) + stripPoissonKernel (z.im / ℓ) T * b s) := by congr 1 funext T try dsimp [b₀] ring _ = (∫ T : ℝ, stripPoissonKernel (z.im / ℓ) T * b₀ (z.re - ℓ * T)) + ∫ T : ℝ, stripPoissonKernel (z.im / ℓ) T * b s := integral_add hprod₀ hconst _ = (∫ T : ℝ, stripPoissonKernel (z.im / ℓ) T * b₀ (z.re - ℓ * T)) + stripBottomMass (z.im / ℓ) * b s := by rw [integral_mul_const, integral_stripPoissonKernel hzlower hzabove] have hresult := hsum.congr' heq.symm simpa [ℓ, b, U, z₀] using! hresult theorem stripPoissonKernel_tendsto_zero_top (T : ℝ) : Tendsto (fun σ : ℝ => stripPoissonKernel σ T) (𝓝 (1 : ℝ)) (𝓝 (0 : ℝ)) := by have hangle : stripAngle (1 : ℝ) = Real.pi := by unfold stripAngle ring have hden : 4 * (Real.cosh (Real.pi * T / 2) - Real.cos (stripAngle (1 : ℝ))) ≠ 0 := by rw [hangle, Real.cos_pi] have hcosh := Real.one_le_cosh (Real.pi * T / 2) nlinarith have hnum : ContinuousAt (fun σ : ℝ => Real.sin (stripAngle σ)) 1 := by unfold stripAngle fun_prop have hdencont : ContinuousAt (fun σ : ℝ => 4 * (Real.cosh (Real.pi * T / 2) - Real.cos (stripAngle σ))) 1 := by unfold stripAngle fun_prop have h := (hnum.div hdencont hden).tendsto simpa [stripPoissonKernel, hangle, Real.sin_pi] using! h theorem harmonic_top_normalized_height_tendsto {ℓ : ℝ} (hℓ : 0 < ℓ) (s : ℝ) : Tendsto (fun z : ℂ => z.im / ℓ) (𝓝[Complex.im ⁻¹' Ioo (-ℓ) ℓ] ((s : ℂ) + Complex.I * (ℓ : ℂ))) (𝓝 (1 : ℝ)) := by have hcontinuous : Continuous (fun z : ℂ => z.im / ℓ) := by fun_prop convert! hcontinuous.continuousAt.tendsto.mono_left nhdsWithin_le_nhds using 1; simp [hℓ.ne'] theorem harmonic_upper_joint_tendsto_zero {ℓ : ℝ} (hℓ : 0 < ℓ) {b : ℝ → ℝ} (hb : Continuous b) {A : ℝ} (hA : 0 ≤ A) (hbound : ∀ y : ℝ, |b y| ≤ A * (1 + |y|)) (s : ℝ) : Tendsto (fun z : ℂ => ∫ T : ℝ, stripPoissonKernel (z.im / ℓ) T * b (z.re - ℓ * T)) (𝓝[Complex.im ⁻¹' Ioo (-ℓ) ℓ] ((s : ℂ) + Complex.I * (ℓ : ℂ))) (𝓝 (0 : ℝ)) := by let U : Set ℂ := Complex.im ⁻¹' Ioo (-ℓ) ℓ let z₀ : ℂ := (s : ℂ) + Complex.I * (ℓ : ℂ) have hσ : Tendsto (fun z : ℂ => z.im / ℓ) (𝓝[U] z₀) (𝓝 (1 : ℝ)) := harmonic_top_normalized_height_tendsto hℓ s have hreal : Tendsto Complex.re (𝓝[U] z₀) (𝓝 s) := by convert! Complex.continuous_re.continuousAt.tendsto.mono_left nhdsWithin_le_nhds using 1; simp [z₀] have hnonneg : ∀ᶠ z : ℂ in 𝓝[U] z₀, 0 ≤ z.im / ℓ := by have h := hσ.eventually (eventually_gt_nhds (by norm_num : (0 : ℝ) < 1)) exact h.mono (fun z hz => hz.le) have habove : ∀ᶠ z : ℂ in 𝓝[U] z₀, z.im / ℓ < 1 := by filter_upwards [self_mem_nhdsWithin] with z hz apply (div_lt_iff₀ hℓ).2 simpa using! hz.2 have hrealbound : ∀ᶠ z : ℂ in 𝓝[U] z₀, |z.re| ≤ |s| + 1 := by have hball := hreal.eventually (Metric.ball_mem_nhds s (by norm_num : (0 : ℝ) < 1)) filter_upwards [hball] with z hz have hsmall : |z.re - s| < 1 := by simpa [Metric.mem_ball, Real.dist_eq] using! hz have htri := abs_add_le (z.re - s) s have heq : z.re - s + s = z.re := by ring rw [heq] at htri linarith have hmajor : Integrable (fun T : ℝ => (A * (2 + |s|)) * stripPoissonExponentialMajorant T + (A * ℓ) * (stripPoissonExponentialMajorant T * |T|)) := (stripPoissonExponentialMajorant_integrable.const_mul (A * (2 + |s|))).add (harmonic_stripPoissonExponentialMajorant_abs_integrable.const_mul (A * ℓ)) have hmeas : ∀ᶠ z : ℂ in 𝓝[U] z₀, AEStronglyMeasurable (fun T : ℝ => stripPoissonKernel (z.im / ℓ) T * b (z.re - ℓ * T)) := by filter_upwards [] with z have hk : Measurable (fun T : ℝ => stripPoissonKernel (z.im / ℓ) T) := by unfold stripPoissonKernel stripAngle fun_prop have hdatum : Measurable (fun T : ℝ => b (z.re - ℓ * T)) := hb.measurable.comp (by fun_prop) exact (hk.mul hdatum).aestronglyMeasurable have hdom : ∀ᶠ z : ℂ in 𝓝[U] z₀, ∀ᵐ T : ℝ, ‖stripPoissonKernel (z.im / ℓ) T * b (z.re - ℓ * T)‖ ≤ (A * (2 + |s|)) * stripPoissonExponentialMajorant T + (A * ℓ) * (stripPoissonExponentialMajorant T * |T|) := by filter_upwards [hnonneg, habove, hrealbound] with z hznonneg hzabove hzreal filter_upwards [] with T have hzbelow : -1 < z.im / ℓ := by linarith have hkpos := stripPoissonKernel_pos hzbelow hzabove T have hkbound := stripPoissonKernel_le_exponentialMajorant_of_nonneg hznonneg hzabove T have hmajorpos : 0 ≤ stripPoissonExponentialMajorant T := by unfold stripPoissonExponentialMajorant positivity have htri := abs_sub z.re (ℓ * T) have hmul : |ℓ * T| = ℓ * |T| := by rw [abs_mul, abs_of_pos hℓ] rw [hmul] at htri have hdata : |b (z.re - ℓ * T)| ≤ A * (2 + |s| + ℓ * |T|) := by calc |b (z.re - ℓ * T)| ≤ A * (1 + |z.re - ℓ * T|) := hbound _ _ ≤ A * (2 + |s| + ℓ * |T|) := by apply mul_le_mul_of_nonneg_left _ hA linarith rw [norm_mul, Real.norm_eq_abs, abs_of_pos hkpos, Real.norm_eq_abs] calc stripPoissonKernel (z.im / ℓ) T * |b (z.re - ℓ * T)| ≤ stripPoissonExponentialMajorant T * (A * (2 + |s| + ℓ * |T|)) := mul_le_mul hkbound hdata (abs_nonneg _) hmajorpos _ = (A * (2 + |s|)) * stripPoissonExponentialMajorant T + (A * ℓ) * (stripPoissonExponentialMajorant T * |T|) := by ring have hpoint : ∀ᵐ T : ℝ, Tendsto (fun z : ℂ => stripPoissonKernel (z.im / ℓ) T * b (z.re - ℓ * T)) (𝓝[U] z₀) (𝓝 (0 : ℝ)) := by filter_upwards [] with T have hk := (stripPoissonKernel_tendsto_zero_top T).comp hσ have hcont : Continuous (fun z : ℂ => b (z.re - ℓ * T)) := hb.comp (by fun_prop) have hdatum : Tendsto (fun z : ℂ => b (z.re - ℓ * T)) (𝓝[U] z₀) (𝓝 (b (s - ℓ * T))) := by convert! hcont.continuousAt.tendsto.mono_left nhdsWithin_le_nhds using 1; simp [z₀] simpa using! hk.mul hdatum have h := MeasureTheory.tendsto_integral_filter_of_dominated_convergence (f := fun _ : ℝ => (0 : ℝ)) (fun T : ℝ => (A * (2 + |s|)) * stripPoissonExponentialMajorant T + (A * ℓ) * (stripPoissonExponentialMajorant T * |T|)) hmeas hdom hmajor hpoint simpa [U, z₀] using! h theorem exists_antiFourierWitness_eventually_capped_bottom_majorant {d : ℕ} (hd : 0 < d) {R : ℝ} (hR : 0 < R) (w : AntiFourierWitness d R) : ∃ D₀ : ℝ, ∀ D : ℝ, D₀ ≤ D → ∀ y : ℝ, ‖normalizedRadialMellinStrip hd w.function R ((y : ℂ) - Complex.I * (((d : ℝ) / 2 : ℝ) : ℂ))‖ ≤ Real.exp (lowerGammaBoundaryCapped ((d : ℝ) / 2) R D y) := by obtain ⟨C, hC, hglobal⟩ := antiFourierWitness_normalizedMellinStrip_uniform_bound hd w let D₀ : ℝ := Real.log (C + 1) have hD₀ : Real.exp D₀ = C + 1 := by try dsimp [D₀] apply Real.exp_log linarith refine ⟨D₀, ?_⟩ intro D hD y have hbounded : ‖normalizedRadialMellinStrip hd w.function R ((y : ℂ) - Complex.I * (((d : ℝ) / 2 : ℝ) : ℂ))‖ ≤ C := by apply hglobal · simp · simp have hdim : 0 ≤ (d : ℝ) := Nat.cast_nonneg d linarith have hcapped : ‖normalizedRadialMellinStrip hd w.function R ((y : ℂ) - Complex.I * (((d : ℝ) / 2 : ℝ) : ℂ))‖ ≤ Real.exp D := by calc ‖normalizedRadialMellinStrip hd w.function R ((y : ℂ) - Complex.I * (((d : ℝ) / 2 : ℝ) : ℂ))‖ ≤ C := hbounded _ ≤ C + 1 := by linarith _ = Real.exp D₀ := hD₀.symm _ ≤ Real.exp D := Real.exp_le_exp.mpr hD by_cases hy : y = 0 · subst y simpa [lowerGammaBoundaryCapped] using! hcapped · unfold lowerGammaBoundaryCapped rw [if_neg hy] by_cases hmin : lowerGammaBoundaryLog ((d : ℝ) / 2) R y ≤ D · rw [min_eq_left hmin] exact antiFourierWitness_normalizedMellinStrip_bottom_norm_le_gamma hd hR w y hy · rw [min_eq_right (le_of_not_ge hmin)] exact hcapped theorem lowerStripCappedGammaOuter_bottom_re_joint_tendsto {d : ℕ} (hd : 0 < d) (R D s : ℝ) : Tendsto (fun z : ℂ => (lowerStripCappedGammaOuter ((d : ℝ) / 2) R D z).re) (𝓝[Complex.im ⁻¹' Ioo (-((d : ℝ) / 2)) ((d : ℝ) / 2)] ((s : ℂ) - Complex.I * (((d : ℝ) / 2 : ℝ) : ℂ))) (𝓝 (lowerGammaBoundaryCapped ((d : ℝ) / 2) R D s)) := by let ℓ : ℝ := (d : ℝ) / 2 let U : Set ℂ := Complex.im ⁻¹' Ioo (-ℓ) ℓ let z₀ : ℂ := (s : ℂ) - Complex.I * (ℓ : ℂ) have hℓ : 0 < ℓ := half_pos (Nat.cast_pos.mpr hd) have hpoisson := lowerGammaBoundaryCapped_bottom_poisson_joint_tendsto hd R D s have heq : (fun z : ℂ => (lowerStripCappedGammaOuter ℓ R D z).re) =ᶠ[𝓝[U] z₀] (fun z : ℂ => ∫ T : ℝ, stripPoissonKernel (z.im / ℓ) T * lowerGammaBoundaryCapped ℓ R D (z.re - ℓ * T)) := by filter_upwards [self_mem_nhdsWithin] with z hz have hbelow : -1 < z.im / ℓ := by apply (lt_div_iff₀ hℓ).2 simpa using! hz.1 have habove : z.im / ℓ < 1 := by apply (div_lt_iff₀ hℓ).2 simpa using! hz.2 have hrepr : (z.re : ℂ) + Complex.I * (((z.im / ℓ * ℓ : ℝ) : ℂ)) = z := by apply Complex.ext · simp · simp [hℓ.ne'] rw [← hrepr] simpa [ℓ, hℓ.ne'] using! (lowerStripCappedGammaOuter_re_dimension (R := R) (D := D) hd hbelow habove z.re) have hresult := hpoisson.congr' heq.symm simpa [ℓ, U, z₀] using! hresult theorem lowerStripCappedGammaOuter_top_re_joint_tendsto {d : ℕ} (hd : 0 < d) (R D s : ℝ) : Tendsto (fun z : ℂ => (lowerStripCappedGammaOuter ((d : ℝ) / 2) R D z).re) (𝓝[Complex.im ⁻¹' Ioo (-((d : ℝ) / 2)) ((d : ℝ) / 2)] ((s : ℂ) + Complex.I * (((d : ℝ) / 2 : ℝ) : ℂ))) (𝓝 (0 : ℝ)) := by let ℓ : ℝ := (d : ℝ) / 2 let U : Set ℂ := Complex.im ⁻¹' Ioo (-ℓ) ℓ let z₀ : ℂ := (s : ℂ) + Complex.I * (ℓ : ℂ) have hℓ : 0 < ℓ := half_pos (Nat.cast_pos.mpr hd) obtain ⟨A, hA, hbound⟩ := lowerGammaBoundaryCapped_dimension_abs_le_linear hd R D have hcontinuous := lowerGammaBoundaryCapped_continuous hℓ R D have hpoisson := harmonic_upper_joint_tendsto_zero hℓ hcontinuous hA hbound s have heq : (fun z : ℂ => (lowerStripCappedGammaOuter ℓ R D z).re) =ᶠ[𝓝[U] z₀] (fun z : ℂ => ∫ T : ℝ, stripPoissonKernel (z.im / ℓ) T * lowerGammaBoundaryCapped ℓ R D (z.re - ℓ * T)) := by filter_upwards [self_mem_nhdsWithin] with z hz have hbelow : -1 < z.im / ℓ := by apply (lt_div_iff₀ hℓ).2 simpa using! hz.1 have habove : z.im / ℓ < 1 := by apply (div_lt_iff₀ hℓ).2 simpa using! hz.2 have hrepr : (z.re : ℂ) + Complex.I * (((z.im / ℓ * ℓ : ℝ) : ℂ)) = z := by apply Complex.ext · simp · simp [hℓ.ne'] rw [← hrepr] simpa [ℓ, hℓ.ne'] using! (lowerStripCappedGammaOuter_re_dimension (R := R) (D := D) hd hbelow habove z.re) have hresult := hpoisson.congr' heq.symm simpa [ℓ, U, z₀] using! hresult def horizontalStripRealTraceExtension (a b : ℝ) (H : ℂ → ℝ) (bottom top : ℝ → ℝ) (z : ℂ) : ℝ := if z.im = a then bottom z.re else if z.im = b then top z.re else H z theorem horizontalStrip_closed_eq_open_union_edges {a b : ℝ} (hab : a < b) : (Complex.im ⁻¹' Icc a b) = ((Complex.im ⁻¹' Ioo a b) ∪ (Complex.im ⁻¹' {a})) ∪ (Complex.im ⁻¹' {b}) := by ext z change (a ≤ z.im ∧ z.im ≤ b) ↔ (((a < z.im ∧ z.im < b) ∨ z.im = a) ∨ z.im = b) constructor · intro hz by_cases hbottom : z.im = a · exact Or.inl (Or.inr hbottom) by_cases htop : z.im = b · exact Or.inr htop exact Or.inl (Or.inl ⟨lt_of_le_of_ne hz.1 (Ne.symm hbottom), lt_of_le_of_ne hz.2 htop⟩) · intro hz rcases hz with (hinterior | hbottom) | htop · exact ⟨hinterior.1.le, hinterior.2.le⟩ · rw [hbottom] exact ⟨le_rfl, hab.le⟩ · rw [htop] exact ⟨hab.le, le_rfl⟩ theorem horizontalStripRealTraceExtension_continuousOn {a b : ℝ} (hab : a < b) (H : ℂ → ℝ) (bottom top : ℝ → ℝ) (hH : ContinuousOn H (Complex.im ⁻¹' Ioo a b)) (hbottom : Continuous bottom) (htop : Continuous top) (hbottomtrace : ∀ s : ℝ, Tendsto H (𝓝[Complex.im ⁻¹' Ioo a b] ((s : ℂ) + Complex.I * (a : ℂ))) (𝓝 (bottom s))) (htoptrace : ∀ s : ℝ, Tendsto H (𝓝[Complex.im ⁻¹' Ioo a b] ((s : ℂ) + Complex.I * (b : ℂ))) (𝓝 (top s))) : ContinuousOn (horizontalStripRealTraceExtension a b H bottom top) (Complex.im ⁻¹' Icc a b) := by let E : ℂ → ℝ := horizontalStripRealTraceExtension a b H bottom top let O : Set ℂ := Complex.im ⁻¹' Ioo a b let L : Set ℂ := Complex.im ⁻¹' {a} let T : Set ℂ := Complex.im ⁻¹' {b} have hclosedL : IsClosed L := by exact isClosed_singleton.preimage Complex.continuous_im have hclosedT : IsClosed T := by exact isClosed_singleton.preimage Complex.continuous_im have hinterior : ∀ z ∈ O, E z = H z := by intro z hz have hza : z.im ≠ a := ne_of_gt hz.1 have hzb : z.im ≠ b := ne_of_lt hz.2 simp [E, horizontalStripRealTraceExtension, hza, hzb] intro z hz have hU : ContinuousWithinAt E O z := by by_cases hza : z.im = a · have hrepr : (z.re : ℂ) + Complex.I * (a : ℂ) = z := by apply Complex.ext · simp · simpa using! hza.symm have htrace := hbottomtrace z.re rw [hrepr] at htrace have hevent : E =ᶠ[𝓝[O] z] H := mem_of_superset self_mem_nhdsWithin hinterior change Tendsto E (𝓝[O] z) (𝓝 (E z)) have hvalue : E z = bottom z.re := by simp [E, horizontalStripRealTraceExtension, hza] rw [hvalue] exact htrace.congr' hevent.symm · by_cases hzb : z.im = b · have hrepr : (z.re : ℂ) + Complex.I * (b : ℂ) = z := by apply Complex.ext · simp · simpa using! hzb.symm have htrace := htoptrace z.re rw [hrepr] at htrace have hevent : E =ᶠ[𝓝[O] z] H := mem_of_superset self_mem_nhdsWithin hinterior change Tendsto E (𝓝[O] z) (𝓝 (E z)) have hvalue : E z = top z.re := by simp [E, horizontalStripRealTraceExtension, hzb, (ne_of_gt hab : b ≠ a)] rw [hvalue] exact htrace.congr' hevent.symm · have hzO : z ∈ O := by exact ⟨lt_of_le_of_ne hz.1 (Ne.symm hza), lt_of_le_of_ne hz.2 hzb⟩ exact (hH z hzO).congr hinterior (hinterior z hzO) have hL : ContinuousWithinAt E L z := by by_cases hza : z ∈ L · have hreal : z.im = a := hza have hc : Continuous (fun w : ℂ => bottom w.re) := hbottom.comp Complex.continuous_re apply hc.continuousAt.continuousWithinAt.congr · intro w hw have hwa : w.im = a := hw simp [E, horizontalStripRealTraceExtension, hwa] · simp [E, horizontalStripRealTraceExtension, hreal] · apply continuousWithinAt_of_notMem_closure rw [hclosedL.closure_eq] exact hza have hT : ContinuousWithinAt E T z := by by_cases hzb : z ∈ T · have hreal : z.im = b := hzb have hc : Continuous (fun w : ℂ => top w.re) := htop.comp Complex.continuous_re apply hc.continuousAt.continuousWithinAt.congr · intro w hw have hwb : w.im = b := hw have hwa : w.im ≠ a := by rw [hwb] exact ne_of_gt hab simp [E, horizontalStripRealTraceExtension, hwb, (ne_of_gt hab : b ≠ a)] · have hza : z.im ≠ a := by rw [hreal] exact ne_of_gt hab simp [E, horizontalStripRealTraceExtension, hreal, (ne_of_gt hab : b ≠ a)] · apply continuousWithinAt_of_notMem_closure rw [hclosedT.closure_eq] exact hzb change ContinuousWithinAt E (Complex.im ⁻¹' Icc a b) z rw [horizontalStrip_closed_eq_open_union_edges hab] exact (hU.union hL).union hT def lowerStripCappedGammaHarmonic (d : ℕ) (R D : ℝ) (z : ℂ) : ℝ := horizontalStripRealTraceExtension (-((d : ℝ) / 2)) ((d : ℝ) / 2) (fun w : ℂ => (lowerStripCappedGammaOuter ((d : ℝ) / 2) R D w).re) (lowerGammaBoundaryCapped ((d : ℝ) / 2) R D) (fun _ : ℝ => 0) z theorem lowerStripCappedGammaHarmonic_continuousOn {d : ℕ} (hd : 0 < d) (R D : ℝ) : ContinuousOn (lowerStripCappedGammaHarmonic d R D) (Complex.im ⁻¹' Icc (-((d : ℝ) / 2)) ((d : ℝ) / 2)) := by have hℓ : 0 < (d : ℝ) / 2 := by positivity unfold lowerStripCappedGammaHarmonic apply horizontalStripRealTraceExtension_continuousOn (show -((d : ℝ) / 2) < (d : ℝ) / 2 by linarith) · exact Complex.continuous_re.comp_continuousOn (lowerStripCappedGammaOuter_differentiableOn_dimension hd R D).continuousOn · exact lowerGammaBoundaryCapped_continuous hℓ R D · fun_prop · intro s simpa [sub_eq_add_neg] using! lowerStripCappedGammaOuter_bottom_re_joint_tendsto hd R D s · intro s simpa using! lowerStripCappedGammaOuter_top_re_joint_tendsto hd R D s theorem antiFourierWitness_capped_poisson_majorization_of_real_extension {d : ℕ} (hd : 0 < d) {R : ℝ} (w : AntiFourierWitness d R) (D : ℝ) (E : ℂ → ℝ) (hE : ContinuousOn E (Complex.im ⁻¹' Icc (-((d : ℝ) / 2)) ((d : ℝ) / 2))) (hEinterior : ∀ z : ℂ, z.im ∈ Ioo (-((d : ℝ) / 2)) ((d : ℝ) / 2) → E z = (lowerStripCappedGammaOuter ((d : ℝ) / 2) R D z).re) (hEbottom : ∀ z : ℂ, z.im = -((d : ℝ) / 2) → E z = lowerGammaBoundaryCapped ((d : ℝ) / 2) R D z.re) (hEtop : ∀ z : ℂ, z.im = (d : ℝ) / 2 → E z = 0) (hcap : ∀ y : ℝ, ‖normalizedRadialMellinStrip hd w.function R ((y : ℂ) - Complex.I * (((d : ℝ) / 2 : ℝ) : ℂ))‖ ≤ Real.exp (lowerGammaBoundaryCapped ((d : ℝ) / 2) R D y)) {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) (s : ℝ) : ‖normalizedRadialMellinStrip hd w.function R ((s : ℂ) + Complex.I * ((σ * ((d : ℝ) / 2) : ℝ) : ℂ))‖ ≤ Real.exp (∫ T : ℝ, stripPoissonKernel σ T * lowerGammaBoundaryCapped ((d : ℝ) / 2) R D (s - ((d : ℝ) / 2) * T)) := by let ℓ : ℝ := (d : ℝ) / 2 let U : Set ℂ := Complex.im ⁻¹' Ioo (-ℓ) ℓ let S : Set ℂ := Complex.im ⁻¹' Icc (-ℓ) ℓ let Z : ℂ → ℂ := normalizedRadialMellinStrip hd w.function R let W : ℂ → ℂ := lowerStripCappedGammaOuter ℓ R D let f : ℂ → ℂ := fun z => Complex.exp (-(W z)) * Z z let N : ℂ → ℝ := fun z => Real.exp (-(E z)) * ‖Z z‖ have hℓ : 0 < ℓ := half_pos (Nat.cast_pos.mpr hd) have hwidth : -ℓ < ℓ := by linarith have houter : DifferentiableOn ℂ W U := by exact lowerStripCappedGammaOuter_differentiableOn_dimension hd R D have hZdifferentiable : DifferentiableOn ℂ Z U := by exact (antiFourierWitness_normalizedMellinStrip_diffContOnCl hd w).differentiableOn have hf : DifferentiableOn ℂ f U := by exact houter.neg.cexp.mul hZdifferentiable have hclosure : closure U = S := by try dsimp [U, S] rw [Complex.closure_preimage_im, closure_Ioo (ne_of_lt hwidth)] have hZcontinuous : ContinuousOn Z S := by have hcont := (antiFourierWitness_normalizedMellinStrip_diffContOnCl hd w).continuousOn simpa [Z, U, hclosure, ℓ] using! hcont have hN : ContinuousOn N S := by try dsimp [N] exact hE.neg.rexp.mul hZcontinuous.norm have hnonnegative : ∀ z : ℂ, z.im ∈ Icc (-ℓ) ℓ → 0 ≤ N z := by intro z hz exact mul_nonneg (Real.exp_pos _).le (norm_nonneg _) have hinterior : ∀ z : ℂ, z.im ∈ Ioo (-ℓ) ℓ → N z = ‖f z‖ := by intro z hz have hreal := hEinterior z hz try dsimp [N, f, W, Z] rw [hreal, norm_mul, Complex.norm_exp, Complex.neg_re] have hbottom : ∀ z : ℂ, z.im = -ℓ → N z ≤ (1 : ℝ) := by intro z hz have hrepr : (z.re : ℂ) - Complex.I * (ℓ : ℂ) = z := by apply Complex.ext · simp · simp [hz] have hzbound : ‖Z z‖ ≤ Real.exp (lowerGammaBoundaryCapped ℓ R D z.re) := by rw [← hrepr] simpa [Z, ℓ] using! hcap z.re have hboundary := hEbottom z hz try dsimp [N] rw [hboundary] calc Real.exp (-(lowerGammaBoundaryCapped ℓ R D z.re)) * ‖Z z‖ ≤ Real.exp (-(lowerGammaBoundaryCapped ℓ R D z.re)) * Real.exp (lowerGammaBoundaryCapped ℓ R D z.re) := mul_le_mul_of_nonneg_left hzbound (Real.exp_pos _).le _ = 1 := by rw [← Real.exp_add] simp have htop : ∀ z : ℂ, z.im = ℓ → N z ≤ (1 : ℝ) := by intro z hz have hrepr : (z.re : ℂ) + Complex.I * (ℓ : ℂ) = z := by apply Complex.ext · simp · simp [hz] have hzbound : ‖Z z‖ ≤ (1 : ℝ) := by rw [← hrepr] exact antiFourierWitness_normalizedMellinStrip_top_norm_le_one hd w z.re try dsimp [N] rw [hEtop z hz] simpa using! hzbound let z : ℂ := (s : ℂ) + Complex.I * (((σ * ℓ : ℝ) : ℂ)) have hzbelow : -ℓ ≤ z.im := by try dsimp [z] simp only [Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.ofReal_re, zero_mul, Complex.I_im, one_mul, zero_add] nlinarith [mul_pos (show 0 < 1 + σ by linarith) hℓ] have hzabove : z.im ≤ ℓ := by try dsimp [z] simp only [Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.ofReal_re, zero_mul, Complex.I_im, one_mul, zero_add] nlinarith [mul_pos (show 0 < 1 - σ by linarith) hℓ] have hmax : N z ≤ (1 : ℝ) := horizontalStrip_norm_extension_majorization hwidth (by norm_num) f N hf hN hnonnegative hinterior hbottom htop (antiFourierWitness_cappedWeightedMellinStrip_growth hd w D) hzbelow hzabove have hzinterior : z.im ∈ Ioo (-ℓ) ℓ := by try dsimp [z] simp only [Set.mem_Ioo, Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.ofReal_re, zero_mul, Complex.I_im, one_mul, zero_add] constructor · nlinarith [mul_pos (show 0 < 1 + σ by linarith) hℓ] · nlinarith [mul_pos (show 0 < 1 - σ by linarith) hℓ] have hreal := hEinterior z hzinterior have hpoisson := lowerStripCappedGammaOuter_re_dimension (R := R) (D := D) hd hbelow habove s have hEz : E z = ∫ T : ℝ, stripPoissonKernel σ T * lowerGammaBoundaryCapped ℓ R D (s - ℓ * T) := by calc E z = (lowerStripCappedGammaOuter ℓ R D z).re := hreal _ = _ := by simpa [z, ℓ] using! hpoisson have hweighted : Real.exp (-(E z)) * ‖Z z‖ ≤ (1 : ℝ) := hmax have hscale := mul_le_mul_of_nonneg_left hweighted (Real.exp_pos (E z)).le have hfinal : ‖Z z‖ ≤ Real.exp (E z) := by convert! hscale using 1 · rw [← mul_assoc, ← Real.exp_add] simp · simp rw [hEz] at hfinal simpa [z, Z, ℓ] using! hfinal theorem exists_antiFourierWitness_capped_poisson_majorization {d : ℕ} (hd : 0 < d) {R : ℝ} (hR : 0 < R) (w : AntiFourierWitness d R) : ∃ D₀ : ℝ, ∀ D : ℝ, D₀ ≤ D → ∀ {σ : ℝ}, -1 < σ → σ < 1 → ∀ s : ℝ, ‖normalizedRadialMellinStrip hd w.function R ((s : ℂ) + Complex.I * (((σ * ((d : ℝ) / 2) : ℝ) : ℂ)))‖ ≤ Real.exp (∫ T : ℝ, stripPoissonKernel σ T * lowerGammaBoundaryCapped ((d : ℝ) / 2) R D (s - ((d : ℝ) / 2) * T)) := by obtain ⟨D₀, hbottom⟩ := exists_antiFourierWitness_eventually_capped_bottom_majorant hd hR w refine ⟨D₀, ?_⟩ intro D hD σ hbelow habove s apply antiFourierWitness_capped_poisson_majorization_of_real_extension hd w D (lowerStripCappedGammaHarmonic d R D) (lowerStripCappedGammaHarmonic_continuousOn hd R D) · intro z hz have hza : z.im ≠ -((d : ℝ) / 2) := ne_of_gt hz.1 have hzb : z.im ≠ (d : ℝ) / 2 := ne_of_lt hz.2 simp [lowerStripCappedGammaHarmonic, horizontalStripRealTraceExtension, hza, hzb] · intro z hz simp [lowerStripCappedGammaHarmonic, horizontalStripRealTraceExtension, hz] · intro z hz have hℓ : 0 < (d : ℝ) / 2 := half_pos (Nat.cast_pos.mpr hd) have hne : (d : ℝ) / 2 ≠ -((d : ℝ) / 2) := by linarith simp [lowerStripCappedGammaHarmonic, horizontalStripRealTraceExtension, hz, hne] · exact hbottom D hD · exact hbelow · exact habove end noncomputable section open Filter MeasureTheory Metric Set open scoped ENNReal Interval Topology theorem stripPoissonKernel_shifted_centered_interval_max {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) {r : ℝ} (hr : 0 ≤ r) (s : ℝ) : (∫ x in Icc (-r) r, stripPoissonKernel σ (s - x)) ≤ ∫ x in Icc (-r) r, stripPoissonKernel σ (0 - x) := by have hleft : (∫ x in Icc (-r) r, stripPoissonKernel σ (s - x)) = ∫ x in Icc (s - r) (s + r), stripPoissonKernel σ x := by rw [integral_Icc_eq_integral_Ioc, integral_Icc_eq_integral_Ioc, ← intervalIntegral.integral_of_le (by linarith : -r ≤ r), ← intervalIntegral.integral_of_le (by linarith : s - r ≤ s + r), intervalIntegral.integral_comp_sub_left] congr 1; ring have hright : (∫ x in Icc (-r) r, stripPoissonKernel σ (0 - x)) = ∫ x in Icc (-r) r, stripPoissonKernel σ x := by apply setIntegral_congr_fun measurableSet_Icc intro x hx simpa using! stripPoissonKernel_neg σ x rw [hleft, hright] exact stripPoissonKernel_centered_interval_max hbelow habove hr s def stripPoissonWeightedMeasure (σ s : ℝ) : Measure ℝ := (volume : Measure ℝ).withDensity (fun x : ℝ => ENNReal.ofReal (stripPoissonKernel σ (s - x))) theorem stripPoissonWeightedMeasure_apply_Icc {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) (s a b : ℝ) : stripPoissonWeightedMeasure σ s (Icc a b) = ENNReal.ofReal (∫ x in Icc a b, stripPoissonKernel σ (s - x)) := by unfold stripPoissonWeightedMeasure rw [MeasureTheory.withDensity_apply _ measurableSet_Icc] have hint : IntegrableOn (fun x : ℝ => stripPoissonKernel σ (s - x)) (Icc a b) := ((stripPoissonKernel_integrable hbelow habove).comp_sub_left s).integrableOn have hnonneg : 0 ≤ᵐ[(volume : Measure ℝ).restrict (Icc a b)] (fun x : ℝ => stripPoissonKernel σ (s - x)) := Filter.Eventually.of_forall (fun x => (stripPoissonKernel_pos hbelow habove (s - x)).le) exact (ofReal_integral_eq_lintegral_ofReal hint hnonneg).symm theorem stripPoissonWeightedMeasure_centered_interval_max {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) {r : ℝ} (hr : 0 ≤ r) (s : ℝ) : stripPoissonWeightedMeasure σ s (Icc (-r) r) ≤ stripPoissonWeightedMeasure σ 0 (Icc (-r) r) := by rw [stripPoissonWeightedMeasure_apply_Icc hbelow habove, stripPoissonWeightedMeasure_apply_Icc hbelow habove] exact ENNReal.ofReal_le_ofReal (stripPoissonKernel_shifted_centered_interval_max hbelow habove hr s) theorem stripPoissonWeightedMeasure_superlevel_le {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) {f : ℝ → ℝ} {B t : ℝ} (heven : ∀ x : ℝ, f (-x) = f x) (hanti : AntitoneOn f (Ici (0 : ℝ))) (hsupport : Function.support f ⊆ Icc (-B) B) (ht : 0 < t) (s : ℝ) : stripPoissonWeightedMeasure σ s {x : ℝ | t < f x} ≤ stripPoissonWeightedMeasure σ 0 {x : ℝ | t < f x} := by obtain ⟨r, hr, hinner, houter⟩ := even_antitone_superlevel_interval heven hanti hsupport ht have hinterval : stripPoissonWeightedMeasure σ 0 (Ioo (-r) r) = stripPoissonWeightedMeasure σ 0 (Icc (-r) r) := by unfold stripPoissonWeightedMeasure exact measure_congr Ioo_ae_eq_Icc calc stripPoissonWeightedMeasure σ s {x : ℝ | t < f x} ≤ stripPoissonWeightedMeasure σ s (Icc (-r) r) := measure_mono houter _ ≤ stripPoissonWeightedMeasure σ 0 (Icc (-r) r) := stripPoissonWeightedMeasure_centered_interval_max hbelow habove hr s _ = stripPoissonWeightedMeasure σ 0 (Ioo (-r) r) := hinterval.symm _ ≤ stripPoissonWeightedMeasure σ 0 {x : ℝ | t < f x} := measure_mono hinner theorem even_antitone_poisson_lintegral_max {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) {f : ℝ → ℝ} {B : ℝ} (hfmeas : Measurable f) (hfnonneg : ∀ x : ℝ, 0 ≤ f x) (heven : ∀ x : ℝ, f (-x) = f x) (hanti : AntitoneOn f (Ici (0 : ℝ))) (hsupport : Function.support f ⊆ Icc (-B) B) (s : ℝ) : (∫⁻ x : ℝ, ENNReal.ofReal (f x) ∂stripPoissonWeightedMeasure σ s) ≤ ∫⁻ x : ℝ, ENNReal.ofReal (f x) ∂stripPoissonWeightedMeasure σ 0 := by rw [lintegral_eq_lintegral_meas_lt (stripPoissonWeightedMeasure σ s) (Filter.Eventually.of_forall hfnonneg) hfmeas.aemeasurable, lintegral_eq_lintegral_meas_lt (stripPoissonWeightedMeasure σ 0) (Filter.Eventually.of_forall hfnonneg) hfmeas.aemeasurable] apply lintegral_mono_ae filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht exact stripPoissonWeightedMeasure_superlevel_le hbelow habove heven hanti hsupport ht s theorem stripPoissonKernel_weighted_product_integrable {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) {f : ℝ → ℝ} (hf : Integrable f) (s : ℝ) : Integrable (fun x : ℝ => stripPoissonKernel σ (s - x) * f x) := by have hkmeas : Measurable (fun x : ℝ => stripPoissonKernel σ (s - x)) := by unfold stripPoissonKernel stripAngle fun_prop have hmajor : Integrable (fun x : ℝ => stripPoissonKernel σ 0 * ‖f x‖) := hf.norm.const_mul (stripPoissonKernel σ 0) apply hmajor.mono' · exact hkmeas.aestronglyMeasurable.mul hf.aestronglyMeasurable · filter_upwards [] with x rw [norm_mul, Real.norm_eq_abs, abs_of_pos (stripPoissonKernel_pos hbelow habove (s - x))] exact mul_le_mul_of_nonneg_right (stripPoissonKernel_antitone_abs hbelow habove (x := 0) (y := s - x) (by simp)) (norm_nonneg _) theorem stripPoissonWeightedMeasure_integrable {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) {f : ℝ → ℝ} (hf : Integrable f) (s : ℝ) : Integrable f (stripPoissonWeightedMeasure σ s) := by have hkreal : Measurable (fun x : ℝ => stripPoissonKernel σ (s - x)) := by unfold stripPoissonKernel stripAngle fun_prop have hknn : Measurable (fun x : ℝ => Real.toNNReal (stripPoissonKernel σ (s - x))) := hkreal.real_toNNReal unfold stripPoissonWeightedMeasure change Integrable f ((volume : Measure ℝ).withDensity (fun x : ℝ => (Real.toNNReal (stripPoissonKernel σ (s - x)) : ℝ≥0∞))) apply (integrable_withDensity_iff_integrable_smul hknn).2 have hproduct := stripPoissonKernel_weighted_product_integrable hbelow habove hf s convert! hproduct using 1 ext x simp [NNReal.smul_def, Real.coe_toNNReal _ (stripPoissonKernel_pos hbelow habove (s - x)).le, smul_eq_mul] theorem stripPoissonWeightedMeasure_integral {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) (f : ℝ → ℝ) (s : ℝ) : (∫ x : ℝ, f x ∂stripPoissonWeightedMeasure σ s) = ∫ x : ℝ, stripPoissonKernel σ (s - x) * f x := by have hkreal : Measurable (fun x : ℝ => stripPoissonKernel σ (s - x)) := by unfold stripPoissonKernel stripAngle fun_prop have hk : Measurable (fun x : ℝ => ENNReal.ofReal (stripPoissonKernel σ (s - x))) := hkreal.ennreal_ofReal have hfinite : ∀ᵐ x : ℝ ∂volume, ENNReal.ofReal (stripPoissonKernel σ (s - x)) < ⊤ := Filter.Eventually.of_forall (fun x => ENNReal.ofReal_lt_top) unfold stripPoissonWeightedMeasure rw [integral_withDensity_eq_integral_toReal_smul hk hfinite] apply integral_congr_ae filter_upwards [] with x rw [ENNReal.toReal_ofReal (stripPoissonKernel_pos hbelow habove (s - x)).le] rfl theorem even_antitone_poisson_convolution_max {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) {f : ℝ → ℝ} {B : ℝ} (hf : Integrable f) (hfmeas : Measurable f) (hfnonneg : ∀ x : ℝ, 0 ≤ f x) (heven : ∀ x : ℝ, f (-x) = f x) (hanti : AntitoneOn f (Ici (0 : ℝ))) (hsupport : Function.support f ⊆ Icc (-B) B) (s : ℝ) : (∫ x : ℝ, stripPoissonKernel σ (s - x) * f x) ≤ ∫ x : ℝ, stripPoissonKernel σ (0 - x) * f x := by have hsint := stripPoissonWeightedMeasure_integrable hbelow habove hf s have hzero := stripPoissonWeightedMeasure_integrable hbelow habove hf 0 have hsnonneg : 0 ≤ᵐ[stripPoissonWeightedMeasure σ s] f := Filter.Eventually.of_forall hfnonneg have hzerononneg : 0 ≤ᵐ[stripPoissonWeightedMeasure σ 0] f := Filter.Eventually.of_forall hfnonneg have hlin := even_antitone_poisson_lintegral_max hbelow habove hfmeas hfnonneg heven hanti hsupport s rw [← ofReal_integral_eq_lintegral_ofReal hsint hsnonneg, ← ofReal_integral_eq_lintegral_ofReal hzero hzerononneg] at hlin have hcenter : 0 ≤ ∫ x : ℝ, f x ∂stripPoissonWeightedMeasure σ 0 := integral_nonneg hfnonneg have hreal := (ENNReal.ofReal_le_ofReal_iff hcenter).mp hlin rw [stripPoissonWeightedMeasure_integral hbelow habove, stripPoissonWeightedMeasure_integral hbelow habove] at hreal exact hreal theorem lowerGammaBoundaryCapped_dimension_neg {d : ℕ} (R D y : ℝ) : lowerGammaBoundaryCapped ((d : ℝ) / 2) R D (-y) = lowerGammaBoundaryCapped ((d : ℝ) / 2) R D y := by by_cases hy : y = 0 · simp [lowerGammaBoundaryCapped, hy] · simp [lowerGammaBoundaryCapped, hy, lowerGammaBoundaryLog_dimension_neg R hy] theorem lowerGammaBoundaryCapped_dimension_antitoneOn {d : ℕ} (R D : ℝ) : AntitoneOn (lowerGammaBoundaryCapped ((d : ℝ) / 2) R D) (Ici (0 : ℝ)) := by intro x hx y hy hxy change 0 ≤ x at hx change 0 ≤ y at hy by_cases hxzero : x = 0 · subst x unfold lowerGammaBoundaryCapped simp only [ite_true] split_ifs with hyzero · exact le_rfl · exact min_le_right _ _ · have hxpos : 0 < x := lt_of_le_of_ne hx (Ne.symm hxzero) have hypos : 0 < y := lt_of_lt_of_le hxpos hxy have hgamma := lowerGammaBoundaryLog_dimension_antitoneOn (d := d) R (show x ∈ Ioi (0 : ℝ) from hxpos) (show y ∈ Ioi (0 : ℝ) from hypos) hxy simp only [lowerGammaBoundaryCapped, if_neg hxpos.ne', if_neg hypos.ne'] exact min_le_min hgamma (le_refl D) theorem lowerGammaBoundaryLog_dimension_scaled_le_neg_of_large {d : ℕ} (hd : 2 ≤ d) {c Y n : ℝ} (hc : 0 < c) (hn : 0 ≤ n) (hlarge : max 1 (8 * Real.pi * c ^ 2 * Real.exp n) ≤ |Y|) : lowerGammaBoundaryLog ((d : ℝ) / 2) (c * Real.sqrt d) (((d : ℝ) / 2) * Y) ≤ -n := by have hyone : 1 ≤ |Y| := le_trans (le_max_left 1 _) hlarge have hY : Y ≠ 0 := by intro h norm_num [h] at hyone have hA : 0 < 4 * Real.pi * c ^ 2 := by positivity have hden : 0 < |Y| := abs_pos.mpr hY have hradius : 8 * Real.pi * c ^ 2 * Real.exp n ≤ |Y| := le_trans (le_max_right 1 _) hlarge have hexpcancel : Real.exp n * Real.exp (-n) = 1 := by rw [Real.exp_neg, mul_inv_cancel₀ (Real.exp_ne_zero n)] have hscaled := mul_le_mul_of_nonneg_right hradius (Real.exp_pos (-n)).le have hratio : 4 * Real.pi * c ^ 2 / |Y| ≤ (1 / 2 : ℝ) * Real.exp (-n) := by apply (div_le_iff₀ hden).2 nlinarith have hratio_pos : 0 < 4 * Real.pi * c ^ 2 / |Y| := div_pos hA hden have hlogratio : Real.log (4 * Real.pi * c ^ 2 / |Y|) ≤ -(Real.log (2 : ℝ)) - n := by calc Real.log (4 * Real.pi * c ^ 2 / |Y|) ≤ Real.log ((1 / 2 : ℝ) * Real.exp (-n)) := Real.log_le_log hratio_pos hratio _ = -(Real.log (2 : ℝ)) - n := by rw [Real.log_mul (by norm_num : (1 / 2 : ℝ) ≠ 0) (Real.exp_ne_zero _), Real.log_exp, one_div, Real.log_inv] ring have hlogtwo : (1 / 2 : ℝ) ≤ Real.log (2 : ℝ) := by have h := Real.one_sub_inv_le_log_of_pos (by norm_num : (0 : ℝ) < 2) norm_num at h ⊢ exact h have hpiabs : 3 ≤ Real.pi * |Y| := by nlinarith [Real.pi_gt_three, mul_nonneg (by linarith [Real.pi_gt_three] : 0 ≤ Real.pi - 3) (sub_nonneg.mpr hyone)] have harg : 1 ≤ Real.pi * |Y| / 2 := by linarith have hexpthree : 4 ≤ Real.exp (3 : ℝ) := by nlinarith [Real.add_one_le_exp (3 : ℝ)] have hexpsmall : Real.exp ((-Real.pi) * |Y|) ≤ (1 / 4 : ℝ) := by calc Real.exp ((-Real.pi) * |Y|) ≤ Real.exp (-3 : ℝ) := by apply Real.exp_le_exp.mpr nlinarith _ = (Real.exp (3 : ℝ))⁻¹ := Real.exp_neg 3 _ ≤ (1 / 4 : ℝ) := by simpa [one_div] using! (one_div_le_one_div_of_le (by norm_num : (0 : ℝ) < 4) hexpthree) have hcoth := lowerCoth_log_le_four_exp_neg_two harg have hexp : Real.exp (-2 * (Real.pi * |Y| / 2)) = Real.exp ((-Real.pi) * |Y|) := by congr 1 ring rw [hexp] at hcoth have hcorrection : (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * |Y| / 2)) ≤ (1 / 2 : ℝ) := by nlinarith have hℓ : 1 ≤ (d : ℝ) / 2 := by apply (le_div_iff₀ (by norm_num : (0 : ℝ) < 2)).2 exact_mod_cast hd have hlognonneg : 0 ≤ Real.log (2 : ℝ) + n := by linarith have hmain : ((d : ℝ) / 2) * Real.log (4 * Real.pi * c ^ 2 / |Y|) ≤ -(Real.log (2 : ℝ)) - n := by calc ((d : ℝ) / 2) * Real.log (4 * Real.pi * c ^ 2 / |Y|) ≤ ((d : ℝ) / 2) * (-(Real.log (2 : ℝ)) - n) := mul_le_mul_of_nonneg_left hlogratio (by positivity) _ ≤ -(Real.log (2 : ℝ)) - n := by nlinarith [mul_nonneg (sub_nonneg.mpr hℓ) hlognonneg] have htail := lowerGammaBoundaryLog_dimension_scaled_log_tail_uniform hd hc hY linarith def lowerGammaScaledCappedClipped (d : ℕ) (c D n Y : ℝ) : ℝ := max (lowerGammaBoundaryCapped ((d : ℝ) / 2) (c * Real.sqrt d) D (((d : ℝ) / 2) * Y) + n) 0 theorem lowerGammaScaledCappedClipped_continuous {d : ℕ} (hd : 0 < d) (c D n : ℝ) : Continuous (lowerGammaScaledCappedClipped d c D n) := by have hℓ : 0 < (d : ℝ) / 2 := half_pos (Nat.cast_pos.mpr hd) have hcap := lowerGammaBoundaryCapped_continuous hℓ (c * Real.sqrt d) D have hscale : Continuous (fun Y : ℝ => ((d : ℝ) / 2) * Y) := by fun_prop exact ((hcap.comp hscale).add continuous_const).max continuous_const theorem lowerGammaScaledCappedClipped_neg (d : ℕ) (c D n Y : ℝ) : lowerGammaScaledCappedClipped d c D n (-Y) = lowerGammaScaledCappedClipped d c D n Y := by unfold lowerGammaScaledCappedClipped have hmul : ((d : ℝ) / 2) * (-Y) = -(((d : ℝ) / 2) * Y) := by ring rw [hmul, lowerGammaBoundaryCapped_dimension_neg (c * Real.sqrt d) D (((d : ℝ) / 2) * Y)] theorem lowerGammaScaledCappedClipped_antitoneOn (d : ℕ) (c D n : ℝ) : AntitoneOn (lowerGammaScaledCappedClipped d c D n) (Ici (0 : ℝ)) := by intro x hx y hy hxy change 0 ≤ x at hx change 0 ≤ y at hy have hℓ : 0 ≤ (d : ℝ) / 2 := by positivity have hgamma := lowerGammaBoundaryCapped_dimension_antitoneOn (d := d) (c * Real.sqrt d) D (show ((d : ℝ) / 2) * x ∈ Ici (0 : ℝ) from mul_nonneg hℓ hx) (show ((d : ℝ) / 2) * y ∈ Ici (0 : ℝ) from mul_nonneg hℓ hy) (mul_le_mul_of_nonneg_left hxy hℓ) unfold lowerGammaScaledCappedClipped exact max_le_max (by linarith) (le_refl (0 : ℝ)) theorem lowerGammaScaledCappedClipped_support {d : ℕ} (hd : 2 ≤ d) {c D n : ℝ} (hc : 0 < c) (hn : 0 ≤ n) : Function.support (lowerGammaScaledCappedClipped d c D n) ⊆ Icc (-(max 1 (8 * Real.pi * c ^ 2 * Real.exp n))) (max 1 (8 * Real.pi * c ^ 2 * Real.exp n)) := by intro Y hY change lowerGammaScaledCappedClipped d c D n Y ≠ 0 at hY have hsmall : |Y| < max 1 (8 * Real.pi * c ^ 2 * Real.exp n) := by by_contra hnot have hlarge : max 1 (8 * Real.pi * c ^ 2 * Real.exp n) ≤ |Y| := le_of_not_gt hnot have hnonpos := lowerGammaBoundaryLog_dimension_scaled_le_neg_of_large hd hc hn hlarge have hyone : 1 ≤ |Y| := le_trans (le_max_left 1 _) hlarge have hyzero : Y ≠ 0 := by intro hzero norm_num [hzero] at hyone have hℓ : 0 < (d : ℝ) / 2 := by positivity have harg : ((d : ℝ) / 2) * Y ≠ 0 := mul_ne_zero hℓ.ne' hyzero apply hY unfold lowerGammaScaledCappedClipped rw [lowerGammaBoundaryCapped, if_neg harg] apply max_eq_right have hmin := min_le_left (lowerGammaBoundaryLog ((d : ℝ) / 2) (c * Real.sqrt d) (((d : ℝ) / 2) * Y)) D linarith exact ⟨(neg_lt_of_abs_lt hsmall).le, (lt_of_abs_lt hsmall).le⟩ theorem lowerGammaScaledCappedClipped_integrable {d : ℕ} (hd : 2 ≤ d) {c D n : ℝ} (hc : 0 < c) (hn : 0 ≤ n) : Integrable (lowerGammaScaledCappedClipped d c D n) := by have hdpos : 0 < d := lt_of_lt_of_le (by norm_num) hd apply (lowerGammaScaledCappedClipped_continuous hdpos c D n).integrable_of_hasCompactSupport exact HasCompactSupport.of_support_subset_isCompact isCompact_Icc (lowerGammaScaledCappedClipped_support hd hc hn) theorem lowerGammaScaledCappedClipped_poisson_convolution_max {d : ℕ} (hd : 2 ≤ d) {c D n σ : ℝ} (hc : 0 < c) (hn : 0 ≤ n) (hbelow : -1 < σ) (habove : σ < 1) (s : ℝ) : (∫ Y : ℝ, stripPoissonKernel σ (s - Y) * lowerGammaScaledCappedClipped d c D n Y) ≤ ∫ Y : ℝ, stripPoissonKernel σ (0 - Y) * lowerGammaScaledCappedClipped d c D n Y := by have hdpos : 0 < d := lt_of_lt_of_le (by norm_num) hd exact even_antitone_poisson_convolution_max hbelow habove (lowerGammaScaledCappedClipped_integrable hd hc hn) (lowerGammaScaledCappedClipped_continuous hdpos c D n).measurable (fun Y => le_max_right _ _) (lowerGammaScaledCappedClipped_neg d c D n) (lowerGammaScaledCappedClipped_antitoneOn d c D n) (lowerGammaScaledCappedClipped_support hd hc hn) s theorem lowerGammaScaledCapped_poisson_product_integrable {d : ℕ} (hd : 0 < d) {R D σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) (s : ℝ) : Integrable (fun Y : ℝ => stripPoissonKernel σ (s - Y) * lowerGammaBoundaryCapped ((d : ℝ) / 2) R D (((d : ℝ) / 2) * Y)) := by have hℓ : 0 < (d : ℝ) / 2 := half_pos (Nat.cast_pos.mpr hd) have hz : ((((d : ℝ) / 2) * s : ℝ) : ℂ) + Complex.I * ((σ * ((d : ℝ) / 2) : ℝ) : ℂ) ∈ Complex.im ⁻¹' Ioo (-((d : ℝ) / 2)) ((d : ℝ) / 2) := by simp only [Set.mem_preimage, Set.mem_Ioo, Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.ofReal_re, zero_mul, Complex.I_im, one_mul, zero_add] constructor · nlinarith [mul_pos (show 0 < 1 + σ by linarith) hℓ] · nlinarith [mul_pos (show 0 < 1 - σ by linarith) hℓ] have houter := lowerStripCappedGammaOuter_integrable_dimension hd (R := R) (D := D) hz have hreal := houter.re have hscaled := hreal.comp_mul_left' hℓ.ne' have hproduct := hscaled.const_mul ((d : ℝ) / 2) convert! hproduct using 1 ext Y change stripPoissonKernel σ (s - Y) * lowerGammaBoundaryCapped ((d : ℝ) / 2) R D (((d : ℝ) / 2) * Y) = ((d : ℝ) / 2) * (stripRegularizedHolomorphicPoissonKernel ((d : ℝ) / 2) (((((d : ℝ) / 2) * s : ℝ) : ℂ) + Complex.I * ((σ * ((d : ℝ) / 2) : ℝ) : ℂ)) (((d : ℝ) / 2) * Y) * (lowerGammaBoundaryCapped ((d : ℝ) / 2) R D (((d : ℝ) / 2) * Y) : ℂ)).re rw [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, mul_zero, sub_zero] rw [stripRegularizedHolomorphicPoissonKernel_re hℓ hbelow habove] have harg : (((d : ℝ) / 2) * s - ((d : ℝ) / 2) * Y) / ((d : ℝ) / 2) = s - Y := by field_simp [hℓ.ne'] rw [harg] field_simp [hℓ.ne'] theorem lowerGammaScaled_poisson_product_integrable {d : ℕ} (hd : 0 < d) {R σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) (s : ℝ) : Integrable (fun Y : ℝ => stripPoissonKernel σ (s - Y) * lowerGammaBoundaryLog ((d : ℝ) / 2) R (((d : ℝ) / 2) * Y)) := by have hℓ : 0 < (d : ℝ) / 2 := half_pos (Nat.cast_pos.mpr hd) have hz : ((((d : ℝ) / 2) * s : ℝ) : ℂ) + Complex.I * ((σ * ((d : ℝ) / 2) : ℝ) : ℂ) ∈ Complex.im ⁻¹' Ioo (-((d : ℝ) / 2)) ((d : ℝ) / 2) := by simp only [Set.mem_preimage, Set.mem_Ioo, Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.ofReal_re, zero_mul, Complex.I_im, one_mul, zero_add] constructor · nlinarith [mul_pos (show 0 < 1 + σ by linarith) hℓ] · nlinarith [mul_pos (show 0 < 1 - σ by linarith) hℓ] have houter := lowerStripGammaOuter_integrable_dimension hd (R := R) hz have hreal := houter.re have hscaled := hreal.comp_mul_left' hℓ.ne' have hproduct := hscaled.const_mul ((d : ℝ) / 2) convert! hproduct using 1 ext Y change stripPoissonKernel σ (s - Y) * lowerGammaBoundaryLog ((d : ℝ) / 2) R (((d : ℝ) / 2) * Y) = ((d : ℝ) / 2) * (stripRegularizedHolomorphicPoissonKernel ((d : ℝ) / 2) (((((d : ℝ) / 2) * s : ℝ) : ℂ) + Complex.I * ((σ * ((d : ℝ) / 2) : ℝ) : ℂ)) (((d : ℝ) / 2) * Y) * (lowerGammaBoundaryLog ((d : ℝ) / 2) R (((d : ℝ) / 2) * Y) : ℂ)).re rw [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, mul_zero, sub_zero] rw [stripRegularizedHolomorphicPoissonKernel_re hℓ hbelow habove] have harg : (((d : ℝ) / 2) * s - ((d : ℝ) / 2) * Y) / ((d : ℝ) / 2) = s - Y := by field_simp [hℓ.ne'] rw [harg] field_simp [hℓ.ne'] def lowerGammaScaledCappedLowerClip (d : ℕ) (c D n Y : ℝ) : ℝ := max (lowerGammaBoundaryCapped ((d : ℝ) / 2) (c * Real.sqrt d) D (((d : ℝ) / 2) * Y)) (-n) theorem lowerGammaScaledCappedClipped_eq_lowerClip_add (d : ℕ) (c D n Y : ℝ) : lowerGammaScaledCappedClipped d c D n Y = lowerGammaScaledCappedLowerClip d c D n Y + n := by unfold lowerGammaScaledCappedClipped lowerGammaScaledCappedLowerClip have h := max_add_add_right (lowerGammaBoundaryCapped ((d : ℝ) / 2) (c * Real.sqrt d) D (((d : ℝ) / 2) * Y)) (-n) n simpa using! h theorem lowerGammaScaledCappedLowerClip_poisson_integrable {d : ℕ} (hd : 0 < d) {c D n σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) (s : ℝ) : Integrable (fun Y : ℝ => stripPoissonKernel σ (s - Y) * lowerGammaScaledCappedLowerClip d c D n Y) := by have hbase := lowerGammaScaledCapped_poisson_product_integrable hd (R := c * Real.sqrt d) (D := D) hbelow habove s have hk := (stripPoissonKernel_integrable hbelow habove).comp_sub_left s have hconstant := hk.const_mul (-n) have hmax := hbase.sup hconstant convert! hmax using 1 ext Y change stripPoissonKernel σ (s - Y) * max (lowerGammaBoundaryCapped ((d : ℝ) / 2) (c * Real.sqrt d) D (((d : ℝ) / 2) * Y)) (-n) = max (stripPoissonKernel σ (s - Y) * lowerGammaBoundaryCapped ((d : ℝ) / 2) (c * Real.sqrt d) D (((d : ℝ) / 2) * Y)) (-n * stripPoissonKernel σ (s - Y)) rw [mul_max_of_nonneg _ _ (stripPoissonKernel_pos hbelow habove (s - Y)).le] ring_nf theorem lowerGammaScaledCappedClipped_integral_eq {d : ℕ} (hd : 0 < d) {c D n σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) (s : ℝ) : (∫ Y : ℝ, stripPoissonKernel σ (s - Y) * lowerGammaScaledCappedClipped d c D n Y) = (∫ Y : ℝ, stripPoissonKernel σ (s - Y) * lowerGammaScaledCappedLowerClip d c D n Y) + n * stripBottomMass σ := by have hclip := lowerGammaScaledCappedLowerClip_poisson_integrable hd (c := c) (D := D) (n := n) hbelow habove s have hk := (stripPoissonKernel_integrable hbelow habove).comp_sub_left s have hnkernel := hk.const_mul n calc (∫ Y : ℝ, stripPoissonKernel σ (s - Y) * lowerGammaScaledCappedClipped d c D n Y) = ∫ Y : ℝ, (stripPoissonKernel σ (s - Y) * lowerGammaScaledCappedLowerClip d c D n Y) + n * stripPoissonKernel σ (s - Y) := by apply integral_congr_ae filter_upwards [] with Y rw [lowerGammaScaledCappedClipped_eq_lowerClip_add] ring _ = (∫ Y : ℝ, stripPoissonKernel σ (s - Y) * lowerGammaScaledCappedLowerClip d c D n Y) + ∫ Y : ℝ, n * stripPoissonKernel σ (s - Y) := integral_add hclip hnkernel _ = (∫ Y : ℝ, stripPoissonKernel σ (s - Y) * lowerGammaScaledCappedLowerClip d c D n Y) + n * ∫ Y : ℝ, stripPoissonKernel σ (s - Y) := by rw [integral_const_mul] _ = (∫ Y : ℝ, stripPoissonKernel σ (s - Y) * lowerGammaScaledCappedLowerClip d c D n Y) + n * stripBottomMass σ := by rw [integral_sub_left_eq_self (stripPoissonKernel σ) volume s, integral_stripPoissonKernel hbelow habove] theorem lowerGammaScaledCappedLowerClip_poisson_convolution_max {d : ℕ} (hd : 2 ≤ d) {c D n σ : ℝ} (hc : 0 < c) (hn : 0 ≤ n) (hbelow : -1 < σ) (habove : σ < 1) (s : ℝ) : (∫ Y : ℝ, stripPoissonKernel σ (s - Y) * lowerGammaScaledCappedLowerClip d c D n Y) ≤ ∫ Y : ℝ, stripPoissonKernel σ (0 - Y) * lowerGammaScaledCappedLowerClip d c D n Y := by have hdpos : 0 < d := lt_of_lt_of_le (by norm_num) hd have hplus := lowerGammaScaledCappedClipped_poisson_convolution_max (D := D) hd hc hn hbelow habove s rw [lowerGammaScaledCappedClipped_integral_eq hdpos hbelow habove s, lowerGammaScaledCappedClipped_integral_eq hdpos hbelow habove 0] at hplus linarith theorem lowerGammaScaledCappedLowerClip_poisson_tendsto {d : ℕ} (hd : 0 < d) {c D σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) (s : ℝ) : Tendsto (fun n : ℕ => ∫ Y : ℝ, stripPoissonKernel σ (s - Y) * lowerGammaScaledCappedLowerClip d c D (n : ℝ) Y) atTop (𝓝 (∫ Y : ℝ, stripPoissonKernel σ (s - Y) * lowerGammaBoundaryCapped ((d : ℝ) / 2) (c * Real.sqrt d) D (((d : ℝ) / 2) * Y))) := by let b : ℝ → ℝ := fun Y => lowerGammaBoundaryCapped ((d : ℝ) / 2) (c * Real.sqrt d) D (((d : ℝ) / 2) * Y) let K : ℝ → ℝ := fun Y => stripPoissonKernel σ (s - Y) have hbase : Integrable (fun Y : ℝ => K Y * b Y) := lowerGammaScaledCapped_poisson_product_integrable hd (R := c * Real.sqrt d) (D := D) hbelow habove s apply tendsto_integral_of_dominated_convergence (fun Y : ℝ => |K Y * b Y|) · intro n exact (lowerGammaScaledCappedLowerClip_poisson_integrable hd (c := c) (D := D) (n := (n : ℝ)) hbelow habove s).aestronglyMeasurable · exact hbase.abs · intro n filter_upwards [] with Y have hn : 0 ≤ (n : ℝ) := Nat.cast_nonneg n have hclip : |max (b Y) (-(n : ℝ))| ≤ |b Y| := by rcases le_total (b Y) (-(n : ℝ)) with hle | hle · rw [max_eq_right hle, abs_of_nonpos (neg_nonpos.mpr hn), abs_of_nonpos (le_trans hle (neg_nonpos.mpr hn))] linarith · rw [max_eq_left hle] change ‖K Y * max (b Y) (-(n : ℝ))‖ ≤ |K Y * b Y| rw [Real.norm_eq_abs, abs_mul, abs_mul] exact mul_le_mul_of_nonneg_left hclip (abs_nonneg (K Y)) · filter_upwards [] with Y have ht : Tendsto (fun n : ℕ => -(n : ℝ)) atTop atBot := Filter.tendsto_neg_atTop_atBot.comp (tendsto_natCast_atTop_atTop (R := ℝ)) have hevent : ∀ᶠ n : ℕ in atTop, -(n : ℝ) ≤ b Y := ht.eventually (Iic_mem_atBot (b Y)) apply tendsto_const_nhds.congr' filter_upwards [hevent] with n hn change K Y * b Y = K Y * max (b Y) (-(n : ℝ)) rw [max_eq_left hn] theorem lowerGammaScaledCapped_poisson_convolution_max {d : ℕ} (hd : 2 ≤ d) {c D σ : ℝ} (hc : 0 < c) (hbelow : -1 < σ) (habove : σ < 1) (s : ℝ) : (∫ Y : ℝ, stripPoissonKernel σ (s - Y) * lowerGammaBoundaryCapped ((d : ℝ) / 2) (c * Real.sqrt d) D (((d : ℝ) / 2) * Y)) ≤ ∫ Y : ℝ, stripPoissonKernel σ (0 - Y) * lowerGammaBoundaryCapped ((d : ℝ) / 2) (c * Real.sqrt d) D (((d : ℝ) / 2) * Y) := by have hdpos : 0 < d := lt_of_lt_of_le (by norm_num) hd exact le_of_tendsto_of_tendsto (lowerGammaScaledCappedLowerClip_poisson_tendsto hdpos hbelow habove s) (lowerGammaScaledCappedLowerClip_poisson_tendsto hdpos hbelow habove 0) (Filter.Eventually.of_forall (fun n : ℕ => lowerGammaScaledCappedLowerClip_poisson_convolution_max hd hc (Nat.cast_nonneg n) hbelow habove s)) theorem lowerGammaScaledCapped_poisson_tendsto {d : ℕ} (hd : 0 < d) {c σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) (s : ℝ) : Tendsto (fun n : ℕ => ∫ Y : ℝ, stripPoissonKernel σ (s - Y) * lowerGammaBoundaryCapped ((d : ℝ) / 2) (c * Real.sqrt d) (n : ℝ) (((d : ℝ) / 2) * Y)) atTop (𝓝 (∫ Y : ℝ, stripPoissonKernel σ (s - Y) * lowerGammaBoundaryLog ((d : ℝ) / 2) (c * Real.sqrt d) (((d : ℝ) / 2) * Y))) := by have hℓ : 0 < (d : ℝ) / 2 := half_pos (Nat.cast_pos.mpr hd) let b : ℝ → ℝ := fun Y => lowerGammaBoundaryLog ((d : ℝ) / 2) (c * Real.sqrt d) (((d : ℝ) / 2) * Y) let K : ℝ → ℝ := fun Y => stripPoissonKernel σ (s - Y) have hbase : Integrable (fun Y : ℝ => K Y * b Y) := lowerGammaScaled_poisson_product_integrable hd (R := c * Real.sqrt d) hbelow habove s apply tendsto_integral_of_dominated_convergence (fun Y : ℝ => |K Y * b Y|) · intro n exact (lowerGammaScaledCapped_poisson_product_integrable hd (R := c * Real.sqrt d) (D := (n : ℝ)) hbelow habove s).aestronglyMeasurable · exact hbase.abs · intro n filter_upwards [Measure.ae_ne (volume : Measure ℝ) 0] with Y hY have harg : ((d : ℝ) / 2) * Y ≠ 0 := mul_ne_zero hℓ.ne' hY have hn : 0 ≤ (n : ℝ) := Nat.cast_nonneg n have hclip : |min (b Y) (n : ℝ)| ≤ |b Y| := by rcases le_total (b Y) (n : ℝ) with hle | hle · rw [min_eq_left hle] · rw [min_eq_right hle, abs_of_nonneg hn, abs_of_nonneg (le_trans hn hle)] exact hle change ‖K Y * lowerGammaBoundaryCapped ((d : ℝ) / 2) (c * Real.sqrt d) (n : ℝ) (((d : ℝ) / 2) * Y)‖ ≤ |K Y * b Y| rw [lowerGammaBoundaryCapped, if_neg harg, Real.norm_eq_abs, abs_mul, abs_mul] exact mul_le_mul_of_nonneg_left hclip (abs_nonneg (K Y)) · filter_upwards [Measure.ae_ne (volume : Measure ℝ) 0] with Y hY have harg : ((d : ℝ) / 2) * Y ≠ 0 := mul_ne_zero hℓ.ne' hY have ht : Tendsto (fun n : ℕ => (n : ℝ)) atTop atTop := tendsto_natCast_atTop_atTop (R := ℝ) have hevent : ∀ᶠ n : ℕ in atTop, b Y ≤ (n : ℝ) := ht.eventually (Ici_mem_atTop (b Y)) apply tendsto_const_nhds.congr' filter_upwards [hevent] with n hn change K Y * b Y = K Y * lowerGammaBoundaryCapped ((d : ℝ) / 2) (c * Real.sqrt d) (n : ℝ) (((d : ℝ) / 2) * Y) rw [lowerGammaBoundaryCapped, if_neg harg, min_eq_left hn] theorem lowerGammaScaled_poisson_convolution_max {d : ℕ} (hd : 2 ≤ d) {c σ : ℝ} (hc : 0 < c) (hbelow : -1 < σ) (habove : σ < 1) (s : ℝ) : (∫ Y : ℝ, stripPoissonKernel σ (s - Y) * lowerGammaBoundaryLog ((d : ℝ) / 2) (c * Real.sqrt d) (((d : ℝ) / 2) * Y)) ≤ ∫ Y : ℝ, stripPoissonKernel σ (0 - Y) * lowerGammaBoundaryLog ((d : ℝ) / 2) (c * Real.sqrt d) (((d : ℝ) / 2) * Y) := by have hdpos : 0 < d := lt_of_lt_of_le (by norm_num) hd exact le_of_tendsto_of_tendsto (lowerGammaScaledCapped_poisson_tendsto (c := c) hdpos hbelow habove s) (lowerGammaScaledCapped_poisson_tendsto (c := c) hdpos hbelow habove 0) (Filter.Eventually.of_forall (fun n : ℕ => lowerGammaScaledCapped_poisson_convolution_max (D := (n : ℝ)) hd hc hbelow habove s)) theorem lowerStripPoissonMajorant_scaled_convolution {ℓ : ℝ} (hℓ : 0 < ℓ) (R σ s : ℝ) : lowerStripPoissonMajorant ℓ R σ s = ∫ Y : ℝ, stripPoissonKernel σ (s / ℓ - Y) * lowerGammaBoundaryLog ℓ R (ℓ * Y) := by let f : ℝ → ℝ := fun Y => stripPoissonKernel σ (s / ℓ - Y) * lowerGammaBoundaryLog ℓ R (ℓ * Y) calc lowerStripPoissonMajorant ℓ R σ s = ∫ T : ℝ, f (s / ℓ - T) := by unfold lowerStripPoissonMajorant apply integral_congr_ae filter_upwards [] with T try dsimp [f] have harg : s / ℓ - (s / ℓ - T) = T := by ring rw [harg] congr 1 field_simp [hℓ.ne'] _ = ∫ Y : ℝ, f Y := integral_sub_left_eq_self f volume (s / ℓ) theorem lowerStripPoissonMajorant_dimension_centered_max {d : ℕ} (hd : 2 ≤ d) {c σ : ℝ} (hc : 0 < c) (hbelow : -1 < σ) (habove : σ < 1) (s : ℝ) : lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt d) σ s ≤ lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt d) σ 0 := by have hℓ : 0 < (d : ℝ) / 2 := by positivity rw [lowerStripPoissonMajorant_scaled_convolution hℓ (c * Real.sqrt d) σ s, lowerStripPoissonMajorant_scaled_convolution hℓ (c * Real.sqrt d) σ 0] simp only [zero_div] exact lowerGammaScaled_poisson_convolution_max hd hc hbelow habove (s / ((d : ℝ) / 2)) theorem lowerRiemannLog_zero (T : ℝ) : lowerRiemannLog T 0 = Real.log (|T| / 2) := by unfold lowerRiemannLog have hsqrt : Real.sqrt (T ^ 2 / 4) = |T| / 2 := by rw [show T ^ 2 / 4 = (T / 2) ^ 2 by ring, Real.sqrt_sq_eq_abs, abs_div] norm_num simp [hsqrt] theorem lowerRiemannLog_scaled_factor {ℓ T : ℝ} (hℓ : 0 < ℓ) (j : ℝ) : Real.sqrt (j ^ 2 + (ℓ * T / 2) ^ 2) = ℓ * Real.sqrt ((j / ℓ) ^ 2 + T ^ 2 / 4) := by have hinside : j ^ 2 + (ℓ * T / 2) ^ 2 = ℓ ^ 2 * ((j / ℓ) ^ 2 + T ^ 2 / 4) := by field_simp [hℓ.ne'] ring rw [hinside, Real.sqrt_mul (sq_nonneg ℓ), Real.sqrt_sq_eq_abs, abs_of_pos hℓ] theorem lowerGammaBoundaryLog_integer_scaled {k : ℕ} (hk : 0 < k) {R T : ℝ} (hR : 0 < R) (hT : T ≠ 0) : lowerGammaBoundaryLog (k : ℝ) R ((k : ℝ) * T) = (k : ℝ) * Real.log (Real.pi * R ^ 2 / (k : ℝ)) - ∑ j ∈ Finset.range k, lowerRiemannLog T ((j : ℝ) / (k : ℝ)) := by have hkreal : 0 < (k : ℝ) := Nat.cast_pos.mpr hk have hy : (k : ℝ) * T ≠ 0 := mul_ne_zero hkreal.ne' hT rw [lowerGammaBoundaryLog_integer k R hy] have hterm (j : ℕ) : Real.log (Real.sqrt ((j : ℝ) ^ 2 + (((k : ℝ) * T) / 2) ^ 2)) = Real.log (k : ℝ) + lowerRiemannLog T ((j : ℝ) / (k : ℝ)) := by rw [lowerRiemannLog_scaled_factor hkreal] have hrad : 0 < ((j : ℝ) / (k : ℝ)) ^ 2 + T ^ 2 / 4 := by nlinarith [sq_nonneg ((j : ℝ) / (k : ℝ)), sq_pos_of_ne_zero hT] rw [Real.log_mul hkreal.ne' (Real.sqrt_pos.mpr hrad).ne'] rfl simp_rw [hterm] rw [Finset.sum_add_distrib] have hsum : (∑ _j ∈ Finset.range k, Real.log (k : ℝ)) = (k : ℝ) * Real.log (k : ℝ) := by simp rw [hsum] rw [Real.log_div (show Real.pi * R ^ 2 ≠ 0 by positivity) hkreal.ne'] simp only [div_eq_mul_inv] ring theorem lowerGammaBoundaryLog_halfInteger_scaled (k : ℕ) {ℓ R T : ℝ} (hℓeq : ℓ = (k : ℝ) + 1 / 2) (hR : 0 < R) (hT : T ≠ 0) : lowerGammaBoundaryLog ℓ R (ℓ * T) = ℓ * Real.log (Real.pi * R ^ 2 / ℓ) - ∑ j ∈ Finset.range k, lowerRiemannLog T (((j : ℝ) + 1 / 2) / ℓ) + (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * ℓ * |T| / 2)) - (1 / 2 : ℝ) * Real.log (|T| / 2) := by have hℓ : 0 < ℓ := by rw [hℓeq] positivity have hy : ℓ * T ≠ 0 := mul_ne_zero hℓ.ne' hT have hraw := lowerGammaBoundaryLog_halfInteger k R hy rw [← hℓeq] at hraw rw [hraw] have hterm (j : ℕ) : Real.log (Real.sqrt (((j : ℝ) + 1 / 2) ^ 2 + (ℓ * T / 2) ^ 2)) = Real.log ℓ + lowerRiemannLog T (((j : ℝ) + 1 / 2) / ℓ) := by rw [lowerRiemannLog_scaled_factor hℓ] have hrad : 0 < (((j : ℝ) + 1 / 2) / ℓ) ^ 2 + T ^ 2 / 4 := by nlinarith [sq_nonneg (((j : ℝ) + 1 / 2) / ℓ), sq_pos_of_ne_zero hT] rw [Real.log_mul hℓ.ne' (Real.sqrt_pos.mpr hrad).ne'] rfl simp_rw [hterm] rw [Finset.sum_add_distrib] have hsum : (∑ _j ∈ Finset.range k, Real.log ℓ) = (k : ℝ) * Real.log ℓ := by simp rw [hsum] have habs : |ℓ * T| = ℓ * |T| := by rw [abs_mul, abs_of_pos hℓ] rw [habs] have harg : Real.pi * (ℓ * |T|) / 2 = Real.pi * ℓ * |T| / 2 := by ring rw [harg] have ht : 0 < |T| / 2 := by positivity have hcoth : 0 < lowerCoth (Real.pi * ℓ * |T| / 2) := by apply lowerCoth_pos positivity have hden : ℓ * |T| / 2 = ℓ * (|T| / 2) := by ring rw [hden, Real.log_div hcoth.ne' (mul_ne_zero hℓ.ne' ht.ne'), Real.log_mul hℓ.ne' ht.ne'] rw [Real.log_div (show Real.pi * R ^ 2 ≠ 0 by positivity) hℓ.ne'] rw [hℓeq] ring theorem lowerRiemannLog_continuous {T : ℝ} (hT : T ≠ 0) : Continuous (lowerRiemannLog T) := by have hrad (x : ℝ) : 0 < x ^ 2 + T ^ 2 / 4 := by nlinarith [sq_nonneg x, sq_pos_of_ne_zero hT] have hsqrt : Continuous (fun x : ℝ => Real.sqrt (x ^ 2 + T ^ 2 / 4)) := by fun_prop unfold lowerRiemannLog exact hsqrt.log (fun x => (Real.sqrt_pos.mpr (hrad x)).ne') def lowerRiemannErrorMajorant (T : ℝ) : ℝ := 3 * |lowerRiemannLog T 0| + 2 * |lowerRiemannLog T 1| + (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * |T| / 2)) theorem lowerGammaBoundaryLog_integer_riemann_le {k : ℕ} (hk : 0 < k) {R T : ℝ} (hR : 0 < R) (hT : T ≠ 0) : lowerGammaBoundaryLog (k : ℝ) R ((k : ℝ) * T) ≤ (k : ℝ) * (Real.log (Real.pi * R ^ 2 / (k : ℝ)) + 1 + lowerEndpointPhase T) + lowerRiemannErrorMajorant T := by rw [lowerGammaBoundaryLog_integer_scaled hk hR hT] have hriemann := (lower_integer_leftRiemann_error hT hk).2 have hphase := integral_lowerRiemannLog hT have hcoth := lowerCoth_log_nonneg (show 0 < Real.pi * |T| / 2 by positivity) unfold lowerRiemannErrorMajorant nlinarith [le_abs_self (lowerRiemannLog T 1), neg_le_abs (lowerRiemannLog T 0), abs_nonneg (lowerRiemannLog T 0), abs_nonneg (lowerRiemannLog T 1)] theorem lowerRiemannLog_halfInteger_tail_integral_le (k : ℕ) {ℓ T : ℝ} (hℓeq : ℓ = (k : ℝ) + 1 / 2) (hT : T ≠ 0) : ℓ * (∫ x in ((k : ℝ) / ℓ)..1, lowerRiemannLog T x) ≤ (1 / 2 : ℝ) * lowerRiemannLog T 1 := by have hℓ : 0 < ℓ := by rw [hℓeq] positivity have hratio_nonneg : 0 ≤ (k : ℝ) / ℓ := by positivity have hratio_le : (k : ℝ) / ℓ ≤ 1 := by apply (div_le_one hℓ).2 rw [hℓeq] linarith have hcont := lowerRiemannLog_continuous hT have hint : IntervalIntegrable (lowerRiemannLog T) volume ((k : ℝ) / ℓ) 1 := hcont.intervalIntegrable _ _ have hconst : IntervalIntegrable (fun _ : ℝ => lowerRiemannLog T 1) volume ((k : ℝ) / ℓ) 1 := intervalIntegrable_const have hmono : (∫ x in ((k : ℝ) / ℓ)..1, lowerRiemannLog T x) ≤ ∫ _x in ((k : ℝ) / ℓ)..1, lowerRiemannLog T 1 := by apply intervalIntegral.integral_mono_on hratio_le hint hconst intro x hx apply lowerRiemannLog_monotoneOn hT · exact (show x ∈ Ici (0 : ℝ) from le_trans hratio_nonneg hx.1) · exact (show (1 : ℝ) ∈ Ici (0 : ℝ) by norm_num) · exact hx.2 rw [intervalIntegral.integral_const, smul_eq_mul] at hmono have hscaled := mul_le_mul_of_nonneg_left hmono hℓ.le have hfactor : ℓ * (1 - (k : ℝ) / ℓ) = (1 / 2 : ℝ) := by field_simp [hℓ.ne'] rw [hℓeq] ring calc ℓ * (∫ x in ((k : ℝ) / ℓ)..1, lowerRiemannLog T x) ≤ ℓ * ((1 - (k : ℝ) / ℓ) * lowerRiemannLog T 1) := hscaled _ = (1 / 2 : ℝ) * lowerRiemannLog T 1 := by rw [← mul_assoc, hfactor] theorem lowerGammaBoundaryLog_halfInteger_riemann_le (k : ℕ) {ℓ R T : ℝ} (hℓeq : ℓ = (k : ℝ) + 1 / 2) (hℓone : 1 ≤ ℓ) (hR : 0 < R) (hT : T ≠ 0) : lowerGammaBoundaryLog ℓ R (ℓ * T) ≤ ℓ * (Real.log (Real.pi * R ^ 2 / ℓ) + 1 + lowerEndpointPhase T) + lowerRiemannErrorMajorant T := by have hℓ : 0 < ℓ := by linarith have hratio_nonneg : 0 ≤ (k : ℝ) / ℓ := by positivity have hratio_le : (k : ℝ) / ℓ ≤ 1 := by apply (div_le_one hℓ).2 rw [hℓeq] linarith let q : ℝ → ℝ := lowerRiemannLog T have hcont := lowerRiemannLog_continuous hT have hfirst : IntervalIntegrable q volume (0 : ℝ) ((k : ℝ) / ℓ) := hcont.intervalIntegrable _ _ have hlast : IntervalIntegrable q volume ((k : ℝ) / ℓ) 1 := hcont.intervalIntegrable _ _ have hsplit : (∫ x in (0 : ℝ)..((k : ℝ) / ℓ), q x) + (∫ x in ((k : ℝ) / ℓ)..1, q x) = ∫ x in (0 : ℝ)..1, q x := intervalIntegral.integral_add_adjacent_intervals hfirst hlast have hmid := lower_halfInteger_midpointRiemann_error hT hℓ k have hmidupper : ℓ * (∫ x in (0 : ℝ)..((k : ℝ) / ℓ), q x) - ∑ j ∈ Finset.range k, q (((j : ℝ) + 1 / 2) / ℓ) ≤ q ((k : ℝ) / ℓ) - q 0 := by exact le_trans (le_abs_self _) hmid have htail := lowerRiemannLog_halfInteger_tail_integral_le k hℓeq hT have hsumupper : -(∑ j ∈ Finset.range k, q (((j : ℝ) + 1 / 2) / ℓ)) ≤ -ℓ * (∫ x in (0 : ℝ)..1, q x) + (q ((k : ℝ) / ℓ) - q 0) + (1 / 2 : ℝ) * q 1 := by nlinarith have hqk : q ((k : ℝ) / ℓ) ≤ q 1 := by apply lowerRiemannLog_monotoneOn hT · exact (show (k : ℝ) / ℓ ∈ Ici (0 : ℝ) from hratio_nonneg) · exact (show (1 : ℝ) ∈ Ici (0 : ℝ) by norm_num) · exact hratio_le have harg : 0 < Real.pi * |T| / 2 := by positivity have hargℓ : 0 < Real.pi * ℓ * |T| / 2 := by positivity have hargorder : Real.pi * |T| / 2 ≤ Real.pi * ℓ * |T| / 2 := by nlinarith [mul_nonneg (sub_nonneg.mpr hℓone) (mul_nonneg Real.pi_pos.le (abs_nonneg T))] have hcoth := lowerCoth_log_antitoneOn harg hargℓ hargorder have hphase := integral_lowerRiemannLog hT rw [lowerGammaBoundaryLog_halfInteger_scaled k hℓeq hR hT, ← lowerRiemannLog_zero T] unfold lowerRiemannErrorMajorant change ℓ * Real.log (Real.pi * R ^ 2 / ℓ) - ∑ j ∈ Finset.range k, q (((j : ℝ) + 1 / 2) / ℓ) + (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * ℓ * |T| / 2)) - (1 / 2 : ℝ) * q 0 ≤ ℓ * (Real.log (Real.pi * R ^ 2 / ℓ) + 1 + lowerEndpointPhase T) + (3 * |q 0| + 2 * |q 1| + (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * |T| / 2))) change -(∫ x in (0 : ℝ)..1, q x) = 1 + lowerEndpointPhase T at hphase nlinarith [le_abs_self (q 1), neg_le_abs (q 0), abs_nonneg (q 0), abs_nonneg (q 1)] theorem lowerGammaBoundaryLog_dimension_riemann_le {d : ℕ} (hd : 2 ≤ d) {R T : ℝ} (hR : 0 < R) (hT : T ≠ 0) : lowerGammaBoundaryLog ((d : ℝ) / 2) R (((d : ℝ) / 2) * T) ≤ ((d : ℝ) / 2) * (Real.log (Real.pi * R ^ 2 / ((d : ℝ) / 2)) + 1 + lowerEndpointPhase T) + lowerRiemannErrorMajorant T := by rcases d.even_or_odd with ⟨k, rfl⟩ | ⟨k, rfl⟩ · have hk : 0 < k := by omega have hq : ((↑(k + k) : ℝ) / 2) = (k : ℝ) := by push_cast ring rw [hq] exact lowerGammaBoundaryLog_integer_riemann_le hk hR hT · have hk : 0 < k := by omega have hq : ((↑(2 * k + 1) : ℝ) / 2) = (k : ℝ) + 1 / 2 := by push_cast ring rw [hq] apply lowerGammaBoundaryLog_halfInteger_riemann_le k rfl · have hkre : 1 ≤ (k : ℝ) := by exact_mod_cast hk linarith · exact hR · exact hT theorem lowerGammaBoundaryLog_dimension_scaled_riemann_le {d : ℕ} (hd : 2 ≤ d) {c T : ℝ} (hc : 0 < c) (hT : T ≠ 0) : lowerGammaBoundaryLog ((d : ℝ) / 2) (c * Real.sqrt d) (((d : ℝ) / 2) * T) ≤ ((d : ℝ) / 2) * (Real.log (2 * Real.pi * Real.exp 1 * c ^ 2) + lowerEndpointPhase T) + lowerRiemannErrorMajorant T := by have hdpos : 0 < d := lt_of_lt_of_le (by norm_num) hd have hdreal : 0 < (d : ℝ) := Nat.cast_pos.mpr hdpos have hR : 0 < c * Real.sqrt d := mul_pos hc (Real.sqrt_pos.mpr hdreal) have hratio : Real.pi * (c * Real.sqrt d) ^ 2 / ((d : ℝ) / 2) = 2 * Real.pi * c ^ 2 := by rw [mul_pow, Real.sq_sqrt hdreal.le] field_simp [hdreal.ne'] have hconstant : Real.log (2 * Real.pi * c ^ 2) + 1 = Real.log (2 * Real.pi * Real.exp 1 * c ^ 2) := by have hfactor : 2 * Real.pi * Real.exp 1 * c ^ 2 = (2 * Real.pi * c ^ 2) * Real.exp 1 := by ring rw [hfactor, Real.log_mul (show 2 * Real.pi * c ^ 2 ≠ 0 by positivity) (Real.exp_ne_zero _), Real.log_exp] have h := lowerGammaBoundaryLog_dimension_riemann_le hd hR hT rw [hratio] at h calc lowerGammaBoundaryLog ((d : ℝ) / 2) (c * Real.sqrt d) (((d : ℝ) / 2) * T) ≤ ((d : ℝ) / 2) * (Real.log (2 * Real.pi * c ^ 2) + 1 + lowerEndpointPhase T) + lowerRiemannErrorMajorant T := h _ = ((d : ℝ) / 2) * (Real.log (2 * Real.pi * Real.exp 1 * c ^ 2) + lowerEndpointPhase T) + lowerRiemannErrorMajorant T := by rw [← hconstant] theorem stripPoissonKernel_le_mass_mul_exponential {σ : ℝ} (hzero : 0 ≤ σ) (habove : σ < 1) (T : ℝ) : stripPoissonKernel σ T ≤ stripBottomMass σ * stripPoissonExponentialMajorant T := by have hbelow : -1 < σ := by linarith have hmass := stripBottomMass_pos habove have hnormalize := stripNormalizedPoissonKernel_eq_extension hbelow habove T have hbound := stripNormalizedPoissonExtension_le_majorant hzero habove.le T have hquotient : stripPoissonKernel σ T / stripBottomMass σ ≤ stripPoissonExponentialMajorant T := by change stripNormalizedPoissonKernel σ T ≤ stripPoissonExponentialMajorant T rw [hnormalize] exact hbound.2 have h := (div_le_iff₀ hmass).mp hquotient nlinarith theorem stripPoissonExponentialMajorant_abs_moment_integrable : Integrable (fun T : ℝ => stripPoissonExponentialMajorant T * |T|) := by have hmoment := integrable_abs_pow_mul_exp_neg_mul_abs 1 (half_pos Real.pi_pos) have hscaled := hmoment.const_mul (Real.pi / 2) convert! hscaled using 1 ext T simp [stripPoissonExponentialMajorant] ring theorem stripPoissonKernel_abs_moment_integrable {σ : ℝ} (hzero : 0 ≤ σ) (habove : σ < 1) : Integrable (fun T : ℝ => stripPoissonKernel σ T * |T|) := by have hbelow : -1 < σ := by linarith have hmajor := stripPoissonExponentialMajorant_abs_moment_integrable.const_mul (stripBottomMass σ) have habsmeas : Measurable (fun T : ℝ => |T|) := by fun_prop apply hmajor.mono' ((stripPoissonKernel_integrable hbelow habove).aestronglyMeasurable.mul habsmeas.aestronglyMeasurable) filter_upwards [] with T change ‖stripPoissonKernel σ T * |T|‖ ≤ stripBottomMass σ * (stripPoissonExponentialMajorant T * |T|) rw [Real.norm_eq_abs, abs_mul, abs_of_pos (stripPoissonKernel_pos hbelow habove T), abs_abs] calc stripPoissonKernel σ T * |T| ≤ (stripBottomMass σ * stripPoissonExponentialMajorant T) * |T| := mul_le_mul_of_nonneg_right (stripPoissonKernel_le_mass_mul_exponential hzero habove T) (abs_nonneg T) _ = stripBottomMass σ * (stripPoissonExponentialMajorant T * |T|) := by ring theorem stripPoissonKernel_mul_lowerRiemannLog_zero_integrable {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) : Integrable (fun T : ℝ => stripPoissonKernel σ T * lowerRiemannLog T 0) := by have hgamma0 := lowerGammaScaled_poisson_product_integrable (d := 2) (by norm_num : 0 < (2 : ℕ)) (R := (1 : ℝ)) hbelow habove 0 have hgamma : Integrable (fun T : ℝ => stripPoissonKernel σ T * lowerGammaBoundaryLog 1 1 T) := by apply hgamma0.congr filter_upwards [] with T norm_num [stripPoissonKernel_neg] have hk := stripPoissonKernel_integrable hbelow habove have hconst := hk.const_mul (Real.log Real.pi) have hdifference := hconst.sub hgamma apply hdifference.congr filter_upwards [Measure.ae_ne (volume : Measure ℝ) 0] with T hT have hidentity : lowerGammaBoundaryLog 1 1 T = Real.log Real.pi - lowerRiemannLog T 0 := by simpa using! (lowerGammaBoundaryLog_integer_scaled (k := 1) (by norm_num) (R := (1 : ℝ)) (by norm_num) hT) change Real.log Real.pi * stripPoissonKernel σ T - stripPoissonKernel σ T * lowerGammaBoundaryLog 1 1 T = stripPoissonKernel σ T * lowerRiemannLog T 0 rw [hidentity] ring theorem lowerRiemannLog_one_nonneg_le (T : ℝ) : 0 ≤ lowerRiemannLog T 1 ∧ lowerRiemannLog T 1 ≤ |T| / 2 := by have hrad : 0 < (1 : ℝ) + T ^ 2 / 4 := by nlinarith [sq_nonneg T] have hsqrtone : 1 ≤ Real.sqrt ((1 : ℝ) + T ^ 2 / 4) := by apply (Real.le_sqrt (by norm_num) hrad.le).2 nlinarith [sq_nonneg T] have hsqrtupper : Real.sqrt ((1 : ℝ) + T ^ 2 / 4) ≤ 1 + |T| / 2 := by apply Real.sqrt_le_iff.mpr constructor · positivity · nlinarith [abs_nonneg T, sq_abs T] unfold lowerRiemannLog simp only [one_pow] constructor · exact Real.log_nonneg hsqrtone · have hlog := Real.log_le_sub_one_of_pos (Real.sqrt_pos.mpr hrad) linarith theorem lowerRiemannLog_one_continuous : Continuous (fun T : ℝ => lowerRiemannLog T 1) := by have hrad (T : ℝ) : 0 < (1 : ℝ) + T ^ 2 / 4 := by nlinarith [sq_nonneg T] have hsqrt : Continuous (fun T : ℝ => Real.sqrt ((1 : ℝ) + T ^ 2 / 4)) := by fun_prop have h := hsqrt.log (fun T => (Real.sqrt_pos.mpr (hrad T)).ne') simpa [lowerRiemannLog] using! h theorem stripPoissonKernel_mul_abs_lowerRiemannLog_one_integrable {σ : ℝ} (hzero : 0 ≤ σ) (habove : σ < 1) : Integrable (fun T : ℝ => stripPoissonKernel σ T * |lowerRiemannLog T 1|) := by have hbelow : -1 < σ := by linarith have hmoment := stripPoissonKernel_abs_moment_integrable hzero habove have hmajor := hmoment.const_mul (1 / 2 : ℝ) have hmeas := (stripPoissonKernel_integrable hbelow habove).aestronglyMeasurable.mul lowerRiemannLog_one_continuous.abs.aestronglyMeasurable apply hmajor.mono' hmeas filter_upwards [] with T have hq := lowerRiemannLog_one_nonneg_le T change ‖stripPoissonKernel σ T * |lowerRiemannLog T 1|‖ ≤ (1 / 2 : ℝ) * (stripPoissonKernel σ T * |T|) rw [Real.norm_eq_abs, abs_mul, abs_of_pos (stripPoissonKernel_pos hbelow habove T), abs_abs, abs_of_nonneg hq.1] nlinarith [mul_nonneg (stripPoissonKernel_pos hbelow habove T).le (sub_nonneg.mpr hq.2)] theorem stripPoissonKernel_mul_abs_lowerRiemannLog_zero_integrable {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) : Integrable (fun T : ℝ => stripPoissonKernel σ T * |lowerRiemannLog T 0|) := by have h := (stripPoissonKernel_mul_lowerRiemannLog_zero_integrable hbelow habove).abs apply h.congr filter_upwards [] with T rw [abs_mul, abs_of_pos (stripPoissonKernel_pos hbelow habove T)] theorem stripPoissonKernel_mul_coth_log_integrable {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) : Integrable (fun T : ℝ => stripPoissonKernel σ T * Real.log (lowerCoth (Real.pi * |T| / 2))) := by have h := stripPoissonKernel_weighted_product_integrable hbelow habove lowerCoth_log_abs_integrable 0 apply h.congr filter_upwards [] with T rw [zero_sub, stripPoissonKernel_neg] theorem lowerRiemannErrorMajorant_poisson_integrable {σ : ℝ} (hzero : 0 ≤ σ) (habove : σ < 1) : Integrable (fun T : ℝ => stripPoissonKernel σ T * lowerRiemannErrorMajorant T) := by have hbelow : -1 < σ := by linarith have hqzero := (stripPoissonKernel_mul_abs_lowerRiemannLog_zero_integrable hbelow habove).const_mul (3 : ℝ) have hone := (stripPoissonKernel_mul_abs_lowerRiemannLog_one_integrable hzero habove).const_mul (2 : ℝ) have hcoth := (stripPoissonKernel_mul_coth_log_integrable hbelow habove).const_mul (1 / 2 : ℝ) have hsum := hqzero.add (hone.add hcoth) convert! hsum using 1 ext T change stripPoissonKernel σ T * lowerRiemannErrorMajorant T = 3 * (stripPoissonKernel σ T * |lowerRiemannLog T 0|) + (2 * (stripPoissonKernel σ T * |lowerRiemannLog T 1|) + (1 / 2 : ℝ) * (stripPoissonKernel σ T * Real.log (lowerCoth (Real.pi * |T| / 2)))) unfold lowerRiemannErrorMajorant ring theorem stripPoissonKernel_mul_lowerEndpointPhase_integrable {σ : ℝ} (hzero : 0 ≤ σ) (habove : σ < 1) : Integrable (fun T : ℝ => stripPoissonKernel σ T * lowerEndpointPhase T) := by have hbelow : -1 < σ := by linarith have hmajor := stripPoissonExponentialMajorant_mul_lowerEndpointPhase_integrable.const_mul (stripBottomMass σ) have hmeas := (stripPoissonKernel_integrable hbelow habove).aestronglyMeasurable.mul lowerEndpointPhase_continuous.aestronglyMeasurable apply hmajor.mono' hmeas filter_upwards [] with T change ‖stripPoissonKernel σ T * lowerEndpointPhase T‖ ≤ stripBottomMass σ * (stripPoissonExponentialMajorant T * ‖lowerEndpointPhase T‖) rw [norm_mul, Real.norm_eq_abs, abs_of_pos (stripPoissonKernel_pos hbelow habove T)] calc stripPoissonKernel σ T * ‖lowerEndpointPhase T‖ ≤ (stripBottomMass σ * stripPoissonExponentialMajorant T) * ‖lowerEndpointPhase T‖ := mul_le_mul_of_nonneg_right (stripPoissonKernel_le_mass_mul_exponential hzero habove T) (norm_nonneg _) _ = stripBottomMass σ * (stripPoissonExponentialMajorant T * ‖lowerEndpointPhase T‖) := by ring theorem integral_stripPoissonKernel_mul_lowerEndpointPhase {σ : ℝ} (habove : σ < 1) : (∫ T : ℝ, stripPoissonKernel σ T * lowerEndpointPhase T) = stripBottomMass σ * lowerPoissonEndpointExpectation σ := by have hmass : stripBottomMass σ ≠ 0 := (stripBottomMass_pos habove).ne' unfold lowerPoissonEndpointExpectation stripNormalizedPoissonKernel rw [← integral_const_mul] apply integral_congr_ae filter_upwards [] with T field_simp [hmass] def lowerRiemannPoissonError (σ : ℝ) : ℝ := ∫ T : ℝ, stripPoissonKernel σ T * lowerRiemannErrorMajorant T theorem lowerStripPoissonMajorant_dimension_central_bound {d : ℕ} (hd : 2 ≤ d) {c σ : ℝ} (hc : 0 < c) (hzero : 0 ≤ σ) (habove : σ < 1) : lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt d) σ 0 ≤ ((d : ℝ) / 2) * stripBottomMass σ * (Real.log (2 * Real.pi * Real.exp 1 * c ^ 2) + lowerPoissonEndpointExpectation σ) + lowerRiemannPoissonError σ := by have hbelow : -1 < σ := by linarith have hdpos : 0 < d := lt_of_lt_of_le (by norm_num) hd have hℓ : 0 < (d : ℝ) / 2 := half_pos (Nat.cast_pos.mpr hdpos) let ℓ : ℝ := (d : ℝ) / 2 let A : ℝ := Real.log (2 * Real.pi * Real.exp 1 * c ^ 2) let K : ℝ → ℝ := stripPoissonKernel σ let q : ℝ → ℝ := lowerEndpointPhase let E : ℝ → ℝ := lowerRiemannErrorMajorant have hleft0 := lowerGammaScaled_poisson_product_integrable hdpos (R := c * Real.sqrt d) hbelow habove 0 have hleft : Integrable (fun T : ℝ => K T * lowerGammaBoundaryLog ℓ (c * Real.sqrt d) (ℓ * T)) := by simpa only [zero_sub, stripPoissonKernel_neg] using! hleft0 have hk : Integrable K := stripPoissonKernel_integrable hbelow habove have hq : Integrable (fun T : ℝ => K T * q T) := stripPoissonKernel_mul_lowerEndpointPhase_integrable hzero habove have hE : Integrable (fun T : ℝ => K T * E T) := lowerRiemannErrorMajorant_poisson_integrable hzero habove have hconstant := hk.const_mul (ℓ * A) have hphaseterm := hq.const_mul ℓ have hsum := hconstant.add (hphaseterm.add hE) have hright : Integrable (fun T : ℝ => K T * (ℓ * (A + q T) + E T)) := by convert! hsum using 1 ext T change K T * (ℓ * (A + q T) + E T) = (ℓ * A) * K T + (ℓ * (K T * q T) + K T * E T) ring have hmono : (∫ T : ℝ, K T * lowerGammaBoundaryLog ℓ (c * Real.sqrt d) (ℓ * T)) ≤ ∫ T : ℝ, K T * (ℓ * (A + q T) + E T) := by apply integral_mono_ae hleft hright filter_upwards [Measure.ae_ne (volume : Measure ℝ) 0] with T hT apply mul_le_mul_of_nonneg_left (lowerGammaBoundaryLog_dimension_scaled_riemann_le hd hc hT) (stripPoissonKernel_pos hbelow habove T).le have heval : (∫ T : ℝ, K T * (ℓ * (A + q T) + E T)) = ℓ * stripBottomMass σ * (A + lowerPoissonEndpointExpectation σ) + lowerRiemannPoissonError σ := by calc (∫ T : ℝ, K T * (ℓ * (A + q T) + E T)) = ∫ T : ℝ, (ℓ * A) * K T + (ℓ * (K T * q T) + K T * E T) := by apply integral_congr_ae filter_upwards [] with T ring _ = (∫ T : ℝ, (ℓ * A) * K T) + ((∫ T : ℝ, ℓ * (K T * q T)) + ∫ T : ℝ, K T * E T) := by have hfirst := integral_add hconstant (hphaseterm.add hE) have hsecond := integral_add hphaseterm hE simpa only [Pi.add_apply] using! hfirst.trans (congrArg (fun x : ℝ => (∫ T : ℝ, (ℓ * A) * K T) + x) hsecond) _ = ℓ * stripBottomMass σ * (A + lowerPoissonEndpointExpectation σ) + lowerRiemannPoissonError σ := by rw [integral_const_mul, integral_const_mul, integral_stripPoissonKernel hbelow habove, integral_stripPoissonKernel_mul_lowerEndpointPhase habove] change (ℓ * A) * stripBottomMass σ + (ℓ * (stripBottomMass σ * lowerPoissonEndpointExpectation σ) + lowerRiemannPoissonError σ) = _ ring rw [lowerStripPoissonMajorant_scaled_convolution hℓ (c * Real.sqrt d) σ 0] simp only [zero_div, zero_sub, stripPoissonKernel_neg] exact hmono.trans_eq heval theorem exists_lowerStripPoissonMajorant_uniform_negative {c : ℝ} (hc : 0 < c) (hsharp : c < Real.pi⁻¹) : ∃ σ γ : ℝ, 0 < σ ∧ σ < 1 ∧ 0 < γ ∧ ∀ᶠ d : ℕ in atTop, ∀ s : ℝ, lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt d) σ s ≤ -γ * ((d : ℝ) / 2) := by have hnegative := eventually_lowerPoissonEndpointSharpCoefficient_neg hc hsharp have hpositive : ∀ᶠ σ : ℝ in 𝓝[<] (1 : ℝ), 0 < σ := Filter.Eventually.filter_mono nhdsWithin_le_nhds (eventually_gt_nhds (show (0 : ℝ) < 1 by norm_num)) have hless : ∀ᶠ σ : ℝ in 𝓝[<] (1 : ℝ), σ < 1 := self_mem_nhdsWithin obtain ⟨σ, hσpos, hσless, hσnegative⟩ := (hpositive.and (hless.and hnegative)).exists have hmass := stripBottomMass_pos hσless let A : ℝ := Real.log (2 * Real.pi * Real.exp 1 * c ^ 2) + lowerPoissonEndpointExpectation σ have hA : A < 0 := hσnegative let γ : ℝ := -(stripBottomMass σ * A) / 2 have hγ : 0 < γ := by try dsimp [γ] nlinarith [mul_neg_of_pos_of_neg hmass hA] have hscale : Tendsto (fun d : ℕ => (d : ℝ) / 2) atTop atTop := by have hcast := tendsto_natCast_atTop_atTop (R := ℝ) have hmul := hcast.atTop_mul_const (by norm_num : (0 : ℝ) < 1 / 2) convert! hmul using 1 ext d ring have hγscale : Tendsto (fun d : ℕ => γ * ((d : ℝ) / 2)) atTop atTop := by have hmul := hscale.atTop_mul_const hγ convert! hmul using 1 ext d ring have herror : ∀ᶠ d : ℕ in atTop, lowerRiemannPoissonError σ ≤ γ * ((d : ℝ) / 2) := hγscale.eventually (Ici_mem_atTop (lowerRiemannPoissonError σ)) refine ⟨σ, γ, hσpos, hσless, hγ, ?_⟩ filter_upwards [eventually_ge_atTop (2 : ℕ), herror] with d hd hderr intro s have hcenter := lowerStripPoissonMajorant_dimension_centered_max hd hc (by linarith) hσless s have hbound := lowerStripPoissonMajorant_dimension_central_bound hd hc hσpos.le hσless calc lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt d) σ s ≤ lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt d) σ 0 := hcenter _ ≤ ((d : ℝ) / 2) * stripBottomMass σ * A + lowerRiemannPoissonError σ := hbound _ ≤ -γ * ((d : ℝ) / 2) := by try dsimp [γ] at hderr ⊢ nlinarith theorem lowerCoth_log_half_le_of_one_le_abs {Y : ℝ} (hY : 1 ≤ |Y|) : (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * |Y| / 2)) ≤ (1 / 2 : ℝ) := by have hpiabs : 3 ≤ Real.pi * |Y| := by nlinarith [Real.pi_gt_three, mul_nonneg (by linarith [Real.pi_gt_three] : 0 ≤ Real.pi - 3) (sub_nonneg.mpr hY)] have harg : 1 ≤ Real.pi * |Y| / 2 := by linarith have hexpthree : 4 ≤ Real.exp (3 : ℝ) := by nlinarith [Real.add_one_le_exp (3 : ℝ)] have hexpsmall : Real.exp ((-Real.pi) * |Y|) ≤ (1 / 4 : ℝ) := by calc Real.exp ((-Real.pi) * |Y|) ≤ Real.exp (-3 : ℝ) := by apply Real.exp_le_exp.mpr nlinarith _ = (Real.exp (3 : ℝ))⁻¹ := Real.exp_neg 3 _ ≤ (1 / 4 : ℝ) := by simpa [one_div] using! (one_div_le_one_div_of_le (by norm_num : (0 : ℝ) < 4) hexpthree) have hcoth := lowerCoth_log_le_four_exp_neg_two harg have hexp : Real.exp (-2 * (Real.pi * |Y| / 2)) = Real.exp ((-Real.pi) * |Y|) := by congr 1 ring rw [hexp] at hcoth nlinarith theorem lowerGammaBoundaryLog_dimension_scaled_log_tail_simple {d : ℕ} (hd : 2 ≤ d) {c Y : ℝ} (hc : 0 < c) (hY : 1 ≤ |Y|) : lowerGammaBoundaryLog ((d : ℝ) / 2) (c * Real.sqrt d) (((d : ℝ) / 2) * Y) ≤ ((d : ℝ) / 2) * Real.log (4 * Real.pi * Real.exp 1 * c ^ 2 / |Y|) := by have hyzero : Y ≠ 0 := by intro hzero norm_num [hzero] at hY have htail := lowerGammaBoundaryLog_dimension_scaled_log_tail_uniform hd hc hyzero have hcorr := lowerCoth_log_half_le_of_one_le_abs hY have hℓ : 1 ≤ (d : ℝ) / 2 := by apply (le_div_iff₀ (by norm_num : (0 : ℝ) < 2)).2 exact_mod_cast hd have hlog : Real.log (4 * Real.pi * Real.exp 1 * c ^ 2 / |Y|) = Real.log (4 * Real.pi * c ^ 2 / |Y|) + 1 := by have hfactor : 4 * Real.pi * Real.exp 1 * c ^ 2 / |Y| = (4 * Real.pi * c ^ 2 / |Y|) * Real.exp 1 := by field_simp [abs_ne_zero.mpr hyzero] rw [hfactor, Real.log_mul (show 4 * Real.pi * c ^ 2 / |Y| ≠ 0 by positivity) (Real.exp_ne_zero _), Real.log_exp] rw [hlog] nlinarith def stripPoissonCoreMass (σ : ℝ) : ℝ := ∫ T in Icc (-1 : ℝ) 1, stripPoissonKernel σ T theorem stripPoissonCoreMass_pos {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) : 0 < stripPoissonCoreMass σ := by have hk := stripPoissonKernel_integrable hbelow habove have hkone := stripPoissonKernel_pos hbelow habove 1 have hconstant : IntegrableOn (fun _T : ℝ => stripPoissonKernel σ 1) (Icc (-1 : ℝ) 1) := (continuous_const : Continuous (fun _T : ℝ => stripPoissonKernel σ 1)).integrableOn_Icc have hcompare : (∫ _T in Icc (-1 : ℝ) 1, stripPoissonKernel σ 1) ≤ ∫ T in Icc (-1 : ℝ) 1, stripPoissonKernel σ T := by apply setIntegral_mono_on hconstant hk.integrableOn measurableSet_Icc intro T hT apply stripPoissonKernel_antitone_abs hbelow habove rw [abs_of_pos (by norm_num : (0 : ℝ) < 1)] exact (abs_le).mpr hT have hvalue : (∫ _T in Icc (-1 : ℝ) 1, stripPoissonKernel σ 1) = 2 * stripPoissonKernel σ 1 := by norm_num rw [hvalue] at hcompare unfold stripPoissonCoreMass nlinarith theorem lowerGammaScaledPositivePart_poisson_exponential_tail {d : ℕ} (hd : 2 ≤ d) {c σ C S : ℝ} (hc : 0 < c) (hσ : 0 ≤ σ) (hσone : σ < 1) (hC : 0 < C) (hsupport : Function.support (lowerGammaScaledPositivePart d c) ⊆ Icc (-C) C) (hmass : (∫ Y : ℝ, lowerGammaScaledPositivePart d c Y) ≤ C * ((d : ℝ) / 2)) (hS : C ≤ S) : (∫ Y : ℝ, stripPoissonKernel σ (S - Y) * lowerGammaScaledPositivePart d c Y) ≤ (stripBottomMass σ * (Real.pi / 2) * Real.exp (-(Real.pi / 2) * (S - C))) * (C * ((d : ℝ) / 2)) := by have hbelow : -1 < σ := by linarith let E : ℝ := stripBottomMass σ * (Real.pi / 2) * Real.exp (-(Real.pi / 2) * (S - C)) have hE : 0 ≤ E := by apply (mul_nonneg_iff_of_pos_right hC).mp try dsimp [E] exact mul_nonneg (mul_nonneg (mul_nonneg (stripBottomMass_pos hσone).le (by positivity)) (Real.exp_pos _).le) hC.le have hp := lowerGammaScaledPositivePart_integrable hd hc have hweighted := stripPoissonKernel_weighted_product_integrable hbelow hσone hp S have hmajor : Integrable (fun Y : ℝ => E * lowerGammaScaledPositivePart d c Y) := hp.const_mul E calc (∫ Y : ℝ, stripPoissonKernel σ (S - Y) * lowerGammaScaledPositivePart d c Y) ≤ ∫ Y : ℝ, E * lowerGammaScaledPositivePart d c Y := by apply integral_mono_ae hweighted hmajor filter_upwards [] with Y by_cases hzero : lowerGammaScaledPositivePart d c Y = 0 · simp [hzero] · have hY := hsupport hzero have hdist : S - C ≤ |S - Y| := by rw [abs_of_nonneg (by linarith [hY.2] : 0 ≤ S - Y)] linarith [hY.2] have hexp : Real.exp (-(Real.pi / 2) * |S - Y|) ≤ Real.exp (-(Real.pi / 2) * (S - C)) := by apply Real.exp_le_exp.mpr nlinarith [Real.pi_pos] have hkernel : stripPoissonKernel σ (S - Y) ≤ E := by calc stripPoissonKernel σ (S - Y) ≤ stripBottomMass σ * stripPoissonExponentialMajorant (S - Y) := stripPoissonKernel_le_mass_mul_exponential hσ hσone (S - Y) _ = stripBottomMass σ * ((Real.pi / 2) * Real.exp (-(Real.pi / 2) * |S - Y|)) := by rfl _ ≤ stripBottomMass σ * ((Real.pi / 2) * Real.exp (-(Real.pi / 2) * (S - C))) := by apply mul_le_mul_of_nonneg_left · exact mul_le_mul_of_nonneg_left hexp (by positivity) · exact (stripBottomMass_pos hσone).le _ = E := by try dsimp [E] ring exact mul_le_mul_of_nonneg_right hkernel (le_max_right _ _) _ = E * (∫ Y : ℝ, lowerGammaScaledPositivePart d c Y) := by rw [integral_const_mul] _ ≤ E * (C * ((d : ℝ) / 2)) := mul_le_mul_of_nonneg_left hmass hE _ = (stripBottomMass σ * (Real.pi / 2) * Real.exp (-(Real.pi / 2) * (S - C))) * (C * ((d : ℝ) / 2)) := by rfl theorem lowerStripPoissonMajorant_core_tail_split {d : ℕ} (hd : 2 ≤ d) {c σ S : ℝ} (hc : 0 < c) (hσ : 0 ≤ σ) (hσone : σ < 1) (hS : 2 ≤ S) : lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt d) σ (((d : ℝ) / 2) * S) ≤ (((d : ℝ) / 2) * Real.log ((8 * Real.pi * Real.exp 1 * c ^ 2) / S)) * stripPoissonCoreMass σ + ∫ Y : ℝ, stripPoissonKernel σ (S - Y) * lowerGammaScaledPositivePart d c Y := by have hbelow : -1 < σ := by linarith have hdpos : 0 < d := lt_of_lt_of_le (by norm_num) hd have hℓ : 0 < (d : ℝ) / 2 := by positivity have hSpos : 0 < S := by linarith let ℓ : ℝ := (d : ℝ) / 2 let P : ℝ := 4 * Real.pi * Real.exp 1 * c ^ 2 let A : ℝ := 8 * Real.pi * Real.exp 1 * c ^ 2 let L : ℝ := ℓ * Real.log (A / S) let b : ℝ → ℝ := fun Y => lowerGammaBoundaryLog ℓ (c * Real.sqrt d) (ℓ * Y) let p : ℝ → ℝ := lowerGammaScaledPositivePart d c have hP : 0 < P := by try dsimp [P] positivity have hA : A = 2 * P := by try dsimp [A, P] ring have hb_integrable : Integrable (fun T : ℝ => stripPoissonKernel σ T * b (S - T)) := by have hbase := lowerGammaScaled_poisson_product_integrable hdpos (R := c * Real.sqrt d) hbelow hσone S have hcomp := hbase.comp_sub_left S convert! hcomp using 1 ext T try dsimp [b, ℓ] congr 1; ring_nf have hp_integrable : Integrable (fun T : ℝ => stripPoissonKernel σ T * p (S - T)) := by have hbase := stripPoissonKernel_weighted_product_integrable hbelow hσone (lowerGammaScaledPositivePart_integrable hd hc) S have hcomp := hbase.comp_sub_left S convert! hcomp using 1 ext T try dsimp [p] congr 1; ring_nf have hcore_integrable : Integrable (fun T : ℝ => stripPoissonKernel σ T * (Icc (-1 : ℝ) 1).indicator (fun _ : ℝ => L) T) := by have hbase := ((stripPoissonKernel_integrable hbelow hσone).const_mul L).indicator (s := Icc (-1 : ℝ) 1) measurableSet_Icc convert! hbase using 1 ext T by_cases hT : T ∈ Icc (-1 : ℝ) 1 · simp [hT] ring · simp [hT] have hnear : ∀ T ∈ Icc (-1 : ℝ) 1, b (S - T) ≤ L := by intro T hT have hdiff : 0 < S - T := by linarith [hT.2] have hlarge : 1 ≤ |S - T| := by rw [abs_of_pos hdiff] linarith [hT.2] have hratio : P / |S - T| ≤ A / S := by apply (div_le_div_iff₀ (abs_pos.mpr hdiff.ne') hSpos).2 rw [abs_of_pos hdiff, hA] nlinarith [mul_nonneg hP.le (show 0 ≤ S - 2 * T by linarith [hT.2])] have hlog : Real.log (P / |S - T|) ≤ Real.log (A / S) := by apply Real.log_le_log (by positivity) exact hratio have htail := lowerGammaBoundaryLog_dimension_scaled_log_tail_simple hd hc hlarge change b (S - T) ≤ ℓ * Real.log (P / |S - T|) at htail change b (S - T) ≤ ℓ * Real.log (A / S) exact htail.trans (mul_le_mul_of_nonneg_left hlog hℓ.le) have hpointwise : ∀ T : ℝ, stripPoissonKernel σ T * b (S - T) ≤ stripPoissonKernel σ T * (Icc (-1 : ℝ) 1).indicator (fun _ : ℝ => L) T + stripPoissonKernel σ T * p (S - T) := by intro T have hkernel := (stripPoissonKernel_pos hbelow hσone T).le have hpnonneg : 0 ≤ p (S - T) := by try dsimp [p, lowerGammaScaledPositivePart] exact le_max_right _ _ have hb_le_p : b (S - T) ≤ p (S - T) := by try dsimp [b, p, ℓ, lowerGammaScaledPositivePart] exact le_max_left _ _ by_cases hT : T ∈ Icc (-1 : ℝ) 1 · simp only [Set.indicator_of_mem hT] have h := hnear T hT nlinarith [mul_nonneg hkernel hpnonneg, mul_nonneg hkernel (sub_nonneg.mpr h)] · simp only [Set.indicator_of_notMem hT, mul_zero, zero_add] exact mul_le_mul_of_nonneg_left hb_le_p hkernel have hcore_integral : (∫ T : ℝ, stripPoissonKernel σ T * (Icc (-1 : ℝ) 1).indicator (fun _ : ℝ => L) T) = L * stripPoissonCoreMass σ := by calc (∫ T : ℝ, stripPoissonKernel σ T * (Icc (-1 : ℝ) 1).indicator (fun _ : ℝ => L) T) = ∫ T : ℝ, (Icc (-1 : ℝ) 1).indicator (fun T => L * stripPoissonKernel σ T) T := by apply integral_congr_ae filter_upwards [] with T by_cases hT : T ∈ Icc (-1 : ℝ) 1 · simp [hT] ring · simp [hT] _ = ∫ T in Icc (-1 : ℝ) 1, L * stripPoissonKernel σ T := by rw [integral_indicator measurableSet_Icc] _ = L * stripPoissonCoreMass σ := by rw [integral_const_mul] rfl have hpositive_integral : (∫ T : ℝ, stripPoissonKernel σ T * p (S - T)) = ∫ Y : ℝ, stripPoissonKernel σ (S - Y) * lowerGammaScaledPositivePart d c Y := by let f : ℝ → ℝ := fun T => stripPoissonKernel σ T * p (S - T) calc (∫ T : ℝ, stripPoissonKernel σ T * p (S - T)) = ∫ T : ℝ, f T := by rfl _ = ∫ Y : ℝ, f (S - Y) := (integral_sub_left_eq_self f volume S).symm _ = ∫ Y : ℝ, stripPoissonKernel σ (S - Y) * lowerGammaScaledPositivePart d c Y := by apply integral_congr_ae filter_upwards [] with Y try dsimp [f, p] congr 1 ring_nf have hrepresentation : lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt d) σ (((d : ℝ) / 2) * S) = ∫ T : ℝ, stripPoissonKernel σ T * b (S - T) := by rw [lowerStripPoissonMajorant_scaled_convolution hℓ (c * Real.sqrt d) σ] have hscale : (((d : ℝ) / 2) * S / ((d : ℝ) / 2)) = S := by field_simp [hℓ.ne'] rw [hscale] let f : ℝ → ℝ := fun T => stripPoissonKernel σ T * b (S - T) calc (∫ Y : ℝ, stripPoissonKernel σ (S - Y) * lowerGammaBoundaryLog ((d : ℝ) / 2) (c * Real.sqrt d) (((d : ℝ) / 2) * Y)) = ∫ Y : ℝ, f (S - Y) := by apply integral_congr_ae filter_upwards [] with Y try dsimp [f, b, ℓ] congr 1 ring_nf _ = ∫ T : ℝ, f T := integral_sub_left_eq_self f volume S _ = ∫ T : ℝ, stripPoissonKernel σ T * b (S - T) := by rfl rw [hrepresentation] calc (∫ T : ℝ, stripPoissonKernel σ T * b (S - T)) ≤ ∫ T : ℝ, (stripPoissonKernel σ T * (Icc (-1 : ℝ) 1).indicator (fun _ : ℝ => L) T + stripPoissonKernel σ T * p (S - T)) := by apply integral_mono_ae hb_integrable (hcore_integrable.add hp_integrable) exact Filter.Eventually.of_forall hpointwise _ = L * stripPoissonCoreMass σ + ∫ Y : ℝ, stripPoissonKernel σ (S - Y) * lowerGammaScaledPositivePart d c Y := by rw [integral_add hcore_integrable hp_integrable, hcore_integral, hpositive_integral] _ = (((d : ℝ) / 2) * Real.log ((8 * Real.pi * Real.exp 1 * c ^ 2) / S)) * stripPoissonCoreMass σ + ∫ Y : ℝ, stripPoissonKernel σ (S - Y) * lowerGammaScaledPositivePart d c Y := by rfl theorem lowerStripPoissonMajorant_dimension_neg {d : ℕ} (hd : 0 < d) (R σ s : ℝ) : lowerStripPoissonMajorant ((d : ℝ) / 2) R σ (-s) = lowerStripPoissonMajorant ((d : ℝ) / 2) R σ s := by have hℓ : 0 < (d : ℝ) / 2 := by positivity let f : ℝ → ℝ := fun T => stripPoissonKernel σ T * lowerGammaBoundaryLog ((d : ℝ) / 2) R (s - ((d : ℝ) / 2) * T) unfold lowerStripPoissonMajorant calc (∫ T : ℝ, stripPoissonKernel σ T * lowerGammaBoundaryLog ((d : ℝ) / 2) R (-s - ((d : ℝ) / 2) * T)) = ∫ T : ℝ, f (-T) := by apply integral_congr_ae filter_upwards [Measure.ae_ne (volume : Measure ℝ) (-s / ((d : ℝ) / 2))] with T hT have hy : s + ((d : ℝ) / 2) * T ≠ 0 := by intro hzero apply hT apply (eq_div_iff hℓ.ne').2 nlinarith try dsimp [f] rw [stripPoissonKernel_neg] have harg : -s - ((d : ℝ) / 2) * T = -(s + ((d : ℝ) / 2) * T) := by ring rw [harg, lowerGammaBoundaryLog_dimension_neg R hy] congr 1 ring_nf _ = ∫ T : ℝ, f T := integral_neg_eq_self f volume _ = ∫ T : ℝ, stripPoissonKernel σ T * lowerGammaBoundaryLog ((d : ℝ) / 2) R (s - ((d : ℝ) / 2) * T) := by rfl theorem exists_lowerStripPoissonMajorant_positive_logarithmic_tail {c σ : ℝ} (hc : 0 < c) (hσ : 0 ≤ σ) (hσone : σ < 1) : ∃ A B κ : ℝ, 0 < A ∧ 0 < B ∧ 0 < κ ∧ ∀ d : ℕ, 2 ≤ d → ∀ S : ℝ, B ≤ S → lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt d) σ (((d : ℝ) / 2) * S) ≤ -κ * ((d : ℝ) / 2) * Real.log (S / A) := by have hbelow : -1 < σ := by linarith obtain ⟨C, hC, huniform⟩ := exists_lowerGammaScaledPositivePart_uniform_bound hc let A : ℝ := 8 * Real.pi * Real.exp 1 * c ^ 2 let m : ℝ := stripPoissonCoreMass σ let κ : ℝ := m / 2 let a : ℝ := Real.pi / 2 let β : ℝ := stripBottomMass σ * a * C have hA : 0 < A := by try dsimp [A] positivity have hm : 0 < m := stripPoissonCoreMass_pos hbelow hσone have hκ : 0 < κ := by try dsimp [κ] positivity have ha : 0 < a := by try dsimp [a] positivity have hβ : 0 < β := by try dsimp [β] exact mul_pos (mul_pos (stripBottomMass_pos hσone) ha) hC have hscale : Tendsto (fun S : ℝ => S * a) atTop atTop := tendsto_id.atTop_mul_const ha have hnegative : Tendsto (fun S : ℝ => -(S * a)) atTop atBot := Filter.tendsto_neg_atTop_atBot.comp hscale have hexponential : Tendsto (fun S : ℝ => Real.exp (-(S * a))) atTop (𝓝 0) := Real.tendsto_exp_atBot.comp hnegative have hdecay : Tendsto (fun S : ℝ => β * Real.exp (-a * (S - C))) atTop (𝓝 0) := by have hmul := hexponential.const_mul (β * Real.exp (a * C)) convert! hmul using 1 · ext S calc β * Real.exp (-a * (S - C)) = β * Real.exp (a * C + -(S * a)) := by congr 1 ring_nf _ = β * (Real.exp (a * C) * Real.exp (-(S * a))) := by rw [Real.exp_add] _ = β * Real.exp (a * C) * Real.exp (-(S * a)) := by ring · simp have hsmall : ∀ᶠ S : ℝ in atTop, β * Real.exp (-a * (S - C)) < m / 4 := hdecay.eventually (Iio_mem_nhds (by positivity : 0 < m / 4)) have hbounded : ∀ᶠ S : ℝ in atTop, max 2 (max C (2 * A)) ≤ S := eventually_ge_atTop _ obtain ⟨B₀, hB₀⟩ := Filter.eventually_atTop.1 (hsmall.and hbounded) let B : ℝ := max 1 B₀ have hB : 0 < B := by try dsimp [B] linarith [le_max_left (1 : ℝ) B₀] refine ⟨A, B, κ, hA, hB, hκ, ?_⟩ intro d hd S hSB have hBzero : B₀ ≤ S := le_trans (le_max_right 1 B₀) hSB obtain ⟨hsmallS, hlargeS⟩ := hB₀ S hBzero have hStwo : 2 ≤ S := le_trans (le_max_left 2 _) hlargeS have hSC : C ≤ S := le_trans (le_trans (le_max_left C (2 * A)) (le_max_right 2 _)) hlargeS have hSratio : 2 * A ≤ S := le_trans (le_trans (le_max_right C (2 * A)) (le_max_right 2 _)) hlargeS have hSpos : 0 < S := by linarith obtain ⟨hsupport, hpositive⟩ := huniform d hd have htail := lowerStripPoissonMajorant_core_tail_split hd hc hσ hσone hStwo have hpositive_tail := lowerGammaScaledPositivePart_poisson_exponential_tail hd hc hσ hσone hC hsupport hpositive hSC have hpositive_bound : (∫ Y : ℝ, stripPoissonKernel σ (S - Y) * lowerGammaScaledPositivePart d c Y) ≤ (β * Real.exp (-a * (S - C))) * ((d : ℝ) / 2) := by calc (∫ Y : ℝ, stripPoissonKernel σ (S - Y) * lowerGammaScaledPositivePart d c Y) ≤ (stripBottomMass σ * (Real.pi / 2) * Real.exp (-(Real.pi / 2) * (S - C))) * (C * ((d : ℝ) / 2)) := hpositive_tail _ = (β * Real.exp (-a * (S - C))) * ((d : ℝ) / 2) := by try dsimp [β, a] ring have hlogtwo : (1 / 2 : ℝ) ≤ Real.log 2 := by have h := Real.one_sub_inv_le_log_of_pos (by norm_num : (0 : ℝ) < 2) norm_num at h ⊢ linarith have hratio : (2 : ℝ) ≤ S / A := (le_div_iff₀ hA).2 hSratio have hlogratio : (1 / 2 : ℝ) ≤ Real.log (S / A) := hlogtwo.trans (Real.log_le_log (by norm_num : (0 : ℝ) < 2) hratio) have hflip : Real.log (A / S) = -Real.log (S / A) := by rw [Real.log_div hA.ne' hSpos.ne', Real.log_div hSpos.ne' hA.ne'] ring have hℓ : 0 < (d : ℝ) / 2 := by positivity calc lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt d) σ (((d : ℝ) / 2) * S) ≤ (((d : ℝ) / 2) * Real.log (A / S)) * m + ∫ Y : ℝ, stripPoissonKernel σ (S - Y) * lowerGammaScaledPositivePart d c Y := by exact htail _ ≤ (((d : ℝ) / 2) * Real.log (A / S)) * m + (β * Real.exp (-a * (S - C))) * ((d : ℝ) / 2) := by linarith [hpositive_bound] _ ≤ -κ * ((d : ℝ) / 2) * Real.log (S / A) := by rw [hflip] try dsimp [κ] nlinarith [mul_nonneg (show 0 ≤ (d : ℝ) / 2 by positivity) (show 0 ≤ m * Real.log (S / A) / 2 - β * Real.exp (-a * (S - C)) by nlinarith [mul_nonneg hm.le (show 0 ≤ Real.log (S / A) - 1 / 2 by linarith)])] theorem exists_lowerStripPoissonMajorant_logarithmic_tail {c σ : ℝ} (hc : 0 < c) (hσ : 0 ≤ σ) (hσone : σ < 1) : ∃ A B κ : ℝ, 0 < A ∧ 0 < B ∧ 0 < κ ∧ ∀ d : ℕ, 2 ≤ d → ∀ S : ℝ, B ≤ |S| → lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt d) σ (((d : ℝ) / 2) * S) ≤ -κ * ((d : ℝ) / 2) * Real.log (|S| / A) := by obtain ⟨A, B, κ, hA, hB, hκ, htail⟩ := exists_lowerStripPoissonMajorant_positive_logarithmic_tail hc hσ hσone refine ⟨A, B, κ, hA, hB, hκ, ?_⟩ intro d hd S hS by_cases hnonneg : 0 ≤ S · rw [abs_of_nonneg hnonneg] at hS ⊢ exact htail d hd S hS · have hnegative : S < 0 := lt_of_not_ge hnonneg have habs : |S| = -S := abs_of_neg hnegative have hdpos : 0 < d := lt_of_lt_of_le (by norm_num) hd have hnegS : B ≤ -S := by simpa [habs] using! hS have htailneg := htail d hd (-S) hnegS have harg : ((d : ℝ) / 2) * S = -(((d : ℝ) / 2) * (-S)) := by ring calc lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt d) σ (((d : ℝ) / 2) * S) = lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt d) σ (-(((d : ℝ) / 2) * (-S))) := by rw [harg] _ = lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt d) σ (((d : ℝ) / 2) * (-S)) := lowerStripPoissonMajorant_dimension_neg hdpos (c * Real.sqrt d) σ (((d : ℝ) / 2) * (-S)) _ ≤ -κ * ((d : ℝ) / 2) * Real.log ((-S) / A) := htailneg _ = -κ * ((d : ℝ) / 2) * Real.log (|S| / A) := by rw [habs] theorem inverseQuadraticAbs_integrable : Integrable (fun S : ℝ => 1 / (1 + |S|) ^ 2) := by have hbase := integrable_one_add_norm (E := ℝ) (μ := volume) (r := (2 : ℝ)) (by norm_num) convert! hbase using 1 ext S rw [Real.norm_eq_abs, Real.rpow_neg (by positivity)] simp [one_div] theorem exists_lowerStripPoissonMajorant_integrable_majorant {c : ℝ} (hc : 0 < c) (hsharp : c < Real.pi⁻¹) : ∃ σ γ C : ℝ, 0 < σ ∧ σ < 1 ∧ 0 < γ ∧ 0 < C ∧ ∀ᶠ d : ℕ in atTop, ∀ S : ℝ, Real.exp (lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt d) σ (((d : ℝ) / 2) * S)) ≤ C * Real.exp (-γ * ((d : ℝ) / 2)) / (1 + |S|) ^ 2 := by obtain ⟨σ, γ₀, hσpos, hσone, hγ₀, hcentral⟩ := exists_lowerStripPoissonMajorant_uniform_negative hc hsharp obtain ⟨A, B, κ, hA, hB, hκ, htail⟩ := exists_lowerStripPoissonMajorant_logarithmic_tail hc hσpos.le hσone let T : ℝ := max B (max A 1) let C : ℝ := max ((1 + T) ^ 2) (4 * A ^ 2) let γ : ℝ := γ₀ / 2 have hT : 1 ≤ T := by try dsimp [T] exact le_trans (le_max_right A 1) (le_max_right B (max A 1)) have hTA : A ≤ T := by try dsimp [T] exact le_trans (le_max_left A 1) (le_max_right B (max A 1)) have hTB : B ≤ T := by try dsimp [T] exact le_max_left B (max A 1) have hC : 0 < C := by try dsimp [C] have hsq : 0 < (1 + T) ^ 2 := sq_pos_of_pos (by linarith) exact lt_of_lt_of_le hsq (le_max_left _ _) have hγ : 0 < γ := by try dsimp [γ] positivity have hscale : Tendsto (fun d : ℕ => (d : ℝ) / 2) atTop atTop := by have hcast := tendsto_natCast_atTop_atTop (R := ℝ) have hmul := hcast.atTop_mul_const (by norm_num : (0 : ℝ) < 1 / 2) convert! hmul using 1 ext d ring have hdimension : ∀ᶠ d : ℕ in atTop, 4 / κ ≤ (d : ℝ) / 2 := hscale.eventually (Ici_mem_atTop (4 / κ)) refine ⟨σ, γ, C, hσpos, hσone, hγ, hC, ?_⟩ filter_upwards [eventually_ge_atTop (2 : ℕ), hdimension, hcentral] with d hd hdim hcen intro S have hℓ : 0 < (d : ℝ) / 2 := by positivity by_cases hfar : T ≤ |S| · have hBS : B ≤ |S| := le_trans hTB hfar have hAS : A ≤ |S| := le_trans hTA hfar have habspos : 0 < |S| := lt_of_lt_of_le hA hAS have hratio : (1 : ℝ) ≤ |S| / A := (le_div_iff₀ hA).2 (by simpa using! hAS) have hlog : 0 ≤ Real.log (|S| / A) := Real.log_nonneg hratio have hκscale : 4 ≤ κ * ((d : ℝ) / 2) := by have h := (div_le_iff₀ hκ).1 hdim nlinarith have hnegative := hcen (((d : ℝ) / 2) * S) have hfrequency := htail d hd S hBS have haverage : lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt d) σ (((d : ℝ) / 2) * S) ≤ -γ * ((d : ℝ) / 2) - 2 * Real.log (|S| / A) := by try dsimp [γ] nlinarith [mul_nonneg (sub_nonneg.mpr hκscale) hlog] have hpow : Real.exp (-(2 : ℝ) * Real.log (|S| / A)) = (A / |S|) ^ 2 := by calc Real.exp (-(2 : ℝ) * Real.log (|S| / A)) = Real.exp (-Real.log (|S| / A) + -Real.log (|S| / A)) := by congr 1 ring _ = Real.exp (-Real.log (|S| / A)) * Real.exp (-Real.log (|S| / A)) := by rw [Real.exp_add] _ = (A / |S|) ^ 2 := by rw [Real.exp_neg, Real.exp_log (div_pos habspos hA)] field_simp [habspos.ne', hA.ne'] have hu : 1 ≤ |S| := le_trans hT hfar have hquad : (1 + |S|) ^ 2 ≤ 4 * |S| ^ 2 := by nlinarith [sq_nonneg (|S| - 1)] have hquadmajor : (A / |S|) ^ 2 * (1 + |S|) ^ 2 ≤ 4 * A ^ 2 := by calc (A / |S|) ^ 2 * (1 + |S|) ^ 2 ≤ (A / |S|) ^ 2 * (4 * |S| ^ 2) := mul_le_mul_of_nonneg_left hquad (sq_nonneg _) _ = 4 * A ^ 2 := by field_simp [habspos.ne'] have hden : 0 < (1 + |S|) ^ 2 := sq_pos_of_pos (by positivity) have hprofile : (A / |S|) ^ 2 ≤ C / (1 + |S|) ^ 2 := by apply (le_div_iff₀ hden).2 exact hquadmajor.trans (show 4 * A ^ 2 ≤ C from le_max_right _ _) calc Real.exp (lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt d) σ (((d : ℝ) / 2) * S)) ≤ Real.exp (-γ * ((d : ℝ) / 2) - 2 * Real.log (|S| / A)) := Real.exp_le_exp.mpr haverage _ = Real.exp (-γ * ((d : ℝ) / 2)) * (A / |S|) ^ 2 := by rw [show -γ * ((d : ℝ) / 2) - 2 * Real.log (|S| / A) = -γ * ((d : ℝ) / 2) + (-(2 : ℝ) * Real.log (|S| / A)) by ring, Real.exp_add, hpow] _ ≤ Real.exp (-γ * ((d : ℝ) / 2)) * (C / (1 + |S|) ^ 2) := mul_le_mul_of_nonneg_left hprofile (Real.exp_pos _).le _ = C * Real.exp (-γ * ((d : ℝ) / 2)) / (1 + |S|) ^ 2 := by ring · have hnear : |S| ≤ T := le_of_lt (lt_of_not_ge hfar) have hden : 0 < (1 + |S|) ^ 2 := sq_pos_of_pos (by positivity) have hnearquad : (1 + |S|) ^ 2 ≤ (1 + T) ^ 2 := by nlinarith [abs_nonneg S] have hdenmajor : (1 + |S|) ^ 2 ≤ C := hnearquad.trans (le_max_left _ _) have hexpcentral : Real.exp (lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt d) σ (((d : ℝ) / 2) * S)) ≤ Real.exp (-γ * ((d : ℝ) / 2)) := by apply Real.exp_le_exp.mpr have h := hcen (((d : ℝ) / 2) * S) try dsimp [γ] nlinarith [mul_nonneg hγ₀.le hℓ.le] calc Real.exp (lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt d) σ (((d : ℝ) / 2) * S)) ≤ Real.exp (-γ * ((d : ℝ) / 2)) := hexpcentral _ ≤ C * Real.exp (-γ * ((d : ℝ) / 2)) / (1 + |S|) ^ 2 := by apply (le_div_iff₀ hden).2 calc Real.exp (-γ * ((d : ℝ) / 2)) * (1 + |S|) ^ 2 ≤ Real.exp (-γ * ((d : ℝ) / 2)) * C := mul_le_mul_of_nonneg_left hdenmajor (Real.exp_pos _).le _ = C * Real.exp (-γ * ((d : ℝ) / 2)) := by ring def lowerInverseQuadraticMass : ℝ := ∫ S : ℝ, 1 / (1 + |S|) ^ 2 theorem antiFourierWitness_interiorMellinL1_le_of_integrable_majorant {d : ℕ} (hd : 0 < d) {R σ γ C : ℝ} (hR : 0 < R) (hσbelow : -1 < σ) (hσabove : σ < 1) (w : AntiFourierWitness d R) (hpoint : ∀ s : ℝ, ‖normalizedRadialMellinStrip hd w.function R ((s : ℂ) + Complex.I * (((σ * ((d : ℝ) / 2) : ℝ) : ℂ)))‖ ≤ Real.exp (lowerStripPoissonMajorant ((d : ℝ) / 2) R σ s)) (hmajor : ∀ S : ℝ, Real.exp (lowerStripPoissonMajorant ((d : ℝ) / 2) R σ (((d : ℝ) / 2) * S)) ≤ C * Real.exp (-γ * ((d : ℝ) / 2)) / (1 + |S|) ^ 2) : (∫ s : ℝ, ‖normalizedRadialMellinStrip hd w.function R ((s : ℂ) + Complex.I * (((σ * ((d : ℝ) / 2) : ℝ) : ℂ)))‖) ≤ (C * lowerInverseQuadraticMass) * ((d : ℝ) / 2) * Real.exp (-γ * ((d : ℝ) / 2)) := by let ℓ : ℝ := (d : ℝ) / 2 have hℓ : 0 < ℓ := by try dsimp [ℓ] positivity let Z : ℝ → ℂ := fun s => normalizedRadialMellinStrip hd w.function R ((s : ℂ) + Complex.I * (((σ * ℓ : ℝ) : ℂ))) have ha : (1 - σ) * ℓ < (d : ℝ) := by have hplus : 0 < (1 + σ) * ℓ := mul_pos (by linarith) hℓ have hinner : 0 < (1 - σ) * ℓ := mul_pos (sub_pos.mpr hσabove) hℓ apply (mul_lt_mul_iff_right₀ hinner).mp try dsimp [ℓ] at hplus hinner ⊢ nlinarith [mul_pos hplus hinner] have hheight : ℓ - (1 - σ) * ℓ = σ * ℓ := by ring have hZ : Integrable Z := by have h := antiFourierWitness_normalizedMellinStrip_shifted_integrable hd hR w ha convert! h using 1 ext s try dsimp [Z, ℓ] at * congr 2 push_cast ring let E : ℝ := C * Real.exp (-γ * ℓ) have hprofile : Integrable (fun S : ℝ => E / (1 + |S|) ^ 2) := by have h := inverseQuadraticAbs_integrable.const_mul E convert! h using 1 ext S ring have hscaled : Integrable (fun S : ℝ => ‖Z (ℓ * S)‖) := by have h := hZ.norm.comp_mul_left' hℓ.ne' convert! h using 1 have hbound : (∫ S : ℝ, ‖Z (ℓ * S)‖) ≤ E * lowerInverseQuadraticMass := by calc (∫ S : ℝ, ‖Z (ℓ * S)‖) ≤ ∫ S : ℝ, E / (1 + |S|) ^ 2 := by apply integral_mono_ae hscaled hprofile filter_upwards [] with S calc ‖Z (ℓ * S)‖ ≤ Real.exp (lowerStripPoissonMajorant ℓ R σ (ℓ * S)) := by exact hpoint (ℓ * S) _ ≤ E / (1 + |S|) ^ 2 := by exact hmajor S _ = E * lowerInverseQuadraticMass := by unfold lowerInverseQuadraticMass calc (∫ S : ℝ, E / (1 + |S|) ^ 2) = ∫ S : ℝ, E * (1 / (1 + |S|) ^ 2) := by apply integral_congr_ae filter_upwards [] with S ring _ = E * (∫ S : ℝ, 1 / (1 + |S|) ^ 2) := by rw [integral_const_mul] have hchange : (∫ s : ℝ, ‖Z s‖) = ℓ * (∫ S : ℝ, ‖Z (ℓ * S)‖) := by have h := Measure.integral_comp_mul_left (fun s : ℝ => ‖Z s‖) ℓ rw [abs_of_pos (inv_pos.mpr hℓ), smul_eq_mul] at h calc (∫ s : ℝ, ‖Z s‖) = ℓ * (ℓ⁻¹ * (∫ s : ℝ, ‖Z s‖)) := by field_simp [hℓ.ne'] _ = ℓ * (∫ S : ℝ, ‖Z (ℓ * S)‖) := by rw [← h] change (∫ s : ℝ, ‖Z s‖) ≤ (C * lowerInverseQuadraticMass) * ℓ * Real.exp (-γ * ℓ) rw [hchange] calc ℓ * (∫ S : ℝ, ‖Z (ℓ * S)‖) ≤ ℓ * (E * lowerInverseQuadraticMass) := mul_le_mul_of_nonneg_left hbound hℓ.le _ = (C * lowerInverseQuadraticMass) * ℓ * Real.exp (-γ * ℓ) := by try dsimp [E] ring theorem lowerStripCappedPoisson_tendsto {d : ℕ} (hd : 0 < d) {c σ : ℝ} (hσbelow : -1 < σ) (hσabove : σ < 1) (s : ℝ) : Tendsto (fun n : ℕ => ∫ T : ℝ, stripPoissonKernel σ T * lowerGammaBoundaryCapped ((d : ℝ) / 2) (c * Real.sqrt d) (n : ℝ) (s - ((d : ℝ) / 2) * T)) atTop (𝓝 (lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt d) σ s)) := by have hℓ : 0 < (d : ℝ) / 2 := by positivity rw [lowerStripPoissonMajorant_scaled_convolution hℓ (c * Real.sqrt d) σ s] have h := lowerGammaScaledCapped_poisson_tendsto (c := c) hd hσbelow hσabove (s / ((d : ℝ) / 2)) convert! h using 1 ext n let f : ℝ → ℝ := fun Y => stripPoissonKernel σ (s / ((d : ℝ) / 2) - Y) * lowerGammaBoundaryCapped ((d : ℝ) / 2) (c * Real.sqrt d) (n : ℝ) (((d : ℝ) / 2) * Y) calc (∫ T : ℝ, stripPoissonKernel σ T * lowerGammaBoundaryCapped ((d : ℝ) / 2) (c * Real.sqrt d) (n : ℝ) (s - ((d : ℝ) / 2) * T)) = ∫ T : ℝ, f (s / ((d : ℝ) / 2) - T) := by apply integral_congr_ae filter_upwards [] with T try dsimp [f] have hkernel : s / ((d : ℝ) / 2) - (s / ((d : ℝ) / 2) - T) = T := by ring have harg : ((d : ℝ) / 2) * (s / ((d : ℝ) / 2) - T) = s - ((d : ℝ) / 2) * T := by field_simp [hℓ.ne'] rw [hkernel, harg] _ = ∫ Y : ℝ, f Y := integral_sub_left_eq_self f volume (s / ((d : ℝ) / 2)) _ = ∫ Y : ℝ, stripPoissonKernel σ (s / ((d : ℝ) / 2) - Y) * lowerGammaBoundaryCapped ((d : ℝ) / 2) (c * Real.sqrt d) (n : ℝ) (((d : ℝ) / 2) * Y) := by rfl theorem uniformAntiFourierSignRadius_of_poisson_majorization (hpoisson : ∀ {d : ℕ} (hd : 0 < d) {R : ℝ} (_hR : 0 < R) (w : AntiFourierWitness d R) {σ : ℝ} (_hσbelow : -1 < σ) (_hσabove : σ < 1) (s : ℝ), ‖normalizedRadialMellinStrip hd w.function R ((s : ℂ) + Complex.I * (((σ * ((d : ℝ) / 2) : ℝ) : ℂ)))‖ ≤ Real.exp (lowerStripPoissonMajorant ((d : ℝ) / 2) R σ s)) : UniformAntiFourierSignRadius := by intro c hc hcritical have hsharp : c < Real.pi⁻¹ := by simpa [criticalRadius] using! hcritical obtain ⟨σ, γ, C, hσpos, hσone, hγ, hC, hmajor⟩ := exists_lowerStripPoissonMajorant_integrable_majorant hc hsharp let J : ℝ := lowerInverseQuadraticMass let Q : ℝ := C * J let K : ℝ := (2 * Real.pi)⁻¹ * Q / (1 - σ) have hσbelow : -1 < σ := by linarith have hsigmapos : 0 < 1 - σ := sub_pos.mpr hσone have hscale : Tendsto (fun d : ℕ => (d : ℝ) / 2) atTop atTop := by have hcast := tendsto_natCast_atTop_atTop (R := ℝ) have hmul := hcast.atTop_mul_const (by norm_num : (0 : ℝ) < 1 / 2) convert! hmul using 1 ext d ring have hγscale : Tendsto (fun d : ℕ => γ * ((d : ℝ) / 2)) atTop atTop := by have h := hscale.atTop_mul_const hγ convert! h using 1 ext d ring have hnegative : Tendsto (fun d : ℕ => -(γ * ((d : ℝ) / 2))) atTop atBot := Filter.tendsto_neg_atTop_atBot.comp hγscale have hexp : Tendsto (fun d : ℕ => Real.exp (-(γ * ((d : ℝ) / 2)))) atTop (𝓝 0) := Real.tendsto_exp_atBot.comp hnegative have hlimit : Tendsto (fun d : ℕ => K * Real.exp (-γ * ((d : ℝ) / 2))) atTop (𝓝 0) := by have h := hexp.const_mul K convert! h using 1 · ext d congr 1 ring_nf · simp have hsmall : ∀ᶠ d : ℕ in atTop, K * Real.exp (-γ * ((d : ℝ) / 2)) < (1 / 2 : ℝ) := hlimit.eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1 / 2)) filter_upwards [eventually_ge_atTop (2 : ℕ), hmajor, hsmall] with d hd hmaj hsmall_d have hdpos : 0 < d := lt_of_lt_of_le (by norm_num) hd have hdreal : 0 < (d : ℝ) := Nat.cast_pos.mpr hdpos have hR : 0 < c * Real.sqrt (d : ℝ) := mul_pos hc (Real.sqrt_pos.mpr hdreal) refine ⟨?_⟩ intro w have hpoint : ∀ s : ℝ, ‖normalizedRadialMellinStrip hdpos w.function (c * Real.sqrt (d : ℝ)) ((s : ℂ) + Complex.I * (((σ * ((d : ℝ) / 2) : ℝ) : ℂ)))‖ ≤ Real.exp (lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt (d : ℝ)) σ s) := by intro s exact hpoisson hdpos hR w hσbelow hσone s have hL1 := antiFourierWitness_interiorMellinL1_le_of_integrable_majorant hdpos hR hσbelow hσone w hpoint hmaj have hℓ : 0 < (d : ℝ) / 2 := by positivity have hden : 0 < (1 - σ) * ((d : ℝ) / 2) := mul_pos hsigmapos hℓ have hpi : 0 ≤ (2 * Real.pi)⁻¹ := by positivity have hbound : ((2 * Real.pi)⁻¹ * ∫ s : ℝ, ‖normalizedRadialMellinStrip hdpos w.function (c * Real.sqrt (d : ℝ)) ((s : ℂ) + Complex.I * (((σ * ((d : ℝ) / 2) : ℝ) : ℂ)))‖) / ((1 - σ) * ((d : ℝ) / 2)) ≤ K * Real.exp (-γ * ((d : ℝ) / 2)) := by calc ((2 * Real.pi)⁻¹ * ∫ s : ℝ, ‖normalizedRadialMellinStrip hdpos w.function (c * Real.sqrt (d : ℝ)) ((s : ℂ) + Complex.I * (((σ * ((d : ℝ) / 2) : ℝ) : ℂ)))‖) / ((1 - σ) * ((d : ℝ) / 2)) ≤ ((2 * Real.pi)⁻¹ * ((C * lowerInverseQuadraticMass) * ((d : ℝ) / 2) * Real.exp (-γ * ((d : ℝ) / 2)))) / ((1 - σ) * ((d : ℝ) / 2)) := by apply (div_le_div_iff_of_pos_right hden).2 exact mul_le_mul_of_nonneg_left hL1 hpi _ = K * Real.exp (-γ * ((d : ℝ) / 2)) := by try dsimp [K, Q, J] field_simp [hsigmapos.ne', hℓ.ne'] exact no_antiFourierWitness_of_interiorMellinL1_lt_half hdpos hR hσbelow hσone w (lt_of_le_of_lt hbound hsmall_d) theorem lowerStripCappedPoisson_tendsto_radius {d : ℕ} (hd : 0 < d) {R σ : ℝ} (hσbelow : -1 < σ) (hσabove : σ < 1) (s : ℝ) : Tendsto (fun n : ℕ => ∫ T : ℝ, stripPoissonKernel σ T * lowerGammaBoundaryCapped ((d : ℝ) / 2) R (n : ℝ) (s - ((d : ℝ) / 2) * T)) atTop (𝓝 (lowerStripPoissonMajorant ((d : ℝ) / 2) R σ s)) := by have hdreal : 0 < (d : ℝ) := Nat.cast_pos.mpr hd have hsqrt : 0 < Real.sqrt (d : ℝ) := Real.sqrt_pos.mpr hdreal let c : ℝ := R / Real.sqrt (d : ℝ) have hrad : c * Real.sqrt (d : ℝ) = R := by try dsimp [c] exact div_mul_cancel₀ R hsqrt.ne' have h := lowerStripCappedPoisson_tendsto (c := c) hd hσbelow hσabove s simpa only [hrad] using! h theorem antiFourierWitness_norm_le_poisson_of_eventually_capped_radius {d : ℕ} (hd : 0 < d) {R σ : ℝ} (w : AntiFourierWitness d R) (hσbelow : -1 < σ) (hσabove : σ < 1) (s : ℝ) (hcapped : ∀ᶠ n : ℕ in atTop, ‖normalizedRadialMellinStrip hd w.function R ((s : ℂ) + Complex.I * (((σ * ((d : ℝ) / 2) : ℝ) : ℂ)))‖ ≤ Real.exp (∫ T : ℝ, stripPoissonKernel σ T * lowerGammaBoundaryCapped ((d : ℝ) / 2) R (n : ℝ) (s - ((d : ℝ) / 2) * T))) : ‖normalizedRadialMellinStrip hd w.function R ((s : ℂ) + Complex.I * (((σ * ((d : ℝ) / 2) : ℝ) : ℂ)))‖ ≤ Real.exp (lowerStripPoissonMajorant ((d : ℝ) / 2) R σ s) := by have hlimit := lowerStripCappedPoisson_tendsto_radius (R := R) hd hσbelow hσabove s have hexp := Real.continuous_exp.continuousAt.tendsto.comp hlimit exact le_of_tendsto_of_tendsto tendsto_const_nhds hexp hcapped theorem uniformAntiFourierSignRadius_of_capped_poisson_majorization (hcap : ∀ {d : ℕ} (hd : 0 < d) {R : ℝ} (_hR : 0 < R) (w : AntiFourierWitness d R), ∃ D₀ : ℝ, ∀ D : ℝ, D₀ ≤ D → ∀ {σ : ℝ}, -1 < σ → σ < 1 → ∀ s : ℝ, ‖normalizedRadialMellinStrip hd w.function R ((s : ℂ) + Complex.I * (((σ * ((d : ℝ) / 2) : ℝ) : ℂ)))‖ ≤ Real.exp (∫ T : ℝ, stripPoissonKernel σ T * lowerGammaBoundaryCapped ((d : ℝ) / 2) R D (s - ((d : ℝ) / 2) * T))) : UniformAntiFourierSignRadius := by apply uniformAntiFourierSignRadius_of_poisson_majorization intro d hd R hR w σ hσbelow hσabove s obtain ⟨D₀, hD⟩ := hcap hd hR w apply antiFourierWitness_norm_le_poisson_of_eventually_capped_radius hd w hσbelow hσabove s have hevent : ∀ᶠ n : ℕ in atTop, D₀ ≤ (n : ℝ) := (tendsto_natCast_atTop_atTop (R := ℝ)).eventually (Ici_mem_atTop D₀) filter_upwards [hevent] with n hn exact hD (n : ℝ) hn hσbelow hσabove s end noncomputable section open Filter MeasureTheory Set open scoped ENNReal Interval Topology theorem uniformAntiFourierSignRadius : UniformAntiFourierSignRadius := by apply uniformAntiFourierSignRadius_of_capped_poisson_majorization intro d hd R hR w exact exists_antiFourierWitness_capped_poisson_majorization hd hR w end noncomputable section open Set def quotientRootMap (d : ℕ) (x : ℝ) : ℝ := x ^ ((d : ℝ)⁻¹) / Real.sqrt (d : ℝ) theorem continuous_quotientRootMap (d : ℕ) : Continuous (quotientRootMap d) := by unfold quotientRootMap exact (Real.continuous_rpow_const (by positivity)).div_const _ theorem monotoneOn_quotientRootMap (d : ℕ) : MonotoneOn (quotientRootMap d) (quotientSet d) := by intro x hx y _ hxy rcases hx with ⟨f, rfl⟩ unfold quotientRootMap exact div_le_div_of_nonneg_right (Real.rpow_le_rpow (quotient_pos f).le hxy (by positivity)) (Real.sqrt_nonneg _) theorem normalizedCostRange_eq_quotientRootImage (d : ℕ) : Set.range (normalizedCost (d := d)) = quotientRootMap d '' quotientSet d := by ext y constructor · rintro ⟨f, rfl⟩ exact ⟨quotient f, ⟨f, rfl⟩, rfl⟩ · rintro ⟨_, ⟨f, rfl⟩, rfl⟩ exact ⟨f, rfl⟩ theorem normalizedProgram_eq_quotientInf_root (d : ℕ) (hadmissible : Nonempty (Admissible d)) : normalizedProgram d = quotientRootMap d (sInf (quotientSet d)) := by obtain ⟨f⟩ := hadmissible have hnonempty : (quotientSet d).Nonempty := ⟨quotient f, ⟨f, rfl⟩⟩ unfold normalizedProgram rw [normalizedCostRange_eq_quotientRootImage] exact (MonotoneOn.map_csInf_of_continuousWithinAt (continuous_quotientRootMap d).continuousWithinAt (monotoneOn_quotientRootMap d) hnonempty (quotientSet_bddBelow d)).symm theorem quotientInf_nonneg (d : ℕ) (hadmissible : Nonempty (Admissible d)) : 0 ≤ sInf (quotientSet d) := by obtain ⟨f⟩ := hadmissible refine le_csInf ⟨quotient f, f, rfl⟩ ?_ rintro _ ⟨g, rfl⟩ exact (quotient_pos g).le def packingGeometricRoot (d : ℕ) : ℝ := (unitBallVolume d / (2 : ℝ) ^ d) ^ ((d : ℝ)⁻¹) * Real.sqrt (d : ℝ) theorem linearProgram_root_eq_geometric_mul_normalizedProgram {d : ℕ} (hd : 0 < d) (hadmissible : Nonempty (Admissible d)) : (linearProgram d) ^ ((d : ℝ)⁻¹) = packingGeometricRoot d * normalizedProgram d := by have hsqrt : Real.sqrt (d : ℝ) ≠ 0 := (Real.sqrt_pos.2 (by exact_mod_cast hd)).ne' rw [normalizedProgram_eq_quotientInf_root d hadmissible] unfold linearProgram packingGeometricRoot quotientRootMap rw [Real.mul_rpow (geometricFactor_pos d).le (quotientInf_nonneg d hadmissible)] field_simp end noncomputable section open Filter open scoped Nat Topology theorem unitBallVolume_odd (k : ℕ) : unitBallVolume (2 * k + 1) = Real.pi ^ k * 2 ^ (k + 1) / ((2 * k + 1)‼ : ℝ) := by have hhalf : ((↑(2 * k + 1) : ℝ) / 2) = (k : ℝ) + 1 / 2 := by push_cast ring have hgamma : Real.Gamma (((↑(2 * k + 1) : ℝ) / 2) + 1) = ((2 * k + 1)‼ : ℝ) * Real.sqrt Real.pi / (2 : ℝ) ^ (k + 1) := by rw [hhalf] convert! Real.Gamma_nat_add_one_add_half k using 1; ring_nf have hpi : Real.pi ^ (((2 * k + 1 : ℕ) : ℝ) / 2) = Real.pi ^ k * Real.sqrt Real.pi := by rw [hhalf, Real.rpow_add Real.pi_pos, Real.rpow_natCast, ← Real.sqrt_eq_rpow] have hdouble : (0 : ℝ) < ((2 * k + 1)‼ : ℝ) := by exact_mod_cast Nat.doubleFactorial_pos (2 * k + 1) unfold unitBallVolume rw [hpi, hgamma] field_simp theorem oddDoubleFactorial_mul_two_pow_factorial (k : ℕ) : ((2 * k + 1)‼ : ℝ) * (2 : ℝ) ^ k * (k.factorial : ℝ) = ((2 * k + 1).factorial : ℝ) := by exact_mod_cast (by rw [mul_assoc, ← Nat.doubleFactorial_two_mul, ← Nat.factorial_eq_mul_doubleFactorial] : (2 * k + 1)‼ * 2 ^ k * k.factorial = (2 * k + 1).factorial) theorem unitBallVolume_odd_factorial (k : ℕ) : unitBallVolume (2 * k + 1) = Real.pi ^ k * (2 : ℝ) ^ (2 * k + 1) * (k.factorial : ℝ) / ((2 * k + 1).factorial : ℝ) := by rw [unitBallVolume_odd] have hdouble : ((2 * k + 1)‼ : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt (Nat.doubleFactorial_pos (2 * k + 1))) have hfactorial : ((2 * k + 1).factorial : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt (Nat.factorial_pos (2 * k + 1))) have hidentity := oddDoubleFactorial_mul_two_pow_factorial k have hpower : (2 : ℝ) ^ (2 * k + 1) = (2 : ℝ) ^ (k + 1) * (2 : ℝ) ^ k := by rw [← pow_add] congr 1 omega rw [hpower] field_simp nlinarith [hidentity] theorem tendsto_factorialStirlingSequence : Tendsto Stirling.stirlingSeq atTop (nhds (Real.sqrt Real.pi)) := Stirling.tendsto_stirlingSeq_sqrt_pi theorem tendsto_log_factorialStirlingSequence : Tendsto (fun k : ℕ => Real.log (Stirling.stirlingSeq k)) atTop (nhds (Real.log (Real.sqrt Real.pi))) := by exact (Real.continuousAt_log (by positivity)).tendsto.comp tendsto_factorialStirlingSequence theorem tendsto_log_nat_div_nat : Tendsto (fun k : ℕ => Real.log (k : ℝ) / (k : ℝ)) atTop (nhds 0) := by simpa using! (Real.tendsto_pow_log_div_mul_add_atTop 1 0 1 (by norm_num : (1 : ℝ) ≠ 0)).comp (tendsto_natCast_atTop_atTop (R := ℝ)) theorem tendsto_log_factorialStirlingSequence_div_nat : Tendsto (fun k : ℕ => Real.log (Stirling.stirlingSeq k) / (k : ℝ)) atTop (nhds 0) := by convert! tendsto_log_factorialStirlingSequence.mul (tendsto_inv_atTop_nhds_zero_nat (𝕜 := ℝ)) using 1; simp theorem tendsto_log_two_mul_nat_div_nat : Tendsto (fun k : ℕ => Real.log ((2 : ℝ) * (k : ℝ)) / (k : ℝ)) atTop (nhds 0) := by have hsum := (tendsto_const_div_atTop_nhds_zero_nat (Real.log (2 : ℝ))).add tendsto_log_nat_div_nat have hsum' : Tendsto (fun k : ℕ => Real.log (2 : ℝ) / (k : ℝ) + Real.log (k : ℝ) / (k : ℝ)) atTop (nhds 0) := by simpa using! hsum refine hsum'.congr' ?_ filter_upwards [eventually_gt_atTop (0 : ℕ)] with k hk rw [← add_div, Real.log_mul (by norm_num : (2 : ℝ) ≠ 0) (by exact_mod_cast (Nat.ne_of_gt hk))] theorem tendsto_log_factorial_div_nat_sub_log_nat : Tendsto (fun k : ℕ => Real.log (k.factorial : ℝ) / (k : ℝ) - Real.log (k : ℝ)) atTop (nhds (-1)) := by have hlimit := (tendsto_log_factorialStirlingSequence_div_nat.add (tendsto_log_two_mul_nat_div_nat.const_mul (1 / 2 : ℝ))).sub (tendsto_const_nhds (x := (1 : ℝ))) have htarget : Tendsto (fun k : ℕ => Real.log (Stirling.stirlingSeq k) / (k : ℝ) + (1 / 2 : ℝ) * (Real.log ((2 : ℝ) * (k : ℝ)) / (k : ℝ)) - 1) atTop (nhds (-1)) := by convert! hlimit using 1; norm_num refine htarget.congr' ?_ filter_upwards [eventually_gt_atTop (0 : ℕ)] with k hk have hkreal : (k : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hk) have hformula := Stirling.log_stirlingSeq_formula k rw [Real.log_div hkreal (Real.exp_ne_zero 1), Real.log_exp] at hformula have hcomm : Real.log ((k : ℝ) * 2) = Real.log (2 * (k : ℝ)) := by rw [mul_comm] field_simp nlinarith [hformula, hcomm] theorem tendsto_oddDimension_atTop : Tendsto (fun k : ℕ => 2 * k + 1) atTop atTop := by exact tendsto_atTop_mono (fun k => by change k ≤ 2 * k + 1; omega) tendsto_id theorem tendsto_log_nat_div_oddDimension : Tendsto (fun k : ℕ => Real.log (k : ℝ) / (2 * (k : ℝ) + 1)) atTop (nhds 0) := by have hproduct := tendsto_log_nat_div_nat.mul Stirling.tendsto_self_div_two_mul_self_add_one have hlimit : Tendsto (fun k : ℕ => (Real.log (k : ℝ) / (k : ℝ)) * ((k : ℝ) / (2 * (k : ℝ) + 1))) atTop (nhds 0) := by convert! hproduct using 1; norm_num refine hlimit.congr' ?_ filter_upwards [eventually_gt_atTop (0 : ℕ)] with k hk have hkreal : (k : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hk) field_simp theorem tendsto_log_nat_sub_log_oddDimension : Tendsto (fun k : ℕ => Real.log (k : ℝ) - Real.log (2 * (k : ℝ) + 1)) atTop (nhds (Real.log (1 / 2 : ℝ))) := by have hratio := Stirling.tendsto_self_div_two_mul_self_add_one.log (by norm_num : (1 / 2 : ℝ) ≠ 0) refine hratio.congr' ?_ filter_upwards [eventually_gt_atTop (0 : ℕ)] with k hk have hkreal : (k : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hk) have hodd : (2 * (k : ℝ) + 1) ≠ 0 := by positivity exact Real.log_div hkreal hodd def normalizedVolumeLog (d : ℕ) : ℝ := Real.log (unitBallVolume d) / (d : ℝ) + Real.log (d : ℝ) / 2 theorem normalizedVolumeLog_odd_eq (k : ℕ) (hk : 0 < k) : normalizedVolumeLog (2 * k + 1) = (k : ℝ) / (2 * (k : ℝ) + 1) * Real.log Real.pi + Real.log 2 + ((k : ℝ) / (2 * (k : ℝ) + 1)) * (Real.log (k.factorial : ℝ) / (k : ℝ) - Real.log (k : ℝ)) - (Real.log ((2 * k + 1).factorial : ℝ) / (2 * (k : ℝ) + 1) - Real.log (2 * (k : ℝ) + 1)) + ((k : ℝ) / (2 * (k : ℝ) + 1) - (1 / 2 : ℝ)) * Real.log (k : ℝ) + (1 / 2 : ℝ) * (Real.log (k : ℝ) - Real.log (2 * (k : ℝ) + 1)) := by have hkreal : (k : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hk) have hodd : (2 * (k : ℝ) + 1) ≠ 0 := by positivity have hkfactorial : (k.factorial : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt (Nat.factorial_pos k)) have hoddfactorial : ((2 * k + 1).factorial : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt (Nat.factorial_pos (2 * k + 1))) have hpipow : Real.pi ^ k ≠ (0 : ℝ) := pow_ne_zero k Real.pi_ne_zero have htwopow : (2 : ℝ) ^ (2 * k + 1) ≠ 0 := by positivity unfold normalizedVolumeLog rw [unitBallVolume_odd_factorial, Real.log_div (mul_ne_zero (mul_ne_zero hpipow htwopow) hkfactorial) hoddfactorial, Real.log_mul (mul_ne_zero hpipow htwopow) hkfactorial, Real.log_mul hpipow htwopow, Real.log_pow, Real.log_pow] push_cast field_simp ring theorem tendsto_normalizedVolumeLog_even : Tendsto (fun k : ℕ => normalizedVolumeLog (2 * k)) atTop (nhds ((Real.log (2 * Real.pi) + 1) / 2)) := by have hcore := (tendsto_const_nhds (x := Real.log (2 * Real.pi) / 2)).sub (tendsto_log_factorial_div_nat_sub_log_nat.const_mul (1 / 2 : ℝ)) have hlimit : Tendsto (fun k : ℕ => Real.log (2 * Real.pi) / 2 - (1 / 2 : ℝ) * (Real.log (k.factorial : ℝ) / (k : ℝ) - Real.log (k : ℝ))) atTop (nhds ((Real.log (2 * Real.pi) + 1) / 2)) := by convert! hcore using 1; norm_num; ring refine hlimit.congr' ?_ filter_upwards [eventually_gt_atTop (0 : ℕ)] with k hk have hkreal : (k : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hk) have hkfactorial : (k.factorial : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt (Nat.factorial_pos k)) have hpipow : Real.pi ^ k ≠ (0 : ℝ) := pow_ne_zero k Real.pi_ne_zero unfold normalizedVolumeLog rw [unitBallVolume_even, Real.log_div hpipow hkfactorial, Real.log_pow, Real.log_mul (by norm_num : (2 : ℝ) ≠ 0) Real.pi_ne_zero] push_cast rw [Real.log_mul (by norm_num : (2 : ℝ) ≠ 0) hkreal] field_simp ring theorem tendsto_odd_halfDimension_log_correction : Tendsto (fun k : ℕ => ((k : ℝ) / (2 * (k : ℝ) + 1) - (1 / 2 : ℝ)) * Real.log (k : ℝ)) atTop (nhds 0) := by have hscaled := tendsto_log_nat_div_oddDimension.const_mul (-1 / 2 : ℝ) have hlimit : Tendsto (fun k : ℕ => (-1 / 2 : ℝ) * (Real.log (k : ℝ) / (2 * (k : ℝ) + 1))) atTop (nhds 0) := by convert! hscaled using 1; norm_num refine hlimit.congr' (Filter.Eventually.of_forall ?_) intro k have hodd : 2 * (k : ℝ) + 1 ≠ 0 := by positivity field_simp ring theorem tendsto_log_oddFactorial_div_oddDimension_sub_log : Tendsto (fun k : ℕ => Real.log ((2 * k + 1).factorial : ℝ) / (2 * (k : ℝ) + 1) - Real.log (2 * (k : ℝ) + 1)) atTop (nhds (-1)) := by simpa [Function.comp_def, Nat.cast_add, Nat.cast_mul] using! tendsto_log_factorial_div_nat_sub_log_nat.comp tendsto_oddDimension_atTop theorem tendsto_normalizedVolumeLog_odd : Tendsto (fun k : ℕ => normalizedVolumeLog (2 * k + 1)) atTop (nhds ((Real.log (2 * Real.pi) + 1) / 2)) := by have hq := Stirling.tendsto_self_div_two_mul_self_add_one have hparts := (((((hq.mul_const (Real.log Real.pi)).add (tendsto_const_nhds (x := Real.log (2 : ℝ)))).add (hq.mul tendsto_log_factorial_div_nat_sub_log_nat)).sub tendsto_log_oddFactorial_div_oddDimension_sub_log).add tendsto_odd_halfDimension_log_correction).add (tendsto_log_nat_sub_log_oddDimension.const_mul (1 / 2 : ℝ)) have hconstant : (1 / 2 : ℝ) * Real.log Real.pi + Real.log 2 + (1 / 2 : ℝ) * (-1) - (-1) + 0 + (1 / 2 : ℝ) * Real.log (1 / 2 : ℝ) = (Real.log (2 * Real.pi) + 1) / 2 := by rw [Real.log_div (by norm_num : (1 : ℝ) ≠ 0) (by norm_num : (2 : ℝ) ≠ 0), Real.log_mul (by norm_num : (2 : ℝ) ≠ 0) Real.pi_ne_zero] norm_num ring have hlimit : Tendsto (fun k : ℕ => (k : ℝ) / (2 * (k : ℝ) + 1) * Real.log Real.pi + Real.log 2 + ((k : ℝ) / (2 * (k : ℝ) + 1)) * (Real.log (k.factorial : ℝ) / (k : ℝ) - Real.log (k : ℝ)) - (Real.log ((2 * k + 1).factorial : ℝ) / (2 * (k : ℝ) + 1) - Real.log (2 * (k : ℝ) + 1)) + ((k : ℝ) / (2 * (k : ℝ) + 1) - (1 / 2 : ℝ)) * Real.log (k : ℝ) + (1 / 2 : ℝ) * (Real.log (k : ℝ) - Real.log (2 * (k : ℝ) + 1))) atTop (nhds ((Real.log (2 * Real.pi) + 1) / 2)) := by simpa only [hconstant] using! hparts refine hlimit.congr' ?_ filter_upwards [eventually_gt_atTop (0 : ℕ)] with k hk exact (normalizedVolumeLog_odd_eq k hk).symm theorem tendsto_of_even_and_odd {X : Type*} [TopologicalSpace X] {f : ℕ → X} {x : X} (heven : Tendsto (fun k : ℕ => f (2 * k)) atTop (nhds x)) (hodd : Tendsto (fun k : ℕ => f (2 * k + 1)) atTop (nhds x)) : Tendsto f atTop (nhds x) := by refine Filter.tendsto_iff_forall_eventually_mem.2 ?_ intro s hs obtain ⟨Ne, hNe⟩ := Filter.eventually_atTop.1 (heven.eventually hs) obtain ⟨No, hNo⟩ := Filter.eventually_atTop.1 (hodd.eventually hs) refine Filter.eventually_atTop.2 ⟨2 * max Ne No + 1, ?_⟩ intro n hn rcases Nat.even_or_odd n with he | ho · obtain ⟨k, rfl⟩ := even_iff_exists_two_mul.mp he apply hNe omega · obtain ⟨k, rfl⟩ := odd_iff_exists_bit1.mp ho apply hNo omega theorem tendsto_normalizedVolumeLog : Tendsto normalizedVolumeLog atTop (nhds ((Real.log (2 * Real.pi) + 1) / 2)) := by exact tendsto_of_even_and_odd tendsto_normalizedVolumeLog_even tendsto_normalizedVolumeLog_odd def normalizedVolumeRoot (d : ℕ) : ℝ := unitBallVolume d ^ ((d : ℝ)⁻¹) * Real.sqrt (d : ℝ) theorem normalizedVolumeRoot_pos {d : ℕ} (hd : 0 < d) : 0 < normalizedVolumeRoot d := by unfold normalizedVolumeRoot exact mul_pos (Real.rpow_pos_of_pos (unitBallVolume_pos d) _) (Real.sqrt_pos.2 (by exact_mod_cast hd)) theorem log_normalizedVolumeRoot {d : ℕ} (hd : 0 < d) : Real.log (normalizedVolumeRoot d) = normalizedVolumeLog d := by unfold normalizedVolumeRoot normalizedVolumeLog rw [Real.log_mul (Real.rpow_pos_of_pos (unitBallVolume_pos d) _).ne' (Real.sqrt_pos.2 (by exact_mod_cast hd)).ne', Real.log_rpow (unitBallVolume_pos d), Real.log_sqrt (by exact_mod_cast (Nat.zero_le d))] ring theorem exp_normalizedVolumeLog_limit : Real.exp ((Real.log (2 * Real.pi) + 1) / 2) = Real.sqrt (2 * Real.pi * Real.exp 1) := by have hbase : 0 < (2 : ℝ) * Real.pi := by positivity have htarget : 0 ≤ (2 : ℝ) * Real.pi * Real.exp 1 := by positivity have hsq : (Real.exp ((Real.log (2 * Real.pi) + 1) / 2)) ^ 2 = 2 * Real.pi * Real.exp 1 := by calc (Real.exp ((Real.log (2 * Real.pi) + 1) / 2)) ^ 2 = Real.exp (((Real.log (2 * Real.pi) + 1) / 2) + ((Real.log (2 * Real.pi) + 1) / 2)) := by rw [Real.exp_add] ring _ = Real.exp (Real.log (2 * Real.pi) + 1) := by congr 1 ring _ = 2 * Real.pi * Real.exp 1 := by rw [Real.exp_add, Real.exp_log hbase] have hroot := Real.sq_sqrt htarget nlinarith [Real.exp_pos ((Real.log (2 * Real.pi) + 1) / 2), Real.sqrt_nonneg (2 * Real.pi * Real.exp 1)] theorem tendsto_normalizedVolumeRoot : Tendsto normalizedVolumeRoot atTop (nhds (Real.sqrt (2 * Real.pi * Real.exp 1))) := by have hexp : Tendsto (fun d : ℕ => Real.exp (normalizedVolumeLog d)) atTop (nhds (Real.exp ((Real.log (2 * Real.pi) + 1) / 2))) := Real.continuous_exp.continuousAt.tendsto.comp tendsto_normalizedVolumeLog rw [exp_normalizedVolumeLog_limit] at hexp refine hexp.congr' ?_ filter_upwards [eventually_gt_atTop (0 : ℕ)] with d hd rw [← log_normalizedVolumeRoot hd, Real.exp_log (normalizedVolumeRoot_pos hd)] theorem rpow_two_pow_inv_dimension {d : ℕ} (hd : 0 < d) : ((2 : ℝ) ^ d) ^ ((d : ℝ)⁻¹) = 2 := by have hdreal : (d : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hd) calc ((2 : ℝ) ^ d) ^ ((d : ℝ)⁻¹) = ((2 : ℝ) ^ (d : ℝ)) ^ ((d : ℝ)⁻¹) := by rw [Real.rpow_natCast] _ = (2 : ℝ) ^ ((d : ℝ) * (d : ℝ)⁻¹) := by rw [Real.rpow_mul (by norm_num : (0 : ℝ) ≤ 2)] _ = 2 := by rw [mul_inv_cancel₀ hdreal, Real.rpow_one] theorem packingGeometricRoot_eq_normalizedVolumeRoot_div_two {d : ℕ} (hd : 0 < d) : packingGeometricRoot d = normalizedVolumeRoot d / 2 := by unfold packingGeometricRoot normalizedVolumeRoot rw [Real.div_rpow (unitBallVolume_pos d).le (by positivity), rpow_two_pow_inv_dimension hd] ring theorem tendsto_packingGeometricRoot : Tendsto packingGeometricRoot atTop (nhds (Real.sqrt (2 * Real.pi * Real.exp 1) / 2)) := by have hlimit := tendsto_normalizedVolumeRoot.div_const (2 : ℝ) refine hlimit.congr' ?_ filter_upwards [eventually_gt_atTop (0 : ℕ)] with d hd exact (packingGeometricRoot_eq_normalizedVolumeRoot_div_two hd).symm end noncomputable section open Filter Function MeasureTheory Set open scoped FourierTransform SchwartzMap Topology RealInnerProductSpace Pointwise ContDiff def radialFlatBumpReal (d : ℕ) (x : Euclidean d) : ℝ := expNegInvGlue (1 - 4 * ‖x‖ ^ 2) def radialFlatBumpFun (d : ℕ) (x : Euclidean d) : ℂ := (radialFlatBumpReal d x : ℂ) theorem radialFlatBumpReal_nonneg (d : ℕ) (x : Euclidean d) : 0 ≤ radialFlatBumpReal d x := expNegInvGlue.nonneg _ theorem radialFlatBumpReal_zero_pos (d : ℕ) : 0 < radialFlatBumpReal d (0 : Euclidean d) := by unfold radialFlatBumpReal simpa using! expNegInvGlue.pos_of_pos (by norm_num : (0 : ℝ) < 1) theorem support_radialFlatBumpReal (d : ℕ) : Function.support (radialFlatBumpReal d) = Metric.ball (0 : Euclidean d) (1 / 2 : ℝ) := by ext x simp only [Function.mem_support, radialFlatBumpReal, Metric.mem_ball, dist_zero_right] constructor · intro hx have hpos : 0 < 1 - 4 * ‖x‖ ^ 2 := by exact lt_of_not_ge (fun h => hx (expNegInvGlue.zero_of_nonpos h)) nlinarith [norm_nonneg x] · intro hx have hpos : 0 < 1 - 4 * ‖x‖ ^ 2 := by nlinarith [norm_nonneg x] exact (expNegInvGlue.pos_of_pos hpos).ne' theorem support_radialFlatBumpFun (d : ℕ) : Function.support (radialFlatBumpFun d) = Metric.ball (0 : Euclidean d) (1 / 2 : ℝ) := by rw [← support_radialFlatBumpReal d] ext x simp [radialFlatBumpFun] theorem radialFlatBumpFun_contDiff (d : ℕ) : ContDiff ℝ ∞ (radialFlatBumpFun d) := by change ContDiff ℝ ∞ (fun x : Euclidean d => Complex.ofRealCLM (expNegInvGlue (1 - 4 * ‖x‖ ^ 2))) exact Complex.ofRealCLM.contDiff.comp (expNegInvGlue.contDiff.comp (contDiff_const.sub (contDiff_const.mul (contDiff_norm_sq ℝ)))) theorem radialFlatBumpFun_hasCompactSupport (d : ℕ) : HasCompactSupport (radialFlatBumpFun d) := by apply HasCompactSupport.of_support_subset_isCompact (isCompact_closedBall (0 : Euclidean d) (1 / 2 : ℝ)) rw [support_radialFlatBumpFun] exact Metric.ball_subset_closedBall def radialFlatBump (d : ℕ) : TestFunction d := (radialFlatBumpFun_hasCompactSupport d).toSchwartzMap (radialFlatBumpFun_contDiff d) @[simp] theorem radialFlatBump_apply (d : ℕ) (x : Euclidean d) : radialFlatBump d x = (radialFlatBumpReal d x : ℂ) := by rfl theorem radialFlatBump_real (d : ℕ) : IsRealValued (radialFlatBump d) := by intro x simp theorem radialFlatBump_radial (d : ℕ) : IsRadial (radialFlatBump d) := by intro x y hxy simp [radialFlatBumpReal, hxy] theorem integral_radialFlatBumpReal_pos (d : ℕ) : 0 < ∫ x : Euclidean d, radialFlatBumpReal d x := by apply integral_pos_of_integrable_nonneg_nonzero (show Continuous (radialFlatBumpReal d) by unfold radialFlatBumpReal fun_prop) · have hcomplex : Integrable (radialFlatBump d : Euclidean d → ℂ) := (radialFlatBump d).integrable simpa using! hcomplex.re · exact radialFlatBumpReal_nonneg d · exact (radialFlatBumpReal_zero_pos d).ne' theorem IsRadial.fourier {d : ℕ} {f : TestFunction d} (hf : IsRadial f) : IsRadial (𝓕 f : TestFunction d) := by intro x y hxy let A : Euclidean d ≃ₗᵢ[ℝ] Euclidean d := Submodule.reflection (ℝ ∙ (x - y))ᗮ have hA : A x = y := Submodule.reflection_sub hxy have hcomp : (f : Euclidean d → ℂ) ∘ A = f := by funext z exact hf (A z) z (A.norm_map z) change (𝓕 (f : Euclidean d → ℂ)) x = (𝓕 (f : Euclidean d → ℂ)) y calc (𝓕 (f : Euclidean d → ℂ)) x = (𝓕 ((f : Euclidean d → ℂ) ∘ A)) x := by rw [hcomp] _ = (𝓕 (f : Euclidean d → ℂ)) (A x) := Real.fourier_comp_linearIsometry A (f : Euclidean d → ℂ) x _ = (𝓕 (f : Euclidean d → ℂ)) y := by rw [hA] theorem fourier_conj_apply_of_real {d : ℕ} (f : TestFunction d) (hf : IsRealValued f) (ξ : Euclidean d) : starRingEnd ℂ ((𝓕 f : TestFunction d) ξ) = ((𝓕 f : TestFunction d) (-ξ)) := by change starRingEnd ℂ ((𝓕 (f : Euclidean d → ℂ)) ξ) = (𝓕 (f : Euclidean d → ℂ)) (-ξ) rw [Real.fourier_eq', Real.fourier_eq', ← integral_conj] apply integral_congr_ae filter_upwards with x have hreal : starRingEnd ℂ (f x) = f x := Complex.conj_eq_iff_im.mpr (hf x) have htwo : starRingEnd ℂ (2 : ℂ) = 2 := Complex.conj_ofNat 2 simp [smul_eq_mul, map_mul, ← Complex.exp_conj, hreal, htwo] theorem IsRealValued.fourier_of_radial {d : ℕ} {f : TestFunction d} (hf : IsRealValued f) (hrad : IsRadial f) : IsRealValued (𝓕 f : TestFunction d) := by intro ξ apply Complex.conj_eq_iff_im.mp rw [fourier_conj_apply_of_real f hf] exact hrad.fourier (-ξ) ξ (by simp) def radialAutocorrelation (d : ℕ) : TestFunction d := SchwartzMap.convolution (ContinuousLinearMap.mul ℂ ℂ) (radialFlatBump d) (radialFlatBump d) theorem fourier_radialAutocorrelation_apply (d : ℕ) (ξ : Euclidean d) : ((𝓕 (radialAutocorrelation d) : TestFunction d) ξ) = ((𝓕 (radialFlatBump d) : TestFunction d) ξ) ^ 2 := by unfold radialAutocorrelation rw [SchwartzMap.fourier_convolution] simp [pow_two] theorem fourier_radialFlatBump_real (d : ℕ) : IsRealValued (𝓕 (radialFlatBump d) : TestFunction d) := (radialFlatBump_real d).fourier_of_radial (radialFlatBump_radial d) theorem fourier_radialAutocorrelation_real (d : ℕ) : IsRealValued (𝓕 (radialAutocorrelation d) : TestFunction d) := by intro ξ rw [fourier_radialAutocorrelation_apply] simp [pow_two, Complex.mul_im, fourier_radialFlatBump_real d ξ] theorem fourier_radialAutocorrelation_nonneg (d : ℕ) (ξ : Euclidean d) : 0 ≤ ((𝓕 (radialAutocorrelation d) : TestFunction d) ξ).re := by rw [fourier_radialAutocorrelation_apply] simp only [pow_two, Complex.mul_re, fourier_radialFlatBump_real d ξ, mul_zero, sub_zero] exact mul_self_nonneg _ theorem fourier_radialFlatBump_zero (d : ℕ) : ((𝓕 (radialFlatBump d) : TestFunction d) (0 : Euclidean d)) = (↑(∫ x : Euclidean d, radialFlatBumpReal d x) : ℂ) := by change (𝓕 (radialFlatBump d : Euclidean d → ℂ)) 0 = _ rw [Real.fourier_eq'] simpa [radialFlatBump_apply] using! (integral_ofReal (𝕜 := ℂ) (f := radialFlatBumpReal d) (μ := (volume : Measure (Euclidean d)))) theorem fourier_radialAutocorrelation_zero_pos (d : ℕ) : 0 < ((𝓕 (radialAutocorrelation d) : TestFunction d) (0 : Euclidean d)).re := by rw [fourier_radialAutocorrelation_apply, fourier_radialFlatBump_zero] simpa [pow_two, Complex.mul_re] using! mul_pos (integral_radialFlatBumpReal_pos d) (integral_radialFlatBumpReal_pos d) theorem support_radialFlatBump (d : ℕ) : Function.support (radialFlatBump d : Euclidean d → ℂ) = Metric.ball (0 : Euclidean d) (1 / 2 : ℝ) := support_radialFlatBumpFun d theorem support_radialAutocorrelation_subset (d : ℕ) : Function.support (radialAutocorrelation d : Euclidean d → ℂ) ⊆ Metric.ball (0 : Euclidean d) (1 : ℝ) := by have hconv : (radialAutocorrelation d : Euclidean d → ℂ) = MeasureTheory.convolution (radialFlatBump d : Euclidean d → ℂ) (radialFlatBump d : Euclidean d → ℂ) (ContinuousLinearMap.mul ℂ ℂ) volume := by funext x exact SchwartzMap.convolution_apply (ContinuousLinearMap.mul ℂ ℂ) (radialFlatBump d) (radialFlatBump d) x rw [hconv] calc Function.support (MeasureTheory.convolution (radialFlatBump d : Euclidean d → ℂ) (radialFlatBump d : Euclidean d → ℂ) (ContinuousLinearMap.mul ℂ ℂ) volume) ⊆ Function.support (radialFlatBump d : Euclidean d → ℂ) + Function.support (radialFlatBump d : Euclidean d → ℂ) := MeasureTheory.support_convolution_subset (ContinuousLinearMap.mul ℂ ℂ) _ = Metric.ball (0 : Euclidean d) (1 : ℝ) := by rw [support_radialFlatBump] rw [ball_add_ball (by norm_num : (0 : ℝ) < 1 / 2) (by norm_num : (0 : ℝ) < 1 / 2)] norm_num theorem radialAutocorrelation_outside_eq_zero (d : ℕ) (x : Euclidean d) (hx : 1 ≤ ‖x‖) : radialAutocorrelation d x = 0 := by by_contra hne have hsupport : x ∈ Function.support (radialAutocorrelation d : Euclidean d → ℂ) := hne have hball := support_radialAutocorrelation_subset d hsupport have hnorm : ‖x‖ < (1 : ℝ) := by simpa [Metric.mem_ball, dist_zero_right] using! hball linarith theorem radialAutocorrelation_real (d : ℕ) : IsRealValued (radialAutocorrelation d) := by intro x rw [radialAutocorrelation, SchwartzMap.convolution_apply, MeasureTheory.convolution_def] change (∫ t : Euclidean d, (radialFlatBumpReal d t : ℂ) * (radialFlatBumpReal d (x - t) : ℂ)).im = 0 simp_rw [← Complex.ofReal_mul] have hreal : (∫ t : Euclidean d, (↑(radialFlatBumpReal d t * radialFlatBumpReal d (x - t)) : ℂ)) = (↑(∫ t : Euclidean d, radialFlatBumpReal d t * radialFlatBumpReal d (x - t)) : ℂ) := integral_ofReal (𝕜 := ℂ) rw [hreal] simp theorem fourier_radialAutocorrelation_radial (d : ℕ) : IsRadial (𝓕 (radialAutocorrelation d) : TestFunction d) := by intro x y hxy rw [fourier_radialAutocorrelation_apply, fourier_radialAutocorrelation_apply] rw [(radialFlatBump_radial d).fourier x y hxy] theorem radialAutocorrelation_radial (d : ℕ) : IsRadial (radialAutocorrelation d) := by intro x y hxy have h := (fourier_radialAutocorrelation_radial d).fourier (-x) (-y) (by simpa using! hxy) simpa [fourier_sq_apply] using! h def autocorrelationAdmissible (d : ℕ) : Admissible d where function := radialAutocorrelation d real := radialAutocorrelation_real d radial := radialAutocorrelation_radial d fourier_real := fourier_radialAutocorrelation_real d fourier_nonneg := fourier_radialAutocorrelation_nonneg d fourier_zero_pos := fourier_radialAutocorrelation_zero_pos d outside_nonpos := by intro x hx rw [radialAutocorrelation_outside_eq_zero d x hx] simp theorem admissible_nonempty (d : ℕ) : Nonempty (Admissible d) := ⟨autocorrelationAdmissible d⟩ theorem quotientSet_nonempty (d : ℕ) : (quotientSet d).Nonempty := ⟨quotient (autocorrelationAdmissible d), ⟨autocorrelationAdmissible d, rfl⟩⟩ end noncomputable section theorem log_criticalPackingBase : Real.log criticalPackingBase = (1 / 2 : ℝ) * Real.log (Real.exp 1 / (2 * Real.pi)) := by unfold criticalPackingBase rw [Real.log_sqrt (by positivity)] ring theorem logb_criticalPackingBase : Real.logb 2 criticalPackingBase = -criticalBinaryExponent := by rw [Real.logb, log_criticalPackingBase] unfold criticalBinaryExponent rw [Real.logb] rw [Real.log_div (by positivity) (by positivity), Real.log_div (by positivity) (by positivity), Real.log_exp] ring theorem criticalPackingBase_lt_one : criticalPackingBase < 1 := by unfold criticalPackingBase have hratio : Real.exp 1 / (2 * Real.pi) < 1 := by apply (div_lt_one (by positivity)).2 nlinarith [Real.exp_one_lt_three, Real.pi_gt_three] exact (Real.sqrt_lt' (by norm_num : (0 : ℝ) < 1)).2 (by simpa using! hratio) theorem criticalBinaryExponent_pos : 0 < criticalBinaryExponent := by have hlog : Real.logb 2 criticalPackingBase < 0 := by exact (Real.logb_neg (by norm_num) criticalPackingBase_pos criticalPackingBase_lt_one) rw [logb_criticalPackingBase] at hlog linarith end noncomputable section open Filter open scoped Topology theorem uniformAdmissibleLowerBound_of_signRadius (hsign : UniformAntiFourierSignRadius) : UniformAdmissibleLowerBound := by intro c hc by_cases hpositive : 0 < c · filter_upwards [hsign c hpositive hc, eventually_gt_atTop (0 : ℕ)] with d hno hd intro f exact normalizedCost_ge_of_no_antiFourierWitness f hd c hno · exact Filter.Eventually.of_forall fun d f => (le_of_not_gt hpositive).trans (normalizedCost_nonneg f) theorem normalizedProgram_eq_quotientInf_root_unconditional (d : ℕ) : normalizedProgram d = quotientRootMap d (sInf (quotientSet d)) := normalizedProgram_eq_quotientInf_root d (admissible_nonempty d) theorem quotientInf_nonneg_unconditional (d : ℕ) : 0 ≤ sInf (quotientSet d) := quotientInf_nonneg d (admissible_nonempty d) theorem linearProgram_nonneg (d : ℕ) : 0 ≤ linearProgram d := by unfold linearProgram exact mul_nonneg (geometricFactor_pos d).le (quotientInf_nonneg_unconditional d) theorem linearProgram_root_eq_geometric_mul_normalizedProgram_unconditional {d : ℕ} (hd : 0 < d) : (linearProgram d) ^ ((d : ℝ)⁻¹) = packingGeometricRoot d * normalizedProgram d := linearProgram_root_eq_geometric_mul_normalizedProgram hd (admissible_nonempty d) theorem geometricLimit_mul_criticalRadius : (Real.sqrt (2 * Real.pi * Real.exp 1) / 2) * criticalRadius = criticalPackingBase := by have hleft : (Real.sqrt (2 * Real.pi * Real.exp 1)) ^ 2 = 2 * Real.pi * Real.exp 1 := Real.sq_sqrt (by positivity) have hright : (2 * Real.pi * Real.sqrt (Real.exp 1 / (2 * Real.pi))) ^ 2 = 2 * Real.pi * Real.exp 1 := by rw [mul_pow, mul_pow, Real.sq_sqrt (by positivity)] field_simp have heq : Real.sqrt (2 * Real.pi * Real.exp 1) = 2 * Real.pi * Real.sqrt (Real.exp 1 / (2 * Real.pi)) := by have hleft_nonneg : 0 ≤ Real.sqrt (2 * Real.pi * Real.exp 1) := Real.sqrt_nonneg _ have hright_nonneg : 0 ≤ 2 * Real.pi * Real.sqrt (Real.exp 1 / (2 * Real.pi)) := by positivity nlinarith unfold criticalRadius criticalPackingBase rw [heq] field_simp theorem sharpPackingRoot_of_sharpQuotient (hquotient : SharpQuotientAsymptotic) : SharpPackingRootAsymptotic := by unfold SharpQuotientAsymptotic at hquotient unfold SharpPackingRootAsymptotic have hproduct := tendsto_packingGeometricRoot.mul hquotient rw [geometricLimit_mul_criticalRadius] at hproduct refine hproduct.congr' ?_ filter_upwards [eventually_gt_atTop (0 : ℕ)] with d hd exact (linearProgram_root_eq_geometric_mul_normalizedProgram_unconditional hd).symm theorem eventually_linearProgram_pos_of_sharpQuotient (hquotient : SharpQuotientAsymptotic) : ∀ᶠ d : ℕ in atTop, 0 < linearProgram d := by have hnorm : ∀ᶠ d : ℕ in atTop, 0 < normalizedProgram d := hquotient.eventually (Ioi_mem_nhds criticalRadius_pos) filter_upwards [hnorm, eventually_gt_atTop (0 : ℕ)] with d hpositive hd have hnonneg := quotientInf_nonneg_unconditional d have hinf : 0 < sInf (quotientSet d) := by by_contra hnot have hzero : sInf (quotientSet d) = 0 := le_antisymm (le_of_not_gt hnot) hnonneg rw [normalizedProgram_eq_quotientInf_root_unconditional d, hzero] at hpositive have hdreal : (d : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hd) simp [quotientRootMap, hdreal] at hpositive unfold linearProgram exact mul_pos (geometricFactor_pos d) hinf theorem sharpLog_of_sharpQuotient (hquotient : SharpQuotientAsymptotic) : SharpLogAsymptotic := by have hroot := sharpPackingRoot_of_sharpQuotient hquotient unfold SharpPackingRootAsymptotic at hroot have hlogs := hroot.log criticalPackingBase_pos.ne' rw [log_criticalPackingBase] at hlogs unfold SharpLogAsymptotic refine hlogs.congr' ?_ filter_upwards [eventually_linearProgram_pos_of_sharpQuotient hquotient] with d hd rw [Real.log_rpow hd] ring def SharpBinaryLogAsymptotic : Prop := Tendsto (fun d : ℕ => Real.logb 2 (linearProgram d) / (d : ℝ)) atTop (nhds (-criticalBinaryExponent)) theorem sharpBinaryLog_of_sharpQuotient (hquotient : SharpQuotientAsymptotic) : SharpBinaryLogAsymptotic := by have hnatural := sharpLog_of_sharpQuotient hquotient unfold SharpLogAsymptotic at hnatural have hscaled := hnatural.div_const (Real.log 2) have hconstant : ((1 / 2 : ℝ) * Real.log (Real.exp 1 / (2 * Real.pi))) / Real.log 2 = -criticalBinaryExponent := by calc _ = Real.log criticalPackingBase / Real.log 2 := by rw [log_criticalPackingBase] _ = Real.logb 2 criticalPackingBase := by rfl _ = -criticalBinaryExponent := logb_criticalPackingBase rw [hconstant] at hscaled unfold SharpBinaryLogAsymptotic refine hscaled.congr' (Filter.Eventually.of_forall ?_) intro d change (Real.log (linearProgram d) / (d : ℝ)) / Real.log 2 = (Real.log (linearProgram d) / Real.log 2) / (d : ℝ) ring theorem sharpAsymptotics_of_uniform_lower_and_ordered_upper (hlower : UniformAdmissibleLowerBound) (construction : OrderedEpsilonUpperConstruction) : SharpQuotientAsymptotic ∧ SharpPackingRootAsymptotic ∧ SharpLogAsymptotic ∧ SharpBinaryLogAsymptotic := by have hquotient := sharpQuotient_of_uniform_lower_and_ordered_upper hlower construction exact ⟨hquotient, sharpPackingRoot_of_sharpQuotient hquotient, sharpLog_of_sharpQuotient hquotient, sharpBinaryLog_of_sharpQuotient hquotient⟩ theorem sharpAsymptotics_of_signRadius_and_ordered_upper (hsign : UniformAntiFourierSignRadius) (construction : OrderedEpsilonUpperConstruction) : SharpQuotientAsymptotic ∧ SharpPackingRootAsymptotic ∧ SharpLogAsymptotic ∧ SharpBinaryLogAsymptotic := sharpAsymptotics_of_uniform_lower_and_ordered_upper (uniformAdmissibleLowerBound_of_signRadius hsign) construction theorem saddleSourceSchwartzRealization : SaddleSourceSchwartzRealization := by intro ε hε horder d hd refine ⟨minusSaddleSchwartz hε hd horder, plusSaddleSchwartz hε hd horder, ?_, ?_⟩ · intro x rfl · intro x rfl noncomputable def saddleOrderedUpperConstruction_of_sourceSigns (hsigns : SaddleSourceEventualSigns) : OrderedEpsilonUpperConstruction := saddleOrderedUpperConstruction saddleSourceSchwartzRealization hsigns theorem sharpAsymptotics_of_saddleSourceEventualSigns (hsigns : SaddleSourceEventualSigns) : SharpQuotientAsymptotic ∧ SharpPackingRootAsymptotic ∧ SharpLogAsymptotic ∧ SharpBinaryLogAsymptotic := sharpAsymptotics_of_signRadius_and_ordered_upper uniformAntiFourierSignRadius (saddleOrderedUpperConstruction_of_sourceSigns hsigns) end noncomputable section open Filter MeasureTheory Set open scoped FourierTransform SchwartzMap Topology theorem eventually_plusSaddleProfile_nonneg_on_star : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ᶠ d : ℕ in atTop, ∀ r : ℝ, 0 ≤ r → r ≤ saddleSmallRadiusStar ε d → 0 ≤ (plusSaddleProfile ε ((d : ℝ) / 2) r).re := by filter_upwards [eventually_plusSaddleProfile_re_pos_on_star] with ε hε filter_upwards [hε] with d hd intro r hr hstar exact (hd r hr hstar).le theorem plusSaddleProfile_re_pos_at_sourceSaddle_of_gaussian_error {ε : ℝ} {d : ℕ} {u : ℝ} (hε : 0 < ε) (hd : 0 < d) (hu : -1 < u) (horder : shortCutoff ε ≤ shortEndpoint ε) (hV : 0 < saddleSourceGaussianVariance ε ((d : ℝ) / 2) u) (herror : ‖(∫ T : ℝ, saddleSourceCenteredPlusIntegrand ε ((d : ℝ) / 2) u (saddleLogRadius ε d u) T) - (∫ T : ℝ, saddleSourceGaussianPlusIntegrand ε ((d : ℝ) / 2) u T)‖ < (∫ T : ℝ, saddleSourceGaussianPlusIntegrand ε ((d : ℝ) / 2) u T).re) : 0 < (plusSaddleProfile ε ((d : ℝ) / 2) (Real.exp (saddleLogRadius ε d u))).re := by have hℓ : 0 < (d : ℝ) / 2 := by positivity exact plusSaddleProfile_exp_re_pos_of_gaussian_error hε hℓ hu horder hV herror theorem minusSaddleProfile_re_neg_at_sourceSaddle_of_gaussian_error {ε : ℝ} {d : ℕ} {u : ℝ} (hε : 0 < ε) (hd : 0 < d) (hu : -1 < u) (horder : shortCutoff ε ≤ shortEndpoint ε) (hV : 0 < saddleSourceGaussianVariance ε ((d : ℝ) / 2) u) (herror : ‖(∫ T : ℝ, saddleSourceCenteredMinusIntegrand ε ((d : ℝ) / 2) u (saddleLogRadius ε d u) T) - (∫ T : ℝ, saddleSourceGaussianMinusIntegrand ε ((d : ℝ) / 2) u T)‖ < -(∫ T : ℝ, saddleSourceGaussianMinusIntegrand ε ((d : ℝ) / 2) u T).re) : (minusSaddleProfile ε ((d : ℝ) / 2) (Real.exp (saddleLogRadius ε d u))).re < 0 := by have hℓ : 0 < (d : ℝ) / 2 := by positivity exact minusSaddleProfile_exp_re_neg_of_gaussian_error hε hℓ hu horder hV herror theorem saddleSourceGaussianPlusIntegrand_integral_re_eq_norm {ε ℓ u : ℝ} (hε : 0 < ε) (hu : -1 < u) : (∫ T : ℝ, saddleSourceGaussianPlusIntegrand ε ℓ u T).re = ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by have hvalue : 0 < beta ε + (1 - u) ^ 2 * (1 + u) := by have h := plusPolynomial_imaginary_re_pos hε hu rw [plusPolynomial_imaginary, Complex.ofReal_re] at h exact h rw [saddleSourceGaussianPlusIntegrand_integral, saddleSourceGaussianKernel_integral, plusPolynomial_imaginary] simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hvalue] ring theorem saddleSourceGaussianMinusIntegrand_neg_integral_re_eq_norm {ε ℓ u : ℝ} (hε : 0 < ε) (hu : 1 + ε / 4 ≤ u) : -(∫ T : ℝ, saddleSourceGaussianMinusIntegrand ε ℓ u T).re = ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by have hvalue : beta ε + (1 - u) * (1 + u) ^ 2 < 0 := by have h := minusPolynomial_imaginary_re_neg hε hu rw [minusPolynomial_imaginary, Complex.ofReal_re] at h exact h rw [saddleSourceGaussianMinusIntegrand_integral, saddleSourceGaussianKernel_integral, minusPolynomial_imaginary] simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero, Complex.norm_real, Real.norm_eq_abs, abs_of_neg hvalue] ring theorem saddleSmallRadiusStarOrdinate_sourceScale {d : ℕ} (hd : 0 < d) (ε : ℝ) {u : ℝ} (hu : saddleSmallRadiusStarOrdinate ε d ≤ u) : Real.log ((d : ℝ) / 2) / 4 ≤ ((d : ℝ) / 2) * (1 + u) := by let ℓ : ℝ := (d : ℝ) / 2 have hℓ : 0 < ℓ := by try dsimp [ℓ] positivity have hstar : ℓ * (1 + saddleSmallRadiusStarOrdinate ε d) = Real.log ℓ / 4 := by unfold saddleSmallRadiusStarOrdinate try dsimp [ℓ] field_simp [hℓ.ne'] ring change Real.log ℓ / 4 ≤ ℓ * (1 + u) rw [← hstar] apply mul_le_mul_of_nonneg_left _ hℓ.le linarith theorem saddleSource_positiveOrdinate_sourceScale {ℓ u : ℝ} (hℓ : 0 < ℓ) (hu : 1 ≤ u) : Real.log ℓ / 4 ≤ ℓ * (1 + u) := by have hlog := Real.log_le_sub_one_of_pos hℓ have hproduct := mul_nonneg hℓ.le (sub_nonneg.mpr hu) nlinarith theorem eventually_plusSaddleProfile_re_pos_at_firstBranchSaddles : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ᶠ d : ℕ in atTop, ∀ u : ℝ, saddleSmallRadiusStarOrdinate ε d ≤ u → u ≤ 1 + ε / 2 → 0 < (plusSaddleProfile ε ((d : ℝ) / 2) (Real.exp (saddleLogRadius ε d u))).re := by filter_upwards [self_mem_nhdsWithin, eventually_upper_shortCutoff_le_shortEndpoint, eventually_saddleSourceGaussianVariance_firstBranch_pos, eventually_saddleSourceFirstBranch_fullGaussianErrors] with ε hε horder hvariance hfull change 0 < ε at hε have hdimension := tendsto_saddleResidue_dimension_half.eventually hfull filter_upwards [hdimension, eventually_saddleSmallRadiusStarOrdinate_gt_neg_one ε, eventually_gt_atTop (0 : ℕ)] with d hdimen hstar hd intro u hu hupper have hulower : -1 < u := hstar.trans_le hu have hℓ : 0 < (d : ℝ) / 2 := by positivity have hscale := saddleSmallRadiusStarOrdinate_sourceScale hd ε hu have herr := (hdimen u hulower hupper hscale).1 have hV := hvariance ((d : ℝ) / 2) hℓ u hulower hupper have herror : ‖(∫ T : ℝ, saddleSourceCenteredPlusIntegrand ε ((d : ℝ) / 2) u (saddleLogRadius ε d u) T) - (∫ T : ℝ, saddleSourceGaussianPlusIntegrand ε ((d : ℝ) / 2) u T)‖ < (∫ T : ℝ, saddleSourceGaussianPlusIntegrand ε ((d : ℝ) / 2) u T).re := by rw [saddleSourceGaussianPlusIntegrand_integral_re_eq_norm hε hulower] simpa [saddleSourceStationaryLogRadius_eq_saddleLogRadius] using! herr exact plusSaddleProfile_re_pos_at_sourceSaddle_of_gaussian_error hε hd hulower horder hV herror theorem eventually_minusSaddleProfile_re_neg_at_firstBranchSaddles : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ᶠ d : ℕ in atTop, ∀ u : ℝ, 1 + ε / 4 ≤ u → u ≤ 1 + ε / 2 → (minusSaddleProfile ε ((d : ℝ) / 2) (Real.exp (saddleLogRadius ε d u))).re < 0 := by filter_upwards [self_mem_nhdsWithin, eventually_upper_shortCutoff_le_shortEndpoint, eventually_saddleSourceGaussianVariance_firstBranch_pos, eventually_saddleSourceFirstBranch_fullGaussianErrors] with ε hε horder hvariance hfull change 0 < ε at hε have hdimension := tendsto_saddleResidue_dimension_half.eventually hfull filter_upwards [hdimension, eventually_gt_atTop (0 : ℕ)] with d hdimen hd intro u hulower hupper have hℓ : 0 < (d : ℝ) / 2 := by positivity have hu : -1 < u := by linarith have huone : 1 ≤ u := by linarith have hscale := saddleSource_positiveOrdinate_sourceScale hℓ huone have herr := (hdimen u hu hupper hscale).2 hulower have hV := hvariance ((d : ℝ) / 2) hℓ u hu hupper have herror : ‖(∫ T : ℝ, saddleSourceCenteredMinusIntegrand ε ((d : ℝ) / 2) u (saddleLogRadius ε d u) T) - (∫ T : ℝ, saddleSourceGaussianMinusIntegrand ε ((d : ℝ) / 2) u T)‖ < -(∫ T : ℝ, saddleSourceGaussianMinusIntegrand ε ((d : ℝ) / 2) u T).re := by rw [saddleSourceGaussianMinusIntegrand_neg_integral_re_eq_norm hε hulower] simpa [saddleSourceStationaryLogRadius_eq_saddleLogRadius] using! herr exact minusSaddleProfile_re_neg_at_sourceSaddle_of_gaussian_error hε hd hu horder hV herror theorem eventually_plusSaddleProfile_re_pos_at_secondBranchSaddles : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ᶠ d : ℕ in atTop, ∀ u : ℝ, 1 + ε / 2 ≤ u → 0 < (plusSaddleProfile ε ((d : ℝ) / 2) (Real.exp (saddleLogRadius ε d u))).re := by filter_upwards [self_mem_nhdsWithin, eventually_upper_shortCutoff_le_shortEndpoint, eventually_saddleSourceGaussianVariance_secondBranch_pos, eventually_saddleSourceSecondBranch_fullGaussianErrors] with ε hε horder hvariance hfull change 0 < ε at hε have hdimension := tendsto_saddleResidue_dimension_half.eventually hfull filter_upwards [hdimension, eventually_gt_atTop (0 : ℕ)] with d hdimen hd intro u hu let δ : ℝ := u - 1 have hδ : ε / 2 ≤ δ := by try dsimp [δ] linarith have hidentity : 1 + δ = u := by try dsimp [δ] ring have hulower : -1 < u := by linarith have hℓ : 0 < (d : ℝ) / 2 := by positivity have hV : 0 < saddleSourceGaussianVariance ε ((d : ℝ) / 2) u := by simpa only [hidentity] using! hvariance ((d : ℝ) / 2) hℓ δ hδ have herr := (hdimen δ hδ).1 rw [hidentity] at herr have herror : ‖(∫ T : ℝ, saddleSourceCenteredPlusIntegrand ε ((d : ℝ) / 2) u (saddleLogRadius ε d u) T) - (∫ T : ℝ, saddleSourceGaussianPlusIntegrand ε ((d : ℝ) / 2) u T)‖ < (∫ T : ℝ, saddleSourceGaussianPlusIntegrand ε ((d : ℝ) / 2) u T).re := by rw [saddleSourceGaussianPlusIntegrand_integral_re_eq_norm hε hulower] simpa [saddleSourceStationaryLogRadius_eq_saddleLogRadius] using! herr exact plusSaddleProfile_re_pos_at_sourceSaddle_of_gaussian_error hε hd hulower horder hV herror theorem eventually_minusSaddleProfile_re_neg_at_secondBranchSaddles : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ᶠ d : ℕ in atTop, ∀ u : ℝ, 1 + ε / 2 ≤ u → (minusSaddleProfile ε ((d : ℝ) / 2) (Real.exp (saddleLogRadius ε d u))).re < 0 := by filter_upwards [self_mem_nhdsWithin, eventually_upper_shortCutoff_le_shortEndpoint, eventually_saddleSourceGaussianVariance_secondBranch_pos, eventually_saddleSourceSecondBranch_fullGaussianErrors] with ε hε horder hvariance hfull change 0 < ε at hε have hdimension := tendsto_saddleResidue_dimension_half.eventually hfull filter_upwards [hdimension, eventually_gt_atTop (0 : ℕ)] with d hdimen hd intro u hu let δ : ℝ := u - 1 have hδ : ε / 2 ≤ δ := by try dsimp [δ] linarith have hidentity : 1 + δ = u := by try dsimp [δ] ring have hulower : -1 < u := by linarith have huminus : 1 + ε / 4 ≤ u := by linarith have hℓ : 0 < (d : ℝ) / 2 := by positivity have hV : 0 < saddleSourceGaussianVariance ε ((d : ℝ) / 2) u := by simpa only [hidentity] using! hvariance ((d : ℝ) / 2) hℓ δ hδ have herr := (hdimen δ hδ).2 rw [hidentity] at herr have herror : ‖(∫ T : ℝ, saddleSourceCenteredMinusIntegrand ε ((d : ℝ) / 2) u (saddleLogRadius ε d u) T) - (∫ T : ℝ, saddleSourceGaussianMinusIntegrand ε ((d : ℝ) / 2) u T)‖ < -(∫ T : ℝ, saddleSourceGaussianMinusIntegrand ε ((d : ℝ) / 2) u T).re := by rw [saddleSourceGaussianMinusIntegrand_neg_integral_re_eq_norm hε huminus] simpa [saddleSourceStationaryLogRadius_eq_saddleLogRadius] using! herr exact minusSaddleProfile_re_neg_at_sourceSaddle_of_gaussian_error hε hd hulower horder hV herror theorem eventually_plusSaddleProfile_nonneg_of_star : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ᶠ d : ℕ in atTop, ∀ r : ℝ, saddleSmallRadiusStar ε d ≤ r → 0 ≤ (plusSaddleProfile ε ((d : ℝ) / 2) r).re := by filter_upwards [eventually_saddleSmallRadiusStar_log_coverage, eventually_plusSaddleProfile_re_pos_at_firstBranchSaddles, eventually_plusSaddleProfile_re_pos_at_secondBranchSaddles] with ε hcoverage hfirst hsecond filter_upwards [hcoverage, hfirst, hsecond] with d hcoverage_d hfirst_d hsecond_d intro r hr obtain ⟨u, hu, hlog⟩ := hcoverage_d r hr have hrpos : 0 < r := (saddleSmallRadiusStar_pos ε d).trans_le hr have hexp : Real.exp (saddleLogRadius ε d u) = r := by rw [hlog, Real.exp_log hrpos] by_cases hbranch : u ≤ 1 + ε / 2 · have h := hfirst_d u hu hbranch rw [hexp] at h exact h.le · have hupper : 1 + ε / 2 ≤ u := (lt_of_not_ge hbranch).le have h := hsecond_d u hupper rw [hexp] at h exact h.le theorem eventually_minusSaddleProfile_nonpos_of_sourceRadius : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), ∀ᶠ d : ℕ in atTop, ∀ r : ℝ, saddleSourceRadius ε d ≤ r → (minusSaddleProfile ε ((d : ℝ) / 2) r).re ≤ 0 := by filter_upwards [eventually_saddleSourceRadius_log_coverage, eventually_minusSaddleProfile_re_neg_at_firstBranchSaddles, eventually_minusSaddleProfile_re_neg_at_secondBranchSaddles] with ε hcoverage hfirst hsecond filter_upwards [hfirst, hsecond, eventually_gt_atTop (0 : ℕ)] with d hfirst_d hsecond_d hd intro r hr obtain ⟨u, hu, hlog⟩ := hcoverage d hd r hr have hrpos : 0 < r := (saddleSourceRadius_pos ε d).trans_le hr have hexp : Real.exp (saddleLogRadius ε d u) = r := by rw [hlog, Real.exp_log hrpos] by_cases hbranch : u ≤ 1 + ε / 2 · have h := hfirst_d u hu hbranch rw [hexp] at h exact h.le · have hupper : 1 + ε / 2 ≤ u := (lt_of_not_ge hbranch).le have h := hsecond_d u hupper rw [hexp] at h exact h.le theorem saddleSourceEventualSigns : SaddleSourceEventualSigns := by unfold SaddleSourceEventualSigns filter_upwards [eventually_plusSaddleProfile_nonneg_on_star, eventually_plusSaddleProfile_nonneg_of_star, eventually_minusSaddleProfile_nonpos_of_sourceRadius] with ε hsmall hlarge hminus filter_upwards [hsmall, hlarge, hminus] with d hsmall_d hlarge_d hminus_d constructor · intro x change 0 ≤ (plusSaddleProfile ε ((d : ℝ) / 2) ‖x‖).re rcases le_total ‖x‖ (saddleSmallRadiusStar ε d) with hx | hx · exact hsmall_d ‖x‖ (norm_nonneg x) hx · exact hlarge_d ‖x‖ hx · intro x hx change (minusSaddleProfile ε ((d : ℝ) / 2) ‖x‖).re ≤ 0 exact hminus_d ‖x‖ hx theorem sharpAsymptotics : SharpQuotientAsymptotic ∧ SharpPackingRootAsymptotic ∧ SharpLogAsymptotic ∧ SharpBinaryLogAsymptotic := sharpAsymptotics_of_saddleSourceEventualSigns saddleSourceEventualSigns theorem sharpQuotientAsymptotic : SharpQuotientAsymptotic := sharpAsymptotics.1 theorem sharpPackingRootAsymptotic : SharpPackingRootAsymptotic := sharpAsymptotics.2.1 theorem sharpLogAsymptotic : SharpLogAsymptotic := sharpAsymptotics.2.2.1 theorem sharpBinaryLogAsymptotic : SharpBinaryLogAsymptotic := sharpAsymptotics.2.2.2 end noncomputable section open Filter open scoped Topology def manuscriptQuotientRootSet (d : ℕ) : Set ℝ := Set.range fun f : Admissible d => quotient f ^ ((d : ℝ)⁻¹) theorem manuscriptQuotientRootSet_eq_image (d : ℕ) : manuscriptQuotientRootSet d = (fun x : ℝ => x ^ ((d : ℝ)⁻¹)) '' quotientSet d := by ext y constructor · rintro ⟨f, rfl⟩ exact ⟨quotient f, ⟨f, rfl⟩, rfl⟩ · rintro ⟨_, ⟨f, rfl⟩, rfl⟩ exact ⟨f, rfl⟩ theorem manuscriptQuotientRootInf_eq (d : ℕ) : sInf (manuscriptQuotientRootSet d) = (sInf (quotientSet d)) ^ ((d : ℝ)⁻¹) := by have hcontinuous : Continuous (fun x : ℝ => x ^ ((d : ℝ)⁻¹)) := Real.continuous_rpow_const (by positivity) have hmono : MonotoneOn (fun x : ℝ => x ^ ((d : ℝ)⁻¹)) (quotientSet d) := by intro x hx y _ hxy obtain ⟨f, rfl⟩ := hx exact Real.rpow_le_rpow (quotient_pos f).le hxy (by positivity) obtain ⟨f⟩ := admissible_nonempty d have hnonempty : (quotientSet d).Nonempty := ⟨quotient f, ⟨f, rfl⟩⟩ rw [manuscriptQuotientRootSet_eq_image] exact (MonotoneOn.map_csInf_of_continuousWithinAt hcontinuous.continuousWithinAt hmono hnonempty (quotientSet_bddBelow d)).symm def manuscriptNormalizedQuotientInfRoot (d : ℕ) : ℝ := (sInf (quotientSet d)) ^ ((d : ℝ)⁻¹) / Real.sqrt (d : ℝ) theorem manuscriptNormalizedQuotientInfRoot_eq (d : ℕ) : manuscriptNormalizedQuotientInfRoot d = normalizedProgram d := by rw [normalizedProgram_eq_quotientInf_root_unconditional] rfl theorem manuscriptQuotientRootInf_div_sqrt_eq (d : ℕ) : sInf (manuscriptQuotientRootSet d) / Real.sqrt (d : ℝ) = normalizedProgram d := by rw [manuscriptQuotientRootInf_eq] exact manuscriptNormalizedQuotientInfRoot_eq d theorem manuscriptQuotientRootInf_div_sqrt_tendsto (hquotient : SharpQuotientAsymptotic) : Tendsto (fun d : ℕ => sInf (manuscriptQuotientRootSet d) / Real.sqrt (d : ℝ)) atTop (nhds ((Real.pi)⁻¹)) := by change Tendsto (fun d : ℕ => sInf (manuscriptQuotientRootSet d) / Real.sqrt (d : ℝ)) atTop (nhds criticalRadius) unfold SharpQuotientAsymptotic at hquotient exact hquotient.congr' (Filter.Eventually.of_forall fun d => (manuscriptQuotientRootInf_div_sqrt_eq d).symm) def manuscriptPackingDeficit (d : ℕ) : ℝ := max 0 (criticalPackingBase - (linearProgram d) ^ ((d : ℝ)⁻¹)) theorem manuscriptPackingDeficit_nonneg (d : ℕ) : 0 ≤ manuscriptPackingDeficit d := by exact le_max_left _ _ theorem manuscriptPackingDeficit_le_criticalPackingBase (d : ℕ) : manuscriptPackingDeficit d ≤ criticalPackingBase := by unfold manuscriptPackingDeficit refine max_le criticalPackingBase_pos.le ?_ have hroot : 0 ≤ (linearProgram d) ^ ((d : ℝ)⁻¹) := Real.rpow_nonneg (linearProgram_nonneg d) _ linarith theorem tendsto_manuscriptPackingDeficit (hpacking : SharpPackingRootAsymptotic) : Tendsto manuscriptPackingDeficit atTop (nhds (0 : ℝ)) := by unfold SharpPackingRootAsymptotic at hpacking have hconstant : Tendsto (fun _ : ℕ => criticalPackingBase) atTop (nhds criticalPackingBase) := tendsto_const_nhds have hsub : Tendsto (fun d : ℕ => criticalPackingBase - (linearProgram d) ^ ((d : ℝ)⁻¹)) atTop (nhds (0 : ℝ)) := by simpa using! hconstant.sub hpacking have hmax := (tendsto_const_nhds (f := atTop) (x := (0 : ℝ))).max hsub simpa [manuscriptPackingDeficit] using! hmax theorem manuscriptPackingRoot_sub_deficit_le (d : ℕ) : criticalPackingBase - manuscriptPackingDeficit d ≤ (linearProgram d) ^ ((d : ℝ)⁻¹) := by have hdeficit : criticalPackingBase - (linearProgram d) ^ ((d : ℝ)⁻¹) ≤ manuscriptPackingDeficit d := by exact le_max_right _ _ linarith theorem manuscriptPackingRoot_sub_deficit_pow_le {d : ℕ} (hd : 0 < d) : (criticalPackingBase - manuscriptPackingDeficit d) ^ d ≤ linearProgram d := by have hbase : 0 ≤ criticalPackingBase - manuscriptPackingDeficit d := sub_nonneg.mpr (manuscriptPackingDeficit_le_criticalPackingBase d) have hpower := pow_le_pow_left₀ hbase (manuscriptPackingRoot_sub_deficit_le d) d rw [Real.rpow_inv_natCast_pow (linearProgram_nonneg d) (Nat.ne_of_gt hd)] at hpower exact hpower theorem linearProgram_le_geometric_mul_quotient {d : ℕ} (f : Admissible d) : linearProgram d ≤ (unitBallVolume d / (2 : ℝ) ^ d) * quotient f := by unfold linearProgram exact mul_le_mul_of_nonneg_left (csInf_le (quotientSet_bddBelow d) ⟨f, rfl⟩) (geometricFactor_pos d).le theorem manuscriptUniversalQuotientBound {d : ℕ} (hd : 0 < d) (f : Admissible d) : (2 : ℝ) ^ d / unitBallVolume d * (criticalPackingBase - manuscriptPackingDeficit d) ^ d ≤ quotient f := by have hprogram := (manuscriptPackingRoot_sub_deficit_pow_le hd).trans (linearProgram_le_geometric_mul_quotient f) calc (2 : ℝ) ^ d / unitBallVolume d * (criticalPackingBase - manuscriptPackingDeficit d) ^ d ≤ (2 : ℝ) ^ d / unitBallVolume d * ((unitBallVolume d / (2 : ℝ) ^ d) * quotient f) := by exact mul_le_mul_of_nonneg_left hprogram (div_pos (pow_pos (by norm_num : (0 : ℝ) < 2) d) (unitBallVolume_pos d)).le _ = quotient f := by have hv := (unitBallVolume_pos d).ne' field_simp def manuscriptPackingRootError (d : ℕ) : ℝ := (linearProgram d) ^ ((d : ℝ)⁻¹) - criticalPackingBase theorem tendsto_manuscriptPackingRootError (hpacking : SharpPackingRootAsymptotic) : Tendsto manuscriptPackingRootError atTop (nhds (0 : ℝ)) := by unfold SharpPackingRootAsymptotic at hpacking have hconstant : Tendsto (fun _ : ℕ => criticalPackingBase) atTop (nhds criticalPackingBase) := tendsto_const_nhds simpa [manuscriptPackingRootError] using! hpacking.sub hconstant theorem manuscriptLinearProgram_eq_packing_error_pow {d : ℕ} (hd : 0 < d) : linearProgram d = (criticalPackingBase + manuscriptPackingRootError d) ^ d := by have hroot : criticalPackingBase + manuscriptPackingRootError d = (linearProgram d) ^ ((d : ℝ)⁻¹) := by unfold manuscriptPackingRootError ring rw [hroot] exact (Real.rpow_inv_natCast_pow (linearProgram_nonneg d) (Nat.ne_of_gt hd)).symm def manuscriptBinaryExponentError (d : ℕ) : ℝ := -(Real.logb 2 (linearProgram d) / (d : ℝ)) - criticalBinaryExponent theorem tendsto_manuscriptBinaryExponentError (hbinary : SharpBinaryLogAsymptotic) : Tendsto manuscriptBinaryExponentError atTop (nhds (0 : ℝ)) := by unfold SharpBinaryLogAsymptotic at hbinary have hconstant : Tendsto (fun _ : ℕ => criticalBinaryExponent) atTop (nhds criticalBinaryExponent) := tendsto_const_nhds simpa [manuscriptBinaryExponentError] using! hbinary.neg.sub hconstant theorem manuscriptLinearProgram_eq_binary_error_rpow {d : ℕ} (hd : 0 < d) (hpositive : 0 < linearProgram d) : linearProgram d = (2 : ℝ) ^ (-(criticalBinaryExponent + manuscriptBinaryExponentError d) * (d : ℝ)) := by have hdreal : (d : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hd) have hexponent : -(criticalBinaryExponent + manuscriptBinaryExponentError d) * (d : ℝ) = Real.logb 2 (linearProgram d) := by unfold manuscriptBinaryExponentError field_simp ring rw [hexponent] exact (Real.rpow_logb (by norm_num) (by norm_num) hpositive).symm def manuscriptQuotientRootError (d : ℕ) : ℝ := normalizedProgram d - criticalRadius theorem tendsto_manuscriptQuotientRootError : Tendsto manuscriptQuotientRootError atTop (nhds (0 : ℝ)) := by have hquotient : Tendsto normalizedProgram atTop (nhds criticalRadius) := sharpQuotientAsymptotic have hconstant : Tendsto (fun _ : ℕ => criticalRadius) atTop (nhds criticalRadius) := tendsto_const_nhds simpa [manuscriptQuotientRootError] using! hquotient.sub hconstant theorem manuscriptQuotientRootError_isLittleO : Asymptotics.IsLittleO atTop manuscriptQuotientRootError (fun _ : ℕ => (1 : ℝ)) := (Asymptotics.isLittleO_one_iff ℝ).2 tendsto_manuscriptQuotientRootError theorem manuscriptQuotientRootInf_eq_critical_add_error {d : ℕ} (hd : 0 < d) : sInf (manuscriptQuotientRootSet d) = ((Real.pi)⁻¹ + manuscriptQuotientRootError d) * Real.sqrt (d : ℝ) := by have hsqrt : 0 < Real.sqrt (d : ℝ) := by positivity have hroot := (div_eq_iff hsqrt.ne').mp (manuscriptQuotientRootInf_div_sqrt_eq d) calc sInf (manuscriptQuotientRootSet d) = normalizedProgram d * Real.sqrt (d : ℝ) := hroot _ = ((Real.pi)⁻¹ + manuscriptQuotientRootError d) * Real.sqrt (d : ℝ) := by unfold manuscriptQuotientRootError criticalRadius ring theorem exists_manuscriptQuotientRootIsLittleO : ∃ e : ℕ → ℝ, Asymptotics.IsLittleO atTop e (fun _ : ℕ => (1 : ℝ)) ∧ ∀ d : ℕ, 0 < d → sInf (manuscriptQuotientRootSet d) = ((Real.pi)⁻¹ + e d) * Real.sqrt (d : ℝ) := by refine ⟨manuscriptQuotientRootError, manuscriptQuotientRootError_isLittleO, ?_⟩ intro d hd exact manuscriptQuotientRootInf_eq_critical_add_error hd theorem manuscriptPackingRootError_tendsto : Tendsto manuscriptPackingRootError atTop (nhds (0 : ℝ)) := tendsto_manuscriptPackingRootError sharpPackingRootAsymptotic theorem manuscriptPackingRootError_isLittleO : Asymptotics.IsLittleO atTop manuscriptPackingRootError (fun _ : ℕ => (1 : ℝ)) := (Asymptotics.isLittleO_one_iff ℝ).2 manuscriptPackingRootError_tendsto theorem manuscriptLinearProgram_eq_canonicalPackingPow {d : ℕ} (hd : 0 < d) : linearProgram d = (criticalPackingBase + manuscriptPackingRootError d) ^ d := manuscriptLinearProgram_eq_packing_error_pow hd theorem exists_manuscriptPackingIsLittleO : ∃ e : ℕ → ℝ, Asymptotics.IsLittleO atTop e (fun _ : ℕ => (1 : ℝ)) ∧ ∀ d : ℕ, 0 < d → linearProgram d = (criticalPackingBase + e d) ^ d := by exact ⟨manuscriptPackingRootError, manuscriptPackingRootError_isLittleO, fun _ hd => manuscriptLinearProgram_eq_canonicalPackingPow hd⟩ theorem manuscriptPackingDeficit_isLittleO : Asymptotics.IsLittleO atTop manuscriptPackingDeficit (fun _ : ℕ => (1 : ℝ)) := (Asymptotics.isLittleO_one_iff ℝ).2 (tendsto_manuscriptPackingDeficit sharpPackingRootAsymptotic) theorem exists_manuscriptUniversalPackingIsLittleO : ∃ δ : ℕ → ℝ, Asymptotics.IsLittleO atTop δ (fun _ : ℕ => (1 : ℝ)) ∧ (∀ d : ℕ, 0 ≤ δ d) ∧ (∀ d : ℕ, 0 < d → ∀ f : Admissible d, (2 : ℝ) ^ d / unitBallVolume d * (criticalPackingBase - δ d) ^ d ≤ quotient f) := by exact ⟨manuscriptPackingDeficit, manuscriptPackingDeficit_isLittleO, manuscriptPackingDeficit_nonneg, fun _ hd f => manuscriptUniversalQuotientBound hd f⟩ theorem manuscriptBinaryExponentError_tendsto : Tendsto manuscriptBinaryExponentError atTop (nhds (0 : ℝ)) := tendsto_manuscriptBinaryExponentError sharpBinaryLogAsymptotic theorem manuscriptBinaryExponentError_isLittleO : Asymptotics.IsLittleO atTop manuscriptBinaryExponentError (fun _ : ℕ => (1 : ℝ)) := (Asymptotics.isLittleO_one_iff ℝ).2 manuscriptBinaryExponentError_tendsto theorem eventually_manuscriptLinearProgram_pos : ∀ᶠ d : ℕ in atTop, 0 < linearProgram d := eventually_linearProgram_pos_of_sharpQuotient sharpQuotientAsymptotic theorem manuscriptLinearProgram_eq_canonicalBinaryRpow {d : ℕ} (hd : 0 < d) (hpositive : 0 < linearProgram d) : linearProgram d = (2 : ℝ) ^ (-(criticalBinaryExponent + manuscriptBinaryExponentError d) * (d : ℝ)) := manuscriptLinearProgram_eq_binary_error_rpow hd hpositive theorem eventually_manuscriptLinearProgram_eq_canonicalBinaryRpow : ∀ᶠ d : ℕ in atTop, linearProgram d = (2 : ℝ) ^ (-(criticalBinaryExponent + manuscriptBinaryExponentError d) * (d : ℝ)) := by filter_upwards [eventually_gt_atTop (0 : ℕ), eventually_manuscriptLinearProgram_pos] with d hd hpositive exact manuscriptLinearProgram_eq_canonicalBinaryRpow hd hpositive theorem exists_manuscriptBinaryIsLittleO : ∃ e : ℕ → ℝ, Asymptotics.IsLittleO atTop e (fun _ : ℕ => (1 : ℝ)) ∧ ∀ᶠ d : ℕ in atTop, linearProgram d = (2 : ℝ) ^ (-(criticalBinaryExponent + e d) * (d : ℝ)) := by exact ⟨manuscriptBinaryExponentError, manuscriptBinaryExponentError_isLittleO, eventually_manuscriptLinearProgram_eq_canonicalBinaryRpow⟩ end end CohnElkies section set_option backward.isDefEq.respectTransparency false set_option backward.defeqAttrib.useBackward true set_option maxHeartbeats 800000 section open Metric MeasureTheory variable {r : ℝ} {ι : Type*} [Fintype ι] theorem EuclideanSpace.euclidean_ball_volume_positive [Nonempty ι] (x : EuclideanSpace ℝ ι) (hr : 0 < r) : 0 < volume (ball x r) := by simpa using! measure_ball_pos (μ := volume) x hr open Classical in theorem EuclideanSpace.euclidean_ball_volume_finite [NullSingletonClass (volume : Measure (EuclideanSpace ℝ ι))] (x : EuclideanSpace ℝ ι) : volume (ball x r) < ⊤ := by simpa using! measure_ball_lt_top (μ := volume) (x := x) (r := r) end section open MeasureTheory Metric Filter open Module open scoped BigOperators ENNReal Pointwise instance CohnElkies.numeralTwoAtLeast : Nat.AtLeastTwo 2 := ⟨by decide⟩ instance CohnElkies.euclideanFiniteDimensional (d : ℕ) : FiniteDimensional ℝ (EuclideanSpace ℝ (Fin d)) := by infer_instance instance CohnElkies.euclideanBorelSpace (d : ℕ) : BorelSpace (EuclideanSpace ℝ (Fin d)) := by infer_instance section Definitions structure SpherePacking (d : ℕ) where centers : Set (EuclideanSpace ℝ (Fin d)) separation : ℝ separation_pos : 0 < separation := by positivity centers_dist : Pairwise (separation ≤ dist · · : centers → centers → Prop) structure PeriodicSpherePacking (d : ℕ) extends SpherePacking d where lattice : Submodule ℤ (EuclideanSpace ℝ (Fin d)) lattice_action : ∀ ⦃x y⦄, x ∈ lattice → y ∈ centers → x + y ∈ centers lattice_discrete : DiscreteTopology lattice := by infer_instance lattice_isZLattice : IsZLattice ℝ lattice := by infer_instance variable {d : ℕ} attribute [instance] PeriodicSpherePacking.lattice_discrete attribute [instance] PeriodicSpherePacking.lattice_isZLattice theorem SpherePacking.distinct_centers_separation_bound (S : SpherePacking d) (x y : EuclideanSpace ℝ (Fin d)) (hx : x ∈ S.centers) (hy : y ∈ S.centers) (hxy : x ≠ y) : S.separation ≤ dist x y := by simpa using! S.centers_dist (Subtype.coe_ne_coe.mp (by simpa using! hxy) : (⟨x, hx⟩ : S.centers) ≠ ⟨y, hy⟩) instance PeriodicSpherePacking.instDiscretePackingLattice (S : PeriodicSpherePacking d) : DiscreteTopology S.lattice := S.lattice_discrete instance PeriodicSpherePacking.instFullRankPackingLattice (S : PeriodicSpherePacking d) : IsZLattice ℝ S.lattice := S.lattice_isZLattice instance SpherePacking.instDiscretePackingCenters (S : SpherePacking d) : DiscreteTopology S.centers := DiscreteTopology.of_forall_le_dist S.separation_pos S.centers_dist noncomputable instance PeriodicSpherePacking.latticeCenterTranslationAction (S : PeriodicSpherePacking d) : AddAction S.lattice S.centers := by refine { vadd := fun x y => ⟨(x : EuclideanSpace ℝ (Fin d)) + y, S.lattice_action x.property y.property⟩ zero_vadd := ?_ add_vadd := ?_ } · intro x y z apply Subtype.ext exact add_assoc (x : EuclideanSpace ℝ (Fin d)) y z · intro y apply Subtype.ext exact zero_add (y : EuclideanSpace ℝ (Fin d)) @[reducible] def SpherePacking.occupiedBallRegion (S : SpherePacking d) : Set (EuclideanSpace ℝ (Fin d)) := ⋃ x : S.centers, ball (x : EuclideanSpace ℝ (Fin d)) (S.separation / 2) noncomputable def SpherePacking.densityInsideRadius (S : SpherePacking d) (R : ℝ) : ℝ≥0∞ := volume (S.occupiedBallRegion ∩ ball 0 R) / (volume (ball (0 : EuclideanSpace ℝ (Fin d)) R)) noncomputable def SpherePacking.upperPackingDensity (S : SpherePacking d) : ℝ≥0∞ := limsup S.densityInsideRadius atTop theorem PeriodicSpherePacking.integral_basis_spans_packing_lattice (S : PeriodicSpherePacking d) {ι : Type*} (b : Basis ι ℤ S.lattice) : Submodule.span ℤ (Set.range (b.ofZLatticeBasis ℝ _)) = S.lattice := Basis.ofZLatticeBasis_span ℝ S.lattice b theorem PeriodicSpherePacking.mem_integral_basis_span_iff (S : PeriodicSpherePacking d) {ι : Type*} (b : Basis ι ℤ S.lattice) (v) : v ∈ Submodule.span ℤ (Set.range (b.ofZLatticeBasis ℝ _)) ↔ v ∈ S.lattice := SetLike.ext_iff.mp (S.integral_basis_spans_packing_lattice b) v end Definitions section Scaling variable {d : ℕ} open Real def SpherePacking.rescaleConfiguration (S : SpherePacking d) {c : ℝ} (hc : 0 < c) : SpherePacking d := by refine { centers := (fun x : EuclideanSpace ℝ (Fin d) => c • x) '' S.centers separation := c * S.separation separation_pos := mul_pos hc S.separation_pos centers_dist := ?_ } rintro ⟨_, ⟨x, hx, rfl⟩⟩ ⟨_, ⟨y, hy, rfl⟩⟩ hxy have hne : x ≠ y := by intro h apply hxy subst y rfl have hdist := S.distinct_centers_separation_bound x y hx hy hne change c * S.separation ≤ dist (c • x) (c • y) simpa [dist_smul₀, abs_of_pos hc] using mul_le_mul_of_nonneg_left hdist hc.le noncomputable def PeriodicSpherePacking.rescaleConfiguration (S : PeriodicSpherePacking d) {c : ℝ} (hc : 0 < c) : PeriodicSpherePacking d := by let scale : EuclideanSpace ℝ (Fin d) →ₗ[ℤ] EuclideanSpace ℝ (Fin d) := (LinearMap.lsmul ℝ (EuclideanSpace ℝ (Fin d)) c).restrictScalars ℤ let scaledLattice : Submodule ℤ (EuclideanSpace ℝ (Fin d)) := S.lattice.map scale let latticeEquiv : S.lattice ≃ scaledLattice := { toFun := fun x => ⟨c • (x : EuclideanSpace ℝ (Fin d)), ⟨x, x.property, rfl⟩⟩ invFun := fun y => ⟨c⁻¹ • (y : EuclideanSpace ℝ (Fin d)), by obtain ⟨x, hx, hxy⟩ := y.property change c • x = (y : EuclideanSpace ℝ (Fin d)) at hxy rw [← hxy] simpa [smul_smul, hc.ne'] using hx⟩ left_inv := by intro x apply Subtype.ext simp [smul_smul, hc.ne'] right_inv := by intro y apply Subtype.ext simp [smul_smul, hc.ne'] } let latticeHomeomorph : S.lattice ≃ₜ scaledLattice := { latticeEquiv with continuous_toFun := by change Continuous (fun x : S.lattice => (⟨c • (x : EuclideanSpace ℝ (Fin d)), _⟩ : scaledLattice)) fun_prop continuous_invFun := by change Continuous (fun y : scaledLattice => (⟨c⁻¹ • (y : EuclideanSpace ℝ (Fin d)), _⟩ : S.lattice)) fun_prop } letI : DiscreteTopology scaledLattice := latticeHomeomorph.discreteTopology have scaled_span_top : Submodule.span ℝ (scaledLattice : Set (EuclideanSpace ℝ (Fin d))) = ⊤ := by have all_scaled_mem : ∀ x : EuclideanSpace ℝ (Fin d), c • x ∈ Submodule.span ℝ (scaledLattice : Set (EuclideanSpace ℝ (Fin d))) := by intro x have hx : x ∈ Submodule.span ℝ (S.lattice : Set (EuclideanSpace ℝ (Fin d))) := by rw [S.lattice_isZLattice.span_top] exact Submodule.mem_top induction hx using Submodule.span_induction with | mem x hx => apply Submodule.subset_span exact ⟨x, hx, rfl⟩ | zero => simp | add x y hx hy ihx ihy => simpa [smul_add] using (Submodule.add_mem (Submodule.span ℝ (scaledLattice : Set (EuclideanSpace ℝ (Fin d)))) ihx ihy) | smul a x hx ih => rw [smul_comm c a] exact Submodule.smul_mem (Submodule.span ℝ (scaledLattice : Set (EuclideanSpace ℝ (Fin d)))) a ih apply top_unique intro x _ simpa [smul_smul, hc.ne'] using all_scaled_mem (c⁻¹ • x) letI : IsZLattice ℝ scaledLattice := ⟨scaled_span_top⟩ refine { toSpherePacking := S.toSpherePacking.rescaleConfiguration hc lattice := scaledLattice lattice_action := ?_ lattice_discrete := inferInstance lattice_isZLattice := inferInstance } rintro _ _ ⟨x, hx, rfl⟩ ⟨y, hy, rfl⟩ refine ⟨x + y, S.lattice_action hx hy, ?_⟩ change c • (x + y) = c • x + c • y exact smul_add c x y lemma SpherePacking.rescale_occupied_region {S : SpherePacking d} {c : ℝ} (hc : 0 < c) : (S.rescaleConfiguration hc).occupiedBallRegion = c • S.occupiedBallRegion := by have hc0 : (c : ℝ) ≠ 0 := hc.ne' ext x simp [SpherePacking.occupiedBallRegion, SpherePacking.rescaleConfiguration, Set.smul_set_iUnion, Set.mem_smul_set, _root_.smul_ball hc0, Real.norm_eq_abs, abs_of_pos hc, mul_div_assoc] end Scaling noncomputable section Density variable {d : ℕ} (S : SpherePacking d) def PeriodicSpherePackingConstant (d : ℕ) : ℝ≥0∞ := ⨆ S : PeriodicSpherePacking d, S.upperPackingDensity def SpherePackingConstant (d : ℕ) : ℝ≥0∞ := ⨆ S : SpherePacking d, S.upperPackingDensity end Density section DensityLemmas namespace SpherePacking lemma local_density_le_one {d : ℕ} (S : SpherePacking d) (R : ℝ) : S.densityInsideRadius R ≤ 1 := by simpa [densityInsideRadius] using! (ENNReal.div_le_of_le_mul (by simpa [one_mul] using! volume.mono Set.inter_subset_right)) lemma upper_packing_density_le_one {d : ℕ} (S : SpherePacking d) : S.upperPackingDensity ≤ 1 := by rw [upperPackingDensity] exact limsup_le_iSup.trans <| iSup_le fun R => local_density_le_one (S := S) R @[simp] lemma rescale_local_packing_density {d : ℕ} (S : SpherePacking d) {c : ℝ} (hc : 0 < c) (R : ℝ) : (S.rescaleConfiguration hc).densityInsideRadius (c * R) = S.densityInsideRadius R := by have hball : ball (0 : EuclideanSpace ℝ (Fin d)) (c * R) = c • ball 0 R := by simpa only [smul_zero, Real.norm_eq_abs, abs_of_pos hc] using! (smul_ball hc.ne.symm (0 : EuclideanSpace ℝ (Fin d)) R).symm rw [densityInsideRadius, rescale_occupied_region, hball, ← Set.smul_set_inter₀ hc.ne.symm] rw [Measure.addHaar_smul_of_nonneg _ hc.le, Measure.addHaar_smul_of_nonneg _ hc.le] rw [ENNReal.mul_div_mul_left, densityInsideRadius] · rw [ne_eq, ENNReal.ofReal_eq_zero, not_le, finrank_euclideanSpace_fin] positivity · apply ENNReal.ofReal_ne_top @[simp] lemma rescale_local_packing_density_radius {d : ℕ} (S : SpherePacking d) {c : ℝ} (hc : 0 < c) (R : ℝ) : (S.rescaleConfiguration hc).densityInsideRadius R = S.densityInsideRadius (R / c) := by simpa [mul_div_assoc', hc.ne.symm] using! (rescale_local_packing_density (S := S) hc (R := R / c)) lemma rescale_upper_packing_density {d : ℕ} (S : SpherePacking d) {c : ℝ} (hc : 0 < c) : (S.rescaleConfiguration hc).upperPackingDensity = S.upperPackingDensity := by simpa [upperPackingDensity, Function.comp, map_div_atTop_eq c hc] using! (limsup_congr (Eventually.of_forall fun R => rescale_local_packing_density_radius (S := S) hc R)).trans (Filter.limsup_comp (u := S.densityInsideRadius) (v := fun R => R / c) (f := atTop)) theorem packing_supremum_eq_unit_separation {d : ℕ} : SpherePackingConstant d = ⨆ (S : SpherePacking d) (_ : S.separation = 1), S.upperPackingDensity := by rw [iSup_subtype', SpherePackingConstant] refine le_antisymm (iSup_le ?_) (iSup_le ?_) · intro S simpa [rescale_upper_packing_density] using! (le_iSup (fun S : { S : SpherePacking d // S.separation = 1 } ↦ S.val.upperPackingDensity) ⟨S.rescaleConfiguration (inv_pos.mpr S.separation_pos), inv_mul_cancel₀ S.separation_pos.ne.symm⟩) · rintro ⟨S, -⟩ exact le_iSup upperPackingDensity S end DensityLemmas.SpherePacking section BasicResults open scoped ENNReal open EuclideanSpace variable {d : ℕ} (S : SpherePacking d) lemma nearby_ball_union_subset_clipped_union (X : Set (EuclideanSpace ℝ (Fin d))) (r R : ℝ) : ⋃ x ∈ X ∩ ball 0 R, ball x r ⊆ (⋃ x ∈ X, ball x r) ∩ ball 0 (R + r) := by intro x hx simp only [Set.mem_inter_iff, Set.mem_iUnion, mem_ball, exists_prop, dist_zero_right] at hx ⊢ obtain ⟨y, ⟨hy₁, hy₂⟩⟩ := hx use ⟨y, ⟨hy₁.left, hy₂⟩⟩ exact lt_of_le_of_lt (norm_le_norm_add_norm_sub' x y) (by gcongr <;> tauto) lemma clipped_ball_union_subset_nearby_union (X : Set (EuclideanSpace ℝ (Fin d))) (r R : ℝ) : (⋃ x ∈ X, ball x r) ∩ ball 0 (R - r) ⊆ ⋃ x ∈ X ∩ ball 0 R, ball x r := by intro x hx simp only [Set.mem_inter_iff, Set.mem_iUnion, mem_ball, exists_prop, dist_zero_right] at hx ⊢ obtain ⟨⟨y, ⟨hy₁, hy₂⟩⟩, hx⟩ := hx use y, ⟨hy₁, ?_⟩, hy₂ refine lt_of_le_of_lt (norm_le_norm_add_norm_sub x y) ?_ rw [← sub_add_cancel R r] exact add_lt_add hx (by simpa [dist_eq_norm, norm_sub_rev] using! hy₂) theorem SpherePacking.volume_center_ball_union_eq_tsum (R : ℝ) {r' : ℝ} (hr' : r' ≤ S.separation / 2) : volume (⋃ x : ↑(S.centers ∩ ball 0 R), ball (x : EuclideanSpace ℝ (Fin d)) r') = ∑' x : ↑(S.centers ∩ ball 0 R), volume (ball (x : EuclideanSpace ℝ (Fin d)) r') := by have : Countable ↑(S.centers ∩ ball 0 R) := Set.Countable.mono Set.inter_subset_left (countable_of_Lindelof_of_discrete (X := S.centers)) apply measure_iUnion ?_ (fun _ ↦ measurableSet_ball) intro ⟨x, hx⟩ ⟨y, hy⟩ h apply ball_disjoint_ball simp_rw [ne_eq, Subtype.mk.injEq] at h ⊢ linarith [S.distinct_centers_separation_bound x y hx.left hy.left h] theorem SpherePacking.center_count_in_ball_upper_bound (hd : 0 < d) (R : ℝ) : (S.centers ∩ ball 0 R).encard ≤ volume (S.occupiedBallRegion ∩ ball 0 (R + S.separation / 2)) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) (S.separation / 2)) := by have h := volume.mono <| nearby_ball_union_subset_clipped_union S.centers (S.separation / 2) R change volume _ ≤ volume _ at h simp_rw [Set.biUnion_eq_iUnion, S.volume_center_ball_union_eq_tsum R (le_refl _), Measure.addHaar_ball_center, ENNReal.tsum_set_const] at h haveI : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd rwa [← ENNReal.le_div_iff_mul_le] at h <;> left · exact (euclidean_ball_volume_positive _ (by linarith [S.separation_pos])).ne.symm · exact (euclidean_ball_volume_finite _).ne theorem SpherePacking.center_count_in_ball_lower_bound (R : ℝ) : (S.centers ∩ ball 0 R).encard ≥ volume (S.occupiedBallRegion ∩ ball 0 (R - S.separation / 2)) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) (S.separation / 2)) := by have h := volume.mono <| clipped_ball_union_subset_nearby_union S.centers (S.separation / 2) R change volume _ ≤ volume _ at h simp_rw [Set.biUnion_eq_iUnion, S.volume_center_ball_union_eq_tsum _ (le_refl _), Measure.addHaar_ball_center, ENNReal.tsum_set_const] at h exact ENNReal.div_le_of_le_mul h theorem SpherePacking.finite_centers_inside_ball (R : ℝ) : Finite ↑(S.centers ∩ ball 0 R) := by apply Set.encard_lt_top_iff.mp rcases eq_or_ne d 0 with rfl | hd · exact Set.encard_lt_top_iff.2 <| Set.Finite.of_subsingleton (S.centers ∩ ball 0 R) · have hd' : 0 < d := Nat.pos_of_ne_zero hd haveI : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd' apply ENat.toENNReal_lt.mp refine lt_of_le_of_lt (S.center_count_in_ball_upper_bound hd' R) ?_ refine ENNReal.div_lt_top (ne_of_lt <| lt_of_le_of_lt (volume.mono Set.inter_subset_right) (EuclideanSpace.euclidean_ball_volume_finite _)) (euclidean_ball_volume_positive _ (by linarith [S.separation_pos])).ne.symm theorem SpherePacking.local_density_lower_bound (hd : 0 < d) (R : ℝ) : S.densityInsideRadius R ≥ (S.centers ∩ ball 0 (R - S.separation / 2)).encard * volume (ball (0 : EuclideanSpace ℝ (Fin d)) (S.separation / 2)) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) R) := by haveI : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd rw [densityInsideRadius, occupiedBallRegion] apply ENNReal.div_le_div_right exact (ENNReal.le_div_iff_mul_le (Or.inl (euclidean_ball_volume_positive _ (by linarith [S.separation_pos])).ne.symm) (Or.inl (euclidean_ball_volume_finite _).ne)).1 <| (by simpa [sub_add_cancel] using! (S.center_count_in_ball_upper_bound hd (R - S.separation / 2))) theorem SpherePacking.local_density_upper_bound (hd : 0 < d) (R : ℝ) : S.densityInsideRadius R ≤ (S.centers ∩ ball 0 (R + S.separation / 2)).encard * volume (ball (0 : EuclideanSpace ℝ (Fin d)) (S.separation / 2)) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) R) := by haveI : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd rw [densityInsideRadius, occupiedBallRegion] apply ENNReal.div_le_div_right exact (ENNReal.div_le_iff_le_mul (Or.inl (euclidean_ball_volume_positive _ (by linarith [S.separation_pos])).ne.symm) (Or.inl (euclidean_ball_volume_finite _).ne)).1 <| (by simpa [add_sub_cancel_right] using! (S.center_count_in_ball_lower_bound (R + S.separation / 2))) end BasicResults end section theorem ENNReal.cancel_common_numerator_in_division_ratio {a b c : ENNReal} (ha : a ≠ 0) (ha' : a ≠ ⊤) (hc : c ≠ ⊤) : (a / b) / (a / c) = c / b := by simp only [div_eq_mul_inv] rw [ENNReal.mul_inv (Or.inl ha) (Or.inr (ENNReal.inv_ne_zero.mpr hc)), inv_inv] calc a * b⁻¹ * (a⁻¹ * c) = (a * a⁻¹) * (c * b⁻¹) := by ac_rfl _ = c * b⁻¹ := by rw [ENNReal.mul_inv_cancel ha ha', one_mul] theorem ENat.tsum_constant_eq_card_mul {α : Type*} (c : ENat) : ∑' (_ : α), c = ENat.card α * c := by classical by_cases hα : Finite α · letI := Fintype.ofFinite α simp [tsum_fintype, ENat.card_eq_coe_fintype_card, nsmul_eq_mul] · letI := not_finite_iff_infinite.mp hα by_cases hc : c = 0 · simp [hc] · rw [ENat.card_eq_top_of_infinite, ENat.top_mul hc] apply HasSum.tsum_eq change Filter.Tendsto (fun s : Finset α => ∑ i ∈ s, c) Filter.atTop (nhds (⊤ : ENat)) apply tendsto_order.2 constructor · intro b hb have hbtop : b ≠ ⊤ := ne_of_lt hb obtain ⟨s, hs⟩ := Finset.exists_card_eq (α := α) (b.toNat + 1) apply Filter.eventually_atTop.2 refine ⟨s, ?_⟩ intro t hst have hcard : s.card ≤ t.card := Finset.card_le_card hst have hbc : b < (s.card : ENat) := by rw [← ENat.coe_toNat hbtop, hs] exact_mod_cast Nat.lt_succ_self b.toNat have hc_one : (1 : ENat) ≤ c := Order.one_le_iff_ne_zero.2 hc calc b < (s.card : ENat) := hbc _ ≤ (t.card : ENat) := by exact_mod_cast hcard _ ≤ (t.card : ENat) * c := by simpa using (mul_le_mul_right hc_one (t.card : ENat)) _ = ∑ i ∈ t, c := by simp [nsmul_eq_mul] · intro b hb exact (not_lt_of_ge le_top hb).elim theorem ENat.tsum_subtype_constant_eq_encard_mul {α : Type*} (s : Set α) (c : ENat) : ∑' (_ : s), c = s.encard * c := by rw [ENat.tsum_constant_eq_card_mul, Set.encard] theorem ENat.tsum_unit_eq_cardinality {α : Type*} : ∑' (_ : α), 1 = ENat.card α := by simp [ENat.tsum_constant_eq_card_mul] theorem ENat.tsum_subtype_unit_eq_encard {α : Type*} (s : Set α) : ∑' (_ : s), 1 = s.encard := by rw [ENat.tsum_unit_eq_cardinality, Set.encard] end section namespace ENat open Function Set section tsum variable {ι : Sort*} {α β : Type*} {f g : α → ℕ∞} {s t : Set α} protected theorem hasSum : HasSum f (⨆ s : Finset α, ∑ a ∈ s, f a) := tendsto_atTop_iSup fun _ _ ↦ Finset.sum_le_sum_of_subset @[simp] protected theorem summable : Summable f := ENat.hasSum.summable protected theorem tsum_reindex_injective_le {φ : α → β} (hφ : Injective φ) (g : β → ℕ∞) : ∑' x, g (φ x) ≤ ∑' y, g y := (ENat.summable (f := fun x => g (φ x))).tsum_le_tsum_of_inj φ hφ (fun _ _ ↦ bot_le) (fun _ ↦ le_rfl) (ENat.summable (f := g)) protected theorem tsum_le_reindex_surjection {φ : α → β} (hφ : Surjective φ) (g : β → ℕ∞) : ∑' y, g y ≤ ∑' x, g (φ x) := calc ∑' y, g y = ∑' y, g (φ (surjInv hφ y)) := by simp [surjInv_eq hφ] _ ≤ ∑' x, g (φ x) := ENat.tsum_reindex_injective_le (injective_surjInv hφ) _ protected theorem tsum_reindex_bijection {φ : α → β} (hφ : φ.Bijective) (g : β → ℕ∞) : ∑' x, g (φ x) = ∑' y, g y := (ENat.tsum_reindex_injective_le hφ.injective g).antisymm (ENat.tsum_le_reindex_surjection hφ.surjective g) protected theorem tsum_dependent_subtype_reindex {β : α → Type*} (f : (Σ a, β a) → ℕ∞) : ∑' p : Σ a, β a, f p = ∑' (a) (b), f ⟨a, b⟩ := Summable.tsum_sigma' (fun _ ↦ ENat.summable) ENat.summable variable {ι : Type*} theorem tsum_disjoint_subtype_union (f : α → ℕ∞) (t : ι → Set α) (ht : Pairwise (Disjoint on t)) : ∑' x : ⋃ i, t i, f x = ∑' i, ∑' x : t i, f x := calc ∑' x : ⋃ i, t i, f x = ∑' x : Σ i, t i, f x.2 := (ENat.tsum_reindex_bijection (sigmaToiUnion_bijective t (fun _ _ hij ↦ ht hij)) _).symm _ = _ := ENat.tsum_dependent_subtype_reindex _ end ENat.tsum open Function theorem Set.encard_disjoint_union_eq_tsum {ι α : Type*} {s : ι → Set α} (hs : Set.PairwiseDisjoint Set.univ s) : (⋃ i, s i).encard = ∑' i, (s i).encard := by simpa [ENat.tsum_subtype_unit_eq_encard] using! (ENat.tsum_disjoint_subtype_union (f := fun _ : α => (1 : ℕ∞)) (t := s) (by simpa [Set.PairwiseDisjoint, Set.pairwise_univ] using! hs)) end section open ZSpan variable {E ι K : Type*} [NormedField K] [LinearOrder K] [IsStrictOrderedRing K] [NormedAddCommGroup E] [NormedSpace K E] (b : Module.Basis ι K E) [FloorRing K] [Fintype ι] theorem ZSpan.fundamental_region_iff_coordinate_floor_zero (v : E) : v ∈ fundamentalDomain b ↔ floor b v = 0 := by simp_rw [mem_fundamentalDomain, ← Int.floor_eq_zero_iff] constructor <;> intro h · simp [floor, h] · intro i exact_mod_cast (by simpa [h] using! (repr_floor_apply b v i).symm) section BasisIndexEquiv variable {d : ℕ} namespace ZLattice noncomputable def coordinateIndexEquiv (Λ : Submodule ℤ (EuclideanSpace ℝ (Fin d))) [DiscreteTopology Λ] [IsZLattice ℝ Λ] : (Module.Free.ChooseBasisIndex ℤ Λ) ≃ (Fin d) := by let c := EuclideanSpace.equiv (Fin d) ℝ let e := c.toLinearEquiv.restrictScalars ℤ let L : Submodule ℤ (Fin d → ℝ) := Λ.map e.toLinearMap have hmem (x : EuclideanSpace ℝ (Fin d)) : x ∈ Λ ↔ e x ∈ L := by constructor · intro hx exact ⟨x, hx, rfl⟩ · rintro ⟨y, hy, he⟩ exact e.injective he ▸ hy let h : Λ ≃ₜ L := c.toHomeomorph.subtype (by simpa [e] using hmem) letI : DiscreteTopology L := h.discreteTopology have hset : (L : Set (Fin d → ℝ)) = c.toLinearEquiv.toLinearMap '' (Λ : Set (EuclideanSpace ℝ (Fin d))) := by ext x change (∃ y, y ∈ Λ ∧ e y = x) ↔ ∃ y, y ∈ Λ ∧ c.toLinearEquiv.toLinearMap y = x simp [e] letI : IsZLattice ℝ L := ⟨by calc Submodule.span ℝ (L : Set (Fin d → ℝ)) = Submodule.map c.toLinearEquiv.toLinearMap (Submodule.span ℝ (Λ : Set (EuclideanSpace ℝ (Fin d)))) := by rw [Submodule.map_span] rw [hset] _ = Submodule.map c.toLinearEquiv.toLinearMap ⊤ := by rw [IsZLattice.span_top] _ = ⊤ := Submodule.map_eq_top_iff.mpr rfl⟩ exact (Module.Free.chooseBasis ℤ Λ).indexEquiv ((IsZLattice.basis L).map (e.submoduleMap Λ).symm) end ZLattice end BasisIndexEquiv end section open scoped ENNReal open SpherePacking EuclideanSpace MeasureTheory Metric ZSpan Bornology Module section aux_lemmas variable {d : ℕ} (S : PeriodicSpherePacking d) (D : Set (EuclideanSpace ℝ (Fin d))) private lemma bounded_union_of_center_balls (hD_isBounded : IsBounded D) : IsBounded (⋃ x ∈ S.centers ∩ D, ball x (S.separation / 2)) := by rcases (isBounded_iff_forall_norm_le).1 hD_isBounded with ⟨L, hL⟩ refine (isBounded_iff_forall_norm_le).2 ⟨L + S.separation / 2, ?_⟩ intro x hx rcases Set.mem_iUnion₂.1 hx with ⟨y, hy, hx⟩ exact (norm_le_norm_add_norm_sub' x y).trans <| add_le_add (hL y hy.2) (le_of_lt (by simpa [mem_ball, dist_eq_norm] using! hx)) private lemma pairwise_disjoint_center_balls (D : Set (EuclideanSpace ℝ (Fin d))) : Set.PairwiseDisjoint (S.centers ∩ D) (fun x ↦ ball x (S.separation / 2)) := by intro x hx y hy hxy exact ball_disjoint_ball (by simpa [add_halves] using! S.distinct_centers_separation_bound _ _ hx.left hy.left hxy) private theorem finite_of_bounded_union_with_uniform_volume {ι τ : Type*} {s : Set ι} {f : ι → Set (EuclideanSpace ℝ τ)} {c : ℝ≥0∞} (hc : 0 < c) [Fintype τ] [NullSingletonClass (volume : Measure (EuclideanSpace ℝ τ))] (h_measurable : ∀ x ∈ s, MeasurableSet (f x)) (h_bounded : IsBounded (⋃ x ∈ s, f x)) (h_volume : ∀ x ∈ s, c ≤ volume (f x)) (h_disjoint : s.PairwiseDisjoint f) : s.Finite := by classical have h_finite_volume : volume (⋃ x ∈ s, f x) < ⊤ := h_bounded.measure_lt_top by_contra hs haveI : Infinite s := Set.infinite_coe_iff.mpr hs let e : ℕ ↪ s := Set.Infinite.natEmbedding s hs have h_sum : volume (⋃ n : ℕ, f (e n : ι)) = ∑' n : ℕ, volume (f (e n : ι)) := by apply measure_iUnion · intro m n hmn apply h_disjoint (e m).property (e n).property intro heq exact hmn (e.injective (Subtype.ext heq)) · intro n exact h_measurable (e n) (e n).property have h_top : ∑' n : ℕ, volume (f (e n : ι)) = ⊤ := by apply top_unique calc (⊤ : ENNReal) = ∑' _ : ℕ, c := by simp [hc.ne'] _ ≤ ∑' n : ℕ, volume (f (e n : ι)) := ENNReal.tsum_le_tsum fun n => h_volume (e n) (e n).property have h_subset : (⋃ n : ℕ, f (e n : ι)) ⊆ ⋃ x ∈ s, f x := by intro x hx obtain ⟨n, hn⟩ := Set.mem_iUnion.mp hx exact Set.mem_iUnion₂.mpr ⟨e n, (e n).property, hn⟩ have h_le : (⊤ : ENNReal) ≤ volume (⋃ x ∈ s, f x) := by rw [← h_top, ← h_sum] exact volume.mono h_subset exact (ne_of_lt h_finite_volume) (top_unique h_le) lemma finite_centers_in_bounded_region (hD_isBounded : IsBounded D) (hd : 0 < d) : Finite ↑(S.centers ∩ D) := by haveI : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd refine (Set.finite_coe_iff).2 <| finite_of_bounded_union_with_uniform_volume (c := volume (ball (0 : EuclideanSpace ℝ (Fin d)) (S.separation / 2))) (hc := by simpa using! euclidean_ball_volume_positive (0 : EuclideanSpace ℝ (Fin d)) (by nlinarith [S.separation_pos])) (h_measurable := fun _ _ => measurableSet_ball) (h_bounded := bounded_union_of_center_balls S D hD_isBounded) (h_volume := fun _ _ => by simp [Measure.addHaar_ball_center]) (h_disjoint := by simpa using! pairwise_disjoint_center_balls S D) lemma finite_centers_in_fundamental_region {ι : Type*} [Finite ι] (b : Basis ι ℤ S.lattice) (hd : 0 < d) : Finite ↑(S.centers ∩ fundamentalDomain (b.ofZLatticeBasis ℝ _)) := finite_centers_in_bounded_region S _ (ZSpan.fundamentalDomain_isBounded _) hd open scoped Pointwise in lemma finite_centers_in_translated_fundamental_region {ι : Type*} [Finite ι] (b : Basis ι ℤ S.lattice) (hd : 0 < d) (v : EuclideanSpace ℝ (Fin d)) : Finite ↑(S.centers ∩ (v +ᵥ fundamentalDomain (b.ofZLatticeBasis ℝ _))) := finite_centers_in_bounded_region S _ ((ZSpan.fundamentalDomain_isBounded _).vadd v) hd end aux_lemmas section Pointwise open scoped Pointwise variable {d : ℕ} lemma translates_disjoint_of_unique_cover {Λ : Submodule ℤ (EuclideanSpace ℝ (Fin d))} {D : Set (EuclideanSpace ℝ (Fin d))} (hD_unique_covers : ∀ x, ∃! g : Λ, g +ᵥ x ∈ D) {g h : Λ} (hgh : g ≠ h) : Disjoint (g +ᵥ D) (h +ᵥ D) := by refine Set.disjoint_left.2 (by intro x hxg hxh exact hgh <| neg_injective <| (hD_unique_covers x).unique (by simpa [Set.mem_vadd_set_iff_neg_vadd_mem] using! hxg) (by simpa [Set.mem_vadd_set_iff_neg_vadd_mem] using! hxh)) end Pointwise section instances variable {d : ℕ} (S : PeriodicSpherePacking d) open scoped Pointwise noncomputable def PeriodicSpherePacking.centerOrbitEquivFundamentalRegion (D : Set (EuclideanSpace ℝ (Fin d))) (hD_unique_covers : ∀ x, ∃! g : S.lattice, g +ᵥ x ∈ D) : Quotient S.latticeCenterTranslationAction.orbitRel ≃ ↑(S.centers ∩ D) := by classical have h_vadd (g : S.lattice) (x : S.centers) : ((g +ᵥ x : S.centers) : EuclideanSpace ℝ (Fin d)) = (g : EuclideanSpace ℝ (Fin d)) + x := by rfl let f : ↑(S.centers ∩ D) → Quotient S.latticeCenterTranslationAction.orbitRel := fun x => Quotient.mk _ (⟨x.1, x.2.1⟩ : S.centers) refine (Equiv.ofBijective f ⟨?_, ?_⟩).symm · intro x y hxy obtain ⟨g, hg⟩ := Quotient.exact hxy have hco : (g : EuclideanSpace ℝ (Fin d)) + y.1 = x.1 := by simpa only [h_vadd] using congrArg Subtype.val hg have hgD : (g : EuclideanSpace ℝ (Fin d)) + y.1 ∈ D := hco.symm ▸ x.2.2 have hgzero : g = 0 := (hD_unique_covers y.1).unique hgD (by simpa using y.2.2) apply Subtype.ext simpa [hgzero] using hco.symm · intro q refine Quotient.inductionOn q ?_ intro x obtain ⟨g, hg, -⟩ := hD_unique_covers (x : EuclideanSpace ℝ (Fin d)) let y : S.centers := g +ᵥ x have hyD : (y : EuclideanSpace ℝ (Fin d)) ∈ D := by rw [show (y : EuclideanSpace ℝ (Fin d)) = (g : EuclideanSpace ℝ (Fin d)) + x from h_vadd g x] exact hg refine ⟨⟨y, y.property, hyD⟩, ?_⟩ apply Quotient.sound refine ⟨g, ?_⟩ apply Subtype.ext simp [y] noncomputable def PeriodicSpherePacking.centerOrbitEquivBasisRegion {ι : Type*} [Finite ι] (b : Basis ι ℤ S.lattice) : Quotient S.latticeCenterTranslationAction.orbitRel ≃ ↑(S.centers ∩ (fundamentalDomain (b.ofZLatticeBasis ℝ _))) := by refine S.centerOrbitEquivFundamentalRegion _ ?_ intro x obtain ⟨v, ⟨hv, hv'⟩⟩ := exist_unique_vadd_mem_fundamentalDomain (b.ofZLatticeBasis ℝ _) x use ⟨v.val, ?_⟩, ?_, ?_ · apply Set.mem_of_subset_of_mem ?_ v.prop rw [← Submodule.coe_toAddSubgroup, Basis.ofZLatticeBasis_span] rfl · simp only at hv' ⊢ convert! hv using 1 · intro s hs rw [← hv' ⟨s, ?_⟩ hs] apply Set.mem_of_subset_of_mem _ s.prop rw [← Submodule.coe_toAddSubgroup, Basis.ofZLatticeBasis_span] rfl noncomputable def PeriodicSpherePacking.centerOrbitEquivTranslatedBasisRegion {ι : Type*} [Finite ι] (b : Basis ι ℤ S.lattice) (v : EuclideanSpace ℝ (Fin d)) : Quotient S.latticeCenterTranslationAction.orbitRel ≃ ↑(S.centers ∩ (v +ᵥ fundamentalDomain (b.ofZLatticeBasis ℝ _))) := by refine S.centerOrbitEquivFundamentalRegion _ ?_ intro x obtain ⟨⟨g, hg_lattice⟩, hg, hg'⟩ := exist_unique_vadd_mem_fundamentalDomain (b.ofZLatticeBasis ℝ _) (x - v) refine ⟨⟨g, ?_⟩, ?_, ?_⟩ · apply Set.mem_of_subset_of_mem ?_ hg_lattice rw [← Submodule.coe_toAddSubgroup, Basis.ofZLatticeBasis_span] rfl · change g + x ∈ v +ᵥ fundamentalDomain (b.ofZLatticeBasis ℝ _) rw [Set.mem_vadd_set_iff_neg_vadd_mem] change -v + (g + x) ∈ fundamentalDomain (b.ofZLatticeBasis ℝ _) simp only [(Submodule.span ℤ (Set.range ⇑(b.ofZLatticeBasis ℝ S.lattice))).mk_vadd, vadd_eq_add] at hg convert hg using 1; abel · intro s hs apply Subtype.ext have hs' : s.val + (x - v) ∈ fundamentalDomain (b.ofZLatticeBasis ℝ _) := by rw [Set.mem_vadd_set_iff_neg_vadd_mem] at hs change -v + (s.val + x) ∈ fundamentalDomain (b.ofZLatticeBasis ℝ _) at hs convert hs using 1; abel have heq := hg' ⟨s.val, by apply Set.mem_of_subset_of_mem ?_ s.prop rw [← Submodule.coe_toAddSubgroup, Basis.ofZLatticeBasis_span] rfl⟩ hs' have hvals : s.val = g := congrArg (fun z : ↥(Submodule.span ℤ (Set.range ⇑(b.ofZLatticeBasis ℝ S.lattice))) => (z : EuclideanSpace ℝ (Fin d))) heq exact hvals instance (S : PeriodicSpherePacking 0) : Finite S.centers := inferInstance noncomputable instance PeriodicSpherePacking.finiteCenterTranslationQuotient : Finite (Quotient S.latticeCenterTranslationAction.orbitRel) := by let b : Basis _ ℤ S.lattice := (ZLattice.module_free ℝ S.lattice).chooseBasis by_cases hd : 0 < d · haveI : Finite ↑(S.centers ∩ fundamentalDomain (b.ofZLatticeBasis ℝ _)) := finite_centers_in_fundamental_region S b hd exact Finite.of_equiv _ (S.centerOrbitEquivBasisRegion b).symm · have : d = 0 := Nat.eq_zero_of_not_pos hd subst this exact Quotient.finite (AddAction.orbitRel ..) noncomputable instance : Fintype (Quotient S.latticeCenterTranslationAction.orbitRel) := Fintype.ofFinite _ end instances section centerOrbitCardinality open scoped Pointwise open Finset Set variable {d : ℕ} (S : PeriodicSpherePacking d) (D : Set (EuclideanSpace ℝ (Fin d))) noncomputable def PeriodicSpherePacking.centerOrbitCardinality : ℕ := Fintype.card (Quotient S.latticeCenterTranslationAction.orbitRel) theorem PeriodicSpherePacking.card_centers_in_fundamental_region (hD_isBounded : IsBounded D) (hD_unique_covers : ∀ x, ∃! g : S.lattice, g +ᵥ x ∈ D) (hd : 0 < d) : haveI := @Fintype.ofFinite _ <| finite_centers_in_bounded_region S D hD_isBounded hd (S.centers ∩ D).toFinset.card = S.centerOrbitCardinality := by rw [centerOrbitCardinality] convert! Finset.card_eq_of_equiv_fintype ?_ simpa [Set.mem_toFinset] using! (S.centerOrbitEquivFundamentalRegion D hD_unique_covers).symm theorem PeriodicSpherePacking.encard_centers_in_fundamental_region (hD_isBounded : IsBounded D) (hD_unique_covers : ∀ x, ∃! g : S.lattice, g +ᵥ x ∈ D) (hd : 0 < d) : (S.centers ∩ D).encard = S.centerOrbitCardinality := by rw [← S.card_centers_in_fundamental_region D hD_isBounded hD_unique_covers hd] convert! Set.encard_eq_coe_toFinset_card _ theorem PeriodicSpherePacking.card_centers_in_translated_region (hd : 0 < d) {ι : Type*} [Finite ι] (b : Basis ι ℤ S.lattice) (v : EuclideanSpace ℝ (Fin d)) : haveI := @Fintype.ofFinite _ <| finite_centers_in_translated_fundamental_region S b hd v (S.centers ∩ (v +ᵥ fundamentalDomain (b.ofZLatticeBasis ℝ _))).toFinset.card = S.centerOrbitCardinality := by rw [centerOrbitCardinality] exact card_eq_of_equiv_fintype (by simpa using! (S.centerOrbitEquivTranslatedBasisRegion b v).symm) theorem PeriodicSpherePacking.encard_centers_in_translated_region (hd : 0 < d) {ι : Type*} [Finite ι] (b : Basis ι ℤ S.lattice) (v : EuclideanSpace ℝ (Fin d)) : (S.centers ∩ (v +ᵥ fundamentalDomain (b.ofZLatticeBasis ℝ _))).encard = S.centerOrbitCardinality := by rw [← S.card_centers_in_translated_region hd b] convert! Set.encard_eq_coe_toFinset_card _ end centerOrbitCardinality section numReps_aux variable {d : ℕ} @[reducible] noncomputable def PeriodicSpherePacking.instFintypeBoundedCenterRepresentatives (S : PeriodicSpherePacking d) (hd : 0 < d) {D : Set (EuclideanSpace ℝ (Fin d))} (hD_isBounded : IsBounded D) : Fintype ↑(S.centers ∩ D) := @Fintype.ofFinite _ <| finite_centers_in_bounded_region S D hD_isBounded hd noncomputable def PeriodicSpherePacking.boundedCenterRepresentativeCount (S : PeriodicSpherePacking d) (hd : 0 < d) {D : Set (EuclideanSpace ℝ (Fin d))} (hD_isBounded : IsBounded D) : ℕ := letI := S.instFintypeBoundedCenterRepresentatives hd hD_isBounded Fintype.card ↑(S.centers ∩ D) theorem PeriodicSpherePacking.orbit_cardinality_eq_bounded_representatives (S : PeriodicSpherePacking d) (hd : 0 < d) {D : Set (EuclideanSpace ℝ (Fin d))} (hD_isBounded : IsBounded D) (hD_unique_covers : ∀ x, ∃! g : S.lattice, g +ᵥ x ∈ D) : S.centerOrbitCardinality = S.boundedCenterRepresentativeCount hd hD_isBounded := by simpa [PeriodicSpherePacking.boundedCenterRepresentativeCount, Set.toFinset_card] using! (S.card_centers_in_fundamental_region (D := D) hD_isBounded hD_unique_covers hd).symm end numReps_aux section theorem_2_3 variable {d : ℕ} (S : PeriodicSpherePacking d) (D : Set (EuclideanSpace ℝ (Fin d))) open scoped Pointwise private theorem iUnion_lattice_inter_ball_sub_vadd_fundamentalDomain_subset_ball {ι : Type*} (b : Basis ι ℝ (EuclideanSpace ℝ (Fin d))) {L : ℝ} (hL : ∀ x ∈ fundamentalDomain b, ‖x‖ ≤ L) (R : ℝ) : ⋃ x ∈ ↑S.lattice ∩ ball (0 : EuclideanSpace ℝ (Fin d)) (R - L), x +ᵥ (fundamentalDomain b : Set (EuclideanSpace ℝ (Fin d))) ⊆ ball 0 R := by intro z hz rcases Set.mem_iUnion.mp hz with ⟨x, hz⟩ rcases Set.mem_iUnion.mp hz with ⟨hx, hz⟩ rw [Set.mem_vadd_set] at hz rcases hz with ⟨y, hy, rfl⟩ have hxnorm : ‖x‖ < R - L := by simpa [mem_ball, dist_zero_right] using hx.2 have hynorm : ‖y‖ ≤ L := hL y hy have hsum : ‖x + y‖ < R := lt_of_le_of_lt (norm_add_le x y) (by linarith) simpa [mem_ball, dist_zero_right, vadd_eq_add] using hsum private theorem fundamental_region_translates_disjoint {ι : Type*} [Finite ι] (b : Basis ι ℤ S.lattice) {x y : EuclideanSpace ℝ (Fin d)} (hx : x ∈ S.lattice) (hy : y ∈ S.lattice) (hxy : x ≠ y) : Disjoint (x +ᵥ fundamentalDomain (b.ofZLatticeBasis ℝ _)) (y +ᵥ fundamentalDomain (b.ofZLatticeBasis ℝ _)) := by let Λ : Submodule ℤ (EuclideanSpace ℝ (Fin d)) := Submodule.span ℤ (Set.range (b.ofZLatticeBasis ℝ _)) have hx' : x ∈ Λ := by simpa [Λ, S.integral_basis_spans_packing_lattice] using! hx have hy' : y ∈ Λ := by simpa [Λ, S.integral_basis_spans_packing_lattice] using! hy have hxy' : (⟨x, hx'⟩ : Λ) ≠ ⟨y, hy'⟩ := fun h => hxy (by simpa using! congrArg Subtype.val h) simpa [Λ] using! (translates_disjoint_of_unique_cover (d := d) (Λ := Λ) (D := fundamentalDomain (b.ofZLatticeBasis ℝ _)) (by intro u; simpa using! exist_unique_vadd_mem_fundamentalDomain (b.ofZLatticeBasis ℝ _) u) hxy') theorem PeriodicSpherePacking.encard_centers_inter_ball_ge_numReps_nsmul_encard_lattice_inter_ball (hd : 0 < d) {ι : Type*} [Finite ι] (b : Basis ι ℤ S.lattice) {L : ℝ} (hL : ∀ x ∈ fundamentalDomain (b.ofZLatticeBasis ℝ _), ‖x‖ ≤ L) (R : ℝ) : (↑S.centers ∩ ball 0 R).encard ≥ S.centerOrbitCardinality • (↑S.lattice ∩ ball (0 : EuclideanSpace ℝ (Fin d)) (R - L)).encard := by have hsub := Set.inter_subset_inter_right S.centers (iUnion_lattice_inter_ball_sub_vadd_fundamentalDomain_subset_ball S (b.ofZLatticeBasis ℝ _) hL R) rw [Set.biUnion_eq_iUnion, Set.inter_iUnion] at hsub have henc := Set.encard_mono hsub rw [Set.encard_disjoint_union_eq_tsum] at henc · simp_rw [S.encard_centers_in_translated_region hd] at henc · convert! henc.ge rw [nsmul_eq_mul, ENat.tsum_subtype_constant_eq_encard_mul, mul_comm] · intro ⟨x, hx⟩ _ ⟨y, hy⟩ _ hxy have hxy' : x ≠ y := fun h => hxy (Subtype.ext h) refine Set.disjoint_left.2 fun u hux huy => (Set.disjoint_left.1 (fundamental_region_translates_disjoint (S := S) b hx.left hy.left hxy')) hux.right huy.right private theorem ball_subset_iUnion_lattice_inter_ball_add_vadd_fundamentalDomain {ι : Type*} [Finite ι] (b : Basis ι ℤ S.lattice) {L : ℝ} (hL : ∀ x ∈ fundamentalDomain (b.ofZLatticeBasis ℝ _), ‖x‖ ≤ L) (R : ℝ) : ball 0 R ⊆ ⋃ x ∈ ↑S.lattice ∩ ball (0 : EuclideanSpace ℝ (Fin d)) (R + L), x +ᵥ (fundamentalDomain (b.ofZLatticeBasis ℝ _) : Set (EuclideanSpace ℝ (Fin d))) := by letI : Fintype ι := Fintype.ofFinite ι intro x hx refine Set.mem_iUnion₂.2 ⟨floor (b.ofZLatticeBasis ℝ _) x, ?_, ?_⟩ · refine ⟨?_, ?_⟩ · rw [SetLike.mem_coe, ← S.mem_integral_basis_span_iff b] exact Submodule.coe_mem _ · rw [mem_ball_zero_iff] at hx ⊢ have hfloor : ‖floor (b.ofZLatticeBasis ℝ _) x‖ = ‖x - fract (b.ofZLatticeBasis ℝ _) x‖ := by simp [fract] refine lt_of_le_of_lt (hfloor.le.trans (norm_sub_le _ _)) ?_ exact add_lt_add_of_lt_of_le hx (hL _ (fract_mem_fundamentalDomain _ _)) · rw [Set.mem_vadd_set_iff_neg_vadd_mem, vadd_eq_add, neg_add_eq_sub] exact fract_mem_fundamentalDomain (b.ofZLatticeBasis ℝ _) x theorem PeriodicSpherePacking.encard_centers_inter_ball_le_numReps_nsmul_encard_lattice_inter_ball (hd : 0 < d) {ι : Type*} [Finite ι] (b : Basis ι ℤ S.lattice) {L : ℝ} (hL : ∀ x ∈ fundamentalDomain (b.ofZLatticeBasis ℝ _), ‖x‖ ≤ L) (R : ℝ) : (↑S.centers ∩ ball 0 R).encard ≤ S.centerOrbitCardinality • (↑S.lattice ∩ ball (0 : EuclideanSpace ℝ (Fin d)) (R + L)).encard := by have hsub := Set.inter_subset_inter_right S.centers (ball_subset_iUnion_lattice_inter_ball_add_vadd_fundamentalDomain S b hL R) rw [Set.biUnion_eq_iUnion, Set.inter_iUnion] at hsub have henc := Set.encard_mono hsub rw [Set.encard_disjoint_union_eq_tsum] at henc · simp_rw [S.encard_centers_in_translated_region hd] at henc · convert! henc rw [nsmul_eq_mul, ENat.tsum_subtype_constant_eq_encard_mul, mul_comm] · intro ⟨x, hx⟩ _ ⟨y, hy⟩ _ hxy have hxy' : x ≠ y := fun h => hxy (Subtype.ext h) refine Set.disjoint_left.2 fun u hux huy => (Set.disjoint_left.1 (fundamental_region_translates_disjoint (S := S) b hx.left hy.left hxy')) hux.right huy.right end theorem_2_3 section theorem_2_2 open scoped Pointwise variable {d : ℕ} (S : PeriodicSpherePacking d) {ι : Type*} [Finite ι] (D : Set (EuclideanSpace ℝ (Fin d))) {L : ℝ} (R : ℝ) theorem lattice_region_is_additive_fundamental_domain (hD_unique_covers : ∀ x, ∃! g : S.lattice, g +ᵥ x ∈ D) (hD_measurable : MeasurableSet D) : IsAddFundamentalDomain S.lattice D := MeasureTheory.IsAddFundamentalDomain.mk' (μ := volume) hD_measurable.nullMeasurableSet hD_unique_covers private theorem ball_covered_by_nearby_lattice_translates (hD_unique_covers : ∀ x, ∃! g : S.lattice, g +ᵥ x ∈ D) (hL : ∀ x ∈ D, ‖x‖ ≤ L) : ball 0 (R - L) ⊆ ⋃ x ∈ ↑S.lattice ∩ ball (0 : EuclideanSpace ℝ (Fin d)) R, (x +ᵥ D) := by intro x hx have hx' : ‖x‖ < R - L := by simpa [mem_ball_zero_iff] using! hx rcases hD_unique_covers x with ⟨g, hg, -⟩ simp_rw [Set.mem_iUnion, exists_prop, Set.mem_inter_iff] refine ⟨-g.val, ⟨⟨by simp, ?_⟩, ?_⟩⟩ · have : ‖g.val‖ < R := by have htri : ‖g.val‖ ≤ ‖g.val + x‖ + ‖x‖ := by simpa [sub_eq_add_neg, add_assoc] using! (norm_sub_le (a := g.val + x) (b := x)) refine lt_of_le_of_lt htri ?_ calc ‖g.val + x‖ + ‖x‖ < L + (R - L) := add_lt_add_of_le_of_lt (hL _ (by simpa using! hg)) hx' _ = R := by abel simpa [mem_ball_zero_iff, norm_neg] using! this · exact (Set.mem_vadd_set_iff_neg_vadd_mem).2 (by simpa using! hg) instance (E : Type*) [AddCommGroup E] [MeasurableSpace E] [MeasurableAdd E] [Module ℤ E] [Module ℝ E] (μ : Measure E) [μ.IsAddLeftInvariant] [IsScalarTower ℤ ℝ E] (s : Submodule ℤ E) : VAddInvariantMeasure s E μ where measure_preimage_vadd c t ht := by simp only [Submodule.vadd_def, vadd_eq_add, measure_preimage_add] theorem PeriodicSpherePacking.encard_lattice_inter_ball_ge_volume_ball_sub_div_volume (hD_unique_covers : ∀ x, ∃! g : S.lattice, g +ᵥ x ∈ D) (hL : ∀ x ∈ D, ‖x‖ ≤ L) : (↑S.lattice ∩ ball (0 : EuclideanSpace ℝ (Fin d)) R).encard ≥ volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R - L)) / volume D := by have hcover := volume.mono (ball_covered_by_nearby_lattice_translates (S := S) (D := D) (R := R) hD_unique_covers hL) rw [Set.biUnion_eq_iUnion] at hcover have hcount : Set.Countable ((S.lattice : Set (EuclideanSpace ℝ (Fin d))) ∩ ball 0 R) := Set.Countable.mono Set.inter_subset_left (countable_of_Lindelof_of_discrete (X := S.lattice)) letI : Countable ↑((S.lattice : Set (EuclideanSpace ℝ (Fin d))) ∩ ball 0 R) := hcount apply ENNReal.div_le_of_le_mul refine hcover.trans ?_ calc volume (⋃ x : ↑((S.lattice : Set (EuclideanSpace ℝ (Fin d))) ∩ ball 0 R), (x : EuclideanSpace ℝ (Fin d)) +ᵥ D) ≤ ∑' x : ↑((S.lattice : Set (EuclideanSpace ℝ (Fin d))) ∩ ball 0 R), volume ((x : EuclideanSpace ℝ (Fin d)) +ᵥ D) := measure_iUnion_le _ _ = ∑' _ : ↑((S.lattice : Set (EuclideanSpace ℝ (Fin d))) ∩ ball 0 R), volume D := by simp_rw [measure_vadd] _ = _ := ENNReal.tsum_set_const _ _ private theorem nearby_lattice_translates_subset_expanded_ball (hL : ∀ x ∈ D, ‖x‖ ≤ L) : ⋃ x ∈ ↑S.lattice ∩ ball (0 : EuclideanSpace ℝ (Fin d)) R, (x +ᵥ D) ⊆ ball 0 (R + L) := by intro x hx rw [mem_ball_zero_iff] rcases (by simpa [Set.mem_iUnion, exists_prop, Set.mem_inter_iff] using! hx) with ⟨i, ⟨-, hi_ball⟩, hi_mem⟩ have hi_ball' : ‖i‖ < R := by simpa [mem_ball_zero_iff] using! hi_ball have hi_mem' : ‖-i + x‖ ≤ L := hL _ (Set.mem_vadd_set_iff_neg_vadd_mem.mp hi_mem) calc _ = ‖i + (-i + x)‖ := by congr; abel _ ≤ ‖i‖ + ‖-i + x‖ := norm_add_le _ _ _ < R + L := add_lt_add_of_lt_of_le hi_ball' hi_mem' theorem PeriodicSpherePacking.encard_lattice_inter_ball_le_volume_ball_add_div_volume (hD_unique_covers : ∀ x, ∃! g : S.lattice, g +ᵥ x ∈ D) (hD_measurable : MeasurableSet D) (hL : ∀ x ∈ D, ‖x‖ ≤ L) (hd : 0 < d) : (↑S.lattice ∩ ball (0 : EuclideanSpace ℝ (Fin d)) R).encard ≤ volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + L)) / volume D := by classical let T : Set (EuclideanSpace ℝ (Fin d)) := ↑S.lattice ∩ ball 0 R letI : Countable T := Set.Countable.mono Set.inter_subset_left (countable_of_Lindelof_of_discrete (X := S.lattice)) have hfinite : volume D ≠ ⊤ := ne_of_lt <| ((Metric.isBounded_closedBall : Bornology.IsBounded (Metric.closedBall (0 : EuclideanSpace ℝ (Fin d)) L)).subset (fun x hx => by simpa [Metric.mem_closedBall, dist_zero_right] using hL x hx)).measure_lt_top letI : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd have hnonzero : volume D ≠ 0 := (lattice_region_is_additive_fundamental_domain S D hD_unique_covers hD_measurable).measure_ne_zero (fun hv => by have hp := euclidean_ball_volume_positive (0 : EuclideanSpace ℝ (Fin d)) (by norm_num : (0 : ℝ) < 1) simp [hv] at hp) apply (ENNReal.le_div_iff_mul_le (Or.inl hnonzero) (Or.inl hfinite)).2 calc (T.encard : ℝ≥0∞) * volume D = ∑' x : T, volume ((x : EuclideanSpace ℝ (Fin d)) +ᵥ D) := by simp_rw [measure_vadd] exact (ENNReal.tsum_set_const T (volume D)).symm _ = volume (⋃ x : T, (x : EuclideanSpace ℝ (Fin d)) +ᵥ D) := by symm apply measure_iUnion · intro x y hxy exact translates_disjoint_of_unique_cover (Λ := S.lattice) (D := D) hD_unique_covers (g := ⟨x, x.property.1⟩) (h := ⟨y, y.property.1⟩) (fun h => hxy (Subtype.ext (congrArg (fun z : S.lattice => (z : EuclideanSpace ℝ (Fin d))) h))) · intro x have hxset : (x : EuclideanSpace ℝ (Fin d)) +ᵥ D = (fun z : EuclideanSpace ℝ (Fin d) => -(x : EuclideanSpace ℝ (Fin d)) + z) ⁻¹' D := by ext z simp only [Set.mem_vadd_set_iff_neg_vadd_mem, Set.mem_preimage, vadd_eq_add] rw [hxset] exact hD_measurable.preimage (measurable_const.add measurable_id : Measurable (fun z : EuclideanSpace ℝ (Fin d) => -(x : EuclideanSpace ℝ (Fin d)) + z)) _ ≤ volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + L)) := by apply volume.mono simpa [T, Set.biUnion_eq_iUnion] using (nearby_lattice_translates_subset_expanded_ball (S := S) (D := D) (R := R) hL) open ZSpan variable (b : Basis ι ℤ S.lattice) theorem PeriodicSpherePacking.encard_lattice_inter_ball_ge_volume_ball_sub_div_volume_fundamentalDomain (hL : ∀ x ∈ fundamentalDomain (b.ofZLatticeBasis ℝ _), ‖x‖ ≤ L) : (↑S.lattice ∩ ball (0 : EuclideanSpace ℝ (Fin d)) R).encard ≥ volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R - L)) / volume (fundamentalDomain (b.ofZLatticeBasis ℝ _)) := by refine S.encard_lattice_inter_ball_ge_volume_ball_sub_div_volume _ R ?_ hL intro x rcases exist_unique_vadd_mem_fundamentalDomain (b.ofZLatticeBasis ℝ _) x with ⟨⟨v, hv⟩, hvD, hvuniq⟩ refine ⟨⟨v, by simpa [S.integral_basis_spans_packing_lattice] using! hv⟩, hvD, ?_⟩ rintro ⟨y, hy⟩ hyD have := hvuniq ⟨y, by simpa [S.integral_basis_spans_packing_lattice] using! hy⟩ hyD exact Subtype.ext (by simpa using! congrArg Subtype.val this) theorem PeriodicSpherePacking.encard_lattice_inter_ball_le_volume_ball_add_div_volume_fundamentalDomain (hL : ∀ x ∈ fundamentalDomain (b.ofZLatticeBasis ℝ _), ‖x‖ ≤ L) (hd : 0 < d) : (↑S.lattice ∩ ball (0 : EuclideanSpace ℝ (Fin d)) R).encard ≤ volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + L)) / volume (fundamentalDomain (b.ofZLatticeBasis ℝ _)) := by refine S.encard_lattice_inter_ball_le_volume_ball_add_div_volume _ R ?_ (fundamentalDomain_measurableSet _) hL hd intro x rcases exist_unique_vadd_mem_fundamentalDomain (b.ofZLatticeBasis ℝ _) x with ⟨⟨v, hv⟩, hvD, hvuniq⟩ refine ⟨⟨v, by simpa [S.integral_basis_spans_packing_lattice] using! hv⟩, hvD, ?_⟩ rintro ⟨y, hy⟩ hyD have := hvuniq ⟨y, by simpa [S.integral_basis_spans_packing_lattice] using! hy⟩ hyD exact Subtype.ext (by simpa using! congrArg Subtype.val this) section finiteDensity_limit open MeasureTheory Measure Metric ZSpan variable {d : ℕ} {S : PeriodicSpherePacking d} {ι : Type*} [Finite ι] (b : Basis ι ℤ S.lattice) {L : ℝ} (R : ℝ) theorem finiteDensity_le_numReps_mul_volume_ball_ratio (hL : ∀ x ∈ fundamentalDomain (b.ofZLatticeBasis ℝ _), ‖x‖ ≤ L) (hd : 0 < d) : S.densityInsideRadius R ≤ S.centerOrbitCardinality * volume (ball (0 : EuclideanSpace ℝ (Fin d)) (S.separation / 2)) / volume (fundamentalDomain (b.ofZLatticeBasis ℝ _)) * (volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + S.separation / 2 + L * 2)) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) R)) := calc _ ≤ (S.centers ∩ ball 0 (R + S.separation / 2)).encard * volume (ball (0 : EuclideanSpace ℝ (Fin d)) (S.separation / 2)) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) R) := S.local_density_upper_bound hd R _ ≤ S.centerOrbitCardinality • (↑S.lattice ∩ ball (0 : EuclideanSpace ℝ (Fin d)) (R + S.separation / 2 + L)).encard * volume (ball (0 : EuclideanSpace ℝ (Fin d)) (S.separation / 2)) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) R) := by gcongr simpa using! ENat.toENNReal_le.mpr (S.encard_centers_inter_ball_le_numReps_nsmul_encard_lattice_inter_ball hd b hL _) _ ≤ S.centerOrbitCardinality * (volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + S.separation / 2 + L + L)) / volume (fundamentalDomain (b.ofZLatticeBasis ℝ _))) * volume (ball (0 : EuclideanSpace ℝ (Fin d)) (S.separation / 2)) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) R) := by rw [nsmul_eq_mul] gcongr exact S.encard_lattice_inter_ball_le_volume_ball_add_div_volume_fundamentalDomain _ b hL hd _ = S.centerOrbitCardinality * volume (ball (0 : EuclideanSpace ℝ (Fin d)) (S.separation / 2)) / volume (fundamentalDomain (b.ofZLatticeBasis ℝ _)) * (volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + S.separation / 2 + L * 2)) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) R)) := by rw [← mul_div_assoc, ← mul_div_assoc, mul_two, ← add_assoc, ← ENNReal.mul_div_right_comm, ← ENNReal.mul_div_right_comm, mul_assoc, mul_assoc] congr 3 rw [mul_comm] theorem finiteDensity_ge_numReps_mul_volume_ball_ratio (hL : ∀ x ∈ fundamentalDomain (b.ofZLatticeBasis ℝ _), ‖x‖ ≤ L) (hd : 0 < d) : S.densityInsideRadius R ≥ S.centerOrbitCardinality * volume (ball (0 : EuclideanSpace ℝ (Fin d)) (S.separation / 2)) / volume (fundamentalDomain (b.ofZLatticeBasis ℝ _)) * (volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R - S.separation / 2 - L * 2)) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) R)) := by calc _ ≥ (S.centers ∩ ball 0 (R - S.separation / 2)).encard * volume (ball (0 : EuclideanSpace ℝ (Fin d)) (S.separation / 2)) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) R) := S.local_density_lower_bound hd R _ ≥ S.centerOrbitCardinality • (↑S.lattice ∩ ball (0 : EuclideanSpace ℝ (Fin d)) (R - S.separation / 2 - L)).encard * volume (ball (0 : EuclideanSpace ℝ (Fin d)) (S.separation / 2)) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) R) := by gcongr simpa using ENat.toENNReal_le.mpr (S.encard_centers_inter_ball_ge_numReps_nsmul_encard_lattice_inter_ball hd b hL (R - S.separation / 2)) _ ≥ S.centerOrbitCardinality * (volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R - S.separation / 2 - L - L)) / volume (fundamentalDomain (b.ofZLatticeBasis ℝ _))) * volume (ball (0 : EuclideanSpace ℝ (Fin d)) (S.separation / 2)) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) R) := by rw [nsmul_eq_mul] gcongr exact S.encard_lattice_inter_ball_ge_volume_ball_sub_div_volume_fundamentalDomain _ b hL _ = _ := by rw [show R - S.separation / 2 - L - L = R - S.separation / 2 - L * 2 by ring] simp only [div_eq_mul_inv] ac_rfl open Filter Topology section VolumeBallRatio open scoped Topology NNReal open Asymptotics Filter ENNReal EuclideanSpace lemma eventually_ofReal_div_add_one_rpow_mem_Icc {d : ℝ} {ε : ℝ≥0∞} (hd : 0 ≤ d) (hε : 0 < ε) : ∃ k : ℝ, k ≥ 0 ∧ ∀ k' ≥ k, ENNReal.ofReal ((k' / (k' + 1)) ^ d) ∈ Set.Icc (1 - ε) (1 + ε) := by have hshift : Tendsto (fun k : ℝ => k + 1) atTop atTop := by simpa using (tendsto_atTop_add_const_right atTop (1 : ℝ) tendsto_id) have hzero : Tendsto (fun k : ℝ => 1 / (k + 1)) atTop (𝓝 0) := tendsto_const_nhds.div_atTop hshift have hratio : Tendsto (fun k : ℝ => k / (k + 1)) atTop (𝓝 1) := by have hone : Tendsto (fun _ : ℝ => (1 : ℝ)) atTop (𝓝 1) := tendsto_const_nhds have hnear : Tendsto (fun k : ℝ => 1 - 1 / (k + 1)) atTop (𝓝 1) := by simpa only [sub_zero] using hone.sub hzero refine hnear.congr' ?_ filter_upwards [eventually_gt_atTop (-1 : ℝ)] with k hk have hne : k + 1 ≠ 0 := by linarith field_simp ring have hrpow : Tendsto (fun k : ℝ => (k / (k + 1)) ^ d) atTop (𝓝 1) := by simpa only [Function.comp_def, Real.one_rpow] using (Real.continuous_rpow_const hd).continuousAt.tendsto.comp hratio have hlimit : Tendsto (fun k : ℝ => ENNReal.ofReal ((k / (k + 1)) ^ d)) atTop (𝓝 (1 : ℝ≥0∞)) := by simpa only [Function.comp_def, ENNReal.ofReal_one] using ENNReal.continuous_ofReal.continuousAt.tendsto.comp hrpow have hlower : 1 - ε < (1 : ℝ≥0∞) := ENNReal.sub_lt_self (by simp) (by simp) (ne_of_gt hε) have hupper : (1 : ℝ≥0∞) < 1 + ε := by exact ENNReal.lt_add_right (by simp) (ne_of_gt hε) obtain ⟨k, hk⟩ := eventually_atTop.1 (hlimit.eventually (Ioo_mem_nhds hlower hupper)) refine ⟨max k 0, le_max_right _ _, ?_⟩ intro k' hk' have hmem := hk k' (le_trans (le_max_left _ _) hk') exact ⟨hmem.1.le, hmem.2.le⟩ lemma eventually_ofReal_div_add_one_pow_mem_Icc {ε : ℝ≥0∞} (hε : 0 < ε) : ∃ k : ℝ, k ≥ 0 ∧ ∀ k' ≥ k, ENNReal.ofReal ((k' / (k' + 1)) ^ d) ∈ Set.Icc (1 - ε) (1 + ε) := by simpa using! eventually_ofReal_div_add_one_rpow_mem_Icc (d := d) (Nat.cast_nonneg _) hε theorem volume_ball_div_volume_ball_add_tendsto_one {C : ℝ} (hd : 0 < d) (hC : 0 ≤ C) : Tendsto (fun R ↦ volume (ball (0 : EuclideanSpace ℝ (Fin d)) R) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + C))) atTop (𝓝 1) := by letI : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd let c : ℝ≥0∞ := ENNReal.ofReal (Real.sqrt Real.pi ^ d / Real.Gamma ((d : ℝ) / 2 + 1)) have hc : c ≠ 0 := by have hb : volume (ball (0 : EuclideanSpace ℝ (Fin d)) 1) ≠ 0 := ne_of_gt (measure_ball_pos (μ := volume) 0 (by norm_num)) rw [EuclideanSpace.volume_ball] at hb simpa [c] using hb have hctop : c ≠ ⊤ := by exact ENNReal.ofReal_ne_top have hshift : Tendsto (fun R : ℝ => R + C) atTop atTop := by simpa using (tendsto_atTop_add_const_right atTop C tendsto_id) have hzero : Tendsto (fun R : ℝ => C / (R + C)) atTop (𝓝 0) := tendsto_const_nhds.div_atTop hshift have hratio : Tendsto (fun R : ℝ => R / (R + C)) atTop (𝓝 1) := by have hone : Tendsto (fun _ : ℝ => (1 : ℝ)) atTop (𝓝 1) := tendsto_const_nhds have hnear : Tendsto (fun R : ℝ => 1 - C / (R + C)) atTop (𝓝 1) := by simpa only [sub_zero] using hone.sub hzero refine hnear.congr' ?_ filter_upwards [eventually_gt_atTop (-C)] with R hR have hne : R + C ≠ 0 := by linarith field_simp ring have hpow : Tendsto (fun R : ℝ => (R / (R + C)) ^ d) atTop (𝓝 1) := by simpa using hratio.pow d have hlimit : Tendsto (fun R : ℝ => ENNReal.ofReal ((R / (R + C)) ^ d)) atTop (𝓝 (1 : ℝ≥0∞)) := by simpa only [Function.comp_def, ENNReal.ofReal_one] using ENNReal.continuous_ofReal.continuousAt.tendsto.comp hpow refine hlimit.congr' ?_ filter_upwards [eventually_gt_atTop (0 : ℝ)] with R hR have hRC : 0 < R + C := by linarith symm rw [EuclideanSpace.volume_ball, EuclideanSpace.volume_ball] simp only [Fintype.card_fin] change ENNReal.ofReal R ^ d * c / (ENNReal.ofReal (R + C) ^ d * c) = _ rw [ENNReal.mul_div_mul_right _ _ hc hctop, ← ENNReal.ofReal_pow hR.le d, ← ENNReal.ofReal_pow hRC.le d, ← ENNReal.ofReal_div_of_pos (pow_pos hRC d), ← div_pow] theorem volume_ball_add_div_volume_ball_add_tendsto_one_of_nonneg {d : ℕ} {C C' : ℝ} (hd : 0 < d) (hC : 0 ≤ C) (hC' : 0 ≤ C') : Tendsto (fun R ↦ volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + C)) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + C'))) atTop (𝓝 1) := by haveI : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd have hshift : Tendsto (fun R : ℝ => R + C') atTop atTop := tendsto_atTop_add_const_right _ C' tendsto_id have herror : Tendsto (fun R : ℝ => (C - C') / (R + C')) atTop (𝓝 0) := by simpa [div_eq_mul_inv] using (tendsto_inv_atTop_zero.comp hshift).const_mul (C - C') have hratio : Tendsto (fun R : ℝ => (R + C) / (R + C')) atTop (𝓝 1) := by have hsum : Tendsto (fun R : ℝ => 1 + (C - C') / (R + C')) atTop (𝓝 1) := by simpa using tendsto_const_nhds.add herror apply Tendsto.congr' (f₁ := fun R : ℝ => 1 + (C - C') / (R + C')) ?_ hsum filter_upwards [eventually_ge_atTop (1 : ℝ)] with R hR have hden : R + C' ≠ 0 := ne_of_gt (by linarith) field_simp; ring have hpow : Tendsto (fun R : ℝ => ((R + C) / (R + C')) ^ d) atTop (𝓝 1) := by simpa using hratio.pow d have henn : Tendsto (fun R : ℝ => ENNReal.ofReal (((R + C) / (R + C')) ^ d)) atTop (𝓝 1) := by simpa using tendsto_ofReal hpow apply Tendsto.congr' (f₁ := fun R : ℝ => ENNReal.ofReal (((R + C) / (R + C')) ^ d)) ?_ henn filter_upwards [eventually_ge_atTop (1 : ℝ)] with R hR symm rw [volume_ball, volume_ball, Fintype.card_fin, ← ENNReal.ofReal_pow, ← ENNReal.ofReal_mul, ← ENNReal.ofReal_pow, ← ENNReal.ofReal_mul, ← ENNReal.ofReal_div_of_pos, mul_div_mul_right, ← div_pow] <;> positivity theorem Filter.atTop_invariant_under_translation {β : Type*} {f : ℝ → β} (C : ℝ) (α : Filter β) : Tendsto f atTop α ↔ Tendsto (fun x ↦ f (x + C)) atTop α := by have hmap : Filter.map (fun x : ℝ => x + C) atTop = atTop := by simpa using! (Filter.map_add_atTop_eq (α := ℝ) (k := C)) constructor <;> intro hf · exact tendsto_map'_iff.mp (by simpa [hmap] using! hf) · have : Tendsto f (Filter.map (fun x : ℝ => x + C) atTop) α := tendsto_map'_iff.mpr hf simpa [hmap] using! this theorem volume_ball_add_div_volume_ball_add_tendsto_one {d : ℕ} {C C' : ℝ} (hd : 0 < d) : Tendsto (fun R ↦ volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + C)) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + C'))) atTop (𝓝 1) := by have hC₀ : 0 ≤ max (-C) (-C') + C := by linarith [le_max_left (-C) (-C')] have hC'₀ : 0 ≤ max (-C) (-C') + C' := by linarith [le_max_right (-C) (-C')] refine (Filter.atTop_invariant_under_translation (f := fun R ↦ volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + C)) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + C'))) (max (-C) (-C')) _).mpr ?_ simpa [add_assoc] using! volume_ball_add_div_volume_ball_add_tendsto_one_of_nonneg (d := d) (C := max (-C) (-C') + C) (C' := max (-C) (-C') + C') hd hC₀ hC'₀ end VolumeBallRatio end finiteDensity_limit end theorem_2_2 end section open scoped ENNReal open SpherePacking EuclideanSpace MeasureTheory Metric ZSpan Bornology Module open Filter open scoped Pointwise open scoped Topology variable {d : ℕ} section DensityEqFdDensity variable {d : ℕ} {S : PeriodicSpherePacking d} {ι : Type*} [Finite ι] (b : Basis ι ℤ S.lattice) {L : ℝ} (R : ℝ) lemma PeriodicSpherePacking.local_packing_density_tends_to_formula (hL : ∀ x ∈ fundamentalDomain (b.ofZLatticeBasis ℝ _), ‖x‖ ≤ L) (hd : 0 < d) : Tendsto S.densityInsideRadius atTop (𝓝 (S.centerOrbitCardinality * volume (ball (0 : EuclideanSpace ℝ (Fin d)) (S.separation / 2)) / volume (fundamentalDomain (b.ofZLatticeBasis ℝ _)))) := by apply tendsto_of_tendsto_of_tendsto_of_le_of_le ?_ ?_ (finiteDensity_ge_numReps_mul_volume_ball_ratio b · hL hd) (finiteDensity_le_numReps_mul_volume_ball_ratio b · hL hd) · rw [show ∀ a : ENNReal, 𝓝 a = 𝓝 (a * 1) by intro; rw [mul_one]] apply ENNReal.Tendsto.const_mul · simp_rw [sub_sub, sub_eq_add_neg] convert! volume_ball_add_div_volume_ball_add_tendsto_one hd (C := -(S.separation / 2 + L * 2)) rw [add_zero] · left exact one_ne_zero · rw [show ∀ a : ENNReal, 𝓝 a = 𝓝 (a * 1) by intro; rw [mul_one]] apply ENNReal.Tendsto.const_mul · simp_rw [add_assoc] convert! volume_ball_add_div_volume_ball_add_tendsto_one hd (C := S.separation / 2 + L * 2) rw [add_zero] · left exact one_ne_zero theorem PeriodicSpherePacking.density_eq_numReps_mul_volume_ball_div_volume_fundamentalDomain (hL : ∀ x ∈ fundamentalDomain (b.ofZLatticeBasis ℝ _), ‖x‖ ≤ L) (hd : 0 < d) : S.upperPackingDensity = S.centerOrbitCardinality * volume (ball (0 : EuclideanSpace ℝ (Fin d)) (S.separation / 2)) / volume (fundamentalDomain (b.ofZLatticeBasis ℝ _)) := limsSup_eq_of_le_nhds (S.local_packing_density_tends_to_formula b hL hd) end DensityEqFdDensity section ConstantEqNormalizedConstant theorem periodic_packing_supremum_eq_unit_separation : PeriodicSpherePackingConstant d = ⨆ (S : PeriodicSpherePacking d) (_ : S.separation = 1), S.upperPackingDensity := by rw [iSup_subtype', PeriodicSpherePackingConstant] apply le_antisymm · apply iSup_le intro S have h := inv_mul_cancel₀ S.separation_pos.ne.symm have := le_iSup (fun x : { x : PeriodicSpherePacking d // x.separation = 1 } ↦ x.val.upperPackingDensity) ⟨S.rescaleConfiguration (inv_pos.mpr S.separation_pos), h⟩ rw [← rescale_upper_packing_density] · exact this · rw [inv_pos] exact S.separation_pos · refine iSup_le ?_ rintro ⟨S, _⟩ exact le_iSup (fun S : PeriodicSpherePacking d => S.upperPackingDensity) S end ConstantEqNormalizedConstant section Disjoint_Covering_of_Centers theorem PeriodicSpherePacking.center_representatives_cover_uniquely (S : PeriodicSpherePacking d) {D : Set (EuclideanSpace ℝ (Fin d))} (hD_unique_covers : ∀ x, ∃! g : S.lattice, g +ᵥ x ∈ D) : ∀ x : S.centers, ∃! g : S.lattice, (g +ᵥ x : EuclideanSpace ℝ (Fin d)) ∈ S.centers ∩ D := by intro x obtain ⟨g, hg, hunique⟩ := hD_unique_covers (x : EuclideanSpace ℝ (Fin d)) refine ⟨g, ⟨?_, hg⟩, ?_⟩ · exact S.lattice_action g.property x.property · intro h hh exact hunique h hh.2 end Disjoint_Covering_of_Centers section Fundamental_Domains_in_terms_of_Basis open Submodule variable (S : PeriodicSpherePacking d) (b : Basis (Fin d) ℤ S.lattice) theorem PeriodicSpherePacking.fundamental_region_admits_norm_bound : ∃ L : ℝ, ∀ x ∈ fundamentalDomain (b.ofZLatticeBasis ℝ _), ‖x‖ ≤ L := isBounded_iff_forall_norm_le.1 (fundamentalDomain_isBounded (Basis.ofZLatticeBasis ℝ S.lattice b)) theorem PeriodicSpherePacking.basis_region_translates_cover_uniquely : ∀ x, ∃! g : S.lattice, g +ᵥ x ∈ fundamentalDomain (b.ofZLatticeBasis ℝ _) := by intro x obtain ⟨g, hg, h_unique⟩ := exist_unique_vadd_mem_fundamentalDomain (b.ofZLatticeBasis ℝ _) x have hg_lattice : (g : EuclideanSpace ℝ (Fin d)) ∈ S.lattice := (S.mem_integral_basis_span_iff b g).mp g.property refine ⟨⟨g, hg_lattice⟩, hg, ?_⟩ rintro ⟨h, hh⟩ h_mem apply Subtype.ext exact congrArg (fun z : Submodule.span ℤ (Set.range (b.ofZLatticeBasis ℝ _)) => (z : EuclideanSpace ℝ (Fin d))) (h_unique ⟨h, (S.mem_integral_basis_span_iff b h).mpr hh⟩ h_mem) end Fundamental_Domains_in_terms_of_Basis section Periodic_Density_Formula noncomputable def PeriodicSpherePacking.coordinateIndexEquiv (P : PeriodicSpherePacking d) : (Module.Free.ChooseBasisIndex ℤ ↥P.lattice) ≃ (Fin d) := ZLattice.coordinateIndexEquiv P.lattice noncomputable def PeriodicSpherePacking.canonicalPackingLatticeBasis (S : PeriodicSpherePacking d) : Basis (Fin d) ℤ ↥S.lattice := ((ZLattice.module_free ℝ S.lattice).chooseBasis).reindex S.coordinateIndexEquiv @[simp] theorem PeriodicSpherePacking.density_eq_numReps_mul_volume_ball_div_covolume (S : PeriodicSpherePacking d) (hd : 0 < d) : S.upperPackingDensity = (ENat.toENNReal (S.centerOrbitCardinality : ENat)) * volume (ball (0 : EuclideanSpace ℝ (Fin d)) (S.separation / 2)) / Real.toNNReal (ZLattice.covolume S.lattice) := by obtain ⟨L, hL⟩ := S.fundamental_region_admits_norm_bound S.canonicalPackingLatticeBasis rw [S.density_eq_numReps_mul_volume_ball_div_volume_fundamentalDomain S.canonicalPackingLatticeBasis hL hd] haveI : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd have hfinite : volume (fundamentalDomain (S.canonicalPackingLatticeBasis.ofZLatticeBasis ℝ _)) ≠ ⊤ := (Bornology.IsBounded.measure_lt_top (fundamentalDomain_isBounded (S.canonicalPackingLatticeBasis.ofZLatticeBasis ℝ _))).ne have hfund : IsAddFundamentalDomain S.lattice (fundamentalDomain (S.canonicalPackingLatticeBasis.ofZLatticeBasis ℝ _)) := lattice_region_is_additive_fundamental_domain S _ (S.basis_region_translates_cover_uniquely S.canonicalPackingLatticeBasis) (fundamentalDomain_measurableSet _) rw [ZLattice.covolume_eq_measure_fundamentalDomain S.lattice volume hfund] have hdenom : (↑(Real.toNNReal (volume.real (fundamentalDomain (S.canonicalPackingLatticeBasis.ofZLatticeBasis ℝ _)))) : ENNReal) = volume (fundamentalDomain (S.canonicalPackingLatticeBasis.ofZLatticeBasis ℝ _)) := by change ENNReal.ofReal (volume (fundamentalDomain (S.canonicalPackingLatticeBasis.ofZLatticeBasis ℝ _))).toReal = _ exact ENNReal.ofReal_toReal hfinite rw [hdenom] norm_num end Periodic_Density_Formula section Empty_Centers theorem PeriodicSpherePacking.packing_density_zero_of_empty_centers (S : PeriodicSpherePacking d) (hd : 0 < d) [instEmpty : IsEmpty S.centers] : S.upperPackingDensity = 0 := by rw [S.density_eq_numReps_mul_volume_ball_div_covolume hd] let b := S.canonicalPackingLatticeBasis let D := fundamentalDomain (Basis.ofZLatticeBasis ℝ S.lattice b) have hD_isBounded : IsBounded D := fundamentalDomain_isBounded (Basis.ofZLatticeBasis ℝ S.lattice b) have hD_unique_covers : ∀ x, ∃! g : S.lattice, g +ᵥ x ∈ D := S.basis_region_translates_cover_uniquely b rw [← S.card_centers_in_fundamental_region D hD_isBounded hD_unique_covers hd] simp only [Set.toFinset_card, ENat.toENNReal_coe, ENNReal.div_eq_zero_iff, mul_eq_zero, Nat.cast_eq_zero, ENNReal.coe_ne_top, or_false] left letI := @Fintype.ofFinite _ <| finite_centers_in_bounded_region S D hD_isBounded hd haveI : IsEmpty (↥(S.centers ∩ D)) := ⟨fun x => instEmpty.false ⟨x.1, x.2.1⟩⟩ simp end Empty_Centers end section open scoped ENNReal open SpherePacking EuclideanSpace MeasureTheory Metric ZSpan Bornology Module section PeriodicConstantAux open MeasureTheory Metric EuclideanSpace open scoped Pointwise variable {d : ℕ} lemma coordinate_abs_bounded_by_norm (x : EuclideanSpace ℝ (Fin d)) (i : Fin d) : |x i| ≤ ‖x‖ := by simpa [EuclideanSpace.inner_single_left, PiLp.norm_single] using! abs_real_inner_le_norm (EuclideanSpace.single i (1 : ℝ)) x lemma coordinate_difference_small_inside_ball {x y : EuclideanSpace ℝ (Fin d)} {r : ℝ} (hy : y ∈ ball x r) (i : Fin d) : |y i - x i| < r := by have hnorm : ‖y - x‖ < r := by simpa [Metric.mem_ball, dist_eq_norm, dist_comm] using! hy exact lt_of_le_of_lt (by simpa using! coordinate_abs_bounded_by_norm (d := d) (y - x) i) hnorm lemma metric_ball_subset_axis_cell {x : EuclideanSpace ℝ (Fin d)} {r L : ℝ} (hx : ∀ i : Fin d, x i ∈ Set.Icc r (L - r)) : ball x r ⊆ {y : EuclideanSpace ℝ (Fin d) | ∀ i : Fin d, y i ∈ Set.Ico (0 : ℝ) L} := by intro y hy i have hxi := hx i have hsub : |y i - x i| < r := coordinate_difference_small_inside_ball (d := d) hy i have hy0 : 0 ≤ y i := by have hx0 : 0 ≤ x i - r := sub_nonneg.mpr hxi.1 have : x i - r < y i := by linarith [(abs_lt.mp hsub).1] exact hx0.trans (le_of_lt this) have hyL : y i < L := by have : y i < x i + r := by linarith [(abs_lt.mp hsub).2] exact lt_of_lt_of_le this (by linarith [hxi.2]) exact ⟨hy0, hyL⟩ lemma center_distance_bound_of_disjoint_regions {x y : EuclideanSpace ℝ (Fin d)} {r : ℝ} {A B : Set (EuclideanSpace ℝ (Fin d))} (hx : ball x r ⊆ A) (hy : ball y r ⊆ B) (hAB : Disjoint A B) : 2 * r ≤ dist x y := by by_contra hlt have hlt' : dist x y < 2 * r := lt_of_not_ge hlt let m : EuclideanSpace ℝ (Fin d) := midpoint ℝ x y have hhalf : (1 / 2 : ℝ) * dist x y < r := by nlinarith have hmx : m ∈ ball x r := by simpa [Metric.mem_ball, dist_comm, m] using! (by simpa [m] using! hhalf : dist m x < r) have hmy : m ∈ ball y r := by simpa [Metric.mem_ball, dist_comm, m] using! (by simpa [m, dist_comm] using! hhalf : dist m y < r) exact Set.disjoint_left.1 hAB (hx hmx) (hy hmy) open scoped Pointwise in noncomputable def latticeReplicatedCenters (Λ : Submodule ℤ (EuclideanSpace ℝ (Fin d))) (F : Set (EuclideanSpace ℝ (Fin d))) : Set (EuclideanSpace ℝ (Fin d)) := ⋃ g : Λ, g +ᵥ F lemma mem_replicated_centers_iff {Λ : Submodule ℤ (EuclideanSpace ℝ (Fin d))} {F : Set (EuclideanSpace ℝ (Fin d))} {x : EuclideanSpace ℝ (Fin d)} : x ∈ latticeReplicatedCenters (d := d) Λ F ↔ ∃ g : Λ, ∃ f ∈ F, x = g +ᵥ f := by simp [latticeReplicatedCenters, Set.mem_iUnion, Set.mem_vadd_set, eq_comm] lemma replicated_centers_translation_closed {Λ : Submodule ℤ (EuclideanSpace ℝ (Fin d))} {F : Set (EuclideanSpace ℝ (Fin d))} {x y : EuclideanSpace ℝ (Fin d)} (hx : x ∈ Λ) (hy : y ∈ latticeReplicatedCenters (d := d) Λ F) : x + y ∈ latticeReplicatedCenters (d := d) Λ F := by rcases (mem_replicated_centers_iff (d := d) (Λ := Λ) (F := F) (x := y)).1 hy with ⟨g, f, hf, rfl⟩ refine (mem_replicated_centers_iff (d := d) (Λ := Λ) (F := F)).2 ⟨(⟨x, hx⟩ : Λ) + g, f, hf, ?_⟩ simp [Submodule.vadd_def, vadd_eq_add, add_assoc] lemma translated_ball_subset_translated_region {Λ : Submodule ℤ (EuclideanSpace ℝ (Fin d))} {D : Set (EuclideanSpace ℝ (Fin d))} {r : ℝ} {g : Λ} {x : EuclideanSpace ℝ (Fin d)} (hx : ball x r ⊆ D) : ball (g +ᵥ x) r ⊆ g +ᵥ D := by intro y hy refine Set.mem_vadd_set.2 ⟨(-g : Λ) +ᵥ y, ?_, by simp [Submodule.vadd_def, vadd_eq_add]⟩ apply hx have : (- (g : EuclideanSpace ℝ (Fin d))) +ᵥ y ∈ (- (g : EuclideanSpace ℝ (Fin d))) +ᵥ ball (g +ᵥ x) r := Set.mem_vadd_set.2 ⟨y, by simpa [Submodule.vadd_def, vadd_eq_add] using! hy, rfl⟩ simpa [Metric.vadd_ball, add_vadd, Submodule.vadd_def, vadd_eq_add] using! this noncomputable def replicate_to_periodic_packing (S : SpherePacking d) (Λ : Submodule ℤ (EuclideanSpace ℝ (Fin d))) [DiscreteTopology Λ] [IsZLattice ℝ Λ] (D F : Set (EuclideanSpace ℝ (Fin d))) (hD_unique_covers : ∀ x, ∃! g : Λ, g +ᵥ x ∈ D) (hF_centers : F ⊆ S.centers) (hF_ball : ∀ x ∈ F, ball x (S.separation / 2) ⊆ D) : PeriodicSpherePacking d := by refine { centers := latticeReplicatedCenters (d := d) Λ F separation := S.separation separation_pos := S.separation_pos centers_dist := ?_ lattice := Λ lattice_action := ?_ lattice_discrete := inferInstance lattice_isZLattice := inferInstance } · intro a b hab change S.separation ≤ dist (a : EuclideanSpace ℝ (Fin d)) (b : EuclideanSpace ℝ (Fin d)) rcases (mem_replicated_centers_iff (d := d) (Λ := Λ) (F := F) (x := (a : EuclideanSpace ℝ (Fin d)))).1 a.property with ⟨ga, fa, hfa, ha⟩ rcases (mem_replicated_centers_iff (d := d) (Λ := Λ) (F := F) (x := (b : EuclideanSpace ℝ (Fin d)))).1 b.property with ⟨gb, fb, hfb, hb⟩ by_cases hgg : ga = gb · subst hgg have hne : fa ≠ fb := by intro h apply hab apply Subtype.ext simp [ha, hb, h] have hdist := S.distinct_centers_separation_bound fa fb (hF_centers hfa) (hF_centers hfb) hne have : S.separation ≤ dist (ga +ᵥ fa) (ga +ᵥ fb) := by have htrans : dist (ga +ᵥ fa) (ga +ᵥ fb) = dist fa fb := dist_vadd_cancel_left (ga : EuclideanSpace ℝ (Fin d)) fa fb simpa [htrans] using! hdist simpa [ha, hb] using! this · have hballa : ball (ga +ᵥ fa) (S.separation / 2) ⊆ ga +ᵥ D := translated_ball_subset_translated_region (d := d) (Λ := Λ) (D := D) (g := ga) (x := fa) (r := S.separation / 2) (hF_ball fa hfa) have hballb : ball (gb +ᵥ fb) (S.separation / 2) ⊆ gb +ᵥ D := translated_ball_subset_translated_region (d := d) (Λ := Λ) (D := D) (g := gb) (x := fb) (r := S.separation / 2) (hF_ball fb hfb) have hdisj : Disjoint (ga +ᵥ D) (gb +ᵥ D) := translates_disjoint_of_unique_cover (d := d) (Λ := Λ) (D := D) hD_unique_covers hgg have : 2 * (S.separation / 2) ≤ dist (ga +ᵥ fa) (gb +ᵥ fb) := center_distance_bound_of_disjoint_regions (d := d) hballa hballb hdisj have : S.separation ≤ dist (ga +ᵥ fa) (gb +ᵥ fb) := by simpa [two_mul, add_halves] using! this simpa [ha, hb] using! this · intro x y hx hy exact replicated_centers_translation_closed (d := d) (Λ := Λ) (F := F) hx hy end PeriodicConstantAux section PeriodicConstantCube open scoped Pointwise variable {d : ℕ} def axisAlignedCell (L : ℝ) : Set (EuclideanSpace ℝ (Fin d)) := {x | ∀ i : Fin d, x i ∈ Set.Ico (0 : ℝ) L} def insetAxisAlignedCell (L r : ℝ) : Set (EuclideanSpace ℝ (Fin d)) := {x | ∀ i : Fin d, x i ∈ Set.Icc r (L - r)} noncomputable def axisCellBasis (L : ℝ) (hL : 0 < L) : Basis (Fin d) ℝ (EuclideanSpace ℝ (Fin d)) := ((EuclideanSpace.basisFun (Fin d) ℝ).toBasis).isUnitSMul (fun _ : Fin d ↦ IsUnit.mk0 L (ne_of_gt hL)) noncomputable def axisCellLattice (L : ℝ) (hL : 0 < L) : Submodule ℤ (EuclideanSpace ℝ (Fin d)) := Submodule.span ℤ (Set.range (axisCellBasis (d := d) L hL)) lemma axis_cell_basis_fundamental_region (L : ℝ) (hL : 0 < L) : fundamentalDomain (axisCellBasis (d := d) L hL) = axisAlignedCell (d := d) L := by ext x simp only [ZSpan.mem_fundamentalDomain, axisAlignedCell, axisCellBasis, Module.Basis.repr_isUnitSMul, Units.smul_def, Units.val_inv_eq_inv_val, Set.mem_setOf_eq, Set.mem_Ico] constructor · intro hx i specialize hx i refine ⟨?_, ?_⟩ · have : 0 ≤ (L : ℝ) * (L⁻¹ * x.ofLp i) := mul_nonneg (le_of_lt hL) hx.1 have : 0 ≤ (L * L⁻¹) * x.ofLp i := by simpa [mul_assoc] using! this simpa [mul_inv_cancel₀ (ne_of_gt hL)] using! this · have : (L : ℝ) * (L⁻¹ * x.ofLp i) < (L : ℝ) * 1 := mul_lt_mul_of_pos_left hx.2 hL have : (L * L⁻¹) * x.ofLp i < (L : ℝ) * 1 := by simpa [mul_assoc] using! this simpa [mul_inv_cancel₀ (ne_of_gt hL)] using! this · intro hx i specialize hx i have hLinv : 0 < (L⁻¹ : ℝ) := inv_pos.mpr hL refine ⟨mul_nonneg (le_of_lt hLinv) hx.1, ?_⟩ have : (L⁻¹ : ℝ) * x.ofLp i < (L⁻¹ : ℝ) * L := mul_lt_mul_of_pos_left hx.2 hLinv simpa [mul_assoc, inv_mul_cancel₀ (ne_of_gt hL), one_mul] using! this lemma metric_ball_subset_inset_axis_cell {L r : ℝ} {x : EuclideanSpace ℝ (Fin d)} (hx : x ∈ insetAxisAlignedCell (d := d) L r) : ball x r ⊆ axisAlignedCell (d := d) L := by simpa [axisAlignedCell, insetAxisAlignedCell] using! metric_ball_subset_axis_cell (d := d) (x := x) (r := r) (L := L) hx lemma replicated_centers_intersection_of_subset {Λ : Submodule ℤ (EuclideanSpace ℝ (Fin d))} {D F : Set (EuclideanSpace ℝ (Fin d))} (hF_sub : F ⊆ D) (hD_unique_covers : ∀ x, ∃! g : Λ, g +ᵥ x ∈ D) : latticeReplicatedCenters (d := d) Λ F ∩ D = F := by ext x constructor · rintro ⟨hx, hxD⟩ rcases (mem_replicated_centers_iff (d := d) (Λ := Λ) (F := F)).1 hx with ⟨g, f, hf, hxf⟩ obtain ⟨g₀, hg₀, hunique⟩ := hD_unique_covers f have hg : g = g₀ := hunique g (show g +ᵥ f ∈ D from hxf ▸ hxD) have hzero : (0 : Λ) = g₀ := hunique 0 (by simpa using hF_sub hf) have : g = 0 := hg.trans hzero.symm simpa [hxf, this] using hf · intro hx refine ⟨?_, hF_sub hx⟩ exact (mem_replicated_centers_iff (d := d) (Λ := Λ) (F := F)).2 ⟨0, x, hx, by simp⟩ end PeriodicConstantCube section Periodic_Constant_Eq_Constant open scoped Pointwise namespace PeriodicConstant variable {d : ℕ} private lemma coordinate_preimage_volume (s : Set (Fin d → ℝ)) (hs : MeasurableSet s) : volume ((fun x : EuclideanSpace ℝ (Fin d) ↦ x.ofLp) ⁻¹' s) = volume s := by simpa using! (PiLp.volume_preserving_ofLp (ι := Fin d)).measure_preimage hs.nullMeasurableSet lemma axis_cell_translates_cover_uniquely (L : ℝ) (hL : 0 < L) : ∀ x, ∃! g : axisCellLattice (d := d) L hL, g +ᵥ x ∈ axisAlignedCell (d := d) L := fun x => by simpa [axisCellLattice, axis_cell_basis_fundamental_region (d := d) (L := L) (hL := hL)] using! exist_unique_vadd_mem_fundamentalDomain (axisCellBasis (d := d) L hL) x lemma axis_cell_is_bounded (L : ℝ) (hL : 0 < L) : IsBounded (axisAlignedCell (d := d) L) := by simpa [axis_cell_basis_fundamental_region (d := d) (L := L) (hL := hL)] using! fundamentalDomain_isBounded (axisCellBasis (d := d) L hL) lemma axis_cell_is_measurable (L : ℝ) (hL : 0 < L) : MeasurableSet (axisAlignedCell (d := d) L) := by simpa [axis_cell_basis_fundamental_region (d := d) (L := L) (hL := hL)] using! fundamentalDomain_measurableSet (axisCellBasis (d := d) L hL) lemma axis_cell_eq_coordinate_preimage (L : ℝ) : axisAlignedCell (d := d) L = (fun x : EuclideanSpace ℝ (Fin d) ↦ x.ofLp) ⁻¹' (Set.pi Set.univ fun _ : Fin d ↦ Set.Ico (0 : ℝ) L) := by ext x simp [axisAlignedCell, Set.mem_pi] lemma axis_cell_volume_formula (L : ℝ) : volume (axisAlignedCell (d := d) L) = (ENNReal.ofReal L) ^ d := by have hmeas : MeasurableSet (Set.pi Set.univ fun _ : Fin d ↦ Set.Ico (0 : ℝ) L) := by simpa using! (MeasurableSet.pi Set.countable_univ fun _ _ ↦ measurableSet_Ico) have hpre : volume (axisAlignedCell (d := d) L) = volume (Set.pi Set.univ fun _ : Fin d ↦ Set.Ico (0 : ℝ) L) := by simpa [axis_cell_eq_coordinate_preimage (d := d) (L := L)] using! (coordinate_preimage_volume (d := d) (s := Set.pi Set.univ fun _ : Fin d ↦ Set.Ico (0 : ℝ) L) hmeas) rw [hpre, volume_pi, Measure.pi_pi] simp [Real.volume_Ico, sub_zero] lemma inset_cell_eq_coordinate_preimage (L r : ℝ) : insetAxisAlignedCell (d := d) L r = (fun x : EuclideanSpace ℝ (Fin d) ↦ x.ofLp) ⁻¹' (Set.pi Set.univ fun _ : Fin d ↦ Set.Icc r (L - r)) := by ext x simp [insetAxisAlignedCell, Pi.le_def, forall_and] lemma inset_axis_cell_volume_formula (L r : ℝ) : volume (insetAxisAlignedCell (d := d) L r) = (ENNReal.ofReal (L - 2 * r)) ^ d := by have hmeas : MeasurableSet (Set.pi Set.univ fun _ : Fin d ↦ Set.Icc r (L - r)) := by exact MeasurableSet.pi Set.countable_univ fun _ _ ↦ measurableSet_Icc have hpre : volume (insetAxisAlignedCell (d := d) L r) = volume (Set.pi Set.univ fun _ : Fin d ↦ Set.Icc r (L - r)) := by simpa [inset_cell_eq_coordinate_preimage (d := d) (L := L) (r := r)] using! (coordinate_preimage_volume (d := d) (s := Set.pi Set.univ fun _ : Fin d ↦ Set.Icc r (L - r)) hmeas) rw [hpre, volume_pi, Measure.pi_pi] simp [Real.volume_Icc, sub_eq_add_neg, add_left_comm, add_comm, two_mul] lemma inset_cell_subset_axis_cell {L r : ℝ} (hr : 0 < r) : insetAxisAlignedCell (d := d) L r ⊆ axisAlignedCell (d := d) L := by intro x hx i have hxi := hx i exact ⟨(le_of_lt hr).trans hxi.1, hxi.2.trans_lt (sub_lt_self L hr)⟩ end PeriodicConstant section PeriodicConstantApprox open scoped Pointwise open MeasureTheory Metric namespace PeriodicConstantApprox variable {d : ℕ} lemma translated_axis_cells_cover_uniquely (L : ℝ) (hL : 0 < L) (v : axisCellLattice (d := d) L hL) : ∀ x, ∃! g : axisCellLattice (d := d) L hL, g +ᵥ x ∈ v +ᵥ axisAlignedCell (d := d) L := by intro x have hvadd (a : axisCellLattice (d := d) L hL) : a +ᵥ x ∈ v +ᵥ axisAlignedCell (d := d) L ↔ (a - v) +ᵥ x ∈ axisAlignedCell (d := d) L := by simp [Set.mem_vadd_set_iff_neg_vadd_mem, Submodule.vadd_def, vadd_eq_add, sub_eq_add_neg, add_assoc, add_comm] obtain ⟨g, hg, hguniq⟩ := PeriodicConstant.axis_cell_translates_cover_uniquely (d := d) L hL x refine ⟨g + v, (hvadd (a := g + v)).2 (by simpa using! hg), ?_⟩ intro a ha have ha' : (a - v) +ᵥ x ∈ axisAlignedCell (d := d) L := (hvadd a).1 ha have : a - v = g := hguniq _ ha' exact (sub_eq_iff_eq_add).1 this lemma ball_subset_translated_cell_of_interior {L r : ℝ} (hL : 0 < L) {v : axisCellLattice (d := d) L hL} {x : EuclideanSpace ℝ (Fin d)} (hx : x ∈ v +ᵥ insetAxisAlignedCell (d := d) L r) : ball x r ⊆ v +ᵥ axisAlignedCell (d := d) L := by have hx' : (- (v : EuclideanSpace ℝ (Fin d))) +ᵥ x ∈ insetAxisAlignedCell (d := d) L r := by simpa [Set.mem_vadd_set_iff_neg_vadd_mem] using! hx have hball : ball ((- (v : EuclideanSpace ℝ (Fin d))) +ᵥ x) r ⊆ axisAlignedCell (d := d) L := metric_ball_subset_inset_axis_cell (d := d) (L := L) (r := r) hx' have h := translated_ball_subset_translated_region (d := d) (Λ := axisCellLattice (d := d) L hL) (D := axisAlignedCell (d := d) L) (g := v) (x := (- (v : EuclideanSpace ℝ (Fin d))) +ᵥ x) (r := r) hball simpa [add_vadd, Submodule.vadd_def, vadd_eq_add, add_assoc, add_comm] using! h lemma axis_cell_subset_enclosing_ball (L : ℝ) (hL : 0 < L) : ∃ C : ℝ, axisAlignedCell (d := d) L ⊆ ball (0 : EuclideanSpace ℝ (Fin d)) C := by simpa using! (PeriodicConstant.axis_cell_is_bounded (d := d) L hL).subset_ball 0 lemma lattice_points_in_ball_finite (L : ℝ) (hL : 0 < L) (R : ℝ) : Set.Finite {g : axisCellLattice (d := d) L hL | (g : EuclideanSpace ℝ (Fin d)) ∈ ball 0 R} := by letI : DiscreteTopology (axisCellLattice (d := d) L hL) := by unfold axisCellLattice infer_instance have hdiscrete := (inferInstance : DiscreteTopology (axisCellLattice (d := d) L hL)) rw [discreteTopology_iff_isOpen_singleton_zero, Metric.isOpen_singleton_iff] at hdiscrete obtain ⟨ε, hε, hεzero⟩ := hdiscrete have hzero : ∀ g : axisCellLattice (d := d) L hL, ‖g‖ < ε → g = 0 := by intro g hg apply hεzero g simpa [dist_zero_right] using hg let P : SpherePacking d := { centers := (axisCellLattice (d := d) L hL : Set (EuclideanSpace ℝ (Fin d))) separation := ε separation_pos := hε centers_dist := by intro x y hxy by_contra hdist have hdist' : dist (x : EuclideanSpace ℝ (Fin d)) y < ε := by change ¬ ε ≤ dist (x : EuclideanSpace ℝ (Fin d)) y at hdist exact lt_of_not_ge hdist let g : axisCellLattice (d := d) L hL := ⟨(x : EuclideanSpace ℝ (Fin d)) - y, sub_mem x.property y.property⟩ have hg : ‖g‖ < ε := by simpa [g, dist_eq_norm] using hdist' have hgeq : g = 0 := hzero g hg apply hxy apply Subtype.ext exact sub_eq_zero.mp (congrArg (fun z : axisCellLattice (d := d) L hL => (z : EuclideanSpace ℝ (Fin d))) hgeq) } have hfinite : Set.Finite (P.centers ∩ ball (0 : EuclideanSpace ℝ (Fin d)) R) := (Set.finite_coe_iff).1 (P.finite_centers_inside_ball R) refine (hfinite.preimage (f := fun g : axisCellLattice (d := d) L hL => (g : EuclideanSpace ℝ (Fin d))) Subtype.val_injective.injOn).subset ?_ intro g hg exact ⟨g.property, hg⟩ end PeriodicConstantApprox end PeriodicConstantApprox end Periodic_Constant_Eq_Constant end section open scoped ENNReal open SpherePacking EuclideanSpace MeasureTheory Metric ZSpan Bornology Module open scoped Pointwise Topology variable {d : ℕ} namespace PeriodicConstantApprox section CoordCubeCover open Metric variable (L : ℝ) (hL : 0 < L) noncomputable def axisCellCoverIndex (x : EuclideanSpace ℝ (Fin d)) : axisCellLattice (d := d) L hL := Classical.choose (PeriodicConstant.axis_cell_translates_cover_uniquely (d := d) L hL x) lemma axis_cell_cover_index_mem (x : EuclideanSpace ℝ (Fin d)) : axisCellCoverIndex (d := d) L hL x +ᵥ x ∈ axisAlignedCell (d := d) L := (Classical.choose_spec (PeriodicConstant.axis_cell_translates_cover_uniquely (d := d) L hL x)).1 lemma axis_cell_cover_index_unique (x : EuclideanSpace ℝ (Fin d)) (g : axisCellLattice (d := d) L hL) (hg : g +ᵥ x ∈ axisAlignedCell (d := d) L) : g = axisCellCoverIndex (d := d) L hL x := (Classical.choose_spec (PeriodicConstant.axis_cell_translates_cover_uniquely (d := d) L hL x)).2 g hg lemma mem_negated_cover_index_cell (x : EuclideanSpace ℝ (Fin d)) : x ∈ (-axisCellCoverIndex (d := d) L hL x) +ᵥ axisAlignedCell (d := d) L := by simpa [Set.mem_vadd_set_iff_neg_vadd_mem] using! axis_cell_cover_index_mem (d := d) L hL x lemma negated_cover_index_mem_enlarged_ball {C R : ℝ} (hC : axisAlignedCell (d := d) L ⊆ ball (0 : EuclideanSpace ℝ (Fin d)) C) {x : EuclideanSpace ℝ (Fin d)} (hx : x ∈ ball 0 R) : ((-axisCellCoverIndex (d := d) L hL x : axisCellLattice (d := d) L hL) : EuclideanSpace ℝ (Fin d)) ∈ ball 0 (R + C) := by have hx0 : ‖x‖ < R := by simpa [mem_ball_zero_iff] using! hx have hxgC : ‖(axisCellCoverIndex (d := d) L hL x : EuclideanSpace ℝ (Fin d)) + x‖ < C := by have hmem : (axisCellCoverIndex (d := d) L hL x : EuclideanSpace ℝ (Fin d)) + x ∈ axisAlignedCell (d := d) L := by simpa [Submodule.vadd_def, vadd_eq_add] using! axis_cell_cover_index_mem (d := d) L hL x simpa [mem_ball_zero_iff] using! (hC hmem) have htri : ‖(axisCellCoverIndex (d := d) L hL x : EuclideanSpace ℝ (Fin d))‖ ≤ ‖(axisCellCoverIndex (d := d) L hL x : EuclideanSpace ℝ (Fin d)) + x‖ + ‖x‖ := by simpa [sub_eq_add_neg, add_comm, add_left_comm, add_assoc] using! (norm_sub_le (a := (axisCellCoverIndex (d := d) L hL x : EuclideanSpace ℝ (Fin d)) + x) (b := x)) have : ‖(- (axisCellCoverIndex (d := d) L hL x : EuclideanSpace ℝ (Fin d)))‖ < R + C := by have : ‖(axisCellCoverIndex (d := d) L hL x : EuclideanSpace ℝ (Fin d))‖ < C + R := by refine lt_of_le_of_lt htri ?_ simpa [add_comm, add_left_comm, add_assoc] using! add_lt_add hxgC hx0 simpa [norm_neg, add_comm, add_left_comm, add_assoc] using! this simpa [mem_ball_zero_iff] using! this lemma mem_translated_cell_iff_cover_index (g : axisCellLattice (d := d) L hL) (x : EuclideanSpace ℝ (Fin d)) : x ∈ g +ᵥ axisAlignedCell (d := d) L ↔ g = -axisCellCoverIndex (d := d) L hL x := by constructor · intro hx have : (-g : axisCellLattice (d := d) L hL) = axisCellCoverIndex (d := d) L hL x := axis_cell_cover_index_unique (d := d) L hL x (-g) (by simpa [Set.mem_vadd_set_iff_neg_vadd_mem] using! hx) simpa using! congrArg (fun t : axisCellLattice (d := d) L hL => -t) this · rintro rfl; exact mem_negated_cover_index_cell (d := d) L hL x end CoordCubeCover section CoverVolumeBound open scoped BigOperators lemma translated_axis_cell_subset_ball {L : ℝ} (hL : 0 < L) {R C : ℝ} (hC : axisAlignedCell (d := d) L ⊆ ball (0 : EuclideanSpace ℝ (Fin d)) C) {g : axisCellLattice (d := d) L hL} (hg : (g : EuclideanSpace ℝ (Fin d)) ∈ ball 0 (R + C)) : g +ᵥ axisAlignedCell (d := d) L ⊆ ball (0 : EuclideanSpace ℝ (Fin d)) (R + (2 * C)) := by intro y hy rcases hy with ⟨x, hx, rfl⟩ have hx' : ‖x‖ < C := by simpa [mem_ball_zero_iff] using! hC hx have hg' : ‖(g : EuclideanSpace ℝ (Fin d))‖ < R + C := by simpa [mem_ball_zero_iff] using! hg have : ‖(g : EuclideanSpace ℝ (Fin d)) + x‖ < R + (2 * C) := by refine (lt_of_le_of_lt (norm_add_le _ _) ?_) simpa [two_mul, add_assoc, add_left_comm, add_comm] using! add_lt_add hg' hx' simpa [Submodule.vadd_def, vadd_eq_add, mem_ball_zero_iff] using! this lemma finite_cell_union_subset_enclosing_ball {L : ℝ} (hL : 0 < L) {R C : ℝ} (hC : axisAlignedCell (d := d) L ⊆ ball (0 : EuclideanSpace ℝ (Fin d)) C) : let htSet := PeriodicConstantApprox.lattice_points_in_ball_finite (d := d) L hL (R + C) let t : Finset (axisCellLattice (d := d) L hL) := htSet.toFinset (⋃ g ∈ t, g +ᵥ axisAlignedCell (d := d) L) ⊆ ball (0 : EuclideanSpace ℝ (Fin d)) (R + (2 * C)) := by intro htSet t y hy rcases Set.mem_iUnion₂.1 hy with ⟨g, hgT, hy'⟩ have hgBall : (g : EuclideanSpace ℝ (Fin d)) ∈ ball (0 : EuclideanSpace ℝ (Fin d)) (R + C) := htSet.mem_toFinset.1 (by simpa [t] using! hgT) exact (translated_axis_cell_subset_ball (d := d) (hL := hL) (R := R) (C := C) hC hgBall) hy' lemma lattice_count_mul_cell_volume_le_ball_volume {L : ℝ} (hL : 0 < L) {R C : ℝ} (hC : axisAlignedCell (d := d) L ⊆ ball (0 : EuclideanSpace ℝ (Fin d)) C) : let htSet := PeriodicConstantApprox.lattice_points_in_ball_finite (d := d) L hL (R + C) let t : Finset (axisCellLattice (d := d) L hL) := htSet.toFinset (t.card : ℝ≥0∞) * volume (axisAlignedCell (d := d) L) ≤ volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + (2 * C))) := by intro htSet t have hdisj : Set.PairwiseDisjoint (↑t : Set (axisCellLattice (d := d) L hL)) (fun g : axisCellLattice (d := d) L hL => g +ᵥ axisAlignedCell (d := d) L) := by intro g _ h _ hgh exact translates_disjoint_of_unique_cover (d := d) (Λ := axisCellLattice (d := d) L hL) (D := axisAlignedCell (d := d) L) (PeriodicConstant.axis_cell_translates_cover_uniquely (d := d) L hL) hgh have hmeas : ∀ g ∈ t, MeasurableSet (g +ᵥ axisAlignedCell (d := d) L) := by intro g _; simpa using! (MeasurableSet.const_vadd (PeriodicConstant.axis_cell_is_measurable (d := d) L hL) g) have hvol_union : volume (⋃ g ∈ t, g +ᵥ axisAlignedCell (d := d) L) = ∑ g ∈ t, volume (g +ᵥ axisAlignedCell (d := d) L) := measure_biUnion_finset (μ := volume) hdisj hmeas have hsub : (⋃ g ∈ t, g +ᵥ axisAlignedCell (d := d) L) ⊆ ball (0 : EuclideanSpace ℝ (Fin d)) (R + (2 * C)) := finite_cell_union_subset_enclosing_ball (d := d) (hL := hL) (R := R) (C := C) hC have hle := volume.mono hsub simp_all end CoverVolumeBound section BoundaryControl open scoped ENNReal Pointwise BigOperators def constantCoordinateVector (c : ℝ) : EuclideanSpace ℝ (Fin d) := WithLp.toLp 2 (fun _ : Fin d => c) lemma coordinate_abs_lt_of_norm_bound {x : EuclideanSpace ℝ (Fin d)} {r : ℝ} (hx : ‖x‖ < r) (i : Fin d) : |x i| < r := lt_of_le_of_lt (coordinate_abs_bounded_by_norm (d := d) x i) hx lemma boundary_half_ball_subset_outer_annulus (L : ℝ) : ((axisAlignedCell (d := d) L \ insetAxisAlignedCell (d := d) L (1 / 2)) + ball (0 : EuclideanSpace ℝ (Fin d)) (1 / 2)) ⊆ ((constantCoordinateVector (d := d) (- (1 / 2 : ℝ))) +ᵥ insetAxisAlignedCell (d := d) (L + 1) 0) \ insetAxisAlignedCell (d := d) L 1 := by intro x hx rcases hx with ⟨a, ⟨ha, ha_boundary⟩, b, hb, rfl⟩ have hb_norm : ‖b‖ < (1 / 2 : ℝ) := by simpa [mem_ball_zero_iff] using hb constructor · refine Set.mem_vadd_set.2 ⟨a + b - constantCoordinateVector (d := d) (-(1 / 2 : ℝ)), ?_, ?_⟩ · intro i rcases ha i with ⟨ha_nonneg, ha_lt⟩ have hbi := coordinate_abs_lt_of_norm_bound (d := d) hb_norm i rcases abs_lt.mp hbi with ⟨hb_lower, hb_upper⟩ change 0 ≤ (a + b - constantCoordinateVector (d := d) (-(1 / 2 : ℝ))) i ∧ (a + b - constantCoordinateVector (d := d) (-(1 / 2 : ℝ))) i ≤ L + 1 - 0 simp only [PiLp.sub_apply, PiLp.add_apply, constantCoordinateVector] constructor <;> linarith · simp [vadd_eq_add] · intro h_inset apply ha_boundary intro i have hxi := h_inset i have hbi := coordinate_abs_lt_of_norm_bound (d := d) hb_norm i rcases abs_lt.mp hbi with ⟨hb_lower, hb_upper⟩ change (1 / 2 : ℝ) ≤ a i ∧ a i ≤ L - 1 / 2 change 1 ≤ (a + b) i ∧ (a + b) i ≤ L - 1 at hxi simp only [PiLp.add_apply] at hxi rcases hxi with ⟨hx_lower, hx_upper⟩ constructor <;> linarith variable (S : SpherePacking d) lemma boundary_count_mul_ball_volume_le_annulus {L : ℝ} (hL : 0 < L) (hSsep : S.separation = 1) {g : axisCellLattice (d := d) L hL} {s : Finset (EuclideanSpace ℝ (Fin d))} (hs_centers : ∀ x ∈ s, x ∈ S.centers) (hs_boundary : ∀ x ∈ s, x ∈ (g +ᵥ axisAlignedCell (d := d) L) \ (g +ᵥ insetAxisAlignedCell (d := d) L (1 / 2))) : (s.card : ℝ≥0∞) * volume (ball (0 : EuclideanSpace ℝ (Fin d)) (2⁻¹ : ℝ)) ≤ volume (((constantCoordinateVector (d := d) (- (1 / 2 : ℝ))) +ᵥ insetAxisAlignedCell (d := d) (L + 1) 0) \ insetAxisAlignedCell (d := d) L 1) := by classical let v : EuclideanSpace ℝ (Fin d) := g have hdisj : Set.PairwiseDisjoint (↑s : Set (EuclideanSpace ℝ (Fin d))) (fun x : EuclideanSpace ℝ (Fin d) => ball (x - v) (1 / 2 : ℝ)) := by intro x hx y hy hxy apply ball_disjoint_ball have hdist := S.distinct_centers_separation_bound x y (hs_centers x hx) (hs_centers y hy) hxy rw [hSsep] at hdist convert hdist using 1 <;> norm_num [dist_eq_norm, sub_sub_sub_cancel_right] have hmeas : ∀ x ∈ s, MeasurableSet (ball (x - v) (1 / 2 : ℝ)) := by intro x hx exact measurableSet_ball have hvol_union : volume (⋃ x ∈ s, ball (x - v) (1 / 2 : ℝ)) = ∑ x ∈ s, volume (ball (x - v) (1 / 2 : ℝ)) := measure_biUnion_finset (μ := volume) hdisj hmeas have hsub : (⋃ x ∈ s, ball (x - v) (1 / 2 : ℝ)) ⊆ ((constantCoordinateVector (d := d) (-(1 / 2 : ℝ))) +ᵥ insetAxisAlignedCell (d := d) (L + 1) 0) \ insetAxisAlignedCell (d := d) L 1 := by intro y hy rcases Set.mem_iUnion₂.mp hy with ⟨x, hx, hy⟩ apply boundary_half_ball_subset_outer_annulus (d := d) L refine Set.mem_add.mpr ⟨x - v, ?_, y - (x - v), ?_, ?_⟩ · have hboundary := hs_boundary x hx constructor · have hcell := hboundary.1 simpa [v, Set.mem_vadd_set_iff_neg_vadd_mem, Submodule.vadd_def, vadd_eq_add, sub_eq_add_neg, add_comm] using hcell · intro hinset apply hboundary.2 simpa [v, Set.mem_vadd_set_iff_neg_vadd_mem, Submodule.vadd_def, vadd_eq_add, sub_eq_add_neg, add_comm] using hinset · simpa [mem_ball, dist_eq_norm] using hy · abel calc (s.card : ℝ≥0∞) * volume (ball (0 : EuclideanSpace ℝ (Fin d)) (2⁻¹ : ℝ)) = volume (⋃ x ∈ s, ball (x - v) (1 / 2 : ℝ)) := by rw [hvol_union] simp [Measure.addHaar_ball_center] _ ≤ volume (((constantCoordinateVector (d := d) (-(1 / 2 : ℝ))) +ᵥ insetAxisAlignedCell (d := d) (L + 1) 0) \ insetAxisAlignedCell (d := d) L 1) := volume.mono hsub end BoundaryControl end PeriodicConstantApprox namespace SpherePacking open Filter variable {d : ℕ} lemma frequently_local_density_exceeds_threshold (S : SpherePacking d) {b : ℝ≥0∞} (hb : b < S.upperPackingDensity) : ∃ᶠ R in (atTop : Filter ℝ), b < S.densityInsideRadius R := by exact frequently_lt_of_lt_limsup (u := S.densityInsideRadius) (b := b) (h := by simpa [SpherePacking.upperPackingDensity] using! hb) lemma finite_center_ball_intersection_set (S : SpherePacking d) (R : ℝ) : (S.centers ∩ ball (0 : EuclideanSpace ℝ (Fin d)) R).Finite := by simpa [Set.finite_coe_iff] using! (SpherePacking.finite_centers_inside_ball (S := S) (R := R)) end SpherePacking namespace PeriodicConstantApprox open Filter variable {d : ℕ} def uniformShellShift (d : ℕ) (c : ℝ) : EuclideanSpace ℝ (Fin d) := WithLp.toLp 2 (fun _ : Fin d => c) lemma unit_inset_cell_subset_shifted_shell (L : ℝ) : insetAxisAlignedCell (d := d) L 1 ⊆ (uniformShellShift d (- (1 / 2 : ℝ))) +ᵥ insetAxisAlignedCell (d := d) (L + 1) 0 := by intro x hx refine (Set.mem_vadd_set_iff_neg_vadd_mem).2 ?_ have hx' : ∀ i : Fin d, x.ofLp i ∈ Set.Icc (1 : ℝ) (L - 1) := by simpa [insetAxisAlignedCell, Set.mem_setOf_eq] using! hx simp only [insetAxisAlignedCell, Set.mem_setOf_eq, uniformShellShift, vadd_eq_add, one_div, WithLp.ofLp_add, WithLp.ofLp_neg, Pi.add_apply, Pi.neg_apply, neg_neg] exact fun i => by let hxi := hx' i refine ⟨by linarith [hxi.1], by linarith [hxi.2]⟩ lemma axis_shell_volume_difference (L : ℝ) : volume (((uniformShellShift d (- (1 / 2 : ℝ))) +ᵥ insetAxisAlignedCell (d := d) (L + 1) 0) \ insetAxisAlignedCell (d := d) L 1) = volume (insetAxisAlignedCell (d := d) (L + 1) 0) - volume (insetAxisAlignedCell (d := d) L 1) := by have hsub : insetAxisAlignedCell (d := d) L 1 ⊆ (uniformShellShift d (- (1 / 2 : ℝ))) +ᵥ insetAxisAlignedCell (d := d) (L + 1) 0 := unit_inset_cell_subset_shifted_shell (d := d) L have hmeas_inner : MeasurableSet (insetAxisAlignedCell (d := d) L 1) := by have hmeasPi : MeasurableSet (Set.pi Set.univ fun _ : Fin d ↦ Set.Icc (1 : ℝ) (L - 1)) := by refine MeasurableSet.pi Set.countable_univ ?_ intro _ _ exact measurableSet_Icc have hmp : MeasurePreserving (fun x : EuclideanSpace ℝ (Fin d) ↦ x.ofLp) := by simpa using! (PiLp.volume_preserving_ofLp (ι := Fin d)) simpa [PeriodicConstant.inset_cell_eq_coordinate_preimage (d := d) (L := L) (r := (1 : ℝ))] using! hmeasPi.preimage hmp.measurable have hfin : volume (insetAxisAlignedCell (d := d) L 1) ≠ ∞ := by simp [PeriodicConstant.inset_axis_cell_volume_formula] simpa [measure_vadd, uniformShellShift] using! (measure_sdiff (μ := volume) hsub hmeas_inner.nullMeasurableSet hfin) lemma axis_shell_volume_power_formula (L : ℝ) : volume (((uniformShellShift d (- (1 / 2 : ℝ))) +ᵥ insetAxisAlignedCell (d := d) (L + 1) 0) \ insetAxisAlignedCell (d := d) L 1) = (ENNReal.ofReal (L + 1)) ^ d - (ENNReal.ofReal (L - 2)) ^ d := by rw [axis_shell_volume_difference (d := d) (L := L)] simp [PeriodicConstant.inset_axis_cell_volume_formula] section BoundaryControlShellVec open scoped ENNReal Pointwise BigOperators open SpherePacking EuclideanSpace MeasureTheory Metric variable {d : ℕ} variable (S : SpherePacking d) lemma boundary_count_mul_ball_volume_le_shell {L : ℝ} (hL : 0 < L) (hSsep : S.separation = 1) {g : axisCellLattice (d := d) L hL} {s : Finset (EuclideanSpace ℝ (Fin d))} (hs_centers : ∀ x ∈ s, x ∈ S.centers) (hs_boundary : ∀ x ∈ s, x ∈ (g +ᵥ axisAlignedCell (d := d) L) \ (g +ᵥ insetAxisAlignedCell (d := d) L (1 / 2))) : (s.card : ℝ≥0∞) * volume (ball (0 : EuclideanSpace ℝ (Fin d)) (2⁻¹ : ℝ)) ≤ volume (((uniformShellShift d (- (1 / 2 : ℝ))) +ᵥ insetAxisAlignedCell (d := d) (L + 1) 0) \ insetAxisAlignedCell (d := d) L 1) := by simpa [uniformShellShift, constantCoordinateVector] using! (boundary_count_mul_ball_volume_le_annulus (S := S) hL hSsep hs_centers hs_boundary) end BoundaryControlShellVec section CubeLatticeCovolume open scoped ENNReal open ZSpan lemma axis_lattice_covolume_eq_cell_volume (L : ℝ) (hL : 0 < L) : ZLattice.covolume (axisCellLattice (d := d) L hL) volume = (volume (axisAlignedCell (d := d) L)).toReal := by letI : DiscreteTopology (axisCellLattice (d := d) L hL) := ZSpan.instDiscreteTopologySubtypeMemSubmoduleIntSpanRangeCoeBasisRealOfFinite (axisCellBasis (d := d) L hL) letI : IsZLattice ℝ (axisCellLattice (d := d) L hL) := instIsZLatticeRealSpan (axisCellBasis (d := d) L hL) have hfund : IsAddFundamentalDomain (axisCellLattice (d := d) L hL) (fundamentalDomain (axisCellBasis (d := d) L hL)) volume := by simpa [axisCellLattice] using! (ZSpan.isAddFundamentalDomain (axisCellBasis (d := d) L hL) volume) simpa [Measure.real, axis_cell_basis_fundamental_region (d := d) (L := L) (hL := hL)] using! (ZLattice.covolume_eq_measure_fundamentalDomain (L := axisCellLattice (d := d) L hL) (μ := volume) hfund) lemma axis_lattice_covolume_toNNReal (L : ℝ) (hL : 0 < L) : Real.toNNReal (ZLattice.covolume (axisCellLattice (d := d) L hL) volume) = (volume (axisAlignedCell (d := d) L)).toNNReal := by simp [axis_lattice_covolume_eq_cell_volume (d := d) (L := L) hL] end CubeLatticeCovolume section PeriodizeCubeDensity open scoped ENNReal Pointwise open SpherePacking EuclideanSpace MeasureTheory Metric Bornology variable {d : ℕ} lemma replicated_cell_packing_density_formula (hd : 0 < d) (S : SpherePacking d) (hSsep : S.separation = 1) {L : ℝ} (hL : 0 < L) {g : axisCellLattice (d := d) L hL} (F : Finset (EuclideanSpace ℝ (Fin d))) (hF_centers : ∀ x ∈ F, x ∈ S.centers) (hF_inner : ∀ x ∈ F, x ∈ g +ᵥ insetAxisAlignedCell (d := d) L (2⁻¹ : ℝ)) : ∃ P : PeriodicSpherePacking d, P.separation = 1 ∧ P.upperPackingDensity = (F.card : ℝ≥0∞) * volume (ball (0 : EuclideanSpace ℝ (Fin d)) (2⁻¹ : ℝ)) / Real.toNNReal (ZLattice.covolume (axisCellLattice (d := d) L hL) volume) := by let Λ : Submodule ℤ (EuclideanSpace ℝ (Fin d)) := axisCellLattice (d := d) L hL let D : Set (EuclideanSpace ℝ (Fin d)) := g +ᵥ axisAlignedCell (d := d) L let Fset : Set (EuclideanSpace ℝ (Fin d)) := (F : Set (EuclideanSpace ℝ (Fin d))) letI : DiscreteTopology Λ := ZSpan.instDiscreteTopologySubtypeMemSubmoduleIntSpanRangeCoeBasisRealOfFinite (axisCellBasis (d := d) L hL) letI : IsZLattice ℝ Λ := instIsZLatticeRealSpan (axisCellBasis (d := d) L hL) let P : PeriodicSpherePacking d := replicate_to_periodic_packing (d := d) S (Λ := Λ) D Fset (hD_unique_covers := PeriodicConstantApprox.translated_axis_cells_cover_uniquely (d := d) L hL g) (hF_centers := by assumption) (hF_ball := by intro x hx have hx' : x ∈ F := by simpa [Fset] using! hx have hxInner : x ∈ g +ᵥ insetAxisAlignedCell (d := d) L (S.separation / 2) := by simpa [hSsep] using! (hF_inner x hx') exact ball_subset_translated_cell_of_interior hL hxInner) have hPsep : P.separation = 1 := by simpa [P, hSsep] refine ⟨P, hPsep, ?_⟩ have hD_bounded : IsBounded D := by simpa [D, Submodule.vadd_def, vadd_eq_add] using! (PeriodicConstant.axis_cell_is_bounded (d := d) L hL).vadd (g : EuclideanSpace ℝ (Fin d)) have hD_unique : ∀ x, ∃! g0 : (axisCellLattice (d := d) L hL), g0 +ᵥ x ∈ D := PeriodicConstantApprox.translated_axis_cells_cover_uniquely (d := d) L hL g have hF_sub : Fset ⊆ D := by intro x hx have hx' : x ∈ F := by simpa [Fset] using! hx rcases (hF_inner x hx') with ⟨a, ha, rfl⟩ have ha' : a ∈ axisAlignedCell (d := d) L := PeriodicConstant.inset_cell_subset_axis_cell (d := d) (L := L) (r := (2⁻¹ : ℝ)) (by norm_num) ha exact ⟨a, ha', rfl⟩ have hcenters_inter : P.centers ∩ D = Fset := by simpa [P, replicate_to_periodic_packing, Fset] using! (replicated_centers_intersection_of_subset (d := d) (Λ := axisCellLattice (d := d) L hL) (D := D) (F := Fset) hF_sub hD_unique) have hnumReps : P.centerOrbitCardinality = F.card := by have h' : (P.centerOrbitCardinality : ENat) = (F.card : ENat) := by simpa [hcenters_inter, Fset, Set.encard_coe_eq_coe_finsetCard] using! (P.encard_centers_in_fundamental_region (d := d) (D := D) hD_bounded hD_unique hd).symm exact_mod_cast h' simpa [hnumReps, hPsep] using! P.density_eq_numReps_mul_volume_ball_div_covolume (d := d) hd end PeriodizeCubeDensity lemma axis_shell_volume_ratio_tends_zero : Tendsto (fun L : ℝ => ((L + 1) ^ d - (L - 2) ^ d) / (L ^ d)) atTop (𝓝 (0 : ℝ)) := by have hinv : Tendsto (fun L : ℝ => L⁻¹) atTop (𝓝 0) := tendsto_inv_atTop_zero have hplus : Tendsto (fun L : ℝ => 1 + L⁻¹) atTop (𝓝 (1 : ℝ)) := by simpa using (tendsto_const_nhds.add hinv) have hminus : Tendsto (fun L : ℝ => 1 - 2 * L⁻¹) atTop (𝓝 (1 : ℝ)) := by simpa using (tendsto_const_nhds.sub (tendsto_const_nhds.mul hinv)) have hlimit : Tendsto (fun L : ℝ => (1 + L⁻¹) ^ d - (1 - 2 * L⁻¹) ^ d) atTop (𝓝 (0 : ℝ)) := by simpa using (hplus.pow d).sub (hminus.pow d) apply hlimit.congr' filter_upwards [eventually_gt_atTop (0 : ℝ)] with L hL have hplus_eq : 1 + L⁻¹ = (L + 1) / L := by field_simp [hL.ne'] have hminus_eq : 1 - 2 * L⁻¹ = (L - 2) / L := by field_simp [hL.ne'] rw [hplus_eq, hminus_eq, div_pow, div_pow, ← sub_div] lemma axis_shell_relative_cell_volume_tends_zero : Tendsto (fun L : ℝ => volume (((uniformShellShift d (- (1 / 2 : ℝ))) +ᵥ insetAxisAlignedCell (d := d) (L + 1) 0) \ insetAxisAlignedCell (d := d) L 1) / volume (axisAlignedCell (d := d) L)) atTop (𝓝 (0 : ℝ≥0∞)) := by have hlimit : Tendsto (fun L : ℝ => ENNReal.ofReal (((L + 1) ^ d - (L - 2) ^ d) / (L ^ d))) atTop (𝓝 (0 : ℝ≥0∞)) := by simpa only [Function.comp_def, ENNReal.ofReal_zero] using ENNReal.continuous_ofReal.continuousAt.tendsto.comp (axis_shell_volume_ratio_tends_zero (d := d)) refine hlimit.congr' ?_ filter_upwards [eventually_gt_atTop (2 : ℝ)] with L hL have hL0 : 0 < L := by linarith have hLplus : 0 ≤ L + 1 := by linarith have hLminus : 0 ≤ L - 2 := by linarith rw [axis_shell_volume_power_formula, PeriodicConstant.axis_cell_volume_formula, ← ENNReal.ofReal_pow hLplus d, ← ENNReal.ofReal_pow hLminus d, ← ENNReal.ofReal_pow hL0.le d, ← ENNReal.ofReal_sub, ← ENNReal.ofReal_div_of_pos (pow_pos hL0 d)] exact pow_nonneg hLminus d end PeriodicConstantApprox namespace SpherePacking open Filter open scoped ENNReal BigOperators variable {d : ℕ} lemma cancel_common_denominator_in_product_ratio {a b c : ℝ≥0∞} (hb0 : b ≠ 0) (hb : b ≠ ∞) : ((a * b) / c) / b = a / c := by calc ((a * b) / c) / b = (a * b) * c⁻¹ * b⁻¹ := by simp [div_eq_mul_inv, mul_assoc] _ = a * c⁻¹ * (b * b⁻¹) := by ac_rfl _ = a / c := by simp [div_eq_mul_inv, ENNReal.mul_inv_cancel hb0 hb] theorem exists_periodic_unit_packing_above_density_threshold (hd : 0 < d) (S : SpherePacking d) (hSsep : S.separation = 1) {b : ℝ≥0∞} (hb : b < S.upperPackingDensity) : ∃ P : PeriodicSpherePacking d, P.separation = 1 ∧ b < P.upperPackingDensity := by classical by_contra hnone push Not at hnone obtain ⟨c, hbc, hc⟩ := exists_between hb let cell : ℝ → ℝ≥0∞ := fun L => volume (axisAlignedCell (d := d) L) let shell : ℝ → ℝ≥0∞ := fun L => volume (((PeriodicConstantApprox.uniformShellShift d (-(1 / 2 : ℝ))) +ᵥ insetAxisAlignedCell (d := d) (L + 1) 0) \ insetAxisAlignedCell (d := d) L 1) have hshell : Tendsto (fun L : ℝ => shell L / cell L) atTop (𝓝 0) := by simpa [shell, cell] using (PeriodicConstantApprox.axis_shell_relative_cell_volume_tends_zero (d := d)) have hsmall : ∀ᶠ L : ℝ in atTop, b + shell L / cell L < c := by have hlim : Tendsto (fun L : ℝ => b + shell L / cell L) atTop (𝓝 b) := by simpa using tendsto_const_nhds.add hshell exact hlim.eventually (Iio_mem_nhds hbc) obtain ⟨L, hL, hsmallL⟩ := ((eventually_gt_atTop (0 : ℝ)).and hsmall).exists have hcell_top : cell L ≠ ∞ := by simp [cell, PeriodicConstant.axis_cell_volume_formula] have hcell_zero : cell L ≠ 0 := by simp [cell, PeriodicConstant.axis_cell_volume_formula, hL] have hden : (↑(Real.toNNReal (ZLattice.covolume (axisCellLattice (d := d) L hL) volume)) : ℝ≥0∞) = cell L := by rw [PeriodicConstantApprox.axis_lattice_covolume_toNNReal (d := d) L hL] exact ENNReal.coe_toNNReal hcell_top obtain ⟨C, hC⟩ := PeriodicConstantApprox.axis_cell_subset_enclosing_ball (d := d) L hL let A : ℝ≥0∞ := b + shell L / cell L have hAc : A < c := hsmallL have hratio : Tendsto (fun R : ℝ => A * (volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + (1 / 2 + 2 * C))) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + 0)))) atTop (𝓝 A) := by simpa using (ENNReal.Tendsto.const_mul (volume_ball_add_div_volume_ball_add_tendsto_one (d := d) (C := 1 / 2 + 2 * C) (C' := 0) hd) (Or.inl one_ne_zero)) have hratio_small : ∀ᶠ R : ℝ in atTop, A * (volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + (1 / 2 + 2 * C))) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + 0))) < c := hratio.eventually (Iio_mem_nhds hAc) obtain ⟨R, hR_density, hR_ratio⟩ := ((S.frequently_local_density_exceeds_threshold hc).and_eventually hratio_small).exists let huSet := S.finite_center_ball_intersection_set (R + (1 / 2 : ℝ)) let u : Finset (EuclideanSpace ℝ (Fin d)) := huSet.toFinset let htSet := PeriodicConstantApprox.lattice_points_in_ball_finite (d := d) L hL (R + (1 / 2 : ℝ) + C) let t : Finset (axisCellLattice (d := d) L hL) := htSet.toFinset let index (x : EuclideanSpace ℝ (Fin d)) : axisCellLattice (d := d) L hL := -PeriodicConstantApprox.axisCellCoverIndex (d := d) L hL x have hindex : ∀ x ∈ u, index x ∈ t := by intro x hx have hxball : x ∈ ball (0 : EuclideanSpace ℝ (Fin d)) (R + (1 / 2 : ℝ)) := (huSet.mem_toFinset.mp (by simpa [u] using hx)).2 apply htSet.mem_toFinset.mpr simpa [index, t] using (PeriodicConstantApprox.negated_cover_index_mem_enlarged_ball (d := d) L hL (C := C) (R := R + (1 / 2 : ℝ)) hC hxball) let piece (g : axisCellLattice (d := d) L hL) : Finset (EuclideanSpace ℝ (Fin d)) := u.filter fun x => index x = g let inner (g : axisCellLattice (d := d) L hL) : Finset (EuclideanSpace ℝ (Fin d)) := (piece g).filter fun x => x ∈ g +ᵥ insetAxisAlignedCell (d := d) L (2⁻¹ : ℝ) let boundary (g : axisCellLattice (d := d) L hL) : Finset (EuclideanSpace ℝ (Fin d)) := (piece g).filter fun x => x ∉ g +ᵥ insetAxisAlignedCell (d := d) L (2⁻¹ : ℝ) let V : ℝ≥0∞ := volume (ball (0 : EuclideanSpace ℝ (Fin d)) (2⁻¹ : ℝ)) have hpiece_center {g : axisCellLattice (d := d) L hL} {x : EuclideanSpace ℝ (Fin d)} (hx : x ∈ piece g) : x ∈ S.centers := by have hx' : x ∈ u.filter (fun y => index y = g) := by simpa only [piece] using hx have hxu : x ∈ u := (Finset.mem_filter.mp hx').1 exact (huSet.mem_toFinset.mp (by simpa [u] using hxu)).1 have hpiece_cell {g : axisCellLattice (d := d) L hL} {x : EuclideanSpace ℝ (Fin d)} (hx : x ∈ piece g) : x ∈ g +ᵥ axisAlignedCell (d := d) L := by have hx' : x ∈ u.filter (fun y => index y = g) := by simpa only [piece] using hx have hidx : index x = g := (Finset.mem_filter.mp hx').2 apply (PeriodicConstantApprox.mem_translated_cell_iff_cover_index (d := d) L hL g x).2 simpa [index] using hidx.symm have hinner_bound (g : axisCellLattice (d := d) L hL) : ((inner g).card : ℝ≥0∞) * V ≤ b * cell L := by obtain ⟨P, hPsep, hPdensity⟩ := PeriodicConstantApprox.replicated_cell_packing_density_formula (d := d) hd S hSsep hL (inner g) (by intro x hx exact hpiece_center (Finset.mem_filter.mp (by simpa [inner] using hx)).1) (by intro x hx exact (Finset.mem_filter.mp (by simpa [inner] using hx)).2) have hPbound : P.upperPackingDensity ≤ b := hnone P hPsep rw [hPdensity, hden] at hPbound exact (ENNReal.div_le_iff hcell_zero hcell_top).mp (by simpa [V] using hPbound) have hboundary_bound (g : axisCellLattice (d := d) L hL) : ((boundary g).card : ℝ≥0∞) * V ≤ shell L := by apply PeriodicConstantApprox.boundary_count_mul_ball_volume_le_shell (d := d) S hL hSsep · intro x hx have hx' : x ∈ (piece g).filter (fun y => y ∉ g +ᵥ insetAxisAlignedCell (d := d) L (2⁻¹ : ℝ)) := by simpa only [boundary] using hx exact hpiece_center (Finset.mem_filter.mp hx').1 · intro x hx have hx' : x ∈ (piece g).filter (fun y => y ∉ g +ᵥ insetAxisAlignedCell (d := d) L (2⁻¹ : ℝ)) := by simpa only [boundary] using hx have hx' := Finset.mem_filter.mp hx' exact ⟨hpiece_cell hx'.1, by simpa [one_div] using hx'.2⟩ have hpiece_bound (g : axisCellLattice (d := d) L hL) : ((piece g).card : ℝ≥0∞) * V ≤ A * cell L := by have hcard : (inner g).card + (boundary g).card = (piece g).card := by simpa [inner, boundary] using (Finset.card_filter_add_card_filter_not (s := piece g) (fun x : EuclideanSpace ℝ (Fin d) => x ∈ g +ᵥ insetAxisAlignedCell (d := d) L (2⁻¹ : ℝ))) have hcard' : ((piece g).card : ℝ≥0∞) = ((inner g).card : ℝ≥0∞) + (boundary g).card := by exact_mod_cast hcard.symm calc ((piece g).card : ℝ≥0∞) * V = ((inner g).card : ℝ≥0∞) * V + ((boundary g).card : ℝ≥0∞) * V := by rw [hcard', add_mul] _ ≤ b * cell L + shell L := add_le_add (hinner_bound g) (hboundary_bound g) _ = A * cell L := by simp [A, add_mul, ENNReal.div_mul_cancel hcell_zero hcell_top] have hpartition : ∑ g ∈ t, (piece g).card = u.card := by simpa [piece, Finset.filter_eq_self.mpr hindex] using (Finset.sum_card_fiberwise_eq_card_filter u t index) have hsum_bound : (u.card : ℝ≥0∞) * V ≤ (t.card : ℝ≥0∞) * (A * cell L) := by have hcast : (u.card : ℝ≥0∞) = ∑ g ∈ t, ((piece g).card : ℝ≥0∞) := by exact_mod_cast hpartition.symm calc (u.card : ℝ≥0∞) * V = (∑ g ∈ t, ((piece g).card : ℝ≥0∞)) * V := by rw [hcast] _ = ∑ g ∈ t, ((piece g).card : ℝ≥0∞) * V := by simp_rw [Finset.sum_mul] _ ≤ ∑ _g ∈ t, A * cell L := Finset.sum_le_sum fun g _ => hpiece_bound g _ = (t.card : ℝ≥0∞) * (A * cell L) := by simp [nsmul_eq_mul] have ht_volume : (t.card : ℝ≥0∞) * cell L ≤ volume (ball (0 : EuclideanSpace ℝ (Fin d)) ((R + (1 / 2 : ℝ)) + 2 * C)) := by simpa [t, htSet, cell] using (PeriodicConstantApprox.lattice_count_mul_cell_volume_le_ball_volume (d := d) (hL := hL) (R := R + (1 / 2 : ℝ)) (C := C) hC) have hcenter_bound : (u.card : ℝ≥0∞) * V ≤ A * volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + (1 / 2 + 2 * C))) := by calc (u.card : ℝ≥0∞) * V ≤ (t.card : ℝ≥0∞) * (A * cell L) := hsum_bound _ = A * ((t.card : ℝ≥0∞) * cell L) := by ac_rfl _ ≤ A * volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + (1 / 2 + 2 * C))) := by gcongr simpa [add_assoc] using ht_volume have hlocal_bound : S.densityInsideRadius R ≤ (u.card : ℝ≥0∞) * V / volume (ball (0 : EuclideanSpace ℝ (Fin d)) R) := by have h := S.local_density_upper_bound hd R simp only [hSsep, one_div] at h have henc : (S.centers ∩ ball (0 : EuclideanSpace ℝ (Fin d)) (R + (2⁻¹ : ℝ))).encard = (u.card : ENat) := by simpa [u, huSet, one_div] using huSet.encard_eq_coe_toFinset_card rw [henc] at h simpa [V] using h have hfinal : S.densityInsideRadius R ≤ A * (volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + (1 / 2 + 2 * C))) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + 0))) := by calc S.densityInsideRadius R ≤ (u.card : ℝ≥0∞) * V / volume (ball (0 : EuclideanSpace ℝ (Fin d)) R) := hlocal_bound _ ≤ (A * volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + (1 / 2 + 2 * C)))) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) R) := by gcongr _ = A * (volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + (1 / 2 + 2 * C))) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + 0))) := by simp [div_eq_mul_inv, mul_assoc] exact (not_lt_of_ge (le_of_lt (lt_of_le_of_lt hfinal hR_ratio))) hR_density end SpherePacking theorem periodic_packing_supremum_eq_unrestricted (hd : 0 < d) : PeriodicSpherePackingConstant d = SpherePackingConstant d := by rw [periodic_packing_supremum_eq_unit_separation (d := d), SpherePacking.packing_supremum_eq_unit_separation (d := d)] apply le_antisymm · refine iSup₂_le ?_ intro P hPsep refine (le_iSup (fun _ : (P.toSpherePacking).separation = 1 ↦ (P.toSpherePacking).upperPackingDensity) hPsep).trans ?_ exact le_iSup (fun S : SpherePacking d ↦ ⨆ (_ : S.separation = 1), S.upperPackingDensity) P.toSpherePacking · refine iSup₂_le ?_ intro S hSsep refine le_of_forall_lt ?_ intro a ha rcases exists_between ha with ⟨b, hab, hbS⟩ rcases SpherePacking.exists_periodic_unit_packing_above_density_threshold (d := d) hd S hSsep hbS with ⟨P, hPsep, hbP⟩ have hb_lt_sup : b < ⨆ (P : PeriodicSpherePacking d) (_ : P.separation = 1), P.upperPackingDensity := lt_of_lt_of_le hbP (le_iSup_of_le P (le_iSup_of_le hPsep le_rfl)) exact hab.trans hb_lt_sup end section open scoped BigOperators Real open MeasureTheory namespace SchwartzMap.UnitAddTorus def coordinateTorusProjection (n : ℕ) : (Fin n → ℝ) → UnitAddTorus (Fin n) := fun x i => (x i : UnitAddCircle) @[continuity] theorem continuous_coordinate_torus_projection {n : ℕ} : Continuous (coordinateTorusProjection n) := by simpa [coordinateTorusProjection, UnitAddCircle] using! (continuous_pi fun i => (AddCircle.continuous_mk' (p := (1 : ℝ))).comp (continuous_apply i)) def successorCoordinateHomeomorphism (α : Type*) [TopologicalSpace α] (n : ℕ) : (α × (Fin n → α)) ≃ₜ (Fin n.succ → α) where toEquiv := Fin.consEquiv (fun _ ↦ α) continuous_toFun := by simpa [Fin.consEquiv] using! Continuous.finCons (by fun_prop) (by fun_prop) continuous_invFun := by fun_prop theorem coordinate_torus_projection_is_open_quotient (n : ℕ) : IsOpenQuotientMap (coordinateTorusProjection n) := by induction n with | zero => have h : coordinateTorusProjection 0 = (Homeomorph.homeomorphOfUnique (Fin 0 → ℝ) (UnitAddTorus (Fin 0)) : _ → _) := by funext x; exact Subsingleton.elim _ _ simpa [h] using! (Homeomorph.homeomorphOfUnique (Fin 0 → ℝ) (UnitAddTorus (Fin 0))).isOpenQuotientMap | succ n ih => have h₁ : IsOpenQuotientMap (fun x : ℝ => (x : UnitAddCircle)) := by simpa using! (QuotientAddGroup.isOpenQuotientMap_mk (G := ℝ) (N := AddSubgroup.zmultiples (1 : ℝ))) let eX := (successorCoordinateHomeomorphism (α := ℝ) n).symm let eY := successorCoordinateHomeomorphism (α := UnitAddCircle) n have heX : IsOpenQuotientMap (eX : (Fin n.succ → ℝ) → ℝ × (Fin n → ℝ)) := eX.isOpenQuotientMap have hprod : IsOpenQuotientMap (Prod.map (fun x : ℝ => (x : UnitAddCircle)) (coordinateTorusProjection n)) := IsOpenQuotientMap.prodMap h₁ (ih) have hconj : coordinateTorusProjection n.succ = (fun x => eY (Prod.map (fun x : ℝ => (x : UnitAddCircle)) (coordinateTorusProjection n) (eX x))) := by funext x ext i cases i using Fin.cases with | zero => simp [coordinateTorusProjection, eY, successorCoordinateHomeomorphism, eX, Prod.map] | succ i => simp [coordinateTorusProjection, eY, successorCoordinateHomeomorphism, eX, Prod.map, Fin.tail] have hhomeoY : IsOpenQuotientMap eY := eY.isOpenQuotientMap rw [hconj] exact IsOpenQuotientMap.comp hhomeoY (IsOpenQuotientMap.comp hprod heX) theorem coordinate_torus_projection_measure_preserving (n : ℕ) (t : ℝ) : MeasurePreserving (coordinateTorusProjection n) (Measure.pi fun _ : Fin n => (volume : Measure ℝ).restrict (Set.Ioc t (t + 1))) (volume : Measure (UnitAddTorus (Fin n))) := by simpa [coordinateTorusProjection] using! (MeasureTheory.measurePreserving_pi (μ := fun _ : Fin n => (volume : Measure ℝ).restrict (Set.Ioc t (t + 1))) (ν := fun _ : Fin n => (volume : Measure UnitAddCircle)) (hf := fun _ => UnitAddCircle.measurePreserving_mk t)) theorem restricted_product_volume_eq_product_restriction (n : ℕ) (t : ℝ) : (volume : Measure (Fin n → ℝ)).restrict (Set.univ.pi fun _ : Fin n => Set.Ioc t (t + 1)) = Measure.pi fun _ : Fin n => (volume : Measure ℝ).restrict (Set.Ioc t (t + 1)) := by simpa using! (Measure.restrict_pi_pi (μ := fun _ : Fin n => (volume : Measure ℝ)) (s := fun _ : Fin n => Set.Ioc t (t + 1))) theorem fourier_character_coordinate_projection (n : ℕ) (k : Fin n → ℤ) (x : Fin n → ℝ) : UnitAddTorus.mFourier k (coordinateTorusProjection n x) = Complex.exp (2 * π * Complex.I * (∑ i : Fin n, (k i : ℝ) * x i)) := by simpa [UnitAddTorus.mFourier, ContinuousMap.coe_mk, coordinateTorusProjection, fourier_coe_apply, Finset.mul_sum, mul_assoc, mul_left_comm, mul_comm] using! (Complex.exp_sum (s := (Finset.univ : Finset (Fin n))) (f := fun i : Fin n => 2 * π * Complex.I * ((k i : ℝ) * x i))).symm theorem fourier_character_coordinate_projection_ofLp (n : ℕ) (k : Fin n → ℤ) (x : EuclideanSpace ℝ (Fin n)) : UnitAddTorus.mFourier k (coordinateTorusProjection n (WithLp.ofLp x)) = Complex.exp (2 * π * Complex.I * (∑ i : Fin n, (k i : ℝ) * x i)) := by simpa using! (fourier_character_coordinate_projection (n := n) (k := k) (x := WithLp.ofLp x)) theorem torus_integral_eq_coordinate_cell_integral (n : ℕ) (t : ℝ) (g : UnitAddTorus (Fin n) → ℂ) (hg : AEStronglyMeasurable g (volume : Measure (UnitAddTorus (Fin n)))) : (∫ y : UnitAddTorus (Fin n), g y) = ∫ x, g (coordinateTorusProjection n x) ∂(volume : Measure (Fin n → ℝ)).restrict (Set.univ.pi fun _ : Fin n => Set.Ioc t (t + 1)) := by have hmp := coordinate_torus_projection_measure_preserving n t have h1 : (∫ y : UnitAddTorus (Fin n), g y) = ∫ x, g (coordinateTorusProjection n x) ∂(Measure.pi fun _ : Fin n => (volume : Measure ℝ).restrict (Set.Ioc t (t + 1))) := by rw [← hmp.map_eq] simpa using! (MeasureTheory.integral_map (hφ := hmp.aemeasurable) (f := g) (hfm := by simpa [hmp.map_eq] using! hg)) simpa [(restricted_product_volume_eq_product_restriction n t).symm] using! h1 end SchwartzMap.UnitAddTorus end section namespace SpherePacking.ForMathlib.Fourier open scoped FourierTransform open MeasureTheory variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [FiniteDimensional ℝ V] [MeasurableSpace V] [BorelSpace V] theorem fourier_precompose_linear_equivalence (A : V ≃ₗ[ℝ] V) (f : V → ℂ) (w : V) : 𝓕 (fun x ↦ f (A x)) w = (abs (LinearMap.det (A : V →ₗ[ℝ] V)))⁻¹ • 𝓕 f (((A.symm : V ≃ₗ[ℝ] V).toLinearMap).adjoint w) := by rw [Real.fourier_eq', Real.fourier_eq'] let B : V →L[ℝ] V := A.toContinuousLinearEquiv.toContinuousLinearMap let g : V → ℂ := fun x => Complex.exp ((↑(-2 * Real.pi * @inner ℝ V _ x (((A.symm : V ≃ₗ[ℝ] V).toLinearMap).adjoint w)) : ℂ) * Complex.I) • f x have hinner (x : V) : @inner ℝ V _ (A x) (((A.symm : V ≃ₗ[ℝ] V).toLinearMap).adjoint w) = @inner ℝ V _ x w := by rw [LinearMap.adjoint_inner_right] simp have hchange : (∫ x : V, g x) = |LinearMap.det (A : V →ₗ[ℝ] V)| • ∫ x : V, g (A x) := by have h := MeasureTheory.integral_image_eq_integral_abs_det_fderiv_smul (volume : Measure V) (s := Set.univ) (f := fun x : V => A x) (f' := fun _ : V => B) MeasurableSet.univ (fun x _ => B.hasFDerivAt.hasFDerivWithinAt) (Set.injOn_of_injective A.injective) g have hdetB : B.det = LinearMap.det (A : V →ₗ[ℝ] V) := by rfl calc (∫ x : V, g x) = ∫ x : V, |LinearMap.det (A : V →ₗ[ℝ] V)| • g (A x) := by simpa [Set.image_univ, A.surjective.range_eq, hdetB] using h _ = |LinearMap.det (A : V →ₗ[ℝ] V)| • ∫ x : V, g (A x) := integral_smul _ _ have hdet : LinearMap.det (A : V →ₗ[ℝ] V) ≠ 0 := by intro hzero have hcomp := LinearMap.det_comp ((A.symm : V ≃ₗ[ℝ] V).toLinearMap) (A : V →ₗ[ℝ] V) simp [hzero] at hcomp change (∫ x : V, Complex.exp ((↑(-2 * Real.pi * @inner ℝ V _ x w) : ℂ) * Complex.I) • f (A x)) = |LinearMap.det (A : V →ₗ[ℝ] V)|⁻¹ • ∫ x : V, g x have hleft : (∫ x : V, Complex.exp ((↑(-2 * Real.pi * @inner ℝ V _ x w) : ℂ) * Complex.I) • f (A x)) = ∫ x : V, g (A x) := by congr 1 funext x simp [g, hinner] rw [hleft] calc (∫ x : V, g (A x)) = |LinearMap.det (A : V →ₗ[ℝ] V)|⁻¹ • (|LinearMap.det (A : V →ₗ[ℝ] V)| • ∫ x : V, g (A x)) := by rw [← mul_smul, inv_mul_cancel₀ (abs_ne_zero.mpr hdet), one_smul] _ = |LinearMap.det (A : V →ₗ[ℝ] V)|⁻¹ • ∫ x : V, g x := by rw [hchange] end SpherePacking.ForMathlib.Fourier end section open scoped BigOperators open MeasureTheory namespace SchwartzMap variable {d : ℕ} variable (Λ : Submodule ℤ (EuclideanSpace ℝ (Fin d))) [DiscreteTopology Λ] [IsZLattice ℝ Λ] section StandardLattice noncomputable def referenceIntegerLattice (d : ℕ) : Submodule ℤ (EuclideanSpace ℝ (Fin d)) := Submodule.span ℤ (Set.range ((EuclideanSpace.basisFun (Fin d) ℝ).toBasis)) namespace referenceIntegerLattice instance instDiscreteReferenceIntegerLattice : DiscreteTopology (referenceIntegerLattice d) := by simpa [referenceIntegerLattice] using! (inferInstance : DiscreteTopology (Submodule.span ℤ (Set.range ((EuclideanSpace.basisFun (Fin d) ℝ).toBasis)))) instance instFullRankPackingLattice : IsZLattice ℝ (referenceIntegerLattice d) := by simpa [referenceIntegerLattice] using! (inferInstance : IsZLattice ℝ (Submodule.span ℤ (Set.range ((EuclideanSpace.basisFun (Fin d) ℝ).toBasis)))) end StandardLattice.referenceIntegerLattice section PoissonSummation namespace PoissonSummation namespace Standard noncomputable def embeddedIntegerVector (k : Fin d → ℤ) : (EuclideanSpace ℝ (Fin d)) := WithLp.toLp (2 : ENNReal) (fun i : Fin d => (k i : ℝ)) @[simp] lemma embedded_integer_vector_coordinate (k : Fin d → ℤ) (i : Fin d) : embeddedIntegerVector (d := d) k i = (k i : ℝ) := by simp [embeddedIntegerVector] lemma embedded_integer_vector_mem_reference_lattice (k : Fin d → ℤ) : embeddedIntegerVector (d := d) k ∈ SchwartzMap.referenceIntegerLattice d := by have hsum : embeddedIntegerVector (d := d) k = ∑ i : Fin d, (k i) • ((EuclideanSpace.basisFun (Fin d) ℝ).toBasis i) := by ext j simp [embeddedIntegerVector, OrthonormalBasis.coe_toBasis, EuclideanSpace.basisFun_apply, Pi.single_apply] rw [hsum] refine (SchwartzMap.referenceIntegerLattice d).sum_mem ?_ intro i hi refine (SchwartzMap.referenceIntegerLattice d).smul_mem (k i) ?_ exact Submodule.subset_span ⟨i, rfl⟩ end SchwartzMap.PoissonSummation.PoissonSummation.Standard namespace SchwartzMap open TopologicalSpace MeasureTheory variable {d : ℕ} namespace PoissonSummation.Standard open UnitAddTorus def halfOpenUnitCell : Set (EuclideanSpace ℝ (Fin d)) := {x | ∀ i : Fin d, x i ∈ Set.Ioc (0 : ℝ) 1} lemma half_open_unit_cell_measurable : MeasurableSet (halfOpenUnitCell (d := d)) := by have hset : halfOpenUnitCell (d := d) = ⋂ i : Fin d, {x : (EuclideanSpace ℝ (Fin d)) | x i ∈ Set.Ioc (0 : ℝ) 1} := by ext x simp [halfOpenUnitCell] have hcoord : ∀ i : Fin d, MeasurableSet {x : (EuclideanSpace ℝ (Fin d)) | x i ∈ Set.Ioc (0 : ℝ) 1} := by intro i have hproj : Measurable fun x : (EuclideanSpace ℝ (Fin d)) => x i := by simpa using! (PiLp.continuous_apply (p := (2 : ENNReal)) (β := fun _ : Fin d => ℝ) i).measurable exact hproj measurableSet_Ioc simpa [hset] using! MeasurableSet.iInter (ι := Fin d) hcoord lemma half_open_unit_cell_null_measurable : NullMeasurableSet (halfOpenUnitCell (d := d)) := (half_open_unit_cell_measurable (d := d)).nullMeasurableSet lemma unique_integer_shift_into_half_open_cell (x : (EuclideanSpace ℝ (Fin d))) : ∃! n : Fin d → ℤ, x + SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n ∈ halfOpenUnitCell (d := d) := by have hxcoord : ∀ i : Fin d, ∃! m : ℤ, (x i : ℝ) + m • (1 : ℝ) ∈ Set.Ioc (0 : ℝ) 1 := by intro i simpa [one_smul, add_assoc] using! (existsUnique_add_zsmul_mem_Ioc (G := ℝ) (ha := zero_lt_one) (b := (x i : ℝ)) (c := (0 : ℝ))) choose n hn hn_unique using hxcoord refine ⟨n, ?_, ?_⟩ · intro i simpa [SchwartzMap.PoissonSummation.Standard.embedded_integer_vector_coordinate, halfOpenUnitCell, zsmul_one] using! hn i · intro n' hn' funext i have hcoords : ∀ i : Fin d, (x + SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n') i ∈ Set.Ioc (0 : ℝ) 1 := by simpa [halfOpenUnitCell] using! hn' exact hn_unique i (n' i) (by simpa [SchwartzMap.PoissonSummation.Standard.embedded_integer_vector_coordinate, zsmul_one] using! hcoords i) lemma reference_lattice_element_eq_integer_vector (x : (EuclideanSpace ℝ (Fin d))) (hx : x ∈ SchwartzMap.referenceIntegerLattice d) : ∃ n : Fin d → ℤ, x = SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n := by let b : OrthonormalBasis (Fin d) ℝ (EuclideanSpace ℝ (Fin d)) := EuclideanSpace.basisFun (Fin d) ℝ have hx_span : x ∈ Submodule.span ℤ (Set.range fun j : Fin d => (b.toBasis j : (EuclideanSpace ℝ (Fin d)))) := by simpa [SchwartzMap.referenceIntegerLattice, referenceIntegerLattice] using! hx have hx_repr := (Module.Basis.mem_span_iff_repr_mem (R := ℤ) (b := b.toBasis) x).1 hx_span choose n hn using hx_repr have hn' : ∀ i : Fin d, (n i : ℝ) = x i := by intro i simpa [b] using! hn i refine ⟨n, ?_⟩ ext i simp [SchwartzMap.PoissonSummation.Standard.embedded_integer_vector_coordinate, hn' i] lemma reference_lattice_dual_self : LinearMap.BilinForm.dualSubmodule (B := (innerₗ (EuclideanSpace ℝ (Fin d)) : LinearMap.BilinForm ℝ (EuclideanSpace ℝ (Fin d)))) (SchwartzMap.referenceIntegerLattice d) = SchwartzMap.referenceIntegerLattice d := by ext x constructor · intro hx have hxcoord : ∀ i : Fin d, ∃ n : ℤ, (n : ℝ) = x i := by intro i have hinner : inner ℝ x (EuclideanSpace.basisFun (Fin d) ℝ i) ∈ (1 : Submodule ℤ ℝ) := by simpa [innerₗ_apply_apply] using! hx _ (Submodule.subset_span ⟨i, by simp⟩) rcases Submodule.mem_one.mp hinner with ⟨n, hn⟩ exact ⟨n, by simpa [-EuclideanSpace.basisFun_apply] using! hn⟩ choose n hn using hxcoord have hx' : x = SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n := by ext i simp [SchwartzMap.PoissonSummation.Standard.embedded_integer_vector_coordinate, hn i] simpa [hx'] using! SchwartzMap.PoissonSummation.Standard.embedded_integer_vector_mem_reference_lattice (d := d) n · intro hx y hy rcases reference_lattice_element_eq_integer_vector (d := d) x hx with ⟨n, rfl⟩ rcases reference_lattice_element_eq_integer_vector (d := d) y hy with ⟨m, rfl⟩ refine Submodule.mem_one.mpr ⟨∑ i : Fin d, n i * m i, ?_⟩ simp [innerₗ_apply_apply, SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector, PiLp.inner_apply, map_sum, Int.cast_mul, mul_comm] end SchwartzMap.PoissonSummation.Standard namespace SchwartzMap variable {d : ℕ} namespace PoissonSummation.Standard open UnitAddTorus def euclideanTorusProjection : (EuclideanSpace ℝ (Fin d)) → UnitAddTorus (Fin d) := fun x => UnitAddTorus.coordinateTorusProjection d ((WithLp.ofLp : (EuclideanSpace ℝ (Fin d)) → (Fin d → ℝ)) x) @[continuity] theorem continuous_euclidean_torus_projection : Continuous (euclideanTorusProjection (d := d)) := by simpa [euclideanTorusProjection] using! (UnitAddTorus.continuous_coordinate_torus_projection (n := d)).comp (PiLp.continuous_ofLp (p := (2 : ENNReal)) (β := fun _ : Fin d => ℝ)) theorem euclidean_torus_projection_is_open_quotient : IsOpenQuotientMap (euclideanTorusProjection (d := d)) := by unfold euclideanTorusProjection exact IsOpenQuotientMap.comp (UnitAddTorus.coordinate_torus_projection_is_open_quotient d) (PiLp.homeomorph (p := (2 : ENNReal)) (β := fun _ : Fin d => ℝ)).isOpenQuotientMap @[simp] theorem torus_projection_add_integer_vector (x : (EuclideanSpace ℝ (Fin d))) (n : Fin d → ℤ) : euclideanTorusProjection (d := d) (x + SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n) = euclideanTorusProjection (d := d) x := by ext i simp [euclideanTorusProjection, UnitAddTorus.coordinateTorusProjection] theorem equal_torus_projections_differ_by_integer_vector {x y : (EuclideanSpace ℝ (Fin d))} (h : euclideanTorusProjection (d := d) x = euclideanTorusProjection (d := d) y) : ∃ n : Fin d → ℤ, x - y = SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n := by have hcoord : ∀ i : Fin d, ∃ n : ℤ, (n : ℝ) = (x i - y i : ℝ) := by intro i have hsub : ((x i - y i : ℝ) : AddCircle (1 : ℝ)) = 0 := by simpa [UnitAddCircle, AddCircle.coe_sub, euclideanTorusProjection, UnitAddTorus.coordinateTorusProjection] using! sub_eq_zero.2 (congrArg (fun t => t i) h) rcases (AddCircle.coe_eq_zero_iff (p := (1 : ℝ)) (x := (x i - y i : ℝ))).1 hsub with ⟨n, hn⟩ exact ⟨n, by simpa using! hn⟩ choose n hn using hcoord refine ⟨n, ?_⟩ ext i simp [SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector, hn i] theorem half_open_cell_is_fundamental_region : MeasureTheory.IsAddFundamentalDomain (SchwartzMap.referenceIntegerLattice d) (SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d)) (volume : Measure (EuclideanSpace ℝ (Fin d))) := by refine MeasureTheory.IsAddFundamentalDomain.mk' (SchwartzMap.PoissonSummation.Standard.half_open_unit_cell_null_measurable (d := d)) ?_ intro x rcases SchwartzMap.PoissonSummation.Standard.unique_integer_shift_into_half_open_cell (d := d) x with ⟨n, hn, hn_unique⟩ refine ⟨(⟨SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n, SchwartzMap.PoissonSummation.Standard.embedded_integer_vector_mem_reference_lattice (d := d) n⟩), ?_, ?_⟩ · simpa [Submodule.vadd_def, vadd_eq_add, add_comm, add_left_comm, add_assoc] using! hn · intro ℓ hℓ rcases SchwartzMap.PoissonSummation.Standard.reference_lattice_element_eq_integer_vector (d := d) (ℓ : (EuclideanSpace ℝ (Fin d))) ℓ.property with ⟨n', hn'⟩ have : n' = n := hn_unique n' (by simpa [Submodule.vadd_def, vadd_eq_add, add_comm, add_left_comm, add_assoc, hn'] using! hℓ) apply Subtype.ext simp [hn', this] theorem torus_integral_eq_euclidean_cell_integral (g : UnitAddTorus (Fin d) → ℂ) (hg : AEStronglyMeasurable g (volume : Measure (UnitAddTorus (Fin d)))) : (∫ y : UnitAddTorus (Fin d), g y) = ∫ x, g (euclideanTorusProjection (d := d) x) ∂(volume : Measure (EuclideanSpace ℝ (Fin d))).restrict (SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d)) := by have h1 : (∫ y : UnitAddTorus (Fin d), g y) = ∫ x, g (UnitAddTorus.coordinateTorusProjection d x) ∂(volume : Measure (Fin d → ℝ)).restrict (Set.univ.pi fun _ : Fin d => Set.Ioc (0 : ℝ) (0 + 1)) := by simpa using! (UnitAddTorus.torus_integral_eq_coordinate_cell_integral (n := d) (t := (0 : ℝ)) g hg) let f : (Fin d → ℝ) ≃ᵐ (EuclideanSpace ℝ (Fin d)) := MeasurableEquiv.toLp 2 (Fin d → ℝ) have hmp : MeasurePreserving (⇑f) (volume : Measure (Fin d → ℝ)) (volume : Measure (EuclideanSpace ℝ (Fin d))) := by simpa [f, MeasurableEquiv.coe_toLp] using! (PiLp.volume_preserving_toLp (ι := Fin d)) have hpre : f ⁻¹' (SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d)) = Set.univ.pi fun _ : Fin d => Set.Ioc (0 : ℝ) (0 + 1) := by ext x simp [f, SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell, MeasurableEquiv.coe_toLp] have hmpR : MeasurePreserving (⇑f) ((volume : Measure (Fin d → ℝ)).restrict (f ⁻¹' SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d))) ((volume : Measure (EuclideanSpace ℝ (Fin d))).restrict (SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d))) := MeasurePreserving.restrict_preimage hmp (SchwartzMap.PoissonSummation.Standard.half_open_unit_cell_measurable (d := d)) have h2 : (∫ x, g (UnitAddTorus.coordinateTorusProjection d x) ∂(volume : Measure (Fin d → ℝ)).restrict (Set.univ.pi fun _ : Fin d => Set.Ioc (0 : ℝ) (0 + 1))) = ∫ y, g (euclideanTorusProjection (d := d) y) ∂(volume : Measure (EuclideanSpace ℝ (Fin d))).restrict (SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d)) := by simpa [hpre, euclideanTorusProjection, f] using! (MeasurePreserving.integral_comp' hmpR (g := fun y : (EuclideanSpace ℝ (Fin d)) => g (UnitAddTorus.coordinateTorusProjection d (WithLp.ofLp y)))) exact h1.trans h2 end SchwartzMap.PoissonSummation.Standard end section open scoped BigOperators FourierTransform open MeasureTheory namespace SchwartzMap.PoissonSummation.Standard variable {d : ℕ} open UnitAddTorus noncomputable def integerVectorLatticeEquiv : (Fin d → ℤ) ≃ (SchwartzMap.referenceIntegerLattice d) := by refine Equiv.ofBijective (fun n : Fin d → ℤ => ⟨SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n, SchwartzMap.PoissonSummation.Standard.embedded_integer_vector_mem_reference_lattice (d := d) n⟩) ?_ refine ⟨?_, ?_⟩ · intro a b hab have hab' : SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) a = SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) b := by simpa using! congrArg Subtype.val hab funext i have := congrArg (fun x : (EuclideanSpace ℝ (Fin d)) => x i) hab' simpa [SchwartzMap.PoissonSummation.Standard.embedded_integer_vector_coordinate] using! this · intro ℓ rcases SchwartzMap.PoissonSummation.Standard.reference_lattice_element_eq_integer_vector (d := d) (x := (ℓ : (EuclideanSpace ℝ (Fin d)))) ℓ.property with ⟨n, hn⟩ refine ⟨n, ?_⟩ apply Subtype.ext simpa using! hn.symm variable (f : 𝓢(EuclideanSpace ℝ (Fin d), ℂ)) instance instMeasurableReferenceLatticeTranslation : MeasurableVAdd (SchwartzMap.referenceIntegerLattice d) (EuclideanSpace ℝ (Fin d)) := by refine { measurable_const_vadd := ?_, measurable_vadd_const := ?_ } · intro c simpa [Submodule.vadd_def, vadd_eq_add] using! (continuous_const.add continuous_id).measurable · intro x simpa [Submodule.vadd_def, vadd_eq_add] using! (continuous_subtype_val.add continuous_const).measurable instance instReferenceLatticeTranslationInvariantVolume : MeasureTheory.VAddInvariantMeasure (SchwartzMap.referenceIntegerLattice d) (EuclideanSpace ℝ (Fin d)) (volume : Measure (EuclideanSpace ℝ (Fin d))) where measure_preimage_vadd c s hs := by simp [Submodule.vadd_def, vadd_eq_add, MeasureTheory.measure_preimage_add] noncomputable def latticeTranslatedMap (ℓ : (SchwartzMap.referenceIntegerLattice d)) : C((EuclideanSpace ℝ (Fin d)), ℂ) := (⟨(fun x => f x), f.continuous⟩ : C((EuclideanSpace ℝ (Fin d)), ℂ)).comp (ContinuousMap.addRight (ℓ : (EuclideanSpace ℝ (Fin d)))) lemma finite_reference_lattice_points_of_norm_bound (r : ℝ) : ( {ℓ : (SchwartzMap.referenceIntegerLattice d) | ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖ ≤ r} : Set _ ).Finite := by haveI : DiscreteTopology (((SchwartzMap.referenceIntegerLattice d)).toAddSubgroup) := (inferInstance : DiscreteTopology (SchwartzMap.referenceIntegerLattice d)) have hfinE : Set.Finite (Metric.closedBall (0 : (EuclideanSpace ℝ (Fin d))) r ∩ (((SchwartzMap.referenceIntegerLattice d)).toAddSubgroup : Set (EuclideanSpace ℝ (Fin d)))) := Metric.finite_isBounded_inter_isClosed DiscreteTopology.isDiscrete Metric.isBounded_closedBall AddSubgroup.isClosed_of_discrete let e : (SchwartzMap.referenceIntegerLattice d) ↪ (EuclideanSpace ℝ (Fin d)) := ⟨fun ℓ => (ℓ : (EuclideanSpace ℝ (Fin d))), Subtype.coe_injective⟩ have hfin_pre : (e ⁻¹' (Metric.closedBall (0 : (EuclideanSpace ℝ (Fin d))) r ∩ ((SchwartzMap.referenceIntegerLattice d) : Set (EuclideanSpace ℝ (Fin d))))).Finite := by simpa using! Set.Finite.preimage_embedding e (by simpa [Submodule.coe_toAddSubgroup] using! hfinE) have : (e ⁻¹' (Metric.closedBall (0 : (EuclideanSpace ℝ (Fin d))) r ∩ ((SchwartzMap.referenceIntegerLattice d) : Set (EuclideanSpace ℝ (Fin d))))) = {ℓ : (SchwartzMap.referenceIntegerLattice d) | ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖ ≤ r} := by ext ℓ simp [e, Metric.mem_closedBall, dist_eq_norm, sub_eq_add_neg, add_zero] simpa [this] using! hfin_pre lemma summable_restricted_lattice_translate_norms (K : TopologicalSpace.Compacts (EuclideanSpace ℝ (Fin d))) : Summable (fun ℓ : (SchwartzMap.referenceIntegerLattice d) => ‖(latticeTranslatedMap (d := d) f ℓ).restrict K‖) := by let k : ℕ := Module.finrank ℤ (SchwartzMap.referenceIntegerLattice d) + 1 obtain ⟨C, hCpos, hC⟩ := f.decay k 0 have hC' : ∀ x : (EuclideanSpace ℝ (Fin d)), ‖x‖ ^ k * ‖f x‖ ≤ C := by simpa [norm_iteratedFDeriv_zero] using! hC obtain ⟨r, hrK⟩ := K.isCompact.isBounded.subset_closedBall (0 : (EuclideanSpace ℝ (Fin d))) let r0 : ℝ := max r 0 have hrK0 : (K : Set (EuclideanSpace ℝ (Fin d))) ⊆ Metric.closedBall (0 : (EuclideanSpace ℝ (Fin d))) r0 := by have hr_le : r ≤ r0 := le_max_left r 0 have hball : Metric.closedBall (0 : (EuclideanSpace ℝ (Fin d))) r ⊆ Metric.closedBall (0 : (EuclideanSpace ℝ (Fin d))) r0 := Metric.closedBall_subset_closedBall hr_le exact fun x hx => hball (hrK hx) let R : ℝ := max (2 * r0) 1 have hfin : ( {ℓ : (SchwartzMap.referenceIntegerLattice d) | ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖ ≤ R} : Set _ ).Finite := finite_reference_lattice_points_of_norm_bound (d := d) (r := R) have h_event : ∀ᶠ ℓ : (SchwartzMap.referenceIntegerLattice d) in Filter.cofinite, ‖(latticeTranslatedMap (d := d) f ℓ).restrict K‖ ≤ (C * (2 ^ k : ℝ)) * (‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖⁻¹ ^ k) := by filter_upwards [hfin.eventually_cofinite_notMem] with ℓ hℓ have hRlt : R < ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖ := lt_of_not_ge (by simpa using! hℓ) have hnorm_lt : 2 * r0 < ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖ := lt_of_le_of_lt (le_max_left _ _) hRlt have hnorm_pos : 0 < ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖ := lt_trans (by positivity) hRlt refine (ContinuousMap.norm_le _ (by positivity)).2 ?_ rintro ⟨x, hxK⟩ have hxball : (x : (EuclideanSpace ℝ (Fin d))) ∈ Metric.closedBall (0 : (EuclideanSpace ℝ (Fin d))) r0 := hrK0 hxK have hxnorm : ‖(x : (EuclideanSpace ℝ (Fin d)))‖ ≤ r0 := by simpa [Metric.mem_closedBall, dist_eq_norm, sub_eq_add_neg, add_zero] using! hxball have hnorm_ge : (1 / 2 : ℝ) * ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖ ≤ ‖(x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ := by have hsub : ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖ - ‖(x : (EuclideanSpace ℝ (Fin d)))‖ ≤ ‖(ℓ : (EuclideanSpace ℝ (Fin d))) + x‖ := by simpa [add_comm, add_left_comm, add_assoc] using! (norm_sub_norm_le (ℓ : (EuclideanSpace ℝ (Fin d))) (-x)) have hxlt : ‖(x : (EuclideanSpace ℝ (Fin d)))‖ < (1 / 2 : ℝ) * ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖ := by grind have : (1 / 2 : ℝ) * ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖ ≤ ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖ - ‖(x : (EuclideanSpace ℝ (Fin d)))‖ := by nlinarith [le_of_lt hxlt] have : (1 / 2 : ℝ) * ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖ ≤ ‖(ℓ : (EuclideanSpace ℝ (Fin d))) + x‖ := le_trans this hsub simpa [add_comm, add_left_comm, add_assoc] using! this have hnorm_xℓ_pos : 0 < ‖(x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ := (by positivity : 0 < (1 / 2 : ℝ) * ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖).trans_le hnorm_ge have hpow_pos : 0 < ‖(x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ ^ k := pow_pos hnorm_xℓ_pos _ have hdiv : ‖f (x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ ≤ C / (‖(x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ ^ k) := (le_div_iff₀' hpow_pos).2 (hC' (x + (ℓ : (EuclideanSpace ℝ (Fin d))))) have hpow_le : C / (‖(x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ ^ k) ≤ (C * (2 ^ k : ℝ)) * (‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖⁻¹ ^ k) := by have hpow_ge : ((1 / 2 : ℝ) * ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖) ^ k ≤ ‖(x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ ^ k := pow_le_pow_left₀ (by positivity) hnorm_ge _ have hinv : (‖(x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ ^ k)⁻¹ ≤ (2 ^ k : ℝ) * (‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖⁻¹ ^ k) := by have hapos : 0 < ((1 / 2 : ℝ) * ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖) ^ k := by exact pow_pos (mul_pos (by positivity) hnorm_pos) _ have : (‖(x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ ^ k)⁻¹ ≤ (((1 / 2 : ℝ) * ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖) ^ k)⁻¹ := by simpa [one_div] using! (one_div_le_one_div_of_le hapos hpow_ge) simpa [mul_assoc, mul_comm, inv_pow, mul_inv_rev, mul_pow] using! this have := mul_le_mul_of_nonneg_left hinv (le_of_lt hCpos) simpa [div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm] using! this have : ‖f (x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ ≤ (C * (2 ^ k : ℝ)) * (‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖⁻¹ ^ k) := le_trans hdiv hpow_le simpa [latticeTranslatedMap, ContinuousMap.restrict_apply, ContinuousMap.comp_apply] using! this have hsum_pow : Summable (fun ℓ : (SchwartzMap.referenceIntegerLattice d) => (‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖⁻¹ ^ k : ℝ)) := by simpa [k] using! (ZLattice.summable_norm_pow_inv (L := (SchwartzMap.referenceIntegerLattice d)) (n := k) (Nat.lt_succ_self _)) have hsum_bd : Summable (fun ℓ : (SchwartzMap.referenceIntegerLattice d) => (C * (2 ^ k : ℝ)) * (‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖⁻¹ ^ k)) := hsum_pow.mul_left (C * (2 ^ k : ℝ)) refine Summable.of_norm_bounded_eventually hsum_bd ?_ filter_upwards [h_event] with ℓ hℓ simpa [Real.norm_of_nonneg (by positivity)] using! hℓ noncomputable def latticePeriodizedMap : C((EuclideanSpace ℝ (Fin d)), ℂ) := ∑' ℓ : (SchwartzMap.referenceIntegerLattice d), latticeTranslatedMap (d := d) f ℓ lemma lattice_periodized_map_apply (x : (EuclideanSpace ℝ (Fin d))) : latticePeriodizedMap (d := d) f x = ∑' ℓ : (SchwartzMap.referenceIntegerLattice d), f (x + (ℓ : (EuclideanSpace ℝ (Fin d)))) := by have hsum := ContinuousMap.summable_of_locally_summable_norm (summable_restricted_lattice_translate_norms (d := d) f) simpa [latticePeriodizedMap, translate_apply] using! (ContinuousMap.tsum_apply hsum x).symm @[simp] lemma lattice_periodization_translation_invariant (x : (EuclideanSpace ℝ (Fin d))) (ℓ₀ : (SchwartzMap.referenceIntegerLattice d)) : latticePeriodizedMap (d := d) f (x + ℓ₀) = latticePeriodizedMap (d := d) f x := by simpa [lattice_periodized_map_apply (d := d) f, add_assoc] using! (Equiv.addLeft ℓ₀).tsum_eq fun ℓ => f (x + (ℓ : (EuclideanSpace ℝ (Fin d)))) noncomputable def euclideanTorusProjectionContinuous : C((EuclideanSpace ℝ (Fin d)), UnitAddTorus (Fin d)) := ⟨PoissonSummation.Standard.euclideanTorusProjection (d := d), PoissonSummation.Standard.continuous_euclidean_torus_projection (d := d)⟩ lemma continuous_torus_projection_is_quotient : Topology.IsQuotientMap (euclideanTorusProjectionContinuous (d := d)) := by let h := PoissonSummation.Standard.euclidean_torus_projection_is_open_quotient (d := d) simpa [euclideanTorusProjectionContinuous] using! h.isQuotientMap lemma lattice_periodization_factors_through_torus : Function.FactorsThrough (latticePeriodizedMap (d := d) f) (euclideanTorusProjectionContinuous (d := d)) := by intro x y hxy rcases PoissonSummation.Standard.equal_torus_projections_differ_by_integer_vector (d := d) (x := x) (y := y) (by simpa [euclideanTorusProjectionContinuous] using! hxy) with ⟨n, hn⟩ have hx : x = y + SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n := by simpa [sub_eq_add_neg, add_assoc, add_left_comm, add_comm] using! congrArg (fun t => t + y) hn simpa [hx] using! (lattice_periodization_translation_invariant (d := d) (f := f) y ⟨SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n, SchwartzMap.PoissonSummation.Standard.embedded_integer_vector_mem_reference_lattice (d := d) n⟩) noncomputable def torusDescendedPeriodization : C(UnitAddTorus (Fin d), ℂ) := Topology.IsQuotientMap.lift (hf := continuous_torus_projection_is_quotient (d := d)) (g := latticePeriodizedMap (d := d) f) (lattice_periodization_factors_through_torus (d := d) (f := f)) lemma torus_descended_periodization_comp_projection (x : (EuclideanSpace ℝ (Fin d))) : torusDescendedPeriodization (d := d) f (PoissonSummation.Standard.euclideanTorusProjection (d := d) x) = latticePeriodizedMap (d := d) f x := by have hcomp : (torusDescendedPeriodization (d := d) f).comp (euclideanTorusProjectionContinuous (d := d)) = latticePeriodizedMap (d := d) f := by simp [torusDescendedPeriodization] simpa [euclideanTorusProjectionContinuous] using! congrArg (fun g : C((EuclideanSpace ℝ (Fin d)), ℂ) => g x) hcomp lemma negative_fourier_character_projection (n : Fin d → ℤ) (x : (EuclideanSpace ℝ (Fin d))) : UnitAddTorus.mFourier (-n) (PoissonSummation.Standard.euclideanTorusProjection (d := d) x) = (𝐞 (-(inner ℝ x (SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n))) : ℂ) := by simp [PoissonSummation.Standard.euclideanTorusProjection, UnitAddTorus.fourier_character_coordinate_projection_ofLp, Real.fourierChar_apply, SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector, PiLp.inner_apply, Finset.sum_neg_distrib, mul_assoc, mul_comm] @[simp] lemma embedded_integer_vector_neg (n : Fin d → ℤ) : SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) (-n) = -SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n := by ext i simp [SchwartzMap.PoissonSummation.Standard.embedded_integer_vector_coordinate] lemma fourier_character_euclidean_projection (n : Fin d → ℤ) (x : (EuclideanSpace ℝ (Fin d))) : UnitAddTorus.mFourier n (PoissonSummation.Standard.euclideanTorusProjection (d := d) x) = (𝐞 (inner ℝ x (SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n)) : ℂ) := by simpa [embedded_integer_vector_neg (d := d) (n := n), inner_neg_right, neg_neg] using! (negative_fourier_character_projection (d := d) (n := -n) (x := x)) lemma fourier_character_projection_exponential (n : Fin d → ℤ) (x : (EuclideanSpace ℝ (Fin d))) : UnitAddTorus.mFourier n (PoissonSummation.Standard.euclideanTorusProjection (d := d) x) = Complex.exp (2 * Real.pi * Complex.I * ⟪x, SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n⟫_[ℝ]) := by have hinner : inner ℝ x (SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n) = RCLike.wInner (𝕜 := ℝ) 1 x.ofLp (SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n).ofLp := RCLike.inner_eq_wInner_one x (embeddedIntegerVector n) simpa [Real.fourierChar_apply, mul_assoc, mul_comm, hinner] using! (fourier_character_euclidean_projection (d := d) (n := n) (x := x)) lemma negative_character_invariant_under_lattice_shift (n : Fin d → ℤ) (ℓ : (SchwartzMap.referenceIntegerLattice d)) (x : (EuclideanSpace ℝ (Fin d))) : UnitAddTorus.mFourier (-n) (PoissonSummation.Standard.euclideanTorusProjection (d := d) (x + (ℓ : (EuclideanSpace ℝ (Fin d))))) = UnitAddTorus.mFourier (-n) (PoissonSummation.Standard.euclideanTorusProjection (d := d) x) := by rcases PoissonSummation.Standard.reference_lattice_element_eq_integer_vector (d := d) (x := (ℓ : (EuclideanSpace ℝ (Fin d)))) ℓ.property with ⟨m, hm⟩ simp [hm] lemma half_open_unit_cell_subset_closed_ball : SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d) ⊆ Metric.closedBall (0 : (EuclideanSpace ℝ (Fin d))) (Real.sqrt d) := by intro x hx have hsum : (∑ i : Fin d, ‖x i‖ ^ 2) ≤ (d : ℝ) := by have hterm : ∀ i : Fin d, ‖x i‖ ^ 2 ≤ (1 : ℝ) := by intro i have hi : x i ∈ Set.Ioc (0 : ℝ) 1 := hx i have hxle : ‖x i‖ ≤ (1 : ℝ) := by have hxnonneg : 0 ≤ x i := le_of_lt hi.1 simpa [Real.norm_eq_abs, abs_of_nonneg hxnonneg] using! hi.2 simpa [pow_two] using! mul_le_mul hxle hxle (norm_nonneg _) (by positivity) simpa using! (Finset.sum_le_sum fun i _ => hterm i).trans_eq (by simp) simpa [Metric.mem_closedBall, dist_eq_norm, EuclideanSpace.norm_eq] using! (Real.sqrt_le_sqrt hsum) lemma half_open_unit_cell_volume_finite : (volume : Measure (EuclideanSpace ℝ (Fin d))) (SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d)) < ⊤ := by simpa using! ((Metric.isBounded_closedBall (x := (0 : (EuclideanSpace ℝ (Fin d)))) (r := Real.sqrt d)).subset (half_open_unit_cell_subset_closed_ball (d := d))).measure_lt_top lemma fourier_character_translate_integrable_on_cell (n : Fin d → ℤ) (ℓ : (SchwartzMap.referenceIntegerLattice d)) : IntegrableOn (fun x : (EuclideanSpace ℝ (Fin d)) => UnitAddTorus.mFourier (-n) (PoissonSummation.Standard.euclideanTorusProjection (d := d) x) * f (x + (ℓ : (EuclideanSpace ℝ (Fin d))))) (SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d)) (volume : Measure (EuclideanSpace ℝ (Fin d))) := by let K : TopologicalSpace.Compacts (EuclideanSpace ℝ (Fin d)) := ⟨Metric.closedBall (0 : (EuclideanSpace ℝ (Fin d))) (Real.sqrt d), isCompact_closedBall (0 : (EuclideanSpace ℝ (Fin d))) (Real.sqrt d)⟩ have hK : SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d) ⊆ (K : Set (EuclideanSpace ℝ (Fin d))) := (half_open_unit_cell_subset_closed_ball (d := d)) have hbound : ∀ x ∈ SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d), ‖UnitAddTorus.mFourier (-n) (PoissonSummation.Standard.euclideanTorusProjection (d := d) x) * f (x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ ≤ ‖(latticeTranslatedMap (d := d) f ℓ).restrict K‖ := by intro x hx have hxK : x ∈ (K : Set (EuclideanSpace ℝ (Fin d))) := hK hx have hmFourier : ‖UnitAddTorus.mFourier (-n) (PoissonSummation.Standard.euclideanTorusProjection (d := d) x)‖ ≤ 1 := by simpa [UnitAddTorus.mFourier_norm (d := Fin d) (n := -n)] using! (ContinuousMap.norm_coe_le_norm (UnitAddTorus.mFourier (-n)) (PoissonSummation.Standard.euclideanTorusProjection (d := d) x)) have hsup : ‖f (x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ ≤ ‖(latticeTranslatedMap (d := d) f ℓ).restrict K‖ := by simpa [translate_apply, ContinuousMap.restrict_apply] using! (ContinuousMap.norm_coe_le_norm ((latticeTranslatedMap (d := d) f ℓ).restrict K) ⟨x, hxK⟩) calc ‖UnitAddTorus.mFourier (-n) (PoissonSummation.Standard.euclideanTorusProjection (d := d) x) * f (x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ = ‖UnitAddTorus.mFourier (-n) (PoissonSummation.Standard.euclideanTorusProjection (d := d) x)‖ * ‖f (x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ := by simp _ ≤ 1 * ‖f (x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ := by gcongr _ = ‖f (x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ := by simp _ ≤ ‖(latticeTranslatedMap (d := d) f ℓ).restrict K‖ := hsup refine Measure.integrableOn_of_bounded (μ := (volume : Measure (EuclideanSpace ℝ (Fin d)))) (s := SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d)) (s_finite := (half_open_unit_cell_volume_finite (d := d)).ne) ?_ (M := ‖(latticeTranslatedMap (d := d) f ℓ).restrict K‖) ?_ · exact (((UnitAddTorus.mFourier (-n)).continuous.comp (PoissonSummation.Standard.continuous_euclidean_torus_projection (d := d))).mul (f.continuous.comp (continuous_id.add continuous_const))).aestronglyMeasurable · exact ae_restrict_of_forall_mem (SchwartzMap.PoissonSummation.Standard.half_open_unit_cell_measurable (d := d)) hbound end SchwartzMap.PoissonSummation.Standard namespace SchwartzMap.PoissonSummation.Standard variable {d : ℕ} open UnitAddTorus variable (f : 𝓢(EuclideanSpace ℝ (Fin d), ℂ)) noncomputable def ball : TopologicalSpace.Compacts (EuclideanSpace ℝ (Fin d)) := ⟨Metric.closedBall (0 : (EuclideanSpace ℝ (Fin d))) (Real.sqrt d), isCompact_closedBall (0 : (EuclideanSpace ℝ (Fin d))) (Real.sqrt d)⟩ lemma fourier_weighted_translate_norm_bound (n : Fin d → ℤ) (ℓ : (SchwartzMap.referenceIntegerLattice d)) (x : (EuclideanSpace ℝ (Fin d))) (hx : x ∈ SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d)) : ‖UnitAddTorus.mFourier (-n) (PoissonSummation.Standard.euclideanTorusProjection (d := d) x) * f (x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ ≤ ‖(latticeTranslatedMap (d := d) f ℓ).restrict (ball (d := d))‖ := by have hxK : x ∈ (ball (d := d) : Set (EuclideanSpace ℝ (Fin d))) := (half_open_unit_cell_subset_closed_ball (d := d)) hx have hmFourier : ‖UnitAddTorus.mFourier (-n) (PoissonSummation.Standard.euclideanTorusProjection (d := d) x)‖ ≤ 1 := by simpa [UnitAddTorus.mFourier_norm (d := Fin d) (n := -n)] using! (ContinuousMap.norm_coe_le_norm (UnitAddTorus.mFourier (-n)) (PoissonSummation.Standard.euclideanTorusProjection (d := d) x)) have hsup : ‖f (x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ ≤ ‖(latticeTranslatedMap (d := d) f ℓ).restrict (ball (d := d))‖ := by simpa [translate_apply, ContinuousMap.restrict_apply] using! (ContinuousMap.norm_coe_le_norm ((latticeTranslatedMap (d := d) f ℓ).restrict (ball (d := d))) ⟨x, hxK⟩) calc ‖UnitAddTorus.mFourier (-n) (PoissonSummation.Standard.euclideanTorusProjection (d := d) x) * f (x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ = ‖UnitAddTorus.mFourier (-n) (PoissonSummation.Standard.euclideanTorusProjection (d := d) x)‖ * ‖f (x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ := by simp _ ≤ 1 * ‖f (x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ := by gcongr _ = ‖f (x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ := by simp _ ≤ ‖(latticeTranslatedMap (d := d) f ℓ).restrict (ball (d := d))‖ := hsup lemma summable_cell_integrals_of_weighted_translates (n : Fin d → ℤ) : Summable (fun ℓ : (SchwartzMap.referenceIntegerLattice d) => ∫ x in SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d), ‖UnitAddTorus.mFourier (-n) (PoissonSummation.Standard.euclideanTorusProjection (d := d) x) * f (x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ ∂(volume : Measure (EuclideanSpace ℝ (Fin d)))) := by let s : Set (EuclideanSpace ℝ (Fin d)) := SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d) let μ : Measure (EuclideanSpace ℝ (Fin d)) := (volume : Measure (EuclideanSpace ℝ (Fin d))).restrict s haveI : IsFiniteMeasure μ := by refine ⟨?_⟩ simpa [μ, s] using! (half_open_unit_cell_volume_finite (d := d)) have hsum_norm : Summable (fun ℓ : (SchwartzMap.referenceIntegerLattice d) => μ.real Set.univ * ‖(latticeTranslatedMap (d := d) f ℓ).restrict (ball (d := d))‖) := by simpa [mul_assoc, mul_comm, mul_left_comm] using! (summable_restricted_lattice_translate_norms (d := d) f (ball (d := d))).mul_left (μ.real Set.univ) refine Summable.of_nonneg_of_le (fun _ => by positivity) (fun ℓ => ?_) hsum_norm have hle_ae : (fun x : (EuclideanSpace ℝ (Fin d)) => ‖UnitAddTorus.mFourier (-n) (PoissonSummation.Standard.euclideanTorusProjection (d := d) x) * f (x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖) ≤ᵐ[μ] fun _ : (EuclideanSpace ℝ (Fin d)) => ‖(latticeTranslatedMap (d := d) f ℓ).restrict (ball (d := d))‖ := by refine ae_restrict_of_forall_mem (SchwartzMap.PoissonSummation.Standard.half_open_unit_cell_measurable (d := d)) ?_ intro x hx exact fourier_weighted_translate_norm_bound (d := d) (f := f) n ℓ x hx have hnonneg : (0 : (EuclideanSpace ℝ (Fin d)) → ℝ) ≤ᵐ[μ] fun x : (EuclideanSpace ℝ (Fin d)) => ‖UnitAddTorus.mFourier (-n) (PoissonSummation.Standard.euclideanTorusProjection (d := d) x) * f (x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ := ae_of_all _ (fun _ => by positivity) have hle' : (∫ x, ‖UnitAddTorus.mFourier (-n) (PoissonSummation.Standard.euclideanTorusProjection (d := d) x) * f (x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ ∂μ) ≤ μ.real Set.univ * ‖(latticeTranslatedMap (d := d) f ℓ).restrict (ball (d := d))‖ := by have hle : (∫ x, ‖UnitAddTorus.mFourier (-n) (PoissonSummation.Standard.euclideanTorusProjection (d := d) x) * f (x + (ℓ : (EuclideanSpace ℝ (Fin d))))‖ ∂μ) ≤ ∫ x, ‖(latticeTranslatedMap (d := d) f ℓ).restrict (ball (d := d))‖ ∂μ := integral_mono_of_nonneg hnonneg (integrable_const ‖(latticeTranslatedMap (d := d) f ℓ).restrict (ball (d := d))‖) hle_ae simpa [MeasureTheory.integral_const (μ := μ), smul_eq_mul, mul_comm] using! hle simpa [μ, s, mul_comm, mul_left_comm, mul_assoc] using! hle' lemma fourier_coefficient_torus_periodization (n : Fin d → ℤ) : UnitAddTorus.mFourierCoeff (torusDescendedPeriodization (d := d) f) n = 𝓕 (fun x : (EuclideanSpace ℝ (Fin d)) => f x) (SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n) := by let χ : (EuclideanSpace ℝ (Fin d)) → ℂ := fun x => UnitAddTorus.mFourier (-n) (PoissonSummation.Standard.euclideanTorusProjection (d := d) x) let G : (EuclideanSpace ℝ (Fin d)) → ℂ := fun x => χ x * f x have hχ_cont : Continuous χ := (UnitAddTorus.mFourier (-n)).continuous.comp (PoissonSummation.Standard.continuous_euclidean_torus_projection (d := d)) have hχ_norm (x : EuclideanSpace ℝ (Fin d)) : ‖χ x‖ ≤ 1 := by simpa [χ, UnitAddTorus.mFourier_norm (d := Fin d) (n := -n)] using! (ContinuousMap.norm_coe_le_norm (UnitAddTorus.mFourier (-n)) (PoissonSummation.Standard.euclideanTorusProjection (d := d) x)) have hG_int : Integrable G (volume : Measure (EuclideanSpace ℝ (Fin d))) := by refine f.integrable.norm.mono' (hχ_cont.mul f.continuous).aestronglyMeasurable ?_ filter_upwards [] with x change ‖χ x * f x‖ ≤ ‖f x‖ calc ‖χ x * f x‖ = ‖χ x‖ * ‖f x‖ := norm_mul _ _ _ ≤ 1 * ‖f x‖ := by gcongr; exact hχ_norm x _ = ‖f x‖ := one_mul _ have hχ_shift (ℓ : SchwartzMap.referenceIntegerLattice d) (x : EuclideanSpace ℝ (Fin d)) : χ (x + (ℓ : EuclideanSpace ℝ (Fin d))) = χ x := negative_character_invariant_under_lattice_shift (d := d) n ℓ x have htranslate (ℓ : SchwartzMap.referenceIntegerLattice d) : (∫ x in (fun y : EuclideanSpace ℝ (Fin d) => (ℓ : EuclideanSpace ℝ (Fin d)) + y) '' SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d), G x) = ∫ x in SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d), χ x * f (x + (ℓ : EuclideanSpace ℝ (Fin d))) := by let s : Set (EuclideanSpace ℝ (Fin d)) := SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d) let t : Set (EuclideanSpace ℝ (Fin d)) := (fun y : EuclideanSpace ℝ (Fin d) => (ℓ : EuclideanSpace ℝ (Fin d)) + y) '' s have hs : MeasurableSet s := SchwartzMap.PoissonSummation.Standard.half_open_unit_cell_measurable (d := d) have hls : MeasurableSet t := by have hpre : t = (fun x : EuclideanSpace ℝ (Fin d) => -(ℓ : EuclideanSpace ℝ (Fin d)) + x) ⁻¹' s := by ext x simp [t] rw [hpre] exact (continuous_const.add continuous_id).measurable hs have hmem (x : EuclideanSpace ℝ (Fin d)) : ((ℓ : EuclideanSpace ℝ (Fin d)) + x ∈ t) ↔ x ∈ s := by simp [t] calc (∫ x in t, G x) = ∫ x, t.indicator G x := (integral_indicator hls).symm _ = ∫ x, t.indicator G ((ℓ : EuclideanSpace ℝ (Fin d)) + x) := (integral_add_left_eq_self (t.indicator G) (ℓ : EuclideanSpace ℝ (Fin d))).symm _ = ∫ x, s.indicator (fun x : EuclideanSpace ℝ (Fin d) => G ((ℓ : EuclideanSpace ℝ (Fin d)) + x)) x := by apply integral_congr_ae filter_upwards [] with x by_cases hx : x ∈ s · simp [hx, (hmem x).2 hx] · simp [hx, mt (hmem x).1 hx] _ = ∫ x in s, G ((ℓ : EuclideanSpace ℝ (Fin d)) + x) := integral_indicator hs _ = ∫ x in s, χ x * f (x + (ℓ : EuclideanSpace ℝ (Fin d))) := by apply integral_congr_ae filter_upwards [] with x simp [G, add_comm, hχ_shift] have hglobal : (∫ x : EuclideanSpace ℝ (Fin d), G x) = ∑' ℓ : SchwartzMap.referenceIntegerLattice d, ∫ x in SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d), χ x * f (x + (ℓ : EuclideanSpace ℝ (Fin d))) := by rw [(half_open_cell_is_fundamental_region (d := d)).integral_eq_tsum G hG_int] apply tsum_congr intro ℓ change (∫ x in (fun y : EuclideanSpace ℝ (Fin d) => (ℓ : EuclideanSpace ℝ (Fin d)) + y) '' SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d), G x) = _ exact htranslate ℓ calc UnitAddTorus.mFourierCoeff (torusDescendedPeriodization (d := d) f) n = ∫ y : UnitAddTorus (Fin d), UnitAddTorus.mFourier (-n) y * torusDescendedPeriodization (d := d) f y := by rw [UnitAddTorus.mFourierCoeff_eq_integral (torusDescendedPeriodization (d := d) f) n (fun _ => 0)] have hset : {x : Fin d → ℝ | ∀ i, x i ∈ Set.Ioc (0 : ℝ) (0 + 1)} = Set.univ.pi (fun _ : Fin d => Set.Ioc (0 : ℝ) (0 + 1)) := by ext x simp rw [hset] simpa [UnitAddTorus.coordinateTorusProjection, smul_eq_mul] using! (UnitAddTorus.torus_integral_eq_coordinate_cell_integral (n := d) (t := 0) (fun y : UnitAddTorus (Fin d) => UnitAddTorus.mFourier (-n) y * torusDescendedPeriodization (d := d) f y) (((UnitAddTorus.mFourier (-n)).continuous.mul (torusDescendedPeriodization (d := d) f).continuous).aestronglyMeasurable)).symm _ = ∫ x in SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d), χ x * latticePeriodizedMap (d := d) f x := by rw [torus_integral_eq_euclidean_cell_integral (fun y : UnitAddTorus (Fin d) => UnitAddTorus.mFourier (-n) y * torusDescendedPeriodization (d := d) f y) (((UnitAddTorus.mFourier (-n)).continuous.mul (torusDescendedPeriodization (d := d) f).continuous).aestronglyMeasurable)] apply integral_congr_ae filter_upwards [] with x simp [χ, torus_descended_periodization_comp_projection] _ = ∫ x in SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d), ∑' ℓ : SchwartzMap.referenceIntegerLattice d, χ x * f (x + (ℓ : EuclideanSpace ℝ (Fin d))) := by apply integral_congr_ae filter_upwards [] with x rw [lattice_periodized_map_apply] exact tsum_mul_left.symm _ = ∑' ℓ : SchwartzMap.referenceIntegerLattice d, ∫ x in SchwartzMap.PoissonSummation.Standard.halfOpenUnitCell (d := d), χ x * f (x + (ℓ : EuclideanSpace ℝ (Fin d))) := by exact (integral_tsum_of_summable_integral_norm (fun ℓ => fourier_character_translate_integrable_on_cell (d := d) f n ℓ) (summable_cell_integrals_of_weighted_translates (d := d) f n)).symm _ = ∫ x : EuclideanSpace ℝ (Fin d), G x := hglobal.symm _ = 𝓕 (fun x : EuclideanSpace ℝ (Fin d) => f x) (SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n) := by rw [Real.fourier_eq'] apply integral_congr_ae filter_upwards [] with x simp only [G, χ, negative_fourier_character_projection, Real.fourierChar_apply, smul_eq_mul] congr 1 push_cast ring_nf lemma summable_fourier_coefficients_torus_periodization : Summable (UnitAddTorus.mFourierCoeff (torusDescendedPeriodization (d := d) f)) := by have hsum_norm : Summable (fun n : Fin d → ℤ => ‖𝓕 (fun x : (EuclideanSpace ℝ (Fin d)) => f x) (SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n)‖) := by let k : ℕ := d + 1 have hk : Module.finrank ℤ (SchwartzMap.referenceIntegerLattice d) < k := by have hrank : Module.finrank ℤ (SchwartzMap.referenceIntegerLattice d) = d := by have h := (ZLattice.rank (K := ℝ) (L := (SchwartzMap.referenceIntegerLattice d))) simpa using! (h.trans (by simp)) simp [hrank, k] obtain ⟨C, hCpos, hC⟩ := (FourierTransform.fourierCLE ℂ (SchwartzMap (EuclideanSpace ℝ (Fin d)) ℂ) f).decay k 0 have hC' : ∀ x : (EuclideanSpace ℝ (Fin d)), ‖x‖ ^ k * ‖𝓕 (fun y : (EuclideanSpace ℝ (Fin d)) => f y) x‖ ≤ C := by simpa [FourierTransform.fourierCLE_apply, fourier_coe, norm_iteratedFDeriv_zero] using! hC have hsum_pow : Summable (fun ℓ : (SchwartzMap.referenceIntegerLattice d) => (‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖⁻¹ ^ k : ℝ)) := by simpa [k] using! (ZLattice.summable_norm_pow_inv (L := (SchwartzMap.referenceIntegerLattice d)) (n := k) hk) have hsum_bd : Summable (fun ℓ : (SchwartzMap.referenceIntegerLattice d) => (C : ℝ) * (‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖⁻¹ ^ k)) := hsum_pow.mul_left C have hsum_lattice : Summable (fun ℓ : (SchwartzMap.referenceIntegerLattice d) => ‖𝓕 (fun y : (EuclideanSpace ℝ (Fin d)) => f y) (ℓ : (EuclideanSpace ℝ (Fin d)))‖) := by have hfin : ({ℓ : (SchwartzMap.referenceIntegerLattice d) | ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖ ≤ (1 : ℝ)} : Set _).Finite := finite_reference_lattice_points_of_norm_bound (d := d) 1 refine Summable.of_norm_bounded_eventually hsum_bd ?_ filter_upwards [hfin.compl_mem_cofinite] with ℓ hℓ have hnorm_gt : (1 : ℝ) < ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖ := lt_of_not_ge (by simpa using! hℓ) have hnorm_pos : 0 < ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖ := lt_trans (by positivity) hnorm_gt have hpow_pos : 0 < ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖ ^ k := pow_pos hnorm_pos _ have hmain := hC' (ℓ : (EuclideanSpace ℝ (Fin d))) have : ‖𝓕 (fun y : (EuclideanSpace ℝ (Fin d)) => f y) (ℓ : (EuclideanSpace ℝ (Fin d)))‖ ≤ C / (‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖ ^ k) := (le_div_iff₀' hpow_pos).2 hmain have hdiv : ‖𝓕 (fun y : (EuclideanSpace ℝ (Fin d)) => f y) (ℓ : (EuclideanSpace ℝ (Fin d)))‖ ≤ (C : ℝ) * (‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖⁻¹ ^ k) := by simpa [div_eq_mul_inv, inv_pow, one_div] using! this simpa [Real.norm_of_nonneg (norm_nonneg _)] using! hdiv let e := (PoissonSummation.Standard.integerVectorLatticeEquiv (d := d)) have : Summable (fun n : Fin d → ℤ => ‖𝓕 (fun y : (EuclideanSpace ℝ (Fin d)) => f y) ((e n : (SchwartzMap.referenceIntegerLattice d)) : (EuclideanSpace ℝ (Fin d)))‖) := by simpa using! (Summable.comp_injective hsum_lattice e.injective) simpa [PoissonSummation.Standard.integerVectorLatticeEquiv] using! this refine (Summable.of_norm ?_) simpa [fourier_coefficient_torus_periodization (d := d) (f := f)] using! hsum_norm theorem reference_lattice_poisson_formula (v : (EuclideanSpace ℝ (Fin d))) : (∑' ℓ : (SchwartzMap.referenceIntegerLattice d), f (v + (ℓ : (EuclideanSpace ℝ (Fin d))))) = ∑' n : Fin d → ℤ, (𝓕 (fun x : (EuclideanSpace ℝ (Fin d)) => f x) (SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n)) * Complex.exp (2 * Real.pi * Complex.I * ⟪v, SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n⟫_[ℝ]) := by simpa [torus_descended_periodization_comp_projection (d := d) (f := f) v, lattice_periodized_map_apply (d := d) (f := f), smul_eq_mul, fourier_coefficient_torus_periodization (d := d) (f := f), fourier_character_projection_exponential (d := d), mul_assoc, mul_left_comm, mul_comm] using! (UnitAddTorus.hasSum_mFourier_series_apply_of_summable (f := torusDescendedPeriodization (d := d) f) (summable_fourier_coefficients_torus_periodization (d := d) (f := f)) (euclideanTorusProjection (d := d) v)).tsum_eq.symm end SchwartzMap.PoissonSummation.Standard end section open scoped BigOperators FourierTransform Real open MeasureTheory Module namespace SchwartzMap variable {d : ℕ} noncomputable abbrev polarIntegerLattice (L : Submodule ℤ (EuclideanSpace ℝ (Fin d))) : Submodule ℤ (EuclideanSpace ℝ (Fin d)) := LinearMap.BilinForm.dualSubmodule (B := (innerₗ (EuclideanSpace ℝ (Fin d)) : LinearMap.BilinForm ℝ (EuclideanSpace ℝ (Fin d)))) L noncomputable def integralLatticeCoordinateBasis (L : Submodule ℤ (EuclideanSpace ℝ (Fin d))) [DiscreteTopology L] [IsZLattice ℝ L] : Basis (Fin d) ℤ L := by haveI : Module.Free ℤ L := by infer_instance haveI : Module.Finite ℤ L := ZLattice.module_finite ℝ L let b₀ := Module.Free.chooseBasis ℤ L have hfinrank : Module.finrank ℤ L = d := by have hE : Module.finrank ℝ (EuclideanSpace ℝ (Fin d)) = d := by simp exact (ZLattice.rank (K := ℝ) (L := L)).trans hE let e : Module.Free.ChooseBasisIndex ℤ L ≃ Fin d := Fintype.equivOfCardEq (by simpa [hfinrank] using! (Module.finrank_eq_card_chooseBasisIndex (R := ℤ) (M := L)).symm) exact b₀.reindex e noncomputable def realLatticeCoordinateBasis (L : Submodule ℤ (EuclideanSpace ℝ (Fin d))) [DiscreteTopology L] [IsZLattice ℝ L] : Basis (Fin d) ℝ (EuclideanSpace ℝ (Fin d)) := (integralLatticeCoordinateBasis (d := d) L).ofZLatticeBasis ℝ L noncomputable def referenceEuclideanBasis : Basis (Fin d) ℝ (EuclideanSpace ℝ (Fin d)) := (EuclideanSpace.basisFun (Fin d) ℝ).toBasis noncomputable def latticeCoordinateEquiv (L : Submodule ℤ (EuclideanSpace ℝ (Fin d))) [DiscreteTopology L] [IsZLattice ℝ L] : (EuclideanSpace ℝ (Fin d)) ≃ₗ[ℝ] (EuclideanSpace ℝ (Fin d)) := (referenceEuclideanBasis (d := d)).equiv (realLatticeCoordinateBasis (d := d) L) (Equiv.refl (Fin d)) @[simp] lemma lattice_coordinate_equiv_apply_reference_basis (L : Submodule ℤ (EuclideanSpace ℝ (Fin d))) [DiscreteTopology L] [IsZLattice ℝ L] (i : Fin d) : (latticeCoordinateEquiv (d := d) L) ((referenceEuclideanBasis (d := d)) i) = (realLatticeCoordinateBasis (d := d) L) i := by simpa [latticeCoordinateEquiv, referenceEuclideanBasis, realLatticeCoordinateBasis] using! (Basis.equiv_apply (b := referenceEuclideanBasis (d := d)) (b' := realLatticeCoordinateBasis (d := d) L) (e := Equiv.refl _) (i := i)) lemma coordinate_transport_maps_reference_lattice (L : Submodule ℤ (EuclideanSpace ℝ (Fin d))) [DiscreteTopology L] [IsZLattice ℝ L] : Submodule.map ((latticeCoordinateEquiv (d := d) L).toLinearMap.restrictScalars ℤ) (SchwartzMap.referenceIntegerLattice d) = L := by have hspan : Submodule.span ℤ (Set.range (realLatticeCoordinateBasis (d := d) L)) = L := by simpa [realLatticeCoordinateBasis] using! (Module.Basis.ofZLatticeBasis_span (K := ℝ) (L := L) (b := integralLatticeCoordinateBasis (d := d) L)) have himage : (fun a : (EuclideanSpace ℝ (Fin d)) => (latticeCoordinateEquiv (d := d) L) a) '' (Set.range (referenceEuclideanBasis (d := d))) = Set.range (realLatticeCoordinateBasis (d := d) L) := by have hfun : (fun a : (EuclideanSpace ℝ (Fin d)) => (latticeCoordinateEquiv (d := d) L) a) ∘ referenceEuclideanBasis (d := d) = realLatticeCoordinateBasis (d := d) L := by funext i simp [Function.comp] simpa [hfun] using! (Set.range_comp (g := fun a : (EuclideanSpace ℝ (Fin d)) => (latticeCoordinateEquiv (d := d) L) a) (f := referenceEuclideanBasis (d := d))).symm calc Submodule.map ((latticeCoordinateEquiv (d := d) L).toLinearMap.restrictScalars ℤ) (SchwartzMap.referenceIntegerLattice d) = Submodule.span ℤ ((fun a : (EuclideanSpace ℝ (Fin d)) => (latticeCoordinateEquiv (d := d) L) a) '' Set.range (referenceEuclideanBasis (d := d))) := by simp [SchwartzMap.referenceIntegerLattice, referenceEuclideanBasis, Submodule.map_span] _ = Submodule.span ℤ (Set.range (realLatticeCoordinateBasis (d := d) L)) := by simp [himage] _ = L := by simp [hspan] section FundamentalDomain lemma reference_basis_fundamental_region_volume : (volume : Measure (EuclideanSpace ℝ (Fin d))).real (ZSpan.fundamentalDomain ((EuclideanSpace.basisFun (Fin d) ℝ).toBasis)) = 1 := by have hdomain : ZSpan.fundamentalDomain ((EuclideanSpace.basisFun (Fin d) ℝ).toBasis) = axisAlignedCell (d := d) 1 := by ext x simp [ZSpan.mem_fundamentalDomain, axisAlignedCell] rw [Measure.real, hdomain, PeriodicConstant.axis_cell_volume_formula] norm_num end FundamentalDomain section CovolumeDet variable (L : Submodule ℤ (EuclideanSpace ℝ (Fin d))) [DiscreteTopology L] [IsZLattice ℝ L] lemma lattice_covolume_eq_coordinate_determinant : ZLattice.covolume L = abs ((LinearMap.det : ((EuclideanSpace ℝ (Fin d)) →ₗ[ℝ] (EuclideanSpace ℝ (Fin d))) →* ℝ) ((latticeCoordinateEquiv L).toLinearMap)) := by let bZ : Basis (Fin d) ℤ L := integralLatticeCoordinateBasis L have hdet : (referenceEuclideanBasis (d := d)).det (fun i : Fin d => (bZ i : (EuclideanSpace ℝ (Fin d)))) = (LinearMap.det : ((EuclideanSpace ℝ (Fin d)) →ₗ[ℝ] (EuclideanSpace ℝ (Fin d))) →* ℝ) ((latticeCoordinateEquiv L).toLinearMap) := by have hdetA : (LinearMap.det : ((EuclideanSpace ℝ (Fin d)) →ₗ[ℝ] (EuclideanSpace ℝ (Fin d))) →* ℝ) ((latticeCoordinateEquiv L).toLinearMap) = (referenceEuclideanBasis (d := d)).det (realLatticeCoordinateBasis (d := d) L) := by simp [latticeCoordinateEquiv, referenceEuclideanBasis] have hr : realLatticeCoordinateBasis (d := d) L = fun i : Fin d => (bZ i : (EuclideanSpace ℝ (Fin d))) := by funext i simp [realLatticeCoordinateBasis, bZ] exact (congrArg ((referenceEuclideanBasis (d := d)).det) hr.symm).trans hdetA.symm have hcovol : ZLattice.covolume L = |(referenceEuclideanBasis (d := d)).det (fun i : Fin d => (bZ i : (EuclideanSpace ℝ (Fin d))))| := by simpa [referenceEuclideanBasis, reference_basis_fundamental_region_volume (d := d)] using! (ZLattice.covolume_eq_det_mul_measureReal (L := L) (b := bZ) (b₀ := referenceEuclideanBasis (d := d)) (μ := (volume : Measure (EuclideanSpace ℝ (Fin d))))) simp [hcovol, hdet] end CovolumeDet section PoissonSummationLattices variable (L : Submodule ℤ (EuclideanSpace ℝ (Fin d))) [DiscreteTopology L] [IsZLattice ℝ L] noncomputable def latticeCoordinateTransport : (EuclideanSpace ℝ (Fin d)) ≃ₗ[ℝ] (EuclideanSpace ℝ (Fin d)) := latticeCoordinateEquiv (d := d) L noncomputable def dualCoordinateTransport : (EuclideanSpace ℝ (Fin d)) →ₗ[ℝ] (EuclideanSpace ℝ (Fin d)) := ((latticeCoordinateTransport (d := d) (L := L)).symm.toLinearMap).adjoint noncomputable def latticeCoordinateAdjoint : (EuclideanSpace ℝ (Fin d)) →ₗ[ℝ] (EuclideanSpace ℝ (Fin d)) := ((latticeCoordinateTransport (d := d) (L := L)).toLinearMap).adjoint noncomputable def referenceLatticeCoordinateEquiv : SchwartzMap.referenceIntegerLattice d ≃ₗ[ℤ] L := (LinearEquiv.restrictScalars ℤ (latticeCoordinateTransport (d := d) (L := L))).ofSubmodules (SchwartzMap.referenceIntegerLattice d) L (by simpa [LinearEquiv.restrictScalars_apply] using! (coordinate_transport_maps_reference_lattice (d := d) L)) @[simp] lemma reference_lattice_coordinate_equiv_apply (x : SchwartzMap.referenceIntegerLattice d) : ((referenceLatticeCoordinateEquiv (d := d) L x : L) : (EuclideanSpace ℝ (Fin d))) = (latticeCoordinateTransport (d := d) (L := L)) x := by simp [referenceLatticeCoordinateEquiv] lemma dual_transport_comp_coordinate_adjoint : (dualCoordinateTransport (d := d) L ∘ₗ latticeCoordinateAdjoint (d := d) L) = (LinearMap.id : (EuclideanSpace ℝ (Fin d)) →ₗ[ℝ] (EuclideanSpace ℝ (Fin d))) := by let Amap : (EuclideanSpace ℝ (Fin d)) →ₗ[ℝ] (EuclideanSpace ℝ (Fin d)) := (latticeCoordinateTransport (d := d) (L := L)).toLinearMap let Bmap : (EuclideanSpace ℝ (Fin d)) →ₗ[ℝ] (EuclideanSpace ℝ (Fin d)) := (latticeCoordinateTransport (d := d) (L := L)).symm.toLinearMap have hcomp : Amap ∘ₗ Bmap = (LinearMap.id : (EuclideanSpace ℝ (Fin d)) →ₗ[ℝ] (EuclideanSpace ℝ (Fin d))) := by ext x simp [Amap, Bmap] calc dualCoordinateTransport (d := d) L ∘ₗ latticeCoordinateAdjoint (d := d) L = Bmap.adjoint ∘ₗ Amap.adjoint := by simp [dualCoordinateTransport, latticeCoordinateAdjoint, Amap, Bmap] _ = (Amap ∘ₗ Bmap).adjoint := by exact (LinearMap.adjoint_comp Amap Bmap).symm _ = (LinearMap.id : (EuclideanSpace ℝ (Fin d)) →ₗ[ℝ] (EuclideanSpace ℝ (Fin d))) := by simp [hcomp] lemma coordinate_adjoint_comp_dual_transport : (latticeCoordinateAdjoint (d := d) L ∘ₗ dualCoordinateTransport (d := d) L) = (LinearMap.id : (EuclideanSpace ℝ (Fin d)) →ₗ[ℝ] (EuclideanSpace ℝ (Fin d))) := by let Amap : (EuclideanSpace ℝ (Fin d)) →ₗ[ℝ] (EuclideanSpace ℝ (Fin d)) := (latticeCoordinateTransport (d := d) (L := L)).toLinearMap let Bmap : (EuclideanSpace ℝ (Fin d)) →ₗ[ℝ] (EuclideanSpace ℝ (Fin d)) := (latticeCoordinateTransport (d := d) (L := L)).symm.toLinearMap have hcomp : Bmap ∘ₗ Amap = (LinearMap.id : (EuclideanSpace ℝ (Fin d)) →ₗ[ℝ] (EuclideanSpace ℝ (Fin d))) := by ext x simp [Amap, Bmap] calc latticeCoordinateAdjoint (d := d) L ∘ₗ dualCoordinateTransport (d := d) L = Amap.adjoint ∘ₗ Bmap.adjoint := by simp [dualCoordinateTransport, latticeCoordinateAdjoint, Amap, Bmap] _ = (Bmap ∘ₗ Amap).adjoint := by exact (LinearMap.adjoint_comp Bmap Amap).symm _ = (LinearMap.id : (EuclideanSpace ℝ (Fin d)) →ₗ[ℝ] (EuclideanSpace ℝ (Fin d))) := by simp [hcomp] noncomputable def dualAdjointCoordinateEquiv : (EuclideanSpace ℝ (Fin d)) ≃ₗ[ℝ] (EuclideanSpace ℝ (Fin d)) := { toLinearMap := dualCoordinateTransport (d := d) L invFun := latticeCoordinateAdjoint (d := d) L left_inv := by intro x have h := coordinate_adjoint_comp_dual_transport (d := d) (L := L) simpa using! congrArg (fun f : (EuclideanSpace ℝ (Fin d)) →ₗ[ℝ] (EuclideanSpace ℝ (Fin d)) => f x) h right_inv := by intro x have h := dual_transport_comp_coordinate_adjoint (d := d) (L := L) simpa using! congrArg (fun f : (EuclideanSpace ℝ (Fin d)) →ₗ[ℝ] (EuclideanSpace ℝ (Fin d)) => f x) h } lemma dual_coordinate_transport_maps_reference_lattice : Submodule.map ((dualCoordinateTransport (d := d) L).restrictScalars ℤ) (referenceIntegerLattice d) = polarIntegerLattice (d := d) L := by ext x have hdualStd : polarIntegerLattice (d := d) (referenceIntegerLattice d) = referenceIntegerLattice d := by simpa [polarIntegerLattice] using! (PoissonSummation.Standard.reference_lattice_dual_self (d := d)) constructor · rintro ⟨y, hy, rfl⟩ intro z hz rcases (show (z : (EuclideanSpace ℝ (Fin d))) ∈ Submodule.map ((latticeCoordinateTransport (d := d) L).toLinearMap.restrictScalars ℤ) (referenceIntegerLattice d) by simpa [latticeCoordinateTransport, coordinate_transport_maps_reference_lattice (d := d) L] using! hz) with ⟨w, hw, rfl⟩ have hydual : y ∈ polarIntegerLattice (d := d) (referenceIntegerLattice d) := by simpa [hdualStd] using! hy have hinter : inner ℝ ((dualCoordinateTransport (d := d) L) y) ((latticeCoordinateTransport (d := d) (L := L)) w) = inner ℝ y w := by simpa [dualCoordinateTransport, latticeCoordinateTransport] using! (LinearMap.adjoint_inner_left ((latticeCoordinateTransport (d := d) (L := L)).symm.toLinearMap) ((latticeCoordinateTransport (d := d) (L := L)) w) y) simpa [polarIntegerLattice, innerₗ_apply_apply, hinter] using! hydual w hw · intro hx refine ⟨(latticeCoordinateAdjoint (d := d) L) x, ?_, ?_⟩ · have hydual : (latticeCoordinateAdjoint (d := d) L) x ∈ polarIntegerLattice (d := d) (referenceIntegerLattice d) := by intro w hw have hwL : (latticeCoordinateTransport (d := d) (L := L)) w ∈ L := by have : (latticeCoordinateTransport (d := d) (L := L)) w ∈ Submodule.map (((latticeCoordinateTransport (d := d) (L := L)).toLinearMap).restrictScalars ℤ) (referenceIntegerLattice d) := ⟨w, hw, rfl⟩ simpa [latticeCoordinateTransport, coordinate_transport_maps_reference_lattice (d := d) L] using! this have hinner : inner ℝ ((latticeCoordinateAdjoint (d := d) L) x) w = inner ℝ x ((latticeCoordinateTransport (d := d) (L := L)) w) := by simpa [latticeCoordinateAdjoint, latticeCoordinateTransport] using! (LinearMap.adjoint_inner_left ((latticeCoordinateTransport (d := d) (L := L)).toLinearMap) w x) simpa [polarIntegerLattice, innerₗ_apply_apply, hinner] using! hx ((latticeCoordinateTransport (d := d) (L := L)) w) hwL simpa [hdualStd] using! hydual · have h := dual_transport_comp_coordinate_adjoint (d := d) (L := L) simpa using! congrArg (fun f : (EuclideanSpace ℝ (Fin d)) →ₗ[ℝ] (EuclideanSpace ℝ (Fin d)) => f x) h noncomputable def referenceLatticePolarEquiv : SchwartzMap.referenceIntegerLattice d ≃ₗ[ℤ] polarIntegerLattice (d := d) L := (LinearEquiv.restrictScalars ℤ (dualAdjointCoordinateEquiv (d := d) (L := L))).ofSubmodules (SchwartzMap.referenceIntegerLattice d) (polarIntegerLattice (d := d) L) (by simpa [LinearEquiv.restrictScalars_apply] using! (dual_coordinate_transport_maps_reference_lattice (d := d) (L := L))) noncomputable def integerVectorPolarLatticeEquiv : (Fin d → ℤ) ≃ polarIntegerLattice (d := d) L := (PoissonSummation.Standard.integerVectorLatticeEquiv (d := d)).trans (referenceLatticePolarEquiv (d := d) L).toEquiv @[simp] lemma reference_lattice_polar_equiv_apply (x : SchwartzMap.referenceIntegerLattice d) : ((referenceLatticePolarEquiv (d := d) L x : polarIntegerLattice (d := d) L) : (EuclideanSpace ℝ (Fin d))) = (dualCoordinateTransport (d := d) L) x := by simp [referenceLatticePolarEquiv, dualAdjointCoordinateEquiv] @[simp] lemma integer_vector_polar_equiv_coe (n : Fin d → ℤ) : ((integerVectorPolarLatticeEquiv (d := d) L n : polarIntegerLattice (d := d) L) : (EuclideanSpace ℝ (Fin d))) = (dualCoordinateTransport (d := d) L) (SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n) := by simp [integerVectorPolarLatticeEquiv, PoissonSummation.Standard.integerVectorLatticeEquiv] theorem integer_lattice_poisson_identity (f : SchwartzMap (EuclideanSpace ℝ (Fin d)) ℂ) (v : (EuclideanSpace ℝ (Fin d))) : (∑' ℓ : L, f (v + (ℓ : (EuclideanSpace ℝ (Fin d))))) = (1 / ZLattice.covolume L) * ∑' m : polarIntegerLattice (d := d) L, (𝓕 (fun x : (EuclideanSpace ℝ (Fin d)) => f x) m) * Complex.exp (2 * π * Complex.I * ⟪v, m⟫_[ℝ]) := by let A : (EuclideanSpace ℝ (Fin d)) ≃ₗ[ℝ] (EuclideanSpace ℝ (Fin d)) := latticeCoordinateTransport (d := d) (L := L) let g : SchwartzMap (EuclideanSpace ℝ (Fin d)) ℂ := SchwartzMap.compCLMOfContinuousLinearEquiv ℂ A.toContinuousLinearEquiv f have hstd := SchwartzMap.PoissonSummation.Standard.reference_lattice_poisson_formula (d := d) (f := g) (v := A.symm v) have hlhs : (∑' ℓ : SchwartzMap.referenceIntegerLattice d, g (A.symm v + (ℓ : (EuclideanSpace ℝ (Fin d))))) = ∑' ℓ : L, f (v + (ℓ : (EuclideanSpace ℝ (Fin d)))) := by calc (∑' ℓ : SchwartzMap.referenceIntegerLattice d, g (A.symm v + (ℓ : (EuclideanSpace ℝ (Fin d))))) = ∑' ℓ : SchwartzMap.referenceIntegerLattice d, f (v + A (ℓ : (EuclideanSpace ℝ (Fin d)))) := by refine tsum_congr fun ℓ ↦ ?_ simp [g, map_add] _ = ∑' ℓ : L, f (v + (ℓ : (EuclideanSpace ℝ (Fin d)))) := by simpa [reference_lattice_coordinate_equiv_apply] using! ((referenceLatticeCoordinateEquiv (d := d) L).toEquiv.tsum_eq (f := fun ℓ : L => f (v + (ℓ : (EuclideanSpace ℝ (Fin d)))))) have hrhs : (∑' n : Fin d → ℤ, (𝓕 (fun x : (EuclideanSpace ℝ (Fin d)) => g x) (SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n)) * Complex.exp (2 * π * Complex.I * ⟪A.symm v, SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n⟫_[ℝ])) = (1 / ZLattice.covolume L) * ∑' m : polarIntegerLattice (d := d) L, (𝓕 (fun x : (EuclideanSpace ℝ (Fin d)) => f x) m) * Complex.exp (2 * π * Complex.I * ⟪v, m⟫_[ℝ]) := by let F : polarIntegerLattice (d := d) L → ℂ := fun m => (𝓕 (fun x : (EuclideanSpace ℝ (Fin d)) => f x) m) * Complex.exp (2 * π * Complex.I * ⟪v, m⟫_[ℝ]) let detA : ℝ := (LinearMap.det : ((EuclideanSpace ℝ (Fin d)) →ₗ[ℝ] (EuclideanSpace ℝ (Fin d))) →* ℝ) (A : (EuclideanSpace ℝ (Fin d)) →ₗ[ℝ] (EuclideanSpace ℝ (Fin d))) let cC : ℂ := ((abs detA)⁻¹ : ℝ) have hfourier (w : (EuclideanSpace ℝ (Fin d))) : 𝓕 (fun x : (EuclideanSpace ℝ (Fin d)) => g x) w = cC * 𝓕 (fun x : (EuclideanSpace ℝ (Fin d)) => f x) ((dualCoordinateTransport (d := d) L) w) := by simpa [g, A, dualCoordinateTransport, detA, cC, Complex.real_smul] using! (SpherePacking.ForMathlib.Fourier.fourier_precompose_linear_equivalence (A := A) (f := fun x : (EuclideanSpace ℝ (Fin d)) => f x) w) have hexp (w : (EuclideanSpace ℝ (Fin d))) : Complex.exp (2 * π * Complex.I * ⟪A.symm v, w⟫_[ℝ]) = Complex.exp (2 * π * Complex.I * ⟪v, (dualCoordinateTransport (d := d) L) w⟫_[ℝ]) := by have hinner : ⟪A.symm v, w⟫_[ℝ] = ⟪v, (dualCoordinateTransport (d := d) L) w⟫_[ℝ] := by have : inner ℝ (A.symm v) w = inner ℝ v ((dualCoordinateTransport (d := d) L) w) := by simpa [A, dualCoordinateTransport] using! (LinearMap.adjoint_inner_right ((A.symm : (EuclideanSpace ℝ (Fin d)) ≃ₗ[ℝ] (EuclideanSpace ℝ (Fin d))).toLinearMap) v w).symm simpa [RCLike.inner_eq_wInner_one] using! this simp [hinner] have hdetC : cC = (1 / ZLattice.covolume L) := by have hcovol : ZLattice.covolume L = abs detA := by simpa [A, latticeCoordinateTransport, detA] using! (lattice_covolume_eq_coordinate_determinant (d := d) (L := L)) simp [cC, hcovol, one_div] have hsum : (∑' n : Fin d → ℤ, (𝓕 (fun x : (EuclideanSpace ℝ (Fin d)) => g x) (SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n)) * Complex.exp (2 * π * Complex.I * ⟪A.symm v, SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n⟫_[ℝ])) = cC * ∑' m : polarIntegerLattice (d := d) L, F m := by calc (∑' n : Fin d → ℤ, (𝓕 (fun x : (EuclideanSpace ℝ (Fin d)) => g x) (SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n)) * Complex.exp (2 * π * Complex.I * ⟪A.symm v, SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n⟫_[ℝ])) = ∑' n : Fin d → ℤ, cC * F (integerVectorPolarLatticeEquiv (d := d) L n) := by refine tsum_congr fun n ↦ ?_ simpa [F, mul_assoc] using! congrArg₂ (· * ·) (hfourier (w := SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n)) (hexp (w := SchwartzMap.PoissonSummation.Standard.embeddedIntegerVector (d := d) n)) _ = cC * ∑' n : Fin d → ℤ, F (integerVectorPolarLatticeEquiv (d := d) L n) := tsum_mul_left _ = cC * ∑' m : polarIntegerLattice (d := d) L, F m := by rw [(integerVectorPolarLatticeEquiv (d := d) L).tsum_eq] simp [hsum, hdetC, F] simpa [hlhs, hrhs] using! hstd end SchwartzMap.PoissonSummationLattices end section variable {d : ℕ} [Fact (0 < d)] variable (Λ : Submodule ℤ (EuclideanSpace ℝ (Fin d))) [DiscreteTopology Λ] [IsZLattice ℝ Λ] instance instNonemptyFinOfPositiveDimension : Nonempty (Fin d) := ⟨0, Fact.out⟩ noncomputable section open scoped BigOperators FourierTransform namespace SchwartzMap omit [Fact (0 < d)] in theorem latticePoissonSummationFormula (f : SchwartzMap (EuclideanSpace ℝ (Fin d)) ℂ) (v : EuclideanSpace ℝ (Fin d)) : ∑' ℓ : Λ, f (v + ℓ) = (1 / ZLattice.covolume Λ) * ∑' m : polarIntegerLattice (d := d) Λ, (𝓕 ⇑f m) * Complex.exp (2 * Real.pi * Complex.I * ⟪v, m⟫_[ℝ]) := by simpa using! (SchwartzMap.integer_lattice_poisson_identity (d := d) (L := Λ) f v) section FourierSchwartz variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [FiniteDimensional ℝ V] [MeasurableSpace V] [BorelSpace V] (f : 𝓢(V, E)) @[simp] theorem schwartz_fourier_inverse_identity : 𝓕⁻ (𝓕 ⇑f) = f := by simpa only [SchwartzMap.fourierInv_coe, SchwartzMap.fourier_coe] using congrArg (fun g : 𝓢(V, E) => (g : V → E)) (show (𝓕⁻ (𝓕 f : 𝓢(V, E)) : 𝓢(V, E)) = f from FourierTransform.fourierInv_fourier_eq f) end FourierSchwartz end SchwartzMap section Positivity_on_Nhd variable {E : Type*} [TopologicalSpace E] theorem Continuous.positive_iff_positive_on_neighborhood {f : E → ℝ} (hf₁ : Continuous f) (x : E) : 0 < f x ↔ ∃ U ∈ (nhds x), ∀ y ∈ U, 0 < f y := by constructor · intro hx refine ⟨{y | 0 < f y}, ?_, fun y hy => hy⟩ exact (isOpen_lt continuous_const hf₁).mem_nhds hx · rintro ⟨U, hU, hpos⟩ exact hpos x (mem_of_mem_nhds hU) open MeasureTheory variable [MeasureSpace E] [BorelSpace E] end Positivity_on_Nhd section Integration open MeasureTheory Filter variable {E : Type*} [NormedAddCommGroup E] variable [TopologicalSpace E] [IsTopologicalAddGroup E] [MeasureSpace E] [BorelSpace E] variable [(volume : Measure E).IsAddLeftInvariant] [(volume : Measure E).Regular] [NeZero (volume : Measure E)] instance : (volume : Measure E).IsOpenPosMeasure := isOpenPosMeasure_of_addLeftInvariant_of_regular theorem Continuous.nonnegative_integral_vanishes_iff_function_vanishes {f : E → ℝ} (hf₁ : Continuous f) (hf₂ : Integrable f) (hnn : ∀ x, 0 ≤ f x) : ∫ (v : E), f v = 0 ↔ f = 0 := by constructor · intro hzero funext x change f x = 0 by_contra hx have hopen : IsOpen (Function.support f) := by exact (isOpen_ne : IsOpen {y : ℝ | y ≠ 0}).preimage hf₁ have hmeasure : 0 < volume (Function.support f) := hopen.measure_pos volume ⟨x, hx⟩ have hpositive : 0 < ∫ v : E, f v := (integral_pos_iff_support_of_nonneg hnn hf₂).2 hmeasure linarith · intro hzero simp [hzero] end Integration section Misc instance : DecidableEq (EuclideanSpace ℝ (Fin d)) := inferInstance omit [Fact (0 < d)] theorem Complex.negative_imaginary_exponential_eq_conjugate (x m : EuclideanSpace ℝ (Fin d)) : Complex.exp (-(2 * (Real.pi : ℂ) * Complex.I * (⟪x, m⟫_[ℝ] : ℂ))) = (starRingEnd ℂ) (Complex.exp (2 * (Real.pi : ℂ) * Complex.I * (⟪x, m⟫_[ℝ] : ℂ))) := calc Complex.exp (-(2 * (Real.pi : ℂ) * Complex.I * (⟪x, m⟫_[ℝ] : ℂ))) = Circle.exp (-2 * Real.pi * ⟪x, m⟫_[ℝ]) := by rw [Circle.coe_exp] push_cast ring_nf _ = (starRingEnd ℂ) (Circle.exp (2 * Real.pi * ⟪x, m⟫_[ℝ])) := by rw [mul_assoc, neg_mul, ← mul_assoc, ← Circle.coe_inv_eq_conj, Circle.exp_neg] _ = (starRingEnd ℂ) (Complex.exp (2 * (Real.pi : ℂ) * Complex.I * (⟪x, m⟫_[ℝ] : ℂ))) := by rw [Circle.coe_exp] apply congrArg (starRingEnd ℂ) push_cast ring_nf end Misc end end section open scoped RealInnerProductSpace open Module namespace SpherePacking.CohnElkies variable {d : ℕ} instance (Λ : Submodule ℤ (EuclideanSpace ℝ (Fin d))) [DiscreteTopology Λ] [IsZLattice ℝ Λ] : DiscreteTopology (LinearMap.BilinForm.dualSubmodule (B := innerₗ (EuclideanSpace ℝ (Fin d))) Λ) := by let ι := Module.Free.ChooseBasisIndex ℤ Λ let bZ : Basis ι ℤ Λ := Module.Free.chooseBasis ℤ Λ let bR : Basis ι ℝ (EuclideanSpace ℝ (Fin d)) := bZ.ofZLatticeBasis ℝ Λ have hB : LinearMap.BilinForm.Nondegenerate (innerₗ (EuclideanSpace ℝ (Fin d)) : LinearMap.BilinForm ℝ (EuclideanSpace ℝ (Fin d))) := by constructor <;> intro x hx all_goals have : ⟪x, x⟫ = (0 : ℝ) := by simpa [innerₗ_apply_apply] using! hx x exact inner_self_eq_zero.1 this have hdual : LinearMap.BilinForm.dualSubmodule (B := innerₗ (EuclideanSpace ℝ (Fin d))) Λ = Submodule.span ℤ (Set.range (LinearMap.BilinForm.dualBasis (B := innerₗ (EuclideanSpace ℝ (Fin d))) hB bR)) := by simpa [bR, bZ.ofZLatticeBasis_span (K := ℝ) (L := Λ)] using! (LinearMap.BilinForm.dualSubmodule_span_of_basis (B := innerₗ (EuclideanSpace ℝ (Fin d))) (R := ℤ) (S := ℝ) (M := EuclideanSpace ℝ (Fin d)) hB bR) exact hdual ▸ (inferInstance : DiscreteTopology (Submodule.span ℤ (Set.range (LinearMap.BilinForm.dualBasis (B := innerₗ (EuclideanSpace ℝ (Fin d))) hB bR)))) end SpherePacking.CohnElkies end section open scoped SchwartzMap open scoped FourierTransform open BigOperators namespace SpherePacking.CohnElkies variable {d : ℕ} namespace LPBoundAux section ZLatticeSummability variable (Λ : Submodule ℤ (EuclideanSpace ℝ (Fin d))) [DiscreteTopology Λ] lemma summable_norm_on_translated_integral_lattice (f : 𝓢(EuclideanSpace ℝ (Fin d), ℂ)) (a : EuclideanSpace ℝ (Fin d)) : Summable (fun ℓ : Λ => ‖f (a + (ℓ : EuclideanSpace ℝ (Fin d)))‖) := by let k : ℕ := Module.finrank ℤ Λ + 1 obtain ⟨C, hCpos, hC⟩ := f.decay k 0 have hdecay : ∀ x : EuclideanSpace ℝ (Fin d), ‖x‖ ^ k * ‖f x‖ ≤ C := by simpa [norm_iteratedFDeriv_zero] using! hC let R : ℝ := max (2 * ‖a‖) 1 have hfinite : ({ℓ : Λ | ‖(ℓ : EuclideanSpace ℝ (Fin d))‖ ≤ R} : Set Λ).Finite := by haveI : DiscreteTopology Λ.toAddSubgroup := (inferInstance : DiscreteTopology Λ) have hfiniteAmbient : (Metric.closedBall (0 : EuclideanSpace ℝ (Fin d)) R ∩ (Λ.toAddSubgroup : Set (EuclideanSpace ℝ (Fin d)))).Finite := Metric.finite_isBounded_inter_isClosed DiscreteTopology.isDiscrete Metric.isBounded_closedBall AddSubgroup.isClosed_of_discrete let e : Λ ↪ EuclideanSpace ℝ (Fin d) := ⟨fun ℓ => (ℓ : EuclideanSpace ℝ (Fin d)), Subtype.coe_injective⟩ have hpreimage : (e ⁻¹' (Metric.closedBall (0 : EuclideanSpace ℝ (Fin d)) R ∩ (Λ : Set (EuclideanSpace ℝ (Fin d))))).Finite := by apply Set.Finite.preimage_embedding e simpa [Submodule.coe_toAddSubgroup] using! hfiniteAmbient have hset : e ⁻¹' (Metric.closedBall (0 : EuclideanSpace ℝ (Fin d)) R ∩ (Λ : Set (EuclideanSpace ℝ (Fin d)))) = {ℓ : Λ | ‖(ℓ : EuclideanSpace ℝ (Fin d))‖ ≤ R} := by ext ℓ simp [e, Metric.mem_closedBall, dist_eq_norm] simpa [hset] using! hpreimage have hsumPow : Summable (fun ℓ : Λ => (‖(ℓ : EuclideanSpace ℝ (Fin d))‖⁻¹ ^ k : ℝ)) := by simpa [k] using! (ZLattice.summable_norm_pow_inv (L := Λ) (n := k) (Nat.lt_succ_self (Module.finrank ℤ Λ))) have hsumBound : Summable (fun ℓ : Λ => (C * (2 ^ k : ℝ)) * (‖(ℓ : EuclideanSpace ℝ (Fin d))‖⁻¹ ^ k)) := hsumPow.mul_left (C * (2 ^ k : ℝ)) refine Summable.of_norm_bounded_eventually hsumBound ?_ filter_upwards [hfinite.eventually_cofinite_notMem] with ℓ hℓ have hR : R < ‖(ℓ : EuclideanSpace ℝ (Fin d))‖ := lt_of_not_ge (by simpa using! hℓ) have hlarge : 2 * ‖a‖ < ‖(ℓ : EuclideanSpace ℝ (Fin d))‖ := lt_of_le_of_lt (le_max_left _ _) hR have hpositive : 0 < ‖(ℓ : EuclideanSpace ℝ (Fin d))‖ := lt_of_lt_of_le zero_lt_one ((le_max_right _ _).trans hR.le) have htranslate : (1 / 2 : ℝ) * ‖(ℓ : EuclideanSpace ℝ (Fin d))‖ ≤ ‖a + (ℓ : EuclideanSpace ℝ (Fin d))‖ := by have htriangle : ‖(ℓ : EuclideanSpace ℝ (Fin d))‖ - ‖a‖ ≤ ‖a + (ℓ : EuclideanSpace ℝ (Fin d))‖ := by simpa [add_comm] using! (norm_sub_norm_le (ℓ : EuclideanSpace ℝ (Fin d)) (-a)) nlinarith have htranslatePositive : 0 < ‖a + (ℓ : EuclideanSpace ℝ (Fin d))‖ := (mul_pos (by norm_num : (0 : ℝ) < 1 / 2) hpositive).trans_le htranslate have hpowPositive : 0 < ‖a + (ℓ : EuclideanSpace ℝ (Fin d))‖ ^ k := pow_pos htranslatePositive _ have hbound : ‖f (a + (ℓ : EuclideanSpace ℝ (Fin d)))‖ ≤ C / ‖a + (ℓ : EuclideanSpace ℝ (Fin d))‖ ^ k := (le_div_iff₀' hpowPositive).2 (hdecay (a + (ℓ : EuclideanSpace ℝ (Fin d)))) have hpower : ((1 / 2 : ℝ) * ‖(ℓ : EuclideanSpace ℝ (Fin d))‖) ^ k ≤ ‖a + (ℓ : EuclideanSpace ℝ (Fin d))‖ ^ k := pow_le_pow_left₀ (by positivity) htranslate _ have hsourcePositive : 0 < ((1 / 2 : ℝ) * ‖(ℓ : EuclideanSpace ℝ (Fin d))‖) ^ k := pow_pos (mul_pos (by norm_num : (0 : ℝ) < 1 / 2) hpositive) _ have hinverse : (‖a + (ℓ : EuclideanSpace ℝ (Fin d))‖ ^ k)⁻¹ ≤ (2 ^ k : ℝ) * (‖(ℓ : EuclideanSpace ℝ (Fin d))‖⁻¹ ^ k) := by have h := one_div_le_one_div_of_le hsourcePositive hpower simpa [one_div, mul_pow, mul_inv_rev, inv_pow, mul_assoc, mul_comm] using! h have hfinal := (mul_le_mul_of_nonneg_left hinverse hCpos.le) have hresult : ‖f (a + (ℓ : EuclideanSpace ℝ (Fin d)))‖ ≤ (C * (2 ^ k : ℝ)) * (‖(ℓ : EuclideanSpace ℝ (Fin d))‖⁻¹ ^ k) := by calc ‖f (a + (ℓ : EuclideanSpace ℝ (Fin d)))‖ ≤ C / ‖a + (ℓ : EuclideanSpace ℝ (Fin d))‖ ^ k := hbound _ ≤ (C * (2 ^ k : ℝ)) * (‖(ℓ : EuclideanSpace ℝ (Fin d))‖⁻¹ ^ k) := by simpa [div_eq_mul_inv, mul_assoc] using! hfinal simpa [Real.norm_of_nonneg (norm_nonneg _)] using! hresult end SpherePacking.CohnElkies.LPBoundAux.ZLatticeSummability end section open scoped Real open scoped SchwartzMap FourierTransform namespace SpherePacking.CohnElkies noncomputable def centerFourierExponentialSum {d : ℕ} (P : PeriodicSpherePacking d) (D : Set (EuclideanSpace ℝ (Fin d))) : ↥(SchwartzMap.polarIntegerLattice (d := d) P.lattice) → ℂ := fun m => ∑' x : ↑(P.centers ∩ D), Complex.exp (2 * π * Complex.I * ⟪(x : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ]) lemma origin_character_sum_norm_sq_eq_orbit_count_sq {d : ℕ} (P : PeriodicSpherePacking d) {D : Set (EuclideanSpace ℝ (Fin d))} (hd : 0 < d) (hD_isBounded : Bornology.IsBounded D) : norm (∑' x : ↑(P.centers ∩ D), Complex.exp (2 * π * Complex.I * ⟪(x : EuclideanSpace ℝ (Fin d)), (0 : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) ^ 2 = (P.boundedCenterRepresentativeCount hd hD_isBounded : ℝ) ^ 2 := by letI := P.instFintypeBoundedCenterRepresentatives hd hD_isBounded simp [PeriodicSpherePacking.boundedCenterRepresentativeCount] lemma inverse_product_rearrangement {α : Type*} [DivisionCommMonoid α] (c a b : α) : (1 / c) * a * b = b * a / c := by simp [div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm] lemma nonnegative_weighted_nonzero_frequency_sum {d : ℕ} (f : 𝓢(EuclideanSpace ℝ (Fin d), ℂ)) (P : PeriodicSpherePacking d) (D : Set (EuclideanSpace ℝ (Fin d))) (hCohnElkies₂ : ∀ x : EuclideanSpace ℝ (Fin d), (𝓕 f x).re ≥ 0) : 0 ≤ ∑' m : ↥(SchwartzMap.polarIntegerLattice (d := d) P.lattice), (if m = (0 : ↥(SchwartzMap.polarIntegerLattice (d := d) P.lattice)) then 0 else (𝓕 ⇑f m).re * (norm (∑' x : ↑(P.centers ∩ D), Complex.exp (2 * π * Complex.I * ⟪(x : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) ^ 2)) := by refine tsum_nonneg (fun m => ?_) by_cases hm : m = (0 : ↥(SchwartzMap.polarIntegerLattice (d := d) P.lattice)) · simp [hm] · have hf : 0 ≤ (𝓕 ⇑f m).re := by simpa using! hCohnElkies₂ (m : EuclideanSpace ℝ (Fin d)) simpa [centerFourierExponentialSum, hm] using! (mul_nonneg hf (sq_nonneg (norm (centerFourierExponentialSum P D m)))) end SpherePacking.CohnElkies end section open scoped BigOperators FourierTransform SchwartzMap Real open Complex MeasureTheory namespace SpherePacking.CohnElkies variable {d : ℕ} lemma packing_spectral_sum_exchange (f : 𝓢(EuclideanSpace ℝ (Fin d), ℂ)) (hRealFourier : ∀ x : EuclideanSpace ℝ (Fin d), (((𝓕 f) x).re : ℂ) = (𝓕 f) x) (P : PeriodicSpherePacking d) {D : Set (EuclideanSpace ℝ (Fin d))} (hD_isBounded : Bornology.IsBounded D) (hd : 0 < d) : (∑' x : ↑(P.centers ∩ D), ∑' y : ↑(P.centers ∩ D), (1 / ZLattice.covolume P.lattice volume) * ∑' m : SchwartzMap.polarIntegerLattice (d := d) P.lattice, (𝓕 f m) * exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])).re = ((1 / ZLattice.covolume P.lattice volume) * ∑' m : SchwartzMap.polarIntegerLattice (d := d) P.lattice, (𝓕 f m).re * (∑' x : ↑(P.centers ∩ D), ∑' y : ↑(P.centers ∩ D), exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ]))).re := by classical letI := P.instFintypeBoundedCenterRepresentatives hd hD_isBounded have hFourierNorm : Summable (fun m : SchwartzMap.polarIntegerLattice (d := d) P.lattice => ‖(𝓕 f) (m : EuclideanSpace ℝ (Fin d))‖) := by simpa using (LPBoundAux.summable_norm_on_translated_integral_lattice (SchwartzMap.polarIntegerLattice (d := d) P.lattice) (𝓕 f) (0 : EuclideanSpace ℝ (Fin d))) have hWeighted (x y : ↑(P.centers ∩ D)) : Summable (fun m : SchwartzMap.polarIntegerLattice (d := d) P.lattice => (𝓕 f m) * exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) := by apply Summable.of_norm simpa [norm_mul, Complex.norm_exp, Complex.mul_re, mul_assoc] using hFourierNorm have hSwap (g : ↑(P.centers ∩ D) → SchwartzMap.polarIntegerLattice (d := d) P.lattice → ℂ) (hg : ∀ x, Summable (g x)) : Summable (fun m => ∑ x : ↑(P.centers ∩ D), g x m) ∧ (∑ x : ↑(P.centers ∩ D), ∑' m, g x m) = ∑' m, ∑ x : ↑(P.centers ∩ D), g x m := by have hAux (s : Finset ↑(P.centers ∩ D)) : Summable (fun m => ∑ x ∈ s, g x m) ∧ (∑ x ∈ s, ∑' m, g x m) = ∑' m, ∑ x ∈ s, g x m := by induction s using Finset.induction_on with | empty => simp | @insert x s hx ih => constructor · simpa [hx] using (hg x).add ih.1 · simpa [hx, ih.2] using ((hg x).tsum_add ih.1).symm simpa using hAux Finset.univ let c : ℂ := 1 / ZLattice.covolume P.lattice volume have hInner (x : ↑(P.centers ∩ D)) : Summable (fun m : SchwartzMap.polarIntegerLattice (d := d) P.lattice => ∑ y : ↑(P.centers ∩ D), (𝓕 f m) * exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) ∧ (∑ y : ↑(P.centers ∩ D), ∑' m : SchwartzMap.polarIntegerLattice (d := d) P.lattice, (𝓕 f m) * exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) = ∑' m : SchwartzMap.polarIntegerLattice (d := d) P.lattice, ∑ y : ↑(P.centers ∩ D), (𝓕 f m) * exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ]) := by exact hSwap (fun y m => (𝓕 f m) * exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) (hWeighted x) have hOuter : (∑ x : ↑(P.centers ∩ D), ∑' m : SchwartzMap.polarIntegerLattice (d := d) P.lattice, ∑ y : ↑(P.centers ∩ D), (𝓕 f m) * exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) = ∑' m : SchwartzMap.polarIntegerLattice (d := d) P.lattice, ∑ x : ↑(P.centers ∩ D), ∑ y : ↑(P.centers ∩ D), (𝓕 f m) * exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ]) := by exact (hSwap (fun x m => ∑ y : ↑(P.centers ∩ D), (𝓕 f m) * exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) (fun x => (hInner x).1)).2 have hExchange : (∑ x : ↑(P.centers ∩ D), ∑ y : ↑(P.centers ∩ D), c * ∑' m : SchwartzMap.polarIntegerLattice (d := d) P.lattice, (𝓕 f m) * exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) = c * ∑' m : SchwartzMap.polarIntegerLattice (d := d) P.lattice, (𝓕 f m) * (∑ x : ↑(P.centers ∩ D), ∑ y : ↑(P.centers ∩ D), exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) := by calc _ = c * ∑ x : ↑(P.centers ∩ D), ∑ y : ↑(P.centers ∩ D), ∑' m : SchwartzMap.polarIntegerLattice (d := d) P.lattice, (𝓕 f m) * exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ]) := by simp [Finset.mul_sum] _ = c * ∑ x : ↑(P.centers ∩ D), ∑' m : SchwartzMap.polarIntegerLattice (d := d) P.lattice, ∑ y : ↑(P.centers ∩ D), (𝓕 f m) * exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ]) := by congr 1 exact Finset.sum_congr rfl (fun x _ => (hInner x).2) _ = c * ∑' m : SchwartzMap.polarIntegerLattice (d := d) P.lattice, ∑ x : ↑(P.centers ∩ D), ∑ y : ↑(P.centers ∩ D), (𝓕 f m) * exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ]) := congrArg (fun z : ℂ => c * z) hOuter _ = _ := by congr 1 apply tsum_congr intro m simp [Finset.mul_sum, mul_assoc] have hRealCoeff (m : SchwartzMap.polarIntegerLattice (d := d) P.lattice) : (((𝓕 f m).re : ℝ) : ℂ) = 𝓕 f m := hRealFourier (m : EuclideanSpace ℝ (Fin d)) simpa [tsum_fintype, c, hRealCoeff] using congrArg Complex.re hExchange end SpherePacking.CohnElkies end section open scoped BigOperators open scoped SchwartzMap namespace SpherePacking.CohnElkies variable {d : ℕ} namespace LPBoundSummability open SpherePacking.CohnElkies.LPBoundAux section ZLattice variable (Λ : Submodule ℤ (EuclideanSpace ℝ (Fin d))) [DiscreteTopology Λ] variable (f : 𝓢(EuclideanSpace ℝ (Fin d), ℂ)) (a : EuclideanSpace ℝ (Fin d)) theorem summable_lattice_shift_values : Summable (fun ℓ : Λ => f (a + (ℓ : EuclideanSpace ℝ (Fin d)))) := Summable.of_norm (summable_norm_on_translated_integral_lattice (Λ := Λ) f a) theorem summable_lattice_shift_real_parts : Summable (fun ℓ : Λ => (f (a + (ℓ : EuclideanSpace ℝ (Fin d)))).re) := Complex.reCLM.summable (summable_lattice_shift_values (Λ := Λ) f a) end SpherePacking.CohnElkies.LPBoundSummability.ZLattice end section namespace SpherePacking.CohnElkies noncomputable section open scoped BigOperators SchwartzMap variable {d : ℕ} def fundamentalCentersLatticeProductEquiv (P : PeriodicSpherePacking d) [Nonempty P.centers] {D : Set (EuclideanSpace ℝ (Fin d))} (hD_unique_covers : ∀ x, ∃! g : P.lattice, g +ᵥ x ∈ D) : (↑(P.centers ∩ D) × P.lattice) ≃ P.centers := by classical let E := EuclideanSpace ℝ (Fin d) refine { toFun := fun z => ⟨(z.2 : E) + (z.1 : E), P.lattice_action z.2.property z.1.property.1⟩ invFun := fun x => let g := Classical.choose (hD_unique_covers (x : E)) (⟨(g : E) + (x : E), P.lattice_action g.property x.property, (Classical.choose_spec (hD_unique_covers (x : E))).1⟩, -g) left_inv := ?_ right_inv := ?_ } · rintro ⟨x, g⟩ let k := Classical.choose (hD_unique_covers ((g : E) + (x : E))) have hk : k = -g := by symm apply (Classical.choose_spec (hD_unique_covers ((g : E) + (x : E)))).2 simpa [Submodule.vadd_def, vadd_eq_add, add_assoc] using x.property.2 change (⟨(k : E) + ((g : E) + (x : E)), _⟩, -k) = (x, g) apply Prod.ext · apply Subtype.ext change (k : E) + ((g : E) + (x : E)) = (x : E) simp [hk] · change -k = g simp [hk] · intro x let g := Classical.choose (hD_unique_covers (x : E)) change (⟨((-g : P.lattice) : E) + ((g : E) + (x : E)), _⟩ : P.centers) = x apply Subtype.ext simp lemma center_double_sum_eq_region_lattice_sum (f : 𝓢(EuclideanSpace ℝ (Fin d), ℂ)) (P : PeriodicSpherePacking d) [Nonempty P.centers] {D : Set (EuclideanSpace ℝ (Fin d))} (hD_isBounded : Bornology.IsBounded D) (hD_unique_covers : ∀ x, ∃! g : P.lattice, g +ᵥ x ∈ D) (hd : 0 < d) : ∑' (x : P.centers) (y : ↑(P.centers ∩ D)), (f (x - (y : EuclideanSpace ℝ (Fin d)))).re = ∑' (x : ↑(P.centers ∩ D)) (y : ↑(P.centers ∩ D)) (ℓ : P.lattice), (f ((x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)) + (ℓ : EuclideanSpace ℝ (Fin d)))).re := by classical letI : Fintype ↑(P.centers ∩ D) := @Fintype.ofFinite _ (finite_centers_in_bounded_region P D hD_isBounded hd) let e := fundamentalCentersLatticeProductEquiv P hD_unique_covers have hs (x y : ↑(P.centers ∩ D)) : Summable (fun ℓ : P.lattice => (f ((x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)) + (ℓ : EuclideanSpace ℝ (Fin d)))).re) := LPBoundSummability.summable_lattice_shift_real_parts (Λ := P.lattice) f ((x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d))) have hswap (x : ↑(P.centers ∩ D)) : Summable (fun ℓ : P.lattice => ∑' y : ↑(P.centers ∩ D), (f ((x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)) + (ℓ : EuclideanSpace ℝ (Fin d)))).re) ∧ (∑' ℓ : P.lattice, ∑' y : ↑(P.centers ∩ D), (f ((x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)) + (ℓ : EuclideanSpace ℝ (Fin d)))).re) = ∑' y : ↑(P.centers ∩ D), ∑' ℓ : P.lattice, (f ((x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)) + (ℓ : EuclideanSpace ℝ (Fin d)))).re := by have haux (s : Finset ↑(P.centers ∩ D)) : Summable (fun ℓ : P.lattice => ∑ y ∈ s, (f ((x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)) + (ℓ : EuclideanSpace ℝ (Fin d)))).re) ∧ (∑' ℓ : P.lattice, ∑ y ∈ s, (f ((x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)) + (ℓ : EuclideanSpace ℝ (Fin d)))).re) = ∑ y ∈ s, ∑' ℓ : P.lattice, (f ((x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)) + (ℓ : EuclideanSpace ℝ (Fin d)))).re := by induction s using Finset.induction_on with | empty => simp | @insert y s hy ih => constructor · simpa [hy] using (hs x y).add ih.1 · simpa [hy, ih.2] using (hs x y).tsum_add ih.1 constructor · simpa [tsum_fintype] using (haux Finset.univ).1 · simpa [tsum_fintype] using (haux Finset.univ).2 calc _ = ∑' z : ↑(P.centers ∩ D) × P.lattice, ∑' y : ↑(P.centers ∩ D), (f (((z.2 : P.lattice) : EuclideanSpace ℝ (Fin d)) + (z.1 : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)))).re := by simpa [e, fundamentalCentersLatticeProductEquiv] using (e.tsum_eq (f := fun x : P.centers => ∑' y : ↑(P.centers ∩ D), (f ((x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)))).re)).symm _ = ∑' x : ↑(P.centers ∩ D), ∑' ℓ : P.lattice, ∑' y : ↑(P.centers ∩ D), (f ((x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)) + (ℓ : EuclideanSpace ℝ (Fin d)))).re := by let ep : (Σ _ : ↑(P.centers ∩ D), P.lattice) ≃ (↑(P.centers ∩ D) × P.lattice) := Equiv.sigmaEquivProd _ _ have htotal : Summable (fun z : Σ _ : ↑(P.centers ∩ D), P.lattice => ∑' y : ↑(P.centers ∩ D), (f ((z.1 : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)) + ((z.2 : P.lattice) : EuclideanSpace ℝ (Fin d)))).re) := by let G : (Σ _ : ↑(P.centers ∩ D), P.lattice) → ℝ := fun z => ∑' y : ↑(P.centers ∩ D), (f ((z.1 : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)) + ((z.2 : P.lattice) : EuclideanSpace ℝ (Fin d)))).re change Summable G have hind (x : ↑(P.centers ∩ D)) : Summable (({z : Σ _ : ↑(P.centers ∩ D), P.lattice | z.1 = x}).indicator G) := by let ex : P.lattice ≃ {z : Σ _ : ↑(P.centers ∩ D), P.lattice | z.1 = x} := { toFun := fun ℓ => ⟨⟨x, ℓ⟩, rfl⟩ invFun := fun z => z.val.2 left_inv := fun _ => rfl right_inv := by intro z apply Subtype.ext cases z with | mk z hz => cases z with | mk x' ℓ => cases hz rfl } apply summable_subtype_iff_indicator.mp apply (ex.summable_iff).mp simpa [G, ex, Function.comp_def] using (hswap x).1 have hall := summable_sum (s := Finset.univ) (fun x _ => hind x) simpa [Set.indicator, eq_comm] using hall calc _ = ∑' z : Σ _ : ↑(P.centers ∩ D), P.lattice, ∑' y : ↑(P.centers ∩ D), (f (((z.2 : P.lattice) : EuclideanSpace ℝ (Fin d)) + (z.1 : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)))).re := by simpa [ep] using (ep.tsum_eq (f := fun z : ↑(P.centers ∩ D) × P.lattice => ∑' y : ↑(P.centers ∩ D), (f (((z.2 : P.lattice) : EuclideanSpace ℝ (Fin d)) + (z.1 : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)))).re)).symm _ = ∑' z : Σ _ : ↑(P.centers ∩ D), P.lattice, ∑' y : ↑(P.centers ∩ D), (f ((z.1 : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)) + ((z.2 : P.lattice) : EuclideanSpace ℝ (Fin d)))).re := by apply tsum_congr intro z apply tsum_congr intro y congr 2 abel _ = _ := Summable.tsum_sigma' (fun x => (hswap x).1) htotal _ = _ := by apply tsum_congr intro x exact (hswap x).2 end end SpherePacking.CohnElkies end section open scoped BigOperators SchwartzMap namespace SpherePacking.CohnElkies variable {d : ℕ} variable {f : 𝓢(EuclideanSpace ℝ (Fin d), ℂ)} section FundamentalDomain variable {P : PeriodicSpherePacking d} variable {D : Set (EuclideanSpace ℝ (Fin d))} lemma real_lattice_sum_bounded_by_origin_term (hP : P.separation = 1) (hD_unique_covers : ∀ x, ∃! g : P.lattice, g +ᵥ x ∈ D) (hCohnElkies₁ : ∀ x : EuclideanSpace ℝ (Fin d), ‖x‖ ≥ 1 → (f x).re ≤ 0) (x y : ↑(P.centers ∩ D)) : (∑' ℓ : P.lattice, (f ((x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)) + (ℓ : EuclideanSpace ℝ (Fin d)))).re) ≤ ite (x = y) (f 0).re 0 := by classical let E := EuclideanSpace ℝ (Fin d) have hsum : Summable (fun ℓ : P.lattice => (f ((x : E) - (y : E) + (ℓ : E))).re) := SpherePacking.CohnElkies.LPBoundSummability.summable_lattice_shift_real_parts (Λ := P.lattice) (f := f) ((x : E) - (y : E)) have hnonpos (ℓ : P.lattice) (hne : (ℓ : E) + (x : E) ≠ (y : E)) : (f ((x : E) - (y : E) + (ℓ : E))).re ≤ 0 := by have hcenter : (ℓ : E) + (x : E) ∈ P.centers := P.lattice_action ℓ.property x.property.1 have hdist : 1 ≤ dist ((ℓ : E) + (x : E)) (y : E) := by rw [← hP] exact P.toSpherePacking.distinct_centers_separation_bound ((ℓ : E) + (x : E)) (y : E) hcenter y.property.1 hne apply hCohnElkies₁ simpa [dist_eq_norm, sub_eq_add_neg, add_assoc, add_left_comm, add_comm] using hdist by_cases hxy : x = y · subst y simp only [] have hmajor : Summable (fun ℓ : P.lattice => if ℓ = 0 then (f 0).re else 0) := by apply summable_of_ne_finset_zero (s := {0}) intro ℓ hℓ have hne : ℓ ≠ 0 := by intro hzero exact hℓ (by simp [hzero]) simp [hne] calc (∑' ℓ : P.lattice, (f ((x : E) - (x : E) + (ℓ : E))).re) ≤ ∑' ℓ : P.lattice, if ℓ = 0 then (f 0).re else 0 := by apply Summable.tsum_le_tsum (hf := hsum) (hg := hmajor) intro ℓ by_cases hℓ : ℓ = 0 · simp [hℓ] · simp only [if_neg hℓ] apply hnonpos ℓ intro heq apply hℓ apply Subtype.ext have hz := congrArg (fun z : E => z - (x : E)) heq simpa using hz _ = (f 0).re := by simp · simp only [if_neg hxy] have hterms (ℓ : P.lattice) : (f ((x : E) - (y : E) + (ℓ : E))).re ≤ 0 := by apply hnonpos ℓ intro heq have hℓD : ℓ +ᵥ (x : E) ∈ D := by change (ℓ : E) + (x : E) ∈ D rw [heq] exact y.property.2 have hzeroD : (0 : P.lattice) +ᵥ (x : E) ∈ D := by simpa using x.property.2 have hℓ : ℓ = (0 : P.lattice) := (hD_unique_covers (x : E)).unique hℓD hzeroD apply hxy apply Subtype.ext simpa [hℓ] using heq simpa using (Summable.tsum_le_tsum hterms hsum (summable_zero : Summable (fun _ : P.lattice => (0 : ℝ)))) end FundamentalDomain end SpherePacking.CohnElkies end section open scoped FourierTransform ENNReal SchwartzMap BigOperators open SpherePacking MeasureTheory Complex Real Bornology Module variable {d : ℕ} variable {f : 𝓢(EuclideanSpace ℝ (Fin d), ℂ)} (hne_zero : f ≠ 0) variable (hReal : ∀ x : EuclideanSpace ℝ (Fin d), ↑(f x).re = (f x)) variable (hRealFourier : ∀ x : EuclideanSpace ℝ (Fin d), ↑(𝓕 f x).re = (𝓕 f x)) variable (hCohnElkies₁ : ∀ x : EuclideanSpace ℝ (Fin d), ‖x‖ ≥ 1 → (f x).re ≤ 0) variable (hCohnElkies₂ : ∀ x : EuclideanSpace ℝ (Fin d), (𝓕 f x).re ≥ 0) section Complex_Function_Helpers theorem imaginary_part_vanishes_of_real_valued (g : EuclideanSpace ℝ (Fin d) → ℂ) : (∀ x : EuclideanSpace ℝ (Fin d), ↑(g x).re = (g x)) → (∀ x : EuclideanSpace ℝ (Fin d), (g x).im = 0) := by intro hIsReal x simpa [eq_comm] using! congrArg Complex.im (hIsReal x) include hRealFourier in @[simp] theorem fourier_imaginary_component_vanishes : ∀ x : EuclideanSpace ℝ (Fin d), (𝓕 f x).im = 0 := imaginary_part_vanishes_of_real_valued (𝓕 ⇑f) hRealFourier end Complex_Function_Helpers section Nonnegativity theorem fourier_transform_is_integrable : MeasureTheory.Integrable (𝓕 ⇑f) := ((FourierTransform.fourierCLE ℝ (SchwartzMap (EuclideanSpace ℝ (Fin d)) ℂ)) f).integrable include hne_zero in theorem fourier_transform_nonzero : 𝓕 f ≠ 0 := by intro hFourierZero apply hne_zero rw [← ContinuousLinearEquiv.map_eq_zero_iff (FourierTransform.fourierCLE ℝ _)] exact hFourierZero include hCohnElkies₂ in theorem test_function_nonnegative_at_origin : 0 ≤ (f 0).re := by rw [← f.schwartz_fourier_inverse_identity, fourierInv_eq] simp only [inner_zero_right, AddChar.map_zero_eq_one, one_smul] rw [← RCLike.re_eq_complex_re, ← integral_re fourier_transform_is_integrable] refine integral_nonneg ?_ intro v simpa [RCLike.re_eq_complex_re] using! hCohnElkies₂ v include hReal hRealFourier hCohnElkies₂ hne_zero in theorem test_function_positive_at_origin : 0 < (f 0).re := by have h0 : 0 ≤ (f 0).re := test_function_nonnegative_at_origin (f := f) hCohnElkies₂ refine lt_of_le_of_ne h0 ?_ intro hf0re have hf0 : f 0 = 0 := by simpa [hf0re.symm] using! (hReal 0).symm have hint0 : (∫ v : EuclideanSpace ℝ (Fin d), 𝓕 (⇑f) v) = 0 := by have hInv : 𝓕⁻ (𝓕 ⇑f) 0 = f 0 := congrArg (fun g : EuclideanSpace ℝ (Fin d) → ℂ => g 0) (f.schwartz_fourier_inverse_identity) simpa [fourierInv_eq, inner_zero_right, AddChar.map_zero_eq_one, one_smul, hf0] using! hInv have hintRe : ∫ v : EuclideanSpace ℝ (Fin d), (𝓕 (⇑f) v).re = 0 := by have : (∫ v : EuclideanSpace ℝ (Fin d), 𝓕 (⇑f) v).re = 0 := by simpa using! congrArg Complex.re hint0 have hre : (∫ v : EuclideanSpace ℝ (Fin d), (𝓕 (⇑f) v).re) = (∫ v : EuclideanSpace ℝ (Fin d), 𝓕 (⇑f) v).re := by simpa using! (integral_re (f := fun v : EuclideanSpace ℝ (Fin d) => 𝓕 (⇑f) v) fourier_transform_is_integrable) exact hre.trans this have hcont : Continuous (fun x : EuclideanSpace ℝ (Fin d) => (𝓕 f x).re) := by fun_prop have hfun : (fun x : EuclideanSpace ℝ (Fin d) => (𝓕 f x).re) = 0 := by refine (Continuous.nonnegative_integral_vanishes_iff_function_vanishes hcont ?_ hCohnElkies₂).1 ?_ · have h𝓕_int : MeasureTheory.Integrable (fun x : EuclideanSpace ℝ (Fin d) => 𝓕 f x) := by rw [← FourierTransform.fourierCLE_apply (R := ℝ) (E := 𝓢(EuclideanSpace ℝ (Fin d), ℂ)) f] exact ((FourierTransform.fourierCLE ℝ (SchwartzMap (EuclideanSpace ℝ (Fin d)) ℂ)) f).integrable exact h𝓕_int.re simpa using! hintRe have h𝓕fzero : 𝓕 f = 0 := by ext x have hx : (𝓕 f x).re = 0 := by simpa [hfun] using! congrArg (fun g => g x) hfun simpa [hx] using! (hRealFourier x).symm exact fourier_transform_nonzero hne_zero h𝓕fzero end Nonnegativity section Fundamental_Domain_Dependent variable {P : PeriodicSpherePacking d} (hP : P.separation = 1) [Nonempty P.centers] variable {D : Set (EuclideanSpace ℝ (Fin d))} (hD_isBounded : IsBounded D) variable (hD_unique_covers : ∀ x, ∃! g : P.lattice, g +ᵥ x ∈ D) (hD_measurable : MeasurableSet D) include hP hCohnElkies₁ in open Classical in theorem packing_bound_auxiliary_estimate (hd : 0 < d) (hD_unique_covers : ∀ x, ∃! g : P.lattice, g +ᵥ x ∈ D) : ∑' x : P.centers, ∑' y : ↑(P.centers ∩ D), (f (x - (y : EuclideanSpace ℝ (Fin d)))).re ≤ ↑(P.boundedCenterRepresentativeCount hd hD_isBounded) * (f 0).re := by letI := P.instFintypeBoundedCenterRepresentatives hd hD_isBounded rw [SpherePacking.CohnElkies.center_double_sum_eq_region_lattice_sum f P hD_isBounded hD_unique_covers hd] simp_rw [tsum_fintype] calc (∑ x : ↑(P.centers ∩ D), ∑ y : ↑(P.centers ∩ D), ∑' ℓ : P.lattice, (f ((x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)) + (ℓ : EuclideanSpace ℝ (Fin d)))).re) ≤ ∑ x : ↑(P.centers ∩ D), ∑ y : ↑(P.centers ∩ D), ite (x = y) (f 0).re 0 := by exact Finset.sum_le_sum fun x _ => Finset.sum_le_sum fun y _ => SpherePacking.CohnElkies.real_lattice_sum_bounded_by_origin_term hP hD_unique_covers hCohnElkies₁ x y _ = ↑(P.boundedCenterRepresentativeCount hd hD_isBounded) * (f 0).re := by simp [PeriodicSpherePacking.boundedCenterRepresentativeCount] omit [Nonempty ↑P.centers] in include hD_isBounded in lemma packing_bound_complete_estimate_refined (hd : 0 < d) : ∑' (x : ↑(P.centers ∩ D)) (y : ↑(P.centers ∩ D)) (ℓ : ↥P.lattice), (f (↑x - ↑y + ↑ℓ)).re = (∑' (x : ↑(P.centers ∩ D)) (y : ↑(P.centers ∩ D)) (ℓ : ↥P.lattice), f (↑x - ↑y + ↑ℓ)).re := by haveI : Finite ↑(P.centers ∩ D) := finite_centers_in_bounded_region P D hD_isBounded hd rw [re_tsum Summable.of_finite] refine tsum_congr fun x => ?_ rw [re_tsum Summable.of_finite] refine tsum_congr fun y => ?_ simpa [sub_eq_add_neg, add_assoc, add_left_comm, add_comm] using! (re_tsum (SpherePacking.CohnElkies.LPBoundSummability.summable_lattice_shift_values (Λ := P.lattice) (f := f) (a := (↑x - ↑y : EuclideanSpace ℝ (Fin d))))).symm include d f hP hne_zero hReal hRealFourier hCohnElkies₁ hCohnElkies₂ hD_unique_covers in omit hne_zero hReal hCohnElkies₂ in theorem packing_bound_geometric_estimate (hd : 0 < d) : ↑(P.boundedCenterRepresentativeCount hd hD_isBounded) * (f 0).re ≥ (1 / ZLattice.covolume P.lattice volume) * ∑' m : SchwartzMap.polarIntegerLattice (d := d) P.lattice, (𝓕 ⇑f m).re * (norm (∑' x : ↑(P.centers ∩ D), exp (2 * π * I * ⟪↑x, (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) ^ 2) := by classical letI : Fintype ↑(P.centers ∩ D) := P.instFintypeBoundedCenterRepresentatives hd hD_isBounded have hcharacter (x y : ↑(P.centers ∩ D)) (m : SchwartzMap.polarIntegerLattice (d := d) P.lattice) : exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ]) = exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ]) * (starRingEnd ℂ) (exp (2 * π * I * ⟪(y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) := by have hinner : ⟪(x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ] = ⟪(x : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ] - ⟪(y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ] := by simpa only [← RCLike.inner_eq_wInner_one] using (inner_sub_left (x : EuclideanSpace ℝ (Fin d)) (y : EuclideanSpace ℝ (Fin d)) (m : EuclideanSpace ℝ (Fin d))) rw [hinner] have hsplit : (2 * (π : ℂ) * I * ((⟪(x : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ] - ⟪(y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ] : ℝ) : ℂ)) = 2 * (π : ℂ) * I * (⟪(x : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ] : ℂ) + -(2 * (π : ℂ) * I * (⟪(y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ] : ℂ)) := by push_cast ring rw [hsplit, Complex.exp_add, Complex.negative_imaginary_exponential_eq_conjugate] have hfactor (m : SchwartzMap.polarIntegerLattice (d := d) P.lattice) : (∑' x : ↑(P.centers ∩ D), ∑' y : ↑(P.centers ∩ D), exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) = (norm (∑' x : ↑(P.centers ∩ D), exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) ^ 2 : ℝ) := by simp_rw [tsum_fintype, hcharacter] calc _ = (∑ x : ↑(P.centers ∩ D), exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) * (∑ y : ↑(P.centers ∩ D), (starRingEnd ℂ) (exp (2 * π * I * ⟪(y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ]))) := by symm rw [Finset.sum_mul] apply Finset.sum_congr rfl intro x hx rw [Finset.mul_sum] _ = (∑ x : ↑(P.centers ∩ D), exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) * (starRingEnd ℂ) (∑ y : ↑(P.centers ∩ D), exp (2 * π * I * ⟪(y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) := by rw [map_sum] _ = _ := by rw [Complex.mul_conj, Complex.normSq_eq_norm_sq] have hFourierNorm : Summable (fun m : SchwartzMap.polarIntegerLattice (d := d) P.lattice => ‖(𝓕 f) (m : EuclideanSpace ℝ (Fin d))‖) := by simpa using (SpherePacking.CohnElkies.LPBoundAux.summable_norm_on_translated_integral_lattice (SchwartzMap.polarIntegerLattice (d := d) P.lattice) (𝓕 f) (0 : EuclideanSpace ℝ (Fin d))) have hWeighted (x y : ↑(P.centers ∩ D)) : Summable (fun m : SchwartzMap.polarIntegerLattice (d := d) P.lattice => (𝓕 f m) * exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) := by apply Summable.of_norm simpa [norm_mul, Complex.norm_exp, Complex.mul_re, mul_assoc] using hFourierNorm have hFull : Summable (fun m : SchwartzMap.polarIntegerLattice (d := d) P.lattice => ∑ x : ↑(P.centers ∩ D), ∑ y : ↑(P.centers ∩ D), (𝓕 f m) * exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)) - (y : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) := summable_sum fun x _ => summable_sum fun y _ => hWeighted x y have hSpectral : Summable (fun m : SchwartzMap.polarIntegerLattice (d := d) P.lattice => ((𝓕 f m).re : ℂ) * (norm (∑' x : ↑(P.centers ∩ D), exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) ^ 2 : ℝ)) := by refine (summable_congr ?_).mp hFull intro m rw [← hRealFourier (m : EuclideanSpace ℝ (Fin d)), ← hfactor m] simp [tsum_fintype, Finset.mul_sum] have hgeom : (∑' (x : ↑(P.centers ∩ D)) (y : ↑(P.centers ∩ D)) (ℓ : ↥P.lattice), (f (↑x - ↑y + ↑ℓ)).re) = (1 / ZLattice.covolume P.lattice volume) * ∑' m : SchwartzMap.polarIntegerLattice (d := d) P.lattice, (𝓕 ⇑f m).re * (norm (∑' x : ↑(P.centers ∩ D), exp (2 * π * I * ⟪↑x, (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) ^ 2) := by rw [packing_bound_complete_estimate_refined hD_isBounded hd] simp_rw [SchwartzMap.latticePoissonSummationFormula P.lattice f] simp_rw [← SchwartzMap.fourier_coe] rw [SpherePacking.CohnElkies.packing_spectral_sum_exchange f hRealFourier P hD_isBounded hd] simp_rw [hfactor] have hcov : (1 / (ZLattice.covolume P.lattice volume : ℂ)) = ((1 / ZLattice.covolume P.lattice volume : ℝ) : ℂ) := by norm_cast rw [hcov, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero, Complex.re_tsum hSpectral] congr 1 apply tsum_congr intro m simp only [pow_two, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, mul_zero, sub_zero] have hbound := packing_bound_auxiliary_estimate (f := f) hCohnElkies₁ hP hD_isBounded hd hD_unique_covers rw [SpherePacking.CohnElkies.center_double_sum_eq_region_lattice_sum (f := f) (P := P) (D := D) hD_isBounded hD_unique_covers hd] at hbound linarith [hgeom] include d f hP hne_zero hReal hRealFourier hCohnElkies₁ hCohnElkies₂ in omit hne_zero hReal hRealFourier hCohnElkies₁ hP [Nonempty ↑P.centers] in theorem packing_bound_spectral_estimate (hd : 0 < d) : (1 / ZLattice.covolume P.lattice volume) * ∑' m : SchwartzMap.polarIntegerLattice (d := d) P.lattice, (𝓕 ⇑f m).re * (norm (∑' x : ↑(P.centers ∩ D), exp (2 * π * I * ⟪↑x, (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) ^ 2) ≥ ↑(P.boundedCenterRepresentativeCount hd hD_isBounded) ^ 2 * (𝓕 f 0).re / ZLattice.covolume P.lattice volume := by classical letI := P.instFintypeBoundedCenterRepresentatives hd hD_isBounded let N : ℝ := P.boundedCenterRepresentativeCount hd hD_isBounded let F : SchwartzMap.polarIntegerLattice (d := d) P.lattice → ℝ := fun m => (𝓕 ⇑f m).re * (norm (∑' x : ↑(P.centers ∩ D), exp (2 * π * I * ⟪↑x, (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) ^ 2) have hFourierNorm : Summable (fun m : SchwartzMap.polarIntegerLattice (d := d) P.lattice => ‖(𝓕 f) (m : EuclideanSpace ℝ (Fin d))‖) := by simpa using (SpherePacking.CohnElkies.LPBoundAux.summable_norm_on_translated_integral_lattice (SchwartzMap.polarIntegerLattice (d := d) P.lattice) (𝓕 f) (0 : EuclideanSpace ℝ (Fin d))) have hCharacterBound (m : SchwartzMap.polarIntegerLattice (d := d) P.lattice) : norm (∑' x : ↑(P.centers ∩ D), exp (2 * π * I * ⟪↑x, (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) ≤ N := by rw [tsum_fintype] calc _ ≤ ∑ x : ↑(P.centers ∩ D), ‖exp (2 * π * I * ⟪(x : EuclideanSpace ℝ (Fin d)), (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])‖ := norm_sum_le _ _ _ = N := by simp [N, PeriodicSpherePacking.boundedCenterRepresentativeCount, Complex.norm_exp, Complex.mul_re, mul_assoc] have hFnonneg (m : SchwartzMap.polarIntegerLattice (d := d) P.lattice) : 0 ≤ F m := by exact mul_nonneg (hCohnElkies₂ _) (sq_nonneg _) have hFsummable : Summable F := by refine Summable.of_nonneg_of_le hFnonneg (fun m => ?_) (hFourierNorm.mul_left (N ^ 2)) have hcoeff : (𝓕 ⇑f (m : EuclideanSpace ℝ (Fin d))).re ≤ ‖(𝓕 f) (m : EuclideanSpace ℝ (Fin d))‖ := by exact (le_abs_self _).trans (Complex.abs_re_le_norm ((𝓕 f) (m : EuclideanSpace ℝ (Fin d)))) have hsq : norm (∑' x : ↑(P.centers ∩ D), exp (2 * π * I * ⟪↑x, (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) ^ 2 ≤ N ^ 2 := by have hN : 0 ≤ N := by dsimp [N] positivity nlinarith [hCharacterBound m, norm_nonneg (∑' x : ↑(P.centers ∩ D), exp (2 * π * I * ⟪↑x, (m : EuclideanSpace ℝ (Fin d))⟫_[ℝ]))] change _ ≤ N ^ 2 * ‖(𝓕 f) (m : EuclideanSpace ℝ (Fin d))‖ simpa [F, mul_comm] using (mul_le_mul hcoeff hsq (sq_nonneg _) (norm_nonneg _)) have htail : 0 ≤ ∑' m : SchwartzMap.polarIntegerLattice (d := d) P.lattice, if m = 0 then 0 else F m := by exact SpherePacking.CohnElkies.nonnegative_weighted_nonzero_frequency_sum f P D hCohnElkies₂ have horigin : F (0 : SchwartzMap.polarIntegerLattice (d := d) P.lattice) = (𝓕 f 0).re * N ^ 2 := by change (𝓕 f (0 : EuclideanSpace ℝ (Fin d))).re * norm (∑' x : ↑(P.centers ∩ D), exp (2 * π * I * ⟪↑x, (0 : EuclideanSpace ℝ (Fin d))⟫_[ℝ])) ^ 2 = (𝓕 f 0).re * N ^ 2 rw [SpherePacking.CohnElkies.origin_character_sum_norm_sq_eq_orbit_count_sq P hd hD_isBounded] have hsum : (𝓕 f 0).re * N ^ 2 ≤ ∑' m, F m := by rw [hFsummable.tsum_eq_add_tsum_ite 0, horigin] linarith have hcovol : 0 ≤ ZLattice.covolume P.lattice volume := by rw [SchwartzMap.lattice_covolume_eq_coordinate_determinant] exact abs_nonneg _ have hscaled := mul_le_mul_of_nonneg_left hsum (by positivity : 0 ≤ (1 / ZLattice.covolume P.lattice volume : ℝ)) simpa [F, N, div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm] using hscaled include d f hP hne_zero hReal hRealFourier hCohnElkies₁ hCohnElkies₂ hD_unique_covers in omit hne_zero hReal in theorem packing_bound_complete_estimate (hd : 0 < d) : ↑(P.boundedCenterRepresentativeCount hd hD_isBounded) * (f 0).re ≥ ↑(P.boundedCenterRepresentativeCount hd hD_isBounded) ^ 2 * (𝓕 f 0).re / ZLattice.covolume P.lattice volume := by exact (packing_bound_spectral_estimate (P := P) hCohnElkies₂ hD_isBounded hd).trans (packing_bound_geometric_estimate hRealFourier hCohnElkies₁ hP hD_isBounded hD_unique_covers hd) end Fundamental_Domain_Dependent section Main_Theorem_For_One_Packing variable {P : PeriodicSpherePacking d} (hP : P.separation = 1) [Nonempty P.centers] variable {D : Set (EuclideanSpace ℝ (Fin d))} (hD_isBounded : IsBounded D) variable (hD_unique_covers : ∀ x, ∃! g : P.lattice, g +ᵥ x ∈ D) include d f hne_zero hReal hRealFourier hCohnElkies₁ hCohnElkies₂ P hP D hD_isBounded hD_unique_covers theorem LinearProgrammingBound' (hd : 0 < d) : P.upperPackingDensity ≤ (f 0).re.toNNReal / (𝓕 f 0).re.toNNReal * volume (Metric.ball (0 : EuclideanSpace ℝ (Fin d)) (1 / 2)) := by classical letI : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd have hfunction : 0 < (f 0).re := test_function_positive_at_origin hne_zero hReal hRealFourier hCohnElkies₂ have hball : volume (Metric.ball (0 : EuclideanSpace ℝ (Fin d)) (1 / 2)) ≠ 0 := (EuclideanSpace.euclidean_ball_volume_positive (0 : EuclideanSpace ℝ (Fin d)) (by norm_num : (0 : ℝ) < 1 / 2)).ne' have hball_inv : volume (Metric.ball (0 : EuclideanSpace ℝ (Fin d)) (2 : ℝ)⁻¹) ≠ 0 := by simpa only [one_div] using hball by_cases hfourier_zero : (𝓕 f 0).re = 0 · simp [hfourier_zero, div_eq_mul_inv, (Real.toNNReal_pos.mpr hfunction).ne', hball_inv] · have hfourier : 0 < (𝓕 f 0).re := lt_of_le_of_ne (hCohnElkies₂ 0) (Ne.symm hfourier_zero) have hcount_nat : 0 < P.centerOrbitCardinality := by unfold PeriodicSpherePacking.centerOrbitCardinality exact Fintype.card_pos_iff.mpr ⟨Quotient.mk _ (Classical.choice (inferInstance : Nonempty P.centers))⟩ have hcount : 0 < (P.boundedCenterRepresentativeCount hd hD_isBounded : ℝ) := by rw [← P.orbit_cardinality_eq_bounded_representatives hd hD_isBounded hD_unique_covers] exact_mod_cast hcount_nat have hcovolume : 0 < ZLattice.covolume P.lattice volume := by rw [SchwartzMap.lattice_covolume_eq_coordinate_determinant] apply abs_pos.mpr intro hdet let e := SchwartzMap.latticeCoordinateEquiv P.lattice have hcomp : e.toLinearMap * e.symm.toLinearMap = 1 := by ext x simp have hdetcomp := congrArg (LinearMap.det : ((EuclideanSpace ℝ (Fin d)) →ₗ[ℝ] (EuclideanSpace ℝ (Fin d))) →* ℝ) hcomp simp [map_mul, hdet, e] at hdetcomp have hestimate := packing_bound_complete_estimate (f := f) hRealFourier hCohnElkies₁ hCohnElkies₂ hP hD_isBounded hD_unique_covers hd have hscaled : (P.boundedCenterRepresentativeCount hd hD_isBounded : ℝ) ^ 2 * (𝓕 f 0).re ≤ ((P.boundedCenterRepresentativeCount hd hD_isBounded : ℝ) * (f 0).re) * ZLattice.covolume P.lattice volume := (div_le_iff₀ hcovolume).mp hestimate have hcancel : (P.boundedCenterRepresentativeCount hd hD_isBounded : ℝ) * (𝓕 f 0).re ≤ (f 0).re * ZLattice.covolume P.lattice volume := by apply le_of_mul_le_mul_left _ hcount simpa [pow_two, mul_assoc, mul_left_comm, mul_comm] using hscaled have hreal : (P.boundedCenterRepresentativeCount hd hD_isBounded : ℝ) / ZLattice.covolume P.lattice volume ≤ (f 0).re / (𝓕 f 0).re := (div_le_div_iff₀ hcovolume hfourier).mpr hcancel have hnonnegative := ENNReal.ofReal_le_ofReal hreal rw [ENNReal.ofReal_div_of_pos hcovolume, ENNReal.ofReal_div_of_pos hfourier] at hnonnegative have hnonnegative' : (P.boundedCenterRepresentativeCount hd hD_isBounded : ℝ≥0∞) / (ZLattice.covolume P.lattice volume).toNNReal ≤ (f 0).re.toNNReal / (𝓕 f 0).re.toNNReal := by simpa [ENNReal.ofReal] using hnonnegative rw [P.density_eq_numReps_mul_volume_ball_div_covolume hd, hP, P.orbit_cardinality_eq_bounded_representatives hd hD_isBounded hD_unique_covers] simpa [div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm] using mul_le_mul_left hnonnegative' (volume (Metric.ball (0 : EuclideanSpace ℝ (Fin d)) (1 / 2))) end Main_Theorem_For_One_Packing section Main_Theorem include d f hne_zero hReal hRealFourier hCohnElkies₁ hCohnElkies₂ theorem LinearProgrammingBound (hd : 0 < d) : SpherePackingConstant d ≤ (f 0).re.toNNReal / (𝓕 ⇑f 0).re.toNNReal * volume (Metric.ball (0 : EuclideanSpace ℝ (Fin d)) (1 / 2)) := by rw [← periodic_packing_supremum_eq_unrestricted hd, periodic_packing_supremum_eq_unit_separation (d := d)] refine iSup_le fun P => ?_ refine iSup_le fun hP => ?_ cases isEmpty_or_nonempty ↑P.centers with | inl instEmpty => simp [P.packing_density_zero_of_empty_centers hd] | inr instNonempty => let b : Basis (Fin d) ℤ ↥P.lattice := ((ZLattice.module_free ℝ P.lattice).chooseBasis).reindex (PeriodicSpherePacking.coordinateIndexEquiv P) exact LinearProgrammingBound' hne_zero hReal hRealFourier hCohnElkies₁ hCohnElkies₂ hP (ZSpan.fundamentalDomain_isBounded (Basis.ofZLatticeBasis ℝ P.lattice b)) (PeriodicSpherePacking.basis_region_translates_cover_uniquely (S := P) b) hd end Main_Theorem end end set_option backward.isDefEq.respectTransparency false set_option backward.defeqAttrib.useBackward true set_option maxHeartbeats 800000 noncomputable section open Filter open scoped FourierTransform SchwartzMap Topology namespace PackingBounds.RadialMain theorem exact_limit : Tendsto (fun d : ℕ => CohnElkies.linearProgram d ^ ((d : ℝ)⁻¹)) atTop (nhds (Real.sqrt (Real.exp 1 / (2 * Real.pi)))) := by simpa [CohnElkies.SharpPackingRootAsymptotic, CohnElkies.criticalPackingBase] using! CohnElkies.sharpPackingRootAsymptotic theorem exact_binary_exponent : Tendsto (fun d : ℕ => Real.logb 2 (CohnElkies.linearProgram d) / (d : ℝ)) atTop (nhds (-(1 / 2 : ℝ) * Real.logb 2 (2 * Real.pi / Real.exp 1))) := by simpa [CohnElkies.SharpBinaryLogAsymptotic, CohnElkies.criticalBinaryExponent] using! CohnElkies.sharpBinaryLogAsymptotic end PackingBounds.RadialMain end set_option backward.isDefEq.respectTransparency false set_option backward.defeqAttrib.useBackward true set_option maxHeartbeats 800000 noncomputable section open Filter MeasureTheory Metric open scoped ENNReal FourierTransform SchwartzMap Topology namespace PackingBounds.PackingBridge theorem volume_half_ball {d : ℕ} (hd : 0 < d) : volume (ball (0 : CohnElkies.Euclidean d) (1 / 2 : ℝ)) = ENNReal.ofReal (CohnElkies.unitBallVolume d / (2 : ℝ) ^ d) := by letI : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd rw [EuclideanSpace.volume_ball] simp only [Fintype.card_fin, CohnElkies.sqrt_pi_pow_eq_rpow] rw [← ENNReal.ofReal_pow (by positivity), ← ENNReal.ofReal_mul (by positivity)] congr 1 simp [CohnElkies.unitBallVolume] ring theorem sphere_packing_le_admissible {d : ℕ} (hd : 0 < d) (f : CohnElkies.Admissible d) : SpherePackingConstant d ≤ ENNReal.ofReal (CohnElkies.unitBallVolume d / (2 : ℝ) ^ d * CohnElkies.quotient f) := by have hfne : f.function ≠ 0 := by intro hf have h := f.fourier_zero_pos rw [hf] at h simp at h have hreal : ∀ x : CohnElkies.Euclidean d, ((f.function x).re : ℂ) = f.function x := by intro x apply Complex.ext · simp · simp [f.real x] have hfourier : ∀ x : CohnElkies.Euclidean d, (((𝓕 f.function : CohnElkies.TestFunction d) x).re : ℂ) = (𝓕 f.function : CohnElkies.TestFunction d) x := by intro x apply Complex.ext · simp · simp [f.fourier_real x] have h := LinearProgrammingBound hfne hreal hfourier (fun x hx => f.outside_nonpos x hx) f.fourier_nonneg hd rw [volume_half_ball hd] at h have horigin : 0 ≤ (f.function (0 : CohnElkies.Euclidean d)).re := (CohnElkies.admissible_zero_pos f).le have hratio : ((f.function (0 : CohnElkies.Euclidean d)).re.toNNReal : ENNReal) / (((𝓕 f.function : CohnElkies.TestFunction d) (0 : CohnElkies.Euclidean d)).re.toNNReal : ENNReal) = ENNReal.ofReal (CohnElkies.quotient f) := by rw [← ENNReal.coe_div (Real.toNNReal_pos.mpr f.fourier_zero_pos).ne'] simp only [CohnElkies.quotient, ENNReal.ofReal, Real.toNNReal_div horigin] change SpherePackingConstant d ≤ ((f.function (0 : CohnElkies.Euclidean d)).re.toNNReal : ENNReal) / (((𝓕 f.function : CohnElkies.TestFunction d) (0 : CohnElkies.Euclidean d)).re.toNNReal : ENNReal) * ENNReal.ofReal (CohnElkies.unitBallVolume d / (2 : ℝ) ^ d) at h rw [hratio] at h calc SpherePackingConstant d ≤ ENNReal.ofReal (CohnElkies.quotient f) * ENNReal.ofReal (CohnElkies.unitBallVolume d / (2 : ℝ) ^ d) := h _ = ENNReal.ofReal (CohnElkies.unitBallVolume d / (2 : ℝ) ^ d * CohnElkies.quotient f) := by rw [ENNReal.ofReal_mul (CohnElkies.geometricFactor_pos d).le] exact mul_comm _ _ theorem sphere_packing_le_radial_linear_program {d : ℕ} (hd : 0 < d) : (SpherePackingConstant d).toReal ≤ CohnElkies.linearProgram d := by have hfactor := CohnElkies.geometricFactor_pos d have hbound : (SpherePackingConstant d).toReal / (CohnElkies.unitBallVolume d / (2 : ℝ) ^ d) ≤ sInf (CohnElkies.quotientSet d) := by apply le_csInf (CohnElkies.quotientSet_nonempty d) rintro _ ⟨f, rfl⟩ apply (div_le_iff₀ hfactor).2 have hcost : 0 ≤ CohnElkies.unitBallVolume d / (2 : ℝ) ^ d * CohnElkies.quotient f := mul_nonneg hfactor.le (CohnElkies.quotient_pos f).le have h := ENNReal.toReal_le_of_le_ofReal hcost (sphere_packing_le_admissible hd f) simpa [mul_comm] using! h unfold CohnElkies.linearProgram simpa [mul_comm] using! (div_le_iff₀ hfactor).1 hbound theorem sphere_packing_le_radial_linear_program_ennreal {d : ℕ} (hd : 0 < d) : SpherePackingConstant d ≤ ENNReal.ofReal (CohnElkies.linearProgram d) := by have hfinite : SpherePackingConstant d ≠ ⊤ := by apply ne_top_of_le_ne_top ENNReal.one_ne_top unfold SpherePackingConstant exact iSup_le fun P => SpherePacking.upper_packing_density_le_one P exact (ENNReal.le_ofReal_iff_toReal_le hfinite (CohnElkies.linearProgram_nonneg d)).2 (sphere_packing_le_radial_linear_program hd) theorem sphere_packing_sharp_asymptotic_upper : ∃ e : ℕ → ℝ, Asymptotics.IsLittleO atTop e (fun _ : ℕ => (1 : ℝ)) ∧ ∀ d : ℕ, 0 < d → SpherePackingConstant d ≤ ENNReal.ofReal ((Real.sqrt (Real.exp 1 / (2 * Real.pi)) + e d) ^ d) := by obtain ⟨e, he, hformula⟩ := CohnElkies.exists_manuscriptPackingIsLittleO refine ⟨e, he, fun d hd => ?_⟩ change SpherePackingConstant d ≤ ENNReal.ofReal ((CohnElkies.criticalPackingBase + e d) ^ d) rw [← hformula d hd] exact sphere_packing_le_radial_linear_program_ennreal hd end PackingBounds.PackingBridge end section set_option backward.isDefEq.respectTransparency false set_option backward.defeqAttrib.useBackward true set_option maxHeartbeats 800000 noncomputable section open Filter MeasureTheory open scoped ENNReal FourierTransform SchwartzMap Topology namespace PackingBounds structure FullAdmissible (d : ℕ) where function : CohnElkies.TestFunction d real : ∀ x : CohnElkies.Euclidean d, (function x).im = 0 fourier_real : ∀ x : CohnElkies.Euclidean d, ((𝓕 function) x).im = 0 fourier_nonneg : ∀ x : CohnElkies.Euclidean d, 0 ≤ ((𝓕 function) x).re fourier_zero_pos : 0 < ((𝓕 function) (0 : CohnElkies.Euclidean d)).re outside_nonpos : ∀ x : CohnElkies.Euclidean d, 1 ≤ ‖x‖ → (function x).re ≤ 0 def fullQuotient {d : ℕ} (f : FullAdmissible d) : ℝ := (f.function (0 : CohnElkies.Euclidean d)).re / ((𝓕 f.function) (0 : CohnElkies.Euclidean d)).re def fullQuotientSet (d : ℕ) : Set ℝ := Set.range (fullQuotient (d := d)) def fullLinearProgram (d : ℕ) : ℝ := CohnElkies.unitBallVolume d / (2 : ℝ) ^ d * sInf (fullQuotientSet d) def radialToFull {d : ℕ} (f : CohnElkies.Admissible d) : FullAdmissible d where function := f.function real := f.real fourier_real := f.fourier_real fourier_nonneg := f.fourier_nonneg fourier_zero_pos := f.fourier_zero_pos outside_nonpos := f.outside_nonpos theorem fullQuotient_radialToFull {d : ℕ} (f : CohnElkies.Admissible d) : fullQuotient (radialToFull f) = CohnElkies.quotient f := by rfl theorem fullQuotientSet_eq_radial_iff (d : ℕ) : fullQuotientSet d = CohnElkies.quotientSet d ↔ ∀ f : FullAdmissible d, ∃ g : CohnElkies.Admissible d, CohnElkies.quotient g = fullQuotient f := by constructor · intro h f have hf : fullQuotient f ∈ fullQuotientSet d := ⟨f, rfl⟩ rw [h] at hf exact hf · intro h apply Set.Subset.antisymm · rintro _ ⟨f, rfl⟩ exact h f · rintro _ ⟨f, rfl⟩ exact ⟨radialToFull f, fullQuotient_radialToFull f⟩ end PackingBounds end end noncomputable section open scoped FourierTransform Real Topology namespace SpherePacking.Alternative abbrev Ambient (d : ℕ) := EuclideanSpace ℝ (Fin d) abbrev Schwartz (d : ℕ) := SchwartzMap (Ambient d) ℂ def IsRealValued {d : ℕ} (f : Schwartz d) : Prop := ∀ x, (f x).im = 0 def IsRadial {d : ℕ} (f : Schwartz d) : Prop := ∀ x y : Ambient d, ‖x‖ = ‖y‖ → f x = f y def fourierReal {d : ℕ} (f : Schwartz d) (x : Ambient d) : ℝ := ((𝓕 f : Schwartz d) x).re structure IsAdmissible {d : ℕ} (f : Schwartz d) : Prop where real_valued : IsRealValued f radial : IsRadial f fourier_real_valued : IsRealValued (𝓕 f : Schwartz d) fourier_zero_pos : 0 < fourierReal f 0 fourier_nonneg : ∀ x, 0 ≤ fourierReal f x eventually_nonpos : ∀ x : Ambient d, 1 ≤ ‖x‖ → (f x).re ≤ 0 def quotient {d : ℕ} (f : Schwartz d) : ℝ := (f 0).re / fourierReal f 0 end SpherePacking.Alternative end noncomputable section open Set Matrix MeasureTheory namespace SpherePacking.Alternative abbrev OrthogonalGroup (d : ℕ) := Matrix.orthogonalGroup (Fin d) ℝ theorem orthogonal_entry_abs_le_one {d : ℕ} {A : Matrix (Fin d) (Fin d) ℝ} (hA : A ∈ Matrix.orthogonalGroup (Fin d) ℝ) (i j : Fin d) : |A i j| ≤ (1 : ℝ) := by have hdiag := congrArg (fun B : Matrix (Fin d) (Fin d) ℝ => B i i) ((Matrix.mem_orthogonalGroup_iff (Fin d) ℝ).mp hA) have hsum : (∑ k : Fin d, A i k * A i k) = (1 : ℝ) := by simpa [Matrix.mul_apply] using hdiag have hterm : A i j * A i j ≤ ∑ k : Fin d, A i k * A i k := by exact Finset.single_le_sum (fun k _ => mul_self_nonneg (A i k)) (Finset.mem_univ j) exact (abs_le_one_iff_mul_self_le_one).2 (hterm.trans_eq hsum) theorem orthogonal_isCompact (d : ℕ) : IsCompact (Matrix.orthogonalGroup (Fin d) ℝ : Set (Matrix (Fin d) (Fin d) ℝ)) := by refine ((isCompact_Icc (a := (-1 : ℝ)) (b := (1 : ℝ))).matrix).of_isClosed_subset isClosed_unitary ?_ intro A hA change ∀ i j, A i j ∈ Set.Icc (-1 : ℝ) 1 intro i j exact abs_le.mp (orthogonal_entry_abs_le_one hA i j) instance orthogonalGroupCompactSpace (d : ℕ) : CompactSpace (OrthogonalGroup d) := isCompact_iff_compactSpace.mp (orthogonal_isCompact d) instance orthogonalGroupMeasurableSpace (d : ℕ) : MeasurableSpace (OrthogonalGroup d) := borel (OrthogonalGroup d) instance orthogonalGroupBorelSpace (d : ℕ) : BorelSpace (OrthogonalGroup d) := ⟨rfl⟩ def orthogonalAction {d : ℕ} (U : OrthogonalGroup d) (x : Ambient d) : Ambient d := Matrix.toLpLin 2 2 (U : Matrix (Fin d) (Fin d) ℝ) x @[simp] theorem orthogonalAction_one {d : ℕ} (x : Ambient d) : orthogonalAction (1 : OrthogonalGroup d) x = x := by change Matrix.toLpLin 2 2 (1 : Matrix (Fin d) (Fin d) ℝ) x = x rw [Matrix.toLpLin_one] rfl @[simp] theorem orthogonalAction_mul {d : ℕ} (U V : OrthogonalGroup d) (x : Ambient d) : orthogonalAction (U * V) x = orthogonalAction U (orthogonalAction V x) := by change Matrix.toLpLin 2 2 ((U : Matrix (Fin d) (Fin d) ℝ) * (V : Matrix (Fin d) (Fin d) ℝ)) x = Matrix.toLpLin 2 2 (U : Matrix (Fin d) (Fin d) ℝ) (Matrix.toLpLin 2 2 (V : Matrix (Fin d) (Fin d) ℝ) x) rw [Matrix.toLpLin_mul_same] rfl @[simp] theorem orthogonalAction_zero {d : ℕ} (U : OrthogonalGroup d) : orthogonalAction U (0 : Ambient d) = 0 := by exact map_zero (Matrix.toLpLin 2 2 (U : Matrix (Fin d) (Fin d) ℝ)) def orthogonalIsometryEquiv (d : ℕ) : OrthogonalGroup d ≃* (Ambient d ≃ₗᵢ[ℝ] Ambient d) := (Unitary.mapEquiv (StarMulEquiv.ofClass (Matrix.toEuclideanCLM (n := Fin d) (𝕜 := ℝ)))).toMulEquiv.trans Unitary.linearIsometryEquiv def orthogonalLinearIsometry {d : ℕ} (U : OrthogonalGroup d) : Ambient d ≃ₗᵢ[ℝ] Ambient d := orthogonalIsometryEquiv d U @[simp] theorem orthogonalLinearIsometry_apply {d : ℕ} (U : OrthogonalGroup d) (x : Ambient d) : orthogonalLinearIsometry U x = orthogonalAction U x := by rfl theorem orthogonalAction_continuous {d : ℕ} (x : Ambient d) : Continuous (fun U : OrthogonalGroup d => orthogonalAction U x) := by change Continuous (fun U : OrthogonalGroup d => WithLp.toLp 2 ((U : Matrix (Fin d) (Fin d) ℝ) *ᵥ WithLp.ofLp x)) exact (EuclideanSpace.equiv (Fin d) ℝ).symm.continuous.comp (continuous_subtype_val.matrix_mulVec continuous_const) theorem continuous_orthogonalAction_apply {d : ℕ} (x : Ambient d) : Continuous (fun U : OrthogonalGroup d => orthogonalAction U x) := orthogonalAction_continuous x theorem orthogonalAction_joint_continuous (d : ℕ) : Continuous (fun p : OrthogonalGroup d × Ambient d => orthogonalAction p.1 p.2) := by change Continuous (fun p : OrthogonalGroup d × Ambient d => WithLp.toLp 2 (((p.1 : Matrix (Fin d) (Fin d) ℝ) *ᵥ WithLp.ofLp p.2))) exact (PiLp.continuous_toLp 2 (fun _ : Fin d => ℝ)).comp ((continuous_subtype_val.comp continuous_fst).matrix_mulVec ((PiLp.continuous_ofLp 2 (fun _ : Fin d => ℝ)).comp continuous_snd)) def orthogonalMatrixOfIsometry {d : ℕ} (A : Ambient d ≃ₗᵢ[ℝ] Ambient d) : OrthogonalGroup d := ⟨A.toMatrix (EuclideanSpace.basisFun (Fin d) ℝ).toBasis (EuclideanSpace.basisFun (Fin d) ℝ).toBasis, A.toMatrix_mem_unitaryGroup (EuclideanSpace.basisFun (Fin d) ℝ) (EuclideanSpace.basisFun (Fin d) ℝ)⟩ @[simp] theorem orthogonalMatrixOfIsometry_action {d : ℕ} (A : Ambient d ≃ₗᵢ[ℝ] Ambient d) (x : Ambient d) : orthogonalAction (orthogonalMatrixOfIsometry A) x = A x := by change (Matrix.toLpLin 2 2) ((LinearMap.toMatrix (EuclideanSpace.basisFun (Fin d) ℝ).toBasis (EuclideanSpace.basisFun (Fin d) ℝ).toBasis) A.toLinearEquiv.toLinearMap) x = A x rw [Matrix.toLpLin_eq_toLin] change (Matrix.toLin (EuclideanSpace.basisFun (Fin d) ℝ).toBasis (EuclideanSpace.basisFun (Fin d) ℝ).toBasis) ((LinearMap.toMatrix (EuclideanSpace.basisFun (Fin d) ℝ).toBasis (EuclideanSpace.basisFun (Fin d) ℝ).toBasis) A.toLinearEquiv.toLinearMap) x = A x rw [Matrix.toLin_toMatrix] rfl theorem orthogonal_transitive {d : ℕ} {x y : Ambient d} (hxy : ‖x‖ = ‖y‖) : ∃ U : OrthogonalGroup d, orthogonalAction U x = y := by let A : Ambient d ≃ₗᵢ[ℝ] Ambient d := Submodule.reflection (ℝ ∙ (x - y))ᗮ refine ⟨orthogonalMatrixOfIsometry A, ?_⟩ rw [orthogonalMatrixOfIsometry_action] exact Submodule.reflection_sub hxy def orthogonalPositiveCompacts (d : ℕ) : TopologicalSpace.PositiveCompacts (OrthogonalGroup d) := ⟨⟨Set.univ, isCompact_univ⟩, by simp⟩ def radialOrthogonalHaar (d : ℕ) : Measure (OrthogonalGroup d) := Measure.haarMeasure (orthogonalPositiveCompacts d) @[simp] theorem radialOrthogonalHaar_univ (d : ℕ) : radialOrthogonalHaar d Set.univ = 1 := by simpa [radialOrthogonalHaar, orthogonalPositiveCompacts] using (Measure.haarMeasure_self (K₀ := orthogonalPositiveCompacts d)) instance radialOrthogonalHaar_probability (d : ℕ) : IsProbabilityMeasure (radialOrthogonalHaar d) := ⟨radialOrthogonalHaar_univ d⟩ instance radialOrthogonalHaar_isHaar (d : ℕ) : (radialOrthogonalHaar d).IsHaarMeasure := by unfold radialOrthogonalHaar infer_instance instance radialOrthogonalHaar_leftInvariant (d : ℕ) : (radialOrthogonalHaar d).IsMulLeftInvariant := by unfold radialOrthogonalHaar infer_instance instance radialOrthogonalHaar_finite (d : ℕ) : IsFiniteMeasure (radialOrthogonalHaar d) := by infer_instance end SpherePacking.Alternative end noncomputable section open Filter MeasureTheory open scoped ContDiff Topology namespace SpherePacking.Alternative noncomputable def radialIsometrySchwartzOrbit {d : ℕ} (U : Ambient d ≃ₗᵢ[ℝ] Ambient d) (f : Schwartz d) : Schwartz d := SchwartzMap.compCLMOfContinuousLinearEquiv ℂ U.toContinuousLinearEquiv f @[simp] theorem radialIsometrySchwartzOrbit_apply {d : ℕ} (U : Ambient d ≃ₗᵢ[ℝ] Ambient d) (f : Schwartz d) (x : Ambient d) : radialIsometrySchwartzOrbit U f x = f (U x) := by rfl @[simp] theorem radialIsometrySchwartzOrbit_symm_apply {d : ℕ} (U : Ambient d ≃ₗᵢ[ℝ] Ambient d) (f : Schwartz d) : radialIsometrySchwartzOrbit U.symm (radialIsometrySchwartzOrbit U f) = f := by ext x simp theorem radialIsometrySchwartzOrbit_iteratedFDeriv_norm {d : ℕ} (U : Ambient d ≃ₗᵢ[ℝ] Ambient d) (f : Schwartz d) (n : ℕ) (x : Ambient d) : ‖iteratedFDeriv ℝ n (radialIsometrySchwartzOrbit U f : Ambient d → ℂ) x‖ = ‖iteratedFDeriv ℝ n (f : Ambient d → ℂ) (U x)‖ := by change ‖iteratedFDeriv ℝ n ((f : Ambient d → ℂ) ∘ (U : Ambient d → Ambient d)) x‖ = _ exact U.norm_iteratedFDeriv_comp_right (f : Ambient d → ℂ) x n theorem radialIsometrySchwartzOrbit_iteratedFDeriv {d : ℕ} (U : Ambient d ≃ₗᵢ[ℝ] Ambient d) (f : Schwartz d) (n : ℕ) (x : Ambient d) : iteratedFDeriv ℝ n (radialIsometrySchwartzOrbit U f : Ambient d → ℂ) x = (iteratedFDeriv ℝ n (f : Ambient d → ℂ) (U x)).compContinuousLinearMap (fun _ ↦ U.toContinuousLinearMap) := by change iteratedFDeriv ℝ n ((f : Ambient d → ℂ) ∘ (U : Ambient d → Ambient d)) x = _ exact U.toContinuousLinearMap.iteratedFDeriv_comp_right (f.smooth ⊤) x (mod_cast le_top) theorem radialIsometrySchwartzOrbit_weighted_iteratedFDeriv_le {d : ℕ} (U : Ambient d ≃ₗᵢ[ℝ] Ambient d) (f : Schwartz d) (k n : ℕ) (x : Ambient d) : ‖x‖ ^ k * ‖iteratedFDeriv ℝ n (radialIsometrySchwartzOrbit U f : Ambient d → ℂ) x‖ ≤ SchwartzMap.seminorm ℂ k n f := by rw [radialIsometrySchwartzOrbit_iteratedFDeriv_norm, ← U.norm_map x] exact SchwartzMap.le_seminorm ℂ k n f (U x) theorem radialIsometrySchwartzOrbit_seminorm_le {d : ℕ} (U : Ambient d ≃ₗᵢ[ℝ] Ambient d) (f : Schwartz d) (k n : ℕ) : SchwartzMap.seminorm ℂ k n (radialIsometrySchwartzOrbit U f) ≤ SchwartzMap.seminorm ℂ k n f := by apply SchwartzMap.seminorm_le_bound ℂ k n (radialIsometrySchwartzOrbit U f) (apply_nonneg (SchwartzMap.seminorm ℂ k n) f) exact radialIsometrySchwartzOrbit_weighted_iteratedFDeriv_le U f k n theorem radialIsometrySchwartzOrbit_seminorm_eq {d : ℕ} (U : Ambient d ≃ₗᵢ[ℝ] Ambient d) (f : Schwartz d) (k n : ℕ) : SchwartzMap.seminorm ℂ k n (radialIsometrySchwartzOrbit U f) = SchwartzMap.seminorm ℂ k n f := by apply le_antisymm (radialIsometrySchwartzOrbit_seminorm_le U f k n) have h := radialIsometrySchwartzOrbit_seminorm_le U.symm (radialIsometrySchwartzOrbit U f) k n simpa using h end SpherePacking.Alternative end noncomputable section open Filter MeasureTheory Set open scoped ContDiff Real Topology namespace SpherePacking.Alternative theorem orthogonalLinearIsometry_continuousLinearMap_continuous (d : ℕ) : Continuous (fun U : OrthogonalGroup d => (orthogonalLinearIsometry U).toContinuousLinearMap) := by change Continuous (fun U : OrthogonalGroup d => Matrix.toEuclideanCLM (n := Fin d) (𝕜 := ℝ) (U : Matrix (Fin d) (Fin d) ℝ)) exact (Matrix.toEuclideanCLM (n := Fin d) (𝕜 := ℝ)).toAlgEquiv.toLinearEquiv.toLinearMap |>.continuous_of_finiteDimensional |>.comp continuous_subtype_val theorem orthogonalSchwartzIteratedFDeriv_continuous {d : ℕ} (f : Schwartz d) (n : ℕ) (x : Ambient d) : Continuous (fun U : OrthogonalGroup d => iteratedFDeriv ℝ n (radialIsometrySchwartzOrbit (orthogonalLinearIsometry U) f : Ambient d → ℂ) x) := by have hderiv : Continuous (fun U : OrthogonalGroup d => iteratedFDeriv ℝ n (f : Ambient d → ℂ) (orthogonalAction U x)) := ((f.smooth ⊤).continuous_iteratedFDeriv (mod_cast le_top)).comp (orthogonalAction_continuous x) have hmaps : Continuous (fun U : OrthogonalGroup d => fun _ : Fin n => (orthogonalLinearIsometry U).toContinuousLinearMap) := continuous_pi fun _ => orthogonalLinearIsometry_continuousLinearMap_continuous d have hcomp : Continuous (fun p : ContinuousMultilinearMap ℝ (fun _ : Fin n => Ambient d) ℂ × (Fin n → Ambient d →L[ℝ] Ambient d) => p.1.compContinuousLinearMap p.2) := by exact continuous_iff_continuousAt.2 fun p => (ContinuousMultilinearMap.hasStrictFDerivAt_compContinuousLinearMap p).continuousAt have h := hcomp.comp (hderiv.prodMk hmaps) simpa [Function.comp_def, radialIsometrySchwartzOrbit_iteratedFDeriv, orthogonalLinearIsometry_apply] using h theorem orthogonalSchwartzInverseIteratedFDeriv_continuous {d : ℕ} (f : Schwartz d) (n : ℕ) (x : Ambient d) : Continuous (fun U : OrthogonalGroup d => iteratedFDeriv ℝ n (radialIsometrySchwartzOrbit (orthogonalLinearIsometry U⁻¹) f : Ambient d → ℂ) x) := (orthogonalSchwartzIteratedFDeriv_continuous f n x).comp continuous_inv theorem orthogonalSchwartzInverseIteratedFDeriv_aestronglyMeasurable {d : ℕ} (f : Schwartz d) (n : ℕ) (x : Ambient d) : AEStronglyMeasurable (fun U : OrthogonalGroup d => iteratedFDeriv ℝ n (radialIsometrySchwartzOrbit (orthogonalLinearIsometry U⁻¹) f : Ambient d → ℂ) x) (radialOrthogonalHaar d) := (orthogonalSchwartzInverseIteratedFDeriv_continuous f n x).aestronglyMeasurable_of_compactSpace end SpherePacking.Alternative namespace SpherePacking.Alternative section ProbabilityAverage variable {α : Type*} [MeasurableSpace α] variable (μ : Measure α) [IsProbabilityMeasure μ] variable {d : ℕ} (g : α → Schwartz d) (C : ℕ → ℕ → ℝ) theorem radialSchwartzParametricDerivativeIntegrable (hmeas : ∀ (n : ℕ) (x : Ambient d), AEStronglyMeasurable (fun a : α ↦ iteratedFDeriv ℝ n (g a : Ambient d → ℂ) x) μ) (hbound : ∀ (a : α) (k n : ℕ), SchwartzMap.seminorm ℂ k n (g a) ≤ C k n) (n : ℕ) (x : Ambient d) : Integrable (fun a : α ↦ iteratedFDeriv ℝ n (g a : Ambient d → ℂ) x) μ := by apply Integrable.of_bound (hmeas n x) (C 0 n) filter_upwards [] with a exact (SchwartzMap.norm_iteratedFDeriv_le_seminorm ℂ (g a) n x).trans (hbound a 0 n) theorem radialSchwartzParametric_hasFDerivAt_iteratedIntegral (hmeas : ∀ (n : ℕ) (x : Ambient d), AEStronglyMeasurable (fun a : α ↦ iteratedFDeriv ℝ n (g a : Ambient d → ℂ) x) μ) (hbound : ∀ (a : α) (k n : ℕ), SchwartzMap.seminorm ℂ k n (g a) ≤ C k n) (n : ℕ) (x : Ambient d) : HasFDerivAt (fun y : Ambient d ↦ ∫ a : α, iteratedFDeriv ℝ n (g a : Ambient d → ℂ) y ∂μ) (∫ a : α, fderiv ℝ (iteratedFDeriv ℝ n (g a : Ambient d → ℂ)) x ∂μ) x := by have hderiv_meas : AEStronglyMeasurable (fun a : α ↦ fderiv ℝ (iteratedFDeriv ℝ n (g a : Ambient d → ℂ)) x) μ := by have h := (continuousMultilinearCurryLeftEquiv ℝ (fun _ : Fin (n + 1) ↦ Ambient d) ℂ).continuous.comp_aestronglyMeasurable (hmeas (n + 1) x) simpa only [fderiv_iteratedFDeriv, Function.comp_apply] using h apply hasFDerivAt_integral_of_dominated_of_fderiv_le (𝕜 := ℝ) (F := fun y : Ambient d ↦ fun a : α ↦ iteratedFDeriv ℝ n (g a : Ambient d → ℂ) y) (F' := fun y : Ambient d ↦ fun a : α ↦ fderiv ℝ (iteratedFDeriv ℝ n (g a : Ambient d → ℂ)) y) (bound := fun _ : α ↦ C 0 (n + 1)) (s := Set.univ) Filter.univ_mem (Filter.Eventually.of_forall (fun y ↦ hmeas n y)) (radialSchwartzParametricDerivativeIntegrable μ g C hmeas hbound n x) hderiv_meas (by filter_upwards [] with a y _ calc ‖fderiv ℝ (iteratedFDeriv ℝ n (g a : Ambient d → ℂ)) y‖ = ‖iteratedFDeriv ℝ (n + 1) (g a : Ambient d → ℂ) y‖ := norm_fderiv_iteratedFDeriv _ ≤ SchwartzMap.seminorm ℂ 0 (n + 1) (g a) := SchwartzMap.norm_iteratedFDeriv_le_seminorm ℂ (g a) (n + 1) y _ ≤ C 0 (n + 1) := hbound a 0 (n + 1)) (integrable_const (C 0 (n + 1))) filter_upwards [] with a y _ exact (((g a).smooth ⊤).differentiable_iteratedFDeriv (ENat.natCast_lt_of_coe_top_le_withTop (le_refl _) n)).differentiableAt.hasFDerivAt theorem radialSchwartzParametric_iteratedFDeriv_integral (hmeas : ∀ (n : ℕ) (x : Ambient d), AEStronglyMeasurable (fun a : α ↦ iteratedFDeriv ℝ n (g a : Ambient d → ℂ) x) μ) (hbound : ∀ (a : α) (k n : ℕ), SchwartzMap.seminorm ℂ k n (g a) ≤ C k n) (n : ℕ) (x : Ambient d) : iteratedFDeriv ℝ n (fun y : Ambient d ↦ ∫ a : α, (g a) y ∂μ) x = ∫ a : α, iteratedFDeriv ℝ n (g a : Ambient d → ℂ) x ∂μ := by induction n generalizing x with | zero => ext v rw [ContinuousMultilinearMap.integral_apply (radialSchwartzParametricDerivativeIntegrable μ g C hmeas hbound 0 x)] simp | succ n ih => rw [iteratedFDeriv_succ_eq_comp_left, Function.comp_apply] have hprevious : iteratedFDeriv ℝ n (fun y : Ambient d ↦ ∫ a : α, (g a) y ∂μ) = fun y : Ambient d ↦ ∫ a : α, iteratedFDeriv ℝ n (g a : Ambient d → ℂ) y ∂μ := by funext y exact ih y rw [hprevious, (radialSchwartzParametric_hasFDerivAt_iteratedIntegral μ g C hmeas hbound n x).fderiv] calc (continuousMultilinearCurryLeftEquiv ℝ (fun _ : Fin (n + 1) ↦ Ambient d) ℂ).symm (∫ a : α, fderiv ℝ (iteratedFDeriv ℝ n (g a : Ambient d → ℂ)) x ∂μ) = ∫ a : α, (continuousMultilinearCurryLeftEquiv ℝ (fun _ : Fin (n + 1) ↦ Ambient d) ℂ).symm (fderiv ℝ (iteratedFDeriv ℝ n (g a : Ambient d → ℂ)) x) ∂μ := by exact (LinearIsometry.integral_comp_comm (𝕜 := ℝ) (LinearIsometryEquiv.toLinearIsometry ((continuousMultilinearCurryLeftEquiv ℝ (fun _ : Fin (n + 1) ↦ Ambient d) ℂ).symm)) (fun a : α ↦ fderiv ℝ (iteratedFDeriv ℝ n (g a : Ambient d → ℂ)) x)).symm _ = ∫ a : α, iteratedFDeriv ℝ (n + 1) (g a : Ambient d → ℂ) x ∂μ := by apply integral_congr_ae filter_upwards [] with a rw [iteratedFDeriv_succ_eq_comp_left] rfl end ProbabilityAverage end SpherePacking.Alternative end noncomputable section open MeasureTheory open scoped Topology namespace SpherePacking.Alternative def radialSymmetrizationAverage {d : ℕ} (f : Schwartz d) (x : Ambient d) : ℂ := ∫ U : OrthogonalGroup d, f (orthogonalAction U⁻¹ x) ∂radialOrthogonalHaar d theorem radialSymmetrizationAverage_integrable {d : ℕ} (f : Schwartz d) (x : Ambient d) : Integrable (fun U : OrthogonalGroup d ↦ f (orthogonalAction U⁻¹ x)) (radialOrthogonalHaar d) := by have hcontinuous : Continuous (fun U : OrthogonalGroup d ↦ f (orthogonalAction U⁻¹ x)) := f.continuous.comp ((continuous_orthogonalAction_apply x).comp continuous_inv) simpa using hcontinuous.continuousOn.integrableOn_compact isCompact_univ theorem radialSymmetrizationAverage_comp_orthogonal {d : ℕ} (f : Schwartz d) (A : OrthogonalGroup d) (x : Ambient d) : radialSymmetrizationAverage f (orthogonalAction A x) = radialSymmetrizationAverage f x := by unfold radialSymmetrizationAverage calc (∫ U : OrthogonalGroup d, f (orthogonalAction U⁻¹ (orthogonalAction A x)) ∂radialOrthogonalHaar d) = ∫ U : OrthogonalGroup d, f (orthogonalAction (A * U)⁻¹ (orthogonalAction A x)) ∂radialOrthogonalHaar d := (integral_mul_left_eq_self (μ := radialOrthogonalHaar d) (fun U : OrthogonalGroup d ↦ f (orthogonalAction U⁻¹ (orthogonalAction A x))) A).symm _ = ∫ U : OrthogonalGroup d, f (orthogonalAction U⁻¹ x) ∂radialOrthogonalHaar d := by apply integral_congr_ae filter_upwards with U simp only [mul_inv_rev, orthogonalAction_mul] rw [← orthogonalAction_mul A⁻¹ A x] simp theorem radialSymmetrizationAverage_eq_of_norm_eq {d : ℕ} (f : Schwartz d) {x y : Ambient d} (hxy : ‖x‖ = ‖y‖) : radialSymmetrizationAverage f x = radialSymmetrizationAverage f y := by obtain ⟨A, hA⟩ := orthogonal_transitive hxy rw [← hA] exact (radialSymmetrizationAverage_comp_orthogonal f A x).symm @[simp] theorem radialSymmetrizationAverage_zero {d : ℕ} (f : Schwartz d) : radialSymmetrizationAverage f 0 = f 0 := by simp [radialSymmetrizationAverage] end SpherePacking.Alternative end noncomputable section open MeasureTheory Filter open scoped Topology ContDiff namespace SpherePacking.Alternative theorem scalarProbabilityAverage_weighted_iteratedFDeriv_le {ι : Type*} [MeasurableSpace ι] (μ : Measure ι) [IsProbabilityMeasure μ] {d : ℕ} (F : ι → Schwartz d) (C : ℕ → ℕ → ℝ) (hbound : ∀ (k n : ℕ) (a : ι) (x : Ambient d), ‖x‖ ^ k * ‖iteratedFDeriv ℝ n (fun y : Ambient d ↦ F a y) x‖ ≤ C k n) (hderiv : ∀ (n : ℕ) (x : Ambient d), iteratedFDeriv ℝ n (fun y : Ambient d ↦ ∫ a, F a y ∂μ) x = ∫ a, iteratedFDeriv ℝ n (fun y : Ambient d ↦ F a y) x ∂μ) (k n : ℕ) (x : Ambient d) : ‖x‖ ^ k * ‖iteratedFDeriv ℝ n (fun y : Ambient d ↦ ∫ a, F a y ∂μ) x‖ ≤ C k n := by rw [hderiv n x] calc ‖x‖ ^ k * ‖∫ a, iteratedFDeriv ℝ n (fun y : Ambient d ↦ F a y) x ∂μ‖ ≤ ‖x‖ ^ k * ∫ a, ‖iteratedFDeriv ℝ n (fun y : Ambient d ↦ F a y) x‖ ∂μ := mul_le_mul_of_nonneg_left (norm_integral_le_integral_norm _) (by positivity) _ = ∫ a, ‖x‖ ^ k * ‖iteratedFDeriv ℝ n (fun y : Ambient d ↦ F a y) x‖ ∂μ := by rw [integral_const_mul] _ ≤ ∫ _a : ι, C k n ∂μ := by apply integral_mono_of_nonneg · exact Eventually.of_forall (fun _ ↦ by positivity) · exact integrable_const _ · exact Eventually.of_forall (fun a ↦ hbound k n a x) _ = C k n := by simp noncomputable def scalarProbabilitySchwartzAverage {ι : Type*} [MeasurableSpace ι] (μ : Measure ι) [IsProbabilityMeasure μ] {d : ℕ} (F : ι → Schwartz d) (C : ℕ → ℕ → ℝ) (hsmooth : ContDiff ℝ ∞ (fun x : Ambient d ↦ ∫ a, F a x ∂μ)) (hderiv : ∀ (n : ℕ) (x : Ambient d), iteratedFDeriv ℝ n (fun y : Ambient d ↦ ∫ a, F a y ∂μ) x = ∫ a, iteratedFDeriv ℝ n (fun y : Ambient d ↦ F a y) x ∂μ) (hbound : ∀ (k n : ℕ) (a : ι) (x : Ambient d), ‖x‖ ^ k * ‖iteratedFDeriv ℝ n (fun y : Ambient d ↦ F a y) x‖ ≤ C k n) : Schwartz d where toFun x := ∫ a, F a x ∂μ smooth' := hsmooth decay' k n := ⟨C k n, scalarProbabilityAverage_weighted_iteratedFDeriv_le μ F C hbound hderiv k n⟩ noncomputable def radialSymmetrization {d : ℕ} (f : Schwartz d) : Schwartz d := by let F : OrthogonalGroup d → Schwartz d := fun U ↦ radialIsometrySchwartzOrbit (orthogonalLinearIsometry U⁻¹) f let C : ℕ → ℕ → ℝ := fun k n ↦ SchwartzMap.seminorm ℂ k n f have hmeas : ∀ (n : ℕ) (x : Ambient d), AEStronglyMeasurable (fun U : OrthogonalGroup d ↦ iteratedFDeriv ℝ n (F U : Ambient d → ℂ) x) (radialOrthogonalHaar d) := by intro n x exact orthogonalSchwartzInverseIteratedFDeriv_aestronglyMeasurable f n x have hseminorm : ∀ (U : OrthogonalGroup d) (k n : ℕ), SchwartzMap.seminorm ℂ k n (F U) ≤ C k n := by intro U k n exact (radialIsometrySchwartzOrbit_seminorm_eq (orthogonalLinearIsometry U⁻¹) f k n).le have hderiv : ∀ (n : ℕ) (x : Ambient d), iteratedFDeriv ℝ n (fun y : Ambient d ↦ ∫ U, F U y ∂radialOrthogonalHaar d) x = ∫ U, iteratedFDeriv ℝ n (fun y : Ambient d ↦ F U y) x ∂radialOrthogonalHaar d := by intro n x exact radialSchwartzParametric_iteratedFDeriv_integral (radialOrthogonalHaar d) F C hmeas hseminorm n x have hsmooth : ContDiff ℝ ∞ (fun x : Ambient d ↦ ∫ U, F U x ∂radialOrthogonalHaar d) := by refine contDiff_of_differentiable_iteratedFDeriv ?_ intro n _ have heq := funext (hderiv n) rw [heq] intro x exact (radialSchwartzParametric_hasFDerivAt_iteratedIntegral (radialOrthogonalHaar d) F C hmeas hseminorm n x).differentiableAt have hweighted : ∀ (k n : ℕ) (U : OrthogonalGroup d) (x : Ambient d), ‖x‖ ^ k * ‖iteratedFDeriv ℝ n (fun y : Ambient d ↦ F U y) x‖ ≤ C k n := by intro k n U x exact radialIsometrySchwartzOrbit_weighted_iteratedFDeriv_le (orthogonalLinearIsometry U⁻¹) f k n x exact scalarProbabilitySchwartzAverage (radialOrthogonalHaar d) F C hsmooth hderiv hweighted @[simp] theorem radialSymmetrization_apply {d : ℕ} (f : Schwartz d) (x : Ambient d) : radialSymmetrization f x = radialSymmetrizationAverage f x := by rfl end SpherePacking.Alternative end noncomputable section open MeasureTheory open scoped FourierTransform Topology namespace SpherePacking.Alternative def orthogonalScalarAverage {d : ℕ} {G : Type*} [MeasurableSpace G] (μ : Measure G) (A : G → (Ambient d ≃ₗᵢ[ℝ] Ambient d)) (f : Schwartz d) (x : Ambient d) : ℂ := ∫ U : G, f (A U x) ∂μ theorem orthogonalScalarAverage_im_eq_zero {d : ℕ} {G : Type*} [MeasurableSpace G] {μ : Measure G} (A : G → (Ambient d ≃ₗᵢ[ℝ] Ambient d)) {f : Schwartz d} (hf : IsRealValued f) (x : Ambient d) (hint : Integrable (fun U : G ↦ f (A U x)) μ) : (orthogonalScalarAverage μ A f x).im = 0 := by unfold orthogonalScalarAverage calc (∫ U : G, f (A U x) ∂μ).im = ∫ U : G, (f (A U x)).im ∂μ := (integral_im hint).symm _ = 0 := by apply integral_eq_zero_of_ae filter_upwards with U exact hf (A U x) theorem orthogonalScalarAverage_re {d : ℕ} {G : Type*} [MeasurableSpace G] {μ : Measure G} (A : G → (Ambient d ≃ₗᵢ[ℝ] Ambient d)) (f : Schwartz d) (x : Ambient d) (hint : Integrable (fun U : G ↦ f (A U x)) μ) : (orthogonalScalarAverage μ A f x).re = ∫ U : G, (f (A U x)).re ∂μ := by unfold orthogonalScalarAverage exact (integral_re hint).symm theorem orthogonalScalarAverage_nonneg_of_nonneg {d : ℕ} {G : Type*} [MeasurableSpace G] {μ : Measure G} (A : G → (Ambient d ≃ₗᵢ[ℝ] Ambient d)) {f : Schwartz d} (hf : ∀ y : Ambient d, 0 ≤ (f y).re) (x : Ambient d) (hint : Integrable (fun U : G ↦ f (A U x)) μ) : 0 ≤ (orthogonalScalarAverage μ A f x).re := by rw [orthogonalScalarAverage_re A f x hint] exact integral_nonneg (fun U ↦ hf (A U x)) theorem orthogonalScalarAverage_nonpos_of_norm_ge {d : ℕ} {G : Type*} [MeasurableSpace G] {μ : Measure G} (A : G → (Ambient d ≃ₗᵢ[ℝ] Ambient d)) {f : Schwartz d} {R : ℝ} (hf : ∀ y : Ambient d, R ≤ ‖y‖ → (f y).re ≤ 0) {x : Ambient d} (hx : R ≤ ‖x‖) (hint : Integrable (fun U : G ↦ f (A U x)) μ) : (orthogonalScalarAverage μ A f x).re ≤ 0 := by rw [orthogonalScalarAverage_re A f x hint] apply integral_nonpos intro U apply hf (A U x) simpa only [(A U).norm_map] using hx theorem radialSymmetrizationAverage_eq_orthogonalScalarAverage {d : ℕ} (f : Schwartz d) (x : Ambient d) : radialSymmetrizationAverage f x = orthogonalScalarAverage (radialOrthogonalHaar d) (fun U : OrthogonalGroup d ↦ orthogonalLinearIsometry U⁻¹) f x := by rfl theorem radialSymmetrizationAverage_im_eq_zero {d : ℕ} {f : Schwartz d} (hf : IsRealValued f) (x : Ambient d) : (radialSymmetrizationAverage f x).im = 0 := by rw [radialSymmetrizationAverage_eq_orthogonalScalarAverage] exact orthogonalScalarAverage_im_eq_zero (fun U : OrthogonalGroup d ↦ orthogonalLinearIsometry U⁻¹) hf x (radialSymmetrizationAverage_integrable f x) theorem radialSymmetrizationAverage_nonneg_of_nonneg {d : ℕ} {f : Schwartz d} (hf : ∀ y : Ambient d, 0 ≤ (f y).re) (x : Ambient d) : 0 ≤ (radialSymmetrizationAverage f x).re := by rw [radialSymmetrizationAverage_eq_orthogonalScalarAverage] exact orthogonalScalarAverage_nonneg_of_nonneg (fun U : OrthogonalGroup d ↦ orthogonalLinearIsometry U⁻¹) hf x (radialSymmetrizationAverage_integrable f x) theorem radialSymmetrizationAverage_nonpos_of_norm_ge {d : ℕ} {f : Schwartz d} {R : ℝ} (hf : ∀ y : Ambient d, R ≤ ‖y‖ → (f y).re ≤ 0) {x : Ambient d} (hx : R ≤ ‖x‖) : (radialSymmetrizationAverage f x).re ≤ 0 := by rw [radialSymmetrizationAverage_eq_orthogonalScalarAverage] exact orthogonalScalarAverage_nonpos_of_norm_ge (fun U : OrthogonalGroup d ↦ orthogonalLinearIsometry U⁻¹) hf hx (radialSymmetrizationAverage_integrable f x) theorem radialSymmetrizationAverage_nonpos_of_one_le_norm {d : ℕ} {f : Schwartz d} (hf : ∀ y : Ambient d, 1 ≤ ‖y‖ → (f y).re ≤ 0) {x : Ambient d} (hx : 1 ≤ ‖x‖) : (radialSymmetrizationAverage f x).re ≤ 0 := radialSymmetrizationAverage_nonpos_of_norm_ge hf hx end SpherePacking.Alternative end noncomputable section open MeasureTheory open scoped FourierTransform Real Topology namespace SpherePacking.Alternative theorem IsRadial.neg_apply {d : ℕ} {f : Schwartz d} (hf : IsRadial f) (x : Ambient d) : f (-x) = f x := by exact hf (-x) x (norm_neg x) theorem IsRealValued.fourier_conj {d : ℕ} {f : Schwartz d} (hf : IsRealValued f) (x : Ambient d) : (starRingEnd ℂ) ((𝓕 f : Schwartz d) x) = (𝓕 f : Schwartz d) (-x) := by change (starRingEnd ℂ) (𝓕 (f : Ambient d → ℂ) x) = 𝓕 (f : Ambient d → ℂ) (-x) rw [Real.fourier_eq', Real.fourier_eq', ← integral_conj] apply integral_congr_ae filter_upwards with y have hy : (starRingEnd ℂ) (f y) = f y := Complex.conj_eq_iff_im.mpr (hf y) simp [smul_eq_mul, ← Complex.exp_conj, hy, real_inner_comm, map_ofNat] theorem IsRadial.fourier_realValued {d : ℕ} {f : Schwartz d} (hradial : IsRadial f) (hreal : IsRealValued f) : IsRealValued (𝓕 f : Schwartz d) := by intro x apply Complex.conj_eq_iff_im.mp rw [hreal.fourier_conj x] change 𝓕 (f : Ambient d → ℂ) (-x) = 𝓕 (f : Ambient d → ℂ) x rw [Real.fourier_eq', Real.fourier_eq'] have hneg : (fun y : Ambient d ↦ Complex.exp ((↑(-2 * Real.pi * @inner ℝ _ _ y (-x)) : ℂ) * Complex.I) * f y) = (fun y : Ambient d ↦ Complex.exp ((↑(-2 * Real.pi * @inner ℝ _ _ (-y) x) : ℂ) * Complex.I) * f (-y)) := by funext y rw [hradial.neg_apply y] congr 2 simp simp only [smul_eq_mul] rw [hneg] exact (LinearIsometryEquiv.neg ℝ (E := Ambient d)).measurePreserving.integral_comp (LinearIsometryEquiv.neg ℝ (E := Ambient d)).toHomeomorph.measurableEmbedding (fun y : Ambient d ↦ Complex.exp ((↑(-2 * Real.pi * @inner ℝ _ _ y x) : ℂ) * Complex.I) * f y) end SpherePacking.Alternative end noncomputable section open Filter MeasureTheory open scoped FourierTransform Real Topology namespace SpherePacking.Alternative def radialFourierCharacter {d : ℕ} (ξ x : Ambient d) : ℂ := Complex.exp (((-2 * Real.pi * @inner ℝ _ _ x ξ : ℝ) : ℂ) * Complex.I) theorem radialFourierCharacter_continuous {d : ℕ} (ξ : Ambient d) : Continuous (radialFourierCharacter ξ) := by unfold radialFourierCharacter fun_prop theorem radialFourierCharacter_norm {d : ℕ} (ξ x : Ambient d) : ‖radialFourierCharacter ξ x‖ = 1 := by unfold radialFourierCharacter exact Complex.norm_exp_ofReal_mul_I _ def radialFourierOrbitAverage {d : ℕ} {G : Type*} [MeasurableSpace G] (μ : Measure G) (A : G → (Ambient d ≃ₗᵢ[ℝ] Ambient d)) (f : Schwartz d) (x : Ambient d) : ℂ := ∫ g : G, f (A g x) ∂μ def radialFourierOrbitKernel {d : ℕ} {G : Type*} [MeasurableSpace G] (A : G → (Ambient d ≃ₗᵢ[ℝ] Ambient d)) (f : Schwartz d) (ξ : Ambient d) (p : G × Ambient d) : ℂ := radialFourierCharacter ξ p.2 * f (A p.1 p.2) theorem radialFourier_orthogonalOrbit_integrable {d : ℕ} (f : Schwartz d) (A : Ambient d ≃ₗᵢ[ℝ] Ambient d) : Integrable (fun x : Ambient d ↦ f (A x)) := by change Integrable ((f : Ambient d → ℂ) ∘ A) exact (A.measurePreserving.integrable_comp_emb A.toHomeomorph.measurableEmbedding).2 f.integrable theorem radialFourier_orthogonalCharacterOrbit_integrable {d : ℕ} (f : Schwartz d) (ξ : Ambient d) (A : Ambient d ≃ₗᵢ[ℝ] Ambient d) : Integrable (fun x : Ambient d ↦ radialFourierCharacter ξ x * f (A x)) := by refine (radialFourier_orthogonalOrbit_integrable f A).bdd_mul (c := (1 : ℝ)) (radialFourierCharacter_continuous ξ).aestronglyMeasurable ?_ filter_upwards [] with x rw [radialFourierCharacter_norm] theorem radialFourier_orthogonalCharacterOrbit_integral_norm {d : ℕ} (f : Schwartz d) (ξ : Ambient d) (A : Ambient d ≃ₗᵢ[ℝ] Ambient d) : (∫ x : Ambient d, ‖radialFourierCharacter ξ x * f (A x)‖) = ∫ x : Ambient d, ‖f x‖ := by calc (∫ x : Ambient d, ‖radialFourierCharacter ξ x * f (A x)‖) = ∫ x : Ambient d, ‖f (A x)‖ := by apply integral_congr_ae filter_upwards [] with x rw [norm_mul, radialFourierCharacter_norm, one_mul] _ = ∫ x : Ambient d, ‖f x‖ := A.measurePreserving.integral_comp A.toHomeomorph.measurableEmbedding (fun x : Ambient d ↦ ‖f x‖) theorem radialFourier_orthogonalCharacterOrbit_integral {d : ℕ} (f : Schwartz d) (ξ : Ambient d) (A : Ambient d ≃ₗᵢ[ℝ] Ambient d) : (∫ x : Ambient d, radialFourierCharacter ξ x * f (A x)) = (𝓕 f : Schwartz d) (A ξ) := by rw [congrFun (SchwartzMap.fourier_coe f) (A ξ)] rw [← Real.fourier_comp_linearIsometry A (f : Ambient d → ℂ) ξ] rw [Real.fourier_eq'] rfl theorem radialFourierOrbitKernel_integrable {d : ℕ} {G : Type*} [MeasurableSpace G] (μ : Measure G) [IsFiniteMeasure μ] (A : G → (Ambient d ≃ₗᵢ[ℝ] Ambient d)) (f : Schwartz d) (ξ : Ambient d) (horbit : Measurable (fun p : G × Ambient d ↦ f (A p.1 p.2))) : Integrable (radialFourierOrbitKernel A f ξ) (μ.prod volume) := by have hcharacter : Measurable (fun p : G × Ambient d ↦ radialFourierCharacter ξ p.2) := (radialFourierCharacter_continuous ξ).measurable.comp measurable_snd have hmeas : AEStronglyMeasurable (radialFourierOrbitKernel A f ξ) (μ.prod volume) := by exact (hcharacter.mul horbit).aestronglyMeasurable apply (integrable_prod_iff hmeas).2 constructor · filter_upwards [] with g exact radialFourier_orthogonalCharacterOrbit_integrable f ξ (A g) · have hconstant : (fun g : G ↦ ∫ x : Ambient d, ‖radialFourierOrbitKernel A f ξ (g, x)‖) = fun _ : G ↦ ∫ x : Ambient d, ‖f x‖ := by funext g exact radialFourier_orthogonalCharacterOrbit_integral_norm f ξ (A g) rw [hconstant] exact integrable_const _ theorem radialFourierOrbitAverage_fourier {d : ℕ} {G : Type*} [MeasurableSpace G] (μ : Measure G) [IsFiniteMeasure μ] (A : G → (Ambient d ≃ₗᵢ[ℝ] Ambient d)) (f : Schwartz d) (ξ : Ambient d) (horbit : Measurable (fun p : G × Ambient d ↦ f (A p.1 p.2))) : (𝓕 (radialFourierOrbitAverage μ A f) : Ambient d → ℂ) ξ = ∫ g : G, (𝓕 f : Schwartz d) (A g ξ) ∂μ := by have hprod := radialFourierOrbitKernel_integrable μ A f ξ horbit have hprod' : Integrable (Function.uncurry (fun g : G ↦ fun x : Ambient d ↦ radialFourierCharacter ξ x * f (A g x))) (μ.prod volume) := hprod calc (𝓕 (radialFourierOrbitAverage μ A f) : Ambient d → ℂ) ξ = ∫ x : Ambient d, radialFourierCharacter ξ x * (∫ g : G, f (A g x) ∂μ) := by rw [Real.fourier_eq'] rfl _ = ∫ x : Ambient d, ∫ g : G, radialFourierCharacter ξ x * f (A g x) ∂μ := by apply integral_congr_ae filter_upwards [] with x rw [integral_const_mul] _ = ∫ g : G, (∫ x : Ambient d, radialFourierCharacter ξ x * f (A g x)) ∂μ := by exact (integral_integral_swap hprod').symm _ = ∫ g : G, (𝓕 f : Schwartz d) (A g ξ) ∂μ := by apply integral_congr_ae filter_upwards [] with g exact radialFourier_orthogonalCharacterOrbit_integral f ξ (A g) theorem radialOrthogonalHaarOrbit_measurable {d : ℕ} (f : Schwartz d) : Measurable (fun p : OrthogonalGroup d × Ambient d ↦ f (orthogonalLinearIsometry (p.1⁻¹) p.2)) := by have hforward : Measurable (fun p : OrthogonalGroup d × Ambient d ↦ f (orthogonalAction p.1 p.2)) := (f.continuous.comp (orthogonalAction_joint_continuous d)).measurable have hinverse : Measurable (fun p : OrthogonalGroup d × Ambient d ↦ (p.1⁻¹, p.2)) := ((continuous_inv.comp continuous_fst).prodMk continuous_snd).measurable have hcomposed : Measurable ((fun p : OrthogonalGroup d × Ambient d ↦ f (orthogonalAction p.1 p.2)) ∘ (fun p : OrthogonalGroup d × Ambient d ↦ (p.1⁻¹, p.2))) := hforward.comp hinverse have heq : ((fun p : OrthogonalGroup d × Ambient d ↦ f (orthogonalAction p.1 p.2)) ∘ (fun p : OrthogonalGroup d × Ambient d ↦ (p.1⁻¹, p.2))) = (fun p : OrthogonalGroup d × Ambient d ↦ f (orthogonalLinearIsometry (p.1⁻¹) p.2)) := by funext p simp only [Function.comp_apply, orthogonalLinearIsometry_apply] rw [← heq] exact hcomposed theorem radialOrthogonalHaar_radialFourierOrbitAverage_eq {d : ℕ} (f : Schwartz d) : radialFourierOrbitAverage (radialOrthogonalHaar d) (fun U : OrthogonalGroup d ↦ orthogonalLinearIsometry (U⁻¹)) f = fun x : Ambient d ↦ ∫ U : OrthogonalGroup d, f (orthogonalAction (U⁻¹) x) ∂radialOrthogonalHaar d := by funext x simp only [radialFourierOrbitAverage, orthogonalLinearIsometry_apply] theorem radialOrthogonalHaar_fourier_average {d : ℕ} (f : Schwartz d) (ξ : Ambient d) : (𝓕 (fun x : Ambient d ↦ ∫ U : OrthogonalGroup d, f (orthogonalAction (U⁻¹) x) ∂radialOrthogonalHaar d) : Ambient d → ℂ) ξ = ∫ U : OrthogonalGroup d, (𝓕 f : Schwartz d) (orthogonalAction (U⁻¹) ξ) ∂radialOrthogonalHaar d := by have h := radialFourierOrbitAverage_fourier (radialOrthogonalHaar d) (fun U : OrthogonalGroup d ↦ orthogonalLinearIsometry (U⁻¹)) f ξ (radialOrthogonalHaarOrbit_measurable f) rw [radialOrthogonalHaar_radialFourierOrbitAverage_eq] at h simpa only [orthogonalLinearIsometry_apply] using h theorem fourier_radialSymmetrizationAverage {d : ℕ} (f : Schwartz d) (ξ : Ambient d) : (𝓕 (radialSymmetrizationAverage f) : Ambient d → ℂ) ξ = radialSymmetrizationAverage (𝓕 f : Schwartz d) ξ := by change (𝓕 (fun x : Ambient d ↦ ∫ U : OrthogonalGroup d, f (orthogonalAction (U⁻¹) x) ∂radialOrthogonalHaar d) : Ambient d → ℂ) ξ = ∫ U : OrthogonalGroup d, (𝓕 f : Schwartz d) (orthogonalAction (U⁻¹) ξ) ∂radialOrthogonalHaar d exact radialOrthogonalHaar_fourier_average f ξ end SpherePacking.Alternative end section namespace CohnElkies open Real theorem manuscript_pi_gt_d40 : (3.1415926535897932384626433832795028841971 : ℝ) < Real.pi := by pi_lower_bound [ 735361475704189444449261582374705033264205603/519979086093778969111063874274015566558335798, 1614821575232605988709216844925630282861368192/873935138947824998568689940684460881617215487, 656577935817689754327774835830964272273936545/334720529017192598890280584873839652366119323, 988606023810882196459876585735687236751892707/496694732804374296058706410324658507725695065, 1651831167639818239827787964208026071585604941/826911635098838176108984261014947012483672374, 1755154679930232820263785896055424906833073974/877841729481728059293345630561450330393398391, 2 - 79752583061956089944333925496586284889697/529578559130067173792567219683348143064410820, 2 - 33578028749876676575324057253414810454419/891860101759478655835226554662632484009089330, 2 - 2023347725461536275851288370301469261345/214966623026649846227138260963993675942277029, 2 - 380666362037738892566128113113773132347/161772518244974281498999006942870931497546037, 2 - 251046407591291149403479324978532177198/426750641818596804075471463319417463200870061, 2 - 17315306189051452896527586926594829145/117736283560911906970692594678804476810243167, 2 - 27907377984971801502612766014066156500/759030398147093798557642130232480057456819083, 2 - 2733218175793841927608435860500580766/297354438176963679012339193982596158449108593, 2 - 1037292406535850791771626211910383705/451399750411679965819001075988389198958582008, 2 - 383753404709486344001837952766399826/667993672716155145330103580991570671665923771, 2 - 44507605683707279921013884665630709/309894829528892083222521203142405007605307258, 2 - 23561580395478464172815305141493120/656212512702781872380015327329460136094681669, 2 - 8771864317040573691992116797987775/977219189535313506358048457167695800363495739, 2 - 412307583058020647935707466896589/183730558336283575052453369562826705376838777, 2 - 475086774834670308773605284009400/846823701384727188979626370746895670941323369, 2 - 6973622552264526590076341756765/49720844061159399112765143738232888815228211, 2 - 3186955676953953774593674190519/90889993002100255334812570424527051756032623, 2 - 4375550972375884762729814599645/499151965162799191521774371691243901983241411, 2 - 1772257618646811055661652109395/808698953532660250926135466132261140481448534, 2 - 349757213473338141134005772451/638390919131392777951497334354505236135793351, 2 - 72280955868919422410960110385/527720419483186549925790952520229083602745314, 2 - 25257215036912345125862033732/737607739356847568184981921787132294843646957, 2 - 2324341250967290575936039609/271518786709342497698200579680060636461095427, 2 - 1061630290064446694733083483/496058946890397653337409495554235728792888595, 2 - 442486281704336039732791711/827027190048904780667399013302533997104961654, 2 - 82433206310005974378689695/616285799584080780936023628928240995696737692, 2 - 30978652654901532434646773/926408401471875934314552525649109498545930380, 2 - 5949112494974025801844681/711626533024603400661141506439715595438426398, 2 - 1488645378333291753464333/712280731205802957601587489731363925875380583, 2 - 311613299623885301012002/596397643495347974982662142013620277703762065, 2 - 63072330278304091838905/482857300290369859425002505038023854988170907, 2 - 32605808218565518555751/998469690955292120604834604188297664602699610, 2 - 5663641555015948878471/693738292909227354863640966523341210443528992, 2 - 1603199205058214183873/785502167753187813716964469784487075859456977, 2 - 44825661393271397839/87850977181856875708959200359192810444967936, 2 - 16712123733148509526/131012135023317745422814662893303915447412115, 2 - 7140385192192506875/223903825475514836670954579146312854911781387, 2 - 4160227356078390473/521815445414544909502154200808081979185363550, 2 - 699108891373707226/350755654747986089749457002604645380644053897, 2 - 497141281084142964/997699315231333805990357056984939405828893971, 2 - 92888033870267334/745657874827459315134729234044062405590466049, 2 - 10665263554519287/342461237478433816261148956467446703435302915, 2 - 4236305380785542/544110466890662689837268986105222479944808103, 2 - 568739137072179/292195098884918480899301001339344616600520732, 2 - 181385748742031/372754560643267024821967034486762314848400139, 2 - 47674565390365/391892126017424105724813755694867351547151423, 2 - 5400864560618/177583688716374021873992688626359744424923661, 2 - 4353452415089/572576579061074327256536572269398173074839437, 2 - 826510067390/434818403256652567017102390033358512038607537, 2 - 96176477778/202389803334583619135833712211760400508055511, 2 - 28928898521/243507111826904771212880637097965274798624030, 2 - 24139063429/812755952465356617792735761066305578964302993, 2 - 6367069803/857510300243666595284348532136001675193759107, 2 - 1639239443/883084213259843725279555829890113730634319291, 2 - 449528216/968671837807799978038261085163266904926700999, 2 - 76535949/659698018833096349363195216762459711821137560, 2 - 27368039/943590108624480001162828822150932034770679532, 2 - 6235781/859984344680080078244721278776482467699447003, 2 - 1785710/985077984065614745945940843479880071089657287, 2 - 397219/876495493114916585044381620545854549637103999, 2 - 101968/900002189642910478540105131766805683689790157, 2 - 6373/225000547410727619635026282941701420922445946 ] theorem manuscript_pi_lt_d40 : Real.pi < (3.1415926535897932384626433832795028841972 : ℝ) := by pi_upper_bound [ 1039958172187557938222127748548031133116671596/735361475704189444449261582374705033264205603, 478600201932118537014372129053837886122622977/259016562814844923225458149839934988405454400, 1182498913955913611246998658806287670131286118/602832718630194264072038938933209267184190947, 1139983240089622598367681070890702364436863257/572749565752289112691897652726420869483397158, 674481014253471597715809997605373598022854036/337647217988004053604565193351470742340478365, 269533488700628097187480932294978891806858111/134807345802484089306431186280444595624077023, 420905580543923078565774113181648780392853312/210468638173333744382139020201544708917537687, 2 - 31926845698391972653468048132858014902853/848003319835492629921682152249077132987676173, 2 - 8108366808736375002249475328759402081624/861457578053143701596187469837317055705281751, 2 - 2029306367992899893583901291970723460857/862398242081153303323095550851323422829390564, 2 - 231101607182344170973682087493706072629/392846725578063437471774030332666574376227416, 2 - 135315453494852624563540466067291440848/920084139945324285207090004477574497128390087, 2 - 34044628036482554587150776276456079741/925952541554296651600453869089959260049677115, 2 - 4052169822603481177168312692673824331/440846871160565874727106467869656774562246627, 2 - 801922142447528620497602929069763587/348973397153566374832583919639342120400246079, 2 - 481209055088791607609364415560704144/837633230371927058033366741151868934748925247, 2 - 113054314109121052752837595887467637/787167650565777117853550453436049729117746205, 2 - 14340425695331680726780260220166029/399394549126552515418368409320179336950126770, 2 - 3019050454844383843500019861063084/336333752098505251371206631083595757042543133, 2 - 1610246068693380262057771290784723/717550249902165056039428804346235182014784930, 2 - 487734481880246629681327728136419/869367747360521469272727157390228771417681774, 2 - 137242647445257253738871692029311/978518728397542913198239584143906449903230908, 2 - 21288593117416659995434766323662/607137430074311094126890035131943120519883575, 2 - 5857330264071901236134578919623/668189658942879462211683907427185023736732090, 2 - 2132126319239785003961782198301/972910656457038550077219955056105607109522974, 2 - 168942853109302073475588485888/308361283548905886801637537324565780491650037, 2 - 75315778818612352219470484959/549877542626017186668561016006891803309628525, 2 - 29671165285025041273006731466/866512048853593027811592443889978200306743183, 2 - 8207314770350496977343044476/958740523862342596587563150141441205238118539, 2 - 2106996854031980052849266081/984518480957279362976237003741885645208294518, 2 - 399026005149600975072600235/745797936433699146277898488182552125370505008, 2 - 95685947067243905811005714/715365725015338979873684473685166565426855403, 2 - 33073566370724119432203115/989056241205785090258279708019330815863592041, 2 - 3984038500980196147331973/476566464037162809315126170425177865990984692, 2 - 1042168041131121032104528/498652147234220326353021612299768165554943531, 2 - 350618556460258511634529/671049923385909816377109097197941893316019192, 2 - 79028164771330370274248/605008981276109856817751151899493354536360527, 2 - 4131057167700323562223/126503086379677319104240685793019008628153779, 2 - 3286166430575333444773/402521852348496839241792808620760988972084265, 2 - 956634030973735405145/468711625296155077873789265301216817301264231, 2 - 483277038052230485720/947144084946281086629831373567881309173888721, 2 - 113952896055717407583/893316280009203015109189852668480167576970194, 2 - 25569069203407167573/801779211400377293212910706890228769506220562, 2 - 5834153507919709911/731775249471387034816150077230941975121262313, 2 - 1421965109039843353/713425775303792154982421860936484924627622640, 2 - 85216225560508607/171018125275998454226342111284069679460535239, 2 - 37093012248467561/297763829545266672883865946689942992746972732, 2 - 30741359800390301/987103981556127176822113852828510585552191322, 2 - 1804544974600881/231775502566157072957301476478860117147634601, 2 - 1647741116704936/846542548506279747906539872767526287661823269, 2 - 461099060868406/947575975726025446169145676561321977987258143, 2 - 49163781692172/404133708878982793050423215175582405635492687, 2 - 21881458565777/719475573399778575163850086037978793585812022, 2 - 2094824291058/275516351608843520478868364472078908817430105, 2 - 1681569257363/884656204807047798406922262871635855544343887, 2 - 393715917389/828519498020983981957157855180512039240663501, 2 - 105566259993/888597091195954639448027786400187331580333109, 2 - 19159340368/645089979369049868235147149302222051991873987, 2 - 5607517927/755214648178958075303519341119553451792278928, 2 - 503785402/271397163652170674127158979142886913570521167, 2 - 15501183/33402929761376817082750298554995233427377101, 2 - 57160993/492696495298339981310941296919078409156330724, 2 - 2664361/91861338161818176317937714259135608038765309, 2 - 6903394/952055687195941732346620159941135907213796675, 2 - 787336/434329963802792643606236891736102085809815933, 2 - 390117/860824362096253989380565946398553793601962899, 2 - 21941/193658285373402428307394934647099908852166227, 2 - 24034/848527091867162656568056124936584332410178231 ] end CohnElkies end set_option maxHeartbeats 1600000 noncomputable section open Finset namespace CohnElkies theorem criticalBinaryExponent_eq_log_div : criticalBinaryExponent = Real.log (2 * Real.pi / Real.exp 1) / (2 * Real.log 2) := by unfold criticalBinaryExponent Real.logb have hlog : Real.log (2 : ℝ) ≠ 0 := (Real.log_pos (by norm_num : (1 : ℝ) < 2)).ne' field_simp theorem criticalBinaryExponent_eq_three_halves_sub_logFourDivPi : criticalBinaryExponent = (3 / 2 : ℝ) - (Real.log (4 / Real.pi) + 1) / (2 * Real.log 2) := by rw [criticalBinaryExponent_eq_log_div] have htwo : (2 : ℝ) ≠ 0 := by norm_num have hpi : Real.pi ≠ 0 := Real.pi_pos.ne' have hlogtwo : Real.log (2 : ℝ) ≠ 0 := (Real.log_pos (by norm_num : (1 : ℝ) < 2)).ne' have hfour : Real.log (4 : ℝ) = 2 * Real.log 2 := by rw [show (4 : ℝ) = 2 * 2 by norm_num, Real.log_mul htwo htwo] ring have hleft : Real.log (2 * Real.pi / Real.exp 1) = Real.log 2 + Real.log Real.pi - 1 := by rw [Real.log_div (mul_ne_zero htwo hpi) (Real.exp_ne_zero _), Real.log_mul htwo hpi, Real.log_exp] have hright : Real.log (4 / Real.pi) = 2 * Real.log 2 - Real.log Real.pi := by rw [Real.log_div (by norm_num : (4 : ℝ) ≠ 0) hpi, hfour] rw [hleft, hright] field_simp ; ring theorem baseTwo_log_two_gt_d6 : (0.693147 : ℝ) < Real.log 2 := by have h := Real.sum_range_le_log_div (x := (1 / 3 : ℝ)) (by norm_num) (by norm_num) 6 norm_num [Finset.sum_range_succ] at h nlinarith theorem baseTwo_log_four_div_pi_lt_d7 : Real.log (4 / Real.pi) < (0.2415647 : ℝ) := by have hp : (3.141592 : ℝ) < Real.pi := Real.pi_gt_d6 have harg : (4 : ℝ) / Real.pi < 4 / 3.141592 := by apply (div_lt_div_iff₀ Real.pi_pos (by norm_num : (0 : ℝ) < 3.141592)).2 nlinarith have hmono := Real.log_lt_log (by positivity : (0 : ℝ) < 4 / Real.pi) harg have hs := Real.log_div_le_sum_range_add (x := (107301 / 892699 : ℝ)) (by norm_num) (by norm_num) 5 norm_num [Finset.sum_range_succ] at hs norm_num at hmono nlinarith theorem criticalBinaryExponent_gt_d4 : (0.6044 : ℝ) < criticalBinaryExponent := by rw [criticalBinaryExponent_eq_three_halves_sub_logFourDivPi] have hlogpos : 0 < Real.log (2 : ℝ) := Real.log_pos (by norm_num : (1 : ℝ) < 2) have hden : 0 < 2 * Real.log (2 : ℝ) := by positivity have hratio : (Real.log (4 / Real.pi) + 1) / (2 * Real.log 2) < (3 / 2 : ℝ) - 0.6044 := by apply (div_lt_iff₀ hden).2 nlinarith [baseTwo_log_two_gt_d6, baseTwo_log_four_div_pi_lt_d7] linarith theorem baseTwo_log_two_gt_d36 : (0.693147180559945309417232121458176568 : ℝ) < Real.log 2 := by have h := Real.sum_range_le_log_div (x := (1 / 3 : ℝ)) (by norm_num) (by norm_num) 42 norm_num [Finset.sum_range_succ] at h nlinarith theorem baseTwo_log_two_lt_d36 : Real.log 2 < (0.693147180559945309417232121458176569 : ℝ) := by have h := Real.log_div_le_sum_range_add (x := (1 / 3 : ℝ)) (by norm_num) (by norm_num) 42 norm_num [Finset.sum_range_succ] at h nlinarith theorem baseTwo_log_four_div_pi_gt_d36 : (0.241564475270490444691036891563294424 : ℝ) < Real.log (4 / Real.pi) := by have hs : (0.241564475270490444691036891563294424 : ℝ) < Real.log (4 / (3.1415926535897932384626433832795028841972 : ℝ)) := by have h := Real.sum_range_le_log_div (x := (2146018366025516903843391541801242789507 / 17853981633974483096156608458198757210493 : ℝ)) (by norm_num) (by norm_num) 20 norm_num [Finset.sum_range_succ] at h ⊢ linarith calc (0.241564475270490444691036891563294424 : ℝ) < Real.log (4 / (3.1415926535897932384626433832795028841972 : ℝ)) := hs _ < Real.log (4 / Real.pi) := by apply Real.log_lt_log (by positivity) apply (div_lt_div_iff₀ (by norm_num : (0 : ℝ) < 3.1415926535897932384626433832795028841972) Real.pi_pos).2 nlinarith [manuscript_pi_lt_d40] theorem baseTwo_log_four_div_pi_lt_d36 : Real.log (4 / Real.pi) < (0.241564475270490444691036891563294425 : ℝ) := by have hs : Real.log (4 / (3.1415926535897932384626433832795028841971 : ℝ)) < (0.241564475270490444691036891563294425 : ℝ) := by have h := Real.log_div_le_sum_range_add (x := (8584073464102067615373566167204971158029 / 71415926535897932384626433832795028841971 : ℝ)) (by norm_num) (by norm_num) 20 norm_num [Finset.sum_range_succ] at h ⊢ linarith calc Real.log (4 / Real.pi) < Real.log (4 / (3.1415926535897932384626433832795028841971 : ℝ)) := by apply Real.log_lt_log (by positivity) apply (div_lt_div_iff₀ Real.pi_pos (by norm_num : (0 : ℝ) < 3.1415926535897932384626433832795028841971)).2 nlinarith [manuscript_pi_gt_d40] _ < (0.241564475270490444691036891563294425 : ℝ) := hs theorem criticalBinaryExponent_gt_d33 : (0.604400544291677695341677307053057 : ℝ) < criticalBinaryExponent := by rw [criticalBinaryExponent_eq_three_halves_sub_logFourDivPi] have hden : 0 < 2 * Real.log (2 : ℝ) := by positivity have hratio : (Real.log (4 / Real.pi) + 1) / (2 * Real.log 2) < (3 / 2 : ℝ) - 0.604400544291677695341677307053057 := by apply (div_lt_iff₀ hden).2 nlinarith [baseTwo_log_two_gt_d36, baseTwo_log_four_div_pi_lt_d36] linarith theorem criticalBinaryExponent_lt_d33 : criticalBinaryExponent < (0.604400544291677695341677307053058 : ℝ) := by rw [criticalBinaryExponent_eq_three_halves_sub_logFourDivPi] have hden : 0 < 2 * Real.log (2 : ℝ) := by positivity have hratio : (3 / 2 : ℝ) - 0.604400544291677695341677307053058 < (Real.log (4 / Real.pi) + 1) / (2 * Real.log 2) := by apply (lt_div_iff₀ hden).2 nlinarith [baseTwo_log_two_lt_d36, baseTwo_log_four_div_pi_gt_d36] linarith theorem criticalBinaryExponent_gt_d30 : (0.604400544291677695341677307053 : ℝ) < criticalBinaryExponent := by nlinarith [criticalBinaryExponent_gt_d33] theorem criticalBinaryExponent_lt_d30 : criticalBinaryExponent < (0.604400544291677695341677307054 : ℝ) := by nlinarith [criticalBinaryExponent_lt_d33] theorem criticalBinaryExponent_mem_Ioo_d30 : criticalBinaryExponent ∈ Set.Ioo (0.604400544291677695341677307053 : ℝ) 0.604400544291677695341677307054 := ⟨criticalBinaryExponent_gt_d30, criticalBinaryExponent_lt_d30⟩ end CohnElkies end noncomputable section open Filter open scoped Topology namespace CohnElkies theorem manuscriptQuotientRootSet_eq_literal (d : ℕ) : manuscriptQuotientRootSet d = {q : ℝ | ∃ f : Admissible d, quotient f ^ ((d : ℝ)⁻¹) = q} := by ext q simp [manuscriptQuotientRootSet] structure SharpCohnElkiesManuscriptConclusions : Prop where root_before_infimum : Tendsto (fun d : ℕ => sInf {q : ℝ | ∃ f : Admissible d, quotient f ^ ((d : ℝ)⁻¹) = q} / Real.sqrt (d : ℝ)) atTop (𝓝 (1 / Real.pi)) root_before_infimum_vanishing_error : ∃ err : ℕ → ℝ, Tendsto err atTop (𝓝 0) ∧ ∀ d : ℕ, 0 < d → sInf {q : ℝ | ∃ f : Admissible d, quotient f ^ ((d : ℝ)⁻¹) = q} = (1 / Real.pi + err d) * Real.sqrt (d : ℝ) linear_program_root : Tendsto (fun d : ℕ => (linearProgram d) ^ ((d : ℝ)⁻¹)) atTop (𝓝 (Real.sqrt (Real.exp 1 / (2 * Real.pi)))) natural_logarithmic_rate : Tendsto (fun d : ℕ => Real.log (linearProgram d) / (d : ℝ)) atTop (𝓝 ((1 / 2 : ℝ) * Real.log (Real.exp 1 / (2 * Real.pi)))) natural_vanishing_exponential_error : ∃ err : ℕ → ℝ, Tendsto err atTop (𝓝 0) ∧ (∀ᶠ d : ℕ in atTop, linearProgram d = (Real.sqrt (Real.exp 1 / (2 * Real.pi)) + err d) ^ d) universal_nonnegative_delta : ∃ δ : ℕ → ℝ, Tendsto δ atTop (𝓝 0) ∧ (∀ d : ℕ, 0 ≤ δ d) ∧ (∀ᶠ d : ℕ in atTop, ∀ f : Admissible d, (2 : ℝ) ^ d / unitBallVolume d * (Real.sqrt (Real.exp 1 / (2 * Real.pi)) - δ d) ^ d ≤ quotient f) base_two_exponent_positive : 0 < (1 / 2 : ℝ) * Real.logb 2 (2 * Real.pi / Real.exp 1) base_two_decimal_certificate : (1 / 2 : ℝ) * Real.logb 2 (2 * Real.pi / Real.exp 1) ∈ Set.Ioo (0.604400544291677695341677307053 : ℝ) 0.604400544291677695341677307054 base_two_logarithmic_rate : Tendsto (fun d : ℕ => Real.logb 2 (linearProgram d) / (d : ℝ)) atTop (𝓝 (-((1 / 2 : ℝ) * Real.logb 2 (2 * Real.pi / Real.exp 1)))) base_two_vanishing_exponential_error : ∃ err : ℕ → ℝ, Tendsto err atTop (𝓝 0) ∧ (∀ᶠ d : ℕ in atTop, linearProgram d = (2 : ℝ) ^ (-((1 / 2 : ℝ) * Real.logb 2 (2 * Real.pi / Real.exp 1) + err d) * (d : ℝ))) theorem sharpCohnElkiesManuscriptConclusions : SharpCohnElkiesManuscriptConclusions := by refine { root_before_infimum := ?_ root_before_infimum_vanishing_error := ?_ linear_program_root := ?_ natural_logarithmic_rate := ?_ natural_vanishing_exponential_error := ?_ universal_nonnegative_delta := ?_ base_two_exponent_positive := ?_ base_two_decimal_certificate := ?_ base_two_logarithmic_rate := ?_ base_two_vanishing_exponential_error := ?_ } · simp_rw [← manuscriptQuotientRootSet_eq_literal] simpa [one_div] using (manuscriptQuotientRootInf_div_sqrt_tendsto sharpQuotientAsymptotic) · obtain ⟨err, herr, hformula⟩ := exists_manuscriptQuotientRootIsLittleO refine ⟨err, (Asymptotics.isLittleO_one_iff ℝ).mp herr, ?_⟩ intro d hd rw [← manuscriptQuotientRootSet_eq_literal] simpa [one_div] using hformula d hd · simpa [SharpPackingRootAsymptotic, criticalPackingBase] using sharpPackingRootAsymptotic · simpa [SharpLogAsymptotic] using sharpLogAsymptotic · obtain ⟨err, herr, hformula⟩ := exists_manuscriptPackingIsLittleO refine ⟨err, (Asymptotics.isLittleO_one_iff ℝ).mp herr, ?_⟩ filter_upwards [eventually_gt_atTop (0 : ℕ)] with d hd simpa [criticalPackingBase] using hformula d hd · obtain ⟨δ, hδ, hnonneg, hbound⟩ := exists_manuscriptUniversalPackingIsLittleO refine ⟨δ, (Asymptotics.isLittleO_one_iff ℝ).mp hδ, hnonneg, ?_⟩ filter_upwards [eventually_gt_atTop (0 : ℕ)] with d hd f simpa [criticalPackingBase] using hbound d hd f · simpa [criticalBinaryExponent] using criticalBinaryExponent_pos · simpa [criticalBinaryExponent] using criticalBinaryExponent_mem_Ioo_d30 · simpa [SharpBinaryLogAsymptotic, criticalBinaryExponent] using sharpBinaryLogAsymptotic · obtain ⟨err, herr, hformula⟩ := exists_manuscriptBinaryIsLittleO refine ⟨err, (Asymptotics.isLittleO_one_iff ℝ).mp herr, ?_⟩ simpa [criticalBinaryExponent] using hformula end CohnElkies end noncomputable section open MeasureTheory open scoped FourierTransform Real Topology namespace SpherePacking.Alternative structure IsUnrestrictedAdmissible {d : ℕ} (f : Schwartz d) : Prop where real_valued : IsRealValued f fourier_real_valued : IsRealValued (𝓕 f : Schwartz d) fourier_zero_pos : 0 < fourierReal f 0 fourier_nonneg : ∀ x, 0 ≤ fourierReal f x eventually_nonpos : ∀ x : Ambient d, 1 ≤ ‖x‖ → (f x).re ≤ 0 end SpherePacking.Alternative namespace SpherePacking.Alternative theorem quotient_eq_of_origin_and_fourier_origin {d : ℕ} {f g : Schwartz d} (horigin : g 0 = f 0) (hfourier : fourierReal g 0 = fourierReal f 0) : quotient g = quotient f := by simp only [quotient, horigin, hfourier] theorem IsUnrestrictedAdmissible.radialAdmissible_of_average_data {d : ℕ} {f g : Schwartz d} (hf : IsUnrestrictedAdmissible f) (hreal : IsRealValued g) (hradial : IsRadial g) (hfourier_zero : fourierReal g 0 = fourierReal f 0) (hfourier_nonneg : ∀ x : Ambient d, 0 ≤ fourierReal g x) (hexterior : ∀ x : Ambient d, 1 ≤ ‖x‖ → (g x).re ≤ 0) : IsAdmissible g where real_valued := hreal radial := hradial fourier_real_valued := hradial.fourier_realValued hreal fourier_zero_pos := hfourier_zero.symm ▸ hf.fourier_zero_pos fourier_nonneg := hfourier_nonneg eventually_nonpos := hexterior theorem radial_of_radialSymmetrizationAverage {d : ℕ} {f g : Schwartz d} (haverage : ∀ x : Ambient d, g x = radialSymmetrizationAverage f x) : IsRadial g := by intro x y hxy rw [haverage x, haverage y] exact radialSymmetrizationAverage_eq_of_norm_eq f hxy theorem radialSymmetrizationAverage_schwartz_zero {d : ℕ} {f g : Schwartz d} (haverage : ∀ x : Ambient d, g x = radialSymmetrizationAverage f x) : g 0 = f 0 := by rw [haverage 0, radialSymmetrizationAverage_zero] theorem radialSymmetrizationAverage_fourier_zero {d : ℕ} {f g : Schwartz d} (hfourier : ∀ x : Ambient d, (𝓕 g : Schwartz d) x = radialSymmetrizationAverage (𝓕 f : Schwartz d) x) : fourierReal g 0 = fourierReal f 0 := by unfold fourierReal rw [hfourier 0, radialSymmetrizationAverage_zero] theorem IsUnrestrictedAdmissible.radialAdmissible_of_radialSymmetrizationAverage {d : ℕ} {f g : Schwartz d} (hf : IsUnrestrictedAdmissible f) (haverage : ∀ x : Ambient d, g x = radialSymmetrizationAverage f x) (hfourier : ∀ x : Ambient d, (𝓕 g : Schwartz d) x = radialSymmetrizationAverage (𝓕 f : Schwartz d) x) : IsAdmissible g := by apply hf.radialAdmissible_of_average_data · intro x rw [haverage x] exact radialSymmetrizationAverage_im_eq_zero hf.real_valued x · exact radial_of_radialSymmetrizationAverage haverage · exact radialSymmetrizationAverage_fourier_zero hfourier · intro x change 0 ≤ ((𝓕 g : Schwartz d) x).re rw [hfourier x] apply radialSymmetrizationAverage_nonneg_of_nonneg intro y exact hf.fourier_nonneg y · intro x hx rw [haverage x] exact radialSymmetrizationAverage_nonpos_of_one_le_norm hf.eventually_nonpos hx theorem quotient_eq_of_radialSymmetrizationAverage {d : ℕ} {f g : Schwartz d} (haverage : ∀ x : Ambient d, g x = radialSymmetrizationAverage f x) (hfourier : ∀ x : Ambient d, (𝓕 g : Schwartz d) x = radialSymmetrizationAverage (𝓕 f : Schwartz d) x) : quotient g = quotient f := by exact quotient_eq_of_origin_and_fourier_origin (radialSymmetrizationAverage_schwartz_zero haverage) (radialSymmetrizationAverage_fourier_zero hfourier) theorem radialSymmetrization_fourier_average_apply_for_admissibility {d : ℕ} (f : Schwartz d) (x : Ambient d) : (𝓕 (radialSymmetrization f) : Schwartz d) x = radialSymmetrizationAverage (𝓕 f : Schwartz d) x := by have hfun : (radialSymmetrization f : Ambient d → ℂ) = radialSymmetrizationAverage f := by funext y exact radialSymmetrization_apply f y calc (𝓕 (radialSymmetrization f) : Schwartz d) x = (𝓕 (radialSymmetrization f : Ambient d → ℂ)) x := congrFun (SchwartzMap.fourier_coe (radialSymmetrization f)) x _ = (𝓕 (radialSymmetrizationAverage f) : Ambient d → ℂ) x := by rw [hfun] _ = radialSymmetrizationAverage (𝓕 f : Schwartz d) x := fourier_radialSymmetrizationAverage f x theorem IsUnrestrictedAdmissible.radialSymmetrization_admissible {d : ℕ} {f : Schwartz d} (hf : IsUnrestrictedAdmissible f) : IsAdmissible (radialSymmetrization f) := by exact hf.radialAdmissible_of_radialSymmetrizationAverage (radialSymmetrization_apply f) (radialSymmetrization_fourier_average_apply_for_admissibility f) theorem IsUnrestrictedAdmissible.quotient_radialSymmetrization {d : ℕ} {f : Schwartz d} (_hf : IsUnrestrictedAdmissible f) : quotient (radialSymmetrization f) = quotient f := by exact quotient_eq_of_radialSymmetrizationAverage (radialSymmetrization_apply f) (radialSymmetrization_fourier_average_apply_for_admissibility f) end SpherePacking.Alternative namespace SpherePacking.Alternative def schwartzDilation {d : ℕ} (a : ℝ) (ha : a ≠ 0) (f : Schwartz d) : Schwartz d := SchwartzMap.compCLMOfContinuousLinearEquiv ℂ (ContinuousLinearEquiv.smulLeft (Units.mk0 a ha)) f @[simp] theorem schwartzDilation_apply {d : ℕ} (a : ℝ) (ha : a ≠ 0) (f : Schwartz d) (x : Ambient d) : schwartzDilation a ha f x = f (a • x) := by rfl @[simp] theorem schwartzDilation_zero {d : ℕ} (a : ℝ) (ha : a ≠ 0) (f : Schwartz d) : schwartzDilation a ha f 0 = f 0 := by simp [schwartzDilation_apply] theorem fourier_schwartzDilation_apply {d : ℕ} (a : ℝ) (ha : 0 < a) (f : Schwartz d) (ξ : Ambient d) : (𝓕 (schwartzDilation a ha.ne' f) : Schwartz d) ξ = (a ^ d)⁻¹ • (𝓕 f : Schwartz d) (a⁻¹ • ξ) := by change 𝓕 (schwartzDilation a ha.ne' f : Ambient d → ℂ) ξ = (a ^ d)⁻¹ • 𝓕 (f : Ambient d → ℂ) (a⁻¹ • ξ) rw [Real.fourier_eq', Real.fourier_eq'] let g : Ambient d → ℂ := fun y ↦ Complex.exp ((↑(-2 * Real.pi * @inner ℝ _ _ y (a⁻¹ • ξ)) : ℂ) * Complex.I) • f y have hinner (y : Ambient d) : @inner ℝ _ _ (a • y) (a⁻¹ • ξ) = @inner ℝ _ _ y ξ := by rw [real_inner_smul_left, real_inner_smul_right] field_simp calc (∫ y : Ambient d, Complex.exp ((↑(-2 * Real.pi * @inner ℝ _ _ y ξ) : ℂ) * Complex.I) • schwartzDilation a ha.ne' f y) = ∫ y : Ambient d, g (a • y) := by apply integral_congr_ae filter_upwards with y simp [g, schwartzDilation_apply, hinner y] _ = (a ^ d)⁻¹ • ∫ y : Ambient d, g y := by simpa [finrank_euclideanSpace] using (Measure.integral_comp_smul_of_nonneg (volume : Measure (Ambient d)) g a (hR := ha.le)) _ = (a ^ d)⁻¹ • ∫ y : Ambient d, Complex.exp ((↑(-2 * Real.pi * @inner ℝ _ _ y (a⁻¹ • ξ)) : ℂ) * Complex.I) • f y := by rfl theorem fourierReal_schwartzDilation_apply {d : ℕ} (a : ℝ) (ha : 0 < a) (f : Schwartz d) (ξ : Ambient d) : fourierReal (schwartzDilation a ha.ne' f) ξ = (a ^ d)⁻¹ * fourierReal f (a⁻¹ • ξ) := by unfold fourierReal rw [fourier_schwartzDilation_apply a ha f ξ] rw [Complex.smul_re] rfl theorem fourierReal_schwartzDilation_nonneg {d : ℕ} {f : Schwartz d} (hf : ∀ ξ, 0 ≤ fourierReal f ξ) (a : ℝ) (ha : 0 < a) (ξ : Ambient d) : 0 ≤ fourierReal (schwartzDilation a ha.ne' f) ξ := by rw [fourierReal_schwartzDilation_apply a ha f ξ] exact mul_nonneg (by positivity) (hf _) theorem fourierReal_schwartzDilation_zero_pos {d : ℕ} {f : Schwartz d} (hf : 0 < fourierReal f 0) (a : ℝ) (ha : 0 < a) : 0 < fourierReal (schwartzDilation a ha.ne' f) 0 := by rw [fourierReal_schwartzDilation_apply a ha f 0] simp only [smul_zero] exact mul_pos (by positivity) hf theorem quotient_schwartzDilation {d : ℕ} (a : ℝ) (ha : 0 < a) (f : Schwartz d) : quotient (schwartzDilation a ha.ne' f) = a ^ d * quotient f := by unfold quotient rw [schwartzDilation_zero, fourierReal_schwartzDilation_apply a ha f 0] simp only [smul_zero] have hpow : a ^ d ≠ 0 := pow_ne_zero _ ha.ne' field_simp end SpherePacking.Alternative end noncomputable section open Filter open scoped FourierTransform SchwartzMap Topology namespace PackingBounds theorem FullAdmissible.toAlternative {d : ℕ} (f : FullAdmissible d) : SpherePacking.Alternative.IsUnrestrictedAdmissible f.function where real_valued := f.real fourier_real_valued := f.fourier_real fourier_zero_pos := f.fourier_zero_pos fourier_nonneg := f.fourier_nonneg eventually_nonpos := f.outside_nonpos def FullAdmissible.ofAlternative {d : ℕ} {f : SpherePacking.Alternative.Schwartz d} (hf : SpherePacking.Alternative.IsUnrestrictedAdmissible f) : FullAdmissible d where function := f real := hf.real_valued fourier_real := hf.fourier_real_valued fourier_nonneg := hf.fourier_nonneg fourier_zero_pos := hf.fourier_zero_pos outside_nonpos := hf.eventually_nonpos def FullAdmissible.radialization {d : ℕ} (f : FullAdmissible d) : CohnElkies.Admissible d := let hf := f.toAlternative let g := SpherePacking.Alternative.radialSymmetrization f.function let hg := hf.radialSymmetrization_admissible { function := g real := hg.real_valued radial := hg.radial fourier_real := hg.fourier_real_valued fourier_nonneg := hg.fourier_nonneg fourier_zero_pos := hg.fourier_zero_pos outside_nonpos := hg.eventually_nonpos } theorem FullAdmissible.quotient_radialization {d : ℕ} (f : FullAdmissible d) : CohnElkies.quotient f.radialization = fullQuotient f := by change SpherePacking.Alternative.quotient (SpherePacking.Alternative.radialSymmetrization f.function) = SpherePacking.Alternative.quotient f.function exact f.toAlternative.quotient_radialSymmetrization theorem exists_radial_admissible_of_full {d : ℕ} (f : FullAdmissible d) : ∃ g : CohnElkies.Admissible d, CohnElkies.quotient g = fullQuotient f := by exact ⟨f.radialization, f.quotient_radialization⟩ theorem fullQuotientSet_eq_radial (d : ℕ) : fullQuotientSet d = CohnElkies.quotientSet d := by apply (fullQuotientSet_eq_radial_iff d).2 exact exists_radial_admissible_of_full theorem fullLinearProgram_eq_radial (d : ℕ) : fullLinearProgram d = CohnElkies.linearProgram d := by simp only [fullLinearProgram, CohnElkies.linearProgram, fullQuotientSet_eq_radial] namespace FullMain theorem exact_limit : Tendsto (fun d : ℕ => fullLinearProgram d ^ ((d : ℝ)⁻¹)) atTop (nhds (Real.sqrt (Real.exp 1 / (2 * Real.pi)))) := by simpa only [fullLinearProgram_eq_radial] using RadialMain.exact_limit theorem exact_binary_exponent : Tendsto (fun d : ℕ => Real.logb 2 (fullLinearProgram d) / (d : ℝ)) atTop (nhds (-(1 / 2 : ℝ) * Real.logb 2 (2 * Real.pi / Real.exp 1))) := by simpa only [fullLinearProgram_eq_radial] using RadialMain.exact_binary_exponent end FullMain end PackingBounds end noncomputable section open Filter open scoped Topology namespace PackingBounds theorem fullQuotientRootSet_eq_radial (d : ℕ) : {q : ℝ | ∃ f : FullAdmissible d, fullQuotient f ^ ((d : ℝ)⁻¹) = q} = {q : ℝ | ∃ f : CohnElkies.Admissible d, CohnElkies.quotient f ^ ((d : ℝ)⁻¹) = q} := by ext q constructor · rintro ⟨f, hq⟩ have hf : fullQuotient f ∈ CohnElkies.quotientSet d := by rw [← fullQuotientSet_eq_radial d] exact ⟨f, rfl⟩ obtain ⟨g, hg⟩ := hf exact ⟨g, by simpa [hg] using hq⟩ · rintro ⟨f, hq⟩ exact ⟨radialToFull f, by simpa [fullQuotient_radialToFull] using hq⟩ structure SharpFullCohnElkiesManuscriptConclusions : Prop where root_before_infimum : Tendsto (fun d : ℕ => sInf {q : ℝ | ∃ f : FullAdmissible d, fullQuotient f ^ ((d : ℝ)⁻¹) = q} / Real.sqrt (d : ℝ)) atTop (𝓝 (1 / Real.pi)) root_before_infimum_vanishing_error : ∃ err : ℕ → ℝ, Tendsto err atTop (𝓝 0) ∧ ∀ d : ℕ, 0 < d → sInf {q : ℝ | ∃ f : FullAdmissible d, fullQuotient f ^ ((d : ℝ)⁻¹) = q} = (1 / Real.pi + err d) * Real.sqrt (d : ℝ) linear_program_root : Tendsto (fun d : ℕ => (fullLinearProgram d) ^ ((d : ℝ)⁻¹)) atTop (𝓝 (Real.sqrt (Real.exp 1 / (2 * Real.pi)))) natural_logarithmic_rate : Tendsto (fun d : ℕ => Real.log (fullLinearProgram d) / (d : ℝ)) atTop (𝓝 ((1 / 2 : ℝ) * Real.log (Real.exp 1 / (2 * Real.pi)))) natural_vanishing_exponential_error : ∃ err : ℕ → ℝ, Tendsto err atTop (𝓝 0) ∧ (∀ᶠ d : ℕ in atTop, fullLinearProgram d = (Real.sqrt (Real.exp 1 / (2 * Real.pi)) + err d) ^ d) universal_nonnegative_delta : ∃ δ : ℕ → ℝ, Tendsto δ atTop (𝓝 0) ∧ (∀ d : ℕ, 0 ≤ δ d) ∧ (∀ᶠ d : ℕ in atTop, ∀ f : FullAdmissible d, (2 : ℝ) ^ d / CohnElkies.unitBallVolume d * (Real.sqrt (Real.exp 1 / (2 * Real.pi)) - δ d) ^ d ≤ fullQuotient f) base_two_exponent_positive : 0 < (1 / 2 : ℝ) * Real.logb 2 (2 * Real.pi / Real.exp 1) base_two_decimal_certificate : (1 / 2 : ℝ) * Real.logb 2 (2 * Real.pi / Real.exp 1) ∈ Set.Ioo (0.604400544291677695341677307053 : ℝ) 0.604400544291677695341677307054 base_two_logarithmic_rate : Tendsto (fun d : ℕ => Real.logb 2 (fullLinearProgram d) / (d : ℝ)) atTop (𝓝 (-((1 / 2 : ℝ) * Real.logb 2 (2 * Real.pi / Real.exp 1)))) base_two_vanishing_exponential_error : ∃ err : ℕ → ℝ, Tendsto err atTop (𝓝 0) ∧ (∀ᶠ d : ℕ in atTop, fullLinearProgram d = (2 : ℝ) ^ (-((1 / 2 : ℝ) * Real.logb 2 (2 * Real.pi / Real.exp 1) + err d) * (d : ℝ))) theorem SharpFullCohnElkiesManuscriptConclusions.ofRadial : SharpFullCohnElkiesManuscriptConclusions := by have hradial := CohnElkies.sharpCohnElkiesManuscriptConclusions refine { root_before_infimum := ?_ root_before_infimum_vanishing_error := ?_ linear_program_root := ?_ natural_logarithmic_rate := ?_ natural_vanishing_exponential_error := ?_ universal_nonnegative_delta := ?_ base_two_exponent_positive := hradial.base_two_exponent_positive base_two_decimal_certificate := hradial.base_two_decimal_certificate base_two_logarithmic_rate := ?_ base_two_vanishing_exponential_error := ?_ } · simpa only [fullQuotientRootSet_eq_radial] using hradial.root_before_infimum · obtain ⟨err, herr, hformula⟩ := hradial.root_before_infimum_vanishing_error exact ⟨err, herr, by simpa only [fullQuotientRootSet_eq_radial] using hformula⟩ · simpa only [fullLinearProgram_eq_radial] using hradial.linear_program_root · simpa only [fullLinearProgram_eq_radial] using hradial.natural_logarithmic_rate · obtain ⟨err, herr, hformula⟩ := hradial.natural_vanishing_exponential_error exact ⟨err, herr, by simpa only [fullLinearProgram_eq_radial] using hformula⟩ · obtain ⟨δ, hδ, hnonneg, hbound⟩ := hradial.universal_nonnegative_delta refine ⟨δ, hδ, hnonneg, ?_⟩ filter_upwards [hbound] with d hd f have hf : fullQuotient f ∈ CohnElkies.quotientSet d := by rw [← fullQuotientSet_eq_radial d] exact ⟨f, rfl⟩ obtain ⟨g, hg⟩ := hf simpa [hg] using hd g · simpa only [fullLinearProgram_eq_radial] using hradial.base_two_logarithmic_rate · obtain ⟨err, herr, hformula⟩ := hradial.base_two_vanishing_exponential_error exact ⟨err, herr, by simpa only [fullLinearProgram_eq_radial] using hformula⟩ theorem SharpFullCohnElkiesManuscriptConclusions.components : Tendsto (fun d : ℕ => sInf {q : ℝ | ∃ f : FullAdmissible d, fullQuotient f ^ ((d : ℝ)⁻¹) = q} / Real.sqrt (d : ℝ)) atTop (𝓝 (1 / Real.pi)) ∧ (∃ err : ℕ → ℝ, Tendsto err atTop (𝓝 0) ∧ ∀ d : ℕ, 0 < d → sInf {q : ℝ | ∃ f : FullAdmissible d, fullQuotient f ^ ((d : ℝ)⁻¹) = q} = (1 / Real.pi + err d) * Real.sqrt (d : ℝ)) ∧ Tendsto (fun d : ℕ => (fullLinearProgram d) ^ ((d : ℝ)⁻¹)) atTop (𝓝 (Real.sqrt (Real.exp 1 / (2 * Real.pi)))) ∧ Tendsto (fun d : ℕ => Real.log (fullLinearProgram d) / (d : ℝ)) atTop (𝓝 ((1 / 2 : ℝ) * Real.log (Real.exp 1 / (2 * Real.pi)))) ∧ (∃ err : ℕ → ℝ, Tendsto err atTop (𝓝 0) ∧ (∀ᶠ d : ℕ in atTop, fullLinearProgram d = (Real.sqrt (Real.exp 1 / (2 * Real.pi)) + err d) ^ d)) ∧ (∃ δ : ℕ → ℝ, Tendsto δ atTop (𝓝 0) ∧ (∀ d : ℕ, 0 ≤ δ d) ∧ (∀ᶠ d : ℕ in atTop, ∀ f : FullAdmissible d, (2 : ℝ) ^ d / CohnElkies.unitBallVolume d * (Real.sqrt (Real.exp 1 / (2 * Real.pi)) - δ d) ^ d ≤ fullQuotient f)) ∧ 0 < (1 / 2 : ℝ) * Real.logb 2 (2 * Real.pi / Real.exp 1) ∧ (1 / 2 : ℝ) * Real.logb 2 (2 * Real.pi / Real.exp 1) ∈ Set.Ioo (0.604400544291677695341677307053 : ℝ) 0.604400544291677695341677307054 ∧ Tendsto (fun d : ℕ => Real.logb 2 (fullLinearProgram d) / (d : ℝ)) atTop (𝓝 (-((1 / 2 : ℝ) * Real.logb 2 (2 * Real.pi / Real.exp 1)))) ∧ (∃ err : ℕ → ℝ, Tendsto err atTop (𝓝 0) ∧ (∀ᶠ d : ℕ in atTop, fullLinearProgram d = (2 : ℝ) ^ (-((1 / 2 : ℝ) * Real.logb 2 (2 * Real.pi / Real.exp 1) + err d) * (d : ℝ)))) := ⟨SharpFullCohnElkiesManuscriptConclusions.ofRadial.root_before_infimum, SharpFullCohnElkiesManuscriptConclusions.ofRadial.root_before_infimum_vanishing_error, SharpFullCohnElkiesManuscriptConclusions.ofRadial.linear_program_root, SharpFullCohnElkiesManuscriptConclusions.ofRadial.natural_logarithmic_rate, SharpFullCohnElkiesManuscriptConclusions.ofRadial.natural_vanishing_exponential_error, SharpFullCohnElkiesManuscriptConclusions.ofRadial.universal_nonnegative_delta, SharpFullCohnElkiesManuscriptConclusions.ofRadial.base_two_exponent_positive, SharpFullCohnElkiesManuscriptConclusions.ofRadial.base_two_decimal_certificate, SharpFullCohnElkiesManuscriptConclusions.ofRadial.base_two_logarithmic_rate, SharpFullCohnElkiesManuscriptConclusions.ofRadial.base_two_vanishing_exponential_error⟩ theorem sharpFullCohnElkiesManuscriptConclusions : SharpFullCohnElkiesManuscriptConclusions := { root_before_infimum := SharpFullCohnElkiesManuscriptConclusions.components.1 root_before_infimum_vanishing_error := SharpFullCohnElkiesManuscriptConclusions.components.2.1 linear_program_root := SharpFullCohnElkiesManuscriptConclusions.components.2.2.1 natural_logarithmic_rate := SharpFullCohnElkiesManuscriptConclusions.components.2.2.2.1 natural_vanishing_exponential_error := SharpFullCohnElkiesManuscriptConclusions.components.2.2.2.2.1 universal_nonnegative_delta := SharpFullCohnElkiesManuscriptConclusions.components.2.2.2.2.2.1 base_two_exponent_positive := SharpFullCohnElkiesManuscriptConclusions.components.2.2.2.2.2.2.1 base_two_decimal_certificate := SharpFullCohnElkiesManuscriptConclusions.components.2.2.2.2.2.2.2.1 base_two_logarithmic_rate := SharpFullCohnElkiesManuscriptConclusions.components.2.2.2.2.2.2.2.2.1 base_two_vanishing_exponential_error := SharpFullCohnElkiesManuscriptConclusions.components.2.2.2.2.2.2.2.2.2 } end PackingBounds end