mathlib documentation

core.data.vector

def vector (α : Type u) (n : ) :
Type u

Equations
@[instance]
def vector.decidable_eq {α : Type u} {n : } [decidable_eq α] :

Equations
def vector.nil {α : Type u} :
vector α 0

Equations
def vector.cons {α : Type u} {n : } (a : α) (a_1 : vector α n) :

Equations
def vector.length {α : Type u} {n : } (v : vector α n) :

Equations
def vector.head {α : Type u} {n : } (a : vector α n.succ) :
α

Equations
@[simp]
theorem vector.head_cons {α : Type u} {n : } (a : α) (v : vector α n) :
(a :: v).head = a

def vector.tail {α : Type u} {n : } (a : vector α n) :
vector α (n - 1)

Equations
@[simp]
theorem vector.tail_cons {α : Type u} {n : } (a : α) (v : vector α n) :
(a :: v).tail = v

@[simp]
theorem vector.cons_head_tail {α : Type u} {n : } (v : vector α n.succ) :
v.head :: v.tail = v

def vector.to_list {α : Type u} {n : } (v : vector α n) :
list α

Equations
def vector.nth {α : Type u} {n : } (v : vector α n) (a : fin n) :
α

Equations
def vector.append {α : Type u} {n m : } (a : vector α n) (a_1 : vector α m) :
vector α (n + m)

Equations
def vector.elim {α : Type u_1} {C : Π {n : }, vector α nSort u} (H : Π (l : list α), C l, _⟩) {n : } (v : vector α n) :
C v

Equations
def vector.map {α : Type u} {β : Type v} {n : } (f : α → β) (a : vector α n) :
vector β n

Equations
@[simp]
theorem vector.map_nil {α : Type u} {β : Type v} (f : α → β) :

theorem vector.map_cons {α : Type u} {β : Type v} {n : } (f : α → β) (a : α) (v : vector α n) :
vector.map f (a :: v) = f a :: vector.map f v

def vector.map₂ {α : Type u} {β : Type v} {φ : Type w} {n : } (f : α → β → φ) (a : vector α n) (a_1 : vector β n) :
vector φ n

Equations
def vector.repeat {α : Type u} (a : α) (n : ) :
vector α n

Equations
def vector.drop {α : Type u} {n : } (i : ) (a : vector α n) :
vector α (n - i)

Equations
def vector.take {α : Type u} {n : } (i : ) (a : vector α n) :
vector α (min i n)

Equations
def vector.remove_nth {α : Type u} {n : } (i : fin n) (a : vector α n) :
vector α (n - 1)

Equations
def vector.of_fn {α : Type u} {n : } (a : fin n → α) :
vector α n

Equations
def vector.map_accumr {α : Type u} {β : Type v} {n : } {σ : Type} (f : α → σ → σ × β) (a : vector α n) (a_1 : σ) :
σ × vector β n

Equations
def vector.map_accumr₂ {n : } {α β σ φ : Type} (f : α → β → σ → σ × φ) (a : vector α n) (a_1 : vector β n) (a_2 : σ) :
σ × vector φ n

Equations
theorem vector.eq {α : Type u} {n : } (a1 a2 : vector α n) (a : a1.to_list = a2.to_list) :
a1 = a2

theorem vector.eq_nil {α : Type u} (v : vector α 0) :

@[simp]
theorem vector.to_list_mk {α : Type u} {n : } (v : list α) (P : v.length = n) :

@[simp]
theorem vector.to_list_nil {α : Type u} :

@[simp]
theorem vector.to_list_length {α : Type u} {n : } (v : vector α n) :

@[simp]
theorem vector.to_list_cons {α : Type u} {n : } (a : α) (v : vector α n) :
(a :: v).to_list = a :: v.to_list

@[simp]
theorem vector.to_list_append {α : Type u} {n m : } (v : vector α n) (w : vector α m) :

@[simp]
theorem vector.to_list_drop {α : Type u} {n m : } (v : vector α m) :

@[simp]
theorem vector.to_list_take {α : Type u} {n m : } (v : vector α m) :