The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V03. Sets, finite structures and big operators

Mathlib.Data.Finsupp.Basic

244 declarations and 5 deprecated aliases. Mathlib docs · Source

Miscellaneous definitions, lemmas, and constructions using finsupp

Main declarations

  • Finsupp.graph: the finset of input and output pairs with non-zero outputs.
  • Finsupp.mapRange.equiv: Finsupp.mapRange as an equiv.
  • Finsupp.mapDomain: maps the domain of a Finsupp by a function and by summing.
  • Finsupp.comapDomain: postcomposition of a Finsupp with a function injective on the preimage of its support.
  • Finsupp.filter: filter p f is the finitely supported function that is f a if p a is true and 0 otherwise.
  • Finsupp.frange: the image of a finitely supported function on its support.
  • Finsupp.subtype_domain: the restriction of a finitely supported function f to a subtype.

Implementation notes

This file is a noncomputable theory and uses classical logic throughout.

TODO

  • Expand the list of definitions and important lemmas to the module docstring.

Declarations about graph

Declarations about mapRange

Declarations about equivCongrLeft

Declarations about mapDomain

Declarations about comapDomain

Declarations about Finsupp.filter

Declarations about frange

Declarations about Finsupp.subtypeDomain

Declarations about curry and uncurry

Declarations about finitely supported functions whose support is a Sum type

Declarations about sigma types

theorem Finsupp.extendDomain.congr_simp E1 #

∀ {α : Type u_1} {M : Type u_12} [inst : Zero M] {P : α → Prop} {inst_1 : DecidablePred P} [inst_2 : DecidablePred P]
  (f f_1 : Subtype P →₀ M), f = f_1 → f.extendDomain = f_1.extendDomain

theorem Finsupp.comapDomain.congr_simp E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] (f f_1 : α → β) (e_f : f = f_1) (l l_1 : β →₀ M)
  (e_l : l = l_1) (hf : Set.InjOn f (f ⁻¹' ↑l.support)), Finsupp.comapDomain f l hf = Finsupp.comapDomain f_1 l_1 ⋯

theorem Finsupp.filter.congr_simp E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] (p p_1 : α → Prop),
  p = p_1 →
    ∀ {inst_1 : DecidablePred p} [inst_2 : DecidablePred p_1] (f f_1 : α →₀ M),
      f = f_1 → Finsupp.filter p f = Finsupp.filter p_1 f_1

theorem Finsupp.comapDomain.addMonoidHom.congr_simp E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddZeroClass M] {f f_1 : α → β} (e_f : f = f_1)
  (hf : Function.Injective f), Finsupp.comapDomain.addMonoidHom hf = Finsupp.comapDomain.addMonoidHom ⋯

def Finsupp.graph E3 #

{α : Type u_1} → {M : Type u_5} → [inst : Zero M] → (α →₀ M) → Finset (α × M)

The graph of a finitely supported function over its support, i.e. the finset of input and output pairs with non-zero outputs.

theorem Finsupp.mk_mem_graph_iff E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] {a : α} {m : M} {f : α →₀ M}, (a, m) ∈ f.graph ↔ f a = m ∧ m ≠ 0

theorem Finsupp.mem_graph_iff E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] {c : α × M} {f : α →₀ M}, c ∈ f.graph ↔ f c.1 = c.2 ∧ c.2 ≠ 0

theorem Finsupp.mk_mem_graph E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] (f : α →₀ M) {a : α}, a ∈ f.support → (a, f a) ∈ f.graph

theorem Finsupp.apply_eq_of_mem_graph E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] {a : α} {m : M} {f : α →₀ M}, (a, m) ∈ f.graph → f a = m

theorem Finsupp.notMem_graph_snd_zero E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] (a : α) (f : α →₀ M), (a, 0) ∉ f.graph

theorem Finsupp.image_fst_graph E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] [inst_1 : DecidableEq α] (f : α →₀ M),
  Finset.image Prod.fst f.graph = f.support

theorem Finsupp.graph_injective E1 #

∀ (α : Type u_12) (M : Type u_13) [inst : Zero M], Function.Injective Finsupp.graph

theorem Finsupp.graph_inj E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] {f g : α →₀ M}, f.graph = g.graph ↔ f = g

theorem Finsupp.graph_zero E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M], Finsupp.graph 0 = ∅

theorem Finsupp.graph_eq_empty E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] {f : α →₀ M}, f.graph = ∅ ↔ f = 0

theorem Finsupp.mapRange_multiset_sum E1 #

∀ {α : Type u_1} {M : Type u_5} {N : Type u_6} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N] {F : Type u_12}
  [inst_2 : FunLike F M N] [inst_3 : AddMonoidHomClass F M N] (f : F) (m : Multiset (α →₀ M)),
  Finsupp.mapRange ⇑f ⋯ m.sum = (Multiset.map (fun x ↦ Finsupp.mapRange ⇑f ⋯ x) m).sum

theorem Finsupp.mapRange_finsetSum E1 #

∀ {α : Type u_1} {ι : Type u_4} {M : Type u_5} {N : Type u_6} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N]
  {F : Type u_12} [inst_2 : FunLike F M N] [inst_3 : AddMonoidHomClass F M N] (f : F) (s : Finset ι) (g : ι → α →₀ M),
  Finsupp.mapRange ⇑f ⋯ (∑ x ∈ s, g x) = ∑ x ∈ s, Finsupp.mapRange ⇑f ⋯ (g x)

def Finsupp.equivMapDomain E1 #

{α : Type u_1} → {β : Type u_2} → {M : Type u_5} → [inst : Zero M] → α ≃ β → (α →₀ M) → β →₀ M

Given f : α ≃ β, we can map l : α →₀ M to equivMapDomain f l : β →₀ M (computably) by mapping the support forwards and the function backwards.

theorem Finsupp.equivMapDomain_apply E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] (f : α ≃ β) (l : α →₀ M) (b : β),
  (Finsupp.equivMapDomain f l) b = l (f.symm b)

theorem Finsupp.equivMapDomain_symm_apply E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] (f : α ≃ β) (l : β →₀ M) (a : α),
  (Finsupp.equivMapDomain f.symm l) a = l (f a)

theorem Finsupp.equivMapDomain_refl E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] (l : α →₀ M), Finsupp.equivMapDomain (Equiv.refl α) l = l

theorem Finsupp.equivMapDomain_refl' E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M], Finsupp.equivMapDomain (Equiv.refl α) = id

theorem Finsupp.equivMapDomain_trans E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {M : Type u_5} [inst : Zero M] (f : α ≃ β) (g : β ≃ γ) (l : α →₀ M),
  Finsupp.equivMapDomain (f.trans g) l = Finsupp.equivMapDomain g (Finsupp.equivMapDomain f l)

theorem Finsupp.equivMapDomain_trans' E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {M : Type u_5} [inst : Zero M] (f : α ≃ β) (g : β ≃ γ),
  Finsupp.equivMapDomain (f.trans g) = Finsupp.equivMapDomain g ∘ Finsupp.equivMapDomain f

theorem Finsupp.equivMapDomain_single E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] (f : α ≃ β) (a : α) (b : M),
  (Finsupp.equivMapDomain f fun₀ | a => b) = fun₀ | f a => b

theorem Finsupp.equivMapDomain_zero E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] {f : α ≃ β}, Finsupp.equivMapDomain f 0 = 0

theorem Finsupp.sum_equivMapDomain E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} {N : Type u_6} [inst : Zero M] [inst_1 : AddCommMonoid N] (f : α ≃ β)
  (l : α →₀ M) (g : β → M → N), (Finsupp.equivMapDomain f l).sum g = l.sum fun a m ↦ g (f a) m

theorem Finsupp.prod_equivMapDomain E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} {N : Type u_6} [inst : Zero M] [inst_1 : CommMonoid N] (f : α ≃ β)
  (l : α →₀ M) (g : β → M → N), (Finsupp.equivMapDomain f l).prod g = l.prod fun a m ↦ g (f a) m

def Finsupp.equivCongrLeft E1 #

{α : Type u_1} → {β : Type u_2} → {M : Type u_5} → [inst : Zero M] → α ≃ β → (α →₀ M) ≃ (β →₀ M)

Given f : α ≃ β, the finitely supported function spaces are also in bijection: (α →₀ M) ≃ (β →₀ M).

This is the finitely-supported version of Equiv.piCongrLeft.

theorem Finsupp.equivCongrLeft_apply E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] (f : α ≃ β) (l : α →₀ M),
  (Finsupp.equivCongrLeft f) l = Finsupp.equivMapDomain f l

