From c1cabfd5a66380143891085980d5d20ba47f4c56 Mon Sep 17 00:00:00 2001 From: Vasily Ilin Date: Tue, 20 Oct 2026 22:52:35 +0000 Subject: [PATCH] Optimize LeanModularForms proof elaboration --- .../ContourIntegral/CrossingLimit.lean | 16 +- .../ContourIntegral/PVSplit.lean | 26 +- .../ContourIntegral/SegmentFTC.lean | 2 +- .../LeanModularForms/ForMathlib/Bounds.lean | 4 - .../ForMathlib/IsBoundedAtImInfty.lean | 6 - .../LeanModularForms/ForMathlib/LevelOne.lean | 4 - .../GeneralizedResidueTheory/ArcCalculus.lean | 25 +- .../GeneralizedResidueTheory/Basic.lean | 4 +- .../CauchyPrimitive.lean | 16 +- .../GeneralizedResidueTheorem.lean | 4 +- .../HomologicalCauchy/DixonProof.lean | 70 ++-- .../HomologicalCauchy/Meromorphic.lean | 2 +- .../Homotopy/Integrality.lean | 16 +- .../Homotopy/Invariance.lean | 2 +- .../Homotopy/ParametricDiff.lean | 5 +- .../GeneralizedResidueTheory/LogDerivFTC.lean | 5 +- .../OnCurvePV/Basic.lean | 31 +- .../PVInfrastructure/AnnulusBounds.lean | 28 +- .../PVInfrastructure/GammaAnalysis.lean | 10 +- .../PVInfrastructure/RemainderAnalysis.lean | 10 +- .../PVInfrastructure/SingularAnnulus.lean | 44 +-- .../PVInfrastructure/StepBounds.lean | 38 ++- .../PVInfrastructure/UniformStepBound.lean | 13 +- .../PiecewiseCurveAPI.lean | 4 +- .../PrincipalValue.lean | 9 +- .../GeneralizedResidueTheory/Residue.lean | 28 +- .../Residue/Flatness.lean | 14 +- .../FlatnessTransfer/BoundaryVanishing.lean | 17 +- .../CutoffInfrastructure.lean | 29 +- .../FlatnessTransfer/HigherOrderAssembly.lean | 2 +- .../FlatnessTransfer/PerTermVanishing.lean | 9 +- .../PerTermVanishing/CPVHelpers.lean | 5 +- .../Residue/GeneralizedTheorem.lean | 1 - .../Residue/GeneralizedTheoremBase.lean | 20 +- .../Residue/MultipointPV.lean | 14 +- .../MultipointPV/DominatedConvergence.lean | 20 +- .../Residue/SectorCurve.lean | 29 +- .../Residue/SectorCurveLemma.lean | 84 +++-- .../WindingNumber/CrossingAnalysis.lean | 37 ++- .../WindingNumber/Decomposition.lean | 6 +- .../WindingNumber/Defs.lean | 2 +- .../WindingNumber/Proposition22.lean | 12 +- .../AbstractHeckeRing/Commutativity.lean | 1 - .../HeckeRIngs/AbstractHeckeRing/Degree.lean | 1 - .../HeckeRIngs/AbstractHeckeRing/Module.lean | 2 +- .../AbstractHeckeRing/Multiplication.lean | 5 +- .../HeckeRIngs/AbstractHeckeRing/Ring.lean | 1 - .../HeckeRIngs/GL2/Basic.lean | 1 - .../HeckeRIngs/GL2/Degree.lean | 4 +- .../HeckeRIngs/GL2/HeckeAction.lean | 2 +- .../HeckeRIngs/GL2/HeckeModularForm.lean | 3 +- .../HeckeRIngs/GL2/MultiplicationTable.lean | 3 +- .../HeckeRIngs/GLn/Basic.lean | 5 +- .../HeckeRIngs/GLn/CoprimeMul.lean | 5 +- .../HeckeRIngs/GLn/Degree.lean | 2 +- .../HeckeRIngs/GLn/DiagonalCosets.lean | 12 +- .../HeckeRIngs/GLn/SLnTransvection.lean | 10 +- .../Modularforms/ClogArgLems.lean | 2 +- .../Modularforms/Cotangent.lean | 4 - .../Modularforms/Derivative.lean | 34 +- .../Modularforms/DimensionFormulas.lean | 9 +- .../Modularforms/Eisenstein.lean | 4 +- .../Modularforms/EisensteinAsymptotics.lean | 18 +- .../Modularforms/Eisensteinqexpansions.lean | 4 +- .../LeanModularForms/Modularforms/Eta.lean | 4 +- .../Modularforms/EtaCleanup.lean | 33 +- .../Modularforms/Generators/Defs.lean | 8 +- .../Modularforms/Generators/Injectivity.lean | 17 +- .../Modularforms/Generators/Surjectivity.lean | 6 +- .../Modularforms/IsCuspForm.lean | 2 +- .../Modularforms/Iteratedderivs.lean | 20 +- .../Modularforms/JacobiTheta.lean | 27 +- .../Modularforms/LogDerivLems.lean | 7 +- .../Modularforms/RamanujanIdentities.lean | 10 +- .../Modularforms/ResToImagAxis.lean | 11 +- .../Modularforms/SlashActionAuxil.lean | 3 +- .../Modularforms/SummableLems.lean | 64 ++-- .../Modularforms/ThetaDerivIdentities.lean | 8 +- .../Modularforms/TsumderivWithin.lean | 14 +- .../SpherePacking/CuspDecay.lean | 36 ++- .../SpherePacking/PhiHolomorphic.lean | 3 +- .../SpherePacking/ViazovskaMagicFunction.lean | 80 ++--- .../ValenceFormula/Boundary/Basic.lean | 14 +- .../ValenceFormula/Boundary/Bounds.lean | 46 +-- .../ValenceFormula/Boundary/Smooth.lean | 42 ++- .../Boundary/Winding/Framework.lean | 2 +- .../Boundary/Winding/LeftEdge.lean | 128 +++++--- .../Boundary/Winding/RightEdge.lean | 128 ++++---- .../Boundary/Winding/UnitArc.lean | 105 +++--- .../Boundary/Winding/UnitArcHelpers.lean | 105 +++--- .../ValenceFormula/CoreIdentity.lean | 38 ++- .../ValenceFormula/InteriorWinding.lean | 21 +- .../ValenceFormula/ModularInvariance.lean | 24 +- .../ValenceFormula/OnCurvePV/Basic.lean | 3 +- .../OnCurvePV/EndpointCorner.lean | 42 ++- .../ValenceFormula/OnCurvePV/Main.lean | 303 ++++++++++-------- .../ValenceFormula/OrbitPairing.lean | 11 +- .../ValenceFormula/OrbitSum.lean | 13 +- .../ValenceFormula/PVChain.lean | 4 +- .../PVChain/ArcContribution.lean | 32 +- .../ValenceFormula/PVChain/Assembly.lean | 94 +++--- .../PVChain/Assembly/ResidueSide.lean | 31 +- .../ValenceFormula/PVChain/Helpers.lean | 33 +- .../PVChain/OnCurveCapture.lean | 44 +-- .../PVChain/ResidueSideInfra.lean | 67 ++-- .../PVChain/Seg5CuspIntegral.lean | 12 +- .../RectHomotopy/AngleAnalysis.lean | 90 +++--- .../BoundaryHomotopyDerivBounds.lean | 17 +- .../RectHomotopy/BoundaryHomotopySmooth.lean | 25 +- .../ValenceFormula/RectHomotopy/Geometry.lean | 18 +- .../RectHomotopy/HomotopyDef.lean | 25 +- .../RectHomotopy/MainTheoremBound.lean | 26 +- .../RectHomotopy/MainTheoremDerivCont.lean | 6 +- .../RectHomotopy/PolygonSlope.lean | 16 +- .../RectHomotopy/RadialHomotopy.lean | 75 +++-- .../RectHomotopy/WindingBase.lean | 163 ++++++---- .../ValenceFormula/TextbookExistence.lean | 4 +- .../ValenceFormula/TextbookForm.lean | 74 +++-- .../ValenceFormula/WindingWeights/Common.lean | 22 +- .../ValenceFormula/WindingWeights/I.lean | 190 ++++++----- .../ValenceFormula/WindingWeights/Rho.lean | 125 +++++--- .../WindingWeights/RhoPlusOne.lean | 151 +++++---- 122 files changed, 2074 insertions(+), 1503 deletions(-) diff --git a/LeanPool/LeanModularForms/ContourIntegral/CrossingLimit.lean b/LeanPool/LeanModularForms/ContourIntegral/CrossingLimit.lean index b263ad3441..60f852c6c8 100644 --- a/LeanPool/LeanModularForms/ContourIntegral/CrossingLimit.lean +++ b/LeanPool/LeanModularForms/ContourIntegral/CrossingLimit.lean @@ -124,9 +124,9 @@ theorem pv_tendsto_of_crossing_limit_asymmetric have hδR := hδR_pos ε hε_pos hε_lt have hδL_bd := hδL_small ε hε_pos hε_lt have hδR_bd := hδR_small ε hε_pos hε_lt - have h_left_lt : a < t₀ - δ_left ε := by linarith - have h_right_lt : t₀ + δ_right ε < b := by linarith - have h_mid_lt : t₀ - δ_left ε < t₀ + δ_right ε := by linarith + have h_left_lt : a < t₀ - δ_left ε := by linarith only [hδL_bd] + have h_right_lt : t₀ + δ_right ε < b := by linarith only [hδR_bd] + have h_mid_lt : t₀ - δ_left ε < t₀ + δ_right ε := by linarith only [hδL, hδR] -- Abbreviate the cutoff integrand set F := fun t => if ‖γ t - s‖ > ε then (γ t - s)⁻¹ * deriv γ t else (0 : ℂ) with hF_def -- F = 0 on the middle segment [t₀ - δL, t₀ + δR] @@ -155,7 +155,11 @@ theorem pv_tendsto_of_crossing_limit_asymmetric mem_ae_iff.mpr (by rw [compl_compl]; exact (Set.finite_singleton _).measure_zero volume) filter_upwards [h_ne] with t ht_ne ht_mem rw [uIoc_of_le (le_of_lt h_right_lt)] at ht_mem - simp_all + simp_all only [mem_Ioo, mem_Ico, and_imp, mem_Ioc, mem_Icc, tsub_le_iff_right, and_self, + gt_iff_lt, + ite_eq_right_iff, mul_eq_zero, inv_eq_zero, ite_eq_left_iff, not_lt, zero_eq_mul, + mem_compl_iff, mem_singleton_iff, + ↓reduceIte] -- Integrability of F on each piece have hF_int_left : IntervalIntegrable F volume a (t₀ - δ_left ε) := (hint_left ε hε_pos hε_lt).congr_ae @@ -189,7 +193,9 @@ theorem pv_tendsto_of_crossing_limit_asymmetric ∫ t in (t₀ + δ_right ε)..b, (γ t - s)⁻¹ * deriv γ t := intervalIntegral.integral_congr_ae hF_right -- Assemble - simp_all + simp_all only [mem_Ioo, mem_Ico, and_imp, mem_Ioc, mem_Icc, tsub_le_iff_right, and_self, + gt_iff_lt, + ite_eq_right_iff, mul_eq_zero, inv_eq_zero, ite_eq_left_iff, not_lt, zero_eq_mul, add_zero] exact h_limit.congr' h_ev.symm end ContourIntegral diff --git a/LeanPool/LeanModularForms/ContourIntegral/PVSplit.lean b/LeanPool/LeanModularForms/ContourIntegral/PVSplit.lean index ee82c060d3..758f9e7c2a 100644 --- a/LeanPool/LeanModularForms/ContourIntegral/PVSplit.lean +++ b/LeanPool/LeanModularForms/ContourIntegral/PVSplit.lean @@ -61,18 +61,18 @@ theorem pv_split_at_crossing {γ : ℝ → ℂ} {a b : ℝ} {s : ℂ} {ε δ : have hδ_lt_right : δ < b - t₀ := lt_of_lt_of_le hδ_small (min_le_right _ _) have ha_lt_t₀ : a < t₀ := ht₀.1 have ht₀_lt_b : t₀ < b := ht₀.2 - have h_left_lt : a < t₀ - δ := by linarith - have h_mid_lt : t₀ - δ < t₀ + δ := by linarith - have h_right_lt : t₀ + δ < b := by linarith + have h_left_lt : a < t₀ - δ := by linarith only [hδ_lt_left] + have h_mid_lt : t₀ - δ < t₀ + δ := by linarith only [hδ] + have h_right_lt : t₀ + δ < b := by linarith only [hδ_lt_right] -- F = 0 on the middle segment [t₀ - δ, t₀ + δ] have hF_mid : ∀ t ∈ uIoc (t₀ - δ) (t₀ + δ), F t = 0 := by intro t ht - rw [uIoc_of_le (by linarith)] at ht + rw [uIoc_of_le (by linarith only [hδ])] at ht simp only [hF_def] rw [ite_eq_right (not_lt.mpr _)] apply h_near rw [abs_le] - constructor <;> [linarith [ht.1]; linarith [ht.2]] + constructor <;> [linarith only [ht, ht.1]; linarith only [ht, ht.2]] -- F = (γ t - s)⁻¹ * deriv γ t a.e. on [a, t₀ - δ] -- (The single boundary point t = t₀ - δ is measure zero; for all other t in Ioc a (t₀-δ) -- we have |t - t₀| > δ strictly, so h_far applies.) @@ -85,10 +85,10 @@ theorem pv_split_at_crossing {γ : ℝ → ℂ} {a b : ℝ} {s : ℂ} {ε δ : simp only [hF_def] rw [ite_eq_left] -- ht : t ∈ Ioc a (t₀ - δ), t ≠ t₀ - δ, so t < t₀ - δ, giving |t - t₀| > δ - apply h_far t ⟨le_of_lt ht.1, le_trans ht.2 (by linarith)⟩ - rw [abs_of_nonpos (by linarith [ht.2])] + apply h_far t ⟨le_of_lt ht.1, le_trans ht.2 (by linarith only [hδ, hδ_lt_right])⟩ + rw [abs_of_nonpos (by linarith only [hδ, ht, ht.2])] have : t < t₀ - δ := lt_of_le_of_ne ht.2 (fun h => ht_ne (Set.mem_singleton_iff.mpr h)) - linarith + linarith only [this] -- F = (γ t - s)⁻¹ * deriv γ t a.e. on [t₀ + δ, b] have hF_right : ∀ᵐ t ∂volume, t ∈ uIoc (t₀ + δ) b → F t = (γ t - s)⁻¹ * deriv γ t := by @@ -99,9 +99,9 @@ theorem pv_split_at_crossing {γ : ℝ → ℂ} {a b : ℝ} {s : ℂ} {ε δ : simp only [hF_def] rw [ite_eq_left] -- ht : t ∈ Ioc (t₀ + δ) b, so t₀ + δ < t, giving |t - t₀| = t - t₀ > δ - apply h_far t ⟨le_trans (by linarith) (le_of_lt ht.1), ht.2⟩ - rw [abs_of_nonneg (by linarith [ht.1])] - linarith [ht.1] + apply h_far t ⟨le_trans (by linarith only [hδ, hδ_lt_left]) (le_of_lt ht.1), ht.2⟩ + rw [abs_of_nonneg (by linarith only [hδ, ht, ht.1])] + linarith only [ht, ht.1] -- Integrability of F on each piece have hF_int_left : IntervalIntegrable F volume a (t₀ - δ) := hint_left.congr_ae ((ae_restrict_iff' measurableSet_uIoc).mpr @@ -131,6 +131,8 @@ theorem pv_split_at_crossing {γ : ℝ → ℂ} {a b : ℝ} {s : ℂ} {ε δ : ∫ t in (t₀ + δ)..b, (γ t - s)⁻¹ * deriv γ t := integral_congr_ae hF_right -- Assemble - simp_all + simp_all only [mem_Ioo, and_self, lt_min_iff, mem_Icc, and_imp, gt_iff_lt, ite_eq_right_iff, + mul_eq_zero, + inv_eq_zero, ite_eq_left_iff, not_lt, zero_eq_mul, add_zero] end ContourIntegral diff --git a/LeanPool/LeanModularForms/ContourIntegral/SegmentFTC.lean b/LeanPool/LeanModularForms/ContourIntegral/SegmentFTC.lean index 25191bdf78..de4bae45d7 100644 --- a/LeanPool/LeanModularForms/ContourIntegral/SegmentFTC.lean +++ b/LeanPool/LeanModularForms/ContourIntegral/SegmentFTC.lean @@ -58,7 +58,7 @@ theorem ftc_telescope_closed_split {f : ℝ → ℂ} {a b t₀ δ : ℝ} Complex.log (f b) - Complex.log (f (t₀ + δ))) : (∫ t in a..(t₀ - δ), deriv f t / f t) + (∫ t in (t₀ + δ)..b, deriv f t / f t) = Complex.log (f (t₀ - δ)) - Complex.log (f (t₀ + δ)) := by - simp_all + simp_all only [sub_add_sub_cancel] /-- FTC on three consecutive segments telescopes: the integral over [a,d] is log(f d) - log(f a) if each sub-interval satisfies the FTC-for-log. -/ diff --git a/LeanPool/LeanModularForms/ForMathlib/Bounds.lean b/LeanPool/LeanModularForms/ForMathlib/Bounds.lean index 3597684b7f..53a6135550 100644 --- a/LeanPool/LeanModularForms/ForMathlib/Bounds.lean +++ b/LeanPool/LeanModularForms/ForMathlib/Bounds.lean @@ -8,10 +8,6 @@ module public import Mathlib.NumberTheory.ModularForms.Bounds public import LeanPool.LeanModularForms.ForMathlib.Petersson -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Combinatorics.Matroid.Init -import Mathlib.MeasureTheory.Integral.Bochner.Basic -import Mathlib.Tactic.Positivity.Finset /-! # Bounds for modular forms diff --git a/LeanPool/LeanModularForms/ForMathlib/IsBoundedAtImInfty.lean b/LeanPool/LeanModularForms/ForMathlib/IsBoundedAtImInfty.lean index a89385bc97..5521a21689 100644 --- a/LeanPool/LeanModularForms/ForMathlib/IsBoundedAtImInfty.lean +++ b/LeanPool/LeanModularForms/ForMathlib/IsBoundedAtImInfty.lean @@ -7,12 +7,6 @@ module public import Mathlib.NumberTheory.ModularForms.EisensteinSeries.IsBoundedAtImInfty -import Mathlib.Algebra.Order.Algebra -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.SpecialFunctions.Pow.NNReal -import Mathlib.Data.Sym.Sym2.Init -import Mathlib.Tactic.NormNum.GCD -import Mathlib.Tactic.Positivity.Finset /-! # Boundedness of Eisenstein series diff --git a/LeanPool/LeanModularForms/ForMathlib/LevelOne.lean b/LeanPool/LeanModularForms/ForMathlib/LevelOne.lean index 6342d65a8e..1de8304185 100644 --- a/LeanPool/LeanModularForms/ForMathlib/LevelOne.lean +++ b/LeanPool/LeanModularForms/ForMathlib/LevelOne.lean @@ -12,10 +12,6 @@ public import LeanPool.LeanModularForms.ForMathlib.CongruenceSubgrps public import LeanPool.LeanModularForms.ForMathlib.Identities public import Mathlib.NumberTheory.ModularForms.LevelOne.Basic -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Combinatorics.Matroid.Init -import Mathlib.MeasureTheory.Integral.Bochner.Basic -import Mathlib.Tactic.Positivity.Finset /-! # Level one modular forms diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/ArcCalculus.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/ArcCalculus.lean index dba9b9bb0f..c9ad6b6a37 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/ArcCalculus.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/ArcCalculus.lean @@ -55,12 +55,21 @@ theorem unitArc_at_end (θ₁ θ₂ a b : ℝ) (hab : a ≠ b) : unitArc θ₁ θ₂ a b b = exp (↑θ₂ * I) := by simp only [unitArc] have hba : b - a ≠ 0 := sub_ne_zero.mpr (Ne.symm hab) - simp_all + simp_all only [ne_eq, not_false_eq_true, div_self, one_mul, add_sub_cancel] /-- The unit arc is continuous. -/ theorem unitArc_continuous (θ₁ θ₂ a b : ℝ) : Continuous (unitArc θ₁ θ₂ a b) := by unfold unitArc - fun_prop + exact Continuous.cexp + (Continuous.mul_const + (Continuous.comp' continuous_ofReal + (Continuous.const_add + (Continuous.mul_const + (Continuous.comp' (Continuous.div_const continuous_id' (b - a)) + (Continuous.fun_sub continuous_id' continuous_const)) + (θ₂ - θ₁)) + θ₁)) + I) /-- Helper: the angle function for the unit arc has a specific derivative. -/ private lemma unitArc_angle_hasDerivAt (θ₁ θ₂ a b t : ℝ) (_hab : b - a ≠ 0) : @@ -107,8 +116,8 @@ theorem exp_sub_norm_sq (θ₁ θ₂ : ℝ) : have hc1 := Real.sin_sq_add_cos_sq θ₁ have hc2 := Real.sin_sq_add_cos_sq θ₂ rw [Real.cos_sub] - nlinarith [sq_nonneg (Real.cos θ₁ - Real.cos θ₂), - sq_nonneg (Real.sin θ₁ - Real.sin θ₂)] + nlinarith only [hc1, hc2, sq_nonneg (Real.cos θ₁ - Real.cos θ₂), + sq_nonneg (Real.sin θ₁ - Real.sin θ₂)] /-- sin is positive on the open interval (0, π). -/ theorem sin_pos_of_mem_Ioo_zero_pi {θ : ℝ} (hθ : θ ∈ Ioo 0 π) : 0 < Real.sin θ := @@ -122,12 +131,12 @@ theorem abs_cos_le_half_of_mem_Icc {θ : ℝ} (hθ : θ ∈ Icc (π / 3) (2 * π have h2 : θ ≤ 2 * π / 3 := hθ.2 rw [abs_le]; constructor · have : Real.cos (2 * π / 3) ≤ Real.cos θ := - Real.cos_le_cos_of_nonneg_of_le_pi (by linarith) (by linarith) h2 + Real.cos_le_cos_of_nonneg_of_le_pi (by linarith only [hpi, h1]) (by linarith only [hpi]) h2 rw [show (2 * π / 3 : ℝ) = π - π / 3 from by ring, Real.cos_pi_sub, Real.cos_pi_div_three] at this - linarith + linarith only [this] · have : Real.cos θ ≤ Real.cos (π / 3) := - Real.cos_le_cos_of_nonneg_of_le_pi (by linarith) (by linarith) h1 - simp_all + Real.cos_le_cos_of_nonneg_of_le_pi (by linarith only [hpi]) (by linarith only [hpi, h2]) h1 + simp_all only [mem_Icc, and_self, cos_pi_div_three, one_div] end ArcCalculus diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Basic.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Basic.lean index fa1a3834ba..b31896607f 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Basic.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Basic.lean @@ -161,7 +161,7 @@ private theorem exists_min_above_in_finite_union ((Set.Finite.mem_toFinset hS_above_finite).mpr hs) exact ⟨s_min, hs_min_in.2, hs_min_le b ⟨Set.mem_union_left _ rfl, ht_lt_b⟩, - fun x hx hxS => by linarith [hs_min_le x ⟨hxS, hx.1⟩, hx.2]⟩ + fun x hx hxS => by linarith only [hs_min_le, hx, hxS, hs_min_le x ⟨hxS, hx.1⟩, hx.2]⟩ private theorem eq_on_Ioo_of_deriv_zero {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] @@ -176,7 +176,7 @@ private theorem eq_on_Ioo_of_deriv_zero f x = f y := fun x hx y hy => IsOpen.is_const_of_deriv_eq_zero isOpen_Ioo isPreconnected_Ioo h_diff h_dz hx hy - have h_mid : (t + s_min) / 2 ∈ Ioo t s_min := by constructor <;> linarith + have h_mid : (t + s_min) / 2 ∈ Ioo t s_min := by constructor <;> linarith only [ht_lt_s] have h_eq_mid : ∀ x ∈ Ioo t s_min, f x = f ((t + s_min) / 2) := fun x hx => h_const x hx _ h_mid have h_cont_Ioo : ContinuousWithinAt f (Ioo t s_min) t := diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/CauchyPrimitive.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/CauchyPrimitive.lean index 8015138d19..09fc2efc0f 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/CauchyPrimitive.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/CauchyPrimitive.lean @@ -8,7 +8,6 @@ module public import Mathlib.Analysis.Calculus.Deriv.Basic public import Mathlib.Analysis.Complex.Basic public import Mathlib.Topology.Algebra.Module.ModuleTopology -import Mathlib.Analysis.Calculus.ParametricIntervalIntegral import Mathlib.Analysis.Complex.CauchyIntegral import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts @@ -47,7 +46,7 @@ private lemma segment_subset_convex {S : Set ℂ} (hS : Convex ℝ S) {c z : ℂ} (hc : c ∈ S) (hz : z ∈ S) : ∀ t ∈ Icc (0 : ℝ) 1, c + t • (z - c) ∈ S := fun t ht => by rw [show c + t • (z - c) = (1 - t) • c + t • z from by module] - exact hS hc hz (by linarith [ht.2]) ht.1 (by linarith [ht.1]) + exact hS hc hz (by linarith only [ht, ht.2]) ht.1 (by linarith only [ht.1]) private lemma integral_t_mul_deriv_eq {f : ℂ → ℂ} {S : Set ℂ} {c z : ℂ} (hS_open : IsOpen S) @@ -109,7 +108,10 @@ private lemma integral_t_mul_deriv_eq {f : ℂ → ℂ} {S : Set ℂ} intervalIntegral.integral_mul_deriv_eq_deriv_mul_of_hasDerivAt hu_cont hv_cont hu_deriv hv_deriv hu'_int hv'_int simp only [u, v, u', v'] at h_parts - simp_all + simp_all only [mem_Icc, real_smul, and_imp, zero_le_one, uIcc_of_le, inf_of_le_left, + sup_of_le_right, mem_Ioo, + ofReal_one, one_smul, add_sub_cancel, one_mul, ofReal_zero, zero_smul, add_zero, zero_mul, + sub_zero] private lemma continuous_segmentMap (c w : ℂ) : Continuous (fun t : ℝ => c + t • (w - c)) := @@ -236,7 +238,10 @@ private lemma segmentIntegrand_lipschitzOnWith {f : ℂ → ℂ} _ = |t| * M * ‖x - y‖ := by ring _ = |t| * M * dist x y := by rw [dist_eq_norm] _ ≤ Real.toNNReal (|t| * M) * dist x y := by - simp_all + simp_all only [mem_Icc, Metric.mem_ball, real_smul, add_sub_add_left_eq_sub, + Complex.norm_mul, norm_real, + Real.norm_eq_abs, Real.coe_toNNReal', mul_nonneg_iff_of_pos_right, abs_nonneg, + sup_of_le_left, Std.le_refl] private lemma hasDerivAt_segmentIntegral_aux {f : ℂ → ℂ} {S : Set ℂ} {c z : ℂ} {ε : ℝ} @@ -381,7 +386,8 @@ private lemma hasDerivAt_segmentIntegral {f : ℂ → ℂ} suffices hH : HasDerivAt H (H' z) z by have h_prod := hH.mul h1 refine h_prod.congr_deriv ?_ - simp_all + simp_all only [mem_Icc, real_smul, and_imp, gt_iff_lt, intervalIntegral.integral_mul_const, + mul_eq_mul_right_iff, hasDerivAt_sub_const_iff, mul_one, sub_add_cancel] exact hasDerivAt_segmentIntegral_aux hε_pos hS_convex hS_open hc hz hf hε_ball diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/GeneralizedResidueTheorem.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/GeneralizedResidueTheorem.lean index 5e1da128cf..e4815c8e46 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/GeneralizedResidueTheorem.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/GeneralizedResidueTheorem.lean @@ -161,7 +161,7 @@ theorem generalizedResidueTheorem (U : Set ℂ) (hU : IsOpen U) generalizedWindingNumber' γ.toFun γ.a γ.b s * residueAt f s := by have hL_eq : L = cauchyPrincipalValueOn S0 f_res γ.toFun γ.a γ.b := (hL.limUnder_eq).symm - simp_all + simp_all only [gt_iff_lt, ne_eq, Set.mem_Icc, and_imp, implies_true] rw [← h_limit_eq] have hPV_res_tendsto : Tendsto (fun ε => ∫ t in γ.a..γ.b, cauchyPrincipalValueIntegrandOn S0 @@ -270,7 +270,7 @@ theorem generalizedResidueTheorem_simplePoles (U : Set ℂ) (hU : IsOpen U) 2 * Real.pi * I * ∑ s ∈ S0, generalizedWindingNumber' γ.toFun γ.a γ.b s * residueSimplePole f s := by - simp_all + simp_all only [gt_iff_lt, ne_eq, Set.mem_Icc, and_imp, implies_true] have hCancel : Tendsto (fun ε => (∫ t in γ.a..γ.b, cauchyPrincipalValueIntegrandOn S0 f γ.toFun ε t) - diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy/DixonProof.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy/DixonProof.lean index 503dc26418..afffa827d6 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy/DixonProof.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy/DixonProof.lean @@ -9,7 +9,6 @@ public import LeanPool.LeanModularForms.GeneralizedResidueTheory.HomologicalCauc public import Mathlib.Analysis.Calculus.DSlope import LeanPool.LeanModularForms.GeneralizedResidueTheory.Homotopy.Invariance import LeanPool.LeanModularForms.GeneralizedResidueTheory.Residue -import Mathlib.Analysis.Calculus.ParametricIntervalIntegral import Mathlib.Analysis.Complex.Liouville import Mathlib.Analysis.Complex.RemovableSingularity import Mathlib.Analysis.Normed.Group.ZeroAtInfty @@ -225,7 +224,9 @@ private lemma dixonH2_deriv_bound (f : ℂ → ℂ) (γ : PiecewiseC1Immersion) · exact hM_f_nn · exact hM_d t ht · positivity - · simp_all + · simp_all only [mem_Icc, and_imp, Metric.mem_ball, uIoc_of_le, mem_Ioc, and_true, + inv_pow, inv_pos, + pow_succ_pos, mul_nonneg_iff_of_pos_right] private lemma dixonH2_hasDerivAt (f : ℂ → ℂ) (γ : PiecewiseC1Immersion) (hfγ_cont : ContinuousOn (fun t => f (γ.toFun t)) (Icc γ.a γ.b)) @@ -307,8 +308,8 @@ private lemma ball_avoids_curve_of_infDist_pos (γ : PiecewiseC1Immersion) ∀ x ∈ Metric.ball w (Metric.infDist w (γ.toFun '' Icc γ.a γ.b) / 2), ∀ t ∈ Icc γ.a γ.b, γ.toFun t ≠ x := by intro x hx t ht heq - linarith [Metric.infDist_le_dist_of_mem (x := w) (show x ∈ γ.toFun '' Icc γ.a γ.b from ⟨t, ht, - heq⟩), + linarith only [hinfDist_pos, hx, ht, heq, + Metric.infDist_le_dist_of_mem (x := w) (show x ∈ γ.toFun '' Icc γ.a γ.b from ⟨t, ht, heq⟩), show dist w x < _ / 2 from by rw [dist_comm]; exact Metric.mem_ball.mp hx] private lemma dist_lower_bound_at_center (γ : PiecewiseC1Immersion) (w : ℂ) : @@ -318,7 +319,7 @@ private lemma dist_lower_bound_at_center (γ : PiecewiseC1Immersion) (w : ℂ) : have hid := Metric.infDist_le_dist_of_mem (x := w) (show γ.toFun t ∈ γ.toFun '' Icc γ.a γ.b from ⟨t, ht, rfl⟩) rw [Complex.dist_eq, ← norm_neg (w - γ.toFun t), neg_sub] at hid - linarith [Metric.infDist_nonneg (x := w) (s := γ.toFun '' Icc γ.a γ.b)] + linarith only [hid, Metric.infDist_nonneg (x := w) (s := γ.toFun '' Icc γ.a γ.b)] private lemma dist_lower_bound_on_ball (γ : PiecewiseC1Immersion) (w : ℂ) : ∀ x ∈ Metric.ball w (Metric.infDist w (γ.toFun '' Icc γ.a γ.b) / 2), @@ -328,8 +329,9 @@ private lemma dist_lower_bound_on_ball (γ : PiecewiseC1Immersion) (w : ℂ) : have htri := dist_triangle w x (γ.toFun t) rw [dist_comm w x] at htri have h1 : Metric.infDist w (γ.toFun '' Icc γ.a γ.b) / 2 ≤ dist x (γ.toFun t) := by - linarith [Metric.infDist_le_dist_of_mem (x := w) - (show γ.toFun t ∈ γ.toFun '' Icc γ.a γ.b from ⟨t, ht, rfl⟩), + linarith only [hx, ht, htri, + Metric.infDist_le_dist_of_mem (x := + w) (show γ.toFun t ∈ γ.toFun '' Icc γ.a γ.b from ⟨t, ht, rfl⟩), Metric.mem_ball.mp hx] rwa [Complex.dist_eq, ← norm_neg (x - γ.toFun t), neg_sub] at h1 @@ -346,7 +348,8 @@ private lemma dixonH2_differentiableAt_infDist_pos (f : ℂ → ℂ) obtain ⟨M_d, hM_d_spec⟩ := piecewiseC1Immersion_deriv_bounded γ exact (dixonH2_hasDerivAt f γ hfγ_cont M_f M_d (Metric.infDist w (γ.toFun '' Icc γ.a γ.b) / 2) hM_f_spec hM_d_spec - (le_trans (norm_nonneg _) (hM_f_spec γ.a (left_mem_Icc.mpr hab))) (by linarith) w + (le_trans (norm_nonneg _) (hM_f_spec γ.a (left_mem_Icc.mpr hab))) (by + linarith only [hinfDist_pos]) w (dist_lower_bound_at_center γ w) (ball_avoids_curve_of_infDist_pos γ w hinfDist_pos) (dist_lower_bound_on_ball γ w)).differentiableAt @@ -373,28 +376,28 @@ private lemma dslope_uniform_bound (hU : IsOpen U) (hf : DifferentiableOn ℂ f ‖dslope f c w‖ ≤ C := by obtain ⟨r, hr_pos, hr_sub⟩ := Metric.isOpen_iff.mp hU w₀ hw₀ have hcb_sub : Metric.closedBall w₀ (r / 2) ⊆ U := - (Metric.closedBall_subset_ball (by linarith)).trans hr_sub + (Metric.closedBall_subset_ball (by linarith only [hr_pos])).trans hr_sub obtain ⟨M_f, hM_f⟩ := (hK_compact.union (isCompact_closedBall w₀ (r / 2))).exists_bound_of_continuousOn (hf.continuousOn.mono (Set.union_subset hK_sub hcb_sub) |>.norm) obtain ⟨C_d, hC_d⟩ := (isCompact_closedBall w₀ (r / 2)).exists_bound_of_continuousOn (((hf.mono hr_sub).deriv Metric.isOpen_ball).continuousOn.mono - (Metric.closedBall_subset_ball (by linarith))) + (Metric.closedBall_subset_ball (by linarith only [hr_pos]))) refine ⟨max (C_d + 1) (8 * (|M_f| + 1) / r + 1), by positivity, - r / 4, by linarith, fun c hc w hw => ?_⟩ + r / 4, by linarith only [hr_pos], fun c hc w hw => ?_⟩ by_cases hcw : c = w · subst hcw; rw [dslope_same] calc ‖deriv f c‖ ≤ C_d := - hC_d c (Metric.closedBall_subset_closedBall (by linarith : r / 4 ≤ r / 2) + hC_d c (Metric.closedBall_subset_closedBall (by linarith only [hr_pos] : r / 4 ≤ r / 2) (Metric.ball_subset_closedBall hw)) - _ ≤ C_d + 1 := by linarith + _ ≤ C_d + 1 := by linarith only [] _ ≤ _ := le_max_left _ _ · have hne : w ≠ c := fun h => hcw h.symm rw [dslope_of_ne _ hne, slope_def_field, norm_div] by_cases hc_near : c ∈ Metric.closedBall w₀ (r / 2) · have hw_cb : w ∈ Metric.closedBall w₀ (r / 2) := - Metric.closedBall_subset_closedBall (by linarith : r / 4 ≤ r / 2) + Metric.closedBall_subset_closedBall (by linarith only [hr_pos] : r / 4 ≤ r / 2) (Metric.ball_subset_closedBall hw) have h_mvt := (convex_closedBall w₀ (r / 2)).norm_image_sub_le_of_norm_deriv_le (fun z hz => (hf z (hcb_sub hz)).differentiableAt (hU.mem_nhds (hcb_sub hz))) @@ -403,33 +406,34 @@ private lemma dslope_uniform_bound (hU : IsOpen U) (hf : DifferentiableOn ℂ f ≤ C_d * ‖w - c‖ / ‖w - c‖ := div_le_div_of_nonneg_right h_mvt (norm_nonneg _) _ = C_d := mul_div_cancel_right₀ C_d (norm_ne_zero_iff.mpr (sub_ne_zero.mpr hne)) - _ ≤ C_d + 1 := by linarith + _ ≤ C_d + 1 := by linarith only [] _ ≤ _ := le_max_left _ _ · have h_sep : r / 4 ≤ ‖w - c‖ := by have : r / 2 < dist w₀ c := by rw [dist_comm]; rwa [Metric.mem_closedBall, not_le] at hc_near calc r / 4 = r / 2 - r / 4 := by ring - _ ≤ dist w₀ c - dist w w₀ := by linarith [Metric.mem_ball.mp hw] + _ ≤ dist w₀ c - dist w w₀ := by linarith only [hw, this, Metric.mem_ball.mp hw] _ ≤ dist w c := by have := dist_triangle_left c w₀ w - rw [dist_comm w₀ c]; linarith + rw [dist_comm w₀ c]; linarith only [this] _ = ‖w - c‖ := by rw [dist_eq_norm] simp only [norm_norm] at hM_f have h1 : ‖f w‖ ≤ M_f := hM_f w (Or.inr - (Metric.closedBall_subset_closedBall (by linarith : r / 4 ≤ r / 2) + (Metric.closedBall_subset_closedBall (by linarith only [hr_pos] : r / 4 ≤ r / 2) (Metric.ball_subset_closedBall hw))) have hM_f_nn : 0 ≤ M_f := le_trans (norm_nonneg _) h1 have h_num : ‖f w - f c‖ ≤ 2 * M_f := by - linarith [norm_sub_le (f w) (f c), hM_f c (Or.inl hc)] - have h_denom_pos : (0 : ℝ) < ‖w - c‖ := lt_of_lt_of_le (by linarith) h_sep + linarith only [hc, hM_f, h1, norm_sub_le (f w) (f c), hM_f c (Or.inl hc)] + have h_denom_pos : (0 : ℝ) < ‖w - c‖ := lt_of_lt_of_le (by linarith only [hr_pos]) h_sep have h_eq : 2 * M_f / (r / 4) = 8 * M_f / r := by ring have h_le : 8 * M_f / r ≤ 8 * (|M_f| + 1) / r + 1 := by rw [abs_of_nonneg hM_f_nn] - linarith [div_nonneg (show (0 : ℝ) ≤ 8 by norm_num) hr_pos.le, + linarith only [hr_pos, div_nonneg (show (0 : ℝ) ≤ 8 by norm_num) hr_pos.le, (show 8 * M_f / r + 8 / r + 1 = 8 * (M_f + 1) / r + 1 from by ring)] exact le_trans (le_trans (div_le_div_of_nonneg_right h_num (le_of_lt h_denom_pos)) - (div_le_div_of_nonneg_left (by linarith) (by linarith) h_sep)) + (div_le_div_of_nonneg_left (by linarith only [hM_f_nn]) + (by linarith only [hr_pos]) h_sep)) (le_trans (h_eq ▸ le_refl _) (le_trans h_le (le_max_right _ _))) private theorem dixonH1_dslope_t_cont (hU : IsOpen U) (hf : DifferentiableOn ℂ f U) @@ -753,7 +757,7 @@ private lemma curveImage_dist_lower_bound (γ : PiecewiseC1Immersion) {R : ℝ} (ht : t ∈ Icc γ.a γ.b) : ‖w‖ - R ≤ ‖γ.toFun t - w‖ := by have h1 : ‖w‖ - ‖γ.toFun t‖ ≤ ‖w - γ.toFun t‖ := norm_sub_norm_le w (γ.toFun t) rw [norm_sub_rev] at h1 - linarith [hR (γ.toFun t) ⟨t, ht, rfl⟩] + linarith only [hR, ht, h1, hR (γ.toFun t) ⟨t, ht, rfl⟩] private lemma dixonH2_norm_bound (γ : PiecewiseC1Immersion) {R M_f M_d : ℝ} (hM_f_nn : 0 ≤ M_f) (hR : ∀ x ∈ γ.toFun '' Icc γ.a γ.b, ‖x‖ ≤ R) @@ -763,7 +767,7 @@ private lemma dixonH2_norm_bound (γ : PiecewiseC1Immersion) {R M_f M_d : ℝ} ‖dixonH2 f γ w‖ ≤ M_f * M_d * (γ.b - γ.a) / (‖w‖ - R) := by have hab : γ.a ≤ γ.b := le_of_lt γ.hab simp only [dixonH2] - have hpos : 0 < ‖w‖ - R := by linarith + have hpos : 0 < ‖w‖ - R := by linarith only [hw] have h_ptwise : ∀ t ∈ Set.uIoc γ.a γ.b, ‖f (γ.toFun t) / (γ.toFun t - w) * deriv γ.toFun t‖ ≤ M_f * M_d / (‖w‖ - R) := by intro t ht_ui @@ -779,7 +783,7 @@ private lemma dixonH2_norm_bound (γ : PiecewiseC1Immersion) {R M_f M_d : ℝ} ≤ (M_f * M_d / (‖w‖ - R)) * |γ.b - γ.a| := intervalIntegral.norm_integral_le_of_norm_le_const h_ptwise _ = M_f * M_d * (γ.b - γ.a) / (‖w‖ - R) := by - rw [abs_of_nonneg (by linarith : 0 ≤ γ.b - γ.a)]; ring + rw [abs_of_nonneg (by linarith only [hab] : 0 ≤ γ.b - γ.a)]; ring private lemma windingNumber_norm_lt_one (γ : PiecewiseC1Immersion) {R M_d : ℝ} {w : ℂ} (hR : ∀ x ∈ γ.toFun '' Icc γ.a γ.b, ‖x‖ ≤ R) @@ -858,20 +862,20 @@ private lemma dixonFunction_norm_lt_of_large (hU : IsOpen U) (hf : Differentiabl ‖dixonFunction f U γ w‖ < ε := by have hR_lt : R < ‖w‖ := by have hnn : 0 ≤ M_d * (γ.b - γ.a) / (2 * Real.pi) := - div_nonneg (mul_nonneg hM_d_nn (by linarith [γ.hab])) Real.two_pi_pos.le - linarith [le_max_left (R + M_d * (γ.b - γ.a) / (2 * Real.pi)) - (R + M_f * M_d * (γ.b - γ.a) / ε)] + div_nonneg (mul_nonneg hM_d_nn (by linarith only [γ.hab])) Real.two_pi_pos.le + linarith only [hw, hnn, + le_max_left (R + M_d * (γ.b - γ.a) / (2 * Real.pi)) (R + M_f * M_d * (γ.b - γ.a) / ε)] have hwn_eq_zero : generalizedWindingNumber' γ.toFun γ.a γ.b w = 0 := windingNumber_zero_of_large_norm γ hM_d_nn hR hM_d h_null.closed (lt_of_le_of_lt (le_max_left _ _) hw) have h_bound_lt_ε : M_f * M_d * (γ.b - γ.a) / (‖w‖ - R) < ε := by - have hpos : 0 < ‖w‖ - R := by linarith + have hpos : 0 < ‖w‖ - R := by linarith only [hR_lt] rw [div_lt_iff₀ hpos] have h_div_lt : M_f * M_d * (γ.b - γ.a) / ε < ‖w‖ - R := by - linarith [lt_of_le_of_lt (le_max_right _ _) hw] - linarith [(div_lt_iff₀ hε).mp h_div_lt] + linarith only [hw, lt_of_le_of_lt (le_max_right _ _) hw] + linarith only [hε, h_div_lt, (div_lt_iff₀ hε).mp h_div_lt] have hoff : ∀ t ∈ Icc γ.a γ.b, γ.toFun t ≠ w := by - intro t ht heq; linarith [hR (γ.toFun t) ⟨t, ht, rfl⟩, heq ▸ hR_lt] + intro t ht heq; linarith only [hR, hR_lt, ht, heq, hR (γ.toFun t) ⟨t, ht, rfl⟩, heq ▸ hR_lt] by_cases hwin : w ∈ U · simp only [dixonFunction, dite_eq_left hwin] rw [dixonH1_eq hU hf γ h_null.image_subset w hoff, hwn_eq_zero] @@ -965,7 +969,7 @@ theorem contourIntegral_eq_zero_of_nullHomologous (hU : IsOpen U) (hf : Differen obtain ⟨w₀, hw₀U, hw₀_off⟩ : ∃ w₀ ∈ U, w₀ ∉ γ.toFun '' Icc γ.a γ.b := by by_contra h; push Not at h have : U ⊆ interior (γ.toFun '' Icc γ.a γ.b) := hU.subset_interior_iff.mpr h - simp_all + simp_all only [mem_image, mem_Icc, subset_empty_iff, isOpen_empty, Set.not_nonempty_empty] have hw₀_avoids : ∀ t ∈ Icc γ.a γ.b, γ.toFun t ≠ w₀ := fun t ht heq => hw₀_off ⟨t, ht, heq⟩ set F := fun z => f z * (z - w₀) with hF_def diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy/Meromorphic.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy/Meromorphic.lean index 5cadf6dac0..4fbf93d303 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy/Meromorphic.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/HomologicalCauchy/Meromorphic.lean @@ -92,7 +92,7 @@ private lemma contourIntegral_eq_of_agree_on_curve (f g : ℂ → ℂ) apply intervalIntegral.integral_congr intro t ht rw [Set.uIcc_of_le (le_of_lt γ.hab)] at ht - simp_all + simp_all only [mem_Icc, and_imp] private lemma contourIntegral_add_principalPart_regularPart (f : ℂ → ℂ) (s : ℂ) (hf : MeromorphicAt f s) (U : Set ℂ) (hf_diff : DifferentiableOn ℂ f (U \ {s})) diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/Integrality.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/Integrality.lean index 128ba45837..240c59bd66 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/Integrality.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/Integrality.lean @@ -128,7 +128,8 @@ theorem ClosedCurvesHomotopicAvoiding.toPiecewise PiecewiseCurvesHomotopicAvoiding γ₀ γ₁ a b z₀ ∅ := by obtain ⟨H, hcont, hH0, hH1, hclosed, havoid, hdiff, hderiv_cont⟩ := h refine ⟨H, hcont, hH0, hH1, hclosed, havoid, ?_, ?_, ?_⟩ - · simp_all + · simp_all only [mem_Icc, and_imp, ne_eq, mem_Ioo, Finset.notMem_empty, not_false_eq_true, + implies_true] · intro p₁ p₂ _hp _hvac _hI exact hderiv_cont.continuousOn.mono (Set.subset_univ _) · have hK : IsCompact (Set.Icc a b ×ˢ Set.Icc (0 : ℝ) 1) := @@ -175,9 +176,9 @@ lemma exists_ball_avoiding_finset {P : Finset ℝ} {t : ℝ} (ht : t ∉ P) : let d := Finset.inf' P hP_ne (fun p => |p - t|) have hd_pos : 0 < d := by rw [Finset.lt_inf'_iff]; exact fun p hp => abs_pos.mpr (sub_ne_zero.mpr (h_ne p hp)) - exact ⟨d / 2, by linarith, fun x hx hxP => by + exact ⟨d / 2, by linarith only [hd_pos], fun x hx hxP => by have : d ≤ |x - t| := Finset.inf'_le (fun p => |p - t|) hxP - have : |x - t| < d := by rw [abs_lt]; constructor <;> linarith [hx.1, hx.2] + have : |x - t| < d := by rw [abs_lt]; constructor <;> linarith only [hd_pos, hx, hx.1, hx.2] linarith⟩ private lemma bound_away_from_z₀ @@ -484,7 +485,9 @@ theorem exp_integral_eq_endpoint_ratio_piecewise have hGb' : (γ b - z₀) * Complex.exp (-(∫ s in a..b, deriv γ s / (γ s - z₀))) = γ a - z₀ := by have := hG_const b (right_mem_Icc.mpr hab.le) - simp_all + simp_all only [mem_Ioo, and_imp, mem_Icc, ne_eq, gt_iff_lt, intervalIntegral.integral_same, + neg_zero, + exp_zero, mul_one] have h_neg : Complex.exp (-(∫ t in a..b, deriv γ t / (γ t - z₀))) = (γ a - z₀) / (γ b - z₀) := by rw [eq_div_iff hne_b, mul_comm]; exact hGb' rw [show Complex.exp (∫ t in a..b, deriv γ t / (γ t - z₀)) = @@ -505,7 +508,7 @@ theorem winding_integrand_bounded_of_uniform_avoidance intro heq have h := hδ_bound t ht s hs simp only [heq, norm_zero] at h - linarith + linarith only [hδ_pos, h] have h_inv_bound : ‖(H (t, s) - z₀)⁻¹‖ ≤ δ⁻¹ := by rw [norm_inv, inv_eq_one_div, inv_eq_one_div] exact one_div_le_one_div_of_le hδ_pos (hδ_bound t ht s hs) @@ -586,7 +589,8 @@ private lemma exp_endpoint_ratio_from_gFunc have hGb' : (γ b - z₀) * Complex.exp (-(∫ s in a..b, deriv γ s / (γ s - z₀))) = γ a - z₀ := by have := hG_const b (right_mem_Icc.mpr hab.le) - simp_all + simp_all only [mem_Icc, ne_eq, and_imp, intervalIntegral.integral_same, neg_zero, exp_zero, + mul_one] have h_neg : Complex.exp (-(∫ t in a..b, deriv γ t / (γ t - z₀))) = (γ a - z₀) / (γ b - z₀) := by rw [eq_div_iff hne_b, mul_comm]; exact hGb' rw [show Complex.exp (∫ t in a..b, deriv γ t / (γ t - z₀)) = diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/Invariance.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/Invariance.lean index 814d30375f..1f8864a82c 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/Invariance.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/Invariance.lean @@ -324,7 +324,7 @@ theorem windingNumber_eq_of_piecewise_homotopic apply windingNumber_integer_of_piecewise_closed_avoiding (fun t => H (t, s)) a b z₀ P hab · exact hH_closed s hs · exact hH_cont.comp (continuous_id.prodMk continuous_const) |>.continuousOn - · simp_all + · simp_all only [mem_Icc, and_imp, ne_eq, mem_Ioo, not_false_eq_true, implies_true] · intro p₁ p₂ hp₁p₂ hpiece h_sub convert (hH_deriv_cont p₁ p₂ hp₁p₂ hpiece h_sub).comp (continuous_id.prodMk continuous_const).continuousOn diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/ParametricDiff.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/ParametricDiff.lean index a7c0aa15d5..175611bad7 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/ParametricDiff.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Homotopy/ParametricDiff.lean @@ -9,7 +9,6 @@ public import Mathlib.Analysis.Calculus.ContDiff.Defs public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic import Mathlib.Analysis.Calculus.Deriv.Prod import Mathlib.Analysis.Calculus.FDeriv.Symmetric -import Mathlib.Analysis.Calculus.ParametricIntervalIntegral import Mathlib.Analysis.Complex.CauchyIntegral /-! @@ -76,7 +75,7 @@ theorem intervalIntegral_continuous_on_param obtain ⟨M, hM⟩ := hbound apply intervalIntegral.continuousAt_of_dominated_interval · filter_upwards with s; exact hmeas s - · have h_nhd : Ioo (s₀ - 1) (s₀ + 1) ∈ 𝓝 s₀ := by apply Ioo_mem_nhds <;> linarith + · have h_nhd : Ioo (s₀ - 1) (s₀ + 1) ∈ 𝓝 s₀ := by apply Ioo_mem_nhds <;> linarith only [] filter_upwards [h_nhd] with s hs filter_upwards with t intro ht @@ -620,6 +619,6 @@ theorem hasDerivAt_homotopy_integral_zero rw [← h_ftc] exact hasDerivAt_homotopy_param f H a b s hab hH_smooth hf_diff hfH_cont hs hf_differentiable (fun t ht => h_schwarz t ht) - simp_all + simp_all only [mem_Icc, and_imp] end diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/LogDerivFTC.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/LogDerivFTC.lean index bf9dc5ee79..c0d03e21b0 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/LogDerivFTC.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/LogDerivFTC.lean @@ -114,7 +114,8 @@ theorem ftc_log_piece {g h : ℝ → ℂ} {a b : ℝ} (hab : a ≤ b) (show Integrable _ (volume.restrict (Ioc a b)) from hint_h.1) ((MeasureTheory.ae_restrict_iff' measurableSet_Ioc).mpr (h_congr.mono (fun t ht hm => (ht (uIoc_of_le hab ▸ hm)).symm))) - · simp_all + · simp_all only [mem_Ioo, and_imp, mem_Icc, ne_eq, uIoc_of_le, mem_Ioc, not_lt, Ioc_eq_empty, + integrableOn_empty] have h_ftc := integral_logDeriv_eq_log_sub hab hh_cont hh_diff hh_deriv_cont hh_slit exact ⟨hint_g, by calc ∫ t in a..b, deriv g t / g t @@ -167,7 +168,7 @@ theorem ftc_log_neg_on_segment {f : ℝ → ℂ} {a b : ℝ} (hab : a ≤ b) intro x hx have hslit := hf_slit x (Ioo_subset_Icc_self hx) have h_log := (hf_diff x hx).hasDerivAt.neg.clog_real hslit - simp_all + simp_all only [mem_Ioo, and_imp, mem_Icc, ne_eq, Pi.neg_apply, neg_div_neg_eq] have hint : IntervalIntegrable (fun t => deriv f t / f t) volume a b := by apply ContinuousOn.intervalIntegrable rw [Set.uIcc_of_le hab] diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/OnCurvePV/Basic.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/OnCurvePV/Basic.lean index d0f2ff5853..4edcdecd18 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/OnCurvePV/Basic.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/OnCurvePV/Basic.lean @@ -50,7 +50,7 @@ lemma pv_limit_via_dyadic {γ : ℝ → ℂ} {a b t₀ : ℝ} {L : ℂ} have hδ_pos : 0 < δ := by positivity have h_dyadic_lt : ∀ n : ℕ, δ / 2 ^ n < δ_P1 := fun n => calc δ / 2 ^ n ≤ δ := div_le_self hδ_pos.le (one_le_pow₀ (by norm_num : (1 : ℝ) ≤ 2)) - _ < δ_P1 := by simp only [δ]; linarith + _ < δ_P1 := by simp only [δ]; linarith only [hδ_P1_pos] let I : ℝ → ℂ := fun ε => ∫ t in a..b, if ε < ‖γ t - γ t₀‖ then (γ t - γ t₀)⁻¹ * deriv γ t else 0 have h_step : ∀ n, ‖I (δ / 2 ^ (n + 1)) - I (δ / 2 ^ n)‖ ≤ K * δ / 2 ^ n := fun n => by @@ -58,7 +58,7 @@ lemma pv_limit_via_dyadic {γ : ℝ → ℂ} {a b t₀ : ℝ} {L : ℂ} have h_le : δ / 2 ^ (n + 1) ≤ δ / 2 ^ n := div_le_div_of_nonneg_left hδ_pos.le (by positivity) (pow_le_pow_right₀ (by norm_num : (1 : ℝ) ≤ 2) (Nat.le_succ n)) - have h_ratio : δ / 2 ^ n ≤ 2 * (δ / 2 ^ (n + 1)) := by rw [pow_succ]; ring_nf; linarith + have h_ratio : δ / 2 ^ n ≤ 2 * (δ / 2 ^ (n + 1)) := by rw [pow_succ]; ring_nf; linarith only [] have h_bound := h_step_uniform (δ / 2 ^ n) (δ / 2 ^ (n + 1)) hε₂_pos h_le h_ratio (h_dyadic_lt n) calc ‖I (δ / 2 ^ (n + 1)) - I (δ / 2 ^ n)‖ @@ -74,7 +74,7 @@ lemma pv_limit_via_dyadic {γ : ℝ → ℂ} {a b t₀ : ℝ} {L : ℂ} rw [Metric.tendsto_nhdsWithin_nhds] intro η hη_pos rw [Metric.tendsto_atTop] at h_limit_tendsto - obtain ⟨N₁, hN₁⟩ := h_limit_tendsto (η / 2) (by linarith) + obtain ⟨N₁, hN₁⟩ := h_limit_tendsto (η / 2) (by linarith only [hη_pos]) have h_pow_unbounded : ∃ N₂ : ℕ, K * δ / 2 ^ N₂ < η / 4 := by have : Tendsto (fun n : ℕ => K * δ / 2 ^ n) atTop (𝓝 0) := by have h_tendsto_pow : Tendsto (fun n : ℕ => (2 : ℝ) ^ n) atTop atTop := @@ -83,7 +83,7 @@ lemma pv_limit_via_dyadic {γ : ℝ → ℂ} {a b t₀ : ℝ} {L : ℂ} simp_rw [one_div]; exact tendsto_inv_atTop_zero.comp h_tendsto_pow convert Tendsto.const_mul (K * δ) h_tendsto_inv using 1 <;> [ext n; skip] <;> ring rw [Metric.tendsto_atTop] at this - obtain ⟨N₂, hN₂⟩ := this (η / 4) (by linarith) + obtain ⟨N₂, hN₂⟩ := this (η / 4) (by linarith only [hη_pos]) refine ⟨N₂, ?_⟩ specialize hN₂ N₂ le_rfl rw [Real.dist_eq, sub_zero, @@ -110,11 +110,11 @@ lemma pv_limit_via_dyadic {γ : ℝ → ℂ} {a b t₀ : ℝ} {L : ℂ} have h_div_ge : δ / 2 ^ (M + 1) ≥ δ / 2 ^ N := div_le_div_of_nonneg_left hδ_pos.le (by positivity) (pow_le_pow_right₀ (by norm_num : (1 : ℝ) ≤ 2) h_lt) - linarith + linarith only [hε_lt_dyadic, hM_lower, h_div_ge] have h_first_piece : ‖I ε - I (δ / 2 ^ M)‖ ≤ K * δ / 2 ^ M := by have h_ratio_M : δ / 2 ^ M ≤ 2 * ε := by have : δ / 2 ^ M = 2 * (δ / 2 ^ (M + 1)) := by rw [pow_succ]; ring - linarith + linarith only [hM_lower, this] have h_bound := h_step_uniform (δ / 2 ^ M) ε hε_pos' hM_upper h_ratio_M (h_dyadic_lt M) calc ‖I ε - I (δ / 2 ^ M)‖ ≤ K * (δ / 2 ^ M) := h_bound @@ -124,7 +124,7 @@ lemma pv_limit_via_dyadic {γ : ℝ → ℂ} {a b t₀ : ℝ} {L : ℂ} have hKδN_nonneg : 0 ≤ K * δ / 2 ^ N := by positivity calc ‖I ε - I (δ / 2 ^ N)‖ ≤ K * δ / 2 ^ N := h_first_piece - _ ≤ K * δ / 2 ^ N + K * δ / 2 ^ N := by linarith + _ ≤ K * δ / 2 ^ N + K * δ / 2 ^ N := by linarith only [hKδN_nonneg] _ = 2 * K * δ / 2 ^ N := by ring · have hM_gt_N : M > N := Nat.lt_of_le_of_ne hM_ge_N (Ne.symm hMN) have h_tri_inner : ‖I ε - I (δ / 2 ^ N)‖ ≤ @@ -142,9 +142,10 @@ lemma pv_limit_via_dyadic {γ : ℝ → ℂ} {a b t₀ : ℝ} {L : ℂ} calc ‖I ε - I (δ / 2 ^ N)‖ ≤ ‖I ε - I (δ / 2 ^ M)‖ + ‖I (δ / 2 ^ M) - I (δ / 2 ^ N)‖ := h_tri_inner _ ≤ K * δ / 2 ^ M + (2 * K * δ / 2 ^ N - 2 * K * δ / 2 ^ M) := by - linarith [h_first_piece, h_sum_bound] + linarith only [h_first_piece, h_sum_bound] _ = 2 * K * δ / 2 ^ N - K * δ / 2 ^ M := by ring - _ ≤ 2 * K * δ / 2 ^ N := by linarith [show (0 : ℝ) ≤ K * δ / 2 ^ M from by positivity] + _ ≤ 2 * K * δ / 2 ^ N := by + linarith only [hK_pos, hδ_P1_pos, show (0 : ℝ) ≤ K * δ / 2 ^ M from by positivity] have hN_ge_N₂ : N ≥ N₂ := le_max_right _ _ have h_pow_le : (2 : ℝ) ^ N₂ ≤ 2 ^ N := pow_le_pow_right₀ (by norm_num : (1 : ℝ) ≤ 2) hN_ge_N₂ @@ -157,9 +158,9 @@ lemma pv_limit_via_dyadic {γ : ℝ → ℂ} {a b t₀ : ℝ} {L : ℂ} exact mul_lt_mul_of_pos_left h_Kδ_bound (by norm_num : (0 : ℝ) < 2) calc dist (I ε) limit_dyadic ≤ dist (I ε) (I (δ / 2 ^ N)) + dist (I (δ / 2 ^ N)) limit_dyadic := h_tri - _ ≤ 2 * K * δ / 2 ^ N + dist (I (δ / 2 ^ N)) limit_dyadic := by linarith - _ < 2 * K * δ / 2 ^ N + η / 2 := by linarith - _ < η / 2 + η / 2 := by linarith + _ ≤ 2 * K * δ / 2 ^ N + dist (I (δ / 2 ^ N)) limit_dyadic := by linarith only [h_first] + _ < 2 * K * δ / 2 ^ N + η / 2 := by linarith only [h_second] + _ < η / 2 + η / 2 := by linarith only [h_first_small] _ = η := by ring lemma measurableSet_norm_gt_of_continuousOn {f : ℝ → ℂ} {s : Set ℝ} @@ -283,7 +284,7 @@ lemma arc_angle_injective {t t' : ℝ} exact this exact_mod_cast Complex.ofReal_injective (mul_right_cancel₀ I_ne_zero h2) have h_diff_small : |Real.pi * (1 + t) / 6 - Real.pi * (1 + t') / 6| < Real.pi := by - rw [abs_lt]; constructor <;> nlinarith [Real.pi_pos, ht.1, ht.2, ht'.1, ht'.2] + rw [abs_lt]; constructor <;> nlinarith only [ht, ht', Real.pi_pos, ht.1, ht.2, ht'.1, ht'.2] have hn0 : n = 0 := by by_contra h_ne have h1 : |(n : ℝ)| ≥ 1 := by exact_mod_cast Int.one_le_abs h_ne @@ -291,9 +292,9 @@ lemma arc_angle_injective {t t' : ℝ} rw [abs_mul, abs_of_pos (by positivity : 0 < 2 * Real.pi)] exact le_mul_of_one_le_right (by positivity) h1 have h3 : |2 * Real.pi * (n : ℝ)| < Real.pi := by rwa [h_vals] at h_diff_small - linarith [Real.pi_pos] + linarith only [h2, h3, Real.pi_pos] rw [hn0] at h_vals; simp only [Int.cast_zero, mul_zero] at h_vals - nlinarith [Real.pi_ne_zero, Real.pi_pos] + nlinarith only [h_vals, Real.pi_ne_zero, Real.pi_pos] /-- CPV trivially exists when the curve avoids `z₀` on `[a, b]`. -/ lemma cpv_avoidance (f : ℂ → ℂ) (γ : ℝ → ℂ) (a b : ℝ) (z₀ : ℂ) diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/AnnulusBounds.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/AnnulusBounds.lean index a439d7b817..58becf25f2 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/AnnulusBounds.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/AnnulusBounds.lean @@ -255,7 +255,7 @@ lemma volume_shell_le {t₀ r₁ r₂ : ℝ} private lemma abs_sub_threshold_le {g x ε e : ℝ} (h_approx : |g - x| ≤ e) (h_between : (g ≤ ε ∧ ε ≤ x) ∨ (x ≤ ε ∧ ε ≤ g)) : |x - ε| ≤ e := by rw [abs_le] at h_approx ⊢ - rcases h_between with ⟨h1, h2⟩ | ⟨h1, h2⟩ <;> constructor <;> linarith + rcases h_between with ⟨h1, h2⟩ | ⟨h1, h2⟩ <;> constructor <;> linarith only [h_approx, h2, h1] lemma symmDiff_subset_boundaryLayers {g x e ε₁ ε₂ : ℝ} @@ -268,21 +268,21 @@ lemma symmDiff_subset_boundaryLayers ⟨⟨hg_lower, hg_upper⟩, hnotB⟩ | ⟨⟨hx_lower, hx_upper⟩, hnotA⟩ · by_cases hx_le_ε₂ : x ≤ ε₂ - · exact Or.inl (abs_sub_threshold_le h_approx (Or.inr ⟨hx_le_ε₂, by linarith⟩)) + · exact Or.inl (abs_sub_threshold_le h_approx (Or.inr ⟨hx_le_ε₂, by linarith only [hg_lower]⟩)) · push Not at hx_le_ε₂ have hx_gt_ε₁ : ε₁ < x := by by_contra h_not push Not at h_not exact hnotB ⟨hx_le_ε₂, h_not⟩ - exact Or.inr (abs_sub_threshold_le h_approx (Or.inl ⟨hg_upper, by linarith⟩)) + exact Or.inr (abs_sub_threshold_le h_approx (Or.inl ⟨hg_upper, by linarith only [hx_gt_ε₁]⟩)) · by_cases hg_le_ε₂ : g ≤ ε₂ - · exact Or.inl (abs_sub_threshold_le h_approx (Or.inl ⟨hg_le_ε₂, by linarith⟩)) + · exact Or.inl (abs_sub_threshold_le h_approx (Or.inl ⟨hg_le_ε₂, by linarith only [hx_lower]⟩)) · push Not at hg_le_ε₂ have hg_gt_ε₁ : ε₁ < g := by by_contra h_not push Not at h_not exact hnotA ⟨hg_le_ε₂, h_not⟩ - exact Or.inr (abs_sub_threshold_le h_approx (Or.inr ⟨hx_upper, by linarith⟩)) + exact Or.inr (abs_sub_threshold_le h_approx (Or.inr ⟨hx_upper, by linarith only [hg_gt_ε₁]⟩)) lemma tAnnLin_implies_r_le {L_norm r ε₁ : ℝ} (hL_pos : 0 < L_norm) @@ -299,15 +299,15 @@ lemma near_threshold_implies_r_in_shell (ε - K₀ * R_max^2) / L_norm ≤ r ∧ r ≤ (ε + K₀ * R_max^2) / L_norm := by have h_abs := abs_le.mp h_near - have h_lower : ε - K₀ * r^2 ≤ L_norm * r := by linarith [h_abs.1] - have h_upper : L_norm * r ≤ ε + K₀ * r^2 := by linarith [h_abs.2] + have h_lower : ε - K₀ * r^2 ≤ L_norm * r := by linarith only [h_abs, h_abs.1] + have h_upper : L_norm * r ≤ ε + K₀ * r^2 := by linarith only [h_abs, h_abs.2] have hr2_le : r^2 ≤ R_max^2 := - sq_le_sq' (by linarith) hr_le + sq_le_sq' (by linarith only [hR_max_nonneg, hr_nonneg]) hr_le have hK_r2_le : K₀ * r^2 ≤ K₀ * R_max^2 := mul_le_mul_of_nonneg_left hr2_le hK₀_nonneg refine ⟨?_, ?_⟩ - · rw [div_le_iff₀ hL_pos]; linarith - · rw [le_div_iff₀ hL_pos]; linarith + · rw [div_le_iff₀ hL_pos]; linarith only [h_abs, hK_r2_le] + · rw [le_div_iff₀ hL_pos]; linarith only [h_abs, hK_r2_le] /-- When `ε ≤ Δ` (small epsilon), the shell is contained in a ball of radius `(ε+Δ)/L_norm`. -/ private lemma shell_vol_le_of_small_eps {t₀ ε Δ L_norm : ℝ} @@ -407,14 +407,14 @@ private lemma annulus_lower_bound {γ : ℝ → ℂ} {t₀ : ℝ} {L : ℂ} {K have h_smul_norm : ‖(t - t₀) • L‖ = |t - t₀| * ‖L‖ := norm_smul (t - t₀) L have h1 : ‖γ t - γ t₀‖ ≥ ‖(t - t₀) • L‖ - ‖γ t - γ t₀ - (t - t₀) • L‖ := by have := abs_norm_sub_norm_le (γ t - γ t₀) ((t - t₀) • L) - linarith [abs_le.mp this] + linarith only [this, abs_le.mp this] have h2 : ‖γ t - γ t₀‖ ≥ |t - t₀| * ‖L‖ - K₀ * |t - t₀|^2 := by rw [h_smul_norm] at h1 - linarith [h_approx] + linarith only [h_approx, h1] have h4 : K₀ * |t - t₀| < ‖L‖ / 2 := by have : K₀ * (‖L‖ / (2 * K₀)) = ‖L‖ / 2 := by field_simp - linarith [mul_lt_mul_of_pos_left ht_lt_L_over_2K hK₀_pos] - nlinarith [h2, h4, abs_nonneg (t - t₀), + linarith only [hK₀_pos, ht_lt_L_over_2K, this, mul_lt_mul_of_pos_left ht_lt_L_over_2K hK₀_pos] + nlinarith only [h_approx, h_smul_norm, h1, h4, h2, abs_nonneg (t - t₀), mul_nonneg (abs_nonneg (t - t₀)) (le_of_lt (by linarith : (0 : ℝ) < ‖L‖ / 2 - K₀ * |t - t₀|))] lemma annulus_symmDiff_measure_bound diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/GammaAnalysis.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/GammaAnalysis.lean index a4b0ce13c3..aed212b16d 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/GammaAnalysis.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/GammaAnalysis.lean @@ -47,7 +47,7 @@ private lemma hasDerivAt_remainder_bound simpa only [Real.norm_eq_abs] using h_bound private lemma norm_real_smul (x : ℝ) (L : ℂ) : ‖x • L‖ = |x| * ‖L‖ := by - simp_all + simp_all only [real_smul, Complex.norm_mul, norm_real, Real.norm_eq_abs] /-- The increment norm is within `M` of the linear part `|t - t₀| * ‖L‖`. -/ private lemma abs_norm_gamma_sub_smul_le {γ : ℝ → ℂ} {t₀ : ℝ} {L : ℂ} {M : ℝ} {t : ℝ} @@ -161,7 +161,7 @@ lemma gamma_lower_bound_of_hasDerivAt (‖L‖ / 2) (half_pos hLnorm_pos) refine ⟨δ, hδ_pos, fun t ht_pos ht_lt => ?_⟩ have h := abs_le.mp (abs_norm_gamma_sub_smul_le (hδ_bound t ht_pos ht_lt)) - nlinarith [h.1] + nlinarith only [h, h.1] /-- Upper bound on ‖γ t - γ t₀‖ from non-zero derivative. Uses `hasDerivAt_remainder_bound` + triangle inequality. -/ @@ -176,7 +176,7 @@ lemma gamma_upper_bound_of_hasDerivAt hasDerivAt_remainder_bound hγ_hasderiv ‖L‖ hLnorm_pos refine ⟨δ, hδ_pos, fun t ht_pos ht_lt => ?_⟩ have h := abs_le.mp (abs_norm_gamma_sub_smul_le (hδ_bound t ht_pos ht_lt)) - nlinarith [h.2] + nlinarith only [h, h.2] /-- If γ is continuous on [a,b] and injective at γ(t₀), then γ stays bounded away from γ(t₀) outside any @@ -238,7 +238,7 @@ lemma t_lower_from_gamma_lower have h1 : εC < 2 * ‖L‖ * |t - t₀| := lt_of_lt_of_le h_gamma_lower (h_upper t ht_pos ht_lt) calc εC / (2 * ‖L‖) < (2 * ‖L‖ * |t - t₀|) / (2 * ‖L‖) := - div_lt_div_of_pos_right h1 (by linarith [norm_pos_iff.mpr hL]) + div_lt_div_of_pos_right h1 (by linarith only [hL, norm_pos_iff.mpr hL]) _ = |t - t₀| := by field_simp /-- If γ is C² at t₀, then deriv γ is continuous at t₀. -/ @@ -253,7 +253,7 @@ lemma contAt_deriv_of_contDiffAt_two have h_cont_at_fderiv : ContinuousAt (fderiv ℝ γ) t₀ := h_fderiv_cont.continuousAt (Metric.isOpen_ball.mem_nhds (Metric.mem_ball_self hε_pos)) have h_deriv_eq : deriv γ = (fun t => fderiv ℝ γ t 1) := funext fun t => by - simp_all + simp_all only [gt_iff_lt, fderiv_eq_smul_deriv, one_smul] rw [h_deriv_eq] exact h_cont_at_fderiv.clm_apply continuousAt_const diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/RemainderAnalysis.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/RemainderAnalysis.lean index c9b324bb8a..e122dda4d3 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/RemainderAnalysis.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/RemainderAnalysis.lean @@ -40,7 +40,7 @@ lemma contDiffAt_one_deriv_of_contDiffAt_two ContDiffAt ℝ 1 (deriv γ) t₀ := by have h_apply := (show ContDiffAt ℝ (1 + 1) γ t₀ from hγ_C2).fderiv_right_succ.clm_apply (contDiffAt_const (c := (1 : ℝ))) - simp_all + simp_all only [fderiv_eq_smul_deriv, one_smul] /-- Lipschitz-type bound on `deriv γ` deviation from C². -/ lemma deriv_deviation_bound_of_C2 @@ -87,9 +87,9 @@ lemma quadratic_approx_of_contDiffAt_two simp only [add_sub_cancel_left, abs_of_pos h_half]; exact h_half have h := h_deriv_dev (t₀ + δ₁ / 2) (by simp only [add_sub_cancel_left, abs_of_pos h_half]; exact half_lt_self hδ₁_pos) - linarith [norm_nonneg (deriv γ (t₀ + δ₁ / 2) - L), + linarith only [hM_neg, h_abs, h, norm_nonneg (deriv γ (t₀ + δ₁ / 2) - L), mul_neg_of_neg_of_pos hM_neg h_abs] - have hK_pos : 0 < K := by linarith + have hK_pos : 0 < K := by linarith only [hM_nonneg] use K, δ, hδ_pos, hK_pos intro t ht by_cases ht_eq : t = t₀ @@ -154,7 +154,7 @@ lemma quadratic_approx_of_contDiffAt_two = ‖h t‖ := by rw [h_eq] _ ≤ M * |t - t₀| * |t - t₀| := h_bound _ = M * |t - t₀| ^ 2 := by ring - _ ≤ K * |t - t₀| ^ 2 := by nlinarith [sq_nonneg |t - t₀|] + _ ≤ K * |t - t₀| ^ 2 := by nlinarith only [sq_nonneg |t - t₀|] /-- Bounded slope deviation from C² smoothness. -/ lemma bounded_slope_deviation_of_contDiffAt_two @@ -224,7 +224,7 @@ lemma numerator_quadratic_bound K₁ * |t - t₀| ^ 2 := add_le_add h1 h2 _ = (K₁ + K₂) * |t - t₀| ^ 2 := by ring - _ ≤ (K₁ + K₂ + 1) * |t - t₀| ^ 2 := by nlinarith [sq_nonneg |t - t₀|] + _ ≤ (K₁ + K₂ + 1) * |t - t₀| ^ 2 := by nlinarith only [sq_nonneg |t - t₀|] /-- Bounded remainder from C² smoothness. -/ lemma remainder_bounded_of_C2 diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/SingularAnnulus.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/SingularAnnulus.lean index ed6d4113bb..ecfff9894c 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/SingularAnnulus.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/SingularAnnulus.lean @@ -43,11 +43,11 @@ private lemma ite_const_eq_iff_of_ne {P Q : Prop} [Decidable P] [Decidable Q] {c (hc : c ≠ 0) (h : (if P then c else 0) = if Q then c else 0) : P ↔ Q := by constructor · intro hp - simp_all + simp_all only [ne_eq, ↓reduceIte, left_eq_ite_iff, imp_false, Decidable.not_not] · intro hq rw [ite_eq_left hq] at h by_contra hp - simp_all + simp_all only [ne_eq, ↓reduceIte, not_true_eq_false] /-- The `h'`-thresholded singular indicator is measurable, given `h'` strongly measurable. -/ private lemma singular_annulus_fγ'_measurable {t₀ ε₁ ε₂ : ℝ} {h' : ℝ → ℝ} @@ -78,7 +78,7 @@ private lemma singular_annulus_final_ratio {Kmeas ε₁ ε₂ : ℝ} {L : ℂ} show 4 * Kmeas / ‖L‖ ^ 2 * ε₁ = 4 * Kmeas * ε₁ / ‖L‖ ^ 2 from by ring, div_le_div_iff₀ (mul_pos (by positivity : (0 : ℝ) < ‖L‖ ^ 3) hε₂_pos) (by positivity : (0 : ℝ) < ‖L‖ ^ 2)] - nlinarith [mul_pos hKmeas_pos (pow_pos hL_pos 3), + nlinarith only [hKmeas_pos, hL_pos, hε₁_pos, h_ratio, mul_pos hKmeas_pos (pow_pos hL_pos 3), show ε₁ ^ 2 ≤ ε₁ * (2 * ε₂) from by rw [sq]; exact mul_le_mul_of_nonneg_left h_ratio hε₁_pos.le] /-- The symmetric difference of the two localized annulus regions is measurable, given that the @@ -203,7 +203,7 @@ lemma singular_tAnnLin_inside_interval lt_of_lt_of_le h_abs_lt (min_le_right _ _) rw [abs_lt] at h1 h2 exact Set.mem_Icc.mpr - ⟨by linarith [h1.1], by linarith [h2.2]⟩ + ⟨by linarith only [h1, h1.1], by linarith only [h2, h2.2]⟩ lemma singular_tAnnLin_cancel (t₀ : ℝ) {L : ℂ} (hL_pos : 0 < ‖L‖) @@ -259,7 +259,7 @@ private lemma singular_annulus_f_lin_bound · rw [ite_eq_left hcond] have hlo : ε₂ / (2 * ‖L‖) < |t - t₀| := by calc ε₂ / (2 * ‖L‖) - < ε₂ / ‖L‖ := div_lt_div_of_pos_left hε₂_pos hL_pos (by linarith) + < ε₂ / ‖L‖ := div_lt_div_of_pos_left hε₂_pos hL_pos (by linarith only [hL_pos]) _ ≤ |t - t₀| := by rw [div_le_iff₀ hL_pos, mul_comm]; exact le_of_lt hcond.1 exact inv_norm_le_of_half_lower hL_pos hε₂_pos hlo.le · simp only [hcond, ite_false, norm_zero]; positivity @@ -345,11 +345,11 @@ private lemma lin_indicator_eq_inv_left (MeasureTheory.measure_singleton _) filter_upwards [h_ne] with t ht_ne ht_mem rw [Set.uIoc_of_le hmc₂_le_mc₁] at ht_mem - have h_np : t - t₀ ≤ 0 := by linarith [ht_mem.2] + have h_np : t - t₀ ≤ 0 := by linarith only [hc₁_nonneg, ht_mem, ht_mem.2] exact hφ_val t ⟨by rw [abs_of_nonpos h_np] - linarith [lt_of_le_of_ne ht_mem.2 ht_ne], - by rw [abs_of_nonpos h_np]; linarith [ht_mem.1]⟩ + linarith only [ht_ne, ht_mem, lt_of_le_of_ne ht_mem.2 ht_ne], + by rw [abs_of_nonpos h_np]; linarith only [ht_mem, ht_mem.1]⟩ /-- On `(t₀ + c₁, t₀ + c₂)`, the indicator equals `(t - t₀)⁻¹` (right annular wing). -/ private lemma lin_indicator_eq_inv_right @@ -363,10 +363,10 @@ private lemma lin_indicator_eq_inv_right apply intervalIntegral.integral_congr_ae filter_upwards with t ht_mem rw [Set.uIoc_of_le hpc₁_le_pc₂] at ht_mem - have h_nn : 0 ≤ t - t₀ := by linarith [ht_mem.1] + have h_nn : 0 ≤ t - t₀ := by linarith only [hc₁_nonneg, ht_mem, ht_mem.1] exact hφ_val t - ⟨by rw [abs_of_nonneg h_nn]; linarith [ht_mem.1], - by rw [abs_of_nonneg h_nn]; linarith [ht_mem.2]⟩ + ⟨by rw [abs_of_nonneg h_nn]; linarith only [ht_mem, ht_mem.1], + by rw [abs_of_nonneg h_nn]; linarith only [ht_mem, ht_mem.2]⟩ private lemma singular_annulus_lin_integral_zero {a b t₀ : ℝ} {L : ℂ} {ε₁ ε₂ : ℝ} @@ -386,7 +386,7 @@ private lemma singular_annulus_lin_integral_zero div_le_div_of_nonneg_right hε₂_le (le_of_lt hL_pos) have hc₂_lt_dist : c₂ < min (t₀ - a) (b - t₀) := by rw [show c₂ = ε₁ / ‖L‖ from rfl, div_lt_iff₀ hL_pos] - linarith [mul_comm ‖L‖ (min (t₀ - a) (b - t₀))] + linarith only [hε₁_lt_Ldist, mul_comm ‖L‖ (min (t₀ - a) (b - t₀))] set φ : ℝ → ℂ := fun t => if ε₂ < ‖L‖ * |t - t₀| ∧ ‖L‖ * |t - t₀| ≤ ε₁ then (↑(t - t₀) : ℂ)⁻¹ else 0 @@ -398,8 +398,10 @@ private lemma singular_annulus_lin_integral_zero fun t hnt => ite_eq_right (mt (h_cond_iff t).mp hnt) have hφ_val : ∀ t, c₁ < |t - t₀| ∧ |t - t₀| ≤ c₂ → φ t = (↑(t - t₀) : ℂ)⁻¹ := fun t ht => ite_eq_left ((h_cond_iff t).mpr ht) - have ha_lt_mc₂ : a < t₀ - c₂ := by linarith [lt_of_lt_of_le hc₂_lt_dist (min_le_left _ _)] - have hpc₂_lt_b : t₀ + c₂ < b := by linarith [lt_of_lt_of_le hc₂_lt_dist (min_le_right _ _)] + have ha_lt_mc₂ : a < t₀ - c₂ := by + linarith only [hc₂_lt_dist, lt_of_lt_of_le hc₂_lt_dist (min_le_left _ _)] + have hpc₂_lt_b : t₀ + c₂ < b := by + linarith only [hc₂_lt_dist, lt_of_lt_of_le hc₂_lt_dist (min_le_right _ _)] have h_split := integral_split_five (hφ_int a (t₀ - c₂)) (hφ_int (t₀ - c₂) (t₀ - c₁)) (hφ_int (t₀ - c₁) (t₀ + c₁)) (hφ_int (t₀ + c₁) (t₀ + c₂)) @@ -407,9 +409,11 @@ private lemma singular_annulus_lin_integral_zero have hc₂_pos : 0 < c₂ := div_pos (lt_of_lt_of_le hε₂_pos hε₂_le) hL_pos have h0_L := lin_indicator_zero_left hc₂_pos.le ha_lt_mc₂ (hφ_int a (t₀ - c₂)) hφ_zero have h0_R := lin_indicator_zero_right hc₂_pos.le hpc₂_lt_b (hφ_int (t₀ + c₂) b) hφ_zero - have h0_M := lin_indicator_zero_middle (by linarith : t₀ - c₁ ≤ t₀ + c₁) hφ_zero - have hE_L := lin_indicator_eq_inv_left hc₁_pos.le (by linarith : t₀ - c₂ ≤ t₀ - c₁) hφ_val - have hE_R := lin_indicator_eq_inv_right hc₁_pos.le (by linarith : t₀ + c₁ ≤ t₀ + c₂) hφ_val + have h0_M := lin_indicator_zero_middle (by linarith only [hc₁_pos] : t₀ - c₁ ≤ t₀ + c₁) hφ_zero + have hE_L := + lin_indicator_eq_inv_left hc₁_pos.le (by linarith only [hc₁_le_c₂] : t₀ - c₂ ≤ t₀ - c₁) hφ_val + have hE_R := + lin_indicator_eq_inv_right hc₁_pos.le (by linarith only [hc₁_le_c₂] : t₀ + c₁ ≤ t₀ + c₂) hφ_val rw [h_split, h0_L, h0_R, h0_M, hE_L, hE_R] simpa only [zero_add, add_zero] using singular_tAnnLin_cancel t₀ hL_pos ε₁ ε₂ hε₂_pos hε₂_le @@ -565,8 +569,8 @@ lemma singular_annulus_bound_explicit no_return_of_inj_continuous hδ₁_pos hγ_cont h_inj have ht₀_mem := Set.mem_Ioo.mp hat₀ have h_dist_pos : - 0 < min (t₀ - a) (b - t₀) := by - simp_all + 0 < min (t₀ - a) (b - t₀) := + lt_min (sub_pos.mpr ht₀_mem.1) (sub_pos.mpr ht₀_mem.2) let δ := min (min δ_meas ρ) (min (‖L‖ * min (t₀ - a) (b - t₀)) (‖L‖ * δ₀')) have hδ_pos : 0 < δ := @@ -594,7 +598,7 @@ lemma singular_annulus_bound_explicit by_contra h_not_lt push Not at h_not_lt have h_far := h_far_bound t ht h_not_lt - linarith + linarith only [hε₁_lt_ρ, hγt, h_far] have hJ_lin_zero : (∫ t in a..b, if ε₂ < ‖L‖ * |t - t₀| ∧ diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/StepBounds.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/StepBounds.lean index 219e5976ab..bd3a9a309e 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/StepBounds.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/StepBounds.lean @@ -83,11 +83,11 @@ lemma remainder_integral_O_eps {r : ℝ → ℂ} {t₀ ε C : ℝ} ‖∫ t in (t₀ + ε)..(t₀ + 2 * ε), r t‖ ≤ 2 * C * ε := by have h_left := norm_integral_le_const_left (r := r) (t₀ := t₀) - (a := ε) (b := 2 * ε) (B := 2 * ε) hε_pos (by linarith) le_rfl hr_bound + (a := ε) (b := 2 * ε) (B := 2 * ε) hε_pos (by linarith only [hε_pos]) le_rfl hr_bound have h_right := norm_integral_le_const_right (r := r) (t₀ := t₀) - (a := ε) (b := 2 * ε) (B := 2 * ε) hε_pos (by linarith) le_rfl hr_bound + (a := ε) (b := 2 * ε) (B := 2 * ε) hε_pos (by linarith only [hε_pos]) le_rfl hr_bound rw [show 2 * ε - ε = ε by ring] at h_left h_right - linarith + linarith only [h_left, h_right] /-- Symmetric cancellation of 1/(t-t₀). -/ lemma integral_inv_symm @@ -110,7 +110,7 @@ lemma integral_inv_symm simp only [show 2 * t₀ - (t₀ + ε₂) = t₀ - ε₂ from by ring, show 2 * t₀ - (t₀ + ε₁) = t₀ - ε₁ from by ring, show ∀ x, 2 * t₀ - x - t₀ = -(x - t₀) from fun x => by ring, h_odd] at h1 - simp_all + simp_all only [ofReal_neg, inv_neg, implies_true, ofReal_sub, intervalIntegral.integral_neg] rw [h_reflect, neg_add_cancel] /-- The base integral `∫ η/u` over `[c₁, c₂]` evaluates to `η log(c₂/c₁)`. -/ @@ -260,8 +260,9 @@ lemma step_bound_with_eta {r : ℝ → ℂ} calc ‖∫ t in (t₀ - ε)..(t₀ - ε / 2), r t‖ + ‖∫ t in (t₀ + ε / 2)..(t₀ + ε), r t‖ ≤ 2 * η * Real.log (ε / (ε / 2)) := - remainder_annulus_bound (by linarith) hε_pos (by linarith) hη_pos - (fun t ht_lo ht_hi => hr_bound t (by linarith) ht_hi.le) + remainder_annulus_bound (by linarith only [hε_pos]) hε_pos (by linarith only [hε_pos]) + hη_pos + (fun t ht_lo ht_hi => hr_bound t (by linarith only [ht_lo, ht_hi]) ht_hi.le) _ = 2 * η * Real.log 2 := by rw [show ε / (ε / 2) = 2 from by field_simp] /-- Error bound extends to smaller scales. -/ @@ -507,7 +508,7 @@ lemma summableSubseqAux_tendsto_zero {γ : ℝ → ℂ} have h_squeeze : ∀ n, ε n ≤ ε 0 * (1 / 2) ^ n := fun n => by have h1 := summableSubseqAux_le_geometric hL hγ_hasderiv hγ_cont_deriv δ₀ hδ₀_pos n have h2 : ε 0 / 2 ^ n = ε 0 * (1 / 2) ^ n := by rw [one_div, inv_pow, ← div_eq_mul_inv] - linarith + linarith only [hL, hγ_hasderiv, hγ_cont_deriv, h1, h2] have h_geom_tendsto : Tendsto (fun n => ε 0 * (1 / 2 : ℝ) ^ n) atTop (𝓝 0) := by @@ -645,7 +646,8 @@ lemma remainder_step_bound {r : ℝ → ℂ} calc ‖∫ t in (t₀ - ε)..(t₀ - ε / 2), r t‖ + ‖∫ t in (t₀ + ε / 2)..(t₀ + ε), r t‖ ≤ 2 * η * Real.log (ε / (ε / 2)) := - remainder_annulus_bound (by linarith) hε_pos (by linarith) (by linarith) hr_bound + remainder_annulus_bound (by linarith only [hε_pos]) hε_pos (by linarith only [hε_pos]) (by + linarith only [_hη_pos]) hr_bound _ = 2 * η * Real.log 2 := by rw [show ε / (ε / 2) = 2 from by field_simp] /-- Remainder bounded ratio for annuli. -/ @@ -666,7 +668,7 @@ lemma remainder_bounded_ratio {r : ℝ → ℂ} remainder_annulus_bound hε₁_pos (lt_trans hε₁_pos hε₁₂) hε₁₂ hη_pos hr_bound _ ≤ 2 * η * Real.log K := by - nlinarith [Real.log_pos _hK, + nlinarith only [hε₁_pos, hε₁₂, hη_pos, h_ratio, Real.log_pos _hK, Real.log_le_log (div_pos (lt_trans hε₁_pos hε₁₂) hε₁_pos) h_ratio] /-- Dyadic step bound for remainder. -/ @@ -690,7 +692,7 @@ lemma remainder_dyadic_step {r : ℝ → ℂ} have h_lt : ε₀ / 2 ^ (n + 1) < ε₀ / 2 ^ n := by have h_pow_lt : (2 : ℝ) ^ n < 2 ^ (n + 1) := by have h : (2 : ℝ) ^ (n + 1) = 2 ^ n * 2 := by ring - rw [h]; linarith + rw [h]; linarith only [h_pow_pos] exact div_lt_div_of_pos_left hε₀_pos h_pow_pos h_pow_lt have h_ratio : @@ -731,11 +733,15 @@ lemma pv_dyadic_step_O_eps {r : ℝ → ℂ} div_le_self hδ₀_pos.le (one_le_pow₀ (by norm_num : (1 : ℝ) ≤ 2)) have h_left := norm_integral_le_const_left (r := r) (t₀ := t₀) - (a := ε_n / 2) (b := ε_n) (B := δ₀) hε_n_half_pos (by linarith) hε_n_le_δ₀ hr_bounded + (a := + ε_n / 2) (b := ε_n) (B := δ₀) hε_n_half_pos (by linarith only + [hε_n_pos]) hε_n_le_δ₀ hr_bounded have h_right := norm_integral_le_const_right (r := r) (t₀ := t₀) - (a := ε_n / 2) (b := ε_n) (B := δ₀) hε_n_half_pos (by linarith) hε_n_le_δ₀ hr_bounded + (a := + ε_n / 2) (b := ε_n) (B := δ₀) hε_n_half_pos (by linarith only + [hε_n_pos]) hε_n_le_δ₀ hr_bounded rw [show ε_n - ε_n / 2 = ε_n / 2 by ring] at h_left h_right - linarith + linarith only [h_left, h_right] /-- Dyadic sequence is Cauchy with bounded remainder. -/ lemma cauchySeq_pv_dyadic {I : ℝ → ℂ} {δ₀ C : ℝ} @@ -764,7 +770,7 @@ lemma t_bound_from_gamma_annulus |t - t₀| ≤ 2 * ε / ‖L‖ := by have hL_norm_pos : 0 < ‖L‖ := norm_pos_iff.mpr hL rw [le_div_iff₀ hL_norm_pos] - nlinarith [h_lower t ht_pos ht_lt, hγ_bound] + nlinarith only [h_lower, ht_pos, ht_lt, hγ_bound, h_lower t ht_pos ht_lt] /-- Integrand bound on γ-annulus. -/ lemma integrand_bound_on_annulus @@ -781,7 +787,7 @@ lemma integrand_bound_on_annulus |t - t₀|⁻¹ := by rw [norm_inv, Complex.norm_real, Real.norm_eq_abs] have h := norm_sub_norm_le ((γ t - γ t₀)⁻¹ * deriv γ t) (↑(t - t₀))⁻¹ rw [h_inv_norm] at h - linarith [hr_bounded t ht_pos ht_lt] + linarith only [hr_bounded, ht_pos, ht_lt, h, hr_bounded t ht_pos ht_lt] /-- Annulus localization: γ-annulus points are local. -/ lemma annulus_implies_t_local @@ -792,7 +798,7 @@ lemma annulus_implies_t_local (t : ℝ) (ht_ab : t ∈ Set.Icc a b) (hγ_bound : ‖γ t - γ t₀‖ ≤ ε₁) : |t - t₀| < δ₀ ∧ |t - t₀| < δ₁ := by - simp_all + simp_all only [mem_Icc, lt_min_iff, and_imp, and_self] /-- Bracket ε between dyadic points: for ε ∈ (0, δ], find n with δ/2^(n+1) < ε ≤ δ/2^n. -/ lemma exists_dyadic_bracket {δ ε : ℝ} diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/UniformStepBound.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/UniformStepBound.lean index e85e19c66e..664ce2b208 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/UniformStepBound.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PVInfrastructure/UniformStepBound.lean @@ -64,13 +64,13 @@ private lemma singular_cutoff_intervalIntegrable · rw [ite_eq_left hcond, norm_inv, Complex.norm_real, Real.norm_eq_abs] have h_t_ne : t ≠ t₀ := by intro heq; subst heq - simp only [sub_self, norm_zero] at hcond; linarith [hcond.1] + simp only [sub_self, norm_zero] at hcond; linarith only [hε₂_pos, hcond, hcond.1] have h_abs_pos : 0 < |t - t₀| := abs_pos.mpr (sub_ne_zero.mpr h_t_ne) have h_lt_δ_up : |t - t₀| < δ_up := h_loc t ht_Icc hcond.2 have h_up := h_upper t h_abs_pos h_lt_δ_up have h_t_lower : ε₂ / (2 * ‖L‖) < |t - t₀| := by rw [div_lt_iff₀ (by positivity : 0 < 2 * ‖L‖)] - linarith [hcond.1] + linarith only [hcond, h_up, hcond.1] calc |t - t₀|⁻¹ ≤ (ε₂ / (2 * ‖L‖))⁻¹ := inv_anti₀ (by positivity) (le_of_lt h_t_lower) _ = 2 * ‖L‖ / ε₂ := by rw [inv_div] @@ -97,7 +97,8 @@ private lemma annulus_cutoff_intervalIntegrable · rw [ite_eq_left h₂] by_cases h₁ : ε₁ < ‖γ t - γ t₀‖ · rw [ite_eq_left h₁, sub_self, ite_eq_right (fun h => absurd h₁ (not_lt.mpr h.2))] - · simp_all + · simp_all only [not_lt, and_self, ↓reduceIte, sub_eq_self, ite_eq_right_iff, isEmpty_Prop, + IsEmpty.forall_iff] · rw [ite_eq_right h₂, zero_sub] by_cases h₁ : ε₁ < ‖γ t - γ t₀‖ · exact absurd (lt_of_le_of_lt hε₂_le h₁) h₂ @@ -125,7 +126,7 @@ private lemma annulus_integral_split by_cases hcond : ε₂ < ‖γ t - γ t₀‖ ∧ ‖γ t - γ t₀‖ ≤ ε₁ · rw [ite_eq_left hcond, ite_eq_left hcond, ite_eq_left hcond]; ring · rw [ite_eq_right hcond, ite_eq_right hcond, ite_eq_right hcond, add_zero] - simp_all + simp_all only [ofReal_sub, intervalIntegral.integral_add] /-- Uniform step bound with epsilon-independent constant. -/ lemma pv_step_bound_ratio_two_uniform @@ -186,10 +187,10 @@ lemma pv_step_bound_ratio_two_uniform have hε₁_lt_ρ : ε₁ < ρ := by calc ε₁ < δ := hε₁_lt _ ≤ ρ / 2 := min_le_right _ _ - _ < ρ := by linarith + _ < ρ := by linarith only [hρ_pos] by_contra h_not_lt push Not at h_not_lt - linarith [h_far_bound t ht h_not_lt] + linarith only [h_far_bound, ht, hγ_le, hε₁_lt_ρ, h_not_lt, h_far_bound t ht h_not_lt] have hI_int₂ := cutoff_integrand_intervalIntegrable hat₀ hL hγ_meas hγ_cont_deriv ε₂ hε₂_pos diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PiecewiseCurveAPI.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PiecewiseCurveAPI.lean index ce1ed0b958..ea5abcb626 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PiecewiseCurveAPI.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PiecewiseCurveAPI.lean @@ -85,7 +85,7 @@ theorem sortedPartition_head (γ : PiecewiseC1Curve) : have hne := sortedPartition_nonempty γ have h_a_mem : γ.a ∈ γ.sortedPartition := (mem_sortedPartition γ γ.a).mpr γ.endpoints_in_partition.1 - linarith [(sortedPartition_mem_Icc γ _ (List.head_mem hne)).1, + linarith only [hne, h_a_mem, (sortedPartition_mem_Icc γ _ (List.head_mem hne)).1, (sortedPartition_sorted γ).rel_head h_a_mem] /-- Helper: in a sorted list, every element is ≤ the last element. -/ @@ -112,7 +112,7 @@ theorem sortedPartition_last (γ : PiecewiseC1Curve) : have hne := sortedPartition_nonempty γ have h_b_mem : γ.b ∈ γ.sortedPartition := (mem_sortedPartition γ γ.b).mpr γ.endpoints_in_partition.2 - linarith [(sortedPartition_mem_Icc γ _ (List.getLast_mem hne)).2, + linarith only [hne, h_b_mem, (sortedPartition_mem_Icc γ _ (List.getLast_mem hne)).2, (sortedPartition_sorted γ).rel_getLast h_b_mem] /-! ### Consecutive pairs cover `[a, b]` -/ diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PrincipalValue.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PrincipalValue.lean index e060ce633e..1c7c0dbb86 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/PrincipalValue.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/PrincipalValue.lean @@ -225,15 +225,15 @@ private theorem pv_uniform_bound_of_continuous_aux le_trans (norm_nonneg _) (hMg' _ ⟨a, left_mem_Icc.mpr hab.le, rfl⟩) have hMγ_nn : (0 : ℝ) ≤ Mγ' := le_trans (norm_nonneg _) (hMγ'' a (left_mem_Icc.mpr hab.le)) - refine ⟨Mg * Mγ' + 1, by linarith [mul_nonneg hMg_nn hMγ_nn], + refine ⟨Mg * Mγ' + 1, by linarith only [hMg_nn, hMγ_nn, mul_nonneg hMg_nn hMγ_nn], fun ε _ t ht => ?_⟩ unfold cauchyPrincipalValueIntegrand'; split_ifs with h · calc ‖g (γ t) * deriv γ t‖ = ‖g (γ t)‖ * ‖deriv γ t‖ := norm_mul _ _ _ ≤ Mg * Mγ' := mul_le_mul (hMg' _ ⟨t, ht, rfl⟩) (hMγ'' t ht) (norm_nonneg _) hMg_nn - _ ≤ Mg * Mγ' + 1 := by linarith - · simp only [norm_zero]; linarith [mul_nonneg hMg_nn hMγ_nn] + _ ≤ Mg * Mγ' + 1 := by linarith only [] + · simp only [norm_zero]; linarith only [hMg_nn, hMγ_nn, mul_nonneg hMg_nn hMγ_nn] /-- PV exists for continuous integrands on C¹ curves. -/ theorem cauchyPrincipalValueExists_of_continuous @@ -259,7 +259,8 @@ theorem cauchyPrincipalValueExists_of_continuous exact ⟨Ioo 0 ‖γ t - z₀‖, Ioo_mem_nhdsGT (norm_pos_iff.mpr (sub_ne_zero.mpr h)), fun ε hε => by - simp_all⟩) tendsto_const_nhds⟩ + simp_all only [gt_iff_lt, mem_Icc, and_imp, mem_Ioo, + cauchyPrincipalValueIntegrand'_of_gt]⟩) tendsto_const_nhds⟩ · filter_upwards [self_mem_nhdsWithin] with ε _ exact (aEStronglyMeasurable_pv_integrand (hg.mono sdiff_subset) hγ hγ').mono_measure diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue.lean index c83dcb264a..9105caa58b 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue.lean @@ -214,7 +214,7 @@ lemma piecewiseC1_deriv_intervalIntegrable (γ : PiecewiseC1Curve) obtain ⟨M, hM⟩ := h_bdd rw [intervalIntegrable_iff] refine MeasureTheory.IntegrableOn.of_bound ?_ ?_ M ?_ - · simp_all + · simp_all only [mem_Icc, and_imp, Real.volume_uIoc, ENNReal.ofReal_lt_top] · exact (aestronglyMeasurable_deriv γ.toFun _).restrict · rw [MeasureTheory.ae_restrict_iff' measurableSet_uIoc] apply Filter.Eventually.of_forall @@ -369,7 +369,8 @@ private lemma diff_punctured_of_diff_off_poles (fun h => (Set.mem_compl_singleton_iff.mp hw_ne) (Set.mem_singleton_iff.mp (h_S0_singleton h)))⟩ · have h_S0_non : ∃ s' ∈ S0, s' ≠ z := by - simp_all + obtain ⟨s', hs', hne⟩ := Set.not_subset.mp h_S0_singleton + exact ⟨s', hs', fun h => hne (Set.mem_singleton_iff.mpr h)⟩ obtain ⟨s', hs'_in, hs'_ne⟩ := h_S0_non have h_ne : (S0.filter (· ≠ z)).Nonempty := ⟨s', Finset.mem_filter.mpr ⟨hs'_in, hs'_ne⟩⟩ @@ -383,10 +384,11 @@ private lemma diff_punctured_of_diff_off_poles intro hw_in_S0 rcases eq_or_ne w z with rfl | hw_eq · exact hw_ne_z rfl - · linarith [Finset.inf'_le (fun s => ‖s - z‖) (show w ∈ S0.filter (· ≠ z) from - Finset.mem_filter.mpr ⟨Finset.mem_coe.mp hw_in_S0, hw_eq⟩), - (dist_eq_norm w z ▸ show dist w z < δ from - lt_of_lt_of_le hw (min_le_right _ _) : ‖w - z‖ < δ)] + · have h_dist_ge : δ ≤ ‖w - z‖ := Finset.inf'_le (fun s => ‖s - z‖) + (Finset.mem_filter.mpr ⟨Finset.mem_coe.mp hw_in_S0, hw_eq⟩) + have h_dist_lt : ‖w - z‖ < δ := dist_eq_norm w z ▸ + lt_of_lt_of_le hw (min_le_right _ _) + exact (not_lt_of_ge h_dist_ge) h_dist_lt lemma simple_poles_decomposition (U : Set ℂ) (hU : IsOpen U) @@ -510,14 +512,14 @@ lemma cauchyPrincipalValueIntegrandOn_eq_of_far cauchyPrincipalValueIntegrandOn S0 f γ ε t = f (γ t) * deriv γ t := by unfold cauchyPrincipalValueIntegrandOn - rw [ite_eq_right]; push Not; intro s hs; linarith [h_far s hs] + rw [ite_eq_right]; push Not; intro s hs; linarith only [h_far, hs, h_far s hs] lemma cauchyPrincipalValueIntegrandOn_empty (f : ℂ → ℂ) (γ : ℝ → ℂ) (ε : ℝ) (t : ℝ) : cauchyPrincipalValueIntegrandOn ∅ f γ ε t = f (γ t) * deriv γ t := by unfold cauchyPrincipalValueIntegrandOn - simp_all + simp_all only [Finset.notMem_empty, false_and, exists_const, ↓reduceIte] lemma cauchyPrincipalValueIntegrandOn_singleton (f : ℂ → ℂ) (γ : ℝ → ℂ) (z₀ : ℂ) (ε : ℝ) (t : ℝ) : @@ -526,8 +528,12 @@ lemma cauchyPrincipalValueIntegrandOn_singleton else 0 := by unfold cauchyPrincipalValueIntegrandOn by_cases h : ‖γ t - z₀‖ ≤ ε - · simp_all - · simp_all + · simp_all only [Finset.mem_singleton, exists_eq_left, ↓reduceIte, gt_iff_lt, right_eq_ite_iff, + zero_eq_mul, + isEmpty_Prop, not_lt, IsEmpty.forall_iff] + · simp_all only [not_le, Finset.mem_singleton, exists_eq_left, gt_iff_lt, ↓reduceIte, + ite_eq_right_iff, + zero_eq_mul, isEmpty_Prop, IsEmpty.forall_iff] lemma cauchyPrincipalValueOn_empty (f : ℂ → ℂ) (γ : ℝ → ℂ) (a b : ℝ) : @@ -676,7 +682,7 @@ theorem pv_integral_simple_pole then (·⁻¹) ((fun s => γ.toFun s - z₀) t) * deriv (fun s => γ.toFun s - z₀) t else 0)).symm] - simp_all + simp_all only [sub_zero, gt_iff_lt, deriv_sub_const_fun, implies_true, ite_mul, zero_mul] simp_rw [h_integral'] obtain ⟨L, hL⟩ := hPV exact (hL.mul_const c).limUnder_eq ▸ diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/Flatness.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/Flatness.lean index 532ee03807..70bb09dc6e 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/Flatness.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/Flatness.lean @@ -102,7 +102,7 @@ theorem norm_tangentDeviation_le (w L : ℂ) (hL : L ≠ 0) : have hns : 0 < Complex.normSq L := Complex.normSq_pos.mpr hL unfold tangentDeviation orthogonalProjectionComplex suffices h : ‖((w * starRingEnd ℂ L).re / Complex.normSq L) • L‖ ≤ ‖w‖ by - linarith [norm_sub_le w (((w * starRingEnd ℂ L).re / Complex.normSq L) • L)] + linarith only [h, norm_sub_le w (((w * starRingEnd ℂ L).re / Complex.normSq L) • L)] rw [norm_smul, Real.norm_eq_abs] calc |(w * starRingEnd ℂ L).re / Complex.normSq L| * ‖L‖ ≤ (‖w‖ * ‖L‖ / Complex.normSq L) * ‖L‖ := by @@ -187,7 +187,7 @@ private theorem tangentDeviation_isLittleO_of_remainder have h2 : ‖(t - t₀) • L‖ ≤ ‖γ t - γ t₀‖ + ‖r t‖ := (show (t - t₀) • L = (γ t - γ t₀) - r t by simp [hr_def]) ▸ norm_sub_le _ _ rw [div_mul_eq_mul_div, le_div_iff₀ hL_pos] - nlinarith [norm_nonneg (γ t - γ t₀), ht] + nlinarith only [ht, h1, h2, norm_nonneg (γ t - γ t₀)] exact (ho1.trans_isBigO hO2).congr_left fun t => (h_eq t).symm /-- Key lemma: if gamma has derivative L at t_0, then the tangent deviation of @@ -392,7 +392,8 @@ theorem satisfiesConditionB_of_simple_poles · -- Smooth point: angle = pi = 1*pi/1 refine ⟨1, 1, one_ne_zero, Nat.coprime_one_left 1, ?_⟩ rw [angleAtCrossing_smooth γ t₀ ht₀_Ioo hp] - simp_all + simp_all only [mem_Icc, mem_Ioo, ne_eq, Nat.exists_ne_zero, Nat.cast_add, Nat.cast_one, + forall_and_index, one_mul, div_one] · intro s hs t₀ _ht₀ _hcross _ht₀_Ioo obtain ⟨c, g, hg, hf_eq⟩ := _hSimplePoles s hs refine ⟨1, ![c], g, hg, ?_, ?_⟩ @@ -400,7 +401,12 @@ theorem satisfiesConditionB_of_simple_poles rw [hz] simp [pow_one] ring - · simp_all + · simp_all only [mem_Icc, mem_Ioo, ne_eq, Nat.exists_ne_zero, Nat.cast_add, Nat.cast_one, + forall_and_index, Matrix.cons_val_fin_one, Fin.val_eq_zero, ge_iff_le, nonpos_iff_eq_zero, + one_ne_zero, CharP.cast_eq_zero, + zero_mul, zero_eq_mul, Int.cast_eq_zero, mul_eq_zero, OfNat.ofNat_ne_zero, + Real.pi_ne_zero, or_self, or_true, + not_isEmpty_of_nonempty, IsEmpty.exists_iff, implies_true] /-- Both conditions (A) and (B) are satisfied for simple poles, provided corner crossing angles are rational multiples of π. Condition (A) is fully diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/BoundaryVanishing.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/BoundaryVanishing.lean index 0b0144c91b..70ac70bc8a 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/BoundaryVanishing.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/BoundaryVanishing.lean @@ -158,7 +158,7 @@ private lemma slope_tendsto_right_of_deriv have h_no_part : ∀ t ∈ Ioo t₀ δ, t ∉ γ.toPiecewiseC1Curve.partition := by intro t ht htp have ht_in : t ∈ P := Finset.mem_filter.mpr ⟨htp, ht.1⟩ - linarith [Finset.min'_le P t ht_in, ht.2] + linarith only [ht, ht_in, Finset.min'_le P t ht_in, ht.2] have h_sub : Ioo t₀ δ ⊆ Icc γ.a γ.b := fun t ht => ⟨le_of_lt (lt_trans ht₀.1 ht.1), le_trans (le_of_lt ht.2) hδ_le_b⟩ have h_diff : DifferentiableOn ℝ γ.toFun (Ioo t₀ δ) := fun t ht => @@ -233,7 +233,7 @@ private lemma slope_tendsto_left_of_deriv have h_no_part : ∀ t ∈ Ioo δ t₀, t ∉ γ.toPiecewiseC1Curve.partition := by intro t ht htp have ht_in : t ∈ P := Finset.mem_filter.mpr ⟨htp, ht.2⟩ - linarith [Finset.le_max' P t ht_in, ht.1] + linarith only [ht, ht_in, Finset.le_max' P t ht_in, ht.1] have h_sub : Ioo δ t₀ ⊆ Icc γ.a γ.b := fun t ht => ⟨le_of_lt (lt_of_le_of_lt ha_le_δ ht.1), le_of_lt (lt_trans ht.2 ht₀.2)⟩ have h_diff : DifferentiableOn ℝ γ.toFun (Ioo δ t₀) := fun t ht => @@ -420,18 +420,19 @@ theorem norm_sub_le_tangentDeviation_of_unit (u v : ℂ) Complex.abs_re_le_norm _ _ = 1 := by rw [norm_mul, hu, starRingEnd_apply, norm_star, hv, mul_one] exact le_of_abs_le h1 - have h_re_bound : 1 - (u * starRingEnd ℂ v).re = ‖u - v‖ ^ 2 / 2 := by linarith + have h_re_bound : 1 - (u * starRingEnd ℂ v).re = ‖u - v‖ ^ 2 / 2 := by linarith only [h_normSq] have h_tri := norm_add_le (tangentDeviation u v) (((u * starRingEnd ℂ v).re - 1) • v) rw [← h_decomp] at h_tri have h_smul_norm : ‖((u * starRingEnd ℂ v).re - 1) • v‖ = ‖u - v‖ ^ 2 / 2 := by - rw [norm_smul, Real.norm_eq_abs, hv, mul_one, abs_of_nonpos (by linarith), neg_sub, + rw [norm_smul, Real.norm_eq_abs, hv, mul_one, abs_of_nonpos (by linarith only [h_re_le]), + neg_sub, h_re_bound] have h_sq_le : ‖u - v‖ ^ 2 / 2 ≤ ‖u - v‖ / 2 := by rw [div_le_div_iff_of_pos_right two_pos] calc ‖u - v‖ ^ 2 = ‖u - v‖ * ‖u - v‖ := sq _ _ ≤ ‖u - v‖ * 1 := mul_le_mul_of_nonneg_left h_close (norm_nonneg _) _ = ‖u - v‖ := mul_one _ - linarith [h_smul_norm, h_sq_le, h_tri] + linarith only [h_tri, h_smul_norm, h_sq_le] private lemma eq_exp_arg_mul_I_of_norm_one (z : ℂ) (hz : ‖z‖ = 1) : z = exp (↑(arg z) * I) := by @@ -457,7 +458,7 @@ lemma unit_zpow_eq_of_angle_multiple rw [h_eq, mul_eq_zero] left rw [ofReal_eq_zero] - linarith + linarith only [hn] private lemma orthogonalProjectionComplex_real_smul_left (c : ℝ) (w L : ℂ) : orthogonalProjectionComplex (c • w) L = c • orthogonalProjectionComplex w L := by @@ -514,8 +515,8 @@ private lemma unit_sq_le_two_mul_tangentDeviation_sq rw [← mul_assoc, mul_comm u (↑R : ℂ), mul_assoc, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero] rw [hre]; ring - have hR_le : R ≤ 1 := by nlinarith [sq_nonneg (‖tangentDeviation u v₀‖)] - rw [h_lhs, h_rhs]; nlinarith [hR_pos.le, hR_le] + have hR_le : R ≤ 1 := by nlinarith only [h_lhs, sq_nonneg (‖tangentDeviation u v₀‖)] + rw [h_lhs, h_rhs]; nlinarith only [hR_pos, h_lhs, hR_pos.le, hR_le] private lemma norm_sub_le_sqrt2_tangentDeviation (u v₀ : ℂ) (hu : ‖u‖ = 1) (hv₀ : ‖v₀‖ = 1) diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/CutoffInfrastructure.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/CutoffInfrastructure.lean index e0935d0bf6..7bc27aa0eb 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/CutoffInfrastructure.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/CutoffInfrastructure.lean @@ -51,7 +51,9 @@ private lemma direction_rate_from_flatness_right have hL_pos : (0 : ℝ) < ‖L_R‖ := norm_pos_iff.mpr hL_R_ne have hL_ne : ‖L_R‖ ≠ 0 := ne_of_gt hL_pos have hv₀_norm : ‖v₀‖ = 1 := by - simp_all + simp_all only [mem_Ioo, ne_eq, norm_pos_iff, not_false_eq_true, norm_eq_zero, + Complex.norm_div, norm_real, + norm_norm, div_self] have h_flat_eps : (fun ε => ‖tangentDeviation (γ.toFun (σ ε) - s) L_R‖) =o[𝓝[>] 0] (fun ε => ε ^ m) := by have h1 := (h_flat.right_flat L_R hL_R_ne htend_R).congr @@ -113,7 +115,9 @@ private lemma direction_rate_from_flatness_left have hL_pos : (0 : ℝ) < ‖L_L‖ := norm_pos_iff.mpr hL_L_ne have hL_ne : ‖L_L‖ ≠ 0 := ne_of_gt hL_pos have hv₀_norm : ‖v₀‖ = 1 := by - simp_all + simp_all only [mem_Ioo, ne_eq, norm_pos_iff, not_false_eq_true, norm_eq_zero, + Complex.norm_div, norm_neg, + norm_real, norm_norm, div_self] have h_flat_eps : (fun ε => ‖tangentDeviation (γ.toFun (σ ε) - s) (-L_L)‖) =o[𝓝[>] 0] (fun ε => ε ^ m) := by have h1 := (h_flat.left_flat L_L hL_L_ne htend_L).congr @@ -467,13 +471,15 @@ private lemma cutoff_zpow_direction_and_ftc have hne_left : ∀ t ∈ Icc γ.a (σ₁ ε), γ.toFun t ≠ s := by intro t ht habs rcases eq_or_lt_of_le ht.2 with rfl | ht_lt - · rw [habs, sub_self, norm_zero] at h5; linarith [hε.1] - · have := h7 t ⟨ht.1, ht_lt⟩; rw [habs, sub_self, norm_zero] at this; linarith [hε.1] + · rw [habs, sub_self, norm_zero] at h5; linarith only [hε, h5, hε.1] + · have := h7 t ⟨ht.1, ht_lt⟩; rw [habs, sub_self, norm_zero] at this; linarith only [hε, + this, hε.1] have hne_right : ∀ t ∈ Icc (σ₂ ε) γ.b, γ.toFun t ≠ s := by intro t ht habs rcases eq_or_lt_of_le ht.1 with rfl | ht_gt - · rw [habs, sub_self, norm_zero] at h6; linarith [hε.1] - · have := h8 t ⟨ht_gt, ht.2⟩; rw [habs, sub_self, norm_zero] at this; linarith [hε.1] + · rw [habs, sub_self, norm_zero] at h6; linarith only [hε, h6, hε.1] + · have := h8 t ⟨ht_gt, ht.2⟩; rw [habs, sub_self, norm_zero] at this; linarith only [hε, + this, hε.1] exact cutoff_zpow_integral_eq_boundary γ s m hm hγ_closed (σ₁ ε) (σ₂ ε) ε h1 (lt_trans h2 h3) h4 hε.1 h5 h6 h7 h8 h9 (zpow_mul_deriv_intervalIntegrable γ s m γ.a (σ₁ ε) h1 le_rfl @@ -540,15 +546,18 @@ lemma cutoff_zpow_infrastructure · filter_upwards [hIoo_ev] with ε hε change γ.toFun (σ₂ ε) - s ≠ 0 have h_norm := (hprops ε hε).2.2.2.2.2.1 - exact sub_ne_zero.mpr (fun h => by rw [h, sub_self, norm_zero] at h_norm; linarith [hε.1]) + exact sub_ne_zero.mpr (fun h => by rw [h, sub_self, norm_zero] at h_norm; linarith only [hε, + h_norm, hε.1]) · filter_upwards [hIoo_ev] with ε hε change γ.toFun (σ₁ ε) - s ≠ 0 have h_norm := (hprops ε hε).2.2.2.2.1 - exact sub_ne_zero.mpr (fun h => by rw [h, sub_self, norm_zero] at h_norm; linarith [hε.1]) + exact sub_ne_zero.mpr (fun h => by rw [h, sub_self, norm_zero] at h_norm; linarith only [hε, + h_norm, hε.1]) · change ‖L_R / ↑‖L_R‖‖ = 1 - simp_all + rw [norm_div, Complex.norm_real, norm_norm, div_self (norm_ne_zero_iff.mpr hL_R_ne)] · change ‖-L_L / ↑‖L_L‖‖ = 1 - simp_all + rw [norm_div, norm_neg, Complex.norm_real, norm_norm, + div_self (norm_ne_zero_iff.mpr hL_L_ne)] · have h_arg_uR : uR.arg = L_R.arg := by change (L_R / ↑‖L_R‖).arg = L_R.arg rw [div_eq_inv_mul, ← Complex.ofReal_inv, diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/HigherOrderAssembly.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/HigherOrderAssembly.lean index 4080b2d6a6..b180e6d8ec 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/HigherOrderAssembly.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/HigherOrderAssembly.lean @@ -409,7 +409,7 @@ private theorem cpv_tendsto_zero_of_add_split_set intro hmem have hmem' := Finset.mem_coe.mp hmem have := h_near (γ.toFun t) hmem' - rw [sub_self, norm_zero] at this; linarith + rw [sub_self, norm_zero] at this; linarith only [hε, this] congr 1; exact h_off_S0 (γ.toFun t) hγt_not_S0 rw [show (fun t => cauchyPrincipalValueIntegrandOn S0 g γ.toFun ε t) = fun t => cauchyPrincipalValueIntegrandOn S0 diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/PerTermVanishing.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/PerTermVanishing.lean index b14f1fe594..b922e899d3 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/PerTermVanishing.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/PerTermVanishing.lean @@ -573,18 +573,19 @@ private lemma dct_bound_diff_cpv_zpow by_cases h_single_cut : ‖γ.toFun t - s‖ > ε · rw [ite_eq_left h_single_cut]; simp only [sub_zero] obtain ⟨s', hs', hs'_close⟩ := h_multi_cut - have hs'_ne : s' ≠ s := by intro heq; rw [heq] at hs'_close; linarith + have hs'_ne : s' ≠ s := by intro heq; rw [heq] at hs'_close; linarith only [h_single_cut, + hs'_close] have h_sep_s' : δ_sep ≤ ‖s - s'‖ := hδ_sep_le s' (Finset.mem_erase.mpr ⟨hs'_ne, hs'⟩) have h_far : ‖γ.toFun t - s‖ ≥ δ_sep / 2 := by have h1 : ‖s - s'‖ ≤ ‖γ.toFun t - s‖ + ‖γ.toFun t - s'‖ := by rw [norm_sub_rev (γ.toFun t) s] exact norm_sub_le_norm_sub_add_norm_sub s (γ.toFun t) s' - linarith [hε2] + linarith only [h_single_cut, hs'_close, h_sep_s', h1, hε2] have ht_Icc : t ∈ Icc γ.a γ.b := Ioc_subset_Icc_self (Set.uIoc_of_le γ.hab.le ▸ ht) exact zpow_deriv_norm_bound_of_dist_ge γ s m Mγ' hMγ' (δ_sep / 2) - (by linarith) t ht_Icc h_far + (by linarith only [hδ_pos]) t ht_Icc h_far · push Not at h_single_cut; rw [ite_eq_right (not_lt.mpr h_single_cut)] norm_num; positivity · rw [ite_eq_right h_multi_cut] @@ -726,7 +727,7 @@ theorem multipoint_pv_zpow_tendsto_zero (S0 : Finset ℂ) (fun _ => (δ_sep / 2)⁻¹ ^ m * (|Mγ'| + 1)) (by filter_upwards [self_mem_nhdsWithin] with ε (hε : (0 : ℝ) < ε) exact aesm_diff_single_multi_cpv_zpow S0 γ s m hs ε hε) - (by filter_upwards [Ioo_mem_nhdsGT (show (0 : ℝ) < δ_sep / 2 by linarith)] + (by filter_upwards [Ioo_mem_nhdsGT (show (0 : ℝ) < δ_sep / 2 by linarith only [hδ_pos])] with ε hε exact dct_bound_diff_cpv_zpow S0 γ s m hs hS0_single Mγ' hMγ' δ_sep hδ_pos hδ_sep_le ε hε) diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/PerTermVanishing/CPVHelpers.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/PerTermVanishing/CPVHelpers.lean index ff67196a60..02a2d55234 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/PerTermVanishing/CPVHelpers.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/FlatnessTransfer/PerTermVanishing/CPVHelpers.lean @@ -82,7 +82,10 @@ theorem tendsto_cpv_of_continuousOn_zero_integral simp only [cauchyPrincipalValueIntegrandOn] have h_not_in' := h_not_in ht_in by_cases hS0_empty : S0 = ∅ - · simp_all + · simp_all only [Finset.notMem_empty, ne_eq, IsEmpty.forall_iff, implies_true, + eventually_true, + not_true_eq_false, false_and, exists_const, ↓reduceIte, + tendsto_const_nhds_iff] · have hS0_ne : S0.Nonempty := Finset.nonempty_of_ne_empty hS0_empty let δ := S0.inf' hS0_ne (fun s => ‖γ.toFun t - s‖) have hδ_pos : 0 < δ := diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/GeneralizedTheorem.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/GeneralizedTheorem.lean index 9e171f9eb4..1207a72bc3 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/GeneralizedTheorem.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/GeneralizedTheorem.lean @@ -11,7 +11,6 @@ import Mathlib.Analysis.SpecialFunctions.Trigonometric.Arctan import Mathlib.CategoryTheory.Category.Init import Mathlib.Combinatorics.Matroid.Init import Mathlib.MeasureTheory.Covering.Besicovitch -import Mathlib.Tactic.Positivity.Finset /-! # Residue/GeneralizedTheorem (legacy stub) diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/GeneralizedTheoremBase.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/GeneralizedTheoremBase.lean index 50a6ca5c01..a97f629fee 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/GeneralizedTheoremBase.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/GeneralizedTheoremBase.lean @@ -67,10 +67,12 @@ private lemma cpv_crossing_null ⋃ s ∈ (↑S0 : Set ℂ), {t | t ∈ Icc γ.a γ.b ∧ γ.toFun t = s} := by ext t - simp_all + simp_all only [mem_Icc, SetLike.mem_coe, mem_ofPred_eq, mem_iUnion, exists_and_left, + exists_prop, + ↓existsAndEq, and_true] rw [h_eq, MeasureTheory.measure_biUnion_null_iff (Set.Finite.countable (Finset.finite_toSet S0))] - simp_all + simp_all only [mem_Icc, SetLike.mem_coe, implies_true] private lemma finset_min_sep (S0 : Finset ℂ) (hS0_nonempty : S0.Nonempty) : @@ -147,7 +149,7 @@ private lemma cpv_cauchy_of_sum_and_regular (S0 : Finset ℂ) (f : ℂ → ℂ) (residueSimplePole f s.val / (γ.toFun t - s.val)) * deriv γ.toFun t else 0) (𝓝[>] 0) (𝓝 L) := by apply tendsto_finsetSum - simp_all + simp_all only [gt_iff_lt, ne_eq, Finset.mem_attach, imp_self, implies_true] let M := fun ε => ∫ t in γ.a..γ.b, cauchyPrincipalValueIntegrandOn S0 f γ.toFun ε t let S' := fun ε => ∑ s ∈ S0.attach, @@ -185,7 +187,9 @@ lemma cauchyPrincipalValueOn_singular_sum (S0 : Finset ℂ) (f : ℂ → ℂ) · subst hS0_empty unfold CauchyPrincipalValueExistsOn cauchyPrincipalValueIntegrandOn - simp_all + simp_all only [Finset.notMem_empty, IsEmpty.forall_iff, implies_true, Finset.sum_empty, + sub_zero, false_and, + exists_const, ↓reduceIte, tendsto_const_nhds_iff, exists_eq'] · have hS0_nonempty : S0.Nonempty := Finset.nonempty_iff_ne_empty.mpr hS0_empty unfold CauchyPrincipalValueExistsOn @@ -220,7 +224,9 @@ private lemma holomorphic_closed_integral_zero (U : Set ℂ) (hU : IsOpen U) have h_deriv' : ∀ t ∈ Ioo γ.a γ.b \ (↑γ.partition ∩ Ioo γ.a γ.b), HasDerivAt (F ∘ γ.toFun) (g (γ.toFun t) * deriv γ.toFun t) t := by - simp_all + simp_all only [mem_Icc, and_imp, mem_Ioo, sdiff_inter_self_eq_sdiff, Set.mem_sdiff, + SetLike.mem_coe, + not_false_eq_true, implies_true] have h_int : IntervalIntegrable (fun t => g (γ.toFun t) * deriv γ.toFun t) MeasureTheory.volume γ.a γ.b := by @@ -376,7 +382,7 @@ private lemma generalizedResidueTheorem'_crossing_formula unfold cauchyPrincipalValue' simp only [zero_mul] apply limUnder_eventually_eq_const - simp_all + simp_all only [gt_iff_lt, ite_self, intervalIntegral.integral_zero, eventually_true] · exact pv_integral_simple_pole γ.toPiecewiseC1Curve s (residueSimplePole f s) (single_pole_pv_base_exists γ s (residueSimplePole f s) hc (hPV_singular s hs)) have h_multipoint_eq_sum : @@ -603,7 +609,7 @@ holds near `s` (on a punctured neighborhood). -/ private lemma sum_div_sub_decomp (S0 : Finset ℂ) (c : ℂ → ℂ) (s : ℂ) (hs : s ∈ S0) : ∀ᶠ z in 𝓝[≠] s, (fun z => ∑ s' ∈ S0, c s' / (z - s')) z = c s / (z - s) + ∑ s' ∈ S0.erase s, c s' / (z - s') := by - simp_all + simp_all only [Finset.sum_erase_eq_sub, add_sub_cancel, eventually_true] /-- The sum `∑ s ∈ S0, c(s) / (z - s)` has a simple pole at each `s ∈ S0`, with coefficient `c(s)` and analytic remainder `∑ s' ∈ S0.erase s, c(s') / (z - s')`. -/ diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MultipointPV.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MultipointPV.lean index 6c1e40019b..6889c71d3f 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MultipointPV.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MultipointPV.lean @@ -130,8 +130,12 @@ private lemma measurableSet_multipoint_goodset {γ : ℝ → ℂ} {a b ε : ℝ} have h_eq : {t | ∀ s ∈ S, ε < ‖γ t - s‖} ∩ Icc a b = Icc a b \ ({t | ∃ s ∈ S, ‖γ t - s‖ ≤ ε} ∩ Icc a b) := by ext t; constructor - · simp_all - · simp_all + · simp_all only [mem_inter_iff, mem_ofPred_eq, mem_Icc, sdiff_inter_self_eq_sdiff, + Set.mem_sdiff, and_self, + not_exists, not_and, not_le, implies_true] + · simp_all only [sdiff_inter_self_eq_sdiff, Set.mem_sdiff, mem_Icc, mem_ofPred_eq, + not_exists, not_and, not_le, + mem_inter_iff, implies_true, and_self] rw [h_eq]; exact isClosed_Icc.measurableSet.diff (measurableSet_multipoint_condition S hγ) private lemma goodset_piecewise_ae_eq_multipoint {g : ℂ → ℂ} {γ : ℝ → ℂ} {a b ε : ℝ} @@ -362,7 +366,7 @@ lemma disjoint_balls_of_small_epsilon (S0 : Finset ℂ) (ε : ℝ) (_hε : 0 < intro s hs s' hs' hne; apply Metric.ball_disjoint_ball have h2 : δ ≤ dist s s' := by rw [dist_eq_norm, norm_sub_rev]; exact h_sep s hs s' hs' hne - linarith + linarith only [hε_small, h2] /-! ## Boundedness Lemmas -/ @@ -443,7 +447,7 @@ lemma intervalIntegrable_cauchyPrincipalValueIntegrandOn {S0 : Finset ℂ} {f : · exact le_trans (hMγ' t ht) (le_abs_self _) · exact norm_nonneg _ · positivity - _ ≤ |Mf| * |Mγ'| + 1 := by linarith + _ ≤ |Mf| * |Mγ'| + 1 := by linarith only [] let M := |Mf| * |Mγ'| + 1 have h_meas : AEStronglyMeasurable @@ -495,7 +499,7 @@ lemma intervalIntegrable_residueTerm (le_abs_self _) · exact norm_nonneg _ · positivity - _ ≤ M := by simp only [M]; linarith + _ ≤ M := by simp only [M]; linarith only [] · simp only [norm_zero, M]; positivity have hγ_cont := γ.toPiecewiseC1Curve.continuous_toFun diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MultipointPV/DominatedConvergence.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MultipointPV/DominatedConvergence.lean index c353fc2d40..1b68945b9c 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MultipointPV/DominatedConvergence.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/MultipointPV/DominatedConvergence.lean @@ -204,21 +204,21 @@ private lemma residue_sum_norm_le_singular_bound {S0 : Finset ℂ} {f : ℂ → _ = ‖s - z‖ := by ring_nf _ = ‖z - s‖ := norm_sub_rev _ _ by_cases hε_small' : ε ≤ δ / 2 - · calc δ / 2 ≤ δ - ε := by linarith - _ ≤ ‖s - s₀‖ - ‖z - s₀‖ := by linarith [h_sep, hs₀_near] + · calc δ / 2 ≤ δ - ε := by linarith only [hε_small'] + _ ≤ ‖s - s₀‖ - ‖z - s₀‖ := by linarith only [hs₀_near, h_sep] _ ≤ ‖z - s‖ := h_tri - · push Not at hε_small'; linarith [h_inc] + · push Not at hε_small'; linarith only [h_inc, hε_small'] have hMc_nonneg : 0 ≤ Mc := le_trans (norm_nonneg _) (hMc s hs) calc ‖residueSimplePole f s / (z - s)‖ = ‖residueSimplePole f s‖ / ‖z - s‖ := norm_div _ _ _ ≤ Mc / ‖z - s‖ := div_le_div_of_nonneg_right (hMc s hs) (norm_nonneg _) - _ ≤ Mc / (δ / 2) := div_le_div_of_nonneg_left hMc_nonneg (by linarith) h_dist + _ ≤ Mc / (δ / 2) := div_le_div_of_nonneg_left hMc_nonneg (by linarith only [hδ_pos]) h_dist _ = 2 * Mc / δ := by ring · simp only [h_inc, ↓reduceIte, norm_zero] refine div_nonneg (mul_nonneg ?_ ?_) ?_ - · linarith + · linarith only [] · exact le_trans (norm_nonneg _) (hMc s₀ hs₀) - · linarith + · linarith only [hδ_pos] private lemma norm_A_int_bound_some_near (S0 : Finset ℂ) (f : ℂ → ℂ) (γ : PiecewiseC1Immersion) (Mc Mγ' δ : ℝ) (hδ_pos : 0 < δ) @@ -251,15 +251,15 @@ private lemma norm_A_int_bound_some_near (S0 : Finset ℂ) (f : ℂ → ℂ) (γ Finset.sum_le_sum (residue_sum_norm_le_singular_bound hδ_pos hMc hδ_sep hs₀ hs₀_near) _ = singularBound := by simp only [Finset.sum_const]; ring have h_sb_nonneg : 0 ≤ singularBound := - div_nonneg (mul_nonneg (mul_nonneg (by linarith) (Nat.cast_nonneg _)) - (le_trans (norm_nonneg _) (hMc s₀ hs₀))) (by linarith) + div_nonneg (mul_nonneg (mul_nonneg (by linarith only []) (Nat.cast_nonneg _)) + (le_trans (norm_nonneg _) (hMc s₀ hs₀))) (by linarith only [hδ_pos]) calc ‖(∑ s ∈ S0, if ‖γ.toFun t - s‖ > ε then residueSimplePole f s / (γ.toFun t - s) else 0) * deriv γ.toFun t‖ ≤ singularBound * Mγ' := (norm_mul_le _ _).trans (mul_le_mul h_sum_bound h_γ'_bound (norm_nonneg _) h_sb_nonneg) _ ≤ max 0 singularBound * max 0 Mγ' := by have h0_le_Mγ' : 0 ≤ Mγ' := le_trans (norm_nonneg _) h_γ'_bound - simp_all + simp_all only [mem_Icc, and_imp, ne_eq, sup_of_le_right, gt_iff_lt, Std.le_refl] _ ≤ B := hB private lemma A_int_norm_bound (S0 : Finset ℂ) (f g_reg : ℂ → ℂ) (γ : PiecewiseC1Immersion) @@ -313,7 +313,7 @@ private lemma A_int_aEStronglyMeasurable (S0 : Finset ℂ) (f g_reg : ℂ → · push Not at h_near have h_not_in_S0 : γ.toFun t ∉ (S0 : Set ℂ) := by intro h_in; have := h_near (γ.toFun t) h_in - simp only [sub_self, norm_zero] at this; linarith + simp only [sub_self, norm_zero] at this; linarith only [hε, this] rw [hg_decomp (γ.toFun t) h_not_in_S0] have h_meas1 := aEStronglyMeasurable_pv_integrand_decomposed S0 (residueSimplePole f) hε hg_cont hγ_cont hγ'_off_P diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/SectorCurve.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/SectorCurve.lean index 40c80c9fa9..d9a35406b1 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/SectorCurve.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/SectorCurve.lean @@ -254,7 +254,7 @@ theorem pv_integrand_seg3 (r : ℝ) (hr : 0 < r) (α : ℝ) (t : ℝ) (ht : t /-- The integral of `1/t` from `epsilon` to `1` is `-log(epsilon)`. -/ theorem integral_seg1_eq_neg_log (ε : ℝ) (hε : 0 < ε) (_hε1 : ε < 1) : ∫ t in ε..1, (t : ℝ)⁻¹ = -Real.log ε := by - simp_all + simp_all only [zero_lt_one, integral_inv_of_pos, one_div, Real.log_inv] /-- The integral of `-1/(3-t)` from `2` to `3-epsilon` is `log(epsilon)`. -/ theorem integral_seg3_eq_log (ε : ℝ) (hε : 0 < ε) (_hε1 : ε < 1) : @@ -265,7 +265,9 @@ theorem integral_seg3_eq_log (ε : ℝ) (hε : 0 < ε) (_hε1 : ε < 1) : (a := (2 : ℝ)) (b := 3 - ε) rw [this] congr 1 <;> ring - simp_all + simp_all only [intervalIntegral.integral_comp_sub_left, sub_sub_cancel, zero_lt_one, + integral_inv_of_pos, + one_div, Real.log_inv, neg_neg] /-- On segment 1, the norm of the sector curve is `t * r`. -/ theorem sectorCurve_norm_seg1 (r : ℝ) (hr : 0 < r) (α : ℝ) (t : ℝ) (ht : t ∈ Icc 0 1) : @@ -277,7 +279,7 @@ theorem sectorCurve_norm_seg1 (r : ℝ) (hr : 0 < r) (α : ℝ) (t : ℝ) (ht : theorem sectorCurve_norm_seg3' (r : ℝ) (hr : 0 < r) (α : ℝ) (t : ℝ) (ht : t ∈ Icc 2 3) : ‖sectorCurve r α t‖ = (3 - t) * r := by rw [sectorCurve_seg3 r α t ht, norm_mul, Complex.norm_exp_I_mul_ofReal, mul_one, - Complex.norm_of_nonneg (mul_nonneg (by linarith [ht.2]) (le_of_lt hr))] + Complex.norm_of_nonneg (mul_nonneg (by linarith only [ht, ht.2]) (le_of_lt hr))] /-- The logarithmic integrals from segments 1 and 3 cancel. -/ theorem log_cancellation (r : ℝ) (hr : 0 < r) (ε : ℝ) (hε : 0 < ε) (hεr : ε < r) : @@ -294,7 +296,8 @@ theorem log_cancellation (r : ℝ) (hr : 0 < r) (ε : ℝ) (hε : 0 < ε) (hεr have := intervalIntegral.integral_comp_sub_left (fun u => u⁻¹) (3 : ℝ) (a := (2 : ℝ)) (b := 3 - ε / r) rw [this]; congr 1 <;> ring - simp_all + simp_all only [div_pos_iff_of_pos_left, zero_lt_one, integral_inv_of_pos, one_div, inv_div, + intervalIntegral.integral_comp_sub_left, sub_sub_cancel, neg_neg] have h1c : ∫ t in (ε / r)..(1 : ℝ), (↑(t⁻¹) : ℂ) = ↑(-(Real.log (ε / r))) := by rw [← h1, intervalIntegral.integral_ofReal] have h2c : ∫ t in (2 : ℝ)..(3 - ε / r), (-(↑((3 - t)⁻¹)) : ℂ) = @@ -332,12 +335,12 @@ private theorem pv_cutoff_F_integrable_3delta_3 (r : ℝ) (hr : 0 < r) (α : ℝ have hδ : 0 < δ := div_pos hε hr have hδ1 : δ < 1 := by rwa [div_lt_one hr] apply (intervalIntegrable_const (c := (0 : ℂ))).congr - intro t ht; rw [Set.uIoc_of_le (by linarith : 3 - δ ≤ 3)] at ht + intro t ht; rw [Set.uIoc_of_le (by linarith only [hδ] : 3 - δ ≤ 3)] at ht dsimp only [F]; simp only [sub_zero]; rw [ite_eq_right (not_lt.mpr _)] - have h2 : 2 ≤ t := by linarith [ht.1] + have h2 : 2 ≤ t := by linarith only [hδ1, ht, ht.1] rw [sectorCurve_norm_seg3' r hr α t ⟨h2, ht.2⟩] - have : (3 - t) * r ≤ δ * r := mul_le_mul_of_nonneg_right (by linarith [ht.1]) hr.le - linarith [show δ * r = ε from by rw [hδ_def]; field_simp] + have : (3 - t) * r ≤ δ * r := mul_le_mul_of_nonneg_right (by linarith only [ht, ht.1]) hr.le + linarith only [hr, hε, hδ_def, this, show δ * r = ε from by rw [hδ_def]; field_simp] private theorem pv_cutoff_F_integrable_delta_1 (r : ℝ) (hr : 0 < r) (α : ℝ) (ε : ℝ) (hε : 0 < ε) (hεr : ε < r) : @@ -488,7 +491,7 @@ private theorem pv_sector_cutoff_composed_integrabilities (r : ℝ) (hr : 0 < r) have hFint_02 := intervalIntegrable_union_adjacent (by norm_num) (by norm_num) hFint_01 hFint_12 exact ⟨hFint_01, hFint_02, - intervalIntegrable_union_adjacent (by norm_num) (by linarith) hFint_02 hFint_2_3δ⟩ + intervalIntegrable_union_adjacent (by norm_num) (by linarith only [hδ1]) hFint_02 hFint_2_3δ⟩ private theorem pv_cutoff_integral_seg1_eq_inv (r : ℝ) (hr : 0 < r) (α : ℝ) (ε : ℝ) (hε : 0 < ε) (hεr : ε < r) : @@ -596,16 +599,16 @@ theorem pv_sector_cutoff_eq (r : ℝ) (hr : 0 < r) (α : ℝ) rw [Set.uIcc_of_le (le_of_lt hδ)] at ht dsimp only [F]; simp only [sub_zero]; rw [ite_eq_right (not_lt.mpr _)] rw [sectorCurve_norm_seg1 r hr α t ⟨ht.1, le_trans ht.2 (le_of_lt hδ1)⟩] - calc t * r ≤ δ * r := by nlinarith [ht.2] + calc t * r ≤ δ * r := by nlinarith only [hr, ht, ht.2] _ = ε := by rw [hδ_def]; field_simp] exact intervalIntegral.integral_zero have hI5 : ∫ t in (3 - δ)..(3 : ℝ), F t = 0 := by rw [show ∫ t in (3 - δ)..(3 : ℝ), F t = ∫ t in (3 - δ)..(3 : ℝ), (0 : ℂ) from by apply intervalIntegral.integral_congr; intro t ht - rw [Set.uIcc_of_le (by linarith : 3 - δ ≤ 3)] at ht + rw [Set.uIcc_of_le (by linarith only [hδ] : 3 - δ ≤ 3)] at ht dsimp only [F]; simp only [sub_zero]; rw [ite_eq_right (not_lt.mpr _)] - rw [sectorCurve_norm_seg3' r hr α t ⟨by linarith [ht.1], ht.2⟩] - calc (3 - t) * r ≤ δ * r := by nlinarith [ht.1] + rw [sectorCurve_norm_seg3' r hr α t ⟨by linarith only [hδ1, ht, ht.1], ht.2⟩] + calc (3 - t) * r ≤ δ * r := by nlinarith only [hr, ht, ht.1] _ = ε := by rw [hδ_def]; field_simp] exact intervalIntegral.integral_zero have hI2 := pv_cutoff_integral_seg1_eq_inv r hr α ε hε hεr diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/SectorCurveLemma.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/SectorCurveLemma.lean index 7ff9fe4817..8e2bdc85db 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/SectorCurveLemma.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/SectorCurveLemma.lean @@ -172,7 +172,7 @@ private theorem φ_sectorCurve_integrableOn_01 (r : ℝ) (hr : 0 < r) (α : ℝ) · exact hg.continuousOn.comp ((continuous_ofReal.comp (continuous_id.mul continuous_const)).continuousOn) (fun t ht => by - have := hγ_in_ball t ⟨ht.1, by linarith [ht.2]⟩ + have := hγ_in_ball t ⟨ht.1, by linarith only [ht, ht.2]⟩ rwa [sectorCurve_seg1 r α t ht] at this) · exact continuousOn_const exact (hc.intervalIntegrable_of_Icc (by norm_num)).congr_ae (by @@ -195,7 +195,7 @@ private theorem φ_sectorCurve_integrableOn_12 (r : ℝ) (hr : 0 < r) (α : ℝ) (continuous_const.mul (continuous_ofReal.comp ((continuous_id.sub continuous_const).mul continuous_const))))).continuousOn) (fun t ht => by - have := hγ_in_ball t ⟨by linarith [ht.1], by linarith [ht.2]⟩ + have := hγ_in_ball t ⟨by linarith only [ht, ht.1], by linarith only [ht, ht.2]⟩ rwa [sectorCurve_seg2 r α t ht] at this) · exact (continuous_const.mul (continuous_exp.comp (continuous_const.mul (continuous_ofReal.comp @@ -219,7 +219,7 @@ private theorem φ_sectorCurve_integrableOn_23 (r : ℝ) (hr : 0 < r) (α : ℝ) ((continuous_ofReal.comp ((continuous_const.sub continuous_id).mul continuous_const)).mul continuous_const).continuousOn (fun t ht => by - have := hγ_in_ball t ⟨by linarith [ht.1], ht.2⟩ + have := hγ_in_ball t ⟨by linarith only [ht, ht.1], ht.2⟩ rwa [sectorCurve_seg3 r α t ht] at this) · exact continuousOn_const exact (hc.intervalIntegrable_of_Icc (by norm_num)).congr_ae (by @@ -338,13 +338,13 @@ private theorem cauchyPV_inv_integrableOn_3δ3 (r : ℝ) (hr : 0 < r) (α : ℝ) (intervalIntegrable_const (c := (0 : ℂ))).congr (fun t ht => by have hεr_pos : ε / r > 0 := div_pos hε_pos hr have hεr_lt_one : ε / r < 1 := (div_lt_one hr).mpr hε_lt_r - rw [Set.uIoc_of_le (by linarith : 3 - ε / r ≤ 3)] at ht + rw [Set.uIoc_of_le (by linarith only [hεr_pos] : 3 - ε / r ≤ 3)] at ht simp only [cauchyPrincipalValueIntegrand', sub_zero] rw [ite_eq_right (not_lt.mpr _)] - rw [sectorCurve_norm_seg3' r hr α t ⟨by linarith [ht.1], ht.2⟩] + rw [sectorCurve_norm_seg3' r hr α t ⟨by linarith only [ht, hεr_lt_one, ht.1], ht.2⟩] have : (3 - t) * r ≤ ε / r * r := - mul_le_mul_of_nonneg_right (by linarith [ht.1]) hr.le - linarith [div_mul_cancel₀ ε (ne_of_gt hr)]) + mul_le_mul_of_nonneg_right (by linarith only [ht, ht.1]) hr.le + linarith only [hr, this, div_mul_cancel₀ ε (ne_of_gt hr)]) private theorem cauchyPV_inv_integrableOn_δ1 (r : ℝ) (hr : 0 < r) (α : ℝ) (ε : ℝ) (hε_pos : 0 < ε) (hε_lt_r : ε < r) : @@ -476,7 +476,9 @@ private theorem cauchyPV_g_tendsto_zero (r : ℝ) (hr : 0 < r) (α : ℝ) exact tendsto_const_nhds.congr' (by filter_upwards [Ioo_mem_nhdsGT (norm_pos_iff.mpr (sub_ne_zero.mpr h_ne))] with ε hε - simp_all)) + simp_all only [mem_Icc, and_false, not_false_eq_true, Nat.ofNat_nonneg, uIoc_of_le, + mem_Ioc, ne_eq, sub_zero, + mem_Ioo, cauchyPrincipalValueIntegrand'_of_gt])) private theorem cauchyPV_simplePole_integral_split (r : ℝ) (hr : 0 < r) (α : ℝ) (c : ℂ) (g : ℂ → ℂ) (hg : AnalyticOnNhd ℂ g (Metric.ball 0 (↑r + 1))) : @@ -553,7 +555,7 @@ theorem cauchyPV_sectorCurve_eq_mul_residueSimplePole (r : ℝ) (hr : 0 < r) (α deriv (sectorCurve r α) t else 0) := by intro ε hε t; split_ifs with h - · have hne : sectorCurve r α t ≠ 0 := by intro heq; simp [heq] at h; linarith + · have hne : sectorCurve r α t ≠ 0 := by intro heq; simp [heq] at h; linarith only [hε, h] rw [hf_eq _ hne] · rfl have h_sp := cauchyPV_sectorCurve_simplePole r hr α hα_nonneg hα_le c g hg @@ -579,17 +581,19 @@ private theorem sectorCurve_ne_zero_of_Icc_δ (r : ℝ) (hr : 0 < r) (α : ℝ) · rw [sectorCurve_seg1 r α t ⟨le_trans hδ_pos.le ht.1, h1⟩] at h0 have : t * r = 0 := Complex.ofReal_eq_zero.mp h0 rcases mul_eq_zero.mp this with ht0 | hr0 - · linarith [ht.1] - · linarith + · linarith only [hδ_pos, ht, ht0, ht.1] + · linarith only [hr, hr0] · rcases le_or_gt t 2 with h2 | h2 · rw [sectorCurve_seg2 r α t ⟨le_of_lt h1, h2⟩] at h0 - simp_all - · rw [sectorCurve_seg3 r α t ⟨le_of_lt h2, by linarith [ht.2]⟩] at h0 + simp_all only [mem_Icc, ofReal_mul, ofReal_sub, ofReal_one, mul_eq_zero, ofReal_eq_zero, + exp_ne_zero, + or_false, lt_self_iff_false] + · rw [sectorCurve_seg3 r α t ⟨le_of_lt h2, by linarith only [hδ_pos, ht, ht.2]⟩] at h0 rcases mul_eq_zero.mp h0 with h3t | hexp0 · have : (3 - t) * r = 0 := Complex.ofReal_eq_zero.mp h3t rcases mul_eq_zero.mp this with ht3 | hr0 - · linarith [ht.2] - · linarith + · linarith only [hδ_pos, ht, ht3, ht.2] + · linarith only [hr, hr0] · exact absurd hexp0 (Complex.exp_ne_zero _) private theorem sectorCurve_norm_le_near_zero (r : ℝ) (hr : 0 < r) (α : ℝ) @@ -604,8 +608,10 @@ private theorem sectorCurve_norm_le_near_three (r : ℝ) (hr : 0 < r) (α : ℝ) (δ : ℝ) (hδ_lt_1 : δ < 1) (ε : ℝ) (hδr_eq : δ * r = ε) : ∀ t ∈ Icc (3 - δ) 3, ‖sectorCurve r α t‖ ≤ ε := by intro t ht - rw [sectorCurve_norm_seg3' r hr α t ⟨le_trans (by linarith : 2 ≤ 3 - δ) ht.1, ht.2⟩] - calc (3 - t) * r ≤ δ * r := by apply mul_le_mul_of_nonneg_right _ hr.le; linarith [ht.1] + rw [sectorCurve_norm_seg3' r hr α t ⟨le_trans (by linarith only [hδ_lt_1] : 2 ≤ 3 - δ) ht.1, + ht.2⟩] + calc (3 - t) * r ≤ δ * r := by apply mul_le_mul_of_nonneg_right _ hr.le; linarith only [ht, + ht.1] _ = ε := hδr_eq private theorem sectorCurve_norm_gt_mid (r : ℝ) (hr : 0 < r) (α : ℝ) @@ -621,9 +627,9 @@ private theorem sectorCurve_norm_gt_mid (r : ℝ) (hr : 0 < r) (α : ℝ) · have : ‖sectorCurve r α t‖ = r := sectorCurve_norm_on_arc r hr α t ⟨le_of_lt h1, h2⟩ rw [this]; exact hε_lt_r - · rw [sectorCurve_norm_seg3' r hr α t ⟨le_of_lt h2, by linarith [ht.2]⟩] + · rw [sectorCurve_norm_seg3' r hr α t ⟨le_of_lt h2, by linarith only [hδ_pos, ht, ht.2]⟩] calc ε = δ * r := hδr_eq.symm - _ < (3 - t) * r := by apply mul_lt_mul_of_pos_right _ hr; linarith [ht.2] + _ < (3 - t) * r := by apply mul_lt_mul_of_pos_right _ hr; linarith only [ht, ht.2] private theorem zpow_integrableOn_δ1 (r : ℝ) (hr : 0 < r) (α : ℝ) (n : ℕ) (δ : ℝ) (hδ_pos : 0 < δ) (hδ_lt_1 : δ < 1) : @@ -633,7 +639,8 @@ private theorem zpow_integrableOn_δ1 (r : ℝ) (hr : 0 < r) (α : ℝ) (Icc δ 1) := by apply ContinuousOn.mul · apply ContinuousOn.zpow₀ - · fun_prop + · exact Continuous.comp_continuousOn' continuous_ofReal + (ContinuousOn.mul_const (continuousOn_id' (Icc δ 1)) r) · intro t ht left; exact Complex.ofReal_ne_zero.mpr (ne_of_gt (mul_pos (lt_of_lt_of_le hδ_pos ht.1) hr)) · exact continuousOn_const @@ -650,10 +657,24 @@ private theorem zpow_integrableOn_12 (r : ℝ) (hr : 0 < r) (α : ℝ) (n : ℕ) (↑r * (I * ↑α) * exp (I * ↑((t - 1) * α)))) (Icc 1 2) := by apply ContinuousOn.mul · apply ContinuousOn.zpow₀ - · fun_prop + · exact ContinuousOn.const_mul + (ContinuousOn.cexp + (ContinuousOn.const_mul + (Continuous.comp_continuousOn' continuous_ofReal + (ContinuousOn.mul_const + (ContinuousOn.fun_sub (continuousOn_id' (Icc 1 2)) continuousOn_const) α)) + I)) + ↑r · intro t _; left exact mul_ne_zero (Complex.ofReal_ne_zero.mpr (ne_of_gt hr)) (Complex.exp_ne_zero _) - · fun_prop + · exact ContinuousOn.const_mul + (ContinuousOn.cexp + (ContinuousOn.const_mul + (Continuous.comp_continuousOn' continuous_ofReal + (ContinuousOn.mul_const + (ContinuousOn.fun_sub (continuousOn_id' (Icc 1 2)) continuousOn_const) α)) + I)) + (↑r * (I * ↑α)) exact (this.intervalIntegrable_of_Icc (by norm_num)).congr_ae (by rw [Set.uIoc_of_le (by norm_num : (1 : ℝ) ≤ 2), ← Measure.restrict_congr_set Ioo_ae_eq_Ioc] @@ -665,22 +686,27 @@ private theorem zpow_integrableOn_23δ (r : ℝ) (hr : 0 < r) (α : ℝ) (n : ℕ) (δ : ℝ) (hδ_pos : 0 < δ) (hδ_lt_1 : δ < 1) : IntervalIntegrable (fun t => (sectorCurve r α t) ^ (-(↑n : ℤ)) * deriv (sectorCurve r α) t) volume 2 (3 - δ) := by - have h3δ_gt_2 : 2 < 3 - δ := by linarith + have h3δ_gt_2 : 2 < 3 - δ := by linarith only [hδ_lt_1] have : ContinuousOn (fun t => (↑((3 - t) * r) * exp (I * ↑α)) ^ (-(↑n : ℤ)) * (-(↑r) * exp (I * ↑α))) (Icc 2 (3 - δ)) := by apply ContinuousOn.mul · apply ContinuousOn.zpow₀ - · fun_prop + · exact ContinuousOn.mul_const + (Continuous.comp_continuousOn' continuous_ofReal + (ContinuousOn.mul_const + (ContinuousOn.fun_sub continuousOn_const (continuousOn_id' (Icc 2 (3 - δ)))) r)) + (cexp (I * ↑α)) · intro t ht; left - exact mul_ne_zero (Complex.ofReal_ne_zero.mpr (ne_of_gt (mul_pos (by linarith [ht.2]) hr))) + exact mul_ne_zero (Complex.ofReal_ne_zero.mpr (ne_of_gt (mul_pos (by + linarith only [hδ_pos, ht, ht.2]) hr))) (Complex.exp_ne_zero _) · exact continuousOn_const exact (this.intervalIntegrable_of_Icc h3δ_gt_2.le).congr_ae (by rw [Set.uIoc_of_le h3δ_gt_2.le, ← Measure.restrict_congr_set Ioo_ae_eq_Ioc] filter_upwards [ae_restrict_mem measurableSet_Ioo] with t ht - simp only [sectorCurve_seg3 r α t ⟨le_of_lt ht.1, by linarith [ht.2]⟩, - deriv_sectorCurve_seg3 r α t ⟨ht.1, by linarith [ht.2]⟩]) + simp only [sectorCurve_seg3 r α t ⟨le_of_lt ht.1, by linarith only [hδ_pos, ht, ht.2]⟩, + deriv_sectorCurve_seg3 r α t ⟨ht.1, by linarith only [hδ_pos, ht, ht.2]⟩]) private theorem zpow_primitive_hasDerivAt (r : ℝ) (hr : 0 < r) (α : ℝ) (n : ℕ) (hn : 2 ≤ n) (δ : ℝ) (hδ_pos : 0 < δ) (hδ_lt_1 : δ < 1) : @@ -715,10 +741,10 @@ private theorem zpow_ftc_vanishes (r : ℝ) (_hr : 0 < r) (α : ℝ) (n : ℕ) ( let F := fun t => (γ t) ^ m / (m : ℂ) F (3 - δ) - F δ = 0 := by intro m γ F - have h3δ_gt_2 : 2 < 3 - δ := by linarith + have h3δ_gt_2 : 2 < 3 - δ := by linarith only [hδ_lt_1] have hγ_δ : γ δ = ↑(δ * r) := sectorCurve_seg1 r α δ ⟨hδ_pos.le, hδ_lt_1.le⟩ have hγ_3δ : γ (3 - δ) = ↑(δ * r) * exp (I * ↑α) := by - have := sectorCurve_seg3 r α (3 - δ) ⟨h3δ_gt_2.le, by linarith⟩ + have := sectorCurve_seg3 r α (3 - δ) ⟨h3δ_gt_2.le, by linarith only [hδ_pos]⟩ simp only [show 3 - (3 - δ) = δ from by ring] at this; exact this simp only [F, hγ_δ, hγ_3δ, mul_zpow] rw [show (exp (I * ↑α)) ^ m = exp (I * ↑((1 - (↑n : ℤ)) * α)) from by diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/CrossingAnalysis.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/CrossingAnalysis.lean index c4c499db9a..dc6bd2b574 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/CrossingAnalysis.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/CrossingAnalysis.lean @@ -94,7 +94,8 @@ private lemma immersion_right_partition_free (γ : PiecewiseC1Immersion) {t₀ : by_cases hQ : Q.Nonempty · have hmem := Finset.mem_filter.mp (Finset.min'_mem Q hQ) exact ⟨Q.min' hQ, hmem.2, le_trans (γ.partition_subset hmem.1).2 (le_refl _), - fun s hs hc => by linarith [Finset.min'_le Q s (Finset.mem_filter.mpr ⟨hc, hs.1⟩), hs.2]⟩ + fun s hs hc => by + linarith only [hQ, hs, hc, Finset.min'_le Q s (Finset.mem_filter.mpr ⟨hc, hs.1⟩), hs.2]⟩ · exact ⟨γ.b, ht₀.2, le_refl _, fun s hs hc => hQ ⟨s, Finset.mem_filter.mpr ⟨hc, hs.1⟩⟩⟩ /-- A partition-free open neighborhood `(l₀, t₀)` to the left of an interior point. -/ @@ -105,7 +106,8 @@ private lemma immersion_left_partition_free (γ : PiecewiseC1Immersion) {t₀ : by_cases hQ : Q.Nonempty · have hmem := Finset.mem_filter.mp (Finset.max'_mem Q hQ) exact ⟨Q.max' hQ, hmem.2, le_trans (γ.partition_subset hmem.1).1 (le_refl _), - fun s hs hc => by linarith [Finset.le_max' Q s (Finset.mem_filter.mpr ⟨hc, hs.2⟩), hs.1]⟩ + fun s hs hc => by + linarith only [hQ, hs, hc, Finset.le_max' Q s (Finset.mem_filter.mpr ⟨hc, hs.2⟩), hs.1]⟩ · exact ⟨γ.a, ht₀.1, le_refl _, fun s hs hc => hQ ⟨s, Finset.mem_filter.mpr ⟨hc, hs.2⟩⟩⟩ /-- One-sided slope convergence `(γ t - z₀)/(t - t₀) → L` on the right, from the @@ -293,7 +295,15 @@ lemma piecewiseC1Immersion_norm_strictMono_near_crossing have hdiff := γ.smooth_off_partition t ⟨le_trans hl₁_ge_a (le_of_lt ht.1), le_trans ht.2.le ht₀.2.le⟩ (hno_L₁ t ht) have hne : γ.toFun t ≠ z₀ := by - intro heq; have := hneg_L t ht; simp_all + intro heq; have := hneg_L t ht; simp_all only [mem_Ioo, ne_eq, Complex.inner, map_sub, + mul_re, sub_re, conj_re, sub_im, conj_im, + sub_neg_eq_add, mul_neg, map_div₀, conj_ofReal, + div_ofReal_re, div_ofReal_im, gt_iff_lt, and_imp, + ofReal_sub, + norm_pos_iff, not_false_eq_true, mem_Ioi, + mem_ofPred_eq, mem_Iio, sub_self, inner_zero_left, + norm_zero, div_zero, + lt_self_iff_false] rw [(hasDerivAt_norm_sub γ.toFun t _ hdiff.hasDerivAt hne).deriv] exact hneg_L t ht · apply strictMonoOn_of_deriv_pos (convex_Icc _ _) @@ -304,7 +314,15 @@ lemma piecewiseC1Immersion_norm_strictMono_near_crossing have hdiff := γ.smooth_off_partition t ⟨le_trans ht₀.1.le (le_of_lt ht.1), le_trans ht.2.le hr₁_le_b⟩ (hno_R₁ t ht) have hne : γ.toFun t ≠ z₀ := by - intro heq; have := hpos_R t ht; simp_all + intro heq; have := hpos_R t ht; simp_all only [mem_Ioo, ne_eq, Complex.inner, map_sub, + mul_re, sub_re, conj_re, sub_im, conj_im, + sub_neg_eq_add, mul_neg, map_div₀, conj_ofReal, + div_ofReal_re, div_ofReal_im, gt_iff_lt, and_imp, + ofReal_sub, + norm_pos_iff, not_false_eq_true, mem_Ioi, + mem_ofPred_eq, mem_Iio, sub_self, inner_zero_left, + norm_zero, div_zero, + lt_self_iff_false] rw [(hasDerivAt_norm_sub γ.toFun t _ hdiff.hasDerivAt hne).deriv] exact hpos_R t ht @@ -440,10 +458,14 @@ lemma exists_cutoff_boundary_times_with_mono exists_cutoff_boundary_times γ z₀ t₀ ht₀ hcross honly have hg_l_pos : 0 < ‖γ.toFun l - z₀‖ := by apply norm_pos_iff.mpr; apply sub_ne_zero.mpr - intro heq; have := honly l ⟨hl_ge_a, le_trans hl_lt.le (le_of_lt ht₀.2)⟩ heq; linarith + intro heq; have := + honly l ⟨hl_ge_a, le_trans hl_lt.le (le_of_lt ht₀.2)⟩ heq; linarith only [hl_lt, + this] have hg_r_pos : 0 < ‖γ.toFun r - z₀‖ := by apply norm_pos_iff.mpr; apply sub_ne_zero.mpr - intro heq; have := honly r ⟨le_trans (le_of_lt ht₀.1) hr_gt.le, hr_le_b⟩ heq; linarith + intro heq; have := + honly r ⟨le_trans (le_of_lt ht₀.1) hr_gt.le, hr_le_b⟩ heq; linarith only [hr_gt, + this] exact ⟨min δ₁ (min ‖γ.toFun l - z₀‖ ‖γ.toFun r - z₀‖), lt_min hδ₁ (lt_min hg_l_pos hg_r_pos), l, r, hl_lt, hr_gt, hl_ge_a, hr_le_b, hg_anti, hg_mono, @@ -493,7 +515,8 @@ private lemma exp_cutoff_G_const_on (hF_deriv t ht_ab htP h_gt).differentiableAt.neg.cexp · have ht_ab : t ∈ Ioo γ.a γ.b := ⟨lt_of_le_of_lt hac ht.1, lt_of_lt_of_le ht.2 hdb⟩ have h_gt : ε < ‖γ.toFun t - z₀‖ := h_pos t ht - have hne : γ.toFun t - z₀ ≠ 0 := by intro h; rw [h, norm_zero] at h_gt; linarith + have hne : γ.toFun t - z₀ ≠ 0 := by intro h; rw [h, norm_zero] at h_gt; linarith only [hε, + h_gt] have hG_at : HasDerivAt G (deriv γ.toFun t * cexp (-F t) + (γ.toFun t - z₀) * (cexp (-F t) * -f t)) t := by rw [hG_def] diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Decomposition.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Decomposition.lean index fc49e80104..af0b1bd7ba 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Decomposition.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Decomposition.lean @@ -46,8 +46,8 @@ private lemma no_endpoint_crossing_of_unique_interior (honly : ∀ t ∈ Icc γ.a γ.b, γ.toFun t = z₀ → t = t₀) : γ.toFun γ.a ≠ z₀ ∧ γ.toFun γ.b ≠ z₀ := by constructor - · intro h; have := honly γ.a (left_mem_Icc.mpr γ.hab.le) h; linarith [ht₀.1] - · intro h; have := honly γ.b (right_mem_Icc.mpr γ.hab.le) h; linarith [ht₀.2] + · intro h; have := honly γ.a (left_mem_Icc.mpr γ.hab.le) h; linarith only [ht₀, this, ht₀.1] + · intro h; have := honly γ.b (right_mem_Icc.mpr γ.hab.le) h; linarith only [ht₀, this, ht₀.2] /-- CPV of `(z - z₀)⁻¹` exists when there is a unique crossing at `t₀`. -/ private lemma cpv_exists_of_unique_crossing @@ -192,7 +192,7 @@ theorem generalizedWindingNumber_eq_neg_angleContribution_single -((angleAtCrossing γ t₀ ht₀ : ℂ) / (2 * Real.pi)) := by have := generalizedWindingNumber_eq_external_sub_angle γ z₀ t₀ ht₀ - simp_all + simp_all only [mem_Icc, and_imp, Std.le_refl, zero_sub] /-- At a smooth crossing with zero external winding, contribution is -1/2. -/ theorem generalizedWindingNumber_eq_neg_half_smooth_crossing diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Defs.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Defs.lean index 25880aa20d..198366d5f7 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Defs.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Defs.lean @@ -109,7 +109,7 @@ theorem windingNumber_corner_crossing (singleton_at_crossing γ t₀ z₀ hcross) = α / (2 * Real.pi) := by simp only [windingNumberWithAngles'] - simp_all + simp_all only [Finset.univ_unique, Finset.sum_singleton, Finset.default_singleton] /-- When γ avoids z₀, the PV cutoff is trivial below minimum distance. -/ theorem cauchyPrincipalValue_eq_classical_off_curve' diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Proposition22.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Proposition22.lean index 3bea9273e3..bb4cfd5887 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Proposition22.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/WindingNumber/Proposition22.lean @@ -290,20 +290,20 @@ theorem exists_isolated_crossing_interval set b' := (t₀ + min u γ.b) / 2 with hb'_def have h_max_lt : max l γ.a < t₀ := max_lt hl_lt ht₀.1 have h_t₀_lt_min : t₀ < min u γ.b := lt_min hlt_u ht₀.2 - have ha'_lt : a' < t₀ := by linarith - have ht₀_lt_b' : t₀ < b' := by linarith + have ha'_lt : a' < t₀ := by linarith only [ha'_def, h_max_lt] + have ht₀_lt_b' : t₀ < b' := by linarith only [hb'_def, h_t₀_lt_min] have hl_lt_a' : l < a' := by have : l ≤ max l γ.a := le_max_left _ _ - linarith + linarith only [ha'_def, ha'_lt, this] have hb'_lt_u : b' < u := by have : min u γ.b ≤ u := min_le_left _ _ - linarith + linarith only [hb'_def, ht₀_lt_b', this] have ha_le_a' : γ.a ≤ a' := by have : γ.a ≤ max l γ.a := le_max_right _ _ - linarith + linarith only [ha'_def, ha'_lt, this] have hb'_le_b : b' ≤ γ.b := by have : min u γ.b ≤ γ.b := min_le_right _ _ - linarith + linarith only [hb'_def, ht₀_lt_b', this] refine ⟨a', b', ha'_lt, ht₀_lt_b', ?_, ?_, ?_⟩ · intro t ht exact ⟨le_trans ha_le_a' ht.1, le_trans ht.2 hb'_le_b⟩ diff --git a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Commutativity.lean b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Commutativity.lean index 5569235e7e..97585c8d59 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Commutativity.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Commutativity.lean @@ -10,7 +10,6 @@ import LeanPool.LeanModularForms.HeckeRIngs.AbstractHeckeRing.Associativity import Mathlib.Analysis.Normed.Group.Basic import Mathlib.Data.EReal.Operations import Mathlib.Data.Finsupp.SMulWithZero -import Mathlib.Data.Int.ConditionallyCompleteOrder import Mathlib.Tactic.ContinuousFunctionalCalculus import Mathlib.Topology.Algebra.InfiniteSum.Order import Mathlib.Topology.MetricSpace.Bounded diff --git a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Degree.lean b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Degree.lean index 330d9293d2..df63098f6f 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Degree.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Degree.lean @@ -9,7 +9,6 @@ public import LeanPool.LeanModularForms.HeckeRIngs.AbstractHeckeRing.Ring import LeanPool.LeanModularForms.HeckeRIngs.AbstractHeckeRing.Associativity import Mathlib.Analysis.Normed.Group.Basic import Mathlib.Data.EReal.Operations -import Mathlib.Data.Int.ConditionallyCompleteOrder import Mathlib.Tactic.ContinuousFunctionalCalculus import Mathlib.Topology.Algebra.InfiniteSum.Order import Mathlib.Topology.MetricSpace.Bounded diff --git a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Module.lean b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Module.lean index 2b6c3a3e78..43a544ef4f 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Module.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Module.lean @@ -162,7 +162,7 @@ lemma zero_smul_HeckeModule (z : HeckeModule P Z) : (0 : 𝕋 P Z) • z = 0 := /-- Any Hecke ring element acts as zero on the zero module element. -/ lemma smul_zero_HeckeModule (T : 𝕋 P Z) : T • (0 : HeckeModule P Z) = 0 := by simp only [smul_eq_sum] - simp_all + simp_all only [single_mul, sum_zero_index, sum_fun_zero] /-- The module action is additive in the module argument. -/ lemma smul_add_right (T : 𝕋 P Z) (m₁ m₂ : HeckeModule P Z) : diff --git a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Multiplication.lean b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Multiplication.lean index 06ad408534..983136864b 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Multiplication.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Multiplication.lean @@ -13,7 +13,6 @@ public meta import Mathlib.Tactic.ToAdditive import Mathlib.Analysis.Normed.Group.Basic import Mathlib.Data.EReal.Operations import Mathlib.Data.Finsupp.SMulWithZero -import Mathlib.Data.Int.ConditionallyCompleteOrder import Mathlib.Tactic.ContinuousFunctionalCalculus import Mathlib.Topology.Algebra.InfiniteSum.Order import Mathlib.Topology.MetricSpace.Bounded @@ -178,7 +177,7 @@ lemma set_singleton_mul_left_cancel (a : G) {S T : Set G} · intro hx have hax : a * x ∈ ({a} : Set G) * T := by rw [← h]; exact Set.mul_mem_mul (Set.mem_singleton a) hx - simp_all + simp_all only [singleton_mul, image_mul_left, mem_preimage, inv_mul_cancel_left] · intro hx have hax : a * x ∈ ({a} : Set G) * S := by rw [h]; exact Set.mul_mem_mul (Set.mem_singleton a) hx @@ -542,7 +541,7 @@ lemma mul_singleton_𝕋 (D1 D2 : HeckeCoset P) (a b : ℤ) : TSingle P ℤ D1 a * TSingle P ℤ D2 b = a • b • m P (HeckeCoset.rep D1) (HeckeCoset.rep D2) := by simp_rw [TSingle, mul_def] - simp_all + simp_all only [zero_smul, smul_zero, Finsupp.sum_single_index] open Finsupp diff --git a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Ring.lean b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Ring.lean index 348d9000b4..26f42bee4f 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Ring.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Ring.lean @@ -10,7 +10,6 @@ import LeanPool.LeanModularForms.HeckeRIngs.AbstractHeckeRing.Associativity import Mathlib.Analysis.Normed.Group.Basic import Mathlib.Data.EReal.Operations import Mathlib.Data.Finsupp.SMul -import Mathlib.Data.Int.ConditionallyCompleteOrder import Mathlib.Tactic.ContinuousFunctionalCalculus import Mathlib.Topology.Algebra.InfiniteSum.Order import Mathlib.Topology.MetricSpace.Bounded diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GL2/Basic.lean b/LeanPool/LeanModularForms/HeckeRIngs/GL2/Basic.lean index 8c8dc14fa8..d023ace164 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GL2/Basic.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GL2/Basic.lean @@ -11,7 +11,6 @@ import LeanPool.LeanModularForms.HeckeRIngs.GLn.CoprimeMul import LeanPool.LeanModularForms.HeckeRIngs.GLn.PrimeDecomposition import Mathlib.Analysis.Normed.Group.Basic import Mathlib.Data.EReal.Operations -import Mathlib.Data.Int.ConditionallyCompleteOrder import Mathlib.Tactic.Positivity.Finset import Mathlib.Topology.Algebra.InfiniteSum.Order import Mathlib.Topology.MetricSpace.Bounded diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GL2/Degree.lean b/LeanPool/LeanModularForms/HeckeRIngs/GL2/Degree.lean index 4800bf9e67..700f5b3774 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GL2/Degree.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GL2/Degree.lean @@ -148,7 +148,9 @@ theorem deg_T_sum_prime_pow (k : ℕ) : /-- `deg(TSum(1)) = 1`, used as base case for deg_T_sum. -/ private lemma deg_T_sum_one : deg (GLPair 2) (TSum 1) = 1 := by change deg (GLPair 2) (∑ a ∈ Nat.divisors 1, TAd a (1 / a)) = 1 - simp_all + simp_all only [Nat.divisors_one, Finset.sum_singleton, Order.lt_one_iff, Nat.div_self, + T_ad_one_one, + deg_one_val] /-- Theorem 3.24(7): `deg(T(m)) = σ₁(m)`. By prime factorization + coprime multiplicativity + prime-power case. -/ diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GL2/HeckeAction.lean b/LeanPool/LeanModularForms/HeckeRIngs/GL2/HeckeAction.lean index f5fc1c3d26..6316824118 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GL2/HeckeAction.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GL2/HeckeAction.lean @@ -201,7 +201,7 @@ private lemma heckeSlash_slash (k : ℤ) (D : HeckeCoset (GLPair 2)) (f : ℍ (g : GL (Fin 2) ℚ) : (heckeSlash k D f) ∣[k] g = ∑ i : decompQuot (GLPair 2) (HeckeCoset.rep D), (f ∣[k] tRep D i) ∣[k] g := by simp only [heckeSlash] - simp_all + simp_all only [SlashAction.sum_slash] /-- Left multiplication by a transposed H-element preserves the slash action under Γ-invariance: `f ∣[k] (hᵀ * g) = f ∣[k] g` when `h ∈ H`. -/ diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GL2/HeckeModularForm.lean b/LeanPool/LeanModularForms/HeckeRIngs/GL2/HeckeModularForm.lean index f82a2f6cc0..2e727c8ad8 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GL2/HeckeModularForm.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GL2/HeckeModularForm.lean @@ -294,7 +294,8 @@ private theorem heckeSlash_comp (k : ℤ) (D₁ D₂ : HeckeCoset (GLPair 2)) (f (∑ j : decompQuot (GLPair 2) (HeckeCoset.rep D₂), f ∣[k] tRep D₂ j) ∣[k] tRep D₁ i) = ∑ i, ∑ j, (f ∣[k] tRep D₂ j) ∣[k] tRep D₁ i from by - simp_all] + simp_all only [MonoidHom.mem_range, forall_exists_index, forall_apply_eq_imp_iff, + SlashAction.sum_slash]] have h_slash_mul : ∀ (i : decompQuot (GLPair 2) (HeckeCoset.rep D₁)) (j : decompQuot (GLPair 2) (HeckeCoset.rep D₂)), diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GL2/MultiplicationTable.lean b/LeanPool/LeanModularForms/HeckeRIngs/GL2/MultiplicationTable.lean index 2d6e705a91..6c491bca32 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GL2/MultiplicationTable.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GL2/MultiplicationTable.lean @@ -13,7 +13,6 @@ import LeanPool.LeanModularForms.HeckeRIngs.GLn.TransposeAntiInvolution import Mathlib.Analysis.Normed.Group.Basic import Mathlib.Data.EReal.Operations import Mathlib.Data.Finset.NatDivisors -import Mathlib.Data.Int.ConditionallyCompleteOrder import Mathlib.Data.Int.Star import Mathlib.NumberTheory.ArithmeticFunction.Misc import Mathlib.Tactic.Positivity.Finset @@ -234,7 +233,7 @@ private lemma mulSupport_pp_det_eq (k : ℕ) (a : Fin 2 → ℕ) (ha_pos : ∀ i have h_rhs : (g₁ * g₂ * (g₃ * g₄)).val.det = (a 0 : ℚ) * (a 1 : ℚ) := by rw [h_eq, Units.val_mul, Units.val_mul, Matrix.det_mul, Matrix.det_mul] simp only [SLnZ_to_GLnQ_det, diagMat_det 2 _ ha_pos, Fin.prod_univ_two, one_mul, mul_one] - exact_mod_cast show (a 0 : ℚ) * (a 1 : ℚ) = (p : ℚ) ^ (k + 1) by linarith + exact_mod_cast show (a 0 : ℚ) * (a 1 : ℚ) = (p : ℚ) ^ (k + 1) by linarith only [h_lhs, h_rhs] include hp in private lemma mulSupport_pp_dvd_p_aux diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GLn/Basic.lean b/LeanPool/LeanModularForms/HeckeRIngs/GLn/Basic.lean index 2023a1df24..13a7f4a321 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GLn/Basic.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GLn/Basic.lean @@ -9,7 +9,6 @@ public import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs public import LeanPool.LeanModularForms.HeckeRIngs.AbstractHeckeRing.Basic import Mathlib.Analysis.Normed.Group.Basic import Mathlib.Data.EReal.Operations -import Mathlib.Data.Int.ConditionallyCompleteOrder import Mathlib.Topology.Algebra.InfiniteSum.Order import Mathlib.Topology.MetricSpace.Bounded @@ -145,8 +144,8 @@ private lemma gamma_decompose (d : ℤ) (gamma : Matrix (Fin n) (Fin n) ℤ) gamma = 1 + d • Matrix.of fun i j => (gamma i j - (1 : Matrix _ _ ℤ) i j) / d := by ext i j; simp only [Matrix.add_apply, Matrix.one_apply, Matrix.smul_apply, smul_eq_mul, Matrix.of_apply, Matrix.one_apply] at * - nlinarith [mul_comm ((gamma i j - if i = j then 1 else 0) / d) d, - Int.ediv_mul_cancel (hgamma i j)] + nlinarith only [hgamma, mul_comm ((gamma i j - if i = j then 1 else 0) / d) d, + Int.ediv_mul_cancel (hgamma i j)] /-- If `d | (γ - I)` entry-wise, then `d | (adj(A) * γ * A)` entry-wise. Key: `adj(A) * (I + dM) * A = d·I + d·(adj(A)·M·A)`. -/ diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GLn/CoprimeMul.lean b/LeanPool/LeanModularForms/HeckeRIngs/GLn/CoprimeMul.lean index 0f20cdaf51..f25c24ace2 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GLn/CoprimeMul.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GLn/CoprimeMul.lean @@ -10,7 +10,6 @@ public import LeanPool.LeanModularForms.HeckeRIngs.AbstractHeckeRing.Degree import LeanPool.LeanModularForms.HeckeRIngs.GLn.SLnTransvection import Mathlib.Analysis.Normed.Group.Basic import Mathlib.Data.EReal.Operations -import Mathlib.Data.Int.ConditionallyCompleteOrder import Mathlib.Tactic.LinearCombination import Mathlib.Tactic.Positivity.Finset import Mathlib.Topology.Algebra.InfiniteSum.Order @@ -615,7 +614,7 @@ private lemma GLnQ_mem_SLnZ_of_coprime_scaling (C : GL (Fin n) ℚ) t * ((pb : ℚ) * (↑C : Matrix (Fin n) (Fin n) ℚ) i j) := by have hst_Q : (s : ℚ) * (pa : ℚ) + (t : ℚ) * (pb : ℚ) = 1 := by exact_mod_cast hst have := congr_arg (· * (↑C : Matrix (Fin n) (Fin n) ℚ) i j) hst_Q - simp only [add_mul, one_mul] at this; linarith + simp only [add_mul, one_mul] at this; linarith only [this] rw [h1, hza, hzb]; push_cast; ring set N : Matrix (Fin n) (Fin n) ℤ := Matrix.of fun i j => (h_int i j).choose have hN_eq : ∀ i j, (↑C : Matrix (Fin n) (Fin n) ℚ) i j = ((N i j : ℤ) : ℚ) := @@ -689,7 +688,7 @@ private lemma diagSandwich_scaling (b : Fin n → ℕ) (hb : ∀ i, 0 < b i) RingHom.mapMatrix_apply, Int.coe_castRingHom, algebraMap_int_eq, Matrix.mul_diagonal, Matrix.diagonal_mul, Matrix.map_apply] at h_entry have hbq_ne : (b q : ℚ) ≠ 0 := Nat.cast_ne_zero.mpr (hb q).ne' - field_simp at h_entry ⊢; linarith + field_simp at h_entry ⊢; linarith only [h_entry] rw [h_D_entry] have h_dvd : (b q : ℤ) ∣ ∏ k, (b k : ℤ) := Finset.dvd_prod_of_mem _ (Finset.mem_univ q) have hbq_ne : (b q : ℚ) ≠ 0 := Nat.cast_ne_zero.mpr (hb q).ne' diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GLn/Degree.lean b/LeanPool/LeanModularForms/HeckeRIngs/GLn/Degree.lean index 3486a3c457..0a09d8df28 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GLn/Degree.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GLn/Degree.lean @@ -486,7 +486,7 @@ private lemma diagMat_comm_of_const (a : Fin n → ℕ) (ha : ∀ i, 0 < a i) (a 0 : ℚ) • (1 : Matrix (Fin n) (Fin n) ℚ) := by ext i j simp only [Matrix.diagonal_apply, Matrix.smul_apply, Matrix.one_apply, smul_eq_mul] - simp_all + simp_all only [forall_const, mul_ite, mul_one, mul_zero] rw [h_diag, smul_mul_assoc, mul_smul_comm, one_mul, mul_one] /-- For `n = 2`, scalar case: `deg(T(c, c)) = 1`. -/ diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GLn/DiagonalCosets.lean b/LeanPool/LeanModularForms/HeckeRIngs/GLn/DiagonalCosets.lean index c93270bb7c..606b2824b8 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GLn/DiagonalCosets.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GLn/DiagonalCosets.lean @@ -405,14 +405,14 @@ private lemma gcd_2x2_mul (a b : ℤ) : intro g s t p q have hpg : p * g = a := Int.ediv_mul_cancel (Int.gcd_dvd_left a b) have hqg : q * g = b := Int.ediv_mul_cancel (Int.gcd_dvd_right a b) - have hbez : s * a + t * b = g := by linarith [Int.gcd_eq_gcd_ab a b] + have hbez : s * a + t * b = g := by linarith only [Int.gcd_eq_gcd_ab a b] have h1 : !![s, t; -q, p] * (!![a, (0 : ℤ); 0, b] : Matrix (Fin 2) (Fin 2) ℤ) = !![s * a, t * b; -(q * a), p * b] := by ext i j; fin_cases i <;> fin_cases j <;> simp [mul_apply, Fin.sum_univ_two] rw [h1]; ext i j; fin_cases i <;> fin_cases j <;> simp only [Fin.zero_eta, Fin.isValue, mul_apply, of_apply, cons_val', cons_val_fin_one, cons_val_zero, Fin.sum_univ_two, mul_one, cons_val_one, Fin.mk_one, mul_neg, neg_mul, neg_neg] - · linarith + · linarith only [hbez] · have key : -(s * a * (t * q)) + t * b * (1 - t * q) = (1 - (s * p + t * q)) * (t * q * g) := by rw [← hpg, ← hqg]; ring rw [key] @@ -421,9 +421,9 @@ private lemma gcd_2x2_mul (a b : ℤ) : calc (s * p + t * q) * g = s * (p * g) + t * (q * g) := by ring _ = s * a + t * b := by rw [hpg, hqg] _ = g := hbez - linarith + linarith only [this] have : (1 - (s * p + t * q)) * (t * q * g) = t * q * ((1 - (s * p + t * q)) * g) := by ring - linarith [mul_eq_zero_of_right (t * q) h2] + linarith only [h2, mul_eq_zero_of_right (t * q) h2] · rw [← hpg, ← hqg]; ring · rw [← hpg, ← hqg]; ring @@ -601,7 +601,9 @@ private lemma make_first_divide_all (k : ℕ) (d : Fin (k + 2) → ℤ) (hd : obtain ⟨L₁, R₁, d₁, hd₁_pos, hd₁_zero, hd₁_rest, _, hlt, hmul₁⟩ := gcd_step_general k d hd j hj_ne have hN₁ : (d₁ (0 : Fin (k + 2))).natAbs < N := by - simp_all + simp_all only [exists_prop, forall_const, ne_eq, Fin.val_eq_zero_iff, + Fin.zero_eta, + Int.natAbs_natCast, not_false_eq_true] obtain ⟨d₂, hd₂_pos, hd₂_div, L₂, R₂, hmul₂⟩ := ih _ hN₁ d₁ hd₁_pos (hd₁_pos 0) rfl refine ⟨d₂, hd₂_pos, hd₂_div, L₂ * L₁, R₁ * R₂, ?_⟩ diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GLn/SLnTransvection.lean b/LeanPool/LeanModularForms/HeckeRIngs/GLn/SLnTransvection.lean index f30f69b1c1..c3a0db429d 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GLn/SLnTransvection.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GLn/SLnTransvection.lean @@ -82,7 +82,7 @@ private lemma slTransvecG_col0 {m : ℕ} (i j : Fin (m + 1)) (hij : i ≠ j) (c private lemma col0_ne_zero {m : ℕ} (σ : Matrix.SpecialLinearGroup (Fin (m + 1)) ℤ) : ∃ i, σ.1 i 0 ≠ 0 := by by_contra h; push Not at h - linarith [σ.2, Matrix.det_eq_zero_of_column_eq_zero 0 (fun i => h i)] + linarith only [h, σ.2, Matrix.det_eq_zero_of_column_eq_zero 0 (fun i => h i)] private def nzCount {m : ℕ} (σ : Matrix.SpecialLinearGroup (Fin (m + 1)) ℤ) : ℕ := (Finset.univ.filter fun i : Fin (m+1) => σ.1 i 0 ≠ 0).card @@ -106,7 +106,7 @@ private lemma col0_euclidean_step {m : ℕ} (σ : Matrix.SpecialLinearGroup (Fin set q := σ.1 i₀ 0 / σ.1 j₀ 0 have h_new : (slTransvecG i₀ j₀ hij₀ (-q) * σ).1 i₀ 0 = σ.1 i₀ 0 % σ.1 j₀ 0 := by rw [slTransvecG_col0]; simp only [ite_true] - linarith [(Int.mul_ediv_add_emod (σ.1 i₀ 0) (σ.1 j₀ 0)).symm] + linarith only [(Int.mul_ediv_add_emod (σ.1 i₀ 0) (σ.1 j₀ 0)).symm] have h_oth : ∀ a, a ≠ i₀ → (slTransvecG i₀ j₀ hij₀ (-q) * σ).1 a 0 = σ.1 a 0 := fun a ha => by rw [slTransvecG_col0]; simp [ha] have h_rem : (σ.1 i₀ 0 % σ.1 j₀ 0).natAbs < (σ.1 j₀ 0).natAbs := by @@ -122,14 +122,14 @@ private lemma col0_euclidean_step {m : ℕ} (σ : Matrix.SpecialLinearGroup (Fin ((slTransvecG i₀ j₀ hij₀ (-q) * σ).1 k 0).natAbs = ∑ k ∈ Finset.univ.erase i₀, (σ.1 k 0).natAbs := Finset.sum_congr rfl fun k hk => by rw [h_oth k (Finset.mem_erase.mp hk).1] - rw [h_rest, h_new]; linarith [Nat.lt_of_lt_of_le h_rem hge] + rw [h_rest, h_new]; linarith only [hge, h_rem, Nat.lt_of_lt_of_le h_rem hge] · push Not at hge refine ⟨j₀, i₀, Ne.symm hij₀, -(σ.1 j₀ 0 / σ.1 i₀ 0), ?_⟩ set q := σ.1 j₀ 0 / σ.1 i₀ 0 have h_new : (slTransvecG j₀ i₀ (Ne.symm hij₀) (-q) * σ).1 j₀ 0 = σ.1 j₀ 0 % σ.1 i₀ 0 := by rw [slTransvecG_col0]; simp only [ite_true] - linarith [(Int.mul_ediv_add_emod (σ.1 j₀ 0) (σ.1 i₀ 0)).symm] + linarith only [(Int.mul_ediv_add_emod (σ.1 j₀ 0) (σ.1 i₀ 0)).symm] have h_oth : ∀ a, a ≠ j₀ → (slTransvecG j₀ i₀ (Ne.symm hij₀) (-q) * σ).1 a 0 = σ.1 a 0 := @@ -147,7 +147,7 @@ private lemma col0_euclidean_step {m : ℕ} (σ : Matrix.SpecialLinearGroup (Fin ((slTransvecG j₀ i₀ (Ne.symm hij₀) (-q) * σ).1 k 0).natAbs = ∑ k ∈ Finset.univ.erase j₀, (σ.1 k 0).natAbs := Finset.sum_congr rfl fun k hk => by rw [h_oth k (Finset.mem_erase.mp hk).1] - rw [h_rest, h_new]; linarith [Nat.lt_of_lt_of_le h_rem (Nat.le_of_lt hge)] + rw [h_rest, h_new]; linarith only [hge, h_rem, Nat.lt_of_lt_of_le h_rem (Nat.le_of_lt hge)] private lemma col0_reduce {m : ℕ} (σ : Matrix.SpecialLinearGroup (Fin (m + 1)) ℤ) : ∃ (L : List (Matrix.SpecialLinearGroup (Fin (m+1)) ℤ)), diff --git a/LeanPool/LeanModularForms/Modularforms/ClogArgLems.lean b/LeanPool/LeanModularForms/Modularforms/ClogArgLems.lean index 25a00645b8..d6c467e9f2 100644 --- a/LeanPool/LeanModularForms/Modularforms/ClogArgLems.lean +++ b/LeanPool/LeanModularForms/Modularforms/ClogArgLems.lean @@ -62,7 +62,7 @@ lemma arg_pow_aux (n : ℕ) (x : ℂ) (hx : x ≠ 0) (hna : |arg x| < π / n) : lemma one_add_abs_half_ne_zero {x : ℂ} (hb : ‖x‖ < 1 / 2) : 1 + x ≠ 0 := by intro h rw [add_eq_zero_iff_neg_eq] at h - simp [← h] at hb; linarith + simp [← h] at hb; linarith only [hb] lemma arg_pow (n : ℕ) (f : ℕ → ℂ) (hf : Tendsto f atTop (𝓝 0)) : ∀ᶠ m : ℕ in atTop, Complex.arg ((1 + f m) ^ n) = n * Complex.arg (1 + f m) := by diff --git a/LeanPool/LeanModularForms/Modularforms/Cotangent.lean b/LeanPool/LeanModularForms/Modularforms/Cotangent.lean index e02031caa0..a4b88f041e 100644 --- a/LeanPool/LeanModularForms/Modularforms/Cotangent.lean +++ b/LeanPool/LeanModularForms/Modularforms/Cotangent.lean @@ -7,10 +7,6 @@ module public import Mathlib.Analysis.SpecialFunctions.Trigonometric.Cotangent -import Mathlib.Analysis.Complex.UpperHalfPlane.Basic -import Mathlib.Analysis.SpecialFunctions.Trigonometric.Arctan -import Mathlib.MeasureTheory.Covering.Besicovitch -import Mathlib.Tactic.Positivity.Finset /-! # Cotangent series expansion diff --git a/LeanPool/LeanModularForms/Modularforms/Derivative.lean b/LeanPool/LeanModularForms/Modularforms/Derivative.lean index c162faaf4a..558b4a0aa0 100644 --- a/LeanPool/LeanModularForms/Modularforms/Derivative.lean +++ b/LeanPool/LeanModularForms/Modularforms/Derivative.lean @@ -9,14 +9,12 @@ module public import LeanPool.LeanModularForms.Modularforms.MDifferentiableFunProp import LeanPool.LeanModularForms.ForMathlib.AtImInfty -import LeanPool.LeanModularForms.Modularforms.ForMathlibCusps import LeanPool.LeanModularForms.Modularforms.SummableLems import Mathlib.Algebra.Order.Star.Real import Mathlib.Analysis.Complex.Liouville /-! # Derivative -/ - @[expose] public section open UpperHalfPlane hiding I @@ -181,7 +179,8 @@ lemma MDifferentiable_div {F G : ℍ → ℂ} simp [Function.comp, Pi.div_apply, ofComplex_apply_of_im_pos hw] exact ((MDifferentiableAt_DifferentiableAt (hF τ)).div (MDifferentiableAt_DifferentiableAt (hG τ)) - (by simp_all)).congr_of_eventuallyEq h_eq.symm + (by simp_all only [ne_eq, Function.comp_apply, ofComplex_apply, + not_false_eq_true])).congr_of_eventuallyEq h_eq.symm @[simp] theorem D_const (c : ℂ) : D (Function.const ℍ c) = 0 := by @@ -541,7 +540,11 @@ lemma D_slash (k : ℤ) (F : ℍ → ℂ) (hF : MDiff F) (γ : SL(2, ℤ)) : simp only [ModularForm.SL_slash_apply, hF_mob, hmob_eq] have hpow_combine : 1 / (denom γ z) ^ 2 * (denom γ z) ^ (-k) = (denom γ z) ^ (-(k + 2)) := by rw [one_div, ← zpow_natCast (denom γ z) 2, ← zpow_neg, ← zpow_add₀ hz_denom_ne] - simp_all + simp_all only [ne_eq, denom_ne_zero, not_false_eq_true, + Matrix.SpecialLinearGroup.coeToGL_det, Units.val_one, + zero_lt_one, Function.comp_apply, zpow_neg, gt_iff_lt, deriv_mul, one_div, Fin.isValue, + neg_mul, + ModularGroup.sl_moeb, Nat.cast_ofNat, Int.reduceNeg, neg_add_rev] have hpow_m1 : (denom γ z) ^ (-k - 1) = (denom γ z) ^ (-1 : ℤ) * (denom γ z) ^ (-k) := by rw [← zpow_add₀ hz_denom_ne] congr 1 @@ -655,7 +658,9 @@ theorem D_real_of_real {F : ℍ → ℂ} (hF_real : ResToImagAxis.Real F) im_deriv_eq_zero_of_im_eq_zero (ResToImagAxis.Differentiable F hF_diff t ht) him have h_im_eq : (deriv F.resToImagAxis t).im = -2 * π * ((D F).resToImagAxis t).im := by simpa [mul_assoc, ofReal_mul] using congrArg Complex.im (deriv_resToImagAxis_eq F hF_diff ht) - simp_all + simp_all only [resToImagAxis_apply, resToImagAxis_eq_resToImagAxis, neg_mul, zero_eq_neg, + mul_eq_zero, + OfNat.ofNat_ne_zero, pi_ne_zero, or_self, false_or] /-- The real part of F.resToImagAxis has derivative -2π * ((D F).resToImagAxis t).re at t. -/ lemma hasDerivAt_resToImagAxis_re {F : ℍ → ℂ} (hdiff : MDiff F) @@ -675,7 +680,7 @@ theorem D_nonneg_from_antitone {F : ℍ → ℂ} have hderiv_nonpos : deriv (fun s => (F.resToImagAxis s).re) t ≤ 0 := (derivWithin_of_isOpen isOpen_Ioi ht).symm.trans_le hanti.derivWithin_nonpos rw [(hasDerivAt_resToImagAxis_re hdiff ht).deriv] at hderiv_nonpos - nlinarith [Real.pi_pos] + nlinarith only [hderiv_nonpos, Real.pi_pos] /-- If F is real on the imaginary axis, MDifferentiable, and has strictly negative derivative on the imaginary axis, then D F is positive on the imaginary axis. @@ -691,7 +696,7 @@ theorem D_pos_from_deriv_neg {F : ℍ → ℂ} refine ⟨D_real_of_real hreal hdiff, fun t ht => ?_⟩ have hderiv := hderiv_neg t ht rw [(hasDerivAt_resToImagAxis_re hdiff ht).deriv] at hderiv - nlinarith [Real.pi_pos] + nlinarith only [hderiv, Real.pi_pos] /-- If $F$ is a modular form where $F(it)$ is positive for sufficiently large $t$ (i.e. constant term @@ -708,7 +713,7 @@ theorem antiDerPos {F : ℍ → ℂ} (hFderiv : MDiff F) have hn : ∀ t ∈ Set.Ioi (0 : ℝ), deriv g t < 0 := fun t (ht : 0 < t) => by rw [(hg t ht).deriv] have ht' : 0 < (ResToImagAxis (D F) t).re := hDF_pos t ht - nlinarith [Real.pi_pos] + nlinarith only [ht', Real.pi_pos] have gpos := fun t ht => StrictAntiOn.eventuallyPos_Ioi (strictAntiOn_of_deriv_neg (convex_Ioi 0) (fun x hx => (hg x hx).continuousAt.continuousWithinAt) @@ -741,8 +746,8 @@ lemma closedBall_center_subset_upperHalfPlane (z : ℍ) : _ ≤ ‖w - z‖ := abs_im_le_norm _ _ = dist w z := (dist_eq_norm _ _).symm _ ≤ z.im / 2 := hdist - have hlower : z.im / 2 ≤ w.im := by linarith [(abs_le.mp habs).1] - exact lt_of_lt_of_le (by linarith [z.im_pos] : 0 < z.im / 2) hlower + have hlower : z.im / 2 ≤ w.im := by linarith only [habs, (abs_le.mp habs).1] + exact lt_of_lt_of_le (by linarith only [z.im_pos] : 0 < z.im / 2) hlower /-- Cauchy estimate for the D-derivative: if `f ∘ ofComplex` is holomorphic on a disk of radius `r` around `z` and bounded by `M` on the boundary sphere, @@ -770,7 +775,7 @@ lemma D_isBoundedAtImInfty_of_bounded {f : ℍ → ℂ} obtain ⟨M, A, hMA⟩ := hbdd use M / π, 2 * max A 0 + 1 intro z hz - have hR_pos : 0 < z.im / 2 := by linarith [z.im_pos] + have hR_pos : 0 < z.im / 2 := by linarith only [z.im_pos] have hclosed := closedBall_center_subset_upperHalfPlane z have hDiff : DiffContOnCl ℂ (f ∘ ofComplex) (Metric.ball (z : ℂ) (z.im / 2)) := diffContOnCl_comp_ofComplex_of_mdifferentiable hf hclosed @@ -783,10 +788,11 @@ lemma D_isBoundedAtImInfty_of_bounded {f : ℍ → ℂ} _ ≤ ‖w - z‖ := abs_im_le_norm _ _ = dist w z := (dist_eq_norm _ _).symm _ = z.im / 2 := hdist - have hw_im_ge_A : A ≤ w.im := by linarith [(abs_le.mp habs).1, le_max_left A 0] + have hw_im_ge_A : A ≤ w.im := by linarith only [hz, habs, (abs_le.mp habs).1, le_max_left A 0] simpa [ofComplex_apply_of_im_pos hw_im_pos] using hMA ⟨w, hw_im_pos⟩ hw_im_ge_A - have hz_im_ge_1 : 1 ≤ z.im := by linarith [le_max_right A 0] - have hM_nonneg : 0 ≤ M := le_trans (norm_nonneg _) (hMA z (by linarith [le_max_left A 0])) + have hz_im_ge_1 : 1 ≤ z.im := by linarith only [hz, le_max_right A 0] + have hM_nonneg : 0 ≤ M := le_trans (norm_nonneg _) (hMA z (by + linarith only [hz, hR_pos, le_max_left A 0])) calc ‖D f z‖ ≤ M / (2 * π * (z.im / 2)) := norm_D_le_of_sphere_bound hR_pos hDiff hf_bdd_sphere _ = M / (π * z.im) := by ring _ ≤ M / (π * 1) := by gcongr diff --git a/LeanPool/LeanModularForms/Modularforms/DimensionFormulas.lean b/LeanPool/LeanModularForms/Modularforms/DimensionFormulas.lean index 77863a2f1b..ed3ac77f91 100644 --- a/LeanPool/LeanModularForms/Modularforms/DimensionFormulas.lean +++ b/LeanPool/LeanModularForms/Modularforms/DimensionFormulas.lean @@ -134,7 +134,8 @@ lemma delta_eq_E4E6_const : ∃ (c : ℂ), (c • Delta) = DeltaE4E6Aux := by lemma cuspform_weight_lt_12_zero (k : ℤ) (hk : k < 12) : Module.rank ℂ (CuspForm Γ(1) k) = 0 := by rw [LinearEquiv.rank_eq (CuspFormsIsoModforms k)] - exact rank_modularForm_gammaOne (ModularForm.levelOne_neg_weight_rank_zero (by linarith)) + exact rank_modularForm_gammaOne (ModularForm.levelOne_neg_weight_rank_zero (by + linarith only [hk])) lemma IsCuspForm_weight_lt_eq_zero (k : ℤ) (hk : k < 12) (f : ModularForm Γ(1) k) (hf : IsCuspForm Γ(1) k f) : f = 0 := by @@ -148,7 +149,7 @@ lemma IsCuspForm_weight_lt_eq_zero (k : ℤ) (hk : k < 12) (f : ModularForm Γ(1 rw [← hz] have := rank_zero_iff_forall_zero.mp (cuspform_weight_lt_12_zero k hk) (IsCuspFormToCuspForm Γ(1) k f hf) - simp_all + simp_all only [SlashInvariantForm.toFun_eq_coe, toSlashInvariantForm_coe, zero_apply] lemma Delta_E4_E6_eq : ModFormMk _ _ DeltaE4E6Aux = ((1/ 1728 : ℂ) • (((DirectSum.of _ 4 E₄)^3 - (DirectSum.of _ 6 E₆)^2) 12 )) := by @@ -228,7 +229,7 @@ theorem Delta_E4_eqn : Delta = DeltaE4E6Aux := by ext z obtain ⟨c, H⟩ := delta_eq_E4E6_const suffices h2 : c = 1 by - simp_all + simp_all only [one_smul] · have h1 := Delta_q_one_term have h2 := Delta_E4_E6_aux_q_one_term rw [← H] at h2 @@ -236,7 +237,7 @@ theorem Delta_E4_eqn : Delta = DeltaE4E6Aux := by (hh := by positivity) (hΓ := by simp) c Delta).symm have hsmul : qExpansion 1 ⇑(c • Delta) = qExpansion 1 (c • ⇑Delta) := by rfl rw [hsmul, ← Nat.cast_one (R := ℝ), ← hs] at h2 - simp_all + simp_all only [Nat.cast_one, map_smul, smul_eq_mul, mul_one, one_smul] /-- A weight-`k` level-one space with a generator `g` whose `q`-expansion has constant term `1` diff --git a/LeanPool/LeanModularForms/Modularforms/Eisenstein.lean b/LeanPool/LeanModularForms/Modularforms/Eisenstein.lean index 0db6dba017..7fdb016521 100644 --- a/LeanPool/LeanModularForms/Modularforms/Eisenstein.lean +++ b/LeanPool/LeanModularForms/Modularforms/Eisenstein.lean @@ -952,7 +952,7 @@ lemma norm_exp_two_pi_I_le_exp_neg_two_pi (z : ℍ) (hz : 1 ≤ z.im) : rw [show (2 : ℂ) * ↑π * Complex.I * z = Complex.I * (2 * π * z) by ring] simp [Complex.I_re, Complex.I_im, mul_comm] rw [Complex.norm_exp, h, Real.exp_le_exp] - nlinarith [Real.pi_pos] + nlinarith only [hz, Real.pi_pos] /-- Bound on the q-series ∑ n·qⁿ/(1-qⁿ) that appears in E₂. @@ -1017,7 +1017,7 @@ For im(z) ≥ 1, |q| ≤ exp(-2π), so by `norm_tsum_logDeriv_expo_le`, lemma E₂_isBoundedAtImInfty : IsBoundedAtImInfty E₂ := by rw [UpperHalfPlane.isBoundedAtImInfty_iff] set r₀ : ℝ := Real.exp (-2 * π) - have hr₀_lt_one : r₀ < 1 := Real.exp_lt_one_iff.mpr (by linarith [Real.pi_pos]) + have hr₀_lt_one : r₀ < 1 := Real.exp_lt_one_iff.mpr (by linarith only [Real.pi_pos]) refine ⟨1 + 24 * (r₀ / (1 - r₀) ^ 3), 1, fun z hz => ?_⟩ rw [E₂_eq] set q : ℂ := cexp (2 * π * Complex.I * z) diff --git a/LeanPool/LeanModularForms/Modularforms/EisensteinAsymptotics.lean b/LeanPool/LeanModularForms/Modularforms/EisensteinAsymptotics.lean index 34dd656613..6f5206a2da 100644 --- a/LeanPool/LeanModularForms/Modularforms/EisensteinAsymptotics.lean +++ b/LeanPool/LeanModularForms/Modularforms/EisensteinAsymptotics.lean @@ -8,14 +8,12 @@ module public import LeanPool.LeanModularForms.Modularforms.Derivative import LeanPool.LeanModularForms.ForMathlib.AtImInfty -import LeanPool.LeanModularForms.Modularforms.ForMathlibCusps import LeanPool.LeanModularForms.Modularforms.SerreDerivativeSlash import Mathlib.Algebra.Order.Star.Real import Mathlib.Analysis.Real.Pi.Bounds /-! # EisensteinAsymptotics -/ - @[expose] public section /-! @@ -87,23 +85,27 @@ lemma E₂_sub_one_isBigO_exp : (fun z : ℍ => E₂ z - 1) =O[atImInfty] -- Key bounds: ‖q‖ ≤ exp(-2π) < 1/2 have hq_bound : ‖q‖ ≤ Real.exp (-2 * π) := norm_exp_two_pi_I_le_exp_neg_two_pi z hz have hexp_lt_half : Real.exp (-2 * π) < 1 / 2 := by - have : 1 < 2 * π := by nlinarith [pi_gt_three] - calc Real.exp (-2 * π) < Real.exp (-1) := Real.exp_strictMono (by linarith) + have : 1 < 2 * π := by nlinarith only [pi_gt_three] + calc Real.exp (-2 * π) < Real.exp (-1) := Real.exp_strictMono (by linarith only [this]) _ < 1 / 2 := by rw [Real.exp_neg, one_div, inv_lt_inv₀ (Real.exp_pos _) (by norm_num : (0 : ℝ) < 2)] - have := Real.add_one_lt_exp (by norm_num : (1 : ℝ) ≠ 0); linarith + have := Real.add_one_lt_exp (by norm_num : (1 : ℝ) ≠ 0); linarith only [this] have hq_lt_half : ‖q‖ < 1 / 2 := lt_of_le_of_lt hq_bound hexp_lt_half - have hone_sub_q_gt_half : 1 / 2 < 1 - ‖q‖ := by linarith + have hone_sub_q_gt_half : 1 / 2 < 1 - ‖q‖ := by linarith only [hq_bound, hexp_lt_half] -- Use norm_tsum_logDeriv_expo_le and bound r/(1-r)³ ≤ 8r for r < 1/2 have htsum_bound := norm_tsum_logDeriv_expo_le (norm_exp_two_pi_I_lt_one z) have hsum_le_8q : ‖q‖ / (1 - ‖q‖) ^ 3 ≤ 8 * ‖q‖ := by - have h1 : (1 / 8 : ℝ) ≤ (1 - ‖q‖) ^ 3 := by nlinarith [sq_nonneg (1 - ‖q‖)] + have h1 : (1 / 8 : ℝ) ≤ (1 - ‖q‖) ^ 3 := by + nlinarith only [hq_bound, hexp_lt_half, sq_nonneg (1 - ‖q‖)] calc ‖q‖ / (1 - ‖q‖) ^ 3 ≤ ‖q‖ / (1 / 8) := by apply div_le_div_of_nonneg_left (norm_nonneg _) (by positivity) h1 _ = 8 * ‖q‖ := by ring have hq_eq_exp : ‖q‖ = Real.exp (-2 * π * z.im) := by have hre : (2 * ↑π * Complex.I * (z : ℂ)).re = -2 * π * z.im := by - simp_all + simp_all only [neg_mul, one_div, mul_re, re_ofNat, ofReal_re, im_ofNat, ofReal_im, + mul_zero, sub_zero, + Complex.I_re, mul_im, zero_mul, add_zero, Complex.I_im, mul_one, sub_self, coe_re, + coe_im, zero_sub] rw [Complex.norm_exp, hre] calc 24 * ‖∑' n : ℕ+, ↑n * q ^ (n : ℕ) / (1 - q ^ (n : ℕ))‖ ≤ 24 * (‖q‖ / (1 - ‖q‖) ^ 3) := by gcongr diff --git a/LeanPool/LeanModularForms/Modularforms/Eisensteinqexpansions.lean b/LeanPool/LeanModularForms/Modularforms/Eisensteinqexpansions.lean index 0d6e89664b..903ea60040 100644 --- a/LeanPool/LeanModularForms/Modularforms/Eisensteinqexpansions.lean +++ b/LeanPool/LeanModularForms/Modularforms/Eisensteinqexpansions.lean @@ -216,7 +216,7 @@ theorem q_exp_iden_2 (k : ℕ) (hk : 3 ≤ k) (hk2 : Even k) (z : ℍ) : lemma EQ0 (k : ℕ) (z : ℍ) : ∑' (x : Fin 2 → ℤ), 1 / (x 0 * (z : ℂ) + x 1) ^ ↑k = ∑' x : ℤ × ℤ, 1 / ((x.1 : ℂ) * z + x.2) ^ k := by rw [← (piFinTwoEquiv fun _ => ℤ).tsum_eq] - simp_all + simp_all only [Fin.isValue, one_div, piFinTwoEquiv_apply] lemma EQ1 (k : ℕ) (hk : 3 ≤ (k : ℤ)) (hk2 : Even k) (z : ℍ) : ∑' (x : Fin 2 → ℤ), 1 / (x 0 * (z : ℂ) + x 1) ^ ↑k = 2 * riemannZeta ↑k + @@ -321,7 +321,7 @@ lemma EQ2 (k : ℕ) (hk : 3 ≤ (k : ℤ)) (z : ℍ) : ∑' (x : Fin 2 → ℤ), 1 / ((c.1 0) * (z : ℂ) + (c.1 1)) ^ k := by have := EQ22 k hk z simp_rw [eisSummand] at this - simp_all + simp_all only [Nat.ofNat_le_cast, Fin.isValue, zpow_neg, zpow_natCast, one_div] /-This result is already proven in the modular forms repo and being PRed (slowly) into mathlib, so diff --git a/LeanPool/LeanModularForms/Modularforms/Eta.lean b/LeanPool/LeanModularForms/Modularforms/Eta.lean index c7470ca78f..4a497f1cd9 100644 --- a/LeanPool/LeanModularForms/Modularforms/Eta.lean +++ b/LeanPool/LeanModularForms/Modularforms/Eta.lean @@ -164,4 +164,6 @@ lemma eta_equality : {z : ℂ | 0 < z.im}.EqOn ((η ∘ (fun z : ℂ => -1/z))) simpa [ModularForm.eta] using (ModularForm.eta_ne_zero (z := (Complex.I : ℂ)) (by simp)) have hcd := (mul_eq_right₀ he).mp h3.symm rw [mul_eq_one_iff_inv_eq₀ hz, inv_eq_iff_eq_inv] at hcd - simp_all + simp_all only [ne_eq, inv_eq_zero, mem_ofPred_eq, comp_apply, Pi.smul_apply, Pi.mul_apply, + smul_eq_mul, + Complex.I_im, zero_lt_one, not_false_eq_true, inv_mul_cancel₀, one_mul] diff --git a/LeanPool/LeanModularForms/Modularforms/EtaCleanup.lean b/LeanPool/LeanModularForms/Modularforms/EtaCleanup.lean index 9136f135cd..63dc7611b2 100644 --- a/LeanPool/LeanModularForms/Modularforms/EtaCleanup.lean +++ b/LeanPool/LeanModularForms/Modularforms/EtaCleanup.lean @@ -86,7 +86,9 @@ theorem Summable_eta_q (z : ℍ) : Summable fun n : ℕ ↦ ‖-etaQ n z‖ := b @[fun_prop] lemma qParam_differentiable (n : ℝ) : Differentiable ℂ (𝕢 n) := by rw [show 𝕢 n = fun x => exp (2 * π * Complex.I * x / n) by rfl] - fun_prop + exact Differentiable.cexp + (Differentiable.div_const + (Differentiable.const_mul differentiable_id (2 * ↑π * Complex.I)) (↑n : ℂ)) @[fun_prop] lemma qParam_ContDiff (n : ℝ) (m : WithTop ℕ∞) : ContDiff ℂ m (𝕢 n) := by @@ -140,7 +142,10 @@ lemma logDeriv_one_sub_mul_cexp_comp (r : ℂ) {g : ℂ → ℂ} (hg : Different logDeriv ((fun z ↦ 1 - r * cexp z) ∘ g) = fun z ↦ -r * (deriv g z) * cexp (g z) / (1 - r * cexp (g z)) := by ext y - rw [logDeriv_comp (by fun_prop) (hg y), logDeriv_one_sub_exp] + rw [logDeriv_comp (by + exact DifferentiableAt.const_sub + (DifferentiableAt.const_mul (DifferentiableAt.cexp differentiableAt_id) r) 1) (hg y), + logDeriv_one_sub_exp] ring @@ -151,7 +156,7 @@ theorem one_add_eta_logDeriv_eq (z : ℂ) (i : ℕ) : ((fun z ↦ 1 - 1 * cexp z) ∘ fun x ↦ 2 * ↑π * Complex.I * (↑i + 1) * x) := by aesop have h3 : deriv (fun x : ℂ ↦ (2 * π * Complex.I * (i + 1) * x)) = fun _ ↦ 2 * π * Complex.I * (i + 1) := by - simp_all + simp_all only [one_mul, deriv_const_mul_id'] simp_rw [eta_q_eq_exp, h2, logDeriv_one_sub_mul_cexp_comp 1 (g := fun x => (2 * π * Complex.I * (i + 1) * x)) (by fun_prop), h3] simp @@ -174,7 +179,9 @@ lemma logDeriv_q' (n : ℝ) (z : ℂ) : logDeriv (𝕢 n) z = 2 * ↑π * Comple ext y simp only [Periodic.qParam, comp_apply] ring_nf - rw [this, logDeriv_comp (by fun_prop) (by fun_prop), deriv_const_mul _ (by fun_prop)] + rw [this, logDeriv_comp (by + exact DifferentiableAt.cexp differentiableAt_id) (by fun_prop), deriv_const_mul _ (by + exact differentiableAt_id)] simp only [logDeriv_exp, Pi.one_apply, deriv_id'', mul_one, one_mul] lemma logDeriv_z_term' (z : ℍ) : logDeriv (𝕢 24) ↑z = 2 * ↑π * Complex.I / 24 := by @@ -189,12 +196,19 @@ theorem etaProdTerm_differentiableAt (z : ℍ) : DifferentiableAt ℂ ηₚ ↑z · filter_upwards with b y apply (DifferentiableOn.finsetProd (u := Finset.range b) (f := fun i x => 1 - cexp (2 * ↑π * Complex.I * (↑i + 1) * x)) - (by fun_prop)).congr + (by + exact fun i a ↦ + DifferentiableOn.const_sub + (Differentiable.comp_differentiableOn (Differentiable.cexp differentiable_id) + (DifferentiableOn.const_mul differentiableOn_id (2 * ↑π * Complex.I * (↑i + 1)))) + 1)).congr intro x hx simp [sub_eq_add_neg, eta_q_eq_exp] lemma eta_DifferentiableAt_UpperHalfPlane' (z : ℍ) : DifferentiableAt ℂ dedekindEtaFun' z := by - apply DifferentiableAt.mul (by fun_prop) (etaProdTerm_differentiableAt z) + apply DifferentiableAt.mul (by + exact Differentiable.differentiableAt + (qParam_differentiable 24)) (etaProdTerm_differentiableAt z) lemma eta_logDeriv' (z : ℍ) : logDeriv dedekindEtaFun' z = (π * Complex.I / 12) * E₂ z := by unfold dedekindEtaFun' etaProdTerm @@ -221,7 +235,8 @@ lemma eta_logDeriv' (z : ℍ) : logDeriv dedekindEtaFun' z = (π * Complex.I / 1 apply tsum_congr; intro n; push_cast; ring · intro i x hx simp_rw [eta_q_eq_exp] - fun_prop + exact ((differentiableAt_const (1 : ℂ)).sub + (((differentiableAt_const (𝕜 := ℂ) _).mul differentiableAt_id).cexp)).differentiableWithinAt · simp only [one_add_eta_logDeriv_eq] apply ((summable_nat_add_iff 1).mpr ((logDeriv_q_expo_summable (𝕢₁ z) (by simpa [Periodic.qParam] using exp_upperHalfPlane_lt_one z)).mul_left @@ -380,4 +395,6 @@ lemma eta_equality' : {z : ℂ | 0 < z.im}.EqOn ((η ∘ (fun z : ℂ => -1/z))) have hcd := (mul_eq_right₀ he).mp (_root_.id (Eq.symm h3)) rw [mul_eq_one_iff_inv_eq₀ hz] at hcd rw [@inv_eq_iff_eq_inv] at hcd - simp_all + simp_all only [ne_eq, inv_eq_zero, mem_ofPred_eq, comp_apply, Pi.smul_apply, Pi.mul_apply, + smul_eq_mul, + Complex.I_im, zero_lt_one, not_false_eq_true, inv_mul_cancel₀, one_mul] diff --git a/LeanPool/LeanModularForms/Modularforms/Generators/Defs.lean b/LeanPool/LeanModularForms/Modularforms/Generators/Defs.lean index 0528155bee..61529d9130 100644 --- a/LeanPool/LeanModularForms/Modularforms/Generators/Defs.lean +++ b/LeanPool/LeanModularForms/Modularforms/Generators/Defs.lean @@ -61,7 +61,13 @@ theorem levelOne_odd_weight_eq_zero {k : ℤ} (hk : Odd k) have hdenom : denom (Matrix.SpecialLinearGroup.toGL ((Matrix.SpecialLinearGroup.map (Int.castRingHom ℝ)) (-1 : SL(2, ℤ)))) ↑z = -1 := by rw [ModularGroup.denom_apply] - simp_all + simp_all only [SlashInvariantForm.toFun_eq_coe, toSlashInvariantForm_coe, + Matrix.SpecialLinearGroup.coe_int_neg, map_one, zpow_neg, Fin.isValue, + Matrix.SpecialLinearGroup.coe_neg, + Matrix.SpecialLinearGroup.coe_one, Matrix.neg_apply, ne_eq, one_ne_zero, + not_false_eq_true, Matrix.one_apply_ne, + neg_zero, Int.cast_zero, zero_mul, Matrix.one_apply_eq, Int.reduceNeg, Int.cast_neg, + Int.cast_one, zero_add] rw [hdenom, zpow_neg, hk.neg_one_zpow, inv_neg, inv_one] at hmod simp only [SlashInvariantForm.toFun_eq_coe, ModularForm.toSlashInvariantForm_coe] at hmod simp only [_root_.zero_apply] diff --git a/LeanPool/LeanModularForms/Modularforms/Generators/Injectivity.lean b/LeanPool/LeanModularForms/Modularforms/Generators/Injectivity.lean index ddfb2498bc..a8458f3b84 100644 --- a/LeanPool/LeanModularForms/Modularforms/Generators/Injectivity.lean +++ b/LeanPool/LeanModularForms/Modularforms/Generators/Injectivity.lean @@ -283,8 +283,19 @@ private lemma mvpoly_support_after_reduction {σ R : Type*} [CommRing R] [Decida · exact absurd (hxd ▸ hx) hd_not · exact Finset.mem_union_left _ (Finset.mem_erase.mpr ⟨hxd, hp⟩) · rcases Finset.mem_union.mp (MvPolynomial.support_sub σ _ _ hdelta) with h1 | h2 - · simp_all - · simp_all + · simp_all only [ne_eq, AddMonoidAlgebra.coeff_sub, Finsupp.coe_sub, Pi.sub_apply, + MvPolynomial.coeff_monomial, + ↓reduceIte, sub_sub_cancel, ite_eq_right_iff, MvPolynomial.mem_support_iff, ite_self, + sub_zero, sub_self, + not_true_eq_false, not_false_eq_true, not_imp, Finset.union_singleton, + Finset.mem_insert, Finset.mem_erase, + false_and, or_false, imp_false] + · simp_all only [ne_eq, AddMonoidAlgebra.coeff_sub, Finsupp.coe_sub, Pi.sub_apply, + MvPolynomial.coeff_monomial, + ↓reduceIte, sub_sub_cancel, ite_eq_right_iff, MvPolynomial.mem_support_iff, ite_self, + sub_zero, sub_self, + not_true_eq_false, not_false_eq_true, not_imp, Finset.union_singleton, + Finset.mem_insert, Finset.mem_erase, true_or] private lemma whomog_poly_Delta_decomp {n : ℕ} (hn12 : 12 ≤ n) (p : MvPolynomial (Fin 2) ℂ) @@ -368,7 +379,7 @@ private lemma reduced_poly_is_scalar {n : ℕ} (_hn12 : 12 ≤ n) have hw2 := hr (MvPolynomial.mem_support_iff.mp hd₂) have h46_1 := weight_eq_4a_6b d₁; rw [hw1] at h46_1 have h46_2 := weight_eq_4a_6b d₂; rw [hw2] at h46_2 - have heq : d₁ 0 * 4 + d₁ 1 * 6 = d₂ 0 * 4 + d₂ 1 * 6 := by linarith + have heq : d₁ 0 * 4 + d₁ 1 * 6 = d₂ 0 * 4 + d₂ 1 * 6 := by linarith only [h46_1, h46_2] obtain ⟨hd0, hd1⟩ := unique_small_weight_soln (hr_red d₁ hd₁) (hr_red d₂ hd₂) heq ext i; fin_cases i <;> assumption diff --git a/LeanPool/LeanModularForms/Modularforms/Generators/Surjectivity.lean b/LeanPool/LeanModularForms/Modularforms/Generators/Surjectivity.lean index 47b7b9e1ad..1264c14770 100644 --- a/LeanPool/LeanModularForms/Modularforms/Generators/Surjectivity.lean +++ b/LeanPool/LeanModularForms/Modularforms/Generators/Surjectivity.lean @@ -47,11 +47,13 @@ private lemma mul_modform_ne_zero_of_coeff_one {k₁ k₂ : ℤ} intro h have hcoeff : (qExpansion 1 (f.mul g)).coeff 0 = 1 := by have := qExpansion_mul_coeff 1 k₁ k₂ f g - simp_all + simp_all only [PowerSeries.coeff_zero_eq_constantCoeff, Nat.cast_one, FunLike.coe_zero, + map_mul, mul_one] have hcoe : (⇑(f.mul g) : ℍ → ℂ) = 0 := by rw [h]; ext z; simp only [zero_apply, Pi.zero_apply] rw [show qExpansion 1 (f.mul g) = qExpansion 1 (0 : ℍ → ℂ) from congr_arg (qExpansion 1) hcoe, qExpansion_zero] at hcoeff - simp_all + simp_all only [PowerSeries.coeff_zero_eq_constantCoeff, PowerSeries.constantCoeff_zero, + zero_ne_one] private lemma mul_Delta_map_eq_DirectSum_mul (n : ℕ) (_hn : 12 ≤ n) (h : ModularForm Γ(1) (↑n - 12)) : diff --git a/LeanPool/LeanModularForms/Modularforms/IsCuspForm.lean b/LeanPool/LeanModularForms/Modularforms/IsCuspForm.lean index 3bfdd6513a..796c3223ac 100644 --- a/LeanPool/LeanModularForms/Modularforms/IsCuspForm.lean +++ b/LeanPool/LeanModularForms/Modularforms/IsCuspForm.lean @@ -147,7 +147,7 @@ private lemma isZeroAtImInfty_of_coeffZero {k : ℤ} obtain ⟨m, hm⟩ := Function.Periodic.qParam_left_inv_mod_period (h := 1) (Ne.symm (zero_ne_one' ℝ)) y have := (periodic_comp_ofComplex (h := 1) f (by simp)).int_mul m y - simp_all + simp_all only [comp_apply, top_eq_univ, mem_univ, ofReal_one, mul_one, ofComplex_apply] /-- Build a `CuspForm` from a modular form whose q-expansion has vanishing constant term. -/ noncomputable def cuspFormOfCoeffZero {k : ℤ} diff --git a/LeanPool/LeanModularForms/Modularforms/Iteratedderivs.lean b/LeanPool/LeanModularForms/Modularforms/Iteratedderivs.lean index 3dfe52b2fa..ab20a5a5c0 100644 --- a/LeanPool/LeanModularForms/Modularforms/Iteratedderivs.lean +++ b/LeanPool/LeanModularForms/Modularforms/Iteratedderivs.lean @@ -37,7 +37,9 @@ theorem aut_iter_deriv (d : ℤ) (k : ℕ) : intro x hx induction k generalizing x with | zero => - simp_all + simp_all only [mem_ofPred_eq, one_div, iteratedDerivWithin_zero, pow_zero, + Nat.factorial_zero, Nat.cast_one, + mul_one, zero_add, pow_one, one_mul] | succ k IH => rw [iteratedDerivWithin_succ] simp only [one_div, Nat.cast_succ, Nat.factorial, Nat.cast_mul] @@ -79,8 +81,8 @@ theorem aut_iter_deriv (d : ℤ) (k : ℕ) : apply pow_ne_zero (k + 1) (upper_ne_int ⟨x, hx⟩ d) · apply IsOpen.uniqueDiffWithinAt _ hx refine isOpen_lt ?_ ?_ - · fun_prop - · fun_prop + · exact continuous_const + · exact continuous_im rw [←H] apply derivWithin_congr · norm_cast at * @@ -89,7 +91,7 @@ theorem aut_iter_deriv (d : ℤ) (k : ℕ) : Nat.cast_one, Int.cast_add] at * intro r hr apply IH hr - simp_all + simp_all only [mem_ofPred_eq, one_div] theorem aut_iter_deriv' (d : ℤ) (k : ℕ) : EqOn (iteratedDerivWithin k (fun z : ℂ => 1 / (z - d)) {z : ℂ | 0 < z.im}) @@ -119,7 +121,7 @@ theorem iter_div_aut_add (d : ℤ) (k : ℕ) : rw [iteratedDerivWithin_add hx ?_] · have h2 := aut_iter_deriv d k hx have h3 := aut_iter_deriv' d k hx - simp_all + simp_all only [mem_ofPred_eq, one_div] · have h4 := aut_contDiffOn d k simp only [one_div] at h4 apply h4 @@ -128,7 +130,9 @@ theorem iter_div_aut_add (d : ℤ) (k : ℕ) : simp only [Int.cast_neg, sub_neg_eq_add, one_div] at h5 apply h5 exact hx - · exact IsOpen.uniqueDiffOn (isOpen_lt (by fun_prop) (by fun_prop)) + · exact IsOpen.uniqueDiffOn (isOpen_lt (by + exact continuous_const) (by + exact continuous_im)) variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] (n : ℕ) (f : 𝕜 → F) (s : Set 𝕜) (x : 𝕜) @@ -141,5 +145,7 @@ theorem exp_iter_deriv_within (n m : ℕ) : {z : ℂ | 0 < z.im}) (fun t => (2 * ↑π * Complex.I * m) ^ n * Complex.exp (2 * ↑π * Complex.I * m * t)) {z : ℂ | 0 < z.im} := by - apply EqOn.trans (iteratedDerivWithin_of_isOpen (isOpen_lt (by fun_prop) (by fun_prop))) + apply EqOn.trans (iteratedDerivWithin_of_isOpen (isOpen_lt (by + exact continuous_const) (by + exact continuous_im))) exact fun x _ => congr_fun (iteratedDeriv_cexp_const_mul ..) x diff --git a/LeanPool/LeanModularForms/Modularforms/JacobiTheta.lean b/LeanPool/LeanModularForms/Modularforms/JacobiTheta.lean index 2c2131bbb9..9d111cd75a 100644 --- a/LeanPool/LeanModularForms/Modularforms/JacobiTheta.lean +++ b/LeanPool/LeanModularForms/Modularforms/JacobiTheta.lean @@ -13,8 +13,6 @@ import LeanPool.LeanModularForms.ForMathlib.FunctionsBoundedAtInfty import LeanPool.LeanModularForms.ForMathlib.SlashActions import LeanPool.LeanModularForms.ForMathlib.UpperHalfPlane import LeanPool.LeanModularForms.Modularforms.DimensionFormulas -import LeanPool.LeanModularForms.Modularforms.ForMathlibCusps -import LeanPool.LeanModularForms.Modularforms.ForMathlibFunctionsBoundedAtInfty import Mathlib.Algebra.Order.Star.Real import Mathlib.Analysis.Normed.Group.Tannery import Mathlib.Data.Int.Star @@ -22,7 +20,6 @@ import Mathlib.Order.CompletePartialOrder /-! # JacobiTheta -/ - @[expose] public section /-! @@ -795,16 +792,19 @@ theorem jacobiTheta₂_half_apply_tendsto_atImInfty : · exact summable_ofReal.mp summable_ofReal_exp_neg_pi_sq · intro k split_ifs with hk - · simp_all + · simp_all only [one_div, neg_mul, Int.cast_zero, mul_zero, zero_mul, ne_eq, + OfNat.ofNat_ne_zero, + not_false_eq_true, zero_pow, add_zero, Complex.exp_zero, tendsto_const_nhds_iff] · rw [tendsto_zero_iff_norm_tendsto_zero] simp_rw [hnorm] have hk2_pos : 0 < (k : ℝ) ^ 2 := sq_pos_of_ne_zero (Int.cast_ne_zero.mpr hk) exact (Real.tendsto_exp_atBot).comp - (tendsto_im_atImInfty.const_mul_atTop_of_neg (by nlinarith [Real.pi_pos, hk2_pos])) + (tendsto_im_atImInfty.const_mul_atTop_of_neg (by nlinarith only [hk2_pos, Real.pi_pos])) · rw [eventually_atImInfty] use 1, fun z hz k ↦ ?_ rw [hnorm] - have hcoef_nonpos : (-π * (k : ℝ) ^ 2) ≤ 0 := by nlinarith [Real.pi_pos, sq_nonneg (k : ℝ)] + have hcoef_nonpos : (-π * (k : ℝ) ^ 2) ≤ 0 := by + nlinarith only [Real.pi_pos, sq_nonneg (k : ℝ)] have hmul : (-π * (k : ℝ) ^ 2) * z.im ≤ (-π * (k : ℝ) ^ 2) * 1 := by exact mul_le_mul_of_nonpos_left hz hcoef_nonpos simpa using Real.exp_le_exp.mpr hmul @@ -1057,7 +1057,7 @@ lemma Θ₄_term_imag_axis_real (n : ℤ) (t : ℝ) (ht : 0 < t) : (-(Real.pi * (n : ℝ) ^ 2 * t) : ℝ) := by push_cast ring_nf - simp_all + simp_all only [I_sq, mul_neg, mul_one, neg_mul] rw [hexpr] simp only [Complex.mul_im, neg_one_zpow_im_eq_zero n, exp_ofReal_im, mul_zero, zero_mul, add_zero] @@ -1140,7 +1140,7 @@ theorem H₂_imag_axis_pos : ResToImagAxis.Pos H₂ := by have hz_eq : z = (z.re : ℂ) := Complex.ext (by simp) (by simp [hΘ₂_im]) rw [hz_eq] norm_cast - simp_all + simp_all only [pow_succ_pos] /-- `H₄(it)` is real for all `t > 0`. @@ -1181,14 +1181,21 @@ theorem H₄_imag_axis_pos : ResToImagAxis.Pos H₄ := by simp only [Function.resToImagAxis_apply, ResToImagAxis, h1t_pos, ↓reduceDIte, Pi.neg_apply] rw [hNeg, hI_neg2, h1t_neg2, h1_div_1t] at hSlash have hEq : H₂.resToImagAxis (1 / t) = (t : ℂ) ^ 2 * H₄.resToImagAxis t := by - simp_all + simp_all only [one_div, inv_pos, Function.resToImagAxis_apply, neg_mul, one_mul, neg_inj, + Int.reduceNeg, + _root_.zpow_neg, zpow_ofNat, I_sq, inv_neg, inv_one, ofReal_inv, inv_pow, inv_inv, + div_inv_eq_mul] have hH₂_pos := H₂_imag_axis_pos.2 (1 / t) h1t_pos have hH₄_real := H₄_imag_axis_real t ht have hProd_re : ((t : ℂ) ^ 2 * H₄.resToImagAxis t).re = (t : ℝ) ^ 2 * (H₄.resToImagAxis t).re := by simp only [Function.resToImagAxis_apply, ResToImagAxis, ht, ↓reduceDIte] at hH₄_real ⊢ simp only [sq, Complex.mul_re, ofReal_re, ofReal_im, zero_mul, sub_zero] - simp_all + simp_all only [one_div, inv_pos, Function.resToImagAxis_apply, neg_mul, one_mul, neg_inj, + Int.reduceNeg, + _root_.zpow_neg, zpow_ofNat, I_sq, inv_neg, inv_one, ofReal_inv, inv_pow, inv_inv, + div_inv_eq_mul, mul_re, sub_pos, + mul_im, ofReal_re, ofReal_im, mul_zero, zero_mul, add_zero, sub_zero] rw [hEq, hProd_re, mul_comm] at hH₂_pos exact pos_of_mul_pos_left hH₂_pos (le_of_lt (sq_pos_of_pos ht)) diff --git a/LeanPool/LeanModularForms/Modularforms/LogDerivLems.lean b/LeanPool/LeanModularForms/Modularforms/LogDerivLems.lean index b5256f79b9..62dfe01f5e 100644 --- a/LeanPool/LeanModularForms/Modularforms/LogDerivLems.lean +++ b/LeanPool/LeanModularForms/Modularforms/LogDerivLems.lean @@ -85,7 +85,9 @@ lemma logDeriv_one_sub_exp (r : ℂ) : logDeriv (fun z => 1 - r * cexp (z)) = fun z => -r * cexp z / (1 - r * cexp ( z)) := by ext z rw [logDeriv] - simp_all + simp_all only [deriv_const_sub', differentiableAt_const, differentiableAt_exp, deriv_fun_mul, + deriv_const', + zero_mul, Complex.deriv_exp, zero_add, Pi.div_apply, neg_mul] lemma logDeriv_one_sub_exp_comp (r : ℂ) (g : ℂ → ℂ) (hg : Differentiable ℂ g) : logDeriv ((fun z => 1 - r * cexp (z)) ∘ g) = @@ -94,7 +96,8 @@ lemma logDeriv_one_sub_exp_comp (r : ℂ) (g : ℂ → ℂ) (hg : Differentiable rw [logDeriv_comp, logDeriv_one_sub_exp] · simp only [neg_mul] ring - · simp_all + · simp_all only [differentiableAt_const, differentiableAt_exp, DifferentiableAt.fun_mul, + DifferentiableAt.fun_sub] · exact hg y lemma logDeriv_q_expo_summable (r : ℂ) (hr : ‖r‖ < 1) : Summable fun n : ℕ => diff --git a/LeanPool/LeanModularForms/Modularforms/RamanujanIdentities.lean b/LeanPool/LeanModularForms/Modularforms/RamanujanIdentities.lean index 723f114c53..28cffd424f 100644 --- a/LeanPool/LeanModularForms/Modularforms/RamanujanIdentities.lean +++ b/LeanPool/LeanModularForms/Modularforms/RamanujanIdentities.lean @@ -85,7 +85,10 @@ theorem ramanujan_E₂' : serreD 1 E₂ = - 12⁻¹ * E₄.toFun := by have hc_val : c = -(1/12 : ℂ) := scalar_eq_of_tendsto hfun serre_DE₂_tendsto_atImInfty E₄_tendsto_one_atImInfty ext z - simp_all + simp_all only [one_div, _root_.neg_smul, serre_D_apply, one_mul, SlashInvariantForm.toFun_eq_coe, + toSlashInvariantForm_coe, neg_mul, pi_ofNat_eq_const, pi_inv_const_eq_const, Pi.mul_apply, + Pi.neg_apply, + Function.const_apply] /-- Serre derivative of E₄: `serreD 4 E₄ = - 3⁻¹ * E₆`. @@ -102,7 +105,10 @@ theorem ramanujan_E₄' : serreD 4 E₄.toFun = - 3⁻¹ * E₆.toFun := by have hc_val : c = -(1/3 : ℂ) := scalar_eq_of_tendsto hfun serre_DE₄_tendsto_atImInfty E₆_tendsto_one_atImInfty ext z - simp_all + simp_all only [one_div, _root_.neg_smul, SlashInvariantForm.toFun_eq_coe, + toSlashInvariantForm_coe, + serre_D_apply, neg_mul, pi_ofNat_eq_const, pi_inv_const_eq_const, Pi.mul_apply, + Pi.neg_apply, Function.const_apply] /-- Serre derivative of E₆: `serreD 6 E₆ = - 2⁻¹ * E₄²`. diff --git a/LeanPool/LeanModularForms/Modularforms/ResToImagAxis.lean b/LeanPool/LeanModularForms/Modularforms/ResToImagAxis.lean index b67593a7c5..00af428046 100644 --- a/LeanPool/LeanModularForms/Modularforms/ResToImagAxis.lean +++ b/LeanPool/LeanModularForms/Modularforms/ResToImagAxis.lean @@ -197,7 +197,7 @@ theorem ResToImagAxis.Pos.pow {F : ℍ → ℂ} (hF : ResToImagAxis.Pos F) (n : @[fun_prop] theorem ResToImagAxis.EventuallyPos.from_pos {F : ℍ → ℂ} (hF : ResToImagAxis.Pos F) : ResToImagAxis.EventuallyPos F := - ⟨hF.1, 1, one_pos, fun t ht ↦ hF.2 t (by linarith)⟩ + ⟨hF.1, 1, one_pos, fun t ht ↦ hF.2 t (by linarith only [ht])⟩ @[fun_prop] theorem ResToImagAxis.EventuallyPos.one : @@ -370,7 +370,7 @@ lemma isBigO_atImInfty_of_fourier_shift rexp (-(2 * π) * (↑m + ↑n₀) * z.im) ≤ rexp (-(2 * π * c) * m) * rexp (-(2 * π * c) * n₀) := by rw [← Real.exp_add, Real.exp_le_exp] - have _ : (↑m + ↑n₀) * z.im ≥ (↑m + ↑n₀) * c := by nlinarith + have _ : (↑m + ↑n₀) * z.im ≥ (↑m + ↑n₀) * c := by nlinarith only [hz] nlinarith [Real.pi_pos, (Nat.cast_nonneg m : (0 : ℝ) ≤ m), (Nat.cast_nonneg n₀ : (0 : ℝ) ≤ n₀), z.im_pos] -- Summability of norms @@ -398,8 +398,8 @@ lemma isBigO_atImInfty_of_fourier_shift rw [← Real.exp_add]; ring_nf have hexp_m : rexp (-(2 * π) * m * z.im) ≤ rexp (-(2 * π * c) * m) := by rw [Real.exp_le_exp] - have key : (m : ℝ) * z.im ≥ m * c := by nlinarith - nlinarith [Real.pi_pos, (Nat.cast_nonneg m : (0 : ℝ) ≤ m), z.im_pos] + have key : (m : ℝ) * z.im ≥ m * c := by nlinarith only [hz] + nlinarith only [key, Real.pi_pos, (Nat.cast_nonneg m : (0 : ℝ) ≤ m), z.im_pos] calc ‖a m‖ * rexp (-(2 * π) * (↑m + ↑n₀) * z.im) = ‖a m‖ * rexp (-(2 * π) * m * z.im) * rexp (-(2 * π) * n₀ * z.im) := by rw [hsplit]; ring @@ -444,4 +444,5 @@ lemma tendsto_resToImagAxis_of_tendsto_atImInfty {F : ℍ → ℂ} {c : ℂ} refine ⟨max A 1, fun t ht ↦ ?_⟩ have ht_pos : 0 < t := lt_of_lt_of_le one_pos (le_of_max_le_right ht) simp only [Function.resToImagAxis, ResToImagAxis, ht_pos, ↓reduceDIte] - simp_all + simp_all only [gt_iff_lt, ge_iff_le, sup_le_iff, mk_im, mul_im, Complex.I_re, ofReal_im, mul_zero, + Complex.I_im, ofReal_re, one_mul, zero_add] diff --git a/LeanPool/LeanModularForms/Modularforms/SlashActionAuxil.lean b/LeanPool/LeanModularForms/Modularforms/SlashActionAuxil.lean index 24f6e0c259..72015a081e 100644 --- a/LeanPool/LeanModularForms/Modularforms/SlashActionAuxil.lean +++ b/LeanPool/LeanModularForms/Modularforms/SlashActionAuxil.lean @@ -330,7 +330,8 @@ theorem slashaction_generators_SL2Z (∀ γ : SL(2, ℤ), f ∣[k] γ = f) := by intro γ refine (slashaction_generators f ⊤ _ SL2Z_generate k).mpr ?_ ⟨γ, by simp⟩ - simp_all + simp_all only [Set.mem_insert_iff, Set.mem_singleton_iff, forall_eq_or_imp, implies_true, + and_self] theorem slashaction_generators_GL2R (f : ℍ → ℂ) (k : ℤ) (hS : f ∣[k] S = f) (hT : f ∣[k] T = f) : diff --git a/LeanPool/LeanModularForms/Modularforms/SummableLems.lean b/LeanPool/LeanModularForms/Modularforms/SummableLems.lean index e16f59fa86..6da67339c2 100644 --- a/LeanPool/LeanModularForms/Modularforms/SummableLems.lean +++ b/LeanPool/LeanModularForms/Modularforms/SummableLems.lean @@ -23,7 +23,6 @@ import Mathlib.Topology.Separation.CompletelyRegular /-! # SummableLems -/ - @[expose] public section @@ -41,7 +40,7 @@ private lemma neg_eq_comp_negEquiv {α : Type*} (f : ℤ → α) : theorem int_sum_neg {α : Type*} [AddCommMonoid α] [TopologicalSpace α] (f : ℤ → α) : ∑' d : ℤ, f d = ∑' d, f (-d) := by - simp_all + simp_all only [tsum_comp_neg] theorem summable_neg {α : Type*} [TopologicalSpace α] [AddCommMonoid α] (f : ℤ → α) (hf : Summable f) : Summable fun d => f (-d) := by @@ -174,7 +173,7 @@ lemma upper_half_plane_ne_int_pow_two (z : ℍ) (n : ℤ) : (z : ℂ) ^ 2 - n ^ | inl h => have := upp_half_not_ints z (-n) rw [add_eq_zero_iff_eq_neg] at h - simp_all + simp_all only [Int.cast_neg, ne_eq, not_true_eq_false] theorem upbnd (z : ℍ) (d : ℤ) : (d ^ 2 : ℝ) * r z ^ 2 ≤ ‖((z : ℂ) ^ 2 - d ^ 2)‖ := by by_cases hd : d ≠ 0 @@ -213,7 +212,7 @@ theorem lhs_summable (z : ℍ) : Summable fun n : ℕ+ => 1 / ((z : ℂ) - n) + have hrr : Summable fun (i : ℕ) ↦ ((i : ℝ) ^ 2)⁻¹ := by simp apply hrr.subtype apply Summable.of_nonneg_of_le _ _ hs - · simp_all + · simp_all only [one_div, mul_inv_rev, inv_nonneg, norm_nonneg, implies_true] intro b rw [inv_le_inv₀] · rw [mul_comm] @@ -224,7 +223,7 @@ theorem lhs_summable (z : ℍ) : Summable fun n : ℕ+ => 1 / ((z : ℂ) - n) + · norm_cast apply pow_pos apply r_pos - simp_all + simp_all only [one_div, mul_inv_rev, Nat.cast_pos, PNat.pos, pow_succ_pos] theorem sum_int_even {α : Type*} [UniformSpace α] [CommRing α] [IsUniformAddGroup α] @@ -365,21 +364,21 @@ private lemma aux (a b c : ℝ) (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) : a⁻¹ refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ · simp_rw [inv_eq_one_div] at h rw [mul_one_div, le_div_comm₀ _ hb] at h - · simp_all - simp_all + · simp_all only [one_div, div_inv_eq_mul] + simp_all only [one_div, inv_pos] · simp_rw [inv_eq_one_div] rw [← div_le_comm₀ _ ha] · simp only [one_div, mul_inv_rev, inv_inv] rw [propext (mul_inv_le_iff₀ hc), mul_comm] exact h - simp_all + simp_all only [one_div, mul_pos_iff_of_pos_left, inv_pos] lemma summable_hammerTime_nat {α : Type} [NormedField α] [CompleteSpace α] (f : ℕ → α) (a : ℝ) (hab : 1 < a) (hf : (fun n => (f n)⁻¹) =O[cofinite] fun n => (|(n : ℝ)| ^ (a : ℝ))⁻¹) : Summable fun n => (f n)⁻¹ := by apply summable_of_isBigO _ hf - simp_all + simp_all only [Nat.abs_cast, Real.summable_nat_rpow_inv] theorem summable_diff_denom (z : ℍ) (i : ℤ) : Summable fun (m : ℤ) ↦ ((m : ℂ) * ↑z + ↑i + 1)⁻¹ * ((m : ℂ) * ↑z + ↑i)⁻¹ := by @@ -616,7 +615,7 @@ lemma G2_alt_indexing2_δ (z : ℍ) : ∑' (m : Fin 2 → ℤ), rw [Summable.tsum_comm'] · rw [G2_alt_indexing_δ] · apply this.congr - simp_all + simp_all only [one_div, mul_inv_rev, Prod.forall, uncurry_apply_pair, implies_true] · intro b simp only [one_div, mul_inv_rev] apply this.prod_factor @@ -628,7 +627,9 @@ lemma G2_alt_indexing2_δ (z : ℍ) : ∑' (m : Fin 2 → ℤ), simp [Fin.isValue, one_div, mul_inv_rev, swapEquiv, Equiv.coe_fn_mk, finTwoArrowEquiv_symm_apply] at H have := H.prod_factor c - simp_all + simp_all only [Fin.isValue, comp_apply, swap_apply, Nat.succ_eq_add_one, Nat.reduceAdd, + Matrix.cons_val_one, + Matrix.cons_val_fin_one, Matrix.cons_val_zero] @@ -750,7 +751,11 @@ lemma hsum (k : ℕ) (z : ℍ) : Summable fun b : ℕ+ => ∑ _ ∈ (b : ℕ).di simp only [Finset.sum_const, nsmul_eq_mul] have hs := summable_norm_iff.mpr (a33 (k+1) 1 z) apply Summable.of_nonneg_of_le _ _ hs - · simp_all + · simp_all only [PNat.val_ofNat, Nat.cast_one, mul_one, Complex.norm_mul, norm_pow, + RCLike.norm_natCast, + Nat.cast_pos, Finset.card_pos, Nat.nonempty_divisors, ne_eq, PNat.ne_zero, + not_false_eq_true, + mul_nonneg_iff_of_pos_left, PNat.pos, pow_pos, norm_nonneg, implies_true] intro b simp only [PNat.val_ofNat, Nat.cast_one, mul_one, Complex.norm_mul, norm_pow, norm_natCast] rw [← mul_assoc] @@ -834,7 +839,9 @@ theorem exp_series_ite_deriv_uexp2 (k : ℕ) (x : {z : ℂ | 0 < z.im}) : · apply tsum_congr intro b rw [iteratedDerivWithin_succ] - · exact isOpen_lt (by fun_prop) (by fun_prop) + · exact isOpen_lt (by + exact continuous_const) (by + exact Complex.continuous_im) · exact x.2 · intro y hy apply Summable.congr (summable_iter_derv' k ⟨y, hy⟩) @@ -887,9 +894,11 @@ theorem tsum_uexp_contDiffOn (k : ℕ) : apply le_of_eq norm_cast simp only [ofReal_mul, ofReal_ofNat] - rw [derivWithin_fun_mul (by fun_prop) (by fun_prop), - derivWithin_cexp (by fun_prop) (upper_half_plane_isOpen.uniqueDiffOn _ <| by aesop), - derivWithin_const_mul _ (by fun_prop)] + have hd : DifferentiableWithinAt ℂ (fun y : ℂ => 2 * ↑π * Complex.I * n * y) ℍ' ↑r := + (differentiableWithinAt_const _).mul differentiableWithinAt_id + rw [derivWithin_fun_mul (differentiableWithinAt_const _) hd.cexp, + derivWithin_cexp hd (upper_half_plane_isOpen.uniqueDiffOn _ <| by aesop), + derivWithin_const_mul _ differentiableWithinAt_id] simp only [derivWithin_fun_const, Pi.zero_apply, zero_mul, zero_add, Complex.norm_mul, norm_pow, norm_ofNat, norm_real, Real.norm_eq_abs, norm_I, mul_one, RCLike.norm_natCast] have hr : derivWithin (fun y ↦ y) ℍ' ↑r = 1 := by @@ -1038,7 +1047,7 @@ theorem aut_bound_on_comp (K : Set ℍ) (hk2 : IsCompact K) (k : ℕ) : · apply Summable.mul_left simp only [norm_inv, norm_zpow, RCLike.norm_natCast] have : Summable fun (i : ℕ) ↦ ((i : ℝ) ^ ((k : ℤ) + 2))⁻¹ := by - have := (Real.summable_nat_rpow_inv (p := k + 2)).mpr (by linarith) + have := (Real.summable_nat_rpow_inv (p := k + 2)).mpr (by linarith only []) apply this.congr intro n norm_cast @@ -1057,7 +1066,8 @@ theorem aut_bound_on_comp (K : Set ℍ) (hk2 : IsCompact K) (k : ℕ) : refine ⟨fun _ => 0, summable_zero, ?_⟩ intro n rw [not_nonempty_iff_eq_empty] at h1 - simp_all + simp_all only [finite_empty, Finite.isCompact, norm_le_zero_iff, isEmpty_coe_sort, + IsEmpty.forall_iff] theorem diff_on_aux (k : ℕ) (n : ℕ+) : DifferentiableOn ℂ @@ -1079,8 +1089,10 @@ theorem diff_at_aux (s : {z : ℂ | 0 < z.im}) (k : ℕ) (n : ℕ+) : · apply DifferentiableOn.congr (diff_on_aux k n) intro r hr have ht := this hr - simp_all - exact (isOpen_lt (by fun_prop) (by fun_prop)).mem_nhds (by simp) + simp_all only [Int.cast_natCast, one_div, mem_ofPred_eq, Pi.add_apply] + exact (isOpen_lt (by + exact continuous_const) (by + exact Complex.continuous_im)).mem_nhds (by simp) theorem aut_series_ite_deriv_uexp2 (k : ℕ) (x : ℍ) : iteratedDerivWithin k (fun z : ℂ => ∑' n : ℕ+, (1 / (z - n) + 1 / (z + n))) {z : ℂ | 0 < z.im} x @@ -1110,8 +1122,8 @@ theorem aut_series_ite_deriv_uexp2 (k : ℕ) (x : ℍ) : intro b rw [iteratedDerivWithin_succ] · refine isOpen_lt ?_ ?_ - · fun_prop - · fun_prop + · exact continuous_const + · exact Complex.continuous_im · simpa using x.2 · intro y hy simpa using summable_iter_aut k ⟨y, hy⟩ @@ -1277,8 +1289,8 @@ theorem aux_iter_der_tsum_eqOn (k : ℕ) (hk : 2 ≤ k) : have := aux_iter_der_tsum (k - 1) hk0 ⟨z, hz⟩ have hk1 : k - 1 + 1 = k := by apply Nat.sub_add_cancel - linarith - simp_all + linarith only [hk] + simp_all only [one_div] theorem pos_sum_eq (k : ℕ) (hk : 0 < k) : @@ -1304,7 +1316,7 @@ theorem cot_series_repr (z : ℍ) : have := cot_series_rep' (UpperHalfPlane.coe_mem_integerComplement z) simp only [one_div] at * have hrw := tsum_pnat_eq_tsum_succ3 fun n : ℕ => (1 / ((z : ℂ) - n) + 1 / (z + n)) - simp_all + simp_all only [one_div, Nat.cast_add, Nat.cast_one] lemma EisensteinSeries_Identity (z : ℍ) : @@ -1448,7 +1460,7 @@ theorem tsum_sigma_eqn2 (k : ℕ) (z : ℍ) : lemma G2_summable_aux (n : ℤ) (z : ℍ) (k : ℤ) (hk : 2 ≤ k) : Summable fun d : ℤ => ((((n : ℂ) * z) + d) ^ k)⁻¹ := by apply summable_inv_of_isBigO_rpow_inv (show 1 < (k : ℝ) by norm_cast) - lift k to ℕ using (by linarith) + lift k to ℕ using (by linarith only [hk]) have := linear_bigO_pow n z k norm_cast at * diff --git a/LeanPool/LeanModularForms/Modularforms/ThetaDerivIdentities.lean b/LeanPool/LeanModularForms/Modularforms/ThetaDerivIdentities.lean index 84b4803992..03b481d182 100644 --- a/LeanPool/LeanModularForms/Modularforms/ThetaDerivIdentities.lean +++ b/LeanPool/LeanModularForms/Modularforms/ThetaDerivIdentities.lean @@ -10,12 +10,10 @@ public import LeanPool.LeanModularForms.Modularforms.JacobiTheta public import LeanPool.LeanModularForms.Modularforms.Derivative import LeanPool.LeanModularForms.Modularforms.DimensionFormulas import LeanPool.LeanModularForms.Modularforms.EisensteinAsymptotics -import LeanPool.LeanModularForms.Modularforms.ForMathlibCusps import Mathlib.Data.Int.Star /-! # ThetaDerivIdentities -/ - @[expose] public section /-! @@ -686,7 +684,9 @@ lemma f₂_eq_zero : f₂ = 0 := by funext z have hz := congrFun hh z unfold thetaH at hz - simp_all + simp_all only [mul_zero, add_zero, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, zero_pow, + Pi.add_apply, + Pi.pow_apply, Pi.zero_apply, pow_eq_zero_iff] -- From f₄_sq_mul_eq and thetaH = 0: f₄² * (3 * HSumSq) = 0 have h_f₄_sq_3H : f₄ ^ 2 * (fun z => 3 * HSumSq z) = 0 := by ext z @@ -702,7 +702,7 @@ lemma f₂_eq_zero : f₂ = 0 := by ((UpperHalfPlane.mul_eq_zero_iff f₄_sq_MDiff three_H_sum_sq_MDifferentiable).mp h_f₄_sq_3H ).resolve_right three_H_sum_sq_ne_zero -- From f₄² = f₄ * f₄ = 0: f₄ = 0 - simp_all + simp_all only [zero_mul, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, pow_eq_zero_iff] /-- From f₂ = 0 and h = 0, deduce f₄ = 0 -/ lemma f₄_eq_zero : f₄ = 0 := by diff --git a/LeanPool/LeanModularForms/Modularforms/TsumderivWithin.lean b/LeanPool/LeanModularForms/Modularforms/TsumderivWithin.lean index 4888913963..a5d76fee65 100644 --- a/LeanPool/LeanModularForms/Modularforms/TsumderivWithin.lean +++ b/LeanPool/LeanModularForms/Modularforms/TsumderivWithin.lean @@ -33,7 +33,9 @@ open scoped Interval Real NNReal ENNReal Topology BigOperators Nat abbrev ℍ' := {z : ℂ | 0 < z.im} lemma upper_half_plane_isOpen : - IsOpen ℍ' := by apply isOpen_lt (by fun_prop) (by fun_prop) + IsOpen ℍ' := by apply isOpen_lt (by + exact continuous_const) (by + exact continuous_im) theorem derivWithin_tsum_fun' {α : Type _} (f : α → ℂ → ℂ) {s : Set ℂ} (hs : IsOpen s) (x : ℂ) (hx : x ∈ s) (hf : ∀ y ∈ s, Summable fun n : α => f n y) @@ -68,7 +70,9 @@ theorem der_iter_eq_der_aux2 (k n : ℕ) (r : ℍ') : iteratedDerivWithin k (fun s : ℂ => Complex.exp (2 * ↑π * Complex.I * n * s)) ℍ' z) ↑r := by apply DifferentiableOn.differentiableAt · exact DifferentiableOn.congr (by fun_prop) (fun x hx => exp_iter_deriv_within k n hx) - exact IsOpen.mem_nhds (isOpen_lt (by fun_prop) (by fun_prop)) r.2 + exact IsOpen.mem_nhds (isOpen_lt (by + exact continuous_const) (by + exact continuous_im)) r.2 theorem der_iter_eq_der2 (k n : ℕ) (r : ℍ') : deriv (iteratedDerivWithin k (fun s : ℂ => Complex.exp (2 * ↑π * Complex.I * n * s)) ℍ') ↑r = @@ -110,7 +114,11 @@ private lemma summable_two_pi_pow_geometric (r : ℝ) (hr : ‖r‖ < 1) (K : apply Summable.congr _ heq rw [summable_mul_left_iff] · exact summable_norm_pow_mul_geometric_of_norm_lt_one K hr - simp_all + simp_all only [Real.norm_eq_abs, norm_mul, norm_pow, RCLike.norm_natCast, + norm_ofNat, + norm_real, Real.abs_pi, norm_I, mul_one, ne_eq, pow_eq_zero_iff', mul_eq_zero, + OfNat.ofNat_ne_zero, Real.pi_ne_zero, + or_self, false_and, not_false_eq_true] theorem iter_deriv_comp_bound2 (K : Set ℂ) (hK1 : K ⊆ ℍ') (hK2 : IsCompact K) (k : ℕ) : ∃ u : ℕ → ℝ, diff --git a/LeanPool/LeanModularForms/SpherePacking/CuspDecay.lean b/LeanPool/LeanModularForms/SpherePacking/CuspDecay.lean index c510bea9c4..de77b46f98 100644 --- a/LeanPool/LeanModularForms/SpherePacking/CuspDecay.lean +++ b/LeanPool/LeanModularForms/SpherePacking/CuspDecay.lean @@ -164,7 +164,7 @@ private lemma tsum_pnat_eq_r_times (r : ℝ) : have h1 : ∑' (n : ℕ+), (↑↑n : ℝ) * r ^ (n : ℕ) = ∑' (m : ℕ), (↑(m + 1) : ℝ) * r ^ (m + 1) := by rw [← Equiv.tsum_eq Equiv.pnatEquivNat] - simp_all + simp_all only [Equiv.pnatEquivNat_apply, PNat.natPred_add_one] rw [h1, ← tsum_mul_left]; congr 1; ext m; ring private lemma norm_term_le_two_mul {q : ℂ} (hq : ‖q‖ ≤ 1 / 2) (n : ℕ+) : @@ -175,8 +175,8 @@ private lemma norm_term_le_two_mul {q : ℂ} (hq : ‖q‖ ≤ 1 / 2) (n : ℕ+) (pow_le_pow_left₀ (norm_nonneg q) hq n).trans ((pow_le_pow_of_le_one (by norm_num) (by norm_num) n.2).trans (by norm_num)) have h1_sub : 1/2 ≤ ‖1 - q ^ (n : ℕ)‖ := by - linarith [norm_sub_norm_le (1 : ℂ) (q ^ (n : ℕ)), norm_one (α := ℂ), - show ‖q ^ (n : ℕ)‖ ≤ 1/2 from norm_pow q n ▸ hqn_le] + linarith only [hqn_le, norm_sub_norm_le (1 : ℂ) (q ^ (n : ℕ)), norm_one (α := ℂ), + show ‖q ^ (n : ℕ)‖ ≤ 1 / 2 from norm_pow q n ▸ hqn_le] calc (n : ℝ) * ‖q‖ ^ (n : ℕ) / ‖1 - q ^ ↑n‖ ≤ (n : ℝ) * ‖q‖ ^ (n : ℕ) / (1/2) := div_le_div_of_nonneg_left (by positivity) (by positivity) h1_sub @@ -203,7 +203,8 @@ private lemma summable_norm_E2_terms {q : ℂ} (hq : ‖q‖ ≤ 1 / 2) : private lemma tsum_succ_mul_pow {r : ℝ} (hr : ‖r‖ < 1) : ∑' m : ℕ, (↑(m + 1) : ℝ) * r ^ m = 1 / (1 - r) ^ 2 := by have := tsum_choose_mul_geometric_of_norm_lt_one 1 hr - simp_all + simp_all only [Real.norm_eq_abs, Nat.choose_one_right, Nat.cast_add, Nat.cast_one, + Nat.reduceAdd, one_div] private lemma tsum_two_mul_pnat_pow {r : ℝ} (hr : ‖r‖ < 1) : ∑' (n : ℕ+), 2 * (↑↑n : ℝ) * r ^ (n : ℕ) = 2 * (r / (1 - r) ^ 2) := by @@ -225,8 +226,8 @@ private lemma tsum_E2_series_bound {q : ℂ} (hq : ‖q‖ ≤ 1 / 2) : (norm_term_le_two_mul hq) (summable_two_mul_pnat_pow hnn)) (by norm_num) _ = 24 * (2 * (‖q‖ / (1 - ‖q‖) ^ 2)) := by rw [tsum_two_mul_pnat_pow hnn] _ ≤ 24 * (2 * (4 * ‖q‖)) := by - gcongr; rw [div_le_iff₀ (pow_pos (by linarith) 2)] - nlinarith [norm_nonneg q, sq_nonneg (1 - 2 * ‖q‖)] + gcongr; rw [div_le_iff₀ (pow_pos (by linarith only [hq_lt]) 2)] + nlinarith only [hq, norm_nonneg q, sq_nonneg (1 - 2 * ‖q‖)] _ = 192 * ‖q‖ := by ring private lemma E2_sub_one_bound (z : UpperHalfPlane) @@ -284,15 +285,16 @@ private lemma E2_sub_one_eventually_le : ‖E₂ z - 1‖ ≤ 192 * ‖Function.Periodic.qParam 1 (z : ℂ)‖ := (tendsto_qParam_atImInfty.eventually (Metric.ball_mem_nhds 0 (by norm_num : (0 : ℝ) < 1/2))).mono fun z hz => - E2_sub_one_bound z (by simp only [dist_zero_right] at hz; linarith) + E2_sub_one_bound z (by simp only [dist_zero_right] at hz; linarith only [hz]) /-- `‖E₄ z‖ ≤ 2` eventually (since `E₄ → 1`). -/ private lemma E4_eventually_bounded : ∀ᶠ z : UpperHalfPlane in UpperHalfPlane.atImInfty, ‖E₄ z‖ ≤ 2 := (E₄_tendsto_one_atImInfty_SP.eventually (Metric.ball_mem_nhds 1 (by norm_num : (0 : ℝ) < 1))).mono fun z hz => - by linarith [show ‖E₄ z - 1‖ < 1 from by rwa [dist_eq_norm] at hz, - norm_le_insert' (E₄ z) 1, norm_one (α := ℂ)] + by + linarith only [hz, show ‖E₄ z - 1‖ < 1 from by rwa [dist_eq_norm] at hz, + norm_le_insert' (E₄ z) 1, norm_one (α := ℂ)] /-- `‖q(z)‖ < 1` eventually (since `q → 0`). -/ private lemma qParam_eventually_lt_one : @@ -313,15 +315,15 @@ private lemma E2E4_sub_E6_bound {z : UpperHalfPlane} {C₁ C₂ : ℝ} (_hC₁ : set qz := Function.Periodic.qParam 1 (z : ℂ) have hE2_norm : ‖E₂ z‖ ≤ 193 := calc ‖E₂ z‖ ≤ ‖(1 : ℂ)‖ + ‖E₂ z - 1‖ := norm_le_insert' _ _ - _ ≤ 1 + 192 * ‖qz‖ := by linarith [norm_one (α := ℂ)] - _ ≤ 1 + 192 * 1 := by nlinarith [norm_nonneg qz] + _ ≤ 1 + 192 * ‖qz‖ := by linarith only [hE2, norm_one (α := ℂ)] + _ ≤ 1 + 192 * 1 := by nlinarith only [hq_lt, norm_nonneg qz] _ = 193 := by norm_num rw [show E₂ z * E₄ z - E₆ z = E₂ z * (E₄ z - 1) + (E₂ z - 1) - (E₆ z - 1) from by ring] calc ‖E₂ z * (E₄ z - 1) + (E₂ z - 1) - (E₆ z - 1)‖ ≤ ‖E₂ z * (E₄ z - 1)‖ + ‖E₂ z - 1‖ + ‖E₆ z - 1‖ := by - linarith [norm_sub_le (E₂ z * (E₄ z - 1) + (E₂ z - 1)) (E₆ z - 1), - norm_add_le (E₂ z * (E₄ z - 1)) (E₂ z - 1)] + linarith only [norm_sub_le (E₂ z * (E₄ z - 1) + (E₂ z - 1)) (E₆ z - 1), + norm_add_le (E₂ z * (E₄ z - 1)) (E₂ z - 1)] _ ≤ ‖E₂ z‖ * (C₁ * ‖qz‖) + 192 * ‖qz‖ + C₂ * ‖qz‖ := by gcongr; rw [norm_mul]; exact mul_le_mul_of_nonneg_left hE4 (norm_nonneg _) _ = (‖E₂ z‖ * C₁ + 192 + C₂) * ‖qz‖ := by ring @@ -364,9 +366,11 @@ private lemma Delta_lower_bound : ∃ r > 0, ∀ z : UpperHalfPlane, have hdist := hδ hqz_ne (by rwa [dist_zero_right]) rw [dist_eq_norm, div_sub_one hqz_ne, norm_div] at hdist have hcF_close : ‖cFDelta qz - qz‖ < 1/2 * ‖qz‖ := by rwa [div_lt_iff₀ hq_pos] at hdist - linarith [show ‖qz‖ ≤ ‖cFDelta qz‖ + ‖cFDelta qz - qz‖ from - calc ‖qz‖ = ‖cFDelta qz - (cFDelta qz - qz)‖ := by ring_nf - _ ≤ ‖cFDelta qz‖ + ‖cFDelta qz - qz‖ := norm_sub_le _ _] + linarith only [hcF_close, + show ‖qz‖ ≤ ‖cFDelta qz‖ + ‖cFDelta qz - qz‖ from + calc + ‖qz‖ = ‖cFDelta qz - (cFDelta qz - qz)‖ := by ring_nf + _ ≤ ‖cFDelta qz‖ + ‖cFDelta qz - qz‖ := norm_sub_le _ _] /-- phi0 is bounded at `Im -> infinity`. -/ theorem phi0_isBoundedAtImInfty : diff --git a/LeanPool/LeanModularForms/SpherePacking/PhiHolomorphic.lean b/LeanPool/LeanModularForms/SpherePacking/PhiHolomorphic.lean index 0ade6a1407..74be1059ab 100644 --- a/LeanPool/LeanModularForms/SpherePacking/PhiHolomorphic.lean +++ b/LeanPool/LeanModularForms/SpherePacking/PhiHolomorphic.lean @@ -53,7 +53,8 @@ theorem E₂_differentiableOn : simp only [comp, ofComplex_apply_of_im_pos hz, Pi.mul_apply] have h := eta_logDeriv' ⟨z, hz⟩ have hpi : (↑Real.pi : ℂ) * Complex.I / 12 ≠ 0 := by - simp_all + simp_all only [ne_eq, div_eq_zero_iff, mul_eq_zero, Complex.ofReal_eq_zero, Real.pi_ne_zero, + Complex.I_ne_zero, or_self, OfNat.ofNat_ne_zero, not_false_eq_true] change logDeriv dedekindEtaFun' z = _ at h rw [h, inv_mul_cancel_left₀ hpi] diff --git a/LeanPool/LeanModularForms/SpherePacking/ViazovskaMagicFunction.lean b/LeanPool/LeanModularForms/SpherePacking/ViazovskaMagicFunction.lean index be89db0ab9..30b311e437 100644 --- a/LeanPool/LeanModularForms/SpherePacking/ViazovskaMagicFunction.lean +++ b/LeanPool/LeanModularForms/SpherePacking/ViazovskaMagicFunction.lean @@ -226,14 +226,16 @@ theorem convex_upperHalfPlaneSet : Convex ℝ {z : ℂ | 0 < z.im} := by have hx' : (0 : ℝ) < x.im := hx have hy' : (0 : ℝ) < y.im := hy rcases eq_or_lt_of_le ha with rfl | ha' - · simp only [zero_add] at hab; subst hab; simp; linarith - · linarith [mul_pos ha' hx', mul_nonneg hb (le_of_lt hy')] + · simp only [zero_add] at hab; subst hab; simp; linarith only [hy'] + · linarith only [hb, hx', hy', ha', mul_pos ha' hx', mul_nonneg hb (le_of_lt hy')] /-! ## Holomorphicity of the integrand -/ /-- When `Im(z) > 0`, the point `-1/(z+1)` also has positive imaginary part. -/ theorem neg_inv_add_one_im_pos {z : ℂ} (hz : 0 < z.im) : 0 < (-1 / (z + 1)).im := by - have hne : z + 1 ≠ 0 := by intro h; have := (Complex.ext_iff.mp h).2; simp at this; linarith + have hne : z + 1 ≠ 0 := by + intro h; have := (Complex.ext_iff.mp h).2; simp at this; linarith only [hz, + this] rw [neg_div, Complex.neg_im, Complex.div_im] rw [Complex.one_im, Complex.one_re, zero_mul, zero_div, one_mul, zero_sub, neg_neg] exact div_pos (by simpa using hz) (Complex.normSq_pos.mpr hne) @@ -245,7 +247,9 @@ theorem viazovska_integrand_left_differentiableOn (r : ℝ) : intro z hz unfold viazovskaIntegrandLeft have hz' : 0 < z.im := hz - have hne : z + 1 ≠ 0 := by intro h; have := (Complex.ext_iff.mp h).2; simp at this; linarith + have hne : z + 1 ≠ 0 := by + intro h; have := (Complex.ext_iff.mp h).2; simp at this; linarith only [hz', + this] have him := neg_inv_add_one_im_pos hz' have hφ : DifferentiableAt ℂ φ₀'' (-1 / (z + 1)) := (φ₀''_differentiableOn _ him).differentiableAt @@ -283,7 +287,7 @@ theorem segment_integral_eq_sub_of_hasDerivAt {f G : ℂ → ℂ} {S : Set ℂ} have : a + ↑t • (b - a) = (1 - t) • a + t • b := by simp only [smul_sub, sub_smul, one_smul]; ring rw [this] - exact hS_convex ha hb (by linarith [ht.2]) ht.1 (by ring) + exact hS_convex ha hb (by linarith only [ht, ht.2]) ht.1 (by ring) have hcont : ContinuousOn (fun t : ℝ => f (a + t • (b - a))) (Icc 0 1) := hf_cont.comp (continuous_const.add (continuous_ofReal.smul continuous_const)).continuousOn h_mem @@ -517,9 +521,9 @@ private theorem exp_bound_diag {r : ℝ} {t : ℝ} (ht : 0 < t) (ht1 : t ≤ 1) rw [Complex.norm_exp]; apply Real.exp_le_exp_of_le simp [contourNeg1ToI, Complex.mul_im, Complex.I_re, Complex.I_im, Complex.add_im, Complex.ofReal_re, Complex.ofReal_im] - nlinarith [Real.pi_pos, neg_abs_le r, abs_nonneg r, ht1, + nlinarith only [ht, ht1, Real.pi_pos, neg_abs_le r, abs_nonneg r, mul_le_mul_of_nonneg_right (neg_abs_le r) ht.le, - mul_le_mul_of_nonneg_left (show t ≤ 2 from by linarith) (abs_nonneg r)] + mul_le_mul_of_nonneg_left (show t ≤ 2 from by linarith only [ht1]) (abs_nonneg r)] /-- Exponential bound along the vertical contour for `t ∈ (0, 1]`. -/ private theorem exp_bound_vert {r : ℝ} {t : ℝ} (ht : 0 < t) (ht1 : t ≤ 1) : @@ -528,9 +532,8 @@ private theorem exp_bound_vert {r : ℝ} {t : ℝ} (ht : 0 < t) (ht1 : t ≤ 1) rw [Complex.norm_exp]; apply Real.exp_le_exp_of_le simp [Complex.mul_im, Complex.I_re, Complex.I_im, Complex.add_im, Complex.ofReal_re, Complex.ofReal_im] - nlinarith [Real.pi_pos, neg_abs_le r, abs_nonneg r, ht1, - mul_le_mul_of_nonneg_right (neg_abs_le r) ht.le, - mul_le_mul_of_nonneg_left ht1 (abs_nonneg r)] + nlinarith only [ht, ht1, Real.pi_pos, neg_abs_le r, abs_nonneg r, + mul_le_mul_of_nonneg_right (neg_abs_le r) ht.le, mul_le_mul_of_nonneg_left ht1 (abs_nonneg r)] /-- For small `t > 0`, the phi0 bound `M` applies along the diagonal contour, because `Im(-1/(z+1)) = 1/(2t) >= A`. -/ @@ -544,8 +547,8 @@ private theorem phi0_bound_of_small_diag {t A : ℝ} (ht : 0 < t) (ht_lt : t < 1 simp only [UpperHalfPlane.mk_im]; rw [im_neg_inv_diag ht] have : max A 1 ≤ 1 / (2 * t) := by rw [lt_div_iff₀ (by positivity : (0 : ℝ) < 2 * max A 1)] at ht_lt - rw [le_div_iff₀ (by positivity : (0 : ℝ) < 2 * t)]; linarith - linarith [le_max_left A 1] + rw [le_div_iff₀ (by positivity : (0 : ℝ) < 2 * t)]; linarith only [ht_lt] + linarith only [this, le_max_left A 1] /-- For small `t > 0`, the phi0 bound `M` applies along the vertical contour, because `Im(-1/(z+1)) = 1/t >= A`. -/ @@ -560,8 +563,8 @@ private theorem phi0_bound_of_small_vert {t A : ℝ} (ht : 0 < t) (ht_lt : t < 1 rw [im_neg_inv_vert ht] have : max A 1 ≤ 1 / t := by rw [lt_div_iff₀ (by positivity : (0 : ℝ) < max A 1)] at ht_lt - rw [le_div_iff₀ (by positivity : (0 : ℝ) < t)]; linarith - linarith [le_max_left A 1] + rw [le_div_iff₀ (by positivity : (0 : ℝ) < t)]; linarith only [ht_lt] + linarith only [this, le_max_left A 1] /-- The integrand norm along the diagonal is bounded by `C * t^2` for small `t > 0`. -/ private theorem integrand_norm_bound_diag {r : ℝ} {t : ℝ} (ht : 0 < t) (ht1 : t ≤ 1) @@ -586,7 +589,7 @@ private theorem integrand_norm_bound_diag {r : ℝ} {t : ℝ} (ht : 0 < t) (ht1 · exact exp_bound_diag ht ht1 _ ≤ C_bd * t ^ 2 := by simp only [C_bd] - nlinarith [hM_nn, norm_nonneg ((1 : ℂ) + I), Real.exp_pos (Real.pi * |r| * 2), + nlinarith only [hM_nn, norm_nonneg ((1 : ℂ) + I), Real.exp_pos (Real.pi * |r| * 2), sq_nonneg t, mul_nonneg (Real.exp_pos (Real.pi * |r| * 2)).le (norm_nonneg ((1 : ℂ) + I))] @@ -613,8 +616,7 @@ private theorem integrand_norm_bound_vert {r : ℝ} {t : ℝ} (ht : 0 < t) (ht1 · exact exp_bound_vert ht ht1 _ ≤ C_bd * t ^ 2 := by simp only [C_bd] - nlinarith [hM_nn, norm_nonneg (I : ℂ), Real.exp_pos (Real.pi * |r|), - sq_nonneg t, + nlinarith only [hM_nn, norm_nonneg (I : ℂ), Real.exp_pos (Real.pi * |r|), sq_nonneg t, mul_nonneg (Real.exp_pos (Real.pi * |r|)).le (norm_nonneg (I : ℂ))] /-- At `t = 0`, the diagonal integrand is `ContinuousWithinAt` on `[0, 1]`. @@ -788,7 +790,7 @@ theorem I12_split_at_delta (r : ℝ) (δ : ℝ) (hδ₀ : 0 ≤ δ) (hδ₁ : δ viazovskaIntegrandLeft r (contourNeg1ToI t) * (1 + I) := by unfold I12; congr 1; ext t; rw [deriv_contour_neg1_to_i] rw [hI12] - have hint := hcont.intervalIntegrable_of_Icc (μ := volume) (by linarith : (0 : ℝ) ≤ 1) + have hint := hcont.intervalIntegrable_of_Icc (μ := volume) (by linarith only [] : (0 : ℝ) ≤ 1) have hδ_mem : δ ∈ Set.uIcc (0 : ℝ) 1 := Set.mem_uIcc.mpr (Or.inl ⟨hδ₀, hδ₁⟩) exact (intervalIntegral.integral_add_adjacent_intervals (hint.mono_set (Set.uIcc_subset_uIcc_left hδ_mem)) @@ -803,7 +805,7 @@ theorem I12_vert_split_at_delta (r : ℝ) (δ : ℝ) (hδ₀ : 0 ≤ δ) (hδ₁ (∫ t in δ..1, viazovskaIntegrandLeft r (-1 + I * ↑t) * I) := by unfold I12Vert - have hint := hcont.intervalIntegrable_of_Icc (μ := volume) (by linarith : (0 : ℝ) ≤ 1) + have hint := hcont.intervalIntegrable_of_Icc (μ := volume) (by linarith only [] : (0 : ℝ) ≤ 1) have hδ_mem : δ ∈ Set.uIcc (0 : ℝ) 1 := Set.mem_uIcc.mpr (Or.inl ⟨hδ₀, hδ₁⟩) exact (intervalIntegral.integral_add_adjacent_intervals (hint.mono_set (Set.uIcc_subset_uIcc_left hδ_mem)) @@ -828,13 +830,16 @@ private theorem ftc_tail_diag (r : ℝ) (G : ℂ → ℂ) have hGdiag : ∀ t ∈ Set.uIcc δ 1, HasDerivAt (fun s => G (contourNeg1ToI s)) (viazovskaIntegrandLeft r (contourNeg1ToI t) * (1 + I)) t := by intro t ht - have ht_pos : 0 < t := by rcases Set.mem_uIcc.mp ht with ⟨h1, _⟩ | ⟨_, h2⟩ <;> linarith + have ht_pos : 0 < t := by + rcases Set.mem_uIcc.mp ht with ⟨h1, _⟩ | ⟨h2, _⟩ + · exact lt_of_lt_of_le hδ h1 + · exact lt_of_lt_of_le zero_lt_one h2 exact ((@HasDerivAt.scomp ℝ _ ℂ _ _ t ℂ _ _ _ IsScalarTower.right _ _ _ _ (hG _ (contour_neg1_to_i_im_pos ht_pos)) (hasDerivAt_contour_neg1_to_i t))).congr_deriv (by simp [smul_eq_mul]; ring) have h := intervalIntegral.integral_eq_sub_of_hasDerivAt hGdiag - ((hcont.mono (fun x hx => ⟨by linarith [hx.1], hx.2⟩)).intervalIntegrable_of_Icc - (by linarith)) + ((hcont.mono (fun x hx => ⟨by linarith only [hδ, hx, hx.1], hx.2⟩)).intervalIntegrable_of_Icc + (by linarith only [hδ1])) simpa [Function.comp] using h /-- FTC for the tail vertical integral: for delta in (0, 1], the integral from @@ -848,13 +853,16 @@ private theorem ftc_tail_vert (r : ℝ) (G : ℂ → ℂ) have hGvert : ∀ t ∈ Set.uIcc δ 1, HasDerivAt (fun s : ℝ => G (-1 + I * ↑s)) (viazovskaIntegrandLeft r (-1 + I * ↑t) * I) t := by intro t ht - have ht_pos : 0 < t := by rcases Set.mem_uIcc.mp ht with ⟨h1, _⟩ | ⟨_, h2⟩ <;> linarith + have ht_pos : 0 < t := by + rcases Set.mem_uIcc.mp ht with ⟨h1, _⟩ | ⟨h2, _⟩ + · exact lt_of_lt_of_le hδ h1 + · exact lt_of_lt_of_le zero_lt_one h2 exact ((@HasDerivAt.scomp ℝ _ ℂ _ _ t ℂ _ _ _ IsScalarTower.right _ _ _ _ (hG _ (vertical_contour_im_pos ht_pos)) (hasDerivAt_vert_contour t))).congr_deriv (by simp [smul_eq_mul]; ring) exact intervalIntegral.integral_eq_sub_of_hasDerivAt hGvert - ((hcont.mono (fun x hx => ⟨by linarith [hx.1], hx.2⟩)).intervalIntegrable_of_Icc - (by linarith)) + ((hcont.mono (fun x hx => ⟨by linarith only [hδ, hx, hx.1], hx.2⟩)).intervalIntegrable_of_Icc + (by linarith only [hδ1])) /-- For each delta in (0, 1], the difference `I12 - (I12Vert + I12Horiz)` equals the sum of two head integrals plus a G-difference. -/ @@ -924,7 +932,7 @@ private theorem segment_integrand_norm_bound (r : ℝ) {δ : ℝ} (hδ_pos : 0 < have him : 0 < z₀.im := by simp [z₀, a, dir, Complex.add_im, Complex.mul_im, Complex.I_re, Complex.I_im, Complex.ofReal_re, Complex.ofReal_im, - Complex.neg_im, Complex.one_im, Complex.one_re]; linarith + Complex.neg_im, Complex.one_im, Complex.one_re]; linarith only [hδ_pos] have hz_plus_1 : z₀ + 1 = ↑δ * ((1 - ↑t : ℂ) + I) := by simp [z₀, a, dir]; ring have him_w : 0 < (-1 / (z₀ + 1)).im := neg_inv_add_one_im_pos him have hnsq : Complex.normSq (z₀ + 1) = δ ^ 2 * ((1 - t) ^ 2 + 1) := by @@ -937,33 +945,33 @@ private theorem segment_integrand_norm_bound (r : ℝ) {δ : ℝ} (hδ_pos : 0 < simp [Complex.mul_im, Complex.I_re, Complex.I_im, Complex.ofReal_re, Complex.ofReal_im, Complex.add_im, Complex.sub_im, Complex.one_im] -- Im(-1/(z+1)) >= 1/(2*delta) >= A - have h1t_sq : (1 - t) ^ 2 + 1 ≤ 2 := by nlinarith + have h1t_sq : (1 - t) ^ 2 + 1 ≤ 2 := by nlinarith only [ht1, ht2] have him_lb : 1 / (2 * δ) ≤ (-1 / (z₀ + 1)).im := by rw [neg_div, Complex.neg_im, Complex.div_im] simp only [Complex.one_re, Complex.one_im, zero_mul, zero_div, one_mul, zero_sub, neg_neg] rw [hnsq, him_eq] rw [div_le_div_iff₀ (by positivity : (0 : ℝ) < 2 * δ) (by positivity : 0 < δ ^ 2 * ((1 - t) ^ 2 + 1))] - nlinarith [sq_nonneg δ] + nlinarith only [h1t_sq, sq_nonneg δ] have hA_le : A ≤ (-1 / (z₀ + 1)).im := by have : max A 1 ≤ 1 / (2 * δ) := by rw [lt_div_iff₀ (by positivity : (0 : ℝ) < 2 * max A 1)] at hδ_lt_A - rw [le_div_iff₀ (by positivity : (0 : ℝ) < 2 * δ)]; linarith - linarith [le_max_left A 1] + rw [le_div_iff₀ (by positivity : (0 : ℝ) < 2 * δ)]; linarith only [hδ_lt_A] + linarith only [him_lb, this, le_max_left A 1] -- Bound phi0, (z+1)^2, exp have hφ : ‖φ₀'' (-1 / (z₀ + 1))‖ ≤ M := by simp only [φ₀'', him_w, dite_eq_left] - exact hMA ⟨_, him_w⟩ (by simp [UpperHalfPlane.im]; linarith) + exact hMA ⟨_, him_w⟩ (by simp [UpperHalfPlane.im]; linarith only [hA_le]) have hsq : ‖(z₀ + 1) ^ 2‖ ≤ 2 * δ ^ 2 := by rw [norm_pow, ← Complex.normSq_eq_norm_sq, hnsq] - nlinarith [sq_nonneg δ, h1t_sq] + nlinarith only [h1t_sq, sq_nonneg δ] have hexp : ‖Complex.exp (↑Real.pi * I * ↑r * z₀)‖ ≤ Real.exp (Real.pi * |r| * 2) := by rw [Complex.norm_exp]; apply Real.exp_le_exp_of_le simp [z₀, a, dir, Complex.mul_im, Complex.I_re, Complex.I_im, Complex.add_im, Complex.ofReal_re, Complex.ofReal_im, Complex.neg_im, Complex.one_im, Complex.one_re] - nlinarith [Real.pi_pos, neg_abs_le r, abs_nonneg r, + nlinarith only [hδ_pos, hδ1, Real.pi_pos, neg_abs_le r, abs_nonneg r, mul_le_mul_of_nonneg_right (neg_abs_le r) hδ_pos.le, mul_le_mul_of_nonneg_left hδ1 (abs_nonneg r)] -- ||F(z0)|| <= C_seg * delta^2 <= 1 @@ -981,13 +989,13 @@ private theorem segment_integrand_norm_bound (r : ℝ) {δ : ℝ} (hδ_pos : 0 < rw [Real.sq_sqrt (by positivity)] at h1 have h2 : C_seg * δ ^ 2 < C_seg * (1 / C_seg) := mul_lt_mul_of_pos_left h1 hC_seg_pos - simp [ne_of_gt hC_seg_pos] at h2; linarith + simp [ne_of_gt hC_seg_pos] at h2; linarith only [h2] calc ‖viazovskaIntegrandLeft r z₀‖ ≤ M * (2 * δ ^ 2) * Real.exp (Real.pi * |r| * 2) := hF_unfold.trans (by gcongr) _ ≤ C_seg * δ ^ 2 := by simp only [C_seg] - nlinarith [hM_nn, Real.exp_pos (Real.pi * |r| * 2), sq_nonneg δ] + nlinarith only [hM_nn, Real.exp_pos (Real.pi * |r| * 2), sq_nonneg δ] _ ≤ 1 := hCδ -- ||F(z0) * dir|| = ||F(z0)|| * delta <= 1 * delta = delta have hneg_norm : ‖dir‖ = δ := by @@ -1034,7 +1042,7 @@ private theorem G_diff_tendsto_zero (r : ℝ) (G : ℂ → ℂ) have ha_uhp : a ∈ {z : ℂ | 0 < z.im} := by simp only [a, Set.mem_ofPred_eq, Complex.add_im, Complex.neg_im, Complex.one_im, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, Complex.add_re, Complex.one_re, - Complex.I_re, Complex.I_im]; nlinarith + Complex.I_re, Complex.I_im]; nlinarith only [hδ_pos] have hb_uhp := neg_one_add_delta_I_mem_uhp hδ_pos have hdir_eq : (-1 + ↑δ * I : ℂ) - a = dir := by simp [a, dir]; ring have hG_seg : G (-1 + ↑δ * I) - G a = diff --git a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Basic.lean b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Basic.lean index f8733dea16..2a85c1e81c 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Basic.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Basic.lean @@ -36,10 +36,10 @@ noncomputable section def heightCutoff : ℝ := Real.sqrt 3 / 2 + 1 lemma one_lt_heightCutoff : 1 < heightCutoff := by - unfold heightCutoff; linarith [Real.sqrt_pos_of_pos (show (3 : ℝ) > 0 by norm_num)] + unfold heightCutoff; linarith only [Real.sqrt_pos_of_pos (show (3 : ℝ) > 0 by norm_num)] lemma sqrt3_div2_lt_heightCutoff : - Real.sqrt 3 / 2 < heightCutoff := by unfold heightCutoff; linarith + Real.sqrt 3 / 2 < heightCutoff := by unfold heightCutoff; linarith only [] /-- Segment 1: right vertical from (1/2 + H·i) down to ρ+1. -/ def fdBoundarySeg1 : ℝ → ℂ := fun t => @@ -289,7 +289,7 @@ private lemma fdBoundary_H_inner234_cont (H : ℝ) : Continuous (fdBoundary_H_in apply Continuous.if_le fdBoundary_H_seg23b_cont (fdBoundary_H_inner34_cont H) continuous_id continuous_const intro t ht; simp only [id] at ht - have : t = 3 := by linarith + have : t = 3 := by linarith only [ht] subst this; unfold fdBoundary_H_inner34 simp only [show (3 : ℝ) ≤ 4 from by norm_num, ite_true] have h : (↑Real.pi / 2 + (↑(3 : ℝ) - 2) * (2 * ↑Real.pi / 3 - ↑Real.pi / 2)) * I = @@ -308,12 +308,14 @@ private lemma fdBoundary_H_inner1234_cont (H : ℝ) : Continuous (fdBoundary_H_i apply Continuous.if_le fdBoundary_H_seg23_cont (fdBoundary_H_inner234_cont H) continuous_id continuous_const intro t ht; simp only [id] at ht - have : t = 2 := by linarith + have : t = 2 := by linarith only [ht] subst this; unfold fdBoundary_H_inner234 simp only [show (2 : ℝ) ≤ 3 from by norm_num, ite_true] have h1 : (↑Real.pi / 3 + (↑(2 : ℝ) - 1) * (↑Real.pi / 2 - ↑Real.pi / 3)) * I = ↑(Real.pi / 2) * I := by push_cast; ring - simp_all + simp_all only [ofReal_ofNat, ofReal_div, mul_eq_mul_right_iff, I_ne_zero, or_false, + exp_pi_div_two_mul_I, + sub_self, zero_mul, add_zero] private lemma fdBoundary_H_eq_layered (H : ℝ) (t : ℝ) : fdBoundaryH H t = @@ -331,7 +333,7 @@ theorem fdBoundary_H_continuous (H : ℝ) : apply Continuous.if_le (fdBoundary_H_seg1_cont H) (fdBoundary_H_inner1234_cont H) continuous_id continuous_const intro t ht; simp only [id] at ht - have : t = 1 := by linarith + have : t = 1 := by linarith only [ht] subst this; unfold fdBoundary_H_inner1234 simp only [show (1 : ℝ) ≤ 2 from by norm_num, ite_true] have h : (↑Real.pi / 3 + (↑(1 : ℝ) - 1) * (↑Real.pi / 2 - ↑Real.pi / 3)) * I = diff --git a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Bounds.lean b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Bounds.lean index 3f4f0d8bfe..2cd67b58b9 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Bounds.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Bounds.lean @@ -43,54 +43,61 @@ lemma fdBoundary_H_eq_seg2_H {t : ℝ} (H : ℝ) lemma fdBoundary_H_eq_seg3_H {t : ℝ} (H : ℝ) (ht2 : 2 < t) (ht3 : t ≤ 3) : fdBoundaryH H t = fdBoundarySeg3H t := by - simp only [fdBoundaryH, show ¬t ≤ 1 from not_le.mpr (by linarith), + simp only [fdBoundaryH, show ¬t ≤ 1 from not_le.mpr (by linarith only [ht2]), show ¬t ≤ 2 from not_le.mpr ht2, ht3, ite_true, ite_false, fdBoundarySeg3H, fdBoundarySeg3] lemma fdBoundary_H_eq_seg4_H {H t : ℝ} (ht3 : 3 < t) (ht4 : t ≤ 4) : fdBoundaryH H t = fdBoundarySeg4H H t := by - simp only [fdBoundaryH, show ¬t ≤ 1 from not_le.mpr (by linarith), - show ¬t ≤ 2 from not_le.mpr (by linarith), show ¬t ≤ 3 from not_le.mpr ht3, + simp only [fdBoundaryH, show ¬t ≤ 1 from not_le.mpr (by linarith only [ht3]), + show ¬t ≤ 2 from not_le.mpr (by linarith only [ht3]), show ¬t ≤ 3 from not_le.mpr ht3, ht4, ite_true, ite_false, fdBoundarySeg4H] lemma fdBoundary_H_eq_seg5_H {H t : ℝ} (ht4 : 4 < t) : fdBoundaryH H t = fdBoundarySeg5H H t := by - simp only [fdBoundaryH, show ¬t ≤ 1 from not_le.mpr (by linarith), - show ¬t ≤ 2 from not_le.mpr (by linarith), show ¬t ≤ 3 from not_le.mpr (by linarith), + simp only [fdBoundaryH, show ¬t ≤ 1 from not_le.mpr (by linarith only [ht4]), + show ¬t ≤ 2 from not_le.mpr (by linarith only [ht4]), show ¬t ≤ 3 from not_le.mpr (by + linarith only [ht4]), show ¬t ≤ 4 from not_le.mpr ht4, ite_false, fdBoundarySeg5H] private lemma seg2_angle_in_range {t : ℝ} (ht1 : 1 ≤ t) (ht2 : t ≤ 2) : Real.pi / 3 ≤ Real.pi / 3 + (t - 1) * (Real.pi / 2 - Real.pi / 3) ∧ Real.pi / 3 + (t - 1) * (Real.pi / 2 - Real.pi / 3) ≤ 2 * Real.pi / 3 := by have hpi := Real.pi_pos; constructor - · nlinarith [mul_nonneg (show (0 : ℝ) ≤ t - 1 by linarith) - (show (0 : ℝ) ≤ Real.pi / 6 by linarith)] - · nlinarith [mul_le_mul_of_nonneg_right (show t - 1 ≤ 1 by linarith) + · nlinarith only [ht1, hpi, + mul_nonneg (show (0 : ℝ) ≤ t - 1 by linarith) (show (0 : ℝ) ≤ Real.pi / 6 by linarith)] + · nlinarith only [ht2, hpi, + mul_le_mul_of_nonneg_right (show t - 1 ≤ 1 by linarith) (show (0 : ℝ) ≤ Real.pi / 6 by linarith)] private lemma seg3_angle_in_range {t : ℝ} (ht2 : 2 ≤ t) (ht3 : t ≤ 3) : Real.pi / 3 ≤ Real.pi / 2 + (t - 2) * (2 * Real.pi / 3 - Real.pi / 2) ∧ Real.pi / 2 + (t - 2) * (2 * Real.pi / 3 - Real.pi / 2) ≤ 2 * Real.pi / 3 := by have hpi := Real.pi_pos - have h_nonneg : 0 ≤ (t - 2) * (2 * Real.pi / 3 - Real.pi / 2) := by nlinarith + have h_nonneg : 0 ≤ (t - 2) * (2 * Real.pi / 3 - Real.pi / 2) := by nlinarith only [ht2, hpi] constructor - · nlinarith - · nlinarith [mul_le_mul_of_nonneg_right (show t - 2 ≤ 1 by linarith) + · nlinarith only [hpi, h_nonneg] + · nlinarith only [ht3, hpi, + mul_le_mul_of_nonneg_right (show t - 2 ≤ 1 by linarith) (show (0 : ℝ) ≤ Real.pi / 6 by linarith)] private lemma sin_pos_of_angle_in_range {θ : ℝ} (h1 : Real.pi / 3 ≤ θ) (h2 : θ ≤ 2 * Real.pi / 3) : 0 < Real.sin θ := - ArcCalculus.sin_pos_of_mem_Ioo_zero_pi ⟨by linarith [Real.pi_pos], by linarith [Real.pi_pos]⟩ + ArcCalculus.sin_pos_of_mem_Ioo_zero_pi ⟨by linarith only [h1, Real.pi_pos], by + linarith only [h2, Real.pi_pos]⟩ private lemma sin_ge_sqrt3_div_2_of_angle_in_range {θ : ℝ} (h1 : Real.pi / 3 ≤ θ) (h2 : θ ≤ 2 * Real.pi / 3) : Real.sqrt 3 / 2 ≤ Real.sin θ := by have hpi := Real.pi_pos rw [show Real.sqrt 3 / 2 = Real.sin (Real.pi / 3) from Real.sin_pi_div_three.symm] by_cases h : θ ≤ Real.pi / 2 - · exact Real.sin_le_sin_of_le_of_le_pi_div_two (by linarith) h h1 + · exact Real.sin_le_sin_of_le_of_le_pi_div_two (by linarith only [hpi]) h h1 · push Not at h; rw [show Real.sin θ = Real.sin (Real.pi - θ) from (Real.sin_pi_sub θ).symm] - exact Real.sin_le_sin_of_le_of_le_pi_div_two (by linarith) (by linarith) (by linarith) + exact Real.sin_le_sin_of_le_of_le_pi_div_two (by linarith only [h2, h]) + (by linarith only [h]) + (by + linarith only [h2]) private lemma abs_cos_le_half_of_angle_in_range {θ : ℝ} (h1 : Real.pi / 3 ≤ θ) (h2 : θ ≤ 2 * Real.pi / 3) : |Real.cos θ| ≤ 1 / 2 := @@ -237,20 +244,21 @@ lemma fdBoundary_eq_seg2 {t : ℝ} (ht1 : 1 < t) (ht2 : t ≤ 2) : lemma fdBoundary_eq_seg3 {t : ℝ} (ht2 : 2 < t) (ht3 : t ≤ 3) : fdBoundary t = fdBoundarySeg3 t := by - simp only [fdBoundary, show ¬t ≤ 1 from not_le.mpr (by linarith), + simp only [fdBoundary, show ¬t ≤ 1 from not_le.mpr (by linarith only [ht2]), show ¬t ≤ 2 from not_le.mpr ht2, ht3, ite_true, ite_false, fdBoundarySeg3] lemma fdBoundary_eq_seg4 {t : ℝ} (ht3 : 3 < t) (ht4 : t ≤ 4) : fdBoundary t = fdBoundarySeg4 t := by - simp only [fdBoundary, show ¬t ≤ 1 from not_le.mpr (by linarith), - show ¬t ≤ 2 from not_le.mpr (by linarith), show ¬t ≤ 3 from not_le.mpr ht3, + simp only [fdBoundary, show ¬t ≤ 1 from not_le.mpr (by linarith only [ht3]), + show ¬t ≤ 2 from not_le.mpr (by linarith only [ht3]), show ¬t ≤ 3 from not_le.mpr ht3, ht4, ite_true, ite_false, fdBoundarySeg4] lemma fdBoundary_eq_seg5 {t : ℝ} (ht4 : 4 < t) : fdBoundary t = fdBoundarySeg5 t := by - simp only [fdBoundary, show ¬t ≤ 1 from not_le.mpr (by linarith), - show ¬t ≤ 2 from not_le.mpr (by linarith), show ¬t ≤ 3 from not_le.mpr (by linarith), + simp only [fdBoundary, show ¬t ≤ 1 from not_le.mpr (by linarith only [ht4]), + show ¬t ≤ 2 from not_le.mpr (by linarith only [ht4]), show ¬t ≤ 3 from not_le.mpr (by + linarith only [ht4]), show ¬t ≤ 4 from not_le.mpr ht4, ite_false, fdBoundarySeg5] theorem fdBoundary_continuous : Continuous fdBoundary := by diff --git a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Smooth.lean b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Smooth.lean index d0590025e6..88a9f8e81a 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Smooth.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Smooth.lean @@ -129,7 +129,7 @@ private lemma hasDerivAt_seg1_fun (H : ℝ) (t : ℝ) : ((0 - 1 * (↑H - ↑(Real.sqrt 3) / 2)) * I) t := by apply HasDerivAt.mul_const exact (hasDerivAt_const t (↑H : ℂ)).sub ((hasDerivAt_id t).ofReal_comp.mul_const _) - simp_all + simp_all only [one_mul, zero_sub, neg_sub] exact h1.const_add ((1 : ℂ) / 2) lemma fdBoundary_H_hasDerivAt_seg1' (H : ℝ) (t : ℝ) @@ -274,7 +274,7 @@ private lemma seg_vertical_deriv_ne_zero {H : ℝ} (hH : Real.sqrt 3 / 2 < H) : apply mul_ne_zero _ I_ne_zero intro h; apply_fun Complex.re at h simp only [sub_re, ofReal_re, div_ofNat, zero_re] at h - linarith + linarith only [hH, h] private lemma arc_tendsto_left {H : ℝ} (p : ℝ) (h1p : 1 < p) (hp3 : p ≤ 3) : Tendsto (deriv (fdBoundaryH H)) (𝓝[<] p) (𝓝 (exp ((↑Real.pi * (↑p + 1) / 6) * I) * @@ -336,9 +336,9 @@ lemma fdBoundary_H_hasDerivAt_seg5 (H : ℝ) {t : ℝ} (h4 : 4 < t) : have heq : fdBoundaryH H =ᶠ[𝓝 t] fun s : ℝ => (↑s - 9/2 : ℂ) + ↑H * I := by filter_upwards [Ioi_mem_nhds h4] with s hs have hs4 : (4 : ℝ) < s := hs - simp only [fdBoundaryH, show ¬s ≤ 1 from by linarith, - show ¬s ≤ 2 from by linarith, show ¬s ≤ 3 from by linarith, - show ¬s ≤ 4 from by linarith, ite_false] + simp only [fdBoundaryH, show ¬s ≤ 1 from by linarith only [hs4], + show ¬s ≤ 2 from by linarith only [hs4], show ¬s ≤ 3 from by linarith only [hs4], + show ¬s ≤ 4 from by linarith only [hs4], ite_false] exact (hasDerivAt_seg5_fun H t).congr_of_eventuallyEq heq theorem continuous_fdBoundary_seg1_H (H : ℝ) : @@ -396,7 +396,7 @@ private lemma seg4_eventuallyEq_left_4 (H : ℝ) : eventuallyEq_nhdsLE_of_Ioo 3 5 (by norm_num) (by norm_num) fun s hs => by rcases eq_or_lt_of_le (show s ≤ 4 from hs.2) with rfl | h · simp only [fdBoundarySeg4H, fdBoundary_H_at_four]; push_cast; ring - · exact (fdBoundary_H_eq_seg4_H (by linarith [hs.1.1]) (le_of_lt h)).symm + · exact (fdBoundary_H_eq_seg4_H (by linarith only [hs, hs.1.1]) (le_of_lt h)).symm private lemma seg5_eventuallyEq_right_4 (H : ℝ) : fdBoundarySeg5H H =ᶠ[𝓝[≥] 4] fdBoundaryH H := @@ -422,7 +422,7 @@ lemma fdBoundary_H_not_differentiableAt_4 {H : ℝ} (hH : Real.sqrt 3 / 2 < H) : (((uniqueDiffWithinAt_Iic (4 : ℝ)).eq_deriv _ hleft hd.hasDerivWithinAt).trans ((uniqueDiffWithinAt_Ici (4 : ℝ)).eq_deriv _ hright hd.hasDerivWithinAt).symm) simp only [mul_im, ofReal_re, I_re, mul_zero, ofReal_im, I_im, mul_one, one_im] at him - linarith [sub_pos.mpr hH] + linarith only [hH, him, sub_pos.mpr hH] private lemma arc_eventuallyEq_left_3 (H : ℝ) : (fun s => exp ((↑Real.pi * (↑s + 1) / 6) * I)) =ᶠ[𝓝[≤] 3] fdBoundaryH H := @@ -433,7 +433,7 @@ private lemma arc_eventuallyEq_left_3 (H : ℝ) : simp only [fdBoundary, show ¬(3 : ℝ) ≤ 1 from by norm_num, ↓reduceIte, show ¬(3 : ℝ) ≤ 2 from by norm_num, show (3 : ℝ) ≤ 3 from le_rfl] congr 1; push_cast; ring - · exact (fdBoundary_H_eq_arc_near (by linarith [hs.1.1]) hs3').symm.eq_of_nhds + · exact (fdBoundary_H_eq_arc_near (by linarith only [hs, hs.1.1]) hs3').symm.eq_of_nhds private lemma seg4_eventuallyEq_right_3 (H : ℝ) : fdBoundarySeg4H H =ᶠ[𝓝[≥] 3] fdBoundaryH H := @@ -444,7 +444,7 @@ private lemma seg4_eventuallyEq_right_3 (H : ℝ) : simp only [fdBoundarySeg4H, ellipticPointRho, ellipticPointRho', UpperHalfPlane.coe_mk] push_cast; ring - · exact (fdBoundary_H_eq_seg4_H h (by linarith [hs.1.2])).symm + · exact (fdBoundary_H_eq_seg4_H h (by linarith only [hs, hs.1.2])).symm lemma fdBoundary_H_not_differentiableAt_3 {H : ℝ} (_hH : Real.sqrt 3 / 2 < H) : ¬DifferentiableAt ℝ (fdBoundaryH H) 3 := by @@ -487,7 +487,10 @@ lemma fdBoundary_H_not_differentiableAt_3 {H : ℝ} (_hH : Real.sqrt 3 / 2 < H) have hsin : Real.sin (Real.pi * 4 / 6) = Real.sqrt 3 / 2 := by rw [show Real.pi * 4 / 6 = Real.pi - Real.pi / 3 from by ring, Real.sin_pi_sub, Real.sin_pi_div_three] - simp_all + simp_all only [ofReal_div, ofReal_ofNat, ofReal_mul, ofReal_sub, hasDerivAt_deriv_iff, neg_mul, + neg_eq_zero, + mul_eq_zero, div_eq_zero_iff, Real.pi_ne_zero, OfNat.ofNat_ne_zero, or_self, + Nat.ofNat_nonneg, Real.sqrt_eq_zero] private lemma seg1_eventuallyEq_left_1 (H : ℝ) : fdBoundarySeg1H H =ᶠ[𝓝[≤] 1] fdBoundaryH H := @@ -502,7 +505,7 @@ private lemma arc_eventuallyEq_right_1 (H : ℝ) : rw [show (↑Real.pi * (↑(1 : ℝ) + 1) / 6) * I = ↑(Real.pi / 3 : ℝ) * I from by push_cast; ring, exp_mul_I, ← ofReal_cos, ← ofReal_sin, Real.cos_pi_div_three, Real.sin_pi_div_three] push_cast; ring - · exact (fdBoundary_H_eq_arc_near hs1 (by linarith [hs.1.2])).symm.eq_of_nhds + · exact (fdBoundary_H_eq_arc_near hs1 (by linarith only [hs, hs.1.2])).symm.eq_of_nhds lemma fdBoundary_H_not_differentiableAt_1 {H : ℝ} (_hH : Real.sqrt 3 / 2 < H) : ¬DifferentiableAt ℝ (fdBoundaryH H) 1 := by @@ -542,7 +545,10 @@ lemma fdBoundary_H_not_differentiableAt_1 {H : ℝ} (_hH : Real.sqrt 3 / 2 < H) I_mul_re, exp_ofReal_mul_I_im]; ring rw [hre_lhs, hre_rhs] at hre rw [show Real.pi * 2 / 6 = Real.pi / 3 from by ring] at hre - simp_all + simp_all only [ofReal_sub, ofReal_div, ofReal_ofNat, neg_sub, ofReal_mul, hasDerivAt_deriv_iff, + Real.sin_pi_div_three, neg_mul, zero_eq_neg, mul_eq_zero, div_eq_zero_iff, Real.pi_ne_zero, + OfNat.ofNat_ne_zero, + or_self, Nat.ofNat_nonneg, Real.sqrt_eq_zero] lemma fdBoundary_H_right_deriv_limit (H : ℝ) (hH : Real.sqrt 3 / 2 < H) @@ -735,9 +741,11 @@ lemma fdBoundary_H_deriv_continuousOn_Ioo_34 (H : ℝ) : ContinuousOn (deriv (fdBoundaryH H)) (Ioo 3 4) := by intro t ht exact (fdBoundary_H_deriv_continuousAt_off_fullPartition H t - ⟨by linarith [ht.1], by linarith [ht.2]⟩ - (notMem_fullPartition_of_lt (by linarith [ht.1]) (by linarith [ht.1]) (by linarith [ht.1]) - (by linarith [ht.1]) (by linarith [ht.2]) (by linarith [ht.2]))).continuousWithinAt + ⟨by linarith only [ht, ht.1], by linarith only [ht, ht.2]⟩ + (notMem_fullPartition_of_lt (by linarith only [ht, ht.1]) (by linarith only [ht, ht.1]) (by + linarith only [ht, ht.1]) + (by linarith only [ht, ht.1]) (by linarith only [ht, ht.2]) (by + linarith only [ht, ht.2]))).continuousWithinAt lemma fdBoundary_H_deriv_continuousOn_Ioo_45 (H : ℝ) : ContinuousOn (deriv (fdBoundaryH H)) (Ioo 4 5) := by @@ -751,7 +759,7 @@ lemma fdBoundary_H_deriv_continuousOn_Ioo_45 (H : ℝ) : private lemma norm_cast_sub_eq {H : ℝ} (hH : Real.sqrt 3 / 2 < H) : ‖(↑H - ↑(Real.sqrt 3) / 2 : ℂ)‖ = H - Real.sqrt 3 / 2 := by have hcast : (↑H - ↑(Real.sqrt 3) / 2 : ℂ) = ↑(H - Real.sqrt 3 / 2) := by push_cast; ring - rw [hcast, Complex.norm_real, Real.norm_of_nonneg (by linarith)] + rw [hcast, Complex.norm_real, Real.norm_of_nonneg (by linarith only [hH])] lemma fdBoundary_H_deriv_bound_ex {H : ℝ} (hH : Real.sqrt 3 / 2 < H) : @@ -783,7 +791,7 @@ lemma fdBoundary_H_deriv_bound_ex {H : ℝ} push_cast; ring, Complex.norm_real, Real.norm_of_nonneg (by positivity)] rw [hpi] - exact le_max_of_le_right (by linarith [Real.pi_le_four]) + exact le_max_of_le_right (by linarith only [Real.pi_le_four]) · push Not at ht3 by_cases ht4 : t < 4 · rw [show deriv (fdBoundaryH H) t = _ from (fdBoundary_H_hasDerivAt_seg4 H diff --git a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/Framework.lean b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/Framework.lean index 129bb3b970..5c685617b9 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/Framework.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/Framework.lean @@ -125,7 +125,7 @@ private theorem pv_convert {γ : ℝ → ℂ} {a b : ℝ} {s : ℂ} {L : ℂ} Tendsto (fun ε => ∫ t in a..b, if (ε < ‖(γ t - s : ℂ) - 0‖) then (γ t - s)⁻¹ * deriv (fun t => γ t - s) t else 0) (nhdsWithin 0 (Ioi 0)) (nhds L) := by - simp_all + simp_all only [gt_iff_lt, sub_zero, deriv_sub_const_fun] /-- Master theorem: compute `generalizedWindingNumber'` from single-crossing data. diff --git a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/LeftEdge.lean b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/LeftEdge.lean index cc867f0ed9..5bbbae64d7 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/LeftEdge.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/LeftEdge.lean @@ -9,7 +9,6 @@ public import LeanPool.LeanModularForms.GeneralizedResidueTheory.Basic public import LeanPool.LeanModularForms.ValenceFormula.Boundary.Basic import LeanPool.LeanModularForms.ContourIntegral.CrossingLimit import LeanPool.LeanModularForms.ContourIntegral.WindingNumber -import LeanPool.LeanModularForms.ValenceFormula.Boundary.Bounds import LeanPool.LeanModularForms.ValenceFormula.Boundary.Smooth import LeanPool.LeanModularForms.ValenceFormula.Boundary.Winding.RightEdge import LeanPool.LeanModularForms.ValenceFormula.TrigLemmas @@ -37,12 +36,13 @@ noncomputable section private lemma leftEdge_t₀_mem_Ioo (H : ℝ) (_hH_sqrt : Real.sqrt 3 / 2 < H) (s : ℂ) (hs_im_lower : Real.sqrt 3 / 2 < s.im) (hs_im : s.im < H) : 3 + (s.im - Real.sqrt 3 / 2) / (H - Real.sqrt 3 / 2) ∈ Ioo (3 : ℝ) 4 := by - have hα_pos : 0 < H - Real.sqrt 3 / 2 := by linarith + have hα_pos : 0 < H - Real.sqrt 3 / 2 := by linarith only [hs_im_lower, hs_im] constructor - · linarith [div_pos (by linarith : (0 : ℝ) < s.im - Real.sqrt 3 / 2) hα_pos] + · linarith only [hs_im_lower, hα_pos, + div_pos (by linarith : (0 : ℝ) < s.im - Real.sqrt 3 / 2) hα_pos] · have : (s.im - Real.sqrt 3 / 2) / (H - Real.sqrt 3 / 2) < 1 := - (div_lt_one hα_pos).mpr (by linarith) - linarith + (div_lt_one hα_pos).mpr (by linarith only [hs_im]) + linarith only [this] private lemma leftEdge_h₃_eq {H : ℝ} {s : ℂ} (hs_re : s.re = -1 / 2) (t : ℝ) : fdBoundarySeg4H H t - s = @@ -61,7 +61,7 @@ private lemma leftEdge_dist_from_rightVertical (s : ℂ) (hs_re : s.re = -1 / 2) private lemma leftEdge_min_dist_pos (s : ℂ) (hs_norm : ‖s‖ > 1) (hs_im : s.im < H) : 0 < min (min (‖s‖ - 1) 1) (H - s.im) := - lt_min (lt_min (by linarith) one_pos) (by linarith) + lt_min (lt_min (by linarith only [hs_norm]) one_pos) (by linarith only [hs_im]) private lemma leftEdge_min_dist_from_non_seg4 (H : ℝ) (s : ℂ) (hs_re : s.re = -1 / 2) (_hs_norm : ‖s‖ > 1) (_hs_im : s.im < H) (t : ℝ) (ht_seg4_left : t ≤ 3) @@ -103,7 +103,8 @@ private lemma leftEdge_min_dist_from_non_seg4_right (H : ℝ) (s : ℂ) (_hs_re Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im] calc min (min (‖s‖ - 1) 1) (H - s.im) ≤ H - s.im := min_le_right _ _ - _ = |(fdBoundarySeg5H H t - s).im| := by rw [him]; exact (abs_of_pos (by linarith)).symm + _ = |(fdBoundarySeg5H H t - s).im| := by + rw [him]; exact (abs_of_pos (by linarith only [hs_im])).symm _ ≤ ‖fdBoundarySeg5H H t - s‖ := Complex.abs_im_le_norm _ private lemma leftEdge_final_log (H : ℝ) (s : ℂ) @@ -117,14 +118,14 @@ private lemma leftEdge_final_log (H : ℝ) (s : ℂ) have h_expand : (t₀ - δ - 3) * (H - Real.sqrt 3 / 2) = (t₀ - 3) * α - δ * α := by rw [hα_def]; ring have h_eq' : Real.sqrt 3 / 2 + (t₀ - δ - 3) * (H - Real.sqrt 3 / 2) - s.im = -(δ * α) := by - rw [h_expand]; linarith [ht₀_mul] + rw [h_expand]; linarith only [ht₀_mul] rw [h_eq'] have hval_plus : fdBoundarySeg4H H (t₀ + δ) - s = ↑(δ * α) * I := by rw [leftEdge_h₃_eq hs_re] have h_expand : (t₀ + δ - 3) * (H - Real.sqrt 3 / 2) = (t₀ - 3) * α + δ * α := by rw [hα_def]; ring have h_eq' : Real.sqrt 3 / 2 + (t₀ + δ - 3) * (H - Real.sqrt 3 / 2) - s.im = δ * α := by - rw [h_expand]; linarith [ht₀_mul] + rw [h_expand]; linarith only [ht₀_mul] rw [h_eq'] rw [hval_minus, hval_plus] rw [show (↑(-(δ * α)) * I : ℂ) = -(↑(δ * α) * I) from by push_cast; ring] @@ -144,8 +145,8 @@ private lemma leftEdge_slit_arc (s : ℂ) (hs_re : s.re = -1 / 2) exp (↑(Real.pi * (1 + t) / 6) * I) - s ∈ Complex.slitPlane := by rw [Complex.mem_slitPlane_iff] set θ := Real.pi * (1 + t) / 6 with hθ_def - have hθ_lower : Real.pi / 3 ≤ θ := by simp only [hθ_def]; nlinarith [Real.pi_pos] - have hθ_upper : θ ≤ 2 * Real.pi / 3 := by simp only [hθ_def]; nlinarith [Real.pi_pos] + have hθ_lower : Real.pi / 3 ≤ θ := by simp only [hθ_def]; nlinarith only [ht1, Real.pi_pos] + have hθ_upper : θ ≤ 2 * Real.pi / 3 := by simp only [hθ_def]; nlinarith only [ht3, Real.pi_pos] by_cases h3_eq : t = 3 · right subst h3_eq @@ -154,18 +155,20 @@ private lemma leftEdge_slit_arc (s : ℂ) (hs_re : s.re = -1 / 2) exp_real_angle_I, cos_two_pi_div_three, sin_two_pi_div_three] simp [Complex.sub_im, Complex.add_im, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_one, mul_zero, add_zero] - linarith [hs_im_lower] + linarith only [hs_im_lower] · left have ht3_strict : t < 3 := lt_of_le_of_ne ht3 h3_eq - have hθ_strict : θ < 2 * Real.pi / 3 := by simp only [hθ_def]; nlinarith [Real.pi_pos] + have hθ_strict : θ < 2 * Real.pi / 3 := by simp only [hθ_def]; nlinarith only [ht3_strict, + Real.pi_pos] change 0 < (cexp (↑θ * I) - s).re simp only [Complex.sub_re, exp_ofReal_mul_I_re] rw [hs_re] have hcos_gt : Real.cos θ > -(1 / 2) := by have h := Real.cos_lt_cos_of_nonneg_of_le_pi - (le_of_lt (by nlinarith [Real.pi_pos])) (by nlinarith [Real.pi_pos]) hθ_strict - rw [cos_two_pi_div_three] at h; linarith - linarith + (le_of_lt (by nlinarith only [hθ_lower, hθ_strict, Real.pi_pos])) (by + nlinarith only [hθ_lower, hθ_strict, Real.pi_pos]) hθ_strict + rw [cos_two_pi_div_three] at h; linarith only [h] + linarith only [hcos_gt] private lemma leftEdge_slit_seg4_left (H : ℝ) (s : ℂ) (hs_re : s.re = -1 / 2) (α : ℝ) (hα_def : α = H - Real.sqrt 3 / 2) (hα_pos : 0 < α) @@ -179,9 +182,10 @@ private lemma leftEdge_slit_seg4_left (H : ℝ) (s : ℂ) (hs_re : s.re = -1 / 2 simp only [Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_one, mul_zero, add_zero] have : (t - 3) * α < s.im - Real.sqrt 3 / 2 := by - nlinarith [mul_le_mul_of_nonneg_right (show t - 3 ≤ t₀ - δ' - 3 from by linarith) - (le_of_lt hα_pos), mul_pos hδ' hα_pos, ht₀_mul] - rw [hα_def] at this; intro h; linarith + nlinarith only [hα_pos, ht₀_mul, hδ', htd, + mul_le_mul_of_nonneg_right (show t - 3 ≤ t₀ - δ' - 3 from by linarith) (le_of_lt hα_pos), + mul_pos hδ' hα_pos] + rw [hα_def] at this; intro h; linarith only [this, h] private lemma leftEdge_slit_seg4_right (H : ℝ) (s : ℂ) (hs_re : s.re = -1 / 2) (α : ℝ) (hα_def : α = H - Real.sqrt 3 / 2) (hα_pos : 0 < α) @@ -195,9 +199,10 @@ private lemma leftEdge_slit_seg4_right (H : ℝ) (s : ℂ) (hs_re : s.re = -1 / simp only [Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_one, mul_zero, add_zero] have : (t - 3) * α > s.im - Real.sqrt 3 / 2 := by - nlinarith [mul_le_mul_of_nonneg_right (show t₀ + δ' - 3 ≤ t - 3 from by linarith) - (le_of_lt hα_pos), mul_pos hδ' hα_pos, ht₀_mul] - rw [hα_def] at this; intro h; linarith + nlinarith only [hα_pos, ht₀_mul, hδ', htd, + mul_le_mul_of_nonneg_right (show t₀ + δ' - 3 ≤ t - 3 from by linarith) (le_of_lt hα_pos), + mul_pos hδ' hα_pos] + rw [hα_def] at this; intro h; linarith only [this, h] private lemma leftEdge_slit_seg5 (H : ℝ) (s : ℂ) (hs_re : s.re = -1 / 2) (hs_im : s.im < H) (t : ℝ) (ht4 : 4 ≤ t) (ht5 : t ≤ 5) : @@ -244,8 +249,9 @@ private lemma leftEdge_norm_gt_of_seg4_right (H : ℝ) (s : ℂ) (hs_re : s.re = rw [norm_mul, Complex.norm_real, Complex.norm_I, mul_one, Real.norm_eq_abs, show H - Real.sqrt 3 / 2 = α from hα_def.symm] have hε_eq : ε = δ * α := by rw [hδ_def]; exact (div_mul_cancel₀ ε (ne_of_gt hα_pos)).symm - have h_im_pos : Real.sqrt 3 / 2 + (t - 3) * α - s.im > 0 := by nlinarith [ht₀_mul] - rw [abs_of_pos h_im_pos]; nlinarith [ht₀_mul] + have h_im_pos : Real.sqrt 3 / 2 + (t - 3) * α - s.im > 0 := by + nlinarith only [hα_pos, ht₀_mul, hδ_pos, ht_gt_t₀pδ] + rw [abs_of_pos h_im_pos]; nlinarith only [hα_pos, ht₀_mul, ht_gt_t₀pδ, hε_eq] private lemma leftEdge_norm_le_of_near_crossing (H : ℝ) (s : ℂ) (hs_re : s.re = -1 / 2) (α : ℝ) (hα_pos : 0 < α) (hα_def : α = H - Real.sqrt 3 / 2) @@ -254,16 +260,17 @@ private lemma leftEdge_norm_le_of_near_crossing (H : ℝ) (s : ℂ) (hs_re : s.r (hδ_lt_t₀m3 : δ < t₀ - 3) (hεα_lt_4mt₀ : δ < 4 - t₀) (t : ℝ) (ht_mem : t ∈ Ioc (t₀ - δ) (t₀ + δ)) : ‖fdBoundaryH H t - s‖ ≤ ε := by - rw [fdBoundary_H_eq_seg4_H (by linarith [ht_mem.1]) (by linarith [ht_mem.2])] + rw [fdBoundary_H_eq_seg4_H (by linarith only [hδ_lt_t₀m3, ht_mem, ht_mem.1]) (by + linarith only [hεα_lt_4mt₀, ht_mem, ht_mem.2])] rw [leftEdge_h₃_eq hs_re] rw [norm_mul, Complex.norm_real, Complex.norm_I, mul_one, Real.norm_eq_abs, abs_le, show H - Real.sqrt 3 / 2 = α from hα_def.symm] have hε_eq : ε = δ * α := by rw [hδ_def]; exact (div_mul_cancel₀ ε (ne_of_gt hα_pos)).symm have h_tα_upper : (t - 3) * α ≤ (t₀ + δ - 3) * α := - mul_le_mul_of_nonneg_right (by linarith [ht_mem.2]) (le_of_lt hα_pos) + mul_le_mul_of_nonneg_right (by linarith only [ht_mem, ht_mem.2]) (le_of_lt hα_pos) have h_tα_lower : (t₀ - δ - 3) * α < (t - 3) * α := - mul_lt_mul_of_pos_right (by linarith [ht_mem.1]) hα_pos - constructor <;> nlinarith [ht₀_mul] + mul_lt_mul_of_pos_right (by linarith only [ht_mem, ht_mem.1]) hα_pos + constructor <;> nlinarith only [ht₀_mul, hε_eq, h_tα_lower, h_tα_upper] /-- From `t` in the open-interval `uIoc a b` minus its endpoints, get strict bounds. -/ private lemma mem_Ioo_of_uIoc_sdiff_endpoints {a b t : ℝ} (hab : a ≤ b) @@ -302,7 +309,10 @@ private lemma leftEdge_ae_seg_eq (g h₀ h_arc h₃ h₅ : ℝ → ℂ) · intro a b ha_ge hab hb4 filter_upwards [ae_endpoints_compl a b] with t ht_ne ht_mem obtain ⟨ht_gt_a, ht_lt_b⟩ := mem_Ioo_of_uIoc_sdiff_endpoints (le_of_lt hab) ht_ne ht_mem - rw [hg_h₃ t (by linarith) (by linarith), hderiv_3 t ⟨by linarith, by linarith⟩] + rw [hg_h₃ t (by linarith only [ha_ge, ht_gt_a]) + (by linarith only [hb4, ht_lt_b]), hderiv_3 t ⟨by + linarith only [ha_ge, ht_gt_a], by + linarith only [hb4, ht_lt_b]⟩] · filter_upwards [ae_endpoints_compl 4 5] with t ht_ne ht_mem obtain ⟨ht4, ht5⟩ := mem_Ioo_of_uIoc_sdiff_endpoints (by norm_num) ht_ne ht_mem rw [hg_h₅ t ht4, hderiv_5 t ⟨ht4, ht5⟩] @@ -319,13 +329,14 @@ private lemma leftEdge_norm_gt_left (H : ℝ) (s : ℂ) (hs_re : s.re = -1 / 2) set d := min (min (‖s‖ - 1) 1) (H - s.im) by_cases ht3 : t ≤ 3 · have : d ≤ ‖fdBoundaryH H t - s‖ := - leftEdge_min_dist_from_non_seg4 H s hs_re hs_norm hs_im t ht3 (by linarith) - linarith [hε_lt_d] + leftEdge_min_dist_from_non_seg4 H s hs_re hs_norm hs_im t ht3 (by + linarith only [ht₀_lt4, hδ_pos, hεα_lt_t₀m3, ht3]) + linarith only [hε_lt_d, this] · push Not at ht3 have ht_lt_t₀mδ : t < t₀ - δ := lt_of_le_of_ne ht_mem.2 ht_ne_right exact leftEdge_norm_gt_of_seg4_left H s hs_re α hα_pos hα_def t₀ ht₀_mul ε δ hδ_pos - hδ_def t ht3 (by linarith [ht_mem.2]) ht_lt_t₀mδ + hδ_def t ht3 (by linarith only [ht₀_lt4, hδ_pos, ht_lt_t₀mδ, ht_mem.2]) ht_lt_t₀mδ private lemma leftEdge_norm_gt_right (H : ℝ) (s : ℂ) (hs_re : s.re = -1 / 2) (hs_norm : ‖s‖ > 1) (hs_im : s.im < H) @@ -340,11 +351,11 @@ private lemma leftEdge_norm_gt_right (H : ℝ) (s : ℂ) (hs_re : s.re = -1 / 2) set d := min (min (‖s‖ - 1) 1) (H - s.im) by_cases ht4 : t ≤ 4 · exact leftEdge_norm_gt_of_seg4_right H s hs_re α hα_pos hα_def t₀ ht₀_mul ε δ hδ_pos - hδ_def t (by linarith [ht_mem.1]) ht4 ht_mem.1 + hδ_def t (by linarith only [ht₀_gt3, hδ_pos, ht_mem, ht_mem.1]) ht4 ht_mem.1 · push Not at ht4 have : d ≤ ‖fdBoundaryH H t - s‖ := leftEdge_min_dist_from_non_seg4_right H s hs_re hs_norm hs_im t ht4 ht_mem.2 - linarith [hε_lt_d] + linarith only [hε_lt_d, this] private lemma leftEdge_h_far (H : ℝ) (_hH_sqrt : Real.sqrt 3 / 2 < H) (s : ℂ) (hs_re : s.re = -1 / 2) (hs_norm : ‖s‖ > 1) (hs_im : s.im < H) @@ -371,9 +382,10 @@ private lemma leftEdge_h_far (H : ℝ) (_hH_sqrt : Real.sqrt 3 / 2 < H) rcases eq_or_lt_of_le ht_mem.1 with h_t0 | h_t0 · -- t = 0: use min_dist bound directly (seg1 case) have : min (min (‖s‖ - 1) 1) (H - s.im) ≤ ‖fdBoundaryH H t - s‖ := - leftEdge_min_dist_from_non_seg4 H s hs_re hs_norm hs_im t (by linarith [h_left, - hεα_lt_t₀m3]) (by linarith [h_left, hεα_lt_4mt₀]) - linarith [hε_lt_d] + leftEdge_min_dist_from_non_seg4 H s hs_re hs_norm hs_im t (by + linarith only [hδ_pos, hεα_lt_t₀m3, hεα_lt_4mt₀, h_t0, h_left]) + (by linarith only [hδ_pos, hεα_lt_t₀m3, hεα_lt_4mt₀, h_t0, h_left]) + linarith only [hthresh_le_d, hε_lt, this, hε_lt_d] · apply leftEdge_norm_gt_left H s hs_re hs_norm hs_im α hα_pos hα_def t₀ ht₀_lt4 ht₀_mul ε hε_pos (ε / α) hδ_pos rfl hεα_lt_t₀m3 hε_lt_d t ⟨h_t0, le_of_lt h_left⟩ exact ne_of_lt h_left @@ -382,9 +394,9 @@ private lemma leftEdge_h_far (H : ℝ) (_hH_sqrt : Real.sqrt 3 / 2 < H) have ht_gt : t₀ + ε / α < t := by rcases le_or_gt t₀ t with h | h · -- t ≥ t₀, so |t₀ - t| = t - t₀ > ε/α - rw [abs_of_nonpos (by linarith)] at h_abs; linarith + rw [abs_of_nonpos (by linarith only [h])] at h_abs; linarith only [h_abs] · -- t < t₀, so |t₀ - t| = t₀ - t ≤ ε/α (from h_right), but h_abs says > ε/α - rw [abs_of_pos (by linarith)] at h_abs; linarith + rw [abs_of_pos (by linarith only [h])] at h_abs; linarith only [h_abs, h_right] apply leftEdge_norm_gt_right H s hs_re hs_norm hs_im α hα_pos hα_def t₀ ht₀_gt3 ht₀_lt4 ht₀_mul ε hε_pos (ε / α) hδ_pos rfl hεα_lt_4mt₀ hε_lt_d t ⟨ht_gt, ht_mem.2⟩ @@ -405,22 +417,23 @@ private lemma leftEdge_h_near (H : ℝ) (_hH_sqrt : Real.sqrt 3 / 2 < H) have hεα_lt_4mt₀ : ε / α < 4 - t₀ := (div_lt_iff₀ hα_pos).mpr (_hε_lt.trans_le hthresh_le_4mt₀α) rw [abs_le] at h_abs - have ht_lower : t₀ - ε / α ≤ t := by linarith [h_abs.1] - have ht_upper : t ≤ t₀ + ε / α := by linarith [h_abs.2] + have ht_lower : t₀ - ε / α ≤ t := by linarith only [h_abs, h_abs.1] + have ht_upper : t ≤ t₀ + ε / α := by linarith only [h_abs, h_abs.2] rcases eq_or_lt_of_le ht_lower with h_eq | h_lt · -- t = t₀ - δ: boundary case rw [← h_eq] - rw [fdBoundary_H_eq_seg4_H (by linarith [hεα_lt_t₀m3]) (by linarith [hεα_lt_4mt₀]), + rw [fdBoundary_H_eq_seg4_H (by linarith only [hεα_lt_t₀m3]) (by + linarith only [hδ_pos, hεα_lt_4mt₀]), leftEdge_h₃_eq hs_re] simp only [norm_mul, Complex.norm_real, Complex.norm_I, mul_one, Real.norm_eq_abs] have hea : ε / α * α = ε := div_mul_cancel₀ ε (ne_of_gt hα_pos) have hα_eq : H - Real.sqrt 3 / 2 = α := hα_def.symm have key : Real.sqrt 3 / 2 + (t₀ - ε / α - 3) * α - s.im = -(ε / α) * α := by have expand : (t₀ - ε / α - 3) * α = (t₀ - 3) * α - ε / α * α := by ring - linarith [ht₀_mul] + linarith only [ht₀_mul] have : Real.sqrt 3 / 2 + (t₀ - ε / α - 3) * (H - Real.sqrt 3 / 2) - s.im = -(ε / α) * α := by rw [hα_eq]; exact key - rw [this, show (-(ε / α) * α) = -ε from by linarith [neg_mul (ε / α) α, hea], + rw [this, show (-(ε / α) * α) = -ε from by linarith only [hea, neg_mul (ε / α) α], abs_neg, abs_of_pos hε_pos] · exact leftEdge_norm_le_of_near_crossing H s hs_re α hα_pos hα_def t₀ ht₀_gt3 ht₀_mul ε (ε / α) hδ_def hεα_lt_t₀m3 hεα_lt_4mt₀ t ⟨h_lt, ht_upper⟩ @@ -634,7 +647,7 @@ private lemma leftEdge_winding_aux (H : ℝ) (hH_sqrt : Real.sqrt 3 / 2 < H) (fdBoundaryH H t - s)⁻¹ * deriv (fdBoundaryH H) t else 0) (𝓝[>] 0) (𝓝 (-(↑Real.pi * I))) := by set α := H - Real.sqrt 3 / 2 with hα_def - have hα_pos : 0 < α := by rw [hα_def]; linarith + have hα_pos : 0 < α := by rw [hα_def]; linarith only [hs_im_lower, hs_im] set t₀ := 3 + (s.im - Real.sqrt 3 / 2) / α with ht₀_def have ht₀_Ioo := leftEdge_t₀_mem_Ioo H hH_sqrt s hs_im_lower hs_im have ht₀_gt3 : 3 < t₀ := ht₀_Ioo.1 @@ -646,7 +659,8 @@ private lemma leftEdge_winding_aux (H : ℝ) (hH_sqrt : Real.sqrt 3 / 2 < H) -- Choose threshold small enough for all bounds set threshold := min d (min ((t₀ - 3) * α) ((4 - t₀) * α)) have hthresh_pos : 0 < threshold := lt_min hd_pos - (lt_min (mul_pos (by linarith) hα_pos) (mul_pos (by linarith) hα_pos)) + (lt_min (mul_pos (sub_pos.mpr ht₀_gt3) hα_pos) + (mul_pos (sub_pos.mpr ht₀_lt4) hα_pos)) have hthresh_le_d : threshold ≤ d := min_le_left _ _ have hthresh_le_t₀m3α : threshold ≤ (t₀ - 3) * α := (min_le_right _ _).trans (min_le_left _ _) @@ -660,8 +674,10 @@ private lemma leftEdge_winding_aux (H : ℝ) (hH_sqrt : Real.sqrt 3 / 2 < H) intro ε hε_pos hε_lt simp only [sub_zero] exact lt_min - (by rw [div_lt_iff₀ hα_pos]; nlinarith [hε_lt.trans_le hthresh_le_t₀m3α]) - (by rw [div_lt_iff₀ hα_pos]; nlinarith [hε_lt.trans_le hthresh_le_4mt₀α]) + (by rw [div_lt_iff₀ hα_pos]; nlinarith only [hthresh_le_t₀m3α, hthresh_le_4mt₀α, hε_pos, + hε_lt, hε_lt.trans_le hthresh_le_t₀m3α]) + (by rw [div_lt_iff₀ hα_pos]; nlinarith only [hthresh_le_t₀m3α, hthresh_le_4mt₀α, hε_pos, + hε_lt, hε_lt.trans_le hthresh_le_4mt₀α]) have hd : ∀ t, deriv (fun u => fdBoundaryH H u - s) t = deriv (fdBoundaryH H) t := fun t => deriv_sub_const (f := fdBoundaryH H) _ have hftc := fun ε (hε_pos : 0 < ε) (hε_lt : ε < threshold) => @@ -670,7 +686,7 @@ private lemma leftEdge_winding_aux (H : ℝ) (hH_sqrt : Real.sqrt 3 / 2 < H) ε hε_pos hε_lt -- Apply pv_tendsto_of_crossing_limit refine ContourIntegral.pv_tendsto_of_crossing_limit - (t₀ := t₀) (ht₀ := ⟨by linarith, by linarith⟩) + (t₀ := t₀) (ht₀ := ⟨by linarith only [ht₀_gt3, ht₀_lt4], by linarith only [ht₀_gt3, ht₀_lt4]⟩) (threshold := threshold) (hthresh := hthresh_pos) (δ := fun ε => ε / α) (E := fun ε => Complex.log (fdBoundarySeg4H H (t₀ - ε / α) - s) - @@ -690,11 +706,17 @@ private lemma leftEdge_winding_aux (H : ℝ) (hH_sqrt : Real.sqrt 3 / 2 < H) exact leftEdge_h_near H hH_sqrt s hs_re α hα_pos hα_def t₀ ht₀_gt3 ht₀_lt4 ht₀_mul threshold hthresh_le_t₀m3α hthresh_le_4mt₀α ε hε_pos hε_lt · -- h_ftc: far integrals = E(ε) - simp_all + simp_all only [gt_iff_lt, sub_pos, mem_Ioo, lt_add_iff_pos_right, div_pos_iff_of_pos_left, + true_and, + add_sub_cancel_left, implies_true, sub_zero, lt_min_iff, deriv_sub_const_fun] · -- hint_left - simp_all + simp_all only [gt_iff_lt, sub_pos, mem_Ioo, lt_add_iff_pos_right, div_pos_iff_of_pos_left, + true_and, + add_sub_cancel_left, implies_true, sub_zero, lt_min_iff, deriv_sub_const_fun] · -- hint_right - simp_all + simp_all only [gt_iff_lt, sub_pos, mem_Ioo, lt_add_iff_pos_right, div_pos_iff_of_pos_left, + true_and, + add_sub_cancel_left, implies_true, sub_zero, lt_min_iff, deriv_sub_const_fun] · -- h_limit: E(ε) → L -- E(ε) = log(h₃(t₀ - ε/α)) - log(h₃(t₀ + ε/α)) = -(π*I) constantly have hE_const : ∀ ε, 0 < ε → ε < threshold → @@ -713,6 +735,6 @@ theorem gWN_fdBoundary_H_eq_neg_half_of_leftEdge (H : ℝ) (hH_sqrt : Real.sqrt generalizedWindingNumber' (fdBoundaryH H) 0 5 s = -1/2 := by apply ContourIntegral.gWN_eq_neg_half_of_pv_tendsto have h_tendsto := leftEdge_winding_aux H hH_sqrt s hs_re hs_norm hs_im_lower hs_im - simp_all + simp_all only [gt_iff_lt, sub_zero, deriv_sub_const_fun] end diff --git a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/RightEdge.lean b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/RightEdge.lean index 893745c307..cf84bf502a 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/RightEdge.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/RightEdge.lean @@ -10,7 +10,6 @@ public import LeanPool.LeanModularForms.ValenceFormula.Boundary.Basic import LeanPool.LeanModularForms.ContourIntegral.CrossingLimit import LeanPool.LeanModularForms.ContourIntegral.WindingNumber import LeanPool.LeanModularForms.GeneralizedResidueTheory.LogDerivFTC -import LeanPool.LeanModularForms.ValenceFormula.Boundary.Bounds import LeanPool.LeanModularForms.ValenceFormula.Boundary.Smooth import LeanPool.LeanModularForms.ValenceFormula.TrigLemmas import LeanPool.LeanModularForms.ValenceFormula.WindingWeights.Common @@ -40,9 +39,10 @@ lemma rightEdge_t₀_mem_Ioo (H : ℝ) (_hH : heightCutoff ≤ H) (s : ℂ) (hs_im_lower : Real.sqrt 3 / 2 < s.im) (hs_im : s.im < H) : (H - s.im) / (H - Real.sqrt 3 / 2) ∈ Ioo (0 : ℝ) 1 := by have hH_sqrt : Real.sqrt 3 / 2 < H := by - have : heightCutoff = Real.sqrt 3 / 2 + 1 := rfl; linarith - have hα_pos : 0 < H - Real.sqrt 3 / 2 := by linarith - exact ⟨div_pos (by linarith) hα_pos, by rw [div_lt_one hα_pos]; linarith⟩ + have : heightCutoff = Real.sqrt 3 / 2 + 1 := rfl; linarith only [hs_im_lower, hs_im] + have hα_pos : 0 < H - Real.sqrt 3 / 2 := by linarith only [hs_im_lower, hs_im] + exact ⟨div_pos (by linarith only [hs_im]) hα_pos, + by rw [div_lt_one hα_pos]; linarith only [hs_im_lower]⟩ /-- `fdBoundaryH H` passes through `s` at parameter `t₀`. -/ lemma rightEdge_fdBoundary_eq (H : ℝ) (s : ℂ) @@ -50,19 +50,19 @@ lemma rightEdge_fdBoundary_eq (H : ℝ) (s : ℂ) let t₀ := (H - s.im) / (H - Real.sqrt 3 / 2) fdBoundaryH H t₀ = s := by intro t₀ - have hH_sqrt : Real.sqrt 3 / 2 < H := by linarith - have hden_pos : 0 < H - Real.sqrt 3 / 2 := by linarith - have ht₀_le : t₀ ≤ 1 := by rw [div_le_one hden_pos]; linarith + have hH_sqrt : Real.sqrt 3 / 2 < H := by linarith only [hs_im_lower, hs_im] + have hden_pos : 0 < H - Real.sqrt 3 / 2 := by linarith only [hs_im_lower, hs_im] + have ht₀_le : t₀ ≤ 1 := by rw [div_le_one hden_pos]; linarith only [hs_im_lower] simp only [fdBoundaryH, ht₀_le, ↓reduceIte] apply Complex.ext · simp [Complex.add_re, Complex.mul_re, Complex.ofReal_re, Complex.I_re, Complex.I_im] - linarith [hs_re] + linarith only [hs_re] · simp only [one_div, add_im, inv_im, im_ofNat, neg_zero, normSq_ofNat, zero_div, mul_im, sub_re, ofReal_re, mul_re, div_ofNat_re, ofReal_im, sub_im, div_ofNat_im, sub_self, mul_zero, sub_zero, I_im, mul_one, zero_mul, add_zero, I_re, zero_add] have h_cancel : (H - s.im) / (H - Real.sqrt 3 / 2) * (H - Real.sqrt 3 / 2) = H - s.im := div_mul_cancel₀ (H - s.im) (ne_of_gt hden_pos) - linarith + linarith only [h_cancel] /-- The right edge parameter `t₀` is the UNIQUE crossing point on `[0, 5]`. -/ lemma rightEdge_unique_crossing (H : ℝ) (_hH : heightCutoff ≤ H) (s : ℂ) @@ -72,8 +72,8 @@ lemma rightEdge_unique_crossing (H : ℝ) (_hH : heightCutoff ≤ H) (s : ℂ) ∀ t ∈ Icc (0 : ℝ) 5, fdBoundaryH H t = s → t = t₀ := by intro t₀ t ht hs_eq have hH_sqrt : Real.sqrt 3 / 2 < H := by - have : heightCutoff = Real.sqrt 3 / 2 + 1 := rfl; linarith - have hden_pos : 0 < H - Real.sqrt 3 / 2 := by linarith + have : heightCutoff = Real.sqrt 3 / 2 + 1 := rfl; linarith only [hs_im_lower, hs_im] + have hden_pos : 0 < H - Real.sqrt 3 / 2 := by linarith only [hs_im_lower, hs_im] by_cases h1 : t ≤ 1 · simp only [fdBoundaryH, h1, ↓reduceIte] at hs_eq have him := congr_arg Complex.im hs_eq @@ -81,9 +81,9 @@ lemma rightEdge_unique_crossing (H : ℝ) (_hH : heightCutoff ≤ H) (s : ℂ) ofReal_re, mul_re, div_ofNat_re, ofReal_im, sub_im, div_ofNat_im, sub_self, mul_zero, sub_zero, I_im, mul_one, zero_mul, add_zero, I_re, zero_add] at him change t = (H - s.im) / (H - Real.sqrt 3 / 2) - have h_eq : t * (H - Real.sqrt 3 / 2) = H - s.im := by linarith + have h_eq : t * (H - Real.sqrt 3 / 2) = H - s.im := by linarith only [him] rw [eq_div_iff (ne_of_gt hden_pos)] - linarith + linarith only [him] · push Not at h1 by_cases h2 : t ≤ 2 · simp only [fdBoundaryH, show ¬(t ≤ 1) from not_le.mpr h1, ↓reduceIte, h2] at hs_eq @@ -92,7 +92,7 @@ lemma rightEdge_unique_crossing (H : ℝ) (_hH : heightCutoff ≤ H) (s : ℂ) rw [show (↑π / 3 + (↑t - 1) * (↑π / 2 - ↑π / 3)) * I = ↑(π / 3 + (t - 1) * (π / 2 - π / 3)) * I from by push_cast; ring] exact Complex.norm_exp_ofReal_mul_I _ - linarith + linarith only [hs_norm, this] · push Not at h2 by_cases h3 : t ≤ 3 · simp only [fdBoundaryH, show ¬(t ≤ 1) from not_le.mpr h1, ↓reduceIte, @@ -102,7 +102,7 @@ lemma rightEdge_unique_crossing (H : ℝ) (_hH : heightCutoff ≤ H) (s : ℂ) rw [show (↑π / 2 + (↑t - 2) * (2 * ↑π / 3 - ↑π / 2)) * I = ↑(π / 2 + (t - 2) * (2 * π / 3 - π / 2)) * I from by push_cast; ring] exact Complex.norm_exp_ofReal_mul_I _ - linarith + linarith only [hs_norm, this] · push Not at h3 by_cases h4 : t ≤ 4 · simp only [fdBoundaryH, show ¬(t ≤ 1) from not_le.mpr h1, ↓reduceIte, @@ -111,7 +111,7 @@ lemma rightEdge_unique_crossing (H : ℝ) (_hH : heightCutoff ≤ H) (s : ℂ) have hre := congr_arg Complex.re hs_eq simp [Complex.add_re, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im] at hre - linarith [hs_re] + linarith only [hs_re, hre] · push Not at h4 simp only [fdBoundaryH, show ¬(t ≤ 1) from not_le.mpr h1, ↓reduceIte, show ¬(t ≤ 2) from not_le.mpr h2, @@ -120,7 +120,7 @@ lemma rightEdge_unique_crossing (H : ℝ) (_hH : heightCutoff ≤ H) (s : ℂ) have him := congr_arg Complex.im hs_eq simp [Complex.add_im, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im] at him - linarith + linarith only [hs_im, him] /-- Points on seg2/seg3 (unit circle) are at distance ≥ ‖s‖ - 1 from s. -/ lemma rightEdge_dist_from_arc (s : ℂ) (z : ℂ) (hz : ‖z‖ = 1) : @@ -142,7 +142,7 @@ lemma rightEdge_dist_from_leftVertical (s : ℂ) (hs_re : s.re = 1 / 2) (z : ℂ lemma rightEdge_dist_from_horizontal (s : ℂ) (hs_im : s.im < H) (z : ℂ) (hz_im : z.im = H) : H - s.im ≤ ‖z - s‖ := by have him : (z - s).im = H - s.im := by simp [Complex.sub_im, hz_im] - calc H - s.im = |(z - s).im| := by rw [him]; rw [abs_of_pos (by linarith)] + calc H - s.im = |(z - s).im| := by rw [him]; rw [abs_of_pos (by linarith only [hs_im])] _ ≤ ‖z - s‖ := abs_im_le_norm (z - s) /-- Minimum distance from s (on right edge) to the non-seg1 parts of the boundary. -/ @@ -186,7 +186,7 @@ lemma log_div_of_re_pos {a b : ℂ} (ha : 0 < a.re) (hb : 0 < b.re) : have hb_inv_ne : b⁻¹ ≠ 0 := inv_ne_zero hb_ne rw [div_eq_mul_inv] have hb_arg_ne_pi : b.arg ≠ Real.pi := by - intro h; have := Complex.arg_eq_pi_iff.mp h; linarith [this.1] + intro h; have := Complex.arg_eq_pi_iff.mp h; linarith only [hb, this, this.1] have hb_inv_arg : b⁻¹.arg = -b.arg := by rw [Complex.arg_inv]; simp [hb_arg_ne_pi] have ha_abs_arg : |a.arg| < Real.pi / 2 := Complex.abs_arg_lt_pi_div_two_iff.mpr (Or.inl ha) @@ -194,8 +194,8 @@ lemma log_div_of_re_pos {a b : ℂ} (ha : 0 < a.re) (hb : 0 < b.re) : Complex.abs_arg_lt_pi_div_two_iff.mpr (Or.inl hb) have hbi_abs_arg : |b⁻¹.arg| < Real.pi / 2 := by rw [hb_inv_arg, abs_neg]; exact hb_abs_arg have h_sum : a.arg + b⁻¹.arg ∈ Set.Ioc (-Real.pi) Real.pi := - ⟨by linarith [abs_lt.mp ha_abs_arg, abs_lt.mp hbi_abs_arg], - by linarith [abs_lt.mp ha_abs_arg, abs_lt.mp hbi_abs_arg]⟩ + ⟨by linarith only [ha_abs_arg, hbi_abs_arg, abs_lt.mp ha_abs_arg, abs_lt.mp hbi_abs_arg], + by linarith only [ha_abs_arg, hbi_abs_arg, abs_lt.mp ha_abs_arg, abs_lt.mp hbi_abs_arg]⟩ rw [Complex.log_mul ha_ne hb_inv_ne h_sum, Complex.log_inv b hb_arg_ne_pi]; ring private lemma rightEdge_h₀_eq {H : ℝ} {s : ℂ} (hs_re : s.re = 1 / 2) (t : ℝ) : @@ -261,7 +261,7 @@ private lemma rightEdge_min_dist_from_non_seg1 (H : ℝ) (s : ℂ) rw [neg_sub_norm] by_cases h2 : t ≤ 2 · exact rightEdge_min_dist_from_non_seg1_arc s hs_norm _ - (norm_fdBoundary_H_arc H t ht1 (by linarith)) + (norm_fdBoundary_H_arc H t ht1 (by linarith only [h2])) · push Not at h2 by_cases h3 : t < 3 · exact rightEdge_min_dist_from_non_seg1_arc s hs_norm _ @@ -309,19 +309,20 @@ private lemma rightEdge_ae_seg_eq (g h₀ h_arc h₃ h₅ : ℝ → ℂ) rw [Set.uIoc_of_le (le_of_lt hab)] at ht have ht_lt_b : t < b := lt_of_le_of_ne ht.2 (fun h => ht_ne (Set.mem_singleton_iff.mpr h)) have ht_lt1 : t < 1 := lt_of_lt_of_le ht_lt_b hb1 - rw [hg_h₀ t (le_of_lt ht_lt1), hderiv_01 t ⟨by linarith [ht.1], ht_lt1⟩] + rw [hg_h₀ t (le_of_lt ht_lt1), hderiv_01 t ⟨by linarith only [_ha_nn, ht, ht.1], ht_lt1⟩] · have : ({1, 3} : Set ℝ)ᶜ ∈ ae volume := mem_ae_iff.mpr (by rw [compl_compl]; exact (Set.toFinite ({1, 3} : Set ℝ)).measure_zero volume) filter_upwards [this] with t ht_ne ht_mem rw [Set.uIoc_of_le (by norm_num : (1 : ℝ) ≤ 3)] at ht_mem have ht1 : 1 < t := by rcases eq_or_lt_of_le (le_of_lt ht_mem.1) with h | h - · exfalso; exact ht_ne (Set.mem_insert_iff.mpr (Or.inl (by linarith))) + · exfalso; exact ht_ne (Set.mem_insert_iff.mpr (Or.inl (by linarith only [h]))) · exact h have ht3 : t < 3 := by rcases eq_or_lt_of_le ht_mem.2 with h | h · exfalso - exact ht_ne (Set.mem_insert_iff.mpr (Or.inr (Set.mem_singleton_iff.mpr (by linarith)))) + exact ht_ne (Set.mem_insert_iff.mpr (Or.inr (Set.mem_singleton_iff.mpr (by + linarith only [h])))) · exact h rw [hg_arc t ht1 ht3, hderiv_arc t ⟨ht1, ht3⟩] · have : ({3, 4} : Set ℝ)ᶜ ∈ ae volume := mem_ae_iff.mpr (by @@ -330,12 +331,13 @@ private lemma rightEdge_ae_seg_eq (g h₀ h_arc h₃ h₅ : ℝ → ℂ) rw [Set.uIoc_of_le (by norm_num : (3 : ℝ) ≤ 4)] at ht_mem have ht3 : 3 < t := by rcases eq_or_lt_of_le (le_of_lt ht_mem.1) with h | h - · exfalso; exact ht_ne (Set.mem_insert_iff.mpr (Or.inl (by linarith))) + · exfalso; exact ht_ne (Set.mem_insert_iff.mpr (Or.inl (by linarith only [h]))) · exact h have ht4 : t < 4 := by rcases eq_or_lt_of_le ht_mem.2 with h | h · exfalso - exact ht_ne (Set.mem_insert_iff.mpr (Or.inr (Set.mem_singleton_iff.mpr (by linarith)))) + exact ht_ne (Set.mem_insert_iff.mpr (Or.inr (Set.mem_singleton_iff.mpr (by + linarith only [h])))) · exact h rw [hg_h₃ t ht3 (le_of_lt ht4), hderiv_3 t ⟨ht3, ht4⟩] · have : ({4, 5} : Set ℝ)ᶜ ∈ ae volume := mem_ae_iff.mpr (by @@ -344,12 +346,13 @@ private lemma rightEdge_ae_seg_eq (g h₀ h_arc h₃ h₅ : ℝ → ℂ) rw [Set.uIoc_of_le (by norm_num : (4 : ℝ) ≤ 5)] at ht_mem have ht4 : 4 < t := by rcases eq_or_lt_of_le (le_of_lt ht_mem.1) with h | h - · exfalso; exact ht_ne (Set.mem_insert_iff.mpr (Or.inl (by linarith))) + · exfalso; exact ht_ne (Set.mem_insert_iff.mpr (Or.inl (by linarith only [h]))) · exact h have ht5 : t < 5 := by rcases eq_or_lt_of_le ht_mem.2 with h | h · exfalso - exact ht_ne (Set.mem_insert_iff.mpr (Or.inr (Set.mem_singleton_iff.mpr (by linarith)))) + exact ht_ne (Set.mem_insert_iff.mpr (Or.inr (Set.mem_singleton_iff.mpr (by + linarith only [h])))) · exact h rw [hg_h₅ t ht4, hderiv_5 t ⟨ht4, ht5⟩] @@ -389,15 +392,16 @@ private lemma rightEdge_neg_seg1_slitPlane_left (H : ℝ) (s : ℂ) (hs_re : s.r (ht₀_mul : t₀ * (H - Real.sqrt 3 / 2) = H - s.im) (t : ℝ) (_ht0 : 0 ≤ t) (htd : t ≤ t₀ - δ') : -(fdBoundarySeg1H H t - s) ∈ Complex.slitPlane := by - have hα_pos : 0 < H - Real.sqrt 3 / 2 := by linarith + have hα_pos : 0 < H - Real.sqrt 3 / 2 := by linarith only [hH_sqrt] rw [Complex.mem_slitPlane_iff]; right rw [rightEdge_h₀_eq hs_re] simp only [Complex.neg_im, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_one, mul_zero, add_zero] have : t * (H - Real.sqrt 3 / 2) < H - s.im := by - nlinarith [mul_le_mul_of_nonneg_right htd (le_of_lt hα_pos), mul_pos hδ' hα_pos] - intro h; linarith + nlinarith only [hδ', ht₀_mul, htd, hα_pos, mul_le_mul_of_nonneg_right htd (le_of_lt hα_pos), + mul_pos hδ' hα_pos] + intro h; linarith only [this, h] private lemma rightEdge_neg_seg1_slitPlane_right (H : ℝ) (s : ℂ) (hs_re : s.re = 1 / 2) (_hs_im : s.im < H) (hH_sqrt : Real.sqrt 3 / 2 < H) @@ -405,15 +409,16 @@ private lemma rightEdge_neg_seg1_slitPlane_right (H : ℝ) (s : ℂ) (hs_re : s. (ht₀_mul : t₀ * (H - Real.sqrt 3 / 2) = H - s.im) (t : ℝ) (htd : t₀ + δ' ≤ t) (_ht1 : t ≤ 1) : -(fdBoundarySeg1H H t - s) ∈ Complex.slitPlane := by - have hα_pos : 0 < H - Real.sqrt 3 / 2 := by linarith + have hα_pos : 0 < H - Real.sqrt 3 / 2 := by linarith only [hH_sqrt] rw [Complex.mem_slitPlane_iff]; right rw [rightEdge_h₀_eq hs_re] simp only [Complex.neg_im, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_one, mul_zero, add_zero] have : t * (H - Real.sqrt 3 / 2) > H - s.im := by - nlinarith [mul_le_mul_of_nonneg_right htd (le_of_lt hα_pos), mul_pos hδ' hα_pos] - intro h; linarith + nlinarith only [hδ', ht₀_mul, htd, hα_pos, mul_le_mul_of_nonneg_right htd (le_of_lt hα_pos), + mul_pos hδ' hα_pos] + intro h; linarith only [this, h] private lemma rightEdge_neg_arc_slitPlane (s : ℂ) (hs_re : s.re = 1 / 2) (hs_im_lower : Real.sqrt 3 / 2 < s.im) @@ -422,8 +427,8 @@ private lemma rightEdge_neg_arc_slitPlane (s : ℂ) (hs_re : s.re = 1 / 2) rw [Complex.mem_slitPlane_iff] simp only [neg_sub] set θ := Real.pi * (1 + t) / 6 with hθ_def - have hθ_lower : Real.pi / 3 ≤ θ := by simp only [hθ_def]; nlinarith [Real.pi_pos] - have hθ_upper : θ ≤ 2 * Real.pi / 3 := by simp only [hθ_def]; nlinarith [Real.pi_pos] + have hθ_lower : Real.pi / 3 ≤ θ := by simp only [hθ_def]; nlinarith only [ht1, Real.pi_pos] + have hθ_upper : θ ≤ 2 * Real.pi / 3 := by simp only [hθ_def]; nlinarith only [ht3, Real.pi_pos] by_cases ht1_eq : t = 1 · right subst ht1_eq @@ -432,18 +437,20 @@ private lemma rightEdge_neg_arc_slitPlane (s : ℂ) (hs_re : s.re = 1 / 2) exp_real_angle_I, Real.cos_pi_div_three, Real.sin_pi_div_three] simp [Complex.sub_im, Complex.add_im, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_one, mul_zero, add_zero] - linarith [hs_im_lower] + linarith only [hs_im_lower] · left have ht1_strict : 1 < t := lt_of_le_of_ne ht1 (Ne.symm ht1_eq) - have hθ_strict : Real.pi / 3 < θ := by simp only [hθ_def]; nlinarith [Real.pi_pos] + have hθ_strict : Real.pi / 3 < θ := by simp only [hθ_def]; nlinarith only [ht1_strict, + Real.pi_pos] simp only [Complex.sub_re, exp_ofReal_mul_I_re] rw [hs_re] have hcos_lt : Real.cos θ < 1 / 2 := by - have h_pi_div_three : Real.pi / 3 > 0 := by nlinarith [Real.pi_pos] + have h_pi_div_three : Real.pi / 3 > 0 := by + nlinarith only [hθ_upper, hθ_strict, Real.pi_pos] rw [← Real.cos_pi_div_three] exact Real.cos_lt_cos_of_nonneg_of_le_pi (le_of_lt h_pi_div_three) - (hθ_upper.trans (by nlinarith [Real.pi_pos])) hθ_strict - linarith + (hθ_upper.trans (by nlinarith only [hθ_upper, hθ_strict, Real.pi_pos])) hθ_strict + linarith only [hcos_lt] private lemma rightEdge_final_log (H : ℝ) (s : ℂ) (hs_re : s.re = 1 / 2) (α : ℝ) (hα_def : α = H - Real.sqrt 3 / 2) @@ -455,13 +462,13 @@ private lemma rightEdge_final_log (H : ℝ) (s : ℂ) rw [rightEdge_h₀_eq hs_re] have h_sub : (t₀ - δ) * α = t₀ * α - δ * α := sub_mul t₀ δ α have hval : H - (t₀ - δ) * (H - Real.sqrt 3 / 2) - s.im = δ * α := by - rw [hα_def] at h_sub ht₀_mul ⊢; linarith + rw [hα_def] at h_sub ht₀_mul ⊢; linarith only [ht₀_mul] rw [hval] have hval_plus : fdBoundarySeg1H H (t₀ + δ) - s = ↑(-(δ * α)) * I := by rw [rightEdge_h₀_eq hs_re] have h_add : (t₀ + δ) * α = t₀ * α + δ * α := add_mul t₀ δ α have hval : H - (t₀ + δ) * (H - Real.sqrt 3 / 2) - s.im = -(δ * α) := by - rw [hα_def] at h_add ht₀_mul ⊢; linarith + rw [hα_def] at h_add ht₀_mul ⊢; linarith only [ht₀_mul] rw [hval] rw [hval_minus, hval_plus] rw [show -(↑(δ * α) * I : ℂ) = ↑(δ * α) * (-I) from by ring, @@ -732,7 +739,7 @@ private lemma rightEdge_h_far (H : ℝ) (_hH_sqrt : Real.sqrt 3 / 2 < H) rw [abs_sub_comm] at h_abs rcases lt_or_ge t (t₀ - ε / α) with h_left | h_right · -- t < t₀ - δ: t is on seg1 (t < 1), norm > ε - have ht1 : t ≤ 1 := by linarith [hεα_lt_t₀] + have ht1 : t ≤ 1 := by linarith only [hδ_pos, hεα_lt_1mt₀, h_left, hεα_lt_t₀] rw [fdBoundary_H_eq_seg1_H ht1, rightEdge_h₀_eq hs_re] rw [norm_mul, Complex.norm_real, Complex.norm_I, mul_one, Real.norm_eq_abs, show H - Real.sqrt 3 / 2 = α from hα_def.symm] @@ -743,13 +750,13 @@ private lemma rightEdge_h_far (H : ℝ) (_hH_sqrt : Real.sqrt 3 / 2 < H) rw [abs_of_pos h_im_pos] have hε_eq : ε = ε / α * α := (div_mul_cancel₀ ε (ne_of_gt hα_pos)).symm have h_tα : t * α < (t₀ - ε / α) * α := mul_lt_mul_of_pos_right h_left hα_pos - nlinarith [ht₀_mul, div_mul_cancel₀ ε (ne_of_gt hα_pos)] + nlinarith only [ht₀_mul, hε_eq, h_tα, div_mul_cancel₀ ε (ne_of_gt hα_pos)] · -- h_right : t₀ - ε/α ≤ t, h_abs : ε/α < |t₀ - t| -- Derive t > t₀ + ε/α have ht_gt : t₀ + ε / α < t := by rcases le_or_gt t₀ t with h | h - · rw [abs_of_nonpos (by linarith)] at h_abs; linarith - · rw [abs_of_pos (by linarith)] at h_abs; linarith + · rw [abs_of_nonpos (by linarith only [h])] at h_abs; linarith only [h_abs] + · rw [abs_of_pos (by linarith only [h])] at h_abs; linarith only [h_abs, h_right] by_cases ht1 : t ≤ 1 · -- t on seg1, t > t₀ + ε/α rw [fdBoundary_H_eq_seg1_H ht1, rightEdge_h₀_eq hs_re] @@ -758,14 +765,14 @@ private lemma rightEdge_h_far (H : ℝ) (_hH_sqrt : Real.sqrt 3 / 2 < H) have h_tα : (t₀ + ε / α) * α < t * α := mul_lt_mul_of_pos_right ht_gt hα_pos have h_expand : (t₀ + ε / α) * α = t₀ * α + ε / α * α := by ring have h_im_neg : H - t * α - s.im < 0 := by - nlinarith [ht₀_mul, div_mul_cancel₀ ε (ne_of_gt hα_pos)] + nlinarith only [hα_pos, ht₀_mul, hε_pos, h_tα, div_mul_cancel₀ ε (ne_of_gt hα_pos)] rw [abs_of_neg h_im_neg] - nlinarith [ht₀_mul, div_mul_cancel₀ ε (ne_of_gt hα_pos)] + nlinarith only [hα_pos, ht₀_mul, h_tα, div_mul_cancel₀ ε (ne_of_gt hα_pos)] · -- t > 1: non-seg1 part, use min dist bound push Not at ht1 have : d ≤ ‖fdBoundaryH H t - s‖ := rightEdge_min_dist_from_non_seg1 H s hs_re hs_norm hs_im t ht1 ht_mem.2 - linarith [hε_lt_d] + linarith only [hε_lt, hthresh_le_d, this, hε_lt_d] private lemma rightEdge_h_near (H : ℝ) (_hH_sqrt : Real.sqrt 3 / 2 < H) (s : ℂ) (hs_re : s.re = 1 / 2) @@ -783,9 +790,9 @@ private lemma rightEdge_h_near (H : ℝ) (_hH_sqrt : Real.sqrt 3 / 2 < H) have hεα_lt_1mt₀ : ε / α < 1 - t₀ := (div_lt_iff₀ hα_pos).mpr (_hε_lt.trans_le hthresh_le_1mt₀α) rw [abs_le] at h_abs - have ht_lower : t₀ - ε / α ≤ t := by linarith [h_abs.1] - have ht_upper : t ≤ t₀ + ε / α := by linarith [h_abs.2] - have ht1 : t ≤ 1 := by linarith + have ht_lower : t₀ - ε / α ≤ t := by linarith only [h_abs, h_abs.1] + have ht_upper : t ≤ t₀ + ε / α := by linarith only [h_abs, h_abs.2] + have ht1 : t ≤ 1 := by linarith only [h_abs, hεα_lt_1mt₀] rw [fdBoundary_H_eq_seg1_H ht1, rightEdge_h₀_eq hs_re] rw [norm_mul, Complex.norm_real, Complex.norm_I, mul_one, Real.norm_eq_abs, show H - Real.sqrt 3 / 2 = α from hα_def.symm] @@ -795,7 +802,8 @@ private lemma rightEdge_h_near (H : ℝ) (_hH_sqrt : Real.sqrt 3 / 2 < H) mul_le_mul_of_nonneg_right ht_upper (le_of_lt hα_pos) have h_tα_lower : (t₀ - ε / α) * α ≤ t * α := mul_le_mul_of_nonneg_right ht_lower (le_of_lt hα_pos) - constructor <;> nlinarith [ht₀_mul, div_mul_cancel₀ ε (ne_of_gt hα_pos)] + constructor <;> nlinarith only [ht₀_mul, hε_eq, h_tα_upper, div_mul_cancel₀ ε (ne_of_gt hα_pos), + h_tα_lower] /-- From `ε < threshold ≤ min (t₀·α) ((1-t₀)·α)` derive `0 < ε/α`, `ε/α < t₀`, `ε/α < 1-t₀`. -/ private lemma rightEdge_eps_bounds {α t₀ threshold ε : ℝ} (hα_pos : 0 < α) @@ -814,17 +822,17 @@ private lemma rightEdge_winding_aux (H : ℝ) (hH_sqrt : Real.sqrt 3 / 2 < H) (fdBoundaryH H t - s)⁻¹ * deriv (fdBoundaryH H) t else 0) (𝓝[>] 0) (𝓝 (-(↑Real.pi * I))) := by set α := H - Real.sqrt 3 / 2 with hα_def - have hα_pos : 0 < α := by rw [hα_def]; linarith + have hα_pos : 0 < α := by rw [hα_def]; linarith only [hs_im_lower, hs_im] set t₀ := (H - s.im) / α with ht₀_def - have ht₀_pos : 0 < t₀ := div_pos (by linarith) hα_pos - have ht₀_lt : t₀ < 1 := by rw [ht₀_def, div_lt_one hα_pos]; linarith [hα_def] + have ht₀_pos : 0 < t₀ := div_pos (by linarith only [hs_im]) hα_pos + have ht₀_lt : t₀ < 1 := by rw [ht₀_def, div_lt_one hα_pos]; linarith only [hs_im_lower, hα_def] have ht₀_mul : t₀ * α = H - s.im := div_mul_cancel₀ _ (ne_of_gt hα_pos) set d := min (min (‖s‖ - 1) 1) (H - s.im) have hd_pos : 0 < d := rightEdge_min_dist_pos s hs_norm hs_im -- Choose threshold small enough for all bounds set threshold := min d (min (t₀ * α) ((1 - t₀) * α)) have hthresh_pos : 0 < threshold := lt_min hd_pos - (lt_min (mul_pos ht₀_pos hα_pos) (mul_pos (by linarith) hα_pos)) + (lt_min (mul_pos ht₀_pos hα_pos) (mul_pos (by linarith only [ht₀_lt]) hα_pos)) have hthresh_le_d : threshold ≤ d := min_le_left _ _ have hthresh_le_t₀α : threshold ≤ t₀ * α := (min_le_right _ _).trans (min_le_left _ _) @@ -841,7 +849,7 @@ private lemma rightEdge_winding_aux (H : ℝ) (hH_sqrt : Real.sqrt 3 / 2 < H) simpa only [sub_zero] using lt_min h1 (h2.trans (by linarith)) -- Apply pv_tendsto_of_crossing_limit refine ContourIntegral.pv_tendsto_of_crossing_limit - (t₀ := t₀) (ht₀ := ⟨by linarith, by linarith⟩) + (t₀ := t₀) (ht₀ := ⟨by linarith only [ht₀_pos], by linarith only [ht₀_pos, ht₀_lt]⟩) (threshold := threshold) (hthresh := hthresh_pos) (δ := fun ε => ε / α) (E := fun ε => Complex.log (-(fdBoundarySeg1H H (t₀ - ε / α) - s)) - diff --git a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/UnitArc.lean b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/UnitArc.lean index 3f70f41898..c6618a30c3 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/UnitArc.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/UnitArc.lean @@ -51,20 +51,24 @@ private lemma unitArc_re_pos_at_offsets (s : ℂ) (t₀ δ' : ℝ) simp only [Complex.sub_re, Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_zero, zero_mul, sub_self, add_zero] - have hθ_m_lt : θ_m < θ₀' := by simp [θ_m, θ₀']; nlinarith [Real.pi_pos] - have hθ_m_nn : 0 ≤ θ_m := by simp [θ_m]; nlinarith [Real.pi_pos, hδ'_left] - have hθ₀_le_pi : θ₀' ≤ Real.pi := by simp [θ₀']; nlinarith [Real.pi_pos, hδ'_right] - linarith [Real.cos_lt_cos_of_nonneg_of_le_pi hθ_m_nn hθ₀_le_pi hθ_m_lt] + have hθ_m_lt : θ_m < θ₀' := by simp [θ_m, θ₀']; nlinarith only [_hδ'_pos, Real.pi_pos] + have hθ_m_nn : 0 ≤ θ_m := by simp [θ_m]; nlinarith only [hδ'_left, Real.pi_pos] + have hθ₀_le_pi : θ₀' ≤ Real.pi := by simp [θ₀']; nlinarith only [_hδ'_pos, hδ'_left, + hδ'_right, Real.pi_pos] + linarith only [hθ_m_lt, hθ_m_nn, hθ₀_le_pi, + Real.cos_lt_cos_of_nonneg_of_le_pi hθ_m_nn hθ₀_le_pi hθ_m_lt] · set θ_p := Real.pi * (1 + (t₀ + δ')) / 6 set θ₀' := Real.pi * (1 + t₀) / 6 rw [h_s_arc, exp_real_angle_I, exp_real_angle_I] simp only [Complex.sub_re, Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_zero, zero_mul, sub_self, add_zero, neg_sub] - have hθ_gt : θ₀' < θ_p := by simp [θ₀', θ_p]; nlinarith [Real.pi_pos] - have hθ₀_nn : 0 ≤ θ₀' := by simp [θ₀']; nlinarith [Real.pi_pos, hδ'_left] - have hθ_p_le_pi : θ_p ≤ Real.pi := by simp [θ_p]; nlinarith [Real.pi_pos, hδ'_right] - linarith [Real.cos_lt_cos_of_nonneg_of_le_pi hθ₀_nn hθ_p_le_pi hθ_gt] + have hθ_gt : θ₀' < θ_p := by simp [θ₀', θ_p]; nlinarith only [_hδ'_pos, Real.pi_pos] + have hθ₀_nn : 0 ≤ θ₀' := by simp [θ₀']; nlinarith only [_hδ'_pos, hδ'_left, Real.pi_pos] + have hθ_p_le_pi : θ_p ≤ Real.pi := by simp [θ_p]; nlinarith only [_hδ'_pos, hδ'_left, + hδ'_right, Real.pi_pos] + linarith only [hθ_gt, hθ₀_nn, hθ_p_le_pi, + Real.cos_lt_cos_of_nonneg_of_le_pi hθ₀_nn hθ_p_le_pi hθ_gt] private lemma unitArc_log_ratio_tendsto (s : ℂ) (_hs_norm : ‖s‖ = 1) (_hs_re : |s.re| < 1 / 2) (_hs_im_pos : 0 < s.im) @@ -131,7 +135,7 @@ private lemma normSq_exp_sub (α β : ℝ) : Complex.I_re, Complex.I_im, mul_zero, sub_self, add_zero, Complex.sub_re, Complex.add_im, Complex.mul_im, mul_one, Complex.sub_im] rw [Real.cos_sub] - nlinarith [Real.sin_sq_add_cos_sq α, Real.sin_sq_add_cos_sq β, + nlinarith only [Real.sin_sq_add_cos_sq α, Real.sin_sq_add_cos_sq β, sq_nonneg (Real.sin α - Real.sin β), sq_nonneg (Real.cos α - Real.cos β)] private lemma unitArc_normSq_at_offset (s : ℂ) (H : ℝ) (t₀ δ : ℝ) @@ -148,17 +152,22 @@ private lemma unitArc_norm_lt_of_abs_lt (s : ℂ) (H : ℝ) (t₀ : ℝ) (habs : |t₁ - t₀| < |t₂ - t₀|) : ‖fdBoundaryH H t₁ - s‖ < ‖fdBoundaryH H t₂ - s‖ := by rw [show t₁ = t₀ + (t₁ - t₀) from by ring, show t₂ = t₀ + (t₂ - t₀) from by ring] - have hns₁ := unitArc_normSq_at_offset s H t₀ (t₁ - t₀) h_s_arc (by linarith) (by linarith) - have hns₂ := unitArc_normSq_at_offset s H t₀ (t₂ - t₀) h_s_arc (by linarith) (by linarith) + have hns₁ := unitArc_normSq_at_offset s H t₀ (t₁ - t₀) h_s_arc (by linarith only [ht₁_arc]) (by + linarith only [ht₁_arc']) + have hns₂ := unitArc_normSq_at_offset s H t₀ (t₂ - t₀) h_s_arc (by linarith only [ht₂_arc]) (by + linarith only [ht₂_arc']) have h_abs_bound : |t₂ - t₀| < 2 := by - rw [abs_lt]; constructor <;> linarith [ht₀_Ioo.1, ht₀_Ioo.2] + rw [abs_lt]; constructor <;> linarith only [ht₀_Ioo, ht₂_arc, ht₀_Ioo.1, ht₀_Ioo.2, ht₂_arc'] have hφ₁_nn : 0 ≤ Real.pi * |t₁ - t₀| / 6 := by positivity - have hφ₂_le_pi : Real.pi * |t₂ - t₀| / 6 ≤ Real.pi := by nlinarith [Real.pi_pos] - have hφ_lt : Real.pi * |t₁ - t₀| / 6 < Real.pi * |t₂ - t₀| / 6 := by nlinarith [Real.pi_pos] + have hφ₂_le_pi : Real.pi * |t₂ - t₀| / 6 ≤ Real.pi := by + nlinarith only [h_abs_bound, Real.pi_pos] + have hφ_lt : Real.pi * |t₁ - t₀| / 6 < Real.pi * |t₂ - t₀| / 6 := by + nlinarith only [habs, Real.pi_pos] rw [Complex.norm_def, Complex.norm_def] apply Real.sqrt_lt_sqrt (Complex.normSq_nonneg _) rw [hns₁, hns₂, cos_pi_mul_div_six_abs (t₁ - t₀), cos_pi_mul_div_six_abs (t₂ - t₀)] - linarith [Real.cos_lt_cos_of_nonneg_of_le_pi hφ₁_nn hφ₂_le_pi hφ_lt] + linarith only [hφ₁_nn, hφ₂_le_pi, hφ_lt, + Real.cos_lt_cos_of_nonneg_of_le_pi hφ₁_nn hφ₂_le_pi hφ_lt] /-! ### Helper 1: Arc outside points have norm > ε -/ @@ -171,7 +180,7 @@ private lemma unitArc_arc_outside_gt_eps (s : ℂ) (H : ℝ) (t₀ δ' ε : ℝ) ε < ‖fdBoundaryH H t - s‖ := by rw [← hδ'_eq] exact unitArc_norm_lt_of_abs_lt s H t₀ ht₀_Ioo h_s_arc (t₀ + δ') t - (by linarith [ht₀_Ioo.1]) hδ'_right ht1 ht3 + (by linarith only [hδ'_pos, hδ'_left, ht₀_Ioo.1]) hδ'_right ht1 ht3 (by rw [show t₀ + δ' - t₀ = δ' from by ring, abs_of_pos hδ'_pos]; exact habs) /-! ### Helper 2: Arc inside points have norm ≤ ε -/ @@ -187,16 +196,18 @@ private lemma unitArc_arc_inside_le_eps (s : ℂ) (H : ℝ) (t₀ δ' ε : ℝ) · rw [← hδ'_eq] rw [show t = t₀ + (t - t₀) from by ring, Complex.norm_def, Complex.norm_def] apply le_of_eq; congr 1 - rw [unitArc_normSq_at_offset s H t₀ (t - t₀) h_s_arc (by linarith) (by linarith), - unitArc_normSq_at_offset s H t₀ δ' h_s_arc (by linarith [ht₀_Ioo.1]) hδ'_right] + rw [unitArc_normSq_at_offset s H t₀ (t - t₀) h_s_arc (by linarith only [ht1]) (by + linarith only [ht3]), + unitArc_normSq_at_offset s H t₀ δ' h_s_arc (by + linarith only [hδ'_pos, hδ'_left, ht₀_Ioo.1]) hδ'_right] congr 1; congr 1 rcases le_or_gt (t - t₀) 0 with h | h - · have h_neg : t - t₀ = -δ' := by rw [abs_of_nonpos h] at heq; linarith + · have h_neg : t - t₀ = -δ' := by rw [abs_of_nonpos h] at heq; linarith only [heq] rw [h_neg, show Real.pi * (-δ') / 6 = -(Real.pi * δ' / 6) from by ring, Real.cos_neg] · rw [abs_of_pos h] at heq; rw [heq] · rw [← hδ'_eq] exact le_of_lt (unitArc_norm_lt_of_abs_lt s H t₀ ht₀_Ioo h_s_arc t (t₀ + δ') - ht1 ht3 (by linarith [ht₀_Ioo.1]) hδ'_right + ht1 ht3 (by linarith only [hδ'_pos, hδ'_left, ht₀_Ioo.1]) hδ'_right (by rw [show t₀ + δ' - t₀ = δ' from by ring, abs_of_pos hδ'_pos]; exact hlt)) /-! ### Helper 3: Norm classification — left of crossing -/ @@ -216,7 +227,10 @@ private lemma unitArc_norm_gt_left (s : ℂ) (H : ℝ) (_hH : 1 < H) (t₀ δ' _ ≤ ‖fdBoundaryH H t - s‖ := unitArc_min_dist_from_seg1 H s hs_re t h1 · push Not at h1 exact unitArc_arc_outside_gt_eps s H t₀ δ' ε ht₀_Ioo h_s_arc hδ'_pos hδ'_left hδ'_right - hδ'_eq t h1 (by linarith) (by rw [abs_of_nonpos (by linarith)]; linarith) + hδ'_eq t h1 (by linarith only [hδ'_pos, hδ'_right, ht_lt]) + (by + rw [abs_of_nonpos (by linarith only [hδ'_pos, ht_lt])] + linarith only [ht_lt]) /-! ### Helper 4: Norm classification — right of crossing -/ @@ -231,7 +245,10 @@ private lemma unitArc_norm_gt_right (s : ℂ) (H : ℝ) (hH : 1 < H) (t₀ δ' ε < ‖fdBoundaryH H t - s‖ := by by_cases h3 : t < 3 · exact unitArc_arc_outside_gt_eps s H t₀ δ' ε ht₀_Ioo h_s_arc hδ'_pos hδ'_left hδ'_right - hδ'_eq t (by linarith) h3 (by rw [abs_of_pos (by linarith)]; linarith) + hδ'_eq t (by linarith only [hδ'_pos, hδ'_left, ht_gt]) h3 + (by + rw [abs_of_pos (by linarith only [hδ'_pos, ht_gt])] + linarith only [ht_gt]) · push Not at h3 calc ε < min (min (1/2 - s.re) (s.re + 1/2)) (H - 1) := hε_lt_d _ ≤ ‖fdBoundaryH H t - s‖ := @@ -250,11 +267,12 @@ private lemma unitArc_h_near (H : ℝ) (s : ℂ) (hδ_eq : ‖fdBoundaryH H (t₀ + δ) - s‖ = ε) (t : ℝ) (habs : |t - t₀| ≤ δ) : ‖fdBoundaryH H t - s‖ ≤ ε := by - have hδ_left : 1 < t₀ - δ := by have := lt_of_lt_of_le hδ_lt_hw (hhw ▸ min_le_left _ _); linarith + have hδ_left : 1 < t₀ - δ := by + have := lt_of_lt_of_le hδ_lt_hw (hhw ▸ min_le_left _ _); linarith only [this] have hδ_right : t₀ + δ < 3 := by - have := lt_of_lt_of_le hδ_lt_hw (hhw ▸ min_le_right _ _); linarith - have ht1 : 1 < t := by have : -δ ≤ t - t₀ := (abs_le.mp habs).1; linarith - have ht3 : t < 3 := by have : t - t₀ ≤ δ := (abs_le.mp habs).2; linarith + have := lt_of_lt_of_le hδ_lt_hw (hhw ▸ min_le_right _ _); linarith only [this] + have ht1 : 1 < t := by have : -δ ≤ t - t₀ := (abs_le.mp habs).1; linarith only [hδ_left, this] + have ht3 : t < 3 := by have : t - t₀ ≤ δ := (abs_le.mp habs).2; linarith only [hδ_right, this] exact unitArc_arc_inside_le_eps s H t₀ δ ε ht₀_Ioo h_s_arc hδ_pos hδ_left hδ_right hδ_eq t ht1 ht3 habs @@ -287,7 +305,7 @@ private lemma unitArc_limit_aux (H : ℝ) (s : ℂ) · exact eventually_nhdsWithin_of_forall fun ε hε => Set.mem_Ioi.mpr (by simp only [hδ_fn_def] have hε_pos : 0 < ε := Set.mem_Ioi.mp hε - exact mul_pos (by positivity) (Real.arcsin_pos.mpr (by linarith))) + exact mul_pos (by positivity) (Real.arcsin_pos.mpr (by linarith only [hε_pos]))) have h_comp : Tendsto (f_diff ∘ δ_fn) (nhdsWithin 0 (Ioi 0)) (nhds 0) := h_diff.comp hδ_fn_to_zero have h_ev : ∀ᶠ ε in nhdsWithin 0 (Ioi 0), @@ -300,10 +318,12 @@ private lemma unitArc_limit_aux (H : ℝ) (s : ℂ) have hδ_pos' := hδ_pos ε hε.1 hε.2 have hδ_lt_t₀m1 : δ_fn ε < t₀ - 1 := lt_of_lt_of_le hδ_lt hhw_le_t₀_sub_one have hδ_lt_3mt₀ : δ_fn ε < 3 - t₀ := lt_of_lt_of_le hδ_lt hhw_le_three_sub_t₀ - have hδ_left : 1 < t₀ - δ_fn ε := by linarith - have hδ_right : t₀ + δ_fn ε < 3 := by linarith - rw [fdBoundary_H_eq_arc hδ_left (by linarith [ht₀_Ioo.2, hδ_pos']), - fdBoundary_H_eq_arc (by linarith [ht₀_Ioo.1, hδ_pos']) hδ_right] + have hδ_left : 1 < t₀ - δ_fn ε := by linarith only [hhw_le_t₀_sub_one, hδ_lt] + have hδ_right : t₀ + δ_fn ε < 3 := by linarith only [hhw_le_three_sub_t₀, hδ_lt] + rw [fdBoundary_H_eq_arc hδ_left (by + linarith only [hhw_le_three_sub_t₀, hδ_lt, hδ_pos', ht₀_Ioo.2]), + fdBoundary_H_eq_arc (by linarith only [hhw_le_t₀_sub_one, hδ_lt, hδ_pos', + ht₀_Ioo.1]) hδ_right] have h_sub : Tendsto (fun ε => (f_diff ∘ δ_fn) ε - ↑Real.pi * I) (nhdsWithin 0 (Ioi 0)) (nhds (0 - ↑Real.pi * I)) := h_comp.sub tendsto_const_nhds @@ -339,8 +359,8 @@ private lemma unitArc_ftc_bundle_aux (H : ℝ) (hH : 1 < H) (s : ℂ) have hδ_lt := hδ_lt_hw ε hε_pos hε_lt have hδ_lt_t₀m1 : δ_fn ε < t₀ - 1 := lt_of_lt_of_le hδ_lt hhw_le_t₀_sub_one have hδ_lt_3mt₀ : δ_fn ε < 3 - t₀ := lt_of_lt_of_le hδ_lt hhw_le_three_sub_t₀ - have hδ_left : 1 < t₀ - δ_fn ε := by linarith - have hδ_right : t₀ + δ_fn ε < 3 := by linarith + have hδ_left : 1 < t₀ - δ_fn ε := by linarith only [hhw_le_t₀_sub_one, hδ_lt] + have hδ_right : t₀ + δ_fn ε < 3 := by linarith only [hhw_le_three_sub_t₀, hδ_lt] obtain ⟨hint_l, hint_r, h_sum⟩ := unitArc_ftc_value H hH s hs_norm hs_re hs_im_pos (δ_fn ε) hδ_pos' t₀ ht₀_Ioo h_s_arc hδ_left hδ_right have h_deriv_eq : ∀ t : ℝ, @@ -359,8 +379,10 @@ private lemma unitArc_ftc_bundle_aux (H : ℝ) (hH : 1 < H) (s : ℂ) rw [h_congr, h_congr, h_sum] obtain ⟨h_re_l, h_re_r⟩ := unitArc_re_pos_at_offsets s t₀ (δ_fn ε) ht₀_Ioo h_s_arc hδ_pos' hδ_left hδ_right - rw [fdBoundary_H_eq_arc hδ_left (by linarith [hδ_lt_3mt₀] : t₀ - δ_fn ε < 3), - fdBoundary_H_eq_arc (by linarith [ht₀_Ioo.1, hδ_pos'] : 1 < t₀ + δ_fn ε) hδ_right, + rw [fdBoundary_H_eq_arc hδ_left (by + linarith only [hhw_le_three_sub_t₀, hδ_pos', hδ_lt, hδ_lt_3mt₀] : t₀ - δ_fn ε < 3), + fdBoundary_H_eq_arc (by linarith only [hhw_le_t₀_sub_one, hδ_pos', hδ_lt, + ht₀_Ioo.1] : 1 < t₀ + δ_fn ε) hδ_right, log_div_of_re_pos h_re_l h_re_r] private lemma unitArc_winding_aux (H : ℝ) (hH : 1 < H) (s : ℂ) @@ -379,7 +401,7 @@ private lemma unitArc_winding_aux (H : ℝ) (hH : 1 < H) (s : ℂ) have hhw_le_three_sub_t₀ : hw ≤ 3 - t₀ := min_le_right _ _ have hsin_hw : 0 < Real.sin (Real.pi * hw / 12) := by apply Real.sin_pos_of_pos_of_lt_pi; · positivity - · nlinarith [Real.pi_pos] + · nlinarith only [hhw_le_t₀_sub_one, hhw_le_three_sub_t₀, Real.pi_pos] set threshold := min d_min (2 * Real.sin (Real.pi * hw / 12)) with hthresh_def have hthresh_pos : 0 < threshold := lt_min hd_min_pos (by positivity) set δ_fn : ℝ → ℝ := fun ε => 12 / Real.pi * Real.arcsin (ε / 2) with hδ_fn_def @@ -389,7 +411,8 @@ private lemma unitArc_winding_aux (H : ℝ) (hH : 1 < H) (s : ℂ) lt_of_lt_of_le hε_lt (min_le_right _ _) have harcsin_lt : Real.arcsin (ε / 2) < Real.pi * hw / 12 := by have hπhw12 : Real.pi * hw / 12 = Real.arcsin (Real.sin (Real.pi * hw / 12)) := - (Real.arcsin_sin (by nlinarith [Real.pi_pos]) (by nlinarith [Real.pi_pos])).symm + (Real.arcsin_sin (by nlinarith only [hhw_pos, Real.pi_pos]) (by + nlinarith only [hhw_le_t₀_sub_one, hhw_le_three_sub_t₀, Real.pi_pos])).symm rw [hπhw12] apply Real.arcsin_lt_arcsin (by linarith) · linarith @@ -425,19 +448,19 @@ private lemma unitArc_winding_aux (H : ℝ) (hH : 1 < H) (s : ℂ) rw [show Real.pi * δ_fn ε / 6 = 2 * (δ_fn ε * Real.pi / 12) from by ring] have h2sin : 2 - 2 * Real.cos (2 * (δ_fn ε * Real.pi / 12)) = (2 * Real.sin (δ_fn ε * Real.pi / 12)) ^ 2 := by - have := Real.sin_sq (δ_fn ε * Real.pi / 12) - nlinarith [Real.sin_sq (δ_fn ε * Real.pi / 12), Real.cos_sq (δ_fn ε * Real.pi / 12)] + rw [mul_pow, Real.sin_sq, Real.cos_two_mul] + ring have hsin_pos : 0 < Real.sin (δ_fn ε * Real.pi / 12) := by apply Real.sin_pos_of_pos_of_lt_pi · positivity · have := hδ_lt_hw ε hε_pos hε_lt - nlinarith [Real.pi_pos] + nlinarith only [hhw_le_t₀_sub_one, hhw_le_three_sub_t₀, hδ_lt, Real.pi_pos] have hε_half_bounds : -1 ≤ ε / 2 ∧ ε / 2 ≤ 1 := by constructor · linarith · have hthresh_le : threshold ≤ 2 * Real.sin (Real.pi * hw / 12) := min_le_right _ _ - nlinarith [Real.sin_le_one (Real.pi * hw / 12)] + nlinarith only [hε_lt, hthresh_le, Real.sin_le_one (Real.pi * hw / 12)] rw [h2sin, Real.sqrt_sq_eq_abs, abs_of_pos (by linarith), hangle, Real.sin_arcsin hε_half_bounds.1 hε_half_bounds.2] ring diff --git a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/UnitArcHelpers.lean b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/UnitArcHelpers.lean index 0705568216..231491fc91 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/UnitArcHelpers.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/Boundary/Winding/UnitArcHelpers.lean @@ -6,7 +6,6 @@ Authors: Chris Birkbeck module public import LeanPool.LeanModularForms.ValenceFormula.Boundary.Basic -import LeanPool.LeanModularForms.ValenceFormula.Boundary.Bounds import LeanPool.LeanModularForms.ValenceFormula.Boundary.Smooth import LeanPool.LeanModularForms.ValenceFormula.Boundary.Winding.RightEdge import LeanPool.LeanModularForms.ValenceFormula.TrigLemmas @@ -40,40 +39,41 @@ private lemma unitArc_re_sq_add_im_sq {s : ℂ} (hs_norm : ‖s‖ = 1) : have h2 : ‖s‖ ^ 2 = 1 := by rw [hs_norm]; norm_num rw [Complex.norm_def, Real.sq_sqrt (Complex.normSq_nonneg s)] at h2 simp only [Complex.normSq_apply] at h2 - nlinarith + nlinarith only [h2] /-- For a unit-norm complex `s`, `s.im ≤ 1`. -/ private lemma unitArc_im_le_one {s : ℂ} (hs_norm : ‖s‖ = 1) : s.im ≤ 1 := by - nlinarith [unitArc_re_sq_add_im_sq hs_norm, sq_nonneg s.re] + nlinarith only [hs_norm, unitArc_re_sq_add_im_sq hs_norm, sq_nonneg s.re] /-- The crossing parameter `t₀ = 6·arccos(s.re)/π − 1` lies in `(1, 3)`. -/ lemma unitArc_t₀_mem_Ioo (s : ℂ) (hs_re : |s.re| < 1 / 2) (_hs_im_pos : 0 < s.im) : 6 * Real.arccos s.re / Real.pi - 1 ∈ Ioo (1 : ℝ) 3 := by set θ₀ := Real.arccos s.re with hθ₀_def have hs_re_bound : s.re ∈ Ioo (-1/2 : ℝ) (1/2) := by - have h := abs_lt.mp hs_re; exact ⟨by linarith [h.1], h.2⟩ + have h := abs_lt.mp hs_re; exact ⟨by linarith only [h, h.1], h.2⟩ have hcos_third : Real.arccos (1/2 : ℝ) = Real.pi / 3 := by rw [show (1/2 : ℝ) = Real.cos (Real.pi / 3) from (Real.cos_pi_div_three).symm] - exact Real.arccos_cos (by positivity) (by linarith [Real.pi_pos]) + exact Real.arccos_cos (by positivity) (by linarith only [Real.pi_pos]) have hcos_two_third : Real.arccos (-1/2 : ℝ) = 2 * Real.pi / 3 := by rw [show (-1/2 : ℝ) = Real.cos (2 * Real.pi / 3) from by rw [show (2 : ℝ) * Real.pi / 3 = Real.pi - Real.pi / 3 from by ring, Real.cos_pi_sub, Real.cos_pi_div_three]; ring] - exact Real.arccos_cos (by linarith [Real.pi_pos]) (by linarith [Real.pi_pos]) + exact Real.arccos_cos (by linarith only [Real.pi_pos]) (by linarith only [Real.pi_pos]) have hθ₀_lower : Real.pi / 3 < θ₀ := by rw [← hcos_third] - exact Real.arccos_lt_arccos (by linarith [hs_re_bound.1]) hs_re_bound.2 (by norm_num) + exact Real.arccos_lt_arccos (by linarith only [hs_re_bound, + hs_re_bound.1]) hs_re_bound.2 (by norm_num) have hθ₀_upper : θ₀ < 2 * Real.pi / 3 := by rw [← hcos_two_third] - exact Real.arccos_lt_arccos (by norm_num) (by linarith [hs_re_bound.1]) - (by linarith [hs_re_bound.2]) + exact Real.arccos_lt_arccos (by norm_num) (by linarith only [hs_re_bound, hs_re_bound.1]) + (by linarith only [hs_re_bound, hs_re_bound.2]) constructor · rw [show (1 : ℝ) < 6 * θ₀ / Real.pi - 1 ↔ 2 * Real.pi < 6 * θ₀ from by rw [lt_sub_iff_add_lt, lt_div_iff₀ Real.pi_pos]; ring_nf] - linarith + linarith only [hθ₀_lower] · rw [show 6 * θ₀ / Real.pi - 1 < (3 : ℝ) ↔ 6 * θ₀ < 4 * Real.pi from by rw [sub_lt_iff_lt_add, div_lt_iff₀ Real.pi_pos]; ring_nf] - linarith + linarith only [hθ₀_upper] /-- `fdBoundaryH H` passes through `s` at the arc parameter `t₀`. -/ lemma unitArc_fdBoundary_eq (H : ℝ) (s : ℂ) @@ -89,27 +89,28 @@ lemma unitArc_fdBoundary_eq (H : ℝ) (s : ℂ) have hs_re_range : s.re ∈ Icc (-1 : ℝ) 1 := by constructor · have := abs_le.mp (le_of_lt hs_re |>.trans (by norm_num : (1 : ℝ)/2 ≤ 1)) - linarith [(abs_le.mp (le_of_lt hs_re)).1] - · linarith [(abs_lt.mp hs_re).2] + linarith only [this, (abs_le.mp (le_of_lt hs_re)).1] + · linarith only [hs_re, (abs_lt.mp hs_re).2] rw [Real.cos_arccos hs_re_range.1 hs_re_range.2] have h_sq : s.re ^ 2 + s.im ^ 2 = 1 := unitArc_re_sq_add_im_sq hs_norm have h_sin : Real.sin (Real.arccos s.re) = s.im := by rw [Real.sin_arccos] - have h1m : 1 - s.re ^ 2 = s.im ^ 2 := by linarith + have h1m : 1 - s.re ^ 2 = s.im ^ 2 := by linarith only [h_sq] rw [h1m, Real.sqrt_sq (le_of_lt hs_im_pos)] - simp_all + simp_all only [one_div, mem_Ioo, mem_Icc, re_add_im] private lemma unitArc_dist_from_seg1 (s : ℂ) (hs_re : |s.re| < 1 / 2) (z : ℂ) (hz_re : z.re = 1 / 2) : 1/2 - s.re ≤ ‖z - s‖ := by have hd : (z - s).re = 1/2 - s.re := by simp [Complex.sub_re, hz_re] - calc 1/2 - s.re = |(z - s).re| := by rw [hd, abs_of_pos (by linarith [(abs_lt.mp hs_re).2])] + calc 1/2 - s.re = |(z - s).re| := by rw [hd, abs_of_pos (by + linarith only [hs_re, (abs_lt.mp hs_re).2])] _ ≤ ‖z - s‖ := Complex.abs_re_le_norm _ private lemma unitArc_dist_from_seg4 (s : ℂ) (hs_re : |s.re| < 1 / 2) (z : ℂ) (hz_re : z.re = -1 / 2) : s.re + 1/2 ≤ ‖z - s‖ := by have hd : (z - s).re = -1/2 - s.re := by simp [Complex.sub_re, hz_re] calc s.re + 1/2 = |(-1/2 - s.re)| := by - rw [abs_of_nonpos (by linarith [(abs_lt.mp hs_re).1])]; ring + rw [abs_of_nonpos (by linarith only [hs_re, (abs_lt.mp hs_re).1])]; ring _ = |(z - s).re| := by rw [hd] _ ≤ ‖z - s‖ := Complex.abs_re_le_norm _ @@ -117,8 +118,8 @@ private lemma unitArc_dist_from_seg5 (s : ℂ) (hs_norm : ‖s‖ = 1) (H : ℝ) (z : ℂ) (hz_im : z.im = H) : H - 1 ≤ ‖z - s‖ := by have hs_im_le : s.im ≤ 1 := unitArc_im_le_one hs_norm have hd : (z - s).im = H - s.im := by simp [Complex.sub_im, hz_im] - calc H - 1 ≤ H - s.im := by linarith - _ = |(z - s).im| := by rw [hd, abs_of_pos (by linarith)] + calc H - 1 ≤ H - s.im := by linarith only [hs_im_le] + _ = |(z - s).im| := by rw [hd, abs_of_pos (by linarith only [hH, hs_im_le])] _ ≤ ‖z - s‖ := Complex.abs_im_le_norm _ /-- Minimum separation distance for arc points. -/ @@ -150,11 +151,13 @@ lemma unitArc_min_dist_from_non_arc (H : ℝ) (hH : 1 < H) (s : ℂ) calc d ≤ s.re + 1/2 := le_trans (min_le_left _ _) (min_le_right _ _) _ ≤ _ := unitArc_dist_from_seg4 s hs_re _ hre · by_cases h4 : t ≤ 4 - · have hre := re_fdBoundary_H_seg4 H t (by linarith) (by linarith) h3_lt h4 + · have hre := + re_fdBoundary_H_seg4 H t (by linarith only [h3_lt]) + (by linarith only [h3_lt]) h3_lt h4 calc d ≤ s.re + 1/2 := le_trans (min_le_left _ _) (min_le_right _ _) _ ≤ _ := unitArc_dist_from_seg4 s hs_re _ hre · push Not at h4 - have him := im_fdBoundary_H_seg5 H t (by linarith) (by linarith) h3_lt h4 + have him := im_fdBoundary_H_seg5 H t (by linarith only [h4]) (by linarith only [h4]) h3_lt h4 calc d ≤ H - 1 := min_le_right _ _ _ ≤ _ := unitArc_dist_from_seg5 s hs_norm H hH _ him @@ -178,16 +181,18 @@ private lemma unitArc_g_slitPlane_before (s : ℂ) (↑(Real.cos θ) + ↑(Real.sin θ) * I) - (↑(Real.cos θ₀') + ↑(Real.sin θ₀') * I) = ↑(Real.cos θ - Real.cos θ₀') + ↑(Real.sin θ - Real.sin θ₀') * I from by push_cast; ring] - have hθ_lt : θ < θ₀' := by simp [hθ_def, hθ₀_def]; nlinarith [Real.pi_pos] + have hθ_lt : θ < θ₀' := by simp [hθ_def, hθ₀_def]; nlinarith only [htt₀, Real.pi_pos] have hθ_range : θ ∈ Icc (0 : ℝ) Real.pi := by - constructor <;> simp [hθ_def] <;> nlinarith [Real.pi_pos, ht₀_Ioo.2] + constructor <;> simp [hθ_def] <;> nlinarith only [ht1, Real.pi_pos, ht₀_Ioo.2, ht₀_Ioo, htt₀, + hθ_def, hθ₀_def, hθ_lt] have hθ₀_range : θ₀' ∈ Icc (0 : ℝ) Real.pi := by - constructor <;> simp [hθ₀_def] <;> nlinarith [Real.pi_pos, ht₀_Ioo.2] + constructor <;> simp [hθ₀_def] <;> nlinarith only [ht1, hθ_def, hθ₀_def, hθ_lt, Real.pi_pos, + ht₀_Ioo.2, ht₀_Ioo, htt₀] have h_cos_lt : Real.cos θ > Real.cos θ₀' := Real.cos_lt_cos_of_nonneg_of_le_pi hθ_range.1 hθ₀_range.2 hθ_lt simp only [Complex.add_re, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im] - nlinarith [h_cos_lt, sq_nonneg (Real.sin θ₀' - Real.sin θ)] + nlinarith only [h_cos_lt, sq_nonneg (Real.sin θ₀' - Real.sin θ)] private lemma unitArc_neg_g_slitPlane_after (s : ℂ) (_hs_norm : ‖s‖ = 1) (_hs_re : |s.re| < 1 / 2) (_hs_im_pos : 0 < s.im) @@ -202,21 +207,23 @@ private lemma unitArc_neg_g_slitPlane_after (s : ℂ) ↑(Real.cos θ₀' - Real.cos θ) + ↑(Real.sin θ₀' - Real.sin θ) * I from by push_cast; ring] - have hθ_gt : θ₀' < θ := by simp [hθ_def, hθ₀_def]; nlinarith [Real.pi_pos] + have hθ_gt : θ₀' < θ := by simp [hθ_def, hθ₀_def]; nlinarith only [htt₀, Real.pi_pos] have hθ_range : θ ∈ Icc (0 : ℝ) Real.pi := by constructor - · simp [hθ_def]; nlinarith [Real.pi_pos, ht₀_Ioo.1] - · simp [hθ_def]; have : 1 + t ≤ 4 := by linarith [ht3] - nlinarith [Real.pi_pos] + · simp [hθ_def]; nlinarith only [ht₀_Ioo, htt₀, ht3, hθ_def, hθ₀_def, hθ_gt, Real.pi_pos, + ht₀_Ioo.1] + · simp [hθ_def]; have : 1 + t ≤ 4 := by linarith only [ht3] + nlinarith only [htt₀, ht3, hθ_def, hθ₀_def, hθ_gt, Real.pi_pos] have hθ₀_range : θ₀' ∈ Icc (0 : ℝ) Real.pi := by constructor - · simp [hθ₀_def]; nlinarith [Real.pi_pos, ht₀_Ioo.1] - · simp [hθ₀_def]; nlinarith [Real.pi_pos, ht₀_Ioo.2] + · simp [hθ₀_def]; nlinarith only [ht₀_Ioo, htt₀, ht3, hθ_def, hθ₀_def, hθ_gt, Real.pi_pos, + ht₀_Ioo.1] + · simp [hθ₀_def]; nlinarith only [htt₀, ht3, hθ_def, hθ₀_def, hθ_gt, Real.pi_pos, ht₀_Ioo.2] have h_cos_lt : Real.cos θ₀' > Real.cos θ := Real.cos_lt_cos_of_nonneg_of_le_pi hθ₀_range.1 hθ_range.2 hθ_gt simp only [Complex.add_re, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im] - nlinarith [h_cos_lt, sq_nonneg (Real.sin θ₀' - Real.sin θ)] + nlinarith only [h_cos_lt, sq_nonneg (Real.sin θ₀' - Real.sin θ)] private lemma unitArc_neg_g_slitPlane_seg4 (s : ℂ) (hs_re : |s.re| < 1 / 2) (H : ℝ) (t : ℝ) (_ht3 : 3 ≤ t) (_ht4 : t ≤ 4) : @@ -226,7 +233,7 @@ private lemma unitArc_neg_g_slitPlane_seg4 (s : ℂ) change 0 < (s - (-1/2 + (↑(Real.sqrt 3) / 2 + (↑t - 3) * (↑H - ↑(Real.sqrt 3) / 2)) * I)).re simp [Complex.sub_re, Complex.add_re, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, Complex.neg_re] - linarith [(abs_lt.mp hs_re).1] + linarith only [hs_re, (abs_lt.mp hs_re).1] private lemma unitArc_neg_g_slitPlane_seg5 (s : ℂ) (hs_norm : ‖s‖ = 1) (H : ℝ) (hH : 1 < H) (t : ℝ) : @@ -236,7 +243,7 @@ private lemma unitArc_neg_g_slitPlane_seg5 (s : ℂ) simp only [sub_im, add_im, ofReal_im, div_ofNat_im, im_ofNat, zero_div, sub_self, mul_im, ofReal_re, I_im, mul_one, I_re, mul_zero, add_zero, zero_add, ne_eq] intro h - linarith [unitArc_im_le_one hs_norm] + linarith only [hs_norm, hH, h, unitArc_im_le_one hs_norm] /-- The ratio `g(t₀-δ) / (−g(t₀+δ)) = exp(−i·πδ/6)` on the arc. -/ lemma unitArc_ratio_eq (t₀ δ : ℝ) (hδ_pos : 0 < δ) (hδ_small : δ < 6) : let g_minus := @@ -248,7 +255,8 @@ lemma unitArc_ratio_eq (t₀ δ : ℝ) (hδ_pos : 0 < δ) (hδ_small : δ < 6) : set θ₀ := Real.pi * (1 + t₀) / 6 set φ := Real.pi * δ / 6 with hφ_def have hφ_pos : 0 < φ := by positivity - have hφ_lt_pi : φ < Real.pi := by simp [hφ_def]; nlinarith [Real.pi_pos] + have hφ_lt_pi : φ < Real.pi := by simp [hφ_def]; nlinarith only [hδ_pos, hδ_small, hφ_def, + hφ_pos, Real.pi_pos] rw [show Real.pi * (1 + (t₀ - δ)) / 6 = θ₀ - φ from by simp [θ₀, hφ_def]; ring, show Real.pi * (1 + (t₀ + δ)) / 6 = θ₀ + φ from by simp [θ₀, hφ_def]; ring] rw [show (↑(θ₀ - φ) * I : ℂ) = ↑θ₀ * I - ↑φ * I from by push_cast; ring, @@ -263,7 +271,7 @@ lemma unitArc_ratio_eq (t₀ δ : ℝ) (hδ_pos : 0 < δ) (hδ_small : δ < 6) : intro h have him := congr_arg Complex.im h rw [show w = cexp (↑φ * I) from rfl, exp_ofReal_mul_I_im, one_im] at him - linarith [Real.sin_pos_of_pos_of_lt_pi hφ_pos hφ_lt_pi] + linarith only [hφ_pos, hφ_lt_pi, him, Real.sin_pos_of_pos_of_lt_pi hφ_pos hφ_lt_pi] rw [show z * w⁻¹ - z = z * (w⁻¹ - 1) from by ring, show -(z * w - z) = z * (1 - w) from by ring, mul_div_mul_left _ _ hz_ne] @@ -285,7 +293,7 @@ private lemma unitArc_far_endpoint_correction (H : ℝ) (hH : 1 < H) (s : ℂ) have hg₀_im : g₀.im = H - s.im := by simp [g₀, fdBoundaryH, Complex.sub_im, Complex.add_im, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im] - have hg₀_im_pos : 0 < g₀.im := by rw [hg₀_im]; linarith + have hg₀_im_pos : 0 < g₀.im := by rw [hg₀_im]; linarith only [hH, hs_im_le] have hg₀_ne : g₀ ≠ 0 := by intro h; simp_all simp only [Complex.log] @@ -298,7 +306,7 @@ private lemma unitArc_g_slitPlane_seg1 (s : ℂ) rw [fdBoundary_H_eq_seg1_H ht.2] simp [fdBoundarySeg1H, Complex.sub_re, Complex.add_re, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im] - linarith [(abs_lt.mp hs_re).2] + linarith only [hs_re, (abs_lt.mp hs_re).2] private lemma unitArc_log_final (s : ℂ) (t₀ δ : ℝ) (_ht₀_Ioo : t₀ ∈ Ioo (1 : ℝ) 3) (h_s_arc : s = exp (↑(Real.pi * (1 + t₀) / 6) * I)) @@ -313,10 +321,12 @@ private lemma unitArc_log_final (s : ℂ) (t₀ δ : ℝ) rw [h_s_arc, exp_real_angle_I, exp_real_angle_I] simp only [Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_zero, zero_mul, sub_self, add_zero, Complex.sub_re] - have hθ_lt : θ_m < θ₀' := by simp [θ_m, θ₀']; nlinarith [Real.pi_pos] - have hθ_m_nn : 0 ≤ θ_m := by simp [θ_m]; nlinarith [Real.pi_pos, _ht₀_Ioo.1] - have hθ₀_le_pi : θ₀' ≤ Real.pi := by simp [θ₀']; nlinarith [Real.pi_pos, _ht₀_Ioo.2] - linarith [Real.cos_lt_cos_of_nonneg_of_le_pi hθ_m_nn hθ₀_le_pi hθ_lt] + have hθ_lt : θ_m < θ₀' := by simp [θ_m, θ₀']; nlinarith only [hδ_pos, Real.pi_pos] + have hθ_m_nn : 0 ≤ θ_m := by simp [θ_m]; nlinarith only [hδ_left, Real.pi_pos, _ht₀_Ioo.1] + have hθ₀_le_pi : θ₀' ≤ Real.pi := by simp [θ₀']; nlinarith only [hδ_left, hδ_right, hδ_pos, + Real.pi_pos, _ht₀_Ioo.2] + linarith only [hθ_lt, hθ_m_nn, hθ₀_le_pi, + Real.cos_lt_cos_of_nonneg_of_le_pi hθ_m_nn hθ₀_le_pi hθ_lt] · change 0 < (-(exp (↑(Real.pi * (1 + (t₀ + δ)) / 6) * I) - s)).re set θ_p := Real.pi * (1 + (t₀ + δ)) / 6 set θ₀' := Real.pi * (1 + t₀) / 6 @@ -324,10 +334,13 @@ private lemma unitArc_log_final (s : ℂ) (t₀ δ : ℝ) simp only [Complex.sub_re, Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_zero, zero_mul, sub_self, add_zero, neg_sub] - have hθ_gt : θ₀' < θ_p := by simp [θ₀', θ_p]; nlinarith [Real.pi_pos] - have hθ₀_nn : 0 ≤ θ₀' := by simp [θ₀']; nlinarith [Real.pi_pos, _ht₀_Ioo.1] - have hθ_p_le_pi : θ_p ≤ Real.pi := by simp [θ_p]; nlinarith [Real.pi_pos, _ht₀_Ioo.2] - linarith [Real.cos_lt_cos_of_nonneg_of_le_pi hθ₀_nn hθ_p_le_pi hθ_gt] + have hθ_gt : θ₀' < θ_p := by simp [θ₀', θ_p]; nlinarith only [hδ_pos, Real.pi_pos] + have hθ₀_nn : 0 ≤ θ₀' := by simp [θ₀']; nlinarith only [hδ_left, hδ_right, hδ_pos, + Real.pi_pos, _ht₀_Ioo.1] + have hθ_p_le_pi : θ_p ≤ Real.pi := by simp [θ_p]; nlinarith only [hδ_right, Real.pi_pos, + _ht₀_Ioo.2] + linarith only [hθ_gt, hθ₀_nn, hθ_p_le_pi, + Real.cos_lt_cos_of_nonneg_of_le_pi hθ₀_nn hθ_p_le_pi hθ_gt] /-- For any `δ > 0` with `t₀-δ > 1` and `t₀+δ < 3`, the δ-split integral equals `log(g(t₀-δ)/(-g(t₀+δ))) - πI`. -/ diff --git a/LeanPool/LeanModularForms/ValenceFormula/CoreIdentity.lean b/LeanPool/LeanModularForms/ValenceFormula/CoreIdentity.lean index f15c7c6ad5..5135cb3f32 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/CoreIdentity.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/CoreIdentity.lean @@ -161,9 +161,9 @@ private lemma unit_circle_im_eq_sqrt3_half (s : ℍ) (h_nsq : (s : ℂ).re * (s : ℂ).re + (s : ℂ).im * (s : ℂ).im = 1) (h_re_sq : (s : ℂ).re * (s : ℂ).re = 1 / 4) : (s : ℂ).im = Real.sqrt 3 / 2 := by have h_prod : ((s : ℂ).im - Real.sqrt 3 / 2) * ((s : ℂ).im + Real.sqrt 3 / 2) = 0 := by - nlinarith [Real.mul_self_sqrt (show (3 : ℝ) ≥ 0 by norm_num)] + nlinarith only [h_nsq, h_re_sq, Real.mul_self_sqrt (show (3 : ℝ) ≥ 0 by norm_num)] rcases mul_eq_zero.mp h_prod with h | h - · linarith + · linarith only [h] · exact absurd h (ne_of_gt (add_pos s.2 (by positivity))) private lemma unit_circle_re_neg_half_eq_rho (s : ℍ) @@ -176,7 +176,7 @@ private lemma unit_circle_re_neg_half_eq_rho (s : ℍ) simp only [ellipticPointRho', UpperHalfPlane.coe_mk, add_re, add_im, neg_re, neg_im, one_re, one_im, div_ofNat_re, div_ofNat_im, mul_re, mul_im, ofReal_re, ofReal_im, I_re, I_im, mul_zero, mul_one, sub_zero, add_zero, zero_add, zero_div, neg_zero] <;> - linarith + linarith only [hs_re, h_im] private lemma unit_circle_re_pos_half_eq_rho_plus_one (s : ℍ) (hs_norm : ‖(s : ℂ)‖ = 1) (hs_re : (s : ℂ).re = 1 / 2) : @@ -189,27 +189,28 @@ private lemma unit_circle_re_pos_half_eq_rho_plus_one (s : ℍ) simp only [ellipticPointRhoPlusOne', UpperHalfPlane.coe_mk, add_re, add_im, one_re, one_im, div_ofNat_re, div_ofNat_im, mul_re, mul_im, ofReal_re, ofReal_im, I_re, I_im, mul_zero, mul_one, sub_zero, add_zero, zero_add, zero_div] <;> - linarith + linarith only [hs_re, h_im] private lemma vert_edge_im_gt_sqrt3_half (s : ℍ) (hs_norm : ‖(s : ℂ)‖ > 1) (hs_abs_re : |(s : ℂ).re| = 1 / 2) : Real.sqrt 3 / 2 < (s : ℂ).im := by by_contra h_le; push Not at h_le have h_nsq_gt : Complex.normSq (s : ℂ) > 1 := by - rw [Complex.normSq_eq_norm_sq]; nlinarith [hs_norm, sq_nonneg (‖(s : ℂ)‖ - 1)] + rw [Complex.normSq_eq_norm_sq]; nlinarith only [hs_norm, sq_nonneg (‖(s : ℂ)‖ - 1)] have h_re_sq : (s : ℂ).re * (s : ℂ).re ≤ 1/4 := by rcases (abs_eq (by norm_num : (1 : ℝ)/2 ≥ 0)).mp hs_abs_re with h | h <;> rw [h] <;> norm_num have h_im_sq : (s : ℂ).im * (s : ℂ).im ≤ 3/4 := by have h3 := Real.mul_self_sqrt (show (3 : ℝ) ≥ 0 by norm_num) - nlinarith [mul_self_le_mul_self s.2.le h_le] - linarith [Complex.normSq_apply (s : ℂ)] + nlinarith only [h_le, h3, mul_self_le_mul_self s.2.le h_le] + linarith only [h_nsq_gt, h_re_sq, h_im_sq, Complex.normSq_apply (s : ℂ)] private lemma unit_circle_re_zero_eq_i (s : ℍ) (hs_norm : ‖(s : ℂ)‖ = 1) (hs_re : (s : ℂ).re = 0) : s = ellipticPointI' := by apply UpperHalfPlane.ext have h_nsq : Complex.normSq (s : ℂ) = 1 := by rw [Complex.normSq_eq_norm_sq, hs_norm, one_pow] rw [Complex.normSq_apply, hs_re, mul_zero, zero_add] at h_nsq - have h_le : (s : ℂ).im ≤ 1 := by nlinarith [mul_self_nonneg ((s : ℂ).im - 1), h_nsq] - have h_ge : 1 ≤ (s : ℂ).im := by nlinarith [mul_le_of_le_one_right s.2.le h_le, h_nsq] + have h_le : (s : ℂ).im ≤ 1 := by nlinarith only [h_nsq, mul_self_nonneg ((s : ℂ).im - 1)] + have h_ge : 1 ≤ (s : ℂ).im := by + nlinarith only [h_nsq, h_le, mul_le_of_le_one_right s.2.le h_le] apply Complex.ext · exact hs_re.trans Complex.I_re.symm · exact (le_antisymm h_le h_ge).trans Complex.I_im.symm @@ -222,7 +223,7 @@ private theorem boundary_weight_auto ¬(‖(s : ℂ)‖ > 1 ∧ |(s : ℂ).re| < 1/2) → generalizedWindingNumber' (fdBoundaryH H) 0 5 (↑s : ℂ) = -1/2 := by set M := S.sum (fun s : UpperHalfPlane => (s : ℂ).im) with hM_def - refine ⟨max 2 (M + 1), by linarith [le_max_left (2 : ℝ) (M + 1)], ?_⟩ + refine ⟨max 2 (M + 1), by linarith only [le_max_left (2 : ℝ) (M + 1)], ?_⟩ intro H hH s hs hsi hsρ hsρ1 h_not_int have hs_fd := hS s hs have habs_re := hs_fd.2 @@ -231,26 +232,29 @@ private theorem boundary_weight_auto have hH_ge2 : (2 : ℝ) ≤ H := le_trans (le_max_left 2 (M + 1)) hH have h_im_lt_H : (s : ℂ).im < H := by have h1 : (s : ℂ).im ≤ M := Finset.single_le_sum (fun x _ => le_of_lt x.2) hs - linarith [le_max_right (2 : ℝ) (M + 1)] + linarith only [hH, h1, le_max_right (2 : ℝ) (M + 1)] have hH_sqrt : Real.sqrt 3 / 2 < H := by - nlinarith [Real.sq_sqrt (show (3 : ℝ) ≥ 0 by norm_num), sq_nonneg (Real.sqrt 3 - 2)] + nlinarith only [hH_ge2, Real.sq_sqrt (show (3 : ℝ) ≥ 0 by norm_num), + sq_nonneg (Real.sqrt 3 - 2)] rcases eq_or_lt_of_le hnorm_ge with h_eq | h_gt · have h_re_lt : |(s : ℂ).re| < 1/2 := by by_contra h_ge; push Not at h_ge have h_abs_eq : |(s : ℂ).re| = 1/2 := le_antisymm habs_re h_ge rcases abs_cases (s : ℂ).re with ⟨h_eq_abs, _⟩ | ⟨h_eq_abs, _⟩ - · exact hsρ1 (unit_circle_re_pos_half_eq_rho_plus_one s h_eq.symm (by linarith)) - · exact hsρ (unit_circle_re_neg_half_eq_rho s h_eq.symm (by linarith)) + · exact hsρ1 (unit_circle_re_pos_half_eq_rho_plus_one s h_eq.symm (by + linarith only [h_ge, h_abs_eq, h_eq_abs])) + · exact hsρ (unit_circle_re_neg_half_eq_rho s h_eq.symm (by + linarith only [h_ge, h_abs_eq, h_eq_abs])) exact gWN_fdBoundary_H_eq_neg_half_of_unitArc - H (by linarith) (↑s) h_eq.symm h_re_lt s.2 + H (by linarith only [hH_ge2]) (↑s) h_eq.symm h_re_lt s.2 · have h_abs_eq : |(s : ℂ).re| = 1/2 := by by_contra h_ne; exact h_not_int ⟨h_gt, lt_of_le_of_ne habs_re h_ne⟩ rcases abs_cases (s : ℂ).re with ⟨h_eq_abs, _⟩ | ⟨h_eq_abs, _⟩ · exact gWN_fdBoundary_H_eq_neg_half_of_rightEdge - H hH_sqrt (↑s) (by linarith) h_gt + H hH_sqrt (↑s) (by linarith only [h_abs_eq, h_eq_abs]) h_gt (vert_edge_im_gt_sqrt3_half s h_gt h_abs_eq) h_im_lt_H · exact gWN_fdBoundary_H_eq_neg_half_of_leftEdge - H hH_sqrt (↑s) (by linarith) h_gt + H hH_sqrt (↑s) (by linarith only [h_abs_eq, h_eq_abs]) h_gt (vert_edge_im_gt_sqrt3_half s h_gt h_abs_eq) h_im_lt_H private lemma rho_singleton_sum_eq (S : Finset UpperHalfPlane) diff --git a/LeanPool/LeanModularForms/ValenceFormula/InteriorWinding.lean b/LeanPool/LeanModularForms/ValenceFormula/InteriorWinding.lean index 772ba7652d..fd1350d02e 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/InteriorWinding.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/InteriorWinding.lean @@ -9,7 +9,6 @@ public import LeanPool.LeanModularForms.GeneralizedResidueTheory.Basic public import LeanPool.LeanModularForms.ValenceFormula.Boundary.Basic import LeanPool.LeanModularForms.GeneralizedResidueTheory.Homotopy.Invariance import LeanPool.LeanModularForms.GeneralizedResidueTheory.Residue -import LeanPool.LeanModularForms.ValenceFormula.Boundary.Bounds import LeanPool.LeanModularForms.ValenceFormula.Boundary.Smooth import LeanPool.LeanModularForms.ValenceFormula.RectHomotopy.MainTheorem import Mathlib.CategoryTheory.Category.Init @@ -66,7 +65,7 @@ theorem fdBoundary_H_avoids_interior (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_re : I_re, I_im, div_ofNat, one_re] norm_num rw [habs] at hre - have := abs_lt.mp hp_re; linarith + have := abs_lt.mp hp_re; linarith only [hre, this] · push Not at h1 by_cases h3 : t ≤ 3 · have hnorm : ‖fdBoundaryH H t‖ = 1 := by @@ -74,7 +73,7 @@ theorem fdBoundary_H_avoids_interior (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_re : · rw [fdBoundary_H_at_three H] exact ellipticPointRho_norm · exact fdBoundary_H_norm_eq_one_arc h1 h3' - rw [habs] at hnorm; linarith + rw [habs] at hnorm; linarith only [hp_norm, hnorm] · push Not at h3 by_cases h4 : t ≤ 4 · have hre : (fdBoundaryH H t).re = -1 / 2 := by @@ -84,7 +83,7 @@ theorem fdBoundary_H_avoids_interior (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_re : ofReal_im, I_re, I_im, div_ofNat, one_re] norm_num rw [habs] at hre - have := abs_lt.mp hp_re; linarith + have := abs_lt.mp hp_re; linarith only [hre, this] · push Not at h4 have him : (fdBoundaryH H t).im = H := by rw [fdBoundary_H_eq_seg5_H h4, @@ -92,11 +91,11 @@ theorem fdBoundary_H_avoids_interior (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_re : simp only [add_im, mul_im, ofReal_re, ofReal_im, I_re, I_im, div_ofNat] norm_num - rw [habs] at him; linarith + rw [habs] at him; linarith only [hp_im, him] private lemma fdBoundary_H_eq_arc' {H : ℝ} {t : ℝ} (ht1 : 1 < t) (ht3 : t < 3) : fdBoundaryH H t = Complex.exp (↑(Real.pi * (1 + t) / 6) * I) := by - simp only [fdBoundaryH, show ¬(t ≤ 1) from by linarith, ↓reduceIte] + simp only [fdBoundaryH, show ¬(t ≤ 1) from by linarith only [ht1], ↓reduceIte] by_cases h2 : t ≤ 2 · simp only [h2, ↓reduceIte]; congr 1; push_cast; ring · simp only [h2, ↓reduceIte, show t ≤ 3 from le_of_lt ht3]; congr 1; push_cast; ring @@ -153,11 +152,13 @@ private lemma fdBoundary_H_decomp (H₀ H' : ℝ) (t : ℝ) : unfold fdBoundaryH heightSens by_cases h2 : t ≤ 2 · by_cases h1 : t ≤ 1 <;> - simp only [h1, h2, ↓reduceIte, show t ≤ 3 from by linarith] <;> push_cast <;> ring + simp only [h1, h2, ↓reduceIte, show t ≤ 3 from by linarith only [h1, + h2] ] <;> push_cast <;> ring · push Not at h2 - have h1 : ¬ t ≤ 1 := by linarith + have h1 : ¬ t ≤ 1 := by linarith only [h2] by_cases h3 : t ≤ 3 <;> by_cases h4 : t ≤ 4 <;> - simp only [show ¬ t ≤ 2 from by linarith, h1, h3, h4, ↓reduceIte] <;> push_cast <;> ring + simp only [show ¬ t ≤ 2 from by linarith only [h2, h3, h4], h1, h3, h4, + ↓reduceIte] <;> push_cast <;> ring private lemma fdHomot_continuous (H₀ H₁ : ℝ) : Continuous (fun (q : ℝ × ℝ) => fdBoundaryH (H₀ + q.2 * (H₁ - H₀)) q.1) := by @@ -284,7 +285,7 @@ private lemma fdBoundary_H_piecewise_homotopic (p : ℂ) (hp_norm : ‖p‖ > 1) · intro s _; exact fdBoundary_H_closed _ · intro t ht s hs exact fdBoundary_H_avoids_interior p hp_norm hp_re hp_im_pos - (lt_of_lt_of_le hp_im (by nlinarith [hs.1] : heightCutoff ≤ _)) t ht + (lt_of_lt_of_le hp_im (by nlinarith only [hH, hs, hs.1] : heightCutoff ≤ _)) t ht · exact fun t _ ht_not_P s _ => fdBoundary_H_differentiableAt_off_partition (heightCutoff + s * (H - heightCutoff)) t ht_not_P · exact fun p₁ p₂ _ hfree _ => diff --git a/LeanPool/LeanModularForms/ValenceFormula/ModularInvariance.lean b/LeanPool/LeanModularForms/ValenceFormula/ModularInvariance.lean index 09d7b298d0..d6c7f77a42 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/ModularInvariance.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/ModularInvariance.lean @@ -99,7 +99,9 @@ private lemma filter_map_neg_inv (p : ℂ) (hp : p ≠ 0) exact (tendsto_nhdsWithin_iff.mpr ⟨hφ_an.continuousAt.continuousWithinAt, by rw [eventually_nhdsWithin_iff] - simp_all⟩).eventually hQ + simp_all only [ne_eq, mem_compl_iff, mem_singleton_iff, neg_inj, inv_inj, + not_false_eq_true, implies_true, + eventually_true]⟩).eventually hQ private lemma neg_inv_finite_order_witness (g : ℂ → ℂ) (p : ℂ) (hp : p ≠ 0) (n : ℤ) (h : ℂ → ℂ) (hh_an : AnalyticAt ℂ h (-p⁻¹)) (hh_ne : h (-p⁻¹) ≠ 0) @@ -150,7 +152,8 @@ lemma ord_add_one_eq (p : ℍ) : have h_period := SlashInvariantForm.vAdd_width_periodic 1 k 1 f.toSlashInvariantForm z₀ have h_vadd_coe : ((1 : ℝ) +ᵥ z₀ : ℍ) = ⟨z, hz⟩ := by ext; change (↑(1 : ℝ) : ℂ) + (z - 1) = z; push_cast; ring - simp_all + simp_all only [mem_compl_iff, mem_singleton_iff, Nat.cast_one, Int.cast_one, mul_one, + ModularForm.toSlashInvariantForm_coe] rw [meromorphicOrderAt_congr hG_eq_near, meromorphicOrderAt_comp_sub_const] /-- T-invariance at ρ: `ord(f, ρ+1) = ord(f, ρ)`. -/ @@ -238,7 +241,7 @@ lemma ord_S_eq (p : ℍ) : conv_lhs => rw [h_S_coe] have hp_ne : p_cplx ≠ 0 := by intro h; have : p_cplx.im = 0 := by rw [h]; simp only [Complex.zero_im] - linarith [show p.im = p_cplx.im from rfl, p.im_pos] + linarith only [this, show p.im = p_cplx.im from rfl, p.im_pos] suffices h : meromorphicOrderAt G (-p_cplx⁻¹) = meromorphicOrderAt G p_cplx from congr_arg WithTop.untop₀ h calc meromorphicOrderAt G (-p_cplx⁻¹) = meromorphicOrderAt (fun z => G (-z⁻¹)) p_cplx := @@ -256,7 +259,8 @@ lemma ord_S_eq (p : ℍ) : /-- An open box containing the truncated fundamental domain. -/ def fdBox (M : ℝ) : Set ℂ := {z : ℂ | -1 < z.re ∧ z.re < 1 ∧ (1 : ℝ)/2 < z.im ∧ z.im < M} -lemma fdBox_im_pos {M : ℝ} {z : ℂ} (hz : z ∈ fdBox M) : 0 < z.im := by linarith [hz.2.2.1] +lemma fdBox_im_pos {M : ℝ} {z : ℂ} (hz : z ∈ fdBox M) : 0 < z.im := by + linarith only [hz, hz.2.2.1] /-- A nonzero modular form has finitely many zeros in `fdBox M`. -/ theorem modularForm_finitely_many_zeros_in_fdBox (hf : f ≠ 0) {M : ℝ} (hM : (1 : ℝ) / 2 < M) : @@ -267,15 +271,15 @@ theorem modularForm_finitely_many_zeros_in_fdBox (hf : f ≠ 0) {M : ℝ} (hM : have hBdd : Bornology.IsBounded (fdBox M) := isBounded_iff_forall_norm_le.mpr ⟨1 + M, fun z hz => (Complex.norm_le_abs_re_add_abs_im z).trans (by - have : |z.re| < 1 := abs_lt.mpr ⟨by linarith [hz.1], hz.2.1⟩ - have : |z.im| ≤ M := abs_le.mpr ⟨by linarith [hz.2.2.1], le_of_lt hz.2.2.2⟩ + have : |z.re| < 1 := abs_lt.mpr ⟨by linarith only [hz, hz.1], hz.2.1⟩ + have : |z.im| ≤ M := abs_le.mpr ⟨by linarith only [hM, hz, hz.2.2.1], le_of_lt hz.2.2.2⟩ linarith)⟩ obtain ⟨z₀, hz₀K, hz₀_acc⟩ := hZ_inf.exists_accPt_of_subset_isCompact hBdd.isCompact_closure ((sep_subset _ _).trans subset_closure) have hz₀_im : (1 : ℝ)/2 ≤ z₀.im := closure_minimal (fun z hz => le_of_lt hz.2.2.1) (isClosed_le continuous_const Complex.continuous_im) hz₀K - have hz₀_pos : 0 < z₀.im := by linarith + have hz₀_pos : 0 < z₀.im := by linarith only [hz₀_im] have h_freq : ∃ᶠ y in 𝓝[≠] z₀, modularFormCompOfComplex f y = 0 := (accPt_iff_frequently_nhdsNE.mp hz₀_acc).mono fun y hy => hy.2 let U := {z : ℂ | 0 < z.im} @@ -331,8 +335,8 @@ theorem exists_radius_cusp_nonvanishing (hf : f ≠ 0) : obtain ⟨s, hs_prop, hs_open, hs_zero⟩ := eventually_nhds_iff.mp (eventually_nhdsWithin_iff.mp (cuspFunction_eventually_ne_zero f hf)) obtain ⟨r, hr_pos, hr_ball⟩ := Metric.isOpen_iff.mp hs_open 0 hs_zero - exact ⟨r / 2, by linarith, fun q hq hq_ne => - hs_prop q (hr_ball (lt_of_le_of_lt (Metric.mem_closedBall.mp hq) (by linarith))) + exact ⟨r / 2, by linarith only [hr_pos], fun q hq hq_ne => + hs_prop q (hr_ball (lt_of_le_of_lt (Metric.mem_closedBall.mp hq) (by linarith only [hr_pos]))) (mem_compl_singleton_iff.mpr hq_ne)⟩ /-- Convert a q-radius to a FD boundary height. -/ @@ -366,7 +370,7 @@ lemma cusp_nonvanishing_height_mono {H₁ H₂ : ℝ} (hH : H₁ ≤ H₂) ∀ q ∈ Metric.closedBall (0 : ℂ) (Real.exp (-2 * Real.pi * H₂)), q ≠ 0 → UpperHalfPlane.cuspFunction (1 : ℝ) (⇑f) q ≠ 0 := fun q hq hq_ne => h q (Metric.closedBall_subset_closedBall - (Real.exp_le_exp.mpr (by nlinarith [Real.pi_pos])) hq) hq_ne + (Real.exp_le_exp.mpr (by nlinarith only [hH, Real.pi_pos])) hq) hq_ne /-- Cusp nonvanishing above any floor height. -/ theorem exists_height_cusp_nonvanishing_above (hf : f ≠ 0) (Hmin : ℝ) : diff --git a/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/Basic.lean b/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/Basic.lean index 3078e1aff9..f2af6d891d 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/Basic.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/Basic.lean @@ -8,7 +8,6 @@ module public import LeanPool.LeanModularForms.GeneralizedResidueTheory.Basic public import LeanPool.LeanModularForms.ValenceFormula.Boundary.Basic import LeanPool.LeanModularForms.GeneralizedResidueTheory.OnCurvePV.Basic -import LeanPool.LeanModularForms.ValenceFormula.Boundary.Bounds import LeanPool.LeanModularForms.ValenceFormula.Boundary.Smooth import LeanPool.LeanModularForms.ValenceFormula.WindingWeights.Common import LeanPool.LeanModularForms.ValenceFormula.WindingWeights.I @@ -183,7 +182,7 @@ lemma cpv_extend_to_full_interval (H : ℝ) (hH : Real.sqrt 3 / 2 < H) apply cpv_concat _ _ 0 a' b' s h_cpv_left h_sub ha' (le_of_lt hab') intro ε hε exact (fdBoundary_H_cutout_ii H hH s ε hε).mono_set (by - rw [Set.uIcc_of_le (by linarith : (0 : ℝ) ≤ b'), + rw [Set.uIcc_of_le (by linarith only [ha', hab'] : (0 : ℝ) ≤ b'), Set.uIcc_of_le (by norm_num : (0 : ℝ) ≤ 5)] exact Set.Icc_subset_Icc_right hb') apply cpv_concat _ _ 0 b' 5 s h_cpv_0b' h_cpv_right (le_trans ha' (le_of_lt hab')) hb' diff --git a/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/EndpointCorner.lean b/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/EndpointCorner.lean index 28d172ecf2..422927d1b3 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/EndpointCorner.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/EndpointCorner.lean @@ -8,7 +8,6 @@ module public import LeanPool.LeanModularForms.GeneralizedResidueTheory.Basic public import LeanPool.LeanModularForms.ValenceFormula.Boundary.Basic import LeanPool.LeanModularForms.GeneralizedResidueTheory.OnCurvePV.Basic -import LeanPool.LeanModularForms.ValenceFormula.Boundary.Bounds import LeanPool.LeanModularForms.ValenceFormula.Boundary.Smooth import LeanPool.LeanModularForms.ValenceFormula.OnCurvePV.Basic import LeanPool.LeanModularForms.ValenceFormula.WindingWeights.Common @@ -92,7 +91,7 @@ private lemma endpoint_avoid_14 (H : ℝ) (hH : Real.sqrt 3 / 2 < H) : UpperHalfPlane.coe_mk, Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.I_im, Complex.ofReal_re, Complex.div_ofNat, mul_zero, mul_one, s] at h_im - linarith + linarith only [hH, h_im] · have ht1' : 1 < t := lt_of_le_of_ne ht.1 (Ne.symm ht1) have h_norm : ‖fdBoundaryH H t‖ = 1 := fdBoundary_H_eq_arc ht1' (lt_of_le_of_ne ht3 (by @@ -102,7 +101,7 @@ private lemma endpoint_avoid_14 (H : ℝ) (hH : Real.sqrt 3 / 2 < H) : simp [ellipticPointRho, ellipticPointRho', UpperHalfPlane.coe_mk, Complex.add_im, Complex.neg_im, Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.I_im, Complex.ofReal_re, Complex.div_ofNat, s] at him - linarith [Real.sqrt_pos.mpr (show (0 : ℝ) < 3 from by norm_num)])) |>.symm ▸ + linarith only [hH, him, Real.sqrt_pos.mpr (show (0 : ℝ) < 3 from by norm_num)])) |>.symm ▸ Complex.norm_exp_ofReal_mul_I _ rw [habs] at h_norm have : 1 < ‖s‖ := one_lt_norm_of_one_lt_normSq (by @@ -110,10 +109,12 @@ private lemma endpoint_avoid_14 (H : ℝ) (hH : Real.sqrt 3 / 2 < H) : Complex.mul_re, Complex.I_re, Complex.I_im, Complex.ofReal_im, Complex.add_im, Complex.mul_im, Complex.one_re, Complex.one_im, Complex.div_ofNat] - have hH0 : 0 < H := by linarith [Real.sqrt_pos.mpr (show (0 : ℝ) < 3 from by norm_num)] - nlinarith [mul_lt_mul hH hH.le (by positivity : (0 : ℝ) < Real.sqrt 3 / 2) hH0.le, - Real.mul_self_sqrt (show (0 : ℝ) ≤ 3 from by norm_num)]) - linarith + have hH0 : 0 < H := by + linarith only [hH, Real.sqrt_pos.mpr (show (0 : ℝ) < 3 from by norm_num)] + nlinarith only [hH, hH0, + mul_lt_mul hH hH.le (by positivity : (0 : ℝ) < Real.sqrt 3 / 2) hH0.le, + Real.mul_self_sqrt (show (0 : ℝ) ≤ 3 from by norm_num)]) + linarith only [h_norm, this] · push Not at ht3 have h_re_t := fdBoundary_H_seg4_re' H ht3 ht.2 rw [habs] at h_re_t @@ -156,7 +157,8 @@ private lemma endpoint_norm_seg1 (H : ℝ) (s : ℂ) (hs_def : s = (1 / 2 : ℂ) (t : ℝ) (ht0 : 0 ≤ t) (ht1 : t ≤ 1) : ‖fdBoundaryH H t - s‖ = t * c := by rw [endpoint_diff_seg1 H s hs_def c hc_def t ht0 ht1, norm_mul, Complex.norm_real, - Complex.norm_I, mul_one, Real.norm_eq_abs, abs_of_nonpos (by nlinarith : (-t) * c ≤ 0)] + Complex.norm_I, mul_one, Real.norm_eq_abs, abs_of_nonpos (by nlinarith only [hc, + ht0] : (-t) * c ≤ 0)] ring /-- Norm on seg5: `‖fdBoundaryH H t - s‖ = 5 - t` for the endpoint. -/ @@ -164,7 +166,7 @@ private lemma endpoint_norm_seg5 (H : ℝ) (s : ℂ) (hs_def : s = (1 / 2 : ℂ) (t : ℝ) (ht4 : 4 < t) (ht5 : t ≤ 5) : ‖fdBoundaryH H t - s‖ = 5 - t := by rw [endpoint_diff_seg5 H s hs_def t ht4, Complex.norm_real, Real.norm_eq_abs, - abs_of_nonpos (by linarith)] + abs_of_nonpos (by linarith only [ht5])] ring /-- Integrand on seg1: `(γ t - s)⁻¹ * γ'(t) = t⁻¹` for the endpoint. -/ @@ -377,7 +379,7 @@ private lemma corner_cpv_03 (H : ℝ) (hH : Real.sqrt 3 / 2 < H) : rw [habs, hs_def] at hre simp only [Complex.add_re, Complex.neg_re, Complex.ofReal_re, Complex.mul_re, Complex.I_re, Complex.I_im, Complex.ofReal_im, Complex.one_re, Complex.div_ofNat] at hre - linarith + linarith only [hre] · push Not at ht1 by_cases ht3 : t < 3 · have h_norm : ‖fdBoundaryH H t‖ = 1 := by @@ -388,21 +390,27 @@ private lemma corner_cpv_03 (H : ℝ) (hH : Real.sqrt 3 / 2 < H) : Complex.ofReal_re, Complex.mul_re, Complex.I_re, Complex.I_im, Complex.ofReal_im, Complex.add_im, Complex.neg_im, Complex.mul_im, Complex.one_re, Complex.one_im, Complex.div_ofNat] - have hH0 : 0 < H := by linarith [Real.sqrt_pos.mpr (show (0 : ℝ) < 3 from by norm_num)] - nlinarith [mul_lt_mul hH hH.le (by positivity : (0 : ℝ) < Real.sqrt 3 / 2) hH0.le, - Real.mul_self_sqrt (show (0 : ℝ) ≤ 3 from by norm_num)]) - linarith - · have ht3_eq : t = 3 := le_antisymm ht.2 (by linarith) + have hH0 : 0 < H := by + linarith only [hH, Real.sqrt_pos.mpr (show (0 : ℝ) < 3 from by norm_num)] + nlinarith only [hH, hH0, + mul_lt_mul hH hH.le (by positivity : (0 : ℝ) < Real.sqrt 3 / 2) hH0.le, + Real.mul_self_sqrt (show (0 : ℝ) ≤ 3 from by norm_num)]) + linarith only [h_norm, this] + · have ht3_eq : t = 3 := le_antisymm ht.2 (by linarith only [ht3]) subst ht3_eq rw [fdBoundary_H_at_three] at habs have him_s : s.im = H := by - simp_all + simp_all only [one_div, Nat.ofNat_nonneg, Std.le_refl, and_self, Nat.one_lt_ofNat, + lt_self_iff_false, + not_false_eq_true, add_im, neg_im, inv_im, im_ofNat, neg_zero, normSq_ofNat, + zero_div, mul_im, ofReal_re, I_im, + mul_one, ofReal_im, I_re, mul_zero, add_zero, zero_add] rw [← habs] at him_s have him_rho : (ellipticPointRho : ℂ).im = Real.sqrt 3 / 2 := by simp [ellipticPointRho, ellipticPointRho', UpperHalfPlane.coe_mk, Complex.add_im, Complex.neg_im, Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.I_im, Complex.ofReal_re, Complex.div_ofNat] - linarith [him_rho] + linarith only [hH, him_s, him_rho] private lemma integral_inv_shift_four (a b : ℝ) : (∫ t in a..b, (↑(t - 4) : ℂ)⁻¹) = ∫ u in (a - 4)..(b - 4), (↑u : ℂ)⁻¹ := by diff --git a/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/Main.lean b/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/Main.lean index 75d33667ad..c97bea2cb5 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/Main.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/OnCurvePV/Main.lean @@ -8,7 +8,6 @@ module public import LeanPool.LeanModularForms.GeneralizedResidueTheory.Basic public import LeanPool.LeanModularForms.ValenceFormula.Boundary.Basic import LeanPool.LeanModularForms.GeneralizedResidueTheory.OnCurvePV.Basic -import LeanPool.LeanModularForms.ValenceFormula.Boundary.Bounds import LeanPool.LeanModularForms.ValenceFormula.Boundary.Smooth import LeanPool.LeanModularForms.ValenceFormula.OnCurvePV.Basic import LeanPool.LeanModularForms.ValenceFormula.OnCurvePV.EndpointCorner @@ -55,17 +54,18 @@ private theorem cpv_exists_at_I_H_lt_one (H : ℝ) (hH : Real.sqrt 3 / 2 < H) · have := fdBoundary_H_seg1_re' H ht.1 ht1 rw [h_eq] at this; norm_num [Complex.I_re] at this · push Not at ht1 - rw [(h_arc_I_iff ht1 (by linarith [ht.2])).mp h_eq] at ht; linarith [ht.2] + rw [(h_arc_I_iff ht1 (by linarith only [ht, ht.2])).mp h_eq] at ht; linarith only [ht, + ht.2] · intro t ht h_eq by_cases ht3 : t < 3 - · have ht1 : 1 < t := by linarith [ht.1] - rw [(h_arc_I_iff ht1 ht3).mp h_eq] at ht; linarith [ht.1] + · have ht1 : 1 < t := by linarith only [ht, ht.1] + rw [(h_arc_I_iff ht1 ht3).mp h_eq] at ht; linarith only [ht, ht.1] · push Not at ht3 by_cases ht4 : t ≤ 4 · rcases eq_or_lt_of_le ht3 with rfl | ht3' · exact hγ3_ne_I h_eq · have := fdBoundary_H_seg4_re' H ht3' ht4; rw [h_eq] at this; norm_num at this - · simp_all + · simp_all only [ne_eq, Nat.one_lt_ofNat, mem_Icc, not_le] /-! ### Helper: s = I, H = 1 -/ @@ -94,15 +94,15 @@ private theorem cpv_exists_at_I_H_eq_one (hH : Real.sqrt 3 / 2 < (1 : ℝ)) · erw [(fdBoundary_H_hasDerivAt_seg5 1 (show (4 : ℝ) < 9/2 from by norm_num)).deriv] exact one_ne_zero · apply (fdBoundary_H_deriv_continuousOn_Ioo_45 1).mono - intro t ht; exact ⟨by linarith [ht.1], by linarith [ht.2]⟩ + intro t ht; exact ⟨by linarith only [ht, ht.1], by linarith only [ht, ht.2]⟩ · intro t ht hγt - have ht4 : 4 < t := by linarith [ht.1] - have ht5 : t ≤ 5 := by linarith [ht.2] + have ht4 : 4 < t := by linarith only [ht, ht.1] + have ht5 : t ≤ 5 := by linarith only [ht, ht.2] have h_re_t := fdBoundary_H_seg5_re' 1 ht4 ht5 have h_re_92 := fdBoundary_H_seg5_re' 1 (show (4 : ℝ) < 9/2 from by norm_num) (show (9 : ℝ)/2 ≤ 5 from by norm_num) have : (fdBoundaryH 1 t).re = (fdBoundaryH 1 (9/2)).re := by rw [hγt] - linarith + linarith only [h_re_t, h_re_92, this] have h_cpv_0_52 : CauchyPrincipalValueExists' (fun z => (z - I)⁻¹) (fdBoundaryH 1) 0 (5/2) I := by apply cpv_concat _ _ 0 (3/2) (5/2) I @@ -112,7 +112,8 @@ private theorem cpv_exists_at_I_H_eq_one (hH : Real.sqrt 3 / 2 < (1 : ℝ)) · have := fdBoundary_H_seg1_re' 1 ht.1 ht1 rw [h_eq] at this; norm_num [Complex.I_re] at this · push Not at ht1 - rw [(h_arc_I_iff ht1 (by linarith [ht.2])).mp h_eq] at ht; linarith [ht.2] + rw [(h_arc_I_iff ht1 (by linarith only [ht, ht.2])).mp h_eq] at ht; linarith only [ht, + ht.2] · exact h_arc_cpv · norm_num · norm_num @@ -127,16 +128,16 @@ private theorem cpv_exists_at_I_H_eq_one (hH : Real.sqrt 3 / 2 < (1 : ℝ)) · apply cpv_avoidance _ _ _ _ _ (fdBoundary_H_continuous 1).continuousOn (by norm_num) intro t ht h_eq by_cases ht3 : t < 3 - · have ht1 : 1 < t := by linarith [ht.1] - rw [(h_arc_I_iff ht1 ht3).mp h_eq] at ht; linarith [ht.1] + · have ht1 : 1 < t := by linarith only [ht, ht.1] + rw [(h_arc_I_iff ht1 ht3).mp h_eq] at ht; linarith only [ht, ht.1] · push Not at ht3 by_cases ht4 : t ≤ 4 · rcases eq_or_lt_of_le ht3 with rfl | ht3' · exact hγ3_ne_I h_eq · have := fdBoundary_H_seg4_re' 1 ht3' ht4; rw [h_eq] at this; norm_num at this · push Not at ht4 - have := fdBoundary_H_seg5_re' 1 ht4 (by linarith [ht.2]) - rw [h_eq] at this; simp only [Complex.I_re] at this; linarith [ht.2] + have := fdBoundary_H_seg5_re' 1 ht4 (by linarith only [ht, ht.2]) + rw [h_eq] at this; simp only [Complex.I_re] at this; linarith only [ht, ht4, this, ht.2] · exact h_seg5_cpv · norm_num · norm_num @@ -159,7 +160,7 @@ private theorem cpv_exists_at_I_H_eq_one (hH : Real.sqrt 3 / 2 < (1 : ℝ)) apply cpv_avoidance _ _ _ _ _ (fdBoundary_H_continuous 1).continuousOn (by norm_num) intro t ht h_eq have := fdBoundary_H_seg5_re' 1 (lt_of_lt_of_le (by norm_num : (4:ℝ) < 19/4) ht.1) ht.2 - rw [h_eq] at this; simp only [Complex.I_re] at this; linarith [ht.1] + rw [h_eq] at this; simp only [Complex.I_re] at this; linarith only [ht, this, ht.1] apply cpv_concat _ _ 0 (19/4) 5 I h_cpv_0_194 h_cpv_194_5 (by norm_num) (by norm_num) intro ε hε; exact fdBoundary_H_cutout_ii 1 hH I ε hε @@ -174,7 +175,7 @@ private theorem cpv_exists_generic_seg1 (H : ℝ) (hH : Real.sqrt 3 / 2 < H) (s CauchyPrincipalValueExists' (fun z => (z - s)⁻¹) (fdBoundaryH H) 0 5 s := by have ht₀_gt_0 : 0 < t₀ := lt_of_le_of_ne ht₀_mem.1 (Ne.symm ht₀_ne_0) apply cpv_extend_to_full_interval H hH s (t₀ / 2) ((t₀ + 1) / 2) - (by linarith) (by linarith) (by linarith) + (by linarith only [ht₀_mem]) (by linarith only [ht₀_mem]) (by linarith only []) · apply cpv_exists_on_smooth_subinterval H hH s ⟨by linarith, by linarith⟩ hγt₀ · have heq : fdBoundaryH H =ᶠ[𝓝 t₀] @@ -277,10 +278,10 @@ private theorem cpv_exists_generic_arc_seg5_cross (H : ℝ) (hH : Real.sqrt 3 / (h_seg5_cross : s.im = H) : CauchyPrincipalValueExists' (fun z => (z - s)⁻¹) (fdBoundaryH H) 0 5 s := by set t₁ := s.re + 9/2 with ht₁_def - have ht₁_gt4 : 4 < t₁ := by simp [ht₁_def]; linarith [h_re_s_gt] - have ht₁_lt5 : t₁ < 5 := by simp [ht₁_def]; linarith [h_re_s_lt] + have ht₁_gt4 : 4 < t₁ := by simp [ht₁_def]; linarith only [h_re_s_gt] + have ht₁_lt5 : t₁ < 5 := by simp [ht₁_def]; linarith only [h_re_s_lt] have hγt₁ : fdBoundaryH H t₁ = s := by - rw [fdBoundary_H_eq_seg5_H (by linarith : 4 < t₁)] + rw [fdBoundary_H_eq_seg5_H (by linarith only [ht₁_gt4] : 4 < t₁)] apply Complex.ext · simp [fdBoundarySeg5H, Complex.add_re, Complex.ofReal_re, Complex.mul_re, Complex.I_re, Complex.I_im, Complex.ofReal_im, ht₁_def] @@ -290,7 +291,7 @@ private theorem cpv_exists_generic_arc_seg5_cross (H : ℝ) (hH : Real.sqrt 3 / have h_seg5_cpv : CauchyPrincipalValueExists' (fun z => (z - s)⁻¹) (fdBoundaryH H) ((t₁ + 4) / 2) ((t₁ + 5) / 2) s := by apply cpv_exists_on_smooth_subinterval H hH s - ⟨by linarith, by linarith⟩ hγt₁ + ⟨by linarith only [ht₁_gt4], by linarith only [ht₁_lt5]⟩ hγt₁ · have heq_fn : ∀ u ∈ Set.Ioi (4 : ℝ), fdBoundaryH H u = (↑(u - 9/2) : ℂ) + ↑H * I := by intro u (hu : 4 < u) @@ -304,41 +305,43 @@ private theorem cpv_exists_generic_arc_seg5_cross (H : ℝ) (hH : Real.sqrt 3 / (contDiffAt_id.sub contDiffAt_const)).add contDiffAt_const · erw [(fdBoundary_H_hasDerivAt_seg5 H ht₁_gt4).deriv]; exact one_ne_zero · apply (fdBoundary_H_deriv_continuousOn_Ioo_45 H).mono - intro t ht; exact ⟨by linarith [ht.1], by linarith [ht.2]⟩ + intro t ht; exact ⟨by linarith only [ht₁_gt4, ht, ht.1], by linarith only [ht₁_lt5, ht, ht.2]⟩ · intro t ht hγt - have ht4 : 4 < t := by linarith [ht.1] - have ht5 : t ≤ 5 := by linarith [ht.2] + have ht4 : 4 < t := by linarith only [ht₁_gt4, ht, ht.1] + have ht5 : t ≤ 5 := by linarith only [ht₁_lt5, ht, ht.2] have h_re_t := fdBoundary_H_seg5_re' H ht4 ht5 - simp_all + simp_all only [one_div, mem_Icc, sub_add_cancel] have h_cpv_0_t0h : CauchyPrincipalValueExists' (fun z => (z - s)⁻¹) (fdBoundaryH H) 0 ((t₀ + 3) / 2) s := by apply cpv_concat _ _ 0 ((t₀ + 1) / 2) ((t₀ + 3) / 2) s - · apply cpv_avoidance _ _ _ _ _ (fdBoundary_H_continuous H).continuousOn (by linarith) + · apply cpv_avoidance _ _ _ _ _ (fdBoundary_H_continuous H).continuousOn (by + linarith only [ht₀_gt_1, ht₁_gt4, ht₁_lt5]) intro t ht h_eq by_cases ht1 : t ≤ 1 · have := fdBoundary_H_seg1_re' H ht.1 ht1 - rw [h_eq] at this; linarith + rw [h_eq] at this; linarith only [ht₁_def, ht₁_lt5, this] · push Not at ht1 - have ht3 : t < 3 := by linarith [ht.2] - have h_ne : t ≠ t₀ := by linarith [ht.2] + have ht3 : t < 3 := by linarith only [ht₀_lt_3, ht₁_gt4, ht₁_lt5, ht, ht.2] + have h_ne : t ≠ t₀ := by linarith only [ht, ht1, ht.2] exact h_ne (arc_angle_injective ⟨ht1, ht3⟩ ⟨ht₀_gt_1, ht₀_lt_3⟩ (by have := h_eq.trans hγt₀.symm rwa [fdBoundary_H_eq_arc ht1 ht3, fdBoundary_H_eq_arc ht₀_gt_1 ht₀_lt_3] at this)) · exact h_arc_cpv - · linarith - · linarith + · linarith only [ht₀_gt_1, ht₁_gt4, ht₁_lt5] + · linarith only [] · intro ε hε; exact (fdBoundary_H_cutout_ii H hH s ε hε).mono_set (by - rw [Set.uIcc_of_le (by linarith : (0 : ℝ) ≤ (t₀ + 3) / 2), + rw [Set.uIcc_of_le (by linarith only [ht₀_gt_1, ht₁_gt4, ht₁_lt5] : (0 : ℝ) ≤ (t₀ + 3) / 2), Set.uIcc_of_le (by norm_num : (0 : ℝ) ≤ 5)] - exact Set.Icc_subset_Icc_right (by linarith)) + exact Set.Icc_subset_Icc_right (by linarith only [ht₀_lt_3, ht₁_gt4, ht₁_lt5])) have h_cpv_mid_avoid : CauchyPrincipalValueExists' (fun z => (z - s)⁻¹) (fdBoundaryH H) ((t₀ + 3) / 2) ((t₁ + 4) / 2) s := by - apply cpv_avoidance _ _ _ _ _ (fdBoundary_H_continuous H).continuousOn (by linarith) + apply cpv_avoidance _ _ _ _ _ (fdBoundary_H_continuous H).continuousOn (by + linarith only [ht₀_lt_3, ht₁_gt4, ht₁_lt5]) intro t ht h_eq by_cases ht3 : t < 3 - · have ht1 : 1 < t := by linarith [ht.1] - have h_ne : t ≠ t₀ := by linarith [ht.1] + · have ht1 : 1 < t := by linarith only [ht₀_gt_1, ht₁_gt4, ht₁_lt5, ht, ht.1] + have h_ne : t ≠ t₀ := by linarith only [ht, ht3, ht.1] exact h_ne (arc_angle_injective ⟨ht1, ht3⟩ ⟨ht₀_gt_1, ht₀_lt_3⟩ (by have := h_eq.trans hγt₀.symm rwa [fdBoundary_H_eq_arc ht1 ht3, @@ -348,37 +351,43 @@ private theorem cpv_exists_generic_arc_seg5_cross (H : ℝ) (hH : Real.sqrt 3 / · rcases eq_or_lt_of_le ht3 with rfl | ht3' · exact absurd_fdBoundaryH_three_eq hs_rho h_eq · have := fdBoundary_H_seg4_re' H ht3' ht4 - rw [h_eq] at this; linarith + rw [h_eq] at this; linarith only [h_re_s_gt, this] · push Not at ht4 - have := fdBoundary_H_seg5_re' H ht4 (by linarith [ht.2]) + have := fdBoundary_H_seg5_re' H ht4 (by linarith only [ht₁_gt4, ht₁_lt5, ht, ht.2]) rw [h_eq] at this - simp [ht₁_def] at *; linarith [ht.2] + simp [ht₁_def] at *; linarith only [ht4, this, ht, ht.2] have h_cpv_mid : CauchyPrincipalValueExists' (fun z => (z - s)⁻¹) (fdBoundaryH H) ((t₀ + 3) / 2) ((t₁ + 5) / 2) s := by apply cpv_concat _ _ ((t₀ + 3) / 2) ((t₁ + 4) / 2) ((t₁ + 5) / 2) s - h_cpv_mid_avoid h_seg5_cpv (by linarith) (by linarith) + h_cpv_mid_avoid h_seg5_cpv (by linarith only [ht₀_lt_3, ht₁_gt4, ht₁_lt5]) + (by linarith only []) intro ε hε; exact (fdBoundary_H_cutout_ii H hH s ε hε).mono_set (by - rw [Set.uIcc_of_le (by linarith : (t₀ + 3) / 2 ≤ (t₁ + 5) / 2), + rw [Set.uIcc_of_le (by linarith only [ht₀_lt_3, ht₁_gt4, + ht₁_lt5] : (t₀ + 3) / 2 ≤ (t₁ + 5) / 2), Set.uIcc_of_le (by norm_num : (0 : ℝ) ≤ 5)] - exact Set.Icc_subset_Icc (by linarith) (by linarith)) + exact Set.Icc_subset_Icc (by linarith only [ht₀_gt_1, ht₁_gt4, ht₁_lt5]) + (by linarith only [ht₁_lt5])) have h_cpv_0_t1h : CauchyPrincipalValueExists' (fun z => (z - s)⁻¹) (fdBoundaryH H) 0 ((t₁ + 5) / 2) s := by apply cpv_concat _ _ 0 ((t₀ + 3) / 2) ((t₁ + 5) / 2) s - h_cpv_0_t0h h_cpv_mid (by linarith) (by linarith) + h_cpv_0_t0h h_cpv_mid (by linarith only [ht₀_gt_1, ht₁_gt4, ht₁_lt5]) (by + linarith only [ht₀_lt_3, ht₁_gt4, ht₁_lt5]) intro ε hε; exact (fdBoundary_H_cutout_ii H hH s ε hε).mono_set (by - rw [Set.uIcc_of_le (by linarith : (0 : ℝ) ≤ (t₁ + 5) / 2), + rw [Set.uIcc_of_le (by linarith only [ht₁_gt4, ht₁_lt5] : (0 : ℝ) ≤ (t₁ + 5) / 2), Set.uIcc_of_le (by norm_num : (0 : ℝ) ≤ 5)] - exact Set.Icc_subset_Icc_right (by linarith)) + exact Set.Icc_subset_Icc_right (by linarith only [ht₁_lt5])) have h_cpv_end : CauchyPrincipalValueExists' (fun z => (z - s)⁻¹) (fdBoundaryH H) ((t₁ + 5) / 2) 5 s := by - apply cpv_avoidance _ _ _ _ _ (fdBoundary_H_continuous H).continuousOn (by linarith) + apply cpv_avoidance _ _ _ _ _ (fdBoundary_H_continuous H).continuousOn (by + linarith only [ht₁_lt5]) intro t ht h_eq - have ht4 : 4 < t := by linarith [ht.1] + have ht4 : 4 < t := by linarith only [ht₁_gt4, ht₁_lt5, ht, ht.1] have := fdBoundary_H_seg5_re' H ht4 ht.2 rw [h_eq] at this - simp [ht₁_def] at *; linarith [ht.1] + simp [ht₁_def] at *; linarith only [this, h_re_s_lt, ht, ht.1] exact cpv_concat _ _ 0 ((t₁ + 5) / 2) 5 s h_cpv_0_t1h h_cpv_end - (by linarith) (by linarith) (fun ε hε => fdBoundary_H_cutout_ii H hH s ε hε) + (by linarith only [ht₁_gt4, ht₁_lt5]) + (by linarith only [ht₁_lt5]) (fun ε hε => fdBoundary_H_cutout_ii H hH s ε hε) /-! ### Helper: generic case, t₀ on arc (1 < t₀ < 3) without seg5 crossing -/ @@ -392,21 +401,21 @@ private theorem cpv_exists_generic_arc_no_cross (H : ℝ) (hH : Real.sqrt 3 / 2 (h_seg5_cross : ¬(s.im = H)) : CauchyPrincipalValueExists' (fun z => (z - s)⁻¹) (fdBoundaryH H) 0 5 s := by apply cpv_extend_to_full_interval H hH s ((t₀ + 1) / 2) ((t₀ + 3) / 2) - (by linarith) (by linarith) (by linarith) h_arc_cpv + (by linarith only [ht₀_gt_1]) (by linarith only [ht₀_lt_3]) (by linarith only []) h_arc_cpv · intro t ht h_eq by_cases ht1 : t ≤ 1 - · have := fdBoundary_H_seg1_re' H ht.1 ht1; rw [h_eq] at this; linarith + · have := fdBoundary_H_seg1_re' H ht.1 ht1; rw [h_eq] at this; linarith only [h_re_s_lt, this] · push Not at ht1 - have ht3 : t < 3 := by linarith [ht.2] - have h_ne : t ≠ t₀ := by linarith [ht.2] + have ht3 : t < 3 := by linarith only [ht₀_lt_3, ht, ht.2] + have h_ne : t ≠ t₀ := by linarith only [ht, ht1, ht.2] exact h_ne (arc_angle_injective ⟨ht1, ht3⟩ ⟨ht₀_gt_1, ht₀_lt_3⟩ (by have := h_eq.trans hγt₀.symm rwa [fdBoundary_H_eq_arc ht1 ht3, fdBoundary_H_eq_arc ht₀_gt_1 ht₀_lt_3] at this)) · intro t ht h_eq by_cases ht3 : t < 3 - · have ht1 : 1 < t := by linarith [ht.1] - have h_ne : t ≠ t₀ := by linarith [ht.1] + · have ht1 : 1 < t := by linarith only [ht₀_gt_1, ht, ht.1] + have h_ne : t ≠ t₀ := by linarith only [ht, ht3, ht.1] exact h_ne (arc_angle_injective ⟨ht1, ht3⟩ ⟨ht₀_gt_1, ht₀_lt_3⟩ (by have := h_eq.trans hγt₀.symm rwa [fdBoundary_H_eq_arc ht1 ht3, @@ -416,7 +425,7 @@ private theorem cpv_exists_generic_arc_no_cross (H : ℝ) (hH : Real.sqrt 3 / 2 · rcases eq_or_lt_of_le ht3 with rfl | ht3' · exact absurd_fdBoundaryH_three_eq hs_rho h_eq · have := fdBoundary_H_seg4_re' H ht3' ht4 - rw [h_eq] at this; linarith + rw [h_eq] at this; linarith only [h_re_s_gt, this] · push Not at ht4 have := fdBoundary_H_seg5_im' H ht4 ht.2 rw [h_eq] at this; exact h_seg5_cross this @@ -434,30 +443,30 @@ private theorem cpv_exists_generic_arc (H : ℝ) (hH : Real.sqrt 3 / 2 < H) (s : rw [← hγt₀]; exact fdBoundary_H_arc_im' H ht₀_gt_1 ht₀_lt_3 have h_normSq_s : Complex.normSq s = 1 := by rw [Complex.normSq_apply, h_re_s, h_im_s_arc] - linarith [Real.sin_sq_add_cos_sq (Real.pi * (1 + t₀) / 6)] + linarith only [Real.sin_sq_add_cos_sq (Real.pi * (1 + t₀) / 6)] have h_re_s_lt : s.re < 1/2 := by rw [h_re_s] have h1 : Real.pi * (1 + t₀) / 6 ∈ Set.Icc 0 Real.pi := - ⟨by nlinarith [Real.pi_pos], by nlinarith [Real.pi_pos]⟩ + ⟨by nlinarith only [ht₀_gt_1, Real.pi_pos], by nlinarith only [ht₀_lt_3, Real.pi_pos]⟩ have h2 : Real.pi / 3 ∈ Set.Icc 0 Real.pi := - ⟨by positivity, by linarith [Real.pi_pos]⟩ - have := Real.strictAntiOn_cos h2 h1 (by nlinarith [Real.pi_pos]) - linarith [Real.cos_pi_div_three] + ⟨by positivity, by linarith only [Real.pi_pos]⟩ + have := Real.strictAntiOn_cos h2 h1 (by nlinarith only [ht₀_gt_1, Real.pi_pos]) + linarith only [this, Real.cos_pi_div_three] have h_re_s_gt : -(1 : ℝ)/2 < s.re := by rw [h_re_s] have h1 : Real.pi * (1 + t₀) / 6 ∈ Set.Icc 0 Real.pi := - ⟨by nlinarith [Real.pi_pos], by nlinarith [Real.pi_pos]⟩ + ⟨by nlinarith only [ht₀_gt_1, Real.pi_pos], by nlinarith only [ht₀_lt_3, Real.pi_pos]⟩ have h2 : Real.pi * 2 / 3 ∈ Set.Icc 0 Real.pi := - ⟨by positivity, by nlinarith [Real.pi_pos]⟩ - have := Real.strictAntiOn_cos h1 h2 (by nlinarith [Real.pi_pos]) + ⟨by positivity, by nlinarith only [Real.pi_pos]⟩ + have := Real.strictAntiOn_cos h1 h2 (by nlinarith only [ht₀_lt_3, Real.pi_pos]) have h_cos23 : Real.cos (Real.pi * 2 / 3) = -(1 : ℝ)/2 := by rw [show Real.pi * 2 / 3 = Real.pi - Real.pi / 3 from by ring, Real.cos_pi_sub, Real.cos_pi_div_three]; ring - linarith + linarith only [this, h_cos23] have h_arc_cpv : CauchyPrincipalValueExists' (fun z => (z - s)⁻¹) (fdBoundaryH H) ((t₀ + 1) / 2) ((t₀ + 3) / 2) s := by apply cpv_exists_on_smooth_subinterval H hH s - ⟨by linarith, by linarith⟩ hγt₀ + ⟨by linarith only [ht₀_gt_1], by linarith only [ht₀_lt_3]⟩ hγt₀ · have heq : fdBoundaryH H =ᶠ[𝓝 t₀] (fun u => Complex.exp (↑(Real.pi * (1 + u) / 6) * I)) := Filter.eventuallyEq_iff_exists_mem.mpr ⟨Set.Ioo 1 3, @@ -465,14 +474,21 @@ private theorem cpv_exists_generic_arc (H : ℝ) (hH : Real.sqrt 3 / 2 < H) (s : fun u hu => fdBoundary_H_eq_arc hu.1 hu.2⟩ apply ContDiffAt.congr_of_eventuallyEq _ heq exact ((Complex.ofRealCLM.contDiff.contDiffAt.comp t₀ - (by fun_prop : ContDiffAt ℝ 2 (fun u : ℝ => Real.pi * (1 + u) / 6) t₀)).mul + (by + exact ContDiffAt.div_const + (ContDiffAt.mul contDiffAt_const (ContDiffAt.add contDiffAt_const contDiffAt_id)) 6 : + ContDiffAt ℝ 2 (fun u : ℝ => Real.pi * (1 + u) / 6) t₀)).mul contDiffAt_const).cexp · erw [(fdBoundary_H_hasDerivAt_arc H ht₀_gt_1 ht₀_lt_3).deriv] - simp_all + simp_all only [one_div, ne_eq, mul_eq_zero, exp_ne_zero, div_eq_zero_iff, ofReal_eq_zero, + Real.pi_ne_zero, + OfNat.ofNat_ne_zero, or_self, I_ne_zero, not_false_eq_true] · apply (fdBoundary_H_deriv_continuousOn_Ioo_13 H).mono - intro t ht; exact ⟨by linarith [ht.1], by linarith [ht.2]⟩ + intro t ht; exact ⟨by linarith only [ht₀_gt_1, ht, ht.1], by linarith only [ht₀_lt_3, ht, + ht.2]⟩ · intro t ht hγt - have ht' : t ∈ Set.Ioo (1 : ℝ) 3 := ⟨by linarith [ht.1], by linarith [ht.2]⟩ + have ht' : t ∈ Set.Ioo (1 : ℝ) 3 := ⟨by linarith only [ht₀_gt_1, ht, ht.1], by + linarith only [ht₀_lt_3, ht, ht.2]⟩ exact arc_angle_injective ht' ⟨ht₀_gt_1, ht₀_lt_3⟩ (by rw [fdBoundary_H_eq_arc ht'.1 ht'.2, fdBoundary_H_eq_arc ht₀_gt_1 ht₀_lt_3] at hγt; exact hγt) @@ -490,7 +506,7 @@ private theorem cpv_exists_generic_seg4 (H : ℝ) (hH : Real.sqrt 3 / 2 < H) (s (ht₀_gt_3 : 3 < t₀) (ht₀_lt_4 : t₀ < 4) : CauchyPrincipalValueExists' (fun z => (z - s)⁻¹) (fdBoundaryH H) 0 5 s := by apply cpv_extend_to_full_interval H hH s ((t₀ + 3) / 2) ((t₀ + 4) / 2) - (by linarith) (by linarith) (by linarith) + (by linarith) (by linarith) (by linarith only []) · apply cpv_exists_on_smooth_subinterval H hH s ⟨by linarith, by linarith⟩ hγt₀ · have heq_fn : ∀ u ∈ Set.Ioo (3 : ℝ) 4, @@ -583,7 +599,9 @@ private theorem cpv_exists_generic_seg4 (H : ℝ) (hH : Real.sqrt 3 / 2 < H) (s · subst ht4_eq have h_im_eq : s.im = H := by rw [← h_eq, fdBoundary_H_at_four] - simp_all + simp_all only [mem_Icc, Std.le_refl, add_im, div_ofNat_im, neg_im, one_im, neg_zero, + zero_div, mul_im, + ofReal_re, I_im, mul_one, ofReal_im, I_re, mul_zero, add_zero, zero_add] rw [← hγt₀, fdBoundary_H_eq_seg4_H (by linarith) (le_of_lt ht₀_lt_4)] at h_im_eq simp [fdBoundarySeg4H] at h_im_eq @@ -612,29 +630,33 @@ private theorem cpv_exists_generic_seg5_normSq_one (H : ℝ) (hH : Real.sqrt 3 / (fdBoundaryH H) ((t₀ + 4) / 2) ((t₀ + 5) / 2) s) (h_normSq : Complex.normSq s = 1) : CauchyPrincipalValueExists' (fun z => (z - s)⁻¹) (fdBoundaryH H) 0 5 s := by - have h_re_s_lt : s.re < 1/2 := by linarith [h_re_s] - have h_re_s_gt : -(1 : ℝ)/2 < s.re := by linarith [h_re_s] + have h_re_s_lt : s.re < 1/2 := by linarith only [ht₀_lt_5, h_re_s] + have h_re_s_gt : -(1 : ℝ)/2 < s.re := by linarith only [ht₀_gt_4, h_re_s] have h_ivt : s.re ∈ (fun t => Real.cos (Real.pi * (1 + t) / 6)) '' Set.Icc (1 : ℝ) 3 := by apply intermediate_value_Icc' (by norm_num : (1 : ℝ) ≤ 3) · exact (Real.continuous_cos.comp - (by fun_prop : Continuous (fun t => Real.pi * (1 + t) / 6))).continuousOn + (by + exact Continuous.comp' (Continuous.div_const continuous_id' 6) + (Continuous.comp' (continuous_const_mul π) (Continuous.const_add continuous_id' 1)) + : Continuous (fun t => Real.pi * (1 + t) / 6))).continuousOn · constructor · rw [show Real.pi * (1 + 3) / 6 = Real.pi - Real.pi / 3 from by ring, - Real.cos_pi_sub, Real.cos_pi_div_three]; linarith + Real.cos_pi_sub, Real.cos_pi_div_three]; linarith only [ht₀_gt_4, h_re_s] · rw [show Real.pi * (1 + 1) / 6 = Real.pi / 3 from by ring, - Real.cos_pi_div_three]; linarith + Real.cos_pi_div_three]; linarith only [ht₀_lt_5, h_re_s] obtain ⟨t₁, ht₁_mem, ht₁_cos⟩ := h_ivt simp only [] at ht₁_cos have ht₁_gt1 : 1 < t₁ := by rcases eq_or_lt_of_le ht₁_mem.1 with rfl | h · rw [show Real.pi * (1 + 1) / 6 = Real.pi / 3 from by ring, - Real.cos_pi_div_three] at ht₁_cos; linarith + Real.cos_pi_div_three] at ht₁_cos; linarith only [ht₀_lt_5, h_re_s, ht₁_cos] · exact h have ht₁_lt3 : t₁ < 3 := by rcases eq_or_lt_of_le ht₁_mem.2 with rfl | h · rw [show Real.pi * (1 + 3) / 6 = Real.pi - Real.pi / 3 from by ring, - Real.cos_pi_sub, Real.cos_pi_div_three] at ht₁_cos; linarith + Real.cos_pi_sub, Real.cos_pi_div_three] at ht₁_cos; linarith only [ht₀_gt_4, h_re_s, + ht₁_cos] · exact h have hγt₁ : fdBoundaryH H t₁ = s := by rw [fdBoundary_H_eq_arc ht₁_gt1 ht₁_lt3] @@ -643,17 +665,18 @@ private theorem cpv_exists_generic_seg5_normSq_one (H : ℝ) (hH : Real.sqrt 3 / · rw [Complex.exp_ofReal_mul_I_im] have h_sin_pos : 0 < Real.sin (Real.pi * (1 + t₁) / 6) := Real.sin_pos_of_pos_of_lt_pi - (by nlinarith [Real.pi_pos]) (by nlinarith [Real.pi_pos]) + (by nlinarith only [ht₀_gt_4, ht₀_lt_5, ht₁_gt1, Real.pi_pos]) (by + nlinarith only [ht₀_gt_4, ht₀_lt_5, ht₁_lt3, Real.pi_pos]) exact (sq_eq_sq₀ (le_of_lt h_sin_pos) - (by rw [h_im_s]; linarith [hH, Real.sqrt_nonneg 3] : (0 : ℝ) ≤ s.im)).mp (by + (by rw [h_im_s]; linarith only [hH, Real.sqrt_nonneg 3] : (0 : ℝ) ≤ s.im)).mp (by have h1 := Real.sin_sq_add_cos_sq (Real.pi * (1 + t₁) / 6) rw [ht₁_cos] at h1 rw [Complex.normSq_apply] at h_normSq - nlinarith) + nlinarith only [h_normSq, h1]) have h_arc_cpv : CauchyPrincipalValueExists' (fun z => (z - s)⁻¹) (fdBoundaryH H) ((t₁ + 1) / 2) ((t₁ + 3) / 2) s := by apply cpv_exists_on_smooth_subinterval H hH s - ⟨by linarith, by linarith⟩ hγt₁ + ⟨by linarith only [ht₁_gt1], by linarith only [ht₁_lt3]⟩ hγt₁ · have heq : fdBoundaryH H =ᶠ[𝓝 t₁] (fun u => Complex.exp (↑(Real.pi * (1 + u) / 6) * I)) := Filter.eventuallyEq_iff_exists_mem.mpr ⟨Set.Ioo 1 3, @@ -661,23 +684,28 @@ private theorem cpv_exists_generic_seg5_normSq_one (H : ℝ) (hH : Real.sqrt 3 / fun u hu => fdBoundary_H_eq_arc hu.1 hu.2⟩ apply ContDiffAt.congr_of_eventuallyEq _ heq exact ((Complex.ofRealCLM.contDiff.contDiffAt.comp t₁ - (by fun_prop : + (by + exact ContDiffAt.div_const + (ContDiffAt.mul contDiffAt_const (ContDiffAt.add contDiffAt_const contDiffAt_id)) 6 : ContDiffAt ℝ 2 (fun u : ℝ => Real.pi * (1 + u) / 6) t₁)).mul contDiffAt_const).cexp · erw [(fdBoundary_H_hasDerivAt_arc H ht₁_gt1 ht₁_lt3).deriv] - simp_all + simp_all only [one_div, mem_Icc, ne_eq, mul_eq_zero, exp_ne_zero, div_eq_zero_iff, + ofReal_eq_zero, + Real.pi_ne_zero, OfNat.ofNat_ne_zero, or_self, I_ne_zero, not_false_eq_true] · apply (fdBoundary_H_deriv_continuousOn_Ioo_13 H).mono - intro t ht; exact ⟨by linarith [ht.1], by linarith [ht.2]⟩ + intro t ht; exact ⟨by linarith only [ht₁_gt1, ht, ht.1], by linarith only [ht₁_lt3, ht, ht.2]⟩ · intro t ht hγt have ht' : t ∈ Set.Ioo (1 : ℝ) 3 := - ⟨by linarith [ht.1], by linarith [ht.2]⟩ + ⟨by linarith only [ht₁_gt1, ht, ht.1], by linarith only [ht₁_lt3, ht, ht.2]⟩ exact arc_angle_injective ht' ⟨ht₁_gt1, ht₁_lt3⟩ (by rw [fdBoundary_H_eq_arc ht'.1 ht'.2, fdBoundary_H_eq_arc ht₁_gt1 ht₁_lt3] at hγt; exact hγt) have h_avoid_start : CauchyPrincipalValueExists' (fun z => (z - s)⁻¹) (fdBoundaryH H) 0 ((t₁ + 1) / 2) s := by - apply cpv_avoidance _ _ _ _ _ (fdBoundary_H_continuous H).continuousOn (by linarith) + apply cpv_avoidance _ _ _ _ _ (fdBoundary_H_continuous H).continuousOn (by + linarith only [ht₀_gt_4, ht₀_lt_5, ht₁_gt1]) intro t ht h_eq by_cases ht0 : t = 0 · subst ht0; exact hs_endpoint (by rw [← h_eq, fdBoundary_H_at_zero]) @@ -686,11 +714,11 @@ private theorem cpv_exists_generic_seg5_normSq_one (H : ℝ) (hH : Real.sqrt 3 / rw [fdBoundary_H_eq_seg1_H ht1] simp [fdBoundarySeg1H, Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.I_im, Complex.ofReal_re] - nlinarith [ht.1, lt_of_le_of_ne ht.1 (Ne.symm ht0)] - rw [h_eq] at h_im_t; linarith [h_im_s] + nlinarith only [hH, ht, ht0, ht.1, lt_of_le_of_ne ht.1 (Ne.symm ht0)] + rw [h_eq] at h_im_t; linarith only [h_im_s, h_im_t] · push Not at ht1 - have ht3 : t < 3 := by linarith [ht.2] - have h_ne : t ≠ t₁ := by linarith [ht.2] + have ht3 : t < 3 := by linarith only [ht₀_gt_4, ht₀_lt_5, ht₁_lt3, ht, ht.2] + have h_ne : t ≠ t₁ := by linarith only [ht, ht1, ht.2] exact h_ne (arc_angle_injective ⟨ht1, ht3⟩ ⟨ht₁_gt1, ht₁_lt3⟩ (by have := h_eq.trans hγt₁.symm rwa [fdBoundary_H_eq_arc ht1 ht3, @@ -698,18 +726,19 @@ private theorem cpv_exists_generic_seg5_normSq_one (H : ℝ) (hH : Real.sqrt 3 / have h_cpv_0_t1h : CauchyPrincipalValueExists' (fun z => (z - s)⁻¹) (fdBoundaryH H) 0 ((t₁ + 3) / 2) s := by apply cpv_concat _ _ 0 ((t₁ + 1) / 2) ((t₁ + 3) / 2) s - h_avoid_start h_arc_cpv (by linarith) (by linarith) + h_avoid_start h_arc_cpv (by linarith only [ht₀_gt_4, ht₀_lt_5, ht₁_gt1]) (by linarith only []) intro ε hε; exact (fdBoundary_H_cutout_ii H hH s ε hε).mono_set (by - rw [Set.uIcc_of_le (by linarith : (0 : ℝ) ≤ (t₁ + 3) / 2), + rw [Set.uIcc_of_le (by linarith only [ht₀_gt_4, ht₀_lt_5, ht₁_gt1] : (0 : ℝ) ≤ (t₁ + 3) / 2), Set.uIcc_of_le (by norm_num : (0 : ℝ) ≤ 5)] - exact Set.Icc_subset_Icc_right (by linarith)) + exact Set.Icc_subset_Icc_right (by linarith only [ht₀_gt_4, ht₀_lt_5, ht₁_lt3])) have h_avoid_mid : CauchyPrincipalValueExists' (fun z => (z - s)⁻¹) (fdBoundaryH H) ((t₁ + 3) / 2) ((t₀ + 4) / 2) s := by - apply cpv_avoidance _ _ _ _ _ (fdBoundary_H_continuous H).continuousOn (by linarith) + apply cpv_avoidance _ _ _ _ _ (fdBoundary_H_continuous H).continuousOn (by + linarith only [ht₀_gt_4, ht₀_lt_5, ht₁_lt3]) intro t ht h_eq by_cases ht3 : t < 3 - · have ht1 : 1 < t := by linarith [ht.1] - have h_ne : t ≠ t₁ := by linarith [ht.1] + · have ht1 : 1 < t := by linarith only [ht₀_gt_4, ht₀_lt_5, ht₁_gt1, ht, ht.1] + have h_ne : t ≠ t₁ := by linarith only [ht, ht3, ht.1] exact h_ne (arc_angle_injective ⟨ht1, ht3⟩ ⟨ht₁_gt1, ht₁_lt3⟩ (by have := h_eq.trans hγt₁.symm rwa [fdBoundary_H_eq_arc ht1 ht3, @@ -719,35 +748,40 @@ private theorem cpv_exists_generic_seg5_normSq_one (H : ℝ) (hH : Real.sqrt 3 / · rcases eq_or_lt_of_le ht3 with rfl | ht3' · exact absurd_fdBoundaryH_three_eq hs_rho h_eq · have := fdBoundary_H_seg4_re' H ht3' ht4 - rw [h_eq] at this; linarith [h_re_s] + rw [h_eq] at this; linarith only [ht₀_gt_4, h_re_s, this] · push Not at ht4 - have := fdBoundary_H_seg5_re' H ht4 (by linarith [ht.2]) - rw [h_eq] at this; linarith [h_re_s, ht.2] + have := fdBoundary_H_seg5_re' H ht4 (by linarith only [ht₀_gt_4, ht₀_lt_5, ht, ht.2]) + rw [h_eq] at this; linarith only [h_re_s, ht, ht4, this, ht.2] have h_cpv_mid : CauchyPrincipalValueExists' (fun z => (z - s)⁻¹) (fdBoundaryH H) ((t₁ + 3) / 2) ((t₀ + 5) / 2) s := by apply cpv_concat _ _ ((t₁ + 3) / 2) ((t₀ + 4) / 2) ((t₀ + 5) / 2) s - h_avoid_mid h_seg5_cpv (by linarith) (by linarith) + h_avoid_mid h_seg5_cpv (by linarith only [ht₀_gt_4, ht₀_lt_5, ht₁_lt3]) (by linarith only []) intro ε hε; exact (fdBoundary_H_cutout_ii H hH s ε hε).mono_set (by - rw [Set.uIcc_of_le (by linarith : (t₁ + 3) / 2 ≤ (t₀ + 5) / 2), + rw [Set.uIcc_of_le (by linarith only [ht₀_gt_4, ht₀_lt_5, + ht₁_lt3] : (t₁ + 3) / 2 ≤ (t₀ + 5) / 2), Set.uIcc_of_le (by norm_num : (0 : ℝ) ≤ 5)] - exact Set.Icc_subset_Icc (by linarith) (by linarith)) + exact Set.Icc_subset_Icc (by linarith only [ht₀_gt_4, ht₀_lt_5, ht₁_gt1]) + (by linarith only [ht₀_lt_5])) have h_cpv_0_t0h : CauchyPrincipalValueExists' (fun z => (z - s)⁻¹) (fdBoundaryH H) 0 ((t₀ + 5) / 2) s := by apply cpv_concat _ _ 0 ((t₁ + 3) / 2) ((t₀ + 5) / 2) s - h_cpv_0_t1h h_cpv_mid (by linarith) (by linarith) + h_cpv_0_t1h h_cpv_mid (by linarith only [ht₀_gt_4, ht₀_lt_5, ht₁_gt1]) (by + linarith only [ht₀_gt_4, ht₀_lt_5, ht₁_lt3]) intro ε hε; exact (fdBoundary_H_cutout_ii H hH s ε hε).mono_set (by - rw [Set.uIcc_of_le (by linarith : (0 : ℝ) ≤ (t₀ + 5) / 2), + rw [Set.uIcc_of_le (by linarith only [ht₀_gt_4, ht₀_lt_5] : (0 : ℝ) ≤ (t₀ + 5) / 2), Set.uIcc_of_le (by norm_num : (0 : ℝ) ≤ 5)] - exact Set.Icc_subset_Icc_right (by linarith)) + exact Set.Icc_subset_Icc_right (by linarith only [ht₀_lt_5])) have h_cpv_end : CauchyPrincipalValueExists' (fun z => (z - s)⁻¹) (fdBoundaryH H) ((t₀ + 5) / 2) 5 s := by - apply cpv_avoidance _ _ _ _ _ (fdBoundary_H_continuous H).continuousOn (by linarith) + apply cpv_avoidance _ _ _ _ _ (fdBoundary_H_continuous H).continuousOn (by + linarith only [ht₀_lt_5]) intro t ht h_eq - have ht4 : 4 < t := by linarith [ht.1] + have ht4 : 4 < t := by linarith only [ht₀_gt_4, ht₀_lt_5, ht, ht.1] have := fdBoundary_H_seg5_re' H ht4 ht.2 - rw [h_eq] at this; linarith [h_re_s, ht.1] + rw [h_eq] at this; linarith only [ht₀_lt_5, h_re_s, ht, this, ht.1] exact cpv_concat _ _ 0 ((t₀ + 5) / 2) 5 s h_cpv_0_t0h h_cpv_end - (by linarith) (by linarith) (fun ε hε => fdBoundary_H_cutout_ii H hH s ε hε) + (by linarith only [ht₀_gt_4, ht₀_lt_5]) + (by linarith only [ht₀_lt_5]) (fun ε hε => fdBoundary_H_cutout_ii H hH s ε hε) /-! ### Helper: generic case, t₀ on seg5 (4 < t₀ < 5) without normSq = 1 -/ @@ -763,7 +797,7 @@ private theorem cpv_exists_generic_seg5_normSq_ne_one (H : ℝ) (hH : Real.sqrt (h_im_s : s.im = H) : CauchyPrincipalValueExists' (fun z => (z - s)⁻¹) (fdBoundaryH H) 0 5 s := by apply cpv_extend_to_full_interval H hH s ((t₀ + 4) / 2) ((t₀ + 5) / 2) - (by linarith) (by linarith) (by linarith) h_seg5_cpv + (by linarith only [ht₀_gt_4]) (by linarith only [ht₀_lt_5]) (by linarith only []) h_seg5_cpv · intro t ht h_eq by_cases ht0 : t = 0 · subst ht0; exact hs_endpoint (by rw [← h_eq, fdBoundary_H_at_zero]) @@ -772,28 +806,28 @@ private theorem cpv_exists_generic_seg5_normSq_ne_one (H : ℝ) (hH : Real.sqrt rw [fdBoundary_H_eq_seg1_H ht1] simp [fdBoundarySeg1H, Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.I_im, Complex.ofReal_re] - nlinarith [ht.1, lt_of_le_of_ne ht.1 (Ne.symm ht0)] - rw [h_eq] at h_im_t; linarith [h_im_s] + nlinarith only [hH, ht, ht0, ht.1, lt_of_le_of_ne ht.1 (Ne.symm ht0)] + rw [h_eq] at h_im_t; linarith only [h_im_s, h_im_t] · push Not at ht1 by_cases ht3 : t < 3 · have h_norm_arc : Complex.normSq (fdBoundaryH H t) = 1 := by rw [fdBoundary_H_eq_arc ht1 ht3, Complex.normSq_apply, Complex.exp_ofReal_mul_I_re, Complex.exp_ofReal_mul_I_im] - linarith [Real.sin_sq_add_cos_sq (Real.pi * (1 + t) / 6)] + linarith only [Real.sin_sq_add_cos_sq (Real.pi * (1 + t) / 6)] rw [h_eq] at h_norm_arc; exact h_normSq h_norm_arc · push Not at ht3 by_cases ht4 : t ≤ 4 · rcases eq_or_lt_of_le ht3 with rfl | ht3' · rw [fdBoundary_H_at_three] at h_eq; exact hs_rho h_eq.symm · have := fdBoundary_H_seg4_re' H ht3' ht4 - rw [h_eq] at this; linarith [h_re_s] + rw [h_eq] at this; linarith only [ht₀_gt_4, h_re_s, this] · push Not at ht4 - have := fdBoundary_H_seg5_re' H ht4 (by linarith [ht.2]) - rw [h_eq] at this; linarith [h_re_s, ht.2] + have := fdBoundary_H_seg5_re' H ht4 (by linarith only [ht₀_gt_4, ht₀_lt_5, ht, ht.2]) + rw [h_eq] at this; linarith only [h_re_s, ht, ht4, this, ht.2] · intro t ht h_eq - have ht4 : 4 < t := by linarith [ht.1] + have ht4 : 4 < t := by linarith only [ht₀_gt_4, ht₀_lt_5, ht, ht.1] have := fdBoundary_H_seg5_re' H ht4 ht.2 - rw [h_eq] at this; linarith [h_re_s, ht.1] + rw [h_eq] at this; linarith only [ht₀_lt_5, h_re_s, ht, this, ht.1] /-! ### Helper: generic case, t₀ on seg5 (4 < t₀ < 5), dispatches -/ @@ -812,7 +846,7 @@ private theorem cpv_exists_generic_seg5 (H : ℝ) (hH : Real.sqrt 3 / 2 < H) (s have h_seg5_cpv : CauchyPrincipalValueExists' (fun z => (z - s)⁻¹) (fdBoundaryH H) ((t₀ + 4) / 2) ((t₀ + 5) / 2) s := by apply cpv_exists_on_smooth_subinterval H hH s - ⟨by linarith, by linarith⟩ hγt₀ + ⟨by linarith only [ht₀_gt_4], by linarith only [ht₀_lt_5]⟩ hγt₀ · have heq_fn : ∀ u ∈ Set.Ioi (4 : ℝ), fdBoundaryH H u = (↑(u - 9/2) : ℂ) + ↑H * I := by intro u (hu : 4 < u) @@ -825,12 +859,13 @@ private theorem cpv_exists_generic_seg5 (H : ℝ) (hH : Real.sqrt 3 / 2 < H) (s (contDiffAt_id.sub contDiffAt_const)).add contDiffAt_const · erw [(fdBoundary_H_hasDerivAt_seg5 H ht₀_gt_4).deriv]; exact one_ne_zero · apply (fdBoundary_H_deriv_continuousOn_Ioo_45 H).mono - intro t ht; exact ⟨by linarith [ht.1], by linarith [ht.2]⟩ + intro t ht; exact ⟨by linarith only [ht₀_gt_4, ht, ht.1], by linarith only [ht₀_lt_5, ht, + ht.2]⟩ · intro t ht hγt - have ht4 : 4 < t := by linarith [ht.1] - have ht5 : t ≤ 5 := by linarith [ht.2] + have ht4 : 4 < t := by linarith only [ht₀_gt_4, ht, ht.1] + have ht5 : t ≤ 5 := by linarith only [ht₀_lt_5, ht, ht.2] have h_re_t := fdBoundary_H_seg5_re' H ht4 ht5 - simp_all + simp_all only [one_div, ne_eq, mem_Icc, sub_left_inj] by_cases h_normSq : Complex.normSq s = 1 · exact cpv_exists_generic_seg5_normSq_one H hH s hs_rho hs_endpoint t₀ ht₀_gt_4 ht₀_lt_5 h_im_s h_re_s h_seg5_cpv h_normSq @@ -860,7 +895,7 @@ theorem fdBoundary_H_cpv_exists_of_onCurve (H : ℝ) (hH : Real.sqrt 3 / 2 < H) have hγ2 : fdBoundaryH H 2 = I := by rw [fdBoundary_H_eq_arc (by norm_num : (1 : ℝ) < 2) (by norm_num : (2 : ℝ) < 3)] have : Real.pi * (1 + 2) / 6 = Real.pi / 2 := by ring - simp_all + simp_all only [mem_Icc, ofReal_div, ofReal_ofNat, exp_pi_div_two_mul_I] have h_arc_cpv : CauchyPrincipalValueExists' (fun z => (z - I)⁻¹) (fdBoundaryH H) (3/2) (5/2) I := by apply cpv_exists_on_smooth_subinterval H hH I @@ -872,16 +907,22 @@ theorem fdBoundary_H_cpv_exists_of_onCurve (H : ℝ) (hH : Real.sqrt 3 / 2 < H) fun s hs => fdBoundary_H_eq_arc hs.1 hs.2⟩ apply ContDiffAt.congr_of_eventuallyEq _ heq exact ((Complex.ofRealCLM.contDiff.contDiffAt.comp (2 : ℝ) - (by fun_prop : ContDiffAt ℝ 2 (fun s : ℝ => Real.pi * (1 + s) / 6) (2 : ℝ))).mul + (by + exact ContDiffAt.div_const + (ContDiffAt.mul contDiffAt_const (ContDiffAt.add contDiffAt_const contDiffAt_id)) + 6 : ContDiffAt ℝ 2 (fun s : ℝ => Real.pi * (1 + s) / 6) (2 : ℝ))).mul contDiffAt_const).cexp · have hd := fdBoundary_H_hasDerivAt_arc H (show (1 : ℝ) < 2 from by norm_num) (show (2 : ℝ) < 3 from by norm_num) erw [hd.deriv] - simp_all + simp_all only [mem_Icc, ofReal_ofNat, ne_eq, mul_eq_zero, exp_ne_zero, div_eq_zero_iff, + ofReal_eq_zero, + Real.pi_ne_zero, OfNat.ofNat_ne_zero, or_self, I_ne_zero, not_false_eq_true] · apply (fdBoundary_H_deriv_continuousOn_Ioo_13 H).mono - intro t ht; exact ⟨by linarith [ht.1], by linarith [ht.2]⟩ + intro t ht; exact ⟨by linarith only [ht, ht.1], by linarith only [ht, ht.2]⟩ · intro t ht hγt - have ht' : t ∈ Set.Ioo (1 : ℝ) 3 := ⟨by linarith [ht.1], by linarith [ht.2]⟩ + have ht' : t ∈ Set.Ioo (1 : ℝ) 3 := ⟨by linarith only [ht, ht.1], by + linarith only [ht, ht.2]⟩ have h2' : (2 : ℝ) ∈ Set.Ioo (1 : ℝ) 3 := ⟨by norm_num, by norm_num⟩ rw [fdBoundary_H_eq_arc ht'.1 ht'.2, fdBoundary_H_eq_arc h2'.1 h2'.2] at hγt exact arc_angle_injective ht' h2' hγt @@ -912,7 +953,7 @@ theorem fdBoundary_H_cpv_exists_of_onCurve (H : ℝ) (hH : Real.sqrt 3 / 2 < H) (fun {t} ht4 ht5 => by intro h_eq have := fdBoundary_H_seg5_im' H ht4 ht5 - rw [h_eq] at this; simp only [Complex.I_im] at this; linarith) + rw [h_eq] at this; simp only [Complex.I_im] at this; linarith only [hH_lt, this]) hγ3_ne_I · subst hH_eq exact cpv_exists_at_I_H_eq_one hH h_arc_cpv @@ -936,7 +977,7 @@ theorem fdBoundary_H_cpv_exists_of_onCurve (H : ℝ) (hH : Real.sqrt 3 / 2 < H) have ht₀_ne_5 : t₀ ≠ 5 := by intro h; subst h; exact hs_endpoint (by rw [← hγt₀, fdBoundary_H_at_five]) rw [Set.mem_Icc] at ht₀_mem - have hh₀ : (0 : ℝ) < H - Real.sqrt 3 / 2 := by linarith + have hh₀ : (0 : ℝ) < H - Real.sqrt 3 / 2 := by linarith only [hH] by_cases ht₀_lt_1 : t₀ < 1 · exact cpv_exists_generic_seg1 H hH s hs_rho t₀ ht₀_mem hγt₀ ht₀_ne_0 ht₀_lt_1 diff --git a/LeanPool/LeanModularForms/ValenceFormula/OrbitPairing.lean b/LeanPool/LeanModularForms/ValenceFormula/OrbitPairing.lean index 69d3db0688..353db93289 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/OrbitPairing.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/OrbitPairing.lean @@ -39,7 +39,8 @@ private lemma normSq_sub_one_eq_of_re_half (z : ℂ) (hre : z.re = 1 / 2) : simp only [normSq_apply, sub_re, one_re, sub_im, one_im, sub_zero, hre]; ring private lemma eq_of_sq_eq_of_nonneg {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) - (h : a ^ 2 = b ^ 2) : a = b := by nlinarith [sq_nonneg (a - b), sq_nonneg (a + b)] + (h : a ^ 2 = b ^ 2) : a = b := by + nlinarith only [ha, hb, h, sq_nonneg (a - b), sq_nonneg (a + b)] private lemma norm_eq_of_normSq_eq {z w : ℂ} (h : Complex.normSq z = Complex.normSq w) : ‖z‖ = ‖w‖ := @@ -47,7 +48,7 @@ private lemma norm_eq_of_normSq_eq {z w : ℂ} have := normSq_eq_norm_sq z; have := normSq_eq_norm_sq w; linarith) private lemma one_le_normSq_of_norm_gt_one {z : ℂ} (h : ‖z‖ > 1) : - 1 ≤ Complex.normSq z := by rw [normSq_eq_norm_sq]; nlinarith [norm_nonneg z] + 1 ≤ Complex.normSq z := by rw [normSq_eq_norm_sq]; nlinarith only [h, norm_nonneg z] private lemma normSq_eq_one_of_norm_eq_one {z : ℂ} (h : ‖z‖ = 1) : Complex.normSq z = 1 := by rw [normSq_eq_norm_sq, h]; norm_num @@ -153,7 +154,7 @@ theorem S_smul_re_neg_of_unit (p : ℍ) (hp : ‖(p : ℂ)‖ = 1) : have hns := normSq_eq_one_of_norm_eq_one hp change ((ModularGroup.S • p : ℍ) : ℂ).re = -p.re rw [S_smul_coe] - simp_all + simp_all only [inv_neg, neg_re, inv_re, UpperHalfPlane.coe_re, div_one] /-- S-action preserves 𝒟 for unit-circle points. -/ theorem S_smul_mem_fd_of_unit (p : ℍ) (hp_fd : p ∈ 𝒟) (hp_norm : ‖(p : ℂ)‖ = 1) : @@ -206,7 +207,7 @@ theorem sum_ord_leftVert_eq_sum_T_image (S : Finset ℍ) : lemma ord_vAdd_neg_one_eq (p : ℍ) : orderOfVanishingAt' (⇑f) ((-1 : ℝ) +ᵥ p) = orderOfVanishingAt' (⇑f) p := by have h := ord_add_one_eq f ((-1 : ℝ) +ᵥ p) - simp_all + simp_all only [vadd_neg_vadd] /-- The left-arc filter: points on the unit circle with negative real part. -/ def sLeftArc (S : Finset ℍ) : Finset ℍ := @@ -225,7 +226,7 @@ private lemma S_mul_S : ModularGroup.S * ModularGroup.S = -1 := by /-- S² acts as the identity on ℍ. -/ lemma S_smul_S_smul (p : ℍ) : ModularGroup.S • (ModularGroup.S • p) = p := by rw [← mul_smul, S_mul_S] - simp_all + simp_all only [ModularGroup.SL_neg_smul, one_smul] /-- The S-action is injective on ℍ. -/ lemma S_smul_injective : Function.Injective (ModularGroup.S • · : ℍ → ℍ) := diff --git a/LeanPool/LeanModularForms/ValenceFormula/OrbitSum.lean b/LeanPool/LeanModularForms/ValenceFormula/OrbitSum.lean index 93ac75101b..21e34248ce 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/OrbitSum.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/OrbitSum.lean @@ -131,7 +131,7 @@ theorem orderOfVanishingAt'_ne_zero_of_eq_zero (hf : f ≠ 0) (p : ℍ) (hp : f have h_ord_ne : meromorphicOrderAt (fun w : ℂ => if h : 0 < w.im then f ⟨w, h⟩ else 0) (↑p) ≠ (0 : WithTop ℤ) := by intro h0; apply h_nf.meromorphicOrderAt_eq_zero_iff.mp h0 - simp_all + simp_all only [ne_eq, WithTop.untop₀_zero, UpperHalfPlane.coe_im, dite_eq_ite, ite_self] have h_top := (WithTop.untop₀_eq_zero.mp h_untop_eq).resolve_left h_ord_ne rw [meromorphicOrderAt_eq_top_iff] at h_top have h_analOn : AnalyticOnNhd ℂ (fun w : ℂ => if h : 0 < w.im then f ⟨w, h⟩ else 0) @@ -154,12 +154,13 @@ theorem fd_im_gt_half (p : ℍ) (hp : p ∈ 𝒟) : (1 : ℝ)/2 < (p : ℂ).im : have hre_bridge : UpperHalfPlane.re p = (↑p : ℂ).re := rfl have him_bridge : p.im = (↑p : ℂ).im := rfl have h_nsq : 1 ≤ (p : ℂ).re * (p : ℂ).re + (p : ℂ).im * (p : ℂ).im := by - have := normSq_apply (↑p : ℂ); linarith [this] + have := normSq_apply (↑p : ℂ); linarith only [hnormSq, this] have h_re_sq : (p : ℂ).re * (p : ℂ).re ≤ 1/4 := by have hre := abs_le.mp habs_re - nlinarith [mul_self_nonneg (p : ℂ).re, hre_bridge] - have him_sq : (p : ℂ).im * (p : ℂ).im ≤ 1/4 := by nlinarith [p.im_pos, him_bridge] - linarith + nlinarith only [hre_bridge, hre, mul_self_nonneg (p : ℂ).re] + have him_sq : (p : ℂ).im * (p : ℂ).im ≤ 1/4 := by + nlinarith only [h_le, him_bridge, h_nsq, h_re_sq, p.im_pos] + linarith only [h_nsq, h_re_sq, him_sq] private theorem no_zeros_above_height' (hf : f ≠ 0) : ∃ H₀ : ℝ, Real.sqrt 3 / 2 < H₀ ∧ @@ -171,7 +172,7 @@ private theorem no_zeros_above_height' (hf : f ≠ 0) : have h_qParam_mem : Function.Periodic.qParam (1 : ℝ) (↑p : ℂ) ∈ Metric.closedBall (0 : ℂ) (Real.exp (-2 * Real.pi * H₀)) := by rw [Metric.mem_closedBall, dist_zero_right, Function.Periodic.norm_qParam] - simpa only [div_one] using Real.exp_le_exp.mpr (by nlinarith [Real.pi_pos]) + simpa only [div_one] using Real.exp_le_exp.mpr (by nlinarith only [hp, Real.pi_pos]) have h_qParam_ne : Function.Periodic.qParam (1 : ℝ) (↑p : ℂ) ≠ 0 := by simpa only [Function.Periodic.qParam, ne_eq] using Complex.exp_ne_zero _ exact hH₀_nonvan _ h_qParam_mem h_qParam_ne (h_eq ▸ hfp) diff --git a/LeanPool/LeanModularForms/ValenceFormula/PVChain.lean b/LeanPool/LeanModularForms/ValenceFormula/PVChain.lean index 2cf2532e00..5456dacd92 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/PVChain.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/PVChain.lean @@ -55,7 +55,9 @@ theorem pv_chain_identity (S : Finset UpperHalfPlane) (hS : ∀ p ∈ S, p ∈ (h_res (le_trans (le_max_left _ _) hH)) (h_mod (le_trans (le_max_right _ _) hH)) have hpi : (2 : ℂ) * ↑Real.pi * I ≠ 0 := by - simp_all + simp_all only [ne_eq, sup_le_iff, mul_eq_zero, OfNat.ofNat_ne_zero, ofReal_eq_zero, + Real.pi_ne_zero, or_self, + I_ne_zero, not_false_eq_true] rw [show -(2 * ↑Real.pi * I * ((k : ℂ) / 12 - (orderAtCusp' f : ℂ))) = 2 * ↑Real.pi * I * (-((k : ℂ) / 12 - (orderAtCusp' f : ℂ))) from by ring] at h_eq exact mul_left_cancel₀ hpi h_eq diff --git a/LeanPool/LeanModularForms/ValenceFormula/PVChain/ArcContribution.lean b/LeanPool/LeanModularForms/ValenceFormula/PVChain/ArcContribution.lean index b3e4e635d1..bcf35ef64a 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/PVChain/ArcContribution.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/PVChain/ArcContribution.lean @@ -81,7 +81,7 @@ lemma logDeriv_modform_S_transform (z : ℂ) (hz : 0 < z.im) (hz_ne : z ≠ 0) logDeriv_comp (h_diffOn_g.differentiableAt (h_uhp_open.mem_nhds h_neg_inv_im)) (DifferentiableAt.div (differentiableAt_const _) differentiableAt_id hz_ne) have h_deriv_S : deriv (fun w => -(1 : ℂ)/w) z = 1 / z ^ 2 := by - simp_all + simp_all only [ne_eq, Function.comp_apply, deriv_const_div_id, neg_neg, one_div] have h_zpow_ne : z ^ k ≠ 0 := zpow_ne_zero k hz_ne have h_diff_zpow : DifferentiableAt ℂ (· ^ k) z := differentiableAt_zpow.mpr (.inl hz_ne) have h_diff_g_at_z : DifferentiableAt ℂ g z := @@ -113,7 +113,7 @@ lemma S_isometry_unit_circle (z w : ℂ) (hz : ‖z‖ = 1) (hw : ‖w‖ = 1) : omit f hf in lemma fdBoundary_arc_S_reverse (H : ℝ) (t : ℝ) (ht : t ∈ Set.Ioo (1 : ℝ) 3) : fdBoundaryH H (4 - t) = -(1 : ℂ) / fdBoundaryH H t := by - rw [fdBoundary_H_eq_arc (by linarith [ht.2]) (by linarith [ht.1]), + rw [fdBoundary_H_eq_arc (by linarith only [ht, ht.2]) (by linarith only [ht, ht.1]), fdBoundary_H_eq_arc ht.1 ht.2] have hne : exp ((↑(Real.pi * (1 + t) / 6) : ℂ) * I) ≠ 0 := Complex.exp_ne_zero _ rw [eq_div_iff hne, ← Complex.exp_add] @@ -139,9 +139,11 @@ private lemma arc_indicator_symmetric_of_sArcOfS have h_norm_s := h_S_unit s₀ hs₀ calc ‖fdBoundaryH H t - (-(1 : ℂ)/s₀)‖ = ‖-(1 : ℂ)/fdBoundaryH H t - (-(1 : ℂ)/(-(1 : ℂ)/s₀))‖ := - (S_isometry_unit_circle _ _ h_norm_t (by simp_all)).symm + (S_isometry_unit_circle _ _ h_norm_t + (h_S_unit _ (h_S_closed s₀ hs₀))).symm _ = ‖-(1 : ℂ)/fdBoundaryH H t - s₀‖ := by - simp_all + simp_all only [mem_Ioo, ne_eq, neg_eq_zero, one_ne_zero, not_false_eq_true, + div_div_cancel₀] _ = ‖fdBoundaryH H (4 - t) - s₀‖ := by rw [← h_arc_rev] _ ≤ ε := h_le · rintro ⟨s₁, hs₁, h_le⟩ @@ -501,22 +503,22 @@ private lemma arc_re_strictly_between (H : ℝ) (t : ℝ) (ht : t ∈ Set.Ioo (1 -1/2 < (fdBoundaryH H t).re ∧ (fdBoundaryH H t).re < 1/2 := by rw [fdBoundary_H_eq_arc ht.1 ht.2, Complex.exp_ofReal_mul_I_re] have hpi := Real.pi_pos - have hθ_lo : Real.pi / 3 < Real.pi * (1 + t) / 6 := by nlinarith [ht.1] - have hθ_hi : Real.pi * (1 + t) / 6 < 2 * Real.pi / 3 := by nlinarith [ht.2] + have hθ_lo : Real.pi / 3 < Real.pi * (1 + t) / 6 := by nlinarith only [ht, hpi, ht.1] + have hθ_hi : Real.pi * (1 + t) / 6 < 2 * Real.pi / 3 := by nlinarith only [ht, hpi, ht.2] have hθ_Icc : Real.pi * (1 + t) / 6 ∈ Set.Icc 0 Real.pi := - ⟨by nlinarith [ht.1], by nlinarith [ht.2]⟩ + ⟨by nlinarith only [hpi, hθ_lo, ht.1], by nlinarith only [hpi, hθ_hi, ht.2]⟩ have hpi3_Icc : Real.pi / 3 ∈ Set.Icc 0 Real.pi := - ⟨by nlinarith, by nlinarith⟩ + ⟨by nlinarith only [hpi], by nlinarith only [hpi]⟩ have h23_Icc : 2 * Real.pi / 3 ∈ Set.Icc 0 Real.pi := - ⟨by nlinarith, by nlinarith⟩ + ⟨by nlinarith only [hpi], by nlinarith only [hpi]⟩ constructor · have h1 := Real.strictAntiOn_cos hθ_Icc h23_Icc hθ_hi have h2 : Real.cos (2 * Real.pi / 3) = -1 / 2 := by rw [show 2 * Real.pi / 3 = Real.pi - Real.pi / 3 from by ring, Real.cos_pi_sub, Real.cos_pi_div_three]; ring - linarith + linarith only [h1, h2] · have h1 := Real.strictAntiOn_cos hpi3_Icc hθ_Icc hθ_lo - rw [Real.cos_pi_div_three] at h1; linarith + rw [Real.cos_pi_div_three] at h1; linarith only [h1] omit f hf in private lemma arc_ne_svert (H : ℝ) (S : Finset UpperHalfPlane) @@ -528,7 +530,7 @@ private lemma arc_ne_svert (H : ℝ) (S : Finset UpperHalfPlane) · rcases lt_or_eq_of_le ht.2 with ht3 | rfl · have := arc_re_strictly_between H t ⟨ht1, ht3⟩ rw [h_eq] at this - rcases hs_re with h | h <;> linarith [this.1, this.2] + rcases hs_re with h | h <;> linarith only [this, h, this.1, this.2] · rw [fdBoundary_H_at_three H] at h_eq exact hs_not (h_eq ▸ sArcOfS_rho_in S) · rw [fdBoundary_H_at_one H] at h_eq @@ -575,7 +577,11 @@ private lemma arc_svert_combined_dist (H : ℝ) (S : Finset UpperHalfPlane) : rcases Finset.mem_insert.mp hs with rfl | h · exact le_trans (min_le_right _ _) (hδ₂_bound t ht) · exact le_trans (min_le_left _ _) (hδ₁_bound s h h_sv h_na t ht)⟩ - · simp_all + · simp_all only [gt_iff_lt, mem_Icc, and_imp, not_false_eq_true, implies_true, + forall_const, Finset.mem_insert, + not_and, Decidable.not_not, forall_eq_or_imp, not_true_eq_false, + not_isEmpty_of_nonempty, IsEmpty.forall_iff, + true_and] omit f hf in lemma arc_cpv_eventually_eq_union (S : Finset UpperHalfPlane) diff --git a/LeanPool/LeanModularForms/ValenceFormula/PVChain/Assembly.lean b/LeanPool/LeanModularForms/ValenceFormula/PVChain/Assembly.lean index a984f27884..d9b2a4aed6 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/PVChain/Assembly.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/PVChain/Assembly.lean @@ -6,7 +6,6 @@ Authors: Chris Birkbeck module public import LeanPool.LeanModularForms.ValenceFormula.PVChain.Helpers -import LeanPool.LeanModularForms.ValenceFormula.Boundary.Bounds import LeanPool.LeanModularForms.ValenceFormula.Boundary.Smooth import LeanPool.LeanModularForms.ValenceFormula.PVChain.ArcContribution import LeanPool.LeanModularForms.ValenceFormula.PVChain.OnCurveCapture @@ -54,30 +53,34 @@ The modular side decomposes into: omit f hf in private lemma norm_sub_one_le {z s : ℂ} (hz : z.re = 1 / 2) (hs : s.re = -1 / 2) : ‖(z - 1) - s‖ ≤ ‖z - s‖ := by - have hre1 : ((z - 1) - s).re = 0 := by simp only [Complex.sub_re, Complex.one_re]; linarith + have hre1 : ((z - 1) - s).re = 0 := by + simp only [Complex.sub_re, Complex.one_re]; linarith only [hz, + hs] have him1 : ((z - 1) - s).im = z.im - s.im := by simp only [Complex.sub_im, Complex.one_im]; ring - have hre2 : (z - s).re = 1 := by simp only [Complex.sub_re]; linarith + have hre2 : (z - s).re = 1 := by simp only [Complex.sub_re]; linarith only [hz, hs] have him2 : (z - s).im = z.im - s.im := by simp only [Complex.sub_im] have h1 : ‖(z - 1) - s‖ ^ 2 = (z.im - s.im) ^ 2 := by rw [Complex.sq_norm, Complex.normSq_apply, hre1, him1]; ring have h2 : ‖z - s‖ ^ 2 = 1 + (z.im - s.im) ^ 2 := by rw [Complex.sq_norm, Complex.normSq_apply, hre2, him2]; ring - have h_sq : ‖(z - 1) - s‖ ^ 2 ≤ ‖z - s‖ ^ 2 := by linarith + have h_sq : ‖(z - 1) - s‖ ^ 2 ≤ ‖z - s‖ ^ 2 := by linarith only [h1, h2] have h_le := Real.sqrt_le_sqrt h_sq rwa [Real.sqrt_sq (norm_nonneg _), Real.sqrt_sq (norm_nonneg _)] at h_le omit f hf in private lemma norm_sub_le_sub_one {z s : ℂ} (hz : z.re = 1 / 2) (hs : s.re = 1 / 2) : ‖z - s‖ ≤ ‖(z - 1) - s‖ := by - have hre1 : (z - s).re = 0 := by simp only [Complex.sub_re]; linarith + have hre1 : (z - s).re = 0 := by simp only [Complex.sub_re]; linarith only [hz, hs] have him1 : (z - s).im = z.im - s.im := by simp only [Complex.sub_im] - have hre2 : ((z - 1) - s).re = -1 := by simp only [Complex.sub_re, Complex.one_re]; linarith + have hre2 : ((z - 1) - s).re = -1 := by + simp only [Complex.sub_re, Complex.one_re]; linarith only [hz, + hs] have him2 : ((z - 1) - s).im = z.im - s.im := by simp only [Complex.sub_im, Complex.one_im]; ring have h1 : ‖z - s‖ ^ 2 = (z.im - s.im) ^ 2 := by rw [Complex.sq_norm, Complex.normSq_apply, hre1, him1]; ring have h2 : ‖(z - 1) - s‖ ^ 2 = 1 + (z.im - s.im) ^ 2 := by rw [Complex.sq_norm, Complex.normSq_apply, hre2, him2]; ring - have h_sq : ‖z - s‖ ^ 2 ≤ ‖(z - 1) - s‖ ^ 2 := by linarith + have h_sq : ‖z - s‖ ^ 2 ≤ ‖(z - 1) - s‖ ^ 2 := by linarith only [h1, h2] have h_le := Real.sqrt_le_sqrt h_sq rwa [Real.sqrt_sq (norm_nonneg _), Real.sqrt_sq (norm_nonneg _)] at h_le @@ -101,30 +104,12 @@ private lemma truncation_iff_shift omit f hf in private lemma norm_shift_neg_inv_eq {z s : ℂ} (hz_re : z.re = 1 / 2) (hs_unit : ‖s‖ = 1) : ‖(z - 1) - (-(1 : ℂ) / s)‖ = ‖z - s‖ := by - have hs_ne : s ≠ 0 := by intro h; rw [h, norm_zero] at hs_unit; norm_num at hs_unit - have h_normSq : s.re ^ 2 + s.im ^ 2 = 1 := by - have h := Complex.sq_norm s; rw [hs_unit, one_pow] at h - rw [Complex.normSq_apply] at h - nlinarith [sq s.re, sq s.im] - have h_mul : s.re * s.re + s.im * s.im = 1 := by nlinarith [sq s.re, sq s.im] - have h_neg_inv_re : (-(1 : ℂ) / s).re = -s.re := by - rw [neg_div, Complex.neg_re, Complex.div_re, Complex.one_re, Complex.one_im, - Complex.normSq_apply, h_mul, div_one]; ring - have h_neg_inv_im : (-(1 : ℂ) / s).im = s.im := by - rw [neg_div, Complex.neg_im, Complex.div_im, Complex.one_re, Complex.one_im, - Complex.normSq_apply, h_mul, div_one]; ring - have h1_re : ((z - 1) - (-(1 : ℂ) / s)).re = z.re - 1 + s.re := by - simp only [Complex.sub_re, Complex.one_re, h_neg_inv_re]; ring - have h1_im : ((z - 1) - (-(1 : ℂ) / s)).im = z.im - s.im := by - simp only [Complex.sub_im, Complex.one_im, h_neg_inv_im]; ring - have h_sq1 : ‖(z - 1) - (-(1 : ℂ) / s)‖ ^ 2 = - (z.re - 1 + s.re) ^ 2 + (z.im - s.im) ^ 2 := by - rw [Complex.sq_norm, Complex.normSq_apply, h1_re, h1_im]; ring - have h_sq2 : ‖z - s‖ ^ 2 = (z.re - s.re) ^ 2 + (z.im - s.im) ^ 2 := by - rw [Complex.sq_norm, Complex.normSq_apply, Complex.sub_re z s, Complex.sub_im z s]; ring - have h_eq : ‖(z - 1) - (-(1 : ℂ) / s)‖ ^ 2 = ‖z - s‖ ^ 2 := by rw [h_sq1, h_sq2, hz_re]; ring - nlinarith [sq_nonneg (‖(z - 1) - (-(1 : ℂ) / s)‖ - ‖z - s‖), - norm_nonneg ((z - 1) - (-(1 : ℂ) / s)), norm_nonneg (z - s)] + rw [neg_div, one_div, Complex.inv_eq_conj hs_unit] + have h_reflect : (z - 1) - -((starRingEnd ℂ) s) = -((starRingEnd ℂ) (z - s)) := by + apply Complex.ext <;> + simp only [Complex.sub_re, Complex.sub_im, Complex.neg_re, Complex.neg_im, + Complex.conj_re, Complex.conj_im, Complex.one_re, Complex.one_im, hz_re] <;> ring + rw [h_reflect, norm_neg, Complex.norm_conj] omit f hf in private lemma neg_inv_involution {s : ℂ} (hs_unit : ‖s‖ = 1) : @@ -145,7 +130,8 @@ private lemma truncation_iff_shift_union · rintro ⟨s, hs, h_le⟩ rcases Finset.mem_union.mp hs with h_arc | h_vert · exact ⟨-(1 : ℂ) / s, Finset.mem_union_left _ (sArcOfS_closed S s h_arc), - by linarith [norm_shift_neg_inv_eq hz_re (sArcOfS_unit S s h_arc)]⟩ + by + linarith only [hz_re, h_le, h_arc, norm_shift_neg_inv_eq hz_re (sArcOfS_unit S s h_arc)]⟩ · obtain ⟨s', hs', h_le'⟩ := (truncation_iff_shift S z hz_re ε).mp ⟨s, h_vert, h_le⟩ exact ⟨s', Finset.mem_union_right _ hs', h_le'⟩ · rintro ⟨s, hs, h_le⟩ @@ -154,7 +140,7 @@ private lemma truncation_iff_shift_union refine ⟨-(1 : ℂ) / s, Finset.mem_union_left _ (sArcOfS_closed S s h_arc), ?_⟩ have h_eq := norm_shift_neg_inv_eq hz_re (norm_neg_inv_of_norm_one h_unit) rw [neg_inv_involution h_unit] at h_eq - linarith + linarith only [h_le, h_eq] · obtain ⟨s', hs', h_le'⟩ := (truncation_iff_shift S z hz_re ε).mpr ⟨s, h_vert, h_le⟩ exact ⟨s', Finset.mem_union_right _ hs', h_le'⟩ @@ -208,15 +194,15 @@ private lemma pvIntegrand_seg4_eq_neg_seg1 (_S : Finset UpperHalfPlane) (Sx : Fi pvIntegrand f (fdBoundaryH H) Sx ε (4 - u) = -(pvIntegrand f (fdBoundaryH H) Sx ε u) := by have hu_le1 : u ≤ 1 := le_of_lt hu.2 - have h4u_gt3 : (3 : ℝ) < 4 - u := by linarith [hu.2] - have h4u_lt4 : 4 - u < 4 := by linarith [hu.1] + have h4u_gt3 : (3 : ℝ) < 4 - u := by linarith only [hu, hu.2] + have h4u_lt4 : 4 - u < 4 := by linarith only [hu, hu.1] have h_trunc := h_trunc_iff u hu simp only [pvIntegrand, cauchyPrincipalValueIntegrandOn] by_cases h_trunc_u : ∃ s ∈ Sx, ‖fdBoundaryH H u - s‖ ≤ ε · rw [ite_eq_left h_trunc_u, ite_eq_left (h_trunc.mpr h_trunc_u)]; simp only [neg_zero] · rw [ite_eq_right h_trunc_u, ite_eq_right (mt h_trunc.mp h_trunc_u)] have h_shift : fdBoundaryH H (4 - u) = fdBoundaryH H u - 1 := by - rw [fdBoundary_H_eq_seg4_H h4u_gt3 (by linarith [hu.1]), + rw [fdBoundary_H_eq_seg4_H h4u_gt3 (by linarith only [h4u_lt4, hu.1]), seg4_eq_seg1_minus_one_H H u ⟨le_of_lt hu.1, hu_le1⟩, fdBoundary_H_eq_seg1_H hu_le1] have h_logDeriv : logDeriv (modularFormCompOfComplex f) (fdBoundaryH H (4 - u)) = @@ -254,8 +240,8 @@ private lemma seg4_shift_and_re {H : ℝ} {u : ℝ} (hu : u ∈ Set.Ioo (0 : ℝ fdBoundaryH H (4 - u) = fdBoundaryH H u - 1 ∧ (fdBoundaryH H u).re = 1 / 2 := by have h_seg1 := fdBoundary_H_eq_seg1_H (H := H) (show u ≤ 1 from le_of_lt hu.2) refine ⟨?_, ?_⟩ - · rw [fdBoundary_H_eq_seg4_H (H := H) (show (3 : ℝ) < 4 - u from by linarith [hu.2]) - (show 4 - u ≤ 4 from by linarith [hu.1]), + · rw [fdBoundary_H_eq_seg4_H (H := H) (show (3 : ℝ) < 4 - u from by linarith only [hu, hu.2]) + (show 4 - u ≤ 4 from by linarith only [hu, hu.1]), seg4_eq_seg1_minus_one_H H u ⟨le_of_lt hu.1, le_of_lt hu.2⟩, h_seg1] · rw [h_seg1]; simp [fdBoundarySeg1H, add_re, ofReal_re, mul_re, I_re, I_im, ofReal_im] @@ -336,14 +322,14 @@ private theorem tendsto_pvIntegral_seg5 intro t _ _; simp [h_empty] · set δ := (sArcOfS S ∪ sVertOfS S).inf' h_ne (fun s => H - s.im) have hδ_pos : 0 < δ := - (Finset.lt_inf'_iff h_ne).mpr (fun s hs => by linarith [h_below s hs]) + (Finset.lt_inf'_iff h_ne).mpr (fun s hs => by linarith only [h_below, hs, h_below s hs]) filter_upwards [Ioo_mem_nhdsGT hδ_pos] with ε hε intro t ht4 _; push Not; intro s hs calc ε < δ := hε.2 _ ≤ H - s.im := Finset.inf'_le _ hs _ = |(fdBoundaryH H t - s).im| := by rw [Complex.sub_im, h_seg5_im t ht4, abs_of_pos] - linarith [h_below s hs] + linarith only [h_below, hs, h_below s hs] _ ≤ ‖fdBoundaryH H t - s‖ := Complex.abs_im_le_norm _ have h_ev : ∀ᶠ ε in 𝓝[>] (0 : ℝ), (∫ t in (4 : ℝ)..5, @@ -360,7 +346,7 @@ private theorem tendsto_pvIntegral_seg5 simp only [pvIntegrand, cauchyPrincipalValueIntegrandOn, ite_eq_right (hε t ht.1 ht.2)] · exact Filter.Eventually.of_forall fun t ht => by - rw [Set.mem_Ioc] at ht; exact absurd ht.1 (by linarith [ht.2]) + rw [Set.mem_Ioc] at ht; exact absurd ht.1 (by linarith only [ht, ht.2]) _ = L := seg5_logDeriv_integral_value f hf hH hcusp_nonvan exact tendsto_const_nhds.congr' (h_ev.mono fun ε h => h.symm) @@ -373,12 +359,12 @@ private lemma norm_deriv_fdBoundary_H_le have h_norm_cast : ‖(↑H - ↑(Real.sqrt 3) / 2 : ℂ)‖ = H - Real.sqrt 3 / 2 := by have hcast : (↑H - ↑(Real.sqrt 3) / 2 : ℂ) = ↑(H - Real.sqrt 3 / 2) := by push_cast; ring rw [hcast, Complex.norm_real, Real.norm_of_nonneg (by - linarith [Real.sqrt_pos_of_pos (by norm_num : (3 : ℝ) > 0)])] + linarith only [hH, Real.sqrt_pos_of_pos (by norm_num : (3 : ℝ) > 0)])] by_cases h1 : t < 1 · erw [(fdBoundary_H_hasDerivAt_seg1 H h1).deriv] rw [neg_mul, norm_neg, norm_mul, Complex.norm_I, mul_one, h_norm_cast] - exact le_trans (by linarith [Real.sqrt_nonneg 3]) (le_max_left H 1) + exact le_trans (by linarith only [Real.sqrt_nonneg 3]) (le_max_left H 1) · push Not at h1 have h1' : 1 < t := lt_of_le_of_ne h1 (Ne.symm ht_ne1) by_cases h3 : t < 3 @@ -393,13 +379,13 @@ private lemma norm_deriv_fdBoundary_H_le rw [show (↑Real.pi / 6 : ℂ) = ↑(Real.pi / 6) from by push_cast; ring, Complex.norm_real, Real.norm_of_nonneg (by positivity)] rw [hpi] - exact le_max_of_le_right (by linarith [Real.pi_le_four]) + exact le_max_of_le_right (by linarith only [Real.pi_le_four]) · push Not at h3 have h3' : 3 < t := lt_of_le_of_ne h3 (Ne.symm ht_ne3) by_cases h4 : t < 4 · erw [(fdBoundary_H_hasDerivAt_seg4 H h3' h4).deriv] rw [norm_mul, Complex.norm_I, mul_one, h_norm_cast] - exact le_trans (by linarith [Real.sqrt_nonneg 3]) (le_max_left H 1) + exact le_trans (by linarith only [Real.sqrt_nonneg 3]) (le_max_left H 1) · push Not at h4 have h4' : 4 < t := lt_of_le_of_ne h4 (Ne.symm ht_ne4) erw [(fdBoundary_H_hasDerivAt_seg5 H h4').deriv]; rw [norm_one] @@ -607,7 +593,7 @@ private lemma oncurve_arc_of_zero fdBoundaryH H t ∈ (↑(sArcOfS S) : Set ℂ) := by intro t ht h_zero exact oncurve_arc_capture f hf S hS_complete hH_sqrt3 - ⟨by linarith [ht.1], by linarith [ht.2]⟩ + ⟨by linarith only [ht, ht.1], by linarith only [ht, ht.2]⟩ (by rw [fdBoundary_H_eq_arc ht.1 ht.2]; exact Complex.norm_exp_ofReal_mul_I _) h_zero include hf in @@ -623,7 +609,7 @@ private lemma modular_side_h_capture ∀ t ∈ Icc (0 : ℝ) 5, modularFormCompOfComplex f (fdBoundaryH H t) = 0 → fdBoundaryH H t ∈ (↑(sArcOfS S ∪ sVertOfS S) : Set ℂ) := by - have hH_pos : 0 < H := by linarith [hH_sqrt3, Real.sqrt_nonneg 3] + have hH_pos : 0 < H := by linarith only [hH_gt_one, hH_sqrt3, Real.sqrt_nonneg 3] have h_oncurve_arc := oncurve_arc_of_zero f hf S hS_complete hH_sqrt3 have h_oncurve_vert : ∀ t ∈ Set.Ioo (0 : ℝ) 1, modularFormCompOfComplex f (fdBoundaryH H t) = 0 → @@ -665,9 +651,9 @@ private lemma modular_side_h_capture · have ht_seg4 : fdBoundaryH H t = fdBoundaryH H (4 - t) - 1 := by rw [fdBoundary_H_eq_seg4_H h3 h4] have h4_u := seg4_eq_seg1_minus_one_H H (4 - t) - ⟨by linarith, by linarith [lt_of_le_of_ne h4 h4']⟩ + ⟨by linarith only [h4], by linarith only [h3]⟩ simp only [show (4 : ℝ) - (4 - t) = t from by ring] at h4_u - rw [h4_u, fdBoundary_H_eq_seg1_H (by linarith [lt_of_le_of_ne h4 h4'] : 4 - t ≤ 1)] + rw [h4_u, fdBoundary_H_eq_seg1_H (by linarith only [h3] : 4 - t ≤ 1)] have h_F_per : Function.Periodic (modularFormCompOfComplex f) (1 : ℂ) := by have := SlashInvariantFormClass.periodic_comp_ofComplex f @@ -680,18 +666,18 @@ private lemma modular_side_h_capture simp only [sub_add_cancel] at this rw [ht_seg4] at h_zero; rwa [this] have h_re : (fdBoundaryH H (4 - t)).re = 1/2 := by - rw [fdBoundary_H_eq_seg1_H (by linarith : 4 - t ≤ 1)] + rw [fdBoundary_H_eq_seg1_H (by linarith only [h3] : 4 - t ≤ 1)] simp [fdBoundarySeg1H, add_re, ofReal_re, mul_re, I_re, I_im, ofReal_im] rw [ht_seg4] exact Finset.mem_coe.mpr (Finset.mem_union_right _ (sVertOfS_pair_left S _ (Finset.mem_coe.mp (h_oncurve_vert (4 - t) - ⟨by linarith [lt_of_le_of_ne h4 h4'], by linarith⟩ + ⟨by linarith only [h4, h4', lt_of_le_of_ne h4 h4'], by linarith only [h3]⟩ h_F_zero_shifted)) h_re)) · exfalso have h_im : (fdBoundaryH H t).im = H := by - rw [fdBoundary_H_eq_seg5_H (by linarith : (4 : ℝ) < t)] + rw [fdBoundary_H_eq_seg5_H (by linarith only [h4] : (4 : ℝ) < t)] simp [fdBoundarySeg5H, add_im, ofReal_im, mul_im, I_re, I_im] exact modFormComp_ne_zero_at_height f hH_pos hcusp h_im h_zero @@ -727,8 +713,8 @@ theorem cpv_modular_side_tendsto lt_of_lt_of_le (sVertOfS_im_lt_height_bound S s hs hH₁_bound) (le_trans (le_max_right _ _) hH) have h_arc_below : ∀ s ∈ sArcOfS S, s.im < H := by intro s hs - nlinarith [Complex.sq_norm s, Complex.normSq_apply s, sq_nonneg s.re, - sArcOfS_unit S s hs, hH_gt_one] + nlinarith only [hH_gt_one, hs, Complex.sq_norm s, Complex.normSq_apply s, sq_nonneg s.re, + sArcOfS_unit S s hs] have h_oncurve_arc := oncurve_arc_of_zero f hf S hS_complete hH_sqrt3 have h_oncurve_vert : ∀ t ∈ Set.Ioo (0 : ℝ) 1, modularFormCompOfComplex f (fdBoundaryH H t) = 0 → diff --git a/LeanPool/LeanModularForms/ValenceFormula/PVChain/Assembly/ResidueSide.lean b/LeanPool/LeanModularForms/ValenceFormula/PVChain/Assembly/ResidueSide.lean index fdb860b3b8..cca1c4c161 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/PVChain/Assembly/ResidueSide.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/PVChain/Assembly/ResidueSide.lean @@ -51,9 +51,9 @@ private lemma fd_point_mem_fdBox (↑p : ℂ) ∈ allZerosInFdBox f hf hM_half := by rw [mem_allZerosInFdBox_iff] have h_fd := hS p hp_S - refine ⟨⟨?_, ?_, ?_, by linarith [hH_bound p hp_S]⟩, ?_⟩ - · rw [UpperHalfPlane.coe_re]; linarith [(abs_le.mp h_fd.2).1] - · rw [UpperHalfPlane.coe_re]; linarith [(abs_le.mp h_fd.2).2] + refine ⟨⟨?_, ?_, ?_, by linarith only [hH_lt_M, hH_bound, hp_S, hH_bound p hp_S]⟩, ?_⟩ + · rw [UpperHalfPlane.coe_re]; linarith only [h_fd, (abs_le.mp h_fd.2).1] + · rw [UpperHalfPlane.coe_re]; linarith only [h_fd, (abs_le.mp h_fd.2).2] · by_contra h_le have h_le' : (↑p : ℂ).im ≤ 1/2 := le_of_not_gt h_le rw [UpperHalfPlane.coe_im] at h_le' @@ -61,9 +61,10 @@ private lemma fd_point_mem_fdBox 1 ≤ p.re * p.re + p.im * p.im := by have := Complex.normSq_apply (↑p : ℂ) rw [UpperHalfPlane.coe_re, UpperHalfPlane.coe_im] at this - linarith [h_fd.1] - nlinarith [(abs_le.mp h_fd.2).1, (abs_le.mp h_fd.2).2, p.im_pos] - · simp_all + linarith only [h_fd, this, h_fd.1] + nlinarith only [h_fd, h_le', h_nsq, (abs_le.mp h_fd.2).1, (abs_le.mp h_fd.2).2, p.im_pos] + · simp_all only [ne_eq, one_div, UpperHalfPlane.coe_im, Function.comp_apply, + UpperHalfPlane.ofComplex_apply] omit f hf in private lemma exists_height_above_sqrt3_and_S @@ -71,10 +72,10 @@ private lemma exists_height_above_sqrt3_and_S ∃ H₀ : ℝ, Real.sqrt 3 / 2 < H₀ ∧ 1 ≤ H₀ ∧ ∀ s ∈ S, (s : ℂ).im < H₀ := by rcases S.eq_empty_or_nonempty with rfl | hne - · exact ⟨1, by nlinarith [Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)], + · exact ⟨1, by nlinarith only [Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)], le_refl _, fun s hs => absurd hs (Finset.notMem_empty s)⟩ · refine ⟨max 1 (S.sup' hne (fun s => (s : ℂ).im) + 1), ?_, ?_, ?_⟩ - · calc Real.sqrt 3 / 2 < 1 := by nlinarith [Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)] + · calc Real.sqrt 3 / 2 < 1 := by nlinarith only [Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)] _ ≤ _ := le_max_left _ _ · exact le_max_left _ _ · intro s hs @@ -215,7 +216,9 @@ private lemma cpv_residue_side_eventually_eq Sbox hSbox S_on hS_on s hs filter_upwards [Ioo_mem_nhdsGT hδ_pos] with ε hε intro t ht; exact lt_of_lt_of_le hε.2 (hδ_bound t ht) - simp_all + simp_all only [ne_eq, UpperHalfPlane.coe_im, Finset.mem_sdiff, Finset.mem_union, not_or, + mem_Icc, and_imp, + eventually_all_finset, eventually_all, not_false_eq_true, implies_true] filter_upwards [h_finite_family] with ε hε t ht rw [Set.uIcc_of_le (by norm_num : (0 : ℝ) ≤ 5)] at ht simp only [cauchyPrincipalValueIntegrandOn] @@ -232,7 +235,9 @@ private lemma cpv_residue_side_eventually_eq · exact ⟨s, h_on, h_norm⟩ · rintro ⟨s, hs, h_norm⟩ exact ⟨s, hS0 ▸ Finset.mem_union.mpr (Or.inr hs), h_norm⟩ - simp_all + simp_all only [ne_eq, UpperHalfPlane.coe_im, Finset.mem_sdiff, Finset.mem_union, not_or, + mem_Icc, and_imp, + eventually_all_finset, eventually_all] include hf in /-- The on-curve singular points that are not box-zeros contribute zero to the @@ -362,8 +367,8 @@ theorem cpv_residue_side_tendsto set γ := fdBoundaryH H with hγ_def set S_on := sArcOfS S ∪ sVertOfS S with hS_on_def set M := H + 1 with hM_def - have hM_half : (1 : ℝ)/2 < M := by linarith - have hHM : H < M := by linarith + have hM_half : (1 : ℝ)/2 < M := by linarith only [hH₀_ge1, hH_ge] + have hHM : H < M := by linarith only [] set Sbox := allZerosInFdBox f hf hM_half with hSbox_def set S0 := Sbox ∪ S_on with hS0_def have hSimplePoles : ∀ s ∈ S0, HasSimplePoleAt F s := @@ -412,7 +417,7 @@ theorem cpv_residue_side_tendsto intro habs have := h (γ t) habs simp [sub_self] at this - linarith [mem_Ioi.mp hε] + linarith only [hε, this, mem_Ioi.mp hε] change Fp (γ t) * _ = F (γ t) * _ congr 1; exact logDerivPatched_eq_raw_off F S0 hSimplePoles h_not have hL_tendsto_S_on : Tendsto (fun ε => diff --git a/LeanPool/LeanModularForms/ValenceFormula/PVChain/Helpers.lean b/LeanPool/LeanModularForms/ValenceFormula/PVChain/Helpers.lean index 30cc8d4868..bd5fa02358 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/PVChain/Helpers.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/PVChain/Helpers.lean @@ -112,7 +112,7 @@ private lemma neg_inv_rho_eq_rho_plus_one : simp [ellipticPointRhoPlusOne, ellipticPointRhoPlusOne'] have hnormSq : -(1/2 : ℝ) * -(1/2) + Real.sqrt 3 / 2 * (Real.sqrt 3 / 2) = 1 := by - nlinarith [Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)] + nlinarith only [Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)] apply Complex.ext · simp only [neg_div, Complex.neg_re, Complex.div_re, Complex.one_re, Complex.one_im, Complex.normSq_apply, @@ -132,7 +132,7 @@ private lemma neg_inv_rho_plus_one_eq_rho : have him2 : (ellipticPointRho : ℂ).im = Real.sqrt 3 / 2 := by simp [ellipticPointRho, ellipticPointRho'] have hnormSq : (1/2 : ℝ) * (1/2) + Real.sqrt 3 / 2 * (Real.sqrt 3 / 2) = 1 := by - nlinarith [Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)] + nlinarith only [Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)] apply Complex.ext · simp only [neg_div, Complex.neg_re, Complex.div_re, Complex.one_re, Complex.one_im, Complex.normSq_apply, @@ -192,7 +192,7 @@ omit f hf in theorem exists_height_bound_S (S : Finset UpperHalfPlane) : ∃ H₁ : ℝ, Real.sqrt 3 / 2 < H₁ ∧ 1 < H₁ ∧ ∀ s ∈ S, (s : ℂ).im < H₁ := by rcases S.eq_empty_or_nonempty with h_empty | h_ne - · exact ⟨2, by nlinarith [Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)], + · exact ⟨2, by nlinarith only [Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)], by norm_num, by simp [h_empty]⟩ · set M := S.sup' h_ne (fun s : ℍ => (s : ℂ).im) with hM_def have hM_pos : 0 < M := by @@ -201,10 +201,10 @@ theorem exists_height_bound_S (S : Finset UpperHalfPlane) : _ ≤ M := Finset.le_sup' (fun s : ℍ => (↑s : ℂ).im) hs refine ⟨max 2 (M + 1), lt_of_lt_of_le ?_ (le_max_left _ _), lt_of_lt_of_le (by norm_num : (1 : ℝ) < 2) (le_max_left _ _), ?_⟩ - · nlinarith [Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)] + · nlinarith only [Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)] · intro s hs calc (s : ℂ).im ≤ M := Finset.le_sup' (fun s : ℍ => (↑s : ℂ).im) hs - _ < M + 1 := by linarith + _ < M + 1 := by linarith only [] _ ≤ max 2 (M + 1) := le_max_right _ _ omit f hf in @@ -266,14 +266,14 @@ private lemma im_gt_sqrt3_half_of_re_half_and_norm_gt_one (p : ℍ) (hre : (↑p : ℂ).re = 1 / 2 ∨ (↑p : ℂ).re = -1 / 2) (hnorm : ‖(↑p : ℂ)‖ > 1) : (↑p : ℂ).im > Real.sqrt 3 / 2 := by have h_nsq : (↑p : ℂ).re ^ 2 + (↑p : ℂ).im ^ 2 > 1 := by - have h_norm_sq : ‖(↑p : ℂ)‖ ^ 2 > 1 := by nlinarith [sq_nonneg (‖(↑p : ℂ)‖ - 1)] + have h_norm_sq : ‖(↑p : ℂ)‖ ^ 2 > 1 := by nlinarith only [hnorm, sq_nonneg (‖(↑p : ℂ)‖ - 1)] have : ‖(↑p : ℂ)‖ ^ 2 = (↑p : ℂ).re ^ 2 + (↑p : ℂ).im ^ 2 := by rw [Complex.sq_norm, Complex.normSq_apply] ring - linarith + linarith only [h_norm_sq, this] have h_re_sq : (↑p : ℂ).re ^ 2 = 1/4 := by rcases hre with h | h <;> (rw [h]; ring) have h_im_sq' : (Real.sqrt 3 / 2) ^ 2 < (↑p : ℂ).im ^ 2 := by - rw [div_pow, Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)]; linarith + rw [div_pow, Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)]; linarith only [h_nsq, h_re_sq] have h_sqrt_ineq := Real.sqrt_lt_sqrt (sq_nonneg (Real.sqrt 3 / 2)) h_im_sq' have : Real.sqrt ((↑p : ℂ).im ^ 2) = (↑p : ℂ).im := Real.sqrt_sq p.2.le rw [Real.sqrt_sq (by positivity : (0 : ℝ) ≤ Real.sqrt 3 / 2), this] at h_sqrt_ineq @@ -303,8 +303,9 @@ private lemma im_ge_sqrt3_half_of_re_half_and_norm_eq_one (p : ℍ) ring linarith have h_im_sq : (↑p : ℂ).im ^ 2 ≥ 3/4 := by - have h_re2 : (↑p : ℂ).re ^ 2 ≤ 1 / 4 := by have ⟨h1, h2⟩ := abs_le.mp hre; nlinarith [h1, h2] - nlinarith [h_nsq, h_re2] + have h_re2 : (↑p : ℂ).re ^ 2 ≤ 1 / 4 := by have ⟨h1, h2⟩ := abs_le.mp hre; nlinarith only [h1, + h2] + nlinarith only [h_nsq, h_re2] have h_im_sq' : (Real.sqrt 3 / 2) ^ 2 ≤ (↑p : ℂ).im ^ 2 := by rw [div_pow, Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)]; linarith rcases eq_or_lt_of_le h_im_sq' with h_eq | h_lt @@ -329,9 +330,9 @@ lemma fdBox_of_on_curve (S : Finset UpperHalfPlane) (hS : ∀ p ∈ S, p ∈ have h_nsq : s.re ^ 2 + s.im ^ 2 = 1 := by have h_sq : ‖s‖ ^ 2 = (s.re ^ 2 + s.im ^ 2) := by rw [Complex.sq_norm, Complex.normSq_apply]; ring - nlinarith [h_unit, h_sq] - have h_re_sq_lt : s.re ^ 2 < 1 := by nlinarith - have h_im_le : s.im ≤ 1 := by nlinarith + nlinarith only [h_unit, h_sq] + have h_re_sq_lt : s.re ^ 2 < 1 := by nlinarith only [h_im_pos, h_nsq] + have h_im_le : s.im ≤ 1 := by nlinarith only [h_im_pos, h_nsq] have h_im_ge : s.im ≥ Real.sqrt 3 / 2 := by simp only [sArcOfS, Finset.mem_union, Finset.mem_image, Finset.mem_filter, Finset.mem_insert, Finset.mem_singleton] at h_arc @@ -349,7 +350,7 @@ lemma fdBox_of_on_curve (S : Finset UpperHalfPlane) (hS : ∀ p ∈ S, p ∈ ring have h_nsq : (↑p : ℂ).re ^ 2 + (↑p : ℂ).im ^ 2 = 1 := by linarith simp only [Complex.normSq_apply] - nlinarith [h_nsq] + nlinarith only [h_norm_sq, this, h_nsq] rw [h_nsq_val, div_one] rw [h_eq] exact im_ge_sqrt3_half_of_re_half_and_norm_eq_one p (hS p hp_mem).2 hp_norm @@ -360,8 +361,8 @@ lemma fdBox_of_on_curve (S : Finset UpperHalfPlane) (hS : ∀ p ∈ S, p ∈ simp only [add_im, one_im, div_im, mul_im, I_re, I_im]; norm_num have h_re_bound : -1 < s.re ∧ s.re < 1 := by constructor - · nlinarith [sq_abs s.re] - · nlinarith [sq_abs s.re] + · nlinarith only [h_re_sq_lt, sq_abs s.re] + · nlinarith only [h_re_sq_lt, sq_abs s.re] have sqrt3_gt_one : (1 : ℝ) < Real.sqrt 3 := by rw [show (1 : ℝ) = Real.sqrt 1 from (Real.sqrt_one).symm] exact Real.sqrt_lt_sqrt (by norm_num) (by norm_num) diff --git a/LeanPool/LeanModularForms/ValenceFormula/PVChain/OnCurveCapture.lean b/LeanPool/LeanModularForms/ValenceFormula/PVChain/OnCurveCapture.lean index 90b5ed0b57..53c3330e53 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/PVChain/OnCurveCapture.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/PVChain/OnCurveCapture.lean @@ -93,23 +93,25 @@ theorem oncurve_vert_capture have h_im_val : z.im = H' - t * (H' - Real.sqrt 3 / 2) := by rw [hz_seg]; simp [fdBoundarySeg1H, add_im, mul_im, I_re, I_im, ofReal_re, ofReal_im, div_ofNat] - have h_im_gt : z.im > Real.sqrt 3 / 2 := by rw [h_im_val]; nlinarith [ht.2] - have h_im_pos : 0 < z.im := by linarith [Real.sqrt_pos.mpr (show (0 : ℝ) < 3 by norm_num)] + have h_im_gt : z.im > Real.sqrt 3 / 2 := by rw [h_im_val]; nlinarith only [hH', ht, ht.2] + have h_im_pos : 0 < z.im := by + linarith only [h_im_gt, Real.sqrt_pos.mpr (show (0 : ℝ) < 3 by norm_num)] have h_re_sq : z.re ^ 2 = 1/4 := by rw [h_re]; ring have h_norm_gt : ‖z‖ > 1 := by have h_im_sq_gt : z.im ^ 2 > 3 / 4 := by - nlinarith [mul_self_lt_mul_self (by positivity : 0 ≤ Real.sqrt 3 / 2) h_im_gt, + nlinarith only [h_im_gt, mul_self_lt_mul_self (by positivity : 0 ≤ Real.sqrt 3 / 2) h_im_gt, Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)] rw [Complex.norm_eq_sqrt_sq_add_sq] calc 1 = Real.sqrt 1 := by simp only [Real.sqrt_one] _ < Real.sqrt (z.re ^ 2 + z.im ^ 2) := - Real.sqrt_lt_sqrt (by norm_num) (by linarith) + Real.sqrt_lt_sqrt (by norm_num) (by linarith only [h_re_sq, h_im_sq_gt]) let p : ℍ := ⟨z, h_im_pos⟩ have hp_fd : p ∈ 𝒟 := by refine ⟨?_, by change |z.re| ≤ 1/2; rw [h_re]; norm_num⟩ change 1 ≤ Complex.normSq z rw [Complex.normSq_apply] - nlinarith [mul_self_le_mul_self (by positivity : 0 ≤ Real.sqrt 3 / 2) h_im_gt.le, + nlinarith only [h_im_gt, h_re_sq, + mul_self_le_mul_self (by positivity : 0 ≤ Real.sqrt 3 / 2) h_im_gt.le, Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)] have hp_zero : f p = 0 := modform_zero_to_uhp f h_im_pos h_zero have hp_in_S := hS_complete p hp_fd (orderOfVanishingAt'_ne_zero_of_eq_zero f hf p hp_zero) @@ -126,17 +128,17 @@ theorem height_contradiction {H : ℝ} (hH_ge1 : 1 ≤ H) (hH_bound : ∀ s ∈ S, (s : ℂ).im < H) {z : ℂ} (h_im : z.im = H) (h_re : |z.re| ≤ 1 / 2) (h_zero : modularFormCompOfComplex f z = 0) : False := by - have h_im_pos : 0 < z.im := by linarith + have h_im_pos : 0 < z.im := by linarith only [hH_ge1, h_im] let p : ℍ := ⟨z, h_im_pos⟩ have hp_fd : p ∈ 𝒟 := by refine ⟨?_, h_re⟩ change 1 ≤ Complex.normSq z rw [Complex.normSq_apply] - nlinarith [sq_nonneg z.re, sq_nonneg z.im, sq_abs z.im] + nlinarith only [hH_ge1, h_im, sq_nonneg z.re, sq_nonneg z.im, sq_abs z.im] have hp_zero : f p = 0 := modform_zero_to_uhp f h_im_pos h_zero have hp_in_S := hS_complete p hp_fd (orderOfVanishingAt'_ne_zero_of_eq_zero f hf p hp_zero) have h_p_im : (↑p : ℂ).im = z.im := rfl - linarith [hH_bound p hp_in_S] + linarith only [hH_bound, h_im, hp_in_S, hH_bound p hp_in_S] omit hf in lemma seg4_eq_seg1_minus_one_H (H : ℝ) (s : ℝ) (_hs : s ∈ Icc 0 1) : @@ -153,10 +155,11 @@ theorem oncurve_seg4_capture fdBoundaryH H t ∈ (↑(sVertOfS S) : Set ℂ) := by set z := fdBoundaryH H t with hz_def have hz_seg : z = fdBoundarySeg4H H t := - fdBoundary_H_eq_seg4_H (by linarith [ht.1]) (le_of_lt ht.2) + fdBoundary_H_eq_seg4_H (by linarith only [ht, ht.1]) (le_of_lt ht.2) set s := 4 - t with hs_def - have hs_Icc : s ∈ Icc (0 : ℝ) 1 := ⟨by linarith [ht.2], by linarith [ht.1]⟩ - have hs_Ioo : s ∈ Set.Ioo (0 : ℝ) 1 := ⟨by linarith [ht.2], by linarith [ht.1]⟩ + have hs_Icc : s ∈ Icc (0 : ℝ) 1 := ⟨by linarith only [ht, ht.2], by linarith only [ht, ht.1]⟩ + have hs_Ioo : s ∈ Set.Ioo (0 : ℝ) 1 := ⟨by linarith only [ht, ht.2], by + linarith only [ht, ht.1]⟩ have h4s : (4 : ℝ) - s = t := by rw [hs_def]; ring have h_seg_eq : z = fdBoundarySeg1H H s - 1 := by rw [hz_seg, ← h4s]; exact seg4_eq_seg1_minus_one_H H s hs_Icc @@ -170,24 +173,25 @@ theorem oncurve_seg4_capture have h_im_val : (fdBoundarySeg1H H s).im = H - s * (H - Real.sqrt 3 / 2) := by simp [fdBoundarySeg1H, add_im, mul_im, I_re, I_im, ofReal_re, ofReal_im, div_ofNat] have h_im_gt : (fdBoundarySeg1H H s).im > Real.sqrt 3 / 2 := by - rw [h_im_val]; nlinarith [hs_Ioo.2] + rw [h_im_val]; nlinarith only [hH, hs_Ioo, hs_Ioo.2] have h_im_pos : 0 < (fdBoundarySeg1H H s).im := by - linarith [Real.sqrt_pos.mpr (show (0 : ℝ) < 3 by norm_num)] + linarith only [h_im_gt, Real.sqrt_pos.mpr (show (0 : ℝ) < 3 by norm_num)] have h_re_sq : (fdBoundarySeg1H H s).re ^ 2 = 1/4 := by rw [h_re]; ring have h_norm_gt : ‖fdBoundarySeg1H H s‖ > 1 := by have h_im_sq_gt : (fdBoundarySeg1H H s).im ^ 2 > 3/4 := by - nlinarith [mul_self_lt_mul_self (by positivity : 0 ≤ Real.sqrt 3 / 2) h_im_gt, + nlinarith only [h_im_gt, mul_self_lt_mul_self (by positivity : 0 ≤ Real.sqrt 3 / 2) h_im_gt, Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)] rw [Complex.norm_eq_sqrt_sq_add_sq] calc 1 = Real.sqrt 1 := by simp only [Real.sqrt_one] _ < Real.sqrt ((fdBoundarySeg1H H s).re ^ 2 + (fdBoundarySeg1H H s).im ^ 2) := - Real.sqrt_lt_sqrt (by norm_num) (by linarith) + Real.sqrt_lt_sqrt (by norm_num) (by linarith only [h_re_sq, h_im_sq_gt]) let p : ℍ := ⟨fdBoundarySeg1H H s, h_im_pos⟩ have hp_fd : p ∈ 𝒟 := by refine ⟨?_, by change |(fdBoundarySeg1H H s).re| ≤ 1/2; rw [h_re]; norm_num⟩ change 1 ≤ Complex.normSq (fdBoundarySeg1H H s) rw [Complex.normSq_apply] - nlinarith [mul_self_le_mul_self (by positivity : 0 ≤ Real.sqrt 3 / 2) h_im_gt.le, + nlinarith only [h_im_gt, h_re_sq, + mul_self_le_mul_self (by positivity : 0 ≤ Real.sqrt 3 / 2) h_im_gt.le, Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)] have hp_zero : f p = 0 := modform_zero_to_uhp f h_im_pos h_zero_seg1 have hp_in_S := hS_complete p hp_fd (orderOfVanishingAt'_ne_zero_of_eq_zero f hf p hp_zero) @@ -235,7 +239,7 @@ theorem oncurve_full_capture (S : Finset ℍ) (_hS : ∀ p ∈ S, p ∈ 𝒟) rw [fdBoundary_H_eq_arc h1 h3s] exact Complex.norm_exp_ofReal_mul_I _ exact oncurve_arc_capture f hf S hS_complete hH_sqrt3 - ⟨by linarith, by linarith [ht.2]⟩ h_norm h_zero + ⟨by linarith only [h1], by linarith only [h3, ht.2]⟩ h_norm h_zero · rcases le_or_gt t 4 with h4 | h4 · rcases (eq_or_lt_of_le h4 : t = 4 ∨ t < 4) with rfl | h4s · exfalso @@ -252,12 +256,12 @@ theorem oncurve_full_capture (S : Finset ℍ) (_hS : ∀ p ∈ S, p ∈ 𝒟) exact oncurve_seg4_capture f hf S hS_complete hH_sqrt3 ⟨h3, h4s⟩ h_zero · exfalso have h_re : |(fdBoundaryH H t).re| ≤ 1/2 := by - rw [fdBoundary_H_eq_seg5_H (by linarith : (4 : ℝ) < t)] + rw [fdBoundary_H_eq_seg5_H (by linarith only [h4] : (4 : ℝ) < t)] simp only [fdBoundarySeg5H, add_re, sub_re, ofReal_re, div_ofNat_re, re_ofNat, mul_re, I_re, mul_zero, ofReal_im, I_im, mul_one, sub_self, add_zero, one_div] - rw [abs_le]; constructor <;> linarith [ht.2] + rw [abs_le]; constructor <;> linarith only [h4, ht.2, ht] have h_im : (fdBoundaryH H t).im = H := by - rw [fdBoundary_H_eq_seg5_H (by linarith : (4 : ℝ) < t)] + rw [fdBoundary_H_eq_seg5_H (by linarith only [h4] : (4 : ℝ) < t)] simp [fdBoundarySeg5H, add_im, sub_im, mul_im, I_re, I_im, ofReal_re, ofReal_im] exact height_contradiction f hf S hS_complete hH_ge1 hH_bound h_im h_re h_zero diff --git a/LeanPool/LeanModularForms/ValenceFormula/PVChain/ResidueSideInfra.lean b/LeanPool/LeanModularForms/ValenceFormula/PVChain/ResidueSideInfra.lean index dff1216f35..48e0c46f68 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/PVChain/ResidueSideInfra.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/PVChain/ResidueSideInfra.lean @@ -10,7 +10,6 @@ public import LeanPool.LeanModularForms.GeneralizedResidueTheory.Residue public import LeanPool.LeanModularForms.ValenceFormula.Boundary.Basic import LeanPool.LeanModularForms.GeneralizedResidueTheory.Homotopy.Invariance import LeanPool.LeanModularForms.GeneralizedResidueTheory.Residue.MultipointPV -import LeanPool.LeanModularForms.ValenceFormula.Boundary.Bounds import LeanPool.LeanModularForms.ValenceFormula.Boundary.Smooth import LeanPool.LeanModularForms.ValenceFormula.OrbitSum import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv @@ -60,16 +59,18 @@ lemma fdBox_isOpen (M : ℝ) : IsOpen (fdBox M) := by private lemma strict_convex_comb_lb {a b x y L : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a + b = 1) (hx : L < x) (hy : L < y) : L < a * x + b * y := by rcases eq_or_lt_of_le ha with rfl | ha' - · simp only [zero_add] at hab; subst hab; simp only [zero_mul, zero_add, one_mul]; linarith - · linarith [mul_lt_mul_of_pos_left hx ha', mul_le_mul_of_nonneg_left hy.le hb, - show a * L + b * L = L from by linear_combination L * hab] + · simp only [zero_add] at hab; subst hab; simp only [zero_mul, zero_add, + one_mul]; linarith only [hy] + · linarith only [hb, hab, hx, hy, ha', mul_lt_mul_of_pos_left hx ha', + mul_le_mul_of_nonneg_left hy.le hb, show a * L + b * L = L from by linear_combination L * hab] private lemma strict_convex_comb_ub {a b x y U : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a + b = 1) (hx : x < U) (hy : y < U) : a * x + b * y < U := by rcases eq_or_lt_of_le ha with rfl | ha' - · simp only [zero_add] at hab; subst hab; simp only [zero_mul, zero_add, one_mul]; linarith - · linarith [mul_lt_mul_of_pos_left hx ha', mul_le_mul_of_nonneg_left hy.le hb, - show a * U + b * U = U from by linear_combination U * hab] + · simp only [zero_add] at hab; subst hab; simp only [zero_mul, zero_add, + one_mul]; linarith only [hy] + · linarith only [hb, hab, hx, hy, ha', mul_lt_mul_of_pos_left hx ha', + mul_le_mul_of_nonneg_left hy.le hb, show a * U + b * U = U from by linear_combination U * hab] lemma fdBox_convex (M : ℝ) : Convex ℝ (fdBox M) := by intro x hx y hy a b ha hb hab @@ -81,7 +82,8 @@ lemma fdBox_convex (M : ℝ) : Convex ℝ (fdBox M) := by him ▸ strict_convex_comb_lb ha hb hab hx.2.2.1 hy.2.2.1, him ▸ strict_convex_comb_ub ha hb hab hx.2.2.2 hy.2.2.2⟩ -private lemma fdBox_im_pos' {M : ℝ} {z : ℂ} (hz : z ∈ fdBox M) : 0 < z.im := by linarith [hz.2.2.1] +private lemma fdBox_im_pos' {M : ℝ} {z : ℂ} (hz : z ∈ fdBox M) : 0 < z.im := by + linarith only [hz, hz.2.2.1] /-! ### allZerosInFdBox -/ @@ -281,14 +283,14 @@ lemma fdBoundary_H_mem_fdBox' {H M : ℝ} (hH : 1 ≤ H) (hM : H < M) (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 5) : fdBoundaryH H t ∈ fdBox M := by have h_re_abs := fdBoundary_H_re_abs_le_half H t ht constructor - · linarith [abs_le.mp h_re_abs] + · linarith only [h_re_abs, abs_le.mp h_re_abs] constructor - · linarith [abs_le.mp h_re_abs] + · linarith only [h_re_abs, abs_le.mp h_re_abs] constructor · have hH_sqrt3 : Real.sqrt 3 / 2 ≤ H := by - nlinarith [Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)] + nlinarith only [hH, Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)] have h_half_lt_sqrt3 : (1 : ℝ)/2 < Real.sqrt 3 / 2 := by - nlinarith [Real.mul_self_sqrt (show (0 : ℝ) ≤ 3 by norm_num), + nlinarith only [Real.mul_self_sqrt (show (0 : ℝ) ≤ 3 by norm_num), Real.sqrt_pos.mpr (show (0 : ℝ) < 3 by norm_num)] exact lt_of_lt_of_le h_half_lt_sqrt3 (fdBoundary_H_im_ge_sqrt3_div_2 H hH_sqrt3 t ht) · exact lt_of_le_of_lt (fdBoundary_H_im_le_H hH t ht) hM @@ -455,7 +457,8 @@ omit f hf in /-- `‖fdBoundaryH H t‖ ≥ 1` for `t ∈ [0, 5]` when `H ≥ 1`. -/ lemma fdBoundary_H_norm_ge_one {H : ℝ} (hH : 1 ≤ H) (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 5) : ‖fdBoundaryH H t‖ ≥ 1 := by - have hH_sqrt3 : Real.sqrt 3 / 2 ≤ H := by nlinarith [Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)] + have hH_sqrt3 : Real.sqrt 3 / 2 ≤ H := by + nlinarith only [hH, Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)] by_cases h1 : t ≤ 1 · rw [fdBoundary_H_eq_seg1_H h1] have hre : (fdBoundarySeg1H H t).re = 1/2 := by @@ -465,13 +468,13 @@ lemma fdBoundary_H_norm_ge_one {H : ℝ} (hH : 1 ≤ H) (t : ℝ) (ht : t ∈ Ic rwa [fdBoundary_H_eq_seg1_H h1] at this have h_nsq : normSq (fdBoundarySeg1H H t) ≥ 1 := by rw [normSq_apply, hre] - nlinarith [mul_self_le_mul_self (by positivity : (0 : ℝ) ≤ Real.sqrt 3 / 2) him, - Real.mul_self_sqrt (show (0 : ℝ) ≤ 3 from by norm_num)] + nlinarith only [him, mul_self_le_mul_self (by positivity : (0 : ℝ) ≤ Real.sqrt 3 / 2) him, + Real.mul_self_sqrt (show (0 : ℝ) ≤ 3 from by norm_num)] exact norm_ge_one_of_normSq_ge_one h_nsq · push Not at h1; by_cases h3 : t ≤ 3 - · rw [fdBoundary_H_eq_fdBoundary_on_13 H (by linarith) h3] - suffices ‖fdBoundary t‖ = 1 by linarith - simp only [fdBoundary, show ¬(t ≤ 1) from by linarith, ↓reduceIte] + · rw [fdBoundary_H_eq_fdBoundary_on_13 H (by linarith only [h1]) h3] + suffices ‖fdBoundary t‖ = 1 by linarith only [this] + simp only [fdBoundary, show ¬(t ≤ 1) from by linarith only [h1], ↓reduceIte] split_ifs with h2 · change ‖fdBoundarySeg2 t‖ = 1 unfold fdBoundarySeg2 @@ -493,8 +496,9 @@ lemma fdBoundary_H_norm_ge_one {H : ℝ} (hH : 1 ≤ H) (t : ℝ) (ht : t ∈ Ic rwa [fdBoundary_H_eq_seg4_H h3 h4] at this have h_nsq : normSq (fdBoundarySeg4H H t) ≥ 1 := by rw [normSq_apply, hre] - nlinarith [mul_self_le_mul_self (by positivity : (0 : ℝ) ≤ Real.sqrt 3 / 2) him, - Real.mul_self_sqrt (show (0 : ℝ) ≤ 3 from by norm_num)] + nlinarith only [him, + mul_self_le_mul_self (by positivity : (0 : ℝ) ≤ Real.sqrt 3 / 2) him, + Real.mul_self_sqrt (show (0 : ℝ) ≤ 3 from by norm_num)] exact norm_ge_one_of_normSq_ge_one h_nsq · push Not at h4 rw [fdBoundary_H_eq_seg5_H h4] @@ -503,8 +507,8 @@ lemma fdBoundary_H_norm_ge_one {H : ℝ} (hH : 1 ≤ H) (t : ℝ) (ht : t ∈ Ic div_ofNat] have h_nsq : normSq (fdBoundarySeg5H H t) ≥ 1 := by rw [normSq_apply] - nlinarith [mul_self_nonneg (fdBoundarySeg5H H t).re, - mul_self_le_mul_self (by linarith : (0 : ℝ) ≤ 1) (hH.trans him.ge)] + nlinarith only [hH, him, mul_self_nonneg (fdBoundarySeg5H H t).re, + mul_self_le_mul_self (by linarith only [] : (0 : ℝ) ≤ 1) (hH.trans him.ge)] exact norm_ge_one_of_normSq_ge_one h_nsq omit f hf in @@ -516,9 +520,9 @@ lemma off_curve_of_not_in_fd_H {H : ℝ} (hH : 1 ≤ H) (z₀ : ℂ) intro t ht heq by_cases h_re : |z₀.re| ≤ 1/2 · have h_norm_lt : ‖z₀‖ < 1 := hz₀_not_fd h_re - linarith [heq ▸ fdBoundary_H_norm_ge_one hH t ht] + linarith only [hH, ht, heq, h_norm_lt, heq ▸ fdBoundary_H_norm_ge_one hH t ht] · push Not at h_re - linarith [heq ▸ fdBoundary_H_re_abs_le_half H t ht] + linarith only [ht, heq, h_re, heq ▸ fdBoundary_H_re_abs_le_half H t ht] omit f hf in /-- FTC: integral = 0 for a closed curve with slit-plane avoidance. -/ @@ -602,13 +606,14 @@ lemma winding_zero_for_non_fd_point_H_geo (S : Finset UpperHalfPlane) change 1 ≤ Complex.normSq z₀ have h_sq := Complex.sq_norm z₀ rw [Complex.normSq_apply] at h_sq ⊢ - nlinarith [h_sq] + nlinarith only [h_norm, h_sq] have h_ord : orderOfVanishingAt' (⇑f) s ≠ 0 := orderOfVanishingAt'_ne_zero_of_eq_zero f hf s h_fs exact hz₀_not_S s (hS_complete s h_fd h_ord) rfl have h_off : ∀ t ∈ Icc (0 : ℝ) 5, fdBoundaryH H t ≠ z₀ := off_curve_of_not_in_fd_H hH z₀ hz₀_not_fd - have hH_sqrt3 : Real.sqrt 3 / 2 < H := by nlinarith [Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)] + have hH_sqrt3 : Real.sqrt 3 / 2 < H := by + nlinarith only [hH, Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num)] have h_classical := generalizedWindingNumber_eq_classical_away (fdBoundaryHCurve H) z₀ (by intro t ht; exact h_off t ht) rw [show (fdBoundaryHCurve H).toFun = fdBoundaryH H from rfl, @@ -646,12 +651,14 @@ lemma winding_zero_for_non_fd_point_H_geo (S : Finset UpperHalfPlane) have h_sq_norm_curve := Complex.sq_norm (fdBoundaryH H t) rw [Complex.normSq_apply, h2] at h_sq_norm_curve have h_curve_sq_ge : ‖fdBoundaryH H t‖ ^ 2 ≥ 1 := by - nlinarith [norm_nonneg (fdBoundaryH H t), fdBoundary_H_norm_ge_one hH t ht] + nlinarith only [hH, ht, norm_nonneg (fdBoundaryH H t), fdBoundary_H_norm_ge_one hH t ht] have h_im_pos : 0 < (fdBoundaryH H t).im := fdBoundary_H_im_pos H hH_sqrt3 t ht - nlinarith [mul_nonneg (show z₀.im - (fdBoundaryH H t).im ≥ 0 from by linarith) - (show z₀.im + (fdBoundaryH H t).im ≥ 0 from by linarith), - (show ‖z₀‖ ^ 2 < 1 from by nlinarith [norm_nonneg z₀])] + have h_im_product := mul_nonneg (sub_nonneg.mpr h1) + (add_nonneg (le_of_lt hz₀_im_pos) (le_of_lt h_im_pos)) + have h_norm_sq_lt : ‖z₀‖ ^ 2 < 1 := by + nlinarith only [h_norm_lt, norm_nonneg z₀] + nlinarith only [h_sq_norm_z₀, h_sq_norm_curve, h_curve_sq_ge, h_im_product, h_norm_sq_lt] · exact hγ_diff · exact hγ_deriv_cont · exact hγ_deriv_bdd diff --git a/LeanPool/LeanModularForms/ValenceFormula/PVChain/Seg5CuspIntegral.lean b/LeanPool/LeanModularForms/ValenceFormula/PVChain/Seg5CuspIntegral.lean index d5faad294c..49cfb6e035 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/PVChain/Seg5CuspIntegral.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/PVChain/Seg5CuspIntegral.lean @@ -8,7 +8,6 @@ module public import LeanPool.LeanModularForms.ValenceFormula.ModularInvariance public import LeanPool.LeanModularForms.ValenceFormula.Boundary.Basic import LeanPool.LeanModularForms.ForMathlib.QExpansion -import LeanPool.LeanModularForms.ValenceFormula.Boundary.Bounds import LeanPool.LeanModularForms.ValenceFormula.Boundary.Smooth import Mathlib.Analysis.SpecialFunctions.Trigonometric.Arctan import Mathlib.CategoryTheory.Category.Init @@ -163,7 +162,8 @@ private lemma cuspFunction_factored (hf : f ≠ 0) : (Convex.isPreconnected (convex_ball 0 1)) h0_mem hF_local refine ⟨g₀, hg_diff, hg_ne, fun q hq => ?_⟩ have := hF_eq hq - simp_all + simp_all only [ne_eq, sub_zero, smul_eq_mul, Metric.mem_ball, dist_self, zero_lt_one, + dist_zero_right] /-! ### Circle integral helpers -/ @@ -218,7 +218,7 @@ lemma seg5_q_radius_H_pos (H : ℝ) : 0 < seg5QRadiusH H := omit f hf in /-- `seg5QRadiusH H < 1` when `H > 0`. -/ private lemma seg5_q_radius_H_lt_one' {H : ℝ} (hH : 0 < H) : seg5QRadiusH H < 1 := - Real.exp_lt_one_iff.mpr (by nlinarith [Real.pi_pos]) + Real.exp_lt_one_iff.mpr (by nlinarith only [hH, Real.pi_pos]) /-! ### Circle integral of logDeriv(cuspFunction) -/ @@ -320,7 +320,9 @@ omit f hf in private lemma im_fdBoundary_seg5_H_pos {H : ℝ} (hH : 0 < H) (t : ℝ) : 0 < (fdBoundarySeg5H H t).im := by change 0 < ((↑t : ℂ) - 9 / 2 + ↑H * I).im - simp_all + simp_all only [add_im, sub_im, ofReal_im, div_ofNat_im, im_ofNat, zero_div, sub_self, mul_im, + ofReal_re, I_im, + mul_one, I_re, mul_zero, add_zero, zero_add] omit hf in /-- Chain rule for logDeriv along seg5 at height H: @@ -349,7 +351,7 @@ private lemma logDeriv_modularForm_eq_logDeriv_cuspFn_mul_qderiv_H simp only [q_fn, Function.Periodic.norm_qParam] have him : 0 < (fdBoundarySeg5H H t).im := im_fdBoundary_seg5_H_pos hH t rw [show (-2 * Real.pi * z.im / (1 : ℝ)) = -2 * Real.pi * z.im by ring] - exact Real.exp_lt_one_iff.mpr (by nlinarith [Real.pi_pos]) + exact Real.exp_lt_one_iff.mpr (by nlinarith only [him, Real.pi_pos]) have hF_diff : DifferentiableAt ℂ F (q_fn z) := ModularFormClass.differentiableAt_cuspFunction f one_pos (by simp) hq_norm diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/AngleAnalysis.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/AngleAnalysis.lean index aaec35d38b..db59048183 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/AngleAnalysis.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/AngleAnalysis.lean @@ -68,7 +68,11 @@ lemma v0_quadrant (p : ℂ) (hp_re : |p.re| < 1 / 2) (hp_im : p.im < HHeight) : (fdPolygon 0 - p).re > 0 ∧ (fdPolygon 0 - p).im > 0 := by rw [fdPolygon_at_zero] have hpre : p.re < 1/2 := (abs_lt.mp hp_re).2 - simp_all + simp_all only [one_div, sub_re, add_re, inv_re, re_ofNat, normSq_ofNat, div_self_mul_self', + mul_re, ofReal_re, + I_re, mul_zero, ofReal_im, I_im, mul_one, sub_self, add_zero, gt_iff_lt, sub_pos, sub_im, + add_im, inv_im, im_ofNat, + neg_zero, zero_div, mul_im, zero_add, and_self] /-- For interior points with ‖p‖ > 1, |p.re| < 1/2, 0 < p.im, we have p.im > √3/2. -/ lemma interior_point_im_bound (p : ℂ) (hp_norm : ‖p‖ > 1) @@ -76,20 +80,20 @@ lemma interior_point_im_bound (p : ℂ) (hp_norm : ‖p‖ > 1) p.im > Real.sqrt 3 / 2 := by have hpre_sq : p.re ^ 2 < 1/4 := by have h := abs_lt.mp hp_re - nlinarith [sq_abs p.re] + nlinarith only [h, sq_abs p.re] have hnorm_sq : p.re ^ 2 + p.im ^ 2 > 1 := by rw [Complex.norm_eq_sqrt_sq_add_sq] at hp_norm have h_sum_nonneg : 0 ≤ p.re^2 + p.im^2 := by positivity calc p.re^2 + p.im^2 = (Real.sqrt (p.re^2 + p.im^2))^2 := (Real.sq_sqrt h_sum_nonneg).symm - _ > 1^2 := by nlinarith + _ > 1^2 := by nlinarith only [hp_norm] _ = 1 := by ring - have hp_im_sq : p.im ^ 2 > 3/4 := by linarith + have hp_im_sq : p.im ^ 2 > 3/4 := by linarith only [hpre_sq, hnorm_sq] have h4 : Real.sqrt 4 = 2 := by rw [show (4 : ℝ) = 2^2 by norm_num, Real.sqrt_sq (by norm_num : (0 : ℝ) ≤ 2)] have h3 : Real.sqrt (3/4) = Real.sqrt 3 / 2 := by rw [Real.sqrt_div (by norm_num : (3 : ℝ) ≥ 0), h4] rw [← h3, gt_iff_lt, Real.sqrt_lt' hp_im_pos] - linarith + linarith only [hpre_sq, hnorm_sq] /-- Direction from p to fdPolygon 1 (= rho') is in Q4 (re > 0, im < 0). -/ lemma v1_quadrant (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_re : |p.re| < 1 / 2) @@ -99,7 +103,7 @@ lemma v1_quadrant (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_re : |p.re| < 1 / 2) have hbound := interior_point_im_bound p hp_norm hp_re hp_im_pos have hre : (rho' - p).re = 1/2 - p.re := by simp [rho'] have him : (rho' - p).im = Real.sqrt 3 / 2 - p.im := by simp [rho'] - exact ⟨by linarith, by linarith⟩ + exact ⟨by linarith only [hpre, hre], by linarith only [hbound, him]⟩ /-- Polygon vertex at t=3: rho. -/ lemma fdPolygon_at_three : fdPolygon 3 = rho := by @@ -110,19 +114,23 @@ lemma fdPolygon_at_three : fdPolygon 3 = rho := by lemma v3_quadrant (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_re : |p.re| < 1 / 2) (hp_im_pos : 0 < p.im) : (fdPolygon 3 - p).re < 0 ∧ (fdPolygon 3 - p).im < 0 := by rw [fdPolygon_at_three] - have hpre : -1/2 < p.re := by linarith [(abs_lt.mp hp_re).1] + have hpre : -1/2 < p.re := by linarith only [hp_re, (abs_lt.mp hp_re).1] have hbound := interior_point_im_bound p hp_norm hp_re hp_im_pos have hre : (rho - p).re = -1/2 - p.re := by simp [rho] have him : (rho - p).im = Real.sqrt 3 / 2 - p.im := by simp [rho] - exact ⟨by linarith, by linarith⟩ + exact ⟨by linarith only [hpre, hre], by linarith only [hbound, him]⟩ /-- Direction from p to fdPolygon 4 is in Q2 (re < 0, im > 0). -/ lemma v4_quadrant (p : ℂ) (hp_re : |p.re| < 1 / 2) (hp_im : p.im < HHeight) : (fdPolygon 4 - p).re < 0 ∧ (fdPolygon 4 - p).im > 0 := by rw [fdPolygon_at_four] have hpre_neg : -(1/2) < p.re := (abs_lt.mp hp_re).1 - have hpre : -1/2 < p.re := by linarith - simp_all + have hpre : -1/2 < p.re := by linarith only [hpre_neg] + simp_all only [one_div, sub_re, add_re, div_ofNat_re, neg_re, one_re, mul_re, ofReal_re, I_re, + mul_zero, + ofReal_im, I_im, mul_one, sub_self, add_zero, sub_neg, sub_im, add_im, div_ofNat_im, + neg_im, one_im, neg_zero, + zero_div, mul_im, zero_add, gt_iff_lt, sub_pos, and_self] /-- Q1: re > 0, im > 0 → 0 < arg < π/2. -/ lemma arg_Q1 (z : ℂ) (hz_re : 0 < z.re) (hz_im : 0 < z.im) : @@ -132,7 +140,7 @@ lemma arg_Q1 (z : ℂ) (hz_re : 0 < z.re) (hz_im : 0 < z.im) : have h_ne : z.arg ≠ 0 := by intro h_eq rw [Complex.arg_eq_zero_iff] at h_eq - linarith [h_eq.2] + linarith only [hz_im, h_eq, h_eq.2] exact lt_of_le_of_ne h_nonneg (Ne.symm h_ne) · rw [Complex.arg_lt_pi_div_two_iff] left; exact hz_re @@ -143,14 +151,14 @@ lemma arg_Q4 (z : ℂ) (hz_re : 0 < z.re) (hz_im : z.im < 0) : constructor · rw [Complex.neg_pi_div_two_lt_arg_iff] left; exact hz_re - · simp_all + · simp_all only [arg_neg_iff] /-- Q3: im < 0 → -π < arg < 0. -/ lemma arg_Q3 (z : ℂ) (hz_im : z.im < 0) : -Real.pi < z.arg ∧ z.arg < 0 := by constructor · exact (Complex.arg_mem_Ioc z).1 - · simp_all + · simp_all only [arg_neg_iff] /-- Q2: re < 0, im > 0 → π/2 < arg ≤ π. -/ lemma arg_Q2 (z : ℂ) (hz_re : z.re < 0) (hz_im : 0 < z.im) : @@ -160,8 +168,8 @@ lemma arg_Q2 (z : ℂ) (hz_re : z.re < 0) (hz_im : 0 < z.im) : push Not at h rw [Complex.arg_le_pi_div_two_iff] at h cases h with - | inl h_re_pos => linarith - | inr h_im_neg => linarith + | inl h_re_pos => linarith only [hz_re, h_re_pos] + | inr h_im_neg => linarith only [hz_im, h_im_neg] · exact (Complex.arg_mem_Ioc z).2 /-- The unique time on seg4 where (fdPolygon t - p) crosses the negative real axis. -/ @@ -185,27 +193,27 @@ lemma tL_mem_Ioo (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_re : |p.re| < 1 / 2) /-- On seg4, (fdPolygon t - p).re < 0. -/ lemma seg4_vec_re_neg (p : ℂ) (hp_re : |p.re| < 1 / 2) (t : ℝ) (ht : t ∈ Set.Ioc (3 : ℝ) 4) : (fdPolygon t - p).re < 0 := by - have hpre : -1/2 < p.re := by linarith [(abs_lt.mp hp_re).1] + have hpre : -1/2 < p.re := by linarith only [hp_re, (abs_lt.mp hp_re).1] have hseg4_re : (fdPolygon t).re = -1/2 := by simp only [fdPolygon] split_ifs with h1 h2 h3 h4 - · linarith [ht.1] - · linarith [ht.1] - · linarith [ht.1] + · linarith only [ht, h1, ht.1] + · linarith only [ht, h2, ht.1] + · linarith only [ht, h3, ht.1] · simp - · linarith [ht.2] - simp_all + · linarith only [ht, h4, ht.2] + simp_all only [one_div, mem_Ioc, sub_re, sub_neg] /-- On seg4, the imaginary part of fdPolygon t. -/ lemma seg4_im_formula (t : ℝ) (ht : t ∈ Set.Ioc (3 : ℝ) 4) : (fdPolygon t).im = Real.sqrt 3 / 2 + (t - 3) * (HHeight - Real.sqrt 3 / 2) := by simp only [fdPolygon] split_ifs with h1 h2 h3 h4 - · linarith [ht.1] - · linarith [ht.1] - · linarith [ht.1] + · linarith only [ht, h1, ht.1] + · linarith only [ht, h2, ht.1] + · linarith only [ht, h3, ht.1] · simp [Complex.add_im, Complex.mul_im, Complex.I_re, Complex.I_im, Complex.ofReal_im] - · linarith [ht.2] + · linarith only [ht, h4, ht.2] /-- Sign of (fdPolygon t - p).im on seg4: negative before tL, zero at tL, positive after. -/ @@ -214,8 +222,8 @@ lemma seg4_vec_im_sign (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_re : |p.re| < 1 / 2 (t < tL p → (fdPolygon t - p).im < 0) ∧ (t = tL p → (fdPolygon t - p).im = 0) ∧ (tL p < t → 0 < (fdPolygon t - p).im) := by have hbound := interior_point_im_bound p hp_norm hp_re hp_im_pos - have hH : HHeight = Real.sqrt 3 / 2 + 1 := rfl - have hdenom_pos : HHeight - Real.sqrt 3 / 2 > 0 := by rw [hH]; linarith + have hdenom_pos : HHeight - Real.sqrt 3 / 2 > 0 := + sub_pos.mpr (lt_trans hbound hp_im) have hdenom_ne : HHeight - Real.sqrt 3 / 2 ≠ 0 := ne_of_gt hdenom_pos have him := seg4_im_formula t ht set D := HHeight - Real.sqrt 3 / 2 with hD_def @@ -231,9 +239,11 @@ lemma seg4_vec_im_sign (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_re : |p.re| < 1 / 2 rw [h2, mul_div_cancel₀ _ hdenom_ne] ring refine ⟨?_, ?_, ?_⟩ - · simp_all + · intro hlt + rw [him_eq] + exact mul_neg_of_pos_of_neg hdenom_pos (sub_neg.mpr hlt) · intro heq; rw [him_eq, heq, sub_self, mul_zero] - · intro hgt; rw [him_eq]; exact mul_pos hdenom_pos (by linarith) + · intro hgt; rw [him_eq]; exact mul_pos hdenom_pos (by linarith only [hgt]) /-- At tL, the vector fdPolygon t - p is a nonzero negative real. -/ lemma seg4_vec_at_tL (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_re : |p.re| < 1 / 2) (hp_im_pos : 0 < p.im) @@ -264,7 +274,7 @@ lemma arg_seg4_after (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_re : |p.re| < 1 / 2) 0 < Complex.arg (fdPolygon t - p) := by have hre := seg4_vec_re_neg p hp_re t ht have him := (seg4_vec_im_sign p hp_norm hp_re hp_im_pos hp_im t ht).2.2 htL - linarith [(arg_Q2 (fdPolygon t - p) hre him).1, Real.pi_pos] + linarith only [hre, him, (arg_Q2 (fdPolygon t - p) hre him).1, Real.pi_pos] /-- arg is preserved under normalization. -/ lemma arg_normalize_eq (z : ℂ) (hz : z ≠ 0) : @@ -298,7 +308,7 @@ lemma fdPolygon_zero_ne_interior (p : ℂ) (hp_im : p.im < HHeight) : fdPolygon simp only [Complex.add_im, Complex.mul_im, Complex.ofReal_re, Complex.I_re, Complex.I_im, Complex.ofReal_im, mul_one, zero_mul, Complex.div_ofNat_im, Complex.one_im, zero_div, zero_add, add_zero] - simp_all + simp_all only [one_div, lt_self_iff_false] /-- fdPolygon 5 ≠ p for interior points. -/ lemma fdPolygon_five_ne_interior (p : ℂ) (hp_im : p.im < HHeight) : fdPolygon 5 ≠ p := by @@ -314,7 +324,7 @@ lemma lifted_angle_at_zero (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_re : |p.re| < 1 fdPolygonRadialCircleAngle p 0 := by have htL := tL_mem_Ioo p hp_norm hp_re hp_im_pos hp_im simp only [fdPolygonRadialCircleAngleLifted] - rw [ite_eq_left (by linarith [htL.1] : (0 : ℝ) < tL p)] + rw [ite_eq_left (by linarith only [htL, htL.1] : (0 : ℝ) < tL p)] rw [← fdPolygonRadialCircle_angle_eq_arg p 0 (fdPolygon_zero_ne_interior p hp_im)] /-- At t=5, the lifted angle is raw angle minus 2π (5 > tL). -/ @@ -325,7 +335,7 @@ lemma lifted_angle_at_five (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_re : |p.re| < 1 fdPolygonRadialCircleAngle p 5 - 2 * Real.pi := by have htL := tL_mem_Ioo p hp_norm hp_re hp_im_pos hp_im simp only [fdPolygonRadialCircleAngleLifted] - rw [ite_eq_right (by linarith [htL.2] : ¬(5 : ℝ) < tL p)] + rw [ite_eq_right (by linarith only [htL, htL.2] : ¬(5 : ℝ) < tL p)] rw [← fdPolygonRadialCircle_angle_eq_arg p 5 (fdPolygon_five_ne_interior p hp_im)] /-- fdPolygon is periodic with period 5. -/ @@ -381,15 +391,15 @@ noncomputable def refP₀ : ℂ := Complex.I * (refY₀ : ℂ) lemma ref_Y₀_pos : 0 < refY₀ := by unfold refY₀ HHeight - linarith [Real.sqrt_pos_of_pos (by norm_num : (0 : ℝ) < 3)] + linarith only [Real.sqrt_pos_of_pos (by norm_num : (0 : ℝ) < 3)] lemma ref_Y₀_gt_one : 1 < refY₀ := by unfold refY₀ HHeight - linarith [Real.sqrt_pos_of_pos (by norm_num : (0 : ℝ) < 3)] + linarith only [Real.sqrt_pos_of_pos (by norm_num : (0 : ℝ) < 3)] lemma ref_Y₀_lt_H : refY₀ < HHeight := by unfold refY₀ HHeight - linarith [Real.sqrt_pos_of_pos (by norm_num : (0 : ℝ) < 3)] + linarith only [Real.sqrt_pos_of_pos (by norm_num : (0 : ℝ) < 3)] lemma ref_p₀_norm : ‖refP₀‖ > 1 := by unfold refP₀ @@ -399,19 +409,21 @@ lemma ref_p₀_norm : ‖refP₀‖ > 1 := by lemma ref_p₀_re : |refP₀.re| < 1 / 2 := by unfold refP₀ - simp_all + simp_all only [mul_re, I_re, ofReal_re, zero_mul, I_im, ofReal_im, mul_zero, sub_self, + abs_zero, one_div, + inv_pos, Nat.ofNat_pos] lemma ref_p₀_im_pos : 0 < refP₀.im := by unfold refP₀ simp only [Complex.mul_im, Complex.I_re, Complex.I_im, Complex.ofReal_re, Complex.ofReal_im, zero_mul, one_mul] - linarith [ref_Y₀_pos] + linarith only [ref_Y₀_pos] lemma ref_p₀_im : refP₀.im < HHeight := by unfold refP₀ simp only [Complex.mul_im, Complex.I_re, Complex.I_im, Complex.ofReal_re, Complex.ofReal_im, zero_mul, one_mul] - linarith [ref_Y₀_lt_H] + linarith only [ref_Y₀_lt_H] /-- Center-translation homotopy invariance of winding number. -/ lemma winding_fdPolygon_center_invariant (p₁ p₂ : ℂ) diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/BoundaryHomotopyDerivBounds.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/BoundaryHomotopyDerivBounds.lean index 8c280c27ad..1cbd41b48b 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/BoundaryHomotopyDerivBounds.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/BoundaryHomotopyDerivBounds.lean @@ -31,13 +31,13 @@ private lemma norm_deriv_arc_chord_le (α c : ℝ) (a b : ℂ) (hab : ‖b - a ‖deriv (fun t' : ℝ => (1 - s) • Complex.exp (((α : ℝ) + (t' - c) * (Real.pi / 6)) * I) + s • chordSegment a b (t' - c)) t‖ ≤ 5 := by - have h1s : |1 - s| ≤ 1 := by rw [abs_le]; constructor <;> linarith [hs.1, hs.2] - have hs' : |s| ≤ 1 := by rw [abs_le]; constructor <;> linarith [hs.1, hs.2] - have hpi6 : Real.pi / 6 ≤ 1 := by have := Real.pi_le_four; linarith + have h1s : |1 - s| ≤ 1 := by rw [abs_le]; constructor <;> linarith only [hs, hs.1, hs.2] + have hs' : |s| ≤ 1 := by rw [abs_le]; constructor <;> linarith only [hs, hs.1, hs.2] + have hpi6 : Real.pi / 6 ≤ 1 := by have := Real.pi_le_four; linarith only [this] have h_arc : HasDerivAt (fun t' : ℝ => Complex.exp (((α : ℝ) + (t' - c) * (Real.pi / 6)) * I)) (((Real.pi : ℝ) / 6) * I * Complex.exp (((α : ℝ) + (t - c) * (Real.pi / 6)) * I)) t := by have := hasDerivAt_arc_exp α (Real.pi / 6) c t - simp_all + simp_all only [mem_Icc, ofReal_div, ofReal_ofNat] have h_chord : HasDerivAt (fun t' : ℝ => chordSegment a b (t' - c)) (b - a) t := hasDerivAt_chordSegment_shift a b c t have h_combined : HasDerivAt (fun t' : ℝ => @@ -64,10 +64,11 @@ private lemma norm_deriv_arc_chord_le (α c : ℝ) (a b : ℂ) (hab : ‖b - a _ = |1 - s| * (Real.pi / 6) + |s| * ‖b - a‖ := by rw [norm_smul, norm_smul, Real.norm_eq_abs, Real.norm_eq_abs, harc_norm] _ ≤ 1 * 1 + 1 * 2 := by - have hb1 : |1 - s| * (Real.pi / 6) ≤ 1 * 1 := by nlinarith [abs_nonneg (1 - s)] + have hb1 : |1 - s| * (Real.pi / 6) ≤ 1 * 1 := by + nlinarith only [h1s, hpi6, abs_nonneg (1 - s)] have hb2 : |s| * ‖b - a‖ ≤ 1 * 2 := mul_le_mul hs' hab (norm_nonneg _) (by norm_num) - linarith + linarith only [hb1, hb2] _ ≤ 5 := by norm_num /-- Norm bound for segment 2 derivative. -/ @@ -166,7 +167,7 @@ lemma norm_deriv_H_seg1_le (t : ℝ) (_s : ℝ) : ((HHeight : ℂ) - Real.sqrt 3 / 2) t := by simpa using Complex.ofRealCLM.hasDerivAt.mul_const ((HHeight : ℂ) - Real.sqrt 3 / 2) have h4 := (((hasDerivAt_const t (HHeight : ℂ)).sub h2).mul_const I) - simp_all + simp_all only [Pi.sub_apply, zero_sub, neg_sub, one_div, hasDerivAt_const_add_iff] rw [h_deriv.deriv, HHeight_sub_sqrt3_div2] simp only [neg_one_mul, norm_neg, Complex.norm_I]; norm_num @@ -185,7 +186,7 @@ lemma norm_deriv_H_seg4_le (t : ℝ) (_s : ℝ) : simpa using (Complex.ofRealCLM.hasDerivAt.sub_const 3).mul_const ((HHeight : ℂ) - Real.sqrt 3 / 2) have h5 := (((hasDerivAt_const t (Real.sqrt 3 / 2 : ℂ)).add h3).mul_const I) - simp_all + simp_all only [Pi.add_apply, zero_add, hasDerivAt_const_add_iff] rw [h_deriv.deriv, HHeight_sub_sqrt3_div2] simp only [one_mul, Complex.norm_I]; norm_num diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/BoundaryHomotopySmooth.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/BoundaryHomotopySmooth.lean index 0520fdb956..6ea370720d 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/BoundaryHomotopySmooth.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/BoundaryHomotopySmooth.lean @@ -44,9 +44,9 @@ private lemma arc_chord_re_neg (s : ℝ) (hs : s ∈ Set.Icc (0 : ℝ) 1) : by_cases hs0 : s = 0 · subst hs0 simp only [sub_zero, one_mul, zero_mul, add_zero] - nlinarith [hpi, hsqrt3_pos] + nlinarith only [hpi, hsqrt3_pos] · have hs_pos : s > 0 := lt_of_le_of_ne hs.1 (Ne.symm hs0) - nlinarith [hs.1, hs.2, hs_pos, mul_pos hpi hsqrt3_pos] + nlinarith only [hs, hpi, hsqrt3_pos, hs_pos, hs.1, hs.2, mul_pos hpi hsqrt3_pos] /-- The homotopy is not differentiable at `t = 1` (left/right derivatives differ). -/ private lemma not_diffAt_at_one (s : ℝ) (hs : s ∈ Set.Icc (0 : ℝ) 1) : @@ -191,7 +191,7 @@ private lemma not_diffAt_at_three (s : ℝ) (hs : s ∈ Set.Icc (0 : ℝ) 1) : rw [show ((↑(Real.pi / 2) : ℂ) + ((↑(3 : ℝ) : ℂ) - ↑(2 : ℝ)) * (↑(Real.pi / 6) : ℂ)) = ↑(2 * Real.pi / 3) from by push_cast; ring] exact exp_two_pi_div_three_eq_rho - simp_all + simp_all only [mem_Icc, ofReal_div, ofReal_ofNat] have h_chord : HasDerivAt (fun t' : ℝ => chordSegment iPoint rho (t' - 2)) (rho - iPoint) (3 : ℝ) := hasDerivAt_chordSegment_shift iPoint rho 2 3 @@ -291,10 +291,16 @@ private lemma not_diffAt_at_three (s : ℝ) (hs : s ∈ Set.Icc (0 : ℝ) 1) : (-Real.pi * Real.sqrt 3 / 12 - Real.pi / 12 * I) + (s:ℂ) * (-1/2 + (Real.sqrt 3 / 2 - 1) * I)) = (1 - s) * (-Real.pi * Real.sqrt 3 / 12) + s * (-1/2) := by - simp_all + simp_all only [mem_Icc, neg_mul, subset_compl_singleton_iff, mem_Iio, lt_self_iff_false, + not_false_eq_true, + mem_Ioi, add_re, mul_re, sub_re, one_re, ofReal_re, div_ofNat_re, neg_re, ofReal_im, + mul_zero, sub_zero, I_re, + div_ofNat_im, zero_div, I_im, mul_one, sub_self, sub_im, one_im, neg_im, mul_im, + zero_mul, add_zero, neg_zero, + zero_sub, mul_neg, add_im, zero_add] have h_re_eq := congr_arg Complex.re heq rw [h_lhs_re, h_rhs_re] at h_re_eq - linarith [h_re_eq, arc_chord_re_neg s hs] + linarith only [hs, h_re_eq, arc_chord_re_neg s hs] exact h_ne h_eq_left.symm /-- The homotopy is not differentiable at `t = 4` (left/right derivatives differ). -/ @@ -413,12 +419,17 @@ lemma interval_in_segment (p₁ p₂ : ℝ) (_hp : p₁ < p₂) · by_contra hlt have h3_in : (3 : ℝ) ∈ Set.Ioo p₁ p₂ := ⟨not_le.mp hlt, not_le.mp h3⟩ have := h_avoid 3 h3_in - simp_all + simp_all only [mem_Ioo, Finset.mem_insert, Finset.mem_singleton, not_or, and_imp, + not_le, ge_iff_le, and_self, + OfNat.ofNat_eq_ofNat, Nat.succ_ne_self, Nat.reduceEqDiff, or_false, or_true, + not_true_eq_false] · exact h4 · right by_contra hlt have h4_in : (4 : ℝ) ∈ Set.Ioo p₁ p₂ := ⟨not_le.mp hlt, not_le.mp h4⟩ have := h_avoid 4 h4_in - simp_all + simp_all only [mem_Ioo, Finset.mem_insert, Finset.mem_singleton, not_or, and_imp, + not_le, ge_iff_le, and_self, + OfNat.ofNat_eq_ofNat, Nat.reduceEqDiff, Nat.succ_ne_self, or_true, not_true_eq_false] end RectHomotopyProof diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/Geometry.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/Geometry.lean index 1e75deabda..b3de3a4c95 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/Geometry.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/Geometry.lean @@ -49,7 +49,7 @@ lemma rho_norm : ‖rho‖ = 1 := by mul_im, add_zero] ring_nf have h : (Real.sqrt 3) ^ 2 = 3 := - Real.sq_sqrt (by linarith : (0 : ℝ) ≤ 3) + Real.sq_sqrt (by linarith only [] : (0 : ℝ) ≤ 3) rw [h]; norm_num lemma rho'_norm : ‖rho'‖ = 1 := by @@ -60,7 +60,7 @@ lemma rho'_norm : ‖rho'‖ = 1 := by mul_im, add_zero] ring_nf have h : (Real.sqrt 3) ^ 2 = 3 := - Real.sq_sqrt (by linarith : (0 : ℝ) ≤ 3) + Real.sq_sqrt (by linarith only [] : (0 : ℝ) ≤ 3) rw [h]; norm_num lemma i_point_norm : ‖iPoint‖ = 1 := by simp only [iPoint, Complex.norm_I] @@ -75,7 +75,7 @@ def chordSegment (z₁ z₂ : ℂ) : ℝ → ℂ := lemma chordSegment_in_convex {z₁ z₂ : ℂ} {S : Set ℂ} (hS : Convex ℝ S) (hz₁ : z₁ ∈ S) (hz₂ : z₂ ∈ S) (t : ℝ) (ht : t ∈ Icc 0 1) : chordSegment z₁ z₂ t ∈ S := - hS hz₁ hz₂ (by linarith [ht.2]) ht.1 (by ring) + hS hz₁ hz₂ (by linarith only [ht, ht.2]) ht.1 (by ring) lemma convex_closedBall_zero_one : Convex ℝ (closedBall (0 : ℂ) 1) := convex_closedBall 0 1 @@ -161,17 +161,17 @@ lemma exists_ball_in_polygon_interior (p : ℂ) (hp : ‖p‖ > 1) (hp_im : 0 < ∃ ε > 0, ∀ z, ‖z - p‖ < ε → z.im > 0 ∧ ‖z‖ > 1 := by use min ((‖p‖ - 1)/2) (p.im/2) constructor - · exact lt_min (by linarith) (by linarith) + · exact lt_min (by linarith only [hp]) (by linarith only [hp_im]) intro z hz have hz₁ : ‖z - p‖ < (‖p‖ - 1)/2 := lt_of_lt_of_le hz (min_le_left _ _) have hz₂ : ‖z - p‖ < p.im/2 := lt_of_lt_of_le hz (min_le_right _ _) have h_im_bound : |z.im - p.im| ≤ ‖z - p‖ := Complex.abs_im_le_norm (z - p) have h_norm_bound : |‖z‖ - ‖p‖| ≤ ‖z - p‖ := abs_norm_sub_norm_le z p constructor - · linarith [(abs_lt.mp (lt_of_le_of_lt h_im_bound hz₂)).1, - (abs_lt.mp (lt_of_le_of_lt h_im_bound hz₂)).2] - · linarith [(abs_lt.mp (lt_of_le_of_lt h_norm_bound hz₁)).1, - (abs_lt.mp (lt_of_le_of_lt h_norm_bound hz₁)).2] + · linarith only [hp_im, hz₂, h_im_bound, (abs_lt.mp (lt_of_le_of_lt h_im_bound hz₂)).1, + (abs_lt.mp (lt_of_le_of_lt h_im_bound hz₂)).2] + · linarith only [hp, hz₁, h_norm_bound, (abs_lt.mp (lt_of_le_of_lt h_norm_bound hz₁)).1, + (abs_lt.mp (lt_of_le_of_lt h_norm_bound hz₁)).2] lemma circleIntegral_winding (p : ℂ) (ε : ℝ) (hε : 0 < ε) : (∮ z in C(p, ε), (z - p)⁻¹) = @@ -297,7 +297,7 @@ lemma norm_ge_abs_im (z : ℂ) : ‖z‖ ≥ |z.im| := lemma H_height_gt_one : HHeight > 1 := by unfold HHeight - linarith [Real.sqrt_pos.mpr (by norm_num : (3 : ℝ) > 0)] + linarith only [Real.sqrt_pos.mpr (by norm_num : (3 : ℝ) > 0)] end RectHomotopyProof diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/HomotopyDef.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/HomotopyDef.lean index e957f40a87..e3b8bcdc2b 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/HomotopyDef.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/HomotopyDef.lean @@ -84,7 +84,7 @@ lemma hasDerivAt_arc_exp (α β c t : ℝ) : Complex.ofRealCLM.hasDerivAt.sub_const (c : ℂ) have h_inner : HasDerivAt (fun t' : ℝ => (α : ℂ) + ((t' : ℂ) - c) * (β : ℂ)) (β : ℂ) t := by have h_mul := h_shift.mul_const (β : ℂ) - simp_all + simp_all only [hasDerivAt_sub_const_iff, one_mul, hasDerivAt_const_add_iff] have h := (Complex.hasDerivAt_exp (((α : ℂ) + ((t : ℂ) - c) * (β : ℂ)) * I)).comp t (h_inner.mul_const I) simp only [mul_comm (Complex.exp _)] at h @@ -117,7 +117,7 @@ lemma exp_pi_div_three_eq_rho' : lemma exp_pi_div_two_eq_I : Complex.exp (↑(Real.pi / 2) * I) = I := by - simp_all + simp_all only [ofReal_div, ofReal_ofNat, exp_pi_div_two_mul_I] lemma exp_two_pi_div_three_eq_rho : Complex.exp (↑(2 * Real.pi / 3) * I) = rho := by @@ -214,12 +214,12 @@ lemma fdBoundaryToPolygonHomotopy_continuous : lemma fdBoundaryToPolygonHomotopy_at_zero (t : ℝ) (_ht : t ∈ Icc 0 5) : fdBoundaryToPolygonHomotopy (t, 0) = fdBoundary t := by simp only [fdBoundaryToPolygonHomotopy, fdBoundary] - simp_all + simp_all only [mem_Icc, one_div, sub_zero, one_smul, zero_smul, add_zero] lemma fdBoundaryToPolygonHomotopy_at_one (t : ℝ) (_ht : t ∈ Icc 0 5) : fdBoundaryToPolygonHomotopy (t, 1) = fdPolygon t := by simp only [fdBoundaryToPolygonHomotopy, fdPolygon] - simp_all + simp_all only [mem_Icc, one_div, sub_self, zero_smul, one_smul, zero_add] lemma fdBoundaryToPolygonHomotopy_avoids (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_re : |p.re| < 1 / 2) (hp_im : p.im < HHeight) (t : ℝ) (_ht : t ∈ Icc 0 5) (s : ℝ) @@ -238,8 +238,8 @@ lemma fdBoundaryToPolygonHomotopy_avoids (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_r Complex.ofReal_im, Complex.div_ofNat_im, Complex.mul_im] norm_num - simp_all - · have ht2 : t - 1 ∈ Icc 0 1 := by constructor <;> linarith [h1, h2] + simp_all only [gt_iff_lt, one_div, mem_Icc, abs_inv, Nat.abs_ofNat, lt_self_iff_false] + · have ht2 : t - 1 ∈ Icc 0 1 := by constructor <;> linarith only [h1, h2] have h_arc_in := segment2_arc_in_closed_unit_ball t have h_chord_in := chord1_in_closed_unit_ball (t - 1) ht2 have h_in_ball : (1 - s) • Complex.exp @@ -250,7 +250,7 @@ lemma fdBoundaryToPolygonHomotopy_avoids (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_r h_arc_in h_chord_in s hs have hp_out := outside_closed_unit_ball p hp_norm exact fun h => hp_out (h ▸ h_in_ball) - · have ht3 : t - 2 ∈ Icc 0 1 := by constructor <;> linarith [h2, h3] + · have ht3 : t - 2 ∈ Icc 0 1 := by constructor <;> linarith only [h2, h3] have h_arc_in := segment3_arc_in_closed_unit_ball t have h_chord_in := chord2_in_closed_unit_ball (t - 2) ht3 have h_in_ball : (1 - s) • Complex.exp @@ -274,7 +274,7 @@ lemma fdBoundaryToPolygonHomotopy_avoids (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_r norm_num rw [heq] at hre have : |p.re| = 1/2 := by rw [hre]; norm_num - linarith + linarith only [hp_re, this] · intro heq have him : (↑t - 9/2 + ↑HHeight * I : ℂ).im = HHeight := by @@ -282,8 +282,9 @@ lemma fdBoundaryToPolygonHomotopy_avoids (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_r Complex.ofReal_im, Complex.div_ofNat_im, Complex.mul_im, Complex.ofReal_re, Complex.I_re, mul_zero, Complex.I_im, mul_one] - simp_all - rw [heq] at him; linarith + simp_all only [gt_iff_lt, one_div, mem_Icc, not_le, im_ofNat, zero_div, sub_self, add_zero, + zero_add] + rw [heq] at him; linarith only [hp_im, him] lemma fdBoundaryToPolygonHomotopy_closed (s : ℝ) (_hs : s ∈ Icc 0 1) : fdBoundaryToPolygonHomotopy (0, s) = @@ -302,7 +303,9 @@ noncomputable def circleAround (p : ℂ) (ε : ℝ) : lemma circleAround_closed (p : ℂ) (ε : ℝ) : circleAround p ε 0 = circleAround p ε 5 := by simp only [circleAround, Complex.ofReal_zero, mul_zero, zero_div, Complex.ofReal_ofNat] - simp_all + simp_all only [exp_zero, mul_one, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, + mul_div_cancel_right₀, + exp_two_pi_mul_I] lemma circleAround_continuous (p : ℂ) (ε : ℝ) : Continuous (circleAround p ε) := by unfold circleAround; continuity diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheoremBound.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheoremBound.lean index d257e77414..b29e740e56 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheoremBound.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheoremBound.lean @@ -45,7 +45,7 @@ private lemma not_diffAt_at_two (s : ℝ) (hs0 : s ≠ 0) : rw [show ((↑(Real.pi / 3) : ℂ) + ((↑(2 : ℝ) : ℂ) - ↑(1 : ℝ)) * (↑(Real.pi / 6) : ℂ)) = ↑(Real.pi / 2) from by push_cast; ring] exact exp_pi_div_two_eq_I - simp_all + simp_all only [ne_eq, ofReal_div, ofReal_ofNat, ofReal_one] have h_chord_left : HasDerivAt (fun t' : ℝ => chordSegment rho' iPoint (t' - 1)) (iPoint - rho') (2 : ℝ) := hasDerivAt_chordSegment_shift rho' iPoint 1 2 @@ -78,7 +78,9 @@ private lemma not_diffAt_at_two (s : ℝ) (hs0 : s ≠ 0) : Complex.exp (((Real.pi : ℝ) / 2 + (t' - 2) * ((Real.pi : ℝ) / 6)) * I)) (((Real.pi : ℝ) / 6) * I * I) (2 : ℝ) := by have h_raw := hasDerivAt_arc_exp (Real.pi / 2) (Real.pi / 6) 2 2 - simp_all + simp_all only [ne_eq, real_smul, ofReal_sub, ofReal_one, ofReal_div, ofReal_ofNat, sub_self, + zero_mul, + add_zero, exp_pi_div_two_mul_I] have h_chord_right : HasDerivAt (fun t' : ℝ => chordSegment iPoint rho (t' - 2)) (rho - iPoint) (2 : ℝ) := hasDerivAt_chordSegment_shift iPoint rho 2 2 @@ -104,7 +106,7 @@ private lemma not_diffAt_at_two (s : ℝ) (hs0 : s ≠ 0) : simp [chordSegment] have h_at_t'r : fdBoundaryToPolygonHomotopy (t', s) = g_right t' := by simp only [fdBoundaryToPolygonHomotopy, - not_le.mpr (show (1 : ℝ) < t' by linarith [ht'.1]), not_le.mpr ht'.1, ite_false, + not_le.mpr (show (1 : ℝ) < t' by linarith only [ht', ht'.1]), not_le.mpr ht'.1, ite_false, le_of_lt ht'.2, ite_true] congr 1; congr 1; congr 1; ring rw [h_at_t'r, h_at_2r] @@ -112,7 +114,9 @@ private lemma not_diffAt_at_two (s : ℝ) (hs0 : s ≠ 0) : have h_eq_right := tendsto_nhds_unique (h_slope_inner.mono_left (nhdsGT_le_nhdsNE 2)) h_right_val rw [h_eq_left] at h_eq_right have h_pts_eq : iPoint - rho' = rho - iPoint := by - simp_all + simp_all only [ne_eq, real_smul, ofReal_sub, ofReal_one, add_right_inj, mul_eq_mul_left_iff, + ofReal_eq_zero, + or_false] have h_im_left : Complex.im (iPoint - rho') = 1 - Real.sqrt 3 / 2 := by simp only [iPoint, rho'] simp [Complex.add_im, Complex.sub_im, Complex.mul_im, Complex.ofReal_im, Complex.ofReal_re, @@ -124,7 +128,7 @@ private lemma not_diffAt_at_two (s : ℝ) (hs0 : s ≠ 0) : Complex.one_im] have h_im_eq := congr_arg Complex.im h_pts_eq rw [h_im_left, h_im_right] at h_im_eq - nlinarith [Real.sq_sqrt (by norm_num : (3 : ℝ) ≥ 0), Real.sqrt_nonneg 3] + nlinarith only [h_im_eq, Real.sq_sqrt (by norm_num : (3 : ℝ) ≥ 0), Real.sqrt_nonneg 3] /-- The derivative-norm bound at the corner `t = 2`, `s = 0` (the homotopy is smooth there). -/ private lemma deriv_bound_at_two_zero : @@ -150,11 +154,11 @@ private lemma deriv_bound_at_two_zero : convert h_raw using 2 <;> push_cast <;> ring rw [h_deriv.deriv] have h_exp_norm : ‖Complex.exp ((Real.pi / 2) * I)‖ = 1 := by - simp_all + simp_all only [exp_pi_div_two_mul_I, norm_I] rw [norm_mul, norm_mul, h_exp_norm, Complex.norm_I, mul_one, mul_one, show (Real.pi / 6 : ℂ) = ((Real.pi / 6 : ℝ) : ℂ) from by push_cast; ring, Complex.norm_real, Real.norm_eq_abs, abs_of_pos (by positivity : (0 : ℝ) < Real.pi / 6)] - have := Real.pi_le_four; linarith + have := Real.pi_le_four; linarith only [this] lemma fdBoundaryToPolygonHomotopy_deriv_bound : ∃ M : ℝ, ∀ t ∈ Icc 0 5, ∀ s ∈ Icc (0 : ℝ) 1, @@ -213,7 +217,8 @@ lemma fdBoundaryToPolygonHomotopy_deriv_bound : filter_upwards [eventually_gt_nhds ht4'.1, eventually_lt_nhds ht4'.2] with t' ht3' ht4'' simp only [fdBoundaryToPolygonHomotopy, - not_le.mpr (by linarith : 1 < t'), not_le.mpr (by linarith : 2 < t'), + not_le.mpr (by linarith only [ht3', ht4''] : 1 < t'), not_le.mpr (by + linarith only [ht3', ht4''] : 2 < t'), not_le.mpr ht3', le_of_lt ht4'', ite_false, ite_true] rw [heq.deriv_eq]; exact norm_deriv_H_seg4_le t s · by_cases h4' : t = 4 @@ -225,8 +230,9 @@ lemma fdBoundaryToPolygonHomotopy_deriv_bound : (fun t' : ℝ => ((↑t' : ℂ) - 9/2) + (HHeight : ℂ) * I) := by filter_upwards [eventually_gt_nhds ht5'] with t' ht4' simp only [fdBoundaryToPolygonHomotopy, - not_le.mpr (by linarith : 1 < t'), not_le.mpr (by linarith : 2 < t'), - not_le.mpr (by linarith : 3 < t'), not_le.mpr ht4', ite_false] + not_le.mpr (by linarith only [ht4'] : 1 < t'), not_le.mpr (by + linarith only [ht4'] : 2 < t'), + not_le.mpr (by linarith only [ht4'] : 3 < t'), not_le.mpr ht4', ite_false] rw [heq.deriv_eq]; exact norm_deriv_H_seg5_le t s · simp only [deriv_zero_of_not_differentiableAt hd, norm_zero]; norm_num diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheoremDerivCont.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheoremDerivCont.lean index 113d4a20d8..dcb5585313 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheoremDerivCont.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheoremDerivCont.lean @@ -44,7 +44,8 @@ private lemma seg2_deriv_eq (s t : ℝ) (ht1 : 1 < t) (ht2 : t < 2) : have h_shift : HasDerivAt (fun t' : ℝ => (t' : ℂ) - 1) 1 t := Complex.ofRealCLM.hasDerivAt.sub_const 1 have h_mul := h_shift.mul_const ((Real.pi : ℂ) / 6) - simp_all + simp_all only [real_smul, ofReal_sub, ofReal_one, hasDerivAt_sub_const_iff, one_mul, + hasDerivAt_const_add_iff] have h_arc : HasDerivAt (fun t' : ℝ => Complex.exp ((Real.pi / 3 + (t' - 1) * (Real.pi / 6)) * I)) ((Real.pi / 6) * I * Complex.exp ((Real.pi / 3 + (t - 1) * (Real.pi / 6)) * I)) t := by @@ -90,7 +91,8 @@ private lemma seg3_deriv_eq (s t : ℝ) (ht2 : 2 < t) (ht3 : t < 3) : have h_shift : HasDerivAt (fun t' : ℝ => (t' : ℂ) - 2) 1 t := Complex.ofRealCLM.hasDerivAt.sub_const 2 have h_mul := h_shift.mul_const ((Real.pi : ℂ) / 6) - simp_all + simp_all only [real_smul, ofReal_sub, ofReal_one, hasDerivAt_sub_const_iff, one_mul, + hasDerivAt_const_add_iff] have h_arc : HasDerivAt (fun t' : ℝ => Complex.exp ((Real.pi / 2 + (t' - 2) * (Real.pi / 6)) * I)) ((Real.pi / 6) * I * Complex.exp ((Real.pi / 2 + (t - 2) * (Real.pi / 6)) * I)) t := by diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/PolygonSlope.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/PolygonSlope.lean index 022e23e841..07df219bd6 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/PolygonSlope.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/PolygonSlope.lean @@ -124,7 +124,11 @@ lemma fdPolygon_deriv_ne_at_t1 : (-I : ℂ) ≠ (iPoint - rho') := by simp only [rho', iPoint] intro heq have h_lhs : (-I : ℂ).re = 0 := by simp only [Complex.neg_re, Complex.I_re, neg_zero] - simp_all + simp_all only [one_div, sub_re, I_re, add_re, inv_re, re_ofNat, normSq_ofNat, + div_self_mul_self', mul_re, + div_ofNat_re, ofReal_re, mul_zero, div_ofNat_im, ofReal_im, zero_div, I_im, mul_one, + sub_self, add_zero, zero_sub, + neg_eq_zero, inv_eq_zero, OfNat.ofNat_ne_zero] lemma fdPolygon_deriv_ne_at_t2 : (iPoint - rho' : ℂ) ≠ (rho - iPoint) := by simp only [rho', iPoint, rho] @@ -132,8 +136,8 @@ lemma fdPolygon_deriv_ne_at_t2 : (iPoint - rho' : ℂ) ≠ (rho - iPoint) := by have h_sqrt3_lt : Real.sqrt 3 / 2 < 1 := by have h2 : Real.sqrt 3 < 2 := by have : (Real.sqrt 3)^2 = 3 := Real.sq_sqrt (by norm_num : (0 : ℝ) ≤ 3) - nlinarith [Real.sqrt_nonneg 3] - linarith + nlinarith only [this, Real.sqrt_nonneg 3] + linarith only [h2] have h_sqrt3_re : (↑(Real.sqrt 3) / 2 : ℂ).re = Real.sqrt 3 / 2 := by simp only [Complex.div_ofNat_re, Complex.ofReal_re] have him : (I - (1/2 + ↑(Real.sqrt 3) / 2 * I)).im = @@ -142,7 +146,7 @@ lemma fdPolygon_deriv_ne_at_t2 : (iPoint - rho' : ℂ) ≠ (rho - iPoint) := by Complex.div_ofNat_im, Complex.mul_im, Complex.I_re, mul_zero, Complex.ofReal_im, mul_one, add_zero, Complex.neg_im, zero_div, h_sqrt3_re] at him - linarith + linarith only [h_sqrt3_lt, him] lemma fdPolygon_deriv_ne_at_t3 : (rho - iPoint : ℂ) ≠ I := by simp only [rho, iPoint] @@ -155,12 +159,12 @@ lemma fdPolygon_deriv_ne_at_t3 : (rho - iPoint : ℂ) ≠ I := by norm_num rw [heq] at h_lhs have h_rhs : (I : ℂ).re = 0 := Complex.I_re - rw [h_rhs] at h_lhs; linarith + rw [h_rhs] at h_lhs; linarith only [h_lhs] lemma fdPolygon_deriv_ne_at_t4 : (I : ℂ) ≠ (1 : ℂ) := by intro heq have h_lhs : (I : ℂ).im = 1 := Complex.I_im - simp_all + simp_all only [one_im, zero_ne_one] lemma slope_fdPolygon_at_t1_left (s : ℝ) (hs : s < 1) : slope fdPolygon 1 s = diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/RadialHomotopy.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/RadialHomotopy.lean index 8d44df5774..ad390ace43 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/RadialHomotopy.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/RadialHomotopy.lean @@ -55,16 +55,19 @@ lemma polygonToCircleRadial_avoids (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_re : |p have hnorm_pos : ‖fdPolygon t - p‖ > 0 := norm_pos_iff.mpr hdir_ne have hcoeff : (1 - s) * ‖fdPolygon t - p‖ + s > 0 := by have h1 : (1 - s) * ‖fdPolygon t - p‖ ≥ 0 := - mul_nonneg (by linarith [hs.2]) (le_of_lt hnorm_pos) + mul_nonneg (by linarith only [hs, hs.2]) (le_of_lt hnorm_pos) rcases eq_or_lt_of_le hs.1 with hs0 | hs0 · simp only [← hs0, sub_zero, one_mul, add_zero]; exact hnorm_pos - · linarith + · linarith only [h1, hs0] intro heq rw [add_eq_left] at heq rw [RCLike.real_smul_eq_coe_mul] at heq rcases mul_eq_zero.mp heq with hcoeff_zero | hdir_zero · exact ne_of_gt hcoeff (Complex.ofReal_eq_zero.mp hcoeff_zero) - · simp_all + · simp_all only [gt_iff_lt, one_div, mem_Icc, ne_eq, norm_pos_iff, not_false_eq_true, + coe_algebraMap, + ofReal_add, ofReal_mul, ofReal_sub, ofReal_one, mul_zero, div_eq_zero_iff, + ofReal_eq_zero, norm_eq_zero, or_self] /-- The radial circle around p: normalized projection of fdPolygon onto unit circle around p. This is polygonToCircleRadial at s=1. -/ @@ -79,7 +82,9 @@ lemma fdPolygonRadialCircle_dist (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_re : |p.r fdPolygon_sub_p_norm_pos p hp_norm hp_re hp_im t ht simp only [fdPolygonRadialCircle, polygonToCircleRadial, sub_self, zero_mul, zero_add, add_sub_cancel_left] - simp_all + simp_all only [gt_iff_lt, one_div, mem_Icc, norm_pos_iff, ne_eq, one_smul, Complex.norm_div, + norm_real, + norm_norm, norm_eq_zero, not_false_eq_true, div_self] /-- fdPolygonRadialCircle avoids p. -/ lemma fdPolygonRadialCircle_avoids (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_re : |p.re| < 1 / 2) @@ -95,37 +100,37 @@ lemma fdPolygon_ne_p_everywhere (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_re : |p.re by_cases ht1 : t ≤ 1 · simp only [fdPolygon, ht1, ↓reduceIte] at heq have hre : p.re = 1/2 := by rw [← heq]; simp [Complex.add_re, Complex.mul_re] - linarith [abs_lt.mp hp_re] + linarith only [hp_re, hre, abs_lt.mp hp_re] · push Not at ht1 by_cases ht2 : t ≤ 2 · simp only [fdPolygon, not_le.mpr ht1, ht2, ↓reduceIte] at heq - have ht_range : t - 1 ∈ Icc 0 1 := ⟨by linarith, by linarith⟩ + have ht_range : t - 1 ∈ Icc 0 1 := ⟨by linarith only [ht1], by linarith only [ht2]⟩ have hin_ball : chordSegment rho' iPoint (t - 1) ∈ closedBall (0 : ℂ) 1 := chord_in_closed_unit_ball rho' iPoint rho'_norm i_point_norm (t - 1) ht_range rw [mem_closedBall, dist_zero_right] at hin_ball rw [heq] at hin_ball - linarith + linarith only [hp_norm, hin_ball] · push Not at ht2 by_cases ht3 : t ≤ 3 · simp only [fdPolygon, not_le.mpr ht1, not_le.mpr ht2, ht3, ↓reduceIte] at heq - have ht_range : t - 2 ∈ Icc 0 1 := ⟨by linarith, by linarith⟩ + have ht_range : t - 2 ∈ Icc 0 1 := ⟨by linarith only [ht2], by linarith only [ht3]⟩ have hin_ball : chordSegment iPoint rho (t - 2) ∈ closedBall (0 : ℂ) 1 := chord_in_closed_unit_ball iPoint rho i_point_norm rho_norm (t - 2) ht_range rw [mem_closedBall, dist_zero_right] at hin_ball rw [heq] at hin_ball - linarith + linarith only [hp_norm, hin_ball] · push Not at ht3 by_cases ht4 : t ≤ 4 · simp only [fdPolygon, not_le.mpr ht1, not_le.mpr ht2, not_le.mpr ht3, ht4, ↓reduceIte] at heq have hre : p.re = -1/2 := by rw [← heq]; simp [Complex.add_re, Complex.mul_re] - have hp_re' : p.re > -1/2 := by linarith [abs_lt.mp hp_re] - linarith + have hp_re' : p.re > -1/2 := by linarith only [hp_re, hre, abs_lt.mp hp_re] + linarith only [hre, hp_re'] · push Not at ht4 simp only [fdPolygon, not_le.mpr ht1, not_le.mpr ht2, not_le.mpr ht3, not_le.mpr ht4, ↓reduceIte] at heq have him : p.im = HHeight := by rw [← heq]; simp [Complex.add_im, Complex.mul_im] - linarith + linarith only [hp_im, him] /-- Radial homotopy is continuous. -/ lemma polygonToCircleRadial_continuous (p : ℂ) (hp_norm : ‖p‖ > 1) (hp_re : |p.re| < 1 / 2) @@ -195,7 +200,11 @@ lemma polygonToCircleRadial_differentiable_off_partition (p : ℂ) (hp_norm : have h_norm_C_diff : DifferentiableAt ℝ (fun t' => (‖fdPolygon t' - p‖ : ℂ)) t := Complex.ofRealCLM.differentiableAt.comp t h_norm_diff have h_norm_C_ne : (‖fdPolygon t - p‖ : ℂ) ≠ 0 := by - simp_all + simp_all only [gt_iff_lt, one_div, mem_Ioo, Finset.mem_insert, Finset.mem_singleton, not_or, + mem_Icc, + differentiableAt_const, DifferentiableAt.fun_sub, ne_eq, DifferentiableAt.fun_mul, + DifferentiableAt.fun_add, + ofReal_eq_zero, norm_eq_zero, not_false_eq_true] have h_unit_diff : DifferentiableAt ℝ (fun t' => (fdPolygon t' - p) / (‖fdPolygon t' - p‖ : ℂ)) t := h_diff_sub.div h_norm_C_diff h_norm_C_ne @@ -339,7 +348,7 @@ lemma norm_normalize_sub_le {w₁ w₂ : ℂ} {δ : ℝ} (hδ : 0 < δ) have hterm2 : ‖w₂ * ((‖w₂‖ : ℂ) - (‖w₁‖ : ℂ)) / ((‖w₁‖ : ℂ) * (‖w₂‖ : ℂ))‖ ≤ ‖w₁ - w₂‖ / δ := by have h_eq : ‖w₂ * ((‖w₂‖ : ℂ) - (‖w₁‖ : ℂ)) / ((‖w₁‖ : ℂ) * (‖w₂‖ : ℂ))‖ = ‖w₂‖ * ‖((‖w₂‖ : ℂ) - (‖w₁‖ : ℂ))‖ / (‖w₁‖ * ‖w₂‖) := by - simp_all + simp_all only [norm_pos_iff, ne_eq, Complex.norm_div, norm_real, norm_norm, Complex.norm_mul] rw [h_eq, show ‖w₂‖ * ‖((‖w₂‖ : ℂ) - (‖w₁‖ : ℂ))‖ = ‖((‖w₂‖ : ℂ) - (‖w₁‖ : ℂ))‖ * ‖w₂‖ from mul_comm _ _, @@ -408,7 +417,7 @@ lemma fdPolygon_hasDerivWithinAt_Ici (x : ℝ) : · have : t = 1 := le_antisymm h'₁ (h1.trans ht_ge) subst this; simp [chordSegment, rho', HHeight, iPoint] · rfl - all_goals linarith + all_goals linarith only [ht_lt, h'₂] exact (fdPolygon_seg2_differentiable.differentiableAt.hasDerivAt.hasDerivWithinAt ).congr_of_eventuallyEq heq (by simp only [fdPolygon, fdPolygonSeg2] @@ -416,59 +425,59 @@ lemma fdPolygon_hasDerivWithinAt_Ici (x : ℝ) : · have : x = 1 := le_antisymm h'₁ h1; subst this simp [chordSegment, rho', HHeight, iPoint] · rfl - all_goals linarith) + all_goals linarith only [h2, h'₂]) · push Not at h1 h2 have heq : fdPolygon =ᶠ[𝓝[Ici x] x] fdPolygonSeg3 := by filter_upwards [Ico_mem_nhdsGE h3] with t ht obtain ⟨ht_ge, ht_lt⟩ := ht simp only [fdPolygon, fdPolygonSeg3] split_ifs with h'₁ h'₂ h'₃ h'₄ - · linarith [h2.trans ht_ge] + · linarith only [h2, ht_ge, h'₁, h2.trans ht_ge] · have : t = 2 := le_antisymm h'₂ (h2.trans ht_ge) subst this; simp [chordSegment, rho, iPoint]; ring · rfl - all_goals linarith + all_goals linarith only [ht_lt, h'₃] exact (fdPolygon_seg3_differentiable.differentiableAt.hasDerivAt.hasDerivWithinAt ).congr_of_eventuallyEq heq (by simp only [fdPolygon, fdPolygonSeg3] split_ifs with h'₁ h'₂ h'₃ h'₄ - · linarith + · linarith only [h2, h'₁] · have : x = 2 := le_antisymm h'₂ h2; subst this simp [chordSegment, rho, iPoint]; ring · rfl - all_goals linarith) + all_goals linarith only [h3, h'₃]) · push Not at h1 h2 h3 have heq : fdPolygon =ᶠ[𝓝[Ici x] x] fdPolygonSeg4 := by filter_upwards [Ico_mem_nhdsGE h4] with t ht obtain ⟨ht_ge, ht_lt⟩ := ht simp only [fdPolygon, fdPolygonSeg4] split_ifs with h'₁ h'₂ h'₃ h'₄ - · linarith [h3.trans ht_ge] - · linarith [h3.trans ht_ge] + · linarith only [h2, ht_ge, h'₁, h3.trans ht_ge] + · linarith only [h3, ht_ge, h'₂, h3.trans ht_ge] · have : t = 3 := le_antisymm h'₃ (h3.trans ht_ge) subst this simp [chordSegment, rho, iPoint, HHeight]; ring · rfl - all_goals linarith + all_goals linarith only [ht_lt, h'₄] exact (fdPolygon_seg4_differentiable.differentiableAt.hasDerivAt.hasDerivWithinAt ).congr_of_eventuallyEq heq (by simp only [fdPolygon, fdPolygonSeg4] split_ifs with h'₁ h'₂ h'₃ h'₄ - · linarith - · linarith + · linarith only [h2, h'₁] + · linarith only [h3, h'₂] · have : x = 3 := le_antisymm h'₃ h3; subst this simp [chordSegment, rho, iPoint, HHeight]; ring · rfl - all_goals linarith) + all_goals linarith only [h4, h'₄]) · push Not at h1 h2 h3 h4 have heq : fdPolygon =ᶠ[𝓝[Ici x] x] fdPolygonSeg5 := by filter_upwards [self_mem_nhdsWithin] with t ht have hxt : x ≤ t := ht simp only [fdPolygon, fdPolygonSeg5] split_ifs with h'₁ h'₂ h'₃ h'₄ - · linarith - · linarith - · linarith + · linarith only [h4, hxt, h'₁] + · linarith only [h4, hxt, h'₂] + · linarith only [h4, hxt, h'₃] · have : t = 4 := le_antisymm h'₄ (h4.trans hxt) subst this; simp [HHeight]; ring · rfl @@ -476,9 +485,9 @@ lemma fdPolygon_hasDerivWithinAt_Ici (x : ℝ) : ).congr_of_eventuallyEq heq (by simp only [fdPolygon, fdPolygonSeg5] split_ifs with h'₁ h'₂ h'₃ h'₄ - · linarith - · linarith - · linarith + · linarith only [h4, h'₁] + · linarith only [h4, h'₂] + · linarith only [h4, h'₃] · have : x = 4 := le_antisymm h'₄ h4; subst this simp [HHeight]; ring · rfl) @@ -492,7 +501,7 @@ lemma fdPolygon_norm_sub_le (a b : ℝ) : have := norm_image_sub_le_of_norm_deriv_right_le_segment fdPolygon_continuous.continuousOn (fun x _ => fdPolygon_hasDerivWithinAt_Ici x) (fun x _ => fdPolygon_right_deriv_norm_le x) b (right_mem_Icc.mpr h) - linarith + linarith only [this] /-- t-derivative is bounded. -/ lemma polygonToCircleRadial_deriv_bounded (p : ℂ) (hp_norm : ‖p‖ > 1) diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/WindingBase.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/WindingBase.lean index f40745bc80..3e624e26a7 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/WindingBase.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/WindingBase.lean @@ -46,28 +46,30 @@ private lemma sqrt_one_minus_sq_plus_linear_ge_one (x : ℝ) (hx0 : 0 ≤ x) (hx Real.sqrt (1 - x^2) + (2 - Real.sqrt 3) * x ≥ 1 := by have hsq3 : Real.sqrt 3 ^ 2 = 3 := Real.sq_sqrt (by norm_num : (0 : ℝ) ≤ 3) have hsq3_pos : 0 < Real.sqrt 3 := Real.sqrt_pos_of_pos (by norm_num : (0 : ℝ) < 3) - have hsq3_lt2 : Real.sqrt 3 < 2 := by nlinarith [hsq3] - have h_2ms_pos : 0 ≤ 2 - Real.sqrt 3 := by linarith - have h1 : 0 ≤ 1 - x ^ 2 := by nlinarith - have h_rhs : 0 ≤ 1 - (2 - Real.sqrt 3) * x := by nlinarith [sq_nonneg (Real.sqrt 3 - 1)] - suffices h : Real.sqrt (1 - x ^ 2) ≥ 1 - (2 - Real.sqrt 3) * x by linarith + have hsq3_lt2 : Real.sqrt 3 < 2 := by nlinarith only [hsq3, hsq3_pos] + have h_2ms_pos : 0 ≤ 2 - Real.sqrt 3 := by linarith only [hsq3_lt2] + have h1 : 0 ≤ 1 - x ^ 2 := by nlinarith only [hx0, hx1] + have h_rhs : 0 ≤ 1 - (2 - Real.sqrt 3) * x := by + nlinarith only [hx0, hx1, hsq3, hsq3_pos, sq_nonneg (Real.sqrt 3 - 1)] + suffices h : Real.sqrt (1 - x ^ 2) ≥ 1 - (2 - Real.sqrt 3) * x by linarith only [h] rw [ge_iff_le, ← Real.sqrt_sq h_rhs] apply Real.sqrt_le_sqrt have key : x * ((8 - 4 * Real.sqrt 3) * x - (4 - 2 * Real.sqrt 3)) ≤ 0 := by apply mul_nonpos_of_nonneg_of_nonpos hx0 have : (8 - 4 * Real.sqrt 3) * x ≤ (8 - 4 * Real.sqrt 3) * (1/2) := by - apply mul_le_mul_of_nonneg_left hx1; nlinarith [hsq3] - linarith - nlinarith [sq_nonneg (1 - 2*x), sq_nonneg (Real.sqrt 3 * (1 - 2*x)), sq_nonneg x, hsq3, key] + apply mul_le_mul_of_nonneg_left hx1; nlinarith only [hsq3_lt2, hsq3] + linarith only [this] + nlinarith only [hsq3, key, sq_nonneg (1 - 2 * x), sq_nonneg (Real.sqrt 3 * (1 - 2 * x)), + sq_nonneg x] private lemma convex_combo_gt_one' (s A Y₀ : ℝ) (hs0 : 0 ≤ s) (hs1 : s ≤ 1) (hY₀ : Y₀ > 1) (hA : A > 1) : (1 - s) * A + s * Y₀ > 1 := by rcases eq_or_lt_of_le hs0 with rfl | hs_pos - · simp only [sub_zero, one_mul, zero_mul, add_zero]; linarith + · simp only [sub_zero, one_mul, zero_mul, add_zero]; linarith only [hA] rcases eq_or_lt_of_le hs1 with rfl | hs_lt1 - · simp only [sub_self, zero_mul, zero_add, one_mul]; linarith - · have : (1 - s) * A > (1 - s) := by nlinarith - have : s * Y₀ > s := by nlinarith + · simp only [sub_self, zero_mul, zero_add, one_mul]; linarith only [hY₀] + · have : (1 - s) * A > (1 - s) := by nlinarith only [hA, hs_lt1] + have : s * Y₀ > s := by nlinarith only [hY₀, hs_pos] linarith private lemma avoids_chord_rho'_to_i (p : ℂ) @@ -81,8 +83,8 @@ private lemma avoids_chord_rho'_to_i (p : ℂ) have hsq3 : Real.sqrt 3 ^ 2 = 3 := Real.sq_sqrt (by norm_num : (0 : ℝ) ≤ 3) have hsq3_pos : 0 < Real.sqrt 3 := Real.sqrt_pos_of_pos (by norm_num : (0 : ℝ) < 3) set u := t - 1 with hu_def - have hu0 : 0 ≤ u := by linarith - have hu1 : u ≤ 1 := by linarith + have hu0 : 0 ≤ u := by linarith only [ht1] + have hu1 : u ≤ 1 := by linarith only [ht2] have hfd : fdPolygon t = chordSegment rho' iPoint u := by simp only [fdPolygon, show ¬(t ≤ 1) from not_le.mpr ht1, ↓reduceIte, ht2, hu_def] have hfd_re : (fdPolygon t).re = (1 - u) / 2 := by @@ -101,33 +103,36 @@ private lemma avoids_chord_rho'_to_i (p : ℂ) rcases le_or_gt 0 p.re with hp_re_nn | hp_re_neg · rw [hfd_re] at heq_re rw [hfd_im] at heq_im - have h_1mu : 1 - u = 2 * ((1 - s) * p.re) := by linarith - have h_u : u = 1 - 2 * ((1 - s) * p.re) := by linarith + have h_1mu : 1 - u = 2 * ((1 - s) * p.re) := by linarith only [heq_re] + have h_u : u = 1 - 2 * ((1 - s) * p.re) := by linarith only [heq_re] have heq_im' : (1 - s) * (p.im + p.re * (2 - Real.sqrt 3)) + s * refY₀ = 1 := by have : (1 - u) * (Real.sqrt 3 / 2) + u = 1 - (1 - s) * p.re * (2 - Real.sqrt 3) := by rw [h_1mu, h_u]; ring - linarith + linarith only [heq_im, this] have hp_im_bound : p.im > Real.sqrt (1 - p.re ^ 2) := by - have h1 : 0 ≤ 1 - p.re ^ 2 := by nlinarith [abs_lt.mp hp_re] + have h1 : 0 ≤ 1 - p.re ^ 2 := by nlinarith only [abs_lt.mp hp_re] rw [show p.im = Real.sqrt (p.im ^ 2) from (Real.sqrt_sq (le_of_lt hp_im_pos)).symm] - exact Real.sqrt_lt_sqrt h1 (by nlinarith) - have hp_re_le : p.re ≤ 1/2 := by rcases abs_le.mp (le_of_lt hp_re) with ⟨_, h⟩; linarith + exact Real.sqrt_lt_sqrt h1 (by linarith only [hp_sq]) + have hp_re_le : p.re ≤ 1/2 := by + rcases abs_le.mp (le_of_lt hp_re) with ⟨_, h⟩; linarith only [h] have h_combo : p.im + p.re * (2 - Real.sqrt 3) > 1 := by have h_ge := sqrt_one_minus_sq_plus_linear_ge_one p.re hp_re_nn hp_re_le - linarith + linarith only [hp_im_bound, h_ge] have h_lhs_gt : (1 - s) * (p.im + p.re * (2 - Real.sqrt 3)) + s * refY₀ > 1 := convex_combo_gt_one' s (p.im + p.re * (2 - Real.sqrt 3)) refY₀ hs0 hs1 ref_Y₀_gt_one h_combo - linarith + linarith only [heq_im', h_lhs_gt] · rw [hfd_re] at heq_re - have h_lhs_nn : (1 - u) / 2 ≥ 0 := div_nonneg (by linarith) (by norm_num) + have h_lhs_nn : (1 - u) / 2 ≥ 0 := div_nonneg (by linarith only [ht2]) (by norm_num) have h_rhs_le : (1 - s) * p.re ≤ 0 := mul_nonpos_of_nonneg_of_nonpos h1s_nn (le_of_lt hp_re_neg) - have h_both_zero : (1 - s) * p.re = 0 ∧ (1 - u) / 2 = 0 := by constructor <;> linarith + have h_both_zero : (1 - s) * p.re = 0 ∧ (1 - u) / 2 = 0 := by + constructor <;> linarith only [ht2, + heq_re, h_rhs_le] have hs_eq : s = 1 := by rcases mul_eq_zero.mp h_both_zero.1 with h | h - · linarith - · exfalso; linarith + · linarith only [hs1, h] + · exfalso; linarith only [hp_re_neg, h] rw [hs_eq] at heq_im simp only [sub_self, zero_mul, zero_add, one_mul] at heq_im rw [hfd_im] at heq_im @@ -135,11 +140,11 @@ private lemma avoids_chord_rho'_to_i (p : ℂ) have : (1 - u) * (Real.sqrt 3 / 2) + u = Real.sqrt 3 / 2 + u * (1 - Real.sqrt 3 / 2) := by ring rw [this] - have h1 : 1 - Real.sqrt 3 / 2 > 0 := by nlinarith [hsq3] + have h1 : 1 - Real.sqrt 3 / 2 > 0 := by nlinarith only [hsq3, hsq3_pos] have h2 : u * (1 - Real.sqrt 3 / 2) ≤ 1 * (1 - Real.sqrt 3 / 2) := mul_le_mul_of_nonneg_right hu1 (le_of_lt h1) - linarith - linarith [ref_Y₀_gt_one] + linarith only [h2] + linarith only [heq_im, h_bound, ref_Y₀_gt_one] private lemma avoids_chord_i_to_rho (p : ℂ) (hp_re : |p.re| < 1 / 2) (hp_im_pos : 0 < p.im) @@ -152,10 +157,10 @@ private lemma avoids_chord_i_to_rho (p : ℂ) have hsq3 : Real.sqrt 3 ^ 2 = 3 := Real.sq_sqrt (by norm_num : (0 : ℝ) ≤ 3) have hsq3_pos : 0 < Real.sqrt 3 := Real.sqrt_pos_of_pos (by norm_num : (0 : ℝ) < 3) set v := t - 2 with hv_def - have hv0 : 0 ≤ v := by linarith - have hv1 : v ≤ 1 := by linarith + have hv0 : 0 ≤ v := by linarith only [ht2] + have hv1 : v ≤ 1 := by linarith only [ht3] have hfd : fdPolygon t = chordSegment iPoint rho v := by - simp only [fdPolygon, show ¬(t ≤ 1) from by linarith, + simp only [fdPolygon, show ¬(t ≤ 1) from by linarith only [ht2], show ¬(t ≤ 2) from not_le.mpr ht2, ↓reduceIte, ht3, hv_def] have hfd_re : (fdPolygon t).re = -v / 2 := by rw [hfd] @@ -176,51 +181,53 @@ private lemma avoids_chord_i_to_rho (p : ℂ) · rcases eq_or_lt_of_le hp_re_np with hp_re_zero | hp_re_neg · rw [hfd_re] at heq_re rw [hp_re_zero, mul_zero] at heq_re - have hv_eq : v = 0 := by linarith + have hv_eq : v = 0 := by linarith only [ht2, heq_re] rw [hfd_im, hv_eq] at heq_im simp only [zero_mul, sub_zero] at heq_im have hp_im_gt1 : p.im > 1 := by - have : p.im ^ 2 > 1 := by nlinarith [hp_re_zero] - nlinarith [sq_nonneg (p.im - 1)] + have : p.im ^ 2 > 1 := by + simpa only [hp_re_zero, zero_pow (by decide : (2 : ℕ) ≠ 0), zero_add] using hp_sq + nlinarith only [this, hp_im_pos] have : (1 - s) * p.im + s * refY₀ > 1 := convex_combo_gt_one' s p.im refY₀ hs0 hs1 ref_Y₀_gt_one hp_im_gt1 - linarith + linarith only [ht2, heq_re] · rw [hfd_re] at heq_re - have hv_eq : v = -2 * ((1 - s) * p.re) := by linarith - have hv_eq' : v = 2 * (1 - s) * (-p.re) := by linarith + have hv_eq : v = -2 * ((1 - s) * p.re) := by linarith only [heq_re] + have hv_eq' : v = 2 * (1 - s) * (-p.re) := by linarith only [heq_re] rw [hfd_im] at heq_im have heq_im' : (1 - s) * (p.im + (-p.re) * (2 - Real.sqrt 3)) + s * refY₀ = 1 := by have : v * (1 - Real.sqrt 3 / 2) = (1 - s) * (-p.re) * (2 - Real.sqrt 3) := by rw [hv_eq']; ring - linarith + linarith only [heq_im, this] have hp_abs_re : |p.re| = -p.re := abs_of_neg hp_re_neg - have hp_re_nn' : 0 ≤ -p.re := by linarith - have hp_re_le' : -p.re ≤ 1/2 := by rw [← hp_abs_re]; linarith + have hp_re_nn' : 0 ≤ -p.re := by linarith only [hp_re_neg] + have hp_re_le' : -p.re ≤ 1/2 := by rw [← hp_abs_re]; linarith only [hp_re] have hp_im_bound : p.im > Real.sqrt (1 - p.re ^ 2) := by - have h1 : 0 ≤ 1 - p.re ^ 2 := by nlinarith [abs_lt.mp hp_re] + have h1 : 0 ≤ 1 - p.re ^ 2 := by nlinarith only [abs_lt.mp hp_re] rw [show p.im = Real.sqrt (p.im ^ 2) from (Real.sqrt_sq (le_of_lt hp_im_pos)).symm] - exact Real.sqrt_lt_sqrt h1 (by nlinarith) + exact Real.sqrt_lt_sqrt h1 (by linarith only [hp_sq]) have h_neg_re_sq : (-p.re) ^ 2 = p.re ^ 2 := by ring have h_combo : p.im + (-p.re) * (2 - Real.sqrt 3) > 1 := by have h_ge := sqrt_one_minus_sq_plus_linear_ge_one (-p.re) hp_re_nn' hp_re_le' rw [h_neg_re_sq] at h_ge - linarith + linarith only [hp_im_bound, h_ge] have h_lhs_gt : (1 - s) * (p.im + (-p.re) * (2 - Real.sqrt 3)) + s * refY₀ > 1 := convex_combo_gt_one' s (p.im + (-p.re) * (2 - Real.sqrt 3)) refY₀ hs0 hs1 ref_Y₀_gt_one h_combo - linarith + linarith only [heq_im', h_lhs_gt] · rw [hfd_re] at heq_re have h_rhs_nn : (1 - s) * p.re ≥ 0 := by positivity - have h_lhs_le : -v / 2 ≤ 0 := by linarith - have h_both_zero : (1 - s) * p.re = 0 ∧ v = 0 := by constructor <;> linarith + have h_lhs_le : -v / 2 ≤ 0 := by linarith only [ht2, heq_re, h_rhs_nn] + have h_both_zero : (1 - s) * p.re = 0 ∧ v = 0 := by constructor <;> linarith only [ht2, + heq_re, h_rhs_nn] have hs_eq : s = 1 := by rcases mul_eq_zero.mp h_both_zero.1 with h | h - · linarith - · exfalso; linarith + · linarith only [ht2, heq_re, h_rhs_nn] + · exfalso; linarith only [ht2, heq_re, h_rhs_nn] rw [hs_eq] at heq_im; simp only [sub_self, zero_mul, zero_add, one_mul] at heq_im rw [hfd_im, show v = 0 from h_both_zero.2] at heq_im simp only [zero_mul, sub_zero] at heq_im - linarith [ref_Y₀_gt_one] + linarith only [ht2, heq_re, h_rhs_nn, ref_Y₀_gt_one] /-- The straight line from any valid interior point p to refP₀ = I*Y₀ avoids all points on the fdPolygon boundary. -/ @@ -320,11 +327,15 @@ lemma rc_sub_ref_p₀_mem_slitPlane (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 5) have hnorm_pos : (0 : ℝ) < ‖w‖ := norm_pos_iff.mpr hw_ne have hgoal_eq : fdPolygonRadialCircle refP₀ t - refP₀ = w / ↑‖w‖ := by unfold fdPolygonRadialCircle polygonToCircleRadial - simp_all + simp_all only [mem_Icc, ne_eq, norm_pos_iff, not_false_eq_true, sub_self, zero_mul, zero_add, + one_smul, + add_sub_cancel_left] rw [hgoal_eq] suffices hw_slit : w ∈ Complex.slitPlane by simp only [Complex.slitPlane, Set.mem_ofPred_eq] at hw_slit ⊢ - simp_all + simp_all only [mem_Icc, ne_eq, norm_pos_iff, not_false_eq_true, sub_re, sub_pos, sub_im, + div_ofReal_re, + div_pos_iff_of_pos_right, div_ofReal_im, div_eq_zero_iff, norm_eq_zero, or_false] simp only [Complex.slitPlane, Set.mem_ofPred_eq] have ref_re : refP₀.re = 0 := refP₀_re_eq_zero have ref_im : refP₀.im = refY₀ := refP₀_im_eq @@ -353,8 +364,9 @@ lemma rc_sub_ref_p₀_mem_slitPlane (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 5) Complex.ofReal_re, Complex.I_im, mul_one, Complex.div_ofNat_im, Complex.ofReal_im, Complex.I_re, mul_zero, add_zero, zero_add] rw [him, hrho', show iPoint.im = 1 from by unfold iPoint; simp only [Complex.I_im]] - nlinarith [Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num), sq_nonneg (2 - Real.sqrt 3)] - intro h_eq; linarith [ref_Y₀_gt_one] + nlinarith only [ht0, ht2, Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num), + sq_nonneg (2 - Real.sqrt 3)] + intro h_eq; linarith only [hfd_im_le, h_eq, ref_Y₀_gt_one] · push Not at ht2 by_cases ht3 : t ≤ 3 · right; rw [hw_im] @@ -371,31 +383,41 @@ lemma rc_sub_ref_p₀_mem_slitPlane (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 5) mul_im, div_ofNat_re, ofReal_re, I_im, mul_one, ofReal_im, I_re, mul_zero, add_zero, zero_add] rw [him, show iPoint.im = 1 from by unfold iPoint; simp only [Complex.I_im], hrho] - nlinarith [Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num), sq_nonneg (2 - Real.sqrt 3)] - intro h_eq; linarith [ref_Y₀_gt_one] + nlinarith only [ht0, ht2, Real.sq_sqrt (show (0 : ℝ) ≤ 3 by norm_num), + sq_nonneg (2 - Real.sqrt 3)] + intro h_eq; linarith only [hfd_im_le, h_eq, ref_Y₀_gt_one] · push Not at ht3 by_cases ht4 : t ≤ 4 · right; rw [hw_im] have hfd_im : (fdPolygon t).im = Real.sqrt 3 / 2 + (t - 3) * (HHeight - Real.sqrt 3 / 2) := by simp only [fdPolygon, not_le.mpr ht1, not_le.mpr ht2, not_le.mpr ht3, ht4, ↓reduceIte] - simp_all - have hdenom_pos : HHeight - Real.sqrt 3 / 2 > 0 := by unfold HHeight; linarith + simp_all only [mem_Icc, and_self, ne_eq, norm_pos_iff, not_false_eq_true, sub_re, + sub_zero, sub_im, add_im, + div_ofNat_im, neg_im, one_im, neg_zero, zero_div, mul_im, add_re, div_ofNat_re, + ofReal_re, mul_re, re_ofNat, + ofReal_im, im_ofNat, sub_self, mul_zero, I_im, mul_one, zero_mul, add_zero, I_re, + zero_add] + have hdenom_pos : HHeight - Real.sqrt 3 / 2 > 0 := by unfold HHeight; linarith only [] intro h_eq - have him_eq : (fdPolygon t).im = refY₀ := by linarith + have him_eq : (fdPolygon t).im = refY₀ := by linarith only [h_eq] have him_eq' : (t - 3) * (HHeight - Real.sqrt 3 / 2) = - refY₀ - Real.sqrt 3 / 2 := by linarith [hfd_im] + refY₀ - Real.sqrt 3 / 2 := by linarith only [hfd_im, h_eq] have ht_eq : t - 3 = (refY₀ - Real.sqrt 3 / 2) / (HHeight - Real.sqrt 3 / 2) := by - rw [eq_div_iff (ne_of_gt hdenom_pos)]; linarith - have : t = tL refP₀ := by simp only [tL, ref_im]; linarith + rw [eq_div_iff (ne_of_gt hdenom_pos)]; linarith only [hfd_im, h_eq] + have : t = tL refP₀ := by simp only [tL, ref_im]; linarith only [ht_eq] exact htL this · push Not at ht4 right; rw [hw_im] have hfd_im : (fdPolygon t).im = HHeight := by simp only [fdPolygon, not_le.mpr ht1, not_le.mpr ht2, not_le.mpr ht3, not_le.mpr ht4, ↓reduceIte] - simp_all - linarith [ref_Y₀_lt_H] + simp_all only [mem_Icc, and_self, ne_eq, norm_pos_iff, not_false_eq_true, sub_re, + sub_zero, sub_im, add_im, + ofReal_im, div_ofNat_im, im_ofNat, zero_div, sub_self, mul_im, ofReal_re, I_im, + mul_one, I_re, mul_zero, add_zero, + zero_add] + linarith only [hfd_im, ref_Y₀_lt_H] /-- fdPolygon t - refP₀ is in slitPlane for t ∈ [0, 5] with t ≠ tL refP₀. Derived from `rc_sub_ref_p₀_mem_slitPlane` via positive-scaling; the same @@ -411,10 +433,14 @@ lemma fdPolygon_sub_ref_p₀_mem_slitPlane (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 5 have hnorm_pos : (0 : ℝ) < ‖w‖ := norm_pos_iff.mpr hw_ne have hrc_eq : fdPolygonRadialCircle refP₀ t - refP₀ = w / ↑‖w‖ := by unfold fdPolygonRadialCircle polygonToCircleRadial - simp_all + simp_all only [mem_Icc, ne_eq, norm_pos_iff, not_false_eq_true, sub_self, zero_mul, zero_add, + one_smul, + add_sub_cancel_left] rw [hrc_eq] at hw simp only [Complex.slitPlane, Set.mem_ofPred_eq] at hw ⊢ - simp_all + simp_all only [mem_Icc, ne_eq, div_ofReal_re, sub_re, div_ofReal_im, sub_im, div_eq_zero_iff, + norm_eq_zero, + not_or, norm_pos_iff, not_false_eq_true, sub_pos, div_pos_iff_of_pos_right, and_true] /-- w = fdPolygon · - refP₀ is continuous. -/ lemma continuous_w : Continuous (fun t => fdPolygon t - refP₀) := @@ -440,7 +466,7 @@ lemma w_im_neg_near_tL_left : have htL := tL_mem_Ioo refP₀ ref_p₀_norm ref_p₀_re ref_p₀_im_pos ref_p₀_im exact Filter.mem_of_superset (Ioo_mem_nhdsLT htL.1) fun t ht => (seg4_vec_im_sign refP₀ ref_p₀_norm ref_p₀_re ref_p₀_im_pos ref_p₀_im t - ⟨ht.1, by linarith [ht.2, htL.2]⟩).1 ht.2 + ⟨ht.1, by linarith only [htL, ht, ht.2, htL.2]⟩).1 ht.2 /-- For t near tL from above, w(t).im > 0. -/ lemma w_im_pos_near_tL_right : @@ -449,7 +475,8 @@ lemma w_im_pos_near_tL_right : have htL := tL_mem_Ioo refP₀ ref_p₀_norm ref_p₀_re ref_p₀_im_pos ref_p₀_im apply Filter.mem_of_superset (Ioo_mem_nhdsGT htL.2) intro t ht - have ht_Ioc : t ∈ Set.Ioc (3 : ℝ) 4 := ⟨by linarith [ht.1, htL.1], by linarith [ht.2]⟩ + have ht_Ioc : t ∈ Set.Ioc (3 : ℝ) 4 := ⟨by linarith only [htL, ht, ht.1, htL.1], by + linarith only [ht, ht.2]⟩ exact (seg4_vec_im_sign refP₀ ref_p₀_norm ref_p₀_re ref_p₀_im_pos ref_p₀_im t ht_Ioc).2.2 ht.1 diff --git a/LeanPool/LeanModularForms/ValenceFormula/TextbookExistence.lean b/LeanPool/LeanModularForms/ValenceFormula/TextbookExistence.lean index 6a2581cd0a..166654fc73 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/TextbookExistence.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/TextbookExistence.lean @@ -96,9 +96,9 @@ private lemma uhp_norm_one_re_zero_eq_i (p : ℍ) (hn : ‖(p : ℂ)‖ = 1) (hr have h_nsq : Complex.normSq (p : ℂ) = 1 := by rw [Complex.normSq_eq_norm_sq, hn, one_pow] rw [Complex.normSq_apply, hr] at h_nsq have h_im : (p : ℂ).im = 1 := by - have h_prod : ((p : ℂ).im - 1) * ((p : ℂ).im + 1) = 0 := by nlinarith + have h_prod : ((p : ℂ).im - 1) * ((p : ℂ).im + 1) = 0 := by nlinarith only [h_nsq] rcases mul_eq_zero.mp h_prod with h | h - · linarith + · linarith only [h] · exact absurd h (ne_of_gt (add_pos p.2 one_pos)) exact Complex.ext (hr.trans Complex.I_re.symm) (h_im.trans Complex.I_im.symm) diff --git a/LeanPool/LeanModularForms/ValenceFormula/TextbookForm.lean b/LeanPool/LeanModularForms/ValenceFormula/TextbookForm.lean index e9e0be0132..867ae24241 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/TextbookForm.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/TextbookForm.lean @@ -139,11 +139,11 @@ private theorem fd'_orbit_i_eq_i (p : ℍ) (hp : p ∈ 𝒟) (horb : orb p = oi) have h_n_zero : n = 0 := by by_contra h_ne have h2 := hp.2; rw [hn] at h2 - linarith [show (1 : ℝ) ≤ |(n : ℝ)| from by exact_mod_cast Int.one_le_abs h_ne] + linarith only [h_ne, h2, show (1 : ℝ) ≤ |(n : ℝ)| from by exact_mod_cast Int.one_le_abs h_ne] exact UpperHalfPlane.ext_re_im (by rw [hn, h_n_zero, Int.cast_zero] exact (Complex.I_re : (I : ℂ).re = 0).symm) - (by linarith [h_im, ellipticPointI'_im]) + (by linarith only [h_im, ellipticPointI'_im]) private lemma ellipticPointRho'_re : (ellipticPointRho' : ℍ).re = -1/2 := by change (-1/2 + (Real.sqrt 3 / 2) * I : ℂ).re = -1/2; simp [add_re, mul_re, I_re, I_im] @@ -180,7 +180,7 @@ private lemma normSq_denom_at_rho (g : SL(2, ℤ)) : simp only [add_re, mul_re, neg_re, one_re, div_ofNat_re, ofReal_re, mul_zero, I_re, I_im, sub_zero, mul_one, add_im, neg_im, one_im, div_ofNat_im, ofReal_im, zero_div, mul_im, zero_mul, add_zero, Complex.intCast_re, Complex.intCast_im] - ring_nf; nlinarith [Real.mul_self_sqrt (show (3 : ℝ) ≥ 0 by norm_num)] + ring_nf; nlinarith only [Real.mul_self_sqrt (show (3 : ℝ) ≥ 0 by norm_num)] private lemma normSq_denom_eq_one_of_smul_rho_in_fd (g : SL(2, ℤ)) (h_fd : g • ellipticPointRho' ∈ 𝒟) : @@ -218,15 +218,15 @@ private lemma abs_re_eq_half_of_smul_rho_in_fd (g : SL(2, ℤ)) have h_im := ModularGroup.im_smul_eq_div_normSq g ellipticPointRho' rw [ellipticPointRho'_im, normSq_denom_at_rho, h_cd1, div_one] at h_im; exact h_im have h_im_sq : (g • ellipticPointRho').im ^ 2 = 3/4 := by - rw [h_im_eq]; nlinarith [Real.mul_self_sqrt (show (3 : ℝ) ≥ 0 by norm_num)] + rw [h_im_eq]; nlinarith only [Real.mul_self_sqrt (show (3 : ℝ) ≥ 0 by norm_num)] have h_nsq : (g • ellipticPointRho').re ^ 2 + (g • ellipticPointRho').im ^ 2 ≥ 1 := by have h_apply := Complex.normSq_apply (↑(g • ellipticPointRho') : ℂ) rw [UpperHalfPlane.coe_re, UpperHalfPlane.coe_im] at h_apply - nlinarith [h_fd.1, h_apply] + nlinarith only [h_fd, h_apply, h_fd.1] exact le_antisymm h_fd.2 (by - by_contra h_lt; push Not at h_lt; nlinarith [sq_abs (g • ellipticPointRho').re, - abs_nonneg (g • ellipticPointRho').re, h_im_sq, h_nsq]) + by_contra h_lt; push Not at h_lt; nlinarith only [h_im_sq, h_nsq, h_lt, + sq_abs (g • ellipticPointRho').re, abs_nonneg (g • ellipticPointRho').re]) private theorem fd'_orbit_rho_eq (p : ℍ) (hp : p ∈ 𝒟) (horb : orb p = orho) : p = ellipticPointRho' ∨ p = ellipticPointRhoPlusOne' := by @@ -243,15 +243,15 @@ private theorem fd'_orbit_rho_eq (p : ℍ) (hp : p ∈ 𝒟) (horb : orb p = orh have h_re_eq : (g • ellipticPointRho').re = -1/2 ∨ (g • ellipticPointRho').re = 1/2 := by have h_re_abs := abs_re_eq_half_of_smul_rho_in_fd g hp h_cd1 rcases le_or_gt (g • ellipticPointRho').re 0 with h_neg | h_pos - · left; linarith [abs_of_nonpos h_neg] - · right; linarith [abs_of_pos h_pos] + · left; linarith only [h_re_abs, h_neg, abs_of_nonpos h_neg] + · right; linarith only [h_re_abs, h_pos, abs_of_pos h_pos] rcases h_re_eq with h_re_left | h_re_right · left - exact UpperHalfPlane.ext_re_im (by linarith [h_re_left, ellipticPointRho'_re]) - (by linarith [h_im, ellipticPointRho'_im]) + exact UpperHalfPlane.ext_re_im (by linarith only [h_re_left, ellipticPointRho'_re]) + (by linarith only [h_im, ellipticPointRho'_im]) · right - exact UpperHalfPlane.ext_re_im (by linarith [h_re_right, ellipticPointRhoPlusOne'_re]) - (by linarith [h_im, ellipticPointRhoPlusOne'_im]) + exact UpperHalfPlane.ext_re_im (by linarith only [h_re_right, ellipticPointRhoPlusOne'_re]) + (by linarith only [h_im, ellipticPointRhoPlusOne'_im]) private theorem orb_repCanon_nonEll (p : ℍ) (hp : p ∈ repCanon f hf) : orb p ≠ oi ∧ orb p ≠ orho := by @@ -279,29 +279,33 @@ private lemma normSq_denom_expand_general (h : SL(2, ℤ)) (p : ℍ) : private lemma abs_int_cast_eq_one_of_sq_one {c : ℤ} (h : (c : ℝ) ^ 2 = 1) : |(c : ℝ)| = 1 := by - nlinarith [sq_abs (c : ℝ), abs_nonneg (c : ℝ), sq_nonneg (|(c : ℝ)| - 1)] + nlinarith only [h, sq_abs (c : ℝ), abs_nonneg (c : ℝ), sq_nonneg (|(c : ℝ)| - 1)] private lemma d_mul_linear_nonneg {c d : ℤ} {z : ℍ} (hz : z ∈ 𝒟) (h_c_abs : |(c : ℝ)| = 1) : (d : ℝ) * (2 * (c : ℝ) * (z : ℂ).re + (d : ℝ)) ≥ 0 := by have h_bound : |2 * (c : ℝ) * (z : ℂ).re| ≤ 1 := by rw [abs_mul, abs_mul, abs_of_pos (by norm_num : (2 : ℝ) > 0), h_c_abs, mul_one] - have h_re : |(z : ℂ).re| ≤ 1/2 := hz.2; linarith + have h_re : |(z : ℂ).re| ≤ 1/2 := hz.2; linarith only [h_re] rcases le_or_gt (d : ℤ) 0 with hd | hd · rcases eq_or_lt_of_le hd with hd0 | hd_neg · simp [show (d : ℝ) = 0 from by exact_mod_cast hd0] · have hd_le : (d : ℝ) ≤ -1 := by exact_mod_cast Int.le_sub_one_of_lt hd_neg - exact mul_nonneg_iff.mpr (Or.inr ⟨by linarith, by linarith [abs_le.mp h_bound]⟩) + exact mul_nonneg_iff.mpr (Or.inr ⟨by linarith only [hd_le], by + linarith only [h_bound, hd_le, abs_le.mp h_bound]⟩) · have hd_ge : (d : ℝ) ≥ 1 := by exact_mod_cast hd - exact mul_nonneg (by linarith) (by linarith [abs_le.mp h_bound]) + exact mul_nonneg (by linarith only [hd_ge]) (by + linarith only [h_bound, hd_ge, abs_le.mp h_bound]) private lemma normSq_denom_ge_one (h : SL(2, ℤ)) (z : ℍ) (hz : z ∈ 𝒟) (h_csq : ((h : Matrix (Fin 2) (Fin 2) ℤ) 1 0) ^ 2 = 1) : Complex.normSq (UpperHalfPlane.denom h z) ≥ 1 := by have h_csq_real : ((h : Matrix (Fin 2) (Fin 2) ℤ) 1 0 : ℝ) ^ 2 = 1 := by exact_mod_cast h_csq rw [normSq_denom_expand_general, h_csq_real, one_mul] - nlinarith [hz.1, d_mul_linear_nonneg (c := (h : Matrix (Fin 2) (Fin 2) ℤ) 1 0) - (d := (h : Matrix (Fin 2) (Fin 2) ℤ) 1 1) hz (abs_int_cast_eq_one_of_sq_one h_csq_real)] + nlinarith only [hz, h_csq_real, hz.1, + d_mul_linear_nonneg (c := (h : Matrix (Fin 2) (Fin 2) ℤ) 1 0) + (d := (h : Matrix (Fin 2) (Fin 2) ℤ) 1 1) hz + (abs_int_cast_eq_one_of_sq_one h_csq_real)] private lemma inv_c_sq_eq (g : SL(2, ℤ)) : ((g⁻¹ : SL(2, ℤ)).1 1 0) ^ 2 = ((g : Matrix (Fin 2) (Fin 2) ℤ) 1 0) ^ 2 := by @@ -328,8 +332,10 @@ private lemma normSq_eq_one_of_denom_one (h : SL(2, ℤ)) (z : ℍ) (hz : z ∈ have h_csq_real : ((h : Matrix (Fin 2) (Fin 2) ℤ) 1 0 : ℝ) ^ 2 = 1 := by exact_mod_cast h_csq have h_expand := normSq_denom_expand_general h z rw [h_denom, h_csq_real, one_mul] at h_expand - nlinarith [hz.1, d_mul_linear_nonneg (c := (h : Matrix (Fin 2) (Fin 2) ℤ) 1 0) - (d := (h : Matrix (Fin 2) (Fin 2) ℤ) 1 1) hz (abs_int_cast_eq_one_of_sq_one h_csq_real)] + nlinarith only [hz, h_csq_real, h_expand, hz.1, + d_mul_linear_nonneg (c := (h : Matrix (Fin 2) (Fin 2) ℤ) 1 0) + (d := (h : Matrix (Fin 2) (Fin 2) ℤ) 1 1) hz + (abs_int_cast_eq_one_of_sq_one h_csq_real)] private lemma c_abs_le_one_of_smul_fd (g : SL(2, ℤ)) (p₁ p₂ : ℍ) (hg : g • p₂ = p₁) (hp₁ : p₁ ∈ 𝒟) (hp₂ : p₂ ∈ 𝒟) : @@ -340,7 +346,7 @@ private lemma c_abs_le_one_of_smul_fd (g : SL(2, ℤ)) (p₁ p₂ : ℍ) have h_nsq_eq : Complex.normSq (UpperHalfPlane.denom g p₂) = p₂.im / p₁.im := by rw [h_p1_im_eq]; field_simp by_contra h_gt; push Not at h_gt - have h_c2 : c ^ 2 ≥ 4 := by nlinarith [sq_abs c] + have h_c2 : c ^ 2 ≥ 4 := by nlinarith only [h_gt, sq_abs c] have h1 : (↑c : ℝ) ^ 2 * p₂.im ^ 2 ≤ p₂.im / p₁.im := by rw [← h_nsq_eq]; convert p₂.c_mul_im_sq_le_normSq_denom g using 1; simp [c]; ring have h2 : (↑c : ℝ) ^ 2 * p₂.im ^ 2 * p₁.im ≤ p₂.im := by @@ -352,12 +358,13 @@ private lemma c_abs_le_one_of_smul_fd (g : SL(2, ℤ)) (p₁ p₂ : ℍ) rw [h_eq]; exact (div_le_one p₂.im_pos).mpr h2 have h_prod : 4 * (p₂.im * p₁.im) ≤ 1 := by have h_c2_real : (↑c : ℝ) ^ 2 ≥ 4 := by exact_mod_cast h_c2 - nlinarith [mul_nonneg (show (0 : ℝ) ≤ (↑c : ℝ) ^ 2 - 4 from by linarith) - (mul_nonneg p₂.im_pos.le p₁.im_pos.le)] + nlinarith only [h3, h_c2_real, + mul_nonneg (show (0 : ℝ) ≤ (↑c : ℝ) ^ 2 - 4 from by linarith) + (mul_nonneg p₂.im_pos.le p₁.im_pos.le)] have hp1_im : (1 : ℝ) / 2 < p₁.im := by rw [← UpperHalfPlane.coe_im]; exact fd_im_gt_half _ hp₁ have hp2_im : (1 : ℝ) / 2 < p₂.im := by rw [← UpperHalfPlane.coe_im]; exact fd_im_gt_half _ hp₂ - nlinarith [mul_pos (by linarith : (0 : ℝ) < p₁.im - 1/2) - (by linarith : (0 : ℝ) < p₂.im - 1/2)] + nlinarith only [h_prod, hp1_im, hp2_im, + mul_pos (by linarith : (0 : ℝ) < p₁.im - 1 / 2) (by linarith : (0 : ℝ) < p₂.im - 1 / 2)] private lemma repCanon_re_lt_half (p : ℍ) (hp : p ∈ repCanon f hf) : p.re < 1/2 := by simp only [repCanon, Finset.mem_union] at hp; rcases hp with (h | h) | h @@ -395,9 +402,9 @@ private lemma normSq_denom_one_of_im_eq (g : SL(2, ℤ)) have h := ModularGroup.im_smul_eq_div_normSq g p₁ rw [h_smul, h_im] at h have hne : Complex.normSq (UpperHalfPlane.denom g p₁) ≠ 0 := by - intro h0; simp [h0] at h; linarith [p₂.im_pos] + intro h0; simp [h0] at h; linarith only [h, p₂.im_pos] rw [eq_div_iff hne] at h - nlinarith [p₂.im_pos] + nlinarith only [h, p₂.im_pos] private lemma injOn_c_ne_zero (g : SL(2, ℤ)) (p₁ p₂ : ℍ) (hg : g • p₂ = p₁) (hp₁ : p₁ ∈ repCanon f hf) (hp₂ : p₂ ∈ repCanon f hf) @@ -406,7 +413,8 @@ private lemma injOn_c_ne_zero (g : SL(2, ℤ)) (p₁ p₂ : ℍ) (h_abs_c : |(g : Matrix (Fin 2) (Fin 2) ℤ) 1 0| ≤ 1) : p₁ = p₂ := by have h_csq : ((g : Matrix (Fin 2) (Fin 2) ℤ) 1 0) ^ 2 = 1 := by - nlinarith [sq_abs ((g : Matrix (Fin 2) (Fin 2) ℤ) 1 0), Int.one_le_abs h_c_ne] + nlinarith only [h_c_ne, h_abs_c, sq_abs ((g : Matrix (Fin 2) (Fin 2) ℤ) 1 0), + Int.one_le_abs h_c_ne] have h_nsq_eq : Complex.normSq (UpperHalfPlane.denom g p₂) = p₂.im / p₁.im := by have h := ModularGroup.im_smul_eq_div_normSq g p₂; rw [hg] at h; rw [h]; field_simp have h_im_eq : p₁.im = p₂.im := le_antisymm @@ -422,16 +430,16 @@ private lemma injOn_c_ne_zero (g : SL(2, ℤ)) (p₁ p₂ : ℍ) ((inv_c_sq_eq g).trans h_csq) (normSq_denom_one_of_im_eq g⁻¹ p₁ p₂ (inv_smul_eq_iff.mpr hg.symm) h_im_eq) have h_p1_norm : ‖(p₁ : ℂ)‖ = 1 := by - nlinarith [Complex.normSq_eq_norm_sq (p₁ : ℂ), norm_nonneg (p₁ : ℂ), + nlinarith only [h_p1_nsq, Complex.normSq_eq_norm_sq (p₁ : ℂ), norm_nonneg (p₁ : ℂ), sq_nonneg (‖(p₁ : ℂ)‖ - 1)] have h_p2_norm : ‖(p₂ : ℂ)‖ = 1 := by - nlinarith [Complex.normSq_eq_norm_sq (p₂ : ℂ), norm_nonneg (p₂ : ℂ), + nlinarith only [h_p2_nsq, Complex.normSq_eq_norm_sq (p₂ : ℂ), norm_nonneg (p₂ : ℂ), sq_nonneg (‖(p₂ : ℂ)‖ - 1)] have h_re_eq : (p₁ : ℂ).re = (p₂ : ℂ).re := by rw [Complex.normSq_apply] at h_p1_nsq h_p2_nsq rw [show (↑p₁ : ℂ).im = (↑p₂ : ℂ).im from h_im_eq] at h_p1_nsq - nlinarith [sq_nonneg ((p₁ : ℂ).re - (p₂ : ℂ).re), - sq_nonneg ((p₁ : ℂ).re + (p₂ : ℂ).re), + nlinarith only [hf, hp₁, hp₂, h_p2_nsq, h_p1_nsq, h_p1_norm, h_p2_norm, + sq_nonneg ((p₁ : ℂ).re - (p₂ : ℂ).re), sq_nonneg ((p₁ : ℂ).re + (p₂ : ℂ).re), repCanon_norm_one_re_neg f hf p₁ hp₁ h_p1_norm, repCanon_norm_one_re_neg f hf p₂ hp₂ h_p2_norm] exact UpperHalfPlane.ext_re_im h_re_eq h_im_eq diff --git a/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/Common.lean b/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/Common.lean index 1fc27274a6..6ac6a45725 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/Common.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/Common.lean @@ -90,7 +90,7 @@ theorem fdBoundary_H_seg4 (H : ℝ) {t : ℝ} (ht1 : ¬(t ≤ 1)) (ht2 : ¬(t theorem fdBoundary_H_eq_arc {H : ℝ} {t : ℝ} (ht1 : 1 < t) (ht3 : t < 3) : fdBoundaryH H t = Complex.exp (↑(Real.pi * (1 + t) / 6) * I) := by - simp only [fdBoundaryH, show ¬(t ≤ 1) from by linarith, ↓reduceIte] + simp only [fdBoundaryH, show ¬(t ≤ 1) from by linarith only [ht1], ↓reduceIte] by_cases h2 : t ≤ 2 · simp only [h2, ↓reduceIte]; congr 1; push_cast; ring · simp only [h2, ↓reduceIte, show t ≤ 3 from le_of_lt ht3]; congr 1; push_cast; ring @@ -155,7 +155,8 @@ private lemma logDeriv_integrable_congr {g h : ℝ → ℂ} {a b : ℝ} (hab : a (show Integrable _ (volume.restrict (Ioc a b)) from hint_h.1) ((MeasureTheory.ae_restrict_iff' measurableSet_Ioc).mpr (h_congr.mono (fun t ht hm => (ht (uIoc_of_le hab ▸ hm)).symm))) - · simp_all + · simp_all only [mem_Icc, ne_eq, and_imp, mem_Ioo, uIoc_of_le, mem_Ioc, not_lt, Ioc_eq_empty, + integrableOn_empty] lemma ftc_log_piece_upper {g h : ℝ → ℂ} {a b : ℝ} (hab : a ≤ b) (hh_cont : ContinuousOn h (Icc a b)) (hh_diff : ∀ t ∈ Ioo a b, DifferentiableAt ℝ h t) @@ -256,7 +257,10 @@ lemma hasDerivAt_arc (s : ℂ) : lemma continuous_arc_deriv (_ : ℂ) : Continuous (fun t : ℝ => ↑(Real.pi / 6) * I * exp (↑(Real.pi * (1 + t) / 6) * I)) := Continuous.mul continuous_const (Continuous.cexp (Continuous.mul - (continuous_ofReal.comp (by fun_prop : Continuous fun s => Real.pi * (1 + s) / 6)) + (continuous_ofReal.comp (by + exact Continuous.comp' (Continuous.div_const continuous_id' 6) + (Continuous.comp' (continuous_const_mul π) (Continuous.const_add continuous_id' 1)) : + Continuous fun s => Real.pi * (1 + s) / 6)) continuous_const)) /-- nhds equality from Ioo agreement. -/ @@ -277,20 +281,22 @@ lemma eventuallyEq_of_Ioi {g h : ℝ → ℂ} {a : ℝ} /-- `sin(π/12) < 1/2`, used to bound ε from 2·sin(π/12) bounds. -/ lemma sin_pi_12_lt_half : Real.sin (Real.pi / 12) < 1 / 2 := calc Real.sin (Real.pi / 12) < Real.sin (Real.pi / 6) := - Real.sin_lt_sin_of_lt_of_le_pi_div_two (by nlinarith [Real.pi_pos]) - (by nlinarith [Real.pi_pos]) (by nlinarith [Real.pi_pos]) + Real.sin_lt_sin_of_lt_of_le_pi_div_two (by nlinarith only [Real.pi_pos]) + (by nlinarith only [Real.pi_pos]) (by nlinarith only [Real.pi_pos]) _ = 1 / 2 := Real.sin_pi_div_six /-- `sin(π/12) > 0`. -/ lemma sin_pi_12_pos : 0 < Real.sin (Real.pi / 12) := - ArcCalculus.sin_pos_of_mem_Ioo_zero_pi (by constructor <;> nlinarith [Real.pi_pos]) + ArcCalculus.sin_pos_of_mem_Ioo_zero_pi (by constructor <;> nlinarith only [Real.pi_pos]) /-- `arcsin(ε/2) < π/12` whenever `0 < ε < 2·sin(π/12)`. -/ lemma arcsin_eps_div_two_lt_pi_12 {ε : ℝ} (hε_pos : 0 < ε) (hε_lt_2sin : ε < 2 * Real.sin (Real.pi / 12)) : Real.arcsin (ε / 2) < Real.pi / 12 := calc Real.arcsin (ε / 2) < Real.arcsin (Real.sin (Real.pi / 12)) := - Real.arcsin_lt_arcsin (by linarith) (by linarith) (Real.sin_le_one _) - _ = Real.pi / 12 := Real.arcsin_sin (by nlinarith [Real.pi_pos]) (by nlinarith [Real.pi_pos]) + Real.arcsin_lt_arcsin (by linarith only [hε_pos]) + (by linarith only [hε_lt_2sin]) (Real.sin_le_one _) + _ = Real.pi / 12 := Real.arcsin_sin (by nlinarith only [Real.pi_pos]) (by + nlinarith only [Real.pi_pos]) end diff --git a/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/I.lean b/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/I.lean index 9bb4d0fc33..73ebd35faa 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/I.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/I.lean @@ -48,14 +48,14 @@ private lemma cos_delta_pi_six_sub_one_factor (δ : ℝ) : Real.cos (δ * Real.pi / 6) - 1 = -(2 * Real.sin (δ * Real.pi / 12) * Real.sin (δ * Real.pi / 12)) := by rw [show δ * Real.pi / 6 = 2 * (δ * Real.pi / 12) from by ring, Real.cos_two_mul] - nlinarith [Real.sin_sq_add_cos_sq (δ * Real.pi / 12)] + nlinarith only [Real.sin_sq_add_cos_sq (δ * Real.pi / 12)] /-- Half-angle factorization of the boundary displacement from `i`. -/ private lemma g_i_factor {δ : ℝ} (hδ_lower : -1 < δ) (hδ_upper : δ < 1) : fdBoundaryH H (2 - δ) - I = (2 * Real.sin (δ * Real.pi / 12)) • Complex.exp (↑(-(δ * Real.pi / 12)) * I) := by - have h1 : 1 < 2 - δ := by linarith - have h3 : 2 - δ < 3 := by linarith + have h1 : 1 < 2 - δ := by linarith only [hδ_upper] + have h3 : 2 - δ < 3 := by linarith only [hδ_lower] rw [fdBoundary_H_eq_arc h1 h3, exp_real_angle_I] set θ := Real.pi / 2 - δ * Real.pi / 6 with hθ_def rw [show Real.pi * (1 + (2 - δ)) / 6 = θ from by simp only [hθ_def]; ring] @@ -77,7 +77,7 @@ private lemma g_i_factor_right {δ : ℝ} (hδ : 0 < δ) (hδ1 : δ < 1) : fdBoundaryH H (2 + δ) - I = -(2 * Real.sin (δ * Real.pi / 12)) • Complex.exp (↑(δ * Real.pi / 12) * I) := by simpa only [sub_neg_eq_add, neg_mul, neg_div, Real.sin_neg, neg_neg, mul_neg] using - (g_i_factor (H := H) (δ := -δ) (by linarith) (by linarith)) + (g_i_factor (H := H) (δ := -δ) (by linarith only [hδ1]) (by linarith only [hδ])) private lemma sin_i_half_angle_pos {δ : ℝ} (hδ : 0 < δ) (hδ1 : δ < 1) : 0 < Real.sin (δ * Real.pi / 12) := @@ -86,7 +86,7 @@ private lemma sin_i_half_angle_pos {δ : ℝ} (hδ : 0 < δ) (hδ1 : δ < 1) : private lemma arg_approach_i_left (hδ : 0 < δ) (hδ_small : δ < 1) : (fdBoundaryH H (2 - δ) - I).arg = -(δ * Real.pi / 12) := by - rw [g_i_factor (by linarith) hδ_small, Complex.real_smul, exp_real_angle_I, + rw [g_i_factor (by linarith only [hδ]) hδ_small, Complex.real_smul, exp_real_angle_I, Complex.ofReal_cos, Complex.ofReal_sin] exact Complex.arg_mul_cos_add_sin_mul_I (mul_pos (by norm_num : (0 : ℝ) < 2) (sin_i_half_angle_pos hδ hδ_small)) @@ -114,7 +114,7 @@ private lemma arg_approach_i_right (hδ : 0 < δ) (hδ_small : δ < 1) : private lemma g_i_norm_left {δ : ℝ} (hδ : 0 < δ) (hδ1 : δ < 1) : ‖fdBoundaryH H (2 - δ) - I‖ = 2 * Real.sin (δ * Real.pi / 12) := by - rw [g_i_factor (by linarith) hδ1, norm_smul, Complex.norm_exp_ofReal_mul_I, + rw [g_i_factor (by linarith only [hδ]) hδ1, norm_smul, Complex.norm_exp_ofReal_mul_I, mul_one, Real.norm_of_nonneg (mul_nonneg (by norm_num) (sin_i_half_angle_pos hδ hδ1).le)] private lemma g_i_norm_right {δ : ℝ} (hδ : 0 < δ) (hδ1 : δ < 1) : @@ -126,7 +126,11 @@ private lemma g_i_norm_ge_seg0 {t : ℝ} (_ht0 : 0 ≤ t) (ht1 : t ≤ 1) : 1 / 2 ≤ ‖fdBoundaryH H t - I‖ := by have hre : (fdBoundaryH H t - I).re = 1 / 2 := by rw [fdBoundary_H_seg0 H ht1] - simp_all + simp_all only [one_div, sub_re, add_re, inv_re, re_ofNat, normSq_ofNat, div_self_mul_self', + mul_re, ofReal_re, + div_ofNat_re, ofReal_im, sub_im, div_ofNat_im, zero_div, sub_self, mul_zero, sub_zero, + I_re, mul_im, zero_mul, + add_zero, I_im, mul_one] calc (1 : ℝ) / 2 = |1 / 2| := (abs_of_pos (by norm_num)).symm _ = |(fdBoundaryH H t - I).re| := by rw [hre] _ ≤ ‖fdBoundaryH H t - I‖ := Complex.abs_re_le_norm _ @@ -136,10 +140,17 @@ private lemma g_i_norm_ge_seg4 (H : ℝ) (hH : 1 < H) {t : ℝ} (ht4 : 4 ≤ t) have him : (fdBoundaryH H t - I).im = H - 1 := by rcases eq_or_lt_of_le ht4 with rfl | ht4' · rw [fdBoundary_H_at_four H] - simp_all - · rw [fdBoundary_H_seg4 H (by linarith) (by linarith) (by linarith) (by linarith)] - simp_all - calc H - 1 = |H - 1| := (abs_of_pos (by linarith)).symm + simp_all only [Std.le_refl, sub_im, add_im, div_ofNat_im, neg_im, one_im, neg_zero, + zero_div, mul_im, + ofReal_re, I_im, mul_one, ofReal_im, I_re, mul_zero, add_zero, zero_add] + · rw [fdBoundary_H_seg4 H (by linarith only [ht4]) + (by linarith only [ht4]) + (by linarith only [ht4]) + (by linarith only [ht4'])] + simp_all only [sub_im, add_im, ofReal_im, div_ofNat_im, im_ofNat, zero_div, sub_self, + mul_im, ofReal_re, I_im, + mul_one, I_re, mul_zero, add_zero, zero_add] + calc H - 1 = |H - 1| := (abs_of_pos (by linarith only [hH])).symm _ = |(fdBoundaryH H t - I).im| := by rw [him] _ ≤ ‖fdBoundaryH H t - I‖ := Complex.abs_im_le_norm _ @@ -148,8 +159,12 @@ private lemma g_i_slitPlane_left {t : ℝ} (_ht0 : 0 ≤ t) (ht2 : t < 2) : rw [Complex.mem_slitPlane_iff]; left rcases le_or_gt t 1 with ht1 | ht1 · rw [fdBoundary_H_seg0 H ht1] - simp_all - · rw [fdBoundary_H_seg1 H (by linarith) (by linarith)] + simp_all only [one_div, sub_re, add_re, inv_re, re_ofNat, normSq_ofNat, div_self_mul_self', + mul_re, ofReal_re, + div_ofNat_re, ofReal_im, sub_im, div_ofNat_im, zero_div, sub_self, mul_zero, sub_zero, + I_re, mul_im, zero_mul, + add_zero, I_im, mul_one, inv_pos, Nat.ofNat_pos] + · rw [fdBoundary_H_seg1 H (by linarith only [ht1]) (by linarith only [ht2])] set θ := Real.pi / 3 + (t - 1) * (Real.pi / 2 - Real.pi / 3) with hθ_def rw [show (↑Real.pi / 3 + (↑t - 1) * (↑Real.pi / 2 - ↑Real.pi / 3)) * I = (↑θ : ℂ) * I from by simp only [hθ_def]; push_cast; ring, exp_real_angle_I] @@ -158,18 +173,22 @@ private lemma g_i_slitPlane_left {t : ℝ} (_ht0 : 0 ≤ t) (ht2 : t < 2) : mul_one] apply Real.cos_pos_of_mem_Ioo constructor - · simp only [hθ_def]; nlinarith [Real.pi_pos] - · simp only [hθ_def]; nlinarith [Real.pi_pos] + · simp only [hθ_def]; nlinarith only [_ht0, Real.pi_pos] + · simp only [hθ_def]; nlinarith only [ht2, Real.pi_pos] private lemma g_i_seg3_value {t : ℝ} (ht3 : 3 < t) (ht4 : t ≤ 4) : fdBoundaryH H t - I = -1/2 + ↑(Real.sqrt 3 / 2 - 1 + (t - 3) * (H - Real.sqrt 3 / 2)) * I := by - rw [fdBoundary_H_seg3 H (by linarith) (by linarith) (by linarith) ht4] + rw [fdBoundary_H_seg3 H (by linarith only [ht3]) + (by linarith only [ht3]) + (by linarith only [ht3]) ht4] push_cast; ring private lemma g_i_seg4_value {t : ℝ} (ht4 : 4 < t) : fdBoundaryH H t - I = ↑(t - 9/2) + ↑(H - 1) * I := by - rw [fdBoundary_H_seg4 H (by linarith) (by linarith) (by linarith) (by linarith)] + rw [fdBoundary_H_seg4 H (by linarith only [ht4]) (by linarith only [ht4]) (by + linarith only [ht4]) (by + linarith only [ht4])] push_cast; ring private lemma g_i_norm_ge_seg3 {t : ℝ} (ht3 : 3 ≤ t) (ht4 : t ≤ 4) : @@ -183,7 +202,11 @@ private lemma g_i_norm_ge_seg3 {t : ℝ} (ht3 : 3 ≤ t) (ht4 : t ≤ 4) : Complex.I_re, Complex.I_im, mul_zero, sub_zero] norm_num · rw [g_i_seg3_value ht3' ht4] - simp_all + simp_all only [ofReal_add, ofReal_sub, ofReal_div, ofReal_ofNat, ofReal_one, ofReal_mul, + add_re, div_ofNat_re, + neg_re, one_re, mul_re, sub_re, ofReal_re, re_ofNat, sub_im, ofReal_im, im_ofNat, + sub_self, div_ofNat_im, zero_div, + mul_zero, sub_zero, I_re, add_im, one_im, mul_im, zero_mul, add_zero, I_im, mul_one] calc 1 / 2 = |(-1 : ℝ) / 2| := by norm_num _ = |(fdBoundaryH H t - I).re| := by rw [hre] _ ≤ ‖fdBoundaryH H t - I‖ := Complex.abs_re_le_norm _ @@ -197,29 +220,30 @@ private lemma g_i_slitPlane_arc_right {t : ℝ} (ht2 : 2 < t) (ht3 : t ≤ 3) : Complex.add_im, Complex.sub_im, Complex.neg_im, Complex.div_ofNat_im, Complex.div_ofNat_re, Complex.one_im, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_zero, add_zero, mul_one, zero_div] - nlinarith [Real.sq_sqrt (show (3 : ℝ) ≥ 0 by norm_num), sq_nonneg (2 - Real.sqrt 3)] - · rw [fdBoundary_H_eq_arc (by linarith) ht3', exp_real_angle_I] + nlinarith only [Real.sq_sqrt (show (3 : ℝ) ≥ 0 by norm_num), sq_nonneg (2 - Real.sqrt 3)] + · rw [fdBoundary_H_eq_arc (by linarith only [ht2]) ht3', exp_real_angle_I] simp only [Complex.add_im, Complex.sub_im, Complex.ofReal_im, Complex.mul_im, Complex.ofReal_re, Complex.I_re, Complex.I_im, mul_zero, add_zero, mul_one, zero_add] - have hθ_bound : Real.pi / 2 < Real.pi * (1 + t) / 6 := by nlinarith [Real.pi_pos] - have hθ_bound2 : Real.pi * (1 + t) / 6 < Real.pi + Real.pi / 2 := by nlinarith [Real.pi_pos] + have hθ_bound : Real.pi / 2 < Real.pi * (1 + t) / 6 := by nlinarith only [ht2, Real.pi_pos] + have hθ_bound2 : Real.pi * (1 + t) / 6 < Real.pi + Real.pi / 2 := by + nlinarith only [ht2, ht3, hθ_bound, Real.pi_pos] have h_cos_neg := Real.cos_neg_of_pi_div_two_lt_of_lt hθ_bound hθ_bound2 have h_sin_lt : Real.sin (Real.pi * (1 + t) / 6) < 1 := by by_contra h_ge; push Not at h_ge have h_eq := le_antisymm (Real.sin_le_one _) h_ge have : Real.cos (Real.pi * (1 + t) / 6) = 0 := by - nlinarith [Real.sin_sq_add_cos_sq (Real.pi * (1 + t) / 6)] - linarith - linarith + nlinarith only [h_cos_neg, h_ge, Real.sin_sq_add_cos_sq (Real.pi * (1 + t) / 6)] + linarith only [h_cos_neg, this] + linarith only [h_sin_lt] private lemma g_i_norm_arc_right {t : ℝ} (ht2 : 2 < t) (ht3 : t < 3) : ‖fdBoundaryH H t - I‖ = 2 * Real.sin ((t - 2) * Real.pi / 12) := by - have h := g_i_norm_right (H := H) (δ := t - 2) (by linarith) (by linarith) + have h := g_i_norm_right (H := H) (δ := t - 2) (by linarith only [ht2]) (by linarith only [ht3]) rwa [show 2 + (t - 2) = t from by ring] at h private lemma g_i_norm_arc_left {t : ℝ} (ht1 : 1 < t) (ht2 : t < 2) : ‖fdBoundaryH H t - I‖ = 2 * Real.sin ((2 - t) * Real.pi / 12) := by - have h := g_i_norm_left (H := H) (δ := 2 - t) (by linarith) (by linarith) + have h := g_i_norm_left (H := H) (δ := 2 - t) (by linarith only [ht2]) (by linarith only [ht1]) rwa [show 2 - (2 - t) = t from by ring] at h private noncomputable def t₀_i (H : ℝ) : ℝ := @@ -227,20 +251,21 @@ private noncomputable def t₀_i (H : ℝ) : ℝ := private lemma H_sub_sqrt3_div2_pos (hH : 1 < H) : 0 < H - Real.sqrt 3 / 2 := have := Real.sq_sqrt (show (3 : ℝ) ≥ 0 by norm_num) - by nlinarith [sq_nonneg (2 - Real.sqrt 3)] + by nlinarith only [hH, this, sq_nonneg (2 - Real.sqrt 3)] private lemma t₀_i_gt_three (hH : 1 < H) : 3 < t₀_i H := by unfold t₀_i have h_num_pos : 0 < 1 - Real.sqrt 3 / 2 := - by nlinarith [Real.sq_sqrt (show (3 : ℝ) ≥ 0 by norm_num), sq_nonneg (2 - Real.sqrt 3)] - linarith [div_pos h_num_pos (H_sub_sqrt3_div2_pos hH)] + by nlinarith only [Real.sq_sqrt (show (3 : ℝ) ≥ 0 by norm_num), sq_nonneg (2 - Real.sqrt 3)] + linarith only [hH, h_num_pos, div_pos h_num_pos (H_sub_sqrt3_div2_pos hH)] private lemma t₀_i_lt_four (hH : 1 < H) : t₀_i H < 4 := by unfold t₀_i have h_den_pos := H_sub_sqrt3_div2_pos hH rw [show (4 : ℝ) = 3 + 1 from by ring] - have : (1 - Real.sqrt 3 / 2) / (H - Real.sqrt 3 / 2) < 1 := by rw [div_lt_one h_den_pos]; linarith - linarith + have : (1 - Real.sqrt 3 / 2) / (H - Real.sqrt 3 / 2) < 1 := by + rw [div_lt_one h_den_pos]; linarith only [hH] + linarith only [this] private lemma t₀_i_im_eq_zero (hH : 1 < H) : Real.sqrt 3 / 2 - 1 + (t₀_i H - 3) * (H - Real.sqrt 3 / 2) = 0 := by @@ -254,26 +279,26 @@ private lemma g_i_at_t₀ (hH : 1 < H) : fdBoundaryH H (t₀_i H) - I = -1/2 := by have ht₀3 := t₀_i_gt_three hH have ht₀4 := t₀_i_lt_four hH - rw [g_i_seg3_value (by linarith) (by linarith), t₀_i_im_eq_zero hH] + rw [g_i_seg3_value (by linarith only [ht₀3]) (by linarith only [ht₀4]), t₀_i_im_eq_zero hH] simp only [ofReal_zero, zero_mul, add_zero] private lemma g_i_seg3_im_neg {t : ℝ} (ht3 : 3 < t) (ht_t0 : t < t₀_i H) (hH : 1 < H) : (fdBoundaryH H t - I).im < 0 := by - rw [g_i_seg3_value ht3 (by linarith [t₀_i_lt_four hH])] + rw [g_i_seg3_value ht3 (by linarith only [ht_t0, hH, t₀_i_lt_four hH])] simp only [Complex.add_im, Complex.neg_im, Complex.div_ofNat_im, Complex.one_im, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_zero, add_zero, mul_one] norm_num - nlinarith [H_sub_sqrt3_div2_pos hH, t₀_i_im_eq_zero hH] + nlinarith only [ht_t0, hH, H_sub_sqrt3_div2_pos hH, t₀_i_im_eq_zero hH] private lemma g_i_seg3_im_pos {t : ℝ} (ht_t0 : t₀_i H < t) (ht4 : t ≤ 4) (hH : 1 < H) : 0 < (fdBoundaryH H t - I).im := by - rw [g_i_seg3_value (by linarith [t₀_i_gt_three hH]) ht4] + rw [g_i_seg3_value (by linarith only [ht_t0, hH, t₀_i_gt_three hH]) ht4] simp only [Complex.add_im, Complex.neg_im, Complex.div_ofNat_im, Complex.one_im, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_zero, add_zero, mul_one] norm_num - nlinarith [H_sub_sqrt3_div2_pos hH, t₀_i_im_eq_zero hH] + nlinarith only [ht_t0, hH, H_sub_sqrt3_div2_pos hH, t₀_i_im_eq_zero hH] private lemma g_i_ne_zero_seg3 {t : ℝ} (ht3 : 3 ≤ t) (ht4 : t ≤ 4) : fdBoundaryH H t - I ≠ 0 := by @@ -287,7 +312,13 @@ private lemma g_i_ne_zero_seg3 {t : ℝ} (ht3 : 3 ≤ t) (ht4 : t ≤ 4) : Complex.I_re, Complex.I_im, mul_zero, sub_zero] at this norm_num at this · rw [g_i_seg3_value ht3' ht4] at this - simp_all + simp_all only [ofReal_add, ofReal_sub, ofReal_div, ofReal_ofNat, ofReal_one, ofReal_mul, + add_re, div_ofNat_re, + neg_re, one_re, mul_re, sub_re, ofReal_re, re_ofNat, sub_im, ofReal_im, im_ofNat, sub_self, + div_ofNat_im, zero_div, + mul_zero, sub_zero, I_re, add_im, one_im, mul_im, zero_mul, add_zero, I_im, mul_one, + div_eq_zero_iff, neg_eq_zero, + one_ne_zero, OfNat.ofNat_ne_zero, or_self] private lemma log_neg_eq_add_pi_I {z : ℂ} (_hz_ne : z ≠ 0) (hz_im : z.im < 0) : Complex.log (-z) = Complex.log z + ↑Real.pi * I := by @@ -331,7 +362,7 @@ private lemma h2_at_three_im_neg (H : ℝ) : simp only [Complex.add_im, Complex.neg_im, Complex.div_ofNat_im, Complex.one_im, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, mul_zero, add_zero, mul_one] - nlinarith [Real.sq_sqrt (show (3 : ℝ) ≥ 0 by norm_num), sq_nonneg (2 - Real.sqrt 3)] + nlinarith only [Real.sq_sqrt (show (3 : ℝ) ≥ 0 by norm_num), sq_nonneg (2 - Real.sqrt 3)] /-- On an open interval where `g` and `h` agree, both the values and the derivatives match. -/ private lemma eq_and_deriv_eq_on_Ioo {g h : ℝ → ℂ} {a b t : ℝ} (ht : t ∈ Ioo a b) @@ -607,7 +638,7 @@ private lemma i_h_far (H : ℝ) (hH : 1 < H) : ε < ‖fdBoundaryH H t - I‖ := by intro threshold ε hε_pos hε_lt t ht_mem h_abs have hpi_pos : 0 < Real.pi := Real.pi_pos - have hH1_pos : 0 < H - 1 := by linarith + have hH1_pos : 0 < H - 1 := by linarith only [hH] have hsin_pos : 0 < Real.sin (Real.pi / 12) := sin_pi_12_pos have h2sin_pos : 0 < 2 * Real.sin (Real.pi / 12) := by positivity have hε_lt_half : ε < 1/2 := lt_of_lt_of_le hε_lt @@ -617,9 +648,9 @@ private lemma i_h_far (H : ℝ) (hH : 1 < H) : have hε_lt_2sin : ε < 2 * Real.sin (Real.pi / 12) := lt_of_lt_of_le hε_lt (le_trans (min_le_left _ _) (min_le_right _ _)) have hε_lt_one : ε < 1 := lt_of_lt_of_le hε_lt (min_le_right _ _) - have hε_half_pos : 0 < ε / 2 := by linarith - have hε_half_le : ε / 2 ≤ 1 := by linarith - have hε_half_neg : -1 ≤ ε / 2 := by linarith + have hε_half_pos : 0 < ε / 2 := by linarith only [hε_pos] + have hε_half_le : ε / 2 ≤ 1 := by linarith only [hε_lt_half] + have hε_half_neg : -1 ≤ ε / 2 := by linarith only [hε_pos, hε_lt_half] have harcsin_pos : 0 < Real.arcsin (ε / 2) := Real.arcsin_pos.mpr hε_half_pos set δ := 12 / Real.pi * Real.arcsin (ε / 2) with hδ_def have hδ_pos : 0 < δ := by rw [hδ_def]; positivity @@ -627,10 +658,10 @@ private lemma i_h_far (H : ℝ) (hH : 1 < H) : have hδ_angle : δ * Real.pi / 12 = Real.arcsin (ε / 2) := by rw [hδ_def]; field_simp have h_norm_L : ‖fdBoundaryH H (2 - δ) - I‖ = ε := by rw [g_i_norm_left hδ_pos hδ_lt_one, hδ_angle, - Real.sin_arcsin hε_half_neg hε_half_le]; linarith + Real.sin_arcsin hε_half_neg hε_half_le]; linarith only [] have h_norm_R : ‖fdBoundaryH H (2 + δ) - I‖ = ε := by rw [g_i_norm_right hδ_pos hδ_lt_one, hδ_angle, - Real.sin_arcsin hε_half_neg hε_half_le]; linarith + Real.sin_arcsin hε_half_neg hε_half_le]; linarith only [] -- h_abs : δ < |t - 2|, so t < 2 - δ or t > 2 + δ rcases lt_or_ge t (2 - δ) with h_left | h_right · -- t < 2 - δ: use left norm bounds @@ -638,25 +669,25 @@ private lemma i_h_far (H : ℝ) (hH : 1 < H) : · calc ε < 1 / 2 := hε_lt_half _ ≤ ‖fdBoundaryH H t - I‖ := g_i_norm_ge_seg0 ht_mem.1 ht1 · change ε < ‖fdBoundaryH H t - I‖ - rw [g_i_norm_arc_left ht1 (by linarith)] + rw [g_i_norm_arc_left ht1 (by linarith only [hδ_pos, h_left])] rw [← h_norm_L, g_i_norm_left hδ_pos hδ_lt_one] exact strictMonoOn_i_chordLength ⟨hδ_pos.le, hδ_lt_one.le⟩ - ⟨by linarith, by linarith⟩ (by linarith) + ⟨by linarith only [hδ_pos, h_left], by linarith only [ht1]⟩ (by linarith only [h_left]) · -- t ≥ 2 - δ and δ < |t - 2|, so t > 2 + δ have h_gt : 2 + δ < t := by rcases le_or_gt (2 : ℝ) t with h2 | h2 · -- t ≥ 2: |t - 2| = t - 2 > δ - rw [abs_of_nonneg (by linarith)] at h_abs - linarith + rw [abs_of_nonneg (by linarith only [h2])] at h_abs + linarith only [h_abs] · -- t < 2: |t - 2| = 2 - t, but 2 - t < δ from h_right, contradiction - rw [abs_of_neg (by linarith)] at h_abs - linarith + rw [abs_of_neg (by linarith only [h2])] at h_abs + linarith only [h_abs, h_right] rcases lt_or_ge t 3 with ht3 | ht3 · change ε < ‖fdBoundaryH H t - I‖ - rw [g_i_norm_arc_right (by linarith) ht3] + rw [g_i_norm_arc_right (by linarith only [hδ_pos, h_gt]) ht3] rw [← h_norm_R, g_i_norm_right hδ_pos hδ_lt_one] exact strictMonoOn_i_chordLength ⟨hδ_pos.le, hδ_lt_one.le⟩ - ⟨by linarith, by linarith⟩ (by linarith) + ⟨by linarith only [hδ_pos, h_gt], by linarith only [ht3]⟩ (by linarith only [h_gt]) · rcases le_or_gt t 4 with ht4 | ht4 · calc ε < 1 / 2 := hε_lt_half _ ≤ ‖fdBoundaryH H t - I‖ := g_i_norm_ge_seg3 ht3 ht4 @@ -671,10 +702,10 @@ private lemma i_h_near (H : ℝ) : ‖fdBoundaryH H t - I‖ ≤ ε := by intro threshold ε hε_pos hε_lt t h_abs have hpi_pos : 0 < Real.pi := Real.pi_pos - have hε_half_pos : 0 < ε / 2 := by linarith + have hε_half_pos : 0 < ε / 2 := by linarith only [hε_pos] have hε_lt_one : ε < 1 := lt_of_lt_of_le hε_lt (min_le_right _ _) - have hε_half_le : ε / 2 ≤ 1 := by linarith - have hε_half_neg : -1 ≤ ε / 2 := by linarith + have hε_half_le : ε / 2 ≤ 1 := by linarith only [hε_pos, hε_lt_one] + have hε_half_neg : -1 ≤ ε / 2 := by linarith only [hε_pos, hε_lt_one] have hε_lt_2sin : ε < 2 * Real.sin (Real.pi / 12) := lt_of_lt_of_le hε_lt (le_trans (min_le_left _ _) (min_le_right _ _)) have harcsin_pos : 0 < Real.arcsin (ε / 2) := Real.arcsin_pos.mpr hε_half_pos @@ -688,22 +719,24 @@ private lemma i_h_near (H : ℝ) : rcases le_or_gt t 2 with ht2 | ht2 · rcases eq_or_lt_of_le ht2 with rfl | ht2' · rw [fdBoundary_H_at_two_eq_I, sub_self, norm_zero]; exact le_of_lt hε_pos - · have ht1 : 1 < t := by linarith [h_abs.1] + · have ht1 : 1 < t := by linarith only [h_abs, hδ_lt_one, h_abs.1] rw [g_i_norm_arc_left ht1 ht2'] - have h2t_le : 2 - t ≤ δ := by linarith [h_abs.1] + have h2t_le : 2 - t ≤ δ := by linarith only [h_abs, h_abs.1] calc 2 * Real.sin ((2 - t) * Real.pi / 12) ≤ 2 * Real.sin (δ * Real.pi / 12) := - strictMonoOn_i_chordLength.monotoneOn ⟨by linarith, by linarith⟩ + strictMonoOn_i_chordLength.monotoneOn ⟨by linarith only [ht2], by + linarith only [h_abs, hδ_lt_one]⟩ ⟨hδ_pos.le, hδ_lt_one.le⟩ h2t_le - _ = ε := by rw [hδ_angle, Real.sin_arcsin hε_half_neg hε_half_le]; linarith - · have ht3 : t < 3 := by linarith [h_abs.2] + _ = ε := by rw [hδ_angle, Real.sin_arcsin hε_half_neg hε_half_le]; linarith only [] + · have ht3 : t < 3 := by linarith only [h_abs, hδ_lt_one, h_abs.2] rw [g_i_norm_arc_right ht2 ht3] - have ht2_le : t - 2 ≤ δ := by linarith [h_abs.2] + have ht2_le : t - 2 ≤ δ := by linarith only [h_abs, h_abs.2] calc 2 * Real.sin ((t - 2) * Real.pi / 12) ≤ 2 * Real.sin (δ * Real.pi / 12) := - strictMonoOn_i_chordLength.monotoneOn ⟨by linarith, by linarith⟩ + strictMonoOn_i_chordLength.monotoneOn ⟨by linarith only [ht2], by + linarith only [h_abs, hδ_lt_one]⟩ ⟨hδ_pos.le, hδ_lt_one.le⟩ ht2_le - _ = ε := by rw [hδ_angle, Real.sin_arcsin hε_half_neg hε_half_le]; linarith + _ = ε := by rw [hδ_angle, Real.sin_arcsin hε_half_neg hε_half_le]; linarith only [] private lemma i_angle_bound {δ ε : ℝ} (H : ℝ) (hδ_pos : 0 < δ) (hδ_lt_one : δ < 1) @@ -711,13 +744,14 @@ private lemma i_angle_bound {δ ε : ℝ} (H : ℝ) δ * Real.pi / 12 < ε := by set x := δ * Real.pi / 12 with hx_def have hx_pos : 0 < x := by positivity - have hx_le_one : x ≤ 1 := by nlinarith [Real.pi_le_four] + have hx_le_one : x ≤ 1 := by nlinarith only [hδ_pos, hδ_lt_one, hx_def, Real.pi_le_four] have h_sin_lb := Real.sin_gt_sub_cube hx_pos - have h_lb : x - x ^ 3 / 4 > x / 2 := by nlinarith [sq_nonneg x, sq_nonneg (1 - x)] + have h_lb : x - x ^ 3 / 4 > x / 2 := by + nlinarith only [hx_pos, hx_le_one, sq_nonneg x, sq_nonneg (1 - x)] have h_norm_is_2sin : 2 * Real.sin x = ε := by rw [hx_def] - linarith [g_i_norm_left (H := H) hδ_pos hδ_lt_one] - linarith + linarith only [hδ_pos, hδ_lt_one, h_norm_L, g_i_norm_left (H := H) hδ_pos hδ_lt_one] + linarith only [hx_pos, h_sin_lb, h_lb, h_norm_is_2sin] -- Helper: integrability and FTC for the i-crossing, with integrand already in the -- form expected by pv_tendsto_of_crossing_limit (i.e. (γ t - I)⁻¹ * deriv γ t). @@ -734,7 +768,7 @@ private lemma i_ftc_integrability (H : ℝ) (hH : 1 < H) {ε : ℝ} Complex.log (fdBoundaryH H (2 + δ) - I) - 2 * ↑Real.pi * I) := by intro δ have hpi_pos : 0 < Real.pi := Real.pi_pos - have hε_half_pos : 0 < ε / 2 := by linarith + have hε_half_pos : 0 < ε / 2 := by linarith only [hε_pos] have harcsin_pos : 0 < Real.arcsin (ε / 2) := Real.arcsin_pos.mpr hε_half_pos have hδ_pos : 0 < δ := mul_pos (div_pos (by norm_num) hpi_pos) harcsin_pos have hδ_lt_one : δ < 1 := i_delta_lt_one hε_pos hε_lt_2sin @@ -744,7 +778,8 @@ private lemma i_ftc_integrability (H : ℝ) (hH : 1 < H) {ε : ℝ} have hd : deriv (fun s => fdBoundaryH H s - I) t = deriv (fdBoundaryH H) t := deriv_sub_const (f := fdBoundaryH H) _ rw [hd, div_eq_mul_inv, mul_comm] - simp_all + simp_all only [div_pos_iff_of_pos_left, Nat.ofNat_pos, Real.arcsin_pos, deriv_sub_const_fun, + and_self] -- Helper: the log-difference E(ε) tends to -(I·π). private lemma i_E_tendsto (H : ℝ) (_ : 1 < H) (threshold : ℝ) (hthresh_pos : 0 < threshold) @@ -766,7 +801,7 @@ private lemma i_E_tendsto (H : ℝ) (_ : 1 < H) (threshold : ℝ) (hthresh_pos : have hε_lt : ε < threshold := hε_dist.trans_le (min_le_left _ _) have hε_lt_r2 : ε < r / 2 := hε_dist.trans_le (min_le_right _ _) have hε_lt_2sin : ε < 2 * Real.sin (Real.pi / 12) := lt_of_lt_of_le hε_lt hthresh_le_2sin - have hε_half_neg : -1 ≤ ε / 2 := by linarith + have hε_half_neg : -1 ≤ ε / 2 := by linarith only [hε_pos] have hε_half_le : ε / 2 ≤ 1 := by linarith [lt_of_lt_of_le hε_lt hthresh_le_one] have hε_half_pos : 0 < ε / 2 := by linarith have harcsin_pos : 0 < Real.arcsin (ε / 2) := Real.arcsin_pos.mpr hε_half_pos @@ -819,7 +854,7 @@ theorem pv_integral_at_i_tendsto (H : ℝ) (hH : 1 < H) : deriv (fun s => fdBoundaryH H s - I) t else 0) (𝓝[>] 0) (𝓝 (-(I * ↑Real.pi))) := by have hpi_pos : 0 < Real.pi := Real.pi_pos - have hH1_pos : 0 < H - 1 := by linarith + have hH1_pos : 0 < H - 1 := by linarith only [hH] have hsin_pos : 0 < Real.sin (Real.pi / 12) := sin_pi_12_pos have h2sin_pos : 0 < 2 * Real.sin (Real.pi / 12) := by positivity set threshold := min (min (min (1/2 : ℝ) (H - 1)) (2 * Real.sin (Real.pi / 12))) 1 @@ -832,19 +867,24 @@ theorem pv_integral_at_i_tendsto (H : ℝ) (hH : 1 < H) : -- δ(ε) = 12/π * arcsin(ε/2) have hδ_pos : ∀ ε, 0 < ε → ε < threshold → 0 < 12 / Real.pi * Real.arcsin (ε / 2) := fun ε hε _ => mul_pos (div_pos (by norm_num) hpi_pos) - (Real.arcsin_pos.mpr (by linarith)) + (Real.arcsin_pos.mpr (by linarith only [hε])) have hδ_small : ∀ ε, 0 < ε → ε < threshold → 12 / Real.pi * Real.arcsin (ε / 2) < min (2 - 0) (5 - 2) := by intro ε hε_pos hε_lt have hδ1 := i_delta_lt_one hε_pos (lt_of_lt_of_le hε_lt hthresh_le_2sin) - simp only [sub_zero]; exact lt_min (by linarith) (by linarith) + simp only [sub_zero]; exact lt_min (by linarith only [hthresh_le_one, hε_pos, hε_lt, hδ1]) (by + linarith only [hthresh_le_one, hε_pos, hε_lt, hδ1]) -- reduce to the form without deriv (fun s => ...) suffices h : Tendsto (fun ε => ∫ t in (0 : ℝ)..5, if ‖fdBoundaryH H t - I‖ > ε then (fdBoundaryH H t - I)⁻¹ * deriv (fdBoundaryH H) t else 0) (𝓝[>] 0) (𝓝 (-(I * ↑Real.pi))) by - simp_all + simp_all only [sub_pos, Nat.ofNat_pos, mul_pos_iff_of_pos_left, one_div, lt_min_iff, inv_pos, + and_self, + zero_lt_one, min_le_iff, tsub_le_iff_right, Std.le_refl, or_true, true_or, + div_pos_iff_of_pos_left, Real.arcsin_pos, + implies_true, sub_zero, and_imp, gt_iff_lt, deriv_sub_const_fun] apply ContourIntegral.pv_tendsto_of_crossing_limit (t₀ := 2) (ht₀ := by norm_num) (threshold := threshold) (hthresh := hthresh_pos) diff --git a/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/Rho.lean b/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/Rho.lean index 4af904e45e..bd65ec506b 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/Rho.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/Rho.lean @@ -59,7 +59,7 @@ private lemma rho_diff_factor (δ : ℝ) : rw [show (Real.pi / 6 - (Real.pi / 6 - δ * Real.pi / 6)) / 2 = δ * Real.pi / 12 from by ring, show (Real.pi / 6 + (Real.pi / 6 - δ * Real.pi / 6)) / 2 = Real.pi / 6 - δ * Real.pi / 12 from by ring] at h - linarith [Real.sin_pi_div_six] + linarith only [h, Real.sin_pi_div_six] have h_im : Real.cos (Real.pi / 6 - δ * Real.pi / 6) - Real.sqrt 3 / 2 = 2 * Real.sin (δ * Real.pi / 12) * Real.sin (Real.pi / 6 - δ * Real.pi / 12) := by have h := Real.cos_sub_cos (Real.pi / 6 - δ * Real.pi / 6) (Real.pi / 6) @@ -67,18 +67,18 @@ private lemma rho_diff_factor (δ : ℝ) : from by ring, show (Real.pi / 6 - δ * Real.pi / 6 - Real.pi / 6) / 2 = -(δ * Real.pi / 12) from by ring, Real.sin_neg] at h - nlinarith [Real.cos_pi_div_six, + nlinarith only [h, Real.cos_pi_div_six, mul_comm (Real.sin (Real.pi / 6 - δ * Real.pi / 12)) (Real.sin (δ * Real.pi / 12))] rw [h_cos_shift, h_sin_shift] apply Complex.ext · simp only [add_re, sub_re, mul_re, neg_re, ofReal_re, ofReal_im, I_re, I_im, one_re, div_ofNat_re, div_ofNat_im, mul_zero, zero_mul, sub_zero, add_zero, mul_one, zero_div] - linarith [h_re] + linarith only [h_re] · simp only [add_im, sub_im, mul_im, neg_im, ofReal_re, ofReal_im, I_re, I_im, one_im, div_ofNat_re, div_ofNat_im, mul_zero, zero_mul, add_zero, mul_one, zero_div] - linarith [h_im] + linarith only [h_im] /-- The norm of the ρ-difference along the seg2/arc phasor: `2·sin(δπ/12)` when that is `≥ 0`. -/ private lemma rho_diff_norm (δ : ℝ) (hδ : 0 ≤ Real.sin (δ * Real.pi / 12)) : @@ -119,16 +119,16 @@ theorem fdBoundary_H_sub_rho_seg1_re (H : ℝ) {t : ℝ} (ht1 : 1 < t) (ht2 : t simp only [Complex.add_re, Complex.sub_re, Complex.ofReal_re, Complex.mul_re, Complex.I_re, Complex.I_im, Complex.ofReal_im, Complex.neg_re, Complex.one_re, Complex.div_ofNat_re, Complex.div_ofNat_im, zero_div] - have hθ_upper : θ ≤ Real.pi / 2 := by simp only [hθ_def]; nlinarith [Real.pi_pos] + have hθ_upper : θ ≤ Real.pi / 2 := by simp only [hθ_def]; nlinarith only [ht2, Real.pi_pos] have hcos : 0 ≤ Real.cos θ := - Real.cos_nonneg_of_mem_Icc ⟨by simp only [hθ_def]; nlinarith [Real.pi_pos], hθ_upper⟩ - linarith + Real.cos_nonneg_of_mem_Icc ⟨by simp only [hθ_def]; nlinarith only [ht1, Real.pi_pos], hθ_upper⟩ + linarith only [hcos] /-- On seg 2 (t ∈ (2, 3)): `γ(t) - ρ` has `re = cos(θ(t)) + 1/2 > 0` since `θ ∈ (π/2, 2π/3)` gives `cos ∈ (-1/2, 0)` hence `re ∈ (0, 1/2)`. -/ theorem fdBoundary_H_sub_rho_seg2_re (H : ℝ) {t : ℝ} (ht2 : 2 < t) (ht3 : t < 3) : (fdBoundaryH H t - ellipticPointRho).re > 0 := by - rw [fdBoundary_H_seg2 H (by linarith) (by linarith) (le_of_lt ht3)] + rw [fdBoundary_H_seg2 H (by linarith only [ht2]) (by linarith only [ht2]) (le_of_lt ht3)] simp only [ellipticPointRho, ellipticPointRho', UpperHalfPlane.coe_mk] set θ : ℝ := Real.pi / 2 + (t - 2) * (2 * Real.pi / 3 - Real.pi / 2) with hθ_def rw [show (↑Real.pi / 2 + (↑t - 2) * (2 * ↑Real.pi / 3 - ↑Real.pi / 2)) * I = @@ -140,13 +140,15 @@ theorem fdBoundary_H_sub_rho_seg2_re (H : ℝ) {t : ℝ} (ht2 : 2 < t) (ht3 : t Complex.div_ofNat_re, Complex.div_ofNat_im, zero_div] ring rw [hre] - have hθ_upper : θ < 2 * Real.pi / 3 := by simp only [hθ_def]; nlinarith [Real.pi_pos] + have hθ_upper : θ < 2 * Real.pi / 3 := by simp only [hθ_def]; nlinarith only [ht3, Real.pi_pos] have hcos_gt : Real.cos θ > -1 / 2 := by - have := cos_two_pi_div_three - rw [show (-1 : ℝ) / 2 = Real.cos (2 * Real.pi / 3) from by linarith] - exact Real.cos_lt_cos_of_nonneg_of_le_pi (by simp only [hθ_def]; nlinarith [Real.pi_pos]) - (by nlinarith [Real.pi_pos]) hθ_upper - linarith + rw [← cos_two_pi_div_three] + exact Real.cos_lt_cos_of_nonneg_of_le_pi + (by + simp only [hθ_def] + nlinarith only [ht2, Real.pi_pos]) + (by nlinarith only [Real.pi_pos]) hθ_upper + linarith only [hcos_gt] /-- On seg 3 (t ∈ (3, 4]): `γ(t) - ρ = (y(t) - √3/2)I` with `y > √3/2`, so `im > 0`. -/ theorem fdBoundary_H_sub_rho_seg3_slitPlane (H : ℝ) (hH : Real.sqrt 3 / 2 < H) @@ -154,12 +156,14 @@ theorem fdBoundary_H_sub_rho_seg3_slitPlane (H : ℝ) (hH : Real.sqrt 3 / 2 < H) fdBoundaryH H t - ellipticPointRho ∈ slitPlane := by have h_diff : fdBoundaryH H t - (ellipticPointRho : ℂ) = ↑((t - 3) * (H - Real.sqrt 3 / 2)) * I := by - rw [fdBoundary_H_seg3 H (by linarith) (by linarith) (by linarith) ht4] + rw [fdBoundary_H_seg3 H (by linarith only [ht3]) + (by linarith only [ht3]) + (by linarith only [ht3]) ht4] simp only [ellipticPointRho, ellipticPointRho', UpperHalfPlane.coe_mk] push_cast; ring rw [h_diff, Complex.mem_slitPlane_iff]; right simp only [Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im] - nlinarith + nlinarith only [hH, ht3] /-- On seg 4: `γ(t) - ρ` has `im = H - √3/2 > 0` for `H > √3/2`. -/ theorem fdBoundary_H_sub_rho_seg4_slitPlane (H : ℝ) (hH : Real.sqrt 3 / 2 < H) @@ -167,13 +171,16 @@ theorem fdBoundary_H_sub_rho_seg4_slitPlane (H : ℝ) (hH : Real.sqrt 3 / 2 < H) fdBoundaryH H t - ellipticPointRho ∈ slitPlane := by have h_diff : fdBoundaryH H t - (ellipticPointRho : ℂ) = ↑(t - 4) + ↑(H - Real.sqrt 3 / 2) * I := by - rw [fdBoundary_H_seg4 H (by linarith) (by linarith) (by linarith) (by linarith)] + rw [fdBoundary_H_seg4 H (by linarith only [ht4]) + (by linarith only [ht4]) + (by linarith only [ht4]) + (by linarith only [ht4])] simp only [ellipticPointRho, ellipticPointRho', UpperHalfPlane.coe_mk] push_cast; ring rw [h_diff, Complex.mem_slitPlane_iff]; right simp only [Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.I_im, Complex.ofReal_re] - linarith + linarith only [hH] /-- Combined: `γ(t) - ρ ∈ slitPlane` for all `t ∈ [0, 5]` with `t ≠ 3`. -/ theorem fdBoundary_H_sub_rho_slitPlane (H : ℝ) (hH : Real.sqrt 3 / 2 < H) @@ -205,7 +212,9 @@ theorem fdBoundary_H_eq_rho_iff (H : ℝ) (hH : Real.sqrt 3 / 2 < H) private lemma arg_approach_rho_left_helper (hδ : 0 < δ) (hδ_small : δ < 1) : (fdBoundaryH H (3 - δ) - ellipticPointRho).arg = Real.pi / 6 - δ * Real.pi / 12 := by - rw [fdBoundary_H_seg2 H (by linarith) (by linarith) (by linarith : 3 - δ ≤ 3)] + rw [fdBoundary_H_seg2 H (by linarith only [hδ, hδ_small]) + (by linarith only [hδ_small]) + (by linarith only [hδ] : 3 - δ ≤ 3)] simp only [ellipticPointRho, ellipticPointRho', UpperHalfPlane.coe_mk] have h_angle : (↑(Real.pi : ℝ) / 2 + (↑(3 - δ : ℝ) - 2) * (2 * ↑Real.pi / 3 - ↑Real.pi / 2)) * I = (↑(2 * Real.pi / 3 - δ * Real.pi / 6) : ℂ) * I := by congr 1; push_cast; ring @@ -215,8 +224,9 @@ private lemma arg_approach_rho_left_helper (hδ : 0 < δ) (hδ_small : δ < 1) : show (↑(Real.sin (Real.pi / 6 - δ * Real.pi / 12)) : ℂ) = Complex.sin ↑(Real.pi / 6 - δ * Real.pi / 12) from Complex.ofReal_sin _] exact Complex.arg_mul_cos_add_sin_mul_I (mul_pos (by norm_num : (0 : ℝ) < 2) - (ArcCalculus.sin_pos_of_mem_Ioo_zero_pi (by constructor <;> nlinarith [Real.pi_pos]))) - ⟨by nlinarith [Real.pi_pos], by nlinarith [Real.pi_pos]⟩ + (ArcCalculus.sin_pos_of_mem_Ioo_zero_pi (by constructor <;> nlinarith only [hδ, Real.pi_pos, + hδ_small]))) + ⟨by nlinarith only [hδ_small, Real.pi_pos], by nlinarith only [hδ, Real.pi_pos]⟩ /-- The `arg` of the approach direction from the left (seg 2 side) at `ρ`. `γ(3-δ) - ρ ≈ δ·(π/6)·exp(iπ/6)`, so `arg → π/6`. -/ @@ -235,7 +245,7 @@ theorem arg_approach_rho_left : abs_neg, abs_of_pos (by positivity)] have hx_lt_eps : x < ε := by rw [sub_zero, abs_of_pos hx_mem] at hx_dist; linarith [min_le_right 1 ε] - nlinarith [Real.pi_le_four] + nlinarith only [hx_mem, hx_small, hx_lt_eps, Real.pi_le_four] /-- The `arg` of the approach direction from the right (seg 3 side) at `ρ`. `γ(3+δ) - ρ = δ(H-√3/2)I`, so `arg = π/2` (exact, not just limit). -/ @@ -244,7 +254,10 @@ theorem arg_approach_rho_right (H : ℝ) (hH : Real.sqrt 3 / 2 < H) (fdBoundaryH H (3 + δ) - ellipticPointRho).arg = Real.pi / 2 := by have h_diff : fdBoundaryH H (3 + δ) - (ellipticPointRho : ℂ) = ↑(δ * (H - Real.sqrt 3 / 2)) * I := by - rw [fdBoundary_H_seg3 H (by linarith) (by linarith) (by linarith) (by linarith : 3 + δ ≤ 4)] + rw [fdBoundary_H_seg3 H (by linarith only [hδ]) + (by linarith only [hδ]) + (by linarith only [hδ]) + (by linarith only [hδ4] : 3 + δ ≤ 4)] simp only [ellipticPointRho, ellipticPointRho', UpperHalfPlane.coe_mk] push_cast; ring rw [h_diff, Complex.arg_eq_pi_div_two_iff] @@ -252,11 +265,14 @@ theorem arg_approach_rho_right (H : ℝ) (hH : Real.sqrt 3 / 2 < H) · simp only [Complex.mul_re, Complex.ofReal_re, Complex.I_re, Complex.ofReal_im, Complex.I_im] ring · simp only [Complex.mul_im, Complex.ofReal_re, Complex.I_im, Complex.ofReal_im, Complex.I_re] - nlinarith + nlinarith only [hH, hδ] private lemma g_seg3_value (H : ℝ) {δ : ℝ} (hδ : 0 < δ) (hδ1 : δ ≤ 1) : fdBoundaryH H (3 + δ) - ellipticPointRho = ↑(δ * (H - Real.sqrt 3 / 2)) * I := by - rw [fdBoundary_H_seg3 H (by linarith) (by linarith) (by linarith) (by linarith : 3 + δ ≤ 4)] + rw [fdBoundary_H_seg3 H (by linarith only [hδ]) + (by linarith only [hδ]) + (by linarith only [hδ]) + (by linarith only [hδ1] : 3 + δ ≤ 4)] simp only [ellipticPointRho, ellipticPointRho', UpperHalfPlane.coe_mk] push_cast; ring @@ -264,29 +280,33 @@ private lemma g_norm_seg3 (H : ℝ) (hH : Real.sqrt 3 / 2 < H) {δ : ℝ} (hδ : 0 < δ) (hδ1 : δ ≤ 1) : ‖fdBoundaryH H (3 + δ) - ellipticPointRho‖ = δ * (H - Real.sqrt 3 / 2) := by rw [g_seg3_value H hδ hδ1, norm_mul, Complex.norm_I, mul_one, Complex.norm_real, - Real.norm_of_nonneg (by nlinarith : 0 ≤ δ * (H - Real.sqrt 3 / 2))] + Real.norm_of_nonneg (by nlinarith only [hH, hδ] : 0 ≤ δ * (H - Real.sqrt 3 / 2))] private lemma g_norm_seg2 {δ : ℝ} (hδ : 0 < δ) (hδ1 : δ < 1) : ‖fdBoundaryH H (3 - δ) - ellipticPointRho‖ = 2 * Real.sin (δ * Real.pi / 12) := by - rw [fdBoundary_H_seg2 H (by linarith) (by linarith) (by linarith : 3 - δ ≤ 3)] + rw [fdBoundary_H_seg2 H (by linarith only [hδ, hδ1]) + (by linarith only [hδ1]) + (by linarith only [hδ] : 3 - δ ≤ 3)] simp only [ellipticPointRho, ellipticPointRho', UpperHalfPlane.coe_mk] rw [show (↑Real.pi / 2 + (↑(3 - δ : ℝ) - 2) * (2 * ↑Real.pi / 3 - ↑Real.pi / 2)) * I = (↑(2 * Real.pi / 3 - δ * Real.pi / 6) : ℂ) * I from by push_cast; ring, exp_real_angle_I] exact rho_diff_norm δ - (le_of_lt (ArcCalculus.sin_pos_of_mem_Ioo_zero_pi (by constructor <;> nlinarith [Real.pi_pos]))) + (le_of_lt (ArcCalculus.sin_pos_of_mem_Ioo_zero_pi (by constructor <;> nlinarith only [hδ, + Real.pi_pos, hδ1]))) private lemma g_norm_arc {t : ℝ} (ht1 : 1 < t) (ht3 : t < 3) : ‖fdBoundaryH H t - ellipticPointRho‖ = 2 * Real.sin ((3 - t) * Real.pi / 12) := by rw [fdBoundary_H_eq_arc ht1 ht3] simp only [ellipticPointRho, ellipticPointRho', UpperHalfPlane.coe_mk] set δ := 3 - t with hδ_def - have hδ : 0 < δ := by linarith - have hδ2 : δ < 2 := by linarith + have hδ : 0 < δ := by linarith only [ht3] + have hδ2 : δ < 2 := by linarith only [ht1] rw [show (↑(Real.pi * (1 + t) / 6) : ℂ) * I = (↑(2 * Real.pi / 3 - δ * Real.pi / 6) : ℂ) * I from by rw [hδ_def]; push_cast; ring, exp_real_angle_I] exact rho_diff_norm δ - (le_of_lt (ArcCalculus.sin_pos_of_mem_Ioo_zero_pi (by constructor <;> nlinarith [Real.pi_pos]))) + (le_of_lt (ArcCalculus.sin_pos_of_mem_Ioo_zero_pi (by constructor <;> nlinarith only [ht3, + Real.pi_pos, ht1]))) private lemma g_norm_ge_one_seg0 {t : ℝ} (_ht0 : 0 ≤ t) (ht1 : t ≤ 1) : 1 ≤ ‖fdBoundaryH H t - ellipticPointRho‖ := by @@ -306,12 +326,16 @@ private lemma g_norm_ge_seg4 (H : ℝ) (hH : Real.sqrt 3 / 2 < H) rw [hd, mul_comm, Complex.I_mul_im, Complex.ofReal_re] · have hd : fdBoundaryH H t - (ellipticPointRho : ℂ) = ↑(t - 4) + ↑(H - Real.sqrt 3 / 2) * I := by - rw [fdBoundary_H_seg4 H (by linarith) (by linarith) (by linarith) (by linarith)] + rw [fdBoundary_H_seg4 H (by linarith only [ht4]) + (by linarith only [ht4]) + (by linarith only [ht4]) + (by linarith only [ht4'])] simp only [ellipticPointRho, ellipticPointRho', UpperHalfPlane.coe_mk] push_cast; ring rw [hd, Complex.add_im, Complex.ofReal_im, zero_add, mul_comm, Complex.I_mul_im, Complex.ofReal_re] - calc H - Real.sqrt 3 / 2 = |(H - Real.sqrt 3 / 2 : ℝ)| := (abs_of_pos (by linarith)).symm + calc H - Real.sqrt 3 / 2 = |(H - Real.sqrt 3 / 2 : ℝ)| := + (abs_of_pos (by linarith only [hH])).symm _ = |(fdBoundaryH H t - (ellipticPointRho : ℂ)).im| := by rw [him] _ ≤ ‖fdBoundaryH H t - (ellipticPointRho : ℂ)‖ := Complex.abs_im_le_norm _ @@ -508,20 +532,25 @@ private lemma norm_le_middle_rho (H : ℝ) (hH : Real.sqrt 3 / 2 < H) · rcases eq_or_lt_of_le ht3 with rfl | ht3' · simp only [fdBoundary_H_at_three_eq_rho, sub_self, norm_zero] exact le_of_lt hε - · have ht1 : 1 < t := by nlinarith + · have ht1 : 1 < t := by nlinarith only [hδ_L_pos, hδ_L_lt_one, ht_lo] rw [g_norm_arc ht1 ht3'] rw [← h_norm_L, g_norm_seg2 hδ_L_pos hδ_L_lt_one] - have h_3mt_le : 3 - t ≤ δ_L := by linarith - have h_angle_le : (3 - t) * Real.pi / 12 ≤ δ_L * Real.pi / 12 := by nlinarith [Real.pi_pos] + have h_3mt_le : 3 - t ≤ δ_L := by linarith only [ht_lo] + have h_angle_le : (3 - t) * Real.pi / 12 ≤ δ_L * Real.pi / 12 := by + nlinarith only [hδ_L_pos, hδ_L_lt_one, ht_lo, Real.pi_pos] exact mul_le_mul_of_nonneg_left (Real.sin_le_sin_of_le_of_le_pi_div_two - (by nlinarith [Real.pi_pos]) (by nlinarith [Real.pi_pos]) h_angle_le) + (by + nlinarith only [hδ_L_pos, hδ_L_lt_one, hδ_R_lt_one, ht_lo, ht_hi, h_angle_le, + Real.pi_pos]) (by + nlinarith only [hδ_L_pos, hδ_L_lt_one, Real.pi_pos]) h_angle_le) (by norm_num : (0 : ℝ) ≤ 2) - · have ht_le_4 : t ≤ 4 := by linarith + · have ht_le_4 : t ≤ 4 := by linarith only [hδ_R_lt_one, ht_hi] have h_t_as_3pδ : t = 3 + (t - 3) := by ring - rw [h_t_as_3pδ, g_norm_seg3 H hH (by linarith) (by linarith : t - 3 ≤ 1), + rw [h_t_as_3pδ, g_norm_seg3 H hH (by linarith only [ht3]) (by + linarith only [hδ_R_lt_one, ht_hi] : t - 3 ≤ 1), ← h_norm_R, g_norm_seg3 H hH hδ_R_pos (le_of_lt hδ_R_lt_one)] - exact mul_le_mul_of_nonneg_right (by linarith : t - 3 ≤ δ_R) (le_of_lt hH_gap) + exact mul_le_mul_of_nonneg_right (by linarith only [ht_hi] : t - 3 ≤ δ_R) (le_of_lt hH_gap) -- Left cutoff: angle-based distance to ρ from arc side private def δ_L_rho : ℝ → ℝ := fun ε => 12 / Real.pi * Real.arcsin (ε / 2) @@ -647,7 +676,7 @@ private lemma pv_integrals_rho (H : ℝ) (hH : Real.sqrt 3 / 2 < H) : (∀ ε : ℝ, 0 < ε → ε < threshold → IntervalIntegrable (fun t => (g t - 0)⁻¹ * deriv g t) volume (3 + δ_R_rho H ε) 5) := by intro g threshold - have hH_gap : 0 < H - Real.sqrt 3 / 2 := by linarith + have hH_gap : 0 < H - Real.sqrt 3 / 2 := by linarith only [hH] have hpi_pos : 0 < Real.pi := Real.pi_pos have hε_aux : ∀ ε : ℝ, 0 < ε → ε < threshold → Real.arcsin (ε / 2) < Real.pi / 12 := by @@ -657,7 +686,7 @@ private lemma pv_integrals_rho (H : ℝ) (hH : Real.sqrt 3 / 2 < H) : have hδL_pos : ∀ ε : ℝ, 0 < ε → ε < threshold → 0 < δ_L_rho ε := by intro ε hε_pos hε_lt exact mul_pos (div_pos (by norm_num) hpi_pos) - (Real.arcsin_pos.mpr (by linarith [lt_of_lt_of_le hε_lt (min_le_right _ _)])) + (Real.arcsin_pos.mpr (by linarith only [hε_pos, lt_of_lt_of_le hε_lt (min_le_right _ _)])) have hδL_lt_one : ∀ ε : ℝ, 0 < ε → ε < threshold → δ_L_rho ε < 1 := by intro ε hε_pos hε_lt change 12 / Real.pi * Real.arcsin (ε / 2) < 1 @@ -702,7 +731,7 @@ private lemma pv_log_limit_at_rho (H : ℝ) (hH : Real.sqrt 3 / 2 < H) : Tendsto (fun ε => Complex.log (g (3 - δ_L ε)) - Complex.log (g (3 + δ_R ε))) (nhdsWithin 0 (Ioi 0)) (nhds (-(I * ↑Real.pi / 3))) := by intro g δ_L δ_R - have hH_gap : 0 < H - Real.sqrt 3 / 2 := by linarith + have hH_gap : 0 < H - Real.sqrt 3 / 2 := by linarith only [hH] have hsin_pos : 0 < Real.sin (Real.pi / 12) := sin_pi_12_pos have h2sin_pos : 0 < 2 * Real.sin (Real.pi / 12) := by positivity have hpi_pos : 0 < Real.pi := Real.pi_pos @@ -751,7 +780,7 @@ private lemma pv_log_limit_at_rho (H : ℝ) (hH : Real.sqrt 3 / 2 < H) : field_simp have h_norm_L : ‖g (3 - δ_L ε)‖ = ε := by change ‖fdBoundaryH H (3 - δ_L ε) - ellipticPointRho‖ = ε - rw [g_norm_seg2 hδL_p hδL_lt_one, hδL_angle, Real.sin_arcsin hε2_neg hε2_le]; linarith + rw [g_norm_seg2 hδL_p hδL_lt_one, hδL_angle, Real.sin_arcsin hε2_neg hε2_le]; linarith only [] have h_norm_R : ‖g (3 + δ_R ε)‖ = ε := by change ‖fdBoundaryH H (3 + δ_R ε) - ellipticPointRho‖ = ε rw [g_norm_seg3 H hH hδR_p (le_of_lt hδR_lt_one)] @@ -778,7 +807,7 @@ private lemma pv_log_limit_at_rho (H : ℝ) (hH : Real.sqrt 3 / 2 < H) : set x := δ_L ε * Real.pi / 12 with hx_def have hx_pos : 0 < x := by positivity have hx_le_one : x ≤ 1 := by - have : x < Real.pi / 12 := by nlinarith + have : x < Real.pi / 12 := by nlinarith only [harcsin_lt, hδL_angle] linarith [Real.pi_le_four] nlinarith [Real.sin_gt_sub_cube hx_pos, sq_nonneg x, sq_nonneg (1 - x)] linarith @@ -790,7 +819,7 @@ theorem pv_integral_at_rho_tendsto (H : ℝ) (hH : Real.sqrt 3 / 2 < H) : deriv (fun s => fdBoundaryH H s - ellipticPointRho) t else 0) (𝓝[>] 0) (𝓝 (-(I * ↑Real.pi / 3))) := by set g := fun t => fdBoundaryH H t - (ellipticPointRho : ℂ) with hg_def - have hH_gap : 0 < H - Real.sqrt 3 / 2 := by linarith + have hH_gap : 0 < H - Real.sqrt 3 / 2 := by linarith only [hH] have hsin_pos : 0 < Real.sin (Real.pi / 12) := sin_pi_12_pos have h2sin_pos : 0 < 2 * Real.sin (Real.pi / 12) := by positivity have hpi_pos : 0 < Real.pi := Real.pi_pos @@ -803,7 +832,7 @@ theorem pv_integral_at_rho_tendsto (H : ℝ) (hH : Real.sqrt 3 / 2 < H) : have hδL_pos : ∀ ε : ℝ, 0 < ε → ε < threshold → 0 < δ_L ε := by intro ε hε_pos hε_lt exact mul_pos (div_pos (by norm_num) hpi_pos) - (Real.arcsin_pos.mpr (by linarith [lt_of_lt_of_le hε_lt (min_le_right _ _)])) + (Real.arcsin_pos.mpr (by linarith only [hε_pos, lt_of_lt_of_le hε_lt (min_le_right _ _)])) have hδL_small : ∀ ε : ℝ, 0 < ε → ε < threshold → δ_L ε < (3 : ℝ) - 0 := by intro ε hε_pos hε_lt have harcsin_lt : Real.arcsin (ε / 2) < Real.pi / 12 := @@ -821,7 +850,7 @@ theorem pv_integral_at_rho_tendsto (H : ℝ) (hH : Real.sqrt 3 / 2 < H) : intro ε hε_pos hε_lt have hε_lt_gap : ε < H - Real.sqrt 3 / 2 := lt_of_lt_of_le hε_lt (min_le_left _ _) simp only [show (5 : ℝ) - 3 = 2 from by norm_num, δ_R, δ_R_rho] - calc ε / (H - Real.sqrt 3 / 2) < 1 := by rw [div_lt_one hH_gap]; linarith + calc ε / (H - Real.sqrt 3 / 2) < 1 := by rw [div_lt_one hH_gap]; linarith only [hε_lt_gap] _ < 2 := by norm_num -- Norm bounds and FTC from private lemmas obtain ⟨h_far_left, h_far_right, h_near⟩ := pv_norm_bounds_rho H hH diff --git a/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/RhoPlusOne.lean b/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/RhoPlusOne.lean index c2bbe6a38f..c4f1094231 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/RhoPlusOne.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/WindingWeights/RhoPlusOne.lean @@ -47,7 +47,8 @@ private lemma g_rho'_seg0_value {t : ℝ} (ht : t ≤ 1) : private lemma g_rho'_norm_seg0 (hH : Real.sqrt 3 / 2 < H) {t : ℝ} (_ht0 : 0 ≤ t) (ht1 : t < 1) : ‖fdBoundaryH H t - ellipticPointRhoPlusOne‖ = (1 - t) * (H - Real.sqrt 3 / 2) := by rw [g_rho'_seg0_value (le_of_lt ht1), norm_mul, Complex.norm_real, - Complex.norm_I, mul_one, Real.norm_of_nonneg (mul_nonneg (by linarith) (by linarith))] + Complex.norm_I, mul_one, Real.norm_of_nonneg (mul_nonneg (by linarith only [ht1]) (by + linarith only [hH]))] private lemma g_rho'_arc_value {t : ℝ} (ht1 : 1 < t) (ht3 : t < 3) : fdBoundaryH H t - ellipticPointRhoPlusOne = @@ -59,14 +60,18 @@ private lemma g_rho'_arc_value {t : ℝ} (ht1 : 1 < t) (ht3 : t < 3) : private lemma g_rho'_seg3_value {t : ℝ} (ht3 : 3 < t) (ht4 : t ≤ 4) : fdBoundaryH H t - ellipticPointRhoPlusOne = -1 + ↑((t - 3) * (H - Real.sqrt 3 / 2)) * I := by - rw [fdBoundary_H_seg3 H (by linarith) (by linarith) (by linarith) ht4] + rw [fdBoundary_H_seg3 H (by linarith only [ht3]) + (by linarith only [ht3]) + (by linarith only [ht3]) ht4] simp only [ellipticPointRhoPlusOne, ellipticPointRhoPlusOne', UpperHalfPlane.coe_mk] push_cast; ring private lemma g_rho'_seg4_value {t : ℝ} (ht4 : 4 < t) : fdBoundaryH H t - ellipticPointRhoPlusOne = ↑(t - 5) + ↑(H - Real.sqrt 3 / 2) * I := by - rw [fdBoundary_H_seg4 H (by linarith) (by linarith) (by linarith) (by linarith)] + rw [fdBoundary_H_seg4 H (by linarith only [ht4]) (by linarith only [ht4]) (by + linarith only [ht4]) (by + linarith only [ht4])] simp only [ellipticPointRhoPlusOne, ellipticPointRhoPlusOne', UpperHalfPlane.coe_mk] push_cast; ring @@ -75,22 +80,24 @@ private lemma sin_ge_sqrt3_div_2_of_mem {θ : ℝ} Real.sqrt 3 / 2 ≤ Real.sin θ := by rw [← Real.sin_pi_div_three] by_cases h : θ ≤ Real.pi / 2 - · exact Real.sin_le_sin_of_le_of_le_pi_div_two (by nlinarith [Real.pi_pos]) h hlo + · exact Real.sin_le_sin_of_le_of_le_pi_div_two (by nlinarith only [hlo, hhi, Real.pi_pos]) h hlo · push Not at h rw [show θ = Real.pi - (Real.pi - θ) from by ring, Real.sin_pi_sub] exact Real.sin_le_sin_of_le_of_le_pi_div_two - (by nlinarith [Real.pi_pos]) (by nlinarith) (by nlinarith) + (by nlinarith only [hhi, h, Real.pi_pos]) (by nlinarith only [h]) (by + nlinarith only [hhi]) private lemma sin_gt_sqrt3_div_2_of_mem {θ : ℝ} (hlo : Real.pi / 3 < θ) (hhi : θ < 2 * Real.pi / 3) : Real.sqrt 3 / 2 < Real.sin θ := by rw [← Real.sin_pi_div_three] by_cases h : θ ≤ Real.pi / 2 - · exact Real.sin_lt_sin_of_lt_of_le_pi_div_two (by nlinarith [Real.pi_pos]) h hlo + · exact Real.sin_lt_sin_of_lt_of_le_pi_div_two (by nlinarith only [hlo, hhi, Real.pi_pos]) h hlo · push Not at h rw [show θ = Real.pi - (Real.pi - θ) from by ring, Real.sin_pi_sub] exact Real.sin_lt_sin_of_lt_of_le_pi_div_two - (by nlinarith [Real.pi_pos]) (by nlinarith) (by nlinarith) + (by nlinarith only [hhi, h, Real.pi_pos]) (by nlinarith only [h]) (by + nlinarith only [hhi]) private lemma g_rho'_im_nonneg (hH : Real.sqrt 3 / 2 < H) {t : ℝ} (ht : t ∈ Icc (0 : ℝ) 5) (hne : t ≠ 1) : @@ -98,7 +105,7 @@ private lemma g_rho'_im_nonneg (hH : Real.sqrt 3 / 2 < H) rcases le_or_gt t 1 with h1 | h1 · have ht1 : t < 1 := lt_of_le_of_ne h1 hne rw [g_rho'_seg0_value h1, mul_comm, Complex.I_mul_im, Complex.ofReal_re] - exact mul_nonneg (by linarith) (by linarith) + exact mul_nonneg (by linarith only [ht1]) (by linarith only [hH]) · rcases lt_or_ge t 3 with h3 | h3 · rw [g_rho'_arc_value h1 h3] have hre_zero : (↑(Real.pi * (1 + t) / 6) * I : ℂ).re = 0 := by @@ -106,8 +113,9 @@ private lemma g_rho'_im_nonneg (hH : Real.sqrt 3 / 2 < H) simp only [sub_im, Complex.exp_im, hre_zero, Real.exp_zero, one_mul, add_im, ofReal_im, mul_im, I_re, I_im, ofReal_re, mul_zero, add_zero, mul_one] have h_sin_ge : Real.sqrt 3 / 2 ≤ Real.sin (Real.pi * (1 + t) / 6) := - sin_ge_sqrt3_div_2_of_mem (by nlinarith [Real.pi_pos]) (by nlinarith [Real.pi_pos]) - linarith + sin_ge_sqrt3_div_2_of_mem (by nlinarith only [h1, Real.pi_pos]) (by + nlinarith only [h3, Real.pi_pos]) + linarith only [h_sin_ge] · rcases eq_or_lt_of_le h3 with rfl | h3' · rw [fdBoundary_H_at_three_eq_rho] simp only [ellipticPointRhoPlusOne, ellipticPointRhoPlusOne', @@ -121,13 +129,13 @@ private lemma g_rho'_im_nonneg (hH : Real.sqrt 3 / 2 < H) (t - 3) * (H - Real.sqrt 3 / 2) := by simp [Complex.add_im, Complex.neg_im, Complex.one_im, Complex.mul_im, Complex.ofReal_im, Complex.I_re, Complex.I_im, Complex.ofReal_re] - rw [this]; exact mul_nonneg (by linarith) (by linarith) + rw [this]; exact mul_nonneg (by linarith only [h3]) (by linarith only [hH]) · rw [g_rho'_seg4_value h4] have : (↑(t - 5) + ↑(H - Real.sqrt 3 / 2) * I : ℂ).im = H - Real.sqrt 3 / 2 := by simp [Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.I_im, Complex.ofReal_re] - rw [this]; linarith + rw [this]; linarith only [hH] private lemma g_rho'_ne_zero (hH : Real.sqrt 3 / 2 < H) {t : ℝ} (ht : t ∈ Icc (0 : ℝ) 5) (hne : t ≠ 1) : @@ -148,7 +156,8 @@ private lemma g_rho'_ne_zero (hH : Real.sqrt 3 / 2 < H) simp only [sub_im, Complex.exp_im, hre_zero, Real.exp_zero, one_mul, add_im, ofReal_im, mul_im, I_re, I_im, ofReal_re, mul_zero, add_zero, mul_one] have : Real.sqrt 3 / 2 < Real.sin (Real.pi * (1 + t) / 6) := - sin_gt_sqrt3_div_2_of_mem (by nlinarith [Real.pi_pos]) (by nlinarith [Real.pi_pos]) + sin_gt_sqrt3_div_2_of_mem (by nlinarith only [h1, Real.pi_pos]) (by + nlinarith only [h3, Real.pi_pos]) linarith rw [h_eq] at him_pos; simp only [Complex.zero_im, lt_irrefl] at him_pos · rcases eq_or_lt_of_le h3 with rfl | h3' @@ -162,7 +171,9 @@ private lemma g_rho'_ne_zero (hH : Real.sqrt 3 / 2 < H) have hre : (-1 + ↑((t - 3) * (H - Real.sqrt 3 / 2)) * I : ℂ).re = -1 := by simp [Complex.add_re, Complex.neg_re, Complex.one_re, Complex.mul_re, Complex.ofReal_re, Complex.I_re, Complex.ofReal_im, Complex.I_im] - simp_all + simp_all only [mem_Icc, ne_eq, ofReal_mul, ofReal_sub, ofReal_ofNat, ofReal_div, + zero_re, zero_eq_neg, + one_ne_zero] · rw [g_rho'_seg4_value h4] at h_eq have him : (↑(t - 5) + ↑(H - Real.sqrt 3 / 2) * I : ℂ).im = H - Real.sqrt 3 / 2 := by @@ -177,7 +188,7 @@ private lemma g_rho'_slitPlane (hH : Real.sqrt 3 / 2 < H) rcases le_or_gt t 1 with h1 | h1 · have ht1 : t < 1 := lt_of_le_of_ne h1 hne1 rw [g_rho'_seg0_value h1, mul_comm, Complex.I_mul_im, Complex.ofReal_re] - exact ne_of_gt (mul_pos (by linarith) (by linarith)) + exact ne_of_gt (mul_pos (by linarith only [ht1]) (by linarith only [hH])) · rcases lt_or_ge t 3 with h3 | h3 · rw [g_rho'_arc_value h1 h3] have hre_zero : (↑(Real.pi * (1 + t) / 6) * I : ℂ).re = 0 := by @@ -185,8 +196,9 @@ private lemma g_rho'_slitPlane (hH : Real.sqrt 3 / 2 < H) simp only [sub_im, Complex.exp_im, hre_zero, Real.exp_zero, one_mul, add_im, ofReal_im, mul_im, I_re, I_im, ofReal_re, mul_zero, add_zero, mul_one] have h_sin_gt : Real.sqrt 3 / 2 < Real.sin (Real.pi * (1 + t) / 6) := - sin_gt_sqrt3_div_2_of_mem (by nlinarith [Real.pi_pos]) (by nlinarith [Real.pi_pos]) - exact ne_of_gt (by linarith) + sin_gt_sqrt3_div_2_of_mem (by nlinarith only [h1, Real.pi_pos]) (by + nlinarith only [h3, Real.pi_pos]) + exact ne_of_gt (by linarith only [h_sin_gt]) · rcases eq_or_lt_of_le h3 with rfl | h3' · exact absurd rfl hne3 · rcases le_or_gt t 4 with h4 | h4 @@ -195,26 +207,30 @@ private lemma g_rho'_slitPlane (hH : Real.sqrt 3 / 2 < H) (t - 3) * (H - Real.sqrt 3 / 2) := by simp [Complex.add_im, Complex.neg_im, Complex.one_im, Complex.mul_im, Complex.ofReal_im, Complex.I_re, Complex.I_im, Complex.ofReal_re] - rw [this]; exact ne_of_gt (mul_pos (by linarith) (by linarith)) + rw [this]; exact ne_of_gt (mul_pos (by linarith only [h3']) (by linarith only [hH])) · rw [g_rho'_seg4_value h4] have : (↑(t - 5) + ↑(H - Real.sqrt 3 / 2) * I : ℂ).im = H - Real.sqrt 3 / 2 := by simp [Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.I_re, Complex.I_im, Complex.ofReal_re] - rw [this]; exact ne_of_gt (by linarith) + rw [this]; exact ne_of_gt (by linarith only [hH]) private theorem arg_approach_rho'_left (hH : Real.sqrt 3 / 2 < H) {δ : ℝ} (hδ : 0 < δ) (_hδ1 : δ ≤ 1) : (fdBoundaryH H (1 - δ) - ellipticPointRhoPlusOne).arg = Real.pi / 2 := by - rw [g_rho'_seg0_value (by linarith : 1 - δ ≤ 1), show (1 - (1 - δ)) = δ from by ring, + rw [g_rho'_seg0_value (by linarith only [hδ] : 1 - δ ≤ 1), show (1 - (1 - δ)) = δ from by ring, Complex.arg_eq_pi_div_two_iff] - simp_all + simp_all only [ofReal_mul, ofReal_sub, ofReal_div, ofReal_ofNat, mul_re, ofReal_re, sub_re, + div_ofNat_re, + ofReal_im, sub_im, div_ofNat_im, zero_div, sub_self, mul_zero, sub_zero, I_re, mul_im, + zero_mul, add_zero, I_im, + mul_one, mul_pos_iff_of_pos_left, sub_pos, and_self] private lemma g_rho'_norm_seg0_at (hH : Real.sqrt 3 / 2 < H) {δ : ℝ} (hδ : 0 < δ) (_hδ1 : δ ≤ 1) : ‖fdBoundaryH H (1 - δ) - ellipticPointRhoPlusOne‖ = δ * (H - Real.sqrt 3 / 2) := by - rw [g_rho'_seg0_value (by linarith : 1 - δ ≤ 1), show (1 - (1 - δ)) = δ from by ring, + rw [g_rho'_seg0_value (by linarith only [hδ] : 1 - δ ≤ 1), show (1 - (1 - δ)) = δ from by ring, norm_mul, Complex.norm_real, Complex.norm_I, mul_one, - Real.norm_of_nonneg (mul_nonneg (le_of_lt hδ) (by linarith))] + Real.norm_of_nonneg (mul_nonneg (le_of_lt hδ) (by linarith only [hH]))] /-- Core arc factorization at `ρ'`: `exp(π(1+(1+δ))/6·I) - (1/2 + √3/2·I)` equals a positive scalar `2·sin(δπ/12)` times the unit phasor `exp((5π/6+δπ/12)·I)`. Shared by the arc arg @@ -231,13 +247,13 @@ private lemma g_rho'_arc_factor (δ : ℝ) : have h := Real.cos_sub_cos θ (Real.pi / 3) rw [show (θ + Real.pi / 3) / 2 = φ from by simp only [hφ_def, hθ_eq]; ring, show (θ - Real.pi / 3) / 2 = δ * Real.pi / 12 from by rw [hθ_eq]; ring] at h - linarith [Real.cos_pi_div_three] + linarith only [h, Real.cos_pi_div_three] have h_sin_sub : Real.sin θ - Real.sqrt 3 / 2 = 2 * Real.sin (δ * Real.pi / 12) * Real.cos φ := by have h := Real.sin_sub_sin θ (Real.pi / 3) rw [show (θ - Real.pi / 3) / 2 = δ * Real.pi / 12 from by rw [hθ_eq]; ring, show (θ + Real.pi / 3) / 2 = φ from by simp only [hφ_def, hθ_eq]; ring] at h - linarith [Real.sin_pi_div_three] + linarith only [h, Real.sin_pi_div_three] have h_neg_sin_eq : -Real.sin φ = Real.cos (5 * Real.pi / 6 + δ * Real.pi / 12) := by rw [show 5 * Real.pi / 6 + δ * Real.pi / 12 = Real.pi / 2 + φ from by simp only [hφ_def]; ring, Real.cos_add, Real.cos_pi_div_two, Real.sin_pi_div_two]; ring @@ -251,36 +267,43 @@ private lemma g_rho'_arc_factor (δ : ℝ) : ← h_neg_sin_eq, ← h_cos_eq] apply Complex.ext · simp only [add_re, sub_re, mul_re, ofReal_re, ofReal_im, I_re, I_im, - mul_zero, zero_mul, sub_zero, add_zero, mul_one]; linarith [h_cos_sub] + mul_zero, zero_mul, sub_zero, add_zero, mul_one]; linarith only [h_cos_sub] · simp only [add_im, sub_im, mul_im, ofReal_re, ofReal_im, I_re, I_im, - mul_zero, zero_mul, add_zero, mul_one]; linarith [h_sin_sub] + mul_zero, zero_mul, add_zero, mul_one]; linarith only [h_sin_sub] private lemma arg_approach_rho'_right_helper (hδ : 0 < δ) (hδ_small : δ < 2) : (fdBoundaryH H (1 + δ) - ellipticPointRhoPlusOne).arg = 5 * Real.pi / 6 + δ * Real.pi / 12 := by - rw [g_rho'_arc_value (by linarith : 1 < 1 + δ) (by linarith : 1 + δ < 3), g_rho'_arc_factor, + rw [g_rho'_arc_value (by linarith only [hδ] : 1 < 1 + δ) + (by linarith only [hδ_small] : 1 + δ < 3), g_rho'_arc_factor, exp_real_angle_I] have h_sin_pos : 0 < Real.sin (δ * Real.pi / 12) := - ArcCalculus.sin_pos_of_mem_Ioo_zero_pi (by constructor <;> nlinarith [Real.pi_pos]) + ArcCalculus.sin_pos_of_mem_Ioo_zero_pi (by constructor <;> nlinarith only [hδ, Real.pi_pos, + hδ_small]) have h_angle_lt_pi : 5 * Real.pi / 6 + δ * Real.pi / 12 < Real.pi := by - nlinarith [Real.pi_pos, mul_pos (show (0 : ℝ) < 2 - δ by linarith) Real.pi_pos] + nlinarith only [hδ_small, Real.pi_pos, + mul_pos (show (0 : ℝ) < 2 - δ by linarith only [hδ_small]) Real.pi_pos] simp only [Complex.ofReal_cos, Complex.ofReal_sin] exact Complex.arg_mul_cos_add_sin_mul_I (mul_pos (by norm_num : (0 : ℝ) < 2) h_sin_pos) - ⟨by linarith [show (0 : ℝ) < 5 * Real.pi / 6 + δ * Real.pi / 12 from by positivity], + ⟨by + linarith only [hδ, h_angle_lt_pi, + show (0 : ℝ) < 5 * Real.pi / 6 + δ * Real.pi / 12 from by positivity], le_of_lt h_angle_lt_pi⟩ private lemma g_rho'_norm_arc {δ : ℝ} (hδ : 0 < δ) (hδ2 : δ < 2) : ‖fdBoundaryH H (1 + δ) - ellipticPointRhoPlusOne‖ = 2 * Real.sin (δ * Real.pi / 12) := by - rw [g_rho'_arc_value (by linarith : 1 < 1 + δ) (by linarith : 1 + δ < 3), g_rho'_arc_factor] + rw [g_rho'_arc_value (by linarith only [hδ] : 1 < 1 + δ) + (by linarith only [hδ2] : 1 + δ < 3), g_rho'_arc_factor] have h_sin_nn : 0 ≤ Real.sin (δ * Real.pi / 12) := - le_of_lt (ArcCalculus.sin_pos_of_mem_Ioo_zero_pi (by constructor <;> nlinarith [Real.pi_pos])) + le_of_lt (ArcCalculus.sin_pos_of_mem_Ioo_zero_pi (by constructor <;> nlinarith only [hδ, + Real.pi_pos, hδ2])) rw [norm_mul, Complex.norm_real, Real.norm_of_nonneg (mul_nonneg (by norm_num) h_sin_nn), Complex.norm_exp_ofReal_mul_I, mul_one] private lemma g_rho'_norm_arc_full {t : ℝ} (ht1 : 1 < t) (ht3 : t < 3) : ‖fdBoundaryH H t - ellipticPointRhoPlusOne‖ = 2 * Real.sin ((t - 1) * Real.pi / 12) := by - have hδ : 0 < t - 1 := by linarith - have hδ2 : t - 1 < 2 := by linarith + have hδ : 0 < t - 1 := by linarith only [ht1] + have hδ2 : t - 1 < 2 := by linarith only [ht3] convert g_rho'_norm_arc (δ := t - 1) hδ hδ2 using 2 <;> ring_nf private lemma g_rho'_norm_ge_seg4 (hH : Real.sqrt 3 / 2 < H) @@ -293,10 +316,18 @@ private lemma g_rho'_norm_ge_seg4 (hH : Real.sqrt 3 / 2 < H) rw [fdBoundary_H_at_four] simp only [ellipticPointRhoPlusOne, ellipticPointRhoPlusOne', UpperHalfPlane.coe_mk] push_cast; ring - simp_all + simp_all only [Std.le_refl, ofReal_sub, ofReal_div, ofReal_ofNat, add_im, neg_im, one_im, + neg_zero, mul_im, + sub_re, ofReal_re, div_ofNat_re, I_im, mul_one, sub_im, ofReal_im, div_ofNat_im, + zero_div, sub_self, I_re, mul_zero, + add_zero, zero_add] · rw [g_rho'_seg4_value ht4'] - simp_all - calc H - Real.sqrt 3 / 2 = |(H - Real.sqrt 3 / 2 : ℝ)| := (abs_of_pos (by linarith)).symm + simp_all only [ofReal_sub, ofReal_ofNat, ofReal_div, add_im, sub_im, ofReal_im, im_ofNat, + sub_self, mul_im, + sub_re, ofReal_re, div_ofNat_re, I_im, mul_one, div_ofNat_im, zero_div, I_re, mul_zero, + add_zero, zero_add] + calc H - Real.sqrt 3 / 2 = |(H - Real.sqrt 3 / 2 : ℝ)| := + (abs_of_pos (by linarith only [hH])).symm _ = |(fdBoundaryH H t - (ellipticPointRhoPlusOne : ℂ)).im| := by rw [him] _ ≤ ‖fdBoundaryH H t - (ellipticPointRhoPlusOne : ℂ)‖ := Complex.abs_im_le_norm _ @@ -560,13 +591,18 @@ private lemma norm_le_middle_rho_plus_one (H : ℝ) (hH : Real.sqrt 3 / 2 < H) · rcases eq_or_lt_of_le ht1 with rfl | ht1' · simp only [fdBoundary_H_at_one_eq_rho_plus_one, sub_self, norm_zero] exact le_of_lt hε - · rw [g_rho'_norm_seg0 hH (by linarith) ht1', + · rw [g_rho'_norm_seg0 hH (by linarith only [hδ_L_lt_one, ht_lo]) ht1', ← h_norm_L, g_rho'_norm_seg0_at hH hδ_L_pos (le_of_lt hδ_L_lt_one)] - exact mul_le_mul_of_nonneg_right (by linarith) (le_of_lt hH_gap) - · rw [g_rho'_norm_arc_full ht1 (by linarith : t < 3), - ← h_norm_R, g_rho'_norm_arc hδ_R_pos (by linarith : δ_R < 2)] + exact mul_le_mul_of_nonneg_right (by linarith only [ht_lo]) (le_of_lt hH_gap) + · rw [g_rho'_norm_arc_full ht1 (by linarith only [hδ_L_pos, hδ_L_lt_one, hδ_R_lt_one, + ht_hi] : t < 3), + ← h_norm_R, g_rho'_norm_arc hδ_R_pos (by + linarith only [hδ_L_pos, hδ_L_lt_one, hδ_R_lt_one] : δ_R < 2)] exact mul_le_mul_of_nonneg_left (Real.sin_le_sin_of_le_of_le_pi_div_two - (by nlinarith) (by nlinarith) (by nlinarith [show t - 1 ≤ δ_R from by linarith])) + (by nlinarith only [hδ_L_pos, hδ_L_lt_one, ht_lo, hpi_pos]) (by + nlinarith only [hδ_L_pos, hδ_L_lt_one, hδ_R_lt_one, hpi_pos]) (by + nlinarith only [hδ_L_pos, hδ_L_lt_one, ht_hi, hpi_pos, + show t - 1 ≤ δ_R from by linarith only [ht_hi] ])) (by norm_num) private lemma rho'_norm_gt_right_of_arc (H : ℝ) (hH : Real.sqrt 3 / 2 < H) @@ -580,13 +616,14 @@ private lemma rho'_norm_gt_right_of_arc (H : ℝ) (hH : Real.sqrt 3 / 2 < H) · rcases eq_or_lt_of_le ht3 with rfl | ht3' · calc ε < 1 := hε_lt_one _ ≤ _ := g_rho'_norm_ge_one_seg3 (le_refl 3) (by norm_num) - · rw [g_rho'_norm_arc_full (by linarith : 1 < t) ht3', + · rw [g_rho'_norm_arc_full (by linarith only [ht1, hδ_R_pos] : 1 < t) ht3', ← h_norm_R, g_rho'_norm_arc hδ_R_pos (by linarith : δ_R < 2)] have hpi_pos := Real.pi_pos apply mul_lt_mul_of_pos_left _ (by norm_num : (0 : ℝ) < 2) exact Real.sin_lt_sin_of_lt_of_le_pi_div_two - (by nlinarith) (by nlinarith) - (by nlinarith [show δ_R < t - 1 from by linarith]) + (by nlinarith only [hδ_R_pos, hpi_pos]) + (by nlinarith only [hδ_R_pos, hδ_R_lt_one, ht5, hpi_pos]) + (by nlinarith only [ht1, hpi_pos, show δ_R < t - 1 from by linarith]) · rcases le_or_gt t 4 with ht4 | ht4 · calc ε < 1 := hε_lt_one _ ≤ _ := g_rho'_norm_ge_one_seg3 (le_of_lt ht3) ht4 @@ -598,24 +635,30 @@ private lemma arc_angle_lt_epsilon {δ_R ε : ℝ} (hδ_R_pos : 0 < δ_R) (h_norm_R : ‖fdBoundaryH H (1 + δ_R) - (ellipticPointRhoPlusOne : ℂ)‖ = ε) : δ_R * Real.pi / 12 < ε := by have h_sin_eq : Real.sin (δ_R * Real.pi / 12) = ε / 2 := by - linarith [h_norm_R ▸ g_rho'_norm_arc (H := H) hδ_R_pos (show δ_R < 2 by linarith)] + linarith only [hδ_R_pos, hδ_R_lt_one, h_norm_R, + h_norm_R ▸ g_rho'_norm_arc (H := H) hδ_R_pos (show δ_R < 2 by linarith)] set x := δ_R * Real.pi / 12 with hx_def have hx_pos : 0 < x := by positivity have hx_le_one : x ≤ 1 := by - linarith [Real.pi_le_four, show x < Real.pi / 12 by rw [hx_def]; nlinarith] - nlinarith [Real.sin_gt_sub_cube hx_pos, sq_nonneg x, sq_nonneg (1 - x)] + have hx_lt : x < Real.pi / 12 := by + rw [hx_def] + nlinarith only [hδ_R_lt_one, Real.pi_pos] + linarith only [hx_lt, Real.pi_le_four] + nlinarith only [h_sin_eq, hx_pos, hx_le_one, Real.sin_gt_sub_cube hx_pos, sq_nonneg x, + sq_nonneg (1 - x)] private lemma δ_right_lt_one_aux {ε : ℝ} (hε_half_neg : (-1 : ℝ) ≤ ε / 2) (hε_lt_2sin : ε < 2 * Real.sin (Real.pi / 12)) : 12 / Real.pi * Real.arcsin (ε / 2) < 1 := by have hpi_pos : 0 < Real.pi := Real.pi_pos - have hε_lt_sin : ε / 2 < Real.sin (Real.pi / 12) := by linarith + have hε_lt_sin : ε / 2 < Real.sin (Real.pi / 12) := by linarith only [hε_lt_2sin] have harcsin_lt : Real.arcsin (ε / 2) < Real.pi / 12 := calc Real.arcsin (ε / 2) < Real.arcsin (Real.sin (Real.pi / 12)) := Real.arcsin_lt_arcsin hε_half_neg hε_lt_sin (Real.sin_le_one _) _ = Real.pi / 12 := - Real.arcsin_sin (by nlinarith [Real.pi_pos]) (by nlinarith [Real.pi_pos]) + Real.arcsin_sin (by nlinarith only [hpi_pos, Real.pi_pos]) (by + nlinarith only [hpi_pos, Real.pi_pos]) calc 12 / Real.pi * Real.arcsin (ε / 2) < 12 / Real.pi * (Real.pi / 12) := mul_lt_mul_of_pos_left harcsin_lt (div_pos (by norm_num) hpi_pos) @@ -631,10 +674,10 @@ private lemma rho'_delta_bounds {H ε : ℝ} (hH_gap : 0 < H - Real.sqrt 3 / 2) 0 < 12 / Real.pi * Real.arcsin (ε / 2) ∧ 12 / Real.pi * Real.arcsin (ε / 2) < 1 := by have hpi_pos : 0 < Real.pi := Real.pi_pos - have hε_half_neg : (-1 : ℝ) ≤ ε / 2 := by linarith - have hε_half_le : ε / 2 ≤ 1 := by linarith [Real.sin_le_one (Real.pi / 12)] + have hε_half_neg : (-1 : ℝ) ≤ ε / 2 := by linarith only [hε_pos] + have hε_half_le : ε / 2 ≤ 1 := by linarith only [hε_lt_2sin, Real.sin_le_one (Real.pi / 12)] refine ⟨hε_half_neg, hε_half_le, div_pos hε_pos hH_gap, ?_, - mul_pos (div_pos (by norm_num) hpi_pos) (Real.arcsin_pos.mpr (by linarith)), + mul_pos (div_pos (by norm_num) hpi_pos) (Real.arcsin_pos.mpr (by linarith only [hε_pos])), δ_right_lt_one_aux hε_half_neg hε_lt_2sin⟩ rw [div_lt_one hH_gap]; exact hε_lt_gap