File: Mathlib/Data/Vector3.lean

full_name: Vector3
code: /-- Alternate definition of `Vector` based on `Fin2`. -/
def Vector3 (α : Type u) (n : ℕ) : Type u 
goal: Type u

full_name: instInhabitedVector3
code: instance [Inhabited α] : Inhabited (Vector3 α n) 
goal: Inhabited (Vector3 α n)

full_name: Vector3.nil
code: /-- The empty vector -/
@[match_pattern]
def nil : Vector3 α 0 
goal: Vector3 α 0

full_name: Vector3.cons
code: /-- The vector cons operation -/
@[match_pattern]
def cons (a : α) (v : Vector3 α n) : Vector3 α (n + 1) 
goal: Vector3 α (n + 1)

full_name: Vector3.«_aux_Mathlib_Data_Vector3___macroRules_term[_]_1»
code: macro_rules | `([$l,*]) => `(expand_foldr% (h t => cons h t) nil [$(.ofElems l),*])
goal: Lean.Macro

full_name: Vector3.unexpandNil
code: @[app_unexpander Vector3.nil] def unexpandNil : Lean.PrettyPrinter.Unexpander
  
goal: Lean.PrettyPrinter.Unexpander

full_name: Vector3.unexpandCons
code: @[app_unexpander Vector3.cons] def unexpandCons : Lean.PrettyPrinter.Unexpander
  
goal: Lean.PrettyPrinter.Unexpander

full_name: Vector3.«_aux_Mathlib_Data_Vector3___macroRules_Vector3_term_::__1»
code: @[inherit_doc]
scoped notation a " :: " b => cons a b
goal: Lean.Macro

full_name: Vector3._aux_Mathlib_Data_Vector3___unexpand_Vector3_cons_1
code: @[inherit_doc]
scoped notation a " :: " b => cons a b
goal: Lean.PrettyPrinter.Unexpander

full_name: Vector3.cons_fz
code: @[simp]
theorem cons_fz (a : α) (v : Vector3 α n) : (a :: v) fz = a 
goal: Vector3.cons a v Fin2.fz = a

full_name: Vector3.cons_fs
code: @[simp]
theorem cons_fs (a : α) (v : Vector3 α n) (i) : (a :: v) (fs i) = v i 
goal: Vector3.cons a v i.fs = v i

full_name: Vector3.nth
code: /-- Get the `i`th element of a vector -/
abbrev nth (i : Fin2 n) (v : Vector3 α n) : α 
goal: α

full_name: Vector3.ofFn
code: /-- Construct a vector from a function on `Fin2`. -/
abbrev ofFn (f : Fin2 n → α) : Vector3 α n 
goal: Vector3 α n

full_name: Vector3.head
code: /-- Get the head of a nonempty vector. -/
def head (v : Vector3 α (n + 1)) : α 
goal: α

full_name: Vector3.tail
code: /-- Get the tail of a nonempty vector. -/
def tail (v : Vector3 α (n + 1)) : Vector3 α n 
goal: Vector3 α n

full_name: Vector3.eq_nil
code: theorem eq_nil (v : Vector3 α 0) : v = [] 
goal: v = []

full_name: Vector3.cons_head_tail
code: theorem cons_head_tail (v : Vector3 α (n + 1)) : (head v :: tail v) = v 
goal: Vector3.cons v.head v.tail = v

full_name: Vector3.nilElim
code: /-- Eliminator for an empty vector. -/
@[elab_as_elim]  -- Porting note: add `elab_as_elim`
def nilElim {C : Vector3 α 0 → Sort u} (H : C []) (v : Vector3 α 0) : C v 
goal: C v

full_name: Vector3.consElim
code: /-- Recursion principle for a nonempty vector. -/
@[elab_as_elim]  -- Porting note: add `elab_as_elim`
def consElim {C : Vector3 α (n + 1) → Sort u} (H : ∀ (a : α) (t : Vector3 α n), C (a :: t))
    (v : Vector3 α (n + 1)) : C v 
goal: C v

full_name: Vector3.consElim_cons
code: @[simp]
theorem consElim_cons {C H a t} : @consElim α n C H (a :: t) = H a t 
goal: Vector3.consElim H (Vector3.cons a t) = H a t

full_name: Vector3.recOn
code: /-- Recursion principle with the vector as first argument. -/
@[elab_as_elim]
protected def recOn {C : ∀ {n}, Vector3 α n → Sort u} {n} (v : Vector3 α n) (H0 : C [])
    (Hs : ∀ {n} (a) (w : Vector3 α n), C w → C (a :: w)) : C v 
goal: C v

full_name: Vector3.recOn_nil
code: @[simp]
theorem recOn_nil {C H0 Hs} : @Vector3.recOn α (@C) 0 [] H0 @Hs = H0 
goal: [].recOn H0 Hs = H0

full_name: Vector3.recOn_cons
code: @[simp]
theorem recOn_cons {C H0 Hs n a v} :
    @Vector3.recOn α (@C) (n + 1) (a :: v) H0 @Hs = Hs a v (@Vector3.recOn α (@C) n v H0 @Hs) 
goal: (Vector3.cons a v).recOn H0 Hs = Hs a v (v.recOn H0 Hs)

full_name: Vector3.append
code: /-- Append two vectors -/
def append (v : Vector3 α m) (w : Vector3 α n) : Vector3 α (n + m) 
goal: Vector3 α (n + m)

full_name: Vector3.«_aux_Mathlib_Data_Vector3___macroRules_Vector3_term_+-+__1»
code: /--
A local infix notation for `Vector3.append`
-/
local infixl:65 " +-+ " => Vector3.append
goal: Lean.Macro

