Skip to content

Commit

Permalink
feat: Port/Data.Finsupp.ToDfinsupp (#1995)
Browse files Browse the repository at this point in the history
port of data.finsup.to_dfinsupp

includes naming of instances in `Data.Finsupp.Defs`

Had to unroll the instance defs for `sigmaFinsuppLequivDfinsupp` (duplicating defs) to address a timeout issue.



Co-authored-by: ChrisHughes24 <chrishughes24@gmail.com>
Co-authored-by: Johan Commelin <johan@commelin.net>
  • Loading branch information
3 people committed Feb 3, 2023
1 parent 0fd92f8 commit 207a0e5
Show file tree
Hide file tree
Showing 3 changed files with 402 additions and 3 deletions.
1 change: 1 addition & 0 deletions Mathlib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ import Mathlib.Data.Finsupp.NeLocus
import Mathlib.Data.Finsupp.Order
import Mathlib.Data.Finsupp.Pointwise
import Mathlib.Data.Finsupp.Pwo
import Mathlib.Data.Finsupp.ToDfinsupp
import Mathlib.Data.Fintype.Basic
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.Fintype.Card
Expand Down
6 changes: 3 additions & 3 deletions Mathlib/Data/Finsupp/Defs.lean
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ theorem coe_mk (f : α → M) (s : Finset α) (h : ∀ a, a ∈ s ↔ f a ≠ 0)
rfl
#align finsupp.coe_mk Finsupp.coe_mk

instance : Zero (α →₀ M) :=
instance hasZero: Zero (α →₀ M) :=
⟨⟨∅, 0, fun _ => ⟨fun h ↦ (not_mem_empty _ h).elim, fun H => (H rfl).elim⟩⟩⟩

@[simp]
Expand Down Expand Up @@ -1002,7 +1002,7 @@ theorem single_add (a : α) (b₁ b₂ : M) : single a (b₁ + b₂) = single a
· rw [add_apply, single_eq_of_ne h, single_eq_of_ne h, single_eq_of_ne h, zero_add]
#align finsupp.single_add Finsupp.single_add

instance : AddZeroClass (α →₀ M) :=
instance addZeroClass: AddZeroClass (α →₀ M) :=
FunLike.coe_injective.addZeroClass _ coe_zero coe_add

/-- `Finsupp.single` as an `AddMonoidHom`.
Expand Down Expand Up @@ -1211,7 +1211,7 @@ instance hasNatScalar : SMul ℕ (α →₀ M) :=
fun n v => v.mapRange ((· • ·) n) (nsmul_zero _)⟩
#align finsupp.has_nat_scalar Finsupp.hasNatScalar

instance : AddMonoid (α →₀ M) :=
instance addMonoid: AddMonoid (α →₀ M) :=
FunLike.coe_injective.addMonoid _ coe_zero coe_add fun _ _ => rfl

end AddMonoid
Expand Down
Loading

0 comments on commit 207a0e5

Please sign in to comment.