theorem Finsupp.equivCongrLeft_symm E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] (f : α ≃ β),
  (Finsupp.equivCongrLeft f).symm = Finsupp.equivCongrLeft f.symm

theorem Nat.cast_finsuppProd E0 #

∀ {α : Type u_1} {M : Type u_5} {R : Type u_10} [inst : Zero M] (f : α →₀ M) [inst_1 : CommSemiring R] (g : α → M → ℕ),
  ↑(f.prod g) = f.prod fun a b ↦ ↑(g a b)

theorem Nat.cast_finsupp_sum E0 #

∀ {α : Type u_1} {M : Type u_5} {R : Type u_10} [inst : Zero M] (f : α →₀ M) [inst_1 : AddCommMonoidWithOne R]
  (g : α → M → ℕ), ↑(f.sum g) = f.sum fun a b ↦ ↑(g a b)

theorem Int.cast_finsuppProd E0 #

∀ {α : Type u_1} {M : Type u_5} {R : Type u_10} [inst : Zero M] (f : α →₀ M) [inst_1 : CommRing R] (g : α → M → ℤ),
  ↑(f.prod g) = f.prod fun a b ↦ ↑(g a b)

theorem Int.cast_finsupp_sum E0 #

∀ {α : Type u_1} {M : Type u_5} {R : Type u_10} [inst : Zero M] (f : α →₀ M) [inst_1 : AddCommGroupWithOne R]
  (g : α → M → ℤ), ↑(f.sum g) = f.sum fun a b ↦ ↑(g a b)

theorem Rat.cast_finsupp_sum E0 #

∀ {α : Type u_1} {M : Type u_5} {R : Type u_10} [inst : Zero M] (f : α →₀ M) [inst_1 : DivisionRing R] [CharZero R]
  (g : α → M → ℚ), ↑(f.sum g) = f.sum fun a b ↦ ↑(g a b)

theorem Rat.cast_finsuppProd E0 #

∀ {α : Type u_1} {M : Type u_5} {R : Type u_10} [inst : Zero M] (f : α →₀ M) [inst_1 : Field R] [CharZero R]
  (g : α → M → ℚ), ↑(f.prod g) = f.prod fun a b ↦ ↑(g a b)

def Finsupp.mapDomain E3 #

{α : Type u_1} → {β : Type u_2} → {M : Type u_5} → [inst : AddCommMonoid M] → (α → β) → (α →₀ M) → β →₀ M

Given f : α → β and x : α →₀ M, mapDomain f x : β →₀ M is the finitely supported function whose value at b : β is the sum of v a over all a : α such that f a = b.

theorem Finsupp.mapDomain_apply E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] (f : α → β) (x : α →₀ M) (b : β),
  (Finsupp.mapDomain f x) b = x.sum fun a m ↦ (fun₀ | f a => m) b

theorem Finsupp.mapDomain_apply_of_injective E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] {f : α → β},
  Function.Injective f → ∀ (x : α →₀ M) (a : α), (Finsupp.mapDomain f x) (f a) = x a

theorem Finsupp.mapDomain_of_notMem_image_support E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] {f : α → β} {x : α →₀ M} {b : β},
  b ∉ f '' ↑x.support → (Finsupp.mapDomain f x) b = 0

theorem Finsupp.mapDomain_of_notMem_range E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] {f : α → β} (x : α →₀ M),
  ∀ a ∉ Set.range f, (Finsupp.mapDomain f x) a = 0

theorem Finsupp.mem_range_of_mapDomain_ne_zero E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] {f : α → β} {x : α →₀ M} {b : β},
  (Finsupp.mapDomain f x) b ≠ 0 → b ∈ Set.range f

theorem Finsupp.mapDomain_fun_id E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {v : α →₀ M}, Finsupp.mapDomain (fun x ↦ x) v = v

Eta-expanded form of Finsupp.mapDomain_id

theorem Finsupp.mapDomain_id E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {v : α →₀ M}, Finsupp.mapDomain id v = v

theorem Finsupp.mapDomain_fun_comp E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {M : Type u_5} [inst : AddCommMonoid M] {v : α →₀ M} (f : α → β)
  (g : β → γ), Finsupp.mapDomain (fun a ↦ g (f a)) v = Finsupp.mapDomain g (Finsupp.mapDomain f v)

theorem Finsupp.mapDomain_comp E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {M : Type u_5} [inst : AddCommMonoid M] {v : α →₀ M} {f : α → β}
  {g : β → γ}, Finsupp.mapDomain (g ∘ f) v = Finsupp.mapDomain g (Finsupp.mapDomain f v)

theorem Finsupp.mapDomain_single E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] {f : α → β} {a : α} {b : M},
  (Finsupp.mapDomain f fun₀ | a => b) = fun₀ | f a => b

theorem Finsupp.mapDomain_zero E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] {f : α → β}, Finsupp.mapDomain f 0 = 0

theorem Finsupp.mapDomain_congr E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] {v₁ v₂ : α →₀ M} {f g : α → β},
  v₁ = v₂ → (∀ x ∈ v₁.support, f x = g x) → Finsupp.mapDomain f v₁ = Finsupp.mapDomain g v₂

theorem Finsupp.mapDomain_add E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] {v₁ v₂ : α →₀ M} {f : α → β},
  Finsupp.mapDomain f (v₁ + v₂) = Finsupp.mapDomain f v₁ + Finsupp.mapDomain f v₂

theorem Finsupp.mapDomain_sub E1 #

∀ {α : Type u_12} {β : Type u_13} {M : Type u_14} [inst : AddCommGroup M] {v₁ v₂ : α →₀ M} {f : α → β},
  Finsupp.mapDomain f (v₁ - v₂) = Finsupp.mapDomain f v₁ - Finsupp.mapDomain f v₂

theorem Finsupp.mapDomain_equiv_apply E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] {f : α ≃ β} (x : α →₀ M) (a : β),
  (Finsupp.mapDomain (⇑f) x) a = x (f.symm a)

theorem Finsupp.support_mapDomain_embedding E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] (f : α ↪ β) (x : α →₀ M),
  (Finsupp.mapDomain (⇑f) x).support = Finset.map f x.support

def Finsupp.mapDomain.addMonoidHom E1 #

{α : Type u_1} → {β : Type u_2} → {M : Type u_5} → [inst : AddCommMonoid M] → (α → β) → (α →₀ M) →+ β →₀ M

Finsupp.mapDomain is an AddMonoidHom.

theorem Finsupp.mapDomain.addMonoidHom_apply E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] (f : α → β) (x : α →₀ M),
  (Finsupp.mapDomain.addMonoidHom f) x = Finsupp.mapDomain f x

theorem Finsupp.mapDomain.addMonoidHom_id E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M], Finsupp.mapDomain.addMonoidHom id = AddMonoidHom.id (α →₀ M)

theorem Finsupp.mapDomain.addMonoidHom_comp E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {M : Type u_5} [inst : AddCommMonoid M] (f : β → γ) (g : α → β),
  Finsupp.mapDomain.addMonoidHom (f ∘ g) = (Finsupp.mapDomain.addMonoidHom f).comp (Finsupp.mapDomain.addMonoidHom g)

theorem Finsupp.mapDomain_finsetSum E1 #

∀ {α : Type u_1} {β : Type u_2} {ι : Type u_4} {M : Type u_5} [inst : AddCommMonoid M] {f : α → β} {s : Finset ι}
  {v : ι → α →₀ M}, Finsupp.mapDomain f (∑ i ∈ s, v i) = ∑ i ∈ s, Finsupp.mapDomain f (v i)

theorem Finsupp.mapDomain_sum E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} {N : Type u_6} [inst : AddCommMonoid M] [inst_1 : Zero N] {f : α → β}
  {s : α →₀ N} {v : α → N → α →₀ M}, Finsupp.mapDomain f (s.sum v) = s.sum fun a b ↦ Finsupp.mapDomain f (v a b)

theorem Finsupp.mapDomain_support E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] [inst_1 : DecidableEq β] {f : α → β}
  {s : α →₀ M}, (Finsupp.mapDomain f s).support ⊆ Finset.image f s.support

theorem Finsupp.mapDomain_apply' E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] (S : Set α) {f : α → β} (x : α →₀ M),
  ↑x.support ⊆ S → Set.InjOn f S → ∀ {a : α}, a ∈ S → (Finsupp.mapDomain f x) (f a) = x a

theorem Finsupp.mapDomain_support_of_injOn E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] [inst_1 : DecidableEq β] {f : α → β}
  (s : α →₀ M), Set.InjOn f ↑s.support → (Finsupp.mapDomain f s).support = Finset.image f s.support

