diff --git a/LeanPool/PhaseRetrieval.lean b/LeanPool/PhaseRetrieval.lean index f7ae90ebbc..927b598a96 100644 --- a/LeanPool/PhaseRetrieval.lean +++ b/LeanPool/PhaseRetrieval.lean @@ -7,11 +7,6 @@ module public import LeanPool.PhaseRetrieval.Constant public import LeanPool.PhaseRetrieval.DimdPoly -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.SpecialFunctions.Bernstein -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Combinatorics.Matroid.Init -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.Tactic.NormNum.Parity /-! diff --git a/LeanPool/PhaseRetrieval/Constant.lean b/LeanPool/PhaseRetrieval/Constant.lean index ef0c30ab23..963c1e56c1 100644 --- a/LeanPool/PhaseRetrieval/Constant.lean +++ b/LeanPool/PhaseRetrieval/Constant.lean @@ -8,8 +8,6 @@ module public import LeanPool.PhaseRetrieval.Constant.Internal.Local import LeanPool.PhaseRetrieval.Constant.Internal.LocalCore import LeanPool.PhaseRetrieval.Constant.Internal.LocalHelpers -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.Tactic.NormNum.Parity /-! diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/AnnulusLocalEstimate.lean b/LeanPool/PhaseRetrieval/Constant/Internal/AnnulusLocalEstimate.lean index dd8eabe95b..1488ccff1a 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/AnnulusLocalEstimate.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/AnnulusLocalEstimate.lean @@ -18,8 +18,6 @@ module public import LeanPool.PhaseRetrieval.Constant.Internal.BlockDecomposition import LeanPool.PhaseRetrieval.Constant.Internal.HighFreqBandEstimate import LeanPool.PhaseRetrieval.Constant.Internal.LocalCircleEstimate -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.Tactic.NormNum.Parity /-! # AnnulusLocalEstimate -/ diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/BlockDecomposition.lean b/LeanPool/PhaseRetrieval/Constant/Internal/BlockDecomposition.lean index 1feed38cde..96617de6bd 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/BlockDecomposition.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/BlockDecomposition.lean @@ -25,8 +25,6 @@ Authors: Susanna Bertolini, Jaume de Dios Pont module public import LeanPool.PhaseRetrieval.Constant.Internal.Definitions -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Data.Nat.Factorial.DoubleFactorial /-! # BlockDecomposition -/ diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/HighFreqBandEstimate.lean b/LeanPool/PhaseRetrieval/Constant/Internal/HighFreqBandEstimate.lean index b5d8330471..e5d7c3033f 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/HighFreqBandEstimate.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/HighFreqBandEstimate.lean @@ -22,8 +22,6 @@ import LeanPool.PhaseRetrieval.Constant.Internal.MissingMathlib.Poincare import LeanPool.PhaseRetrieval.Constant.Internal.RotationalAveraging import LeanPool.PhaseRetrieval.Constant.Internal.SafeSquare import Mathlib.Analysis.Real.Pi.Bounds -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.Tactic.NormNum.Parity /-! # HighFreqBandEstimate -/ diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/LaplaceFactorial.lean b/LeanPool/PhaseRetrieval/Constant/Internal/LaplaceFactorial.lean index 5c498bcb33..0333c4afd9 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/LaplaceFactorial.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/LaplaceFactorial.lean @@ -21,7 +21,6 @@ Authors: Susanna Bertolini, Jaume de Dios Pont module public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic import Mathlib.Analysis.SpecialFunctions.Stirling import Mathlib.Tactic.NormNum.Parity diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/LeakageEstimate.lean b/LeanPool/PhaseRetrieval/Constant/Internal/LeakageEstimate.lean index 61ca58e4a1..f687c5bc2c 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/LeakageEstimate.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/LeakageEstimate.lean @@ -19,8 +19,6 @@ module public import LeanPool.PhaseRetrieval.Constant.Internal.BlockDecomposition import LeanPool.PhaseRetrieval.Constant.Internal.LaplaceFactorial -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.Tactic.NormNum.Parity /-! # LeakageEstimate -/ diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/LipschitzRho.lean b/LeanPool/PhaseRetrieval/Constant/Internal/LipschitzRho.lean index 1ca1c03cf5..81b703b26e 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/LipschitzRho.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/LipschitzRho.lean @@ -19,8 +19,6 @@ Authors: Susanna Bertolini, Jaume de Dios Pont module public import LeanPool.PhaseRetrieval.Constant.Internal.Definitions -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Data.Nat.Factorial.DoubleFactorial /-! # LipschitzRho -/ diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/Local.lean b/LeanPool/PhaseRetrieval/Constant/Internal/Local.lean index ebe57c57fb..bca6af8a6f 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/Local.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/Local.lean @@ -27,9 +27,6 @@ public import Mathlib.LinearAlgebra.Complex.FiniteDimensional public import Mathlib.MeasureTheory.Integral.Bochner.Basic public import Mathlib.MeasureTheory.Measure.Haar.OfBasis import LeanPool.PhaseRetrieval.Constant.Internal.LocalHelpers -import Mathlib.Analysis.SpecialFunctions.Bernstein -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.Tactic.NormNum.Parity /-! # Local -/ diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/LocalCircleEstimate.lean b/LeanPool/PhaseRetrieval/Constant/Internal/LocalCircleEstimate.lean index fd0a42442f..3c963eedf3 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/LocalCircleEstimate.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/LocalCircleEstimate.lean @@ -16,8 +16,6 @@ Authors: Susanna Bertolini, Jaume de Dios Pont module public import LeanPool.PhaseRetrieval.Constant.Internal.Definitions -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.Tactic.NormNum.Parity /-! # LocalCircleEstimate -/ @@ -247,7 +245,7 @@ private lemma equal_l2_masses {L : ℕ} (_hL : 1 ≤ L) {E : Finset ℕ} /-! ### Pointwise bound: rho(w)² ≥ w.re²/2 - ‖w‖⁴ -/ --- The nonlinear `rho` estimate is discharged by a large `nlinarith` certificate. +-- A sum-of-squares identity controls the nonlinear remainder in the `rho` estimate. private lemma rho_sq_lower_bound (w : ℂ) (hw : ‖w‖ ≤ 1 / 4) : (rho w) ^ 2 ≥ w.re ^ 2 / 2 - ‖w‖ ^ 4 := by unfold rho; rw [sq_abs] @@ -268,28 +266,43 @@ private lemma rho_sq_lower_bound (w : ℂ) (hw : ‖w‖ ≤ 1 / 4) : have hA_sq : (2 + 2 * u + s - u ^ 2 / 2 + s ^ 2) ^ 2 ≥ 4 * ((1 + u) ^ 2 + v ^ 2) := by - nlinarith [sq_nonneg (2 * u + u ^ 2 / 2 + v ^ 2 + - (u ^ 2 + v ^ 2) ^ 2), - sq_nonneg u, sq_nonneg v, sq_nonneg (u * v), - sq_nonneg (u ^ 2 + v ^ 2 - u), - sq_nonneg (u + v ^ 2), - sq_nonneg (u ^ 2 - v ^ 2)] + set t := u ^ 2 / 2 + v ^ 2 + s ^ 2 + have hs : 0 ≤ s := add_nonneg (sq_nonneg u) (sq_nonneg v) + have hs_sq : s ^ 2 ≤ s := by + simpa only [sq, mul_one] using + mul_le_mul_of_nonneg_left (show s ≤ 1 by linarith only [hs_le]) hs + have ht : 0 ≤ t := by dsimp [t]; positivity + have ht_le : t ≤ 2 * s := by + dsimp [t] + have hu : u ^ 2 / 2 + v ^ 2 ≤ s := by dsimp [s]; linarith only [sq_nonneg u] + linarith only [hu, hs_sq] + have hdiff : 0 ≤ (2 * s - t) * (2 * s + t) := + mul_nonneg (sub_nonneg.mpr ht_le) (by positivity) + have hidentity : + (2 + 2 * u + s - u ^ 2 / 2 + s ^ 2) ^ 2 - + 4 * ((1 + u) ^ 2 + v ^ 2) = + 2 * (u + t) ^ 2 + (2 * s - t) * (2 * s + t) := by + dsimp [s, t] + ring + have hnonneg : 0 ≤ (2 + 2 * u + s - u ^ 2 / 2 + s ^ 2) ^ 2 - + 4 * ((1 + u) ^ 2 + v ^ 2) := by + rw [hidentity] + positivity + linarith only [hnonneg] have hA_nn : 0 ≤ 2 + 2 * u + s - u ^ 2 / 2 + s ^ 2 := by - have : u ^ 2 ≤ s := by simp [s]; nlinarith [sq_nonneg v] - nlinarith + have hidentity : 2 + 2 * u + s - u ^ 2 / 2 + s ^ 2 = + (u + 2) ^ 2 / 2 + v ^ 2 + s ^ 2 := by dsimp [s]; ring + rw [hidentity] + positivity have h2r : 2 * r ≤ 2 + 2 * u + s - u ^ 2 / 2 + s ^ 2 := by - by_contra h_neg; push Not at h_neg - have h1 : - (2 * r) ^ 2 > - (2 + 2 * u + s - u ^ 2 / 2 + s ^ 2) ^ 2 := - sq_lt_sq' (by linarith) h_neg - rw [show (2 * r) ^ 2 = 4 * r ^ 2 from by ring, hr_sq] at h1 - linarith + apply (sq_le_sq₀ (by positivity) hA_nn).mp + linarith only [hr_sq, hA_sq] have hw4 : ‖w‖ ^ 4 = s ^ 2 := by have : ‖w‖ ^ 4 = (‖w‖ ^ 2) ^ 2 := by ring rw [this, hw_sq] - rw [hw4]; nlinarith [sq_nonneg (r - 1)] + rw [hw4] + linarith only [hr_sq, h2r, show s = u ^ 2 + v ^ 2 from rfl] /-! ### ∫ ‖P‖⁴ bound -/ @@ -581,7 +594,7 @@ private lemma large_amplitude {L : ℕ} (hL : 1 ≤ L) {E : Finset ℕ} ∂AddCircle.haarAddCircle ≤ 2 * cns + 4 := by have h_pw : ∀ t : AddCircle T, (‖(1 : ℂ) + P t‖ + 1) ^ 2 ≤ - 2 * ‖(1 : ℂ) + P t‖ ^ 2 + 2 := by intro t; nlinarith [sq_nonneg (‖(1 : ℂ) + P t‖ - 1)] + 2 * ‖(1 : ℂ) + P t‖ ^ 2 + 2 := by intro t; linarith only [sq_nonneg (‖(1 : ℂ) + P t‖ - 1)] calc ∫ t, (‖(1 : ℂ) + P t‖ + 1) ^ 2 ∂AddCircle.haarAddCircle ≤ ∫ t, (2 * ‖(1 : ℂ) + P t‖ ^ 2 + 2) ∂AddCircle.haarAddCircle := integral_mono @@ -644,7 +657,7 @@ theorem local_circle_estimate {L : ℕ} (hL : 1 ≤ L) {E : Finset ℕ} have hL_real : (1 : ℝ) ≤ (L : ℝ) := Nat.one_le_cast.mpr hL nlinarith [mul_le_mul_of_nonneg_left (by linarith : (3 : ℝ) / 16 * circleNormSq P ≤ ∫ t, rho (P t) ^ 2 ∂AddCircle.haarAddCircle) - (show (0 : ℝ) ≤ 144 * L from by nlinarith)] + (show (0 : ℝ) ≤ 144 * L from by linarith)] · push Not at hx have h := large_amplitude hL hE hE_pos b P hP hx have hL_pos : (0 : ℝ) < (L : ℝ) := Nat.cast_pos.mpr (by omega) diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/LocalCore.lean b/LeanPool/PhaseRetrieval/Constant/Internal/LocalCore.lean index 9d875052aa..0aa5c3f5c9 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/LocalCore.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/LocalCore.lean @@ -109,13 +109,16 @@ private lemma integral_fourier_eq_zero (n : ℤ) (hn : n ≠ 0) : (fourier 0 : C(AddCircle T, ℂ)) from rfl, fourierCoeff_fourier] simp [Pi.single, Function.update, hn] rw [fourierCoeff] at h - simp_all + simp_all only [ne_eq, neg_neg, fourier_apply, zero_smul, AddCircle.toCircle_zero, Circle.coe_one, + smul_eq_mul, mul_one] private lemma integral_polyEvalCircle_eq_zero {D : ℕ} (a : Fin D → ℂ) (r : ℝ) : ∫ t : AddCircle T, polyEvalCircle a r t ∂AddCircle.haarAddCircle = 0 := by unfold polyEvalCircle rw [integral_finsetSum _ (fun k _ => by - simpa using (((fourier ((k.val + 1 : ℕ) : ℤ)) : C(AddCircle T, ℂ)).continuous.const_mul + simpa only [Nat.cast_add, Nat.cast_one, fourier_apply, fourier_add', natCast_zsmul, + one_smul] using + (((fourier ((k.val + 1 : ℕ) : ℤ)) : C(AddCircle T, ℂ)).continuous.const_mul (a k * (r : ℂ) ^ (k.val + 1))).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _))] apply Finset.sum_eq_zero @@ -128,7 +131,8 @@ private lemma integral_polyEvalCircle_eq_zero {D : ℕ} (a : Fin D → ℂ) (r : = (a k * (r : ℂ) ^ (k.val + 1)) * ∫ t : AddCircle T, fourier ((k.val + 1 : ℕ) : ℤ) t ∂AddCircle.haarAddCircle := by - simpa [mul_assoc] using integral_const_mul + simpa only [Nat.cast_add, Nat.cast_one, fourier_apply, fourier_add', natCast_zsmul, + one_smul, mul_assoc] using integral_const_mul (a k * (r : ℂ) ^ (k.val + 1)) (fun t : AddCircle T => (fourier ((k.val + 1 : ℕ) : ℤ) t : ℂ)) _ = 0 := by rw [integral_fourier_eq_zero _ hne, mul_zero] @@ -190,7 +194,7 @@ private lemma integral_const_add_polyEvalCircle_sq {D : ℕ} have hc : c.re ^ 2 + c.im ^ 2 = ‖c‖ ^ 2 := by rw [Complex.sq_norm, Complex.normSq_apply] ring_nf - nlinarith + linarith only [hc] have h_int3 : Integrable (fun t : AddCircle T => @@ -220,7 +224,7 @@ private lemma integral_const_add_polyEvalCircle_sq {D : ℕ} ∫ t : AddCircle T, (‖c‖ ^ 2 + 2 * c.re * (polyEvalCircle a r t).re) ∂AddCircle.haarAddCircle + ∫ t : AddCircle T, 2 * c.im * (polyEvalCircle a r t).im ∂AddCircle.haarAddCircle := by - simpa [add_assoc] using + simpa only [add_assoc, Function.comp_apply, Pi.add_apply] using (integral_add ((real_cont_integrable_circle continuous_const).add (real_cont_integrable_circle ((Complex.continuous_re.comp hcont).const_mul (2 * c.re)))) @@ -230,7 +234,7 @@ private lemma integral_const_add_polyEvalCircle_sq {D : ℕ} ∂AddCircle.haarAddCircle = ∫ t : AddCircle T, ‖c‖ ^ 2 ∂AddCircle.haarAddCircle + ∫ t : AddCircle T, 2 * c.re * (polyEvalCircle a r t).re ∂AddCircle.haarAddCircle := by - simpa using + simpa only [integral_const, probReal_univ, smul_eq_mul, one_mul, Function.comp_apply] using (integral_add (real_cont_integrable_circle continuous_const) (real_cont_integrable_circle ((Complex.continuous_re.comp hcont).const_mul (2 * c.re)))) rw [h_split1, h_split2] @@ -264,14 +268,14 @@ private lemma integrable_pow_mul_exp_neg_sq (n : ℕ) : Integrable (fun r : ℝ => r ^ n * Real.exp (-r ^ 2)) volume := by have hs : (-1 : ℝ) < (n : ℝ) := by exact_mod_cast (show -1 < (n : ℤ) by omega) have h := integrable_rpow_mul_exp_neg_mul_sq one_pos hs - simp_all + simp_all only [rpow_natCast, neg_mul, one_mul] private lemma integrable_abs_pow_mul_exp_neg_sq (n : ℕ) : Integrable (fun r : ℝ => |r| ^ n * Real.exp (-r ^ 2)) volume := by have : (fun r : ℝ => |r| ^ n * Real.exp (-r ^ 2)) = fun r => ‖r ^ n * Real.exp (-r ^ 2)‖ := by - simp_all + simp_all only [norm_mul, norm_pow, norm_eq_abs, abs_exp] rw [this] exact (integrable_pow_mul_exp_neg_sq n).norm @@ -283,7 +287,9 @@ private lemma norm_polyEvalCircle_le {D : ℕ} (a : Fin D → ℂ) (r : ℝ) (t ≤ ∑ k : Fin D, ‖a k * (r : ℂ) ^ (k.val + 1) * fourier ((k.val + 1 : ℕ) : ℤ) t‖ := norm_sum_le _ _ _ ≤ ∑ k : Fin D, ‖a k‖ * |r| ^ (k.val + 1) := by - simp_all [fourier_apply, Circle.norm_coe] + simp_all only [Nat.cast_add, Nat.cast_one, fourier_apply, fourier_add', natCast_zsmul, + one_smul, Complex.norm_mul, norm_pow, norm_real, norm_eq_abs, Circle.norm_coe, mul_one, + Std.le_refl] private lemma norm_sq_polyEvalCircle_le {D : ℕ} (a : Fin D → ℂ) (r : ℝ) (t : AddCircle T) : ‖polyEvalCircle a r t‖ ^ 2 ≤ @@ -292,7 +298,7 @@ private lemma norm_sq_polyEvalCircle_le {D : ℕ} (a : Fin D → ℂ) (r : ℝ) apply Finset.sum_nonneg intro k hk exact mul_nonneg (norm_nonneg _) (pow_nonneg (abs_nonneg r) _) - nlinarith [norm_polyEvalCircle_le a r t, hsumnn, norm_nonneg (polyEvalCircle a r t)] + nlinarith only [norm_polyEvalCircle_le a r t, norm_nonneg (polyEvalCircle a r t)] private lemma integrableOn_polar_norm {D : ℕ} (a : Fin D → ℂ) : IntegrableOn @@ -454,7 +460,8 @@ private lemma integrableOn_polar_norm {D : ℕ} (a : Fin D → ℂ) : ((1 + r ^ (D - 1)) * C) ^ 2 := sq_le_sq' (by linarith) hsum_le have hsq2 : ((1 + r ^ (D - 1)) * C) ^ 2 ≤ - 2 * (1 + (r ^ (D - 1)) ^ 2) * C ^ 2 := by nlinarith [sq_nonneg (1 - r ^ (D - 1))] + 2 * (1 + (r ^ (D - 1)) ^ 2) * C ^ 2 := by + nlinarith only [sq_nonneg (1 - r ^ (D - 1))] have hpow_eq : r ^ 3 * (r ^ (D - 1)) ^ 2 = r * r ^ (D * 2) := by have hexp_eq : 3 + (D - 1) * 2 = 1 + D * 2 := by omega rw [← pow_mul, ← pow_add, hexp_eq, pow_add, pow_one] @@ -465,9 +472,7 @@ private lemma integrableOn_polar_norm {D : ℕ} (a : Fin D → ℂ) : _ = 2 * C ^ 2 * (r ^ 3 + r ^ 3 * (r ^ (D - 1)) ^ 2) := by ring _ = 2 * C ^ 2 * (r ^ 3 + r * r ^ (D * 2)) := by rw [hpow_eq] _ ≤ r * r ^ (D * 2) * C ^ 2 * 4 + r ^ 3 * C ^ 2 * 4 := by - nlinarith [pow_nonneg hr_nn 3, - mul_nonneg hr_nn (pow_nonneg hr_nn (D * 2)), - sq_nonneg C] + nlinarith only [pow_nonneg hr_nn 3, mul_nonneg hr_nn (pow_nonneg hr_nn (D * 2))] private lemma gaussian_integral_eq_pi : ∫ z : ℂ, Real.exp (-‖z‖ ^ 2) = Real.pi := by @@ -491,11 +496,12 @@ private lemma gaussian_integral_eq_pi : have hz : ‖({ re := x, im := y } : ℂ)‖ ^ 2 = x ^ 2 + y ^ 2 := by calc ‖({ re := x, im := y } : ℂ)‖ ^ 2 = Complex.normSq ({ re := x, im := y } : ℂ) := by - simpa [pow_two] using + simpa only [pow_two, normSq_mk] using (Complex.normSq_eq_norm_sq ({ re := x, im := y } : ℂ)).symm _ = x ^ 2 + y ^ 2 := by simp [Complex.normSq, pow_two] rw [hz, show -(x ^ 2 + y ^ 2) = -x ^ 2 + -y ^ 2 by ring, Real.exp_add] - _ = ∫ z : ℂ, Real.exp (-‖z‖ ^ 2) := by simpa using hraw + _ = ∫ z : ℂ, Real.exp (-‖z‖ ^ 2) := by simpa only [measurableEquivRealProd_symm_apply] using + hraw have hprod : ∫ p : ℝ × ℝ, f p = (∫ x : ℝ, Real.exp (-x ^ 2)) * ∫ y : ℝ, Real.exp (-y ^ 2) := by @@ -503,12 +509,14 @@ private lemma gaussian_integral_eq_pi : (fun y : ℝ => Real.exp (-y ^ 2)) rw [hcomp, hprod] have hgauss : ∫ x : ℝ, Real.exp (-(1 : ℝ) * x ^ 2) = Real.sqrt Real.pi := by - simpa using integral_gaussian (1 : ℝ) - have hgauss' : ∫ x : ℝ, Real.exp (-x ^ 2) = Real.sqrt Real.pi := by simpa [one_mul] using hgauss + simpa only [neg_mul, one_mul, div_one] using integral_gaussian (1 : ℝ) + have hgauss' : ∫ x : ℝ, Real.exp (-x ^ 2) = Real.sqrt Real.pi := by simpa only [neg_mul, + one_mul] using + hgauss calc (∫ x : ℝ, Real.exp (-x ^ 2)) * ∫ y : ℝ, Real.exp (-y ^ 2) = Real.sqrt Real.pi * Real.sqrt Real.pi := by simp [hgauss'] - _ = Real.pi := by nlinarith [Real.sq_sqrt Real.pi_pos.le] + _ = Real.pi := by linarith only [Real.sq_sqrt Real.pi_pos.le] private lemma gaussian_integral_normalized : (1 / Real.pi) * ∫ z : ℂ, Real.exp (-‖z‖ ^ 2) = 1 := by @@ -719,8 +727,9 @@ private lemma radial_gaussian_integral (n : ℕ) : intro r _ congr 1 · rw [← rpow_natCast r (2 * n + 1)] - simp_all - · simp_all + simp_all only [Nat.ofNat_pos, Set.mem_Ioi, Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat, + Nat.cast_one] + · simp_all only [Nat.ofNat_pos, Set.mem_Ioi, rpow_ofNat] rw [setIntegral_congr_fun measurableSet_Ioi pow_eq] rw [integral_rpow_mul_exp_neg_rpow hp hq] have h1 : (2 * (n : ℝ) + 1 + 1) / 2 = ↑n + 1 := by ring @@ -887,7 +896,7 @@ lemma gaussian_integral_const_add_polyEval {D : ℕ} (a : Fin D → ℂ) (c : unfold first have : IntegrableOn (fun r : ℝ => (T * ‖c‖ ^ 2) * (r ^ 1 * Real.exp (-r ^ 2))) (Set.Ioi 0) volume := (integrable_pow_mul_exp_neg_sq 1).integrableOn.const_mul (T * ‖c‖ ^ 2) - simpa [IntegrableOn, mul_assoc, mul_left_comm, mul_comm, pow_one] using this + simpa only [mul_comm, mul_left_comm, IntegrableOn, pow_one, mul_assoc] using this have hsum : whole = first + second := by funext r simp [whole, first, second] @@ -915,7 +924,8 @@ lemma gaussian_integral_const_add_polyEval {D : ℕ} (a : Fin D → ℂ) (c : simp only [T] field_simp have hrad : 2 * ∫ r in Set.Ioi (0 : ℝ), r * Real.exp (-r ^ 2) = 1 := by - simpa using radial_gaussian_integral 0 + simpa only [mul_zero, zero_add, pow_one, Nat.factorial_zero, Nat.cast_one] using + radial_gaussian_integral 0 calc (1 / Real.pi) * ((∫ r in Set.Ioi (0 : ℝ), T * (r * Real.exp (-r ^ 2)) ∂volume) * ‖c‖ ^ 2) = (((1 / Real.pi) * T) * @@ -945,7 +955,7 @@ lemma gaussian_integral_const_add_polyEval {D : ℕ} (a : Fin D → ℂ) (c : ∫ t : AddCircle T, ‖polyEvalCircle a r t‖ ^ 2 ∂AddCircle.haarAddCircle := by rw [hT_eq] _ = (1 / Real.pi) * ∫ z : ℂ, ‖polyEval a z‖ ^ 2 * Real.exp (-‖z‖ ^ 2) := by - simpa using (fockNorm_polar_local a).symm + simpa only [one_div] using (fockNorm_polar_local a).symm _ = fockNormSq a := fockNorm_eq_gaussian_integral a have hfinal : (1 / Real.pi) * (∫ r in Set.Ioi (0 : ℝ), first r) + @@ -961,7 +971,8 @@ lemma gaussian_integral_const_add_polyEval {D : ℕ} (a : Fin D → ℂ) (c : private lemma gaussian_integral_real_const_add_polyEval {D : ℕ} (a : Fin D → ℂ) (u : ℝ) : (1 / Real.pi) * ∫ z : ℂ, ‖(u : ℂ) + polyEval a z‖ ^ 2 * Real.exp (-‖z‖ ^ 2) = - u ^ 2 + fockNormSq a := by simpa using gaussian_integral_const_add_polyEval a (u : ℂ) + u ^ 2 + fockNormSq a := by simpa only [one_div, norm_real, norm_eq_abs, sq_abs] using + gaussian_integral_const_add_polyEval a (u : ℂ) private lemma integrable_gaussian_sq_real_const_add_polyEval {D : ℕ} (a : Fin D → ℂ) (u : ℝ) : @@ -1004,7 +1015,7 @@ private lemma integrable_gaussian_sq_real_const_add_polyEval {D : ℕ} rw [lintegral_congr_ae hFG] have hG_int : Integrable G ((volume.prod volume).restrict (Set.Ioi 0 ×ˢ Set.Ioo (-Real.pi) Real.pi)) := by - simpa [G, IntegrableOn] using integrableOn_polar_real_const_add a u + simpa only [IntegrableOn, G] using integrableOn_polar_real_const_add a u have hG_nonneg : 0 ≤ᵐ[(volume.prod volume).restrict (Set.Ioi 0 ×ˢ Set.Ioo (-Real.pi) Real.pi)] G := by apply (ae_restrict_iff' (measurableSet_Ioi.prod measurableSet_Ioo)).mpr @@ -1030,7 +1041,7 @@ private lemma measurable_gaussianWeight : Measurable gaussianWeight := by private lemma gaussianWeight_ae_lt_top : ∀ᵐ z : ℂ ∂volume, ENNReal.ofReal (gaussianWeight z) < ∞ := by - simp_all + simp_all only [ENNReal.ofReal_lt_top, Filter.eventually_true] private lemma integrable_gaussianWeight : Integrable gaussianWeight volume := by @@ -1040,7 +1051,7 @@ private lemma integrable_gaussianWeight : simp [gaussianWeight, polyEval] private lemma gaussianMeasure_isFinite : IsFiniteMeasure gaussianMeasure := by - simpa [gaussianMeasure, gaussianWeight] using + simpa only [gaussianMeasure, gaussianWeight, one_div] using (MeasureTheory.isFiniteMeasure_withDensity_ofReal (μ := (volume : Measure ℂ)) integrable_gaussianWeight.hasFiniteIntegral) @@ -1074,7 +1085,8 @@ private lemma integral_one_gaussianMeasure : calc ∫ z, (1 : ℝ) ∂gaussianMeasure = (1 / Real.pi) * ∫ z : ℂ, Real.exp (-‖z‖ ^ 2) := by - simpa using integral_gaussianMeasure_eq (fun _ : ℂ => (1 : ℝ)) + simpa only [integral_const, smul_eq_mul, mul_one, one_div, one_mul] using + integral_gaussianMeasure_eq (fun _ : ℂ => (1 : ℝ)) _ = 1 := gaussian_integral_normalized private lemma integrable_sq_gaussianMeasure_real_const_add_polyEval {D : ℕ} @@ -1126,12 +1138,12 @@ private lemma integrable_sq_gaussianMeasure_norm_add_one_real_const_add_polyEval have hnorm := norm_add_le (1 : ℂ) ((u : ℂ) + polyEval a z) calc ‖(1 : ℂ) + ((u : ℂ) + polyEval a z)‖ + 1 ≤ (1 + ‖(u : ℂ) + polyEval a z‖) + 1 := by - simpa [add_comm, add_left_comm, add_assoc] using add_le_add_right hnorm 1 + simpa only [add_comm, add_assoc, add_left_comm, norm_one] using add_le_add_right hnorm 1 _ = 2 + ‖(u : ℂ) + polyEval a z‖ := by ring have hsq : (2 + ‖(u : ℂ) + polyEval a z‖) ^ 2 ≤ 8 + 2 * ‖(u : ℂ) + polyEval a z‖ ^ 2 := by - nlinarith [sq_nonneg (‖(u : ℂ) + polyEval a z‖ - 2)] + linarith only [sq_nonneg (‖(u : ℂ) + polyEval a z‖ - 2)] have htri_sq : (‖(1 : ℂ) + ((u : ℂ) + polyEval a z)‖ + 1) ^ 2 ≤ (2 + ‖(u : ℂ) + polyEval a z‖) ^ 2 := by have hnn1 : 0 ≤ ‖(1 : ℂ) + ((u : ℂ) + polyEval a z)‖ + 1 := by positivity @@ -1148,8 +1160,8 @@ private lemma integrable_of_sq_gaussian {f : ℂ → ℝ} ((MeasureTheory.integrable_const (1 : ℝ)).add hf2) hfm ?_ filter_upwards with z rw [Real.norm_eq_abs] - have hbound : |f z| ≤ |f z| ^ 2 + 1 := by nlinarith [sq_nonneg (|f z| - (1 / 2 : ℝ))] - simpa [sq_abs, add_comm, add_left_comm, add_assoc] using hbound + have hbound : |f z| ≤ |f z| ^ 2 + 1 := by linarith only [sq_nonneg (|f z| - (1 / 2 : ℝ))] + simpa only [Pi.add_apply, add_comm, ge_iff_le, sq_abs, add_left_comm, add_assoc] using hbound private lemma integrable_mul_of_sq_gaussian {f g : ℂ → ℝ} (hfgm : AEStronglyMeasurable (fun z => f z * g z) gaussianMeasure) @@ -1160,8 +1172,10 @@ private lemma integrable_mul_of_sq_gaussian {f g : ℂ → ℝ} filter_upwards with z rw [Real.norm_eq_abs] rw [abs_mul] - have hbound : |f z| * |g z| ≤ |f z| ^ 2 + |g z| ^ 2 := by nlinarith [sq_nonneg (|f z| - |g z|)] - simpa [sq_abs] using hbound + have hbound : |f z| * |g z| ≤ |f z| ^ 2 + |g z| ^ 2 := by + linarith only [two_mul_le_add_sq |f z| |g z|, + mul_nonneg (abs_nonneg (f z)) (abs_nonneg (g z))] + simpa only [Pi.add_apply, ge_iff_le, sq_abs] using hbound private lemma gaussian_l1_sq_le {f : ℂ → ℝ} (hfm : AEStronglyMeasurable f gaussianMeasure) @@ -1172,10 +1186,12 @@ private lemma gaussian_l1_sq_le {f : ℂ → ℝ} have h1 : Integrable (fun _ : ℂ => (1 : ℝ)) gaussianMeasure := MeasureTheory.integrable_const 1 have h1sq : Integrable (fun _ : ℂ => (1 : ℝ) ^ 2) gaussianMeasure := by simpa only [one_pow] using h1 - have hfg : Integrable (fun z => f z * 1) gaussianMeasure := by simpa using hf + have hfg : Integrable (fun z => f z * 1) gaussianMeasure := by simpa only [mul_one] using hf have hcs := integral_cauchy_schwarz hf h1 hf2 h1sq hfg - have hmass : gaussianMeasure.real Set.univ = 1 := by simpa using integral_one_gaussianMeasure - simpa [hmass] using hcs + have hmass : gaussianMeasure.real Set.univ = 1 := by simpa only [integral_const, + smul_eq_mul, mul_one] using + integral_one_gaussianMeasure + simpa only [ge_iff_le, mul_one, one_pow, integral_const, hmass, smul_eq_mul] using hcs private lemma rho_factor (w : ℂ) : |‖(1 : ℂ) + w‖ ^ 2 - 1| = rho w * (‖(1 : ℂ) + w‖ + 1) := by @@ -1225,33 +1241,35 @@ private lemma rho_centered_integral_bound ((hRm.const_add |u|).pow 2) ?_ filter_upwards with z rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] - have hmul : 2 * |u| * R z ≤ |u| ^ 2 + R z ^ 2 := by nlinarith [sq_nonneg (|u| - R z)] - have hsq : (|u| + R z) ^ 2 ≤ 2 * |u| ^ 2 + 2 * R z ^ 2 := by nlinarith [hmul] + have hmul : 2 * |u| * R z ≤ |u| ^ 2 + R z ^ 2 := by linarith only [sq_nonneg (|u| - R z)] + have hsq : (|u| + R z) ^ 2 ≤ 2 * |u| ^ 2 + 2 * R z ^ 2 := by linarith only [hmul] exact hsq have hmono : rq2 ≤ ∫ z, (|u| + R z) ^ 2 ∂gaussianMeasure := by rw [← hrq_mu] refine MeasureTheory.integral_mono_ae hG2_int hsum_sq_int ?_ refine Filter.Eventually.of_forall ?_ intro z - have hsum_nn : 0 ≤ |u| + R z := by nlinarith [abs_nonneg u, hR_nonneg z] - nlinarith [hpt z, hG_nonneg z, hsum_nn] + have hsum_nn : 0 ≤ |u| + R z := by linarith only [abs_nonneg u, hR_nonneg z] + nlinarith only [hpt z, hG_nonneg z] have hsum_eval : ∫ z, (|u| + R z) ^ 2 ∂gaussianMeasure = |u| ^ 2 + 2 * |u| * ∫ z, R z ∂gaussianMeasure + m ^ 2 := by - have hmass : gaussianMeasure.real Set.univ = 1 := by simpa using integral_one_gaussianMeasure + have hmass : gaussianMeasure.real Set.univ = 1 := by simpa only [integral_const, + smul_eq_mul, mul_one] using + integral_one_gaussianMeasure have habs_sq : |u| ^ 2 = u ^ 2 := by rw [sq_abs] have hsplit1 : ∫ z, (u ^ 2 + 2 * |u| * R z + R z ^ 2) ∂gaussianMeasure = ∫ z, (u ^ 2 + 2 * |u| * R z) ∂gaussianMeasure + ∫ z, R z ^ 2 ∂gaussianMeasure := by - simpa [add_assoc] using + simpa only [add_assoc, Pi.add_apply] using (integral_add ((MeasureTheory.integrable_const (u ^ 2)).add (hR_int.const_mul (2 * |u|))) hR2_int) have hsplit2 : ∫ z, (u ^ 2 + 2 * |u| * R z) ∂gaussianMeasure = ∫ z, (u ^ 2 : ℝ) ∂gaussianMeasure + ∫ z, 2 * |u| * R z ∂gaussianMeasure := by - simpa using + simpa only [integral_const, smul_eq_mul] using (integral_add (MeasureTheory.integrable_const (u ^ 2)) (hR_int.const_mul (2 * |u|))) calc @@ -1269,7 +1287,7 @@ private lemma rho_centered_integral_bound simp [hmass, habs_sq] have hsum_bound : ∫ z, (|u| + R z) ^ 2 ∂gaussianMeasure ≤ (|u| + m) ^ 2 := by rw [hsum_eval] - nlinarith [hR_l1_le, abs_nonneg u] + nlinarith only [hR_l1_le, abs_nonneg u] exact le_trans hmono hsum_bound /-- The scalar lower bound `|2u + x2| ≤ ∫ rho(u + polyEval a) · (‖1+u+polyEval a‖+1)` @@ -1283,15 +1301,17 @@ private lemma scalar_raw_bound {D : ℕ} (a : Fin D → ℂ) {u x2 q2 : ℝ} have : IsFiniteMeasure gaussianMeasure := gaussianMeasure_isFinite set G : ℂ → ℂ := fun z => (u : ℂ) + polyEval a z with hG have hOne2_int : Integrable (fun z => ‖(1 : ℂ) + G z‖ ^ 2) gaussianMeasure := by - simpa [G, add_assoc, add_left_comm, add_comm] using + simpa only [add_comm, add_assoc, ofReal_add, ofReal_one, add_left_comm, G] using integrable_sq_gaussianMeasure_real_const_add_polyEval a (u + 1) have hplus_sq : ∫ z, ‖(1 : ℂ) + G z‖ ^ 2 ∂gaussianMeasure = (u + 1) ^ 2 + q2 := by calc ∫ z, ‖(1 : ℂ) + G z‖ ^ 2 ∂gaussianMeasure = (1 / Real.pi) * ∫ z : ℂ, ‖(1 : ℂ) + G z‖ ^ 2 * Real.exp (-‖z‖ ^ 2) := by - simpa using integral_gaussianMeasure_eq (fun z : ℂ => ‖(1 : ℂ) + G z‖ ^ 2) + simpa only [one_div] using + integral_gaussianMeasure_eq (fun z : ℂ => ‖(1 : ℂ) + G z‖ ^ 2) _ = (u + 1) ^ 2 + fockNormSq a := by - simpa [G, add_assoc, add_left_comm, add_comm] using + simpa only [one_div, add_comm, add_assoc, ofReal_add, ofReal_one, add_left_comm, + G] using gaussian_integral_real_const_add_polyEval a (u + 1) _ = (u + 1) ^ 2 + q2 := by rw [← hq2_fock] have h_int_eq : ∫ z, (‖(1 : ℂ) + G z‖ ^ 2 - 1) ∂gaussianMeasure = 2 * u + x2 := by @@ -1309,7 +1329,7 @@ private lemma scalar_raw_bound {D : ℕ} (a : Fin D → ℂ) {u x2 q2 : ℝ} _ ≤ ∫ z, |‖(1 : ℂ) + G z‖ ^ 2 - 1| ∂gaussianMeasure := by have h := norm_integral_le_integral_norm (μ := gaussianMeasure) (f := fun z : ℂ => ‖(1 : ℂ) + G z‖ ^ 2 - 1) - simp_all + simp_all only [norm_eq_abs] _ = ∫ z, rho (G z) * (‖(1 : ℂ) + G z‖ + 1) ∂gaussianMeasure := by apply integral_congr_ae filter_upwards with z @@ -1328,29 +1348,31 @@ private lemma s2_le_aux {N B : ℂ → ℝ} {x2 : ℝ} have : IsFiniteMeasure gaussianMeasure := gaussianMeasure_isFinite have hrhs_int : Integrable (fun z => 4 + 4 * N z + N z ^ 2) gaussianMeasure := by have h := (MeasureTheory.integrable_const (4 : ℝ)).add ((hN_int.const_mul 4).add hN2_int) - simp_all + simp_all only [ne_eq, enorm_ne_top, not_false_eq_true, integrable_const_enorm, + integrable_add_iff_integrable_right, integrable_add_iff_integrable_left, + integrable_add_iff_integrable_left'] have hmono : ∫ z, B z ^ 2 ∂gaussianMeasure ≤ ∫ z, (4 + 4 * N z + N z ^ 2) ∂gaussianMeasure := by refine MeasureTheory.integral_mono_ae hB2_int hrhs_int (Filter.Eventually.of_forall fun z => ?_) - have htri_sq : B z ^ 2 ≤ (2 + N z) ^ 2 := by nlinarith [hB_le z, hB_nonneg z] - nlinarith [htri_sq] + have htri_sq : B z ^ 2 ≤ (2 + N z) ^ 2 := by nlinarith only [hB_le z, hB_nonneg z] + linarith only [htri_sq] have hsplit1 : ∫ z, (4 + 4 * N z + N z ^ 2) ∂gaussianMeasure = ∫ z, (4 + 4 * N z) ∂gaussianMeasure + ∫ z, N z ^ 2 ∂gaussianMeasure := by - simpa [add_assoc] using + simpa only [add_assoc, Pi.add_apply] using (integral_add ((MeasureTheory.integrable_const (4 : ℝ)).add (hN_int.const_mul 4)) hN2_int) have hsplit2 : ∫ z, (4 + 4 * N z) ∂gaussianMeasure = ∫ z, (4 : ℝ) ∂gaussianMeasure + ∫ z, 4 * N z ∂gaussianMeasure := by - simpa using + simpa only [integral_const, smul_eq_mul] using (integral_add (MeasureTheory.integrable_const (4 : ℝ)) (hN_int.const_mul 4)) calc ∫ z, B z ^ 2 ∂gaussianMeasure ≤ ∫ z, (4 + 4 * N z + N z ^ 2) ∂gaussianMeasure := hmono _ = 4 + 4 * ∫ z, N z ∂gaussianMeasure + x2 := by rw [hsplit1, hsplit2, integral_const, integral_const_mul, hx_mu] have hmass : gaussianMeasure.real Set.univ = 1 := by - simpa using integral_one_gaussianMeasure + simpa only [integral_const, smul_eq_mul, mul_one] using integral_one_gaussianMeasure simp [hmass] /-- The closing real-arithmetic step of the local-stability estimate: from the @@ -1373,7 +1395,7 @@ private lemma local_fock_closing_arith have hx_sq_small : x ^ 2 ≤ (1 / 4601 : ℝ) ^ 2 := by rw [hx_sq]; exact hx2_small exact le_of_sq_le_sq hx_sq_small (by norm_num) have hscalar_main : |2 * u + x2| ≤ (2 + x) * m := by - have h_rhs_nonneg : 0 ≤ (2 + x) * m := by nlinarith [hx_nonneg, hm_nonneg] + have h_rhs_nonneg : 0 ≤ (2 + x) * m := by positivity have hsq' : |2 * u + x2| ^ 2 ≤ ((2 + x) * m) ^ 2 := by have hms2 : m2 * s2 ≤ ((2 + x) * m) ^ 2 := by calc @@ -1392,11 +1414,12 @@ private lemma local_fock_closing_arith 2 * |u| = |2 * u| := by rw [abs_mul]; norm_num _ ≤ |2 * u + x2| + x2 := htwo _ ≤ (2 + x) * m + x2 := by gcongr - nlinarith [htwo'] + linarith only [htwo'] have hu_bound_delta : |u| ≤ ((2 + (1 / 4601 : ℝ)) / 2) * m + x ^ 2 / 2 := by - nlinarith [hu_bound, hx_le_delta, hx_sq, hx_nonneg] + have hmul := mul_le_mul_of_nonneg_right hx_le_delta hm_nonneg + linarith only [hu_bound, hmul, hx_sq] have hy_le : y ≤ 4600 * (|u| + m) := by - have h_rhs_nonneg : 0 ≤ 4600 * (|u| + m) := by nlinarith [hm_nonneg, abs_nonneg u] + have h_rhs_nonneg : 0 ≤ 4600 * (|u| + m) := by positivity have hq2_le : y ^ 2 ≤ (4600 * (|u| + m)) ^ 2 := by rw [hy_sq] calc @@ -1407,25 +1430,25 @@ private lemma local_fock_closing_arith _ = (4600 * (|u| + m)) ^ 2 := by ring exact le_of_sq_le_sq hq2_le h_rhs_nonneg have hx_le_uy : x ≤ |u| + y := by - have h_rhs_nonneg : 0 ≤ |u| + y := by nlinarith [abs_nonneg u, hy_nonneg] + have h_rhs_nonneg : 0 ≤ |u| + y := by positivity have hx2_le : x ^ 2 ≤ (|u| + y) ^ 2 := by rw [hx_sq] calc x2 = u ^ 2 + y ^ 2 := by rw [hx2_eq, ← hy_sq] - _ ≤ |u| ^ 2 + 2 * |u| * y + y ^ 2 := by nlinarith [abs_nonneg u, hy_nonneg, sq_abs u] + _ ≤ |u| ^ 2 + 2 * |u| * y + y ^ 2 := by + nlinarith only [mul_nonneg (abs_nonneg u) hy_nonneg, sq_abs u] _ = (|u| + y) ^ 2 := by ring exact le_of_sq_le_sq hx2_le h_rhs_nonneg have hpre : x ≤ (4600 + 4601 * ((2 + (1 / 4601 : ℝ)) / 2)) * m + (4601 / 2) * x ^ 2 := by - nlinarith [hx_le_uy, hy_le, hu_bound_delta] - have hx_sq_small : x ^ 2 ≤ (1 / 4601 : ℝ) * x := by nlinarith [hx_le_delta, hx_nonneg] + linarith only [hx_le_uy, hy_le, hu_bound_delta] + have hx_sq_small : x ^ 2 ≤ (1 / 4601 : ℝ) * x := by + simpa only [sq] using mul_le_mul_of_nonneg_right hx_le_delta hx_nonneg have habsorb : x ≤ (4600 + 4601 * ((2 + (1 / 4601 : ℝ)) / 2)) * m + (1 / 2 : ℝ) * x := by - nlinarith [hpre, hx_sq_small] + linarith only [hpre, hx_sq_small] have hx_final : x ≤ 23003 * m := by - have hconst : - 2 * (4600 + 4601 * ((2 + (1 / 4601 : ℝ)) / 2)) ≤ (23003 : ℝ) := by norm_num - nlinarith + linarith only [habsorb, hm_nonneg] have hsq : x ^ 2 ≤ (23003 * m) ^ 2 := pow_le_pow_left₀ hx_nonneg hx_final 2 calc x2 = x ^ 2 := hx_sq.symm @@ -1550,15 +1573,12 @@ theorem LocalFockSPR_of_small_norm have hR_l1_sq : (∫ z, R z ∂gaussianMeasure) ^ 2 ≤ m2 := by simpa [hm_mu] using gaussian_l1_sq_le hR_meas hR2_int - have hN_l1_nonneg : 0 ≤ ∫ z, N z ∂gaussianMeasure := integral_nonneg (fun z => norm_nonneg _) - have hR_l1_nonneg : 0 ≤ ∫ z, R z ∂gaussianMeasure := by - exact integral_nonneg (fun z => by unfold R; exact abs_nonneg _) have hx_nonneg : 0 ≤ x := Real.sqrt_nonneg _ have hm_nonneg : 0 ≤ m := Real.sqrt_nonneg _ have hN_l1_le : ∫ z, N z ∂gaussianMeasure ≤ x := by - nlinarith [hN_l1_sq, hx_sq, hN_l1_nonneg, hx_nonneg] + exact le_of_sq_le_sq (hN_l1_sq.trans_eq hx_sq.symm) hx_nonneg have hR_l1_le : ∫ z, R z ∂gaussianMeasure ≤ m := by - nlinarith [hR_l1_sq, hm_sq, hR_l1_nonneg, hm_nonneg] + exact le_of_sq_le_sq (hR_l1_sq.trans_eq hm_sq.symm) hm_nonneg have hB_nonneg : ∀ z, 0 ≤ B z := fun z => by unfold B; positivity have hB_le : ∀ z, B z ≤ 2 + N z := by intro z @@ -1570,7 +1590,8 @@ theorem LocalFockSPR_of_small_norm _ = 2 + ‖p.eval z‖ := by ring have hs2_le_aux : s2 ≤ 4 + 4 * ∫ z, N z ∂gaussianMeasure + x2 := s2_le_aux hB2_int hN_int hN2_int hx_mu hB_le hB_nonneg - have hs2_le : s2 ≤ (2 + x) ^ 2 := by nlinarith [hs2_le_aux, hN_l1_le, hx_sq] + have hs2_le : s2 ≤ (2 + x) ^ 2 := by + linarith only [hs2_le_aux, hN_l1_le, hx_sq] have hscalar_raw : |2 * u + x2| ≤ ∫ z, R z * B z ∂gaussianMeasure := by refine le_trans (scalar_raw_bound a hq2_eq_fock hx2_eq) (le_of_eq ?_) diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/LocalHelpers.lean b/LeanPool/PhaseRetrieval/Constant/Internal/LocalHelpers.lean index 0e5d2a4b8d..ab2b536c05 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/LocalHelpers.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/LocalHelpers.lean @@ -17,8 +17,6 @@ public import Mathlib.LinearAlgebra.Complex.FiniteDimensional public import Mathlib.MeasureTheory.Integral.Bochner.Basic public import Mathlib.MeasureTheory.Measure.Haar.OfBasis import LeanPool.PhaseRetrieval.Constant.Internal.LocalCore -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.Tactic.NormNum.Parity /-! # LocalHelpers -/ diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/RotationalAveraging.lean b/LeanPool/PhaseRetrieval/Constant/Internal/RotationalAveraging.lean index 2ab1ea7e8e..f4e66eb9e4 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/RotationalAveraging.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/RotationalAveraging.lean @@ -16,8 +16,6 @@ Authors: Susanna Bertolini, Jaume de Dios Pont module public import LeanPool.PhaseRetrieval.Constant.Internal.Definitions -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Data.Nat.Factorial.DoubleFactorial /-! # RotationalAveraging -/ diff --git a/LeanPool/PhaseRetrieval/Constant/Internal/SafeSquare.lean b/LeanPool/PhaseRetrieval/Constant/Internal/SafeSquare.lean index d8ed0d7bd9..0ede6cc593 100644 --- a/LeanPool/PhaseRetrieval/Constant/Internal/SafeSquare.lean +++ b/LeanPool/PhaseRetrieval/Constant/Internal/SafeSquare.lean @@ -17,7 +17,7 @@ Authors: Susanna Bertolini, Jaume de Dios Pont module public import Mathlib.Basic.Real.Basic -import Mathlib.Analysis.SpecialFunctions.Pow.Real +import Mathlib.Tactic.Linarith -- shake: keep import Mathlib.Tactic.NormNum.Parity import Mathlib.Tactic.Positivity.Finset diff --git a/LeanPool/PhaseRetrieval/DimdPoly.lean b/LeanPool/PhaseRetrieval/DimdPoly.lean index 0e2d844eca..232e1eaad8 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly.lean @@ -6,11 +6,6 @@ Authors: Susanna Bertolini, Jaume de Dios Pont module public import LeanPool.PhaseRetrieval.DimdPoly.Internal.Auxiliary -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.SpecialFunctions.Bernstein -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Combinatorics.Matroid.Init -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.Tactic.NormNum.Parity /-! # DimdPoly -/ diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Auxiliary.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Auxiliary.lean index 308ab163aa..cd822e3e87 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Auxiliary.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Auxiliary.lean @@ -9,10 +9,6 @@ public import Mathlib.LinearAlgebra.Complex.FiniteDimensional public import Mathlib.MeasureTheory.Integral.Bochner.Basic public import Mathlib.MeasureTheory.Measure.Haar.OfBasis import LeanPool.PhaseRetrieval.DimdPoly.Internal.PhaseStability -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Combinatorics.Matroid.Init -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm import Mathlib.Tactic.NormNum.Parity diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/CoefficientLimitRigidity.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/CoefficientLimitRigidity.lean index ed801140b0..9d470b016f 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/CoefficientLimitRigidity.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/CoefficientLimitRigidity.lean @@ -11,8 +11,6 @@ import LeanPool.PhaseRetrieval.DimdPoly.Internal.FiniteBaseAnnulusEstimate import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermitek.TrueLevelBasis import LeanPool.PhaseRetrieval.DimdPoly.Internal.ProductAnnulusLocalization import LeanPool.PhaseRetrieval.DimdPoly.Internal.TensorBasis -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Combinatorics.Matroid.Init import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm import Mathlib.Tactic.NormNum.Parity import Mathlib.Topology.MetricSpace.Sequences diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Definitions.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Definitions.lean index 2395c4c26b..6f60f37ecf 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Definitions.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Definitions.lean @@ -7,10 +7,6 @@ module public import Mathlib.Analysis.Fourier.AddCircle public import Mathlib.LinearAlgebra.Complex.FiniteDimensional -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Combinatorics.Matroid.Init -import Mathlib.Data.Nat.Factorial.DoubleFactorial /-! # Definitions -/ diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/ExactModulusRecovery.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/ExactModulusRecovery.lean index 337d259575..f51e063718 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/ExactModulusRecovery.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/ExactModulusRecovery.lean @@ -10,9 +10,7 @@ public import LeanPool.PhaseRetrieval.DimdPoly.Internal.ImportedAnalyticInputs public import Mathlib.Analysis.SpecialFunctions.Gamma.Basic import LeanPool.PhaseRetrieval.DimdPoly.Internal.TensorBasis import Mathlib.Analysis.Calculus.Deriv.Star -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic import Mathlib.Analysis.Fourier.LpSpace -import Mathlib.Combinatorics.Matroid.Init import Mathlib.MeasureTheory.Integral.Gamma import Mathlib.Probability.Distributions.Gaussian.Real import Mathlib.RingTheory.Finiteness.Prod @@ -87,7 +85,8 @@ private lemma star_sub_div_sqrtTwo (x ω : ℝ) : (Real.sqrt 2 : ℂ)) = ((x : ℂ) + (2 * Real.pi : ℂ) * Complex.I * (ω : ℂ)) / (Real.sqrt 2 : ℂ) := by - simp_all + simp_all only [star_div₀, star_sub, RCLike.star_def, Complex.conj_ofReal, star_mul', star_ofNat, + Complex.conj_I, mul_neg, neg_mul, sub_neg_eq_add] /-- `realHermiteGenerating`: real Hermite Generating. -/ noncomputable def realHermiteGenerating (t : ℝ) (u : ℂ) : ℂ := @@ -101,7 +100,7 @@ theorem realHermiteGenerating_conj (t : ℝ) (u : ℂ) : rw [star_mul] have hpi : star (((Real.pi ^ (-(1 / 4 : ℝ)) : ℝ) : ℂ)) = (((Real.pi ^ (-(1 / 4 : ℝ)) : ℝ) : ℂ)) := by - simp_all + simp_all only [one_div, RCLike.star_def, Complex.conj_ofReal] rw [hpi, mul_comm] congr 1 change (starRingEnd ℂ) @@ -110,7 +109,8 @@ theorem realHermiteGenerating_conj (t : ℝ) (u : ℂ) : rw [← Complex.exp_conj] congr 1 have htwo : (starRingEnd ℂ) 2 = (2 : ℂ) := Complex.conj_ofReal 2 - simp_all + simp_all only [one_div, RCLike.star_def, Complex.conj_ofReal, map_sub, map_add, map_neg, map_div₀, + map_pow, map_mul] theorem realHermiteGenerating_hasDerivAt (t : ℝ) (u : ℂ) : HasDerivAt (realHermiteGenerating t) @@ -669,6 +669,8 @@ theorem hasDerivAt_integral_shifted_generating_mul_modulated_right_closed let E : ℂ := Complex.ofReal (Real.exp (-((x ^ 2 + (2 * Real.pi) ^ 2 * ω ^ 2) / 4))) + change HasDerivAt _ + (((u - star z) * Complex.exp (u * w0 + z * u - star z * w0)) * E) w0 have hfun : (fun w : ℂ => ∫ t : ℝ, realHermiteGenerating (t + x / 2) u * @@ -676,21 +678,17 @@ theorem hasDerivAt_integral_shifted_generating_mul_modulated_right_closed Complex.exp (-(2 * Real.pi : ℂ) * Complex.I * (ω * t : ℂ))) = fun w : ℂ => Complex.exp (u * w + z * u - star z * w) * E := by funext w - simpa [z, E] using - realHermiteGenerating_ambiguity_integral_independent_kernel x ω u w + exact realHermiteGenerating_ambiguity_integral_independent_kernel x ω u w rw [hfun] have hu : HasDerivAt (fun w : ℂ => u * w) u w0 := by - simpa using HasDerivAt.const_mul u (hasDerivAt_id w0) + simpa only [id_eq, mul_one] using HasDerivAt.const_mul u (hasDerivAt_id w0) have hz : HasDerivAt (fun w : ℂ => star z * w) (star z) w0 := by - simpa using HasDerivAt.const_mul (star z) (hasDerivAt_id w0) + simpa only [id_eq, mul_one] using HasDerivAt.const_mul (star z) (hasDerivAt_id w0) have hlin : HasDerivAt (fun w : ℂ => u * w + z * u - star z * w) (u - star z) w0 := by - have h := (hu.add_const (z * u)).sub hz - have heq : (fun w : ℂ => u * w + z * u - star z * w) = - (fun x => u * x + z * u) - fun w => star z * w := by - funext w; simp [Pi.sub_apply] - rw [heq]; exact h - simpa [z, E, mul_assoc, mul_left_comm, mul_comm] using hlin.cexp.mul_const E + exact (hu.add_const (z * u)).sub hz + exact (hlin.cexp.mul_const E).congr_deriv + (congrArg (fun value : ℂ => value * E) (mul_comm _ _)) theorem hasDerivAt_integral_shifted_generating_mul_modulated_left_closed (u0 w : ℂ) (x ω : ℝ) : @@ -717,6 +715,8 @@ theorem hasDerivAt_integral_shifted_generating_mul_modulated_left_closed let E : ℂ := Complex.ofReal (Real.exp (-((x ^ 2 + (2 * Real.pi) ^ 2 * ω ^ 2) / 4))) + change HasDerivAt _ + (((w + z) * Complex.exp (u0 * w + z * u0 - star z * w)) * E) u0 have hfun : (fun u : ℂ => ∫ t : ℝ, realHermiteGenerating (t + x / 2) u * @@ -724,18 +724,17 @@ theorem hasDerivAt_integral_shifted_generating_mul_modulated_left_closed Complex.exp (-(2 * Real.pi : ℂ) * Complex.I * (ω * t : ℂ))) = fun u : ℂ => Complex.exp (u * w + z * u - star z * w) * E := by funext u - simpa [z, E] using - realHermiteGenerating_ambiguity_integral_independent_kernel x ω u w + exact realHermiteGenerating_ambiguity_integral_independent_kernel x ω u w rw [hfun] have hw : HasDerivAt (fun u : ℂ => u * w) w u0 := by - simpa using HasDerivAt.mul_const (hasDerivAt_id u0) w + simpa only [id_eq, one_mul] using HasDerivAt.mul_const (hasDerivAt_id u0) w have hz : HasDerivAt (fun u : ℂ => z * u) z u0 := by - simpa using HasDerivAt.const_mul z (hasDerivAt_id u0) + simpa only [id_eq, mul_one] using HasDerivAt.const_mul z (hasDerivAt_id u0) have hlin : HasDerivAt (fun u : ℂ => u * w + z * u - star z * w) (w + z) u0 := by - simpa [sub_eq_add_neg, add_assoc, add_left_comm, add_comm] using - (hw.add hz).sub_const (star z * w) - simpa [z, E, mul_assoc, mul_left_comm, mul_comm] using hlin.cexp.mul_const E + exact (hw.add hz).sub_const (star z * w) + exact (hlin.cexp.mul_const E).congr_deriv + (congrArg (fun value : ℂ => value * E) (mul_comm _ _)) theorem iteratedDeriv_cexp_mul_right_at_zero (n : ℕ) (w : ℂ) : iteratedDeriv n (fun u : ℂ => Complex.exp (u * w)) 0 = w ^ n := by @@ -881,7 +880,8 @@ private theorem cexp_ambiguity_kernel_sum_eq_complexHermite (-1 : ℂ) ^ k * complexHermite n k z := by rw [complexHermite, Finset.mul_sum] have hsubset : Finset.range (min n k + 1) ⊆ Finset.range (k + 1) := by - simp_all + simp_all only [Finset.range_subset_range, add_le_add_iff_right, min_le_iff, Std.le_refl, + or_true] rw [← Finset.sum_subset hsubset] · apply Finset.sum_congr rfl intro i hi @@ -895,7 +895,10 @@ private theorem cexp_ambiguity_kernel_sum_eq_complexHermite rw [← neg_one_pow_mul_of_le k i hi_le_k] norm_num [Nat.cast_mul] ring - · simp_all + · simp_all only [Finset.range_subset_range, add_le_add_iff_right, min_le_iff, Std.le_refl, + or_true, Finset.mem_range, Order.lt_add_one_iff, le_inf_iff, and_true, not_le, + RCLike.star_def, mul_eq_zero, Nat.cast_eq_zero, Nat.descFactorial_eq_zero_iff_lt, + pow_eq_zero_iff', ne_eq, true_or, neg_eq_zero, map_eq_zero, implies_true] private theorem iteratedDeriv_cexp_ambiguity_kernel_diag_at_zero (k : ℕ) (z : ℂ) : @@ -923,7 +926,7 @@ private theorem inv_factorial_mul_complexHermite_self_eq_phi1D have hsqrt : Real.sqrt ((Nat.factorial k : ℝ) * (Nat.factorial k : ℝ)) = (Nat.factorial k : ℝ) := by - simp_all + simp_all only [Nat.cast_nonneg, Real.sqrt_mul_self] rw [phi1D, hsqrt] norm_num @@ -944,7 +947,11 @@ theorem realHermiteGenerating_deriv_zero (t : ℝ) : funext u ring] rw [deriv_fun_add] - · simp_all + · simp_all only [deriv_const_mul_id', differentiableAt_const, deriv_const_add', + differentiableAt_fun_id, DifferentiableAt.fun_pow, deriv_fun_mul, deriv_fun_pow, + Nat.cast_ofNat, Nat.add_one_sub_one, pow_one, mul_zero, deriv_id'', mul_one, zero_mul, + ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, zero_pow, deriv_div_const, deriv_const', + zero_div, add_zero] · fun_prop · fun_prop] ring_nf @@ -972,7 +979,7 @@ theorem integral_real_sq_exp_neg_sq : (∫ x : ℝ, x ^ (2 : ℕ) * Real.exp (-(x ^ (2 : ℕ)))) = Real.sqrt Real.pi / 2 := by have h_abs : (fun x : ℝ => x ^ (2 : ℕ) * Real.exp (-(x ^ (2 : ℕ)))) = fun x : ℝ => (fun y : ℝ => y ^ (2 : ℕ) * Real.exp (-(y ^ (2 : ℕ)))) |x| := by - simp_all + simp_all only [sq_abs] rw [h_abs] rw [show (∫ x : ℝ, (fun y : ℝ => y ^ (2 : ℕ) * Real.exp (-(y ^ (2 : ℕ)))) |x|) = 2 * ∫ x in Set.Ioi (0 : ℝ), @@ -983,11 +990,13 @@ theorem integral_real_sq_exp_neg_sq : rw [show (∫ x in Set.Ioi (0 : ℝ), (fun y : ℝ => y ^ (2 : ℕ) * Real.exp (-(y ^ (2 : ℕ)))) x) = ∫ x in Set.Ioi (0 : ℝ), x ^ (2 : ℝ) * Real.exp (-1 * x ^ (2 : ℝ)) by - simp_all] + simp_all only [sq_abs, Real.rpow_ofNat, neg_mul, one_mul]] rw [integral_rpow_mul_exp_neg_mul_rpow] · rw [show ((2 : ℝ) + 1) / 2 = ((1 : ℕ) : ℝ) + 1 / 2 by norm_num] rw [Real.Gamma_nat_add_half] - simp_all + simp_all only [sq_abs, neg_add_rev, Real.one_rpow, one_div, one_mul, mul_one, + Nat.add_one_sub_one, Nat.doubleFactorial.eq_2, Nat.cast_one, pow_one, ne_eq, + OfNat.ofNat_ne_zero, not_false_eq_true, mul_inv_cancel_left₀] · norm_num · norm_num · norm_num @@ -999,7 +1008,7 @@ theorem integral_real_mul_exp_neg_sq : (μ := (volume : MeasureTheory.Measure ℝ)) rw [show (fun x : ℝ => (-x) * Real.exp (-((-x) ^ (2 : ℕ)))) = fun x : ℝ => -(x * Real.exp (-(x ^ (2 : ℕ)))) by - simp_all] + simp_all only [even_two, Even.neg_pow, neg_mul]] at h rw [MeasureTheory.integral_neg] at h linarith @@ -1042,7 +1051,7 @@ theorem realHermite1D_inner_one_one : rw [show (∫ t : ℝ, (t : ℂ) ^ (2 : ℕ) * ((Real.exp (-(t ^ (2 : ℕ))) : ℝ) : ℂ)) = ∫ t : ℝ, ((t ^ (2 : ℕ) * Real.exp (-(t ^ (2 : ℕ))) : ℝ) : ℂ) by - simp_all] + simp_all only [Complex.ofReal_exp, Complex.ofReal_neg, Complex.ofReal_pow, Complex.ofReal_mul]] rw [integral_complex_ofReal, integral_real_sq_exp_neg_sq] rw [show (((2 : ℝ) : ℂ) * ((Real.pi ^ (-(1 / 2 : ℝ)) : ℝ) : ℂ)) * ((Real.sqrt Real.pi / 2 : ℝ) : ℂ) = 1 by @@ -1137,7 +1146,7 @@ theorem realHermite1D_zero_memLp : · have hbase : Integrable (fun t : ℝ => Real.exp (-1 * t ^ (2 : ℝ))) := by simpa using integrable_exp_neg_mul_sq (b := (1 : ℝ)) zero_lt_one have hbase_nat : Integrable (fun t : ℝ => Real.exp (-(t ^ (2 : ℕ)))) := by - simp_all + simp_all only [one_div, Real.rpow_ofNat, neg_mul, one_mul] refine (hbase_nat.const_mul (‖((Real.pi ^ (-(1 / 4 : ℝ)) : ℝ) : ℂ)‖ ^ (2 : ℕ))).congr ?_ filter_upwards with t @@ -1155,7 +1164,8 @@ theorem realHermite1D_one_memLp : funext t rw [realHermite1D_one] unfold realHermiteGenerating - simp_all + simp_all only [one_div, mul_zero, add_zero, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, + zero_pow, zero_div, sub_zero] rw [hfun] refine (MeasureTheory.memLp_two_iff_integrable_sq_norm ?_).2 ?_ · exact Continuous.aestronglyMeasurable (by fun_prop) @@ -1165,7 +1175,7 @@ theorem realHermite1D_one_memLp : Integrable (fun t : ℝ => t ^ (2 : ℝ) * Real.exp (-1 * t ^ (2 : ℝ))) := by simpa using integrable_rpow_mul_exp_neg_mul_sq (b := (1 : ℝ)) zero_lt_one (by norm_num : (-1 : ℝ) < 2) - simp_all + simp_all only [one_div, Real.rpow_ofNat, neg_mul, one_mul] refine (hbase.const_mul (‖(Real.sqrt 2 : ℂ) * ((Real.pi ^ (-(1 / 4 : ℝ)) : ℝ) : ℂ)‖ ^ (2 : ℕ))).congr ?_ @@ -1174,7 +1184,7 @@ theorem realHermite1D_one_memLp : rw [neg_ofReal_sq_div_two_re t] rw [real_exp_neg_sq_eq_sq t] rw [show t ^ (2 : ℕ) = ‖(t : ℂ)‖ ^ (2 : ℕ) by - simp_all] + simp_all only [one_div, Complex.norm_real, Real.norm_eq_abs, sq_abs]] ring private lemma integrable_pow_mul_exp_neg_sq @@ -1182,7 +1192,7 @@ private lemma integrable_pow_mul_exp_neg_sq Integrable (fun r : ℝ => r ^ n * Real.exp (-r ^ 2)) volume := by have hs : (-1 : ℝ) < (n : ℝ) := by exact_mod_cast (show -1 < (n : ℤ) by omega) have h := integrable_rpow_mul_exp_neg_mul_sq one_pos hs - simp_all + simp_all only [Real.rpow_natCast, neg_mul, one_mul] theorem complex_monomial_gaussian_memLp (k : ℕ) : @@ -1330,7 +1340,7 @@ theorem complex_monomial_gaussian_product_integral_of_eq_two_mul (((((2 * r - 1 : ℕ)‼ : ℕ) : ℝ) * Real.sqrt Real.pi / (2 ^ r : ℝ)) : ℂ) := by have heven : Even (k + l) := by - simp_all + simp_all only [even_two, Even.mul_right] rw [complex_monomial_gaussian_product_integral_of_even heven] rw [show ((((k + l : ℕ) : ℝ) + 1) / 2) = (r : ℝ) + 1 / 2 by rw [hkl] @@ -1425,7 +1435,7 @@ theorem complex_monomial_gaussian_finite_bilinear_integral_eq_even_moments (a k * b l) * (Real.Gamma ((((k + l : ℕ) : ℝ) + 1) / 2) : ℂ) := by rw [complex_monomial_gaussian_finite_bilinear_integral_eq_ite] - simp_all + simp_all only [↓reduceIte, Nat.cast_add] private theorem iteratedDeriv_cexp_neg_sq_div_two_zero_of_odd {n : ℕ} (hodd : Odd n) : @@ -1482,11 +1492,17 @@ private theorem iteratedDeriv_cexp_neg_sq_div_two_zero_of_two_mul have hb_ne_one : b ≠ 1 := by omega have hder : iteratedDeriv b (fun u : ℂ => -u) 0 = 0 := by rw [show (fun u : ℂ => -u) = fun u : ℂ => (-1 : ℂ) * u by - simp_all] + simp_all only [Finset.mem_range, Order.lt_add_one_iff, ne_eq, not_false_eq_true, + neg_mul, one_mul]] rw [iteratedDeriv_const_mul_field] simp [iteratedDeriv_fun_id_zero, hb_ne_one] - simp_all - · simp_all + simp_all only [Finset.mem_range, Order.lt_add_one_iff, ne_eq, not_false_eq_true, mul_zero, + zero_mul] + · simp_all only [Finset.mem_range, lt_add_iff_pos_left, Order.lt_add_one_iff, zero_le, + not_true_eq_false, Nat.choose_one_right, Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat, + Nat.cast_one, iteratedDeriv_one, deriv_neg'', mul_neg, mul_one, neg_add_rev, + add_tsub_cancel_right, mul_eq_zero, pow_eq_zero_iff', neg_eq_zero, one_ne_zero, ne_eq, + true_and, Nat.cast_eq_zero, IsEmpty.forall_iff] · fun_prop · fun_prop @@ -1539,7 +1555,7 @@ theorem realHermiteGenerating_iteratedDeriv_zero_expansion b ^ k * iteratedDeriv (n - k) q 0 := by rw [hfun, iteratedDeriv_const_mul_field, iteratedDeriv_fun_mul] - · simp_all + · simp_all only [iteratedDeriv_cexp_const_mul, mul_zero, Complex.exp_zero, mul_one] · fun_prop · fun_prop _ = ∑ k ∈ Finset.range (n + 1), @@ -1649,7 +1665,10 @@ private lemma standardGaussianMoment_add_two (r : ℕ) : refine ⟨s + 1, ?_⟩ rw [hs] ring - simp_all + simp_all only [Nat.not_even_bit1, not_false_eq_true, Nat.add_one_sub_one, + Nat.doubleFactorial.eq_3, Nat.cast_mul, Nat.cast_add, Nat.cast_ofNat, Nat.cast_one, + ↓reduceIte, mul_zero, ite_eq_right_iff, mul_eq_zero, Nat.cast_eq_zero, isEmpty_Prop, + Nat.not_even_iff_odd, IsEmpty.forall_iff] private lemma standardGaussianMoment_succ_eq_mul_pred (k : ℕ) : standardGaussianMoment (k + 1) = @@ -1727,7 +1746,7 @@ private lemma gaussianMomentFunctional_add (p q : Polynomial ℤ) : gaussianMomentFunctional p + gaussianMomentFunctional q := by unfold gaussianMomentFunctional rw [Polynomial.sum_add_index] - · simp_all + · simp_all only [Int.cast_zero, zero_mul, implies_true] · intro i a b norm_num ring @@ -1736,7 +1755,7 @@ private lemma gaussianMomentFunctional_monomial (k : ℕ) (a : ℤ) : gaussianMomentFunctional (Polynomial.monomial k a) = (a : ℂ) * standardGaussianMoment k := by unfold gaussianMomentFunctional - simp_all + simp_all only [Int.cast_zero, zero_mul, Polynomial.sum_monomial_index] private lemma gaussianMomentFunctional_neg (p : Polynomial ℤ) : gaussianMomentFunctional (-p) = -gaussianMomentFunctional p := by @@ -1747,7 +1766,7 @@ private lemma gaussianMomentFunctional_neg (p : Polynomial ℤ) : | monomial k a => rw [← Polynomial.monomial_neg, gaussianMomentFunctional_monomial, gaussianMomentFunctional_monomial] - simp_all + simp_all only [Int.cast_neg, neg_mul] private lemma gaussianMomentFunctional_sub (p q : Polynomial ℤ) : gaussianMomentFunctional (p - q) = @@ -1925,7 +1944,8 @@ private theorem hermiteStandardInner_eq_factorial (n m : ℕ) : by_cases h : n = m · subst m simp [Nat.factorial_succ] - · simp_all + · simp_all only [Nat.cast_add, Nat.cast_one, ↓reduceIte, mul_zero, + Nat.add_right_cancel_iff] private lemma hermite_support_subset_range_succ (n : ℕ) : (Polynomial.hermite n).support ⊆ Finset.range (n + 1) := by @@ -2067,7 +2087,9 @@ theorem realHermiteGenerating_iteratedDeriv_inner_eq_zero_of_odd_add · have hnk_even : Even (n + k) := Nat.not_odd_iff_even.mp hnk have hml_even : Even (m + l) := Nat.not_odd_iff_even.mp hml have hkl_odd : Odd (k + l) := by grind [Nat.odd_add] - simp_all + simp_all only [Finset.mem_range, Order.lt_add_one_iff, Nat.not_odd_iff_even, Nat.cast_add, + mul_ite, mul_zero, ite_eq_right_iff, mul_eq_zero, Complex.ofReal_eq_zero, isEmpty_Prop, + Nat.not_even_iff_odd, IsEmpty.forall_iff] theorem realHermiteGenerating_inner_finite_sum_eq_factorial (n m : ℕ) : @@ -2216,7 +2238,8 @@ private lemma star_deriv_of_conj_symm {g : ℂ → ℂ} have hderiv := (hgdiff z).hasDerivAt.conj_conj have hfun : (conj ∘ g ∘ conj) = g := by funext x - simp_all + simp_all only [RCLike.star_def, hasDerivAt_conj_conj_iff, RingHomCompTriple.comp_apply, + RingHom.id_apply, hasDerivAt_deriv_iff, Function.comp_apply] have hderiv' : HasDerivAt g (star (deriv g z)) (star z) := by simpa [hfun] using hderiv exact hderiv'.deriv.symm @@ -2228,7 +2251,7 @@ private lemma star_iteratedDeriv_of_conj_symm {f : ℂ → ℂ} intro n induction n with | zero => - simp_all + simp_all only [RCLike.star_def, iteratedDeriv_zero, implies_true] | succ n ih => intro z simp only [iteratedDeriv_succ] @@ -2305,7 +2328,7 @@ private theorem realHermiteGenerating_stft_integral_eq_phase_mul_halfCentered have hphase : phase * phaseInv = 1 := by dsimp [phase, phaseInv] rw [← Complex.exp_add] - simp_all + simp_all only [one_div, neg_mul, neg_add_cancel, Complex.exp_zero] change (∫ t : ℝ, G t) = phase * (∫ t : ℝ, F t) rw [hF, ← mul_assoc, hphase, one_mul] @@ -2450,8 +2473,8 @@ private theorem realHermiteGenerating_stft_interchange_of_halfCentered_interchan fun u : ℂ => phase * (Complex.exp (u * v + z * u - star z * v) * E) by funext u - simpa [phase, z, E, inner, mul_assoc, mul_left_comm, mul_comm] - using realHermiteGenerating_stft_integral_kernel x ω u v] + simpa only [Real.inner_apply, Complex.ofReal_mul] using + (realHermiteGenerating_stft_integral_kernel x ω u v).trans (mul_assoc _ _ _)] rw [iteratedDeriv_const_mul_field, iteratedDeriv_mul_const_field] rw [hfun, iteratedDeriv_const_mul_field, @@ -2524,7 +2547,9 @@ private theorem realHermite1D_stft_integral_formula_of_interchange ((Real.sqrt ((Nat.factorial n : ℝ) * (Nat.factorial k : ℝ))) : ℂ) = sn * sk := by rw [← Complex.ofReal_mul] - simp_all + simp_all only [neg_mul, RCLike.inner_apply, conj_trivial, Complex.ofReal_mul, RCLike.star_def, + ne_eq, Nat.cast_eq_zero, Nat.cast_pos, Complex.ofReal_eq_zero, Nat.cast_nonneg, + Real.sqrt_eq_zero, not_false_eq_true, Real.sqrt_mul] have hscale_scalar : cn * ck = (sn * sk)⁻¹ := by change (sn / fn) * (sk / fk) = (sn * sk)⁻¹ field_simp [hfn_ne, hfk_ne, hsn_ne, hsk_ne] @@ -2584,8 +2609,8 @@ private theorem realHermite1D_stft_integral_formula_of_interchange fun u : ℂ => phase * (Complex.exp (u * v + z * u - star z * v) * E) by funext u - simpa [phase, z, E, inner, mul_assoc, mul_left_comm, mul_comm] - using realHermiteGenerating_stft_integral_kernel x ω u v] + simpa only [Real.inner_apply, Complex.ofReal_mul] using + (realHermiteGenerating_stft_integral_kernel x ω u v).trans (mul_assoc _ _ _)] rw [iteratedDeriv_const_mul_field, iteratedDeriv_mul_const_field] rw [hfun, iteratedDeriv_const_mul_field, @@ -2778,7 +2803,7 @@ theorem realHermiteTensorL2_inner_eq_integral_of_memLp realHermiteTensorL2_eq_toLp_of_memLp beta hβ, MeasureTheory.L2.inner_def] apply MeasureTheory.integral_congr_ae filter_upwards [hα.coeFn_toLp, hβ.coeFn_toLp] with x hαx hβx - simp_all + simp_all only [RCLike.inner_apply, RCLike.star_def] theorem realHermiteTensorL2_orthonormal_of_memLp_integral {d : Nat} @@ -2846,7 +2871,7 @@ theorem realHermiteTensorRep_memLp_of_realHermite1D_memLp (s := Finset.univ) (f := fun q : Fin d => ‖realHermite1D (alpha q) (y q)‖) (by - simp_all) + simp_all only [Real.rpow_ofNat, Finset.mem_univ, norm_nonneg, imp_self, implies_true]) (2 : ℝ))) have hg_aesm_pi : AEStronglyMeasurable g μpi := by have hcoord_aesm : @@ -2873,7 +2898,7 @@ theorem realHermiteTensorRep_memLp_of_realHermite1D_memLp (f := fun q (y : Fin d -> ℝ) => realHermite1D (alpha q) (y q)) (by - simp_all) + simp_all only [Real.rpow_ofNat, Finset.mem_univ, imp_self, implies_true]) have hg_pi : MemLp g 2 μpi := by rw [← integrable_norm_rpow_iff hg_aesm_pi (by norm_num : (2 : ℝ≥0∞) ≠ 0) (by norm_num : (2 : ℝ≥0∞) ≠ ∞)] @@ -2929,13 +2954,13 @@ theorem realHermiteTensorRep_inner_of_realHermite1D_inner rw [hprod] simp_rw [hinner1] by_cases h : alpha = beta - · simp_all + · simp_all only [RCLike.star_def, ↓reduceIte, Finset.prod_const_one] · rw [ite_eq_right h] have hq : ∃ q, alpha q ≠ beta q := by by_contra hnone apply h funext q - simp_all + simp_all only [RCLike.star_def, ne_eq, not_exists, Decidable.not_not] rcases hq with ⟨q, hq⟩ have hfactor : (if alpha q = beta q then (1 : ℂ) else 0) = 0 := by simp [hq] rw [show (∏ q : Fin d, if alpha q = beta q then (1 : ℂ) else 0) = 0 from by @@ -3027,7 +3052,7 @@ theorem bKappa_coeff_recovery_of_realHermite_orthonormal have hba : inner ℂ (realHermiteTensorL2 beta) (realHermiteTensorL2 alpha) = 0 := by simpa [Ne.symm halpha] using orthonormal_iff_ite.mp horth beta alpha - simp_all + simp_all only [ne_eq, map_smul, coe_innerSL_apply, smul_eq_mul, mul_zero] private theorem skappa_ext_coeff_from_realHermite {d : Nat} {kappa : MultiIndex d} {U V : Skappa d kappa} @@ -3048,7 +3073,7 @@ theorem bKappa_injective_of_realHermite_coeff_recovery Function.Injective (bKappa kappa) := by intro U V hUV apply skappa_ext_coeff_from_realHermite - simp_all + simp_all only [implies_true] theorem bKappa_injective_of_realHermite_orthonormal {d : Nat} (kappa : MultiIndex d) @@ -3240,7 +3265,10 @@ private lemma complexHermite_self_zero (k : Nat) : omega have hpos : 0 < k - j := Nat.sub_pos_of_lt hjlt simp [hpos.ne'] - · simp_all + · simp_all only [Finset.mem_range, lt_add_iff_pos_right, Order.lt_one_iff, not_true_eq_false, + Nat.choose_self, Nat.cast_one, mul_one, tsub_self, pow_zero, star_zero, mul_eq_zero, + pow_eq_zero_iff', neg_eq_zero, one_ne_zero, ne_eq, true_and, Nat.cast_eq_zero, + IsEmpty.forall_iff] private lemma phi1D_self_zero_ne (k : Nat) : phi1D k k 0 ≠ 0 := by rw [phi1D, complexHermite_self_zero] @@ -3281,8 +3309,10 @@ private theorem stftModelPhase_norm {d : Nat} (kappa : MultiIndex d) ‖Complex.exp (-(Real.pi : ℂ) * Complex.I * ((inner ℝ ξ.1 ξ.2 : ℝ) : ℂ))‖ = 1 := by rw [Complex.norm_exp] - simp_all - simp_all + simp_all only [norm_pow, norm_neg, norm_one, one_pow, neg_mul, Complex.neg_re, Complex.mul_re, + Complex.ofReal_re, Complex.I_re, mul_zero, Complex.ofReal_im, Complex.I_im, mul_one, sub_self, + zero_mul, Complex.mul_im, add_zero, neg_zero, Real.exp_zero] + simp_all only [norm_pow, norm_neg, norm_one, one_pow, neg_mul, mul_one] private theorem stftRep_varphiKappa_realHermiteTensorL2_eq_tensorRep_integral {d : Nat} (kappa alpha : MultiIndex d) (ξ : PhaseSpace d) : @@ -3363,7 +3393,8 @@ private theorem tensorRep_stft_integral_eq_prod_oneD ((inner ℝ (ξ.2 q) (WithLp.ofLp t q) : ℝ) : ℂ) by simp only [PiLp.inner_apply, Complex.ofReal_sum, Finset.mul_sum]] rw [Complex.exp_sum] - simp_all + simp_all only [neg_mul, RCLike.inner_apply, conj_trivial, Complex.ofReal_mul, + PiLp.sub_apply, RCLike.star_def] _ = ∫ y : Fin d → ℝ, ∏ q : Fin d, f q (y q) := by simpa [MeasurableEquiv.coe_toLp_symm] using (EuclideanSpace.volume_preserving_symm_measurableEquiv_toLp (Fin d)).integral_comp' @@ -3423,10 +3454,11 @@ private theorem prod_oneDRealHermiteSTFT_closed_eq_model calc (∏ q : Fin d, Complex.ofReal (Real.exp (-(coordQ q)))) = ∏ q : Fin d, Complex.exp (((-(coordQ q) : ℝ) : ℂ)) := by - simp_all + simp_all only [neg_mul, Complex.ofReal_exp, Complex.ofReal_neg] _ = Complex.exp (∑ q : Fin d, (((-(coordQ q) : ℝ) : ℂ))) := by rw [Complex.exp_sum] _ = Complex.ofReal (Real.exp (-(QKappa ξ))) := by - simp_all + simp_all only [neg_mul, Complex.ofReal_neg, Finset.sum_neg_distrib, Complex.ofReal_exp, + Complex.ofReal_sum] calc (∏ q : Fin d, (-1 : ℂ) ^ kappa q * @@ -3469,7 +3501,8 @@ private theorem oneDWindowAmbiguityFactor_eq_scaled_iteratedDeriv_integral ((Real.sqrt (Nat.factorial k : ℝ) : ℂ) ^ (2 : ℕ)) = (Nat.factorial k : ℂ) := by rw [← Complex.ofReal_pow] - simp_all + simp_all only [RCLike.star_def, ne_eq, Nat.cast_eq_zero, Nat.cast_nonneg, Real.sq_sqrt, + Complex.ofReal_natCast] have hc_sq : c * c = (Nat.factorial k : ℂ)⁻¹ := by dsimp [c] field_simp [hfac_ne] @@ -4183,7 +4216,8 @@ private theorem scaled_moment_sum_eq_shifted_mgf_unscaled_sum ((Real.pi ^ (-(1 / 4 : ℝ)) : ℝ) : ℂ)) = ((Real.pi ^ (-(1 / 2 : ℝ)) : ℝ) : ℂ) := by simpa [one_div] using realHermiteGenerating_pi_quarter_mul_self - simp_all + simp_all only [one_div, ne_eq, Complex.ofReal_eq_zero, Finset.mem_range, Order.lt_add_one_iff, + not_false_eq_true, inv_mul_cancel₀] calc ((Real.pi ^ (-(1 / 2 : ℝ)) : ℝ) : ℂ)⁻¹ * (((Real.pi ^ (-(1 / 4 : ℝ)) : ℝ) : ℂ) * A * @@ -4194,7 +4228,8 @@ private theorem scaled_moment_sum_eq_shifted_mgf_unscaled_sum ((Real.pi ^ (-(1 / 4 : ℝ)) : ℝ) : ℂ))) * (Complex.exp (-((x : ℂ) ^ 2 / 4)) * (A * B * S)) := by ring _ = Complex.exp (-((x : ℂ) ^ 2 / 4)) * (A * B * S) := by - simp_all + simp_all only [one_div, ne_eq, Complex.ofReal_eq_zero, Finset.mem_range, + Order.lt_add_one_iff, one_mul] _ = Complex.exp (-((x : ℂ) ^ 2 / 4)) * ((Nat.choose n k : ℂ) * (Real.sqrt 2 : ℂ) ^ k * iteratedDeriv (n - k) (fun u : ℂ => Complex.exp (-(u ^ 2) / 2)) 0 * @@ -4257,7 +4292,8 @@ private theorem shifted_mgf_coefficient_eq_kernel_coefficient fun w : ℂ => iteratedDeriv n (fun u : ℂ => Complex.exp (u * w + z * u - star z * w)) 0 * E := by - simp_all + simp_all only [neg_mul, iteratedDeriv_const_mul_field, RCLike.star_def, + iteratedDeriv_mul_const_field] rw [hinner, iteratedDeriv_mul_const_field, iteratedDeriv_cexp_ambiguity_kernel_at_zero] private theorem oneDWindowAmbiguityMonomialKernel_eq_shifted_monomial @@ -4425,7 +4461,7 @@ private theorem oneDWindowAmbiguityMonomialKernel_normalized_integrable Integrable g ((volume : Measure ℝ).withDensity (ProbabilityTheory.gaussianPDF 0 (1 / 2 : NNReal))) := by - simp_all + simp_all only [one_div] have hpdf_meas : Measurable (ProbabilityTheory.gaussianPDF 0 (1 / 2 : NNReal)) := ProbabilityTheory.measurable_gaussianPDF 0 (1 / 2 : NNReal) @@ -4780,7 +4816,7 @@ private theorem iteratedDeriv_generating_cross_ambiguity_moment_sum_eq_kernel_co rw [← shifted_mgf_coefficient_eq_kernel_coefficient n m x ω, scaled_moment_sum_eq_shifted_mgf_unscaled_sum, ← shifted_mgf_mixed_derivative_expansion_unscaled] - simp_all + simp_all only [neg_mul, iteratedDeriv_const_mul_field] private theorem iteratedDeriv_generating_cross_ambiguity_integral_eq_kernel_coefficient (n m : ℕ) (x ω : ℝ) : @@ -4839,7 +4875,9 @@ private theorem realHermiteTensor_stft_integral_formula_of_oneD (Complex.ofReal (Real.exp (-(((ξ.1 q) ^ 2 + (2 * Real.pi) ^ 2 * (ξ.2 q) ^ 2) / 4))) * phi1D (kappa q) (alpha q) (TKappa ξ q)) by - simp_all] + simp_all only [RCLike.star_def, neg_mul, RCLike.inner_apply, conj_trivial, Complex.ofReal_mul, + Complex.ofReal_exp, Complex.ofReal_neg, Complex.ofReal_div, Complex.ofReal_add, + Complex.ofReal_pow, Complex.ofReal_ofNat]] exact prod_oneDRealHermiteSTFT_closed_eq_model kappa alpha ξ private theorem realHermiteTensor_stft_integral_formula @@ -4920,7 +4958,7 @@ private theorem stft_model_global_phase_of_basis_formula (stftModelPhase kappa ξ * (((WKappa ξ : ℝ) : ℂ) * Phi kappa alpha (TKappa ξ))) := by - simp_all + simp_all only [Prod.forall, map_smul, smul_eq_mul, Subtype.forall, Prod.mk.eta] _ = ∑' alpha : Idx d, (stftModelPhase kappa ξ * ((WKappa ξ : ℝ) : ℂ)) * (coeffSkappa U alpha * Phi kappa alpha (TKappa ξ)) := by @@ -4956,7 +4994,8 @@ private theorem stft_model_modulus_of_global_phase_formula WKappa ξ * ‖toFun kappa U (TKappa ξ)‖ := by rw [hmodel U ξ] have hW_nonneg : 0 ≤ WKappa ξ := le_of_lt (WKappa_pos ξ) - simp_all + simp_all only [Prod.forall, Complex.norm_mul, Complex.norm_real, Real.norm_eq_abs, one_mul, + mul_eq_mul_right_iff, abs_eq_self, norm_eq_zero, true_or] theorem stft_model_modulus {d : Nat} (hd : 0 < d) (kappa : MultiIndex d) @@ -5129,7 +5168,8 @@ private theorem tensorRep_windowAmbiguity_integral_eq_prod_oneD ((inner ℝ (ξ.2 q) (WithLp.ofLp t q) : ℝ) : ℂ) by simp only [PiLp.inner_apply, Complex.ofReal_sum, Finset.mul_sum]] rw [Complex.exp_sum] - simp_all + simp_all only [neg_mul, RCLike.inner_apply, conj_trivial, Complex.ofReal_mul, one_div, + PiLp.add_apply, PiLp.smul_apply, smul_eq_mul, PiLp.sub_apply, RCLike.star_def] _ = ∫ y : Fin d → ℝ, ∏ q : Fin d, f q (y q) := by simpa [MeasurableEquiv.coe_toLp_symm] using (EuclideanSpace.volume_preserving_symm_measurableEquiv_toLp (Fin d)).integral_comp' @@ -5168,10 +5208,11 @@ private theorem prod_oneDWindowAmbiguity_closed_eq_PKappa_exp calc (∏ q : Fin d, Complex.ofReal (Real.exp (-(coordQ q)))) = ∏ q : Fin d, Complex.exp (((-(coordQ q) : ℝ) : ℂ)) := by - simp_all + simp_all only [Complex.ofReal_exp, Complex.ofReal_neg] _ = Complex.exp (∑ q : Fin d, (((-(coordQ q) : ℝ) : ℂ))) := by rw [Complex.exp_sum] _ = Complex.ofReal (Real.exp (-(QKappa ξ))) := by - simp_all + simp_all only [Complex.ofReal_neg, Finset.sum_neg_distrib, Complex.ofReal_exp, + Complex.ofReal_sum] calc (∏ q : Fin d, ((-1 : ℂ) ^ kappa q * phi1D (kappa q) (kappa q) (TKappa ξ q) * @@ -5208,7 +5249,8 @@ private theorem tensorRep_windowAmbiguity_integral_eq_PKappa_exp_of_oneD Complex.ofReal (Real.exp (-(((ξ.1 q) ^ 2 + (2 * Real.pi) ^ 2 * (ξ.2 q) ^ 2) / 4)))) by - simp_all] + simp_all only [Complex.ofReal_exp, Complex.ofReal_neg, Complex.ofReal_div, Complex.ofReal_add, + Complex.ofReal_pow, Complex.ofReal_mul, Complex.ofReal_ofNat]] exact prod_oneDWindowAmbiguity_closed_eq_PKappa_exp kappa ξ theorem windowAmbiguity_factorization @@ -5261,7 +5303,8 @@ private lemma dense_ne_zero_of_phaseSpace_polynomial have hC : (Polynomial.evalRingHom (t : ℂ)).comp Polynomial.C = RingHom.id ℂ := by ext z simp - simp_all + simp_all only [Prod.forall, Prod.mk.eta, ne_eq, gt_iff_lt, Polynomial.coe_evalRingHom, + MvPolynomial.coe_eval₂Hom, MvPolynomial.eval₂_id] _ = MvPolynomial.eval (phaseSpacePolyEval (line t)) p := by have hev : (fun s => Polynomial.eval (t : ℂ) (affineCoord s)) = phaseSpacePolyEval (line t) := by @@ -5279,7 +5322,8 @@ private lemma dense_ne_zero_of_phaseSpace_polynomial have hq_ne : qpoly ≠ 0 := by intro hzero have hq1 := hqeval 1 - simp_all + simp_all only [Prod.forall, Prod.mk.eta, ne_eq, gt_iff_lt, Polynomial.eval_zero, + Complex.ofReal_one, not_true_eq_false] let rootsReal : Set ℝ := {t : ℝ | qpoly.eval (t : ℂ) = 0} have hroots_countable : rootsReal.Countable := by have hroots_complex : ({z : ℂ | qpoly.IsRoot z}).Finite := @@ -5301,7 +5345,8 @@ private lemma dense_ne_zero_of_phaseSpace_polynomial exact hline_cont.continuousAt hball rcases hnonroots_dense.inter_nhds_nonempty hpre_ball with ⟨t, ht_nonroot, ht_ball⟩ refine ⟨line t, ?_⟩ - simp_all + simp_all only [Prod.forall, Prod.mk.eta, ne_eq, gt_iff_lt, Set.mem_ofPred_eq, Set.mem_preimage, + Metric.mem_ball, Set.mem_inter_iff, not_false_eq_true, and_self] theorem windowAmbiguity_dense_nonvanishing {d : Nat} (hd : 0 < d) (kappa : MultiIndex d) : @@ -5340,13 +5385,14 @@ theorem spectrogram_eq_of_equal_modulus_to_ambiguity_eq have hprod : ambiguityRep f f ξ * star (ambiguityRep hwin hwin ξ) = ambiguityRep g g ξ * star (ambiguityRep hwin hwin ξ) := by - simp_all + simp_all only [Prod.forall, Complex.ofReal_pow, RCLike.star_def, mul_eq_mul_right_iff, + map_eq_zero] exact mul_right_cancel₀ (star_ne_zero.mpr hξ) hprod have hs_dense : Dense s := by simpa [s, hwin] using windowAmbiguity_dense_nonvanishing hd kappa have hamb : ambiguityRep f f = ambiguityRep g g := Continuous.ext_on hs_dense (continuous_ambiguityRep f f) (continuous_ambiguityRep g g) h_on - simp_all + simp_all only [Prod.forall, implies_true] private lemma integral_fourier_schwartz_mul_eq {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] @@ -5376,7 +5422,7 @@ private lemma integral_fourier_schwartz_mul_eq funext x rw [ContinuousLinearMap.mul_apply', Real.fourier_eq] simp only [VectorFourier.fourierIntegral] - simp_all + simp_all only [ContinuousLinearMap.mul_apply', flip_innerₗ, innerₗ_apply_apply] rw [hflip] simpa [ContinuousLinearMap.mul_apply', Real.fourier_eq, VectorFourier.fourierIntegral] using hswap.symm @@ -5416,11 +5462,12 @@ private theorem fourier_l1_l2_eq_zero_ae 𝓕 H ∈ (MeasureTheory.Lp.toTemperedDistributionCLM ℂ (volume : Measure V) 2).ker := by - simp_all + simp_all only [LinearMap.mem_ker, ContinuousLinearMap.coe_coe, + Lp.toTemperedDistributionCLM_apply] have hker_bot := MeasureTheory.Lp.ker_toTemperedDistributionCLM_eq_bot (F := ℂ) (μ := (volume : Measure V)) (p := (2 : ℝ≥0∞)) - simp_all + simp_all only [Submodule.mem_bot] have hH_zero : H = 0 := by have h := congrArg (fun G : Lp ℂ 2 (volume : Measure V) => 𝓕⁻ G) @@ -5671,7 +5718,24 @@ private lemma sectionDiff_fourier_eq_ambiguity_sub funext v ring] rw [integral_sub hFphase hGphase] - simp [ambiguityRep, Fsec, Gsec, phase, real_inner_comm, mul_assoc, mul_comm] + have hphase_eq (t : RealVec d) : + phase t = Complex.exp (-(2 * Real.pi : ℂ) * Complex.I * ((inner ℝ ω t : ℝ) : ℂ)) := by + dsimp [phase] + congr 1 + rw [real_inner_comm t ω] + push_cast + ring + have hamb (h : L2Real d) : + (∫ t : RealVec d, phase t * + ((h : RealVec d → ℂ) (t + ((1 / 2 : ℝ) • x)) * + star ((h : RealVec d → ℂ) (t - ((1 / 2 : ℝ) • x))))) = + ambiguityRep h h (x, ω) := by + rw [ambiguityRep] + apply integral_congr_ae + filter_upwards with t + rw [hphase_eq] + exact mul_comm _ _ + exact congrArg₂ (fun a b : ℂ => a - b) (hamb f) (hamb g) theorem equalAmbiguity_to_rankOneKernel_ae {d : Nat} {f g : L2Real d} {fRep gRep : RealVec d -> ℂ} @@ -5750,7 +5814,7 @@ theorem equalAmbiguity_to_rankOneKernel_ae (by simpa [f0, μ] using hf_int) (by simpa [g0, μ] using hg_int) _ = 0 := by - simp_all + simp_all only [Prod.forall, one_div, RCLike.star_def, sub_self] exact fourier_l1_l2_eq_zero_ae hdiff_int hx_l2 hfourier have hcenter_zero_prod : centerDiff =ᵐ[μ.prod μ] fun _ => (0 : ℂ) := by @@ -5817,7 +5881,7 @@ theorem equalAmbiguity_to_rankOneKernel_ae have h0 : f0 p.1 * star (f0 p.2) - g0 p.1 * star (g0 p.2) = 0 := hp have heq : f0 p.1 * star (f0 p.2) = g0 p.1 * star (g0 p.2) := sub_eq_zero.mp h0 - simp_all + simp_all only [Prod.forall, one_div, RCLike.star_def] simpa [μ, MeasureTheory.Measure.volume_eq_prod] using hrep_prod private lemma exists_eventually_and_ne_zero @@ -5829,7 +5893,7 @@ private lemma exists_eventually_and_ne_zero by_contra hnone apply hnot filter_upwards [hP] with x hxP - simp_all + simp_all only [ne_eq, not_exists, not_and, Decidable.not_not] private lemma norm_eq_one_of_mul_star_eq_one {w : ℂ} (h : w * star w = 1) : @@ -6038,7 +6102,8 @@ private theorem pkappa_eq_zero_of_norm_sq_eq_zero_wip (Finset.single_le_sum (f := fun beta : Idx d => ‖F beta‖ ^ 2) (s := F.support) (a := alpha) (fun beta _ => by positivity) hmem) - simp_all + simp_all only [ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, pow_eq_zero_iff, + Finsupp.mem_support_iff, sq_nonpos_iff, norm_eq_zero] · exact Finsupp.notMem_support_iff.mp hmem private theorem pkappa_eq_zero_of_eval_zero_wip @@ -6118,14 +6183,15 @@ private theorem skappa_eq_zero_of_toFun_zero_exact_wip private theorem coeff_eq_zero_of_self_kernel_zero_exact_wip {z : ℂ} (h : z * star z = 0) : z = 0 := by - simp_all + simp_all only [RCLike.star_def, mul_eq_zero, map_eq_zero, or_self] private theorem norm_eq_of_self_kernel_eq_exact_wip {x y : ℂ} (h : x * star x = y * star y) : ‖x‖ = ‖y‖ := by have hmul_norm : ‖x‖ * ‖x‖ = ‖y‖ * ‖y‖ := by simpa [norm_mul, norm_star] using congrArg norm h have hsq : ‖x‖ ^ 2 = ‖y‖ ^ 2 := by simpa [sq] using hmul_norm - simp_all + simp_all only [RCLike.star_def, norm_nonneg, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, + pow_left_inj₀] private theorem scalar_multiple_of_coeff_kernel_exact_wip {d : Nat} {kappa : MultiIndex d} {U V : Skappa d kappa} @@ -6140,7 +6206,7 @@ private theorem scalar_multiple_of_coeff_kernel_exact_wip rw [hU_zero] rfl have hself : coeffSkappa V alpha * star (coeffSkappa V alpha) = 0 := by - simp_all + simp_all only [RCLike.star_def, map_zero, mul_zero] exact coeff_eq_zero_of_self_kernel_zero_exact_wip hself have hV_zero : V = 0 := skappa_eq_zero_of_coeff_zero_exact_wip hV_coeff_zero refine ⟨1, by norm_num, ?_⟩ @@ -6152,7 +6218,7 @@ private theorem scalar_multiple_of_coeff_kernel_exact_wip · have hU_coeff_nonzero : ∃ alpha0, coeffSkappa U alpha0 ≠ 0 := by by_contra hnone have hzero : ∀ alpha, coeffSkappa U alpha = 0 := by - simp_all + simp_all only [RCLike.star_def, ne_eq, not_exists, Decidable.not_not, implies_true] exact hU_zero (skappa_eq_zero_of_coeff_zero_exact_wip hzero) rcases hU_coeff_nonzero with ⟨alpha0, hU0⟩ let u0 : ℂ := coeffSkappa U alpha0 @@ -6179,7 +6245,8 @@ private theorem scalar_multiple_of_coeff_kernel_exact_wip dsimp [u, v, u0, v0] exact hker alpha alpha0 have hstar_v0 : star v0 = star w * star u0 := by - simp_all + simp_all only [RCLike.star_def, ne_eq, Complex.norm_mul, one_mul, norm_eq_zero, + not_false_eq_true, star_mul'] have hcancel : v * star w = u := by apply mul_right_cancel₀ (star_ne_zero.mpr hu0_ne) calc @@ -6217,7 +6284,7 @@ private theorem coeff_kernel_of_scalar_multiple_exact_wip rw [star_mul] ring _ = coeffSkappa U alpha * star (coeffSkappa U beta) := by - simp_all + simp_all only [RCLike.star_def, one_mul] theorem ambiguity_eq_to_skappa_phase {d : Nat} (hd : 0 < d) (kappa : MultiIndex d) @@ -6296,7 +6363,7 @@ theorem exact_modulus_recovery_skappa {U V : Skappa d kappa} (hmod : ∀ z, ‖toFun kappa U z‖ = ‖toFun kappa V z‖) : ∃ w : ℂ, ‖w‖ = 1 ∧ V = w • U := exact_modulus_recovery_skappa_ae hd kappa (by - simp_all) + simp_all only [Filter.EventuallyEq.refl]) theorem exact_modulus_recovery_pkappa {d : Nat} (hd : 0 < d) (kappa : MultiIndex d) diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/FiniteBaseAnnulusEstimate.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/FiniteBaseAnnulusEstimate.lean index cc92fdd1cf..edbc28ba53 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/FiniteBaseAnnulusEstimate.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/FiniteBaseAnnulusEstimate.lean @@ -13,10 +13,6 @@ import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite1Dimd.ProductAnnulusCirc import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite1Dimd.ProductBasisAndAnnuli import LeanPool.PhaseRetrieval.DimdPoly.Internal.ProductAnnulusLocalization import LeanPool.PhaseRetrieval.DimdPoly.Internal.TensorBasis -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Combinatorics.Matroid.Init -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.Tactic.NormNum.Parity /-! # FiniteBaseAnnulusEstimate -/ diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/FiniteBaseCircleEstimate.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/FiniteBaseCircleEstimate.lean index 16abceaf32..3a4e4e5408 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/FiniteBaseCircleEstimate.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/FiniteBaseCircleEstimate.lean @@ -12,10 +12,7 @@ import LeanPool.PhaseRetrieval.Constant.Internal.LipschitzRho import LeanPool.PhaseRetrieval.Constant.Internal.MissingMathlib.Poincare import Mathlib.Algebra.Order.Chebyshev import Mathlib.Analysis.Complex.Polynomial.Basic -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic import Mathlib.Analysis.Real.Pi.Bounds -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.Order.Interval.Set.Union import Mathlib.Tactic.NormNum.Parity @@ -73,7 +70,7 @@ private theorem circleChar_mk_wip (n : Nat) (theta : ℝ) : Circle.coe_exp] rw [← Complex.exp_nat_mul] congr 1 - ring + ac_rfl private theorem norm_bandPoly_sub_fast_mul (N : Nat) {L : Nat} (p : Fin L -> ℂ) (u : ℂ) (x : Circle) : @@ -106,7 +103,7 @@ private theorem norm_circleChar_sub_le (n : Nat) (x y : Circle) : ‖circleChar n x - circleChar n y‖ <= (n : ℝ) * ‖zeta x - zeta y‖ := by - simpa [circleChar_eq_zeta_pow] using + simpa only [circleChar_eq_zeta_pow] using norm_pow_sub_pow_le_nat_mul_norm_sub (z := zeta x) (w := zeta y) (norm_zeta x) (norm_zeta y) n @@ -141,7 +138,7 @@ private theorem norm_charSum_sub_le_chord {K : Nat} rw [Finset.sum_mul] congr ext n - ring + ac_rfl private theorem charSlope_nonneg {K : Nat} (f : Fin K -> ℂ) : 0 <= ∑ n : Fin K, ‖f n‖ * (n.1 : ℝ) := Finset.sum_nonneg fun n hn => @@ -205,7 +202,8 @@ private theorem hasDerivAt_slowBandPoly_mk {L : Nat} (slowBandPolyDeriv p t) t := by unfold slowBandPoly slowBandPolyDeriv unfold slowBandPolyDerivCircle - simpa [circleChar_eq_fourier_nat, mul_assoc] using + simpa only [circleChar_eq_fourier_nat, fourier_apply, natCast_zsmul, mul_assoc, Int.cast_natCast, + Complex.ofReal_mul, Complex.ofReal_ofNat] using (HasDerivAt.fun_sum (u := Finset.univ) (x := t) @@ -268,7 +266,7 @@ private theorem safe_square · have hbc_pos : 0 <= b - c := by linarith have hsq_to_a : (b - c) ^ 2 <= a ^ 2 := by nlinarith have hsq_from_bc : (1 / 2) * b ^ 2 - c ^ 2 <= (b - c) ^ 2 := by - nlinarith [sq_nonneg (b - 2 * c)] + linarith only [sq_nonneg (b - 2 * c)] exact hsq_from_bc.trans hsq_to_a private theorem defect_pointwise_safe_carrier_average @@ -286,7 +284,8 @@ private theorem defect_pointwise_safe_carrier_average |b - a| <= |(‖Q x + circleChar N x * u‖ - ‖Q x‖) - (‖Q x + bandPoly N p x‖ - ‖Q x‖)| := by - simpa [a, b, sub_eq_add_neg, add_assoc, add_left_comm, add_comm] + simpa only [sub_eq_add_neg, add_comm, neg_add_rev, neg_neg, add_left_comm, add_assoc, + add_neg_cancel_left, a, b] using abs_abs_sub_abs_le_abs_sub (‖Q x + circleChar N x * u‖ - ‖Q x‖) (‖Q x + bandPoly N p x‖ - ‖Q x‖) @@ -302,17 +301,17 @@ private theorem defect_pointwise_safe_carrier_average (Q x + bandPoly N p x)‖ := abs_norm_sub_norm_le _ _ _ = ‖circleChar N x * u - bandPoly N p x‖ := by - simp_all + simp_all only [sub_sub_sub_cancel_right, add_sub_add_left_eq_sub] _ = ‖bandPoly N p x - circleChar N x * u‖ := by rw [← norm_neg] - simp_all + simp_all only [sub_sub_sub_cancel_right, neg_sub] _ = c := by simp [c, norm_bandPoly_sub_fast_mul] exact (le_abs_self (b - a)).trans (h_abs.trans h_norm) have hmain : b - c <= a := by linarith have hsafe := safe_square (a := a) (b := b) (c := c) (abs_nonneg _) (abs_nonneg _) (norm_nonneg _) hmain - simpa [a, b, c, sq_abs] using hsafe + simpa only [one_div, tsub_le_iff_right, ge_iff_le, sq_abs, a, b, c] using hsafe private theorem carrierAverage_constCenter_sq_le_defect {N : Nat} (k : Fin N) {L : Nat} (p : Fin L -> ℂ) @@ -354,18 +353,18 @@ private theorem defect_setIntegral_safe_carrier_average MeasureTheory.Integrable (fun x : Circle => (‖Q x + circleChar N x * u‖ - ‖Q x‖) ^ 2) μCircle := by - simpa [μCircle] using + simpa only [μCircle] using havg_cont.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) have hvar_int : MeasureTheory.Integrable (fun x : Circle => ‖slowBandPoly p x - u‖ ^ 2) μCircle := by - simpa [μCircle] using + simpa only [μCircle] using hvar_cont.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) have hactual_int : MeasureTheory.Integrable (fun x : Circle => (‖Q x + bandPoly N p x‖ - ‖Q x‖) ^ 2) μCircle := by - simpa [μCircle] using + simpa only [μCircle] using hactual_cont.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) have hcombo_int : MeasureTheory.Integrable @@ -434,7 +433,7 @@ private theorem carrierAverage_mass_le_defect_plus_variance calc arcLength (carrierArc N k) * ‖carrierAverage (N := N) k (slowBandPoly p)‖ ^ 2 - <= Crot * A := by simpa [I, u] using hrot + <= Crot * A := by simpa only [I, u] using hrot _ <= Crot * (2 * Dint + 2 * V) := mul_le_mul_of_nonneg_left hA (le_of_lt Crot_pos) _ = @@ -461,13 +460,13 @@ private theorem const_center_abs_defect_eq_norm_mul_rho _ = ‖c‖ * FockSPR.rho (c⁻¹ * w) := rfl private theorem abs_norm_sub_one_le_norm_sub_one (lam : ℂ) : - |‖lam‖ - 1| <= ‖lam - 1‖ := by simpa [norm_one] using abs_norm_sub_norm_le lam (1 : ℂ) + |‖lam‖ - 1| <= ‖lam - 1‖ := by simpa only [norm_one] using abs_norm_sub_norm_le lam (1 : ℂ) private theorem abs_rho_sub_rho_le_norm_sub (w z : ℂ) : |FockSPR.rho w - FockSPR.rho z| <= ‖w - z‖ := by have h := FockSPR.rho_lipschitz.dist_le_mul w z rw [NNReal.coe_one, one_mul, Real.dist_eq, dist_eq_norm] at h - simpa [Real.dist_eq] using h + simpa only [ge_iff_le, Real.dist_eq] using h private theorem const_center_multiplicative_stability {c lam u : ℂ} (hc : c ≠ 0) (hlam : lam ≠ 0) @@ -560,7 +559,7 @@ private theorem norm_inv_le_two_of_norm_sub_one_le_half {lam : ℂ} linarith have hpos : 0 < ‖lam‖ := by linarith rw [norm_inv, inv_le_comm₀ hpos (by norm_num : (0 : ℝ) < 2)] - nlinarith + linarith only [hlower] private theorem norm_inv_sub_one_le_two_mul_norm_sub_one_of_close {lam : ℂ} (hclose : ‖lam - 1‖ <= 1 / 2) : @@ -610,7 +609,7 @@ private theorem defect_pointwise_const_center_compare_of_close let b : ℝ := |‖c + u‖ - ‖c‖| let e : ℝ := 4 * ‖lam - 1‖ * ‖u‖ have hstab : |a - b| <= e := by - simpa [a, b, e, abs_sub_comm] using + simpa only [abs_sub_comm, Complex.norm_mul, a, b, e] using const_center_multiplicative_stability_of_close (c := c) (lam := lam) (u := u) hc hclose have hba : b - e <= a := by @@ -624,7 +623,7 @@ private theorem defect_pointwise_const_center_compare_of_close have hsafe := safe_square (a := a) (b := b) (c := e) (abs_nonneg _) (abs_nonneg _) he_nonneg hba - simpa [a, b, e, sq_abs] using hsafe + simpa only [one_div, Complex.norm_mul, tsub_le_iff_right, ge_iff_le, sq_abs, a, b, e] using hsafe private theorem defect_pointwise_const_center_compare_fast_of_close (N : Nat) (x : Circle) {c lam u : ℂ} (hc : c ≠ 0) @@ -634,7 +633,8 @@ private theorem defect_pointwise_const_center_compare_fast_of_close (‖lam * c + circleChar N x * u‖ - ‖lam * c‖) ^ 2 := by have h := defect_pointwise_const_center_compare_of_close (c := c) (lam := lam) (u := circleChar N x * u) hc hclose - simpa [norm_mul, norm_circleChar_wip] using h + simpa only [one_div, Complex.norm_mul, tsub_le_iff_right, ge_iff_le, norm_circleChar_wip, one_mul, + norm_mul] using h private theorem exists_factor_close_of_norm_sub_le {Qx c : ℂ} {theta : ℝ} (hc : c ≠ 0) @@ -679,7 +679,7 @@ private theorem defect_setIntegral_const_center_compare_fast MeasureTheory.Integrable (fun x : Circle => (‖c + circleChar N x * u‖ - ‖c‖) ^ 2) μCircle := by - simpa [μCircle] using + simpa only [μCircle] using hconst_cont.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) have : MeasureTheory.IsFiniteMeasure μCircle := by dsimp [μCircle] @@ -692,7 +692,7 @@ private theorem defect_setIntegral_const_center_compare_fast MeasureTheory.Integrable (fun x : Circle => (‖Q x + circleChar N x * u‖ - ‖Q x‖) ^ 2) μCircle := by - simpa [μCircle] using + simpa only [μCircle] using hactual_cont.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) have hcombo_int : MeasureTheory.Integrable @@ -771,17 +771,17 @@ private theorem defect_setIntegral_const_center_compare have hconst_int : MeasureTheory.Integrable (fun x : Circle => (‖c + P x‖ - ‖c‖) ^ 2) μCircle := by - simpa [μCircle] using + simpa only [μCircle] using hconst_cont.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) have herr_int : MeasureTheory.Integrable (fun x : Circle => (4 * theta * ‖P x‖) ^ 2) μCircle := by - simpa [μCircle] using + simpa only [μCircle] using herr_cont.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) have hactual_int : MeasureTheory.Integrable (fun x : Circle => (‖Q x + P x‖ - ‖Q x‖) ^ 2) μCircle := by - simpa [μCircle] using + simpa only [μCircle] using hactual_cont.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) have hcombo_int : MeasureTheory.Integrable @@ -806,7 +806,7 @@ private theorem defect_setIntegral_const_center_compare (4 * ‖lam - 1‖ * ‖P x‖) ^ 2 <= (4 * theta * ‖P x‖) ^ 2 := by have hleft_nonneg : 0 <= 4 * ‖lam - 1‖ * ‖P x‖ := by positivity - have hright_nonneg : 0 <= 4 * theta * ‖P x‖ := by nlinarith [htheta_nonneg, norm_nonneg (P x)] + have hright_nonneg : 0 <= 4 * theta * ‖P x‖ := by positivity have hmul : 4 * ‖lam - 1‖ * ‖P x‖ <= 4 * theta * ‖P x‖ := by nlinarith [norm_nonneg (lam - 1), norm_nonneg (P x)] nlinarith @@ -869,7 +869,7 @@ theorem circleBadConst_pos (D : Nat) : 1 <= circleBadConst D := by private theorem circleBadConst_ge_succ_of_pos {D : Nat} (hD : 0 < D) : D + 1 <= circleBadConst D := by - have hsucc_le : D + 1 <= 82 * D := by nlinarith + have hsucc_le : D + 1 <= 82 * D := by linarith only [hD] have hbad_inner : 82 * D <= max (82 * D) (2 ^ D - 1) := le_max_left (82 * D) (2 ^ D - 1) have hbad : 82 * D <= circleBadConst D := by @@ -971,7 +971,7 @@ private theorem coeff_polyOfCoeff {D : Nat} intro hval exact hbn (Fin.ext hval.symm) simp [hne] - · simp_all + · simp_all only [Finset.mem_univ, not_true_eq_false, ↓reduceIte, IsEmpty.forall_iff] private theorem polyOfCoeff_ne_zero_of_ne_zero {D : Nat} {q : Fin (D + 1) -> ℂ} (hq : q ≠ 0) : @@ -980,7 +980,7 @@ private theorem polyOfCoeff_ne_zero_of_ne_zero {D : Nat} apply hq funext n have hcoeff := congrArg (fun p : Polynomial ℂ => p.coeff n.1) hpoly - simpa [coeff_polyOfCoeff q n] using hcoeff + simpa only [Pi.zero_apply, coeff_polyOfCoeff q n, Polynomial.coeff_zero] using hcoeff private theorem leadingCoeff_polyOfCoeff_ne_zero_of_ne_zero {D : Nat} {q : Fin (D + 1) -> ℂ} (hq : q ≠ 0) : @@ -992,7 +992,8 @@ private theorem natDegree_polyOfCoeff_pos_of_nonconst {D : Nat} (hnonconst_coeff : ∃ n : Fin (D + 1), n.1 ≠ 0 ∧ q n ≠ 0) : 0 < (polyOfCoeff q).natDegree := by rcases hnonconst_coeff with ⟨n, hn_pos, hnq⟩ - have hcoeff : (polyOfCoeff q).coeff n.1 ≠ 0 := by simpa [coeff_polyOfCoeff q n] using hnq + have hcoeff : (polyOfCoeff q).coeff n.1 ≠ 0 := by simpa only [coeff_polyOfCoeff q n, ne_eq] using + hnq exact lt_of_lt_of_le (Nat.pos_of_ne_zero hn_pos) (Polynomial.le_natDegree_of_ne_zero hcoeff) @@ -1003,7 +1004,7 @@ private theorem exists_mem_roots_polyOfCoeff_of_nonconst {D : Nat} have hdeg : 0 < (polyOfCoeff q).natDegree := natDegree_polyOfCoeff_pos_of_nonconst hnonconst_coeff have hcard : 0 < (polyOfCoeff q).roots.card := by - simpa [roots_card_polyOfCoeff_eq_natDegree q] using hdeg + simpa only [roots_card_polyOfCoeff_eq_natDegree q] using hdeg exact Multiset.card_pos_iff_exists_mem.mp hcard private theorem norm_leadingCoeff_polyOfCoeff_pos_of_ne_zero {D : Nat} @@ -1043,12 +1044,14 @@ private theorem complex_multiset_prod_norm_le_perturbed | cons ζ s ih => have hζ : ‖b ζ - a ζ‖ <= eps * ‖a ζ‖ := h ζ (by simp) have hs : ∀ ξ ∈ s, ‖b ξ - a ξ‖ <= eps * ‖a ξ‖ := by - simp_all + simp_all only [Multiset.mem_cons, or_true, implies_true, Multiset.norm_prod_map, + forall_const, forall_eq_or_imp, true_and] have ih' := ih hs have hbζ : ‖b ζ‖ <= (1 + eps) * ‖a ζ‖ := by calc ‖b ζ‖ = ‖a ζ + (b ζ - a ζ)‖ := by - simp_all + simp_all only [Multiset.mem_cons, or_true, implies_true, Multiset.norm_prod_map, + forall_const, forall_eq_or_imp, and_self, add_sub_cancel] _ <= ‖a ζ‖ + ‖b ζ - a ζ‖ := norm_add_le _ _ _ <= ‖a ζ‖ + eps * ‖a ζ‖ := by nlinarith _ = (1 + eps) * ‖a ζ‖ := by ring @@ -1079,7 +1082,8 @@ private theorem complex_multiset_prod_sub_norm_le_perturbed | cons ζ s ih => have hζ : ‖b ζ - a ζ‖ <= eps * ‖a ζ‖ := h ζ (by simp) have hs : ∀ ξ ∈ s, ‖b ξ - a ξ‖ <= eps * ‖a ξ‖ := by - simp_all + simp_all only [Multiset.mem_cons, or_true, implies_true, forall_const, forall_eq_or_imp, + true_and] have ih' := ih hs have hprod_b := complex_multiset_prod_norm_le_perturbed s a b heps hs let A : ℝ := (s.map fun ζ => ‖a ζ‖).prod @@ -1089,7 +1093,9 @@ private theorem complex_multiset_prod_sub_norm_le_perturbed dsimp [A] refine Multiset.prod_nonneg (s := s.map (fun ζ : ℂ => ‖a ζ‖)) ?_ - simp_all + simp_all only [Multiset.mem_cons, or_true, implies_true, forall_eq_or_imp, + and_self, Multiset.norm_prod_map, Multiset.mem_map, forall_exists_index, and_imp, + forall_apply_eq_imp_iff₂, norm_nonneg] have hpow_ge_one : 1 <= r ^ s.card := by have hr_ge_one : 1 <= r := by dsimp [r]; linarith exact one_le_pow₀ (n := s.card) hr_ge_one @@ -1120,14 +1126,14 @@ private theorem complex_multiset_prod_sub_norm_le_perturbed have hmul1 : ‖b ζ - a ζ‖ * ‖(s.map b).prod‖ <= (eps * ‖a ζ‖) * (r ^ s.card * A) := - mul_le_mul hζ (by simpa [A, r] using hprod_b) + mul_le_mul hζ (by simpa only [Multiset.norm_prod_map, r, A] using hprod_b) hterm1_nonneg hepsa_nonneg have hmul2 : ‖a ζ‖ * ‖(s.map b).prod - (s.map a).prod‖ <= ‖a ζ‖ * ((r ^ s.card - 1) * A) := mul_le_mul_of_nonneg_left - (by simpa [A, r] using ih') (norm_nonneg _) + (by simpa only [r, A] using ih') (norm_nonneg _) nlinarith _ = ((1 + eps) ^ (ζ ::ₘ s).card - 1) * @@ -1152,17 +1158,20 @@ private theorem lowPoly_relative_oscillation_of_root_factor_bound ‖(roots.map b).prod - (roots.map a).prod‖ <= ((1 + eps) ^ roots.card - 1) * (roots.map fun ζ => ‖a ζ‖).prod := complex_multiset_prod_sub_norm_le_perturbed - roots a b heps (by simpa [roots, a, b] using hroot) + roots a b heps (by simpa only [Polynomial.mem_roots', ne_eq, Polynomial.IsRoot.def, + sub_sub_sub_cancel_right, and_imp, roots, b, a] using hroot) have hprod_nonneg : 0 <= (roots.map fun ζ => ‖a ζ‖).prod := by refine Multiset.prod_nonneg (s := roots.map fun ζ : ℂ => ‖a ζ‖) ?_ - simp_all + simp_all only [tsub_le_iff_right, Polynomial.mem_roots', ne_eq, Polynomial.IsRoot.def, + sub_sub_sub_cancel_right, and_imp, Multiset.mem_map, forall_exists_index, + forall_apply_eq_imp_iff₂, norm_nonneg, implies_true] have htheta_mul : ((1 + eps) ^ roots.card - 1) * (roots.map fun ζ => ‖a ζ‖).prod <= theta * (roots.map fun ζ => ‖a ζ‖).prod := - mul_le_mul_of_nonneg_right (by simpa [roots] using htheta) hprod_nonneg + mul_le_mul_of_nonneg_right (by simpa only [tsub_le_iff_right, roots] using htheta) hprod_nonneg have hdiff : lowPoly q x - lowPoly q y = lc * ((roots.map b).prod - (roots.map a).prod) := by @@ -1181,7 +1190,7 @@ private theorem lowPoly_relative_oscillation_of_root_factor_bound _ = theta * ‖lowPoly q y‖ := by rw [norm_lowPoly_eq_leadingCoeff_mul_roots q y] simp [roots, lc, a] - ring + ac_rfl private theorem one_add_eps_pow_le_one_add_two_nat_mul {eps : ℝ} (heps : 0 <= eps) : @@ -1226,7 +1235,7 @@ private theorem one_add_eps_pow_sub_one_le_of_nat_le (1 + eps) ^ m - 1 <= theta := by have hmDreal : (m : ℝ) <= (D : ℝ) := by exact_mod_cast hmD have hmleD : 2 * (m : ℝ) * eps <= 2 * (D : ℝ) * eps := by - nlinarith [mul_le_mul_of_nonneg_right hmDreal heps] + linarith only [mul_le_mul_of_nonneg_right hmDreal heps] have hsmallm : 2 * (m : ℝ) * eps <= 1 := hmleD.trans hsmallD have hmtheta : 2 * (m : ℝ) * eps <= theta := hmleD.trans hthetaD exact (one_add_eps_pow_sub_one_le_two_nat_mul heps hsmallm).trans hmtheta @@ -1248,7 +1257,8 @@ private theorem one_add_degree_eps_pow_sub_one_le_one_div_sixtyfour have hsmallD : 2 * (D : ℝ) * eps <= 1 := by have h : (1 / 64 : ℝ) <= 1 := by norm_num exact hthetaD.trans h - simpa [eps] using + simpa only [Nat.cast_add, Nat.cast_one, one_div, mul_inv_rev, tsub_le_iff_right, ge_iff_le, + eps] using one_add_eps_pow_sub_one_le_of_nat_le (m := m) (D := D) (eps := eps) (theta := (1 / 64 : ℝ)) heps hmD hsmallD hthetaD @@ -1277,7 +1287,8 @@ private theorem lowPoly_norm_ge_of_roots_dist_ge {D : Nat} have hpow : ((polyOfCoeff q).roots.map fun _ : ℂ => delta).prod = delta ^ (polyOfCoeff q).roots.card := by simp - exact mul_le_mul_of_nonneg_left (by simpa [hpow] using hprod) (norm_nonneg _) + exact mul_le_mul_of_nonneg_left (by simpa only [Multiset.map_const', Multiset.prod_replicate, + hpow] using hprod) (norm_nonneg _) private noncomputable def badCarrierIndices (N : Nat) (roots : Multiset ℂ) (delta : ℝ) : Finset (Fin N) := @@ -1351,7 +1362,7 @@ private theorem badCarrierIndices_subset_roots_biUnion rcases Finset.mem_filter.mp hk with ⟨_hk_univ, ζ, hζ, x, hx_arc, hx_close⟩ rw [Finset.mem_biUnion] refine ⟨ζ, ?_, ?_⟩ - · simpa using hζ + · simpa only [Multiset.mem_toFinset] using hζ · unfold badCarrierIndicesForRoot exact Finset.mem_filter.mpr ⟨Finset.mem_univ k, ⟨x, hx_arc, hx_close⟩⟩ @@ -1372,7 +1383,7 @@ private theorem badCarrierIndices_card_le_roots_card_mul ∑ ζ ∈ roots.toFinset, (badCarrierIndicesForRoot N ζ delta).card <= ∑ _ζ ∈ roots.toFinset, M := by refine Finset.sum_le_sum ?_ - simp_all + simp_all only [Multiset.mem_toFinset, implies_true] have htoFinset : roots.toFinset.card <= roots.card := Multiset.toFinset_card_le roots calc @@ -1384,7 +1395,7 @@ private theorem badCarrierIndices_card_le_roots_card_mul hcard_union _ <= ∑ _ζ ∈ roots.toFinset, M := hsum _ = roots.toFinset.card * M := by - simp_all + simp_all only [Finset.sum_const, smul_eq_mul] _ <= roots.card * M := Nat.mul_le_mul_right M htoFinset private theorem badCarrierIndices_card_le_of_forall_root_card_le @@ -1466,9 +1477,9 @@ private theorem carrierArc_arcSet_eq_mk_image_Icc_wip {N : Nat} (k : Fin N) : le_of_lt (carrierArc_length_pos_wip k) constructor · dsimp [arcLength] at hlen_nonneg ⊢ - nlinarith [ht.1, hlen_nonneg] + nlinarith only [ht.1, hlen_nonneg] · dsimp [arcLength] at hlen_nonneg ⊢ - nlinarith [ht.2, hlen_nonneg] + nlinarith only [ht.2, hlen_nonneg] · intro hx rcases hx with ⟨y, hy, rfl⟩ let t : ℝ := (y - (carrierArc N k).left) / arcLength (carrierArc N k) @@ -1494,7 +1505,7 @@ private theorem circle_dist_mk_le_abs_sub (a b : ℝ) : rw [dist_eq_norm, ← QuotientAddGroup.mk_sub] have h : ‖((a - b : ℝ) : Circle)‖ <= ‖a - b‖ := QuotientAddGroup.norm_mk_le_norm - simpa [Real.norm_eq_abs] using h + simpa only [QuotientAddGroup.mk_sub, ge_iff_le, Real.norm_eq_abs] using h private theorem addCircle_norm_mk_le_pi_div_two_chord (theta : ℝ) : ‖((QuotientAddGroup.mk theta : Circle))‖ <= @@ -1520,7 +1531,7 @@ private theorem addCircle_norm_mk_le_pi_div_two_chord (theta : ℝ) : _ = Real.pi := by ring have hhalf : |phi / 2| <= Real.pi / 2 := by rw [abs_div, abs_of_pos (by norm_num : (0 : ℝ) < 2)] - nlinarith [hphi_le_pi] + linarith only [hphi_le_pi] have h_abs_half : |phi / 2| = |phi| / 2 := by rw [abs_div, abs_of_pos (by norm_num : (0 : ℝ) < 2)] have hjordan := Real.mul_abs_le_abs_sin hhalf have hsin_bound : |phi| <= Real.pi * |Real.sin (phi / 2)| := by @@ -1547,7 +1558,7 @@ private theorem addCircle_norm_mk_le_pi_div_two_chord (theta : ℝ) : ‖Complex.exp (Complex.I * phi) - 1‖ := by rw [mul_comm Complex.I theta, mul_comm Complex.I phi, hperiod] rw [hnorm, hchord_eq, hchord_phi] - nlinarith [hsin_bound] + linarith only [hsin_bound] private theorem zeta_mk_wip (theta : ℝ) : zeta (QuotientAddGroup.mk theta : Circle) = Complex.exp (Complex.I * theta) := by @@ -1579,7 +1590,7 @@ private theorem circle_dist_le_pi_div_two_mul_chord (x y : Circle) : rw [dist_eq_norm, ← QuotientAddGroup.mk_sub] have hbase := addCircle_norm_mk_le_pi_div_two_chord (a - b) rw [zeta_mk_sub_norm_eq a b] - simpa using hbase + simpa only [QuotientAddGroup.mk_sub, ge_iff_le, Complex.ofReal_sub] using hbase private theorem carrierArc_dist_le_length {N : Nat} (k : Fin N) : ∀ x ∈ arcSet (carrierArc N k), ∀ y ∈ arcSet (carrierArc N k), @@ -1625,8 +1636,8 @@ private theorem quotient_mk_injOn_Ioc_zero_period_wip : Set.InjOn (fun t : ℝ => (QuotientAddGroup.mk t : Circle)) (Set.Ioc (0 : ℝ) (2 * Real.pi)) := by intro x hx y hy hxy - have hx0 : x ∈ Set.Ioc (0 : ℝ) (0 + 2 * Real.pi) := by simpa using hx - have hy0 : y ∈ Set.Ioc (0 : ℝ) (0 + 2 * Real.pi) := by simpa using hy + have hx0 : x ∈ Set.Ioc (0 : ℝ) (0 + 2 * Real.pi) := by simpa only [zero_add, Set.mem_Ioc] using hx + have hy0 : y ∈ Set.Ioc (0 : ℝ) (0 + 2 * Real.pi) := by simpa only [zero_add, Set.mem_Ioc] using hy have hx' : AddCircle.equivIoc (2 * Real.pi) (0 : ℝ) (QuotientAddGroup.mk x : Circle) = ⟨x, hx0⟩ := @@ -1635,7 +1646,7 @@ private theorem quotient_mk_injOn_Ioc_zero_period_wip : AddCircle.equivIoc (2 * Real.pi) (0 : ℝ) (QuotientAddGroup.mk y : Circle) = ⟨y, hy0⟩ := AddCircle.equivIoc_coe_eq hy0 - simp_all + simp_all only [Set.mem_Ioc, Subtype.mk.injEq] private theorem carrierArc_mk_preimage_image_Ioc_inter_fundamental_wip {N : Nat} (k : Fin N) : @@ -1663,7 +1674,9 @@ private theorem carrierArc_mk_preimage_image_Ioc_inter_fundamental_wip private theorem volume_singleton_circle_wip (x : Circle) : MeasureTheory.volume ({x} : Set Circle) = 0 := by have h := AddCircle.volume_closedBall (T := 2 * Real.pi) (x := x) (ε := 0) - simpa using h + simpa only [MeasureTheory.Measure.addHaar_singleton, Metric.closedBall_zero, mul_zero, + ENNReal.ofReal_min, Nat.ofNat_nonneg, ENNReal.ofReal_mul, ENNReal.ofReal_ofNat, + ENNReal.ofReal_zero, zero_le, inf_of_le_right] using h private theorem μCircle_singleton_wip (x : Circle) : μCircle ({x} : Set Circle) = 0 := by @@ -1672,7 +1685,8 @@ private theorem μCircle_singleton_wip (x : Circle) : rw [AddCircle.volume_eq_smul_haarAddCircle, MeasureTheory.Measure.smul_apply] at hvol rw [smul_eq_mul] at hvol have hcoef : ENNReal.ofReal (2 * Real.pi) ≠ 0 := by simp [ENNReal.ofReal_eq_zero, Real.pi_pos] - simpa [μCircle] using (mul_eq_zero.mp hvol).resolve_left hcoef + simpa only [μCircle, MeasureTheory.Measure.addHaar_singleton] using + (mul_eq_zero.mp hvol).resolve_left hcoef private theorem carrierArc_arcSet_ae_eq_mk_image_Ioc_wip {N : Nat} (k : Fin N) : arcSet (carrierArc N k) =ᵐ[μCircle] @@ -1748,7 +1762,7 @@ private theorem volume_mk_image_carrierArc_Ioc_wip {N : Nat} (k : Fin N) : ((fun t : ℝ => (QuotientAddGroup.mk t : Circle)) ⁻¹' S) ∩ Set.Ioc (0 : ℝ) (0 + 2 * Real.pi) = Set.Ioc ((carrierArc N k).left) ((carrierArc N k).right) := by - simpa [S] using carrierArc_mk_preimage_image_Ioc_inter_fundamental_wip k + simpa only [zero_add, S] using carrierArc_mk_preimage_image_Ioc_inter_fundamental_wip k rw [hpre_set, Real.volume_Ioc] at hpre dsimp [arcLength] symm @@ -1790,7 +1804,7 @@ private theorem carrierArc_mu_real_eq_length_div_period ENNReal.toReal_ofReal hell_nonneg] at h have hT_pos : 0 < (2 * Real.pi : ℝ) := by positivity rw [MeasureTheory.measureReal_def, eq_div_iff hT_pos.ne'] - simpa [mul_comm] using h + simpa only [mul_comm] using h private theorem carrierArc_mu_real_eq_inv_nat {N : Nat} (k : Fin N) : @@ -1855,7 +1869,7 @@ private theorem badCarrierForRoot_union_subset_closedBall_of_center calc ‖zeta x - zeta x0‖ = ‖(zeta x - ζ) + (ζ - zeta x0)‖ := by - simp_all + simp_all only [sub_add_sub_cancel] _ <= ‖zeta x - ζ‖ + ‖ζ - zeta x0‖ := norm_add_le _ _ _ <= delta + delta := by exact add_le_add (le_of_lt hx_close) (le_of_lt hx0_close') _ = 2 * delta := by ring @@ -1872,7 +1886,7 @@ private theorem badCarrierForRoot_union_subset_closedBall_of_center _ <= arcLength (carrierArc N k) + Real.pi * delta := by exact add_le_add hdist_y_x hdist_x_x0 _ = Real.pi * delta + (2 * Real.pi) / (N : ℝ) := by rw [carrierArc_length k] - ring + ac_rfl private theorem carrierArc_setIntegral_eq_iocImage_wip {N : Nat} (k : Fin N) (f : Circle -> ℝ) : @@ -1886,7 +1900,7 @@ private theorem carrierIocImage_mu_real_eq_inv_nat {N : Nat} (k : Fin N) : μCircle.real (carrierIocImage k) = (N : ℝ)⁻¹ := by have h := carrierArc_setIntegral_eq_iocImage_wip k (fun _ : Circle => (1 : ℝ)) rw [MeasureTheory.setIntegral_const, MeasureTheory.setIntegral_const] at h - simpa [carrierArc_mu_real_eq_inv_nat k] using h.symm + simpa only [smul_eq_mul, mul_one, carrierArc_mu_real_eq_inv_nat k] using h.symm private theorem carrierArc_setIntegral_eq_iocImage_complex_wip {N : Nat} (k : Fin N) (f : Circle -> ℂ) : @@ -1926,7 +1940,8 @@ private theorem carrierIocImage_indicator_preimage_eq_wip exact htiff by_cases hs : (QuotientAddGroup.mk t : Circle) ∈ carrierIocImage k · simp [Set.indicator_of_mem, ht, hs, hmem.mp hs] - · simp_all + · simp_all only [Set.mem_Ioc, false_iff, not_and, not_le, and_self, Set.indicator_of_mem, + not_false_eq_true, Set.indicator_of_notMem, implies_true] · have hnot : t ∉ Set.Ioc ((carrierArc N k).left) ((carrierArc N k).right) := by intro htc have hsubset : Set.Ioc ((carrierArc N k).left) ((carrierArc N k).right) ⊆ @@ -1967,7 +1982,7 @@ private theorem carrierIocImage_volume_setIntegral_eq_real_Ioc rw [← MeasureTheory.integral_indicator measurableSet_Ioc, ← MeasureTheory.integral_indicator measurableSet_Ioc] have hfun := carrierIocImage_indicator_preimage_eq_wip k f - simpa [g, S, zero_add] using congrArg + simpa only [zero_add, g, S] using congrArg (fun h : ℝ -> ℝ => ∫ t, h t ∂ (MeasureTheory.volume : MeasureTheory.Measure ℝ)) hfun rw [← hrhs, ← hpre] @@ -2051,7 +2066,7 @@ private theorem carrierIocImage_volume_setIntegral_eq_real_Ioc_complex rw [← MeasureTheory.integral_indicator measurableSet_Ioc, ← MeasureTheory.integral_indicator measurableSet_Ioc] have hfun := carrierIocImage_indicator_preimage_eq_wip k f - simpa [g, S, zero_add] using congrArg + simpa only [zero_add, g, S] using congrArg (fun h : ℝ -> ℂ => ∫ t, h t ∂ (MeasureTheory.volume : MeasureTheory.Measure ℝ)) hfun rw [← hrhs, ← hpre] @@ -2136,7 +2151,7 @@ private theorem carrierAverage_eq_interval_average (N : ℂ) * ((1 / (2 * Real.pi) : ℝ) • I) = ((N : ℂ) * ((1 / (2 * Real.pi) : ℝ) : ℂ)) * I := by rw [Complex.real_smul] - ring + ac_rfl _ = (((arcLength (carrierArc N k))⁻¹ : ℝ) : ℂ) * I := by rw [hcoeff] _ = ((arcLength (carrierArc N k))⁻¹ : ℝ) • I := by rw [Complex.real_smul] @@ -2176,7 +2191,7 @@ private theorem carrierAverage_variance_interval_le_derivative simpa [a, h] using carrierArc_left_add_length_eq_right_wip k have hf_deriv : ∀ x ∈ Set.Icc (0 : ℝ) h, HasDerivAt f (f' x) x := by intro x hx - simpa [f, f'] using hasDerivAt_slowBandPoly_shift p a x + simpa only [QuotientAddGroup.mk_add, f, f'] using hasDerivAt_slowBandPoly_shift p a x have hf_cont : ContinuousOn f (Set.Icc (0 : ℝ) h) := by exact (((continuous_slowBandPoly p).comp ((AddCircle.continuous_mk' (2 * Real.pi)).comp @@ -2192,7 +2207,7 @@ private theorem carrierAverage_variance_interval_le_derivative change h⁻¹ • (∫ x in (0 : ℝ)..h, Q (QuotientAddGroup.mk (x + a) : Circle)) = avg rw [hshift, hright] - simpa [avg, Q, h] using + simpa only [Complex.real_smul, Complex.ofReal_inv, avg, Q, h] using (carrierAverage_eq_interval_average (N := N) k Q).symm have hp := FockSPR.MissingMathlib.poincare_interval hh_pos hf_deriv hf_cont hf'_cont @@ -2203,7 +2218,7 @@ private theorem carrierAverage_variance_interval_le_derivative ‖Q (QuotientAddGroup.mk t : Circle) - avg‖ ^ 2) = ∫ x in (0 : ℝ)..h, ‖f x - avg‖ ^ 2 := by rw [← hright] - simpa [f] using + simpa only [QuotientAddGroup.mk_add, f] using intervalIntegral_shift_wip (fun t : ℝ => ‖Q (QuotientAddGroup.mk t : Circle) - avg‖ ^ 2) a h have hshift_rhs : @@ -2213,7 +2228,7 @@ private theorem carrierAverage_variance_interval_le_derivative simpa [f'] using intervalIntegral_shift_wip (fun t : ℝ => ‖slowBandPolyDeriv p t‖ ^ 2) a h - simpa [Q, a, h, avg, hshift_lhs, hshift_rhs] using hp + simpa only [hshift_lhs, hshift_rhs, ge_iff_le, Q, a, h, avg] using hp private theorem carrierAverage_variance_carrier_le_derivative_interval {N L : Nat} (k : Fin N) (p : Fin L -> ℂ) : @@ -2293,7 +2308,7 @@ private theorem carrierIocImage_setIntegral_biUnion_finset_wip intro hk exact carrierIocImage_disjoint_wip (k := a) (l := k) (by intro hak - simp_all) + simp_all only [not_true_eq_false]) have hnull_union : MeasureTheory.NullMeasurableSet (⋃ k ∈ K, carrierIocImage k) μCircle := K.nullMeasurableSet_biUnion @@ -2325,12 +2340,17 @@ private theorem carrierIocImage_union_mu_real_eq_card_inv_nat ∀ k ∈ K, MeasureTheory.IntegrableOn (fun _ : Circle => (1 : ℝ)) (carrierIocImage k) μCircle := by - simp_all + simp_all only [enorm_one, ne_eq, ENNReal.one_ne_top, not_false_eq_true, + MeasureTheory.integrableOn_const_iff, one_ne_zero, MeasureTheory.measure_lt_top, or_true, + implies_true] have hsum := carrierIocImage_setIntegral_biUnion_finset_wip (N := N) K (fun _ : Circle => (1 : ℝ)) hf have hleft : (∫ x in U, (1 : ℝ) ∂ μCircle) = μCircle.real U := by - simp_all + simp_all only [enorm_one, ne_eq, ENNReal.one_ne_top, not_false_eq_true, + MeasureTheory.integrableOn_const_iff, one_ne_zero, MeasureTheory.measure_lt_top, or_true, + implies_true, MeasureTheory.integral_const, MeasurableSet.univ, + MeasureTheory.measureReal_restrict_apply, Set.univ_inter, smul_eq_mul, mul_one] have hright : (∑ k ∈ K, ∫ x in carrierIocImage k, (1 : ℝ) ∂ μCircle) = ∑ k ∈ K, (N : ℝ)⁻¹ := by @@ -2338,7 +2358,11 @@ private theorem carrierIocImage_union_mu_real_eq_card_inv_nat intro k hk rw [MeasureTheory.setIntegral_const] simp [carrierIocImage_mu_real_eq_inv_nat k] - simp_all + simp_all only [enorm_one, ne_eq, ENNReal.one_ne_top, not_false_eq_true, + MeasureTheory.integrableOn_const_iff, one_ne_zero, MeasureTheory.measure_lt_top, or_true, + implies_true, MeasureTheory.integral_const, MeasurableSet.univ, + MeasureTheory.measureReal_restrict_apply, Set.univ_inter, smul_eq_mul, mul_one, + Finset.sum_const, nsmul_eq_mul] private theorem μCircle_real_closedBall_eq_min_div_period (x : Circle) {R : ℝ} (hR : 0 <= R) : @@ -2358,7 +2382,7 @@ private theorem μCircle_real_closedBall_eq_min_div_period ENNReal.toReal_ofReal hT_nonneg] at h have hT_pos : 0 < (2 * Real.pi : ℝ) := by positivity rw [MeasureTheory.measureReal_def, eq_div_iff hT_pos.ne'] - simpa [S, mul_comm] using h.symm + simpa only [mul_comm, S] using h.symm private theorem carrierIocImage_card_invNat_le_closedBall_ratio {N : Nat} (K : Finset (Fin N)) {x0 : Circle} {R : ℝ} @@ -2385,7 +2409,7 @@ private theorem nat_card_le_of_real_invNat_le {N M : Nat} (hN : 0 < N) {c : Nat} (h : (c : ℝ) * (N : ℝ)⁻¹ <= (M : ℝ) * (N : ℝ)⁻¹) : c <= M := by - simp_all + simp_all only [inv_pos, Nat.cast_pos, mul_le_mul_iff_left₀, Nat.cast_le] private theorem carrierIocImage_card_le_of_closedBall_ratio_le {N M : Nat} (hN : 0 < N) (K : Finset (Fin N)) {x0 : Circle} {R : ℝ} @@ -2471,12 +2495,12 @@ private theorem carrierArc_length_le_canonical_delta circleBadConst_ge_succ_of_pos hD have hbad_ge_real : (((D + 1 : Nat) : ℝ) <= (circleBadConst D : ℝ)) := by exact_mod_cast hbad_ge rw [carrierArc_length k] - have htwo_pi_le_eight : (2 * Real.pi : ℝ) <= 8 := by nlinarith [Real.pi_le_four] + have htwo_pi_le_eight : (2 * Real.pi : ℝ) <= 8 := by linarith only [Real.pi_le_four] have hscale : 8 <= 8 * ((circleBadConst D : ℝ) / ((D + 1 : Nat) : ℝ)) := by have hratio : (1 : ℝ) <= (circleBadConst D : ℝ) / ((D + 1 : Nat) : ℝ) := by rw [le_div_iff₀ hsucc_pos] - simpa using hbad_ge_real + simpa only [Nat.cast_add, Nat.cast_one, one_mul] using hbad_ge_real nlinarith calc (2 * Real.pi) / (N : ℝ) <= 8 / (N : ℝ) := @@ -2501,7 +2525,8 @@ private theorem real_Ioc_zero_period_subset_iUnion_carrierIoc_wip have hsub := Ioc_subset_biUnion_Ioc N a have ht0N : t ∈ Set.Ioc (a 0) (a N) := by have hNpos : (0 : ℝ) < (N : ℝ) := by exact_mod_cast hN - simpa [a, hNpos.ne'] using ht + simpa only [CharP.cast_eq_zero, mul_zero, zero_div, isUnit_iff_ne_zero, ne_eq, hNpos.ne', + not_false_eq_true, IsUnit.mul_div_cancel_right, Set.mem_Ioc, a] using ht have htunion : t ∈ ⋃ i ∈ Finset.range N, Set.Ioc (a i) (a (i + 1)) := hsub ht0N @@ -2509,7 +2534,7 @@ private theorem real_Ioc_zero_period_subset_iUnion_carrierIoc_wip rcases Set.mem_iUnion.mp hi_mem with ⟨hi_range, hti⟩ have hi_lt : i < N := Finset.mem_range.mp hi_range refine Set.mem_iUnion.mpr ⟨⟨i, hi_lt⟩, ?_⟩ - simpa [a, carrierArc] using hti + simpa only [carrierArc, Nat.cast_add, Nat.cast_one, Set.mem_Ioc, a] using hti private theorem carrierIocImage_iUnion_univ_wip {N : Nat} (hN : 0 < N) : @@ -2519,14 +2544,14 @@ private theorem carrierIocImage_iUnion_univ_wip have hfull : ((fun t : ℝ => (QuotientAddGroup.mk t : Circle)) '' Set.Ioc (0 : ℝ) (0 + 2 * Real.pi)) = Set.univ := by - simpa using + simpa only [zero_add] using (AddCircle.coe_image_Ioc_eq (p := 2 * Real.pi) (a := (0 : ℝ))) have hxfull : x ∈ (fun t : ℝ => (QuotientAddGroup.mk t : Circle)) '' Set.Ioc (0 : ℝ) (0 + 2 * Real.pi) := by - simp_all + simp_all only [zero_add, Set.mem_univ] rcases hxfull with ⟨t, ht, rfl⟩ - have ht' : t ∈ Set.Ioc (0 : ℝ) (2 * Real.pi) := by simpa using ht + have ht' : t ∈ Set.Ioc (0 : ℝ) (2 * Real.pi) := by simpa only [Set.mem_Ioc, zero_add] using ht have htc := real_Ioc_zero_period_subset_iUnion_carrierIoc_wip (N := N) hN ht' rcases Set.mem_iUnion.mp htc with ⟨k, htk⟩ @@ -2550,8 +2575,9 @@ private theorem carrierIocImage_setIntegral_univ_wip (fun k hk => hf.integrableOn) have hunion : (⋃ k ∈ (Finset.univ : Finset (Fin N)), carrierIocImage k) = - Set.univ := by simpa using carrierIocImage_iUnion_univ_wip (N := N) hN - simp_all + Set.univ := by simpa only [Finset.mem_univ, Set.iUnion_true] using + carrierIocImage_iUnion_univ_wip (N := N) hN + simp_all only [Finset.mem_univ, Set.iUnion_true, MeasureTheory.Measure.restrict_univ] private theorem carrierArc_setIntegral_univ_wip {N : Nat} (hN : 0 < N) (f : Circle -> ℝ) @@ -2593,7 +2619,10 @@ private theorem carrierAverage_sub_mean_integral_zero (μCircle.restrict s) := MeasureTheory.integrable_const _ rw [MeasureTheory.integral_sub hf.restrict hconst, MeasureTheory.integral_const] simp only [hmu, carrierAverage, s] - simp_all + simp_all only [ne_eq, Nat.cast_eq_zero, MeasurableSet.univ, + MeasureTheory.measureReal_restrict_apply, Set.univ_inter, enorm_ne_top, not_false_eq_true, + MeasureTheory.integrable_const_enorm, Complex.real_smul, Complex.ofReal_inv, + Complex.ofReal_natCast, inv_mul_cancel_left₀, sub_self] private theorem setIntegral_bias_variance_of_mean_zero {α : Type} [MeasurableSpace α] (μ : MeasureTheory.Measure α) @@ -2615,7 +2644,9 @@ private theorem setIntegral_bias_variance_of_mean_zero ∫ x in s, @inner ℝ ℂ _ c (f x - c) ∂ μ = 0 := by have key : ∀ x, @inner ℝ ℂ _ c (f x - c) = (innerSL ℝ c) (f x - c) := by - simp_all + simp_all only [ne_eq, enorm_ne_top, not_false_eq_true, MeasureTheory.integrable_const_enorm, + Complex.inner, Complex.mul_re, Complex.sub_re, Complex.conj_re, Complex.sub_im, + Complex.conj_im, mul_neg, sub_neg_eq_add, coe_innerSL_apply, implies_true] simp_rw [key] rw [ContinuousLinearMap.integral_comp_comm (innerSL ℝ c) hgc.restrict, hmean] simp @@ -2629,7 +2660,9 @@ private theorem setIntegral_bias_variance_of_mean_zero ∫ x in s, (‖f x‖ ^ 2 - ‖f x - c‖ ^ 2) ∂ μ = ∫ x in s, (2 * @inner ℝ ℂ _ c (f x - c) + ‖c‖ ^ 2) ∂ μ := by - simp_all + simp_all only [ne_eq, enorm_ne_top, not_false_eq_true, MeasureTheory.integrable_const_enorm, + Complex.inner, Complex.mul_re, Complex.sub_re, Complex.conj_re, Complex.sub_im, + Complex.conj_im, mul_neg, sub_neg_eq_add] have hsplit : ∫ x in s, (‖f x‖ ^ 2 - ‖f x - c‖ ^ 2) ∂ μ = (∫ x in s, ‖f x‖ ^ 2 ∂ μ) - @@ -2639,7 +2672,9 @@ private theorem setIntegral_bias_variance_of_mean_zero (fun x => @inner ℝ ℂ _ c (f x - c)) μ := by have key : ∀ x, @inner ℝ ℂ _ c (f x - c) = (innerSL ℝ c) (f x - c) := by - simp_all + simp_all only [ne_eq, enorm_ne_top, not_false_eq_true, MeasureTheory.integrable_const_enorm, + Complex.inner, Complex.mul_re, Complex.sub_re, Complex.conj_re, Complex.sub_im, + Complex.conj_im, mul_neg, sub_neg_eq_add, coe_innerSL_apply, implies_true] rw [show (fun x => @inner ℝ ℂ _ c (f x - c)) = fun x => (innerSL ℝ c) (f x - c) by funext x @@ -2680,14 +2715,14 @@ private theorem carrierAverage_bias_variance dsimp [μCircle] infer_instance have hf : MeasureTheory.Integrable f μCircle := by - simpa [f, μCircle] using + simpa only [μCircle, f] using hf_cont.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) have hfsq : MeasureTheory.Integrable (fun x : Circle => ‖f x‖ ^ 2) μCircle := by - simpa [f, μCircle] using + simpa only [μCircle, f] using hfsq_cont.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) have hgc_sq : MeasureTheory.Integrable (fun x : Circle => ‖f x - c‖ ^ 2) μCircle := by - simpa [f, c, μCircle] using + simpa only [μCircle, f, c] using hgc_sq_cont.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) have hmean : (∫ x in arcSet (carrierArc N k), f x - c ∂ μCircle) = 0 := by @@ -2768,7 +2803,7 @@ private theorem carrierAverage_fast_theta_error_le_half_mass_plus_variance have htheta_sq : theta ^ 2 <= (1 / 64 : ℝ) ^ 2 := by nlinarith [sq_nonneg (theta - 1 / 64)] have hpi_pos : 0 < Real.pi := Real.pi_pos field_simp [ne_of_gt hpi_pos] - nlinarith + linarith only [htheta_sq] have hX_nonneg : 0 <= X := by have hell : 0 <= arcLength (carrierArc N k) := arcLength_nonneg (carrierArc N k) @@ -2820,7 +2855,7 @@ private theorem slowBandPoly_l2_eq_average_mass_plus_variance have hf_cont : Continuous f := (continuous_slowBandPoly p).norm.pow 2 have hf_int : MeasureTheory.Integrable f μCircle := by - simpa [f, μCircle] using + simpa only [μCircle, f] using hf_cont.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) have hdecomp : (∫ x, f x ∂ μCircle) = @@ -2840,7 +2875,8 @@ private theorem slowBandPoly_l2_eq_average_mass_plus_variance ‖carrierAverage (N := N) k (slowBandPoly p)‖ ^ 2 + ∫ x in arcSet (carrierArc N k), ‖slowBandPoly p x - - carrierAverage (N := N) k (slowBandPoly p)‖ ^ 2 ∂ μCircle := by simpa [f] using hbv + carrierAverage (N := N) k (slowBandPoly p)‖ ^ 2 ∂ μCircle := by simpa only [f] using + hbv _ = (1 / (2 * Real.pi)) * Avg k + Var k := by simp [Avg, Var] ring @@ -2850,7 +2886,7 @@ private theorem slowBandPoly_l2_eq_average_mass_plus_variance _ = ∑ k : Fin N, ∫ x in arcSet (carrierArc N k), f x ∂ μCircle := hdecomp _ = ∑ k : Fin N, ((1 / (2 * Real.pi)) * Avg k + Var k) := by - simp_all + simp_all only [one_div, mul_inv_rev] _ = (1 / (2 * Real.pi)) * (∑ k : Fin N, Avg k) + ∑ k : Fin N, Var k := by rw [Finset.sum_add_distrib, Finset.mul_sum] _ = @@ -2867,7 +2903,8 @@ private theorem zeta_arcParam (I : CircleArc) (t : ℝ) : zeta (arcParam I t) = Complex.exp (Complex.I * (I.left + t * arcLength I)) := by have h := circleChar_mk_wip 1 (I.left + t * arcLength I) - simpa [circleChar, arcParam, mul_assoc] using h + simpa only [arcParam, QuotientAddGroup.mk_add, circleChar, pow_one, Nat.cast_one, mul_one, + Complex.ofReal_add, Complex.ofReal_mul, mul_assoc] using h private theorem carrierArc_chord_le_length {N : Nat} (k : Fin N) : ∀ x ∈ arcSet (carrierArc N k), @@ -2898,7 +2935,7 @@ private theorem carrierArc_chord_le_length {N : Nat} (k : Fin N) : _ = ‖Complex.exp (Complex.I * (t * arcLength I)) - 1‖ := by rw [norm_mul, Complex.norm_exp_I_mul_ofReal, one_mul] _ <= ‖t * arcLength I‖ := by - simpa [Complex.ofReal_mul] using + simpa only [norm_mul, Real.norm_eq_abs, Complex.ofReal_mul] using (Real.norm_exp_I_mul_ofReal_sub_one_le (x := t * arcLength I)) _ = t * arcLength I := by rw [Real.norm_of_nonneg (mul_nonneg ht_nonneg hlen_nonneg)] _ <= arcLength I := by nlinarith @@ -2917,7 +2954,7 @@ private theorem slowBandPoly_sub_carrierBase_le_slope_length have hmul : S * ‖zeta x - zeta (carrierBase k)‖ <= S * arcLength (carrierArc N k) := mul_le_mul_of_nonneg_left hchord hS_nonneg - exact hosc.trans (by simpa [S] using hmul) + exact hosc.trans (by simpa only [S] using hmul) private theorem lowPoly_norm_lower_on_goodCarrier {D N : Nat} (q : Fin (D + 1) -> ℂ) {delta : ℝ} (hdelta : 0 <= delta) @@ -3020,7 +3057,8 @@ private theorem goodCarrier_relative_oscillation_of_root_product_chord_bound calc ‖(zeta x - ζ) - (zeta (carrierBase k) - ζ)‖ = ‖zeta x - zeta (carrierBase k)‖ := by - simp_all + simp_all only [tsub_le_iff_right, Polynomial.mem_roots', ne_eq, Polynomial.IsRoot.def, + sub_sub_sub_cancel_right] _ <= eps * delta := hchord x hx _ <= eps * ‖zeta (carrierBase k) - ζ‖ := hdelta_to_root @@ -3060,7 +3098,7 @@ private theorem goodCarrier_absolute_oscillation_of_chord_bound have hosc := norm_lowPoly_sub_le_chord q x (carrierBase k) have hSR : S * ‖zeta x - zeta (carrierBase k)‖ <= S * R := mul_le_mul_of_nonneg_left (hchord x hx) hS_nonneg - exact hosc.trans (hSR.trans (by simpa [S] using hslope)) + exact hosc.trans (hSR.trans (by simpa only [S] using hslope)) private theorem goodCarrier_defect_compare_band {D N L : Nat} {q : Fin (D + 1) -> ℂ} (hq : q ≠ 0) (p : Fin L -> ℂ) @@ -3128,7 +3166,7 @@ private theorem goodCarrier_base_mass_le_actual_defect_plus_fast_variance_error exact lowPoly_ne_zero_at_goodCarrierBase hq hdelta_pos hgood have hrot : arcLength (carrierArc N k) * ‖u‖ ^ 2 <= Crot * A := by - simpa [A, c, u, s, arcIntegral] using + simpa only [arcIntegral, A, c, u, s] using constantCenter_fastRotate_carrierArc_sq_le_defectSq (N := N) k (c := c) (u := u) hc have hfast_compare : @@ -3140,20 +3178,22 @@ private theorem goodCarrier_base_mass_le_actual_defect_plus_fast_variance_error (c := c) (u := u) (theta := theta) hc htheta_nonneg htheta_le (goodCarrier_factor_of_relative_oscillation hq hdelta_pos hgood hosc) - simpa [A, B, E, c, u, s] using h + simpa only [one_div, MeasureTheory.integral_const, MeasurableSet.univ, + MeasureTheory.measureReal_restrict_apply, Set.univ_inter, smul_eq_mul, tsub_le_iff_right, + ge_iff_le, A, B, E, c, u, s] using h have hsafe : (1 / 2) * B - V <= Dint := by have h := defect_setIntegral_safe_carrier_average s (lowPoly q) (continuous_lowPoly q) N p u - simpa [B, Dint, V, u, s] using h + simpa only [one_div, tsub_le_iff_right, ge_iff_le, B, Dint, V, u, s] using h have hA : A <= 4 * Dint + 4 * V + 2 * E := by nlinarith have hmul : Crot * A <= Crot * (4 * Dint + 4 * V + 2 * E) := mul_le_mul_of_nonneg_left hA (le_of_lt Crot_pos) calc arcLength (carrierArc N k) * ‖slowBandPoly p (carrierBase k)‖ ^ 2 - <= Crot * A := by simpa [u] using hrot + <= Crot * A := by simpa only [u] using hrot _ <= Crot * (4 * Dint + 4 * V + 2 * E) := hmul _ = 4 * Crot * @@ -3241,7 +3281,7 @@ private theorem carrier_fast_theta_error_le_half_base arcLength (carrierArc N k) * ‖slowBandPoly p (carrierBase k)‖ ^ 2 := by rw [← hu_norm] - nlinarith [mul_le_mul_of_nonneg_right hcoef (mul_nonneg hnorm_sq hell_nonneg)] + linarith only [mul_le_mul_of_nonneg_right hcoef (mul_nonneg hnorm_sq hell_nonneg)] field_simp [hpi_ne] linarith @@ -3283,11 +3323,13 @@ private theorem (4 * theta * ‖slowBandPoly p (carrierBase k)‖) ^ 2 ∂ μCircle have hraw : X <= 4 * Crot * Dint + 4 * Crot * V + E := by - simpa [X, Dint, V, E] using + simpa only [MeasureTheory.integral_const, MeasurableSet.univ, + MeasureTheory.measureReal_restrict_apply, Set.univ_inter, smul_eq_mul, X, Dint, V, E] using goodCarrier_base_mass_le_actual_defect_plus_fast_variance_error_of_arcLength_slope (q := q) hq p hdelta_pos htheta_nonneg htheta_le hgood hslope have hE : E <= (1 / 2) * X := by - simpa [X, E] using + simpa only [MeasureTheory.integral_const, MeasurableSet.univ, + MeasureTheory.measureReal_restrict_apply, Set.univ_inter, smul_eq_mul, one_div, X, E] using carrier_fast_theta_error_le_half_base (N := N) (L := L) k p htheta_nonneg htheta_le_small calc @@ -3329,11 +3371,13 @@ private theorem goodCarrier_base_mass_le_actual_defect_plus_fast_variance_absorb (4 * theta * ‖slowBandPoly p (carrierBase k)‖) ^ 2 ∂ μCircle have hraw : X <= 4 * Crot * Dint + 4 * Crot * V + E := by - simpa [X, Dint, V, E] using + simpa only [MeasureTheory.integral_const, MeasurableSet.univ, + MeasureTheory.measureReal_restrict_apply, Set.univ_inter, smul_eq_mul, X, Dint, V, E] using goodCarrier_base_mass_le_actual_defect_plus_fast_variance_error (q := q) hq p hdelta_pos htheta_nonneg htheta_le hgood hosc have hE : E <= (1 / 2) * X := by - simpa [X, E] using + simpa only [MeasureTheory.integral_const, MeasurableSet.univ, + MeasureTheory.measureReal_restrict_apply, Set.univ_inter, smul_eq_mul, one_div, X, E] using carrier_fast_theta_error_le_half_base (N := N) (L := L) k p htheta_nonneg htheta_le_small calc @@ -3415,7 +3459,7 @@ private theorem goodCarrier_average_mass_le_actual_defect_plus_errors 2 * Crot * A + 2 * Crot * V := carrierAverage_mass_le_defect_plus_variance (N := N) k p hc have hcompare : (1 / 2) * A - E <= Dint := by - simpa [A, Dint, E, c] using + simpa only [one_div, tsub_le_iff_right, A, Dint, E, c] using goodCarrier_defect_compare_band (q := q) hq p hdelta_pos htheta_nonneg htheta_le hgood hosc have hA : A <= 2 * Dint + 2 * E := by nlinarith @@ -3424,7 +3468,7 @@ private theorem goodCarrier_average_mass_le_actual_defect_plus_errors ‖carrierAverage (N := N) k (slowBandPoly p)‖ ^ 2 <= 2 * Crot * A + 2 * Crot * V := havg _ <= 2 * Crot * (2 * Dint + 2 * E) + 2 * Crot * V := by - have hcoef_nonneg : 0 <= 2 * Crot := by nlinarith [Crot_pos] + have hcoef_nonneg : 0 <= 2 * Crot := by linarith only [Crot_pos] have hmul : 2 * Crot * A <= 2 * Crot * (2 * Dint + 2 * E) := mul_le_mul_of_nonneg_left hA hcoef_nonneg @@ -3484,7 +3528,7 @@ private theorem goodCarrier_average_mass_le_actual_defect_plus_fast_variance_abs have hE : 4 * Crot * E <= (1 / 2) * X + 4 * Crot * (4 * theta) ^ 2 * V := by - simpa [X, E, V] using + simpa only [one_div, X, E, V] using carrierAverage_fast_theta_error_le_half_mass_plus_variance (N := N) (L := L) k p htheta_nonneg htheta_le_small calc @@ -3566,7 +3610,8 @@ private theorem parseval_fin_fourier {L : Nat} (c : Fin L -> ℂ) : let d : ℤ -> ℂ := fun k => b' (Int.toNat k) have hPLp : PLp = ∑ k ∈ E', d k • fourierLp 2 k := by simp only [PLp, Pcont, E', d, fourierLp, map_sum, map_smul] - simp_all + simp_all only [fourier_apply, natCast_zsmul, Finset.sum_map, Function.Embedding.coeFn_mk, + Int.toNat_natCast] have hinner_orth : @inner ℂ _ _ PLp PLp = Complex.ofReal (∑ n ∈ E, ‖b' n‖ ^ 2) := by @@ -3709,7 +3754,7 @@ private theorem slowBandPolyDeriv_interval_sum_eq_circleL2Sq intro x rfl have hf_int : MeasureTheory.Integrable f μCircle := by - simpa [f, μCircle] using + simpa only [μCircle, f] using hf_cont.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) have hpart : (∫ x, f x ∂ μCircle) = @@ -3721,7 +3766,7 @@ private theorem slowBandPolyDeriv_interval_sum_eq_circleL2Sq ∫ t in (carrierArc N k).left..(carrierArc N k).right, ‖slowBandPolyDeriv p t‖ ^ 2 := by intro k - simpa [f, slowBandPolyDeriv] using + simpa only [one_div, mul_inv_rev, slowBandPolyDeriv, f] using carrierArc_setIntegral_eq_intervalIntegral_wip (k := k) (f := f) calc (1 / (2 * Real.pi)) * @@ -3733,7 +3778,7 @@ private theorem slowBandPolyDeriv_interval_sum_eq_circleL2Sq ∫ t in (carrierArc N k).left..(carrierArc N k).right, ‖slowBandPolyDeriv p t‖ ^ 2 := by rw [Finset.mul_sum] _ = ∑ k : Fin N, ∫ x in arcSet (carrierArc N k), f x ∂ μCircle := by - simp_all + simp_all only [one_div, mul_inv_rev] _ = ∫ x, f x ∂ μCircle := hpart.symm _ = circleL2Sq (slowBandPolyDerivCircle p) := by simp [circleL2Sq, f, μCircle] @@ -3758,7 +3803,7 @@ private theorem sum_carrierAverage_variance_le_global have h := carrierAverage_variance_carrier_le_derivative_interval (N := N) (L := L) k p - simpa [I, c, carrierArc_length] using h + simpa only [one_div, mul_inv_rev, ge_iff_le, carrierArc_length, I, c] using h have hsum_local : (∑ k : Fin N, ∫ x in arcSet (carrierArc N k), @@ -3773,7 +3818,7 @@ private theorem sum_carrierAverage_variance_le_global = ∑ k : Fin N, c * ((1 / (2 * Real.pi)) * I k) := by refine Finset.sum_congr rfl ?_ intro k hk - ring + ac_rfl _ = c * ∑ k : Fin N, ((1 / (2 * Real.pi)) * I k) := by rw [Finset.mul_sum] _ = c * ((1 / (2 * Real.pi)) * ∑ k : Fin N, I k) := by congr 1 @@ -3783,7 +3828,7 @@ private theorem sum_carrierAverage_variance_le_global ((L : ℝ) - 1) ^ 2 * circleL2Sq (slowBandPoly p) := by rw [show (1 / (2 * Real.pi)) * ∑ k : Fin N, I k = circleL2Sq (slowBandPolyDerivCircle p) by - simpa [I] using slowBandPolyDeriv_interval_sum_eq_circleL2Sq + simpa only [one_div, mul_inv_rev, I] using slowBandPolyDeriv_interval_sum_eq_circleL2Sq (N := N) (L := L) hN p] exact slowBandPolyDerivCircle_l2_le p have hc_nonneg : 0 <= c := by @@ -3816,7 +3861,7 @@ private theorem slowBandPoly_slope_sq_le_L_cubed_l2 {L : Nat} (sq_sum_le_card_mul_sum_sq (s := S) (f := fun m : Fin L => ‖p m‖ * (m.1 : ℝ)) : _) - simpa [S] using h + simpa only [ge_iff_le, Finset.card_univ, Fintype.card_fin, S] using h have hsum : ∑ m : Fin L, (‖p m‖ * (m.1 : ℝ)) ^ 2 <= (L : ℝ) ^ 2 * ∑ m : Fin L, ‖p m‖ ^ 2 := by @@ -3831,14 +3876,14 @@ private theorem slowBandPoly_slope_sq_le_L_cubed_l2 {L : Nat} intro m hm have hmL : (m.1 : ℝ) <= (L : ℝ) := by exact_mod_cast Nat.le_of_lt m.2 have hm_nonneg : 0 <= (m.1 : ℝ) := by exact_mod_cast Nat.zero_le m.1 - have hL_nonneg : 0 <= (L : ℝ) := by exact_mod_cast Nat.zero_le L - have hsq : (m.1 : ℝ) ^ 2 <= (L : ℝ) ^ 2 := by nlinarith [hm_nonneg, hL_nonneg, hmL] + have hsq : (m.1 : ℝ) ^ 2 <= (L : ℝ) ^ 2 := + pow_le_pow_left₀ hm_nonneg hmL 2 exact mul_le_mul_of_nonneg_left hsq (sq_nonneg ‖p m‖) _ = (L : ℝ) ^ 2 * ∑ m : Fin L, ‖p m‖ ^ 2 := by rw [Finset.mul_sum] congr ext m - ring + ac_rfl have hL_nonneg : 0 <= (L : ℝ) := by exact_mod_cast Nat.zero_le L calc (∑ m : Fin L, ‖p m‖ * (m.1 : ℝ)) ^ 2 @@ -3920,7 +3965,7 @@ private theorem slowBandPoly_carrier_variance_le_measure ‖slowBandPoly p x - slowBandPoly p (carrierBase k)‖ ^ 2 ∂ μCircle := MeasureTheory.integral_nonneg fun x => sq_nonneg _ rw [Real.norm_eq_abs, abs_of_nonneg hnonneg] at hbound - simpa [C] using hbound + simpa only [ge_iff_le, C] using hbound private theorem norm_slowBandPoly_le_sum_norm {L : Nat} (p : Fin L -> ℂ) (x : Circle) : @@ -3942,12 +3987,12 @@ private theorem slowBandPoly_norm_sq_le_L_circleL2Sq {L : Nat} Finset.sum_nonneg fun m hm => norm_nonneg (p m) have hsquare : ‖slowBandPoly p x‖ ^ 2 <= (∑ m : Fin L, ‖p m‖) ^ 2 := by - nlinarith [norm_nonneg (slowBandPoly p x), hsum_nonneg, hnorm] + nlinarith only [norm_nonneg (slowBandPoly p x), hnorm] have hcs : (∑ m : Fin L, ‖p m‖) ^ 2 <= ((Finset.univ : Finset (Fin L)).card : ℝ) * ∑ m : Fin L, ‖p m‖ ^ 2 := by - simpa using + simpa only [Finset.card_univ, Fintype.card_fin] using (sq_sum_le_card_mul_sum_sq (s := (Finset.univ : Finset (Fin L))) (f := fun m : Fin L => ‖p m‖) : _) @@ -4006,7 +4051,7 @@ private theorem bandPoly_setIntegral_norm_sq_le_measure have hnonneg : 0 <= ∫ x in s, ‖bandPoly N p x‖ ^ 2 ∂ μCircle := MeasureTheory.integral_nonneg fun x => sq_nonneg _ rw [Real.norm_eq_abs, abs_of_nonneg hnonneg] at hbound - simpa [C] using hbound + simpa only [ge_iff_le, C] using hbound private theorem carrierAverage_mass_le_slow_l2 {N L : Nat} (k : Fin N) (p : Fin L -> ℂ) : @@ -4066,7 +4111,7 @@ private theorem carrierAverage_mass_le_L_l2 ((L : ℝ) * circleL2Sq (bandPoly N p)) * (N : ℝ)⁻¹ := by have h := bandPoly_setIntegral_norm_sq_le_measure s N p rw [carrierArc_mu_real_eq_inv_nat k] at h - simpa [s] using h + simpa only [ge_iff_le, s] using h have hperiod_nonneg : 0 <= (2 * Real.pi : ℝ) := by positivity have hmul : (2 * Real.pi) * @@ -4084,7 +4129,7 @@ private theorem carrierAverage_mass_le_L_l2 ‖slowBandPoly p x‖ ^ 2 ∂ μCircle := hmass _ <= (2 * Real.pi) * - (((L : ℝ) * circleL2Sq (bandPoly N p)) * (N : ℝ)⁻¹) := by simpa [s] using hmul + (((L : ℝ) * circleL2Sq (bandPoly N p)) * (N : ℝ)⁻¹) := by simpa only [s] using hmul _ = ((2 * Real.pi) / (N : ℝ)) * ((L : ℝ) * circleL2Sq (bandPoly N p)) := by ring @@ -4133,7 +4178,7 @@ private theorem sum_const_invNat_le {N : Nat} (hN : 0 < N) (K : Finset (Fin N)) {a : ℝ} (ha : 0 <= a) : Finset.sum K (fun _k => a * (N : ℝ)⁻¹) <= a := by - have hKle_nat : K.card <= N := by simpa using (Finset.card_le_univ K) + have hKle_nat : K.card <= N := by simpa only [Fintype.card_fin] using (Finset.card_le_univ K) have hKle : (K.card : ℝ) <= (N : ℝ) := by exact_mod_cast hKle_nat have hNpos : (0 : ℝ) < (N : ℝ) := by exact_mod_cast hN have hfrac : (K.card : ℝ) * (N : ℝ)⁻¹ <= 1 := by @@ -4184,7 +4229,7 @@ private theorem sum_slowBandPoly_carrier_variance_le_global have h := slowBandPoly_carrier_variance_le_measure (N := N) (L := L) k p rw [carrierArc_mu_real_eq_inv_nat k] at h - simpa [b, mul_assoc, mul_left_comm, mul_comm] using h + simpa only [mul_comm, mul_assoc, ge_iff_le, b, mul_left_comm] using h have hsum := Finset.sum_le_sum (s := (Finset.univ : Finset (Fin N))) (fun k hk => hpoint k) @@ -4322,7 +4367,7 @@ private theorem have hD : ∑ k ∈ K, Dterm k <= defectSq (lowPoly q) (bandPoly N p) := by simpa [Dterm] using sum_carrier_defect_integrals_le_global_defectSq K q p - have hcoefD : 0 <= 8 * Crot := by nlinarith [Crot_pos] + have hcoefD : 0 <= 8 * Crot := by linarith only [Crot_pos] have hDmul : 8 * Crot * (∑ k ∈ K, Dterm k) <= 8 * Crot * defectSq (lowPoly q) (bandPoly N p) := @@ -4388,7 +4433,7 @@ private theorem sum_goodCarrier_base_mass_le_global_defect_plus_fast_variance_of goodCarrier_base_mass_le_actual_defect_plus_fast_variance_absorbed (q := q) hq p hdelta_pos htheta_nonneg htheta_le htheta_le_small (hgood k hk) (hosc k hk) - simpa [Dterm, Vterm] using h + simpa only [ge_iff_le, Dterm, Vterm] using h have hsplit : ∑ k ∈ K, (8 * Crot * Dterm k + 8 * Crot * Vterm k) = 8 * Crot * (∑ k ∈ K, Dterm k) + @@ -4412,7 +4457,7 @@ private theorem sum_goodCarrier_base_mass_le_global_defect_plus_fast_variance_of ((L : ℝ) ^ 3 * circleL2Sq (slowBandPoly p)) * ((2 * Real.pi) / (N : ℝ)) ^ 2 := hVsubset.trans hVglobal - have hcoef_nonneg : 0 <= 8 * Crot := by nlinarith [Crot_pos] + have hcoef_nonneg : 0 <= 8 * Crot := by linarith only [Crot_pos] have hDmul : 8 * Crot * (∑ k ∈ K, Dterm k) <= 8 * Crot * defectSq (lowPoly q) (bandPoly N p) := @@ -4494,20 +4539,21 @@ private theorem have htheta_le_small : (1 / 64 : ℝ) <= 1 / 64 := le_rfl have htheta_bound : (1 + eps) ^ (polyOfCoeff q).roots.card - 1 <= (1 / 64 : ℝ) := by - simpa [eps] using root_product_theta_bound_one_div_sixtyfour q + simpa only [one_div, Nat.cast_add, Nat.cast_one, mul_inv_rev, tsub_le_iff_right, eps] using + root_product_theta_bound_one_div_sixtyfour q exact sum_goodCarrier_base_mass_le_global_defect_plus_fast_variance_of_root_product_arcLength (D := D) (N := N) (L := L) hN (q := q) hq p hdelta_pos (eps := eps) (theta := (1 / 64 : ℝ)) heps htheta_bound htheta_nonneg htheta_le htheta_le_small K hgood - (by simpa [eps] using harc) + (by simpa only [one_div, Nat.cast_add, Nat.cast_one, mul_inv_rev, eps] using harc) private theorem sum_univ_eq_sdiff_add {α : Type} [Fintype α] [DecidableEq α] (bad : Finset α) (f : α -> ℝ) : ∑ x : α, f x = ∑ x ∈ (Finset.univ \ bad), f x + ∑ x ∈ bad, f x := by - simp_all + simp_all only [Finset.subset_univ, Finset.sum_sdiff_eq_sub, sub_add_cancel] private theorem sum_carrier_average_mass_eq_good_add_bad {D N L : Nat} (q : Fin (D + 1) -> ℂ) (p : Fin L -> ℂ) @@ -4533,7 +4579,7 @@ private theorem sum_carrier_average_mass_eq_good_add_bad ∑ k ∈ badCarrierIndices N (polyOfCoeff q).roots delta, arcLength (carrierArc N k) * ‖carrierAverage (N := N) k (slowBandPoly p)‖ ^ 2 - simp_all + simp_all only [Finset.subset_univ, Finset.sum_sdiff_eq_sub, sub_add_cancel] private theorem slowBandPoly_l2_le_good_bad_average_defect_variance {D N L : Nat} (hN : 0 < N) @@ -4578,7 +4624,7 @@ private theorem slowBandPoly_l2_le_good_bad_average_defect_variance circleL2Sq (slowBandPoly p) = (1 / (2 * Real.pi)) * (∑ k : Fin N, Avg k) + ∑ k : Fin N, V k := by - simpa [Avg, V] using + simpa only [one_div, mul_inv_rev, Avg, V] using slowBandPoly_l2_eq_average_mass_plus_variance (N := N) (L := L) hN p have hsplit : @@ -4590,12 +4636,12 @@ private theorem slowBandPoly_l2_le_good_bad_average_defect_variance ∑ k ∈ G, Avg k <= 8 * Crot * defectSq (lowPoly q) (bandPoly N p) + Cvar * (∑ k ∈ G, V k) := by - simpa [G, Avg, V, Cvar] using + simpa only [one_div, G, Avg, V, Cvar] using sum_goodCarrier_average_mass_le_global_defect_plus_variance_of_root_product_canonical (D := D) (N := N) (L := L) (q := q) hq p hdelta_pos G (fun k hk => goodCarrierIndices_not_bad hk) - (by simpa [G] using harc) + (by simpa only [Nat.cast_add, Nat.cast_one, one_div, mul_inv_rev, G] using harc) have hbad : ∑ k ∈ B, Avg k <= BadBd := by simpa [B, Avg, BadBd] using @@ -4690,7 +4736,7 @@ private theorem slowBandPoly_l2_le_good_bad_average_defect_poincare (1 / (2 * Real.pi)) * (8 * Crot * defectSq (lowPoly q) (bandPoly N p) + Cvar * V + BadBd) + V := by - simpa [V, Cvar, BadBd] using + simpa only [one_div, mul_inv_rev, V, Cvar, BadBd] using slowBandPoly_l2_le_good_bad_average_defect_variance (D := D) (N := N) (L := L) hN (q := q) hq p hdelta_pos harc @@ -4748,10 +4794,10 @@ private theorem circleL2Sq_bandPoly_pos_of_ne_zero by_contra hnone apply hp funext m - simp_all + simp_all only [ne_eq, not_exists, Decidable.not_not, Pi.zero_apply] rcases hex with ⟨m0, hm0⟩ exact Finset.sum_pos' (fun m hm => sq_nonneg _) ⟨m0, Finset.mem_univ _, by - simp_all⟩ + simp_all only [ne_eq, norm_pos_iff, not_false_eq_true, pow_succ_pos]⟩ private theorem lowPoly_zero_case {D L N : Nat} {q : Fin (D + 1) -> ℂ} (p : Fin L -> ℂ) @@ -4760,7 +4806,7 @@ private theorem lowPoly_zero_case {D L N : Nat} circleL2Sq (bandPoly N p) := by subst q unfold defectSq circleL2Sq lowPoly - simp_all + simp_all only [Pi.zero_apply, zero_mul, Finset.sum_const_zero, zero_add, norm_zero, sub_zero] private theorem lowPoly_zero_degree_eq_const (q : Fin (0 + 1) -> ℂ) : @@ -4775,7 +4821,7 @@ private theorem zero_degree_coeff_ne_zero apply hq funext n fin_cases n - simpa using hc + simpa only [Nat.reduceAdd, Fin.zero_eta, Fin.isValue, Pi.zero_apply] using hc private theorem lowPoly_eq_const_of_tail_zero {D : Nat} (q : Fin (D + 1) -> ℂ) @@ -4785,8 +4831,10 @@ private theorem lowPoly_eq_const_of_tail_zero {D : Nat} unfold lowPoly rw [Finset.sum_eq_single (0 : Fin (D + 1))] · simp [circleChar] - · simp_all - · simp_all + · simp_all only [ne_eq, Fin.val_eq_zero_iff, Finset.mem_univ, not_false_eq_true, zero_mul, + implies_true] + · simp_all only [ne_eq, Fin.val_eq_zero_iff, Finset.mem_univ, not_true_eq_false, + Fin.coe_ofNat_eq_mod, Nat.zero_mod, zero_mul, implies_true] private theorem constant_coeff_ne_zero_of_tail_zero {D : Nat} {q : Fin (D + 1) -> ℂ} (hq : q ≠ 0) @@ -4796,7 +4844,7 @@ private theorem constant_coeff_ne_zero_of_tail_zero {D : Nat} apply hq funext n by_cases hn : n.1 = 0 - · simp_all + · simp_all only [ne_eq, Fin.val_eq_zero_iff, Pi.zero_apply] · exact htail n hn private theorem circleL2Sq_const_mul @@ -4867,7 +4915,7 @@ private theorem finite_base_circle_estimate_degree_zero circleL2Sq (bandPoly N p) <= circleConst 0 * defectSq (lowPoly q) (bandPoly N p) := by let c : ℂ := q 0 - have hc : c ≠ 0 := by simpa [c] using zero_degree_coeff_ne_zero hq + have hc : c ≠ 0 := by simpa only [Fin.isValue, ne_eq, c] using zero_degree_coeff_ne_zero hq let b : Fin L -> ℂ := fun m => c⁻¹ * p m have hsep37 : 37 * L <= N := by have hmul : 37 * L <= circleGap 0 * L := @@ -4889,7 +4937,7 @@ private theorem finite_base_circle_estimate_degree_zero have hdef : defectSq (lowPoly q) (bandPoly N p) = ‖c‖ ^ 2 * I := by rw [lowPoly_zero_degree_eq_const q, hP] - simpa [I, c] using defectSq_const_mul_eq_rho c (bandPoly N b) + simpa only [Fin.isValue, I, c] using defectSq_const_mul_eq_rho c (bandPoly N b) have hscaled : circleL2Sq (bandPoly N p) <= 32 * defectSq (lowPoly q) (bandPoly N p) := by calc circleL2Sq (bandPoly N p) = ‖c‖ ^ 2 * circleL2Sq (bandPoly N b) := hleft @@ -4897,7 +4945,7 @@ private theorem finite_base_circle_estimate_degree_zero mul_le_mul_of_nonneg_left hhigh (sq_nonneg ‖c‖) _ = 32 * defectSq (lowPoly q) (bandPoly N p) := by rw [hdef] - ring + ac_rfl have hconst : (32 : ℝ) <= circleConst 0 := thirty_two_le_circleConst 0 exact hscaled.trans @@ -4911,11 +4959,11 @@ private theorem finite_base_circle_estimate_constant_low circleL2Sq (bandPoly N p) <= circleConst D * defectSq (lowPoly q) (bandPoly N p) := by let c : ℂ := q (0 : Fin (D + 1)) - have hc : c ≠ 0 := by simpa [c] using constant_coeff_ne_zero_of_tail_zero hq htail + have hc : c ≠ 0 := by simpa only [ne_eq, c] using constant_coeff_ne_zero_of_tail_zero hq htail let b : Fin L -> ℂ := fun m => c⁻¹ * p m have hN : 1 <= N := by have hgap : 1 <= circleGap D := circleGap_pos D - nlinarith + nlinarith only [hgap, hsep, hL] have hsep37 : 37 * L <= N := by have hmul : 37 * L <= circleGap D * L := Nat.mul_le_mul_right L (circleGap_ge_37 D) @@ -4944,7 +4992,7 @@ private theorem finite_base_circle_estimate_constant_low mul_le_mul_of_nonneg_left hhigh (sq_nonneg ‖c‖) _ = 32 * defectSq (lowPoly q) (bandPoly N p) := by rw [hdef] - ring + ac_rfl have hconst : (32 : ℝ) <= circleConst D := by exact thirty_two_le_circleConst D exact hscaled.trans (mul_le_mul_of_nonneg_right hconst (defectSq_nonneg (lowPoly q) (bandPoly N p))) @@ -4971,7 +5019,7 @@ private theorem badCarrier_term_le_half_l2 have hsep_real' : ((2 * circleBadConst D * B * L : Nat) : ℝ) <= (N : ℝ) := by exact_mod_cast hsep have hsep_real : 2 * A * (L : ℝ) <= (N : ℝ) := by - simpa [A, Nat.cast_mul, mul_assoc, mul_left_comm, mul_comm] using + simpa only [Nat.cast_mul, mul_comm, mul_assoc, Nat.cast_ofNat, A, mul_left_comm] using hsep_real' have hNpos : (0 : ℝ) < (N : ℝ) := by exact_mod_cast hN have hM_nonneg : 0 <= M := by @@ -4983,7 +5031,7 @@ private theorem badCarrier_term_le_half_l2 mul_le_mul_of_nonneg_right hC_le_A hL_nonneg have htwo : 2 * (C * (L : ℝ)) <= (N : ℝ) := by nlinarith rw [div_le_iff₀ hNpos] - nlinarith + linarith only [htwo] have hrearrange : (1 / (2 * Real.pi)) * (C * (((2 * Real.pi) / (N : ℝ)) * ((L : ℝ) * M))) = @@ -4993,7 +5041,7 @@ private theorem badCarrier_term_le_half_l2 (((badCarrierIndices N (polyOfCoeff q).roots delta).card : ℝ) * (((2 * Real.pi) / (N : ℝ)) * ((L : ℝ) * circleL2Sq (bandPoly N p)))) - = (C * (L : ℝ) / (N : ℝ)) * M := by simpa [C, M] using hrearrange + = (C * (L : ℝ) / (N : ℝ)) * M := by simpa only [one_div, mul_inv_rev, C, M] using hrearrange _ <= (1 / 2) * M := mul_le_mul_of_nonneg_right hratio hM_nonneg @@ -5021,31 +5069,33 @@ private theorem circle_variance_ratio_le_one_div_520 (L : ℝ) <= (N : ℝ) := by exact_mod_cast hsep have hNlargeA : 128 * A ^ 2 * (L : ℝ) <= (N : ℝ) := by have htmp : 2 * A * (64 * A) * (L : ℝ) <= (N : ℝ) := by - simpa [A, circleGoodBudget, mul_assoc, mul_left_comm, mul_comm] using + simpa only [mul_comm, mul_left_comm, mul_assoc, circleGoodBudget, Nat.cast_mul, + Nat.cast_ofNat, A] using hsep_real - nlinarith [htmp] + linarith only [htmp] have hKpos : 0 < K := by norm_num [K] have hLpos : (0 : ℝ) < (L : ℝ) := by exact_mod_cast (lt_of_lt_of_le Nat.zero_lt_one hL) have hK_le_A : K * (L : ℝ) <= 128 * A ^ 2 * (L : ℝ) := by - have hsq : ((82 : ℝ) ^ 2) <= A ^ 2 := by nlinarith [hA_ge] + have hsq : ((82 : ℝ) ^ 2) <= A ^ 2 := by nlinarith only [hA_ge] have hcoef : 128 * ((82 : ℝ) ^ 2) <= 128 * A ^ 2 := by nlinarith have hL_nonneg : 0 <= (L : ℝ) := le_of_lt hLpos - exact mul_le_mul_of_nonneg_right (by simpa [K] using hcoef) hL_nonneg + exact mul_le_mul_of_nonneg_right (by simpa only [Nat.ofNat_pos, mul_le_mul_iff_right₀, K] using + hcoef) hL_nonneg have hNlarge : K * (L : ℝ) <= (N : ℝ) := hK_le_A.trans hNlargeA have hNpos : (0 : ℝ) < (N : ℝ) := by nlinarith have hLm1sq : ((L : ℝ) - 1) ^ 2 <= (L : ℝ) ^ 2 := by - nlinarith [sq_nonneg (1 : ℝ), sub_nonneg.mpr (show (1:ℝ) ≤ L by exact_mod_cast hL)] + linarith only [sub_nonneg.mpr (show (1 : ℝ) ≤ L by exact_mod_cast hL)] have hratio : (L : ℝ) ^ 2 / (N : ℝ) ^ 2 <= (1 : ℝ) / K ^ 2 := by field_simp [sq_pos_of_pos hNpos, sq_pos_of_pos hKpos] - nlinarith [hNlarge, sq_nonneg ((N : ℝ) - K * (L : ℝ))] + nlinarith only [hNlarge] have hsmall : ((L : ℝ) - 1) ^ 2 / (N : ℝ) ^ 2 <= (L : ℝ) ^ 2 / (N : ℝ) ^ 2 := div_le_div_of_nonneg_right hLm1sq (sq_nonneg (N : ℝ)) have hpi_sq : Real.pi ^ 2 <= (16 : ℝ) := by - nlinarith [le_of_lt Real.pi_pos, le_of_lt Real.pi_lt_four] + nlinarith only [le_of_lt Real.pi_pos, le_of_lt Real.pi_lt_four] have hcoef : 4 * Real.pi ^ 2 <= (64 : ℝ) := by nlinarith have hratio_nonneg : 0 <= (L : ℝ) ^ 2 / (N : ℝ) ^ 2 := diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/Definitions.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/Definitions.lean index e6e11dd217..495e2700cd 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/Definitions.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/Definitions.lean @@ -20,8 +20,6 @@ module public import Mathlib.Analysis.Fourier.AddCircle public import Mathlib.Data.Nat.Dist public import Mathlib.LinearAlgebra.Complex.FiniteDimensional -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Combinatorics.Matroid.Init /-! # Definitions -/ diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/ImportedAnalyticInputs.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/ImportedAnalyticInputs.lean index dd0267cdcd..7c48ba614c 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/ImportedAnalyticInputs.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/ImportedAnalyticInputs.lean @@ -15,10 +15,6 @@ public import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite.Definitions public import LeanPool.PhaseRetrieval.Constant.Internal.Definitions import LeanPool.PhaseRetrieval.Constant.Internal.HighFreqBandEstimate import LeanPool.PhaseRetrieval.Constant.Internal.LocalCircleEstimate -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Combinatorics.Matroid.Init -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.Tactic.NormNum.Parity /-! # ImportedAnalyticInputs -/ diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/MissingMathlib.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/MissingMathlib.lean index 8d14a9211f..a675a2c6b3 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/MissingMathlib.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite/MissingMathlib.lean @@ -13,8 +13,6 @@ Authors: Susanna Bertolini, Jaume de Dios Pont module public import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite.Definitions -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Combinatorics.Matroid.Init /-! # MissingMathlib -/ diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/BlockLocalization.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/BlockLocalization.lean index ad7ddb3fb8..c2618fcb0a 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/BlockLocalization.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/BlockLocalization.lean @@ -10,10 +10,6 @@ import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite.MissingMathlib import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite1Dimd.ImportedAnalyticInputs import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite1Dimd.ProductBasisAndAnnuli import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermitek.TrueLevelBasis -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Combinatorics.Matroid.Init -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.Tactic.NormNum.Parity /-! # BlockLocalization -/ diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/Definitions.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/Definitions.lean index 6499237c23..1be2ab607e 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/Definitions.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/Definitions.lean @@ -6,8 +6,6 @@ Authors: Susanna Bertolini, Jaume de Dios Pont module public import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite.Definitions -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Combinatorics.Matroid.Init /-! # Definitions -/ diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/DegreeBookkeeping.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/DegreeBookkeeping.lean index 6bfb8630d3..4070699f7a 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/DegreeBookkeeping.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/DegreeBookkeeping.lean @@ -7,10 +7,6 @@ module public import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite1Dimd.Definitions import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite1Dimd.ProductBasisAndAnnuli -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Combinatorics.Matroid.Init -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.Tactic.NormNum.Parity /-! # DegreeBookkeeping -/ diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ImportedAnalyticInputs.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ImportedAnalyticInputs.lean index e1943cbeb9..290754b23e 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ImportedAnalyticInputs.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ImportedAnalyticInputs.lean @@ -8,10 +8,6 @@ module public import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite1Dimd.Definitions import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermitek.BasisLocalization import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermitek.ImportedAnalyticInputs -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Combinatorics.Matroid.Init -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.MeasureTheory.Integral.Pi import Mathlib.Tactic.NormNum.Parity diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ProductAnnulusCircle.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ProductAnnulusCircle.lean index 3a30f2200d..fb8c369c59 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ProductAnnulusCircle.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ProductAnnulusCircle.lean @@ -10,10 +10,6 @@ import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite1Dimd.BlockLocalization import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite1Dimd.DegreeBookkeeping import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite1Dimd.ImportedAnalyticInputs import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite1Dimd.ProductBasisAndAnnuli -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Combinatorics.Matroid.Init -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.Tactic.NormNum.Parity /-! # ProductAnnulusCircle -/ diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ProductBasisAndAnnuli.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ProductBasisAndAnnuli.lean index 1b035ebe6e..bc81ce1c8c 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ProductBasisAndAnnuli.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ProductBasisAndAnnuli.lean @@ -8,10 +8,7 @@ module public import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite1Dimd.Definitions import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite1Dimd.ImportedAnalyticInputs import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermitek.TrueLevelBasis -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Combinatorics.Matroid.Init -import Mathlib.Data.Nat.Factorial.DoubleFactorial +import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace import Mathlib.Tactic.NormNum.Parity /-! # ProductBasisAndAnnuli -/ diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/BasisLocalization.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/BasisLocalization.lean index 6f142908f2..054888dc4e 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/BasisLocalization.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/BasisLocalization.lean @@ -15,10 +15,8 @@ module public import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermitek.TrueLevelBasis import LeanPool.PhaseRetrieval.Constant.Internal.LaplaceFactorial import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite.MissingMathlib -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic import Mathlib.Analysis.SpecialFunctions.PolarCoord -import Mathlib.Combinatorics.Matroid.Init +import Mathlib.MeasureTheory.Integral.Prod import Mathlib.Tactic.NormNum.Parity /-! # BasisLocalization -/ @@ -36,7 +34,7 @@ private theorem hermiteSeries_single (k n : ℕ) : hermiteSeries k (fun m : ℕ => if m = n then (1 : ℂ) else 0) = Phi k n := by funext z unfold hermiteSeries - simp_all + simp_all only [ite_mul, one_mul, zero_mul, tsum_ite_eq] private theorem qkn_zero (k : ℕ) {r : ℝ} (hr : 0 < r) : qkn k 0 r = 1 := by simp [qkn_explicit hr] @@ -59,9 +57,10 @@ private theorem qkn_descFactorial_form exact_mod_cast (Nat.factorial_mul_descFactorial (n := n) (k := j) hjn) have hmul' : (Nat.factorial n : ℝ) = (Nat.descFactorial n j : ℝ) * (Nat.factorial (n - j) : ℝ) := by - simpa [mul_comm] using hmul.symm + simpa only [mul_comm] using hmul.symm have hden : (Nat.factorial (n - j) : ℝ) ≠ 0 := by positivity - simp_all + simp_all only [mem_range, Order.lt_add_one_iff, ne_eq, Nat.cast_eq_zero, not_false_eq_true, + mul_div_cancel_right₀] -- Nat-level coefficient identity for the Charlier recurrence (s = s'+2 case). private theorem charlier_coeff_nat (k n s' : ℕ) : @@ -127,7 +126,9 @@ private theorem Pkn_eval (k n : ℕ) (x : ℝ) : (Finset.sum (Finset.range (k + 1)) (fun j => Polynomial.C (((-1 : ℝ) ^ j) * (Nat.choose k j : ℝ) * (Nat.descFactorial n j : ℝ)) * Polynomial.X ^ (k - j))) = _ - simp_all + simp_all only [map_mul, map_pow, map_neg, map_one, map_natCast, map_sum, + Polynomial.coe_evalRingHom, + Polynomial.eval_X] private theorem Pkn_coeff (k n m : ℕ) : (Pkn k n).coeff m = @@ -139,7 +140,8 @@ private theorem Pkn_coeff (k n m : ℕ) : rw [Polynomial.finsetSum_coeff] refine Finset.sum_congr rfl ?_ intro j hj - simpa [mul_assoc, mul_left_comm, mul_comm] using + simpa only [mul_comm, mul_left_comm, map_mul, map_natCast, map_pow, map_neg, map_one, mul_assoc, + Polynomial.coeff_natCast_mul] using (Polynomial.coeff_C_mul_X_pow (((-1 : ℝ) ^ j) * (Nat.choose k j : ℝ) * (Nat.descFactorial n j : ℝ)) (k - j) m) @@ -161,14 +163,15 @@ private theorem Pkn_coeff_single (k n m : ℕ) : exact hjne hjeq · simp [hmj] · intro hnotmem - simp_all + simp_all only [mem_range, Order.lt_add_one_iff, tsub_le_iff_right, le_add_iff_nonneg_right, + zero_le, not_true_eq_false] · rw [Pkn_coeff] have hmgt : k < m := Nat.lt_of_not_ge hmk rw [Finset.sum_eq_zero] · simp [hmk] · intro j hj by_cases hmj : m = k - j - · simp_all + · simp_all only [tsub_le_iff_right, le_add_iff_nonneg_right, zero_le, not_true_eq_false] · simp [hmj] private theorem Pkn_succ_succ @@ -249,9 +252,19 @@ private theorem Pkn_succ_succ have hak : a = k ∨ a = k + 1 := by omega rcases hak with ha_eq | ha_eq · subst ha_eq - simp_all + simp_all only [add_le_add_iff_left, Nat.one_le_ofNat, lt_add_iff_pos_right, + Order.lt_one_iff, ↓reduceIte, Nat.reduceSubDiff, add_tsub_cancel_left, pow_one, + Nat.choose_one_right, Nat.cast_add, Nat.cast_ofNat, neg_mul, one_mul, neg_add_rev, + Nat.descFactorial_succ, tsub_zero, Nat.descFactorial_zero, mul_one, + le_add_iff_nonneg_right, zero_le, Nat.cast_one, Std.le_refl, tsub_self, pow_zero, + Nat.choose_zero_right, add_le_iff_nonpos_right, nonpos_iff_eq_zero, one_ne_zero, + mul_zero] ring_nf - · simp_all + · simp_all only [Std.le_refl, Order.lt_add_one_iff, le_add_iff_nonneg_right, zero_le, + ↓reduceIte, tsub_self, pow_zero, Nat.choose_zero_right, Nat.cast_one, mul_one, + Nat.descFactorial_zero, add_le_iff_nonpos_right, nonpos_iff_eq_zero, one_ne_zero, + mul_zero, sub_zero, Nat.cast_add, Order.add_one_le_iff, add_lt_iff_neg_left, + not_lt_zero] private theorem qkn_power_split {r : ℝ} @@ -345,7 +358,7 @@ private lemma normSq_finiteHermiteSum_circlePoint circleLeadingFactor k r * (fourier (-(k : ℤ)) (QuotientAddGroup.mk θ : Circle) : ℂ) * finiteCirclePoly k r a (QuotientAddGroup.mk θ : Circle) := by - simpa using + simpa only [fourier_apply, neg_smul, natCast_zsmul] using (finiteHermiteSum_circle (k := k) (a := a) hr (QuotientAddGroup.mk θ : Circle)) have hfour : ‖(fourier (-(k : ℤ)) (QuotientAddGroup.mk θ : Circle) : ℂ)‖ ^ 2 = 1 := by rw [fourier_mk_norm]; norm_num @@ -360,7 +373,8 @@ private lemma integral_addCircle_volume_eq_smul_haar ∫ t : Circle, f t = T • ∫ t : Circle, f t ∂AddCircle.haarAddCircle := by rw [AddCircle.volume_eq_smul_haarAddCircle, integral_smul_measure] have hT_nonneg : 0 ≤ T := by - simpa [T, HermiteLEAN.T] using (show (0 : ℝ) ≤ 2 * Real.pi by positivity) + simpa only [T, HermiteLEAN.T, Nat.ofNat_pos, mul_nonneg_iff_of_pos_left] using + (show (0 : ℝ) ≤ 2 * Real.pi by positivity) simp [ENNReal.toReal_ofReal hT_nonneg] private lemma integral_Ioo_eq_addCircle @@ -405,7 +419,7 @@ private lemma setIntegral_radialStrip_eq_intervalIntegral (j : ℕ) (f : ℝ → rw [MeasureTheory.setIntegral_congr_set hIoiIco_ae, intervalIntegral.integral_of_le (show (j : ℝ) ≤ (((j + 1 : ℕ) : ℝ)) by exact_mod_cast Nat.le_succ j)] - simpa using + simpa only [Nat.cast_add, Nat.cast_one] using (MeasureTheory.setIntegral_congr_set (f := f) (μ := volume) (Ico_ae_eq_Ioc (a := (j : ℝ)) (b := (((j + 1 : ℕ) : ℝ))))) @@ -428,7 +442,7 @@ private lemma continuous_finiteHermiteSumCircle_comp Continuous (fun p : ℝ × ℝ => finiteHermiteSum k a (circlePoint p.1 ((QuotientAddGroup.mk p.2 : Circle)))) := by - simpa [finiteHermiteSum] using + simpa only [finiteHermiteSum, Pi.mul_apply, Function.comp_apply] using (continuous_finsetSum (s := (Finset.univ : Finset (Fin D))) fun n _ => continuous_const.mul ((continuous_Phi k n.1).comp continuous_circlePoint_mk)) @@ -493,7 +507,7 @@ private lemma annulus_polar_indicator_rw intro p hp rcases p with ⟨r, θ⟩ rcases hp with ⟨hrpos, hθ⟩ - have hrpos' : 0 < r := by simpa using hrpos + have hrpos' : 0 < r := by simpa only [Set.mem_Ioi] using hrpos by_cases hrj : r ∈ Set.Ico (j : ℝ) (((j + 1 : ℕ) : ℝ)) · have hann : Complex.polarCoord.symm (r, θ) ∈ annulus j := by change (j : ℝ) ≤ ‖Complex.polarCoord.symm (r, θ)‖ ∧ @@ -512,7 +526,9 @@ private lemma annulus_polar_indicator_rw = finiteHermiteSum k a (circlePoint r ((QuotientAddGroup.mk θ : Circle))) := by rw [← circlePoint_mk_eq_polarCoord_symm] - simp_all + simp_all only [Set.mem_Ioi, Set.mem_Ioo, Nat.cast_add, Nat.cast_one, Set.mem_Ico, + Complex.polarCoord_symm_apply, ofReal_cos, ofReal_sin, Complex.norm_mul, norm_real, + norm_eq_abs, norm_cos_add_sin_mul_I, mul_one, sq_abs] · have hann : Complex.polarCoord.symm (r, θ) ∉ annulus j := by intro hz apply hrj @@ -520,7 +536,10 @@ private lemma annulus_polar_indicator_rw ‖Complex.polarCoord.symm (r, θ)‖ < (((j + 1 : ℕ) : ℝ)) at hz rw [Complex.norm_polarCoord_symm, abs_of_pos hrpos'] at hz exact hz - simp_all + simp_all only [Set.mem_Ioi, Set.mem_Ioo, Nat.cast_add, Nat.cast_one, Set.mem_Ico, not_and, + not_lt, Complex.polarCoord_symm_apply, ofReal_cos, ofReal_sin, not_false_eq_true, + Set.indicator_of_notMem, smul_eq_mul, mul_zero, Set.mem_prod, Set.mem_inter_iff, true_and, + and_self, and_true, implies_true] private lemma annulusIntegralSq_finiteHermiteSum_eq_radial (k : ℕ) @@ -558,14 +577,18 @@ private lemma annulusIntegralSq_finiteHermiteSum_eq_radial (Set.Ioi (0 : ℝ) ∩ Set.Ico (j : ℝ) (((j + 1 : ℕ) : ℝ))) ×ˢ Set.Ioo (-Real.pi) Real.pi := by ext p - simp_all + simp_all only [Complex.polarCoord_symm_apply, ofReal_cos, ofReal_sin, smul_eq_mul, Nat.cast_add, + Nat.cast_one, Set.mem_inter_iff, Set.mem_prod, Set.mem_Ioi, Set.mem_Ico, Set.mem_Ioo, + and_iff_left_iff_imp, and_self, implies_true] rw [hstrip, show (volume : Measure (ℝ × ℝ)) = volume.prod volume from Measure.volume_eq_prod ℝ ℝ] rw [setIntegral_prod _ ((integrableOn_annulus_polar_finiteHermiteSum k a j).mono_set (Set.prod_mono (by - simp_all) + simp_all only [Complex.polarCoord_symm_apply, ofReal_cos, ofReal_sin, smul_eq_mul, + Nat.cast_add, Nat.cast_one, Set.inter_eq_left, Set.inter_subset_right]) (by - simp_all)))] + simp_all only [Complex.polarCoord_symm_apply, ofReal_cos, ofReal_sin, smul_eq_mul, + Nat.cast_add, Nat.cast_one, Set.inter_eq_left, Std.le_refl])))] let srad : Set ℝ := Set.Ioi (0 : ℝ) ∩ Set.Ico (j : ℝ) (((j + 1 : ℕ) : ℝ)) have inner_eq : ∀ r : ℝ, r ∈ srad → @@ -687,7 +710,8 @@ private lemma annulusIntegralSq_Phi_eq |qkn k n r| ^ 2) rw [show circleL2Sq (finiteCirclePoly k r (singleCoeff n)) = ∑ m : Fin (n + 1), ‖singleCoeff n m‖ ^ 2 * |qkn k m.1 r| ^ 2 by - simpa using (finiteCirclePoly_l2_identity (k := k) (r := r) (a := singleCoeff n))] + simpa only [sq_abs] using + (finiteCirclePoly_l2_identity (k := k) (r := r) (a := singleCoeff n))] let n0 : Fin (n + 1) := ⟨n, Nat.lt_succ_self n⟩ have hn0 : n0 ∈ (Finset.univ : Finset (Fin (n + 1))) := by simp [n0] rw [Finset.sum_eq_single_of_mem n0 hn0] @@ -700,7 +724,9 @@ private lemma annulusIntegralSq_Phi_eq apply hne exact Fin.ext hm_eq have hm_zero : singleCoeff n m = 0 := by simp [singleCoeff, hm_ne] - simp_all + simp_all only [Nat.cast_add, Nat.cast_one, le_add_iff_nonneg_right, zero_le_one, Set.uIcc_of_le, + Set.mem_Icc, mem_univ, ne_eq, norm_zero, OfNat.ofNat_ne_zero, not_false_eq_true, zero_pow, + sq_abs, zero_mul] private lemma intervalIntegrable_basisRadialTerm (k n j : ℕ) : @@ -716,7 +742,7 @@ private lemma intervalIntegrable_basisRadialTerm have hcircle0 : Continuous (fun r : ℝ => circlePoint r t0) := by have h := continuous_circlePoint_mk.comp (continuous_id.prodMk (continuous_const (y := (0 : ℝ)))) - simpa [t0, Function.comp_def] using h + simpa only [QuotientAddGroup.mk_zero, id_eq, Function.comp_def, t0] using h have hg : Continuous g := by dsimp [g] have h := continuous_id.mul @@ -763,7 +789,7 @@ private lemma sqrt_sub_le_sub_of_one_le have hdiff_nonneg : 0 ≤ Real.sqrt a - Real.sqrt b := sub_nonneg.mpr (Real.sqrt_le_sqrt hba) have hden : 1 ≤ Real.sqrt a + Real.sqrt b := by have hb_sqrt : 1 ≤ Real.sqrt b := by - simp_all + simp_all only [sub_nonneg, sqrt_le_sqrt_iff, one_le_sqrt] nlinarith [hb_sqrt, Real.sqrt_nonneg a] have hmul : (Real.sqrt a - Real.sqrt b) * (Real.sqrt a + Real.sqrt b) = a - b := by @@ -801,7 +827,7 @@ private lemma monomial_core_pointwise have hfac := FockSPR.exp_phi_le_factorial hm exact (div_le_iff₀ hfact_pos).2 - (by simpa [div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm] using hfac) + (by simpa only [div_eq_mul_inv, one_mul, mul_comm, mul_left_comm, mul_assoc] using hfac) calc r ^ (2 * m + 1) * Real.exp (-r ^ 2) / (Nat.factorial m : ℝ) = Real.exp (FockSPR.phiFunc m r) / (Nat.factorial m : ℝ) := by rw [h_eq] @@ -866,7 +892,7 @@ private theorem phi0_support_zero (k : ℕ) : phi0 k (circlePoint r t) = circleLeadingFactor k r * (fourier (-(k : ℤ)) t : ℂ) * g 0) := by let g : ℕ → ℂ := fun n => if n = 0 then 1 else 0 refine ⟨g, ?_, ?_, ?_⟩ - · simpa [g, phi0] using (hermiteSeries_single k 0).symm + · simpa only [phi0, g] using (hermiteSeries_single k 0).symm · intro n hn simp [g, Nat.ne_of_gt hn] · intro r hr t @@ -956,7 +982,7 @@ private theorem annulusIntegralSq_phi0_eq intro p hp rcases p with ⟨r, θ⟩ rcases hp with ⟨hrpos, hθ⟩ - have hrpos' : 0 < r := by simpa using hrpos + have hrpos' : 0 < r := by simpa only [Set.mem_Ioi] using hrpos by_cases hrj : r ∈ Set.Ico (j : ℝ) (((j + 1 : ℕ) : ℝ)) · have hann : Complex.polarCoord.symm (r, θ) ∈ annulus j := by @@ -988,7 +1014,10 @@ private theorem annulusIntegralSq_phi0_eq ‖Complex.polarCoord.symm (r, θ)‖ < (((j + 1 : ℕ) : ℝ)) at hz rw [Complex.norm_polarCoord_symm, abs_of_pos hrpos'] at hz exact hz - simp_all + simp_all only [fourier_apply, neg_smul, natCast_zsmul, Set.mem_Ioi, Set.mem_Ioo, Nat.cast_add, + Nat.cast_one, Set.mem_Ico, not_and, not_lt, Complex.polarCoord_symm_apply, ofReal_cos, + ofReal_sin, not_false_eq_true, Set.indicator_of_notMem, smul_eq_mul, mul_zero, Set.mem_prod, + Set.mem_inter_iff, true_and, and_self, and_true, implies_true] change (1 / Real.pi) * ∫ p in Complex.polarCoord.target, @@ -1008,7 +1037,10 @@ private theorem annulusIntegralSq_phi0_eq (Set.Ioi (0 : ℝ) ∩ Set.Ico (j : ℝ) (((j + 1 : ℕ) : ℝ))) ×ˢ Set.Ioo (-Real.pi) Real.pi := by ext p - simp_all + simp_all only [fourier_apply, neg_smul, natCast_zsmul, Complex.polarCoord_symm_apply, + ofReal_cos, ofReal_sin, smul_eq_mul, Nat.cast_add, Nat.cast_one, Set.mem_inter_iff, + Set.mem_prod, Set.mem_Ioi, Set.mem_Ico, Set.mem_Ioo, and_iff_left_iff_imp, and_self, + implies_true] rw [hstrip, show (volume : Measure (ℝ × ℝ)) = volume.prod volume from Measure.volume_eq_prod ℝ ℝ, setIntegral_prod _ (integrableOn_annulus_polar_phi0 k j (‖g 0‖ ^ 2))] @@ -1128,7 +1160,9 @@ private theorem annulusIntegralSq_phi0_shell_bound = (‖g 0‖ ^ 2 / (Nat.factorial k : ℝ)) * ((((j + 1 : ℕ) : ℝ) ^ (2 * k + 1))) * Real.exp (-(j : ℝ) ^ 2) := by - simp_all + simp_all only [fourier_apply, neg_smul, natCast_zsmul, Nat.cast_add, Nat.cast_one, + intervalIntegral.integral_const_mul, intervalIntegral.integral_const, add_sub_cancel_left, + smul_eq_mul, one_mul] calc 2 * ∫ r in (j : ℝ)..(((j + 1 : ℕ) : ℝ)), phi0AnnulusIntegrand k (‖g 0‖ ^ 2) r ≤ @@ -1179,7 +1213,7 @@ theorem phi0_localization : rw [hkcast] linarith have hsum : (((j + 1 : ℕ) : ℝ)) ≤ x + (((k + 6 : ℕ) : ℝ)) := by - simpa [Nat.cast_add, Nat.cast_one] using hsum' + simpa only [Nat.cast_add, Nat.cast_one, Nat.cast_ofNat] using hsum' have hk6_ge1_nat : 1 ≤ k + 6 := by omega have hk6_ge1 : (1 : ℝ) ≤ (((k + 6 : ℕ) : ℝ)) := by exact_mod_cast hk6_ge1_nat have hmul : x + (((k + 6 : ℕ) : ℝ)) ≤ (((k + 6 : ℕ) : ℝ)) * (x + 1) := by nlinarith @@ -1189,7 +1223,7 @@ theorem phi0_localization : (((j + 1 : ℕ) : ℝ) ^ m) ≤ ((((k + 6 : ℕ) : ℝ) * (x + 1)) ^ m) := by gcongr _ = ((((k + 6 : ℕ) : ℝ) ^ m)) * ((x + 1) ^ m) := by rw [mul_pow] have hpoly2 : (x + 1) ^ m ≤ 2 ^ (m - 1) * (x ^ m + 1) := by - simpa [add_comm, add_left_comm, add_assoc] using + simpa only [one_pow, add_comm, add_left_comm, add_assoc] using add_pow_le hx_nonneg (show (0 : ℝ) ≤ 1 by norm_num) m have hpoly : (((j + 1 : ℕ) : ℝ) ^ m) ≤ ((((k + 6 : ℕ) : ℝ) ^ m)) * (2 ^ (m - 1)) * (1 + x ^ m) := by @@ -1206,24 +1240,25 @@ theorem phi0_localization : calc annulusIntegralSq (phi0 k) j ≤ (2 * (‖g 0‖ ^ 2 / (Nat.factorial k : ℝ))) * ((((j + 1 : ℕ) : ℝ) ^ m)) * - Real.exp (-(j : ℝ) ^ 2) := by simpa [m] using hshell + Real.exp (-(j : ℝ) ^ 2) := by simpa only [Nat.cast_add, Nat.cast_one, m] using hshell _ ≤ (2 * (‖g 0‖ ^ 2 / (Nat.factorial k : ℝ))) * ((((k + 6 : ℕ) : ℝ) ^ m) * (2 ^ (m - 1)) * (1 + x ^ m)) * Real.exp (-x ^ 2) := by gcongr _ = A * (1 + x ^ m) * Real.exp (-x ^ 2) := by dsimp [A] ring have hgauss : (1 + x ^ m) * Real.exp (-x ^ 2) ≤ Cpoly * Real.exp (-((1 : ℝ) / 2) * x ^ 2) := by - simpa [one_mul] using hCpoly x hx_nonneg + simpa only [one_div, neg_mul, one_mul] using hCpoly x hx_nonneg have hA_nonneg : 0 ≤ A := by positivity calc annulusIntegralSq (phi0 k) j ≤ A * (1 + x ^ m) * Real.exp (-x ^ 2) := hmain _ ≤ A * (Cpoly * Real.exp (-((1 : ℝ) / 2) * x ^ 2)) := by - simpa [mul_assoc] using mul_le_mul_of_nonneg_left hgauss hA_nonneg + simpa only [mul_assoc, one_div, neg_mul] using mul_le_mul_of_nonneg_left hgauss hA_nonneg _ ≤ (A * Cpoly + 1) * Real.exp (-((1 : ℝ) / 2) * x ^ 2) := by have hexp_nonneg : 0 ≤ Real.exp (-((1 : ℝ) / 2) * x ^ 2) := (Real.exp_pos _).le have hcoeff : A * Cpoly ≤ A * Cpoly + 1 := by linarith - simpa [mul_assoc] using mul_le_mul_of_nonneg_right hcoeff hexp_nonneg + simpa only [one_div, neg_mul, ge_iff_le, mul_assoc] using + mul_le_mul_of_nonneg_right hcoeff hexp_nonneg _ = C * Real.exp (-((1 : ℝ) / 2) * x ^ 2) := by rfl _ = C * Real.exp (-((1 : ℝ) / 2) * (posPart ((j : ℝ) - ((k + 5 : ℕ) : ℝ))) ^ 2) := by rfl @@ -1866,7 +1901,7 @@ private lemma Pkn_sq_bound (k n : ℕ) (hkn_strict : k < n) (r : ℝ) {Ak : ℝ} have hkn_cast : (k : ℝ) < (n : ℝ) := by exact_mod_cast hkn_strict simp only [m]; linarith rw [sq, ← Real.rpow_add hm_pos', ← hm_rpow_nat] - simp_all + simp_all only [rpow_natCast, add_halves] have hP_abs_bound := sq_le_sq' (by linarith [abs_nonneg ((Pkn k n).eval (r ^ 2))]) hPkn calc ((Pkn k n).eval (r ^ 2)) ^ 2 @@ -2145,12 +2180,15 @@ private lemma radial_density_eq_step (k : ℕ) (r : ℝ) (hr : 0 ≤ r) (hr_pos have hqkn : r ^ k * qkn k k r = (1 / Real.sqrt (Nat.factorial k : ℝ)) * (Pkn k k).eval (r ^ 2) := by - simpa using qkn_mul_rpow_eq_Pkn_eval k k hr_pos le_rfl + simpa only [one_div, tsub_self, pow_zero, mul_one] using + qkn_mul_rpow_eq_Pkn_eval k k hr_pos le_rfl have hPkn : |(Pkn k k).eval (r ^ 2)| ≤ Ak * (1 + |r ^ 2 - 1|) ^ k := by - simpa [show k - k + 1 = 1 by omega, Real.sqrt_one] using hAk_bound k le_rfl (r ^ 2) + simpa only [sub_self, zero_add, one_rpow, mul_one, sqrt_one, div_one, show k - k + 1 = 1 by + omega, Real.sqrt_one] using hAk_bound k le_rfl (r ^ 2) have hu_bound : 1 + |r ^ 2 - 1| ≤ (1 + |r - 1|) ^ 2 := by - simpa [Real.sqrt_one] using one_plus_abs_u_le_sq 1 (by norm_num) r hr + simpa only [Nat.cast_one, sqrt_one, div_one, Real.sqrt_one] using + one_plus_abs_u_le_sq 1 (by norm_num) r hr have hPkn_sq : ((Pkn k k).eval (r ^ 2)) ^ 2 ≤ Ak ^ 2 * (1 + |r - 1|) ^ (4 * k) := by have hu_pow : (1 + |r ^ 2 - 1|) ^ k ≤ (1 + |r - 1|) ^ (2 * k) := by @@ -2214,7 +2252,7 @@ private lemma radial_density_eq_step (k : ℕ) (r : ℝ) (hr : 0 ≤ r) (hr_pos nlinarith only [show (1 : ℝ) ≤ (Nat.factorial k : ℝ) by exact_mod_cast hfac_ge_one_nat] have htmp : (1 : ℝ) / ((Nat.factorial k : ℝ) ^ 2) ≤ (1 : ℝ) / 1 := one_div_le_one_div_of_le (by positivity : (0 : ℝ) < 1) hfac_sq_ge - simpa using htmp + simpa only [one_div, ge_iff_le, ne_eq, one_ne_zero, not_false_eq_true, div_self] using htmp have hconst_le : Ak ^ 2 * Real.exp 1 * Cp ≤ Ak ^ 2 * C0 * Real.exp 2 * Cp + Ak ^ 2 * Real.exp 1 * Cp + Cp * Real.exp 1 := by @@ -2468,7 +2506,7 @@ private theorem gaussian_rStar_to_posPart (k n : ℕ) (hn : 1 ≤ n) (hkn : k -- m = (n:ℝ)-(k:ℝ)+1. have hm_pos : 1 ≤ m := by dsimp [m] - simp_all + simp_all only [le_add_iff_nonneg_left, sub_nonneg, Nat.cast_le] rcases Nat.eq_zero_or_pos k with rfl | hk · -- k = 0: m = n - 0 + 1 = n + 1. have hm_eq : m = (n : ℝ) + 1 := by dsimp [m]; simp diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/ImportedAnalyticInputs.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/ImportedAnalyticInputs.lean index dcc9dccd2b..12a982eee4 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/ImportedAnalyticInputs.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/ImportedAnalyticInputs.lean @@ -14,10 +14,6 @@ module public import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermitek.TrueLevelBasis import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite.ImportedAnalyticInputs -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Combinatorics.Matroid.Init -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.Tactic.NormNum.Parity /-! # ImportedAnalyticInputs -/ diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/ModulusRigidity.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/ModulusRigidity.lean index aafd7f7fbe..989a1b2fed 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/ModulusRigidity.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/ModulusRigidity.lean @@ -13,9 +13,6 @@ Authors: Susanna Bertolini, Jaume de Dios Pont module public import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermitek.TrueLevelBasis -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Combinatorics.Matroid.Init /-! # ModulusRigidity -/ diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/TrueLevelBasis.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/TrueLevelBasis.lean index 49aa5d5837..ec9c67068b 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/TrueLevelBasis.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/TrueLevelBasis.lean @@ -16,8 +16,6 @@ module public import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite.Definitions import Mathlib.Analysis.Complex.Isometry -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Combinatorics.Matroid.Init import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm import Mathlib.MeasureTheory.Integral.Gamma @@ -171,8 +169,8 @@ private theorem sum_Icc_eq_sum_Fin {α : Type*} [AddCommMonoid α] · intro n hn obtain ⟨hlo, hhi⟩ := Finset.mem_Icc.mp hn refine ⟨⟨n - N, by omega⟩, Finset.mem_univ _, ?_⟩ - simp_all - · simp_all + simp_all only [coe_Icc, Set.mem_Icc, and_self, add_tsub_cancel_of_le] + · simp_all only [mem_univ, imp_self, implies_true] private lemma filter_embedding_eq_singleton {D : ℕ} {α : Type*} [DecidableEq α] (e : Fin D ↪ α) (k : Fin D) : @@ -474,7 +472,7 @@ theorem qkn_structure : /-- The circle coefficients `qkn` remain fixed by complex conjugation. -/ @[simp] theorem qkn_real : ∀ {k n : ℕ} {r : ℝ}, star (qkn k n r : ℂ) = (qkn k n r : ℂ) := by - simp_all + simp_all only [RCLike.star_def, conj_ofReal, implies_true] -- Helper: r ^ (-2 : ℤ) = 1 / r ^ 2 private lemma zpow_neg_two_eq (r : ℝ) : @@ -584,7 +582,13 @@ private lemma qkn_div_rn_bound (k n : ℕ) : apply Finset.sum_le_sum_of_subset_of_nonneg (Finset.erase_subset _ _) intro j _ _ apply div_nonneg - · simp_all + · simp_all only [one_div, inv_pos, sqrt_pos, Nat.cast_pos, mul_nonneg_iff_of_pos_left, + sqrt_div, inv_nonneg, sqrt_nonneg, sqrt_mul, sqrt_inv, sup_le_iff, and_true, pow_pos, + sub_sub_cancel_left, zpow_neg, mem_range, lt_add_iff_pos_left, Order.lt_add_one_iff, + le_inf_iff, zero_le, and_self, pow_zero, Nat.choose_zero_right, Nat.cast_one, mul_one, + tsub_zero, one_mul, CharP.cast_eq_zero, mul_zero, zpow_ofNat, inv_one, + div_self_eq_one₀, ne_eq, Nat.cast_eq_zero, sum_erase_eq_sub, not_false_eq_true, + div_self, mem_erase, Decidable.not_not, zero_le_one] · positivity rw [hdiff, Real.norm_eq_abs, abs_mul, abs_of_nonneg (le_of_lt hc_pos)] calc c * |∑ j ∈ (Finset.range (min k n + 1)).erase 0, S j| @@ -651,7 +655,7 @@ theorem qkn_eventual_lower_bound : intro k n obtain ⟨c₀, hc₀ne, hlim⟩ := qkn_top_term_asymptotic k n have hc₀pos : 0 < ‖(c₀ : ℂ)‖ := by - simp_all + simp_all only [ne_eq, ge_iff_le, norm_real, norm_eq_abs, abs_pos, not_false_eq_true] set ε := ‖(c₀ : ℂ)‖ / 2 with hε_def have hε : 0 < ε := by positivity obtain ⟨R₀, hR₀⟩ := hlim ε hε @@ -741,7 +745,8 @@ theorem qkn_ratio_control : -- ‖qkn n‖ * r ≤ (cn+1)*r^(n+1) ≤ (cn+1)*r^d = C*cd*r^d ≤ C*‖qkn d‖ calc ‖(qkn k n r : ℂ)‖ * r ≤ (cn + 1) * r ^ n * r := by - simp_all + simp_all only [ge_iff_le, norm_real, norm_eq_abs, one_div, ofReal_inv, inv_pos, sqrt_pos, + Nat.cast_pos, sup_le_iff, and_self, ne_eq, ofReal_eq_zero, mul_le_mul_iff_left₀] _ = (cn + 1) * r ^ (n + 1) := by ring _ ≤ (cn + 1) * r ^ d := by apply mul_le_mul_of_nonneg_left @@ -878,7 +883,7 @@ private lemma alternating_vandermonde_coeff (k s N : ℕ) : ((((Polynomial.C (1 : ℤ)) + Polynomial.X) ^ s * Polynomial.X ^ k).coeff N) := alternating_vandermonde_coeff_poly k s N _ = if k ≤ N then (((Polynomial.C (1 : ℤ)) + Polynomial.X) ^ s).coeff (N - k) else 0 := by - simpa using + simpa only [eq_intCast, Int.cast_one] using (Polynomial.coeff_mul_X_pow' (((Polynomial.C (1 : ℤ)) + Polynomial.X) ^ s) k N) _ = if k ≤ N then ↑(s.choose (N - k)) else 0 := by by_cases h : k ≤ N <;> simp [h, Polynomial.coeff_one_add_X_pow] @@ -886,12 +891,14 @@ private lemma alternating_vandermonde_coeff (k s N : ℕ) : private theorem alternating_vandermonde_zero (k s : ℕ) : ∑ j ∈ Finset.range (k + 1), (-1 : ℤ) ^ j * ↑(k.choose j) * ↑((k + s - j).choose k) = 1 := by - simpa [ite_eq_left (Nat.le_refl k)] using alternating_vandermonde_coeff k s k + simpa only [Int.reduceNeg, Std.le_refl, ↓reduceIte, tsub_self, Nat.choose_zero_right, + Nat.cast_one, ite_eq_left (Nat.le_refl k)] using alternating_vandermonde_coeff k s k private theorem alternating_vandermonde_vanish (k s r : ℕ) (hr : r < k) : ∑ j ∈ Finset.range (k + 1), (-1 : ℤ) ^ j * ↑(k.choose j) * ↑((k + s - j).choose r) = 0 := by - simpa [ite_eq_right (Nat.not_le_of_lt hr)] using alternating_vandermonde_coeff k s r + simpa only [Int.reduceNeg, ite_eq_right (Nat.not_le_of_lt hr)] using + alternating_vandermonde_coeff k s r /-! ## Double-sum identity for phi_orthonormal diagonal case -/ @@ -986,7 +993,7 @@ private lemma inner_sum_vanish_pos (k m i : ℕ) Nat.choose (k + (m - i) - j) (k - i) := by intro j; congr 1; omega simp_rw [hrw] rw [alternating_vandermonde_vanish k (m - i) (k - i) (by omega)] - ring + ac_rfl -- The double sum identity -- This is the heaviest combinatorial normalization in the file: @@ -1015,7 +1022,9 @@ private theorem double_sum_vandermonde (k m : ℕ) : have hik : i ≤ k := by simp [Finset.mem_range] at hi; omega by_cases him : i ≤ m · rw [inner_sum_vanish_pos k m i (by omega) hik him]; ring - · simp_all + · simp_all only [mem_range, Order.lt_add_one_iff, Int.reduceNeg, ne_eq, not_le, mul_eq_zero, + not_false_eq_true, pow_eq_zero_iff, neg_eq_zero, one_ne_zero, Int.natCast_eq_zero, false_or, + Nat.descFactorial_eq_zero_iff_lt, or_true, true_or] · intro h; exfalso; exact h (Finset.mem_range.mpr (Nat.zero_lt_succ k)) -- Helper: each monomial term ‖z‖^{2a} * exp(-‖z‖²) is integrable @@ -1303,10 +1312,12 @@ theorem phi_orthonormal : set I := ∫ z, f z have h : -I = I := hint_eq have h2 : I + I = 0 := by nth_rw 1 [← neg_neg I, h]; exact neg_add_cancel I - simp_all + simp_all only [RCLike.star_def, ofReal_exp, ofReal_neg, ofReal_pow, ne_eq, Int.cast_eq_zero, + norm_map, LinearIsometryEquiv.coe_toHomeomorph, add_self_eq_zero] -- Connect to weightedInner unfold weightedInner HermiteLEAN.weightedInner - simp_all + simp_all only [RCLike.star_def, ofReal_exp, ofReal_neg, ofReal_pow, ne_eq, Int.cast_eq_zero, + norm_map, LinearIsometryEquiv.coe_toHomeomorph, one_div, mul_zero] -- Phi_mem_Hk is proved below, after finiteHermiteSum_normSq @@ -1321,7 +1332,7 @@ theorem continuous_Phi (k n : ℕ) : Continuous (Phi k n) := by (((-1 : ℂ) ^ j) * (Nat.choose k j : ℂ) * ((Nat.factorial n : ℂ) / (Nat.factorial (n - j) : ℂ))) * (z ^ (n - j) * (star z) ^ (k - j))) := continuous_const.mul hpow - simpa [mul_assoc] using hterm + simpa only [mul_assoc, RCLike.star_def] using hterm /-- Finite Hermite sums are continuous. -/ private theorem continuous_finiteHermiteSum (k : ℕ) {D : ℕ} (a : Fin D → ℂ) : @@ -1351,8 +1362,8 @@ theorem integrable_weightedDiag (k n : ℕ) : _ = (1 / Real.pi : ℂ) * 0 := by rw [MeasureTheory.integral_undef hfC] _ = 0 := by ring have hone : weightedInner (Phi k n) (Phi k n) = 1 := by - simpa using (phi_orthonormal (k := k) (m := n) (n := n)) - simp_all + simpa only [↓reduceIte] using (phi_orthonormal (k := k) (m := n) (n := n)) + simp_all only [one_ne_zero] theorem integrable_weightedCross (k m n : ℕ) : Integrable (fun z : ℂ => @@ -1395,7 +1406,7 @@ theorem integrable_weightedCross (k m n : ℕ) : _ ≤ (((‖Phi k m z‖ ^ 2 + ‖Phi k n z‖ ^ 2) / 2) * Real.exp (-‖z‖ ^ 2)) := by have hsq : 2 * (‖Phi k m z‖ * ‖Phi k n z‖) ≤ ‖Phi k m z‖ ^ 2 + ‖Phi k n z‖ ^ 2 := by - nlinarith [sq_nonneg (‖Phi k m z‖ - ‖Phi k n z‖)] + linarith only [sq_nonneg (‖Phi k m z‖ - ‖Phi k n z‖)] have hexp_nonneg : 0 ≤ Real.exp (-‖z‖ ^ 2) := by positivity nlinarith _ = g z := by simp [g] @@ -1410,7 +1421,7 @@ private lemma weightedNormSq_eq_re_weightedInner (F : ℂ → ℂ) : = fun z : ℂ => ((‖F z‖ ^ 2 * Real.exp (-‖z‖ ^ 2) : ℝ) : ℂ) := by funext z rw [show F z * (starRingEnd ℂ) (F z) = ((‖F z‖ ^ 2 : ℝ) : ℂ) by - simpa using Complex.mul_conj' (F z)] + simpa only [ofReal_pow] using Complex.mul_conj' (F z)] simp rw [hfun, integral_complex_ofReal] simp @@ -1433,7 +1444,7 @@ private lemma weightedInner_conj_symm (F G : ℂ → ℂ) : congr 1 ext z simp only [map_mul, starRingEnd_self_apply, Complex.conj_ofReal] - ring + ac_rfl private lemma integrable_finiteHermiteSum_weightedCross (k : ℕ) {D n : ℕ} (a : Fin D → ℂ) : @@ -1460,18 +1471,18 @@ private lemma integrable_finiteHermiteSum_weightedCross a m * (Phi k m.1 z * (starRingEnd ℂ) (Phi k n z) * (Real.exp (-‖z‖ ^ 2) : ℂ)) := by refine Finset.sum_congr rfl ?_ intro m hm - ring + ac_rfl rw [hEq] refine MeasureTheory.integrable_finsetSum (Finset.univ : Finset (Fin D)) ?_ intro m hm - simpa [mul_assoc, mul_left_comm, mul_comm] using + simpa only [ofReal_exp, ofReal_neg, ofReal_pow, mul_comm, mul_left_comm, mul_assoc] using (integrable_weightedCross k m.1 n).const_mul (a m) private lemma integrable_truncate_weightedCross (k J n : ℕ) (G : ℂ → ℂ) : Integrable (fun z : ℂ => truncate k J G z * (starRingEnd ℂ) (Phi k n z) * (Real.exp (-‖z‖ ^ 2) : ℂ)) := by - simpa [truncate] using + simpa only [truncate, ofReal_exp, ofReal_neg, ofReal_pow] using (integrable_finiteHermiteSum_weightedCross (k := k) (n := n) (a := fun m : Fin (J + 1) => hermiteCoeff k G m.1)) @@ -1483,8 +1494,8 @@ private theorem weightedInner_add_left_of_integrable (fun z : ℂ => G z * (starRingEnd ℂ) (H z) * (Real.exp (-‖z‖ ^ 2) : ℂ))) : weightedInner (F + G) H = weightedInner F H + weightedInner G H := by have hsum := congrArg (fun t : ℂ => (1 / Real.pi : ℂ) * t) (integral_add hF hG) - simpa [weightedInner, HermiteLEAN.weightedInner, Pi.add_apply, add_mul, mul_add, mul_assoc, - mul_left_comm, mul_comm] using hsum + simpa only [weightedInner, HermiteLEAN.weightedInner, one_div, Pi.add_apply, add_mul, ofReal_exp, + ofReal_neg, ofReal_pow, mul_comm, mul_add, mul_left_comm, mul_assoc] using hsum private theorem weightedInner_finset_sum_left {α : Type*} @@ -1505,7 +1516,8 @@ private theorem weightedInner_finset_sum_left ∀ b ∈ s, Integrable (fun z : ℂ => f b z * (starRingEnd ℂ) (g z) * (Real.exp (-‖z‖ ^ 2) : ℂ)) := by - simp_all + simp_all only [ofReal_exp, ofReal_neg, ofReal_pow, mem_insert, forall_eq_or_imp, + implies_true] have hfa : Integrable (fun z : ℂ => f a z * (starRingEnd ℂ) (g z) * (Real.exp (-‖z‖ ^ 2) : ℂ)) := @@ -1600,9 +1612,10 @@ private lemma weightedInner_finiteHermiteSum_basis Phi k m.1 z * ((starRingEnd ℂ) (Phi k n z) * (Real.exp (-‖z‖ ^ 2) : ℂ))) rw [hconst] - ring_nf + ac_rfl · intro m hm - simpa [mul_assoc] using (integrable_weightedCross k m.1 n).const_mul (a m) + simpa only [ofReal_exp, ofReal_neg, ofReal_pow, mul_assoc] using + (integrable_weightedCross k m.1 n).const_mul (a m) private lemma weightedInner_finiteHermiteSum (k : ℕ) {D : ℕ} (a b : Fin D → ℂ) : @@ -1666,7 +1679,7 @@ private lemma weightedInner_finiteHermiteSum (starRingEnd ℂ) (Phi k m.1 z) * (Real.exp (-‖z‖ ^ 2) : ℂ) := by apply integral_congr_ae filter_upwards with z - ring + ac_rfl exact calc (1 / Real.pi : ℂ) * @@ -1680,7 +1693,7 @@ private lemma weightedInner_finiteHermiteSum ∫ z : ℂ, finiteHermiteSum k a z * ((starRingEnd ℂ) (Phi k m.1 z) * (Real.exp (-‖z‖ ^ 2) : ℂ))) := by - ring + ac_rfl _ = (starRingEnd ℂ) (b m) * ((1 / Real.pi : ℂ) * @@ -1694,7 +1707,7 @@ private lemma weightedInner_finiteHermiteSum intro m hm rfl · intro m hm - simpa [mul_assoc, mul_left_comm, mul_comm] using + simpa only [ofReal_exp, ofReal_neg, ofReal_pow, mul_comm, mul_left_comm, mul_assoc] using (integrable_finiteHermiteSum_weightedCross (k := k) (a := a) (n := m.1)).const_mul ((starRingEnd ℂ) (b m)) @@ -1716,7 +1729,7 @@ theorem finiteHermiteSum_inner : intro x rw [phi_orthonormal] by_cases hxm : x = m - · simp_all + · simp_all only [mem_univ, ↓reduceIte] · have hxval : x.1 ≠ m.1 := by intro hEq exact hxm (Fin.ext hEq) @@ -1724,7 +1737,8 @@ theorem finiteHermiteSum_inner : calc star (b m) * ∑ x : Fin D, a x * weightedInner (Phi k x.1) (Phi k m.1) = star (b m) * ∑ x : Fin D, a x * (if x = m then (1 : ℂ) else 0) := by - simp_all + simp_all only [mem_univ, RCLike.star_def, mul_ite, mul_one, mul_zero, sum_ite_eq', + ↓reduceIte] _ = star (b m) * a m := by simp _ = a m * star (b m) := by ring _ = ∑ n : Fin D, a n * star (b n) := by rfl @@ -1746,7 +1760,7 @@ theorem Phi_mem_Hk (k n : ℕ) : Phi k n ∈ Hk k := by ext m rw [phi_orthonormal] by_cases h : n = m - · simp_all + · simp_all only [↓reduceIte, one_mul] · simp [h, show m ≠ n from Ne.symm h] rw [hterm] exact hasSum_ite_eq n (Phi k n z) @@ -1763,7 +1777,7 @@ theorem weightedNorm_smul (c : ℂ) (G : ℂ → ℂ) : change (1 / Real.pi) * ∫ z : ℂ, ‖(c • G) z‖ ^ 2 * Real.exp (-‖z‖ ^ 2) = ‖c‖ ^ 2 * ((1 / Real.pi) * ∫ z : ℂ, ‖G z‖ ^ 2 * Real.exp (-‖z‖ ^ 2)) rw [hInt, MeasureTheory.integral_const_mul] - ring + ac_rfl have hcsq : √(‖c‖ ^ 2) = ‖c‖ := by rw [Real.sqrt_sq_eq_abs, abs_of_nonneg (norm_nonneg c)] change √(weightedNormSq (c • G)) = ‖c‖ * √(weightedNormSq G) rw [hsq, Real.sqrt_mul (by positivity), hcsq] @@ -1790,7 +1804,7 @@ theorem weightedDefectNorm_smul (c : ℂ) (F0 G : ℂ → ℂ) : change (1 / Real.pi) * ∫ z : ℂ, (modulusDefect (c • F0) (c • G) z) ^ 2 * Real.exp (-‖z‖ ^ 2) = ‖c‖ ^ 2 * ((1 / Real.pi) * ∫ z : ℂ, (modulusDefect F0 G z) ^ 2 * Real.exp (-‖z‖ ^ 2)) rw [hInt, MeasureTheory.integral_const_mul] - ring + ac_rfl have hcsq : √(‖c‖ ^ 2) = ‖c‖ := by rw [Real.sqrt_sq_eq_abs, abs_of_nonneg (norm_nonneg c)] change √(weightedDefectNormSq (c • F0) (c • G)) = ‖c‖ * √(weightedDefectNormSq F0 G) rw [hsq, Real.sqrt_mul (by positivity), hcsq] @@ -1809,7 +1823,7 @@ private lemma weightedInner_finiteHermiteSum_coeff (k : ℕ) {D : ℕ} (a : Fin refine Finset.sum_congr rfl ?_; intro x _ by_cases hx : x = m · subst hx; simp [m] - · have : x.1 ≠ n := fun hEq => hx (Fin.ext (by simpa [m] using hEq)) + · have : x.1 ≠ n := fun hEq => hx (Fin.ext (by simpa only [m] using hEq)) simp [this, hx] _ = a m := by simp simp [m, h] @@ -1877,12 +1891,12 @@ theorem hermiteCoeff_finiteHermiteSum : simp [m] · have hxval : x.1 ≠ n := by intro hEq - exact hx (Fin.ext (by simpa [m] using hEq)) + exact hx (Fin.ext (by simpa only [m] using hEq)) simp [hx, hxval, m] calc ∑ x : Fin D, a x * weightedInner (Phi k x.1) (Phi k n) = ∑ x : Fin D, a x * (if x = m then (1 : ℂ) else 0) := by - simp_all + simp_all only [mul_ite, mul_one, mul_zero, sum_ite_eq', mem_univ, ↓reduceIte] _ = a m := by simp _ = if h' : n < D then a ⟨n, h'⟩ else 0 := by simp [m, h] · have horth0 : ∀ x : Fin D, weightedInner (Phi k x.1) (Phi k n) = 0 := by @@ -1892,7 +1906,8 @@ theorem hermiteCoeff_finiteHermiteSum : intro hEq exact h (hEq ▸ x.isLt) simp [hxne] - simp_all + simp_all only [not_lt, mul_zero, sum_const_zero, right_eq_dite_iff, isEmpty_Prop, + IsEmpty.forall_iff] /-- The zeroth coefficient is the inner product against the lowest basis vector. -/ @[simp] theorem hermiteCoeff_phi0 : @@ -1943,7 +1958,7 @@ private lemma hermiteCoeff_sub_truncate (G z - truncate k J G z) * (starRingEnd ℂ) (Phi k n z) * (Real.exp (-‖z‖ ^ 2) : ℂ) have hT : Integrable fT := by unfold fT - simpa [mul_assoc, mul_left_comm, mul_comm] using + simpa only [ofReal_exp, ofReal_neg, ofReal_pow, mul_comm, mul_left_comm, mul_assoc] using (integrable_truncate_weightedCross k J n G) by_cases hG : Integrable fG · have hEq : @@ -1957,7 +1972,8 @@ private lemma hermiteCoeff_sub_truncate unfold fR fG fT ring _ = (1 / Real.pi : ℂ) * ((∫ z : ℂ, fG z) - ∫ z : ℂ, fT z) := by - simpa [fR, fG, fT] using + simpa only [one_div, ofReal_exp, ofReal_neg, ofReal_pow, mul_eq_mul_left_iff, + inv_eq_zero, ofReal_eq_zero, pi_ne_zero, or_false, fG, fT, fR] using congrArg (fun t : ℂ => (1 / Real.pi : ℂ) * t) (MeasureTheory.integral_sub hG hT) _ = weightedInner G (Phi k n) - weightedInner (truncate k J G) (Phi k n) := by @@ -1967,7 +1983,8 @@ private lemma hermiteCoeff_sub_truncate have htruncate : weightedInner (truncate k J G) (Phi k n) = if h : n < J + 1 then hermiteCoeff k G n else 0 := by - simpa [hermiteCoeff] using (hermiteCoeff_truncate (k := k) (J := J) (G := G) n) + simpa only [Order.lt_add_one_iff, hermiteCoeff, dite_eq_ite] using + (hermiteCoeff_truncate (k := k) (J := J) (G := G) n) have hGcoeff : weightedInner G (Phi k n) = hermiteCoeff k G n := rfl by_cases hn : n < J + 1 · simp [hn, htruncate, hGcoeff] @@ -1980,7 +1997,7 @@ private lemma hermiteCoeff_sub_truncate funext z unfold fR fG fT ring - simp_all + simp_all only [integrable_add_iff_integrable_right', not_true_eq_false] have hzeroG : weightedInner G (Phi k n) = 0 := by change (1 / Real.pi : ℂ) * ∫ z : ℂ, fG z = 0 rw [MeasureTheory.integral_undef hGnot] @@ -1990,13 +2007,13 @@ private lemma hermiteCoeff_sub_truncate change (1 / Real.pi : ℂ) * ∫ z : ℂ, fR z = 0 rw [MeasureTheory.integral_undef hR] ring - simp_all + simp_all only [not_false_eq_true, Order.lt_add_one_iff, dite_eq_ite, ite_self] /-- Every truncation lies in the true level space. -/ theorem truncate_mem_Hk : ∀ (k J : ℕ) (G : ℂ → ℂ), truncate k J G ∈ Hk k := by intro k J G - simpa [truncate] using + simpa only [truncate] using (finiteHermiteSum_mem_Hk k (a := fun n : Fin (J + 1) => hermiteCoeff k G n.1)) /-- Exact finite Parseval identity for Hermite truncations. -/ @@ -2005,7 +2022,7 @@ theorem truncate_normSq : weightedNormSq (truncate k J G) = ∑ n : Fin (J + 1), ‖hermiteCoeff k G n.1‖ ^ 2 := by intro k J G - simpa [truncate_eq_finiteHermiteSum] using + simpa only [truncate_eq_finiteHermiteSum] using (finiteHermiteSum_normSq (k := k) (a := fun n : Fin (J + 1) => hermiteCoeff k G n.1)) /-- Finite Hermite sums admit a finite circle representation. -/ @@ -2035,7 +2052,9 @@ theorem finiteHermiteSum_circle : ∑ n ∈ frequencyBand 0 D, finiteCircleCoeff k r a n * fourier (n : ℤ) t = ∑ n : Fin D, a n * ((qkn k n.1 r : ℂ) * fourier (n.1 : ℤ) t) := by - simpa [HermiteLEAN.frequencyBand, finiteCircleCoeff, mul_assoc, mul_left_comm, mul_comm] + simpa only [HermiteLEAN.frequencyBand, zero_add, finiteCircleCoeff, mul_comm, fourier_apply, + natCast_zsmul, mul_dite, mul_zero, Fin.is_lt, ↓reduceDIte, Fin.eta, mul_left_comm, + mul_assoc] using (sum_Icc_eq_sum_Fin 0 D hDpos (fun n => finiteCircleCoeff k r a n * fourier (n : ℤ) t)) @@ -2049,7 +2068,7 @@ theorem finiteHermiteSum_circle : refine Finset.sum_congr rfl ?_ intro n hn rw [phi_polar (k := k) (n := n.1) (r := r) hr t] - ring + ac_rfl _ = circleLeadingFactor k r * (fourier (-(k : ℤ)) t : ℂ) * ∑ n : Fin D, a n * ((qkn k n.1 r : ℂ) * fourier (n.1 : ℤ) t) := by rw [← Finset.mul_sum] _ = circleLeadingFactor k r * (fourier (-(k : ℤ)) t : ℂ) * finiteCirclePoly k r a t := by @@ -2081,7 +2100,8 @@ theorem finiteCirclePoly_support_pos : intro k D r a h0 ext t have hband : frequencyBand 0 (D + 1) = insert 0 (frequencyBand 1 D) := by - simpa [HermiteLEAN.frequencyBand, Nat.succ_eq_add_one, Nat.succ_sub_one] using + simpa only [HermiteLEAN.frequencyBand, zero_add, add_tsub_cancel_right, add_tsub_cancel_left, + Nat.succ_eq_add_one, Nat.succ_sub_one] using (Finset.insert_Icc_add_one_left_eq_Icc (a := (0 : ℕ)) (b := D) (by omega)).symm change Finset.sum (frequencyBand 0 (D + 1)) (fun n => finiteCircleCoeff k r a n * fourier (n : ℤ) t) = @@ -2127,7 +2147,8 @@ theorem truncate_circle : (fourier (-(k : ℤ)) t : ℂ) * truncCirclePoly k r J G t := by intro k J G r hr t - simpa [truncate, truncCirclePoly_eq_finiteCirclePoly] using + simpa only [truncate, fourier_apply, neg_smul, natCast_zsmul, + truncCirclePoly_eq_finiteCirclePoly] using (finiteHermiteSum_circle (k := k) (D := J + 1) (a := fun n : Fin (J + 1) => hermiteCoeff k G n.1) (r := r) hr t) @@ -2151,8 +2172,8 @@ theorem truncCirclePoly_support_pos : (frequencyBand 1 J) (finiteCircleCoeff k r (fun n : Fin (J + 1) => hermiteCoeff k G n.1)) := by intro k J r G h - have h0 : hermiteCoeff k G 0 = 0 := by simpa [hermiteCoeff_phi0] using h - simpa [truncCirclePoly, h0] using + have h0 : hermiteCoeff k G 0 = 0 := by simpa only [hermiteCoeff_phi0] using h + simpa only [truncCirclePoly, h0] using (finiteCirclePoly_support_pos (k := k) (D := J) (r := r) (a := fun n : Fin (J + 1) => hermiteCoeff k G n.1) h0) @@ -2162,7 +2183,7 @@ theorem truncCirclePoly_l2_identity : circleL2Sq (truncCirclePoly k r J G) = ∑ n : Fin (J + 1), ‖hermiteCoeff k G n.1‖ ^ 2 * |qkn k n.1 r| ^ 2 := by intro k J r G - simpa [truncCirclePoly_eq_finiteCirclePoly] using + simpa only [truncCirclePoly_eq_finiteCirclePoly, sq_abs] using (finiteCirclePoly_l2_identity (k := k) (D := J + 1) (r := r) (a := fun n : Fin (J + 1) => hermiteCoeff k G n.1)) @@ -2177,7 +2198,7 @@ private lemma summable_nat_pow_mul_pow_div_factorial_nonneg (m : ℕ) {x : ℝ} positivity · intro n have hdesc_nat : (n + 1) ^ m ≤ (n + m).descFactorial m := by - simpa [Nat.add_comm, Nat.add_left_comm, Nat.add_assoc] using + simpa only [Nat.add_comm, Nat.add_assoc, add_tsub_cancel_left, Nat.add_left_comm] using (Nat.pow_sub_le_descFactorial (n + m) m) have hpow_real : ((n + m + 1 : ℝ) ^ m) ≤ @@ -2194,7 +2215,7 @@ private lemma summable_nat_pow_mul_pow_div_factorial_nonneg (m : ℕ) {x : ℝ} (Nat.factorial n : ℝ) * (((n + m).descFactorial m : ℕ) : ℝ) = (Nat.factorial (n + m) : ℝ) := by have hfact_nat : (n.factorial * (n + m).descFactorial m) = (n + m).factorial := by - simpa [Nat.add_comm, Nat.add_left_comm, Nat.add_assoc] using + simpa only [Nat.add_comm, add_tsub_cancel_left, Nat.add_left_comm, Nat.add_assoc] using (Nat.factorial_mul_descFactorial (show m ≤ n + m by omega)) exact_mod_cast hfact_nat have hcalc : @@ -2229,7 +2250,7 @@ private lemma summable_nat_pow_mul_pow_div_factorial_nonneg (m : ℕ) {x : ℝ} have hfacne : (Nat.factorial (n + m) : ℝ) ≠ 0 := by positivity field_simp [hfacne] _ = ((m + 1 : ℝ) ^ m * x ^ m) * (x ^ n / (Nat.factorial n : ℝ)) := hcalc - · simpa [pow_add, mul_assoc, mul_left_comm, mul_comm] using + · simpa only [mul_comm, mul_left_comm, pow_add, mul_assoc] using (Real.summable_pow_div_factorial x).mul_left ((m + 1 : ℝ) ^ m * x ^ m) /-- Descending factorial ratios are controlled by a fixed successor power. -/ @@ -2255,8 +2276,10 @@ private lemma choose_partial_sum_le_pow_two (k n : ℕ) : Finset.sum (Finset.range (min k n + 1)) (fun j => (Nat.choose k j : ℝ)) ≤ Finset.sum (Finset.range (k + 1)) (fun j => (Nat.choose k j : ℝ)) := by apply Finset.sum_le_sum_of_subset_of_nonneg - · simp_all - · simp_all + · simp_all only [range_subset_range, add_le_add_iff_right, min_le_iff, Std.le_refl, + true_or] + · simp_all only [mem_range, Order.lt_add_one_iff, le_inf_iff, true_and, not_le, + Nat.cast_nonneg, implies_true] _ = (2 : ℝ) ^ k := by exact_mod_cast Nat.sum_range_choose k /-- Uniform disk majorant for the explicit basis vector `Phi k n`. -/ @@ -2296,7 +2319,7 @@ private lemma phi_norm_le_majorant {k n : ℕ} {R : ℝ} (hR : 1 ≤ R) {z : ℂ _ ≤ (Nat.choose k j : ℝ) * ((n + 1 : ℝ) ^ k) * R ^ n * R ^ k := by gcongr _ = (Nat.choose k j : ℝ) * common := by dsimp [common] - ring + ac_rfl have hsum_bound : Finset.sum S (fun j => ‖term j‖) ≤ Finset.sum S (fun j => (Nat.choose k j : ℝ) * common) := Finset.sum_le_sum (fun j hj => hterm_bound j hj) @@ -2326,7 +2349,7 @@ private lemma phi_norm_le_majorant {k n : ℕ} {R : ℝ} (hR : 1 ≤ R) {z : ℂ _ ≤ ((1 / Real.sqrt ((Nat.factorial k : ℝ) * (Nat.factorial n : ℝ))) : ℝ) * (((2 : ℝ) ^ k) * common) := by gcongr - simpa [S] using choose_partial_sum_le_pow_two k n + simpa only [S] using choose_partial_sum_le_pow_two k n _ = ((2 : ℝ) ^ k * (n + 1 : ℝ) ^ k * R ^ k * R ^ n) / Real.sqrt ((Nat.factorial k : ℝ) * (Nat.factorial n : ℝ)) := by dsimp [common] @@ -2432,8 +2455,7 @@ private lemma integrable_Phi_conj_G_exp {k : ℕ} {G : ℂ → ℂ} (n : ℕ) · filter_upwards with z simp only [norm_mul, Complex.norm_conj, Complex.norm_real, Real.norm_of_nonneg (exp_nonneg _)] - nlinarith [sq_nonneg (‖Phi k n z‖ - ‖G z‖), exp_nonneg (-‖z‖ ^ 2 : ℝ), - sq_abs ‖Phi k n z‖, sq_abs ‖G z‖] + nlinarith only [sq_nonneg (‖Phi k n z‖ - ‖G z‖), exp_nonneg (-‖z‖ ^ 2 : ℝ)] private lemma bessel_truncate_le {k : ℕ} {G : ℂ → ℂ} (hG : G ∈ Hk k) (hInt : Integrable (fun z : ℂ => ‖G z‖ ^ 2 * rexp (-‖z‖ ^ 2))) (J : ℕ) : @@ -2471,7 +2493,7 @@ private lemma bessel_truncate_le {k : ℕ} {G : ℂ → ℂ} (hG : G ∈ Hk k) ↑(rexp (-‖z‖ ^ 2)))) = a n * (∫ z : ℂ, (Phi k (↑n) z * (starRingEnd ℂ) (G z) * ↑(rexp (-‖z‖ ^ 2)))) from MeasureTheory.integral_const_mul _ _] - ring + ac_rfl rw [h1] have h2 : weightedInner (Phi k n.1) G = (starRingEnd ℂ) (weightedInner G (Phi k n.1)) := @@ -2485,7 +2507,7 @@ private lemma bessel_truncate_le {k : ℕ} {G : ℂ → ℂ} (hG : G ∈ Hk k) simp only [a] rw [show hermiteCoeff k G ↑n * (starRingEnd ℂ) (hermiteCoeff k G ↑n) = ((‖hermiteCoeff k G ↑n‖ ^ 2 : ℝ) : ℂ) from by - simpa using Complex.mul_conj' (hermiteCoeff k G ↑n)]; push_cast; ring + simpa only [ofReal_pow] using Complex.mul_conj' (hermiteCoeff k G ↑n)]; push_cast; ring -- Also: ⟨truncate, truncate⟩ = ∑ ‖a_n‖² have hInnerTT : weightedInner (truncate k J G) (truncate k J G) = (∑ n : Fin (J + 1), ‖a n‖ ^ 2 : ℝ) := by @@ -2493,7 +2515,7 @@ private lemma bessel_truncate_le {k : ℕ} {G : ℂ → ℂ} (hG : G ∈ Hk k) rw [finiteHermiteSum_inner]; push_cast refine Finset.sum_congr rfl (fun n _ => ?_) rw [show a n * star (a n) = ((‖a n‖ ^ 2 : ℝ) : ℂ) from by - simpa using Complex.mul_conj' (a n)]; push_cast; ring + simpa only [RCLike.star_def, ofReal_pow] using Complex.mul_conj' (a n)]; push_cast; ring -- From the equalities: ⟨trunc, G⟩ = ⟨trunc, trunc⟩ (= ∑ ‖a_n‖²) have hCrossZero : weightedInner (truncate k J G) G = weightedInner (truncate k J G) (truncate k J G) := by rw [hInnerTG', hInnerTT] @@ -2530,7 +2552,7 @@ private lemma bessel_truncate_le {k : ℕ} {G : ℂ → ℂ} (hG : G ∈ Hk k) show ‖(starRingEnd ℂ) (G z)‖ = ‖G z‖ by simp, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (exp_nonneg _)] _ ≤ ((‖Tfun z‖ ^ 2 + ‖G z‖ ^ 2) / 2) * rexp (-‖z‖ ^ 2) := by - nlinarith [sq_nonneg (‖Tfun z‖ - ‖G z‖), exp_nonneg (-‖z‖ ^ 2 : ℝ)] + nlinarith only [sq_nonneg (‖Tfun z‖ - ‖G z‖), exp_nonneg (-‖z‖ ^ 2 : ℝ)] have hIntLe : ‖∫ z : ℂ, Tfun z * (starRingEnd ℂ) (G z) * (Real.exp (-‖z‖ ^ 2) : ℂ)‖ ≤ ∫ z : ℂ, ((‖Tfun z‖ ^ 2 + ‖G z‖ ^ 2) / 2) * rexp (-‖z‖ ^ 2) := @@ -2550,7 +2572,8 @@ private lemma bessel_truncate_le {k : ℕ} {G : ℂ → ℂ} (hG : G ∈ Hk k) rw [hEq, MeasureTheory.integral_const_mul, MeasureTheory.integral_add hTInt hInt] ring have hpi_norm : ‖(1 / Real.pi : ℂ)‖ = (1 / Real.pi : ℝ) := by - simp_all + simp_all only [ofReal_exp, ofReal_neg, ofReal_pow, ofReal_sum, Complex.norm_mul, + RCLike.norm_conj, one_div, inv_nonneg, norm_inv, norm_real, norm_eq_abs, abs_pi] calc ‖weightedInner Tfun G‖ = ‖(1 / Real.pi : ℂ) * @@ -2565,7 +2588,7 @@ private lemma bessel_truncate_le {k : ℕ} {G : ℂ → ℂ} (hG : G ∈ Hk k) have hReEq : (weightedInner Tfun G).re = weightedNormSq Tfun := by calc (weightedInner Tfun G).re = (weightedInner Tfun Tfun).re := by - simpa [Tfun] using congrArg Complex.re hCrossZero + simpa only [Tfun] using congrArg Complex.re hCrossZero _ = weightedNormSq Tfun := (weightedNormSq_eq_re_weightedInner Tfun).symm have hTle : weightedNormSq Tfun ≤ weightedNormSq G := by have hmid : weightedNormSq Tfun ≤ (weightedNormSq Tfun + weightedNormSq G) / 2 := by @@ -2574,7 +2597,7 @@ private lemma bessel_truncate_le {k : ℕ} {G : ℂ → ℂ} (hG : G ∈ Hk k) _ ≤ ‖weightedInner Tfun G‖ := Complex.re_le_norm _ _ ≤ (weightedNormSq Tfun + weightedNormSq G) / 2 := hInnerNormLe linarith - simpa [Tfun, hReEq] using hTle + simpa only [hReEq, ge_iff_le, Tfun] using hTle /-- The Gaussian-weighted lintegral of `‖F J‖²` equals `π` times its weighted norm square. -/ @@ -2758,9 +2781,10 @@ private lemma hermiteCoeff_parseval_le {k : ℕ} {G : ℂ → ℂ} (hG : G ∈ H (ENNReal.ofReal (Real.pi * weightedNormSq G)).toReal ≤ (ENNReal.ofReal (Real.pi * ∑' n : ℕ, t n)).toReal := (ENNReal.toReal_le_toReal (by simp) (by simp)).2 hBound - simp_all - have hfinal : weightedNormSq G ≤ ∑' n : ℕ, t n := by nlinarith [Real.pi_pos, hpi_mul_le] - simpa [t] using hfinal + simp_all only [norm_nonneg, pow_succ_nonneg, ENNReal.ofReal_mul, ENNReal.ofReal_pow, + ofReal_norm, ENNReal.toReal_ofReal] + have hfinal : weightedNormSq G ≤ ∑' n : ℕ, t n := by nlinarith only [Real.pi_pos, hpi_mul_le] + simpa only [ge_iff_le, t] using hfinal /-- Parseval identity for the canonical Hermite coefficients. -/ theorem hermiteCoeff_parseval : @@ -2828,12 +2852,12 @@ theorem circle_representation : apply tsum_congr intro n simp [c] - ring + ac_rfl rw [htsum, tsum_mul_left] congr 1 apply tsum_congr intro n - ring + ac_rfl /-- Canonical circle representation in terms of `hermiteCoeff`. -/ theorem circle_representation_hermiteCoeff : @@ -2860,12 +2884,12 @@ theorem circle_representation_hermiteCoeff : apply tsum_congr intro n simp [c] - ring + ac_rfl rw [htsum, tsum_mul_left] congr 1 apply tsum_congr intro n - ring + ac_rfl private lemma summable_sq_Phi_eval (k : ℕ) (z : ℂ) : Summable (fun n => ‖Phi k n z‖ ^ 2) := by @@ -2931,10 +2955,10 @@ private lemma summable_sq_qkn (k : ℕ) {r : ℝ} (hr : 0 < r) : norm_mul, mul_pow, hfourn, Complex.norm_real, Real.norm_eq_abs, show ‖circleLeadingFactor k r‖ ^ 2 = c by rfl] - ring_nf + ac_rfl have hsPhi := summable_sq_Phi_eval k (circlePoint r t0) have hsScaled : Summable (fun n => c⁻¹ * (‖Phi k n (circlePoint r t0)‖ ^ 2)) := hsPhi.mul_left c⁻¹ - simp_all + simp_all only [ne_eq, sq_abs, not_false_eq_true, inv_mul_cancel_left₀] /-- Bessel bound for the partial Hermite coefficient squares. -/ private lemma sum_range_sq_hermiteCoeff_le {k : ℕ} {G : ℂ → ℂ} (hG : G ∈ Hk k) : @@ -2997,9 +3021,9 @@ theorem point_eval_bounded : rw [mul_comm] have hu_summable : Summable u := summable_of_sum_range_le (fun n => norm_nonneg _) hu_range have hnorm_series : Summable (fun n : ℕ => ‖hermiteCoeff k G n * Phi k n z‖) := by - simpa [u] using hu_summable + simpa only [Complex.norm_mul, u] using hu_summable have htsum : (∑' n : ℕ, hermiteCoeff k G n * Phi k n z) = G z := by - simpa [hermiteCoeff] using (hG.2 z).tsum_eq + simpa only [hermiteCoeff] using (hG.2 z).tsum_eq calc ‖G z‖ = ‖∑' n : ℕ, hermiteCoeff k G n * Phi k n z‖ := by rw [← htsum] _ ≤ ∑' n : ℕ, u n := by @@ -3022,7 +3046,7 @@ private lemma summable_circleCoeff_norm {k : ℕ} {G : ℂ → ℂ} (hG : G ∈ have hAMGM : ‖hermiteCoeff k G n‖ * |qkn k n r| ≤ (‖hermiteCoeff k G n‖ ^ 2 + |qkn k n r| ^ 2) / 2 := by - nlinarith [sq_nonneg (‖hermiteCoeff k G n‖ - |qkn k n r|)] + linarith only [sq_nonneg (‖hermiteCoeff k G n‖ - |qkn k n r|)] exact hmul.trans hAMGM private lemma summable_circleCoeff_sq {k : ℕ} {G : ℂ → ℂ} (hG : G ∈ Hk k) {r : ℝ} @@ -3037,10 +3061,11 @@ private lemma summable_circleCoeff_sq {k : ℕ} {G : ℂ → ℂ} (hG : G ∈ Hk have hd_le : d n ≤ M := by have hsingle := hd.sum_le_tsum ({n} : Finset ℕ) (fun _ _ => norm_nonneg _) - simpa [M, d] using hsingle + simpa only [Complex.norm_mul, norm_real, norm_eq_abs, ge_iff_le, sum_singleton, M, d] using + hsingle have hd_nonneg : 0 ≤ d n := norm_nonneg _ have hmul : d n * d n ≤ M * d n := mul_le_mul_of_nonneg_right hd_le hd_nonneg - simpa [pow_two, d] using hmul + simpa only [Complex.norm_mul, norm_real, norm_eq_abs, pow_two, ge_iff_le, d] using hmul private lemma truncCirclePoly_eq_sum (k J : ℕ) (r : ℝ) (G : ℂ → ℂ) : truncCirclePoly k r J G = @@ -3057,7 +3082,7 @@ private lemma truncCirclePoly_eq_sum (k J : ℕ) (r : ℝ) (G : ℂ → ℂ) : = ∑ n : Fin (J + 1), finiteCircleCoeff k r (fun n : Fin (J + 1) => hermiteCoeff k G n.1) n.1 * fourier (n.1 : ℤ) t := by - simpa using + simpa only [fourier_apply, natCast_zsmul, zero_add, add_tsub_cancel_right] using (sum_Icc_eq_sum_Fin 0 (J + 1) (Nat.succ_le_succ (Nat.zero_le J)) (fun n => finiteCircleCoeff k r (fun n : Fin (J + 1) => hermiteCoeff k G n.1) n * @@ -3087,11 +3112,12 @@ private lemma summable_circleSeries_terms {k : ℕ} {G : ℂ → ℂ} (hG : G have hmul : ‖hermiteCoeff k G n * (qkn k n r : ℂ) * fourier (n : ℤ) t‖ ≤ ‖hermiteCoeff k G n‖ * |qkn k n r| := by - simp_all [fourier_apply, Circle.norm_coe] + simp_all only [sq_abs, fourier_apply, natCast_zsmul, Complex.norm_mul, norm_real, norm_eq_abs, + Circle.norm_coe, mul_one, Std.le_refl] have hAMGM : ‖hermiteCoeff k G n‖ * |qkn k n r| ≤ (‖hermiteCoeff k G n‖ ^ 2 + |qkn k n r| ^ 2) / 2 := by - nlinarith [sq_nonneg (‖hermiteCoeff k G n‖ - |qkn k n r|)] + linarith only [sq_nonneg (‖hermiteCoeff k G n‖ - |qkn k n r|)] exact hmul.trans hAMGM private lemma truncCirclePoly_tendsto_circleSeries_pointwise {k : ℕ} {G : ℂ → ℂ} (hG : G ∈ Hk k) @@ -3105,12 +3131,13 @@ private lemma truncCirclePoly_tendsto_circleSeries_pointwise {k : ℕ} {G : ℂ have hconv : Filter.Tendsto (fun J => ∑ n ∈ Finset.range J, a n) Filter.atTop (nhds (circleSeries k (hermiteCoeff k G) r t)) := by - simpa [circleSeries, a] using hs.hasSum.tendsto_sum_nat + simpa only [fourier_apply, natCast_zsmul, circleSeries, a] using hs.hasSum.tendsto_sum_nat have hEqFun : (fun J => truncCirclePoly k r J G t) = (fun J => ∑ n ∈ Finset.range (J + 1), a n) := by ext J - simpa [a, Finset.sum_range] using congrFun (truncCirclePoly_eq_sum k J r G) t + simpa only [fourier_apply, natCast_zsmul, sum_range, a, Finset.sum_range] using + congrFun (truncCirclePoly_eq_sum k J r G) t rw [hEqFun] exact hconv.comp (Filter.tendsto_atTop_atTop.mpr (fun b => ⟨b, fun n hn => by omega⟩)) @@ -3247,7 +3274,7 @@ theorem circleSeries_l2_identity : simp [Complex.norm_real, Real.norm_eq_abs] have hAMGM : ‖g n‖ * |qkn k n r| ≤ (‖g n‖ ^ 2 + |qkn k n r| ^ 2) / 2 := by - nlinarith [sq_nonneg (‖g n‖ - |qkn k n r|)] + linarith only [sq_nonneg (‖g n‖ - |qkn k n r|)] exact hmul.trans hAMGM have hc_sq : Summable (fun n => ‖c n‖ ^ 2) := by let d' : ℕ → ℝ := fun n => ‖c n‖ @@ -3428,7 +3455,8 @@ theorem circleSeries_fourierCoeff_hermiteCoeff : intro k G hG r hr n let c : ℕ → ℂ := fun m => hermiteCoeff k G m * (qkn k m r : ℂ) have hc_norm : Summable (fun m => ‖c m‖) := by - simpa [c] using summable_circleCoeff_norm (k := k) (G := G) hG hr + simpa only [Complex.norm_mul, norm_real, norm_eq_abs, c] using + summable_circleCoeff_norm (k := k) (G := G) hG hr have hInt : ∀ m : ℕ, Integrable @@ -3437,21 +3465,24 @@ theorem circleSeries_fourierCoeff_hermiteCoeff : intro m have hcm : Integrable (fun t : Circle => c m * fourier (m : ℤ) t) AddCircle.haarAddCircle := by - simpa [smul_eq_mul, mul_comm] using + simpa only [fourier_apply, natCast_zsmul, mul_comm, smul_eq_mul] using ((MeasureTheory.integrable_const (c m)).fourier_smul (T := T) (m : ℤ)) - simpa [smul_eq_mul, mul_assoc, mul_left_comm, mul_comm] using + simpa only [fourier_apply, neg_smul, natCast_zsmul, mul_comm, mul_assoc, smul_eq_mul, + mul_left_comm] using (hcm.fourier_smul (T := T) (-(n : ℤ))) have hIntNorm : Summable (fun m : ℕ => ∫ t : Circle, ‖fourier (-(n : ℤ)) t * (c m * fourier (m : ℤ) t)‖ ∂AddCircle.haarAddCircle) := by - simp_all [fourier_apply, Circle.norm_coe] + simp_all only [fourier_apply, neg_smul, natCast_zsmul, Complex.norm_mul, Circle.norm_coe, + mul_one, one_mul, integral_const, probReal_univ, smul_eq_mul] have hsCircle : ∀ t : Circle, Summable (fun m : ℕ => c m * fourier (m : ℤ) t) := by intro t refine Summable.of_norm_bounded (g := fun m => ‖c m‖) hc_norm ?_ - simp_all [fourier_apply, Circle.norm_coe] + simp_all only [fourier_apply, neg_smul, natCast_zsmul, Complex.norm_mul, Circle.norm_coe, + mul_one, one_mul, integral_const, probReal_univ, smul_eq_mul, Std.le_refl, implies_true] calc fourierCoeff (circleSeries k (hermiteCoeff k G) r) (n : ℤ) = ∑' m : ℕ, @@ -3482,12 +3513,13 @@ theorem circleSeries_fourierCoeff_hermiteCoeff : · subst m have hfour : fourierCoeff (T := T) (fourier (n : ℤ)) (n : ℤ) = 1 := by - simpa [Pi.single_apply] using + simpa only [Pi.single_eq_same, Pi.single_apply] using congrFun (fourierCoeff_fourier (T := T) (n : ℤ)) (n : ℤ) simp [hfour] · have hfour : fourierCoeff (T := T) (fourier (m : ℤ)) (n : ℤ) = 0 := by - simpa [Pi.single_apply, hm] using + simpa only [ne_eq, Nat.cast_inj, hm, not_false_eq_true, Pi.single_eq_of_ne', + Pi.single_apply] using congrFun (fourierCoeff_fourier (T := T) (m : ℤ)) (n : ℤ) simp [hm, hfour] _ = c n := by simp @@ -3503,7 +3535,8 @@ theorem h_k_expansion_perp_phi0 : g 0 = 0 := by intro k G hG hperp refine ⟨hermiteCoeff k G, hermiteCoeff_expansion (k := k) (G := G) hG, ?_⟩ - simpa [phi0] using (orthogonal_phi0_iff_hermiteCoeff_zero (k := k) (G := G)).mp hperp + simpa only [hermiteCoeff_phi0, phi0] using + (orthogonal_phi0_iff_hermiteCoeff_zero (k := k) (G := G)).mp hperp private lemma sub_truncate_mem_Hk {k : ℕ} {G : ℂ → ℂ} (hG : G ∈ Hk k) (J : ℕ) : (fun z => G z - truncate k J G z) ∈ Hk k := by @@ -3517,8 +3550,9 @@ private lemma sub_truncate_mem_Hk {k : ℕ} {G : ℂ → ℂ} (hG : G ∈ Hk k) (2 : ℝ) * (‖G z‖ ^ 2 * rexp (-‖z‖ ^ 2) + ‖truncate k J G z‖ ^ 2 * rexp (-‖z‖ ^ 2))) := by - simpa [two_mul, mul_add, add_comm, add_left_comm, add_assoc, mul_comm, mul_left_comm, - mul_assoc] using (hG.1.add (integrable_truncate_normSq_exp k J G)).const_mul (2 : ℝ) + simpa only [mul_add, mul_left_comm, two_mul, add_assoc, Pi.add_apply, add_comm, add_left_comm, + mul_comm, mul_assoc] using + (hG.1.add (integrable_truncate_normSq_exp k J G)).const_mul (2 : ℝ) have hExp_aesm : AEStronglyMeasurable (fun z : ℂ => rexp (-‖z‖ ^ 2)) volume := (continuous_neg.comp ((continuous_pow 2).comp continuous_norm)).rexp.aestronglyMeasurable have hmeas : @@ -3536,7 +3570,7 @@ private lemma sub_truncate_mem_Hk {k : ℕ} {G : ℂ → ℂ} (hG : G ∈ Hk k) pow_le_pow_left₀ (norm_nonneg _) hsub 2 have hab : (‖G z‖ + ‖truncate k J G z‖) ^ 2 ≤ 2 * (‖G z‖ ^ 2 + ‖truncate k J G z‖ ^ 2) := by - nlinarith [sq_nonneg (‖G z‖ - ‖truncate k J G z‖)] + linarith only [sq_nonneg (‖G z‖ - ‖truncate k J G z‖)] exact le_trans hsubsq hab have hmul : ‖G z - truncate k J G z‖ ^ 2 * rexp (-‖z‖ ^ 2) ≤ @@ -3711,7 +3745,7 @@ theorem truncate_locally_uniform : have hprod : Summable (fun n => ‖hermiteCoeff k G n‖ * B n) := by refine Summable.of_nonneg_of_le (fun n => by positivity) ?_ ((hcoeff.add hBsq).div_const 2) intro n - nlinarith [sq_nonneg (‖hermiteCoeff k G n‖ - B n)] + linarith only [sq_nonneg (‖hermiteCoeff k G n‖ - B n)] have htail := tendsto_sum_nat_add (fun n => ‖hermiteCoeff k G n‖ * B n) rw [Metric.tendsto_atTop] at htail obtain ⟨J0, hJ0⟩ := htail ε hε @@ -3763,15 +3797,15 @@ theorem truncate_locally_uniform : have hnonneg : 0 ≤ ∑' n : ℕ, ‖hermiteCoeff k G (n + (J + 1))‖ * B (n + (J + 1)) := tsum_nonneg fun n => by positivity - simpa [Real.norm_eq_abs, abs_of_nonneg hnonneg] using hJtail + simpa only [gt_iff_lt, norm_eq_abs, abs_of_nonneg hnonneg, Real.norm_eq_abs] using hJtail have htrunc : truncate k J G z = ∑ n ∈ Finset.range (J + 1), a n := by change ∑ n : Fin (J + 1), hermiteCoeff k G n.1 * Phi k n.1 z = _ rw [Finset.sum_range] - have htsum : (∑' n : ℕ, a n) = G z := by simpa [a, hermiteCoeff] using (hG.2 z).tsum_eq + have htsum : (∑' n : ℕ, a n) = G z := by simpa only [hermiteCoeff, a] using (hG.2 z).tsum_eq have hsplit : ∑ n ∈ Finset.range (J + 1), a n + ∑' n : ℕ, a (n + (J + 1)) = G z := by - simpa [htsum] using hs.sum_add_tsum_nat_add (J + 1) + simpa only [htsum] using hs.sum_add_tsum_nat_add (J + 1) have htail_eq : truncate k J G z - G z = -∑' n : ℕ, a (n + (J + 1)) := by calc @@ -4004,7 +4038,7 @@ private lemma summable_circleCoeff_norm_of_summable {k : ℕ} {h : ℕ → ℂ} have hmul : ‖h n * (qkn k n r : ℂ)‖ ≤ ‖h n‖ * |qkn k n r| := by simp [Complex.norm_real, Real.norm_eq_abs] have hAMGM : ‖h n‖ * |qkn k n r| ≤ (‖h n‖ ^ 2 + |qkn k n r| ^ 2) / 2 := by - nlinarith [sq_nonneg (‖h n‖ - |qkn k n r|)] + linarith only [sq_nonneg (‖h n‖ - |qkn k n r|)] exact hmul.trans hAMGM /-- The explicit circle series of a square-summable coefficient sequence has the expected Fourier @@ -4018,7 +4052,8 @@ private theorem circleSeries_fourierCoeff_of_summable : intro k h hh r hr n let c : ℕ → ℂ := fun m => h m * (qkn k m r : ℂ) have hc_norm : Summable (fun m => ‖c m‖) := by - simpa [c] using summable_circleCoeff_norm_of_summable (k := k) (h := h) hh hr + simpa only [Complex.norm_mul, norm_real, norm_eq_abs, c] using + summable_circleCoeff_norm_of_summable (k := k) (h := h) hh hr have hInt : ∀ m : ℕ, Integrable @@ -4027,20 +4062,23 @@ private theorem circleSeries_fourierCoeff_of_summable : intro m have hcm : Integrable (fun t : Circle => c m * fourier (m : ℤ) t) AddCircle.haarAddCircle := by - simpa [smul_eq_mul, mul_comm] using + simpa only [fourier_apply, natCast_zsmul, mul_comm, smul_eq_mul] using ((MeasureTheory.integrable_const (c m)).fourier_smul (T := T) (m : ℤ)) - simpa [smul_eq_mul, mul_assoc, mul_left_comm, mul_comm] using + simpa only [fourier_apply, neg_smul, natCast_zsmul, mul_comm, mul_assoc, smul_eq_mul, + mul_left_comm] using (hcm.fourier_smul (T := T) (-(n : ℤ))) have hIntNorm : Summable (fun m : ℕ => ∫ t : Circle, ‖fourier (-(n : ℤ)) t * (c m * fourier (m : ℤ) t)‖ ∂AddCircle.haarAddCircle) := by - simp_all [fourier_apply, Circle.norm_coe] + simp_all only [fourier_apply, neg_smul, natCast_zsmul, Complex.norm_mul, Circle.norm_coe, + mul_one, one_mul, integral_const, probReal_univ, smul_eq_mul] have hsCircle : ∀ t : Circle, Summable (fun m : ℕ => c m * fourier (m : ℤ) t) := by intro t refine Summable.of_norm_bounded (g := fun m => ‖c m‖) hc_norm ?_ - simp_all [fourier_apply, Circle.norm_coe] + simp_all only [fourier_apply, neg_smul, natCast_zsmul, Complex.norm_mul, Circle.norm_coe, + mul_one, one_mul, integral_const, probReal_univ, smul_eq_mul, Std.le_refl, implies_true] calc fourierCoeff (circleSeries k h r) (n : ℤ) = ∑' m : ℕ, @@ -4070,11 +4108,12 @@ private theorem circleSeries_fourierCoeff_of_summable : by_cases hm : m = n · subst m have hfour : fourierCoeff (T := T) (fourier (n : ℤ)) (n : ℤ) = 1 := by - simpa [Pi.single_apply] using + simpa only [Pi.single_eq_same, Pi.single_apply] using congrFun (fourierCoeff_fourier (T := T) (n : ℤ)) (n : ℤ) simp [hfour] · have hfour : fourierCoeff (T := T) (fourier (m : ℤ)) (n : ℤ) = 0 := by - simpa [Pi.single_apply, hm] using + simpa only [ne_eq, Nat.cast_inj, hm, not_false_eq_true, Pi.single_eq_of_ne', + Pi.single_apply] using congrFun (fourierCoeff_fourier (T := T) (m : ℤ)) (n : ℤ) simp [hm, hfour] _ = c n := by simp @@ -4099,9 +4138,10 @@ private theorem hermiteSeries_circle_representation_of_summable : intro n have hmul : ‖h n * (qkn k n r : ℂ) * fourier (n : ℤ) t‖ ≤ ‖h n‖ * |qkn k n r| := by - simp_all [fourier_apply, Circle.norm_coe] + simp_all only [sq_abs, fourier_apply, natCast_zsmul, Complex.norm_mul, norm_real, norm_eq_abs, + Circle.norm_coe, mul_one, Std.le_refl] have hAMGM : ‖h n‖ * |qkn k n r| ≤ (‖h n‖ ^ 2 + |qkn k n r| ^ 2) / 2 := by - nlinarith [sq_nonneg (‖h n‖ - |qkn k n r|)] + linarith only [sq_nonneg (‖h n‖ - |qkn k n r|)] exact hmul.trans hAMGM unfold hermiteSeries circleSeries simp_rw [phi_polar (k := k) (r := r) hr t] @@ -4115,12 +4155,12 @@ private theorem hermiteSeries_circle_representation_of_summable : apply tsum_congr intro n simp [c] - ring + ac_rfl rw [htsum, tsum_mul_left] congr 1 apply tsum_congr intro n - ring + ac_rfl /-- The circle leading factor is nonzero on every positive circle. -/ private lemma circleLeadingFactor_fourier_ne_zero {k : ℕ} {r : ℝ} (hr : 0 < r) (t : Circle) : @@ -4130,7 +4170,7 @@ private lemma circleLeadingFactor_fourier_ne_zero {k : ℕ} {r : ℝ} (hr : 0 < · exact Complex.ofReal_ne_zero.mpr <| div_ne_zero (pow_ne_zero k (ne_of_gt hr)) (by positivity : Real.sqrt ((Nat.factorial k : ℕ) : ℝ) ≠ 0) - · simp_all + · simp_all only [neg_smul, natCast_zsmul, ne_eq, Circle.coe_ne_zero, not_false_eq_true] /-- A square-summable Hermite expansion is unique. -/ private theorem hermiteSeries_unique_of_summable : @@ -4146,22 +4186,26 @@ private theorem hermiteSeries_unique_of_summable : have hcircle : circleSeries k a r = circleSeries k b r := by ext t let c : ℂ := circleLeadingFactor k r * (fourier (-(k : ℤ)) t : ℂ) - have hc_ne : c ≠ 0 := by simpa [c] using circleLeadingFactor_fourier_ne_zero (k := k) hr t + have hc_ne : c ≠ 0 := by simpa only [fourier_apply, neg_smul, natCast_zsmul, ne_eq, mul_eq_zero, + Circle.coe_ne_zero, or_false, c] using + circleLeadingFactor_fourier_ne_zero (k := k) hr t have ha_repr := hermiteSeries_circle_representation_of_summable (k := k) (h := a) ha r hr t have hb_repr := hermiteSeries_circle_representation_of_summable (k := k) (h := b) hb r hr t have hz := congrFun hEq (circlePoint r t) have hmain : c * circleSeries k a r t = c * circleSeries k b r t := by calc c * circleSeries k a r t = hermiteSeries k a (circlePoint r t) := by - simpa [c] using ha_repr.symm + simpa only [fourier_apply, neg_smul, natCast_zsmul, c] using ha_repr.symm _ = hermiteSeries k b (circlePoint r t) := by simpa using hz - _ = c * circleSeries k b r t := by simpa [c] using hb_repr + _ = c * circleSeries k b r t := by simpa only [fourier_apply, neg_smul, + natCast_zsmul, c] using + hb_repr exact mul_left_cancel₀ hc_ne hmain have hfour := congrArg (fun f : Circle → ℂ => fourierCoeff f (n : ℤ)) hcircle have ha_coeff := circleSeries_fourierCoeff_of_summable (k := k) (h := a) ha hr n have hb_coeff := circleSeries_fourierCoeff_of_summable (k := k) (h := b) hb hr n have hq_ne_real : qkn k n r ≠ 0 := hnonzero r le_rfl - simp_all + simp_all only [ge_iff_le, ne_eq, mul_eq_mul_right_iff, ofReal_eq_zero, or_false] /-- Fourier inversion: the canonical coefficients of a Hermite series recover the original coefficient sequence. -/ @@ -4211,9 +4255,9 @@ private lemma summable_hermite_eval_mul = ∑ n : Fin (J + 1), ((‖Phi k n z‖ ^ 2 : ℝ) : ℂ) := by refine Finset.sum_congr rfl ?_ intro n hn - simpa [mul_comm] using Complex.mul_conj' (Phi k n z) + simpa only [mul_comm, ofReal_pow] using Complex.mul_conj' (Phi k n z) _ = (S : ℂ) := by - simp_all + simp_all only [ofReal_pow, ofReal_sum] have hSqLe : S ≤ Cz * Real.sqrt S := by have hFz_norm : ‖finiteHermiteSum k a z‖ ≤ Cz * weightedNorm (finiteHermiteSum k a) := heval rw [hFz, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hS_nn, hWN] at hFz_norm @@ -4224,14 +4268,14 @@ private lemma summable_hermite_eval_mul · have hSpos : 0 < S := lt_of_le_of_ne hS_nn (Ne.symm hS0) have hsqrt_pos : 0 < Real.sqrt S := Real.sqrt_pos.2 hSpos have hsqrt_le : Real.sqrt S ≤ Cz := by - have hsqS : Real.sqrt S * Real.sqrt S = S := by nlinarith [Real.sq_sqrt hS_nn] - nlinarith [hSqLe, hsqS, hsqrt_pos] + have hsqS : Real.sqrt S * Real.sqrt S = S := by linarith only [Real.sq_sqrt hS_nn] + nlinarith only [hSqLe, hsqS, hsqrt_pos] have hCz_nn : 0 ≤ Cz := le_trans (by simp [hS_def]) hsqrt_le nlinarith [hsqrt_le, hCz_nn] have hRK_range : ∀ J : ℕ, ∑ n ∈ Finset.range J, ‖Phi k n z‖ ^ 2 ≤ Cz ^ 2 := by intro J by_cases hJ : J = 0 - · simp_all + · simp_all only [range_zero, sum_empty, pow_succ_nonneg] · obtain ⟨J', rfl⟩ := Nat.exists_eq_succ_of_ne_zero hJ calc ∑ n ∈ Finset.range (J' + 1), ‖Phi k n z‖ ^ 2 @@ -4249,7 +4293,7 @@ private lemma summable_hermite_eval_mul have hmul : ‖h n * Phi k n z‖ ≤ ‖h n‖ * ‖Phi k n z‖ := by simp have hAMGM : ‖h n‖ * ‖Phi k n z‖ ≤ (‖h n‖ ^ 2 + ‖Phi k n z‖ ^ 2) / 2 := by - nlinarith [sq_nonneg (‖h n‖ - ‖Phi k n z‖)] + linarith only [sq_nonneg (‖h n‖ - ‖Phi k n z‖)] exact hmul.trans hAMGM /-- Pointwise convergence of finite Hermite sums to the explicit Hermite series. -/ @@ -4263,7 +4307,8 @@ private lemma finiteHermiteSum_tendsto_hermiteSeries have hsumm := summable_hermite_eval_mul k h hbdd hl2 z have hconv : Filter.Tendsto (fun J : ℕ => ∑ n ∈ Finset.range J, h n * Phi k n z) Filter.atTop - (𝓝 (hermiteSeries k h z)) := by simpa [hermiteSeries] using hsumm.hasSum.tendsto_sum_nat + (𝓝 (hermiteSeries k h z)) := by simpa only [hermiteSeries] using + hsumm.hasSum.tendsto_sum_nat have hshift : Filter.Tendsto (fun J : ℕ => J + 1) Filter.atTop Filter.atTop := by simpa using (Filter.tendsto_add_atTop_nat 1) have hconv' := hconv.comp hshift @@ -4350,7 +4395,7 @@ private theorem weightedNormSq_eq_integral_sq_norm_gaussianScale abs_of_nonneg (gaussianWeight_nonneg z)] ring] rw [gaussianWeight_sq] - ring + ac_rfl rw [hEq, MeasureTheory.integral_const_mul] private theorem memLp_two_gaussianScale_of_integrable @@ -4369,7 +4414,7 @@ private theorem memLp_two_gaussianScale_of_integrable abs_of_nonneg (gaussianWeight_nonneg z)] ring] rw [gaussianWeight_sq] - ring + ac_rfl private theorem weightedNorm_eq_lpNorm_gaussianScale {F : ℂ → ℂ} @@ -4386,7 +4431,7 @@ private theorem weightedNorm_eq_lpNorm_gaussianScale change weightedNorm F = (∫ z : ℂ, ‖gaussianScale F z‖ ^ (2 : ℝ)) ^ ((2 : ℝ)⁻¹) have hsq : (∫ z : ℂ, ‖gaussianScale F z‖ ^ (2 : ℝ)) = weightedNormSq F := by - simpa using (weightedNormSq_eq_integral_sq_norm_gaussianScale F).symm + simpa only [rpow_ofNat] using (weightedNormSq_eq_integral_sq_norm_gaussianScale F).symm rw [hsq] unfold weightedNorm HermiteLEAN.weightedNorm rw [Real.sqrt_eq_rpow] @@ -4407,7 +4452,8 @@ private theorem integrable_weightedCross_of_memLp (F z * (starRingEnd ℂ) (G z) * (Real.exp (-‖z‖ ^ 2) : ℂ)))) := by have hint : Integrable (fun z : ℂ => inner ℂ (GLp z) (FLp z)) := by - simpa [FLp, GLp] using MeasureTheory.L2.integrable_inner (𝕜 := ℂ) GLp FLp + simpa only [RCLike.inner_apply, FLp, GLp] using + MeasureTheory.L2.integrable_inner (𝕜 := ℂ) GLp FLp have hEq : (fun z : ℂ => inner ℂ (GLp z) (FLp z)) =ᵐ[volume] (fun z : ℂ => inner ℂ (gaussianScale G z) (gaussianScale F z)) := by @@ -4430,9 +4476,10 @@ private theorem integrable_weightedCross_of_memLp simp [map_mul] ring, hgw] push_cast - ring + ac_rfl have hpi_ne : (Real.pi : ℂ) ≠ 0 := by exact_mod_cast Real.pi_ne_zero - simpa [hpi_ne, mul_assoc, mul_left_comm, mul_comm] using hscaled.const_mul (Real.pi : ℂ) + simpa only [ofReal_exp, ofReal_neg, ofReal_pow, mul_comm, mul_left_comm, one_div, ne_eq, hpi_ne, + not_false_eq_true, mul_inv_cancel_left₀, mul_assoc] using hscaled.const_mul (Real.pi : ℂ) private theorem weightedInner_eq_l2Inner (F G : ℂ → ℂ) @@ -4460,7 +4507,7 @@ private theorem weightedInner_eq_l2Inner simp [map_mul] ring, hgw] push_cast - ring + ac_rfl calc weightedInner F G = ∫ z : ℂ, ((1 / Real.pi : ℂ) * @@ -4475,7 +4522,8 @@ private theorem weightedInner_eq_l2Inner symm exact integral_congr_ae hEq _ = @inner ℂ _ _ GLp FLp := by - simpa [FLp, GLp] using (MeasureTheory.L2.inner_def (𝕜 := ℂ) GLp FLp).symm + simpa only [RCLike.inner_apply, GLp, FLp] using + (MeasureTheory.L2.inner_def (𝕜 := ℂ) GLp FLp).symm private theorem weightedInner_norm_le_of_integrable {F G : ℂ → ℂ} @@ -4539,7 +4587,7 @@ private lemma hermiteSeries_integrable_sq {k : ℕ} (h : ℕ → ℂ) ∫⁻ z : ℂ, ENNReal.ofReal (‖G z‖ ^ 2 * rexp (-‖z‖ ^ 2)) ≤ ENNReal.ofReal (Real.pi * ∑' n : ℕ, t n) := lintegral_normSq_le_pi_mul_of_tendsto hFint hF_tendsto - (fun z => by simpa [F, G] using finiteHermiteSum_tendsto_hermiteSeries k h hbdd hh z) + (fun z => by simpa only [F, G] using finiteHermiteSum_tendsto_hermiteSeries k h hbdd hh z) have hlin_lt_top : ∫⁻ z : ℂ, ENNReal.ofReal (‖G z‖ ^ 2 * rexp (-‖z‖ ^ 2)) < ⊤ := lt_of_le_of_lt hBound ENNReal.ofReal_lt_top @@ -4758,7 +4806,7 @@ private lemma hermiteSeries_truncation_tail_bound {k : ℕ} (h : ℕ → ℂ) (ENNReal.ofReal_le_ofReal_iff (mul_nonneg (le_of_lt Real.pi_pos) htail_nonneg)).1 hBound' have hfinal : weightedNormSq (fun z : ℂ => G z - SJ z) ≤ ∑' m : ℕ, s m := by - nlinarith [Real.pi_pos, hmul_le] + nlinarith only [Real.pi_pos, hmul_le] simpa [hShift] using hfinal /-- The Hermite coefficients of the series `G = hermiteSeries k h` recover the @@ -4777,7 +4825,7 @@ private lemma hermiteSeries_weightedInner_eq {k : ℕ} (h : ℕ → ℂ) simp have hPhi_norm : weightedNorm (Phi k n) = 1 := by unfold weightedNorm HermiteLEAN.weightedNorm - simp_all + simp_all only [sqrt_one] have hPhi_aesm : AEStronglyMeasurable (Phi k n) volume := (continuous_Phi k n).aestronglyMeasurable have hPhi_int : Integrable (fun z : ℂ => ‖Phi k n z‖ ^ 2 * rexp (-‖z‖ ^ 2)) := @@ -4798,7 +4846,7 @@ private lemma hermiteSeries_weightedInner_eq {k : ℕ} (h : ℕ → ℂ) have hJtail := hJ0 (J + 1) (by omega) rw [dist_zero_right] at hJtail have hnonneg : 0 ≤ ∑' m : ℕ, ‖h (m + J + 1)‖ ^ 2 := by exact tsum_nonneg fun m => sq_nonneg _ - simpa [Real.norm_eq_abs, abs_of_nonneg hnonneg] using (abs_lt.mp hJtail).2 + simpa only [gt_iff_lt, Real.norm_eq_abs, abs_of_nonneg hnonneg] using (abs_lt.mp hJtail).2 let SJ : ℂ → ℂ := F J have hSJ_mem : SJ ∈ Hk k := finiteHermiteSum_mem_Hk k (a := fun m : Fin (J + 1) => h m.1) have hSJ_int : Integrable (fun z : ℂ => ‖SJ z‖ ^ 2 * rexp (-‖z‖ ^ 2)) := hSJ_mem.1 @@ -4812,8 +4860,8 @@ private lemma hermiteSeries_weightedInner_eq {k : ℕ} (h : ℕ → ℂ) (2 : ℝ) * (‖G z‖ ^ 2 * rexp (-‖z‖ ^ 2) + ‖SJ z‖ ^ 2 * rexp (-‖z‖ ^ 2))) := by - simpa [two_mul, mul_add, add_comm, add_left_comm, add_assoc, mul_comm, mul_left_comm, - mul_assoc] using (hIntG.add hSJ_int).const_mul (2 : ℝ) + simpa only [mul_comm, mul_add, mul_left_comm, two_mul, add_assoc, Pi.add_apply, add_comm, + add_left_comm, mul_assoc] using (hIntG.add hSJ_int).const_mul (2 : ℝ) have hExp_aesm : AEStronglyMeasurable (fun z : ℂ => rexp (-‖z‖ ^ 2)) volume := (continuous_neg.comp ((continuous_pow 2).comp continuous_norm)).rexp.aestronglyMeasurable have hmeas : @@ -4830,7 +4878,7 @@ private lemma hermiteSeries_weightedInner_eq {k : ℕ} (h : ℕ → ℂ) ‖G z - SJ z‖ ^ 2 ≤ (‖G z‖ + ‖SJ z‖) ^ 2 := pow_le_pow_left₀ (norm_nonneg _) hsub 2 have hab : (‖G z‖ + ‖SJ z‖) ^ 2 ≤ 2 * (‖G z‖ ^ 2 + ‖SJ z‖ ^ 2) := by - nlinarith [sq_nonneg (‖G z‖ - ‖SJ z‖)] + linarith only [sq_nonneg (‖G z‖ - ‖SJ z‖)] exact le_trans hsubsq hab have hmul : ‖G z - SJ z‖ ^ 2 * rexp (-‖z‖ ^ 2) ≤ @@ -4856,12 +4904,12 @@ private lemma hermiteSeries_weightedInner_eq {k : ℕ} (h : ℕ → ℂ) (fun z : ℂ => G z * (starRingEnd ℂ) (Phi k n z) * (Real.exp (-‖z‖ ^ 2) : ℂ)) := by let hG_mem := memLp_two_gaussianScale_of_integrable hG_aesm hIntG let hPhi_mem := memLp_two_gaussianScale_of_integrable hPhi_aesm hPhi_int - simpa [mul_assoc, mul_left_comm, mul_comm] using + simpa only [ofReal_exp, ofReal_neg, ofReal_pow, mul_comm, mul_left_comm, mul_assoc] using integrable_weightedCross_of_memLp G (Phi k n) hG_mem hPhi_mem have hSJ_cross : Integrable (fun z : ℂ => SJ z * (starRingEnd ℂ) (Phi k n z) * (Real.exp (-‖z‖ ^ 2) : ℂ)) := by - simpa [SJ, F, mul_assoc, mul_left_comm, mul_comm] using + simpa only [mul_comm, ofReal_exp, ofReal_neg, ofReal_pow, SJ, F, mul_assoc, mul_left_comm] using integrable_finiteHermiteSum_weightedCross (k := k) (a := fun m : Fin (J + 1) => h m.1) (n := n) have hDiff_cross : @@ -4880,7 +4928,9 @@ private lemma hermiteSeries_weightedInner_eq {k : ℕ} (h : ℕ → ℂ) calc weightedInner G (Phi k n) = weightedInner (fun z : ℂ => SJ z + (G z - SJ z)) (Phi k n) := by - simp_all + simp_all only [gt_iff_lt, ge_iff_le, dist_zero_right, norm_eq_abs, ne_eq, + norm_pos_iff, Order.lt_add_one_iff, ofReal_exp, ofReal_neg, ofReal_pow, + add_sub_cancel] _ = weightedInner SJ (Phi k n) + weightedInner (fun z : ℂ => G z - SJ z) (Phi k n) := hadd have hsmall : @@ -4914,10 +4964,13 @@ private lemma hermiteSeries_weightedInner_eq {k : ℕ} (h : ℕ → ℂ) ‖weightedInner G (Phi k n) - h n‖ / 2 := by have hnorm_le' : ‖weightedInner (fun z : ℂ => G z - SJ z) (Phi k n)‖ ≤ - weightedNorm (fun z : ℂ => G z - SJ z) := by simpa [hPhi_norm] using hnorm_le + weightedNorm (fun z : ℂ => G z - SJ z) := by simpa only [hPhi_norm, mul_one] using + hnorm_le exact lt_of_le_of_lt hnorm_le' hDiff_small linarith - simp_all + simp_all only [gt_iff_lt, ge_iff_le, dist_zero_right, norm_eq_abs, ne_eq, norm_pos_iff, + Order.lt_add_one_iff, ofReal_exp, ofReal_neg, ofReal_pow, add_sub_cancel_left, + lt_self_iff_false] /-- A square-summable Hermite series defines an element of `H_k`. -/ theorem hermiteSeries_mem_Hk : @@ -4939,12 +4992,13 @@ theorem hermiteSeries_mem_Hk : refine ⟨hIntG, ?_⟩ intro z have hs : Summable (fun n => h n * Phi k n z) := summable_hermite_eval_mul k h hbdd hh z - have hsum : HasSum (fun n => h n * Phi k n z) (G z) := by simpa [G, hermiteSeries] using hs.hasSum + have hsum : HasSum (fun n => h n * Phi k n z) (G z) := by simpa only [hermiteSeries, G] using + hs.hasSum have hterm : (fun n => weightedInner G (Phi k n) * Phi k n z) = (fun n => h n * Phi k n z) := by simp_all - simpa [G, hterm] using hsum + simpa only [hterm, G] using hsum /-- The modulus defect is bounded by the perturbation norm. -/ theorem modulusDefect_le_norm (F0 G : ℂ → ℂ) (z : ℂ) : diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/ImportedAnalyticInputs.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/ImportedAnalyticInputs.lean index 427916a5dd..5b8e25d164 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/ImportedAnalyticInputs.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/ImportedAnalyticInputs.lean @@ -13,9 +13,7 @@ public import Mathlib.MeasureTheory.Function.LpSpace.DomAct.Basic public import LeanPool.PhaseRetrieval.DimdPoly.Internal.Definitions public import Mathlib.Analysis.Distribution.SchwartzSpace.Basic import LeanPool.PhaseRetrieval.Constant.Internal.RotationalAveraging -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic import Mathlib.Analysis.Distribution.SchwartzSpace.Fourier -import Mathlib.Combinatorics.Matroid.Init import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm import Mathlib.MeasureTheory.Function.LpSpace.DomAct.Continuous import Mathlib.MeasureTheory.Measure.RegularityCompacts @@ -217,8 +215,8 @@ theorem quotient_mk_injOn_Ioc_zero_period : Set.InjOn (fun t : ℝ => (QuotientAddGroup.mk t : Circle)) (Set.Ioc (0 : ℝ) (2 * Real.pi)) := by intro x hx y hy hxy - have hx0 : x ∈ Set.Ioc (0 : ℝ) (0 + 2 * Real.pi) := by simpa using hx - have hy0 : y ∈ Set.Ioc (0 : ℝ) (0 + 2 * Real.pi) := by simpa using hy + have hx0 : x ∈ Set.Ioc (0 : ℝ) (0 + 2 * Real.pi) := by simpa only [zero_add, Set.mem_Ioc] using hx + have hy0 : y ∈ Set.Ioc (0 : ℝ) (0 + 2 * Real.pi) := by simpa only [zero_add, Set.mem_Ioc] using hy have hx' : AddCircle.equivIoc (2 * Real.pi) (0 : ℝ) (QuotientAddGroup.mk x : Circle) = ⟨x, hx0⟩ := @@ -257,7 +255,9 @@ theorem carrierArc_mk_preimage_image_Ioc_inter_fundamental theorem volume_singleton_circle (x : Circle) : MeasureTheory.volume ({x} : Set Circle) = 0 := by have h := AddCircle.volume_closedBall (T := 2 * Real.pi) (x := x) (ε := 0) - simpa using h + simpa only [Measure.addHaar_singleton, Metric.closedBall_zero, mul_zero, ENNReal.ofReal_min, + Nat.ofNat_nonneg, ENNReal.ofReal_mul, ENNReal.ofReal_ofNat, ENNReal.ofReal_zero, zero_le, + inf_of_le_right] using h theorem μCircle_singleton (x : Circle) : μCircle ({x} : Set Circle) = 0 := by @@ -266,7 +266,7 @@ theorem μCircle_singleton (x : Circle) : rw [AddCircle.volume_eq_smul_haarAddCircle, MeasureTheory.Measure.smul_apply] at hvol rw [smul_eq_mul] at hvol have hcoef : ENNReal.ofReal (2 * Real.pi) ≠ 0 := by simp [ENNReal.ofReal_eq_zero, Real.pi_pos] - simpa [μCircle] using (mul_eq_zero.mp hvol).resolve_left hcoef + simpa only [μCircle, Measure.addHaar_singleton] using (mul_eq_zero.mp hvol).resolve_left hcoef private theorem carrierArc_arcSet_ae_eq_mk_image_Ioc_of_singleton_null {N : Nat} (k : Fin N) (μ : MeasureTheory.Measure Circle) @@ -352,7 +352,7 @@ theorem volume_mk_image_carrierArc_Ioc {N : Nat} (k : Fin N) : ((fun t : ℝ => (QuotientAddGroup.mk t : Circle)) ⁻¹' S) ∩ Set.Ioc (0 : ℝ) (0 + 2 * Real.pi) = Set.Ioc ((carrierArc N k).left) ((carrierArc N k).right) := by - simpa [S] using carrierArc_mk_preimage_image_Ioc_inter_fundamental k + simpa only [zero_add, S] using carrierArc_mk_preimage_image_Ioc_inter_fundamental k rw [hpre_set, Real.volume_Ioc] at hpre dsimp [arcLength] symm @@ -419,7 +419,7 @@ theorem carrierArc_mk_image_Ioc_integral_eq_scaled (f := S.indicator f) have hpre' : (∫ t in F, S.indicator f (QuotientAddGroup.mk t : Circle)) = - ∫ x : Circle, S.indicator f x := by simpa [F] using hpre + ∫ x : Circle, S.indicator f x := by simpa only [zero_add, F] using hpre have hfund_to_A : (∫ t in F, S.indicator f (QuotientAddGroup.mk t : Circle)) = ∫ t in A, f (QuotientAddGroup.mk t : Circle) := by @@ -437,7 +437,7 @@ theorem carrierArc_mk_image_Ioc_integral_eq_scaled have htpre : t ∈ ((fun t : ℝ => (QuotientAddGroup.mk t : Circle)) ⁻¹' S) ∩ F := ⟨htS, htF⟩ - simpa [hpre_set] using htpre + simpa only [hpre_set] using htpre simp [Set.indicator_of_mem htS, Set.indicator_of_mem htA] · have htA : t ∉ A := by intro htA @@ -460,7 +460,9 @@ theorem carrierArc_mk_image_Ioc_integral_eq_scaled Set.Ioc ((carrierArc N k).left) ((carrierArc N k).right), f x ∂ μCircle) = ∫ x in S, f x ∂ μCircle := by rfl - _ = (2 * Real.pi)⁻¹ * ∫ x : Circle, S.indicator f x := by simpa [smul_eq_mul] using hhaar + _ = (2 * Real.pi)⁻¹ * ∫ x : Circle, S.indicator f x := by simpa only [mul_inv_rev, + smul_eq_mul] using + hhaar _ = (2 * Real.pi)⁻¹ * (∫ t in F, S.indicator f (QuotientAddGroup.mk t : Circle)) := by rw [hpre'] _ = (2 * Real.pi)⁻¹ * ∫ t in A, f (QuotientAddGroup.mk t : Circle) := by rw [hfund_to_A] @@ -509,7 +511,7 @@ theorem circleChar_mk (n : Nat) (theta : ℝ) : Circle.coe_exp] rw [← Complex.exp_nat_mul] congr 1 - ring + ac_rfl theorem circleChar_eq_fourier_nat (n : Nat) (x : Circle) : circleChar n x = fourier (n : Int) x := by @@ -730,7 +732,7 @@ private theorem carrierArc_setIntegral_constant_center_lower rw [← hconst] apply MeasureTheory.setIntegral_congr_fun measurableSet_Ioc intro t ht - simpa [q] using + simpa only [q] using (constant_center_defect_eq_norm_sq_rho (c := c) (u := u) (z := circleChar N (QuotientAddGroup.mk t : Circle)) hc).symm @@ -767,7 +769,7 @@ theorem circleIntegral_union_finset (hf : ∀ i, MeasureTheory.IntegrableOn f (arcSet (I i)) μCircle) : ∫ x in (⋃ i, arcSet (I i)), f x ∂ μCircle = ∑ i, arcIntegral (I i) f := by - simpa [arcIntegral] using + simpa only [arcIntegral] using (MeasureTheory.integral_iUnion_fintype (μ := μCircle) (f := f) (s := fun i => arcSet (I i)) (fun i => measurableSet_arcSet (I i)) hdisj hf) @@ -834,11 +836,11 @@ private theorem gamma_d_isOpenPosMeasure (d : Nat) : have hpos : 0 < gaussianDensity d z := by unfold gaussianDensity positivity - simpa [w, ENNReal.ofReal_eq_zero, not_le] using hpos + simpa only [ne_eq, ENNReal.ofReal_eq_zero, not_le, gt_iff_lt, w] using hpos have hball_ne : gammaD d (Metric.ball x r) ≠ 0 := by intro hzero have hzero' : MeasureTheory.volume.withDensity w (Metric.ball x r) = 0 := by - simpa [gammaD, w] using hzero + simpa only [gammaD, w] using hzero have hvol_zero : MeasureTheory.volume ({z : Cd d | w z ≠ 0} ∩ Metric.ball x r) = 0 := (MeasureTheory.withDensity_apply_eq_zero hw_meas).1 hzero' @@ -847,7 +849,7 @@ private theorem gamma_d_isOpenPosMeasure (d : Nat) : ext z simp [hw_ne_zero z] have hball_vol_zero : MeasureTheory.volume (Metric.ball x r) = 0 := by - simpa [hball_eq] using hvol_zero + simpa only [ne_eq, hball_eq] using hvol_zero exact (Metric.measure_ball_pos (MeasureTheory.volume : MeasureTheory.Measure (Cd d)) x hr).ne' hball_vol_zero exact fun hzero => hball_ne (MeasureTheory.measure_mono_null hball hzero) @@ -1119,7 +1121,7 @@ private theorem schwartzApproxRealVec_tendsto_lpNorm_sub_zero {d : Nat} atTop (nhds 0) := by have hε : Tendsto (fun n : Nat => 1 / ((n : ℝ) + 1)) atTop (nhds 0) := by - simpa using + simpa only [one_div] using (tendsto_one_div_add_atTop_nhds_zero_nat : Tendsto (fun n : Nat => 1 / ((n : ℝ) + 1)) atTop (nhds 0)) exact squeeze_zero (fun _ => MeasureTheory.lpNorm_nonneg) @@ -1140,7 +1142,7 @@ private theorem schwartzApproxRealVec_tendsto_lpNorm {d : Nat} rw [tendsto_iff_dist_tendsto_zero] have hε : Tendsto (fun n : Nat => 1 / ((n : ℝ) + 1)) atTop (nhds 0) := by - simpa using + simpa only [one_div] using (tendsto_one_div_add_atTop_nhds_zero_nat : Tendsto (fun n : Nat => 1 / ((n : ℝ) + 1)) atTop (nhds 0)) have hbound : @@ -1174,11 +1176,11 @@ private theorem schwartzApproxRealVec_tendsto_lpNorm {d : Nat} _ ≤ MeasureTheory.lpNorm (schwartzApproxRealVec hf n : RealVec d -> ℂ) 2 μ + 1 / ((n : ℝ) + 1) := by gcongr - simpa [MeasureTheory.lpNorm_sub_comm] using + simpa only [lpNorm_sub_comm, one_div, MeasureTheory.lpNorm_sub_comm] using schwartzApproxRealVec_lpNorm_sub_le hf n rw [abs_sub_le_iff] constructor <;> linarith - simpa [Real.dist_eq, μ] using squeeze_zero (fun _ => abs_nonneg _) hbound hε + simpa only [Real.dist_eq, μ] using squeeze_zero (fun _ => abs_nonneg _) hbound hε private theorem schwartzApproxRealVec_toLp_tendsto {d : Nat} (f : L2Real d) : Tendsto @@ -1217,9 +1219,9 @@ private theorem schwartzApproxRealVec_toLp_tendsto {d : Nat} (f : L2Real d) : MeasureTheory.lpNorm ((schwartzApproxRealVec hf n : RealVec d -> ℂ) - (f : RealVec d -> ℂ)) 2 μ) atTop (nhds 0) := by - simpa [MeasureTheory.lpNorm_sub_comm, hf, μ] using + simpa only [lpNorm_sub_comm, MeasureTheory.lpNorm_sub_comm, hf, μ] using schwartzApproxRealVec_tendsto_lpNorm_sub_zero hf - simpa [hdist, hf, μ] using hraw + simpa only [hdist, hf, μ] using hraw /-- `IsL2Rep`: Is L2 Rep. -/ def IsL2Rep {d : Nat} (f : L2Real d) (fRep : RealVec d -> ℂ) : Prop := @@ -1236,13 +1238,15 @@ theorem translateL2_coeFn {d : Nat} (a : RealVec d) (f : L2Real d) : =ᵐ[(MeasureTheory.volume : MeasureTheory.Measure (RealVec d))] fun t => (f : RealVec d -> ℂ) (t + a) := by filter_upwards [DomAddAct.vadd_Lp_ae_eq (DomAddAct.mk a) f] with t ht - simpa [translateL2, vadd_eq_add, add_comm] using ht + simpa only [translateL2, DomAddAct.vadd_Lp_val, add_comm, Equiv.symm_apply_apply, + vadd_eq_add] using + ht theorem translateL2_neg_coeFn {d : Nat} (a : RealVec d) (f : L2Real d) : ((translateL2 (-a) f : L2Real d) : RealVec d -> ℂ) =ᵐ[(MeasureTheory.volume : MeasureTheory.Measure (RealVec d))] fun t => (f : RealVec d -> ℂ) (t - a) := by - simpa [sub_eq_add_neg] using translateL2_coeFn (-a) f + simpa only [sub_eq_add_neg] using translateL2_coeFn (-a) f theorem norm_translateL2 {d : Nat} (a : RealVec d) (f : L2Real d) : ‖translateL2 a f‖ = ‖f‖ := by simp [translateL2] @@ -1285,7 +1289,8 @@ private theorem star_modulationPhase {d : Nat} (ω t : RealVec d) : star (modulationPhase ω t) = modulationPhase (-ω) t := by unfold modulationPhase rw [Complex.star_def, ← Complex.exp_conj] - have htwo : (starRingEnd ℂ) (2 : ℂ) = 2 := by simpa using (Complex.conj_ofReal (2 : ℝ)) + have htwo : (starRingEnd ℂ) (2 : ℂ) = 2 := by simpa only [Complex.ofReal_ofNat] using + (Complex.conj_ofReal (2 : ℝ)) simp [inner_neg_left, htwo, mul_assoc, mul_comm, mul_left_comm] private theorem modulationPhase_neg_inv {d : Nat} (ω a : RealVec d) : @@ -1338,8 +1343,10 @@ theorem fourier_translate_realVec {d : Nat} (a : RealVec d) (f : RealVec d -> VectorFourier.fourierIntegral Real.fourierChar volume (innerₗ (RealVec d)) f ω have hω := congrFun h ω simp only [Function.comp_def] at hω - simpa [modulationPhase, Real.fourierChar_apply, sub_eq_add_neg, Circle.smul_def, mul_assoc, - mul_left_comm, mul_comm] using hω + simpa only [sub_eq_add_neg, modulationPhase, mul_comm, mul_neg, neg_mul, mul_assoc, map_neg, + LinearMap.neg_apply, innerₗ_apply_apply, Circle.smul_def, Real.fourierChar_apply, + Complex.ofReal_neg, Complex.ofReal_mul, Complex.ofReal_ofNat, smul_eq_mul, mul_left_comm] using + hω private theorem sub_const_hasTemperateGrowth {d : Nat} (a : RealVec d) : (fun x : RealVec d => x - a).HasTemperateGrowth := by fun_prop @@ -1368,7 +1375,7 @@ theorem fourier_schwartzCompSubConstCLM_realVec {d : Nat} fun ω : RealVec d => modulationPhase a ω * FourierTransform.fourier (f : RealVec d -> ℂ) ω := by ext ω - simpa [schwartzCompSubConstCLM_apply, Function.comp_def] using + simpa only [schwartzCompSubConstCLM_apply, Function.comp_def] using congrFun (fourier_translate_realVec a (f : RealVec d -> ℂ) f.integrable) ω private def stftWindowSchwartz {d : Nat} (x : RealVec d) @@ -1406,7 +1413,7 @@ private theorem stftRep_schwartz_eq_fourier_apply {d : Nat} (h.toLp 2 (MeasureTheory.volume : MeasureTheory.Measure (RealVec d)) : RealVec d -> ℂ) (t - x)) =ᵐ[(MeasureTheory.volume : MeasureTheory.Measure (RealVec d))] fun t : RealVec d => h (t - x) := by - simpa [Function.comp_def] using + simpa only [Function.comp_def] using (MeasureTheory.measurePreserving_sub_right (MeasureTheory.volume : MeasureTheory.Measure (RealVec d)) x).quasiMeasurePreserving.ae_eq_comp @@ -1424,8 +1431,24 @@ private theorem integral_fourier_sq_phase_schwartz_realVec {d : Nat} SchwartzMap.integral_inner_fourier_fourier f (schwartzCompSubConstCLM (-x) f) simp_rw [SchwartzMap.fourier_coe] at h rw [fourier_schwartzCompSubConstCLM_realVec f (-x)] at h - simpa [schwartzCompSubConstCLM_apply, modulationPhase, RCLike.inner_apply', - RCLike.mul_conj, pow_two, sub_eq_add_neg, mul_assoc, mul_comm, mul_left_comm] using h + calc + _ = ∫ η, inner ℂ (FourierTransform.fourier (f : RealVec d → ℂ) η) + (modulationPhase (-x) η * FourierTransform.fourier (f : RealVec d → ℂ) η) := by + symm + apply integral_congr_ae + filter_upwards with η + rw [RCLike.inner_apply'] + calc + _ = ((starRingEnd ℂ) (FourierTransform.fourier (f : RealVec d → ℂ) η) * + FourierTransform.fourier (f : RealVec d → ℂ) η) * modulationPhase (-x) η := by + ac_rfl + _ = _ := by simp only [RCLike.conj_mul, Complex.ofReal_pow, Complex.coe_algebraMap] + _ = ∫ t, inner ℂ (f t) (schwartzCompSubConstCLM (-x) f t) := h + _ = _ := by + apply integral_congr_ae + filter_upwards with t + simp only [RCLike.inner_apply', schwartzCompSubConstCLM_apply, Function.comp_apply, + sub_neg_eq_add, RCLike.star_def] private theorem integral_stftRep_sq_phase_slice_schwartz {d : Nat} (h f : SchwartzMap (RealVec d) ℂ) (y x : RealVec d) : @@ -1435,7 +1458,8 @@ private theorem integral_stftRep_sq_phase_slice_schwartz {d : Nat} (f.toLp 2 (MeasureTheory.volume : MeasureTheory.Measure (RealVec d))) (y, η)‖ ^ 2 : ℝ) : ℂ) * modulationPhase (-x) η = ∫ t, star (stftSliceSchwartz h f y t) * stftSliceSchwartz h f y (t + x) := by - simpa [stftRep_schwartz_eq_fourier_apply] using + simpa only [stftRep_schwartz_eq_fourier_apply, Complex.ofReal_pow, stftSliceSchwartz_apply, + RCLike.star_def, star_mul', RingHomCompTriple.comp_apply, RingHom.id_apply] using integral_fourier_sq_phase_schwartz_realVec (stftSliceSchwartz h f y) x private theorem integrable_norm_sq_schwartz_realVec {d : Nat} @@ -1453,7 +1477,7 @@ private theorem reflected_memLp_schwartz_realVec {d : Nat} MemLp (fun y : RealVec d => h (-y)) 2 (MeasureTheory.volume : MeasureTheory.Measure (RealVec d)) := by let μ : MeasureTheory.Measure (RealVec d) := MeasureTheory.volume - simpa [Function.comp_def, μ] using + simpa only [Function.comp_def, μ] using (h.memLp 2 μ).comp_measurePreserving (Measure.measurePreserving_neg μ) private theorem integrable_norm_sq_translate_sub_schwartz_realVec {d : Nat} @@ -1463,10 +1487,11 @@ private theorem integrable_norm_sq_translate_sub_schwartz_realVec {d : Nat} let μ : MeasureTheory.Measure (RealVec d) := MeasureTheory.volume have hneg : MemLp (fun y : RealVec d => h (-y)) 2 μ := reflected_memLp_schwartz_realVec h have hcomp : MemLp (fun y : RealVec d => h (-(y - t))) 2 μ := by - simpa [Function.comp_def, μ] using + simpa only [neg_sub, Function.comp_def, μ] using hneg.comp_measurePreserving (MeasureTheory.measurePreserving_sub_right μ t) have hmem : MemLp (fun y : RealVec d => h (t - y)) 2 μ := by - simpa [sub_eq_add_neg, add_comm, add_left_comm, add_assoc, μ] using hcomp + simpa only [sub_eq_add_neg, neg_add_rev, neg_neg, add_comm, add_left_comm, add_assoc, μ] using + hcomp exact (MeasureTheory.memLp_two_iff_integrable_sq_norm (μ := μ) (f := fun y : RealVec d => h (t - y)) @@ -1479,11 +1504,11 @@ private theorem integral_norm_sq_translate_sub_schwartz_realVec {d : Nat} calc ∫ y : RealVec d, ‖h (t - y)‖ ^ 2 = ∫ y : RealVec d, ‖h (-y)‖ ^ 2 := by - simpa [sub_eq_add_neg, μ] using + simpa only [sub_eq_add_neg, neg_add_rev, neg_neg, μ] using (integral_sub_right_eq_self (μ := μ) (f := fun y : RealVec d => ‖h (-y)‖ ^ 2) t) _ = ∫ y : RealVec d, ‖h y‖ ^ 2 := by - simpa [μ] using + simpa only [μ] using (integral_neg_eq_self (μ := μ) (f := fun y : RealVec d => ‖h y‖ ^ 2)) private theorem integral_stft_kernel_slice_schwartz_realVec {d : Nat} @@ -1582,11 +1607,14 @@ private theorem integral_signal_autocorr_phase_schwartz_realVec {d : Nat} have hshift : ∫ t, star (f t) * f (t + x) * modulationPhase ω (t + a) = ∫ t, f (t + a) * star (f (t - a)) * modulationPhase ω t := by - simpa [ha, sub_eq_add_neg, add_comm, add_left_comm, add_assoc, - mul_assoc, mul_left_comm, mul_comm] using - (integral_add_right_eq_self (μ := μ) - (f := fun t : RealVec d => - f (t + a) * star (f (t - a)) * modulationPhase ω t) a) + calc + _ = ∫ t, f (t + a + a) * star (f (t + a - a)) * modulationPhase ω (t + a) := by + apply integral_congr_ae + filter_upwards with t + rw [add_assoc t a a, ha, add_sub_cancel_right] + ac_rfl + _ = _ := integral_add_right_eq_self (μ := μ) + (f := fun t : RealVec d => f (t + a) * star (f (t - a)) * modulationPhase ω t) a unfold ambiguityRep rw [hshift] have hf_ae : @@ -1595,13 +1623,13 @@ private theorem integral_signal_autocorr_phase_schwartz_realVec {d : Nat} have hplus : (fun t : RealVec d => (f.toLp 2 μ : RealVec d -> ℂ) (t + a)) =ᵐ[μ] fun t : RealVec d => f (t + a) := by - simpa [Function.comp_def] using + simpa only [Function.comp_def] using ((MeasureTheory.measurePreserving_add_right μ a).quasiMeasurePreserving).ae_eq_comp hf_ae have hminus : (fun t : RealVec d => (f.toLp 2 μ : RealVec d -> ℂ) (t - a)) =ᵐ[μ] fun t : RealVec d => f (t - a) := by - simpa [Function.comp_def, sub_eq_add_neg] using + simpa only [sub_eq_add_neg, Function.comp_def] using ((MeasureTheory.measurePreserving_add_right μ (-a)).quasiMeasurePreserving).ae_eq_comp hf_ae apply integral_congr_ae @@ -1615,7 +1643,7 @@ private theorem signal_autocorr_integrable_schwartz_realVec {d : Nat} (MeasureTheory.volume : MeasureTheory.Measure (RealVec d)) := by let μ : MeasureTheory.Measure (RealVec d) := MeasureTheory.volume have hshift : MemLp (fun t : RealVec d => f (t + x)) 2 μ := by - simpa [Function.comp_def, μ] using + simpa only [Function.comp_def, μ] using (f.memLp 2 μ).comp_measurePreserving (MeasureTheory.measurePreserving_add_right μ x) have hmul := (f.memLp 2 μ).star.integrable_mul hshift @@ -1631,15 +1659,17 @@ private theorem window_autocorr_integrable_schwartz_realVec {d : Nat} have hneg : MemLp (fun y : RealVec d => h (-y)) 2 μ := by simpa [μ] using reflected_memLp_schwartz_realVec h have hleft' : MemLp (fun y : RealVec d => h (-(y - t))) 2 μ := by - simpa [Function.comp_def, μ] using + simpa only [neg_sub, Function.comp_def, μ] using hneg.comp_measurePreserving (MeasureTheory.measurePreserving_sub_right μ t) have hright' : MemLp (fun y : RealVec d => h (-(y - (t + x)))) 2 μ := by - simpa [Function.comp_def, μ] using + simpa only [neg_sub, Function.comp_def, μ] using hneg.comp_measurePreserving (MeasureTheory.measurePreserving_sub_right μ (t + x)) have hleft : MemLp (fun y : RealVec d => h (t - y)) 2 μ := by - simpa [sub_eq_add_neg, add_comm, add_left_comm, add_assoc] using hleft' + simpa only [sub_eq_add_neg, neg_add_rev, neg_neg, add_comm, add_left_comm, add_assoc] using + hleft' have hright : MemLp (fun y : RealVec d => h (t + x - y)) 2 μ := by - simpa [sub_eq_add_neg, add_comm, add_left_comm, add_assoc] using hright' + simpa only [sub_eq_add_neg, add_assoc, neg_add_rev, add_comm, neg_neg, add_left_comm] using + hright' have hmul := hleft.integrable_mul hright.star refine hmul.congr ?_ filter_upwards with y @@ -1650,7 +1680,8 @@ private theorem integral_window_autocorr_norm_schwartz_realVec {d : Nat} ∫ y : RealVec d, ‖h (t - y) * star (h (t + x - y))‖ = ∫ y : RealVec d, ‖h (-y) * star (h (x - y))‖ := by let μ : MeasureTheory.Measure (RealVec d) := MeasureTheory.volume - simpa [sub_eq_add_neg, add_comm, add_left_comm, add_assoc, μ] using + simpa only [sub_eq_add_neg, add_assoc, RCLike.star_def, Complex.norm_mul, RCLike.norm_conj, + neg_add_rev, neg_neg, add_left_comm, add_comm, μ] using (integral_sub_right_eq_self (μ := μ) (f := fun y : RealVec d => ‖h (-y) * star (h (x - y))‖) t) @@ -1721,7 +1752,7 @@ private theorem ambiguityRep_neg_neg_schwartz_realVec {d : Nat} hf_ae filter_upwards [h] with t ht rw [hneg_half] - simpa [Function.comp_def, sub_eq_add_neg] using ht + simpa only [sub_eq_add_neg, Function.comp_apply, Function.comp_def] using ht have hleft_minus : (fun t : RealVec d => (f.toLp 2 μ : RealVec d -> ℂ) (t - (1 / 2 : ℝ) • (-x))) @@ -1731,17 +1762,17 @@ private theorem ambiguityRep_neg_neg_schwartz_realVec {d : Nat} hf_ae filter_upwards [h] with t ht rw [hneg_half] - simpa [Function.comp_def, sub_eq_add_neg] using ht + simpa only [sub_eq_add_neg, neg_neg, Function.comp_apply, Function.comp_def] using ht have hright_plus : (fun t : RealVec d => (f.toLp 2 μ : RealVec d -> ℂ) (t + a)) =ᵐ[μ] fun t : RealVec d => f (t + a) := by - simpa [Function.comp_def] using + simpa only [Function.comp_def] using ((MeasureTheory.measurePreserving_add_right μ a).quasiMeasurePreserving).ae_eq_comp hf_ae have hright_minus : (fun t : RealVec d => (f.toLp 2 μ : RealVec d -> ℂ) (t - a)) =ᵐ[μ] fun t : RealVec d => f (t - a) := by - simpa [Function.comp_def, sub_eq_add_neg] using + simpa only [sub_eq_add_neg, Function.comp_def] using ((MeasureTheory.measurePreserving_add_right μ (-a)).quasiMeasurePreserving).ae_eq_comp hf_ae calc @@ -1795,7 +1826,8 @@ private theorem integral_window_autocorr_phase_schwartz_realVec {d : Nat} modulationPhase ω y = modulationPhase ω t * modulationPhase ω (y - t) := by intro y have hphase := modulationPhase_add ω t (y - t) - simpa [sub_eq_add_neg, add_comm, add_left_comm, add_assoc] using hphase + simpa only [sub_eq_add_neg, add_neg_cancel_comm_assoc, add_comm, add_left_comm, add_assoc] using + hphase have hshift_t : ∫ y : RealVec d, h (t - y) * star (h (t + x - y)) * modulationPhase ω y = modulationPhase ω t * @@ -1808,11 +1840,11 @@ private theorem integral_window_autocorr_phase_schwartz_realVec {d : Nat} refine integral_congr_ae ?_ filter_upwards with y rw [hphase_t y] - ring_nf + ac_rfl _ = modulationPhase ω t * ∫ y : RealVec d, h (t - y) * star (h (t + x - y)) * modulationPhase ω (y - t) := by - simpa [mul_assoc] using + simpa only [RCLike.star_def, mul_assoc] using (MeasureTheory.integral_const_mul (r := modulationPhase ω t) (f := fun y : RealVec d => @@ -1821,15 +1853,16 @@ private theorem integral_window_autocorr_phase_schwartz_realVec {d : Nat} _ = modulationPhase ω t * ∫ y : RealVec d, h (-y) * star (h (x - y)) * modulationPhase ω y := by congr 1 - simpa [sub_eq_add_neg, add_comm, add_left_comm, add_assoc] using + simpa only [sub_eq_add_neg, add_assoc, RCLike.star_def, neg_add_rev, neg_neg, + add_left_comm, add_comm] using (integral_sub_right_eq_self (μ := μ) (f := fun y : RealVec d => h (-y) * star (h (x - y)) * modulationPhase ω y) t) have hneg : ∫ y : RealVec d, h (-y) * star (h (x - y)) * modulationPhase ω y = ∫ y : RealVec d, h y * star (h (x + y)) * modulationPhase (-ω) y := by - simpa [sub_eq_add_neg, add_comm, add_left_comm, add_assoc, - modulationPhase_neg_right, mul_assoc] using + simpa only [sub_eq_add_neg, RCLike.star_def, mul_assoc, modulationPhase_neg_right, neg_neg, + add_comm, add_left_comm, add_assoc] using (integral_neg_eq_self (μ := μ) (f := fun y : RealVec d => h y * star (h (x + y)) * modulationPhase (-ω) y)) have hphase_x : ∀ y : RealVec d, @@ -1848,11 +1881,11 @@ private theorem integral_window_autocorr_phase_schwartz_realVec {d : Nat} refine integral_congr_ae ?_ filter_upwards with y rw [hphase_x y] - ring_nf + ac_rfl _ = modulationPhase ω a * ∫ y : RealVec d, h y * star (h (x + y)) * modulationPhase (-ω) (y + a) := by - simpa [mul_assoc] using + simpa only [RCLike.star_def, mul_assoc] using (MeasureTheory.integral_const_mul (r := modulationPhase ω a) (f := fun y : RealVec d => @@ -1861,7 +1894,8 @@ private theorem integral_window_autocorr_phase_schwartz_realVec {d : Nat} ∫ y : RealVec d, h (y - a) * star (h (y + a)) * modulationPhase (-ω) y := by congr 1 - simpa [ha, sub_eq_add_neg, add_comm, add_left_comm, add_assoc] using + simpa only [RCLike.star_def, sub_eq_add_neg, add_assoc, add_neg_cancel, add_zero, + add_comm, add_left_comm, ha] using (integral_add_right_eq_self (μ := μ) (f := fun y : RealVec d => h (y - a) * star (h (y + a)) * modulationPhase (-ω) y) a) @@ -1879,7 +1913,7 @@ private theorem integral_window_autocorr_phase_schwartz_realVec {d : Nat} hh_ae filter_upwards [hq] with y hy rw [hneg_half] - simpa [Function.comp_def, sub_eq_add_neg] using hy + simpa only [sub_eq_add_neg, Function.comp_apply, Function.comp_def] using hy have hminus : (fun y : RealVec d => (h.toLp 2 μ : RealVec d -> ℂ) (y - (1 / 2 : ℝ) • (-x))) @@ -1889,7 +1923,7 @@ private theorem integral_window_autocorr_phase_schwartz_realVec {d : Nat} hh_ae filter_upwards [hq] with y hy rw [hneg_half] - simpa [Function.comp_def, sub_eq_add_neg] using hy + simpa only [sub_eq_add_neg, neg_neg, Function.comp_apply, Function.comp_def] using hy symm apply integral_congr_ae filter_upwards [hplus, hminus] with y hy1 hy2 @@ -1906,7 +1940,7 @@ private theorem integral_window_autocorr_phase_schwartz_realVec {d : Nat} _ = modulationPhase ω (t + a) * star (ambiguityRep (h.toLp 2 μ) (h.toLp 2 μ) (x, ω)) := by rw [ambiguityRep_neg_neg_schwartz_realVec h x ω, modulationPhase_add] - ring + ac_rfl private theorem modulateL2_mem {d : Nat} (ω : RealVec d) (f : L2Real d) : MeasureTheory.MemLp @@ -1992,7 +2026,7 @@ private theorem modulation_eLpNorm_tendsto_zero {d : Nat} (f : L2Real d) (ω0 : (f := fun _ : RealVec d => (0 : ℝ≥0∞)) (bound := fun t : RealVec d => ‖(2 : ℂ) * (f : RealVec d -> ℂ) t‖ₑ ^ (2 : ℝ)) ?_ ?_ ?_ ?_ - · simpa using hdc + · simpa only [ENNReal.rpow_ofNat, lintegral_const, zero_mul] using hdc · exact Filter.Eventually.of_forall fun ω => by exact (((Continuous.aestronglyMeasurable (by unfold modulationPhase @@ -2012,7 +2046,7 @@ private theorem modulation_eLpNorm_tendsto_zero {d : Nat} (f : L2Real d) (ω0 : ‖modulationPhase ω0 t * (f : RealVec d -> ℂ) t‖ := norm_sub_le _ _ _ = ‖(f : RealVec d -> ℂ) t‖ + ‖(f : RealVec d -> ℂ) t‖ := by rw [norm_mul, norm_mul, modulationPhase_norm, modulationPhase_norm] - ring_nf + ac_rfl _ = ‖(2 : ℂ) * (f : RealVec d -> ℂ) t‖ := by rw [norm_mul] norm_num @@ -2052,16 +2086,17 @@ private theorem modulation_eLpNorm_tendsto_zero {d : Nat} (f : L2Real d) (ω0 : (fun _ : RealVec d => modulationPhase ω0 t * (f : RealVec d -> ℂ) t) (𝓝 ω0) (𝓝 (modulationPhase ω0 t * (f : RealVec d -> ℂ) t)) := tendsto_const_nhds - simpa using hleft.sub hright + simpa only [sub_self] using hleft.sub hright have hnorm : Tendsto (fun ω : RealVec d => ‖modulationPhase ω t * (f : RealVec d -> ℂ) t - modulationPhase ω0 t * (f : RealVec d -> ℂ) t‖ₑ) (𝓝 ω0) (𝓝 (0 : ℝ≥0∞)) := by - simpa [Function.comp_def] using (continuous_enorm.tendsto 0).comp hdiff + simpa only [Function.comp_def, enorm_zero] using (continuous_enorm.tendsto 0).comp hdiff have hpow_cont : Continuous fun x : ℝ≥0∞ => x ^ (2 : ℝ) := ENNReal.continuous_rpow_const - simpa [Function.comp_def, ENNReal.zero_rpow_of_pos (by norm_num : 0 < (2 : ℝ))] using + simpa only [ENNReal.rpow_ofNat, Function.comp_def, ENNReal.zero_rpow_of_pos (by norm_num : 0 + < (2 : ℝ))] using (hpow_cont.tendsto (0 : ℝ≥0∞)).comp hnorm have hpow : Tendsto (fun ω : RealVec d => @@ -2072,7 +2107,8 @@ private theorem modulation_eLpNorm_tendsto_zero {d : Nat} (f : L2Real d) (ω0 : (𝓝 ω0) (𝓝 (0 : ℝ≥0∞)) := by have hpow_cont : Continuous fun x : ℝ≥0∞ => x ^ (1 / (2 : ℝ)) := ENNReal.continuous_rpow_const - simpa [Function.comp_def, ENNReal.zero_rpow_of_pos (by norm_num : 0 < (1 / (2 : ℝ)))] using + simpa only [ENNReal.rpow_ofNat, one_div, Function.comp_def, inv_pos, Nat.ofNat_pos, + ENNReal.zero_rpow_of_pos, ENNReal.zero_rpow_of_pos (by norm_num : 0 < (1 / (2 : ℝ)))] using (hpow_cont.tendsto (0 : ℝ≥0∞)).comp hInt have hmeas : ∀ ω : RealVec d, MeasureTheory.AEStronglyMeasurable (fun t : RealVec d => @@ -2090,7 +2126,7 @@ theorem continuous_modulateL2_apply {d : Nat} (f : L2Real d) : rw [continuous_iff_continuousAt] intro ω0 dsimp [ContinuousAt] - simpa [modulateL2] using + simpa only [modulateL2] using (MeasureTheory.Lp.tendsto_Lp_iff_tendsto_eLpNorm'' (f := fun ω t => modulationPhase ω t * (f : RealVec d -> ℂ) t) (f_ℒp := fun ω => modulateL2_mem ω f) @@ -2143,7 +2179,7 @@ theorem ambiguityRep_eq_lpPairing rw [hg] unfold modulationPhase simp [ContinuousLinearMap.mul_apply'] - ring_nf + ac_rfl theorem edist_modulateL2 {d : Nat} (ω : RealVec d) (f g : L2Real d) : edist (modulateL2 ω f) (modulateL2 ω g) = edist f g := by @@ -2179,7 +2215,7 @@ theorem continuous_modulateL2 {d : Nat} {X : Type*} [TopologicalSpace X] refine hbase.congr_dist ?_ have hdist_h : Tendsto (fun x : X => dist (h x) (h x0)) (𝓝 x0) (𝓝 0) := tendsto_iff_dist_tendsto_zero.mp hh.continuousAt - simpa [dist_comm, dist_modulateL2] using hdist_h + simpa only [dist_modulateL2, dist_comm] using hdist_h theorem edist_star_L2 {d : Nat} (f g : L2Real d) : edist (star f) (star g) = edist f g := by @@ -2275,7 +2311,7 @@ theorem stftRep_eq_lpPairing rw [hh] unfold modulationPhase simp [ContinuousLinearMap.mul_apply'] - ring_nf + ac_rfl theorem norm_stftRep_le {d : Nat} (h f : L2Real d) (ξ : PhaseSpace d) : ‖stftRep h f ξ‖ ≤ ‖f‖ * ‖h‖ := by @@ -2385,7 +2421,7 @@ private theorem stftRep_sq_integrable_schwartz_realVec {d : Nat} filter_upwards with t simp [stftSliceSchwartz_apply, pow_two, mul_assoc, mul_left_comm, mul_comm] rw [h_outer] - simpa using hkernel.integral_norm_prod_right + simpa only [norm_mul, norm_pow, norm_norm] using hkernel.integral_norm_prod_right private theorem stftRep_sq_complex_integrable_schwartz_realVec {d : Nat} (h f : SchwartzMap (RealVec d) ℂ) : @@ -2394,7 +2430,8 @@ private theorem stftRep_sq_complex_integrable_schwartz_realVec {d : Nat} (h.toLp 2 (MeasureTheory.volume : MeasureTheory.Measure (RealVec d))) (f.toLp 2 (MeasureTheory.volume : MeasureTheory.Measure (RealVec d))) p‖ ^ 2 : ℝ) : ℂ)) (MeasureTheory.volume : MeasureTheory.Measure (PhaseSpace d)) := by - simpa using (stftRep_sq_integrable_schwartz_realVec h f).ofReal (𝕜 := ℂ) + simpa only [Complex.ofReal_pow, Complex.coe_algebraMap] using + (stftRep_sq_integrable_schwartz_realVec h f).ofReal (𝕜 := ℂ) private theorem integral_norm_sq_schwartz_eq_lpNorm_sq_realVec {d : Nat} (f : SchwartzMap (RealVec d) ℂ) : @@ -2516,7 +2553,7 @@ private theorem lpNorm_stftRep_schwartz_realVec {d : Nat} ∫ p : PhaseSpace d, ‖stftRep hLp fLp p‖ ^ 2 = MeasureTheory.lpNorm (f : RealVec d -> ℂ) 2 μ ^ 2 * MeasureTheory.lpNorm (h : RealVec d -> ℂ) 2 μ ^ 2 by - simpa [hLp, fLp, μ] using integral_stftRep_sq_schwartz_realVec h f] + simpa only [hLp, μ, fLp] using integral_stftRep_sq_schwartz_realVec h f] have hnonneg : 0 ≤ MeasureTheory.lpNorm (f : RealVec d -> ℂ) 2 μ * MeasureTheory.lpNorm (h : RealVec d -> ℂ) 2 μ := @@ -2574,7 +2611,8 @@ private theorem cross_norm_bound_tendsto_zero tendsto_iff_norm_sub_tendsto_zero.mp hfN have hh_err : Tendsto (fun n : Nat => ‖hN n - h‖) atTop (nhds 0) := tendsto_iff_norm_sub_tendsto_zero.mp hhN - simpa using (hf_err.mul hhN.norm).add (tendsto_const_nhds.mul hh_err) + simpa only [zero_mul, mul_zero, add_zero] using + (hf_err.mul hhN.norm).add (tendsto_const_nhds.mul hh_err) private theorem stftRep_tendsto_schwartzApprox_pointwise {d : Nat} (h f : L2Real d) (ξ : PhaseSpace d) : @@ -2669,8 +2707,9 @@ private theorem eLpNorm_stftRep_le {d : Nat} (h f : L2Real d) : atTop (nhds (ENNReal.ofReal (MeasureTheory.lpNorm (f : RealVec d -> ℂ) 2 μ * MeasureTheory.lpNorm (h : RealVec d -> ℂ) 2 μ))) := by - simpa [μ, μP, eLpNorm_stftRep_schwartz_eq] using hnorms' - simpa [Fₙ, hN, fN] using hnorms_aux + simpa only [eLpNorm_stftRep_schwartz_eq, lpNorm_nonneg, ENNReal.ofReal_mul, μ, μP] using + hnorms' + simpa only [lpNorm_nonneg, ENNReal.ofReal_mul, Fₙ, hN, fN] using hnorms_aux calc MeasureTheory.eLpNorm (stftRep h f) 2 μP = MeasureTheory.eLpNorm F 2 μP := by rfl @@ -2698,7 +2737,8 @@ private theorem stftRep_sq_integrable {d : Nat} (h f : L2Real d) : private theorem stftRep_sq_complex_integrable {d : Nat} (h f : L2Real d) : Integrable (fun p : PhaseSpace d => ((‖stftRep h f p‖ ^ 2 : ℝ) : ℂ)) (MeasureTheory.volume : MeasureTheory.Measure (PhaseSpace d)) := by - simpa using (stftRep_sq_integrable h f).ofReal (𝕜 := ℂ) + simpa only [Complex.ofReal_pow, Complex.coe_algebraMap] using + (stftRep_sq_integrable h f).ofReal (𝕜 := ℂ) private theorem stftRep_memLp {d : Nat} (h f : L2Real d) : MeasureTheory.MemLp (stftRep h f) 2 @@ -2722,18 +2762,19 @@ private theorem lpNorm_stftRep_le_lpNorm {d : Nat} (h f : L2Real d) : let μP : MeasureTheory.Measure (PhaseSpace d) := MeasureTheory.volume have hmem : MeasureTheory.MemLp (stftRep h f) 2 μP := stftRep_memLp h f rw [← MeasureTheory.toReal_eLpNorm] - simpa using + simpa only [ge_iff_le, lpNorm_nonneg, ENNReal.ofReal_mul, ENNReal.toReal_mul, + ENNReal.toReal_ofReal] using (ENNReal.toReal_le_toReal hmem.eLpNorm_ne_top ENNReal.ofReal_ne_top).mpr (eLpNorm_stftRep_le h f) private theorem lpNorm_stftRep_le {d : Nat} (h f : L2Real d) : MeasureTheory.lpNorm (stftRep h f) 2 (MeasureTheory.volume : MeasureTheory.Measure (PhaseSpace d)) ≤ - ‖f‖ * ‖h‖ := by simpa [lpNorm_coeFn_L2Real_eq_norm] using lpNorm_stftRep_le_lpNorm h f + ‖f‖ * ‖h‖ := by simpa only [lpNorm_coeFn_L2Real_eq_norm] using lpNorm_stftRep_le_lpNorm h f private theorem translateL2_sub {d : Nat} (a : RealVec d) (f g : L2Real d) : translateL2 a (f - g) = translateL2 a f - translateL2 a g := by - simpa [translateL2] using DomAddAct.vadd_Lp_sub (DomAddAct.mk a) f g + simpa only [translateL2] using DomAddAct.vadd_Lp_sub (DomAddAct.mk a) f g private theorem star_L2_sub {d : Nat} (f g : L2Real d) : star (f - g) = star f - star g := by @@ -2844,9 +2885,9 @@ private theorem lpNorm_mul_le_real rw [MeasureTheory.lpNorm_one_eq_integral_norm hmem.aestronglyMeasurable] have hpq : Real.HolderConjugate 2 2 := by constructor <;> norm_num have hf_abs : MeasureTheory.MemLp (fun x => |f x|) (ENNReal.ofReal (2 : ℝ)) μ := by - simpa [Real.norm_eq_abs] using hf.norm + simpa only [ENNReal.ofReal_ofNat, Real.norm_eq_abs] using hf.norm have hg_abs : MeasureTheory.MemLp (fun x => |g x|) (ENNReal.ofReal (2 : ℝ)) μ := by - simpa [Real.norm_eq_abs] using hg.norm + simpa only [ENNReal.ofReal_ofNat, Real.norm_eq_abs] using hg.norm have hf_nonneg : 0 ≤ᵐ[μ] fun x => |f x| := Filter.Eventually.of_forall fun _ => abs_nonneg _ have hg_nonneg : 0 ≤ᵐ[μ] fun x => |g x| := @@ -2862,7 +2903,7 @@ private theorem lpNorm_mul_le_real have h' := congrArg ENNReal.toReal h rw [ENNReal.toReal_ofReal (by positivity), MeasureTheory.toReal_eLpNorm] at h' - simpa [Real.norm_eq_abs] using h'.symm + simpa only [Real.rpow_ofNat, sq_abs, one_div, Real.norm_eq_abs] using h'.symm have hg_lp : (∫ x, |g x| ^ (2 : ℝ) ∂μ) ^ (1 / (2 : ℝ)) = MeasureTheory.lpNorm g 2 μ := by @@ -2872,7 +2913,7 @@ private theorem lpNorm_mul_le_real have h' := congrArg ENNReal.toReal h rw [ENNReal.toReal_ofReal (by positivity), MeasureTheory.toReal_eLpNorm] at h' - simpa [Real.norm_eq_abs] using h'.symm + simpa only [Real.rpow_ofNat, sq_abs, one_div, Real.norm_eq_abs] using h'.symm have hleft : ∫ x, ‖f x * g x‖ ∂μ = ∫ x, |f x| * |g x| ∂μ := by refine integral_congr_ae ?_ @@ -2929,7 +2970,7 @@ private theorem lpNorm_stftRep_sq_sub_tendsto_zero {d : Nat} Tendsto (fun n : Nat => Cₙ n * MeasureTheory.lpNorm (fun ξ : PhaseSpace d => Fₙ n ξ - F ξ) 2 μP) - atTop (nhds 0) := by simpa using hC_tendsto.mul hdiff + atTop (nhds 0) := by simpa only [mul_zero] using hC_tendsto.mul hdiff refine squeeze_zero (fun _ => MeasureTheory.lpNorm_nonneg) ?_ hCtendsto intro n have hmemFn : MeasureTheory.MemLp (Fₙ n) 2 μP := by @@ -3130,11 +3171,11 @@ private lemma moyal_kernel_iterated_eq {d : Nat} (h (t - y) * star (h (t + x - y)) * modulationPhase ω y) := by refine integral_congr_ae ?_ filter_upwards with y - ring + ac_rfl _ = (star (f t) * f (t + x)) * ∫ y : RealVec d, h (t - y) * star (h (t + x - y)) * modulationPhase ω y := by - simpa [mul_assoc] using + simpa only [RCLike.star_def, mul_assoc] using (MeasureTheory.integral_const_mul (r := star (f t) * f (t + x)) (f := fun y : RealVec d => @@ -3155,12 +3196,12 @@ private lemma moyal_kernel_iterated_eq {d : Nat} modulationPhase ω (t + (1 / 2 : ℝ) • x) ) := by refine integral_congr_ae ?_ filter_upwards with t - ring + ac_rfl _ = star (ambiguityRep hLp hLp (x, ω)) * ∫ t : RealVec d, (star (f t) * f (t + x)) * modulationPhase ω (t + (1 / 2 : ℝ) • x) := by - simpa [mul_assoc] using + simpa only [RCLike.star_def, one_div, mul_assoc] using (MeasureTheory.integral_const_mul (r := star (ambiguityRep hLp hLp (x, ω))) (f := fun t : RealVec d => @@ -3205,7 +3246,7 @@ private lemma moyal_slice_collapse {d : Nat} modulationPhase (-x) η) := by refine integral_congr_ae ?_ filter_upwards with η - ring + ac_rfl _ = modulationPhase ω y * ∫ η : RealVec d, ((‖stftRep (h.toLp 2 MeasureTheory.volume) @@ -3219,7 +3260,8 @@ private lemma moyal_slice_collapse {d : Nat} _ = ∫ t : RealVec d, modulationPhase ω y * (star (stftSliceSchwartz h f y t) * stftSliceSchwartz h f y (t + x)) := by - simpa [mul_assoc] using + simpa only [stftSliceSchwartz_apply, RCLike.star_def, star_mul', + RingHomCompTriple.comp_apply, RingHom.id_apply, mul_assoc] using (MeasureTheory.integral_const_mul (r := modulationPhase ω y) (f := fun t : RealVec d => @@ -3231,7 +3273,7 @@ private lemma moyal_slice_collapse {d : Nat} refine integral_congr_ae ?_ filter_upwards with t simp only [stftSliceSchwartz_apply, star_mul, star_star] - ring + ac_rfl -- The vector Schwartz Moyal proof is one long Fubini/phase-normalization calc. private theorem symplecticFourier_stft_sq_schwartz_realVec {d : Nat} @@ -3270,7 +3312,8 @@ private theorem symplecticFourier_stft_sq_schwartz_realVec {d : Nat} (h (p.1 - p.2) * star (h (p.1 + x - p.2)))) * modulationPhase ω p.2 have hS : Integrable S (MeasureTheory.volume : MeasureTheory.Measure (PhaseSpace d)) := by - simpa [S, hLp, fLp, μ] using stftRep_sq_complex_integrable_schwartz_realVec h f + simpa only [Complex.ofReal_pow, S, hLp, fLp, μ] using + stftRep_sq_complex_integrable_schwartz_realVec h f have hphase_meas : AEStronglyMeasurable phase (MeasureTheory.volume : MeasureTheory.Measure (PhaseSpace d)) := @@ -3279,7 +3322,7 @@ private theorem symplecticFourier_stft_sq_schwartz_realVec {d : Nat} ∀ᵐ η : PhaseSpace d ∂(MeasureTheory.volume : MeasureTheory.Measure (PhaseSpace d)), ‖phase η‖ ≤ (1 : ℝ) := by filter_upwards with η - simpa [phase] using le_of_eq (symplecticFourierPhase_norm η (x, ω)) + simpa only [Complex.ofReal_sub, phase] using le_of_eq (symplecticFourierPhase_norm η (x, ω)) have hSphase : Integrable (fun η : PhaseSpace d => S η * phase η) (MeasureTheory.volume : MeasureTheory.Measure (PhaseSpace d)) := @@ -3302,8 +3345,9 @@ private theorem symplecticFourier_stft_sq_schwartz_realVec {d : Nat} (fun p : RealVec d × RealVec d => (star (f p.1) * f (p.1 + x)) * (h (p.1 - p.2) * star (h (p.1 + x - p.2)))) - (μ.prod μ) := by simpa [μ] using autocorr_kernel_integrable_schwartz_realVec f h x - simpa [G, mul_assoc] using hbase.mul_bdd hmod_meas hmod_bound + (μ.prod μ) := by simpa only [RCLike.star_def, μ] using + autocorr_kernel_integrable_schwartz_realVec f h x + simpa only [RCLike.star_def, mul_assoc, G] using hbase.mul_bdd hmod_meas hmod_bound have hK : Integrable (Function.uncurry K) (μ.prod μ) := by refine hG.swap.congr ?_ filter_upwards with p diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalCoercivity.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalCoercivity.lean index dc562c923f..0f7e835853 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalCoercivity.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalCoercivity.lean @@ -12,10 +12,6 @@ import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite1Dimd.ImportedAnalyticIn import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermitek.TrueLevelBasis import LeanPool.PhaseRetrieval.DimdPoly.Internal.ProductAnnulusLocalization import LeanPool.PhaseRetrieval.DimdPoly.Internal.TensorBasis -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Combinatorics.Matroid.Init -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm import Mathlib.Tactic.NormNum.Parity diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalReduction/OrthogonalReduction.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalReduction/OrthogonalReduction.lean index d69abe230e..925a8e52a3 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalReduction/OrthogonalReduction.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalReduction/OrthogonalReduction.lean @@ -8,10 +8,6 @@ module public import Mathlib.Analysis.InnerProductSpace.Basic public import Mathlib.MeasureTheory.Function.LpSpace.Basic import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite.ImportedAnalyticInputs -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Combinatorics.Matroid.Init -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm import Mathlib.Tactic.NormNum.Parity diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/PhaseStability.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/PhaseStability.lean index 4db466c599..1c90012ea9 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/PhaseStability.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/PhaseStability.lean @@ -9,10 +9,6 @@ public import LeanPool.PhaseRetrieval.DimdPoly.Internal.TensorBasis import LeanPool.PhaseRetrieval.DimdPoly.Internal.CoefficientLimitRigidity import LeanPool.PhaseRetrieval.DimdPoly.Internal.OrthogonalCoercivity import LeanPool.PhaseRetrieval.DimdPoly.Internal.OrthogonalReduction.OrthogonalReduction -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Combinatorics.Matroid.Init -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.MeasureTheory.Function.LpSeminorm.LpNorm import Mathlib.Tactic.NormNum.Parity diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/ProductAnnulusLocalization.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/ProductAnnulusLocalization.lean index 7d6cd6d93f..7c6424031d 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/ProductAnnulusLocalization.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/ProductAnnulusLocalization.lean @@ -9,10 +9,6 @@ public import LeanPool.PhaseRetrieval.DimdPoly.Internal.Definitions import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite1Dimd.BlockLocalization import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite1Dimd.ProductBasisAndAnnuli import LeanPool.PhaseRetrieval.DimdPoly.Internal.TensorBasis -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Combinatorics.Matroid.Init -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.Tactic.NormNum.Parity /-! # ProductAnnulusLocalization -/ diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/TensorBasis.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/TensorBasis.lean index b55ebf8015..c38cdb32f8 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/TensorBasis.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/TensorBasis.lean @@ -10,10 +10,6 @@ public import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite1Dimd.Definitions import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite1Dimd.ImportedAnalyticInputs import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermite1Dimd.ProductBasisAndAnnuli import LeanPool.PhaseRetrieval.DimdPoly.Internal.Hermitek.TrueLevelBasis -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.SpecialFunctions.Gamma.Basic -import Mathlib.Combinatorics.Matroid.Init -import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.Tactic.NormNum.Parity /-! # TensorBasis -/