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

96 declarations and 1 deprecated aliases. Mathlib docs · Source

Type of functions with finite support

For any type α and any type M with zero, we define the type Finsupp α M (notation: α →₀ M) of finitely supported functions from α to M, i.e. the functions which are zero everywhere on α except on a finite set.

Functions with finite support are used (at least) in the following parts of the library:

  • MonoidAlgebra R M and AddMonoidAlgebra R M are defined as M →₀ R;

  • polynomials and multivariate polynomials are defined as AddMonoidAlgebras, hence they use Finsupp under the hood;

  • the linear combination of a family of vectors v i with coefficients f i (as used, e.g., to define linearly independent family LinearIndependent) is defined as a map Finsupp.linearCombination : (ι → M) → (ι →₀ R) →ₗ[R] M.

Some other constructions are naturally equivalent to α →₀ M with some α and M but are defined in a different way in the library:

  • Multiset α ≃+ α →₀ ℕ;
  • FreeAddCommGroup α ≃+ α →₀ ℤ.

Most of the theory assumes that the range is a commutative additive monoid. This gives us the big sum operator as a powerful way to construct Finsupp elements, which is defined in Mathlib/Algebra/BigOperators/Finsupp/Basic.lean.

Many constructions based on α →₀ M are defs rather than abbrevs to avoid reusing unwanted type class instances. E.g., MonoidAlgebra, AddMonoidAlgebra, and types based on these two have non-pointwise multiplication.

Main declarations

  • Finsupp: The type of finitely supported functions from α to β.
  • Finsupp.onFinset: The restriction of a function to a Finset as a Finsupp.
  • Finsupp.mapRange: Composition of a ZeroHom with a Finsupp.
  • Finsupp.embDomain: Maps the domain of a Finsupp by an embedding.
  • Finsupp.zipWith: Postcomposition of two Finsupps with a function f such that f 0 0 = 0.

Notation

This file adds α →₀ M as a global notation for Finsupp α M.

We also use the following convention for Type* variables in this file

  • α, β: types with no additional structure that appear as the first argument to Finsupp somewhere in the statement;

  • ι : an auxiliary index type;

  • M, N, O: types with Zero or (Add)(Comm)Monoid structure;

  • G, H: groups (commutative or not, multiplicative or additive);

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.

Basic declarations about Finsupp

Declarations about onFinset

Declarations about mapRange

Declarations about embDomain

Declarations about zipWith

theorem Finsupp.embDomain.match_1.congr_eq_1 E1 #

∀ {α : Type u_1} (motive : Option α → Sort u_2) (x : Option α) (h_1 : (a : α) → motive (some a))
  (h_2 : Unit → motive none) (a : α),
  x = some a →
    (match x with
      | some a => h_1 a
      | none => h_2 ()) ≍
      h_1 a

theorem Finsupp.mapRange.congr_simp E1 #

∀ {α : Type u_1} {M : Type u_4} {N : Type u_5} [inst : Zero M] [inst_1 : Zero N] (f f_1 : M → N) (e_f : f = f_1)
  (hf : f 0 = 0) (g g_1 : α →₀ M), g = g_1 → Finsupp.mapRange f hf g = Finsupp.mapRange f_1 ⋯ g_1

def Finsupp.ctorIdx E1 #

{α : Type u_8} → {M : Type u_9} → {inst : Zero M} → (α →₀ M) → ℕ

theorem Finsupp.mk.inj E1 #

∀ {α : Type u_8} {M : Type u_9} {inst : Zero M} {support : Finset α} {toFun : α → M}
  {mem_support_toFun : ∀ (a : α), a ∈ support ↔ toFun a ≠ 0} {support_1 : Finset α} {toFun_1 : α → M}
  {mem_support_toFun_1 : ∀ (a : α), a ∈ support_1 ↔ toFun_1 a ≠ 0},
  { support := support, toFun := toFun, mem_support_toFun := mem_support_toFun } =
      { support := support_1, toFun := toFun_1, mem_support_toFun := mem_support_toFun_1 } →
    support = support_1 ∧ toFun = toFun_1

theorem Finsupp.embDomain.match_1.congr_eq_2 E1 #