theorem Finsupp.mapDomain_support_of_injective E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] [inst_1 : DecidableEq β] {f : α → β},
  Function.Injective f → ∀ (s : α →₀ M), (Finsupp.mapDomain f s).support = Finset.image f s.support

theorem Finsupp.sum_mapDomain_index E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} {N : Type u_6} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N]
  {f : α → β} {s : α →₀ M} {h : β → M → N},
  (∀ (b : β), h b 0 = 0) →
    (∀ (b : β) (m₁ m₂ : M), h b (m₁ + m₂) = h b m₁ + h b m₂) → (Finsupp.mapDomain f s).sum h = s.sum fun a m ↦ h (f a) m

theorem Finsupp.prod_mapDomain_index E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} {N : Type u_6} [inst : AddCommMonoid M] [inst_1 : CommMonoid N]
  {f : α → β} {s : α →₀ M} {h : β → M → N},
  (∀ (b : β), h b 0 = 1) →
    (∀ (b : β) (m₁ m₂ : M), h b (m₁ + m₂) = h b m₁ * h b m₂) →
      (Finsupp.mapDomain f s).prod h = s.prod fun a m ↦ h (f a) m

theorem Finsupp.sum_mapDomain_index_addMonoidHom E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} {N : Type u_6} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N]
  {f : α → β} {s : α →₀ M} (h : β → M →+ N),
  ((Finsupp.mapDomain f s).sum fun b m ↦ (h b) m) = s.sum fun a m ↦ (h (f a)) m

A version of sum_mapDomain_index that takes a bundled AddMonoidHom, rather than separate linearity hypotheses.

theorem Finsupp.embDomain_eq_mapDomain E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] (f : α ↪ β) (v : α →₀ M),
  Finsupp.embDomain f v = Finsupp.mapDomain (⇑f) v

theorem Finsupp.sum_mapDomain_index_inj E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} {N : Type u_6} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N]
  {f : α → β} {s : α →₀ M} {h : β → M → N},
  Function.Injective f → (Finsupp.mapDomain f s).sum h = s.sum fun a b ↦ h (f a) b

theorem Finsupp.prod_mapDomain_index_inj E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} {N : Type u_6} [inst : AddCommMonoid M] [inst_1 : CommMonoid N]
  {f : α → β} {s : α →₀ M} {h : β → M → N},
  Function.Injective f → (Finsupp.mapDomain f s).prod h = s.prod fun a b ↦ h (f a) b

theorem Finsupp.mapDomain_injective E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] {f : α → β},
  Function.Injective f → Function.Injective (Finsupp.mapDomain f)

theorem Finsupp.mapDomain_surjective E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] {f : α → β},
  Function.Surjective f → Function.Surjective (Finsupp.mapDomain f)

theorem Finsupp.mapDomain_fintype E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] [inst_1 : Fintype α] (f : α → β) (g : α →₀ M),
  Finsupp.mapDomain f g = ∑ a, fun₀ | f a => g a

def Finsupp.mapDomainEmbedding E1 #

{α : Type u_12} → {β : Type u_13} → (α ↪ β) → (α →₀ ℕ) ↪ β →₀ ℕ

When f is an embedding we have an embedding (α →₀ ℕ) ↪ (β →₀ ℕ) given by mapDomain.

theorem Finsupp.mapDomainEmbedding_apply E0 #

∀ {α : Type u_12} {β : Type u_13} (f : α ↪ β) (x : α →₀ ℕ), (Finsupp.mapDomainEmbedding f) x = Finsupp.mapDomain (⇑f) x

theorem Finsupp.mapDomain.addMonoidHom_comp_mapRange E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} {N : Type u_6} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N]
  (f : α → β) (g : M →+ N),
  (Finsupp.mapDomain.addMonoidHom f).comp (Finsupp.mapRange.addMonoidHom g) =
    (Finsupp.mapRange.addMonoidHom g).comp (Finsupp.mapDomain.addMonoidHom f)

theorem Finsupp.mapDomain_mapRange E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} {N : Type u_6} [inst : AddCommMonoid M] [inst_1 : AddCommMonoid N]
  (f : α → β) (v : α →₀ M) (g : M → N) (h0 : g 0 = 0),
  (∀ (x y : M), g (x + y) = g x + g y) →
    Finsupp.mapDomain f (Finsupp.mapRange g h0 v) = Finsupp.mapRange g h0 (Finsupp.mapDomain f v)

When g preserves addition, mapRange and mapDomain commute.

theorem Finsupp.sum_update_add E1 #

∀ {α : Type u_1} {β : Type u_2} {ι : Type u_4} [inst : AddZeroClass α] [inst_1 : AddCommMonoid β] (f : ι →₀ α) (i : ι)
  (a : α) (g : ι → α → β),
  (∀ (i : ι), g i 0 = 0) →
    (∀ (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

theorem Finsupp.mapDomain_injOn E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] (S : Set α) {f : α → β},
  Set.InjOn f S → Set.InjOn (Finsupp.mapDomain f) {w | ↑w.support ⊆ S}

theorem Finsupp.equivMapDomain_eq_mapDomain E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_12} [inst : AddCommMonoid M] (f : α ≃ β) (l : α →₀ M),
  Finsupp.equivMapDomain f l = Finsupp.mapDomain (⇑f) l

def Finsupp.comapDomain E3 #

{α : Type u_1} →
  {β : Type u_2} →
    {M : Type u_5} → [inst : Zero M] → (f : α → β) → (l : β →₀ M) → Set.InjOn f (f ⁻¹' ↑l.support) → α →₀ M

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.

theorem Finsupp.comapDomain_support E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] (f : α → β) (l : β →₀ M)
  (hf : Set.InjOn f (f ⁻¹' ↑l.support)), (Finsupp.comapDomain f l hf).support = l.support.preimage f hf

theorem Finsupp.comapDomain_apply E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] (f : α → β) (l : β →₀ M)
  (hf : Set.InjOn f (f ⁻¹' ↑l.support)) (a : α), (Finsupp.comapDomain f l hf) a = l (f a)

theorem Finsupp.sum_comapDomain E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} {N : Type u_6} [inst : Zero M] [inst_1 : AddCommMonoid N] (f : α → β)
  (l : β →₀ M) (g : β → M → N) (hf : Set.BijOn f (f ⁻¹' ↑l.support) ↑l.support),
  (Finsupp.comapDomain f l ⋯).sum (g ∘ f) = l.sum g

theorem Finsupp.prod_comapDomain E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} {N : Type u_6} [inst : Zero M] [inst_1 : CommMonoid N] (f : α → β)
  (l : β →₀ M) (g : β → M → N) (hf : Set.BijOn f (f ⁻¹' ↑l.support) ↑l.support),
  (Finsupp.comapDomain f l ⋯).prod (g ∘ f) = l.prod g

theorem Finsupp.comapDomain_single_of_notMem_range E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] {f : α → β} {b : β},
  b ∉ Set.range f →
    ∀ (m : M) (hf : Set.InjOn f (f ⁻¹' ↑(fun₀ | b => m).support)), Finsupp.comapDomain f (fun₀ | b => m) hf = 0

theorem Finsupp.embDomain_comapDomain E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] {f : α ↪ β} {g : β →₀ M},
  ↑g.support ⊆ Set.range ⇑f → Finsupp.embDomain f (Finsupp.comapDomain (⇑f) g ⋯) = g

theorem Finsupp.comapDomain_embDomain E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] (f : α ↪ β) (l : α →₀ M),
  Finsupp.comapDomain (⇑f) (Finsupp.embDomain f l) ⋯ = l

theorem Finsupp.comapDomain_zero E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] (f : α → β)
  (hif : optParam (Set.InjOn f (f ⁻¹' ↑(Finsupp.support 0))) ⋯), Finsupp.comapDomain f 0 hif = 0

Note the hif argument is needed for this to work in rw.

theorem Finsupp.comapDomain_single E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] (f : α → β) (a : α) (m : M)
  (hif : Set.InjOn f (f ⁻¹' ↑(fun₀ | f a => m).support)), Finsupp.comapDomain f (fun₀ | f a => m) hif = fun₀ | a => m

theorem Finsupp.comapDomain_surjective E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] {f : α → β} (hf : Function.Injective f),
  Function.Surjective fun l ↦ Finsupp.comapDomain f l ⋯

theorem Finsupp.comapDomain_add E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddZeroClass M] {f : α → β} (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)),
  Finsupp.comapDomain f (v₁ + v₂) hv₁₂ = Finsupp.comapDomain f v₁ hv₁ + Finsupp.comapDomain f v₂ hv₂

theorem Finsupp.comapDomain_add_of_injective E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddZeroClass M] {f : α → β} (hf : Function.Injective f)
  (v₁ v₂ : β →₀ M), Finsupp.comapDomain f (v₁ + v₂) ⋯ = Finsupp.comapDomain f v₁ ⋯ + Finsupp.comapDomain f v₂ ⋯

A version of Finsupp.comapDomain_add that's easier to use.

def Finsupp.comapDomain.addMonoidHom E1 #

{α : Type u_1} →
  {β : Type u_2} → {M : Type u_5} → [inst : AddZeroClass M] → {f : α → β} → Function.Injective f → (β →₀ M) →+ α →₀ M

Finsupp.comapDomain is an AddMonoidHom.

theorem Finsupp.comapDomain.addMonoidHom_apply E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddZeroClass M] {f : α → β} (hf : Function.Injective f)
  (x : β →₀ M), (Finsupp.comapDomain.addMonoidHom hf) x = Finsupp.comapDomain f x ⋯

theorem Finsupp.mapDomain_comapDomain E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] (f : α → β) (hf : Function.Injective f)
  (l : β →₀ M), ↑l.support ⊆ Set.range f → Finsupp.mapDomain f (Finsupp.comapDomain f l ⋯) = l

theorem Finsupp.mapDomain_comapDomain_nat_add_one E1 #

∀ {M : Type u_5} [inst : AddCommMonoid M] (l : ℕ →₀ M),
  Finsupp.mapDomain (fun x ↦ x + 1) ((Finsupp.comapDomain.addMonoidHom ⋯) l) = Finsupp.erase 0 l

theorem Finsupp.comapDomain_mapDomain E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] (f : α → β) (hf : Function.Injective f)
  (l : α →₀ M), Finsupp.comapDomain f (Finsupp.mapDomain f l) ⋯ = l

