l3lab/ntp-mathlib huggingface dataset:
@[simp, nolint unusedHavesSuffices] -- Porting note: false positive
theorem list_ofNat_succ (v : ℕ) :
    ofNat (List α) (succ v) = ofNat α v.unpair.1 :: ofNat (List α) v.unpair.2 :=
  ofNat_of_decode <|
    show decodeList (succ v) = _ by
      

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : Denumerable α
inst✝ : Denumerable β
v : ℕ
⊢ decodeList (succ v) = some (ofNat α (unpair v).1 :: ofNat (List α) (unpair v).2)

Next tactic:
cases' e : unpair v with v₁ v₂
@[simp, nolint unusedHavesSuffices] -- Porting note: false positive
theorem list_ofNat_succ (v : ℕ) :
    ofNat (List α) (succ v) = ofNat α v.unpair.1 :: ofNat (List α) v.unpair.2 :=
  ofNat_of_decode <|
    show decodeList (succ v) = _ by
      cases' e : unpair v with v₁ v₂
      

Proof state:
case mk
α : Type u_1
β : Type u_2
inst✝¹ : Denumerable α
inst✝ : Denumerable β
v v₁ v₂ : ℕ
e : unpair v = (v₁, v₂)
⊢ decodeList (succ v) = some (ofNat α (v₁, v₂).1 :: ofNat (List α) (v₁, v₂).2)

Next tactic:
simp [decodeList, e]
@[simp, nolint unusedHavesSuffices] -- Porting note: false positive
theorem list_ofNat_succ (v : ℕ) :
    ofNat (List α) (succ v) = ofNat α v.unpair.1 :: ofNat (List α) v.unpair.2 :=
  ofNat_of_decode <|
    show decodeList (succ v) = _ by
      cases' e : unpair v with v₁ v₂
      simp [decodeList, e]
      

Proof state:
case mk
α : Type u_1
β : Type u_2
inst✝¹ : Denumerable α
inst✝ : Denumerable β
v v₁ v₂ : ℕ
e : unpair v = (v₁, v₂)
⊢ (Seq.seq (some fun x => ofNat α v₁ :: x) fun x => decodeList v₂) = some (ofNat α v₁ :: ofNat (List α) v₂)

Next tactic:
rw [show decodeList v₂ = decode (α := List α) v₂ from rfl, decode_eq_ofNat, Option.seq_some,
        Option.some.injEq]
theorem lower_raise : ∀ l n, lower (raise l n) n = l
  | [], n => rfl
  | m :: l, n => by 

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : Denumerable α
inst✝ : Denumerable β
m : ℕ
l : List ℕ
n : ℕ
⊢ lower (raise (m :: l) n) n = m :: l

Next tactic:
rw [raise, lower, add_tsub_cancel_right, lower_raise l]
theorem raise_lower : ∀ {l n}, List.Sorted (· ≤ ·) (n :: l) → raise (lower l n) n = l
  | [], n, _ => rfl
  | m :: l, n, h => by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : Denumerable α
inst✝ : Denumerable β
m : ℕ
l : List ℕ
n : ℕ
h : Sorted (fun x x_1 => x ≤ x_1) (n :: m :: l)
⊢ raise (lower (m :: l) n) n = m :: l

Next tactic:
have : n ≤ m := List.rel_of_sorted_cons h _ (l.mem_cons_self _)
theorem raise_lower : ∀ {l n}, List.Sorted (· ≤ ·) (n :: l) → raise (lower l n) n = l
  | [], n, _ => rfl
  | m :: l, n, h => by
    have : n ≤ m := List.rel_of_sorted_cons h _ (l.mem_cons_self _)
    

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : Denumerable α
inst✝ : Denumerable β
m : ℕ
l : List ℕ
n : ℕ
h : Sorted (fun x x_1 => x ≤ x_1) (n :: m :: l)
this : n ≤ m
⊢ raise (lower (m :: l) n) n = m :: l