∀ {α : Type u_1} (motive : Option α → Sort u_2) (x : Option α) (h_1 : (a : α) → motive (some a))
  (h_2 : Unit → motive none),
  x = none →
    (match x with
      | some a => h_1 a
      | none => h_2 ()) ≍
      h_2 ()

theorem Finsupp.onFinset.congr_simp E1 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] (s s_1 : Finset α) (e_s : s = s_1) (f f_1 : α → M) (e_f : f = f_1)
  (hf : ∀ (a : α), f a ≠ 0 → a ∈ s), Finsupp.onFinset s f hf = Finsupp.onFinset s_1 f_1 ⋯

theorem Finsupp.mk.injEq E0 #

∀ {α : Type u_8} {M : Type u_9} [inst : Zero M] (support : Finset α) (toFun : α → M)
  (mem_support_toFun : ∀ (a : α), a ∈ support ↔ toFun a ≠ 0) (support_1 : Finset α) (toFun_1 : α → M)
  (mem_support_toFun_1 : ∀ (a : α), a ∈ support_1 ↔ toFun_1 a ≠ 0),
  ({ support := support, toFun := toFun, mem_support_toFun := mem_support_toFun } =
      { support := support_1, toFun := toFun_1, mem_support_toFun := mem_support_toFun_1 }) =
    (support = support_1 ∧ toFun = toFun_1)

theorem Finsupp.ofSupportFinite.congr_simp E1 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] (f f_1 : α → M) (e_f : f = f_1) (hf : (Function.support f).Finite),
  Finsupp.ofSupportFinite f hf = Finsupp.ofSupportFinite f_1 ⋯

theorem Finsupp.mapRange.equiv.congr_simp E1 #

∀ {ι : Type u_3} {M : Type u_4} {N : Type u_5} [inst : Zero M] [inst_1 : Zero N] (e e_1 : M ≃ N) (e_e : e = e_1)
  (hf : e 0 = 0), Finsupp.mapRange.equiv e hf = Finsupp.mapRange.equiv e_1 ⋯

theorem Finsupp.mk.congr_simp E1 #

∀ {α : Type u_8} {M : Type u_9} [inst : Zero M] (support support_1 : Finset α) (e_support : support = support_1)
  (toFun toFun_1 : α → M) (e_toFun : toFun = toFun_1) (mem_support_toFun : ∀ (a : α), a ∈ support ↔ toFun a ≠ 0),
  { support := support, toFun := toFun, mem_support_toFun := mem_support_toFun } =
    { support := support_1, toFun := toFun_1, mem_support_toFun := ⋯ }

theorem Finsupp.zipWith.congr_simp E1 #

∀ {α : Type u_1} {M : Type u_4} {N : Type u_5} {O : Type u_6} [inst : Zero M] [inst_1 : Zero N] [inst_2 : Zero O]
  (f f_1 : M → N → O) (e_f : f = f_1) (hf : f 0 0 = 0) (g₁ g₁_1 : α →₀ M),
  g₁ = g₁_1 → ∀ (g₂ g₂_1 : α →₀ N), g₂ = g₂_1 → Finsupp.zipWith f hf g₁ g₂ = Finsupp.zipWith f_1 ⋯ g₁_1 g₂_1

structure Finsupp E3 #

Type u_8 → (M : Type u_9) → [Zero M] → Type (max u_8 u_9)

Finsupp α M, denoted α →₀ M, is the type of functions f : α → M such that f x = 0 for all but finitely many x.

ctor Finsupp.mk E0 #

{α : Type u_8} →
  {M : Type u_9} →
    [inst : Zero M] → (support : Finset α) → (toFun : α → M) → (∀ (a : α), a ∈ support ↔ toFun a ≠ 0) → α →₀ M

abbrev Finsupp.support E3 #

{α : Type u_8} → {M : Type u_9} → [inst : Zero M] → (α →₀ M) → Finset α

The support of a finitely supported function (aka Finsupp).

abbrev Finsupp.toFun E1 #

{α : Type u_8} → {M : Type u_9} → [inst : Zero M] → (α →₀ M) → α → M

The underlying function of a bundled finitely supported function (aka Finsupp).

theorem Finsupp.mem_support_toFun E0 #

