Skip to content

Commit 798365a

Browse files
committed
chore: absorb steps into terminal grind (leanprover-community#32713)
This PR takes existing proofs that end with `grind`, and absorbs steps before `grind` that aren't needed. From [#mathlib4 > Weekly linting log @ πŸ’¬](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Weekly.20linting.20log/near/562390081)
1 parent 02a5455 commit 798365a

12 files changed

Lines changed: 12 additions & 45 deletions

File tree

β€ŽMathlib/Algebra/BigOperators/Group/Finset/Interval.leanβ€Ž

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ lemma prod_Icc_succ_eq_mul_endpoints {R : Type*} [CommGroup R] (f : β„€ β†’ R) {
4141
f (N + 1) * f (-(N + 1) : β„€) * ∏ m ∈ Icc (-N : β„€) N, f m := by
4242
induction N
4343
Β· rw [Icc_succ_succ]
44-
simp only [CharP.cast_eq_zero, neg_zero, Icc_self, zero_add, Int.reduceNeg, union_insert,
45-
union_singleton, mem_insert, reduceCtorEq, mem_singleton, neg_eq_zero, one_ne_zero, or_self,
46-
not_false_eq_true, prod_insert, prod_singleton]
4744
grind
4845
Β· rw [Icc_succ_succ, prod_union (by simp)]
4946
grind

β€ŽMathlib/Algebra/Polynomial/RuleOfSigns.leanβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ private lemma exists_cons_of_leadingCoeff_pos (Ξ·) (h₁ : 0 < leadingCoeff P) (
268268
monomial P.natDegree P.nextCoeff - C Ξ· * monomial P.natDegree P.leadingCoeff by
269269
grind [X_mul_monomial, sub_mul, mul_sub, self_sub_monomial_natDegree_leadingCoeff,
270270
natDegree_eraseLead_add_one, leadingCoeff_eraseLead_eq_nextCoeff]
271-
rw [nextCoeff_of_natDegree_pos (h₇ β–Έ P.natDegree.succ_pos), h₇] at h₉
272271
grind [coeff_X_sub_C_mul, C_mul_monomial, nextCoeff_of_natDegree_pos, leadingCoeff]
273272
Β· rw [h_cons, leadingCoeff_mul, leadingCoeff_X_sub_C, one_mul, hβ‚‚]
274273

β€ŽMathlib/Analysis/Analytic/Order.leanβ€Ž

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,6 @@ theorem isClopen_setOf_analyticOrderAt_eq_top (hf : AnalyticOnNhd π•œ f U) :
370370
obtain ⟨t', h₁t', hβ‚‚t', h₃t'⟩ := hz
371371
use Subtype.val ⁻¹' t'
372372
simp only [isOpen_induced hβ‚‚t', mem_preimage, h₃t', and_self, and_true]
373-
intro w hw
374-
simp only [mem_setOf_eq]
375373
grind
376374

377375
/-- On a connected set, there exists a point where a meromorphic function `f` has finite order iff

β€ŽMathlib/CategoryTheory/Filtered/Basic.leanβ€Ž

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,7 @@ theorem sup_exists :
245245
rw [← Category.assoc]
246246
by_cases h : X = X' ∧ Y = Y'
247247
· rcases h with ⟨rfl, rfl⟩
248-
by_cases hf : f = f'
249-
Β· subst hf
250-
apply coeq_condition
251-
Β· rw [@w' _ _ mX mY f']
252-
grind
248+
grind [coeq_condition]
253249
Β· rw [@w' _ _ mX' mY' f' _]
254250
apply Finset.mem_of_mem_insert_of_ne mf'
255251
contrapose! h

β€ŽMathlib/Combinatorics/SimpleGraph/Walks/Maps.leanβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ theorem map_injective_of_injective {f : G β†’g G'} (hinj : Function.Injective f)
114114
| nil => simp at h
115115
| cons _ _ =>
116116
simp only [map_cons, cons.injEq] at h
117-
cases hinj h.1
118117
grind
119118

120119
section mapLe

β€ŽMathlib/Data/Fin/Tuple/Basic.leanβ€Ž

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,10 +1208,7 @@ lemma find_of_find_le {p : Fin (m + n) β†’ Prop} [DecidablePred p]
12081208

12091209
theorem find?_eq_dite {p : Fin n β†’ Bool} :
12101210
find? p = if h : βˆƒ i, p i then some (Fin.find (p Β·) h) else none := by
1211-
split_ifs with h
1212-
Β· simp_rw [find?_eq_some_iff, Fin.find_spec h, lt_find_iff]
1213-
grind
1214-
Β· simpa [find?_eq_none_iff] using h
1211+
split_ifs <;> grind
12151212

12161213
theorem find?_decide_eq_dite :
12171214
find? (p Β·) = if h : βˆƒ i, p i then some (Fin.find p h) else none := by

β€ŽMathlib/Data/Finset/Pi.leanβ€Ž

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,7 @@ theorem pi_insert [βˆ€ a, DecidableEq (Ξ² a)] {s : Finset Ξ±} {t : βˆ€ a : Ξ±, F
122122
exact ((pi s t).nodup.map <| Multiset.Pi.cons_injective ha).dedup.symm
123123

124124
theorem pi_singletons {Ξ² : Type*} (s : Finset Ξ±) (f : Ξ± β†’ Ξ²) :
125-
(s.pi fun a => ({f a} : Finset Ξ²)) = {fun a _ => f a} := by
126-
ext
127-
grind
125+
(s.pi fun a => ({f a} : Finset Ξ²)) = {fun a _ => f a} := by grind
128126

129127
theorem pi_const_singleton {Ξ² : Type*} (s : Finset Ξ±) (i : Ξ²) :
130128
(s.pi fun _ => ({i} : Finset Ξ²)) = {fun _ _ => i} :=

β€ŽMathlib/Data/Nat/Sqrt.leanβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ private lemma sqrt_isSqrt (n : β„•) : IsSqrt n (sqrt n) := by
106106
simp only [shiftLeft_eq, Nat.one_mul]
107107
refine Nat.le_of_lt (Nat.le_trans lt_log2_self (le_add_right_of_le ?_))
108108
rw [← Nat.pow_add]
109-
apply Nat.pow_le_pow_right (by decide)
110109
grind
111110

112111
lemma sqrt_le (n : β„•) : sqrt n * sqrt n ≀ n := (sqrt_isSqrt n).left

β€ŽMathlib/Data/PFun.leanβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,6 @@ theorem dom_comp (f : Ξ² β†’. Ξ³) (g : Ξ± β†’. Ξ²) : (f.comp g).Dom = g.preimage
497497
@[simp]
498498
theorem preimage_comp (f : Ξ² β†’. Ξ³) (g : Ξ± β†’. Ξ²) (s : Set Ξ³) :
499499
(f.comp g).preimage s = g.preimage (f.preimage s) := by
500-
ext
501500
grind
502501

503502
@[simp]

β€ŽMathlib/MeasureTheory/Integral/IntervalIntegral/DerivIntegrable.leanβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ theorem MonotoneOn.intervalIntegral_deriv_mem_uIcc {f : ℝ β†’ ℝ} {a b : ℝ}
139139
refine intervalIntegral.integral_congr_ae ?_
140140
rw [uIoc_of_le hab]
141141
filter_upwards [hβ‚‚] with x _ _
142-
exact abs_eq_self.mpr (f_deriv_nonneg (by rw [← Ioc_diff_right]; grind)) |>.symm
142+
exact abs_eq_self.mpr (f_deriv_nonneg (by grind)) |>.symm
143143

144144
/-- If `f` has bounded variation on `uIcc a b`, then `f'` is interval integrable on `a..b`. -/
145145
theorem BoundedVariationOn.intervalIntegrable_deriv {f : ℝ β†’ ℝ} {a b : ℝ}

0 commit comments

Comments
Β (0)