theorem Finsupp.mem_range_mapDomain_iff E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] (f : α → β),
  Function.Injective f → ∀ (x : β →₀ M), x ∈ Set.range (Finsupp.mapDomain f) ↔ ∀ b ∉ Set.range f, x b = 0

def Finsupp.filter E3 #

{α : Type u_1} → {M : Type u_5} → [inst : Zero M] → (p : α → Prop) → [DecidablePred p] → (α →₀ M) → α →₀ M

Finsupp.filter p f is the finitely supported function that is f a if p a is true and 0 otherwise.

theorem Finsupp.filter_apply E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] (p : α → Prop) [inst_1 : DecidablePred p] (f : α →₀ M) (a : α),
  (Finsupp.filter p f) a = if p a then f a else 0

theorem Finsupp.filter_eq E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] [inst_1 : DecidableEq α] (f : α →₀ M) (a : α),
  Finsupp.filter (fun x ↦ a = x) f = fun₀ | a => f a

theorem Finsupp.filter_eq' E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] [inst_1 : DecidableEq α] (f : α →₀ M) (a : α),
  Finsupp.filter (fun x ↦ x = a) f = fun₀ | a => f a

theorem Finsupp.filter_eq_indicator E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] (p : α → Prop) [inst_1 : DecidablePred p] (f : α →₀ M),
  ⇑(Finsupp.filter p f) = {x | p x}.indicator ⇑f

theorem Finsupp.filter_eq_zero_iff E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] (p : α → Prop) [inst_1 : DecidablePred p] (f : α →₀ M),
  Finsupp.filter p f = 0 ↔ ∀ (x : α), p x → f x = 0

theorem Finsupp.filter_eq_self_iff E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] (p : α → Prop) [inst_1 : DecidablePred p] (f : α →₀ M),
  Finsupp.filter p f = f ↔ ∀ (x : α), f x ≠ 0 → p x

theorem Finsupp.filter_apply_pos E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] (p : α → Prop) [inst_1 : DecidablePred p] (f : α →₀ M) {a : α},
  p a → (Finsupp.filter p f) a = f a

theorem Finsupp.filter_apply_neg E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] (p : α → Prop) [inst_1 : DecidablePred p] (f : α →₀ M) {a : α},
  ¬p a → (Finsupp.filter p f) a = 0

theorem Finsupp.support_filter E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] (p : α → Prop) [inst_1 : DecidablePred p] (f : α →₀ M),
  (Finsupp.filter p f).support = {x ∈ f.support | p x}

theorem Finsupp.filter_zero E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] (p : α → Prop) [inst_1 : DecidablePred p], Finsupp.filter p 0 = 0

theorem Finsupp.filter_single_of_pos E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] (p : α → Prop) [inst_1 : DecidablePred p] {a : α} {b : M},
  p a → (Finsupp.filter p fun₀ | a => b) = fun₀ | a => b

theorem Finsupp.filter_single_of_neg E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] (p : α → Prop) [inst_1 : DecidablePred p] {a : α} {b : M},
  ¬p a → (Finsupp.filter p fun₀ | a => b) = 0

theorem Finsupp.sum_filter_index E1 #

∀ {α : Type u_1} {M : Type u_5} {N : Type u_6} [inst : Zero M] (p : α → Prop) [inst_1 : DecidablePred p] (f : α →₀ M)
  [inst_2 : AddCommMonoid N] (g : α → M → N), (Finsupp.filter p f).sum g = ∑ x ∈ (Finsupp.filter p f).support, g x (f x)

theorem Finsupp.prod_filter_index E1 #

∀ {α : Type u_1} {M : Type u_5} {N : Type u_6} [inst : Zero M] (p : α → Prop) [inst_1 : DecidablePred p] (f : α →₀ M)
  [inst_2 : CommMonoid N] (g : α → M → N), (Finsupp.filter p f).prod g = ∏ x ∈ (Finsupp.filter p f).support, g x (f x)

theorem Finsupp.sum_filter_add_sum_filter_not E0 #

∀ {α : Type u_1} {M : Type u_5} {N : Type u_6} [inst : Zero M] (p : α → Prop) [inst_1 : DecidablePred p] (f : α →₀ M)
  [inst_2 : AddCommMonoid N] (g : α → M → N),
  (Finsupp.filter p f).sum g + (Finsupp.filter (fun a ↦ ¬p a) f).sum g = f.sum g

theorem Finsupp.prod_filter_mul_prod_filter_not E0 #

∀ {α : Type u_1} {M : Type u_5} {N : Type u_6} [inst : Zero M] (p : α → Prop) [inst_1 : DecidablePred p] (f : α →₀ M)
  [inst_2 : CommMonoid N] (g : α → M → N),
  (Finsupp.filter p f).prod g * (Finsupp.filter (fun a ↦ ¬p a) f).prod g = f.prod g

theorem Finsupp.sum_sub_sum_filter E0 #

∀ {α : Type u_1} {M : Type u_5} {G : Type u_8} [inst : Zero M] (p : α → Prop) [inst_1 : DecidablePred p] (f : α →₀ M)
  [inst_2 : AddCommGroup G] (g : α → M → G),
  f.sum g - (Finsupp.filter p f).sum g = (Finsupp.filter (fun a ↦ ¬p a) f).sum g

theorem Finsupp.prod_div_prod_filter E0 #

∀ {α : Type u_1} {M : Type u_5} {G : Type u_8} [inst : Zero M] (p : α → Prop) [inst_1 : DecidablePred p] (f : α →₀ M)
  [inst_2 : CommGroup G] (g : α → M → G),
  f.prod g / (Finsupp.filter p f).prod g = (Finsupp.filter (fun a ↦ ¬p a) f).prod g

theorem Finsupp.filter_add_filter_not E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (f : α →₀ M) (p : α → Prop) [inst_1 : DecidablePred p],
  Finsupp.filter p f + Finsupp.filter (fun x ↦ ¬p x) f = f

def Finsupp.frange E3 #

{α : Type u_1} → {M : Type u_5} → [inst : Zero M] → (α →₀ M) → Finset M

frange f is the image of f on the support of f.

theorem Finsupp.mem_frange E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] {f : α →₀ M} {y : M}, y ∈ f.frange ↔ y ≠ 0 ∧ y ∈ Set.range ⇑f

theorem Finsupp.zero_notMem_frange E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] {f : α →₀ M}, 0 ∉ f.frange

theorem Finsupp.frange_single E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] {x : α} {y : M}, (fun₀ | x => y).frange ⊆ {y}

theorem Finsupp.mem_frange_of_mem E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] {x : α} {f : α →₀ M}, x ∈ f.support → f x ∈ f.frange

theorem Finsupp.range_subset_insert_frange E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] (f : α →₀ M), Set.range ⇑f ⊆ insert 0 ↑f.frange

theorem Finsupp.finite_range E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] (f : α →₀ M), (Set.range ⇑f).Finite

def Finsupp.subtypeDomain E1 #

{α : Type u_1} → {M : Type u_5} → [inst : Zero M] → (p : α → Prop) → (α →₀ M) → Subtype p →₀ M