Next tactic:
simp [raise, lower, tsub_add_cancel_of_le this, raise_lower h.of_cons]
/-- If `α` is denumerable, then so is `Multiset α`. Warning: this is *not* the same encoding as used
in `Multiset.encodable`. -/
instance multiset : Denumerable (Multiset α) :=
  mk'
    ⟨fun s : Multiset α => encode <| lower ((s.map encode).sort (· ≤ ·)) 0,
     fun n =>
      Multiset.map (ofNat α) (raise (ofNat (List ℕ) n) 0),
     fun s => by
      

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : Denumerable α
inst✝ : Denumerable β
s : Multiset α
⊢ (fun n => Multiset.map (ofNat α) ↑(raise (ofNat (List ℕ) n) 0))
      ((fun s => encode (lower (Multiset.sort (fun x x_1 => x ≤ x_1) (Multiset.map encode s)) 0)) s) =
    s

Next tactic:
have :=
        raise_lower (List.sorted_cons.2 ⟨fun n _ => Nat.zero_le n, (s.map encode).sort_sorted _⟩)
/-- If `α` is denumerable, then so is `Multiset α`. Warning: this is *not* the same encoding as used
in `Multiset.encodable`. -/
instance multiset : Denumerable (Multiset α) :=
  mk'
    ⟨fun s : Multiset α => encode <| lower ((s.map encode).sort (· ≤ ·)) 0,
     fun n =>
      Multiset.map (ofNat α) (raise (ofNat (List ℕ) n) 0),
     fun s => by
      have :=
        raise_lower (List.sorted_cons.2 ⟨fun n _ => Nat.zero_le n, (s.map encode).sort_sorted _⟩)
      

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : Denumerable α
inst✝ : Denumerable β
s : Multiset α
this :
  raise (lower (Multiset.sort (fun x x_1 => x ≤ x_1) (Multiset.map encode s)) 0) 0 =
    Multiset.sort (fun x x_1 => x ≤ x_1) (Multiset.map encode s)
⊢ (fun n => Multiset.map (ofNat α) ↑(raise (ofNat (List ℕ) n) 0))
      ((fun s => encode (lower (Multiset.sort (fun x x_1 => x ≤ x_1) (Multiset.map encode s)) 0)) s) =
    s

Next tactic:
simp [-Multiset.coe_map, this]
/-- If `α` is denumerable, then so is `Multiset α`. Warning: this is *not* the same encoding as used
in `Multiset.encodable`. -/
instance multiset : Denumerable (Multiset α) :=
  mk'
    ⟨fun s : Multiset α => encode <| lower ((s.map encode).sort (· ≤ ·)) 0,
     fun n =>
      Multiset.map (ofNat α) (raise (ofNat (List ℕ) n) 0),
     fun s => by
      have :=
        raise_lower (List.sorted_cons.2 ⟨fun n _ => Nat.zero_le n, (s.map encode).sort_sorted _⟩)
      simp [-Multiset.coe_map, this],
     fun n => by
      

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : Denumerable α
inst✝ : Denumerable β
n : ℕ
⊢ (fun s => encode (lower (Multiset.sort (fun x x_1 => x ≤ x_1) (Multiset.map encode s)) 0))
      ((fun n => Multiset.map (ofNat α) ↑(raise (ofNat (List ℕ) n) 0)) n) =
    n

Next tactic:
simp [-Multiset.coe_map, List.mergeSort_eq_self _ (raise_sorted _ _), lower_raise]
theorem lower_raise' : ∀ l n, lower' (raise' l n) n = l
  | [], n => rfl
  | m :: l, n => by 

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : Denumerable α
inst✝ : Denumerable β
m : ℕ
l : List ℕ
n : ℕ
⊢ lower' (raise' (m :: l) n) n = m :: l