∀ {α : Type u_8} {M : Type u_9} [inst : Zero M] (self : α →₀ M) (a : α), a ∈ self.support ↔ self.toFun a ≠ 0

The witness that the support of a Finsupp is indeed the exact locus where its underlying function is nonzero.

def «term_→₀_» E1 #

Lean.TrailingParserDescr

Finsupp α M, denoted α →₀ M, is the type of functions f : α → M such that f x = 0 for all but finitely many x.

instance Finsupp.instFunLike E0 #

{α : Type u_1} → {M : Type u_4} → [inst : Zero M] → FunLike (α →₀ M) α M

theorem Finsupp.ext E1 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] {f g : α →₀ M}, (∀ (a : α), f a = g a) → f = g

theorem Finsupp.ext_iff E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] {f g : α →₀ M}, f = g ↔ ∀ (a : α), f a = g a

instance Finsupp.instSubsingleton E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] [IsEmpty α], Subsingleton (α →₀ M)

instance Finsupp.instSubsingleton' E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] [Subsingleton M], Subsingleton (α →₀ M)

theorem Finsupp.nontrivial_of_nontrivial E1 #

∀ (α : Type u_1) {M : Type u_4} [inst : Zero M] [h : Nontrivial (α →₀ M)], Nontrivial M

theorem Finsupp.ne_iff E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] {f g : α →₀ M}, f ≠ g ↔ ∃ a, f a ≠ g a

theorem Finsupp.coe_mk E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] (f : α → M) (s : Finset α) (h : ∀ (a : α), a ∈ s ↔ f a ≠ 0),
  ⇑{ support := s, toFun := f, mem_support_toFun := h } = f

instance Finsupp.instZero E0 #

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

theorem Finsupp.coe_zero E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M], ⇑0 = 0

theorem Finsupp.zero_apply E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] {a : α}, 0 a = 0

theorem Finsupp.support_zero E0 #

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

instance Finsupp.instInhabited E0 #

{α : Type u_1} → {M : Type u_4} → [inst : Zero M] → Inhabited (α →₀ M)

theorem Finsupp.default_eq_zero E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M], default = 0

theorem Finsupp.mem_support_iff E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] {f : α →₀ M} {a : α}, a ∈ f.support ↔ f a ≠ 0

theorem Finsupp.fun_support_eq E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] (f : α →₀ M), Function.support ⇑f = ↑f.support

theorem Finsupp.notMem_support_iff E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] {f : α →₀ M} {a : α}, a ∉ f.support ↔ f a = 0

theorem Finsupp.coe_eq_zero E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] {f : α →₀ M}, ⇑f = 0 ↔ f = 0

theorem Finsupp.ext_iff' E1 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] {f g : α →₀ M},
  f = g ↔ f.support = g.support ∧ ∀ x ∈ f.support, f x = g x

theorem Finsupp.support_eq_empty E0 #

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

theorem Finsupp.support_nonempty_iff E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] {f : α →₀ M}, f.support.Nonempty ↔ f ≠ 0

theorem Finsupp.card_support_eq_zero E1 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] {f : α →₀ M}, f.support.card = 0 ↔ f = 0

instance Finsupp.instDecidableEq E0 #

{α : Type u_1} → {M : Type u_4} → [inst : Zero M] → [DecidableEq α] → [DecidableEq M] → DecidableEq (α →₀ M)

theorem Finsupp.hasFiniteSupport E1 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] (f : α →₀ M), Function.HasFiniteSupport ⇑f

theorem Finsupp.support_subset_iff E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] {s : Set α} {f : α →₀ M}, ↑f.support ⊆ s ↔ ∀ a ∉ s, f a = 0

def Finsupp.equivFunOnFinite E1 #

{α : Type u_1} → {M : Type u_4} → [inst : Zero M] → [Finite α] → (α →₀ M) ≃ (α → M)

Given Finite α, equivFunOnFinite is the Equiv between α →₀ β and α → β. (All functions on a finite type are finitely supported.)

theorem Finsupp.equivFunOnFinite_apply E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] [inst_1 : Finite α] (a : α →₀ M) (a_1 : α),
  Finsupp.equivFunOnFinite a a_1 = a a_1

