Skip to content

Commit be0a10d

Browse files
committed
chore: replace long terminal simp only […]:s (≥4 lemmas) with bare simp:s (leanprover-community#36639)
The goal of this PR is to decrease the number of times lemmas are called explicitly. Any decrease in compilation time is a welcome side effect, although it is not a primary objective. Trace profiling results (differences <30 ms considered measurement noise): * `Polynomial.degree_sum_le`: unchanged 🎉 * `AlgebraicGeometry.Scheme.PartialMap.ext_iff`: unchanged 🎉 * `MeromorphicAt.inv`: 515 ms before, 469 ms after 🎉 * `IsLowerSet.le_card_inter_finset'`: unchanged 🎉 * `SimpleGraph.adj_and_reachable_delete_edges_iff_exists_cycle`: unchanged 🎉 * `List.Vector.scanl_get`: unchanged 🎉 * `isSeparable_algebraMap`: unchanged 🎉 * `ArithmeticFunction.vonMangoldt.not_summable_residueClass_prime_div`: 643 ms before, 597 ms after 🎉 * `CompleteLattice.isCompactElement_iff_exists_le_sSup_of_le_sSup`: 163 ms before, 120 ms after 🎉 * `ProbabilityTheory.meas_ge_le_variance_div_sq`: unchanged 🎉 * `MvPowerSeries.mem_nonZeroDivisorsRight_of_constantCoeff`: 936 ms before, 485 ms after 🎉 * `Polynomial.mem_span_C_X_sub_C_X_sub_C_iff_eval_eval_eq_zero`: unchanged 🎉 * `ENNReal.limsup_sub_const`: 185 ms before, 95 ms after 🎉 Profiled using `set_option trace.profiler true in`. This PR is batched under the following guidelines: * Up to ~5 changed files per PR * Up to ~25 changed declarations per PR * Up to ~100 changed lines per PR
1 parent 55aa437 commit be0a10d

13 files changed

Lines changed: 13 additions & 15 deletions

File tree

Mathlib/Algebra/Polynomial/Degree/Defs.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ theorem degree_update_le (p : R[X]) (n : ℕ) (a : R) : degree (p.update n a)
388388

389389
theorem degree_sum_le (s : Finset ι) (f : ι → R[X]) :
390390
degree (∑ i ∈ s, f i) ≤ s.sup fun b => degree (f b) :=
391-
Finset.cons_induction_on s (by simp only [sum_empty, sup_empty, degree_zero, le_refl])
391+
Finset.cons_induction_on s (by simp)
392392
fun a s has ih =>
393393
calc
394394
degree (∑ i ∈ cons a s has, f i) ≤ max (degree (f a)) (degree (∑ i ∈ s, f i)) := by

Mathlib/AlgebraicGeometry/RationalMap.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ lemma ext_iff (f g : X.PartialMap Y) :
6262
f = g ↔ ∃ e : f.domain = g.domain, f.hom = (X.isoOfEq e).hom ≫ g.hom := by
6363
constructor
6464
· rintro rfl
65-
simp only [exists_true_left, Scheme.isoOfEq_rfl, Iso.refl_hom, Category.id_comp]
65+
simp
6666
· obtain ⟨U, hU, f⟩ := f
6767
obtain ⟨V, hV, g⟩ := g
6868
rintro ⟨rfl : U = V, e⟩

Mathlib/Analysis/Meromorphic/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ lemma inv {f : 𝕜 → 𝕜'} (hf : MeromorphicAt f x) : MeromorphicAt f⁻¹ x
244244
refine ⟨n + 1, (this.fun_smul <| hg_an.inv hg_ne).congr ?_⟩
245245
filter_upwards [hg_eq, hg_an.continuousAt.eventually_ne hg_ne] with z hfg hg_ne'
246246
rcases eq_or_ne z x with rfl | hz_ne
247-
· simp only [sub_self, pow_succ, mul_zero, zero_smul]
247+
· simp
248248
· replace hfg := congr_arg (·⁻¹) hfg
249249
simp only [smul_inv₀] at hfg
250250
rw [inv_smul_eq_iff₀ (pow_ne_zero m (sub_ne_zero.mpr hz_ne)), smul_comm,

Mathlib/Combinatorics/SetFamily/HarrisKleitman.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ theorem IsLowerSet.le_card_inter_finset' (h𝒜 : IsLowerSet (𝒜 : Set (Finset
6161
obtain rfl | rfl := h𝒜s
6262
· simp only [card_empty, zero_mul, empty_inter, mul_zero, le_refl]
6363
obtain rfl | rfl := hℬs
64-
· simp only [card_empty, inter_empty, mul_zero, le_refl]
64+
· simp
6565
· simp only [card_empty, pow_zero, inter_singleton_of_mem, mem_singleton, card_singleton,
6666
le_refl]
6767
| insert a s hs ih =>

Mathlib/Combinatorics/SimpleGraph/Connectivity/Connected.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ theorem adj_and_reachable_delete_edges_iff_exists_cycle {v w : V} :
795795
rw [Sym2.eq_swap]
796796
intro h
797797
cases hp (Walk.edges_toPath_subset p h)
798-
· simp only [Sym2.eq_swap, Walk.edges_cons, List.mem_cons, true_or]
798+
· simp
799799
· rintro ⟨u, c, hc, he⟩
800800
refine ⟨c.adj_of_mem_edges he, ?_⟩
801801
by_contra! hb

Mathlib/Data/Vector/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ theorem scanl_get (i : Fin n) :
375375
| succ n hn =>
376376
rw [← cons_head_tail v, scanl_cons, get_cons_succ]
377377
refine Fin.cases ?_ ?_ i
378-
· simp only [get_zero, scanl_head, Fin.castSucc_zero, head_cons]
378+
· simp
379379
· intro i'
380380
simp only [hn, Fin.castSucc_succ, get_cons_succ]
381381

Mathlib/FieldTheory/Separable.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ variable [Ring K] [Algebra F K]
656656
variable {F} in
657657
theorem isSeparable_algebraMap (x : F) : IsSeparable F (algebraMap F K x) :=
658658
Polynomial.Separable.of_dvd (Polynomial.separable_X_sub_C (x := x))
659-
(minpoly.dvd F (algebraMap F K x) (by simp only [map_sub, aeval_X, aeval_C, sub_self]))
659+
(minpoly.dvd F (algebraMap F K x) (by simp))
660660

661661
instance Algebra.isSeparable_self : Algebra.IsSeparable F F :=
662662
⟨isSeparable_algebraMap⟩

Mathlib/NumberTheory/LSeries/PrimesInAP.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ lemma not_summable_residueClass_prime_div (ha : IsUnit a) :
430430
have H₁ {x : ℝ} (hx : 1 < x) : ∑' n, residueClass a n / (n : ℝ) ^ x ≤ C := by
431431
refine Summable.tsum_le_tsum (fun n ↦ ?_) ?_ key
432432
· rcases n.eq_zero_or_pos with rfl | hn
433-
· simp only [Nat.cast_zero, Real.zero_rpow (zero_lt_one.trans hx).ne', div_zero, le_refl]
433+
· simp
434434
· refine div_le_div_of_nonneg_left (residueClass_nonneg a _) (mod_cast hn) ?_
435435
conv_lhs => rw [← Real.rpow_one n]
436436
exact Real.rpow_le_rpow_of_exponent_le (by norm_cast) hx.le

Mathlib/Order/CompactlyGenerated/Basic.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ theorem isCompactElement_iff_exists_le_sSup_of_le_sSup (k : α) :
125125
have Sne : S.Nonempty := by
126126
suffices ⊥ ∈ S from Set.nonempty_of_mem this
127127
use ∅
128-
simp only [Set.empty_subset, Finset.coe_empty, Finset.sup_empty,
129-
and_self_iff]
128+
simp
130129
-- Now apply the defn of compact and finish.
131130
obtain ⟨j, ⟨hjS, hjk⟩⟩ := hk S Sne dir_US (le_trans hsup sup_S)
132131
obtain ⟨t, ⟨htS, htsup⟩⟩ := hjS

Mathlib/Probability/Moments/Variance.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ theorem meas_ge_le_variance_div_sq [IsFiniteMeasure μ] {X : Ω → ℝ} (hX : M
379379
(hc : 0 < c) : μ {ω | c ≤ |X ω - μ[X]|} ≤ ENNReal.ofReal (variance X μ / c ^ 2) := by
380380
rw [ENNReal.ofReal_div_of_pos (sq_pos_of_ne_zero hc.ne.symm), hX.ofReal_variance_eq]
381381
convert @meas_ge_le_evariance_div_sq _ _ _ _ hX.1 c.toNNReal (by simp [hc]) using 1
382-
· simp only [Real.coe_toNNReal', max_le_iff, abs_nonneg, and_true]
382+
· simp
383383
· rw [ENNReal.ofReal_pow hc.le]
384384
rfl
385385

0 commit comments

Comments
 (0)