diff --git a/LeanPool/SpherePacking/Conclusion.lean b/LeanPool/SpherePacking/Conclusion.lean index 1e08e2269d..1874f57cfd 100644 --- a/LeanPool/SpherePacking/Conclusion.lean +++ b/LeanPool/SpherePacking/Conclusion.lean @@ -800,32 +800,15 @@ private theorem radialSchwartzParametric_iteratedFDeriv_integral rw [hprevious, (radialSchwartzParametric_hasFDerivAt_iteratedIntegral μ g C hmeas hbound n x).fderiv] - calc - (continuousMultilinearCurryLeftEquiv ℝ - (fun _ : Fin (n + 1) ↦ Ambient d) ℂ).symm - (∫ a : α, fderiv ℝ - (iteratedFDeriv ℝ n (g a : Ambient d → ℂ)) x ∂μ) = - ∫ a : α, - (continuousMultilinearCurryLeftEquiv ℝ - (fun _ : Fin (n + 1) ↦ Ambient d) ℂ).symm - (fderiv ℝ - (iteratedFDeriv ℝ n (g a : Ambient d → ℂ)) x) - ∂μ := by - exact - (LinearIsometry.integral_comp_comm - (𝕜 := ℝ) - (LinearIsometryEquiv.toLinearIsometry - ((continuousMultilinearCurryLeftEquiv ℝ - (fun _ : Fin (n + 1) ↦ Ambient d) ℂ).symm)) - (fun a : α ↦ fderiv ℝ - (iteratedFDeriv ℝ n - (g a : Ambient d → ℂ)) x)).symm - _ = ∫ a : α, iteratedFDeriv ℝ (n + 1) - (g a : Ambient d → ℂ) x ∂μ := by - apply integral_congr_ae - filter_upwards [] with a - rw [iteratedFDeriv_succ_eq_comp_left] - rfl + simp_rw [iteratedFDeriv_succ_eq_comp_left, Function.comp_apply] + exact + (LinearIsometry.integral_comp_comm + (𝕜 := ℝ) + (LinearIsometryEquiv.toLinearIsometry + ((continuousMultilinearCurryLeftEquiv ℝ + (fun _ : Fin (n + 1) ↦ Ambient d) ℂ).symm)) + (fun a : α ↦ fderiv ℝ + (iteratedFDeriv ℝ n (g a : Ambient d → ℂ)) x)).symm end ProbabilityAverage diff --git a/LeanPool/SpherePacking/Foundations.lean b/LeanPool/SpherePacking/Foundations.lean index bd29e766fa..730cd3c300 100644 --- a/LeanPool/SpherePacking/Foundations.lean +++ b/LeanPool/SpherePacking/Foundations.lean @@ -7,26 +7,20 @@ Authors: OpenAI, Sidharth Hariharan, Gareth Ma, Dean Cureton module public import Mathlib.Analysis.Distribution.SchwartzSpace.Basic -import Mathlib.AlgebraicTopology.FundamentalGroupoid.SimplyConnected import Mathlib.Analysis.Complex.RemovableSingularity -import Mathlib.Analysis.Convex.Contractible import Mathlib.Analysis.Convex.SpecificFunctions.Deriv import Mathlib.Analysis.Distribution.SchwartzSpace.Fourier import Mathlib.Analysis.InnerProductSpace.Calculus import Mathlib.Analysis.MellinInversion import Mathlib.Analysis.Meromorphic.Complex import Mathlib.Analysis.Real.Pi.Bounds -import Mathlib.Analysis.SpecialFunctions.Complex.Arctan import Mathlib.Analysis.SpecialFunctions.Log.Base import Mathlib.Analysis.SpecialFunctions.Pow.Integral import Mathlib.Analysis.SpecialFunctions.Trigonometric.DerivHyp import Mathlib.MeasureTheory.Integral.Asymptotics import Mathlib.MeasureTheory.Measure.Lebesgue.VolumeOfBalls import Mathlib.Probability.Moments.ComplexMGF -import Mathlib.RingTheory.SimpleRing.Principal import Mathlib.Tactic.NormNum.RealSqrt -import Mathlib.Tactic.Polynomial.Basic -import Mathlib.Tactic.ReduceModChar /-! # Foundations @@ -153,7 +147,7 @@ private theorem plusPolynomial_imaginary_re_pos {ε u : ℝ} (hε : 0 < ε) (hu : -1 < u) : 0 < (plusPolynomial ε (Complex.I * (u : ℂ))).re := by have hs : 0 ≤ (1 - u) ^ 2 * (1 + u) := - mul_nonneg (sq_nonneg _) (by linarith) + mul_nonneg (sq_nonneg _) (by linear_combination hu) rw [plusPolynomial_imaginary, Complex.ofReal_re] exact add_pos_of_pos_of_nonneg (div_pos hε four_pos) hs @@ -161,16 +155,16 @@ private theorem minusPolynomial_imaginary_re_neg {ε u : ℝ} (hε : 0 < ε) (hu : 1 + ε / 4 ≤ u) : (minusPolynomial ε (Complex.I * (u : ℂ))).re < 0 := by rw [minusPolynomial_imaginary, Complex.ofReal_re] - have huone : 1 ≤ u := by linarith + have huone : 1 ≤ u := by linarith only [hε, hu] have hs : (4 : ℝ) ≤ (1 + u) ^ 2 := by - linarith [sq_nonneg (u - 1)] - have ht : ε / 4 ≤ u - 1 := by linarith + linarith only [sq_nonneg (u - 1), hε, hu] + have ht : ε / 4 ≤ u - 1 := by linear_combination hu have hproduct : ε ≤ (u - 1) * (1 + u) ^ 2 := by calc ε = (ε / 4) * 4 := by ring _ ≤ (u - 1) * (1 + u) ^ 2 := - mul_le_mul ht hs (by norm_num) (by linarith) - linarith + mul_le_mul ht hs (by norm_num) (by linarith only [hε, hu]) + linarith only [hε, hproduct] end @@ -239,7 +233,7 @@ private theorem integer_gamma_product (k : ℕ) {y : ℝ} (hy : y ≠ 0) : have him := congrArg Complex.im hj try dsimp [z] at him norm_num at him - exact hy (by linarith) + exact hy (by exact him) simpa only [add_comm] using! gamma_add_nat_eq_product z hz k private theorem half_integer_gamma_product (k : ℕ) (y : ℝ) : @@ -255,8 +249,8 @@ private theorem half_integer_gamma_product (k : ℕ) (y : ℝ) : try dsimp [z] at hre norm_num at hre have hjnonneg : 0 ≤ (j : ℝ) := Nat.cast_nonneg j - linarith - simpa [z, add_comm, add_left_comm, add_assoc] using! + linarith only [hre] + simpa only [z, add_comm, add_left_comm, add_assoc] using! gamma_add_nat_eq_product z hz k end @@ -373,7 +367,7 @@ private theorem antiFourierPart_nonneg_of_signs {d : ℕ} (x : Euclidean d) (hx : R ≤ ‖x‖) : 0 ≤ (antiFourierPart f x).re := by change 0 ≤ ((𝓕 f) x).re - (f x).re - linarith [hfourier x, houtside x hx] + linarith only [hfourier x, houtside x hx, hfourier, houtside, hx] private structure AntiFourierWitness (d : ℕ) (R : ℝ) where function : TestFunction d @@ -813,13 +807,13 @@ private theorem analytic_eq_zero_of_imaginary_ray refine ⟨z, ⟨?_, ?_⟩, ?_⟩ · apply hvanish u try dsimp [u, t₀] - linarith + linarith only [hε] · intro hz have hu : u = t₀ := by have him := congrArg Complex.im hz simpa [z, z₀] using! him try dsimp [u] at hu - linarith + linarith only [hε, hu] · dsimp [z₀, z, u] rw [dist_eq_norm, ← sub_mul, ← Complex.ofReal_sub, norm_mul, Complex.norm_real, Complex.norm_I, mul_one, Real.norm_eq_abs] @@ -839,6 +833,9 @@ private theorem nonnegative_compact_fourier_fixed_eq_zero {d : ℕ} (hcompact : HasCompactSupport (g : Euclidean d → ℂ)) (hfixed : (𝓕 g : TestFunction d) = g) : g = 0 := by + let : NormedAddCommGroup (EuclideanSpace ℝ (Fin d)) := inferInstance + let : NormedSpace ℝ (EuclideanSpace ℝ (Fin d)) := inferInstance + let : MeasureSpace (EuclideanSpace ℝ (Fin d)) := inferInstance classical let : Nontrivial (Euclidean d) := Module.nontrivial_of_finrank_pos (R := ℝ) (M := Euclidean d) @@ -851,7 +848,7 @@ private theorem nonnegative_compact_fourier_fixed_eq_zero {d : ℕ} fun x => -2 * Real.pi * @inner ℝ (Euclidean d) _ x e have hX : Continuous X := by try dsimp [X] - fun_prop + exact Continuous.const_mul (Continuous.inner continuous_id' continuous_const) (-2 * Real.pi) let μ : Measure (Euclidean d) := nonnegativeSchwartzMeasure g hg let F : ℂ → ℂ := ProbabilityTheory.complexMGF X μ have hanalytic : AnalyticOnNhd ℂ F Set.univ := by @@ -1101,6 +1098,7 @@ private theorem integral_radialProfile_mul {d : ℕ} (hd : 0 < d) radialSurfaceArea d • ∫ r : ℝ in Ioi 0, r ^ (d - 1) • (radialProfile hd f r * w r) := by + let : MeasureSpace (EuclideanSpace ℝ (Fin d)) := inferInstance let : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd calc (∫ x : Euclidean d, f x * w ‖x‖) = @@ -1303,6 +1301,9 @@ private theorem schwartz_mul_norm_cpow_integrable {d : ℕ} have hdim : 1 ≤ Module.finrank ℝ (Euclidean d) := by rw [finrank_euclideanSpace_fin] omega + let : NormedAddCommGroup (EuclideanSpace ℝ (Fin d)) := inferInstance + let : NormedSpace ℝ (EuclideanSpace ℝ (Fin d)) := inferInstance + let : MeasureSpace (EuclideanSpace ℝ (Fin d)) := inferInstance have hexponent : -z.re < (Module.finrank ℝ (Euclidean d) : ℝ) := by rw [finrank_euclideanSpace_fin] @@ -1379,7 +1380,7 @@ private theorem gaussianMellinParameter_integrable simpa only [Real.rpow_one, neg_mul] using! (integrableOn_rpow_mul_exp_neg_mul_rpow (p := (1 : ℝ)) (s := b.re - 1) (b := r) - (by linarith) (by norm_num) hr) + (by linear_combination hb) (by norm_num) hr) apply (integrable_norm_iff hmeas).mp apply hreal.congr_fun _ measurableSet_Ioi intro a ha @@ -1492,6 +1493,10 @@ private theorem gaussianMellinMixture_integrable {d : ℕ} (Function.uncurry (gaussianMellinMixture f b)) ((volume : Measure (Euclidean d)).prod (volume.restrict (Ioi (0 : ℝ)))) := by + let : Nonempty (Euclidean d) := ⟨0⟩ + let : NormedAddCommGroup (EuclideanSpace ℝ (Fin d)) := inferInstance + let : NormedSpace ℝ (EuclideanSpace ℝ (Fin d)) := inferInstance + let : MeasureSpace (EuclideanSpace ℝ (Fin d)) := inferInstance let : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd have hpow : Measurable (fun a : ℝ => (a : ℂ) ^ (b - 1)) := by apply measurable_of_continuousOn_compl_singleton (0 : ℝ) @@ -1645,6 +1650,7 @@ private theorem mellin_gaussianMellinPairingProfile {d : ℕ} Complex.Gamma b * (∫ x : Euclidean d, f x * (‖x‖ : ℂ) ^ (-(2 * b))) := by + let : MeasureSpace (EuclideanSpace ℝ (Fin d)) := inferInstance let : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd unfold mellin simp only [smul_eq_mul] @@ -1815,11 +1821,11 @@ private theorem fourier_riesz_pairing {d : ℕ} (-(2 * ((d : ℂ) / 2 - b)))))) := by have hdual : 0 < (((d : ℂ) / 2 - b).re) := by norm_num - linarith + linarith only [hbd] have hdual_dimension : 2 * (((d : ℂ) / 2 - b).re) < (d : ℝ) := by norm_num - linarith + linarith only [hb] calc Complex.Gamma b * (∫ ξ : Euclidean d, @@ -1862,11 +1868,11 @@ private theorem fourier_riesz_pairing_strip {d : ℕ} have hb : 0 < b.re := by try dsimp [b] norm_num - linarith + exact hsd have hbd : 2 * b.re < (d : ℝ) := by try dsimp [b] norm_num - linarith + linear_combination hs have hleft : -(2 * b) = s - (d : ℂ) := by try dsimp [b] ring @@ -1895,7 +1901,7 @@ private theorem radial_fourier_mellin_strip {d : ℕ} mellin (radialProfile hd f) ((d : ℂ) - s) := by have hdual : 0 < ((((d : ℂ) - s) / 2).re) := by norm_num - linarith + exact hsd have hgamma : Complex.Gamma (((d : ℂ) - s) / 2) ≠ 0 := Complex.Gamma_ne_zero_of_re_pos hdual @@ -2038,7 +2044,7 @@ private theorem shellOscillation_eq_sinc (B T : ℝ) : congr 2 <;> congr 1 <;> ring field_simp ring_nf at hsin ⊢ - linarith + linarith only [hsin] private theorem cos_le_quartic {x : ℝ} (hx0 : 0 ≤ x) (hx1 : x ≤ 1) : Real.cos x ≤ 1 - x ^ 2 / 2 + x ^ 4 * (5 / 96 : ℝ) := by @@ -2071,15 +2077,15 @@ private theorem sin_le_quintic {x : ℝ} (hx0 : 0 ≤ x) (hx1 : x ≤ 1) : private theorem sin_le_linear_sub_cubic {x : ℝ} (hx0 : 0 ≤ x) (hxhalf : x ≤ (1 / 2 : ℝ)) : Real.sin x ≤ x - (4 / 25 : ℝ) * x ^ 3 := by - have hx1 : x ≤ (1 : ℝ) := by linarith + have hx1 : x ≤ (1 : ℝ) := by linear_combination hxhalf have hsin := sin_le_quintic hx0 hx1 have hsq : x ^ 2 ≤ (1 / 4 : ℝ) := by linarith only [mul_nonneg hx0 (sub_nonneg.mpr hxhalf), hxhalf] have hcub : 0 ≤ x ^ 3 := pow_nonneg hx0 _ have hfifth : x ^ 5 ≤ x ^ 3 / 4 := by have hprod := mul_nonneg hcub (sub_nonneg.mpr hsq) - linarith [show x ^ 5 = x ^ 3 * x ^ 2 by ring] - linarith + linarith only [show x ^ 5 = x ^ 3 * x ^ 2 by ring, hprod] + linarith only [hsin, hcub, hfifth] private theorem sinc_abs (x : ℝ) : Real.sinc |x| = Real.sinc x := by rcases le_total 0 x with hx | hx @@ -2100,13 +2106,13 @@ private theorem sinc_quadratic_gap_nonneg {x : ℝ} have hsin := sin_le_linear_sub_cubic hxpos.le hxhalf have hfrac : Real.sin x / x ≤ 1 - (4 / 25 : ℝ) * x ^ 2 := by apply (div_le_iff₀ hxpos).2 - linarith - linarith + linear_combination hsin + linear_combination hfrac private theorem abs_sinc_le_twentyfour_twentyfive {x : ℝ} (hx : (1 / 2 : ℝ) ≤ x) : |Real.sinc x| ≤ (24 / 25 : ℝ) := by - have hxpos : 0 < x := by linarith + have hxpos : 0 < x := by linear_combination hx have hhalf : Real.sin (1 / 2 : ℝ) ≤ (12 / 25 : ℝ) := by have h := sin_le_quintic (x := (1 / 2 : ℝ)) (by norm_num) (by norm_num) norm_num at h ⊢ @@ -2125,7 +2131,7 @@ private theorem abs_sinc_le_twentyfour_twentyfive {x : ℝ} · have hslope := strictConcaveOn_sin_Icc.secant_strict_mono (a := (0 : ℝ)) (x := (1 / 2 : ℝ)) (y := x) ⟨le_rfl, Real.pi_pos.le⟩ - ⟨by norm_num, by linarith [Real.pi_gt_three]⟩ + ⟨by norm_num, by linarith only [Real.pi_gt_three, hxpi, hlt]⟩ ⟨hxpos.le, hxpi⟩ (by norm_num) hxpos.ne' hlt simp only [Real.sin_zero, sub_zero] at hslope @@ -2144,12 +2150,12 @@ private theorem sinc_explicit (T : ℝ) : rw [← sinc_abs (T / 2)] simp only [abs_div, Nat.abs_ofNat] by_cases hsmall : |T| ≤ 1 - · have hxhalf : |T| / 2 ≤ (1 / 2 : ℝ) := by linarith + · have hxhalf : |T| / 2 ≤ (1 / 2 : ℝ) := by linarith only [hsmall] have hgap := sinc_quadratic_gap_nonneg (x := |T| / 2) (by positivity) hxhalf have hsq : T ^ 2 ≤ (1 : ℝ) := by have habsq : |T| ^ 2 ≤ (1 : ℝ) := by - linarith [mul_nonneg (abs_nonneg T) (sub_nonneg.mpr hsmall)] + linarith only [mul_nonneg (abs_nonneg T) (sub_nonneg.mpr hsmall), hsmall] simpa only [sq_abs] using! habsq have hscaled : (4 / 25 : ℝ) * (|T| / 2) ^ 2 = @@ -2161,12 +2167,12 @@ private theorem sinc_explicit (T : ℝ) : · have hlarge : 1 ≤ |T| := le_of_not_ge hsmall have hsq : (1 : ℝ) ≤ T ^ 2 := by have habsq : (1 : ℝ) ≤ |T| ^ 2 := by - linarith [sq_nonneg (|T| - 1)] + linarith only [sq_nonneg (|T| - 1), hsmall] simpa only [sq_abs] using! habsq have hgap := abs_sinc_le_twentyfour_twentyfive - (x := |T| / 2) (by linarith) + (x := |T| / 2) (by linarith only [hsmall]) rw [min_eq_right hsq, hsinc] - linarith + linear_combination hgap private theorem shellOscillation_lower_bound (B T : ℝ) : (1 / 25 : ℝ) * min (T ^ 2) 1 ≤ shellOscillation B T := by @@ -2182,7 +2188,7 @@ private theorem shellOscillation_lower_bound (B T : ℝ) : abs_mul _ _ _ ≤ |Real.sinc (T / 2)| := mul_le_of_le_one_right (abs_nonneg _) hcos - linarith [sinc_explicit T] + linarith only [sinc_explicit T, hprod] private theorem cosh_ratio_lower {a δ : ℝ} (ha : 0 ≤ a) (hδ : 0 ≤ δ) : Real.exp (δ * a) / 2 ≤ @@ -2191,7 +2197,7 @@ private theorem cosh_ratio_lower {a δ : ℝ} (ha : 0 ≤ a) (hδ : 0 ≤ δ) : rw [show (1 + δ) * a = a + δ * a by ring, Real.cosh_add] have hq : Real.exp (δ * a) / 2 ≤ Real.cosh (δ * a) := by rw [Real.cosh_eq] - linarith [Real.exp_pos (-(δ * a))] + linarith only [Real.exp_pos (-(δ * a))] calc Real.exp (δ * a) / 2 * Real.cosh a = Real.cosh a * (Real.exp (δ * a) / 2) := by ring @@ -2254,7 +2260,7 @@ private theorem positiveShellDamping_lower_bound {ε ℓ δ T : ℝ} (fun a : ℝ => C * (1 - Real.cos (a * T))) := continuous_const.mul hosc have hcosh : Continuous (fun a : ℝ => Real.cosh ((1 + δ) * a)) := by - fun_prop + exact Continuous.comp' Real.continuous_cosh (Continuous.const_mul continuous_id' (1 + δ)) have hright : Continuous (fun a : ℝ => positiveShellDensity ε a * Real.cosh ((1 + δ) * a) * (1 - Real.cos (a * T))) := @@ -2273,7 +2279,9 @@ private theorem positiveShellDamping_lower_bound {ε ℓ δ T : ℝ} try dsimp [C, positiveShellDensity] calc shellWeight ε * Real.exp (δ * B) / 2 - ≤ shellWeight ε * Real.exp (δ * a) / 2 := by gcongr + ≤ shellWeight ε * Real.exp (δ * a) / 2 := by + exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left he (le_of_lt hQ)) + zero_le_two _ ≤ shellWeight ε * (Real.cosh ((1 + δ) * a) / Real.cosh a) := by calc @@ -2287,7 +2295,7 @@ private theorem positiveShellDamping_lower_bound {ε ℓ δ T : ℝ} exact mul_le_mul_of_nonneg_right hbase (sub_nonneg.mpr (Real.cos_le_one _)) have hmono := intervalIntegral.integral_mono_on - (μ := volume) (show B ≤ B + 1 by linarith) + (μ := volume) (show B ≤ B + 1 by linarith only []) (hleft.intervalIntegrable _ _) (hright.intervalIntegrable _ _) hpoint have hleftIntegral : @@ -2307,12 +2315,17 @@ private theorem positiveShellDamping_lower_bound {ε ℓ δ T : ℝ} try dsimp [C] ring _ ≤ ℓ * (C * shellOscillation B T) := by - gcongr + refine mul_le_mul_of_nonneg_left + (mul_le_mul_of_nonneg_left ?_ + (le_of_lt + (div_pos (mul_pos hQ (Real.exp_pos (δ * B))) + (zero_lt_two)))) + hℓ exact shellOscillation_lower_bound B T _ ≤ ℓ * ∫ a in B..B + 1, positiveShellDensity ε a * Real.cosh ((1 + δ) * a) * (1 - Real.cos (a * T)) := by - gcongr + exact mul_le_mul_of_nonneg_left hmono hℓ private noncomputable def positiveShellRadiusContribution (ε : ℝ) : ℝ := ∫ a in (ε⁻¹ ^ 3)..(ε⁻¹ ^ 3 + 1), @@ -2342,7 +2355,7 @@ private theorem positiveShellRadiusContribution_bounds {ε : ℝ} (hε : 0 < ε) (fun a : ℝ => positiveShellDensity ε a * a * Real.sinh ((1 + δ) * a)) := by have hsinh : Continuous (fun a : ℝ => Real.sinh ((1 + δ) * a)) := by - fun_prop + exact Continuous.comp' Real.continuous_sinh (Continuous.const_mul continuous_id' (1 + δ)) exact (hden.mul continuous_id).mul hsinh have hnonneg : ∀ a ∈ Set.Icc B (B + 1), 0 ≤ positiveShellDensity ε a * a * @@ -2354,7 +2367,7 @@ private theorem positiveShellRadiusContribution_bounds {ε : ℝ} (hε : 0 < ε) exact (div_pos hQ (Real.cosh_pos a)).le exact mul_nonneg (mul_nonneg hden0 ha0) (Real.sinh_nonneg_iff.mpr - (mul_nonneg (by linarith : 0 ≤ 1 + δ) ha0)) + (mul_nonneg (by linear_combination hδ : 0 ≤ 1 + δ) ha0)) have hpoint : ∀ a ∈ Set.Icc B (B + 1), positiveShellDensity ε a * a * Real.sinh ((1 + δ) * a) ≤ K := by intro a ha @@ -2369,7 +2382,7 @@ private theorem positiveShellRadiusContribution_bounds {ε : ℝ} (hε : 0 < ε) positiveShellDensity ε a * a * Real.sinh ((1 + δ) * a) ≤ positiveShellDensity ε a * a * Real.cosh ((1 + δ) * a) := by - gcongr + refine mul_le_mul_of_nonneg_left ?_ (mul_nonneg hden0 ha0) exact (Real.sinh_lt_cosh (x := (1 + δ) * a)).le _ = shellWeight ε * a * (Real.cosh ((1 + δ) * a) / Real.cosh a) := by @@ -2386,11 +2399,11 @@ private theorem positiveShellRadiusContribution_bounds {ε : ℝ} (hε : 0 < ε) constructor · change 0 ≤ ∫ a in B..B + 1, positiveShellDensity ε a * a * Real.sinh ((1 + δ) * a) - exact intervalIntegral.integral_nonneg (by linarith) hnonneg + exact intervalIntegral.integral_nonneg (by linarith only []) hnonneg · change (∫ a in B..B + 1, positiveShellDensity ε a * a * Real.sinh ((1 + δ) * a)) ≤ K have hmono := intervalIntegral.integral_mono_on (μ := volume) - (show B ≤ B + 1 by linarith) + (show B ≤ B + 1 by linarith only []) (hright.intervalIntegrable _ _) ((continuous_const : Continuous (fun _ : ℝ => K)).intervalIntegrable _ _) hpoint @@ -2630,7 +2643,7 @@ private theorem positiveShellOscillatoryIntegral_continuous (ε : ℝ) : continuous_parametric_integral_of_continuous (μ := volume) hF isCompact_Icc have horder : (ε⁻¹ ^ 3) ≤ (ε⁻¹ ^ 3) + 1 := by - linarith + linarith only [] have hident (t : ℝ) : (∫ a in (ε⁻¹ ^ 3)..(ε⁻¹ ^ 3 + 1), positiveShellDensity ε a * (Real.cos (a * t) - 1)) = @@ -2699,7 +2712,7 @@ private theorem complexShellInterval_differentiable simpa only [id_eq, mul_one] using! (hasDerivAt_id z).const_mul (x : ℂ) have hcos := (Complex.hasDerivAt_cos ((x : ℂ) * z)).comp z hlinear - simpa [F, F', mul_assoc] using! + simpa only [F, F', mul_assoc] using! (hcos.sub_const (1 : ℂ)).const_mul (w x : ℂ) have hrewrite : (fun z : ℂ => @@ -2784,7 +2797,7 @@ private theorem mellinShellPhase_continuous {ε : ℝ} try dsimp [w] rw [max_eq_left ha.1] have hremote : (ε⁻¹ ^ 3) ≤ (ε⁻¹ ^ 3) + 1 := by - linarith + linarith only [] have hpositive : Continuous (fun z : ℂ => ∫ a in (ε⁻¹ ^ 3)..(ε⁻¹ ^ 3 + 1), (positiveShellDensity ε a : ℂ) * @@ -2837,7 +2850,7 @@ private theorem mellinShellPhase_differentiable {ε : ℝ} rw [hshort_eq] exact complexShellInterval_differentiable w hw horder have hremote : (ε⁻¹ ^ 3) ≤ (ε⁻¹ ^ 3) + 1 := by - linarith + linarith only [] have hpositive : Differentiable ℂ (fun z : ℂ => ∫ a in (ε⁻¹ ^ 3)..(ε⁻¹ ^ 3 + 1), (positiveShellDensity ε a : ℂ) * @@ -2868,8 +2881,8 @@ private theorem abs_realOscillatoryShellPhase_le {ε : ℝ} have hcos (a : ℝ) : |Real.cos (a * t) - 1| ≤ 2 := by apply (abs_le).2 constructor - · linarith [Real.neg_one_le_cos (a * t)] - · linarith [Real.cos_le_one (a * t)] + · linarith only [Real.neg_one_le_cos (a * t)] + · linarith only [Real.cos_le_one (a * t)] have hosc : Continuous (fun a : ℝ => Real.cos (a * t) - 1) := by fun_prop have hs := shortShellDensity_intervalIntegrable hε horder @@ -2899,7 +2912,7 @@ private theorem abs_realOscillatoryShellPhase_le {ε : ℝ} |shortShellDensity ε a| * |Real.cos (a * t) - 1| ≤ |shortShellDensity ε a| * 2 := by - gcongr + refine mul_le_mul_of_nonneg_left ?_ (abs_nonneg (shortShellDensity ε a)) exact hcos a _ = 2 * |shortShellDensity ε a| := by ring _ = 2 * ∫ a in (ε ^ 3)..(10 * Real.log (1 / ε)), @@ -2928,7 +2941,7 @@ private theorem abs_realOscillatoryShellPhase_le {ε : ℝ} |positiveShellDensity ε a| * |Real.cos (a * t) - 1| ≤ |positiveShellDensity ε a| * 2 := by - gcongr + refine mul_le_mul_of_nonneg_left ?_ (abs_nonneg (positiveShellDensity ε a)) exact hcos a _ = 2 * |positiveShellDensity ε a| := by ring _ = 2 * ∫ a in (ε⁻¹ ^ 3)..(ε⁻¹ ^ 3 + 1), @@ -2993,7 +3006,7 @@ private theorem saddleVerticalGamma_continuous {ℓ : ℝ} (hℓ : 0 < ℓ) : have hre := congrArg Complex.re hm norm_num at hre have hmnonneg : (0 : ℝ) ≤ (m : ℝ) := Nat.cast_nonneg m - linarith + linarith only [hz, hre] have harg : ContinuousAt (fun u : ℝ => ((ℓ : ℂ) - Complex.I * (u : ℂ)) / 2) t := ((continuous_const.sub @@ -3026,7 +3039,10 @@ private theorem saddleEnvelope_continuous {ε ℓ : ℝ} have hunit : Continuous (fun t : ℝ => Complex.exp (Complex.I * (t : ℂ) * (Real.log Real.pi : ℂ) / 2)) := by - fun_prop + exact Continuous.cexp + (Continuous.comp' (Continuous.div_const continuous_id' 2) + (Continuous.comp' (continuous_mul_const ↑(Real.log Real.pi)) + (Continuous.const_mul Complex.continuous_ofReal Complex.I))) have hgamma := saddleVerticalGamma_continuous hℓ have hphase : Continuous (fun t : ℝ => Complex.exp ((ℓ : ℂ) * @@ -3128,7 +3144,8 @@ private theorem saddleRegularMellinFactor_continuous {ε : ℝ} fun_prop have harg : Continuous (fun z : ℂ => Complex.I * (z - (ℓ : ℂ)) / (ℓ : ℂ)) := by - fun_prop + exact Continuous.comp' (Continuous.div_const continuous_id' ↑ℓ) + (Continuous.const_mul (Continuous.fun_sub continuous_id' continuous_const) Complex.I) have hphase : Continuous (fun z : ℂ => Complex.exp ((ℓ : ℂ) * mellinShellPhase ε @@ -3148,7 +3165,8 @@ private theorem saddleRegularMellinFactor_differentiable {ε : ℝ} fun_prop have harg : Differentiable ℂ (fun z : ℂ => Complex.I * (z - (ℓ : ℂ)) / (ℓ : ℂ)) := by - fun_prop + exact Differentiable.div_const + (Differentiable.const_mul (Differentiable.sub_const differentiable_id ↑ℓ) Complex.I) ↑ℓ have hphase : Differentiable ℂ (fun z : ℂ => Complex.exp ((ℓ : ℂ) * mellinShellPhase ε @@ -3202,7 +3220,7 @@ private theorem saddleMellinGamma_meromorphic : have hg : MeromorphicAt Complex.Gamma (z / 2) := Meromorphic.Gamma (z / 2) have ha : AnalyticAt ℂ (fun u : ℂ => u / 2) z := by - fun_prop + exact AnalyticAt.div_const analyticAt_id simpa only [Function.comp_def] using! (MeromorphicAt.comp_analyticAt (g := fun u : ℂ => u / 2) (x := z) hg ha) @@ -3676,7 +3694,7 @@ private theorem saddleNthGammaPoleNumerator_differentiableOn (n : ℕ) : change -(2 * ((n : ℝ) + 1)) < z.re ∧ z.re < -(2 * (n : ℝ)) + 1 at hz - linarith [hz.1] + linarith only [hz.1, hz] have hgamma : DifferentiableAt ℂ Complex.Gamma (z / 2 + ((n + 1 : ℕ) : ℂ)) := @@ -4126,7 +4144,7 @@ private theorem saddlePoleCoordinate_ne_zero_at_other have hreal := congrArg Complex.re hzero norm_num [Nat.cast_mul, Complex.mul_re] at hreal have heq : (m : ℝ) = (n : ℝ) := by - linarith + linarith only [hreal] exact_mod_cast heq private noncomputable def plusSaddleFinitePoleRemaining @@ -4157,7 +4175,7 @@ private theorem plusSaddleFinitePoleRemaining_differentiableAt_pole DifferentiableAt ℂ (fun _ : ℂ => plusSaddlePoleResidue ε ℓ m) (-((2 * n : ℕ) : ℂ)) := by - fun_prop + exact differentiableAt_const (plusSaddlePoleResidue ε ℓ m) have hdenominator : DifferentiableAt ℂ (fun z : ℂ => z + ((2 * m : ℕ) : ℂ)) @@ -4181,7 +4199,7 @@ private theorem minusSaddleFinitePoleRemaining_differentiableAt_pole DifferentiableAt ℂ (fun _ : ℂ => minusSaddlePoleResidue ε ℓ m) (-((2 * n : ℕ) : ℂ)) := by - fun_prop + exact differentiableAt_const (minusSaddlePoleResidue ε ℓ m) have hdenominator : DifferentiableAt ℂ (fun z : ℂ => z + ((2 * m : ℕ) : ℂ)) @@ -4210,7 +4228,7 @@ private theorem plusSaddleFinitePoleSubtraction_differentiableAt_of_not_pole have hconstant : DifferentiableAt ℂ (fun _ : ℂ => plusSaddlePoleResidue ε ℓ n) z := by - fun_prop + exact differentiableAt_const (plusSaddlePoleResidue ε ℓ n) have hdenominator : DifferentiableAt ℂ (fun w : ℂ => w + ((2 * n : ℕ) : ℂ)) z := by @@ -4238,7 +4256,7 @@ private theorem minusSaddleFinitePoleSubtraction_differentiableAt_of_not_pole have hconstant : DifferentiableAt ℂ (fun _ : ℂ => minusSaddlePoleResidue ε ℓ n) z := by - fun_prop + exact differentiableAt_const (minusSaddlePoleResidue ε ℓ n) have hdenominator : DifferentiableAt ℂ (fun w : ℂ => w + ((2 * n : ℕ) : ℂ)) z := by @@ -4599,7 +4617,8 @@ private theorem saddleMellinInversePower_differentiable change Differentiable ℂ (fun z : ℂ => (r : ℂ) ^ (-z)) rw [hform] - fun_prop + exact Differentiable.cexp + (Differentiable.const_mul (Differentiable.fun_neg differentiable_id) (Complex.log ↑r)) private noncomputable def saddleGaussianPoleSlope (z : ℂ) : ℂ := dslope (fun w : ℂ => Complex.exp (w ^ 2)) 0 z @@ -4609,7 +4628,7 @@ private theorem saddleGaussianPoleSlope_differentiable : have hgaussian : Differentiable ℂ (fun w : ℂ => Complex.exp (w ^ 2)) := by - fun_prop + exact Differentiable.cexp (Differentiable.fun_pow differentiable_id 2) unfold saddleGaussianPoleSlope exact differentiableOn_univ.mp ((Complex.differentiableOn_dslope @@ -4683,7 +4702,7 @@ private theorem plusSaddleFiniteRapidPoleRegularPart_differentiableOn have hconstant : DifferentiableOn ℂ (fun _ : ℂ => plusSaddlePoleResidue ε ℓ n) (saddleFinitePoleHalfPlane N) := by - fun_prop + exact differentiableOn_const (plusSaddlePoleResidue ε ℓ n) have hslope : Differentiable ℂ (fun z : ℂ => saddleGaussianPoleSlope (z + ((2 * n : ℕ) : ℂ))) := @@ -4705,7 +4724,7 @@ private theorem minusSaddleFiniteRapidPoleRegularPart_differentiableOn have hconstant : DifferentiableOn ℂ (fun _ : ℂ => minusSaddlePoleResidue ε ℓ n) (saddleFinitePoleHalfPlane N) := by - fun_prop + exact differentiableOn_const (minusSaddlePoleResidue ε ℓ n) have hslope : Differentiable ℂ (fun z : ℂ => saddleGaussianPoleSlope (z + ((2 * n : ℕ) : ℂ))) := @@ -4999,9 +5018,9 @@ private theorem norm_plusPolynomial_le (ε : ℝ) (z : ℂ) : norm_add_le _ _ _ = 1 + ‖z‖ ^ 2 := by simp only [norm_one, norm_pow] have hsq : 1 + ‖z‖ ^ 2 ≤ (1 + ‖z‖) ^ 2 := by - linarith + linarith only [hz] have hcube : (1 : ℝ) ≤ (1 + ‖z‖) ^ 3 := - one_le_pow₀ (by linarith) + one_le_pow₀ (by linarith only [hz]) unfold plusPolynomial calc ‖1 + z ^ 2 + ((ε / 4 : ℝ) : ℂ) + @@ -5025,15 +5044,14 @@ private theorem norm_plusPolynomial_le (ε : ℝ) (z : ℂ) : ‖Complex.I * z * (1 + z ^ 2)‖ ≤ ‖z‖ * (1 + ‖z‖ ^ 2) := by rw [norm_mul, norm_mul, Complex.norm_I, one_mul] - gcongr + exact mul_le_mul_of_nonneg_left hbase (norm_nonneg z) exact add_le_add hfirst hsecond _ ≤ (1 + ‖z‖) ^ 2 + |(ε / 4)| + ‖z‖ * (1 + ‖z‖) ^ 2 := by gcongr _ = (1 + ‖z‖) ^ 3 + |(ε / 4)| := by ring _ ≤ (1 + |(ε / 4)|) * (1 + ‖z‖) ^ 3 := by - linarith [mul_le_mul_of_nonneg_left hcube - (abs_nonneg (ε / 4))] + linarith only [mul_le_mul_of_nonneg_left hcube (abs_nonneg (ε / 4)), hcube] private theorem norm_minusPolynomial_le (ε : ℝ) (z : ℂ) : ‖minusPolynomial ε z‖ ≤ @@ -5074,7 +5092,7 @@ private theorem complexGamma_vertical_polynomial_bound {z : ℂ} have hre := congrArg Complex.re hzero norm_num at hre have hj : 0 ≤ (j : ℝ) := Nat.cast_nonneg j - linarith + linarith only [hz, hre] have hprod : |z.im| ^ k ≤ ∏ j ∈ Finset.range k, ‖z + (j : ℂ)‖ := by @@ -5094,7 +5112,7 @@ private theorem complexGamma_vertical_polynomial_bound {z : ℂ} |z.im| ^ k * ‖Complex.Gamma z‖ ≤ (∏ j ∈ Finset.range k, ‖z + (j : ℂ)‖) * ‖Complex.Gamma z‖ := by - gcongr + exact mul_le_mul_of_nonneg_right hprod (norm_nonneg (Complex.Gamma z)) _ = ‖Complex.Gamma z * ∏ j ∈ Finset.range k, (z + (j : ℂ))‖ := by rw [norm_mul, norm_prod] @@ -5133,7 +5151,7 @@ private theorem complexGamma_shifted_vertical_polynomial_bound |z.im| ^ k * ‖Complex.Gamma z‖ ≤ (∏ j ∈ Finset.range k, ‖z + (j : ℂ)‖) * ‖Complex.Gamma z‖ := by - gcongr + exact mul_le_mul_of_nonneg_right hprod (norm_nonneg (Complex.Gamma z)) _ = ‖Complex.Gamma z * ∏ j ∈ Finset.range k, (z + (j : ℂ))‖ := by rw [norm_mul, norm_prod] @@ -5187,7 +5205,7 @@ private theorem saddleGamma_shiftedLine_polynomial_bound calc |t| ^ m * ‖Complex.Gamma z‖ ≤ |t| ^ (k + m) * ‖Complex.Gamma z‖ := by - gcongr + exact mul_le_mul_of_nonneg_right hpow (norm_nonneg (Complex.Gamma z)) _ = (2 : ℝ) ^ (k + m) * ((|t| / 2) ^ (k + m) * ‖Complex.Gamma z‖) := by @@ -5196,7 +5214,11 @@ private theorem saddleGamma_shiftedLine_polynomial_bound _ ≤ (2 : ℝ) ^ (k + m) * Real.Gamma (a / 2 + ((k + m : ℕ) : ℝ)) := by - gcongr + exact mul_le_mul_of_nonneg_left hgamma + (le_of_lt + (pow_pos + (zero_lt_two) + (k + m))) private theorem norm_complexCos_le_cosh_im (z : ℂ) : ‖Complex.cos z‖ ≤ Real.cosh z.im := by @@ -5212,7 +5234,8 @@ private theorem norm_complexCos_le_cosh_im (z : ℂ) : norm_num _ ≤ (‖Complex.exp (z * Complex.I)‖ + ‖Complex.exp (-z * Complex.I)‖) / 2 := by - gcongr + refine div_le_div_of_nonneg_right ?_ + zero_le_two exact norm_add_le _ _ _ = Real.cosh z.im := by rw [Complex.norm_exp, Complex.norm_exp, @@ -5236,10 +5259,10 @@ private theorem saddleHorizontalShellVariation_mono have hK : 0 ≤ K := hH.trans hHK have hcosH : Continuous (fun a : ℝ => Real.cosh (a * H) + 1) := by - fun_prop + exact Continuous.add_const (Continuous.comp' Real.continuous_cosh (continuous_mul_const H)) 1 have hcosK : Continuous (fun a : ℝ => Real.cosh (a * K) + 1) := by - fun_prop + exact Continuous.add_const (Continuous.comp' Real.continuous_cosh (continuous_mul_const K)) 1 have hcos (a : ℝ) : Real.cosh (a * H) ≤ Real.cosh (a * K) := by apply Real.cosh_le_cosh.mpr @@ -5262,7 +5285,7 @@ private theorem saddleHorizontalShellVariation_mono gcongr exact hcos a have hB : (ε⁻¹ ^ 3) ≤ (ε⁻¹ ^ 3) + 1 := by - linarith + linarith only [] have hp : IntervalIntegrable (positiveShellDensity ε) volume (ε⁻¹ ^ 3) ((ε⁻¹ ^ 3) + 1) := (positiveShellDensity_continuous ε).intervalIntegrable @@ -5295,7 +5318,7 @@ private theorem norm_mellinShellPhase_le_horizontalVariation positivity have hcosh : Continuous (fun a : ℝ => Real.cosh (a * H) + 1) := by - fun_prop + exact Continuous.add_const (Continuous.comp' Real.continuous_cosh (continuous_mul_const H)) 1 have hcos (a : ℝ) (ha : 0 ≤ a) : ‖Complex.cos ((a : ℂ) * z) - 1‖ ≤ Real.cosh (a * H) + 1 := by @@ -5312,10 +5335,10 @@ private theorem norm_mellinShellPhase_le_horizontalVariation _ = ‖Complex.cos ((a : ℂ) * z)‖ + 1 := by norm_num _ ≤ Real.cosh ((a : ℂ) * z).im + 1 := by - gcongr + refine add_le_add ?_ (le_refl 1) exact norm_complexCos_le_cosh_im ((a : ℂ) * z) _ ≤ Real.cosh (a * H) + 1 := by - gcongr + refine add_le_add ?_ (le_refl 1) exact Real.cosh_le_cosh.mpr him have hshort : ‖∫ a in (ε ^ 3)..(10 * Real.log (1 / ε)), @@ -5333,7 +5356,7 @@ private theorem norm_mellinShellPhase_le_horizontalVariation · exact (shortShellDensity_intervalIntegrable hε horder).abs.mul_continuousOn hcosh.continuousOn have hB : (ε⁻¹ ^ 3) ≤ (ε⁻¹ ^ 3) + 1 := by - linarith + linarith only [] have hpositive : ‖∫ a in (ε⁻¹ ^ 3)..(ε⁻¹ ^ 3 + 1), (positiveShellDensity ε a : ℂ) * @@ -5369,7 +5392,7 @@ private theorem norm_saddleShellExponential_horizontal_le _ = |ℓ| * ‖mellinShellPhase ε z‖ := by rw [norm_mul, Complex.norm_real, Real.norm_eq_abs] _ ≤ |ℓ| * saddleHorizontalShellVariation ε |z.im| := by - gcongr + refine mul_le_mul_of_nonneg_left ?_ (abs_nonneg ℓ) exact norm_mellinShellPhase_le_horizontalVariation hε horder (le_refl |z.im|) @@ -5469,10 +5492,10 @@ private theorem saddleMellinShellArgument_shiftedLine_linear_le (abs_nonneg ((a - ℓ) / ℓ)) calc _ ≤ 1 + (|t| / ℓ + |(a - ℓ) / ℓ|) := by - gcongr + exact add_le_add (le_refl 1) hargument _ ≤ |t| + |t| / ℓ + |(a - ℓ) / ℓ| * |t| := by - linarith + linear_combination ht + hoffset _ = _ := by rw [div_eq_mul_inv] ring @@ -5760,11 +5783,11 @@ private theorem saddleShiftedGamma_continuousOn intro a ha change 0 < a / 2 + ((k + (m + 3) : ℕ) : ℝ) have ha' : A / 2 ≤ a / 2 := by - linarith [ha.1] + linarith only [ha.1, ha] rw [Nat.cast_add] have hm : (0 : ℝ) ≤ ((m + 3 : ℕ) : ℝ) := Nat.cast_nonneg _ - linarith + linarith only [hshift, ha'] private theorem saddleFixedStripMajorant_continuousOn {A B : ℝ} (ε ℓ H : ℝ) (k m : ℕ) @@ -5812,7 +5835,7 @@ private theorem plusSaddleMellinData_horizontalStrip_polynomial_bound ((a : ℂ) + (t : ℂ) * Complex.I)‖ ≤ C := by obtain ⟨k, hk⟩ := exists_nat_gt (-(A / 2)) have hshiftA : 0 < A / 2 + (k : ℝ) := by - linarith + linear_combination hk let H : ℝ := saddleHorizontalStripHeight ℓ A B have hcont : ContinuousOn (fun a : ℝ => saddleFixedStripMajorant ε ℓ H a k m) @@ -5860,7 +5883,7 @@ private theorem minusSaddleMellinData_horizontalStrip_polynomial_bound ((a : ℂ) + (t : ℂ) * Complex.I)‖ ≤ C := by obtain ⟨k, hk⟩ := exists_nat_gt (-(A / 2)) have hshiftA : 0 < A / 2 + (k : ℝ) := by - linarith + linear_combination hk let H : ℝ := saddleHorizontalStripHeight ℓ A B have hcont : ContinuousOn (fun a : ℝ => saddleFixedStripMajorant ε ℓ H a k m) @@ -5947,7 +5970,7 @@ private theorem norm_saddleShellExponential_le {ε ℓ : ℝ} _ = |ℓ| * |realOscillatoryShellPhase ε (t / ℓ)| := abs_mul _ _ _ ≤ |ℓ| * (2 * saddleShellTotalVariation ε) := by - gcongr + refine mul_le_mul_of_nonneg_left ?_ (abs_nonneg ℓ) exact abs_realOscillatoryShellPhase_le hε horder (t / ℓ) _ = 2 * |ℓ| * saddleShellTotalVariation ε := by ring @@ -5980,7 +6003,11 @@ private theorem saddleEnvelope_vertical_polynomial_bound {ε ℓ : ℝ} rw [div_pow, div_mul_eq_mul_div, mul_div_assoc', mul_div_cancel_left₀ _ (pow_ne_zero k two_ne_zero)] _ ≤ (2 : ℝ) ^ k * Real.Gamma (ℓ / 2 + k) := by - gcongr + exact mul_le_mul_of_nonneg_left hgamma + (le_of_lt + (pow_pos + (zero_lt_two) + k)) have hunit : ‖Complex.exp (Complex.I * (t : ℂ) * (Real.log Real.pi : ℂ) / 2)‖ = 1 := by @@ -6073,7 +6100,8 @@ private theorem saddleEnvelope_weighted_norm_le ring _ ≤ |t| ^ k * ‖saddleEnvelope ε ℓ t‖ * ((1 + |(ε / 4)|) * (1 + ℓ⁻¹) ^ 3 * |t| ^ 3) := by - gcongr + exact mul_le_mul_of_nonneg_left hpoly + (mul_nonneg (pow_nonneg (abs_nonneg t) k) (norm_nonneg (saddleEnvelope ε ℓ t))) _ = ((1 + |(ε / 4)|) * (1 + ℓ⁻¹) ^ 3) * (|t| ^ (k + 3) * ‖saddleEnvelope ε ℓ t‖) := by rw [pow_add] @@ -6138,7 +6166,7 @@ private theorem integrable_of_continuous_polynomial_decay calc (|t| ^ k * ‖F t‖) * (1 + t ^ 2) ≤ (|t| ^ k * ‖F t‖) * (2 * t ^ 2) := - mul_le_mul_of_nonneg_left (by linarith only [hsquare]) + mul_le_mul_of_nonneg_left (by linear_combination hsquare) (mul_nonneg (pow_nonneg (abs_nonneg t) _) (norm_nonneg _)) _ = 2 * (|t| ^ (k + 2) * ‖F t‖) := by rw [pow_add, sq_abs]; ring _ ≤ 2 * C := mul_le_mul_of_nonneg_left (htail t ht) (by norm_num) @@ -6216,7 +6244,7 @@ private theorem plusSaddleMellinData_shiftedLine_moment_integrable intro m obtain ⟨k, hk⟩ := exists_nat_gt (-(a / 2)) have hshift : 0 < a / 2 + (k : ℝ) := by - linarith + linear_combination hk refine ⟨saddleShiftedLineMajorant ε ℓ a k m, saddleShiftedLineMajorant_nonneg hℓ k m hshift, ?_⟩ intro t ht @@ -6237,7 +6265,7 @@ private theorem minusSaddleMellinData_shiftedLine_moment_integrable intro m obtain ⟨k, hk⟩ := exists_nat_gt (-(a / 2)) have hshift : 0 < a / 2 + (k : ℝ) := by - linarith + linear_combination hk refine ⟨saddleShiftedLineMajorant ε ℓ a k m, saddleShiftedLineMajorant_nonneg hℓ k m hshift, ?_⟩ intro t ht @@ -6371,7 +6399,7 @@ private theorem saddleGaussianPoleRepresentative_shiftedLine_continuous have hre := congrArg Complex.re hzero norm_num [Complex.mul_re] at hre push_cast - linarith + linear_combination hre unfold saddleGaussianPoleRepresentative exact (Complex.continuous_exp.comp (hline.pow 2)).div hline hnonzero @@ -6387,7 +6415,7 @@ private theorem saddleGaussianPoleRepresentative_shiftedLine_bound have hreal : a + ((2 * n : ℕ) : ℝ) ≠ 0 := by intro hzero apply ha - linarith + linear_combination hzero have habs : 0 < |a + ((2 * n : ℕ) : ℝ)| := abs_pos.mpr hreal have hden : @@ -7097,7 +7125,7 @@ private theorem saddleCauchyPolePrimitive_hasDerivAt (((a : ℂ) + (t : ℂ) * Complex.I)⁻¹) t := by have hden : a ^ 2 + t ^ 2 ≠ 0 := by have ha2 : 0 < a ^ 2 := sq_pos_of_ne_zero ha - linarith [sq_nonneg t] + linarith only [sq_nonneg t, ha2] have hatan : HasDerivAt (fun y : ℝ => Real.arctan (y / a)) (a / (a ^ 2 + t ^ 2)) t := by @@ -7164,7 +7192,7 @@ private theorem saddleCauchyPole_symmetric_intervalIntegral (fun t _ => saddleCauchyPolePrimitive_hasDerivAt ha t) hint] unfold saddleCauchyPolePrimitive - simp only [Complex.ofReal_arctan, Complex.ofReal_div, pow_two, Complex.ofReal_ofNat, neg_div, + simp only [Complex.ofReal_div, pow_two, Complex.ofReal_ofNat, neg_div, Real.arctan_neg, Complex.ofReal_neg, mul_neg, neg_mul, neg_neg, sub_sub_sub_cancel_right, sub_neg_eq_add, Complex.ofReal_mul]; ring @@ -7474,10 +7502,10 @@ private theorem integrable_scaled_norm_moment (norm_nonneg _))] apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) rw [abs_mul] - gcongr + refine pow_le_pow_left₀ (abs_nonneg y) ?_ k calc |y| = 1 * |y| := by ring - _ ≤ |c| * |y| := by gcongr + _ ≤ |c| * |y| := by exact mul_le_mul_of_nonneg_right hclarge (abs_nonneg y) simpa only [Real.norm_eq_abs] using! hresult private theorem plusSaddleFourierData_norm_moment_integrable {ε ℓ : ℝ} @@ -7493,12 +7521,12 @@ private theorem plusSaddleFourierData_norm_moment_integrable {ε ℓ : ℝ} have hclarge : 1 ≤ |c| := by try dsimp [c] rw [abs_neg, abs_of_pos (mul_pos (by norm_num) Real.pi_pos)] - linarith [Real.pi_gt_three] + linarith only [Real.pi_gt_three] have h := integrable_scaled_norm_moment (plusSaddleSpectrum_continuous hε hℓ horder) (fun j => plusSaddleSpectrum_norm_moment_integrable hε hℓ horder j) hc hclarge k - simpa [plusSaddleFourierData, c, neg_mul, mul_assoc] using! h + simpa only [plusSaddleFourierData, c, neg_mul, mul_assoc] using! h private theorem minusSaddleFourierData_norm_moment_integrable {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) @@ -7513,12 +7541,12 @@ private theorem minusSaddleFourierData_norm_moment_integrable {ε ℓ : ℝ} have hclarge : 1 ≤ |c| := by try dsimp [c] rw [abs_neg, abs_of_pos (mul_pos (by norm_num) Real.pi_pos)] - linarith [Real.pi_gt_three] + linarith only [Real.pi_gt_three] have h := integrable_scaled_norm_moment (minusSaddleSpectrum_continuous hε hℓ horder) (fun j => minusSaddleSpectrum_norm_moment_integrable hε hℓ horder j) hc hclarge k - simpa [minusSaddleFourierData, c, neg_mul, mul_assoc] using! h + simpa only [minusSaddleFourierData, c, neg_mul, mul_assoc] using! h private theorem plusSaddleFourierData_fourier_contDiff {ε ℓ : ℝ} (hε : 0 < ε) (hℓ : 0 < ℓ) diff --git a/LeanPool/SpherePacking/GammaAnalysis.lean b/LeanPool/SpherePacking/GammaAnalysis.lean index e91fe1ff81..63e4c7e327 100644 --- a/LeanPool/SpherePacking/GammaAnalysis.lean +++ b/LeanPool/SpherePacking/GammaAnalysis.lean @@ -58,7 +58,7 @@ private theorem complexFrullaniSegment_re_pos {z w : ℂ} have hfirst : 0 ≤ (1 - s) * z.re := mul_nonneg (sub_nonneg.mpr hs.2) hz.le have hsecond : 0 < s * w.re := mul_pos hspos hw - linarith + linarith only [hfirst, hsecond] private noncomputable def complexFrullaniKernel (z w : ℂ) (x : ℝ) : ℂ := (Complex.exp (-z * (x : ℂ)) - @@ -97,7 +97,7 @@ private theorem intervalIntegral_complexLaplaceSegment have hinner := (complexFrullaniSegment_hasDerivAt z w s).neg.mul_const (x : ℂ) - convert! hinner.cexp.neg.div_const (x : ℂ) using 1 + convert hinner.cexp.neg.div_const (x : ℂ) using 1 · simp only [Pi.neg_apply] field_simp [hxc] have hcontinuous : @@ -137,7 +137,7 @@ private theorem complexFrullaniSegment_min_re_le have hsecond : 0 ≤ s * (w.re - min z.re w.re) := mul_nonneg hs.1 (sub_nonneg.mpr hwmin) - linarith + linarith only [hfirst, hsecond] private theorem complexFrullaniKernel_norm_le_exp (z w : ℂ) {x : ℝ} (hx : 0 < x) : @@ -384,13 +384,13 @@ private theorem complexFrullaniShiftKernel_norm_le_exp _ ≤ ‖(1 : ℂ) - z‖ + 1 := by rw [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hs.1] - linarith [hs.2] + linarith only [hs.2, hs] have hmin : min z.re 1 ≤ min (z + (s : ℂ)).re (1 : ℂ).re := by apply le_min · simp only [Complex.add_re, Complex.ofReal_re] - linarith [min_le_left z.re (1 : ℝ), hs.1] + linarith only [min_le_left z.re (1 : ℝ), hs.1, hs] · exact min_le_right z.re (1 : ℝ) calc ‖complexFrullaniKernel (z + (s : ℂ)) 1 x‖ ≤ @@ -444,7 +444,7 @@ private theorem complexFrullaniShiftParameter_integrable rw [Set.uIoc_of_le (show (0 : ℝ) ≤ 1 by norm_num)] at hs have hspositive : 0 < (z + (s : ℂ)).re := by simp only [Complex.add_re, Complex.ofReal_re] - linarith [hs.1] + linarith only [hs.1, hz, hs] change IntegrableOn (complexFrullaniKernel (z + (s : ℂ)) 1) @@ -467,7 +467,7 @@ private theorem complexFrullaniShiftParameter_integrable ⟨hs.1.le, hs.2⟩ have hspositive : 0 < (z + (s : ℂ)).re := by simp only [Complex.add_re, Complex.ofReal_re] - linarith [hs.1] + linarith only [hs.1, hz, hs] have hkernel := complexFrullaniKernel_integrable hspositive (by norm_num : 0 < (1 : ℂ).re) @@ -517,7 +517,7 @@ private theorem intervalIntegral_complexFrullaniShift (∫ s in (0 : ℝ)..1, Complex.exp (-(z + (s : ℂ)) * (x : ℂ))) = complexFrullaniKernel z (z + 1) x := by - convert! + convert intervalIntegral_complexLaplaceSegment z (z + 1) hx using 1 apply intervalIntegral.integral_congr @@ -588,13 +588,13 @@ private theorem complexWallisLogPrimitive_hasDerivAt have hline := complexWallisTranslatedSegment_hasDerivAt z s have hpositive : 0 < (z + (s : ℂ)).re := by simp only [Complex.add_re, Complex.ofReal_re] - linarith [hs.1] + linarith only [hs.1, hz, hs] have hslit : z + (s : ℂ) ∈ Complex.slitPlane := Complex.mem_slitPlane_iff.mpr (Or.inl hpositive) have hnonzero : z + (s : ℂ) ≠ 0 := Complex.slitPlane_ne_zero hslit have hlog := hline.clog_real hslit - convert! (hline.mul hlog).sub hline using 1 + convert (hline.mul hlog).sub hline using 1 simp only [one_mul, div_eq_mul_inv, ne_eq, hnonzero, not_false_eq_true, mul_inv_cancel₀, add_sub_cancel_right] @@ -605,7 +605,7 @@ private theorem intervalIntegral_complexWallisLog (z + 1) * Complex.log (z + 1) - z * Complex.log z - 1 := by have hline : Continuous (fun s : ℝ => z + (s : ℂ)) := by - fun_prop + exact Continuous.const_add Complex.continuous_ofReal z have hlog : ContinuousOn (fun s : ℝ => Complex.log (z + (s : ℂ))) @@ -616,7 +616,7 @@ private theorem intervalIntegral_complexWallisLog apply Complex.mem_slitPlane_iff.mpr left simp only [Complex.add_re, Complex.ofReal_re] - linarith [hs.1] + linarith only [hs.1, hz, hs] rw [intervalIntegral.integral_eq_sub_of_hasDerivAt (fun s hs => by rw [Set.uIcc_of_le (show (0 : ℝ) ≤ 1 by norm_num)] at hs @@ -652,7 +652,7 @@ private theorem integral_complexWallisPhaseKernel rw [Set.uIcc_of_le (show (0 : ℝ) ≤ 1 by norm_num)] at hs have hspositive : 0 < (z + (s : ℂ)).re := by simp only [Complex.add_re, Complex.ofReal_re] - linarith [hs.1] + linarith only [hs.1, hz, hs] change (∫ x : ℝ in Ioi 0, complexFrullaniKernel (z + (s : ℂ)) 1 x) = @@ -714,7 +714,7 @@ private theorem stripNormalizedPoissonKernel_eq_extension (x := 0) (y := stripAngle σ) (by norm_num) hangle.2.le hangle.1 simpa only [gt_iff_lt, Real.cos_zero] using! h - linarith [Real.one_le_cosh (Real.pi * T / 2)] + linarith only [Real.one_le_cosh (Real.pi * T / 2), hcos] rw [stripAngle_eq_pi_sub, Real.cos_pi_sub] at horiginal have hpositive : 0 < Real.cosh (Real.pi * T / 2) + @@ -731,7 +731,7 @@ private theorem stripNormalizedPoissonExtension_one (T : ℝ) : stripNormalizedPoissonExtension 1 T = limitingStripPoissonDensity T := by have hden : Real.cosh (Real.pi * T / 2) + 1 ≠ 0 := by - linarith [Real.one_le_cosh (Real.pi * T / 2)] + linarith only [Real.one_le_cosh (Real.pi * T / 2)] unfold stripNormalizedPoissonExtension limitingStripPoissonDensity simp only [sub_self, mul_zero, zero_div, Real.sinc_zero, Real.cos_zero, mul_one] @@ -743,13 +743,14 @@ private theorem stripNormalizedPoissonExtension_continuousAt_one (T : ℝ) : unfold stripNormalizedPoissonExtension have hangle : Continuous (fun σ : ℝ => Real.pi * (1 - σ) / 2) := by - fun_prop + exact Continuous.comp' (Continuous.div_const continuous_id' 2) + (Continuous.const_mul (Continuous.fun_sub continuous_const continuous_id') Real.pi) have hden : Real.cosh (Real.pi * T / 2) + Real.cos (Real.pi * (1 - (1 : ℝ)) / 2) ≠ 0 := by simp only [sub_self, mul_zero, zero_div, Real.cos_zero] have hcosh := Real.one_le_cosh (Real.pi * T / 2) - linarith + linarith only [hcosh] exact ((continuous_const.mul (Real.continuous_sinc.comp hangle)).continuousAt.div @@ -769,7 +770,7 @@ private theorem tendsto_stripNormalizedPoissonKernel (T : ℝ) : (fun σ : ℝ => stripNormalizedPoissonExtension σ T) := by filter_upwards [hpos, hlt] with σ hσpos hσlt exact stripNormalizedPoissonKernel_eq_extension - (by linarith) hσlt T + (by linarith only [hσpos, hσlt]) hσlt T have hext : Tendsto (fun σ : ℝ => stripNormalizedPoissonExtension σ T) (𝓝[<] 1) (𝓝 (limitingStripPoissonDensity T)) := by @@ -793,7 +794,7 @@ private theorem inv_cosh_le_two_exp_neg_abs (u : ℝ) : have hhalf : Real.exp |u| / 2 ≤ Real.cosh u := by rw [← Real.cosh_abs, Real.cosh_eq] have hpositive := (Real.exp_pos (-|u|)).le - linarith + linarith only [hpositive] rw [← one_div, div_le_iff₀ (Real.cosh_pos u)] calc (1 : ℝ) = @@ -817,15 +818,15 @@ private theorem stripNormalizedPoissonExtension_le_majorant have hqzero : 0 ≤ q := by try dsimp [q] exact div_nonneg (mul_nonneg Real.pi_pos.le (sub_nonneg.mpr hone)) - (by norm_num) + (by norm_num1) have hqlarge : q ≤ Real.pi / 2 := by try dsimp [q] - linarith [mul_nonneg Real.pi_pos.le hzero] + linarith only [mul_nonneg Real.pi_pos.le hzero, hzero] have hqpi : q ≤ Real.pi := by - linarith [Real.pi_pos] + linarith only [Real.pi_pos, hqzero, hqlarge] have hcos : 0 ≤ Real.cos q := Real.cos_nonneg_of_mem_Icc - ⟨by linarith [Real.pi_pos], hqlarge⟩ + ⟨by linarith only [Real.pi_pos, hqzero, hqlarge], hqlarge⟩ have hsinc : 0 ≤ Real.sinc q := by by_cases hq : q = 0 · simp only [hq, Real.sinc_zero, zero_le_one] @@ -835,11 +836,11 @@ private theorem stripNormalizedPoissonExtension_le_majorant have hden : 0 < Real.cosh u + Real.cos q := add_pos_of_pos_of_nonneg (Real.cosh_pos u) hcos have hcoefficient : 0 < Real.pi / 4 := - div_pos Real.pi_pos (by norm_num) + div_pos Real.pi_pos (by norm_num1) have habsu : |u| = (Real.pi / 2) * |T| := by try dsimp [u] rw [abs_div, abs_mul, abs_of_pos Real.pi_pos] - norm_num + norm_num1 ring constructor · unfold stripNormalizedPoissonExtension @@ -989,7 +990,7 @@ private theorem poissonLogistic_image_univ : constructor · positivity · apply (div_lt_one (by positivity)).2 - linarith + linarith only [] · intro hx have hratio : 0 < x / (1 - x) := div_pos hx.1 (sub_pos.mpr hx.2) @@ -1024,7 +1025,7 @@ private theorem poissonLogistic_injective : have hexp : Real.exp (Real.pi * u) = Real.exp (Real.pi * v) := by apply (div_eq_div_iff heu hev).mp at huv - linarith + linear_combination huv have harg : Real.pi * u = Real.pi * v := Real.exp_injective hexp exact mul_left_cancel₀ Real.pi_ne_zero harg @@ -1158,53 +1159,18 @@ private theorem gamma_one_add_imaginary_mul_gamma_one_sub Complex.Gamma (1 + Complex.I * (x : ℂ)) * Complex.Gamma (1 - Complex.I * (x : ℂ)) = ((Real.pi * x / Real.sinh (Real.pi * x) : ℝ) : ℂ) := by - let z : ℂ := Complex.I * (x : ℂ) - have hz : z ≠ 0 := by - try dsimp [z] - exact mul_ne_zero Complex.I_ne_zero - (Complex.ofReal_ne_zero.mpr hx) - have hnegz : -z ≠ 0 := neg_ne_zero.mpr hz - have hplus : - Complex.Gamma (1 + z) = z * Complex.Gamma z := by - convert! Complex.Gamma_add_one z hz using 1; ring_nf - have hminus : - Complex.Gamma (1 - z) = - (-z) * Complex.Gamma (-z) := by - convert! Complex.Gamma_add_one (-z) hnegz using 1; ring_nf - have hconjarg : -z = starRingEnd ℂ z := by - try dsimp [z] - simp only [map_mul, Complex.conj_I, Complex.conj_ofReal] - ring - have hgammaprod : - Complex.Gamma z * Complex.Gamma (-z) = - (‖Complex.Gamma z‖ ^ 2 : ℝ) := by - rw [hconjarg, Complex.Gamma_conj, mul_comm, - ← Complex.normSq_eq_conj_mul_self, - Complex.normSq_eq_norm_sq] - have hsinh : Real.sinh (Real.pi * x) ≠ 0 := - Real.sinh_ne_zero.mpr - (mul_ne_zero Real.pi_ne_zero hx) - change Complex.Gamma (1 + z) * - Complex.Gamma (1 - z) = _ - rw [hplus, hminus] - calc - (z * Complex.Gamma z) * - ((-z) * Complex.Gamma (-z)) = - ((x ^ 2 : ℝ) : ℂ) * - (Complex.Gamma z * Complex.Gamma (-z)) := by - try dsimp [z] - ring_nf - simp only [Complex.I_sq, neg_mul, one_mul, neg_neg, Complex.ofReal_pow] - ring - _ = ((x ^ 2 * ‖Complex.Gamma z‖ ^ 2 : ℝ) : ℂ) := by - rw [hgammaprod] - push_cast - ring - _ = ((Real.pi * x / Real.sinh (Real.pi * x) : ℝ) : ℂ) := by - try dsimp [z] - rw [norm_gamma_imaginary_sq hx] - congr 1 - field_simp [hx, hsinh] + have hz : Complex.I * (x : ℂ) ≠ 0 := + mul_ne_zero Complex.I_ne_zero (Complex.ofReal_ne_zero.mpr hx) + have hsin : + Complex.sin ((Real.pi : ℂ) * (Complex.I * (x : ℂ))) = + (Real.sinh (Real.pi * x) : ℂ) * Complex.I := by + rw [show (Real.pi : ℂ) * (Complex.I * (x : ℂ)) = + ((Real.pi * x : ℝ) : ℂ) * Complex.I by push_cast; ring, + Complex.sin_mul_I, ← Complex.ofReal_sinh] + rw [add_comm (1 : ℂ), Complex.Gamma_add_one _ hz, + mul_assoc, Complex.Gamma_mul_Gamma_one_sub, hsin] + push_cast + field_simp [Complex.I_ne_zero] private theorem poissonLogistic_characteristic_of_ne_zero {t : ℝ} (ht : t ≠ 0) : @@ -1294,7 +1260,7 @@ private theorem poissonLogistic_characteristic_integrable (t : ℝ) : Continuous (fun u : ℝ => Complex.exp (Complex.I * (t : ℂ) * (u : ℂ))) := by - fun_prop + exact Continuous.cexp (Continuous.const_mul Complex.continuous_ofReal (Complex.I * ↑t)) apply poissonLogisticDensity_integrable.mono' (poissonLogisticDensity_integrable.ofReal.aestronglyMeasurable.mul hcontinuous.aestronglyMeasurable) @@ -1363,7 +1329,8 @@ private theorem lowerEndpointPhase_continuous : positivity) have hfirst : Continuous (fun T : ℝ => -Real.pi * |T| / 4) := by - fun_prop + exact Continuous.comp' (Continuous.div_const continuous_id' 4) + (Continuous.const_mul (Continuous.abs continuous_id') (-Real.pi)) have hsecond : Continuous (fun T : ℝ => (1 / 2 : ℝ) * Real.log (1 + T ^ 2 / 4)) := @@ -1380,12 +1347,12 @@ private theorem abs_lowerEndpointPhase_le (T : ℝ) : |lowerEndpointPhase T| ≤ Real.pi * |T| + T ^ 2 := by have hnonneg : 0 ≤ T ^ 2 / 4 := by positivity have hlogzero : 0 ≤ Real.log (1 + T ^ 2 / 4) := - Real.log_nonneg (by linarith) + Real.log_nonneg (by linear_combination hnonneg) have hlogupper : Real.log (1 + T ^ 2 / 4) ≤ T ^ 2 / 4 := by have h := Real.log_le_sub_one_of_pos (show 0 < 1 + T ^ 2 / 4 by positivity) - linarith + linear_combination h have hatanzero : 0 ≤ Real.arctan (|T| / 2) := Real.arctan_nonneg.mpr (by positivity) have hatanupper : Real.arctan (|T| / 2) ≤ Real.pi / 2 := @@ -1402,8 +1369,8 @@ private theorem abs_lowerEndpointPhase_le (T : ℝ) : unfold lowerEndpointPhase apply (abs_le).2 constructor - · linarith [sq_nonneg T] - · linarith [sq_nonneg T] + · linarith only [sq_nonneg T, hnonneg, hlogupper, hmulzero, hmulupper] + · linarith only [sq_nonneg T, hnonneg, hlogzero, hmulzero, hmulupper] private theorem stripPoissonExponentialMajorant_mul_lowerEndpointPhase_integrable : Integrable @@ -1485,11 +1452,11 @@ private theorem tendsto_integral_stripNormalizedPoissonKernel_mul · filter_upwards [hpos, hlt] with σ hσpos hσlt exact (stripNormalizedPoissonKernel_integrable - (by linarith) hσlt).aestronglyMeasurable.mul hf + (by linarith only [hσpos, hσlt]) hσlt).aestronglyMeasurable.mul hf · filter_upwards [hpos, hlt] with σ hσpos hσlt filter_upwards [] with T have hext := stripNormalizedPoissonKernel_eq_extension - (by linarith : -1 < σ) hσlt T + (by linarith only [hσpos, hσlt] : -1 < σ) hσlt T have hbound := stripNormalizedPoissonExtension_le_majorant hσpos.le hσlt.le T rw [norm_mul, Real.norm_eq_abs, hext, @@ -1522,7 +1489,7 @@ private theorem poissonLogistic_cosine_integrable (t : ℝ) : poissonLogisticDensity u * Real.cos (t * u)) := by have hcontinuous : Continuous (fun u : ℝ => Real.cos (t * u)) := by - fun_prop + exact Continuous.comp' Real.continuous_cos (Continuous.const_mul continuous_id' t) apply poissonLogisticDensity_integrable.mono' (poissonLogisticDensity_integrable.aestronglyMeasurable.mul hcontinuous.aestronglyMeasurable) @@ -1594,12 +1561,12 @@ private theorem lowerWallisPhaseKernel_abs_le_moment positivity have hqone : q ≤ 1 := by try dsimp [q] - exact Real.exp_le_one_iff.mpr (by linarith) + exact Real.exp_le_one_iff.mpr (by linear_combination ht) have hone : 0 ≤ 1 - q := by - linarith + linear_combination hqone have hone_le : 1 - q ≤ t := by try dsimp [q] - linarith [Real.add_one_le_exp (-t)] + linarith only [Real.add_one_le_exp (-t)] have hcos : |Real.cos (u * t) - 1| ≤ |u| * t := by have h := Real.abs_cos_sub_cos_le (u * t) 0 @@ -1614,11 +1581,11 @@ private theorem lowerWallisPhaseKernel_abs_le_moment rw [← Real.exp_add] simp only [add_neg_cancel, Real.exp_zero] have hcancel_nonneg : 0 ≤ 1 - q - t * q := by - linarith + linear_combination hqproduct have hcancel_upper : 1 - q - t * q ≤ t ^ 2 := by calc 1 - q - t * q ≤ t * (1 - q) := by - linarith [hone_le] + linear_combination hone_le _ ≤ t * t := mul_le_mul_of_nonneg_left hone_le ht.le _ = t ^ 2 := by @@ -1650,8 +1617,11 @@ private theorem lowerWallisPhaseKernel_abs_le_moment (mul_le_mul_of_nonneg_left hcos hone) hcancel_upper _ ≤ t * (|u| * t) + t ^ 2 := by - linarith [mul_le_mul_of_nonneg_right hone_le - (mul_nonneg (abs_nonneg u) ht.le)] + linarith only [ + mul_le_mul_of_nonneg_right hone_le (mul_nonneg (abs_nonneg u) ht.le), + ht, + hone_le + ] _ = (|u| + 1) * t ^ 2 := by ring @@ -1666,11 +1636,11 @@ private theorem lowerWallisPhaseKernel_abs_le_tail positivity have hqone : q ≤ 1 := by try dsimp [q] - exact Real.exp_le_one_iff.mpr (by linarith) + exact Real.exp_le_one_iff.mpr (by linear_combination ht) have hone : 0 ≤ 1 - q := by - linarith + linear_combination hqone have hone_upper : 1 - q ≤ 1 := by - linarith + linear_combination hqpos have ht_sq : t ≤ t ^ 2 := by nlinarith have hsq : 0 < t ^ 2 := sq_pos_of_pos htpos @@ -1698,10 +1668,9 @@ private theorem lowerWallisPhaseKernel_abs_le_tail mul_le_mul_of_nonneg_left hcos hone _ ≤ 1 := by simpa only [mul_one, tsub_le_iff_right, le_add_iff_nonneg_right] using! hone_upper - linarith + linear_combination hfactor _ ≤ 1 + q * t ^ 2 := by - linarith [mul_nonneg hqpos.le - (sub_nonneg.mpr ht_sq)] + linarith only [mul_nonneg hqpos.le (sub_nonneg.mpr ht_sq), hqpos, ht_sq] _ = (1 / t ^ 2 + q) * t ^ 2 := by field_simp [htpos.ne'] @@ -1922,7 +1891,7 @@ private theorem integral_poissonLogistic_mul_lowerWallisPhaseKernel rw [← Real.exp_add] simp only [add_neg_cancel, Real.exp_zero] unfold wallisLaplaceKernel - field_simp [htne, hpositive, hdiff, hden]; linarith [hexp] + field_simp [htne, hpositive, hdiff, hden]; linarith only [hexp] private noncomputable def lowerWallisRegularizedPhaseKernel (a u t : ℝ) : ℝ := ((1 - Real.exp (-t)) * Real.exp (-a * t) * @@ -1965,25 +1934,25 @@ private theorem lowerWallisRegularizedPhaseKernel_abs_le_moment positivity have hqone : q ≤ 1 := by try dsimp [q] - exact Real.exp_le_one_iff.mpr (by linarith) + exact Real.exp_le_one_iff.mpr (by linear_combination ht) have hrpos : 0 < r := by try dsimp [r] positivity have hrone : r ≤ 1 := by try dsimp [r] apply Real.exp_le_one_iff.mpr - linarith [mul_nonneg hazero ht.le] - have hqnonneg : 0 ≤ 1 - q := by linarith - have hrnonneg : 0 ≤ 1 - r := by linarith + linarith only [mul_nonneg hazero ht.le, hazero, ht] + have hqnonneg : 0 ≤ 1 - q := by linear_combination hqone + have hrnonneg : 0 ≤ 1 - r := by linear_combination hrone have hqbound : 1 - q ≤ t := by try dsimp [q] - linarith [Real.add_one_le_exp (-t)] + linarith only [Real.add_one_le_exp (-t)] have hrbound : 1 - r ≤ t := by have hfirst : 1 - r ≤ a * t := by try dsimp [r] - linarith [Real.add_one_le_exp (-a * t)] + linarith only [Real.add_one_le_exp (-a * t)] have hsecond : a * t ≤ t := by - linarith [mul_nonneg (sub_nonneg.mpr haone) ht.le] + linarith only [mul_nonneg (sub_nonneg.mpr haone) ht.le, haone, ht] exact hfirst.trans hsecond have hsq : 0 < t ^ 2 := sq_pos_of_pos ht have hcorrection : @@ -1991,7 +1960,7 @@ private theorem lowerWallisRegularizedPhaseKernel_abs_le_moment t ^ 2| ≤ 1 := by rw [abs_div, abs_of_pos hsq, abs_mul, abs_mul, abs_of_nonneg hqnonneg, - abs_of_nonpos (show r - 1 ≤ 0 by linarith)] + abs_of_nonpos (show r - 1 ≤ 0 by linear_combination hrone)] apply (div_le_iff₀ hsq).2 have hcos := Real.abs_cos_le_one (u * t) calc @@ -1999,7 +1968,7 @@ private theorem lowerWallisRegularizedPhaseKernel_abs_le_moment (1 - q) * (1 - r) := by have hfactor : 0 ≤ (1 - q) * (1 - r) := mul_nonneg hqnonneg hrnonneg - linarith [mul_le_mul_of_nonneg_left hcos hfactor] + linarith only [mul_le_mul_of_nonneg_left hcos hfactor, hcos, hfactor] _ ≤ t * t := mul_le_mul hqbound hrbound hrnonneg ht.le _ = 1 * t ^ 2 := by ring @@ -2032,15 +2001,15 @@ private theorem lowerWallisRegularizedPhaseKernel_abs_le_tail positivity have hqone : q ≤ 1 := by try dsimp [q] - exact Real.exp_le_one_iff.mpr (by linarith) + exact Real.exp_le_one_iff.mpr (by linear_combination ht) have hrpos : 0 < r := by try dsimp [r] positivity have hrone : r ≤ 1 := by try dsimp [r] apply Real.exp_le_one_iff.mpr - linarith [mul_nonneg hazero htpos.le] - have hqnonneg : 0 ≤ 1 - q := by linarith + linarith only [mul_nonneg hazero htpos.le, hazero, htpos] + have hqnonneg : 0 ≤ 1 - q := by linear_combination hqone have hsq : 0 < t ^ 2 := sq_pos_of_pos htpos have htsq : t ≤ t ^ 2 := by nlinarith unfold lowerWallisRegularizedPhaseKernel @@ -2063,12 +2032,12 @@ private theorem lowerWallisRegularizedPhaseKernel_abs_le_tail calc (1 - q) * r ≤ (1 - q) * 1 := mul_le_mul_of_nonneg_left hrone hqnonneg - _ ≤ 1 := by linarith + _ ≤ 1 := by linear_combination hqpos have hfactor : 0 ≤ (1 - q) * r := mul_nonneg hqnonneg hrpos.le - linarith [mul_le_mul_of_nonneg_left hcos hfactor] + linarith only [mul_le_mul_of_nonneg_left hcos hfactor, hcos, hfirst, hfactor] _ ≤ 1 + q * t ^ 2 := by - linarith [mul_nonneg hqpos.le (sub_nonneg.mpr htsq)] + linarith only [mul_nonneg hqpos.le (sub_nonneg.mpr htsq), hqpos, htsq] _ = (1 / t ^ 2 + q) * t ^ 2 := by field_simp [htpos.ne'] @@ -2126,7 +2095,7 @@ private theorem tendsto_integral_lowerWallisRegularizedPhaseKernel have haone : 1 / ((n : ℝ) + 1) ≤ 1 := by apply (div_le_iff₀ (show 0 < (n : ℝ) + 1 by positivity)).2 have hn : 0 ≤ (n : ℝ) := Nat.cast_nonneg n - linarith + linarith only [] rw [Real.norm_eq_abs] by_cases htone : t ≤ 1 · simp only [lowerWallisRegularizedPhaseMajorant, @@ -2330,7 +2299,7 @@ private theorem lowerWallisComplexLogPhase_ofReal rfl have hnorm : ‖(a : ℂ) + 1‖ = a + 1 := by rw [hcast, Complex.norm_real, Real.norm_eq_abs, - abs_of_nonneg (show 0 ≤ a + 1 by linarith)] + abs_of_nonneg (show 0 ≤ a + 1 by linear_combination ha)] unfold lowerWallisComplexLogPhase simp only [Complex.sub_re, Complex.add_re, Complex.one_re, Complex.mul_re, Complex.ofReal_re, Complex.log_re, @@ -2357,7 +2326,7 @@ private theorem tendsto_lowerWallisComplexLogPhase_regularized (u : ℝ) : 1 + a * Real.log a - (a + 1) * Real.log (a + 1)) := by have hshift : Continuous (fun a : ℝ => a + 1) := by - fun_prop + exact Continuous.add_const continuous_id' 1 exact (continuous_const.add Real.continuous_mul_log).sub (Real.continuous_mul_log.comp hshift) @@ -2567,7 +2536,7 @@ private theorem integral_poissonLogistic_lowerEndpointPhase : have hwallis := integral_poissonLogistic_one_add_lowerEndpointPhase rw [hsplit, integral_poissonLogisticDensity] at hwallis - linarith + linear_combination hwallis private theorem limitingPoissonEndpointExpectation_eq_log_pi_div_two_sub_one : limitingPoissonEndpointExpectation = @@ -2606,7 +2575,7 @@ private theorem limitingPoissonEndpointExpectation_eq_log_pi_div_two_sub_one : lowerEndpointPhase (2 * u)) := by rw [integral_const_mul] have hphase := integral_poissonLogistic_lowerEndpointPhase - linarith + linarith only [hscale, hlogistic, hphase] private theorem lowerPoissonEndpointSharpCoefficient_eq {c : ℝ} (hc : 0 < c) : @@ -2649,15 +2618,15 @@ private theorem lowerPoissonEndpointSharpCoefficient_neg have hdiv : c < 1 / Real.pi := by simpa only [one_div] using! hsharp have h := (lt_div_iff₀ Real.pi_pos).mp hdiv - linarith + linear_combination h have hpositive : 0 < Real.pi * c := mul_pos Real.pi_pos hc have hbelow : Real.pi ^ 2 * c ^ 2 < 1 := by have hfactor : 0 < (1 - Real.pi * c) * (1 + Real.pi * c) := - mul_pos (sub_pos.mpr hproduct) (by linarith) - linarith + mul_pos (sub_pos.mpr hproduct) (by linarith only [hproduct, hpositive]) + linear_combination hfactor exact Real.log_neg (by positivity) hbelow private theorem tendsto_lowerPoissonEndpointSharpCoefficient @@ -2696,19 +2665,19 @@ private theorem saddle_one_add_abs_cube_le (T : ℝ) : have hfactor : 0 ≤ (|T| - 1) ^ 2 * (|T| + 1) := mul_nonneg (sq_nonneg _) (by positivity) - linarith + linarith only [hfactor] private theorem plusPolynomial_imaginary_norm_ge_beta {ε u : ℝ} (hε : 0 < ε) (hu : -1 ≤ u) : (ε / 4) ≤ ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hb : 0 < (ε / 4) := div_pos hε four_pos have hterm : 0 ≤ (1 - u) ^ 2 * (1 + u) := - mul_nonneg (sq_nonneg _) (by linarith) + mul_nonneg (sq_nonneg _) (by linear_combination hu) have hvalue : 0 < (ε / 4) + (1 - u) ^ 2 * (1 + u) := add_pos_of_pos_of_nonneg hb hterm rw [plusPolynomial_imaginary, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hvalue] - linarith + linear_combination hterm private theorem plusPolynomial_imaginary_cubic_growth_le {ε u : ℝ} (hε : 0 < ε) (hu : -1 ≤ u) : @@ -2716,62 +2685,38 @@ private theorem plusPolynomial_imaginary_cubic_growth_le (27 / (ε / 4) + 9) * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hb : 0 < (ε / 4) := div_pos hε four_pos - have hnorm : - (ε / 4) ≤ ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := - plusPolynomial_imaginary_norm_ge_beta hε hu + have hterm : 0 ≤ (1 - u) ^ 2 * (1 + u) := + mul_nonneg (sq_nonneg _) (by linear_combination hu) + have hvalue : ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ = + (ε / 4) + (1 - u) ^ 2 * (1 + u) := by + rw [plusPolynomial_imaginary, Complex.norm_real, Real.norm_eq_abs] + exact abs_of_pos (add_pos_of_pos_of_nonneg hb hterm) + rw [hvalue] by_cases hbounded : u ≤ 2 - · have habs : |u| ≤ 2 := by - exact (abs_le).mpr ⟨by linarith only [hu], hbounded⟩ - have hcube : (1 + |u|) ^ 3 ≤ 27 := by - have hbase : 1 + |u| ≤ (3 : ℝ) := by linarith only [habs] - exact (pow_le_pow_left₀ (by positivity) hbase 3).trans_eq (by norm_num) + · have habs : |u| ≤ 2 := abs_le.mpr ⟨by linear_combination hu, hbounded⟩ + have hcube : (1 + |u|) ^ 3 ≤ 27 := + (pow_le_pow_left₀ (by positivity) + (show 1 + |u| ≤ (3 : ℝ) by linear_combination habs) 3).trans_eq (by norm_num) calc (1 + |u|) ^ 3 ≤ 27 := hcube _ = (27 / (ε / 4)) * (ε / 4) := (div_mul_cancel₀ _ hb.ne').symm - _ ≤ (27 / (ε / 4)) * - ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := - mul_le_mul_of_nonneg_left hnorm (by positivity) - _ ≤ (27 / (ε / 4) + 9) * - ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := by - have hnonnegative := - norm_nonneg (plusPolynomial ε (Complex.I * (u : ℂ))) - linarith only [hnonnegative] + _ ≤ (27 / (ε / 4) + 9) * ((ε / 4) + (1 - u) ^ 2 * (1 + u)) := + mul_le_mul (le_add_of_nonneg_right (by norm_num)) + (le_add_of_nonneg_right hterm) hb.le (by positivity) · have hlarge : 2 < u := lt_of_not_ge hbounded - have habs : |u| = u := abs_of_pos (by linarith only [hlarge]) - have hvalue : - ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ = - (ε / 4) + (1 - u) ^ 2 * (1 + u) := by - rw [plusPolynomial_imaginary, Complex.norm_real, - Real.norm_eq_abs] - apply abs_of_pos - exact add_pos_of_pos_of_nonneg hb - (mul_nonneg (sq_nonneg _) (by linarith only [hlarge])) - have hsq : - (1 + u) ^ 2 ≤ 9 * (1 - u) ^ 2 := by - have hfactor : 0 ≤ (2 * u - 1) * (u - 2) := - mul_nonneg (by linarith only [hlarge]) (by linarith only [hlarge]) + have hsquare : (1 + u) ^ 2 ≤ 9 * (1 - u) ^ 2 := by + have hfactor := mul_nonneg + (show 0 ≤ 2 * u - 1 by linarith only [hlarge]) + (show 0 ≤ u - 2 by linear_combination hlarge) linarith only [hfactor] - have hcube : - (1 + u) ^ 3 ≤ - 9 * ((1 - u) ^ 2 * (1 + u)) := by - have hproduct := mul_le_mul_of_nonneg_right - hsq (show 0 ≤ 1 + u by linarith only [hlarge]) - linarith only [hproduct] - rw [habs] - calc - (1 + u) ^ 3 ≤ - 9 * ((1 - u) ^ 2 * (1 + u)) := hcube - _ ≤ 9 * ‖plusPolynomial ε - (Complex.I * (u : ℂ))‖ := by - rw [hvalue] - linarith only [hb] - _ ≤ (27 / (ε / 4) + 9) * - ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := by - have hnonnegative := - norm_nonneg (plusPolynomial ε (Complex.I * (u : ℂ))) - have hcoefficient : 0 ≤ 27 / (ε / 4) := by - positivity - linarith only [mul_nonneg hcoefficient hnonnegative] + have hcubic : (1 + u) ^ 3 ≤ 9 * ((1 - u) ^ 2 * (1 + u)) := by + have hproduct := mul_le_mul_of_nonneg_right hsquare + (show 0 ≤ 1 + u by linear_combination hlarge) + linear_combination hproduct + rw [abs_of_pos (show 0 < u by linear_combination hlarge)] + exact hcubic.trans + (mul_le_mul (le_add_of_nonneg_left (div_nonneg (by norm_num) hb.le)) + (le_add_of_nonneg_left hb.le) hterm (by positivity)) private theorem minusPolynomial_imaginary_norm_ge_three_beta {ε u : ℝ} (hε : 0 < ε) @@ -2779,17 +2724,17 @@ private theorem minusPolynomial_imaginary_norm_ge_three_beta 3 * (ε / 4) ≤ ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hb : 0 < (ε / 4) := div_pos hε four_pos - have hone : 1 ≤ u := by linarith + have hone : 1 ≤ u := by linarith only [hε, hu] have hbeta : (ε / 4) ≤ u - 1 := by - linarith + linear_combination hu have hsquare : (4 : ℝ) ≤ (1 + u) ^ 2 := by - linarith [sq_nonneg (u - 1)] + linarith only [sq_nonneg (u - 1), hε, hu] have hproduct : 4 * (ε / 4) ≤ (u - 1) * (1 + u) ^ 2 := by calc 4 * (ε / 4) = (ε / 4) * 4 := by ring _ ≤ (u - 1) * (1 + u) ^ 2 := - mul_le_mul hbeta hsquare (by norm_num) (by linarith) + mul_le_mul hbeta hsquare (by norm_num) (by linarith only [hε, hu]) have hnegative := minusPolynomial_imaginary_re_neg hε hu rw [minusPolynomial_imaginary, Complex.norm_real, Real.norm_eq_abs] @@ -2798,7 +2743,7 @@ private theorem minusPolynomial_imaginary_norm_ge_three_beta at hnegative exact hnegative rw [abs_of_neg harg] - linarith + linear_combination hproduct private theorem minusPolynomial_imaginary_cubic_growth_le {ε u : ℝ} (hε : 0 < ε) @@ -2807,78 +2752,43 @@ private theorem minusPolynomial_imaginary_cubic_growth_le (9 / (ε / 4) + 6) * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hb : 0 < (ε / 4) := div_pos hε four_pos - have hone : 1 ≤ u := by linarith only [hu, hb] - have hbeta : (ε / 4) ≤ u - 1 := by - linarith only [hu] - have habs : |u| = u := abs_of_pos (zero_lt_one.trans_le hone) - have hnorm := minusPolynomial_imaginary_norm_ge_three_beta - hε hu + have hone : 1 ≤ u := by linear_combination hb + hu + have hnegative := minusPolynomial_imaginary_re_neg hε hu + have hvalue : ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ = + (u - 1) * (1 + u) ^ 2 - (ε / 4) := by + rw [minusPolynomial_imaginary, Complex.norm_real, Real.norm_eq_abs] + rw [minusPolynomial_imaginary, Complex.ofReal_re] at hnegative + rw [abs_of_neg hnegative] + ring + have hnorm := minusPolynomial_imaginary_norm_ge_three_beta hε hu + rw [hvalue] at hnorm ⊢ + have hpositive : 0 < (u - 1) * (1 + u) ^ 2 - (ε / 4) := + (mul_pos (by norm_num : (0 : ℝ) < 3) hb).trans_le hnorm + rw [abs_of_pos (zero_lt_one.trans_le hone)] by_cases hbounded : u ≤ 2 - · have hcube : (1 + |u|) ^ 3 ≤ 27 := by - have hbase : 1 + |u| ≤ (3 : ℝ) := by - rw [habs] - linarith only [hbounded] - exact (pow_le_pow_left₀ (by positivity) hbase 3).trans_eq (by norm_num) + · have hcube : (1 + u) ^ 3 ≤ 27 := + (pow_le_pow_left₀ (by linear_combination hone) + (show 1 + u ≤ (3 : ℝ) by linear_combination hbounded) 3).trans_eq (by norm_num) calc - (1 + |u|) ^ 3 ≤ 27 := hcube + (1 + u) ^ 3 ≤ 27 := hcube _ = (9 / (ε / 4)) * (3 * (ε / 4)) := by - rw [div_mul_eq_mul_div, mul_div_assoc, mul_div_cancel_right₀ _ hb.ne'] + rw [mul_left_comm (9 / (ε / 4)), div_mul_cancel₀ _ hb.ne'] norm_num - _ ≤ (9 / (ε / 4)) * - ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := - mul_le_mul_of_nonneg_left hnorm (by positivity) - _ ≤ (9 / (ε / 4) + 6) * - ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by - have hnonnegative := - norm_nonneg (minusPolynomial ε - (Complex.I * (u : ℂ))) - linarith only [hnonnegative] + _ ≤ (9 / (ε / 4) + 6) * ((u - 1) * (1 + u) ^ 2 - (ε / 4)) := + mul_le_mul (le_add_of_nonneg_right (by norm_num)) hnorm + (by positivity) (by positivity) · have hlarge : 2 < u := lt_of_not_ge hbounded - have hnegative := minusPolynomial_imaginary_re_neg hε hu - have hvalue : - ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ = - (u - 1) * (1 + u) ^ 2 - (ε / 4) := by - rw [minusPolynomial_imaginary, Complex.norm_real, - Real.norm_eq_abs] - have harg : (ε / 4) + (1 - u) * (1 + u) ^ 2 < 0 := by - rw [minusPolynomial_imaginary, Complex.ofReal_re] - at hnegative - exact hnegative - rw [abs_of_neg harg] - ring - have hsquare : (4 : ℝ) ≤ (1 + u) ^ 2 := by - linarith only [sq_nonneg (u - 1), hlarge] - have hterm : - 2 * (ε / 4) ≤ (u - 1) * (1 + u) ^ 2 := by - calc - 2 * (ε / 4) ≤ 4 * (ε / 4) := by linarith only [hb] - _ = (ε / 4) * 4 := by ring - _ ≤ (u - 1) * (1 + u) ^ 2 := - mul_le_mul hbeta hsquare (by norm_num) (by linarith only [hone]) - have hlinear : 1 + u ≤ 3 * (u - 1) := by - linarith only [hlarge] - have hcubic : - (1 + u) ^ 3 ≤ - 3 * ((u - 1) * (1 + u) ^ 2) := by - have hproduct := - mul_le_mul_of_nonneg_right hlinear (sq_nonneg (1 + u)) - linarith only [hproduct] - rw [habs] + have hlinear : 1 + u ≤ 3 * (u - 1) := by linarith only [hlarge] + have hcubic : (1 + u) ^ 3 ≤ 3 * ((u - 1) * (1 + u) ^ 2) := by + have hproduct := mul_le_mul_of_nonneg_right hlinear (sq_nonneg (1 + u)) + linear_combination hproduct calc - (1 + u) ^ 3 ≤ - 3 * ((u - 1) * (1 + u) ^ 2) := hcubic - _ ≤ 6 * ‖minusPolynomial ε - (Complex.I * (u : ℂ))‖ := by - rw [hvalue] - linarith only [hterm] - _ ≤ (9 / (ε / 4) + 6) * - ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by - have hnonnegative := - norm_nonneg (minusPolynomial ε - (Complex.I * (u : ℂ))) - have hcoefficient : 0 ≤ 9 / (ε / 4) := by - positivity - linarith only [mul_nonneg hcoefficient hnonnegative] + (1 + u) ^ 3 ≤ 3 * ((u - 1) * (1 + u) ^ 2) := hcubic + _ ≤ 6 * ((u - 1) * (1 + u) ^ 2 - (ε / 4)) := by + linarith only [hb, hnorm] + _ ≤ (9 / (ε / 4) + 6) * ((u - 1) * (1 + u) ^ 2 - (ε / 4)) := + mul_le_mul_of_nonneg_right + (le_add_of_nonneg_left (div_nonneg (by norm_num) hb.le)) hpositive.le private theorem saddle_complex_frequency_norm_le (T u : ℝ) : ‖(T : ℂ) + Complex.I * (u : ℂ)‖ ≤ |T| + |u| := by @@ -2889,6 +2799,37 @@ private theorem saddle_complex_frequency_norm_le (T u : ℝ) : _ = |T| + |u| := by simp only [Complex.norm_real, Real.norm_eq_abs, Complex.norm_mul, Complex.norm_I, one_mul] +private theorem polynomial_uniform_frequency_ratio_le + (P : ℂ → ℂ) {B H u : ℝ} (hB : 0 ≤ B) + (hD : 0 < ‖P (Complex.I * (u : ℂ))‖) + (hbase : ∀ z : ℂ, ‖P z‖ ≤ B * (1 + ‖z‖) ^ 3) + (hheight : (1 + |u|) ^ 3 ≤ H * ‖P (Complex.I * (u : ℂ))‖) + (T : ℝ) : + ‖P ((T : ℂ) + Complex.I * (u : ℂ))‖ / + ‖P (Complex.I * (u : ℂ))‖ ≤ + (4 * B * H) * (1 + |T| ^ 3) := by + have htriangle : + 1 + ‖(T : ℂ) + Complex.I * (u : ℂ)‖ ≤ + (1 + |T|) * (1 + |u|) := by + linarith only [saddle_complex_frequency_norm_le T u, + mul_nonneg (abs_nonneg T) (abs_nonneg u)] + have hfrequency := saddle_one_add_abs_cube_le T + apply (div_le_iff₀ hD).2 + calc + ‖P ((T : ℂ) + Complex.I * (u : ℂ))‖ ≤ + B * (1 + ‖(T : ℂ) + Complex.I * (u : ℂ)‖) ^ 3 := hbase _ + _ ≤ B * ((1 + |T|) * (1 + |u|)) ^ 3 := + mul_le_mul_of_nonneg_left + (pow_le_pow_left₀ (by positivity) htriangle 3) hB + _ = (B * (1 + |T|) ^ 3) * (1 + |u|) ^ 3 := by ring + _ ≤ (B * (4 * (1 + |T| ^ 3))) * + (H * ‖P (Complex.I * (u : ℂ))‖) := + mul_le_mul (mul_le_mul_of_nonneg_left hfrequency hB) + hheight (pow_nonneg (by positivity) 3) + (mul_nonneg hB ((pow_nonneg (by positivity) 3).trans hfrequency)) + _ = ((4 * B * H) * (1 + |T| ^ 3)) * + ‖P (Complex.I * (u : ℂ))‖ := by ring + private theorem exists_plusPolynomial_uniform_norm_ratio {ε : ℝ} (hε : 0 < ε) : ∃ C : ℝ, 0 < C ∧ @@ -2898,47 +2839,13 @@ private theorem exists_plusPolynomial_uniform_norm_ratio ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ C * (1 + |T| ^ 3) := by have hb : 0 < (ε / 4) := div_pos hε four_pos - refine ⟨4 * (1 + (ε / 4)) * (27 / (ε / 4) + 9), - by positivity, ?_⟩ + refine ⟨4 * (1 + (ε / 4)) * (27 / (ε / 4) + 9), by positivity, ?_⟩ intro u hu T - let z : ℂ := (T : ℂ) + Complex.I * (u : ℂ) - let D : ℝ := ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ - have hD : 0 < D := - lt_of_lt_of_le hb (plusPolynomial_imaginary_norm_ge_beta hε hu) - have htriangle : - 1 + ‖z‖ ≤ (1 + |T|) * (1 + |u|) := by - have hz := saddle_complex_frequency_norm_le T u - change ‖z‖ ≤ |T| + |u| at hz - linarith [mul_nonneg (abs_nonneg T) (abs_nonneg u)] - have hpower : - (1 + ‖z‖) ^ 3 ≤ - ((1 + |T|) * (1 + |u|)) ^ 3 := - pow_le_pow_left₀ (by positivity) htriangle 3 - have hbase := norm_plusPolynomial_le ε z - rw [abs_of_pos hb] at hbase - have hfrequency := saddle_one_add_abs_cube_le T - have hheight := plusPolynomial_imaginary_cubic_growth_le - hε hu - change ‖plusPolynomial ε z‖ / D ≤ - (4 * (1 + (ε / 4)) * (27 / (ε / 4) + 9)) * - (1 + |T| ^ 3) - apply (div_le_iff₀ hD).2 - calc - ‖plusPolynomial ε z‖ ≤ - (1 + (ε / 4)) * (1 + ‖z‖) ^ 3 := hbase - _ ≤ (1 + (ε / 4)) * - ((1 + |T|) * (1 + |u|)) ^ 3 := by - gcongr - _ = (1 + (ε / 4)) * (1 + |T|) ^ 3 * - (1 + |u|) ^ 3 := by - ring - _ ≤ (1 + (ε / 4)) * - (4 * (1 + |T| ^ 3)) * - ((27 / (ε / 4) + 9) * D) := by - gcongr - _ = ((4 * (1 + (ε / 4)) * (27 / (ε / 4) + 9)) * - (1 + |T| ^ 3)) * D := by - ring + have hD := hb.trans_le (plusPolynomial_imaginary_norm_ge_beta hε hu) + apply polynomial_uniform_frequency_ratio_le (plusPolynomial ε) + (by positivity) hD (fun z => ?_) + (plusPolynomial_imaginary_cubic_growth_le hε hu) T + simpa only [abs_of_pos hb] using norm_plusPolynomial_le ε z private theorem exists_minusPolynomial_uniform_norm_ratio {ε : ℝ} (hε : 0 < ε) : @@ -2949,50 +2856,15 @@ private theorem exists_minusPolynomial_uniform_norm_ratio ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ ≤ C * (1 + |T| ^ 3) := by have hb : 0 < (ε / 4) := div_pos hε four_pos - refine ⟨4 * (1 + (ε / 4)) * (9 / (ε / 4) + 6), - by positivity, ?_⟩ + refine ⟨4 * (1 + (ε / 4)) * (9 / (ε / 4) + 6), by positivity, ?_⟩ intro u hu T - let z : ℂ := (T : ℂ) + Complex.I * (u : ℂ) - let D : ℝ := ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ - have hD : 0 < D := by - have h := minusPolynomial_imaginary_norm_ge_three_beta - hε hu - change 3 * (ε / 4) ≤ D at h - linarith - have htriangle : - 1 + ‖z‖ ≤ (1 + |T|) * (1 + |u|) := by - have hz := saddle_complex_frequency_norm_le T u - change ‖z‖ ≤ |T| + |u| at hz - linarith [mul_nonneg (abs_nonneg T) (abs_nonneg u)] - have hpower : - (1 + ‖z‖) ^ 3 ≤ - ((1 + |T|) * (1 + |u|)) ^ 3 := - pow_le_pow_left₀ (by positivity) htriangle 3 - have hbase := norm_minusPolynomial_le ε z - rw [abs_of_pos hb] at hbase - have hfrequency := saddle_one_add_abs_cube_le T - have hheight := minusPolynomial_imaginary_cubic_growth_le - hε hu - change ‖minusPolynomial ε z‖ / D ≤ - (4 * (1 + (ε / 4)) * (9 / (ε / 4) + 6)) * - (1 + |T| ^ 3) - apply (div_le_iff₀ hD).2 - calc - ‖minusPolynomial ε z‖ ≤ - (1 + (ε / 4)) * (1 + ‖z‖) ^ 3 := hbase - _ ≤ (1 + (ε / 4)) * - ((1 + |T|) * (1 + |u|)) ^ 3 := by - gcongr - _ = (1 + (ε / 4)) * (1 + |T|) ^ 3 * - (1 + |u|) ^ 3 := by - ring - _ ≤ (1 + (ε / 4)) * - (4 * (1 + |T| ^ 3)) * - ((9 / (ε / 4) + 6) * D) := by - gcongr - _ = ((4 * (1 + (ε / 4)) * (9 / (ε / 4) + 6)) * - (1 + |T| ^ 3)) * D := by - ring + have hD : 0 < ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by + have h := minusPolynomial_imaginary_norm_ge_three_beta hε hu + linarith only [hb, h] + apply polynomial_uniform_frequency_ratio_le (minusPolynomial ε) + (by positivity) hD (fun z => ?_) + (minusPolynomial_imaginary_cubic_growth_le hε hu) T + simpa only [abs_of_pos hb] using norm_minusPolynomial_le ε z private theorem plusPolynomial_add_sub (ε : ℝ) (z w : ℂ) : plusPolynomial ε (z + w) - plusPolynomial ε z = @@ -3029,9 +2901,9 @@ private theorem plusSaddleLinearCoefficient_norm_le (z : ℂ) : _ = 2 * ‖z‖ + ‖(1 : ℂ) + 3 * z ^ 2‖ := by simp only [Complex.norm_mul, Complex.norm_ofNat, Complex.norm_I, one_mul] _ ≤ 2 * ‖z‖ + (1 + 3 * ‖z‖ ^ 2) := by - gcongr + exact add_le_add (le_refl (2 * ‖z‖)) hinner _ ≤ 3 * (1 + ‖z‖) ^ 2 := by - linarith [norm_nonneg z] + linarith only [norm_nonneg z] private theorem minusSaddleLinearCoefficient_norm_le (z : ℂ) : ‖2 * z - Complex.I * (1 + 3 * z ^ 2)‖ ≤ @@ -3052,9 +2924,9 @@ private theorem minusSaddleLinearCoefficient_norm_le (z : ℂ) : _ = 2 * ‖z‖ + ‖(1 : ℂ) + 3 * z ^ 2‖ := by simp only [Complex.norm_mul, Complex.norm_ofNat, Complex.norm_I, one_mul] _ ≤ 2 * ‖z‖ + (1 + 3 * ‖z‖ ^ 2) := by - gcongr + exact add_le_add (le_refl (2 * ‖z‖)) hinner _ ≤ 3 * (1 + ‖z‖) ^ 2 := by - linarith [norm_nonneg z] + linarith only [norm_nonneg z] private theorem plusSaddleQuadraticCoefficient_norm_le (z : ℂ) : ‖1 + 3 * Complex.I * z‖ ≤ @@ -3066,7 +2938,7 @@ private theorem plusSaddleQuadraticCoefficient_norm_le (z : ℂ) : _ = 1 + 3 * ‖z‖ := by simp only [norm_one, Complex.norm_mul, Complex.norm_ofNat, Complex.norm_I, mul_one] _ ≤ 3 * (1 + ‖z‖) ^ 2 := by - linarith [norm_nonneg z, sq_nonneg ‖z‖] + linarith only [norm_nonneg z, sq_nonneg ‖z‖] private theorem minusSaddleQuadraticCoefficient_norm_le (z : ℂ) : ‖1 - 3 * Complex.I * z‖ ≤ @@ -3078,14 +2950,14 @@ private theorem minusSaddleQuadraticCoefficient_norm_le (z : ℂ) : _ = 1 + 3 * ‖z‖ := by simp only [norm_one, Complex.norm_mul, Complex.norm_ofNat, Complex.norm_I, mul_one] _ ≤ 3 * (1 + ‖z‖) ^ 2 := by - linarith [norm_nonneg z, sq_nonneg ‖z‖] + linarith only [norm_nonneg z, sq_nonneg ‖z‖] private theorem saddle_abs_sq_le_add_cube (T : ℝ) : |T| ^ 2 ≤ |T| + |T| ^ 3 := by have hfactor : 0 ≤ |T| * (|T| - (1 / 2 : ℝ)) ^ 2 := mul_nonneg (abs_nonneg T) (sq_nonneg _) - linarith [abs_nonneg T] + linarith only [abs_nonneg T, hfactor] private theorem saddle_cubic_translation_norm_le (u T : ℝ) (A B C : ℂ) @@ -3099,18 +2971,18 @@ private theorem saddle_cubic_translation_norm_le let S : ℝ := |T| + |T| ^ 3 have hH : 1 ≤ H := by try dsimp [H] - linarith [abs_nonneg u, sq_nonneg |u|] + linarith only [abs_nonneg u, sq_nonneg |u|] have hS : 0 ≤ S := by try dsimp [S] positivity have hT : |T| ≤ S := by try dsimp [S] - linarith [pow_nonneg (abs_nonneg T) 3] + linarith only [pow_nonneg (abs_nonneg T) 3] have hT2 : |T| ^ 2 ≤ S := by exact saddle_abs_sq_le_add_cube T have hT3 : |T| ^ 3 ≤ S := by try dsimp [S] - linarith [abs_nonneg T] + linarith only [abs_nonneg T] have hfirst : ‖(T : ℂ) * A‖ ≤ |T| * (3 * H) := by rw [norm_mul, Complex.norm_real, Real.norm_eq_abs] @@ -3125,17 +2997,14 @@ private theorem saddle_cubic_translation_norm_le ‖C * (T : ℂ) ^ 3‖ ≤ |T| ^ 3 := by rw [norm_mul, norm_pow, Complex.norm_real, Real.norm_eq_abs] - linarith [mul_le_mul_of_nonneg_right hC - (pow_nonneg (abs_nonneg T) 3)] + linarith only [mul_le_mul_of_nonneg_right hC (pow_nonneg (abs_nonneg T) 3), hC] have hfirst' : |T| * (3 * H) ≤ 3 * H * S := by - linarith [mul_le_mul_of_nonneg_left hT - (show 0 ≤ 3 * H by positivity)] + linarith only [mul_le_mul_of_nonneg_left hT (show 0 ≤ 3 * H by positivity), hT] have hsecond' : |T| ^ 2 * (3 * H) ≤ 3 * H * S := by - linarith [mul_le_mul_of_nonneg_left hT2 - (show 0 ≤ 3 * H by positivity)] + linarith only [mul_le_mul_of_nonneg_left hT2 (show 0 ≤ 3 * H by positivity), hT2] have hthird' : |T| ^ 3 ≤ H * S := by have hraise : S ≤ H * S := by - linarith [mul_nonneg (sub_nonneg.mpr hH) hS] + linarith only [mul_nonneg (sub_nonneg.mpr hH) hS, hH, hS] exact hT3.trans hraise calc ‖(T : ℂ) * A + (T : ℂ) ^ 2 * B + @@ -3145,13 +3014,13 @@ private theorem saddle_cubic_translation_norm_le norm_add_le _ _ _ ≤ (‖(T : ℂ) * A‖ + ‖(T : ℂ) ^ 2 * B‖) + ‖C * (T : ℂ) ^ 3‖ := by - gcongr + refine add_le_add ?_ (le_refl ‖C * ↑T ^ 3‖) exact norm_add_le _ _ _ ≤ (|T| * (3 * H) + |T| ^ 2 * (3 * H)) + |T| ^ 3 := by - gcongr + exact add_le_add (add_le_add hfirst hsecond) hthird _ ≤ 9 * H * S := by - linarith [mul_nonneg (show 0 ≤ H by positivity) hS] + linarith only [mul_nonneg (show 0 ≤ H by positivity) hS, hT, hfirst', hsecond', hthird'] _ = 9 * (1 + |u|) ^ 2 * (|T| + |T| ^ 3) := by rfl @@ -3247,7 +3116,7 @@ private theorem exists_plusPolynomial_uniform_difference_ratio have hfactor : 0 ≤ |u| * (1 + |u|) ^ 2 := mul_nonneg (abs_nonneg u) (sq_nonneg _) - linarith + linear_combination hfactor have hgrowth := plusPolynomial_imaginary_cubic_growth_le hε hu have hquadratic : @@ -3266,7 +3135,11 @@ private theorem exists_plusPolynomial_uniform_difference_ratio 9 * (1 + |u|) ^ 2 * S := plusPolynomial_translation_norm_le ε u T _ ≤ 9 * ((27 / (ε / 4) + 9) * D) * S := by - gcongr + exact mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left hquadratic + (le_of_lt + ((by norm_num)))) + (add_nonneg (abs_nonneg T) (pow_nonneg (abs_nonneg T) 3)) _ = ((9 * (27 / (ε / 4) + 9)) * S) * D := by ring @@ -3288,7 +3161,7 @@ private theorem exists_minusPolynomial_uniform_difference_ratio have h := minusPolynomial_imaginary_norm_ge_three_beta hε hu change 3 * (ε / 4) ≤ D at h - linarith + linarith only [hε, h] have hS : 0 ≤ S := by try dsimp [S] positivity @@ -3296,7 +3169,7 @@ private theorem exists_minusPolynomial_uniform_difference_ratio have hfactor : 0 ≤ |u| * (1 + |u|) ^ 2 := mul_nonneg (abs_nonneg u) (sq_nonneg _) - linarith + linarith only [hfactor] have hgrowth := minusPolynomial_imaginary_cubic_growth_le hε hu have hquadratic : @@ -3315,7 +3188,11 @@ private theorem exists_minusPolynomial_uniform_difference_ratio 9 * (1 + |u|) ^ 2 * S := minusPolynomial_translation_norm_le ε u T _ ≤ 9 * ((9 / (ε / 4) + 6) * D) * S := by - gcongr + exact mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left hquadratic + (le_of_lt + ((by norm_num)))) + (add_nonneg (abs_nonneg T) (pow_nonneg (abs_nonneg T) 3)) _ = ((9 * (9 / (ε / 4) + 6)) * S) * D := by ring @@ -3338,7 +3215,7 @@ private theorem upperNegativeHalfGammaArgument_ne_zero sub_self, sub_zero, Complex.zero_re] at hre have hN : 0 ≤ (N : ℝ) := Nat.cast_nonneg N - linarith + linarith only [hre] private theorem upperNegativeHalfGammaArgument_succ_add_one (N : ℕ) (s : ℝ) : @@ -3355,7 +3232,7 @@ private theorem tendsto_upper_shortEndpoint_scaled : (by norm_num : (0 : ℝ) < 1) simp only [Real.rpow_one] at hlog have hscaled := hlog.const_mul (-10 : ℝ) - convert! hscaled using 1 + convert hscaled using 1 · ext ε rw [one_div, Real.log_inv] ring @@ -3367,7 +3244,7 @@ private theorem tendsto_upper_one_add_shortEndpoint_scaled : have hid : Tendsto (fun ε : ℝ => ε) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := tendsto_id.mono_left nhdsWithin_le_nhds - convert! hid.add tendsto_upper_shortEndpoint_scaled using 1 + convert hid.add tendsto_upper_shortEndpoint_scaled using 1 · ext ε ring · norm_num @@ -3380,7 +3257,7 @@ private theorem eventually_upper_shortMargin_positive : Tendsto (fun ε : ℝ => 10 * (ε * (1 + (10 * Real.log (1 / ε))))) (𝓝[>] (0 : ℝ)) (𝓝 (0 : ℝ)) := by - convert! tendsto_upper_one_add_shortEndpoint_scaled.const_mul + convert tendsto_upper_one_add_shortEndpoint_scaled.const_mul (10 : ℝ) using 1; norm_num have hsmall := hscaled.eventually (Iio_mem_nhds (by norm_num : (0 : ℝ) < 1 / 2)) @@ -3389,10 +3266,10 @@ private theorem eventually_upper_shortMargin_positive : change 0 < ε at hε have hcompare : ε * (1 + a) ≤ ε * (1 + (10 * Real.log (1 / ε))) := - mul_le_mul_of_nonneg_left (by linarith [ha.2]) hε.le + mul_le_mul_of_nonneg_left (by linarith only [ha.2, ha]) hε.le change 10 * (ε * (1 + (10 * Real.log (1 / ε)))) < 1 / 2 at hbound - linarith + linarith only [hcompare, hbound] private theorem eventually_upper_shellLocation_gt_shortEndpoint : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), @@ -3415,7 +3292,7 @@ private theorem eventually_upper_shellLocation_gt_shortEndpoint : filter_upwards [hevent] with ε hε change ε ^ 2 * (ε * (1 + (10 * Real.log (1 / ε)))) < 1 at hε - linarith + linear_combination hε filter_upwards [self_mem_nhdsWithin, hsmall] with ε hε hbound change 0 < ε at hε @@ -3500,18 +3377,18 @@ private theorem tendsto_upper_log_cubic_gaussian_atTop : · filter_upwards [eventually_ge_atTop (1 : ℝ)] with x hx have hlog : 0 ≤ Real.log x := Real.log_nonneg hx have hcube : 0 ≤ x ^ 3 := by positivity - exact mul_nonneg (by linarith) (Real.exp_pos _).le + exact mul_nonneg (by linarith only [hlog, hcube]) (Real.exp_pos _).le · filter_upwards [eventually_ge_atTop (1 : ℝ)] with x hx - have hxpos : 0 < x := by linarith + have hxpos : 0 < x := by linear_combination hx have hlog := Real.log_le_sub_one_of_pos hxpos have hsquare : 0 ≤ x ^ 2 - 1 := by - linarith [sq_nonneg (x - 1)] + linarith only [sq_nonneg (x - 1), hx] have hcube : x ≤ x ^ 3 := by - linarith [mul_nonneg hxpos.le hsquare] + linarith only [mul_nonneg hxpos.le hsquare, hxpos, hsquare] have hfactor : 10 * Real.log x + x ^ 3 ≤ 11 * (x ^ 3 + 1) := by - linarith + linarith only [hlog, hcube] calc (10 * Real.log x + x ^ 3) * Real.exp (-(x ^ 2) / 8) ≤ @@ -3534,7 +3411,7 @@ private theorem tendsto_upper_shell_log_correction_atTop : have hscaled : Tendsto (fun x : ℝ => 5 * Real.log x / x) atTop (𝓝 (0 : ℝ)) := by - convert! hlog.const_mul (5 : ℝ) using 1 + convert hlog.const_mul (5 : ℝ) using 1 · ext x ring · norm_num @@ -3579,13 +3456,13 @@ private theorem eventually_upper_shell_parameter_margin : shellWeight ε * Real.exp ((ε / 2) * (ε⁻¹ ^ 3)) := by exact (div_lt_one hden).mp hε - linarith + linarith only [hscaled] private theorem upper_one_sub_cos_le_min (x : ℝ) : 1 - Real.cos x ≤ min (x ^ 2 / 2) 2 := by apply le_min - · linarith [Real.one_sub_sq_div_two_le_cos (x := x)] - · linarith [Real.neg_one_le_cos x] + · linarith only [Real.one_sub_sq_div_two_le_cos (x := x)] + · linarith only [Real.neg_one_le_cos x] private theorem upper_min_frequency_inverse_sq_le {a : ℝ} (ha : 0 < a) (T : ℝ) : @@ -3595,10 +3472,10 @@ private theorem upper_min_frequency_inverse_sq_le by_cases hsmall : T ^ 2 ≤ 1 · rw [min_eq_left hsmall] have hmin := min_le_left (T ^ 2) ((a ^ 2)⁻¹) - linarith [mul_nonneg (sq_nonneg T) hinv] + linarith only [mul_nonneg (sq_nonneg T) hinv, hinv, hmin] · rw [min_eq_right (le_of_not_ge hsmall)] have hmin := min_le_right (T ^ 2) ((a ^ 2)⁻¹) - linarith + linear_combination hmin private noncomputable def upperShortShellDamping (ε ℓ δ T : ℝ) : ℝ := ℓ * ∫ a in (ε ^ 3)..(10 * Real.log (1 / ε)), @@ -3642,9 +3519,9 @@ private theorem upper_shortShellDensity_damping_le Real.exp (δ * A) * min (T ^ 2) 1 * (1 + (a ^ 2)⁻¹) := by have hmarginone : (1 - 10 * ε * (1 + a)) ≤ 1 := by - linarith [mul_nonneg hε.le (show 0 ≤ 1 + a by linarith)] + linarith only [mul_nonneg hε.le (show 0 ≤ 1 + a by linarith), hε, ha] have hnegativeexp : Real.exp (-2 * a) ≤ 1 := by - exact Real.exp_le_one_iff.mpr (by linarith) + exact Real.exp_le_one_iff.mpr (by linarith only [ha]) have hratio : Real.cosh ((1 + δ) * a) / Real.cosh a ≤ Real.exp (δ * A) := by @@ -3758,7 +3635,7 @@ private theorem upperShortShellDamping_global_bound (Real.cosh_pos a)).ne' have hcosh : Continuous (fun a : ℝ => Real.cosh ((1 + δ) * a)) := by - fun_prop + exact Continuous.comp' Real.continuous_cosh (Continuous.const_mul continuous_id' (1 + δ)) have hosc : Continuous (fun a : ℝ => 1 - Real.cos (a * T)) := by fun_prop @@ -3807,7 +3684,7 @@ private theorem upperShortShellDamping_global_bound have hcoefficient : A - a₀ + a₀⁻¹ - A⁻¹ ≤ A + a₀⁻¹ := by have hAinv : 0 ≤ A⁻¹ := (inv_pos.mpr hA).le - linarith + linear_combination ha₀ + hAinv change ℓ * (∫ a in a₀..A, (-shortShellDensity ε a) * @@ -3838,7 +3715,7 @@ private theorem eventually_upper_shortCutoff_le_shortEndpoint : have hupper := tendsto_shortEndpoint.eventually_ge_atTop (1 : ℝ) filter_upwards [hlower, hupper] with ε hl hu - linarith + linear_combination hl + hu private theorem upper_shell_parameter_margin_propagate {ε δ : ℝ} @@ -3856,7 +3733,7 @@ private theorem upper_shell_parameter_margin_propagate let q : ℝ := δ - ε / 2 have hq : 0 ≤ q := by try dsimp [q] - linarith + linear_combination hδ have hexp : Real.exp (q * (10 * Real.log (1 / ε))) ≤ Real.exp (q * (ε⁻¹ ^ 3)) := @@ -3912,7 +3789,7 @@ private theorem eventually_upper_shortShell_domination : change 0 < ε at hε intro ℓ hℓ δ hδ T have hδnonneg : 0 ≤ δ := by - linarith + linarith only [hε, hδ] have hshort : upperShortShellDamping ε ℓ δ T ≤ ℓ * upperShellShortCoefficient ε * @@ -3922,10 +3799,10 @@ private theorem eventually_upper_shortShell_domination : hε hℓ hδnonneg horder (fun a ha => by have h := hshortmargin a ha - linarith) + linear_combination h) have hpropagate := upper_shell_parameter_margin_propagate hδ - (le_of_lt (by linarith [hseparation])) hmargin + (le_of_lt (by linear_combination hseparation)) hmargin have hpositive := positiveShellDamping_lower_bound (ε := ε) (ℓ := ℓ) (δ := δ) (T := T) @@ -3940,7 +3817,7 @@ private theorem eventually_upper_shortShell_domination : _ ≤ ℓ * ((1 / 5000 : ℝ) * shellWeight ε * Real.exp (δ * (ε⁻¹ ^ 3))) * min (T ^ 2) 1 := by - convert! mul_le_mul_of_nonneg_right + convert mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hpropagate hℓ) hfreq using 1; ring _ = (1 / 100 : ℝ) * @@ -3977,7 +3854,7 @@ private theorem upperPositiveShellVariance_bounds try dsimp [B] positivity have hQ : 0 < shellWeight ε := shellWeight_pos ε - have horder : B ≤ B + 1 := by linarith + have horder : B ≤ B + 1 := by linarith only [] have hcont : Continuous (fun a : ℝ => positiveShellDensity ε a * a ^ 2 * Real.cosh ((1 + δ) * a)) := by @@ -4012,7 +3889,11 @@ private theorem upperPositiveShellVariance_bounds _ ≤ shellWeight ε * a ^ 2 * (Real.cosh ((1 + δ) * a) / Real.cosh a) := by - gcongr + exact mul_le_mul (mul_le_mul_of_nonneg_left hsquare (le_of_lt hQ)) hratio + (le_of_lt + (div_pos (Real.exp_pos (δ * B)) + (zero_lt_two))) + (mul_nonneg (le_of_lt hQ) (Even.pow_nonneg (even_two_mul 1) a)) _ = positiveShellDensity ε a * a ^ 2 * Real.cosh ((1 + δ) * a) := by unfold positiveShellDensity @@ -4081,10 +3962,9 @@ private theorem upper_shortShellDensity_variance_le Real.cosh ((1 + δ) * a) ≤ (1 / 2 : ℝ) * Real.exp (δ * A) := by have hmargin : (1 - 10 * ε * (1 + a)) ≤ 1 := by - linarith [mul_nonneg hε.le - (show 0 ≤ 1 + a by linarith)] + linarith only [mul_nonneg hε.le (show 0 ≤ 1 + a by linarith), hε, ha] have hexp : Real.exp (-2 * a) ≤ 1 := - Real.exp_le_one_iff.mpr (by linarith) + Real.exp_le_one_iff.mpr (by linarith only [ha]) have hratio : Real.cosh ((1 + δ) * a) / Real.cosh a ≤ Real.exp (δ * A) := @@ -4144,7 +4024,7 @@ private theorem upperShortShellVariance_global_bound positivity have hcosh : Continuous (fun a : ℝ => Real.cosh ((1 + δ) * a)) := by - fun_prop + exact Continuous.comp' Real.continuous_cosh (Continuous.const_mul continuous_id' (1 + δ)) have hleft : ContinuousOn (fun a : ℝ => (-shortShellDensity ε a) * a ^ 2 * @@ -4182,7 +4062,7 @@ private theorem upperShortShellVariance_global_bound smul_eq_mul] using! hmono _ ≤ (A + a₀⁻¹) * K := by apply mul_le_mul_of_nonneg_right _ hK - linarith + linear_combination ha₀ + hinv _ = (1 / 2 : ℝ) * upperShellShortCoefficient ε * Real.exp (δ * A) := by unfold upperShellShortCoefficient @@ -4218,7 +4098,7 @@ private theorem upper_shellLocation_one_le 1 ≤ (ε⁻¹ ^ 3) := by have hinv : 1 ≤ ε⁻¹ := (one_le_inv₀ hε).mpr hεone - convert! pow_le_pow_left₀ + convert pow_le_pow_left₀ (show (0 : ℝ) ≤ 1 by norm_num) hinv 3 using 1; norm_num private theorem eventually_upper_shortShellVariance_domination : @@ -4244,10 +4124,10 @@ private theorem eventually_upper_shortShellVariance_domination : have hB : 1 ≤ (ε⁻¹ ^ 3) := upper_shellLocation_one_le hε hεone.le have hBsq : 1 ≤ (ε⁻¹ ^ 3) ^ 2 := by - linarith [sq_nonneg ((ε⁻¹ ^ 3) - 1)] + linarith only [sq_nonneg ((ε⁻¹ ^ 3) - 1), hB] have hpropagate := upper_shell_parameter_margin_propagate - hδ (by linarith [hseparation]) hmargin + hδ (by linear_combination hseparation + hεone + hε) hmargin have hvariance := upperShortShellVariance_global_bound hε hδnonneg horder @@ -4265,7 +4145,7 @@ private theorem eventually_upper_shortShellVariance_domination : _ ≤ (1 / 2 : ℝ) * ((1 / 5000 : ℝ) * shellWeight ε * Real.exp (δ * (ε⁻¹ ^ 3))) := by - convert! mul_le_mul_of_nonneg_left + convert mul_le_mul_of_nonneg_left hpropagate (by norm_num : (0 : ℝ) ≤ 1 / 2) using 1; ring _ ≤ (1 / 100 : ℝ) * @@ -4274,7 +4154,7 @@ private theorem eventually_upper_shortShellVariance_domination : Real.exp (δ * (ε⁻¹ ^ 3))) := by have hscaled := mul_le_mul_of_nonneg_right hBsq hqexp - linarith + linarith only [hqexp, hscaled] _ ≤ (1 / 100 : ℝ) * upperPositiveShellVariance ε δ := mul_le_mul_of_nonneg_left hpositive @@ -4304,7 +4184,7 @@ private theorem eventually_upper_netShellVariance_bounds : (δ := δ) hε horder (fun a ha => by have h := hmargin a ha - linarith) + linear_combination h) have hupper := hdom δ hδ unfold upperNetShellVariance constructor <;> linarith @@ -4324,7 +4204,7 @@ private theorem upperPositiveShellThirdMoment_le try dsimp [B] positivity have horder : B ≤ B + 1 := by - linarith + linarith only [] have hdensity := positiveShellDensity_continuous ε have hbase : Continuous (fun a : ℝ => positiveShellDensity ε a * a ^ 2 * @@ -4408,7 +4288,7 @@ private theorem upperShortShellThirdMoment_le positivity have hcosh : Continuous (fun a : ℝ => Real.cosh ((1 + δ) * a)) := by - fun_prop + exact Continuous.comp' Real.continuous_cosh (Continuous.const_mul continuous_id' (1 + δ)) have hbase : ContinuousOn (fun a : ℝ => (-shortShellDensity ε a) * a ^ 2 * Real.cosh ((1 + δ) * a)) (Set.Icc a₀ A) := @@ -4490,7 +4370,7 @@ private theorem eventually_upper_shortShellThirdMoment_domination : (δ := δ) hε horder (fun a ha => by have h := hmargin a ha - linarith) + linear_combination h) calc upperShortShellThirdMoment ε δ ≤ (10 * Real.log (1 / ε)) * upperShortShellVariance ε δ := hthird @@ -4522,7 +4402,7 @@ private theorem eventually_upper_netShellThirdMoment_bound : (δ := δ) hε have hnegative := hshort δ hδ unfold upperNetShellThirdMoment - linarith + linear_combination hpositive + hnegative private theorem upper_inv_one_sub_exp_neg_bounds {x : ℝ} (hx : 0 < x) : @@ -4530,16 +4410,16 @@ private theorem upper_inv_one_sub_exp_neg_bounds (1 - Real.exp (-x))⁻¹ ≤ 1 + x⁻¹ := by have hden : 0 < 1 - Real.exp (-x) := by have he : Real.exp (-x) < 1 := - Real.exp_lt_one_iff.mpr (by linarith) - linarith + Real.exp_lt_one_iff.mpr (by linear_combination hx) + linear_combination he have hlower : 1 - Real.exp (-x) ≤ x := by - linarith [Real.add_one_le_exp (-x)] + linarith only [Real.add_one_le_exp (-x)] have hplus : 0 < 1 + x := by - linarith + linear_combination hx have hexp : Real.exp (-x) ≤ (1 + x)⁻¹ := by rw [Real.exp_neg] apply (inv_le_inv₀ (Real.exp_pos x) hplus).2 - linarith [Real.add_one_le_exp x] + linarith only [Real.add_one_le_exp x] constructor · exact (inv_le_inv₀ hx hden).2 hlower · have hgoal : @@ -4620,8 +4500,8 @@ private theorem upperGammaVarianceDensity_pointwise_bounds have hkernel := upper_inv_one_sub_exp_neg_bounds hx have hden : 0 < 1 - Real.exp (-x) := by have he : Real.exp (-x) < 1 := - Real.exp_lt_one_iff.mpr (by linarith) - linarith + Real.exp_lt_one_iff.mpr (by linear_combination hx) + linear_combination he have hfactor : 0 ≤ a * Real.exp (-η * a) := by positivity have hidentity : @@ -5337,7 +5217,7 @@ private theorem realHyperbolicShellPhase_hasDerivAt exact realHyperbolicShellInterval_hasDerivAt w hw horder u have hremote : (ε⁻¹ ^ 3) ≤ (ε⁻¹ ^ 3) + 1 := by - linarith + linarith only [] have hpositive := realHyperbolicShellInterval_hasDerivAt (positiveShellDensity ε) (positiveShellDensity_continuous ε) hremote u @@ -5481,9 +5361,11 @@ private theorem plusSaddleSmallRadiusPolynomial_error try dsimp [s] exact (div_le_iff₀ hℓ).mpr (by simpa only [one_mul] using! hn) have hsquare : (2 + s) ^ 2 ≤ 9 := by - linarith [mul_nonneg - (show 0 ≤ 3 - (2 + s) by linarith) - (show 0 ≤ 3 + (2 + s) by linarith)] + linarith only [ + mul_nonneg (show 0 ≤ 3 - (2 + s) by linarith) (show 0 ≤ 3 + (2 + s) by linarith), + hs, + hsone + ] have hnumerator : 0 ≤ s * (2 + s) ^ 2 := mul_nonneg hs (sq_nonneg _) change |((ε / 4) - s * (2 + s) ^ 2) / @@ -5517,7 +5399,7 @@ private theorem abs_exp_sub_one_le_abs_mul_exp_abs (t : ℝ) : rw [← Real.exp_add] simp only [add_neg_cancel, Real.exp_zero] rw [hcancel] at hmul - linarith + linear_combination hmul · have hexp : Real.exp t ≤ 1 := by simpa only [Real.exp_le_one_iff, Real.exp_zero] using! Real.exp_le_exp.mpr ht have hnegt : 0 ≤ -t := neg_nonneg.mpr ht @@ -5528,13 +5410,12 @@ private theorem abs_exp_sub_one_le_abs_mul_exp_abs (t : ℝ) : abs_of_nonpos ht] have hsupport := Real.add_one_le_exp t have hlinear : 1 - Real.exp t ≤ -t := by - linarith + linear_combination hsupport calc -(Real.exp t - 1) = 1 - Real.exp t := by ring _ ≤ -t := hlinear _ ≤ -t * Real.exp (-t) := by - linarith [mul_nonneg hnegt - (sub_nonneg.mpr hexpneg)] + linarith only [mul_nonneg hnegt (sub_nonneg.mpr hexpneg), hnegt, hexpneg] private theorem plusSaddleSmallRadiusCoefficient_error_of_phase {ε ℓ : ℝ} @@ -5629,8 +5510,7 @@ private theorem exists_plusSaddleSmallRadiusCoefficient_error (C * (n : ℝ) ^ 2 + K * (n : ℝ)) / ℓ by ring] apply (div_le_div_iff_of_pos_right hℓ).mpr - linarith [mul_nonneg hC hnreal, - mul_nonneg hK (sq_nonneg (n : ℝ))] + linarith only [mul_nonneg hC hnreal, mul_nonneg hK (sq_nonneg (n : ℝ)), hC, hK, hnreal] have hq : C * (n : ℝ) ^ 2 / ℓ ≤ (C + K) * (n : ℝ) ^ 2 / ℓ := by @@ -5723,7 +5603,7 @@ private theorem saddleExpSeries_polynomialMoment_hasSum (y : ℝ) : have hsecond := saddleExpSeries_secondFallingMoment_hasSum y have hcombined := hfirst.add hsecond - convert! hcombined using 1 + convert hcombined using 1 · funext n ring · ring @@ -5907,7 +5787,7 @@ private theorem saddleExpSeries_alternating_tail_bound have hidentity : Real.exp (-y) - (∑ n ∈ Finset.range m, f n) = ∑' n : ℕ, f (n + m) := by - linarith + linarith only [hdecomp] calc |Real.exp (-y) - (∑ n ∈ Finset.range m, f n)| = @@ -5955,7 +5835,7 @@ private theorem exists_plusSaddleSmallRadius_finiteResidue_error have htail := saddleExpSeries_alternating_tail_bound hy (N + 1) (by push_cast - linarith) + linear_combination hyratio) have hsplit : (∑ n ∈ Finset.range (N + 1), ((-y) ^ n / (n.factorial : ℝ)) * @@ -6088,8 +5968,8 @@ private theorem upperGammaMeasureDensity_pos 0 < upperGammaMeasureDensity ℓ η a := by have hx : 0 < 2 * a / ℓ := by positivity have hden : 0 < 1 - Real.exp (-(2 * a / ℓ)) := by - have he := Real.exp_lt_one_iff.mpr (show -(2 * a / ℓ) < 0 by linarith) - linarith + have he := Real.exp_lt_one_iff.mpr (show -(2 * a / ℓ) < 0 by linear_combination hx) + linear_combination he unfold upperGammaMeasureDensity exact div_pos (Real.exp_pos _) (mul_pos ha hden) @@ -6149,8 +6029,7 @@ private theorem upperGammaDampingIntegrand_integrable sub_nonneg.mpr (Real.cos_le_one _) have hquad : 1 - Real.cos (a * T) ≤ (a * T) ^ 2 / 2 := by - linarith [Real.one_sub_sq_div_two_le_cos - (x := a * T)] + linarith only [Real.one_sub_sq_div_two_le_cos (x := a * T)] unfold upperGammaDampingIntegrand rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg hcos hdensity.le)] @@ -6200,7 +6079,7 @@ private theorem upperGammaDampingIntegrand_lower_on_window have hexp : (Real.exp 1)⁻¹ ≤ Real.exp (-η * a) := by rw [← Real.exp_neg] - exact Real.exp_le_exp.mpr (by linarith) + exact Real.exp_le_exp.mpr (by linear_combination heta) have hvariance := (upperGammaVarianceDensity_pointwise_bounds (η := η) hℓ ha).1 @@ -6216,7 +6095,14 @@ private theorem upperGammaDampingIntegrand_lower_on_window ring _ ≤ (T ^ 2 / 4) * ((ℓ / 2) * Real.exp (-η * a)) := by - gcongr + exact mul_le_mul_of_nonneg_left + (mul_le_mul_of_nonneg_left hexp + (le_of_lt + (div_pos hℓ + (zero_lt_two)))) + (le_of_lt + (div_pos (lt_of_le_of_ne' (Even.pow_nonneg (even_two_mul 1) T) (pow_ne_zero 2 hT)) + ((by norm_num)))) _ ≤ (T ^ 2 / 4) * (a ^ 2 * upperGammaMeasureDensity ℓ η a) := mul_le_mul_of_nonneg_left hvariance hquarter @@ -6291,7 +6177,7 @@ private theorem upperGammaDamping_lower_bound change ((volume : Measure ℝ) (Ioc (0 : ℝ) q)).toReal = q rw [Real.volume_Ioc, - ENNReal.toReal_ofReal (by linarith)] + ENNReal.toReal_ofReal (by linarith only [hq])] simp only [sub_zero] have hconstintegral : (∫ a : ℝ in Ioc (0 : ℝ) q, c) = q * c := by @@ -6353,7 +6239,7 @@ private theorem eventually_upperSaddleDamping_gamma_add_shell intro ℓ hℓ δ hδ T have hshort := hdom ℓ hℓ.le δ hδ T unfold upperSaddleDamping - linarith + linear_combination hshort private theorem eventually_upperSaddleVariance_bounds : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), @@ -6373,7 +6259,7 @@ private theorem eventually_upperSaddleVariance_bounds change 0 < ε at hε intro ℓ hℓ δ hδ have hη : 0 < 2 + δ := by - linarith + linarith only [hε, hδ] obtain ⟨hγlow, hγhigh⟩ := upperGammaVariance_bounds hℓ hη obtain ⟨hslow, hshigh⟩ := @@ -6413,9 +6299,9 @@ private theorem eventually_upperSaddleVariance_pos change 0 < ε at hε intro ℓ hℓ δ hδ have hδnonnegative : 0 ≤ δ := by - linarith + linarith only [hε, hδ] have hη : 0 < 2 + δ := by - linarith + linarith only [hε, hδ] have hshell := upperPositiveShellVariance_pos hε hδnonnegative have hpositive : @@ -6430,8 +6316,8 @@ private theorem upperGammaThirdMoment_le_two_mul_variance {ℓ η : ℝ} (hℓ : 1 ≤ ℓ) (hη : 2 ≤ η) : upperGammaThirdMoment ℓ η ≤ 2 * upperGammaVariance ℓ η := by - have hℓpositive : 0 < ℓ := by linarith - have hηpositive : 0 < η := by linarith + have hℓpositive : 0 < ℓ := by linear_combination hℓ + have hηpositive : 0 < η := by linear_combination hη have hγthird := (upperGammaThirdMoment_bounds hℓpositive hηpositive).2 have hγvariance := @@ -6441,17 +6327,14 @@ private theorem upperGammaThirdMoment_le_two_mul_variance apply (div_le_div_iff₀ (show 0 < 2 * η ^ 2 by positivity) (show 0 < 2 * η by positivity)).2 - linarith [mul_nonneg hηpositive.le - (show 0 ≤ η - 1 by linarith)] + linarith only [mul_nonneg hηpositive.le (show 0 ≤ η - 1 by linarith), hη, hηpositive] have hηsquare : 4 ≤ η ^ 2 := by - linarith [sq_nonneg (η - 2)] + linarith only [sq_nonneg (η - 2), hη] have hsquare : 4 ≤ ℓ * η ^ 2 := by calc (4 : ℝ) ≤ η ^ 2 := hηsquare _ ≤ ℓ * η ^ 2 := by - linarith [mul_nonneg - (show 0 ≤ ℓ - 1 by linarith) - (sq_nonneg η)] + linarith only [mul_nonneg (show 0 ≤ ℓ - 1 by linarith) (sq_nonneg η), hℓ] have hsecond : 2 / (ℓ * η ^ 3) ≤ 1 / (2 * η) := by apply (div_le_div_iff₀ @@ -6459,15 +6342,15 @@ private theorem upperGammaThirdMoment_le_two_mul_variance (show 0 < 2 * η by positivity)).2 have hscaled := mul_le_mul_of_nonneg_right hsquare hηpositive.le - linarith + linear_combination hscaled calc upperGammaThirdMoment ℓ η ≤ 1 / (2 * η ^ 2) + 2 / (ℓ * η ^ 3) := hγthird _ ≤ 2 * (1 / (2 * η)) := by - linarith + linear_combination hfirst + hsecond _ ≤ 2 * upperGammaVariance ℓ η := by - linarith + linarith only [hγvariance] private noncomputable def upperSaddleShellThirdCoefficient (ε : ℝ) : ℝ := (ε⁻¹ ^ 3) + 1 + (10 * Real.log (1 / ε)) / 100 @@ -6487,13 +6370,13 @@ private theorem eventually_upperSaddleThirdMoment_le_variance with ε hε horder hnet hthird change 0 < ε at hε intro ℓ hℓ δ hδ - have hℓpositive : 0 < ℓ := by linarith + have hℓpositive : 0 < ℓ := by linarith only [hℓ] have hδnonnegative : 0 ≤ δ := by - linarith + linarith only [hε, hδ] have hη : 2 ≤ 2 + δ := by - linarith + linarith only [hε, hδ] have hηpositive : 0 < 2 + δ := by - linarith + linarith only [hε, hδ] have hgamma := upperGammaThirdMoment_le_two_mul_variance hℓ hη @@ -6503,7 +6386,7 @@ private theorem eventually_upperSaddleThirdMoment_le_variance upperPositiveShellVariance_pos hε hδnonnegative have hnetnonnegative : 0 ≤ upperNetShellVariance ε δ := by - linarith + linarith only [hnetlower, hpositiveShell] have hgammavariance : 0 ≤ upperGammaVariance ℓ (2 + δ) := by have h := (upperGammaVariance_bounds @@ -6524,7 +6407,7 @@ private theorem eventually_upperSaddleThirdMoment_le_variance upperPositiveShellVariance ε δ ≤ (100 / 99 : ℝ) * upperNetShellVariance ε δ := by - linarith + linarith only [hnetlower] have hthirdshell : upperNetShellThirdMoment ε δ ≤ (100 / 99 : ℝ) * @@ -6544,8 +6427,16 @@ private theorem eventually_upperSaddleThirdMoment_le_variance upperNetShellVariance ε δ := by ring unfold upperSaddleThirdMoment upperSaddleVariance - linarith [mul_nonneg hC hgammavariance, - mul_nonneg hC hnetnonnegative] + linarith only [ + mul_nonneg hC hgammavariance, + mul_nonneg hC hnetnonnegative, + hgamma, + hnetlower, + hpositiveShell, + hgammavariance, + hC, + hthirdshell + ] private theorem upperShortMargin_mul_exp_antitone {ε : ℝ} (hε : 0 < ε) : @@ -6589,11 +6480,10 @@ private theorem upperShortMargin_mul_exp_antitone have h := interior_subset ha exact h have hmargin : (1 - 10 * ε * (1 + a)) ≤ 1 := by - linarith [mul_nonneg hε.le - (show 0 ≤ 1 + a by linarith)] + linarith only [mul_nonneg hε.le (show 0 ≤ 1 + a by linarith), hε, ha0] exact mul_nonpos_of_nonneg_of_nonpos (mul_nonneg hε.le (Real.exp_pos _).le) - (by linarith) + (by linear_combination hmargin) private theorem upperShortMargin_mul_exp_le_zero_value {ε a : ℝ} (hε : 0 < ε) (ha : 0 ≤ a) : @@ -6616,7 +6506,7 @@ private theorem upperFirstBranch_shortRatio_le 1 - 4 * ε := by have hmarginupper : (1 - 10 * ε * (1 + a)) ≤ 1 - 10 * ε := by - linarith [mul_nonneg hε.le ha] + linarith only [mul_nonneg hε.le ha, hε, ha] by_cases hubounded : u ≤ 1 · have huexp : Real.exp ((u - 1) * a) ≤ 1 := by @@ -6641,21 +6531,19 @@ private theorem upperFirstBranch_shortRatio_le gcongr _ = (1 - 10 * ε * (1 + a)) := by ring _ ≤ 1 - 10 * ε := hmarginupper - _ ≤ 1 - 4 * ε := by linarith + _ ≤ 1 - 4 * ε := by linarith only [hε] · have hugreater : 1 ≤ u := (le_of_not_ge hubounded) - have hδ : 0 ≤ u - 1 := by linarith + have hδ : 0 ≤ u - 1 := by linarith only [hubounded] have hratio : Real.cosh (u * a) / Real.cosh a ≤ Real.exp ((u - 1) * a) := by - convert! cosh_ratio_upper ha hδ using 1; ring_nf + convert cosh_ratio_upper ha hδ using 1; ring_nf have hdouble : Real.exp (2 * (u - 1) * a) ≤ Real.exp (ε * a) := by apply Real.exp_le_exp.mpr - linarith [mul_nonneg - (show 0 ≤ ε - 2 * (u - 1) by linarith) - ha] + linarith only [mul_nonneg (show 0 ≤ ε - 2 * (u - 1) by linarith) ha, ha, huupper] calc (1 - 10 * ε * (1 + a)) * Real.exp ((u - 1) * a) * @@ -6675,7 +6563,7 @@ private theorem upperFirstBranch_shortRatio_le _ ≤ 1 - 10 * ε := upperShortMargin_mul_exp_le_zero_value hε ha - _ ≤ 1 - 4 * ε := by linarith + _ ≤ 1 - 4 * ε := by linarith only [huupper, hubounded] private theorem upperFirstBranch_shortMeasure_pointwise {ε ℓ u a : ℝ} @@ -6688,7 +6576,7 @@ private theorem upperFirstBranch_shortMeasure_pointwise (1 - 4 * ε) * upperGammaMeasureDensity ℓ (1 + u) a := by have hfactor : 0 ≤ 1 - 4 * ε := by - linarith + linarith only [hεsmall] have hratio := upperFirstBranch_shortRatio_le hε ha.le hulower huupper hmargin have hvariance := @@ -6700,7 +6588,7 @@ private theorem upperFirstBranch_shortMeasure_pointwise upperGammaMeasureDensity ℓ (1 + u) a := by apply (div_le_iff₀ (sq_pos_of_pos ha)).2 - linarith + linear_combination hvariance have hbasepositive : 0 ≤ (ℓ / 2) * Real.exp (-(1 + u) * a) / a ^ 2 := by @@ -6756,12 +6644,12 @@ private theorem upperFirstBranch_shortDamping_le_gamma let η : ℝ := 1 + u have hη : 0 < η := by try dsimp [η] - linarith + linarith only [hulower] have ha₀ : 0 < a₀ := by try dsimp [a₀] positivity have hfactor : 0 ≤ 1 - 4 * ε := by - linarith + linarith only [hεsmall] have hsubset : Ioc a₀ A ⊆ Ioi (0 : ℝ) := by intro a ha exact ha₀.trans ha.1 @@ -6779,7 +6667,7 @@ private theorem upperFirstBranch_shortDamping_le_gamma have hs := shortShellDensity_intervalIntegrable hε horder have hcosh : Continuous (fun a : ℝ => Real.cosh (u * a)) := by - fun_prop + exact Continuous.comp' Real.continuous_cosh (Continuous.const_mul continuous_id' u) have hosc : Continuous (fun a : ℝ => 1 - Real.cos (a * T)) := by fun_prop @@ -6881,7 +6769,7 @@ private theorem positiveShellDamping_nonneg unfold positiveShellDamping apply mul_nonneg hℓ apply intervalIntegral.integral_nonneg - (show (ε⁻¹ ^ 3) ≤ (ε⁻¹ ^ 3) + 1 by linarith) + (show (ε⁻¹ ^ 3) ≤ (ε⁻¹ ^ 3) + 1 by linarith only []) intro a ha unfold positiveShellDensity exact mul_nonneg @@ -6914,7 +6802,7 @@ private theorem upperFirstBranchSaddleDamping_lower_bound have hpositive := positiveShellDamping_nonneg (ε := ε) (δ := u - 1) (T := T) hℓ.le unfold upperFirstBranchSaddleDamping - linarith + linarith only [hshort, hpositive] private theorem saddle_shifted_complexCos_re (a T u : ℝ) : @@ -6963,7 +6851,10 @@ private theorem saddle_complexShellInterval_re Complex.cos ((x : ℂ) * ((T : ℂ) + Complex.I * (u : ℂ))) - 1) := by - fun_prop + exact Continuous.fun_sub + (Continuous.comp' Complex.continuous_cos + (Continuous.comp' (continuous_mul_const (↑T + Complex.I * ↑u)) Complex.continuous_ofReal)) + continuous_const have hF : IntervalIntegrable F volume a b := by exact (hwcomplex.mul hkernel.continuousOn).intervalIntegrable_of_Icc hab @@ -7028,7 +6919,7 @@ private theorem mellinShellPhase_shifted_re · exact saddle_complexShellInterval_re (positiveShellDensity ε) (show (ε⁻¹ ^ 3) ≤ (ε⁻¹ ^ 3) + 1 by - linarith) + linarith only []) (positiveShellDensity_continuous ε).continuousOn T u private theorem saddle_shellInterval_hyperbolic_sub_oscillatory @@ -7086,7 +6977,7 @@ private theorem saddleShellPhase_damping_identity saddle_shellInterval_hyperbolic_sub_oscillatory (positiveShellDensity ε) (show (ε⁻¹ ^ 3) ≤ (ε⁻¹ ^ 3) + 1 by - linarith) + linarith only []) (positiveShellDensity_continuous ε).continuousOn T u rw [mellinShellPhase_shifted_re hε horder T u] unfold realHyperbolicShellPhase @@ -7397,7 +7288,7 @@ private theorem radialMellinFrequency_injective {d : ℕ} have h := hfrequency (-(2 * Real.pi * ξ)) rw [radialMellinFrequency_eq_criticalLogFourier, radialMellinFrequency_eq_criticalLogFourier] at h - convert! h using 1 <;> field_simp [Real.pi_ne_zero] + convert h using 1 <;> field_simp [Real.pi_ne_zero] have hlog : radialCriticalLogProfile hd f = radialCriticalLogProfile hd g := by funext u @@ -7708,20 +7599,20 @@ private theorem saddleLogGamma_differentiableAt {x : ℝ} (hx : 0 < x) : exact (Real.differentiableAt_Gamma (fun n => ne_of_gt (by have hn : 0 ≤ (n : ℝ) := Nat.cast_nonneg n - linarith))).log (Real.Gamma_pos_of_pos hx).ne' + linarith only [hx]))).log (Real.Gamma_pos_of_pos hx).ne' private theorem saddleDigamma_bounds {x : ℝ} (hx : 1 < x) : Real.log (x - 1) ≤ saddleDigamma x ∧ saddleDigamma x ≤ Real.log x := by - have hxpositive : 0 < x := by linarith - have hxprevious : 0 < x - 1 := by linarith - have hnext : 0 < x + 1 := by linarith + have hxpositive : 0 < x := by linear_combination hx + have hxprevious : 0 < x - 1 := by linear_combination hx + have hnext : 0 < x + 1 := by linear_combination hx have hdiff := saddleLogGamma_differentiableAt hxpositive constructor · have hconv := Real.convexOn_log_Gamma.slope_le_deriv (show x - 1 ∈ Ioi (0 : ℝ) from hxprevious) (show x ∈ Ioi (0 : ℝ) from hxpositive) - (show x - 1 < x by linarith) hdiff + (show x - 1 < x by linarith only []) hdiff have hrec := saddleLogGamma_add_one hxprevious have hshift : (x - 1) + 1 = x := by ring rw [hshift] at hrec @@ -7733,7 +7624,7 @@ private theorem saddleDigamma_bounds {x : ℝ} (hx : 1 < x) : · have hconv := Real.convexOn_log_Gamma.deriv_le_slope (show x ∈ Ioi (0 : ℝ) from hxpositive) (show x + 1 ∈ Ioi (0 : ℝ) from hnext) - (show x < x + 1 by linarith) hdiff + (show x < x + 1 by linarith only []) hdiff have hrec := saddleLogGamma_add_one hxpositive unfold saddleDigamma rw [slope_def_field] at hconv @@ -7760,8 +7651,8 @@ private theorem tendsto_saddleDigamma_sub_log : atTop (𝓝 (0 : ℝ)) := by refine hlog.congr' ?_ filter_upwards [eventually_gt_atTop (1 : ℝ)] with x hx - have hxzero : x ≠ 0 := by linarith - have hxprevious : x - 1 ≠ 0 := by linarith + have hxzero : x ≠ 0 := by linarith only [hx] + have hxprevious : x - 1 ≠ 0 := by linarith only [hx] rw [← Real.log_div hxprevious hxzero] congr 1 field_simp diff --git a/LeanPool/SpherePacking/HarmonicAnalysis.lean b/LeanPool/SpherePacking/HarmonicAnalysis.lean index f62b27f847..4af5d3ce8c 100644 --- a/LeanPool/SpherePacking/HarmonicAnalysis.lean +++ b/LeanPool/SpherePacking/HarmonicAnalysis.lean @@ -68,7 +68,7 @@ private theorem tendsto_saddleEulerHarmonicCorrection atTop atTop := by have h := hcast.atTop_add (tendsto_const_nhds (x := m + 1)) - convert! h using 1 + convert h using 1 funext n ring have hdigamma := @@ -140,7 +140,7 @@ private theorem tendsto_saddleEulerHarmonicCorrection push_cast at hrec rw [show m + ((n : ℝ) + 1) = m + (n : ℝ) + 1 by ring] at hrec - linarith + linarith only [hrec] private noncomputable def upperCenteredLaplaceKernel (c T a : ℝ) : ℂ := @@ -284,11 +284,11 @@ private theorem upperGammaCenteredGeometricLimit_eq_kernel upperCenteredLaplaceKernel η T a * (((1 - Real.exp (-(2 * a / ℓ)))⁻¹ : ℝ) : ℂ) = upperGammaCenteredKernel ℓ η T a := by - simp only [upperCenteredLaplaceKernel, mul_comm, Complex.ofReal_mul, mul_neg, div_eq_mul_inv, - Complex.ofReal_inv, Complex.ofReal_exp, Complex.ofReal_neg, mul_assoc, mul_left_comm, - Complex.ofReal_sub, + simp only [upperCenteredLaplaceKernel, Complex.ofReal_mul, div_eq_mul_inv, + Complex.ofReal_inv, Complex.ofReal_exp, Complex.ofReal_neg, Complex.ofReal_sub, Complex.ofReal_one, Complex.ofReal_ofNat, upperGammaCenteredKernel, - upperGammaMeasureDensity, mul_inv_rev] + upperGammaMeasureDensity, mul_inv_rev] + ring private theorem tendsto_integral_upperGammaCenteredTruncatedKernel {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) (T : ℝ) : @@ -315,7 +315,7 @@ private theorem tendsto_integral_upperGammaCenteredTruncatedKernel apply Real.exp_lt_one_iff.mpr have hp : 0 < 2 * a / ℓ := div_pos (mul_pos (by norm_num) ha) hℓ - linarith + linear_combination hp have hsum : (∑ k ∈ Finset.range (n + 1), Real.exp (-(2 * a / ℓ)) ^ k) ≤ @@ -349,7 +349,7 @@ private theorem tendsto_integral_upperGammaCenteredTruncatedKernel apply Real.exp_lt_one_iff.mpr have hp : 0 < 2 * a / ℓ := div_pos (mul_pos (by norm_num) ha) hℓ - linarith + linear_combination hp have hgeo := (hasSum_geometric_of_lt_one hq0 hq1).tendsto_sum_nat have hshift := hgeo.comp (tendsto_add_atTop_nat 1) @@ -647,7 +647,7 @@ private theorem exp_integral_upperGammaCenteredTruncatedKernel (((b * (∑ k ∈ Finset.range (n + 1), (m + (k : ℝ))⁻¹) : ℝ) : ℂ))) := by - simpa [m, b] using! + simpa only [m, b, Complex.ofReal_add, Complex.ofReal_natCast] using! exp_integral_upperGammaCenteredTruncatedKernel_eq_product hℓ hη T n have hphase : @@ -796,7 +796,7 @@ private theorem exp_upperGammaCenteredPhase (m + (k : ℝ))⁻¹) : ℝ) : ℂ)))) := by filter_upwards [eventually_gt_atTop (0 : ℕ)] with n hn - simpa [m, b] using! + simpa only [m, b] using! exp_integral_upperGammaCenteredTruncatedKernel hℓ hη T hn have hmatch := @@ -844,7 +844,7 @@ private theorem saddleSourceCenteredPhase_cubic_remainder_norm_le T ^ 2 : ℝ) : ℂ)‖ ≤ (ℓ * upperSaddleThirdMoment ε ℓ (u - 1) / 6) * |T| ^ 3 := by - have hη : 0 < 1 + u := by linarith + have hη : 0 < 1 + u := by linear_combination hu have hgamma := upperGammaCenteredPhase_cubic_remainder_norm_le hℓ hη T @@ -946,7 +946,7 @@ private theorem saddleSourceCenteredEnvelope_eq_gamma_shell ((ℓ * T * Real.log Real.pi / 2 : ℝ) : ℂ)) * Complex.exp (Complex.I * ((ℓ * T * v : ℝ) : ℂ))) := by - have hη : 0 < 1 + u := by linarith + have hη : 0 < 1 + u := by linarith only [hu] have hm : 0 < ℓ * (1 + u) / 2 := by positivity have hG : (Real.Gamma (ℓ * (1 + u) / 2) : ℂ) ≠ 0 := by @@ -1015,7 +1015,7 @@ private theorem saddleSourceCenteredEnvelope_stationary_eq_exp_phase saddleSourceCenteredEnvelope ε ℓ u (saddleSourceStationaryLogRadius ε ℓ u) T = Complex.exp (saddleSourceCenteredPhase ε ℓ u T) := by - have hη : 0 < 1 + u := by linarith + have hη : 0 < 1 + u := by linear_combination hu rw [saddleSourceCenteredEnvelope_eq_gamma_shell hℓ hu] rw [saddleSourceStationaryFrequencyPhase_eq] @@ -1099,7 +1099,10 @@ private theorem saddleSourceCenteredEnvelope_stationary_gaussian_error_le (Complex.norm_exp_sub_one_le hRone) hg.le _ ≤ saddleSourceGaussianKernel ε ℓ u T * (2 * q) := by - gcongr + exact mul_le_mul_of_nonneg_left + (mul_le_mul_of_nonneg_left hR + zero_le_two) + (le_of_lt hg) _ = 2 * saddleSourceGaussianKernel ε ℓ u T * q := by ring @@ -1204,7 +1207,7 @@ private theorem saddleSourceCenteredPolynomial_centralGaussianError_le _ ≤ ‖P ((T : ℂ) + z) - P z‖ + ‖P z‖ := norm_add_le _ _ _ ≤ p * ‖P z‖ + ‖P z‖ := by - gcongr + exact add_le_add hpolyT (le_refl ‖P z‖) _ = (1 + p) * ‖P z‖ := by ring have hg : 0 ≤ saddleSourceGaussianKernel ε ℓ u T := by unfold saddleSourceGaussianKernel @@ -1248,7 +1251,14 @@ private theorem saddleSourceCenteredPolynomial_centralGaussianError_le ((1 + p) * ‖P z‖) + saddleSourceGaussianKernel ε ℓ u T * (p * ‖P z‖) := by - gcongr + exact add_le_add + (mul_le_mul henvq hpolynorm (norm_nonneg (P (↑T + z))) + (mul_nonneg + (mul_nonneg + zero_le_two + hg) + hq)) + (mul_le_mul_of_nonneg_left hpolyT hg) _ = c * saddleSourceGaussianKernel ε ℓ u T := by try dsimp [c] ring @@ -1388,7 +1398,7 @@ private theorem saddle_abs_le_exp_sq (T : ℝ) : have hsquare : (|T| - 1) ^ 2 ≥ 0 := sq_nonneg _ have habs : |T| ^ 2 = T ^ 2 := sq_abs T have hlinear : |T| ≤ 1 + T ^ 2 := by - linarith [abs_nonneg T, sq_nonneg T] + linarith only [abs_nonneg T, sq_nonneg T, hsquare, habs] exact hlinear.trans (by simpa only [add_comm] using! Real.add_one_le_exp (T ^ 2)) @@ -1406,14 +1416,14 @@ private theorem saddleGaussianTailWeight_le_two_exp_three_sq (T : ℝ) : exact (Real.one_le_exp_iff).mpr (by positivity) unfold saddleGaussianTailWeight rw [hexpcube] at hcube - linarith + linarith only [hcube, hone] private theorem saddleGaussianTailWeight_le_two_exp_three_abs (T : ℝ) : saddleGaussianTailWeight T ≤ 2 * Real.exp (3 * |T|) := by have hlinear : |T| ≤ Real.exp |T| := by calc - |T| ≤ 1 + |T| := by linarith + |T| ≤ 1 + |T| := by linarith only [] _ ≤ Real.exp |T| := by simpa only [add_comm] using! Real.add_one_le_exp |T| have hcube : |T| ^ 3 ≤ (Real.exp |T|) ^ 3 := @@ -1426,7 +1436,7 @@ private theorem saddleGaussianTailWeight_le_two_exp_three_abs (T : ℝ) : exact (Real.one_le_exp_iff).mpr (by positivity) unfold saddleGaussianTailWeight rw [hexpcube] at hcube - linarith + linarith only [hcube, hone] private theorem saddle_integral_exp_neg_mul_abs {a : ℝ} (ha : 0 < a) : @@ -1491,7 +1501,7 @@ private theorem saddleGaussian_cubic_tail_integral_le Real.exp (-k * T ^ 2)) ≤ 2 * Real.exp (-(k / 4) * R ^ 2) * Real.sqrt (Real.pi / (k / 4)) := by - have hkpos : 0 < k := by linarith + have hkpos : 0 < k := by linear_combination hk have hquarter : 0 < k / 4 := by positivity let c : ℝ := 2 * Real.exp (-(k / 4) * R ^ 2) have hc : 0 ≤ c := by @@ -1515,16 +1525,17 @@ private theorem saddleGaussian_cubic_tail_integral_le 3 * T ^ 2 + (-k * T ^ 2) ≤ (-(k / 4) * R ^ 2) + (-(k / 4) * T ^ 2) := by - linarith [ - mul_nonneg (show 0 ≤ k - 6 by linarith) - (sq_nonneg T), - mul_nonneg (show 0 ≤ k by linarith) - (show 0 ≤ T ^ 2 - R ^ 2 by linarith)] + linarith only [ + mul_nonneg (show 0 ≤ k - 6 by linarith) (sq_nonneg T), + mul_nonneg (show 0 ≤ k by linarith) (show 0 ≤ T ^ 2 - R ^ 2 by linarith), + hk, + hsq + ] calc saddleGaussianTailWeight T * Real.exp (-k * T ^ 2) ≤ (2 * Real.exp (3 * T ^ 2)) * Real.exp (-k * T ^ 2) := by - gcongr + refine mul_le_mul_of_nonneg_right ?_ (le_of_lt (Real.exp_pos (-k * T ^ 2))) exact saddleGaussianTailWeight_le_two_exp_three_sq T _ = 2 * Real.exp (3 * T ^ 2 + (-k * T ^ 2)) := by @@ -1533,7 +1544,8 @@ private theorem saddleGaussian_cubic_tail_integral_le _ ≤ 2 * Real.exp (-(k / 4) * R ^ 2 + (-(k / 4) * T ^ 2)) := by - gcongr + exact mul_le_mul_of_nonneg_left (Real.exp_monotone hexponent) + zero_le_two _ = c * Real.exp (-(k / 4) * T ^ 2) := by try dsimp [c] rw [Real.exp_add] @@ -1566,7 +1578,7 @@ private theorem saddleExponential_cubic_tail_integral_le Real.exp (-k * |T|)) ≤ 2 * Real.exp (-(k / 4) * R) * (2 / (k / 4)) := by - have hkpos : 0 < k := by linarith + have hkpos : 0 < k := by linear_combination hk have hquarter : 0 < k / 4 := by positivity let c : ℝ := 2 * Real.exp (-(k / 4) * R) have hc : 0 ≤ c := by @@ -1587,16 +1599,18 @@ private theorem saddleExponential_cubic_tail_integral_le have hexponent : 3 * |T| + (-k * |T|) ≤ (-(k / 4) * R) + (-(k / 4) * |T|) := by - linarith [ - mul_nonneg (show 0 ≤ k - 6 by linarith) - hTabs, - mul_nonneg (show 0 ≤ k by linarith) - (show 0 ≤ |T| - R by linarith)] + linarith only [ + mul_nonneg (show 0 ≤ k - 6 by linarith) hTabs, + mul_nonneg (show 0 ≤ k by linarith) (show 0 ≤ |T| - R by linarith), + hk, + hT, + hTabs + ] calc saddleGaussianTailWeight T * Real.exp (-k * |T|) ≤ (2 * Real.exp (3 * |T|)) * Real.exp (-k * |T|) := by - gcongr + refine mul_le_mul_of_nonneg_right ?_ (le_of_lt (Real.exp_pos (-k * |T|))) exact saddleGaussianTailWeight_le_two_exp_three_abs T _ = 2 * Real.exp (3 * |T| + (-k * |T|)) := by @@ -1604,7 +1618,8 @@ private theorem saddleExponential_cubic_tail_integral_le ring _ ≤ 2 * Real.exp (-(k / 4) * R + (-(k / 4) * |T|)) := by - gcongr + exact mul_le_mul_of_nonneg_left (Real.exp_monotone hexponent) + zero_le_two _ = c * Real.exp (-(k / 4) * |T|) := by try dsimp [c] rw [Real.exp_add] @@ -1648,7 +1663,7 @@ private theorem saddleGaussianOuterPhi_le_endpointBarrier c * ℓ * Q * Real.exp (B * δ₀) := by have hδnonneg : 0 ≤ δ := hδ₀.trans hδ have hlog := Real.log_le_sub_one_of_pos - (show 0 < 2 + δ by linarith) + (show 0 < 2 + δ by linear_combination hδ₀ + hδ) have hexpstep : Real.exp (B * δ₀) * (1 + B * (δ - δ₀)) ≤ @@ -1658,7 +1673,7 @@ private theorem saddleGaussianOuterPhi_le_endpointBarrier (1 + B * (δ - δ₀)) ≤ Real.exp (B * δ₀) * Real.exp (B * (δ - δ₀)) := by - gcongr + refine mul_le_mul_of_nonneg_left ?_ (le_of_lt (Real.exp_pos (B * δ₀))) simpa only [add_comm] using! Real.add_one_le_exp (B * (δ - δ₀)) _ = Real.exp (B * δ) := by @@ -1668,7 +1683,7 @@ private theorem saddleGaussianOuterPhi_le_endpointBarrier have hdifference : Real.exp (B * δ₀) * (B * (δ - δ₀)) ≤ Real.exp (B * δ) - Real.exp (B * δ₀) := by - linarith + linear_combination hexpstep have hcoefficient : 0 ≤ c * ℓ * Q := by apply (mul_nonneg_iff_of_pos_right hB).mp exact mul_nonneg @@ -1677,9 +1692,9 @@ private theorem saddleGaussianOuterPhi_le_endpointBarrier mul_le_mul_of_nonneg_left hdifference hcoefficient have hlinearscaled := mul_le_mul_of_nonneg_right hscale - (show 0 ≤ δ - δ₀ by linarith) + (show 0 ≤ δ - δ₀ by linear_combination hδ) unfold saddleGaussianOuterPhi - linarith + linarith only [hlog, hexpscaled, hlinearscaled] private theorem eventually_saddleGaussianOuterPhi_uniform {B Q c δ₀ : ℝ} @@ -1707,7 +1722,7 @@ private theorem eventually_saddleGaussianOuterPhi_uniform Real.exp (A * δ₀ + 4) * (ℓ ^ (1 / 2 : ℝ) * Real.exp (-s * ℓ))) atTop (𝓝 (0 : ℝ)) := by - convert! + convert (tendsto_const_nhds (x := Real.exp (A * δ₀ + 4))).mul hbase using 1; simp only [mul_zero] apply hscaled.congr' @@ -1737,7 +1752,7 @@ private theorem eventually_saddleGaussianOuterPhi_uniform (A / (c * Q * B * Real.exp (B * δ₀)))] with ℓ hℓ apply (div_le_iff₀ hfactor).mp at hℓ - linarith + linear_combination hℓ filter_upwards [eventually_ge_atTop (0 : ℝ), hthreshold, hsmall] with ℓ hℓ hscale hbound intro δ hδ @@ -1751,7 +1766,7 @@ private theorem eventually_saddleGaussianOuterPhi_uniform apply mul_le_mul_of_nonneg_left _ (Real.sqrt_nonneg ℓ) apply Real.exp_le_exp.mpr try dsimp [A, s] - linarith + linear_combination hphi exact hcompare.trans_lt hbound private theorem upperPositiveShellVariance_firstBranch_le @@ -1764,7 +1779,7 @@ private theorem upperPositiveShellVariance_firstBranch_le have hB : 0 ≤ B := by try dsimp [B] positivity - have horder : B ≤ B + 1 := by linarith + have horder : B ≤ B + 1 := by linarith only [] have huabs : |u| ≤ 1 + ε / 2 := by apply (abs_le).mpr constructor <;> linarith @@ -1817,10 +1832,10 @@ private theorem upperFirstBranch_saddleSourceGaussianVariance_upper_bound let η : ℝ := 1 + u have hη : 0 < η := by try dsimp [η] - linarith + linear_combination hulower have hηupper : η ≤ 2 + ε / 2 := by try dsimp [η] - linarith + linear_combination huupper have hgammabound := (upperGammaVariance_bounds hℓ hη).2 have hsmallterm : 1 / (ℓ * η ^ 2) ≤ 1 / η := by @@ -1832,7 +1847,7 @@ private theorem upperFirstBranch_saddleSourceGaussianVariance_upper_bound calc upperGammaVariance ℓ η ≤ 1 / (2 * η) + 1 / (ℓ * η ^ 2) := hgammabound - _ ≤ 1 / (2 * η) + 1 / η := by gcongr + _ ≤ 1 / (2 * η) + 1 / η := by exact add_le_add (le_refl (1 / (2 * η))) hsmallterm _ = (3 / 2 : ℝ) / η := by ring_nf have hshort := upperShortShellVariance_nonneg (δ := u - 1) hε horder hmargin @@ -1850,7 +1865,7 @@ private theorem upperFirstBranch_saddleSourceGaussianVariance_upper_bound try dsimp [η] ring rw [hargument] - linarith + linear_combination hgamma + hshort + hremote calc saddleSourceGaussianVariance ε ℓ u ≤ (3 / 2 : ℝ) / η + @@ -1876,10 +1891,10 @@ private theorem saddle_exp_neg_mul_min_le_add rcases le_total x y with hxy | hyx · rw [min_eq_left hxy, max_eq_left] apply Real.exp_le_exp.mpr - linarith [mul_nonneg ha (sub_nonneg.mpr hxy)] + linarith only [mul_nonneg ha (sub_nonneg.mpr hxy), ha, hxy] · rw [min_eq_right hyx, max_eq_right] apply Real.exp_le_exp.mpr - linarith [mul_nonneg ha (sub_nonneg.mpr hyx)] + linarith only [mul_nonneg ha (sub_nonneg.mpr hyx), ha, hyx] rw [hmax] exact max_le_add_of_nonneg (Real.exp_pos (-a * x)).le (Real.exp_pos (-a * y)).le @@ -1906,7 +1921,7 @@ private theorem saddleSourceNormalizedEnvelope_continuous Complex.ofReal_re, Complex.add_re, Complex.one_re, Complex.ofReal_im, Complex.add_im, Complex.one_im, add_zero, mul_zero, sub_zero, Complex.I_re, zero_mul, Complex.I_im, Complex.mul_im, sub_self] - linarith [mul_pos hℓ (show 0 < 1 + u by linarith)] + linarith only [mul_pos hℓ (show 0 < 1 + u by linarith), hℓ, hu] exact (saddleMellinGamma_differentiableAt_of_re_pos hre).continuousAt.comp_of_eq harg.continuousAt (by rfl) have hregular : Continuous @@ -1957,7 +1972,8 @@ private theorem saddleSourceTailIntegrand_continuous Real.exp (-saddleSourceContourDamping ε ℓ u T)) := by have hweight : Continuous saddleGaussianTailWeight := by unfold saddleGaussianTailWeight - fun_prop + exact Continuous.const_add + (Continuous.comp' (Continuous.fun_pow continuous_id' 3) (Continuous.abs continuous_id')) 1 exact hweight.mul (saddleSourceDampingExponential_continuous hε hℓ hu horder) @@ -1975,7 +1991,7 @@ private theorem saddleSourceContourDamping_firstBranch_min_lower_bound (ε * ℓ / (2 * Real.exp 1)) * min (T ^ 2 / (1 + u)) |T| ≤ saddleSourceContourDamping ε ℓ u T := by - have hη : 0 < 1 + u := by linarith + have hη : 0 < 1 + u := by linear_combination hulower have hgamma := upperGammaDamping_lower_bound hℓ hη T have hfirst := upperFirstBranchSaddleDamping_lower_bound @@ -2008,7 +2024,7 @@ private theorem saddleSource_firstBranch_weighted_integrable let a : ℝ := ε * ℓ / (2 * Real.exp 1) have hη : 0 < η := by try dsimp [η] - linarith + linear_combination hulower have ha : 0 < a := by try dsimp [a] positivity @@ -2053,8 +2069,7 @@ private theorem saddleSource_firstBranch_weighted_integrable -a * (T ^ 2 / η) = -(a / η) * T ^ 2 := by ring rw [hrearrange] at hexp - linarith [mul_le_mul_of_nonneg_left hexp - (saddleGaussianTailWeight_nonneg T)] + linarith only [mul_le_mul_of_nonneg_left hexp (saddleGaussianTailWeight_nonneg T), hexp] private theorem saddleSource_firstBranch_weighted_tail_le {ε ℓ u R : ℝ} @@ -2086,7 +2101,7 @@ private theorem saddleSource_firstBranch_weighted_tail_le let a : ℝ := ε * ℓ / (2 * Real.exp 1) have hη : 0 < η := by try dsimp [η] - linarith + linarith only [hulower] have ha : 0 < a := by try dsimp [a] positivity @@ -2129,8 +2144,7 @@ private theorem saddleSource_firstBranch_weighted_tail_le -a * (T ^ 2 / η) = -(a / η) * T ^ 2 := by ring rw [hrearrange] - linarith [mul_le_mul_of_nonneg_left hexp - (saddleGaussianTailWeight_nonneg T)] + linarith only [mul_le_mul_of_nonneg_left hexp (saddleGaussianTailWeight_nonneg T), hexp] have hcompare := setIntegral_mono_on hsource.integrableOn hmajor.integrableOn (saddleGaussianTailSet_measurable R) hpoint @@ -2167,7 +2181,7 @@ private theorem saddleSource_firstBranch_weighted_tail_le Real.sqrt (Real.pi / (a / η / 4)) + 2 * Real.exp (-(a / 4) * R) * (2 / (a / 4)) := by - gcongr + refine add_le_add ?_ ?_ · apply saddleGaussian_cubic_tail_integral_le · exact hquadratic · exact hR @@ -2192,7 +2206,13 @@ private theorem saddleFirstBranch_normalizedGaussian_prefactor_le 4 * Real.pi * (η * V) / c := by field_simp [hc.ne', hℓ.ne', hη.ne'] _ ≤ 4 * Real.pi * C / c := by - gcongr + exact div_le_div_of_nonneg_right + (mul_le_mul_of_nonneg_left hupper + (le_of_lt + (mul_pos + ((by norm_num)) + Real.pi_pos))) + (le_of_lt hc) _ = 4 * (Real.pi * C / c) := by ring rw [← Real.sqrt_mul (mul_nonneg hℓ.le hV.le)] calc @@ -2242,7 +2262,7 @@ private theorem saddleFirstBranch_normalizedLinear_prefactor_le apply (div_le_div_iff₀ hℓ (mul_pos hℓ hη)).mpr have hscaled := mul_le_mul_of_nonneg_left hupper hℓ.le - linarith + linear_combination hscaled have hidentity : Real.sqrt (ℓ * V) / ℓ = Real.sqrt (V / ℓ) := by calc @@ -2293,7 +2313,7 @@ private theorem saddleSource_firstBranch_normalized_tail_bound let R : ℝ := z / Real.sqrt (ℓ * V) have hη : 0 < η := by try dsimp [η] - linarith + linarith only [hulower] have hc : 0 < c := by try dsimp [c] positivity @@ -2417,8 +2437,7 @@ private theorem saddleSourceFirstBranchVarianceCoefficient_pos have hshell := saddleSourcePositiveShellVariance_nonneg ε (ε / 2) unfold saddleSourceFirstBranchVarianceCoefficient - linarith [mul_nonneg - (show 0 ≤ 2 + ε / 2 by positivity) hshell] + linarith only [mul_nonneg (show 0 ≤ 2 + ε / 2 by positivity) hshell, hε, hshell] private noncomputable def saddleFirstBranchTailLogMajorant (c C ℓ : ℝ) : ℝ := @@ -2450,7 +2469,7 @@ private theorem tendsto_saddleFirstBranchTailLogMajorant -(c / (4 * C)) * (Real.log ℓ / 4) ^ (1 / 6 : ℝ)) atTop atBot := - hpower.const_mul_atTop_of_neg (by linarith) + hpower.const_mul_atTop_of_neg (by linear_combination hrate) have hexp : Tendsto (fun ℓ : ℝ => Real.exp @@ -2466,7 +2485,7 @@ private theorem tendsto_saddleFirstBranchTailLogMajorant (fun ℓ : ℝ => Real.sqrt (C / (Real.log ℓ / 4))) atTop (𝓝 (0 : ℝ)) := by - convert! hratio.sqrt using 1; simp only [Real.sqrt_zero] + convert hratio.sqrt using 1; simp only [Real.sqrt_zero] have hfirst := hexp.const_mul (4 * Real.sqrt (Real.pi * C / c)) have hsecond := hsqrt.const_mul (16 / c) @@ -2548,10 +2567,10 @@ private theorem eventually_saddleSource_firstBranch_uniform_tail : let z : ℝ := (ℓ * η) ^ (1 / 12 : ℝ) have hη : 0 < η := by try dsimp [η] - linarith + linear_combination hulower have hηU : η ≤ U := by try dsimp [η, U] - linarith + linear_combination huupper have hscale : 1 ≤ ℓ * η := hlogoneℓ.trans hlogscale have hV : 0 < V := by @@ -2562,7 +2581,7 @@ private theorem eventually_saddleSource_firstBranch_uniform_tail : 0 ≤ (1 - 10 * ε * (1 + a)) := by intro a ha have h := hmargin a ha - linarith + linear_combination hεsmall + hε + h have hvariance := upperFirstBranch_saddleSourceGaussianVariance_upper_bound hε hℓ hulower huupper horder hmargin' hscale @@ -2575,12 +2594,11 @@ private theorem eventually_saddleSource_firstBranch_uniform_tail : _ = C := by field_simp [hη.ne'] have hlinear : 6 ≤ c * ℓ := by have h := (div_le_iff₀ hc).mp hlinbase - linarith + linear_combination h have hquadratic : 6 ≤ (c * ℓ) / η := by apply (le_div_iff₀ hη).mpr have h := (div_le_iff₀ hc).mp hquadbase - linarith [mul_le_mul_of_nonneg_left hηU - (by norm_num : (0 : ℝ) ≤ 6)] + linarith only [mul_le_mul_of_nonneg_left hηU (by norm_num : (0 : ℝ) ≤ 6), hηU, h] have hz : 0 ≤ z := by try dsimp [z] positivity @@ -2588,8 +2606,8 @@ private theorem eventually_saddleSource_firstBranch_uniform_tail : (z := z) (C := C) hε hεsmall hℓ hulower huupper horder hmargin' hV hC hupper hz (by - convert! hquadratic using 1; dsimp [c, η]; ring) (by - convert! hlinear using 1; dsimp [c]; ring) + convert hquadratic using 1; dsimp [c, η]; ring) (by + convert hlinear using 1; dsimp [c]; ring) have hlognonneg : 0 ≤ Real.log ℓ / 4 := zero_le_one.trans hlogoneℓ have hpower : (Real.log ℓ / 4) ^ (1 / 6 : ℝ) ≤ z ^ 2 := by @@ -2666,7 +2684,7 @@ private theorem eventually_saddleGaussianOuterPhi_uniform_polynomial filter_upwards [hlimit] with ℓ hℓ intro δ hδ have hδnonnegative : 0 ≤ δ := hδ₀.trans hδ - have hη : 0 < 2 + δ := by linarith + have hη : 0 < 2 + δ := by linear_combination hδ₀ + hδ have hpower : (2 + δ) ^ 4 = Real.exp (4 * Real.log (2 + δ)) := by @@ -2736,7 +2754,7 @@ private theorem saddleSourcePositiveShellThirdMoment_nonneg have hB : 0 ≤ (ε⁻¹ ^ 3) := by positivity unfold upperPositiveShellThirdMoment - apply intervalIntegral.integral_nonneg (by linarith) + apply intervalIntegral.integral_nonneg (by linarith only []) intro a ha have ha : 0 ≤ a := hB.trans ha.1 have hdensity : 0 ≤ positiveShellDensity ε a := by @@ -2757,7 +2775,7 @@ private theorem upperPositiveShellThirdMoment_firstBranch_le have hB : 0 ≤ B := by try dsimp [B] positivity - have horder : B ≤ B + 1 := by linarith + have horder : B ≤ B + 1 := by linarith only [] have huabs : |u| ≤ 1 + ε / 2 := by apply (abs_le).mpr constructor <;> linarith @@ -2806,7 +2824,7 @@ private theorem upperGammaVariance_firstBranch_scaled_le (upperGammaVariance_bounds hℓ hη).2 hη.le _ = 1 / 2 + 1 / (ℓ * η) := by field_simp [hℓ.ne', hη.ne'] - _ ≤ (3 / 2 : ℝ) := by linarith + _ ≤ (3 / 2 : ℝ) := by linear_combination hone private theorem upperGammaThirdMoment_firstBranch_scaled_le {ℓ η : ℝ} (hℓ : 0 < ℓ) (hη : 0 < η) @@ -2818,7 +2836,9 @@ private theorem upperGammaThirdMoment_firstBranch_scaled_le have htwo : 2 / (ℓ * η) ≤ (2 : ℝ) := by calc 2 / (ℓ * η) = 2 * (1 / (ℓ * η)) := by ring - _ ≤ 2 * (1 : ℝ) := by gcongr + _ ≤ 2 * (1 : ℝ) := by + exact mul_le_mul_of_nonneg_left hone + zero_le_two _ = 2 := by ring calc η ^ 2 * upperGammaThirdMoment ℓ η ≤ @@ -2829,7 +2849,7 @@ private theorem upperGammaThirdMoment_firstBranch_scaled_le (sq_nonneg η) _ = 1 / 2 + 2 / (ℓ * η) := by field_simp [hℓ.ne', hη.ne'] - _ ≤ (5 / 2 : ℝ) := by linarith + _ ≤ (5 / 2 : ℝ) := by linear_combination htwo private noncomputable def saddleSourceFirstBranchThirdMomentCoefficient (ε : ℝ) : ℝ := @@ -2854,13 +2874,13 @@ private theorem upperFirstBranch_saddleSourceThirdMoment_scaled_le let U : ℝ := 2 + ε / 2 have hη : 0 < η := by try dsimp [η] - linarith + linear_combination hulower have hU : 0 < U := by try dsimp [U] positivity have hηU : η ≤ U := by try dsimp [η, U] - linarith + linear_combination huupper have hA : 0 ≤ (10 * Real.log (1 / ε)) := by have hcut : 0 < (ε ^ 3) := by positivity @@ -2879,7 +2899,7 @@ private theorem upperFirstBranch_saddleSourceThirdMoment_scaled_le upperShortShellVariance ε (u - 1) ≤ upperGammaVariance ℓ η := by try dsimp [η] - linarith [mul_nonneg hε.le hgammanonneg] + linarith only [mul_nonneg hε.le hgammanonneg, hε, hgammanonneg, hshortvariance] have hshortthird := upperShortShellThirdMoment_le (δ := u - 1) hε horder hmargin have hshort : @@ -2897,9 +2917,13 @@ private theorem upperFirstBranch_saddleSourceThirdMoment_scaled_le _ = (10 * Real.log (1 / ε)) * η * (η * upperGammaVariance ℓ η) := by ring _ ≤ (10 * Real.log (1 / ε)) * η * (3 / 2 : ℝ) := by - gcongr + exact mul_le_mul_of_nonneg_left hgamma (mul_nonneg hA (le_of_lt hη)) _ ≤ (10 * Real.log (1 / ε)) * U * (3 / 2 : ℝ) := by - gcongr + exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hηU hA) + (le_of_lt + (div_pos + ((by norm_num)) + (zero_lt_two))) _ = (3 / 2 : ℝ) * (10 * Real.log (1 / ε)) * U := by ring have hremote := @@ -2916,7 +2940,7 @@ private theorem upperFirstBranch_saddleSourceThirdMoment_scaled_le η ^ 2 * upperPositiveShellThirdMoment ε (ε / 2) := mul_le_mul_of_nonneg_left hremote (sq_nonneg η) _ ≤ U ^ 2 * upperPositiveShellThirdMoment ε (ε / 2) := by - gcongr + exact mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (le_of_lt hη) hηU 2) hremote0 unfold saddleSourceFirstBranchThirdMomentCoefficient unfold upperSaddleThirdMoment upperNetShellThirdMoment have hargument : 2 + (u - 1) = η := by @@ -2930,7 +2954,7 @@ private theorem upperFirstBranch_saddleSourceThirdMoment_scaled_le (5 / 2 : ℝ) + (3 / 2 : ℝ) * (10 * Real.log (1 / ε)) * U + U ^ 2 * upperPositiveShellThirdMoment ε (ε / 2) - linarith only [hthirdgamma, hshort, hremoteScaled] + linear_combination hthirdgamma + hshort + hremoteScaled private noncomputable def saddleSourceSecondBranchVarianceFloor (ε : ℝ) : ℝ := (99 / 200 : ℝ) * (ε⁻¹ ^ 3) ^ 2 * @@ -2955,7 +2979,7 @@ private theorem eventually_saddleSourceGaussianVariance_secondBranch_floor : with ε hε hvariance change 0 < ε at hε intro ℓ hℓ δ hδ - have hδ0 : 0 ≤ δ := by linarith + have hδ0 : 0 ≤ δ := by linarith only [hε, hδ] have hB : 0 ≤ (ε⁻¹ ^ 3) := by positivity have hfactor : @@ -2989,17 +3013,25 @@ private theorem eventually_saddleSourceGaussianVariance_secondBranch_floor : (ε⁻¹ ^ 3) ^ 2 * shellWeight ε * Real.exp (δ * (ε⁻¹ ^ 3))) := by - gcongr + exact mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left hmono hfactor) + (le_of_lt + (div_pos + ((by norm_num)) + ((by norm_num)))) _ ≤ (99 / 100 : ℝ) * upperPositiveShellVariance ε δ := by - gcongr - have hη : 0 < 2 + δ := by linarith + exact mul_le_mul_of_nonneg_left hpositive + (le_of_lt + (div_pos + ((by norm_num)) + ((by norm_num)))) + have hη : 0 < 2 + δ := by linarith only [hε, hδ] have hgamma : 0 ≤ 1 / (2 * (2 + δ)) := by positivity unfold saddleSourceGaussianVariance have hargument : 1 + δ - 1 = δ := by ring rw [hargument] - linarith + linear_combination hfull + hfloor + hgamma private theorem saddleSource_cubic_window_le {ℓ V M C z T : ℝ} @@ -3015,7 +3047,11 @@ private theorem saddleSource_cubic_window_le calc (ℓ * M / 6) * |T| ^ 3 ≤ (ℓ * (C * V) / 6) * |T| ^ 3 := by - gcongr + exact mul_le_mul_of_nonneg_right + (div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hM (le_of_lt hℓ)) + (le_of_lt + ((by norm_num)))) + (pow_nonneg (abs_nonneg T) 3) _ ≤ (ℓ * (C * V) / 6) * (z / Real.sqrt (ℓ * V)) ^ 3 := by gcongr @@ -3147,11 +3183,11 @@ private theorem exists_polynomial_uniform_central_window exact mul_nonneg (mul_nonneg (abs_nonneg T) (sub_nonneg.mpr hTunit)) (by positivity) - linarith + linarith only [hfactor] have hscale : 2 * C * R ≤ κ := by have hmin : R ≤ κ / (2 * C) := min_le_right _ _ have hfactor : 0 < 2 * C := by positivity - linarith [(le_div_iff₀ hfactor).mp hmin] + linarith only [(le_div_iff₀ hfactor).mp hmin, hmin, hfactor] calc ‖P ((T : ℂ) + Complex.I * (u : ℂ)) - P (Complex.I * (u : ℂ))‖ ≤ C * (|T| + |T| ^ 3) * ‖P (Complex.I * (u : ℂ))‖ := @@ -3161,7 +3197,7 @@ private theorem exists_polynomial_uniform_central_window calc C * (|T| + |T| ^ 3) ≤ C * (2 * R) := by apply mul_le_mul_of_nonneg_left _ hC.le - linarith + linarith only [hT, hcube] _ = 2 * C * R := by ring _ ≤ κ * ‖P (Complex.I * (u : ℂ))‖ := by exact mul_le_mul_of_nonneg_right hscale (norm_nonneg _) @@ -3239,7 +3275,7 @@ private theorem saddleSource_scaled_cubic_window_le (K / (6 * c * Real.sqrt c)) * (z ^ 3 / Real.sqrt (ℓ * η)) := by have hV : 0 < V := by - nlinarith [hvariance, mul_pos hη hc] + exact pos_of_mul_pos_right (hc.trans_le hvariance) hη.le have hs : 0 < Real.sqrt (ℓ * V) := Real.sqrt_pos.2 (mul_pos hℓ hV) have ht : 0 < Real.sqrt (ℓ * η) := @@ -3250,7 +3286,7 @@ private theorem saddleSource_scaled_cubic_window_le Real.sqrt_pos.2 hc have hm : M ≤ K / η ^ 2 := by apply (le_div_iff₀ (sq_pos_of_pos hη)).2 - linarith + linarith only [hmoment] have hcross : Real.sqrt (ℓ * V) * η = Real.sqrt (ℓ * η) * Real.sqrt (η * V) := by @@ -3292,7 +3328,13 @@ private theorem saddleSource_scaled_cubic_window_le (ℓ * M / 6) * |T| ^ 3 ≤ (ℓ * (K / η ^ 2) / 6) * (z / Real.sqrt (ℓ * V)) ^ 3 := by - gcongr + refine mul_le_mul + (div_le_div_of_nonneg_right + (mul_le_mul_of_nonneg_left hm hℓ.le) (by norm_num)) + (pow_le_pow_left₀ (abs_nonneg T) hT 3) + (pow_nonneg (abs_nonneg T) 3) ?_ + exact div_nonneg + (mul_nonneg hℓ.le (div_nonneg hK (sq_nonneg η))) (by norm_num) _ = (K / 6) * z ^ 3 / (Real.sqrt (ℓ * η) * (Real.sqrt (η * V)) ^ 3) := by @@ -3311,7 +3353,11 @@ private theorem saddleSource_scaled_cubic_window_le _ ≤ (K / 6) * z ^ 3 / (Real.sqrt (ℓ * η) * (Real.sqrt c) ^ 3) := by - gcongr + exact div_le_div_of_nonneg_left + (mul_nonneg (div_nonneg hK (by norm_num)) (pow_nonneg hz 3)) + (mul_pos ht (pow_pos hcroot 3)) + (mul_le_mul_of_nonneg_left + (pow_le_pow_left₀ hcroot.le hwlower 3) ht.le) _ = (K / (6 * c * Real.sqrt c)) * (z ^ 3 / Real.sqrt (ℓ * η)) := by have hcsquare : (Real.sqrt c) ^ 2 = c := @@ -3330,7 +3376,7 @@ private theorem upperFirstBranch_saddleSourceGaussianVariance_scaled_lower_bound (10 * Real.log (1 / ε)), 0 ≤ (1 - 10 * ε * (1 + a))) : 2 * ε ≤ (1 + u) * saddleSourceGaussianVariance ε ℓ u := by - have hη : 0 < 1 + u := by linarith + have hη : 0 < 1 + u := by linear_combination hulower have hgamma := (upperGammaVariance_bounds hℓ hη).1 have hsource := upperFirstBranch_saddleSourceGaussianVariance_lower_bound @@ -3342,10 +3388,16 @@ private theorem upperFirstBranch_saddleSourceGaussianVariance_scaled_lower_bound norm_num _ ≤ (1 + u) * (4 * ε * upperGammaVariance ℓ (1 + u)) := by - gcongr + exact mul_le_mul_of_nonneg_left + (mul_le_mul_of_nonneg_left hgamma + (le_of_lt + (mul_pos + ((by norm_num)) + hε))) + (le_of_lt hη) _ ≤ (1 + u) * saddleSourceGaussianVariance ε ℓ u := by - gcongr + exact mul_le_mul_of_nonneg_left hsource (le_of_lt hη) private theorem saddleSourceFirstBranchThirdMomentCoefficient_pos {ε : ℝ} (hε : 0 < ε) @@ -3376,7 +3428,7 @@ private theorem saddleSourceFirstBranch_cubic_central_window_le (saddleSourceFirstBranchThirdMomentCoefficient ε / (12 * ε * Real.sqrt (2 * ε))) * (ℓ * (1 + u)) ^ (-(1 / 4 : ℝ)) := by - have hη : 0 < 1 + u := by linarith + have hη : 0 < 1 + u := by linear_combination hulower have hx : 0 < ℓ * (1 + u) := mul_pos hℓ hη have hK := saddleSourceFirstBranchThirdMomentCoefficient_pos hε horder @@ -3430,7 +3482,7 @@ private theorem eventually_saddleSourceSecondBranch_cubic_central_window_le : with ε hε horder hfloor hmoment change 0 < ε at hε intro ℓ hℓ δ hδ T hT - have hℓpositive : 0 < ℓ := by linarith + have hℓpositive : 0 < ℓ := by linear_combination hℓ have hfloorpositive := saddleSourceSecondBranchVarianceFloor_pos hε have hvariance := hfloor ℓ hℓpositive δ hδ @@ -3537,7 +3589,9 @@ private theorem saddleSource_scaled_central_radius_le _ = z * Real.sqrt (ℓ * V) * η := by ring _ ≤ U * z / (Real.sqrt (ℓ * η) * Real.sqrt c) := by - gcongr + exact div_le_div₀ (mul_nonneg hU hz) (mul_le_mul_of_nonneg_right hηU hz) + (mul_pos (Real.sqrt_pos_of_pos (mul_pos hℓ hη)) (Real.sqrt_pos_of_pos hc)) + (mul_le_mul_of_nonneg_left hwlower (le_of_lt (Real.sqrt_pos_of_pos (mul_pos hℓ hη)))) _ = (U / Real.sqrt c) * (z / Real.sqrt (ℓ * η)) := by ring @@ -3554,7 +3608,7 @@ private theorem saddleSourceFirstBranch_central_radius_le saddleSourceFirstBranchCentralRadius ε ℓ u ≤ ((2 + ε / 2) / Real.sqrt (2 * ε)) * (ℓ * (1 + u)) ^ (-(5 / 12 : ℝ)) := by - have hη : 0 < 1 + u := by linarith + have hη : 0 < 1 + u := by linear_combination hulower have hx : 0 < ℓ * (1 + u) := mul_pos hℓ hη have hvariance := upperFirstBranch_saddleSourceGaussianVariance_scaled_lower_bound @@ -3564,7 +3618,7 @@ private theorem saddleSourceFirstBranch_central_radius_le (V := saddleSourceGaussianVariance ε ℓ u) (c := 2 * ε) (U := 2 + ε / 2) (z := (ℓ * (1 + u)) ^ (1 / 12 : ℝ)) - hℓ hη (by positivity) (by linarith) + hℓ hη (by positivity) (by linear_combination huupper) (Real.rpow_nonneg hx.le _) hvariance calc saddleSourceFirstBranchCentralRadius ε ℓ u ≤ @@ -3637,14 +3691,14 @@ private theorem eventually_saddleSourceFirstBranch_cubic_window : (10 * Real.log (1 / ε)), 0 ≤ (1 - 10 * ε * (1 + a)) := by intro a ha have h := hmargin a ha - linarith + linear_combination h intro κ hκ let A : ℝ := saddleSourceFirstBranchThirdMomentCoefficient ε / (12 * ε * Real.sqrt (2 * ε)) have htendsto : Tendsto (fun x : ℝ => A * x ^ (-(1 / 4 : ℝ))) atTop (𝓝 (0 : ℝ)) := by - convert! tendsto_const_nhds.mul + convert tendsto_const_nhds.mul (tendsto_rpow_neg_atTop (by norm_num : (0 : ℝ) < 1 / 4)) using 1 all_goals simp only [mul_zero] @@ -3656,9 +3710,9 @@ private theorem eventually_saddleSourceFirstBranch_cubic_window : with ℓ hℓ hlog hlogone intro u hu huupper hstar T hT have hxN : N ≤ ℓ * (1 + u) := by - linarith + linarith only [hlog, hstar] have hxone : 1 ≤ ℓ * (1 + u) := by - linarith + linarith only [hlogone, hstar] have hbound := saddleSourceFirstBranch_cubic_central_window_le hε hεsmall hℓ hu huupper horder hmargin' hxone hT @@ -3686,7 +3740,7 @@ private theorem eventually_saddleSourceSecondBranch_cubic_window : have htendsto : Tendsto (fun ℓ : ℝ => A * ℓ ^ (-(1 / 4 : ℝ))) atTop (𝓝 (0 : ℝ)) := by - convert! tendsto_const_nhds.mul + convert tendsto_const_nhds.mul (tendsto_rpow_neg_atTop (by norm_num : (0 : ℝ) < 1 / 4)) using 1 all_goals simp only [mul_zero] @@ -3720,13 +3774,13 @@ private theorem eventually_saddleSourceFirstBranch_central_radius_lt : (10 * Real.log (1 / ε)), 0 ≤ (1 - 10 * ε * (1 + a)) := by intro a ha have h := hmargin a ha - linarith + linear_combination h intro κ hκ let A : ℝ := (2 + ε / 2) / Real.sqrt (2 * ε) have htendsto : Tendsto (fun x : ℝ => A * x ^ (-(5 / 12 : ℝ))) atTop (𝓝 (0 : ℝ)) := by - convert! tendsto_const_nhds.mul + convert tendsto_const_nhds.mul (tendsto_rpow_neg_atTop (by norm_num : (0 : ℝ) < 5 / 12)) using 1 all_goals simp only [mul_zero] @@ -3737,7 +3791,7 @@ private theorem eventually_saddleSourceFirstBranch_central_radius_lt : with ℓ hℓ hlog intro u hu huupper hstar have hxN : N ≤ ℓ * (1 + u) := by - linarith + linarith only [hlog, hstar] exact (saddleSourceFirstBranch_central_radius_le hε hεsmall hℓ hu huupper horder hmargin').trans_lt (hN (ℓ * (1 + u)) hxN) @@ -3760,7 +3814,7 @@ private theorem eventually_saddleSourceSecondBranch_central_radius_lt : have htendsto : Tendsto (fun ℓ : ℝ => A * ℓ ^ (-(5 / 12 : ℝ))) atTop (𝓝 (0 : ℝ)) := by - convert! tendsto_const_nhds.mul + convert tendsto_const_nhds.mul (tendsto_rpow_neg_atTop (by norm_num : (0 : ℝ) < 5 / 12)) using 1 all_goals simp only [mul_zero] @@ -3781,9 +3835,8 @@ private theorem exists_saddleSource_central_error_tolerance positivity have hquarter : q ≤ (1 / 4 : ℝ) := min_le_left _ _ have hk : q ≤ κ / 8 := min_le_right _ _ - refine ⟨q, hq, by linarith, ?_⟩ - linarith [mul_nonneg hq.le - (sub_nonneg.mpr hquarter)] + refine ⟨q, hq, by linarith only [hq, hquarter], ?_⟩ + linarith only [mul_nonneg hq.le (sub_nonneg.mpr hquarter), hq, hquarter, hk] private theorem eventually_saddleSourceFirstBranch_centralGaussianErrors : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), @@ -3820,7 +3873,7 @@ private theorem eventually_saddleSourceFirstBranch_centralGaussianErrors : (10 * Real.log (1 / ε)), 0 ≤ (1 - 10 * ε * (1 + a)) := by intro a ha have h := hmargin a ha - linarith + linear_combination h intro κ hκ obtain ⟨q, hq, hqone, hfactor⟩ := exists_saddleSource_central_error_tolerance hκ @@ -3837,7 +3890,7 @@ private theorem eventually_saddleSourceFirstBranch_centralGaussianErrors : let R : ℝ := saddleSourceFirstBranchCentralRadius ε ℓ u have hV := hvariance ℓ hℓ u hu huupper have hR : 0 ≤ R := by - have hη : 0 ≤ 1 + u := by linarith + have hη : 0 ≤ 1 + u := by linear_combination hu try dsimp [R, saddleSourceFirstBranchCentralRadius] exact div_nonneg (Real.rpow_nonneg (mul_nonneg hℓ.le hη) _) @@ -3878,7 +3931,7 @@ private theorem eventually_saddleSourceFirstBranch_centralGaussianErrors : hcentral _ < κ * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by - gcongr + exact mul_lt_mul_of_pos_right (mul_lt_mul_of_pos_right hfactor hden) hG · intro huminus have hpoly : ∀ T : ℝ, |T| ≤ R → ‖minusPolynomial ε @@ -3894,7 +3947,7 @@ private theorem eventually_saddleSourceFirstBranch_centralGaussianErrors : have hbound := minusPolynomial_imaginary_norm_ge_three_beta hε huminus - linarith + linarith only [hε, hbound] have hcentral := saddleSourceCenteredMinusIntegrand_centralGaussianError_le hε hℓ hu horder hmargin' hV hR hq.le hqone hq.le @@ -3910,7 +3963,7 @@ private theorem eventually_saddleSourceFirstBranch_centralGaussianErrors : hcentral _ < κ * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by - gcongr + exact mul_lt_mul_of_pos_right (mul_lt_mul_of_pos_right hfactor hden) hG private theorem eventually_saddleSourceSecondBranch_centralGaussianErrors : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), @@ -3955,7 +4008,7 @@ private theorem eventually_saddleSourceSecondBranch_centralGaussianErrors : (10 * Real.log (1 / ε)), 0 ≤ (1 - 10 * ε * (1 + a)) := by intro a ha have h := hmargin a ha - linarith + linear_combination h intro κ hκ obtain ⟨q, hq, hqone, hfactor⟩ := exists_saddleSource_central_error_tolerance hκ @@ -3971,13 +4024,13 @@ private theorem eventually_saddleSourceSecondBranch_centralGaussianErrors : intro δ hδ let u : ℝ := 1 + δ let R : ℝ := saddleSourceSecondBranchCentralRadius ε ℓ u - have hδzero : 0 ≤ δ := by linarith + have hδzero : 0 ≤ δ := by linarith only [hε, hδ] have hu : -1 < u := by try dsimp [u] - linarith + linarith only [hε, hδ] have huminus : 1 + ε / 4 ≤ u := by try dsimp [u] - linarith + linarith only [hε, hδ] have hV : 0 < saddleSourceGaussianVariance ε ℓ u := by try dsimp [u] exact hvariance ℓ hℓ δ hδ @@ -4021,7 +4074,8 @@ private theorem eventually_saddleSourceSecondBranch_centralGaussianErrors : saddleSourceGaussianPlusIntegrand ε ℓ u T)‖ < κ * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) - exact hcentral.trans_lt (by gcongr) + exact hcentral.trans_lt + (mul_lt_mul_of_pos_right (mul_lt_mul_of_pos_right hfactor hden) hG) · have hpoly : ∀ T : ℝ, |T| ≤ R → ‖minusPolynomial ε ((T : ℂ) + Complex.I * (u : ℂ)) - @@ -4036,7 +4090,7 @@ private theorem eventually_saddleSourceSecondBranch_centralGaussianErrors : have hbound := minusPolynomial_imaginary_norm_ge_three_beta hε huminus - linarith + linarith only [hε, hbound] have hcentral := saddleSourceCenteredMinusIntegrand_centralGaussianError_le hε hℓ hu horder hmargin' hV hR hq.le hqone hq.le @@ -4048,7 +4102,8 @@ private theorem eventually_saddleSourceSecondBranch_centralGaussianErrors : saddleSourceGaussianMinusIntegrand ε ℓ u T)‖ < κ * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) - exact hcentral.trans_lt (by gcongr) + exact hcentral.trans_lt + (mul_lt_mul_of_pos_right (mul_lt_mul_of_pos_right hfactor hden) hG) private theorem upperPositiveShellDamping_local_variance_lower {ε ℓ δ T : ℝ} @@ -4060,13 +4115,13 @@ private theorem upperPositiveShellDamping_local_variance_lower have hB : 0 ≤ B := by try dsimp [B] positivity - have hB1 : 0 < B + 1 := by linarith - have horder : B ≤ B + 1 := by linarith + have hB1 : 0 < B + 1 := by linear_combination hB + have horder : B ≤ B + 1 := by linarith only [] have hwindow : (B + 1) * |T| ≤ 1 / 2 := by calc (B + 1) * |T| ≤ (B + 1) * (1 / (2 * (B + 1))) := by - apply mul_le_mul_of_nonneg_left _ (by linarith) + apply mul_le_mul_of_nonneg_left _ (by linear_combination hB) simpa only [one_div, mul_inv_rev, B] using! hT _ = 1 / 2 := by field_simp [hB1.ne'] @@ -4074,7 +4129,7 @@ private theorem upperPositiveShellDamping_local_variance_lower positiveShellDensity_continuous ε have hcosh : Continuous (fun a : ℝ => Real.cosh ((1 + δ) * a)) := by - fun_prop + exact Continuous.comp' Real.continuous_cosh (Continuous.const_mul continuous_id' (1 + δ)) have hosc : Continuous (fun a : ℝ => 1 - Real.cos (a * T)) := by fun_prop @@ -4163,10 +4218,10 @@ private theorem upperGammaVarianceDensity_laplace_linear_lower positivity have hden : 0 < 1 - Real.exp (-x) := by have h := Real.exp_lt_one_iff.mpr - (show -x < 0 by linarith) - linarith + (show -x < 0 by linear_combination hx) + linear_combination h have hdenone : 1 - Real.exp (-x) ≤ 1 := by - linarith [Real.exp_pos (-x)] + linarith only [Real.exp_pos (-x)] have hinv : 1 ≤ (1 - Real.exp (-x))⁻¹ := by rw [inv_eq_one_div] apply (le_div_iff₀ hden).2 @@ -4206,7 +4261,7 @@ private theorem upperGammaDamping_local_variance_lower calc 1 / (2 * η) = (1 / η) / 2 := by ring _ ≤ 1 / η := by - linarith [inv_pos.mpr hη] + linarith only [inv_pos.mpr hη, hq] have hsubset : Ioc p q ⊆ Ioi (0 : ℝ) := by intro a ha exact hp.trans ha.1 @@ -4223,13 +4278,15 @@ private theorem upperGammaDamping_local_variance_lower intro a ha have ha0 : 0 < a := hp.trans ha.1 have halower : 1 / (2 * η) ≤ a := by - simpa [p] using! ha.1.le + simpa only [p] using! ha.1.le have haupper : a ≤ 1 / η := by - simpa [q] using! ha.2 + simpa only [q] using! ha.2 have hquarter : 1 / (4 * η) ≤ a / 2 := by calc 1 / (4 * η) = (1 / (2 * η)) / 2 := by ring - _ ≤ a / 2 := by gcongr + _ ≤ a / 2 := by + exact div_le_div_of_nonneg_right halower + zero_le_two have heta : η * a ≤ 1 := by calc η * a ≤ η * (1 / η) := @@ -4239,7 +4296,7 @@ private theorem upperGammaDamping_local_variance_lower Real.exp (-η * a) := by rw [← Real.exp_neg] apply Real.exp_le_exp.mpr - linarith + linarith only [heta] have hmoment : (ℓ / 4 + 1 / (4 * η)) * (Real.exp 1)⁻¹ ≤ @@ -4262,7 +4319,7 @@ private theorem upperGammaDamping_local_variance_lower Real.exp (-η * a) := by gcongr _ ≤ a ^ 2 * upperGammaMeasureDensity ℓ η a := by - linarith + linarith only [hgamma, hlinear] have haT : |a * T| ≤ 1 := by rw [abs_mul, abs_of_pos ha0] calc @@ -4327,8 +4384,8 @@ private theorem upperGammaDamping_local_variance_lower _ = ℓ / (2 * η) + 1 / η ^ 2 := by field_simp [hℓ.ne', hη.ne'] _ ≤ ℓ / η + 1 / η ^ 2 := by - gcongr - linarith + refine add_le_add (div_le_div₀ (le_of_lt hℓ) (le_refl ℓ) hη ?_) (le_refl (1 / η ^ 2)) + linarith only [hη] have hidentity : (q - p) * C = ((ℓ / η + 1 / η ^ 2) / @@ -4343,7 +4400,13 @@ private theorem upperGammaDamping_local_variance_lower ring _ ≤ ((ℓ / η + 1 / η ^ 2) / (32 * Real.exp 1)) * T ^ 2 := by - gcongr + exact mul_le_mul_of_nonneg_right + (div_le_div_of_nonneg_right hscaled + (le_of_lt + (mul_pos + ((by norm_num)) + (Real.exp_pos 1)))) + (Even.pow_nonneg (even_two_mul 1) T) _ = (q - p) * C := hidentity.symm _ = ∫ a : ℝ in Ioc p q, C := hconstintegral.symm @@ -4371,9 +4434,9 @@ private theorem eventually_saddleSourceContourDamping_secondBranch_local_coerciv change 0 < ε at hε intro ℓ hℓ δ hδ T hT have hδnonnegative : 0 ≤ δ := by - linarith + linarith only [hε, hδ] have hη : 0 < 2 + δ := by - linarith + linarith only [hε, hδ] have hB : 0 ≤ (ε⁻¹ ^ 3) := by positivity have hhalf : @@ -4381,10 +4444,10 @@ private theorem eventually_saddleSourceContourDamping_secondBranch_local_coerciv have hb : 0 < 2 * ((ε⁻¹ ^ 3) + 1) := by positivity apply (div_le_iff₀ hb).2 - linarith + linear_combination hB have hTgamma : |T| ≤ 2 + δ := by have hsmall := hT.trans hhalf - linarith + linarith only [hε, hδ, hT, hhalf] have hgamma := upperGammaDamping_local_variance_lower hℓ hη hTgamma have hshell := upperPositiveShellDamping_local_variance_lower @@ -4414,7 +4477,7 @@ private theorem eventually_saddleSourceContourDamping_secondBranch_local_coerciv upperGammaVariance ℓ (2 + δ) * T ^ 2 ≤ (ℓ / (32 * Real.exp 1)) * upperGammaVariance ℓ (2 + δ) * T ^ 2 := by - convert! mul_le_mul_of_nonneg_right + convert mul_le_mul_of_nonneg_right hγcoefficient hγbase using 1 <;> ring _ ≤ upperGammaDamping ℓ (2 + δ) T := hgamma have heone : 1 ≤ Real.exp 1 := @@ -4426,7 +4489,7 @@ private theorem eventually_saddleSourceContourDamping_secondBranch_local_coerciv (1 / (100 * Real.exp 1) : ℝ) ≤ 1 / 100 := by apply (div_le_iff₀ (by positivity : (0 : ℝ) < 100 * Real.exp 1)).2 - linarith + linear_combination heone _ ≤ (99 / 100 : ℝ) * (1 / 4) := by norm_num have hsbase : @@ -4443,7 +4506,7 @@ private theorem eventually_saddleSourceContourDamping_secondBranch_local_coerciv (99 / 100 : ℝ) * ((ℓ / 4) * upperPositiveShellVariance ε δ * T ^ 2) := by - convert! mul_le_mul_of_nonneg_right + convert mul_le_mul_of_nonneg_right hscoefficient hsbase using 1 <;> ring _ ≤ (99 / 100 : ℝ) * positiveShellDamping ε ℓ δ T := @@ -4453,7 +4516,7 @@ private theorem eventually_saddleSourceContourDamping_secondBranch_local_coerciv upperGammaVariance ℓ (2 + δ) + upperPositiveShellVariance ε δ := by unfold upperSaddleVariance - linarith [(hnet δ hδ).2] + linarith only [(hnet δ hδ).2, hnet, hδ] have hfactor : 0 ≤ (ℓ / (100 * Real.exp 1)) * T ^ 2 := by positivity @@ -4468,7 +4531,7 @@ private theorem eventually_saddleSourceContourDamping_secondBranch_local_coerciv upperGammaVariance ℓ (2 + δ) * T ^ 2 + (ℓ / (100 * Real.exp 1)) * upperPositiveShellVariance ε δ * T ^ 2 := by - convert! mul_le_mul_of_nonneg_left + convert mul_le_mul_of_nonneg_left hvariance hfactor using 1 <;> ring _ ≤ upperGammaDamping ℓ (2 + δ) T + (99 / 100 : ℝ) * @@ -4493,8 +4556,8 @@ private theorem eventually_saddleSourceContourDamping_secondBranch_min_lower_bou with ε hε hdom change 0 < ε at hε intro ℓ hℓ δ hδ T - have hδ0 : 0 ≤ δ := by linarith - have hη : 0 < 2 + δ := by linarith + have hδ0 : 0 ≤ δ := by linarith only [hε, hδ] + have hη : 0 < 2 + δ := by linarith only [hε, hδ] have hgamma := upperGammaDamping_lower_bound hℓ hη T have hshell : 0 ≤ (99 / 100 : ℝ) * @@ -4502,7 +4565,7 @@ private theorem eventually_saddleSourceContourDamping_secondBranch_min_lower_bou positivity [positiveShellDamping_nonneg (ε := ε) (δ := δ) (T := T) hℓ.le] rw [saddleSourceContourDamping_eq_secondBranch] - linarith [hdom ℓ hℓ δ hδ T] + linarith only [hdom ℓ hℓ δ hδ T, hdom, hℓ, hδ, hgamma, hshell] private theorem eventually_saddleSource_secondBranch_weighted_integrable : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), @@ -4523,14 +4586,14 @@ private theorem eventually_saddleSource_secondBranch_weighted_integrable : intro ℓ hℓ δ hδ let η : ℝ := 2 + δ let a : ℝ := ℓ / (8 * Real.exp 1) - have hδ0 : 0 ≤ δ := by linarith + have hδ0 : 0 ≤ δ := by linarith only [hε, hδ] have hη : 0 < η := by try dsimp [η] - linarith + linarith only [hε, hδ] have ha : 0 < a := by try dsimp [a] positivity - have hu : -1 < 1 + δ := by linarith + have hu : -1 < 1 + δ := by linarith only [hε, hδ] have hgaussian := saddleGaussianTailWeight_mul_gaussian_integrable (div_pos ha hη) @@ -4574,8 +4637,7 @@ private theorem eventually_saddleSource_secondBranch_weighted_integrable : Real.exp (-(a / η) * T ^ 2) + saddleGaussianTailWeight T * Real.exp (-a * |T|) - linarith [mul_le_mul_of_nonneg_left hexp - (saddleGaussianTailWeight_nonneg T)] + linarith only [mul_le_mul_of_nonneg_left hexp (saddleGaussianTailWeight_nonneg T), hexp] private theorem saddleGaussian_weighted_integral_le_rescaled {k : ℝ} (hk : 0 < k) : @@ -4613,7 +4675,7 @@ private theorem saddleGaussian_weighted_integral_le_rescaled have hcube : 0 ≤ |T| ^ 3 := by positivity have hscaled := mul_le_mul_of_nonneg_right hCproduct hcube - linarith + linarith only [hCone, hscaled] have hpoint (T : ℝ) : saddleGaussianTailWeight T * Real.exp (-k * T ^ 2) ≤ @@ -4695,7 +4757,7 @@ private theorem saddleExponential_weighted_integral_le_rescaled have hcube : 0 ≤ |T| ^ 3 := by positivity have hscaled := mul_le_mul_of_nonneg_right hCproduct hcube - linarith + linarith only [hCone, hscaled] have hpoint (T : ℝ) : saddleGaussianTailWeight T * Real.exp (-k * |T|) ≤ @@ -4803,10 +4865,10 @@ private theorem eventually_saddleSource_secondBranch_pointwise_gaussian_plus_out let t₀ : ℝ := saddleSourceSecondBranchLocalFrequency ε let a : ℝ := ℓ / (8 * Real.exp 1) let η : ℝ := 2 + δ - have hδ0 : 0 ≤ δ := by linarith + have hδ0 : 0 ≤ δ := by linarith only [hε, hδ] have hη : 0 < η := by try dsimp [η] - linarith + linarith only [hε, hδ] have ha : 0 < a := by try dsimp [a] positivity @@ -4820,7 +4882,7 @@ private theorem eventually_saddleSource_secondBranch_pointwise_gaussian_plus_out apply (div_le_iff₀ (show (0 : ℝ) < 2 * ((ε⁻¹ ^ 3) + 1) by positivity)).2 - linarith + linarith only [hB] have hw : 0 ≤ saddleGaussianTailWeight T := saddleGaussianTailWeight_nonneg T by_cases hinside : |T| ≤ t₀ @@ -4836,7 +4898,7 @@ private theorem eventually_saddleSource_secondBranch_pointwise_gaussian_plus_out ε ℓ δ * T ^ 2) := by apply Real.exp_le_exp.mpr unfold saddleSourceSecondBranchGaussianRate - linarith + linear_combination hquadratic have hfirst := mul_le_mul_of_nonneg_left hlocalexp hw have houter : 0 ≤ Real.exp @@ -4850,7 +4912,7 @@ private theorem eventually_saddleSource_secondBranch_pointwise_gaussian_plus_out (-saddleSourceSecondBranchGammaLinearRate ℓ * |T|)) := by positivity - linarith + linear_combination hfirst + houter · have houtside : t₀ ≤ |T| := le_of_not_ge hinside have hsquare : t₀ ^ 2 ≤ T ^ 2 := by @@ -4894,7 +4956,7 @@ private theorem eventually_saddleSource_secondBranch_pointwise_gaussian_plus_out rw [saddleSourceContourDamping_eq_secondBranch] have hfull := hdom ℓ hℓ δ hδ T try dsimp [a, η] at hgamma ⊢ - linarith + linear_combination hbarrier + hgamma + hfull have hmin := saddle_exp_neg_mul_min_le_add (a := a) (x := T ^ 2 / η) (y := |T|) ha.le have hexp : @@ -4917,7 +4979,7 @@ private theorem eventually_saddleSource_secondBranch_pointwise_gaussian_plus_out (-(saddleSourceSecondBranchOuterBarrier ε ℓ δ + a * min (T ^ 2 / η) |T|)) := by apply Real.exp_le_exp.mpr - linarith + linear_combination hcombined _ = Real.exp (-saddleSourceSecondBranchOuterBarrier ε ℓ δ) * Real.exp @@ -4950,7 +5012,7 @@ private theorem eventually_saddleSource_secondBranch_pointwise_gaussian_plus_out (-saddleSourceSecondBranchGaussianRate ε ℓ δ * T ^ 2) := by positivity - linarith + linear_combination hweighted + hfirst private theorem eventually_saddleSource_secondBranch_weighted_tail_explicit : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), @@ -4999,8 +5061,8 @@ private theorem eventually_saddleSource_secondBranch_weighted_tail_explicit : let q : ℝ := saddleSourceSecondBranchGammaGaussianRate ℓ δ let a : ℝ := saddleSourceSecondBranchGammaLinearRate ℓ let b : ℝ := saddleSourceSecondBranchOuterBarrier ε ℓ δ - have hδ0 : 0 ≤ δ := by linarith - have hη : 0 < 2 + δ := by linarith + have hδ0 : 0 ≤ δ := by linarith only [hε, hδ] + have hη : 0 < 2 + δ := by linarith only [hε, hδ] have hV := hvariance ℓ hℓ δ hδ have hkpos : 0 < k := by try dsimp [k, saddleSourceSecondBranchGaussianRate] @@ -5294,8 +5356,8 @@ private theorem saddle_sqrt_le_one_add Real.sqrt x ≤ 1 + x := by apply Real.sqrt_le_iff.mpr constructor - · linarith - · linarith [sq_nonneg x] + · linear_combination hx + · linarith only [sq_nonneg x, hx] private theorem saddle_inverse_sqrt_cube_le {q : ℝ} (hq : 0 < q) : @@ -5313,12 +5375,12 @@ private theorem saddle_inverse_sqrt_cube_le have hidentity : ((s ^ 3)⁻¹) ^ 2 = (6 / q) ^ 3 := by field_simp [hq.ne', hs.ne'] - linarith [hcubed] + linarith only [hcubed] have hnonnegative : 0 ≤ (s ^ 3)⁻¹ := by positivity change (s ^ 3)⁻¹ ≤ 1 + (6 / q) ^ 3 rw [← hidentity] - linarith [sq_nonneg ((s ^ 3)⁻¹ - (1 / 2 : ℝ))] + linarith only [sq_nonneg ((s ^ 3)⁻¹ - (1 / 2 : ℝ))] private theorem saddleSecondBranch_gammaWeightedCoefficient_le {q η C : ℝ} @@ -5331,7 +5393,7 @@ private theorem saddleSecondBranch_gammaWeightedCoefficient_le Real.sqrt (Real.pi / (q / 2)) ≤ (2 * (1 + (6 * C) ^ 3) * (1 + 2 * Real.pi * C)) * η ^ 4 := by - have hη0 : 0 ≤ η := by linarith + have hη0 : 0 ≤ η := by linear_combination hη have hηthree : 1 ≤ η ^ 3 := by simpa only [one_pow] using! (pow_le_pow_left₀ @@ -5342,12 +5404,15 @@ private theorem saddleSecondBranch_gammaWeightedCoefficient_le 1 + (6 / q) ^ 3 := by apply max_le · have : 0 ≤ (6 / q) ^ 3 := by positivity - linarith + linear_combination this · exact hinverse have hqscaled : 6 / q ≤ 6 * C * η := by calc 6 / q = 6 * (1 / q) := by ring - _ ≤ 6 * (C * η) := by gcongr + _ ≤ 6 * (C * η) := by + exact mul_le_mul_of_nonneg_left hrate + (le_of_lt + ((by norm_num))) _ = 6 * C * η := by ring have hmaxpoly : max (1 : ℝ) ((Real.sqrt (q / 6) ^ 3)⁻¹) ≤ @@ -5356,11 +5421,18 @@ private theorem saddleSecondBranch_gammaWeightedCoefficient_le max (1 : ℝ) ((Real.sqrt (q / 6) ^ 3)⁻¹) ≤ 1 + (6 / q) ^ 3 := hmax _ ≤ 1 + (6 * C * η) ^ 3 := by - gcongr + exact add_le_add (le_refl 1) + (pow_le_pow_left₀ + (le_of_lt + (div_pos + ((by norm_num)) + hq)) + hqscaled 3) _ ≤ (1 + (6 * C) ^ 3) * η ^ 3 := by - linarith [mul_nonneg - (show 0 ≤ (6 * C) ^ 3 by positivity) - (show 0 ≤ η ^ 3 - 1 by linarith)] + linarith only [ + mul_nonneg (show 0 ≤ (6 * C) ^ 3 by positivity) (show 0 ≤ η ^ 3 - 1 by linarith), + hηthree + ] have hpiscaled : Real.pi / (q / 2) ≤ 2 * Real.pi * C * η := by @@ -5369,7 +5441,11 @@ private theorem saddleSecondBranch_gammaWeightedCoefficient_le (2 * Real.pi) * (1 / q) := by field_simp [hq.ne'] _ ≤ (2 * Real.pi) * (C * η) := by - gcongr + exact mul_le_mul_of_nonneg_left hrate + (le_of_lt + (mul_pos + (zero_lt_two) + Real.pi_pos)) _ = 2 * Real.pi * C * η := by ring have hsqrt : Real.sqrt (Real.pi / (q / 2)) ≤ @@ -5379,9 +5455,9 @@ private theorem saddleSecondBranch_gammaWeightedCoefficient_le 1 + Real.pi / (q / 2) := saddle_sqrt_le_one_add (by positivity) _ ≤ 1 + 2 * Real.pi * C * η := by - linarith + linear_combination hpiscaled _ ≤ (1 + 2 * Real.pi * C) * η := by - linarith + linear_combination hη calc 2 * max (1 : ℝ) ((Real.sqrt (q / 6) ^ 3)⁻¹) * @@ -5412,22 +5488,33 @@ private theorem saddleSecondBranch_linearWeightedCoefficient_le have hbase : 6 / a ≤ 6 * C := by calc 6 / a = 6 * (1 / a) := by ring - _ ≤ 6 * C := by gcongr + _ ≤ 6 * C := by + exact mul_le_mul_of_nonneg_left hrate + (le_of_lt + ((by norm_num))) have hmax : max (1 : ℝ) (((a / 6) ^ 3)⁻¹) ≤ 1 + (6 * C) ^ 3 := by rw [hidentity] apply max_le · have : 0 ≤ (6 * C) ^ 3 := by positivity - linarith + linear_combination this · have hcubes : (6 / a) ^ 3 ≤ (6 * C) ^ 3 := by - gcongr - linarith + exact pow_le_pow_left₀ + (le_of_lt + (div_pos + ((by norm_num)) + ha)) + hbase 3 + linear_combination hcubes have hlinear : 2 / (a / 2) ≤ 4 * C := by calc 2 / (a / 2) = 4 * (1 / a) := by field_simp [ha.ne']; ring - _ ≤ 4 * C := by gcongr + _ ≤ 4 * C := by + exact mul_le_mul_of_nonneg_left hrate + (le_of_lt + ((by norm_num))) calc 2 * max (1 : ℝ) (((a / 6) ^ 3)⁻¹) * (2 / (a / 2)) ≤ @@ -5437,8 +5524,7 @@ private theorem saddleSecondBranch_linearWeightedCoefficient_le have hcoefficient : 0 ≤ 8 * C * (1 + (6 * C) ^ 3) := by positivity - linarith [mul_le_mul_of_nonneg_left - hηfour hcoefficient] + linarith only [mul_le_mul_of_nonneg_left hηfour hcoefficient, hηfour, hcoefficient] private noncomputable def saddleSourceSecondBranchMomentCoefficient : ℝ := let C : ℝ := 8 * Real.exp 1 @@ -5494,9 +5580,12 @@ private theorem saddleSourceSecondBranch_outerMoment_le (Real.exp_pos 1).ne', hηpositive.ne'] _ ≤ C * η := by apply (div_le_iff₀ hℓpositive).2 - linarith [mul_nonneg - (mul_nonneg hC.le hηpositive.le) - (show 0 ≤ ℓ - 1 by linarith)] + linarith only [ + mul_nonneg (mul_nonneg hC.le hηpositive.le) (show 0 ≤ ℓ - 1 by linarith), + hℓ, + hηpositive, + hC + ] have harate : 1 / a ≤ C := by calc 1 / a = C / ℓ := by @@ -5506,8 +5595,7 @@ private theorem saddleSourceSecondBranch_outerMoment_le (Real.exp_pos 1).ne'] _ ≤ C := by apply (div_le_iff₀ hℓpositive).2 - linarith [mul_nonneg hC.le - (show 0 ≤ ℓ - 1 by linarith)] + linarith only [mul_nonneg hC.le (show 0 ≤ ℓ - 1 by linarith), hℓ, hC] have hgamma := saddleSecondBranch_gammaWeightedCoefficient_le hq hη hC hqrate have hlinear := saddleSecondBranch_linearWeightedCoefficient_le @@ -5527,7 +5615,7 @@ private theorem saddleSourceSecondBranch_outerMoment_le (2 * (1 + (6 * C) ^ 3) * (1 + 2 * Real.pi * C) + 8 * C * (1 + (6 * C) ^ 3)) * η ^ 4 - linarith + linear_combination hgamma + hlinear private noncomputable def saddleSourceSecondBranchVarianceCoefficient (ε : ℝ) : ℝ := 2 + ((ε⁻¹ ^ 3) + 1) ^ 2 * shellWeight ε @@ -5551,13 +5639,13 @@ private theorem eventually_saddleSourceGaussianVariance_secondBranch_upper : with ε hε hvariance change 0 < ε at hε intro ℓ hℓ δ hδ - have hℓpositive : 0 < ℓ := by linarith - have hδ0 : 0 ≤ δ := by linarith + have hℓpositive : 0 < ℓ := by linarith only [hℓ] + have hδ0 : 0 ≤ δ := by linarith only [hε, hδ] let η : ℝ := 2 + δ have hηtwo : 2 ≤ η := by try dsimp [η] - linarith - have hη : 0 < η := by linarith + linarith only [hε, hδ] + have hη : 0 < η := by linarith only [hε, hδ] have hB : 0 ≤ (ε⁻¹ ^ 3) := by positivity have hexp : 1 ≤ @@ -5567,15 +5655,15 @@ private theorem eventually_saddleSourceGaussianVariance_secondBranch_upper : have hfirst : 1 / (2 * η) ≤ (1 : ℝ) := by apply (div_le_iff₀ (show 0 < 2 * η by positivity)).2 - linarith + linarith only [hε, hδ] have hden : 0 < ℓ * η ^ 2 := by positivity have hsecond : 1 / (ℓ * η ^ 2) ≤ (1 : ℝ) := by apply (div_le_iff₀ hden).2 have hηsquare : 1 ≤ η ^ 2 := by - linarith [sq_nonneg (η - 1)] + linarith only [sq_nonneg (η - 1), hε, hδ] have hscaled := mul_le_mul_of_nonneg_right hℓ (sq_nonneg η) - linarith + linarith only [hηsquare, hscaled] have hshell := (upperPositiveShellVariance_bounds hε hδ0).2 have hfull := (hvariance ℓ hℓpositive δ hδ).2 @@ -5590,9 +5678,9 @@ private theorem eventually_saddleSourceGaussianVariance_secondBranch_upper : ((ε⁻¹ ^ 3) + 1) ^ 2 * shellWeight ε * Real.exp (((ε⁻¹ ^ 3) + 1) * δ) := by - convert! hshell using 1; ring_nf + convert hshell using 1; ring_nf unfold saddleSourceSecondBranchVarianceCoefficient - linarith + linarith only [hexp, hfirst, hsecond, hsource, hshell'] private theorem eventually_saddleSource_secondBranch_sqrtVariance_le : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), @@ -5613,7 +5701,7 @@ private theorem eventually_saddleSource_secondBranch_sqrtVariance_le : let C : ℝ := saddleSourceSecondBranchVarianceCoefficient ε have hC : 0 < C := saddleSourceSecondBranchVarianceCoefficient_pos ε - have hℓpositive : 0 < ℓ := by linarith + have hℓpositive : 0 < ℓ := by linear_combination hℓ have hsource := hupper ℓ hℓ δ hδ have hscaled := mul_le_mul_of_nonneg_left hsource hℓpositive.le @@ -5662,7 +5750,7 @@ theorem tendsto_saddleSourceSecondBranchLocalTailMajorant : have hexp := Real.tendsto_exp_atBot.comp hnegative have hscaled := hexp.const_mul (2 * Real.sqrt (400 * Real.exp 1 * Real.pi)) - convert! hscaled using 1 + convert hscaled using 1 · funext ℓ congr 2 ring @@ -5741,11 +5829,11 @@ private theorem eventually_saddleSource_secondBranch_uniform_tail : let V : ℝ := saddleSourceGaussianVariance ε ℓ (1 + δ) let z : ℝ := ℓ ^ (1 / 12 : ℝ) let η : ℝ := 2 + δ - have hℓpositive : 0 < ℓ := by linarith - have hδ0 : 0 ≤ δ := by linarith + have hℓpositive : 0 < ℓ := by linear_combination hℓ + have hδ0 : 0 ≤ δ := by linarith only [hε, hδ] have hη : 1 ≤ η := by try dsimp [η] - linarith + linarith only [hε, hδ] have hVfloor : V₀ ≤ V := by try dsimp [V₀, V] exact hfloor ℓ hℓpositive δ hδ @@ -5755,11 +5843,11 @@ private theorem eventually_saddleSource_secondBranch_uniform_tail : positivity have hscale : 600 * Real.exp 1 ≤ ℓ * V₀ := by have h := (div_le_iff₀ hV₀).mp hone - linarith + exact h have hfullscale : 600 * Real.exp 1 ≤ ℓ * V := by have h := mul_le_mul_of_nonneg_left hVfloor hℓpositive.le - linarith + linear_combination hscale + h have hk : 6 ≤ saddleSourceSecondBranchGaussianRate ε ℓ δ := by unfold saddleSourceSecondBranchGaussianRate @@ -5769,8 +5857,8 @@ private theorem eventually_saddleSource_secondBranch_uniform_tail : have hgoal : (6 : ℝ) ≤ (ℓ * V) / (100 * Real.exp 1) := by apply (le_div_iff₀ hden).2 - linarith - convert! hgoal using 1; ring + linear_combination hfullscale + convert hgoal using 1; ring have hsource := htail ℓ hℓpositive δ hδ z hz hk have hpower : z ^ 2 = ℓ ^ (1 / 6 : ℝ) := by try dsimp [z] @@ -5860,7 +5948,7 @@ private theorem eventually_saddleSource_secondBranch_uniform_tail : (-saddleSourceContourDamping ε ℓ (1 + δ) T)) ≤ _ at hsource dsimp only [M] at houterterm - linarith + linear_combination hlocalterm + houterterm + hsource end @@ -5947,7 +6035,7 @@ private theorem saddleGaussian_fullLine_error_le_central_add_tails _ ≤ ‖∫ T : ℝ in s, (F T - G T)‖ + ((∫ T : ℝ in tail, ‖F T‖) + (∫ T : ℝ in tail, ‖G T‖)) := by - gcongr + exact add_le_add (le_refl ‖∫ (T : ℝ) in s, F T - G T‖) htailbound _ = ‖∫ T : ℝ in Icc (-R) R, (F T - G T)‖ + (∫ T : ℝ in saddleGaussianTailSet R, ‖F T‖) + (∫ T : ℝ in saddleGaussianTailSet R, ‖G T‖) := by @@ -5993,12 +6081,12 @@ private theorem saddleSource_scaled_tail_lt_relative_gaussian Real.sqrt (2 * Real.pi) / Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) := by apply (eq_div_iff hs.ne').mpr - linarith + linear_combination hmass have hW : W < κ / Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) := by apply (lt_div_iff₀ hs).mpr - linarith + linear_combination hnormalized calc X ≤ C * A * W := hbound _ < C * A * @@ -6102,7 +6190,7 @@ private theorem exists_saddleSourceCenteredMinusIntegrand_weighted_tail_integral obtain ⟨C, hC, hpoly⟩ := exists_minusPolynomial_uniform_weighted_bound hε exact ⟨C, hC, fun ℓ hℓ u hu v R hweighted => SaddleSign.centeredIntegrand_weighted_tail_integral_le .minus - hε hℓ (by linarith) horder (hpoly u hu) v R hweighted⟩ + hε hℓ (by linarith only [hε, hu]) horder (hpoly u hu) v R hweighted⟩ private theorem SaddleSign.gaussianIntegrand_tail_norm_eq (s : SaddleSign) (ε ℓ u R : ℝ) : @@ -6230,8 +6318,8 @@ private theorem saddleSourceGaussianKernel_normalized_tail_le positivity have hk : 6 ≤ k := by try dsimp [k, V] - linarith - have hkpos : 0 < k := by linarith + linarith only [hlarge] + have hkpos : 0 < k := by linear_combination hk have hR : 0 ≤ R := by try dsimp [R] positivity @@ -6244,12 +6332,11 @@ private theorem saddleSourceGaussianKernel_normalized_tail_le intro T hT have hw : 1 ≤ saddleGaussianTailWeight T := by unfold saddleGaussianTailWeight - linarith [pow_nonneg (abs_nonneg T) 3] + linarith only [pow_nonneg (abs_nonneg T) 3] unfold saddleSourceGaussianKernel change Real.exp (-k * T ^ 2) ≤ saddleGaussianTailWeight T * Real.exp (-k * T ^ 2) - linarith [mul_le_mul_of_nonneg_right hw - (Real.exp_pos (-k * T ^ 2)).le] + linarith only [mul_le_mul_of_nonneg_right hw (Real.exp_pos (-k * T ^ 2)).le, hw] have hcompare := setIntegral_mono_on hgaussian.integrableOn hweighted.integrableOn (saddleGaussianTailSet_measurable R) hpoint @@ -6329,7 +6416,7 @@ private theorem tendsto_saddleSourceGaussianNormalizedTailMajorant : atTop atBot := by have h := hpower.const_mul_atTop_of_neg (by norm_num : -(1 / 8 : ℝ) < 0) - convert! h using 1 + convert h using 1 funext x ring have hexp := Real.tendsto_exp_atBot.comp hnegative @@ -6390,10 +6477,10 @@ private theorem eventually_saddleSource_firstBranch_uniform_gaussian_tail : let z : ℝ := (ℓ * η) ^ (1 / 12 : ℝ) have hη : 0 < η := by try dsimp [η] - linarith + linear_combination hulower have hηupper : η ≤ U := by try dsimp [η, U] - linarith + linear_combination huupper have hV : 0 < V := hvariance ℓ hℓ u hulower huupper have hmargin' : @@ -6401,7 +6488,7 @@ private theorem eventually_saddleSource_firstBranch_uniform_gaussian_tail : 0 ≤ (1 - 10 * ε * (1 + a)) := by intro a ha have h := hmargin a ha - linarith + linear_combination hεsmall + hε + h have hvar := upperFirstBranch_saddleSourceGaussianVariance_scaled_lower_bound hε hεsmall hℓ hulower huupper horder hmargin' @@ -6412,16 +6499,16 @@ private theorem eventually_saddleSource_firstBranch_uniform_gaussian_tail : exact hvar.trans hproduct have hthreshold' : 6 * U ≤ ℓ * ε := by have h := (div_le_iff₀ hε).mp hthreshold - linarith + exact h have hlarge : 12 ≤ ℓ * V := by have hproduct := mul_le_mul_of_nonneg_left hvarupper hℓ.le have hmain : U * 12 ≤ U * (ℓ * V) := by - linarith + linarith only [hthreshold', hproduct] by_contra hnot have hlt : ℓ * V < 12 := lt_of_not_ge hnot have hcontradiction := mul_lt_mul_of_pos_left hlt hU - linarith + linarith only [hthreshold', hproduct, hcontradiction] have hz : 0 ≤ z := by try dsimp [z] exact Real.rpow_nonneg @@ -6490,7 +6577,7 @@ private theorem eventually_saddleSource_secondBranch_uniform_gaussian_tail : have hlarge : 12 ≤ ℓ * V := by have hbase := (div_le_iff₀ hV₀).mp hthreshold calc - 12 ≤ ℓ * V₀ := by linarith + 12 ≤ ℓ * V₀ := by exact hbase _ ≤ ℓ * V := mul_le_mul_of_nonneg_left hVlower hℓ.le have hz : 0 ≤ z := by @@ -6569,7 +6656,7 @@ private theorem eventually_saddleSourceFirstBranch_sourceL1Tails : (10 * Real.log (1 / ε)), 0 ≤ (1 - 10 * ε * (1 + a)) := by intro a ha have h := hmargin a ha - linarith + linear_combination hεsmall + hε + h obtain ⟨Cp, hCp, hplus⟩ := exists_saddleSourceCenteredPlusIntegrand_weighted_tail_integral_bound hε horder @@ -6595,14 +6682,14 @@ private theorem eventually_saddleSourceFirstBranch_sourceL1Tails : saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T)) < κ / Cp := by - simpa [R, V, saddleSourceFirstBranchCentralRadius] using! hp u hu huupper hstar + simpa only [R, V, saddleSourceFirstBranchCentralRadius] using! hp u hu huupper hstar have hmnormal : Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T)) < κ / Cm := by - simpa [R, V, saddleSourceFirstBranchCentralRadius] using! hm u hu huupper hstar + simpa only [R, V, saddleSourceFirstBranchCentralRadius] using! hm u hu huupper hstar constructor · have hden : 0 < ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := @@ -6623,7 +6710,7 @@ private theorem eventually_saddleSourceFirstBranch_sourceL1Tails : (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T))) := by - gcongr + exact mul_le_mul_of_nonneg_left hbound (le_of_lt (Real.sqrt_pos_of_pos (mul_pos hℓ hV))) _ = Cp * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, @@ -6632,7 +6719,7 @@ private theorem eventually_saddleSourceFirstBranch_sourceL1Tails : ring _ < Cp * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (κ / Cp) := by - gcongr + exact mul_lt_mul_of_pos_left hpnormal (mul_pos hCp hden) _ = κ * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := by field_simp [hCp.ne'] · intro huminus @@ -6642,7 +6729,7 @@ private theorem eventually_saddleSourceFirstBranch_sourceL1Tails : have hnorm := minusPolynomial_imaginary_norm_ge_three_beta hε huminus - linarith + linarith only [hε, hnorm] have hbound := hminus ℓ hℓ u huminus v R hweighted change Real.sqrt (ℓ * V) * @@ -6658,7 +6745,7 @@ private theorem eventually_saddleSourceFirstBranch_sourceL1Tails : (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T))) := by - gcongr + exact mul_le_mul_of_nonneg_left hbound (le_of_lt (Real.sqrt_pos_of_pos (mul_pos hℓ hV))) _ = Cm * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, @@ -6667,7 +6754,7 @@ private theorem eventually_saddleSourceFirstBranch_sourceL1Tails : ring _ < Cm * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (κ / Cm) := by - gcongr + exact mul_lt_mul_of_pos_left hmnormal (mul_pos hCm hden) _ = κ * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by field_simp [hCm.ne'] @@ -6706,7 +6793,7 @@ private theorem eventually_saddleSourceFirstBranch_gaussianL1Tails : have hkernel : s * (∫ T : ℝ in saddleGaussianTailSet R, saddleSourceGaussianKernel ε ℓ u T) < κ := by - simpa [s, R, saddleSourceFirstBranchCentralRadius] using! hℓ u hu huupper hstar + simpa only [s, R, saddleSourceFirstBranchCentralRadius] using! hℓ u hu huupper hstar constructor · have hden : 0 < ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := @@ -6717,7 +6804,7 @@ private theorem eventually_saddleSourceFirstBranch_gaussianL1Tails : ‖saddleSourceGaussianPlusIntegrand ε ℓ u T‖) < κ * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ rw [saddleSourceGaussianPlusIntegrand_tail_norm_eq] - linarith [mul_lt_mul_of_pos_left hkernel hden] + linarith only [mul_lt_mul_of_pos_left hkernel hden, hkernel, hden] · intro huminus have hden : 0 < ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by @@ -6725,13 +6812,13 @@ private theorem eventually_saddleSourceFirstBranch_gaussianL1Tails : have hnorm := minusPolynomial_imaginary_norm_ge_three_beta hε huminus - linarith + linarith only [hε, hnorm] change s * (∫ T : ℝ in saddleGaussianTailSet R, ‖saddleSourceGaussianMinusIntegrand ε ℓ u T‖) < κ * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ rw [saddleSourceGaussianMinusIntegrand_tail_norm_eq] - linarith [mul_lt_mul_of_pos_left hkernel hden] + linarith only [mul_lt_mul_of_pos_left hkernel hden, hkernel, hden] private theorem eventually_saddleSourceFirstBranch_fullGaussianErrors : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), @@ -6817,7 +6904,7 @@ private theorem eventually_saddleSourceFirstBranch_fullGaussianErrors : _ < ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by - linarith [mul_pos hden hG] + linarith only [mul_pos hden hG, hG, hden] · intro huminus have hden : 0 < ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by @@ -6825,7 +6912,7 @@ private theorem eventually_saddleSourceFirstBranch_fullGaussianErrors : have hnorm := minusPolynomial_imaginary_norm_ge_three_beta hε huminus - linarith + linarith only [hε, hnorm] have hfull := saddleGaussian_fullLine_error_lt_of_central_and_normalized_tails (ε := ε) (ℓ := ℓ) (u := u) (R := R) @@ -6859,7 +6946,7 @@ private theorem eventually_saddleSourceFirstBranch_fullGaussianErrors : _ < ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by - linarith [mul_pos hden hG] + linarith only [mul_pos hden hG, hG, hden] private theorem eventually_saddleSourceSecondBranch_sourceL1Tails_of_uniform_tail (hweighted : @@ -6935,10 +7022,10 @@ private theorem eventually_saddleSourceSecondBranch_sourceL1Tails_of_uniform_tai let V : ℝ := saddleSourceGaussianVariance ε ℓ u have hu : -1 < u := by try dsimp [u] - linarith + linarith only [hε, hδ] have huminus : 1 + ε / 4 ≤ u := by try dsimp [u] - linarith + linarith only [hε, hδ] have hV : 0 < V := by try dsimp [V, u] exact hvariance ℓ hℓ δ hδ @@ -6978,7 +7065,7 @@ private theorem eventually_saddleSourceSecondBranch_sourceL1Tails_of_uniform_tai (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T))) := by - gcongr + exact mul_le_mul_of_nonneg_left hbound (le_of_lt (Real.sqrt_pos_of_pos (mul_pos hℓ hV))) _ = Cp * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, @@ -6987,7 +7074,7 @@ private theorem eventually_saddleSourceSecondBranch_sourceL1Tails_of_uniform_tai ring _ < Cp * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (κ / Cp) := by - gcongr + exact mul_lt_mul_of_pos_left hpnormal (mul_pos hCp hden) _ = κ * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := by field_simp [hCp.ne'] · have hden : 0 < @@ -6996,7 +7083,7 @@ private theorem eventually_saddleSourceSecondBranch_sourceL1Tails_of_uniform_tai have hnorm := minusPolynomial_imaginary_norm_ge_three_beta hε huminus - linarith + linarith only [hε, hnorm] have hbound := hminus ℓ hℓ u huminus v R hweighted' change Real.sqrt (ℓ * V) * @@ -7012,7 +7099,7 @@ private theorem eventually_saddleSourceSecondBranch_sourceL1Tails_of_uniform_tai (∫ T : ℝ in saddleGaussianTailSet R, saddleGaussianTailWeight T * Real.exp (-saddleSourceContourDamping ε ℓ u T))) := by - gcongr + exact mul_le_mul_of_nonneg_left hbound (le_of_lt (Real.sqrt_pos_of_pos (mul_pos hℓ hV))) _ = Cm * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (Real.sqrt (ℓ * V) * (∫ T : ℝ in saddleGaussianTailSet R, @@ -7021,7 +7108,7 @@ private theorem eventually_saddleSourceSecondBranch_sourceL1Tails_of_uniform_tai ring _ < Cm * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (κ / Cm) := by - gcongr + exact mul_lt_mul_of_pos_left hmnormal (mul_pos hCm hden) _ = κ * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by field_simp [hCm.ne'] @@ -7062,14 +7149,14 @@ private theorem eventually_saddleSourceSecondBranch_gaussianL1Tails : Real.sqrt (ℓ * saddleSourceGaussianVariance ε ℓ u) have hu : -1 < u := by try dsimp [u] - linarith + linarith only [hε, hδ] have huminus : 1 + ε / 4 ≤ u := by try dsimp [u] - linarith + linarith only [hε, hδ] have hkernel : s * (∫ T : ℝ in saddleGaussianTailSet R, saddleSourceGaussianKernel ε ℓ u T) < κ := by - simpa [s, R, u, saddleSourceSecondBranchCentralRadius] using! hℓ δ hδ + simpa only [s, R, u, saddleSourceSecondBranchCentralRadius] using! hℓ δ hδ constructor · have hden : 0 < ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ := @@ -7080,20 +7167,20 @@ private theorem eventually_saddleSourceSecondBranch_gaussianL1Tails : ‖saddleSourceGaussianPlusIntegrand ε ℓ u T‖) < κ * ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ rw [saddleSourceGaussianPlusIntegrand_tail_norm_eq] - linarith [mul_lt_mul_of_pos_left hkernel hden] + linarith only [mul_lt_mul_of_pos_left hkernel hden, hkernel, hden] · have hden : 0 < ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hb := div_pos hε four_pos have hnorm := minusPolynomial_imaginary_norm_ge_three_beta hε huminus - linarith + linarith only [hε, hnorm] change s * (∫ T : ℝ in saddleGaussianTailSet R, ‖saddleSourceGaussianMinusIntegrand ε ℓ u T‖) < κ * ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ rw [saddleSourceGaussianMinusIntegrand_tail_norm_eq] - linarith [mul_lt_mul_of_pos_left hkernel hden] + linarith only [mul_lt_mul_of_pos_left hkernel hden, hkernel, hden] private theorem eventually_saddleSourceSecondBranch_fullGaussianErrors_of_sourceL1 (hsource : @@ -7168,10 +7255,10 @@ private theorem eventually_saddleSourceSecondBranch_fullGaussianErrors_of_source let v : ℝ := saddleSourceStationaryLogRadius ε ℓ u have hu : -1 < u := by try dsimp [u] - linarith + linarith only [hε, hδ] have huminus : 1 + ε / 4 ≤ u := by try dsimp [u] - linarith + linarith only [hε, hδ] have hV : 0 < saddleSourceGaussianVariance ε ℓ u := by try dsimp [u] exact hvariance ℓ hℓ δ hδ @@ -7225,14 +7312,14 @@ private theorem eventually_saddleSourceSecondBranch_fullGaussianErrors_of_source _ < ‖plusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by - linarith [mul_pos hden hG] + linarith only [mul_pos hden hG, hG, hden] · have hden : 0 < ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ := by have hb := div_pos hε four_pos have hnorm := minusPolynomial_imaginary_norm_ge_three_beta hε huminus - linarith + linarith only [hε, hnorm] have hfull := saddleGaussian_fullLine_error_lt_of_central_and_normalized_tails (ε := ε) (ℓ := ℓ) (u := u) (R := R) @@ -7273,7 +7360,7 @@ private theorem eventually_saddleSourceSecondBranch_fullGaussianErrors_of_source _ < ‖minusPolynomial ε (Complex.I * (u : ℂ))‖ * (∫ T : ℝ, saddleSourceGaussianKernel ε ℓ u T) := by - linarith [mul_pos hden hG] + linarith only [mul_pos hden hG, hG, hden] private theorem eventually_saddleSourceSecondBranch_sourceL1Tails : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), @@ -7354,7 +7441,7 @@ private theorem saddleDigamma_eq_complexDigamma_re have hre := congrArg Complex.re h have hn : 0 ≤ (n : ℝ) := Nat.cast_nonneg n simp only [Complex.ofReal_re, Complex.neg_re, Complex.natCast_re] at hre - linarith + linarith only [hx, hre] have hreal : HasDerivAt Real.Gamma (deriv Complex.Gamma (x : ℂ)).re x := by @@ -7378,7 +7465,7 @@ private theorem complexGamma_differentiableOn_positiveHalfPlane : have hnreal : 0 ≤ (n : ℝ) := Nat.cast_nonneg n simp only [Complex.neg_re, Complex.natCast_re] at hre change 0 < z.re at hz - linarith + linarith only [hre, hz] private theorem complexDigamma_continuousOn_positiveHalfPlane : ContinuousOn Complex.digamma @@ -7426,7 +7513,7 @@ private theorem tendsto_saddleDigamma_atTop : Tendsto saddleDigamma atTop atTop := by have h := Real.tendsto_log_atTop.atTop_add tendsto_saddleDigamma_sub_log - convert! h using 1 + convert h using 1 funext x ring @@ -7557,7 +7644,7 @@ private theorem saddleSourceShellDerivative_hasDerivAt Real.cosh (u * a)) u := by have h := saddleSinhShellInterval_hasDerivAt w hw horder u - convert! h using 1 + convert h using 1 · funext v apply intervalIntegral.integral_congr intro a ha @@ -7574,7 +7661,7 @@ private theorem saddleSourceShellDerivative_hasDerivAt congr 2 ring have hremote : (ε⁻¹ ^ 3) ≤ (ε⁻¹ ^ 3) + 1 := by - linarith + linarith only [] have hpositive : HasDerivAt (fun v : ℝ => @@ -7588,7 +7675,7 @@ private theorem saddleSourceShellDerivative_hasDerivAt (positiveShellDensity ε) (positiveShellDensity_continuous ε) hremote u - convert! h using 1 + convert h using 1 · funext v apply intervalIntegral.integral_congr intro a ha @@ -7617,7 +7704,7 @@ private theorem saddleSourceShellDerivative_hasDerivAt ring_nf have hsum := hshort.add hpositive unfold saddleSourceShellDerivative - convert! hsum using 1 + convert hsum using 1 rw [hshortvariance, hpositivevariance] unfold upperNetShellVariance ring @@ -7646,8 +7733,8 @@ private theorem eventually_saddleSourceShellDerivative_monotone_secondBranch : have hmem : u ∈ Ici (1 + ε / 2) := interior_subset hu exact hmem - have hδ : ε / 2 ≤ u - 1 := by linarith - have hδnonneg : 0 ≤ u - 1 := by linarith + have hδ : ε / 2 ≤ u - 1 := by linear_combination hthreshold + have hδnonneg : 0 ≤ u - 1 := by linarith only [hε, hthreshold] have hvariance := (upperPositiveShellVariance_bounds hε hδnonneg).1 have hpositive : 0 ≤ upperPositiveShellVariance ε (u - 1) := by @@ -7657,7 +7744,7 @@ private theorem eventually_saddleSourceShellDerivative_monotone_secondBranch : Real.exp ((u - 1) * (ε⁻¹ ^ 3)) by positivity [shellWeight_pos ε]).trans hvariance have hnetlower := (hnet (u - 1) hδ).1 - linarith + linarith only [hpositive, hnetlower] private theorem saddleLogRadius_continuousOn_Ici {ε : ℝ} (hε : 0 < ε) @@ -7677,7 +7764,7 @@ private theorem saddleLogRadius_continuousOn_Ici try dsimp [g] have hu' : u₀ ≤ u := hu have hupositive : 0 < 1 + u := by - linarith + linarith only [hu₀, hu'] change 0 < ((d : ℝ) / 2) * (1 + u) / 2 positivity have hdigamma : @@ -7716,7 +7803,7 @@ private theorem tendsto_saddleGammaArgument_atTop have hlinear := tendsto_id.const_mul_atTop hslope have h := hlinear.atTop_add (tendsto_const_nhds (x := (d : ℝ) / 4)) - convert! h using 1 + convert h using 1 funext u simp only [id_eq] ring @@ -7757,7 +7844,7 @@ private theorem tendsto_saddleLogRadius_atTop_of_shell_monotone · exact hu rw [saddleLogRadius_eq_digamma_add_shellDerivative] try dsimp [C] - linarith + linear_combination hshell exact tendsto_atTop_mono' atTop hcomparison hbaseline private theorem eventually_tendsto_saddleLogRadius_atTop : @@ -7833,7 +7920,7 @@ private theorem eventually_saddleSmallRadiusStarOrdinate_gt_neg_one : have hdreal : (3 : ℝ) ≤ (d : ℝ) := by exact_mod_cast hd have hdimension : 1 < (d : ℝ) / 2 := by - linarith + linarith only [hdreal] have hlog : 0 < Real.log ((d : ℝ) / 2) := Real.log_pos hdimension have hdenominator : 0 < 4 * ((d : ℝ) / 2) := by @@ -7843,7 +7930,7 @@ private theorem eventually_saddleSmallRadiusStarOrdinate_gt_neg_one : (4 * ((d : ℝ) / 2)) := div_pos hlog hdenominator unfold saddleSmallRadiusStarOrdinate - linarith + linear_combination hratio private theorem eventually_saddleSmallRadiusStar_log_coverage : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), @@ -7879,7 +7966,7 @@ private theorem eventually_saddleSourceRadius_log_coverage : with ε hε hcoverage change 0 < ε at hε intro d hd r hr - have hu₀ : -1 < 1 + ε / 4 := by linarith + have hu₀ : -1 < 1 + ε / 4 := by linarith only [hε] apply hcoverage d hd (1 + ε / 4) hu₀ r exact hr @@ -7924,7 +8011,7 @@ private theorem eventualLowerBound_of_uniform_and_constructive (hlower : UniformAdmissibleLowerBound) (hupper : ConstructivePrimalUpperBound) : EventualLowerBound := by intro c hc - have haux : Real.pi⁻¹ < Real.pi⁻¹ + 1 := by linarith + have haux : Real.pi⁻¹ < Real.pi⁻¹ + 1 := by linarith only [] filter_upwards [hlower c hc, hupper (Real.pi⁻¹ + 1) haux] with d hcost ⟨f, _⟩ unfold normalizedProgram @@ -7940,14 +8027,14 @@ private theorem sharpQuotient_of_eventual_bounds refine tendsto_order.2 ⟨?_, ?_⟩ · intro a ha have hmid : (a + Real.pi⁻¹) / 2 < Real.pi⁻¹ := by - linarith + linarith only [ha] filter_upwards [hlower _ hmid] with d hd - linarith + linarith only [ha, hd] · intro b hb have hmid : Real.pi⁻¹ < (Real.pi⁻¹ + b) / 2 := by - linarith + linarith only [hb] filter_upwards [hupper _ hmid] with d hd - linarith + linarith only [hb, hd] private theorem sharpQuotient_of_uniform_lower_and_constructive_upper (hlower : UniformAdmissibleLowerBound) diff --git a/LeanPool/SpherePacking/MellinAnalysis.lean b/LeanPool/SpherePacking/MellinAnalysis.lean index 694eb7090c..53bcfc0d9e 100644 --- a/LeanPool/SpherePacking/MellinAnalysis.lean +++ b/LeanPool/SpherePacking/MellinAnalysis.lean @@ -9,7 +9,6 @@ module import all LeanPool.SpherePacking.Foundations public import Mathlib.MeasureTheory.Function.L1Space.Integrable public import Mathlib.MeasureTheory.Measure.Haar.OfBasis -import Mathlib.Algebra.Ring.IsFormallyReal import Mathlib.Analysis.Calculus.Taylor import Mathlib.Analysis.Real.Pi.Wallis import Mathlib.Analysis.SumIntegralComparisons @@ -46,7 +45,7 @@ private theorem saddleCauchyPole_symmetric_intervalIntegral_tendsto_pos have hreal : Tendsto (fun T : ℝ => 2 * Real.arctan (T / a)) Filter.atTop (𝓝 Real.pi) := by - convert! (tendsto_const_nhds.mul hatan) using 1 + convert (tendsto_const_nhds.mul hatan) using 1 all_goals ring_nf have hcomplex : Tendsto (fun T : ℝ => @@ -77,7 +76,7 @@ private theorem saddleCauchyPole_symmetric_intervalIntegral_tendsto_neg have hreal : Tendsto (fun T : ℝ => 2 * Real.arctan (T / a)) Filter.atTop (𝓝 (-Real.pi)) := by - convert! (tendsto_const_nhds.mul hatan) using 1 + convert (tendsto_const_nhds.mul hatan) using 1 all_goals ring_nf have hcomplex : Tendsto (fun T : ℝ => @@ -102,7 +101,7 @@ private theorem saddleShiftedCauchyPole_symmetric_intervalIntegral_tendsto_pos ((2 * n : ℕ) : ℂ))⁻¹)) Filter.atTop (𝓝 (Real.pi : ℂ)) := by have hshift : 0 < a + ((2 * n : ℕ) : ℝ) := by - linarith + linear_combination ha have hlimit := saddleCauchyPole_symmetric_intervalIntegral_tendsto_pos hshift @@ -123,7 +122,7 @@ private theorem saddleShiftedCauchyPole_symmetric_intervalIntegral_tendsto_neg ((2 * n : ℕ) : ℂ))⁻¹)) Filter.atTop (𝓝 (-(Real.pi : ℂ))) := by have hshift : a + ((2 * n : ℕ) : ℝ) < 0 := by - linarith + linear_combination ha have hlimit := saddleCauchyPole_symmetric_intervalIntegral_tendsto_neg hshift @@ -361,7 +360,7 @@ private theorem saddleGaussianPoleShiftedSlope_symmetric_intervalIntegral have hre := congrArg Complex.re hzero norm_num [Complex.mul_re] at hre push_cast - linarith + linear_combination hre have hgaussian : IntervalIntegrable (fun t : ℝ => saddleGaussianPoleRepresentative n @@ -606,7 +605,7 @@ private theorem saddleGaussianPole_shiftedLine_ne_zero have hre := congrArg Complex.re hzero norm_num [Complex.mul_re] at hre push_cast - linarith + linear_combination hre private theorem saddleGaussianPoleWeightedCorrection_eq_sub {r : ℝ} (n : ℕ) {z : ℂ} @@ -1454,7 +1453,7 @@ private theorem saddleTaylorContour_mem_halfPlane (N : ℕ) : -(2 * ((N : ℝ) + 1)) < saddleTaylorContour N := by unfold saddleTaylorContour push_cast - linarith + linarith only [] private theorem saddleTaylorContour_ne_pole (N n : ℕ) : saddleTaylorContour N ≠ -((2 * n : ℕ) : ℝ) := by @@ -1691,12 +1690,12 @@ private noncomputable def frullaniKernel (a b x : ℝ) : ℝ := private theorem laplaceKernel_integrable {a : ℝ} (ha : 0 < a) : IntegrableOn (fun x : ℝ => Real.exp (-a * x)) (Ioi 0) := by - exact integrableOn_exp_mul_Ioi (by linarith : -a < 0) 0 + exact integrableOn_exp_mul_Ioi (by linear_combination ha : -a < 0) 0 private theorem integral_laplaceKernel {a : ℝ} (ha : 0 < a) : (∫ x : ℝ in Ioi 0, Real.exp (-a * x)) = a⁻¹ := by simpa only [neg_mul, mul_zero, Real.exp_zero, neg_div_neg_eq, - one_div] using! (integral_exp_mul_Ioi (by linarith : -a < 0) 0) + one_div] using! (integral_exp_mul_Ioi (by linear_combination ha : -a < 0) 0) private theorem intervalIntegral_laplaceKernel {x : ℝ} (hx : x ≠ 0) (a b : ℝ) : @@ -1734,7 +1733,7 @@ private theorem laplaceParameter_integrable {a b : ℝ} · filter_upwards [ae_restrict_mem measurableSet_uIoc] with s hs have hspos : 0 < s := by rw [Set.uIoc_of_le hab] at hs - linarith [hs.1] + linarith only [hs.1, ha, hs] exact laplaceKernel_integrable hspos · have hnonzero : ∀ s ∈ Set.uIcc a b, s ≠ 0 := by @@ -1751,7 +1750,7 @@ private theorem laplaceParameter_integrable {a b : ℝ} filter_upwards [ae_restrict_mem measurableSet_uIoc] with s hs have hspos : 0 < s := by rw [Set.uIoc_of_le hab] at hs - linarith [hs.1] + linarith only [hs.1, ha, hs] symm change (∫ y : ℝ in Ioi 0, ‖Real.exp (-s * y)‖) = s⁻¹ simpa only [Real.norm_eq_abs, abs_of_pos (Real.exp_pos _)] using! @@ -1821,8 +1820,8 @@ private theorem wallisPairKernel_integrable (n : ℕ) : IntegrableOn (wallisPairKernel n) (Ioi 0) := by unfold wallisPairKernel apply Integrable.sub - · exact frullaniKernel_integrable (by positivity) (by linarith) - · exact frullaniKernel_integrable (by positivity) (by linarith) + · exact frullaniKernel_integrable (by positivity) (by linarith only []) + · exact frullaniKernel_integrable (by positivity) (by linarith only []) private noncomputable def wallisPairFactor (n : ℕ) : ℝ := ((2 * (n : ℝ) + 2) / (2 * (n : ℝ) + 1)) * @@ -1833,10 +1832,10 @@ private theorem integral_wallisPairKernel (n : ℕ) : Real.log (wallisPairFactor n) := by unfold wallisPairKernel rw [integral_sub - (frullaniKernel_integrable (by positivity) (by linarith)) - (frullaniKernel_integrable (by positivity) (by linarith)), - integral_frullaniKernel (by positivity) (by linarith), - integral_frullaniKernel (by positivity) (by linarith)] + (frullaniKernel_integrable (by positivity) (by linarith only [])) + (frullaniKernel_integrable (by positivity) (by linarith only [])), + integral_frullaniKernel (by positivity) (by linarith only []), + integral_frullaniKernel (by positivity) (by linarith only [])] unfold wallisPairFactor rw [Real.log_mul (by positivity) (by positivity), Real.log_div (by positivity) (by positivity), @@ -1934,7 +1933,7 @@ private theorem wallisLaplaceKernel_abs_le {x : ℝ} (hx : 0 < x) : unfold wallisLaplaceKernel have hq : 0 < Real.exp (-x) := Real.exp_pos _ have hsub : 1 - Real.exp (-x) ≤ x := by - linarith [Real.add_one_le_exp (-x)] + linarith only [Real.add_one_le_exp (-x)] have hden : 0 < x * (1 + Real.exp (-x)) := by positivity apply (div_le_iff₀ hden).2 have hmul : 0 ≤ x * Real.exp (-x) := @@ -1964,7 +1963,7 @@ private theorem wallisPartialKernel_abs_le (n : ℕ) {x : ℝ} (hx : 0 < x) : have hfactor : 0 ≤ 1 - Real.exp (-(2 * (n : ℝ)) * x) := sub_nonneg.mpr hexp have hfactor_le : 1 - Real.exp (-(2 * (n : ℝ)) * x) ≤ 1 := by - linarith [Real.exp_pos (-(2 * (n : ℝ)) * x)] + linarith only [Real.exp_pos (-(2 * (n : ℝ)) * x)] rw [abs_of_nonneg (mul_nonneg (wallisLaplaceKernel_nonneg hx) hfactor)] exact mul_le_of_le_one_right (wallisLaplaceKernel_nonneg hx) hfactor_le @@ -1978,7 +1977,7 @@ private theorem tendsto_wallisPartialKernel {x : ℝ} (hx : 0 < x) : have hexp : Tendsto (fun n : ℕ => Real.exp (-(2 * (n : ℝ)) * x)) atTop (nhds 0) := by - convert! Real.tendsto_exp_neg_atTop_nhds_zero.comp hlinear using 1 + convert Real.tendsto_exp_neg_atTop_nhds_zero.comp hlinear using 1 funext n congr 1 ring @@ -2045,7 +2044,7 @@ private theorem tendsto_cubic_gaussian_atTop : Tendsto (fun x : ℝ => (x ^ 3 + 1) * Real.exp (-(1 / 8 : ℝ) * x)) atTop (nhds 0) := by - convert! hpoly.add hone using 1 + convert hpoly.add hone using 1 · ext x ring · norm_num @@ -2057,8 +2056,7 @@ private theorem tendsto_cubic_gaussian_atTop : have hxpoly : 0 ≤ x ^ 3 + 1 := by positivity apply mul_le_mul_of_nonneg_left _ hxpoly apply Real.exp_le_exp.mpr - linarith [mul_nonneg (by linarith : 0 ≤ x) - (by linarith : 0 ≤ x - 1)] + linarith only [mul_nonneg (by linarith : 0 ≤ x) (by linarith : 0 ≤ x - 1), hx] private noncomputable def shellRadiusMajorant (ε : ℝ) : ℝ := ((ε⁻¹ ^ 3) + 1) * shellWeight ε * @@ -2082,7 +2080,7 @@ private theorem tendsto_shellRadiusMajorant : apply tendsto_nhdsGT_zero_of_comp_inv_tendsto_atTop have hsmall : Tendsto (fun x : ℝ => x⁻¹ / 4) atTop (nhds 0) := by - convert! tendsto_inv_atTop_zero.div_const (4 : ℝ) using 1; norm_num + convert tendsto_inv_atTop_zero.div_const (4 : ℝ) using 1; norm_num have hexp : Tendsto (fun x : ℝ => Real.exp (x⁻¹ / 4)) atTop (nhds 1) := by simpa only [Real.exp_zero] using! hsmall.rexp @@ -2132,7 +2130,7 @@ private theorem sinh_le_mul_cosh {a : ℝ} (ha : 0 ≤ a) : (show a ∈ Set.Ici 0 from ha) ha try dsimp [f] at h norm_num at h - linarith + exact h private noncomputable def shortShellRadiusIntegrand (ε a : ℝ) : ℝ := shortShellDensity ε a * a * Real.sinh ((1 + ε / 4) * a) @@ -2171,11 +2169,12 @@ private theorem shortMargin_abs_le_exp {ε a : ℝ} rw [abs_of_pos (by norm_num : (0 : ℝ) < 1), abs_of_nonneg hterm] _ ≤ 11 * (1 + a) := by - linarith [mul_le_mul_of_nonneg_right hε1 - (show 0 ≤ 1 + a by linarith)] + linarith only [mul_le_mul_of_nonneg_right hε1 (show 0 ≤ 1 + a by linarith), hε1, ha] _ ≤ 11 * Real.exp a := by - gcongr - linarith [Real.add_one_le_exp a] + refine mul_le_mul_of_nonneg_left ?_ + (le_of_lt + ((by norm_num))) + linarith only [Real.add_one_le_exp a] private theorem shortShellHyperbolicRatio_le {ε a : ℝ} (hε0 : 0 ≤ ε) (hε1 : ε ≤ 1) (ha : 0 ≤ a) : @@ -2191,12 +2190,25 @@ private theorem shortShellHyperbolicRatio_le {ε a : ℝ} exact (div_le_div_iff_of_pos_right (Real.cosh_pos a)).2 (sinh_le_mul_cosh harg) _ ≤ ((5 / 4 : ℝ) * a) * Real.exp ((ε / 4) * a) := by - gcongr - · linarith + refine mul_le_mul (mul_le_mul_of_nonneg_right ?_ ha) ?_ + (le_of_lt (div_pos (Real.cosh_pos ((1 + ε / 4) * a)) (Real.cosh_pos a))) + (mul_nonneg + (le_of_lt + (div_pos + ((by norm_num)) + ((by norm_num)))) + ha) + · linarith only [hε1] · exact cosh_ratio_upper ha hδ _ ≤ ((5 / 4 : ℝ) * a) * Real.exp (a / 4) := by - gcongr - linarith [mul_le_mul_of_nonneg_right hε1 ha] + refine mul_le_mul_of_nonneg_left (Real.exp_monotone ?_) + (mul_nonneg + (le_of_lt + (div_pos + ((by norm_num)) + ((by norm_num)))) + ha) + linarith only [mul_le_mul_of_nonneg_right hε1 ha, hε1, ha] private theorem shortShellRadiusIntegrand_eq_ratio {ε a : ℝ} (ha : a ≠ 0) : shortShellRadiusIntegrand ε a = @@ -2256,10 +2268,11 @@ private theorem shortShellRadiusIntegrand_measurable (ε : ℝ) : fun_prop have hd : Measurable (fun a : ℝ => 2 * a ^ 2 * Real.cosh a) := by - fun_prop + exact Measurable.fun_mul (Measurable.const_mul (Measurable.pow_const measurable_id' 2) 2) + (Measurable.cosh measurable_id') have hs : Measurable (fun a : ℝ => Real.sinh ((1 + ε / 4) * a)) := by - fun_prop + exact Measurable.sinh (Measurable.const_mul measurable_id' (1 + ε / 4)) exact ((hn.div hd).neg.mul measurable_id).mul hs private theorem tendsto_shortCutoff : @@ -2577,6 +2590,7 @@ private theorem radialL1Mass_eq {d : ℕ} (hd : 0 < d) radialSurfaceArea d * ∫ r : ℝ in Ioi 0, r ^ (d - 1) * ‖radialProfile hd g r‖ := by + let : MeasureSpace (EuclideanSpace ℝ (Fin d)) := inferInstance let : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd unfold radialL1Mass calc @@ -2793,6 +2807,7 @@ private theorem integral_re_eq_zero_of_antiFourier {d : ℕ} (hanti : (𝓕 g : TestFunction d) = -g) (hzero : g (0 : Euclidean d) = 0) : (∫ x : Euclidean d, (g x).re) = 0 := by + let : MeasureSpace (EuclideanSpace ℝ (Fin d)) := inferInstance have hfourierzero : ((𝓕 g : TestFunction d) (0 : Euclidean d)) = 0 := by rw [hanti] @@ -2996,7 +3011,7 @@ private theorem radialProfile_mellinConvergent {d : ℕ} (a := s.re + 1) (b := (-2 : ℝ)) (radialProfile_locallyIntegrableOn hd f) (radialProfile_isBigO_rpow_atTop hd f (s.re + 1)) - (by linarith) + (by linarith only []) · simpa only [neg_neg, Real.rpow_ofNat] using! radialProfile_isBigO_rpow_two_zero hd f hf hzero · exact hs @@ -3009,7 +3024,7 @@ private theorem radialProfile_mellin_differentiableAt {d : ℕ} (a := s.re + 1) (b := (-2 : ℝ)) (radialProfile_locallyIntegrableOn hd f) (radialProfile_isBigO_rpow_atTop hd f (s.re + 1)) - (by linarith) + (by linarith only []) · simpa only [neg_neg, Real.rpow_ofNat] using! radialProfile_isBigO_rpow_two_zero hd f hf hzero · exact hs @@ -3026,7 +3041,7 @@ private theorem radialMellinStrip_differentiableAt {d : ℕ} have hs : -2 < (((d : ℂ) / 2 - Complex.I * z).re) := by norm_num - linarith + linear_combination hz change DifferentiableAt ℂ (fun w : ℂ => @@ -3059,7 +3074,7 @@ private theorem radialMellinStrip_diffContOnCl {d : ℕ} closure_Ioo (ne_of_lt (neg_lt_self hhalf))] at hz apply (radialMellinStrip_differentiableAt - hd f hf hzero z (by linarith [hz.1])).differentiableWithinAt + hd f hf hzero z (by linarith only [hz.1, hz])).differentiableWithinAt private noncomputable def normalizedRadialMellinStrip {d : ℕ} (hd : 0 < d) (f : TestFunction d) (R : ℝ) (z : ℂ) : ℂ := @@ -3244,17 +3259,17 @@ private theorem radial_fourier_mellin_regularized_closed {d : ℕ} (radialProfile_mellin_differentiableAt hd (𝓕 f : TestFunction d) (gaussianMellin_fourier_radial hf) hhatZero w - (by linarith [hw.1])).continuousAt.continuousWithinAt + (by linarith only [hw.1, hw])).continuousAt.continuousWithinAt have hprimal : ContinuousOn (fun w : ℂ => mellin (radialProfile hd f) ((d : ℂ) - w)) T := by intro w hw change 0 ≤ w.re ∧ w.re ≤ (d : ℝ) at hw have hinner : ContinuousAt (fun v : ℂ => (d : ℂ) - v) w := by - fun_prop + exact ContinuousAt.fun_sub continuousAt_const (continuousAt_id' w) have hre : -2 < (((d : ℂ) - w).re) := by norm_num - linarith [hw.2] + linarith only [hw.2, hw] exact ((radialProfile_mellin_differentiableAt hd f hf hzero ((d : ℂ) - w) hre).continuousAt.comp @@ -3281,11 +3296,11 @@ private theorem radial_fourier_mellin_regularized_closed {d : ℕ} have hg₁ : Complex.Gamma (w / 2) ≠ 0 := by apply Complex.Gamma_ne_zero_of_re_pos norm_num - linarith [hw.1] + linarith only [hw.1, hw] have hg₂ : Complex.Gamma (((d : ℂ) - w) / 2) ≠ 0 := by apply Complex.Gamma_ne_zero_of_re_pos norm_num - linarith [hw.2] + linarith only [hw.2, hw] try dsimp [L, G] rw [radial_fourier_mellin_strip hd f hf w hw.1 hw.2] field_simp @@ -3330,7 +3345,7 @@ private theorem radial_fourier_mellin_antifourier_boundary {d : ℕ} try dsimp [s] at him norm_num at him apply hy - linarith + exact him have hden : Complex.Gamma (((d : ℂ) - s) / 2) ≠ 0 := by apply Complex.Gamma_ne_zero_of_re_pos try dsimp [s] @@ -3352,7 +3367,7 @@ private theorem radial_fourier_mellin_antifourier_boundary {d : ℕ} mellin (radialProfile hd f) ((d : ℂ) - s)) := by field_simp [hnum, hden] at heq ⊢ linear_combination -heq - convert! hcross using 1 <;> dsimp [s] <;> + convert hcross using 1 <;> dsimp [s] <;> push_cast <;> ring_nf private theorem radial_fourier_mellin_antifourier_boundary_norm {d : ℕ} @@ -3393,7 +3408,7 @@ private theorem radial_fourier_mellin_antifourier_boundary_norm {d : ℕ} (((d : ℝ) / 2 : ℝ) + Complex.I * (y : ℂ) / 2)‖ := by apply (eq_div_iff hden).2 push_cast - convert! hnorm using 1; ring + convert hnorm using 1; ring _ = Real.pi ^ ((d : ℝ) / 2) * (‖Complex.Gamma (-(Complex.I * (y : ℂ)) / 2)‖ / ‖Complex.Gamma @@ -3529,7 +3544,7 @@ private theorem normalizedRadialMellinStrip_bottom_norm_le_gamma {d : ℕ} have him := congrArg Complex.im hn norm_num at him apply hy - linarith + exact him have hdenGamma : Complex.Gamma (((d : ℝ) / 2 : ℝ) + @@ -3640,7 +3655,7 @@ private theorem radialProfile_mellin_uniform_strip_bound {d : ℕ} ‖radialProfile hd f r‖) (Ioi (0 : ℝ)) := by have hre : -2 < ((d : ℂ).re) := by norm_num - linarith [show (0 : ℝ) ≤ (d : ℝ) from Nat.cast_nonneg d] + linarith only [show (0 : ℝ) ≤ (d : ℝ) from Nat.cast_nonneg d] have hconv := radialProfile_mellinConvergent hd f hf hzero (d : ℂ) hre simpa only [Complex.natCast_re] using! @@ -3660,7 +3675,7 @@ private theorem radialProfile_mellin_uniform_strip_bound {d : ℕ} refine ⟨max 0 B, le_max_left _ _, ?_⟩ intro s hs hsd have hconv : MellinConvergent (radialProfile hd f) s := - radialProfile_mellinConvergent hd f hf hzero s (by linarith) + radialProfile_mellinConvergent hd f hf hzero s (by linear_combination hs) have hbound : ‖mellin (radialProfile hd f) s‖ ≤ B := by calc ‖mellin (radialProfile hd f) s‖ ≤ @@ -3681,7 +3696,7 @@ private theorem radialProfile_mellin_uniform_strip_bound {d : ℕ} · calc r ^ (s.re - 1) ≤ r ^ (-(1 : ℝ)) := Real.rpow_le_rpow_of_exponent_ge hr hone - (by linarith) + (by linear_combination hs) _ ≤ r ^ (-(1 : ℝ)) + r ^ ((d : ℝ) - 1) := by exact le_add_of_nonneg_right (Real.rpow_nonneg hr.le _) @@ -3689,7 +3704,7 @@ private theorem radialProfile_mellin_uniform_strip_bound {d : ℕ} calc r ^ (s.re - 1) ≤ r ^ ((d : ℝ) - 1) := Real.rpow_le_rpow_of_exponent_le hlarge - (by linarith) + (by linear_combination hsd) _ ≤ r ^ (-(1 : ℝ)) + r ^ ((d : ℝ) - 1) := by exact le_add_of_nonneg_left (Real.rpow_nonneg hr.le _) @@ -3714,11 +3729,11 @@ private theorem normalizedRadialMellinStrip_uniform_bound {d : ℕ} have hsnonneg : 0 ≤ (((d : ℂ) / 2 - Complex.I * z).re) := by norm_num - linarith + linear_combination hzlower have hsupper : (((d : ℂ) / 2 - Complex.I * z).re) ≤ (d : ℝ) := by norm_num - linarith + linear_combination hzupper have hphase : ((((d : ℂ) / 2 + Complex.I * z) * (Real.log R : ℂ))).re ≤ @@ -3726,10 +3741,10 @@ private theorem normalizedRadialMellinStrip_uniform_bound {d : ℕ} norm_num have hcoefnonneg : 0 ≤ (d : ℝ) / 2 - z.im := by - linarith + linear_combination hzupper have hcoefupper : (d : ℝ) / 2 - z.im ≤ (d : ℝ) := by - linarith + linear_combination hzlower calc ((d : ℝ) / 2 - z.im) * Real.log R ≤ ((d : ℝ) / 2 - z.im) * |Real.log R| := @@ -3951,7 +3966,7 @@ private theorem normalizedRadialLogProfile_weighted_integrable {d : ℕ} let κ : ℝ := (d : ℝ) - a have hκ : -2 < κ := by try dsimp [κ] - linarith + linear_combination ha have hconv : MellinConvergent (radialProfile hd f) (κ : ℂ) := by apply radialProfile_mellinConvergent hd f hf hzero @@ -4069,7 +4084,7 @@ private theorem integrable_fourier_of_integrable_two_derivatives have hquadratic (t : ℝ) : t ^ 2 * ‖(𝓕 g : ℝ → ℂ) t‖ ≤ D / p ^ 2 := by apply (le_div_iff₀ (sq_pos_of_pos hp)).2 - linarith [hsecond t] + linarith only [hsecond t, hsecond] have hmajor : Integrable (fun t : ℝ => (A + D / p ^ 2) * (1 + t ^ 2)⁻¹) := integrable_inv_one_add_sq.const_mul (A + D / p ^ 2) @@ -4080,8 +4095,7 @@ private theorem integrable_fourier_of_integrable_two_derivatives change ‖(𝓕 g : ℝ → ℂ) t‖ ≤ (A + D / p ^ 2) / (1 + t ^ 2) apply (le_div_iff₀ hden).2 - linarith [hzero t, hquadratic t, - norm_nonneg ((𝓕 g : ℝ → ℂ) t)] + linarith only [hzero t, hquadratic t, norm_nonneg ((𝓕 g : ℝ → ℂ) t), hzero, hquadratic] private theorem schwartzRealLine_mellinConvergent_of_re_pos (g : 𝓢(ℝ, ℂ)) (s : ℂ) (hs : 0 < s.re) : @@ -4109,7 +4123,7 @@ private theorem schwartzRealLine_mellinConvergent_of_re_pos simpa only [neg_zero, Real.rpow_zero, norm_one, mul_one] using! hbounded r exact mellinConvergent_of_isBigO_rpow (a := s.re + 1) (b := (0 : ℝ)) hlocal htop - (by linarith) hzero hs + (by linarith only []) hzero hs private noncomputable def schwartzExponentialTilt (g : 𝓢(ℝ, ℂ)) (κ R v : ℝ) : ℂ := @@ -4173,7 +4187,7 @@ private theorem schwartzExponentialTilt_differentiable unfold schwartzExponentialTilt have hexpreal : Differentiable ℝ (fun v : ℝ => Real.exp (κ * v)) := by - fun_prop + exact Differentiable.exp (Differentiable.const_mul differentiable_id κ) have hexp : Differentiable ℝ (fun v : ℝ => (Real.exp (κ * v) : ℂ)) := @@ -4182,7 +4196,7 @@ private theorem schwartzExponentialTilt_differentiable (g.smooth 1).differentiable (by norm_num) have hradius : Differentiable ℝ (fun v : ℝ => R * Real.exp v) := by - fun_prop + exact Differentiable.const_mul (Differentiable.exp differentiable_id) R exact hexp.mul (hg.comp hradius) private theorem schwartzExponentialTilt_deriv @@ -4240,7 +4254,7 @@ private theorem schwartzExponentialTilt_deriv_integrable (SchwartzMap.derivCLM ℂ ℂ) g have hzero := schwartzExponentialTilt_integrable g hκ hR have hone := schwartzExponentialTilt_integrable - g' (show 0 < κ + 1 by linarith) hR + g' (show 0 < κ + 1 by linear_combination hκ) hR have hsum := (hzero.const_mul (κ : ℂ)).add (hone.const_mul (R : ℂ)) @@ -4301,7 +4315,7 @@ private theorem schwartzExponentialTilt_deriv_deriv_integrable schwartzExponentialTilt_deriv_integrable g hκ hR have hone := schwartzExponentialTilt_deriv_integrable - g' (show 0 < κ + 1 by linarith) hR + g' (show 0 < κ + 1 by linear_combination hκ) hR have hsum := (hzero.const_mul (κ : ℂ)).add (hone.const_mul (R : ℂ)) @@ -4358,7 +4372,7 @@ private theorem normalizedRadialLogProfile_weighted_fourier_integrable ((radialSurfaceArea d / radialL1Mass f * R ^ d : ℝ) : ℂ) have hκ : 0 < κ := by try dsimp [κ] - linarith + linear_combination ha have hweight : (fun v : ℝ => (Real.exp (-a * v) : ℂ) * @@ -4443,7 +4457,7 @@ private theorem normalizedRadialMellinStrip_shifted_fourier_inversion try dsimp [W] apply normalizedRadialLogProfile_weighted_integrable hd f hf hreal hzero hR - linarith + linear_combination ha have hFW : Integrable (𝓕 W : ℝ → ℂ) := by try dsimp [W] exact normalizedRadialLogProfile_weighted_fourier_integrable @@ -4522,22 +4536,23 @@ private theorem stripAngle_mem_Ioo {σ : ℝ} 0 < stripAngle σ ∧ stripAngle σ < Real.pi := by unfold stripAngle constructor - · exact div_pos (mul_pos Real.pi_pos (by linarith)) (by norm_num) + · exact div_pos (mul_pos Real.pi_pos (by linear_combination hbelow)) (by norm_num) · calc Real.pi * (1 + σ) / 2 < Real.pi * 2 / 2 := by - gcongr - linarith + refine div_lt_div_of_pos_right (mul_lt_mul_of_pos_left ?_ Real.pi_pos) + (zero_lt_two) + linear_combination habove _ = Real.pi := by ring private theorem stripBottomMass_pos {σ : ℝ} (hσ : σ < 1) : 0 < stripBottomMass σ := by unfold stripBottomMass - linarith + linarith only [hσ] private theorem stripBottomMass_lt_one {σ : ℝ} (hσ : -1 < σ) : stripBottomMass σ < 1 := by unfold stripBottomMass - linarith + linarith only [hσ] private theorem stripPoissonKernel_pos {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) (T : ℝ) : @@ -4551,7 +4566,7 @@ private theorem stripPoissonKernel_pos {σ : ℝ} simpa only [gt_iff_lt, Real.cos_zero] using! h have hden : 0 < Real.cosh (Real.pi * T / 2) - Real.cos (stripAngle σ) := by - linarith [Real.one_le_cosh (Real.pi * T / 2)] + linarith only [Real.one_le_cosh (Real.pi * T / 2), hcos] exact div_pos hsin (mul_pos (by norm_num) hden) end @@ -4609,22 +4624,25 @@ private theorem stripPoissonPrimitive_hasDerivAt {σ : ℝ} have hden : 0 < Real.exp (Real.pi * T / 2) ^ 2 + 1 - 2 * Real.exp (Real.pi * T / 2) * Real.cos (stripAngle σ) := by - linarith [sq_nonneg - (Real.exp (Real.pi * T / 2) - Real.cos (stripAngle σ)), - sq_pos_of_pos hsin] + linarith only [ + sq_nonneg (Real.exp (Real.pi * T / 2) - Real.cos (stripAngle σ)), + sq_pos_of_pos hsin, + hsin, + htrig + ] field_simp [hsin0, hpi, hexp.ne', hden.ne'] - linarith + linarith only [htrig] private theorem stripPoissonPrimitive_zero {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) : stripPoissonPrimitive σ 0 = stripAngle σ / (2 * Real.pi) := by obtain ⟨hangle, hangle'⟩ := stripAngle_mem_Ioo hbelow habove have hhalf : 0 < stripAngle σ / 2 := half_pos hangle - have hhalf' : stripAngle σ / 2 < Real.pi / 2 := by linarith + have hhalf' : stripAngle σ / 2 < Real.pi / 2 := by linarith only [hangle'] have hcos : 0 < Real.cos (stripAngle σ / 2) := - Real.cos_pos_of_mem_Ioo ⟨by linarith [Real.pi_pos], hhalf'⟩ + Real.cos_pos_of_mem_Ioo ⟨by linarith only [Real.pi_pos, hangle, hangle'], hhalf'⟩ have hsin : 0 < Real.sin (stripAngle σ / 2) := - Real.sin_pos_of_pos_of_lt_pi hhalf (by linarith [Real.pi_pos]) + Real.sin_pos_of_pos_of_lt_pi hhalf (by linarith only [Real.pi_pos, hangle, hangle']) have hratio : (1 - Real.cos (stripAngle σ)) / Real.sin (stripAngle σ) = Real.tan (stripAngle σ / 2) := by @@ -4642,7 +4660,7 @@ private theorem stripPoissonPrimitive_zero {σ : ℝ} ring unfold stripPoissonPrimitive simp only [mul_zero, zero_div, Real.exp_zero] - rw [hratio, Real.arctan_tan (by linarith [Real.pi_pos]) hhalf'] + rw [hratio, Real.arctan_tan (by linarith only [Real.pi_pos, hangle, hangle']) hhalf'] ring private theorem stripPoissonPrimitive_tendsto_atTop {σ : ℝ} @@ -4652,7 +4670,7 @@ private theorem stripPoissonPrimitive_tendsto_atTop {σ : ℝ} have hsin : 0 < Real.sin (stripAngle σ) := Real.sin_pos_of_pos_of_lt_pi hangle hangle' have hscale : Tendsto (fun T : ℝ => Real.pi * T / 2) atTop atTop := by - convert! tendsto_id.atTop_mul_const (half_pos Real.pi_pos) using 1 + convert tendsto_id.atTop_mul_const (half_pos Real.pi_pos) using 1 ext T change Real.pi * T / 2 = T * (Real.pi / 2) ring @@ -4678,7 +4696,7 @@ private theorem stripPoissonPrimitive_tendsto_atTop {σ : ℝ} (tendsto_nhds_of_tendsto_nhdsWithin Real.tendsto_arctan_atTop).comp hratio unfold stripPoissonPrimitive - convert! hatan.div_const Real.pi using 1 + convert hatan.div_const Real.pi using 1 field_simp [Real.pi_ne_zero] private theorem stripPoissonKernel_integrableOn_Ioi {σ : ℝ} @@ -4754,7 +4772,7 @@ private theorem stripPoissonKernel_antitone_abs (Real.cosh (Real.pi * x / 2) - Real.cos (stripAngle σ)) := by have hxcosh := Real.one_le_cosh (Real.pi * x / 2) - linarith + linarith only [hcos, hxcosh] have hcosh : Real.cosh (Real.pi * x / 2) ≤ Real.cosh (Real.pi * y / 2) := by @@ -4766,7 +4784,7 @@ private theorem stripPoissonKernel_antitone_abs Real.cos (stripAngle σ)) ≤ 4 * (Real.cosh (Real.pi * y / 2) - Real.cos (stripAngle σ)) := by - linarith + linarith only [hcosh] unfold stripPoissonKernel exact div_le_div_of_nonneg_left hsin.le hxden hden @@ -4809,7 +4827,7 @@ private theorem stripPoissonPrimitive_centered_antitoneOn apply stripPoissonKernel_antitone_abs hbelow habove apply (sq_le_sq₀ (abs_nonneg _) (abs_nonneg _)).mp rw [sq_abs, sq_abs] - linarith [mul_nonneg hxpos hr] + linarith only [mul_nonneg hxpos hr, hr, hxpos] private theorem intervalIntegral_stripPoissonKernel {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) @@ -4835,7 +4853,7 @@ private theorem stripPoissonPrimitive_centered_neg simp_rw [stripPoissonKernel_neg] at hneg rw [intervalIntegral_stripPoissonKernel hbelow habove, intervalIntegral_stripPoissonKernel hbelow habove] at hneg - convert! hneg.symm using 1 + convert hneg.symm using 1 all_goals ring_nf private theorem stripPoissonPrimitive_centered_le @@ -4849,13 +4867,13 @@ private theorem stripPoissonPrimitive_centered_le stripPoissonPrimitive_centered_antitoneOn hbelow habove hr by_cases hs : 0 ≤ s - · convert! hanti (show (0 : ℝ) ∈ Ici 0 by simp only [mem_Ici, Std.le_refl]) + · convert hanti (show (0 : ℝ) ∈ Ici 0 by simp only [mem_Ici, Std.le_refl]) (show s ∈ Ici 0 from hs) hs using 1 all_goals ring_nf - · have hsneg : 0 ≤ -s := by linarith + · have hsneg : 0 ≤ -s := by linarith only [hs] rw [← stripPoissonPrimitive_centered_neg hbelow habove r s] - convert! hanti (show (0 : ℝ) ∈ Ici 0 by simp only [mem_Ici, Std.le_refl]) + convert hanti (show (0 : ℝ) ∈ Ici 0 by simp only [mem_Ici, Std.le_refl]) (show -s ∈ Ici 0 from hsneg) hsneg using 1 all_goals ring_nf @@ -4866,8 +4884,8 @@ private theorem stripPoissonKernel_centered_interval_max ∫ x in Icc (-r) r, stripPoissonKernel σ x := by rw [integral_Icc_eq_integral_Ioc, integral_Icc_eq_integral_Ioc, - ← intervalIntegral.integral_of_le (by linarith : s - r ≤ s + r), - ← intervalIntegral.integral_of_le (by linarith : -r ≤ r), + ← intervalIntegral.integral_of_le (by linarith only [hr] : s - r ≤ s + r), + ← intervalIntegral.integral_of_le (by linarith only [hr] : -r ≤ r), intervalIntegral_stripPoissonKernel hbelow habove, intervalIntegral_stripPoissonKernel hbelow habove] exact stripPoissonPrimitive_centered_le hbelow habove hr s @@ -4894,9 +4912,12 @@ private theorem stripComplexPoissonKernel_re have hden : 0 < Real.exp (Real.pi * T / 2) ^ 2 + 1 - 2 * Real.exp (Real.pi * T / 2) * Real.cos (stripAngle σ) := by - linarith [sq_nonneg - (Real.exp (Real.pi * T / 2) - Real.cos (stripAngle σ)), - sq_pos_of_pos hsin] + linarith only [ + sq_nonneg (Real.exp (Real.pi * T / 2) - Real.cos (stripAngle σ)), + sq_pos_of_pos hsin, + hsin, + htrig + ] unfold stripComplexPoissonKernel stripPoissonKernel rw [Real.cosh_eq, Real.exp_neg] simp only [Complex.div_re, Complex.div_im, Complex.mul_re, Complex.I_re, @@ -4933,7 +4954,7 @@ private theorem stripSchwarzExponential_hasDerivAt (Complex.I * (ℓ : ℂ))).const_mul (Real.pi : ℂ)).div_const (2 * (ℓ : ℂ)) unfold stripSchwarzExponential - convert! haffine.cexp using 1 + convert haffine.cexp using 1 all_goals simp only [id_eq, mul_one] private theorem norm_stripSchwarzExponential (ℓ : ℝ) (z : ℂ) (y : ℝ) : @@ -4977,10 +4998,10 @@ private theorem stripSchwarzAngle_mem_Ioo Real.pi * (z.im + ℓ) / (2 * ℓ) < Real.pi := by change -ℓ < z.im ∧ z.im < ℓ at hz constructor - · exact div_pos (mul_pos Real.pi_pos (by linarith)) + · exact div_pos (mul_pos Real.pi_pos (by linarith only [hz])) (mul_pos (by norm_num) hℓ) · apply (div_lt_iff₀ (mul_pos (by norm_num) hℓ)).2 - linarith [mul_pos Real.pi_pos (show 0 < ℓ - z.im by linarith)] + linarith only [mul_pos Real.pi_pos (show 0 < ℓ - z.im by linarith), hz] /-- The squared distance from `e * (cos θ + i sin θ)` to `1` dominates `sin θ ^ 2`. -/ private theorem sin_sq_le_shifted_normSq {e s c : ℝ} (htrig : s ^ 2 + c ^ 2 = 1) : @@ -5063,11 +5084,11 @@ private theorem stripHolomorphicPoissonKernel_denominator_ne_zero Complex.mul_re, zero_mul, sub_self, add_zero] have hpositive : 0 < Real.pi * (z.im + ℓ) / (2 * ℓ) := by - exact div_pos (mul_pos Real.pi_pos (by linarith)) + exact div_pos (mul_pos Real.pi_pos (by linarith only [hz])) (mul_pos (by norm_num) hℓ) have hless : Real.pi * (z.im + ℓ) / (2 * ℓ) < Real.pi := by apply (div_lt_iff₀ (mul_pos (by norm_num) hℓ)).2 - linarith [mul_pos Real.pi_pos (show 0 < ℓ - z.im by linarith)] + linarith only [mul_pos Real.pi_pos (show 0 < ℓ - z.im by linarith), hz] have hsin := Real.sin_pos_of_pos_of_lt_pi hpositive hless intro hzero have him := congrArg Complex.im hzero @@ -5290,16 +5311,18 @@ private theorem stripRegularizedHolomorphicPoissonKernelDeriv_local_bound positivity have hA : Continuous A := by try dsimp [A] - fun_prop + exact Continuous.comp' Real.continuous_sin + (Continuous.comp' (Continuous.div_const continuous_id' (2 * ℓ)) + (Continuous.const_mul (Continuous.add_const Complex.continuous_im ℓ) Real.pi)) have hstrip : Complex.im ⁻¹' Ioo (-ℓ) ℓ ∈ 𝓝 z := by have him : Continuous (fun w : ℂ => w.im) := by - fun_prop + exact Complex.continuous_im exact (isOpen_Ioo.preimage him).mem_nhds hz have hsinset : A ⁻¹' Ioi (sin0 / 2) ∈ 𝓝 z := by apply (isOpen_Ioi.preimage hA).mem_nhds change sin0 / 2 < sin0 - linarith + linarith only [hsin0] have hCpos : 0 ≤ Cpos := by try dsimp [Cpos] positivity @@ -5319,9 +5342,9 @@ private theorem stripRegularizedHolomorphicPoissonKernelDeriv_local_bound have hreabs := Complex.abs_re_le_norm (w - z) simp only [Complex.sub_re] at hreabs have hreupper : w.re ≤ z.re + 1 := by - linarith [le_abs_self (w.re - z.re)] + linarith only [le_abs_self (w.re - z.re), hdist, hreabs] have hrelower : z.re - 1 ≤ w.re := by - linarith [neg_le_abs (w.re - z.re)] + linarith only [neg_le_abs (w.re - z.re), hdist, hreabs] have hsinw : sin0 / 2 < Real.sin (Real.pi * (w.im + ℓ) / (2 * ℓ)) := by exact hwsin @@ -5345,7 +5368,7 @@ private theorem stripRegularizedHolomorphicPoissonKernelDeriv_local_bound try dsimp [a] ring _ ≤ a * (z.re + 1 - y) := - mul_le_mul_of_nonneg_left (by linarith) ha.le + mul_le_mul_of_nonneg_left (by linear_combination hreupper) ha.le calc ‖stripRegularizedHolomorphicPoissonKernelDeriv ℓ w y‖ ≤ Real.pi * Real.exp (Real.pi * (w.re - y) / (2 * ℓ)) / @@ -5373,7 +5396,7 @@ private theorem stripRegularizedHolomorphicPoissonKernelDeriv_local_bound Cpos * Real.exp ((-a) * y) ≤ (Cpos + Cneg) * Real.exp ((-a) * y) exact mul_le_mul_of_nonneg_right - (by linarith) (Real.exp_pos _).le + (by linear_combination hCneg) (Real.exp_pos _).le · have hnum : Real.pi * Real.exp (-(Real.pi * (w.re - y) / (2 * ℓ))) ≤ Real.pi * Real.exp (-a * (z.re - 1 - y)) := by @@ -5386,7 +5409,7 @@ private theorem stripRegularizedHolomorphicPoissonKernelDeriv_local_bound ring _ ≤ -(a * (z.re - 1 - y)) := by apply neg_le_neg - exact mul_le_mul_of_nonneg_left (by linarith) ha.le + exact mul_le_mul_of_nonneg_left (by linear_combination hrelower) ha.le _ = -a * (z.re - 1 - y) := by ring calc ‖stripRegularizedHolomorphicPoissonKernelDeriv ℓ w y‖ ≤ @@ -5420,7 +5443,7 @@ private theorem stripRegularizedHolomorphicPoissonKernelDeriv_local_bound ring rw [hexp] exact mul_le_mul_of_nonneg_right - (by linarith) (Real.exp_pos _).le + (by linear_combination hCpos) (Real.exp_pos _).le private theorem stripRegularizedHolomorphicPoissonKernel_of_nonneg {ℓ : ℝ} (hℓ : 0 < ℓ) {z : ℂ} @@ -5629,13 +5652,13 @@ private theorem strip_abs_log_le_add_rpow {x : ℝ} (hx : 0 < x) : · rw [abs_of_nonneg (Real.log_nonneg hlarge)] have hlog := Real.log_le_sub_one_of_pos hx have hpower := Real.rpow_pos_of_pos hx (-(1 / 2 : ℝ)) - linarith + linarith only [hlog, hpower] · have hsmall : x ≤ 1 := le_of_not_ge hlarge rw [abs_of_nonpos (Real.log_nonpos hx.le hsmall)] have hpower := Real.rpow_pos_of_pos hx (-(1 / 2 : ℝ)) have hlog := Real.log_le_sub_one_of_pos hpower rw [Real.log_rpow hx] at hlog - linarith + linarith only [hx, hlarge, hlog] private theorem strip_exp_abs_log_integrableOn_Ioi {a : ℝ} (ha : 0 < a) : IntegrableOn @@ -5667,7 +5690,7 @@ private theorem strip_exp_abs_log_integrableOn_Ioi {a : ℝ} (ha : 0 < a) : have hexpcontinuous : ContinuousOn (fun x : ℝ => Real.exp ((-a) * x)) (Ioi (0 : ℝ)) := by - fun_prop + exact ContinuousOn.rexp (ContinuousOn.const_mul (continuousOn_id' (Ioi 0)) (-a)) apply hmajorant.mono' ((hexpcontinuous.mul hlogcontinuous.abs).aestronglyMeasurable measurableSet_Ioi) @@ -5762,9 +5785,9 @@ private theorem abs_sub_eq_two_profileNegativePart (φ : ℝ → ℝ) (v : ℝ) |φ v| - φ v = 2 * profileNegativePart φ v := by unfold profileNegativePart rcases le_total 0 (φ v) with h | h - · rw [abs_of_nonneg h, max_eq_right (by linarith)] + · rw [abs_of_nonneg h, max_eq_right (by linear_combination h)] ring - · rw [abs_of_nonpos h, max_eq_left (by linarith)] + · rw [abs_of_nonpos h, max_eq_left (by linear_combination h)] ring private theorem integral_profileNegativePart_eq_half {φ : ℝ → ℝ} @@ -5786,7 +5809,7 @@ private theorem integral_profileNegativePart_eq_half {φ : ℝ → ℝ} (abs_sub_eq_two_profileNegativePart φ) _ = 2 * ∫ v : ℝ, profileNegativePart φ v := by rw [integral_const_mul] - linarith + linarith only [hsigned, htwice] private theorem profileNegativePart_setIntegral_Iic_eq_integral {φ : ℝ → ℝ} (hsign : ∀ v : ℝ, 0 ≤ v → 0 ≤ φ v) : @@ -5796,7 +5819,7 @@ private theorem profileNegativePart_setIntegral_Iic_eq_integral {φ : ℝ → intro v hv have hvpos : 0 < v := by simpa only [mem_Iic, not_le] using! hv unfold profileNegativePart - exact max_eq_right (by linarith [hsign v hvpos.le]) + exact max_eq_right (by linarith only [hsign v hvpos.le, hsign, hvpos]) private theorem normalizedProfile_negativeHalfline_mass_ge_half {φ : ℝ → ℝ} (hφ : Integrable φ) @@ -5897,7 +5920,7 @@ private theorem no_normalizedProfile_of_fourierInversion_lt_half hφ hmean hmass hsign have hupper := negativeHalfline_le_of_fourierInversion hφ ha Z hinversion - linarith + linarith only [hsmall, hlower, hupper] private theorem no_antiFourierWitness_of_fourierInversion_lt_half {d : ℕ} (hd : 0 < d) {R : ℝ} (hR : 0 < R) @@ -6010,7 +6033,7 @@ private theorem no_antiFourierWitness_of_interiorMellinL1_lt_half mul_pos (sub_pos.mpr hσabove) hℓ have haless : (1 - σ) * ((d : ℝ) / 2) < (d : ℝ) := by - linarith [mul_pos (by linarith : 0 < 1 + σ) hℓ] + linarith only [mul_pos (by linarith : 0 < 1 + σ) hℓ, hσbelow, hℓ] have hheight : (d : ℝ) / 2 - (1 - σ) * ((d : ℝ) / 2) = σ * ((d : ℝ) / 2) := by @@ -6035,7 +6058,7 @@ private theorem lowerGammaBoundaryLog_continuousOn intro m hm have him := congrArg Complex.im hm norm_num at him - exact hS y hy (by linarith) + exact hS y hy (by exact him) have hdenPole (y : ℝ) : ∀ m : ℕ, (ℓ : ℂ) + Complex.I * (y : ℂ) / 2 ≠ -(m : ℂ) := by @@ -6043,7 +6066,7 @@ private theorem lowerGammaBoundaryLog_continuousOn have hre := congrArg Complex.re hm norm_num at hre have hmnonneg : 0 ≤ (m : ℝ) := Nat.cast_nonneg m - linarith + linarith only [hℓ, hre] have hnum : ContinuousOn (fun y : ℝ => Complex.Gamma (-Complex.I * (y : ℂ) / 2)) S := by @@ -6180,7 +6203,7 @@ private theorem integerGammaFactor_ne_zero intro hz have him := congrArg Complex.im hz norm_num at him - exact hy (by linarith) + exact hy (by exact him) private theorem gamma_imaginary_ne_zero {y : ℝ} (hy : y ≠ 0) : Complex.Gamma (Complex.I * (y : ℂ) / 2) ≠ 0 := by @@ -6188,7 +6211,7 @@ private theorem gamma_imaginary_ne_zero {y : ℝ} (hy : y ≠ 0) : intro j hj have him := congrArg Complex.im hj norm_num at him - exact hy (by linarith) + exact hy (by exact him) private theorem norm_gamma_neg_imaginary (y : ℝ) : ‖Complex.Gamma (-Complex.I * (y : ℂ) / 2)‖ = @@ -6242,7 +6265,7 @@ private theorem lowerGammaBoundaryLog_integer private theorem lower_sqrtFactor_ge_abs_half (c y : ℝ) : |y| / 2 ≤ Real.sqrt (c ^ 2 + (y / 2) ^ 2) := by apply (Real.le_sqrt (by positivity) (by positivity)).2 - linarith [sq_nonneg c, sq_abs y] + linarith only [sq_nonneg c, sq_abs y] private theorem lowerGammaBoundaryLog_integer_log_tail (k : ℕ) {R y : ℝ} (hR : 0 < R) (hy : y ≠ 0) : @@ -6282,7 +6305,7 @@ private theorem lowerGammaBoundaryLog_integer_log_tail (Real.sqrt ((j : ℝ) ^ 2 + (y / 2) ^ 2)) ≤ (k : ℝ) * Real.log (Real.pi * R ^ 2) - (k : ℝ) * Real.log (|y| / 2) := by - linarith + linear_combination hsum _ = (k : ℝ) * (Real.log (Real.pi * R ^ 2) - Real.log (|y| / 2)) := by @@ -6297,30 +6320,30 @@ private theorem lower_abs_log_sqrtFactor_le c + y / 2 + |Real.log (y / 2)| := by have ht : 0 < y / 2 := by positivity have hinside : 0 < c ^ 2 + (y / 2) ^ 2 := by - linarith [sq_nonneg c, sq_pos_of_pos ht] + linarith only [sq_nonneg c, sq_pos_of_pos ht, ht] have hsqrt : 0 < Real.sqrt (c ^ 2 + (y / 2) ^ 2) := Real.sqrt_pos.2 hinside have hlower : y / 2 ≤ Real.sqrt (c ^ 2 + (y / 2) ^ 2) := by apply (Real.le_sqrt ht.le hinside.le).2 - linarith [sq_nonneg c] + linarith only [sq_nonneg c] have hupper : Real.sqrt (c ^ 2 + (y / 2) ^ 2) ≤ c + y / 2 := by apply Real.sqrt_le_iff.mpr constructor · positivity - · linarith [mul_nonneg hc ht.le] + · linarith only [mul_nonneg hc ht.le, hc, ht] by_cases hlarge : 1 ≤ Real.sqrt (c ^ 2 + (y / 2) ^ 2) · rw [abs_of_nonneg (Real.log_nonneg hlarge)] have hlog := Real.log_le_sub_one_of_pos hsqrt have habs := abs_nonneg (Real.log (y / 2)) - linarith + linear_combination hupper + hlog + habs · rw [abs_of_nonpos (Real.log_nonpos hsqrt.le (le_of_not_ge hlarge))] have hlog := Real.log_le_log ht hlower have habs := neg_le_abs (Real.log (y / 2)) have hnonneg : 0 ≤ c + y / 2 := by positivity - linarith + linear_combination hsqrt + hupper + hlog + habs private theorem lower_exp_abs_log_div_two_integrableOn_Ioi {a : ℝ} (ha : 0 < a) : @@ -6413,7 +6436,7 @@ private theorem lower_exp_log_sqrtFactor_integrableOn_Ioi apply (Real.sqrt_pos.2 ?_).ne' have ht : 0 < y / 2 := by exact half_pos (mem_Ioi.mp hy) - linarith [sq_nonneg c, sq_pos_of_pos ht] + linarith only [sq_nonneg c, sq_pos_of_pos ht, ht] apply hmajorant.mono' (hcontinuous.aestronglyMeasurable measurableSet_Ioi) filter_upwards [ae_restrict_mem measurableSet_Ioi] with y hy @@ -6756,7 +6779,7 @@ private theorem norm_gamma_imaginary_sq {x : ℝ} (hx : x ≠ 0) : (mul_ne_zero Complex.I_ne_zero (Complex.ofReal_ne_zero.mpr hx)) have hrec : Complex.Gamma (1 - z) = (-z) * Complex.Gamma (-z) := by - convert! Complex.Gamma_add_one (-z) hz using 1; ring_nf + convert Complex.Gamma_add_one (-z) hz using 1; ring_nf have hconjarg : -z = starRingEnd ℂ z := by try dsimp [z] simp only [map_mul, Complex.conj_I, Complex.conj_ofReal] @@ -6823,7 +6846,7 @@ private theorem halfIntegerGammaFactor_ne_zero (j : ℕ) (y : ℝ) : have hre := congrArg Complex.re hz norm_num at hre have hj : 0 ≤ (j : ℝ) := Nat.cast_nonneg j - linarith + linarith only [hre] private theorem lowerGammaBoundaryLog_halfInteger_factorized (k : ℕ) (R : ℝ) {y : ℝ} (hy : y ≠ 0) : @@ -6898,7 +6921,7 @@ private theorem lowerCoth_one_le {x : ℝ} (hx : 0 < x) : unfold lowerCoth apply (le_div_iff₀ hsinh).2 rw [one_mul, Real.sinh_eq, Real.cosh_eq] - linarith [Real.exp_pos (-x)] + linarith only [Real.exp_pos (-x)] private theorem lowerCoth_log_nonneg {x : ℝ} (hx : 0 < x) : 0 ≤ Real.log (lowerCoth x) := @@ -6913,11 +6936,11 @@ private theorem lowerCoth_hasDerivAt {x : ℝ} (hx : 0 < x) : (Real.hasDerivAt_cosh x).div (Real.hasDerivAt_sinh x) hsinh unfold lowerCoth - convert! hderiv using 1 + convert hderiv using 1 rw [div_eq_mul_inv] have hidentity := Real.cosh_sq_sub_sinh_sq x field_simp [hsinh] - linarith + linear_combination hidentity private theorem lowerCoth_antitoneOn : AntitoneOn lowerCoth (Ioi (0 : ℝ)) := by @@ -6942,16 +6965,16 @@ private theorem lowerCoth_log_antitoneOn : private theorem lower_cosh_le_exp {x : ℝ} (hx : 0 ≤ x) : Real.cosh x ≤ Real.exp x := by have hnegative : Real.exp (-x) ≤ Real.exp x := - Real.exp_le_exp.mpr (by linarith) + Real.exp_le_exp.mpr (by linarith only [hx]) rw [Real.cosh_eq] - linarith + linarith only [hnegative] private theorem lower_sinh_le_exp (x : ℝ) : Real.sinh x ≤ Real.exp x := by have hpositive := Real.exp_pos (-x) have hpositive' := Real.exp_pos x rw [Real.sinh_eq] - linarith + linarith only [hpositive, hpositive'] private theorem lower_abs_log_cosh_le {x : ℝ} (hx : 0 ≤ x) : |Real.log (Real.cosh x)| ≤ x := by @@ -6971,12 +6994,12 @@ private theorem lower_abs_log_sinh_le {x : ℝ} (hx : 0 < x) : (lower_sinh_le_exp x) have habs := abs_nonneg (Real.log x) rw [Real.log_exp] at hlog - linarith + linarith only [hlog, habs] · rw [abs_of_nonpos (Real.log_nonpos hsinh.le (le_of_not_ge hlarge))] have hlog := Real.log_le_log hx hlower have habs := neg_le_abs (Real.log x) - linarith + linarith only [hx, hlog, habs] private theorem lower_abs_log_coth_div_le {x : ℝ} (hx : 0 < x) : |Real.log (lowerCoth (Real.pi * x) / x)| ≤ @@ -7013,10 +7036,10 @@ private theorem lower_abs_log_coth_div_le {x : ℝ} (hx : 0 < x) : (Real.log (Real.cosh (Real.pi * x)) - Real.log (Real.sinh (Real.pi * x))) (Real.log x) - linarith + linear_combination hfirst + hsecond _ ≤ 2 * (Real.pi * x) + |Real.log Real.pi| + 2 * |Real.log x| := by - linarith + linear_combination hlogpi + hcoshbound + hsinhbound private theorem lowerCoth_sub_one_eq {x : ℝ} (hx : 0 < x) : @@ -7032,17 +7055,17 @@ private theorem lower_sinh_ge_exp_quarter {x : ℝ} (hx : 1 ≤ x) : Real.exp x / 4 ≤ Real.sinh x := by have hbig : 2 ≤ Real.exp x := by - linarith [Real.add_one_le_exp x] + linarith only [Real.add_one_le_exp x, hx] have hsmall : Real.exp (-x) ≤ 1 := - Real.exp_le_one_iff.mpr (by linarith) + Real.exp_le_one_iff.mpr (by linear_combination hx) rw [Real.sinh_eq] - linarith + linarith only [hbig, hsmall] private theorem lowerCoth_log_le_four_exp_neg_two {x : ℝ} (hx : 1 ≤ x) : Real.log (lowerCoth x) ≤ 4 * Real.exp (-2 * x) := by - have hxpos : 0 < x := by linarith + have hxpos : 0 < x := by linear_combination hx have hsinh : 0 < Real.sinh x := Real.sinh_pos_iff.mpr hxpos calc @@ -7088,8 +7111,8 @@ private theorem lowerCoth_log_small_abs_bound (Real.log (lowerCoth (Real.pi * (|y| / 2)) / (|y| / 2))) have hlogu := le_abs_self (Real.log (|y| / 2)) have hpibound : 2 * (Real.pi * (|y| / 2)) ≤ Real.pi := by - linarith [mul_nonneg Real.pi_pos.le (sub_nonneg.mpr hsmall)] - linarith + linarith only [mul_nonneg Real.pi_pos.le (sub_nonneg.mpr hsmall), hsmall] + linarith only [hloghalf, hbase, hlogdiv, hlogu, hpibound] private theorem lowerCoth_log_abs_integrable : Integrable (fun y : ℝ => @@ -7120,7 +7143,8 @@ private theorem lowerCoth_log_abs_integrable : (hnear.const_mul (Real.exp 1)).add hfar apply hmajor.mono' · have harg : Measurable (fun y : ℝ => Real.pi * |y| / 2) := by - fun_prop + exact Measurable.div_const + (Measurable.const_mul (Continuous.measurable (Continuous.abs continuous_id')) Real.pi) 2 have hcoth : Measurable (fun y : ℝ => lowerCoth (Real.pi * |y| / 2)) := by unfold lowerCoth @@ -7152,7 +7176,7 @@ private theorem lowerCoth_log_abs_integrable : have hfactor : 1 ≤ Real.exp 1 * Real.exp ((-1 : ℝ) * |y|) := by rw [← Real.exp_add] - exact (Real.one_le_exp_iff).2 (by linarith only [hsmall]) + exact (Real.one_le_exp_iff).2 (by linear_combination hsmall) have hpolynonneg : 0 ≤ A + 3 * |Real.log (|y|)| := by positivity have hproduct : @@ -7171,7 +7195,7 @@ private theorem lowerCoth_log_abs_integrable : ring try dsimp [A] at hsmallbound ⊢ try dsimp [A] at hproduct hrewrite - linarith + linear_combination hfar_nonneg + hsmallbound + hproduct · have hylarge : 1 < |y| := lt_of_not_ge hsmall have harg : 1 ≤ Real.pi * |y| / 2 := by linarith [Real.pi_gt_three, @@ -7184,7 +7208,7 @@ private theorem lowerCoth_log_abs_integrable : congr 1 ring rw [hexp] at hbound - linarith + linear_combination hnear_nonneg + hbound private theorem lower_exp_log_coth_div_integrableOn_Ioi {a : ℝ} (ha : 0 < a) : @@ -7254,7 +7278,7 @@ private theorem lower_exp_log_coth_div_integrableOn_Ioi Real.log (lowerCoth (Real.pi * y / 2) / (y / 2))) (Ioi (0 : ℝ)) := by apply ContinuousOn.mul - · fun_prop + · exact ContinuousOn.rexp (ContinuousOn.const_mul (continuousOn_id' (Ioi 0)) (-a)) · exact hargument.log hargument_nonzero apply hmajorant.mono' (hcontinuous.aestronglyMeasurable measurableSet_Ioi) @@ -7264,7 +7288,7 @@ private theorem lower_exp_log_coth_div_integrableOn_Ioi |Real.log (lowerCoth (Real.pi * y / 2) / (y / 2))| ≤ Real.pi * y + |Real.log Real.pi| + 2 * |Real.log (y / 2)| := by - convert! lower_abs_log_coth_div_le (half_pos hypos) using 1 <;> + convert lower_abs_log_coth_div_le (half_pos hypos) using 1 <;> ring_nf change ‖Real.exp ((-a) * y) * @@ -7492,7 +7516,7 @@ private theorem lowerGammaBoundaryLog_halfInteger_log_tail (1 / 2 : ℝ) * (Real.log (lowerCoth (Real.pi * |y| / 2)) - Real.log (|y| / 2)) := by - linarith only [hsum] + linear_combination hsum _ = ((k : ℝ) + 1 / 2) * (Real.log (Real.pi * R ^ 2) - Real.log (|y| / 2)) + @@ -7523,7 +7547,7 @@ private theorem lowerGammaBoundaryLog_dimension_log_tail ring rw [hq] have htail := lowerGammaBoundaryLog_integer_log_tail k hR hy - linarith + linarith only [hcoth, htail] · have hq : ((↑(2 * k + 1) : ℝ) / 2) = (k : ℝ) + 1 / 2 := by push_cast @@ -7579,14 +7603,16 @@ private theorem lowerGammaBoundaryLog_dimension_scaled_log_tail_uniform have hcompare : Real.pi * |Y| / 2 ≤ Real.pi * |((d : ℝ) / 2) * Y| / 2 := by - rw [abs_mul, abs_of_nonneg (by linarith : 0 ≤ (d : ℝ) / 2)] - linarith [mul_nonneg Real.pi_pos.le (abs_nonneg Y), - mul_nonneg (sub_nonneg.mpr hℓ) - (mul_nonneg Real.pi_pos.le (abs_nonneg Y))] + rw [abs_mul, abs_of_nonneg (by linear_combination hℓ : 0 ≤ (d : ℝ) / 2)] + linarith only [ + mul_nonneg Real.pi_pos.le (abs_nonneg Y), + mul_nonneg (sub_nonneg.mpr hℓ) (mul_nonneg Real.pi_pos.le (abs_nonneg Y)), + hℓ + ] have hcoth := lowerCoth_log_antitoneOn ht ht' hcompare have htail := lowerGammaBoundaryLog_dimension_scaled_log_tail hdpos hc hY - linarith + linarith only [hcoth, htail] private theorem lower_positiveLogRatio_integrable {A : ℝ} (hA : 0 < A) : @@ -7611,7 +7637,7 @@ private theorem lower_positiveLogRatio_integrable hnear.const_mul (Real.exp B) apply hmajor.mono' · have harg : Measurable (fun y : ℝ => A / |y|) := by - fun_prop + exact Measurable.const_div (Continuous.measurable (Continuous.abs continuous_id')) A exact (harg.log.max measurable_const).aestronglyMeasurable · filter_upwards [] with y rw [Real.norm_eq_abs, abs_of_nonneg (le_max_right _ _)] @@ -7625,8 +7651,7 @@ private theorem lower_positiveLogRatio_integrable Real.log (A / |y|) ≤ |Real.log A| + |Real.log (|y|)| := by rw [Real.log_div hA.ne' (abs_ne_zero.mpr hy)] - linarith [le_abs_self (Real.log A), - neg_le_abs (Real.log (|y|))] + linarith only [le_abs_self (Real.log A), neg_le_abs (Real.log (|y|))] have hpoly : 0 ≤ |Real.log A| + |Real.log (|y|)| := by positivity have hmax : @@ -7636,12 +7661,12 @@ private theorem lower_positiveLogRatio_integrable have hfactor : 1 ≤ Real.exp B * Real.exp ((-1 : ℝ) * |y|) := by rw [← Real.exp_add] - exact (Real.one_le_exp_iff).2 (by linarith) + exact (Real.one_le_exp_iff).2 (by linarith only [hsmall]) have hproduct : |Real.log A| + |Real.log (|y|)| ≤ (Real.exp B * Real.exp ((-1 : ℝ) * |y|)) * (|Real.log A| + |Real.log (|y|)|) := by - linarith [mul_nonneg (sub_nonneg.mpr hfactor) hpoly] + linarith only [mul_nonneg (sub_nonneg.mpr hfactor) hpoly, hpoly, hfactor] calc max (Real.log (A / |y|)) 0 ≤ |Real.log A| + |Real.log (|y|)| := hmax @@ -7690,7 +7715,7 @@ private theorem lowerGammaScaledPositivePart_le hd hc hY unfold lowerGammaScaledPositivePart apply max_le - · linarith + · linear_combination hlog + htail · positivity private theorem lowerGammaScaledPositivePart_integrable @@ -7798,26 +7823,26 @@ private theorem lowerGammaBoundaryLog_dimension_scaled_nonpos_of_large rw [one_div, Real.log_inv] have hlogtwo : (1 / 2 : ℝ) ≤ Real.log (2 : ℝ) := by have h := Real.one_sub_inv_le_log_of_pos - (by norm_num : (0 : ℝ) < 2) - norm_num at h ⊢ + (by norm_num1 : (0 : ℝ) < 2) + norm_num1 at h ⊢ exact h have hpiabs : 3 ≤ Real.pi * |Y| := by linarith only [Real.pi_gt_three, mul_le_mul_of_nonneg_left hyone Real.pi_pos.le] have harg : 1 ≤ Real.pi * |Y| / 2 := by linarith only [hpiabs] have hexpthree : 4 ≤ Real.exp (3 : ℝ) := by - linarith [Real.add_one_le_exp (3 : ℝ)] + linarith only [Real.add_one_le_exp (3 : ℝ)] have hexpsmall : Real.exp ((-Real.pi) * |Y|) ≤ (1 / 4 : ℝ) := by calc Real.exp ((-Real.pi) * |Y|) ≤ Real.exp (-3 : ℝ) := by apply Real.exp_le_exp.mpr - linarith + linear_combination hpiabs _ = (Real.exp (3 : ℝ))⁻¹ := Real.exp_neg 3 _ ≤ (1 / 4 : ℝ) := by simpa only [one_div] using! (one_div_le_one_div_of_le - (by norm_num : (0 : ℝ) < 4) hexpthree) + (by norm_num1 : (0 : ℝ) < 4) hexpthree) have hcoth := lowerCoth_log_le_four_exp_neg_two harg have hexp : Real.exp (-2 * (Real.pi * |Y| / 2)) = @@ -7829,9 +7854,9 @@ private theorem lowerGammaBoundaryLog_dimension_scaled_nonpos_of_large (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * |Y| / 2)) ≤ (1 / 2 : ℝ) := by - linarith + linarith only [hexpsmall, hcoth] have hℓ : 1 ≤ (d : ℝ) / 2 := by - apply (le_div_iff₀ (by norm_num : (0 : ℝ) < 2)).2 + apply (le_div_iff₀ (by norm_num1 : (0 : ℝ) < 2)).2 exact_mod_cast hd have hmain : ((d : ℝ) / 2) * @@ -7844,10 +7869,10 @@ private theorem lowerGammaBoundaryLog_dimension_scaled_nonpos_of_large mul_le_mul_of_nonneg_left hlogratio (by positivity) _ ≤ -(Real.log (2 : ℝ)) := by linarith only [mul_nonneg (sub_nonneg.mpr hℓ) - (show 0 ≤ Real.log (2 : ℝ) by linarith only [hlogtwo])] + (show 0 ≤ Real.log (2 : ℝ) by linear_combination hlogtwo)] have htail := lowerGammaBoundaryLog_dimension_scaled_log_tail_uniform hd hc hY - linarith + linarith only [hlogtwo, hexpsmall, hcoth, hmain, htail] private theorem lowerGammaScaledPositivePart_support {d : ℕ} (hd : 2 ≤ d) {c : ℝ} (hc : 0 < c) : @@ -7895,7 +7920,7 @@ private theorem exists_lowerGammaScaledPositivePart_uniform_bound Real.sinh_zero, div_zero, Real.log_zero, Std.le_refl] · exact lowerCoth_log_nonneg (by positivity) - refine ⟨C, by linarith, ?_⟩ + refine ⟨C, by linarith only [hB, hC], ?_⟩ intro d hd constructor · intro Y hY @@ -7914,7 +7939,7 @@ private theorem exists_lowerGammaScaledPositivePart_uniform_bound ((d : ℝ) / 2) * J + (1 / 2 : ℝ) * K ≤ ((d : ℝ) / 2) * (J + (1 / 2 : ℝ) * K) := by - linarith [mul_nonneg (sub_nonneg.mpr hℓ) hK] + linarith only [mul_nonneg (sub_nonneg.mpr hℓ) hK, hK, hℓ] have hconstant : J + (1 / 2 : ℝ) * K ≤ C := le_max_right B _ calc @@ -7982,7 +8007,7 @@ private theorem lowerGammaBoundaryLog_integer_antitoneOn apply Real.sqrt_le_sqrt exact add_le_add le_rfl (pow_le_pow_left₀ (half_pos hx).le (div_le_div_of_nonneg_right hxy zero_le_two) 2) - linarith + linear_combination hsum private theorem lowerGammaBoundaryLog_halfInteger_antitoneOn (k : ℕ) (R : ℝ) : @@ -8015,7 +8040,8 @@ private theorem lowerGammaBoundaryLog_halfInteger_antitoneOn have hxarg : 0 < Real.pi * x / 2 := by positivity have hyarg : 0 < Real.pi * y / 2 := by positivity have harg : Real.pi * x / 2 ≤ Real.pi * y / 2 := by - gcongr + exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hxy (le_of_lt Real.pi_pos)) + zero_le_two have hcoth : lowerCoth (Real.pi * y / 2) ≤ lowerCoth (Real.pi * x / 2) := @@ -8030,7 +8056,7 @@ private theorem lowerGammaBoundaryLog_halfInteger_antitoneOn _ ≤ lowerCoth (Real.pi * x / 2) / (x / 2) := div_le_div_of_nonneg_left (lowerCoth_pos hxarg).le (half_pos hx) - (by linarith) + (by linarith only [hxy]) have hcorr : Real.log (lowerCoth (Real.pi * y / 2) / (y / 2)) ≤ Real.log (lowerCoth (Real.pi * x / 2) / (x / 2)) := @@ -8077,7 +8103,7 @@ private theorem even_antitone_superlevel_interval have hunonzero : f u ≠ 0 := by intro hzero rw [hzero] at hu - linarith [hu.2] + linarith only [hu.2, ht, hu] exact (hsupport hunonzero).2 let r : ℝ := sSup S have hr : 0 ≤ r := by @@ -8137,7 +8163,7 @@ private theorem lowerGammaBoundaryLog_halfInteger_exp_integrable (((j : ℝ) + 1 / 2) ^ 2 + (y / 2) ^ 2))) := by exact integrable_finsetSum (Finset.range k) (fun j _ => lower_exp_log_sqrtFactor_integrable ha - (by have hj : 0 ≤ (j : ℝ) := Nat.cast_nonneg j; linarith)) + (by have hj : 0 ≤ (j : ℝ) := Nat.cast_nonneg j; linarith only [])) have hcorrection : Integrable (fun y : ℝ => @@ -8207,12 +8233,12 @@ private theorem lowerRiemannLog_monotoneOn {T : ℝ} (hT : T ≠ 0) : MonotoneOn (lowerRiemannLog T) (Ici (0 : ℝ)) := by intro x hx y hy hxy have hrad : 0 < x ^ 2 + T ^ 2 / 4 := by - linarith [sq_nonneg x, sq_pos_of_ne_zero hT] + linarith only [sq_nonneg x, sq_pos_of_ne_zero hT, hT] have hsquares : x ^ 2 ≤ y ^ 2 := (sq_le_sq₀ hx hy).2 hxy unfold lowerRiemannLog exact Real.log_le_log (Real.sqrt_pos.2 hrad) - (Real.sqrt_le_sqrt (by linarith)) + (Real.sqrt_le_sqrt (by linear_combination hsquares)) private theorem monotone_leftRiemann_error (f : ℝ → ℝ) {k : ℕ} (hk : 0 < k) @@ -8263,7 +8289,7 @@ private theorem monotone_leftRiemann_error (∑ j ∈ Finset.range k, f ((j : ℝ) / (k : ℝ))) = f 1 - f 0 := by rw [← Finset.sum_sub_distrib] - convert! Finset.sum_range_sub + convert Finset.sum_range_sub (fun j : ℕ => f ((j : ℝ) / (k : ℝ))) k using 1 · apply Finset.sum_congr rfl intro j _ @@ -8271,9 +8297,9 @@ private theorem monotone_leftRiemann_error · simp only [ne_eq, hkne, not_false_eq_true, div_self, CharP.cast_eq_zero, zero_div] constructor · rw [← hintegral] - linarith + linear_combination hleft · rw [← hintegral] - linarith + linear_combination hright + hshift private theorem lower_integer_leftRiemann_error {T : ℝ} (hT : T ≠ 0) {k : ℕ} (hk : 0 < k) : @@ -8315,8 +8341,8 @@ private theorem monotone_midpointIntegral_error have hjnonneg : 0 ≤ (j : ℝ) := Nat.cast_nonneg j have hjlast : (j : ℝ) + 1 ≤ (k : ℝ) := by exact_mod_cast (Nat.succ_le_of_lt hjk) - exact hf ⟨hjnonneg, by linarith⟩ - ⟨by linarith, by linarith⟩ (by linarith) + exact hf ⟨hjnonneg, by linear_combination hjlast⟩ + ⟨by linarith only [], by linear_combination hjlast⟩ (by linarith only []) have hmidright : (∑ j ∈ Finset.range k, f ((j : ℝ) + 1 / 2)) ≤ ∑ j ∈ Finset.range k, f ((j : ℝ) + 1) := by @@ -8326,14 +8352,14 @@ private theorem monotone_midpointIntegral_error have hjnonneg : 0 ≤ (j : ℝ) := Nat.cast_nonneg j have hjlast : (j : ℝ) + 1 ≤ (k : ℝ) := by exact_mod_cast (Nat.succ_le_of_lt hjk) - exact hf ⟨by linarith, by linarith⟩ - ⟨by linarith, hjlast⟩ (by linarith) + exact hf ⟨by linarith only [], by linear_combination hjlast⟩ + ⟨by linarith only [], hjlast⟩ (by linarith only []) have hshift : (∑ j ∈ Finset.range k, f ((j : ℝ) + 1)) - (∑ j ∈ Finset.range k, f (j : ℝ)) = f (k : ℝ) - f 0 := by rw [← Finset.sum_sub_distrib] - convert! Finset.sum_range_sub (fun j : ℕ => f (j : ℝ)) k using 1 + convert Finset.sum_range_sub (fun j : ℕ => f (j : ℝ)) k using 1 · apply Finset.sum_congr rfl intro j _ simp only [Nat.cast_add, Nat.cast_one] @@ -8382,7 +8408,7 @@ private theorem lowerRiemannLogPrimitive_hasDerivAt HasDerivAt (lowerRiemannLogPrimitive T) (lowerRiemannLog T x) x := by have hrad : 0 < x ^ 2 + T ^ 2 / 4 := by - linarith [sq_nonneg x, sq_pos_of_ne_zero hT] + linarith only [sq_nonneg x, sq_pos_of_ne_zero hT, hT] have ha : 0 < |T| / 2 := half_pos (abs_pos.mpr hT) have hquad : HasDerivAt (fun u : ℝ => u ^ 2 + T ^ 2 / 4) (2 * x) x := by diff --git a/LeanPool/SpherePacking/PackingBound.lean b/LeanPool/SpherePacking/PackingBound.lean index 00751d5db4..eac1c9536b 100644 --- a/LeanPool/SpherePacking/PackingBound.lean +++ b/LeanPool/SpherePacking/PackingBound.lean @@ -384,7 +384,7 @@ private theorem SpherePacking.volume_center_ball_union_eq_tsum intro ⟨x, hx⟩ ⟨y, hy⟩ h apply ball_disjoint_ball simp_rw [ne_eq, Subtype.mk.injEq] at h ⊢ - linarith [S.distinct_centers_separation_bound x y hx.left hy.left h] + linarith only [S.distinct_centers_separation_bound x y hx.left hy.left h, hr', hx, hy, h] private theorem SpherePacking.center_count_in_ball_upper_bound (hd : 0 < d) (R : ℝ) : (S.centers ∩ ball 0 R).encard ≤ @@ -397,7 +397,7 @@ private theorem SpherePacking.center_count_in_ball_upper_bound (hd : 0 < d) (R : Measure.addHaar_ball_center, ENNReal.tsum_set_const] at h have : Nonempty (Fin d) := Fin.pos_iff_nonempty.mp hd rwa [← ENNReal.le_div_iff_mul_le] at h <;> left - · exact (euclidean_ball_volume_positive _ (by linarith [S.separation_pos])).ne.symm + · exact (euclidean_ball_volume_positive _ (by linarith only [S.separation_pos])).ne.symm · exact (euclidean_ball_volume_finite _).ne private theorem SpherePacking.center_count_in_ball_lower_bound (R : ℝ) : @@ -424,7 +424,7 @@ private theorem SpherePacking.finite_centers_inside_ball (R : ℝ) : (ne_of_lt <| lt_of_le_of_lt (volume.mono Set.inter_subset_right) (EuclideanSpace.euclidean_ball_volume_finite _)) - (euclidean_ball_volume_positive _ (by linarith [S.separation_pos])).ne.symm + (euclidean_ball_volume_positive _ (by linarith only [S.separation_pos])).ne.symm private theorem SpherePacking.local_density_lower_bound (hd : 0 < d) (R : ℝ) : S.densityInsideRadius R @@ -435,7 +435,7 @@ private theorem SpherePacking.local_density_lower_bound (hd : 0 < d) (R : ℝ) : rw [densityInsideRadius, occupiedBallRegion] apply ENNReal.div_le_div_right exact (ENNReal.le_div_iff_mul_le - (Or.inl (euclidean_ball_volume_positive _ (by linarith [S.separation_pos])).ne.symm) + (Or.inl (euclidean_ball_volume_positive _ (by linarith only [S.separation_pos])).ne.symm) (Or.inl (euclidean_ball_volume_finite _).ne)).1 <| (by simpa only [Set.iUnion_coe_set, sub_add_cancel] using! (S.center_count_in_ball_upper_bound hd (R - S.separation / 2))) @@ -449,7 +449,7 @@ private theorem SpherePacking.local_density_upper_bound (hd : 0 < d) (R : ℝ) : rw [densityInsideRadius, occupiedBallRegion] apply ENNReal.div_le_div_right exact (ENNReal.div_le_iff_le_mul - (Or.inl (euclidean_ball_volume_positive _ (by linarith [S.separation_pos])).ne.symm) + (Or.inl (euclidean_ball_volume_positive _ (by linarith only [S.separation_pos])).ne.symm) (Or.inl (euclidean_ball_volume_finite _).ne)).1 <| (by simpa only [Set.iUnion_coe_set, add_sub_cancel_right, ge_iff_le] using! (S.center_count_in_ball_lower_bound (R + S.separation / 2))) @@ -697,8 +697,9 @@ private lemma finite_centers_in_bounded_region (hD_isBounded : IsBounded D) (hd (c := volume (ball (0 : EuclideanSpace ℝ (Fin d)) (S.separation / 2))) (hc := by simpa only using! - euclidean_ball_volume_positive (0 : EuclideanSpace ℝ (Fin d)) (by linarith - [S.separation_pos])) + euclidean_ball_volume_positive (0 : EuclideanSpace ℝ (Fin d)) (by linarith only [ + S.separation_pos + ])) (h_measurable := fun _ _ => measurableSet_ball) (h_bounded := bounded_union_of_center_balls S D hD_isBounded) (h_volume := fun _ _ => by simp only [Measure.addHaar_ball_center, Std.le_refl]) @@ -863,7 +864,7 @@ private theorem PeriodicSpherePacking.card_centers_in_fundamental_region haveI := @Fintype.ofFinite _ <| finite_centers_in_bounded_region S D hD_isBounded hd (S.centers ∩ D).toFinset.card = S.centerOrbitCardinality := by rw [centerOrbitCardinality] - convert! Finset.card_eq_of_equiv_fintype ?_ + convert Finset.card_eq_of_equiv_fintype ?_ simpa only [mem_toFinset, mem_inter_iff] using! (S.centerOrbitEquivFundamentalRegion D hD_unique_covers).symm @@ -873,7 +874,7 @@ private theorem PeriodicSpherePacking.encard_centers_in_fundamental_region (hd : 0 < d) : (S.centers ∩ D).encard = S.centerOrbitCardinality := by rw [← S.card_centers_in_fundamental_region D hD_isBounded hD_unique_covers hd] - convert! Set.encard_eq_coe_toFinset_card _ + convert Set.encard_eq_coe_toFinset_card _ private theorem PeriodicSpherePacking.card_centers_in_translated_region (hd : 0 < d) {ι : Type*} [Finite ι] (b : Basis ι ℤ S.lattice) (v : EuclideanSpace ℝ (Fin d)) : @@ -889,7 +890,7 @@ private theorem PeriodicSpherePacking.encard_centers_in_translated_region (hd : (S.centers ∩ (v +ᵥ fundamentalDomain (b.ofZLatticeBasis ℝ _))).encard = S.centerOrbitCardinality := by rw [← S.card_centers_in_translated_region hd b] - convert! Set.encard_eq_coe_toFinset_card _ + convert Set.encard_eq_coe_toFinset_card _ end centerOrbitCardinality @@ -940,7 +941,7 @@ private theorem iUnion_lattice_inter_ball_sub_vadd_fundamentalDomain_subset_ball simpa only [mem_ball, dist_zero_right] using hx.2 have hynorm : ‖y‖ ≤ L := hL y hy have hsum : ‖x + y‖ < R := - lt_of_le_of_lt (norm_add_le x y) (by linarith) + lt_of_le_of_lt (norm_add_le x y) (by linarith only [hxnorm, hynorm]) simpa only [vadd_eq_add, mem_ball, dist_zero_right, gt_iff_lt] using hsum private theorem fundamental_region_translates_disjoint @@ -1300,7 +1301,7 @@ private theorem volume_ball_add_div_volume_ball_add_tendsto_one_of_nonneg simpa only [add_zero] using tendsto_const_nhds.add herror apply Tendsto.congr' (f₁ := fun R : ℝ => 1 + (C - C') / (R + C')) ?_ hsum filter_upwards [eventually_ge_atTop (1 : ℝ)] with R hR - have hden : R + C' ≠ 0 := ne_of_gt (by linarith) + have hden : R + C' ≠ 0 := ne_of_gt (by linarith only [hC', hR]) field_simp; ring have hpow : Tendsto (fun R : ℝ => ((R + C) / (R + C')) ^ d) atTop (𝓝 1) := by simpa only [one_pow] using hratio.pow d @@ -1329,8 +1330,8 @@ private theorem Filter.atTop_invariant_under_translation {β : Type*} {f : ℝ private theorem volume_ball_add_div_volume_ball_add_tendsto_one {d : ℕ} {C C' : ℝ} (hd : 0 < d) : Tendsto (fun R ↦ volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + C)) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + C'))) atTop (𝓝 1) := by - have hC₀ : 0 ≤ max (-C) (-C') + C := by linarith [le_max_left (-C) (-C')] - have hC'₀ : 0 ≤ max (-C) (-C') + C' := by linarith [le_max_right (-C) (-C')] + have hC₀ : 0 ≤ max (-C) (-C') + C := by linarith only [le_max_left (-C) (-C')] + have hC'₀ : 0 ≤ max (-C) (-C') + C' := by linarith only [le_max_right (-C) (-C')] refine (Filter.atTop_invariant_under_translation (f := fun R ↦ volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + C)) / volume (ball (0 : EuclideanSpace ℝ (Fin d)) (R + C'))) (max (-C) (-C')) _).mpr ?_ @@ -1371,14 +1372,14 @@ private lemma PeriodicSpherePacking.local_packing_density_tends_to_formula · rw [show ∀ a : ENNReal, 𝓝 a = 𝓝 (a * 1) by intro; rw [mul_one]] apply ENNReal.Tendsto.const_mul · simp_rw [sub_sub, sub_eq_add_neg] - convert! volume_ball_add_div_volume_ball_add_tendsto_one hd (C := -(S.separation / 2 + L * 2)) + convert volume_ball_add_div_volume_ball_add_tendsto_one hd (C := -(S.separation / 2 + L * 2)) rw [add_zero] · left exact one_ne_zero · rw [show ∀ a : ENNReal, 𝓝 a = 𝓝 (a * 1) by intro; rw [mul_one]] apply ENNReal.Tendsto.const_mul · simp_rw [add_assoc] - convert! volume_ball_add_div_volume_ball_add_tendsto_one hd (C := S.separation / 2 + L * 2) + convert volume_ball_add_div_volume_ball_add_tendsto_one hd (C := S.separation / 2 + L * 2) rw [add_zero] · left exact one_ne_zero @@ -1550,11 +1551,11 @@ private lemma metric_ball_subset_axis_cell {x : EuclideanSpace ℝ (Fin d)} {r L have hsub : |y i - x i| < r := coordinate_difference_small_inside_ball (d := d) hy i have hy0 : 0 ≤ y i := by have hx0 : 0 ≤ x i - r := sub_nonneg.mpr hxi.1 - have : x i - r < y i := by linarith [(abs_lt.mp hsub).1] + have : x i - r < y i := by linarith only [(abs_lt.mp hsub).1, hsub] exact hx0.trans (le_of_lt this) have hyL : y i < L := by - have : y i < x i + r := by linarith [(abs_lt.mp hsub).2] - exact lt_of_lt_of_le this (by linarith [hxi.2]) + have : y i < x i + r := by linarith only [(abs_lt.mp hsub).2, hsub] + exact lt_of_lt_of_le this (by linarith only [hxi.2, hxi]) exact ⟨hy0, hyL⟩ private lemma center_distance_bound_of_disjoint_regions {x y : EuclideanSpace ℝ (Fin d)} {r : ℝ} @@ -1564,7 +1565,7 @@ private lemma center_distance_bound_of_disjoint_regions {x y : EuclideanSpace by_contra hlt have hlt' : dist x y < 2 * r := lt_of_not_ge hlt let m : EuclideanSpace ℝ (Fin d) := midpoint ℝ x y - have hhalf : (1 / 2 : ℝ) * dist x y < r := by linarith + have hhalf : (1 / 2 : ℝ) * dist x y < r := by linarith only [hlt] have hmx : m ∈ ball x r := by simpa only [mem_ball, dist_comm, dist_left_midpoint, Real.norm_ofNat] using! (by simpa only [dist_midpoint_left, Real.norm_ofNat, one_div, @@ -2208,7 +2209,7 @@ private lemma unit_inset_cell_subset_shifted_shell (L : ℝ) : WithLp.ofLp_neg, Pi.add_apply, Pi.neg_apply, neg_neg] exact fun i => by let hxi := hx' i - refine ⟨by linarith [hxi.1], by linarith [hxi.2]⟩ + refine ⟨by linarith only [hxi.1, hxi], by linarith only [hxi.2, hxi]⟩ private lemma axis_shell_volume_difference (L : ℝ) : volume (((uniformShellShift d (- (1 / 2 : ℝ))) +ᵥ insetAxisAlignedCell (d := d) (L + 1) 0) \ @@ -2400,9 +2401,9 @@ private lemma axis_shell_relative_cell_volume_tends_zero : (axis_shell_volume_ratio_tends_zero (d := d)) refine hlimit.congr' ?_ filter_upwards [eventually_gt_atTop (2 : ℝ)] with L hL - have hL0 : 0 < L := by linarith - have hLplus : 0 ≤ L + 1 := by linarith - have hLminus : 0 ≤ L - 2 := by linarith + have hL0 : 0 < L := by linear_combination hL + have hLplus : 0 ≤ L + 1 := by linear_combination hL + have hLminus : 0 ≤ L - 2 := by linear_combination hL rw [axis_shell_volume_power_formula, PeriodicConstant.axis_cell_volume_formula, ← ENNReal.ofReal_pow hLplus d, ← ENNReal.ofReal_pow hLminus d, ← ENNReal.ofReal_pow hL0.le d, @@ -3279,7 +3280,7 @@ private lemma summable_restricted_lattice_translate_norms (K : TopologicalSpace. linarith only [hxnorm, hnorm_lt] have : (1 / 2 : ℝ) * ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖ ≤ ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖ - ‖(x : (EuclideanSpace ℝ (Fin d)))‖ := by - linarith [le_of_lt hxlt] + linarith only [le_of_lt hxlt, hnorm_lt, hxnorm] have : (1 / 2 : ℝ) * ‖(ℓ : (EuclideanSpace ℝ (Fin d)))‖ ≤ ‖(ℓ : (EuclideanSpace ℝ (Fin d))) + x‖ := le_trans this hsub simpa only [one_div, ge_iff_le, add_comm] using! this @@ -4212,7 +4213,7 @@ private theorem integer_lattice_poisson_identity (f : SchwartzMap (EuclideanSpac 𝓕 (fun x : (EuclideanSpace ℝ (Fin d)) => g x) w = cC * 𝓕 (fun x : (EuclideanSpace ℝ (Fin d)) => f x) ((dualCoordinateTransport (d := d) L) w) := by - simpa [g, A, dualCoordinateTransport, detA, cC, Complex.real_smul] using! + simpa only [g, A, dualCoordinateTransport, detA, cC, Complex.real_smul] using! (SpherePacking.ForMathlib.Fourier.fourier_precompose_linear_equivalence (A := A) (f := fun x : (EuclideanSpace ℝ (Fin d)) => f x) w) have hexp (w : (EuclideanSpace ℝ (Fin d))) : @@ -4336,7 +4337,7 @@ private theorem Continuous.nonnegative_integral_vanishes_iff_function_vanishes { hopen.measure_pos volume ⟨x, hx⟩ have hpositive : 0 < ∫ v : E, f v := (integral_pos_iff_support_of_nonneg hnn hf₂).2 hmeasure - linarith + linarith only [hzero, hpositive] · intro hzero simp only [hzero, Pi.zero_apply, integral_zero] @@ -4496,7 +4497,7 @@ private lemma summable_norm_on_translated_integral_lattice (f : 𝓢(EuclideanSp ‖a + (ℓ : EuclideanSpace ℝ (Fin d))‖ := by simpa only [tsub_le_iff_right, add_comm, norm_neg, sub_neg_eq_add] using! (norm_sub_norm_le (ℓ : EuclideanSpace ℝ (Fin d)) (-a)) - linarith + linarith only [hlarge, htriangle] have htranslatePositive : 0 < ‖a + (ℓ : EuclideanSpace ℝ (Fin d))‖ := (mul_pos (by norm_num : (0 : ℝ) < 1 / 2) hpositive).trans_le htranslate @@ -5383,7 +5384,7 @@ private theorem packing_bound_geometric_estimate (hd : 0 < d) : (f := f) hCohnElkies₁ hP hD_isBounded hd hD_unique_covers rw [SpherePacking.CohnElkies.center_double_sum_eq_region_lattice_sum (f := f) (P := P) (D := D) hD_isBounded hD_unique_covers hd] at hbound - linarith [hgeom] + linarith only [hgeom, hD_isBounded, hd, hbound] include d f hP hne_zero hReal hRealFourier hCohnElkies₁ hCohnElkies₂ in omit hne_zero hReal hRealFourier hCohnElkies₁ hP [Nonempty ↑P.centers] in @@ -5471,7 +5472,7 @@ private theorem packing_bound_spectral_estimate (hd : 0 < d) : P hd hD_isBounded] have hsum : (𝓕 f 0).re * N ^ 2 ≤ ∑' m, F m := by rw [hFsummable.tsum_eq_add_tsum_ite 0, horigin] - linarith + linarith only [htail] have hcovol : 0 ≤ ZLattice.covolume P.lattice volume := by rw [SchwartzMap.lattice_covolume_eq_coordinate_determinant] exact abs_nonneg _ diff --git a/LeanPool/SpherePacking/RadialConstruction.lean b/LeanPool/SpherePacking/RadialConstruction.lean index 498ba8cf6c..f073b18982 100644 --- a/LeanPool/SpherePacking/RadialConstruction.lean +++ b/LeanPool/SpherePacking/RadialConstruction.lean @@ -129,14 +129,14 @@ private theorem lowerGammaBoundaryLog_pole_decomposition have him := congrArg Complex.im h try dsimp [s] at him norm_num at him - exact hy (by linarith) + exact hy (by exact him) have hgammas : Complex.Gamma s ≠ 0 := by apply Complex.Gamma_ne_zero intro m hm have him := congrArg Complex.im hm try dsimp [s] at him norm_num at him - exact hy (by linarith) + exact hy (by exact him) have hnorm : ‖Complex.Gamma (s + 1)‖ = ‖s‖ * ‖Complex.Gamma s‖ := by @@ -188,20 +188,22 @@ private theorem lowerGammaBoundaryLog_tendsto_atTop_zero have hre := congrArg Complex.re hm norm_num at hre have hmnonneg : 0 ≤ (m : ℝ) := Nat.cast_nonneg m - linarith + linarith only [hre] have hdenPole : ∀ m : ℕ, (ℓ : ℂ) ≠ -(m : ℂ) := by intro m hm have hre := congrArg Complex.re hm norm_num at hre have hmnonneg : 0 ≤ (m : ℝ) := Nat.cast_nonneg m - linarith + linarith only [hℓ, hre] have hnumGamma : ContinuousAt (fun y : ℝ => Complex.Gamma (1 - Complex.I * (y : ℂ) / 2)) 0 := by apply (Complex.continuousAt_Gamma (1 : ℂ) hnumPole).comp_of_eq - · fun_prop + · exact ContinuousAt.fun_sub continuousAt_const + (ContinuousAt.comp' (Continuous.continuousAt (Continuous.div_const continuous_id' 2)) + (ContinuousAt.const_mul (Continuous.continuousAt Complex.continuous_ofReal) Complex.I)) · norm_num have hdenGamma : ContinuousAt (fun y : ℝ => @@ -209,7 +211,10 @@ private theorem lowerGammaBoundaryLog_tendsto_atTop_zero ((ℓ : ℂ) + Complex.I * (y : ℂ) / 2)) 0 := by apply (Complex.continuousAt_Gamma (ℓ : ℂ) hdenPole).comp_of_eq - · fun_prop + · exact ContinuousAt.const_add + (ContinuousAt.comp' (Continuous.continuousAt (Continuous.div_const continuous_id' 2)) + (ContinuousAt.const_mul (Continuous.continuousAt Complex.continuous_ofReal) Complex.I)) + ↑ℓ · norm_num have hnumLog : ContinuousAt (fun y : ℝ => @@ -246,7 +251,7 @@ private theorem lowerGammaBoundaryLog_tendsto_atTop_zero (𝓝 (ℓ * Real.log (Real.pi * R ^ 2) + Real.log ‖Complex.Gamma (1 : ℂ)‖ - Real.log ‖Complex.Gamma (ℓ : ℂ)‖)) := by - convert! hregular.tendsto.mono_left + convert hregular.tendsto.mono_left (nhdsWithin_le_nhds (s := {(0 : ℝ)}ᶜ)) using 1; norm_num have hnegative : @@ -331,7 +336,7 @@ private theorem lowerGammaBoundaryCapped_exp_integrable_of_exp_integrable hgammaabs.add (hbase.const_mul |D|) have hweight : Continuous (fun y : ℝ => Real.exp ((-a) * |y|)) := by - fun_prop + exact Continuous.rexp (Continuous.const_mul (Continuous.abs continuous_id') (-a)) apply hmajor.mono' ((hweight.mul (lowerGammaBoundaryCapped_continuous @@ -565,7 +570,7 @@ private theorem stripRegularizedOuter_differentiableAt_of_exp_integrable have hstrip : Complex.im ⁻¹' Ioo (-ℓ) ℓ ∈ 𝓝 z := by have him : Continuous (fun w : ℂ => w.im) := by - fun_prop + exact Complex.continuous_im exact (isOpen_Ioo.preimage him).mem_nhds hz have hneighborhood : S ∩ (Complex.im ⁻¹' Ioo (-ℓ) ℓ) ∈ 𝓝 z := @@ -782,8 +787,8 @@ private theorem lowerStripCappedGammaOuter_re_dimension Complex.I_re, Complex.ofReal_re, zero_mul, Complex.I_im, one_mul, zero_add] constructor - · linarith [mul_pos (show 0 < 1 + σ by linarith) hℓ] - · linarith [mul_pos (show 0 < 1 - σ by linarith) hℓ] + · linarith only [mul_pos (show 0 < 1 + σ by linarith) hℓ, hσbelow, hℓ] + · linarith only [mul_pos (show 0 < 1 - σ by linarith) hℓ, hσabove, hℓ] unfold lowerStripCappedGammaOuter exact stripRegularizedOuter_re hℓ hσbelow hσabove s (lowerGammaBoundaryCapped ((d : ℝ) / 2) R D) @@ -801,13 +806,14 @@ private theorem stripPoissonKernel_tendsto_zero_bottom_of_ne Real.one_lt_cosh.mpr hu have hangle : Continuous (fun σ : ℝ => stripAngle σ) := by unfold stripAngle - fun_prop + exact Continuous.comp' (Continuous.div_const continuous_id' 2) + (Continuous.const_mul (Continuous.const_add continuous_id' 1) Real.pi) have hden : 4 * (Real.cosh (Real.pi * T / 2) - Real.cos (stripAngle (-1))) ≠ 0 := by simp only [stripAngle] norm_num - linarith + linarith only [hcosh] have hcontinuous : ContinuousAt (fun σ : ℝ => stripPoissonKernel σ T) (-1 : ℝ) := by @@ -816,7 +822,7 @@ private theorem stripPoissonKernel_tendsto_zero_bottom_of_ne (continuousAt_const.mul (continuousAt_const.sub (Real.continuous_cos.comp hangle).continuousAt)) hden) - convert! hcontinuous.tendsto using 1 + convert hcontinuous.tendsto using 1 all_goals simp only [stripPoissonKernel, stripAngle, add_neg_cancel, mul_zero, zero_div, Real.sin_zero, Real.cos_zero] @@ -839,19 +845,20 @@ private theorem stripPoissonKernel_le_center_of_lower_of_abs_ge have hc : 0 < c := by try dsimp [c] have hrecip : C⁻¹ < 1 := (inv_lt_one₀ hCpos).mpr hC - linarith + linear_combination hrecip have hA : 0 < A := Real.cosh_pos _ have hCA : C ≤ A := by apply Real.cosh_le_cosh.mpr rw [abs_div, abs_div, abs_mul, abs_mul, abs_of_pos Real.pi_pos, abs_of_pos hδ] norm_num - gcongr + exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hT (le_of_lt Real.pi_pos)) + zero_le_two have hratio : 1 ≤ A / C := by apply (le_div_iff₀ hCpos).2 simpa only [one_mul] using! hCA have hangle := stripAngle_mem_Ioo hbelow - (show σ < 1 by linarith) + (show σ < 1 by linear_combination hnonpos) have hcoslt : Real.cos (stripAngle σ) < 1 := by have h := Real.cos_lt_cos_of_nonneg_of_le_pi (x := 0) (y := stripAngle σ) @@ -861,12 +868,12 @@ private theorem stripPoissonKernel_le_center_of_lower_of_abs_ge Real.sin_pos_of_pos_of_lt_pi hangle.1 hangle.2 have hden : 0 < A - Real.cos (stripAngle σ) := by try dsimp [A] - linarith [Real.one_le_cosh (Real.pi * T / 2)] + linarith only [Real.one_le_cosh (Real.pi * T / 2), hC, hCA, hcoslt] have hcompare : c * A ≤ A - Real.cos (stripAngle σ) := by have hcos := Real.cos_le_one (stripAngle σ) try dsimp [c] rw [sub_mul, one_mul, inv_mul_eq_div] - linarith + linear_combination hratio + hcoslt have hcA : 0 < 4 * (c * A) := by positivity calc stripPoissonKernel σ T = @@ -895,15 +902,14 @@ private theorem stripPoissonKernel_le_center_of_lower let q : ℝ := Real.cos (stripAngle σ) let c : ℝ := 1 - q have hangle := stripAngle_mem_Ioo hbelow - (show σ < 1 by linarith) + (show σ < 1 by linear_combination hnonpos) have hhalf : stripAngle σ ≤ Real.pi / 2 := by unfold stripAngle - linarith [mul_nonpos_of_nonneg_of_nonpos - Real.pi_pos.le hnonpos] + linarith only [mul_nonpos_of_nonneg_of_nonpos Real.pi_pos.le hnonpos, hnonpos] have hq : 0 ≤ q := by try dsimp [q] apply Real.cos_nonneg_of_mem_Icc - exact ⟨by linarith [Real.pi_pos], hhalf⟩ + exact ⟨by linarith only [Real.pi_pos, hangle], hhalf⟩ have hqlt : q < 1 := by try dsimp [q] have h := Real.cos_lt_cos_of_nonneg_of_le_pi @@ -912,12 +918,12 @@ private theorem stripPoissonKernel_le_center_of_lower simpa only [gt_iff_lt, Real.cos_zero] using! h have hc : 0 < c := by try dsimp [c] - linarith + linear_combination hqlt have hA : 0 < A := Real.cosh_pos _ have hAone : 1 ≤ A := Real.one_le_cosh _ have hcompare : c * A ≤ A - q := by try dsimp [c] - linarith [mul_nonneg hq (sub_nonneg.mpr hAone)] + linarith only [mul_nonneg hq (sub_nonneg.mpr hAone), hq, hAone] have hsin : 0 < Real.sin (stripAngle σ) := Real.sin_pos_of_pos_of_lt_pi hangle.1 hangle.2 have hcA : 0 < 4 * (c * A) := by positivity @@ -951,7 +957,7 @@ private theorem stripPoissonKernel_lower_product_integrable stripPoissonKernel σ T * g T) := by let C : ℝ := 1 / (1 - Real.cos (stripAngle σ)) have hangle := stripAngle_mem_Ioo hbelow - (show σ < 1 by linarith) + (show σ < 1 by linear_combination hnonpos) have hqlt : Real.cos (stripAngle σ) < 1 := by have h := Real.cos_lt_cos_of_nonneg_of_le_pi (x := 0) (y := stripAngle σ) @@ -959,7 +965,7 @@ private theorem stripPoissonKernel_lower_product_integrable simpa only [gt_iff_lt, Real.cos_zero] using! h have hC : 0 < C := by try dsimp [C] - exact one_div_pos.mpr (by linarith) + exact one_div_pos.mpr (by linear_combination hqlt) have hmajor : Integrable (fun T : ℝ => C * ‖stripPoissonKernel 0 T * g T‖) := @@ -974,7 +980,7 @@ private theorem stripPoissonKernel_lower_product_integrable apply hmajor.mono' hmeas.aestronglyMeasurable filter_upwards [] with T have hσpositive := stripPoissonKernel_pos - hbelow (show σ < 1 by linarith) T + hbelow (show σ < 1 by linear_combination hnonpos) T have hzero := stripPoissonKernel_pos (by norm_num : (-1 : ℝ) < 0) (by norm_num : (0 : ℝ) < 1) T @@ -1008,14 +1014,14 @@ private theorem lowerGammaBoundaryCapped_central_poisson_shift_integrable Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.I_im, Complex.ofReal_re, zero_mul, one_mul, zero_add] - constructor <;> linarith + constructor <;> linarith only [hℓ] have houter := lowerStripCappedGammaOuter_integrable_dimension hd (R := R) (D := D) hz have hreal := houter.re have htranslated := hreal.comp_sub_left s have hscaled := htranslated.comp_mul_left' hℓ.ne' have hproduct := hscaled.const_mul ℓ - convert! hproduct using 1 + convert hproduct using 1 ext T change stripPoissonKernel 0 T * @@ -1192,8 +1198,8 @@ private theorem horizontalStrip_norm_extension_majorization obtain ⟨m, r, rfl, rfl⟩ : ∃ m r : ℝ, a = m - r ∧ b = m + r := ⟨(a + b) / 2, (b - a) / 2, by ring, by ring⟩ - have hr : 0 < r := by linarith - have hwidth : m - r < m + r := by linarith + have hr : 0 < r := by linarith only [hza, hzb] + have hwidth : m - r < m + r := by linarith only [hza, hzb] rw [add_sub_sub_cancel, ← two_mul, div_mul_eq_div_div] at hgrowth have hπr : 0 < Real.pi / 2 / r := @@ -1251,7 +1257,7 @@ private theorem horizontalStrip_norm_extension_majorization rw [Complex.im_ofReal_mul, Complex.sub_im, Complex.mul_I_im, Complex.ofReal_re, abs_mul, abs_of_pos hq] - gcongr + exact mul_le_mul_of_nonneg_left hw (le_of_lt hq) simpa only [aff, Complex.re_ofReal_mul, abs_mul, abs_of_pos hq, Complex.sub_re, Complex.mul_I_re, Complex.ofReal_im, @@ -1379,21 +1385,21 @@ private theorem horizontalStrip_norm_extension_majorization private theorem harmonic_abs_log_half_le_half {x : ℝ} (hx : 2 ≤ x) : |Real.log (x / 2)| ≤ x / 2 := by - have hhalf : 1 ≤ x / 2 := by linarith + have hhalf : 1 ≤ x / 2 := by linarith only [hx] rw [abs_of_nonneg (Real.log_nonneg hhalf)] have hlog := Real.log_le_sub_one_of_pos - (show 0 < x / 2 by linarith) - linarith + (show 0 < x / 2 by linarith only [hx]) + linear_combination hlog private theorem harmonic_abs_log_sqrtFactor_le_linear {c x : ℝ} (hc : 0 ≤ c) (hx : 2 ≤ x) : |Real.log (Real.sqrt (c ^ 2 + (x / 2) ^ 2))| ≤ c + x := by have hfactor := lower_abs_log_sqrtFactor_le - hc (show 0 < x by linarith) + hc (show 0 < x by linear_combination hx) have hlog := harmonic_abs_log_half_le_half hx - linarith + linear_combination hfactor + hlog private theorem harmonic_abs_log_coth_div_le_linear {x : ℝ} (hx : 2 ≤ x) : @@ -1401,9 +1407,9 @@ private theorem harmonic_abs_log_coth_div_le_linear (lowerCoth (Real.pi * (x / 2)) / (x / 2))| ≤ Real.pi * x + |Real.log Real.pi| + x := by have hcorr := lower_abs_log_coth_div_le - (show 0 < x / 2 by linarith) + (show 0 < x / 2 by linarith only [hx]) have hlog := harmonic_abs_log_half_le_half hx - linarith + linarith only [hcorr, hlog] private theorem harmonic_integerGammaBoundary_abs_le_linear (k : ℕ) (R : ℝ) : @@ -1425,7 +1431,7 @@ private theorem harmonic_integerGammaBoundary_abs_le_linear positivity refine ⟨A, hA, ?_⟩ intro x hx - have hxzero : x ≠ 0 := by linarith + have hxzero : x ≠ 0 := by linarith only [hx] have hsum : |∑ j ∈ Finset.range k, Real.log @@ -1455,11 +1461,20 @@ private theorem harmonic_integerGammaBoundary_abs_le_linear Real.log (Real.sqrt ((j : ℝ) ^ 2 + (x / 2) ^ 2))) have hk : 0 ≤ (k : ℝ) := Nat.cast_nonneg k - have hxpos : 0 ≤ x := by linarith + have hxpos : 0 ≤ x := by linear_combination hx try dsimp [A, L] try dsimp [L] at hL - linarith [mul_nonneg hL hxpos, - mul_nonneg hS hxpos, mul_nonneg hk hxpos] + linarith only [ + mul_nonneg hL hxpos, + mul_nonneg hS hxpos, + mul_nonneg hk hxpos, + hS, + hL, + hx, + hsum, + habs, + hxpos + ] private theorem harmonic_halfIntegerGammaBoundary_abs_le_linear (k : ℕ) (R : ℝ) : @@ -1485,7 +1500,7 @@ private theorem harmonic_halfIntegerGammaBoundary_abs_le_linear Real.pi_pos.le) hQ) zero_le_two refine ⟨A, hA, ?_⟩ intro x hx - have hxpos : 0 < x := by linarith + have hxpos : 0 < x := by linarith only [hx] have hsum : |∑ j ∈ Finset.range k, Real.log @@ -1646,7 +1661,7 @@ private theorem lowerGammaBoundaryCapped_dimension_abs_le_linear refine ⟨A, hA, ?_⟩ intro y have hfactor : 1 ≤ 1 + |y| := by - linarith [abs_nonneg y] + linarith only [abs_nonneg y] by_cases hy : |y| < 2 · have hymem : y ∈ Icc (-2 : ℝ) 2 := by have hbounds := abs_lt.mp hy @@ -1658,7 +1673,7 @@ private theorem lowerGammaBoundaryCapped_dimension_abs_le_linear ((d : ℝ) / 2) R D y| ≤ K := hcompact _ ≤ A := hKA _ ≤ A * (1 + |y|) := by - linarith [mul_nonneg hA (abs_nonneg y)] + linarith only [mul_nonneg hA (abs_nonneg y), hA] · have hylarge : 2 ≤ |y| := le_of_not_gt hy have hyzero : y ≠ 0 := by intro heq @@ -1680,14 +1695,14 @@ private theorem lowerGammaBoundaryCapped_dimension_abs_le_linear calc |D| ≤ A := hDA _ ≤ A * (1 + |y|) := by - linarith [mul_nonneg hA (abs_nonneg y)] + linarith only [mul_nonneg hA (abs_nonneg y), hA] private theorem stripPoissonKernel_le_exponentialMajorant_of_nonneg {σ : ℝ} (hσ : 0 ≤ σ) (hσone : σ < 1) (T : ℝ) : stripPoissonKernel σ T ≤ stripPoissonExponentialMajorant T := by - have hbelow : -1 < σ := by linarith + have hbelow : -1 < σ := by linear_combination hσ have hmass := stripBottomMass_pos hσone have hmassone := (stripBottomMass_lt_one hbelow).le @@ -1719,10 +1734,9 @@ private theorem harmonic_stripPoissonExponentialMajorant_abs_integrable : integrable_abs_pow_mul_exp_neg_mul_abs 1 (half_pos Real.pi_pos) have hconstant := hbase.const_mul (Real.pi / 2) - convert! hconstant using 1 + convert hconstant using 1 ext T unfold stripPoissonExponentialMajorant - norm_num ring private theorem harmonic_stripPoissonKernel_zero_abs_integrable : @@ -1800,7 +1814,7 @@ private theorem exists_stripPoissonKernel_uniform_abs_moment : try dsimp [C] have hpositive := Real.cosh_pos (Real.pi / 2) have hinv := (inv_lt_one₀ hpositive).mpr hcosh - exact one_div_pos.mpr (by linarith) + exact one_div_pos.mpr (by linear_combination hinv) have hJ : 0 ≤ J := by try dsimp [J] apply integral_nonneg @@ -1863,9 +1877,7 @@ private theorem exists_stripPoissonKernel_uniform_abs_moment : congr 2 ring_nf rw [hCeq] at hcompare - linarith [mul_nonneg - (sub_nonneg.mpr hcompare) - (abs_nonneg T)] + linarith only [mul_nonneg (sub_nonneg.mpr hcompare) (abs_nonneg T), hcompare] _ ≤ ∫ T : ℝ, C * (stripPoissonKernel 0 T * |T|) := by apply setIntegral_le_integral hscaled @@ -1898,8 +1910,7 @@ private theorem exists_stripPoissonKernel_uniform_abs_moment : have hkpos := stripPoissonKernel_pos hbelow habove T - linarith [mul_nonneg hkpos.le - (sub_nonneg.mpr hTabs)] + linarith only [mul_nonneg hkpos.le (sub_nonneg.mpr hTabs), hTabs, hkpos] _ ≤ ∫ T : ℝ, stripPoissonKernel σ T := by apply setIntegral_le_integral hk @@ -1911,7 +1922,7 @@ private theorem exists_stripPoissonKernel_uniform_abs_moment : _ ≤ 1 := (stripBottomMass_lt_one hbelow).le have hsplit := integral_add_compl hS hmoment try dsimp [M] - linarith + linarith only [hE, hfar, hnear, hsplit] · have hσnonneg : 0 ≤ σ := le_of_not_ge hσ have hmajor := harmonic_stripPoissonExponentialMajorant_abs_integrable @@ -1926,7 +1937,7 @@ private theorem exists_stripPoissonKernel_uniform_abs_moment : hσnonneg habove T) (abs_nonneg T) try dsimp [M] - linarith [mul_nonneg hC.le hJ] + linarith only [mul_nonneg hC.le hJ, hC, hJ, habove, hσ, hineq] private theorem lowerGammaBoundaryCapped_poisson_abs_le_linear {d : ℕ} (hd : 0 < d) (R D : ℝ) : @@ -1997,9 +2008,8 @@ private theorem lowerGammaBoundaryCapped_poisson_abs_le_linear A * (1 + |s - ℓ * T|) := hb _ ≤ A * (1 + |s| + ℓ * |T|) := by apply mul_le_mul_of_nonneg_left _ hA - linarith - linarith [mul_nonneg hkpos.le - (sub_nonneg.mpr hbig)] + linarith only [htriangle] + linarith only [mul_nonneg hkpos.le (sub_nonneg.mpr hbig), hkpos, hbig] have hmass := (stripBottomMass_lt_one hbelow).le have hmasspos := @@ -2034,12 +2044,10 @@ private theorem lowerGammaBoundaryCapped_poisson_abs_le_linear hmass (by positivity : 0 ≤ A * (1 + |s|)) have hsecond := mul_le_mul_of_nonneg_left hmomentle (by positivity : 0 ≤ A * ℓ) - linarith + linarith only [hfirst, hsecond] _ ≤ B * (1 + |s|) := by try dsimp [B] - linarith [mul_nonneg - (show 0 ≤ A * ℓ * M by positivity) - (abs_nonneg s)] + linarith only [mul_nonneg (show 0 ≤ A * ℓ * M by positivity) (abs_nonneg s), hd, hA, hM] private theorem lowerStripCappedGammaOuter_abs_re_le_linear {d : ℕ} (hd : 0 < d) (R D : ℝ) : @@ -2124,7 +2132,7 @@ private theorem antiFourierWitness_cappedWeightedMellinStrip_growth try dsimp [c] apply (div_lt_div_iff₀ (by positivity : 0 < 4 * ℓ) - (by linarith : 0 < ℓ - (-ℓ))).2 + (by linarith only [hℓ] : 0 < ℓ - (-ℓ))).2 exact mul_lt_mul_of_pos_left (by linarith only [hℓ]) Real.pi_pos let B : ℝ := G * (1 + 1 / c) refine ⟨c, hclt, B, ?_⟩ @@ -2195,8 +2203,7 @@ private theorem antiFourierWitness_cappedWeightedMellinStrip_growth _ ≤ (K + 1) * Real.exp (B * Real.exp (c * |z.re|)) := by - linarith [Real.exp_pos - (B * Real.exp (c * |z.re|))] + linarith only [Real.exp_pos (B * Real.exp (c * |z.re|))] private theorem harmonic_bottom_normalized_height_tendsto {ℓ : ℝ} (hℓ : 0 < ℓ) (s : ℝ) : @@ -2207,8 +2214,8 @@ private theorem harmonic_bottom_normalized_height_tendsto (𝓝 (-1 : ℝ)) := by have hcontinuous : Continuous (fun z : ℂ => z.im / ℓ) := by - fun_prop - convert! hcontinuous.continuousAt.tendsto.mono_left + exact Continuous.comp' (Continuous.div_const continuous_id' ℓ) continuous_im + convert hcontinuous.continuousAt.tendsto.mono_left nhdsWithin_le_nhds using 1; simp only [sub_im, ofReal_im, mul_im, I_re, mul_zero, I_im, ofReal_re, one_mul, zero_add, zero_sub, ne_eq, @@ -2220,7 +2227,7 @@ private theorem harmonic_bottom_real_tendsto (𝓝[Complex.im ⁻¹' Ioo (-ℓ) ℓ] ((s : ℂ) - Complex.I * (ℓ : ℂ))) (𝓝 s) := by - convert! Complex.continuous_re.continuousAt.tendsto.mono_left + convert Complex.continuous_re.continuousAt.tendsto.mono_left nhdsWithin_le_nhds using 1; simp only [sub_re, ofReal_re, mul_re, I_re, zero_mul, I_im, ofReal_im, mul_zero, sub_self, sub_zero] @@ -2265,7 +2272,7 @@ private theorem harmonic_bottom_far_joint_tendsto_zero try dsimp [C] have hpositive := Real.cosh_pos (Real.pi * δ / 2) have hinv := (inv_lt_one₀ hpositive).mpr hcosh - exact one_div_pos.mpr (by linarith) + exact one_div_pos.mpr (by linear_combination hinv) have hσ : Tendsto (fun z : ℂ => z.im / ℓ) (𝓝[U] z₀) (𝓝 (-1 : ℝ)) := by @@ -2304,7 +2311,7 @@ private theorem harmonic_bottom_far_joint_tendsto_zero (z.re - s) s have heq : z.re - s + s = z.re := by ring rw [heq] at htriangle - linarith + linear_combination hsmall + htriangle have hkzero := stripPoissonKernel_integrable (by norm_num : (-1 : ℝ) < 0) (by norm_num : (0 : ℝ) < 1) @@ -2345,7 +2352,7 @@ private theorem harmonic_bottom_far_joint_tendsto_zero hzbelow hzupper hδ (show δ ≤ |T| from hT) have hkpos := stripPoissonKernel_pos - hzbelow (by linarith) T + hzbelow (by linear_combination hzupper) T have hzero := stripPoissonKernel_pos (by norm_num : (-1 : ℝ) < 0) (by norm_num : (0 : ℝ) < 1) T @@ -2362,7 +2369,7 @@ private theorem harmonic_bottom_far_joint_tendsto_zero hbound _ _ ≤ A * (2 + |s| + ℓ * |T|) := by apply mul_le_mul_of_nonneg_left _ hA - linarith + linear_combination hzreal + htri rw [norm_mul, Real.norm_eq_abs, abs_of_pos hkpos, Real.norm_eq_abs] change @@ -2388,8 +2395,13 @@ private theorem harmonic_bottom_far_joint_tendsto_zero (by norm_num : (0 : ℝ) < 1) T exact mul_nonneg hC.le (add_nonneg - (mul_nonneg (by positivity) hzero.le) - (mul_nonneg (by positivity) + (mul_nonneg (by + exact mul_nonneg hA + (le_of_lt + (add_pos_of_pos_of_nonneg + (zero_lt_two) + (abs_nonneg s)))) hzero.le) + (mul_nonneg (by exact mul_nonneg hA (le_of_lt hℓ)) (mul_nonneg hzero.le (abs_nonneg T)))) have hpoint : ∀ᵐ T : ℝ, @@ -2404,7 +2416,7 @@ private theorem harmonic_bottom_far_joint_tendsto_zero subst T have hbad : δ ≤ (0 : ℝ) := by simpa [S] using! hT - linarith + linarith only [hδ, hbad] simp_rw [Set.indicator_of_mem hT] have hkernel := (stripPoissonKernel_tendsto_zero_bottom_of_ne @@ -2417,7 +2429,7 @@ private theorem harmonic_bottom_far_joint_tendsto_zero (fun z : ℂ => b (z.re - ℓ * T)) (𝓝[U] z₀) (𝓝 (b (s - ℓ * T))) := by - convert! hcont.continuousAt.tendsto.mono_left + convert hcont.continuousAt.tendsto.mono_left nhdsWithin_le_nhds using 1; simp only [sub_re, ofReal_re, mul_re, I_re, zero_mul, I_im, ofReal_im, mul_zero, sub_self, sub_zero, z₀] @@ -2510,7 +2522,7 @@ private theorem harmonic_bottom_joint_tendsto_zero_of_zero filter_upwards [hlower, hupper, hfarevent, hrealclose] with z hzbelow hzupper hzfar hzreal - have hzabove : z.im / ℓ < 1 := by linarith + have hzabove : z.im / ℓ < 1 := by linear_combination hzupper have hg : Continuous (fun T : ℝ => b (z.re - ℓ * T)) := hb.comp (by fun_prop) @@ -2573,7 +2585,7 @@ private theorem harmonic_bottom_joint_tendsto_zero_of_zero (z.re - ℓ * T) - s = (z.re - s) - ℓ * T := by ring rw [hring] - linarith + linear_combination hzreal + hscaled + htriangle have hbdist : dist (z.re - ℓ * T) s < η := by rw [Real.dist_eq] @@ -2586,8 +2598,7 @@ private theorem harmonic_bottom_joint_tendsto_zero_of_zero hzbelow hzabove T rw [norm_mul, Real.norm_eq_abs, abs_of_pos hkpos, Real.norm_eq_abs] - linarith [mul_nonneg hkpos.le - (sub_nonneg.mpr hbabs.le)] + linarith only [mul_nonneg hkpos.le (sub_nonneg.mpr hbabs.le), hbabs, hkpos] _ ≤ ∫ T : ℝ, (ε / 2) * stripPoissonKernel (z.im / ℓ) T := @@ -2601,8 +2612,7 @@ private theorem harmonic_bottom_joint_tendsto_zero_of_zero _ ≤ ε / 2 := by have hmass := (stripBottomMass_lt_one hzbelow).le - linarith [mul_nonneg hhalf.le - (sub_nonneg.mpr hmass)] + linarith only [mul_nonneg hhalf.le (sub_nonneg.mpr hmass), hhalf, hmass] have hsplit := integral_add_compl hS hproduct rw [dist_zero_right] calc @@ -2623,7 +2633,7 @@ private theorem harmonic_bottom_joint_tendsto_zero_of_zero stripPoissonKernel (z.im / ℓ) T * b (z.re - ℓ * T)‖ := norm_add_le _ _ - _ < ε := by linarith + _ < ε := by linear_combination hzfar + hnear private theorem lowerGammaBoundaryCapped_bottom_poisson_joint_tendsto {d : ℕ} (hd : 0 < d) (R D s : ℝ) : @@ -2649,7 +2659,7 @@ private theorem lowerGammaBoundaryCapped_bottom_poisson_joint_tendsto lowerGammaBoundaryCapped_continuous hℓ R D have hb₀ : Continuous b₀ := by try dsimp [b₀] - fun_prop + exact Continuous.fun_sub hb continuous_const obtain ⟨A, hA, hbound⟩ := lowerGammaBoundaryCapped_dimension_abs_le_linear hd R D let A₀ : ℝ := A + |b s| @@ -2665,7 +2675,7 @@ private theorem lowerGammaBoundaryCapped_bottom_poisson_joint_tendsto have hy : 0 ≤ |y| := abs_nonneg y have hbs : 0 ≤ |b s| := abs_nonneg _ try dsimp [b₀, A₀] - linarith [mul_nonneg hbs hy] + linarith only [mul_nonneg hbs hy, htriangle, hbmain, hy, hbs] have hcentral : ∀ t : ℝ, Integrable (fun T : ℝ => stripPoissonKernel 0 T * b (t - ℓ * T)) := by @@ -2692,7 +2702,8 @@ private theorem lowerGammaBoundaryCapped_bottom_poisson_joint_tendsto hℓ s have hmasscontinuous : Continuous stripBottomMass := by unfold stripBottomMass - fun_prop + exact Continuous.comp' (Continuous.div_const continuous_id' 2) + (Continuous.fun_sub continuous_const continuous_id') have hmass : Tendsto (fun z : ℂ => stripBottomMass (z.im / ℓ)) (𝓝[U] z₀) (𝓝 (1 : ℝ)) := by @@ -2720,7 +2731,7 @@ private theorem lowerGammaBoundaryCapped_bottom_poisson_joint_tendsto have hzlower : -1 < z.im / ℓ := by apply (lt_div_iff₀ hℓ).2 simpa only [neg_mul, one_mul] using! hz.1 - have hzabove : z.im / ℓ < 1 := by linarith + have hzabove : z.im / ℓ < 1 := by linear_combination hzupper have hg₀ : Continuous (fun T : ℝ => b₀ (z.re - ℓ * T)) := by exact hb₀.comp (by fun_prop) @@ -2769,17 +2780,24 @@ private theorem stripPoissonKernel_tendsto_zero_top Real.cos (stripAngle (1 : ℝ))) ≠ 0 := by rw [hangle, Real.cos_pi] have hcosh := Real.one_le_cosh (Real.pi * T / 2) - linarith + linarith only [hcosh] have hnum : ContinuousAt (fun σ : ℝ => Real.sin (stripAngle σ)) 1 := by unfold stripAngle - fun_prop + exact ContinuousAt.comp' (Continuous.continuousAt Real.continuous_sin) + (ContinuousAt.comp' (Continuous.continuousAt (Continuous.div_const continuous_id' 2)) + (ContinuousAt.const_mul (ContinuousAt.const_add (continuousAt_id' 1) 1) π)) have hdencont : ContinuousAt (fun σ : ℝ => 4 * (Real.cosh (Real.pi * T / 2) - Real.cos (stripAngle σ))) 1 := by unfold stripAngle - fun_prop + exact ContinuousAt.const_mul + (ContinuousAt.fun_sub continuousAt_const + (ContinuousAt.comp' (Continuous.continuousAt Real.continuous_cos) + (ContinuousAt.comp' (Continuous.continuousAt (Continuous.div_const continuous_id' 2)) + (ContinuousAt.const_mul (ContinuousAt.const_add (continuousAt_id' 1) 1) π)))) + 4 have h := (hnum.div hdencont hden).tendsto simpa only [stripPoissonKernel, Pi.div_apply, hangle, Real.sin_pi, Real.cos_pi, sub_neg_eq_add, zero_div] using! h @@ -2793,8 +2811,8 @@ private theorem harmonic_top_normalized_height_tendsto (𝓝 (1 : ℝ)) := by have hcontinuous : Continuous (fun z : ℂ => z.im / ℓ) := by - fun_prop - convert! hcontinuous.continuousAt.tendsto.mono_left + exact Continuous.comp' (Continuous.div_const continuous_id' ℓ) continuous_im + convert hcontinuous.continuousAt.tendsto.mono_left nhdsWithin_le_nhds using 1; simp only [add_im, ofReal_im, mul_im, I_re, mul_zero, I_im, ofReal_re, one_mul, zero_add, ne_eq, hℓ.ne', @@ -2824,7 +2842,7 @@ private theorem harmonic_upper_joint_tendsto_zero harmonic_top_normalized_height_tendsto hℓ s have hreal : Tendsto Complex.re (𝓝[U] z₀) (𝓝 s) := by - convert! Complex.continuous_re.continuousAt.tendsto.mono_left + convert Complex.continuous_re.continuousAt.tendsto.mono_left nhdsWithin_le_nhds using 1; simp only [add_re, ofReal_re, mul_re, I_re, zero_mul, I_im, ofReal_im, mul_zero, sub_self, add_zero, z₀] @@ -2850,7 +2868,7 @@ private theorem harmonic_upper_joint_tendsto_zero have htri := abs_add_le (z.re - s) s have heq : z.re - s + s = z.re := by ring rw [heq] at htri - linarith + linear_combination hsmall + htri have hmajor : Integrable (fun T : ℝ => (A * (2 + |s|)) * @@ -2886,7 +2904,7 @@ private theorem harmonic_upper_joint_tendsto_zero filter_upwards [hnonneg, habove, hrealbound] with z hznonneg hzabove hzreal filter_upwards [] with T - have hzbelow : -1 < z.im / ℓ := by linarith + have hzbelow : -1 < z.im / ℓ := by linear_combination hznonneg have hkpos := stripPoissonKernel_pos hzbelow hzabove T have hkbound := stripPoissonKernel_le_exponentialMajorant_of_nonneg @@ -2906,7 +2924,7 @@ private theorem harmonic_upper_joint_tendsto_zero A * (1 + |z.re - ℓ * T|) := hbound _ _ ≤ A * (2 + |s| + ℓ * |T|) := by apply mul_le_mul_of_nonneg_left _ hA - linarith + linear_combination hzreal + htri rw [norm_mul, Real.norm_eq_abs, abs_of_pos hkpos, Real.norm_eq_abs] calc @@ -2936,7 +2954,7 @@ private theorem harmonic_upper_joint_tendsto_zero have hdatum : Tendsto (fun z : ℂ => b (z.re - ℓ * T)) (𝓝[U] z₀) (𝓝 (b (s - ℓ * T))) := by - convert! hcont.continuousAt.tendsto.mono_left + convert hcont.continuousAt.tendsto.mono_left nhdsWithin_le_nhds using 1; simp only [add_re, ofReal_re, mul_re, I_re, zero_mul, I_im, ofReal_im, mul_zero, sub_self, add_zero, z₀] @@ -2967,7 +2985,7 @@ private theorem exists_antiFourierWitness_eventually_capped_bottom_majorant have hD₀ : Real.exp D₀ = C + 1 := by try dsimp [D₀] apply Real.exp_log - linarith + linear_combination hC refine ⟨D₀, ?_⟩ intro D hD y have hbounded : @@ -2995,7 +3013,7 @@ private theorem exists_antiFourierWitness_eventually_capped_bottom_majorant ((y : ℂ) - Complex.I * (((d : ℝ) / 2 : ℝ) : ℂ))‖ ≤ C := hbounded - _ ≤ C + 1 := by linarith + _ ≤ C + 1 := by linarith only [] _ = Real.exp D₀ := hD₀.symm _ ≤ Real.exp D := Real.exp_le_exp.mpr hD by_cases hy : y = 0 @@ -3285,12 +3303,12 @@ private theorem lowerStripCappedGammaHarmonic_continuousOn have hℓ : 0 < (d : ℝ) / 2 := by positivity unfold lowerStripCappedGammaHarmonic apply horizontalStripRealTraceExtension_continuousOn - (show -((d : ℝ) / 2) < (d : ℝ) / 2 by linarith) + (show -((d : ℝ) / 2) < (d : ℝ) / 2 by linarith only [hℓ]) · exact Complex.continuous_re.comp_continuousOn (lowerStripCappedGammaOuter_differentiableOn_dimension hd R D).continuousOn · exact lowerGammaBoundaryCapped_continuous hℓ R D - · fun_prop + · exact continuous_const · intro s simpa only [ofReal_neg, ofReal_div, ofReal_natCast, ofReal_ofNat, mul_neg, sub_eq_add_neg] using! @@ -3343,7 +3361,7 @@ private theorem antiFourierWitness_capped_poisson_majorization_of_real_extension let f : ℂ → ℂ := fun z => Complex.exp (-(W z)) * Z z let N : ℂ → ℝ := fun z => Real.exp (-(E z)) * ‖Z z‖ have hℓ : 0 < ℓ := half_pos (Nat.cast_pos.mpr hd) - have hwidth : -ℓ < ℓ := by linarith + have hwidth : -ℓ < ℓ := by linarith only [hℓ] have houter : DifferentiableOn ℂ W U := by exact lowerStripCappedGammaOuter_differentiableOn_dimension hd R D @@ -3430,13 +3448,13 @@ private theorem antiFourierWitness_capped_poisson_majorization_of_real_extension simp only [Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.ofReal_re, zero_mul, Complex.I_im, one_mul, zero_add] - linarith [mul_pos (show 0 < 1 + σ by linarith) hℓ] + linarith only [mul_pos (show 0 < 1 + σ by linarith) hℓ, hbelow, hℓ] have hzabove : z.im ≤ ℓ := by try dsimp [z] simp only [Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.ofReal_re, zero_mul, Complex.I_im, one_mul, zero_add] - linarith [mul_pos (show 0 < 1 - σ by linarith) hℓ] + linarith only [mul_pos (show 0 < 1 - σ by linarith) hℓ, habove, hℓ] have hmax : N z ≤ (1 : ℝ) := horizontalStrip_norm_extension_majorization hwidth (by norm_num) f N hf hN @@ -3451,8 +3469,8 @@ private theorem antiFourierWitness_capped_poisson_majorization_of_real_extension Complex.ofReal_re, zero_mul, Complex.I_im, one_mul, zero_add] constructor - · linarith [mul_pos (show 0 < 1 + σ by linarith) hℓ] - · linarith [mul_pos (show 0 < 1 - σ by linarith) hℓ] + · linarith only [mul_pos (show 0 < 1 + σ by linarith) hℓ, hbelow, hℓ] + · linarith only [mul_pos (show 0 < 1 - σ by linarith) hℓ, habove, hℓ] have hreal := hEinterior z hzinterior have hpoisson := lowerStripCappedGammaOuter_re_dimension (R := R) (D := D) hd hbelow habove s @@ -3470,7 +3488,7 @@ private theorem antiFourierWitness_capped_poisson_majorization_of_real_extension mul_le_mul_of_nonneg_left hweighted (Real.exp_pos (E z)).le have hfinal : ‖Z z‖ ≤ Real.exp (E z) := by - convert! hscale using 1 + convert hscale using 1 · rw [← mul_assoc, ← Real.exp_add] simp only [add_neg_cancel, Real.exp_zero, one_mul] · simp only [mul_one] @@ -3514,7 +3532,7 @@ private theorem exists_antiFourierWitness_capped_poisson_majorization have hℓ : 0 < (d : ℝ) / 2 := half_pos (Nat.cast_pos.mpr hd) have hne : (d : ℝ) / 2 ≠ -((d : ℝ) / 2) := by - linarith + linarith only [hℓ] simp only [lowerStripCappedGammaHarmonic, horizontalStripRealTraceExtension, hz, hne, ↓reduceIte] · exact hbottom D hD @@ -3542,9 +3560,9 @@ private theorem stripPoissonKernel_shifted_centered_interval_max stripPoissonKernel σ x := by rw [integral_Icc_eq_integral_Ioc, integral_Icc_eq_integral_Ioc, - ← intervalIntegral.integral_of_le (by linarith : -r ≤ r), + ← intervalIntegral.integral_of_le (by linarith only [hr] : -r ≤ r), ← intervalIntegral.integral_of_le - (by linarith : s - r ≤ s + r), + (by linarith only [hr] : s - r ≤ s + r), intervalIntegral.integral_comp_sub_left] congr 1; ring have hright : @@ -3703,7 +3721,7 @@ private theorem stripPoissonWeightedMeasure_integrable have hproduct := stripPoissonKernel_weighted_product_integrable hbelow habove hf s - convert! hproduct using 1 + convert hproduct using 1 ext x simp only [NNReal.smul_def, Real.coe_toNNReal _ (stripPoissonKernel_pos hbelow habove (s - x)).le, smul_eq_mul] @@ -3850,13 +3868,13 @@ private theorem lowerGammaBoundaryLog_dimension_scaled_le_neg_of_large have harg : 1 ≤ Real.pi * |Y| / 2 := by linarith only [hpiabs] have hexpthree : 4 ≤ Real.exp (3 : ℝ) := by - linarith [Real.add_one_le_exp (3 : ℝ)] + linarith only [Real.add_one_le_exp (3 : ℝ)] have hexpsmall : Real.exp ((-Real.pi) * |Y|) ≤ (1 / 4 : ℝ) := by calc Real.exp ((-Real.pi) * |Y|) ≤ Real.exp (-3 : ℝ) := by apply Real.exp_le_exp.mpr - linarith + linear_combination hpiabs _ = (Real.exp (3 : ℝ))⁻¹ := Real.exp_neg 3 _ ≤ (1 / 4 : ℝ) := by simpa only [one_div] using! @@ -3873,12 +3891,12 @@ private theorem lowerGammaBoundaryLog_dimension_scaled_le_neg_of_large (1 / 2 : ℝ) * Real.log (lowerCoth (Real.pi * |Y| / 2)) ≤ (1 / 2 : ℝ) := by - linarith + linarith only [hexpsmall, hcoth] have hℓ : 1 ≤ (d : ℝ) / 2 := by apply (le_div_iff₀ (by norm_num : (0 : ℝ) < 2)).2 exact_mod_cast hd have hlognonneg : 0 ≤ Real.log (2 : ℝ) + n := by - linarith + linear_combination hn + hlogtwo have hmain : ((d : ℝ) / 2) * Real.log (4 * Real.pi * c ^ 2 / |Y|) ≤ @@ -3889,11 +3907,10 @@ private theorem lowerGammaBoundaryLog_dimension_scaled_le_neg_of_large ((d : ℝ) / 2) * (-(Real.log (2 : ℝ)) - n) := mul_le_mul_of_nonneg_left hlogratio (by positivity) _ ≤ -(Real.log (2 : ℝ)) - n := by - linarith [mul_nonneg - (sub_nonneg.mpr hℓ) hlognonneg] + linarith only [mul_nonneg (sub_nonneg.mpr hℓ) hlognonneg, hℓ, hlognonneg] have htail := lowerGammaBoundaryLog_dimension_scaled_log_tail_uniform hd hc hY - linarith + linarith only [hlogtwo, hexpsmall, hcoth, hmain, htail] private noncomputable def lowerGammaScaledCappedClipped (d : ℕ) (c D n Y : ℝ) : ℝ := @@ -3942,7 +3959,7 @@ private theorem lowerGammaScaledCappedClipped_antitoneOn mul_nonneg hℓ hy) (mul_le_mul_of_nonneg_left hxy hℓ) unfold lowerGammaScaledCappedClipped - exact max_le_max (by linarith) (le_refl (0 : ℝ)) + exact max_le_max (by linear_combination hgamma) (le_refl (0 : ℝ)) private theorem lowerGammaScaledCappedClipped_support {d : ℕ} (hd : 2 ≤ d) {c D n : ℝ} @@ -3976,7 +3993,7 @@ private theorem lowerGammaScaledCappedClipped_support have hmin := min_le_left (lowerGammaBoundaryLog ((d : ℝ) / 2) (c * Real.sqrt d) (((d : ℝ) / 2) * Y)) D - linarith + linear_combination hnonpos + hmin exact ⟨(neg_lt_of_abs_lt hsmall).le, (lt_of_abs_lt hsmall).le⟩ @@ -4029,14 +4046,14 @@ private theorem lowerGammaScaledCapped_poisson_product_integrable Complex.I_re, Complex.ofReal_re, zero_mul, Complex.I_im, one_mul, zero_add] constructor - · linarith [mul_pos (show 0 < 1 + σ by linarith) hℓ] - · linarith [mul_pos (show 0 < 1 - σ by linarith) hℓ] + · linarith only [mul_pos (show 0 < 1 + σ by linarith) hℓ, hbelow, hℓ] + · linarith only [mul_pos (show 0 < 1 - σ by linarith) hℓ, habove, hℓ] have houter := lowerStripCappedGammaOuter_integrable_dimension hd (R := R) (D := D) hz have hreal := houter.re have hscaled := hreal.comp_mul_left' hℓ.ne' have hproduct := hscaled.const_mul ((d : ℝ) / 2) - convert! hproduct using 1 + convert hproduct using 1 ext Y change stripPoissonKernel σ (s - Y) * @@ -4079,14 +4096,14 @@ private theorem lowerGammaScaled_poisson_product_integrable Complex.I_re, Complex.ofReal_re, zero_mul, Complex.I_im, one_mul, zero_add] constructor - · linarith [mul_pos (show 0 < 1 + σ by linarith) hℓ] - · linarith [mul_pos (show 0 < 1 - σ by linarith) hℓ] + · linarith only [mul_pos (show 0 < 1 + σ by linarith) hℓ, hbelow, hℓ] + · linarith only [mul_pos (show 0 < 1 - σ by linarith) hℓ, habove, hℓ] have houter := lowerStripGammaOuter_integrable_dimension hd (R := R) hz have hreal := houter.re have hscaled := hreal.comp_mul_left' hℓ.ne' have hproduct := hscaled.const_mul ((d : ℝ) / 2) - convert! hproduct using 1 + convert hproduct using 1 ext Y change stripPoissonKernel σ (s - Y) * @@ -4141,7 +4158,7 @@ private theorem lowerGammaScaledCappedLowerClip_poisson_integrable have hk := (stripPoissonKernel_integrable hbelow habove).comp_sub_left s have hconstant := hk.const_mul (-n) have hmax := hbase.sup hconstant - convert! hmax using 1 + convert hmax using 1 ext Y change stripPoissonKernel σ (s - Y) * @@ -4217,7 +4234,7 @@ private theorem lowerGammaScaledCappedLowerClip_poisson_convolution_max hdpos hbelow habove s, lowerGammaScaledCappedClipped_integral_eq hdpos hbelow habove 0] at hplus - linarith + linear_combination hplus private theorem lowerGammaScaledCappedLowerClip_poisson_tendsto {d : ℕ} (hd : 0 < d) {c D σ : ℝ} @@ -4257,7 +4274,7 @@ private theorem lowerGammaScaledCappedLowerClip_poisson_tendsto · rw [max_eq_right hle, abs_of_nonpos (neg_nonpos.mpr hn), abs_of_nonpos (le_trans hle (neg_nonpos.mpr hn))] - linarith + linear_combination hle · rw [max_eq_left hle] change ‖K Y * max (b Y) (-(n : ℝ))‖ ≤ |K Y * b Y| @@ -4467,8 +4484,7 @@ private theorem lowerGammaBoundaryLog_integer_scaled rw [lowerRiemannLog_scaled_factor hkreal] have hrad : 0 < ((j : ℝ) / (k : ℝ)) ^ 2 + T ^ 2 / 4 := by - linarith [sq_nonneg ((j : ℝ) / (k : ℝ)), - sq_pos_of_ne_zero hT] + linarith only [sq_nonneg ((j : ℝ) / (k : ℝ)), sq_pos_of_ne_zero hT, hT] rw [Real.log_mul hkreal.ne' (Real.sqrt_pos.mpr hrad).ne'] rfl @@ -4513,8 +4529,7 @@ private theorem lowerGammaBoundaryLog_halfInteger_scaled rw [lowerRiemannLog_scaled_factor hℓ] have hrad : 0 < (((j : ℝ) + 1 / 2) / ℓ) ^ 2 + T ^ 2 / 4 := by - linarith [sq_nonneg (((j : ℝ) + 1 / 2) / ℓ), - sq_pos_of_ne_zero hT] + linarith only [sq_nonneg (((j : ℝ) + 1 / 2) / ℓ), sq_pos_of_ne_zero hT, hT] rw [Real.log_mul hℓ.ne' (Real.sqrt_pos.mpr hrad).ne'] rfl @@ -4550,11 +4565,11 @@ private theorem lowerRiemannLog_continuous {T : ℝ} (hT : T ≠ 0) : Continuous (lowerRiemannLog T) := by have hrad (x : ℝ) : 0 < x ^ 2 + T ^ 2 / 4 := by - linarith [sq_nonneg x, sq_pos_of_ne_zero hT] + linarith only [sq_nonneg x, sq_pos_of_ne_zero hT, hT] have hsqrt : Continuous (fun x : ℝ => Real.sqrt (x ^ 2 + T ^ 2 / 4)) := by - fun_prop + exact Continuous.sqrt (Continuous.add_const (Continuous.fun_pow continuous_id' 2) (T ^ 2 / 4)) unfold lowerRiemannLog exact hsqrt.log (fun x => (Real.sqrt_pos.mpr (hrad x)).ne') @@ -4601,7 +4616,7 @@ private theorem lowerRiemannLog_halfInteger_tail_integral_le have hratio_le : (k : ℝ) / ℓ ≤ 1 := by apply (div_le_one hℓ).2 rw [hℓeq] - linarith + linarith only [] have hcont := lowerRiemannLog_continuous hT have hint : IntervalIntegrable (lowerRiemannLog T) volume ((k : ℝ) / ℓ) 1 := @@ -4647,12 +4662,12 @@ private theorem lowerGammaBoundaryLog_halfInteger_riemann_le ℓ * (Real.log (Real.pi * R ^ 2 / ℓ) + 1 + lowerEndpointPhase T) + lowerRiemannErrorMajorant T := by - have hℓ : 0 < ℓ := by linarith + have hℓ : 0 < ℓ := by linarith only [hℓone] have hratio_nonneg : 0 ≤ (k : ℝ) / ℓ := by positivity have hratio_le : (k : ℝ) / ℓ ≤ 1 := by apply (div_le_one hℓ).2 rw [hℓeq] - linarith + linarith only [] let q : ℝ → ℝ := lowerRiemannLog T have hcont := lowerRiemannLog_continuous hT have hfirst : IntervalIntegrable q volume @@ -4757,7 +4772,7 @@ private theorem lowerGammaBoundaryLog_dimension_riemann_le apply lowerGammaBoundaryLog_halfInteger_riemann_le k rfl · have hkre : 1 ≤ (k : ℝ) := by exact_mod_cast hk - linarith + linear_combination hkre · exact hR · exact hT @@ -4810,7 +4825,7 @@ private theorem stripPoissonKernel_le_mass_mul_exponential (T : ℝ) : stripPoissonKernel σ T ≤ stripBottomMass σ * stripPoissonExponentialMajorant T := by - have hbelow : -1 < σ := by linarith + have hbelow : -1 < σ := by linear_combination hzero have hmass := stripBottomMass_pos habove have hnormalize := stripNormalizedPoissonKernel_eq_extension hbelow habove T @@ -4824,7 +4839,7 @@ private theorem stripPoissonKernel_le_mass_mul_exponential rw [hnormalize] exact hbound.2 have h := (div_le_iff₀ hmass).mp hquotient - linarith + linear_combination h private theorem stripPoissonExponentialMajorant_abs_moment_integrable : Integrable (fun T : ℝ => @@ -4832,7 +4847,7 @@ private theorem stripPoissonExponentialMajorant_abs_moment_integrable : have hmoment := integrable_abs_pow_mul_exp_neg_mul_abs 1 (half_pos Real.pi_pos) have hscaled := hmoment.const_mul (Real.pi / 2) - convert! hscaled using 1 + convert hscaled using 1 ext T simp only [stripPoissonExponentialMajorant, neg_mul, pow_one] ring @@ -4840,12 +4855,12 @@ private theorem stripPoissonExponentialMajorant_abs_moment_integrable : private theorem stripPoissonKernel_abs_moment_integrable {σ : ℝ} (hzero : 0 ≤ σ) (habove : σ < 1) : Integrable (fun T : ℝ => stripPoissonKernel σ T * |T|) := by - have hbelow : -1 < σ := by linarith + have hbelow : -1 < σ := by linear_combination hzero have hmajor := stripPoissonExponentialMajorant_abs_moment_integrable.const_mul (stripBottomMass σ) have habsmeas : Measurable (fun T : ℝ => |T|) := by - fun_prop + exact Continuous.measurable (Continuous.abs continuous_id') apply hmajor.mono' ((stripPoissonKernel_integrable hbelow habove).aestronglyMeasurable.mul habsmeas.aestronglyMeasurable) @@ -4906,30 +4921,30 @@ private theorem lowerRiemannLog_one_nonneg_le (T : ℝ) : 0 ≤ lowerRiemannLog T 1 ∧ lowerRiemannLog T 1 ≤ |T| / 2 := by have hrad : 0 < (1 : ℝ) + T ^ 2 / 4 := by - linarith [sq_nonneg T] + linarith only [sq_nonneg T] have hsqrtone : 1 ≤ Real.sqrt ((1 : ℝ) + T ^ 2 / 4) := by apply (Real.le_sqrt (by norm_num) hrad.le).2 - linarith [sq_nonneg T] + linarith only [sq_nonneg T] have hsqrtupper : Real.sqrt ((1 : ℝ) + T ^ 2 / 4) ≤ 1 + |T| / 2 := by apply Real.sqrt_le_iff.mpr constructor · positivity - · linarith [abs_nonneg T, sq_abs T] + · linarith only [abs_nonneg T, sq_abs T] unfold lowerRiemannLog simp only [one_pow] constructor · exact Real.log_nonneg hsqrtone · have hlog := Real.log_le_sub_one_of_pos (Real.sqrt_pos.mpr hrad) - linarith + linear_combination hsqrtupper + hlog private theorem lowerRiemannLog_one_continuous : Continuous (fun T : ℝ => lowerRiemannLog T 1) := by have hrad (T : ℝ) : 0 < (1 : ℝ) + T ^ 2 / 4 := by - linarith [sq_nonneg T] + linarith only [sq_nonneg T] have hsqrt : Continuous (fun T : ℝ => Real.sqrt ((1 : ℝ) + T ^ 2 / 4)) := by @@ -4942,7 +4957,7 @@ private theorem stripPoissonKernel_mul_abs_lowerRiemannLog_one_integrable {σ : ℝ} (hzero : 0 ≤ σ) (habove : σ < 1) : Integrable (fun T : ℝ => stripPoissonKernel σ T * |lowerRiemannLog T 1|) := by - have hbelow : -1 < σ := by linarith + have hbelow : -1 < σ := by linear_combination hzero have hmoment := stripPoissonKernel_abs_moment_integrable hzero habove have hmajor := hmoment.const_mul (1 / 2 : ℝ) @@ -4958,9 +4973,12 @@ private theorem stripPoissonKernel_mul_abs_lowerRiemannLog_one_integrable rw [Real.norm_eq_abs, abs_mul, abs_of_pos (stripPoissonKernel_pos hbelow habove T), abs_abs, abs_of_nonneg hq.1] - linarith [mul_nonneg - (stripPoissonKernel_pos hbelow habove T).le - (sub_nonneg.mpr hq.2)] + linarith only [ + mul_nonneg (stripPoissonKernel_pos hbelow habove T).le (sub_nonneg.mpr hq.2), + habove, + hbelow, + hq + ] private theorem stripPoissonKernel_mul_abs_lowerRiemannLog_zero_integrable {σ : ℝ} (hbelow : -1 < σ) (habove : σ < 1) : @@ -4990,7 +5008,7 @@ private theorem lowerRiemannErrorMajorant_poisson_integrable Integrable (fun T : ℝ => stripPoissonKernel σ T * lowerRiemannErrorMajorant T) := by - have hbelow : -1 < σ := by linarith + have hbelow : -1 < σ := by linear_combination hzero have hqzero := (stripPoissonKernel_mul_abs_lowerRiemannLog_zero_integrable hbelow habove).const_mul (3 : ℝ) @@ -5001,7 +5019,7 @@ private theorem lowerRiemannErrorMajorant_poisson_integrable (stripPoissonKernel_mul_coth_log_integrable hbelow habove).const_mul (1 / 2 : ℝ) have hsum := hqzero.add (hone.add hcoth) - convert! hsum using 1 + convert hsum using 1 ext T change stripPoissonKernel σ T * lowerRiemannErrorMajorant T = @@ -5017,7 +5035,7 @@ private theorem stripPoissonKernel_mul_lowerEndpointPhase_integrable {σ : ℝ} (hzero : 0 ≤ σ) (habove : σ < 1) : Integrable (fun T : ℝ => stripPoissonKernel σ T * lowerEndpointPhase T) := by - have hbelow : -1 < σ := by linarith + have hbelow : -1 < σ := by linear_combination hzero have hmajor := stripPoissonExponentialMajorant_mul_lowerEndpointPhase_integrable.const_mul (stripBottomMass σ) @@ -5071,7 +5089,7 @@ private theorem lowerStripPoissonMajorant_dimension_central_bound (Real.log (2 * Real.pi * Real.exp 1 * c ^ 2) + lowerPoissonEndpointExpectation σ) + lowerRiemannPoissonError σ := by - have hbelow : -1 < σ := by linarith + have hbelow : -1 < σ := by linear_combination hzero have hdpos : 0 < d := lt_of_lt_of_le (by norm_num) hd have hℓ : 0 < (d : ℝ) / 2 := half_pos (Nat.cast_pos.mpr hdpos) @@ -5100,7 +5118,7 @@ private theorem lowerStripPoissonMajorant_dimension_central_bound have hsum := hconstant.add (hphaseterm.add hE) have hright : Integrable (fun T : ℝ => K T * (ℓ * (A + q T) + E T)) := by - convert! hsum using 1 + convert hsum using 1 ext T change K T * (ℓ * (A + q T) + E T) = @@ -5194,19 +5212,19 @@ private theorem exists_lowerStripPoissonMajorant_uniform_negative let γ : ℝ := -(stripBottomMass σ * A) / 2 have hγ : 0 < γ := by try dsimp [γ] - linarith [mul_neg_of_pos_of_neg hmass hA] + linarith only [mul_neg_of_pos_of_neg hmass hA, hmass, hA] have hscale : Tendsto (fun d : ℕ => (d : ℝ) / 2) atTop atTop := by have hcast := tendsto_natCast_atTop_atTop (R := ℝ) have hmul := hcast.atTop_mul_const (by norm_num : (0 : ℝ) < 1 / 2) - convert! hmul using 1 + convert hmul using 1 ext d ring have hγscale : Tendsto (fun d : ℕ => γ * ((d : ℝ) / 2)) atTop atTop := by have hmul := hscale.atTop_mul_const hγ - convert! hmul using 1 + convert hmul using 1 ext d ring have herror : ∀ᶠ d : ℕ in atTop, @@ -5219,7 +5237,7 @@ private theorem exists_lowerStripPoissonMajorant_uniform_negative with d hd hderr intro s have hcenter := lowerStripPoissonMajorant_dimension_centered_max - hd hc (by linarith) hσless s + hd hc (by linarith only [hσpos, hσless]) hσless s have hbound := lowerStripPoissonMajorant_dimension_central_bound hd hc hσpos.le hσless @@ -5232,7 +5250,7 @@ private theorem exists_lowerStripPoissonMajorant_uniform_negative lowerRiemannPoissonError σ := hbound _ ≤ -γ * ((d : ℝ) / 2) := by try dsimp [γ] at hderr ⊢ - linarith + linear_combination hderr private theorem lowerCoth_log_half_le_of_one_le_abs {Y : ℝ} (hY : 1 ≤ |Y|) : @@ -5240,20 +5258,21 @@ private theorem lowerCoth_log_half_le_of_one_le_abs Real.log (lowerCoth (Real.pi * |Y| / 2)) ≤ (1 / 2 : ℝ) := by have hpiabs : 3 ≤ Real.pi * |Y| := by - linarith [Real.pi_gt_three, - mul_nonneg - (by linarith [Real.pi_gt_three] : 0 ≤ Real.pi - 3) - (sub_nonneg.mpr hY)] + linarith only [ + Real.pi_gt_three, + mul_nonneg (by linarith [Real.pi_gt_three] : 0 ≤ Real.pi - 3) (sub_nonneg.mpr hY), + hY + ] have harg : 1 ≤ Real.pi * |Y| / 2 := by - linarith + linarith only [hpiabs] have hexpthree : 4 ≤ Real.exp (3 : ℝ) := by - linarith [Real.add_one_le_exp (3 : ℝ)] + linarith only [Real.add_one_le_exp (3 : ℝ)] have hexpsmall : Real.exp ((-Real.pi) * |Y|) ≤ (1 / 4 : ℝ) := by calc Real.exp ((-Real.pi) * |Y|) ≤ Real.exp (-3 : ℝ) := by apply Real.exp_le_exp.mpr - linarith + linarith only [hpiabs] _ = (Real.exp (3 : ℝ))⁻¹ := Real.exp_neg 3 _ ≤ (1 / 4 : ℝ) := by simpa only [one_div] using! @@ -5266,7 +5285,7 @@ private theorem lowerCoth_log_half_le_of_one_le_abs congr 1 ring rw [hexp] at hcoth - linarith + linarith only [hexpsmall, hcoth] private theorem lowerGammaBoundaryLog_dimension_scaled_log_tail_simple {d : ℕ} (hd : 2 ≤ d) {c Y : ℝ} @@ -5296,7 +5315,7 @@ private theorem lowerGammaBoundaryLog_dimension_scaled_log_tail_simple (show 4 * Real.pi * c ^ 2 / |Y| ≠ 0 by positivity) (Real.exp_ne_zero _), Real.log_exp] rw [hlog] - linarith + linear_combination htail + hcorr + hℓ private noncomputable def stripPoissonCoreMass (σ : ℝ) : ℝ := ∫ T in Icc (-1 : ℝ) 1, stripPoissonKernel σ T @@ -5330,7 +5349,7 @@ private theorem stripPoissonCoreMass_pos norm_num rw [hvalue] at hcompare unfold stripPoissonCoreMass - linarith + linarith only [hkone, hcompare] private theorem lowerGammaScaledPositivePart_poisson_exponential_tail {d : ℕ} (hd : 2 ≤ d) {c σ C S : ℝ} @@ -5349,7 +5368,7 @@ private theorem lowerGammaScaledPositivePart_poisson_exponential_tail (stripBottomMass σ * (Real.pi / 2) * Real.exp (-(Real.pi / 2) * (S - C))) * (C * ((d : ℝ) / 2)) := by - have hbelow : -1 < σ := by linarith + have hbelow : -1 < σ := by linear_combination hσ let E : ℝ := stripBottomMass σ * (Real.pi / 2) * Real.exp (-(Real.pi / 2) * (S - C)) @@ -5380,8 +5399,8 @@ private theorem lowerGammaScaledPositivePart_poisson_exponential_tail · simp only [hzero, mul_zero, Std.le_refl] · have hY := hsupport hzero have hdist : S - C ≤ |S - Y| := by - rw [abs_of_nonneg (by linarith [hY.2] : 0 ≤ S - Y)] - linarith [hY.2] + rw [abs_of_nonneg (by linarith only [hY.2, hS, hY] : 0 ≤ S - Y)] + linarith only [hY.2, hY] have hexp : Real.exp (-(Real.pi / 2) * |S - Y|) ≤ Real.exp (-(Real.pi / 2) * (S - C)) := by @@ -5432,10 +5451,10 @@ private theorem lowerStripPoissonMajorant_core_tail_split ∫ Y : ℝ, stripPoissonKernel σ (S - Y) * lowerGammaScaledPositivePart d c Y := by - have hbelow : -1 < σ := by linarith + have hbelow : -1 < σ := by linear_combination hσ have hdpos : 0 < d := lt_of_lt_of_le (by norm_num) hd have hℓ : 0 < (d : ℝ) / 2 := by positivity - have hSpos : 0 < S := by linarith + have hSpos : 0 < S := by linear_combination hS let ℓ : ℝ := (d : ℝ) / 2 let P : ℝ := 4 * Real.pi * Real.exp 1 * c ^ 2 let A : ℝ := 8 * Real.pi * Real.exp 1 * c ^ 2 @@ -5454,7 +5473,7 @@ private theorem lowerStripPoissonMajorant_core_tail_split have hbase := lowerGammaScaled_poisson_product_integrable hdpos (R := c * Real.sqrt d) hbelow hσone S have hcomp := hbase.comp_sub_left S - convert! hcomp using 1 + convert hcomp using 1 ext T try dsimp [b, ℓ] congr 1; ring_nf @@ -5464,7 +5483,7 @@ private theorem lowerStripPoissonMajorant_core_tail_split hbelow hσone (lowerGammaScaledPositivePart_integrable hd hc) S have hcomp := hbase.comp_sub_left S - convert! hcomp using 1 + convert hcomp using 1 ext T try dsimp [p] congr 1; ring_nf @@ -5475,7 +5494,7 @@ private theorem lowerStripPoissonMajorant_core_tail_split have hbase := ((stripPoissonKernel_integrable hbelow hσone).const_mul L).indicator (s := Icc (-1 : ℝ) 1) measurableSet_Icc - convert! hbase using 1 + convert hbase using 1 ext T by_cases hT : T ∈ Icc (-1 : ℝ) 1 · simp only [hT, indicator_of_mem] @@ -5483,15 +5502,14 @@ private theorem lowerStripPoissonMajorant_core_tail_split · simp only [hT, not_false_eq_true, indicator_of_notMem, mul_zero] have hnear : ∀ T ∈ Icc (-1 : ℝ) 1, b (S - T) ≤ L := by intro T hT - have hdiff : 0 < S - T := by linarith [hT.2] + have hdiff : 0 < S - T := by linarith only [hT.2, hS, hT] have hlarge : 1 ≤ |S - T| := by rw [abs_of_pos hdiff] - linarith [hT.2] + linarith only [hT.2, hS, hT] have hratio : P / |S - T| ≤ A / S := by apply (div_le_div_iff₀ (abs_pos.mpr hdiff.ne') hSpos).2 rw [abs_of_pos hdiff, hA] - linarith [mul_nonneg hP.le - (show 0 ≤ S - 2 * T by linarith [hT.2])] + linarith only [mul_nonneg hP.le (show 0 ≤ S - 2 * T by linarith [hT.2]), hS, hP, hT] have hlog : Real.log (P / |S - T|) ≤ Real.log (A / S) := by apply Real.log_le_log (by positivity) @@ -5519,8 +5537,13 @@ private theorem lowerStripPoissonMajorant_core_tail_split by_cases hT : T ∈ Icc (-1 : ℝ) 1 · simp only [Set.indicator_of_mem hT] have h := hnear T hT - linarith [mul_nonneg hkernel hpnonneg, - mul_nonneg hkernel (sub_nonneg.mpr h)] + linarith only [ + mul_nonneg hkernel hpnonneg, + mul_nonneg hkernel (sub_nonneg.mpr h), + hkernel, + hpnonneg, + h + ] · simp only [Set.indicator_of_notMem hT, mul_zero, zero_add] exact mul_le_mul_of_nonneg_left hb_le_p hkernel @@ -5643,7 +5666,7 @@ private theorem lowerStripPoissonMajorant_dimension_neg intro hzero apply hT apply (eq_div_iff hℓ.ne').2 - linarith + linear_combination hzero try dsimp [f] rw [stripPoissonKernel_neg] have harg : @@ -5670,7 +5693,7 @@ private theorem exists_lowerStripPoissonMajorant_positive_logarithmic_tail lowerStripPoissonMajorant ((d : ℝ) / 2) (c * Real.sqrt d) σ (((d : ℝ) / 2) * S) ≤ -κ * ((d : ℝ) / 2) * Real.log (S / A) := by - have hbelow : -1 < σ := by linarith + have hbelow : -1 < σ := by linear_combination hσ obtain ⟨C, hC, huniform⟩ := exists_lowerGammaScaledPositivePart_uniform_bound hc let A : ℝ := 8 * Real.pi * Real.exp 1 * c ^ 2 @@ -5707,7 +5730,7 @@ private theorem exists_lowerStripPoissonMajorant_positive_logarithmic_tail atTop (𝓝 0) := by have hmul := hexponential.const_mul (β * Real.exp (a * C)) - convert! hmul using 1 + convert hmul using 1 · ext S calc β * Real.exp (-a * (S - C)) = @@ -5733,7 +5756,7 @@ private theorem exists_lowerStripPoissonMajorant_positive_logarithmic_tail let B : ℝ := max 1 B₀ have hB : 0 < B := by try dsimp [B] - linarith [le_max_left (1 : ℝ) B₀] + linarith only [le_max_left (1 : ℝ) B₀] refine ⟨A, B, κ, hA, hB, hκ, ?_⟩ intro d hd S hSB have hBzero : B₀ ≤ S := @@ -5747,7 +5770,7 @@ private theorem exists_lowerStripPoissonMajorant_positive_logarithmic_tail have hSratio : 2 * A ≤ S := le_trans (le_trans (le_max_right C (2 * A)) (le_max_right 2 _)) hlargeS - have hSpos : 0 < S := by linarith + have hSpos : 0 < S := by linear_combination hStwo obtain ⟨hsupport, hpositive⟩ := huniform d hd have htail := lowerStripPoissonMajorant_core_tail_split hd hc hσ hσone hStwo @@ -5774,7 +5797,7 @@ private theorem exists_lowerStripPoissonMajorant_positive_logarithmic_tail have h := Real.one_sub_inv_le_log_of_pos (by norm_num : (0 : ℝ) < 2) norm_num at h ⊢ - linarith + exact h have hratio : (2 : ℝ) ≤ S / A := (le_div_iff₀ hA).2 hSratio have hlogratio : (1 / 2 : ℝ) ≤ Real.log (S / A) := @@ -5796,7 +5819,7 @@ private theorem exists_lowerStripPoissonMajorant_positive_logarithmic_tail _ ≤ (((d : ℝ) / 2) * Real.log (A / S)) * m + (β * Real.exp (-a * (S - C))) * ((d : ℝ) / 2) := by - linarith [hpositive_bound] + linear_combination hpositive_bound _ ≤ -κ * ((d : ℝ) / 2) * Real.log (S / A) := by rw [hflip] try dsimp [κ] @@ -5854,7 +5877,7 @@ private theorem inverseQuadraticAbs_integrable : have hbase := integrable_one_add_norm (E := ℝ) (μ := volume) (r := (2 : ℝ)) (by norm_num) - convert! hbase using 1 + convert hbase using 1 ext S rw [Real.norm_eq_abs, Real.rpow_neg (by positivity)] @@ -5891,7 +5914,7 @@ private theorem exists_lowerStripPoissonMajorant_integrable_majorant exact le_max_left B (max A 1) have hC : 0 < C := by try dsimp [C] - have hsq : 0 < (1 + T) ^ 2 := sq_pos_of_pos (by linarith) + have hsq : 0 < (1 + T) ^ 2 := sq_pos_of_pos (by linear_combination hσpos + hσone + hT) exact lt_of_lt_of_le hsq (le_max_left _ _) have hγ : 0 < γ := by try dsimp [γ] @@ -5901,7 +5924,7 @@ private theorem exists_lowerStripPoissonMajorant_integrable_majorant have hcast := tendsto_natCast_atTop_atTop (R := ℝ) have hmul := hcast.atTop_mul_const (by norm_num : (0 : ℝ) < 1 / 2) - convert! hmul using 1 + convert hmul using 1 ext d ring have hdimension : ∀ᶠ d : ℕ in atTop, @@ -5922,7 +5945,7 @@ private theorem exists_lowerStripPoissonMajorant_integrable_majorant Real.log_nonneg hratio have hκscale : 4 ≤ κ * ((d : ℝ) / 2) := by have h := (div_le_iff₀ hκ).1 hdim - linarith only [h] + linear_combination h have hnegative := hcen (((d : ℝ) / 2) * S) have hfrequency := htail d hd S hBS have haverage : @@ -5995,7 +6018,7 @@ private theorem exists_lowerStripPoissonMajorant_integrable_majorant have hden : 0 < (1 + |S|) ^ 2 := sq_pos_of_pos (by positivity) have hnearquad : (1 + |S|) ^ 2 ≤ (1 + T) ^ 2 := - pow_le_pow_left₀ (by positivity) (by linarith) 2 + pow_le_pow_left₀ (by positivity) (by linarith only [hfar]) 2 have hdenmajor : (1 + |S|) ^ 2 ≤ C := hnearquad.trans (le_max_left _ _) have hexpcentral : @@ -6006,7 +6029,7 @@ private theorem exists_lowerStripPoissonMajorant_integrable_majorant apply Real.exp_le_exp.mpr have h := hcen (((d : ℝ) / 2) * S) try dsimp [γ] - linarith [mul_nonneg hγ₀.le hℓ.le] + linarith only [mul_nonneg hγ₀.le hℓ.le, hγ₀, hℓ, h] calc Real.exp (lowerStripPoissonMajorant ((d : ℝ) / 2) @@ -6058,19 +6081,19 @@ private theorem antiFourierWitness_interiorMellinL1_le_of_integrable_majorant ((s : ℂ) + Complex.I * (((σ * ℓ : ℝ) : ℂ))) have ha : (1 - σ) * ℓ < (d : ℝ) := by have hplus : 0 < (1 + σ) * ℓ := - mul_pos (by linarith) hℓ + mul_pos (by linarith only [hσbelow]) hℓ have hinner : 0 < (1 - σ) * ℓ := mul_pos (sub_pos.mpr hσabove) hℓ apply (mul_lt_mul_iff_right₀ hinner).mp try dsimp [ℓ] at hplus hinner ⊢ - linarith [mul_pos hplus hinner] + linarith only [mul_pos hplus hinner, hplus, hinner] have hheight : ℓ - (1 - σ) * ℓ = σ * ℓ := by ring have hZ : Integrable Z := by have h := antiFourierWitness_normalizedMellinStrip_shifted_integrable hd hR w ha - convert! h using 1 + convert h using 1 ext s try dsimp [Z, ℓ] at * congr 2 @@ -6080,12 +6103,12 @@ private theorem antiFourierWitness_interiorMellinL1_le_of_integrable_majorant have hprofile : Integrable (fun S : ℝ => E / (1 + |S|) ^ 2) := by have h := inverseQuadraticAbs_integrable.const_mul E - convert! h using 1 + convert h using 1 ext S ring have hscaled : Integrable (fun S : ℝ => ‖Z (ℓ * S)‖) := by have h := hZ.norm.comp_mul_left' hℓ.ne' - convert! h using 1 + convert h using 1 have hbound : (∫ S : ℝ, ‖Z (ℓ * S)‖) ≤ E * lowerInverseQuadraticMass := by @@ -6155,7 +6178,7 @@ private theorem lowerStripCappedPoisson_tendsto have h := lowerGammaScaledCapped_poisson_tendsto (c := c) hd hσbelow hσabove (s / ((d : ℝ) / 2)) - convert! h using 1 + convert h using 1 ext n let f : ℝ → ℝ := fun Y => stripPoissonKernel σ (s / ((d : ℝ) / 2) - Y) * @@ -6212,20 +6235,20 @@ private theorem uniformAntiFourierSignRadius_of_poisson_majorization let J : ℝ := lowerInverseQuadraticMass let Q : ℝ := C * J let K : ℝ := (2 * Real.pi)⁻¹ * Q / (1 - σ) - have hσbelow : -1 < σ := by linarith + have hσbelow : -1 < σ := by linarith only [hσpos, hσone] have hsigmapos : 0 < 1 - σ := sub_pos.mpr hσone have hscale : Tendsto (fun d : ℕ => (d : ℝ) / 2) atTop atTop := by have hcast := tendsto_natCast_atTop_atTop (R := ℝ) have hmul := hcast.atTop_mul_const (by norm_num : (0 : ℝ) < 1 / 2) - convert! hmul using 1 + convert hmul using 1 ext d ring have hγscale : Tendsto (fun d : ℕ => γ * ((d : ℝ) / 2)) atTop atTop := by have h := hscale.atTop_mul_const hγ - convert! h using 1 + convert h using 1 ext d ring have hnegative : Tendsto @@ -6239,7 +6262,7 @@ private theorem uniformAntiFourierSignRadius_of_poisson_majorization (fun d : ℕ => K * Real.exp (-γ * ((d : ℝ) / 2))) atTop (𝓝 0) := by have h := hexp.const_mul K - convert! h using 1 + convert h using 1 · ext d congr 1 ring_nf @@ -6489,7 +6512,7 @@ private theorem unitBallVolume_odd (k : ℕ) : ((2 * k + 1)‼ : ℝ) * Real.sqrt Real.pi / (2 : ℝ) ^ (k + 1) := by rw [hhalf] - convert! Real.Gamma_nat_add_one_add_half k using 1; ring_nf + convert Real.Gamma_nat_add_one_add_half k using 1; ring_nf have hpi : Real.pi ^ (((2 * k + 1 : ℕ) : ℝ) / 2) = Real.pi ^ k * Real.sqrt Real.pi := by @@ -6529,7 +6552,7 @@ private theorem unitBallVolume_odd_factorial (k : ℕ) : omega rw [hpower] field_simp - linarith [hidentity] + linarith only [hidentity] private theorem tendsto_factorialStirlingSequence : Tendsto Stirling.stirlingSeq atTop @@ -6593,7 +6616,7 @@ private theorem tendsto_log_factorial_div_nat_sub_log_nat : (1 / 2 : ℝ) * (Real.log ((2 : ℝ) * (k : ℝ)) / (k : ℝ)) - 1) atTop (nhds (-1)) := by - convert! hlimit using 1; norm_num + convert hlimit using 1; norm_num refine htarget.congr' ?_ filter_upwards [eventually_gt_atTop (0 : ℕ)] with k hk have hkreal : (k : ℝ) ≠ 0 := by @@ -6605,7 +6628,7 @@ private theorem tendsto_log_factorial_div_nat_sub_log_nat : Real.log ((k : ℝ) * 2) = Real.log (2 * (k : ℝ)) := by rw [mul_comm] field_simp - linarith [hformula, hcomm] + linarith only [hformula, hcomm] private theorem tendsto_oddDimension_atTop : Tendsto (fun k : ℕ => 2 * k + 1) atTop atTop := by @@ -6624,7 +6647,7 @@ private theorem tendsto_log_nat_div_oddDimension : (Real.log (k : ℝ) / (k : ℝ)) * ((k : ℝ) / (2 * (k : ℝ) + 1))) atTop (nhds 0) := by - convert! hproduct using 1; norm_num + convert hproduct using 1; norm_num refine hlimit.congr' ?_ filter_upwards [eventually_gt_atTop (0 : ℕ)] with k hk have hkreal : (k : ℝ) ≠ 0 := by @@ -6702,7 +6725,7 @@ private theorem tendsto_normalizedVolumeLog_even : (Real.log (k.factorial : ℝ) / (k : ℝ) - Real.log (k : ℝ))) atTop (nhds ((Real.log (2 * Real.pi) + 1) / 2)) := by - convert! hcore using 1; norm_num; ring + convert hcore using 1; norm_num; ring refine hlimit.congr' ?_ filter_upwards [eventually_gt_atTop (0 : ℕ)] with k hk have hkreal : (k : ℝ) ≠ 0 := by @@ -6735,7 +6758,7 @@ private theorem tendsto_odd_halfDimension_log_correction : (-1 / 2 : ℝ) * (Real.log (k : ℝ) / (2 * (k : ℝ) + 1))) atTop (nhds 0) := by - convert! hscaled using 1; norm_num + convert hscaled using 1; norm_num refine hlimit.congr' (Filter.Eventually.of_forall ?_) intro k have hodd : 2 * (k : ℝ) + 1 ≠ 0 := by positivity @@ -7136,7 +7159,7 @@ private theorem radialAutocorrelation_outside_eq_zero (d : ℕ) have hball := support_radialAutocorrelation_subset d hsupport have hnorm : ‖x‖ < (1 : ℝ) := by simpa only [Metric.mem_ball, dist_zero_right] using! hball - linarith + linarith only [hx, hnorm] private theorem radialAutocorrelation_real (d : ℕ) : IsRealValued (radialAutocorrelation d) := by @@ -7215,7 +7238,7 @@ private theorem criticalPackingBase_lt_one : criticalPackingBase < 1 := by unfold criticalPackingBase have hratio : Real.exp 1 / (2 * Real.pi) < 1 := by apply (div_lt_one (by positivity)).2 - linarith [Real.exp_one_lt_three, Real.pi_gt_three] + linarith only [Real.exp_one_lt_three, Real.pi_gt_three] exact (Real.sqrt_lt' (by norm_num : (0 : ℝ) < 1)).2 (by simpa only [one_pow] using! hratio) @@ -7224,7 +7247,7 @@ private theorem criticalBinaryExponent_pos : 0 < criticalBinaryExponent := by exact (Real.logb_neg (by norm_num) criticalPackingBase_pos criticalPackingBase_lt_one) rw [logb_criticalPackingBase] at hlog - linarith + linear_combination hlog end @@ -7523,7 +7546,7 @@ private theorem saddleSmallRadiusStarOrdinate_sourceScale change Real.log ℓ / 4 ≤ ℓ * (1 + u) rw [← hstar] apply mul_le_mul_of_nonneg_left _ hℓ.le - linarith + linear_combination hu private theorem saddleSource_positiveOrdinate_sourceScale {ℓ u : ℝ} (hℓ : 0 < ℓ) (hu : 1 ≤ u) : @@ -7531,7 +7554,7 @@ private theorem saddleSource_positiveOrdinate_sourceScale have hlog := Real.log_le_sub_one_of_pos hℓ have hproduct := mul_nonneg hℓ.le (sub_nonneg.mpr hu) - linarith + linarith only [hℓ, hlog, hproduct] private theorem eventually_plusSaddleProfile_re_pos_at_firstBranchSaddles : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), @@ -7594,8 +7617,8 @@ private theorem eventually_minusSaddleProfile_re_neg_at_firstBranchSaddles : eventually_gt_atTop (0 : ℕ)] with d hdimen hd intro u hulower hupper have hℓ : 0 < (d : ℝ) / 2 := by positivity - have hu : -1 < u := by linarith - have huone : 1 ≤ u := by linarith + have hu : -1 < u := by linarith only [hε, hulower] + have huone : 1 ≤ u := by linarith only [hε, hulower] have hscale := saddleSource_positiveOrdinate_sourceScale hℓ huone have herr := (hdimen u hu hupper hscale).2 hulower have hV := hvariance ((d : ℝ) / 2) hℓ u hu hupper @@ -7634,11 +7657,11 @@ private theorem eventually_plusSaddleProfile_re_pos_at_secondBranchSaddles : let δ : ℝ := u - 1 have hδ : ε / 2 ≤ δ := by try dsimp [δ] - linarith + linear_combination hu have hidentity : 1 + δ = u := by try dsimp [δ] ring - have hulower : -1 < u := by linarith + have hulower : -1 < u := by linarith only [hε, hu] have hℓ : 0 < (d : ℝ) / 2 := by positivity have hV : 0 < saddleSourceGaussianVariance ε ((d : ℝ) / 2) u := by @@ -7681,12 +7704,12 @@ private theorem eventually_minusSaddleProfile_re_neg_at_secondBranchSaddles : let δ : ℝ := u - 1 have hδ : ε / 2 ≤ δ := by try dsimp [δ] - linarith + linear_combination hu have hidentity : 1 + δ = u := by try dsimp [δ] ring - have hulower : -1 < u := by linarith - have huminus : 1 + ε / 4 ≤ u := by linarith + have hulower : -1 < u := by linarith only [hε, hu] + have huminus : 1 + ε / 4 ≤ u := by linarith only [hε, hu] have hℓ : 0 < (d : ℝ) / 2 := by positivity have hV : 0 < saddleSourceGaussianVariance ε ((d : ℝ) / 2) u := by @@ -7878,7 +7901,7 @@ private theorem manuscriptPackingDeficit_le_criticalPackingBase (d : ℕ) : refine max_le criticalPackingBase_pos.le ?_ have hroot : 0 ≤ (linearProgram d) ^ ((d : ℝ)⁻¹) := Real.rpow_nonneg (linearProgram_nonneg d) _ - linarith + linear_combination hroot private theorem tendsto_manuscriptPackingDeficit (hpacking : SharpPackingRootAsymptotic) : @@ -7904,7 +7927,7 @@ private theorem manuscriptPackingRoot_sub_deficit_le (d : ℕ) : criticalPackingBase - (linearProgram d) ^ ((d : ℝ)⁻¹) ≤ manuscriptPackingDeficit d := by exact le_max_right _ _ - linarith + linear_combination hdeficit private theorem manuscriptPackingRoot_sub_deficit_pow_le {d : ℕ} (hd : 0 < d) : diff --git a/LeanPool/SpherePacking/SaddleAnalysis.lean b/LeanPool/SpherePacking/SaddleAnalysis.lean index 7cee39c57b..7f72ad5daa 100644 --- a/LeanPool/SpherePacking/SaddleAnalysis.lean +++ b/LeanPool/SpherePacking/SaddleAnalysis.lean @@ -213,7 +213,7 @@ private theorem norm_saddleShellExponential_eq_exp_neg_damping hε horder ℓ T u rw [← Real.exp_add] congr 1 - linarith + linarith only [hphase] private noncomputable def saddleSourceShellDerivative (ε u : ℝ) : ℝ := (∫ a in (ε ^ 3)..(10 * Real.log (1 / ε)), @@ -410,7 +410,7 @@ private theorem exists_saddleSourceShellDerivative_endpoint_bound C * (u - -1) := hbound _ ≤ max C 0 * (u + 1) := by have hnonneg : 0 ≤ u + 1 := by - linarith [hu.1] + linarith only [hu.1, hu] calc C * (u - -1) = C * (u + 1) := by ring _ ≤ max C 0 * (u + 1) := @@ -420,7 +420,7 @@ private theorem exists_saddleSourceShellDerivative_endpoint_bound private theorem saddle_log_sq_le_four_mul {x : ℝ} (hx : 1 ≤ x) : (Real.log x) ^ 2 ≤ 4 * x := by - have hxpos : 0 < x := by linarith + have hxpos : 0 < x := by linear_combination hx have hspos : 0 < Real.sqrt x := Real.sqrt_pos.2 hxpos have hsquare := Real.sq_sqrt hxpos.le @@ -433,14 +433,14 @@ private theorem saddle_log_sq_le_four_mul Real.log_nonneg hx have hupper : Real.log x ≤ 2 * Real.sqrt x := by rw [hlogsplit] - linarith + linarith only [hslog] have hfactor := mul_nonneg (sub_nonneg.mpr hupper) (add_nonneg (mul_nonneg (by norm_num : (0 : ℝ) ≤ 2) (Real.sqrt_nonneg x)) hlognonnegative) - linarith + linarith only [hsquare, hfactor] private theorem exists_saddleSmallRadiusStar_coordinate_bound {ε : ℝ} (hε : 0 < ε) @@ -469,28 +469,28 @@ private theorem exists_saddleSmallRadiusStar_coordinate_bound positivity have hlogpositive : 0 < Real.log ℓ := by try dsimp [ℓ] - linarith + linear_combination hloglarge have hℓone : 1 < ℓ := (Real.log_pos_iff hℓnonnegative).mp hlogpositive - have hℓ : 0 < ℓ := by linarith + have hℓ : 0 < ℓ := by linear_combination hℓone have hdreal : 0 < (d : ℝ) := by try dsimp [ℓ] at hℓ - linarith + linarith only [hℓ] have hd : 0 < d := by exact_mod_cast hdreal have hm : 1 < m := by try dsimp [m, ℓ] - linarith - have hmpositive : 0 < m := by linarith + linarith only [hloglarge] + have hmpositive : 0 < m := by linear_combination hm have hqnonnegative : 0 ≤ q := by try dsimp [q] positivity have hlogupper : Real.log ℓ ≤ ℓ := by - linarith [Real.log_le_sub_one_of_pos hℓ] + linarith only [Real.log_le_sub_one_of_pos hℓ, hℓ] have hqbound : q ≤ 1 / 4 := by try dsimp [q] apply (div_le_iff₀ (show 0 < 4 * ℓ by positivity)).mpr - linarith + linear_combination hlogupper have hstar : saddleSmallRadiusStarOrdinate d = -1 + q := by rfl @@ -525,7 +525,10 @@ private theorem exists_saddleSmallRadiusStar_coordinate_bound try dsimp [z] calc 2 * K * q ≤ 2 * K * (1 / 4 : ℝ) := by - gcongr + exact mul_le_mul_of_nonneg_left hqbound + (mul_nonneg + zero_le_two + hK) _ = K / 2 := by ring have hlogquad := saddle_log_sq_le_four_mul hℓone.le have hmz : m * z ≤ K / 4 := by @@ -538,8 +541,7 @@ private theorem exists_saddleSmallRadiusStar_coordinate_bound rw [hid] apply (div_le_iff₀ (show 0 < 16 * ℓ by positivity)).mpr - linarith [mul_nonneg hK - (sub_nonneg.mpr hlogquad)] + linarith only [mul_nonneg hK (sub_nonneg.mpr hlogquad), hK, hlogquad] have hexpdifference : Real.exp z - 1 ≤ z * Real.exp z := by have hsource := @@ -562,7 +564,7 @@ private theorem exists_saddleSmallRadiusStar_coordinate_bound (K / 4) * Real.exp (K / 2) := by exact mul_le_mul hmz hexpbound (Real.exp_pos z).le (by positivity) - linarith + linear_combination hdifference + hscaled calc saddleSmallRadiusVariable ε (saddleSmallRadiusStar ε d) = @@ -578,7 +580,7 @@ private theorem exists_saddleSmallRadiusStar_coordinate_bound apply Real.exp_le_exp.mpr have hdigamma := (saddleDigamma_bounds hm).2 try dsimp [z] - linarith + linarith only [hshell, hdigamma] _ = m * Real.exp z := by rw [Real.exp_add, Real.exp_log hmpositive] _ ≤ m + K / 4 * Real.exp (K / 2) := hproduct @@ -610,23 +612,27 @@ private theorem exists_eventually_y_star_le_log_eighth_add intro r hr hrstar have hℓ : 0 < (d : ℝ) / 2 := by have he := Real.exp_pos (8 : ℝ) - linarith + linarith only [hd, he] have hlog : 8 < Real.log ((d : ℝ) / 2) := by apply (Real.lt_log_iff_exp_lt hℓ).mpr - linarith + linarith only [hd] have hstarpositive : 0 < saddleSmallRadiusStar ε d := saddleSmallRadiusStar_pos ε d have hsquare : r ^ 2 ≤ (saddleSmallRadiusStar ε d) ^ 2 := by - linarith [mul_nonneg - (sub_nonneg.mpr hrstar) - (add_nonneg hstarpositive.le hr)] + linarith only [ + mul_nonneg (sub_nonneg.mpr hrstar) (add_nonneg hstarpositive.le hr), + hr, + hrstar, + hstarpositive + ] calc saddleSmallRadiusVariable ε r ≤ saddleSmallRadiusVariable ε (saddleSmallRadiusStar ε d) := by unfold saddleSmallRadiusVariable - gcongr + exact mul_le_mul_of_nonneg_left hsquare + (le_of_lt (mul_pos Real.pi_pos (Real.exp_pos (2 * saddleShellDerivativeOne ε)))) _ ≤ Real.log ((d : ℝ) / 2) / 8 + C := hstar d hlog @@ -664,7 +670,7 @@ private theorem tendsto_logLinear_div_atTop : (tendsto_inv_atTop_zero : Tendsto (fun ℓ : ℝ => ℓ⁻¹) atTop (𝓝 0)) - convert! (hlog.const_mul 20).add hinv using 1 + convert (hlog.const_mul 20).add hinv using 1 · funext ℓ ring · norm_num @@ -692,7 +698,7 @@ private theorem tendsto_logLinear_sq_div_atTop : (tendsto_inv_atTop_zero : Tendsto (fun ℓ : ℝ => ℓ⁻¹) atTop (𝓝 0)) - convert! ((hlog2.const_mul 400).add + convert ((hlog2.const_mul 400).add (hlog1.const_mul 40)).add hinv using 1 · funext ℓ ring @@ -714,7 +720,7 @@ private theorem tendsto_saddleSmallResidueTruncation_div : with ℓ hℓ exact div_le_div_of_nonneg_right (saddleSmallResidueTruncation_upper hℓ) - (by linarith) + (by linear_combination hℓ) · exact tendsto_logLinear_div_atTop private theorem tendsto_saddleSmallResidueTruncation_sq_div : @@ -732,11 +738,11 @@ private theorem tendsto_saddleSmallResidueTruncation_sq_div : positivity · filter_upwards [eventually_ge_atTop (1 : ℝ)] with ℓ hℓ - apply div_le_div_of_nonneg_right _ (by linarith) + apply div_le_div_of_nonneg_right _ (by linear_combination hℓ) exact (sq_le_sq₀ (by exact_mod_cast (Nat.zero_le (saddleSmallResidueTruncation ℓ))) - (by linarith [Real.log_nonneg hℓ])).mpr + (by linarith only [Real.log_nonneg hℓ, hℓ])).mpr (saddleSmallResidueTruncation_upper hℓ) · exact tendsto_logLinear_sq_div_atTop @@ -750,7 +756,7 @@ private theorem eventually_saddleSmallResidueTruncation_double_le : eventually_gt_atTop (0 : ℝ)] with ℓ hratio hℓ have h := (div_lt_iff₀ hℓ).mp hratio - linarith + linarith only [h] private theorem eventually_saddleSmallResidueTruncation_succ_double_le : ∀ᶠ ℓ : ℝ in atTop, @@ -761,10 +767,10 @@ private theorem eventually_saddleSmallResidueTruncation_succ_double_le : filter_upwards [hsmall, eventually_ge_atTop (4 : ℝ)] with ℓ hratio hℓ - have hℓpos : 0 < ℓ := by linarith + have hℓpos : 0 < ℓ := by linear_combination hℓ have h := (div_lt_iff₀ hℓpos).mp hratio push_cast - linarith + linarith only [hℓ, h] private theorem eventually_saddleSmallResidueTruncation_dominates_window {C : ℝ} (hC : 0 ≤ C) : @@ -780,7 +786,7 @@ private theorem eventually_saddleSmallResidueTruncation_dominates_window have hlogC : C ≤ Real.log ℓ := by simpa only [max_eq_left hC] using! hlog have hN := saddleSmallResidueTruncation_lower ℓ - linarith [hlogC] + linarith only [hlogC, hyupper, hN] private theorem saddleExpSeries_term_le_exp_mul_half_pow {y : ℝ} (hy : 0 ≤ y) (m : ℕ) : @@ -810,7 +816,7 @@ private theorem saddleSmallResidue_half_log_le : Real.log (1 / 2 : ℝ) ≤ -(1 / 2 : ℝ) := by have h := Real.log_le_sub_one_of_pos (by norm_num : (0 : ℝ) < 1 / 2) - linarith + linear_combination h private theorem saddleSmallResidueTruncation_half_pow_le (ℓ : ℝ) : @@ -822,7 +828,7 @@ private theorem saddleSmallResidueTruncation_half_pow_le 20 * Real.log ℓ ≤ (m : ℝ) := by try dsimp [m] push_cast - linarith [saddleSmallResidueTruncation_lower ℓ] + linarith only [saddleSmallResidueTruncation_lower ℓ] have hhalf := saddleSmallResidue_half_log_le have hproduct := mul_le_mul_of_nonneg_left hhalf @@ -830,7 +836,7 @@ private theorem saddleSmallResidueTruncation_half_pow_le have hexponent : (m : ℝ) * Real.log (1 / 2 : ℝ) ≤ -10 * Real.log ℓ := by - linarith + linarith only [hmlower, hproduct] change (1 / 2 : ℝ) ^ m ≤ _ calc (1 / 2 : ℝ) ^ m = @@ -870,7 +876,7 @@ private theorem saddleSmallResidue_tail_le_majorant (3 * (Real.log ℓ / 8 + C)) * Real.exp (-10 * Real.log ℓ) := by apply mul_le_mul - · exact Real.exp_le_exp.mpr (by linarith) + · exact Real.exp_le_exp.mpr (by linarith only [hyupper]) · exact hgeo · positivity · positivity @@ -894,7 +900,7 @@ private theorem tendsto_saddleSmallResidueTailMajorant have hsmall := (Real.tendsto_exp_atBot.comp hneg).const_mul (Real.exp (3 * C)) - convert! hsmall using 1 + convert hsmall using 1 · funext ℓ unfold saddleSmallResidueTailMajorant rw [show @@ -992,7 +998,7 @@ private theorem tendsto_saddleLogWindowPolynomial_exp_neg (fun t : ℝ => t ^ 2 * Real.exp (-(3 / 4 : ℝ) * t)) atTop (𝓝 0) := by - convert! h2base.const_mul ((4 / 3 : ℝ) ^ 2) + convert h2base.const_mul ((4 / 3 : ℝ) ^ 2) using 1 · funext t try dsimp @@ -1010,7 +1016,7 @@ private theorem tendsto_saddleLogWindowPolynomial_exp_neg (fun t : ℝ => t * Real.exp (-(3 / 4 : ℝ) * t)) atTop (𝓝 0) := by - convert! h1base.const_mul (4 / 3 : ℝ) + convert h1base.const_mul (4 / 3 : ℝ) using 1 · funext t try dsimp @@ -1033,7 +1039,7 @@ private theorem tendsto_saddleLogWindowPolynomial_exp_neg ((h2.const_mul (1 / 64 : ℝ)).add (h1.const_mul (C / 4 + 1 / 4))).add (h0.const_mul (C ^ 2 + 2 * C)) - convert! hpoly using 1 + convert hpoly using 1 · funext t ring · norm_num @@ -1047,7 +1053,7 @@ private theorem tendsto_saddleSmallResidueCoefficientMajorant (fun ℓ : ℝ => K * (saddleSmallResidueTruncation ℓ : ℝ) ^ 2 / ℓ) atTop (𝓝 0) := by - convert! tendsto_saddleSmallResidueTruncation_sq_div.const_mul K + convert tendsto_saddleSmallResidueTruncation_sq_div.const_mul K using 1 · funext ℓ ring @@ -1066,7 +1072,7 @@ private theorem tendsto_saddleSmallResidueCoefficientMajorant (Real.exp (2 * C)) have htotal := (hfactor.const_mul K).mul hwindowScaled - convert! htotal using 1 + convert htotal using 1 · funext ℓ unfold saddleSmallResidueCoefficientMajorant rw [show @@ -1172,7 +1178,7 @@ theorem tendsto_saddleResidue_dimension_half : have hcast := tendsto_natCast_atTop_atTop (R := ℝ) have hmul := hcast.atTop_mul_const (by norm_num : (0 : ℝ) < 1 / 2) - convert! hmul using 1 + convert hmul using 1 funext d ring @@ -1225,7 +1231,7 @@ private theorem gamma_half_factorial_lower (N : ℕ) : Real.Gamma (((N + 1 : ℕ) : ℝ) + 3 / 2) = ((N : ℝ) + 3 / 2) * Real.Gamma ((N : ℝ) + 3 / 2) := by - convert! Real.Gamma_add_one hq.ne' using 1 + convert Real.Gamma_add_one hq.ne' using 1 all_goals push_cast ring_nf @@ -1286,7 +1292,7 @@ private theorem saddleNegative_factorialTail_le_majorant _ ≤ Real.exp (3 * (Real.log ℓ / 8 + C)) * (2 * Real.exp (-10 * Real.log ℓ)) := by apply mul_le_mul - · exact Real.exp_le_exp.mpr (by linarith) + · exact Real.exp_le_exp.mpr (by linarith only [hyupper]) · exact hgeo · positivity · positivity @@ -1314,7 +1320,7 @@ private theorem saddleNegative_sqrt_le_one_add Real.sqrt y ≤ 1 + y := by have hs := Real.sqrt_nonneg y have hsq := Real.sq_sqrt hy - linarith [sq_nonneg (Real.sqrt y - 1)] + linarith only [sq_nonneg (Real.sqrt y - 1), hy, hsq] private noncomputable def saddleNegativeRelativeGammaTailMajorant (C K Kε ℓ : ℝ) : ℝ := @@ -1373,7 +1379,7 @@ private theorem saddleNegative_relativeGammaTail_le_majorant have hsqrtY : Real.sqrt y ≤ 1 + Y := by calc Real.sqrt y ≤ 1 + y := hsqrt - _ ≤ 1 + Y := by dsimp [Y]; linarith + _ ≤ 1 + Y := by dsimp [Y]; linear_combination hyupper have htail := saddleNegative_factorialTail_le_majorant hy hyupper have hbase : 0 ≤ y ^ N / (N.factorial : ℝ) := by @@ -1399,7 +1405,10 @@ private theorem saddleNegative_relativeGammaTail_le_majorant (Real.exp y * ((y ^ N / (N.factorial : ℝ)) / Real.Gamma (3 / 2 : ℝ))) * E := by - gcongr + exact mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left hfrac (le_of_lt (Real.exp_pos y))) + (mul_nonneg hKε (Real.sqrt_nonneg y))) + (le_of_lt (Real.exp_pos (K * (2 * ↑N + 1) ^ 2 / ℓ))) _ = (Kε / Real.Gamma (3 / 2 : ℝ)) * Real.sqrt y * (Real.exp y * (y ^ N / (N.factorial : ℝ))) * E := by @@ -1407,7 +1416,11 @@ private theorem saddleNegative_relativeGammaTail_le_majorant _ ≤ (Kε / Real.Gamma (3 / 2 : ℝ)) * (1 + Y) * (2 * saddleSmallResidueTailMajorant C ℓ) * E := by - gcongr + apply mul_le_mul_of_nonneg_right _ hE + exact mul_le_mul + (mul_le_mul_of_nonneg_left hsqrtY (div_nonneg hKε hΓ.le)) + htail (mul_nonneg (Real.exp_pos y).le hbase) + (mul_nonneg (div_nonneg hKε hΓ.le) (add_nonneg zero_le_one hY)) _ = saddleNegativeRelativeGammaTailMajorant C K Kε ℓ := by unfold saddleNegativeRelativeGammaTailMajorant try dsimp [N, Y, E] @@ -1428,7 +1441,7 @@ private theorem tendsto_saddleNegativeTruncation_odd_sq_div : ((tendsto_saddleSmallResidueTruncation_sq_div.const_mul 4).add (tendsto_saddleSmallResidueTruncation_div.const_mul 4)).add hinv - convert! h using 1 + convert h using 1 · funext ℓ ring · norm_num @@ -1454,7 +1467,7 @@ private theorem tendsto_saddleNegativeLogWindowTailMajorant (fun t : ℝ => t * Real.exp (-(77 / 8 : ℝ) * t)) atTop (𝓝 0) := by - convert! h1base.const_mul (8 / 77 : ℝ) using 1 + convert h1base.const_mul (8 / 77 : ℝ) using 1 · funext t try dsimp ring_nf @@ -1472,7 +1485,7 @@ private theorem tendsto_saddleNegativeLogWindowTailMajorant (h0.const_mul (1 + C)) have hlog := hpoly.comp Real.tendsto_log_atTop have hscaled := hlog.const_mul (Real.exp (3 * C)) - convert! hscaled using 1 + convert hscaled using 1 · funext ℓ unfold saddleSmallResidueTailMajorant rw [show @@ -1494,7 +1507,7 @@ private theorem tendsto_saddleNegativeRelativeGammaTailMajorant have htotal := (hsmall.const_mul (2 * Kε / Real.Gamma (3 / 2 : ℝ))).mul herror - convert! htotal using 1 + convert htotal using 1 · funext ℓ unfold saddleNegativeRelativeGammaTailMajorant ring_nf @@ -1662,7 +1675,7 @@ private theorem tendsto_integral_upperGammaTruncatedDampingIntegrand apply Real.exp_lt_one_iff.mpr have : 0 < 2 * a / ℓ := div_pos (mul_pos (by norm_num) ha) hℓ - linarith + linear_combination this have hbase : 0 ≤ upperCosLaplaceKernel η T a := by unfold upperCosLaplaceKernel exact div_nonneg @@ -1700,7 +1713,7 @@ private theorem tendsto_integral_upperGammaTruncatedDampingIntegrand apply Real.exp_lt_one_iff.mpr have : 0 < 2 * a / ℓ := div_pos (mul_pos (by norm_num) ha) hℓ - linarith + linear_combination this have hgeo := (hasSum_geometric_of_lt_one hq0 hq1).tendsto_sum_nat have hshift := hgeo.comp (tendsto_add_atTop_nat 1) @@ -1810,7 +1823,7 @@ private theorem upperGammaEuler_real_factor_norm {m : ℝ} (hm : 0 < m) (k : ℕ) : ‖(m : ℂ) + (k : ℂ)‖ = m + (k : ℝ) := by have hp : 0 ≤ m + (k : ℝ) := by positivity - convert! Complex.norm_of_nonneg hp using 1; + convert Complex.norm_of_nonneg hp using 1; push_cast; ring private theorem upperGammaEuler_complex_factor_pos @@ -2119,18 +2132,18 @@ private theorem plusSaddleProfile_re_pos_of_relative_residue_bounds (1 / 2 : ℝ) < Real.exp y * S := by have hscaled := mul_le_mul_of_nonneg_left hSabs hexp.le - linarith + linarith only [hfinite, hone, hscaled] have hQabs := Complex.abs_re_le_norm Q have hQneg : -‖Q‖ ≤ Q.re := by - linarith [neg_abs_le Q.re] + linarith only [neg_abs_le Q.re, hQabs] have hQlower : -(1 / 2 : ℝ) < Real.exp y * Q.re := by have hscaled := mul_le_mul_of_nonneg_left hQneg hexp.le - linarith + linear_combination hremainder + hscaled have hsum : 0 < S + Q.re := by have hscaled : 0 < Real.exp y * (S + Q.re) := by - linarith + linear_combination hSlower + hQlower exact (mul_pos_iff_of_pos_left hexp).mp hscaled exact (div_pos_iff_of_pos_right hO).mp (hnormal.symm ▸ hsum) @@ -2156,7 +2169,7 @@ private theorem upperPositiveHalfGamma_scaled_sq_le ‖Complex.Gamma (((1 / 2 : ℝ) : ℂ) + Complex.I * (x : ℂ))‖ ^ 2 = Real.pi / Real.cosh (Real.pi * x) := by - convert! norm_gamma_half_add_imaginary_sq x using 1; norm_num + convert norm_gamma_half_add_imaginary_sq x using 1; norm_num rw [hhalf, Real.Gamma_one_half_eq, Real.sq_sqrt Real.pi_pos.le] field_simp [(Real.cosh_pos (Real.pi * x)).ne']; norm_num @@ -2168,7 +2181,7 @@ private theorem upperPositiveHalfGamma_scaled_sq_le have hreal : Real.Gamma (((n + 1 : ℕ) : ℝ) + 1 / 2) = q * Real.Gamma q := by - convert! Real.Gamma_add_one hq.ne' using 1 + convert Real.Gamma_add_one hq.ne' using 1 · simp only [Nat.cast_add, Nat.cast_one, one_div, q] ring_nf let z : ℂ := (q : ℂ) + Complex.I * (x : ℂ) @@ -2182,7 +2195,7 @@ private theorem upperPositiveHalfGamma_scaled_sq_le (((((n + 1 : ℕ) : ℝ) + 1 / 2 : ℝ) : ℂ) + Complex.I * (x : ℂ)) = z * Complex.Gamma z := by - convert! Complex.Gamma_add_one z hz using 1 + convert Complex.Gamma_add_one z hz using 1 · simp only [Nat.cast_add, Nat.cast_one, one_div, Complex.ofReal_add, Complex.ofReal_natCast, Complex.ofReal_one, Complex.ofReal_inv, Complex.ofReal_ofNat, z, q] @@ -2225,9 +2238,9 @@ private theorem upperNegativeContour_shortMeasure_pointwise (1 - 4 * ε) * upperGammaMeasureDensity ℓ η a := by have hfactor : 0 ≤ 1 - 4 * ε := by apply (mul_nonneg_iff_of_pos_right hη).mp - exact mul_nonneg (by linarith [hεsmall]) hη.le + exact mul_nonneg (by linarith only [hεsmall]) hη.le have hmargintop : (1 - 10 * ε * (1 + a)) ≤ 1 - 10 * ε := by - linarith [mul_nonneg hε.le ha.le] + linarith only [mul_nonneg hε.le ha.le, hε, ha] have hbase : (ℓ / 2) * Real.exp (-η * a) / a ^ 2 ≤ upperGammaMeasureDensity ℓ η a := by @@ -2235,21 +2248,20 @@ private theorem upperNegativeContour_shortMeasure_pointwise (upperGammaVarianceDensity_pointwise_bounds (η := η) hℓ ha).1 apply (div_le_iff₀ (sq_pos_of_pos ha)).2 - linarith + linear_combination hvariance have hbasepos : 0 ≤ (ℓ / 2) * Real.exp (-η * a) / a ^ 2 := by positivity have hratio : Real.cosh (κ * a) / Real.cosh a ≤ Real.exp ((κ - 1) * a) := by - convert! cosh_ratio_upper ha.le + convert cosh_ratio_upper ha.le (sub_nonneg.mpr hκ) using 1; ring_nf have hexp : Real.exp ((η - 2) * a) * Real.exp ((κ - 1) * a) ≤ 1 := by rw [← Real.exp_add, Real.exp_le_one_iff] - linarith [mul_nonneg - (show 0 ≤ 3 - (κ + η) by linarith) ha.le] + linarith only [mul_nonneg (show 0 ≤ 3 - (κ + η) by linarith) ha.le, hκη, ha] have hcoefficient : (1 - 10 * ε * (1 + a)) * Real.exp ((η - 2) * a) * (Real.cosh (κ * a) / Real.cosh a) ≤ @@ -2266,7 +2278,7 @@ private theorem upperNegativeContour_shortMeasure_pointwise _ ≤ (1 - 10 * ε * (1 + a)) := by simpa only [mul_one] using! mul_le_mul_of_nonneg_left hexp hmargin _ ≤ 1 - 10 * ε := hmargintop - _ ≤ 1 - 4 * ε := by linarith + _ ≤ 1 - 4 * ε := by linarith only [hε] have hidentity : ℓ * (-shortShellDensity ε a) * Real.cosh (κ * a) = ((1 - 10 * ε * (1 + a)) * Real.exp ((η - 2) * a) * @@ -2319,7 +2331,7 @@ private theorem upperNegativeContour_shortDamping_le_gamma have ha₀ : 0 < a₀ := by try dsimp [a₀] positivity - have hfactor : 0 ≤ 1 - 4 * ε := by linarith + have hfactor : 0 ≤ 1 - 4 * ε := by linarith only [hεsmall] have hsubset : Ioc a₀ A ⊆ Ioi (0 : ℝ) := by intro a ha exact ha₀.trans ha.1 @@ -2335,7 +2347,7 @@ private theorem upperNegativeContour_shortDamping_le_gamma have hs := shortShellDensity_intervalIntegrable hε horder have hcosh : Continuous (fun a : ℝ => Real.cosh (κ * a)) := by - fun_prop + exact Continuous.comp' Real.continuous_cosh (Continuous.const_mul continuous_id' κ) have hosc : Continuous (fun a : ℝ => 1 - Real.cos (a * T)) := by fun_prop @@ -2454,7 +2466,7 @@ private theorem one_le_saddleNegativeContourOrdinate unfold saddleNegativeContourOrdinate have hN : 0 ≤ (N : ℝ) := Nat.cast_nonneg N have hq : 0 ≤ (2 * (N : ℝ) + 1) / ℓ := by positivity - linarith + linear_combination hq private theorem saddleNegativeContourOrdinate_add_rate_le_three {ℓ : ℝ} (hℓ : 0 < ℓ) (N : ℕ) @@ -2465,7 +2477,7 @@ private theorem saddleNegativeContourOrdinate_add_rate_le_three have hratio : (4 * (N : ℝ) + 4) / ℓ ≤ 2 := by apply (div_le_iff₀ hℓ).2 norm_num [Nat.cast_add, Nat.cast_one] at hN - linarith + linarith only [hN] calc 1 + (2 * (N : ℝ) + 1) / ℓ + (2 * (N : ℝ) + 3) / ℓ = @@ -2534,7 +2546,7 @@ private theorem upperNegativeContour_reflectedGamma_damping_exp_le_cosh have hinverse : Real.exp (2 * D) * Real.exp (-D) ^ 2 = 1 := by rw [pow_two, ← Real.exp_add, ← Real.exp_add] - convert! Real.exp_zero using 1; ring_nf + convert Real.exp_zero using 1; ring_nf change Real.exp (2 * D) ≤ Real.cosh (Real.pi * (s / 2)) calc Real.exp (2 * D) = Real.exp (2 * D) * 1 := by ring @@ -2605,7 +2617,7 @@ private theorem upperNegativeHalfGamma_reflection_norm ring _ = Real.pi / Real.cosh (Real.pi * (s / 2)) := by try dsimp [z] - convert! norm_gamma_half_add_imaginary_sq (s / 2) + convert norm_gamma_half_add_imaginary_sq (s / 2) using 1 | succ N ih => let z : ℂ := @@ -2622,7 +2634,7 @@ private theorem upperNegativeHalfGamma_reflection_norm zero_div, mul_zero, sub_self, add_zero, Complex.zero_re, z] at h have hN : 0 ≤ (N : ℝ) := Nat.cast_nonneg N - linarith + linarith only [h] have harg : upperNegativeHalfGammaArgument (N + 1) s = -z := by unfold upperNegativeHalfGammaArgument @@ -2714,14 +2726,14 @@ private theorem upperNegativeHalfGamma_norm_eq_reflected_damping rw [Real.exp_neg] at href field_simp [hΓ.ne', (Real.exp_pos D).ne', (Real.cosh_pos (Real.pi * (s / 2))).ne'] at href ⊢ - simpa [D, neg_div, mul_comm, mul_left_comm, mul_assoc] using! href + simpa only [D, neg_div, mul_comm, mul_left_comm, mul_assoc] using! href private theorem upper_log_cosh_ge_abs_sub_log_two (x : ℝ) : |x| - Real.log 2 ≤ Real.log (Real.cosh x) := by have hhalf : Real.exp |x| / 2 ≤ Real.cosh x := by rw [← Real.cosh_abs, Real.cosh_eq] have hp := (Real.exp_pos (-|x|)).le - linarith + linarith only [hp] apply Real.exp_le_exp.mp rw [Real.exp_log (Real.cosh_pos x), Real.exp_sub, Real.exp_log (by norm_num : (0 : ℝ) < 2)] @@ -2766,12 +2778,11 @@ private theorem upperNegativeContour_gamma_mul_exp_short_le exact hreflect have hlog := upper_log_cosh_ge_abs_sub_log_two (Real.pi * (s / 2)) - have hfactor : 0 ≤ 2 - 4 * ε := by linarith + have hfactor : 0 ≤ 2 - 4 * ε := by linarith only [hε, hεsmall] have hphase : (2 - 4 * ε) * D - Real.log C ≤ -(2 * ε) * Real.log C := by - linarith [mul_nonneg hfactor - (show 0 ≤ Real.log C - 2 * D by linarith)] + linarith only [mul_nonneg hfactor (show 0 ≤ Real.log C - 2 * D by linarith), hDlog, hfactor] have hlogphase : -(2 * ε) * Real.log C ≤ 2 * ε * Real.log 2 - ε * Real.pi * |s| := by @@ -2831,11 +2842,25 @@ private theorem upperNegativeContour_gamma_mul_exp_short_le (Real.exp ((2 - 4 * ε) * D) / C) := by ring _ ≤ (Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp (-(2 * ε) * Real.log C) := by - gcongr + exact mul_le_mul_of_nonneg_left (Real.exp_monotone hphase) + (le_of_lt + (div_pos Real.pi_pos + (Real.Gamma_pos_of_pos + (Right.add_pos_of_nonneg_of_pos (Nat.cast_nonneg' N) + (div_pos + ((by norm_num)) + (zero_lt_two)))))) _ ≤ (Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp (2 * ε * Real.log 2 - ε * Real.pi * |s|) := by - gcongr + exact mul_le_mul_of_nonneg_left (Real.exp_monotone hlogphase) + (le_of_lt + (div_pos Real.pi_pos + (Real.Gamma_pos_of_pos + (Right.add_pos_of_nonneg_of_pos (Nat.cast_nonneg' N) + (div_pos + ((by norm_num)) + (zero_lt_two)))))) _ = (Real.pi / Real.Gamma ((N : ℝ) + 3 / 2)) * Real.exp (2 * ε * Real.log 2) * Real.exp (-ε * Real.pi * |s|) := by @@ -2893,8 +2918,8 @@ private theorem saddleNegativeContourOrdinate_le_two have hratio : (2 * (N : ℝ) + 1) / ℓ ≤ 1 := by apply (div_le_iff₀ hℓ).2 norm_num [Nat.cast_add, Nat.cast_one] at hN - linarith - linarith + linear_combination hN + linear_combination hratio private theorem upperNegativeContour_gamma_mul_shellExponential_le {ε ℓ : ℝ} @@ -2967,10 +2992,10 @@ private theorem upperNegativeContour_gamma_mul_shellExponential_le Real.exp (ℓ * realHyperbolicShellPhase ε κ) * Real.exp (-(P - S)) := by rw [realHyperbolicShellPhase_neg] at hshell - convert! hshell using 1 + convert hshell using 1 have hexp : Real.exp (-(P - S)) ≤ Real.exp S := by apply Real.exp_le_exp.mpr - linarith + linear_combination hP rw [saddleTaylorContour_gammaArgument, saddleTaylorContour_shellArgument hℓ N s, norm_mul, hshell'] @@ -3029,7 +3054,7 @@ private theorem norm_plusPolynomial_negativeContour_le have hℓone : 1 ≤ ℓ := by norm_num [Nat.cast_add, Nat.cast_one] at hN have hcast : 0 ≤ (N : ℝ) := Nat.cast_nonneg N - linarith + linarith only [hN] have hdivide : |s| / ℓ ≤ |s| := (div_le_self (abs_nonneg s) hℓone) have hnorm : @@ -3046,13 +3071,13 @@ private theorem norm_plusPolynomial_negativeContour_le simp only [Complex.ofReal_div, Complex.ofReal_neg, Complex.norm_div, norm_neg, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hℓ, mul_neg, Complex.norm_mul, Complex.norm_I, - abs_of_nonneg (show 0 ≤ κ by linarith), + abs_of_nonneg (show 0 ≤ κ by linarith only [hκ]), one_mul] have hbase : 1 + ‖((-s / ℓ : ℝ) : ℂ) + Complex.I * (((-κ : ℝ) : ℂ))‖ ≤ 3 * (1 + |s|) := by - linarith [abs_nonneg s] + linarith only [abs_nonneg s, hκtop, hdivide, hnorm] rw [saddleTaylorContour_shellArgument hℓ N s] calc ‖plusPolynomial ε @@ -3717,7 +3742,7 @@ private theorem eventually_plusSaddleTaylorRemainder_relative_lt_half_on_star (Kε * Real.sqrt y * y ^ N / Real.Gamma ((N : ℝ) + 3 / 2) * Real.exp (saddleNegativeContourPhaseError ε ℓ N)) := by - gcongr + exact mul_le_mul_of_nonneg_left hrelative (le_of_lt (Real.exp_pos y)) _ ≤ Real.exp y * (Kε * Real.sqrt y * y ^ N / Real.Gamma ((N : ℝ) + 3 / 2) * @@ -3775,7 +3800,7 @@ private theorem eventually_plusSaddleProfile_re_pos_on_star : hε (le_of_lt hεsmall) horder intro a ha have h := hmargin a ha - linarith + linear_combination h end @@ -3832,7 +3857,7 @@ private theorem saddleRealCpow_hasDerivAt intro heq have hre := congrArg Complex.re heq norm_num at hre - linarith + linarith only [hz, hre] simpa only [Complex.ofReal_zero, Complex.zero_cpow hsub, mul_zero] using! saddleRealCpow_hasDerivAt_zero hz · exact hasDerivAt_ofReal_cpow_const hx hz0 @@ -3857,12 +3882,12 @@ private theorem saddlePositiveCpow_hasDerivAt_zero norm_num at hz have hsub : 0 < (z - 1).re := by change 0 < z.re - 1 - linarith + linarith only [hz] have hsub0 : z - 1 ≠ 0 := by intro heq have hre := congrArg Complex.re heq norm_num at hre - linarith + linarith only [hz, hre] rw [hasDerivAt_iff_tendsto_slope_zero] have htend : Tendsto (saddlePositiveCpow (z - 1)) @@ -3901,7 +3926,7 @@ private theorem saddlePositiveCpow_hasDerivAt intro heq have hre := congrArg Complex.re heq norm_num at hre - linarith + linarith only [hz, hre] rcases lt_trichotomy x 0 with hneg | hzero | hpos · have hevent : saddlePositiveCpow z =ᶠ[𝓝 x] @@ -4043,7 +4068,7 @@ private theorem saddlePositiveContourPower_frequency_continuous have hpositive : 0 < (saddleContourExponent a t - (j : ℂ)).re := by rw [saddleContourExponent_sub_nat_re] - linarith + linear_combination ha simpa only [Complex.sub_re, saddleContourExponent_re, Complex.natCast_re, Complex.zero_re, ne_eq] using! hpositive.ne' @@ -4065,10 +4090,10 @@ private theorem saddlePositiveContourMoment_hasDerivAt exact saddlePolynomialWeightedData_integrable hD (saddleContourFallingPolynomial a k) have hjpos : (j : ℝ) < -a / 2 := by - linarith + linear_combination ha have hsuccpos : ((j + 1 : ℕ) : ℝ) < -a / 2 := by push_cast - linarith + exact ha have hkernel (k : ℕ) (hk : (k : ℝ) < -a / 2) (v : ℝ) : AEStronglyMeasurable @@ -4094,10 +4119,10 @@ private theorem saddlePositiveContourMoment_hasDerivAt ‖saddlePositiveCpow (saddleContourExponent a t - (j : ℂ)) v‖ * ‖W j t‖ ≤ 1 * ‖W j t‖ := by - gcongr + refine mul_le_mul_of_nonneg_right ?_ (norm_nonneg (W j t)) apply saddlePositiveCpow_norm_le_one · rw [saddleContourExponent_sub_nat_re] - linarith + linear_combination ha · exact hv _ = ‖W j t‖ := one_mul _ have hdiff (t v : ℝ) @@ -4113,7 +4138,7 @@ private theorem saddlePositiveContourMoment_hasDerivAt have hreal : 1 < (saddleContourExponent a t - (j : ℂ)).re := by rw [saddleContourExponent_sub_nat_re] - linarith + linear_combination ha have hderiv := (saddlePositiveCpow_hasDerivAt hreal v).mul_const (W j t) @@ -4129,7 +4154,7 @@ private theorem saddlePositiveContourMoment_hasDerivAt rw [saddleContourFallingPolynomial_eval_succ] ring rw [harg, hfall] - convert! hderiv using 1 + convert hderiv using 1 all_goals ring have hresult := _root_.hasDerivAt_integral_of_dominated_loc_of_deriv_le @@ -4157,7 +4182,7 @@ private theorem saddlePositiveContourMoment_hasDerivAt ((j + 1 : ℕ) : ℂ)) v‖ * ‖W (j + 1) t‖ ≤ 1 * ‖W (j + 1) t‖ := by - gcongr + refine mul_le_mul_of_nonneg_right ?_ (norm_nonneg (W (j + 1) t)) apply saddlePositiveCpow_norm_le_one · rw [saddleContourExponent_sub_nat_re] exact sub_pos.mpr hsuccpos @@ -4205,11 +4230,11 @@ private theorem saddlePositiveContourMoment_contDiffOn have hj : (j : ℝ) + 1 < -a / 2 := by push_cast at ha have hn : (0 : ℝ) ≤ (n : ℝ) := Nat.cast_nonneg n - linarith + linarith only [ha] have hnext : (n : ℝ) + ((j + 1 : ℕ) : ℝ) + 1 < -a / 2 := by push_cast at ha ⊢ - linarith + linear_combination ha rw [show (↑(n + 1) : WithTop ℕ∞) = (↑n : WithTop ℕ∞) + 1 by simp only [Nat.cast_add, Nat.cast_one], contDiffOn_succ_iff_deriv_of_isOpen isOpen_Ioo] @@ -4259,7 +4284,7 @@ private theorem saddleMellinInversePower_eq_squaredPositiveCpow have hpositive : 0 < (saddleContourExponent a t - (j : ℂ)).re := by rw [saddleContourExponent_sub_nat_re] - linarith + linear_combination ha simpa only [Complex.sub_re, saddleContourExponent_re, Complex.natCast_re, Complex.zero_re, ne_eq] using! hpositive.ne' simp only [saddlePositiveCpow, max_self, Complex.ofReal_zero, Complex.zero_cpow hexp, zero_mul] @@ -4398,7 +4423,7 @@ private theorem saddleTaylorContour_smoothShift (n : ℕ) : -(saddleTaylorContour (n + 2)) / 2 := by simp only [saddleTaylorContour, neg_neg] push_cast - linarith + linarith only [] private theorem SaddleSign.saddleFunction_contDiff_nat (s : SaddleSign) {ε : ℝ} (hε : 0 < ε) @@ -4717,7 +4742,7 @@ private theorem saddlePositiveContourMoment_hasDerivAt_of_positiveContour (saddleContourExponent a t - (k : ℂ)).re ≤ 0 := by rw [saddleContourExponent_sub_nat_re] have hk : (0 : ℝ) ≤ k := Nat.cast_nonneg k - linarith + linarith only [ha] have hpoint (v : ℝ) (hv : v ∈ Set.Ioi (1 : ℝ)) : Integrable @@ -4733,7 +4758,7 @@ private theorem saddlePositiveContourMoment_hasDerivAt_of_positiveContour ‖saddlePositiveCpow (saddleContourExponent a t - (j : ℂ)) v‖ * ‖W j t‖ ≤ 1 * ‖W j t‖ := by - gcongr + refine mul_le_mul_of_nonneg_right ?_ (norm_nonneg (W j t)) exact saddlePositiveCpow_norm_le_one_of_nonpos (hpower j t) hv _ = ‖W j t‖ := one_mul _ @@ -4753,7 +4778,7 @@ private theorem saddlePositiveContourMoment_hasDerivAt_of_positiveContour rw [saddleContourExponent_sub_nat_re] have hk : (0 : ℝ) ≤ j := Nat.cast_nonneg j have hneg : -a / 2 - (j : ℝ) < 0 := by - linarith + linarith only [ha] simpa only [Complex.zero_re, ne_eq] using! hneg.ne have hderiv := (saddlePositiveCpow_hasDerivAt_of_pos @@ -4771,7 +4796,7 @@ private theorem saddlePositiveContourMoment_hasDerivAt_of_positiveContour rw [saddleContourFallingPolynomial_eval_succ] ring rw [harg, hfall] - convert! hderiv using 1 + convert hderiv using 1 all_goals ring have hmeas : ∀ᶠ v in 𝓝 u, @@ -4807,7 +4832,7 @@ private theorem saddlePositiveContourMoment_hasDerivAt_of_positiveContour ((j + 1 : ℕ) : ℂ)) v‖ * ‖W (j + 1) t‖ ≤ 1 * ‖W (j + 1) t‖ := by - gcongr + refine mul_le_mul_of_nonneg_right ?_ (norm_nonneg (W (j + 1) t)) exact saddlePositiveCpow_norm_le_one_of_nonpos (hpower (j + 1) t) hv _ = ‖W (j + 1) t‖ := one_mul _)) @@ -5017,13 +5042,13 @@ private theorem SaddleSign.outerSquaredProfile_contDiff (s : SaddleSign) change v < 2 at hv have hvzero : Real.smoothTransition (v - 2) = 0 := - Real.smoothTransition.zero_of_nonpos (by linarith) + Real.smoothTransition.zero_of_nonpos (by linear_combination hv) simp only [SaddleSign.outerSquaredProfile, saddleOuterCutoff, hvzero, Complex.ofReal_zero, zero_mul] exact contDiffAt_const.congr_of_eventuallyEq hevent · have hone : u ∈ Set.Ioi (1 : ℝ) := by change 1 < u - linarith + linarith only [hu] have hcontour : ContDiffAt ℝ ∞ (s.positiveSquaredContour ε ℓ 2) u := @@ -5036,7 +5061,7 @@ private theorem SaddleSign.outerSquaredProfile_eq_zero (s : SaddleSign) (ε ℓ : ℝ) {u : ℝ} (hu : u < 2) : s.outerSquaredProfile ε ℓ u = 0 := by have hcut : Real.smoothTransition (u - 2) = 0 := - Real.smoothTransition.zero_of_nonpos (by linarith) + Real.smoothTransition.zero_of_nonpos (by linear_combination hu) simp only [SaddleSign.outerSquaredProfile, saddleOuterCutoff, hcut, Complex.ofReal_zero, zero_mul] private theorem SaddleSign.outerSquaredProfile_eq_positiveContour (s : SaddleSign) @@ -5047,12 +5072,12 @@ private theorem SaddleSign.outerSquaredProfile_eq_positiveContour (s : SaddleSig s.outerSquaredProfile ε ℓ u = s.positiveSquaredContour ε ℓ a u := by have hcut : Real.smoothTransition (u - 2) = 1 := - Real.smoothTransition.one_of_one_le (by linarith) + Real.smoothTransition.one_of_one_le (by linear_combination hu) unfold SaddleSign.outerSquaredProfile saddleOuterCutoff rw [hcut] norm_num exact s.positiveSquaredContour_eq_of_pos - hε hℓ horder (by norm_num) ha (by linarith) + hε hℓ horder (by norm_num) ha (by linear_combination hu) private theorem saddleOuterSquaredProfile_schwartz_decay {G : ℝ → ℂ} @@ -5113,12 +5138,12 @@ private theorem saddleOuterSquaredProfile_schwartz_decay ((le_max_left B (‖c‖ * L)).trans (le_max_right 0 _)) · have hu4 : (4 : ℝ) < u := lt_of_not_ge hupper - have hu3 : (3 : ℝ) < u := by linarith - have hu0 : (0 : ℝ) < u := by linarith - have hu1 : (1 : ℝ) ≤ u := by linarith + have hu3 : (3 : ℝ) < u := by linarith only [hupper] + have hu0 : (0 : ℝ) < u := by linarith only [hupper] + have hu1 : (1 : ℝ) ≤ u := by linarith only [hupper] have huoi : u ∈ Set.Ioi (1 : ℝ) := by change 1 < u - linarith + linarith only [hupper] have hevent : G =ᶠ[𝓝 u] (fun v : ℝ => @@ -5143,7 +5168,7 @@ private theorem saddleOuterSquaredProfile_schwartz_decay try dsimp [a] push_cast have hn : (0 : ℝ) ≤ (n : ℝ) := Nat.cast_nonneg n - linarith + linarith only [] have hpower : u ^ (-a / 2 - (n : ℝ)) ≤ u ^ (-(k : ℝ)) := @@ -5165,7 +5190,13 @@ private theorem saddleOuterSquaredProfile_schwartz_decay _ ≤ u ^ k * (‖c‖ * (u ^ (-a / 2 - (n : ℝ)) * L)) := by - gcongr + exact mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left hmoment (norm_nonneg c)) + (le_of_lt + (pow_pos + (lt_trans + ((by norm_num)) + hu4) + k)) _ ≤ u ^ k * (‖c‖ * (u ^ (-(k : ℝ)) * L)) := by gcongr @@ -5256,9 +5287,9 @@ private theorem SaddleSign.outerDifference_hasCompactSupport (s : SaddleSign) by_contra hnot apply houtside exact mem_closedBall_zero_iff.mpr (le_of_not_gt hnot) - have hr : 0 < ‖x‖ := by linarith + have hr : 0 < ‖x‖ := by linear_combination hr2 have hsquare : (3 : ℝ) < ‖x‖ ^ 2 := by - linarith [sq_nonneg (‖x‖ - 2)] + linarith only [sq_nonneg (‖x‖ - 2), hr2] change s.profile ε ℓ ‖x‖ - s.outerSchwartz hε hℓ horder d x ≠ 0 at hx @@ -5345,7 +5376,7 @@ private noncomputable def saddleSourceContourDamping private theorem saddleSourceContourEnvelopeScale_pos {ε ℓ u : ℝ} (hℓ : 0 < ℓ) (hu : -1 < u) : 0 < saddleSourceContourEnvelopeScale ε ℓ u := by - have hη : 0 < 1 + u := by linarith + have hη : 0 < 1 + u := by linear_combination hu unfold saddleSourceContourEnvelopeScale exact mul_pos (mul_pos (Real.exp_pos _) @@ -5379,7 +5410,7 @@ private theorem saddleSourceContour_gamma_norm Real.exp (-upperGammaDamping ℓ (1 + u) T) := by rw [saddleSourceMellinContour_gammaArgument] exact upperGammaShifted_modulus_eq_exp_neg_damping - hℓ (by linarith) T + hℓ (by linear_combination hu) T private theorem saddleSourceContour_shellExponential_norm {ε ℓ u : ℝ} @@ -5575,8 +5606,8 @@ private theorem SaddleSign.profile_eq_sourceContourIntegral (s : SaddleSign) s.mellinData ε ℓ (saddleSourceMellinContour ℓ u T)) := by have ha : 0 < ℓ * (1 + u) := by - have hη : 0 < 1 + u := by linarith - positivity + have hη : 0 < 1 + u := by linear_combination hu + exact mul_pos hℓ hη rw [s.profile_eq_positive_contour (a := ℓ * (1 + u)) hε hℓ horder hr ha] rw [saddleSourceMellinContour_integral_change @@ -5820,7 +5851,7 @@ private theorem eventually_saddleSourceGaussianVariance_secondBranch_pos : filter_upwards [eventually_upperSaddleVariance_pos] with ε hpositive intro ℓ hℓ δ hδ - convert! hpositive ℓ hℓ δ hδ using 1 + convert hpositive ℓ hℓ δ hδ using 1 all_goals simp only [saddleSourceGaussianVariance, add_sub_cancel_left] private theorem plusSaddleProfile_exp_re_pos_of_gaussian_error @@ -5851,7 +5882,7 @@ private theorem plusSaddleProfile_exp_re_pos_of_gaussian_error have := (neg_le_of_abs_le hreal) exact this rw [Complex.sub_re] at hlower - linarith + linarith only [herror, hlower] rw [plusSaddleProfile_exp_eq_centeredIntegral hε hℓ hu horder v] change 0 < @@ -5889,7 +5920,7 @@ private theorem minusSaddleProfile_exp_re_neg_of_gaussian_error have hupper : (J - G).re ≤ ‖J - G‖ := (le_abs_self _).trans hreal rw [Complex.sub_re] at hupper - linarith + linarith only [herror, hupper] rw [minusSaddleProfile_exp_eq_centeredIntegral hε hℓ hu horder v] change @@ -5905,7 +5936,7 @@ private theorem saddleSourcePositiveShellVariance_nonneg 0 ≤ upperPositiveShellVariance ε δ := by unfold upperPositiveShellVariance apply intervalIntegral.integral_nonneg - (show (ε⁻¹ ^ 3) ≤ (ε⁻¹ ^ 3) + 1 by linarith) + (show (ε⁻¹ ^ 3) ≤ (ε⁻¹ ^ 3) + 1 by linarith only []) intro a ha unfold positiveShellDensity exact mul_nonneg @@ -5933,12 +5964,12 @@ private theorem upperFirstBranch_shortVariance_le_gamma a ^ 2 * upperGammaMeasureDensity ℓ η a have hη : 0 < η := by try dsimp [η] - linarith + linarith only [hulower] have ha₀ : 0 < a₀ := by try dsimp [a₀] positivity have hfactor : 0 ≤ 1 - 4 * ε := by - linarith + linarith only [hεsmall] have hsubset : Ioc a₀ A ⊆ Ioi (0 : ℝ) := by intro a ha exact ha₀.trans ha.1 @@ -5953,9 +5984,9 @@ private theorem upperFirstBranch_shortVariance_le_gamma have hs := shortShellDensity_intervalIntegrable hε horder have hcosh : Continuous (fun a : ℝ => Real.cosh (u * a)) := by - fun_prop + exact Continuous.comp' Real.continuous_cosh (Continuous.const_mul continuous_id' u) have hsquare : Continuous (fun a : ℝ => a ^ 2) := by - fun_prop + exact Continuous.fun_pow continuous_id' 2 have hshortInterval : IntervalIntegrable (fun a : ℝ => ℓ * (-shortShellDensity ε a) * @@ -5986,7 +6017,7 @@ private theorem upperFirstBranch_shortVariance_le_gamma (hmargin a ⟨ha.1.le, ha.2⟩) have hmul := mul_le_mul_of_nonneg_right hcomparison (sq_nonneg a) - simpa [γ, η, mul_assoc, mul_left_comm, mul_comm] using! hmul + simpa only [γ, η, mul_assoc, mul_left_comm, mul_comm] using! hmul have hmono := setIntegral_mono_on hshortOn hscaledOn measurableSet_Ioc hpoint have hnonnegative : @@ -6063,7 +6094,7 @@ private theorem upperFirstBranch_saddleSourceGaussianVariance_lower_bound upperSaddleVariance upperNetShellVariance have hη : 2 + (u - 1) = 1 + u := by ring rw [hη] - linarith + linarith only [hshort, hpositive] private theorem eventually_saddleSourceGaussianVariance_firstBranch_pos : ∀ᶠ ε : ℝ in 𝓝[>] (0 : ℝ), @@ -6086,7 +6117,7 @@ private theorem eventually_saddleSourceGaussianVariance_firstBranch_pos : with ε hε hεsmall horder hmargin change 0 < ε at hε intro ℓ hℓ u hulower huupper - have hη : 0 < 1 + u := by linarith + have hη : 0 < 1 + u := by linear_combination hulower have hgamma := (upperGammaVariance_bounds hℓ hη).1 have hgammaPos : 0 < upperGammaVariance ℓ (1 + u) := @@ -6132,8 +6163,8 @@ private theorem SaddleSign.centeredIntegrand_integrable (s : SaddleSign) saddleSourceContourEnvelopeScale ε ℓ u : ℝ) : ℂ) have ha : 0 < a := by try dsimp [a] - have : 0 < 1 + u := by linarith - positivity + have : 0 < 1 + u := by linear_combination hu + exact mul_pos hℓ this have hline := s.mellinData_shiftedLine_weighted_integrable (a := a) (r := Real.exp v) @@ -6442,7 +6473,7 @@ private theorem upperImaginaryExp_quadratic_remainder_norm_le rw [hconj, Complex.norm_conj] _ ≤ (-x) ^ 3 / 6 := upperImaginaryExp_quadratic_remainder_norm_le_of_nonneg - (by linarith) + (by linarith only [hx]) _ = |x| ^ 3 / 6 := by rw [abs_of_neg hxnegative] @@ -6658,7 +6689,7 @@ private theorem saddleSourcePositiveShellQuadraticRemainder_norm_le have hbound := saddleSourceWeightedCosineQuadraticRemainder_norm_le (positiveShellDensity ε) - (show (ε⁻¹ ^ 3) ≤ (ε⁻¹ ^ 3) + 1 by linarith) + (show (ε⁻¹ ^ 3) ≤ (ε⁻¹ ^ 3) + 1 by linarith only []) hB (positiveShellDensity_continuous ε).continuousOn (fun a ha => by @@ -6666,7 +6697,7 @@ private theorem saddleSourcePositiveShellQuadraticRemainder_norm_le exact div_nonneg (shellWeight_pos ε).le (Real.cosh_pos a).le) u T - convert! hbound using 1 + convert hbound using 1 unfold upperPositiveShellThirdMoment congr 1 apply intervalIntegral.integral_congr @@ -6730,7 +6761,7 @@ private theorem saddleSourceShortShellQuadraticRemainder_norm_le ring rw [heq, norm_neg] rw [hnorm] - convert! hbound using 1 + convert hbound using 1 unfold upperShortShellThirdMoment congr 1 apply intervalIntegral.integral_congr @@ -6775,7 +6806,10 @@ private theorem saddleSourceWeightedCosineQuadraticRemainder_integral_eq Complex.cos ((a : ℂ) * ((T : ℂ) + Complex.I * (u : ℂ))) - 1) := by - fun_prop + exact Continuous.fun_sub + (Continuous.comp' Complex.continuous_cos + (Continuous.comp' (continuous_mul_const (↑T + Complex.I * ↑u)) Complex.continuous_ofReal)) + continuous_const have hF : IntervalIntegrable F volume b c := (hwc.mul hkernel.continuousOn).intervalIntegrable_of_Icc hbc @@ -6919,7 +6953,7 @@ private theorem saddleSourceShellQuadraticRemainder_eq saddleSourceWeightedCosineQuadraticRemainder_integral_eq (positiveShellDensity ε) (show (ε⁻¹ ^ 3) ≤ (ε⁻¹ ^ 3) + 1 by - linarith) + linarith only []) (positiveShellDensity_continuous ε).continuousOn u T have hvariance : (∫ a in (ε ^ 3)..(10 * Real.log (1 / ε)),