theorem Finsupp.equivFunOnFinite_symm_apply_support E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] [inst_1 : Finite α] (f : α → M),
  (Finsupp.equivFunOnFinite.symm f).support = ⋯.toFinset

theorem Finsupp.equivFunOnFinite_symm_apply_apply E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] [inst_1 : Finite α] (f : α → M) (a : α),
  (Finsupp.equivFunOnFinite.symm f) a = f a

theorem Finsupp.equivFunOnFinite_symm_coe E0 #

∀ {M : Type u_4} [inst : Zero M] {α : Type u_8} [inst_1 : Finite α] (f : α →₀ M), Finsupp.equivFunOnFinite.symm ⇑f = f

theorem Finsupp.coe_equivFunOnFinite_symm E0 #

∀ {M : Type u_4} [inst : Zero M] {α : Type u_8} [inst_1 : Finite α] (f : α → M), ⇑(Finsupp.equivFunOnFinite.symm f) = f

theorem Finsupp.unique_ext E1 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] [inst_1 : Unique α] {f g : α →₀ M}, f default = g default → f = g

theorem Finsupp.unique_ext_iff E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] [inst_1 : Unique α] {f g : α →₀ M}, f = g ↔ f default = g default

def Finsupp.onFinsetSupport E1 #

{α : Type u_1} → {M : Type u_4} → [Zero M] → Finset α → (α → M) → Finset α

The (not exposed) support of Finsupp.onFinset.

def Finsupp.onFinset E3 #

{α : Type u_1} → {M : Type u_4} → [inst : Zero M] → (s : Finset α) → (f : α → M) → (∀ (a : α), f a ≠ 0 → a ∈ s) → α →₀ M

Finsupp.onFinset s f hf is the finsupp function representing f restricted to the finset s. The function must be 0 outside of s. Use this when the set needs to be filtered anyways, otherwise a better set representation is often available.

theorem Finsupp.coe_onFinset E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] (s : Finset α) (f : α → M) (hf : ∀ (a : α), f a ≠ 0 → a ∈ s),
  ⇑(Finsupp.onFinset s f hf) = f

theorem Finsupp.onFinset_apply E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] {s : Finset α} {f : α → M} {hf : ∀ (a : α), f a ≠ 0 → a ∈ s} {a : α},
  (Finsupp.onFinset s f hf) a = f a

theorem Finsupp.support_onFinset E1 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] [inst_1 : DecidableEq M] {s : Finset α} {f : α → M}
  (hf : ∀ (a : α), f a ≠ 0 → a ∈ s), (Finsupp.onFinset s f hf).support = {a ∈ s | f a ≠ 0}

theorem Finsupp.onFinset_support E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] (f : α →₀ M), Finsupp.onFinset f.support ⇑f ⋯ = f

theorem Finsupp.support_onFinset_subset E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] {s : Finset α} {f : α → M} {hf : ∀ (a : α), f a ≠ 0 → a ∈ s},
  (Finsupp.onFinset s f hf).support ⊆ s

theorem Finsupp.mem_support_onFinset E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] {s : Finset α} {f : α → M} (hf : ∀ (a : α), f a ≠ 0 → a ∈ s) {a : α},
  a ∈ (Finsupp.onFinset s f hf).support ↔ f a ≠ 0

def Finsupp.ofSupportFinite E1 #

{α : Type u_1} → {M : Type u_4} → [inst : Zero M] → (f : α → M) → (Function.support f).Finite → α →₀ M

The natural Finsupp induced by the function f given that it has finite support.

theorem Finsupp.ofSupportFinite_coe E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] {f : α → M} {hf : (Function.support f).Finite},
  ⇑(Finsupp.ofSupportFinite f hf) = f

theorem Finsupp.ofSupportFinite_support E1 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] {f : α → M} (hf : (Function.support f).Finite),
  (Finsupp.ofSupportFinite f hf).support = hf.toFinset

instance Finsupp.instCanLift E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M],
  CanLift (α → M) (α →₀ M) DFunLike.coe fun f ↦ (Function.support f).Finite

def Finsupp.mapRange E3 #

