Documentation

Mathlib.Data.Vector.Basic

Additional theorems and definitions about the Vector type #

This file introduces the infix notation ::ᵥ for Vector.cons.

If a : α and l : Vector α n, then cons a l, is the vector of length n + 1 whose first element is a and with l as the rest of the list.

Equations
Instances For
    Equations
    theorem Mathlib.Vector.toList_injective {n : } {α : Type u_1} :
    Function.Injective Mathlib.Vector.toList
    theorem Mathlib.Vector.ext {n : } {α : Type u_1} {v : Mathlib.Vector α n} {w : Mathlib.Vector α n} :
    (∀ (m : Fin n), v.get m = w.get m)v = w

    Two v w : Vector α n are equal iff they are equal at every single index.

    The empty Vector is a Subsingleton.

    Equations
    • =
    @[simp]
    theorem Mathlib.Vector.cons_val {n : } {α : Type u_1} (a : α) (v : Mathlib.Vector α n) :
    (a ::ᵥ v) = a :: v
    theorem Mathlib.Vector.eq_cons_iff {n : } {α : Type u_1} (a : α) (v : Mathlib.Vector α n.succ) (v' : Mathlib.Vector α n) :
    v = a ::ᵥ v' v.head = a v.tail = v'
    theorem Mathlib.Vector.ne_cons_iff {n : } {α : Type u_1} (a : α) (v : Mathlib.Vector α n.succ) (v' : Mathlib.Vector α n) :
    v a ::ᵥ v' v.head a v.tail v'
    theorem Mathlib.Vector.exists_eq_cons {n : } {α : Type u_1} (v : Mathlib.Vector α n.succ) :
    ∃ (a : α) (as : Mathlib.Vector α n), v = a ::ᵥ as
    @[simp]
    theorem Mathlib.Vector.toList_ofFn {α : Type u_1} {n : } (f : Fin nα) :
    @[simp]
    theorem Mathlib.Vector.mk_toList {n : } {α : Type u_1} (v : Mathlib.Vector α n) (h : v.toList.length = n) :
    v.toList, h = v
    @[simp]
    theorem Mathlib.Vector.length_val {n : } {α : Type u_1} (v : Mathlib.Vector α n) :
    (v).length = n
    @[simp]
    theorem Mathlib.Vector.toList_map {n : } {α : Type u_1} {β : Type u_2} (v : Mathlib.Vector α n) (f : αβ) :
    (Mathlib.Vector.map f v).toList = List.map f v.toList
    @[simp]
    theorem Mathlib.Vector.head_map {n : } {α : Type u_1} {β : Type u_2} (v : Mathlib.Vector α (n + 1)) (f : αβ) :
    (Mathlib.Vector.map f v).head = f v.head
    @[simp]
    theorem Mathlib.Vector.tail_map {n : } {α : Type u_1} {β : Type u_2} (v : Mathlib.Vector α (n + 1)) (f : αβ) :
    theorem Mathlib.Vector.get_eq_get {n : } {α : Type u_1} (v : Mathlib.Vector α n) (i : Fin n) :
    v.get i = v.toList.get (Fin.cast i)
    @[simp]
    theorem Mathlib.Vector.get_replicate {n : } {α : Type u_1} (a : α) (i : Fin n) :
    @[simp]
    theorem Mathlib.Vector.get_map {n : } {α : Type u_1} {β : Type u_2} (v : Mathlib.Vector α n) (f : αβ) (i : Fin n) :
    (Mathlib.Vector.map f v).get i = f (v.get i)
    @[simp]
    theorem Mathlib.Vector.map₂_nil {α : Type u_1} {β : Type u_2} {γ : Type u_3} (f : αβγ) :
    Mathlib.Vector.map₂ f Mathlib.Vector.nil Mathlib.Vector.nil = Mathlib.Vector.nil
    @[simp]
    theorem Mathlib.Vector.map₂_cons {n : } {α : Type u_1} {β : Type u_2} {γ : Type u_3} (hd₁ : α) (tl₁ : Mathlib.Vector α n) (hd₂ : β) (tl₂ : Mathlib.Vector β n) (f : αβγ) :
    Mathlib.Vector.map₂ f (hd₁ ::ᵥ tl₁) (hd₂ ::ᵥ tl₂) = f hd₁ hd₂ ::ᵥ Mathlib.Vector.map₂ f tl₁ tl₂
    @[simp]
    theorem Mathlib.Vector.get_ofFn {α : Type u_1} {n : } (f : Fin nα) (i : Fin n) :
    (Mathlib.Vector.ofFn f).get i = f i
    @[simp]
    theorem Mathlib.Vector.ofFn_get {n : } {α : Type u_1} (v : Mathlib.Vector α n) :
    def Equiv.vectorEquivFin (α : Type u_2) (n : ) :
    Mathlib.Vector α n (Fin nα)

    The natural equivalence between length-n vectors and functions from Fin n.

    Equations
    • Equiv.vectorEquivFin α n = { toFun := Mathlib.Vector.get, invFun := Mathlib.Vector.ofFn, left_inv := , right_inv := }
    Instances For
      theorem Mathlib.Vector.get_tail {n : } {α : Type u_1} (x : Mathlib.Vector α n) (i : Fin (n - 1)) :
      x.tail.get i = x.get i + 1,
      @[simp]
      theorem Mathlib.Vector.get_tail_succ {n : } {α : Type u_1} (v : Mathlib.Vector α n.succ) (i : Fin n) :
      v.tail.get i = v.get i.succ
      @[simp]
      theorem Mathlib.Vector.tail_val {n : } {α : Type u_1} (v : Mathlib.Vector α n.succ) :
      v.tail = (v).tail
      @[simp]
      theorem Mathlib.Vector.tail_nil {α : Type u_1} :
      Mathlib.Vector.nil.tail = Mathlib.Vector.nil

      The tail of a nil vector is nil.

      @[simp]
      theorem Mathlib.Vector.singleton_tail {α : Type u_1} (v : Mathlib.Vector α 1) :
      v.tail = Mathlib.Vector.nil

      The tail of a vector made up of one element is nil.

      @[simp]
      theorem Mathlib.Vector.tail_ofFn {α : Type u_1} {n : } (f : Fin n.succα) :
      (Mathlib.Vector.ofFn f).tail = Mathlib.Vector.ofFn fun (i : Fin n) => f i.succ
      @[simp]
      theorem Mathlib.Vector.toList_empty {α : Type u_1} (v : Mathlib.Vector α 0) :
      v.toList = []
      @[simp]
      theorem Mathlib.Vector.toList_singleton {α : Type u_1} (v : Mathlib.Vector α 1) :
      v.toList = [v.head]

      The list that makes up a Vector made up of a single element, retrieved via toList, is equal to the list of that single element.

      @[simp]
      theorem Mathlib.Vector.empty_toList_eq_ff {n : } {α : Type u_1} (v : Mathlib.Vector α (n + 1)) :
      v.toList.isEmpty = false
      theorem Mathlib.Vector.not_empty_toList {n : } {α : Type u_1} (v : Mathlib.Vector α (n + 1)) :
      ¬v.toList.isEmpty = true
      @[simp]
      theorem Mathlib.Vector.map_id {α : Type u_1} {n : } (v : Mathlib.Vector α n) :

      Mapping under id does not change a vector.

      theorem Mathlib.Vector.nodup_iff_injective_get {n : } {α : Type u_1} {v : Mathlib.Vector α n} :
      v.toList.Nodup Function.Injective v.get
      theorem Mathlib.Vector.head?_toList {n : } {α : Type u_1} (v : Mathlib.Vector α n.succ) :
      v.toList.head? = some v.head
      def Mathlib.Vector.reverse {n : } {α : Type u_1} (v : Mathlib.Vector α n) :

      Reverse a vector.

      Equations
      • v.reverse = v.toList.reverse,
      Instances For
        theorem Mathlib.Vector.toList_reverse {n : } {α : Type u_1} {v : Mathlib.Vector α n} :
        v.reverse.toList = v.toList.reverse

        The List of a vector after a reverse, retrieved by toList is equal to the List.reverse after retrieving a vector's toList.

        @[simp]
        theorem Mathlib.Vector.reverse_reverse {n : } {α : Type u_1} {v : Mathlib.Vector α n} :
        v.reverse.reverse = v
        @[simp]
        theorem Mathlib.Vector.get_zero {n : } {α : Type u_1} (v : Mathlib.Vector α n.succ) :
        v.get 0 = v.head
        @[simp]
        theorem Mathlib.Vector.head_ofFn {α : Type u_1} {n : } (f : Fin n.succα) :
        (Mathlib.Vector.ofFn f).head = f 0
        theorem Mathlib.Vector.get_cons_zero {n : } {α : Type u_1} (a : α) (v : Mathlib.Vector α n) :
        (a ::ᵥ v).get 0 = a
        @[simp]
        theorem Mathlib.Vector.get_cons_nil {α : Type u_1} {ix : Fin 1} (x : α) :
        (x ::ᵥ Mathlib.Vector.nil).get ix = x

        Accessing the nth element of a vector made up of one element x : α is x itself.

        @[simp]
        theorem Mathlib.Vector.get_cons_succ {n : } {α : Type u_1} (a : α) (v : Mathlib.Vector α n) (i : Fin n) :
        (a ::ᵥ v).get i.succ = v.get i
        def Mathlib.Vector.last {n : } {α : Type u_1} (v : Mathlib.Vector α (n + 1)) :
        α

        The last element of a Vector, given that the vector is at least one element.

        Equations
        Instances For
          theorem Mathlib.Vector.last_def {n : } {α : Type u_1} {v : Mathlib.Vector α (n + 1)} :
          v.last = v.get (Fin.last n)

          The last element of a Vector, given that the vector is at least one element.

          theorem Mathlib.Vector.reverse_get_zero {n : } {α : Type u_1} {v : Mathlib.Vector α (n + 1)} :
          v.reverse.head = v.last

          The last element of a vector is the head of the reverse vector.

          def Mathlib.Vector.scanl {n : } {α : Type u_1} {β : Type u_2} (f : βαβ) (b : β) (v : Mathlib.Vector α n) :
          Mathlib.Vector β (n + 1)

          Construct a Vector β (n + 1) from a Vector α n by scanning f : β → α → β from the "left", that is, from 0 to Fin.last n, using b : β as the starting value.

          Equations
          Instances For
            @[simp]
            theorem Mathlib.Vector.scanl_nil {α : Type u_1} {β : Type u_2} (f : βαβ) (b : β) :
            Mathlib.Vector.scanl f b Mathlib.Vector.nil = b ::ᵥ Mathlib.Vector.nil

            Providing an empty vector to scanl gives the starting value b : β.

            @[simp]
            theorem Mathlib.Vector.scanl_cons {n : } {α : Type u_1} {β : Type u_2} (f : βαβ) (b : β) (v : Mathlib.Vector α n) (x : α) :

            The recursive step of scanl splits a vector x ::ᵥ v : Vector α (n + 1) into the provided starting value b : β and the recursed scanl f b x : β as the starting value.

            This lemma is the cons version of scanl_get.

            @[simp]
            theorem Mathlib.Vector.scanl_val {n : } {α : Type u_1} {β : Type u_2} (f : βαβ) (b : β) {v : Mathlib.Vector α n} :
            (Mathlib.Vector.scanl f b v) = List.scanl f b v

            The underlying List of a Vector after a scanl is the List.scanl of the underlying List of the original Vector.

            @[simp]
            theorem Mathlib.Vector.toList_scanl {n : } {α : Type u_1} {β : Type u_2} (f : βαβ) (b : β) (v : Mathlib.Vector α n) :
            (Mathlib.Vector.scanl f b v).toList = List.scanl f b v.toList

            The toList of a Vector after a scanl is the List.scanl of the toList of the original Vector.

            @[simp]
            theorem Mathlib.Vector.scanl_singleton {α : Type u_1} {β : Type u_2} (f : βαβ) (b : β) (v : Mathlib.Vector α 1) :
            Mathlib.Vector.scanl f b v = b ::ᵥ f b v.head ::ᵥ Mathlib.Vector.nil

            The recursive step of scanl splits a vector made up of a single element x ::ᵥ nil : Vector α 1 into a Vector of the provided starting value b : β and the mapped f b x : β as the last value.

            @[simp]
            theorem Mathlib.Vector.scanl_head {n : } {α : Type u_1} {β : Type u_2} (f : βαβ) (b : β) (v : Mathlib.Vector α n) :
            (Mathlib.Vector.scanl f b v).head = b

            The first element of scanl of a vector v : Vector α n, retrieved via head, is the starting value b : β.

            @[simp]
            theorem Mathlib.Vector.scanl_get {n : } {α : Type u_1} {β : Type u_2} (f : βαβ) (b : β) (v : Mathlib.Vector α n) (i : Fin n) :
            (Mathlib.Vector.scanl f b v).get i.succ = f ((Mathlib.Vector.scanl f b v).get i.castSucc) (v.get i)

            For an index i : Fin n, the nth element of scanl of a vector v : Vector α n at i.succ, is equal to the application function f : β → α → β of the castSucc i element of scanl f b v and get v i.

            This lemma is the get version of scanl_cons.

            def Mathlib.Vector.mOfFn {m : Type u → Type u_2} [Monad m] {α : Type u} {n : } :
            (Fin nm α)m (Mathlib.Vector α n)

            Monadic analog of Vector.ofFn. Given a monadic function on Fin n, return a Vector α n inside the monad.

            Equations
            Instances For
              theorem Mathlib.Vector.mOfFn_pure {m : Type u_2 → Type u_3} [Monad m] [LawfulMonad m] {α : Type u_2} {n : } (f : Fin nα) :
              def Mathlib.Vector.mmap {m : Type u → Type u_2} [Monad m] {α : Type u_3} {β : Type u} (f : αm β) {n : } :
              Mathlib.Vector α nm (Mathlib.Vector β n)

              Apply a monadic function to each component of a vector, returning a vector inside the monad.

              Equations
              Instances For
                @[simp]
                theorem Mathlib.Vector.mmap_nil {m : Type u_2 → Type u_3} [Monad m] {α : Type u_4} {β : Type u_2} (f : αm β) :
                Mathlib.Vector.mmap f Mathlib.Vector.nil = pure Mathlib.Vector.nil
                @[simp]
                theorem Mathlib.Vector.mmap_cons {m : Type u_2 → Type u_3} [Monad m] {α : Type u_4} {β : Type u_2} (f : αm β) (a : α) {n : } (v : Mathlib.Vector α n) :
                Mathlib.Vector.mmap f (a ::ᵥ v) = do let h'f a let t'Mathlib.Vector.mmap f v pure (h' ::ᵥ t')
                def Mathlib.Vector.inductionOn {α : Type u_1} {C : {n : } → Mathlib.Vector α nSort u_2} {n : } (v : Mathlib.Vector α n) (nil : C Mathlib.Vector.nil) (cons : {n : } → {x : α} → {w : Mathlib.Vector α n} → C wC (x ::ᵥ w)) :
                C v

                Define C v by induction on v : Vector α n.

                This function has two arguments: nil handles the base case on C nil, and cons defines the inductive step using ∀ x : α, C w → C (x ::ᵥ w).

                It is used as the default induction principle for the induction tactic.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  @[simp]
                  theorem Mathlib.Vector.inductionOn_nil {α : Type u_1} {C : {n : } → Mathlib.Vector α nSort u_2} (nil : C Mathlib.Vector.nil) (cons : {n : } → {x : α} → {w : Mathlib.Vector α n} → C wC (x ::ᵥ w)) :
                  (Mathlib.Vector.nil.inductionOn nil fun {n : } {x : α} {w : Mathlib.Vector α n} => cons) = nil
                  @[simp]
                  theorem Mathlib.Vector.inductionOn_cons {α : Type u_1} {C : {n : } → Mathlib.Vector α nSort u_2} {n : } (x : α) (v : Mathlib.Vector α n) (nil : C Mathlib.Vector.nil) (cons : {n : } → {x : α} → {w : Mathlib.Vector α n} → C wC (x ::ᵥ w)) :
                  ((x ::ᵥ v).inductionOn nil fun {n : } {x : α} {w : Mathlib.Vector α n} => cons) = cons (v.inductionOn nil fun {n : } {x : α} {w : Mathlib.Vector α n} => cons)
                  def Mathlib.Vector.inductionOn₂ {n : } {α : Type u_1} {β : Type u_2} {C : {n : } → Mathlib.Vector α nMathlib.Vector β nSort u_4} (v : Mathlib.Vector α n) (w : Mathlib.Vector β n) (nil : C Mathlib.Vector.nil Mathlib.Vector.nil) (cons : {n : } → {a : α} → {b : β} → {x : Mathlib.Vector α n} → {y : Mathlib.Vector β n} → C x yC (a ::ᵥ x) (b ::ᵥ y)) :
                  C v w

                  Define C v w by induction on a pair of vectors v : Vector α n and w : Vector β n.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    def Mathlib.Vector.inductionOn₃ {n : } {α : Type u_1} {β : Type u_2} {γ : Type u_3} {C : {n : } → Mathlib.Vector α nMathlib.Vector β nMathlib.Vector γ nSort u_4} (u : Mathlib.Vector α n) (v : Mathlib.Vector β n) (w : Mathlib.Vector γ n) (nil : C Mathlib.Vector.nil Mathlib.Vector.nil Mathlib.Vector.nil) (cons : {n : } → {a : α} → {b : β} → {c : γ} → {x : Mathlib.Vector α n} → {y : Mathlib.Vector β n} → {z : Mathlib.Vector γ n} → C x y zC (a ::ᵥ x) (b ::ᵥ y) (c ::ᵥ z)) :
                    C u v w

                    Define C u v w by induction on a triplet of vectors u : Vector α n, v : Vector β n, and w : Vector γ b.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      def Mathlib.Vector.casesOn {α : Type u_1} {m : } {motive : {n : } → Mathlib.Vector α nSort u_4} (v : Mathlib.Vector α m) (nil : motive Mathlib.Vector.nil) (cons : {n : } → (hd : α) → (tl : Mathlib.Vector α n) → motive (hd ::ᵥ tl)) :
                      motive v

                      Define motive v by case-analysis on v : Vector α n.

                      Equations
                      Instances For
                        def Mathlib.Vector.casesOn₂ {α : Type u_1} {β : Type u_2} {m : } {motive : {n : } → Mathlib.Vector α nMathlib.Vector β nSort u_4} (v₁ : Mathlib.Vector α m) (v₂ : Mathlib.Vector β m) (nil : motive Mathlib.Vector.nil Mathlib.Vector.nil) (cons : {n : } → (x : α) → (y : β) → (xs : Mathlib.Vector α n) → (ys : Mathlib.Vector β n) → motive (x ::ᵥ xs) (y ::ᵥ ys)) :
                        motive v₁ v₂

                        Define motive v₁ v₂ by case-analysis on v₁ : Vector α n and v₂ : Vector β n.

                        Equations
                        Instances For
                          def Mathlib.Vector.casesOn₃ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {m : } {motive : {n : } → Mathlib.Vector α nMathlib.Vector β nMathlib.Vector γ nSort u_4} (v₁ : Mathlib.Vector α m) (v₂ : Mathlib.Vector β m) (v₃ : Mathlib.Vector γ m) (nil : motive Mathlib.Vector.nil Mathlib.Vector.nil Mathlib.Vector.nil) (cons : {n : } → (x : α) → (y : β) → (z : γ) → (xs : Mathlib.Vector α n) → (ys : Mathlib.Vector β n) → (zs : Mathlib.Vector γ n) → motive (x ::ᵥ xs) (y ::ᵥ ys) (z ::ᵥ zs)) :
                          motive v₁ v₂ v₃

                          Define motive v₁ v₂ v₃ by case-analysis on v₁ : Vector α n, v₂ : Vector β n, and v₃ : Vector γ n.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            def Mathlib.Vector.toArray {n : } {α : Type u_1} :
                            Mathlib.Vector α nArray α

                            Cast a vector to an array.

                            Equations
                            Instances For
                              def Mathlib.Vector.insertNth {n : } {α : Type u_1} (a : α) (i : Fin (n + 1)) (v : Mathlib.Vector α n) :
                              Mathlib.Vector α (n + 1)

                              v.insertNth a i inserts a into the vector v at position i (and shifting later components to the right).

                              Equations
                              Instances For
                                theorem Mathlib.Vector.insertNth_val {n : } {α : Type u_1} {a : α} {i : Fin (n + 1)} {v : Mathlib.Vector α n} :
                                (Mathlib.Vector.insertNth a i v) = List.insertNth (i) a v
                                @[simp]
                                theorem Mathlib.Vector.eraseIdx_val {n : } {α : Type u_1} {i : Fin n} {v : Mathlib.Vector α n} :
                                (Mathlib.Vector.eraseIdx i v) = (v).eraseIdx i
                                @[deprecated Mathlib.Vector.eraseIdx_val]
                                theorem Mathlib.Vector.removeNth_val {n : } {α : Type u_1} {i : Fin n} {v : Mathlib.Vector α n} :
                                (Mathlib.Vector.eraseIdx i v) = (v).eraseIdx i

                                Alias of Mathlib.Vector.eraseIdx_val.

                                theorem Mathlib.Vector.eraseIdx_insertNth {n : } {α : Type u_1} {a : α} {v : Mathlib.Vector α n} {i : Fin (n + 1)} :
                                @[deprecated Mathlib.Vector.eraseIdx_insertNth]
                                theorem Mathlib.Vector.removeNth_insertNth {n : } {α : Type u_1} {a : α} {v : Mathlib.Vector α n} {i : Fin (n + 1)} :

                                Alias of Mathlib.Vector.eraseIdx_insertNth.

                                theorem Mathlib.Vector.eraseIdx_insertNth' {n : } {α : Type u_1} {a : α} {v : Mathlib.Vector α (n + 1)} {i : Fin (n + 1)} {j : Fin (n + 2)} :
                                @[deprecated Mathlib.Vector.eraseIdx_insertNth']
                                theorem Mathlib.Vector.removeNth_insertNth' {n : } {α : Type u_1} {a : α} {v : Mathlib.Vector α (n + 1)} {i : Fin (n + 1)} {j : Fin (n + 2)} :

                                Alias of Mathlib.Vector.eraseIdx_insertNth'.

                                theorem Mathlib.Vector.insertNth_comm {n : } {α : Type u_1} (a : α) (b : α) (i : Fin (n + 1)) (j : Fin (n + 1)) (h : i j) (v : Mathlib.Vector α n) :
                                def Mathlib.Vector.set {n : } {α : Type u_1} (v : Mathlib.Vector α n) (i : Fin n) (a : α) :

                                set v n a replaces the nth element of v with a.

                                Equations
                                • v.set i a = (v).set (i) a,
                                Instances For
                                  @[simp]
                                  theorem Mathlib.Vector.toList_set {n : } {α : Type u_1} (v : Mathlib.Vector α n) (i : Fin n) (a : α) :
                                  (v.set i a).toList = v.toList.set (i) a
                                  @[simp]
                                  theorem Mathlib.Vector.get_set_same {n : } {α : Type u_1} (v : Mathlib.Vector α n) (i : Fin n) (a : α) :
                                  (v.set i a).get i = a
                                  theorem Mathlib.Vector.get_set_of_ne {n : } {α : Type u_1} {v : Mathlib.Vector α n} {i : Fin n} {j : Fin n} (h : i j) (a : α) :
                                  (v.set i a).get j = v.get j
                                  theorem Mathlib.Vector.get_set_eq_if {n : } {α : Type u_1} {v : Mathlib.Vector α n} {i : Fin n} {j : Fin n} (a : α) :
                                  (v.set i a).get j = if i = j then a else v.get j
                                  theorem Mathlib.Vector.sum_set {n : } {α : Type u_1} [AddMonoid α] (v : Mathlib.Vector α n) (i : Fin n) (a : α) :
                                  (v.set i a).toList.sum = (Mathlib.Vector.take (i) v).toList.sum + a + (Mathlib.Vector.drop (i + 1) v).toList.sum
                                  theorem Mathlib.Vector.prod_set {n : } {α : Type u_1} [Monoid α] (v : Mathlib.Vector α n) (i : Fin n) (a : α) :
                                  (v.set i a).toList.prod = (Mathlib.Vector.take (i) v).toList.prod * a * (Mathlib.Vector.drop (i + 1) v).toList.prod
                                  theorem Mathlib.Vector.sum_set' {n : } {α : Type u_1} [AddCommGroup α] (v : Mathlib.Vector α n) (i : Fin n) (a : α) :
                                  (v.set i a).toList.sum = v.toList.sum + -v.get i + a
                                  theorem Mathlib.Vector.prod_set' {n : } {α : Type u_1} [CommGroup α] (v : Mathlib.Vector α n) (i : Fin n) (a : α) :
                                  (v.set i a).toList.prod = v.toList.prod * (v.get i)⁻¹ * a
                                  def Mathlib.Vector.traverse {n : } {F : Type u → Type u} [Applicative F] {α : Type u} {β : Type u} (f : αF β) :
                                  Mathlib.Vector α nF (Mathlib.Vector β n)

                                  Apply an applicative function to each component of a vector.

                                  Equations
                                  Instances For
                                    @[simp]
                                    theorem Mathlib.Vector.traverse_def {n : } {F : Type u → Type u} [Applicative F] {α : Type u} {β : Type u} (f : αF β) (x : α) (xs : Mathlib.Vector α n) :
                                    Mathlib.Vector.traverse f (x ::ᵥ xs) = Seq.seq (Mathlib.Vector.cons <$> f x) fun (x : Unit) => Mathlib.Vector.traverse f xs
                                    theorem Mathlib.Vector.comp_traverse {n : } {F : Type u → Type u} {G : Type u → Type u} [Applicative F] [Applicative G] [LawfulApplicative G] {α : Type u} {β : Type u} {γ : Type u} (f : βF γ) (g : αG β) (x : Mathlib.Vector α n) :
                                    theorem Mathlib.Vector.traverse_eq_map_id {n : } {α : Type u_1} {β : Type u_1} (f : αβ) (x : Mathlib.Vector α n) :
                                    theorem Mathlib.Vector.naturality {n : } {F : Type u → Type u} {G : Type u → Type u} [Applicative F] [Applicative G] [LawfulApplicative F] [LawfulApplicative G] (η : ApplicativeTransformation F G) {α : Type u} {β : Type u} (f : αF β) (x : Mathlib.Vector α n) :
                                    (fun {α : Type u} => η.app α) (Mathlib.Vector.traverse f x) = Mathlib.Vector.traverse ((fun {α : Type u} => η.app α) f) x
                                    Equations
                                    @[simp]
                                    theorem Mathlib.Vector.replicate_succ {α : Type u_1} {n : } (val : α) :
                                    @[simp]
                                    theorem Mathlib.Vector.get_append_cons_zero {α : Type u_1} {m : } {n : } (xs : Mathlib.Vector α n) (ys : Mathlib.Vector α m) {x : α} :
                                    ((x ::ᵥ xs).append ys).get 0, = x
                                    @[simp]
                                    theorem Mathlib.Vector.get_append_cons_succ {α : Type u_1} {m : } {n : } (xs : Mathlib.Vector α n) (ys : Mathlib.Vector α m) {x : α} {i : Fin (n + m)} {h : i + 1 < n.succ + m} :
                                    ((x ::ᵥ xs).append ys).get i + 1, h = (xs.append ys).get i
                                    @[simp]
                                    theorem Mathlib.Vector.append_nil {α : Type u_1} {n : } (xs : Mathlib.Vector α n) :
                                    xs.append Mathlib.Vector.nil = xs
                                    @[simp]
                                    theorem Mathlib.Vector.get_map₂ {α : Type u_2} {β : Type u_3} {n : } {γ : Type u_1} (v₁ : Mathlib.Vector α n) (v₂ : Mathlib.Vector β n) (f : αβγ) (i : Fin n) :
                                    (Mathlib.Vector.map₂ f v₁ v₂).get i = f (v₁.get i) (v₂.get i)
                                    @[simp]
                                    theorem Mathlib.Vector.mapAccumr_cons {α : Type u_2} {n : } (xs : Mathlib.Vector α n) :
                                    ∀ {α_1 : Type} {β : Type u_1} {f : αα_1α_1 × β} {x : α} {s : α_1}, Mathlib.Vector.mapAccumr f (x ::ᵥ xs) s = let r := Mathlib.Vector.mapAccumr f xs s; let q := f x r.1; (q.1, q.2 ::ᵥ r.2)
                                    @[simp]
                                    theorem Mathlib.Vector.mapAccumr₂_cons {α : Type} {β : Type} {n : } (xs : Mathlib.Vector α n) (ys : Mathlib.Vector β n) :
                                    ∀ {α_1 β_1 : Type} {f : αβα_1α_1 × β_1} {x : α} {y : β} {s : α_1}, Mathlib.Vector.mapAccumr₂ f (x ::ᵥ xs) (y ::ᵥ ys) s = let r := Mathlib.Vector.mapAccumr₂ f xs ys s; let q := f x y r.1; (q.1, q.2 ::ᵥ r.2)