Documentation

ArkLib.ToMathlib.Finsupp.Fin

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:

In this context, we prove some usual properties of these operations, analogous to those of Data.Fin.Tuple.Basic.

@[simp]
theorem Fin.prod_insertNth {β : Type u_2} [CommMonoid β] {n : } (x : β) (f : Fin nβ) (p : Fin (n + 1)) :
i : Fin (n + 1), p.insertNth x f i = x * i : Fin n, f i
@[simp]
theorem Fin.sum_insertNth {β : Type u_2} [AddCommMonoid β] {n : } (x : β) (f : Fin nβ) (p : Fin (n + 1)) :
i : Fin (n + 1), p.insertNth x f i = x + i : Fin n, f i
def Finsupp.init {n : } {M : Type u_1} [Zero M] (s : Fin (n + 1) →₀ M) :

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

Equations
    Instances For
      def Finsupp.removeNth {n : } {M : Type u_1} [Zero M] (p : Fin (n + 1)) (s : Fin (n + 1) →₀ M) :

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

      Equations
        Instances For
          def Finsupp.snoc {n : } {M : Type u_1} [Zero M] (s : Fin n →₀ M) (y : M) :
          Fin (n + 1) →₀ M

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

          Equations
            Instances For
              def Finsupp.insertNth {n : } {M : Type u_1} [Zero M] (p : Fin (n + 1)) (y : M) (s : Fin n →₀ M) :
              Fin (n + 1) →₀ M

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

              Equations
                Instances For
                  @[simp]
                  theorem Finsupp.removeNth_apply {n : } {M : Type u_1} [Zero M] (p : Fin (n + 1)) (s : Fin (n + 1) →₀ M) (i : Fin n) :
                  (removeNth p s) i = s (p.succAbove i)
                  @[simp]
                  theorem Finsupp.removeNth_zero {n : } {M : Type u_1} [Zero M] (s : Fin (n + 1) →₀ M) :
                  @[simp]
                  theorem Finsupp.removeNth_last {n : } {M : Type u_1} [Zero M] (s : Fin (n + 1) →₀ M) :
                  @[simp]
                  theorem Finsupp.removeNth_update {n : } {M : Type u_1} [Zero M] (p : Fin (n + 1)) (s : Fin (n + 1) →₀ M) (y : M) :
                  removeNth p (s.update p y) = removeNth p s

                  Updating the i-th entry does not affect removing the i-th entry.

                  @[simp]
                  theorem Finsupp.init_apply {n : } {M : Type u_1} [Zero M] (s : Fin (n + 1) →₀ M) (i : Fin n) :
                  s.init i = s i.castSucc
                  @[simp]
                  theorem Finsupp.init_update_last {n : } {M : Type u_1} [Zero M] (s : Fin (n + 1) →₀ M) (y : M) :
                  (s.update (Fin.last n) y).init = s.init
                  @[simp]
                  theorem Finsupp.init_update_castSucc {n : } {M : Type u_1} [Zero M] (s : Fin (n + 1) →₀ M) (y : M) (i : Fin n) :
                  theorem Finsupp.tail_init_eq_init_tail {n : } {M : Type u_1} [Zero M] (s : Fin (n + 2) →₀ M) :
                  @[simp]
                  theorem Finsupp.snoc_last {n : } {M : Type u_1} [Zero M] (y : M) (s : Fin n →₀ M) :
                  (s.snoc y) (Fin.last n) = y
                  @[simp]
                  theorem Finsupp.snoc_castSucc {n : } {M : Type u_1} [Zero M] (y : M) (s : Fin n →₀ M) (i : Fin n) :
                  (s.snoc y) i.castSucc = s i
                  @[simp]
                  theorem Finsupp.insertNth_zero {n : } {M : Type u_1} [Zero M] (y : M) (s : Fin n →₀ M) :
                  insertNth 0 y s = cons y s
                  @[simp]
                  theorem Finsupp.insertNth_last {n : } {M : Type u_1} [Zero M] (y : M) (s : Fin n →₀ M) :
                  insertNth (Fin.last n) y s = s.snoc y
                  @[simp]
                  theorem Finsupp.insertNth_apply_same {n : } {M : Type u_1} [Zero M] (p : Fin (n + 1)) (y : M) (s : Fin n →₀ M) :
                  (insertNth p y s) p = y
                  @[simp]
                  theorem Finsupp.insertNth_apply_succAbove {n : } {M : Type u_1} [Zero M] (p : Fin (n + 1)) (y : M) (s : Fin n →₀ M) (i : Fin n) :
                  (insertNth p y s) (p.succAbove i) = s i
                  @[simp]
                  theorem Finsupp.init_snoc {n : } {M : Type u_1} [Zero M] (y : M) (s : Fin n →₀ M) :
                  (s.snoc y).init = s
                  @[simp]
                  theorem Finsupp.snoc_init_self {n : } {M : Type u_1} [Zero M] (t : Fin (n + 1) →₀ M) :
                  t.init.snoc (t (Fin.last n)) = t
                  @[simp]
                  theorem Finsupp.insertNth_removeNth {n : } {M : Type u_1} [Zero M] (p : Fin (n + 1)) (y : M) (t : Fin (n + 1) →₀ M) :
                  insertNth p y (removeNth p t) = t.update p y
                  theorem Finsupp.insertNth_self_removeNth {n : } {M : Type u_1} [Zero M] (p : Fin (n + 1)) (t : Fin (n + 1) →₀ M) :
                  insertNth p (t p) (removeNth p t) = t
                  @[simp]
                  theorem Finsupp.snoc_zero_zero {n : } {M : Type u_1} [Zero M] :
                  snoc 0 0 = 0
                  @[simp]
                  theorem Finsupp.insertNth_zero_zero {n : } {M : Type u_1} [Zero M] (p : Fin (n + 1)) :
                  insertNth p 0 0 = 0
                  theorem Finsupp.snoc_ne_zero_of_left {n : } {M : Type u_1} [Zero M] {y : M} {s : Fin n →₀ M} (h : s 0) :
                  s.snoc y 0
                  theorem Finsupp.snoc_ne_zero_of_right {n : } {M : Type u_1} [Zero M] {y : M} {s : Fin n →₀ M} (h : y 0) :
                  s.snoc y 0
                  theorem Finsupp.snoc_ne_zero_iff {n : } {M : Type u_1} [Zero M] {y : M} {s : Fin n →₀ M} :
                  s.snoc y 0 s 0 y 0
                  theorem Finsupp.insertNth_ne_zero_of_left {n : } {M : Type u_1} [Zero M] (p : Fin (n + 1)) {y : M} {s : Fin n →₀ M} (h : y 0) :
                  insertNth p y s 0
                  theorem Finsupp.insertNth_ne_zero_of_right {n : } {M : Type u_1} [Zero M] (p : Fin (n + 1)) {y : M} {s : Fin n →₀ M} (h : s 0) :
                  insertNth p y s 0
                  theorem Finsupp.insertNth_ne_zero_iff {n : } {M : Type u_1} [Zero M] (p : Fin (n + 1)) {y : M} {s : Fin n →₀ M} :
                  insertNth p y s 0 y 0 s 0
                  theorem Finsupp.snoc_support {n : } {M : Type u_1} [Zero M] {y : M} {s : Fin n →₀ M} :
                  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_support {n : } {M : Type u_1} [Zero M] (p : Fin (n + 1)) {y : M} {s : Fin n →₀ M} :
                  theorem Finsupp.insertNth_right_injective {n : } {M : Type u_1} [Zero M] (p : Fin (n + 1)) {y : M} :
                  theorem Finsupp.sum_insertNth {M : Type u_2} [AddCommMonoid M] {n : } (σ : Fin n →₀ M) (i : M) (p : Fin (n + 1)) :
                  ((insertNth p i σ).sum fun (x : Fin (n + 1)) (e : M) => e) = i + σ.sum fun (x : Fin n) (e : M) => e
                  theorem Finsupp.sum_insertNth' {M : Type u_2} {N : Type u_3} [AddCommMonoid M] [AddCommMonoid N] {n : } (σ : Fin n →₀ M) (i : M) (p : Fin (n + 1)) (f : Fin (n + 1)MN) (h : ∀ (x : Fin (n + 1)), f x 0 = 0) :
                  (insertNth p i σ).sum f = f p i + σ.sum (p.removeNth f)