{α : Type u_1} →
  {M : Type u_4} → {N : Type u_5} → [inst : Zero M] → [inst_1 : Zero N] → (f : M → N) → f 0 = 0 → (α →₀ M) → α →₀ N

The composition of f : M → N and g : α →₀ M is mapRange f hf g : α →₀ N, which is well-defined when f 0 = 0.

This preserves the structure on f, and exists in various bundled forms for when f is itself bundled (defined in Mathlib/Data/Finsupp/Basic.lean):

  • Finsupp.mapRange.equiv
  • Finsupp.mapRange.zeroHom
  • Finsupp.mapRange.addMonoidHom
  • Finsupp.mapRange.addEquiv
  • Finsupp.mapRange.linearMap
  • Finsupp.mapRange.linearEquiv

theorem Finsupp.mapRange_apply E0 #

∀ {α : Type u_1} {M : Type u_4} {N : Type u_5} [inst : Zero M] [inst_1 : Zero N] {f : M → N} {hf : f 0 = 0} {g : α →₀ M}
  {a : α}, (Finsupp.mapRange f hf g) a = f (g a)

theorem Finsupp.mapRange_zero E0 #

∀ {α : Type u_1} {M : Type u_4} {N : Type u_5} [inst : Zero M] [inst_1 : Zero N] {f : M → N} {hf : f 0 = 0},
  Finsupp.mapRange f hf 0 = 0

theorem Finsupp.mapRange_eq_zero E0 #

∀ {α : Type u_1} {M : Type u_4} {N : Type u_5} [inst : Zero M] [inst_1 : Zero N] {a : α →₀ M} {f : M → N},
  Function.Injective f → ∀ (h : f 0 = 0), Finsupp.mapRange f h a = 0 ↔ a = 0

theorem Finsupp.mapRange_id E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M] (g : α →₀ M), Finsupp.mapRange id ⋯ g = g

theorem Finsupp.mapRange_comp E1 #

∀ {α : Type u_1} {M : Type u_4} {N : Type u_5} {O : Type u_6} [inst : Zero M] [inst_1 : Zero N] [inst_2 : Zero O]
  (f : N → O) (hf : f 0 = 0) (f₂ : M → N) (hf₂ : f₂ 0 = 0) (h : (f ∘ f₂) 0 = 0) (g : α →₀ M),
  Finsupp.mapRange (f ∘ f₂) h g = Finsupp.mapRange f hf (Finsupp.mapRange f₂ hf₂ g)

theorem Finsupp.mapRange_mapRange E0 #

∀ {α : Type u_1} {M : Type u_4} {N : Type u_5} {O : Type u_6} [inst : Zero M] [inst_1 : Zero N] [inst_2 : Zero O]
  (e₁ : N → O) (e₂ : M → N) (he₁ : e₁ 0 = 0) (he₂ : e₂ 0 = 0) (f : α →₀ M),
  Finsupp.mapRange e₁ he₁ (Finsupp.mapRange e₂ he₂ f) = Finsupp.mapRange (e₁ ∘ e₂) ⋯ f

theorem Finsupp.support_mapRange E1 #

∀ {α : Type u_1} {M : Type u_4} {N : Type u_5} [inst : Zero M] [inst_1 : Zero N] {f : M → N} {hf : f 0 = 0}
  {g : α →₀ M}, (Finsupp.mapRange f hf g).support ⊆ g.support

theorem Finsupp.support_mapRange_of_injective E1 #

∀ {ι : Type u_3} {M : Type u_4} {N : Type u_5} [inst : Zero M] [inst_1 : Zero N] {e : M → N} (he0 : e 0 = 0)
  (f : ι →₀ M), Function.Injective e → (Finsupp.mapRange e he0 f).support = f.support

theorem Finsupp.support_mapRange_eq E0 #

∀ {α : Type u_1} {M : Type u_4} {N : Type u_5} [inst : Zero M] [inst_1 : Zero N] {f : M → N} (hf : f 0 = 0)
  (g : α →₀ M), (∀ (x : M), f x = 0 → x = 0) → (Finsupp.mapRange f hf g).support = g.support

theorem Finsupp.range_mapRange E1 #

