Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 327259a

Browse files
committed
refactor(data/dfinsupp/basic): Improve definitional equalities of coercions (#15521)
This means that `dfinsupp.coe_add` etc are true by definition, rather than requiring the application of `quotient.induction` first. The key change is that the underlying function is no longer "hidden" under the quotient, as it does not need to be. One motivation for this is to make the API more similar to that of `finsupp`. This change eliminates `dfinsupp.pre`, instead using `{s : multiset ι // ∀ i, i ∈ s ∨ to_fun i = 0}` directly. We no longer even need to create a `setoid` instance, since we can just use `trunc`. While adjusting some proofs in `data/finsupp/interval` to use the new definition, this ended up eliminating some decidable arguments. I don't think that is a consequence of this redefinition, and is incidental cleanup that could have been performed separately.
1 parent dcb4b68 commit 327259a

File tree

5 files changed

+213
-252
lines changed

5 files changed

+213
-252
lines changed

src/algebra/direct_sum/basic.lean

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ variables [Π i, add_comm_group (β i)]
4949
instance : add_comm_group (direct_sum ι β) := dfinsupp.add_comm_group
5050

5151
variables {β}
52-
@[simp] lemma sub_apply (g₁ g₂ : ⨁ i, β i) (i : ι) : (g₁ - g₂) i = g₁ i - g₂ i :=
53-
dfinsupp.sub_apply _ _ _
52+
@[simp] lemma sub_apply (g₁ g₂ : ⨁ i, β i) (i : ι) : (g₁ - g₂) i = g₁ i - g₂ i := rfl
5453

5554
end add_comm_group
5655

@@ -59,8 +58,7 @@ variables [Π i, add_comm_monoid (β i)]
5958
@[simp] lemma zero_apply (i : ι) : (0 : ⨁ i, β i) i = 0 := rfl
6059

6160
variables {β}
62-
@[simp] lemma add_apply (g₁ g₂ : ⨁ i, β i) (i : ι) : (g₁ + g₂) i = g₁ i + g₂ i :=
63-
dfinsupp.add_apply _ _ _
61+
@[simp] lemma add_apply (g₁ g₂ : ⨁ i, β i) (i : ι) : (g₁ + g₂) i = g₁ i + g₂ i := rfl
6462

6563
variables (β)
6664
include dec_ι
@@ -223,10 +221,10 @@ variables {α : ι → Type u} {δ : Π i, α i → Type w} [Π i j, add_comm_mo
223221
noncomputable def sigma_curry : (⨁ (i : Σ i, _), δ i.1 i.2) →+ ⨁ i j, δ i j :=
224222
{ to_fun := @dfinsupp.sigma_curry _ _ δ _,
225223
map_zero' := dfinsupp.sigma_curry_zero,
226-
map_add' := λ f g, dfinsupp.sigma_curry_add f g }
224+
map_add' := λ f g, @dfinsupp.sigma_curry_add _ _ δ _ f g }
227225

228226
@[simp] lemma sigma_curry_apply (f : ⨁ (i : Σ i, _), δ i.1 i.2) (i : ι) (j : α i) :
229-
sigma_curry f i j = f ⟨i, j⟩ := dfinsupp.sigma_curry_apply f i j
227+
sigma_curry f i j = f ⟨i, j⟩ := @dfinsupp.sigma_curry_apply _ _ δ _ f i j
230228

231229
/--The natural map between `⨁ i (j : α i), δ i j` and `Π₀ (i : Σ i, α i), δ i.1 i.2`, inverse of
232230
`curry`.-/

0 commit comments

Comments
 (0)