Skip to content

Commit c441d4f

Browse files
committed
2 parents 526a44c + be32fc5 commit c441d4f

File tree

8 files changed

+13
-22
lines changed

8 files changed

+13
-22
lines changed

Mathlib/Algebra/Polynomial/Reverse.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ theorem coeff_reflect (N : ℕ) (f : R[X]) (i : ℕ) : coeff (reflect N f) i = f
100100
calc
101101
Finsupp.embDomain (revAt N) f i = Finsupp.embDomain (revAt N) f (revAt N (revAt N i)) := by
102102
rw [revAt_invol]
103-
_ = f (revAt N i) := Finsupp.embDomain_apply _ _ _
103+
_ = f (revAt N i) := Finsupp.embDomain_apply_self _ _ _
104104

105105
@[simp]
106106
theorem reflect_zero {N : ℕ} : reflect N (0 : R[X]) = 0 :=

Mathlib/Analysis/Fourier/BoundedContinuousFunctionChar.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ lemma star_mem_range_charAlgHom (he : Continuous e) (hL : Continuous fun p : V
140140
refine ⟨z.embDomain f, ?_⟩
141141
ext1 u
142142
simp only [charAlgHom_apply, Finsupp.support_embDomain, Finset.sum_map,
143-
Finsupp.embDomain_apply, star_apply, star_sum, star_mul', Circle.star_addChar]
143+
Finsupp.embDomain_apply_self, star_apply, star_sum, star_mul', Circle.star_addChar]
144144
rw [Finsupp.support_mapRange_of_injective (star_zero _) y star_injective]
145145
simp [z, f]
146146

Mathlib/Data/Finsupp/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ theorem subtypeDomain_not_piecewise (f : Subtype P →₀ M) (g : {a // ¬ P a}
10971097
Finsupp.ext fun a => dif_neg a.prop
10981098

10991099
/-- Extend the domain of a `Finsupp` by using `0` where `P x` does not hold. -/
1100-
@[simps! support toFun]
1100+
@[simps! (attr := grind =) support toFun]
11011101
def extendDomain (f : Subtype P →₀ M) : α →₀ M := piecewise f 0
11021102

11031103
theorem extendDomain_eq_embDomain_subtype (f : Subtype P →₀ M) :

Mathlib/Data/Finsupp/Defs.lean

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ instance instFunLike : FunLike (α →₀ M) α M :=
113113
ext a
114114
exact (hf _).trans (hg _).symm⟩
115115

116-
@[ext]
116+
@[ext, grind ext]
117117
theorem ext {f g : α →₀ M} (h : ∀ a, f a = g a) : f = g :=
118118
DFunLike.ext _ _ h
119119

@@ -299,7 +299,7 @@ def mapRange (f : M → N) (hf : f 0 = 0) (g : α →₀ M) : α →₀ N :=
299299
onFinset g.support (f ∘ g) fun a => by
300300
rw [mem_support_iff, not_imp_not]; exact fun H => (congr_arg f H).trans hf
301301

302-
@[simp]
302+
@[simp, grind =]
303303
theorem mapRange_apply {f : M → N} {hf : f 0 = 0} {g : α →₀ M} {a : α} :
304304
mapRange f hf g a = f (g a) :=
305305
rfl
@@ -427,7 +427,7 @@ theorem embDomain_apply (f : α ↪ β) (v : α →₀ M) (b : β) :
427427
-- TODO: investigate why `grind` needs `split_ifs` first; this should never happen.
428428
split_ifs <;> grind
429429

430-
@[simp]
430+
@[simp, grind =]
431431
theorem embDomain_apply_self (f : α ↪ β) (v : α →₀ M) (a : α) : embDomain f v (f a) = v a := by
432432
classical
433433
simp_rw [embDomain, coe_mk, mem_map']
@@ -455,12 +455,7 @@ theorem embDomain_eq_zero {f : α ↪ β} {l : α →₀ M} : embDomain f l = 0
455455
(embDomain_injective f).eq_iff' <| embDomain_zero f
456456

457457
theorem embDomain_mapRange (f : α ↪ β) (g : M → N) (p : α →₀ M) (hg : g 0 = 0) :
458-
embDomain f (mapRange g hg p) = mapRange g hg (embDomain f p) := by
459-
ext a
460-
by_cases h : a ∈ Set.range f
461-
· rcases h with ⟨a', rfl⟩
462-
rw [mapRange_apply, embDomain_apply_self, embDomain_apply_self, mapRange_apply]
463-
· rw [mapRange_apply, embDomain_notin_range, embDomain_notin_range, ← hg] <;> assumption
458+
embDomain f (mapRange g hg p) = mapRange g hg (embDomain f p) := by grind
464459

465460
end EmbDomain
466461

Mathlib/Data/Finsupp/Option.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ theorem sum_option_index_smul [Semiring R] [AddCommMonoid M] [Module R M] (f : O
110110
f.sum_option_index _ (fun _ => zero_smul _ _) fun _ _ _ => add_smul _ _ _
111111

112112
@[simp] lemma some_embDomain_some [Zero M] (f : α →₀ M) : (f.embDomain .some).some = f := by
113-
ext; rw [some_apply]; exact embDomain_apply _ _ _
113+
ext; rw [some_apply]; exact embDomain_apply_self _ _ _
114114

115115
@[simp] lemma embDomain_some_none [Zero M] (f : α →₀ M) : f.embDomain .some none = 0 :=
116116
embDomain_notin_range _ _ _ (by simp)

Mathlib/Data/Finsupp/Single.lean

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def single (a : α) (b : M) : α →₀ M where
6060
· simp [hb, Pi.single, update]
6161
simp [ha]
6262

63+
@[grind =]
6364
theorem single_apply [Decidable (a = a')] : single a b a' = if a = a' then b else 0 := by
6465
classical
6566
simp_rw [@eq_comm _ a a', single, coe_mk, Pi.single_apply]
@@ -469,11 +470,7 @@ theorem single_of_embDomain_single (l : α →₀ M) (f : α ↪ β) (a : β) (b
469470
constructor
470471
· ext d
471472
rw [← embDomain_apply_self f l, h]
472-
by_cases h_cases : c = d
473-
· simp only [Eq.symm h_cases, hc₂, single_eq_same]
474-
· rw [single_apply, single_apply, if_neg, if_neg h_cases]
475-
by_contra hfd
476-
exact h_cases (f.injective (hc₂.trans hfd))
473+
grind
477474
· exact hc₂
478475

479476
@[simp]

Mathlib/Data/List/ToFinsupp.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ theorem toFinsupp_append {R : Type*} [AddZeroClass R] (l₁ l₂ : List R)
101101
| inr h =>
102102
rcases Nat.exists_eq_add_of_le h with ⟨k, rfl⟩
103103
rw [getD_append_right _ _ _ _ h, Nat.add_sub_cancel_left, getD_eq_default _ _ h, zero_add]
104-
exact Eq.symm (Finsupp.embDomain_apply _ _ _)
104+
exact Eq.symm (Finsupp.embDomain_apply_self _ _ _)
105105

106106
theorem toFinsupp_cons_eq_single_add_embDomain {R : Type*} [AddZeroClass R] (x : R) (xs : List R)
107107
[DecidablePred (getD (x::xs) · 00)] [DecidablePred (getD xs · 00)] :

Mathlib/Logic/Embedding/Basic.lean

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ theorem coeFn_mk {α β} (f : α → β) (i) : (@mk _ _ f i : α → β) = f :=
114114
theorem mk_coe {α β : Type*} (f : α ↪ β) (inj) : (⟨f, inj⟩ : α ↪ β) = f :=
115115
rfl
116116

117-
@[grind! .]
117+
@[grind! .] -- This adds `Injective f` into the grind context for every embedding `f : α ↪ β`.
118118
protected theorem injective {α β} (f : α ↪ β) : Injective f :=
119119
EmbeddingLike.injective f
120120

@@ -180,8 +180,7 @@ def setValue {α β : Sort*} (f : α ↪ β) (a : α) (b : β) [∀ a', Decidabl
180180
[∀ a', Decidable (f a' = b)] : α ↪ β :=
181181
fun a' => if a' = a then b else if f a' = b then f a else f a', by
182182
intro x y h
183-
simp only at h
184-
split_ifs at h <;> (try subst b) <;> (try simp only [f.injective.eq_iff] at *) <;> grind⟩
183+
grind⟩
185184

186185
@[simp]
187186
theorem setValue_eq {α β} (f : α ↪ β) (a : α) (b : β) [∀ a', Decidable (a' = a)]

0 commit comments

Comments
 (0)