∀ {α : Type u_1} {M : Type u_4} {N : Type u_5} [inst : Zero M] [inst_1 : Zero N] (e : M → N) (he₀ : e 0 = 0),
  Set.range (Finsupp.mapRange e he₀) = {g | ∀ (i : α), g i ∈ Set.range e}

theorem Finsupp.mapRange_injective E1 #

∀ {α : Type u_1} {M : Type u_4} {N : Type u_5} [inst : Zero M] [inst_1 : Zero N] (e : M → N) (he₀ : e 0 = 0),
  Function.Injective e → Function.Injective (Finsupp.mapRange e he₀)

Finsupp.mapRange of an injective function is injective.

theorem Finsupp.mapRange_surjective E1 #

∀ {α : Type u_1} {M : Type u_4} {N : Type u_5} [inst : Zero M] [inst_1 : Zero N] (e : M → N) (he₀ : e 0 = 0),
  Function.Surjective e → Function.Surjective (Finsupp.mapRange e he₀)

Finsupp.mapRange of a surjective function is surjective.

theorem Finsupp.mapRange_bijective E1 #

∀ {α : Type u_1} {M : Type u_4} {N : Type u_5} [inst : Zero M] [inst_1 : Zero N] (e : M → N) (he₀ : e 0 = 0),
  Function.Bijective e → Function.Bijective (Finsupp.mapRange e he₀)

def Finsupp.mapRange.equiv E3 #

{ι : Type u_3} →
  {M : Type u_4} → {N : Type u_5} → [inst : Zero M] → [inst_1 : Zero N] → (e : M ≃ N) → e 0 = 0 → (ι →₀ M) ≃ (ι →₀ N)

Finsupp.mapRange as an equiv.

theorem Finsupp.mapRange.equiv_apply E0 #

∀ {ι : Type u_3} {M : Type u_4} {N : Type u_5} [inst : Zero M] [inst_1 : Zero N] (e : M ≃ N) (hf : e 0 = 0)
  (g : ι →₀ M), (Finsupp.mapRange.equiv e hf) g = Finsupp.mapRange (⇑e) hf g

theorem Finsupp.mapRange.equiv_refl E0 #

∀ {ι : Type u_3} {M : Type u_4} [inst : Zero M], Finsupp.mapRange.equiv (Equiv.refl M) ⋯ = Equiv.refl (ι →₀ M)

theorem Finsupp.mapRange.equiv_trans E1 #

∀ {ι : Type u_3} {M : Type u_4} {N : Type u_5} {O : Type u_6} [inst : Zero M] [inst_1 : Zero N] [inst_2 : Zero O]
  (e : M ≃ N) (hf : e 0 = 0) (f₂ : N ≃ O) (hf₂ : f₂ 0 = 0),
  Finsupp.mapRange.equiv (e.trans f₂) ⋯ = (Finsupp.mapRange.equiv e hf).trans (Finsupp.mapRange.equiv f₂ hf₂)

theorem Finsupp.mapRange.equiv_symm E0 #

∀ {ι : Type u_3} {M : Type u_4} {N : Type u_5} [inst : Zero M] [inst_1 : Zero N] (e : M ≃ N) (hf : e 0 = 0),
  (Finsupp.mapRange.equiv e hf).symm = Finsupp.mapRange.equiv e.symm ⋯

def Finsupp.embDomain E3 #

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

Given f : α ↪ β and v : α →₀ M, Finsupp.embDomain f v : β →₀ M is the finitely supported function whose value at f a : β is v a. For a b : β outside the range of f, it is zero.

theorem Finsupp.support_embDomain E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_4} [inst : Zero M] (f : α ↪ β) (v : α →₀ M),
  (Finsupp.embDomain f v).support = Finset.map f v.support

theorem Finsupp.embDomain_zero E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_4} [inst : Zero M] (f : α ↪ β), Finsupp.embDomain f 0 = 0

theorem Finsupp.embDomain_apply E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_4} [inst : Zero M] (f : α ↪ β) (v : α →₀ M) (b : β),
  (Finsupp.embDomain f v) b = if h : ∃ a, f a = b then v h.choose else 0

theorem Finsupp.embDomain_apply_self E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_4} [inst : Zero M] (f : α ↪ β) (v : α →₀ M) (a : α),
  (Finsupp.embDomain f v) (f a) = v a