subtypeDomain p f is the restriction of the finitely supported function f to subtype p.

theorem Finsupp.support_subtypeDomain E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] {p : α → Prop} [D : DecidablePred p] {f : α →₀ M},
  (Finsupp.subtypeDomain p f).support = Finset.subtype p f.support

theorem Finsupp.subtypeDomain_apply E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] {p : α → Prop} {a : Subtype p} {v : α →₀ M},
  (Finsupp.subtypeDomain p v) a = v ↑a

theorem Finsupp.subtypeDomain_zero E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] {p : α → Prop}, Finsupp.subtypeDomain p 0 = 0

theorem Finsupp.subtypeDomain_eq_iff_forall E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] {p : α → Prop} {f g : α →₀ M},
  Finsupp.subtypeDomain p f = Finsupp.subtypeDomain p g ↔ ∀ (x : α), p x → f x = g x

theorem Finsupp.subtypeDomain_eq_iff E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] {p : α → Prop} {f g : α →₀ M},
  (∀ x ∈ f.support, p x) → (∀ x ∈ g.support, p x) → (Finsupp.subtypeDomain p f = Finsupp.subtypeDomain p g ↔ f = g)

theorem Finsupp.subtypeDomain_eq_zero_iff' E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] {p : α → Prop} {f : α →₀ M},
  Finsupp.subtypeDomain p f = 0 ↔ ∀ (x : α), p x → f x = 0

theorem Finsupp.subtypeDomain_eq_zero_iff E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : Zero M] {p : α → Prop} {f : α →₀ M},
  (∀ x ∈ f.support, p x) → (Finsupp.subtypeDomain p f = 0 ↔ f = 0)

theorem Finsupp.sum_subtypeDomain_index E1 #

∀ {α : Type u_1} {M : Type u_5} {N : Type u_6} [inst : Zero M] {p : α → Prop} [inst_1 : AddCommMonoid N] {v : α →₀ M}
  {h : α → M → N}, (∀ x ∈ v.support, p x) → ((Finsupp.subtypeDomain p v).sum fun a b ↦ h (↑a) b) = v.sum h

theorem Finsupp.prod_subtypeDomain_index E1 #

∀ {α : Type u_1} {M : Type u_5} {N : Type u_6} [inst : Zero M] {p : α → Prop} [inst_1 : CommMonoid N] {v : α →₀ M}
  {h : α → M → N}, (∀ x ∈ v.support, p x) → ((Finsupp.subtypeDomain p v).prod fun a b ↦ h (↑a) b) = v.prod h

theorem Finsupp.subtypeDomain_add E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddZeroClass M] {p : α → Prop} {v v' : α →₀ M},
  Finsupp.subtypeDomain p (v + v') = Finsupp.subtypeDomain p v + Finsupp.subtypeDomain p v'

def Finsupp.subtypeDomainAddMonoidHom E1 #

{α : Type u_1} → {M : Type u_5} → [inst : AddZeroClass M] → {p : α → Prop} → (α →₀ M) →+ Subtype p →₀ M

subtypeDomain but as an AddMonoidHom.

def Finsupp.filterAddHom E1 #

{α : Type u_1} → {M : Type u_5} → [inst : AddZeroClass M] → (p : α → Prop) → [DecidablePred p] → (α →₀ M) →+ α →₀ M

Finsupp.filter as an AddMonoidHom.

theorem Finsupp.filter_add E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddZeroClass M] {p : α → Prop} [inst_1 : DecidablePred p] {v v' : α →₀ M},
  Finsupp.filter p (v + v') = Finsupp.filter p v + Finsupp.filter p v'

theorem Finsupp.subtypeDomain_sum E1 #

∀ {α : Type u_1} {ι : Type u_4} {M : Type u_5} [inst : AddCommMonoid M] {p : α → Prop} {s : Finset ι} {h : ι → α →₀ M},
  Finsupp.subtypeDomain p (∑ c ∈ s, h c) = ∑ c ∈ s, Finsupp.subtypeDomain p (h c)

theorem Finsupp.subtypeDomain_finsupp_sum E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} {N : Type u_6} [inst : AddCommMonoid M] {p : α → Prop} [inst_1 : Zero N]
  {s : β →₀ N} {h : β → N → α →₀ M}, Finsupp.subtypeDomain p (s.sum h) = s.sum fun c d ↦ Finsupp.subtypeDomain p (h c d)

theorem Finsupp.filter_sum E1 #

∀ {α : Type u_1} {ι : Type u_4} {M : Type u_5} [inst : AddCommMonoid M] {p : α → Prop} [inst_1 : DecidablePred p]
  (s : Finset ι) (f : ι → α →₀ M), Finsupp.filter p (∑ a ∈ s, f a) = ∑ a ∈ s, Finsupp.filter p (f a)

theorem Finsupp.filter_eq_sum E1 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] (p : α → Prop) [inst_1 : DecidablePred p] (f : α →₀ M),
  Finsupp.filter p f = ∑ i ∈ f.support with p i, fun₀ | i => f i

theorem Finsupp.subtypeDomain_neg E0 #

∀ {α : Type u_1} {G : Type u_8} [inst : AddGroup G] {p : α → Prop} {v : α →₀ G},
  Finsupp.subtypeDomain p (-v) = -Finsupp.subtypeDomain p v

theorem Finsupp.subtypeDomain_sub E0 #

∀ {α : Type u_1} {G : Type u_8} [inst : AddGroup G] {p : α → Prop} {v v' : α →₀ G},
  Finsupp.subtypeDomain p (v - v') = Finsupp.subtypeDomain p v - Finsupp.subtypeDomain p v'

theorem Finsupp.filter_neg E0 #

∀ {α : Type u_1} {G : Type u_8} [inst : AddGroup G] (p : α → Prop) [inst_1 : DecidablePred p] (f : α →₀ G),
  Finsupp.filter p (-f) = -Finsupp.filter p f

theorem Finsupp.filter_sub E0 #

∀ {α : Type u_1} {G : Type u_8} [inst : AddGroup G] (p : α → Prop) [inst_1 : DecidablePred p] (f₁ f₂ : α →₀ G),
  Finsupp.filter p (f₁ - f₂) = Finsupp.filter p f₁ - Finsupp.filter p f₂

theorem Finsupp.mem_support_multiset_sum E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M] {s : Multiset (α →₀ M)},
  ∀ a ∈ s.sum.support, ∃ f ∈ s, a ∈ f.support

theorem Finsupp.mem_support_finsetSum E0 #

∀ {α : Type u_1} {ι : Type u_4} {M : Type u_5} [inst : AddCommMonoid M] {s : Finset ι} {h : ι → α →₀ M},
  ∀ a ∈ (∑ c ∈ s, h c).support, ∃ c ∈ s, a ∈ (h c).support

def Finsupp.uncurry E1 #

{α : Type u_1} → {β : Type u_2} → {M : Type u_5} → [inst : Zero M] → (α →₀ β →₀ M) → α × β →₀ M

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.

theorem Finsupp.uncurry_apply E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] (f : α →₀ β →₀ M) (x : α × β), f.uncurry x = (f x.1) x.2

theorem Finsupp.uncurry_apply_pair E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] (f : α →₀ β →₀ M) (a : α) (b : β),
  f.uncurry (a, b) = (f a) b

theorem Finsupp.uncurry_single E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] (a : α) (b : β) (m : M),
  (fun₀ | a => fun₀ | b => m).uncurry = fun₀ | (a, b) => m

theorem Finsupp.sum_uncurry_index E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} {N : Type u_6} [inst : Zero M] [inst_1 : AddCommMonoid N]
  (f : α →₀ β →₀ M) (g : α × β → M → N), (f.uncurry.sum fun p c ↦ g p c) = f.sum fun a f ↦ f.sum fun b ↦ g (a, b)

theorem Finsupp.sum_uncurry_index' E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} {N : Type u_6} [inst : Zero M] [inst_1 : AddCommMonoid N]
  (f : α →₀ β →₀ M) (g : α → β → M → N), (f.uncurry.sum fun p c ↦ g p.1 p.2 c) = f.sum fun a f ↦ f.sum (g a)

def Finsupp.curry E1 #

{α : Type u_1} → {β : Type u_2} → {M : Type u_5} → [inst : Zero M] → (α × β →₀ M) → α →₀ β →₀ M

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 γ.

theorem Finsupp.curry_apply E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] (f : α × β →₀ M) (x : α) (y : β),
  (f.curry x) y = f (x, y)

theorem Finsupp.support_curry E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] [inst_1 : DecidableEq α] (f : α × β →₀ M),
  f.curry.support = Finset.image Prod.fst f.support

