From fcba3dca4e622b7aa44e6565f973a7dd81514c6e Mon Sep 17 00:00:00 2001 From: Vasily Ilin Date: Fri, 13 Nov 2026 16:27:08 +0000 Subject: [PATCH 1/3] Reduce Chudnovsky proof elaboration cost --- LeanPool/Chudnovsky/Basic.lean | 8 +- LeanPool/Chudnovsky/BernoulliValues.lean | 8 +- LeanPool/Chudnovsky/Chudnovsky.lean | 16 +- LeanPool/Chudnovsky/Clausen.lean | 109 +++++----- LeanPool/Chudnovsky/Coefficients.lean | 190 +--------------- LeanPool/Chudnovsky/ComplexMult.lean | 70 +++--- LeanPool/Chudnovsky/DivisionValues.lean | 202 +++++++++--------- LeanPool/Chudnovsky/Estimates.lean | 144 ++++++------- LeanPool/Chudnovsky/Fourier.lean | 78 +++---- LeanPool/Chudnovsky/Imports.lean | 1 + LeanPool/Chudnovsky/Kummer.lean | 148 ++++++------- LeanPool/Chudnovsky/Liouville.lean | 35 +-- LeanPool/Chudnovsky/MainTheorem.lean | 96 ++++----- LeanPool/Chudnovsky/NumericalBounds.lean | 168 +++++++++++++++ LeanPool/Chudnovsky/Numerics.lean | 34 +-- LeanPool/Chudnovsky/Periodicity.lean | 6 +- LeanPool/Chudnovsky/Quasiperiods.lean | 29 +-- LeanPool/Chudnovsky/Ramanujan.lean | 62 +++--- LeanPool/Chudnovsky/SigmaZeta.lean | 63 +++--- LeanPool/Chudnovsky/SingularModuli.lean | 6 +- .../SingularModuli/CMRelations.lean | 8 +- .../Chudnovsky/SingularModuli/CosetOrbit.lean | 27 ++- .../SingularModuli/FormReduction.lean | 26 +-- .../Chudnovsky/SingularModuli/JFunction.lean | 42 ++-- .../Chudnovsky/SingularModuli/Kronecker.lean | 53 ++--- .../Chudnovsky/SingularModuli/MasserA1.lean | 51 ++--- .../SingularModuli/ModularPolynomialQ.lean | 39 ++-- .../SingularModuli/ModularPolynomialZ.lean | 75 ++++--- .../SingularModuli/QuadraticPoints.lean | 2 +- .../SingularModuli/Rationality.lean | 34 +-- .../Chudnovsky/SingularModuli/Valence.lean | 99 +++++---- LeanPool/Chudnovsky/WeierstrassMore.lean | 49 +++-- 32 files changed, 1013 insertions(+), 965 deletions(-) create mode 100644 LeanPool/Chudnovsky/NumericalBounds.lean diff --git a/LeanPool/Chudnovsky/Basic.lean b/LeanPool/Chudnovsky/Basic.lean index d2cdcfe305..c4e9f8feb3 100644 --- a/LeanPool/Chudnovsky/Basic.lean +++ b/LeanPool/Chudnovsky/Basic.lean @@ -56,11 +56,11 @@ def Lτ (τ : ℍ) : PeriodPair where def q (τ : ℍ) : ℂ := Function.Periodic.qParam 1 τ lemma q_eq (τ : ℍ) : q τ = Complex.exp (2 * π * Complex.I * τ) := by - simp [q, Function.Periodic.qParam] + simp only [q, Function.Periodic.qParam, ofReal_one, div_one] lemma norm_q (τ : ℍ) : ‖q τ‖ = Real.exp (-(2 * π * τ.im)) := by rw [q, Function.Periodic.norm_qParam] - simp [coe_im] + simp only [neg_mul, coe_im, div_one] lemma norm_q_lt_one (τ : ℍ) : ‖q τ‖ < 1 := by rw [norm_q, Real.exp_lt_one_iff, neg_lt_zero] @@ -118,10 +118,10 @@ def Region : Set ℍ := {τ : ℍ | 5 / 4 < τ.im} lemma τ₁₆₃_mem_Region : τ₁₆₃ ∈ Region := by simp only [Region, Set.mem_ofPred_eq, τ₁₆₃_im] - nlinarith [Real.sq_sqrt (by norm_num : (163 : ℝ) ≥ 0).le, Real.sqrt_nonneg (163 : ℝ)] + nlinarith [Real.sq_sqrt (by norm_num1 : (163 : ℝ) ≥ 0).le, Real.sqrt_nonneg (163 : ℝ)] lemma τ₈_mem_Region : τ₈ ∈ Region := by simp only [Region, Set.mem_ofPred_eq, τ₈_im] - nlinarith [Real.sq_sqrt (by norm_num : (2 : ℝ) ≥ 0).le, Real.sqrt_nonneg (2 : ℝ)] + nlinarith [Real.sq_sqrt (by norm_num1 : (2 : ℝ) ≥ 0).le, Real.sqrt_nonneg (2 : ℝ)] end Chudnovsky diff --git a/LeanPool/Chudnovsky/BernoulliValues.lean b/LeanPool/Chudnovsky/BernoulliValues.lean index f7c86a2229..7f3a498641 100644 --- a/LeanPool/Chudnovsky/BernoulliValues.lean +++ b/LeanPool/Chudnovsky/BernoulliValues.lean @@ -21,19 +21,19 @@ namespace Chudnovsky /-- The fourth Bernoulli number, using the known value of `bernoulli'`. -/ lemma bernoulli_four_value : bernoulli 4 = -1 / 30 := by rw [bernoulli, bernoulli'_four] - norm_num + norm_num1 /-- The sixth Bernoulli number, evaluated from the preceding values. -/ lemma bernoulli_six_value : bernoulli 6 = 1 / 42 := by - have h5 : bernoulli' 5 = 0 := bernoulli'_eq_zero_of_odd ⟨2, rfl⟩ (by norm_num) + have h5 : bernoulli' 5 = 0 := bernoulli'_eq_zero_of_odd ⟨2, rfl⟩ (by norm_num1) have h6 : bernoulli' 6 = 1 / 42 := by rw [bernoulli'_def] rw [Finset.sum_range_succ, Finset.sum_range_succ, Finset.sum_range_succ, Finset.sum_range_succ, Finset.sum_range_succ, Finset.sum_range_succ, Finset.sum_range_zero, bernoulli'_zero, bernoulli'_one, bernoulli'_two, bernoulli'_three, bernoulli'_four, h5] - norm_num [Nat.choose] + norm_num only [Nat.choose] rw [bernoulli, h6] - norm_num + norm_num1 end Chudnovsky diff --git a/LeanPool/Chudnovsky/Chudnovsky.lean b/LeanPool/Chudnovsky/Chudnovsky.lean index b95b28ccb4..5645cdbfc0 100644 --- a/LeanPool/Chudnovsky/Chudnovsky.lean +++ b/LeanPool/Chudnovsky/Chudnovsky.lean @@ -47,9 +47,9 @@ theorem summable_chudnovskyTerm : Summable fun n : ℕ ↦ (chudnovskyTerm n : -- Comparison against `(545140134·n + 13591409)·rⁿ` with `r = 1728/640320³ < 1`. set r : ℝ := 1728 / 640320 ^ 3 with hr_def have hr : ‖r‖ < 1 := by - rw [Real.norm_eq_abs, abs_of_nonneg (by positivity)]; rw [hr_def]; norm_num + rw [Real.norm_eq_abs, abs_of_nonneg (by positivity)]; rw [hr_def]; norm_num1 have hg1 : Summable (fun n : ℕ => (n : ℝ) * r ^ n) := by - simpa using summable_pow_mul_geometric_of_norm_lt_one 1 hr + simpa only [pow_one] using summable_pow_mul_geometric_of_norm_lt_one 1 hr have hg0 : Summable (fun n : ℕ => r ^ n) := summable_geometric_of_norm_lt_one hr have hg : Summable (fun n : ℕ => (545140134 * (n : ℝ) + 13591409) * r ^ n) := by have hrw : (fun n : ℕ => (545140134 * (n : ℝ) + 13591409) * r ^ n) @@ -72,7 +72,7 @@ theorem summable_chudnovskyTerm : Summable fun n : ℕ ↦ (chudnovskyTerm n : have key : ((6*n)! : ℝ) ≤ 1728^n * (((3*n)! : ℝ) * (n ! )^3) := by have h := factorial_six_bound n calc ((6*n)! : ℝ) ≤ ((1728^n * ((3*n)! * (n ! )^3) : ℕ) : ℝ) := by exact_mod_cast h - _ = 1728^n * (((3*n)! : ℝ) * (n ! )^3) := by push_cast; ring + _ = 1728^n * (((3*n)! : ℝ) * (n ! )^3) := by push_cast; ac_rfl have hApos : (0:ℝ) ≤ 545140134*(n:ℝ)+13591409 := by positivity have hrpow : r^n * (640320:ℝ)^(3*n) = 1728^n := by rw [hr_def, div_pow, ← pow_mul, @@ -80,7 +80,7 @@ theorem summable_chudnovskyTerm : Summable fun n : ℕ ↦ (chudnovskyTerm n : rw [show (545140134 * (n:ℝ) + 13591409) * r ^ n * (((3*n)! : ℝ) * (n ! )^3 * 640320^(3*n)) = (545140134 * (n:ℝ) + 13591409) * (r ^ n * 640320^(3*n)) - * (((3*n)! : ℝ) * (n ! )^3) from by ring, hrpow] + * (((3*n)! : ℝ) * (n ! )^3) from by ac_rfl, hrpow] linear_combination mul_le_mul_of_nonneg_left key hApos /-- The glue lemma: Milla's normalization `√(640320³)/(12π) = ∑ …` implies Mathlib's @@ -101,8 +101,8 @@ private theorem chudnovsky_glue rw [neg_pow, ← pow_mul] have h1 : ((3 * n)! : ℂ) ≠ 0 := by exact_mod_cast Nat.factorial_ne_zero _ have h2 : ((n ! : ℕ) : ℂ) ≠ 0 := by exact_mod_cast Nat.factorial_ne_zero _ - have h3 : (640320 : ℂ) ^ (3 * n) ≠ 0 := pow_ne_zero _ (by norm_num) - have h4 : ((-1 : ℂ)) ^ n ≠ 0 := pow_ne_zero _ (by norm_num) + have h3 : (640320 : ℂ) ^ (3 * n) ≠ 0 := pow_ne_zero _ (by norm_num only) + have h4 : ((-1 : ℂ)) ^ n ≠ 0 := pow_ne_zero _ (by norm_num only) simp only [chudnovskyTerm, chudnovskyNum, chudnovskyDenom] rw [hpow] push_cast @@ -118,8 +118,8 @@ private theorem chudnovsky_glue -- `640320^(3/2) = √(640320³)`. have hrpow : (640320 : ℝ) ^ (3 / 2 : ℝ) = Real.sqrt (640320 ^ 3) := by rw [Real.sqrt_eq_rpow, show ((640320 : ℝ) ^ 3) = (640320 : ℝ) ^ ((3 : ℕ) : ℝ) from - (Real.rpow_natCast _ 3).symm, ← Real.rpow_mul (by norm_num)] - norm_num + (Real.rpow_natCast _ 3).symm, ← Real.rpow_mul (by norm_num only)] + norm_num only have hs : Real.sqrt (640320 ^ 3) ≠ 0 := by positivity have hpi : (π : ℝ) ≠ 0 := Real.pi_ne_zero -- Assemble. diff --git a/LeanPool/Chudnovsky/Clausen.lean b/LeanPool/Chudnovsky/Clausen.lean index 1318e54138..f6ced41dea 100644 --- a/LeanPool/Chudnovsky/Clausen.lean +++ b/LeanPool/Chudnovsky/Clausen.lean @@ -107,8 +107,8 @@ theorem generalizedHypergeometricSeries_apply_zero (n : ℕ) : @[simp] theorem generalizedHypergeometric_zero : ₃F₂ α β γ δ ε (0 : 𝔸) = 1 := by - simp [generalizedHypergeometric_eq_tsum, ← generalizedHypergeometricSeries_apply_eq, - generalizedHypergeometricSeries_apply_zero] + simp only [generalizedHypergeometric_eq_tsum, ← generalizedHypergeometricSeries_apply_eq, + generalizedHypergeometricSeries_apply_zero, tsum_pi_single] end Field @@ -130,10 +130,7 @@ theorem generalizedHypergeometricSeries_radius_eq_one {𝕂 : Type*} (𝔸 : Typ rw [ascPochhammer_eval_eq_zero_iff] at hz obtain ⟨k, _, hk⟩ := hz exact hx k hk - have hxn : ∀ (x : 𝕂) (n : ℕ), (∀ kn : ℕ, (kn : 𝕂) ≠ -x) → x + (n : 𝕂) ≠ 0 := by - intro x n hx he - rw [add_comm] at he - exact hx n (eq_neg_of_add_eq_zero_left he) + -- Cancel the old coefficient factors before taking norms. have key : ∀ n : ℕ, generalizedHypergeometricCoefficient α β γ δ ε n / generalizedHypergeometricCoefficient α β γ δ ε (n + 1) = ((δ + n) * (ε + n) * (1 + n)) / ((α + n) * (β + n) * (γ + n)) := by @@ -143,52 +140,47 @@ theorem generalizedHypergeometricSeries_radius_eq_one {𝕂 : Type*} (𝔸 : Typ have hγ := hpne γ n fun k => (h k).2.2.1 have hδ := hpne δ n fun k => (h k).2.2.2.1 have hε := hpne ε n fun k => (h k).2.2.2.2 - have hαn := hxn α n fun k => (h k).1 - have hβn := hxn β n fun k => (h k).2.1 - have hγn := hxn γ n fun k => (h k).2.2.1 - have hδn := hxn δ n fun k => (h k).2.2.2.1 - have hεn := hxn ε n fun k => (h k).2.2.2.2 - have hfac : ((n ! : 𝕂)) ≠ 0 := Nat.cast_ne_zero.2 (Nat.factorial_ne_zero n) - have hn1 : ((n : 𝕂) + 1) ≠ 0 := Nat.cast_add_one_ne_zero n - have hden : (α + (n : 𝕂)) * (β + n) * (γ + n) ≠ 0 := - mul_ne_zero (mul_ne_zero hαn hβn) hγn - have hcn1 : generalizedHypergeometricCoefficient α β γ δ ε (n + 1) ≠ 0 := by - simp only [generalizedHypergeometricCoefficient] - refine mul_ne_zero (mul_ne_zero (mul_ne_zero (mul_ne_zero (mul_ne_zero ?_ ?_) ?_) ?_) ?_) ?_ - · exact inv_ne_zero (Nat.cast_ne_zero.2 (Nat.factorial_ne_zero _)) - · exact hpne α (n + 1) fun k => (h k).1 - · exact hpne β (n + 1) fun k => (h k).2.1 - · exact hpne γ (n + 1) fun k => (h k).2.2.1 - · exact inv_ne_zero (hpne δ (n + 1) fun k => (h k).2.2.2.1) - · exact inv_ne_zero (hpne ε (n + 1) fun k => (h k).2.2.2.2) - have hrec : generalizedHypergeometricCoefficient α β γ δ ε n * - ((α + (n : 𝕂)) * (β + n) * (γ + n)) = - generalizedHypergeometricCoefficient α β γ δ ε (n + 1) * - ((δ + (n : 𝕂)) * (ε + n) * (1 + n)) := by - simp only [generalizedHypergeometricCoefficient, Nat.factorial_succ, ascPochhammer_succ_eval, - Nat.cast_mul, Nat.cast_succ] - field_simp - ring - exact (div_eq_div_iff hcn1 hden).mpr (hrec.trans (mul_comm _ _)) + have hfac : (n ! : 𝕂) ≠ 0 := Nat.cast_ne_zero.2 (Nat.factorial_ne_zero n) + simp only [generalizedHypergeometricCoefficient, Nat.factorial_succ, + ascPochhammer_succ_eval, Nat.cast_mul, Nat.cast_succ, + div_eq_mul_inv, mul_inv_rev, inv_inv, add_comm (1 : 𝕂) (n : 𝕂)] + calc + _ = ((n ! : 𝕂) * (n ! : 𝕂)⁻¹) + * ((ascPochhammer 𝕂 n).eval α * ((ascPochhammer 𝕂 n).eval α)⁻¹) + * ((ascPochhammer 𝕂 n).eval β * ((ascPochhammer 𝕂 n).eval β)⁻¹) + * ((ascPochhammer 𝕂 n).eval γ * ((ascPochhammer 𝕂 n).eval γ)⁻¹) + * ((ascPochhammer 𝕂 n).eval δ * ((ascPochhammer 𝕂 n).eval δ)⁻¹) + * ((ascPochhammer 𝕂 n).eval ε * ((ascPochhammer 𝕂 n).eval ε)⁻¹) + * ((α + n)⁻¹ * (β + n)⁻¹ * (γ + n)⁻¹ + * (δ + n) * (ε + n) * ((n : 𝕂) + 1)) := by ring + _ = _ := by + rw [mul_inv_cancel₀ hfac, mul_inv_cancel₀ hα, mul_inv_cancel₀ hβ, + mul_inv_cancel₀ hγ, mul_inv_cancel₀ hδ, mul_inv_cancel₀ hε] + simp only [one_mul, mul_one] + ring have limit : Tendsto (fun n : ℕ => ((δ + n) * (ε + n) * (1 + n)) / ((α + n) * (β + n) * (γ + n))) atTop (𝓝 1) := by have h1 : Tendsto (fun n : ℕ => (δ + (n : 𝕂)) / (α + n)) atTop (𝓝 1) := by - simpa using tendsto_add_mul_div_add_mul_atTop_nhds δ α (1 : 𝕂) (d := 1) one_ne_zero + simpa only [one_mul, ne_eq, one_ne_zero, not_false_eq_true, + div_self] using tendsto_add_mul_div_add_mul_atTop_nhds δ α (1 : 𝕂) (d := 1) one_ne_zero have h2 : Tendsto (fun n : ℕ => (ε + (n : 𝕂)) / (β + n)) atTop (𝓝 1) := by - simpa using tendsto_add_mul_div_add_mul_atTop_nhds ε β (1 : 𝕂) (d := 1) one_ne_zero + simpa only [one_mul, ne_eq, one_ne_zero, not_false_eq_true, + div_self] using tendsto_add_mul_div_add_mul_atTop_nhds ε β (1 : 𝕂) (d := 1) one_ne_zero have h3 : Tendsto (fun n : ℕ => (1 + (n : 𝕂)) / (γ + n)) atTop (𝓝 1) := by - simpa using tendsto_add_mul_div_add_mul_atTop_nhds (1 : 𝕂) γ (1 : 𝕂) (d := 1) one_ne_zero + simpa only [one_mul, ne_eq, one_ne_zero, not_false_eq_true, + div_self + ] using tendsto_add_mul_div_add_mul_atTop_nhds (1 : 𝕂) γ (1 : 𝕂) (d := 1) one_ne_zero have heq : (fun n : ℕ => ((δ + (n : 𝕂)) * (ε + n) * (1 + n)) / ((α + n) * (β + n) * (γ + n))) = fun n : ℕ => (δ + (n : 𝕂)) / (α + n) * ((ε + n) / (β + n)) * ((1 + n) / (γ + n)) := by funext n simp only [div_eq_mul_inv, mul_inv_rev] - ring + ac_rfl rw [heq] - simpa using (h1.mul h2).mul h3 + simpa only [mul_one] using (h1.mul h2).mul h3 have limitn : Tendsto (fun n : ℕ => ‖((δ + (n : 𝕂)) * (ε + n) * (1 + n)) / ((α + n) * (β + n) * (γ + n))‖) - atTop (𝓝 1) := by simpa using Filter.Tendsto.norm limit + atTop (𝓝 1) := by simpa only [norm_div, norm_mul, norm_one] using Filter.Tendsto.norm limit refine limitn.congr (fun n => ?_) simp only [Nat.succ_eq_add_one] rw [← norm_div, key n] @@ -291,7 +283,7 @@ private theorem DiscSummable.shift {c : ℕ → ℂ} (hc : DiscSummable c) : have hρ0 : 0 ≤ ρ := (norm_nonneg w).trans hwρ.le have hρpos : 0 < ρ := lt_of_le_of_lt (norm_nonneg w) hwρ have hg : Summable fun m : ℕ => (m : ℝ) * ‖c m‖ * ρ ^ m := by - simpa using hc.weighted 1 hρ0 hρ1 + simpa only [pow_one] using hc.weighted 1 hρ0 hρ1 have hg1 : Summable fun n : ℕ => ((n + 1 : ℕ) : ℝ) * ‖c (n + 1)‖ * ρ ^ (n + 1) := (summable_nat_add_iff (f := fun m : ℕ => (m : ℝ) * ‖c m‖ * ρ ^ m) 1).2 hg have hbnd : Summable fun n : ℕ => ((n : ℝ) + 1) * ‖c (n + 1)‖ * ρ ^ n := by @@ -393,7 +385,7 @@ private theorem ordinaryHypergeometric_discSummable (a b c : ℂ) (hc : ∀ k : have hkn' : (kn : ℂ) = -a ∨ (kn : ℂ) = -b := by by_contra hcon push Not at hcon - exact absurd (hkn hcon.1) (by simpa using hcon.2) + exact absurd (hkn hcon.1) (by simpa only [ne_eq] using hcon.2) apply summable_of_ne_finset_zero (s := Finset.range (kn + 1)) intro n hn rw [Finset.mem_range, not_lt] at hn @@ -486,7 +478,7 @@ theorem ordinaryHypergeometric_ode (a b c : ℂ) (hc : ∀ k : ℕ, (k : ℂ) have hd2 : deriv (deriv fun w : ℂ => ₂F₁ a b c w) z = ∑' n : ℕ, C2 n * z ^ n := by have hev : deriv (fun w : ℂ => ₂F₁ a b c w) =ᶠ[nhds z] fun w => ∑' n : ℕ, C1 n * w ^ n := by have hball : Metric.ball (0 : ℂ) 1 ∈ nhds z := - Metric.isOpen_ball.mem_nhds (by simpa [Metric.mem_ball, dist_zero_right] using hz) + Metric.isOpen_ball.mem_nhds (by simpa only [Metric.mem_ball, dist_zero_right] using hz) filter_upwards [hball] with w hw rw [Metric.mem_ball, dist_zero_right] at hw exact (hHD w hw).deriv @@ -599,10 +591,11 @@ private theorem generalizedHypergeometric_discSummable (α β γ δ ε : ℂ) : exact ascPochhammer_eval_neg_coe_nat_of_lt hlt]; ring) | (rw [show (ascPochhammer ℂ n).eval δ = 0 by rw [show δ = -(kn : ℂ) by linear_combination hp] - exact ascPochhammer_eval_neg_coe_nat_of_lt hlt]; simp) + exact ascPochhammer_eval_neg_coe_nat_of_lt hlt]; simp only [inv_zero, mul_zero, + zero_mul]) | (rw [show (ascPochhammer ℂ n).eval ε = 0 by rw [show ε = -(kn : ℂ) by linear_combination hp] - exact ascPochhammer_eval_neg_coe_nat_of_lt hlt]; simp) + exact ascPochhammer_eval_neg_coe_nat_of_lt hlt]; simp only [inv_zero, mul_zero]) rw [hc0, zero_mul, norm_zero] /-- Paper Thm. `dgl3f2`: on the unit disc, `g = ₃F₂(α, β, γ; δ, ε; ·)` satisfies the third-order @@ -646,7 +639,7 @@ theorem generalizedHypergeometric_ode (α β γ δ ε : ℂ) have D1eq : ∀ w : ℂ, ‖w‖ < 1 → deriv (fun w : ℂ => ₃F₂ α β γ δ ε w) w = ∑' n : ℕ, D1 n * w ^ n := fun w hw => (hHD1 w hw).deriv have hnbhd : ∀ w : ℂ, ‖w‖ < 1 → Metric.ball (0 : ℂ) 1 ∈ nhds w := fun w hw => - Metric.isOpen_ball.mem_nhds (by simpa [Metric.mem_ball, dist_zero_right] using hw) + Metric.isOpen_ball.mem_nhds (by simpa only [Metric.mem_ball, dist_zero_right] using hw) have D2eq : ∀ w : ℂ, ‖w‖ < 1 → deriv (deriv fun w : ℂ => ₃F₂ α β γ δ ε w) w = ∑' n : ℕ, D2 n * w ^ n := by intro w hw @@ -838,7 +831,8 @@ private theorem clausen_coeff_general (a b : ℂ) have hee2 : (∑ k ∈ Finset.range (nn + 1), C k * C (nn - k)) = E nn := rfl rw [hee1, hee2] at key linear_combination key - have ee0 : E 0 = 1 := by simp [hEdef, C0] + have ee0 : E 0 = 1 := by simp only [hEdef, zero_add, Finset.range_one, zero_tsub, C0, mul_one, + Finset.sum_singleton] have hAne : ∀ nn : ℕ, A nn ≠ 0 := by intro nn simp only [hAdef] @@ -1048,7 +1042,8 @@ private theorem ee_rec (n : ℕ) : ((n : ℚ) + 1) ^ 3 * ee (n + 1) = AA n * ee /-- Both coefficient sequences satisfy the same recurrence with the same initial value, hence they are equal. -/ -private theorem ee_zero : ee 0 = 1 := by simp [ee, cc_zero] +private theorem ee_zero : ee 0 = 1 := by simp only [ee, zero_add, Finset.range_one, zero_tsub, + cc_zero, mul_one, Finset.sum_singleton] private theorem ee_eq_dd (n : ℕ) : ee n = dd n := by induction n with @@ -1087,12 +1082,12 @@ theorem hyp2F1_sq_eq_hyp3F2 {z : ℂ} (hz : ‖z‖ < 1) : hyp2F1 z ^ 2 = hyp3F2 rw [Nat.cast_eq_zero] at h0; omega · have h0 : ((kn + 1 : ℕ) : ℂ) = 0 := by push_cast; linear_combination h rw [Nat.cast_eq_zero] at h0; omega - have hc : (1 / 12 : ℂ) + 5 / 12 + 1 / 2 = 1 := by norm_num - have hc' : 2 * (1 / 12 : ℂ) + 2 * (5 / 12) = 1 := by norm_num + have hc : (1 / 12 : ℂ) + 5 / 12 + 1 / 2 = 1 := by norm_num1 + have hc' : 2 * (1 / 12 : ℂ) + 2 * (5 / 12) = 1 := by norm_num1 have h := clausen_formula (1 / 12 : ℂ) (5 / 12) (fun k => by rw [hc]; exact (hnd k).2.2) (fun k => by rw [hc']; exact (hnd k).2.2) hz - convert h using 1 <;> norm_num [hyp2F1, hyp3F2] + convert h using 1 <;> norm_num only [hyp2F1, hyp3F2] /-- The Pochhammer/factorial identity from the proof of paper Thm. `darst`: `(1/6)ₙ · (1/2)ₙ · (5/6)ₙ = (6n)! / ((3n)! · 12^(3n))`, stated over `ℚ`. -/ @@ -1106,13 +1101,13 @@ theorem ascPochhammer_prod_eq_factorial (n : ℕ) : have e6 : ((6 * (n + 1))! : ℚ) = (6 * n + 1) * (6 * n + 2) * (6 * n + 3) * (6 * n + 4) * (6 * n + 5) * (6 * n + 6) * ((6 * n)! : ℚ) := by - rw [show 6 * (n + 1) = 6 * n + 1 + 1 + 1 + 1 + 1 + 1 from by ring] + rw [show 6 * (n + 1) = 6 * n + 1 + 1 + 1 + 1 + 1 + 1 from by omega] simp only [Nat.factorial_succ] push_cast ring have e3 : ((3 * (n + 1))! : ℚ) = (3 * n + 1) * (3 * n + 2) * (3 * n + 3) * ((3 * n)! : ℚ) := by - rw [show 3 * (n + 1) = 3 * n + 1 + 1 + 1 from by ring] + rw [show 3 * (n + 1) = 3 * n + 1 + 1 + 1 from by omega] simp only [Nat.factorial_succ] push_cast ring @@ -1122,7 +1117,7 @@ theorem ascPochhammer_prod_eq_factorial (n : ℕ) : ((ascPochhammer ℚ n).eval (5 / 6) * (5 / 6 + n)) = (ascPochhammer ℚ n).eval (1 / 6) * (ascPochhammer ℚ n).eval (1 / 2) * (ascPochhammer ℚ n).eval (5 / 6) * ((1 / 6 + n) * (1 / 2 + n) * (5 / 6 + n)) from by ring, - ih, e6, e3, show 3 * (n + 1) = 3 * n + 3 from by ring, pow_add] + ih, e6, e3, show 3 * (n + 1) = 3 * n + 3 from by omega, pow_add] have hf3 : ((3 * n)! : ℚ) ≠ 0 := by positivity field_simp ring @@ -1138,7 +1133,7 @@ theorem hyp2F1_sq_eq_tsum {z : ℂ} (hz : ‖z‖ < 1) : refine tsum_congr fun n => ?_ have hn : (n ! : ℂ) ≠ 0 := Nat.cast_ne_zero.2 (Nat.factorial_ne_zero n) have h3n : ((3 * n)! : ℂ) ≠ 0 := Nat.cast_ne_zero.2 (Nat.factorial_ne_zero _) - have h12 : (12 : ℂ) ^ (3 * n) ≠ 0 := pow_ne_zero _ (by norm_num) + have h12 : (12 : ℂ) ^ (3 * n) ≠ 0 := pow_ne_zero _ (by norm_num1) -- The `ℂ`-version of the Pochhammer/factorial identity, in multiplicative form. have hprod : (ascPochhammer ℂ n).eval (1 / 6 : ℂ) * (ascPochhammer ℂ n).eval (5 / 6 : ℂ) * (ascPochhammer ℂ n).eval (1 / 2 : ℂ) * ((3 * n)! : ℂ) * (12 : ℂ) ^ (3 * n) @@ -1146,13 +1141,13 @@ theorem hyp2F1_sq_eq_tsum {z : ℂ} (hz : ‖z‖ < 1) : have hℚ := ascPochhammer_prod_eq_factorial n have e6 : (ascPochhammer ℂ n).eval (1 / 6 : ℂ) = (((ascPochhammer ℚ n).eval (1 / 6 : ℚ) : ℚ) : ℂ) := by - rw [show (1 / 6 : ℂ) = ((1 / 6 : ℚ) : ℂ) by norm_num, ← ascPochhammer_eval_ratCast] + rw [show (1 / 6 : ℂ) = ((1 / 6 : ℚ) : ℂ) by norm_num1, ← ascPochhammer_eval_ratCast] have e56 : (ascPochhammer ℂ n).eval (5 / 6 : ℂ) = (((ascPochhammer ℚ n).eval (5 / 6 : ℚ) : ℚ) : ℂ) := by - rw [show (5 / 6 : ℂ) = ((5 / 6 : ℚ) : ℂ) by norm_num, ← ascPochhammer_eval_ratCast] + rw [show (5 / 6 : ℂ) = ((5 / 6 : ℚ) : ℂ) by norm_num1, ← ascPochhammer_eval_ratCast] have e12 : (ascPochhammer ℂ n).eval (1 / 2 : ℂ) = (((ascPochhammer ℚ n).eval (1 / 2 : ℚ) : ℚ) : ℂ) := by - rw [show (1 / 2 : ℂ) = ((1 / 2 : ℚ) : ℂ) by norm_num, ← ascPochhammer_eval_ratCast] + rw [show (1 / 2 : ℂ) = ((1 / 2 : ℚ) : ℂ) by norm_num1, ← ascPochhammer_eval_ratCast] rw [e6, e56, e12, show (((ascPochhammer ℚ n).eval (1 / 6 : ℚ) : ℚ) : ℂ) * (((ascPochhammer ℚ n).eval (5 / 6 : ℚ) : ℚ) : ℂ) * diff --git a/LeanPool/Chudnovsky/Coefficients.lean b/LeanPool/Chudnovsky/Coefficients.lean index 5b8b1adb55..f1df46fdfa 100644 --- a/LeanPool/Chudnovsky/Coefficients.lean +++ b/LeanPool/Chudnovsky/Coefficients.lean @@ -9,6 +9,7 @@ public import LeanPool.Chudnovsky.Estimates import LeanPool.Chudnovsky.ComplexMult import LeanPool.Chudnovsky.MainTheorem import LeanPool.Chudnovsky.Numerics +import LeanPool.Chudnovsky.NumericalBounds import LeanPool.Chudnovsky.SingularModuli import LeanPool.Chudnovsky.SingularModuli.CMRelations import LeanPool.Chudnovsky.SingularModuli.ModularPolynomialZ @@ -55,74 +56,7 @@ private lemma jwert_real_bound {e : ℝ} (hL : (3.80898093700765233822623151647e-18 : ℝ) < e) (hU : e < (3.80898093700765233822623151648e-18 : ℝ)) : |(1 - 240 * e + 2160 * e ^ 2) ^ 3 / (e * (1 + e - e ^ 2) ^ 24) - 640320 ^ 3| < 1 / 2 := by - -- The final tolerance is one half, so coarse rational enclosures suffice. - have hL : (3.808980937007652338e-18 : ℝ) < e := lt_trans (by norm_num) hL - have hU : e < (3.808980937007652339e-18 : ℝ) := lt_trans hU (by norm_num) - have hepos : 0 < e := lt_trans (by norm_num) hL - have he2U : e ^ 2 ≤ (3.808980937007652339e-18 : ℝ) ^ 2 := - pow_le_pow_left₀ hepos.le hU.le 2 - have he2nn : 0 ≤ e ^ 2 := sq_nonneg e - -- enclosures for `g = 1 - 240e + 2160e²` - have hGLg : (1 - 240 * 3.808980937007652339e-18 : ℝ) - ≤ 1 - 240 * e + 2160 * e ^ 2 := by linarith only [hU, he2nn] - have hgGH : 1 - 240 * e + 2160 * e ^ 2 ≤ - (1 - 240 * 3.808980937007652338e-18 - + 2160 * (3.808980937007652339e-18) ^ 2 : ℝ) := by linarith only [hL, he2U] - have hGLpos : (0 : ℝ) < 1 - 240 * 3.808980937007652339e-18 := by norm_num - have hgpos : 0 < 1 - 240 * e + 2160 * e ^ 2 := lt_of_lt_of_le hGLpos hGLg - -- enclosures for `h = 1 + e - e²` - have hHLh : (1 + 3.808980937007652338e-18 - - (3.808980937007652339e-18) ^ 2 : ℝ) ≤ 1 + e - e ^ 2 := by - linarith only [hL, he2U] - have hhHH : 1 + e - e ^ 2 ≤ (1 + 3.808980937007652339e-18 : ℝ) := by - linarith only [hU, he2nn] - have hHLpos : (0 : ℝ) < 1 + 3.808980937007652338e-18 - - (3.808980937007652339e-18) ^ 2 := by norm_num - have hhpos : 0 < 1 + e - e ^ 2 := lt_of_lt_of_le hHLpos hHLh - -- cube / 24-th power the enclosures - have hN_hi : (1 - 240 * e + 2160 * e ^ 2) ^ 3 ≤ - (1 - 240 * 3.808980937007652338e-18 - + 2160 * (3.808980937007652339e-18) ^ 2) ^ 3 := - pow_le_pow_left₀ hgpos.le hgGH 3 - have hN_lo : (1 - 240 * 3.808980937007652339e-18) ^ 3 - ≤ (1 - 240 * e + 2160 * e ^ 2) ^ 3 := pow_le_pow_left₀ hGLpos.le hGLg 3 - have hW_hi : (1 + e - e ^ 2) ^ 24 ≤ (1 + 3.808980937007652339e-18) ^ 24 := - pow_le_pow_left₀ hhpos.le hhHH 24 - have hW_lo : (1 + 3.808980937007652338e-18 - - (3.808980937007652339e-18) ^ 2) ^ 24 ≤ (1 + e - e ^ 2) ^ 24 := - pow_le_pow_left₀ hHLpos.le hHLh 24 - -- the two division enclosures of `S` - have hden_pos : 0 < e * (1 + e - e ^ 2) ^ 24 := mul_pos hepos (pow_pos hhpos 24) - have hSupper : (1 - 240 * e + 2160 * e ^ 2) ^ 3 / (e * (1 + e - e ^ 2) ^ 24) ≤ - (1 - 240 * 3.808980937007652338e-18 - + 2160 * (3.808980937007652339e-18) ^ 2) ^ 3 / - (3.808980937007652338e-18 * - (1 + 3.808980937007652338e-18 - - (3.808980937007652339e-18) ^ 2) ^ 24) := by - apply div_le_div₀ (by positivity) hN_hi - (mul_pos (by norm_num) (pow_pos hHLpos 24)) - exact mul_le_mul hL.le hW_lo (pow_nonneg hHLpos.le 24) hepos.le - have hSlower : (1 - 240 * 3.808980937007652339e-18) ^ 3 / - (3.808980937007652339e-18 * - (1 + 3.808980937007652339e-18) ^ 24) ≤ - (1 - 240 * e + 2160 * e ^ 2) ^ 3 / (e * (1 + e - e ^ 2) ^ 24) := by - apply div_le_div₀ (by positivity) hN_lo hden_pos - exact mul_le_mul hU.le hW_hi (pow_nonneg hhpos.le 24) (by norm_num) - -- the two heavy rational inequalities - have hUpNum : (1 - 240 * 3.808980937007652338e-18 - + 2160 * (3.808980937007652339e-18) ^ 2) ^ 3 / - (3.808980937007652338e-18 * - (1 + 3.808980937007652338e-18 - - (3.808980937007652339e-18) ^ 2) ^ 24) < (640320 : ℝ) ^ 3 + 1 / 2 := by - norm_num - have hLoNum : (640320 : ℝ) ^ 3 - 1 / 2 < - (1 - 240 * 3.808980937007652339e-18) ^ 3 / - (3.808980937007652339e-18 * - (1 + 3.808980937007652339e-18) ^ 24) := by - norm_num - rw [abs_lt] - exact ⟨by linarith only [hLoNum.trans_le hSlower], - by linarith only [hSupper.trans_lt hUpNum]⟩ + exact NumericalBounds.jwert_real_bound hL hU /-- Milla's `jwert2` at `N = 163`, from the integrality input `1728·J(τ₁₆₃) ∈ ℤ` as an explicit hypothesis: the singular value `1728·J(τ₁₆₃) = −640320³`. -/ @@ -162,7 +96,7 @@ theorem jwert_τ₁₆₃_of (hjm : ∃ m : ℤ, 1728 * J τ₁₆₃ = (m : ℂ ≤ ‖1728 * J τ₁₆₃ - 1728 * Jtilde τ₁₆₃‖ + ‖1728 * Jtilde τ₁₆₃ - (-640320 ^ 3 : ℂ)‖ := norm_sub_le_norm_sub_add_norm_sub _ _ _ _ < 0.2 + 1 / 2 := add_lt_add hJJt hnorm_Jt - _ < 1 := by norm_num + _ < 1 := by norm_num1 -- an integer within `< 1` of `−640320³` equals it rw [hm] at hchain have hz : m + 640320 ^ 3 = 0 := by @@ -202,109 +136,7 @@ private lemma s2tilde_real_bound {e pv sv : ℝ} |(1 - 240 * e + 2160 * e ^ 2) / (1 + 504 * e - 16632 * e ^ 2) * (1 + 24 * e - 72 * e ^ 2 - 3 / (pv * (sv / 2))) * 10996566783048 - 9351571368960| < 1 / 2 := by - -- The final tolerance is one half, so coarse rational enclosures suffice. - have heL : (3e-18 : ℝ) < e := lt_trans (by norm_num) heL - have heU : e < (4e-18 : ℝ) := lt_trans heU (by norm_num) - have hpL : (3.14159265358979 : ℝ) < pv := lt_trans (by norm_num) hpL - have hpU : pv < (3.14159265358980 : ℝ) := lt_trans hpU (by norm_num) - have hsL : (12.7671453348037 : ℝ) < sv := lt_trans (by norm_num) hsL - have hsU : sv < (12.7671453348038 : ℝ) := lt_trans hsU (by norm_num) - have hepos : 0 < e := lt_trans (by norm_num) heL - have hp_pos : 0 < pv := lt_trans (by norm_num) hpL - have hs_pos : 0 < sv := lt_trans (by norm_num) hsL - have hpsv : 0 < pv * (sv / 2) := by positivity - -- enclosures for `e²` - have he2U : e ^ 2 ≤ (4e-18 : ℝ) ^ 2 := - pow_le_pow_left₀ hepos.le heU.le 2 - have he2L : (3e-18 : ℝ) ^ 2 ≤ e ^ 2 := - pow_le_pow_left₀ (by norm_num) heL.le 2 - have he2nn : 0 ≤ e ^ 2 := sq_nonneg e - -- num = 1 − 240e + 2160e² - have hnumL : (1 - 240 * 4e-18 : ℝ) - ≤ 1 - 240 * e + 2160 * e ^ 2 := by linarith only [heU, he2nn] - have hnumH : 1 - 240 * e + 2160 * e ^ 2 ≤ - (1 - 240 * 3e-18 - + 2160 * (4e-18) ^ 2 : ℝ) := by linarith only [heL, he2U] - have hnumpos : 0 < 1 - 240 * e + 2160 * e ^ 2 := lt_of_lt_of_le (by norm_num) hnumL - -- den = 1 + 504e − 16632e² - have hdenL : (1 + 504 * 3e-18 - - 16632 * (4e-18) ^ 2 : ℝ) - ≤ 1 + 504 * e - 16632 * e ^ 2 := by linarith only [heL, he2U] - have hdenH : - 1 + 504 * e - 16632 * e ^ 2 ≤ (1 + 504 * 4e-18 : ℝ) := by - linarith only [heU, he2nn] - have hdenpos : 0 < 1 + 504 * e - 16632 * e ^ 2 := lt_of_lt_of_le (by norm_num) hdenL - -- w = 3/(pv·(sv/2)); `wH` (from `πL, sL`) is the max, `wL` (from `πU, sU`) the min - have hwH : 3 / (pv * (sv / 2)) - ≤ (3 / (3.14159265358979 * (12.7671453348037 / 2)) : ℝ) := - div_le_div_of_nonneg_left (by norm_num) (by positivity) - (mul_le_mul hpL.le (by linarith only [hsL]) (by norm_num) hp_pos.le) - have hwL : (3 / (3.14159265358980 * (12.7671453348038 / 2)) : ℝ) - ≤ 3 / (pv * (sv / 2)) := - div_le_div_of_nonneg_left (by norm_num) hpsv - (mul_le_mul hpU.le (by linarith only [hsU]) (by positivity) (by norm_num)) - -- Z = 1 + 24e − 72e² − w : lower bound subtracts `wH`, upper bound subtracts `wL` - have hZL : (1 + 24 * 3e-18 - - 72 * (4e-18) ^ 2 - - 3 / (3.14159265358979 * (12.7671453348037 / 2)) : ℝ) - ≤ 1 + 24 * e - 72 * e ^ 2 - 3 / (pv * (sv / 2)) := by linarith only [heL, he2U, hwH] - have hZH : 1 + 24 * e - 72 * e ^ 2 - 3 / (pv * (sv / 2)) ≤ - (1 + 24 * 4e-18 - - 72 * (3e-18) ^ 2 - - 3 / (3.14159265358980 * (12.7671453348038 / 2)) : ℝ) := by - linarith only [heU, he2L, hwL] - have hZpos : 0 < 1 + 24 * e - 72 * e ^ 2 - 3 / (pv * (sv / 2)) := - lt_of_lt_of_le (by norm_num) hZL - -- num·Z rational enclosures - have hNZlo : (1 - 240 * 4e-18) - * (1 + 24 * 3e-18 - - 72 * (4e-18) ^ 2 - - 3 / (3.14159265358979 * (12.7671453348037 / 2))) - ≤ (1 - 240 * e + 2160 * e ^ 2) * (1 + 24 * e - 72 * e ^ 2 - 3 / (pv * (sv / 2))) := - mul_le_mul hnumL hZL (by norm_num) hnumpos.le - have hNZhi : (1 - 240 * e + 2160 * e ^ 2) * (1 + 24 * e - 72 * e ^ 2 - 3 / (pv * (sv / 2))) - ≤ (1 - 240 * 3e-18 - + 2160 * (4e-18) ^ 2) - * (1 + 24 * 4e-18 - - 72 * (3e-18) ^ 2 - - 3 / (3.14159265358980 * (12.7671453348038 / 2))) := - mul_le_mul hnumH hZH hZpos.le (by norm_num) - -- rewrite the target quantity as `(num·Z)·b / den` - rw [show (1 - 240 * e + 2160 * e ^ 2) / (1 + 504 * e - 16632 * e ^ 2) - * (1 + 24 * e - 72 * e ^ 2 - 3 / (pv * (sv / 2))) * 10996566783048 - = (1 - 240 * e + 2160 * e ^ 2) * (1 + 24 * e - 72 * e ^ 2 - 3 / (pv * (sv / 2))) - * 10996566783048 / (1 + 504 * e - 16632 * e ^ 2) from by ring] - have hlo : (9351571368960 : ℝ) - 1 / 2 < - (1 - 240 * e + 2160 * e ^ 2) * (1 + 24 * e - 72 * e ^ 2 - 3 / (pv * (sv / 2))) - * 10996566783048 / (1 + 504 * e - 16632 * e ^ 2) := by - rw [lt_div_iff₀ hdenpos] - have hb := mul_le_mul_of_nonneg_right hNZlo (by norm_num : (0 : ℝ) ≤ 10996566783048) - have hD := mul_le_mul_of_nonneg_left hdenH - (by norm_num : (0 : ℝ) ≤ 9351571368960 - 1 / 2) - have hnum : (9351571368960 - 1 / 2 : ℝ) * (1 + 504 * 4e-18) - < (1 - 240 * 4e-18) - * (1 + 24 * 3e-18 - - 72 * (4e-18) ^ 2 - - 3 / (3.14159265358979 * (12.7671453348037 / 2))) - * 10996566783048 := by norm_num - exact hD.trans_lt (hnum.trans_le hb) - have hhi : (1 - 240 * e + 2160 * e ^ 2) * (1 + 24 * e - 72 * e ^ 2 - 3 / (pv * (sv / 2))) - * 10996566783048 / (1 + 504 * e - 16632 * e ^ 2) < (9351571368960 : ℝ) + 1 / 2 := by - rw [div_lt_iff₀ hdenpos] - have hb := mul_le_mul_of_nonneg_right hNZhi (by norm_num : (0 : ℝ) ≤ 10996566783048) - have hD := mul_le_mul_of_nonneg_left hdenL - (by norm_num : (0 : ℝ) ≤ 9351571368960 + 1 / 2) - have hnum : (1 - 240 * 3e-18 - + 2160 * (4e-18) ^ 2) - * (1 + 24 * 4e-18 - - 72 * (3e-18) ^ 2 - - 3 / (3.14159265358980 * (12.7671453348038 / 2))) - * 10996566783048 - < (9351571368960 + 1 / 2 : ℝ) * (1 + 504 * 3e-18 - - 16632 * (4e-18) ^ 2) := by norm_num - exact hb.trans_lt (hnum.trans_le hD) - rw [abs_lt] - exact ⟨by linarith only [hlo], by linarith only [hhi]⟩ + exact NumericalBounds.s2tilde_real_bound heL heU hpL hpU hsL hsU /-- Milla's `s2nenner`/`satzhilfszahlen` at `N = 163`, from the integrality and rationality inputs as explicit hypotheses: `s₂(τ₁₆₃) = 77265280/90856689`. -/ @@ -354,7 +186,7 @@ theorem s₂_τ₁₆₃_of (hjm : ∃ m : ℤ, 1728 * J τ₁₆₃ = (m : ℂ) linear_combination -hrel have hKsq : K ^ 2 = (10996566783048 : ℂ) ^ 2 := by rw [hKdef, mul_pow, mul_pow, hsq1, hE6sq, jwert_τ₁₆₃_of hjm] - push_cast; norm_num + push_cast; norm_num only -- hence `K = ±b`, so `s₂·b = ±P` is an algebraic integer have hbranch : K = (10996566783048 : ℂ) ∨ K = -(10996566783048 : ℂ) := by have hfac : (K - 10996566783048) * (K + 10996566783048) = 0 := by linear_combination hKsq @@ -380,12 +212,12 @@ theorem s₂_τ₁₆₃_of (hjm : ∃ m : ℤ, 1728 * J τ₁₆₃ = (m : ℂ) rw [show s₂ τ₁₆₃ * 10996566783048 - s₂tilde τ₁₆₃ * 10996566783048 = (s₂ τ₁₆₃ - s₂tilde τ₁₆₃) * 10996566783048 from by ring, norm_mul, hbnorm] have hq3 : ‖q τ₁₆₃‖ ^ 3 < (3.80898093700765233822623151648e-18 : ℝ) ^ 3 := - pow_lt_pow_left₀ hqbound (norm_nonneg _) (by norm_num) + pow_lt_pow_left₀ hqbound (norm_nonneg _) (by norm_num only) calc ‖s₂ τ₁₆₃ - s₂tilde τ₁₆₃‖ * 10996566783048 < 222000 * ‖q τ₁₆₃‖ ^ 3 * 10996566783048 := by nlinarith [theonaehers2 hτ, hqpos] _ < 222000 * (3.80898093700765233822623151648e-18 : ℝ) ^ 3 * 10996566783048 := by nlinarith [hq3] - _ < 1 / 4 := by norm_num + _ < 1 / 4 := by norm_num only have hnum := s2tilde_real_bound (e := Real.exp (-(π * Real.sqrt 163))) (pv := π) (sv := Real.sqrt 163) exp_neg_pi_sqrt_163_gt exp_neg_pi_sqrt_163_lt pi_gt_high_precision pi_lt_high_precision sqrt_163_gt sqrt_163_lt @@ -411,7 +243,7 @@ theorem s₂_τ₁₆₃_of (hjm : ∃ m : ℤ, 1728 * J τ₁₆₃ = (m : ℂ) + (s₂tilde τ₁₆₃ * 10996566783048 - 9351571368960)‖ := by congr 1; ring _ ≤ _ := norm_add_le _ _ _ < 1 / 4 + 1 / 2 := add_lt_add hpart1 hpart2 - _ < 1 := by norm_num + _ < 1 := by norm_num only rw [hm] at hpin have hmval : m = 9351571368960 := by have hlt : ‖((m - 9351571368960 : ℤ) : ℂ)‖ < 1 := by @@ -424,8 +256,8 @@ theorem s₂_τ₁₆₃_of (hjm : ∃ m : ℤ, 1728 * J τ₁₆₃ = (m : ℂ) -- conclude `s₂ = 9351571368960/10996566783048 = 77265280/90856689` have hfinal : s₂ τ₁₆₃ * 10996566783048 = ((9351571368960 : ℤ) : ℂ) := by rw [hm, hmval] have hval : s₂ τ₁₆₃ = 9351571368960 / 10996566783048 := by - rw [eq_div_iff (by norm_num : (10996566783048 : ℂ) ≠ 0), hfinal]; norm_num - rw [hval]; push_cast; norm_num + rw [eq_div_iff (by norm_num only : (10996566783048 : ℂ) ≠ 0), hfinal]; norm_num only + rw [hval]; push_cast; norm_num only /-- Milla's `s2nenner`/`satzhilfszahlen` at `N = 163`: `s₂(τ₁₆₃) = 77265280/90856689`. -/ @@ -437,7 +269,7 @@ rationality inputs as hypotheses: `(1 − s₂(τ₁₆₃))/6 = 13591409/545140 theorem one_sub_s₂_τ₁₆₃_div_six_of (hjm : ∃ m : ℤ, 1728 * J τ₁₆₃ = (m : ℂ)) (hsr : ∃ r : ℚ, s₂ τ₁₆₃ = (r : ℂ)) : (1 - s₂ τ₁₆₃) / 6 = (13591409 / 545140134 : ℚ) := by - rw [s₂_τ₁₆₃_of hjm hsr]; push_cast; norm_num + rw [s₂_τ₁₆₃_of hjm hsr]; push_cast; norm_num1 /-- The combination entering the Chudnovsky formula: `(1 − s₂(τ₁₆₃))/6 = 13591409/545140134`. -/ diff --git a/LeanPool/Chudnovsky/ComplexMult.lean b/LeanPool/Chudnovsky/ComplexMult.lean index 3f1e04f14c..9a44b3ed99 100644 --- a/LeanPool/Chudnovsky/ComplexMult.lean +++ b/LeanPool/Chudnovsky/ComplexMult.lean @@ -96,9 +96,9 @@ theorem isIntegral_C_mul_conj {τ : ℍ} {A B C : ℤ} have hconj : (A : ℂ) + B * (starRingEnd ℂ) (τ : ℂ) + C * ((starRingEnd ℂ) (τ : ℂ)) ^ 2 = 0 := by have := congrArg (starRingEnd ℂ) hCM - simpa using this + simpa only [map_add, map_intCast, map_mul, map_pow, map_zero] using this refine ⟨Polynomial.X ^ 2 + (Polynomial.C B * Polynomial.X + Polynomial.C (A * C)), ?_, ?_⟩ - · exact Polynomial.monic_X_pow_add (Polynomial.degree_linear_le.trans_lt (by norm_num)) + · exact Polynomial.monic_X_pow_add (Polynomial.degree_linear_le.trans_lt (by norm_num1)) · simp only [Polynomial.eval₂_add, Polynomial.eval₂_pow, Polynomial.eval₂_mul, Polynomial.eval₂_X, Polynomial.eval₂_C] push_cast @@ -108,7 +108,7 @@ theorem isIntegral_C_mul_conj {τ : ℍ} {A B C : ℤ} `j = 1728·J` is (it is a root of `X³ − j`). -/ theorem isIntegral_E₄_div_eta_pow (τ : ℍ) (hj : IsIntegral ℤ (1728 * J τ)) : IsIntegral ℤ (E₄ τ / ModularForm.eta τ ^ 8) := by - refine IsIntegral.of_pow (n := 3) (by norm_num) ?_ + refine IsIntegral.of_pow (n := 3) (by norm_num1) ?_ have hΔ : ModularForm.discriminant τ = ModularForm.eta τ ^ 24 := rfl have hx : (E₄ τ / ModularForm.eta τ ^ 8) ^ 3 = 1728 * J τ := by rw [mul_J_eq, div_pow, show (ModularForm.eta τ ^ 8) ^ 3 = ModularForm.discriminant τ by @@ -119,17 +119,18 @@ theorem isIntegral_E₄_div_eta_pow (τ : ℍ) (hj : IsIntegral ℤ (1728 * J τ `j = 1728·J` is (it is a root of `X² − (j − 1728)`). -/ theorem isIntegral_E₆_div_eta_pow (τ : ℍ) (hj : IsIntegral ℤ (1728 * J τ)) : IsIntegral ℤ (E₆ τ / ModularForm.eta τ ^ 12) := by - refine IsIntegral.of_pow (n := 2) (by norm_num) ?_ + refine IsIntegral.of_pow (n := 2) (by norm_num1) ?_ have hΔ : ModularForm.discriminant τ = ModularForm.eta τ ^ 24 := rfl have hne := discriminant_ne_zero τ have hrel := E₄_cube_sub_E₆_sq_eq_discriminant τ have h1728 : IsIntegral ℤ (1728 : ℂ) := by - rw [show (1728 : ℂ) = algebraMap ℤ ℂ 1728 by simp] + rw [show (1728 : ℂ) = algebraMap ℤ ℂ 1728 by simp only [algebraMap_int_eq, eq_intCast, + Int.cast_ofNat]] exact isIntegral_algebraMap have hx : (E₆ τ / ModularForm.eta τ ^ 12) ^ 2 = 1728 * J τ - 1728 := by rw [mul_J_eq, div_pow, show (ModularForm.eta τ ^ 12) ^ 2 = ModularForm.discriminant τ by rw [hΔ]; ring] - field_simp + field_simp (disch := first | assumption | norm_num1 | positivity) linear_combination -hrel rw [hx] exact hj.sub h1728 @@ -169,14 +170,14 @@ private lemma latHatUnit_pow4 (τ : ℍ) : (latHatUnit τ : ℂ) ^ 4 = (π : ℂ) ^ 4 / 9 * ModularForm.eta τ ^ 8 := by have hs4 : ((Real.sqrt 3 : ℝ) : ℂ) ^ 4 = 9 := by calc ((Real.sqrt 3 : ℝ) : ℂ) ^ 4 = (((Real.sqrt 3 : ℝ) : ℂ) ^ 2) ^ 2 := by ring - _ = 9 := by rw [sqrt3_sq]; norm_num + _ = 9 := by rw [sqrt3_sq]; norm_num1 rw [latHatUnit_val, mul_pow, div_pow, hs4]; ring private lemma latHatUnit_pow6 (τ : ℍ) : (latHatUnit τ : ℂ) ^ 6 = (π : ℂ) ^ 6 / 27 * ModularForm.eta τ ^ 12 := by have hs6 : ((Real.sqrt 3 : ℝ) : ℂ) ^ 6 = 27 := by calc ((Real.sqrt 3 : ℝ) : ℂ) ^ 6 = (((Real.sqrt 3 : ℝ) : ℂ) ^ 2) ^ 3 := by ring - _ = 27 := by rw [sqrt3_sq]; norm_num + _ = 27 := by rw [sqrt3_sq]; norm_num1 rw [latHatUnit_val, mul_pow, div_pow, hs6]; ring /-- `¼g₂(L̂) = 3·E₄/η⁸` (paper `proofzweistern`). -/ @@ -202,7 +203,8 @@ private lemma isIntegral_latHat_g₂_div_four (τ : ℍ) (hj : IsIntegral ℤ (1 IsIntegral ℤ ((latHatUnit τ • Lτ τ).g₂ / 4) := by rw [latHat_g₂_div_four] have h3 : IsIntegral ℤ (3 : ℂ) := by - rw [show (3 : ℂ) = algebraMap ℤ ℂ 3 by simp]; exact isIntegral_algebraMap + rw [show (3 : ℂ) = algebraMap ℤ ℂ 3 by simp only [algebraMap_int_eq, eq_intCast, + Int.cast_ofNat]]; exact isIntegral_algebraMap exact h3.mul (isIntegral_E₄_div_eta_pow τ hj) /-- `¼g₃(L̂)` is an algebraic integer whenever `j = 1728J` is. -/ @@ -210,7 +212,8 @@ private lemma isIntegral_latHat_g₃_div_four (τ : ℍ) (hj : IsIntegral ℤ (1 IsIntegral ℤ ((latHatUnit τ • Lτ τ).g₃ / 4) := by rw [latHat_g₃_div_four] have h2 : IsIntegral ℤ (2 : ℂ) := by - rw [show (2 : ℂ) = algebraMap ℤ ℂ 2 by simp]; exact isIntegral_algebraMap + rw [show (2 : ℂ) = algebraMap ℤ ℂ 2 by simp only [algebraMap_int_eq, eq_intCast, + Int.cast_ofNat]]; exact isIntegral_algebraMap exact h2.mul (isIntegral_E₆_div_eta_pow τ hj) /-- Transfer of integrality: since `¼g₂(L̂)` and `¼g₃(L̂)` are algebraic integers (given @@ -260,10 +263,11 @@ private lemma C_mul_conj_mul {τ : ℍ} {A B C : ℤ} (hCM : (A : ℂ) + B * τ + C * (τ : ℂ) ^ 2 = 0) : ((C : ℂ) * τ) * ((C : ℂ) * (starRingEnd ℂ) (τ : ℂ)) = (A : ℂ) * C := by rcases eq_or_ne ((C : ℂ)) 0 with hC | hC - · simp [hC] + · simp only [hC, zero_mul, mul_zero] · have hconj : (A : ℂ) + B * (starRingEnd ℂ) (τ : ℂ) + C * ((starRingEnd ℂ) (τ : ℂ)) ^ 2 = 0 := by - have := congrArg (starRingEnd ℂ) hCM; simpa using this + have := congrArg (starRingEnd ℂ) hCM; simpa only [map_add, map_intCast, map_mul, map_pow, + map_zero] using this have hX : ((C : ℂ) * τ) ^ 2 + B * ((C : ℂ) * τ) + A * C = 0 := by linear_combination (C : ℂ) * hCM have hY : ((C : ℂ) * (starRingEnd ℂ) (τ : ℂ)) ^ 2 + @@ -301,13 +305,14 @@ section Lemkapa2 /-- The lattice is countable (local copy of the private helper in `DivisionValues.lean`). -/ private lemma countable_lattice_cm (L : PeriodPair) : (↑L.lattice : Set ℂ).Countable := by have : Countable ↥L.lattice := countable_of_Lindelof_of_discrete - simpa using Set.countable_range (Subtype.val : ↥L.lattice → ℂ) + simpa only [Subtype.range_coe_subtype, + SetLike.setOfPred_mem_eq] using Set.countable_range (Subtype.val : ↥L.lattice → ℂ) /-- A signed fraction `k/m` with integral value and `|k| < m` is zero (local copy of the private helper in `DivisionValues.lean`). -/ private lemma frac_den_one_imp_zero_cm {m : ℕ} (hm : 0 < m) {k : ℤ} (hlt : k.natAbs < m) (h : ((k : ℚ) / (m : ℚ)).den = 1) : k = 0 := by - have hmQ : (m : ℚ) ≠ 0 := by exact_mod_cast hm.ne' + have hmQ : (m : ℚ) ≠ 0 := by exact Nat.cast_ne_zero.mpr hm.ne' set q : ℚ := (k : ℚ) / (m : ℚ) with hqdef have heq : ((q.num : ℤ) : ℚ) = q := (Rat.den_eq_one_iff q).mp h have hqk : (k : ℚ) = q.num * (m : ℚ) := by @@ -316,7 +321,7 @@ private lemma frac_den_one_imp_zero_cm {m : ℕ} (hm : 0 < m) {k : ℤ} have hnat : k.natAbs = q.num.natAbs * m := by rw [hkeq, Int.natAbs_mul, Int.natAbs_natCast] rcases Nat.eq_zero_or_pos q.num.natAbs with h0 | h0 - · rw [hkeq]; simp [Int.natAbs_eq_zero.mp h0] + · rw [hkeq]; simp only [Int.natAbs_eq_zero.mp h0, zero_mul] · exfalso have hle : m ≤ q.num.natAbs * m := Nat.le_mul_of_pos_left m h0 omega @@ -353,9 +358,9 @@ private lemma weierstrassZeta_add_int_cm (L : PeriodPair) {ω et : ℂ} (hω : apply hw have hb : (b : ℂ) * ω ∈ L.lattice := by rw [← zsmul_eq_mul]; exact zsmul_mem hω b - simpa using sub_mem hc hb + simpa only [add_sub_cancel_right] using sub_mem hc hb induction a using Int.induction_on with - | zero => simp + | zero => simp only [Int.cast_zero, zero_mul, add_zero] | succ k ih => rw [show w + ((k + 1 : ℤ) : ℂ) * ω = (w + ((k : ℤ) : ℂ) * ω) + ω by push_cast; ring, hq _ (hmem k), ih] @@ -395,7 +400,7 @@ private def cmSet (B C : ℤ) (M : ℕ) : Finset (Fin M × Fin M) := private lemma mem_cmSet_iff {B C : ℤ} {M : ℕ} {v : Fin M × Fin M} : v ∈ cmSet B C M ↔ C ∣ (v.2 : ℤ) ∧ (M : ℤ) ∣ C * (v.1 : ℤ) - B * (v.2 : ℤ) := by - simp [cmSet] + simp only [cmSet, Finset.mem_filter, Finset.mem_univ, true_and] private lemma zero_mem_cmSet {B C : ℤ} {M : ℕ} [NeZero M] : (0 : Fin M × Fin M) ∈ cmSet B C M := by @@ -403,7 +408,7 @@ private lemma zero_mem_cmSet {B C : ℤ} {M : ℕ} [NeZero M] : /-- `Cτ ∈ L_τ`. -/ private lemma cm_alpha_mem (τ : ℍ) (C : ℤ) : (C : ℂ) * τ ∈ (Lτ τ).lattice := - PeriodPair.mem_lattice.mpr ⟨0, C, by simp⟩ + PeriodPair.mem_lattice.mpr ⟨0, C, by simp only [Int.cast_zero, Lτ_ω₁, mul_one, Lτ_ω₂, zero_add]⟩ /-- Multiplication by `α = Cτ` maps the lattice into itself (this is complex multiplication: `Cτ·1 = Cτ ∈ L` and `Cτ·τ = −A − Bτ ∈ L`). -/ @@ -475,8 +480,8 @@ private lemma cmSet_exists_add_mem {τ : ℍ} {A B C : ℤ} {M : ℕ} have hb1 : x.toNat < M := (Int.toNat_lt hx0).mpr hxM have hb2 : (C * y).toNat < M := (Int.toNat_lt hCy0).mpr hCyM set v : Fin M × Fin M := (⟨x.toNat, hb1⟩, ⟨(C * y).toNat, hb2⟩) with hvdef - have hv1 : ((v.1 : ℕ) : ℤ) = x := by simp [hvdef, Int.toNat_of_nonneg hx0] - have hv2 : ((v.2 : ℕ) : ℤ) = C * y := by simp [hvdef, Int.toNat_of_nonneg hCy0] + have hv1 : ((v.1 : ℕ) : ℤ) = x := by simp only [hvdef, Int.toNat_of_nonneg hx0] + have hv2 : ((v.2 : ℕ) : ℤ) = C * y := by simp only [hvdef, Int.toNat_of_nonneg hCy0] refine ⟨v, ?_, ?_⟩ · -- membership in `cmSet` rw [mem_cmSet_iff] @@ -585,7 +590,7 @@ private lemma card_cmSet {A B C : ℤ} {M : ℕ} (hA : 0 < A) (hC : 0 < C) calc (C : ℤ) * (((v.1 : ℕ) : ℤ) - B * (y : ℤ)) = C * ((v.1 : ℕ) : ℤ) - B * ((v.2 : ℕ) : ℤ) := by rw [hv2y]; ring _ = (M : ℤ) * d := hd - _ = C * (A * d) := by rw [hMAC]; ring + _ = C * (A * d) := by rw [hMAC]; ac_rfl exact mul_left_cancel₀ hCne hCC have hmod : (B * (y : ℤ)) % A = ((v.1 : ℕ) : ℤ) % A := by conv_rhs => rw [show ((v.1 : ℕ) : ℤ) = B * (y : ℤ) + A * d by linarith only [hAd]] @@ -607,7 +612,7 @@ private lemma card_cmSet {A B C : ℤ} {M : ℕ} (hA : 0 < A) (hC : 0 < C) rw [Nat.add_mul_div_left _ _ ha0, Nat.div_eq_of_lt ((Int.toNat_lt_toNat hA).mpr h1), zero_add] rw [key, Finset.card_univ] - simp [hM] + simp only [Fintype.card_prod, Fintype.card_fin, hM] private lemma cmM_pos {A C : ℤ} {M : ℕ} (hA : 0 < A) (hC : 0 < C) (hMAC : (M : ℤ) = A * C) : 0 < M := by @@ -642,7 +647,7 @@ private lemma mulPoleCM_identity {τ : ℍ} {C : ℤ} {M : ℕ} exact ((Lτ τ).weierstrassP_add_coe ((C : ℂ) * τ * (w - z)) ⟨_, hmp⟩).symm have hfrac : ((C : ℂ) * τ) ^ 2 * (((C : ℂ) * τ * (w - z)) ^ 2)⁻¹ = ((w - z) ^ 2)⁻¹ := by rcases eq_or_ne (w - z) 0 with h | h - · simp [h] + · simp only [h, mul_zero, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, zero_pow, inv_zero] · field_simp rw [hE1, hE2, hP1, hP2] linear_combination -hfrac @@ -684,7 +689,7 @@ private lemma analyticAt_mulDiffCM {τ : ℍ} {A B C : ℤ} {M : ℕ} intro hcc exact divPt_sub_notMem_lattice_cm (Lτ τ) hM0 hne (by have h := sub_mem hcc hv₀ - simpa [add_sub_add_left_eq_sub] using h) + simpa only [add_sub_add_left_eq_sub] using h) have hf : AnalyticAt ℂ (fun w : ℂ => w + (Lτ τ).divPt M v) z := by fun_prop exact ((Lτ τ).analyticOnNhd_weierstrassP _ hnl).comp_of_eq hf rfl · apply AnalyticAt.sub @@ -700,7 +705,7 @@ private lemma analyticAt_mulDiffCM {τ : ℍ} {A B C : ℤ} {M : ℕ} · apply Finset.analyticAt_fun_sum intro v hv have hnl : z + (Lτ τ).divPt M v ∉ (Lτ τ).lattice := fun hcc => hmp (by - simpa [mul_add] using + simpa only [mul_add, add_sub_cancel_right] using sub_mem (cm_alpha_mul_mem hCM hcc) (cmSet_mul_divPt_mem hCM hM0 hMAC hv)) have hf : AnalyticAt ℂ (fun w : ℂ => w + (Lτ τ).divPt M v) z := by fun_prop exact ((Lτ τ).analyticOnNhd_weierstrassP _ hnl).comp_of_eq hf rfl @@ -754,7 +759,7 @@ private lemma hasDerivAt_zetaCombCM {τ : ℍ} {A B C : ℤ} {M : ℕ} (-((Lτ τ).weierstrassP (z + (Lτ τ).divPt M v))) z := by intro v hv have hp : z + (Lτ τ).divPt M v ∉ (Lτ τ).lattice := fun hcc => hU (by - simpa [mul_add] using + simpa only [mul_add, add_sub_cancel_right] using sub_mem (cm_alpha_mul_mem hCM hcc) (cmSet_mul_divPt_mem hCM hM0 hMAC hv)) exact (hda _ hp).comp_add_const z _ have hsum : HasDerivAt @@ -765,7 +770,7 @@ private lemma hasDerivAt_zetaCombCM {τ : ℍ} {A B C : ℤ} {M : ℕ} ((C : ℂ) * τ * -((Lτ τ).weierstrassP ((C : ℂ) * τ * z))) z := by have h := HasDerivAt.scomp (𝕜 := ℂ) z (hda _ hU) ((hasDerivAt_id' z).const_mul ((C : ℂ) * τ)) - simpa [Function.comp_def, mul_comm] using h + simpa only [mul_comm, mul_neg, Function.comp_def, mul_one, smul_eq_mul] using h have hterm2 : HasDerivAt (fun w => (C : ℂ) * τ * (Lτ τ).weierstrassZeta ((C : ℂ) * τ * w)) ((C : ℂ) * τ * ((C : ℂ) * τ * -((Lτ τ).weierstrassP ((C : ℂ) * τ * z)))) z := HasDerivAt.const_mul ((C : ℂ) * τ) hcomp2 @@ -831,13 +836,16 @@ private lemma mulDiffCM_const_value {τ : ℍ} {A B C : ℤ} {M : ℕ} set S : Set ℂ := (fun z => (C : ℂ) * τ * z) ⁻¹' (↑(Lτ τ).lattice) with hSdef have hScount : S.Countable := (countable_lattice_cm (Lτ τ)).preimage (mul_right_injective₀ hα0) - have hSclosed : IsClosed S := IsClosed.preimage (by fun_prop) (Lτ τ).isClosed_lattice + have hSclosed : IsClosed S := IsClosed.preimage + SeparatelyContinuousMul.continuous_const_mul (Lτ τ).isClosed_lattice have hUopen : IsOpen (Sᶜ : Set ℂ) := hSclosed.isOpen_compl have hUconn : IsPreconnected (Sᶜ : Set ℂ) := - (hScount.isConnected_compl_of_one_lt_rank (by simp)).isPreconnected + (hScount.isConnected_compl_of_one_lt_rank (by simp only [rank_real_complex, + Nat.one_lt_ofNat])).isPreconnected have hcount2 : (S ∪ (fun z => z + 1) ⁻¹' S).Countable := hScount.union (hScount.preimage (add_left_injective 1)) - obtain ⟨z₀, hz₀⟩ := (hcount2.isConnected_compl_of_one_lt_rank (by simp)).nonempty + obtain ⟨z₀, hz₀⟩ := (hcount2.isConnected_compl_of_one_lt_rank (by simp only [rank_real_complex, + Nat.one_lt_ofNat])).nonempty rw [Set.mem_compl_iff, Set.mem_union, not_or] at hz₀ obtain ⟨hz₀S, hz₀S'⟩ := hz₀ have hUz₀ : (C : ℂ) * τ * z₀ ∉ (Lτ τ).lattice := hz₀S diff --git a/LeanPool/Chudnovsky/DivisionValues.lean b/LeanPool/Chudnovsky/DivisionValues.lean index 5a388929e1..c8e45dbe53 100644 --- a/LeanPool/Chudnovsky/DivisionValues.lean +++ b/LeanPool/Chudnovsky/DivisionValues.lean @@ -59,7 +59,7 @@ private lemma div_den_eq_one_imp {m : ℕ} (hm : 0 < m) {k : ℕ} (hk : k < m) have hnn : (0 : ℤ) ≤ q.num := by have := h0; rw [← heq] at this; exact_mod_cast this have hl1 : q.num < 1 := by have := h1; rw [← heq] at this; exact_mod_cast this have hnum0 : q.num = 0 := by omega - have hq0 : q = 0 := by rw [← heq, hnum0]; simp + have hq0 : q = 0 := by rw [← heq, hnum0]; simp only [Int.cast_zero] rw [hqdef] at hq0 rcases div_eq_zero_iff.mp hq0 with hkq | hmq · exact_mod_cast hkq @@ -78,8 +78,10 @@ theorem divPt_notMem_lattice {m : ℕ} [NeZero m] {v : Fin m × Fin m} (hv : v obtain ⟨hd1, hd2⟩ := hmem have e1 := div_den_eq_one_imp hmpos v.1.2 hd1 have e2 := div_den_eq_one_imp hmpos v.2.2 hd2 - have hv1 : v.1 = 0 := Fin.val_injective (by simpa using e1) - have hv2 : v.2 = 0 := Fin.val_injective (by simpa using e2) + have hv1 : v.1 = 0 := Fin.val_injective (by simpa only [Fin.coe_ofNat_eq_mod, Nat.zero_mod, + Fin.val_eq_zero_iff] using e1) + have hv2 : v.2 = 0 := Fin.val_injective (by simpa only [Fin.coe_ofNat_eq_mod, Nat.zero_mod, + Fin.val_eq_zero_iff] using e2) exact hv (Prod.ext hv1 hv2) /-! ## The σ-transformation law (paper Prop. `trafosigma`) @@ -92,7 +94,8 @@ plan (parallel to the derivation in `Fourier.lean`, which we cannot import here) `Quasiperiods.lean`). -/ private lemma countable_lattice' : (↑L.lattice : Set ℂ).Countable := by have : Countable ↥L.lattice := countable_of_Lindelof_of_discrete - simpa using Set.countable_range (Subtype.val : ↥L.lattice → ℂ) + simpa only [Subtype.range_coe_subtype, + SetLike.setOfPred_mem_eq] using Set.countable_range (Subtype.val : ↥L.lattice → ℂ) /-- `σ` is nonzero away from the lattice. -/ private lemma weierstrassSigma_ne_zero {x : ℂ} (hx : x ∉ L.lattice) : @@ -241,7 +244,7 @@ private theorem Fm_add_intmul {p : ℂ} {m : ℕ} (hp : ∀ w, L.Fm m (w + p) = rw [show x - p + p = x by ring] at this exact this.symm induction a using Int.induction_on with - | zero => simp + | zero => simp only [Int.cast_zero, zero_mul, add_zero] | succ k ih => have heq : w + ((↑k + 1 : ℤ) : ℂ) * p = (w + (↑k : ℤ) * p) + p := by push_cast; ring rw [heq, hp, ih] @@ -284,7 +287,7 @@ The argument has three steps: /-- A signed fraction `k/m` with integral value and `|k| < m` is zero. -/ private lemma frac_den_one_imp_zero {m : ℕ} (hm : 0 < m) {k : ℤ} (hlt : k.natAbs < m) (h : ((k : ℚ) / (m : ℚ)).den = 1) : k = 0 := by - have hmQ : (m : ℚ) ≠ 0 := by exact_mod_cast hm.ne' + have hmQ : (m : ℚ) ≠ 0 := by exact Nat.cast_ne_zero.mpr hm.ne' set q : ℚ := (k : ℚ) / (m : ℚ) with hqdef have heq : ((q.num : ℤ) : ℚ) = q := (Rat.den_eq_one_iff q).mp h have hqk : (k : ℚ) = q.num * (m : ℚ) := by @@ -293,7 +296,7 @@ private lemma frac_den_one_imp_zero {m : ℕ} (hm : 0 < m) {k : ℤ} have hnat : k.natAbs = q.num.natAbs * m := by rw [hkeq, Int.natAbs_mul, Int.natAbs_natCast] rcases Nat.eq_zero_or_pos q.num.natAbs with h0 | h0 - · rw [hkeq]; simp [Int.natAbs_eq_zero.mp h0] + · rw [hkeq]; simp only [Int.natAbs_eq_zero.mp h0, zero_mul] · exfalso have hle : m ≤ q.num.natAbs * m := Nat.le_mul_of_pos_left m h0 omega @@ -302,7 +305,7 @@ private lemma frac_den_one_imp_zero {m : ℕ} (hm : 0 < m) {k : ℤ} private lemma frac_den_one_of_dvd {m : ℕ} (hm : 0 < m) {k : ℤ} (h : (m : ℤ) ∣ k) : ((k : ℚ) / (m : ℚ)).den = 1 := by obtain ⟨j, rfl⟩ := h - have hmQ : (m : ℚ) ≠ 0 := by exact_mod_cast hm.ne' + have hmQ : (m : ℚ) ≠ 0 := by exact Nat.cast_ne_zero.mpr hm.ne' have : (((m : ℤ) * j : ℤ) : ℚ) / (m : ℚ) = (j : ℚ) := by push_cast rw [mul_comm, mul_div_assoc, div_self hmQ, mul_one] @@ -325,7 +328,7 @@ private lemma mul_mem_lattice_of_add_divPt_mem {m : ℕ} [NeZero m] {z : ℂ} {v have h1 : (m : ℂ) * (z + L.divPt m v) ∈ L.lattice := by rw [← nsmul_eq_mul]; exact nsmul_mem h m have h2 := sub_mem h1 (L.mul_divPt_mem_lattice v) - simpa [mul_add] using h2 + simpa only [mul_add, add_sub_cancel_right] using h2 /-- Division points with distinct indices differ by a non-lattice point. -/ private lemma divPt_sub_notMem_lattice {m : ℕ} [NeZero m] {v v' : Fin m × Fin m} (hne : v ≠ v') : @@ -401,7 +404,7 @@ private lemma mulPole_identity {m : ℕ} [NeZero m] {z : ℂ} {v₀ : Fin m × F (hv₀ : z + L.divPt m v₀ ∈ L.lattice) (hmp : (m : ℂ) * z ∈ L.lattice) (w : ℂ) : L.weierstrassP (w + L.divPt m v₀) - (m : ℂ) ^ 2 * L.weierstrassP (m * w) = L.weierstrassPExcept 0 (w - z) - (m : ℂ) ^ 2 * L.weierstrassPExcept 0 (m * (w - z)) := by - have hm0 : (m : ℂ) ≠ 0 := by exact_mod_cast (NeZero.pos m).ne' + have hm0 : (m : ℂ) ≠ 0 := by exact Nat.cast_ne_zero.mpr (NeZero.ne m) have hE1 : L.weierstrassPExcept 0 (w - z) = L.weierstrassP (w - z) + -((w - z) ^ 2)⁻¹ := by simpa using L.weierstrassPExcept_def (0 : L.lattice) (w - z) have hE2 : L.weierstrassPExcept 0 (m * (w - z)) @@ -415,7 +418,7 @@ private lemma mulPole_identity {m : ℕ} [NeZero m] {z : ℂ} {v₀ : Fin m × F exact (L.weierstrassP_add_coe (m * (w - z)) ⟨_, hmp⟩).symm have hfrac : (m : ℂ) ^ 2 * (((m : ℂ) * (w - z)) ^ 2)⁻¹ = ((w - z) ^ 2)⁻¹ := by rcases eq_or_ne (w - z) 0 with h | h - · simp [h] + · simp only [h, mul_zero, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, zero_pow, inv_zero] · field_simp rw [hE1, hE2, hP1, hP2] linear_combination -hfrac @@ -447,7 +450,7 @@ private lemma analyticAt_mulDiff {m : ℕ} [NeZero m] (z : ℂ) : AnalyticAt ℂ intro hc exact L.divPt_sub_notMem_lattice hne (by have h := sub_mem hc hv₀ - simpa [add_sub_add_left_eq_sub] using h) + simpa only [add_sub_add_left_eq_sub] using h) have hf : AnalyticAt ℂ (fun w : ℂ => w + L.divPt m v) z := by fun_prop exact (L.analyticOnNhd_weierstrassP _ hnl).comp_of_eq hf rfl · apply AnalyticAt.sub @@ -492,14 +495,14 @@ private lemma exists_mulDiff_const {m : ℕ} [NeZero m] : ∃ c : ℂ, ∀ z, L. private lemma weierstrassZeta_add_nat_ω₁ {w : ℂ} (hw : w ∉ L.lattice) (k : ℕ) : L.weierstrassZeta (w + (k : ℂ) * L.ω₁) = L.weierstrassZeta w + (k : ℂ) * L.eta₁ := by induction k with - | zero => simp + | zero => simp only [CharP.cast_eq_zero, zero_mul, add_zero] | succ n ih => have hmem : w + (n : ℂ) * L.ω₁ ∉ L.lattice := by intro hc apply hw have hn : (n : ℂ) * L.ω₁ ∈ L.lattice := by rw [← nsmul_eq_mul]; exact nsmul_mem L.ω₁_mem_lattice n - simpa using sub_mem hc hn + simpa only [add_sub_cancel_right] using sub_mem hc hn rw [show w + (↑(n + 1) : ℂ) * L.ω₁ = (w + (n : ℂ) * L.ω₁) + L.ω₁ by push_cast; ring, L.weierstrassZeta_add_ω₁ _ hmem, ih] push_cast; ring @@ -529,7 +532,7 @@ private lemma hasDerivAt_zetaComb {m : ℕ} [NeZero m] {z : ℂ} (hU : (m : ℂ) have hcomp2 : HasDerivAt (fun w => L.weierstrassZeta ((m : ℂ) * w)) ((m : ℂ) * -(L.weierstrassP ((m : ℂ) * z))) z := by have h := HasDerivAt.scomp (𝕜 := ℂ) z (hda _ hU) ((hasDerivAt_id' z).const_mul (m : ℂ)) - simpa [Function.comp_def, mul_comm] using h + simpa only [mul_comm, mul_neg, Function.comp_def, mul_one, smul_eq_mul] using h have hterm2 : HasDerivAt (fun w => (m : ℂ) * L.weierstrassZeta ((m : ℂ) * w)) ((m : ℂ) * ((m : ℂ) * -(L.weierstrassP ((m : ℂ) * z)))) z := HasDerivAt.const_mul (m : ℂ) hcomp2 @@ -571,11 +574,12 @@ domain `{m·z ∉ L}`, hence is constant; comparing at `z` and `z + ω₁` (wher forces `c·ω₁ = 0`, so `c = 0`. -/ private lemma mulDiff_const_eq_zero {m : ℕ} [NeZero m] {c : ℂ} (hc : ∀ z, L.mulDiff m z = c) : c = 0 := by - have hm0 : (m : ℂ) ≠ 0 := by exact_mod_cast (NeZero.pos m).ne' + have hm0 : (m : ℂ) ≠ 0 := by exact Nat.cast_ne_zero.mpr (NeZero.ne m) set B : Set ℂ := (fun z => (m : ℂ) * z) ⁻¹' (↑L.lattice) with hBdef have hmemB : ∀ x, x ∈ B ↔ (m : ℂ) * x ∈ L.lattice := fun x => Iff.rfl have hBcount : B.Countable := L.countable_lattice'.preimage (mul_right_injective₀ hm0) - have hBclosed : IsClosed B := IsClosed.preimage (by fun_prop) L.isClosed_lattice + have hBclosed : IsClosed B := IsClosed.preimage + SeparatelyContinuousMul.continuous_const_mul L.isClosed_lattice have hUopen : IsOpen (Bᶜ : Set ℂ) := hBclosed.isOpen_compl have hUconn : IsPreconnected (Bᶜ : Set ℂ) := (hBcount.isConnected_compl_of_one_lt_rank (by simp)).isPreconnected @@ -646,7 +650,7 @@ private lemma differentiable_sigmaProd : rw [← differentiableOn_univ] refine (L.hasProdLocallyUniformly_weierstrassSigmaTerm.hasProdLocallyUniformlyOn).differentiableOn (.of_forall fun _ ↦ ?_) isOpen_univ - simpa [Finset.prod_fn] using + simpa only [ne_eq, Finset.prod_fn] using DifferentiableOn.finsetProd fun i _ ↦ (hterm (i.1 : ℂ)).differentiableOn /-- `Q(0) = 1`. -/ @@ -680,7 +684,7 @@ private lemma sigma_meromorphicOrderAt (w : ℂ) : have hAn : AnalyticAt ℂ L.weierstrassSigma w := L.differentiable_weierstrassSigma.analyticAt w rw [hAn.meromorphicOrderAt_eq, analyticOrderAt_eq_zero.mpr (.inr (L.weierstrassSigma_ne_zero hw))] - simp + simp only [ENat.map_zero, CharP.cast_eq_zero, WithTop.coe_zero] /-- Translating the argument of `σ` shifts the base point of the meromorphic order. -/ private lemma sigma_shift_meromorphicOrderAt (a w : ℂ) : @@ -697,7 +701,7 @@ private lemma one_le_untop₀_meromorphicOrderAt {c a : ℂ} (ha : a ∉ L.latti set f : ℂ → ℂ := fun z => L.weierstrassP z - c with hf_def have hAn : AnalyticAt ℂ f a := by rw [hf_def]; have := L.analyticOnNhd_weierstrassP a ha; fun_prop - have hfa : f a = 0 := by rw [hf_def]; simp [hc] + have hfa : f a = 0 := by rw [hf_def]; simp only [hc, sub_self] have hz0 : analyticOrderAt f a ≠ 0 := hAn.analyticOrderAt_ne_zero.mpr hfa have hne : meromorphicOrderAt f a ≠ ⊤ := by have hmero : Meromorphic f := by rw [hf_def]; fun_prop @@ -855,7 +859,7 @@ private lemma meromorphicOrderAt_shift (f : ℂ → ℂ) (a w : ℂ) : private lemma weierstrassP_eq_of_sub_mem {w s : ℂ} (h : w - s ∈ L.lattice) : L.weierstrassP s = L.weierstrassP w := by have := L.weierstrassP_sub_coe w ⟨w - s, h⟩ - rwa [show w - ((⟨w - s, h⟩ : L.lattice) : ℂ) = s by simp] at this + rwa [show w - ((⟨w - s, h⟩ : L.lattice) : ℂ) = s by simp only [sub_sub_cancel]] at this /-- The meromorphic order of `℘ − c` is invariant under lattice translation of the base point. -/ @@ -876,7 +880,7 @@ private lemma wpsub_meromorphicOrderAt_eq_one {c a : ℂ} (ha : a ∉ L.lattice) have hAn : AnalyticAt ℂ (fun z => L.weierstrassP z - c) a := by have := L.analyticOnNhd_weierstrassP a ha; fun_prop have h1 : analyticOrderAt (fun z => L.weierstrassP z - c) a = 1 := by - apply hAn.analyticOrderAt_eq_one_of_zero_deriv_ne_zero (by simp [hc]) + apply hAn.analyticOrderAt_eq_one_of_zero_deriv_ne_zero (by simp only [hc, sub_self]) rw [deriv_sub_const, L.deriv_weierstrassP] exact hd rw [hAn.meromorphicOrderAt_eq, h1] @@ -890,7 +894,7 @@ private lemma wpsub_meromorphicOrderAt_eq_two {c a : ℂ} (ha : a ∉ L.lattice) have h2 : 2 ≤ (meromorphicOrderAt f a).untop₀ := L.two_le_untop₀_meromorphicOrderAt ha hc hd have hne : meromorphicOrderAt f a ≠ ⊤ := by - intro htop; rw [htop] at h2; simp at h2 + intro htop; rw [htop] at h2; simp only [WithTop.untop₀_top, Int.reduceLE] at h2 -- upper bound via translation to the fundamental parallelogram and the counting bound obtain ⟨p, hpf, hpl⟩ := L.exists_mem_fund a have hordeq : meromorphicOrderAt f a = meromorphicOrderAt f p := by @@ -899,7 +903,7 @@ private lemma wpsub_meromorphicOrderAt_eq_two {c a : ℂ} (ha : a ∉ L.lattice) exact h have hpnl : p ∉ L.lattice := by intro hplat - exact ha (by simpa using add_mem hplat hpl) + exact ha (by simpa only [add_sub_cancel] using add_mem hplat hpl) have hpc : L.weierstrassP p = c := by rw [L.weierstrassP_eq_of_sub_mem hpl, hc] have hbound := L.sum_untop₀_meromorphicOrderAt_le_two c {p} (fun x hx => by rw [Finset.mem_singleton.mp hx]; exact hpf) @@ -919,8 +923,8 @@ private lemma wpsub_meromorphicOrderAt_eq_zero {c a : ℂ} (ha : a ∉ L.lattice have hAn : AnalyticAt ℂ (fun z => L.weierstrassP z - c) a := by have := L.analyticOnNhd_weierstrassP a ha; fun_prop rw [hAn.meromorphicOrderAt_eq, - analyticOrderAt_eq_zero.mpr (.inr (by simpa using sub_ne_zero.mpr hne))] - simp + analyticOrderAt_eq_zero.mpr (.inr (by simpa only [ne_eq] using sub_ne_zero.mpr hne))] + simp only [ENat.map_zero, CharP.cast_eq_zero, WithTop.coe_zero] /-- The meromorphic order of the σ-quotient `A(w) = σ(w+v)σ(w−v)/σ(w)²` decomposes as a sum of orders of shifted σ's. -/ @@ -932,14 +936,12 @@ private lemma sigmaQuot_meromorphicOrderAt (v z : ℂ) : - 2 * meromorphicOrderAt L.weierstrassSigma z := by have hσa : ∀ x : ℂ, AnalyticAt ℂ L.weierstrassSigma x := fun x => L.differentiable_weierstrassSigma.analyticAt x - have hm1 : MeromorphicAt (fun w => L.weierstrassSigma (w + v)) z := by - have : AnalyticAt ℂ (fun w : ℂ => L.weierstrassSigma (w + v)) z := by - have := hσa (z + v); fun_prop - exact this.meromorphicAt - have hm2 : MeromorphicAt (fun w => L.weierstrassSigma (w - v)) z := by - have : AnalyticAt ℂ (fun w : ℂ => L.weierstrassSigma (w - v)) z := by - have := hσa (z - v); fun_prop - exact this.meromorphicAt + have hm1 : MeromorphicAt (fun w => L.weierstrassSigma (w + v)) z := + ((hσa (z + v)).comp (f := fun w : ℂ => w + v) + (analyticAt_id.add analyticAt_const)).meromorphicAt + have hm2 : MeromorphicAt (fun w => L.weierstrassSigma (w - v)) z := + ((hσa (z - v)).comp (f := fun w : ℂ => w - v) + (analyticAt_id.sub analyticAt_const)).meromorphicAt have hm3 : MeromorphicAt (fun w => L.weierstrassSigma w ^ 2) z := ((hσa z).fun_pow 2).meromorphicAt have hshift1 : meromorphicOrderAt (fun w => L.weierstrassSigma (w + v)) z @@ -948,12 +950,12 @@ private lemma sigmaQuot_meromorphicOrderAt (v z : ℂ) : have hshift2 : meromorphicOrderAt (fun w => L.weierstrassSigma (w - v)) z = meromorphicOrderAt L.weierstrassSigma (z - v) := by have h := L.sigma_shift_meromorphicOrderAt (-v) z - simpa [sub_eq_add_neg] using h + simpa only [sub_eq_add_neg] using h have hpow : meromorphicOrderAt (fun w => L.weierstrassSigma w ^ 2) z = 2 * meromorphicOrderAt L.weierstrassSigma z := by rw [show (fun w => L.weierstrassSigma w ^ 2) = L.weierstrassSigma ^ 2 from rfl, meromorphicOrderAt_pow (hσa z).meromorphicAt] - norm_num + norm_num only rw [show (fun w => L.weierstrassSigma (w + v) * L.weierstrassSigma (w - v) / L.weierstrassSigma w ^ 2) = ((fun w => L.weierstrassSigma (w + v)) * (fun w => L.weierstrassSigma (w - v))) @@ -1023,7 +1025,7 @@ private lemma periodic_add_intmul {F : ℂ → ℂ} {p : ℂ} (hp : ∀ w, F (w rw [show x - p + p = x by ring] at this exact this.symm induction a using Int.induction_on with - | zero => simp + | zero => simp only [Int.cast_zero, zero_mul, add_zero] | succ k ih => have heq : w + ((↑k + 1 : ℤ) : ℂ) * p = (w + (↑k : ℤ) * p) + p := by push_cast; ring rw [heq, hp, ih] @@ -1087,8 +1089,8 @@ private lemma trailingCoeff_wpsub_zero (c : ℂ) : rw [hP, hh] simp only [sub_zero, smul_eq_mul] rw [show (z : ℂ) ^ (-2 : ℤ) = (z ^ 2)⁻¹ by - rw [zpow_neg, ← zpow_natCast z 2]; norm_num] - field_simp + rw [zpow_neg, ← zpow_natCast z 2]; norm_num only] + field_simp (disch := first | assumption | norm_num1 | positivity) ring rw [hAn.meromorphicTrailingCoeffAt_of_ne_zero_of_eq_nhdsNE (by rw [h0]; exact one_ne_zero) hEq, h0] @@ -1183,7 +1185,8 @@ theorem lemwpsigma {u v : ℂ} (hu : u ∉ L.lattice) (hv : v ∉ L.lattice) : have := L.analyticOnNhd_weierstrassP x hx fun_prop have hconn : IsPreconnected ((↑L.lattice : Set ℂ)ᶜ) := - (L.countable_lattice'.isConnected_compl_of_one_lt_rank (by simp)).isPreconnected + (L.countable_lattice'.isConnected_compl_of_one_lt_rank (by simp only [Complex.rank_real_complex, + Nat.one_lt_ofNat])).isPreconnected have hx₀ : L.ω₁ / 2 ∈ ((↑L.lattice : Set ℂ)ᶜ) := L.ω₁_div_two_notMem_lattice have hfreq : ∃ᶠ z in 𝓝[≠] (L.ω₁ / 2), A z = c * g z := by have hm := mem_codiscrete.mp hcod (L.ω₁ / 2) @@ -1223,9 +1226,9 @@ private lemma mul_mem_lattice_of_sub_divPt_mem {m : ℕ} [NeZero m] {z : ℂ} private lemma sigma_mulArg_meromorphicOrderAt (m : ℕ) [NeZero m] (z : ℂ) : meromorphicOrderAt (fun t => L.weierstrassSigma ((m : ℂ) * t)) z = meromorphicOrderAt L.weierstrassSigma ((m : ℂ) * z) := by - have hm : (m : ℂ) ≠ 0 := by exact_mod_cast (NeZero.pos m).ne' + have hm : (m : ℂ) ≠ 0 := by exact Nat.cast_ne_zero.mpr (NeZero.ne m) have hd : deriv (fun t : ℂ => (m : ℂ) * t) z = m := by - simp + simp only [deriv_const_mul_id'] have h := meromorphicOrderAt_comp_of_deriv_ne_zero (f := L.weierstrassSigma) (g := fun t => (m : ℂ) * t) (x := z) (by fun_prop) (by rw [hd]; exact hm) simpa only [Function.comp_def] using h @@ -1341,7 +1344,7 @@ private lemma Fm_sq_meromorphicOrderAt_eq (m : ℕ) [NeZero m] (z : ℂ) : have := sub_mem h hzsub rw [show z - L.divPt m v - (z - L.divPt m v₀) = -(L.divPt m v - L.divPt m v₀) by ring] at this - exact L.divPt_sub_notMem_lattice hvne (by simpa using neg_mem this) + exact L.divPt_sub_notMem_lattice hvne (by simpa only [neg_sub] using neg_mem this) have hadd : z + L.divPt m v ∉ L.lattice := by intro h have := sub_mem h hv₀ @@ -1398,7 +1401,7 @@ private lemma Fm_sq_meromorphicOrderAt_eq (m : ℕ) [NeZero m] (z : ℂ) : have := sub_mem h hzv₁ rw [show z - L.divPt m v - (z - L.divPt m v₁) = -(L.divPt m v - L.divPt m v₁) by ring] at this - exact L.divPt_sub_notMem_lattice hvne₁ (by simpa using neg_mem this) + exact L.divPt_sub_notMem_lattice hvne₁ (by simpa only [neg_sub] using neg_mem this) have hadd : z + L.divPt m v ∉ L.lattice := by intro h have := sub_mem h hv₀ @@ -1431,7 +1434,7 @@ private lemma trailingCoeff_Fm_zero (m : ℕ) [NeZero m] : meromorphicTrailingCoeffAt (L.Fm m) 0 = m := by have hσa : ∀ x : ℂ, AnalyticAt ℂ L.weierstrassSigma x := fun x => L.differentiable_weierstrassSigma.analyticAt x - have hm0 : (m : ℂ) ≠ 0 := by exact_mod_cast (NeZero.pos m).ne' + have hm0 : (m : ℂ) ≠ 0 := by exact Nat.cast_ne_zero.mpr (NeZero.ne m) set Q : ℂ → ℂ := fun z => ∏' l : {l : L.lattice // l ≠ 0}, weierstrassSigmaTerm z (l.1 : ℂ) with hQ have hQan : ∀ x : ℂ, AnalyticAt ℂ Q x := fun x => (L.differentiable_sigmaProd).analyticAt x @@ -1539,7 +1542,8 @@ theorem propfmprod (m : ℕ) [NeZero m] {z : ℂ} (hz : z ∉ L.lattice) : (fun v _ => by fun_prop) fun_prop have hconn : IsPreconnected ((↑L.lattice : Set ℂ)ᶜ) := - (L.countable_lattice'.isConnected_compl_of_one_lt_rank (by simp)).isPreconnected + (L.countable_lattice'.isConnected_compl_of_one_lt_rank (by simp only [Complex.rank_real_complex, + Nat.one_lt_ofNat])).isPreconnected have hx₀ : L.ω₁ / 2 ∈ ((↑L.lattice : Set ℂ)ᶜ) := L.ω₁_div_two_notMem_lattice have hfreq : ∃ᶠ x in 𝓝[≠] (L.ω₁ / 2), F x = c * G x := by have hm := mem_codiscrete.mp hcod (L.ω₁ / 2) @@ -1632,20 +1636,20 @@ noncomputable def P : ℕ → Coeff[X] termination_by m => m decreasing_by all_goals omega -@[simp] lemma P_zero : P 0 = 0 := by simp [P] +@[simp] lemma P_zero : P 0 = 0 := by simp only [P] -@[simp] lemma P_one : P 1 = 1 := by simp [P] +@[simp] lemma P_one : P 1 = 1 := by simp only [P] -@[simp] lemma P_two : P 2 = 1 := by simp [P] +@[simp] lemma P_two : P 2 = 1 := by simp only [P] lemma P_three : P 3 = C 3 * X ^ 4 - C (6 * h2) * X ^ 2 - C (12 * h3) * X - C (h2 ^ 2) := by - simp [P] + simp only [P, map_mul, map_pow] lemma P_four : P 4 = C 2 * X ^ 6 - C (10 * h2) * X ^ 4 - C (40 * h3) * X ^ 3 - C (10 * h2 ^ 2) * X ^ 2 - C (8 * h2 * h3) * X - C (16 * h3 ^ 2 - 2 * h2 ^ 3) := by - simp [P] + simp only [P, map_mul, map_pow, map_sub] /-- Recursion case `m = 4k + 1`, `k ≥ 1` (paper `defipm`). -/ lemma P_four_mul_add_one {k : ℕ} (hk : 1 ≤ k) : @@ -1739,7 +1743,7 @@ private lemma E_leadingCoeff : E.leadingCoeff = 16 := by have hq : (X ^ 3 - C h2 * X - C h3 : Coeff[X]).Monic := by rw [sub_sub] exact Polynomial.monic_X_pow_sub - (Polynomial.degree_linear_le.trans_lt (by norm_num)) + (Polynomial.degree_linear_le.trans_lt (by norm_num1)) rw [E, Polynomial.leadingCoeff_mul, Polynomial.leadingCoeff_pow, hq.leadingCoeff, one_pow, mul_one] rw [show (16 : Coeff[X]) = Polynomial.C (16 : Coeff) from (map_ofNat Polynomial.C 16).symm, @@ -1756,7 +1760,7 @@ private lemma P_nlc_case_5 (j : ℕ) ∧ (P (4 * j + 5)).leadingCoeff = ((j' + 1 : ℕ) : Coeff)) := by have hcast_ne : ∀ n : ℕ, 0 < n → ((n : ℕ) : Coeff) ≠ 0 := fun n hn => Nat.cast_ne_zero.mpr hn.ne' - have h16 : (16 : Coeff) ≠ 0 := by norm_num + have h16 : (16 : Coeff) ≠ 0 := by norm_num1 rw [show 4 * j + 5 = 4 * (j + 1) + 1 by ring, P_four_mul_add_one (by omega : 1 ≤ j + 1), show P (2 * (j + 1) - 1) = P (2 * j + 1) by @@ -1857,7 +1861,7 @@ private lemma P_nlc_case_7 (j : ℕ) ∧ (P (4 * j + 7)).leadingCoeff = ((j' + 1 : ℕ) : Coeff)) := by have hcast_ne : ∀ n : ℕ, 0 < n → ((n : ℕ) : Coeff) ≠ 0 := fun n hn => Nat.cast_ne_zero.mpr hn.ne' - have h16 : (16 : Coeff) ≠ 0 := by norm_num + have h16 : (16 : Coeff) ≠ 0 := by norm_num1 rw [show 4 * j + 7 = 4 * (j + 1) + 3 by ring, P_four_mul_add_three (by omega : 1 ≤ j + 1), show P (2 * (j + 1) + 3) = P (2 * (j + 2) + 1) by @@ -2083,10 +2087,10 @@ theorem lemwp2str {z : ℂ} (hz : z ∉ L.lattice) : have hP'' := L.hasDerivAt_derivWeierstrassP hw have hL : HasDerivAt (fun t => L.derivWeierstrassP t ^ 2) (2 * L.derivWeierstrassP w * deriv L.derivWeierstrassP w) w := by - simpa using hP''.fun_pow 2 + simpa only [Nat.cast_ofNat, Nat.add_one_sub_one, pow_one] using hP''.fun_pow 2 have h3 : HasDerivAt (fun t => L.weierstrassP t ^ 3) (3 * L.weierstrassP w ^ 2 * L.derivWeierstrassP w) w := by - simpa using hP'.fun_pow 3 + simpa only [Nat.cast_ofNat, Nat.add_one_sub_one] using hP'.fun_pow 3 have hR : HasDerivAt (fun t => 4 * L.weierstrassP t ^ 3 - L.g₂ * L.weierstrassP t - L.g₃) (4 * (3 * L.weierstrassP w ^ 2 * L.derivWeierstrassP w) @@ -2111,7 +2115,8 @@ theorem lemwp2str {z : ℂ} (hz : z ∉ L.lattice) : have := L.analyticOnNhd_weierstrassP w hw fun_prop have hconn : IsPreconnected ((↑L.lattice : Set ℂ)ᶜ) := - (L.countable_lattice'.isConnected_compl_of_one_lt_rank (by simp)).isPreconnected + (L.countable_lattice'.isConnected_compl_of_one_lt_rank (by simp only [Complex.rank_real_complex, + Nat.one_lt_ofNat])).isPreconnected obtain ⟨hz₀, h2z₀⟩ := L.divPt_three_props set z₀ : ℂ := L.divPt 3 ((1 : Fin 3), (0 : Fin 3)) with hz₀def have hd0 : L.derivWeierstrassP z₀ ≠ 0 := fun h0 => @@ -2142,7 +2147,7 @@ private lemma wp_third_deriv {z : ℂ} (hz : z ∉ L.lattice) : have h2 : HasDerivAt (fun w => 6 * L.weierstrassP w ^ 2 - L.g₂ / 2) (6 * (2 * L.weierstrassP z * L.derivWeierstrassP z)) z := by have h := ((hP'.fun_pow 2).const_mul (6 : ℂ)).sub_const (L.g₂ / 2) - simpa using h + simpa only [hasDerivAt_sub_const_iff, Nat.cast_ofNat, Nat.add_one_sub_one, pow_one] using h rw [h2.deriv] ring @@ -2218,9 +2223,9 @@ theorem Fm_two {z : ℂ} (hz : z ∉ L.lattice) : (mul_ne_zero (pow_ne_zero 2 hσz) (pow_ne_zero 2 hσz)) have hψ : HasDerivAt (fun v => (z - v) * H v) (-H z) z := by have h1 : HasDerivAt (fun v : ℂ => z - v) (-1) z := by - simpa using (hasDerivAt_id z).const_sub z + simpa only [id_eq] using (hasDerivAt_id z).const_sub z have h := h1.fun_mul hHdiff.hasDerivAt - simpa using h + simpa only [neg_mul, one_mul, sub_self, zero_mul, add_zero] using h have hA : HasDerivAt (fun v => L.weierstrassP v - L.weierstrassP z) (L.derivWeierstrassP z) z := (L.hasDerivAt_weierstrassP hz).sub_const _ have hev : (fun v => L.weierstrassP v - L.weierstrassP z) =ᶠ[𝓝 z] @@ -2235,7 +2240,7 @@ theorem Fm_two {z : ℂ} (hz : z ∉ L.lattice) : simp only [hHdef] rw [hQ0, mul_one, ← two_mul] simp only [Fm] - norm_num + norm_num1 ring_nf rw [← hHz] linear_combination hval @@ -2264,18 +2269,18 @@ private theorem wp2_eq_zeta {z : ℂ} (hz : z ∉ L.lattice) (h2z : 2 * z ∉ L. filter_upwards [L.isClosed_lattice.isOpen_compl.mem_nhds hz] with w hw have h := L.Fm_two hw simp only [Fm] at h - rw [show ((2 : ℕ) : ℂ) = (2 : ℂ) by norm_num, show (2 : ℕ) ^ 2 = 4 from rfl] at h + rw [show ((2 : ℕ) : ℂ) = (2 : ℂ) by norm_num1, show (2 : ℕ) ^ 2 = 4 from rfl] at h exact h have hlin : HasDerivAt (fun w : ℂ => 2 * w) 2 z := by - simpa using (hasDerivAt_id z).const_mul (2 : ℂ) + simpa only [id_eq, mul_one] using (hasDerivAt_id z).const_mul (2 : ℂ) have hnum : HasDerivAt (fun w => L.weierstrassSigma (2 * w)) (L.weierstrassZeta (2 * z) * L.weierstrassSigma (2 * z) * 2) z := by have h := (L.hasDerivAt_sigma h2z).comp z hlin - simpa [Function.comp_def] using h + simpa only [Function.comp_def] using h have hden : HasDerivAt (fun w => L.weierstrassSigma w ^ 4) (4 * L.weierstrassSigma z ^ 3 * (L.weierstrassZeta z * L.weierstrassSigma z)) z := by - simpa using (L.hasDerivAt_sigma hz).fun_pow 4 + simpa only [Nat.cast_ofNat, Nat.add_one_sub_one] using (L.hasDerivAt_sigma hz).fun_pow 4 have hdiv := hnum.fun_div hden (pow_ne_zero 4 hσz) have hneg : HasDerivAt (fun w => -L.derivWeierstrassP w) (-deriv L.derivWeierstrassP z) z := (L.hasDerivAt_derivWeierstrassP hz).fun_neg @@ -2285,7 +2290,7 @@ private theorem wp2_eq_zeta {z : ℂ} (hz : z ∉ L.lattice) (h2z : 2 * z ∉ L. -- substitute `σ(2z) = −℘′·σ(z)⁴` (that is, `F₂ = −℘′`) have hF2 := L.Fm_two hz simp only [Fm] at hF2 - rw [show ((2 : ℕ) : ℂ) = (2 : ℂ) by norm_num, show (2 : ℕ) ^ 2 = 4 from rfl, + rw [show ((2 : ℕ) : ℂ) = (2 : ℂ) by norm_num1, show (2 : ℕ) ^ 2 = 4 from rfl, div_eq_iff (pow_ne_zero 4 hσz)] at hF2 rw [hF2] at hEq have hgoal : (L.weierstrassSigma z ^ 4) ^ 2 * deriv L.derivWeierstrassP z @@ -2299,7 +2304,7 @@ private theorem wp2_eq_zeta {z : ℂ} (hz : z ∉ L.lattice) (h2z : 2 * z ∉ L. private lemma isOpen_U2 : IsOpen {w : ℂ | w ∉ L.lattice ∧ 2 * w ∉ L.lattice} := by have h1 : IsOpen ((↑L.lattice : Set ℂ)ᶜ) := L.isClosed_lattice.isOpen_compl have h2 : IsOpen ((fun w : ℂ => 2 * w) ⁻¹' (↑L.lattice : Set ℂ)ᶜ) := - h1.preimage (by fun_prop) + h1.preimage SeparatelyContinuousMul.continuous_const_mul exact h1.inter h2 /-- Duplication formula: `4℘(2z)℘′(z)² = ℘''(z)² − 8℘(z)℘′(z)²` for `z, 2z ∉ L` @@ -2318,11 +2323,11 @@ private theorem wp_dup {z : ℂ} (hz : z ∉ L.lattice) (h2z : 2 * z ∉ L.latti have hEq := hev.deriv_eq rw [L.wp_third_deriv hz] at hEq have hlin : HasDerivAt (fun w : ℂ => 2 * w) 2 z := by - simpa using (hasDerivAt_id z).const_mul (2 : ℂ) + simpa only [id_eq, mul_one] using (hasDerivAt_id z).const_mul (2 : ℂ) have hζ2 : HasDerivAt (fun w => L.weierstrassZeta (2 * w)) (-L.weierstrassP (2 * z) * 2) z := by have h := (L.hasDerivAt_zeta h2z).comp z hlin - simpa [Function.comp_def] using h + simpa only [neg_mul, Function.comp_def] using h have hG : HasDerivAt (fun w => 2 * (L.weierstrassZeta (2 * w) - 2 * L.weierstrassZeta w)) (2 * (-L.weierstrassP (2 * z) * 2 - 2 * -L.weierstrassP z)) z := @@ -2351,16 +2356,16 @@ private theorem wpp_dup {z : ℂ} (hz : z ∉ L.lattice) (h2z : 2 * z ∉ L.latt exact L.wp_dup hw.1 hw.2 have hEq := hev.deriv_eq have hlin : HasDerivAt (fun w : ℂ => 2 * w) 2 z := by - simpa using (hasDerivAt_id z).const_mul (2 : ℂ) + simpa only [id_eq, mul_one] using (hasDerivAt_id z).const_mul (2 : ℂ) have hP2 : HasDerivAt (fun w => L.weierstrassP (2 * w)) (L.derivWeierstrassP (2 * z) * 2) z := by have h := (L.hasDerivAt_weierstrassP h2z).comp z hlin - simpa [Function.comp_def] using h + simpa only [Function.comp_def] using h have hP' := L.hasDerivAt_weierstrassP hz have hP'' := L.hasDerivAt_derivWeierstrassP hz have hP'sq : HasDerivAt (fun w => L.derivWeierstrassP w ^ 2) (2 * L.derivWeierstrassP z * deriv L.derivWeierstrassP z) z := by - simpa using hP''.fun_pow 2 + simpa only [Nat.cast_ofNat, Nat.add_one_sub_one, pow_one] using hP''.fun_pow 2 have hL : HasDerivAt (fun w => 4 * L.weierstrassP (2 * w) * L.derivWeierstrassP w ^ 2) (4 * (L.derivWeierstrassP (2 * z) * 2) * L.derivWeierstrassP z ^ 2 @@ -2372,7 +2377,7 @@ private theorem wpp_dup {z : ℂ} (hz : z ∉ L.lattice) (h2z : 2 * z ∉ L.latt (((L.analyticOnNhd_derivWeierstrassP z hz).deriv).differentiableAt).hasDerivAt have hdd2 : HasDerivAt (fun w => (deriv L.derivWeierstrassP w) ^ 2) (2 * deriv L.derivWeierstrassP z * deriv (deriv L.derivWeierstrassP) z) z := by - simpa using hdd.fun_pow 2 + simpa only [Nat.cast_ofNat, Nat.add_one_sub_one, pow_one] using hdd.fun_pow 2 have hR : HasDerivAt (fun w => (deriv L.derivWeierstrassP w) ^ 2 - 8 * L.weierstrassP w * L.derivWeierstrassP w ^ 2) @@ -2421,7 +2426,7 @@ private lemma Fm_zero (z : ℂ) : L.Fm 0 z = 0 := by /-- `F₁ = 1` off the lattice. -/ private lemma Fm_one {z : ℂ} (hz : z ∉ L.lattice) : L.Fm 1 z = 1 := by have hσ := L.weierstrassSigma_ne_zero hz - simp [Fm, div_self hσ] + simp only [Fm, Nat.cast_one, one_mul, one_pow, pow_one, div_self hσ] /-- `F_k(z) ≠ 0` when `z, kz ∉ L`. -/ private lemma Fm_ne_zero {k : ℕ} {z : ℂ} (hz : z ∉ L.lattice) @@ -2475,7 +2480,7 @@ theorem lemfrekur_odd (j : ℕ) {z : ℂ} have hj2 : ((j + 2 : ℕ) : ℂ) * z ∉ L.lattice := hz (j + 2) (by omega) have hM := L.Fm_master (j + 1) 1 hz1 hj1 (by rwa [show j + 1 + 1 = j + 2 from rfl]) - simp only [show 2 * (j + 1) + 1 = 2 * j + 3 from by ring, + simp only [show 2 * (j + 1) + 1 = 2 * j + 3 from by omega, show j + 1 + 1 = j + 2 from rfl] at hM rw [L.Fm_one hz1, mul_one] at hM have hn1 := L.lemwpnz (j + 1) hz1 hj1 @@ -2485,7 +2490,7 @@ theorem lemfrekur_odd (j : ℕ) {z : ℂ} have hne1 : L.Fm (j + 1) z ≠ 0 := L.Fm_ne_zero hz1 hj1 have hne2 : L.Fm (j + 2) z ≠ 0 := L.Fm_ne_zero hz1 hj2 rw [hM, hn1, hn2] - field_simp + field_simp (disch := first | assumption | norm_num1 | positivity) ring /-- Paper `lemfrekur`, second recursion: @@ -2502,7 +2507,7 @@ theorem lemfrekur_even (j : ℕ) {z : ℂ} have hj3 : ((j + 3 : ℕ) : ℂ) * z ∉ L.lattice := hz (j + 3) (by omega) have hM := L.Fm_master (j + 1) 2 hz1 hj1 (by rwa [show j + 1 + 2 = j + 3 from rfl]) - simp only [show 2 * (j + 1) + 2 = 2 * j + 4 from by ring, + simp only [show 2 * (j + 1) + 2 = 2 * j + 4 from by omega, show j + 1 + 2 = j + 3 from rfl] at hM have hn1 := L.lemwpnz (j + 1) hz1 hj1 have hn3 := L.lemwpnz (j + 3) hz1 hj3 @@ -2511,7 +2516,7 @@ theorem lemfrekur_even (j : ℕ) {z : ℂ} have hne1 : L.Fm (j + 1) z ≠ 0 := L.Fm_ne_zero hz1 hj1 have hne3 : L.Fm (j + 3) z ≠ 0 := L.Fm_ne_zero hz1 hj3 rw [hM, hn1, hn3] - field_simp + field_simp (disch := first | assumption | norm_num1 | positivity) ring /-- `F₃ = 3℘℘′² − ¼℘''²` for `z, 2z ∉ L`. -/ @@ -2520,12 +2525,12 @@ private theorem Fm_three {z : ℂ} (hz : z ∉ L.lattice) (h2z : 2 * z ∉ L.lat - (deriv L.derivWeierstrassP z) ^ 2 / 4 := by have h1z : ((1 : ℕ) : ℂ) * z ∉ L.lattice := by rwa [Nat.cast_one, one_mul] have h2z' : ((1 + 1 : ℕ) : ℂ) * z ∉ L.lattice := by - rwa [show ((1 + 1 : ℕ) : ℂ) = (2 : ℂ) by norm_num] + rwa [show ((1 + 1 : ℕ) : ℂ) = (2 : ℂ) by norm_num1] have hM := L.Fm_master 1 1 hz h1z h2z' simp only [show 2 * 1 + 1 = 3 from rfl, show 1 + 1 = 2 from rfl] at hM rw [L.Fm_one hz, mul_one, one_pow, mul_one] at hM rw [show ((1 : ℕ) : ℂ) * z = z by rw [Nat.cast_one, one_mul], - show ((2 : ℕ) : ℂ) * z = 2 * z by norm_num] at hM + show ((2 : ℕ) : ℂ) * z = 2 * z by norm_num only] at hM rw [L.Fm_two hz] at hM have hdup := L.wp_dup hz h2z rw [hM] @@ -2551,9 +2556,9 @@ private lemma coeffToC_h2 : L.coeffToC Milla.h2 = L.g₂ / 4 := by private lemma coeffToC_h3 : L.coeffToC Milla.h3 = L.g₃ / 4 := by simp [coeffToC, Milla.h3] -private lemma Pc_one : L.Pc 1 = 1 := by simp [Pc] +private lemma Pc_one : L.Pc 1 = 1 := by simp only [Pc, Milla.P_one, Polynomial.map_one] -private lemma Pc_two : L.Pc 2 = 1 := by simp [Pc] +private lemma Pc_two : L.Pc 2 = 1 := by simp only [Pc, Milla.P_two, Polynomial.map_one] private lemma eval_Pc_three (x : ℂ) : (L.Pc 3).eval x @@ -2619,18 +2624,18 @@ theorem propfmpm (m : ℕ) {z : ℂ} (hz : ∀ k : ℕ, k ≠ 0 → (k : ℂ) * by_cases h5 : m < 5 · -- base cases `m = 0, 1, 2, 3, 4` interval_cases m - · refine ⟨fun h => absurd (Nat.odd_iff.mp h) (by norm_num), fun _ => ?_⟩ - simp [L.Fm_zero, Pc] - · refine ⟨fun _ => ?_, fun h => absurd (Nat.even_iff.mp h) (by norm_num)⟩ + · refine ⟨fun h => absurd (Nat.odd_iff.mp h) (by norm_num1), fun _ => ?_⟩ + simp only [L.Fm_zero, Pc, Milla.P_zero, Polynomial.map_zero, eval_zero, mul_zero] + · refine ⟨fun _ => ?_, fun h => absurd (Nat.even_iff.mp h) (by norm_num1)⟩ rw [L.Fm_one hz1, L.Pc_one] - simp - · refine ⟨fun h => absurd (Nat.odd_iff.mp h) (by norm_num), fun _ => ?_⟩ + simp only [eval_one] + · refine ⟨fun h => absurd (Nat.odd_iff.mp h) (by norm_num1), fun _ => ?_⟩ rw [L.Fm_two hz1, L.Pc_two] - simp - · refine ⟨fun _ => ?_, fun h => absurd (Nat.even_iff.mp h) (by norm_num)⟩ + simp only [eval_one, mul_one] + · refine ⟨fun _ => ?_, fun h => absurd (Nat.even_iff.mp h) (by norm_num1)⟩ rw [L.Fm_three hz1 h2z, L.eval_Pc_three, L.lemwp2str hz1] linear_combination (3 * L.weierstrassP z) * hode - · refine ⟨fun h => absurd (Nat.odd_iff.mp h) (by norm_num), fun _ => ?_⟩ + · refine ⟨fun h => absurd (Nat.odd_iff.mp h) (by norm_num1), fun _ => ?_⟩ rw [L.Fm_four hz1 h2z, L.eval_Pc_four, L.lemwp2str hz1] linear_combination (-L.derivWeierstrassP z * (3 * L.weierstrassP z * (6 * L.weierstrassP z ^ 2 - L.g₂ / 2) @@ -2787,7 +2792,7 @@ private lemma infinite_wp_generic : have heq2 : (k : ℂ) * zpt n = (((k : ℝ) * t n : ℝ) : ℂ) * L.ω₁ := by simp only [hzpt] push_cast - ring + ac_rfl rw [heq2] exact L.irrational_mul_ω₁_notMem hirr have hnotMem : ∀ n, zpt n ∉ L.lattice := by @@ -2902,7 +2907,8 @@ private lemma coeffToC_eq_comp : L.coeffToR := by apply MvPolynomial.ringHom_ext · intro r - simp [coeffToC, coeffToR] + simp only [coeffToC, Nat.succ_eq_add_one, Nat.reduceAdd, AlgHom.toRingHom_eq_coe, eq_intCast, + map_intCast, coeffToR] · intro i fin_cases i <;> simp [coeffToC, coeffToR] @@ -2961,15 +2967,17 @@ private lemma isIntegral_of_cubic_root {x : ℂ} (hx : 4 * (x ^ 3 - L.g₂ / 4 * x - L.g₃ / 4) = 0) : IsIntegral (Algebra.adjoin ℤ ({L.g₂ / 4, L.g₃ / 4} : Set ℂ)) x := by let R := Algebra.adjoin ℤ ({L.g₂ / 4, L.g₃ / 4} : Set ℂ) - let a : R := ⟨L.g₂ / 4, Algebra.subset_adjoin (by simp)⟩ - let b : R := ⟨L.g₃ / 4, Algebra.subset_adjoin (by simp)⟩ + let a : R := ⟨L.g₂ / 4, Algebra.subset_adjoin (by simp only [Set.mem_insert_iff, + Set.mem_singleton_iff, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, div_left_inj', true_or])⟩ + let b : R := ⟨L.g₃ / 4, Algebra.subset_adjoin (by simp only [Set.mem_insert_iff, ne_eq, + OfNat.ofNat_ne_zero, not_false_eq_true, div_left_inj', Set.mem_singleton_iff, or_true])⟩ refine ⟨Polynomial.X ^ 3 - (Polynomial.C a * Polynomial.X + Polynomial.C b), ?_, ?_⟩ · exact Polynomial.monic_X_pow_sub - (Polynomial.degree_linear_le.trans_lt (by norm_num)) + (Polynomial.degree_linear_le.trans_lt (by norm_num1)) · simp only [Polynomial.eval₂_sub, Polynomial.eval₂_add, Polynomial.eval₂_mul, Polynomial.eval₂_pow, Polynomial.eval₂_X, Polynomial.eval₂_C] change x ^ 3 - (L.g₂ / 4 * x + L.g₃ / 4) = 0 - have hzero := (mul_eq_zero.mp hx).resolve_left (by norm_num : (4 : ℂ) ≠ 0) + have hzero := (mul_eq_zero.mp hx).resolve_left (by norm_num1 : (4 : ℂ) ≠ 0) simpa only [sub_sub] using hzero /-- The evaluation of the Baker product at a division value vanishes. -/ @@ -2981,7 +2989,7 @@ private lemma eval_baker_zero (m : ℕ) [NeZero m] {v : Fin m × Fin m} (hv : v rw [Polynomial.eval_mul, Polynomial.eval_prod] apply mul_eq_zero_of_right apply Finset.prod_eq_zero (Finset.mem_erase.mpr ⟨hv, Finset.mem_univ v⟩) - simp + simp only [eval_sub, eval_X, eval_C, sub_self] end PeriodPair diff --git a/LeanPool/Chudnovsky/Estimates.lean b/LeanPool/Chudnovsky/Estimates.lean index 69ef4c254b..ebe35ff86b 100644 --- a/LeanPool/Chudnovsky/Estimates.lean +++ b/LeanPool/Chudnovsky/Estimates.lean @@ -84,9 +84,9 @@ lemma mul_Jtilde_eq (τ : ℍ) : (1 + 240 * (q τ + 9 * q τ ^ 2)) ^ 3 / (q τ * (1 - q τ - q τ ^ 2) ^ 24) := by simp only [Jtilde] rw [show (1728 : ℂ) * q τ * (1 - q τ - q τ ^ 2) ^ 24 - = 1728 * (q τ * (1 - q τ - q τ ^ 2) ^ 24) by ring, + = 1728 * (q τ * (1 - q τ - q τ ^ 2) ^ 24) by ac_rfl, ← div_div, mul_div_assoc', mul_div_assoc', - mul_div_cancel_left₀ _ (by norm_num : (1728 : ℂ) ≠ 0)] + mul_div_cancel_left₀ _ (by norm_num1 : (1728 : ℂ) ≠ 0)] /-- The approximation `stilde₂` of Ramanujan's `s₂` from Theorem `theonaehers2` of the paper: `stilde₂(τ) = (1 + 240(q + 9q²))/(1 - 504(q + 33q²)) · (1 - 24(q + 3q²) - 3/(π·Im τ))`. -/ @@ -118,7 +118,7 @@ lemma norm_q_lt_of_mem_Region {τ : ℍ} (hτ : τ ∈ Region) : rw [norm_q, Real.exp_lt_exp, neg_lt_neg_iff] have hπ : (3.1408 : ℝ) < π := by linarith [Real.pi_gt_d4] have him : (5 / 4 : ℝ) < τ.im := hτ - nlinarith [mul_pos (sub_pos.2 hπ) (sub_pos.2 him)] + linarith [mul_pos (sub_pos.2 hπ) (sub_pos.2 him)] /-! ### `q`-expansions of the Eisenstein series (paper Prop. `sigmaeisen`) @@ -157,11 +157,11 @@ lemma E₄_eq_tsum (τ : ℍ) : /-- Paper Prop. `sigmaeisen`: `E₆(τ) = 1 - 504·∑_{n≥1} σ₅(n)·qⁿ`. -/ lemma E₆_eq_tsum (τ : ℍ) : E₆ τ = 1 - 504 * ∑' n : ℕ, (ArithmeticFunction.sigma 5 (n + 1) : ℂ) * q τ ^ (n + 1) := by - have h := EisensteinSeries.q_expansion_bernoulli (k := 6) (by norm_num) (by decide) τ + have h := EisensteinSeries.q_expansion_bernoulli (k := 6) (by norm_num only) (by decide) τ rw [show bernoulli 6 = 1 / 42 by as_aux_lemma => exact bernoulli_six_value, ← q_eq] at h simp only [zpow_natCast] at h rw [tsum_pnat_eq_tsum_succ (f := fun n ↦ (ArithmeticFunction.sigma 5 n : ℂ) * q τ ^ n)] at h - rw [h]; norm_num + rw [h]; norm_num only /-- Paper Prop. `sigmaeisen`: `E₂(τ) = 1 - 24·∑_{n≥1} σ₁(n)·qⁿ`. -/ lemma E2_eq_tsum (τ : ℍ) : @@ -191,21 +191,21 @@ Proved from `Real.exp_one_gt_d9` and an 8-term Taylor lower bound for `exp 0.852 lemma exp_neg_bound : Real.exp (-7.852) < 0.000389 := by have h1 : (2.7182818283 : ℝ) < Real.exp 1 := Real.exp_one_gt_d9 have h7 : (2.7182818283 : ℝ) ^ 7 < Real.exp 7 := by - have he : Real.exp 7 = Real.exp 1 ^ 7 := by rw [← Real.exp_nat_mul]; norm_num - rw [he]; exact pow_lt_pow_left₀ h1 (by norm_num) (by norm_num) + have he : Real.exp 7 = Real.exp 1 ^ 7 := by rw [← Real.exp_nat_mul]; norm_num only + rw [he]; exact pow_lt_pow_left₀ h1 (by norm_num1) (by norm_num1) have h852 : (2.344323 : ℝ) ≤ Real.exp 0.852 := by - have hs := Real.sum_le_exp_of_nonneg (by norm_num : (0 : ℝ) ≤ 0.852) 8 + have hs := Real.sum_le_exp_of_nonneg (by norm_num1 : (0 : ℝ) ≤ 0.852) 8 refine le_trans ?_ hs - norm_num [Finset.sum_range_succ, Finset.sum_range_zero, Nat.factorial] + norm_num only [Finset.sum_range_succ, Finset.sum_range_zero, Nat.factorial] have hbig : (2570.7 : ℝ) < Real.exp 7.852 := by - have he : Real.exp 7.852 = Real.exp 7 * Real.exp 0.852 := by rw [← Real.exp_add]; norm_num + have he : Real.exp 7.852 = Real.exp 7 * Real.exp 0.852 := by rw [← Real.exp_add]; norm_num only rw [he] - calc (2570.7 : ℝ) < 2.7182818283 ^ 7 * 2.344323 := by norm_num + calc (2570.7 : ℝ) < 2.7182818283 ^ 7 * 2.344323 := by norm_num1 _ ≤ Real.exp 7 * Real.exp 0.852 := - mul_le_mul h7.le h852 (by norm_num) (le_of_lt (lt_trans (by norm_num) h7)) + mul_le_mul h7.le h852 (by norm_num1) (le_of_lt (lt_trans (by norm_num1) h7)) rw [Real.exp_neg] - calc (Real.exp 7.852)⁻¹ < (2570.7 : ℝ)⁻¹ := inv_strictAnti₀ (by norm_num) hbig - _ < 0.000389 := by norm_num + calc (Real.exp 7.852)⁻¹ < (2570.7 : ℝ)⁻¹ := inv_strictAnti₀ (by norm_num1) hbig + _ < 0.000389 := by norm_num1 /-! ### Geometric tail bounds for the Lambert-type series (paper Lemmas `lemrestchaetz` and `lemrestkonkr`) -/ @@ -313,14 +313,14 @@ theorem norm_eisensteinTail_sigma₁ {τ : ℍ} (hτ : τ ∈ Region) : set Q := ‖q τ‖ with hQdef have hQpos : 0 < Q := norm_q_pos τ have hQ : Q < 0.000389 := lt_trans (norm_q_lt_of_mem_Region hτ) exp_neg_bound - have hs : (1 + 1 / (4 : ℝ)) ^ (1 + 1) * Q < 1 := by norm_num; linarith - have htail := norm_eisensteinTail_le 1 4 (by norm_num) τ hs - norm_num at htail + have hs : (1 + 1 / (4 : ℝ)) ^ (1 + 1) * Q < 1 := by norm_num1; linarith + have htail := norm_eisensteinTail_le 1 4 (by norm_num1) τ hs + norm_num1 at htail rw [eisensteinTail_succ 1 3 τ] refine le_trans (norm_add_le _ _) ?_ rw [norm_mul, norm_pow, Complex.norm_natCast, show (ArithmeticFunction.sigma 1 3 : ℕ) = 4 from by decide] - have hD : (0 : ℝ) < 1 - 25 / 16 * Q := by linarith + have hD : (0 : ℝ) < 1 - 25 / 16 * Q := by linarith only [hQ] have hdiv : 16 * Q ^ 4 / (1 - 25 / 16 * Q) ≤ 0.007 * Q ^ 3 := by rw [div_le_iff₀ hD]; linarith [pow_succ_le_of_lt 3 hQpos hQ, pow_pos hQpos 3] push_cast @@ -332,14 +332,14 @@ theorem norm_eisensteinTail_sigma₃ {τ : ℍ} (hτ : τ ∈ Region) : set Q := ‖q τ‖ with hQdef have hQpos : 0 < Q := norm_q_pos τ have hQ : Q < 0.000389 := lt_trans (norm_q_lt_of_mem_Region hτ) exp_neg_bound - have hs : (1 + 1 / (4 : ℝ)) ^ (3 + 1) * Q < 1 := by norm_num; linarith - have htail := norm_eisensteinTail_le 3 4 (by norm_num) τ hs - norm_num at htail + have hs : (1 + 1 / (4 : ℝ)) ^ (3 + 1) * Q < 1 := by norm_num1; linarith + have htail := norm_eisensteinTail_le 3 4 (by norm_num1) τ hs + norm_num1 at htail rw [eisensteinTail_succ 3 3 τ] refine le_trans (norm_add_le _ _) ?_ rw [norm_mul, norm_pow, Complex.norm_natCast, show (ArithmeticFunction.sigma 3 3 : ℕ) = 28 from by decide] - have hD : (0 : ℝ) < 1 - 625 / 256 * Q := by linarith + have hD : (0 : ℝ) < 1 - 625 / 256 * Q := by linarith only [hQ] have hdiv : 256 * Q ^ 4 / (1 - 625 / 256 * Q) ≤ 0.1 * Q ^ 3 := by rw [div_le_iff₀ hD]; linarith [pow_succ_le_of_lt 3 hQpos hQ, pow_pos hQpos 3] push_cast @@ -351,14 +351,14 @@ theorem norm_eisensteinTail_sigma₅ {τ : ℍ} (hτ : τ ∈ Region) : set Q := ‖q τ‖ with hQdef have hQpos : 0 < Q := norm_q_pos τ have hQ : Q < 0.000389 := lt_trans (norm_q_lt_of_mem_Region hτ) exp_neg_bound - have hs : (1 + 1 / (4 : ℝ)) ^ (5 + 1) * Q < 1 := by norm_num; linarith - have htail := norm_eisensteinTail_le 5 4 (by norm_num) τ hs - norm_num at htail + have hs : (1 + 1 / (4 : ℝ)) ^ (5 + 1) * Q < 1 := by norm_num1; linarith + have htail := norm_eisensteinTail_le 5 4 (by norm_num1) τ hs + norm_num1 at htail rw [eisensteinTail_succ 5 3 τ] refine le_trans (norm_add_le _ _) ?_ rw [norm_mul, norm_pow, Complex.norm_natCast, show (ArithmeticFunction.sigma 5 3 : ℕ) = 244 from by decide] - have hD : (0 : ℝ) < 1 - 15625 / 4096 * Q := by linarith + have hD : (0 : ℝ) < 1 - 15625 / 4096 * Q := by linarith only [hQ] have hdiv : 4096 * Q ^ 4 / (1 - 15625 / 4096 * Q) ≤ 1.6 * Q ^ 3 := by rw [div_le_iff₀ hD]; linarith [pow_succ_le_of_lt 3 hQpos hQ, pow_pos hQpos 3] push_cast @@ -405,7 +405,7 @@ theorem lemE6 {τ : ℍ} (hτ : τ ∈ Region) : 0.8 < ‖E₆ τ‖ := by have hQ : Q < 0.000389 := lt_trans (norm_q_lt_of_mem_Region hτ) exp_neg_bound have htail : ‖eisensteinTail 5 3 τ‖ ≤ 245.6 * Q ^ 3 := norm_eisensteinTail_sigma₅ hτ have hqq : ‖q τ + (33 : ℂ) * q τ ^ 2‖ ≤ Q + 33 * Q ^ 2 := - norm_q_add_smul_sq_le (by norm_num) + norm_q_add_smul_sq_le (by norm_num1) -- reverse triangle inequality rw [E₆_eq_trunc τ, E₆trunc] have htri : (1 : ℝ) - ‖(504 : ℂ) * (q τ + 33 * q τ ^ 2)‖ - ‖(504 : ℂ) * eisensteinTail 5 3 τ‖ @@ -418,9 +418,9 @@ theorem lemE6 {τ : ℍ} (hτ : τ ∈ Region) : 0.8 < ‖E₆ τ‖ := by _ ≤ ‖1 - 504 * (q τ + 33 * q τ ^ 2) - 504 * eisensteinTail 5 3 τ‖ := norm_sub_norm_le _ _ have hA : ‖(504 : ℂ) * (q τ + 33 * q τ ^ 2)‖ ≤ 504 * (Q + 33 * Q ^ 2) := by - rw [norm_mul, Complex.norm_ofNat]; exact mul_le_mul_of_nonneg_left hqq (by norm_num) + rw [norm_mul, Complex.norm_ofNat]; exact mul_le_mul_of_nonneg_left hqq (by norm_num1) have hB : ‖(504 : ℂ) * eisensteinTail 5 3 τ‖ ≤ 504 * (245.6 * Q ^ 3) := by - rw [norm_mul, Complex.norm_ofNat]; exact mul_le_mul_of_nonneg_left htail (by norm_num) + rw [norm_mul, Complex.norm_ofNat]; exact mul_le_mul_of_nonneg_left htail (by norm_num1) have hfinal : (0.8 : ℝ) < 1 - 504 * (Q + 33 * Q ^ 2) - 504 * (245.6 * Q ^ 3) := by linarith [hQ, sq_le_of_lt hQpos hQ, pow_succ_le_of_lt 2 hQpos hQ] linarith [htri, hA, hB, hfinal] @@ -430,7 +430,7 @@ theorem E₆_ne_zero_of_mem_Region {τ : ℍ} (hτ : τ ∈ Region) : E₆ τ intro h have h8 := lemE6 hτ rw [h, norm_zero] at h8 - norm_num at h8 + norm_num1 at h8 /-! ### Truncation norm bounds (paper Lemma `lemxy`) -/ @@ -439,14 +439,14 @@ lemma norm_E₆trunc_ge {τ : ℍ} (hτ : τ ∈ Region) : (0.8014 : ℝ) ≤ have hQpos : 0 < ‖q τ‖ := norm_q_pos τ have hQ : ‖q τ‖ < 0.000389 := lt_trans (norm_q_lt_of_mem_Region hτ) exp_neg_bound have hqq : ‖q τ + (33 : ℂ) * q τ ^ 2‖ ≤ ‖q τ‖ + 33 * ‖q τ‖ ^ 2 := - norm_q_add_smul_sq_le (by norm_num) + norm_q_add_smul_sq_le (by norm_num1) rw [E₆trunc] have htri : (1 : ℝ) - ‖(504 : ℂ) * (q τ + 33 * q τ ^ 2)‖ ≤ ‖(1 : ℂ) - 504 * (q τ + 33 * q τ ^ 2)‖ := by have := norm_sub_norm_le (1 : ℂ) (504 * (q τ + 33 * q τ ^ 2)) rwa [norm_one] at this have hA : ‖(504 : ℂ) * (q τ + 33 * q τ ^ 2)‖ ≤ 504 * (‖q τ‖ + 33 * ‖q τ‖ ^ 2) := by - rw [norm_mul, Complex.norm_ofNat]; exact mul_le_mul_of_nonneg_left hqq (by norm_num) + rw [norm_mul, Complex.norm_ofNat]; exact mul_le_mul_of_nonneg_left hqq (by norm_num1) have hlow : (0.8014 : ℝ) ≤ 1 - 504 * (‖q τ‖ + 33 * ‖q τ‖ ^ 2) := by linarith [hQ, sq_le_of_lt hQpos hQ] linarith [htri, hA, hlow] @@ -455,14 +455,14 @@ lemma E₆trunc_ne_zero {τ : ℍ} (hτ : τ ∈ Region) : E₆trunc τ ≠ 0 := intro h have := norm_E₆trunc_ge hτ rw [h, norm_zero] at this - norm_num at this + norm_num1 at this /-- Paper Lemma `lemxy`: `|X| ≤ 1.0937` where `X = E₄⁽²⁾`. -/ lemma norm_E₄trunc_le {τ : ℍ} (hτ : τ ∈ Region) : ‖E₄trunc τ‖ ≤ 1.0937 := by have hQpos : 0 < ‖q τ‖ := norm_q_pos τ have hQ : ‖q τ‖ < 0.000389 := lt_trans (norm_q_lt_of_mem_Region hτ) exp_neg_bound have hqq : ‖q τ + (9 : ℂ) * q τ ^ 2‖ ≤ ‖q τ‖ + 9 * ‖q τ‖ ^ 2 := - norm_q_add_smul_sq_le (by norm_num) + norm_q_add_smul_sq_le (by norm_num1) rw [E₄trunc] refine le_trans (norm_add_le _ _) ?_ rw [norm_one, norm_mul, Complex.norm_ofNat] @@ -479,7 +479,7 @@ lemma norm_E₂starTrunc_le {τ : ℍ} (hτ : τ ∈ Region) : ‖E₂starTrunc linarith [mul_lt_mul Real.pi_gt_three (by linarith : (1 : ℝ) ≤ τ.im) one_pos Real.pi_pos.le] have ht0 : 0 < 3 / (π * τ.im) := by positivity have hqq : ‖q τ + (3 : ℂ) * q τ ^ 2‖ ≤ ‖q τ‖ + 3 * ‖q τ‖ ^ 2 := - norm_q_add_smul_sq_le (by norm_num) + norm_q_add_smul_sq_le (by norm_num1) have hZeq : E₂starTrunc τ = ((1 - 3 / (π * τ.im) : ℝ) : ℂ) - 24 * (q τ + 3 * q τ ^ 2) := by rw [E₂starTrunc]; push_cast; ring rw [hZeq] @@ -496,12 +496,12 @@ lemma norm_s₂tilde_le {τ : ℍ} (hτ : τ ∈ Region) : ‖s₂tilde τ‖ have hZ := norm_E₂starTrunc_le hτ have hYpos : (0 : ℝ) < ‖E₆trunc τ‖ := by linarith [hY] have hdiv : ‖E₄trunc τ‖ / ‖E₆trunc τ‖ ≤ 1.0937 / 0.8014 := - div_le_div₀ (by norm_num) hX (by norm_num) hY + div_le_div₀ (by norm_num1) hX (by norm_num1) hY have hdivnn : 0 ≤ ‖E₄trunc τ‖ / ‖E₆trunc τ‖ := by positivity calc ‖E₄trunc τ‖ / ‖E₆trunc τ‖ * ‖E₂starTrunc τ‖ ≤ (1.0937 / 0.8014) * 1.0094 := - mul_le_mul hdiv hZ (norm_nonneg _) (by norm_num) - _ ≤ 1.3776 := by norm_num + mul_le_mul hdiv hZ (norm_nonneg _) (by norm_num1) + _ ≤ 1.3776 := by norm_num1 /-- `|δX| = |E₄ - X| ≤ 6744·|q|³`. -/ lemma norm_sub_E₄trunc_le {τ : ℍ} (hτ : τ ∈ Region) : @@ -563,8 +563,8 @@ lemma norm_ktilde_ge {τ : ℍ} (hτ : τ ∈ Region) : (0.9907 : ℝ) ≤ ‖kt have hlow : (0.9996108 : ℝ) ≤ ‖1 - q τ - q τ ^ 2‖ := by have h := (norm_one_sub_q_sub_sq (τ := τ)).1 linarith [h, hQ, sq_le_of_lt hQpos hQ] - calc (0.9907 : ℝ) ≤ 0.9996108 ^ 24 := by norm_num - _ ≤ ‖1 - q τ - q τ ^ 2‖ ^ 24 := pow_le_pow_left₀ (by norm_num) hlow 24 + calc (0.9907 : ℝ) ≤ 0.9996108 ^ 24 := by norm_num1 + _ ≤ ‖1 - q τ - q τ ^ 2‖ ^ 24 := pow_le_pow_left₀ (by norm_num1) hlow 24 /-- Paper Lemma `lemk`: `|ktilde| ≤ 1.0094`. -/ lemma norm_ktilde_le {τ : ℍ} (hτ : τ ∈ Region) : ‖ktilde τ‖ ≤ 1.0094 := by @@ -576,13 +576,13 @@ lemma norm_ktilde_le {τ : ℍ} (hτ : τ ∈ Region) : ‖ktilde τ‖ ≤ 1.00 linarith [h, hQ, sq_le_of_lt hQpos hQ] calc ‖1 - q τ - q τ ^ 2‖ ^ 24 ≤ (1.0003892 : ℝ) ^ 24 := pow_le_pow_left₀ (norm_nonneg _) hhi 24 - _ ≤ 1.0094 := by norm_num + _ ≤ 1.0094 := by norm_num1 lemma ktilde_ne_zero {τ : ℍ} (hτ : τ ∈ Region) : ktilde τ ≠ 0 := by intro h have := norm_ktilde_ge hτ rw [h, norm_zero] at this - norm_num at this + norm_num1 at this /-- `1728·q·Jtilde = X³ / ktilde`. -/ lemma mul_q_Jtilde_eq {τ : ℍ} (hτ : τ ∈ Region) : @@ -601,7 +601,7 @@ lemma norm_sub_cube_E₄trunc_le {τ : ℍ} (hτ : τ ∈ Region) : have hdX := norm_sub_E₄trunc_le hτ have hXnn := norm_nonneg (E₄trunc τ) have hdXnn := norm_nonneg (E₄ τ - E₄trunc τ) - have hQ3 : ‖q τ‖ ^ 3 < 0.000389 ^ 3 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num) + have hQ3 : ‖q τ‖ ^ 3 < 0.000389 ^ 3 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num1) have heq : E₄ τ ^ 3 - E₄trunc τ ^ 3 = (E₄ τ - E₄trunc τ) * (3 * E₄trunc τ ^ 2 + 3 * E₄trunc τ * (E₄ τ - E₄trunc τ) + (E₄ τ - E₄trunc τ) ^ 2) := by ring @@ -619,10 +619,10 @@ lemma norm_sub_cube_E₄trunc_le {τ : ℍ} (hτ : τ ∈ Region) : + (E₄ τ - E₄trunc τ) ^ 2‖ ≤ 3.5886 := by refine le_trans hfac ?_ have hdX' : ‖E₄ τ - E₄trunc τ‖ ≤ 6744 * 0.000389 ^ 3 := - hdX.trans (mul_le_mul_of_nonneg_left hQ3.le (by norm_num)) + hdX.trans (mul_le_mul_of_nonneg_left hQ3.le (by norm_num1)) have hX2 : ‖E₄trunc τ‖ ^ 2 ≤ 1.0937 ^ 2 := pow_le_pow_left₀ hXnn hX 2 have hXdX : ‖E₄trunc τ‖ * ‖E₄ τ - E₄trunc τ‖ ≤ 1.0937 * (6744 * 0.000389 ^ 3) := - mul_le_mul hX hdX' hdXnn (by norm_num) + mul_le_mul hX hdX' hdXnn (by norm_num1) have hdX2 : ‖E₄ τ - E₄trunc τ‖ ^ 2 ≤ (6744 * 0.000389 ^ 3) ^ 2 := pow_le_pow_left₀ hdXnn hdX' 2 linarith @@ -636,7 +636,7 @@ lemma norm_E₆trunc_le {τ : ℍ} (hτ : τ ∈ Region) : ‖E₆trunc τ‖ have hQpos : 0 < ‖q τ‖ := norm_q_pos τ have hQ : ‖q τ‖ < 0.000389 := lt_trans (norm_q_lt_of_mem_Region hτ) exp_neg_bound have hqq : ‖q τ + (33 : ℂ) * q τ ^ 2‖ ≤ ‖q τ‖ + 33 * ‖q τ‖ ^ 2 := - norm_q_add_smul_sq_le (by norm_num) + norm_q_add_smul_sq_le (by norm_num1) rw [E₆trunc] refine le_trans (norm_sub_le _ _) ?_ rw [norm_one, norm_mul, Complex.norm_ofNat] @@ -649,7 +649,7 @@ lemma norm_sub_sq_E₆trunc_le {τ : ℍ} (hτ : τ ∈ Region) : have hQ : ‖q τ‖ < 0.000389 := lt_trans (norm_q_lt_of_mem_Region hτ) exp_neg_bound have hY := norm_E₆trunc_le hτ have hdY := norm_sub_E₆trunc_le hτ - have hQ3 : ‖q τ‖ ^ 3 < 0.000389 ^ 3 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num) + have hQ3 : ‖q τ‖ ^ 3 < 0.000389 ^ 3 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num1) have heq : E₆ τ ^ 2 - E₆trunc τ ^ 2 = (E₆ τ - E₆trunc τ) * (2 * E₆trunc τ + (E₆ τ - E₆trunc τ)) := by ring rw [heq, norm_mul] @@ -660,7 +660,7 @@ lemma norm_sub_sq_E₆trunc_le {τ : ℍ} (hτ : τ ∈ Region) : have hfac2 : ‖2 * E₆trunc τ + (E₆ τ - E₆trunc τ)‖ ≤ 2.3975 := by refine le_trans hfac ?_ have hdY' : ‖E₆ τ - E₆trunc τ‖ ≤ 123783 * 0.000389 ^ 3 := - hdY.trans (mul_le_mul_of_nonneg_left hQ3.le (by norm_num)) + hdY.trans (mul_le_mul_of_nonneg_left hQ3.le (by norm_num1)) linarith calc ‖E₆ τ - E₆trunc τ‖ * ‖2 * E₆trunc τ + (E₆ τ - E₆trunc τ)‖ ≤ (123783 * ‖q τ‖ ^ 3) * 2.3975 := mul_le_mul hdY hfac2 (norm_nonneg _) (by positivity) @@ -675,7 +675,7 @@ lemma horner_norm_bound (p : ℂ) {ρ : ℝ} (hp : ‖p‖ ≤ ρ) (hρ : 0 ≤ ≤ l.foldr (fun (a : ℤ) (acc : ℝ) => |(a : ℝ)| + ρ * acc) 0 := by intro l induction l with - | nil => simp + | nil => simp only [List.foldr_nil, norm_zero, Std.le_refl] | cons a t ih => rw [List.foldr_cons, List.foldr_cons] refine (norm_add_le _ _).trans ?_ @@ -710,7 +710,7 @@ lemma lemk {τ : ℍ} (hτ : τ ∈ Region) : ‖kfun τ - ktilde τ‖ ≤ 365. have hQpos : 0 < ‖q τ‖ := norm_q_pos τ have hQ : ‖q τ‖ < 0.000389 := lt_trans (norm_q_lt_of_mem_Region hτ) exp_neg_bound have hqne : q τ ≠ 0 := q_ne_zero τ - have hq2 : (1728 : ℂ) * q τ ≠ 0 := mul_ne_zero (by norm_num) hqne + have hq2 : (1728 : ℂ) * q τ ≠ 0 := mul_ne_zero (by norm_num1) hqne set Gval : ℂ := lemkG.foldr (fun (a : ℤ) (acc : ℂ) => (a : ℂ) + q τ * acc) 0 with hGvaldef -- (a) exact polynomial identity for the "truncation" part have hpoly : E₄trunc τ ^ 3 - E₆trunc τ ^ 2 - 1728 * q τ * ktilde τ @@ -721,26 +721,26 @@ lemma lemk {τ : ℍ} (hτ : τ ∈ Region) : ‖kfun τ - ktilde τ‖ ≤ 365. -- (b) bound on ‖G(q)‖ have hGbound : ‖Gval‖ ≤ 179.8 := by rw [hGvaldef] - refine le_trans (horner_norm_bound (q τ) hQ.le (by norm_num) lemkG) ?_ + refine le_trans (horner_norm_bound (q τ) hQ.le (by norm_num1) lemkG) ?_ simp only [lemkG, List.foldr_cons, List.foldr_nil] - push_cast; norm_num + push_cast; norm_num1 -- (c) rewrite `k - ktilde` as a single quotient over `1728 q` have hid : kfun τ - ktilde τ = ((E₄ τ ^ 3 - E₄trunc τ ^ 3) - (E₆ τ ^ 2 - E₆trunc τ ^ 2) + 1728 * q τ ^ 3 * Gval) / (1728 * q τ) := by rw [← hpoly, kfun] - field_simp + field_simp (disch := first | assumption | norm_num1 | positivity) ring rw [hid, norm_div] have hden : ‖(1728 : ℂ) * q τ‖ = 1728 * ‖q τ‖ := by rw [norm_mul, Complex.norm_ofNat] - rw [hden, div_le_iff₀ (mul_pos (by norm_num) hQpos)] + rw [hden, div_le_iff₀ (mul_pos (by norm_num1) hQpos)] -- (d) bound the numerator by the three pieces of the paper's proof have hp1 : ‖E₄ τ ^ 3 - E₄trunc τ ^ 3‖ ≤ 24202 * ‖q τ‖ ^ 3 := norm_sub_cube_E₄trunc_le hτ have hp2 : ‖E₆ τ ^ 2 - E₆trunc τ ^ 2‖ ≤ 296780 * ‖q τ‖ ^ 3 := norm_sub_sq_E₆trunc_le hτ have hp3 : ‖(1728 : ℂ) * q τ ^ 3 * Gval‖ ≤ 1728 * ‖q τ‖ ^ 3 * 179.8 := by rw [norm_mul, norm_mul, Complex.norm_ofNat, norm_pow] exact mul_le_mul_of_nonneg_left hGbound - (mul_nonneg (by norm_num) (pow_nonneg hQpos.le 3)) + (mul_nonneg (by norm_num1) (pow_nonneg hQpos.le 3)) have hnum : ‖(E₄ τ ^ 3 - E₄trunc τ ^ 3) - (E₆ τ ^ 2 - E₆trunc τ ^ 2) + 1728 * q τ ^ 3 * Gval‖ ≤ 24202 * ‖q τ‖ ^ 3 + 296780 * ‖q τ‖ ^ 3 + 1728 * ‖q τ‖ ^ 3 * 179.8 := @@ -775,14 +775,14 @@ lemma norm_E₄trunc_ge {τ : ℍ} (hτ : τ ∈ Region) : (0.9063 : ℝ) ≤ have hQpos : 0 < ‖q τ‖ := norm_q_pos τ have hQ : ‖q τ‖ < 0.000389 := lt_trans (norm_q_lt_of_mem_Region hτ) exp_neg_bound have hqq : ‖q τ + (9 : ℂ) * q τ ^ 2‖ ≤ ‖q τ‖ + 9 * ‖q τ‖ ^ 2 := - norm_q_add_smul_sq_le (by norm_num) + norm_q_add_smul_sq_le (by norm_num1) rw [E₄trunc] have htri : (1 : ℝ) - ‖(240 : ℂ) * (q τ + 9 * q τ ^ 2)‖ ≤ ‖(1 : ℂ) + 240 * (q τ + 9 * q τ ^ 2)‖ := by have := norm_sub_norm_le (1 : ℂ) (-(240 * (q τ + 9 * q τ ^ 2))) rw [norm_one, norm_neg, sub_neg_eq_add] at this; exact this have hA : ‖(240 : ℂ) * (q τ + 9 * q τ ^ 2)‖ ≤ 240 * (‖q τ‖ + 9 * ‖q τ‖ ^ 2) := by - rw [norm_mul, Complex.norm_ofNat]; exact mul_le_mul_of_nonneg_left hqq (by norm_num) + rw [norm_mul, Complex.norm_ofNat]; exact mul_le_mul_of_nonneg_left hqq (by norm_num1) have hlow : (0.9063 : ℝ) ≤ 1 - 240 * (‖q τ‖ + 9 * ‖q τ‖ ^ 2) := by linarith [hQ, sq_le_of_lt hQpos hQ] linarith [htri, hA, hlow] @@ -795,8 +795,8 @@ lemma norm_Jtilde2_le {τ : ℍ} (hτ : τ ∈ Region) : have hk := norm_ktilde_ge hτ have h1 : ‖E₄trunc τ‖ ^ 3 ≤ 1.0937 ^ 3 := pow_le_pow_left₀ (norm_nonneg _) hX 3 calc ‖E₄trunc τ‖ ^ 3 / ‖ktilde τ‖ ≤ 1.0937 ^ 3 / 0.9907 := - div_le_div₀ (by norm_num) h1 (by norm_num) hk - _ ≤ 1.3206 := by norm_num + div_le_div₀ (by norm_num1) h1 (by norm_num1) hk + _ ≤ 1.3206 := by norm_num1 /-- Paper Lemma `lem3`: `0.7374 ≤ |Jtilde₂|` where `Jtilde₂ = X³/ktilde`. -/ lemma norm_Jtilde2_ge {τ : ℍ} (hτ : τ ∈ Region) : @@ -805,8 +805,8 @@ lemma norm_Jtilde2_ge {τ : ℍ} (hτ : τ ∈ Region) : have hX := norm_E₄trunc_ge hτ have hk := norm_ktilde_le hτ have hkpos : (0 : ℝ) < ‖ktilde τ‖ := by linarith [norm_ktilde_ge hτ] - have h1 : (0.9063 : ℝ) ^ 3 ≤ ‖E₄trunc τ‖ ^ 3 := pow_le_pow_left₀ (by norm_num) hX 3 - calc (0.7374 : ℝ) ≤ 0.9063 ^ 3 / 1.0094 := by norm_num + have h1 : (0.9063 : ℝ) ^ 3 ≤ ‖E₄trunc τ‖ ^ 3 := pow_le_pow_left₀ (by norm_num1) hX 3 + calc (0.7374 : ℝ) ≤ 0.9063 ^ 3 / 1.0094 := by norm_num1 _ ≤ ‖E₄trunc τ‖ ^ 3 / ‖ktilde τ‖ := div_le_div₀ (by positivity) h1 hkpos hk /-- Paper Lemma `lem3`: `|J₂ - Jtilde₂| ≤ 498·|q|²`. -/ @@ -820,7 +820,7 @@ lemma lem3 {τ : ℍ} (hτ : τ ∈ Region) : = (E₄ τ ^ 3 - E₄trunc τ ^ 3 - (E₄trunc τ ^ 3 / ktilde τ) * (kfun τ - ktilde τ)) / kfun τ := by rw [mul_q_J_eq, mul_q_Jtilde_eq hτ] - field_simp + field_simp (disch := first | assumption | norm_num1 | positivity) ring have hkfpos : (0 : ℝ) < ‖kfun τ‖ := norm_pos_iff.mpr hkf rw [hid2, norm_div, div_le_iff₀ hkfpos] @@ -880,7 +880,7 @@ theorem theonaeherJ_approx {τ : ℍ} (hτ : τ ∈ Region) : have heq : 1728 * J τ - 1728 * Jtilde τ = (1728 * q τ * J τ - 1728 * q τ * Jtilde τ) / q τ := by rw [eq_div_iff hq]; ring rw [heq, norm_div, div_lt_iff₀ hQpos] - nlinarith [lem3 hτ, pow_pos hQpos 2, hQpos] + linarith [lem3 hτ, pow_pos hQpos 2, hQpos] /-- Paper Theorem `theonaeherJ`, headline approximation bound: `|1728·J(τ) - 1728·Jtilde(τ)| < 0.2` for `Im τ > 5/4`. -/ @@ -900,7 +900,7 @@ theorem theonaeherJ_lower {τ : ℍ} (hτ : τ ∈ Region) : have heq : 1728 * J τ = (1728 * q τ * J τ) / q τ := by rw [eq_div_iff hq]; ring rw [heq, norm_div, div_lt_div_iff₀ hQpos hQpos] have hlow := norm_mul_q_J_ge hτ - have hQsq : ‖q τ‖ ^ 2 < 0.000389 ^ 2 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num) + have hQsq : ‖q τ‖ ^ 2 < 0.000389 ^ 2 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num only) linarith [mul_le_mul_of_nonneg_right hlow hQpos.le, mul_lt_mul_of_pos_right hQsq hQpos] /-- Paper Theorem `theonaeherJ`, upper bracketing: @@ -913,7 +913,7 @@ theorem theonaeherJ_upper {τ : ℍ} (hτ : τ ∈ Region) : have heq : 1728 * J τ = (1728 * q τ * J τ) / q τ := by rw [eq_div_iff hq]; ring rw [heq, norm_div, div_lt_div_iff₀ hQpos hQpos] have hup := norm_mul_q_J_le hτ - have hQsq : ‖q τ‖ ^ 2 < 0.000389 ^ 2 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num) + have hQsq : ‖q τ‖ ^ 2 < 0.000389 ^ 2 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num only) linarith [mul_le_mul_of_nonneg_right hup hQpos.le, mul_lt_mul_of_pos_right hQsq hQpos] /-- Paper Theorem `theonaeherJ`: `|J(τ)| > 1.096` for `Im τ > 5/4`. -/ @@ -927,12 +927,12 @@ theorem theonaeherJ_norm_J {τ : ℍ} (hτ : τ ∈ Region) : 1.096 < ‖J τ‖ have hd : ‖(1728 : ℂ) * q τ‖ = 1728 * ‖q τ‖ := by rw [norm_mul, Complex.norm_ofNat] rw [show (1728 : ℂ) * q τ * J τ = 1728 * q τ * J τ from rfl, hd, lt_div_iff₀ (by positivity)] have hlow := norm_mul_q_J_ge hτ - have hQsq : ‖q τ‖ ^ 2 < 0.000389 ^ 2 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num) + have hQsq : ‖q τ‖ ^ 2 < 0.000389 ^ 2 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num only) linarith [hlow, hQsq, hQ] /-- `|J(τ)| > 1` for `Im τ > 5/4`; in particular `J(τ) ≠ 0` and `J(τ) ≠ 1` there. -/ theorem one_lt_norm_J {τ : ℍ} (hτ : τ ∈ Region) : 1 < ‖J τ‖ := - lt_trans (by norm_num) (theonaeherJ_norm_J hτ) + lt_trans (by norm_num1) (theonaeherJ_norm_J hτ) /-! ### Theorem `theonaehers2` -/ @@ -958,10 +958,10 @@ theorem theonaehers2 {τ : ℍ} (hτ : τ ∈ Region) : + (E₄ τ - E₄trunc τ) * (E₂star τ - E₂starTrunc τ) - s₂tilde τ * (E₆ τ - E₆trunc τ)) / E₆ τ := by simp only [s₂, s₂tilde_eq] - field_simp + field_simp (disch := first | assumption | norm_num1 | positivity) ring rw [hid, norm_div] - rw [div_lt_iff₀ (lt_trans (by norm_num) hE6norm : (0 : ℝ) < ‖E₆ τ‖)] + rw [div_lt_iff₀ (lt_trans (by norm_num1) hE6norm : (0 : ℝ) < ‖E₆ τ‖)] have hnum : ‖(E₄ τ - E₄trunc τ) * E₂starTrunc τ + E₄trunc τ * (E₂star τ - E₂starTrunc τ) + (E₄ τ - E₄trunc τ) * (E₂star τ - E₂starTrunc τ) - s₂tilde τ * (E₆ τ - E₆trunc τ)‖ @@ -977,12 +977,12 @@ theorem theonaehers2 {τ : ℍ} (hτ : τ ∈ Region) : have h1 : ‖E₄ τ - E₄trunc τ‖ * ‖E₂starTrunc τ‖ ≤ (6744 * Q ^ 3) * 1.0094 := mul_le_mul hdX hZ (norm_nonneg _) (by positivity) have h2 : ‖E₄trunc τ‖ * ‖E₂star τ - E₂starTrunc τ‖ ≤ 1.0937 * (96.2 * Q ^ 3) := - mul_le_mul hX hdZ (norm_nonneg _) (by norm_num) + mul_le_mul hX hdZ (norm_nonneg _) (by norm_num1) have h3 : ‖E₄ τ - E₄trunc τ‖ * ‖E₂star τ - E₂starTrunc τ‖ ≤ (6744 * Q ^ 3) * (96.2 * Q ^ 3) := mul_le_mul hdX hdZ (norm_nonneg _) (by positivity) have h4 : ‖s₂tilde τ‖ * ‖E₆ τ - E₆trunc τ‖ ≤ 1.3776 * (123783 * Q ^ 3) := - mul_le_mul hst hdY (norm_nonneg _) (by norm_num) - have hQ3 : Q ^ 3 < 0.000389 ^ 3 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num) + mul_le_mul hst hdY (norm_nonneg _) (by norm_num1) + have hQ3 : Q ^ 3 < 0.000389 ^ 3 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num1) have hQ6 : (6744 * Q ^ 3) * (96.2 * Q ^ 3) ≤ 1 * Q ^ 3 := by have h33 : Q ^ 3 * Q ^ 3 ≤ 0.000389 ^ 3 * Q ^ 3 := mul_le_mul_of_nonneg_right hQ3.le (pow_pos hQpos 3).le diff --git a/LeanPool/Chudnovsky/Fourier.lean b/LeanPool/Chudnovsky/Fourier.lean index 4e824984d5..92332c2a79 100644 --- a/LeanPool/Chudnovsky/Fourier.lean +++ b/LeanPool/Chudnovsky/Fourier.lean @@ -62,7 +62,8 @@ private lemma G_Lτ_eq (τ : ℍ) {k : ℕ} (hk : 3 ≤ k) : have hbase : (((Lτ τ).latticeEquivProd.symm.toEquiv x : (Lτ τ).lattice) : ℂ) = (x.1 : ℂ) + (x.2 : ℂ) * (τ : ℂ) := by have h := (Lτ τ).latticeEquiv_symm_apply x - simpa using h + simpa only [LinearEquiv.toEquiv_symm, LinearEquiv.coe_symm_toEquiv, Lτ_ω₁, mul_one, + Lτ_ω₂] using h rw [hbase, eisSummand, pairArrowEquiv_apply] simp only [Matrix.cons_val_zero, Matrix.cons_val_one] rw [zpow_neg, zpow_natCast, add_comm] @@ -76,8 +77,8 @@ private lemma eisensteinSeries_eq_two_E (τ : ℍ) {k : ℕ} (hk : 3 ≤ k) : /-- `ζ(6) = π⁶/945`. -/ private lemma riemannZeta_six : riemannZeta 6 = (π : ℂ) ^ 6 / 945 := by - have h := riemannZeta_two_mul_nat (k := 3) (by norm_num) - norm_num [show bernoulli 6 = 1 / 42 by as_aux_lemma => exact bernoulli_six_value] at h + have h := riemannZeta_two_mul_nat (k := 3) (by norm_num1) + norm_num only [show bernoulli 6 = 1 / 42 by as_aux_lemma => exact bernoulli_six_value] at h rw [h]; ring private lemma pi_C_ne_zero : (π : ℂ) ≠ 0 := by exact_mod_cast Real.pi_ne_zero @@ -87,7 +88,7 @@ private lemma pi_C_ne_zero : (π : ℂ) ≠ 0 := by exact_mod_cast Real.pi_ne_ze theorem eta₁_Lτ (τ : ℍ) : (Lτ τ).eta₁ = (π : ℂ) ^ 2 / 3 * E2 τ := by have hz : (2 * riemannZeta 2 : ℂ) ≠ 0 := by rw [riemannZeta_two] - exact mul_ne_zero two_ne_zero (div_ne_zero (pow_ne_zero 2 pi_C_ne_zero) (by norm_num)) + exact mul_ne_zero two_ne_zero (div_ne_zero (pow_ne_zero 2 pi_C_ne_zero) (by norm_num1)) have hE2 : G2 τ = 2 * riemannZeta 2 * E2 τ := by have hdef : E2 τ = (1 / (2 * riemannZeta 2)) • G2 τ := rfl rw [hdef, smul_eq_mul, ← mul_assoc, mul_one_div, div_self hz, one_mul] @@ -95,14 +96,14 @@ theorem eta₁_Lτ (τ : ℍ) : (Lτ τ).eta₁ = (π : ℂ) ^ 2 / 3 * E2 τ := /-- `g₂(L_τ) = (4/3)·π⁴·E₄(τ)` (paper Thm. `fouriertheorem`). -/ theorem g₂_Lτ (τ : ℍ) : (Lτ τ).g₂ = 4 / 3 * (π : ℂ) ^ 4 * E₄ τ := by - rw [PeriodPair.g₂, G_Lτ_eq τ (by norm_num), eisensteinSeries_eq_two_E τ (by norm_num)] - rw [show ((4 : ℕ) : ℂ) = 4 by norm_num, riemannZeta_four] + rw [PeriodPair.g₂, G_Lτ_eq τ (by norm_num1), eisensteinSeries_eq_two_E τ (by norm_num1)] + rw [show ((4 : ℕ) : ℂ) = 4 by norm_num1, riemannZeta_four] ring /-- `g₃(L_τ) = (8/27)·π⁶·E₆(τ)` (paper Thm. `fouriertheorem`). -/ theorem g₃_Lτ (τ : ℍ) : (Lτ τ).g₃ = 8 / 27 * (π : ℂ) ^ 6 * E₆ τ := by - rw [PeriodPair.g₃, G_Lτ_eq τ (by norm_num), eisensteinSeries_eq_two_E τ (by norm_num)] - rw [show ((6 : ℕ) : ℂ) = 6 by norm_num, riemannZeta_six] + rw [PeriodPair.g₃, G_Lτ_eq τ (by norm_num1), eisensteinSeries_eq_two_E τ (by norm_num1)] + rw [show ((6 : ℕ) : ℂ) = 6 by norm_num1, riemannZeta_six] ring /-- `Δ(L_τ) = (2π)¹²/1728·(E₄(τ)³ - E₆(τ)²)` (paper Thm. `fouriertheorem`). -/ @@ -128,7 +129,8 @@ on the connected set `Lᶜ`, hence is constant, and the constant is `-1` by oddn /-- The lattice is a countable subset of `ℂ`. -/ private lemma countable_lattice (L : PeriodPair) : (↑L.lattice : Set ℂ).Countable := by have : Countable ↥L.lattice := countable_of_Lindelof_of_discrete - simpa using Set.countable_range (Subtype.val : ↥L.lattice → ℂ) + simpa only [Subtype.range_coe_subtype, + SetLike.setOfPred_mem_eq] using Set.countable_range (Subtype.val : ↥L.lattice → ℂ) /-- The complement of the lattice is dense in `ℂ`. -/ private lemma dense_compl_lattice (L : PeriodPair) : Dense (↑L.lattice : Set ℂ)ᶜ := @@ -147,10 +149,11 @@ private lemma weierstrassSigma_add_period (L : PeriodPair) (ω : ℂ) (hωlat : set S : Set ℂ := (↑L.lattice)ᶜ with hSdef have hSopen : IsOpen S := L.isClosed_lattice.isOpen_compl have hSconn : IsPreconnected S := - ((countable_lattice L).isConnected_compl_of_one_lt_rank (by simp)).isPreconnected + ((countable_lattice L).isConnected_compl_of_one_lt_rank (by simp only [rank_real_complex, + Nat.one_lt_ofNat])).isPreconnected have hσdiff : Differentiable ℂ sig := L.differentiable_weierstrassSigma have hmem : ∀ {x : ℂ}, x ∉ L.lattice → x + ω ∉ L.lattice := by - intro x hx hc; exact hx (by simpa using sub_mem hc hωlat) + intro x hx hc; exact hx (by simpa only [add_sub_cancel_right] using sub_mem hc hωlat) have hσne : ∀ {x : ℂ}, x ∉ L.lattice → sig x ≠ 0 := by intro x hx; rw [hsig]; exact fun h => hx ((L.weierstrassSigma_eq_zero_iff x).mp h) set E : ℂ → ℂ := fun z => Complex.exp (μ * (z + ω / 2)) with hE @@ -159,8 +162,8 @@ private lemma weierstrassSigma_add_period (L : PeriodPair) (ω : ℂ) (hωlat : have hEderiv : ∀ z, HasDerivAt E (μ * E z) z := by intro z have hlin : HasDerivAt (fun z : ℂ => μ * (z + ω / 2)) μ z := by - simpa using ((hasDerivAt_id z).add_const (ω / 2)).const_mul μ - simpa [hE, mul_comm] using hlin.cexp + simpa only [id_eq, mul_one] using ((hasDerivAt_id z).add_const (ω / 2)).const_mul μ + simpa only [hE, mul_comm] using hlin.cexp have hf : ∀ z, HasDerivAt (fun z => sig (z + ω)) (deriv sig (z + ω)) z := by intro z have h := (hσdiff (z + ω)).hasDerivAt.comp z ((hasDerivAt_id z).add_const ω) @@ -205,7 +208,7 @@ private lemma weierstrassSigma_add_period (L : PeriodPair) (ω : ℂ) (hωlat : -- Hence `m = -1` on `S`. have hmconst : Set.EqOn m (fun _ => (-1 : ℂ)) S := by have hx0mem : -(ω / 2) ∈ S := by - change -(ω / 2) ∉ L.lattice; intro hc; exact hω2 (by simpa using neg_mem hc) + change -(ω / 2) ∉ L.lattice; intro hc; exact hω2 (by simpa only [neg_neg] using neg_mem hc) have hval0 : m (-(ω / 2)) = -1 := by have e1 : -(ω / 2) + ω = ω / 2 := by ring have hEval : E (-(ω / 2)) = 1 := by @@ -216,7 +219,7 @@ private lemma weierstrassSigma_add_period (L : PeriodPair) (ω : ℂ) (hωlat : rw [inv_neg, mul_neg, mul_inv_cancel₀ hsne] refine hSopen.eqOn_of_deriv_eq hSconn ?_ (differentiableOn_const _) ?_ hx0mem ?_ · exact fun z hz => (hmderiv z hz).differentiableAt.differentiableWithinAt - · intro z hz; rw [(hmderiv z hz).deriv]; simp + · intro z hz; rw [(hmderiv z hz).deriv]; simp only [deriv_const'] · simpa using hval0 -- Turn the constancy into the pointwise relation on `S`, then extend by density. have hkey : Set.EqOn (fun z => sig (z + ω)) (fun z => -E z * sig z) S := by @@ -228,13 +231,13 @@ private lemma weierstrassSigma_add_period (L : PeriodPair) (ω : ℂ) (hωlat : change sig (z + ω) = -E z * sig z rw [this, hg]; ring have hcontf : Continuous (fun z => sig (z + ω)) := - hσdiff.continuous.comp (by fun_prop) + hσdiff.continuous.comp SeparatelyContinuousAdd.continuous_add_const have hcontg : Continuous (fun z => -E z * sig z) := by have hcE : Continuous E := by simp only [hE]; fun_prop exact (hcE.neg).mul hσdiff.continuous have heq := Continuous.ext_on (dense_compl_lattice L) hcontf hcontg hkey have := congrFun heq z - simpa [hsig, hE] using this + simpa only [hsig, neg_mul, hE] using this /-- σ transformation law for `L_τ` in the `ω₁ = 1` direction: `σ(z+1) = -exp(η₁·(z+1/2))·σ(z)`. -/ @@ -310,7 +313,8 @@ private lemma qProd_ne_zero {q : ℂ} (hq : ‖q‖ < 1) {v : ℂ} refine tprod_one_add_ne_zero_of_summable (fun k => ?_) ?_ · rw [show (1 : ℂ) + -(q ^ (k + 1) * v) = 1 - q ^ (k + 1) * v by ring, sub_ne_zero] exact fun h => hv k h.symm - · simpa [norm_neg] using summable_norm_iff.mpr (summable_qpow_mul hq v) + · simpa only [norm_neg, Complex.norm_mul, + norm_pow] using summable_norm_iff.mpr (summable_qpow_mul hq v) have hcongr : (∏' k : ℕ, (1 + -(q ^ (k + 1) * v))) = qProd q v := by simp only [qProd]; exact tprod_congr (fun k => by ring) rwa [hcongr] at key @@ -326,7 +330,7 @@ private lemma differentiable_qProd {q : ℂ} (hq : ‖q‖ < 1) : apply hasProdLocallyUniformlyOn_of_forall_compact isOpen_univ intro K _ hcK rcases K.eq_empty_or_nonempty with hN | hN - · simpa [hasProdUniformlyOn_iff_tendstoUniformlyOn, hN] using tendstoUniformlyOn_empty + · simpa only [hN, hasProdUniformlyOn_iff_tendstoUniformlyOn] using tendstoUniformlyOn_empty · obtain ⟨v₀, _, _, HB⟩ := hcK.exists_sSup_image_eq_and_ge hN (show ContinuousOn (fun v : ℂ => ‖v‖) K by fun_prop) refine (((summable_nat_add_iff 1).mpr @@ -336,7 +340,7 @@ private lemma differentiable_qProd {q : ℂ} (hq : ‖q‖ < 1) : rw [norm_neg, norm_mul, norm_pow] exact mul_le_mul_of_nonneg_left (HB x hx) (by positivity) have := hLU.hasProdLocallyUniformlyOn.differentiableOn - (.of_forall fun _ => by simpa [Finset.prod_fn] using + (.of_forall fun _ => by simpa only [Finset.prod_fn] using DifferentiableOn.finsetProd (fun i _ => by fun_prop)) isOpen_univ exact this @@ -358,7 +362,7 @@ private lemma one_sub_qpow_ne_zero {q : ℂ} (hq : ‖q‖ < 1) (k : ℕ) : private lemma multipliable_qProd_inv_nat {q : ℂ} (hq : ‖q‖ < 1) : Multipliable (fun k : ℕ => (1 - q ^ (k + 1))⁻¹) := by - have hpos : 0 < 1 - ‖q‖ := by linarith + have hpos : 0 < 1 - ‖q‖ := by linarith only [hq] have hsum : Summable (fun k : ℕ => q ^ (k + 1) * (1 - q ^ (k + 1))⁻¹) := by refine Summable.of_norm_bounded (g := fun k : ℕ => ‖q‖ ^ (k + 1) * (1 - ‖q‖)⁻¹) @@ -380,7 +384,7 @@ private lemma combined_eq_Gfun {q : ℂ} (hq : ‖q‖ < 1) (w : ℂ) : have hA := multipliable_qProd_nat hq w have hB := multipliable_qProd_nat hq w⁻¹ have hD : Multipliable (fun k : ℕ => 1 - q ^ (k + 1)) := - (multipliable_qProd_nat hq 1).congr (fun k => by ring) + (multipliable_qProd_nat hq 1).congr (fun k => by ac_rfl) have hDsq : Multipliable (fun k : ℕ => (1 - q ^ (k + 1)) ^ 2) := (hD.mul hD).congr (fun k => (sq _).symm) have hDinv := multipliable_qProd_inv_nat hq @@ -390,7 +394,7 @@ private lemma combined_eq_Gfun {q : ℂ} (hq : ‖q‖ < 1) (w : ℂ) : (1 - q ^ (k + 1) * w) * (1 - q ^ (k + 1) * w⁻¹) / (1 - q ^ (k + 1)) ^ 2) := ((hA.mul hB).mul hEsq).congr (fun k => by rw [div_eq_mul_inv]) have hqP1 : qProd q 1 = ∏' k : ℕ, (1 - q ^ (k + 1)) := by - simp only [qProd]; exact tprod_congr (fun k => by ring) + simp only [qProd]; exact tprod_congr (fun k => by ac_rfl) -- `P · ∏'D² = Q(w)·Q(w⁻¹)` have hcomb : (fun k : ℕ => (1 - q ^ (k + 1) * w) * (1 - q ^ (k + 1) * w⁻¹) / (1 - q ^ (k + 1)) ^ 2 @@ -554,7 +558,7 @@ private lemma qProd_qz_ne_zero (τ : ℍ) {z : ℂ} (hz : z ∉ (Lτ τ).lattice private lemma qProd_qzinv_ne_zero (τ : ℍ) {z : ℂ} (hz : z ∉ (Lτ τ).lattice) : qProd (q τ) (exp (2 * (π : ℂ) * I * z))⁻¹ ≠ 0 := by - have hnegz : -z ∉ (Lτ τ).lattice := fun hc => hz (by simpa using neg_mem hc) + have hnegz : -z ∉ (Lτ τ).lattice := fun hc => hz (by simpa only [neg_neg] using neg_mem hc) exact qProd_ne_zero (norm_q_lt_one τ) (fun k => by rw [qpow_qzinv_eq]; exact exp_add_lattice_ne_one τ hnegz ((k : ℤ) + 1)) @@ -574,7 +578,7 @@ private lemma gfun_ne_zero (τ : ℍ) {z : ℂ} (hz : z ∉ (Lτ τ).lattice) : have hqz1 : exp (2 * (π : ℂ) * I * z) - 1 ≠ 0 := by rw [sub_ne_zero] have := exp_add_lattice_ne_one τ hz 0 - simpa using this + simpa only [ne_eq, Int.cast_zero, zero_mul, zero_add] using this simp only [gfun] exact mul_ne_zero (div_ne_zero hqz1 h2pi) (Gfun_ne_zero τ hz) @@ -592,7 +596,7 @@ private lemma deriv_weierstrassSigma_zero (L : PeriodPair) : deriv L.weierstrass rw [← differentiableOn_univ] refine (L.hasProdLocallyUniformly_weierstrassSigmaTerm.hasProdLocallyUniformlyOn |>.differentiableOn) (.of_forall fun _ => ?_) isOpen_univ - simpa [Finset.prod_fn] using DifferentiableOn.finsetProd (fun i _ => + simpa only [ne_eq, Finset.prod_fn] using DifferentiableOn.finsetProd (fun i _ => (by unfold PeriodPair.weierstrassSigmaTerm; fun_prop : DifferentiableOn ℂ (fun z => PeriodPair.weierstrassSigmaTerm z (i.1 : ℂ)) _)) have hP0 : (∏' l : {l : L.lattice // l ≠ 0}, @@ -617,15 +621,15 @@ private lemma gfun_hasDerivAt_zero (τ : ℍ) : HasDerivAt (gfun τ) 1 0 := by have h1 : HasDerivAt (fun z : ℂ => exp (2 * (π : ℂ) * I * z)) (exp (2 * (π : ℂ) * I * 0) * (2 * (π : ℂ) * I)) 0 := by have hlin : HasDerivAt (fun z : ℂ => 2 * (π : ℂ) * I * z) (2 * (π : ℂ) * I) 0 := by - simpa using (hasDerivAt_id (0 : ℂ)).const_mul (2 * (π : ℂ) * I) - simpa [mul_comm] using hlin.cexp + simpa only [id_eq, mul_one] using (hasDerivAt_id (0 : ℂ)).const_mul (2 * (π : ℂ) * I) + simpa only [mul_comm, zero_mul, exp_zero, one_mul] using hlin.cexp have hA : HasDerivAt (fun z : ℂ => (exp (2 * (π : ℂ) * I * z) - 1) / (2 * (π : ℂ) * I)) 1 0 := by have := (h1.sub_const 1).div_const (2 * (π : ℂ) * I) rwa [mul_zero, Complex.exp_zero, one_mul, div_self h2pi] at this have hmul := hA.mul (differentiable_Gfun τ 0).hasDerivAt have hval : (1 : ℂ) * Gfun τ 0 + (exp (2 * (π : ℂ) * I * 0) - 1) / (2 * (π : ℂ) * I) * deriv (Gfun τ) 0 = 1 := by - rw [Gfun_zero]; simp + rw [Gfun_zero]; simp only [mul_one, mul_zero, exp_zero, sub_self, zero_div, zero_mul, add_zero] rw [hval] at hmul exact hmul @@ -651,7 +655,7 @@ private lemma phi_order (τ : ℍ) (z : ℂ) : rfl rw [heq, meromorphicOrderAt_mul hexpan.meromorphicAt hσ, hexpan.meromorphicOrderAt_eq, hexpan.analyticOrderAt_eq_zero.mpr (Complex.exp_ne_zero _)] - simp + simp only [ENat.map_zero, CharP.cast_eq_zero, WithTop.coe_zero, zero_add] /-- `H := φ/g` is periodic under the lattice `L_τ`. -/ private lemma hfun_add_lattice (τ : ℍ) (l : ℂ) (hl : l ∈ (Lτ τ).lattice) (z : ℂ) : @@ -699,7 +703,8 @@ theorem weierstrassSigma_Lτ (τ : ℍ) (z : ℂ) : have hHord0 : meromorphicOrderAt H 0 = 0 := by rw [hH, meromorphicOrderAt_div (hφmero 0) (hgmero 0), phi_order τ 0, (Lτ τ).meromorphicOrderAt_weierstrassSigma 0 (Lτ τ).lattice.zero_mem, gfun_order_zero] - simp + simp only [LinearOrderedAddCommGroupWithTop.sub_self_eq_zero_iff_ne_top, ne_eq, + WithTop.one_ne_top, not_false_eq_true] have hHordAll : ∀ w, meromorphicOrderAt H w = 0 := by intro w by_cases hw : w ∈ (Lτ τ).lattice @@ -707,7 +712,7 @@ theorem weierstrassSigma_Lτ (τ : ℍ) (z : ℂ) : have hcomp : (H ∘ fun x => x + w) = H := by funext x have := hfun_add_lattice τ w hw x - simpa [hH, Pi.div_apply] using this + simpa only [hH, Function.comp_apply, Pi.div_apply] using this have hg : AnalyticAt ℂ (fun x : ℂ => x + w) 0 := by fun_prop have hg' : deriv (fun x : ℂ => x + w) 0 ≠ 0 := by rw [deriv_add_const, deriv_id'']; exact one_ne_zero @@ -726,7 +731,7 @@ theorem weierstrassSigma_Lτ (τ : ℍ) (z : ℂ) : have han : AnalyticAt ℂ (gfun τ) w := (differentiable_gfun τ).analyticAt w rw [han.meromorphicOrderAt_eq, han.analyticOrderAt_eq_zero.mpr (gfun_ne_zero τ hw)] rfl - rw [hσw, hgw]; simp + rw [hσw, hgw]; simp only [sub_zero] -- Apply the workhorse against the constant `1`. have hone : (Lτ τ).IsEllipticWith (fun _ : ℂ => (1 : ℂ)) := ⟨fun w => analyticAt_const.meromorphicAt, fun w l => rfl⟩ @@ -739,7 +744,7 @@ theorem weierstrassSigma_Lτ (τ : ℍ) (z : ℂ) : -- Turn the codiscrete equality into `φ = c·g` everywhere. have hcodis' : {w : ℂ | H w = c} ∈ Filter.codiscrete ℂ := by have h : {w : ℂ | H w = (fun _ => c * (1 : ℂ)) w} ∈ Filter.codiscrete ℂ := hcodis - simpa using h + simpa only [mul_one] using h have hsub : {w : ℂ | H w = c} ⊆ {w : ℂ | φfun τ w = c * gfun τ w} := by intro w hw simp only [Set.mem_ofPred_eq, hH, Pi.div_apply] at hw ⊢ @@ -770,9 +775,10 @@ theorem weierstrassSigma_Lτ (τ : ℍ) (z : ℂ) : have hvlin : HasDerivAt (fun z : ℂ => -(Lτ τ).eta₁ / 2 * z ^ 2 + (π : ℂ) * I * z) ((π : ℂ) * I) 0 := by have h1 : HasDerivAt (fun z : ℂ => -(Lτ τ).eta₁ / 2 * z ^ 2) 0 0 := by - simpa using (hasDerivAt_pow 2 (0 : ℂ)).const_mul (-(Lτ τ).eta₁ / 2) + simpa only [Nat.cast_ofNat, Nat.add_one_sub_one, pow_one, + mul_zero] using (hasDerivAt_pow 2 (0 : ℂ)).const_mul (-(Lτ τ).eta₁ / 2) have h2 : HasDerivAt (fun z : ℂ => (π : ℂ) * I * z) ((π : ℂ) * I) 0 := by - simpa using (hasDerivAt_id (0 : ℂ)).const_mul ((π : ℂ) * I) + simpa only [id_eq, mul_one] using (hasDerivAt_id (0 : ℂ)).const_mul ((π : ℂ) * I) have h3 := h1.add h2 rw [zero_add] at h3 exact h3 diff --git a/LeanPool/Chudnovsky/Imports.lean b/LeanPool/Chudnovsky/Imports.lean index 5c5c773e2d..2410b26dea 100644 --- a/LeanPool/Chudnovsky/Imports.lean +++ b/LeanPool/Chudnovsky/Imports.lean @@ -20,6 +20,7 @@ public import LeanPool.Chudnovsky.Kummer public import LeanPool.Chudnovsky.Lattices public import LeanPool.Chudnovsky.Liouville public import LeanPool.Chudnovsky.MainTheorem +public import LeanPool.Chudnovsky.NumericalBounds public import LeanPool.Chudnovsky.Numerics public import LeanPool.Chudnovsky.Periodicity public import LeanPool.Chudnovsky.PicardFuchs diff --git a/LeanPool/Chudnovsky/Kummer.lean b/LeanPool/Chudnovsky/Kummer.lean index 7330a5b174..effe0943e2 100644 --- a/LeanPool/Chudnovsky/Kummer.lean +++ b/LeanPool/Chudnovsky/Kummer.lean @@ -101,7 +101,7 @@ theorem kummerB_satisfiesPicardFuchs : obtain ⟨hznorm, hzim⟩ := hz -- Basic numerical facts on the region `S = {1 < ‖z‖, im z ≠ 0}`. have hz0 : z ≠ 0 := by - intro h; rw [h, norm_zero] at hznorm; exact absurd hznorm (by norm_num) + intro h; rw [h, norm_zero] at hznorm; exact absurd hznorm (by norm_num only) have hz1 : z ≠ 1 := by intro h; rw [h, norm_one] at hznorm; exact absurd hznorm (lt_irrefl 1) have h1z : (1 : ℂ) - z ≠ 0 := sub_ne_zero.2 (Ne.symm hz1) @@ -144,7 +144,7 @@ theorem kummerB_satisfiesPicardFuchs : intro w hw obtain ⟨hwn, hwim⟩ := hw have hw0 : w ≠ 0 := by - intro h; rw [h, norm_zero] at hwn; exact absurd hwn (by norm_num) + intro h; rw [h, norm_zero] at hwn; exact absurd hwn (by norm_num only) have hw1 : w ≠ 1 := by intro h; rw [h, norm_one] at hwn; exact lt_irrefl 1 hwn have hwslit : w ∈ Complex.slitPlane := Or.inr hwim @@ -195,7 +195,7 @@ theorem kummerB_satisfiesPicardFuchs : rw [heqEv.deriv_eq, hderivKummer z ⟨hznorm, hzim⟩, hHD_D1.deriv] simp only [hD1def, kummerB, id_eq, Pi.mul_apply, Pi.neg_apply, Pi.inv_apply, Function.comp_apply] rw [eZ1z, eW1z, hF2] - field_simp + field_simp (disch := first | assumption | norm_num1 | positivity) ring /-- On `Region`, the argument `1/J(τ)` of the hypergeometric function lies in the open unit @@ -342,7 +342,7 @@ private lemma hasDerivAt_invJ (τ : ℍ) (h4 : E₄ τ ≠ 0) : have hq : HasDerivAt (fun z => (E₄ (ofComplex z) ^ 3 - E₆ (ofComplex z) ^ 2) / E₄ (ofComplex z) ^ 3) _ ↑τ := hnum.div hden hden0 - convert hq using 1 + refine hq.congr_deriv (Eq.symm ?_) simp only [Pi.pow_apply, Pi.sub_apply, ofComplex_apply] rw [inv_J_eq] field_simp @@ -395,7 +395,7 @@ private lemma hasDerivAt_YhC (τ : ℍ) (h4 : E₄ τ ≠ 0) (h6 : E₆ τ ≠ 0 + 1 / 12 * (5 / 12) * hyp2F1 (J τ)⁻¹) / ((J τ)⁻¹ * ((J τ)⁻¹ - 1)) := by rw [eq_div_iff hden] linear_combination hODE - convert h using 1 + refine h.congr_deriv (Eq.symm ?_) rw [XhC_apply, YhC_apply, hF2] simp only [m22] rw [inv_J_sub_one h4, inv_J_eq] @@ -412,7 +412,7 @@ private lemma hasDerivAt_XtC (τ : ℍ) (hs : E₄ τ ∈ Complex.slitPlane) (h6 rw [ofComplex_apply] exact hs have h : HasDerivAt XtC _ ↑τ := (hasDerivAt_E₄C τ).cpow_const (c := (1 / 4 : ℂ)) hsC - convert h using 1 + refine h.congr_deriv (Eq.symm ?_) simp only [ofComplex_apply] rw [YtC_apply, Complex.cpow_sub _ _ h4, Complex.cpow_one, inv_J_eq] field_simp @@ -436,9 +436,9 @@ private lemma hasDerivAt_YtC (τ : ℍ) (hs : E₄ τ ∈ Complex.slitPlane) (h6 (12 : ℂ)).mul (hasDerivAt_E₆C τ) have hden0 : 12 * (E₄ (ofComplex ↑τ) ^ 3 - E₆ (ofComplex ↑τ) ^ 2) * E₆ (ofComplex ↑τ) ≠ 0 := by rw [ofComplex_apply] - exact mul_ne_zero (mul_ne_zero (by norm_num) hB) h6 + exact mul_ne_zero (mul_ne_zero (by norm_num only) hB) h6 have h : HasDerivAt YtC _ ↑τ := hnum.div hden hden0 - convert h using 1 + refine h.congr_deriv (Eq.symm ?_) simp only [Pi.pow_apply, Pi.sub_apply, Pi.mul_apply, ofComplex_apply] rw [XtC_apply, YtC_apply] simp only [m22] @@ -455,7 +455,7 @@ private lemma hasDerivAt_WrC (τ : ℍ) (hs : E₄ τ ∈ Complex.slitPlane) (h6 have h : HasDerivAt WrC _ ↑τ := ((hasDerivAt_XhC τ h4 hu).mul (hasDerivAt_YtC τ hs h6)).sub ((hasDerivAt_YhC τ h4 h6 hu).mul (hasDerivAt_XtC τ hs h6)) - convert h using 1 + refine h.congr_deriv (Eq.symm ?_) rw [WrC_apply] ring @@ -465,12 +465,12 @@ All limits are soft consequences of `E₂, E₄, E₆ → 1` except `Ytilde → cusp-function factorization of `D E₄` and `kfun → 1`. -/ private lemma tendsto_q_zero : Tendsto (fun τ : ℍ => q τ) atImInfty (𝓝 0) := by - simpa [q] using qParam_tendsto_atImInfty one_pos + simpa only [q] using qParam_tendsto_atImInfty one_pos private lemma tendsto_invJ : Tendsto (fun τ : ℍ => (J τ)⁻¹) atImInfty (𝓝 0) := by have h := ((tendsto_E₄_atImInfty.pow 3).sub (tendsto_E₆_atImInfty.pow 2)).div - (tendsto_E₄_atImInfty.pow 3) (by norm_num) - norm_num at h + (tendsto_E₄_atImInfty.pow 3) (by norm_num only) + norm_num only at h exact h.congr fun τ => (inv_J_eq τ).symm private lemma tendsto_XhC : Tendsto (fun τ : ℍ => XhC ↑τ) atImInfty (𝓝 1) := by @@ -499,7 +499,7 @@ private lemma deriv_hyp2F1_zero : deriv hyp2F1 0 = 5 / 144 := by rw [hat.deriv, ordinaryHypergeometricSeries_apply_eq] simp only [ascPochhammer_one, Polynomial.eval_X, Nat.factorial_one, Nat.cast_one, inv_one, one_mul, one_pow, smul_eq_mul, mul_one] - norm_num + norm_num only private lemma tendsto_YhC : Tendsto (fun τ : ℍ => YhC ↑τ) atImInfty (𝓝 (5 / 144)) := by have hF : ContinuousAt (deriv hyp2F1) 0 := @@ -534,14 +534,15 @@ private lemma YtC_eq (τ : ℍ) : field_simp rcases eq_or_ne (E₆ τ) 0 with h6 | h6 · rw [YtC_apply, h6] - simp + simp only [one_div, sub_zero, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, zero_pow, mul_zero, + div_zero] · have hk : kfun τ ≠ 0 := - div_ne_zero (E₄_cube_sub_E₆_sq_ne_zero τ) (mul_ne_zero (by norm_num) hq) + div_ne_zero (E₄_cube_sub_E₆_sq_ne_zero τ) (mul_ne_zero (by norm_num only) hq) have hd1 : (12 : ℂ) * (1728 * q τ * kfun τ) * E₆ τ ≠ 0 := - mul_ne_zero (mul_ne_zero (by norm_num) - (mul_ne_zero (mul_ne_zero (by norm_num) hq) hk)) h6 + mul_ne_zero (mul_ne_zero (by norm_num only) + (mul_ne_zero (mul_ne_zero (by norm_num only) hq) hk)) h6 have hd2 : (6912 : ℂ) * kfun τ * E₆ τ ≠ 0 := - mul_ne_zero (mul_ne_zero (by norm_num) hk) h6 + mul_ne_zero (mul_ne_zero (by norm_num only) hk) h6 rw [YtC_apply, XtC_apply, hkey, hB, div_eq_div_iff hd1 hd2] ring @@ -550,15 +551,16 @@ private lemma tendsto_kfun : Tendsto kfun atImInfty (𝓝 1) := by have h1 : Tendsto (fun τ : ℍ => (1 : ℂ) - q τ - q τ ^ 2) atImInfty (𝓝 (1 - 0 - 0 ^ 2)) := (tendsto_const_nhds.sub tendsto_q_zero).sub (tendsto_q_zero.pow 2) have h2 := h1.pow 24 - norm_num at h2 + norm_num only at h2 exact h2.congr fun τ => by rw [ktilde] have hdiff : Tendsto (fun τ : ℍ => kfun τ - ktilde τ) atImInfty (𝓝 0) := by have hev : ∀ᶠ τ : ℍ in atImInfty, ‖kfun τ - ktilde τ‖ ≤ 365.6 * ‖q τ‖ ^ 2 := by rw [eventually_iff, atImInfty_mem] - exact ⟨2, fun τ hτ => lemk (lt_of_lt_of_le (by norm_num) hτ)⟩ + exact ⟨2, fun τ hτ => lemk (lt_of_lt_of_le (by norm_num only) hτ)⟩ have hg : Tendsto (fun τ : ℍ => 365.6 * ‖q τ‖ ^ 2) atImInfty (𝓝 0) := by have h := (tendsto_q_zero.norm.pow 2).const_mul (365.6 : ℝ) - simpa using h + simpa only [norm_zero, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, zero_pow, + mul_zero] using h exact squeeze_zero_norm' hev hg have h := hkt.add hdiff rw [add_zero] at h @@ -571,21 +573,21 @@ private lemma tendsto_YtC : Tendsto (fun τ : ℍ => YtC ↑τ) atImInfty (𝓝 have hΦ0 : deriv (cuspFunction 1 ⇑E₄) 0 = 240 := by have h := ModularForm.E₄_qExpansion_coeff_one rw [qExpansion_coeff] at h - simpa [iteratedDeriv_one] using h + simpa only [Nat.factorial_one, Nat.cast_one, inv_one, iteratedDeriv_one, one_mul] using h have hΦ : Tendsto (fun τ : ℍ => deriv (cuspFunction 1 ⇑E₄) (q τ)) atImInfty (𝓝 240) := by have h := (hΦana.deriv.continuousAt.tendsto).comp tendsto_q_zero rwa [hΦ0] at h have hnum := (tendsto_XtC.mul (tendsto_E₄_atImInfty.pow 3)).mul hΦ have hden : Tendsto (fun τ : ℍ => 6912 * kfun τ * E₆ τ) atImInfty (𝓝 (6912 * 1 * 1)) := (tendsto_kfun.const_mul (6912 : ℂ)).mul tendsto_E₆_atImInfty - have h := hnum.div hden (by norm_num) - have hval : ((1 * 1 ^ 3 * 240 : ℂ)) / (6912 * 1 * 1) = 5 / 144 := by norm_num + have h := hnum.div hden (by norm_num only) + have hval : ((1 * 1 ^ 3 * 240 : ℂ)) / (6912 * 1 * 1) = 5 / 144 := by norm_num only rw [hval] at h exact h.congr fun τ => (YtC_eq τ).symm private lemma tendsto_WrC : Tendsto (fun τ : ℍ => WrC ↑τ) atImInfty (𝓝 0) := by have h := (tendsto_XhC.mul tendsto_YtC).sub (tendsto_YhC.mul tendsto_XtC) - norm_num at h + norm_num only at h exact h.congr fun τ => by rw [WrC_apply] private lemma tendsto_m22 : Tendsto (fun τ : ℍ => m22 τ) atImInfty (𝓝 (-1)) := by @@ -606,7 +608,7 @@ private lemma near_one_slitPlane {z : ℂ} (h : ‖z - 1‖ < 1 / 2) : z ∈ Com private lemma near_one_ne_zero {z : ℂ} (h : ‖z - 1‖ < 1 / 2) : z ≠ 0 := by intro h0 rw [h0, zero_sub, norm_neg, norm_one] at h - norm_num at h + norm_num only at h private lemma re_le_neg_half {z : ℂ} (h : ‖z + 1‖ < 1 / 2) : z.re ≤ -(1 / 2) := by have h1 : |(z + 1).re| ≤ ‖z + 1‖ := Complex.abs_re_le_norm _ @@ -625,20 +627,20 @@ private lemma eventually_good : ∀ᶠ τ : ℍ in atImInfty, E₄ τ ∈ Complex.slitPlane ∧ E₆ τ ≠ 0 ∧ J τ ≠ 0 ∧ ‖(J τ)⁻¹‖ < 1 ∧ XhC ↑τ ≠ 0 ∧ (m22 τ).re ≤ -(1 / 2) := by have h₁ : ∀ᶠ τ : ℍ in atImInfty, ‖E₄ τ - 1‖ < 1 / 2 := by - have h := Metric.tendsto_nhds.mp tendsto_E₄_atImInfty (1 / 2) (by norm_num) - simpa [dist_eq_norm] using h + have h := Metric.tendsto_nhds.mp tendsto_E₄_atImInfty (1 / 2) (by norm_num only) + simpa only [one_div, dist_eq_norm] using h have h₂ : ∀ᶠ τ : ℍ in atImInfty, ‖E₆ τ - 1‖ < 1 / 2 := by - have h := Metric.tendsto_nhds.mp tendsto_E₆_atImInfty (1 / 2) (by norm_num) - simpa [dist_eq_norm] using h + have h := Metric.tendsto_nhds.mp tendsto_E₆_atImInfty (1 / 2) (by norm_num only) + simpa only [one_div, dist_eq_norm] using h have h₃ : ∀ᶠ τ : ℍ in atImInfty, ‖(J τ)⁻¹‖ < 1 := by have h := Metric.tendsto_nhds.mp tendsto_invJ 1 one_pos - simpa [dist_eq_norm] using h + simpa only [norm_inv, dist_eq_norm, sub_zero] using h have h₄ : ∀ᶠ τ : ℍ in atImInfty, ‖XhC ↑τ - 1‖ < 1 / 2 := by - have h := Metric.tendsto_nhds.mp tendsto_XhC (1 / 2) (by norm_num) - simpa [dist_eq_norm] using h + have h := Metric.tendsto_nhds.mp tendsto_XhC (1 / 2) (by norm_num only) + simpa only [one_div, dist_eq_norm] using h have h₅ : ∀ᶠ τ : ℍ in atImInfty, ‖m22 τ + 1‖ < 1 / 2 := by - have h := Metric.tendsto_nhds.mp tendsto_m22 (1 / 2) (by norm_num) - simpa [dist_eq_norm, sub_neg_eq_add] using h + have h := Metric.tendsto_nhds.mp tendsto_m22 (1 / 2) (by norm_num only) + simpa only [one_div, dist_eq_norm, sub_neg_eq_add] using h filter_upwards [h₁, h₂, h₃, h₄, h₅] with τ k₁ k₂ k₃ k₄ k₅ exact ⟨near_one_slitPlane k₁, near_one_ne_zero k₂, J_ne_zero (near_one_ne_zero k₁), k₃, near_one_ne_zero k₄, re_le_neg_half k₅⟩ @@ -659,7 +661,7 @@ private lemma E₄_ne_zero_of_mem_Region {τ : ℍ} (hτ : τ ∈ Region) : E₄ have hq3 : ‖q τ‖ ^ 3 ≤ (0.000389 : ℝ) ^ 3 := pow_le_pow_left₀ hqpos.le hq.le 3 intro h0 rw [h0, zero_sub, norm_neg] at h2 - nlinarith [hq3] + linarith [hq3] private lemma im_add_vert (z₀ : ℂ) (t : ℝ) : (z₀ + ↑t * Complex.I).im = z₀.im + t := by simp [Complex.add_im, Complex.mul_im] @@ -681,7 +683,7 @@ private lemma tendsto_vertical {z₀ : ℂ} (h : 0 < z₀.im) : exact tendsto_comap_iff.mpr key /-- **Vanishing of the Wronskian** on `{Im z > A}`: a solution of `D w = M₂₂ w` with -`Re M₂₂ ≤ -1/2` has `‖w‖²·e^{-2πt}` nondecreasing along vertical lines, so `w → 0` at +`Re M₂₂ ≤ -1/2` has nondecreasing squared modulus along vertical lines, so `w → 0` at `i∞` forces `w = 0`. -/ private lemma WrC_eq_zero {A : ℝ} (hA : 2 ≤ A) (hgood : ∀ σ : ℍ, A ≤ σ.im → @@ -712,7 +714,8 @@ private lemma WrC_eq_zero {A : ℝ} (hA : 2 ≤ A) exact coe_ofComplex (him t ht) rw [hcoe] at hW have hline : HasDerivAt (fun w : ℂ => z₀ + w * Complex.I) Complex.I ((t : ℝ) : ℂ) := by - simpa using ((hasDerivAt_id ((t : ℝ) : ℂ)).mul_const Complex.I).const_add z₀ + simpa only [hasDerivAt_const_add_iff, id_eq, + one_mul] using ((hasDerivAt_id ((t : ℝ) : ℂ)).mul_const Complex.I).const_add z₀ have hcc := hW.comp ((t : ℝ) : ℂ) hline have hcomp : HasDerivAt (fun s : ℝ => WrC (z₀ + ↑s * Complex.I)) (2 * ↑π * Complex.I * (m22 σ * WrC (z₀ + ↑t * Complex.I)) * Complex.I) t := @@ -731,43 +734,27 @@ private lemma WrC_eq_zero {A : ℝ} (hA : 2 ≤ A) rwa [show -(2 * ↑π) * (m22 (ofComplex (z₀ + ↑t * Complex.I)) * WrC (z₀ + ↑t * Complex.I)) = (-(2 * ↑π) * m22 (ofComplex (z₀ + ↑t * Complex.I))) * WrC (z₀ + ↑t * Complex.I) from (mul_assoc _ _ _).symm, real_inner_mul_self] at h - -- the weighted modulus `g(t) = r(t)·e^{-2πt}` and its monotonicity - have hgd : ∀ t : ℝ, 0 ≤ t → - HasDerivAt (fun s : ℝ => ‖WrC (z₀ + ↑s * Complex.I)‖ ^ 2 * Real.exp (-(2 * π) * s)) - (2 * ((-(2 * ↑π) * m22 (ofComplex (z₀ + ↑t * Complex.I))).re - * ‖WrC (z₀ + ↑t * Complex.I)‖ ^ 2) * Real.exp (-(2 * π) * t) - + ‖WrC (z₀ + ↑t * Complex.I)‖ ^ 2 * (-(2 * π) * Real.exp (-(2 * π) * t))) t := by - intro t ht - have hexp : HasDerivAt (fun s : ℝ => Real.exp (-(2 * π) * s)) - (-(2 * π) * Real.exp (-(2 * π) * t)) t := by - have h1 : HasDerivAt (fun s : ℝ => -(2 * π) * s) (-(2 * π)) t := by - simpa using (hasDerivAt_id t).const_mul (-(2 * π)) - have h2 := (Real.hasDerivAt_exp (-(2 * π) * t)).comp t h1 - rw [show Real.exp (-(2 * π) * t) * (-(2 * π)) - = -(2 * π) * Real.exp (-(2 * π) * t) from mul_comm _ _] at h2 - exact h2 - exact (hrd t ht).mul hexp - have hmono : MonotoneOn (fun s : ℝ => ‖WrC (z₀ + ↑s * Complex.I)‖ ^ 2 - * Real.exp (-(2 * π) * s)) (Set.Ici (0 : ℝ)) := by + -- The squared modulus is nondecreasing along the vertical ray. + have hmono : MonotoneOn (fun s : ℝ => ‖WrC (z₀ + ↑s * Complex.I)‖ ^ 2) + (Set.Ici (0 : ℝ)) := by apply monotoneOn_of_deriv_nonneg (convex_Ici 0) - · exact fun s hs => ((hgd s hs).continuousAt).continuousWithinAt + · exact fun s hs => ((hrd s hs).continuousAt).continuousWithinAt · rw [interior_Ici] - exact fun s hs => (hgd s (le_of_lt hs)).differentiableAt.differentiableWithinAt + exact fun s hs => (hrd s (le_of_lt hs)).differentiableAt.differentiableWithinAt · rw [interior_Ici] intro s hs - rw [(hgd s (le_of_lt hs)).deriv] + rw [(hrd s (le_of_lt hs)).deriv] obtain ⟨_, _, _, _, _, hre⟩ := hgood (ofComplex (z₀ + ↑s * Complex.I)) (himA s (le_of_lt hs)) - have h1 : (0 : ℝ) ≤ ‖WrC (z₀ + ↑s * Complex.I)‖ ^ 2 := by positivity - have h2 : (0 : ℝ) < Real.exp (-(2 * π) * s) := Real.exp_pos _ - have h3 : (-(2 * ↑π) * m22 (ofComplex (z₀ + ↑s * Complex.I))).re + have hreal : (-(2 * ↑π) * m22 (ofComplex (z₀ + ↑s * Complex.I))).re = -(2 * π) * (m22 (ofComplex (z₀ + ↑s * Complex.I))).re := by rw [show (-(2 * ↑π) : ℂ) = ((-(2 * π) : ℝ) : ℂ) from by push_cast; ring, Complex.re_ofReal_mul] - rw [h3] - have key : (0 : ℝ) ≤ -(4 * π * (m22 (ofComplex (z₀ + ↑s * Complex.I))).re) - 2 * π := by - nlinarith only [hre, Real.pi_pos] - linear_combination mul_nonneg (mul_nonneg h1 h2.le) key + rw [hreal] + have hnonneg : 0 ≤ -(2 * π) * (m22 (ofComplex (z₀ + ↑s * Complex.I))).re := + mul_nonneg_of_nonpos_of_nonpos (neg_nonpos.mpr (by positivity)) + (hre.trans (by norm_num only)) + exact mul_nonneg (by norm_num only) (mul_nonneg hnonneg (sq_nonneg _)) -- `ψ → 0` along the ray, so `r → 0` have hψ0 : Tendsto (fun t : ℝ => WrC (z₀ + ↑t * Complex.I)) atTop (𝓝 0) := by have h := tendsto_WrC.comp (tendsto_vertical hz₀im) @@ -777,21 +764,14 @@ private lemma WrC_eq_zero {A : ℝ} (hA : 2 ≤ A) rw [coe_ofComplex (him t ht)] have hr0 : Tendsto (fun t : ℝ => ‖WrC (z₀ + ↑t * Complex.I)‖ ^ 2) atTop (𝓝 0) := by have h := (hψ0.norm).pow 2 - simpa using h - -- squeeze: `g 0 ≤ g t ≤ r t → 0` - have hg0 : ‖WrC (z₀ + ↑(0 : ℝ) * Complex.I)‖ ^ 2 * Real.exp (-(2 * π) * 0) ≤ 0 := by - have hle : ∀ᶠ t : ℝ in atTop, - ‖WrC (z₀ + ↑(0 : ℝ) * Complex.I)‖ ^ 2 * Real.exp (-(2 * π) * 0) - ≤ ‖WrC (z₀ + ↑t * Complex.I)‖ ^ 2 := by - filter_upwards [eventually_ge_atTop (0 : ℝ)] with t ht - have hmt := hmono Set.self_mem_Ici (Set.mem_Ici.mpr ht) ht - have hexp1 : Real.exp (-(2 * π) * t) ≤ 1 := by - apply Real.exp_le_one_iff.mpr - exact mul_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr (by positivity)) ht - exact hmt.trans (mul_le_of_le_one_right (sq_nonneg _) hexp1) - exact ge_of_tendsto hr0 hle + simpa only [norm_zero, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, zero_pow] using h + -- A nondecreasing nonnegative function tending to zero vanishes at the origin. + have hg0 : ‖WrC (z₀ + ↑(0 : ℝ) * Complex.I)‖ ^ 2 ≤ 0 := by + apply ge_of_tendsto hr0 + filter_upwards [eventually_ge_atTop (0 : ℝ)] with t ht + exact hmono Set.self_mem_Ici (Set.mem_Ici.mpr ht) ht have hz : WrC (z₀ + ↑(0 : ℝ) * Complex.I) = WrC z₀ := by norm_num - rw [hz, mul_zero, Real.exp_zero, mul_one] at hg0 + rw [hz] at hg0 have hnorm : ‖WrC z₀‖ = 0 := sq_eq_zero_iff.mp (le_antisymm hg0 (sq_nonneg _)) exact norm_eq_zero.mp hnorm @@ -846,7 +826,7 @@ private lemma XtC_eq_XhC {A : ℝ} (hA : 2 ≤ A) have hray : Tendsto (fun t : ℝ => XtC (z + ↑t * Complex.I) / XhC (z + ↑t * Complex.I)) atTop (𝓝 1) := by have h := (tendsto_XtC.div tendsto_XhC one_ne_zero).comp (tendsto_vertical hz0) - norm_num at h + norm_num only at h refine h.congr' ?_ filter_upwards [eventually_ge_atTop (0 : ℝ)] with t ht have him : 0 < (z + ↑t * Complex.I).im := by @@ -894,7 +874,7 @@ theorem E₄_eq_hyp2F1_pow_four {τ : ℍ} (hτ : τ ∈ Region) : have h := XtC_eq_XhC hA2 hgood hw have h4 : E₄ (ofComplex w) = XtC w ^ 4 := by rw [show XtC w = E₄ (ofComplex w) ^ (1 / 4 : ℂ) from rfl, ← Complex.cpow_nat_mul, - show ((4 : ℕ) : ℂ) * (1 / 4) = 1 by norm_num, Complex.cpow_one] + show ((4 : ℕ) : ℂ) * (1 / 4) = 1 by norm_num only, Complex.cpow_one] rw [h4, h] rfl -- both sides are analytic on `S = {Im z > 5/4}` @@ -910,7 +890,7 @@ theorem E₄_eq_hyp2F1_pow_four {τ : ℍ} (hτ : τ ∈ Region) : have hg : AnalyticOnNhd ℂ (fun w => hyp2F1 (J (ofComplex w))⁻¹ ^ 4) {w : ℂ | 5 / 4 < w.im} := by refine DifferentiableOn.analyticOnNhd (fun w hw => ?_) hSo - have hw0 : 0 < w.im := lt_trans (by norm_num) hw + have hw0 : 0 < w.im := lt_trans (by norm_num only) hw have hR : ofComplex w ∈ Region := by change 5 / 4 < (ofComplex w).im rw [im_ofComplex hw0] @@ -933,7 +913,7 @@ theorem E₄_eq_hyp2F1_pow_four {τ : ℍ} (hτ : τ ∈ Region) : refine (isOpen_lt continuous_const Complex.continuous_im).mem_nhds ?_ change A < (((A + 1 : ℝ) : ℂ) * Complex.I).im rw [him] - linarith + linarith only [] exact Filter.eventuallyEq_of_mem hmem fun w hw => hΩeq w hw have heq := hf.eqOn_of_preconnected_of_eventuallyEq hg hSc hz₀S hev have hτS : (↑τ : ℂ) ∈ {w : ℂ | 5 / 4 < w.im} := by diff --git a/LeanPool/Chudnovsky/Liouville.lean b/LeanPool/Chudnovsky/Liouville.lean index 9d882110fa..208d7a8342 100644 --- a/LeanPool/Chudnovsky/Liouville.lean +++ b/LeanPool/Chudnovsky/Liouville.lean @@ -303,7 +303,7 @@ theorem IsEllipticWith.exists_eq_const_of_differentiable (hf : L.IsEllipticWith L.exists_sub_mem_lattice_of_mem_fundamentalParallelogram z have h := hf.2 (s • L.ω₁ + t • L.ω₂) ⟨z - (s • L.ω₁ + t • L.ω₂), hl⟩ rw [show (s • L.ω₁ + t • L.ω₂) + ((⟨z - (s • L.ω₁ + t • L.ω₂), hl⟩ : L.lattice) : ℂ) = z - from by simp] at h + from by simp only [Complex.real_smul, add_sub_cancel]] at h rw [h] exact hM (Set.mem_image_of_mem f ⟨(s, t), ⟨⟨hs.1, hs.2.le⟩, ⟨ht.1, ht.2.le⟩⟩, rfl⟩) @@ -372,7 +372,8 @@ private lemma integral_edge_eq_sub {f F : ℂ → ℂ} {p ω : ℂ} ∫ t in (0 : ℝ)..1, f (p + (t : ℂ) * ω) * ω = F (p + ω) - F p := by have hγ : ∀ t : ℝ, HasDerivAt (fun s : ℝ ↦ p + (s : ℂ) * ω) ω t := by intro t - simpa using ((Complex.ofRealCLM.hasDerivAt (x := t)).mul_const ω).const_add p + simpa only [hasDerivAt_const_add_iff, Complex.ofRealCLM_apply, Complex.ofReal_one, + one_mul] using ((Complex.ofRealCLM.hasDerivAt (x := t)).mul_const ω).const_add p have key : ∀ t ∈ Set.uIcc (0 : ℝ) 1, HasDerivAt (fun s : ℝ ↦ F (p + (s : ℂ) * ω)) (f (p + (t : ℂ) * ω) * ω) t := by intro t ht @@ -633,7 +634,8 @@ private lemma coord_eq_zero_of_eq_zero {L : PeriodPair} {r s : ℝ} have hli := Fintype.linearIndependent_iff.mp L.indep ![r, s] have hsum : ∑ i, (![r, s] i) • (![L.ω₁, L.ω₂] i) = 0 := by rw [Fin.sum_univ_two] - simpa [Complex.real_smul] using h + simpa only [Nat.succ_eq_add_one, Nat.reduceAdd, Fin.isValue, Matrix.cons_val_zero, + Complex.real_smul, Matrix.cons_val_one, Matrix.cons_val_fin_one] using h have hall := hli hsum exact ⟨hall 0, hall 1⟩ @@ -1092,7 +1094,8 @@ private lemma exists_decomposition {f : ℂ → ℂ} {c : ℂ} (hf : Meromorphic by_cases hord : meromorphicOrderAt f c = ⊤ · refine ⟨0, 0, fun _ => 0, fun _ => 0, analyticAt_const, ?_⟩ filter_upwards [meromorphicOrderAt_eq_top_iff.mp hord] with z hz - simp [hz] + simp only [hz, zero_mul, Finset.range_zero, neg_add_rev, Int.reduceNeg, Finset.sum_const_zero, + add_zero] · obtain ⟨g, hg_an, hg_ne, hg_eq⟩ := (meromorphicOrderAt_ne_top_iff hf).1 hord set n : ℤ := (meromorphicOrderAt f c).untop₀ with hn by_cases hn0 : 0 ≤ n @@ -1118,7 +1121,7 @@ private lemma exists_decomposition {f : ℂ → ℂ} {c : ℂ} (hf : Meromorphic obtain ⟨A, h, hh, hEq⟩ := exists_principalPart (N + 1) g c hg_an refine ⟨A 0, N, fun k => A (k + 1), h, hh, ?_⟩ filter_upwards [hg_eq, self_mem_nhdsWithin] with z hz hzne - have hzc : z ≠ c := by simpa using hzne + have hzc : z ≠ c := by simpa only [ne_eq, Set.mem_compl_iff, Set.mem_singleton_iff] using hzne rw [hz, smul_eq_mul, show n = -(((N + 1 : ℕ) : ℤ)) from by linarith [hN₁n], hEq z hzc, Finset.sum_range_succ'] @@ -1130,7 +1133,7 @@ private lemma exists_decomposition {f : ℂ → ℂ} {c : ℂ} (hf : Meromorphic rw [Finset.sum_congr rfl hre] push_cast ring_nf - rw [show (-1 : ℤ) = -(0 + 1) from by ring, ← zpow_neg_one (z - c)] + rw [show (-1 : ℤ) = -(0 + 1) from by ac_rfl, ← zpow_neg_one (z - c)] ring_nf /-- The residue of a decomposition `a·(z-c)⁻¹ + higher principal part + analytic` is `a`. -/ @@ -1211,8 +1214,10 @@ private lemma analyticAt_sub_zpow (c : ℂ) (n : ℤ) {z : ℂ} (hzc : z ≠ c) intro w hw apply DifferentiableAt.differentiableWithinAt have hbase : DifferentiableAt ℂ (fun w : ℂ ↦ w - c) w := differentiableAt_id.sub_const c - exact hbase.zpow (Or.inl (sub_ne_zero.2 (by simpa using hw))) - exact hd.analyticOnNhd isOpen_compl_singleton z (by simpa using hzc) + exact hbase.zpow (Or.inl (sub_ne_zero.2 (by simpa only [ne_eq, Set.mem_compl_iff, + Set.mem_singleton_iff] using hw))) + exact hd.analyticOnNhd isOpen_compl_singleton z (by simpa only [Set.mem_compl_iff, + Set.mem_singleton_iff, ne_eq] using hzc) /-- Away from `c`, the simple pole `(w - c)⁻¹` is analytic. -/ private lemma analyticAt_sub_inv (c : ℂ) {z : ℂ} (hzc : z ≠ c) : @@ -1221,8 +1226,10 @@ private lemma analyticAt_sub_inv (c : ℂ) {z : ℂ} (hzc : z ≠ c) : intro w hw apply DifferentiableAt.differentiableWithinAt have hbase : DifferentiableAt ℂ (fun w : ℂ ↦ w - c) w := differentiableAt_id.sub_const c - exact hbase.inv (sub_ne_zero.2 (by simpa using hw)) - exact hd.analyticOnNhd isOpen_compl_singleton z (by simpa using hzc) + exact hbase.inv (sub_ne_zero.2 (by simpa only [ne_eq, Set.mem_compl_iff, + Set.mem_singleton_iff] using hw)) + exact hd.analyticOnNhd isOpen_compl_singleton z (by simpa only [Set.mem_compl_iff, + Set.mem_singleton_iff, ne_eq] using hzc) /-- The boundary integral of a principal part `a·(z-c)⁻¹ + higher-order terms` reduces to `a` times the boundary integral of the simple pole: the higher-order (order `≤ -2`) terms @@ -1255,7 +1262,7 @@ private lemma boundaryIntegral_principalPart {L : PeriodPair} {v c : ℂ} (a : intro k _ apply continuousOn_const.mul refine (continuousOn_id.sub continuousOn_const).zpow₀ _ (fun z hz => ?_) - exact Or.inl (by simpa using sub_ne_zero.2 (hbne z hz)) + exact Or.inl (by simpa only [Pi.sub_apply, id_eq, ne_eq] using sub_ne_zero.2 (hbne z hz)) rw [boundaryIntegral_finsetSum hterm] apply Finset.sum_eq_zero intro k _ @@ -1762,7 +1769,7 @@ theorem IsEllipticWith.sum_meromorphicOrderAt_eq_zero (hf : L.IsEllipticWith f) Chudnovsky.residue_eq_zero_of_analyticAt hana rw [hres z] at hz0 have huntop : (meromorphicOrderAt f z).untop₀ ≠ 0 := fun h => - hzord (by rw [← WithTop.coe_untop₀_of_ne_top (hforall z), h]; simp) + hzord (by rw [← WithTop.coe_untop₀_of_ne_top (hforall z), h]; simp only [WithTop.coe_zero]) exact huntop (by exact_mod_cast hz0) -- At the extra non-analyticity points the order (and hence the residue) is `0`. have hzero : ∀ z ∈ hg.finite_nonAnalytic.toFinset, @@ -1772,7 +1779,7 @@ theorem IsEllipticWith.sum_meromorphicOrderAt_eq_zero (hf : L.IsEllipticWith f) have hord0 : meromorphicOrderAt f z = 0 := by by_contra hne exact hznotin ⟨hz.1, hne⟩ - rw [hres z, hord0]; simp + rw [hres z, hord0]; simp only [WithTop.untop₀_zero, Int.cast_zero] have key : ∑ z ∈ (hf.finite_order_ne_zero h0).toFinset, Chudnovsky.residue (logDeriv f) z = 0 := by rw [Finset.sum_subset hsub hzero]; exact hsum0 @@ -1798,7 +1805,7 @@ private lemma codiscrete_add_preimage {S : Set ℂ} (l : ℂ) simp only [Set.mem_preimage, Set.mem_image] constructor · intro hz; exact ⟨z + l, hz, by ring⟩ - · rintro ⟨w, hw, rfl⟩; simpa using hw + · rintro ⟨w, hw, rfl⟩; simpa only [neg_add_cancel_right] using hw rw [hEq]; exact key /-- **Workhorse lemma** (used throughout the paper, e.g. in `pstrichprod`, diff --git a/LeanPool/Chudnovsky/MainTheorem.lean b/LeanPool/Chudnovsky/MainTheorem.lean index 895ac8ef45..03cbf10bc5 100644 --- a/LeanPool/Chudnovsky/MainTheorem.lean +++ b/LeanPool/Chudnovsky/MainTheorem.lean @@ -86,7 +86,7 @@ private theorem factorial_ratio_succ (n : ℕ) : _ = 1728 * (((3 * n + 3) * (3 * n + 2) * (3 * n + 1)) * (n + 1) ^ 3) := by ring calc (6 * (n + 1))! * ((3 * n)! * (n !) ^ 3 * 1728 ^ n) = ((6 * n + 6) * (6 * n + 5) * (6 * n + 4) * (6 * n + 3) * (6 * n + 2) * (6 * n + 1)) - * ((6 * n)! * ((3 * n)! * (n !) ^ 3 * 1728 ^ n)) := by rw [e6]; ring + * ((6 * n)! * ((3 * n)! * (n !) ^ 3 * 1728 ^ n)) := by rw [e6]; ac_rfl _ ≤ (1728 * (((3 * n + 3) * (3 * n + 2) * (3 * n + 1)) * (n + 1) ^ 3)) * ((6 * n)! * ((3 * n)! * (n !) ^ 3 * 1728 ^ n)) := Nat.mul_le_mul hPQ le_rfl _ = (6 * n)! * ((3 * (n + 1))! * ((n + 1)!) ^ 3 * 1728 ^ (n + 1)) := by @@ -96,7 +96,7 @@ private theorem factorial_ratio_succ (n : ℕ) : theorem factorial_ratio_le (n : ℕ) : (6 * n)! ≤ 1728 ^ n * ((3 * n)! * (n !) ^ 3) := by induction n with - | zero => simp + | zero => simp only [mul_zero, factorial_zero, pow_zero, one_pow, mul_one, Std.le_refl] | succ n ih => apply (mul_le_mul_iff_of_pos_right (by positivity : 0 < (3 * n)! * (n !) ^ 3 * 1728 ^ n)).mp @@ -106,7 +106,7 @@ theorem factorial_ratio_le (n : ℕ) : _ ≤ (1728 ^ n * ((3 * n)! * (n !) ^ 3)) * ((3 * (n + 1))! * ((n + 1)!) ^ 3 * 1728 ^ (n + 1)) := Nat.mul_le_mul_right _ ih _ = (1728 ^ (n + 1) * ((3 * (n + 1))! * ((n + 1)!) ^ 3)) - * ((3 * n)! * (n !) ^ 3 * 1728 ^ n) := by ring + * ((3 * n)! * (n !) ^ 3 * 1728 ^ n) := by ac_rfl /-- The Main Theorem's series converges absolutely on the region `Im τ > 1.25` (ratio test: `(6n)!/((3n)!(n!)³) ≤ 1728ⁿ` and `‖1728·J‖ > 1728` on the region). -/ @@ -117,9 +117,9 @@ theorem summable_mainSummand {τ : ℍ} (hτ : τ ∈ Region) : have hqb : ‖q τ‖ < 0.000389 := lt_trans (norm_q_lt_of_mem_Region hτ) exp_neg_bound have hM : (1728 : ℝ) < M := by have h1 : (1728 : ℝ) < 0.737 / ‖q τ‖ := by - rw [lt_div_iff₀ hqpos]; nlinarith [hqb, hqpos] + rw [lt_div_iff₀ hqpos]; linarith [hqb, hqpos] exact lt_trans h1 (theonaeherJ_lower hτ) - have hMpos : 0 < M := lt_trans (by norm_num) hM + have hMpos : 0 < M := lt_trans (by norm_num1) hM set r : ℝ := 1728 / M with hrdef have hr0 : 0 ≤ r := by rw [hrdef]; positivity have hr1 : r < 1 := by rw [hrdef, div_lt_one hMpos]; exact hM @@ -130,7 +130,7 @@ theorem summable_mainSummand {τ : ℍ} (hτ : τ ∈ Region) : have hgeom1 : Summable (fun n : ℕ => (n : ℝ) * r ^ n) := by have h := summable_pow_mul_geometric_of_norm_lt_one 1 (r := r) (by rw [Real.norm_eq_abs, abs_of_nonneg hr0]; exact hr1) - simpa using h + simpa only [pow_one] using h have hg : Summable (fun n : ℕ => (C + n) * r ^ n) := by have he : (fun n : ℕ => (C + (n : ℝ)) * r ^ n) = fun n : ℕ => C * r ^ n + (n : ℝ) * r ^ n := by ext n; ring @@ -143,7 +143,7 @@ theorem summable_mainSummand {τ : ℍ} (hτ : τ ∈ Region) : Complex.norm_natCast, div_le_iff₀ hden_pos] calc ((6 * n)! : ℝ) ≤ ((1728 ^ n * ((3 * n)! * (n !) ^ 3) : ℕ) : ℝ) := by exact_mod_cast factorial_ratio_le n - _ = 1728 ^ n * (((3 * n)! : ℝ) * ((n ! : ℝ)) ^ 3) := by push_cast; ring + _ = 1728 ^ n * (((3 * n)! : ℝ) * ((n ! : ℝ)) ^ 3) := by push_cast; ac_rfl have hA : ‖(1 - s₂ τ) / 6 + (n : ℂ)‖ ≤ C + n := by calc ‖(1 - s₂ τ) / 6 + (n : ℂ)‖ ≤ ‖(1 - s₂ τ) / 6‖ + ‖(n : ℂ)‖ := norm_add_le _ _ _ = C + n := by rw [Complex.norm_natCast, hCdef] @@ -175,7 +175,7 @@ theorem sq_eq_on_preconnected_eq {X : Type*} [TopologicalSpace X] {s : Set X} have h : IsClosed {x : s | (fun x : s => f x + g x) x = 0} := isClosed_eq (hfc.add hgc) continuous_const convert h using 2 with x - simp [eq_neg_iff_add_eq_zero] + simp only [eq_neg_iff_add_eq_zero] -- `A ∪ B = univ` since `(f - g)(f + g) = f² - g² = 0`. have hcover : A ∪ B = Set.univ := by ext x @@ -205,7 +205,7 @@ theorem sq_eq_on_preconnected_eq {X : Type*} [TopologicalSpace X] {s : Set X} hAclopen.eq_univ ⟨⟨x₀, hx₀⟩, h₀⟩ intro x hx have : (⟨x, hx⟩ : s) ∈ A := hAuniv ▸ Set.mem_univ _ - simpa [hA] using this + simpa only [hA, Set.mem_ofPred_eq] using this /-- The region `Im τ > 1.25` is preconnected. -/ theorem isPreconnected_Region : IsPreconnected (Region : Set ℍ) := by @@ -217,7 +217,7 @@ theorem isPreconnected_Region : IsPreconnected (Region : Set ℍ) := by · rintro ⟨τ, hτ, rfl⟩ rw [UpperHalfPlane.coe_im]; exact hτ · intro hz - exact ⟨⟨z, lt_trans (by norm_num) hz⟩, hz, rfl⟩ + exact ⟨⟨z, lt_trans (by norm_num1) hz⟩, hz, rfl⟩ rw [himg] exact (convex_halfSpace_im_gt (5 / 4)).isPreconnected @@ -248,7 +248,7 @@ private lemma Gsq_eq_tsum {z : ℂ} (hz : ‖z‖ < 1) : refine tsum_congr fun n => ?_ have h3n : ((3 * n)! : ℂ) ≠ 0 := Nat.cast_ne_zero.2 (Nat.factorial_ne_zero _) have hn : ((n ! : ℕ) : ℂ) ≠ 0 := Nat.cast_ne_zero.2 (Nat.factorial_ne_zero n) - have h12 : ((12 : ℂ)) ^ (3 * n) = 1728 ^ n := by rw [pow_mul]; norm_num + have h12 : ((12 : ℂ)) ^ (3 * n) = 1728 ^ n := by rw [pow_mul]; norm_num only rw [mainCoeff, h12] field_simp @@ -264,10 +264,10 @@ private lemma hasDerivAt_tsum_mainCoeff {z : ℂ} (hz : ‖z‖ < 1) : have h : Summable fun n : ℕ => (n : ℝ) * ρ ^ n := by have := summable_pow_mul_geometric_of_norm_lt_one (R := ℝ) 1 (r := ρ) (by rw [Real.norm_eq_abs, abs_of_nonneg hρpos.le]; exact hρ1) - simpa using this + simpa only [pow_one] using this refine (h.mul_left ρ⁻¹).congr fun n => ?_ rcases n with _ | k - · simp + · simp only [CharP.cast_eq_zero, pow_zero, mul_one, mul_zero, zero_tsub] · rw [Nat.succ_sub_one, pow_succ] push_cast field_simp @@ -310,7 +310,7 @@ private lemma mainSummand_eq {τ : ℍ} (hJ0 : J τ ≠ 0) (n : ℕ) : mainSummand τ n = ((1 - s₂ τ) / 6 + n) * (mainCoeff n * (1 / J τ) ^ n) := by have h3n : ((3 * n)! : ℂ) ≠ 0 := Nat.cast_ne_zero.2 (Nat.factorial_ne_zero _) have hn : ((n ! : ℕ) : ℂ) ≠ 0 := Nat.cast_ne_zero.2 (Nat.factorial_ne_zero n) - have h1728 : (1728 : ℂ) ≠ 0 := by norm_num + have h1728 : (1728 : ℂ) ≠ 0 := by norm_num1 have hJn : J τ ^ n ≠ 0 := pow_ne_zero n hJ0 rw [mainSummand, mainCoeff, mul_pow, one_div, inv_pow] field_simp @@ -346,7 +346,7 @@ private lemma norm_mainCoeff_antitone : Antitone fun n => ‖mainCoeff n‖ := `0.15` of `1`. Six explicit terms of the (positive, decreasing) coefficient sequence `mainCoeff` plus a geometric tail. -/ private lemma norm_Gsq_sub_one_le {z : ℂ} (hz : ‖z‖ ≤ 0.9125) : ‖Gsq z - 1‖ ≤ 0.15 := by - have hz1 : ‖z‖ < 1 := lt_of_le_of_lt hz (by norm_num) + have hz1 : ‖z‖ < 1 := lt_of_le_of_lt hz (by norm_num1) have hz0 : (0 : ℝ) ≤ ‖z‖ := norm_nonneg z -- summability of the series and of its norms have hSnorm : Summable fun n : ℕ => ‖mainCoeff n * z ^ n‖ := by @@ -405,15 +405,15 @@ private lemma norm_Gsq_sub_one_le {z : ℂ} (hz : ‖z‖ ≤ 0.9125) : ‖Gsq z hterm _ _ hc _ = (0.00467 * 0.9125 ^ 7) * 0.9125 ^ i := by ring have hgeom : Summable fun i : ℕ => (0.00467 * 0.9125 ^ 7 : ℝ) * 0.9125 ^ i := - (summable_geometric_of_lt_one (by norm_num) (by norm_num)).mul_left _ + (summable_geometric_of_lt_one (by norm_num1) (by norm_num1)).mul_left _ calc ∑' i : ℕ, ‖mainCoeff (i + 6 + 1) * z ^ (i + 6 + 1)‖ ≤ ∑' i : ℕ, (0.00467 * 0.9125 ^ 7 : ℝ) * 0.9125 ^ i := ((summable_nat_add_iff (f := fun n : ℕ => ‖mainCoeff (n + 1) * z ^ (n + 1)‖) 6).mpr hSnorm1).tsum_le_tsum hmaj hgeom _ = (0.00467 * 0.9125 ^ 7) * (1 - 0.9125)⁻¹ := by - rw [tsum_mul_left, tsum_geometric_of_lt_one (by norm_num) (by norm_num)] + rw [tsum_mul_left, tsum_geometric_of_lt_one (by norm_num1) (by norm_num1)] refine le_trans (add_le_add hhead htail) ?_ - norm_num + norm_num1 /-- On `Region`, `E₆` is within `0.199` of `1` (from the truncation bounds of `Estimates.lean`). -/ @@ -423,7 +423,7 @@ private lemma norm_E₆_sub_one_le {τ : ℍ} (hτ : τ ∈ Region) : ‖E₆ τ have hQ : Q < 0.000389 := lt_trans (norm_q_lt_of_mem_Region hτ) exp_neg_bound have htail : ‖eisensteinTail 5 3 τ‖ ≤ 245.6 * Q ^ 3 := norm_eisensteinTail_sigma₅ hτ have hqq : ‖q τ + (33 : ℂ) * q τ ^ 2‖ ≤ Q + 33 * Q ^ 2 := - norm_q_add_smul_sq_le (by norm_num) + norm_q_add_smul_sq_le (by norm_num1) have heq : E₆ τ - 1 = -(504 * (q τ + 33 * q τ ^ 2)) - 504 * eisensteinTail 5 3 τ := by rw [E₆_eq_trunc τ, E₆trunc]; ring rw [heq] @@ -439,7 +439,7 @@ private lemma re_div_pos_of_norm_sub_lt {a b : ℂ} (hb : ‖a - b‖ < ‖b‖) have h2 : ‖a / b - 1‖ < 1 := by rw [h1, norm_div, div_lt_one hbn]; exact hb have h3 : |(a / b - 1).re| ≤ ‖a / b - 1‖ := Complex.abs_re_le_norm _ - have h4 : (a / b - 1).re = (a / b).re - 1 := by simp + have h4 : (a / b - 1).re = (a / b).re - 1 := by simp only [sub_re, one_re] have h5 := (abs_le.mp h3).1 linarith @@ -485,8 +485,8 @@ private lemma hasDerivAt_J_comp (τ : ℍ) : (-(2 * π * Complex.I) * E₄ τ ^ 2 * E₆ τ / (E₄ τ ^ 3 - E₆ τ ^ 2)) ↑τ := by have h4 := hasDerivAt_E₄_comp τ have h6 := hasDerivAt_E₆_comp τ - have hcomp4 : ((⇑E₄) ∘ ofComplex) ↑τ = E₄ τ := by simp [Function.comp_apply, ofComplex_apply] - have hcomp6 : ((⇑E₆) ∘ ofComplex) ↑τ = E₆ τ := by simp [Function.comp_apply, ofComplex_apply] + have hcomp4 : ((⇑E₄) ∘ ofComplex) ↑τ = E₄ τ := by simp only [Function.comp_apply, ofComplex_apply] + have hcomp6 : ((⇑E₆) ∘ ofComplex) ↑τ = E₆ τ := by simp only [Function.comp_apply, ofComplex_apply] have hden : ((⇑E₄ ∘ ofComplex) ↑τ) ^ 3 - ((⇑E₆ ∘ ofComplex) ↑τ) ^ 2 ≠ 0 := by rw [hcomp4, hcomp6]; exact E₄_cube_sub_E₆_sq_ne_zero τ have hquot := (h4.pow 3).div ((h4.pow 3).sub (h6.pow 2)) hden @@ -509,7 +509,7 @@ private lemma E2_mul_eq_of_mem_Region {τ : ℍ} (hτ : τ ∈ Region) : -- non-vanishing facts have hJnorm : 1 < ‖J τ‖ := one_lt_norm_J hτ have hJ0 : J τ ≠ 0 := by - intro h; rw [h, norm_zero] at hJnorm; norm_num at hJnorm + intro h; rw [h, norm_zero] at hJnorm; norm_num1 at hJnorm have hden : E₄ τ ^ 3 - E₆ τ ^ 2 ≠ 0 := E₄_cube_sub_E₆_sq_ne_zero τ have hE₄0 : E₄ τ ≠ 0 := by intro h @@ -545,7 +545,7 @@ private lemma E2_mul_eq_of_mem_Region {τ : ℍ} (hτ : τ ∈ Region) : have hev : (⇑E₄ ∘ ofComplex) =ᶠ[nhds (↑τ : ℂ)] fun z => hyp2F1 (((J ∘ ofComplex) z)⁻¹) ^ 4 := by filter_upwards [hopen.mem_nhds hmem] with z hz - have hz0 : 0 < z.im := lt_trans (by norm_num) hz + have hz0 : 0 < z.im := lt_trans (by norm_num1) hz have hzR : ofComplex z ∈ Region := by rw [ofComplex_apply_of_im_pos hz0] exact hz @@ -585,13 +585,13 @@ theorem thm42 {τ : ℍ} (hτ : τ ∈ Region) : -- basic non-vanishing facts have hJnorm : (1.096 : ℝ) < ‖J τ‖ := theonaeherJ_norm_J hτ have hJ0 : J τ ≠ 0 := by - intro h; rw [h, norm_zero] at hJnorm; norm_num at hJnorm + intro h; rw [h, norm_zero] at hJnorm; norm_num only at hJnorm have hden : E₄ τ ^ 3 - E₆ τ ^ 2 ≠ 0 := E₄_cube_sub_E₆_sq_ne_zero τ have hE₄0 : E₄ τ ≠ 0 := by intro h apply hJ0 rw [J, h] - simp + simp only [ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, zero_pow, zero_sub, zero_div] have hE₆0 : E₆ τ ≠ 0 := E₆_ne_zero_of_mem_Region hτ have hπ0 : (π : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr Real.pi_ne_zero have him0 : ((τ.im : ℝ) : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (ne_of_gt τ.im_pos) @@ -613,17 +613,13 @@ theorem thm42 {τ : ℍ} (hτ : τ ∈ Region) : rw [hone] have hG : HasDerivAt hyp2F1 (deriv hyp2F1 (J τ)⁻¹) (J τ)⁻¹ := (hyp2F1_analyticAt hu).differentiableAt.hasDerivAt - have h2 : deriv (fun w => hyp2F1 w ^ 2) (J τ)⁻¹ = - (2 : ℕ) * hyp2F1 (J τ)⁻¹ ^ (2 - 1) * deriv hyp2F1 (J τ)⁻¹ := (hG.pow 2).deriv - rw [h2] - norm_num + simpa only [Nat.cast_ofNat, Nat.reduceSub, pow_one] using (hG.fun_pow 2).deriv -- `J/(J−1)` is the square of `G⁶/E₆` have hsq : J τ / (J τ - 1) = (hyp2F1 (J τ)⁻¹ ^ 6 / E₆ τ) ^ 2 := by have hJ1 : J τ - 1 ≠ 0 := by intro h - have h2 : (J τ - 1) * (E₄ τ ^ 3 - E₆ τ ^ 2) = E₆ τ ^ 2 := by linear_combination hJmul - rw [h, zero_mul] at h2 - exact hE₆0 (pow_eq_zero_iff (n := 2) (by norm_num) |>.mp h2.symm) + rw [sub_eq_zero.mp h, norm_one] at hJnorm + norm_num1 at hJnorm have hJmul' := hJmul rw [hE₄] at hJmul' rw [div_pow, div_eq_div_iff hJ1 (pow_ne_zero 2 hE₆0)] @@ -631,8 +627,8 @@ theorem thm42 {τ : ℍ} (hτ : τ ∈ Region) : -- positivity of `Re(G⁶/E₆)`: quantitative bounds have hznorm : ‖(J τ)⁻¹‖ ≤ 0.9125 := by rw [norm_inv] - have h2 : (1.096 : ℝ)⁻¹ ≤ 0.9125 := by norm_num - exact le_trans (inv_anti₀ (by norm_num) hJnorm.le) h2 + have h2 : (1.096 : ℝ)⁻¹ ≤ 0.9125 := by norm_num only + exact le_trans (inv_anti₀ (by norm_num only) hJnorm.le) h2 have hb2 : ‖hyp2F1 (J τ)⁻¹ ^ 2 - 1‖ ≤ 0.15 := norm_Gsq_sub_one_le hznorm have hb6 : ‖hyp2F1 (J τ)⁻¹ ^ 6 - 1‖ ≤ 0.520875 := by have hexp : hyp2F1 (J τ)⁻¹ ^ 6 - 1 = @@ -652,25 +648,21 @@ theorem thm42 {τ : ℍ} (hτ : τ ∈ Region) : calc ‖(hyp2F1 (J τ)⁻¹ ^ 6 - 1) - (E₆ τ - 1)‖ ≤ ‖hyp2F1 (J τ)⁻¹ ^ 6 - 1‖ + ‖E₆ τ - 1‖ := norm_sub_le _ _ _ ≤ 0.520875 + 0.199 := add_le_add hb6 hE₆b - _ < 0.8 := by norm_num + _ < 0.8 := by norm_num only _ < ‖E₆ τ‖ := hE₆big have hre : 0 < (hyp2F1 (J τ)⁻¹ ^ 6 / E₆ τ).re := re_div_pos_of_norm_sub_lt hsub -- resolve the branch of the square root have hbranch : (J τ / (J τ - 1)) ^ (1 / 2 : ℂ) = hyp2F1 (J τ)⁻¹ ^ 6 / E₆ τ := by - rw [hsq, show (1 / 2 : ℂ) = ((2 : ℂ)⁻¹ : ℂ) by norm_num] + rw [hsq, show (1 / 2 : ℂ) = ((2 : ℂ)⁻¹ : ℂ) by norm_num only] exact Complex.sq_cpow_two_inv hre - -- solve the E₂ identity for `E2 τ` and substitute everything - have hE2' : E2 τ = (E₆ τ * (E₄ τ * J τ) + - 12 * hyp2F1 (J τ)⁻¹ ^ 3 * deriv hyp2F1 (J τ)⁻¹ * E₆ τ) / (E₄ τ ^ 2 * J τ) := by - rw [eq_div_iff (mul_ne_zero (pow_ne_zero 2 hE₄0) hJ0)] - exact hE2 rw [hbranch, hderivsq, hone] simp only [s₂, E₂star] - rw [hE2', hE₄] - set g : ℂ := hyp2F1 (J τ)⁻¹ with hgdef - set g' : ℂ := deriv hyp2F1 (J τ)⁻¹ with hg'def - field_simp - ring + rw [hE₄] at hE2 ⊢ + -- Multiply by the square so the differential identity applies directly. + apply mul_left_cancel₀ (pow_ne_zero 2 hG0) + field_simp (disch := first | assumption | norm_num1 | positivity) + simp only [one_div] + linear_combination (2 * (π : ℂ) * (τ.im : ℂ)) * hE2 /-- **The Main Theorem** (Milla, Thm. `hauptformel`; Chudnovsky–Chudnovsky 1988, Eq. (1.4)): for all `τ` with `Im τ > 1.25`, @@ -683,7 +675,7 @@ theorem hauptformel {τ : ℍ} (hτ : τ ∈ Region) : have hJ0 : J τ ≠ 0 := by intro h rw [h, norm_zero] at hJ - exact absurd hJ (by norm_num) + exact absurd hJ (by norm_num1) have hw : ‖1 / J τ‖ < 1 := by rw [norm_div, norm_one, div_lt_one (lt_trans one_pos hJ)] exact hJ @@ -701,12 +693,12 @@ theorem hauptformel {τ : ℍ} (hτ : τ ∈ Region) : refine Summable.of_norm_bounded (g := fun n : ℕ => (n : ℝ) * ‖w‖ ^ n) ?_ fun n => ?_ · have := summable_pow_mul_geometric_of_norm_lt_one (R := ℝ) 1 (r := ‖w‖) (by rw [Real.norm_eq_abs, abs_of_nonneg (norm_nonneg w)]; exact hw) - simpa using this + simpa only [pow_one] using this · rw [norm_mul, norm_mul, norm_pow, Complex.norm_natCast] calc (n : ℝ) * (‖mainCoeff n‖ * ‖w‖ ^ n) ≤ (n : ℝ) * (1 * ‖w‖ ^ n) := by gcongr exact norm_mainCoeff_le_one n - _ = (n : ℝ) * ‖w‖ ^ n := by ring + _ = (n : ℝ) * ‖w‖ ^ n := by ac_rfl rw [thm42 hτ, Gsq_eq_tsum hw, deriv_Gsq_eq hw, ← hwdef] -- Push the constants into the sums. rw [← tsum_mul_left, ← tsum_mul_left] @@ -714,10 +706,10 @@ theorem hauptformel {τ : ℍ} (hτ : τ ∈ Region) : = fun n : ℕ => (n : ℂ) * (mainCoeff n * w ^ n) := by ext n rcases n with _ | k - · simp + · simp only [CharP.cast_eq_zero, zero_tsub, pow_zero, mul_one, mul_zero, zero_mul] · rw [Nat.succ_sub_one, pow_succ] push_cast - ring + ac_rfl rw [hstep] rw [← (hS0.mul_left ((1 - s₂ τ) / 6)).tsum_add hS1] refine tsum_congr fun n => ?_ diff --git a/LeanPool/Chudnovsky/NumericalBounds.lean b/LeanPool/Chudnovsky/NumericalBounds.lean new file mode 100644 index 0000000000..f48ac69a27 --- /dev/null +++ b/LeanPool/Chudnovsky/NumericalBounds.lean @@ -0,0 +1,168 @@ +/- +Copyright (c) 2026 Xuanji Li and Lean Pool contributors. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Xuanji Li, Lean Pool contributors +-/ +module + +public import Mathlib.Basic.Real.Basic +import Mathlib.Algebra.Order.Ring.Pow +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +/-! +# Real interval certificates for the Chudnovsky coefficients + +Prove the numeric enclosures independently of the modular-form and lattice developments. +Rounded coefficient and factor intervals keep the arithmetic certificates small. +-/ + +public section + +namespace Chudnovsky.NumericalBounds + +/-- Enclose the real approximation to the singular j-value within half a unit. -/ +theorem jwert_real_bound {e : ℝ} + (hL : (3.80898093700765233822623151647e-18 : ℝ) < e) + (hU : e < (3.80898093700765233822623151648e-18 : ℝ)) : + |(1 - 240 * e + 2160 * e ^ 2) ^ 3 / (e * (1 + e - e ^ 2) ^ 24) - 640320 ^ 3| < 1 / 2 := by + -- The final tolerance is one half, so coarse rational enclosures suffice. + have hL : (3.808980937007652338e-18 : ℝ) < e := lt_trans (by norm_num1) hL + have hU : e < (3.808980937007652339e-18 : ℝ) := lt_trans hU (by norm_num1) + have hepos : 0 < e := lt_trans (by norm_num1) hL + have he2U : e ^ 2 ≤ (3.808980937007652339e-18 : ℝ) ^ 2 := + pow_le_pow_left₀ hepos.le hU.le 2 + have he2nn : 0 ≤ e ^ 2 := sq_nonneg e + -- enclosures for `g = 1 - 240e + 2160e²` + have hGLg : (1 - 240 * 3.808980937007652339e-18 : ℝ) + ≤ 1 - 240 * e + 2160 * e ^ 2 := by linarith only [hU, he2nn] + have hgGH : 1 - 240 * e + 2160 * e ^ 2 ≤ + (1 - 240 * 3.808980937007652338e-18 + + 2160 * (3.808980937007652339e-18) ^ 2 : ℝ) := by linarith only [hL, he2U] + have hGLpos : (0 : ℝ) < 1 - 240 * 3.808980937007652339e-18 := by norm_num1 + have hgpos : 0 < 1 - 240 * e + 2160 * e ^ 2 := lt_of_lt_of_le hGLpos hGLg + -- enclosures for `h = 1 + e - e²` + have hHLh : (1 + 3.808980937007652338e-18 + - (3.808980937007652339e-18) ^ 2 : ℝ) ≤ 1 + e - e ^ 2 := by + linarith only [hL, he2U] + have hhHH : 1 + e - e ^ 2 ≤ (1 + 3.808980937007652339e-18 : ℝ) := by + linarith only [hU, he2nn] + have hHLpos : (0 : ℝ) < 1 + 3.808980937007652338e-18 + - (3.808980937007652339e-18) ^ 2 := by norm_num1 + have hhpos : 0 < 1 + e - e ^ 2 := lt_of_lt_of_le hHLpos hHLh + -- cube / 24-th power the enclosures + have hN_hi : (1 - 240 * e + 2160 * e ^ 2) ^ 3 ≤ + (1 - 240 * 3.808980937007652338e-18 + + 2160 * (3.808980937007652339e-18) ^ 2) ^ 3 := + pow_le_pow_left₀ hgpos.le hgGH 3 + have hN_lo : (1 - 240 * 3.808980937007652339e-18) ^ 3 + ≤ (1 - 240 * e + 2160 * e ^ 2) ^ 3 := pow_le_pow_left₀ hGLpos.le hGLg 3 + have hW_hi : (1 + e - e ^ 2) ^ 24 ≤ (1 + 3.808980937007652339e-18) ^ 24 := + pow_le_pow_left₀ hhpos.le hhHH 24 + have hW_lo : (1 + 3.808980937007652338e-18 + - (3.808980937007652339e-18) ^ 2) ^ 24 ≤ (1 + e - e ^ 2) ^ 24 := + pow_le_pow_left₀ hHLpos.le hHLh 24 + -- the two division enclosures of `S` + have hden_pos : 0 < e * (1 + e - e ^ 2) ^ 24 := mul_pos hepos (pow_pos hhpos 24) + have hSupper : (1 - 240 * e + 2160 * e ^ 2) ^ 3 / (e * (1 + e - e ^ 2) ^ 24) ≤ + (1 - 240 * 3.808980937007652338e-18 + + 2160 * (3.808980937007652339e-18) ^ 2) ^ 3 / + (3.808980937007652338e-18 * + (1 + 3.808980937007652338e-18 + - (3.808980937007652339e-18) ^ 2) ^ 24) := by + apply div_le_div₀ (by positivity) hN_hi + (mul_pos (by norm_num1) (pow_pos hHLpos 24)) + exact mul_le_mul hL.le hW_lo (pow_nonneg hHLpos.le 24) hepos.le + have hSlower : (1 - 240 * 3.808980937007652339e-18) ^ 3 / + (3.808980937007652339e-18 * + (1 + 3.808980937007652339e-18) ^ 24) ≤ + (1 - 240 * e + 2160 * e ^ 2) ^ 3 / (e * (1 + e - e ^ 2) ^ 24) := by + apply div_le_div₀ (by positivity) hN_lo hden_pos + exact mul_le_mul hU.le hW_hi (pow_nonneg hhpos.le 24) (by norm_num1) + -- the two heavy rational inequalities + have hUpNum : (1 - 240 * 3.808980937007652338e-18 + + 2160 * (3.808980937007652339e-18) ^ 2) ^ 3 / + (3.808980937007652338e-18 * + (1 + 3.808980937007652338e-18 + - (3.808980937007652339e-18) ^ 2) ^ 24) < (640320 : ℝ) ^ 3 + 1 / 2 := by + norm_num1 + have hLoNum : (640320 : ℝ) ^ 3 - 1 / 2 < + (1 - 240 * 3.808980937007652339e-18) ^ 3 / + (3.808980937007652339e-18 * + (1 + 3.808980937007652339e-18) ^ 24) := by + norm_num1 + rw [abs_lt] + exact ⟨by linarith only [hLoNum.trans_le hSlower], + by linarith only [hSupper.trans_lt hUpNum]⟩ + +/-- Enclose the scaled real approximation to `s₂` within half a unit. -/ +theorem s2tilde_real_bound {e pv sv : ℝ} + (heL : (3.80898093700765233822623151647e-18 : ℝ) < e) + (heU : e < (3.80898093700765233822623151648e-18 : ℝ)) + (hpL : (3.14159265358979323846 : ℝ) < pv) (hpU : pv < (3.14159265358979323847 : ℝ)) + (hsL : (12.7671453348037046617 : ℝ) < sv) (hsU : sv < (12.7671453348037046618 : ℝ)) : + |(1 - 240 * e + 2160 * e ^ 2) / (1 + 504 * e - 16632 * e ^ 2) + * (1 + 24 * e - 72 * e ^ 2 - 3 / (pv * (sv / 2))) * 10996566783048 + - 9351571368960| < 1 / 2 := by + have heL : (3e-18 : ℝ) < e := lt_trans (by norm_num1) heL + have heU : e < (4e-18 : ℝ) := lt_trans heU (by norm_num1) + have hpL : (3.14159265358979 : ℝ) < pv := lt_trans (by norm_num1) hpL + have hpU : pv < (3.14159265358980 : ℝ) := lt_trans hpU (by norm_num1) + have hsL : (12.7671453348037 : ℝ) < sv := lt_trans (by norm_num1) hsL + have hsU : sv < (12.7671453348038 : ℝ) := lt_trans hsU (by norm_num1) + have hepos : 0 < e := lt_trans (by norm_num1) heL + have hp_pos : 0 < pv := lt_trans (by norm_num1) hpL + have hs_pos : 0 < sv := lt_trans (by norm_num1) hsL + have he2U : e ^ 2 ≤ (4e-18 : ℝ) ^ 2 := pow_le_pow_left₀ hepos.le heU.le 2 + have he2nn : 0 ≤ e ^ 2 := sq_nonneg e + have hdenpos : 0 < 1 + 504 * e - 16632 * e ^ 2 := by linarith only [heL, he2U] + let R := (1 - 240 * e + 2160 * e ^ 2) / (1 + 504 * e - 16632 * e ^ 2) + let Z := 1 + 24 * e - 72 * e ^ 2 - 3 / (pv * (sv / 2)) + change |R * Z * 10996566783048 - 9351571368960| < 1 / 2 + -- Round the first factor near one before combining the interval estimates. + have hRL : (1 - 1e-14 : ℝ) ≤ R := by + apply (le_div_iff₀ hdenpos).mpr + linarith only [heU, he2nn] + have hRH : R ≤ (1 : ℝ) := by + apply (div_le_iff₀ hdenpos).mpr + linarith only [heL, he2U] + have hdivision : 3 / (pv * (sv / 2)) = 6 / (pv * sv) := by ring + have hwH : 6 / (pv * sv) ≤ (6 / (3.14159265358979 * 12.7671453348037) : ℝ) := + div_le_div_of_nonneg_left (by norm_num1) (by norm_num1) + (mul_le_mul hpL.le hsL.le (by norm_num1) hp_pos.le) + have hwL : (6 / (3.14159265358980 * 12.7671453348038) : ℝ) ≤ 6 / (pv * sv) := + div_le_div_of_nonneg_left (by norm_num1) (mul_pos hp_pos hs_pos) + (mul_le_mul hpU.le hsU.le hs_pos.le (by norm_num1)) + -- Enclose the second factor directly around the final rational value. + have hZL : (9351571368960 / 10996566783048 - 1e-14 : ℝ) ≤ Z := by + have hnumeric : (9351571368960 / 10996566783048 - 1e-14 : ℝ) + ≤ 1 + 24 * 3e-18 - 72 * (4e-18) ^ 2 + - 6 / (3.14159265358979 * 12.7671453348037) := by norm_num1 + dsimp [Z] + rw [hdivision] + linarith only [hnumeric, heL, he2U, hwH] + have hZH : Z ≤ (9351571368960 / 10996566783048 + 1e-14 : ℝ) := by + have hnumeric : (1 + 24 * 4e-18 + - 6 / (3.14159265358980 * 12.7671453348038) : ℝ) + ≤ 9351571368960 / 10996566783048 + 1e-14 := by norm_num1 + dsimp [Z] + rw [hdivision] + linarith only [hnumeric, heU, he2nn, hwL] + have hRnonneg : 0 ≤ R := le_trans (by norm_num1) hRL + have hZnonneg : 0 ≤ Z := le_trans (by norm_num1) hZL + have hlo := mul_le_mul_of_nonneg_right + (mul_le_mul hRL hZL (by norm_num1) hRnonneg) + (by norm_num1 : (0 : ℝ) ≤ 10996566783048) + have hhi := mul_le_mul_of_nonneg_right + (mul_le_mul hRH hZH hZnonneg (by norm_num1)) + (by norm_num1 : (0 : ℝ) ≤ 10996566783048) + have hlow : (9351571368960 : ℝ) - 1 / 2 + < (1 - 1e-14) * (9351571368960 / 10996566783048 - 1e-14) * 10996566783048 := by + norm_num1 + have hhigh : (1 : ℝ) * (9351571368960 / 10996566783048 + 1e-14) * 10996566783048 + < 9351571368960 + 1 / 2 := by norm_num1 + rw [abs_lt] + exact ⟨by linarith only [hlo, hlow], by linarith only [hhi, hhigh]⟩ + + +end Chudnovsky.NumericalBounds diff --git a/LeanPool/Chudnovsky/Numerics.lean b/LeanPool/Chudnovsky/Numerics.lean index 3a585ea5b9..0a7d4b3e15 100644 --- a/LeanPool/Chudnovsky/Numerics.lean +++ b/LeanPool/Chudnovsky/Numerics.lean @@ -64,12 +64,12 @@ the endpoint rationals below satisfy `lo² < 163 < hi²` (verified exactly). -/ /-- Lower bound for `√163` (21 significant digits). To be proved from `lo² < 163` via `Real.lt_sqrt` / `nlinarith` (PLAN D1). -/ theorem sqrt_163_gt : 12.7671453348037046617 < Real.sqrt 163 := by - rw [Real.lt_sqrt (by norm_num)]; norm_num + rw [Real.lt_sqrt (by norm_num1)]; norm_num1 /-- Upper bound for `√163` (21 significant digits). To be proved from `163 < hi²` via `Real.sqrt_lt'` / `nlinarith` (PLAN D1). -/ theorem sqrt_163_lt : Real.sqrt 163 < 12.7671453348037046618 := by - rw [Real.sqrt_lt' (by norm_num)]; norm_num + rw [Real.sqrt_lt' (by norm_num1)]; norm_num1 /-! ### High-precision internal bounds (Phase D1 certificates) @@ -185,12 +185,12 @@ private theorem pi_lt_d38 : private theorem sqrt_163_gt_d38 : (638357266740185233085547600489044617369/50000000000000000000000000000000000000 : ℝ) < Real.sqrt 163 := by - rw [Real.lt_sqrt (by norm_num)]; norm_num + rw [Real.lt_sqrt (by norm_num1)]; norm_num1 /-- Internal 38-digit upper bound for `√163`. -/ private theorem sqrt_163_lt_d38 : Real.sqrt 163 < (1276714533480370466171095200978089234739/100000000000000000000000000000000000000 : ℝ) := by - rw [Real.sqrt_lt' (by norm_num)]; norm_num + rw [Real.sqrt_lt' (by norm_num1)]; norm_num1 /-- Rational lower bound for `x := π·√163`: `x_lo < π·√163`. -/ private theorem x_lo_lt : @@ -200,9 +200,9 @@ private theorem x_lo_lt : (314159265358979323846264338327950288419/100000000000000000000000000000000000000 : ℝ) * (638357266740185233085547600489044617369/50000000000000000000000000000000000000 : ℝ) < π * Real.sqrt 163 := - mul_lt_mul'' pi_gt_d38 sqrt_163_gt_d38 (by norm_num) (by norm_num) + mul_lt_mul'' pi_gt_d38 sqrt_163_gt_d38 (by norm_num1) (by norm_num1) refine lt_of_le_of_lt ?_ h - norm_num + norm_num1 /-- Rational upper bound for `x := π·√163`: `π·√163 < x_hi`. -/ private theorem lt_x_hi : π * Real.sqrt 163 < @@ -212,7 +212,7 @@ private theorem lt_x_hi : π * Real.sqrt 163 < * (1276714533480370466171095200978089234739/100000000000000000000000000000000000000 : ℝ) := mul_lt_mul'' pi_lt_d38 sqrt_163_lt_d38 Real.pi_pos.le (Real.sqrt_nonneg 163) refine lt_of_lt_of_le h ?_ - norm_num + norm_num1 /-- Upper bound for `exp(x_hi/128)` from the degree-26 Taylor remainder. -/ private theorem exp_b_le : @@ -222,10 +222,10 @@ private theorem exp_b_le : ℝ) := by have hb := Real.exp_bound' (x := (4010916999113251975535008362290414005397/12800000000000000000000000000000000000000 : ℝ)) - (by norm_num) (by norm_num) (n := 26) - (by norm_num) + (by norm_num1) (by norm_num1) (n := 26) + (by norm_num1) refine hb.trans ?_ - norm_num [Finset.sum_range_succ, Nat.factorial] + norm_num only [Finset.sum_range_succ, Nat.factorial] /-- Lower bound for `exp(x_lo/128)` from the degree-26 Taylor partial sum. -/ private theorem le_exp_a : @@ -233,8 +233,8 @@ private theorem le_exp_a : ℝ) ≤ Real.exp (200545849955662598776750418114520700269/640000000000000000000000000000000000000 : ℝ) := by - refine le_trans ?_ (Real.sum_le_exp_of_nonneg (by norm_num) 26) - norm_num [Finset.sum_range_succ, Nat.factorial] + refine le_trans ?_ (Real.sum_le_exp_of_nonneg (by norm_num1) 26) + norm_num only [Finset.sum_range_succ, Nat.factorial] /-- `exp(π·√163) < (exp(x_hi/128))^128`-bound. -/ private theorem exp_pi_sqrt_163_lt_Ubig : @@ -255,7 +255,7 @@ private theorem exp_pi_sqrt_163_lt_Ubig : rw [show (4010916999113251975535008362290414005397/100000000000000000000000000000000000000 : ℝ) = (128 : ℕ) * (4010916999113251975535008362290414005397/12800000000000000000000000000000000000000 : ℝ) - by push_cast; norm_num, Real.exp_nat_mul] + by push_cast; norm_num1, Real.exp_nat_mul] rw [e] exact pow_le_pow_left₀ (Real.exp_nonneg _) exp_b_le 128 @@ -277,9 +277,9 @@ private theorem Lbig_lt_exp_pi_sqrt_163 : rw [show (200545849955662598776750418114520700269/5000000000000000000000000000000000000 : ℝ) = (128 : ℕ) * (200545849955662598776750418114520700269/640000000000000000000000000000000000000 : ℝ) - by push_cast; norm_num, Real.exp_nat_mul] + by push_cast; norm_num1, Real.exp_nat_mul] rw [e] - exact pow_le_pow_left₀ (by norm_num) le_exp_a 128 + exact pow_le_pow_left₀ (by norm_num1) le_exp_a 128 /-! ### Bounds for `e^{-π√163}` @@ -301,7 +301,7 @@ theorem exp_neg_pi_sqrt_163_gt : ℝ) ^ 128 := by positivity have hEpos : (0 : ℝ) < Real.exp (π * Real.sqrt 163) := Real.exp_pos _ refine lt_of_le_of_lt ?_ ((inv_lt_inv₀ hUpos hEpos).mpr hE) - rw [← one_div, le_div_iff₀ hUpos]; norm_num + rw [← one_div, le_div_iff₀ hUpos]; norm_num1 /-- Upper bound for `e^{-π√163}` (30 significant digits), i.e. `e^{-π√163} < 380898093700765233822623151648 / 10^47`. @@ -317,7 +317,7 @@ theorem exp_neg_pi_sqrt_163_lt : ℝ) ^ 128 := by positivity have hEpos : (0 : ℝ) < Real.exp (π * Real.sqrt 163) := Real.exp_pos _ refine lt_of_lt_of_le ((inv_lt_inv₀ hEpos hLpos).mpr hE) ?_ - rw [← one_div, div_le_iff₀ hLpos]; norm_num + rw [← one_div, div_le_iff₀ hLpos]; norm_num1 /-! ### The nome at `τ₁₆₃` -/ diff --git a/LeanPool/Chudnovsky/Periodicity.lean b/LeanPool/Chudnovsky/Periodicity.lean index 604b0f2f50..b4427398e9 100644 --- a/LeanPool/Chudnovsky/Periodicity.lean +++ b/LeanPool/Chudnovsky/Periodicity.lean @@ -25,13 +25,13 @@ lemma periodic_comp_ofComplex_of_vadd {f : ℍ → ℂ} (hf : ∀ τ : ℍ, f (( Periodic (f ∘ ofComplex) 1 := by intro w rcases lt_or_ge 0 w.im with hw | hw - · have hw1 : 0 < (w + 1).im := by simpa using hw + · have hw1 : 0 < (w + 1).im := by simpa only [add_im, one_im, add_zero] using hw simp only [comp_apply, ofComplex_apply_of_im_pos hw1, ofComplex_apply_of_im_pos hw] have h := hf ⟨w, hw⟩ convert h using 2 ext - simp [add_comm] - · have hw1 : (w + 1).im ≤ 0 := by simpa using hw + simp only [coe_vadd, ofReal_one, add_comm] + · have hw1 : (w + 1).im ≤ 0 := by simpa only [add_im, one_im, add_zero] using hw simp only [comp_apply] rw [ofComplex_apply_eq_of_im_nonpos hw1 (by simpa using hw)] diff --git a/LeanPool/Chudnovsky/Quasiperiods.lean b/LeanPool/Chudnovsky/Quasiperiods.lean index 5893642b2f..0edc59947f 100644 --- a/LeanPool/Chudnovsky/Quasiperiods.lean +++ b/LeanPool/Chudnovsky/Quasiperiods.lean @@ -49,7 +49,8 @@ def eta₂ : ℂ := 2 * L.weierstrassZeta (L.ω₂ / 2) /-- The lattice is a countable subset of `ℂ`. -/ private lemma countable_lattice : (↑L.lattice : Set ℂ).Countable := by have : Countable ↥L.lattice := countable_of_Lindelof_of_discrete - simpa using Set.countable_range (Subtype.val : ↥L.lattice → ℂ) + simpa only [Subtype.range_coe_subtype, + SetLike.setOfPred_mem_eq] using Set.countable_range (Subtype.val : ↥L.lattice → ℂ) /-- Quasi-periodicity of `ζ` in an arbitrary period direction `ω ∈ L` (with `ω/2 ∉ L`): `ζ(z+ω) = ζ(z) + 2ζ(ω/2)` for `z ∉ L`. Both quasi-period statements are instances of this. -/ @@ -58,10 +59,11 @@ private theorem weierstrassZeta_add_period (ω : ℂ) (hω : ω ∈ L.lattice) L.weierstrassZeta (z + ω) = L.weierstrassZeta z + 2 * L.weierstrassZeta (ω / 2) := by have hopen : IsOpen ((↑L.lattice : Set ℂ)ᶜ) := L.isClosed_lattice.isOpen_compl have hconn : IsPreconnected ((↑L.lattice : Set ℂ)ᶜ) := - (L.countable_lattice.isConnected_compl_of_one_lt_rank (by simp)).isPreconnected + (L.countable_lattice.isConnected_compl_of_one_lt_rank (by simp only [Complex.rank_real_complex, + Nat.one_lt_ofNat])).isPreconnected have hmem : ∀ {x : ℂ}, x ∉ L.lattice → x + ω ∉ L.lattice := by intro x hx hc - exact hx (by simpa using sub_mem hc hω) + exact hx (by simpa only [add_sub_cancel_right] using sub_mem hc hω) have hfdiff : DifferentiableOn ℂ (fun z ↦ L.weierstrassZeta (z + ω)) (↑L.lattice)ᶜ := L.differentiableOn_weierstrassZeta.comp (by fun_prop) (fun x hx ↦ hmem hx) have hgdiff : DifferentiableOn ℂ @@ -80,7 +82,7 @@ private theorem weierstrassZeta_add_period (ω : ℂ) (hω : ω ∈ L.lattice) have hx₀ : -(ω / 2) ∈ (↑L.lattice : Set ℂ)ᶜ := by change -(ω / 2) ∉ L.lattice intro hc - exact hω2 (by simpa using neg_mem hc) + exact hω2 (by simpa only [neg_neg] using neg_mem hc) have hval : L.weierstrassZeta (-(ω / 2) + ω) = L.weierstrassZeta (-(ω / 2)) + 2 * L.weierstrassZeta (ω / 2) := by rw [show -(ω / 2) + ω = ω / 2 by ring, L.weierstrassZeta_neg] @@ -248,7 +250,7 @@ private lemma hasSum_symmetricIco_D (τ : ℍ) (z : ℂ) (m : ℤ) : refine (tendsto_congr hpart).mpr ?_ have h1 := tendsto_zero_inv_linear C 1 have h2 := tendsto_zero_inv_linear_sub C 1 - simpa using h1.sub h2 + simpa only [one_mul, one_div, Int.cast_one, sub_self] using h1.sub h2 /-- The reindexing equivalence `ℤ × ℤ ≃ (L_τ).lattice`, `(m,n) ↦ m·τ + n`. -/ private def bridgeEqv (τ : ℍ) : ℤ × ℤ ≃ (Lτ τ).lattice := @@ -317,7 +319,7 @@ private lemma bridgeF_summable (τ : ℍ) {z : ℂ} exact (Equiv.summable_iff (f := fun pp : {p : ℤ × ℤ // p ≠ 0} => weierstrassZetaTerm (z + 1) ((bridgeEqv τ pp.1 : (Lτ τ).lattice) : ℂ) - weierstrassZetaTerm z ((bridgeEqv τ pp.1 : (Lτ τ).lattice) : ℂ)) - (Equiv.subtypeEquivRight (fun x => by simp))).mpr hFsum_sub + (Equiv.subtypeEquivRight (fun x => by simp only [mem_singleton, ne_eq]))).mpr hFsum_sub refine hFsum.congr (fun p => ?_) simp only [bridgeF, bridgeEqv_coe] @@ -443,14 +445,14 @@ private theorem legendre_Lτ_aux (τ : ℍ) : refine ⟨(-(n : ℂ)) + (m : ℂ) * (τ : ℂ), PeriodPair.mem_lattice.mpr ⟨-n, m, by push_cast; simp [Chudnovsky.Lτ_ω₁, Chudnovsky.Lτ_ω₂]⟩, ?_⟩ - field_simp + field_simp (disch := first | assumption | norm_num1 | positivity) ring · rintro ⟨w, hw, rfl⟩ obtain ⟨m, n, rfl⟩ := PeriodPair.mem_lattice.mp hw refine ⟨n, -m, ?_⟩ simp only [Chudnovsky.Lτ_ω₁, Chudnovsky.Lτ_ω₂] push_cast - field_simp + field_simp (disch := first | assumption | norm_num1 | positivity) ring -- `(u • L_τ) ζ` at `1/2` equals `τ · ζ_{L_τ}(τ/2)`. have hz : (u : ℂ) * ((τ : ℂ) / 2) = 1 / 2 := by @@ -480,7 +482,8 @@ oriented basis (`0 < Im(ω₂/ω₁)`; for the opposite orientation the right-ha `-2πi`). -/ theorem legendre_relation (h : 0 < (L.ω₂ / L.ω₁).im) : L.eta₁ * L.ω₂ - L.eta₂ * L.ω₁ = 2 * (Real.pi : ℂ) * Complex.I := by - have hω₁ : L.ω₁ ≠ 0 := by simpa using L.indep.ne_zero 0 + have hω₁ : L.ω₁ ≠ 0 := by simpa only [ne_eq, Nat.succ_eq_add_one, Nat.reduceAdd, Fin.isValue, + Matrix.cons_val_zero] using L.indep.ne_zero 0 set τ : ℍ := ⟨L.ω₂ / L.ω₁, h⟩ with hτdef set u : ℂˣ := Units.mk0 L.ω₁ hω₁ with hudef have huval : (u : ℂ) = L.ω₁ := Units.val_mk0 _ @@ -489,7 +492,7 @@ theorem legendre_relation (h : 0 < (L.ω₂ / L.ω₁).im) : apply PeriodPair.periodPair_eq · rw [PeriodPair.smulPP_ω₁, Chudnovsky.Lτ_ω₁, huval, mul_one] · rw [PeriodPair.smulPP_ω₂, Chudnovsky.Lτ_ω₂, huval, hτc] - field_simp + field_simp (disch := first | assumption | norm_num1 | positivity) have he1 : L.eta₁ = (u : ℂ)⁻¹ * (Chudnovsky.Lτ τ).eta₁ := by rw [hLeq]; exact PeriodPair.eta₁_smulPP u (Chudnovsky.Lτ τ) have he2 : L.eta₂ = (u : ℂ)⁻¹ * (Chudnovsky.Lτ τ).eta₂ := by @@ -500,7 +503,7 @@ theorem legendre_relation (h : 0 < (L.ω₂ / L.ω₁).im) : - (u : ℂ)⁻¹ * (Chudnovsky.Lτ τ).eta₂ * (u : ℂ) = (Chudnovsky.Lτ τ).eta₁ * (τ : ℂ) - (Chudnovsky.Lτ τ).eta₂ := by have hune : (u : ℂ) ≠ 0 := u.ne_zero - field_simp + field_simp (disch := first | assumption | norm_num1 | positivity) rw [he1, he2, hω2, ← huval, hrw] exact hlτ @@ -516,8 +519,8 @@ open scoped Real (paper `legendre` with `ω₁ = 1`, `ω₂ = τ`). -/ theorem legendre_Lτ (τ : ℍ) : (Lτ τ).eta₁ * τ - (Lτ τ).eta₂ = 2 * (π : ℂ) * Complex.I := by - have h := (Lτ τ).legendre_relation (by simpa using τ.im_pos) - simpa using h + have h := (Lτ τ).legendre_relation (by simpa only [Lτ_ω₂, Lτ_ω₁, div_one, coe_im] using τ.im_pos) + simpa only [Lτ_ω₂, Lτ_ω₁, mul_one] using h /-- The first quasiperiod of `L_τ` is the weight-2 Eisenstein series `G₂` in its Eisenstein summation order (Mathlib's `EisensteinSeries.G2`, summed over symmetric diff --git a/LeanPool/Chudnovsky/Ramanujan.lean b/LeanPool/Chudnovsky/Ramanujan.lean index 8858eee587..bc4463de14 100644 --- a/LeanPool/Chudnovsky/Ramanujan.lean +++ b/LeanPool/Chudnovsky/Ramanujan.lean @@ -74,7 +74,7 @@ lemma deriv_eqOn_upperHalfPlaneSet {F G : ℂ → ℂ} (h : Set.EqOn F G upperHa /-! ### Transformation behaviour of `E₂` and of level-one modular forms under `T` and `S` -/ lemma E2_slash_T : E2 ∣[(2 : ℤ)] ModularGroup.T = E2 := by - simp [E2_slash_action, D2_T] + simp only [E2_slash_action, one_div, mul_inv_rev, D2_T, smul_zero, sub_zero] private lemma denom_T (τ : ℍ) : denom ModularGroup.T τ = 1 := by simp [ModularGroup.denom_apply, ModularGroup.coe_T] @@ -83,7 +83,7 @@ private lemma denom_T (τ : ℍ) : denom ModularGroup.T τ = 1 := by lemma E2_vadd_one (τ : ℍ) : E2 ((1 : ℝ) +ᵥ τ) = E2 τ := by have h := congr_fun E2_slash_T τ rw [SL_slash_apply, denom_T, modular_T_smul] at h - simpa using h + simpa only [Int.reduceNeg, zpow_neg, zpow_ofNat, one_pow, inv_one, mul_one] using h lemma E2_periodic_comp_ofComplex : Periodic (E2 ∘ ofComplex) 1 := periodic_comp_ofComplex_of_vadd E2_vadd_one @@ -103,7 +103,7 @@ lemma E2_S_smul (τ : ℍ) : have hkey : (6 : ℂ) / (π * I) = -(6 * I / π) := by rw [div_mul_eq_div_div, div_I]; ring rw [h, hkey] - field_simp + field_simp (disch := first | assumption | norm_num1 | positivity) ring /-- Any level-one modular form is invariant under `τ ↦ τ + 1`. -/ @@ -147,7 +147,7 @@ lemma tendsto_E2_atImInfty : Tendsto E2 atImInfty (𝓝 1) := by have hr0 : 0 < r := Real.exp_pos _ have hr1 : r < 1 := by rw [hrdef, Real.exp_lt_one_iff] - have := Real.pi_pos; linarith + have := Real.pi_pos; linarith only [this] -- the constant `C = ∑ (n+1)²·rⁿ` have hC : Summable fun n : ℕ ↦ ((n : ℝ) + 1) ^ 2 * r ^ n := by have h2 : Summable fun n : ℕ ↦ (n : ℝ) ^ 2 * r ^ n := @@ -190,14 +190,14 @@ lemma tendsto_E2_atImInfty : Tendsto E2 atImInfty (𝓝 1) := by calc (ArithmeticFunction.sigma 1 (n + 1) : ℝ) * (‖q τ‖ ^ n * ‖q τ‖) ≤ ((n : ℝ) + 1) ^ 2 * (r ^ n * ‖q τ‖) := by apply mul_le_mul hσ (by gcongr) (by positivity) (by positivity) - _ = ((n : ℝ) + 1) ^ 2 * r ^ n * ‖q τ‖ := by ring + _ = ((n : ℝ) + 1) ^ 2 * r ^ n * ‖q τ‖ := by ac_rfl rw [hE, norm_neg, norm_mul] calc ‖(24 : ℂ)‖ * ‖∑' n : ℕ, (ArithmeticFunction.sigma 1 (n + 1) : ℂ) * q τ ^ (n + 1)‖ ≤ 24 * (C * ‖q τ‖) := by rw [Complex.norm_ofNat] exact mul_le_mul_of_nonneg_left - ((norm_tsum_le_tsum_norm hsumnorm).trans hbound) (by norm_num) - _ = 24 * C * ‖q τ‖ := by ring + ((norm_tsum_le_tsum_norm hsumnorm).trans hbound) (by norm_num1) + _ = 24 * C * ‖q τ‖ := by ac_rfl -- squeeze rw [← tendsto_sub_nhds_zero_iff] have hev : ∀ᶠ τ : ℍ in atImInfty, ‖E2 τ - 1‖ ≤ 24 * C * ‖q τ‖ := by @@ -205,8 +205,8 @@ lemma tendsto_E2_atImInfty : Tendsto E2 atImInfty (𝓝 1) := by exact ⟨1, key⟩ have hg : Tendsto (fun τ : ℍ ↦ 24 * C * ‖q τ‖) atImInfty (𝓝 0) := by have hq0 : Tendsto (fun τ : ℍ ↦ ‖q τ‖) atImInfty (𝓝 0) := by - simpa [q] using (qParam_tendsto_atImInfty one_pos).norm - simpa using hq0.const_mul (24 * C) + simpa only [q, norm_zero] using (qParam_tendsto_atImInfty one_pos).norm + simpa only [mul_zero] using hq0.const_mul (24 * C) exact squeeze_zero_norm' hev hg lemma isBoundedAtImInfty_E2 : IsBoundedAtImInfty E2 := @@ -227,7 +227,7 @@ lemma tendsto_valueAtInfty_atImInfty {f : ℍ → ℂ} (hper : Periodic (f ∘ o have h1 := (Periodic.tendsto_at_I_inf one_pos hper h_hol h_bd).comp tendsto_coe_atImInfty have h2 : Tendsto f atImInfty (𝓝 (cuspFunction 1 f 0)) := by refine h1.congr fun τ ↦ ?_ - simp [Function.comp_def, ofComplex_apply] + simp only [comp_def, comp_apply, ofComplex_apply] rwa [cuspFunction_apply_zero one_pos (analyticAt_cuspFunction_zero one_pos hper hhol hbdd) hper] at h2 @@ -282,7 +282,7 @@ lemma normalizedDeriv_eq_q_mul_deriv_cuspFunction (hper : Periodic (f ∘ ofComp have h2 := hq'.hasDerivAt have hq_eq : Periodic.qParam 1 (↑τ : ℂ) = q τ := rfl rw [hq_eq] at h2 - simpa [mul_comm] using h2 + simpa only [mul_comm, div_one] using h2 have hFq : DifferentiableAt ℂ (cuspFunction 1 f) (q τ) := differentiableAt_cuspFunction one_pos hper hhol hbdd (norm_q_lt_one τ) have hd : deriv (f ∘ ofComplex) ↑τ = deriv (cuspFunction 1 f) (q τ) * (2 * π * I * q τ) := by @@ -301,7 +301,7 @@ lemma isZeroAtImInfty_normalizedDeriv (hper : Periodic (f ∘ ofComplex) 1) analyticAt_cuspFunction_zero one_pos hper hhol hbdd have hc : ContinuousAt (deriv (cuspFunction 1 f)) 0 := hana.deriv.continuousAt have hq0 : Tendsto (fun τ : ℍ ↦ q τ) atImInfty (𝓝 0) := by - simpa [q] using qParam_tendsto_atImInfty one_pos + simpa only [q] using qParam_tendsto_atImInfty one_pos have h : Tendsto (fun τ : ℍ ↦ q τ * deriv (cuspFunction 1 f) (q τ)) atImInfty (𝓝 (0 * deriv (cuspFunction 1 f) 0)) := hq0.mul ((hc.tendsto).comp hq0) @@ -351,7 +351,7 @@ lemma deriv_comp_ofComplex_S (hhol : MDiff f) {Φ : ℂ → ℂ} private lemma coe_S_smul (τ : ℍ) : ((ModularGroup.S • τ : ℍ) : ℂ) = -(↑τ : ℂ)⁻¹ := by rw [modular_S_smul] - simp [inv_neg] + simp only [inv_neg] /-- How `D f` transforms under `S` for a function of weight `m + 1`: if `f(-1/τ) = τ^(m+1)·f(τ)` then @@ -375,7 +375,8 @@ lemma normalizedDeriv_S_smul_of_weight (hhol : MDiff f) {m : ℕ} have hd := deriv_comp_ofComplex_S hhol heq τ -- compute the derivative of the right-hand side have hp : HasDerivAt (fun w : ℂ ↦ w ^ (m + 1)) ((((m + 1) : ℕ) : ℂ) * (↑τ : ℂ) ^ m) ↑τ := by - simpa using hasDerivAt_pow (m + 1) (↑τ : ℂ) + simpa only [Nat.cast_add, Nat.cast_one, + add_tsub_cancel_right] using hasDerivAt_pow (m + 1) (↑τ : ℂ) have hΦ : HasDerivAt (fun w : ℂ ↦ w ^ (m + 1) * (f ∘ ofComplex) w) ((((m + 1) : ℕ) : ℂ) * (↑τ : ℂ) ^ m * (f ∘ ofComplex) ↑τ + (↑τ : ℂ) ^ (m + 1) * deriv (f ∘ ofComplex) ↑τ) ↑τ := @@ -412,7 +413,7 @@ lemma normalizedDeriv_E2_S_smul (τ : ℍ) : simp only [comp_apply, hofS, E2_S_smul ⟨w, hw⟩, ofComplex_apply_of_im_pos hw] have hd := deriv_comp_ofComplex_S E2_mdifferentiable heq τ have hp : HasDerivAt (fun w : ℂ ↦ w ^ 2) (2 * (↑τ : ℂ)) ↑τ := by - simpa using hasDerivAt_pow 2 (↑τ : ℂ) + simpa only [Nat.cast_ofNat, Nat.add_one_sub_one, pow_one] using hasDerivAt_pow 2 (↑τ : ℂ) have hlin : HasDerivAt (fun w : ℂ ↦ 6 / (π * I) * w) (6 / (π * I) * 1) ↑τ := (hasDerivAt_id (↑τ : ℂ)).const_mul (6 / (π * I) : ℂ) have hΦ : HasDerivAt (fun w : ℂ ↦ w ^ 2 * (E2 ∘ ofComplex) w + 6 / (π * I) * w) @@ -444,7 +445,7 @@ private lemma serreDerivative_slash_T {kc : ℂ} {f : ℍ → ℂ} {w : ℤ} rw [SL_slash_apply, denom_T, modular_T_smul] simp only [serreDerivative_apply] rw [normalizedDeriv_vadd_one (periodic_comp_ofComplex_of_vadd hf) τ, E2_vadd_one, hf] - simp + simp only [zpow_neg, one_zpow, inv_one, mul_one] /-- Boundedness at `i∞` of a Serre derivative. -/ private lemma isBoundedAtImInfty_serre {kc : ℂ} {f : ℍ → ℂ} @@ -475,7 +476,7 @@ private lemma tendsto_serre_atImInfty {kc : ℂ} {f : ℍ → ℂ} {a : ℂ} ((tendsto_const_nhds.mul tendsto_E2_atImInfty).mul hlim) have h := hD.sub h2 rw [serreDerivative_eq] - simpa using h + simpa only [mul_one, zero_sub] using h /-- Slash-invariance under `S` of `∂₄E₄` (weight 6). -/ private lemma serre_E₄_slash_S : @@ -495,7 +496,7 @@ private lemma serre_E₄_slash_S : rw [zpow_neg]; norm_cast rw [hz] push_cast - field_simp + field_simp (disch := first | assumption | norm_num1 | positivity) ring /-- Slash-invariance under `S` of `∂₆E₆` (weight 8). -/ @@ -516,7 +517,7 @@ private lemma serre_E₆_slash_S : rw [zpow_neg]; norm_cast rw [hz] push_cast - field_simp + field_simp (disch := first | assumption | norm_num1 | positivity) ring /-- Slash-invariance under `S` of `∂₁E₂ = D E₂ - E₂²/12` (weight 4): the quasimodularity @@ -533,7 +534,7 @@ private lemma serre_E2_slash_S : have hz : ((↑τ : ℂ) ^ (-(4 : ℤ))) = ((↑τ : ℂ) ^ (4 : ℕ))⁻¹ := by rw [zpow_neg]; norm_cast rw [hz] - field_simp + field_simp (disch := first | assumption | norm_num1 | positivity) ring /-- `∂₄E₄ = D E₄ - (1/3)·E₂·E₄`, as a modular form of weight 6 and level one. -/ @@ -604,16 +605,17 @@ private lemma E₄sq_ne_zero : E₄sq ≠ 0 := by rw [E₄sq_coe]; rfl rw [hcoe, qExpansion_mul_coeff_zero hana.continuousAt hana.continuousAt, h4, mul_one] rw [(ModularForm.qExpansion_eq_zero_iff one_pos one_mem_strictPeriods_SL E₄sq).mpr h] at h0 - simp at h0 + simp only [PowerSeries.coeff_zero_eq_constantCoeff, PowerSeries.constantCoeff_zero, + zero_ne_one] at h0 private lemma tendsto_E₄sq_atImInfty : Tendsto (⇑E₄sq) atImInfty (𝓝 1) := by rw [E₄sq_coe] - simpa using tendsto_E₄_atImInfty.mul tendsto_E₄_atImInfty + simpa only [mul_one] using tendsto_E₄_atImInfty.mul tendsto_E₄_atImInfty private lemma rank_eight : Module.rank ℂ (ModularForm 𝒮ℒ (8 : ℤ)) = 1 := by have h := ModularForm.dimension_level_one 8 (by decide) rw [ite_eq_right (by decide)] at h - simpa using h + simpa only [Nat.cast_ofNat, Nat.reduceDiv, zero_add, Nat.cast_one] using h /-- Extract the scalar from a rank-one comparison by taking limits at `i∞`. -/ private lemma smul_const_of_tendsto {k : ℤ} {e : ModularForm 𝒮ℒ k} {g : ℍ → ℂ} {c a b : ℂ} @@ -621,7 +623,7 @@ private lemma smul_const_of_tendsto {k : ℤ} {e : ModularForm 𝒮ℒ k} {g : (hg : Tendsto g atImInfty (𝓝 b)) : c * a = b := by have h1 : Tendsto (⇑(c • e)) atImInfty (𝓝 (c * a)) := by have hcoe : (⇑(c • e) : ℍ → ℂ) = fun τ ↦ c * e τ := by - ext τ; simp + ext τ; simp only [smul_apply, smul_eq_mul] rw [hcoe] exact tendsto_const_nhds.mul he rw [h] at h1 @@ -640,10 +642,10 @@ theorem serreDerivative_E₄_eq : serreDerivative 4 (⇑E₄) = fun τ : ℍ ↦ (ModularFormClass.bdd_at_infty E₄) tendsto_E₄_atImInfty) have hcval : c = -(3⁻¹) := by rw [mul_one] at hval - rw [hval]; norm_num + rw [hval]; norm_num1 funext τ rw [← hfun, hcval] - simp + simp only [_root_.neg_smul, neg_apply, smul_apply, smul_eq_mul, neg_mul] /-- The Serre-derivative form of Ramanujan's identity for `E₆`: `D E₆ - (1/2)·E₂·E₆ = -(1/2)·E₄²`. -/ @@ -659,11 +661,11 @@ theorem serreDerivative_E₆_eq : (ModularFormClass.bdd_at_infty E₆) tendsto_E₆_atImInfty) have hcval : c = -(2⁻¹) := by rw [mul_one] at hval - rw [hval]; norm_num + rw [hval]; norm_num1 funext τ have h := congr_fun hfun τ rw [← h, hcval] - simp [E₄sq_coe] + simp only [_root_.neg_smul, neg_apply, smul_apply, E₄sq_coe, smul_eq_mul, neg_mul] /-- The Serre-derivative form of Ramanujan's identity for `E₂`: `D E₂ - (1/12)·E₂² = -(1/12)·E₄`. -/ @@ -678,10 +680,10 @@ theorem serreDerivative_E2_eq : serreDerivative 1 E2 = fun τ : ℍ ↦ -(12⁻ tendsto_E2_atImInfty) have hcval : c = -(12⁻¹) := by rw [mul_one] at hval - rw [hval]; norm_num + rw [hval]; norm_num1 funext τ rw [← hfun, hcval] - simp + simp only [_root_.neg_smul, neg_apply, smul_apply, smul_eq_mul, neg_mul] end RankOne diff --git a/LeanPool/Chudnovsky/SigmaZeta.lean b/LeanPool/Chudnovsky/SigmaZeta.lean index 6c10326c7d..84437f97a8 100644 --- a/LeanPool/Chudnovsky/SigmaZeta.lean +++ b/LeanPool/Chudnovsky/SigmaZeta.lean @@ -64,7 +64,8 @@ private def negNonzero : {l : L.lattice // l ≠ 0} ≃ {l : L.lattice // l ≠ @[simp] private lemma negNonzero_coe (l : {l : L.lattice // l ≠ 0}) : ((L.negNonzero l).1 : ℂ) = -(l.1 : ℂ) := by - simp [negNonzero, Equiv.subtypeEquiv] + simp only [ne_eq, negNonzero, Equiv.subtypeEquiv, Equiv.neg_apply, Equiv.neg_symm, + Equiv.coe_fn_mk, NegMemClass.coe_neg] private lemma weierstrassSigmaTerm_neg_neg (z w : ℂ) : weierstrassSigmaTerm (-z) (-w) = weierstrassSigmaTerm z w := by @@ -80,14 +81,14 @@ private lemma weierstrassZetaTerm_eq (z w : ℂ) (hw : w ≠ 0) (hzw : z ≠ w) weierstrassZetaTerm z w = z ^ 2 / (w ^ 2 * (z - w)) := by have h1 : z - w ≠ 0 := sub_ne_zero.mpr hzw rw [weierstrassZetaTerm] - field_simp + field_simp (disch := first | assumption | norm_num1 | positivity) ring /-- Summability of `‖ω‖⁻³` over the nonzero lattice points. -/ private lemma summable_norm_rpow_neg_three : Summable (fun l : {l : L.lattice // l ≠ 0} ↦ ‖(l.1 : ℂ)‖ ^ (-3 : ℝ)) := by have h : (-3 : ℝ) < -(Module.finrank ℤ L.lattice : ℝ) := by - rw [L.finrank_lattice]; norm_num + rw [L.finrank_lattice]; norm_num1 exact (ZLattice.summable_norm_rpow L.lattice (-3) h).comp_injective Subtype.val_injective /-- All but finitely many nonzero lattice points have norm `≥ r`. -/ @@ -120,7 +121,7 @@ private lemma norm_weierstrassZetaTerm_le (z w : ℂ) (hw : w ≠ 0) (h : 2 * linear_combination mul_le_mul_of_nonneg_left h1 (by positivity : (0 : ℝ) ≤ 2 * ‖z‖ ^ 2 * ‖w‖ ^ 2) refine hbound.trans_eq ?_ - rw [show (-3 : ℝ) = -(3 : ℕ) by norm_num, Real.rpow_neg hwpos.le, Real.rpow_natCast] + rw [show (-3 : ℝ) = -(3 : ℕ) by norm_num1, Real.rpow_neg hwpos.le, Real.rpow_natCast] ring /-- The pointwise bound `‖σ-factor − 1‖ ≤ (4/3)‖z‖³‖ω‖⁻³` for `‖ω‖ ≥ 2‖z‖`. -/ @@ -131,12 +132,12 @@ private lemma norm_weierstrassSigmaTerm_sub_one_le (z w : ℂ) (hw : w ≠ 0) (h rw [norm_div, div_le_iff₀ hwpos]; linarith only [h] have hlt1 : ‖-(z / w)‖ < 1 := by rw [norm_neg] - exact hnorm.trans_lt (by norm_num) + exact hnorm.trans_lt (by norm_num1) have h1a : (1 : ℂ) - z / w ≠ 0 := by intro H rw [sub_eq_zero] at H rw [← H, norm_one] at hnorm - norm_num at hnorm + norm_num1 at hnorm have hexp : weierstrassSigmaTerm z w = Complex.exp (Complex.log (1 + -(z / w)) - logTaylor 3 (-(z / w))) := by have h1 : (1 : ℂ) + -(z / w) = 1 - z / w := by ring @@ -148,24 +149,24 @@ private lemma norm_weierstrassSigmaTerm_sub_one_le (z w : ℂ) (hw : w ≠ 0) (h rw [hexp] have hubound : ‖Complex.log (1 + -(z / w)) - logTaylor 3 (-(z / w))‖ ≤ 2 / 3 * ‖z / w‖ ^ 3 := by have hinv : (1 - ‖z / w‖)⁻¹ ≤ 2 := by - rw [inv_le_comm₀ (by linarith only [hnorm]) (by norm_num)] + rw [inv_le_comm₀ (by linarith only [hnorm]) (by norm_num1)] rw [inv_eq_one_div]; linarith only [hnorm] calc ‖Complex.log (1 + -(z / w)) - logTaylor 3 (-(z / w))‖ ≤ ‖-(z / w)‖ ^ (2 + 1) * (1 - ‖-(z / w)‖)⁻¹ / (2 + 1) := norm_log_sub_logTaylor_le 2 hlt1 - _ = ‖z / w‖ ^ 3 * (1 - ‖z / w‖)⁻¹ / 3 := by rw [norm_neg]; norm_num + _ = ‖z / w‖ ^ 3 * (1 - ‖z / w‖)⁻¹ / 3 := by rw [norm_neg]; norm_num only _ ≤ ‖z / w‖ ^ 3 * 2 / 3 := by gcongr _ = 2 / 3 * ‖z / w‖ ^ 3 := by ring have hule1 : ‖Complex.log (1 + -(z / w)) - logTaylor 3 (-(z / w))‖ ≤ 1 := by refine hubound.trans ?_ calc 2 / 3 * ‖z / w‖ ^ 3 ≤ 2 / 3 * (1 / 2 : ℝ) ^ 3 := by gcongr - _ ≤ 1 := by norm_num + _ ≤ 1 := by norm_num1 calc ‖Complex.exp (Complex.log (1 + -(z / w)) - logTaylor 3 (-(z / w))) - 1‖ ≤ 2 * ‖Complex.log (1 + -(z / w)) - logTaylor 3 (-(z / w))‖ := norm_exp_sub_one_le hule1 _ ≤ 2 * (2 / 3 * ‖z / w‖ ^ 3) := by gcongr _ = 4 / 3 * ‖z / w‖ ^ 3 := by ring _ = 4 / 3 * ‖z‖ ^ 3 * ‖w‖ ^ (-3 : ℝ) := by - rw [norm_div, div_pow, show (-3 : ℝ) = -(3 : ℕ) by norm_num, + rw [norm_div, div_pow, show (-3 : ℝ) = -(3 : ℕ) by norm_num1, Real.rpow_neg hwpos.le, Real.rpow_natCast] ring @@ -185,7 +186,8 @@ private lemma hasDerivAt_weierstrassSigmaTerm (z w : ℂ) : * (1 / w + z / w ^ 2))) z := by have hquad : HasDerivAt (fun z : ℂ ↦ z ^ 2 / (2 * w ^ 2)) (z / w ^ 2) z := by have h : HasDerivAt (fun z : ℂ ↦ z ^ 2 / (2 * w ^ 2)) ((2 * z) / (2 * w ^ 2)) z := by - simpa using (hasDerivAt_pow 2 z).div_const (2 * w ^ 2) + simpa only [Nat.cast_ofNat, Nat.add_one_sub_one, + pow_one] using (hasDerivAt_pow 2 z).div_const (2 * w ^ 2) rwa [mul_div_mul_left _ _ two_ne_zero] at h exact (((hasDerivAt_id z).div_const w).const_sub 1).mul (((hasDerivAt_id z).div_const w).add hquad).cexp @@ -213,7 +215,7 @@ private lemma deriv_weierstrassZetaTerm {z w : ℂ} (_hw : w ≠ 0) (hzw : z ≠ exact ((hasDerivAt_id z).sub_const w).inv hzw' have h2 : HasDerivAt (fun _ : ℂ ↦ 1 / w) (0 : ℂ) z := hasDerivAt_const z _ have h3 : HasDerivAt (fun z : ℂ ↦ z / w ^ 2) (1 / w ^ 2) z := by - simpa using (hasDerivAt_id z).div_const (w ^ 2) + simpa only [one_div, id_eq] using (hasDerivAt_id z).div_const (w ^ 2) exact (h1.add h2).add h3 rw [hd.deriv]; ring @@ -224,14 +226,14 @@ private lemma summable_norm_sigma_sub_one (z : ℂ) : ((L.summable_norm_rpow_neg_three).mul_left (4 / 3 * ‖z‖ ^ 3)) ?_ filter_upwards [L.cofinite_norm_ge (2 * ‖z‖)] with l hl rw [norm_norm] - have hw : (l.1 : ℂ) ≠ 0 := by simpa using l.2 + have hw : (l.1 : ℂ) ≠ 0 := by simpa only [ne_eq, ZeroMemClass.coe_eq_zero] using l.2 exact norm_weierstrassSigmaTerm_sub_one_le z (l.1 : ℂ) hw hl /-- On a compact set the norm is bounded by a positive constant. -/ private lemma exists_norm_bound_on_compact {K : Set ℂ} (hK : IsCompact K) : ∃ r : ℝ, 0 < r ∧ ∀ x ∈ K, ‖x‖ ≤ r := by rcases K.eq_empty_or_nonempty with rfl | hne - · exact ⟨1, one_pos, by simp⟩ + · exact ⟨1, one_pos, by simp only [Set.mem_empty_iff_false, IsEmpty.forall_iff, implies_true]⟩ · obtain ⟨r, hr⟩ := hK.isBounded.subset_closedBall (0 : ℂ) refine ⟨max r 1, lt_of_lt_of_le one_pos (le_max_right _ _), fun x hx => ?_⟩ have := hr hx @@ -248,7 +250,7 @@ theorem multipliable_weierstrassSigmaTerm (z : ℂ) : refine Summable.of_norm_bounded_eventually ((L.summable_norm_rpow_neg_three).mul_left (4 / 3 * ‖z‖ ^ 3)) ?_ filter_upwards [L.cofinite_norm_ge (2 * ‖z‖)] with l hl - have hw : (l.1 : ℂ) ≠ 0 := by simpa using l.2 + have hw : (l.1 : ℂ) ≠ 0 := by simpa only [ne_eq, ZeroMemClass.coe_eq_zero] using l.2 exact norm_weierstrassSigmaTerm_sub_one_le z (l.1 : ℂ) hw hl exact (Complex.multipliable_one_add_of_summable hsummable).congr fun l ↦ by ring @@ -268,7 +270,7 @@ theorem hasProdLocallyUniformly_weierstrassSigmaTerm : · exact Filter.Eventually.of_forall fun n x _ ↦ Finset.prod_congr rfl fun i _ ↦ by ring · exact fun x _ ↦ tprod_congr fun l ↦ by ring · filter_upwards [L.cofinite_norm_ge (2 * r)] with l hl x hx - have hw : (l.1 : ℂ) ≠ 0 := by simpa using l.2 + have hw : (l.1 : ℂ) ≠ 0 := by simpa only [ne_eq, ZeroMemClass.coe_eq_zero] using l.2 have hx' : ‖x‖ ≤ r := hKr x hx have h2 : 2 * ‖x‖ ≤ ‖(l.1 : ℂ)‖ := le_trans (by linarith) hl calc ‖weierstrassSigmaTerm x (l.1 : ℂ) - 1‖ @@ -286,7 +288,7 @@ theorem summable_weierstrassZetaTerm (z : ℂ) (_hz : z ∉ L.lattice) : refine Summable.of_norm_bounded_eventually ((L.summable_norm_rpow_neg_three).mul_left (2 * ‖z‖ ^ 2)) ?_ filter_upwards [L.cofinite_norm_ge (2 * ‖z‖)] with l hl - have hw : (l.1 : ℂ) ≠ 0 := by simpa using l.2 + have hw : (l.1 : ℂ) ≠ 0 := by simpa only [ne_eq, ZeroMemClass.coe_eq_zero] using l.2 exact norm_weierstrassZetaTerm_le z (l.1 : ℂ) hw hl /-- The ζ-series converges locally uniformly away from the lattice. -/ @@ -302,7 +304,7 @@ theorem hasSumLocallyUniformlyOn_weierstrassZetaTerm : apply tendstoUniformlyOn_tsum_of_cofinite_eventually ((L.summable_norm_rpow_neg_three).mul_left (2 * r ^ 2)) filter_upwards [L.cofinite_norm_ge (2 * r)] with l hl x hx - have hw : (l.1 : ℂ) ≠ 0 := by simpa using l.2 + have hw : (l.1 : ℂ) ≠ 0 := by simpa only [ne_eq, ZeroMemClass.coe_eq_zero] using l.2 have hx' : ‖x‖ ≤ r := hKr x hx have h2 : 2 * ‖x‖ ≤ ‖(l.1 : ℂ)‖ := le_trans (by linarith) hl calc ‖weierstrassZetaTerm x (l.1 : ℂ)‖ @@ -324,7 +326,7 @@ private lemma differentiable_tprod_weierstrassSigmaTerm : refine (L.hasProdLocallyUniformly_weierstrassSigmaTerm.hasProdLocallyUniformlyOn).differentiableOn (.of_forall fun _ ↦ ?_) isOpen_univ - simpa [Finset.prod_fn] using + simpa only [ne_eq, Finset.prod_fn] using DifferentiableOn.finsetProd fun i _ ↦ (differentiable_weierstrassSigmaTerm (i.1 : ℂ)).differentiableOn @@ -346,7 +348,7 @@ theorem differentiableOn_weierstrassZeta : hopen ?_ intro l r hr have hrne : r ≠ (l.1 : ℂ) := by rintro rfl; exact hr l.1.2 - have hw : (l.1 : ℂ) ≠ 0 := by simpa using l.2 + have hw : (l.1 : ℂ) ≠ 0 := by simpa only [ne_eq, ZeroMemClass.coe_eq_zero] using l.2 have hrw : r - (l.1 : ℂ) ≠ 0 := sub_ne_zero.mpr hrne unfold weierstrassZetaTerm fun_prop (disch := assumption) @@ -440,7 +442,7 @@ private lemma differentiable_tprod_family {ι : Type*} (g : ι → ℂ → ℂ) exact hi x (hKr x hx) · exact fun i ↦ ((hdiff i).continuous.sub continuous_const).continuousOn refine hLU.hasProdLocallyUniformlyOn.differentiableOn (.of_forall fun _ ↦ ?_) isOpen_univ - simpa [Finset.prod_fn] using DifferentiableOn.finsetProd fun i _ ↦ (hdiff i).differentiableOn + simpa only [Finset.prod_fn] using DifferentiableOn.finsetProd fun i _ ↦ (hdiff i).differentiableOn /-- At a nonzero lattice point `ω`, the derivative of `σ` is nonzero: split the factor at `ω` out of the product, `σ z = (z · Q z) · (σ-factor at ω)`, where the factor vanishes simply and @@ -449,7 +451,7 @@ private lemma deriv_weierstrassSigma_ne_zero_at (i₀ : {l : L.lattice // l ≠ deriv L.weierstrassSigma (i₀.1 : ℂ) ≠ 0 := by classical set w : ℂ := (i₀.1 : ℂ) with hw - have hwne : w ≠ 0 := by rw [hw]; simpa using i₀.2 + have hwne : w ≠ 0 := by rw [hw]; simpa only [ne_eq, ZeroMemClass.coe_eq_zero] using i₀.2 -- the σ-product with the factor at `i₀` replaced by `1` set g : {l : L.lattice // l ≠ 0} → ℂ → ℂ := fun n z ↦ if n = i₀ then 1 else weierstrassSigmaTerm z (n.1 : ℂ) with hg @@ -471,7 +473,7 @@ private lemma deriv_weierstrassSigma_ne_zero_at (i₀ : {l : L.lattice // l ≠ · simp only [ite_eq_left h, sub_self, norm_zero] positivity · simp only [ite_eq_right h] - have hwn : (n.1 : ℂ) ≠ 0 := by simpa using n.2 + have hwn : (n.1 : ℂ) ≠ 0 := by simpa only [ne_eq, ZeroMemClass.coe_eq_zero] using n.2 have h2 : 2 * ‖x‖ ≤ ‖(n.1 : ℂ)‖ := le_trans (by linarith) hn calc ‖weierstrassSigmaTerm x (n.1 : ℂ) - 1‖ ≤ 4 / 3 * ‖x‖ ^ 3 * ‖(n.1 : ℂ)‖ ^ (-3 : ℝ) := @@ -506,7 +508,8 @@ private lemma deriv_weierstrassSigma_ne_zero_at (i₀ : {l : L.lattice // l ≠ by_cases h : n = i₀ · simp only [ite_eq_left h]; exact one_ne_zero · simp only [ite_eq_right h] - refine weierstrassSigmaTerm_ne_zero (by simpa using n.2) (fun hcontra ↦ ?_) + refine weierstrassSigmaTerm_ne_zero (by simpa only [ne_eq, + ZeroMemClass.coe_eq_zero] using n.2) (fun hcontra ↦ ?_) exact h (Subtype.ext (Subtype.ext hcontra.symm)) have hsummable : Summable (fun n ↦ ‖g n w - 1‖) := Summable.of_nonneg_of_le (fun n ↦ norm_nonneg _) hle (L.summable_norm_sigma_sub_one w) @@ -519,7 +522,7 @@ private lemma deriv_weierstrassSigma_ne_zero_at (i₀ : {l : L.lattice // l ≠ simpa only [div_self hwne, sub_self, zero_mul, add_zero] using hasDerivAt_weierstrassSigmaTerm w w have hBw : weierstrassSigmaTerm w w = 0 := by - rw [weierstrassSigmaTerm, div_self hwne]; simp + rw [weierstrassSigmaTerm, div_self hwne]; simp only [sub_self, zero_mul] have hdB_ne : (-(1 / w) * Complex.exp (w / w + w ^ 2 / (2 * w ^ 2))) ≠ 0 := mul_ne_zero (neg_ne_zero.mpr (one_div_ne_zero hwne)) (Complex.exp_ne_zero _) have hσeq : L.weierstrassSigma = fun z ↦ (z * Q z) * weierstrassSigmaTerm z w := by @@ -566,7 +569,7 @@ theorem meromorphicOrderAt_weierstrassSigma (l : ℂ) (hl : l ∈ L.lattice) : simpa only [hP0, id_eq, one_mul, zero_mul, add_zero] using (one_ne_zero : (1 : ℂ) ≠ 0) · -- `l ≠ 0`: reduce to the split-factor lemma at the lattice point `l`. have hmem : (⟨l, hl⟩ : L.lattice) ≠ 0 := - fun H ↦ hl0 (by simpa using congrArg Subtype.val H) + fun H ↦ hl0 (by simpa only [ZeroMemClass.coe_zero] using congrArg Subtype.val H) exact L.deriv_weierstrassSigma_ne_zero_at ⟨⟨l, hl⟩, hmem⟩ have hord : analyticOrderAt L.weierstrassSigma l = 1 := hAn.analyticOrderAt_eq_one_of_zero_deriv_ne_zero hzero hderiv @@ -582,7 +585,8 @@ theorem logDeriv_weierstrassSigma (z : ℂ) (hz : z ∉ L.lattice) : have hopen : IsOpen ((↑L.lattice : Set ℂ)ᶜ) := L.isClosed_lattice.isOpen_compl have hzne : ∀ l : {l : L.lattice // l ≠ 0}, z ≠ (l.1 : ℂ) := by intro l; rintro rfl; exact hz l.1.2 - have hwne : ∀ l : {l : L.lattice // l ≠ 0}, (l.1 : ℂ) ≠ 0 := fun l ↦ by simpa using l.2 + have hwne : ∀ l : {l : L.lattice // l ≠ 0}, (l.1 : ℂ) ≠ 0 := fun l ↦ by simpa only [ne_eq, + ZeroMemClass.coe_eq_zero] using l.2 have hfacne : ∀ l : {l : L.lattice // l ≠ 0}, weierstrassSigmaTerm z (l.1 : ℂ) ≠ 0 := fun l ↦ weierstrassSigmaTerm_ne_zero (hwne l) (hzne l) have hlogterm : ∀ l : {l : L.lattice // l ≠ 0}, @@ -624,7 +628,7 @@ private lemma differentiableOn_weierstrassZetaTerm (l : {l : L.lattice // l ≠ DifferentiableOn ℂ (fun z ↦ weierstrassZetaTerm z (l.1 : ℂ)) (↑L.lattice)ᶜ := by intro r hr have hrne : r ≠ (l.1 : ℂ) := by rintro rfl; exact hr l.1.2 - have hw : (l.1 : ℂ) ≠ 0 := by simpa using l.2 + have hw : (l.1 : ℂ) ≠ 0 := by simpa only [ne_eq, ZeroMemClass.coe_eq_zero] using l.2 have hrw : r - (l.1 : ℂ) ≠ 0 := sub_ne_zero.mpr hrne unfold weierstrassZetaTerm refine DifferentiableAt.differentiableWithinAt (((?_ : DifferentiableAt ℂ @@ -659,7 +663,8 @@ private lemma hasSum_deriv_zetaTerm {z : ℂ} (hz : z ∉ L.lattice) : have hzc : z ∈ (↑L.lattice : Set ℂ)ᶜ := hz have hzne : ∀ l : {l : L.lattice // l ≠ 0}, z ≠ (l.1 : ℂ) := by intro l; rintro rfl; exact hz l.1.2 - have hwne : ∀ l : {l : L.lattice // l ≠ 0}, (l.1 : ℂ) ≠ 0 := fun l ↦ by simpa using l.2 + have hwne : ∀ l : {l : L.lattice // l ≠ 0}, (l.1 : ℂ) ≠ 0 := fun l ↦ by simpa only [ne_eq, + ZeroMemClass.coe_eq_zero] using l.2 have hderivS : HasSum (fun l : {l : L.lattice // l ≠ 0} ↦ deriv (fun z ↦ weierstrassZetaTerm z (l.1 : ℂ)) z) (deriv (fun z ↦ ∑' l : {l : L.lattice // l ≠ 0}, weierstrassZetaTerm z (l.1 : ℂ)) z) := by diff --git a/LeanPool/Chudnovsky/SingularModuli.lean b/LeanPool/Chudnovsky/SingularModuli.lean index e9e0edf939..f41ce0643c 100644 --- a/LeanPool/Chudnovsky/SingularModuli.lean +++ b/LeanPool/Chudnovsky/SingularModuli.lean @@ -67,10 +67,10 @@ open Complex /-- **Cited input 1** [Silverman ATAEC II.6.1]. The value of the `j`-invariant `j = 1728·J` at the CM point `τ₁₆₃ = (1 + i√163)/2` is an algebraic integer. -/ theorem isIntegral_j_τ₁₆₃ : IsIntegral ℤ (1728 * J τ₁₆₃) := by - have : Fact (Nat.Prime 41) := ⟨by norm_num⟩ - have : NeZero (41 : ℕ) := ⟨by norm_num⟩ + have : Fact (Nat.Prime 41) := ⟨by norm_num1⟩ + have : NeZero (41 : ℕ) := ⟨by norm_num1⟩ obtain ⟨PhiZ, hPhi⟩ := exists_PhiZ_closed (m := 41) - obtain ⟨i, hi⟩ := cm_coset_rel (m := 41) 0 (by norm_num) + obtain ⟨i, hi⟩ := cm_coset_rel (m := 41) 0 (by norm_num1) exact isIntegral_j_of_cm hPhi hi.symm /-- **Cited input 2** [Silverman ATAEC II.4.3(b); Buell]. The degree of `j(τ₁₆₃)` diff --git a/LeanPool/Chudnovsky/SingularModuli/CMRelations.lean b/LeanPool/Chudnovsky/SingularModuli/CMRelations.lean index 705a7f4d57..2857d3697e 100644 --- a/LeanPool/Chudnovsky/SingularModuli/CMRelations.lean +++ b/LeanPool/Chudnovsky/SingularModuli/CMRelations.lean @@ -75,15 +75,15 @@ theorem cmMatrix_det_eq_normForm (n : ℤ) : /-- `M_0` fixes `τ₁₆₃` with determinant `41`. -/ theorem cm_41 : QF.Fixes (0 + 1) (-41) 1 0 τ₁₆₃ ∧ (0 + 1) * 0 - (-41) * 1 = 41 := - ⟨cmMatrix_fixes 0, by ring⟩ + ⟨cmMatrix_fixes 0, by ac_rfl⟩ /-- `M_1` fixes `τ₁₆₃` with determinant `43`. -/ theorem cm_43 : QF.Fixes (1 + 1) (-41) 1 1 τ₁₆₃ ∧ (1 + 1) * 1 - (-41) * 1 = 43 := - ⟨cmMatrix_fixes 1, by ring⟩ + ⟨cmMatrix_fixes 1, by ac_rfl⟩ /-- `M_4` fixes `τ₁₆₃` with determinant `61`. -/ theorem cm_61 : QF.Fixes (4 + 1) (-41) 1 4 τ₁₆₃ ∧ (4 + 1) * 4 - (-41) * 1 = 61 := - ⟨cmMatrix_fixes 4, by ring⟩ + ⟨cmMatrix_fixes 4, by ac_rfl⟩ /-- The three determinants are represented by the norm form `x² + xy + 41 y²` at `(x, y) = (0,1), (1,1), (4,1)` — the arithmetic reason the isogenies exist (`m` splits in @@ -92,7 +92,7 @@ theorem normForm_represents : (0 : ℤ) ^ 2 + 0 * 1 + 41 * 1 ^ 2 = 41 ∧ (1 : ℤ) ^ 2 + 1 * 1 + 41 * 1 ^ 2 = 43 ∧ (4 : ℤ) ^ 2 + 4 * 1 + 41 * 1 ^ 2 = 61 := by - refine ⟨by ring, by ring, by ring⟩ + refine ⟨by ac_rfl, by ac_rfl, by ac_rfl⟩ /-- **The three-prime input, packaged for the rationality argument.** The traces `t = 2n+1` for `n = 0, 1, 4` and multiplier `λ = 1` satisfy the discriminant relations diff --git a/LeanPool/Chudnovsky/SingularModuli/CosetOrbit.lean b/LeanPool/Chudnovsky/SingularModuli/CosetOrbit.lean index 32c324c0fc..a7a54bc2a4 100644 --- a/LeanPool/Chudnovsky/SingularModuli/CosetOrbit.lean +++ b/LeanPool/Chudnovsky/SingularModuli/CosetOrbit.lean @@ -84,11 +84,13 @@ def Acol (m : ℕ) [NeZero m] (b : ℤ) : GL (Fin 2) ℝ := lemma det_AInf_pos [NeZero m] : 0 < (AInf m).det.val := by rw [Matrix.GeneralLinearGroup.val_det_apply, val_AInf, Matrix.det_fin_two_of] - simpa using (Nat.cast_pos.mpr (Nat.pos_of_ne_zero (NeZero.ne m)) : (0 : ℝ) < m) + simpa only [mul_one, mul_zero, sub_zero, + Nat.cast_pos] using (Nat.cast_pos.mpr (Nat.pos_of_ne_zero (NeZero.ne m)) : (0 : ℝ) < m) lemma det_Acol_pos [NeZero m] (b : ℤ) : 0 < (Acol m b).det.val := by rw [Matrix.GeneralLinearGroup.val_det_apply, val_Acol, Matrix.det_fin_two_of] - simpa using (Nat.cast_pos.mpr (Nat.pos_of_ne_zero (NeZero.ne m)) : (0 : ℝ) < m) + simpa only [one_mul, mul_zero, sub_zero, + Nat.cast_pos] using (Nat.cast_pos.mpr (Nat.pos_of_ne_zero (NeZero.ne m)) : (0 : ℝ) < m) /-- The `∞`-coset point: `AInf m • τ = m·τ`. -/ lemma coe_AInf_smul [NeZero m] (τ : ℍ) : (↑(AInf m • τ) : ℂ) = m * τ := by @@ -148,7 +150,7 @@ private lemma dvd_val_add [NeZero m] (b : ZMod m) (c : ℤ) : (m : ℤ) ∣ ((b.val : ℤ) + c) - ((b + (c : ZMod m)).val : ℤ) := by rw [← ZMod.intCast_zmod_eq_zero_iff_dvd] push_cast [ZMod.natCast_val, ZMod.intCast_cast, ZMod.ringHom_map_cast] - simp + simp only [ZMod.cast_id', id_eq, dvd_refl, ZMod.cast_add, ZMod.cast_intCast, sub_self] /-! ## The `T`-permutation @@ -171,17 +173,18 @@ lemma f_T_smul [NeZero m] (i : Option (ZMod m)) (τ : ℍ) : simp only [coe_AInf_smul, UpperHalfPlane.coe_vadd] push_cast; ring rw [hpt] - simpa using j_vadd_int (m : ℤ) (AInf m • τ) + simpa only [j_def, mul_eq_mul_left_iff, OfNat.ofNat_ne_zero, or_false, + Int.cast_natCast] using j_vadd_int (m : ℤ) (AInf m • τ) | some b => simp only [f_some, σT_some] -- first move the `+1` inside the coset offset: point equality have hpt : Acol m b.val • ((1 : ℝ) +ᵥ τ) = Acol m (b.val + 1) • τ := by apply UpperHalfPlane.ext simp only [coe_Acol_smul, UpperHalfPlane.coe_vadd] - push_cast; ring + push_cast; ac_rfl rw [hpt] -- then reduce `(b.val + 1)` to `(b+1).val` mod m - exact j_Acol_smul_congr (by simpa using dvd_val_add b 1) τ + exact j_Acol_smul_congr (by simpa only [ZMod.natCast_val, Int.cast_one] using dvd_val_add b 1) τ /-! ## The `S`-permutation @@ -210,12 +213,12 @@ def sSfun (m : ℕ) [Fact m.Prime] : Option (ZMod m) → Option (ZMod m) lemma sSfun_involutive [Fact m.Prime] : Function.Involutive (sSfun m) := by intro i cases i with - | none => simp [sSfun] + | none => simp only [sSfun, ↓reduceIte] | some b => by_cases hb : b = 0 - · simp [sSfun, hb] + · simp only [sSfun, hb, ↓reduceIte] · have hb' : -b⁻¹ ≠ 0 := neg_ne_zero.mpr (inv_ne_zero hb) - simp [sSfun, hb, hb', inv_neg, inv_inv] + simp only [sSfun, hb, ↓reduceIte, hb', inv_neg, inv_inv, neg_neg] /-- The `S`-permutation as an `Equiv.Perm`. -/ def σS (m : ℕ) [Fact m.Prime] : Equiv.Perm (Option (ZMod m)) := sSfun_involutive.toPerm @@ -239,14 +242,16 @@ lemma f_S_smul [Fact m.Prime] (i : Option (ZMod m)) (τ : ℍ) : | some b => by_cases hb : b = 0 · subst hb - have htarget : σS m (some (0 : ZMod m)) = none := by simp [σS, sSfun] + have htarget : σS m (some (0 : ZMod m)) = none := by simp only [σS, + Function.Involutive.coe_toPerm, sSfun, ↓reduceIte] rw [f_some, j_smul_S_mul, htarget, f_none] -- matrix identity Acol 0 · S = S · AInf refine j_matrix_transfer ModularGroup.S _ (AInf m) τ ?_ apply Matrix.GeneralLinearGroup.ext simp [Fin.forall_fin_two, val_AInf, val_Acol, Matrix.mul_apply, Fin.sum_univ_two, ModularGroup.coe_S] - · have htarget : σS m (some b) = some (-b⁻¹) := by simp [σS, sSfun, hb] + · have htarget : σS m (some b) = some (-b⁻¹) := by simp only [σS, + Function.Involutive.coe_toPerm, sSfun, hb, ↓reduceIte] rw [f_some, j_smul_S_mul, htarget, f_some] -- integers B = b.val, B' = (-b⁻¹).val, and the quotient q with B·B' + 1 = m·q set B : ℤ := (b.val : ℤ) with hB diff --git a/LeanPool/Chudnovsky/SingularModuli/FormReduction.lean b/LeanPool/Chudnovsky/SingularModuli/FormReduction.lean index 94e7f848ec..80db160fab 100644 --- a/LeanPool/Chudnovsky/SingularModuli/FormReduction.lean +++ b/LeanPool/Chudnovsky/SingularModuli/FormReduction.lean @@ -45,7 +45,7 @@ open UpperHalfPlane def Equiv (f g : BQF) : Prop := ∃ p q r s : ℤ, p * s - q * r = 1 ∧ act f p q r s = g -@[refl] theorem Equiv.refl (f : BQF) : Equiv f f := ⟨1, 0, 0, 1, by ring, act_one f⟩ +@[refl] theorem Equiv.refl (f : BQF) : Equiv f f := ⟨1, 0, 0, 1, by ac_rfl, act_one f⟩ theorem Equiv.symm {f g : BQF} (h : Equiv f g) : Equiv g f := by obtain ⟨p, q, r, s, hdet, hfg⟩ := h @@ -62,7 +62,7 @@ theorem Equiv.trans {f g h : BQF} (hfg : Equiv f g) (hgh : Equiv g h) : Equiv f /-- The `T`-generator: shift `(a, b, c) ↦ (a, b + 2an, a n² + b n + c)`; preserves the form class and (obviously) the discriminant. -/ -theorem Equiv.T (f : BQF) (n : ℤ) : Equiv f (act f 1 n 0 1) := ⟨1, n, 0, 1, by ring, rfl⟩ +theorem Equiv.T (f : BQF) (n : ℤ) : Equiv f (act f 1 n 0 1) := ⟨1, n, 0, 1, by omega, rfl⟩ lemma act_T_a (f : BQF) (n : ℤ) : (act f 1 n 0 1).a = f.a := by simp lemma act_T_b (f : BQF) (n : ℤ) : (act f 1 n 0 1).b = f.b + 2 * f.a * n := by @@ -71,7 +71,7 @@ lemma act_T_c (f : BQF) (n : ℤ) : (act f 1 n 0 1).c = f.a * n ^ 2 + f.b * n + simp only [act_c]; ring /-- The `S`-generator: swap `(a, b, c) ↦ (c, −b, a)`. -/ -theorem Equiv.S (f : BQF) : Equiv f (act f 0 (-1) 1 0) := ⟨0, -1, 1, 0, by ring, rfl⟩ +theorem Equiv.S (f : BQF) : Equiv f (act f 0 (-1) 1 0) := ⟨0, -1, 1, 0, by ac_rfl, rfl⟩ lemma act_S_a (f : BQF) : (act f 0 (-1) 1 0).a = f.c := by simp lemma act_S_b (f : BQF) : (act f 0 (-1) 1 0).b = -f.b := by simp only [act_b]; ring @@ -80,7 +80,7 @@ lemma act_S_c (f : BQF) : (act f 0 (-1) 1 0).c = f.a := by simp only [act_c]; ri /-- Equivalent forms have equal discriminant. -/ theorem Equiv.disc_eq {f g : BQF} (h : Equiv f g) : disc f = disc g := by obtain ⟨p, q, r, s, hdet, rfl⟩ := h - rw [disc_act, hdet]; ring + rw [disc_act, hdet]; ac_rfl /-- Equivalence preserves primitivity. -/ theorem Equiv.isPrimitive {f g : BQF} (h : Equiv f g) (hf : IsPrimitive f) : IsPrimitive g := by @@ -253,12 +253,12 @@ private lemma reprN_of_relation {m : ℕ} (hm : m ≤ 61) {D0 t l : ℤ} (hD3 : have hsq : lN ^ 2 ≤ 9 ^ 2 := by have : (lN : ℤ) ^ 2 ≤ 9 ^ 2 := by rw [hlNsq]; omega exact_mod_cast this - exact (Nat.pow_le_pow_iff_left (by norm_num)).mp hsq + exact (Nat.pow_le_pow_iff_left (by norm_num1)).mp hsq have htNle : tN < 16 := by have hsq : tN ^ 2 < 16 ^ 2 := by have : (tN : ℤ) ^ 2 < 16 ^ 2 := by rw [htNsq]; omega exact_mod_cast this - exact (Nat.pow_lt_pow_iff_left (by norm_num)).mp hsq + exact (Nat.pow_lt_pow_iff_left (by norm_num1)).mp hsq have htNsq4m : tN ^ 2 ≤ 4 * m := by have : (tN : ℤ) ^ 2 ≤ 4 * (m : ℤ) := by rw [htNsq]; omega exact_mod_cast this @@ -281,9 +281,9 @@ theorem disc_of_three_relations {D0 : ℤ} (hD3 : D0 ≤ -3) {t1 l1 t2 l2 t3 l3 : ℤ} (hl1 : l1 ≠ 0) (hl2 : l2 ≠ 0) (hl3 : l3 ≠ 0) (h1 : t1 ^ 2 - 4 * 41 = D0 * l1 ^ 2) (h2 : t2 ^ 2 - 4 * 43 = D0 * l2 ^ 2) (h3 : t3 ^ 2 - 4 * 61 = D0 * l3 ^ 2) : D0 = -163 := by - have e1 := reprN_of_relation (m := 41) (by norm_num) hD3 hl1 (by exact_mod_cast h1) - have e2 := reprN_of_relation (m := 43) (by norm_num) hD3 hl2 (by exact_mod_cast h2) - have e3 := reprN_of_relation (m := 61) (by norm_num) hD3 hl3 (by exact_mod_cast h3) + have e1 := reprN_of_relation (m := 41) (by norm_num1) hD3 hl1 (by exact_mod_cast h1) + have e2 := reprN_of_relation (m := 43) (by norm_num1) hD3 hl2 (by exact_mod_cast h2) + have e3 := reprN_of_relation (m := 61) (by norm_num1) hD3 hl3 (by exact_mod_cast h3) have hl1sq : (1 : ℤ) ≤ l1 ^ 2 := by rcases lt_or_gt_of_ne hl1 with h' | h' <;> nlinarith have hub : (-D0) ≤ 164 := by nlinarith [h1, hl1sq, sq_nonneg t1] have hmem : (-D0).toNat ∈ Finset.Icc 1 244 := by @@ -318,14 +318,14 @@ theorem isRoot_smul {f g : BQF} {p q r s : ℤ} (hdet : p * s - q * r = 1) have hlin : ((-r : ℤ) : ℂ) * (τ : ℂ) + ((p : ℤ) : ℂ) = 0 := by rw [← h0, hY]; push_cast; ring obtain ⟨hr0, hp0⟩ := int_lin_eq_zero τ hlin have hr : r = 0 := by omega - rw [hr, hp0] at hdet; simp at hdet + rw [hr, hp0] at hdet; simp only [zero_mul, mul_zero, sub_self, zero_ne_one] at hdet have hform : (g.a : ℂ) * X ^ 2 + (g.b : ℂ) * X * Y + (g.c : ℂ) * Y ^ 2 = 0 := by rw [← hg] simp only [act_a, act_b, act_c, hX, hY, IsRoot] at hroot ⊢ push_cast linear_combination ((p : ℂ) * s - q * r) ^ 2 * hroot simp only [IsRoot, hcoe] - field_simp + field_simp (disch := first | assumption | norm_num1 | positivity) linear_combination hform /-- `τ₁₆₃` is the root of the reduced form `(1, −1, 41)` (`41 − τ + τ² = 0`). -/ @@ -341,7 +341,7 @@ theorem isRoot_τ₁₆₃ : IsRoot ⟨1, -1, 41⟩ Chudnovsky.τ₁₆₃ := by rw [hτ]; push_cast linear_combination (Complex.I ^ 2 / 4) * h163 + (163 / 4) * Complex.I_sq -private lemma posdef_1m141 : IsPosDef ⟨1, -1, 41⟩ := ⟨by norm_num, by norm_num [disc]⟩ +private lemma posdef_1m141 : IsPosDef ⟨1, -1, 41⟩ := ⟨by norm_num1, by norm_num only [disc]⟩ /-- **(C6), analytic form.** Every CM point of a positive-definite form of discriminant `−163` is `SL₂(ℤ)`-equivalent to `τ₁₆₃`. -/ @@ -353,7 +353,7 @@ theorem cm_disc_neg163_smul_eq_τ₁₆₃ {f : BQF} (hpd : IsPosDef f) (hdisc : exact ⟨N, root_unique posdef_1m141 hN isRoot_τ₁₆₃⟩ · obtain ⟨N, hN⟩ := isRoot_smul hdet hact hroot have hTact : act (⟨1, 1, 41⟩ : BQF) 1 (-1) 0 1 = ⟨1, -1, 41⟩ := by decide - obtain ⟨N', hN'⟩ := isRoot_smul (by ring : (1 : ℤ) * 1 - (-1) * 0 = 1) hTact hN + obtain ⟨N', hN'⟩ := isRoot_smul (by ac_rfl : (1 : ℤ) * 1 - (-1) * 0 = 1) hTact hN refine ⟨N' * N, ?_⟩ rw [mul_smul] exact root_unique posdef_1m141 hN' isRoot_τ₁₆₃ diff --git a/LeanPool/Chudnovsky/SingularModuli/JFunction.lean b/LeanPool/Chudnovsky/SingularModuli/JFunction.lean index 09fc5a2c21..8b46432cd0 100644 --- a/LeanPool/Chudnovsky/SingularModuli/JFunction.lean +++ b/LeanPool/Chudnovsky/SingularModuli/JFunction.lean @@ -138,15 +138,15 @@ coefficients. These feed the ℤ-refinement `ModularPolynomialZ.lean` downstream /-- Every q-expansion coefficient of `E₄` is an integer (`1` at `n = 0`, `240·σ₃(n)` else). -/ lemma E₄_qExpansion_coeff_int (n : ℕ) : ∃ c : ℤ, (qExpansion 1 E₄).coeff n = (c : ℂ) := by - have h := EisensteinSeries.E_qExpansion_coeff (k := 4) (by norm_num) (by decide) n + have h := EisensteinSeries.E_qExpansion_coeff (k := 4) (by norm_num only) (by decide) n have hb : bernoulli 4 = -1 / 30 := bernoulli_four_value rw [hb, show (4 : ℕ) - 1 = 3 from rfl] at h by_cases hn : n = 0 - · exact ⟨1, by rw [h, ite_eq_left hn]; norm_num⟩ + · exact ⟨1, by rw [h, ite_eq_left hn]; norm_num only⟩ · refine ⟨240 * ArithmeticFunction.sigma 3 n, ?_⟩ rw [h, ite_eq_right hn] push_cast - norm_num + norm_num only /-- Every q-expansion coefficient of the cube `(qExpansion E₄)³` — i.e. of `E₄³` — is an integer. This is the numerator side of `j = E₄³/Δ`. -/ @@ -155,7 +155,7 @@ lemma E₄_qExpansion_pow_three_coeff_int (n : ℕ) : choose c hc using E₄_qExpansion_coeff_int have hmap : qExpansion 1 E₄ = (PowerSeries.mk c).map (Int.castRingHom ℂ) := by ext m - simp [PowerSeries.coeff_map, PowerSeries.coeff_mk, hc m] + simp only [hc m, PowerSeries.coeff_map, PowerSeries.coeff_mk, eq_intCast] refine ⟨((PowerSeries.mk c) ^ 3).coeff n, ?_⟩ rw [hmap, ← map_pow, PowerSeries.coeff_map] rfl @@ -252,10 +252,10 @@ private lemma dvd_1728_coeff (m : ℕ) : have h24 : (24 : ℤ) ∣ PowerSeries.coeff m (sigmaPS 5 - sigmaPS 3) := by rw [map_sub, sigmaPS, sigmaPS, PowerSeries.coeff_mk, PowerSeries.coeff_mk] split_ifs - · simp + · simp only [sub_self, dvd_zero] · exact dvd_sigma_sub m obtain ⟨c, hc⟩ := h24 - exact ⟨14 * c, by rw [hc]; ring⟩ + exact ⟨14 * c, by rw [hc]; ac_rfl⟩ private lemma exists_delta_coeff (m : ℕ) : ∃ t : ℤ, PowerSeries.coeff m (E4Z ^ 3 - E6Z ^ 2) = 1728 * t := dvd_1728_coeff m @@ -306,7 +306,7 @@ theorem qExpansion_discriminant_int : have h1 := congrArg (PowerSeries.coeff m) hsub rw [map_smul, smul_eq_mul, PowerSeries.coeff_map, deltaInt_spec, map_mul, map_ofNat] at h1 rw [PowerSeries.coeff_map] - exact mul_left_cancel₀ (by norm_num : (1728 : ℂ) ≠ 0) h1 + exact mul_left_cancel₀ (by norm_num1 : (1728 : ℂ) ≠ 0) h1 /-- `Δ` vanishes at the cusp: constant q-expansion coefficient `0`. -/ theorem deltaInt_coeff_zero : PowerSeries.coeff 0 deltaInt = 0 := by @@ -348,7 +348,7 @@ theorem constantCoeff_jqInt : PowerSeries.constantCoeff jqInt = 1 := by have h4 : PowerSeries.constantCoeff E4Z = 1 := by simp [E4Z, sigmaPS, PowerSeries.constantCoeff_mk] rw [h4] - simp + simp only [one_pow, inv_one, Units.val_one, mul_one] /-! ### The analytic side: `τ ↦ q τ` and `τ ↦ j τ · q τ` -/ @@ -367,7 +367,7 @@ lemma mdifferentiable_q : MDiff (fun τ : ℍ ↦ q τ) := by have heq : (fun τ : ℍ ↦ q τ) = (fun z : ℂ ↦ Complex.exp (2 * ↑π * Complex.I * z)) ∘ (fun τ : ℍ ↦ (τ : ℂ)) := by funext τ - simp [q_eq, Function.comp] + simp only [q_eq, Function.comp] rw [heq] exact Differentiable.comp_mdifferentiable (by fun_prop) mdifferentiable_coe @@ -390,12 +390,12 @@ private lemma cuspFunction_qfun_eqOn : intro z hz by_cases hz0 : z = 0 · subst hz0 - simpa using isZeroAtImInfty_qfun.cuspFunction_apply_zero one_pos + simpa only [id_eq] using isZeroAtImInfty_qfun.cuspFunction_apply_zero one_pos · have him := Function.Periodic.im_invQParam_pos_of_norm_lt_one one_pos - (by simpa [dist_zero_right] using hz) hz0 - simp [cuspFunction, Function.Periodic.cuspFunction_eq_of_nonzero 1 _ hz0, - ofComplex_apply_of_im_pos him, q, - Function.Periodic.qParam_right_inv one_ne_zero hz0] + (by simpa only [Metric.mem_ball, dist_zero_right] using hz) hz0 + simp only [cuspFunction, q, Function.Periodic.cuspFunction_eq_of_nonzero 1 _ hz0, + Function.comp_apply, ofComplex_apply_of_im_pos him, + Function.Periodic.qParam_right_inv one_ne_zero hz0, id_eq] /-- The q-expansion of the nome itself is the series `X`. -/ private lemma qExpansion_qfun_eq : qExpansion 1 (fun τ : ℍ ↦ q τ) = PowerSeries.X := by @@ -404,14 +404,16 @@ private lemma qExpansion_qfun_eq : qExpansion 1 (fun τ : ℍ ↦ q τ) = PowerS ext m rw [qExpansion_coeff, PowerSeries.coeff_X, Filter.EventuallyEq.iteratedDeriv_eq m heq] match m with - | 0 => simp - | 1 => simp + | 0 => simp only [Nat.factorial_zero, Nat.cast_one, inv_one, iteratedDeriv_zero, id_eq, mul_zero, + zero_ne_one, ↓reduceIte] + | 1 => simp only [Nat.factorial_one, Nat.cast_one, inv_one, iteratedDeriv_one, deriv_id', mul_one, + ↓reduceIte] | (k + 2) => have hconst : iteratedDeriv (k + 2) (id : ℂ → ℂ) 0 = 0 := by rw [iteratedDeriv_succ', deriv_id'] - simp [iteratedDeriv_const] + simp only [iteratedDeriv_const, Nat.add_eq_zero_iff, one_ne_zero, and_false, ↓reduceIte] rw [hconst] - simp + simp only [mul_zero, Nat.reduceEqDiff, ↓reduceIte] /-- `j·q` is invariant under `τ ↦ τ + 1`. -/ private lemma jq_vadd_one (τ : ℍ) : j ((1 : ℝ) +ᵥ τ) * q ((1 : ℝ) +ᵥ τ) = j τ * q τ := by @@ -446,7 +448,7 @@ private lemma isBoundedAtImInfty_jq : IsBoundedAtImInfty (fun τ : ℍ ↦ j τ have hE : IsBoundedAtImInfty ⇑E₄ := ModularFormClass.bdd_at_infty E₄ have hPinv : Filter.Tendsto (fun τ : ℍ ↦ (∏' n : ℕ, (1 - eta_q n ↑τ) ^ 24)⁻¹) atImInfty (nhds 1) := by - simpa using tendsto_atImInfty_tprod_one_sub_eta_q_pow.inv₀ one_ne_zero + simpa only [inv_one] using tendsto_atImInfty_tprod_one_sub_eta_q_pow.inv₀ one_ne_zero have hPb : IsBoundedAtImInfty (fun τ : ℍ ↦ (∏' n : ℕ, (1 - eta_q n ↑τ) ^ 24)⁻¹) := hPinv.isBigO_one ℝ exact Filter.BoundedAtFilter.mul hE (Filter.BoundedAtFilter.mul hE @@ -530,7 +532,7 @@ theorem j_mul_q_qExpansion_coeff_zero : PowerSeries.coeff 0 (qExpansion 1 (fun τ : ℍ ↦ j τ * q τ)) = 1 := by rw [qExpansion_j_mul_q, PowerSeries.coeff_map, PowerSeries.coeff_zero_eq_constantCoeff_apply, constantCoeff_jqInt] - simp + simp only [eq_intCast, Int.cast_one] /-- **(B1) headline, existential packaging**: `j·q ∈ 1 + q·ℤ⟦q⟧` — there are integers `c 0 = 1, c 1 = 744, c 2 = 196884, …` with `j τ · q τ = ∑ c n · q τ ^ n` for all `τ : ℍ`. -/ diff --git a/LeanPool/Chudnovsky/SingularModuli/Kronecker.lean b/LeanPool/Chudnovsky/SingularModuli/Kronecker.lean index 0f2260eb38..4577ddb95b 100644 --- a/LeanPool/Chudnovsky/SingularModuli/Kronecker.lean +++ b/LeanPool/Chudnovsky/SingularModuli/Kronecker.lean @@ -60,7 +60,7 @@ variable {m : ℕ} /-- `q τ → 0` as `Im τ → ∞`. -/ lemma q_tendsto_zero : Tendsto (fun τ : ℍ ↦ q τ) atImInfty (nhds 0) := by - simpa [q] using qParam_tendsto_atImInfty one_pos + simpa only [q] using qParam_tendsto_atImInfty one_pos /-- `j·q` is bounded at the cusp (it tends to `1`); reconstructed from `discriminant = q · ∏ (1 − qⁿ)²⁴` and `j·Δ = E₄³`. -/ @@ -79,7 +79,7 @@ lemma isBoundedAtImInfty_jq' : IsBoundedAtImInfty (fun τ : ℍ ↦ j τ * q τ) rw [hrec] have hE : IsBoundedAtImInfty ⇑E₄ := ModularFormClass.bdd_at_infty E₄ have hPinv : Tendsto (fun τ : ℍ ↦ (∏' n : ℕ, (1 - eta_q n ↑τ) ^ 24)⁻¹) atImInfty (nhds 1) := by - simpa using tendsto_atImInfty_tprod_one_sub_eta_q_pow.inv₀ one_ne_zero + simpa only [inv_one] using tendsto_atImInfty_tprod_one_sub_eta_q_pow.inv₀ one_ne_zero have hPb : IsBoundedAtImInfty (fun τ : ℍ ↦ (∏' n : ℕ, (1 - eta_q n ↑τ) ^ 24)⁻¹) := hPinv.isBigO_one ℝ exact Filter.BoundedAtFilter.mul hE (Filter.BoundedAtFilter.mul hE @@ -96,7 +96,8 @@ lemma jq_tendsto_one : Tendsto (fun τ : ℍ ↦ j τ * q τ) atImInfty (nhds 1) have hcusp0 : cuspFunction 1 (fun τ : ℍ ↦ j τ * q τ) 0 = 1 := by have h := j_mul_q_qExpansion_coeff_zero rw [qExpansion_coeff] at h - simpa using h + simpa only [j_def, Nat.factorial_zero, Nat.cast_one, inv_one, iteratedDeriv_zero, + one_mul] using h have hcomp : Tendsto (fun τ : ℍ ↦ cuspFunction 1 (fun ρ : ℍ ↦ j ρ * q ρ) (q τ)) atImInfty (nhds (cuspFunction 1 (fun τ : ℍ ↦ j τ * q τ) 0)) := hcts.tendsto.comp q_tendsto_zero rw [hcusp0] at hcomp @@ -113,9 +114,11 @@ lemma jq_comp_tendsto_one {A : GL (Fin 2) ℝ} (hA : (A : Matrix (Fin 2) (Fin 2) lemma wParam_tendsto_zero [NeZero m] : Tendsto (fun τ : ℍ ↦ wParam m τ) atImInfty (nhds 0) := by have h : Tendsto (fun τ : ℍ ↦ q (Acol m (0 : ℤ) • τ)) atImInfty (nhds 0) := - q_tendsto_zero.comp (tendsto_smul_atImInfty (g := Acol m (0 : ℤ)) (by simp [val_Acol])) + q_tendsto_zero.comp (tendsto_smul_atImInfty (g := Acol m (0 : ℤ)) (by simp only [Fin.isValue, + val_Acol, Int.cast_zero, Matrix.of_apply, Matrix.cons_val', Matrix.cons_val_zero, + Matrix.cons_val_fin_one, Matrix.cons_val_one])) refine h.congr (fun τ ↦ ?_) - rw [q_Acol_smul]; simp + rw [q_Acol_smul]; simp only [zpow_ofNat, pow_zero, one_mul] /-! ### Per-factor limits of the orbit product -/ @@ -139,18 +142,18 @@ lemma some_factor_tendsto_one [Fact m.Prime] (b : ZMod m) : rw [show (j (Acol m (b.val : ℤ) • τ) * (zetaM m ^ (b.val : ℤ) * wParam m τ)) * (zetaM m ^ (-(b.val : ℤ)) * wParam m τ ^ (m - 1)) = j (Acol m (b.val : ℤ) • τ) * (zetaM m ^ (b.val : ℤ) * zetaM m ^ (-(b.val : ℤ))) - * (wParam m τ * wParam m τ ^ (m - 1)) from by ring, hzz, hww, mul_one] + * (wParam m τ * wParam m τ ^ (m - 1)) from by ac_rfl, hzz, hww, mul_one] have hA : Tendsto (fun τ : ℍ ↦ j (Acol m (b.val : ℤ) • τ) * q (Acol m (b.val : ℤ) • τ)) atImInfty (nhds 1) := jq_comp_tendsto_one (A := Acol m (b.val : ℤ)) (by simp [val_Acol]) have hB : Tendsto (fun τ : ℍ ↦ zetaM m ^ (-(b.val : ℤ)) * wParam m τ ^ (m - 1)) atImInfty (nhds 0) := by have hw : Tendsto (fun τ : ℍ ↦ wParam m τ ^ (m - 1)) atImInfty (nhds 0) := by - simpa [zero_pow (show m - 1 ≠ 0 by omega)] using wParam_tendsto_zero.pow (m - 1) - simpa using tendsto_const_nhds.mul hw + simpa only [zero_pow (show m - 1 ≠ 0 by omega)] using wParam_tendsto_zero.pow (m - 1) + simpa only [ZMod.natCast_val, zpow_neg, mul_zero] using tendsto_const_nhds.mul hw have hmul : Tendsto (fun τ : ℍ ↦ (j (Acol m (b.val : ℤ) • τ) * q (Acol m (b.val : ℤ) • τ)) * (zetaM m ^ (-(b.val : ℤ)) * wParam m τ ^ (m - 1))) atImInfty (nhds 0) := by - simpa using hA.mul hB + simpa only [ZMod.natCast_val, j_def, zpow_neg, mul_zero] using hA.mul hB exact hmul.congr (fun τ ↦ (hkey τ).symm) have hsub : Tendsto (fun τ : ℍ ↦ j τ * q τ - f m (some b) τ * q τ) atImInfty (nhds (1 - 0)) := jq_tendsto_one.sub hfac @@ -166,14 +169,15 @@ lemma none_factor_tendsto_neg_one [Fact m.Prime] : have hjqm : Tendsto (fun τ : ℍ ↦ j τ * q τ ^ m) atImInfty (nhds 0) := by have h1 : Tendsto (fun τ : ℍ ↦ (j τ * q τ) * q τ ^ (m - 1)) atImInfty (nhds (1 * 0)) := jq_tendsto_one.mul (by - simpa [zero_pow (show m - 1 ≠ 0 by omega)] using q_tendsto_zero.pow (m - 1)) + simpa only [zero_pow (show m - 1 ≠ 0 by omega)] using q_tendsto_zero.pow (m - 1)) rw [mul_zero] at h1 refine h1.congr (fun τ ↦ ?_) rw [mul_assoc, ← pow_succ', Nat.sub_add_cancel (show 1 ≤ m by omega)] -- `f_∞ · qᵐ = j(m·τ) · q(m·τ) → 1` have hfnone : Tendsto (fun τ : ℍ ↦ f m none τ * q τ ^ m) atImInfty (nhds 1) := by have hAI : Tendsto (fun τ : ℍ ↦ j (AInf m • τ) * q (AInf m • τ)) atImInfty (nhds 1) := - jq_comp_tendsto_one (A := AInf m) (by simp [val_AInf]) + jq_comp_tendsto_one (A := AInf m) (by simp only [Fin.isValue, val_AInf, Matrix.of_apply, + Matrix.cons_val', Matrix.cons_val_zero, Matrix.cons_val_fin_one, Matrix.cons_val_one]) refine hAI.congr (fun τ ↦ ?_) rw [f_none, q_AInf_smul (m := m), ← wParam_pow_m (m := m) τ, ← pow_mul, pow_two] have hsub : Tendsto (fun τ : ℍ ↦ j τ * q τ ^ m - f m none τ * q τ ^ m) atImInfty (nhds (0 - 1)) := @@ -191,14 +195,15 @@ lemma orbit_prod_tendsto_neg_one [Fact m.Prime] : have h := tendsto_finsetProd (Finset.univ : Finset (ZMod m)) (f := fun b (τ : ℍ) ↦ (j τ - f m (some b) τ) * q τ) (a := fun _ ↦ (1 : ℂ)) (fun b _ ↦ some_factor_tendsto_one b) - simpa using h + simpa only [j_def, f_some, ZMod.natCast_val, prod_const_one] using h have hcombined : Tendsto (fun τ : ℍ ↦ ((j τ - f m none τ) * q τ ^ m) * ∏ b : ZMod m, ((j τ - f m (some b) τ) * q τ)) atImInfty (nhds (-1)) := by - simpa using none_factor_tendsto_neg_one.mul hprod + simpa only [j_def, f_none, f_some, ZMod.natCast_val, + mul_one] using none_factor_tendsto_neg_one.mul hprod refine hcombined.congr (fun τ ↦ ?_) rw [Fintype.prod_option, Finset.prod_mul_distrib, Finset.prod_const, Finset.card_univ, ZMod.card, show 2 * m = m + m from two_mul m, pow_add] - ring + ac_rfl /-! ### The polynomial side -/ @@ -210,18 +215,18 @@ lemma term_tendsto (c : ℂ) (r d : ℕ) (hrd : r ≤ d) : intro τ have hq : q τ ^ d = q τ ^ r * q τ ^ (d - r) := by rw [← pow_add, Nat.add_sub_cancel' hrd] - rw [hq, mul_pow]; ring + rw [hq, mul_pow]; ac_rfl simp_rw [hfun] by_cases h : r = d · subst h simp only [Nat.sub_self, pow_zero, mul_one, ite_true] - simpa using tendsto_const_nhds.mul (jq_tendsto_one.pow r) + simpa only [j_def, one_pow, mul_one] using tendsto_const_nhds.mul (jq_tendsto_one.pow r) · rw [ite_eq_right h] have hqdr : Tendsto (fun τ : ℍ ↦ q τ ^ (d - r)) atImInfty (nhds 0) := by - simpa [zero_pow (show d - r ≠ 0 by omega)] using q_tendsto_zero.pow (d - r) + simpa only [zero_pow (show d - r ≠ 0 by omega)] using q_tendsto_zero.pow (d - r) have h2 : Tendsto (fun τ : ℍ ↦ c * (j τ * q τ) ^ r) atImInfty (nhds c) := by - simpa using tendsto_const_nhds.mul (jq_tendsto_one.pow r) - simpa using h2.mul hqdr + simpa only [j_def, one_pow, mul_one] using tendsto_const_nhds.mul (jq_tendsto_one.pow r) + simpa only [j_def, mul_zero] using h2.mul hqdr /-- `G(j τ)·q^{natDegree G} → (leadingCoeff G : ℂ)`: matching the polynomial against its top `q`-power isolates the leading coefficient. -/ @@ -275,13 +280,13 @@ theorem diagPhiZ_natDegree_and_leadingCoeff [Fact m.Prime] have hshift : Tendsto (fun τ : ℍ ↦ (G.eval₂ (Int.castRingHom ℂ) (j τ) * q τ ^ G.natDegree) * q τ ^ (2 * m - G.natDegree)) atImInfty (nhds (((G.leadingCoeff : ℤ) : ℂ) * 0)) := hB.mul (by - simpa [zero_pow (show 2 * m - G.natDegree ≠ 0 by omega)] + simpa only [zero_pow (show 2 * m - G.natDegree ≠ 0 by omega)] using q_tendsto_zero.pow (2 * m - G.natDegree)) rw [mul_zero] at hshift have h0 : Tendsto (fun τ : ℍ ↦ G.eval₂ (Int.castRingHom ℂ) (j τ) * q τ ^ (2 * m)) atImInfty (nhds 0) := hshift.congr (fun τ ↦ by rw [mul_assoc, ← pow_add, Nat.add_sub_cancel' hlt.le]) - exact absurd (tendsto_nhds_unique h0 hA) (by norm_num) + exact absurd (tendsto_nhds_unique h0 hA) (by norm_num1) · -- `natDegree = 2m` : the two limits agree, so `leadingCoeff = −1` have hBeq : Tendsto (fun τ : ℍ ↦ G.eval₂ (Int.castRingHom ℂ) (j τ) * q τ ^ (2 * m)) atImInfty (nhds ((G.leadingCoeff : ℤ) : ℂ)) := by rw [← heq]; exact hB @@ -291,7 +296,7 @@ theorem diagPhiZ_natDegree_and_leadingCoeff [Fact m.Prime] have hshift : Tendsto (fun τ : ℍ ↦ (G.eval₂ (Int.castRingHom ℂ) (j τ) * q τ ^ (2 * m)) * q τ ^ (G.natDegree - 2 * m)) atImInfty (nhds ((-1 : ℂ) * 0)) := hA.mul (by - simpa [zero_pow (show G.natDegree - 2 * m ≠ 0 by omega)] + simpa only [zero_pow (show G.natDegree - 2 * m ≠ 0 by omega)] using q_tendsto_zero.pow (G.natDegree - 2 * m)) rw [mul_zero] at hshift have h0 : Tendsto (fun τ : ℍ ↦ G.eval₂ (Int.castRingHom ℂ) (j τ) * q τ ^ G.natDegree) atImInfty @@ -304,9 +309,9 @@ theorem diagPhiZ_natDegree_and_leadingCoeff [Fact m.Prime] have hA0 : Tendsto (fun τ : ℍ ↦ G.eval₂ (Int.castRingHom ℂ) (j τ) * q τ ^ (2 * m)) atImInfty (nhds 0) := by have hz : (fun τ : ℍ ↦ G.eval₂ (Int.castRingHom ℂ) (j τ) * q τ ^ (2 * m)) - = fun _ ↦ (0 : ℂ) := by funext τ; rw [hlcZ]; simp + = fun _ ↦ (0 : ℂ) := by funext τ; rw [hlcZ]; simp only [j_def, eval₂_zero, zero_mul] rw [hz]; exact tendsto_const_nhds - exact absurd (tendsto_nhds_unique hA0 hA) (by norm_num) + exact absurd (tendsto_nhds_unique hA0 hA) (by norm_num1) /-- **`natDegree (diagPhiZ PhiZ) = 2·m`.** -/ theorem diagPhiZ_natDegree_eq [Fact m.Prime] {PhiZ : Polynomial (Polynomial ℤ)} diff --git a/LeanPool/Chudnovsky/SingularModuli/MasserA1.lean b/LeanPool/Chudnovsky/SingularModuli/MasserA1.lean index 9facfd96b3..462b6768d9 100644 --- a/LeanPool/Chudnovsky/SingularModuli/MasserA1.lean +++ b/LeanPool/Chudnovsky/SingularModuli/MasserA1.lean @@ -88,7 +88,7 @@ lemma two_tau_sub_one_ne_zero : 2 * (τ₁₆₃ : ℂ) - 1 ≠ 0 := by intro h have := two_tau_sub_one_sq rw [h] at this - norm_num at this + norm_num1 at this /-- The trace-zero fixing matrix `Λ = !![1, −82; 2, −1]` as an element of `GL (Fin 2) ℝ` (determinant `163 > 0`). -/ @@ -99,7 +99,7 @@ def LamGL : GL (Fin 2) ℝ := lemma LamGL_det_pos : 0 < (LamGL).det.val := by rw [Matrix.GeneralLinearGroup.val_det_apply, val_LamGL, Matrix.det_fin_two_of] - norm_num + norm_num1 /-- **`Λ` fixes `τ₁₆₃`** as a Möbius transformation: `(τ − 82)/(2τ − 1) = τ`. -/ lemma LamGL_smul_eq : LamGL • τ₁₆₃ = τ₁₆₃ := by @@ -140,20 +140,20 @@ lemma J_τ₁₆₃_ne_zero : J τ₁₆₃ ≠ 0 := by have h := one_lt_norm_J τ₁₆₃_mem_Region intro hc rw [hc, norm_zero] at h - linarith + linarith only [h] /-- `j₀ := 1728·J(τ₁₆₃) ≠ 0`. -/ lemma j₀_ne_zero : (1728 : ℂ) * J τ₁₆₃ ≠ 0 := - mul_ne_zero (by norm_num) J_τ₁₆₃_ne_zero + mul_ne_zero (by norm_num1) J_τ₁₆₃_ne_zero /-- `j₀ ≠ 1728`: `J(τ₁₆₃) ≠ 1` since `‖J(τ₁₆₃)‖ > 1`. -/ lemma j₀_ne_1728 : (1728 : ℂ) * J τ₁₆₃ ≠ 1728 := by intro hc have hJ1 : J τ₁₆₃ = 1 := - mul_left_cancel₀ (show (1728 : ℂ) ≠ 0 by norm_num) (by rw [hc]; ring) + mul_left_cancel₀ (show (1728 : ℂ) ≠ 0 by norm_num1) (by rw [hc]; ac_rfl) have h := one_lt_norm_J τ₁₆₃_mem_Region rw [hJ1, norm_one] at h - linarith + linarith only [h] /-- `E₆(τ₁₆₃) ≠ 0` (Estimates `E₆_ne_zero_of_mem_Region`). -/ lemma E₆_τ₁₆₃_ne_zero : E₆ τ₁₆₃ ≠ 0 := @@ -174,10 +174,10 @@ lemma E₄_τ₁₆₃_ne_zero : E₄ τ₁₆₃ ≠ 0 := by to fill its `s₂_τ₁₆₃_rational` pin — importing it here would be a cycle). -/ lemma j₀_rational : ∃ r : ℚ, (1728 : ℂ) * J τ₁₆₃ = (r : ℂ) := by have hint : IsIntegral ℤ ((1728 : ℂ) * J τ₁₆₃) := by - have : Fact (Nat.Prime 41) := ⟨by norm_num⟩ - have : NeZero (41 : ℕ) := ⟨by norm_num⟩ + have : Fact (Nat.Prime 41) := ⟨by norm_num1⟩ + have : NeZero (41 : ℕ) := ⟨by norm_num1⟩ obtain ⟨PhiZ, hPhi⟩ := exists_PhiZ_closed (m := 41) - obtain ⟨i, hi⟩ := cm_coset_rel (m := 41) 0 (by norm_num) + obtain ⟨i, hi⟩ := cm_coset_rel (m := 41) 0 (by norm_num1) exact isIntegral_j_of_cm hPhi hi.symm exact j_τ₁₆₃_rational_of j_surjective hint @@ -237,7 +237,7 @@ theorem masser_s₂_rational_of have hrjne : (rj : ℚ) - 1728 ≠ 0 := by rw [sub_ne_zero] intro hc - exact j₀_ne_1728 (by rw [hrj, hc]; norm_num) + exact j₀_ne_1728 (by rw [hrj, hc]; norm_num1) refine ⟨3 * rj * γ + 4 + 3 * rj / (rj - 1728), ?_⟩ rw [key] push_cast @@ -277,7 +277,7 @@ private lemma two_mul_sub_one_ne_zero {z : ℂ} (hz : 0 < z.im) : 2 * z - 1 ≠ have him := congrArg Complex.im h simp only [Complex.sub_im, Complex.mul_im, Complex.one_im, Complex.zero_im] at him norm_num at him - nlinarith [him, hz] + linarith [him, hz] /-- `λ` matches the `GL₂`-action: `↑(Λ • ofComplex z) = λ z` for `z` in the upper half-plane. -/ private lemma coe_LamGL_smul_ofComplex {z : ℂ} (hz : 0 < z.im) : @@ -425,7 +425,7 @@ Masser's proof) used below. -/ private lemma hasDerivAt_poly_comp {P : Polynomial ℂ} {v : ℂ → ℂ} {v' z : ℂ} (hv : HasDerivAt v v' z) : HasDerivAt (fun y ↦ P.eval (v y)) ((P.derivative).eval (v z) * v') z := by - simpa [Function.comp_def] using (P.hasDerivAt (v z)).comp z hv + simpa only [Function.comp_def] using (P.hasDerivAt (v z)).comp z hv private lemma masser_bivariate_derivs (s : Finset ℕ) (p : ℕ → Polynomial ℂ) (u v u' v' : ℂ → ℂ) (t u'' v'' : ℂ) @@ -635,13 +635,13 @@ private lemma masser_F_vanishes {z : ℂ} (hz : 0 < z.im) : private lemma masser_L1 : (163 : ℂ) / (2 * (τ₁₆₃ : ℂ) - 1) ^ 2 = -1 := by rw [two_tau_sub_one_sq] - norm_num + norm_num1 private lemma masserGD_tau_ne_zero : masserGD (τ₁₆₃ : ℂ) ≠ 0 := by rw [masserGD_tau] refine div_ne_zero (mul_ne_zero (neg_ne_zero.mpr two_pi_I_ne_zero) ?_) (E₄_cube_sub_E₆_sq_ne_zero τ₁₆₃) - exact mul_ne_zero (mul_ne_zero (by norm_num) (pow_ne_zero 2 E₄_τ₁₆₃_ne_zero)) E₆_τ₁₆₃_ne_zero + exact mul_ne_zero (mul_ne_zero (by norm_num1) (pow_ne_zero 2 E₄_τ₁₆₃_ne_zero)) E₆_τ₁₆₃_ne_zero /-- **The first- and second-order Taylor relations** extracted from `F ≡ 0` at `τ₁₆₃`: `β₁₀ = β₀₁` (using `Λ′(τ) = −1`, `g′(τ) ≠ 0`) and Masser's identity (105) in the raw form @@ -658,7 +658,7 @@ private lemma masser_relations : intro z hz have h1 := hasDerivAt_cj (masserLam_im_pos hz) have h2 := hasDerivAt_masserLam (two_mul_sub_one_ne_zero hz) - simpa [Function.comp_def] using h1.comp z h2 + simpa only [Function.comp_def] using h1.comp z h2 have hv : ∀ z : ℂ, 0 < z.im → HasDerivAt cj (masserGD z) z := fun z hz ↦ hasDerivAt_cj hz have hu' : HasDerivAt (fun z ↦ masserGD (masserLam z) * (163 / (2 * z - 1) ^ 2)) (masserG2 + masserGD (τ₁₆₃ : ℂ) * (4 / (2 * (τ₁₆₃ : ℂ) - 1))) (τ₁₆₃ : ℂ) := by @@ -666,9 +666,10 @@ private lemma masser_relations : rw [masserLam_tau]; exact hasDerivAt_masserGD have h1 : HasDerivAt (fun z ↦ masserGD (masserLam z)) (masserG2 * (163 / (2 * (τ₁₆₃ : ℂ) - 1) ^ 2)) (τ₁₆₃ : ℂ) := by - simpa [Function.comp_def] using hgd.comp _ (hasDerivAt_masserLam htau_ne) + simpa only [Function.comp_def] using hgd.comp _ (hasDerivAt_masserLam htau_ne) have hlin : HasDerivAt (fun w : ℂ ↦ 2 * w - 1) 2 (τ₁₆₃ : ℂ) := by - simpa using ((hasDerivAt_id ((τ₁₆₃ : ℂ))).const_mul (2 : ℂ)).sub_const 1 + simpa only [hasDerivAt_sub_const_iff, id_eq, + mul_one] using ((hasDerivAt_id ((τ₁₆₃ : ℂ))).const_mul (2 : ℂ)).sub_const 1 have hdiv := (hasDerivAt_const ((τ₁₆₃ : ℂ)) (163 : ℂ)).fun_div (hlin.fun_pow 2) (pow_ne_zero 2 htau_ne) refine (h1.fun_mul hdiv).congr_deriv ?_ @@ -715,9 +716,9 @@ private lemma masser_norm_form_solve {p k : ℤ} (h : p * p - p * k + 41 * (k * (p = 1 ∧ k = 2) ∨ (p = -1 ∧ k = -2) := by -- Completing the square in each variable bounds the finite search. have hk : |k| ≤ 2 := abs_le_of_sq_le_sq - (by nlinarith only [h, sq_nonneg (2 * p - k)]) (by norm_num) + (by linarith only [h, sq_nonneg (2 * p - k)]) (by norm_num1) have hp : |p| ≤ 13 := abs_le_of_sq_le_sq - (by nlinarith only [h, sq_nonneg (p - 82 * k)]) (by norm_num) + (by linarith only [h, sq_nonneg (p - 82 * k)]) (by norm_num1) have hfinite : ∀ p ∈ Finset.Icc (-13 : ℤ) 13, ∀ k ∈ Finset.Icc (-2 : ℤ) 2, p * p - p * k + 41 * (k * k) = 163 → (p = 1 ∧ k = 2) ∨ (p = -1 ∧ k = -2) := by decide +kernel @@ -744,7 +745,7 @@ private lemma masser_fixes_of_coset {e f g : ℤ} (γ : SL(2, ℤ)) {Aτ τ' : push_cast at h0 obtain ⟨hc0, hd0⟩ := QF.int_lin_eq_zero Aτ h0 rw [hc0, hd0] at hdet - simp at hdet + simp only [Fin.isValue, mul_zero, sub_self, zero_ne_one] at hdet rw [eq_div_iff hden, hW] at hco simp only [eq_intCast] at hco simp only [QF.Fixes] @@ -763,7 +764,7 @@ private lemma masser_fixes_pm {p q r s : ℤ} (hfix : QF.Fixes p q r s τ₁₆ push_cast linear_combination τ₁₆₃_sq have hprim : QF.IsPrimitive ⟨1, -1, 41⟩ := fun d hd _ _ ↦ isUnit_of_dvd_one hd - have hpd : QF.IsPosDef ⟨1, -1, 41⟩ := ⟨one_pos, by norm_num [QF.disc]⟩ + have hpd : QF.IsPosDef ⟨1, -1, 41⟩ := ⟨one_pos, by norm_num only [QF.disc]⟩ obtain ⟨k, hr, hsp, hq⟩ := QF.fixes_classification hprim hpd hroot hfix dsimp only at hr hsp hq have heq : p * p - p * k + 41 * (k * k) = 163 := by @@ -784,7 +785,7 @@ private lemma masser_lemmaA1 {i : Option (ZMod 163)} (hi : i ≠ some (81 : ZMod have hj : j (AInf 163 • τ₁₆₃) = j τ₁₆₃ := by rw [← f_none]; exact h obtain ⟨γ, hγ⟩ := j_injective_mod_Γ hj obtain ⟨hfix, hdet⟩ := masser_fixes_of_coset (e := 163) (f := 0) (g := 1) γ - (by rw [coe_AInf_smul]; push_cast; ring) (by norm_num) hγ.symm + (by rw [coe_AInf_smul]; push_cast; ring) (by norm_num1) hγ.symm rcases masser_fixes_pm hfix (by linear_combination hdet) with ⟨hp, _, _, _⟩ | ⟨hp, _, _, _⟩ all_goals omega | some b => @@ -792,7 +793,7 @@ private lemma masser_lemmaA1 {i : Option (ZMod 163)} (hi : i ≠ some (81 : ZMod have hj : j (Acol 163 (b.val : ℤ) • τ₁₆₃) = j τ₁₆₃ := by rw [← f_some]; exact h obtain ⟨γ, hγ⟩ := j_injective_mod_Γ hj obtain ⟨hfix, hdet⟩ := masser_fixes_of_coset (e := 1) (f := (b.val : ℤ)) (g := 163) γ - (by rw [coe_Acol_smul]; push_cast; ring) (by norm_num) hγ.symm + (by rw [coe_Acol_smul]; push_cast; ring) (by norm_num1) hγ.symm have hvlt : (b.val : ℤ) < 163 := by exact_mod_cast ZMod.val_lt b have hvnn : (0 : ℤ) ≤ (b.val : ℤ) := Int.natCast_nonneg _ have hval : (b.val : ℤ) = 81 := by @@ -839,7 +840,7 @@ private lemma mβ10_ne_zero : mβ10 ≠ 0 := by intro i hi exact sub_ne_zero.mpr (Ne.symm (masser_lemmaA1 (Finset.mem_erase.mp hi).1)) intro h0 - exact hne (by rw [h0]; norm_num) + exact hne (by rw [h0]; norm_num1) /-! ### The gate and the unconditional theorem -/ @@ -870,7 +871,7 @@ theorem masser_gate : ∃ γ : ℚ, E₂star τ₁₆₃ push_cast field_simp at hrel ⊢ have hpre : ((π : ℝ) : ℂ) * 1728 * E₄ τ₁₆₃ ≠ 0 := - mul_ne_zero (mul_ne_zero hπ (by norm_num)) h4 + mul_ne_zero (mul_ne_zero hπ (by norm_num1)) h4 have hrel2 : 2 ^ 2 * (((mβ20 : ℚ) : ℂ) - 2 * ((mβ11 : ℚ) : ℂ) + ((mβ02 : ℚ) : ℂ)) * ((π : ℝ) : ℂ) * Complex.I ^ 2 * 1728 * E₄ τ₁₆₃ ^ 3 * E₆ τ₁₆₃ ^ 2 * 3 * ((τ₁₆₃.im : ℝ) : ℂ) diff --git a/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialQ.lean b/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialQ.lean index aa5dc30ae2..7c173d3da2 100644 --- a/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialQ.lean +++ b/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialQ.lean @@ -125,7 +125,7 @@ lemma sum_zetaM_zpow_mul [NeZero m] (n : ℤ) : rw [sum_zmod_eq_range m (fun k ↦ (zetaM m ^ n) ^ k)] by_cases hdvd : (m : ℤ) ∣ n · rw [ite_eq_left hdvd, (zetaM_zpow_eq_one_iff n).mpr hdvd] - simp + simp only [one_pow, sum_const, card_range, nsmul_eq_mul, mul_one] · rw [ite_eq_right hdvd] have hx1 : zetaM m ^ n ≠ 1 := fun h ↦ hdvd ((zetaM_zpow_eq_one_iff n).mp h) rw [geom_sum_eq hx1] @@ -191,7 +191,8 @@ lemma powerSum_smul [Fact m.Prime] (k : ℕ) (γ : SL(2, ℤ)) (τ : ℍ) : /-- Each power sum is holomorphic on `ℍ`. -/ lemma mdifferentiable_powerSum [NeZero m] (k : ℕ) : MDiff (powerSum m k) := by have heq : powerSum m k = ∑ i : Option (ZMod m), (fun τ : ℍ ↦ (f m i τ) ^ k) := by - funext τ; simp [powerSum, Finset.sum_apply] + funext τ; simp only [powerSum, Fintype.sum_option, f_none, j_def, f_some, ZMod.natCast_val, + Finset.sum_apply] rw [heq] exact MDifferentiable.sum (fun i _ ↦ (mdifferentiable_f i).pow k) @@ -246,7 +247,7 @@ lemma mdifferentiable_coeff_prod_X_sub_C {ι : Type*} (a : ι → ℍ → ℂ) intro n have hconst : (fun τ : ℍ ↦ ((∏ i ∈ (∅ : Finset ι), (X - C (a i τ))).coeff n : ℂ)) = fun _ : ℍ ↦ (if n = 0 then (1 : ℂ) else 0) := by - funext τ; simp [coeff_one] + funext τ; simp only [prod_empty, coeff_one] rw [hconst] exact mdifferentiable_const | insert j s hj ih => @@ -453,7 +454,7 @@ theorem Sk_eq_poly_j split · exact hcR · exact R.zero_mem - · simp [natDegree_C] + · simp only [natDegree_C, Std.le_refl] · intro τ; rw [hc τ, eval_C] | succ N ih => intro R h hinv hholo hmero @@ -481,7 +482,7 @@ theorem Sk_eq_poly_j · refine (natDegree_add_le _ _).trans ?_ refine max_le (hP'deg.trans (Nat.le_succ N)) ?_ refine (natDegree_mul_le).trans ?_ - simp [natDegree_C] + simp only [natDegree_C, natDegree_pow, natDegree_X, mul_one, zero_add, Std.le_refl] · intro τ rw [eval_add, eval_mul, eval_C, eval_pow, eval_X, ← hP'eval τ] simp only [hh'_def] @@ -590,15 +591,17 @@ lemma qExpansion_coeff_unique_raw {F : ℍ → ℂ} {c : ℕ → ℂ} have hball2 := hasFPowerSeriesOnBall_cuspFunction one_pos hFan hsum2 have heq := hball1.hasFPowerSeriesAt.eq_formalMultilinearSeries hball2.hasFPowerSeriesAt have hcoeff := congr_arg (fun p : FormalMultilinearSeries ℂ ℂ ℂ ↦ p.coeff n) heq - simpa [FormalMultilinearSeries.coeff_ofScalars] using hcoeff + simpa only [FormalMultilinearSeries.coeff_ofScalars] using hcoeff /-- The cusp function of the constant function `1` is the constant function `1`. -/ lemma cuspFunction_one_eq : cuspFunction 1 (1 : ℍ → ℂ) = 1 := by ext w rcases eq_or_ne w 0 with rfl | hw - · simpa [cuspFunction, Function.Periodic.cuspFunction] + · simpa only [cuspFunction, Function.Periodic.cuspFunction, Pi.one_comp, Function.update_self, + Pi.one_apply] using! tendsto_const_nhds.limUnder_eq - · simp [cuspFunction, Function.Periodic.cuspFunction_eq_of_nonzero 1 _ hw] + · simp only [cuspFunction, Pi.one_comp, Function.Periodic.cuspFunction_eq_of_nonzero 1 _ hw, + Pi.one_apply] /-- Powers preserve cusp-analyticity, and the `q`-expansion of a power is the power of the `q`-expansion. -/ @@ -662,7 +665,8 @@ lemma divByQ {F G : ℍ → ℂ} intro τ have h1 : HasSum (fun k ↦ (qExpansion 1 F).coeff (k + 1) • q τ ^ (k + 1)) (F τ) := by have hraw := (hasSum_nat_add_iff' 1).mpr (hFsum τ) - simpa [Finset.sum_range_one, hF0] using hraw + simpa only [smul_eq_mul, range_one, sum_singleton, hF0, pow_zero, mul_one, + sub_zero] using hraw have h2 := h1.mul_right (q τ)⁻¹ have hsimp : (fun k ↦ ((qExpansion 1 F).coeff (k + 1) • q τ ^ (k + 1)) * (q τ)⁻¹) = fun k ↦ (qExpansion 1 F).coeff (k + 1) • q τ ^ k := by @@ -696,7 +700,7 @@ private lemma isBoundedAtImInfty_jq_recon : IsBoundedAtImInfty (fun τ : ℍ ↦ have hE : IsBoundedAtImInfty ⇑E₄ := ModularFormClass.bdd_at_infty E₄ have hPinv : Filter.Tendsto (fun τ : ℍ ↦ (∏' n : ℕ, (1 - eta_q n ↑τ) ^ 24)⁻¹) atImInfty (nhds 1) := by - simpa using tendsto_atImInfty_tprod_one_sub_eta_q_pow.inv₀ one_ne_zero + simpa only [inv_one] using tendsto_atImInfty_tprod_one_sub_eta_q_pow.inv₀ one_ne_zero have hPb : IsBoundedAtImInfty (fun τ : ℍ ↦ (∏' n : ℕ, (1 - eta_q n ↑τ) ^ 24)⁻¹) := hPinv.isBigO_one ℝ exact Filter.BoundedAtFilter.mul hE (Filter.BoundedAtFilter.mul hE @@ -721,7 +725,7 @@ private lemma isBoundedAtImInfty_jq_pow (n : ℕ) : | succ n ih => have hmul : (fun τ : ℍ ↦ (j τ * q τ) ^ (n + 1)) = (fun τ : ℍ ↦ (j τ * q τ) ^ n) * (fun τ : ℍ ↦ j τ * q τ) := by - funext τ; simp [pow_succ] + funext τ; simp only [j_def, pow_succ, Pi.mul_apply] rw [hmul] exact Filter.BoundedAtFilter.mul ih isBoundedAtImInfty_jq_recon @@ -789,7 +793,7 @@ theorem poleReduction (N : ℕ) (R : Subring ℂ) (h : ℍ → ℂ) have hF0 : (qExpansion 1 (fun τ : ℍ ↦ (h τ - c * (j τ) ^ (N + 1)) * q τ ^ (N + 1))).coeff 0 = 0 := by rw [hFqexp, map_sub, PowerSeries.coeff_smul, hcoeffJ0, hcoeffA0] - simp + simp only [smul_eq_mul, mul_one, sub_self] -- the `G`-side hypotheses of `divByQ` have hGper : Function.Periodic ((fun τ : ℍ ↦ (h τ - c * (j τ) ^ (N + 1)) * q τ ^ N) ∘ ofComplex) 1 := @@ -917,7 +921,7 @@ lemma Fi_some_eq [NeZero m] (k : ℕ) (b : ZMod m) (τ : ℍ) : /-- A function bounded by `1` in norm is bounded at `i∞`. -/ lemma isBoundedAtImInfty_of_norm_le_one {g : ℍ → ℂ} (hg : ∀ τ, ‖g τ‖ ≤ 1) : IsBoundedAtImInfty g := - Asymptotics.isBigO_of_le atImInfty (fun τ ↦ by simpa using hg τ) + Asymptotics.isBigO_of_le atImInfty (fun τ ↦ by simpa only [Pi.one_apply, norm_one] using hg τ) /-- `(j·q)ᵏ` composed with an upper-triangular isogeny `A` (lower-left entry `0`) is bounded at `i∞`, since the isogeny pushes towards the cusp. -/ @@ -943,7 +947,8 @@ lemma isBoundedAtImInfty_powerSum_mul_qpow [Fact m.Prime] (k : ℕ) : | none => change IsBoundedAtImInfty (fun τ : ℍ ↦ (f m none τ) ^ k * q τ ^ (m * k)) rw [funext (fun τ ↦ Fi_none_eq k τ)] - have hAI : (AInf m) 1 0 = 0 := by simp [val_AInf] + have hAI : (AInf m) 1 0 = 0 := by simp only [Fin.isValue, val_AInf, Matrix.of_apply, + Matrix.cons_val', Matrix.cons_val_zero, Matrix.cons_val_fin_one, Matrix.cons_val_one] exact isBoundedAtImInfty_jqPow_comp k (AInf m) hAI | some b => change IsBoundedAtImInfty (fun τ : ℍ ↦ (f m (some b) τ) ^ k * q τ ^ (m * k)) @@ -1039,7 +1044,7 @@ lemma cast_c [NeZero m] (k : ℕ) : (((m ^ 2 - 1) * k : ℕ) : ℤ) = (m : ℤ) ^ 2 * (k : ℤ) - (k : ℤ) := by have hkle : k ≤ m ^ 2 * k := Nat.le_mul_of_pos_left k (pow_pos (Nat.pos_of_ne_zero (NeZero.ne m)) 2) - rw [Nat.sub_one_mul, Nat.cast_sub hkle]; push_cast; ring + rw [Nat.sub_one_mul, Nat.cast_sub hkle]; push_cast; ac_rfl /-- **`q`-expansion of the averaged coset contribution `∑_b (f_b)ᵏ·q^{mk}`.** The root-of-unity average `sum_zetaM_zpow_mul` collapses the `b`-dependence, leaving an honest `q`-series with @@ -1180,7 +1185,7 @@ def polyJ : Subalgebra ℚ (ℍ → ℂ) := (Polynomial.aeval (fun τ : ℍ ↦ lemma aeval_j_apply (Q : Polynomial ℚ) (τ : ℍ) : (Polynomial.aeval (fun τ : ℍ ↦ j τ) Q) τ = Polynomial.aeval (j τ) Q := by have := Polynomial.aeval_algHom_apply (Pi.evalAlgHom ℚ (fun _ : ℍ ↦ ℂ) τ) (fun τ : ℍ ↦ j τ) Q - simpa using this.symm + simpa only [j_def, Pi.evalAlgHom_apply] using this.symm lemma mem_polyJ_iff {g : ℍ → ℂ} : g ∈ polyJ ↔ ∃ Q : Polynomial ℚ, ∀ τ, g τ = Polynomial.aeval (j τ) Q := by @@ -1245,7 +1250,7 @@ lemma esf_mem_polyJ [Fact m.Prime] (l : ℕ) : (fun τ ↦ esf m l τ) ∈ polyJ have hN := newton_esf (m := m) l τ simp only [Pi.mul_apply, Finset.sum_apply, algebraMap_polyJ_apply] push_cast - field_simp + field_simp (disch := first | assumption | norm_num1 | positivity) linear_combination hN rw [hfun] refine mul_mem (Subalgebra.algebraMap_mem _ _) (sum_mem (fun a ha ↦ ?_)) diff --git a/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialZ.lean b/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialZ.lean index 42f0e178c4..c6343fa745 100644 --- a/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialZ.lean +++ b/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialZ.lean @@ -108,11 +108,11 @@ rational `r`, then `x = (m : ℂ)` for some `m : ℤ`. -/ theorem isInt_of_integral_of_rat {x : ℂ} (hint : IsIntegral ℤ x) {r : ℚ} (hr : x = (r : ℂ)) : ∃ m : ℤ, x = (m : ℂ) := by have h1 : IsIntegral ℤ (algebraMap ℚ ℂ r) := by - have hx : algebraMap ℚ ℂ r = x := by rw [hr]; simp + have hx : algebraMap ℚ ℂ r = x := by rw [hr]; simp only [eq_ratCast] rw [hx]; exact hint have h2 : IsIntegral ℤ r := isIntegral_algebraMap_iff.mp h1 obtain ⟨n, hn⟩ := IsIntegrallyClosed.isIntegral_iff.mp h2 - exact ⟨n, by rw [hr, ← hn]; simp⟩ + exact ⟨n, by rw [hr, ← hn]; simp only [algebraMap_int_eq, eq_intCast, Rat.cast_intCast]⟩ /-- **`ℤ[ζ_m] ∩ ℚ = ℤ`, packaged.** A complex number that is integral over `ℤ` (e.g. an element of `ℤ[ζ_m]`) and rational lies in the bottom subring `⊥ ⊆ ℂ` (the image of `ℤ`). This is the @@ -293,7 +293,7 @@ theorem isIntegral_of_kronecker {PhiZ : Polynomial (Polynomial ℤ)} rw [algebraMap_int_eq]; exact hroot · refine ⟨-(diagPhiZ PhiZ), ?_, ?_⟩ · change (-(diagPhiZ PhiZ)).leadingCoeff = 1 - rw [leadingCoeff_neg, h1]; norm_num + rw [leadingCoeff_neg, h1]; norm_num1 · rw [algebraMap_int_eq, eval₂_neg, hroot, neg_zero] end Chudnovsky @@ -329,7 +329,8 @@ lemma GoodQ.ana {h : ℝ} (hh : 0 < h) {R : Subring ℂ} {g : ℍ → ℂ} (hg : lemma GoodQ.add {h : ℝ} (hh : 0 < h) {R : Subring ℂ} {g₁ g₂ : ℍ → ℂ} (h₁ : GoodQ h R g₁) (h₂ : GoodQ h R g₂) : GoodQ h R (fun τ ↦ g₁ τ + g₂ τ) where per := by - have := h₁.per.add h₂.per; simpa [Function.comp_def] using this + have := h₁.per.add h₂.per; simpa only [Function.Periodic, Function.comp_apply, + Function.comp_def, Pi.add_apply] using this holo := h₁.holo.add h₂.holo bdd := h₁.bdd.add h₂.bdd mem n := by @@ -340,7 +341,8 @@ lemma GoodQ.add {h : ℝ} (hh : 0 < h) {R : Subring ℂ} {g₁ g₂ : ℍ → lemma GoodQ.mul {h : ℝ} (hh : 0 < h) {R : Subring ℂ} {g₁ g₂ : ℍ → ℂ} (h₁ : GoodQ h R g₁) (h₂ : GoodQ h R g₂) : GoodQ h R (fun τ ↦ g₁ τ * g₂ τ) where per := by - have := h₁.per.mul h₂.per; simpa [Function.comp_def] using this + have := h₁.per.mul h₂.per; simpa only [Function.Periodic, Function.comp_apply, + Function.comp_def, Pi.mul_apply] using this holo := h₁.holo.mul h₂.holo bdd := h₁.bdd.mul h₂.bdd mem n := by @@ -349,14 +351,14 @@ lemma GoodQ.mul {h : ℝ} (hh : 0 < h) {R : Subring ℂ} {g₁ g₂ : ℍ → exact R.sum_mem (fun p _ ↦ R.mul_mem (h₁.mem p.1) (h₂.mem p.2)) lemma goodQ_one {h : ℝ} (_hh : 0 < h) {R : Subring ℂ} : GoodQ h R (fun _ : ℍ ↦ (1:ℂ)) where - per := by simp + per := by simp only [Function.Periodic, Function.comp_apply, implies_true] holo := mdifferentiable_const bdd := Filter.const_boundedAtFilter atImInfty (1 : ℂ) mem n := by have h1 : (fun _ : ℍ ↦ (1:ℂ)) = (1 : ℍ → ℂ) := rfl rw [h1, qExpansion_one] rcases eq_or_ne n 0 with rfl | hn - · simp + · simp only [PowerSeries.coeff_one, ↓reduceIte, one_mem] · rw [PowerSeries.coeff_one, ite_eq_right hn]; exact R.zero_mem lemma goodQ_smul {h : ℝ} (hh : 0 < h) {R : Subring ℂ} {g : ℍ → ℂ} (hg : GoodQ h R g) @@ -367,30 +369,30 @@ lemma goodQ_smul {h : ℝ} (hh : 0 < h) {R : Subring ℂ} {g : ℍ → ℂ} (hg holo := mdifferentiable_const.mul hg.holo bdd := hg.bdd.const_mul_left c mem n := by - have he : (fun τ ↦ c * g τ) = c • g := by funext τ; simp [Pi.smul_apply, smul_eq_mul] + have he : (fun τ ↦ c * g τ) = c • g := by funext τ; simp only [Pi.smul_apply, smul_eq_mul] rw [he, qExpansion_smul (hg.ana hh) c, PowerSeries.coeff_smul, smul_eq_mul] exact R.mul_mem hc (hg.mem n) lemma goodQ_const {h : ℝ} (hh : 0 < h) {R : Subring ℂ} {c : ℂ} (hc : c ∈ R) : GoodQ h R (fun _ : ℍ ↦ c) := by have := goodQ_smul hh (goodQ_one hh (R := R)) hc - simpa using this + simpa only [mul_one] using this lemma GoodQ.neg {h : ℝ} (hh : 0 < h) {R : Subring ℂ} {g : ℍ → ℂ} (hg : GoodQ h R g) : GoodQ h R (fun τ ↦ - g τ) := by have := goodQ_smul hh hg (c := -1) (R.neg_mem R.one_mem) - simpa using this + simpa only [neg_mul, one_mul] using this lemma GoodQ.sub {h : ℝ} (hh : 0 < h) {R : Subring ℂ} {g₁ g₂ : ℍ → ℂ} (h₁ : GoodQ h R g₁) (h₂ : GoodQ h R g₂) : GoodQ h R (fun τ ↦ g₁ τ - g₂ τ) := by have := h₁.add hh (h₂.neg hh) - simpa [sub_eq_add_neg] using this + simpa only [sub_eq_add_neg] using this /-- `wParam` is holomorphic. -/ lemma mdifferentiable_wParam : MDiff (fun τ : ℍ ↦ wParam m τ) := by have heq : (fun τ : ℍ ↦ wParam m τ) = (fun z : ℂ ↦ Complex.exp (2 * ↑π * Complex.I * z / m)) ∘ (fun τ : ℍ ↦ (τ : ℂ)) := by - funext τ; simp [wParam, Function.comp] + funext τ; simp only [wParam, Function.comp] rw [heq] exact Differentiable.comp_mdifferentiable (by fun_prop) mdifferentiable_coe @@ -398,7 +400,8 @@ lemma mdifferentiable_wParam : MDiff (fun τ : ℍ ↦ wParam m τ) := by lemma isBoundedAtImInfty_jqPow (k : ℕ) : IsBoundedAtImInfty (fun τ : ℍ ↦ (j τ * q τ) ^ k) := by have hA : (1 : GL (Fin 2) ℝ) 1 0 = 0 := by - simp [Matrix.one_apply_ne] + simp only [Fin.isValue, Units.val_one, ne_eq, one_ne_zero, not_false_eq_true, + Matrix.one_apply_ne] have h := isBoundedAtImInfty_jqPow_comp k 1 hA simpa only [one_smul] using h @@ -409,10 +412,10 @@ lemma isBoundedAtImInfty_q : IsBoundedAtImInfty (fun τ : ℍ ↦ q τ) := /-- Powers preserve `GoodQ`. -/ lemma GoodQ.pow {h : ℝ} (hh : 0 < h) {R : Subring ℂ} {g : ℍ → ℂ} (hg : GoodQ h R g) : ∀ k : ℕ, GoodQ h R (fun τ ↦ g τ ^ k) - | 0 => by simpa using goodQ_one hh (R := R) + | 0 => by simpa only [pow_zero] using goodQ_one hh (R := R) | (k+1) => by have := (hg.pow hh k).mul hh hg - simpa [pow_succ] using this + simpa only [pow_succ] using this lemma goodQ_q (R : Subring ℂ) : GoodQ 1 R (fun τ : ℍ ↦ q τ) where per := periodic_comp_ofComplex_of_vadd q_vadd_one @@ -424,8 +427,8 @@ lemma goodQ_q (R : Subring ℂ) : GoodQ 1 R (fun τ : ℍ ↦ q τ) where have := hasSum_ite_eq (1 : ℕ) (q τ) refine this.congr_fun (fun k ↦ ?_) by_cases hk : k = 1 - · subst hk; simp - · simp [hk] + · subst hk; simp only [↓reduceIte, pow_one, smul_eq_mul, one_mul] + · simp only [hk, ↓reduceIte, smul_eq_mul, zero_mul] have := qExpansion_coeff_unique_raw (analyticAt_cuspFunction_zero one_pos (periodic_comp_ofComplex_of_vadd q_vadd_one) mdifferentiable_q isBoundedAtImInfty_q) @@ -438,7 +441,7 @@ lemma goodQ_q (R : Subring ℂ) : GoodQ 1 R (fun τ : ℍ ↦ q τ) where lemma goodQ_jq (R : Subring ℂ) : GoodQ 1 R (fun τ : ℍ ↦ j τ * q τ) where per := periodic_comp_ofComplex_of_vadd (fun τ ↦ by rw [j_vadd_one, q_vadd_one]) holo := mdifferentiable_j_mul_q - bdd := by simpa using isBoundedAtImInfty_jqPow 1 + bdd := by simpa only [j_def, pow_one] using isBoundedAtImInfty_jqPow 1 mem n := by rw [qExpansion_j_mul_q, PowerSeries.coeff_map, eq_intCast (Int.castRingHom ℂ)] exact intCast_mem R _ @@ -451,7 +454,7 @@ lemma goodQ_sum {h : ℝ} (hh : 0 < h) {R : Subring ℂ} {ι : Type*} (s : Finse (hg : ∀ i ∈ s, GoodQ h R (g i)) : GoodQ h R (fun τ ↦ ∑ i ∈ s, g i τ) := by classical induction s using Finset.induction with - | empty => simpa using goodQ_const hh (R := R) R.zero_mem + | empty => simpa only [sum_empty] using goodQ_const hh (R := R) R.zero_mem | @insert a s ha ih => have hrw : (fun τ ↦ ∑ i ∈ insert a s, g i τ) = (fun τ ↦ g a τ + ∑ i ∈ s, g i τ) := by @@ -477,7 +480,7 @@ lemma orbitPoly_coeff_isCuspMeroR_RQ [NeZero m] (n : ℕ) (P : Polynomial ℚ) Finset.sum_mul] refine Finset.sum_congr rfl (fun k hk ↦ ?_) have hk' : k ≤ N := Nat.lt_succ_iff.mp (Finset.mem_range.mp hk) - have hcast : algebraMap ℚ ℂ (P.coeff k) = ((P.coeff k : ℚ) : ℂ) := by simp + have hcast : algebraMap ℚ ℂ (P.coeff k) = ((P.coeff k : ℚ) : ℂ) := by simp only [eq_ratCast] have hdist : (j τ) ^ k * q τ ^ N = (j τ * q τ) ^ k * q τ ^ (N - k) := by rw [mul_pow, mul_assoc, ← pow_add, Nat.add_sub_cancel' hk'] rw [hcast, mul_assoc, hdist] @@ -505,7 +508,7 @@ lemma wExpansion_coeff_unique_raw [NeZero m] {F : ℍ → ℂ} {c : ℕ → ℂ} have hball2 := hasFPowerSeriesOnBall_cuspFunction hm hFan hsum2 have heq := hball1.hasFPowerSeriesAt.eq_formalMultilinearSeries hball2.hasFPowerSeriesAt have hcoeff := congr_arg (fun p : FormalMultilinearSeries ℂ ℂ ℂ ↦ p.coeff n) heq - simpa [FormalMultilinearSeries.coeff_ofScalars] using hcoeff + simpa only [FormalMultilinearSeries.coeff_ofScalars] using hcoeff /-! ## Width-`m` machinery: algebraic integrality of the `w`-expansion -/ @@ -521,28 +524,30 @@ lemma intCast_mem_RI (n : ℤ) : (n : ℂ) ∈ RI := intCast_mem RI n lemma zetaM_mem_RI [NeZero m] : zetaM m ∈ RI := by rw [mem_RI_iff] refine ⟨X ^ m - C 1, monic_X_pow_sub_C 1 (NeZero.ne m), ?_⟩ - simp [zetaM_pow_m] + simp only [algebraMap_int_eq, eq_intCast, Int.cast_one, eval₂_sub, eval₂_X_pow, zetaM_pow_m, + eval₂_one, sub_self] lemma zetaM_zpow_mem_RI [NeZero m] (n : ℤ) : zetaM m ^ n ∈ RI := by rw [mem_RI_iff] refine ⟨X ^ m - C 1, monic_X_pow_sub_C 1 (NeZero.ne m), ?_⟩ have hpow : (zetaM m ^ n) ^ m = 1 := by rw [← zpow_natCast (zetaM m ^ n) m, ← zpow_mul] - exact (zetaM_zpow_eq_one_iff (n * (m : ℤ))).mpr ⟨n, by ring⟩ - simp [hpow] + exact (zetaM_zpow_eq_one_iff (n * (m : ℤ))).mpr ⟨n, by ac_rfl⟩ + simp only [algebraMap_int_eq, eq_intCast, Int.cast_one, eval₂_sub, eval₂_X_pow, hpow, eval₂_one, + sub_self] /-- General period-`p` version of `periodic_comp_ofComplex_of_vadd`. -/ lemma periodic_comp_ofComplex_of_vadd_gen {f : ℍ → ℂ} {p : ℝ} (_hp : 0 < p) (hf : ∀ τ : ℍ, f ((p : ℝ) +ᵥ τ) = f τ) : Function.Periodic (f ∘ ofComplex) p := by intro w rcases lt_or_ge 0 w.im with hw | hw - · have himeq : (w + (p:ℂ)).im = w.im := by simp + · have himeq : (w + (p:ℂ)).im = w.im := by simp only [add_im, ofReal_im, add_zero] have hw1 : 0 < (w + (p:ℂ)).im := by rw [himeq]; exact hw simp only [Function.comp_apply, ofComplex_apply_of_im_pos hw1, ofComplex_apply_of_im_pos hw] have h := hf ⟨w, hw⟩ convert h using 2 apply UpperHalfPlane.ext - rw [UpperHalfPlane.coe_vadd]; simp [add_comm] + rw [UpperHalfPlane.coe_vadd]; simp only [add_comm] · have hw1 : (w + (p:ℂ)).im ≤ 0 := by simp only [Complex.add_im, Complex.ofReal_im, add_zero]; exact hw simp only [Function.comp_apply] @@ -624,7 +629,8 @@ lemma goodQ_G_none [NeZero m] : rw [mul_one] at h rw [show wParam m τ ^ (m ^ 2) = q τ ^ m by have := wParam_pow_mk (m := m) 1 τ; rwa [mul_one, mul_one] at this] - simpa using h + simpa only [f_none, j_def, pow_one, mul_eq_mul_left_iff, mul_eq_zero, OfNat.ofNat_ne_zero, + false_or] using h have hpe : Function.Periodic ((fun τ : ℍ ↦ f m none τ * wParam m τ ^ (m ^ 2)) ∘ ofComplex) (m : ℝ) := periodic_comp_ofComplex_of_vadd_gen hm (fun τ ↦ by rw [f_vadd_m, wParam_vadd_m]) @@ -632,7 +638,9 @@ lemma goodQ_G_none [NeZero m] : (mdifferentiable_f none).mul (mdifferentiable_wParam.pow (m ^ 2)) have hbd : IsBoundedAtImInfty (fun τ : ℍ ↦ f m none τ * wParam m τ ^ (m ^ 2)) := by rw [funext hval] - exact isBoundedAtImInfty_jqPow_comp 1 (AInf m) (by simp [val_AInf]) + exact isBoundedAtImInfty_jqPow_comp 1 (AInf m) (by simp only [Fin.isValue, val_AInf, + Matrix.of_apply, Matrix.cons_val', Matrix.cons_val_zero, Matrix.cons_val_fin_one, + Matrix.cons_val_one]) refine goodQ_of_wHasSum hpe hho hbd (e := fun n ↦ m ^ 2 * n) (a := fun n ↦ ((PowerSeries.coeff n jqInt : ℤ) : ℂ)) (fun a b hab ↦ Nat.eq_of_mul_eq_mul_left (pow_pos (Nat.pos_of_ne_zero (NeZero.ne m)) 2) hab) @@ -686,8 +694,8 @@ lemma goodQ_w [NeZero m] (R : Subring ℂ) : GoodQ (m : ℝ) R (fun τ : ℍ ↦ intro τ refine (hasSum_ite_eq (1 : ℕ) (wParam m τ)).congr_fun (fun k ↦ ?_) by_cases hk : k = 1 - · subst hk; simp - · simp [hk] + · subst hk; simp only [↓reduceIte, pow_one, smul_eq_mul, one_mul] + · simp only [hk, ↓reduceIte, smul_eq_mul, zero_mul] have := wExpansion_coeff_unique_raw (analyticAt_cuspFunction_zero hm (periodic_comp_ofComplex_of_vadd_gen hm wParam_vadd_m) mdifferentiable_wParam isBoundedAtImInfty_wParam) @@ -706,7 +714,8 @@ lemma goodQ_G [NeZero m] (i : Option (ZMod m)) : lemma coeff_linMul_zero (α β : ℂ) (Q : Polynomial ℂ) : ((C α * X - C β) * Q).coeff 0 = -(β * Q.coeff 0) := by - rw [sub_mul, coeff_sub, mul_assoc, coeff_C_mul, coeff_C_mul, coeff_zero_eq_eval_zero]; simp + rw [sub_mul, coeff_sub, mul_assoc, coeff_C_mul, coeff_C_mul, coeff_zero_eq_eval_zero]; simp only [ + eval_mul, eval_X, zero_mul, mul_zero, zero_sub] lemma coeff_linMul_succ (α β : ℂ) (Q : Polynomial ℂ) (k : ℕ) : ((C α * X - C β) * Q).coeff (k + 1) = α * Q.coeff k - β * Q.coeff (k + 1) := by @@ -727,9 +736,9 @@ lemma goodQ_prod_coeff [NeZero m] (s : Finset (Option (ZMod m))) : intro n by_cases hn : n = 0 · refine (goodQ_const hm (show (1:ℂ) ∈ RI from RI.one_mem)).of_eq (fun τ ↦ ?_) - simp [hn] + simp only [map_pow, map_mul, prod_empty, hn, coeff_one_zero] · refine (goodQ_const hm RI.zero_mem).of_eq (fun τ ↦ ?_) - simp [Finset.prod_empty, coeff_one, hn] + simp only [map_pow, map_mul, prod_empty, coeff_one, hn, ↓reduceIte] | @insert a s ha ih => intro n cases n with diff --git a/LeanPool/Chudnovsky/SingularModuli/QuadraticPoints.lean b/LeanPool/Chudnovsky/SingularModuli/QuadraticPoints.lean index 0217c0375e..7b133511bf 100644 --- a/LeanPool/Chudnovsky/SingularModuli/QuadraticPoints.lean +++ b/LeanPool/Chudnovsky/SingularModuli/QuadraticPoints.lean @@ -243,7 +243,7 @@ theorem fixes_classification {f : BQF} (hf : IsPrimitive f) (hpd : IsPosDef f) obtain ⟨u, v, w, huvw⟩ := bezout_of_primitive hf have hdvd : f.a ∣ r := by refine ⟨u * r + v * (s - p) + w * (-q), ?_⟩ - have hr : r * (u * f.a + v * f.b + w * f.c) = r := by rw [huvw]; ring + have hr : r * (u * f.a + v * f.b + w * f.c) = r := by rw [huvw]; ac_rfl linear_combination -hr + v * hr1 + w * hr2 obtain ⟨k, hk⟩ := hdvd refine ⟨k, hk.trans (mul_comm _ _), ?_, ?_⟩ diff --git a/LeanPool/Chudnovsky/SingularModuli/Rationality.lean b/LeanPool/Chudnovsky/SingularModuli/Rationality.lean index 2532c520a1..017af57a75 100644 --- a/LeanPool/Chudnovsky/SingularModuli/Rationality.lean +++ b/LeanPool/Chudnovsky/SingularModuli/Rationality.lean @@ -112,7 +112,7 @@ def cmGL (n : ℤ) : GL (Fin 2) ℝ := lemma cmGL_det_pos (n : ℤ) : 0 < (cmGL n).det.val := by rw [Matrix.GeneralLinearGroup.val_det_apply, val_cmGL, Matrix.det_fin_two_of] - nlinarith [sq_nonneg (2 * (n : ℝ) + 1)] + linarith [sq_nonneg (2 * (n : ℝ) + 1)] /-- **`M_n` fixes `τ₁₆₃`** as a Möbius transformation. -/ lemma cmGL_smul_eq (n : ℤ) : cmGL n • τ₁₆₃ = τ₁₆₃ := by @@ -157,7 +157,7 @@ lemma cm_coset_rel (n : ℤ) [NeZero m] (hm : (m : ℤ) = n ^ 2 + n + 41) : have hdvd : (m : ℤ) ∣ ((n : ZMod m).val : ℤ) - n := by rw [← ZMod.intCast_zmod_eq_zero_iff_dvd] push_cast [ZMod.natCast_val, ZMod.intCast_cast, ZMod.ringHom_map_cast] - simp + simp only [dvd_refl, ZMod.cast_intCast, sub_self] rw [j_Acol_smul_congr hdvd τ₁₆₃] exact cm_coset_val n hm @@ -313,7 +313,7 @@ lemma fixes_of_coset {e f g : ℤ} (γ : SL(2, ℤ)) {Aτ τ' : ℍ} simp only [eq_intCast] at h0 push_cast at h0 obtain ⟨hc0, hd0⟩ := QF.int_lin_eq_zero Aτ h0 - rw [hc0, hd0] at hdet; simp at hdet + rw [hc0, hd0] at hdet; simp only [Fin.isValue, mul_zero, sub_self, zero_ne_one] at hdet rw [eq_div_iff hden, hW] at hco simp only [eq_intCast] at hco simp only [QF.Fixes] @@ -335,14 +335,14 @@ lemma exists_fixes_of_coincidence [Fact m.Prime] {τ' : ℍ} {i : Option (ZMod m obtain ⟨γ, hγ⟩ := j_injective_mod_Γ hj obtain ⟨p, q, r, s, hfix, hdet⟩ := fixes_of_coset (e := (m : ℤ)) (f := 0) (g := 1) γ - (by rw [coe_AInf_smul]; push_cast; ring) (by norm_num) hγ.symm + (by rw [coe_AInf_smul]; push_cast; ring) (by norm_num only) hγ.symm exact ⟨p, q, r, s, hfix, by rw [hdet]; ring⟩ | some b => have hj : j (Acol m (b.val : ℤ) • τ') = j τ' := by rw [← f_some]; exact h obtain ⟨γ, hγ⟩ := j_injective_mod_Γ hj obtain ⟨p, q, r, s, hfix, hdet⟩ := fixes_of_coset (e := 1) (f := (b.val : ℤ)) (g := (m : ℤ)) γ - (by rw [coe_Acol_smul]; push_cast; ring) (by exact_mod_cast hmpos.ne') hγ.symm + (by rw [coe_Acol_smul]; push_cast; ring) (by exact Nat.cast_ne_zero.mpr hmpos.ne') hγ.symm exact ⟨p, q, r, s, hfix, by rw [hdet]; ring⟩ /-- **(C4), packaged.** A coset coincidence at `τ′` produces a positive-definite integer form @@ -397,9 +397,9 @@ theorem cm_bridge {τ' : ℍ} (h43 : ∃ i : Option (ZMod 43), f 43 i τ' = j τ') (h61 : ∃ i : Option (ZMod 61), f 61 i τ' = j τ') : ∃ M : SL(2, ℤ), M • τ' = τ₁₆₃ := by - have : Fact (Nat.Prime 41) := ⟨by norm_num⟩ - have : Fact (Nat.Prime 43) := ⟨by norm_num⟩ - have : Fact (Nat.Prime 61) := ⟨by norm_num⟩ + have : Fact (Nat.Prime 41) := ⟨by norm_num1⟩ + have : Fact (Nat.Prime 43) := ⟨by norm_num1⟩ + have : Fact (Nat.Prime 61) := ⟨by norm_num1⟩ obtain ⟨i41, hi41⟩ := h41 obtain ⟨i43, hi43⟩ := h43 obtain ⟨i61, hi61⟩ := h61 @@ -457,12 +457,12 @@ lemma phi_coincidence (n : ℤ) (mm : ℕ) [NeZero mm] [Fact mm.Prime] (hm : (mm `j τ₁₆₃`, the value `j τ₁₆₃` is rational. -/ theorem j_τ₁₆₃_rational_of (hsurj : Function.Surjective (j : ℍ → ℂ)) (hint : IsIntegral ℤ (j τ₁₆₃)) : ∃ r : ℚ, j τ₁₆₃ = (r : ℂ) := by - have : NeZero (41 : ℕ) := ⟨by norm_num⟩ - have : NeZero (43 : ℕ) := ⟨by norm_num⟩ - have : NeZero (61 : ℕ) := ⟨by norm_num⟩ - have : Fact (Nat.Prime 41) := ⟨by norm_num⟩ - have : Fact (Nat.Prime 43) := ⟨by norm_num⟩ - have : Fact (Nat.Prime 61) := ⟨by norm_num⟩ + have : NeZero (41 : ℕ) := ⟨by norm_num1⟩ + have : NeZero (43 : ℕ) := ⟨by norm_num1⟩ + have : NeZero (61 : ℕ) := ⟨by norm_num1⟩ + have : Fact (Nat.Prime 41) := ⟨by norm_num1⟩ + have : Fact (Nat.Prime 43) := ⟨by norm_num1⟩ + have : Fact (Nat.Prime 61) := ⟨by norm_num1⟩ set j₀ : ℂ := j τ₁₆₃ with hj0 -- `j₀` is integral (hence algebraic) over `ℚ`. have hintQ : IsIntegral ℚ j₀ := by @@ -474,9 +474,9 @@ theorem j_τ₁₆₃_rational_of (hsurj : Function.Surjective (j : ℍ → ℂ) have hallroots : ∀ x : ℂ, (aeval x) (minpoly ℚ j₀) = 0 → x = j₀ := by intro x hx obtain ⟨τ', hτ'⟩ := hsurj x - have h41 := phi_coincidence 0 41 (by norm_num) hx hτ' - have h43 := phi_coincidence 1 43 (by norm_num) hx hτ' - have h61 := phi_coincidence 4 61 (by norm_num) hx hτ' + have h41 := phi_coincidence 0 41 (by norm_num1) hx hτ' + have h43 := phi_coincidence 1 43 (by norm_num1) hx hτ' + have h61 := phi_coincidence 4 61 (by norm_num1) hx hτ' obtain ⟨M, hM⟩ := cm_bridge h41 h43 h61 rw [← hτ', hj0, ← hM, j_smul] -- Finish: all roots equal `j₀`, so `j₀` is rational (Vieta on the subleading coefficient). diff --git a/LeanPool/Chudnovsky/SingularModuli/Valence.lean b/LeanPool/Chudnovsky/SingularModuli/Valence.lean index f087862e34..b96c6b7ee7 100644 --- a/LeanPool/Chudnovsky/SingularModuli/Valence.lean +++ b/LeanPool/Chudnovsky/SingularModuli/Valence.lean @@ -85,7 +85,7 @@ theorem exists_smul_mem_fd_j (τ : ℍ) : theorem j_eq_iff_J (τ₁ τ₂ : ℍ) : j τ₁ = j τ₂ ↔ J τ₁ = J τ₂ := by rw [j_def, j_def] constructor - · exact fun h ↦ mul_left_cancel₀ (by norm_num : (1728 : ℂ) ≠ 0) h + · exact fun h ↦ mul_left_cancel₀ (by norm_num1 : (1728 : ℂ) ≠ 0) h · exact fun h ↦ by rw [h] /-- `j τ₁ = j τ₂` iff Klein's absolute invariants of the lattices `L_{τ₁}`, `L_{τ₂}` agree. @@ -140,8 +140,8 @@ theorem exists_units_smul_g₂_g₃ (L₁ L₂ : PeriodPair) suffices h : ∃ α : ℂ, α ≠ 0 ∧ (α ^ 4)⁻¹ * L₂.g₂ = L₁.g₂ ∧ (α ^ 6)⁻¹ * L₂.g₃ = L₁.g₃ by obtain ⟨α, hα, h2, h3⟩ := h refine ⟨Units.mk0 α hα, ?_, ?_⟩ - · rw [PeriodPair.g₂_smul]; simpa using h2 - · rw [PeriodPair.g₃_smul]; simpa using h3 + · rw [PeriodPair.g₂_smul]; simpa only [Units.val_mk0] using h2 + · rw [PeriodPair.g₃_smul]; simpa only [Units.val_mk0] using h3 by_cases ha2 : L₁.g₂ = 0 · -- `J₁ = 0`, so `L₂.g₂ = 0`; match the `g₃`'s by a 6th root. have ha3 : L₁.g₃ ≠ 0 := fun h ↦ hd₁ (by simp [PeriodPair.discr, ha2, h]) @@ -150,12 +150,12 @@ theorem exists_units_smul_g₂_g₃ (L₁ L₂ : PeriodPair) have : L₂.g₂ ^ 3 = 0 := by rcases mul_eq_zero.mp hz with h | h · exact h - · exact absurd (pow_eq_zero_iff (by norm_num) |>.mp h) ha3 - exact pow_eq_zero_iff (by norm_num) |>.mp this + · exact absurd (pow_eq_zero_iff (by norm_num1) |>.mp h) ha3 + exact pow_eq_zero_iff (by norm_num1) |>.mp this have hb3 : L₂.g₃ ≠ 0 := fun h ↦ hd₂ (by simp [PeriodPair.discr, hb2, h]) - obtain ⟨α, hα6⟩ := IsAlgClosed.exists_pow_nat_eq (L₂.g₃ / L₁.g₃) (n := 6) (by norm_num) + obtain ⟨α, hα6⟩ := IsAlgClosed.exists_pow_nat_eq (L₂.g₃ / L₁.g₃) (n := 6) (by norm_num1) have hαne : α ≠ 0 := by - rintro rfl; rw [zero_pow (by norm_num)] at hα6 + rintro rfl; rw [zero_pow (by norm_num1)] at hα6 exact (div_ne_zero hb3 ha3) hα6.symm refine ⟨α, hαne, ?_, ?_⟩ · rw [ha2, hb2]; ring @@ -166,13 +166,13 @@ theorem exists_units_smul_g₂_g₃ (L₁ L₂ : PeriodPair) have hz : L₁.g₂ ^ 3 * L₂.g₃ ^ 2 = 0 := by rw [hR, ha3]; ring have : L₂.g₃ ^ 2 = 0 := by rcases mul_eq_zero.mp hz with h | h - · exact absurd (pow_eq_zero_iff (by norm_num) |>.mp h) ha2 + · exact absurd (pow_eq_zero_iff (by norm_num1) |>.mp h) ha2 · exact h - exact pow_eq_zero_iff (by norm_num) |>.mp this + exact pow_eq_zero_iff (by norm_num1) |>.mp this have hb2 : L₂.g₂ ≠ 0 := fun h ↦ hd₂ (by simp [PeriodPair.discr, h, hb3]) - obtain ⟨α, hα4⟩ := IsAlgClosed.exists_pow_nat_eq (L₂.g₂ / L₁.g₂) (n := 4) (by norm_num) + obtain ⟨α, hα4⟩ := IsAlgClosed.exists_pow_nat_eq (L₂.g₂ / L₁.g₂) (n := 4) (by norm_num1) have hαne : α ≠ 0 := by - rintro rfl; rw [zero_pow (by norm_num)] at hα4 + rintro rfl; rw [zero_pow (by norm_num1)] at hα4 exact (div_ne_zero hb2 ha2) hα4.symm refine ⟨α, hαne, ?_, ?_⟩ · rw [hα4, inv_div, div_mul_cancel₀ _ hb2] @@ -184,9 +184,9 @@ theorem exists_units_smul_g₂_g₃ (L₁ L₂ : PeriodPair) have hz : L₁.g₂ ^ 3 * L₂.g₃ ^ 2 = 0 := by rw [hR, h]; ring have : L₂.g₃ ^ 2 = 0 := by rcases mul_eq_zero.mp hz with h' | h' - · exact absurd (pow_eq_zero_iff (by norm_num) |>.mp h') ha2 + · exact absurd (pow_eq_zero_iff (by norm_num1) |>.mp h') ha2 · exact h' - exact pow_eq_zero_iff (by norm_num) |>.mp this + exact pow_eq_zero_iff (by norm_num1) |>.mp this exact hd₂ (by simp [PeriodPair.discr, h, hb3z]) have hb3 : L₂.g₃ ≠ 0 := by intro h @@ -194,28 +194,28 @@ theorem exists_units_smul_g₂_g₃ (L₁ L₂ : PeriodPair) have : L₂.g₂ ^ 3 = 0 := by rcases mul_eq_zero.mp hz with h' | h' · exact h' - · exact absurd (pow_eq_zero_iff (by norm_num) |>.mp h') ha3 - exact hb2 (pow_eq_zero_iff (by norm_num) |>.mp this) + · exact absurd (pow_eq_zero_iff (by norm_num1) |>.mp h') ha3 + exact hb2 (pow_eq_zero_iff (by norm_num1) |>.mp this) -- `u = g₂₂/g₂₁`, `v = g₃₂/g₃₁`, and `u³ = v²`; pick `α` with `α² = v/u`. have hcube : (L₂.g₂ / L₁.g₂) ^ 3 = (L₂.g₃ / L₁.g₃) ^ 2 := by - field_simp + field_simp (disch := first | assumption | norm_num1 | positivity) linear_combination -hR obtain ⟨α, hα2⟩ := - IsAlgClosed.exists_pow_nat_eq ((L₂.g₃ / L₁.g₃) / (L₂.g₂ / L₁.g₂)) (n := 2) (by norm_num) + IsAlgClosed.exists_pow_nat_eq ((L₂.g₃ / L₁.g₃) / (L₂.g₂ / L₁.g₂)) (n := 2) (by norm_num1) have hu : L₂.g₂ / L₁.g₂ ≠ 0 := div_ne_zero hb2 ha2 have hv : L₂.g₃ / L₁.g₃ ≠ 0 := div_ne_zero hb3 ha3 have hαne : α ≠ 0 := by - rintro rfl; rw [zero_pow (by norm_num)] at hα2 + rintro rfl; rw [zero_pow (by norm_num1)] at hα2 exact (div_ne_zero hv hu) hα2.symm -- `α⁴ = (v/u)² = u` and `α⁶ = (v/u)³ = v`. have h4 : α ^ 4 = L₂.g₂ / L₁.g₂ := by have : α ^ 4 = (α ^ 2) ^ 2 := by ring rw [this, hα2, div_pow, ← hcube] - field_simp + field_simp (disch := first | assumption | norm_num1 | positivity) have h6 : α ^ 6 = L₂.g₃ / L₁.g₃ := by have : α ^ 6 = (α ^ 2) ^ 3 := by ring rw [this, hα2, div_pow, hcube] - field_simp + field_simp (disch := first | assumption | norm_num1 | positivity) refine ⟨α, hαne, ?_, ?_⟩ · rw [h4, inv_div, div_mul_cancel₀ _ hb2] · rw [h6, inv_div, div_mul_cancel₀ _ hb3] @@ -226,7 +226,7 @@ theorem exists_units_smul_g₂_g₃ (L₁ L₂ : PeriodPair) theorem discr_Lτ_ne_zero (τ : ℍ) : (Lτ τ).discr ≠ 0 := by rw [discr_Lτ] refine mul_ne_zero ?_ (E₄_cube_sub_E₆_sq_ne_zero τ) - refine div_ne_zero (pow_ne_zero _ ?_) (by norm_num) + refine div_ne_zero (pow_ne_zero _ ?_) (by norm_num1) simp [Real.pi_ne_zero] /- @@ -357,7 +357,7 @@ theorem weierstrassP_eventuallyEq_of_g₂_g₃ (L₁ L₂ : PeriodPair) intro L t have h := L.weierstrassPExcept_add (0 : L.lattice) t simp only [ZeroMemClass.coe_zero, sub_zero] at h - have h0 : (1 : ℂ) / (0 : ℂ) ^ 2 = 0 := by norm_num + have h0 : (1 : ℂ) / (0 : ℂ) ^ 2 = 0 := by norm_num1 rw [h0, sub_zero] at h linear_combination h -- `HasDerivAt` facts, reconstructed from the analyticity lemmas @@ -436,7 +436,7 @@ theorem weierstrassP_eventuallyEq_of_g₂_g₃ (L₁ L₂ : PeriodPair) induction m using Nat.strongRecOn with | ind m IH => rcases eq_or_ne m 0 with rfl | hm0 - · simp [iteratedDeriv_zero, hwdef] + · simp only [hwdef, iteratedDeriv_zero, PeriodPair.weierstrassPExcept_zero, sub_self] rcases eq_or_ne m 1 with rfl | hm1 · rw [hwdef, iteratedDeriv_fun_sub hf₁.contDiffAt hf₂.contDiffAt, L₁.iteratedDeriv_weierstrassPExcept_self 0, L₂.iteratedDeriv_weierstrassPExcept_self 0] @@ -447,7 +447,7 @@ theorem weierstrassP_eventuallyEq_of_g₂_g₃ (L₁ L₂ : PeriodPair) have hG6 : L₁.G 6 = L₂.G 6 := by have e : (140 : ℂ) * L₁.G 6 = 140 * L₂.G 6 := by have hh := h3; simp only [PeriodPair.g₃] at hh; exact hh - exact mul_left_cancel₀ (by norm_num) e + exact mul_left_cancel₀ (by norm_num1) e rw [hwdef, iteratedDeriv_fun_sub hf₁.contDiffAt hf₂.contDiffAt, L₁.iteratedDeriv_weierstrassPExcept_self 0, L₂.iteratedDeriv_weierstrassPExcept_self 0, L₁.sumInvPow_zero, L₂.sumInvPow_zero] @@ -495,7 +495,7 @@ theorem weierstrassP_eventuallyEq_of_g₂_g₃ (L₁ L₂ : PeriodPair) rw [hfac] refine mul_ne_zero (sub_ne_zero.mpr ?_) ?_ · exact_mod_cast hm4 - · have hc3 : ((m : ℂ) + 3) = ((m + 3 : ℕ) : ℂ) := by push_cast; ring + · have hc3 : ((m : ℂ) + 3) = ((m + 3 : ℕ) : ℂ) := by push_cast; ac_rfl rw [hc3]; exact_mod_cast (by omega : m + 3 ≠ 0) exact (mul_eq_zero.mp hcoef).resolve_left hne -- Part B: `w` vanishes to infinite order, hence identically near `0` @@ -507,7 +507,7 @@ theorem weierstrassP_eventuallyEq_of_g₂_g₃ (L₁ L₂ : PeriodPair) have hwloc : ∀ᶠ z in 𝓝[≠] (0 : ℂ), w z = 0 := hworder.filter_mono nhdsWithin_le_nhds filter_upwards [hwloc] with z hz have hfe : L₁.weierstrassPExcept 0 z = L₂.weierstrassPExcept 0 z := by - rw [hwdef] at hz; simpa [sub_eq_zero] using hz + rw [hwdef] at hz; simpa only [sub_eq_zero] using hz rw [hPexc L₁ z, hPexc L₂ z] at hfe linear_combination hfe @@ -530,7 +530,7 @@ lemma lattice_subset_of_eqOn (L₁ L₂ : PeriodPair) simp only [Set.mem_compl_iff, Set.mem_union, not_or] refine ⟨?_, hzB⟩ intro hzL1 - exact hzA ⟨hzL1, fun hh => hzne (by simpa using hh)⟩ + exact hzA ⟨hzL1, fun hh => hzne (by simpa only [Set.mem_singleton_iff] using hh)⟩ have hord1 : meromorphicOrderAt L₁.weierstrassP ω = -2 := L₁.order_weierstrassP ω hω1 have hnn : 0 ≤ meromorphicOrderAt L₂.weierstrassP ω := (L₂.analyticOnNhd_weierstrassP ω hω2).meromorphicOrderAt_nonneg @@ -547,7 +547,7 @@ theorem lattice_eq_of_weierstrassP_eventuallyEq (L₁ L₂ : PeriodPair) have hScount : S.Countable := (lattice_countable L₁).union (lattice_countable L₂) have hUconn : IsPreconnected Sᶜ := (hScount.isConnected_compl_of_one_lt_rank - (by rw [Complex.rank_real_complex]; norm_num)).isPreconnected + (by rw [Complex.rank_real_complex]; norm_num1)).isPreconnected have hUdense : Dense Sᶜ := hScount.dense_compl ℝ have ha1 : AnalyticOnNhd ℂ L₁.weierstrassP Sᶜ := (L₁.analyticOnNhd_weierstrassP).mono @@ -586,7 +586,7 @@ lemma orient_eq {b s t : ℂ} {m₁ n₁ m₂ n₂ : ℤ} have e : starRingEnd ℂ b * (b * t) = ↑(Complex.normSq b) * t := by rw [← mul_assoc, ← Complex.normSq_eq_conj_mul_self] have hcb : starRingEnd ℂ b = ↑m₁ + ↑n₁ * starRingEnd ℂ s := by - rw [h1]; simp + rw [h1]; simp only [map_add, map_intCast, map_mul] rw [hcb, h2] at e have him := congrArg Complex.im e simp only [Complex.mul_im, Complex.add_im, Complex.add_re, Complex.intCast_im, @@ -605,10 +605,12 @@ theorem exists_sl2_of_lattice_eq {σ₁ σ₂ : ℍ} {a : ℂˣ} -- Forward direction: `a` and `a·σ₂` lie in `Lτ σ₁`'s lattice have ha_mem : (↑a : ℂ) ∈ (Lτ σ₁).lattice := by rw [hlat, PeriodPair.mem_smul_lattice_iff] - exact ⟨1, PeriodPair.mem_lattice.mpr ⟨1, 0, by simp⟩, by rw [mul_one]⟩ + exact ⟨1, PeriodPair.mem_lattice.mpr ⟨1, 0, by simp only [Int.cast_one, Lτ_ω₁, mul_one, + Int.cast_zero, Lτ_ω₂, zero_mul, add_zero]⟩, by rw [mul_one]⟩ have hb_mem : (↑a : ℂ) * ↑σ₂ ∈ (Lτ σ₁).lattice := by rw [hlat, PeriodPair.mem_smul_lattice_iff] - exact ⟨↑σ₂, PeriodPair.mem_lattice.mpr ⟨0, 1, by simp⟩, rfl⟩ + exact ⟨↑σ₂, PeriodPair.mem_lattice.mpr ⟨0, 1, by simp only [Int.cast_zero, Lτ_ω₁, mul_one, + Int.cast_one, Lτ_ω₂, one_mul, zero_add]⟩, rfl⟩ obtain ⟨m₁, n₁, hA⟩ := PeriodPair.mem_lattice.mp ha_mem obtain ⟨m₂, n₂, hB⟩ := PeriodPair.mem_lattice.mp hb_mem simp only [Lτ_ω₁, Lτ_ω₂, mul_one] at hA hB @@ -620,21 +622,25 @@ theorem exists_sl2_of_lattice_eq {σ₁ σ₂ : ℍ} {a : ℂˣ} rw [PeriodPair.mem_smul_lattice_iff] constructor · intro hz - refine ⟨(↑a : ℂ) * z, ?_, by rw [← mul_assoc]; simp⟩ + refine ⟨(↑a : ℂ) * z, ?_, by rw [← mul_assoc]; simp only [Units.val_inv_eq_inv_val, ne_eq, + Units.ne_zero, not_false_eq_true, inv_mul_cancel₀, one_mul]⟩ rw [hlat, PeriodPair.mem_smul_lattice_iff] exact ⟨z, hz, rfl⟩ · rintro ⟨w, hw, rfl⟩ rw [hlat, PeriodPair.mem_smul_lattice_iff] at hw obtain ⟨w', hw', rfl⟩ := hw rw [← mul_assoc] - simpa using hw' + simpa only [Units.val_inv_eq_inv_val, ne_eq, Units.ne_zero, not_false_eq_true, + inv_mul_cancel₀, one_mul] using hw' -- Reverse direction: `a⁻¹` and `a⁻¹·σ₁` lie in `Lτ σ₂`'s lattice have ha'_mem : ((a⁻¹ : ℂˣ) : ℂ) ∈ (Lτ σ₂).lattice := by rw [hlat2, PeriodPair.mem_smul_lattice_iff] - exact ⟨1, PeriodPair.mem_lattice.mpr ⟨1, 0, by simp⟩, by rw [mul_one]⟩ + exact ⟨1, PeriodPair.mem_lattice.mpr ⟨1, 0, by simp only [Int.cast_one, Lτ_ω₁, mul_one, + Int.cast_zero, Lτ_ω₂, zero_mul, add_zero]⟩, by rw [mul_one]⟩ have hb'_mem : ((a⁻¹ : ℂˣ) : ℂ) * ↑σ₁ ∈ (Lτ σ₂).lattice := by rw [hlat2, PeriodPair.mem_smul_lattice_iff] - exact ⟨↑σ₁, PeriodPair.mem_lattice.mpr ⟨0, 1, by simp⟩, rfl⟩ + exact ⟨↑σ₁, PeriodPair.mem_lattice.mpr ⟨0, 1, by simp only [Int.cast_zero, Lτ_ω₁, mul_one, + Int.cast_one, Lτ_ω₂, one_mul, zero_add]⟩, rfl⟩ obtain ⟨m₁', n₁', hA'⟩ := PeriodPair.mem_lattice.mp ha'_mem obtain ⟨m₂', n₂', hB'⟩ := PeriodPair.mem_lattice.mp hb'_mem simp only [Lτ_ω₁, Lτ_ω₂, mul_one] at hA' hB' @@ -660,7 +666,8 @@ theorem exists_sl2_of_lattice_eq {σ₁ σ₂ : ℍ} {a : ℂˣ} -- product of `normSq`s is `1` have hnprod : Complex.normSq (↑a : ℂ) * Complex.normSq ((a⁻¹ : ℂˣ) : ℂ) = 1 := by rw [← Complex.normSq_mul] - simp + simp only [Units.val_inv_eq_inv_val, ne_eq, Units.ne_zero, not_false_eq_true, mul_inv_cancel₀, + map_one] -- product of the determinants is `1` have hprodR : (((m₁ * n₂ - n₁ * m₂ : ℤ) : ℝ) * ((m₁' * n₂' - n₁' * m₂' : ℤ) : ℝ)) * ((↑σ₁ : ℂ).im * (↑σ₂ : ℂ).im) = (↑σ₁ : ℂ).im * (↑σ₂ : ℂ).im := by @@ -691,7 +698,7 @@ theorem exists_sl2_of_lattice_eq {σ₁ σ₂ : ℍ} {a : ℂˣ} refine ⟨γ, ?_⟩ rw [← UpperHalfPlane.coe_inj, coe_specialLinearGroup_apply] have hden : (↑n₁ : ℂ) * ↑σ₁ + ↑m₁ ≠ 0 := by - have : (↑n₁ : ℂ) * ↑σ₁ + ↑m₁ = ↑a := by rw [h1]; ring + have : (↑n₁ : ℂ) * ↑σ₁ + ↑m₁ = ↑a := by rw [h1]; ac_rfl rw [this]; exact a.ne_zero change (↑σ₂ : ℂ) = _ simp only [hγ, hM, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.cons_val', @@ -739,12 +746,12 @@ of `ℂ`. for the open mapping theorem). Uses the cusp bracketing `theonaeherJ_lower`/`theonaeherJ_upper`: at `im = 3` the lower bound `0.737·e^{6π}` exceeds the upper bound `1.321·e^{4π}` at `im = 2`. -/ theorem j_two_values : ∃ τ₁ τ₂ : ℍ, j τ₁ ≠ j τ₂ := by - set τa : ℍ := UpperHalfPlane.mk ⟨0, 3⟩ (by norm_num) with hτa - set τb : ℍ := UpperHalfPlane.mk ⟨0, 2⟩ (by norm_num) with hτb + set τa : ℍ := UpperHalfPlane.mk ⟨0, 3⟩ (by norm_num1) with hτa + set τb : ℍ := UpperHalfPlane.mk ⟨0, 2⟩ (by norm_num1) with hτb have hima : τa.im = 3 := rfl have himb : τb.im = 2 := rfl - have hRa : τa ∈ Region := by rw [Region, Set.mem_ofPred_eq, hima]; norm_num - have hRb : τb ∈ Region := by rw [Region, Set.mem_ofPred_eq, himb]; norm_num + have hRa : τa ∈ Region := by rw [Region, Set.mem_ofPred_eq, hima]; norm_num1 + have hRb : τb ∈ Region := by rw [Region, Set.mem_ofPred_eq, himb]; norm_num1 refine ⟨τa, τb, ?_⟩ have hlow := theonaeherJ_lower hRa have hup := theonaeherJ_upper hRb @@ -760,7 +767,7 @@ theorem j_two_values : ∃ τ₁ τ₂ : ℍ, j τ₁ ≠ j τ₂ := by linarith only [hae, Real.pi_gt_three] have hE : Real.exp (-(2 * π)) ≤ 1 / 7 := by rw [Real.exp_neg, inv_eq_one_div] - exact one_div_le_one_div_of_le (by norm_num) h7 + exact one_div_le_one_div_of_le (by norm_num1) h7 have hBpos : 0 < Real.exp (-(2 * π * 2)) := Real.exp_pos _ rw [e1, mul_left_comm, mul_comm (0.737 : ℝ)] exact mul_le_mul_of_nonneg_left (by linarith only [hE]) hBpos.le @@ -873,7 +880,7 @@ theorem isClosed_range_j : IsClosed (Set.range (j : ℍ → ℂ)) := by have him2 : z.im ≤ M := hz.2.2.2 have habs : ‖z‖ ≤ |z.re| + |z.im| := Complex.norm_le_abs_re_add_abs_im z have himabs : |z.im| ≤ |M| := by - rw [abs_of_nonneg (le_trans (by norm_num) him1)] + rw [abs_of_nonneg (le_trans (by norm_num1) him1)] exact him2.trans (le_abs_self M) exact habs.trans (add_le_add hre himabs) have hKc_compact : IsCompact Kc := @@ -885,12 +892,12 @@ theorem isClosed_range_j : IsClosed (Set.range (j : ℍ → ℂ)) := by · rw [UpperHalfPlane.coe_im]; exact him_ge n · rw [UpperHalfPlane.coe_im]; exact him_le n obtain ⟨a, haKc, φ, hφmono, hφlim⟩ := hKc_compact.tendsto_subseq hmem - have haim : (0 : ℝ) < a.im := lt_of_lt_of_le (by norm_num) haKc.2.2.1 + have haim : (0 : ℝ) < a.im := lt_of_lt_of_le (by norm_num1) haKc.2.2.1 set τstar : ℍ := UpperHalfPlane.mk a haim with hτstar have hcoe : (τstar : ℂ) = a := rfl have htend : Filter.Tendsto (fun k => τ (φ k)) Filter.atTop (𝓝 τstar) := by rw [UpperHalfPlane.isEmbedding_coe.tendsto_nhds_iff] - simpa [Function.comp_def, hcoe] using hφlim + simpa only [Function.comp_def, hcoe] using hφlim have hjcont : Continuous (j : ℍ → ℂ) := mdifferentiable_j.continuous have htendj : Filter.Tendsto (fun k => j (τ (φ k))) Filter.atTop (𝓝 (j τstar)) := (hjcont.tendsto τstar).comp htend @@ -909,7 +916,7 @@ theorem j_surjective : Function.Surjective (j : ℍ → ℂ) := by intro w have hcl : IsClopen (Set.range (j : ℍ → ℂ)) := ⟨isClosed_range_j, isOpen_range_j⟩ have hne : (Set.range (j : ℍ → ℂ)).Nonempty := - ⟨j (UpperHalfPlane.mk ⟨0, 1⟩ (by norm_num)), Set.mem_range_self _⟩ + ⟨j (UpperHalfPlane.mk ⟨0, 1⟩ (by norm_num1)), Set.mem_range_self _⟩ have hall : Set.range (j : ℍ → ℂ) = Set.univ := hcl.eq_univ hne have hw : w ∈ Set.range (j : ℍ → ℂ) := hall ▸ Set.mem_univ w exact hw diff --git a/LeanPool/Chudnovsky/WeierstrassMore.lean b/LeanPool/Chudnovsky/WeierstrassMore.lean index 12e7b92aa2..66d2cafba7 100644 --- a/LeanPool/Chudnovsky/WeierstrassMore.lean +++ b/LeanPool/Chudnovsky/WeierstrassMore.lean @@ -72,7 +72,7 @@ theorem notMem_lattice_of_mem_fund {z : ℂ} (hz : z ∈ L.fundamentalParallelog rw [mem_lattice] at hlat obtain ⟨m, n, hmn⟩ := hlat have hmn' : (s : ℂ) * L.ω₁ + (t : ℂ) * L.ω₂ = (m : ℂ) * L.ω₁ + (n : ℂ) * L.ω₂ := by - rw [hmn]; simp [Complex.real_smul] + rw [hmn]; simp only [Complex.real_smul] have key : (s - (m : ℝ)) • L.ω₁ + (t - (n : ℝ)) • L.ω₂ = 0 := by simp only [sub_smul, Complex.real_smul] push_cast @@ -94,7 +94,7 @@ theorem notMem_lattice_of_mem_fund {z : ℂ} (hz : z ∈ L.fundamentalParallelog omega apply hz0 rw [← hs, ← ht, hm0, hn0] - simp + simp only [Int.cast_zero, zero_smul, add_zero] /-- `℘ - c` has a pole of order `2` at each lattice point. -/ theorem meromorphicOrderAt_weierstrassP_sub {c : ℂ} {l₀ : ℂ} (h : l₀ ∈ L.lattice) : @@ -113,7 +113,7 @@ theorem meromorphicOrderAt_weierstrassP_sub {c : ℂ} {l₀ : ℂ} (h : l₀ ∈ /-- `℘ - c` is an elliptic function. -/ theorem isEllipticWith_weierstrassP_sub (c : ℂ) : L.IsEllipticWith (fun z => ℘[L] z - c) := - ⟨by fun_prop, fun z l => by simp⟩ + ⟨by fun_prop, fun z l => by simp only [weierstrassP_add_coe]⟩ /-- **Counting bound** from the third Liouville theorem: the elliptic function `℘ - c` has, counted with multiplicity, at most `2` zeros in the fundamental parallelogram, since @@ -139,7 +139,8 @@ theorem sum_untop₀_meromorphicOrderAt_le_two (c : ℂ) (A : Finset ℂ) have hLiou : ∑ z ∈ T, (meromorphicOrderAt f z).untop₀ = 0 := hell.sum_meromorphicOrderAt_eq_zero h0 have hfund0 : (0 : ℂ) ∈ L.fundamentalParallelogram := - ⟨0, Set.left_mem_Ico.mpr zero_lt_one, 0, Set.left_mem_Ico.mpr zero_lt_one, by simp⟩ + ⟨0, Set.left_mem_Ico.mpr zero_lt_one, 0, Set.left_mem_Ico.mpr zero_lt_one, by simp only [ + zero_smul, add_zero]⟩ have hord0 : meromorphicOrderAt f (0 : ℂ) = -2 := by rw [hf_def, L.meromorphicOrderAt_weierstrassP_sub L.lattice.zero_mem] have h0T : (0 : ℂ) ∈ T := (hmemT 0).mpr ⟨hfund0, by rw [hord0]; decide⟩ @@ -156,7 +157,7 @@ theorem sum_untop₀_meromorphicOrderAt_le_two (c : ℂ) (A : Finset ℂ) refine ⟨hane, (hmemT a).mpr ⟨hAf a ha, ?_⟩⟩ have hAn : AnalyticAt ℂ f a := by rw [hf_def]; have := L.analyticOnNhd_weierstrassP a (hAl a ha); fun_prop - have hfa : f a = 0 := by rw [hf_def]; simp [hAz a ha] + have hfa : f a = 0 := by rw [hf_def]; simp only [hAz a ha, sub_self] rw [hAn.meromorphicOrderAt_eq] intro hcontra exact hAn.analyticOrderAt_ne_zero.mpr hfa (ENat.map_natCast_eq_zero.mp hcontra) @@ -181,14 +182,14 @@ theorem two_le_untop₀_meromorphicOrderAt {c : ℂ} {a : ℂ} (ha : a ∉ L.lat set f : ℂ → ℂ := fun z => ℘[L] z - c with hf_def have hAn : AnalyticAt ℂ f a := by rw [hf_def]; have := L.analyticOnNhd_weierstrassP a ha; fun_prop - have hfa : f a = 0 := by rw [hf_def]; simp [hc] + have hfa : f a = 0 := by rw [hf_def]; simp only [hc, sub_self] have hderiv' : deriv f a = 0 := by rw [hf_def, deriv_sub_const, L.deriv_weierstrassP]; exact hderiv have h2 : (2 : ℕ) ≤ analyticOrderAt f a := by rw [natCast_le_analyticOrderAt_iff_iteratedDeriv_eq_zero hAn] intro i hi interval_cases i - · simpa [iteratedDeriv_zero] using hfa + · simpa only [iteratedDeriv_zero] using hfa · rw [iteratedDeriv_one]; exact hderiv' have hne : meromorphicOrderAt f a ≠ ⊤ := by have hmero : Meromorphic f := by rw [hf_def]; fun_prop @@ -220,7 +221,7 @@ theorem half_ne_half {a b a' b' : ℝ} (h : ¬ (a = a' ∧ b = b')) : a • L.ω₁ + b • L.ω₂ ≠ a' • L.ω₁ + b' • L.ω₂ := by intro he have he' : (a : ℂ) * L.ω₁ + (b : ℂ) * L.ω₂ = (a' : ℂ) * L.ω₁ + (b' : ℂ) * L.ω₂ := by - simpa [Complex.real_smul] using he + simpa only [Complex.real_smul] using he have key : (a - a') • L.ω₁ + (b - b') • L.ω₂ = 0 := by simp only [sub_smul, Complex.real_smul]; linear_combination he' obtain ⟨h1, h2⟩ := LinearIndependent.pair_iff.mp L.indep _ _ key @@ -256,37 +257,43 @@ theorem weierstrassP_ne_of_half {p q : ℂ} /-- Membership of `ω₁/2` in the fundamental parallelogram. -/ private theorem mem_fund_ω₁_div_two : L.ω₁ / 2 ∈ L.fundamentalParallelogram := - ⟨1 / 2, ⟨by norm_num, by norm_num⟩, 0, ⟨le_refl 0, zero_lt_one⟩, by - simp [Complex.real_smul]; ring⟩ + ⟨1 / 2, ⟨by norm_num1, by norm_num1⟩, 0, ⟨le_refl 0, zero_lt_one⟩, by + simp only [one_div, Complex.real_smul, Complex.ofReal_inv, Complex.ofReal_ofNat, zero_smul, + add_zero]; ac_rfl⟩ private theorem mem_fund_ω₂_div_two : L.ω₂ / 2 ∈ L.fundamentalParallelogram := - ⟨0, ⟨le_refl 0, zero_lt_one⟩, 1 / 2, ⟨by norm_num, by norm_num⟩, by - simp [Complex.real_smul]; ring⟩ + ⟨0, ⟨le_refl 0, zero_lt_one⟩, 1 / 2, ⟨by norm_num1, by norm_num1⟩, by + simp only [zero_smul, one_div, Complex.real_smul, Complex.ofReal_inv, Complex.ofReal_ofNat, + zero_add]; ac_rfl⟩ private theorem mem_fund_add_div_two : (L.ω₁ + L.ω₂) / 2 ∈ L.fundamentalParallelogram := - ⟨1 / 2, ⟨by norm_num, by norm_num⟩, 1 / 2, ⟨by norm_num, by norm_num⟩, by - simp [Complex.real_smul]; ring⟩ + ⟨1 / 2, ⟨by norm_num1, by norm_num1⟩, 1 / 2, ⟨by norm_num1, by norm_num1⟩, by + simp only [one_div, Complex.real_smul, Complex.ofReal_inv, Complex.ofReal_ofNat]; ring⟩ private theorem ω₁_div_two_ne_ω₂_div_two : L.ω₁ / 2 ≠ L.ω₂ / 2 := by have h := L.half_ne_half (a := 1 / 2) (b := 0) (a' := 0) (b' := 1 / 2) (by norm_num) rwa [show (1 / 2 : ℝ) • L.ω₁ + (0 : ℝ) • L.ω₂ = L.ω₁ / 2 by - simp [Complex.real_smul]; ring, + simp only [one_div, Complex.real_smul, Complex.ofReal_inv, Complex.ofReal_ofNat, zero_smul, + add_zero]; ac_rfl, show (0 : ℝ) • L.ω₁ + (1 / 2 : ℝ) • L.ω₂ = L.ω₂ / 2 by - simp [Complex.real_smul]; ring] at h + simp only [zero_smul, one_div, Complex.real_smul, Complex.ofReal_inv, Complex.ofReal_ofNat, + zero_add]; ac_rfl] at h private theorem ω₁_div_two_ne_add_div_two : L.ω₁ / 2 ≠ (L.ω₁ + L.ω₂) / 2 := by have h := L.half_ne_half (a := 1 / 2) (b := 0) (a' := 1 / 2) (b' := 1 / 2) (by norm_num) rwa [show (1 / 2 : ℝ) • L.ω₁ + (0 : ℝ) • L.ω₂ = L.ω₁ / 2 by - simp [Complex.real_smul]; ring, + simp only [one_div, Complex.real_smul, Complex.ofReal_inv, Complex.ofReal_ofNat, zero_smul, + add_zero]; ac_rfl, show (1 / 2 : ℝ) • L.ω₁ + (1 / 2 : ℝ) • L.ω₂ = (L.ω₁ + L.ω₂) / 2 by - simp [Complex.real_smul]; ring] at h + simp only [one_div, Complex.real_smul, Complex.ofReal_inv, Complex.ofReal_ofNat]; ring] at h private theorem ω₂_div_two_ne_add_div_two : L.ω₂ / 2 ≠ (L.ω₁ + L.ω₂) / 2 := by have h := L.half_ne_half (a := 0) (b := 1 / 2) (a' := 1 / 2) (b' := 1 / 2) (by norm_num) rwa [show (0 : ℝ) • L.ω₁ + (1 / 2 : ℝ) • L.ω₂ = L.ω₂ / 2 by - simp [Complex.real_smul]; ring, + simp only [zero_smul, one_div, Complex.real_smul, Complex.ofReal_inv, Complex.ofReal_ofNat, + zero_add]; ac_rfl, show (1 / 2 : ℝ) • L.ω₁ + (1 / 2 : ℝ) • L.ω₂ = (L.ω₁ + L.ω₂) / 2 by - simp [Complex.real_smul]; ring] at h + simp only [one_div, Complex.real_smul, Complex.ofReal_inv, Complex.ofReal_ofNat]; ring] at h /-- The half-lattice values are pairwise distinct: `e₁ ≠ e₂`. -/ theorem e₁_ne_e₂ : L.e₁ ≠ L.e₂ := @@ -401,7 +408,7 @@ theorem derivWeierstrassP_eq_zero_iff {z : ℂ} (hz : z ∉ L.lattice) : rw [hderiv0] at h have h4 : (4 : ℂ) * ((℘[L] z - L.e₁) * (℘[L] z - L.e₂) * (℘[L] z - L.e₃)) = 0 := by linear_combination -h - exact (mul_eq_zero.mp h4).resolve_left (by norm_num) + exact (mul_eq_zero.mp h4).resolve_left (by norm_num1) -- If `℘ p = e_k` but `p ≠ ω_k/2`, we get 4 zeros vs 2 poles, contradiction. have finish : ∀ q ω : ℂ, ω ∈ L.lattice → q = ω / 2 → q ∈ L.fundamentalParallelogram → q ∉ L.lattice → ℘'[L] q = 0 → From 4fb25a024210bb37077f2b6cded5bd4a00ae72c7 Mon Sep 17 00:00:00 2001 From: Vasily Ilin Date: Fri, 13 Nov 2026 17:27:49 +0000 Subject: [PATCH 2/3] Refine convergence proofs and retain measured tactic improvements --- LeanPool/Chudnovsky/Basic.lean | 4 +- LeanPool/Chudnovsky/BernoulliValues.lean | 2 +- LeanPool/Chudnovsky/Chudnovsky.lean | 16 +-- LeanPool/Chudnovsky/Clausen.lean | 75 ++++++------- LeanPool/Chudnovsky/Coefficients.lean | 16 +-- LeanPool/Chudnovsky/ComplexMult.lean | 30 +++-- LeanPool/Chudnovsky/DivisionValues.lean | 77 ++++++------- LeanPool/Chudnovsky/Estimates.lean | 106 +++++++++--------- LeanPool/Chudnovsky/Fourier.lean | 23 ++-- LeanPool/Chudnovsky/Kummer.lean | 28 ++--- LeanPool/Chudnovsky/Liouville.lean | 21 ++-- LeanPool/Chudnovsky/MainTheorem.lean | 34 +++--- LeanPool/Chudnovsky/Numerics.lean | 34 +++--- LeanPool/Chudnovsky/Quasiperiods.lean | 9 +- LeanPool/Chudnovsky/Ramanujan.lean | 32 +++--- LeanPool/Chudnovsky/SigmaZeta.lean | 4 +- LeanPool/Chudnovsky/SingularModuli.lean | 6 +- .../SingularModuli/CMRelations.lean | 8 +- .../Chudnovsky/SingularModuli/CosetOrbit.lean | 14 +-- .../SingularModuli/FormReduction.lean | 24 ++-- .../Chudnovsky/SingularModuli/JFunction.lean | 6 +- .../Chudnovsky/SingularModuli/MasserA1.lean | 35 +++--- .../SingularModuli/ModularPolynomialQ.lean | 10 +- .../SingularModuli/ModularPolynomialZ.lean | 30 ++--- .../SingularModuli/QuadraticPoints.lean | 4 +- .../SingularModuli/Rationality.lean | 26 ++--- .../Chudnovsky/SingularModuli/Valence.lean | 51 ++++----- LeanPool/Chudnovsky/WeierstrassMore.lean | 15 ++- 28 files changed, 352 insertions(+), 388 deletions(-) diff --git a/LeanPool/Chudnovsky/Basic.lean b/LeanPool/Chudnovsky/Basic.lean index c4e9f8feb3..311a7c8b9a 100644 --- a/LeanPool/Chudnovsky/Basic.lean +++ b/LeanPool/Chudnovsky/Basic.lean @@ -118,10 +118,10 @@ def Region : Set ℍ := {τ : ℍ | 5 / 4 < τ.im} lemma τ₁₆₃_mem_Region : τ₁₆₃ ∈ Region := by simp only [Region, Set.mem_ofPred_eq, τ₁₆₃_im] - nlinarith [Real.sq_sqrt (by norm_num1 : (163 : ℝ) ≥ 0).le, Real.sqrt_nonneg (163 : ℝ)] + nlinarith only [Real.sq_sqrt (by norm_num : (163 : ℝ) ≥ 0).le, Real.sqrt_nonneg (163 : ℝ)] lemma τ₈_mem_Region : τ₈ ∈ Region := by simp only [Region, Set.mem_ofPred_eq, τ₈_im] - nlinarith [Real.sq_sqrt (by norm_num1 : (2 : ℝ) ≥ 0).le, Real.sqrt_nonneg (2 : ℝ)] + nlinarith only [Real.sq_sqrt (by norm_num : (2 : ℝ) ≥ 0).le, Real.sqrt_nonneg (2 : ℝ)] end Chudnovsky diff --git a/LeanPool/Chudnovsky/BernoulliValues.lean b/LeanPool/Chudnovsky/BernoulliValues.lean index 7f3a498641..eca6bdecd8 100644 --- a/LeanPool/Chudnovsky/BernoulliValues.lean +++ b/LeanPool/Chudnovsky/BernoulliValues.lean @@ -21,7 +21,7 @@ namespace Chudnovsky /-- The fourth Bernoulli number, using the known value of `bernoulli'`. -/ lemma bernoulli_four_value : bernoulli 4 = -1 / 30 := by rw [bernoulli, bernoulli'_four] - norm_num1 + norm_num /-- The sixth Bernoulli number, evaluated from the preceding values. -/ lemma bernoulli_six_value : bernoulli 6 = 1 / 42 := by diff --git a/LeanPool/Chudnovsky/Chudnovsky.lean b/LeanPool/Chudnovsky/Chudnovsky.lean index 5645cdbfc0..b95b28ccb4 100644 --- a/LeanPool/Chudnovsky/Chudnovsky.lean +++ b/LeanPool/Chudnovsky/Chudnovsky.lean @@ -47,9 +47,9 @@ theorem summable_chudnovskyTerm : Summable fun n : ℕ ↦ (chudnovskyTerm n : -- Comparison against `(545140134·n + 13591409)·rⁿ` with `r = 1728/640320³ < 1`. set r : ℝ := 1728 / 640320 ^ 3 with hr_def have hr : ‖r‖ < 1 := by - rw [Real.norm_eq_abs, abs_of_nonneg (by positivity)]; rw [hr_def]; norm_num1 + rw [Real.norm_eq_abs, abs_of_nonneg (by positivity)]; rw [hr_def]; norm_num have hg1 : Summable (fun n : ℕ => (n : ℝ) * r ^ n) := by - simpa only [pow_one] using summable_pow_mul_geometric_of_norm_lt_one 1 hr + simpa using summable_pow_mul_geometric_of_norm_lt_one 1 hr have hg0 : Summable (fun n : ℕ => r ^ n) := summable_geometric_of_norm_lt_one hr have hg : Summable (fun n : ℕ => (545140134 * (n : ℝ) + 13591409) * r ^ n) := by have hrw : (fun n : ℕ => (545140134 * (n : ℝ) + 13591409) * r ^ n) @@ -72,7 +72,7 @@ theorem summable_chudnovskyTerm : Summable fun n : ℕ ↦ (chudnovskyTerm n : have key : ((6*n)! : ℝ) ≤ 1728^n * (((3*n)! : ℝ) * (n ! )^3) := by have h := factorial_six_bound n calc ((6*n)! : ℝ) ≤ ((1728^n * ((3*n)! * (n ! )^3) : ℕ) : ℝ) := by exact_mod_cast h - _ = 1728^n * (((3*n)! : ℝ) * (n ! )^3) := by push_cast; ac_rfl + _ = 1728^n * (((3*n)! : ℝ) * (n ! )^3) := by push_cast; ring have hApos : (0:ℝ) ≤ 545140134*(n:ℝ)+13591409 := by positivity have hrpow : r^n * (640320:ℝ)^(3*n) = 1728^n := by rw [hr_def, div_pow, ← pow_mul, @@ -80,7 +80,7 @@ theorem summable_chudnovskyTerm : Summable fun n : ℕ ↦ (chudnovskyTerm n : rw [show (545140134 * (n:ℝ) + 13591409) * r ^ n * (((3*n)! : ℝ) * (n ! )^3 * 640320^(3*n)) = (545140134 * (n:ℝ) + 13591409) * (r ^ n * 640320^(3*n)) - * (((3*n)! : ℝ) * (n ! )^3) from by ac_rfl, hrpow] + * (((3*n)! : ℝ) * (n ! )^3) from by ring, hrpow] linear_combination mul_le_mul_of_nonneg_left key hApos /-- The glue lemma: Milla's normalization `√(640320³)/(12π) = ∑ …` implies Mathlib's @@ -101,8 +101,8 @@ private theorem chudnovsky_glue rw [neg_pow, ← pow_mul] have h1 : ((3 * n)! : ℂ) ≠ 0 := by exact_mod_cast Nat.factorial_ne_zero _ have h2 : ((n ! : ℕ) : ℂ) ≠ 0 := by exact_mod_cast Nat.factorial_ne_zero _ - have h3 : (640320 : ℂ) ^ (3 * n) ≠ 0 := pow_ne_zero _ (by norm_num only) - have h4 : ((-1 : ℂ)) ^ n ≠ 0 := pow_ne_zero _ (by norm_num only) + have h3 : (640320 : ℂ) ^ (3 * n) ≠ 0 := pow_ne_zero _ (by norm_num) + have h4 : ((-1 : ℂ)) ^ n ≠ 0 := pow_ne_zero _ (by norm_num) simp only [chudnovskyTerm, chudnovskyNum, chudnovskyDenom] rw [hpow] push_cast @@ -118,8 +118,8 @@ private theorem chudnovsky_glue -- `640320^(3/2) = √(640320³)`. have hrpow : (640320 : ℝ) ^ (3 / 2 : ℝ) = Real.sqrt (640320 ^ 3) := by rw [Real.sqrt_eq_rpow, show ((640320 : ℝ) ^ 3) = (640320 : ℝ) ^ ((3 : ℕ) : ℝ) from - (Real.rpow_natCast _ 3).symm, ← Real.rpow_mul (by norm_num only)] - norm_num only + (Real.rpow_natCast _ 3).symm, ← Real.rpow_mul (by norm_num)] + norm_num have hs : Real.sqrt (640320 ^ 3) ≠ 0 := by positivity have hpi : (π : ℝ) ≠ 0 := Real.pi_ne_zero -- Assemble. diff --git a/LeanPool/Chudnovsky/Clausen.lean b/LeanPool/Chudnovsky/Clausen.lean index f6ced41dea..64e0f29a2f 100644 --- a/LeanPool/Chudnovsky/Clausen.lean +++ b/LeanPool/Chudnovsky/Clausen.lean @@ -161,28 +161,16 @@ theorem generalizedHypergeometricSeries_radius_eq_one {𝕂 : Type*} (𝔸 : Typ have limit : Tendsto (fun n : ℕ => ((δ + n) * (ε + n) * (1 + n)) / ((α + n) * (β + n) * (γ + n))) atTop (𝓝 1) := by - have h1 : Tendsto (fun n : ℕ => (δ + (n : 𝕂)) / (α + n)) atTop (𝓝 1) := by - simpa only [one_mul, ne_eq, one_ne_zero, not_false_eq_true, - div_self] using tendsto_add_mul_div_add_mul_atTop_nhds δ α (1 : 𝕂) (d := 1) one_ne_zero - have h2 : Tendsto (fun n : ℕ => (ε + (n : 𝕂)) / (β + n)) atTop (𝓝 1) := by - simpa only [one_mul, ne_eq, one_ne_zero, not_false_eq_true, - div_self] using tendsto_add_mul_div_add_mul_atTop_nhds ε β (1 : 𝕂) (d := 1) one_ne_zero - have h3 : Tendsto (fun n : ℕ => (1 + (n : 𝕂)) / (γ + n)) atTop (𝓝 1) := by - simpa only [one_mul, ne_eq, one_ne_zero, not_false_eq_true, - div_self - ] using tendsto_add_mul_div_add_mul_atTop_nhds (1 : 𝕂) γ (1 : 𝕂) (d := 1) one_ne_zero - have heq : (fun n : ℕ => ((δ + (n : 𝕂)) * (ε + n) * (1 + n)) / ((α + n) * (β + n) * (γ + n))) - = fun n : ℕ => (δ + (n : 𝕂)) / (α + n) * ((ε + n) / (β + n)) * ((1 + n) / (γ + n)) := by - funext n - simp only [div_eq_mul_inv, mul_inv_rev] - ac_rfl - rw [heq] - simpa only [mul_one] using (h1.mul h2).mul h3 + have linear_limit (x y : 𝕂) : + Tendsto (fun n : ℕ => (x + (n : 𝕂)) / (y + n)) atTop (𝓝 1) := by + simpa only [one_mul, div_one] using + tendsto_add_mul_div_add_mul_atTop_nhds x y (1 : 𝕂) (d := 1) one_ne_zero + simpa only [@div_mul_div_comm 𝕂 _, mul_one] using + ((linear_limit δ α).mul (linear_limit ε β)).mul (linear_limit 1 γ) have limitn : Tendsto (fun n : ℕ => ‖((δ + (n : 𝕂)) * (ε + n) * (1 + n)) / ((α + n) * (β + n) * (γ + n))‖) - atTop (𝓝 1) := by simpa only [norm_div, norm_mul, norm_one] using Filter.Tendsto.norm limit + atTop (𝓝 1) := by simpa only [norm_one] using Filter.Tendsto.norm limit refine limitn.congr (fun n => ?_) - simp only [Nat.succ_eq_add_one] rw [← norm_div, key n] open Filter Topology in @@ -220,19 +208,19 @@ theorem generalizedHypergeometric_summable (α β γ δ ε : ℂ) {z : ℂ} (hz all_goals first | (rw [show (ascPochhammer ℂ n).eval α = 0 by - rw [show α = -(kn : ℂ) by linear_combination hp] + rw [show α = -(kn : ℂ) by exact neg_eq_iff_eq_neg.mp hp.symm] exact ascPochhammer_eval_neg_coe_nat_of_lt hlt]; simp) | (rw [show (ascPochhammer ℂ n).eval β = 0 by - rw [show β = -(kn : ℂ) by linear_combination hp] + rw [show β = -(kn : ℂ) by exact neg_eq_iff_eq_neg.mp hp.symm] exact ascPochhammer_eval_neg_coe_nat_of_lt hlt]; simp) | (rw [show (ascPochhammer ℂ n).eval γ = 0 by - rw [show γ = -(kn : ℂ) by linear_combination hp] + rw [show γ = -(kn : ℂ) by exact neg_eq_iff_eq_neg.mp hp.symm] exact ascPochhammer_eval_neg_coe_nat_of_lt hlt]; simp) | (rw [show (ascPochhammer ℂ n).eval δ = 0 by - rw [show δ = -(kn : ℂ) by linear_combination hp] + rw [show δ = -(kn : ℂ) by exact neg_eq_iff_eq_neg.mp hp.symm] exact ascPochhammer_eval_neg_coe_nat_of_lt hlt]; simp) | (rw [show (ascPochhammer ℂ n).eval ε = 0 by - rw [show ε = -(kn : ℂ) by linear_combination hp] + rw [show ε = -(kn : ℂ) by exact neg_eq_iff_eq_neg.mp hp.symm] exact ascPochhammer_eval_neg_coe_nat_of_lt hlt]; simp) rw [hc0, zero_mul] @@ -394,10 +382,10 @@ private theorem ordinaryHypergeometric_discSummable (a b c : ℂ) (hc : ∀ k : simp only [ordinaryHypergeometricCoefficient] rcases hkn' with hp | hp · rw [show (ascPochhammer ℂ n).eval a = 0 by - rw [show a = -(kn : ℂ) by linear_combination hp] + rw [show a = -(kn : ℂ) by exact neg_eq_iff_eq_neg.mp hp.symm] exact ascPochhammer_eval_neg_coe_nat_of_lt hlt]; ring · rw [show (ascPochhammer ℂ n).eval b = 0 by - rw [show b = -(kn : ℂ) by linear_combination hp] + rw [show b = -(kn : ℂ) by exact neg_eq_iff_eq_neg.mp hp.symm] exact ascPochhammer_eval_neg_coe_nat_of_lt hlt]; ring rw [hc0, zero_mul, norm_zero] @@ -581,20 +569,20 @@ private theorem generalizedHypergeometric_discSummable (α β γ δ ε : ℂ) : all_goals first | (rw [show (ascPochhammer ℂ n).eval α = 0 by - rw [show α = -(kn : ℂ) by linear_combination hp] + rw [show α = -(kn : ℂ) by exact neg_eq_iff_eq_neg.mp hp.symm] exact ascPochhammer_eval_neg_coe_nat_of_lt hlt]; ring) | (rw [show (ascPochhammer ℂ n).eval β = 0 by - rw [show β = -(kn : ℂ) by linear_combination hp] + rw [show β = -(kn : ℂ) by exact neg_eq_iff_eq_neg.mp hp.symm] exact ascPochhammer_eval_neg_coe_nat_of_lt hlt]; ring) | (rw [show (ascPochhammer ℂ n).eval γ = 0 by - rw [show γ = -(kn : ℂ) by linear_combination hp] + rw [show γ = -(kn : ℂ) by exact neg_eq_iff_eq_neg.mp hp.symm] exact ascPochhammer_eval_neg_coe_nat_of_lt hlt]; ring) | (rw [show (ascPochhammer ℂ n).eval δ = 0 by - rw [show δ = -(kn : ℂ) by linear_combination hp] + rw [show δ = -(kn : ℂ) by exact neg_eq_iff_eq_neg.mp hp.symm] exact ascPochhammer_eval_neg_coe_nat_of_lt hlt]; simp only [inv_zero, mul_zero, zero_mul]) | (rw [show (ascPochhammer ℂ n).eval ε = 0 by - rw [show ε = -(kn : ℂ) by linear_combination hp] + rw [show ε = -(kn : ℂ) by exact neg_eq_iff_eq_neg.mp hp.symm] exact ascPochhammer_eval_neg_coe_nat_of_lt hlt]; simp only [inv_zero, mul_zero]) rw [hc0, zero_mul, norm_zero] @@ -639,7 +627,7 @@ theorem generalizedHypergeometric_ode (α β γ δ ε : ℂ) have D1eq : ∀ w : ℂ, ‖w‖ < 1 → deriv (fun w : ℂ => ₃F₂ α β γ δ ε w) w = ∑' n : ℕ, D1 n * w ^ n := fun w hw => (hHD1 w hw).deriv have hnbhd : ∀ w : ℂ, ‖w‖ < 1 → Metric.ball (0 : ℂ) 1 ∈ nhds w := fun w hw => - Metric.isOpen_ball.mem_nhds (by simpa only [Metric.mem_ball, dist_zero_right] using hw) + Metric.isOpen_ball.mem_nhds (by simpa [Metric.mem_ball, dist_zero_right] using hw) have D2eq : ∀ w : ℂ, ‖w‖ < 1 → deriv (deriv fun w : ℂ => ₃F₂ α β γ δ ε w) w = ∑' n : ℕ, D2 n * w ^ n := by intro w hw @@ -837,7 +825,8 @@ private theorem clausen_coeff_general (a b : ℂ) intro nn simp only [hAdef] exact mul_ne_zero (mul_ne_zero (Nat.cast_add_one_ne_zero nn) - (fun h => h₂ nn (by linear_combination h))) (fun h => h₁ nn (by linear_combination h)) + (fun h => h₂ nn (by exact eq_neg_of_add_eq_zero_left h))) + (fun h => h₁ nn (by exact eq_neg_of_add_eq_zero_left h)) have ee_eq_dd : ∀ nn : ℕ, E nn = D nn := by intro nn induction nn with @@ -1082,12 +1071,12 @@ theorem hyp2F1_sq_eq_hyp3F2 {z : ℂ} (hz : ‖z‖ < 1) : hyp2F1 z ^ 2 = hyp3F2 rw [Nat.cast_eq_zero] at h0; omega · have h0 : ((kn + 1 : ℕ) : ℂ) = 0 := by push_cast; linear_combination h rw [Nat.cast_eq_zero] at h0; omega - have hc : (1 / 12 : ℂ) + 5 / 12 + 1 / 2 = 1 := by norm_num1 - have hc' : 2 * (1 / 12 : ℂ) + 2 * (5 / 12) = 1 := by norm_num1 + have hc : (1 / 12 : ℂ) + 5 / 12 + 1 / 2 = 1 := by norm_num + have hc' : 2 * (1 / 12 : ℂ) + 2 * (5 / 12) = 1 := by norm_num have h := clausen_formula (1 / 12 : ℂ) (5 / 12) (fun k => by rw [hc]; exact (hnd k).2.2) (fun k => by rw [hc']; exact (hnd k).2.2) hz - convert h using 1 <;> norm_num only [hyp2F1, hyp3F2] + convert h using 1 <;> norm_num [hyp2F1, hyp3F2] /-- The Pochhammer/factorial identity from the proof of paper Thm. `darst`: `(1/6)ₙ · (1/2)ₙ · (5/6)ₙ = (6n)! / ((3n)! · 12^(3n))`, stated over `ℚ`. -/ @@ -1101,13 +1090,13 @@ theorem ascPochhammer_prod_eq_factorial (n : ℕ) : have e6 : ((6 * (n + 1))! : ℚ) = (6 * n + 1) * (6 * n + 2) * (6 * n + 3) * (6 * n + 4) * (6 * n + 5) * (6 * n + 6) * ((6 * n)! : ℚ) := by - rw [show 6 * (n + 1) = 6 * n + 1 + 1 + 1 + 1 + 1 + 1 from by omega] + rw [show 6 * (n + 1) = 6 * n + 1 + 1 + 1 + 1 + 1 + 1 from by ring] simp only [Nat.factorial_succ] push_cast ring have e3 : ((3 * (n + 1))! : ℚ) = (3 * n + 1) * (3 * n + 2) * (3 * n + 3) * ((3 * n)! : ℚ) := by - rw [show 3 * (n + 1) = 3 * n + 1 + 1 + 1 from by omega] + rw [show 3 * (n + 1) = 3 * n + 1 + 1 + 1 from by ring] simp only [Nat.factorial_succ] push_cast ring @@ -1117,7 +1106,7 @@ theorem ascPochhammer_prod_eq_factorial (n : ℕ) : ((ascPochhammer ℚ n).eval (5 / 6) * (5 / 6 + n)) = (ascPochhammer ℚ n).eval (1 / 6) * (ascPochhammer ℚ n).eval (1 / 2) * (ascPochhammer ℚ n).eval (5 / 6) * ((1 / 6 + n) * (1 / 2 + n) * (5 / 6 + n)) from by ring, - ih, e6, e3, show 3 * (n + 1) = 3 * n + 3 from by omega, pow_add] + ih, e6, e3, show 3 * (n + 1) = 3 * n + 3 from by ring, pow_add] have hf3 : ((3 * n)! : ℚ) ≠ 0 := by positivity field_simp ring @@ -1133,7 +1122,7 @@ theorem hyp2F1_sq_eq_tsum {z : ℂ} (hz : ‖z‖ < 1) : refine tsum_congr fun n => ?_ have hn : (n ! : ℂ) ≠ 0 := Nat.cast_ne_zero.2 (Nat.factorial_ne_zero n) have h3n : ((3 * n)! : ℂ) ≠ 0 := Nat.cast_ne_zero.2 (Nat.factorial_ne_zero _) - have h12 : (12 : ℂ) ^ (3 * n) ≠ 0 := pow_ne_zero _ (by norm_num1) + have h12 : (12 : ℂ) ^ (3 * n) ≠ 0 := pow_ne_zero _ (by norm_num) -- The `ℂ`-version of the Pochhammer/factorial identity, in multiplicative form. have hprod : (ascPochhammer ℂ n).eval (1 / 6 : ℂ) * (ascPochhammer ℂ n).eval (5 / 6 : ℂ) * (ascPochhammer ℂ n).eval (1 / 2 : ℂ) * ((3 * n)! : ℂ) * (12 : ℂ) ^ (3 * n) @@ -1141,13 +1130,13 @@ theorem hyp2F1_sq_eq_tsum {z : ℂ} (hz : ‖z‖ < 1) : have hℚ := ascPochhammer_prod_eq_factorial n have e6 : (ascPochhammer ℂ n).eval (1 / 6 : ℂ) = (((ascPochhammer ℚ n).eval (1 / 6 : ℚ) : ℚ) : ℂ) := by - rw [show (1 / 6 : ℂ) = ((1 / 6 : ℚ) : ℂ) by norm_num1, ← ascPochhammer_eval_ratCast] + rw [show (1 / 6 : ℂ) = ((1 / 6 : ℚ) : ℂ) by norm_num, ← ascPochhammer_eval_ratCast] have e56 : (ascPochhammer ℂ n).eval (5 / 6 : ℂ) = (((ascPochhammer ℚ n).eval (5 / 6 : ℚ) : ℚ) : ℂ) := by - rw [show (5 / 6 : ℂ) = ((5 / 6 : ℚ) : ℂ) by norm_num1, ← ascPochhammer_eval_ratCast] + rw [show (5 / 6 : ℂ) = ((5 / 6 : ℚ) : ℂ) by norm_num, ← ascPochhammer_eval_ratCast] have e12 : (ascPochhammer ℂ n).eval (1 / 2 : ℂ) = (((ascPochhammer ℚ n).eval (1 / 2 : ℚ) : ℚ) : ℂ) := by - rw [show (1 / 2 : ℂ) = ((1 / 2 : ℚ) : ℂ) by norm_num1, ← ascPochhammer_eval_ratCast] + rw [show (1 / 2 : ℂ) = ((1 / 2 : ℚ) : ℂ) by norm_num, ← ascPochhammer_eval_ratCast] rw [e6, e56, e12, show (((ascPochhammer ℚ n).eval (1 / 6 : ℚ) : ℚ) : ℂ) * (((ascPochhammer ℚ n).eval (5 / 6 : ℚ) : ℚ) : ℂ) * diff --git a/LeanPool/Chudnovsky/Coefficients.lean b/LeanPool/Chudnovsky/Coefficients.lean index f1df46fdfa..95dbd7055b 100644 --- a/LeanPool/Chudnovsky/Coefficients.lean +++ b/LeanPool/Chudnovsky/Coefficients.lean @@ -96,7 +96,7 @@ theorem jwert_τ₁₆₃_of (hjm : ∃ m : ℤ, 1728 * J τ₁₆₃ = (m : ℂ ≤ ‖1728 * J τ₁₆₃ - 1728 * Jtilde τ₁₆₃‖ + ‖1728 * Jtilde τ₁₆₃ - (-640320 ^ 3 : ℂ)‖ := norm_sub_le_norm_sub_add_norm_sub _ _ _ _ < 0.2 + 1 / 2 := add_lt_add hJJt hnorm_Jt - _ < 1 := by norm_num1 + _ < 1 := by norm_num -- an integer within `< 1` of `−640320³` equals it rw [hm] at hchain have hz : m + 640320 ^ 3 = 0 := by @@ -186,7 +186,7 @@ theorem s₂_τ₁₆₃_of (hjm : ∃ m : ℤ, 1728 * J τ₁₆₃ = (m : ℂ) linear_combination -hrel have hKsq : K ^ 2 = (10996566783048 : ℂ) ^ 2 := by rw [hKdef, mul_pow, mul_pow, hsq1, hE6sq, jwert_τ₁₆₃_of hjm] - push_cast; norm_num only + push_cast; norm_num -- hence `K = ±b`, so `s₂·b = ±P` is an algebraic integer have hbranch : K = (10996566783048 : ℂ) ∨ K = -(10996566783048 : ℂ) := by have hfac : (K - 10996566783048) * (K + 10996566783048) = 0 := by linear_combination hKsq @@ -212,12 +212,12 @@ theorem s₂_τ₁₆₃_of (hjm : ∃ m : ℤ, 1728 * J τ₁₆₃ = (m : ℂ) rw [show s₂ τ₁₆₃ * 10996566783048 - s₂tilde τ₁₆₃ * 10996566783048 = (s₂ τ₁₆₃ - s₂tilde τ₁₆₃) * 10996566783048 from by ring, norm_mul, hbnorm] have hq3 : ‖q τ₁₆₃‖ ^ 3 < (3.80898093700765233822623151648e-18 : ℝ) ^ 3 := - pow_lt_pow_left₀ hqbound (norm_nonneg _) (by norm_num only) + pow_lt_pow_left₀ hqbound (norm_nonneg _) (by norm_num) calc ‖s₂ τ₁₆₃ - s₂tilde τ₁₆₃‖ * 10996566783048 < 222000 * ‖q τ₁₆₃‖ ^ 3 * 10996566783048 := by nlinarith [theonaehers2 hτ, hqpos] _ < 222000 * (3.80898093700765233822623151648e-18 : ℝ) ^ 3 * 10996566783048 := by nlinarith [hq3] - _ < 1 / 4 := by norm_num only + _ < 1 / 4 := by norm_num have hnum := s2tilde_real_bound (e := Real.exp (-(π * Real.sqrt 163))) (pv := π) (sv := Real.sqrt 163) exp_neg_pi_sqrt_163_gt exp_neg_pi_sqrt_163_lt pi_gt_high_precision pi_lt_high_precision sqrt_163_gt sqrt_163_lt @@ -243,7 +243,7 @@ theorem s₂_τ₁₆₃_of (hjm : ∃ m : ℤ, 1728 * J τ₁₆₃ = (m : ℂ) + (s₂tilde τ₁₆₃ * 10996566783048 - 9351571368960)‖ := by congr 1; ring _ ≤ _ := norm_add_le _ _ _ < 1 / 4 + 1 / 2 := add_lt_add hpart1 hpart2 - _ < 1 := by norm_num only + _ < 1 := by norm_num rw [hm] at hpin have hmval : m = 9351571368960 := by have hlt : ‖((m - 9351571368960 : ℤ) : ℂ)‖ < 1 := by @@ -256,8 +256,8 @@ theorem s₂_τ₁₆₃_of (hjm : ∃ m : ℤ, 1728 * J τ₁₆₃ = (m : ℂ) -- conclude `s₂ = 9351571368960/10996566783048 = 77265280/90856689` have hfinal : s₂ τ₁₆₃ * 10996566783048 = ((9351571368960 : ℤ) : ℂ) := by rw [hm, hmval] have hval : s₂ τ₁₆₃ = 9351571368960 / 10996566783048 := by - rw [eq_div_iff (by norm_num only : (10996566783048 : ℂ) ≠ 0), hfinal]; norm_num only - rw [hval]; push_cast; norm_num only + rw [eq_div_iff (by norm_num : (10996566783048 : ℂ) ≠ 0), hfinal]; norm_num + rw [hval]; push_cast; norm_num /-- Milla's `s2nenner`/`satzhilfszahlen` at `N = 163`: `s₂(τ₁₆₃) = 77265280/90856689`. -/ @@ -269,7 +269,7 @@ rationality inputs as hypotheses: `(1 − s₂(τ₁₆₃))/6 = 13591409/545140 theorem one_sub_s₂_τ₁₆₃_div_six_of (hjm : ∃ m : ℤ, 1728 * J τ₁₆₃ = (m : ℂ)) (hsr : ∃ r : ℚ, s₂ τ₁₆₃ = (r : ℂ)) : (1 - s₂ τ₁₆₃) / 6 = (13591409 / 545140134 : ℚ) := by - rw [s₂_τ₁₆₃_of hjm hsr]; push_cast; norm_num1 + rw [s₂_τ₁₆₃_of hjm hsr]; push_cast; norm_num /-- The combination entering the Chudnovsky formula: `(1 − s₂(τ₁₆₃))/6 = 13591409/545140134`. -/ diff --git a/LeanPool/Chudnovsky/ComplexMult.lean b/LeanPool/Chudnovsky/ComplexMult.lean index 9a44b3ed99..89420008d8 100644 --- a/LeanPool/Chudnovsky/ComplexMult.lean +++ b/LeanPool/Chudnovsky/ComplexMult.lean @@ -108,7 +108,7 @@ theorem isIntegral_C_mul_conj {τ : ℍ} {A B C : ℤ} `j = 1728·J` is (it is a root of `X³ − j`). -/ theorem isIntegral_E₄_div_eta_pow (τ : ℍ) (hj : IsIntegral ℤ (1728 * J τ)) : IsIntegral ℤ (E₄ τ / ModularForm.eta τ ^ 8) := by - refine IsIntegral.of_pow (n := 3) (by norm_num1) ?_ + refine IsIntegral.of_pow (n := 3) (by norm_num) ?_ have hΔ : ModularForm.discriminant τ = ModularForm.eta τ ^ 24 := rfl have hx : (E₄ τ / ModularForm.eta τ ^ 8) ^ 3 = 1728 * J τ := by rw [mul_J_eq, div_pow, show (ModularForm.eta τ ^ 8) ^ 3 = ModularForm.discriminant τ by @@ -119,18 +119,17 @@ theorem isIntegral_E₄_div_eta_pow (τ : ℍ) (hj : IsIntegral ℤ (1728 * J τ `j = 1728·J` is (it is a root of `X² − (j − 1728)`). -/ theorem isIntegral_E₆_div_eta_pow (τ : ℍ) (hj : IsIntegral ℤ (1728 * J τ)) : IsIntegral ℤ (E₆ τ / ModularForm.eta τ ^ 12) := by - refine IsIntegral.of_pow (n := 2) (by norm_num1) ?_ + refine IsIntegral.of_pow (n := 2) (by norm_num) ?_ have hΔ : ModularForm.discriminant τ = ModularForm.eta τ ^ 24 := rfl have hne := discriminant_ne_zero τ have hrel := E₄_cube_sub_E₆_sq_eq_discriminant τ have h1728 : IsIntegral ℤ (1728 : ℂ) := by - rw [show (1728 : ℂ) = algebraMap ℤ ℂ 1728 by simp only [algebraMap_int_eq, eq_intCast, - Int.cast_ofNat]] + rw [show (1728 : ℂ) = algebraMap ℤ ℂ 1728 by simp] exact isIntegral_algebraMap have hx : (E₆ τ / ModularForm.eta τ ^ 12) ^ 2 = 1728 * J τ - 1728 := by rw [mul_J_eq, div_pow, show (ModularForm.eta τ ^ 12) ^ 2 = ModularForm.discriminant τ by rw [hΔ]; ring] - field_simp (disch := first | assumption | norm_num1 | positivity) + field_simp linear_combination -hrel rw [hx] exact hj.sub h1728 @@ -170,14 +169,14 @@ private lemma latHatUnit_pow4 (τ : ℍ) : (latHatUnit τ : ℂ) ^ 4 = (π : ℂ) ^ 4 / 9 * ModularForm.eta τ ^ 8 := by have hs4 : ((Real.sqrt 3 : ℝ) : ℂ) ^ 4 = 9 := by calc ((Real.sqrt 3 : ℝ) : ℂ) ^ 4 = (((Real.sqrt 3 : ℝ) : ℂ) ^ 2) ^ 2 := by ring - _ = 9 := by rw [sqrt3_sq]; norm_num1 + _ = 9 := by rw [sqrt3_sq]; norm_num rw [latHatUnit_val, mul_pow, div_pow, hs4]; ring private lemma latHatUnit_pow6 (τ : ℍ) : (latHatUnit τ : ℂ) ^ 6 = (π : ℂ) ^ 6 / 27 * ModularForm.eta τ ^ 12 := by have hs6 : ((Real.sqrt 3 : ℝ) : ℂ) ^ 6 = 27 := by calc ((Real.sqrt 3 : ℝ) : ℂ) ^ 6 = (((Real.sqrt 3 : ℝ) : ℂ) ^ 2) ^ 3 := by ring - _ = 27 := by rw [sqrt3_sq]; norm_num1 + _ = 27 := by rw [sqrt3_sq]; norm_num rw [latHatUnit_val, mul_pow, div_pow, hs6]; ring /-- `¼g₂(L̂) = 3·E₄/η⁸` (paper `proofzweistern`). -/ @@ -203,8 +202,7 @@ private lemma isIntegral_latHat_g₂_div_four (τ : ℍ) (hj : IsIntegral ℤ (1 IsIntegral ℤ ((latHatUnit τ • Lτ τ).g₂ / 4) := by rw [latHat_g₂_div_four] have h3 : IsIntegral ℤ (3 : ℂ) := by - rw [show (3 : ℂ) = algebraMap ℤ ℂ 3 by simp only [algebraMap_int_eq, eq_intCast, - Int.cast_ofNat]]; exact isIntegral_algebraMap + rw [show (3 : ℂ) = algebraMap ℤ ℂ 3 by simp]; exact isIntegral_algebraMap exact h3.mul (isIntegral_E₄_div_eta_pow τ hj) /-- `¼g₃(L̂)` is an algebraic integer whenever `j = 1728J` is. -/ @@ -212,8 +210,7 @@ private lemma isIntegral_latHat_g₃_div_four (τ : ℍ) (hj : IsIntegral ℤ (1 IsIntegral ℤ ((latHatUnit τ • Lτ τ).g₃ / 4) := by rw [latHat_g₃_div_four] have h2 : IsIntegral ℤ (2 : ℂ) := by - rw [show (2 : ℂ) = algebraMap ℤ ℂ 2 by simp only [algebraMap_int_eq, eq_intCast, - Int.cast_ofNat]]; exact isIntegral_algebraMap + rw [show (2 : ℂ) = algebraMap ℤ ℂ 2 by simp]; exact isIntegral_algebraMap exact h2.mul (isIntegral_E₆_div_eta_pow τ hj) /-- Transfer of integrality: since `¼g₂(L̂)` and `¼g₃(L̂)` are algebraic integers (given @@ -305,8 +302,7 @@ section Lemkapa2 /-- The lattice is countable (local copy of the private helper in `DivisionValues.lean`). -/ private lemma countable_lattice_cm (L : PeriodPair) : (↑L.lattice : Set ℂ).Countable := by have : Countable ↥L.lattice := countable_of_Lindelof_of_discrete - simpa only [Subtype.range_coe_subtype, - SetLike.setOfPred_mem_eq] using Set.countable_range (Subtype.val : ↥L.lattice → ℂ) + simpa using Set.countable_range (Subtype.val : ↥L.lattice → ℂ) /-- A signed fraction `k/m` with integral value and `|k| < m` is zero (local copy of the private helper in `DivisionValues.lean`). -/ @@ -408,7 +404,7 @@ private lemma zero_mem_cmSet {B C : ℤ} {M : ℕ} [NeZero M] : /-- `Cτ ∈ L_τ`. -/ private lemma cm_alpha_mem (τ : ℍ) (C : ℤ) : (C : ℂ) * τ ∈ (Lτ τ).lattice := - PeriodPair.mem_lattice.mpr ⟨0, C, by simp only [Int.cast_zero, Lτ_ω₁, mul_one, Lτ_ω₂, zero_add]⟩ + PeriodPair.mem_lattice.mpr ⟨0, C, by simp⟩ /-- Multiplication by `α = Cτ` maps the lattice into itself (this is complex multiplication: `Cτ·1 = Cτ ∈ L` and `Cτ·τ = −A − Bτ ∈ L`). -/ @@ -480,8 +476,8 @@ private lemma cmSet_exists_add_mem {τ : ℍ} {A B C : ℤ} {M : ℕ} have hb1 : x.toNat < M := (Int.toNat_lt hx0).mpr hxM have hb2 : (C * y).toNat < M := (Int.toNat_lt hCy0).mpr hCyM set v : Fin M × Fin M := (⟨x.toNat, hb1⟩, ⟨(C * y).toNat, hb2⟩) with hvdef - have hv1 : ((v.1 : ℕ) : ℤ) = x := by simp only [hvdef, Int.toNat_of_nonneg hx0] - have hv2 : ((v.2 : ℕ) : ℤ) = C * y := by simp only [hvdef, Int.toNat_of_nonneg hCy0] + have hv1 : ((v.1 : ℕ) : ℤ) = x := by simp [hvdef, Int.toNat_of_nonneg hx0] + have hv2 : ((v.2 : ℕ) : ℤ) = C * y := by simp [hvdef, Int.toNat_of_nonneg hCy0] refine ⟨v, ?_, ?_⟩ · -- membership in `cmSet` rw [mem_cmSet_iff] @@ -647,7 +643,7 @@ private lemma mulPoleCM_identity {τ : ℍ} {C : ℤ} {M : ℕ} exact ((Lτ τ).weierstrassP_add_coe ((C : ℂ) * τ * (w - z)) ⟨_, hmp⟩).symm have hfrac : ((C : ℂ) * τ) ^ 2 * (((C : ℂ) * τ * (w - z)) ^ 2)⁻¹ = ((w - z) ^ 2)⁻¹ := by rcases eq_or_ne (w - z) 0 with h | h - · simp only [h, mul_zero, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, zero_pow, inv_zero] + · simp [h] · field_simp rw [hE1, hE2, hP1, hP2] linear_combination -hfrac diff --git a/LeanPool/Chudnovsky/DivisionValues.lean b/LeanPool/Chudnovsky/DivisionValues.lean index c8e45dbe53..225f3f3d80 100644 --- a/LeanPool/Chudnovsky/DivisionValues.lean +++ b/LeanPool/Chudnovsky/DivisionValues.lean @@ -59,7 +59,7 @@ private lemma div_den_eq_one_imp {m : ℕ} (hm : 0 < m) {k : ℕ} (hk : k < m) have hnn : (0 : ℤ) ≤ q.num := by have := h0; rw [← heq] at this; exact_mod_cast this have hl1 : q.num < 1 := by have := h1; rw [← heq] at this; exact_mod_cast this have hnum0 : q.num = 0 := by omega - have hq0 : q = 0 := by rw [← heq, hnum0]; simp only [Int.cast_zero] + have hq0 : q = 0 := by rw [← heq, hnum0]; simp rw [hqdef] at hq0 rcases div_eq_zero_iff.mp hq0 with hkq | hmq · exact_mod_cast hkq @@ -94,8 +94,7 @@ plan (parallel to the derivation in `Fourier.lean`, which we cannot import here) `Quasiperiods.lean`). -/ private lemma countable_lattice' : (↑L.lattice : Set ℂ).Countable := by have : Countable ↥L.lattice := countable_of_Lindelof_of_discrete - simpa only [Subtype.range_coe_subtype, - SetLike.setOfPred_mem_eq] using Set.countable_range (Subtype.val : ↥L.lattice → ℂ) + simpa using Set.countable_range (Subtype.val : ↥L.lattice → ℂ) /-- `σ` is nonzero away from the lattice. -/ private lemma weierstrassSigma_ne_zero {x : ℂ} (hx : x ∉ L.lattice) : @@ -244,7 +243,7 @@ private theorem Fm_add_intmul {p : ℂ} {m : ℕ} (hp : ∀ w, L.Fm m (w + p) = rw [show x - p + p = x by ring] at this exact this.symm induction a using Int.induction_on with - | zero => simp only [Int.cast_zero, zero_mul, add_zero] + | zero => simp | succ k ih => have heq : w + ((↑k + 1 : ℤ) : ℂ) * p = (w + (↑k : ℤ) * p) + p := by push_cast; ring rw [heq, hp, ih] @@ -404,7 +403,7 @@ private lemma mulPole_identity {m : ℕ} [NeZero m] {z : ℂ} {v₀ : Fin m × F (hv₀ : z + L.divPt m v₀ ∈ L.lattice) (hmp : (m : ℂ) * z ∈ L.lattice) (w : ℂ) : L.weierstrassP (w + L.divPt m v₀) - (m : ℂ) ^ 2 * L.weierstrassP (m * w) = L.weierstrassPExcept 0 (w - z) - (m : ℂ) ^ 2 * L.weierstrassPExcept 0 (m * (w - z)) := by - have hm0 : (m : ℂ) ≠ 0 := by exact Nat.cast_ne_zero.mpr (NeZero.ne m) + have hm0 : (m : ℂ) ≠ 0 := by exact_mod_cast (NeZero.pos m).ne' have hE1 : L.weierstrassPExcept 0 (w - z) = L.weierstrassP (w - z) + -((w - z) ^ 2)⁻¹ := by simpa using L.weierstrassPExcept_def (0 : L.lattice) (w - z) have hE2 : L.weierstrassPExcept 0 (m * (w - z)) @@ -418,7 +417,7 @@ private lemma mulPole_identity {m : ℕ} [NeZero m] {z : ℂ} {v₀ : Fin m × F exact (L.weierstrassP_add_coe (m * (w - z)) ⟨_, hmp⟩).symm have hfrac : (m : ℂ) ^ 2 * (((m : ℂ) * (w - z)) ^ 2)⁻¹ = ((w - z) ^ 2)⁻¹ := by rcases eq_or_ne (w - z) 0 with h | h - · simp only [h, mul_zero, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, zero_pow, inv_zero] + · simp [h] · field_simp rw [hE1, hE2, hP1, hP2] linear_combination -hfrac @@ -701,7 +700,7 @@ private lemma one_le_untop₀_meromorphicOrderAt {c a : ℂ} (ha : a ∉ L.latti set f : ℂ → ℂ := fun z => L.weierstrassP z - c with hf_def have hAn : AnalyticAt ℂ f a := by rw [hf_def]; have := L.analyticOnNhd_weierstrassP a ha; fun_prop - have hfa : f a = 0 := by rw [hf_def]; simp only [hc, sub_self] + have hfa : f a = 0 := by rw [hf_def]; simp [hc] have hz0 : analyticOrderAt f a ≠ 0 := hAn.analyticOrderAt_ne_zero.mpr hfa have hne : meromorphicOrderAt f a ≠ ⊤ := by have hmero : Meromorphic f := by rw [hf_def]; fun_prop @@ -880,7 +879,7 @@ private lemma wpsub_meromorphicOrderAt_eq_one {c a : ℂ} (ha : a ∉ L.lattice) have hAn : AnalyticAt ℂ (fun z => L.weierstrassP z - c) a := by have := L.analyticOnNhd_weierstrassP a ha; fun_prop have h1 : analyticOrderAt (fun z => L.weierstrassP z - c) a = 1 := by - apply hAn.analyticOrderAt_eq_one_of_zero_deriv_ne_zero (by simp only [hc, sub_self]) + apply hAn.analyticOrderAt_eq_one_of_zero_deriv_ne_zero (by simp [hc]) rw [deriv_sub_const, L.deriv_weierstrassP] exact hd rw [hAn.meromorphicOrderAt_eq, h1] @@ -1025,7 +1024,7 @@ private lemma periodic_add_intmul {F : ℂ → ℂ} {p : ℂ} (hp : ∀ w, F (w rw [show x - p + p = x by ring] at this exact this.symm induction a using Int.induction_on with - | zero => simp only [Int.cast_zero, zero_mul, add_zero] + | zero => simp | succ k ih => have heq : w + ((↑k + 1 : ℤ) : ℂ) * p = (w + (↑k : ℤ) * p) + p := by push_cast; ring rw [heq, hp, ih] @@ -1089,8 +1088,8 @@ private lemma trailingCoeff_wpsub_zero (c : ℂ) : rw [hP, hh] simp only [sub_zero, smul_eq_mul] rw [show (z : ℂ) ^ (-2 : ℤ) = (z ^ 2)⁻¹ by - rw [zpow_neg, ← zpow_natCast z 2]; norm_num only] - field_simp (disch := first | assumption | norm_num1 | positivity) + rw [zpow_neg, ← zpow_natCast z 2]; norm_num] + field_simp ring rw [hAn.meromorphicTrailingCoeffAt_of_ne_zero_of_eq_nhdsNE (by rw [h0]; exact one_ne_zero) hEq, h0] @@ -1185,8 +1184,7 @@ theorem lemwpsigma {u v : ℂ} (hu : u ∉ L.lattice) (hv : v ∉ L.lattice) : have := L.analyticOnNhd_weierstrassP x hx fun_prop have hconn : IsPreconnected ((↑L.lattice : Set ℂ)ᶜ) := - (L.countable_lattice'.isConnected_compl_of_one_lt_rank (by simp only [Complex.rank_real_complex, - Nat.one_lt_ofNat])).isPreconnected + (L.countable_lattice'.isConnected_compl_of_one_lt_rank (by simp)).isPreconnected have hx₀ : L.ω₁ / 2 ∈ ((↑L.lattice : Set ℂ)ᶜ) := L.ω₁_div_two_notMem_lattice have hfreq : ∃ᶠ z in 𝓝[≠] (L.ω₁ / 2), A z = c * g z := by have hm := mem_codiscrete.mp hcod (L.ω₁ / 2) @@ -1344,7 +1342,7 @@ private lemma Fm_sq_meromorphicOrderAt_eq (m : ℕ) [NeZero m] (z : ℂ) : have := sub_mem h hzsub rw [show z - L.divPt m v - (z - L.divPt m v₀) = -(L.divPt m v - L.divPt m v₀) by ring] at this - exact L.divPt_sub_notMem_lattice hvne (by simpa only [neg_sub] using neg_mem this) + exact L.divPt_sub_notMem_lattice hvne (by simpa using neg_mem this) have hadd : z + L.divPt m v ∉ L.lattice := by intro h have := sub_mem h hv₀ @@ -1401,7 +1399,7 @@ private lemma Fm_sq_meromorphicOrderAt_eq (m : ℕ) [NeZero m] (z : ℂ) : have := sub_mem h hzv₁ rw [show z - L.divPt m v - (z - L.divPt m v₁) = -(L.divPt m v - L.divPt m v₁) by ring] at this - exact L.divPt_sub_notMem_lattice hvne₁ (by simpa only [neg_sub] using neg_mem this) + exact L.divPt_sub_notMem_lattice hvne₁ (by simpa using neg_mem this) have hadd : z + L.divPt m v ∉ L.lattice := by intro h have := sub_mem h hv₀ @@ -1542,8 +1540,7 @@ theorem propfmprod (m : ℕ) [NeZero m] {z : ℂ} (hz : z ∉ L.lattice) : (fun v _ => by fun_prop) fun_prop have hconn : IsPreconnected ((↑L.lattice : Set ℂ)ᶜ) := - (L.countable_lattice'.isConnected_compl_of_one_lt_rank (by simp only [Complex.rank_real_complex, - Nat.one_lt_ofNat])).isPreconnected + (L.countable_lattice'.isConnected_compl_of_one_lt_rank (by simp)).isPreconnected have hx₀ : L.ω₁ / 2 ∈ ((↑L.lattice : Set ℂ)ᶜ) := L.ω₁_div_two_notMem_lattice have hfreq : ∃ᶠ x in 𝓝[≠] (L.ω₁ / 2), F x = c * G x := by have hm := mem_codiscrete.mp hcod (L.ω₁ / 2) @@ -1636,11 +1633,11 @@ noncomputable def P : ℕ → Coeff[X] termination_by m => m decreasing_by all_goals omega -@[simp] lemma P_zero : P 0 = 0 := by simp only [P] +@[simp] lemma P_zero : P 0 = 0 := by simp [P] -@[simp] lemma P_one : P 1 = 1 := by simp only [P] +@[simp] lemma P_one : P 1 = 1 := by simp [P] -@[simp] lemma P_two : P 2 = 1 := by simp only [P] +@[simp] lemma P_two : P 2 = 1 := by simp [P] lemma P_three : P 3 = C 3 * X ^ 4 - C (6 * h2) * X ^ 2 - C (12 * h3) * X - C (h2 ^ 2) := by @@ -1743,7 +1740,7 @@ private lemma E_leadingCoeff : E.leadingCoeff = 16 := by have hq : (X ^ 3 - C h2 * X - C h3 : Coeff[X]).Monic := by rw [sub_sub] exact Polynomial.monic_X_pow_sub - (Polynomial.degree_linear_le.trans_lt (by norm_num1)) + (Polynomial.degree_linear_le.trans_lt (by norm_num)) rw [E, Polynomial.leadingCoeff_mul, Polynomial.leadingCoeff_pow, hq.leadingCoeff, one_pow, mul_one] rw [show (16 : Coeff[X]) = Polynomial.C (16 : Coeff) from (map_ofNat Polynomial.C 16).symm, @@ -1760,7 +1757,7 @@ private lemma P_nlc_case_5 (j : ℕ) ∧ (P (4 * j + 5)).leadingCoeff = ((j' + 1 : ℕ) : Coeff)) := by have hcast_ne : ∀ n : ℕ, 0 < n → ((n : ℕ) : Coeff) ≠ 0 := fun n hn => Nat.cast_ne_zero.mpr hn.ne' - have h16 : (16 : Coeff) ≠ 0 := by norm_num1 + have h16 : (16 : Coeff) ≠ 0 := by norm_num rw [show 4 * j + 5 = 4 * (j + 1) + 1 by ring, P_four_mul_add_one (by omega : 1 ≤ j + 1), show P (2 * (j + 1) - 1) = P (2 * j + 1) by @@ -1861,7 +1858,7 @@ private lemma P_nlc_case_7 (j : ℕ) ∧ (P (4 * j + 7)).leadingCoeff = ((j' + 1 : ℕ) : Coeff)) := by have hcast_ne : ∀ n : ℕ, 0 < n → ((n : ℕ) : Coeff) ≠ 0 := fun n hn => Nat.cast_ne_zero.mpr hn.ne' - have h16 : (16 : Coeff) ≠ 0 := by norm_num1 + have h16 : (16 : Coeff) ≠ 0 := by norm_num rw [show 4 * j + 7 = 4 * (j + 1) + 3 by ring, P_four_mul_add_three (by omega : 1 ≤ j + 1), show P (2 * (j + 1) + 3) = P (2 * (j + 2) + 1) by @@ -2304,7 +2301,7 @@ private theorem wp2_eq_zeta {z : ℂ} (hz : z ∉ L.lattice) (h2z : 2 * z ∉ L. private lemma isOpen_U2 : IsOpen {w : ℂ | w ∉ L.lattice ∧ 2 * w ∉ L.lattice} := by have h1 : IsOpen ((↑L.lattice : Set ℂ)ᶜ) := L.isClosed_lattice.isOpen_compl have h2 : IsOpen ((fun w : ℂ => 2 * w) ⁻¹' (↑L.lattice : Set ℂ)ᶜ) := - h1.preimage SeparatelyContinuousMul.continuous_const_mul + h1.preimage (by fun_prop) exact h1.inter h2 /-- Duplication formula: `4℘(2z)℘′(z)² = ℘''(z)² − 8℘(z)℘′(z)²` for `z, 2z ∉ L` @@ -2480,7 +2477,7 @@ theorem lemfrekur_odd (j : ℕ) {z : ℂ} have hj2 : ((j + 2 : ℕ) : ℂ) * z ∉ L.lattice := hz (j + 2) (by omega) have hM := L.Fm_master (j + 1) 1 hz1 hj1 (by rwa [show j + 1 + 1 = j + 2 from rfl]) - simp only [show 2 * (j + 1) + 1 = 2 * j + 3 from by omega, + simp only [show 2 * (j + 1) + 1 = 2 * j + 3 from by ring, show j + 1 + 1 = j + 2 from rfl] at hM rw [L.Fm_one hz1, mul_one] at hM have hn1 := L.lemwpnz (j + 1) hz1 hj1 @@ -2490,7 +2487,7 @@ theorem lemfrekur_odd (j : ℕ) {z : ℂ} have hne1 : L.Fm (j + 1) z ≠ 0 := L.Fm_ne_zero hz1 hj1 have hne2 : L.Fm (j + 2) z ≠ 0 := L.Fm_ne_zero hz1 hj2 rw [hM, hn1, hn2] - field_simp (disch := first | assumption | norm_num1 | positivity) + field_simp ring /-- Paper `lemfrekur`, second recursion: @@ -2507,7 +2504,7 @@ theorem lemfrekur_even (j : ℕ) {z : ℂ} have hj3 : ((j + 3 : ℕ) : ℂ) * z ∉ L.lattice := hz (j + 3) (by omega) have hM := L.Fm_master (j + 1) 2 hz1 hj1 (by rwa [show j + 1 + 2 = j + 3 from rfl]) - simp only [show 2 * (j + 1) + 2 = 2 * j + 4 from by omega, + simp only [show 2 * (j + 1) + 2 = 2 * j + 4 from by ring, show j + 1 + 2 = j + 3 from rfl] at hM have hn1 := L.lemwpnz (j + 1) hz1 hj1 have hn3 := L.lemwpnz (j + 3) hz1 hj3 @@ -2516,7 +2513,7 @@ theorem lemfrekur_even (j : ℕ) {z : ℂ} have hne1 : L.Fm (j + 1) z ≠ 0 := L.Fm_ne_zero hz1 hj1 have hne3 : L.Fm (j + 3) z ≠ 0 := L.Fm_ne_zero hz1 hj3 rw [hM, hn1, hn3] - field_simp (disch := first | assumption | norm_num1 | positivity) + field_simp ring /-- `F₃ = 3℘℘′² − ¼℘''²` for `z, 2z ∉ L`. -/ @@ -2525,12 +2522,12 @@ private theorem Fm_three {z : ℂ} (hz : z ∉ L.lattice) (h2z : 2 * z ∉ L.lat - (deriv L.derivWeierstrassP z) ^ 2 / 4 := by have h1z : ((1 : ℕ) : ℂ) * z ∉ L.lattice := by rwa [Nat.cast_one, one_mul] have h2z' : ((1 + 1 : ℕ) : ℂ) * z ∉ L.lattice := by - rwa [show ((1 + 1 : ℕ) : ℂ) = (2 : ℂ) by norm_num1] + rwa [show ((1 + 1 : ℕ) : ℂ) = (2 : ℂ) by norm_num] have hM := L.Fm_master 1 1 hz h1z h2z' simp only [show 2 * 1 + 1 = 3 from rfl, show 1 + 1 = 2 from rfl] at hM rw [L.Fm_one hz, mul_one, one_pow, mul_one] at hM rw [show ((1 : ℕ) : ℂ) * z = z by rw [Nat.cast_one, one_mul], - show ((2 : ℕ) : ℂ) * z = 2 * z by norm_num only] at hM + show ((2 : ℕ) : ℂ) * z = 2 * z by norm_num] at hM rw [L.Fm_two hz] at hM have hdup := L.wp_dup hz h2z rw [hM] @@ -2624,18 +2621,18 @@ theorem propfmpm (m : ℕ) {z : ℂ} (hz : ∀ k : ℕ, k ≠ 0 → (k : ℂ) * by_cases h5 : m < 5 · -- base cases `m = 0, 1, 2, 3, 4` interval_cases m - · refine ⟨fun h => absurd (Nat.odd_iff.mp h) (by norm_num1), fun _ => ?_⟩ - simp only [L.Fm_zero, Pc, Milla.P_zero, Polynomial.map_zero, eval_zero, mul_zero] - · refine ⟨fun _ => ?_, fun h => absurd (Nat.even_iff.mp h) (by norm_num1)⟩ + · refine ⟨fun h => absurd (Nat.odd_iff.mp h) (by norm_num), fun _ => ?_⟩ + simp [L.Fm_zero, Pc] + · refine ⟨fun _ => ?_, fun h => absurd (Nat.even_iff.mp h) (by norm_num)⟩ rw [L.Fm_one hz1, L.Pc_one] - simp only [eval_one] - · refine ⟨fun h => absurd (Nat.odd_iff.mp h) (by norm_num1), fun _ => ?_⟩ + simp + · refine ⟨fun h => absurd (Nat.odd_iff.mp h) (by norm_num), fun _ => ?_⟩ rw [L.Fm_two hz1, L.Pc_two] - simp only [eval_one, mul_one] - · refine ⟨fun _ => ?_, fun h => absurd (Nat.even_iff.mp h) (by norm_num1)⟩ + simp + · refine ⟨fun _ => ?_, fun h => absurd (Nat.even_iff.mp h) (by norm_num)⟩ rw [L.Fm_three hz1 h2z, L.eval_Pc_three, L.lemwp2str hz1] linear_combination (3 * L.weierstrassP z) * hode - · refine ⟨fun h => absurd (Nat.odd_iff.mp h) (by norm_num1), fun _ => ?_⟩ + · refine ⟨fun h => absurd (Nat.odd_iff.mp h) (by norm_num), fun _ => ?_⟩ rw [L.Fm_four hz1 h2z, L.eval_Pc_four, L.lemwp2str hz1] linear_combination (-L.derivWeierstrassP z * (3 * L.weierstrassP z * (6 * L.weierstrassP z ^ 2 - L.g₂ / 2) @@ -2792,7 +2789,7 @@ private lemma infinite_wp_generic : have heq2 : (k : ℂ) * zpt n = (((k : ℝ) * t n : ℝ) : ℂ) * L.ω₁ := by simp only [hzpt] push_cast - ac_rfl + ring rw [heq2] exact L.irrational_mul_ω₁_notMem hirr have hnotMem : ∀ n, zpt n ∉ L.lattice := by @@ -2989,7 +2986,7 @@ private lemma eval_baker_zero (m : ℕ) [NeZero m] {v : Fin m × Fin m} (hv : v rw [Polynomial.eval_mul, Polynomial.eval_prod] apply mul_eq_zero_of_right apply Finset.prod_eq_zero (Finset.mem_erase.mpr ⟨hv, Finset.mem_univ v⟩) - simp only [eval_sub, eval_X, eval_C, sub_self] + simp end PeriodPair diff --git a/LeanPool/Chudnovsky/Estimates.lean b/LeanPool/Chudnovsky/Estimates.lean index ebe35ff86b..123420d5c7 100644 --- a/LeanPool/Chudnovsky/Estimates.lean +++ b/LeanPool/Chudnovsky/Estimates.lean @@ -191,21 +191,21 @@ Proved from `Real.exp_one_gt_d9` and an 8-term Taylor lower bound for `exp 0.852 lemma exp_neg_bound : Real.exp (-7.852) < 0.000389 := by have h1 : (2.7182818283 : ℝ) < Real.exp 1 := Real.exp_one_gt_d9 have h7 : (2.7182818283 : ℝ) ^ 7 < Real.exp 7 := by - have he : Real.exp 7 = Real.exp 1 ^ 7 := by rw [← Real.exp_nat_mul]; norm_num only - rw [he]; exact pow_lt_pow_left₀ h1 (by norm_num1) (by norm_num1) + have he : Real.exp 7 = Real.exp 1 ^ 7 := by rw [← Real.exp_nat_mul]; norm_num + rw [he]; exact pow_lt_pow_left₀ h1 (by norm_num) (by norm_num) have h852 : (2.344323 : ℝ) ≤ Real.exp 0.852 := by - have hs := Real.sum_le_exp_of_nonneg (by norm_num1 : (0 : ℝ) ≤ 0.852) 8 + have hs := Real.sum_le_exp_of_nonneg (by norm_num : (0 : ℝ) ≤ 0.852) 8 refine le_trans ?_ hs - norm_num only [Finset.sum_range_succ, Finset.sum_range_zero, Nat.factorial] + norm_num [Finset.sum_range_succ, Finset.sum_range_zero, Nat.factorial] have hbig : (2570.7 : ℝ) < Real.exp 7.852 := by - have he : Real.exp 7.852 = Real.exp 7 * Real.exp 0.852 := by rw [← Real.exp_add]; norm_num only + have he : Real.exp 7.852 = Real.exp 7 * Real.exp 0.852 := by rw [← Real.exp_add]; norm_num rw [he] - calc (2570.7 : ℝ) < 2.7182818283 ^ 7 * 2.344323 := by norm_num1 + calc (2570.7 : ℝ) < 2.7182818283 ^ 7 * 2.344323 := by norm_num _ ≤ Real.exp 7 * Real.exp 0.852 := - mul_le_mul h7.le h852 (by norm_num1) (le_of_lt (lt_trans (by norm_num1) h7)) + mul_le_mul h7.le h852 (by norm_num) (le_of_lt (lt_trans (by norm_num) h7)) rw [Real.exp_neg] - calc (Real.exp 7.852)⁻¹ < (2570.7 : ℝ)⁻¹ := inv_strictAnti₀ (by norm_num1) hbig - _ < 0.000389 := by norm_num1 + calc (Real.exp 7.852)⁻¹ < (2570.7 : ℝ)⁻¹ := inv_strictAnti₀ (by norm_num) hbig + _ < 0.000389 := by norm_num /-! ### Geometric tail bounds for the Lambert-type series (paper Lemmas `lemrestchaetz` and `lemrestkonkr`) -/ @@ -405,7 +405,7 @@ theorem lemE6 {τ : ℍ} (hτ : τ ∈ Region) : 0.8 < ‖E₆ τ‖ := by have hQ : Q < 0.000389 := lt_trans (norm_q_lt_of_mem_Region hτ) exp_neg_bound have htail : ‖eisensteinTail 5 3 τ‖ ≤ 245.6 * Q ^ 3 := norm_eisensteinTail_sigma₅ hτ have hqq : ‖q τ + (33 : ℂ) * q τ ^ 2‖ ≤ Q + 33 * Q ^ 2 := - norm_q_add_smul_sq_le (by norm_num1) + norm_q_add_smul_sq_le (by norm_num) -- reverse triangle inequality rw [E₆_eq_trunc τ, E₆trunc] have htri : (1 : ℝ) - ‖(504 : ℂ) * (q τ + 33 * q τ ^ 2)‖ - ‖(504 : ℂ) * eisensteinTail 5 3 τ‖ @@ -418,9 +418,9 @@ theorem lemE6 {τ : ℍ} (hτ : τ ∈ Region) : 0.8 < ‖E₆ τ‖ := by _ ≤ ‖1 - 504 * (q τ + 33 * q τ ^ 2) - 504 * eisensteinTail 5 3 τ‖ := norm_sub_norm_le _ _ have hA : ‖(504 : ℂ) * (q τ + 33 * q τ ^ 2)‖ ≤ 504 * (Q + 33 * Q ^ 2) := by - rw [norm_mul, Complex.norm_ofNat]; exact mul_le_mul_of_nonneg_left hqq (by norm_num1) + rw [norm_mul, Complex.norm_ofNat]; exact mul_le_mul_of_nonneg_left hqq (by norm_num) have hB : ‖(504 : ℂ) * eisensteinTail 5 3 τ‖ ≤ 504 * (245.6 * Q ^ 3) := by - rw [norm_mul, Complex.norm_ofNat]; exact mul_le_mul_of_nonneg_left htail (by norm_num1) + rw [norm_mul, Complex.norm_ofNat]; exact mul_le_mul_of_nonneg_left htail (by norm_num) have hfinal : (0.8 : ℝ) < 1 - 504 * (Q + 33 * Q ^ 2) - 504 * (245.6 * Q ^ 3) := by linarith [hQ, sq_le_of_lt hQpos hQ, pow_succ_le_of_lt 2 hQpos hQ] linarith [htri, hA, hB, hfinal] @@ -430,7 +430,7 @@ theorem E₆_ne_zero_of_mem_Region {τ : ℍ} (hτ : τ ∈ Region) : E₆ τ intro h have h8 := lemE6 hτ rw [h, norm_zero] at h8 - norm_num1 at h8 + norm_num at h8 /-! ### Truncation norm bounds (paper Lemma `lemxy`) -/ @@ -439,14 +439,14 @@ lemma norm_E₆trunc_ge {τ : ℍ} (hτ : τ ∈ Region) : (0.8014 : ℝ) ≤ have hQpos : 0 < ‖q τ‖ := norm_q_pos τ have hQ : ‖q τ‖ < 0.000389 := lt_trans (norm_q_lt_of_mem_Region hτ) exp_neg_bound have hqq : ‖q τ + (33 : ℂ) * q τ ^ 2‖ ≤ ‖q τ‖ + 33 * ‖q τ‖ ^ 2 := - norm_q_add_smul_sq_le (by norm_num1) + norm_q_add_smul_sq_le (by norm_num) rw [E₆trunc] have htri : (1 : ℝ) - ‖(504 : ℂ) * (q τ + 33 * q τ ^ 2)‖ ≤ ‖(1 : ℂ) - 504 * (q τ + 33 * q τ ^ 2)‖ := by have := norm_sub_norm_le (1 : ℂ) (504 * (q τ + 33 * q τ ^ 2)) rwa [norm_one] at this have hA : ‖(504 : ℂ) * (q τ + 33 * q τ ^ 2)‖ ≤ 504 * (‖q τ‖ + 33 * ‖q τ‖ ^ 2) := by - rw [norm_mul, Complex.norm_ofNat]; exact mul_le_mul_of_nonneg_left hqq (by norm_num1) + rw [norm_mul, Complex.norm_ofNat]; exact mul_le_mul_of_nonneg_left hqq (by norm_num) have hlow : (0.8014 : ℝ) ≤ 1 - 504 * (‖q τ‖ + 33 * ‖q τ‖ ^ 2) := by linarith [hQ, sq_le_of_lt hQpos hQ] linarith [htri, hA, hlow] @@ -455,14 +455,14 @@ lemma E₆trunc_ne_zero {τ : ℍ} (hτ : τ ∈ Region) : E₆trunc τ ≠ 0 := intro h have := norm_E₆trunc_ge hτ rw [h, norm_zero] at this - norm_num1 at this + norm_num at this /-- Paper Lemma `lemxy`: `|X| ≤ 1.0937` where `X = E₄⁽²⁾`. -/ lemma norm_E₄trunc_le {τ : ℍ} (hτ : τ ∈ Region) : ‖E₄trunc τ‖ ≤ 1.0937 := by have hQpos : 0 < ‖q τ‖ := norm_q_pos τ have hQ : ‖q τ‖ < 0.000389 := lt_trans (norm_q_lt_of_mem_Region hτ) exp_neg_bound have hqq : ‖q τ + (9 : ℂ) * q τ ^ 2‖ ≤ ‖q τ‖ + 9 * ‖q τ‖ ^ 2 := - norm_q_add_smul_sq_le (by norm_num1) + norm_q_add_smul_sq_le (by norm_num) rw [E₄trunc] refine le_trans (norm_add_le _ _) ?_ rw [norm_one, norm_mul, Complex.norm_ofNat] @@ -479,7 +479,7 @@ lemma norm_E₂starTrunc_le {τ : ℍ} (hτ : τ ∈ Region) : ‖E₂starTrunc linarith [mul_lt_mul Real.pi_gt_three (by linarith : (1 : ℝ) ≤ τ.im) one_pos Real.pi_pos.le] have ht0 : 0 < 3 / (π * τ.im) := by positivity have hqq : ‖q τ + (3 : ℂ) * q τ ^ 2‖ ≤ ‖q τ‖ + 3 * ‖q τ‖ ^ 2 := - norm_q_add_smul_sq_le (by norm_num1) + norm_q_add_smul_sq_le (by norm_num) have hZeq : E₂starTrunc τ = ((1 - 3 / (π * τ.im) : ℝ) : ℂ) - 24 * (q τ + 3 * q τ ^ 2) := by rw [E₂starTrunc]; push_cast; ring rw [hZeq] @@ -496,12 +496,12 @@ lemma norm_s₂tilde_le {τ : ℍ} (hτ : τ ∈ Region) : ‖s₂tilde τ‖ have hZ := norm_E₂starTrunc_le hτ have hYpos : (0 : ℝ) < ‖E₆trunc τ‖ := by linarith [hY] have hdiv : ‖E₄trunc τ‖ / ‖E₆trunc τ‖ ≤ 1.0937 / 0.8014 := - div_le_div₀ (by norm_num1) hX (by norm_num1) hY + div_le_div₀ (by norm_num) hX (by norm_num) hY have hdivnn : 0 ≤ ‖E₄trunc τ‖ / ‖E₆trunc τ‖ := by positivity calc ‖E₄trunc τ‖ / ‖E₆trunc τ‖ * ‖E₂starTrunc τ‖ ≤ (1.0937 / 0.8014) * 1.0094 := - mul_le_mul hdiv hZ (norm_nonneg _) (by norm_num1) - _ ≤ 1.3776 := by norm_num1 + mul_le_mul hdiv hZ (norm_nonneg _) (by norm_num) + _ ≤ 1.3776 := by norm_num /-- `|δX| = |E₄ - X| ≤ 6744·|q|³`. -/ lemma norm_sub_E₄trunc_le {τ : ℍ} (hτ : τ ∈ Region) : @@ -563,8 +563,8 @@ lemma norm_ktilde_ge {τ : ℍ} (hτ : τ ∈ Region) : (0.9907 : ℝ) ≤ ‖kt have hlow : (0.9996108 : ℝ) ≤ ‖1 - q τ - q τ ^ 2‖ := by have h := (norm_one_sub_q_sub_sq (τ := τ)).1 linarith [h, hQ, sq_le_of_lt hQpos hQ] - calc (0.9907 : ℝ) ≤ 0.9996108 ^ 24 := by norm_num1 - _ ≤ ‖1 - q τ - q τ ^ 2‖ ^ 24 := pow_le_pow_left₀ (by norm_num1) hlow 24 + calc (0.9907 : ℝ) ≤ 0.9996108 ^ 24 := by norm_num + _ ≤ ‖1 - q τ - q τ ^ 2‖ ^ 24 := pow_le_pow_left₀ (by norm_num) hlow 24 /-- Paper Lemma `lemk`: `|ktilde| ≤ 1.0094`. -/ lemma norm_ktilde_le {τ : ℍ} (hτ : τ ∈ Region) : ‖ktilde τ‖ ≤ 1.0094 := by @@ -576,13 +576,13 @@ lemma norm_ktilde_le {τ : ℍ} (hτ : τ ∈ Region) : ‖ktilde τ‖ ≤ 1.00 linarith [h, hQ, sq_le_of_lt hQpos hQ] calc ‖1 - q τ - q τ ^ 2‖ ^ 24 ≤ (1.0003892 : ℝ) ^ 24 := pow_le_pow_left₀ (norm_nonneg _) hhi 24 - _ ≤ 1.0094 := by norm_num1 + _ ≤ 1.0094 := by norm_num lemma ktilde_ne_zero {τ : ℍ} (hτ : τ ∈ Region) : ktilde τ ≠ 0 := by intro h have := norm_ktilde_ge hτ rw [h, norm_zero] at this - norm_num1 at this + norm_num at this /-- `1728·q·Jtilde = X³ / ktilde`. -/ lemma mul_q_Jtilde_eq {τ : ℍ} (hτ : τ ∈ Region) : @@ -601,7 +601,7 @@ lemma norm_sub_cube_E₄trunc_le {τ : ℍ} (hτ : τ ∈ Region) : have hdX := norm_sub_E₄trunc_le hτ have hXnn := norm_nonneg (E₄trunc τ) have hdXnn := norm_nonneg (E₄ τ - E₄trunc τ) - have hQ3 : ‖q τ‖ ^ 3 < 0.000389 ^ 3 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num1) + have hQ3 : ‖q τ‖ ^ 3 < 0.000389 ^ 3 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num) have heq : E₄ τ ^ 3 - E₄trunc τ ^ 3 = (E₄ τ - E₄trunc τ) * (3 * E₄trunc τ ^ 2 + 3 * E₄trunc τ * (E₄ τ - E₄trunc τ) + (E₄ τ - E₄trunc τ) ^ 2) := by ring @@ -619,10 +619,10 @@ lemma norm_sub_cube_E₄trunc_le {τ : ℍ} (hτ : τ ∈ Region) : + (E₄ τ - E₄trunc τ) ^ 2‖ ≤ 3.5886 := by refine le_trans hfac ?_ have hdX' : ‖E₄ τ - E₄trunc τ‖ ≤ 6744 * 0.000389 ^ 3 := - hdX.trans (mul_le_mul_of_nonneg_left hQ3.le (by norm_num1)) + hdX.trans (mul_le_mul_of_nonneg_left hQ3.le (by norm_num)) have hX2 : ‖E₄trunc τ‖ ^ 2 ≤ 1.0937 ^ 2 := pow_le_pow_left₀ hXnn hX 2 have hXdX : ‖E₄trunc τ‖ * ‖E₄ τ - E₄trunc τ‖ ≤ 1.0937 * (6744 * 0.000389 ^ 3) := - mul_le_mul hX hdX' hdXnn (by norm_num1) + mul_le_mul hX hdX' hdXnn (by norm_num) have hdX2 : ‖E₄ τ - E₄trunc τ‖ ^ 2 ≤ (6744 * 0.000389 ^ 3) ^ 2 := pow_le_pow_left₀ hdXnn hdX' 2 linarith @@ -636,7 +636,7 @@ lemma norm_E₆trunc_le {τ : ℍ} (hτ : τ ∈ Region) : ‖E₆trunc τ‖ have hQpos : 0 < ‖q τ‖ := norm_q_pos τ have hQ : ‖q τ‖ < 0.000389 := lt_trans (norm_q_lt_of_mem_Region hτ) exp_neg_bound have hqq : ‖q τ + (33 : ℂ) * q τ ^ 2‖ ≤ ‖q τ‖ + 33 * ‖q τ‖ ^ 2 := - norm_q_add_smul_sq_le (by norm_num1) + norm_q_add_smul_sq_le (by norm_num) rw [E₆trunc] refine le_trans (norm_sub_le _ _) ?_ rw [norm_one, norm_mul, Complex.norm_ofNat] @@ -649,7 +649,7 @@ lemma norm_sub_sq_E₆trunc_le {τ : ℍ} (hτ : τ ∈ Region) : have hQ : ‖q τ‖ < 0.000389 := lt_trans (norm_q_lt_of_mem_Region hτ) exp_neg_bound have hY := norm_E₆trunc_le hτ have hdY := norm_sub_E₆trunc_le hτ - have hQ3 : ‖q τ‖ ^ 3 < 0.000389 ^ 3 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num1) + have hQ3 : ‖q τ‖ ^ 3 < 0.000389 ^ 3 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num) have heq : E₆ τ ^ 2 - E₆trunc τ ^ 2 = (E₆ τ - E₆trunc τ) * (2 * E₆trunc τ + (E₆ τ - E₆trunc τ)) := by ring rw [heq, norm_mul] @@ -660,7 +660,7 @@ lemma norm_sub_sq_E₆trunc_le {τ : ℍ} (hτ : τ ∈ Region) : have hfac2 : ‖2 * E₆trunc τ + (E₆ τ - E₆trunc τ)‖ ≤ 2.3975 := by refine le_trans hfac ?_ have hdY' : ‖E₆ τ - E₆trunc τ‖ ≤ 123783 * 0.000389 ^ 3 := - hdY.trans (mul_le_mul_of_nonneg_left hQ3.le (by norm_num1)) + hdY.trans (mul_le_mul_of_nonneg_left hQ3.le (by norm_num)) linarith calc ‖E₆ τ - E₆trunc τ‖ * ‖2 * E₆trunc τ + (E₆ τ - E₆trunc τ)‖ ≤ (123783 * ‖q τ‖ ^ 3) * 2.3975 := mul_le_mul hdY hfac2 (norm_nonneg _) (by positivity) @@ -710,7 +710,7 @@ lemma lemk {τ : ℍ} (hτ : τ ∈ Region) : ‖kfun τ - ktilde τ‖ ≤ 365. have hQpos : 0 < ‖q τ‖ := norm_q_pos τ have hQ : ‖q τ‖ < 0.000389 := lt_trans (norm_q_lt_of_mem_Region hτ) exp_neg_bound have hqne : q τ ≠ 0 := q_ne_zero τ - have hq2 : (1728 : ℂ) * q τ ≠ 0 := mul_ne_zero (by norm_num1) hqne + have hq2 : (1728 : ℂ) * q τ ≠ 0 := mul_ne_zero (by norm_num) hqne set Gval : ℂ := lemkG.foldr (fun (a : ℤ) (acc : ℂ) => (a : ℂ) + q τ * acc) 0 with hGvaldef -- (a) exact polynomial identity for the "truncation" part have hpoly : E₄trunc τ ^ 3 - E₆trunc τ ^ 2 - 1728 * q τ * ktilde τ @@ -721,26 +721,26 @@ lemma lemk {τ : ℍ} (hτ : τ ∈ Region) : ‖kfun τ - ktilde τ‖ ≤ 365. -- (b) bound on ‖G(q)‖ have hGbound : ‖Gval‖ ≤ 179.8 := by rw [hGvaldef] - refine le_trans (horner_norm_bound (q τ) hQ.le (by norm_num1) lemkG) ?_ + refine le_trans (horner_norm_bound (q τ) hQ.le (by norm_num) lemkG) ?_ simp only [lemkG, List.foldr_cons, List.foldr_nil] - push_cast; norm_num1 + push_cast; norm_num -- (c) rewrite `k - ktilde` as a single quotient over `1728 q` have hid : kfun τ - ktilde τ = ((E₄ τ ^ 3 - E₄trunc τ ^ 3) - (E₆ τ ^ 2 - E₆trunc τ ^ 2) + 1728 * q τ ^ 3 * Gval) / (1728 * q τ) := by rw [← hpoly, kfun] - field_simp (disch := first | assumption | norm_num1 | positivity) + field_simp ring rw [hid, norm_div] have hden : ‖(1728 : ℂ) * q τ‖ = 1728 * ‖q τ‖ := by rw [norm_mul, Complex.norm_ofNat] - rw [hden, div_le_iff₀ (mul_pos (by norm_num1) hQpos)] + rw [hden, div_le_iff₀ (mul_pos (by norm_num) hQpos)] -- (d) bound the numerator by the three pieces of the paper's proof have hp1 : ‖E₄ τ ^ 3 - E₄trunc τ ^ 3‖ ≤ 24202 * ‖q τ‖ ^ 3 := norm_sub_cube_E₄trunc_le hτ have hp2 : ‖E₆ τ ^ 2 - E₆trunc τ ^ 2‖ ≤ 296780 * ‖q τ‖ ^ 3 := norm_sub_sq_E₆trunc_le hτ have hp3 : ‖(1728 : ℂ) * q τ ^ 3 * Gval‖ ≤ 1728 * ‖q τ‖ ^ 3 * 179.8 := by rw [norm_mul, norm_mul, Complex.norm_ofNat, norm_pow] exact mul_le_mul_of_nonneg_left hGbound - (mul_nonneg (by norm_num1) (pow_nonneg hQpos.le 3)) + (mul_nonneg (by norm_num) (pow_nonneg hQpos.le 3)) have hnum : ‖(E₄ τ ^ 3 - E₄trunc τ ^ 3) - (E₆ τ ^ 2 - E₆trunc τ ^ 2) + 1728 * q τ ^ 3 * Gval‖ ≤ 24202 * ‖q τ‖ ^ 3 + 296780 * ‖q τ‖ ^ 3 + 1728 * ‖q τ‖ ^ 3 * 179.8 := @@ -775,14 +775,14 @@ lemma norm_E₄trunc_ge {τ : ℍ} (hτ : τ ∈ Region) : (0.9063 : ℝ) ≤ have hQpos : 0 < ‖q τ‖ := norm_q_pos τ have hQ : ‖q τ‖ < 0.000389 := lt_trans (norm_q_lt_of_mem_Region hτ) exp_neg_bound have hqq : ‖q τ + (9 : ℂ) * q τ ^ 2‖ ≤ ‖q τ‖ + 9 * ‖q τ‖ ^ 2 := - norm_q_add_smul_sq_le (by norm_num1) + norm_q_add_smul_sq_le (by norm_num) rw [E₄trunc] have htri : (1 : ℝ) - ‖(240 : ℂ) * (q τ + 9 * q τ ^ 2)‖ ≤ ‖(1 : ℂ) + 240 * (q τ + 9 * q τ ^ 2)‖ := by have := norm_sub_norm_le (1 : ℂ) (-(240 * (q τ + 9 * q τ ^ 2))) rw [norm_one, norm_neg, sub_neg_eq_add] at this; exact this have hA : ‖(240 : ℂ) * (q τ + 9 * q τ ^ 2)‖ ≤ 240 * (‖q τ‖ + 9 * ‖q τ‖ ^ 2) := by - rw [norm_mul, Complex.norm_ofNat]; exact mul_le_mul_of_nonneg_left hqq (by norm_num1) + rw [norm_mul, Complex.norm_ofNat]; exact mul_le_mul_of_nonneg_left hqq (by norm_num) have hlow : (0.9063 : ℝ) ≤ 1 - 240 * (‖q τ‖ + 9 * ‖q τ‖ ^ 2) := by linarith [hQ, sq_le_of_lt hQpos hQ] linarith [htri, hA, hlow] @@ -795,8 +795,8 @@ lemma norm_Jtilde2_le {τ : ℍ} (hτ : τ ∈ Region) : have hk := norm_ktilde_ge hτ have h1 : ‖E₄trunc τ‖ ^ 3 ≤ 1.0937 ^ 3 := pow_le_pow_left₀ (norm_nonneg _) hX 3 calc ‖E₄trunc τ‖ ^ 3 / ‖ktilde τ‖ ≤ 1.0937 ^ 3 / 0.9907 := - div_le_div₀ (by norm_num1) h1 (by norm_num1) hk - _ ≤ 1.3206 := by norm_num1 + div_le_div₀ (by norm_num) h1 (by norm_num) hk + _ ≤ 1.3206 := by norm_num /-- Paper Lemma `lem3`: `0.7374 ≤ |Jtilde₂|` where `Jtilde₂ = X³/ktilde`. -/ lemma norm_Jtilde2_ge {τ : ℍ} (hτ : τ ∈ Region) : @@ -805,8 +805,8 @@ lemma norm_Jtilde2_ge {τ : ℍ} (hτ : τ ∈ Region) : have hX := norm_E₄trunc_ge hτ have hk := norm_ktilde_le hτ have hkpos : (0 : ℝ) < ‖ktilde τ‖ := by linarith [norm_ktilde_ge hτ] - have h1 : (0.9063 : ℝ) ^ 3 ≤ ‖E₄trunc τ‖ ^ 3 := pow_le_pow_left₀ (by norm_num1) hX 3 - calc (0.7374 : ℝ) ≤ 0.9063 ^ 3 / 1.0094 := by norm_num1 + have h1 : (0.9063 : ℝ) ^ 3 ≤ ‖E₄trunc τ‖ ^ 3 := pow_le_pow_left₀ (by norm_num) hX 3 + calc (0.7374 : ℝ) ≤ 0.9063 ^ 3 / 1.0094 := by norm_num _ ≤ ‖E₄trunc τ‖ ^ 3 / ‖ktilde τ‖ := div_le_div₀ (by positivity) h1 hkpos hk /-- Paper Lemma `lem3`: `|J₂ - Jtilde₂| ≤ 498·|q|²`. -/ @@ -820,7 +820,7 @@ lemma lem3 {τ : ℍ} (hτ : τ ∈ Region) : = (E₄ τ ^ 3 - E₄trunc τ ^ 3 - (E₄trunc τ ^ 3 / ktilde τ) * (kfun τ - ktilde τ)) / kfun τ := by rw [mul_q_J_eq, mul_q_Jtilde_eq hτ] - field_simp (disch := first | assumption | norm_num1 | positivity) + field_simp ring have hkfpos : (0 : ℝ) < ‖kfun τ‖ := norm_pos_iff.mpr hkf rw [hid2, norm_div, div_le_iff₀ hkfpos] @@ -900,7 +900,7 @@ theorem theonaeherJ_lower {τ : ℍ} (hτ : τ ∈ Region) : have heq : 1728 * J τ = (1728 * q τ * J τ) / q τ := by rw [eq_div_iff hq]; ring rw [heq, norm_div, div_lt_div_iff₀ hQpos hQpos] have hlow := norm_mul_q_J_ge hτ - have hQsq : ‖q τ‖ ^ 2 < 0.000389 ^ 2 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num only) + have hQsq : ‖q τ‖ ^ 2 < 0.000389 ^ 2 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num) linarith [mul_le_mul_of_nonneg_right hlow hQpos.le, mul_lt_mul_of_pos_right hQsq hQpos] /-- Paper Theorem `theonaeherJ`, upper bracketing: @@ -913,7 +913,7 @@ theorem theonaeherJ_upper {τ : ℍ} (hτ : τ ∈ Region) : have heq : 1728 * J τ = (1728 * q τ * J τ) / q τ := by rw [eq_div_iff hq]; ring rw [heq, norm_div, div_lt_div_iff₀ hQpos hQpos] have hup := norm_mul_q_J_le hτ - have hQsq : ‖q τ‖ ^ 2 < 0.000389 ^ 2 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num only) + have hQsq : ‖q τ‖ ^ 2 < 0.000389 ^ 2 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num) linarith [mul_le_mul_of_nonneg_right hup hQpos.le, mul_lt_mul_of_pos_right hQsq hQpos] /-- Paper Theorem `theonaeherJ`: `|J(τ)| > 1.096` for `Im τ > 5/4`. -/ @@ -927,12 +927,12 @@ theorem theonaeherJ_norm_J {τ : ℍ} (hτ : τ ∈ Region) : 1.096 < ‖J τ‖ have hd : ‖(1728 : ℂ) * q τ‖ = 1728 * ‖q τ‖ := by rw [norm_mul, Complex.norm_ofNat] rw [show (1728 : ℂ) * q τ * J τ = 1728 * q τ * J τ from rfl, hd, lt_div_iff₀ (by positivity)] have hlow := norm_mul_q_J_ge hτ - have hQsq : ‖q τ‖ ^ 2 < 0.000389 ^ 2 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num only) + have hQsq : ‖q τ‖ ^ 2 < 0.000389 ^ 2 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num) linarith [hlow, hQsq, hQ] /-- `|J(τ)| > 1` for `Im τ > 5/4`; in particular `J(τ) ≠ 0` and `J(τ) ≠ 1` there. -/ theorem one_lt_norm_J {τ : ℍ} (hτ : τ ∈ Region) : 1 < ‖J τ‖ := - lt_trans (by norm_num1) (theonaeherJ_norm_J hτ) + lt_trans (by norm_num) (theonaeherJ_norm_J hτ) /-! ### Theorem `theonaehers2` -/ @@ -958,10 +958,10 @@ theorem theonaehers2 {τ : ℍ} (hτ : τ ∈ Region) : + (E₄ τ - E₄trunc τ) * (E₂star τ - E₂starTrunc τ) - s₂tilde τ * (E₆ τ - E₆trunc τ)) / E₆ τ := by simp only [s₂, s₂tilde_eq] - field_simp (disch := first | assumption | norm_num1 | positivity) + field_simp ring rw [hid, norm_div] - rw [div_lt_iff₀ (lt_trans (by norm_num1) hE6norm : (0 : ℝ) < ‖E₆ τ‖)] + rw [div_lt_iff₀ (lt_trans (by norm_num) hE6norm : (0 : ℝ) < ‖E₆ τ‖)] have hnum : ‖(E₄ τ - E₄trunc τ) * E₂starTrunc τ + E₄trunc τ * (E₂star τ - E₂starTrunc τ) + (E₄ τ - E₄trunc τ) * (E₂star τ - E₂starTrunc τ) - s₂tilde τ * (E₆ τ - E₆trunc τ)‖ @@ -977,12 +977,12 @@ theorem theonaehers2 {τ : ℍ} (hτ : τ ∈ Region) : have h1 : ‖E₄ τ - E₄trunc τ‖ * ‖E₂starTrunc τ‖ ≤ (6744 * Q ^ 3) * 1.0094 := mul_le_mul hdX hZ (norm_nonneg _) (by positivity) have h2 : ‖E₄trunc τ‖ * ‖E₂star τ - E₂starTrunc τ‖ ≤ 1.0937 * (96.2 * Q ^ 3) := - mul_le_mul hX hdZ (norm_nonneg _) (by norm_num1) + mul_le_mul hX hdZ (norm_nonneg _) (by norm_num) have h3 : ‖E₄ τ - E₄trunc τ‖ * ‖E₂star τ - E₂starTrunc τ‖ ≤ (6744 * Q ^ 3) * (96.2 * Q ^ 3) := mul_le_mul hdX hdZ (norm_nonneg _) (by positivity) have h4 : ‖s₂tilde τ‖ * ‖E₆ τ - E₆trunc τ‖ ≤ 1.3776 * (123783 * Q ^ 3) := - mul_le_mul hst hdY (norm_nonneg _) (by norm_num1) - have hQ3 : Q ^ 3 < 0.000389 ^ 3 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num1) + mul_le_mul hst hdY (norm_nonneg _) (by norm_num) + have hQ3 : Q ^ 3 < 0.000389 ^ 3 := pow_lt_pow_left₀ hQ hQpos.le (by norm_num) have hQ6 : (6744 * Q ^ 3) * (96.2 * Q ^ 3) ≤ 1 * Q ^ 3 := by have h33 : Q ^ 3 * Q ^ 3 ≤ 0.000389 ^ 3 * Q ^ 3 := mul_le_mul_of_nonneg_right hQ3.le (pow_pos hQpos 3).le diff --git a/LeanPool/Chudnovsky/Fourier.lean b/LeanPool/Chudnovsky/Fourier.lean index 92332c2a79..921fbd9509 100644 --- a/LeanPool/Chudnovsky/Fourier.lean +++ b/LeanPool/Chudnovsky/Fourier.lean @@ -88,7 +88,7 @@ private lemma pi_C_ne_zero : (π : ℂ) ≠ 0 := by exact_mod_cast Real.pi_ne_ze theorem eta₁_Lτ (τ : ℍ) : (Lτ τ).eta₁ = (π : ℂ) ^ 2 / 3 * E2 τ := by have hz : (2 * riemannZeta 2 : ℂ) ≠ 0 := by rw [riemannZeta_two] - exact mul_ne_zero two_ne_zero (div_ne_zero (pow_ne_zero 2 pi_C_ne_zero) (by norm_num1)) + exact mul_ne_zero two_ne_zero (div_ne_zero (pow_ne_zero 2 pi_C_ne_zero) (by norm_num)) have hE2 : G2 τ = 2 * riemannZeta 2 * E2 τ := by have hdef : E2 τ = (1 / (2 * riemannZeta 2)) • G2 τ := rfl rw [hdef, smul_eq_mul, ← mul_assoc, mul_one_div, div_self hz, one_mul] @@ -96,14 +96,14 @@ theorem eta₁_Lτ (τ : ℍ) : (Lτ τ).eta₁ = (π : ℂ) ^ 2 / 3 * E2 τ := /-- `g₂(L_τ) = (4/3)·π⁴·E₄(τ)` (paper Thm. `fouriertheorem`). -/ theorem g₂_Lτ (τ : ℍ) : (Lτ τ).g₂ = 4 / 3 * (π : ℂ) ^ 4 * E₄ τ := by - rw [PeriodPair.g₂, G_Lτ_eq τ (by norm_num1), eisensteinSeries_eq_two_E τ (by norm_num1)] - rw [show ((4 : ℕ) : ℂ) = 4 by norm_num1, riemannZeta_four] + rw [PeriodPair.g₂, G_Lτ_eq τ (by norm_num), eisensteinSeries_eq_two_E τ (by norm_num)] + rw [show ((4 : ℕ) : ℂ) = 4 by norm_num, riemannZeta_four] ring /-- `g₃(L_τ) = (8/27)·π⁶·E₆(τ)` (paper Thm. `fouriertheorem`). -/ theorem g₃_Lτ (τ : ℍ) : (Lτ τ).g₃ = 8 / 27 * (π : ℂ) ^ 6 * E₆ τ := by - rw [PeriodPair.g₃, G_Lτ_eq τ (by norm_num1), eisensteinSeries_eq_two_E τ (by norm_num1)] - rw [show ((6 : ℕ) : ℂ) = 6 by norm_num1, riemannZeta_six] + rw [PeriodPair.g₃, G_Lτ_eq τ (by norm_num), eisensteinSeries_eq_two_E τ (by norm_num)] + rw [show ((6 : ℕ) : ℂ) = 6 by norm_num, riemannZeta_six] ring /-- `Δ(L_τ) = (2π)¹²/1728·(E₄(τ)³ - E₆(τ)²)` (paper Thm. `fouriertheorem`). -/ @@ -129,8 +129,7 @@ on the connected set `Lᶜ`, hence is constant, and the constant is `-1` by oddn /-- The lattice is a countable subset of `ℂ`. -/ private lemma countable_lattice (L : PeriodPair) : (↑L.lattice : Set ℂ).Countable := by have : Countable ↥L.lattice := countable_of_Lindelof_of_discrete - simpa only [Subtype.range_coe_subtype, - SetLike.setOfPred_mem_eq] using Set.countable_range (Subtype.val : ↥L.lattice → ℂ) + simpa using Set.countable_range (Subtype.val : ↥L.lattice → ℂ) /-- The complement of the lattice is dense in `ℂ`. -/ private lemma dense_compl_lattice (L : PeriodPair) : Dense (↑L.lattice : Set ℂ)ᶜ := @@ -362,7 +361,7 @@ private lemma one_sub_qpow_ne_zero {q : ℂ} (hq : ‖q‖ < 1) (k : ℕ) : private lemma multipliable_qProd_inv_nat {q : ℂ} (hq : ‖q‖ < 1) : Multipliable (fun k : ℕ => (1 - q ^ (k + 1))⁻¹) := by - have hpos : 0 < 1 - ‖q‖ := by linarith only [hq] + have hpos : 0 < 1 - ‖q‖ := by linarith have hsum : Summable (fun k : ℕ => q ^ (k + 1) * (1 - q ^ (k + 1))⁻¹) := by refine Summable.of_norm_bounded (g := fun k : ℕ => ‖q‖ ^ (k + 1) * (1 - ‖q‖)⁻¹) @@ -384,7 +383,7 @@ private lemma combined_eq_Gfun {q : ℂ} (hq : ‖q‖ < 1) (w : ℂ) : have hA := multipliable_qProd_nat hq w have hB := multipliable_qProd_nat hq w⁻¹ have hD : Multipliable (fun k : ℕ => 1 - q ^ (k + 1)) := - (multipliable_qProd_nat hq 1).congr (fun k => by ac_rfl) + (multipliable_qProd_nat hq 1).congr (fun k => by ring) have hDsq : Multipliable (fun k : ℕ => (1 - q ^ (k + 1)) ^ 2) := (hD.mul hD).congr (fun k => (sq _).symm) have hDinv := multipliable_qProd_inv_nat hq @@ -394,7 +393,7 @@ private lemma combined_eq_Gfun {q : ℂ} (hq : ‖q‖ < 1) (w : ℂ) : (1 - q ^ (k + 1) * w) * (1 - q ^ (k + 1) * w⁻¹) / (1 - q ^ (k + 1)) ^ 2) := ((hA.mul hB).mul hEsq).congr (fun k => by rw [div_eq_mul_inv]) have hqP1 : qProd q 1 = ∏' k : ℕ, (1 - q ^ (k + 1)) := by - simp only [qProd]; exact tprod_congr (fun k => by ac_rfl) + simp only [qProd]; exact tprod_congr (fun k => by ring) -- `P · ∏'D² = Q(w)·Q(w⁻¹)` have hcomb : (fun k : ℕ => (1 - q ^ (k + 1) * w) * (1 - q ^ (k + 1) * w⁻¹) / (1 - q ^ (k + 1)) ^ 2 @@ -558,7 +557,7 @@ private lemma qProd_qz_ne_zero (τ : ℍ) {z : ℂ} (hz : z ∉ (Lτ τ).lattice private lemma qProd_qzinv_ne_zero (τ : ℍ) {z : ℂ} (hz : z ∉ (Lτ τ).lattice) : qProd (q τ) (exp (2 * (π : ℂ) * I * z))⁻¹ ≠ 0 := by - have hnegz : -z ∉ (Lτ τ).lattice := fun hc => hz (by simpa only [neg_neg] using neg_mem hc) + have hnegz : -z ∉ (Lτ τ).lattice := fun hc => hz (by simpa using neg_mem hc) exact qProd_ne_zero (norm_q_lt_one τ) (fun k => by rw [qpow_qzinv_eq]; exact exp_add_lattice_ne_one τ hnegz ((k : ℤ) + 1)) @@ -578,7 +577,7 @@ private lemma gfun_ne_zero (τ : ℍ) {z : ℂ} (hz : z ∉ (Lτ τ).lattice) : have hqz1 : exp (2 * (π : ℂ) * I * z) - 1 ≠ 0 := by rw [sub_ne_zero] have := exp_add_lattice_ne_one τ hz 0 - simpa only [ne_eq, Int.cast_zero, zero_mul, zero_add] using this + simpa using this simp only [gfun] exact mul_ne_zero (div_ne_zero hqz1 h2pi) (Gfun_ne_zero τ hz) diff --git a/LeanPool/Chudnovsky/Kummer.lean b/LeanPool/Chudnovsky/Kummer.lean index effe0943e2..5ad75d8db6 100644 --- a/LeanPool/Chudnovsky/Kummer.lean +++ b/LeanPool/Chudnovsky/Kummer.lean @@ -101,7 +101,7 @@ theorem kummerB_satisfiesPicardFuchs : obtain ⟨hznorm, hzim⟩ := hz -- Basic numerical facts on the region `S = {1 < ‖z‖, im z ≠ 0}`. have hz0 : z ≠ 0 := by - intro h; rw [h, norm_zero] at hznorm; exact absurd hznorm (by norm_num only) + intro h; rw [h, norm_zero] at hznorm; exact absurd hznorm (by norm_num) have hz1 : z ≠ 1 := by intro h; rw [h, norm_one] at hznorm; exact absurd hznorm (lt_irrefl 1) have h1z : (1 : ℂ) - z ≠ 0 := sub_ne_zero.2 (Ne.symm hz1) @@ -144,7 +144,7 @@ theorem kummerB_satisfiesPicardFuchs : intro w hw obtain ⟨hwn, hwim⟩ := hw have hw0 : w ≠ 0 := by - intro h; rw [h, norm_zero] at hwn; exact absurd hwn (by norm_num only) + intro h; rw [h, norm_zero] at hwn; exact absurd hwn (by norm_num) have hw1 : w ≠ 1 := by intro h; rw [h, norm_one] at hwn; exact lt_irrefl 1 hwn have hwslit : w ∈ Complex.slitPlane := Or.inr hwim @@ -195,7 +195,7 @@ theorem kummerB_satisfiesPicardFuchs : rw [heqEv.deriv_eq, hderivKummer z ⟨hznorm, hzim⟩, hHD_D1.deriv] simp only [hD1def, kummerB, id_eq, Pi.mul_apply, Pi.neg_apply, Pi.inv_apply, Function.comp_apply] rw [eZ1z, eW1z, hF2] - field_simp (disch := first | assumption | norm_num1 | positivity) + field_simp ring /-- On `Region`, the argument `1/J(τ)` of the hypergeometric function lies in the open unit @@ -342,7 +342,7 @@ private lemma hasDerivAt_invJ (τ : ℍ) (h4 : E₄ τ ≠ 0) : have hq : HasDerivAt (fun z => (E₄ (ofComplex z) ^ 3 - E₆ (ofComplex z) ^ 2) / E₄ (ofComplex z) ^ 3) _ ↑τ := hnum.div hden hden0 - refine hq.congr_deriv (Eq.symm ?_) + convert hq using 1 simp only [Pi.pow_apply, Pi.sub_apply, ofComplex_apply] rw [inv_J_eq] field_simp @@ -412,7 +412,7 @@ private lemma hasDerivAt_XtC (τ : ℍ) (hs : E₄ τ ∈ Complex.slitPlane) (h6 rw [ofComplex_apply] exact hs have h : HasDerivAt XtC _ ↑τ := (hasDerivAt_E₄C τ).cpow_const (c := (1 / 4 : ℂ)) hsC - refine h.congr_deriv (Eq.symm ?_) + convert h using 1 simp only [ofComplex_apply] rw [YtC_apply, Complex.cpow_sub _ _ h4, Complex.cpow_one, inv_J_eq] field_simp @@ -436,9 +436,9 @@ private lemma hasDerivAt_YtC (τ : ℍ) (hs : E₄ τ ∈ Complex.slitPlane) (h6 (12 : ℂ)).mul (hasDerivAt_E₆C τ) have hden0 : 12 * (E₄ (ofComplex ↑τ) ^ 3 - E₆ (ofComplex ↑τ) ^ 2) * E₆ (ofComplex ↑τ) ≠ 0 := by rw [ofComplex_apply] - exact mul_ne_zero (mul_ne_zero (by norm_num only) hB) h6 + exact mul_ne_zero (mul_ne_zero (by norm_num) hB) h6 have h : HasDerivAt YtC _ ↑τ := hnum.div hden hden0 - refine h.congr_deriv (Eq.symm ?_) + convert h using 1 simp only [Pi.pow_apply, Pi.sub_apply, Pi.mul_apply, ofComplex_apply] rw [XtC_apply, YtC_apply] simp only [m22] @@ -455,7 +455,7 @@ private lemma hasDerivAt_WrC (τ : ℍ) (hs : E₄ τ ∈ Complex.slitPlane) (h6 have h : HasDerivAt WrC _ ↑τ := ((hasDerivAt_XhC τ h4 hu).mul (hasDerivAt_YtC τ hs h6)).sub ((hasDerivAt_YhC τ h4 h6 hu).mul (hasDerivAt_XtC τ hs h6)) - refine h.congr_deriv (Eq.symm ?_) + convert h using 1 rw [WrC_apply] ring @@ -499,7 +499,7 @@ private lemma deriv_hyp2F1_zero : deriv hyp2F1 0 = 5 / 144 := by rw [hat.deriv, ordinaryHypergeometricSeries_apply_eq] simp only [ascPochhammer_one, Polynomial.eval_X, Nat.factorial_one, Nat.cast_one, inv_one, one_mul, one_pow, smul_eq_mul, mul_one] - norm_num only + norm_num private lemma tendsto_YhC : Tendsto (fun τ : ℍ => YhC ↑τ) atImInfty (𝓝 (5 / 144)) := by have hF : ContinuousAt (deriv hyp2F1) 0 := @@ -608,7 +608,7 @@ private lemma near_one_slitPlane {z : ℂ} (h : ‖z - 1‖ < 1 / 2) : z ∈ Com private lemma near_one_ne_zero {z : ℂ} (h : ‖z - 1‖ < 1 / 2) : z ≠ 0 := by intro h0 rw [h0, zero_sub, norm_neg, norm_one] at h - norm_num only at h + norm_num at h private lemma re_le_neg_half {z : ℂ} (h : ‖z + 1‖ < 1 / 2) : z.re ≤ -(1 / 2) := by have h1 : |(z + 1).re| ≤ ‖z + 1‖ := Complex.abs_re_le_norm _ @@ -683,7 +683,7 @@ private lemma tendsto_vertical {z₀ : ℂ} (h : 0 < z₀.im) : exact tendsto_comap_iff.mpr key /-- **Vanishing of the Wronskian** on `{Im z > A}`: a solution of `D w = M₂₂ w` with -`Re M₂₂ ≤ -1/2` has nondecreasing squared modulus along vertical lines, so `w → 0` at +`Re M₂₂ ≤ -1/2` has `‖w‖²·e^{-2πt}` nondecreasing along vertical lines, so `w → 0` at `i∞` forces `w = 0`. -/ private lemma WrC_eq_zero {A : ℝ} (hA : 2 ≤ A) (hgood : ∀ σ : ℍ, A ≤ σ.im → @@ -874,7 +874,7 @@ theorem E₄_eq_hyp2F1_pow_four {τ : ℍ} (hτ : τ ∈ Region) : have h := XtC_eq_XhC hA2 hgood hw have h4 : E₄ (ofComplex w) = XtC w ^ 4 := by rw [show XtC w = E₄ (ofComplex w) ^ (1 / 4 : ℂ) from rfl, ← Complex.cpow_nat_mul, - show ((4 : ℕ) : ℂ) * (1 / 4) = 1 by norm_num only, Complex.cpow_one] + show ((4 : ℕ) : ℂ) * (1 / 4) = 1 by norm_num, Complex.cpow_one] rw [h4, h] rfl -- both sides are analytic on `S = {Im z > 5/4}` @@ -890,7 +890,7 @@ theorem E₄_eq_hyp2F1_pow_four {τ : ℍ} (hτ : τ ∈ Region) : have hg : AnalyticOnNhd ℂ (fun w => hyp2F1 (J (ofComplex w))⁻¹ ^ 4) {w : ℂ | 5 / 4 < w.im} := by refine DifferentiableOn.analyticOnNhd (fun w hw => ?_) hSo - have hw0 : 0 < w.im := lt_trans (by norm_num only) hw + have hw0 : 0 < w.im := lt_trans (by norm_num) hw have hR : ofComplex w ∈ Region := by change 5 / 4 < (ofComplex w).im rw [im_ofComplex hw0] @@ -913,7 +913,7 @@ theorem E₄_eq_hyp2F1_pow_four {τ : ℍ} (hτ : τ ∈ Region) : refine (isOpen_lt continuous_const Complex.continuous_im).mem_nhds ?_ change A < (((A + 1 : ℝ) : ℂ) * Complex.I).im rw [him] - linarith only [] + linarith exact Filter.eventuallyEq_of_mem hmem fun w hw => hΩeq w hw have heq := hf.eqOn_of_preconnected_of_eventuallyEq hg hSc hz₀S hev have hτS : (↑τ : ℂ) ∈ {w : ℂ | 5 / 4 < w.im} := by diff --git a/LeanPool/Chudnovsky/Liouville.lean b/LeanPool/Chudnovsky/Liouville.lean index 208d7a8342..ac2e4c5c89 100644 --- a/LeanPool/Chudnovsky/Liouville.lean +++ b/LeanPool/Chudnovsky/Liouville.lean @@ -283,7 +283,7 @@ private lemma finite_fundamentalParallelogram_inter {L : PeriodPair} {S : Set ≤ ‖s • L.ω₁‖ + ‖t • L.ω₂‖ := norm_add_le _ _ _ = |s| * ‖L.ω₁‖ + |t| * ‖L.ω₂‖ := by rw [norm_smul, norm_smul, Real.norm_eq_abs, Real.norm_eq_abs] - _ ≤ ‖L.ω₁‖ + ‖L.ω₂‖ := by nlinarith [norm_nonneg L.ω₁, norm_nonneg L.ω₂] + _ ≤ ‖L.ω₁‖ + ‖L.ω₂‖ := by nlinarith only [hs1, ht1, norm_nonneg L.ω₁, norm_nonneg L.ω₂] exact (Metric.finite_isBounded_inter_isClosed hdisc Metric.isBounded_closedBall hclosed).subset (Set.inter_subset_inter_left S hPsub) @@ -1094,8 +1094,7 @@ private lemma exists_decomposition {f : ℂ → ℂ} {c : ℂ} (hf : Meromorphic by_cases hord : meromorphicOrderAt f c = ⊤ · refine ⟨0, 0, fun _ => 0, fun _ => 0, analyticAt_const, ?_⟩ filter_upwards [meromorphicOrderAt_eq_top_iff.mp hord] with z hz - simp only [hz, zero_mul, Finset.range_zero, neg_add_rev, Int.reduceNeg, Finset.sum_const_zero, - add_zero] + simp [hz] · obtain ⟨g, hg_an, hg_ne, hg_eq⟩ := (meromorphicOrderAt_ne_top_iff hf).1 hord set n : ℤ := (meromorphicOrderAt f c).untop₀ with hn by_cases hn0 : 0 ≤ n @@ -1121,7 +1120,7 @@ private lemma exists_decomposition {f : ℂ → ℂ} {c : ℂ} (hf : Meromorphic obtain ⟨A, h, hh, hEq⟩ := exists_principalPart (N + 1) g c hg_an refine ⟨A 0, N, fun k => A (k + 1), h, hh, ?_⟩ filter_upwards [hg_eq, self_mem_nhdsWithin] with z hz hzne - have hzc : z ≠ c := by simpa only [ne_eq, Set.mem_compl_iff, Set.mem_singleton_iff] using hzne + have hzc : z ≠ c := by simpa using hzne rw [hz, smul_eq_mul, show n = -(((N + 1 : ℕ) : ℤ)) from by linarith [hN₁n], hEq z hzc, Finset.sum_range_succ'] @@ -1133,7 +1132,7 @@ private lemma exists_decomposition {f : ℂ → ℂ} {c : ℂ} (hf : Meromorphic rw [Finset.sum_congr rfl hre] push_cast ring_nf - rw [show (-1 : ℤ) = -(0 + 1) from by ac_rfl, ← zpow_neg_one (z - c)] + rw [show (-1 : ℤ) = -(0 + 1) from by ring, ← zpow_neg_one (z - c)] ring_nf /-- The residue of a decomposition `a·(z-c)⁻¹ + higher principal part + analytic` is `a`. -/ @@ -1214,10 +1213,8 @@ private lemma analyticAt_sub_zpow (c : ℂ) (n : ℤ) {z : ℂ} (hzc : z ≠ c) intro w hw apply DifferentiableAt.differentiableWithinAt have hbase : DifferentiableAt ℂ (fun w : ℂ ↦ w - c) w := differentiableAt_id.sub_const c - exact hbase.zpow (Or.inl (sub_ne_zero.2 (by simpa only [ne_eq, Set.mem_compl_iff, - Set.mem_singleton_iff] using hw))) - exact hd.analyticOnNhd isOpen_compl_singleton z (by simpa only [Set.mem_compl_iff, - Set.mem_singleton_iff, ne_eq] using hzc) + exact hbase.zpow (Or.inl (sub_ne_zero.2 (by simpa using hw))) + exact hd.analyticOnNhd isOpen_compl_singleton z (by simpa using hzc) /-- Away from `c`, the simple pole `(w - c)⁻¹` is analytic. -/ private lemma analyticAt_sub_inv (c : ℂ) {z : ℂ} (hzc : z ≠ c) : @@ -1226,10 +1223,8 @@ private lemma analyticAt_sub_inv (c : ℂ) {z : ℂ} (hzc : z ≠ c) : intro w hw apply DifferentiableAt.differentiableWithinAt have hbase : DifferentiableAt ℂ (fun w : ℂ ↦ w - c) w := differentiableAt_id.sub_const c - exact hbase.inv (sub_ne_zero.2 (by simpa only [ne_eq, Set.mem_compl_iff, - Set.mem_singleton_iff] using hw)) - exact hd.analyticOnNhd isOpen_compl_singleton z (by simpa only [Set.mem_compl_iff, - Set.mem_singleton_iff, ne_eq] using hzc) + exact hbase.inv (sub_ne_zero.2 (by simpa using hw)) + exact hd.analyticOnNhd isOpen_compl_singleton z (by simpa using hzc) /-- The boundary integral of a principal part `a·(z-c)⁻¹ + higher-order terms` reduces to `a` times the boundary integral of the simple pole: the higher-order (order `≤ -2`) terms diff --git a/LeanPool/Chudnovsky/MainTheorem.lean b/LeanPool/Chudnovsky/MainTheorem.lean index 03cbf10bc5..754f82098e 100644 --- a/LeanPool/Chudnovsky/MainTheorem.lean +++ b/LeanPool/Chudnovsky/MainTheorem.lean @@ -86,7 +86,7 @@ private theorem factorial_ratio_succ (n : ℕ) : _ = 1728 * (((3 * n + 3) * (3 * n + 2) * (3 * n + 1)) * (n + 1) ^ 3) := by ring calc (6 * (n + 1))! * ((3 * n)! * (n !) ^ 3 * 1728 ^ n) = ((6 * n + 6) * (6 * n + 5) * (6 * n + 4) * (6 * n + 3) * (6 * n + 2) * (6 * n + 1)) - * ((6 * n)! * ((3 * n)! * (n !) ^ 3 * 1728 ^ n)) := by rw [e6]; ac_rfl + * ((6 * n)! * ((3 * n)! * (n !) ^ 3 * 1728 ^ n)) := by rw [e6]; ring _ ≤ (1728 * (((3 * n + 3) * (3 * n + 2) * (3 * n + 1)) * (n + 1) ^ 3)) * ((6 * n)! * ((3 * n)! * (n !) ^ 3 * 1728 ^ n)) := Nat.mul_le_mul hPQ le_rfl _ = (6 * n)! * ((3 * (n + 1))! * ((n + 1)!) ^ 3 * 1728 ^ (n + 1)) := by @@ -96,7 +96,7 @@ private theorem factorial_ratio_succ (n : ℕ) : theorem factorial_ratio_le (n : ℕ) : (6 * n)! ≤ 1728 ^ n * ((3 * n)! * (n !) ^ 3) := by induction n with - | zero => simp only [mul_zero, factorial_zero, pow_zero, one_pow, mul_one, Std.le_refl] + | zero => simp | succ n ih => apply (mul_le_mul_iff_of_pos_right (by positivity : 0 < (3 * n)! * (n !) ^ 3 * 1728 ^ n)).mp @@ -106,7 +106,7 @@ theorem factorial_ratio_le (n : ℕ) : _ ≤ (1728 ^ n * ((3 * n)! * (n !) ^ 3)) * ((3 * (n + 1))! * ((n + 1)!) ^ 3 * 1728 ^ (n + 1)) := Nat.mul_le_mul_right _ ih _ = (1728 ^ (n + 1) * ((3 * (n + 1))! * ((n + 1)!) ^ 3)) - * ((3 * n)! * (n !) ^ 3 * 1728 ^ n) := by ac_rfl + * ((3 * n)! * (n !) ^ 3 * 1728 ^ n) := by ring /-- The Main Theorem's series converges absolutely on the region `Im τ > 1.25` (ratio test: `(6n)!/((3n)!(n!)³) ≤ 1728ⁿ` and `‖1728·J‖ > 1728` on the region). -/ @@ -217,7 +217,7 @@ theorem isPreconnected_Region : IsPreconnected (Region : Set ℍ) := by · rintro ⟨τ, hτ, rfl⟩ rw [UpperHalfPlane.coe_im]; exact hτ · intro hz - exact ⟨⟨z, lt_trans (by norm_num1) hz⟩, hz, rfl⟩ + exact ⟨⟨z, lt_trans (by norm_num) hz⟩, hz, rfl⟩ rw [himg] exact (convex_halfSpace_im_gt (5 / 4)).isPreconnected @@ -248,7 +248,7 @@ private lemma Gsq_eq_tsum {z : ℂ} (hz : ‖z‖ < 1) : refine tsum_congr fun n => ?_ have h3n : ((3 * n)! : ℂ) ≠ 0 := Nat.cast_ne_zero.2 (Nat.factorial_ne_zero _) have hn : ((n ! : ℕ) : ℂ) ≠ 0 := Nat.cast_ne_zero.2 (Nat.factorial_ne_zero n) - have h12 : ((12 : ℂ)) ^ (3 * n) = 1728 ^ n := by rw [pow_mul]; norm_num only + have h12 : ((12 : ℂ)) ^ (3 * n) = 1728 ^ n := by rw [pow_mul]; norm_num rw [mainCoeff, h12] field_simp @@ -310,7 +310,7 @@ private lemma mainSummand_eq {τ : ℍ} (hJ0 : J τ ≠ 0) (n : ℕ) : mainSummand τ n = ((1 - s₂ τ) / 6 + n) * (mainCoeff n * (1 / J τ) ^ n) := by have h3n : ((3 * n)! : ℂ) ≠ 0 := Nat.cast_ne_zero.2 (Nat.factorial_ne_zero _) have hn : ((n ! : ℕ) : ℂ) ≠ 0 := Nat.cast_ne_zero.2 (Nat.factorial_ne_zero n) - have h1728 : (1728 : ℂ) ≠ 0 := by norm_num1 + have h1728 : (1728 : ℂ) ≠ 0 := by norm_num have hJn : J τ ^ n ≠ 0 := pow_ne_zero n hJ0 rw [mainSummand, mainCoeff, mul_pow, one_div, inv_pow] field_simp @@ -346,7 +346,7 @@ private lemma norm_mainCoeff_antitone : Antitone fun n => ‖mainCoeff n‖ := `0.15` of `1`. Six explicit terms of the (positive, decreasing) coefficient sequence `mainCoeff` plus a geometric tail. -/ private lemma norm_Gsq_sub_one_le {z : ℂ} (hz : ‖z‖ ≤ 0.9125) : ‖Gsq z - 1‖ ≤ 0.15 := by - have hz1 : ‖z‖ < 1 := lt_of_le_of_lt hz (by norm_num1) + have hz1 : ‖z‖ < 1 := lt_of_le_of_lt hz (by norm_num) have hz0 : (0 : ℝ) ≤ ‖z‖ := norm_nonneg z -- summability of the series and of its norms have hSnorm : Summable fun n : ℕ => ‖mainCoeff n * z ^ n‖ := by @@ -405,15 +405,15 @@ private lemma norm_Gsq_sub_one_le {z : ℂ} (hz : ‖z‖ ≤ 0.9125) : ‖Gsq z hterm _ _ hc _ = (0.00467 * 0.9125 ^ 7) * 0.9125 ^ i := by ring have hgeom : Summable fun i : ℕ => (0.00467 * 0.9125 ^ 7 : ℝ) * 0.9125 ^ i := - (summable_geometric_of_lt_one (by norm_num1) (by norm_num1)).mul_left _ + (summable_geometric_of_lt_one (by norm_num) (by norm_num)).mul_left _ calc ∑' i : ℕ, ‖mainCoeff (i + 6 + 1) * z ^ (i + 6 + 1)‖ ≤ ∑' i : ℕ, (0.00467 * 0.9125 ^ 7 : ℝ) * 0.9125 ^ i := ((summable_nat_add_iff (f := fun n : ℕ => ‖mainCoeff (n + 1) * z ^ (n + 1)‖) 6).mpr hSnorm1).tsum_le_tsum hmaj hgeom _ = (0.00467 * 0.9125 ^ 7) * (1 - 0.9125)⁻¹ := by - rw [tsum_mul_left, tsum_geometric_of_lt_one (by norm_num1) (by norm_num1)] + rw [tsum_mul_left, tsum_geometric_of_lt_one (by norm_num) (by norm_num)] refine le_trans (add_le_add hhead htail) ?_ - norm_num1 + norm_num /-- On `Region`, `E₆` is within `0.199` of `1` (from the truncation bounds of `Estimates.lean`). -/ @@ -423,13 +423,13 @@ private lemma norm_E₆_sub_one_le {τ : ℍ} (hτ : τ ∈ Region) : ‖E₆ τ have hQ : Q < 0.000389 := lt_trans (norm_q_lt_of_mem_Region hτ) exp_neg_bound have htail : ‖eisensteinTail 5 3 τ‖ ≤ 245.6 * Q ^ 3 := norm_eisensteinTail_sigma₅ hτ have hqq : ‖q τ + (33 : ℂ) * q τ ^ 2‖ ≤ Q + 33 * Q ^ 2 := - norm_q_add_smul_sq_le (by norm_num1) + norm_q_add_smul_sq_le (by norm_num) have heq : E₆ τ - 1 = -(504 * (q τ + 33 * q τ ^ 2)) - 504 * eisensteinTail 5 3 τ := by rw [E₆_eq_trunc τ, E₆trunc]; ring rw [heq] refine le_trans (norm_sub_le _ _) ?_ rw [norm_neg, norm_mul, norm_mul, Complex.norm_ofNat] - nlinarith [norm_nonneg (eisensteinTail 5 3 τ), pow_pos hQpos 2, pow_pos hQpos 3] + nlinarith only [hQ, htail, hqq, pow_pos hQpos 3] /-- If `a` is closer to `b` than `b` is to `0`, then `a/b` lies in the right half-plane. -/ private lemma re_div_pos_of_norm_sub_lt {a b : ℂ} (hb : ‖a - b‖ < ‖b‖) : 0 < (a / b).re := by @@ -485,8 +485,8 @@ private lemma hasDerivAt_J_comp (τ : ℍ) : (-(2 * π * Complex.I) * E₄ τ ^ 2 * E₆ τ / (E₄ τ ^ 3 - E₆ τ ^ 2)) ↑τ := by have h4 := hasDerivAt_E₄_comp τ have h6 := hasDerivAt_E₆_comp τ - have hcomp4 : ((⇑E₄) ∘ ofComplex) ↑τ = E₄ τ := by simp only [Function.comp_apply, ofComplex_apply] - have hcomp6 : ((⇑E₆) ∘ ofComplex) ↑τ = E₆ τ := by simp only [Function.comp_apply, ofComplex_apply] + have hcomp4 : ((⇑E₄) ∘ ofComplex) ↑τ = E₄ τ := by simp [Function.comp_apply, ofComplex_apply] + have hcomp6 : ((⇑E₆) ∘ ofComplex) ↑τ = E₆ τ := by simp [Function.comp_apply, ofComplex_apply] have hden : ((⇑E₄ ∘ ofComplex) ↑τ) ^ 3 - ((⇑E₆ ∘ ofComplex) ↑τ) ^ 2 ≠ 0 := by rw [hcomp4, hcomp6]; exact E₄_cube_sub_E₆_sq_ne_zero τ have hquot := (h4.pow 3).div ((h4.pow 3).sub (h6.pow 2)) hden @@ -509,7 +509,7 @@ private lemma E2_mul_eq_of_mem_Region {τ : ℍ} (hτ : τ ∈ Region) : -- non-vanishing facts have hJnorm : 1 < ‖J τ‖ := one_lt_norm_J hτ have hJ0 : J τ ≠ 0 := by - intro h; rw [h, norm_zero] at hJnorm; norm_num1 at hJnorm + intro h; rw [h, norm_zero] at hJnorm; norm_num at hJnorm have hden : E₄ τ ^ 3 - E₆ τ ^ 2 ≠ 0 := E₄_cube_sub_E₆_sq_ne_zero τ have hE₄0 : E₄ τ ≠ 0 := by intro h @@ -545,7 +545,7 @@ private lemma E2_mul_eq_of_mem_Region {τ : ℍ} (hτ : τ ∈ Region) : have hev : (⇑E₄ ∘ ofComplex) =ᶠ[nhds (↑τ : ℂ)] fun z => hyp2F1 (((J ∘ ofComplex) z)⁻¹) ^ 4 := by filter_upwards [hopen.mem_nhds hmem] with z hz - have hz0 : 0 < z.im := lt_trans (by norm_num1) hz + have hz0 : 0 < z.im := lt_trans (by norm_num) hz have hzR : ofComplex z ∈ Region := by rw [ofComplex_apply_of_im_pos hz0] exact hz @@ -638,7 +638,7 @@ theorem thm42 {τ : ℍ} (hτ : τ ∈ Region) : refine le_trans (norm_add_le _ _) (le_trans (add_le_add (norm_add_le _ _) le_rfl) ?_) rw [norm_pow, norm_mul, norm_mul, Complex.norm_ofNat, norm_pow] have h0 : (0 : ℝ) ≤ ‖hyp2F1 (J τ)⁻¹ ^ 2 - 1‖ := norm_nonneg _ - nlinarith [hb2] + nlinarith only [hb2, h0] have hE₆b : ‖E₆ τ - 1‖ ≤ 0.199 := norm_E₆_sub_one_le hτ have hE₆big : (0.8 : ℝ) < ‖E₆ τ‖ := lemE6 hτ have hsub : ‖hyp2F1 (J τ)⁻¹ ^ 6 - E₆ τ‖ < ‖E₆ τ‖ := by diff --git a/LeanPool/Chudnovsky/Numerics.lean b/LeanPool/Chudnovsky/Numerics.lean index 0a7d4b3e15..3a585ea5b9 100644 --- a/LeanPool/Chudnovsky/Numerics.lean +++ b/LeanPool/Chudnovsky/Numerics.lean @@ -64,12 +64,12 @@ the endpoint rationals below satisfy `lo² < 163 < hi²` (verified exactly). -/ /-- Lower bound for `√163` (21 significant digits). To be proved from `lo² < 163` via `Real.lt_sqrt` / `nlinarith` (PLAN D1). -/ theorem sqrt_163_gt : 12.7671453348037046617 < Real.sqrt 163 := by - rw [Real.lt_sqrt (by norm_num1)]; norm_num1 + rw [Real.lt_sqrt (by norm_num)]; norm_num /-- Upper bound for `√163` (21 significant digits). To be proved from `163 < hi²` via `Real.sqrt_lt'` / `nlinarith` (PLAN D1). -/ theorem sqrt_163_lt : Real.sqrt 163 < 12.7671453348037046618 := by - rw [Real.sqrt_lt' (by norm_num1)]; norm_num1 + rw [Real.sqrt_lt' (by norm_num)]; norm_num /-! ### High-precision internal bounds (Phase D1 certificates) @@ -185,12 +185,12 @@ private theorem pi_lt_d38 : private theorem sqrt_163_gt_d38 : (638357266740185233085547600489044617369/50000000000000000000000000000000000000 : ℝ) < Real.sqrt 163 := by - rw [Real.lt_sqrt (by norm_num1)]; norm_num1 + rw [Real.lt_sqrt (by norm_num)]; norm_num /-- Internal 38-digit upper bound for `√163`. -/ private theorem sqrt_163_lt_d38 : Real.sqrt 163 < (1276714533480370466171095200978089234739/100000000000000000000000000000000000000 : ℝ) := by - rw [Real.sqrt_lt' (by norm_num1)]; norm_num1 + rw [Real.sqrt_lt' (by norm_num)]; norm_num /-- Rational lower bound for `x := π·√163`: `x_lo < π·√163`. -/ private theorem x_lo_lt : @@ -200,9 +200,9 @@ private theorem x_lo_lt : (314159265358979323846264338327950288419/100000000000000000000000000000000000000 : ℝ) * (638357266740185233085547600489044617369/50000000000000000000000000000000000000 : ℝ) < π * Real.sqrt 163 := - mul_lt_mul'' pi_gt_d38 sqrt_163_gt_d38 (by norm_num1) (by norm_num1) + mul_lt_mul'' pi_gt_d38 sqrt_163_gt_d38 (by norm_num) (by norm_num) refine lt_of_le_of_lt ?_ h - norm_num1 + norm_num /-- Rational upper bound for `x := π·√163`: `π·√163 < x_hi`. -/ private theorem lt_x_hi : π * Real.sqrt 163 < @@ -212,7 +212,7 @@ private theorem lt_x_hi : π * Real.sqrt 163 < * (1276714533480370466171095200978089234739/100000000000000000000000000000000000000 : ℝ) := mul_lt_mul'' pi_lt_d38 sqrt_163_lt_d38 Real.pi_pos.le (Real.sqrt_nonneg 163) refine lt_of_lt_of_le h ?_ - norm_num1 + norm_num /-- Upper bound for `exp(x_hi/128)` from the degree-26 Taylor remainder. -/ private theorem exp_b_le : @@ -222,10 +222,10 @@ private theorem exp_b_le : ℝ) := by have hb := Real.exp_bound' (x := (4010916999113251975535008362290414005397/12800000000000000000000000000000000000000 : ℝ)) - (by norm_num1) (by norm_num1) (n := 26) - (by norm_num1) + (by norm_num) (by norm_num) (n := 26) + (by norm_num) refine hb.trans ?_ - norm_num only [Finset.sum_range_succ, Nat.factorial] + norm_num [Finset.sum_range_succ, Nat.factorial] /-- Lower bound for `exp(x_lo/128)` from the degree-26 Taylor partial sum. -/ private theorem le_exp_a : @@ -233,8 +233,8 @@ private theorem le_exp_a : ℝ) ≤ Real.exp (200545849955662598776750418114520700269/640000000000000000000000000000000000000 : ℝ) := by - refine le_trans ?_ (Real.sum_le_exp_of_nonneg (by norm_num1) 26) - norm_num only [Finset.sum_range_succ, Nat.factorial] + refine le_trans ?_ (Real.sum_le_exp_of_nonneg (by norm_num) 26) + norm_num [Finset.sum_range_succ, Nat.factorial] /-- `exp(π·√163) < (exp(x_hi/128))^128`-bound. -/ private theorem exp_pi_sqrt_163_lt_Ubig : @@ -255,7 +255,7 @@ private theorem exp_pi_sqrt_163_lt_Ubig : rw [show (4010916999113251975535008362290414005397/100000000000000000000000000000000000000 : ℝ) = (128 : ℕ) * (4010916999113251975535008362290414005397/12800000000000000000000000000000000000000 : ℝ) - by push_cast; norm_num1, Real.exp_nat_mul] + by push_cast; norm_num, Real.exp_nat_mul] rw [e] exact pow_le_pow_left₀ (Real.exp_nonneg _) exp_b_le 128 @@ -277,9 +277,9 @@ private theorem Lbig_lt_exp_pi_sqrt_163 : rw [show (200545849955662598776750418114520700269/5000000000000000000000000000000000000 : ℝ) = (128 : ℕ) * (200545849955662598776750418114520700269/640000000000000000000000000000000000000 : ℝ) - by push_cast; norm_num1, Real.exp_nat_mul] + by push_cast; norm_num, Real.exp_nat_mul] rw [e] - exact pow_le_pow_left₀ (by norm_num1) le_exp_a 128 + exact pow_le_pow_left₀ (by norm_num) le_exp_a 128 /-! ### Bounds for `e^{-π√163}` @@ -301,7 +301,7 @@ theorem exp_neg_pi_sqrt_163_gt : ℝ) ^ 128 := by positivity have hEpos : (0 : ℝ) < Real.exp (π * Real.sqrt 163) := Real.exp_pos _ refine lt_of_le_of_lt ?_ ((inv_lt_inv₀ hUpos hEpos).mpr hE) - rw [← one_div, le_div_iff₀ hUpos]; norm_num1 + rw [← one_div, le_div_iff₀ hUpos]; norm_num /-- Upper bound for `e^{-π√163}` (30 significant digits), i.e. `e^{-π√163} < 380898093700765233822623151648 / 10^47`. @@ -317,7 +317,7 @@ theorem exp_neg_pi_sqrt_163_lt : ℝ) ^ 128 := by positivity have hEpos : (0 : ℝ) < Real.exp (π * Real.sqrt 163) := Real.exp_pos _ refine lt_of_lt_of_le ((inv_lt_inv₀ hEpos hLpos).mpr hE) ?_ - rw [← one_div, div_le_iff₀ hLpos]; norm_num1 + rw [← one_div, div_le_iff₀ hLpos]; norm_num /-! ### The nome at `τ₁₆₃` -/ diff --git a/LeanPool/Chudnovsky/Quasiperiods.lean b/LeanPool/Chudnovsky/Quasiperiods.lean index 0edc59947f..49c5850e75 100644 --- a/LeanPool/Chudnovsky/Quasiperiods.lean +++ b/LeanPool/Chudnovsky/Quasiperiods.lean @@ -49,8 +49,7 @@ def eta₂ : ℂ := 2 * L.weierstrassZeta (L.ω₂ / 2) /-- The lattice is a countable subset of `ℂ`. -/ private lemma countable_lattice : (↑L.lattice : Set ℂ).Countable := by have : Countable ↥L.lattice := countable_of_Lindelof_of_discrete - simpa only [Subtype.range_coe_subtype, - SetLike.setOfPred_mem_eq] using Set.countable_range (Subtype.val : ↥L.lattice → ℂ) + simpa using Set.countable_range (Subtype.val : ↥L.lattice → ℂ) /-- Quasi-periodicity of `ζ` in an arbitrary period direction `ω ∈ L` (with `ω/2 ∉ L`): `ζ(z+ω) = ζ(z) + 2ζ(ω/2)` for `z ∉ L`. Both quasi-period statements are instances of this. -/ @@ -319,7 +318,7 @@ private lemma bridgeF_summable (τ : ℍ) {z : ℂ} exact (Equiv.summable_iff (f := fun pp : {p : ℤ × ℤ // p ≠ 0} => weierstrassZetaTerm (z + 1) ((bridgeEqv τ pp.1 : (Lτ τ).lattice) : ℂ) - weierstrassZetaTerm z ((bridgeEqv τ pp.1 : (Lτ τ).lattice) : ℂ)) - (Equiv.subtypeEquivRight (fun x => by simp only [mem_singleton, ne_eq]))).mpr hFsum_sub + (Equiv.subtypeEquivRight (fun x => by simp))).mpr hFsum_sub refine hFsum.congr (fun p => ?_) simp only [bridgeF, bridgeEqv_coe] @@ -445,14 +444,14 @@ private theorem legendre_Lτ_aux (τ : ℍ) : refine ⟨(-(n : ℂ)) + (m : ℂ) * (τ : ℂ), PeriodPair.mem_lattice.mpr ⟨-n, m, by push_cast; simp [Chudnovsky.Lτ_ω₁, Chudnovsky.Lτ_ω₂]⟩, ?_⟩ - field_simp (disch := first | assumption | norm_num1 | positivity) + field_simp ring · rintro ⟨w, hw, rfl⟩ obtain ⟨m, n, rfl⟩ := PeriodPair.mem_lattice.mp hw refine ⟨n, -m, ?_⟩ simp only [Chudnovsky.Lτ_ω₁, Chudnovsky.Lτ_ω₂] push_cast - field_simp (disch := first | assumption | norm_num1 | positivity) + field_simp ring -- `(u • L_τ) ζ` at `1/2` equals `τ · ζ_{L_τ}(τ/2)`. have hz : (u : ℂ) * ((τ : ℂ) / 2) = 1 / 2 := by diff --git a/LeanPool/Chudnovsky/Ramanujan.lean b/LeanPool/Chudnovsky/Ramanujan.lean index bc4463de14..e23e39af6a 100644 --- a/LeanPool/Chudnovsky/Ramanujan.lean +++ b/LeanPool/Chudnovsky/Ramanujan.lean @@ -83,7 +83,7 @@ private lemma denom_T (τ : ℍ) : denom ModularGroup.T τ = 1 := by lemma E2_vadd_one (τ : ℍ) : E2 ((1 : ℝ) +ᵥ τ) = E2 τ := by have h := congr_fun E2_slash_T τ rw [SL_slash_apply, denom_T, modular_T_smul] at h - simpa only [Int.reduceNeg, zpow_neg, zpow_ofNat, one_pow, inv_one, mul_one] using h + simpa using h lemma E2_periodic_comp_ofComplex : Periodic (E2 ∘ ofComplex) 1 := periodic_comp_ofComplex_of_vadd E2_vadd_one @@ -103,7 +103,7 @@ lemma E2_S_smul (τ : ℍ) : have hkey : (6 : ℂ) / (π * I) = -(6 * I / π) := by rw [div_mul_eq_div_div, div_I]; ring rw [h, hkey] - field_simp (disch := first | assumption | norm_num1 | positivity) + field_simp ring /-- Any level-one modular form is invariant under `τ ↦ τ + 1`. -/ @@ -147,7 +147,7 @@ lemma tendsto_E2_atImInfty : Tendsto E2 atImInfty (𝓝 1) := by have hr0 : 0 < r := Real.exp_pos _ have hr1 : r < 1 := by rw [hrdef, Real.exp_lt_one_iff] - have := Real.pi_pos; linarith only [this] + have := Real.pi_pos; linarith -- the constant `C = ∑ (n+1)²·rⁿ` have hC : Summable fun n : ℕ ↦ ((n : ℝ) + 1) ^ 2 * r ^ n := by have h2 : Summable fun n : ℕ ↦ (n : ℝ) ^ 2 * r ^ n := @@ -165,7 +165,7 @@ lemma tendsto_E2_atImInfty : Tendsto E2 atImInfty (𝓝 1) := by have hx0 : (0 : ℝ) ≤ ‖q τ‖ := norm_nonneg _ have hxr : ‖q τ‖ ≤ r := by rw [norm_q, hrdef, Real.exp_le_exp] - have := Real.pi_pos; nlinarith + have := Real.pi_pos; nlinarith only [him, this] have hE : E2 τ - 1 = -(24 * ∑' n : ℕ, (ArithmeticFunction.sigma 1 (n + 1) : ℂ) * q τ ^ (n + 1)) := by rw [E2_eq_one_sub_tsum τ]; ring @@ -190,14 +190,14 @@ lemma tendsto_E2_atImInfty : Tendsto E2 atImInfty (𝓝 1) := by calc (ArithmeticFunction.sigma 1 (n + 1) : ℝ) * (‖q τ‖ ^ n * ‖q τ‖) ≤ ((n : ℝ) + 1) ^ 2 * (r ^ n * ‖q τ‖) := by apply mul_le_mul hσ (by gcongr) (by positivity) (by positivity) - _ = ((n : ℝ) + 1) ^ 2 * r ^ n * ‖q τ‖ := by ac_rfl + _ = ((n : ℝ) + 1) ^ 2 * r ^ n * ‖q τ‖ := by ring rw [hE, norm_neg, norm_mul] calc ‖(24 : ℂ)‖ * ‖∑' n : ℕ, (ArithmeticFunction.sigma 1 (n + 1) : ℂ) * q τ ^ (n + 1)‖ ≤ 24 * (C * ‖q τ‖) := by rw [Complex.norm_ofNat] exact mul_le_mul_of_nonneg_left - ((norm_tsum_le_tsum_norm hsumnorm).trans hbound) (by norm_num1) - _ = 24 * C * ‖q τ‖ := by ac_rfl + ((norm_tsum_le_tsum_norm hsumnorm).trans hbound) (by norm_num) + _ = 24 * C * ‖q τ‖ := by ring -- squeeze rw [← tendsto_sub_nhds_zero_iff] have hev : ∀ᶠ τ : ℍ in atImInfty, ‖E2 τ - 1‖ ≤ 24 * C * ‖q τ‖ := by @@ -205,8 +205,8 @@ lemma tendsto_E2_atImInfty : Tendsto E2 atImInfty (𝓝 1) := by exact ⟨1, key⟩ have hg : Tendsto (fun τ : ℍ ↦ 24 * C * ‖q τ‖) atImInfty (𝓝 0) := by have hq0 : Tendsto (fun τ : ℍ ↦ ‖q τ‖) atImInfty (𝓝 0) := by - simpa only [q, norm_zero] using (qParam_tendsto_atImInfty one_pos).norm - simpa only [mul_zero] using hq0.const_mul (24 * C) + simpa [q] using (qParam_tendsto_atImInfty one_pos).norm + simpa using hq0.const_mul (24 * C) exact squeeze_zero_norm' hev hg lemma isBoundedAtImInfty_E2 : IsBoundedAtImInfty E2 := @@ -227,7 +227,7 @@ lemma tendsto_valueAtInfty_atImInfty {f : ℍ → ℂ} (hper : Periodic (f ∘ o have h1 := (Periodic.tendsto_at_I_inf one_pos hper h_hol h_bd).comp tendsto_coe_atImInfty have h2 : Tendsto f atImInfty (𝓝 (cuspFunction 1 f 0)) := by refine h1.congr fun τ ↦ ?_ - simp only [comp_def, comp_apply, ofComplex_apply] + simp [Function.comp_def, ofComplex_apply] rwa [cuspFunction_apply_zero one_pos (analyticAt_cuspFunction_zero one_pos hper hhol hbdd) hper] at h2 @@ -282,7 +282,7 @@ lemma normalizedDeriv_eq_q_mul_deriv_cuspFunction (hper : Periodic (f ∘ ofComp have h2 := hq'.hasDerivAt have hq_eq : Periodic.qParam 1 (↑τ : ℂ) = q τ := rfl rw [hq_eq] at h2 - simpa only [mul_comm, div_one] using h2 + simpa [mul_comm] using h2 have hFq : DifferentiableAt ℂ (cuspFunction 1 f) (q τ) := differentiableAt_cuspFunction one_pos hper hhol hbdd (norm_q_lt_one τ) have hd : deriv (f ∘ ofComplex) ↑τ = deriv (cuspFunction 1 f) (q τ) * (2 * π * I * q τ) := by @@ -351,7 +351,7 @@ lemma deriv_comp_ofComplex_S (hhol : MDiff f) {Φ : ℂ → ℂ} private lemma coe_S_smul (τ : ℍ) : ((ModularGroup.S • τ : ℍ) : ℂ) = -(↑τ : ℂ)⁻¹ := by rw [modular_S_smul] - simp only [inv_neg] + simp [inv_neg] /-- How `D f` transforms under `S` for a function of weight `m + 1`: if `f(-1/τ) = τ^(m+1)·f(τ)` then @@ -496,7 +496,7 @@ private lemma serre_E₄_slash_S : rw [zpow_neg]; norm_cast rw [hz] push_cast - field_simp (disch := first | assumption | norm_num1 | positivity) + field_simp ring /-- Slash-invariance under `S` of `∂₆E₆` (weight 8). -/ @@ -517,7 +517,7 @@ private lemma serre_E₆_slash_S : rw [zpow_neg]; norm_cast rw [hz] push_cast - field_simp (disch := first | assumption | norm_num1 | positivity) + field_simp ring /-- Slash-invariance under `S` of `∂₁E₂ = D E₂ - E₂²/12` (weight 4): the quasimodularity @@ -534,7 +534,7 @@ private lemma serre_E2_slash_S : have hz : ((↑τ : ℂ) ^ (-(4 : ℤ))) = ((↑τ : ℂ) ^ (4 : ℕ))⁻¹ := by rw [zpow_neg]; norm_cast rw [hz] - field_simp (disch := first | assumption | norm_num1 | positivity) + field_simp ring /-- `∂₄E₄ = D E₄ - (1/3)·E₂·E₄`, as a modular form of weight 6 and level one. -/ @@ -623,7 +623,7 @@ private lemma smul_const_of_tendsto {k : ℤ} {e : ModularForm 𝒮ℒ k} {g : (hg : Tendsto g atImInfty (𝓝 b)) : c * a = b := by have h1 : Tendsto (⇑(c • e)) atImInfty (𝓝 (c * a)) := by have hcoe : (⇑(c • e) : ℍ → ℂ) = fun τ ↦ c * e τ := by - ext τ; simp only [smul_apply, smul_eq_mul] + ext τ; simp rw [hcoe] exact tendsto_const_nhds.mul he rw [h] at h1 diff --git a/LeanPool/Chudnovsky/SigmaZeta.lean b/LeanPool/Chudnovsky/SigmaZeta.lean index 84437f97a8..6301736f2f 100644 --- a/LeanPool/Chudnovsky/SigmaZeta.lean +++ b/LeanPool/Chudnovsky/SigmaZeta.lean @@ -81,14 +81,14 @@ private lemma weierstrassZetaTerm_eq (z w : ℂ) (hw : w ≠ 0) (hzw : z ≠ w) weierstrassZetaTerm z w = z ^ 2 / (w ^ 2 * (z - w)) := by have h1 : z - w ≠ 0 := sub_ne_zero.mpr hzw rw [weierstrassZetaTerm] - field_simp (disch := first | assumption | norm_num1 | positivity) + field_simp ring /-- Summability of `‖ω‖⁻³` over the nonzero lattice points. -/ private lemma summable_norm_rpow_neg_three : Summable (fun l : {l : L.lattice // l ≠ 0} ↦ ‖(l.1 : ℂ)‖ ^ (-3 : ℝ)) := by have h : (-3 : ℝ) < -(Module.finrank ℤ L.lattice : ℝ) := by - rw [L.finrank_lattice]; norm_num1 + rw [L.finrank_lattice]; norm_num exact (ZLattice.summable_norm_rpow L.lattice (-3) h).comp_injective Subtype.val_injective /-- All but finitely many nonzero lattice points have norm `≥ r`. -/ diff --git a/LeanPool/Chudnovsky/SingularModuli.lean b/LeanPool/Chudnovsky/SingularModuli.lean index f41ce0643c..e9e0edf939 100644 --- a/LeanPool/Chudnovsky/SingularModuli.lean +++ b/LeanPool/Chudnovsky/SingularModuli.lean @@ -67,10 +67,10 @@ open Complex /-- **Cited input 1** [Silverman ATAEC II.6.1]. The value of the `j`-invariant `j = 1728·J` at the CM point `τ₁₆₃ = (1 + i√163)/2` is an algebraic integer. -/ theorem isIntegral_j_τ₁₆₃ : IsIntegral ℤ (1728 * J τ₁₆₃) := by - have : Fact (Nat.Prime 41) := ⟨by norm_num1⟩ - have : NeZero (41 : ℕ) := ⟨by norm_num1⟩ + have : Fact (Nat.Prime 41) := ⟨by norm_num⟩ + have : NeZero (41 : ℕ) := ⟨by norm_num⟩ obtain ⟨PhiZ, hPhi⟩ := exists_PhiZ_closed (m := 41) - obtain ⟨i, hi⟩ := cm_coset_rel (m := 41) 0 (by norm_num1) + obtain ⟨i, hi⟩ := cm_coset_rel (m := 41) 0 (by norm_num) exact isIntegral_j_of_cm hPhi hi.symm /-- **Cited input 2** [Silverman ATAEC II.4.3(b); Buell]. The degree of `j(τ₁₆₃)` diff --git a/LeanPool/Chudnovsky/SingularModuli/CMRelations.lean b/LeanPool/Chudnovsky/SingularModuli/CMRelations.lean index 2857d3697e..705a7f4d57 100644 --- a/LeanPool/Chudnovsky/SingularModuli/CMRelations.lean +++ b/LeanPool/Chudnovsky/SingularModuli/CMRelations.lean @@ -75,15 +75,15 @@ theorem cmMatrix_det_eq_normForm (n : ℤ) : /-- `M_0` fixes `τ₁₆₃` with determinant `41`. -/ theorem cm_41 : QF.Fixes (0 + 1) (-41) 1 0 τ₁₆₃ ∧ (0 + 1) * 0 - (-41) * 1 = 41 := - ⟨cmMatrix_fixes 0, by ac_rfl⟩ + ⟨cmMatrix_fixes 0, by ring⟩ /-- `M_1` fixes `τ₁₆₃` with determinant `43`. -/ theorem cm_43 : QF.Fixes (1 + 1) (-41) 1 1 τ₁₆₃ ∧ (1 + 1) * 1 - (-41) * 1 = 43 := - ⟨cmMatrix_fixes 1, by ac_rfl⟩ + ⟨cmMatrix_fixes 1, by ring⟩ /-- `M_4` fixes `τ₁₆₃` with determinant `61`. -/ theorem cm_61 : QF.Fixes (4 + 1) (-41) 1 4 τ₁₆₃ ∧ (4 + 1) * 4 - (-41) * 1 = 61 := - ⟨cmMatrix_fixes 4, by ac_rfl⟩ + ⟨cmMatrix_fixes 4, by ring⟩ /-- The three determinants are represented by the norm form `x² + xy + 41 y²` at `(x, y) = (0,1), (1,1), (4,1)` — the arithmetic reason the isogenies exist (`m` splits in @@ -92,7 +92,7 @@ theorem normForm_represents : (0 : ℤ) ^ 2 + 0 * 1 + 41 * 1 ^ 2 = 41 ∧ (1 : ℤ) ^ 2 + 1 * 1 + 41 * 1 ^ 2 = 43 ∧ (4 : ℤ) ^ 2 + 4 * 1 + 41 * 1 ^ 2 = 61 := by - refine ⟨by ac_rfl, by ac_rfl, by ac_rfl⟩ + refine ⟨by ring, by ring, by ring⟩ /-- **The three-prime input, packaged for the rationality argument.** The traces `t = 2n+1` for `n = 0, 1, 4` and multiplier `λ = 1` satisfy the discriminant relations diff --git a/LeanPool/Chudnovsky/SingularModuli/CosetOrbit.lean b/LeanPool/Chudnovsky/SingularModuli/CosetOrbit.lean index a7a54bc2a4..5717e730f5 100644 --- a/LeanPool/Chudnovsky/SingularModuli/CosetOrbit.lean +++ b/LeanPool/Chudnovsky/SingularModuli/CosetOrbit.lean @@ -150,7 +150,7 @@ private lemma dvd_val_add [NeZero m] (b : ZMod m) (c : ℤ) : (m : ℤ) ∣ ((b.val : ℤ) + c) - ((b + (c : ZMod m)).val : ℤ) := by rw [← ZMod.intCast_zmod_eq_zero_iff_dvd] push_cast [ZMod.natCast_val, ZMod.intCast_cast, ZMod.ringHom_map_cast] - simp only [ZMod.cast_id', id_eq, dvd_refl, ZMod.cast_add, ZMod.cast_intCast, sub_self] + simp /-! ## The `T`-permutation @@ -213,12 +213,12 @@ def sSfun (m : ℕ) [Fact m.Prime] : Option (ZMod m) → Option (ZMod m) lemma sSfun_involutive [Fact m.Prime] : Function.Involutive (sSfun m) := by intro i cases i with - | none => simp only [sSfun, ↓reduceIte] + | none => simp [sSfun] | some b => by_cases hb : b = 0 - · simp only [sSfun, hb, ↓reduceIte] + · simp [sSfun, hb] · have hb' : -b⁻¹ ≠ 0 := neg_ne_zero.mpr (inv_ne_zero hb) - simp only [sSfun, hb, ↓reduceIte, hb', inv_neg, inv_inv, neg_neg] + simp [sSfun, hb, hb', inv_neg, inv_inv] /-- The `S`-permutation as an `Equiv.Perm`. -/ def σS (m : ℕ) [Fact m.Prime] : Equiv.Perm (Option (ZMod m)) := sSfun_involutive.toPerm @@ -242,16 +242,14 @@ lemma f_S_smul [Fact m.Prime] (i : Option (ZMod m)) (τ : ℍ) : | some b => by_cases hb : b = 0 · subst hb - have htarget : σS m (some (0 : ZMod m)) = none := by simp only [σS, - Function.Involutive.coe_toPerm, sSfun, ↓reduceIte] + have htarget : σS m (some (0 : ZMod m)) = none := by simp [σS, sSfun] rw [f_some, j_smul_S_mul, htarget, f_none] -- matrix identity Acol 0 · S = S · AInf refine j_matrix_transfer ModularGroup.S _ (AInf m) τ ?_ apply Matrix.GeneralLinearGroup.ext simp [Fin.forall_fin_two, val_AInf, val_Acol, Matrix.mul_apply, Fin.sum_univ_two, ModularGroup.coe_S] - · have htarget : σS m (some b) = some (-b⁻¹) := by simp only [σS, - Function.Involutive.coe_toPerm, sSfun, hb, ↓reduceIte] + · have htarget : σS m (some b) = some (-b⁻¹) := by simp [σS, sSfun, hb] rw [f_some, j_smul_S_mul, htarget, f_some] -- integers B = b.val, B' = (-b⁻¹).val, and the quotient q with B·B' + 1 = m·q set B : ℤ := (b.val : ℤ) with hB diff --git a/LeanPool/Chudnovsky/SingularModuli/FormReduction.lean b/LeanPool/Chudnovsky/SingularModuli/FormReduction.lean index 80db160fab..8f6f29696a 100644 --- a/LeanPool/Chudnovsky/SingularModuli/FormReduction.lean +++ b/LeanPool/Chudnovsky/SingularModuli/FormReduction.lean @@ -62,7 +62,7 @@ theorem Equiv.trans {f g h : BQF} (hfg : Equiv f g) (hgh : Equiv g h) : Equiv f /-- The `T`-generator: shift `(a, b, c) ↦ (a, b + 2an, a n² + b n + c)`; preserves the form class and (obviously) the discriminant. -/ -theorem Equiv.T (f : BQF) (n : ℤ) : Equiv f (act f 1 n 0 1) := ⟨1, n, 0, 1, by omega, rfl⟩ +theorem Equiv.T (f : BQF) (n : ℤ) : Equiv f (act f 1 n 0 1) := ⟨1, n, 0, 1, by ring, rfl⟩ lemma act_T_a (f : BQF) (n : ℤ) : (act f 1 n 0 1).a = f.a := by simp lemma act_T_b (f : BQF) (n : ℤ) : (act f 1 n 0 1).b = f.b + 2 * f.a * n := by @@ -253,12 +253,12 @@ private lemma reprN_of_relation {m : ℕ} (hm : m ≤ 61) {D0 t l : ℤ} (hD3 : have hsq : lN ^ 2 ≤ 9 ^ 2 := by have : (lN : ℤ) ^ 2 ≤ 9 ^ 2 := by rw [hlNsq]; omega exact_mod_cast this - exact (Nat.pow_le_pow_iff_left (by norm_num1)).mp hsq + exact (Nat.pow_le_pow_iff_left (by norm_num)).mp hsq have htNle : tN < 16 := by have hsq : tN ^ 2 < 16 ^ 2 := by have : (tN : ℤ) ^ 2 < 16 ^ 2 := by rw [htNsq]; omega exact_mod_cast this - exact (Nat.pow_lt_pow_iff_left (by norm_num1)).mp hsq + exact (Nat.pow_lt_pow_iff_left (by norm_num)).mp hsq have htNsq4m : tN ^ 2 ≤ 4 * m := by have : (tN : ℤ) ^ 2 ≤ 4 * (m : ℤ) := by rw [htNsq]; omega exact_mod_cast this @@ -281,11 +281,11 @@ theorem disc_of_three_relations {D0 : ℤ} (hD3 : D0 ≤ -3) {t1 l1 t2 l2 t3 l3 : ℤ} (hl1 : l1 ≠ 0) (hl2 : l2 ≠ 0) (hl3 : l3 ≠ 0) (h1 : t1 ^ 2 - 4 * 41 = D0 * l1 ^ 2) (h2 : t2 ^ 2 - 4 * 43 = D0 * l2 ^ 2) (h3 : t3 ^ 2 - 4 * 61 = D0 * l3 ^ 2) : D0 = -163 := by - have e1 := reprN_of_relation (m := 41) (by norm_num1) hD3 hl1 (by exact_mod_cast h1) - have e2 := reprN_of_relation (m := 43) (by norm_num1) hD3 hl2 (by exact_mod_cast h2) - have e3 := reprN_of_relation (m := 61) (by norm_num1) hD3 hl3 (by exact_mod_cast h3) - have hl1sq : (1 : ℤ) ≤ l1 ^ 2 := by rcases lt_or_gt_of_ne hl1 with h' | h' <;> nlinarith - have hub : (-D0) ≤ 164 := by nlinarith [h1, hl1sq, sq_nonneg t1] + have e1 := reprN_of_relation (m := 41) (by norm_num) hD3 hl1 (by exact_mod_cast h1) + have e2 := reprN_of_relation (m := 43) (by norm_num) hD3 hl2 (by exact_mod_cast h2) + have e3 := reprN_of_relation (m := 61) (by norm_num) hD3 hl3 (by exact_mod_cast h3) + have hl1sq : (1 : ℤ) ≤ l1 ^ 2 := by rcases lt_or_gt_of_ne hl1 with h' | h' <;> nlinarith only [h'] + have hub : (-D0) ≤ 164 := by nlinarith only [h1, hl1sq] have hmem : (-D0).toNat ∈ Finset.Icc 1 244 := by rw [Finset.mem_Icc]; omega have := three_prime_N (-D0).toNat hmem e1 e2 e3 @@ -318,14 +318,14 @@ theorem isRoot_smul {f g : BQF} {p q r s : ℤ} (hdet : p * s - q * r = 1) have hlin : ((-r : ℤ) : ℂ) * (τ : ℂ) + ((p : ℤ) : ℂ) = 0 := by rw [← h0, hY]; push_cast; ring obtain ⟨hr0, hp0⟩ := int_lin_eq_zero τ hlin have hr : r = 0 := by omega - rw [hr, hp0] at hdet; simp only [zero_mul, mul_zero, sub_self, zero_ne_one] at hdet + rw [hr, hp0] at hdet; simp at hdet have hform : (g.a : ℂ) * X ^ 2 + (g.b : ℂ) * X * Y + (g.c : ℂ) * Y ^ 2 = 0 := by rw [← hg] simp only [act_a, act_b, act_c, hX, hY, IsRoot] at hroot ⊢ push_cast linear_combination ((p : ℂ) * s - q * r) ^ 2 * hroot simp only [IsRoot, hcoe] - field_simp (disch := first | assumption | norm_num1 | positivity) + field_simp linear_combination hform /-- `τ₁₆₃` is the root of the reduced form `(1, −1, 41)` (`41 − τ + τ² = 0`). -/ @@ -341,7 +341,7 @@ theorem isRoot_τ₁₆₃ : IsRoot ⟨1, -1, 41⟩ Chudnovsky.τ₁₆₃ := by rw [hτ]; push_cast linear_combination (Complex.I ^ 2 / 4) * h163 + (163 / 4) * Complex.I_sq -private lemma posdef_1m141 : IsPosDef ⟨1, -1, 41⟩ := ⟨by norm_num1, by norm_num only [disc]⟩ +private lemma posdef_1m141 : IsPosDef ⟨1, -1, 41⟩ := ⟨by norm_num, by norm_num [disc]⟩ /-- **(C6), analytic form.** Every CM point of a positive-definite form of discriminant `−163` is `SL₂(ℤ)`-equivalent to `τ₁₆₃`. -/ @@ -353,7 +353,7 @@ theorem cm_disc_neg163_smul_eq_τ₁₆₃ {f : BQF} (hpd : IsPosDef f) (hdisc : exact ⟨N, root_unique posdef_1m141 hN isRoot_τ₁₆₃⟩ · obtain ⟨N, hN⟩ := isRoot_smul hdet hact hroot have hTact : act (⟨1, 1, 41⟩ : BQF) 1 (-1) 0 1 = ⟨1, -1, 41⟩ := by decide - obtain ⟨N', hN'⟩ := isRoot_smul (by ac_rfl : (1 : ℤ) * 1 - (-1) * 0 = 1) hTact hN + obtain ⟨N', hN'⟩ := isRoot_smul (by ring : (1 : ℤ) * 1 - (-1) * 0 = 1) hTact hN refine ⟨N' * N, ?_⟩ rw [mul_smul] exact root_unique posdef_1m141 hN' isRoot_τ₁₆₃ diff --git a/LeanPool/Chudnovsky/SingularModuli/JFunction.lean b/LeanPool/Chudnovsky/SingularModuli/JFunction.lean index 8b46432cd0..a1ef51ba48 100644 --- a/LeanPool/Chudnovsky/SingularModuli/JFunction.lean +++ b/LeanPool/Chudnovsky/SingularModuli/JFunction.lean @@ -306,7 +306,7 @@ theorem qExpansion_discriminant_int : have h1 := congrArg (PowerSeries.coeff m) hsub rw [map_smul, smul_eq_mul, PowerSeries.coeff_map, deltaInt_spec, map_mul, map_ofNat] at h1 rw [PowerSeries.coeff_map] - exact mul_left_cancel₀ (by norm_num1 : (1728 : ℂ) ≠ 0) h1 + exact mul_left_cancel₀ (by norm_num : (1728 : ℂ) ≠ 0) h1 /-- `Δ` vanishes at the cusp: constant q-expansion coefficient `0`. -/ theorem deltaInt_coeff_zero : PowerSeries.coeff 0 deltaInt = 0 := by @@ -348,7 +348,7 @@ theorem constantCoeff_jqInt : PowerSeries.constantCoeff jqInt = 1 := by have h4 : PowerSeries.constantCoeff E4Z = 1 := by simp [E4Z, sigmaPS, PowerSeries.constantCoeff_mk] rw [h4] - simp only [one_pow, inv_one, Units.val_one, mul_one] + simp /-! ### The analytic side: `τ ↦ q τ` and `τ ↦ j τ · q τ` -/ @@ -367,7 +367,7 @@ lemma mdifferentiable_q : MDiff (fun τ : ℍ ↦ q τ) := by have heq : (fun τ : ℍ ↦ q τ) = (fun z : ℂ ↦ Complex.exp (2 * ↑π * Complex.I * z)) ∘ (fun τ : ℍ ↦ (τ : ℂ)) := by funext τ - simp only [q_eq, Function.comp] + simp [q_eq, Function.comp] rw [heq] exact Differentiable.comp_mdifferentiable (by fun_prop) mdifferentiable_coe diff --git a/LeanPool/Chudnovsky/SingularModuli/MasserA1.lean b/LeanPool/Chudnovsky/SingularModuli/MasserA1.lean index 462b6768d9..357777d415 100644 --- a/LeanPool/Chudnovsky/SingularModuli/MasserA1.lean +++ b/LeanPool/Chudnovsky/SingularModuli/MasserA1.lean @@ -88,7 +88,7 @@ lemma two_tau_sub_one_ne_zero : 2 * (τ₁₆₃ : ℂ) - 1 ≠ 0 := by intro h have := two_tau_sub_one_sq rw [h] at this - norm_num1 at this + norm_num at this /-- The trace-zero fixing matrix `Λ = !![1, −82; 2, −1]` as an element of `GL (Fin 2) ℝ` (determinant `163 > 0`). -/ @@ -99,7 +99,7 @@ def LamGL : GL (Fin 2) ℝ := lemma LamGL_det_pos : 0 < (LamGL).det.val := by rw [Matrix.GeneralLinearGroup.val_det_apply, val_LamGL, Matrix.det_fin_two_of] - norm_num1 + norm_num /-- **`Λ` fixes `τ₁₆₃`** as a Möbius transformation: `(τ − 82)/(2τ − 1) = τ`. -/ lemma LamGL_smul_eq : LamGL • τ₁₆₃ = τ₁₆₃ := by @@ -140,11 +140,11 @@ lemma J_τ₁₆₃_ne_zero : J τ₁₆₃ ≠ 0 := by have h := one_lt_norm_J τ₁₆₃_mem_Region intro hc rw [hc, norm_zero] at h - linarith only [h] + linarith /-- `j₀ := 1728·J(τ₁₆₃) ≠ 0`. -/ lemma j₀_ne_zero : (1728 : ℂ) * J τ₁₆₃ ≠ 0 := - mul_ne_zero (by norm_num1) J_τ₁₆₃_ne_zero + mul_ne_zero (by norm_num) J_τ₁₆₃_ne_zero /-- `j₀ ≠ 1728`: `J(τ₁₆₃) ≠ 1` since `‖J(τ₁₆₃)‖ > 1`. -/ lemma j₀_ne_1728 : (1728 : ℂ) * J τ₁₆₃ ≠ 1728 := by @@ -174,10 +174,10 @@ lemma E₄_τ₁₆₃_ne_zero : E₄ τ₁₆₃ ≠ 0 := by to fill its `s₂_τ₁₆₃_rational` pin — importing it here would be a cycle). -/ lemma j₀_rational : ∃ r : ℚ, (1728 : ℂ) * J τ₁₆₃ = (r : ℂ) := by have hint : IsIntegral ℤ ((1728 : ℂ) * J τ₁₆₃) := by - have : Fact (Nat.Prime 41) := ⟨by norm_num1⟩ - have : NeZero (41 : ℕ) := ⟨by norm_num1⟩ + have : Fact (Nat.Prime 41) := ⟨by norm_num⟩ + have : NeZero (41 : ℕ) := ⟨by norm_num⟩ obtain ⟨PhiZ, hPhi⟩ := exists_PhiZ_closed (m := 41) - obtain ⟨i, hi⟩ := cm_coset_rel (m := 41) 0 (by norm_num1) + obtain ⟨i, hi⟩ := cm_coset_rel (m := 41) 0 (by norm_num) exact isIntegral_j_of_cm hPhi hi.symm exact j_τ₁₆₃_rational_of j_surjective hint @@ -237,7 +237,7 @@ theorem masser_s₂_rational_of have hrjne : (rj : ℚ) - 1728 ≠ 0 := by rw [sub_ne_zero] intro hc - exact j₀_ne_1728 (by rw [hrj, hc]; norm_num1) + exact j₀_ne_1728 (by rw [hrj, hc]; norm_num) refine ⟨3 * rj * γ + 4 + 3 * rj / (rj - 1728), ?_⟩ rw [key] push_cast @@ -635,13 +635,13 @@ private lemma masser_F_vanishes {z : ℂ} (hz : 0 < z.im) : private lemma masser_L1 : (163 : ℂ) / (2 * (τ₁₆₃ : ℂ) - 1) ^ 2 = -1 := by rw [two_tau_sub_one_sq] - norm_num1 + norm_num private lemma masserGD_tau_ne_zero : masserGD (τ₁₆₃ : ℂ) ≠ 0 := by rw [masserGD_tau] refine div_ne_zero (mul_ne_zero (neg_ne_zero.mpr two_pi_I_ne_zero) ?_) (E₄_cube_sub_E₆_sq_ne_zero τ₁₆₃) - exact mul_ne_zero (mul_ne_zero (by norm_num1) (pow_ne_zero 2 E₄_τ₁₆₃_ne_zero)) E₆_τ₁₆₃_ne_zero + exact mul_ne_zero (mul_ne_zero (by norm_num) (pow_ne_zero 2 E₄_τ₁₆₃_ne_zero)) E₆_τ₁₆₃_ne_zero /-- **The first- and second-order Taylor relations** extracted from `F ≡ 0` at `τ₁₆₃`: `β₁₀ = β₀₁` (using `Λ′(τ) = −1`, `g′(τ) ≠ 0`) and Masser's identity (105) in the raw form @@ -658,7 +658,7 @@ private lemma masser_relations : intro z hz have h1 := hasDerivAt_cj (masserLam_im_pos hz) have h2 := hasDerivAt_masserLam (two_mul_sub_one_ne_zero hz) - simpa only [Function.comp_def] using h1.comp z h2 + simpa [Function.comp_def] using h1.comp z h2 have hv : ∀ z : ℂ, 0 < z.im → HasDerivAt cj (masserGD z) z := fun z hz ↦ hasDerivAt_cj hz have hu' : HasDerivAt (fun z ↦ masserGD (masserLam z) * (163 / (2 * z - 1) ^ 2)) (masserG2 + masserGD (τ₁₆₃ : ℂ) * (4 / (2 * (τ₁₆₃ : ℂ) - 1))) (τ₁₆₃ : ℂ) := by @@ -666,10 +666,9 @@ private lemma masser_relations : rw [masserLam_tau]; exact hasDerivAt_masserGD have h1 : HasDerivAt (fun z ↦ masserGD (masserLam z)) (masserG2 * (163 / (2 * (τ₁₆₃ : ℂ) - 1) ^ 2)) (τ₁₆₃ : ℂ) := by - simpa only [Function.comp_def] using hgd.comp _ (hasDerivAt_masserLam htau_ne) + simpa [Function.comp_def] using hgd.comp _ (hasDerivAt_masserLam htau_ne) have hlin : HasDerivAt (fun w : ℂ ↦ 2 * w - 1) 2 (τ₁₆₃ : ℂ) := by - simpa only [hasDerivAt_sub_const_iff, id_eq, - mul_one] using ((hasDerivAt_id ((τ₁₆₃ : ℂ))).const_mul (2 : ℂ)).sub_const 1 + simpa using ((hasDerivAt_id ((τ₁₆₃ : ℂ))).const_mul (2 : ℂ)).sub_const 1 have hdiv := (hasDerivAt_const ((τ₁₆₃ : ℂ)) (163 : ℂ)).fun_div (hlin.fun_pow 2) (pow_ne_zero 2 htau_ne) refine (h1.fun_mul hdiv).congr_deriv ?_ @@ -785,7 +784,7 @@ private lemma masser_lemmaA1 {i : Option (ZMod 163)} (hi : i ≠ some (81 : ZMod have hj : j (AInf 163 • τ₁₆₃) = j τ₁₆₃ := by rw [← f_none]; exact h obtain ⟨γ, hγ⟩ := j_injective_mod_Γ hj obtain ⟨hfix, hdet⟩ := masser_fixes_of_coset (e := 163) (f := 0) (g := 1) γ - (by rw [coe_AInf_smul]; push_cast; ring) (by norm_num1) hγ.symm + (by rw [coe_AInf_smul]; push_cast; ring) (by norm_num) hγ.symm rcases masser_fixes_pm hfix (by linear_combination hdet) with ⟨hp, _, _, _⟩ | ⟨hp, _, _, _⟩ all_goals omega | some b => @@ -793,7 +792,7 @@ private lemma masser_lemmaA1 {i : Option (ZMod 163)} (hi : i ≠ some (81 : ZMod have hj : j (Acol 163 (b.val : ℤ) • τ₁₆₃) = j τ₁₆₃ := by rw [← f_some]; exact h obtain ⟨γ, hγ⟩ := j_injective_mod_Γ hj obtain ⟨hfix, hdet⟩ := masser_fixes_of_coset (e := 1) (f := (b.val : ℤ)) (g := 163) γ - (by rw [coe_Acol_smul]; push_cast; ring) (by norm_num1) hγ.symm + (by rw [coe_Acol_smul]; push_cast; ring) (by norm_num) hγ.symm have hvlt : (b.val : ℤ) < 163 := by exact_mod_cast ZMod.val_lt b have hvnn : (0 : ℤ) ≤ (b.val : ℤ) := Int.natCast_nonneg _ have hval : (b.val : ℤ) = 81 := by @@ -840,7 +839,7 @@ private lemma mβ10_ne_zero : mβ10 ≠ 0 := by intro i hi exact sub_ne_zero.mpr (Ne.symm (masser_lemmaA1 (Finset.mem_erase.mp hi).1)) intro h0 - exact hne (by rw [h0]; norm_num1) + exact hne (by rw [h0]; norm_num) /-! ### The gate and the unconditional theorem -/ @@ -871,7 +870,7 @@ theorem masser_gate : ∃ γ : ℚ, E₂star τ₁₆₃ push_cast field_simp at hrel ⊢ have hpre : ((π : ℝ) : ℂ) * 1728 * E₄ τ₁₆₃ ≠ 0 := - mul_ne_zero (mul_ne_zero hπ (by norm_num1)) h4 + mul_ne_zero (mul_ne_zero hπ (by norm_num)) h4 have hrel2 : 2 ^ 2 * (((mβ20 : ℚ) : ℂ) - 2 * ((mβ11 : ℚ) : ℂ) + ((mβ02 : ℚ) : ℂ)) * ((π : ℝ) : ℂ) * Complex.I ^ 2 * 1728 * E₄ τ₁₆₃ ^ 3 * E₆ τ₁₆₃ ^ 2 * 3 * ((τ₁₆₃.im : ℝ) : ℂ) diff --git a/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialQ.lean b/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialQ.lean index 7c173d3da2..859d64e70f 100644 --- a/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialQ.lean +++ b/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialQ.lean @@ -454,7 +454,7 @@ theorem Sk_eq_poly_j split · exact hcR · exact R.zero_mem - · simp only [natDegree_C, Std.le_refl] + · simp [natDegree_C] · intro τ; rw [hc τ, eval_C] | succ N ih => intro R h hinv hholo hmero @@ -482,7 +482,7 @@ theorem Sk_eq_poly_j · refine (natDegree_add_le _ _).trans ?_ refine max_le (hP'deg.trans (Nat.le_succ N)) ?_ refine (natDegree_mul_le).trans ?_ - simp only [natDegree_C, natDegree_pow, natDegree_X, mul_one, zero_add, Std.le_refl] + simp [natDegree_C] · intro τ rw [eval_add, eval_mul, eval_C, eval_pow, eval_X, ← hP'eval τ] simp only [hh'_def] @@ -725,7 +725,7 @@ private lemma isBoundedAtImInfty_jq_pow (n : ℕ) : | succ n ih => have hmul : (fun τ : ℍ ↦ (j τ * q τ) ^ (n + 1)) = (fun τ : ℍ ↦ (j τ * q τ) ^ n) * (fun τ : ℍ ↦ j τ * q τ) := by - funext τ; simp only [j_def, pow_succ, Pi.mul_apply] + funext τ; simp [pow_succ] rw [hmul] exact Filter.BoundedAtFilter.mul ih isBoundedAtImInfty_jq_recon @@ -793,7 +793,7 @@ theorem poleReduction (N : ℕ) (R : Subring ℂ) (h : ℍ → ℂ) have hF0 : (qExpansion 1 (fun τ : ℍ ↦ (h τ - c * (j τ) ^ (N + 1)) * q τ ^ (N + 1))).coeff 0 = 0 := by rw [hFqexp, map_sub, PowerSeries.coeff_smul, hcoeffJ0, hcoeffA0] - simp only [smul_eq_mul, mul_one, sub_self] + simp -- the `G`-side hypotheses of `divByQ` have hGper : Function.Periodic ((fun τ : ℍ ↦ (h τ - c * (j τ) ^ (N + 1)) * q τ ^ N) ∘ ofComplex) 1 := @@ -1250,7 +1250,7 @@ lemma esf_mem_polyJ [Fact m.Prime] (l : ℕ) : (fun τ ↦ esf m l τ) ∈ polyJ have hN := newton_esf (m := m) l τ simp only [Pi.mul_apply, Finset.sum_apply, algebraMap_polyJ_apply] push_cast - field_simp (disch := first | assumption | norm_num1 | positivity) + field_simp linear_combination hN rw [hfun] refine mul_mem (Subalgebra.algebraMap_mem _ _) (sum_mem (fun a ha ↦ ?_)) diff --git a/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialZ.lean b/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialZ.lean index c6343fa745..cfad28d837 100644 --- a/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialZ.lean +++ b/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialZ.lean @@ -108,11 +108,11 @@ rational `r`, then `x = (m : ℂ)` for some `m : ℤ`. -/ theorem isInt_of_integral_of_rat {x : ℂ} (hint : IsIntegral ℤ x) {r : ℚ} (hr : x = (r : ℂ)) : ∃ m : ℤ, x = (m : ℂ) := by have h1 : IsIntegral ℤ (algebraMap ℚ ℂ r) := by - have hx : algebraMap ℚ ℂ r = x := by rw [hr]; simp only [eq_ratCast] + have hx : algebraMap ℚ ℂ r = x := by rw [hr]; simp rw [hx]; exact hint have h2 : IsIntegral ℤ r := isIntegral_algebraMap_iff.mp h1 obtain ⟨n, hn⟩ := IsIntegrallyClosed.isIntegral_iff.mp h2 - exact ⟨n, by rw [hr, ← hn]; simp only [algebraMap_int_eq, eq_intCast, Rat.cast_intCast]⟩ + exact ⟨n, by rw [hr, ← hn]; simp⟩ /-- **`ℤ[ζ_m] ∩ ℚ = ℤ`, packaged.** A complex number that is integral over `ℤ` (e.g. an element of `ℤ[ζ_m]`) and rational lies in the bottom subring `⊥ ⊆ ℂ` (the image of `ℤ`). This is the @@ -293,7 +293,7 @@ theorem isIntegral_of_kronecker {PhiZ : Polynomial (Polynomial ℤ)} rw [algebraMap_int_eq]; exact hroot · refine ⟨-(diagPhiZ PhiZ), ?_, ?_⟩ · change (-(diagPhiZ PhiZ)).leadingCoeff = 1 - rw [leadingCoeff_neg, h1]; norm_num1 + rw [leadingCoeff_neg, h1]; norm_num · rw [algebraMap_int_eq, eval₂_neg, hroot, neg_zero] end Chudnovsky @@ -369,19 +369,19 @@ lemma goodQ_smul {h : ℝ} (hh : 0 < h) {R : Subring ℂ} {g : ℍ → ℂ} (hg holo := mdifferentiable_const.mul hg.holo bdd := hg.bdd.const_mul_left c mem n := by - have he : (fun τ ↦ c * g τ) = c • g := by funext τ; simp only [Pi.smul_apply, smul_eq_mul] + have he : (fun τ ↦ c * g τ) = c • g := by funext τ; simp [Pi.smul_apply, smul_eq_mul] rw [he, qExpansion_smul (hg.ana hh) c, PowerSeries.coeff_smul, smul_eq_mul] exact R.mul_mem hc (hg.mem n) lemma goodQ_const {h : ℝ} (hh : 0 < h) {R : Subring ℂ} {c : ℂ} (hc : c ∈ R) : GoodQ h R (fun _ : ℍ ↦ c) := by have := goodQ_smul hh (goodQ_one hh (R := R)) hc - simpa only [mul_one] using this + simpa using this lemma GoodQ.neg {h : ℝ} (hh : 0 < h) {R : Subring ℂ} {g : ℍ → ℂ} (hg : GoodQ h R g) : GoodQ h R (fun τ ↦ - g τ) := by have := goodQ_smul hh hg (c := -1) (R.neg_mem R.one_mem) - simpa only [neg_mul, one_mul] using this + simpa using this lemma GoodQ.sub {h : ℝ} (hh : 0 < h) {R : Subring ℂ} {g₁ g₂ : ℍ → ℂ} (h₁ : GoodQ h R g₁) (h₂ : GoodQ h R g₂) : GoodQ h R (fun τ ↦ g₁ τ - g₂ τ) := by @@ -412,10 +412,10 @@ lemma isBoundedAtImInfty_q : IsBoundedAtImInfty (fun τ : ℍ ↦ q τ) := /-- Powers preserve `GoodQ`. -/ lemma GoodQ.pow {h : ℝ} (hh : 0 < h) {R : Subring ℂ} {g : ℍ → ℂ} (hg : GoodQ h R g) : ∀ k : ℕ, GoodQ h R (fun τ ↦ g τ ^ k) - | 0 => by simpa only [pow_zero] using goodQ_one hh (R := R) + | 0 => by simpa using goodQ_one hh (R := R) | (k+1) => by have := (hg.pow hh k).mul hh hg - simpa only [pow_succ] using this + simpa [pow_succ] using this lemma goodQ_q (R : Subring ℂ) : GoodQ 1 R (fun τ : ℍ ↦ q τ) where per := periodic_comp_ofComplex_of_vadd q_vadd_one @@ -427,8 +427,8 @@ lemma goodQ_q (R : Subring ℂ) : GoodQ 1 R (fun τ : ℍ ↦ q τ) where have := hasSum_ite_eq (1 : ℕ) (q τ) refine this.congr_fun (fun k ↦ ?_) by_cases hk : k = 1 - · subst hk; simp only [↓reduceIte, pow_one, smul_eq_mul, one_mul] - · simp only [hk, ↓reduceIte, smul_eq_mul, zero_mul] + · subst hk; simp + · simp [hk] have := qExpansion_coeff_unique_raw (analyticAt_cuspFunction_zero one_pos (periodic_comp_ofComplex_of_vadd q_vadd_one) mdifferentiable_q isBoundedAtImInfty_q) @@ -441,7 +441,7 @@ lemma goodQ_q (R : Subring ℂ) : GoodQ 1 R (fun τ : ℍ ↦ q τ) where lemma goodQ_jq (R : Subring ℂ) : GoodQ 1 R (fun τ : ℍ ↦ j τ * q τ) where per := periodic_comp_ofComplex_of_vadd (fun τ ↦ by rw [j_vadd_one, q_vadd_one]) holo := mdifferentiable_j_mul_q - bdd := by simpa only [j_def, pow_one] using isBoundedAtImInfty_jqPow 1 + bdd := by simpa using isBoundedAtImInfty_jqPow 1 mem n := by rw [qExpansion_j_mul_q, PowerSeries.coeff_map, eq_intCast (Int.castRingHom ℂ)] exact intCast_mem R _ @@ -541,13 +541,13 @@ lemma periodic_comp_ofComplex_of_vadd_gen {f : ℍ → ℂ} {p : ℝ} (_hp : 0 < (hf : ∀ τ : ℍ, f ((p : ℝ) +ᵥ τ) = f τ) : Function.Periodic (f ∘ ofComplex) p := by intro w rcases lt_or_ge 0 w.im with hw | hw - · have himeq : (w + (p:ℂ)).im = w.im := by simp only [add_im, ofReal_im, add_zero] + · have himeq : (w + (p:ℂ)).im = w.im := by simp have hw1 : 0 < (w + (p:ℂ)).im := by rw [himeq]; exact hw simp only [Function.comp_apply, ofComplex_apply_of_im_pos hw1, ofComplex_apply_of_im_pos hw] have h := hf ⟨w, hw⟩ convert h using 2 apply UpperHalfPlane.ext - rw [UpperHalfPlane.coe_vadd]; simp only [add_comm] + rw [UpperHalfPlane.coe_vadd]; simp [add_comm] · have hw1 : (w + (p:ℂ)).im ≤ 0 := by simp only [Complex.add_im, Complex.ofReal_im, add_zero]; exact hw simp only [Function.comp_apply] @@ -694,8 +694,8 @@ lemma goodQ_w [NeZero m] (R : Subring ℂ) : GoodQ (m : ℝ) R (fun τ : ℍ ↦ intro τ refine (hasSum_ite_eq (1 : ℕ) (wParam m τ)).congr_fun (fun k ↦ ?_) by_cases hk : k = 1 - · subst hk; simp only [↓reduceIte, pow_one, smul_eq_mul, one_mul] - · simp only [hk, ↓reduceIte, smul_eq_mul, zero_mul] + · subst hk; simp + · simp [hk] have := wExpansion_coeff_unique_raw (analyticAt_cuspFunction_zero hm (periodic_comp_ofComplex_of_vadd_gen hm wParam_vadd_m) mdifferentiable_wParam isBoundedAtImInfty_wParam) diff --git a/LeanPool/Chudnovsky/SingularModuli/QuadraticPoints.lean b/LeanPool/Chudnovsky/SingularModuli/QuadraticPoints.lean index 7b133511bf..2a2aa1054e 100644 --- a/LeanPool/Chudnovsky/SingularModuli/QuadraticPoints.lean +++ b/LeanPool/Chudnovsky/SingularModuli/QuadraticPoints.lean @@ -153,7 +153,7 @@ lemma int_lin_eq_zero (τ : ℍ) {α β : ℤ} (h : (α : ℂ) * (τ : ℂ) + ( lemma IsPosDef.c_pos {f : BQF} (hf : IsPosDef f) : 0 < f.c := by obtain ⟨ha, hd⟩ := hf simp only [disc] at hd - nlinarith [sq_nonneg f.b, hd, ha] + nlinarith only [ha, hd] /-- The square-completion identity `(2aτ + b)² = disc f` for a root `τ` of `f`. -/ lemma sq_two_a_root {f : BQF} {τ : ℍ} (h : IsRoot f τ) : @@ -243,7 +243,7 @@ theorem fixes_classification {f : BQF} (hf : IsPrimitive f) (hpd : IsPosDef f) obtain ⟨u, v, w, huvw⟩ := bezout_of_primitive hf have hdvd : f.a ∣ r := by refine ⟨u * r + v * (s - p) + w * (-q), ?_⟩ - have hr : r * (u * f.a + v * f.b + w * f.c) = r := by rw [huvw]; ac_rfl + have hr : r * (u * f.a + v * f.b + w * f.c) = r := by rw [huvw]; ring linear_combination -hr + v * hr1 + w * hr2 obtain ⟨k, hk⟩ := hdvd refine ⟨k, hk.trans (mul_comm _ _), ?_, ?_⟩ diff --git a/LeanPool/Chudnovsky/SingularModuli/Rationality.lean b/LeanPool/Chudnovsky/SingularModuli/Rationality.lean index 017af57a75..af212f8bfd 100644 --- a/LeanPool/Chudnovsky/SingularModuli/Rationality.lean +++ b/LeanPool/Chudnovsky/SingularModuli/Rationality.lean @@ -157,7 +157,7 @@ lemma cm_coset_rel (n : ℤ) [NeZero m] (hm : (m : ℤ) = n ^ 2 + n + 41) : have hdvd : (m : ℤ) ∣ ((n : ZMod m).val : ℤ) - n := by rw [← ZMod.intCast_zmod_eq_zero_iff_dvd] push_cast [ZMod.natCast_val, ZMod.intCast_cast, ZMod.ringHom_map_cast] - simp only [dvd_refl, ZMod.cast_intCast, sub_self] + simp rw [j_Acol_smul_congr hdvd τ₁₆₃] exact cm_coset_val n hm @@ -397,9 +397,9 @@ theorem cm_bridge {τ' : ℍ} (h43 : ∃ i : Option (ZMod 43), f 43 i τ' = j τ') (h61 : ∃ i : Option (ZMod 61), f 61 i τ' = j τ') : ∃ M : SL(2, ℤ), M • τ' = τ₁₆₃ := by - have : Fact (Nat.Prime 41) := ⟨by norm_num1⟩ - have : Fact (Nat.Prime 43) := ⟨by norm_num1⟩ - have : Fact (Nat.Prime 61) := ⟨by norm_num1⟩ + have : Fact (Nat.Prime 41) := ⟨by norm_num⟩ + have : Fact (Nat.Prime 43) := ⟨by norm_num⟩ + have : Fact (Nat.Prime 61) := ⟨by norm_num⟩ obtain ⟨i41, hi41⟩ := h41 obtain ⟨i43, hi43⟩ := h43 obtain ⟨i61, hi61⟩ := h61 @@ -457,12 +457,12 @@ lemma phi_coincidence (n : ℤ) (mm : ℕ) [NeZero mm] [Fact mm.Prime] (hm : (mm `j τ₁₆₃`, the value `j τ₁₆₃` is rational. -/ theorem j_τ₁₆₃_rational_of (hsurj : Function.Surjective (j : ℍ → ℂ)) (hint : IsIntegral ℤ (j τ₁₆₃)) : ∃ r : ℚ, j τ₁₆₃ = (r : ℂ) := by - have : NeZero (41 : ℕ) := ⟨by norm_num1⟩ - have : NeZero (43 : ℕ) := ⟨by norm_num1⟩ - have : NeZero (61 : ℕ) := ⟨by norm_num1⟩ - have : Fact (Nat.Prime 41) := ⟨by norm_num1⟩ - have : Fact (Nat.Prime 43) := ⟨by norm_num1⟩ - have : Fact (Nat.Prime 61) := ⟨by norm_num1⟩ + have : NeZero (41 : ℕ) := ⟨by norm_num⟩ + have : NeZero (43 : ℕ) := ⟨by norm_num⟩ + have : NeZero (61 : ℕ) := ⟨by norm_num⟩ + have : Fact (Nat.Prime 41) := ⟨by norm_num⟩ + have : Fact (Nat.Prime 43) := ⟨by norm_num⟩ + have : Fact (Nat.Prime 61) := ⟨by norm_num⟩ set j₀ : ℂ := j τ₁₆₃ with hj0 -- `j₀` is integral (hence algebraic) over `ℚ`. have hintQ : IsIntegral ℚ j₀ := by @@ -474,9 +474,9 @@ theorem j_τ₁₆₃_rational_of (hsurj : Function.Surjective (j : ℍ → ℂ) have hallroots : ∀ x : ℂ, (aeval x) (minpoly ℚ j₀) = 0 → x = j₀ := by intro x hx obtain ⟨τ', hτ'⟩ := hsurj x - have h41 := phi_coincidence 0 41 (by norm_num1) hx hτ' - have h43 := phi_coincidence 1 43 (by norm_num1) hx hτ' - have h61 := phi_coincidence 4 61 (by norm_num1) hx hτ' + have h41 := phi_coincidence 0 41 (by norm_num) hx hτ' + have h43 := phi_coincidence 1 43 (by norm_num) hx hτ' + have h61 := phi_coincidence 4 61 (by norm_num) hx hτ' obtain ⟨M, hM⟩ := cm_bridge h41 h43 h61 rw [← hτ', hj0, ← hM, j_smul] -- Finish: all roots equal `j₀`, so `j₀` is rational (Vieta on the subleading coefficient). diff --git a/LeanPool/Chudnovsky/SingularModuli/Valence.lean b/LeanPool/Chudnovsky/SingularModuli/Valence.lean index b96c6b7ee7..8464ba36c9 100644 --- a/LeanPool/Chudnovsky/SingularModuli/Valence.lean +++ b/LeanPool/Chudnovsky/SingularModuli/Valence.lean @@ -85,7 +85,7 @@ theorem exists_smul_mem_fd_j (τ : ℍ) : theorem j_eq_iff_J (τ₁ τ₂ : ℍ) : j τ₁ = j τ₂ ↔ J τ₁ = J τ₂ := by rw [j_def, j_def] constructor - · exact fun h ↦ mul_left_cancel₀ (by norm_num1 : (1728 : ℂ) ≠ 0) h + · exact fun h ↦ mul_left_cancel₀ (by norm_num : (1728 : ℂ) ≠ 0) h · exact fun h ↦ by rw [h] /-- `j τ₁ = j τ₂` iff Klein's absolute invariants of the lattices `L_{τ₁}`, `L_{τ₂}` agree. @@ -226,7 +226,7 @@ theorem exists_units_smul_g₂_g₃ (L₁ L₂ : PeriodPair) theorem discr_Lτ_ne_zero (τ : ℍ) : (Lτ τ).discr ≠ 0 := by rw [discr_Lτ] refine mul_ne_zero ?_ (E₄_cube_sub_E₆_sq_ne_zero τ) - refine div_ne_zero (pow_ne_zero _ ?_) (by norm_num1) + refine div_ne_zero (pow_ne_zero _ ?_) (by norm_num) simp [Real.pi_ne_zero] /- @@ -357,7 +357,7 @@ theorem weierstrassP_eventuallyEq_of_g₂_g₃ (L₁ L₂ : PeriodPair) intro L t have h := L.weierstrassPExcept_add (0 : L.lattice) t simp only [ZeroMemClass.coe_zero, sub_zero] at h - have h0 : (1 : ℂ) / (0 : ℂ) ^ 2 = 0 := by norm_num1 + have h0 : (1 : ℂ) / (0 : ℂ) ^ 2 = 0 := by norm_num rw [h0, sub_zero] at h linear_combination h -- `HasDerivAt` facts, reconstructed from the analyticity lemmas @@ -436,7 +436,7 @@ theorem weierstrassP_eventuallyEq_of_g₂_g₃ (L₁ L₂ : PeriodPair) induction m using Nat.strongRecOn with | ind m IH => rcases eq_or_ne m 0 with rfl | hm0 - · simp only [hwdef, iteratedDeriv_zero, PeriodPair.weierstrassPExcept_zero, sub_self] + · simp [iteratedDeriv_zero, hwdef] rcases eq_or_ne m 1 with rfl | hm1 · rw [hwdef, iteratedDeriv_fun_sub hf₁.contDiffAt hf₂.contDiffAt, L₁.iteratedDeriv_weierstrassPExcept_self 0, L₂.iteratedDeriv_weierstrassPExcept_self 0] @@ -447,7 +447,7 @@ theorem weierstrassP_eventuallyEq_of_g₂_g₃ (L₁ L₂ : PeriodPair) have hG6 : L₁.G 6 = L₂.G 6 := by have e : (140 : ℂ) * L₁.G 6 = 140 * L₂.G 6 := by have hh := h3; simp only [PeriodPair.g₃] at hh; exact hh - exact mul_left_cancel₀ (by norm_num1) e + exact mul_left_cancel₀ (by norm_num) e rw [hwdef, iteratedDeriv_fun_sub hf₁.contDiffAt hf₂.contDiffAt, L₁.iteratedDeriv_weierstrassPExcept_self 0, L₂.iteratedDeriv_weierstrassPExcept_self 0, L₁.sumInvPow_zero, L₂.sumInvPow_zero] @@ -495,7 +495,7 @@ theorem weierstrassP_eventuallyEq_of_g₂_g₃ (L₁ L₂ : PeriodPair) rw [hfac] refine mul_ne_zero (sub_ne_zero.mpr ?_) ?_ · exact_mod_cast hm4 - · have hc3 : ((m : ℂ) + 3) = ((m + 3 : ℕ) : ℂ) := by push_cast; ac_rfl + · have hc3 : ((m : ℂ) + 3) = ((m + 3 : ℕ) : ℂ) := by push_cast; ring rw [hc3]; exact_mod_cast (by omega : m + 3 ≠ 0) exact (mul_eq_zero.mp hcoef).resolve_left hne -- Part B: `w` vanishes to infinite order, hence identically near `0` @@ -507,7 +507,7 @@ theorem weierstrassP_eventuallyEq_of_g₂_g₃ (L₁ L₂ : PeriodPair) have hwloc : ∀ᶠ z in 𝓝[≠] (0 : ℂ), w z = 0 := hworder.filter_mono nhdsWithin_le_nhds filter_upwards [hwloc] with z hz have hfe : L₁.weierstrassPExcept 0 z = L₂.weierstrassPExcept 0 z := by - rw [hwdef] at hz; simpa only [sub_eq_zero] using hz + rw [hwdef] at hz; simpa [sub_eq_zero] using hz rw [hPexc L₁ z, hPexc L₂ z] at hfe linear_combination hfe @@ -530,7 +530,7 @@ lemma lattice_subset_of_eqOn (L₁ L₂ : PeriodPair) simp only [Set.mem_compl_iff, Set.mem_union, not_or] refine ⟨?_, hzB⟩ intro hzL1 - exact hzA ⟨hzL1, fun hh => hzne (by simpa only [Set.mem_singleton_iff] using hh)⟩ + exact hzA ⟨hzL1, fun hh => hzne (by simpa using hh)⟩ have hord1 : meromorphicOrderAt L₁.weierstrassP ω = -2 := L₁.order_weierstrassP ω hω1 have hnn : 0 ≤ meromorphicOrderAt L₂.weierstrassP ω := (L₂.analyticOnNhd_weierstrassP ω hω2).meromorphicOrderAt_nonneg @@ -605,12 +605,10 @@ theorem exists_sl2_of_lattice_eq {σ₁ σ₂ : ℍ} {a : ℂˣ} -- Forward direction: `a` and `a·σ₂` lie in `Lτ σ₁`'s lattice have ha_mem : (↑a : ℂ) ∈ (Lτ σ₁).lattice := by rw [hlat, PeriodPair.mem_smul_lattice_iff] - exact ⟨1, PeriodPair.mem_lattice.mpr ⟨1, 0, by simp only [Int.cast_one, Lτ_ω₁, mul_one, - Int.cast_zero, Lτ_ω₂, zero_mul, add_zero]⟩, by rw [mul_one]⟩ + exact ⟨1, PeriodPair.mem_lattice.mpr ⟨1, 0, by simp⟩, by rw [mul_one]⟩ have hb_mem : (↑a : ℂ) * ↑σ₂ ∈ (Lτ σ₁).lattice := by rw [hlat, PeriodPair.mem_smul_lattice_iff] - exact ⟨↑σ₂, PeriodPair.mem_lattice.mpr ⟨0, 1, by simp only [Int.cast_zero, Lτ_ω₁, mul_one, - Int.cast_one, Lτ_ω₂, one_mul, zero_add]⟩, rfl⟩ + exact ⟨↑σ₂, PeriodPair.mem_lattice.mpr ⟨0, 1, by simp⟩, rfl⟩ obtain ⟨m₁, n₁, hA⟩ := PeriodPair.mem_lattice.mp ha_mem obtain ⟨m₂, n₂, hB⟩ := PeriodPair.mem_lattice.mp hb_mem simp only [Lτ_ω₁, Lτ_ω₂, mul_one] at hA hB @@ -622,25 +620,21 @@ theorem exists_sl2_of_lattice_eq {σ₁ σ₂ : ℍ} {a : ℂˣ} rw [PeriodPair.mem_smul_lattice_iff] constructor · intro hz - refine ⟨(↑a : ℂ) * z, ?_, by rw [← mul_assoc]; simp only [Units.val_inv_eq_inv_val, ne_eq, - Units.ne_zero, not_false_eq_true, inv_mul_cancel₀, one_mul]⟩ + refine ⟨(↑a : ℂ) * z, ?_, by rw [← mul_assoc]; simp⟩ rw [hlat, PeriodPair.mem_smul_lattice_iff] exact ⟨z, hz, rfl⟩ · rintro ⟨w, hw, rfl⟩ rw [hlat, PeriodPair.mem_smul_lattice_iff] at hw obtain ⟨w', hw', rfl⟩ := hw rw [← mul_assoc] - simpa only [Units.val_inv_eq_inv_val, ne_eq, Units.ne_zero, not_false_eq_true, - inv_mul_cancel₀, one_mul] using hw' + simpa using hw' -- Reverse direction: `a⁻¹` and `a⁻¹·σ₁` lie in `Lτ σ₂`'s lattice have ha'_mem : ((a⁻¹ : ℂˣ) : ℂ) ∈ (Lτ σ₂).lattice := by rw [hlat2, PeriodPair.mem_smul_lattice_iff] - exact ⟨1, PeriodPair.mem_lattice.mpr ⟨1, 0, by simp only [Int.cast_one, Lτ_ω₁, mul_one, - Int.cast_zero, Lτ_ω₂, zero_mul, add_zero]⟩, by rw [mul_one]⟩ + exact ⟨1, PeriodPair.mem_lattice.mpr ⟨1, 0, by simp⟩, by rw [mul_one]⟩ have hb'_mem : ((a⁻¹ : ℂˣ) : ℂ) * ↑σ₁ ∈ (Lτ σ₂).lattice := by rw [hlat2, PeriodPair.mem_smul_lattice_iff] - exact ⟨↑σ₁, PeriodPair.mem_lattice.mpr ⟨0, 1, by simp only [Int.cast_zero, Lτ_ω₁, mul_one, - Int.cast_one, Lτ_ω₂, one_mul, zero_add]⟩, rfl⟩ + exact ⟨↑σ₁, PeriodPair.mem_lattice.mpr ⟨0, 1, by simp⟩, rfl⟩ obtain ⟨m₁', n₁', hA'⟩ := PeriodPair.mem_lattice.mp ha'_mem obtain ⟨m₂', n₂', hB'⟩ := PeriodPair.mem_lattice.mp hb'_mem simp only [Lτ_ω₁, Lτ_ω₂, mul_one] at hA' hB' @@ -666,8 +660,7 @@ theorem exists_sl2_of_lattice_eq {σ₁ σ₂ : ℍ} {a : ℂˣ} -- product of `normSq`s is `1` have hnprod : Complex.normSq (↑a : ℂ) * Complex.normSq ((a⁻¹ : ℂˣ) : ℂ) = 1 := by rw [← Complex.normSq_mul] - simp only [Units.val_inv_eq_inv_val, ne_eq, Units.ne_zero, not_false_eq_true, mul_inv_cancel₀, - map_one] + simp -- product of the determinants is `1` have hprodR : (((m₁ * n₂ - n₁ * m₂ : ℤ) : ℝ) * ((m₁' * n₂' - n₁' * m₂' : ℤ) : ℝ)) * ((↑σ₁ : ℂ).im * (↑σ₂ : ℂ).im) = (↑σ₁ : ℂ).im * (↑σ₂ : ℂ).im := by @@ -698,7 +691,7 @@ theorem exists_sl2_of_lattice_eq {σ₁ σ₂ : ℍ} {a : ℂˣ} refine ⟨γ, ?_⟩ rw [← UpperHalfPlane.coe_inj, coe_specialLinearGroup_apply] have hden : (↑n₁ : ℂ) * ↑σ₁ + ↑m₁ ≠ 0 := by - have : (↑n₁ : ℂ) * ↑σ₁ + ↑m₁ = ↑a := by rw [h1]; ac_rfl + have : (↑n₁ : ℂ) * ↑σ₁ + ↑m₁ = ↑a := by rw [h1]; ring rw [this]; exact a.ne_zero change (↑σ₂ : ℂ) = _ simp only [hγ, hM, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.cons_val', @@ -746,12 +739,12 @@ of `ℂ`. for the open mapping theorem). Uses the cusp bracketing `theonaeherJ_lower`/`theonaeherJ_upper`: at `im = 3` the lower bound `0.737·e^{6π}` exceeds the upper bound `1.321·e^{4π}` at `im = 2`. -/ theorem j_two_values : ∃ τ₁ τ₂ : ℍ, j τ₁ ≠ j τ₂ := by - set τa : ℍ := UpperHalfPlane.mk ⟨0, 3⟩ (by norm_num1) with hτa - set τb : ℍ := UpperHalfPlane.mk ⟨0, 2⟩ (by norm_num1) with hτb + set τa : ℍ := UpperHalfPlane.mk ⟨0, 3⟩ (by norm_num) with hτa + set τb : ℍ := UpperHalfPlane.mk ⟨0, 2⟩ (by norm_num) with hτb have hima : τa.im = 3 := rfl have himb : τb.im = 2 := rfl - have hRa : τa ∈ Region := by rw [Region, Set.mem_ofPred_eq, hima]; norm_num1 - have hRb : τb ∈ Region := by rw [Region, Set.mem_ofPred_eq, himb]; norm_num1 + have hRa : τa ∈ Region := by rw [Region, Set.mem_ofPred_eq, hima]; norm_num + have hRb : τb ∈ Region := by rw [Region, Set.mem_ofPred_eq, himb]; norm_num refine ⟨τa, τb, ?_⟩ have hlow := theonaeherJ_lower hRa have hup := theonaeherJ_upper hRb @@ -767,7 +760,7 @@ theorem j_two_values : ∃ τ₁ τ₂ : ℍ, j τ₁ ≠ j τ₂ := by linarith only [hae, Real.pi_gt_three] have hE : Real.exp (-(2 * π)) ≤ 1 / 7 := by rw [Real.exp_neg, inv_eq_one_div] - exact one_div_le_one_div_of_le (by norm_num1) h7 + exact one_div_le_one_div_of_le (by norm_num) h7 have hBpos : 0 < Real.exp (-(2 * π * 2)) := Real.exp_pos _ rw [e1, mul_left_comm, mul_comm (0.737 : ℝ)] exact mul_le_mul_of_nonneg_left (by linarith only [hE]) hBpos.le @@ -916,7 +909,7 @@ theorem j_surjective : Function.Surjective (j : ℍ → ℂ) := by intro w have hcl : IsClopen (Set.range (j : ℍ → ℂ)) := ⟨isClosed_range_j, isOpen_range_j⟩ have hne : (Set.range (j : ℍ → ℂ)).Nonempty := - ⟨j (UpperHalfPlane.mk ⟨0, 1⟩ (by norm_num1)), Set.mem_range_self _⟩ + ⟨j (UpperHalfPlane.mk ⟨0, 1⟩ (by norm_num)), Set.mem_range_self _⟩ have hall : Set.range (j : ℍ → ℂ) = Set.univ := hcl.eq_univ hne have hw : w ∈ Set.range (j : ℍ → ℂ) := hall ▸ Set.mem_univ w exact hw diff --git a/LeanPool/Chudnovsky/WeierstrassMore.lean b/LeanPool/Chudnovsky/WeierstrassMore.lean index 66d2cafba7..1a477c5b6b 100644 --- a/LeanPool/Chudnovsky/WeierstrassMore.lean +++ b/LeanPool/Chudnovsky/WeierstrassMore.lean @@ -72,7 +72,7 @@ theorem notMem_lattice_of_mem_fund {z : ℂ} (hz : z ∈ L.fundamentalParallelog rw [mem_lattice] at hlat obtain ⟨m, n, hmn⟩ := hlat have hmn' : (s : ℂ) * L.ω₁ + (t : ℂ) * L.ω₂ = (m : ℂ) * L.ω₁ + (n : ℂ) * L.ω₂ := by - rw [hmn]; simp only [Complex.real_smul] + rw [hmn]; simp [Complex.real_smul] have key : (s - (m : ℝ)) • L.ω₁ + (t - (n : ℝ)) • L.ω₂ = 0 := by simp only [sub_smul, Complex.real_smul] push_cast @@ -94,7 +94,7 @@ theorem notMem_lattice_of_mem_fund {z : ℂ} (hz : z ∈ L.fundamentalParallelog omega apply hz0 rw [← hs, ← ht, hm0, hn0] - simp only [Int.cast_zero, zero_smul, add_zero] + simp /-- `℘ - c` has a pole of order `2` at each lattice point. -/ theorem meromorphicOrderAt_weierstrassP_sub {c : ℂ} {l₀ : ℂ} (h : l₀ ∈ L.lattice) : @@ -139,8 +139,7 @@ theorem sum_untop₀_meromorphicOrderAt_le_two (c : ℂ) (A : Finset ℂ) have hLiou : ∑ z ∈ T, (meromorphicOrderAt f z).untop₀ = 0 := hell.sum_meromorphicOrderAt_eq_zero h0 have hfund0 : (0 : ℂ) ∈ L.fundamentalParallelogram := - ⟨0, Set.left_mem_Ico.mpr zero_lt_one, 0, Set.left_mem_Ico.mpr zero_lt_one, by simp only [ - zero_smul, add_zero]⟩ + ⟨0, Set.left_mem_Ico.mpr zero_lt_one, 0, Set.left_mem_Ico.mpr zero_lt_one, by simp⟩ have hord0 : meromorphicOrderAt f (0 : ℂ) = -2 := by rw [hf_def, L.meromorphicOrderAt_weierstrassP_sub L.lattice.zero_mem] have h0T : (0 : ℂ) ∈ T := (hmemT 0).mpr ⟨hfund0, by rw [hord0]; decide⟩ @@ -157,7 +156,7 @@ theorem sum_untop₀_meromorphicOrderAt_le_two (c : ℂ) (A : Finset ℂ) refine ⟨hane, (hmemT a).mpr ⟨hAf a ha, ?_⟩⟩ have hAn : AnalyticAt ℂ f a := by rw [hf_def]; have := L.analyticOnNhd_weierstrassP a (hAl a ha); fun_prop - have hfa : f a = 0 := by rw [hf_def]; simp only [hAz a ha, sub_self] + have hfa : f a = 0 := by rw [hf_def]; simp [hAz a ha] rw [hAn.meromorphicOrderAt_eq] intro hcontra exact hAn.analyticOrderAt_ne_zero.mpr hfa (ENat.map_natCast_eq_zero.mp hcontra) @@ -182,14 +181,14 @@ theorem two_le_untop₀_meromorphicOrderAt {c : ℂ} {a : ℂ} (ha : a ∉ L.lat set f : ℂ → ℂ := fun z => ℘[L] z - c with hf_def have hAn : AnalyticAt ℂ f a := by rw [hf_def]; have := L.analyticOnNhd_weierstrassP a ha; fun_prop - have hfa : f a = 0 := by rw [hf_def]; simp only [hc, sub_self] + have hfa : f a = 0 := by rw [hf_def]; simp [hc] have hderiv' : deriv f a = 0 := by rw [hf_def, deriv_sub_const, L.deriv_weierstrassP]; exact hderiv have h2 : (2 : ℕ) ≤ analyticOrderAt f a := by rw [natCast_le_analyticOrderAt_iff_iteratedDeriv_eq_zero hAn] intro i hi interval_cases i - · simpa only [iteratedDeriv_zero] using hfa + · simpa [iteratedDeriv_zero] using hfa · rw [iteratedDeriv_one]; exact hderiv' have hne : meromorphicOrderAt f a ≠ ⊤ := by have hmero : Meromorphic f := by rw [hf_def]; fun_prop @@ -408,7 +407,7 @@ theorem derivWeierstrassP_eq_zero_iff {z : ℂ} (hz : z ∉ L.lattice) : rw [hderiv0] at h have h4 : (4 : ℂ) * ((℘[L] z - L.e₁) * (℘[L] z - L.e₂) * (℘[L] z - L.e₃)) = 0 := by linear_combination -h - exact (mul_eq_zero.mp h4).resolve_left (by norm_num1) + exact (mul_eq_zero.mp h4).resolve_left (by norm_num) -- If `℘ p = e_k` but `p ≠ ω_k/2`, we get 4 zeros vs 2 poles, contradiction. have finish : ∀ q ω : ℂ, ω ∈ L.lattice → q = ω / 2 → q ∈ L.fundamentalParallelogram → q ∉ L.lattice → ℘'[L] q = 0 → From 5127d9273c98e54df93f8bbd96586e039c5dc293 Mon Sep 17 00:00:00 2001 From: Vasily Ilin Date: Fri, 13 Nov 2026 17:36:38 +0000 Subject: [PATCH 3/3] Narrow numerical certificate imports with lake shake --- LeanPool/Chudnovsky/NumericalBounds.lean | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/LeanPool/Chudnovsky/NumericalBounds.lean b/LeanPool/Chudnovsky/NumericalBounds.lean index f48ac69a27..478937a6cd 100644 --- a/LeanPool/Chudnovsky/NumericalBounds.lean +++ b/LeanPool/Chudnovsky/NumericalBounds.lean @@ -6,9 +6,12 @@ Authors: Xuanji Li, Lean Pool contributors module public import Mathlib.Basic.Real.Basic -import Mathlib.Algebra.Order.Ring.Pow -import Mathlib.Tactic.Linarith -import Mathlib.Tactic.Ring +import Mathlib.Data.Rat.Cast.Order +import Mathlib.Tactic.Linarith.Frontend +import Mathlib.Tactic.NormNum.Abs +import Mathlib.Tactic.NormNum.DivMod +import Mathlib.Tactic.NormNum.OfScientific +import Mathlib.Tactic.Ring.RingNF /-! # Real interval certificates for the Chudnovsky coefficients