theorem Finsupp.embDomain_of_notMem_range E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_4} [inst : Zero M] (f : α ↪ β) (v : α →₀ M),
  ∀ a ∉ Set.range ⇑f, (Finsupp.embDomain f v) a = 0

theorem Finsupp.embDomain_injective E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_4} [inst : Zero M] (f : α ↪ β), Function.Injective (Finsupp.embDomain f)

theorem Finsupp.embDomain_inj E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_4} [inst : Zero M] {f : α ↪ β} {l₁ l₂ : α →₀ M},
  Finsupp.embDomain f l₁ = Finsupp.embDomain f l₂ ↔ l₁ = l₂

theorem Finsupp.embDomain_eq_zero E0 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_4} [inst : Zero M] {f : α ↪ β} {l : α →₀ M},
  Finsupp.embDomain f l = 0 ↔ l = 0

theorem Finsupp.embDomain_mapRange E1 #

∀ {α : Type u_1} {β : Type u_2} {M : Type u_4} {N : Type u_5} [inst : Zero M] [inst_1 : Zero N] (f : α ↪ β) (g : M → N)
  (p : α →₀ M) (hg : g 0 = 0),
  Finsupp.embDomain f (Finsupp.mapRange g hg p) = Finsupp.mapRange g hg (Finsupp.embDomain f p)

theorem Finsupp.embDomain_refl E0 #

∀ {α : Type u_1} {M : Type u_4} [inst : Zero M], Finsupp.embDomain (Function.Embedding.refl α) = id

def Finsupp.zipWith E3 #

{α : Type u_1} →
  {M : Type u_4} →
    {N : Type u_5} →
      {O : Type u_6} →
        [inst : Zero M] →
          [inst_1 : Zero N] → [inst_2 : Zero O] → (f : M → N → O) → f 0 0 = 0 → (α →₀ M) → (α →₀ N) → α →₀ O

Given finitely supported functions g₁ : α →₀ M and g₂ : α →₀ N and function f : M → N → O, Finsupp.zipWith f hf g₁ g₂ is the finitely supported function α →₀ O satisfying zipWith f hf g₁ g₂ a = f (g₁ a) (g₂ a), which is well-defined when f 0 0 = 0.

theorem Finsupp.zipWith_apply E0 #

∀ {α : Type u_1} {M : Type u_4} {N : Type u_5} {O : Type u_6} [inst : Zero M] [inst_1 : Zero N] [inst_2 : Zero O]
  {f : M → N → O} {hf : f 0 0 = 0} {g₁ : α →₀ M} {g₂ : α →₀ N} {a : α}, (Finsupp.zipWith f hf g₁ g₂) a = f (g₁ a) (g₂ a)

theorem Finsupp.support_zipWith E1 #

∀ {α : Type u_1} {M : Type u_4} {N : Type u_5} {O : Type u_6} [inst : Zero M] [inst_1 : Zero N] [inst_2 : Zero O]
  [D : DecidableEq α] {f : M → N → O} {hf : f 0 0 = 0} {g₁ : α →₀ M} {g₂ : α →₀ N},
  (Finsupp.zipWith f hf g₁ g₂).support ⊆ g₁.support ∪ g₂.support

def Qq.matchFinsupp E1 #

{u : Lean.Level} →
  (α : Q(Type u)) →
    Lean.MetaM
      (Option
        ((uX : Lean.Level) ×
          (uR : Lean.Level) ×
            (X : Q(Type uX)) ×
              (R : Q(Type uR)) × (instZero : Q(Zero «$R»)) ×' (_ : u =QL (max uX uR)) ×' «$α» =Q («$X» →₀ «$R»)))

Match a type α : Type u against X →₀ R, returning X and R along with proofs that u = max uX uR and α = (X →₀ R).

Qq cannot match α against ~q($X →₀ $R) directly, since that needs solving the universe constraint u =?= max ?uX ?uR, so we introduce the level metavariables by hand.

Deprecated aliases

NameNew nameSince
Finsupp.embDomain_notin_rangeFinsupp.embDomain_of_notMem_range2026-07-15