theorem Finsupp.curry_uncurry E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] (f : α →₀ β →₀ M), f.uncurry.curry = f

theorem Finsupp.uncurry_curry E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] (f : α × β →₀ M), f.curry.uncurry = f

theorem Finsupp.curry_single E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] (a : α × β) (m : M),
  (fun₀ | a => m).curry = fun₀ | a.1 => fun₀ | a.2 => m

theorem Finsupp.sum_curry_index E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} {N : Type u_6} [inst : Zero M] [inst_1 : AddCommMonoid N]
  (f : α × β →₀ M) (g : α → β → M → N), (f.curry.sum fun a f ↦ f.sum (g a)) = f.sum fun p c ↦ g p.1 p.2 c

def Finsupp.curryEquiv E1 #

{α : Type u_1} → {β : Type u_2} → {M : Type u_5} → [inst : Zero M] → (α × β →₀ M) ≃ (α →₀ β →₀ M)

The equivalence between α × β →₀ M and α →₀ β →₀ M given by currying/uncurrying.

theorem Finsupp.curryEquiv_apply E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] (f : α × β →₀ M), Finsupp.curryEquiv f = f.curry

theorem Finsupp.curryEquiv_symm_apply E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] (f : α →₀ β →₀ M), Finsupp.curryEquiv.symm f = f.uncurry

theorem Finsupp.filter_curry E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : Zero M] (f : α × β →₀ M) (p : α → Prop)
  [inst_1 : DecidablePred p], (Finsupp.filter (fun a ↦ p a.1) f).curry = Finsupp.filter p f.curry

def Finsupp.curryAddEquiv E1 #

{α : Type u_1} → {β : Type u_2} → {M : Type u_5} → [inst : AddZeroClass M] → (α × β →₀ M) ≃+ (α →₀ β →₀ M)

The additive monoid isomorphism between α × β →₀ M and α →₀ β →₀ M given by currying/uncurrying.

theorem Finsupp.curryAddEquiv_symm_apply E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddZeroClass M] (f : α →₀ β →₀ M),
  Finsupp.curryAddEquiv.symm f = f.uncurry

theorem Finsupp.coe_curryAddEquiv E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddZeroClass M], ⇑Finsupp.curryAddEquiv = Finsupp.curry

def Finsupp.sumElim E1 #

{α : Type u_1} → {β : Type u_2} → {γ : Type u_3} → [inst : Zero γ] → (α →₀ γ) → (β →₀ γ) → α ⊕ β →₀ γ

Finsupp.sumElim f g maps inl x to f x and inr y to g y.

theorem Finsupp.sumElim_support E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Zero γ] (f : α →₀ γ) (g : β →₀ γ),
  (f.sumElim g).support = f.support.disjSum g.support

theorem Finsupp.coe_sumElim E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Zero γ] (f : α →₀ γ) (g : β →₀ γ),
  ⇑(f.sumElim g) = Sum.elim ⇑f ⇑g

theorem Finsupp.sumElim_apply E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Zero γ] (f : α →₀ γ) (g : β →₀ γ) (x : α ⊕ β),
  (f.sumElim g) x = Sum.elim (⇑f) (⇑g) x

theorem Finsupp.sumElim_inl E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Zero γ] (f : α →₀ γ) (g : β →₀ γ) (x : α),
  (f.sumElim g) (Sum.inl x) = f x

theorem Finsupp.sumElim_inr E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Zero γ] (f : α →₀ γ) (g : β →₀ γ) (x : β),
  (f.sumElim g) (Sum.inr x) = g x

theorem Finsupp.sumElim_zero_zero E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Zero γ], Finsupp.sumElim 0 0 = 0

theorem Finsupp.sumElim_single_zero E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Zero γ] (a : α) (c : γ),
  (fun₀ | a => c).sumElim 0 = fun₀ | Sum.inl a => c

theorem Finsupp.sumElim_zero_single E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Zero γ] (b : β) (c : γ),
  (Finsupp.sumElim 0 fun₀ | b => c) = fun₀ | Sum.inr b => c

theorem Finsupp.sumElim_single_single E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddMonoid M] (a : α) (b : β) (m₁ m₂ : M),
  ((fun₀ | a => m₁).sumElim fun₀ | b => m₂) = (fun₀ | Sum.inl a => m₁) + fun₀ | Sum.inr b => m₂

theorem Finsupp.sumElim_eq_add E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] (f : α →₀ M) (g : β →₀ M),
  f.sumElim g = Finsupp.mapDomain Sum.inl f + Finsupp.mapDomain Sum.inr g

theorem Finsupp.mapDomain_swap_sumElim E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] (f : α →₀ M) (g : β →₀ M),
  Finsupp.mapDomain Sum.swap (f.sumElim g) = g.sumElim f

theorem Finsupp.prod_sumElim E1 #

∀ {ι₁ : Type u_12} {ι₂ : Type u_13} {α : Type u_14} {M : Type u_15} [inst : Zero α] [inst_1 : CommMonoid M]
  (f₁ : ι₁ →₀ α) (f₂ : ι₂ →₀ α) (g : ι₁ ⊕ ι₂ → α → M),
  (f₁.sumElim f₂).prod g = f₁.prod (g ∘ Sum.inl) * f₂.prod (g ∘ Sum.inr)

theorem Finsupp.sum_sumElim E1 #

∀ {ι₁ : Type u_12} {ι₂ : Type u_13} {α : Type u_14} {M : Type u_15} [inst : Zero α] [inst_1 : AddCommMonoid M]
  (f₁ : ι₁ →₀ α) (f₂ : ι₂ →₀ α) (g : ι₁ ⊕ ι₂ → α → M),
  (f₁.sumElim f₂).sum g = f₁.sum (g ∘ Sum.inl) + f₂.sum (g ∘ Sum.inr)

theorem Finsupp.comapDomain_inl_sumElim E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Zero γ] (f : α →₀ γ) (g : β →₀ γ),
  Finsupp.comapDomain Sum.inl (f.sumElim g) ⋯ = f

theorem Finsupp.comapDomain_inr_sumElim E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Zero γ] (f : α →₀ γ) (g : β →₀ γ),
  Finsupp.comapDomain Sum.inr (f.sumElim g) ⋯ = g

theorem Finsupp.embDomain_inl E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Zero γ] (a : α →₀ γ),
  Finsupp.embDomain Function.Embedding.inl a = a.sumElim 0

theorem Finsupp.embDomain_inr E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Zero γ] (b : β →₀ γ),
  Finsupp.embDomain Function.Embedding.inr b = Finsupp.sumElim 0 b

theorem Finsupp.comapDomain_sumElim_comapDomain E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Zero γ] (c : α ⊕ β →₀ γ),
  (Finsupp.comapDomain Sum.inl c ⋯).sumElim (Finsupp.comapDomain Sum.inr c ⋯) = c

theorem Finsupp.sumElim_add E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddZeroClass M] (a b : α →₀ M) (c d : β →₀ M),
  (a + b).sumElim (c + d) = a.sumElim c + b.sumElim d

def Finsupp.sumFinsuppEquivProdFinsupp E1 #

{α : Type u_12} → {β : Type u_13} → {γ : Type u_14} → [inst : Zero γ] → (α ⊕ β →₀ γ) ≃ (α →₀ γ) × (β →₀ γ)

The equivalence between (α ⊕ β) →₀ γ and (α →₀ γ) × (β →₀ γ).

This is the Finsupp version of Equiv.sum_arrow_equiv_prod_arrow.

theorem Finsupp.sumFinsuppEquivProdFinsupp_symm_apply E0 #

∀ {α : Type u_12} {β : Type u_13} {γ : Type u_14} [inst : Zero γ] (fg : (α →₀ γ) × (β →₀ γ)),
  Finsupp.sumFinsuppEquivProdFinsupp.symm fg = fg.1.sumElim fg.2

theorem Finsupp.sumFinsuppEquivProdFinsupp_apply E0 #

∀ {α : Type u_12} {β : Type u_13} {γ : Type u_14} [inst : Zero γ] (f : α ⊕ β →₀ γ),
  Finsupp.sumFinsuppEquivProdFinsupp f = (Finsupp.comapDomain Sum.inl f ⋯, Finsupp.comapDomain Sum.inr f ⋯)

theorem Finsupp.fst_sumFinsuppEquivProdFinsupp E1 #

∀ {α : Type u_12} {β : Type u_13} {γ : Type u_14} [inst : Zero γ] (f : α ⊕ β →₀ γ) (x : α),
  (Finsupp.sumFinsuppEquivProdFinsupp f).1 x = f (Sum.inl x)