full_name: Vector3._aux_Mathlib_Data_Vector3___unexpand_Vector3_append_1
code: /--
A local infix notation for `Vector3.append`
-/
local infixl:65 " +-+ " => Vector3.append
goal: Lean.PrettyPrinter.Unexpander

full_name: Vector3.append_nil
code: @[simp]
theorem append_nil (w : Vector3 α n) : [] +-+ w = w 
goal: [].append w = w

full_name: Vector3.append_cons
code: @[simp]
theorem append_cons (a : α) (v : Vector3 α m) (w : Vector3 α n) : (a :: v) +-+ w = a :: v +-+ w 
goal: (Vector3.cons a v).append w = Vector3.cons a (v.append w)

full_name: Vector3.append_left
code: @[simp]
theorem append_left :
    ∀ {m} (i : Fin2 m) (v : Vector3 α m) {n} (w : Vector3 α n), (v +-+ w) (left n i) = v i
  
goal: v.append w (Fin2.left n i) = v i

full_name: Vector3.append_add
code: @[simp]
theorem append_add :
    ∀ {m} (v : Vector3 α m) {n} (w : Vector3 α n) (i : Fin2 n), (v +-+ w) (add i m) = w i
  
goal: v.append w (i.add m) = w i

full_name: Vector3.insert
code: /-- Insert `a` into `v` at index `i`. -/
def insert (a : α) (v : Vector3 α n) (i : Fin2 (n + 1)) : Vector3 α (n + 1) 
goal: Vector3 α (n + 1)

full_name: Vector3.insert_fz
code: @[simp]
theorem insert_fz (a : α) (v : Vector3 α n) : insert a v fz = a :: v 
goal: Vector3.insert a v Fin2.fz = Vector3.cons a v

full_name: Vector3.insert_fs
code: @[simp]
theorem insert_fs (a : α) (b : α) (v : Vector3 α n) (i : Fin2 (n + 1)) :
    insert a (b :: v) (fs i) = b :: insert a v i 
goal: Vector3.insert a (Vector3.cons b v) i.fs = Vector3.cons b (Vector3.insert a v i)

full_name: Vector3.append_insert
code: theorem append_insert (a : α) (t : Vector3 α m) (v : Vector3 α n) (i : Fin2 (n + 1))
    (e : (n + 1) + m = (n + m) + 1) :
    insert a (t +-+ v) (Eq.recOn e (i.add m)) = Eq.recOn e (t +-+ insert a v i) 
goal: Vector3.insert a (t.append v) (Eq.recOn e (i.add m)) = Eq.recOn e (t.append (Vector3.insert a v i))

full_name: VectorEx
code: /-- "Curried" exists, i.e. `∃ x₁ ... xₙ, f [x₁, ..., xₙ]`. -/
def VectorEx : ∀ k, (Vector3 α k → Prop) → Prop
  
goal: (Vector3 α k → Prop) → Prop

full_name: VectorAll
code: /-- "Curried" forall, i.e. `∀ x₁ ... xₙ, f [x₁, ..., xₙ]`. -/
def VectorAll : ∀ k, (Vector3 α k → Prop) → Prop
  
goal: (Vector3 α k → Prop) → Prop

full_name: exists_vector_zero
code: theorem exists_vector_zero (f : Vector3 α 0 → Prop) : Exists f ↔ f [] 
goal: Exists f ↔ f []

full_name: exists_vector_succ
code: theorem exists_vector_succ (f : Vector3 α (succ n) → Prop) : Exists f ↔ ∃ x v, f (x :: v) 
goal: Exists f ↔ ∃ x v, f (Vector3.cons x v)

full_name: vectorEx_iff_exists
code: theorem vectorEx_iff_exists : ∀ {n} (f : Vector3 α n → Prop), VectorEx n f ↔ Exists f
  
goal: VectorEx n f ↔ Exists f

full_name: vectorAll_iff_forall
code: theorem vectorAll_iff_forall : ∀ {n} (f : Vector3 α n → Prop), VectorAll n f ↔ ∀ v, f v
  
goal: VectorAll n f ↔ ∀ (v : Vector3 α n), f v

full_name: VectorAllP
code: /-- `VectorAllP p v` is equivalent to `∀ i, p (v i)`, but unfolds directly to a conjunction,
  i.e. `VectorAllP p [0, 1, 2] = p 0 ∧ p 1 ∧ p 2`. -/
def VectorAllP (p : α → Prop) (v : Vector3 α n) : Prop 
goal: Prop

full_name: vectorAllP_nil
code: @[simp]
theorem vectorAllP_nil (p : α → Prop) : VectorAllP p [] = True 
goal: VectorAllP p [] = True

full_name: vectorAllP_singleton
code: @[simp]
theorem vectorAllP_singleton (p : α → Prop) (x : α) : VectorAllP p (cons x []) = p x 
goal: VectorAllP p [x] = p x

full_name: vectorAllP_cons
code: @[simp]
theorem vectorAllP_cons (p : α → Prop) (x : α) (v : Vector3 α n) :
    VectorAllP p (x :: v) ↔ p x ∧ VectorAllP p v 
goal: VectorAllP p (Vector3.cons x v) ↔ p x ∧ VectorAllP p v

full_name: vectorAllP_iff_forall
code: theorem vectorAllP_iff_forall (p : α → Prop) (v : Vector3 α n) :
    VectorAllP p v ↔ ∀ i, p (v i) 
goal: VectorAllP p v ↔ ∀ (i : Fin2 n), p (v i)

full_name: VectorAllP.imp
code: theorem VectorAllP.imp {p q : α → Prop} (h : ∀ x, p x → q x) {v : Vector3 α n}
    (al : VectorAllP p v) : VectorAllP q v 
goal: VectorAllP q v