File: Mathlib/Data/Finsupp/Basic.lean

full_name: Finsupp.graph
code: /-- The graph of a finitely supported function over its support, i.e. the finset of input and output
pairs with non-zero outputs. -/
def graph (f : α →₀ M) : Finset (α × M) 
goal: Finset (α × M)

full_name: Finsupp.mk_mem_graph_iff
code: theorem mk_mem_graph_iff {a : α} {m : M} {f : α →₀ M} : (a, m) ∈ f.graph ↔ f a = m ∧ m ≠ 0 
goal: (a, m) ∈ f.graph ↔ f a = m ∧ m ≠ 0

full_name: Finsupp.mem_graph_iff
code: @[simp]
theorem mem_graph_iff {c : α × M} {f : α →₀ M} : c ∈ f.graph ↔ f c.1 = c.2 ∧ c.2 ≠ 0 
goal: c ∈ f.graph ↔ f c.1 = c.2 ∧ c.2 ≠ 0

full_name: Finsupp.mk_mem_graph
code: theorem mk_mem_graph (f : α →₀ M) {a : α} (ha : a ∈ f.support) : (a, f a) ∈ f.graph 
goal: (a, f a) ∈ f.graph

full_name: Finsupp.apply_eq_of_mem_graph
code: theorem apply_eq_of_mem_graph {a : α} {m : M} {f : α →₀ M} (h : (a, m) ∈ f.graph) : f a = m 
goal: f a = m

full_name: Finsupp.not_mem_graph_snd_zero
code: @[simp 1100] -- Porting note: change priority to appease `simpNF`
theorem not_mem_graph_snd_zero (a : α) (f : α →₀ M) : (a, (0 : M)) ∉ f.graph 
goal: (a, 0) ∉ f.graph

full_name: Finsupp.image_fst_graph
code: @[simp]
theorem image_fst_graph [DecidableEq α] (f : α →₀ M) : f.graph.image Prod.fst = f.support 
goal: Finset.image Prod.fst f.graph = f.support

full_name: Finsupp.graph_injective
code: theorem graph_injective (α M) [Zero M] : Injective (@graph α M _) 
goal: Function.Injective Finsupp.graph

full_name: Finsupp.graph_inj
code: @[simp]
theorem graph_inj {f g : α →₀ M} : f.graph = g.graph ↔ f = g 
goal: f.graph = g.graph ↔ f = g

full_name: Finsupp.graph_zero
code: @[simp]
theorem graph_zero : graph (0 : α →₀ M) = ∅ 
goal: Finsupp.graph 0 = ∅

full_name: Finsupp.graph_eq_empty
code: @[simp]
theorem graph_eq_empty {f : α →₀ M} : f.graph = ∅ ↔ f = 0 
goal: f.graph = ∅ ↔ f = 0