theorem Finsupp.snd_sumFinsuppEquivProdFinsupp E1 #

∀ {α : Type u_12} {β : Type u_13} {γ : Type u_14} [inst : Zero γ] (f : α ⊕ β →₀ γ) (y : β),
  (Finsupp.sumFinsuppEquivProdFinsupp f).2 y = f (Sum.inr y)

theorem Finsupp.sumFinsuppEquivProdFinsupp_symm_inl E1 #

∀ {α : Type u_12} {β : Type u_13} {γ : Type u_14} [inst : Zero γ] (fg : (α →₀ γ) × (β →₀ γ)) (x : α),
  (Finsupp.sumFinsuppEquivProdFinsupp.symm fg) (Sum.inl x) = fg.1 x

theorem Finsupp.sumFinsuppEquivProdFinsupp_symm_inr E1 #

∀ {α : Type u_12} {β : Type u_13} {γ : Type u_14} [inst : Zero γ] (fg : (α →₀ γ) × (β →₀ γ)) (y : β),
  (Finsupp.sumFinsuppEquivProdFinsupp.symm fg) (Sum.inr y) = fg.2 y

def Finsupp.sumFinsuppAddEquivProdFinsupp E1 #

{M : Type u_5} → [inst : AddMonoid M] → {α : Type u_12} → {β : Type u_13} → (α ⊕ β →₀ M) ≃+ (α →₀ M) × (β →₀ M)

The additive equivalence between (α ⊕ β) →₀ M and (α →₀ M) × (β →₀ M).

This is the Finsupp version of Equiv.sum_arrow_equiv_prod_arrow.

theorem Finsupp.sumFinsuppAddEquivProdFinsupp_symm_apply E0 #

∀ {M : Type u_5} [inst : AddMonoid M] {α : Type u_12} {β : Type u_13} (fg : (α →₀ M) × (β →₀ M)),
  Finsupp.sumFinsuppAddEquivProdFinsupp.symm fg = fg.1.sumElim fg.2

theorem Finsupp.sumFinsuppAddEquivProdFinsupp_apply E0 #

∀ {M : Type u_5} [inst : AddMonoid M] {α : Type u_12} {β : Type u_13} (f : α ⊕ β →₀ M),
  Finsupp.sumFinsuppAddEquivProdFinsupp f = (Finsupp.comapDomain Sum.inl f ⋯, Finsupp.comapDomain Sum.inr f ⋯)

theorem Finsupp.fst_sumFinsuppAddEquivProdFinsupp E1 #

∀ {M : Type u_5} [inst : AddMonoid M] {α : Type u_12} {β : Type u_13} (f : α ⊕ β →₀ M) (x : α),
  (Finsupp.sumFinsuppAddEquivProdFinsupp f).1 x = f (Sum.inl x)

theorem Finsupp.snd_sumFinsuppAddEquivProdFinsupp E1 #

∀ {M : Type u_5} [inst : AddMonoid M] {α : Type u_12} {β : Type u_13} (f : α ⊕ β →₀ M) (y : β),
  (Finsupp.sumFinsuppAddEquivProdFinsupp f).2 y = f (Sum.inr y)

theorem Finsupp.sumFinsuppAddEquivProdFinsupp_symm_inl E1 #

∀ {M : Type u_5} [inst : AddMonoid M] {α : Type u_12} {β : Type u_13} (fg : (α →₀ M) × (β →₀ M)) (x : α),
  (Finsupp.sumFinsuppAddEquivProdFinsupp.symm fg) (Sum.inl x) = fg.1 x

theorem Finsupp.sumFinsuppAddEquivProdFinsupp_symm_inr E1 #

∀ {M : Type u_5} [inst : AddMonoid M] {α : Type u_12} {β : Type u_13} (fg : (α →₀ M) × (β →₀ M)) (y : β),
  (Finsupp.sumFinsuppAddEquivProdFinsupp.symm fg) (Sum.inr y) = fg.2 y

instance Finsupp.uniqueOfRight E0 #

{α : Type u_1} → {R : Type u_10} → [inst : Zero R] → [Subsingleton R] → Unique (α →₀ R)

The Finsupp version of Pi.unique.

instance Finsupp.uniqueOfLeft E0 #

{α : Type u_1} → {R : Type u_10} → [inst : Zero R] → [IsEmpty α] → Unique (α →₀ R)

The Finsupp version of Pi.uniqueOfIsEmpty.

def Finsupp.piecewise E1 #

