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

28 declarations. Mathlib docs · Source

def Finsupp.some E1 #

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

Restrict a finitely supported function on Option α to a finitely supported function on α.

theorem Finsupp.some_apply E0 #

∀ {α : Type u_1} {M : Type u_2} [inst : Zero M] (f : Option α →₀ M) (a : α), f.some a = f (some a)

theorem Finsupp.some_zero E0 #

∀ {α : Type u_1} {M : Type u_2} [inst : Zero M], Finsupp.some 0 = 0

theorem Finsupp.some_add E0 #

∀ {α : Type u_1} {M : Type u_2} [inst : AddZeroClass M] (f g : Option α →₀ M), (f + g).some = f.some + g.some

theorem Finsupp.some_single_none E0 #

∀ {α : Type u_1} {M : Type u_2} [inst : Zero M] (m : M), (fun₀ | none => m).some = 0

theorem Finsupp.some_single_some E0 #

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

theorem Finsupp.some_embDomain_some E0 #

∀ {α : Type u_1} {M : Type u_2} [inst : Zero M] (f : α →₀ M), (Finsupp.embDomain Function.Embedding.some f).some = f

theorem Finsupp.embDomain_some_none E0 #

∀ {α : Type u_1} {M : Type u_2} [inst : Zero M] (f : α →₀ M), (Finsupp.embDomain Function.Embedding.some f) none = 0

theorem Finsupp.embDomain_some_some E0 #

∀ {α : Type u_1} {M : Type u_2} [inst : Zero M] (f : α →₀ M) (x : α),
  (Finsupp.embDomain Function.Embedding.some f) (some x) = f x

theorem Finsupp.some_update_none E0 #

∀ {α : Type u_1} {M : Type u_2} [inst : Zero M] (f : Option α →₀ M) (a : M), (f.update none a).some = f.some

def Finsupp.optionEquiv E1 #

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

Finsupps from Option are equivalent to pairs of an element and a Finsupp on the original type.

theorem Finsupp.optionEquiv_symm_apply E0 #

∀ {α : Type u_1} {M : Type u_2} [inst : Zero M] (P : M × (α →₀ M)),
  Finsupp.optionEquiv.symm P = (Finsupp.embDomain Function.Embedding.some P.2).update none P.1

theorem Finsupp.optionEquiv_apply E0 #

∀ {α : Type u_1} {M : Type u_2} [inst : Zero M] (P : Option α →₀ M), Finsupp.optionEquiv P = (P none, P.some)

def Finsupp.optionElim E1 #

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

Extend a finitely supported function on α to a finitely supported function on Option α, provided a default value for none.

theorem Finsupp.optionElim_apply_none E1 #

∀ {α : Type u_1} {M : Type u_2} [inst : Zero M] (y : M) (f : α →₀ M), (Finsupp.optionElim y f) none = y

theorem Finsupp.optionElim_apply_some E1 #

∀ {α : Type u_1} {M : Type u_2} [inst : Zero M] (y : M) (f : α →₀ M) (x : α), (Finsupp.optionElim y f) (some x) = f x

theorem Finsupp.optionElim_apply_eq_elim E0 #

∀ {α : Type u_1} {M : Type u_2} [inst : Zero M] (y : M) (f : α →₀ M) (a : Option α),
  (Finsupp.optionElim y f) a = a.elim y ⇑f

theorem Finsupp.optionElim_eq_elim' E1 #

∀ {α : Type u_1} {M : Type u_2} [inst : Zero M] (y : M) (f : α →₀ M) (a : Option α),
  (Finsupp.optionElim y f) a = Option.elim' y (⇑f) a

theorem Finsupp.some_optionElim E0 #

∀ {α : Type u_1} {M : Type u_2} [inst : Zero M] (y : M) (f : α →₀ M), (Finsupp.optionElim y f).some = f

theorem Finsupp.optionElim_some E0 #

∀ {α : Type u_1} {M : Type u_2} [inst : Zero M] (f : Option α →₀ M), Finsupp.optionElim (f none) f.some = f

theorem Finsupp.optionElim_zero E0 #

∀ {α : Type u_1} {M : Type u_2} [inst : Zero M] (y : M), Finsupp.optionElim y 0 = fun₀ | none => y

theorem Finsupp.optionElim_ne_zero_of_left E1 #

∀ {α : Type u_1} {M : Type u_2} [inst : Zero M] (y : M) (f : α →₀ M), y ≠ 0 → Finsupp.optionElim y f ≠ 0

theorem Finsupp.optionElim_ne_zero_of_right E1 #

∀ {α : Type u_1} {M : Type u_2} [inst : Zero M] (y : M) (f : α →₀ M), f ≠ 0 → Finsupp.optionElim y f ≠ 0

theorem Finsupp.optionElim_ne_zero_iff E0 #

∀ {α : Type u_1} {M : Type u_2} [inst : Zero M] (y : M) (f : α →₀ M), Finsupp.optionElim y f ≠ 0 ↔ f ≠ 0 ∨ y ≠ 0

theorem Finsupp.prod_option_index E1 #

∀ {α : Type u_1} {M : Type u_2} {N : Type u_3} [inst : AddZeroClass M] [inst_1 : CommMonoid N] (f : Option α →₀ M)
  (b : Option α → M → N),
  (∀ (o : Option α), b o 0 = 1) →
    (∀ (o : Option α) (m₁ 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 (some a)

theorem Finsupp.sum_option_index E1 #

∀ {α : Type u_1} {M : Type u_2} {N : Type u_3} [inst : AddZeroClass M] [inst_1 : AddCommMonoid N] (f : Option α →₀ M)
  (b : Option α → M → N),
  (∀ (o : Option α), b o 0 = 0) →
    (∀ (o : Option α) (m₁ m₂ : M), b o (m₁ + m₂) = b o m₁ + b o m₂) →
      f.sum b = b none (f none) + f.some.sum fun a ↦ b (some a)

theorem Finsupp.sum_option_index_smul E1 #

∀ {α : Type u_1} {M : Type u_2} {R : Type u_4} [inst : Semiring R] [inst_1 : AddCommMonoid M] [inst_2 : 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 (some a)

theorem Finsupp.optionElim_add E0 #

∀ {α : Type u_1} {M : Type u_2} [inst : AddZeroClass M] (a b : α →₀ M) (i j : M),
  Finsupp.optionElim (i + j) (a + b) = Finsupp.optionElim i a + Finsupp.optionElim j b