Next tactic:
simp [raise', lower', add_tsub_cancel_right, lower_raise']
theorem raise_lower' : ∀ {l n}, (∀ m ∈ l, n ≤ m) → List.Sorted (· < ·) l → raise' (lower' l n) n = l
  | [], n, _, _ => rfl
  | m :: l, n, h₁, h₂ => by
    

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : Denumerable α
inst✝ : Denumerable β
m : ℕ
l : List ℕ
n : ℕ
h₁ : ∀ m_1 ∈ m :: l, n ≤ m_1
h₂ : Sorted (fun x x_1 => x < x_1) (m :: l)
⊢ raise' (lower' (m :: l) n) n = m :: l

Next tactic:
have : n ≤ m := h₁ _ (l.mem_cons_self _)
theorem raise_lower' : ∀ {l n}, (∀ m ∈ l, n ≤ m) → List.Sorted (· < ·) l → raise' (lower' l n) n = l
  | [], n, _, _ => rfl
  | m :: l, n, h₁, h₂ => by
    have : n ≤ m := h₁ _ (l.mem_cons_self _)
    

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : Denumerable α
inst✝ : Denumerable β
m : ℕ
l : List ℕ
n : ℕ
h₁ : ∀ m_1 ∈ m :: l, n ≤ m_1
h₂ : Sorted (fun x x_1 => x < x_1) (m :: l)
this : n ≤ m
⊢ raise' (lower' (m :: l) n) n = m :: l

Next tactic:
simp [raise', lower', tsub_add_cancel_of_le this,
      raise_lower' (List.rel_of_sorted_cons h₂ : ∀ a ∈ l, m < a) h₂.of_cons]
/-- If `α` is denumerable, then so is `Finset α`. Warning: this is *not* the same encoding as used
in `Finset.encodable`. -/
instance finset : Denumerable (Finset α) :=
  mk'
    ⟨fun s : Finset α => encode <| lower' ((s.map (eqv α).toEmbedding).sort (· ≤ ·)) 0, fun n =>
      Finset.map (eqv α).symm.toEmbedding (raise'Finset (ofNat (List ℕ) n) 0), fun s =>
      Finset.eq_of_veq <| by
        

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : Denumerable α
inst✝ : Denumerable β
s : Finset α
⊢ ((fun n => Finset.map (Equiv.toEmbedding (eqv α).symm) (raise'Finset (ofNat (List ℕ) n) 0))
        ((fun s => encode (lower' (Finset.sort (fun x x_1 => x ≤ x_1) (Finset.map (Equiv.toEmbedding (eqv α)) s)) 0))
          s)).val =
    s.val

Next tactic:
simp [-Multiset.coe_map, raise'Finset,
          raise_lower' (fun n _ => Nat.zero_le n) (Finset.sort_sorted_lt _)]
/-- If `α` is denumerable, then so is `Finset α`. Warning: this is *not* the same encoding as used
in `Finset.encodable`. -/
instance finset : Denumerable (Finset α) :=
  mk'
    ⟨fun s : Finset α => encode <| lower' ((s.map (eqv α).toEmbedding).sort (· ≤ ·)) 0, fun n =>
      Finset.map (eqv α).symm.toEmbedding (raise'Finset (ofNat (List ℕ) n) 0), fun s =>
      Finset.eq_of_veq <| by
        simp [-Multiset.coe_map, raise'Finset,
          raise_lower' (fun n _ => Nat.zero_le n) (Finset.sort_sorted_lt _)],
      fun n => by
      

Proof state:
α : Type u_1
β : Type u_2
inst✝¹ : Denumerable α
inst✝ : Denumerable β
n : ℕ
⊢ (fun s => encode (lower' (Finset.sort (fun x x_1 => x ≤ x_1) (Finset.map (Equiv.toEmbedding (eqv α)) s)) 0))
      ((fun n => Finset.map (Equiv.toEmbedding (eqv α).symm) (raise'Finset (ofNat (List ℕ) n) 0)) n) =
    n

Next tactic:
simp [-Multiset.coe_map, Finset.map, raise'Finset, Finset.sort,
        List.mergeSort_eq_self (· ≤ ·) ((raise'_sorted _ _).imp (@le_of_lt _ _)), lower_raise']
/-- The type lists on unit is canonically equivalent to the natural numbers. -/
def listUnitEquiv : List Unit ≃ ℕ where
  toFun := List.length
  invFun n := List.replicate n ()
  left_inv u := List.length_injective (by 

Proof state:
u : List Unit
⊢ length ((fun n => replicate n ()) (length u)) = length u

Next tactic:
simp
@[simp]
theorem cons_val' (v : n' → α) (B : Fin m → n' → α) (i j) :
    vecCons v B i j = vecCons (v j) (fun i => B i j) i := by 

Proof state:
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
v : n' → α
B : Fin m → n' → α
i : Fin (Nat.succ m)
j : n'
⊢ vecCons v B i j = vecCons (v j) (fun i => B i j) i

Next tactic:
refine' Fin.cases _ _ i
@[simp]
theorem cons_val' (v : n' → α) (B : Fin m → n' → α) (i j) :
    vecCons v B i j = vecCons (v j) (fun i => B i j) i := by refine' Fin.cases _ _ i <;> 

Proof state:
case refine'_1
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
v : n' → α
B : Fin m → n' → α
i : Fin (Nat.succ m)
j : n'
⊢ vecCons v B 0 j = vecCons (v j) (fun i => B i j) 0

Next tactic:
simp
@[simp]
theorem cons_val' (v : n' → α) (B : Fin m → n' → α) (i j) :
    vecCons v B i j = vecCons (v j) (fun i => B i j) i := by refine' Fin.cases _ _ i <;> 

Proof state:
case refine'_2
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
v : n' → α
B : Fin m → n' → α
i : Fin (Nat.succ m)
j : n'
⊢ ∀ (i : Fin m), vecCons v B (Fin.succ i) j = vecCons (v j) (fun i => B i j) (Fin.succ i)

Next tactic:
simp
@[simp, nolint simpNF] -- Porting note: LHS does not simplify.
theorem tail_val' (B : Fin m.succ → n' → α) (j : n') :
    (vecTail fun i => B i j) = fun i => vecTail B i j := by
  

Proof state:
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
B : Fin (Nat.succ m) → n' → α
j : n'
⊢ (vecTail fun i => B i j) = fun i => vecTail B i j

Next tactic:
ext
@[simp, nolint simpNF] -- Porting note: LHS does not simplify.
theorem tail_val' (B : Fin m.succ → n' → α) (j : n') :
    (vecTail fun i => B i j) = fun i => vecTail B i j := by
  ext
  

Proof state:
case h
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
B : Fin (Nat.succ m) → n' → α
j : n'
x✝ : Fin m
⊢ vecTail (fun i => B i j) x✝ = vecTail B x✝ j

Next tactic:
simp [vecTail]
@[simp]
theorem cons_dotProduct (x : α) (v : Fin n → α) (w : Fin n.succ → α) :
    dotProduct (vecCons x v) w = x * vecHead w + dotProduct v (vecTail w) := by
  

Proof state:
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
inst✝¹ : AddCommMonoid α
inst✝ : Mul α
x : α
v : Fin n → α
w : Fin (Nat.succ n) → α
⊢ vecCons x v ⬝ᵥ w = x * vecHead w + v ⬝ᵥ vecTail w

Next tactic:
simp [dotProduct, Fin.sum_univ_succ, vecHead, vecTail]
@[simp]
theorem dotProduct_cons (v : Fin n.succ → α) (x : α) (w : Fin n → α) :
    dotProduct v (vecCons x w) = vecHead v * x + dotProduct (vecTail v) w := by
  

Proof state:
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
inst✝¹ : AddCommMonoid α
inst✝ : Mul α
v : Fin (Nat.succ n) → α
x : α
w : Fin n → α
⊢ v ⬝ᵥ vecCons x w = vecHead v * x + vecTail v ⬝ᵥ w

Next tactic:
simp [dotProduct, Fin.sum_univ_succ, vecHead, vecTail]
theorem cons_dotProduct_cons (x : α) (v : Fin n → α) (y : α) (w : Fin n → α) :
    dotProduct (vecCons x v) (vecCons y w) = x * y + dotProduct v w := by 

Proof state:
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
inst✝¹ : AddCommMonoid α
inst✝ : Mul α
x : α
v : Fin n → α
y : α
w : Fin n → α
⊢ vecCons x v ⬝ᵥ vecCons y w = x * y + v ⬝ᵥ w

Next tactic:
simp
@[simp]
theorem col_cons (x : α) (u : Fin m → α) : col (vecCons x u) = vecCons (fun _ => x) (col u) := by
  

Proof state:
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
x : α
u : Fin m → α
⊢ col (vecCons x u) = vecCons (fun x_1 => x) (col u)

Next tactic:
ext i j
@[simp]
theorem col_cons (x : α) (u : Fin m → α) : col (vecCons x u) = vecCons (fun _ => x) (col u) := by
  ext i j
  

Proof state:
case a.h
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
x : α
u : Fin m → α
i : Fin (Nat.succ m)
j : Unit
⊢ col (vecCons x u) i j = vecCons (fun x_1 => x) (col u) i j

Next tactic:
refine' Fin.cases _ _ i
@[simp]
theorem col_cons (x : α) (u : Fin m → α) : col (vecCons x u) = vecCons (fun _ => x) (col u) := by
  ext i j
  refine' Fin.cases _ _ i <;> 

Proof state:
case a.h.refine'_1
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
x : α
u : Fin m → α
i : Fin (Nat.succ m)
j : Unit
⊢ col (vecCons x u) 0 j = vecCons (fun x_1 => x) (col u) 0 j

Next tactic:
simp [vecHead, vecTail]
@[simp]
theorem col_cons (x : α) (u : Fin m → α) : col (vecCons x u) = vecCons (fun _ => x) (col u) := by
  ext i j
  refine' Fin.cases _ _ i <;> 

Proof state:
case a.h.refine'_2
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
x : α
u : Fin m → α
i : Fin (Nat.succ m)
j : Unit
⊢ ∀ (i : Fin m), col (vecCons x u) (Fin.succ i) j = vecCons (fun x_1 => x) (col u) (Fin.succ i) j

Next tactic:
simp [vecHead, vecTail]
@[simp]
theorem row_empty : row (vecEmpty : Fin 0 → α) = fun _ => vecEmpty := by
  

Proof state:
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
⊢ row ![] = fun x => ![]

Next tactic:
ext
@[simp]
theorem row_empty : row (vecEmpty : Fin 0 → α) = fun _ => vecEmpty := by
  ext
  

Proof state:
case a.h
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
i✝ : Unit
x✝ : Fin 0
⊢ row ![] i✝ x✝ = ![]

Next tactic:
rfl
@[simp]
theorem row_cons (x : α) (u : Fin m → α) : row (vecCons x u) = fun _ => vecCons x u := by
  

Proof state:
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
x : α
u : Fin m → α
⊢ row (vecCons x u) = fun x_1 => vecCons x u

Next tactic:
ext
@[simp]
theorem row_cons (x : α) (u : Fin m → α) : row (vecCons x u) = fun _ => vecCons x u := by
  ext
  

Proof state:
case a.h
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
x : α
u : Fin m → α
i✝ : Unit
x✝ : Fin (Nat.succ m)
⊢ row (vecCons x u) i✝ x✝ = vecCons x u x✝

Next tactic:
rfl
@[simp]
theorem cons_transpose (v : n' → α) (A : Matrix (Fin m) n' α) :
    (of (vecCons v A))ᵀ = of fun i => vecCons (v i) (Aᵀ i) := by
  

Proof state:
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
v : n' → α
A : Matrix (Fin m) n' α
⊢ (of (vecCons v A))ᵀ = of fun i => vecCons (v i) (Aᵀ i)

Next tactic:
ext i j
@[simp]
theorem cons_transpose (v : n' → α) (A : Matrix (Fin m) n' α) :
    (of (vecCons v A))ᵀ = of fun i => vecCons (v i) (Aᵀ i) := by
  ext i j
  

Proof state:
case a.h
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
v : n' → α
A : Matrix (Fin m) n' α
i : n'
j : Fin (Nat.succ m)
⊢ (of (vecCons v A))ᵀ i j = of (fun i => vecCons (v i) (Aᵀ i)) i j

Next tactic:
refine' Fin.cases _ _ j
@[simp]
theorem cons_transpose (v : n' → α) (A : Matrix (Fin m) n' α) :
    (of (vecCons v A))ᵀ = of fun i => vecCons (v i) (Aᵀ i) := by
  ext i j
  refine' Fin.cases _ _ j <;> 

Proof state:
case a.h.refine'_1
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
v : n' → α
A : Matrix (Fin m) n' α
i : n'
j : Fin (Nat.succ m)
⊢ (of (vecCons v A))ᵀ i 0 = of (fun i => vecCons (v i) (Aᵀ i)) i 0

Next tactic:
simp
@[simp]
theorem cons_transpose (v : n' → α) (A : Matrix (Fin m) n' α) :
    (of (vecCons v A))ᵀ = of fun i => vecCons (v i) (Aᵀ i) := by
  ext i j
  refine' Fin.cases _ _ j <;> 

Proof state:
case a.h.refine'_2
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
v : n' → α
A : Matrix (Fin m) n' α
i : n'
j : Fin (Nat.succ m)
⊢ ∀ (i_1 : Fin m), (of (vecCons v A))ᵀ i (Fin.succ i_1) = of (fun i => vecCons (v i) (Aᵀ i)) i (Fin.succ i_1)

Next tactic:
simp
@[simp]
theorem tail_transpose (A : Matrix m' (Fin n.succ) α) : vecTail (of.symm Aᵀ) = (vecTail ∘ A)ᵀ := by
  

Proof state:
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
A : Matrix m' (Fin (Nat.succ n)) α
⊢ vecTail (of.symm Aᵀ) = (vecTail ∘ A)ᵀ

Next tactic:
ext i j
@[simp]
theorem tail_transpose (A : Matrix m' (Fin n.succ) α) : vecTail (of.symm Aᵀ) = (vecTail ∘ A)ᵀ := by
  ext i j
  

Proof state:
case h.h
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
A : Matrix m' (Fin (Nat.succ n)) α
i : Fin n
j : m'
⊢ vecTail (of.symm Aᵀ) i j = (vecTail ∘ A)ᵀ i j

Next tactic:
rfl
@[simp]
theorem cons_mul [Fintype n'] (v : n' → α) (A : Fin m → n' → α) (B : Matrix n' o' α) :
    of (vecCons v A) * B = of (vecCons (vecMul v B) (of.symm (of A * B))) := by
  

Proof state:
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
inst✝¹ : NonUnitalNonAssocSemiring α
inst✝ : Fintype n'
v : n' → α
A : Fin m → n' → α
B : Matrix n' o' α
⊢ of (vecCons v A) * B = of (vecCons (vecMul v B) (of.symm (of A * B)))

Next tactic:
ext i j
@[simp]
theorem cons_mul [Fintype n'] (v : n' → α) (A : Fin m → n' → α) (B : Matrix n' o' α) :
    of (vecCons v A) * B = of (vecCons (vecMul v B) (of.symm (of A * B))) := by
  ext i j
  

Proof state:
case a.h
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
inst✝¹ : NonUnitalNonAssocSemiring α
inst✝ : Fintype n'
v : n' → α
A : Fin m → n' → α
B : Matrix n' o' α
i : Fin (Nat.succ m)
j : o'
⊢ (of (vecCons v A) * B) i j = of (vecCons (vecMul v B) (of.symm (of A * B))) i j

Next tactic:
refine' Fin.cases _ _ i
@[simp]
theorem cons_mul [Fintype n'] (v : n' → α) (A : Fin m → n' → α) (B : Matrix n' o' α) :
    of (vecCons v A) * B = of (vecCons (vecMul v B) (of.symm (of A * B))) := by
  ext i j
  refine' Fin.cases _ _ i
  · 

Proof state:
case a.h.refine'_1
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
inst✝¹ : NonUnitalNonAssocSemiring α
inst✝ : Fintype n'
v : n' → α
A : Fin m → n' → α
B : Matrix n' o' α
i : Fin (Nat.succ m)
j : o'
⊢ (of (vecCons v A) * B) 0 j = of (vecCons (vecMul v B) (of.symm (of A * B))) 0 j

Next tactic:
rfl
@[simp]
theorem cons_mul [Fintype n'] (v : n' → α) (A : Fin m → n' → α) (B : Matrix n' o' α) :
    of (vecCons v A) * B = of (vecCons (vecMul v B) (of.symm (of A * B))) := by
  ext i j
  refine' Fin.cases _ _ i
  · rfl
  

Proof state:
case a.h.refine'_2
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
inst✝¹ : NonUnitalNonAssocSemiring α
inst✝ : Fintype n'
v : n' → α
A : Fin m → n' → α
B : Matrix n' o' α
i : Fin (Nat.succ m)
j : o'
⊢ ∀ (i : Fin m), (of (vecCons v A) * B) (Fin.succ i) j = of (vecCons (vecMul v B) (of.symm (of A * B))) (Fin.succ i) j

Next tactic:
simp [mul_val_succ]
@[simp]
theorem cons_vecMul (x : α) (v : Fin n → α) (B : Fin n.succ → o' → α) :
    vecMul (vecCons x v) (of B) = x • vecHead B + vecMul v (of <| vecTail B) := by
  

Proof state:
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
inst✝ : NonUnitalNonAssocSemiring α
x : α
v : Fin n → α
B : Fin (Nat.succ n) → o' → α
⊢ vecMul (vecCons x v) (of B) = x • vecHead B + vecMul v (of (vecTail B))

Next tactic:
ext i
@[simp]
theorem cons_vecMul (x : α) (v : Fin n → α) (B : Fin n.succ → o' → α) :
    vecMul (vecCons x v) (of B) = x • vecHead B + vecMul v (of <| vecTail B) := by
  ext i
  

Proof state:
case h
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
inst✝ : NonUnitalNonAssocSemiring α
x : α
v : Fin n → α
B : Fin (Nat.succ n) → o' → α
i : o'
⊢ vecMul (vecCons x v) (of B) i = (x • vecHead B + vecMul v (of (vecTail B))) i

Next tactic:
simp [vecMul]
@[simp]
theorem vecMul_cons (v : Fin n.succ → α) (w : o' → α) (B : Fin n → o' → α) :
    vecMul v (of <| vecCons w B) = vecHead v • w + vecMul (vecTail v) (of B) := by
  

Proof state:
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
inst✝ : NonUnitalNonAssocSemiring α
v : Fin (Nat.succ n) → α
w : o' → α
B : Fin n → o' → α
⊢ vecMul v (of (vecCons w B)) = vecHead v • w + vecMul (vecTail v) (of B)

Next tactic:
ext i
@[simp]
theorem vecMul_cons (v : Fin n.succ → α) (w : o' → α) (B : Fin n → o' → α) :
    vecMul v (of <| vecCons w B) = vecHead v • w + vecMul (vecTail v) (of B) := by
  ext i
  

Proof state:
case h
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
inst✝ : NonUnitalNonAssocSemiring α
v : Fin (Nat.succ n) → α
w : o' → α
B : Fin n → o' → α
i : o'
⊢ vecMul v (of (vecCons w B)) i = (vecHead v • w + vecMul (vecTail v) (of B)) i

Next tactic:
simp [vecMul]
theorem cons_vecMul_cons (x : α) (v : Fin n → α) (w : o' → α) (B : Fin n → o' → α) :
    vecMul (vecCons x v) (of <| vecCons w B) = x • w + vecMul v (of B) := by 

Proof state:
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
inst✝ : NonUnitalNonAssocSemiring α
x : α
v : Fin n → α
w : o' → α
B : Fin n → o' → α
⊢ vecMul (vecCons x v) (of (vecCons w B)) = x • w + vecMul v (of B)

Next tactic:
simp
@[simp]
theorem cons_mulVec [Fintype n'] (v : n' → α) (A : Fin m → n' → α) (w : n' → α) :
    mulVec (of <| vecCons v A) w = vecCons (dotProduct v w) (mulVec (of A) w) := by
  

Proof state:
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
inst✝¹ : NonUnitalNonAssocSemiring α
inst✝ : Fintype n'
v : n' → α
A : Fin m → n' → α
w : n' → α
⊢ mulVec (of (vecCons v A)) w = vecCons (v ⬝ᵥ w) (mulVec (of A) w)

Next tactic:
ext i
@[simp]
theorem cons_mulVec [Fintype n'] (v : n' → α) (A : Fin m → n' → α) (w : n' → α) :
    mulVec (of <| vecCons v A) w = vecCons (dotProduct v w) (mulVec (of A) w) := by
  ext i
  

Proof state:
case h
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
inst✝¹ : NonUnitalNonAssocSemiring α
inst✝ : Fintype n'
v : n' → α
A : Fin m → n' → α
w : n' → α
i : Fin (Nat.succ m)
⊢ mulVec (of (vecCons v A)) w i = vecCons (v ⬝ᵥ w) (mulVec (of A) w) i

Next tactic:
refine' Fin.cases _ _ i
@[simp]
theorem cons_mulVec [Fintype n'] (v : n' → α) (A : Fin m → n' → α) (w : n' → α) :
    mulVec (of <| vecCons v A) w = vecCons (dotProduct v w) (mulVec (of A) w) := by
  ext i
  refine' Fin.cases _ _ i <;> 

Proof state:
case h.refine'_1
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
inst✝¹ : NonUnitalNonAssocSemiring α
inst✝ : Fintype n'
v : n' → α
A : Fin m → n' → α
w : n' → α
i : Fin (Nat.succ m)
⊢ mulVec (of (vecCons v A)) w 0 = vecCons (v ⬝ᵥ w) (mulVec (of A) w) 0

Next tactic:
simp [mulVec]
@[simp]
theorem cons_mulVec [Fintype n'] (v : n' → α) (A : Fin m → n' → α) (w : n' → α) :
    mulVec (of <| vecCons v A) w = vecCons (dotProduct v w) (mulVec (of A) w) := by
  ext i
  refine' Fin.cases _ _ i <;> 

Proof state:
case h.refine'_2
α : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
inst✝¹ : NonUnitalNonAssocSemiring α
inst✝ : Fintype n'
v : n' → α
A : Fin m → n' → α
w : n' → α
i : Fin (Nat.succ m)
⊢ ∀ (i : Fin m), mulVec (of (vecCons v A)) w (Fin.succ i) = vecCons (v ⬝ᵥ w) (mulVec (of A) w) (Fin.succ i)

Next tactic:
simp [mulVec]
@[simp]
theorem mulVec_cons {α} [CommSemiring α] (A : m' → Fin n.succ → α) (x : α) (v : Fin n → α) :
    mulVec (of A) (vecCons x v) = x • vecHead ∘ A + mulVec (of (vecTail ∘ A)) v := by
  

Proof state:
α✝ : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
inst✝¹ : NonUnitalNonAssocSemiring α✝
α : Type u_1
inst✝ : CommSemiring α
A : m' → Fin (Nat.succ n) → α
x : α
v : Fin n → α
⊢ mulVec (of A) (vecCons x v) = x • vecHead ∘ A + mulVec (of (vecTail ∘ A)) v

Next tactic:
ext i
@[simp]
theorem mulVec_cons {α} [CommSemiring α] (A : m' → Fin n.succ → α) (x : α) (v : Fin n → α) :
    mulVec (of A) (vecCons x v) = x • vecHead ∘ A + mulVec (of (vecTail ∘ A)) v := by
  ext i
  

Proof state:
case h
α✝ : Type u
o n m : ℕ
m' : Type uₘ
n' : Type uₙ
o' : Type uₒ
a b : ℕ
inst✝¹ : NonUnitalNonAssocSemiring α✝
α : Type u_1
inst✝ : CommSemiring α
A : m' → Fin (Nat.succ n) → α
x : α
v : Fin n → α
i : m'
⊢ mulVec (of A) (vecCons x v) i = (x • vecHead ∘ A + mulVec (of (vecTail ∘ A)) v) i

Next tactic:
simp [mulVec, mul_comm]