Tuple operations on maps Fin n →₀ M
#
We interpret maps Fin n →₀ M
as n
-tuples of elements of M
, and define the following
operations:
Finsupp.tail
: the tail of a mapFin (n + 1) →₀ M
, i.e., its lastn
entries;Finsupp.init
: the initial of a mapFin n →₀ M
, i.e., its firstn - 1
entries;Finsupp.removeNth
: removing an element at a given entry of a mapFin (n + 1) →₀ M
;Finsupp.cons
: adding an element at the beginning of ann
-tuple, to get ann + 1
-tuple;Finsupp.snoc
: adding an element at the end of ann
-tuple, to get ann + 1
-tuple;Finsupp.insertNth
: adding an element at a given entry of ann
-tuple, to get ann + 1
-tuple.
In this context, we prove some usual properties of these operations, analogous to those of
Data.Fin.Tuple.Basic
.
removeNth
for maps Fin n →₀ M
. See Fin.removeNth
for more details.
Equations
- Finsupp.removeNth p s = Finsupp.equivFunOnFinite.symm (p.removeNth ⇑s)
Instances For
insertNth
for maps Fin n →₀ M
. See Fin.insertNth
for more details.
Equations
- Finsupp.insertNth p y s = Finsupp.equivFunOnFinite.symm (p.insertNth y ⇑s)
Instances For
theorem
Finsupp.snoc_left_injective
{n : ℕ}
{M : Type u_1}
[Zero M]
{y : M}
:
Function.Injective fun (x : Fin n →₀ M) => x.snoc y
theorem
Finsupp.insertNth_right_injective
{n : ℕ}
{M : Type u_1}
[Zero M]
(p : Fin (n + 1))
{y : M}
:
Function.Injective (insertNth p y)