{α : Type u_1} →
  {M : Type u_12} →
    [inst : Zero M] → {P : α → Prop} → [DecidablePred P] → (Subtype P →₀ M) → ({ a // ¬P a } →₀ M) → α →₀ M

Combine finitely supported functions over {a // P a} and {a // ¬P a}, by case-splitting on P a.

theorem Finsupp.piecewise_apply E0 #

∀ {α : Type u_1} {M : Type u_12} [inst : Zero M] {P : α → Prop} [inst_1 : DecidablePred P] (f : Subtype P →₀ M)
  (g : { a // ¬P a } →₀ M) (a : α), (f.piecewise g) a = if h : P a then f ⟨a, h⟩ else g ⟨a, h⟩

theorem Finsupp.piecewise_support E0 #

∀ {α : Type u_1} {M : Type u_12} [inst : Zero M] {P : α → Prop} [inst_1 : DecidablePred P] (f : Subtype P →₀ M)
  (g : { a // ¬P a } →₀ M),
  (f.piecewise g).support =
    (Finset.map (Function.Embedding.subtype P) f.support).disjUnion
      (Finset.map (Function.Embedding.subtype fun a ↦ ¬P a) g.support) ⋯

theorem Finsupp.subtypeDomain_piecewise E0 #

∀ {α : Type u_1} {M : Type u_12} [inst : Zero M] {P : α → Prop} [inst_1 : DecidablePred P] (f : Subtype P →₀ M)
  (g : { a // ¬P a } →₀ M), Finsupp.subtypeDomain P (f.piecewise g) = f

theorem Finsupp.subtypeDomain_not_piecewise E0 #

∀ {α : Type u_1} {M : Type u_12} [inst : Zero M] {P : α → Prop} [inst_1 : DecidablePred P] (f : Subtype P →₀ M)
  (g : { a // ¬P a } →₀ M), Finsupp.subtypeDomain (fun x ↦ ¬P x) (f.piecewise g) = g

def Finsupp.extendDomain E1 #

{α : Type u_1} → {M : Type u_12} → [inst : Zero M] → {P : α → Prop} → [DecidablePred P] → (Subtype P →₀ M) → α →₀ M

Extend the domain of a Finsupp by using 0 where P x does not hold.

theorem Finsupp.extendDomain_support E0 #

∀ {α : Type u_1} {M : Type u_12} [inst : Zero M] {P : α → Prop} [inst_1 : DecidablePred P] (f : Subtype P →₀ M),
  f.extendDomain.support = Finset.map (Function.Embedding.subtype P) f.support

theorem Finsupp.extendDomain_apply E0 #

∀ {α : Type u_1} {M : Type u_12} [inst : Zero M] {P : α → Prop} [inst_1 : DecidablePred P] (f : Subtype P →₀ M) (a : α),
  f.extendDomain a = if h : P a then f ⟨a, h⟩ else 0

theorem Finsupp.extendDomain_eq_embDomain_subtype E1 #

∀ {α : Type u_1} {M : Type u_12} [inst : Zero M] {P : α → Prop} [inst_1 : DecidablePred P] (f : Subtype P →₀ M),
  f.extendDomain = Finsupp.embDomain (Function.Embedding.subtype P) f

theorem Finsupp.support_extendDomain_subset E1 #

∀ {α : Type u_1} {M : Type u_12} [inst : Zero M] {P : α → Prop} [inst_1 : DecidablePred P] (f : Subtype P →₀ M),
  ↑f.extendDomain.support ⊆ {x | P x}

theorem Finsupp.subtypeDomain_extendDomain E0 #

∀ {α : Type u_1} {M : Type u_12} [inst : Zero M] {P : α → Prop} [inst_1 : DecidablePred P] (f : Subtype P →₀ M),
  Finsupp.subtypeDomain P f.extendDomain = f

theorem Finsupp.extendDomain_subtypeDomain E1 #

∀ {α : Type u_1} {M : Type u_12} [inst : Zero M] {P : α → Prop} [inst_1 : DecidablePred P] (f : α →₀ M),
  (∀ a ∈ f.support, P a) → (Finsupp.subtypeDomain P f).extendDomain = f

theorem Finsupp.extendDomain_single E0 #

∀ {α : Type u_1} {M : Type u_12} [inst : Zero M] {P : α → Prop} [inst_1 : DecidablePred P] (a : Subtype P) (m : M),
  (fun₀ | a => m).extendDomain = fun₀ | ↑a => m

def Finsupp.restrictSupportEquiv E1 #

{α : Type u_1} → (s : Set α) → (M : Type u_12) → [inst : AddCommMonoid M] → { f // ↑f.support ⊆ s } ≃ (↑s →₀ M)

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.

theorem Finsupp.restrictSupportEquiv_apply E0 #

∀ {α : Type u_1} (s : Set α) (M : Type u_12) [inst : AddCommMonoid M] (f : { f // ↑f.support ⊆ s }),
  (Finsupp.restrictSupportEquiv s M) f = Finsupp.subtypeDomain (fun x ↦ x ∈ s) ↑f

theorem Finsupp.restrictSupportEquiv_symm_apply_coe E0 #

∀ {α : Type u_1} (s : Set α) (M : Type u_12) [inst : AddCommMonoid M] [inst_1 : DecidablePred fun x ↦ x ∈ s]
  (f : ↑s →₀ M), ↑((Finsupp.restrictSupportEquiv s M).symm f) = f.extendDomain

theorem Finsupp.restrictSupportEquiv_symm_single E0 #

∀ {α : Type u_1} (s : Set α) (M : Type u_12) [inst : AddCommMonoid M] (a : ↑s) (x : M),
  ↑((Finsupp.restrictSupportEquiv s M).symm fun₀ | a => x) = fun₀ | ↑a => x

def Finsupp.domCongr E1 #

{α : Type u_1} → {β : Type u_2} → {M : Type u_5} → [inst : AddCommMonoid M] → α ≃ β → (α →₀ M) ≃+ (β →₀ M)

Given AddCommMonoid M and e : α ≃ β, domCongr e is the corresponding Equiv between α →₀ M and β →₀ M.

This is Finsupp.equivCongrLeft as an AddEquiv.

theorem Finsupp.domCongr_apply E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] (e : α ≃ β) (l : α →₀ M),
  (Finsupp.domCongr e) l = Finsupp.equivMapDomain e l

theorem Finsupp.domCongr_refl E0 #

∀ {α : Type u_1} {M : Type u_5} [inst : AddCommMonoid M], Finsupp.domCongr (Equiv.refl α) = AddEquiv.refl (α →₀ M)

theorem Finsupp.domCongr_symm E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] (e : α ≃ β),
  (Finsupp.domCongr e).symm = Finsupp.domCongr e.symm

theorem Finsupp.domCongr_trans E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {M : Type u_5} [inst : AddCommMonoid M] (e : α ≃ β) (f : β ≃ γ),
  (Finsupp.domCongr e).trans (Finsupp.domCongr f) = Finsupp.domCongr (e.trans f)

def Finsupp.split E3 #

{ι : Type u_4} → {M : Type u_5} → {αs : ι → Type u_12} → [inst : Zero M] → ((i : ι) × αs i →₀ M) → (i : ι) → αs i →₀ M

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 ith component of l, a finitely supported function from as i to M.

This is the Finsupp version of Sigma.curry.

theorem Finsupp.split_apply E0 #

∀ {ι : Type u_4} {M : Type u_5} {αs : ι → Type u_12} [inst : Zero M] (l : (i : ι) × αs i →₀ M) (i : ι) (x : αs i),
  (l.split i) x = l ⟨i, x⟩

def Finsupp.splitSupport E1 #

{ι : Type u_4} → {M : Type u_5} → {αs : ι → Type u_12} → [inst : Zero M] → ((i : ι) × αs i →₀ M) → Finset ι

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.

theorem Finsupp.mem_splitSupport_iff_ne_zero E0 #

∀ {ι : Type u_4} {M : Type u_5} {αs : ι → Type u_12} [inst : Zero M] (l : (i : ι) × αs i →₀ M) (i : ι),
  i ∈ l.splitSupport ↔ l.split i ≠ 0

def Finsupp.splitComp E1 #

{ι : Type u_4} →
  {M : Type u_5} →
    {N : Type u_6} →
      {αs : ι → Type u_12} →
        [inst : Zero M] →
          ((i : ι) × αs i →₀ M) →
            [inst_1 : Zero N] →
              (g : (i : ι) → (αs i →₀ M) → N) → (∀ (i : ι) (x : αs i →₀ M), x = 0 ↔ g i x = 0) → ι →₀ N

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.

theorem Finsupp.sigma_support E1 #

∀ {ι : Type u_4} {M : Type u_5} {αs : ι → Type u_12} [inst : Zero M] (l : (i : ι) × αs i →₀ M),
  l.support = l.splitSupport.sigma fun i ↦ (l.split i).support

theorem Finsupp.sigma_sum E1 #

∀ {ι : Type u_4} {M : Type u_5} {N : Type u_6} {αs : ι → Type u_12} [inst : Zero M] (l : (i : ι) × αs i →₀ M)
  [inst_1 : AddCommMonoid N] (f : (i : ι) × αs i → M → N),
  l.sum f = ∑ i ∈ l.splitSupport, (l.split i).sum fun a b ↦ f ⟨i, a⟩ b

def Finsupp.sigmaFinsuppEquivPiFinsupp E1 #

{α : Type u_1} →
  {η : Type u_13} → [Fintype η] → {ιs : η → Type u_14} → [inst : Zero α] → ((j : η) × ιs j →₀ α) ≃ ((j : η) → ιs j →₀ α)

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.

theorem Finsupp.sigmaFinsuppEquivPiFinsupp_apply E0 #

∀ {α : Type u_1} {η : Type u_13} [inst : Fintype η] {ιs : η → Type u_14} [inst_1 : Zero α] (f : (j : η) × ιs j →₀ α)
  (j : η) (i : ιs j), (Finsupp.sigmaFinsuppEquivPiFinsupp f j) i = f ⟨j, i⟩

def Finsupp.sigmaFinsuppAddEquivPiFinsupp E1 #

{η : Type u_13} →
  [Fintype η] →
    {α : Type u_15} → {ιs : η → Type u_16} → [inst : AddMonoid α] → ((j : η) × ιs j →₀ α) ≃+ ((j : η) → ιs j →₀ α)

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.

theorem Finsupp.sigmaFinsuppAddEquivPiFinsupp_apply E0 #

∀ {η : Type u_13} [inst : Fintype η] {α : Type u_15} {ιs : η → Type u_16} [inst_1 : AddMonoid α]
  (f : (j : η) × ιs j →₀ α) (j : η) (i : ιs j), (Finsupp.sigmaFinsuppAddEquivPiFinsupp f j) i = f ⟨j, i⟩

theorem Finsupp.mem_range_embDomain_iff E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] (f : α ↪ β) (x : β →₀ M),
  x ∈ Set.range (Finsupp.embDomain f) ↔ ↑x.support ⊆ Set.range ⇑f

theorem Finsupp.embDomain_trans_apply E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {M : Type u_5} [inst : AddCommMonoid M] (v : α →₀ M) (f : α ↪ β)
  (g : β ↪ γ), Finsupp.embDomain (f.trans g) v = Finsupp.embDomain g (Finsupp.embDomain f v)

theorem Finsupp.mapDomain_support_of_subsingletonAddUnits E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : DecidableEq β] [inst_1 : AddCommMonoid M] (f : α → β)
  [Subsingleton (AddUnits M)] (x : α →₀ M), (Finsupp.mapDomain f x).support = Finset.image f x.support

theorem Finsupp.mapDomain_apply_eq_sum E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : DecidableEq β] [inst_1 : AddCommMonoid M] (f : α → β)
  (x : α →₀ M) {a : α}, (Finsupp.mapDomain f x) (f a) = ∑ i ∈ x.support with f i = f a, x i

theorem Finsupp.mapDomain_apply_eq_zero_iff_of_subsingletonAddUnits E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_5} [inst : AddCommMonoid M] (f : α → β) [Subsingleton (AddUnits M)]
  (x : α →₀ M), Finsupp.mapDomain f x = 0 ↔ x = 0

Deprecated aliases

NameNew nameSince
Finsupp.comapDomain_single_of_not_mem_rangeFinsupp.comapDomain_single_of_notMem_range2026-09-28
Finsupp.filter_pos_add_filter_negFinsupp.filter_add_filter_not2026-05-04
Finsupp.mapDomain_notin_rangeFinsupp.mapDomain_of_notMem_range2026-07-15
Finsupp.mapDomain_of_not_mem_image_supportFinsupp.mapDomain_of_notMem_image_support2026-09-28
Finsupp.mem_splitSupport_iff_nonzeroFinsupp.mem_splitSupport_iff_ne_zero2026-10-13