full_name: Finsupp.mapRange.equiv_apply
code: /-- `Finsupp.mapRange` as an equiv. -/
@[simps apply]
def mapRange.equiv (f : M ≃ N) (hf : f 0 = 0) (hf' : f.symm 0 = 0) : (α →₀ M) ≃ (α →₀ N) 
goal: (Finsupp.mapRange.equiv f hf hf') g = Finsupp.mapRange (⇑f) hf g

full_name: Finsupp.mapRange.equiv
code: /-- `Finsupp.mapRange` as an equiv. -/
@[simps apply]
def mapRange.equiv (f : M ≃ N) (hf : f 0 = 0) (hf' : f.symm 0 = 0) : (α →₀ M) ≃ (α →₀ N) 
goal: (α →₀ M) ≃ (α →₀ N)

full_name: Finsupp.mapRange.equiv_refl
code: @[simp]
theorem mapRange.equiv_refl : mapRange.equiv (Equiv.refl M) rfl rfl = Equiv.refl (α →₀ M) 
goal: Finsupp.mapRange.equiv (Equiv.refl M) ⋯ ⋯ = Equiv.refl (α →₀ M)

full_name: Finsupp.mapRange.equiv_trans
code: theorem mapRange.equiv_trans (f : M ≃ N) (hf : f 0 = 0) (hf') (f₂ : N ≃ P) (hf₂ : f₂ 0 = 0) (hf₂') :
    (mapRange.equiv (f.trans f₂) (by rw [Equiv.trans_apply, hf, hf₂])
          (by rw [Equiv.symm_trans_apply, hf₂', hf']) :
        (α →₀ _) ≃ _) =
      (mapRange.equiv f hf hf').trans (mapRange.equiv f₂ hf₂ hf₂') 
goal: Finsupp.mapRange.equiv (f.trans f₂) ⋯ ⋯ = (Finsupp.mapRange.equiv f hf hf').trans (Finsupp.mapRange.equiv f₂ hf₂ hf₂')

full_name: Finsupp.mapRange.equiv_symm
code: @[simp]
theorem mapRange.equiv_symm (f : M ≃ N) (hf hf') :
    ((mapRange.equiv f hf hf').symm : (α →₀ _) ≃ _) = mapRange.equiv f.symm hf' hf 
goal: (Finsupp.mapRange.equiv f hf hf').symm = Finsupp.mapRange.equiv f.symm hf' hf

full_name: Finsupp.mapRange.zeroHom
code: /-- Composition with a fixed zero-preserving homomorphism is itself a zero-preserving homomorphism
on functions. -/
@[simps]
def mapRange.zeroHom (f : ZeroHom M N) : ZeroHom (α →₀ M) (α →₀ N) 
goal: ZeroHom (α →₀ M) (α →₀ N)

full_name: Finsupp.mapRange.zeroHom_apply
code: /-- Composition with a fixed zero-preserving homomorphism is itself a zero-preserving homomorphism
on functions. -/
@[simps]
def mapRange.zeroHom (f : ZeroHom M N) : ZeroHom (α →₀ M) (α →₀ N) 
goal: (Finsupp.mapRange.zeroHom f) g = Finsupp.mapRange ⇑f ⋯ g

full_name: Finsupp.mapRange.zeroHom_id
code: @[simp]
theorem mapRange.zeroHom_id : mapRange.zeroHom (ZeroHom.id M) = ZeroHom.id (α →₀ M) 
goal: Finsupp.mapRange.zeroHom (ZeroHom.id M) = ZeroHom.id (α →₀ M)

full_name: Finsupp.mapRange.zeroHom_comp
code: theorem mapRange.zeroHom_comp (f : ZeroHom N P) (f₂ : ZeroHom M N) :
    (mapRange.zeroHom (f.comp f₂) : ZeroHom (α →₀ _) _) =
      (mapRange.zeroHom f).comp (mapRange.zeroHom f₂) 
goal: Finsupp.mapRange.zeroHom (f.comp f₂) = (Finsupp.mapRange.zeroHom f).comp (Finsupp.mapRange.zeroHom f₂)

full_name: Finsupp.mapRange.addMonoidHom
code: /-- Composition with a fixed additive homomorphism is itself an additive homomorphism on functions.
-/
@[simps]
def mapRange.addMonoidHom (f : M →+ N) : (α →₀ M) →+ α →₀ N 
goal: (α →₀ M) →+ α →₀ N

full_name: Finsupp.mapRange.addMonoidHom_apply
code: /-- Composition with a fixed additive homomorphism is itself an additive homomorphism on functions.
-/
@[simps]
def mapRange.addMonoidHom (f : M →+ N) : (α →₀ M) →+ α →₀ N 
goal: (Finsupp.mapRange.addMonoidHom f) g = Finsupp.mapRange ⇑f ⋯ g

full_name: Finsupp.mapRange.addMonoidHom_id
code: @[simp]
theorem mapRange.addMonoidHom_id :
    mapRange.addMonoidHom (AddMonoidHom.id M) = AddMonoidHom.id (α →₀ M) 
goal: Finsupp.mapRange.addMonoidHom (AddMonoidHom.id M) = AddMonoidHom.id (α →₀ M)

full_name: Finsupp.mapRange.addMonoidHom_comp
code: theorem mapRange.addMonoidHom_comp (f : N →+ P) (f₂ : M →+ N) :
    (mapRange.addMonoidHom (f.comp f₂) : (α →₀ _) →+ _) =
      (mapRange.addMonoidHom f).comp (mapRange.addMonoidHom f₂) 
goal: Finsupp.mapRange.addMonoidHom (f.comp f₂) = (Finsupp.mapRange.addMonoidHom f).comp (Finsupp.mapRange.addMonoidHom f₂)

full_name: Finsupp.mapRange.addMonoidHom_toZeroHom
code: @[simp]
theorem mapRange.addMonoidHom_toZeroHom (f : M →+ N) :
    (mapRange.addMonoidHom f).toZeroHom = (mapRange.zeroHom f.toZeroHom : ZeroHom (α →₀ _) _) 
goal: ↑(Finsupp.mapRange.addMonoidHom f) = Finsupp.mapRange.zeroHom ↑f

full_name: Finsupp.mapRange_multiset_sum
code: theorem mapRange_multiset_sum (f : F) (m : Multiset (α →₀ M)) :
    mapRange f (map_zero f) m.sum = (m.map fun x => mapRange f (map_zero f) x).sum 
goal: Finsupp.mapRange ⇑f ⋯ m.sum = (Multiset.map (fun x => Finsupp.mapRange ⇑f ⋯ x) m).sum

full_name: Finsupp.mapRange_finset_sum
code: theorem mapRange_finset_sum (f : F) (s : Finset ι) (g : ι → α →₀ M) :
    mapRange f (map_zero f) (∑ x ∈ s, g x) = ∑ x ∈ s, mapRange f (map_zero f) (g x) 
goal: Finsupp.mapRange ⇑f ⋯ (∑ x ∈ s, g x) = ∑ x ∈ s, Finsupp.mapRange ⇑f ⋯ (g x)

full_name: Finsupp.mapRange.addEquiv_apply
code: /-- `Finsupp.mapRange.AddMonoidHom` as an equiv. -/
@[simps apply]
def mapRange.addEquiv (f : M ≃+ N) : (α →₀ M) ≃+ (α →₀ N) 
goal: (Finsupp.mapRange.addEquiv f) g = Finsupp.mapRange ⇑f ⋯ g

full_name: Finsupp.mapRange.addEquiv
code: /-- `Finsupp.mapRange.AddMonoidHom` as an equiv. -/
@[simps apply]
def mapRange.addEquiv (f : M ≃+ N) : (α →₀ M) ≃+ (α →₀ N) 
goal: (α →₀ M) ≃+ (α →₀ N)

full_name: Finsupp.mapRange.addEquiv_refl
code: @[simp]
theorem mapRange.addEquiv_refl : mapRange.addEquiv (AddEquiv.refl M) = AddEquiv.refl (α →₀ M) 
goal: Finsupp.mapRange.addEquiv (AddEquiv.refl M) = AddEquiv.refl (α →₀ M)

full_name: Finsupp.mapRange.addEquiv_trans
code: theorem mapRange.addEquiv_trans (f : M ≃+ N) (f₂ : N ≃+ P) :
    (mapRange.addEquiv (f.trans f₂) : (α →₀ M) ≃+ (α →₀ P)) =
      (mapRange.addEquiv f).trans (mapRange.addEquiv f₂) 
goal: Finsupp.mapRange.addEquiv (f.trans f₂) = (Finsupp.mapRange.addEquiv f).trans (Finsupp.mapRange.addEquiv f₂)

full_name: Finsupp.mapRange.addEquiv_symm
code: @[simp]
theorem mapRange.addEquiv_symm (f : M ≃+ N) :
    ((mapRange.addEquiv f).symm : (α →₀ _) ≃+ _) = mapRange.addEquiv f.symm 
goal: (Finsupp.mapRange.addEquiv f).symm = Finsupp.mapRange.addEquiv f.symm

full_name: Finsupp.mapRange.addEquiv_toAddMonoidHom
code: @[simp]
theorem mapRange.addEquiv_toAddMonoidHom (f : M ≃+ N) :
    ((mapRange.addEquiv f : (α →₀ _) ≃+ _) : _ →+ _) =
      (mapRange.addMonoidHom f.toAddMonoidHom : (α →₀ _) →+ _) 
goal: ↑(Finsupp.mapRange.addEquiv f) = Finsupp.mapRange.addMonoidHom f.toAddMonoidHom

full_name: Finsupp.mapRange.addEquiv_toEquiv
code: @[simp]
theorem mapRange.addEquiv_toEquiv (f : M ≃+ N) :
    ↑(mapRange.addEquiv f : (α →₀ _) ≃+ _) =
      (mapRange.equiv (f : M ≃ N) f.map_zero f.symm.map_zero : (α →₀ _) ≃ _) 
goal: ↑(Finsupp.mapRange.addEquiv f) = Finsupp.mapRange.equiv ↑f ⋯ ⋯

full_name: Finsupp.equivMapDomain
code: /-- Given `f : α ≃ β`, we can map `l : α →₀ M` to `equivMapDomain f l : β →₀ M` (computably)
by mapping the support forwards and the function backwards. -/
def equivMapDomain (f : α ≃ β) (l : α →₀ M) : β →₀ M 
goal: β →₀ M

full_name: Finsupp.equivMapDomain_apply
code: @[simp]
theorem equivMapDomain_apply (f : α ≃ β) (l : α →₀ M) (b : β) :
    equivMapDomain f l b = l (f.symm b) 
goal: (Finsupp.equivMapDomain f l) b = l (f.symm b)

full_name: Finsupp.equivMapDomain_symm_apply
code: theorem equivMapDomain_symm_apply (f : α ≃ β) (l : β →₀ M) (a : α) :
    equivMapDomain f.symm l a = l (f a) 
goal: (Finsupp.equivMapDomain f.symm l) a = l (f a)

full_name: Finsupp.equivMapDomain_refl
code: @[simp]
theorem equivMapDomain_refl (l : α →₀ M) : equivMapDomain (Equiv.refl _) l = l 
goal: Finsupp.equivMapDomain (Equiv.refl α) l = l

full_name: Finsupp.equivMapDomain_refl'
code: theorem equivMapDomain_refl' : equivMapDomain (Equiv.refl _) = @id (α →₀ M) 
goal: Finsupp.equivMapDomain (Equiv.refl α) = id

full_name: Finsupp.equivMapDomain_trans
code: theorem equivMapDomain_trans (f : α ≃ β) (g : β ≃ γ) (l : α →₀ M) :
    equivMapDomain (f.trans g) l = equivMapDomain g (equivMapDomain f l) 
goal: Finsupp.equivMapDomain (f.trans g) l = Finsupp.equivMapDomain g (Finsupp.equivMapDomain f l)

full_name: Finsupp.equivMapDomain_trans'
code: theorem equivMapDomain_trans' (f : α ≃ β) (g : β ≃ γ) :
    @equivMapDomain _ _ M _ (f.trans g) = equivMapDomain g ∘ equivMapDomain f 
goal: Finsupp.equivMapDomain (f.trans g) = Finsupp.equivMapDomain g ∘ Finsupp.equivMapDomain f

full_name: Finsupp.equivMapDomain_single
code: @[simp]
theorem equivMapDomain_single (f : α ≃ β) (a : α) (b : M) :
    equivMapDomain f (single a b) = single (f a) b 
goal: Finsupp.equivMapDomain f (Finsupp.single a b) = Finsupp.single (f a) b

full_name: Finsupp.equivMapDomain_zero
code: @[simp]
theorem equivMapDomain_zero {f : α ≃ β} : equivMapDomain f (0 : α →₀ M) = (0 : β →₀ M) 
goal: Finsupp.equivMapDomain f 0 = 0

full_name: Finsupp.sum_equivMapDomain
code: @[to_additive (attr := simp)]
theorem prod_equivMapDomain [CommMonoid N] (f : α ≃ β) (l : α →₀ M) (g : β → M → N) :
    prod (equivMapDomain f l) g = prod l (fun a m => g (f a) m) 
goal: (Finsupp.equivMapDomain f l).sum g = l.sum fun a m => g (f a) m

full_name: Finsupp.prod_equivMapDomain
code: @[to_additive (attr := simp)]
theorem prod_equivMapDomain [CommMonoid N] (f : α ≃ β) (l : α →₀ M) (g : β → M → N) :
    prod (equivMapDomain f l) g = prod l (fun a m => g (f a) m) 
goal: (Finsupp.equivMapDomain f l).prod g = l.prod fun a m => g (f a) m

full_name: Finsupp.equivCongrLeft
code: /-- Given `f : α ≃ β`, the finitely supported function spaces are also in bijection:
`(α →₀ M) ≃ (β →₀ M)`.

This is the finitely-supported version of `Equiv.piCongrLeft`. -/
def equivCongrLeft (f : α ≃ β) : (α →₀ M) ≃ (β →₀ M) 
goal: (α →₀ M) ≃ (β →₀ M)

full_name: Finsupp.equivCongrLeft_apply
code: @[simp]
theorem equivCongrLeft_apply (f : α ≃ β) (l : α →₀ M) : equivCongrLeft f l = equivMapDomain f l 
goal: (Finsupp.equivCongrLeft f) l = Finsupp.equivMapDomain f l

full_name: Finsupp.equivCongrLeft_symm
code: @[simp]
theorem equivCongrLeft_symm (f : α ≃ β) :
    (@equivCongrLeft _ _ M _ f).symm = equivCongrLeft f.symm 
goal: (Finsupp.equivCongrLeft f).symm = Finsupp.equivCongrLeft f.symm

full_name: Nat.cast_finsupp_prod
code: @[simp, norm_cast]
theorem cast_finsupp_prod [CommSemiring R] (g : α → M → ℕ) :
    (↑(f.prod g) : R) = f.prod fun a b => ↑(g a b) 
goal: ↑(f.prod g) = f.prod fun a b => ↑(g a b)

full_name: Nat.cast_finsupp_sum
code: @[simp, norm_cast]
theorem cast_finsupp_sum [CommSemiring R] (g : α → M → ℕ) :
    (↑(f.sum g) : R) = f.sum fun a b => ↑(g a b) 
goal: ↑(f.sum g) = f.sum fun a b => ↑(g a b)

full_name: Int.cast_finsupp_prod
code: @[simp, norm_cast]
theorem cast_finsupp_prod [CommRing R] (g : α → M → ℤ) :
    (↑(f.prod g) : R) = f.prod fun a b => ↑(g a b) 
goal: ↑(f.prod g) = f.prod fun a b => ↑(g a b)

full_name: Int.cast_finsupp_sum
code: @[simp, norm_cast]
theorem cast_finsupp_sum [CommRing R] (g : α → M → ℤ) :
    (↑(f.sum g) : R) = f.sum fun a b => ↑(g a b) 
goal: ↑(f.sum g) = f.sum fun a b => ↑(g a b)

full_name: Rat.cast_finsupp_sum
code: @[simp, norm_cast]
theorem cast_finsupp_sum [DivisionRing R] [CharZero R] (g : α → M → ℚ) :
    (↑(f.sum g) : R) = f.sum fun a b => ↑(g a b) 
goal: ↑(f.sum g) = f.sum fun a b => ↑(g a b)

full_name: Rat.cast_finsupp_prod
code: @[simp, norm_cast]
theorem cast_finsupp_prod [Field R] [CharZero R] (g : α → M → ℚ) :
    (↑(f.prod g) : R) = f.prod fun a b => ↑(g a b) 
goal: ↑(f.prod g) = f.prod fun a b => ↑(g a b)

full_name: Finsupp.mapDomain
code: /-- Given `f : α → β` and `v : α →₀ M`, `mapDomain f v : β →₀ M`
  is the finitely supported function whose value at `a : β` is the sum
  of `v x` over all `x` such that `f x = a`. -/
def mapDomain (f : α → β) (v : α →₀ M) : β →₀ M 
goal: β →₀ M

full_name: Finsupp.mapDomain_apply
code: theorem mapDomain_apply {f : α → β} (hf : Function.Injective f) (x : α →₀ M) (a : α) :
    mapDomain f x (f a) = x a 
goal: (Finsupp.mapDomain f x) (f a) = x a

full_name: Finsupp.mapDomain_notin_range
code: theorem mapDomain_notin_range {f : α → β} (x : α →₀ M) (a : β) (h : a ∉ Set.range f) :
    mapDomain f x a = 0 
goal: (Finsupp.mapDomain f x) a = 0

full_name: Finsupp.mapDomain_id
code: @[simp]
theorem mapDomain_id : mapDomain id v = v 
goal: Finsupp.mapDomain id v = v

full_name: Finsupp.mapDomain_comp
code: theorem mapDomain_comp {f : α → β} {g : β → γ} :
    mapDomain (g ∘ f) v = mapDomain g (mapDomain f v) 
goal: Finsupp.mapDomain (g ∘ f) v = Finsupp.mapDomain g (Finsupp.mapDomain f v)

full_name: Finsupp.mapDomain_single
code: @[simp]
theorem mapDomain_single {f : α → β} {a : α} {b : M} : mapDomain f (single a b) = single (f a) b 
goal: Finsupp.mapDomain f (Finsupp.single a b) = Finsupp.single (f a) b

full_name: Finsupp.mapDomain_zero
code: @[simp]
theorem mapDomain_zero {f : α → β} : mapDomain f (0 : α →₀ M) = (0 : β →₀ M) 
goal: Finsupp.mapDomain f 0 = 0

full_name: Finsupp.mapDomain_congr
code: theorem mapDomain_congr {f g : α → β} (h : ∀ x ∈ v.support, f x = g x) :
    v.mapDomain f = v.mapDomain g 
goal: Finsupp.mapDomain f v = Finsupp.mapDomain g v

full_name: Finsupp.mapDomain_add
code: theorem mapDomain_add {f : α → β} : mapDomain f (v₁ + v₂) = mapDomain f v₁ + mapDomain f v₂ 
goal: Finsupp.mapDomain f (v₁ + v₂) = Finsupp.mapDomain f v₁ + Finsupp.mapDomain f v₂

full_name: Finsupp.mapDomain_equiv_apply
code: @[simp]
theorem mapDomain_equiv_apply {f : α ≃ β} (x : α →₀ M) (a : β) :
    mapDomain f x a = x (f.symm a) 
goal: (Finsupp.mapDomain (⇑f) x) a = x (f.symm a)

full_name: Finsupp.mapDomain.addMonoidHom
code: /-- `Finsupp.mapDomain` is an `AddMonoidHom`. -/
@[simps]
def mapDomain.addMonoidHom (f : α → β) : (α →₀ M) →+ β →₀ M 
goal: (α →₀ M) →+ β →₀ M

full_name: Finsupp.mapDomain.addMonoidHom_apply
code: /-- `Finsupp.mapDomain` is an `AddMonoidHom`. -/
@[simps]
def mapDomain.addMonoidHom (f : α → β) : (α →₀ M) →+ β →₀ M 
goal: (Finsupp.mapDomain.addMonoidHom f) v = Finsupp.mapDomain f v

full_name: Finsupp.mapDomain.addMonoidHom_id
code: @[simp]
theorem mapDomain.addMonoidHom_id : mapDomain.addMonoidHom id = AddMonoidHom.id (α →₀ M) 
goal: Finsupp.mapDomain.addMonoidHom id = AddMonoidHom.id (α →₀ M)

full_name: Finsupp.mapDomain.addMonoidHom_comp
code: theorem mapDomain.addMonoidHom_comp (f : β → γ) (g : α → β) :
    (mapDomain.addMonoidHom (f ∘ g) : (α →₀ M) →+ γ →₀ M) =
      (mapDomain.addMonoidHom f).comp (mapDomain.addMonoidHom g) 
goal: Finsupp.mapDomain.addMonoidHom (f ∘ g) = (Finsupp.mapDomain.addMonoidHom f).comp (Finsupp.mapDomain.addMonoidHom g)

full_name: Finsupp.mapDomain_finset_sum
code: theorem mapDomain_finset_sum {f : α → β} {s : Finset ι} {v : ι → α →₀ M} :
    mapDomain f (∑ i ∈ s, v i) = ∑ i ∈ s, mapDomain f (v i) 
goal: Finsupp.mapDomain f (∑ i ∈ s, v i) = ∑ i ∈ s, Finsupp.mapDomain f (v i)

full_name: Finsupp.mapDomain_sum
code: theorem mapDomain_sum [Zero N] {f : α → β} {s : α →₀ N} {v : α → N → α →₀ M} :
    mapDomain f (s.sum v) = s.sum fun a b => mapDomain f (v a b) 
goal: Finsupp.mapDomain f (s.sum v) = s.sum fun a b => Finsupp.mapDomain f (v a b)

full_name: Finsupp.mapDomain_support
code: theorem mapDomain_support [DecidableEq β] {f : α → β} {s : α →₀ M} :
    (s.mapDomain f).support ⊆ s.support.image f 
goal: (Finsupp.mapDomain f s).support ⊆ Finset.image f s.support

full_name: Finsupp.mapDomain_apply'
code: theorem mapDomain_apply' (S : Set α) {f : α → β} (x : α →₀ M) (hS : (x.support : Set α) ⊆ S)
    (hf : Set.InjOn f S) {a : α} (ha : a ∈ S) : mapDomain f x (f a) = x a 
goal: (Finsupp.mapDomain f x) (f a) = x a

full_name: Finsupp.mapDomain_support_of_injOn
code: theorem mapDomain_support_of_injOn [DecidableEq β] {f : α → β} (s : α →₀ M)
    (hf : Set.InjOn f s.support) : (mapDomain f s).support = Finset.image f s.support 
goal: (Finsupp.mapDomain f s).support = Finset.image f s.support

full_name: Finsupp.mapDomain_support_of_injective
code: theorem mapDomain_support_of_injective [DecidableEq β] {f : α → β} (hf : Function.Injective f)
    (s : α →₀ M) : (mapDomain f s).support = Finset.image f s.support 
goal: (Finsupp.mapDomain f s).support = Finset.image f s.support

full_name: Finsupp.sum_mapDomain_index
code: @[to_additive]
theorem prod_mapDomain_index [CommMonoid N] {f : α → β} {s : α →₀ M} {h : β → M → N}
    (h_zero : ∀ b, h b 0 = 1) (h_add : ∀ b m₁ m₂, h b (m₁ + m₂) = h b m₁ * h b m₂) :
    (mapDomain f s).prod h = s.prod fun a m => h (f a) m 
goal: (Finsupp.mapDomain f s).sum h = s.sum fun a m => h (f a) m

full_name: Finsupp.prod_mapDomain_index
code: @[to_additive]
theorem prod_mapDomain_index [CommMonoid N] {f : α → β} {s : α →₀ M} {h : β → M → N}
    (h_zero : ∀ b, h b 0 = 1) (h_add : ∀ b m₁ m₂, h b (m₁ + m₂) = h b m₁ * h b m₂) :
    (mapDomain f s).prod h = s.prod fun a m => h (f a) m 
goal: (Finsupp.mapDomain f s).prod h = s.prod fun a m => h (f a) m

full_name: Finsupp.sum_mapDomain_index_addMonoidHom
code: /-- A version of `sum_mapDomain_index` that takes a bundled `AddMonoidHom`,
rather than separate linearity hypotheses.
-/
@[simp]
theorem sum_mapDomain_index_addMonoidHom [AddCommMonoid N] {f : α → β} {s : α →₀ M}
    (h : β → M →+ N) : ((mapDomain f s).sum fun b m => h b m) = s.sum fun a m => h (f a) m 
goal: ((Finsupp.mapDomain f s).sum fun b m => (h b) m) = s.sum fun a m => (h (f a)) m

full_name: Finsupp.embDomain_eq_mapDomain
code: theorem embDomain_eq_mapDomain (f : α ↪ β) (v : α →₀ M) : embDomain f v = mapDomain f v 
goal: Finsupp.embDomain f v = Finsupp.mapDomain (⇑f) v

full_name: Finsupp.prod_mapDomain_index_inj
code: @[to_additive]
theorem prod_mapDomain_index_inj [CommMonoid N] {f : α → β} {s : α →₀ M} {h : β → M → N}
    (hf : Function.Injective f) : (s.mapDomain f).prod h = s.prod fun a b => h (f a) b 
goal: (Finsupp.mapDomain f s).prod h = s.prod fun a b => h (f a) b

full_name: Finsupp.sum_mapDomain_index_inj
code: @[to_additive]
theorem prod_mapDomain_index_inj [CommMonoid N] {f : α → β} {s : α →₀ M} {h : β → M → N}
    (hf : Function.Injective f) : (s.mapDomain f).prod h = s.prod fun a b => h (f a) b 
goal: (Finsupp.mapDomain f s).sum h = s.sum fun a b => h (f a) b

full_name: Finsupp.mapDomain_injective
code: theorem mapDomain_injective {f : α → β} (hf : Function.Injective f) :
    Function.Injective (mapDomain f : (α →₀ M) → β →₀ M) 
goal: Function.Injective (Finsupp.mapDomain f)

full_name: Finsupp.mapDomainEmbedding
code: /-- When `f` is an embedding we have an embedding `(α →₀ ℕ) ↪ (β →₀ ℕ)` given by `mapDomain`. -/
@[simps]
def mapDomainEmbedding {α β : Type*} (f : α ↪ β) : (α →₀ ℕ) ↪ β →₀ ℕ 
goal: (α →₀ ℕ) ↪ β →₀ ℕ

full_name: Finsupp.mapDomainEmbedding_apply
code: /-- When `f` is an embedding we have an embedding `(α →₀ ℕ) ↪ (β →₀ ℕ)` given by `mapDomain`. -/
@[simps]
def mapDomainEmbedding {α β : Type*} (f : α ↪ β) : (α →₀ ℕ) ↪ β →₀ ℕ 
goal: (Finsupp.mapDomainEmbedding f) v = Finsupp.mapDomain (⇑f) v

full_name: Finsupp.mapDomain.addMonoidHom_comp_mapRange
code: theorem mapDomain.addMonoidHom_comp_mapRange [AddCommMonoid N] (f : α → β) (g : M →+ N) :
    (mapDomain.addMonoidHom f).comp (mapRange.addMonoidHom g) =
      (mapRange.addMonoidHom g).comp (mapDomain.addMonoidHom f) 
goal: (Finsupp.mapDomain.addMonoidHom f).comp (Finsupp.mapRange.addMonoidHom g) =
  (Finsupp.mapRange.addMonoidHom g).comp (Finsupp.mapDomain.addMonoidHom f)

full_name: Finsupp.mapDomain_mapRange
code: /-- When `g` preserves addition, `mapRange` and `mapDomain` commute. -/
theorem mapDomain_mapRange [AddCommMonoid N] (f : α → β) (v : α →₀ M) (g : M → N) (h0 : g 0 = 0)
    (hadd : ∀ x y, g (x + y) = g x + g y) :
    mapDomain f (mapRange g h0 v) = mapRange g h0 (mapDomain f v) 
goal: Finsupp.mapDomain f (Finsupp.mapRange g h0 v) = Finsupp.mapRange g h0 (Finsupp.mapDomain f v)

full_name: Finsupp.sum_update_add
code: theorem sum_update_add [AddCommMonoid α] [AddCommMonoid β] (f : ι →₀ α) (i : ι) (a : α)
    (g : ι → α → β) (hg : ∀ i, g i 0 = 0)
    (hgg : ∀ (j : ι) (a₁ a₂ : α), g j (a₁ + a₂) = g j a₁ + g j a₂) :
    (f.update i a).sum g + g i (f i) = f.sum g + g i a 
goal: (f.update i a).sum g + g i (f i) = f.sum g + g i a

full_name: Finsupp.mapDomain_injOn
code: theorem mapDomain_injOn (S : Set α) {f : α → β} (hf : Set.InjOn f S) :
    Set.InjOn (mapDomain f : (α →₀ M) → β →₀ M) { w | (w.support : Set α) ⊆ S } 
goal: Set.InjOn (Finsupp.mapDomain f) {w | ↑w.support ⊆ S}

full_name: Finsupp.equivMapDomain_eq_mapDomain
code: theorem equivMapDomain_eq_mapDomain {M} [AddCommMonoid M] (f : α ≃ β) (l : α →₀ M) :
    equivMapDomain f l = mapDomain f l 
goal: Finsupp.equivMapDomain f l = Finsupp.mapDomain (⇑f) l

full_name: Finsupp.comapDomain_support
code: /-- Given `f : α → β`, `l : β →₀ M` and a proof `hf` that `f` is injective on
the preimage of `l.support`, `comapDomain f l hf` is the finitely supported function
from `α` to `M` given by composing `l` with `f`. -/
@[simps support]
def comapDomain [Zero M] (f : α → β) (l : β →₀ M) (hf : Set.InjOn f (f ⁻¹' ↑l.support)) :
    α →₀ M 
goal: (Finsupp.comapDomain f l hf).support = l.support.preimage f hf

full_name: Finsupp.comapDomain
code: /-- Given `f : α → β`, `l : β →₀ M` and a proof `hf` that `f` is injective on
the preimage of `l.support`, `comapDomain f l hf` is the finitely supported function
from `α` to `M` given by composing `l` with `f`. -/
@[simps support]
def comapDomain [Zero M] (f : α → β) (l : β →₀ M) (hf : Set.InjOn f (f ⁻¹' ↑l.support)) :
    α →₀ M 
goal: α →₀ M

full_name: Finsupp.comapDomain_apply
code: @[simp]
theorem comapDomain_apply [Zero M] (f : α → β) (l : β →₀ M) (hf : Set.InjOn f (f ⁻¹' ↑l.support))
    (a : α) : comapDomain f l hf a = l (f a) 
goal: (Finsupp.comapDomain f l hf) a = l (f a)

full_name: Finsupp.sum_comapDomain
code: theorem sum_comapDomain [Zero M] [AddCommMonoid N] (f : α → β) (l : β →₀ M) (g : β → M → N)
    (hf : Set.BijOn f (f ⁻¹' ↑l.support) ↑l.support) :
    (comapDomain f l hf.injOn).sum (g ∘ f) = l.sum g 
goal: (Finsupp.comapDomain f l ⋯).sum (g ∘ f) = l.sum g

full_name: Finsupp.eq_zero_of_comapDomain_eq_zero
code: theorem eq_zero_of_comapDomain_eq_zero [AddCommMonoid M] (f : α → β) (l : β →₀ M)
    (hf : Set.BijOn f (f ⁻¹' ↑l.support) ↑l.support) : comapDomain f l hf.injOn = 0 → l = 0 
goal: Finsupp.comapDomain f l ⋯ = 0 → l = 0

full_name: Finsupp.embDomain_comapDomain
code: lemma embDomain_comapDomain {f : α ↪ β} {g : β →₀ M} (hg : ↑g.support ⊆ Set.range f) :
    embDomain f (comapDomain f g f.injective.injOn) = g 
goal: Finsupp.embDomain f (Finsupp.comapDomain (⇑f) g ⋯) = g

full_name: Finsupp.comapDomain_zero
code: /-- Note the `hif` argument is needed for this to work in `rw`. -/
@[simp]
theorem comapDomain_zero (f : α → β)
    (hif : Set.InjOn f (f ⁻¹' ↑(0 : β →₀ M).support) := Finset.coe_empty ▸ (Set.injOn_empty f)) :
    comapDomain f (0 : β →₀ M) hif = (0 : α →₀ M) 
goal: Finsupp.comapDomain f 0 hif = 0

full_name: Finsupp.comapDomain_single
code: @[simp]
theorem comapDomain_single (f : α → β) (a : α) (m : M)
    (hif : Set.InjOn f (f ⁻¹' (single (f a) m).support)) :
    comapDomain f (Finsupp.single (f a) m) hif = Finsupp.single a m 
goal: Finsupp.comapDomain f (Finsupp.single (f a) m) hif = Finsupp.single a m

full_name: Finsupp.comapDomain_add
code: theorem comapDomain_add (v₁ v₂ : β →₀ M) (hv₁ : Set.InjOn f (f ⁻¹' ↑v₁.support))
    (hv₂ : Set.InjOn f (f ⁻¹' ↑v₂.support)) (hv₁₂ : Set.InjOn f (f ⁻¹' ↑(v₁ + v₂).support)) :
    comapDomain f (v₁ + v₂) hv₁₂ = comapDomain f v₁ hv₁ + comapDomain f v₂ hv₂ 
goal: Finsupp.comapDomain f (v₁ + v₂) hv₁₂ = Finsupp.comapDomain f v₁ hv₁ + Finsupp.comapDomain f v₂ hv₂

full_name: Finsupp.comapDomain_add_of_injective
code: /-- A version of `Finsupp.comapDomain_add` that's easier to use. -/
theorem comapDomain_add_of_injective (hf : Function.Injective f) (v₁ v₂ : β →₀ M) :
    comapDomain f (v₁ + v₂) hf.injOn =
      comapDomain f v₁ hf.injOn + comapDomain f v₂ hf.injOn 
goal: Finsupp.comapDomain f (v₁ + v₂) ⋯ = Finsupp.comapDomain f v₁ ⋯ + Finsupp.comapDomain f v₂ ⋯

full_name: Finsupp.comapDomain.addMonoidHom_apply
code: /-- `Finsupp.comapDomain` is an `AddMonoidHom`. -/
@[simps]
def comapDomain.addMonoidHom (hf : Function.Injective f) : (β →₀ M) →+ α →₀ M 
goal: (Finsupp.comapDomain.addMonoidHom hf) x = Finsupp.comapDomain f x ⋯

full_name: Finsupp.comapDomain.addMonoidHom
code: /-- `Finsupp.comapDomain` is an `AddMonoidHom`. -/
@[simps]
def comapDomain.addMonoidHom (hf : Function.Injective f) : (β →₀ M) →+ α →₀ M 
goal: (β →₀ M) →+ α →₀ M

full_name: Finsupp.mapDomain_comapDomain
code: theorem mapDomain_comapDomain (hf : Function.Injective f) (l : β →₀ M)
    (hl : ↑l.support ⊆ Set.range f) :
    mapDomain f (comapDomain f l hf.injOn) = l 
goal: Finsupp.mapDomain f (Finsupp.comapDomain f l ⋯) = l

full_name: Finsupp.some
code: /-- Restrict a finitely supported function on `Option α` to a finitely supported function on `α`. -/
def some [Zero M] (f : Option α →₀ M) : α →₀ M 
goal: α →₀ M

full_name: Finsupp.some_apply
code: @[simp]
theorem some_apply [Zero M] (f : Option α →₀ M) (a : α) : f.some a = f (Option.some a) 
goal: f.some a = f (some a)

full_name: Finsupp.some_zero
code: @[simp]
theorem some_zero [Zero M] : (0 : Option α →₀ M).some = 0 
goal: Finsupp.some 0 = 0

full_name: Finsupp.some_add
code: @[simp]
theorem some_add [AddCommMonoid M] (f g : Option α →₀ M) : (f + g).some = f.some + g.some 
goal: (f + g).some = f.some + g.some

full_name: Finsupp.some_single_none
code: @[simp]
theorem some_single_none [Zero M] (m : M) : (single none m : Option α →₀ M).some = 0 
goal: (Finsupp.single none m).some = 0

full_name: Finsupp.some_single_some
code: @[simp]
theorem some_single_some [Zero M] (a : α) (m : M) :
    (single (Option.some a) m : Option α →₀ M).some = single a m 
goal: (Finsupp.single (some a) m).some = Finsupp.single a m

full_name: Finsupp.sum_option_index
code: @[to_additive]
theorem prod_option_index [AddCommMonoid M] [CommMonoid N] (f : Option α →₀ M)
    (b : Option α → M → N) (h_zero : ∀ o, b o 0 = 1)
    (h_add : ∀ o m₁ m₂, b o (m₁ + m₂) = b o m₁ * b o m₂) :
    f.prod b = b none (f none) * f.some.prod fun a => b (Option.some a) 
goal: f.sum b = b none (f none) + f.some.sum fun a => b (some a)

full_name: Finsupp.prod_option_index
code: @[to_additive]
theorem prod_option_index [AddCommMonoid M] [CommMonoid N] (f : Option α →₀ M)
    (b : Option α → M → N) (h_zero : ∀ o, b o 0 = 1)
    (h_add : ∀ o m₁ m₂, b o (m₁ + m₂) = b o m₁ * b o m₂) :
    f.prod b = b none (f none) * f.some.prod fun a => b (Option.some a) 
goal: f.prod b = b none (f none) * f.some.prod fun a => b (some a)

full_name: Finsupp.sum_option_index_smul
code: theorem sum_option_index_smul [Semiring R] [AddCommMonoid M] [Module R M] (f : Option α →₀ R)
    (b : Option α → M) :
    (f.sum fun o r => r • b o) = f none • b none + f.some.sum fun a r => r • b (Option.some a) 
goal: (f.sum fun o r => r • b o) = f none • b none + f.some.sum fun a r => r • b (some a)

full_name: Finsupp.filter
code: /--
`Finsupp.filter p f` is the finitely supported function that is `f a` if `p a` is true and `0`
otherwise. -/
def filter (p : α → Prop) [DecidablePred p] (f : α →₀ M) : α →₀ M 
goal: α →₀ M

full_name: Finsupp.filter_apply
code: theorem filter_apply (a : α) : f.filter p a = if p a then f a else 0 
goal: (Finsupp.filter p f) a = if p a then f a else 0

full_name: Finsupp.filter_eq_indicator
code: theorem filter_eq_indicator : ⇑(f.filter p) = Set.indicator { x | p x } f 
goal: ⇑(Finsupp.filter p f) = {x | p x}.indicator ⇑f

full_name: Finsupp.filter_eq_zero_iff
code: theorem filter_eq_zero_iff : f.filter p = 0 ↔ ∀ x, p x → f x = 0 
goal: Finsupp.filter p f = 0 ↔ ∀ (x : α), p x → f x = 0

full_name: Finsupp.filter_eq_self_iff
code: theorem filter_eq_self_iff : f.filter p = f ↔ ∀ x, f x ≠ 0 → p x 
goal: Finsupp.filter p f = f ↔ ∀ (x : α), f x ≠ 0 → p x

full_name: Finsupp.filter_apply_pos
code: @[simp]
theorem filter_apply_pos {a : α} (h : p a) : f.filter p a = f a 
goal: (Finsupp.filter p f) a = f a

full_name: Finsupp.filter_apply_neg
code: @[simp]
theorem filter_apply_neg {a : α} (h : ¬p a) : f.filter p a = 0 
goal: (Finsupp.filter p f) a = 0

full_name: Finsupp.support_filter
code: @[simp]
theorem support_filter : (f.filter p).support = f.support.filter p 
goal: (Finsupp.filter p f).support = Finset.filter p f.support

full_name: Finsupp.filter_zero
code: theorem filter_zero : (0 : α →₀ M).filter p = 0 
goal: Finsupp.filter p 0 = 0

full_name: Finsupp.filter_single_of_pos
code: @[simp]
theorem filter_single_of_pos {a : α} {b : M} (h : p a) : (single a b).filter p = single a b 
goal: Finsupp.filter p (Finsupp.single a b) = Finsupp.single a b

full_name: Finsupp.filter_single_of_neg
code: @[simp]
theorem filter_single_of_neg {a : α} {b : M} (h : ¬p a) : (single a b).filter p = 0 
goal: Finsupp.filter p (Finsupp.single a b) = 0

full_name: Finsupp.prod_filter_index
code: @[to_additive]
theorem prod_filter_index [CommMonoid N] (g : α → M → N) :
    (f.filter p).prod g = ∏ x ∈ (f.filter p).support, g x (f x) 
goal: (Finsupp.filter p f).prod g = ∏ x ∈ (Finsupp.filter p f).support, g x (f x)

full_name: Finsupp.sum_filter_index
code: @[to_additive]
theorem prod_filter_index [CommMonoid N] (g : α → M → N) :
    (f.filter p).prod g = ∏ x ∈ (f.filter p).support, g x (f x) 
goal: (Finsupp.filter p f).sum g = ∑ x ∈ (Finsupp.filter p f).support, g x (f x)

full_name: Finsupp.sum_filter_add_sum_filter_not
code: @[to_additive (attr := simp)]
theorem prod_filter_mul_prod_filter_not [CommMonoid N] (g : α → M → N) :
    (f.filter p).prod g * (f.filter fun a => ¬p a).prod g = f.prod g 
goal: (Finsupp.filter p f).sum g + (Finsupp.filter (fun a => ¬p a) f).sum g = f.sum g

full_name: Finsupp.prod_filter_mul_prod_filter_not
code: @[to_additive (attr := simp)]
theorem prod_filter_mul_prod_filter_not [CommMonoid N] (g : α → M → N) :
    (f.filter p).prod g * (f.filter fun a => ¬p a).prod g = f.prod g 
goal: (Finsupp.filter p f).prod g * (Finsupp.filter (fun a => ¬p a) f).prod g = f.prod g

full_name: Finsupp.sum_sub_sum_filter
code: @[to_additive (attr := simp)]
theorem prod_div_prod_filter [CommGroup G] (g : α → M → G) :
    f.prod g / (f.filter p).prod g = (f.filter fun a => ¬p a).prod g 
goal: f.sum g - (Finsupp.filter p f).sum g = (Finsupp.filter (fun a => ¬p a) f).sum g

full_name: Finsupp.prod_div_prod_filter
code: @[to_additive (attr := simp)]
theorem prod_div_prod_filter [CommGroup G] (g : α → M → G) :
    f.prod g / (f.filter p).prod g = (f.filter fun a => ¬p a).prod g 
goal: f.prod g / (Finsupp.filter p f).prod g = (Finsupp.filter (fun a => ¬p a) f).prod g

full_name: Finsupp.filter_pos_add_filter_neg
code: theorem filter_pos_add_filter_neg [AddZeroClass M] (f : α →₀ M) (p : α → Prop) [DecidablePred p] :
    (f.filter p + f.filter fun a => ¬p a) = f 
goal: Finsupp.filter p f + Finsupp.filter (fun a => ¬p a) f = f

full_name: Finsupp.frange
code: /-- `frange f` is the image of `f` on the support of `f`. -/
def frange (f : α →₀ M) : Finset M 
goal: Finset M

full_name: Finsupp.mem_frange
code: theorem mem_frange {f : α →₀ M} {y : M} : y ∈ f.frange ↔ y ≠ 0 ∧ ∃ x, f x = y 
goal: y ∈ f.frange ↔ y ≠ 0 ∧ ∃ x, f x = y

full_name: Finsupp.zero_not_mem_frange
code: theorem zero_not_mem_frange {f : α →₀ M} : (0 : M) ∉ f.frange 
goal: 0 ∉ f.frange

full_name: Finsupp.frange_single
code: theorem frange_single {x : α} {y : M} : frange (single x y) ⊆ {y} 
goal: (Finsupp.single x y).frange ⊆ {y}

full_name: Finsupp.subtypeDomain
code: /--
`subtypeDomain p f` is the restriction of the finitely supported function `f` to subtype `p`. -/
def subtypeDomain (p : α → Prop) (f : α →₀ M) : Subtype p →₀ M 
goal: Subtype p →₀ M

full_name: Finsupp.support_subtypeDomain
code: @[simp]
theorem support_subtypeDomain [D : DecidablePred p] {f : α →₀ M} :
    (subtypeDomain p f).support = f.support.subtype p 
goal: (Finsupp.subtypeDomain p f).support = Finset.subtype p f.support

full_name: Finsupp.subtypeDomain_apply
code: @[simp]
theorem subtypeDomain_apply {a : Subtype p} {v : α →₀ M} : (subtypeDomain p v) a = v a.val 
goal: (Finsupp.subtypeDomain p v) a = v ↑a

full_name: Finsupp.subtypeDomain_zero
code: @[simp]
theorem subtypeDomain_zero : subtypeDomain p (0 : α →₀ M) = 0 
goal: Finsupp.subtypeDomain p 0 = 0

full_name: Finsupp.subtypeDomain_eq_zero_iff'
code: theorem subtypeDomain_eq_zero_iff' {f : α →₀ M} : f.subtypeDomain p = 0 ↔ ∀ x, p x → f x = 0 
goal: Finsupp.subtypeDomain p f = 0 ↔ ∀ (x : α), p x → f x = 0

full_name: Finsupp.subtypeDomain_eq_zero_iff
code: theorem subtypeDomain_eq_zero_iff {f : α →₀ M} (hf : ∀ x ∈ f.support, p x) :
    f.subtypeDomain p = 0 ↔ f = 0 
goal: Finsupp.subtypeDomain p f = 0 ↔ f = 0

full_name: Finsupp.sum_subtypeDomain_index
code: @[to_additive]
theorem prod_subtypeDomain_index [CommMonoid N] {v : α →₀ M} {h : α → M → N}
    (hp : ∀ x ∈ v.support, p x) : (v.subtypeDomain p).prod (fun a b ↦ h a b) = v.prod h 
goal: ((Finsupp.subtypeDomain p v).sum fun a b => h (↑a) b) = v.sum h

full_name: Finsupp.prod_subtypeDomain_index
code: @[to_additive]
theorem prod_subtypeDomain_index [CommMonoid N] {v : α →₀ M} {h : α → M → N}
    (hp : ∀ x ∈ v.support, p x) : (v.subtypeDomain p).prod (fun a b ↦ h a b) = v.prod h 
goal: ((Finsupp.subtypeDomain p v).prod fun a b => h (↑a) b) = v.prod h

full_name: Finsupp.subtypeDomain_add
code: @[simp]
theorem subtypeDomain_add {v v' : α →₀ M} :
    (v + v').subtypeDomain p = v.subtypeDomain p + v'.subtypeDomain p 
goal: Finsupp.subtypeDomain p (v + v') = Finsupp.subtypeDomain p v + Finsupp.subtypeDomain p v'

full_name: Finsupp.subtypeDomainAddMonoidHom
code: /-- `subtypeDomain` but as an `AddMonoidHom`. -/
def subtypeDomainAddMonoidHom : (α →₀ M) →+ Subtype p →₀ M 
goal: (α →₀ M) →+ Subtype p →₀ M

full_name: Finsupp.filterAddHom
code: /-- `Finsupp.filter` as an `AddMonoidHom`. -/
def filterAddHom (p : α → Prop) [DecidablePred p] : (α →₀ M) →+ α →₀ M 
goal: (α →₀ M) →+ α →₀ M

full_name: Finsupp.filter_add
code: @[simp]
theorem filter_add [DecidablePred p] {v v' : α →₀ M} :
    (v + v').filter p = v.filter p + v'.filter p 
goal: Finsupp.filter p (v + v') = Finsupp.filter p v + Finsupp.filter p v'

full_name: Finsupp.subtypeDomain_sum
code: theorem subtypeDomain_sum {s : Finset ι} {h : ι → α →₀ M} :
    (∑ c ∈ s, h c).subtypeDomain p = ∑ c ∈ s, (h c).subtypeDomain p 
goal: Finsupp.subtypeDomain p (∑ c ∈ s, h c) = ∑ c ∈ s, Finsupp.subtypeDomain p (h c)

full_name: Finsupp.subtypeDomain_finsupp_sum
code: theorem subtypeDomain_finsupp_sum [Zero N] {s : β →₀ N} {h : β → N → α →₀ M} :
    (s.sum h).subtypeDomain p = s.sum fun c d => (h c d).subtypeDomain p 
goal: Finsupp.subtypeDomain p (s.sum h) = s.sum fun c d => Finsupp.subtypeDomain p (h c d)

full_name: Finsupp.filter_sum
code: theorem filter_sum [DecidablePred p] (s : Finset ι) (f : ι → α →₀ M) :
    (∑ a ∈ s, f a).filter p = ∑ a ∈ s, filter p (f a) 
goal: Finsupp.filter p (∑ a ∈ s, f a) = ∑ a ∈ s, Finsupp.filter p (f a)

full_name: Finsupp.filter_eq_sum
code: theorem filter_eq_sum (p : α → Prop) [DecidablePred p] (f : α →₀ M) :
    f.filter p = ∑ i ∈ f.support.filter p, single i (f i) 
goal: Finsupp.filter p f = ∑ i ∈ Finset.filter p f.support, Finsupp.single i (f i)

full_name: Finsupp.subtypeDomain_neg
code: @[simp]
theorem subtypeDomain_neg : (-v).subtypeDomain p = -v.subtypeDomain p 
goal: Finsupp.subtypeDomain p (-v) = -Finsupp.subtypeDomain p v

full_name: Finsupp.subtypeDomain_sub
code: @[simp]
theorem subtypeDomain_sub : (v - v').subtypeDomain p = v.subtypeDomain p - v'.subtypeDomain p 
goal: Finsupp.subtypeDomain p (v - v') = Finsupp.subtypeDomain p v - Finsupp.subtypeDomain p v'

full_name: Finsupp.single_neg
code: @[simp]
theorem single_neg (a : α) (b : G) : single a (-b) = -single a b 
goal: Finsupp.single a (-b) = -Finsupp.single a b

full_name: Finsupp.single_sub
code: @[simp]
theorem single_sub (a : α) (b₁ b₂ : G) : single a (b₁ - b₂) = single a b₁ - single a b₂ 
goal: Finsupp.single a (b₁ - b₂) = Finsupp.single a b₁ - Finsupp.single a b₂

full_name: Finsupp.erase_neg
code: @[simp]
theorem erase_neg (a : α) (f : α →₀ G) : erase a (-f) = -erase a f 
goal: Finsupp.erase a (-f) = -Finsupp.erase a f

full_name: Finsupp.erase_sub
code: @[simp]
theorem erase_sub (a : α) (f₁ f₂ : α →₀ G) : erase a (f₁ - f₂) = erase a f₁ - erase a f₂ 
goal: Finsupp.erase a (f₁ - f₂) = Finsupp.erase a f₁ - Finsupp.erase a f₂

full_name: Finsupp.filter_neg
code: @[simp]
theorem filter_neg (p : α → Prop) [DecidablePred p] (f : α →₀ G) : filter p (-f) = -filter p f 
goal: Finsupp.filter p (-f) = -Finsupp.filter p f

full_name: Finsupp.filter_sub
code: @[simp]
theorem filter_sub (p : α → Prop) [DecidablePred p] (f₁ f₂ : α →₀ G) :
    filter p (f₁ - f₂) = filter p f₁ - filter p f₂ 
goal: Finsupp.filter p (f₁ - f₂) = Finsupp.filter p f₁ - Finsupp.filter p f₂

full_name: Finsupp.mem_support_multiset_sum
code: theorem mem_support_multiset_sum [AddCommMonoid M] {s : Multiset (α →₀ M)} (a : α) :
    a ∈ s.sum.support → ∃ f ∈ s, a ∈ (f : α →₀ M).support 
goal: a ∈ s.sum.support → ∃ f ∈ s, a ∈ f.support

full_name: Finsupp.mem_support_finset_sum
code: theorem mem_support_finset_sum [AddCommMonoid M] {s : Finset ι} {h : ι → α →₀ M} (a : α)
    (ha : a ∈ (∑ c ∈ s, h c).support) : ∃ c ∈ s, a ∈ (h c).support 
goal: ∃ c ∈ s, a ∈ (h c).support

full_name: Finsupp.curry
code: /-- Given a finitely supported function `f` from a product type `α × β` to `γ`,
`curry f` is the "curried" finitely supported function from `α` to the type of
finitely supported functions from `β` to `γ`. -/
protected def curry (f : α × β →₀ M) : α →₀ β →₀ M 
goal: α →₀ β →₀ M

full_name: Finsupp.curry_apply
code: @[simp]
theorem curry_apply (f : α × β →₀ M) (x : α) (y : β) : f.curry x y = f (x, y) 
goal: (f.curry x) y = f (x, y)

full_name: Finsupp.sum_curry_index
code: theorem sum_curry_index (f : α × β →₀ M) (g : α → β → M → N) (hg₀ : ∀ a b, g a b 0 = 0)
    (hg₁ : ∀ a b c₀ c₁, g a b (c₀ + c₁) = g a b c₀ + g a b c₁) :
    (f.curry.sum fun a f => f.sum (g a)) = f.sum fun p c => g p.1 p.2 c 
goal: (f.curry.sum fun a f => f.sum (g a)) = f.sum fun p c => g p.1 p.2 c

full_name: Finsupp.uncurry
code: /-- Given a finitely supported function `f` from `α` to the type of
finitely supported functions from `β` to `M`,
`uncurry f` is the "uncurried" finitely supported function from `α × β` to `M`. -/
protected def uncurry (f : α →₀ β →₀ M) : α × β →₀ M 
goal: α × β →₀ M

full_name: Finsupp.finsuppProdEquiv
code: /-- `finsuppProdEquiv` defines the `Equiv` between `((α × β) →₀ M)` and `(α →₀ (β →₀ M))` given by
currying and uncurrying. -/
def finsuppProdEquiv : (α × β →₀ M) ≃ (α →₀ β →₀ M) 
goal: (α × β →₀ M) ≃ (α →₀ β →₀ M)

full_name: Finsupp.filter_curry
code: theorem filter_curry (f : α × β →₀ M) (p : α → Prop) [DecidablePred p] :
    (f.filter fun a : α × β => p a.1).curry = f.curry.filter p 
goal: (Finsupp.filter (fun a => p a.1) f).curry = Finsupp.filter p f.curry

full_name: Finsupp.support_curry
code: theorem support_curry [DecidableEq α] (f : α × β →₀ M) :
    f.curry.support ⊆ f.support.image Prod.fst 
goal: f.curry.support ⊆ Finset.image Prod.fst f.support

full_name: Finsupp.sumElim
code: /-- `Finsupp.sumElim f g` maps `inl x` to `f x` and `inr y` to `g y`. -/
def sumElim {α β γ : Type*} [Zero γ] (f : α →₀ γ) (g : β →₀ γ) : α ⊕ β →₀ γ 
goal: α ⊕ β →₀ γ

full_name: Finsupp.coe_sumElim
code: @[simp, norm_cast]
theorem coe_sumElim {α β γ : Type*} [Zero γ] (f : α →₀ γ) (g : β →₀ γ) :
    ⇑(sumElim f g) = Sum.elim f g 
goal: ⇑(f.sumElim g) = Sum.elim ⇑f ⇑g

full_name: Finsupp.sumElim_apply
code: theorem sumElim_apply {α β γ : Type*} [Zero γ] (f : α →₀ γ) (g : β →₀ γ) (x : α ⊕ β) :
    sumElim f g x = Sum.elim f g x 
goal: (f.sumElim g) x = Sum.elim (⇑f) (⇑g) x

full_name: Finsupp.sumElim_inl
code: theorem sumElim_inl {α β γ : Type*} [Zero γ] (f : α →₀ γ) (g : β →₀ γ) (x : α) :
    sumElim f g (Sum.inl x) = f x 
goal: (f.sumElim g) (Sum.inl x) = f x

full_name: Finsupp.sumElim_inr
code: theorem sumElim_inr {α β γ : Type*} [Zero γ] (f : α →₀ γ) (g : β →₀ γ) (x : β) :
    sumElim f g (Sum.inr x) = g x 
goal: (f.sumElim g) (Sum.inr x) = g x

full_name: Finsupp.sumFinsuppEquivProdFinsupp
code: /-- The equivalence between `(α ⊕ β) →₀ γ` and `(α →₀ γ) × (β →₀ γ)`.

This is the `Finsupp` version of `Equiv.sum_arrow_equiv_prod_arrow`. -/
@[simps apply symm_apply]
def sumFinsuppEquivProdFinsupp {α β γ : Type*} [Zero γ] : (α ⊕ β →₀ γ) ≃ (α →₀ γ) × (β →₀ γ) 
goal: (α ⊕ β →₀ γ) ≃ (α →₀ γ) × (β →₀ γ)

full_name: Finsupp.sumFinsuppEquivProdFinsupp_symm_apply
code: /-- The equivalence between `(α ⊕ β) →₀ γ` and `(α →₀ γ) × (β →₀ γ)`.

This is the `Finsupp` version of `Equiv.sum_arrow_equiv_prod_arrow`. -/
@[simps apply symm_apply]
def sumFinsuppEquivProdFinsupp {α β γ : Type*} [Zero γ] : (α ⊕ β →₀ γ) ≃ (α →₀ γ) × (β →₀ γ) 
goal: Finsupp.sumFinsuppEquivProdFinsupp.symm fg = fg.1.sumElim fg.2

full_name: Finsupp.sumFinsuppEquivProdFinsupp_apply
code: /-- The equivalence between `(α ⊕ β) →₀ γ` and `(α →₀ γ) × (β →₀ γ)`.

This is the `Finsupp` version of `Equiv.sum_arrow_equiv_prod_arrow`. -/
@[simps apply symm_apply]
def sumFinsuppEquivProdFinsupp {α β γ : Type*} [Zero γ] : (α ⊕ β →₀ γ) ≃ (α →₀ γ) × (β →₀ γ) 
goal: Finsupp.sumFinsuppEquivProdFinsupp f = (Finsupp.comapDomain Sum.inl f ⋯, Finsupp.comapDomain Sum.inr f ⋯)

full_name: Finsupp.fst_sumFinsuppEquivProdFinsupp
code: theorem fst_sumFinsuppEquivProdFinsupp {α β γ : Type*} [Zero γ] (f : α ⊕ β →₀ γ) (x : α) :
    (sumFinsuppEquivProdFinsupp f).1 x = f (Sum.inl x) 
goal: (Finsupp.sumFinsuppEquivProdFinsupp f).1 x = f (Sum.inl x)

full_name: Finsupp.snd_sumFinsuppEquivProdFinsupp
code: theorem snd_sumFinsuppEquivProdFinsupp {α β γ : Type*} [Zero γ] (f : α ⊕ β →₀ γ) (y : β) :
    (sumFinsuppEquivProdFinsupp f).2 y = f (Sum.inr y) 
goal: (Finsupp.sumFinsuppEquivProdFinsupp f).2 y = f (Sum.inr y)

full_name: Finsupp.sumFinsuppEquivProdFinsupp_symm_inl
code: theorem sumFinsuppEquivProdFinsupp_symm_inl {α β γ : Type*} [Zero γ] (fg : (α →₀ γ) × (β →₀ γ))
    (x : α) : (sumFinsuppEquivProdFinsupp.symm fg) (Sum.inl x) = fg.1 x 
goal: (Finsupp.sumFinsuppEquivProdFinsupp.symm fg) (Sum.inl x) = fg.1 x

full_name: Finsupp.sumFinsuppEquivProdFinsupp_symm_inr
code: theorem sumFinsuppEquivProdFinsupp_symm_inr {α β γ : Type*} [Zero γ] (fg : (α →₀ γ) × (β →₀ γ))
    (y : β) : (sumFinsuppEquivProdFinsupp.symm fg) (Sum.inr y) = fg.2 y 
goal: (Finsupp.sumFinsuppEquivProdFinsupp.symm fg) (Sum.inr y) = fg.2 y

full_name: Finsupp.sumFinsuppAddEquivProdFinsupp_apply
code: /-- The additive equivalence between `(α ⊕ β) →₀ M` and `(α →₀ M) × (β →₀ M)`.

This is the `Finsupp` version of `Equiv.sum_arrow_equiv_prod_arrow`. -/
@[simps! apply symm_apply]
def sumFinsuppAddEquivProdFinsupp {α β : Type*} : (α ⊕ β →₀ M) ≃+ (α →₀ M) × (β →₀ M) 
goal: Finsupp.sumFinsuppAddEquivProdFinsupp f = (Finsupp.comapDomain Sum.inl f ⋯, Finsupp.comapDomain Sum.inr f ⋯)

full_name: Finsupp.sumFinsuppAddEquivProdFinsupp_symm_apply
code: /-- The additive equivalence between `(α ⊕ β) →₀ M` and `(α →₀ M) × (β →₀ M)`.

This is the `Finsupp` version of `Equiv.sum_arrow_equiv_prod_arrow`. -/
@[simps! apply symm_apply]
def sumFinsuppAddEquivProdFinsupp {α β : Type*} : (α ⊕ β →₀ M) ≃+ (α →₀ M) × (β →₀ M) 
goal: Finsupp.sumFinsuppAddEquivProdFinsupp.symm fg = fg.1.sumElim fg.2

full_name: Finsupp.sumFinsuppAddEquivProdFinsupp
code: /-- The additive equivalence between `(α ⊕ β) →₀ M` and `(α →₀ M) × (β →₀ M)`.

This is the `Finsupp` version of `Equiv.sum_arrow_equiv_prod_arrow`. -/
@[simps! apply symm_apply]
def sumFinsuppAddEquivProdFinsupp {α β : Type*} : (α ⊕ β →₀ M) ≃+ (α →₀ M) × (β →₀ M) 
goal: (α ⊕ β →₀ M) ≃+ (α →₀ M) × (β →₀ M)

full_name: Finsupp.fst_sumFinsuppAddEquivProdFinsupp
code: theorem fst_sumFinsuppAddEquivProdFinsupp {α β : Type*} (f : α ⊕ β →₀ M) (x : α) :
    (sumFinsuppAddEquivProdFinsupp f).1 x = f (Sum.inl x) 
goal: (Finsupp.sumFinsuppAddEquivProdFinsupp f).1 x = f (Sum.inl x)

full_name: Finsupp.snd_sumFinsuppAddEquivProdFinsupp
code: theorem snd_sumFinsuppAddEquivProdFinsupp {α β : Type*} (f : α ⊕ β →₀ M) (y : β) :
    (sumFinsuppAddEquivProdFinsupp f).2 y = f (Sum.inr y) 
goal: (Finsupp.sumFinsuppAddEquivProdFinsupp f).2 y = f (Sum.inr y)

full_name: Finsupp.sumFinsuppAddEquivProdFinsupp_symm_inl
code: theorem sumFinsuppAddEquivProdFinsupp_symm_inl {α β : Type*} (fg : (α →₀ M) × (β →₀ M)) (x : α) :
    (sumFinsuppAddEquivProdFinsupp.symm fg) (Sum.inl x) = fg.1 x 
goal: (Finsupp.sumFinsuppAddEquivProdFinsupp.symm fg) (Sum.inl x) = fg.1 x

full_name: Finsupp.sumFinsuppAddEquivProdFinsupp_symm_inr
code: theorem sumFinsuppAddEquivProdFinsupp_symm_inr {α β : Type*} (fg : (α →₀ M) × (β →₀ M)) (y : β) :
    (sumFinsuppAddEquivProdFinsupp.symm fg) (Sum.inr y) = fg.2 y 
goal: (Finsupp.sumFinsuppAddEquivProdFinsupp.symm fg) (Sum.inr y) = fg.2 y

full_name: Finsupp.single_smul
code: @[simp, nolint simpNF] -- `simpNF` incorrectly complains the LHS doesn't simplify.
theorem single_smul (a b : α) (f : α → M) (r : R) : single a r b • f a = single a (r • f b) b 
goal: (Finsupp.single a r) b • f a = (Finsupp.single a (r • f b)) b

full_name: Finsupp.comapSMul
code: /-- Scalar multiplication acting on the domain.

This is not an instance as it would conflict with the action on the range.
See the `instance_diamonds` test for examples of such conflicts. -/
def comapSMul : SMul G (α →₀ M) 
goal: SMul G (α →₀ M)

full_name: Finsupp.comapSMul_def
code: theorem comapSMul_def (g : G) (f : α →₀ M) : g • f = mapDomain (g • ·) f 
goal: g • f = Finsupp.mapDomain (fun x => g • x) f

full_name: Finsupp.comapSMul_single
code: @[simp]
theorem comapSMul_single (g : G) (a : α) (b : M) : g • single a b = single (g • a) b 
goal: g • Finsupp.single a b = Finsupp.single (g • a) b

full_name: Finsupp.comapMulAction
code: /-- `Finsupp.comapSMul` is multiplicative -/
def comapMulAction : MulAction G (α →₀ M) 
goal: MulAction G (α →₀ M)

full_name: Finsupp.comapDistribMulAction
code: /-- `Finsupp.comapSMul` is distributive -/
def comapDistribMulAction : DistribMulAction G (α →₀ M) 
goal: DistribMulAction G (α →₀ M)

full_name: Finsupp.comapSMul_apply
code: /-- When `G` is a group, `Finsupp.comapSMul` acts by precomposition with the action of `g⁻¹`.
-/
@[simp]
theorem comapSMul_apply (g : G) (f : α →₀ M) (a : α) : (g • f) a = f (g⁻¹ • a) 
goal: (g • f) a = f (g⁻¹ • a)

full_name: Finsupp.smulZeroClass
code: instance smulZeroClass [Zero M] [SMulZeroClass R M] : SMulZeroClass R (α →₀ M) 
goal: SMulZeroClass R (α →₀ M)

full_name: Finsupp.coe_smul
code: @[simp, norm_cast]
theorem coe_smul [Zero M] [SMulZeroClass R M] (b : R) (v : α →₀ M) : ⇑(b • v) = b • ⇑v 
goal: ⇑(b • v) = b • ⇑v

full_name: Finsupp.smul_apply
code: theorem smul_apply [Zero M] [SMulZeroClass R M] (b : R) (v : α →₀ M) (a : α) :
    (b • v) a = b • v a 
goal: (b • v) a = b • v a

full_name: IsSMulRegular.finsupp
code: theorem _root_.IsSMulRegular.finsupp [Zero M] [SMulZeroClass R M] {k : R}
    (hk : IsSMulRegular M k) : IsSMulRegular (α →₀ M) k 
goal: IsSMulRegular (α →₀ M) k

full_name: Finsupp.faithfulSMul
code: instance faithfulSMul [Nonempty α] [Zero M] [SMulZeroClass R M] [FaithfulSMul R M] :
    FaithfulSMul R (α →₀ M) 
goal: FaithfulSMul R (α →₀ M)

full_name: Finsupp.instSMulWithZero
code: instance instSMulWithZero [Zero R] [Zero M] [SMulWithZero R M] : SMulWithZero R (α →₀ M) 
goal: SMulWithZero R (α →₀ M)

full_name: Finsupp.distribSMul
code: instance distribSMul [AddZeroClass M] [DistribSMul R M] : DistribSMul R (α →₀ M) 
goal: DistribSMul R (α →₀ M)

full_name: Finsupp.distribMulAction
code: instance distribMulAction [Monoid R] [AddMonoid M] [DistribMulAction R M] :
    DistribMulAction R (α →₀ M) 
goal: DistribMulAction R (α →₀ M)

full_name: Finsupp.isScalarTower
code: instance isScalarTower [Zero M] [SMulZeroClass R M] [SMulZeroClass S M] [SMul R S]
  [IsScalarTower R S M] : IsScalarTower R S (α →₀ M) 
goal: IsScalarTower R S (α →₀ M)

full_name: Finsupp.smulCommClass
code: instance smulCommClass [Zero M] [SMulZeroClass R M] [SMulZeroClass S M] [SMulCommClass R S M] :
  SMulCommClass R S (α →₀ M) 
goal: SMulCommClass R S (α →₀ M)

full_name: Finsupp.isCentralScalar
code: instance isCentralScalar [Zero M] [SMulZeroClass R M] [SMulZeroClass Rᵐᵒᵖ M] [IsCentralScalar R M] :
  IsCentralScalar R (α →₀ M) 
goal: IsCentralScalar R (α →₀ M)

full_name: Finsupp.module
code: instance module [Semiring R] [AddCommMonoid M] [Module R M] : Module R (α →₀ M) 
goal: Module R (α →₀ M)

full_name: Finsupp.support_smul
code: theorem support_smul [AddMonoid M] [SMulZeroClass R M] {b : R} {g : α →₀ M} :
    (b • g).support ⊆ g.support 
goal: (b • g).support ⊆ g.support

full_name: Finsupp.support_smul_eq
code: @[simp]
theorem support_smul_eq [Semiring R] [AddCommMonoid M] [Module R M] [NoZeroSMulDivisors R M] {b : R}
    (hb : b ≠ 0) {g : α →₀ M} : (b • g).support = g.support 
goal: (b • g).support = g.support

full_name: Finsupp.filter_smul
code: @[simp]
theorem filter_smul {_ : Monoid R} [AddMonoid M] [DistribMulAction R M] {b : R} {v : α →₀ M} :
    (b • v).filter p = b • v.filter p 
goal: ∀ {x : Monoid R} [inst : AddMonoid M] [inst_1 : DistribMulAction R M] {b : R} {v : α →₀ M},
  Finsupp.filter p (b • v) = b • Finsupp.filter p v

full_name: Finsupp.mapDomain_smul
code: theorem mapDomain_smul {_ : Monoid R} [AddCommMonoid M] [DistribMulAction R M] {f : α → β} (b : R)
    (v : α →₀ M) : mapDomain f (b • v) = b • mapDomain f v 
goal: ∀ {x : Monoid R} [inst : AddCommMonoid M] [inst_1 : DistribMulAction R M] {f : α → β} (b : R) (v : α →₀ M),
  Finsupp.mapDomain f (b • v) = b • Finsupp.mapDomain f v

full_name: Finsupp.smul_single
code: @[simp]
theorem smul_single [Zero M] [SMulZeroClass R M] (c : R) (a : α) (b : M) :
    c • Finsupp.single a b = Finsupp.single a (c • b) 
goal: c • Finsupp.single a b = Finsupp.single a (c • b)

full_name: Finsupp.smul_single'
code: theorem smul_single' {_ : Semiring R} (c : R) (a : α) (b : R) :
    c • Finsupp.single a b = Finsupp.single a (c * b) 
goal: ∀ {x : Semiring R} (c : R) (a : α) (b : R), c • Finsupp.single a b = Finsupp.single a (c * b)

full_name: Finsupp.mapRange_smul
code: theorem mapRange_smul {_ : Monoid R} [AddMonoid M] [DistribMulAction R M] [AddMonoid N]
    [DistribMulAction R N] {f : M → N} {hf : f 0 = 0} (c : R) (v : α →₀ M)
    (hsmul : ∀ x, f (c • x) = c • f x) : mapRange f hf (c • v) = c • mapRange f hf v 
goal: ∀ {x : Monoid R} [inst : AddMonoid M] [inst_1 : DistribMulAction R M] [inst_2 : AddMonoid N]
  [inst_3 : DistribMulAction R N] {f : M → N} {hf : f 0 = 0} (c : R) (v : α →₀ M),
  (∀ (x_1 : M), f (c • x_1) = c • f x_1) → Finsupp.mapRange f hf (c • v) = c • Finsupp.mapRange f hf v

full_name: Finsupp.smul_single_one
code: theorem smul_single_one [Semiring R] (a : α) (b : R) : b • single a (1 : R) = single a b 
goal: b • Finsupp.single a 1 = Finsupp.single a b

full_name: Finsupp.comapDomain_smul
code: theorem comapDomain_smul [AddMonoid M] [Monoid R] [DistribMulAction R M] {f : α → β} (r : R)
    (v : β →₀ M) (hfv : Set.InjOn f (f ⁻¹' ↑v.support))
    (hfrv : Set.InjOn f (f ⁻¹' ↑(r • v).support) :=
      hfv.mono <| Set.preimage_mono <| Finset.coe_subset.mpr support_smul) :
    comapDomain f (r • v) hfrv = r • comapDomain f v hfv 
goal: Finsupp.comapDomain f (r • v) hfrv = r • Finsupp.comapDomain f v hfv

full_name: Finsupp.comapDomain_smul_of_injective
code: /-- A version of `Finsupp.comapDomain_smul` that's easier to use. -/
theorem comapDomain_smul_of_injective [AddMonoid M] [Monoid R] [DistribMulAction R M] {f : α → β}
    (hf : Function.Injective f) (r : R) (v : β →₀ M) :
    comapDomain f (r • v) hf.injOn = r • comapDomain f v hf.injOn 
goal: Finsupp.comapDomain f (r • v) ⋯ = r • Finsupp.comapDomain f v ⋯

full_name: Finsupp.sum_smul_index
code: theorem sum_smul_index [Semiring R] [AddCommMonoid M] {g : α →₀ R} {b : R} {h : α → R → M}
    (h0 : ∀ i, h i 0 = 0) : (b • g).sum h = g.sum fun i a => h i (b * a) 
goal: (b • g).sum h = g.sum fun i a => h i (b * a)

full_name: Finsupp.sum_smul_index'
code: theorem sum_smul_index' [AddMonoid M] [DistribSMul R M] [AddCommMonoid N] {g : α →₀ M} {b : R}
    {h : α → M → N} (h0 : ∀ i, h i 0 = 0) : (b • g).sum h = g.sum fun i c => h i (b • c) 
goal: (b • g).sum h = g.sum fun i c => h i (b • c)

full_name: Finsupp.sum_smul_index_addMonoidHom
code: /-- A version of `Finsupp.sum_smul_index'` for bundled additive maps. -/
theorem sum_smul_index_addMonoidHom [AddMonoid M] [AddCommMonoid N] [DistribSMul R M] {g : α →₀ M}
    {b : R} {h : α → M →+ N} : ((b • g).sum fun a => h a) = g.sum fun i c => h i (b • c) 
goal: ((b • g).sum fun a => ⇑(h a)) = g.sum fun i c => (h i) (b • c)

full_name: Finsupp.noZeroSMulDivisors
code: instance noZeroSMulDivisors [Semiring R] [AddCommMonoid M] [Module R M] {ι : Type*}
    [NoZeroSMulDivisors R M] : NoZeroSMulDivisors R (ι →₀ M) 
goal: NoZeroSMulDivisors R (ι →₀ M)

full_name: Finsupp.DistribMulActionHom.single
code: /-- `Finsupp.single` as a `DistribMulActionSemiHom`.

See also `Finsupp.lsingle` for the version as a linear map. -/
def DistribMulActionHom.single (a : α) : M →+[R] α →₀ M 
goal: M →+[R] α →₀ M

full_name: Finsupp.distribMulActionHom_ext
code: theorem distribMulActionHom_ext {f g : (α →₀ M) →+[R] N}
    (h : ∀ (a : α) (m : M), f (single a m) = g (single a m)) : f = g 
goal: f = g

full_name: Finsupp.distribMulActionHom_ext'
code: /-- See note [partially-applied ext lemmas]. -/
@[ext]
theorem distribMulActionHom_ext' {f g : (α →₀ M) →+[R] N}
    (h : ∀ a : α, f.comp (DistribMulActionHom.single a) = g.comp (DistribMulActionHom.single a)) :
    f = g 
goal: f = g

full_name: Finsupp.uniqueOfRight
code: /-- The `Finsupp` version of `Pi.unique`. -/
instance uniqueOfRight [Subsingleton R] : Unique (α →₀ R) 
goal: Unique (α →₀ R)

full_name: Finsupp.uniqueOfLeft
code: /-- The `Finsupp` version of `Pi.uniqueOfIsEmpty`. -/
instance uniqueOfLeft [IsEmpty α] : Unique (α →₀ R) 
goal: Unique (α →₀ R)

full_name: Finsupp.piecewise_support
code: /-- Combine finitely supported functions over `{a // P a}` and `{a // ¬P a}`, by case-splitting on
`P a`. -/
@[simps]
def piecewise (f : Subtype P →₀ M) (g : {a // ¬ P a} →₀ M) : α →₀ M 
goal: (f.piecewise g).support =
  (Finset.map (Function.Embedding.subtype P) f.support).disjUnion
    (Finset.map (Function.Embedding.subtype fun a => ¬P a) g.support) ⋯

full_name: Finsupp.piecewise
code: /-- Combine finitely supported functions over `{a // P a}` and `{a // ¬P a}`, by case-splitting on
`P a`. -/
@[simps]
def piecewise (f : Subtype P →₀ M) (g : {a // ¬ P a} →₀ M) : α →₀ M 
goal: α →₀ M

full_name: Finsupp.piecewise_toFun
code: /-- Combine finitely supported functions over `{a // P a}` and `{a // ¬P a}`, by case-splitting on
`P a`. -/
@[simps]
def piecewise (f : Subtype P →₀ M) (g : {a // ¬ P a} →₀ M) : α →₀ M 
goal: (f.piecewise g) a = if h : P a then f ⟨a, h⟩ else g ⟨a, h⟩

full_name: Finsupp.subtypeDomain_piecewise
code: @[simp]
theorem subtypeDomain_piecewise (f : Subtype P →₀ M) (g : {a // ¬ P a} →₀ M) :
    subtypeDomain P (f.piecewise g) = f 
goal: Finsupp.subtypeDomain P (f.piecewise g) = f

full_name: Finsupp.subtypeDomain_not_piecewise
code: @[simp]
theorem subtypeDomain_not_piecewise (f : Subtype P →₀ M) (g : {a // ¬ P a} →₀ M) :
    subtypeDomain (¬P ·) (f.piecewise g) = g 
goal: Finsupp.subtypeDomain (fun x => ¬P x) (f.piecewise g) = g

full_name: Finsupp.extendDomain
code: /-- Extend the domain of a `Finsupp` by using `0` where `P x` does not hold. -/
@[simps! support toFun]
def extendDomain (f : Subtype P →₀ M) : α →₀ M 
goal: α →₀ M

full_name: Finsupp.extendDomain_toFun
code: /-- Extend the domain of a `Finsupp` by using `0` where `P x` does not hold. -/
@[simps! support toFun]
def extendDomain (f : Subtype P →₀ M) : α →₀ M 
goal: f.extendDomain a = if h : P a then f ⟨a, h⟩ else 0

full_name: Finsupp.extendDomain_support
code: /-- Extend the domain of a `Finsupp` by using `0` where `P x` does not hold. -/
@[simps! support toFun]
def extendDomain (f : Subtype P →₀ M) : α →₀ M 
goal: f.extendDomain.support = Finset.map (Function.Embedding.subtype P) f.support

full_name: Finsupp.extendDomain_eq_embDomain_subtype
code: theorem extendDomain_eq_embDomain_subtype (f : Subtype P →₀ M) :
    extendDomain f = embDomain (.subtype _) f 
goal: f.extendDomain = Finsupp.embDomain (Function.Embedding.subtype P) f

full_name: Finsupp.support_extendDomain_subset
code: theorem support_extendDomain_subset (f : Subtype P →₀ M) :
    ↑(f.extendDomain).support ⊆ {x | P x} 
goal: ↑f.extendDomain.support ⊆ {x | P x}

full_name: Finsupp.subtypeDomain_extendDomain
code: @[simp]
theorem subtypeDomain_extendDomain (f : Subtype P →₀ M) :
    subtypeDomain P f.extendDomain = f 
goal: Finsupp.subtypeDomain P f.extendDomain = f

full_name: Finsupp.extendDomain_subtypeDomain
code: theorem extendDomain_subtypeDomain (f : α →₀ M) (hf : ∀ a ∈ f.support, P a) :
    (subtypeDomain P f).extendDomain = f 
goal: (Finsupp.subtypeDomain P f).extendDomain = f

full_name: Finsupp.extendDomain_single
code: @[simp]
theorem extendDomain_single (a : Subtype P) (m : M) :
    (single a m).extendDomain = single a.val m 
goal: (Finsupp.single a m).extendDomain = Finsupp.single (↑a) m

full_name: Finsupp.restrictSupportEquiv
code: /-- Given an `AddCommMonoid M` and `s : Set α`, `restrictSupportEquiv s M` is the `Equiv`
between the subtype of finitely supported functions with support contained in `s` and
the type of finitely supported functions from `s`. -/
def restrictSupportEquiv (s : Set α) (M : Type*) [AddCommMonoid M] :
    { f : α →₀ M // ↑f.support ⊆ s } ≃ (s →₀ M) 
goal: { f // ↑f.support ⊆ s } ≃ (↑s →₀ M)

full_name: Finsupp.domCongr_apply
code: /-- Given `AddCommMonoid M` and `e : α ≃ β`, `domCongr e` is the corresponding `Equiv` between
`α →₀ M` and `β →₀ M`.

This is `Finsupp.equivCongrLeft` as an `AddEquiv`. -/
@[simps apply]
protected def domCongr [AddCommMonoid M] (e : α ≃ β) : (α →₀ M) ≃+ (β →₀ M) 
goal: (Finsupp.domCongr e) l = Finsupp.equivMapDomain e l

full_name: Finsupp.domCongr
code: /-- Given `AddCommMonoid M` and `e : α ≃ β`, `domCongr e` is the corresponding `Equiv` between
`α →₀ M` and `β →₀ M`.

This is `Finsupp.equivCongrLeft` as an `AddEquiv`. -/
@[simps apply]
protected def domCongr [AddCommMonoid M] (e : α ≃ β) : (α →₀ M) ≃+ (β →₀ M) 
goal: (α →₀ M) ≃+ (β →₀ M)

full_name: Finsupp.domCongr_refl
code: @[simp]
theorem domCongr_refl [AddCommMonoid M] :
    Finsupp.domCongr (Equiv.refl α) = AddEquiv.refl (α →₀ M) 
goal: Finsupp.domCongr (Equiv.refl α) = AddEquiv.refl (α →₀ M)

full_name: Finsupp.domCongr_symm
code: @[simp]
theorem domCongr_symm [AddCommMonoid M] (e : α ≃ β) :
    (Finsupp.domCongr e).symm = (Finsupp.domCongr e.symm : (β →₀ M) ≃+ (α →₀ M)) 
goal: (Finsupp.domCongr e).symm = Finsupp.domCongr e.symm

full_name: Finsupp.domCongr_trans
code: @[simp]
theorem domCongr_trans [AddCommMonoid M] (e : α ≃ β) (f : β ≃ γ) :
    (Finsupp.domCongr e).trans (Finsupp.domCongr f) =
      (Finsupp.domCongr (e.trans f) : (α →₀ M) ≃+ _) 
goal: (Finsupp.domCongr e).trans (Finsupp.domCongr f) = Finsupp.domCongr (e.trans f)

full_name: Finsupp.split
code: /-- Given `l`, a finitely supported function from the sigma type `Σ (i : ι), αs i` to `M` and
an index element `i : ι`, `split l i` is the `i`th component of `l`,
a finitely supported function from `as i` to `M`.

This is the `Finsupp` version of `Sigma.curry`.
-/
def split (i : ι) : αs i →₀ M 
goal: αs i →₀ M

full_name: Finsupp.split_apply
code: theorem split_apply (i : ι) (x : αs i) : split l i x = l ⟨i, x⟩ 
goal: (l.split i) x = l ⟨i, x⟩

full_name: Finsupp.splitSupport
code: /-- Given `l`, a finitely supported function from the sigma type `Σ (i : ι), αs i` to `β`,
`split_support l` is the finset of indices in `ι` that appear in the support of `l`. -/
def splitSupport (l : (Σi, αs i) →₀ M) : Finset ι 
goal: Finset ι

full_name: Finsupp.mem_splitSupport_iff_nonzero
code: theorem mem_splitSupport_iff_nonzero (i : ι) : i ∈ splitSupport l ↔ split l i ≠ 0 
goal: i ∈ l.splitSupport ↔ l.split i ≠ 0

full_name: Finsupp.splitComp
code: /-- Given `l`, a finitely supported function from the sigma type `Σ i, αs i` to `β` and
an `ι`-indexed family `g` of functions from `(αs i →₀ β)` to `γ`, `split_comp` defines a
finitely supported function from the index type `ι` to `γ` given by composing `g i` with
`split l i`. -/
def splitComp [Zero N] (g : ∀ i, (αs i →₀ M) → N) (hg : ∀ i x, x = 0 ↔ g i x = 0) : ι →₀ N 
goal: ι →₀ N

full_name: Finsupp.sigma_support
code: theorem sigma_support : l.support = l.splitSupport.sigma fun i => (l.split i).support 
goal: l.support = l.splitSupport.sigma fun i => (l.split i).support

full_name: Finsupp.sigma_sum
code: theorem sigma_sum [AddCommMonoid N] (f : (Σi : ι, αs i) → M → N) :
    l.sum f = ∑ i ∈ splitSupport l, (split l i).sum fun (a : αs i) b => f ⟨i, a⟩ b 
goal: l.sum f = ∑ i ∈ l.splitSupport, (l.split i).sum fun a b => f ⟨i, a⟩ b

full_name: Finsupp.sigmaFinsuppEquivPiFinsupp
code: /-- On a `Fintype η`, `Finsupp.split` is an equivalence between `(Σ (j : η), ιs j) →₀ α`
and `Π j, (ιs j →₀ α)`.

This is the `Finsupp` version of `Equiv.Pi_curry`. -/
noncomputable def sigmaFinsuppEquivPiFinsupp : ((Σj, ιs j) →₀ α) ≃ ∀ j, ιs j →₀ α 
goal: ((j : η) × ιs j →₀ α) ≃ ((j : η) → ιs j →₀ α)

full_name: Finsupp.sigmaFinsuppEquivPiFinsupp_apply
code: @[simp]
theorem sigmaFinsuppEquivPiFinsupp_apply (f : (Σj, ιs j) →₀ α) (j i) :
    sigmaFinsuppEquivPiFinsupp f j i = f ⟨j, i⟩ 
goal: (Finsupp.sigmaFinsuppEquivPiFinsupp f j) i = f ⟨j, i⟩

full_name: Finsupp.sigmaFinsuppAddEquivPiFinsupp
code: /-- On a `Fintype η`, `Finsupp.split` is an additive equivalence between
`(Σ (j : η), ιs j) →₀ α` and `Π j, (ιs j →₀ α)`.

This is the `AddEquiv` version of `Finsupp.sigmaFinsuppEquivPiFinsupp`.
-/
noncomputable def sigmaFinsuppAddEquivPiFinsupp {α : Type*} {ιs : η → Type*} [AddMonoid α] :
    ((Σj, ιs j) →₀ α) ≃+ ∀ j, ιs j →₀ α 
goal: ((j : η) × ιs j →₀ α) ≃+ ((j : η) → ιs j →₀ α)

full_name: Finsupp.sigmaFinsuppAddEquivPiFinsupp_apply
code: @[simp]
theorem sigmaFinsuppAddEquivPiFinsupp_apply {α : Type*} {ιs : η → Type*} [AddMonoid α]
    (f : (Σj, ιs j) →₀ α) (j i) : sigmaFinsuppAddEquivPiFinsupp f j i = f ⟨j, i⟩ 
goal: (Finsupp.sigmaFinsuppAddEquivPiFinsupp f j) i = f ⟨j, i⟩