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

20 declarations. Mathlib docs · Source

cons and tail for maps Fin n →₀ M

We interpret maps Fin n →₀ M as n-tuples of elements of M. We define the following operations:

  • Finsupp.tail : the tail of a map Fin (n + 1) →₀ M, i.e., its last n entries;
  • Finsupp.cons : adding an element at the beginning of an n-tuple, to get an n + 1-tuple;

In this context, we prove some usual properties of tail and cons, analogous to those of Data.Fin.Tuple.Basic.

def Finsupp.tail E1 #

{n : ℕ} → {M : Type u_1} → [inst : Zero M] → (Fin (n + 1) →₀ M) → Fin n →₀ M

tail for maps Fin (n + 1) →₀ M. See Fin.tail for more details.

def Finsupp.cons E1 #

{n : ℕ} → {M : Type u_1} → [inst : Zero M] → M → (Fin n →₀ M) → Fin (n + 1) →₀ M

cons for maps Fin n →₀ M. See Fin.cons for more details.

theorem Finsupp.tail_apply E0 #

∀ {n : ℕ} (i : Fin n) {M : Type u_1} [inst : Zero M] (t : Fin (n + 1) →₀ M), t.tail i = t i.succ

theorem Finsupp.cons_zero E0 #

∀ {n : ℕ} {M : Type u_1} [inst : Zero M] (y : M) (s : Fin n →₀ M), (Finsupp.cons y s) 0 = y

theorem Finsupp.cons_succ E0 #

∀ {n : ℕ} (i : Fin n) {M : Type u_1} [inst : Zero M] (y : M) (s : Fin n →₀ M), (Finsupp.cons y s) i.succ = s i

theorem Finsupp.tail_cons E0 #

∀ {n : ℕ} {M : Type u_1} [inst : Zero M] (y : M) (s : Fin n →₀ M), (Finsupp.cons y s).tail = s

theorem Finsupp.tail_update_zero E0 #

∀ {n : ℕ} {M : Type u_1} [inst : Zero M] (y : M) (t : Fin (n + 1) →₀ M), (t.update 0 y).tail = t.tail

theorem Finsupp.tail_update_succ E0 #

∀ {n : ℕ} (i : Fin n) {M : Type u_1} [inst : Zero M] (y : M) (t : Fin (n + 1) →₀ M),
  (t.update i.succ y).tail = t.tail.update i y

theorem Finsupp.cons_tail E0 #

∀ {n : ℕ} {M : Type u_1} [inst : Zero M] (t : Fin (n + 1) →₀ M), Finsupp.cons (t 0) t.tail = t

theorem Finsupp.cons_zero_eq_single_zero E1 #

∀ {n : ℕ} {M : Type u_1} [inst : Zero M] (y : M), Finsupp.cons y 0 = fun₀ | 0 => y

theorem Finsupp.cons_zero_single_eq_single_succ E1 #

∀ {n : ℕ} (i : Fin n) {M : Type u_1} [inst : Zero M] (y : M), (Finsupp.cons 0 fun₀ | i => y) = fun₀ | i.succ => y

theorem Finsupp.cons_zero_zero E0 #

∀ {n : ℕ} {M : Type u_1} [inst : Zero M], Finsupp.cons 0 0 = 0

theorem Finsupp.cons_ne_zero_of_left E1 #

∀ {n : ℕ} {M : Type u_1} [inst : Zero M] {y : M} {s : Fin n →₀ M}, y ≠ 0 → Finsupp.cons y s ≠ 0

theorem Finsupp.cons_ne_zero_of_right E1 #

∀ {n : ℕ} {M : Type u_1} [inst : Zero M] {y : M} {s : Fin n →₀ M}, s ≠ 0 → Finsupp.cons y s ≠ 0

theorem Finsupp.cons_ne_zero_iff E0 #

∀ {n : ℕ} {M : Type u_1} [inst : Zero M] {y : M} {s : Fin n →₀ M}, Finsupp.cons y s ≠ 0 ↔ y ≠ 0 ∨ s ≠ 0

theorem Finsupp.cons_support E1 #

∀ {n : ℕ} {M : Type u_1} [inst : Zero M] {y : M} {s : Fin n →₀ M},
  (Finsupp.cons y s).support ⊆ insert 0 (Finset.map (Fin.succEmb n) s.support)

theorem Finsupp.cons_right_injective E1 #

∀ {n : ℕ} {M : Type u_1} [inst : Zero M] (y : M), Function.Injective (Finsupp.cons y)

theorem Finsupp.cons_injective2 E1 #

∀ {n : ℕ} {M : Type u_1} [inst : Zero M], Function.Injective2 Finsupp.cons

As a binary function, Finsupp.cons is injective.

theorem Finsupp.cons_eq_single_zero_iff E0 #

∀ {n : ℕ} {M : Type u_1} [inst : Zero M] {y : M} {s : Fin n →₀ M} {x : M},
  (Finsupp.cons x s = fun₀ | 0 => y) ↔ s = 0 ∧ x = y

theorem Finsupp.cons_eq_single_succ_iff E0 #

∀ {n : ℕ} (i : Fin n) {M : Type u_1} [inst : Zero M] {y : M} {s : Fin n →₀ M} {x : M},
  (Finsupp.cons x s = fun₀ | i.succ => y) ↔ (s = fun₀ | i => y) ∧ x = 0