Skip to content

Commit aa0d62f

Browse files
committed
chore: golf using grind (leanprover-community#33825)
1 parent 2ca69d3 commit aa0d62f

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ the product over `s`, as long as `a` is in `s` or `f a = 1`. -/
6262
the sum over `s`, as long as `a` is in `s` or `f a = 0`. -/]
6363
theorem prod_insert_of_eq_one_if_notMem [DecidableEq ι] (h : a ∉ s → f a = 1) :
6464
∏ x ∈ insert a s, f x = ∏ x ∈ s, f x := by
65-
by_cases hm : a ∈ s
66-
· simp_rw [insert_eq_of_mem hm]
67-
· rw [prod_insert hm, h hm, one_mul]
65+
by_cases a ∈ s <;> grind
6866

6967
/-- The product of `f` over `insert a s` is the same as
7068
the product over `s`, as long as `f a = 1`. -/

Mathlib/Data/Finset/Sym.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@ theorem sym2_univ [Fintype α] (inst : Fintype (Sym2 α) := Sym2.instFintype) :
8787

8888
@[simp, mono]
8989
theorem sym2_mono (h : s ⊆ t) : s.sym2 ⊆ t.sym2 := by
90-
rw [← val_le_iff, sym2_val, sym2_val]
91-
apply Multiset.sym2_mono
92-
rwa [val_le_iff]
90+
grind
9391

9492
theorem monotone_sym2 : Monotone (Finset.sym2 : Finset α → _) := fun _ _ => sym2_mono
9593

Mathlib/Data/Finsupp/Defs.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,7 @@ theorem support_onFinset [DecidableEq M] {s : Finset α} {f : α → M}
255255
@[simp]
256256
theorem support_onFinset_subset {s : Finset α} {f : α → M} {hf} :
257257
(onFinset s f hf).support ⊆ s := by
258-
classical
259-
rw [support_onFinset]
260-
exact filter_subset (f · ≠ 0) s
258+
grind
261259

262260
grind_pattern support_onFinset_subset => onFinset s f hf
263261

Mathlib/Order/Disjoint.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ theorem top_disjoint : Disjoint ⊤ a ↔ a = ⊥ :=
144144

145145
@[to_dual]
146146
theorem Disjoint.ne_top_of_ne_bot (h : Disjoint a b) (ha : a ≠ ⊥) : b ≠ ⊤ := by
147-
rintro rfl; exact ha <| by simpa using h
147+
grind
148148

149149
@[deprecated ne_bot_of_ne_top (since := "2025-11-07")]
150150
lemma Codisjoint.ne_bot_of_ne_top' (h : Codisjoint a b) (hb : b ≠ ⊤) : a ≠ ⊥ :=

0 commit comments

Comments
 (0)