data.matrix.notation
⟷
Mathlib.Data.Matrix.Notation
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
det_eq_sum_mul_adjugate_row
(#19117)
From lean-matrix-cookbook
@@ -314,6 +314,18 @@ empty_eq _
submatrix A (vec_cons i row) col = vec_cons (λ j, A i (col j)) (submatrix A row col) :=
by { ext i j, refine fin.cases _ _ i; simp [submatrix] }
+/-- Updating a row then removing it is the same as removing it. -/
+@[simp] lemma submatrix_update_row_succ_above (A : matrix (fin m.succ) n' α)
+ (v : n' → α) (f : o' → n') (i : fin m.succ) :
+ (A.update_row i v).submatrix i.succ_above f = A.submatrix i.succ_above f :=
+ext $ λ r s, (congr_fun (update_row_ne (fin.succ_above_ne i r) : _ = A _) (f s) : _)
+
+/-- Updating a column then removing it is the same as removing it. -/
+@[simp] lemma submatrix_update_column_succ_above (A : matrix m' (fin n.succ) α)
+ (v : m' → α) (f : o' → m') (i : fin n.succ) :
+ (A.update_column i v).submatrix f i.succ_above = A.submatrix f i.succ_above :=
+ext $ λ r s, update_column_ne (fin.succ_above_ne i s)
+
end submatrix
section vec2_and_vec3
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(first ported)
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,10 +3,10 @@ Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Eric Wieser
-/
-import Mathbin.Data.Matrix.Basic
-import Mathbin.Data.Fin.VecNotation
-import Mathbin.Tactic.FinCases
-import Mathbin.Algebra.BigOperators.Fin
+import Data.Matrix.Basic
+import Data.Fin.VecNotation
+import Tactic.FinCases
+import Algebra.BigOperators.Fin
#align_import data.matrix.notation from "leanprover-community/mathlib"@"a99f85220eaf38f14f94e04699943e185a5e1d1a"
mathlib commit https://github.com/leanprover-community/mathlib/commit/32a7e535287f9c73f2e4d2aef306a39190f0b504
@@ -534,7 +534,7 @@ theorem mul_fin_two [AddCommMonoid α] [Mul α] (a₁₁ a₁₂ a₂₁ a₂₂
a₂₁ * b₁₁ + a₂₂ * b₂₁, a₂₁ * b₁₂ + a₂₂ * b₂₂] :=
by
ext i j
- fin_cases i <;> fin_cases j <;> simp [Matrix.mul, dot_product, Fin.sum_univ_succ]
+ fin_cases i <;> fin_cases j <;> simp [HMul.hMul, dot_product, Fin.sum_univ_succ]
#align matrix.mul_fin_two Matrix.mul_fin_two
-/
@@ -551,7 +551,7 @@ theorem mul_fin_three [AddCommMonoid α] [Mul α]
a₃₁ * b₁₃ + a₃₂ * b₂₃ + a₃₃ * b₃₃] :=
by
ext i j
- fin_cases i <;> fin_cases j <;> simp [Matrix.mul, dot_product, Fin.sum_univ_succ, ← add_assoc]
+ fin_cases i <;> fin_cases j <;> simp [HMul.hMul, dot_product, Fin.sum_univ_succ, ← add_assoc]
#align matrix.mul_fin_three Matrix.mul_fin_three
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,17 +2,14 @@
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Eric Wieser
-
-! This file was ported from Lean 3 source module data.matrix.notation
-! leanprover-community/mathlib commit a99f85220eaf38f14f94e04699943e185a5e1d1a
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Data.Matrix.Basic
import Mathbin.Data.Fin.VecNotation
import Mathbin.Tactic.FinCases
import Mathbin.Algebra.BigOperators.Fin
+#align_import data.matrix.notation from "leanprover-community/mathlib"@"a99f85220eaf38f14f94e04699943e185a5e1d1a"
+
/-!
# Matrix and vector notation
mathlib commit https://github.com/leanprover-community/mathlib/commit/2fe465deb81bcd7ccafa065bb686888a82f15372
@@ -479,7 +479,8 @@ theorem submatrix_cons_row (A : Matrix m' n' α) (i : m') (row : Fin m → m') (
/-- Updating a row then removing it is the same as removing it. -/
@[simp]
theorem submatrix_updateRow_succAbove (A : Matrix (Fin m.succ) n' α) (v : n' → α) (f : o' → n')
- (i : Fin m.succ) : (A.updateRow i v).submatrix i.succAbove f = A.submatrix i.succAbove f :=
+ (i : Fin m.succ) :
+ (A.updateRow i v).submatrix i.succAboveEmb f = A.submatrix i.succAboveEmb f :=
ext fun r s => (congr_fun (updateRow_ne (Fin.succAbove_ne i r) : _ = A _) (f s) : _)
#align matrix.submatrix_update_row_succ_above Matrix.submatrix_updateRow_succAbove
-/
@@ -488,7 +489,8 @@ theorem submatrix_updateRow_succAbove (A : Matrix (Fin m.succ) n' α) (v : n'
/-- Updating a column then removing it is the same as removing it. -/
@[simp]
theorem submatrix_updateColumn_succAbove (A : Matrix m' (Fin n.succ) α) (v : m' → α) (f : o' → m')
- (i : Fin n.succ) : (A.updateColumn i v).submatrix f i.succAbove = A.submatrix f i.succAbove :=
+ (i : Fin n.succ) :
+ (A.updateColumn i v).submatrix f i.succAboveEmb = A.submatrix f i.succAboveEmb :=
ext fun r s => updateColumn_ne (Fin.succAbove_ne i s)
#align matrix.submatrix_update_column_succ_above Matrix.submatrix_updateColumn_succAbove
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/2a0ce625dbb0ffbc7d1316597de0b25c1ec75303
@@ -220,7 +220,7 @@ theorem col_empty (v : Fin 0 → α) : col v = vecEmpty :=
#print Matrix.col_cons /-
@[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 <;> simp [vec_head, vec_tail]
+ ext i j; refine' Fin.cases _ _ i <;> simp [vec_head, vec_tail]
#align matrix.col_cons Matrix.col_cons
-/
@@ -257,7 +257,7 @@ theorem transpose_empty_cols (A : Matrix (Fin 0) m' α) : Aᵀ = of fun i => ![]
#print Matrix.cons_transpose /-
@[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);
+ (of (vecCons v A))ᵀ = of fun i => vecCons (v i) (Aᵀ i) := by ext i j;
refine' Fin.cases _ _ j <;> simp
#align matrix.cons_transpose Matrix.cons_transpose
-/
@@ -273,7 +273,7 @@ theorem head_transpose (A : Matrix m' (Fin n.succ) α) :
#print Matrix.tail_transpose /-
@[simp]
theorem tail_transpose (A : Matrix m' (Fin n.succ) α) : vecTail (of.symm Aᵀ) = (vecTail ∘ A)ᵀ := by
- ext (i j); rfl
+ ext i j; rfl
#align matrix.tail_transpose Matrix.tail_transpose
-/
@@ -315,7 +315,7 @@ theorem mul_val_succ [Fintype n'] (A : Matrix (Fin m.succ) n' α) (B : Matrix n'
#print Matrix.cons_mul /-
@[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);
+ of (vecCons v A) ⬝ B = of (vecCons (vecMul v B) (of.symm (of A ⬝ B))) := by ext i j;
refine' Fin.cases _ _ i; · rfl; simp [mul_val_succ]
#align matrix.cons_mul Matrix.cons_mul
-/
@@ -430,7 +430,7 @@ theorem cons_vecMulVec (x : α) (v : Fin m → α) (w : n' → α) :
#print Matrix.vecMulVec_cons /-
@[simp]
theorem vecMulVec_cons (v : m' → α) (x : α) (w : Fin n → α) :
- vecMulVec v (vecCons x w) = fun i => v i • vecCons x w := by ext (i j);
+ vecMulVec v (vecCons x w) = fun i => v i • vecCons x w := by ext i j;
rw [vec_mul_vec_apply, Pi.smul_apply, smul_eq_mul]
#align matrix.vec_mul_vec_cons Matrix.vecMulVec_cons
-/
@@ -471,7 +471,7 @@ theorem submatrix_empty (A : Matrix m' n' α) (row : Fin 0 → m') (col : o' →
@[simp]
theorem submatrix_cons_row (A : Matrix m' n' α) (i : m') (row : Fin m → m') (col : o' → n') :
submatrix A (vecCons i row) col = vecCons (fun j => A i (col j)) (submatrix A row col) := by
- ext (i j); refine' Fin.cases _ _ i <;> simp [submatrix]
+ ext i j; refine' Fin.cases _ _ i <;> simp [submatrix]
#align matrix.submatrix_cons_row Matrix.submatrix_cons_row
-/
@@ -502,14 +502,14 @@ section One
variable [Zero α] [One α]
#print Matrix.one_fin_two /-
-theorem one_fin_two : (1 : Matrix (Fin 2) (Fin 2) α) = !![1, 0; 0, 1] := by ext (i j);
+theorem one_fin_two : (1 : Matrix (Fin 2) (Fin 2) α) = !![1, 0; 0, 1] := by ext i j;
fin_cases i <;> fin_cases j <;> rfl
#align matrix.one_fin_two Matrix.one_fin_two
-/
#print Matrix.one_fin_three /-
theorem one_fin_three : (1 : Matrix (Fin 3) (Fin 3) α) = !![1, 0, 0; 0, 1, 0; 0, 0, 1] := by
- ext (i j); fin_cases i <;> fin_cases j <;> rfl
+ ext i j; fin_cases i <;> fin_cases j <;> rfl
#align matrix.one_fin_three Matrix.one_fin_three
-/
@@ -517,13 +517,13 @@ end One
#print Matrix.eta_fin_two /-
theorem eta_fin_two (A : Matrix (Fin 2) (Fin 2) α) : A = !![A 0 0, A 0 1; A 1 0, A 1 1] := by
- ext (i j); fin_cases i <;> fin_cases j <;> rfl
+ ext i j; fin_cases i <;> fin_cases j <;> rfl
#align matrix.eta_fin_two Matrix.eta_fin_two
-/
#print Matrix.eta_fin_three /-
theorem eta_fin_three (A : Matrix (Fin 3) (Fin 3) α) :
- A = !![A 0 0, A 0 1, A 0 2; A 1 0, A 1 1, A 1 2; A 2 0, A 2 1, A 2 2] := by ext (i j);
+ A = !![A 0 0, A 0 1, A 0 2; A 1 0, A 1 1, A 1 2; A 2 0, A 2 1, A 2 2] := by ext i j;
fin_cases i <;> fin_cases j <;> rfl
#align matrix.eta_fin_three Matrix.eta_fin_three
-/
@@ -534,7 +534,7 @@ theorem mul_fin_two [AddCommMonoid α] [Mul α] (a₁₁ a₁₂ a₂₁ a₂₂
!![a₁₁ * b₁₁ + a₁₂ * b₂₁, a₁₁ * b₁₂ + a₁₂ * b₂₂;
a₂₁ * b₁₁ + a₂₂ * b₂₁, a₂₁ * b₁₂ + a₂₂ * b₂₂] :=
by
- ext (i j)
+ ext i j
fin_cases i <;> fin_cases j <;> simp [Matrix.mul, dot_product, Fin.sum_univ_succ]
#align matrix.mul_fin_two Matrix.mul_fin_two
-/
@@ -551,7 +551,7 @@ theorem mul_fin_three [AddCommMonoid α] [Mul α]
a₃₁ * b₁₁ + a₃₂ * b₂₁ + a₃₃ * b₃₁, a₃₁ * b₁₂ + a₃₂ * b₂₂ + a₃₃ * b₃₂,
a₃₁ * b₁₃ + a₃₂ * b₂₃ + a₃₃ * b₃₃] :=
by
- ext (i j)
+ ext i j
fin_cases i <;> fin_cases j <;> simp [Matrix.mul, dot_product, Fin.sum_univ_succ, ← add_assoc]
#align matrix.mul_fin_three Matrix.mul_fin_three
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -176,27 +176,35 @@ section DotProduct
variable [AddCommMonoid α] [Mul α]
+#print Matrix.dotProduct_empty /-
@[simp]
theorem dotProduct_empty (v w : Fin 0 → α) : dotProduct v w = 0 :=
Finset.sum_empty
#align matrix.dot_product_empty Matrix.dotProduct_empty
+-/
+#print Matrix.cons_dotProduct /-
@[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
simp [dot_product, Fin.sum_univ_succ, vec_head, vec_tail]
#align matrix.cons_dot_product Matrix.cons_dotProduct
+-/
+#print Matrix.dotProduct_cons /-
@[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
simp [dot_product, Fin.sum_univ_succ, vec_head, vec_tail]
#align matrix.dot_product_cons Matrix.dotProduct_cons
+-/
+#print Matrix.cons_dotProduct_cons /-
@[simp]
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 simp
#align matrix.cons_dot_product_cons Matrix.cons_dotProduct_cons
+-/
end DotProduct
@@ -275,26 +283,34 @@ section Mul
variable [Semiring α]
+#print Matrix.empty_mul /-
@[simp]
theorem empty_mul [Fintype n'] (A : Matrix (Fin 0) n' α) (B : Matrix n' o' α) : A ⬝ B = of ![] :=
empty_eq _
#align matrix.empty_mul Matrix.empty_mul
+-/
+#print Matrix.empty_mul_empty /-
@[simp]
theorem empty_mul_empty (A : Matrix m' (Fin 0) α) (B : Matrix (Fin 0) o' α) : A ⬝ B = 0 :=
rfl
#align matrix.empty_mul_empty Matrix.empty_mul_empty
+-/
+#print Matrix.mul_empty /-
@[simp]
theorem mul_empty [Fintype n'] (A : Matrix m' n' α) (B : Matrix n' (Fin 0) α) :
A ⬝ B = of fun _ => ![] :=
funext fun _ => empty_eq _
#align matrix.mul_empty Matrix.mul_empty
+-/
+#print Matrix.mul_val_succ /-
theorem mul_val_succ [Fintype n'] (A : Matrix (Fin m.succ) n' α) (B : Matrix n' o' α) (i : Fin m)
(j : o') : (A ⬝ B) i.succ j = (of (vecTail (of.symm A)) ⬝ B) i j :=
rfl
#align matrix.mul_val_succ Matrix.mul_val_succ
+-/
#print Matrix.cons_mul /-
@[simp]
@@ -310,10 +326,12 @@ section VecMul
variable [Semiring α]
+#print Matrix.empty_vecMul /-
@[simp]
theorem empty_vecMul (v : Fin 0 → α) (B : Matrix (Fin 0) o' α) : vecMul v B = 0 :=
rfl
#align matrix.empty_vec_mul Matrix.empty_vecMul
+-/
#print Matrix.vecMul_empty /-
@[simp]
@@ -358,10 +376,12 @@ theorem empty_mulVec [Fintype n'] (A : Matrix (Fin 0) n' α) (v : n' → α) : m
#align matrix.empty_mul_vec Matrix.empty_mulVec
-/
+#print Matrix.mulVec_empty /-
@[simp]
theorem mulVec_empty (A : Matrix m' (Fin 0) α) (v : Fin 0 → α) : mulVec A v = 0 :=
rfl
#align matrix.mul_vec_empty Matrix.mulVec_empty
+-/
#print Matrix.cons_mulVec /-
@[simp]
@@ -371,11 +391,13 @@ theorem cons_mulVec [Fintype n'] (v : n' → α) (A : Fin m → n' → α) (w :
#align matrix.cons_mul_vec Matrix.cons_mulVec
-/
+#print Matrix.mulVec_cons /-
@[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;
simp [mul_vec, mul_comm]
#align matrix.mul_vec_cons Matrix.mulVec_cons
+-/
end MulVec
@@ -383,27 +405,35 @@ section VecMulVec
variable [Semiring α]
+#print Matrix.empty_vecMulVec /-
@[simp]
theorem empty_vecMulVec (v : Fin 0 → α) (w : n' → α) : vecMulVec v w = ![] :=
empty_eq _
#align matrix.empty_vec_mul_vec Matrix.empty_vecMulVec
+-/
+#print Matrix.vecMulVec_empty /-
@[simp]
theorem vecMulVec_empty (v : m' → α) (w : Fin 0 → α) : vecMulVec v w = fun _ => ![] :=
funext fun i => empty_eq _
#align matrix.vec_mul_vec_empty Matrix.vecMulVec_empty
+-/
+#print Matrix.cons_vecMulVec /-
@[simp]
theorem cons_vecMulVec (x : α) (v : Fin m → α) (w : n' → α) :
vecMulVec (vecCons x v) w = vecCons (x • w) (vecMulVec v w) := by ext i;
refine' Fin.cases _ _ i <;> simp [vec_mul_vec]
#align matrix.cons_vec_mul_vec Matrix.cons_vecMulVec
+-/
+#print Matrix.vecMulVec_cons /-
@[simp]
theorem vecMulVec_cons (v : m' → α) (x : α) (w : Fin n → α) :
vecMulVec v (vecCons x w) = fun i => v i • vecCons x w := by ext (i j);
rw [vec_mul_vec_apply, Pi.smul_apply, smul_eq_mul]
#align matrix.vec_mul_vec_cons Matrix.vecMulVec_cons
+-/
end VecMulVec
@@ -411,15 +441,19 @@ section Smul
variable [Semiring α]
+#print Matrix.smul_mat_empty /-
@[simp]
theorem smul_mat_empty {m' : Type _} (x : α) (A : Fin 0 → m' → α) : x • A = ![] :=
empty_eq _
#align matrix.smul_mat_empty Matrix.smul_mat_empty
+-/
+#print Matrix.smul_mat_cons /-
@[simp]
theorem smul_mat_cons (x : α) (v : n' → α) (A : Fin m → n' → α) :
x • vecCons v A = vecCons (x • v) (x • A) := by ext i; refine' Fin.cases _ _ i <;> simp
#align matrix.smul_mat_cons Matrix.smul_mat_cons
+-/
end Smul
@@ -441,19 +475,23 @@ theorem submatrix_cons_row (A : Matrix m' n' α) (i : m') (row : Fin m → m') (
#align matrix.submatrix_cons_row Matrix.submatrix_cons_row
-/
+#print Matrix.submatrix_updateRow_succAbove /-
/-- Updating a row then removing it is the same as removing it. -/
@[simp]
theorem submatrix_updateRow_succAbove (A : Matrix (Fin m.succ) n' α) (v : n' → α) (f : o' → n')
(i : Fin m.succ) : (A.updateRow i v).submatrix i.succAbove f = A.submatrix i.succAbove f :=
ext fun r s => (congr_fun (updateRow_ne (Fin.succAbove_ne i r) : _ = A _) (f s) : _)
#align matrix.submatrix_update_row_succ_above Matrix.submatrix_updateRow_succAbove
+-/
+#print Matrix.submatrix_updateColumn_succAbove /-
/-- Updating a column then removing it is the same as removing it. -/
@[simp]
theorem submatrix_updateColumn_succAbove (A : Matrix m' (Fin n.succ) α) (v : m' → α) (f : o' → m')
(i : Fin n.succ) : (A.updateColumn i v).submatrix f i.succAbove = A.submatrix f i.succAbove :=
ext fun r s => updateColumn_ne (Fin.succAbove_ne i s)
#align matrix.submatrix_update_column_succ_above Matrix.submatrix_updateColumn_succAbove
+-/
end Submatrix
@@ -463,13 +501,17 @@ section One
variable [Zero α] [One α]
+#print Matrix.one_fin_two /-
theorem one_fin_two : (1 : Matrix (Fin 2) (Fin 2) α) = !![1, 0; 0, 1] := by ext (i j);
fin_cases i <;> fin_cases j <;> rfl
#align matrix.one_fin_two Matrix.one_fin_two
+-/
+#print Matrix.one_fin_three /-
theorem one_fin_three : (1 : Matrix (Fin 3) (Fin 3) α) = !![1, 0, 0; 0, 1, 0; 0, 0, 1] := by
ext (i j); fin_cases i <;> fin_cases j <;> rfl
#align matrix.one_fin_three Matrix.one_fin_three
+-/
end One
@@ -539,36 +581,48 @@ theorem vec3_add [Add α] (a₀ a₁ a₂ b₀ b₁ b₂ : α) :
#align matrix.vec3_add Matrix.vec3_add
-/
+#print Matrix.smul_vec2 /-
theorem smul_vec2 {R : Type _} [SMul R α] (x : R) (a₀ a₁ : α) : x • ![a₀, a₁] = ![x • a₀, x • a₁] :=
by rw [smul_cons, smul_cons, smul_empty]
#align matrix.smul_vec2 Matrix.smul_vec2
+-/
+#print Matrix.smul_vec3 /-
theorem smul_vec3 {R : Type _} [SMul R α] (x : R) (a₀ a₁ a₂ : α) :
x • ![a₀, a₁, a₂] = ![x • a₀, x • a₁, x • a₂] := by
rw [smul_cons, smul_cons, smul_cons, smul_empty]
#align matrix.smul_vec3 Matrix.smul_vec3
+-/
variable [AddCommMonoid α] [Mul α]
+#print Matrix.vec2_dotProduct' /-
theorem vec2_dotProduct' {a₀ a₁ b₀ b₁ : α} : ![a₀, a₁] ⬝ᵥ ![b₀, b₁] = a₀ * b₀ + a₁ * b₁ := by
rw [cons_dot_product_cons, cons_dot_product_cons, dot_product_empty, add_zero]
#align matrix.vec2_dot_product' Matrix.vec2_dotProduct'
+-/
+#print Matrix.vec2_dotProduct /-
@[simp]
theorem vec2_dotProduct (v w : Fin 2 → α) : v ⬝ᵥ w = v 0 * w 0 + v 1 * w 1 :=
vec2_dotProduct'
#align matrix.vec2_dot_product Matrix.vec2_dotProduct
+-/
+#print Matrix.vec3_dotProduct' /-
theorem vec3_dotProduct' {a₀ a₁ a₂ b₀ b₁ b₂ : α} :
![a₀, a₁, a₂] ⬝ᵥ ![b₀, b₁, b₂] = a₀ * b₀ + a₁ * b₁ + a₂ * b₂ := by
rw [cons_dot_product_cons, cons_dot_product_cons, cons_dot_product_cons, dot_product_empty,
add_zero, add_assoc]
#align matrix.vec3_dot_product' Matrix.vec3_dotProduct'
+-/
+#print Matrix.vec3_dotProduct /-
@[simp]
theorem vec3_dotProduct (v w : Fin 3 → α) : v ⬝ᵥ w = v 0 * w 0 + v 1 * w 1 + v 2 * w 2 :=
vec3_dotProduct'
#align matrix.vec3_dot_product Matrix.vec3_dotProduct
+-/
end Vec2AndVec3
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -90,7 +90,7 @@ open Interactive.Types
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/-- Parse the entries of a matrix -/
-unsafe def entry_parser {α : Type} (p : parser α) : parser (Σm n, Fin m → Fin n → α) := do
+unsafe def entry_parser {α : Type} (p : parser α) : parser (Σ m n, Fin m → Fin n → α) := do
let-- a list of lists if the matrix has at least one row, or the number of columns if the matrix has
-- zero rows.
p :
@@ -118,8 +118,8 @@ unsafe def entry_parser {α : Type} (p : parser α) : parser (Σm n, Fin m → F
-- a massive amount of effort to make it universe-polymorphic.
@[instance]
unsafe def sigma_sigma_fin_matrix_has_reflect {α : Type} [has_reflect α] [reflected _ α] :
- has_reflect (Σm n : ℕ, Fin m → Fin n → α) :=
- @sigma.reflect.{0, 0} _ _ ℕ (fun m => Σn, Fin m → Fin n → α) _ _ _ fun i =>
+ has_reflect (Σ m n : ℕ, Fin m → Fin n → α) :=
+ @sigma.reflect.{0, 0} _ _ ℕ (fun m => Σ n, Fin m → Fin n → α) _ _ _ fun i =>
@sigma.reflect.{0, 0} _ _ ℕ _ _ _ _ fun j => inferInstance
#align matrix.sigma_sigma_fin_matrix_has_reflect matrix.sigma_sigma_fin_matrix_has_reflect
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Eric Wieser
! This file was ported from Lean 3 source module data.matrix.notation
-! leanprover-community/mathlib commit 86d1873c01a723aba6788f0b9051ae3d23b4c1c3
+! leanprover-community/mathlib commit a99f85220eaf38f14f94e04699943e185a5e1d1a
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -441,6 +441,20 @@ theorem submatrix_cons_row (A : Matrix m' n' α) (i : m') (row : Fin m → m') (
#align matrix.submatrix_cons_row Matrix.submatrix_cons_row
-/
+/-- Updating a row then removing it is the same as removing it. -/
+@[simp]
+theorem submatrix_updateRow_succAbove (A : Matrix (Fin m.succ) n' α) (v : n' → α) (f : o' → n')
+ (i : Fin m.succ) : (A.updateRow i v).submatrix i.succAbove f = A.submatrix i.succAbove f :=
+ ext fun r s => (congr_fun (updateRow_ne (Fin.succAbove_ne i r) : _ = A _) (f s) : _)
+#align matrix.submatrix_update_row_succ_above Matrix.submatrix_updateRow_succAbove
+
+/-- Updating a column then removing it is the same as removing it. -/
+@[simp]
+theorem submatrix_updateColumn_succAbove (A : Matrix m' (Fin n.succ) α) (v : m' → α) (f : o' → m')
+ (i : Fin n.succ) : (A.updateColumn i v).submatrix f i.succAbove = A.submatrix f i.succAbove :=
+ ext fun r s => updateColumn_ne (Fin.succAbove_ne i s)
+#align matrix.submatrix_update_column_succ_above Matrix.submatrix_updateColumn_succAbove
+
end Submatrix
section Vec2AndVec3
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -55,7 +55,7 @@ universe u
variable {α : Type u} {o n m : ℕ} {m' n' o' : Type _}
-open Matrix
+open scoped Matrix
/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[] -/
/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[] -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -176,47 +176,23 @@ section DotProduct
variable [AddCommMonoid α] [Mul α]
-/- warning: matrix.dot_product_empty -> Matrix.dotProduct_empty is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (w : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α (Fin.fintype (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) _inst_2 _inst_1 v w) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1))))))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (w : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α (Fin.fintype (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) _inst_2 _inst_1 v w) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α (AddMonoid.toZero.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1))))
-Case conversion may be inaccurate. Consider using '#align matrix.dot_product_empty Matrix.dotProduct_emptyₓ'. -/
@[simp]
theorem dotProduct_empty (v w : Fin 0 → α) : dotProduct v w = 0 :=
Finset.sum_empty
#align matrix.dot_product_empty Matrix.dotProduct_empty
-/- warning: matrix.cons_dot_product -> Matrix.cons_dotProduct is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {n : Nat} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (x : α) (v : (Fin n) -> α) (w : (Fin (Nat.succ n)) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ n)) α (Fin.fintype (Nat.succ n)) _inst_2 _inst_1 (Matrix.vecCons.{u1} α n x v) w) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) x (Matrix.vecHead.{u1} α n w)) (Matrix.dotProduct.{u1, 0} (Fin n) α (Fin.fintype n) _inst_2 _inst_1 v (Matrix.vecTail.{u1} α n w)))
-but is expected to have type
- forall {α : Type.{u1}} {n : Nat} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (x : α) (v : (Fin n) -> α) (w : (Fin (Nat.succ n)) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ n)) α (Fin.fintype (Nat.succ n)) _inst_2 _inst_1 (Matrix.vecCons.{u1} α n x v) w) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) x (Matrix.vecHead.{u1} α n w)) (Matrix.dotProduct.{u1, 0} (Fin n) α (Fin.fintype n) _inst_2 _inst_1 v (Matrix.vecTail.{u1} α n w)))
-Case conversion may be inaccurate. Consider using '#align matrix.cons_dot_product Matrix.cons_dotProductₓ'. -/
@[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
simp [dot_product, Fin.sum_univ_succ, vec_head, vec_tail]
#align matrix.cons_dot_product Matrix.cons_dotProduct
-/- warning: matrix.dot_product_cons -> Matrix.dotProduct_cons is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {n : Nat} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (v : (Fin (Nat.succ n)) -> α) (x : α) (w : (Fin n) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ n)) α (Fin.fintype (Nat.succ n)) _inst_2 _inst_1 v (Matrix.vecCons.{u1} α n x w)) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (Matrix.vecHead.{u1} α n v) x) (Matrix.dotProduct.{u1, 0} (Fin n) α (Fin.fintype n) _inst_2 _inst_1 (Matrix.vecTail.{u1} α n v) w))
-but is expected to have type
- forall {α : Type.{u1}} {n : Nat} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (v : (Fin (Nat.succ n)) -> α) (x : α) (w : (Fin n) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ n)) α (Fin.fintype (Nat.succ n)) _inst_2 _inst_1 v (Matrix.vecCons.{u1} α n x w)) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (Matrix.vecHead.{u1} α n v) x) (Matrix.dotProduct.{u1, 0} (Fin n) α (Fin.fintype n) _inst_2 _inst_1 (Matrix.vecTail.{u1} α n v) w))
-Case conversion may be inaccurate. Consider using '#align matrix.dot_product_cons Matrix.dotProduct_consₓ'. -/
@[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
simp [dot_product, Fin.sum_univ_succ, vec_head, vec_tail]
#align matrix.dot_product_cons Matrix.dotProduct_cons
-/- warning: matrix.cons_dot_product_cons -> Matrix.cons_dotProduct_cons is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {n : Nat} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (x : α) (v : (Fin n) -> α) (y : α) (w : (Fin n) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ n)) α (Fin.fintype (Nat.succ n)) _inst_2 _inst_1 (Matrix.vecCons.{u1} α n x v) (Matrix.vecCons.{u1} α n y w)) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) x y) (Matrix.dotProduct.{u1, 0} (Fin n) α (Fin.fintype n) _inst_2 _inst_1 v w))
-but is expected to have type
- forall {α : Type.{u1}} {n : Nat} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (x : α) (v : (Fin n) -> α) (y : α) (w : (Fin n) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ n)) α (Fin.fintype (Nat.succ n)) _inst_2 _inst_1 (Matrix.vecCons.{u1} α n x v) (Matrix.vecCons.{u1} α n y w)) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) x y) (Matrix.dotProduct.{u1, 0} (Fin n) α (Fin.fintype n) _inst_2 _inst_1 v w))
-Case conversion may be inaccurate. Consider using '#align matrix.cons_dot_product_cons Matrix.cons_dotProduct_consₓ'. -/
@[simp]
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 simp
@@ -299,46 +275,22 @@ section Mul
variable [Semiring α]
-/- warning: matrix.empty_mul -> Matrix.empty_mul is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {n' : Type.{u2}} {o' : Type.{u3}} [_inst_1 : Semiring.{u1} α] [_inst_2 : Fintype.{u2} n'] (A : Matrix.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) n' α) (B : Matrix.{u2, u3, u1} n' o' α), Eq.{succ (max u3 u1)} (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α) (Matrix.mul.{u1, 0, u2, u3} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) n' o' α _inst_2 (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B) (coeFn.{max 1 (max (max 1 (succ u3) (succ u1)) (succ (max u3 u1))) (succ (max u3 u1)) 1 (succ u3) (succ u1), max (max 1 (succ u3) (succ u1)) (succ (max u3 u1))} (Equiv.{max 1 (succ u3) (succ u1), succ (max u3 u1)} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> o' -> α) (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α)) (fun (_x : Equiv.{max 1 (succ u3) (succ u1), succ (max u3 u1)} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> o' -> α) (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α)) => ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> o' -> α) -> (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α)) (Equiv.hasCoeToFun.{max 1 (succ u3) (succ u1), succ (max u3 u1)} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> o' -> α) (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α)) (Matrix.of.{u1, 0, u3} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α) (Matrix.vecEmpty.{max u3 u1} (o' -> α)))
-but is expected to have type
- forall {α : Type.{u1}} {n' : Type.{u2}} {o' : Type.{u3}} [_inst_1 : Semiring.{u1} α] [_inst_2 : Fintype.{u2} n'] (A : Matrix.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) n' α) (B : Matrix.{u2, u3, u1} n' o' α), Eq.{max (succ u1) (succ u3)} (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α) (Matrix.mul.{u1, 0, u2, u3} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) n' o' α _inst_2 (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B) (FunLike.coe.{max (succ u3) (succ u1), max (succ u3) (succ u1), max (succ u3) (succ u1)} (Equiv.{max (succ u1) (succ u3), max (max (succ u1) (succ u3)) 1} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> o' -> α) (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α)) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> o' -> α) (fun (_x : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> o' -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> o' -> α) => Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α) _x) (Equiv.instFunLikeEquiv.{max (succ u3) (succ u1), max (succ u3) (succ u1)} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> o' -> α) (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α)) (Matrix.of.{u1, 0, u3} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α) (Matrix.vecEmpty.{max u3 u1} (o' -> α)))
-Case conversion may be inaccurate. Consider using '#align matrix.empty_mul Matrix.empty_mulₓ'. -/
@[simp]
theorem empty_mul [Fintype n'] (A : Matrix (Fin 0) n' α) (B : Matrix n' o' α) : A ⬝ B = of ![] :=
empty_eq _
#align matrix.empty_mul Matrix.empty_mul
-/- warning: matrix.empty_mul_empty -> Matrix.empty_mul_empty is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {m' : Type.{u2}} {o' : Type.{u3}} [_inst_1 : Semiring.{u1} α] (A : Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α) (B : Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α), Eq.{succ (max u2 u3 u1)} (Matrix.{u2, u3, u1} m' o' α) (Matrix.mul.{u1, u2, 0, u3} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α (Fin.fintype (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B) (OfNat.ofNat.{max u2 u3 u1} (Matrix.{u2, u3, u1} m' o' α) 0 (OfNat.mk.{max u2 u3 u1} (Matrix.{u2, u3, u1} m' o' α) 0 (Zero.zero.{max u2 u3 u1} (Matrix.{u2, u3, u1} m' o' α) (Matrix.hasZero.{u1, u2, u3} m' o' α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))))
-but is expected to have type
- forall {α : Type.{u1}} {m' : Type.{u2}} {o' : Type.{u3}} [_inst_1 : Semiring.{u1} α] (A : Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) (B : Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α), Eq.{max (max (succ u1) (succ u3)) (succ u2)} (Matrix.{u2, u3, u1} m' o' α) (Matrix.mul.{u1, u2, 0, u3} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α (Fin.fintype (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B) (OfNat.ofNat.{max (max u1 u3) u2} (Matrix.{u2, u3, u1} m' o' α) 0 (Zero.toOfNat0.{max (max u1 u3) u2} (Matrix.{u2, u3, u1} m' o' α) (Matrix.zero.{u1, u2, u3} m' o' α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)))))
-Case conversion may be inaccurate. Consider using '#align matrix.empty_mul_empty Matrix.empty_mul_emptyₓ'. -/
@[simp]
theorem empty_mul_empty (A : Matrix m' (Fin 0) α) (B : Matrix (Fin 0) o' α) : A ⬝ B = 0 :=
rfl
#align matrix.empty_mul_empty Matrix.empty_mul_empty
-/- warning: matrix.mul_empty -> Matrix.mul_empty is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {m' : Type.{u2}} {n' : Type.{u3}} [_inst_1 : Semiring.{u1} α] [_inst_2 : Fintype.{u3} n'] (A : Matrix.{u2, u3, u1} m' n' α) (B : Matrix.{u3, 0, u1} n' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α), Eq.{succ (max u2 u1)} (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α) (Matrix.mul.{u1, u2, u3, 0} m' n' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α _inst_2 (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B) (coeFn.{max 1 (max (max (succ u2) (succ u1)) (succ (max u2 u1))) (succ (max u2 u1)) (succ u2) (succ u1), max (max (succ u2) (succ u1)) (succ (max u2 u1))} (Equiv.{max (succ u2) (succ u1), succ (max u2 u1)} (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α)) (fun (_x : Equiv.{max (succ u2) (succ u1), succ (max u2 u1)} (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α)) => (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) -> (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α)) (Equiv.hasCoeToFun.{max (succ u2) (succ u1), succ (max u2 u1)} (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α)) (Matrix.of.{u1, u2, 0} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α) (fun (_x : m') => Matrix.vecEmpty.{u1} α))
-but is expected to have type
- forall {α : Type.{u1}} {m' : Type.{u2}} {n' : Type.{u3}} [_inst_1 : Semiring.{u1} α] [_inst_2 : Fintype.{u3} n'] (A : Matrix.{u2, u3, u1} m' n' α) (B : Matrix.{u3, 0, u1} n' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α), Eq.{max (succ u1) (succ u2)} (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) (Matrix.mul.{u1, u2, u3, 0} m' n' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α _inst_2 (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B) (FunLike.coe.{max (succ u2) (succ u1), max (succ u2) (succ u1), max (succ u2) (succ u1)} (Equiv.{max (max (succ u1) (succ u2)) 1, max (succ u1) (succ u2)} (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α)) (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (fun (_x : m' -> (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : m' -> (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) => Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) _x) (Equiv.instFunLikeEquiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α)) (Matrix.of.{u1, u2, 0} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) (fun (_x : m') => Matrix.vecEmpty.{u1} α))
-Case conversion may be inaccurate. Consider using '#align matrix.mul_empty Matrix.mul_emptyₓ'. -/
@[simp]
theorem mul_empty [Fintype n'] (A : Matrix m' n' α) (B : Matrix n' (Fin 0) α) :
A ⬝ B = of fun _ => ![] :=
funext fun _ => empty_eq _
#align matrix.mul_empty Matrix.mul_empty
-/- warning: matrix.mul_val_succ -> Matrix.mul_val_succ is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {m : Nat} {n' : Type.{u2}} {o' : Type.{u3}} [_inst_1 : Semiring.{u1} α] [_inst_2 : Fintype.{u2} n'] (A : Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (B : Matrix.{u2, u3, u1} n' o' α) (i : Fin m) (j : o'), Eq.{succ u1} α (Matrix.mul.{u1, 0, u2, u3} (Fin (Nat.succ m)) n' o' α _inst_2 (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B (Fin.succ m i) j) (Matrix.mul.{u1, 0, u2, u3} (Fin m) n' o' α _inst_2 (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (coeFn.{max 1 (max (max 1 (succ u2) (succ u1)) (succ (max u2 u1))) (succ (max u2 u1)) 1 (succ u2) (succ u1), max (max 1 (succ u2) (succ u1)) (succ (max u2 u1))} (Equiv.{max 1 (succ u2) (succ u1), succ (max u2 u1)} ((Fin m) -> n' -> α) (Matrix.{0, u2, u1} (Fin m) n' α)) (fun (_x : Equiv.{max 1 (succ u2) (succ u1), succ (max u2 u1)} ((Fin m) -> n' -> α) (Matrix.{0, u2, u1} (Fin m) n' α)) => ((Fin m) -> n' -> α) -> (Matrix.{0, u2, u1} (Fin m) n' α)) (Equiv.hasCoeToFun.{max 1 (succ u2) (succ u1), succ (max u2 u1)} ((Fin m) -> n' -> α) (Matrix.{0, u2, u1} (Fin m) n' α)) (Matrix.of.{u1, 0, u2} (Fin m) n' α) (Matrix.vecTail.{max u2 u1} (n' -> α) m (coeFn.{max 1 (max (succ (max u2 u1)) 1 (succ u2) (succ u1)) (max 1 (succ u2) (succ u1)) (succ (max u2 u1)), max (succ (max u2 u1)) 1 (succ u2) (succ u1)} (Equiv.{succ (max u2 u1), max 1 (succ u2) (succ u1)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) ((Fin (Nat.succ m)) -> n' -> α)) (fun (_x : Equiv.{succ (max u2 u1), max 1 (succ u2) (succ u1)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) ((Fin (Nat.succ m)) -> n' -> α)) => (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) -> (Fin (Nat.succ m)) -> n' -> α) (Equiv.hasCoeToFun.{succ (max u2 u1), max 1 (succ u2) (succ u1)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) ((Fin (Nat.succ m)) -> n' -> α)) (Equiv.symm.{max 1 (succ u2) (succ u1), succ (max u2 u1)} ((Fin (Nat.succ m)) -> n' -> α) (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (Matrix.of.{u1, 0, u2} (Fin (Nat.succ m)) n' α)) A))) B i j)
-but is expected to have type
- forall {α : Type.{u1}} {m : Nat} {n' : Type.{u2}} {o' : Type.{u3}} [_inst_1 : Semiring.{u1} α] [_inst_2 : Fintype.{u2} n'] (A : Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (B : Matrix.{u2, u3, u1} n' o' α) (i : Fin m) (j : o'), Eq.{succ u1} α (Matrix.mul.{u1, 0, u2, u3} (Fin (Nat.succ m)) n' o' α _inst_2 (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B (Fin.succ m i) j) (Matrix.mul.{u1, 0, u2, u3} (Fin m) n' o' α _inst_2 (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (FunLike.coe.{max (succ u2) (succ u1), max (succ u2) (succ u1), max (succ u2) (succ u1)} (Equiv.{max (succ u1) (succ u2), max (max (succ u1) (succ u2)) 1} ((Fin m) -> n' -> α) (Matrix.{0, u2, u1} (Fin m) n' α)) ((Fin m) -> n' -> α) (fun (_x : (Fin m) -> n' -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : (Fin m) -> n' -> α) => Matrix.{0, u2, u1} (Fin m) n' α) _x) (Equiv.instFunLikeEquiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} ((Fin m) -> n' -> α) (Matrix.{0, u2, u1} (Fin m) n' α)) (Matrix.of.{u1, 0, u2} (Fin m) n' α) (Matrix.vecTail.{max u2 u1} (n' -> α) m (FunLike.coe.{max (succ u2) (succ u1), max (succ u2) (succ u1), max (succ u2) (succ u1)} (Equiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) ((Fin (Nat.succ m)) -> n' -> α)) (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (fun (_x : Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) => (Fin (Nat.succ m)) -> n' -> α) _x) (Equiv.instFunLikeEquiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) ((Fin (Nat.succ m)) -> n' -> α)) (Equiv.symm.{max (succ u2) (succ u1), max (succ u2) (succ u1)} ((Fin (Nat.succ m)) -> n' -> α) (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (Matrix.of.{u1, 0, u2} (Fin (Nat.succ m)) n' α)) A))) B i j)
-Case conversion may be inaccurate. Consider using '#align matrix.mul_val_succ Matrix.mul_val_succₓ'. -/
theorem mul_val_succ [Fintype n'] (A : Matrix (Fin m.succ) n' α) (B : Matrix n' o' α) (i : Fin m)
(j : o') : (A ⬝ B) i.succ j = (of (vecTail (of.symm A)) ⬝ B) i j :=
rfl
@@ -358,12 +310,6 @@ section VecMul
variable [Semiring α]
-/- warning: matrix.empty_vec_mul -> Matrix.empty_vecMul is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {o' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (B : Matrix.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α), Eq.{max (succ u2) (succ u1)} (o' -> α) (Matrix.vecMul.{u1, 0, u2} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)) (Fin.fintype (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) v B) (OfNat.ofNat.{max u2 u1} (o' -> α) 0 (OfNat.mk.{max u2 u1} (o' -> α) 0 (Zero.zero.{max u2 u1} (o' -> α) (Pi.instZero.{u2, u1} o' (fun (ᾰ : o') => α) (fun (i : o') => MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))))
-but is expected to have type
- forall {α : Type.{u1}} {o' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (B : Matrix.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α), Eq.{max (succ u1) (succ u2)} (o' -> α) (Matrix.vecMul.{u1, 0, u2} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)) (Fin.fintype (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) v B) (OfNat.ofNat.{max u1 u2} (o' -> α) 0 (Zero.toOfNat0.{max u1 u2} (o' -> α) (Pi.instZero.{u2, u1} o' (fun (a._@.Mathlib.Data.Matrix.Basic._hyg.18132 : o') => α) (fun (i : o') => MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)))))
-Case conversion may be inaccurate. Consider using '#align matrix.empty_vec_mul Matrix.empty_vecMulₓ'. -/
@[simp]
theorem empty_vecMul (v : Fin 0 → α) (B : Matrix (Fin 0) o' α) : vecMul v B = 0 :=
rfl
@@ -412,12 +358,6 @@ theorem empty_mulVec [Fintype n'] (A : Matrix (Fin 0) n' α) (v : n' → α) : m
#align matrix.empty_mul_vec Matrix.empty_mulVec
-/
-/- warning: matrix.mul_vec_empty -> Matrix.mulVec_empty is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {m' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (A : Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α) (v : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α), Eq.{max (succ u2) (succ u1)} (m' -> α) (Matrix.mulVec.{u1, u2, 0} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)) (Fin.fintype (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) A v) (OfNat.ofNat.{max u2 u1} (m' -> α) 0 (OfNat.mk.{max u2 u1} (m' -> α) 0 (Zero.zero.{max u2 u1} (m' -> α) (Pi.instZero.{u2, u1} m' (fun (ᾰ : m') => α) (fun (i : m') => MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))))
-but is expected to have type
- forall {α : Type.{u1}} {m' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (A : Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{max (succ u1) (succ u2)} (m' -> α) (Matrix.mulVec.{u1, u2, 0} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)) (Fin.fintype (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) A v) (OfNat.ofNat.{max u1 u2} (m' -> α) 0 (Zero.toOfNat0.{max u1 u2} (m' -> α) (Pi.instZero.{u2, u1} m' (fun (a._@.Mathlib.Data.Matrix.Basic._hyg.18074 : m') => α) (fun (i : m') => MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)))))
-Case conversion may be inaccurate. Consider using '#align matrix.mul_vec_empty Matrix.mulVec_emptyₓ'. -/
@[simp]
theorem mulVec_empty (A : Matrix m' (Fin 0) α) (v : Fin 0 → α) : mulVec A v = 0 :=
rfl
@@ -431,12 +371,6 @@ theorem cons_mulVec [Fintype n'] (v : n' → α) (A : Fin m → n' → α) (w :
#align matrix.cons_mul_vec Matrix.cons_mulVec
-/
-/- warning: matrix.mul_vec_cons -> Matrix.mulVec_cons is a dubious translation:
-lean 3 declaration is
- forall {n : Nat} {m' : Type.{u1}} {α : Type.{u2}} [_inst_2 : CommSemiring.{u2} α] (A : m' -> (Fin (Nat.succ n)) -> α) (x : α) (v : (Fin n) -> α), Eq.{max (succ u1) (succ u2)} (m' -> α) (Matrix.mulVec.{u2, u1, 0} m' (Fin (Nat.succ n)) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} α (Semiring.toNonAssocSemiring.{u2} α (CommSemiring.toSemiring.{u2} α _inst_2))) (Fin.fintype (Nat.succ n)) (coeFn.{max 1 (max (max (succ u1) (succ u2)) (succ (max u1 u2))) (succ (max u1 u2)) (succ u1) (succ u2), max (max (succ u1) (succ u2)) (succ (max u1 u2))} (Equiv.{max (succ u1) (succ u2), succ (max u1 u2)} (m' -> (Fin (Nat.succ n)) -> α) (Matrix.{u1, 0, u2} m' (Fin (Nat.succ n)) α)) (fun (_x : Equiv.{max (succ u1) (succ u2), succ (max u1 u2)} (m' -> (Fin (Nat.succ n)) -> α) (Matrix.{u1, 0, u2} m' (Fin (Nat.succ n)) α)) => (m' -> (Fin (Nat.succ n)) -> α) -> (Matrix.{u1, 0, u2} m' (Fin (Nat.succ n)) α)) (Equiv.hasCoeToFun.{max (succ u1) (succ u2), succ (max u1 u2)} (m' -> (Fin (Nat.succ n)) -> α) (Matrix.{u1, 0, u2} m' (Fin (Nat.succ n)) α)) (Matrix.of.{u2, u1, 0} m' (Fin (Nat.succ n)) α) A) (Matrix.vecCons.{u2} α n x v)) (HAdd.hAdd.{max u1 u2, max u1 u2, max u1 u2} (m' -> α) (m' -> α) (m' -> α) (instHAdd.{max u1 u2} (m' -> α) (Pi.instAdd.{u1, u2} m' (fun (ᾰ : m') => α) (fun (i : m') => Distrib.toHasAdd.{u2} α (NonUnitalNonAssocSemiring.toDistrib.{u2} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} α (Semiring.toNonAssocSemiring.{u2} α (CommSemiring.toSemiring.{u2} α _inst_2))))))) (SMul.smul.{u2, max u1 u2} α (m' -> α) (Function.hasSMul.{u1, u2, u2} m' α α (Mul.toSMul.{u2} α (Distrib.toHasMul.{u2} α (NonUnitalNonAssocSemiring.toDistrib.{u2} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} α (Semiring.toNonAssocSemiring.{u2} α (CommSemiring.toSemiring.{u2} α _inst_2))))))) x (Function.comp.{succ u1, succ u2, succ u2} m' ((Fin (Nat.succ n)) -> α) α (Matrix.vecHead.{u2} α n) A)) (Matrix.mulVec.{u2, u1, 0} m' (Fin n) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} α (Semiring.toNonAssocSemiring.{u2} α (CommSemiring.toSemiring.{u2} α _inst_2))) (Fin.fintype n) (coeFn.{max 1 (max (max (succ u1) (succ u2)) (succ (max u1 u2))) (succ (max u1 u2)) (succ u1) (succ u2), max (max (succ u1) (succ u2)) (succ (max u1 u2))} (Equiv.{max (succ u1) (succ u2), succ (max u1 u2)} (m' -> (Fin n) -> α) (Matrix.{u1, 0, u2} m' (Fin n) α)) (fun (_x : Equiv.{max (succ u1) (succ u2), succ (max u1 u2)} (m' -> (Fin n) -> α) (Matrix.{u1, 0, u2} m' (Fin n) α)) => (m' -> (Fin n) -> α) -> (Matrix.{u1, 0, u2} m' (Fin n) α)) (Equiv.hasCoeToFun.{max (succ u1) (succ u2), succ (max u1 u2)} (m' -> (Fin n) -> α) (Matrix.{u1, 0, u2} m' (Fin n) α)) (Matrix.of.{u2, u1, 0} m' (Fin n) α) (Function.comp.{succ u1, succ u2, succ u2} m' ((Fin (Nat.succ n)) -> α) ((Fin n) -> α) (Matrix.vecTail.{u2} α n) A)) v))
-but is expected to have type
- forall {n : Nat} {m' : Type.{u2}} {α : Type.{u1}} [_inst_2 : CommSemiring.{u1} α] (A : m' -> (Fin (Nat.succ n)) -> α) (x : α) (v : (Fin n) -> α), Eq.{max (succ u2) (succ u1)} (m' -> α) (Matrix.mulVec.{u1, u2, 0} m' (Fin (Nat.succ n)) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α _inst_2))) (Fin.fintype (Nat.succ n)) (FunLike.coe.{max (succ u2) (succ u1), max (succ u2) (succ u1), max (succ u2) (succ u1)} (Equiv.{max (max (succ u1) (succ u2)) 1, max (succ u1) (succ u2)} (m' -> (Fin (Nat.succ n)) -> α) (Matrix.{u2, 0, u1} m' (Fin (Nat.succ n)) α)) (m' -> (Fin (Nat.succ n)) -> α) (fun (_x : m' -> (Fin (Nat.succ n)) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : m' -> (Fin (Nat.succ n)) -> α) => Matrix.{u2, 0, u1} m' (Fin (Nat.succ n)) α) _x) (Equiv.instFunLikeEquiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (m' -> (Fin (Nat.succ n)) -> α) (Matrix.{u2, 0, u1} m' (Fin (Nat.succ n)) α)) (Matrix.of.{u1, u2, 0} m' (Fin (Nat.succ n)) α) A) (Matrix.vecCons.{u1} α n x v)) (HAdd.hAdd.{max u2 u1, max u2 u1, max u2 u1} (m' -> α) (m' -> α) (m' -> α) (instHAdd.{max u2 u1} (m' -> α) (Pi.instAdd.{u2, u1} m' (fun (ᾰ : m') => α) (fun (i : m') => Distrib.toAdd.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α _inst_2))))))) (HSMul.hSMul.{u1, max u2 u1, max u2 u1} α (m' -> α) (m' -> α) (instHSMul.{u1, max u2 u1} α (m' -> α) (Pi.instSMul.{u2, u1, u1} m' α (fun (a._@.Init.Prelude._hyg.25 : m') => α) (fun (i : m') => Algebra.toSMul.{u1, u1} α α _inst_2 (CommSemiring.toSemiring.{u1} α _inst_2) (Algebra.id.{u1} α _inst_2)))) x (Function.comp.{succ u2, succ u1, succ u1} m' ((Fin (Nat.succ n)) -> α) α (Matrix.vecHead.{u1} α n) A)) (Matrix.mulVec.{u1, u2, 0} m' (Fin n) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α _inst_2))) (Fin.fintype n) (FunLike.coe.{max (succ u2) (succ u1), max (succ u2) (succ u1), max (succ u2) (succ u1)} (Equiv.{max (max (succ u1) (succ u2)) 1, max (succ u1) (succ u2)} (m' -> (Fin n) -> α) (Matrix.{u2, 0, u1} m' (Fin n) α)) (m' -> (Fin n) -> α) (fun (_x : m' -> (Fin n) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : m' -> (Fin n) -> α) => Matrix.{u2, 0, u1} m' (Fin n) α) _x) (Equiv.instFunLikeEquiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (m' -> (Fin n) -> α) (Matrix.{u2, 0, u1} m' (Fin n) α)) (Matrix.of.{u1, u2, 0} m' (Fin n) α) (Function.comp.{succ u2, succ u1, succ u1} m' ((Fin (Nat.succ n)) -> α) ((Fin n) -> α) (Matrix.vecTail.{u1} α n) A)) v))
-Case conversion may be inaccurate. Consider using '#align matrix.mul_vec_cons Matrix.mulVec_consₓ'. -/
@[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;
@@ -449,46 +383,22 @@ section VecMulVec
variable [Semiring α]
-/- warning: matrix.empty_vec_mul_vec -> Matrix.empty_vecMulVec is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {n' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (w : n' -> α), Eq.{succ (max u2 u1)} (Matrix.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) n' α) (Matrix.vecMulVec.{u1, 0, u2} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) n' α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) v w) (Matrix.vecEmpty.{max u2 u1} (n' -> α))
-but is expected to have type
- forall {α : Type.{u1}} {n' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (w : n' -> α), Eq.{max (succ u1) (succ u2)} (Matrix.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) n' α) (Matrix.vecMulVec.{u1, 0, u2} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) n' α (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) v w) (Matrix.vecEmpty.{max u1 u2} (n' -> α))
-Case conversion may be inaccurate. Consider using '#align matrix.empty_vec_mul_vec Matrix.empty_vecMulVecₓ'. -/
@[simp]
theorem empty_vecMulVec (v : Fin 0 → α) (w : n' → α) : vecMulVec v w = ![] :=
empty_eq _
#align matrix.empty_vec_mul_vec Matrix.empty_vecMulVec
-/- warning: matrix.vec_mul_vec_empty -> Matrix.vecMulVec_empty is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {m' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : m' -> α) (w : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α), Eq.{succ (max u2 u1)} (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α) (Matrix.vecMulVec.{u1, u2, 0} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) v w) (fun (_x : m') => Matrix.vecEmpty.{u1} α)
-but is expected to have type
- forall {α : Type.{u1}} {m' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : m' -> α) (w : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{max (succ u1) (succ u2)} (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) (Matrix.vecMulVec.{u1, u2, 0} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) v w) (fun (_x : m') => Matrix.vecEmpty.{u1} α)
-Case conversion may be inaccurate. Consider using '#align matrix.vec_mul_vec_empty Matrix.vecMulVec_emptyₓ'. -/
@[simp]
theorem vecMulVec_empty (v : m' → α) (w : Fin 0 → α) : vecMulVec v w = fun _ => ![] :=
funext fun i => empty_eq _
#align matrix.vec_mul_vec_empty Matrix.vecMulVec_empty
-/- warning: matrix.cons_vec_mul_vec -> Matrix.cons_vecMulVec is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {m : Nat} {n' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (x : α) (v : (Fin m) -> α) (w : n' -> α), Eq.{succ (max u2 u1)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (Matrix.vecMulVec.{u1, 0, u2} (Fin (Nat.succ m)) n' α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) (Matrix.vecCons.{u1} α m x v) w) (Matrix.vecCons.{max u2 u1} (n' -> α) m (SMul.smul.{u1, max u2 u1} α (n' -> α) (Function.hasSMul.{u2, u1, u1} n' α α (Mul.toSMul.{u1} α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))))) x w) (Matrix.vecMulVec.{u1, 0, u2} (Fin m) n' α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) v w))
-but is expected to have type
- forall {α : Type.{u1}} {m : Nat} {n' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (x : α) (v : (Fin m) -> α) (w : n' -> α), Eq.{max (succ u1) (succ u2)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (Matrix.vecMulVec.{u1, 0, u2} (Fin (Nat.succ m)) n' α (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (Matrix.vecCons.{u1} α m x v) w) (Matrix.vecCons.{max u1 u2} (n' -> α) m (HSMul.hSMul.{u1, max u1 u2, max u1 u2} α (n' -> α) (n' -> α) (instHSMul.{u1, max u1 u2} α (n' -> α) (Pi.instSMul.{u2, u1, u1} n' α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4071 : n') => α) (fun (i : n') => SMulZeroClass.toSMul.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MulZeroClass.toSMulWithZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))))))) x w) (Matrix.vecMulVec.{u1, 0, u2} (Fin m) n' α (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) v w))
-Case conversion may be inaccurate. Consider using '#align matrix.cons_vec_mul_vec Matrix.cons_vecMulVecₓ'. -/
@[simp]
theorem cons_vecMulVec (x : α) (v : Fin m → α) (w : n' → α) :
vecMulVec (vecCons x v) w = vecCons (x • w) (vecMulVec v w) := by ext i;
refine' Fin.cases _ _ i <;> simp [vec_mul_vec]
#align matrix.cons_vec_mul_vec Matrix.cons_vecMulVec
-/- warning: matrix.vec_mul_vec_cons -> Matrix.vecMulVec_cons is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {n : Nat} {m' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : m' -> α) (x : α) (w : (Fin n) -> α), Eq.{succ (max u2 u1)} (Matrix.{u2, 0, u1} m' (Fin (Nat.succ n)) α) (Matrix.vecMulVec.{u1, u2, 0} m' (Fin (Nat.succ n)) α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) v (Matrix.vecCons.{u1} α n x w)) (fun (i : m') => SMul.smul.{u1, u1} α ((Fin (Nat.succ n)) -> α) (Function.hasSMul.{0, u1, u1} (Fin (Nat.succ n)) α α (Mul.toSMul.{u1} α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))))) (v i) (Matrix.vecCons.{u1} α n x w))
-but is expected to have type
- forall {α : Type.{u1}} {n : Nat} {m' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : m' -> α) (x : α) (w : (Fin n) -> α), Eq.{max (succ u1) (succ u2)} (Matrix.{u2, 0, u1} m' (Fin (Nat.succ n)) α) (Matrix.vecMulVec.{u1, u2, 0} m' (Fin (Nat.succ n)) α (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) v (Matrix.vecCons.{u1} α n x w)) (fun (i : m') => HSMul.hSMul.{u1, u1, u1} α ((Fin (Nat.succ n)) -> α) ((Fin (Nat.succ n)) -> α) (instHSMul.{u1, u1} α ((Fin (Nat.succ n)) -> α) (Pi.instSMul.{0, u1, u1} (Fin (Nat.succ n)) α (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ n)) => α) (fun (i : Fin (Nat.succ n)) => SMulZeroClass.toSMul.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MulZeroClass.toSMulWithZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))))))) (v i) (Matrix.vecCons.{u1} α n x w))
-Case conversion may be inaccurate. Consider using '#align matrix.vec_mul_vec_cons Matrix.vecMulVec_consₓ'. -/
@[simp]
theorem vecMulVec_cons (v : m' → α) (x : α) (w : Fin n → α) :
vecMulVec v (vecCons x w) = fun i => v i • vecCons x w := by ext (i j);
@@ -501,23 +411,11 @@ section Smul
variable [Semiring α]
-/- warning: matrix.smul_mat_empty -> Matrix.smul_mat_empty is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Semiring.{u1} α] {m' : Type.{u2}} (x : α) (A : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> m' -> α), Eq.{succ (max u2 u1)} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> m' -> α) (SMul.smul.{u1, max u2 u1} α ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> m' -> α) (Function.hasSMul.{0, u1, max u2 u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α (m' -> α) (Function.hasSMul.{u2, u1, u1} m' α α (Mul.toSMul.{u1} α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))) x A) (Matrix.vecEmpty.{max u2 u1} (m' -> α))
-but is expected to have type
- forall {α : Type.{u2}} [_inst_1 : Semiring.{u2} α] {m' : Type.{u1}} (x : α) (A : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> m' -> α), Eq.{max (succ u2) (succ u1)} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> m' -> α) (HSMul.hSMul.{u2, max u2 u1, max u2 u1} α ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> m' -> α) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> m' -> α) (instHSMul.{u2, max u2 u1} α ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> m' -> α) (Pi.instSMul.{0, max u2 u1, u2} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4259 : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => m' -> α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => Pi.instSMul.{u1, u2, u2} m' α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4262 : m') => α) (fun (i : m') => SMulZeroClass.toSMul.{u2, u2} α α (MonoidWithZero.toZero.{u2} α (Semiring.toMonoidWithZero.{u2} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u2, u2} α α (MonoidWithZero.toZero.{u2} α (Semiring.toMonoidWithZero.{u2} α _inst_1)) (MonoidWithZero.toZero.{u2} α (Semiring.toMonoidWithZero.{u2} α _inst_1)) (MulZeroClass.toSMulWithZero.{u2} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u2} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} α (Semiring.toNonAssocSemiring.{u2} α _inst_1))))))))) x A) (Matrix.vecEmpty.{max u2 u1} (m' -> α))
-Case conversion may be inaccurate. Consider using '#align matrix.smul_mat_empty Matrix.smul_mat_emptyₓ'. -/
@[simp]
theorem smul_mat_empty {m' : Type _} (x : α) (A : Fin 0 → m' → α) : x • A = ![] :=
empty_eq _
#align matrix.smul_mat_empty Matrix.smul_mat_empty
-/- warning: matrix.smul_mat_cons -> Matrix.smul_mat_cons is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {m : Nat} {n' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (x : α) (v : n' -> α) (A : (Fin m) -> n' -> α), Eq.{succ (max u2 u1)} ((Fin (Nat.succ m)) -> n' -> α) (SMul.smul.{u1, max u2 u1} α ((Fin (Nat.succ m)) -> n' -> α) (Function.hasSMul.{0, u1, max u2 u1} (Fin (Nat.succ m)) α (n' -> α) (Function.hasSMul.{u2, u1, u1} n' α α (Mul.toSMul.{u1} α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))) x (Matrix.vecCons.{max u2 u1} (n' -> α) m v A)) (Matrix.vecCons.{max u2 u1} (n' -> α) m (SMul.smul.{u1, max u2 u1} α (n' -> α) (Function.hasSMul.{u2, u1, u1} n' α α (Mul.toSMul.{u1} α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))))) x v) (SMul.smul.{u1, max u2 u1} α ((Fin m) -> n' -> α) (Function.hasSMul.{0, u1, max u2 u1} (Fin m) α (n' -> α) (Function.hasSMul.{u2, u1, u1} n' α α (Mul.toSMul.{u1} α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))) x A))
-but is expected to have type
- forall {α : Type.{u1}} {m : Nat} {n' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (x : α) (v : n' -> α) (A : (Fin m) -> n' -> α), Eq.{max (succ u1) (succ u2)} ((Fin (Nat.succ m)) -> n' -> α) (HSMul.hSMul.{u1, max u1 u2, max u1 u2} α ((Fin (Nat.succ m)) -> n' -> α) ((Fin (Nat.succ m)) -> n' -> α) (instHSMul.{u1, max u1 u2} α ((Fin (Nat.succ m)) -> n' -> α) (Pi.instSMul.{0, max u1 u2, u1} (Fin (Nat.succ m)) α (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ m)) => n' -> α) (fun (i : Fin (Nat.succ m)) => Pi.instSMul.{u2, u1, u1} n' α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4301 : n') => α) (fun (i : n') => SMulZeroClass.toSMul.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MulZeroClass.toSMulWithZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))))) x (Matrix.vecCons.{max u1 u2} (n' -> α) m v A)) (Matrix.vecCons.{max u1 u2} (n' -> α) m (HSMul.hSMul.{u1, max u1 u2, max u1 u2} α (n' -> α) (n' -> α) (instHSMul.{u1, max u1 u2} α (n' -> α) (Pi.instSMul.{u2, u1, u1} n' α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4301 : n') => α) (fun (i : n') => SMulZeroClass.toSMul.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MulZeroClass.toSMulWithZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))))))) x v) (HSMul.hSMul.{u1, max u1 u2, max u1 u2} α ((Fin m) -> n' -> α) ((Fin m) -> n' -> α) (instHSMul.{u1, max u1 u2} α ((Fin m) -> n' -> α) (Pi.instSMul.{0, max u1 u2, u1} (Fin m) α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4304 : Fin m) => n' -> α) (fun (i : Fin m) => Pi.instSMul.{u2, u1, u1} n' α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4307 : n') => α) (fun (i : n') => SMulZeroClass.toSMul.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MulZeroClass.toSMulWithZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))))) x A))
-Case conversion may be inaccurate. Consider using '#align matrix.smul_mat_cons Matrix.smul_mat_consₓ'. -/
@[simp]
theorem smul_mat_cons (x : α) (v : n' → α) (A : Fin m → n' → α) :
x • vecCons v A = vecCons (x • v) (x • A) := by ext i; refine' Fin.cases _ _ i <;> simp
@@ -551,22 +449,10 @@ section One
variable [Zero α] [One α]
-/- warning: matrix.one_fin_two -> Matrix.one_fin_two is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : One.{u1} α], Eq.{succ u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α) (OfNat.ofNat.{u1} (Matrix.{0, 0, u1} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α) 1 (OfNat.mk.{u1} (Matrix.{0, 0, u1} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α) 1 (One.one.{u1} (Matrix.{0, 0, u1} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α) (Matrix.hasOne.{u1, 0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α (fun (a : Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (b : Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) => Fin.decidableEq (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) a b) _inst_1 _inst_2)))) (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) (fun (_x : Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) => ((Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) -> (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) (Equiv.hasCoeToFun.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) (Matrix.of.{u1, 0, 0} (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α _inst_2))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecEmpty.{u1} α))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α _inst_2))) (Matrix.vecEmpty.{u1} α))) (Matrix.vecEmpty.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α)))))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : One.{u1} α], Eq.{succ u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) (OfNat.ofNat.{u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) 1 (One.toOfNat1.{u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) (Matrix.one.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α (fun (a : Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (b : Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) => instDecidableEqFin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) a b) _inst_1 _inst_2))) (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α)) ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (fun (_x : (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) => Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α)) (Matrix.of.{u1, 0, 0} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecEmpty.{u1} α))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecEmpty.{u1} α))) (Matrix.vecEmpty.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α)))))
-Case conversion may be inaccurate. Consider using '#align matrix.one_fin_two Matrix.one_fin_twoₓ'. -/
theorem one_fin_two : (1 : Matrix (Fin 2) (Fin 2) α) = !![1, 0; 0, 1] := by ext (i j);
fin_cases i <;> fin_cases j <;> rfl
#align matrix.one_fin_two Matrix.one_fin_two
-/- warning: matrix.one_fin_three -> Matrix.one_fin_three is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : One.{u1} α], Eq.{succ u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α) (OfNat.ofNat.{u1} (Matrix.{0, 0, u1} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α) 1 (OfNat.mk.{u1} (Matrix.{0, 0, u1} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α) 1 (One.one.{u1} (Matrix.{0, 0, u1} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α) (Matrix.hasOne.{u1, 0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α (fun (a : Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (b : Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) => Fin.decidableEq (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) a b) _inst_1 _inst_2)))) (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) (fun (_x : Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) => ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) -> (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) (Equiv.hasCoeToFun.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) (Matrix.of.{u1, 0, 0} (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)))) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α _inst_2))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α _inst_2))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α _inst_2))) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecEmpty.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α))))))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : One.{u1} α], Eq.{succ u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) (OfNat.ofNat.{u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) 1 (One.toOfNat1.{u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) (Matrix.one.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α (fun (a : Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (b : Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) => instDecidableEqFin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3)) a b) _inst_1 _inst_2))) (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α)) ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (fun (_x : (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) => Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α)) (Matrix.of.{u1, 0, 0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecEmpty.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α))))))
-Case conversion may be inaccurate. Consider using '#align matrix.one_fin_three Matrix.one_fin_threeₓ'. -/
theorem one_fin_three : (1 : Matrix (Fin 3) (Fin 3) α) = !![1, 0, 0; 0, 1, 0; 0, 0, 1] := by
ext (i j); fin_cases i <;> fin_cases j <;> rfl
#align matrix.one_fin_three Matrix.one_fin_three
@@ -639,22 +525,10 @@ theorem vec3_add [Add α] (a₀ a₁ a₂ b₀ b₁ b₂ : α) :
#align matrix.vec3_add Matrix.vec3_add
-/
-/- warning: matrix.smul_vec2 -> Matrix.smul_vec2 is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {R : Type.{u2}} [_inst_1 : SMul.{u2, u1} R α] (x : R) (a₀ : α) (a₁ : α), Eq.{succ u1} ((Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))))) -> α) (SMul.smul.{u2, u1} R ((Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))))) -> α) (Function.hasSMul.{0, u2, u1} (Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))))) R α _inst_1) x (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) a₀ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) a₁ (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (SMul.smul.{u2, u1} R α _inst_1 x a₀) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (SMul.smul.{u2, u1} R α _inst_1 x a₁) (Matrix.vecEmpty.{u1} α)))
-but is expected to have type
- forall {α : Type.{u2}} {R : Type.{u1}} [_inst_1 : SMul.{u1, u2} R α] (x : R) (a₀ : α) (a₁ : α), Eq.{succ u2} ((Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) -> α) (HSMul.hSMul.{u1, u2, u2} R ((Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) -> α) ((Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) -> α) (instHSMul.{u1, u2} R ((Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) R (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) => α) (fun (i : Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) => _inst_1))) x (Matrix.vecCons.{u2} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) a₀ (Matrix.vecCons.{u2} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) a₁ (Matrix.vecEmpty.{u2} α)))) (Matrix.vecCons.{u2} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (HSMul.hSMul.{u1, u2, u2} R α α (instHSMul.{u1, u2} R α _inst_1) x a₀) (Matrix.vecCons.{u2} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (HSMul.hSMul.{u1, u2, u2} R α α (instHSMul.{u1, u2} R α _inst_1) x a₁) (Matrix.vecEmpty.{u2} α)))
-Case conversion may be inaccurate. Consider using '#align matrix.smul_vec2 Matrix.smul_vec2ₓ'. -/
theorem smul_vec2 {R : Type _} [SMul R α] (x : R) (a₀ a₁ : α) : x • ![a₀, a₁] = ![x • a₀, x • a₁] :=
by rw [smul_cons, smul_cons, smul_empty]
#align matrix.smul_vec2 Matrix.smul_vec2
-/- warning: matrix.smul_vec3 -> Matrix.smul_vec3 is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {R : Type.{u2}} [_inst_1 : SMul.{u2, u1} R α] (x : R) (a₀ : α) (a₁ : α) (a₂ : α), Eq.{succ u1} ((Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))) -> α) (SMul.smul.{u2, u1} R ((Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))) -> α) (Function.hasSMul.{0, u2, u1} (Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))) R α _inst_1) x (Matrix.vecCons.{u1} α (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))) a₀ (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) a₁ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) a₂ (Matrix.vecEmpty.{u1} α))))) (Matrix.vecCons.{u1} α (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))) (SMul.smul.{u2, u1} R α _inst_1 x a₀) (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (SMul.smul.{u2, u1} R α _inst_1 x a₁) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (SMul.smul.{u2, u1} R α _inst_1 x a₂) (Matrix.vecEmpty.{u1} α))))
-but is expected to have type
- forall {α : Type.{u2}} {R : Type.{u1}} [_inst_1 : SMul.{u1, u2} R α] (x : R) (a₀ : α) (a₁ : α) (a₂ : α), Eq.{succ u2} ((Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) -> α) (HSMul.hSMul.{u1, u2, u2} R ((Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) -> α) ((Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) -> α) (instHSMul.{u1, u2} R ((Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) R (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) => α) (fun (i : Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) => _inst_1))) x (Matrix.vecCons.{u2} α (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))) a₀ (Matrix.vecCons.{u2} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) a₁ (Matrix.vecCons.{u2} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) a₂ (Matrix.vecEmpty.{u2} α))))) (Matrix.vecCons.{u2} α (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))) (HSMul.hSMul.{u1, u2, u2} R α α (instHSMul.{u1, u2} R α _inst_1) x a₀) (Matrix.vecCons.{u2} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (HSMul.hSMul.{u1, u2, u2} R α α (instHSMul.{u1, u2} R α _inst_1) x a₁) (Matrix.vecCons.{u2} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (HSMul.hSMul.{u1, u2, u2} R α α (instHSMul.{u1, u2} R α _inst_1) x a₂) (Matrix.vecEmpty.{u2} α))))
-Case conversion may be inaccurate. Consider using '#align matrix.smul_vec3 Matrix.smul_vec3ₓ'. -/
theorem smul_vec3 {R : Type _} [SMul R α] (x : R) (a₀ a₁ a₂ : α) :
x • ![a₀, a₁, a₂] = ![x • a₀, x • a₁, x • a₂] := by
rw [smul_cons, smul_cons, smul_cons, smul_empty]
@@ -662,45 +536,21 @@ theorem smul_vec3 {R : Type _} [SMul R α] (x : R) (a₀ a₁ a₂ : α) :
variable [AddCommMonoid α] [Mul α]
-/- warning: matrix.vec2_dot_product' -> Matrix.vec2_dotProduct' is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] {a₀ : α} {a₁ : α} {b₀ : α} {b₁ : α}, Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))))) α (Fin.fintype (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))))) _inst_2 _inst_1 (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) a₀ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) a₁ (Matrix.vecEmpty.{u1} α))) (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) b₀ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) b₁ (Matrix.vecEmpty.{u1} α)))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₀ b₀) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₁ b₁))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] {a₀ : α} {a₁ : α} {b₀ : α} {b₁ : α}, Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) α (Fin.fintype (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) _inst_2 _inst_1 (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) a₀ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) a₁ (Matrix.vecEmpty.{u1} α))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) b₀ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) b₁ (Matrix.vecEmpty.{u1} α)))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₀ b₀) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₁ b₁))
-Case conversion may be inaccurate. Consider using '#align matrix.vec2_dot_product' Matrix.vec2_dotProduct'ₓ'. -/
theorem vec2_dotProduct' {a₀ a₁ b₀ b₁ : α} : ![a₀, a₁] ⬝ᵥ ![b₀, b₁] = a₀ * b₀ + a₁ * b₁ := by
rw [cons_dot_product_cons, cons_dot_product_cons, dot_product_empty, add_zero]
#align matrix.vec2_dot_product' Matrix.vec2_dotProduct'
-/- warning: matrix.vec2_dot_product -> Matrix.vec2_dotProduct is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (w : (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α (Fin.fintype (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) _inst_2 _inst_1 v w) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (v (OfNat.ofNat.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 0 (OfNat.mk.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 0 (Zero.zero.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasZeroOfNeZero (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) (CharZero.NeZero.two.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring))) (StrictOrderedSemiring.to_charZero.{0} Nat Nat.strictOrderedSemiring))))))) (w (OfNat.ofNat.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 0 (OfNat.mk.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 0 (Zero.zero.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasZeroOfNeZero (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) (CharZero.NeZero.two.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring))) (StrictOrderedSemiring.to_charZero.{0} Nat Nat.strictOrderedSemiring)))))))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (v (OfNat.ofNat.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 1 (OfNat.mk.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 1 (One.one.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasOneOfNeZero (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) (CharZero.NeZero.two.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring))) (StrictOrderedSemiring.to_charZero.{0} Nat Nat.strictOrderedSemiring))))))) (w (OfNat.ofNat.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 1 (OfNat.mk.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 1 (One.one.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasOneOfNeZero (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) (CharZero.NeZero.two.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring))) (StrictOrderedSemiring.to_charZero.{0} Nat Nat.strictOrderedSemiring)))))))))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (w : (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α (Fin.fintype (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) _inst_2 _inst_1 v w) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (v (OfNat.ofNat.{0} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) 0 (Fin.instOfNatFin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) 0 (NeZero.succ (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))))) (w (OfNat.ofNat.{0} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) 0 (Fin.instOfNatFin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) 0 (NeZero.succ (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (v (OfNat.ofNat.{0} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) 1 (Fin.instOfNatFin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) 1 (NeZero.succ (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))))) (w (OfNat.ofNat.{0} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) 1 (Fin.instOfNatFin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) 1 (NeZero.succ (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))))))
-Case conversion may be inaccurate. Consider using '#align matrix.vec2_dot_product Matrix.vec2_dotProductₓ'. -/
@[simp]
theorem vec2_dotProduct (v w : Fin 2 → α) : v ⬝ᵥ w = v 0 * w 0 + v 1 * w 1 :=
vec2_dotProduct'
#align matrix.vec2_dot_product Matrix.vec2_dotProduct
-/- warning: matrix.vec3_dot_product' -> Matrix.vec3_dotProduct' is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] {a₀ : α} {a₁ : α} {a₂ : α} {b₀ : α} {b₁ : α} {b₂ : α}, Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))) α (Fin.fintype (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))) _inst_2 _inst_1 (Matrix.vecCons.{u1} α (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))) a₀ (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) a₁ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) a₂ (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} α (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))) b₀ (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) b₁ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) b₂ (Matrix.vecEmpty.{u1} α))))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₀ b₀) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₁ b₁)) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₂ b₂))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] {a₀ : α} {a₁ : α} {a₂ : α} {b₀ : α} {b₁ : α} {b₂ : α}, Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) α (Fin.fintype (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) _inst_2 _inst_1 (Matrix.vecCons.{u1} α (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))) a₀ (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) a₁ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) a₂ (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) b₀ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) b₁ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) b₂ (Matrix.vecEmpty.{u1} α))))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₀ b₀) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₁ b₁)) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₂ b₂))
-Case conversion may be inaccurate. Consider using '#align matrix.vec3_dot_product' Matrix.vec3_dotProduct'ₓ'. -/
theorem vec3_dotProduct' {a₀ a₁ a₂ b₀ b₁ b₂ : α} :
![a₀, a₁, a₂] ⬝ᵥ ![b₀, b₁, b₂] = a₀ * b₀ + a₁ * b₁ + a₂ * b₂ := by
rw [cons_dot_product_cons, cons_dot_product_cons, cons_dot_product_cons, dot_product_empty,
add_zero, add_assoc]
#align matrix.vec3_dot_product' Matrix.vec3_dotProduct'
-/- warning: matrix.vec3_dot_product -> Matrix.vec3_dotProduct is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (w : (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α (Fin.fintype (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) _inst_2 _inst_1 v w) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (v (OfNat.ofNat.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 0 (OfNat.mk.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 0 (Zero.zero.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasZeroOfNeZero (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) (ZeroLEOneClass.NeZero.three.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedSemiring.zeroLEOneClass.{0} Nat Nat.orderedSemiring) (NeZero.one.{0} Nat (NonAssocSemiring.toMulZeroOneClass.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring)) Nat.nontrivial) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)))))))) (w (OfNat.ofNat.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 0 (OfNat.mk.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 0 (Zero.zero.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasZeroOfNeZero (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) (ZeroLEOneClass.NeZero.three.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedSemiring.zeroLEOneClass.{0} Nat Nat.orderedSemiring) (NeZero.one.{0} Nat (NonAssocSemiring.toMulZeroOneClass.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring)) Nat.nontrivial) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring))))))))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (v (OfNat.ofNat.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 1 (OfNat.mk.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 1 (One.one.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasOneOfNeZero (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) (ZeroLEOneClass.NeZero.three.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedSemiring.zeroLEOneClass.{0} Nat Nat.orderedSemiring) (NeZero.one.{0} Nat (NonAssocSemiring.toMulZeroOneClass.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring)) Nat.nontrivial) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)))))))) (w (OfNat.ofNat.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 1 (OfNat.mk.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 1 (One.one.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasOneOfNeZero (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) (ZeroLEOneClass.NeZero.three.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedSemiring.zeroLEOneClass.{0} Nat Nat.orderedSemiring) (NeZero.one.{0} Nat (NonAssocSemiring.toMulZeroOneClass.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring)) Nat.nontrivial) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)))))))))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (v (OfNat.ofNat.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 2 (OfNat.mk.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 2 (bit0.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasAdd (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (One.one.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasOneOfNeZero (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) (ZeroLEOneClass.NeZero.three.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedSemiring.zeroLEOneClass.{0} Nat Nat.orderedSemiring) (NeZero.one.{0} Nat (NonAssocSemiring.toMulZeroOneClass.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring)) Nat.nontrivial) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring))))))))) (w (OfNat.ofNat.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 2 (OfNat.mk.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 2 (bit0.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasAdd (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (One.one.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasOneOfNeZero (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) (ZeroLEOneClass.NeZero.three.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedSemiring.zeroLEOneClass.{0} Nat Nat.orderedSemiring) (NeZero.one.{0} Nat (NonAssocSemiring.toMulZeroOneClass.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring)) Nat.nontrivial) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)))))))))))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (w : (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α (Fin.fintype (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) _inst_2 _inst_1 v w) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (v (OfNat.ofNat.{0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) 0 (Fin.instOfNatFin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3)) 0 (NeZero.succ (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)))))) (w (OfNat.ofNat.{0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) 0 (Fin.instOfNatFin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3)) 0 (NeZero.succ (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))))))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (v (OfNat.ofNat.{0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) 1 (Fin.instOfNatFin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3)) 1 (NeZero.succ (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)))))) (w (OfNat.ofNat.{0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) 1 (Fin.instOfNatFin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3)) 1 (NeZero.succ (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)))))))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (v (OfNat.ofNat.{0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) 2 (Fin.instOfNatFin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3)) 2 (NeZero.succ (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)))))) (w (OfNat.ofNat.{0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) 2 (Fin.instOfNatFin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3)) 2 (NeZero.succ (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))))))))
-Case conversion may be inaccurate. Consider using '#align matrix.vec3_dot_product Matrix.vec3_dotProductₓ'. -/
@[simp]
theorem vec3_dotProduct (v w : Fin 3 → α) : v ⬝ᵥ w = v 0 * w 0 + v 1 * w 1 + v 2 * w 2 :=
vec3_dotProduct'
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -74,9 +74,7 @@ unsafe instance Matrix.toExpr [Lean.ToLevel.{u}] [Lean.ToLevel.{u_1}] [Lean.ToLe
"./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[]" :
reflected _ @Matrix.{u_1, u_2, u}).subst₃
q(_) q(_) q(_)) <|
- by
- dsimp only [Matrix]
- exact h m
+ by dsimp only [Matrix]; exact h m
#align matrix.matrix.reflect Matrix.toExpr
-/
@@ -170,10 +168,7 @@ theorem head_val' (B : Fin m.succ → n' → α) (j : n') : (vecHead fun i => B
#print Matrix.tail_val' /-
@[simp]
theorem tail_val' (B : Fin m.succ → n' → α) (j : n') :
- (vecTail fun i => B i j) = fun i => vecTail B i j :=
- by
- ext
- simp [vec_tail]
+ (vecTail fun i => B i j) = fun i => vecTail B i j := by ext; simp [vec_tail]
#align matrix.tail_val' Matrix.tail_val'
-/
@@ -240,28 +235,20 @@ theorem col_empty (v : Fin 0 → α) : col v = vecEmpty :=
#print Matrix.col_cons /-
@[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 <;> simp [vec_head, vec_tail]
+theorem col_cons (x : α) (u : Fin m → α) : col (vecCons x u) = vecCons (fun _ => x) (col u) := by
+ ext (i j); refine' Fin.cases _ _ i <;> simp [vec_head, vec_tail]
#align matrix.col_cons Matrix.col_cons
-/
#print Matrix.row_empty /-
@[simp]
-theorem row_empty : row (vecEmpty : Fin 0 → α) = fun _ => vecEmpty :=
- by
- ext
- rfl
+theorem row_empty : row (vecEmpty : Fin 0 → α) = fun _ => vecEmpty := by ext; rfl
#align matrix.row_empty Matrix.row_empty
-/
#print Matrix.row_cons /-
@[simp]
-theorem row_cons (x : α) (u : Fin m → α) : row (vecCons x u) = fun _ => vecCons x u :=
- by
- ext
- rfl
+theorem row_cons (x : α) (u : Fin m → α) : row (vecCons x u) = fun _ => vecCons x u := by ext; rfl
#align matrix.row_cons Matrix.row_cons
-/
@@ -286,9 +273,7 @@ theorem transpose_empty_cols (A : Matrix (Fin 0) m' α) : Aᵀ = of fun i => ![]
#print Matrix.cons_transpose /-
@[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)
+ (of (vecCons v A))ᵀ = of fun i => vecCons (v i) (Aᵀ i) := by ext (i j);
refine' Fin.cases _ _ j <;> simp
#align matrix.cons_transpose Matrix.cons_transpose
-/
@@ -303,10 +288,8 @@ theorem head_transpose (A : Matrix m' (Fin n.succ) α) :
#print Matrix.tail_transpose /-
@[simp]
-theorem tail_transpose (A : Matrix m' (Fin n.succ) α) : vecTail (of.symm Aᵀ) = (vecTail ∘ A)ᵀ :=
- by
- ext (i j)
- rfl
+theorem tail_transpose (A : Matrix m' (Fin n.succ) α) : vecTail (of.symm Aᵀ) = (vecTail ∘ A)ᵀ := by
+ ext (i j); rfl
#align matrix.tail_transpose Matrix.tail_transpose
-/
@@ -364,12 +347,8 @@ theorem mul_val_succ [Fintype n'] (A : Matrix (Fin m.succ) n' α) (B : Matrix n'
#print Matrix.cons_mul /-
@[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
- simp [mul_val_succ]
+ of (vecCons v A) ⬝ B = of (vecCons (vecMul v B) (of.symm (of A ⬝ B))) := by ext (i j);
+ refine' Fin.cases _ _ i; · rfl; simp [mul_val_succ]
#align matrix.cons_mul Matrix.cons_mul
-/
@@ -400,9 +379,7 @@ theorem vecMul_empty [Fintype n'] (v : n' → α) (B : Matrix n' (Fin 0) α) : v
#print Matrix.cons_vecMul /-
@[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
+ vecMul (vecCons x v) (of B) = x • vecHead B + vecMul v (of <| vecTail B) := by ext i;
simp [vec_mul]
#align matrix.cons_vec_mul Matrix.cons_vecMul
-/
@@ -410,9 +387,7 @@ theorem cons_vecMul (x : α) (v : Fin n → α) (B : Fin n.succ → o' → α) :
#print Matrix.vecMul_cons /-
@[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
+ vecMul v (of <| vecCons w B) = vecHead v • w + vecMul (vecTail v) (of B) := by ext i;
simp [vec_mul]
#align matrix.vec_mul_cons Matrix.vecMul_cons
-/
@@ -451,9 +426,7 @@ theorem mulVec_empty (A : Matrix m' (Fin 0) α) (v : Fin 0 → α) : mulVec A v
#print Matrix.cons_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
+ mulVec (of <| vecCons v A) w = vecCons (dotProduct v w) (mulVec (of A) w) := by ext i;
refine' Fin.cases _ _ i <;> simp [mul_vec]
#align matrix.cons_mul_vec Matrix.cons_mulVec
-/
@@ -466,9 +439,7 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align matrix.mul_vec_cons Matrix.mulVec_consₓ'. -/
@[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
+ mulVec (of A) (vecCons x v) = x • vecHead ∘ A + mulVec (of (vecTail ∘ A)) v := by ext i;
simp [mul_vec, mul_comm]
#align matrix.mul_vec_cons Matrix.mulVec_cons
@@ -508,9 +479,7 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align matrix.cons_vec_mul_vec Matrix.cons_vecMulVecₓ'. -/
@[simp]
theorem cons_vecMulVec (x : α) (v : Fin m → α) (w : n' → α) :
- vecMulVec (vecCons x v) w = vecCons (x • w) (vecMulVec v w) :=
- by
- ext i
+ vecMulVec (vecCons x v) w = vecCons (x • w) (vecMulVec v w) := by ext i;
refine' Fin.cases _ _ i <;> simp [vec_mul_vec]
#align matrix.cons_vec_mul_vec Matrix.cons_vecMulVec
@@ -522,9 +491,7 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align matrix.vec_mul_vec_cons Matrix.vecMulVec_consₓ'. -/
@[simp]
theorem vecMulVec_cons (v : m' → α) (x : α) (w : Fin n → α) :
- vecMulVec v (vecCons x w) = fun i => v i • vecCons x w :=
- by
- ext (i j)
+ vecMulVec v (vecCons x w) = fun i => v i • vecCons x w := by ext (i j);
rw [vec_mul_vec_apply, Pi.smul_apply, smul_eq_mul]
#align matrix.vec_mul_vec_cons Matrix.vecMulVec_cons
@@ -553,10 +520,7 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align matrix.smul_mat_cons Matrix.smul_mat_consₓ'. -/
@[simp]
theorem smul_mat_cons (x : α) (v : n' → α) (A : Fin m → n' → α) :
- x • vecCons v A = vecCons (x • v) (x • A) :=
- by
- ext i
- refine' Fin.cases _ _ i <;> simp
+ x • vecCons v A = vecCons (x • v) (x • A) := by ext i; refine' Fin.cases _ _ i <;> simp
#align matrix.smul_mat_cons Matrix.smul_mat_cons
end Smul
@@ -574,10 +538,8 @@ theorem submatrix_empty (A : Matrix m' n' α) (row : Fin 0 → m') (col : o' →
#print Matrix.submatrix_cons_row /-
@[simp]
theorem submatrix_cons_row (A : Matrix m' n' α) (i : m') (row : Fin m → m') (col : o' → n') :
- submatrix A (vecCons i row) col = vecCons (fun j => A i (col j)) (submatrix A row col) :=
- by
- ext (i j)
- refine' Fin.cases _ _ i <;> simp [submatrix]
+ submatrix A (vecCons i row) col = vecCons (fun j => A i (col j)) (submatrix A row col) := by
+ ext (i j); refine' Fin.cases _ _ i <;> simp [submatrix]
#align matrix.submatrix_cons_row Matrix.submatrix_cons_row
-/
@@ -595,9 +557,7 @@ lean 3 declaration is
but is expected to have type
forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : One.{u1} α], Eq.{succ u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) (OfNat.ofNat.{u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) 1 (One.toOfNat1.{u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) (Matrix.one.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α (fun (a : Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (b : Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) => instDecidableEqFin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) a b) _inst_1 _inst_2))) (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α)) ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (fun (_x : (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) => Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α)) (Matrix.of.{u1, 0, 0} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecEmpty.{u1} α))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecEmpty.{u1} α))) (Matrix.vecEmpty.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α)))))
Case conversion may be inaccurate. Consider using '#align matrix.one_fin_two Matrix.one_fin_twoₓ'. -/
-theorem one_fin_two : (1 : Matrix (Fin 2) (Fin 2) α) = !![1, 0; 0, 1] :=
- by
- ext (i j)
+theorem one_fin_two : (1 : Matrix (Fin 2) (Fin 2) α) = !![1, 0; 0, 1] := by ext (i j);
fin_cases i <;> fin_cases j <;> rfl
#align matrix.one_fin_two Matrix.one_fin_two
@@ -607,27 +567,21 @@ lean 3 declaration is
but is expected to have type
forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : One.{u1} α], Eq.{succ u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) (OfNat.ofNat.{u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) 1 (One.toOfNat1.{u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) (Matrix.one.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α (fun (a : Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (b : Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) => instDecidableEqFin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3)) a b) _inst_1 _inst_2))) (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α)) ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (fun (_x : (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) => Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α)) (Matrix.of.{u1, 0, 0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecEmpty.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α))))))
Case conversion may be inaccurate. Consider using '#align matrix.one_fin_three Matrix.one_fin_threeₓ'. -/
-theorem one_fin_three : (1 : Matrix (Fin 3) (Fin 3) α) = !![1, 0, 0; 0, 1, 0; 0, 0, 1] :=
- by
- ext (i j)
- fin_cases i <;> fin_cases j <;> rfl
+theorem one_fin_three : (1 : Matrix (Fin 3) (Fin 3) α) = !![1, 0, 0; 0, 1, 0; 0, 0, 1] := by
+ ext (i j); fin_cases i <;> fin_cases j <;> rfl
#align matrix.one_fin_three Matrix.one_fin_three
end One
#print Matrix.eta_fin_two /-
-theorem eta_fin_two (A : Matrix (Fin 2) (Fin 2) α) : A = !![A 0 0, A 0 1; A 1 0, A 1 1] :=
- by
- ext (i j)
- fin_cases i <;> fin_cases j <;> rfl
+theorem eta_fin_two (A : Matrix (Fin 2) (Fin 2) α) : A = !![A 0 0, A 0 1; A 1 0, A 1 1] := by
+ ext (i j); fin_cases i <;> fin_cases j <;> rfl
#align matrix.eta_fin_two Matrix.eta_fin_two
-/
#print Matrix.eta_fin_three /-
theorem eta_fin_three (A : Matrix (Fin 3) (Fin 3) α) :
- A = !![A 0 0, A 0 1, A 0 2; A 1 0, A 1 1, A 1 2; A 2 0, A 2 1, A 2 2] :=
- by
- ext (i j)
+ A = !![A 0 0, A 0 1, A 0 2; A 1 0, A 1 1, A 1 2; A 2 0, A 2 1, A 2 2] := by ext (i j);
fin_cases i <;> fin_cases j <;> rfl
#align matrix.eta_fin_three Matrix.eta_fin_three
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/75e7fca56381d056096ce5d05e938f63a6567828
@@ -504,7 +504,7 @@ theorem vecMulVec_empty (v : m' → α) (w : Fin 0 → α) : vecMulVec v w = fun
lean 3 declaration is
forall {α : Type.{u1}} {m : Nat} {n' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (x : α) (v : (Fin m) -> α) (w : n' -> α), Eq.{succ (max u2 u1)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (Matrix.vecMulVec.{u1, 0, u2} (Fin (Nat.succ m)) n' α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) (Matrix.vecCons.{u1} α m x v) w) (Matrix.vecCons.{max u2 u1} (n' -> α) m (SMul.smul.{u1, max u2 u1} α (n' -> α) (Function.hasSMul.{u2, u1, u1} n' α α (Mul.toSMul.{u1} α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))))) x w) (Matrix.vecMulVec.{u1, 0, u2} (Fin m) n' α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) v w))
but is expected to have type
- forall {α : Type.{u1}} {m : Nat} {n' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (x : α) (v : (Fin m) -> α) (w : n' -> α), Eq.{max (succ u1) (succ u2)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (Matrix.vecMulVec.{u1, 0, u2} (Fin (Nat.succ m)) n' α (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (Matrix.vecCons.{u1} α m x v) w) (Matrix.vecCons.{max u1 u2} (n' -> α) m (HSMul.hSMul.{u1, max u1 u2, max u1 u2} α (n' -> α) (n' -> α) (instHSMul.{u1, max u1 u2} α (n' -> α) (Pi.instSMul.{u2, u1, u1} n' α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4067 : n') => α) (fun (i : n') => SMulZeroClass.toSMul.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MulZeroClass.toSMulWithZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))))))) x w) (Matrix.vecMulVec.{u1, 0, u2} (Fin m) n' α (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) v w))
+ forall {α : Type.{u1}} {m : Nat} {n' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (x : α) (v : (Fin m) -> α) (w : n' -> α), Eq.{max (succ u1) (succ u2)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (Matrix.vecMulVec.{u1, 0, u2} (Fin (Nat.succ m)) n' α (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (Matrix.vecCons.{u1} α m x v) w) (Matrix.vecCons.{max u1 u2} (n' -> α) m (HSMul.hSMul.{u1, max u1 u2, max u1 u2} α (n' -> α) (n' -> α) (instHSMul.{u1, max u1 u2} α (n' -> α) (Pi.instSMul.{u2, u1, u1} n' α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4071 : n') => α) (fun (i : n') => SMulZeroClass.toSMul.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MulZeroClass.toSMulWithZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))))))) x w) (Matrix.vecMulVec.{u1, 0, u2} (Fin m) n' α (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) v w))
Case conversion may be inaccurate. Consider using '#align matrix.cons_vec_mul_vec Matrix.cons_vecMulVecₓ'. -/
@[simp]
theorem cons_vecMulVec (x : α) (v : Fin m → α) (w : n' → α) :
@@ -538,7 +538,7 @@ variable [Semiring α]
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : Semiring.{u1} α] {m' : Type.{u2}} (x : α) (A : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> m' -> α), Eq.{succ (max u2 u1)} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> m' -> α) (SMul.smul.{u1, max u2 u1} α ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> m' -> α) (Function.hasSMul.{0, u1, max u2 u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α (m' -> α) (Function.hasSMul.{u2, u1, u1} m' α α (Mul.toSMul.{u1} α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))) x A) (Matrix.vecEmpty.{max u2 u1} (m' -> α))
but is expected to have type
- forall {α : Type.{u2}} [_inst_1 : Semiring.{u2} α] {m' : Type.{u1}} (x : α) (A : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> m' -> α), Eq.{max (succ u2) (succ u1)} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> m' -> α) (HSMul.hSMul.{u2, max u2 u1, max u2 u1} α ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> m' -> α) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> m' -> α) (instHSMul.{u2, max u2 u1} α ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> m' -> α) (Pi.instSMul.{0, max u2 u1, u2} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4255 : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => m' -> α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => Pi.instSMul.{u1, u2, u2} m' α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4258 : m') => α) (fun (i : m') => SMulZeroClass.toSMul.{u2, u2} α α (MonoidWithZero.toZero.{u2} α (Semiring.toMonoidWithZero.{u2} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u2, u2} α α (MonoidWithZero.toZero.{u2} α (Semiring.toMonoidWithZero.{u2} α _inst_1)) (MonoidWithZero.toZero.{u2} α (Semiring.toMonoidWithZero.{u2} α _inst_1)) (MulZeroClass.toSMulWithZero.{u2} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u2} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} α (Semiring.toNonAssocSemiring.{u2} α _inst_1))))))))) x A) (Matrix.vecEmpty.{max u2 u1} (m' -> α))
+ forall {α : Type.{u2}} [_inst_1 : Semiring.{u2} α] {m' : Type.{u1}} (x : α) (A : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> m' -> α), Eq.{max (succ u2) (succ u1)} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> m' -> α) (HSMul.hSMul.{u2, max u2 u1, max u2 u1} α ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> m' -> α) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> m' -> α) (instHSMul.{u2, max u2 u1} α ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> m' -> α) (Pi.instSMul.{0, max u2 u1, u2} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4259 : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => m' -> α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => Pi.instSMul.{u1, u2, u2} m' α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4262 : m') => α) (fun (i : m') => SMulZeroClass.toSMul.{u2, u2} α α (MonoidWithZero.toZero.{u2} α (Semiring.toMonoidWithZero.{u2} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u2, u2} α α (MonoidWithZero.toZero.{u2} α (Semiring.toMonoidWithZero.{u2} α _inst_1)) (MonoidWithZero.toZero.{u2} α (Semiring.toMonoidWithZero.{u2} α _inst_1)) (MulZeroClass.toSMulWithZero.{u2} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u2} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} α (Semiring.toNonAssocSemiring.{u2} α _inst_1))))))))) x A) (Matrix.vecEmpty.{max u2 u1} (m' -> α))
Case conversion may be inaccurate. Consider using '#align matrix.smul_mat_empty Matrix.smul_mat_emptyₓ'. -/
@[simp]
theorem smul_mat_empty {m' : Type _} (x : α) (A : Fin 0 → m' → α) : x • A = ![] :=
@@ -549,7 +549,7 @@ theorem smul_mat_empty {m' : Type _} (x : α) (A : Fin 0 → m' → α) : x •
lean 3 declaration is
forall {α : Type.{u1}} {m : Nat} {n' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (x : α) (v : n' -> α) (A : (Fin m) -> n' -> α), Eq.{succ (max u2 u1)} ((Fin (Nat.succ m)) -> n' -> α) (SMul.smul.{u1, max u2 u1} α ((Fin (Nat.succ m)) -> n' -> α) (Function.hasSMul.{0, u1, max u2 u1} (Fin (Nat.succ m)) α (n' -> α) (Function.hasSMul.{u2, u1, u1} n' α α (Mul.toSMul.{u1} α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))) x (Matrix.vecCons.{max u2 u1} (n' -> α) m v A)) (Matrix.vecCons.{max u2 u1} (n' -> α) m (SMul.smul.{u1, max u2 u1} α (n' -> α) (Function.hasSMul.{u2, u1, u1} n' α α (Mul.toSMul.{u1} α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))))) x v) (SMul.smul.{u1, max u2 u1} α ((Fin m) -> n' -> α) (Function.hasSMul.{0, u1, max u2 u1} (Fin m) α (n' -> α) (Function.hasSMul.{u2, u1, u1} n' α α (Mul.toSMul.{u1} α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))) x A))
but is expected to have type
- forall {α : Type.{u1}} {m : Nat} {n' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (x : α) (v : n' -> α) (A : (Fin m) -> n' -> α), Eq.{max (succ u1) (succ u2)} ((Fin (Nat.succ m)) -> n' -> α) (HSMul.hSMul.{u1, max u1 u2, max u1 u2} α ((Fin (Nat.succ m)) -> n' -> α) ((Fin (Nat.succ m)) -> n' -> α) (instHSMul.{u1, max u1 u2} α ((Fin (Nat.succ m)) -> n' -> α) (Pi.instSMul.{0, max u1 u2, u1} (Fin (Nat.succ m)) α (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ m)) => n' -> α) (fun (i : Fin (Nat.succ m)) => Pi.instSMul.{u2, u1, u1} n' α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4297 : n') => α) (fun (i : n') => SMulZeroClass.toSMul.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MulZeroClass.toSMulWithZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))))) x (Matrix.vecCons.{max u1 u2} (n' -> α) m v A)) (Matrix.vecCons.{max u1 u2} (n' -> α) m (HSMul.hSMul.{u1, max u1 u2, max u1 u2} α (n' -> α) (n' -> α) (instHSMul.{u1, max u1 u2} α (n' -> α) (Pi.instSMul.{u2, u1, u1} n' α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4297 : n') => α) (fun (i : n') => SMulZeroClass.toSMul.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MulZeroClass.toSMulWithZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))))))) x v) (HSMul.hSMul.{u1, max u1 u2, max u1 u2} α ((Fin m) -> n' -> α) ((Fin m) -> n' -> α) (instHSMul.{u1, max u1 u2} α ((Fin m) -> n' -> α) (Pi.instSMul.{0, max u1 u2, u1} (Fin m) α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4300 : Fin m) => n' -> α) (fun (i : Fin m) => Pi.instSMul.{u2, u1, u1} n' α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4303 : n') => α) (fun (i : n') => SMulZeroClass.toSMul.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MulZeroClass.toSMulWithZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))))) x A))
+ forall {α : Type.{u1}} {m : Nat} {n' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (x : α) (v : n' -> α) (A : (Fin m) -> n' -> α), Eq.{max (succ u1) (succ u2)} ((Fin (Nat.succ m)) -> n' -> α) (HSMul.hSMul.{u1, max u1 u2, max u1 u2} α ((Fin (Nat.succ m)) -> n' -> α) ((Fin (Nat.succ m)) -> n' -> α) (instHSMul.{u1, max u1 u2} α ((Fin (Nat.succ m)) -> n' -> α) (Pi.instSMul.{0, max u1 u2, u1} (Fin (Nat.succ m)) α (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ m)) => n' -> α) (fun (i : Fin (Nat.succ m)) => Pi.instSMul.{u2, u1, u1} n' α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4301 : n') => α) (fun (i : n') => SMulZeroClass.toSMul.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MulZeroClass.toSMulWithZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))))) x (Matrix.vecCons.{max u1 u2} (n' -> α) m v A)) (Matrix.vecCons.{max u1 u2} (n' -> α) m (HSMul.hSMul.{u1, max u1 u2, max u1 u2} α (n' -> α) (n' -> α) (instHSMul.{u1, max u1 u2} α (n' -> α) (Pi.instSMul.{u2, u1, u1} n' α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4301 : n') => α) (fun (i : n') => SMulZeroClass.toSMul.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MulZeroClass.toSMulWithZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))))))) x v) (HSMul.hSMul.{u1, max u1 u2, max u1 u2} α ((Fin m) -> n' -> α) ((Fin m) -> n' -> α) (instHSMul.{u1, max u1 u2} α ((Fin m) -> n' -> α) (Pi.instSMul.{0, max u1 u2, u1} (Fin m) α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4304 : Fin m) => n' -> α) (fun (i : Fin m) => Pi.instSMul.{u2, u1, u1} n' α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4307 : n') => α) (fun (i : n') => SMulZeroClass.toSMul.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MulZeroClass.toSMulWithZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))))) x A))
Case conversion may be inaccurate. Consider using '#align matrix.smul_mat_cons Matrix.smul_mat_consₓ'. -/
@[simp]
theorem smul_mat_cons (x : α) (v : n' → α) (A : Fin m → n' → α) :
mathlib commit https://github.com/leanprover-community/mathlib/commit/f51de8769c34652d82d1c8e5f8f18f8374782bed
@@ -708,15 +708,15 @@ theorem smul_vec3 {R : Type _} [SMul R α] (x : R) (a₀ a₁ a₂ : α) :
variable [AddCommMonoid α] [Mul α]
-/- warning: matrix.vec2_dot_product' -> Matrix.vec2_dot_product' is a dubious translation:
+/- warning: matrix.vec2_dot_product' -> Matrix.vec2_dotProduct' is a dubious translation:
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] {a₀ : α} {a₁ : α} {b₀ : α} {b₁ : α}, Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))))) α (Fin.fintype (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))))) _inst_2 _inst_1 (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) a₀ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) a₁ (Matrix.vecEmpty.{u1} α))) (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) b₀ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) b₁ (Matrix.vecEmpty.{u1} α)))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₀ b₀) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₁ b₁))
but is expected to have type
forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] {a₀ : α} {a₁ : α} {b₀ : α} {b₁ : α}, Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) α (Fin.fintype (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) _inst_2 _inst_1 (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) a₀ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) a₁ (Matrix.vecEmpty.{u1} α))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) b₀ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) b₁ (Matrix.vecEmpty.{u1} α)))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₀ b₀) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₁ b₁))
-Case conversion may be inaccurate. Consider using '#align matrix.vec2_dot_product' Matrix.vec2_dot_product'ₓ'. -/
-theorem vec2_dot_product' {a₀ a₁ b₀ b₁ : α} : ![a₀, a₁] ⬝ᵥ ![b₀, b₁] = a₀ * b₀ + a₁ * b₁ := by
+Case conversion may be inaccurate. Consider using '#align matrix.vec2_dot_product' Matrix.vec2_dotProduct'ₓ'. -/
+theorem vec2_dotProduct' {a₀ a₁ b₀ b₁ : α} : ![a₀, a₁] ⬝ᵥ ![b₀, b₁] = a₀ * b₀ + a₁ * b₁ := by
rw [cons_dot_product_cons, cons_dot_product_cons, dot_product_empty, add_zero]
-#align matrix.vec2_dot_product' Matrix.vec2_dot_product'
+#align matrix.vec2_dot_product' Matrix.vec2_dotProduct'
/- warning: matrix.vec2_dot_product -> Matrix.vec2_dotProduct is a dubious translation:
lean 3 declaration is
@@ -726,20 +726,20 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align matrix.vec2_dot_product Matrix.vec2_dotProductₓ'. -/
@[simp]
theorem vec2_dotProduct (v w : Fin 2 → α) : v ⬝ᵥ w = v 0 * w 0 + v 1 * w 1 :=
- vec2_dot_product'
+ vec2_dotProduct'
#align matrix.vec2_dot_product Matrix.vec2_dotProduct
-/- warning: matrix.vec3_dot_product' -> Matrix.vec3_dot_product' is a dubious translation:
+/- warning: matrix.vec3_dot_product' -> Matrix.vec3_dotProduct' is a dubious translation:
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] {a₀ : α} {a₁ : α} {a₂ : α} {b₀ : α} {b₁ : α} {b₂ : α}, Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))) α (Fin.fintype (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))) _inst_2 _inst_1 (Matrix.vecCons.{u1} α (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))) a₀ (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) a₁ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) a₂ (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} α (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))) b₀ (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) b₁ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) b₂ (Matrix.vecEmpty.{u1} α))))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₀ b₀) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₁ b₁)) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₂ b₂))
but is expected to have type
forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] {a₀ : α} {a₁ : α} {a₂ : α} {b₀ : α} {b₁ : α} {b₂ : α}, Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) α (Fin.fintype (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) _inst_2 _inst_1 (Matrix.vecCons.{u1} α (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))) a₀ (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) a₁ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) a₂ (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) b₀ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) b₁ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) b₂ (Matrix.vecEmpty.{u1} α))))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₀ b₀) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₁ b₁)) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₂ b₂))
-Case conversion may be inaccurate. Consider using '#align matrix.vec3_dot_product' Matrix.vec3_dot_product'ₓ'. -/
-theorem vec3_dot_product' {a₀ a₁ a₂ b₀ b₁ b₂ : α} :
+Case conversion may be inaccurate. Consider using '#align matrix.vec3_dot_product' Matrix.vec3_dotProduct'ₓ'. -/
+theorem vec3_dotProduct' {a₀ a₁ a₂ b₀ b₁ b₂ : α} :
![a₀, a₁, a₂] ⬝ᵥ ![b₀, b₁, b₂] = a₀ * b₀ + a₁ * b₁ + a₂ * b₂ := by
rw [cons_dot_product_cons, cons_dot_product_cons, cons_dot_product_cons, dot_product_empty,
add_zero, add_assoc]
-#align matrix.vec3_dot_product' Matrix.vec3_dot_product'
+#align matrix.vec3_dot_product' Matrix.vec3_dotProduct'
/- warning: matrix.vec3_dot_product -> Matrix.vec3_dotProduct is a dubious translation:
lean 3 declaration is
@@ -749,7 +749,7 @@ but is expected to have type
Case conversion may be inaccurate. Consider using '#align matrix.vec3_dot_product Matrix.vec3_dotProductₓ'. -/
@[simp]
theorem vec3_dotProduct (v w : Fin 3 → α) : v ⬝ᵥ w = v 0 * w 0 + v 1 * w 1 + v 2 * w 2 :=
- vec3_dot_product'
+ vec3_dotProduct'
#align matrix.vec3_dot_product Matrix.vec3_dotProduct
end Vec2AndVec3
mathlib commit https://github.com/leanprover-community/mathlib/commit/95a87616d63b3cb49d3fe678d416fbe9c4217bf4
@@ -320,7 +320,7 @@ variable [Semiring α]
lean 3 declaration is
forall {α : Type.{u1}} {n' : Type.{u2}} {o' : Type.{u3}} [_inst_1 : Semiring.{u1} α] [_inst_2 : Fintype.{u2} n'] (A : Matrix.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) n' α) (B : Matrix.{u2, u3, u1} n' o' α), Eq.{succ (max u3 u1)} (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α) (Matrix.mul.{u1, 0, u2, u3} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) n' o' α _inst_2 (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B) (coeFn.{max 1 (max (max 1 (succ u3) (succ u1)) (succ (max u3 u1))) (succ (max u3 u1)) 1 (succ u3) (succ u1), max (max 1 (succ u3) (succ u1)) (succ (max u3 u1))} (Equiv.{max 1 (succ u3) (succ u1), succ (max u3 u1)} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> o' -> α) (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α)) (fun (_x : Equiv.{max 1 (succ u3) (succ u1), succ (max u3 u1)} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> o' -> α) (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α)) => ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> o' -> α) -> (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α)) (Equiv.hasCoeToFun.{max 1 (succ u3) (succ u1), succ (max u3 u1)} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> o' -> α) (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α)) (Matrix.of.{u1, 0, u3} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α) (Matrix.vecEmpty.{max u3 u1} (o' -> α)))
but is expected to have type
- forall {α : Type.{u1}} {n' : Type.{u2}} {o' : Type.{u3}} [_inst_1 : Semiring.{u1} α] [_inst_2 : Fintype.{u2} n'] (A : Matrix.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) n' α) (B : Matrix.{u2, u3, u1} n' o' α), Eq.{max (succ u1) (succ u3)} (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α) (Matrix.mul.{u1, 0, u2, u3} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) n' o' α _inst_2 (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B) (FunLike.coe.{max (succ u3) (succ u1), max (succ u3) (succ u1), max (succ u3) (succ u1)} (Equiv.{max (succ u1) (succ u3), max (max (succ u1) (succ u3)) 1} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> o' -> α) (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α)) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> o' -> α) (fun (_x : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> o' -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> o' -> α) => Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α) _x) (Equiv.instFunLikeEquiv.{max (succ u3) (succ u1), max (succ u3) (succ u1)} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> o' -> α) (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α)) (Matrix.of.{u1, 0, u3} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α) (Matrix.vecEmpty.{max u3 u1} (o' -> α)))
+ forall {α : Type.{u1}} {n' : Type.{u2}} {o' : Type.{u3}} [_inst_1 : Semiring.{u1} α] [_inst_2 : Fintype.{u2} n'] (A : Matrix.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) n' α) (B : Matrix.{u2, u3, u1} n' o' α), Eq.{max (succ u1) (succ u3)} (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α) (Matrix.mul.{u1, 0, u2, u3} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) n' o' α _inst_2 (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B) (FunLike.coe.{max (succ u3) (succ u1), max (succ u3) (succ u1), max (succ u3) (succ u1)} (Equiv.{max (succ u1) (succ u3), max (max (succ u1) (succ u3)) 1} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> o' -> α) (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α)) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> o' -> α) (fun (_x : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> o' -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> o' -> α) => Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α) _x) (Equiv.instFunLikeEquiv.{max (succ u3) (succ u1), max (succ u3) (succ u1)} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> o' -> α) (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α)) (Matrix.of.{u1, 0, u3} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α) (Matrix.vecEmpty.{max u3 u1} (o' -> α)))
Case conversion may be inaccurate. Consider using '#align matrix.empty_mul Matrix.empty_mulₓ'. -/
@[simp]
theorem empty_mul [Fintype n'] (A : Matrix (Fin 0) n' α) (B : Matrix n' o' α) : A ⬝ B = of ![] :=
@@ -342,7 +342,7 @@ theorem empty_mul_empty (A : Matrix m' (Fin 0) α) (B : Matrix (Fin 0) o' α) :
lean 3 declaration is
forall {α : Type.{u1}} {m' : Type.{u2}} {n' : Type.{u3}} [_inst_1 : Semiring.{u1} α] [_inst_2 : Fintype.{u3} n'] (A : Matrix.{u2, u3, u1} m' n' α) (B : Matrix.{u3, 0, u1} n' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α), Eq.{succ (max u2 u1)} (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α) (Matrix.mul.{u1, u2, u3, 0} m' n' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α _inst_2 (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B) (coeFn.{max 1 (max (max (succ u2) (succ u1)) (succ (max u2 u1))) (succ (max u2 u1)) (succ u2) (succ u1), max (max (succ u2) (succ u1)) (succ (max u2 u1))} (Equiv.{max (succ u2) (succ u1), succ (max u2 u1)} (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α)) (fun (_x : Equiv.{max (succ u2) (succ u1), succ (max u2 u1)} (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α)) => (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) -> (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α)) (Equiv.hasCoeToFun.{max (succ u2) (succ u1), succ (max u2 u1)} (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α)) (Matrix.of.{u1, u2, 0} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α) (fun (_x : m') => Matrix.vecEmpty.{u1} α))
but is expected to have type
- forall {α : Type.{u1}} {m' : Type.{u2}} {n' : Type.{u3}} [_inst_1 : Semiring.{u1} α] [_inst_2 : Fintype.{u3} n'] (A : Matrix.{u2, u3, u1} m' n' α) (B : Matrix.{u3, 0, u1} n' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α), Eq.{max (succ u1) (succ u2)} (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) (Matrix.mul.{u1, u2, u3, 0} m' n' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α _inst_2 (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B) (FunLike.coe.{max (succ u2) (succ u1), max (succ u2) (succ u1), max (succ u2) (succ u1)} (Equiv.{max (max (succ u1) (succ u2)) 1, max (succ u1) (succ u2)} (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α)) (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (fun (_x : m' -> (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : m' -> (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) => Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) _x) (Equiv.instFunLikeEquiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α)) (Matrix.of.{u1, u2, 0} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) (fun (_x : m') => Matrix.vecEmpty.{u1} α))
+ forall {α : Type.{u1}} {m' : Type.{u2}} {n' : Type.{u3}} [_inst_1 : Semiring.{u1} α] [_inst_2 : Fintype.{u3} n'] (A : Matrix.{u2, u3, u1} m' n' α) (B : Matrix.{u3, 0, u1} n' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α), Eq.{max (succ u1) (succ u2)} (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) (Matrix.mul.{u1, u2, u3, 0} m' n' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α _inst_2 (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B) (FunLike.coe.{max (succ u2) (succ u1), max (succ u2) (succ u1), max (succ u2) (succ u1)} (Equiv.{max (max (succ u1) (succ u2)) 1, max (succ u1) (succ u2)} (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α)) (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (fun (_x : m' -> (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : m' -> (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) => Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) _x) (Equiv.instFunLikeEquiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α)) (Matrix.of.{u1, u2, 0} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) (fun (_x : m') => Matrix.vecEmpty.{u1} α))
Case conversion may be inaccurate. Consider using '#align matrix.mul_empty Matrix.mul_emptyₓ'. -/
@[simp]
theorem mul_empty [Fintype n'] (A : Matrix m' n' α) (B : Matrix n' (Fin 0) α) :
@@ -354,7 +354,7 @@ theorem mul_empty [Fintype n'] (A : Matrix m' n' α) (B : Matrix n' (Fin 0) α)
lean 3 declaration is
forall {α : Type.{u1}} {m : Nat} {n' : Type.{u2}} {o' : Type.{u3}} [_inst_1 : Semiring.{u1} α] [_inst_2 : Fintype.{u2} n'] (A : Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (B : Matrix.{u2, u3, u1} n' o' α) (i : Fin m) (j : o'), Eq.{succ u1} α (Matrix.mul.{u1, 0, u2, u3} (Fin (Nat.succ m)) n' o' α _inst_2 (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B (Fin.succ m i) j) (Matrix.mul.{u1, 0, u2, u3} (Fin m) n' o' α _inst_2 (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (coeFn.{max 1 (max (max 1 (succ u2) (succ u1)) (succ (max u2 u1))) (succ (max u2 u1)) 1 (succ u2) (succ u1), max (max 1 (succ u2) (succ u1)) (succ (max u2 u1))} (Equiv.{max 1 (succ u2) (succ u1), succ (max u2 u1)} ((Fin m) -> n' -> α) (Matrix.{0, u2, u1} (Fin m) n' α)) (fun (_x : Equiv.{max 1 (succ u2) (succ u1), succ (max u2 u1)} ((Fin m) -> n' -> α) (Matrix.{0, u2, u1} (Fin m) n' α)) => ((Fin m) -> n' -> α) -> (Matrix.{0, u2, u1} (Fin m) n' α)) (Equiv.hasCoeToFun.{max 1 (succ u2) (succ u1), succ (max u2 u1)} ((Fin m) -> n' -> α) (Matrix.{0, u2, u1} (Fin m) n' α)) (Matrix.of.{u1, 0, u2} (Fin m) n' α) (Matrix.vecTail.{max u2 u1} (n' -> α) m (coeFn.{max 1 (max (succ (max u2 u1)) 1 (succ u2) (succ u1)) (max 1 (succ u2) (succ u1)) (succ (max u2 u1)), max (succ (max u2 u1)) 1 (succ u2) (succ u1)} (Equiv.{succ (max u2 u1), max 1 (succ u2) (succ u1)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) ((Fin (Nat.succ m)) -> n' -> α)) (fun (_x : Equiv.{succ (max u2 u1), max 1 (succ u2) (succ u1)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) ((Fin (Nat.succ m)) -> n' -> α)) => (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) -> (Fin (Nat.succ m)) -> n' -> α) (Equiv.hasCoeToFun.{succ (max u2 u1), max 1 (succ u2) (succ u1)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) ((Fin (Nat.succ m)) -> n' -> α)) (Equiv.symm.{max 1 (succ u2) (succ u1), succ (max u2 u1)} ((Fin (Nat.succ m)) -> n' -> α) (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (Matrix.of.{u1, 0, u2} (Fin (Nat.succ m)) n' α)) A))) B i j)
but is expected to have type
- forall {α : Type.{u1}} {m : Nat} {n' : Type.{u2}} {o' : Type.{u3}} [_inst_1 : Semiring.{u1} α] [_inst_2 : Fintype.{u2} n'] (A : Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (B : Matrix.{u2, u3, u1} n' o' α) (i : Fin m) (j : o'), Eq.{succ u1} α (Matrix.mul.{u1, 0, u2, u3} (Fin (Nat.succ m)) n' o' α _inst_2 (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B (Fin.succ m i) j) (Matrix.mul.{u1, 0, u2, u3} (Fin m) n' o' α _inst_2 (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (FunLike.coe.{max (succ u2) (succ u1), max (succ u2) (succ u1), max (succ u2) (succ u1)} (Equiv.{max (succ u1) (succ u2), max (max (succ u1) (succ u2)) 1} ((Fin m) -> n' -> α) (Matrix.{0, u2, u1} (Fin m) n' α)) ((Fin m) -> n' -> α) (fun (_x : (Fin m) -> n' -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : (Fin m) -> n' -> α) => Matrix.{0, u2, u1} (Fin m) n' α) _x) (Equiv.instFunLikeEquiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} ((Fin m) -> n' -> α) (Matrix.{0, u2, u1} (Fin m) n' α)) (Matrix.of.{u1, 0, u2} (Fin m) n' α) (Matrix.vecTail.{max u2 u1} (n' -> α) m (FunLike.coe.{max (succ u2) (succ u1), max (succ u2) (succ u1), max (succ u2) (succ u1)} (Equiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) ((Fin (Nat.succ m)) -> n' -> α)) (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (fun (_x : Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) => (Fin (Nat.succ m)) -> n' -> α) _x) (Equiv.instFunLikeEquiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) ((Fin (Nat.succ m)) -> n' -> α)) (Equiv.symm.{max (succ u2) (succ u1), max (succ u2) (succ u1)} ((Fin (Nat.succ m)) -> n' -> α) (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (Matrix.of.{u1, 0, u2} (Fin (Nat.succ m)) n' α)) A))) B i j)
+ forall {α : Type.{u1}} {m : Nat} {n' : Type.{u2}} {o' : Type.{u3}} [_inst_1 : Semiring.{u1} α] [_inst_2 : Fintype.{u2} n'] (A : Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (B : Matrix.{u2, u3, u1} n' o' α) (i : Fin m) (j : o'), Eq.{succ u1} α (Matrix.mul.{u1, 0, u2, u3} (Fin (Nat.succ m)) n' o' α _inst_2 (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B (Fin.succ m i) j) (Matrix.mul.{u1, 0, u2, u3} (Fin m) n' o' α _inst_2 (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (FunLike.coe.{max (succ u2) (succ u1), max (succ u2) (succ u1), max (succ u2) (succ u1)} (Equiv.{max (succ u1) (succ u2), max (max (succ u1) (succ u2)) 1} ((Fin m) -> n' -> α) (Matrix.{0, u2, u1} (Fin m) n' α)) ((Fin m) -> n' -> α) (fun (_x : (Fin m) -> n' -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : (Fin m) -> n' -> α) => Matrix.{0, u2, u1} (Fin m) n' α) _x) (Equiv.instFunLikeEquiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} ((Fin m) -> n' -> α) (Matrix.{0, u2, u1} (Fin m) n' α)) (Matrix.of.{u1, 0, u2} (Fin m) n' α) (Matrix.vecTail.{max u2 u1} (n' -> α) m (FunLike.coe.{max (succ u2) (succ u1), max (succ u2) (succ u1), max (succ u2) (succ u1)} (Equiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) ((Fin (Nat.succ m)) -> n' -> α)) (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (fun (_x : Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) => (Fin (Nat.succ m)) -> n' -> α) _x) (Equiv.instFunLikeEquiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) ((Fin (Nat.succ m)) -> n' -> α)) (Equiv.symm.{max (succ u2) (succ u1), max (succ u2) (succ u1)} ((Fin (Nat.succ m)) -> n' -> α) (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (Matrix.of.{u1, 0, u2} (Fin (Nat.succ m)) n' α)) A))) B i j)
Case conversion may be inaccurate. Consider using '#align matrix.mul_val_succ Matrix.mul_val_succₓ'. -/
theorem mul_val_succ [Fintype n'] (A : Matrix (Fin m.succ) n' α) (B : Matrix n' o' α) (i : Fin m)
(j : o') : (A ⬝ B) i.succ j = (of (vecTail (of.symm A)) ⬝ B) i j :=
@@ -462,7 +462,7 @@ theorem cons_mulVec [Fintype n'] (v : n' → α) (A : Fin m → n' → α) (w :
lean 3 declaration is
forall {n : Nat} {m' : Type.{u1}} {α : Type.{u2}} [_inst_2 : CommSemiring.{u2} α] (A : m' -> (Fin (Nat.succ n)) -> α) (x : α) (v : (Fin n) -> α), Eq.{max (succ u1) (succ u2)} (m' -> α) (Matrix.mulVec.{u2, u1, 0} m' (Fin (Nat.succ n)) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} α (Semiring.toNonAssocSemiring.{u2} α (CommSemiring.toSemiring.{u2} α _inst_2))) (Fin.fintype (Nat.succ n)) (coeFn.{max 1 (max (max (succ u1) (succ u2)) (succ (max u1 u2))) (succ (max u1 u2)) (succ u1) (succ u2), max (max (succ u1) (succ u2)) (succ (max u1 u2))} (Equiv.{max (succ u1) (succ u2), succ (max u1 u2)} (m' -> (Fin (Nat.succ n)) -> α) (Matrix.{u1, 0, u2} m' (Fin (Nat.succ n)) α)) (fun (_x : Equiv.{max (succ u1) (succ u2), succ (max u1 u2)} (m' -> (Fin (Nat.succ n)) -> α) (Matrix.{u1, 0, u2} m' (Fin (Nat.succ n)) α)) => (m' -> (Fin (Nat.succ n)) -> α) -> (Matrix.{u1, 0, u2} m' (Fin (Nat.succ n)) α)) (Equiv.hasCoeToFun.{max (succ u1) (succ u2), succ (max u1 u2)} (m' -> (Fin (Nat.succ n)) -> α) (Matrix.{u1, 0, u2} m' (Fin (Nat.succ n)) α)) (Matrix.of.{u2, u1, 0} m' (Fin (Nat.succ n)) α) A) (Matrix.vecCons.{u2} α n x v)) (HAdd.hAdd.{max u1 u2, max u1 u2, max u1 u2} (m' -> α) (m' -> α) (m' -> α) (instHAdd.{max u1 u2} (m' -> α) (Pi.instAdd.{u1, u2} m' (fun (ᾰ : m') => α) (fun (i : m') => Distrib.toHasAdd.{u2} α (NonUnitalNonAssocSemiring.toDistrib.{u2} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} α (Semiring.toNonAssocSemiring.{u2} α (CommSemiring.toSemiring.{u2} α _inst_2))))))) (SMul.smul.{u2, max u1 u2} α (m' -> α) (Function.hasSMul.{u1, u2, u2} m' α α (Mul.toSMul.{u2} α (Distrib.toHasMul.{u2} α (NonUnitalNonAssocSemiring.toDistrib.{u2} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} α (Semiring.toNonAssocSemiring.{u2} α (CommSemiring.toSemiring.{u2} α _inst_2))))))) x (Function.comp.{succ u1, succ u2, succ u2} m' ((Fin (Nat.succ n)) -> α) α (Matrix.vecHead.{u2} α n) A)) (Matrix.mulVec.{u2, u1, 0} m' (Fin n) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} α (Semiring.toNonAssocSemiring.{u2} α (CommSemiring.toSemiring.{u2} α _inst_2))) (Fin.fintype n) (coeFn.{max 1 (max (max (succ u1) (succ u2)) (succ (max u1 u2))) (succ (max u1 u2)) (succ u1) (succ u2), max (max (succ u1) (succ u2)) (succ (max u1 u2))} (Equiv.{max (succ u1) (succ u2), succ (max u1 u2)} (m' -> (Fin n) -> α) (Matrix.{u1, 0, u2} m' (Fin n) α)) (fun (_x : Equiv.{max (succ u1) (succ u2), succ (max u1 u2)} (m' -> (Fin n) -> α) (Matrix.{u1, 0, u2} m' (Fin n) α)) => (m' -> (Fin n) -> α) -> (Matrix.{u1, 0, u2} m' (Fin n) α)) (Equiv.hasCoeToFun.{max (succ u1) (succ u2), succ (max u1 u2)} (m' -> (Fin n) -> α) (Matrix.{u1, 0, u2} m' (Fin n) α)) (Matrix.of.{u2, u1, 0} m' (Fin n) α) (Function.comp.{succ u1, succ u2, succ u2} m' ((Fin (Nat.succ n)) -> α) ((Fin n) -> α) (Matrix.vecTail.{u2} α n) A)) v))
but is expected to have type
- forall {n : Nat} {m' : Type.{u2}} {α : Type.{u1}} [_inst_2 : CommSemiring.{u1} α] (A : m' -> (Fin (Nat.succ n)) -> α) (x : α) (v : (Fin n) -> α), Eq.{max (succ u2) (succ u1)} (m' -> α) (Matrix.mulVec.{u1, u2, 0} m' (Fin (Nat.succ n)) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α _inst_2))) (Fin.fintype (Nat.succ n)) (FunLike.coe.{max (succ u2) (succ u1), max (succ u2) (succ u1), max (succ u2) (succ u1)} (Equiv.{max (max (succ u1) (succ u2)) 1, max (succ u1) (succ u2)} (m' -> (Fin (Nat.succ n)) -> α) (Matrix.{u2, 0, u1} m' (Fin (Nat.succ n)) α)) (m' -> (Fin (Nat.succ n)) -> α) (fun (_x : m' -> (Fin (Nat.succ n)) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : m' -> (Fin (Nat.succ n)) -> α) => Matrix.{u2, 0, u1} m' (Fin (Nat.succ n)) α) _x) (Equiv.instFunLikeEquiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (m' -> (Fin (Nat.succ n)) -> α) (Matrix.{u2, 0, u1} m' (Fin (Nat.succ n)) α)) (Matrix.of.{u1, u2, 0} m' (Fin (Nat.succ n)) α) A) (Matrix.vecCons.{u1} α n x v)) (HAdd.hAdd.{max u2 u1, max u2 u1, max u2 u1} (m' -> α) (m' -> α) (m' -> α) (instHAdd.{max u2 u1} (m' -> α) (Pi.instAdd.{u2, u1} m' (fun (ᾰ : m') => α) (fun (i : m') => Distrib.toAdd.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α _inst_2))))))) (HSMul.hSMul.{u1, max u2 u1, max u2 u1} α (m' -> α) (m' -> α) (instHSMul.{u1, max u2 u1} α (m' -> α) (Pi.instSMul.{u2, u1, u1} m' α (fun (a._@.Init.Prelude._hyg.25 : m') => α) (fun (i : m') => Algebra.toSMul.{u1, u1} α α _inst_2 (CommSemiring.toSemiring.{u1} α _inst_2) (Algebra.id.{u1} α _inst_2)))) x (Function.comp.{succ u2, succ u1, succ u1} m' ((Fin (Nat.succ n)) -> α) α (Matrix.vecHead.{u1} α n) A)) (Matrix.mulVec.{u1, u2, 0} m' (Fin n) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α _inst_2))) (Fin.fintype n) (FunLike.coe.{max (succ u2) (succ u1), max (succ u2) (succ u1), max (succ u2) (succ u1)} (Equiv.{max (max (succ u1) (succ u2)) 1, max (succ u1) (succ u2)} (m' -> (Fin n) -> α) (Matrix.{u2, 0, u1} m' (Fin n) α)) (m' -> (Fin n) -> α) (fun (_x : m' -> (Fin n) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : m' -> (Fin n) -> α) => Matrix.{u2, 0, u1} m' (Fin n) α) _x) (Equiv.instFunLikeEquiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (m' -> (Fin n) -> α) (Matrix.{u2, 0, u1} m' (Fin n) α)) (Matrix.of.{u1, u2, 0} m' (Fin n) α) (Function.comp.{succ u2, succ u1, succ u1} m' ((Fin (Nat.succ n)) -> α) ((Fin n) -> α) (Matrix.vecTail.{u1} α n) A)) v))
+ forall {n : Nat} {m' : Type.{u2}} {α : Type.{u1}} [_inst_2 : CommSemiring.{u1} α] (A : m' -> (Fin (Nat.succ n)) -> α) (x : α) (v : (Fin n) -> α), Eq.{max (succ u2) (succ u1)} (m' -> α) (Matrix.mulVec.{u1, u2, 0} m' (Fin (Nat.succ n)) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α _inst_2))) (Fin.fintype (Nat.succ n)) (FunLike.coe.{max (succ u2) (succ u1), max (succ u2) (succ u1), max (succ u2) (succ u1)} (Equiv.{max (max (succ u1) (succ u2)) 1, max (succ u1) (succ u2)} (m' -> (Fin (Nat.succ n)) -> α) (Matrix.{u2, 0, u1} m' (Fin (Nat.succ n)) α)) (m' -> (Fin (Nat.succ n)) -> α) (fun (_x : m' -> (Fin (Nat.succ n)) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : m' -> (Fin (Nat.succ n)) -> α) => Matrix.{u2, 0, u1} m' (Fin (Nat.succ n)) α) _x) (Equiv.instFunLikeEquiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (m' -> (Fin (Nat.succ n)) -> α) (Matrix.{u2, 0, u1} m' (Fin (Nat.succ n)) α)) (Matrix.of.{u1, u2, 0} m' (Fin (Nat.succ n)) α) A) (Matrix.vecCons.{u1} α n x v)) (HAdd.hAdd.{max u2 u1, max u2 u1, max u2 u1} (m' -> α) (m' -> α) (m' -> α) (instHAdd.{max u2 u1} (m' -> α) (Pi.instAdd.{u2, u1} m' (fun (ᾰ : m') => α) (fun (i : m') => Distrib.toAdd.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α _inst_2))))))) (HSMul.hSMul.{u1, max u2 u1, max u2 u1} α (m' -> α) (m' -> α) (instHSMul.{u1, max u2 u1} α (m' -> α) (Pi.instSMul.{u2, u1, u1} m' α (fun (a._@.Init.Prelude._hyg.25 : m') => α) (fun (i : m') => Algebra.toSMul.{u1, u1} α α _inst_2 (CommSemiring.toSemiring.{u1} α _inst_2) (Algebra.id.{u1} α _inst_2)))) x (Function.comp.{succ u2, succ u1, succ u1} m' ((Fin (Nat.succ n)) -> α) α (Matrix.vecHead.{u1} α n) A)) (Matrix.mulVec.{u1, u2, 0} m' (Fin n) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α _inst_2))) (Fin.fintype n) (FunLike.coe.{max (succ u2) (succ u1), max (succ u2) (succ u1), max (succ u2) (succ u1)} (Equiv.{max (max (succ u1) (succ u2)) 1, max (succ u1) (succ u2)} (m' -> (Fin n) -> α) (Matrix.{u2, 0, u1} m' (Fin n) α)) (m' -> (Fin n) -> α) (fun (_x : m' -> (Fin n) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : m' -> (Fin n) -> α) => Matrix.{u2, 0, u1} m' (Fin n) α) _x) (Equiv.instFunLikeEquiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (m' -> (Fin n) -> α) (Matrix.{u2, 0, u1} m' (Fin n) α)) (Matrix.of.{u1, u2, 0} m' (Fin n) α) (Function.comp.{succ u2, succ u1, succ u1} m' ((Fin (Nat.succ n)) -> α) ((Fin n) -> α) (Matrix.vecTail.{u1} α n) A)) v))
Case conversion may be inaccurate. Consider using '#align matrix.mul_vec_cons Matrix.mulVec_consₓ'. -/
@[simp]
theorem mulVec_cons {α} [CommSemiring α] (A : m' → Fin n.succ → α) (x : α) (v : Fin n → α) :
@@ -593,7 +593,7 @@ variable [Zero α] [One α]
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : One.{u1} α], Eq.{succ u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α) (OfNat.ofNat.{u1} (Matrix.{0, 0, u1} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α) 1 (OfNat.mk.{u1} (Matrix.{0, 0, u1} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α) 1 (One.one.{u1} (Matrix.{0, 0, u1} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α) (Matrix.hasOne.{u1, 0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α (fun (a : Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (b : Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) => Fin.decidableEq (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) a b) _inst_1 _inst_2)))) (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) (fun (_x : Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) => ((Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) -> (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) (Equiv.hasCoeToFun.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) (Matrix.of.{u1, 0, 0} (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α _inst_2))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecEmpty.{u1} α))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α _inst_2))) (Matrix.vecEmpty.{u1} α))) (Matrix.vecEmpty.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α)))))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : One.{u1} α], Eq.{succ u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) (OfNat.ofNat.{u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) 1 (One.toOfNat1.{u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) (Matrix.one.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α (fun (a : Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (b : Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) => instDecidableEqFin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) a b) _inst_1 _inst_2))) (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α)) ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (fun (_x : (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) => Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α)) (Matrix.of.{u1, 0, 0} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecEmpty.{u1} α))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecEmpty.{u1} α))) (Matrix.vecEmpty.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α)))))
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : One.{u1} α], Eq.{succ u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) (OfNat.ofNat.{u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) 1 (One.toOfNat1.{u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) (Matrix.one.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α (fun (a : Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (b : Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) => instDecidableEqFin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) a b) _inst_1 _inst_2))) (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α)) ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (fun (_x : (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) => Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α)) (Matrix.of.{u1, 0, 0} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecEmpty.{u1} α))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecEmpty.{u1} α))) (Matrix.vecEmpty.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α)))))
Case conversion may be inaccurate. Consider using '#align matrix.one_fin_two Matrix.one_fin_twoₓ'. -/
theorem one_fin_two : (1 : Matrix (Fin 2) (Fin 2) α) = !![1, 0; 0, 1] :=
by
@@ -605,7 +605,7 @@ theorem one_fin_two : (1 : Matrix (Fin 2) (Fin 2) α) = !![1, 0; 0, 1] :=
lean 3 declaration is
forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : One.{u1} α], Eq.{succ u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α) (OfNat.ofNat.{u1} (Matrix.{0, 0, u1} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α) 1 (OfNat.mk.{u1} (Matrix.{0, 0, u1} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α) 1 (One.one.{u1} (Matrix.{0, 0, u1} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α) (Matrix.hasOne.{u1, 0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α (fun (a : Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (b : Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) => Fin.decidableEq (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) a b) _inst_1 _inst_2)))) (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) (fun (_x : Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) => ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) -> (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) (Equiv.hasCoeToFun.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) (Matrix.of.{u1, 0, 0} (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)))) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α _inst_2))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α _inst_2))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α _inst_2))) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecEmpty.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α))))))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : One.{u1} α], Eq.{succ u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) (OfNat.ofNat.{u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) 1 (One.toOfNat1.{u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) (Matrix.one.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α (fun (a : Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (b : Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) => instDecidableEqFin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3)) a b) _inst_1 _inst_2))) (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α)) ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (fun (_x : (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) => Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α)) (Matrix.of.{u1, 0, 0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecEmpty.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α))))))
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : One.{u1} α], Eq.{succ u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) (OfNat.ofNat.{u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) 1 (One.toOfNat1.{u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) (Matrix.one.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α (fun (a : Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (b : Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) => instDecidableEqFin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3)) a b) _inst_1 _inst_2))) (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α)) ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (fun (_x : (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.812 : (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) => Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α)) (Matrix.of.{u1, 0, 0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecEmpty.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α))))))
Case conversion may be inaccurate. Consider using '#align matrix.one_fin_three Matrix.one_fin_threeₓ'. -/
theorem one_fin_three : (1 : Matrix (Fin 3) (Fin 3) α) = !![1, 0, 0; 0, 1, 0; 0, 0, 1] :=
by
mathlib commit https://github.com/leanprover-community/mathlib/commit/36b8aa61ea7c05727161f96a0532897bd72aedab
@@ -383,7 +383,7 @@ variable [Semiring α]
lean 3 declaration is
forall {α : Type.{u1}} {o' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (B : Matrix.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α), Eq.{max (succ u2) (succ u1)} (o' -> α) (Matrix.vecMul.{u1, 0, u2} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)) (Fin.fintype (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) v B) (OfNat.ofNat.{max u2 u1} (o' -> α) 0 (OfNat.mk.{max u2 u1} (o' -> α) 0 (Zero.zero.{max u2 u1} (o' -> α) (Pi.instZero.{u2, u1} o' (fun (ᾰ : o') => α) (fun (i : o') => MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))))
but is expected to have type
- forall {α : Type.{u1}} {o' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (B : Matrix.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α), Eq.{max (succ u1) (succ u2)} (o' -> α) (Matrix.vecMul.{u1, 0, u2} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)) (Fin.fintype (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) v B) (OfNat.ofNat.{max u1 u2} (o' -> α) 0 (Zero.toOfNat0.{max u1 u2} (o' -> α) (Pi.instZero.{u2, u1} o' (fun (a._@.Mathlib.Data.Matrix.Basic._hyg.18134 : o') => α) (fun (i : o') => MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)))))
+ forall {α : Type.{u1}} {o' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (B : Matrix.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α), Eq.{max (succ u1) (succ u2)} (o' -> α) (Matrix.vecMul.{u1, 0, u2} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)) (Fin.fintype (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) v B) (OfNat.ofNat.{max u1 u2} (o' -> α) 0 (Zero.toOfNat0.{max u1 u2} (o' -> α) (Pi.instZero.{u2, u1} o' (fun (a._@.Mathlib.Data.Matrix.Basic._hyg.18132 : o') => α) (fun (i : o') => MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)))))
Case conversion may be inaccurate. Consider using '#align matrix.empty_vec_mul Matrix.empty_vecMulₓ'. -/
@[simp]
theorem empty_vecMul (v : Fin 0 → α) (B : Matrix (Fin 0) o' α) : vecMul v B = 0 :=
@@ -441,7 +441,7 @@ theorem empty_mulVec [Fintype n'] (A : Matrix (Fin 0) n' α) (v : n' → α) : m
lean 3 declaration is
forall {α : Type.{u1}} {m' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (A : Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α) (v : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α), Eq.{max (succ u2) (succ u1)} (m' -> α) (Matrix.mulVec.{u1, u2, 0} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)) (Fin.fintype (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) A v) (OfNat.ofNat.{max u2 u1} (m' -> α) 0 (OfNat.mk.{max u2 u1} (m' -> α) 0 (Zero.zero.{max u2 u1} (m' -> α) (Pi.instZero.{u2, u1} m' (fun (ᾰ : m') => α) (fun (i : m') => MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))))
but is expected to have type
- forall {α : Type.{u1}} {m' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (A : Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{max (succ u1) (succ u2)} (m' -> α) (Matrix.mulVec.{u1, u2, 0} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)) (Fin.fintype (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) A v) (OfNat.ofNat.{max u1 u2} (m' -> α) 0 (Zero.toOfNat0.{max u1 u2} (m' -> α) (Pi.instZero.{u2, u1} m' (fun (a._@.Mathlib.Data.Matrix.Basic._hyg.18076 : m') => α) (fun (i : m') => MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)))))
+ forall {α : Type.{u1}} {m' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (A : Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{max (succ u1) (succ u2)} (m' -> α) (Matrix.mulVec.{u1, u2, 0} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)) (Fin.fintype (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) A v) (OfNat.ofNat.{max u1 u2} (m' -> α) 0 (Zero.toOfNat0.{max u1 u2} (m' -> α) (Pi.instZero.{u2, u1} m' (fun (a._@.Mathlib.Data.Matrix.Basic._hyg.18074 : m') => α) (fun (i : m') => MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)))))
Case conversion may be inaccurate. Consider using '#align matrix.mul_vec_empty Matrix.mulVec_emptyₓ'. -/
@[simp]
theorem mulVec_empty (A : Matrix m' (Fin 0) α) (v : Fin 0 → α) : mulVec A v = 0 :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/09079525fd01b3dda35e96adaa08d2f943e1648c
@@ -383,7 +383,7 @@ variable [Semiring α]
lean 3 declaration is
forall {α : Type.{u1}} {o' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (B : Matrix.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α), Eq.{max (succ u2) (succ u1)} (o' -> α) (Matrix.vecMul.{u1, 0, u2} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)) (Fin.fintype (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) v B) (OfNat.ofNat.{max u2 u1} (o' -> α) 0 (OfNat.mk.{max u2 u1} (o' -> α) 0 (Zero.zero.{max u2 u1} (o' -> α) (Pi.instZero.{u2, u1} o' (fun (ᾰ : o') => α) (fun (i : o') => MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))))
but is expected to have type
- forall {α : Type.{u1}} {o' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (B : Matrix.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α), Eq.{max (succ u1) (succ u2)} (o' -> α) (Matrix.vecMul.{u1, 0, u2} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)) (Fin.fintype (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) v B) (OfNat.ofNat.{max u1 u2} (o' -> α) 0 (Zero.toOfNat0.{max u1 u2} (o' -> α) (Pi.instZero.{u2, u1} o' (fun (a._@.Mathlib.Data.Matrix.Basic._hyg.17912 : o') => α) (fun (i : o') => MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)))))
+ forall {α : Type.{u1}} {o' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (B : Matrix.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α), Eq.{max (succ u1) (succ u2)} (o' -> α) (Matrix.vecMul.{u1, 0, u2} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)) (Fin.fintype (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) v B) (OfNat.ofNat.{max u1 u2} (o' -> α) 0 (Zero.toOfNat0.{max u1 u2} (o' -> α) (Pi.instZero.{u2, u1} o' (fun (a._@.Mathlib.Data.Matrix.Basic._hyg.18134 : o') => α) (fun (i : o') => MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)))))
Case conversion may be inaccurate. Consider using '#align matrix.empty_vec_mul Matrix.empty_vecMulₓ'. -/
@[simp]
theorem empty_vecMul (v : Fin 0 → α) (B : Matrix (Fin 0) o' α) : vecMul v B = 0 :=
@@ -441,7 +441,7 @@ theorem empty_mulVec [Fintype n'] (A : Matrix (Fin 0) n' α) (v : n' → α) : m
lean 3 declaration is
forall {α : Type.{u1}} {m' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (A : Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α) (v : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α), Eq.{max (succ u2) (succ u1)} (m' -> α) (Matrix.mulVec.{u1, u2, 0} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)) (Fin.fintype (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) A v) (OfNat.ofNat.{max u2 u1} (m' -> α) 0 (OfNat.mk.{max u2 u1} (m' -> α) 0 (Zero.zero.{max u2 u1} (m' -> α) (Pi.instZero.{u2, u1} m' (fun (ᾰ : m') => α) (fun (i : m') => MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))))
but is expected to have type
- forall {α : Type.{u1}} {m' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (A : Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{max (succ u1) (succ u2)} (m' -> α) (Matrix.mulVec.{u1, u2, 0} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)) (Fin.fintype (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) A v) (OfNat.ofNat.{max u1 u2} (m' -> α) 0 (Zero.toOfNat0.{max u1 u2} (m' -> α) (Pi.instZero.{u2, u1} m' (fun (a._@.Mathlib.Data.Matrix.Basic._hyg.17854 : m') => α) (fun (i : m') => MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)))))
+ forall {α : Type.{u1}} {m' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (A : Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{max (succ u1) (succ u2)} (m' -> α) (Matrix.mulVec.{u1, u2, 0} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)) (Fin.fintype (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) A v) (OfNat.ofNat.{max u1 u2} (m' -> α) 0 (Zero.toOfNat0.{max u1 u2} (m' -> α) (Pi.instZero.{u2, u1} m' (fun (a._@.Mathlib.Data.Matrix.Basic._hyg.18076 : m') => α) (fun (i : m') => MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)))))
Case conversion may be inaccurate. Consider using '#align matrix.mul_vec_empty Matrix.mulVec_emptyₓ'. -/
@[simp]
theorem mulVec_empty (A : Matrix m' (Fin 0) α) (v : Fin 0 → α) : mulVec A v = 0 :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/52932b3a083d4142e78a15dc928084a22fea9ba0
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Eric Wieser
! This file was ported from Lean 3 source module data.matrix.notation
-! leanprover-community/mathlib commit 3e068ece210655b7b9a9477c3aff38a492400aa1
+! leanprover-community/mathlib commit 86d1873c01a723aba6788f0b9051ae3d23b4c1c3
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -16,6 +16,9 @@ import Mathbin.Algebra.BigOperators.Fin
/-!
# Matrix and vector notation
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
This file includes `simp` lemmas for applying operations in `data.matrix.basic` to values built out
of the matrix notation `![a, b] = vec_cons a (vec_cons b vec_empty)` defined in
`data.fin.vec_notation`.
mathlib commit https://github.com/leanprover-community/mathlib/commit/730c6d4cab72b9d84fcfb9e95e8796e9cd8f40ba
@@ -56,9 +56,10 @@ open Matrix
/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[] -/
/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[] -/
+#print Matrix.toExpr /-
/-- Matrices can be reflected whenever their entries can. We insert an `@id (matrix m' n' α)` to
prevent immediate decay to a function. -/
-unsafe instance matrix.reflect [Lean.ToLevel.{u}] [Lean.ToLevel.{u_1}] [Lean.ToLevel.{u_2}]
+unsafe instance Matrix.toExpr [Lean.ToLevel.{u}] [Lean.ToLevel.{u_1}] [Lean.ToLevel.{u_2}]
[reflected _ α] [reflected _ m'] [reflected _ n'] [h : has_reflect (m' → n' → α)] :
has_reflect (Matrix m' n' α) := fun m =>
(by
@@ -73,7 +74,8 @@ unsafe instance matrix.reflect [Lean.ToLevel.{u}] [Lean.ToLevel.{u_1}] [Lean.ToL
by
dsimp only [Matrix]
exact h m
-#align matrix.matrix.reflect matrix.matrix.reflect
+#align matrix.matrix.reflect Matrix.toExpr
+-/
section Parser
@@ -148,16 +150,21 @@ instance [Repr α] : Repr (Matrix (Fin m) (Fin n) α)
String.intercalate ", " <| (List.finRange n).map fun j => repr (f i j)) ++
"]"
+#print Matrix.cons_val' /-
@[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 <;> simp
#align matrix.cons_val' Matrix.cons_val'
+-/
+#print Matrix.head_val' /-
@[simp]
theorem head_val' (B : Fin m.succ → n' → α) (j : n') : (vecHead fun i => B i j) = vecHead B j :=
rfl
#align matrix.head_val' Matrix.head_val'
+-/
+#print Matrix.tail_val' /-
@[simp]
theorem tail_val' (B : Fin m.succ → n' → α) (j : n') :
(vecTail fun i => B i j) = fun i => vecTail B i j :=
@@ -165,28 +172,53 @@ theorem tail_val' (B : Fin m.succ → n' → α) (j : n') :
ext
simp [vec_tail]
#align matrix.tail_val' Matrix.tail_val'
+-/
section DotProduct
variable [AddCommMonoid α] [Mul α]
+/- warning: matrix.dot_product_empty -> Matrix.dotProduct_empty is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (w : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α (Fin.fintype (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) _inst_2 _inst_1 v w) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α (AddZeroClass.toHasZero.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1))))))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (w : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α (Fin.fintype (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) _inst_2 _inst_1 v w) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α (AddMonoid.toZero.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1))))
+Case conversion may be inaccurate. Consider using '#align matrix.dot_product_empty Matrix.dotProduct_emptyₓ'. -/
@[simp]
theorem dotProduct_empty (v w : Fin 0 → α) : dotProduct v w = 0 :=
Finset.sum_empty
#align matrix.dot_product_empty Matrix.dotProduct_empty
+/- warning: matrix.cons_dot_product -> Matrix.cons_dotProduct is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {n : Nat} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (x : α) (v : (Fin n) -> α) (w : (Fin (Nat.succ n)) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ n)) α (Fin.fintype (Nat.succ n)) _inst_2 _inst_1 (Matrix.vecCons.{u1} α n x v) w) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) x (Matrix.vecHead.{u1} α n w)) (Matrix.dotProduct.{u1, 0} (Fin n) α (Fin.fintype n) _inst_2 _inst_1 v (Matrix.vecTail.{u1} α n w)))
+but is expected to have type
+ forall {α : Type.{u1}} {n : Nat} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (x : α) (v : (Fin n) -> α) (w : (Fin (Nat.succ n)) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ n)) α (Fin.fintype (Nat.succ n)) _inst_2 _inst_1 (Matrix.vecCons.{u1} α n x v) w) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) x (Matrix.vecHead.{u1} α n w)) (Matrix.dotProduct.{u1, 0} (Fin n) α (Fin.fintype n) _inst_2 _inst_1 v (Matrix.vecTail.{u1} α n w)))
+Case conversion may be inaccurate. Consider using '#align matrix.cons_dot_product Matrix.cons_dotProductₓ'. -/
@[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
simp [dot_product, Fin.sum_univ_succ, vec_head, vec_tail]
#align matrix.cons_dot_product Matrix.cons_dotProduct
+/- warning: matrix.dot_product_cons -> Matrix.dotProduct_cons is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {n : Nat} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (v : (Fin (Nat.succ n)) -> α) (x : α) (w : (Fin n) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ n)) α (Fin.fintype (Nat.succ n)) _inst_2 _inst_1 v (Matrix.vecCons.{u1} α n x w)) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (Matrix.vecHead.{u1} α n v) x) (Matrix.dotProduct.{u1, 0} (Fin n) α (Fin.fintype n) _inst_2 _inst_1 (Matrix.vecTail.{u1} α n v) w))
+but is expected to have type
+ forall {α : Type.{u1}} {n : Nat} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (v : (Fin (Nat.succ n)) -> α) (x : α) (w : (Fin n) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ n)) α (Fin.fintype (Nat.succ n)) _inst_2 _inst_1 v (Matrix.vecCons.{u1} α n x w)) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (Matrix.vecHead.{u1} α n v) x) (Matrix.dotProduct.{u1, 0} (Fin n) α (Fin.fintype n) _inst_2 _inst_1 (Matrix.vecTail.{u1} α n v) w))
+Case conversion may be inaccurate. Consider using '#align matrix.dot_product_cons Matrix.dotProduct_consₓ'. -/
@[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
simp [dot_product, Fin.sum_univ_succ, vec_head, vec_tail]
#align matrix.dot_product_cons Matrix.dotProduct_cons
+/- warning: matrix.cons_dot_product_cons -> Matrix.cons_dotProduct_cons is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {n : Nat} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (x : α) (v : (Fin n) -> α) (y : α) (w : (Fin n) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ n)) α (Fin.fintype (Nat.succ n)) _inst_2 _inst_1 (Matrix.vecCons.{u1} α n x v) (Matrix.vecCons.{u1} α n y w)) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) x y) (Matrix.dotProduct.{u1, 0} (Fin n) α (Fin.fintype n) _inst_2 _inst_1 v w))
+but is expected to have type
+ forall {α : Type.{u1}} {n : Nat} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (x : α) (v : (Fin n) -> α) (y : α) (w : (Fin n) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ n)) α (Fin.fintype (Nat.succ n)) _inst_2 _inst_1 (Matrix.vecCons.{u1} α n x v) (Matrix.vecCons.{u1} α n y w)) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) x y) (Matrix.dotProduct.{u1, 0} (Fin n) α (Fin.fintype n) _inst_2 _inst_1 v w))
+Case conversion may be inaccurate. Consider using '#align matrix.cons_dot_product_cons Matrix.cons_dotProduct_consₓ'. -/
@[simp]
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 simp
@@ -196,46 +228,59 @@ end DotProduct
section ColRow
+#print Matrix.col_empty /-
@[simp]
theorem col_empty (v : Fin 0 → α) : col v = vecEmpty :=
empty_eq _
#align matrix.col_empty Matrix.col_empty
+-/
+#print Matrix.col_cons /-
@[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 <;> simp [vec_head, vec_tail]
#align matrix.col_cons Matrix.col_cons
+-/
+#print Matrix.row_empty /-
@[simp]
theorem row_empty : row (vecEmpty : Fin 0 → α) = fun _ => vecEmpty :=
by
ext
rfl
#align matrix.row_empty Matrix.row_empty
+-/
+#print Matrix.row_cons /-
@[simp]
theorem row_cons (x : α) (u : Fin m → α) : row (vecCons x u) = fun _ => vecCons x u :=
by
ext
rfl
#align matrix.row_cons Matrix.row_cons
+-/
end ColRow
section Transpose
+#print Matrix.transpose_empty_rows /-
@[simp]
theorem transpose_empty_rows (A : Matrix m' (Fin 0) α) : Aᵀ = of ![] :=
empty_eq _
#align matrix.transpose_empty_rows Matrix.transpose_empty_rows
+-/
+#print Matrix.transpose_empty_cols /-
@[simp]
theorem transpose_empty_cols (A : Matrix (Fin 0) m' α) : Aᵀ = of fun i => ![] :=
funext fun i => empty_eq _
#align matrix.transpose_empty_cols Matrix.transpose_empty_cols
+-/
+#print Matrix.cons_transpose /-
@[simp]
theorem cons_transpose (v : n' → α) (A : Matrix (Fin m) n' α) :
(of (vecCons v A))ᵀ = of fun i => vecCons (v i) (Aᵀ i) :=
@@ -243,19 +288,24 @@ theorem cons_transpose (v : n' → α) (A : Matrix (Fin m) n' α) :
ext (i j)
refine' Fin.cases _ _ j <;> simp
#align matrix.cons_transpose Matrix.cons_transpose
+-/
+#print Matrix.head_transpose /-
@[simp]
theorem head_transpose (A : Matrix m' (Fin n.succ) α) :
vecHead (of.symm Aᵀ) = vecHead ∘ of.symm A :=
rfl
#align matrix.head_transpose Matrix.head_transpose
+-/
+#print Matrix.tail_transpose /-
@[simp]
theorem tail_transpose (A : Matrix m' (Fin n.succ) α) : vecTail (of.symm Aᵀ) = (vecTail ∘ A)ᵀ :=
by
ext (i j)
rfl
#align matrix.tail_transpose Matrix.tail_transpose
+-/
end Transpose
@@ -263,27 +313,52 @@ section Mul
variable [Semiring α]
+/- warning: matrix.empty_mul -> Matrix.empty_mul is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {n' : Type.{u2}} {o' : Type.{u3}} [_inst_1 : Semiring.{u1} α] [_inst_2 : Fintype.{u2} n'] (A : Matrix.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) n' α) (B : Matrix.{u2, u3, u1} n' o' α), Eq.{succ (max u3 u1)} (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α) (Matrix.mul.{u1, 0, u2, u3} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) n' o' α _inst_2 (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B) (coeFn.{max 1 (max (max 1 (succ u3) (succ u1)) (succ (max u3 u1))) (succ (max u3 u1)) 1 (succ u3) (succ u1), max (max 1 (succ u3) (succ u1)) (succ (max u3 u1))} (Equiv.{max 1 (succ u3) (succ u1), succ (max u3 u1)} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> o' -> α) (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α)) (fun (_x : Equiv.{max 1 (succ u3) (succ u1), succ (max u3 u1)} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> o' -> α) (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α)) => ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> o' -> α) -> (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α)) (Equiv.hasCoeToFun.{max 1 (succ u3) (succ u1), succ (max u3 u1)} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> o' -> α) (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α)) (Matrix.of.{u1, 0, u3} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α) (Matrix.vecEmpty.{max u3 u1} (o' -> α)))
+but is expected to have type
+ forall {α : Type.{u1}} {n' : Type.{u2}} {o' : Type.{u3}} [_inst_1 : Semiring.{u1} α] [_inst_2 : Fintype.{u2} n'] (A : Matrix.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) n' α) (B : Matrix.{u2, u3, u1} n' o' α), Eq.{max (succ u1) (succ u3)} (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α) (Matrix.mul.{u1, 0, u2, u3} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) n' o' α _inst_2 (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B) (FunLike.coe.{max (succ u3) (succ u1), max (succ u3) (succ u1), max (succ u3) (succ u1)} (Equiv.{max (succ u1) (succ u3), max (max (succ u1) (succ u3)) 1} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> o' -> α) (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α)) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> o' -> α) (fun (_x : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> o' -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> o' -> α) => Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α) _x) (Equiv.instFunLikeEquiv.{max (succ u3) (succ u1), max (succ u3) (succ u1)} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> o' -> α) (Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α)) (Matrix.of.{u1, 0, u3} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α) (Matrix.vecEmpty.{max u3 u1} (o' -> α)))
+Case conversion may be inaccurate. Consider using '#align matrix.empty_mul Matrix.empty_mulₓ'. -/
@[simp]
theorem empty_mul [Fintype n'] (A : Matrix (Fin 0) n' α) (B : Matrix n' o' α) : A ⬝ B = of ![] :=
empty_eq _
#align matrix.empty_mul Matrix.empty_mul
+/- warning: matrix.empty_mul_empty -> Matrix.empty_mul_empty is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {m' : Type.{u2}} {o' : Type.{u3}} [_inst_1 : Semiring.{u1} α] (A : Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α) (B : Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α), Eq.{succ (max u2 u3 u1)} (Matrix.{u2, u3, u1} m' o' α) (Matrix.mul.{u1, u2, 0, u3} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α (Fin.fintype (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B) (OfNat.ofNat.{max u2 u3 u1} (Matrix.{u2, u3, u1} m' o' α) 0 (OfNat.mk.{max u2 u3 u1} (Matrix.{u2, u3, u1} m' o' α) 0 (Zero.zero.{max u2 u3 u1} (Matrix.{u2, u3, u1} m' o' α) (Matrix.hasZero.{u1, u2, u3} m' o' α (MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))))
+but is expected to have type
+ forall {α : Type.{u1}} {m' : Type.{u2}} {o' : Type.{u3}} [_inst_1 : Semiring.{u1} α] (A : Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) (B : Matrix.{0, u3, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α), Eq.{max (max (succ u1) (succ u3)) (succ u2)} (Matrix.{u2, u3, u1} m' o' α) (Matrix.mul.{u1, u2, 0, u3} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α (Fin.fintype (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B) (OfNat.ofNat.{max (max u1 u3) u2} (Matrix.{u2, u3, u1} m' o' α) 0 (Zero.toOfNat0.{max (max u1 u3) u2} (Matrix.{u2, u3, u1} m' o' α) (Matrix.zero.{u1, u2, u3} m' o' α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)))))
+Case conversion may be inaccurate. Consider using '#align matrix.empty_mul_empty Matrix.empty_mul_emptyₓ'. -/
@[simp]
theorem empty_mul_empty (A : Matrix m' (Fin 0) α) (B : Matrix (Fin 0) o' α) : A ⬝ B = 0 :=
rfl
#align matrix.empty_mul_empty Matrix.empty_mul_empty
+/- warning: matrix.mul_empty -> Matrix.mul_empty is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {m' : Type.{u2}} {n' : Type.{u3}} [_inst_1 : Semiring.{u1} α] [_inst_2 : Fintype.{u3} n'] (A : Matrix.{u2, u3, u1} m' n' α) (B : Matrix.{u3, 0, u1} n' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α), Eq.{succ (max u2 u1)} (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α) (Matrix.mul.{u1, u2, u3, 0} m' n' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α _inst_2 (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B) (coeFn.{max 1 (max (max (succ u2) (succ u1)) (succ (max u2 u1))) (succ (max u2 u1)) (succ u2) (succ u1), max (max (succ u2) (succ u1)) (succ (max u2 u1))} (Equiv.{max (succ u2) (succ u1), succ (max u2 u1)} (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α)) (fun (_x : Equiv.{max (succ u2) (succ u1), succ (max u2 u1)} (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α)) => (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) -> (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α)) (Equiv.hasCoeToFun.{max (succ u2) (succ u1), succ (max u2 u1)} (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α)) (Matrix.of.{u1, u2, 0} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α) (fun (_x : m') => Matrix.vecEmpty.{u1} α))
+but is expected to have type
+ forall {α : Type.{u1}} {m' : Type.{u2}} {n' : Type.{u3}} [_inst_1 : Semiring.{u1} α] [_inst_2 : Fintype.{u3} n'] (A : Matrix.{u2, u3, u1} m' n' α) (B : Matrix.{u3, 0, u1} n' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α), Eq.{max (succ u1) (succ u2)} (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) (Matrix.mul.{u1, u2, u3, 0} m' n' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α _inst_2 (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B) (FunLike.coe.{max (succ u2) (succ u1), max (succ u2) (succ u1), max (succ u2) (succ u1)} (Equiv.{max (max (succ u1) (succ u2)) 1, max (succ u1) (succ u2)} (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α)) (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (fun (_x : m' -> (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : m' -> (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) => Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) _x) (Equiv.instFunLikeEquiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (m' -> (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α)) (Matrix.of.{u1, u2, 0} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) (fun (_x : m') => Matrix.vecEmpty.{u1} α))
+Case conversion may be inaccurate. Consider using '#align matrix.mul_empty Matrix.mul_emptyₓ'. -/
@[simp]
theorem mul_empty [Fintype n'] (A : Matrix m' n' α) (B : Matrix n' (Fin 0) α) :
A ⬝ B = of fun _ => ![] :=
funext fun _ => empty_eq _
#align matrix.mul_empty Matrix.mul_empty
+/- warning: matrix.mul_val_succ -> Matrix.mul_val_succ is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {m : Nat} {n' : Type.{u2}} {o' : Type.{u3}} [_inst_1 : Semiring.{u1} α] [_inst_2 : Fintype.{u2} n'] (A : Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (B : Matrix.{u2, u3, u1} n' o' α) (i : Fin m) (j : o'), Eq.{succ u1} α (Matrix.mul.{u1, 0, u2, u3} (Fin (Nat.succ m)) n' o' α _inst_2 (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B (Fin.succ m i) j) (Matrix.mul.{u1, 0, u2, u3} (Fin m) n' o' α _inst_2 (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (coeFn.{max 1 (max (max 1 (succ u2) (succ u1)) (succ (max u2 u1))) (succ (max u2 u1)) 1 (succ u2) (succ u1), max (max 1 (succ u2) (succ u1)) (succ (max u2 u1))} (Equiv.{max 1 (succ u2) (succ u1), succ (max u2 u1)} ((Fin m) -> n' -> α) (Matrix.{0, u2, u1} (Fin m) n' α)) (fun (_x : Equiv.{max 1 (succ u2) (succ u1), succ (max u2 u1)} ((Fin m) -> n' -> α) (Matrix.{0, u2, u1} (Fin m) n' α)) => ((Fin m) -> n' -> α) -> (Matrix.{0, u2, u1} (Fin m) n' α)) (Equiv.hasCoeToFun.{max 1 (succ u2) (succ u1), succ (max u2 u1)} ((Fin m) -> n' -> α) (Matrix.{0, u2, u1} (Fin m) n' α)) (Matrix.of.{u1, 0, u2} (Fin m) n' α) (Matrix.vecTail.{max u2 u1} (n' -> α) m (coeFn.{max 1 (max (succ (max u2 u1)) 1 (succ u2) (succ u1)) (max 1 (succ u2) (succ u1)) (succ (max u2 u1)), max (succ (max u2 u1)) 1 (succ u2) (succ u1)} (Equiv.{succ (max u2 u1), max 1 (succ u2) (succ u1)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) ((Fin (Nat.succ m)) -> n' -> α)) (fun (_x : Equiv.{succ (max u2 u1), max 1 (succ u2) (succ u1)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) ((Fin (Nat.succ m)) -> n' -> α)) => (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) -> (Fin (Nat.succ m)) -> n' -> α) (Equiv.hasCoeToFun.{succ (max u2 u1), max 1 (succ u2) (succ u1)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) ((Fin (Nat.succ m)) -> n' -> α)) (Equiv.symm.{max 1 (succ u2) (succ u1), succ (max u2 u1)} ((Fin (Nat.succ m)) -> n' -> α) (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (Matrix.of.{u1, 0, u2} (Fin (Nat.succ m)) n' α)) A))) B i j)
+but is expected to have type
+ forall {α : Type.{u1}} {m : Nat} {n' : Type.{u2}} {o' : Type.{u3}} [_inst_1 : Semiring.{u1} α] [_inst_2 : Fintype.{u2} n'] (A : Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (B : Matrix.{u2, u3, u1} n' o' α) (i : Fin m) (j : o'), Eq.{succ u1} α (Matrix.mul.{u1, 0, u2, u3} (Fin (Nat.succ m)) n' o' α _inst_2 (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) A B (Fin.succ m i) j) (Matrix.mul.{u1, 0, u2, u3} (Fin m) n' o' α _inst_2 (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (FunLike.coe.{max (succ u2) (succ u1), max (succ u2) (succ u1), max (succ u2) (succ u1)} (Equiv.{max (succ u1) (succ u2), max (max (succ u1) (succ u2)) 1} ((Fin m) -> n' -> α) (Matrix.{0, u2, u1} (Fin m) n' α)) ((Fin m) -> n' -> α) (fun (_x : (Fin m) -> n' -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : (Fin m) -> n' -> α) => Matrix.{0, u2, u1} (Fin m) n' α) _x) (Equiv.instFunLikeEquiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} ((Fin m) -> n' -> α) (Matrix.{0, u2, u1} (Fin m) n' α)) (Matrix.of.{u1, 0, u2} (Fin m) n' α) (Matrix.vecTail.{max u2 u1} (n' -> α) m (FunLike.coe.{max (succ u2) (succ u1), max (succ u2) (succ u1), max (succ u2) (succ u1)} (Equiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) ((Fin (Nat.succ m)) -> n' -> α)) (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (fun (_x : Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) => (Fin (Nat.succ m)) -> n' -> α) _x) (Equiv.instFunLikeEquiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) ((Fin (Nat.succ m)) -> n' -> α)) (Equiv.symm.{max (succ u2) (succ u1), max (succ u2) (succ u1)} ((Fin (Nat.succ m)) -> n' -> α) (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (Matrix.of.{u1, 0, u2} (Fin (Nat.succ m)) n' α)) A))) B i j)
+Case conversion may be inaccurate. Consider using '#align matrix.mul_val_succ Matrix.mul_val_succₓ'. -/
theorem mul_val_succ [Fintype n'] (A : Matrix (Fin m.succ) n' α) (B : Matrix n' o' α) (i : Fin m)
(j : o') : (A ⬝ B) i.succ j = (of (vecTail (of.symm A)) ⬝ B) i j :=
rfl
#align matrix.mul_val_succ Matrix.mul_val_succ
+#print Matrix.cons_mul /-
@[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))) :=
@@ -293,6 +368,7 @@ theorem cons_mul [Fintype n'] (v : n' → α) (A : Fin m → n' → α) (B : Mat
· rfl
simp [mul_val_succ]
#align matrix.cons_mul Matrix.cons_mul
+-/
end Mul
@@ -300,16 +376,25 @@ section VecMul
variable [Semiring α]
+/- warning: matrix.empty_vec_mul -> Matrix.empty_vecMul is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {o' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (B : Matrix.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α), Eq.{max (succ u2) (succ u1)} (o' -> α) (Matrix.vecMul.{u1, 0, u2} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) o' α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)) (Fin.fintype (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) v B) (OfNat.ofNat.{max u2 u1} (o' -> α) 0 (OfNat.mk.{max u2 u1} (o' -> α) 0 (Zero.zero.{max u2 u1} (o' -> α) (Pi.instZero.{u2, u1} o' (fun (ᾰ : o') => α) (fun (i : o') => MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))))
+but is expected to have type
+ forall {α : Type.{u1}} {o' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (B : Matrix.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α), Eq.{max (succ u1) (succ u2)} (o' -> α) (Matrix.vecMul.{u1, 0, u2} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) o' α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)) (Fin.fintype (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) v B) (OfNat.ofNat.{max u1 u2} (o' -> α) 0 (Zero.toOfNat0.{max u1 u2} (o' -> α) (Pi.instZero.{u2, u1} o' (fun (a._@.Mathlib.Data.Matrix.Basic._hyg.17912 : o') => α) (fun (i : o') => MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)))))
+Case conversion may be inaccurate. Consider using '#align matrix.empty_vec_mul Matrix.empty_vecMulₓ'. -/
@[simp]
theorem empty_vecMul (v : Fin 0 → α) (B : Matrix (Fin 0) o' α) : vecMul v B = 0 :=
rfl
#align matrix.empty_vec_mul Matrix.empty_vecMul
+#print Matrix.vecMul_empty /-
@[simp]
theorem vecMul_empty [Fintype n'] (v : n' → α) (B : Matrix n' (Fin 0) α) : vecMul v B = ![] :=
empty_eq _
#align matrix.vec_mul_empty Matrix.vecMul_empty
+-/
+#print Matrix.cons_vecMul /-
@[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) :=
@@ -317,7 +402,9 @@ theorem cons_vecMul (x : α) (v : Fin n → α) (B : Fin n.succ → o' → α) :
ext i
simp [vec_mul]
#align matrix.cons_vec_mul Matrix.cons_vecMul
+-/
+#print Matrix.vecMul_cons /-
@[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) :=
@@ -325,11 +412,14 @@ theorem vecMul_cons (v : Fin n.succ → α) (w : o' → α) (B : Fin n → o'
ext i
simp [vec_mul]
#align matrix.vec_mul_cons Matrix.vecMul_cons
+-/
+#print Matrix.cons_vecMul_cons /-
@[simp]
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 simp
#align matrix.cons_vec_mul_cons Matrix.cons_vecMul_cons
+-/
end VecMul
@@ -337,16 +427,25 @@ section MulVec
variable [Semiring α]
+#print Matrix.empty_mulVec /-
@[simp]
theorem empty_mulVec [Fintype n'] (A : Matrix (Fin 0) n' α) (v : n' → α) : mulVec A v = ![] :=
empty_eq _
#align matrix.empty_mul_vec Matrix.empty_mulVec
+-/
+/- warning: matrix.mul_vec_empty -> Matrix.mulVec_empty is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {m' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (A : Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α) (v : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α), Eq.{max (succ u2) (succ u1)} (m' -> α) (Matrix.mulVec.{u1, u2, 0} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)) (Fin.fintype (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) A v) (OfNat.ofNat.{max u2 u1} (m' -> α) 0 (OfNat.mk.{max u2 u1} (m' -> α) 0 (Zero.zero.{max u2 u1} (m' -> α) (Pi.instZero.{u2, u1} m' (fun (ᾰ : m') => α) (fun (i : m') => MulZeroClass.toHasZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))))
+but is expected to have type
+ forall {α : Type.{u1}} {m' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (A : Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{max (succ u1) (succ u2)} (m' -> α) (Matrix.mulVec.{u1, u2, 0} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)) (Fin.fintype (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) A v) (OfNat.ofNat.{max u1 u2} (m' -> α) 0 (Zero.toOfNat0.{max u1 u2} (m' -> α) (Pi.instZero.{u2, u1} m' (fun (a._@.Mathlib.Data.Matrix.Basic._hyg.17854 : m') => α) (fun (i : m') => MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)))))
+Case conversion may be inaccurate. Consider using '#align matrix.mul_vec_empty Matrix.mulVec_emptyₓ'. -/
@[simp]
theorem mulVec_empty (A : Matrix m' (Fin 0) α) (v : Fin 0 → α) : mulVec A v = 0 :=
rfl
#align matrix.mul_vec_empty Matrix.mulVec_empty
+#print Matrix.cons_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) :=
@@ -354,7 +453,14 @@ theorem cons_mulVec [Fintype n'] (v : n' → α) (A : Fin m → n' → α) (w :
ext i
refine' Fin.cases _ _ i <;> simp [mul_vec]
#align matrix.cons_mul_vec Matrix.cons_mulVec
+-/
+/- warning: matrix.mul_vec_cons -> Matrix.mulVec_cons is a dubious translation:
+lean 3 declaration is
+ forall {n : Nat} {m' : Type.{u1}} {α : Type.{u2}} [_inst_2 : CommSemiring.{u2} α] (A : m' -> (Fin (Nat.succ n)) -> α) (x : α) (v : (Fin n) -> α), Eq.{max (succ u1) (succ u2)} (m' -> α) (Matrix.mulVec.{u2, u1, 0} m' (Fin (Nat.succ n)) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} α (Semiring.toNonAssocSemiring.{u2} α (CommSemiring.toSemiring.{u2} α _inst_2))) (Fin.fintype (Nat.succ n)) (coeFn.{max 1 (max (max (succ u1) (succ u2)) (succ (max u1 u2))) (succ (max u1 u2)) (succ u1) (succ u2), max (max (succ u1) (succ u2)) (succ (max u1 u2))} (Equiv.{max (succ u1) (succ u2), succ (max u1 u2)} (m' -> (Fin (Nat.succ n)) -> α) (Matrix.{u1, 0, u2} m' (Fin (Nat.succ n)) α)) (fun (_x : Equiv.{max (succ u1) (succ u2), succ (max u1 u2)} (m' -> (Fin (Nat.succ n)) -> α) (Matrix.{u1, 0, u2} m' (Fin (Nat.succ n)) α)) => (m' -> (Fin (Nat.succ n)) -> α) -> (Matrix.{u1, 0, u2} m' (Fin (Nat.succ n)) α)) (Equiv.hasCoeToFun.{max (succ u1) (succ u2), succ (max u1 u2)} (m' -> (Fin (Nat.succ n)) -> α) (Matrix.{u1, 0, u2} m' (Fin (Nat.succ n)) α)) (Matrix.of.{u2, u1, 0} m' (Fin (Nat.succ n)) α) A) (Matrix.vecCons.{u2} α n x v)) (HAdd.hAdd.{max u1 u2, max u1 u2, max u1 u2} (m' -> α) (m' -> α) (m' -> α) (instHAdd.{max u1 u2} (m' -> α) (Pi.instAdd.{u1, u2} m' (fun (ᾰ : m') => α) (fun (i : m') => Distrib.toHasAdd.{u2} α (NonUnitalNonAssocSemiring.toDistrib.{u2} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} α (Semiring.toNonAssocSemiring.{u2} α (CommSemiring.toSemiring.{u2} α _inst_2))))))) (SMul.smul.{u2, max u1 u2} α (m' -> α) (Function.hasSMul.{u1, u2, u2} m' α α (Mul.toSMul.{u2} α (Distrib.toHasMul.{u2} α (NonUnitalNonAssocSemiring.toDistrib.{u2} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} α (Semiring.toNonAssocSemiring.{u2} α (CommSemiring.toSemiring.{u2} α _inst_2))))))) x (Function.comp.{succ u1, succ u2, succ u2} m' ((Fin (Nat.succ n)) -> α) α (Matrix.vecHead.{u2} α n) A)) (Matrix.mulVec.{u2, u1, 0} m' (Fin n) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} α (Semiring.toNonAssocSemiring.{u2} α (CommSemiring.toSemiring.{u2} α _inst_2))) (Fin.fintype n) (coeFn.{max 1 (max (max (succ u1) (succ u2)) (succ (max u1 u2))) (succ (max u1 u2)) (succ u1) (succ u2), max (max (succ u1) (succ u2)) (succ (max u1 u2))} (Equiv.{max (succ u1) (succ u2), succ (max u1 u2)} (m' -> (Fin n) -> α) (Matrix.{u1, 0, u2} m' (Fin n) α)) (fun (_x : Equiv.{max (succ u1) (succ u2), succ (max u1 u2)} (m' -> (Fin n) -> α) (Matrix.{u1, 0, u2} m' (Fin n) α)) => (m' -> (Fin n) -> α) -> (Matrix.{u1, 0, u2} m' (Fin n) α)) (Equiv.hasCoeToFun.{max (succ u1) (succ u2), succ (max u1 u2)} (m' -> (Fin n) -> α) (Matrix.{u1, 0, u2} m' (Fin n) α)) (Matrix.of.{u2, u1, 0} m' (Fin n) α) (Function.comp.{succ u1, succ u2, succ u2} m' ((Fin (Nat.succ n)) -> α) ((Fin n) -> α) (Matrix.vecTail.{u2} α n) A)) v))
+but is expected to have type
+ forall {n : Nat} {m' : Type.{u2}} {α : Type.{u1}} [_inst_2 : CommSemiring.{u1} α] (A : m' -> (Fin (Nat.succ n)) -> α) (x : α) (v : (Fin n) -> α), Eq.{max (succ u2) (succ u1)} (m' -> α) (Matrix.mulVec.{u1, u2, 0} m' (Fin (Nat.succ n)) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α _inst_2))) (Fin.fintype (Nat.succ n)) (FunLike.coe.{max (succ u2) (succ u1), max (succ u2) (succ u1), max (succ u2) (succ u1)} (Equiv.{max (max (succ u1) (succ u2)) 1, max (succ u1) (succ u2)} (m' -> (Fin (Nat.succ n)) -> α) (Matrix.{u2, 0, u1} m' (Fin (Nat.succ n)) α)) (m' -> (Fin (Nat.succ n)) -> α) (fun (_x : m' -> (Fin (Nat.succ n)) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : m' -> (Fin (Nat.succ n)) -> α) => Matrix.{u2, 0, u1} m' (Fin (Nat.succ n)) α) _x) (Equiv.instFunLikeEquiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (m' -> (Fin (Nat.succ n)) -> α) (Matrix.{u2, 0, u1} m' (Fin (Nat.succ n)) α)) (Matrix.of.{u1, u2, 0} m' (Fin (Nat.succ n)) α) A) (Matrix.vecCons.{u1} α n x v)) (HAdd.hAdd.{max u2 u1, max u2 u1, max u2 u1} (m' -> α) (m' -> α) (m' -> α) (instHAdd.{max u2 u1} (m' -> α) (Pi.instAdd.{u2, u1} m' (fun (ᾰ : m') => α) (fun (i : m') => Distrib.toAdd.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α _inst_2))))))) (HSMul.hSMul.{u1, max u2 u1, max u2 u1} α (m' -> α) (m' -> α) (instHSMul.{u1, max u2 u1} α (m' -> α) (Pi.instSMul.{u2, u1, u1} m' α (fun (a._@.Init.Prelude._hyg.25 : m') => α) (fun (i : m') => Algebra.toSMul.{u1, u1} α α _inst_2 (CommSemiring.toSemiring.{u1} α _inst_2) (Algebra.id.{u1} α _inst_2)))) x (Function.comp.{succ u2, succ u1, succ u1} m' ((Fin (Nat.succ n)) -> α) α (Matrix.vecHead.{u1} α n) A)) (Matrix.mulVec.{u1, u2, 0} m' (Fin n) α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α (CommSemiring.toSemiring.{u1} α _inst_2))) (Fin.fintype n) (FunLike.coe.{max (succ u2) (succ u1), max (succ u2) (succ u1), max (succ u2) (succ u1)} (Equiv.{max (max (succ u1) (succ u2)) 1, max (succ u1) (succ u2)} (m' -> (Fin n) -> α) (Matrix.{u2, 0, u1} m' (Fin n) α)) (m' -> (Fin n) -> α) (fun (_x : m' -> (Fin n) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : m' -> (Fin n) -> α) => Matrix.{u2, 0, u1} m' (Fin n) α) _x) (Equiv.instFunLikeEquiv.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (m' -> (Fin n) -> α) (Matrix.{u2, 0, u1} m' (Fin n) α)) (Matrix.of.{u1, u2, 0} m' (Fin n) α) (Function.comp.{succ u2, succ u1, succ u1} m' ((Fin (Nat.succ n)) -> α) ((Fin n) -> α) (Matrix.vecTail.{u1} α n) A)) v))
+Case conversion may be inaccurate. Consider using '#align matrix.mul_vec_cons Matrix.mulVec_consₓ'. -/
@[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 :=
@@ -369,16 +475,34 @@ section VecMulVec
variable [Semiring α]
+/- warning: matrix.empty_vec_mul_vec -> Matrix.empty_vecMulVec is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {n' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α) (w : n' -> α), Eq.{succ (max u2 u1)} (Matrix.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) n' α) (Matrix.vecMulVec.{u1, 0, u2} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) n' α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) v w) (Matrix.vecEmpty.{max u2 u1} (n' -> α))
+but is expected to have type
+ forall {α : Type.{u1}} {n' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α) (w : n' -> α), Eq.{max (succ u1) (succ u2)} (Matrix.{0, u2, u1} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) n' α) (Matrix.vecMulVec.{u1, 0, u2} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) n' α (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) v w) (Matrix.vecEmpty.{max u1 u2} (n' -> α))
+Case conversion may be inaccurate. Consider using '#align matrix.empty_vec_mul_vec Matrix.empty_vecMulVecₓ'. -/
@[simp]
theorem empty_vecMulVec (v : Fin 0 → α) (w : n' → α) : vecMulVec v w = ![] :=
empty_eq _
#align matrix.empty_vec_mul_vec Matrix.empty_vecMulVec
+/- warning: matrix.vec_mul_vec_empty -> Matrix.vecMulVec_empty is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {m' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : m' -> α) (w : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> α), Eq.{succ (max u2 u1)} (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α) (Matrix.vecMulVec.{u1, u2, 0} m' (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) v w) (fun (_x : m') => Matrix.vecEmpty.{u1} α)
+but is expected to have type
+ forall {α : Type.{u1}} {m' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : m' -> α) (w : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> α), Eq.{max (succ u1) (succ u2)} (Matrix.{u2, 0, u1} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α) (Matrix.vecMulVec.{u1, u2, 0} m' (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) v w) (fun (_x : m') => Matrix.vecEmpty.{u1} α)
+Case conversion may be inaccurate. Consider using '#align matrix.vec_mul_vec_empty Matrix.vecMulVec_emptyₓ'. -/
@[simp]
theorem vecMulVec_empty (v : m' → α) (w : Fin 0 → α) : vecMulVec v w = fun _ => ![] :=
funext fun i => empty_eq _
#align matrix.vec_mul_vec_empty Matrix.vecMulVec_empty
+/- warning: matrix.cons_vec_mul_vec -> Matrix.cons_vecMulVec is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {m : Nat} {n' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (x : α) (v : (Fin m) -> α) (w : n' -> α), Eq.{succ (max u2 u1)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (Matrix.vecMulVec.{u1, 0, u2} (Fin (Nat.succ m)) n' α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) (Matrix.vecCons.{u1} α m x v) w) (Matrix.vecCons.{max u2 u1} (n' -> α) m (SMul.smul.{u1, max u2 u1} α (n' -> α) (Function.hasSMul.{u2, u1, u1} n' α α (Mul.toSMul.{u1} α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))))) x w) (Matrix.vecMulVec.{u1, 0, u2} (Fin m) n' α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) v w))
+but is expected to have type
+ forall {α : Type.{u1}} {m : Nat} {n' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (x : α) (v : (Fin m) -> α) (w : n' -> α), Eq.{max (succ u1) (succ u2)} (Matrix.{0, u2, u1} (Fin (Nat.succ m)) n' α) (Matrix.vecMulVec.{u1, 0, u2} (Fin (Nat.succ m)) n' α (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) (Matrix.vecCons.{u1} α m x v) w) (Matrix.vecCons.{max u1 u2} (n' -> α) m (HSMul.hSMul.{u1, max u1 u2, max u1 u2} α (n' -> α) (n' -> α) (instHSMul.{u1, max u1 u2} α (n' -> α) (Pi.instSMul.{u2, u1, u1} n' α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4067 : n') => α) (fun (i : n') => SMulZeroClass.toSMul.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MulZeroClass.toSMulWithZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))))))) x w) (Matrix.vecMulVec.{u1, 0, u2} (Fin m) n' α (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) v w))
+Case conversion may be inaccurate. Consider using '#align matrix.cons_vec_mul_vec Matrix.cons_vecMulVecₓ'. -/
@[simp]
theorem cons_vecMulVec (x : α) (v : Fin m → α) (w : n' → α) :
vecMulVec (vecCons x v) w = vecCons (x • w) (vecMulVec v w) :=
@@ -387,6 +511,12 @@ theorem cons_vecMulVec (x : α) (v : Fin m → α) (w : n' → α) :
refine' Fin.cases _ _ i <;> simp [vec_mul_vec]
#align matrix.cons_vec_mul_vec Matrix.cons_vecMulVec
+/- warning: matrix.vec_mul_vec_cons -> Matrix.vecMulVec_cons is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {n : Nat} {m' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : m' -> α) (x : α) (w : (Fin n) -> α), Eq.{succ (max u2 u1)} (Matrix.{u2, 0, u1} m' (Fin (Nat.succ n)) α) (Matrix.vecMulVec.{u1, u2, 0} m' (Fin (Nat.succ n)) α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))) v (Matrix.vecCons.{u1} α n x w)) (fun (i : m') => SMul.smul.{u1, u1} α ((Fin (Nat.succ n)) -> α) (Function.hasSMul.{0, u1, u1} (Fin (Nat.succ n)) α α (Mul.toSMul.{u1} α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))))) (v i) (Matrix.vecCons.{u1} α n x w))
+but is expected to have type
+ forall {α : Type.{u1}} {n : Nat} {m' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (v : m' -> α) (x : α) (w : (Fin n) -> α), Eq.{max (succ u1) (succ u2)} (Matrix.{u2, 0, u1} m' (Fin (Nat.succ n)) α) (Matrix.vecMulVec.{u1, u2, 0} m' (Fin (Nat.succ n)) α (NonUnitalNonAssocSemiring.toMul.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))) v (Matrix.vecCons.{u1} α n x w)) (fun (i : m') => HSMul.hSMul.{u1, u1, u1} α ((Fin (Nat.succ n)) -> α) ((Fin (Nat.succ n)) -> α) (instHSMul.{u1, u1} α ((Fin (Nat.succ n)) -> α) (Pi.instSMul.{0, u1, u1} (Fin (Nat.succ n)) α (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ n)) => α) (fun (i : Fin (Nat.succ n)) => SMulZeroClass.toSMul.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MulZeroClass.toSMulWithZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))))))) (v i) (Matrix.vecCons.{u1} α n x w))
+Case conversion may be inaccurate. Consider using '#align matrix.vec_mul_vec_cons Matrix.vecMulVec_consₓ'. -/
@[simp]
theorem vecMulVec_cons (v : m' → α) (x : α) (w : Fin n → α) :
vecMulVec v (vecCons x w) = fun i => v i • vecCons x w :=
@@ -401,11 +531,23 @@ section Smul
variable [Semiring α]
+/- warning: matrix.smul_mat_empty -> Matrix.smul_mat_empty is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : Semiring.{u1} α] {m' : Type.{u2}} (x : α) (A : (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> m' -> α), Eq.{succ (max u2 u1)} ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> m' -> α) (SMul.smul.{u1, max u2 u1} α ((Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) -> m' -> α) (Function.hasSMul.{0, u1, max u2 u1} (Fin (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) α (m' -> α) (Function.hasSMul.{u2, u1, u1} m' α α (Mul.toSMul.{u1} α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))) x A) (Matrix.vecEmpty.{max u2 u1} (m' -> α))
+but is expected to have type
+ forall {α : Type.{u2}} [_inst_1 : Semiring.{u2} α] {m' : Type.{u1}} (x : α) (A : (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> m' -> α), Eq.{max (succ u2) (succ u1)} ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> m' -> α) (HSMul.hSMul.{u2, max u2 u1, max u2 u1} α ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> m' -> α) ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> m' -> α) (instHSMul.{u2, max u2 u1} α ((Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) -> m' -> α) (Pi.instSMul.{0, max u2 u1, u2} (Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4255 : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => m' -> α) (fun (i : Fin (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) => Pi.instSMul.{u1, u2, u2} m' α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4258 : m') => α) (fun (i : m') => SMulZeroClass.toSMul.{u2, u2} α α (MonoidWithZero.toZero.{u2} α (Semiring.toMonoidWithZero.{u2} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u2, u2} α α (MonoidWithZero.toZero.{u2} α (Semiring.toMonoidWithZero.{u2} α _inst_1)) (MonoidWithZero.toZero.{u2} α (Semiring.toMonoidWithZero.{u2} α _inst_1)) (MulZeroClass.toSMulWithZero.{u2} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u2} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} α (Semiring.toNonAssocSemiring.{u2} α _inst_1))))))))) x A) (Matrix.vecEmpty.{max u2 u1} (m' -> α))
+Case conversion may be inaccurate. Consider using '#align matrix.smul_mat_empty Matrix.smul_mat_emptyₓ'. -/
@[simp]
theorem smul_mat_empty {m' : Type _} (x : α) (A : Fin 0 → m' → α) : x • A = ![] :=
empty_eq _
#align matrix.smul_mat_empty Matrix.smul_mat_empty
+/- warning: matrix.smul_mat_cons -> Matrix.smul_mat_cons is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {m : Nat} {n' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (x : α) (v : n' -> α) (A : (Fin m) -> n' -> α), Eq.{succ (max u2 u1)} ((Fin (Nat.succ m)) -> n' -> α) (SMul.smul.{u1, max u2 u1} α ((Fin (Nat.succ m)) -> n' -> α) (Function.hasSMul.{0, u1, max u2 u1} (Fin (Nat.succ m)) α (n' -> α) (Function.hasSMul.{u2, u1, u1} n' α α (Mul.toSMul.{u1} α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))) x (Matrix.vecCons.{max u2 u1} (n' -> α) m v A)) (Matrix.vecCons.{max u2 u1} (n' -> α) m (SMul.smul.{u1, max u2 u1} α (n' -> α) (Function.hasSMul.{u2, u1, u1} n' α α (Mul.toSMul.{u1} α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))))) x v) (SMul.smul.{u1, max u2 u1} α ((Fin m) -> n' -> α) (Function.hasSMul.{0, u1, max u2 u1} (Fin m) α (n' -> α) (Function.hasSMul.{u2, u1, u1} n' α α (Mul.toSMul.{u1} α (Distrib.toHasMul.{u1} α (NonUnitalNonAssocSemiring.toDistrib.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))) x A))
+but is expected to have type
+ forall {α : Type.{u1}} {m : Nat} {n' : Type.{u2}} [_inst_1 : Semiring.{u1} α] (x : α) (v : n' -> α) (A : (Fin m) -> n' -> α), Eq.{max (succ u1) (succ u2)} ((Fin (Nat.succ m)) -> n' -> α) (HSMul.hSMul.{u1, max u1 u2, max u1 u2} α ((Fin (Nat.succ m)) -> n' -> α) ((Fin (Nat.succ m)) -> n' -> α) (instHSMul.{u1, max u1 u2} α ((Fin (Nat.succ m)) -> n' -> α) (Pi.instSMul.{0, max u1 u2, u1} (Fin (Nat.succ m)) α (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ m)) => n' -> α) (fun (i : Fin (Nat.succ m)) => Pi.instSMul.{u2, u1, u1} n' α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4297 : n') => α) (fun (i : n') => SMulZeroClass.toSMul.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MulZeroClass.toSMulWithZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))))) x (Matrix.vecCons.{max u1 u2} (n' -> α) m v A)) (Matrix.vecCons.{max u1 u2} (n' -> α) m (HSMul.hSMul.{u1, max u1 u2, max u1 u2} α (n' -> α) (n' -> α) (instHSMul.{u1, max u1 u2} α (n' -> α) (Pi.instSMul.{u2, u1, u1} n' α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4297 : n') => α) (fun (i : n') => SMulZeroClass.toSMul.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MulZeroClass.toSMulWithZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1)))))))) x v) (HSMul.hSMul.{u1, max u1 u2, max u1 u2} α ((Fin m) -> n' -> α) ((Fin m) -> n' -> α) (instHSMul.{u1, max u1 u2} α ((Fin m) -> n' -> α) (Pi.instSMul.{0, max u1 u2, u1} (Fin m) α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4300 : Fin m) => n' -> α) (fun (i : Fin m) => Pi.instSMul.{u2, u1, u1} n' α (fun (a._@.Mathlib.Data.Matrix.Notation._hyg.4303 : n') => α) (fun (i : n') => SMulZeroClass.toSMul.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} α α (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MonoidWithZero.toZero.{u1} α (Semiring.toMonoidWithZero.{u1} α _inst_1)) (MulZeroClass.toSMulWithZero.{u1} α (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} α (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} α (Semiring.toNonAssocSemiring.{u1} α _inst_1))))))))) x A))
+Case conversion may be inaccurate. Consider using '#align matrix.smul_mat_cons Matrix.smul_mat_consₓ'. -/
@[simp]
theorem smul_mat_cons (x : α) (v : n' → α) (A : Fin m → n' → α) :
x • vecCons v A = vecCons (x • v) (x • A) :=
@@ -418,12 +560,15 @@ end Smul
section Submatrix
+#print Matrix.submatrix_empty /-
@[simp]
theorem submatrix_empty (A : Matrix m' n' α) (row : Fin 0 → m') (col : o' → n') :
submatrix A row col = ![] :=
empty_eq _
#align matrix.submatrix_empty Matrix.submatrix_empty
+-/
+#print Matrix.submatrix_cons_row /-
@[simp]
theorem submatrix_cons_row (A : Matrix m' n' α) (i : m') (row : Fin m → m') (col : o' → n') :
submatrix A (vecCons i row) col = vecCons (fun j => A i (col j)) (submatrix A row col) :=
@@ -431,6 +576,7 @@ theorem submatrix_cons_row (A : Matrix m' n' α) (i : m') (row : Fin m → m') (
ext (i j)
refine' Fin.cases _ _ i <;> simp [submatrix]
#align matrix.submatrix_cons_row Matrix.submatrix_cons_row
+-/
end Submatrix
@@ -440,12 +586,24 @@ section One
variable [Zero α] [One α]
+/- warning: matrix.one_fin_two -> Matrix.one_fin_two is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : One.{u1} α], Eq.{succ u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α) (OfNat.ofNat.{u1} (Matrix.{0, 0, u1} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α) 1 (OfNat.mk.{u1} (Matrix.{0, 0, u1} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α) 1 (One.one.{u1} (Matrix.{0, 0, u1} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α) (Matrix.hasOne.{u1, 0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α (fun (a : Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (b : Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) => Fin.decidableEq (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) a b) _inst_1 _inst_2)))) (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) (fun (_x : Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) => ((Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) -> (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) (Equiv.hasCoeToFun.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) (Matrix.of.{u1, 0, 0} (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α _inst_2))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecEmpty.{u1} α))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α _inst_2))) (Matrix.vecEmpty.{u1} α))) (Matrix.vecEmpty.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α)))))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : One.{u1} α], Eq.{succ u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) (OfNat.ofNat.{u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) 1 (One.toOfNat1.{u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) (Matrix.one.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α (fun (a : Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (b : Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) => instDecidableEqFin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) a b) _inst_1 _inst_2))) (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α)) ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (fun (_x : (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) => Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α)) (Matrix.of.{u1, 0, 0} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecEmpty.{u1} α))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecEmpty.{u1} α))) (Matrix.vecEmpty.{u1} ((Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α)))))
+Case conversion may be inaccurate. Consider using '#align matrix.one_fin_two Matrix.one_fin_twoₓ'. -/
theorem one_fin_two : (1 : Matrix (Fin 2) (Fin 2) α) = !![1, 0; 0, 1] :=
by
ext (i j)
fin_cases i <;> fin_cases j <;> rfl
#align matrix.one_fin_two Matrix.one_fin_two
+/- warning: matrix.one_fin_three -> Matrix.one_fin_three is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : One.{u1} α], Eq.{succ u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α) (OfNat.ofNat.{u1} (Matrix.{0, 0, u1} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α) 1 (OfNat.mk.{u1} (Matrix.{0, 0, u1} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α) 1 (One.one.{u1} (Matrix.{0, 0, u1} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α) (Matrix.hasOne.{u1, 0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) α (fun (a : Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (b : Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) => Fin.decidableEq (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) a b) _inst_1 _inst_2)))) (coeFn.{succ u1, succ u1} (Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) (fun (_x : Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) => ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) -> (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) (Equiv.hasCoeToFun.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α)) (Matrix.of.{u1, 0, 0} (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)))) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α _inst_2))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α _inst_2))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne))) (OfNat.ofNat.{u1} α 0 (OfNat.mk.{u1} α 0 (Zero.zero.{u1} α _inst_1))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (OfNat.ofNat.{u1} α 1 (OfNat.mk.{u1} α 1 (One.one.{u1} α _inst_2))) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecEmpty.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α))))))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : Zero.{u1} α] [_inst_2 : One.{u1} α], Eq.{succ u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) (OfNat.ofNat.{u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) 1 (One.toOfNat1.{u1} (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) (Matrix.one.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α (fun (a : Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (b : Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) => instDecidableEqFin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3)) a b) _inst_1 _inst_2))) (FunLike.coe.{succ u1, succ u1, succ u1} (Equiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α)) ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (fun (_x : (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) => Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) _x) (Equiv.instFunLikeEquiv.{succ u1, succ u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (Matrix.{0, 0, u1} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α)) (Matrix.of.{u1, 0, 0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) (OfNat.ofNat.{u1} α 0 (Zero.toOfNat0.{u1} α _inst_1)) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (OfNat.ofNat.{u1} α 1 (One.toOfNat1.{u1} α _inst_2)) (Matrix.vecEmpty.{u1} α)))) (Matrix.vecEmpty.{u1} ((Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α))))))
+Case conversion may be inaccurate. Consider using '#align matrix.one_fin_three Matrix.one_fin_threeₓ'. -/
theorem one_fin_three : (1 : Matrix (Fin 3) (Fin 3) α) = !![1, 0, 0; 0, 1, 0; 0, 0, 1] :=
by
ext (i j)
@@ -454,19 +612,24 @@ theorem one_fin_three : (1 : Matrix (Fin 3) (Fin 3) α) = !![1, 0, 0; 0, 1, 0; 0
end One
+#print Matrix.eta_fin_two /-
theorem eta_fin_two (A : Matrix (Fin 2) (Fin 2) α) : A = !![A 0 0, A 0 1; A 1 0, A 1 1] :=
by
ext (i j)
fin_cases i <;> fin_cases j <;> rfl
#align matrix.eta_fin_two Matrix.eta_fin_two
+-/
+#print Matrix.eta_fin_three /-
theorem eta_fin_three (A : Matrix (Fin 3) (Fin 3) α) :
A = !![A 0 0, A 0 1, A 0 2; A 1 0, A 1 1, A 1 2; A 2 0, A 2 1, A 2 2] :=
by
ext (i j)
fin_cases i <;> fin_cases j <;> rfl
#align matrix.eta_fin_three Matrix.eta_fin_three
+-/
+#print Matrix.mul_fin_two /-
theorem mul_fin_two [AddCommMonoid α] [Mul α] (a₁₁ a₁₂ a₂₁ a₂₂ b₁₁ b₁₂ b₂₁ b₂₂ : α) :
!![a₁₁, a₁₂; a₂₁, a₂₂] ⬝ !![b₁₁, b₁₂; b₂₁, b₂₂] =
!![a₁₁ * b₁₁ + a₁₂ * b₂₁, a₁₁ * b₁₂ + a₁₂ * b₂₂;
@@ -475,7 +638,9 @@ theorem mul_fin_two [AddCommMonoid α] [Mul α] (a₁₁ a₁₂ a₂₁ a₂₂
ext (i j)
fin_cases i <;> fin_cases j <;> simp [Matrix.mul, dot_product, Fin.sum_univ_succ]
#align matrix.mul_fin_two Matrix.mul_fin_two
+-/
+#print Matrix.mul_fin_three /-
theorem mul_fin_three [AddCommMonoid α] [Mul α]
(a₁₁ a₁₂ a₁₃ a₂₁ a₂₂ a₂₃ a₃₁ a₃₂ a₃₃ b₁₁ b₁₂ b₁₃ b₂₁ b₂₂ b₂₃ b₃₁ b₃₂ b₃₃ : α) :
!![a₁₁, a₁₂, a₁₃; a₂₁, a₂₂, a₂₃; a₃₁, a₃₂, a₃₃] ⬝
@@ -490,28 +655,49 @@ theorem mul_fin_three [AddCommMonoid α] [Mul α]
ext (i j)
fin_cases i <;> fin_cases j <;> simp [Matrix.mul, dot_product, Fin.sum_univ_succ, ← add_assoc]
#align matrix.mul_fin_three Matrix.mul_fin_three
+-/
+#print Matrix.vec2_eq /-
theorem vec2_eq {a₀ a₁ b₀ b₁ : α} (h₀ : a₀ = b₀) (h₁ : a₁ = b₁) : ![a₀, a₁] = ![b₀, b₁] := by
subst_vars
#align matrix.vec2_eq Matrix.vec2_eq
+-/
+#print Matrix.vec3_eq /-
theorem vec3_eq {a₀ a₁ a₂ b₀ b₁ b₂ : α} (h₀ : a₀ = b₀) (h₁ : a₁ = b₁) (h₂ : a₂ = b₂) :
![a₀, a₁, a₂] = ![b₀, b₁, b₂] := by subst_vars
#align matrix.vec3_eq Matrix.vec3_eq
+-/
+#print Matrix.vec2_add /-
theorem vec2_add [Add α] (a₀ a₁ b₀ b₁ : α) : ![a₀, a₁] + ![b₀, b₁] = ![a₀ + b₀, a₁ + b₁] := by
rw [cons_add_cons, cons_add_cons, empty_add_empty]
#align matrix.vec2_add Matrix.vec2_add
+-/
+#print Matrix.vec3_add /-
theorem vec3_add [Add α] (a₀ a₁ a₂ b₀ b₁ b₂ : α) :
![a₀, a₁, a₂] + ![b₀, b₁, b₂] = ![a₀ + b₀, a₁ + b₁, a₂ + b₂] := by
rw [cons_add_cons, cons_add_cons, cons_add_cons, empty_add_empty]
#align matrix.vec3_add Matrix.vec3_add
+-/
+/- warning: matrix.smul_vec2 -> Matrix.smul_vec2 is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {R : Type.{u2}} [_inst_1 : SMul.{u2, u1} R α] (x : R) (a₀ : α) (a₁ : α), Eq.{succ u1} ((Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))))) -> α) (SMul.smul.{u2, u1} R ((Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))))) -> α) (Function.hasSMul.{0, u2, u1} (Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))))) R α _inst_1) x (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) a₀ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) a₁ (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (SMul.smul.{u2, u1} R α _inst_1 x a₀) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (SMul.smul.{u2, u1} R α _inst_1 x a₁) (Matrix.vecEmpty.{u1} α)))
+but is expected to have type
+ forall {α : Type.{u2}} {R : Type.{u1}} [_inst_1 : SMul.{u1, u2} R α] (x : R) (a₀ : α) (a₁ : α), Eq.{succ u2} ((Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) -> α) (HSMul.hSMul.{u1, u2, u2} R ((Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) -> α) ((Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) -> α) (instHSMul.{u1, u2} R ((Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) R (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) => α) (fun (i : Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) => _inst_1))) x (Matrix.vecCons.{u2} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) a₀ (Matrix.vecCons.{u2} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) a₁ (Matrix.vecEmpty.{u2} α)))) (Matrix.vecCons.{u2} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (HSMul.hSMul.{u1, u2, u2} R α α (instHSMul.{u1, u2} R α _inst_1) x a₀) (Matrix.vecCons.{u2} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (HSMul.hSMul.{u1, u2, u2} R α α (instHSMul.{u1, u2} R α _inst_1) x a₁) (Matrix.vecEmpty.{u2} α)))
+Case conversion may be inaccurate. Consider using '#align matrix.smul_vec2 Matrix.smul_vec2ₓ'. -/
theorem smul_vec2 {R : Type _} [SMul R α] (x : R) (a₀ a₁ : α) : x • ![a₀, a₁] = ![x • a₀, x • a₁] :=
by rw [smul_cons, smul_cons, smul_empty]
#align matrix.smul_vec2 Matrix.smul_vec2
+/- warning: matrix.smul_vec3 -> Matrix.smul_vec3 is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} {R : Type.{u2}} [_inst_1 : SMul.{u2, u1} R α] (x : R) (a₀ : α) (a₁ : α) (a₂ : α), Eq.{succ u1} ((Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))) -> α) (SMul.smul.{u2, u1} R ((Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))) -> α) (Function.hasSMul.{0, u2, u1} (Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))) R α _inst_1) x (Matrix.vecCons.{u1} α (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))) a₀ (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) a₁ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) a₂ (Matrix.vecEmpty.{u1} α))))) (Matrix.vecCons.{u1} α (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))) (SMul.smul.{u2, u1} R α _inst_1 x a₀) (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (SMul.smul.{u2, u1} R α _inst_1 x a₁) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) (SMul.smul.{u2, u1} R α _inst_1 x a₂) (Matrix.vecEmpty.{u1} α))))
+but is expected to have type
+ forall {α : Type.{u2}} {R : Type.{u1}} [_inst_1 : SMul.{u1, u2} R α] (x : R) (a₀ : α) (a₁ : α) (a₂ : α), Eq.{succ u2} ((Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) -> α) (HSMul.hSMul.{u1, u2, u2} R ((Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) -> α) ((Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) -> α) (instHSMul.{u1, u2} R ((Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) -> α) (Pi.instSMul.{0, u2, u1} (Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) R (fun (a._@.Mathlib.Data.Fin.VecNotation._hyg.29 : Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) => α) (fun (i : Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) => _inst_1))) x (Matrix.vecCons.{u2} α (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))) a₀ (Matrix.vecCons.{u2} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) a₁ (Matrix.vecCons.{u2} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) a₂ (Matrix.vecEmpty.{u2} α))))) (Matrix.vecCons.{u2} α (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))) (HSMul.hSMul.{u1, u2, u2} R α α (instHSMul.{u1, u2} R α _inst_1) x a₀) (Matrix.vecCons.{u2} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (HSMul.hSMul.{u1, u2, u2} R α α (instHSMul.{u1, u2} R α _inst_1) x a₁) (Matrix.vecCons.{u2} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) (HSMul.hSMul.{u1, u2, u2} R α α (instHSMul.{u1, u2} R α _inst_1) x a₂) (Matrix.vecEmpty.{u2} α))))
+Case conversion may be inaccurate. Consider using '#align matrix.smul_vec3 Matrix.smul_vec3ₓ'. -/
theorem smul_vec3 {R : Type _} [SMul R α] (x : R) (a₀ a₁ a₂ : α) :
x • ![a₀, a₁, a₂] = ![x • a₀, x • a₁, x • a₂] := by
rw [smul_cons, smul_cons, smul_cons, smul_empty]
@@ -519,21 +705,45 @@ theorem smul_vec3 {R : Type _} [SMul R α] (x : R) (a₀ a₁ a₂ : α) :
variable [AddCommMonoid α] [Mul α]
+/- warning: matrix.vec2_dot_product' -> Matrix.vec2_dot_product' is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] {a₀ : α} {a₁ : α} {b₀ : α} {b₁ : α}, Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))))) α (Fin.fintype (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))))) _inst_2 _inst_1 (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) a₀ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) a₁ (Matrix.vecEmpty.{u1} α))) (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) b₀ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) b₁ (Matrix.vecEmpty.{u1} α)))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₀ b₀) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₁ b₁))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] {a₀ : α} {a₁ : α} {b₀ : α} {b₁ : α}, Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) α (Fin.fintype (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))))) _inst_2 _inst_1 (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) a₀ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) a₁ (Matrix.vecEmpty.{u1} α))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) b₀ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) b₁ (Matrix.vecEmpty.{u1} α)))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₀ b₀) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₁ b₁))
+Case conversion may be inaccurate. Consider using '#align matrix.vec2_dot_product' Matrix.vec2_dot_product'ₓ'. -/
theorem vec2_dot_product' {a₀ a₁ b₀ b₁ : α} : ![a₀, a₁] ⬝ᵥ ![b₀, b₁] = a₀ * b₀ + a₁ * b₁ := by
rw [cons_dot_product_cons, cons_dot_product_cons, dot_product_empty, add_zero]
#align matrix.vec2_dot_product' Matrix.vec2_dot_product'
+/- warning: matrix.vec2_dot_product -> Matrix.vec2_dotProduct is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (w : (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α (Fin.fintype (OfNat.ofNat.{0} Nat 2 (OfNat.mk.{0} Nat 2 (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) _inst_2 _inst_1 v w) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (v (OfNat.ofNat.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 0 (OfNat.mk.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 0 (Zero.zero.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasZeroOfNeZero (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) (CharZero.NeZero.two.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring))) (StrictOrderedSemiring.to_charZero.{0} Nat Nat.strictOrderedSemiring))))))) (w (OfNat.ofNat.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 0 (OfNat.mk.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 0 (Zero.zero.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasZeroOfNeZero (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) (CharZero.NeZero.two.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring))) (StrictOrderedSemiring.to_charZero.{0} Nat Nat.strictOrderedSemiring)))))))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (v (OfNat.ofNat.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 1 (OfNat.mk.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 1 (One.one.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasOneOfNeZero (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) (CharZero.NeZero.two.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring))) (StrictOrderedSemiring.to_charZero.{0} Nat Nat.strictOrderedSemiring))))))) (w (OfNat.ofNat.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 1 (OfNat.mk.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 1 (One.one.{0} (Fin (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasOneOfNeZero (bit0.{0} Nat Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) (CharZero.NeZero.two.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring))) (StrictOrderedSemiring.to_charZero.{0} Nat Nat.strictOrderedSemiring)))))))))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α) (w : (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) α (Fin.fintype (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) _inst_2 _inst_1 v w) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (v (OfNat.ofNat.{0} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) 0 (Fin.instOfNatFin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) 0 (NeZero.succ (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))))) (w (OfNat.ofNat.{0} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) 0 (Fin.instOfNatFin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) 0 (NeZero.succ (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (v (OfNat.ofNat.{0} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) 1 (Fin.instOfNatFin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) 1 (NeZero.succ (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))))) (w (OfNat.ofNat.{0} (Fin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))) 1 (Fin.instOfNatFin (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) 1 (NeZero.succ (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))))))
+Case conversion may be inaccurate. Consider using '#align matrix.vec2_dot_product Matrix.vec2_dotProductₓ'. -/
@[simp]
theorem vec2_dotProduct (v w : Fin 2 → α) : v ⬝ᵥ w = v 0 * w 0 + v 1 * w 1 :=
vec2_dot_product'
#align matrix.vec2_dot_product Matrix.vec2_dotProduct
+/- warning: matrix.vec3_dot_product' -> Matrix.vec3_dot_product' is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] {a₀ : α} {a₁ : α} {a₂ : α} {b₀ : α} {b₁ : α} {b₂ : α}, Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))) α (Fin.fintype (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))))) _inst_2 _inst_1 (Matrix.vecCons.{u1} α (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))) a₀ (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) a₁ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) a₂ (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} α (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))) b₀ (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) b₁ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))) b₂ (Matrix.vecEmpty.{u1} α))))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₀ b₀) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₁ b₁)) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₂ b₂))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] {a₀ : α} {a₁ : α} {a₂ : α} {b₀ : α} {b₁ : α} {b₂ : α}, Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) α (Fin.fintype (Nat.succ (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))))) _inst_2 _inst_1 (Matrix.vecCons.{u1} α (Nat.succ (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))) a₀ (Matrix.vecCons.{u1} α (Nat.succ (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) a₁ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) a₂ (Matrix.vecEmpty.{u1} α)))) (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)) b₀ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)) b₁ (Matrix.vecCons.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)) b₂ (Matrix.vecEmpty.{u1} α))))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₀ b₀) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₁ b₁)) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) a₂ b₂))
+Case conversion may be inaccurate. Consider using '#align matrix.vec3_dot_product' Matrix.vec3_dot_product'ₓ'. -/
theorem vec3_dot_product' {a₀ a₁ a₂ b₀ b₁ b₂ : α} :
![a₀, a₁, a₂] ⬝ᵥ ![b₀, b₁, b₂] = a₀ * b₀ + a₁ * b₁ + a₂ * b₂ := by
rw [cons_dot_product_cons, cons_dot_product_cons, cons_dot_product_cons, dot_product_empty,
add_zero, add_assoc]
#align matrix.vec3_dot_product' Matrix.vec3_dot_product'
+/- warning: matrix.vec3_dot_product -> Matrix.vec3_dotProduct is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α) (w : (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) α (Fin.fintype (OfNat.ofNat.{0} Nat 3 (OfNat.mk.{0} Nat 3 (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))))) _inst_2 _inst_1 v w) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toHasAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (v (OfNat.ofNat.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 0 (OfNat.mk.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 0 (Zero.zero.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasZeroOfNeZero (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) (ZeroLEOneClass.NeZero.three.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedSemiring.zeroLEOneClass.{0} Nat Nat.orderedSemiring) (NeZero.one.{0} Nat (NonAssocSemiring.toMulZeroOneClass.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring)) Nat.nontrivial) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)))))))) (w (OfNat.ofNat.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 0 (OfNat.mk.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 0 (Zero.zero.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasZeroOfNeZero (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) (ZeroLEOneClass.NeZero.three.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedSemiring.zeroLEOneClass.{0} Nat Nat.orderedSemiring) (NeZero.one.{0} Nat (NonAssocSemiring.toMulZeroOneClass.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring)) Nat.nontrivial) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring))))))))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (v (OfNat.ofNat.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 1 (OfNat.mk.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 1 (One.one.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasOneOfNeZero (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) (ZeroLEOneClass.NeZero.three.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedSemiring.zeroLEOneClass.{0} Nat Nat.orderedSemiring) (NeZero.one.{0} Nat (NonAssocSemiring.toMulZeroOneClass.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring)) Nat.nontrivial) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)))))))) (w (OfNat.ofNat.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 1 (OfNat.mk.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 1 (One.one.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasOneOfNeZero (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) (ZeroLEOneClass.NeZero.three.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedSemiring.zeroLEOneClass.{0} Nat Nat.orderedSemiring) (NeZero.one.{0} Nat (NonAssocSemiring.toMulZeroOneClass.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring)) Nat.nontrivial) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)))))))))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (v (OfNat.ofNat.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 2 (OfNat.mk.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 2 (bit0.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasAdd (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (One.one.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasOneOfNeZero (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) (ZeroLEOneClass.NeZero.three.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedSemiring.zeroLEOneClass.{0} Nat Nat.orderedSemiring) (NeZero.one.{0} Nat (NonAssocSemiring.toMulZeroOneClass.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring)) Nat.nontrivial) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring))))))))) (w (OfNat.ofNat.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 2 (OfNat.mk.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) 2 (bit0.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasAdd (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (One.one.{0} (Fin (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne))) (Fin.hasOneOfNeZero (bit1.{0} Nat Nat.hasOne Nat.hasAdd (One.one.{0} Nat Nat.hasOne)) (ZeroLEOneClass.NeZero.three.{0} Nat (AddCommMonoidWithOne.toAddMonoidWithOne.{0} Nat (NonAssocSemiring.toAddCommMonoidWithOne.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring))) (OrderedCancelAddCommMonoid.toPartialOrder.{0} Nat (StrictOrderedSemiring.toOrderedCancelAddCommMonoid.{0} Nat Nat.strictOrderedSemiring)) (OrderedSemiring.zeroLEOneClass.{0} Nat Nat.orderedSemiring) (NeZero.one.{0} Nat (NonAssocSemiring.toMulZeroOneClass.{0} Nat (Semiring.toNonAssocSemiring.{0} Nat Nat.semiring)) Nat.nontrivial) (OrderedAddCommMonoid.to_covariantClass_left.{0} Nat (OrderedSemiring.toOrderedAddCommMonoid.{0} Nat Nat.orderedSemiring)))))))))))
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : AddCommMonoid.{u1} α] [_inst_2 : Mul.{u1} α] (v : (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α) (w : (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) -> α), Eq.{succ u1} α (Matrix.dotProduct.{u1, 0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) α (Fin.fintype (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) _inst_2 _inst_1 v w) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HAdd.hAdd.{u1, u1, u1} α α α (instHAdd.{u1} α (AddZeroClass.toAdd.{u1} α (AddMonoid.toAddZeroClass.{u1} α (AddCommMonoid.toAddMonoid.{u1} α _inst_1)))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (v (OfNat.ofNat.{0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) 0 (Fin.instOfNatFin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3)) 0 (NeZero.succ (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)))))) (w (OfNat.ofNat.{0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) 0 (Fin.instOfNatFin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3)) 0 (NeZero.succ (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))))))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (v (OfNat.ofNat.{0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) 1 (Fin.instOfNatFin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3)) 1 (NeZero.succ (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)))))) (w (OfNat.ofNat.{0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) 1 (Fin.instOfNatFin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3)) 1 (NeZero.succ (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)))))))) (HMul.hMul.{u1, u1, u1} α α α (instHMul.{u1} α _inst_2) (v (OfNat.ofNat.{0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) 2 (Fin.instOfNatFin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3)) 2 (NeZero.succ (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)))))) (w (OfNat.ofNat.{0} (Fin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3))) 2 (Fin.instOfNatFin (OfNat.ofNat.{0} Nat 3 (instOfNatNat 3)) 2 (NeZero.succ (OfNat.ofNat.{0} Nat 2 (instOfNatNat 2))))))))
+Case conversion may be inaccurate. Consider using '#align matrix.vec3_dot_product Matrix.vec3_dotProductₓ'. -/
@[simp]
theorem vec3_dotProduct (v w : Fin 3 → α) : v ⬝ᵥ w = v 0 * w 0 + v 1 * w 1 + v 2 * w 2 :=
vec3_dot_product'
mathlib commit https://github.com/leanprover-community/mathlib/commit/17ad94b4953419f3e3ce3e77da3239c62d1d09f0
@@ -440,14 +440,12 @@ section One
variable [Zero α] [One α]
-/- ./././Mathport/Syntax/Translate/Tactic/Basic.lean:31:4: unsupported: too many args: matrix.notation ... #[[]] -/
theorem one_fin_two : (1 : Matrix (Fin 2) (Fin 2) α) = !![1, 0; 0, 1] :=
by
ext (i j)
fin_cases i <;> fin_cases j <;> rfl
#align matrix.one_fin_two Matrix.one_fin_two
-/- ./././Mathport/Syntax/Translate/Tactic/Basic.lean:31:4: unsupported: too many args: matrix.notation ... #[[]] -/
theorem one_fin_three : (1 : Matrix (Fin 3) (Fin 3) α) = !![1, 0, 0; 0, 1, 0; 0, 0, 1] :=
by
ext (i j)
@@ -456,14 +454,12 @@ theorem one_fin_three : (1 : Matrix (Fin 3) (Fin 3) α) = !![1, 0, 0; 0, 1, 0; 0
end One
-/- ./././Mathport/Syntax/Translate/Tactic/Basic.lean:31:4: unsupported: too many args: matrix.notation ... #[[]] -/
theorem eta_fin_two (A : Matrix (Fin 2) (Fin 2) α) : A = !![A 0 0, A 0 1; A 1 0, A 1 1] :=
by
ext (i j)
fin_cases i <;> fin_cases j <;> rfl
#align matrix.eta_fin_two Matrix.eta_fin_two
-/- ./././Mathport/Syntax/Translate/Tactic/Basic.lean:31:4: unsupported: too many args: matrix.notation ... #[[]] -/
theorem eta_fin_three (A : Matrix (Fin 3) (Fin 3) α) :
A = !![A 0 0, A 0 1, A 0 2; A 1 0, A 1 1, A 1 2; A 2 0, A 2 1, A 2 2] :=
by
@@ -471,9 +467,6 @@ theorem eta_fin_three (A : Matrix (Fin 3) (Fin 3) α) :
fin_cases i <;> fin_cases j <;> rfl
#align matrix.eta_fin_three Matrix.eta_fin_three
-/- ./././Mathport/Syntax/Translate/Tactic/Basic.lean:31:4: unsupported: too many args: matrix.notation ... #[[]] -/
-/- ./././Mathport/Syntax/Translate/Tactic/Basic.lean:31:4: unsupported: too many args: matrix.notation ... #[[]] -/
-/- ./././Mathport/Syntax/Translate/Tactic/Basic.lean:31:4: unsupported: too many args: matrix.notation ... #[[]] -/
theorem mul_fin_two [AddCommMonoid α] [Mul α] (a₁₁ a₁₂ a₂₁ a₂₂ b₁₁ b₁₂ b₂₁ b₂₂ : α) :
!![a₁₁, a₁₂; a₂₁, a₂₂] ⬝ !![b₁₁, b₁₂; b₂₁, b₂₂] =
!![a₁₁ * b₁₁ + a₁₂ * b₂₁, a₁₁ * b₁₂ + a₁₂ * b₂₂;
@@ -483,9 +476,6 @@ theorem mul_fin_two [AddCommMonoid α] [Mul α] (a₁₁ a₁₂ a₂₁ a₂₂
fin_cases i <;> fin_cases j <;> simp [Matrix.mul, dot_product, Fin.sum_univ_succ]
#align matrix.mul_fin_two Matrix.mul_fin_two
-/- ./././Mathport/Syntax/Translate/Tactic/Basic.lean:31:4: unsupported: too many args: matrix.notation ... #[[]] -/
-/- ./././Mathport/Syntax/Translate/Tactic/Basic.lean:31:4: unsupported: too many args: matrix.notation ... #[[]] -/
-/- ./././Mathport/Syntax/Translate/Tactic/Basic.lean:31:4: unsupported: too many args: matrix.notation ... #[[]] -/
theorem mul_fin_three [AddCommMonoid α] [Mul α]
(a₁₁ a₁₂ a₁₃ a₂₁ a₂₂ a₂₃ a₃₁ a₃₂ a₃₃ b₁₁ b₁₂ b₁₃ b₂₁ b₂₂ b₂₃ b₃₁ b₃₂ b₃₃ : α) :
!![a₁₁, a₁₂, a₁₃; a₂₁, a₂₂, a₂₃; a₃₁, a₃₂, a₃₃] ⬝
mathlib commit https://github.com/leanprover-community/mathlib/commit/17ad94b4953419f3e3ce3e77da3239c62d1d09f0
@@ -476,8 +476,8 @@ theorem eta_fin_three (A : Matrix (Fin 3) (Fin 3) α) :
/- ./././Mathport/Syntax/Translate/Tactic/Basic.lean:31:4: unsupported: too many args: matrix.notation ... #[[]] -/
theorem mul_fin_two [AddCommMonoid α] [Mul α] (a₁₁ a₁₂ a₂₁ a₂₂ b₁₁ b₁₂ b₂₁ b₂₂ : α) :
!![a₁₁, a₁₂; a₂₁, a₂₂] ⬝ !![b₁₁, b₁₂; b₂₁, b₂₂] =
- !![a₁₁ * b₁₁ + a₁₂ * b₂₁, a₁₁ * b₁₂ + a₁₂ * b₂₂; a₂₁ * b₁₁ + a₂₂ * b₂₁,
- a₂₁ * b₁₂ + a₂₂ * b₂₂] :=
+ !![a₁₁ * b₁₁ + a₁₂ * b₂₁, a₁₁ * b₁₂ + a₁₂ * b₂₂;
+ a₂₁ * b₁₁ + a₂₂ * b₂₁, a₂₁ * b₁₂ + a₂₂ * b₂₂] :=
by
ext (i j)
fin_cases i <;> fin_cases j <;> simp [Matrix.mul, dot_product, Fin.sum_univ_succ]
@@ -491,10 +491,11 @@ theorem mul_fin_three [AddCommMonoid α] [Mul α]
!![a₁₁, a₁₂, a₁₃; a₂₁, a₂₂, a₂₃; a₃₁, a₃₂, a₃₃] ⬝
!![b₁₁, b₁₂, b₁₃; b₂₁, b₂₂, b₂₃; b₃₁, b₃₂, b₃₃] =
!![a₁₁ * b₁₁ + a₁₂ * b₂₁ + a₁₃ * b₃₁, a₁₁ * b₁₂ + a₁₂ * b₂₂ + a₁₃ * b₃₂,
- a₁₁ * b₁₃ + a₁₂ * b₂₃ + a₁₃ * b₃₃; a₂₁ * b₁₁ + a₂₂ * b₂₁ + a₂₃ * b₃₁,
- a₂₁ * b₁₂ + a₂₂ * b₂₂ + a₂₃ * b₃₂, a₂₁ * b₁₃ + a₂₂ * b₂₃ + a₂₃ * b₃₃;
+ a₁₁ * b₁₃ + a₁₂ * b₂₃ + a₁₃ * b₃₃;
+ a₂₁ * b₁₁ + a₂₂ * b₂₁ + a₂₃ * b₃₁, a₂₁ * b₁₂ + a₂₂ * b₂₂ + a₂₃ * b₃₂,
+ a₂₁ * b₁₃ + a₂₂ * b₂₃ + a₂₃ * b₃₃;
a₃₁ * b₁₁ + a₃₂ * b₂₁ + a₃₃ * b₃₁, a₃₁ * b₁₂ + a₃₂ * b₂₂ + a₃₃ * b₃₂,
- a₃₁ * b₁₃ + a₃₂ * b₂₃ + a₃₃ * b₃₃] :=
+ a₃₁ * b₁₃ + a₃₂ * b₂₃ + a₃₃ * b₃₃] :=
by
ext (i j)
fin_cases i <;> fin_cases j <;> simp [Matrix.mul, dot_product, Fin.sum_univ_succ, ← add_assoc]
mathlib commit https://github.com/leanprover-community/mathlib/commit/17ad94b4953419f3e3ce3e77da3239c62d1d09f0
@@ -440,23 +440,15 @@ section One
variable [Zero α] [One α]
-/- ./././Mathport/Syntax/Translate/Expr.lean:207:4: warning: unsupported notation `«expr!![ » -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation -/
-theorem one_fin_two :
- (1 : Matrix (Fin 2) (Fin 2) α) =
- «expr!![ »
- "./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation" :=
+/- ./././Mathport/Syntax/Translate/Tactic/Basic.lean:31:4: unsupported: too many args: matrix.notation ... #[[]] -/
+theorem one_fin_two : (1 : Matrix (Fin 2) (Fin 2) α) = !![1, 0; 0, 1] :=
by
ext (i j)
fin_cases i <;> fin_cases j <;> rfl
#align matrix.one_fin_two Matrix.one_fin_two
-/- ./././Mathport/Syntax/Translate/Expr.lean:207:4: warning: unsupported notation `«expr!![ » -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation -/
-theorem one_fin_three :
- (1 : Matrix (Fin 3) (Fin 3) α) =
- «expr!![ »
- "./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation" :=
+/- ./././Mathport/Syntax/Translate/Tactic/Basic.lean:31:4: unsupported: too many args: matrix.notation ... #[[]] -/
+theorem one_fin_three : (1 : Matrix (Fin 3) (Fin 3) α) = !![1, 0, 0; 0, 1, 0; 0, 0, 1] :=
by
ext (i j)
fin_cases i <;> fin_cases j <;> rfl
@@ -464,60 +456,45 @@ theorem one_fin_three :
end One
-/- ./././Mathport/Syntax/Translate/Expr.lean:207:4: warning: unsupported notation `«expr!![ » -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation -/
-theorem eta_fin_two (A : Matrix (Fin 2) (Fin 2) α) :
- A =
- «expr!![ »
- "./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation" :=
+/- ./././Mathport/Syntax/Translate/Tactic/Basic.lean:31:4: unsupported: too many args: matrix.notation ... #[[]] -/
+theorem eta_fin_two (A : Matrix (Fin 2) (Fin 2) α) : A = !![A 0 0, A 0 1; A 1 0, A 1 1] :=
by
ext (i j)
fin_cases i <;> fin_cases j <;> rfl
#align matrix.eta_fin_two Matrix.eta_fin_two
-/- ./././Mathport/Syntax/Translate/Expr.lean:207:4: warning: unsupported notation `«expr!![ » -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation -/
+/- ./././Mathport/Syntax/Translate/Tactic/Basic.lean:31:4: unsupported: too many args: matrix.notation ... #[[]] -/
theorem eta_fin_three (A : Matrix (Fin 3) (Fin 3) α) :
- A =
- «expr!![ »
- "./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation" :=
+ A = !![A 0 0, A 0 1, A 0 2; A 1 0, A 1 1, A 1 2; A 2 0, A 2 1, A 2 2] :=
by
ext (i j)
fin_cases i <;> fin_cases j <;> rfl
#align matrix.eta_fin_three Matrix.eta_fin_three
-/- ./././Mathport/Syntax/Translate/Expr.lean:207:4: warning: unsupported notation `«expr!![ » -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:207:4: warning: unsupported notation `«expr!![ » -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:207:4: warning: unsupported notation `«expr!![ » -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation -/
+/- ./././Mathport/Syntax/Translate/Tactic/Basic.lean:31:4: unsupported: too many args: matrix.notation ... #[[]] -/
+/- ./././Mathport/Syntax/Translate/Tactic/Basic.lean:31:4: unsupported: too many args: matrix.notation ... #[[]] -/
+/- ./././Mathport/Syntax/Translate/Tactic/Basic.lean:31:4: unsupported: too many args: matrix.notation ... #[[]] -/
theorem mul_fin_two [AddCommMonoid α] [Mul α] (a₁₁ a₁₂ a₂₁ a₂₂ b₁₁ b₁₂ b₂₁ b₂₂ : α) :
- «expr!![ »
- "./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation" ⬝
- «expr!![ »
- "./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation" =
- «expr!![ »
- "./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation" :=
+ !![a₁₁, a₁₂; a₂₁, a₂₂] ⬝ !![b₁₁, b₁₂; b₂₁, b₂₂] =
+ !![a₁₁ * b₁₁ + a₁₂ * b₂₁, a₁₁ * b₁₂ + a₁₂ * b₂₂; a₂₁ * b₁₁ + a₂₂ * b₂₁,
+ a₂₁ * b₁₂ + a₂₂ * b₂₂] :=
by
ext (i j)
fin_cases i <;> fin_cases j <;> simp [Matrix.mul, dot_product, Fin.sum_univ_succ]
#align matrix.mul_fin_two Matrix.mul_fin_two
-/- ./././Mathport/Syntax/Translate/Expr.lean:207:4: warning: unsupported notation `«expr!![ » -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:207:4: warning: unsupported notation `«expr!![ » -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:207:4: warning: unsupported notation `«expr!![ » -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation -/
+/- ./././Mathport/Syntax/Translate/Tactic/Basic.lean:31:4: unsupported: too many args: matrix.notation ... #[[]] -/
+/- ./././Mathport/Syntax/Translate/Tactic/Basic.lean:31:4: unsupported: too many args: matrix.notation ... #[[]] -/
+/- ./././Mathport/Syntax/Translate/Tactic/Basic.lean:31:4: unsupported: too many args: matrix.notation ... #[[]] -/
theorem mul_fin_three [AddCommMonoid α] [Mul α]
(a₁₁ a₁₂ a₁₃ a₂₁ a₂₂ a₂₃ a₃₁ a₃₂ a₃₃ b₁₁ b₁₂ b₁₃ b₂₁ b₂₂ b₂₃ b₃₁ b₃₂ b₃₃ : α) :
- «expr!![ »
- "./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation" ⬝
- «expr!![ »
- "./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation" =
- «expr!![ »
- "./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation" :=
+ !![a₁₁, a₁₂, a₁₃; a₂₁, a₂₂, a₂₃; a₃₁, a₃₂, a₃₃] ⬝
+ !![b₁₁, b₁₂, b₁₃; b₂₁, b₂₂, b₂₃; b₃₁, b₃₂, b₃₃] =
+ !![a₁₁ * b₁₁ + a₁₂ * b₂₁ + a₁₃ * b₃₁, a₁₁ * b₁₂ + a₁₂ * b₂₂ + a₁₃ * b₃₂,
+ a₁₁ * b₁₃ + a₁₂ * b₂₃ + a₁₃ * b₃₃; a₂₁ * b₁₁ + a₂₂ * b₂₁ + a₂₃ * b₃₁,
+ a₂₁ * b₁₂ + a₂₂ * b₂₂ + a₂₃ * b₃₂, a₂₁ * b₁₃ + a₂₂ * b₂₃ + a₂₃ * b₃₃;
+ a₃₁ * b₁₁ + a₃₂ * b₂₁ + a₃₃ * b₃₁, a₃₁ * b₁₂ + a₃₂ * b₂₂ + a₃₃ * b₃₂,
+ a₃₁ * b₁₃ + a₃₂ * b₂₃ + a₃₃ * b₃₃] :=
by
ext (i j)
fin_cases i <;> fin_cases j <;> simp [Matrix.mul, dot_product, Fin.sum_univ_succ, ← add_assoc]
mathlib commit https://github.com/leanprover-community/mathlib/commit/347636a7a80595d55bedf6e6fbd996a3c39da69a
@@ -58,7 +58,7 @@ open Matrix
/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[] -/
/-- Matrices can be reflected whenever their entries can. We insert an `@id (matrix m' n' α)` to
prevent immediate decay to a function. -/
-unsafe instance matrix.reflect [reflected_univ.{u}] [reflected_univ.{u_1}] [reflected_univ.{u_2}]
+unsafe instance matrix.reflect [Lean.ToLevel.{u}] [Lean.ToLevel.{u_1}] [Lean.ToLevel.{u_2}]
[reflected _ α] [reflected _ m'] [reflected _ n'] [h : has_reflect (m' → n' → α)] :
has_reflect (Matrix m' n' α) := fun m =>
(by
mathlib commit https://github.com/leanprover-community/mathlib/commit/172bf2812857f5e56938cc148b7a539f52f84ca9
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Eric Wieser
! This file was ported from Lean 3 source module data.matrix.notation
-! leanprover-community/mathlib commit 55e2dfde0cff928ce5c70926a3f2c7dee3e2dd99
+! leanprover-community/mathlib commit 3e068ece210655b7b9a9477c3aff38a492400aa1
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -392,7 +392,7 @@ theorem vecMulVec_cons (v : m' → α) (x : α) (w : Fin n → α) :
vecMulVec v (vecCons x w) = fun i => v i • vecCons x w :=
by
ext (i j)
- rw [vec_mul_vec, Pi.smul_apply, smul_eq_mul]
+ rw [vec_mul_vec_apply, Pi.smul_apply, smul_eq_mul]
#align matrix.vec_mul_vec_cons Matrix.vecMulVec_cons
end VecMulVec
mathlib commit https://github.com/leanprover-community/mathlib/commit/4c586d291f189eecb9d00581aeb3dd998ac34442
@@ -54,8 +54,8 @@ variable {α : Type u} {o n m : ℕ} {m' n' o' : Type _}
open Matrix
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14: unsupported tactic `reflect_name #[] -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14: unsupported tactic `reflect_name #[] -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[] -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[] -/
/-- Matrices can be reflected whenever their entries can. We insert an `@id (matrix m' n' α)` to
prevent immediate decay to a function. -/
unsafe instance matrix.reflect [reflected_univ.{u}] [reflected_univ.{u_1}] [reflected_univ.{u_2}]
@@ -63,11 +63,11 @@ unsafe instance matrix.reflect [reflected_univ.{u}] [reflected_univ.{u_1}] [refl
has_reflect (Matrix m' n' α) := fun m =>
(by
trace
- "./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14: unsupported tactic `reflect_name #[]" :
+ "./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[]" :
reflected _ @id.{max u_1 u_2 u + 1}).subst₂
((by
trace
- "./././Mathport/Syntax/Translate/Tactic/Builtin.lean:76:14: unsupported tactic `reflect_name #[]" :
+ "./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `reflect_name #[]" :
reflected _ @Matrix.{u_1, u_2, u}).subst₃
q(_) q(_) q(_)) <|
by
@@ -441,22 +441,22 @@ section One
variable [Zero α] [One α]
/- ./././Mathport/Syntax/Translate/Expr.lean:207:4: warning: unsupported notation `«expr!![ » -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:391:14: unsupported user notation matrix.notation -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation -/
theorem one_fin_two :
(1 : Matrix (Fin 2) (Fin 2) α) =
«expr!![ »
- "./././Mathport/Syntax/Translate/Expr.lean:391:14: unsupported user notation matrix.notation" :=
+ "./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation" :=
by
ext (i j)
fin_cases i <;> fin_cases j <;> rfl
#align matrix.one_fin_two Matrix.one_fin_two
/- ./././Mathport/Syntax/Translate/Expr.lean:207:4: warning: unsupported notation `«expr!![ » -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:391:14: unsupported user notation matrix.notation -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation -/
theorem one_fin_three :
(1 : Matrix (Fin 3) (Fin 3) α) =
«expr!![ »
- "./././Mathport/Syntax/Translate/Expr.lean:391:14: unsupported user notation matrix.notation" :=
+ "./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation" :=
by
ext (i j)
fin_cases i <;> fin_cases j <;> rfl
@@ -465,59 +465,59 @@ theorem one_fin_three :
end One
/- ./././Mathport/Syntax/Translate/Expr.lean:207:4: warning: unsupported notation `«expr!![ » -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:391:14: unsupported user notation matrix.notation -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation -/
theorem eta_fin_two (A : Matrix (Fin 2) (Fin 2) α) :
A =
«expr!![ »
- "./././Mathport/Syntax/Translate/Expr.lean:391:14: unsupported user notation matrix.notation" :=
+ "./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation" :=
by
ext (i j)
fin_cases i <;> fin_cases j <;> rfl
#align matrix.eta_fin_two Matrix.eta_fin_two
/- ./././Mathport/Syntax/Translate/Expr.lean:207:4: warning: unsupported notation `«expr!![ » -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:391:14: unsupported user notation matrix.notation -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation -/
theorem eta_fin_three (A : Matrix (Fin 3) (Fin 3) α) :
A =
«expr!![ »
- "./././Mathport/Syntax/Translate/Expr.lean:391:14: unsupported user notation matrix.notation" :=
+ "./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation" :=
by
ext (i j)
fin_cases i <;> fin_cases j <;> rfl
#align matrix.eta_fin_three Matrix.eta_fin_three
/- ./././Mathport/Syntax/Translate/Expr.lean:207:4: warning: unsupported notation `«expr!![ » -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:391:14: unsupported user notation matrix.notation -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:207:4: warning: unsupported notation `«expr!![ » -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:391:14: unsupported user notation matrix.notation -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:207:4: warning: unsupported notation `«expr!![ » -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:391:14: unsupported user notation matrix.notation -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation -/
theorem mul_fin_two [AddCommMonoid α] [Mul α] (a₁₁ a₁₂ a₂₁ a₂₂ b₁₁ b₁₂ b₂₁ b₂₂ : α) :
«expr!![ »
- "./././Mathport/Syntax/Translate/Expr.lean:391:14: unsupported user notation matrix.notation" ⬝
+ "./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation" ⬝
«expr!![ »
- "./././Mathport/Syntax/Translate/Expr.lean:391:14: unsupported user notation matrix.notation" =
+ "./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation" =
«expr!![ »
- "./././Mathport/Syntax/Translate/Expr.lean:391:14: unsupported user notation matrix.notation" :=
+ "./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation" :=
by
ext (i j)
fin_cases i <;> fin_cases j <;> simp [Matrix.mul, dot_product, Fin.sum_univ_succ]
#align matrix.mul_fin_two Matrix.mul_fin_two
/- ./././Mathport/Syntax/Translate/Expr.lean:207:4: warning: unsupported notation `«expr!![ » -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:391:14: unsupported user notation matrix.notation -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:207:4: warning: unsupported notation `«expr!![ » -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:391:14: unsupported user notation matrix.notation -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:207:4: warning: unsupported notation `«expr!![ » -/
-/- ./././Mathport/Syntax/Translate/Expr.lean:391:14: unsupported user notation matrix.notation -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation -/
theorem mul_fin_three [AddCommMonoid α] [Mul α]
(a₁₁ a₁₂ a₁₃ a₂₁ a₂₂ a₂₃ a₃₁ a₃₂ a₃₃ b₁₁ b₁₂ b₁₃ b₂₁ b₂₂ b₂₃ b₃₁ b₃₂ b₃₃ : α) :
«expr!![ »
- "./././Mathport/Syntax/Translate/Expr.lean:391:14: unsupported user notation matrix.notation" ⬝
+ "./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation" ⬝
«expr!![ »
- "./././Mathport/Syntax/Translate/Expr.lean:391:14: unsupported user notation matrix.notation" =
+ "./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation" =
«expr!![ »
- "./././Mathport/Syntax/Translate/Expr.lean:391:14: unsupported user notation matrix.notation" :=
+ "./././Mathport/Syntax/Translate/Expr.lean:387:14: unsupported user notation matrix.notation" :=
by
ext (i j)
fin_cases i <;> fin_cases j <;> simp [Matrix.mul, dot_product, Fin.sum_univ_succ, ← add_assoc]
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
of
typecasts (#11593)
This adds some missing Matrix.of
typecasts, and uses Matrix.submatrix
in places where this is more reasonable than adding of
.
Matrix.det_permute'
is a new lemma that fills the obvious gap that these submatrix
restatements emphasize.
@@ -146,9 +146,7 @@ theorem head_val' (B : Fin m.succ → n' → α) (j : n') : (vecHead fun i => B
@[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
- simp [vecTail]
+ (vecTail fun i => B i j) = fun i => vecTail B i j := rfl
#align matrix.tail_val' Matrix.tail_val'
section DotProduct
@@ -187,21 +185,18 @@ theorem col_empty (v : Fin 0 → α) : col v = vecEmpty :=
#align matrix.col_empty Matrix.col_empty
@[simp]
-theorem col_cons (x : α) (u : Fin m → α) : col (vecCons x u) = vecCons (fun _ => x) (col u) := by
+theorem col_cons (x : α) (u : Fin m → α) :
+ col (vecCons x u) = of (vecCons (fun _ => x) (col u)) := by
ext i j
refine' Fin.cases _ _ i <;> simp [vecHead, vecTail]
#align matrix.col_cons Matrix.col_cons
@[simp]
-theorem row_empty : row (vecEmpty : Fin 0 → α) = fun _ => vecEmpty := by
- ext
- rfl
+theorem row_empty : row (vecEmpty : Fin 0 → α) = of fun _ => vecEmpty := rfl
#align matrix.row_empty Matrix.row_empty
@[simp]
-theorem row_cons (x : α) (u : Fin m → α) : row (vecCons x u) = fun _ => vecCons x u := by
- ext
- rfl
+theorem row_cons (x : α) (u : Fin m → α) : row (vecCons x u) = of fun _ => vecCons x u := rfl
#align matrix.row_cons Matrix.row_cons
end ColRow
@@ -350,7 +345,7 @@ theorem empty_vecMulVec (v : Fin 0 → α) (w : n' → α) : vecMulVec v w = ![]
#align matrix.empty_vec_mul_vec Matrix.empty_vecMulVec
@[simp]
-theorem vecMulVec_empty (v : m' → α) (w : Fin 0 → α) : vecMulVec v w = fun _ => ![] :=
+theorem vecMulVec_empty (v : m' → α) (w : Fin 0 → α) : vecMulVec v w = of fun _ => ![] :=
funext fun _ => empty_eq _
#align matrix.vec_mul_vec_empty Matrix.vecMulVec_empty
@@ -363,9 +358,7 @@ theorem cons_vecMulVec (x : α) (v : Fin m → α) (w : n' → α) :
@[simp]
theorem vecMulVec_cons (v : m' → α) (x : α) (w : Fin n → α) :
- vecMulVec v (vecCons x w) = fun i => v i • vecCons x w := by
- ext i j
- rw [vecMulVec_apply, Pi.smul_apply, smul_eq_mul]
+ vecMulVec v (vecCons x w) = of fun i => v i • vecCons x w := rfl
#align matrix.vec_mul_vec_cons Matrix.vecMulVec_cons
end VecMulVec
@@ -172,7 +172,7 @@ theorem dotProduct_cons (v : Fin n.succ → α) (x : α) (w : Fin n → α) :
simp [dotProduct, Fin.sum_univ_succ, vecHead, vecTail]
#align matrix.dot_product_cons Matrix.dotProduct_cons
--- @[simp] -- Porting note: simp can prove this
+-- @[simp] -- Porting note (#10618): simp can prove this
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 simp
#align matrix.cons_dot_product_cons Matrix.cons_dotProduct_cons
@@ -303,7 +303,7 @@ theorem vecMul_cons (v : Fin n.succ → α) (w : o' → α) (B : Fin n → o'
simp [vecMul]
#align matrix.vec_mul_cons Matrix.vecMul_cons
--- @[simp] -- Porting note: simp can prove this
+-- @[simp] -- Porting note (#10618): simp can prove this
theorem cons_vecMul_cons (x : α) (v : Fin n → α) (w : o' → α) (B : Fin n → o' → α) :
vecCons x v ᵥ* of (vecCons w B) = x • w + v ᵥ* of B := by simp
#align matrix.cons_vec_mul_cons Matrix.cons_vecMul_cons
@@ -374,12 +374,12 @@ section SMul
variable [NonUnitalNonAssocSemiring α]
--- @[simp] -- Porting note: simp can prove this
+-- @[simp] -- Porting note (#10618): simp can prove this
theorem smul_mat_empty {m' : Type*} (x : α) (A : Fin 0 → m' → α) : x • A = ![] :=
empty_eq _
#align matrix.smul_mat_empty Matrix.smul_mat_empty
--- @[simp] -- Porting note: simp can prove this
+-- @[simp] -- Porting note (#10618): simp can prove this
theorem smul_mat_cons (x : α) (v : n' → α) (A : Fin m → n' → α) :
x • vecCons v A = vecCons (x • v) (x • A) := by
ext i
@@ -437,6 +437,32 @@ theorem one_fin_three : (1 : Matrix (Fin 3) (Fin 3) α) = !![1, 0, 0; 0, 1, 0; 0
end One
+section AddMonoidWithOne
+variable [AddMonoidWithOne α]
+
+theorem natCast_fin_two (n : ℕ) : (n : Matrix (Fin 2) (Fin 2) α) = !![↑n, 0; 0, ↑n] := by
+ ext i j
+ fin_cases i <;> fin_cases j <;> rfl
+
+theorem natCast_fin_three (n : ℕ) :
+ (n : Matrix (Fin 3) (Fin 3) α) = !![↑n, 0, 0; 0, ↑n, 0; 0, 0, ↑n] := by
+ ext i j
+ fin_cases i <;> fin_cases j <;> rfl
+
+-- See note [no_index around OfNat.ofNat]
+theorem ofNat_fin_two (n : ℕ) [n.AtLeastTwo] :
+ (no_index (OfNat.ofNat n) : Matrix (Fin 2) (Fin 2) α) =
+ !![OfNat.ofNat n, 0; 0, OfNat.ofNat n] :=
+ natCast_fin_two _
+
+-- See note [no_index around OfNat.ofNat]
+theorem ofNat_fin_three (n : ℕ) [n.AtLeastTwo] :
+ (no_index (OfNat.ofNat n) : Matrix (Fin 3) (Fin 3) α) =
+ !![OfNat.ofNat n, 0, 0; 0, OfNat.ofNat n, 0; 0, 0, OfNat.ofNat n] :=
+ natCast_fin_three _
+
+end AddMonoidWithOne
+
theorem eta_fin_two (A : Matrix (Fin 2) (Fin 2) α) : A = !![A 0 0, A 0 1; A 1 0, A 1 1] := by
ext i j
fin_cases i <;> fin_cases j <;> rfl
Matrix.mulVec
and Matrix.vecMul
get infix notation (#10297)
Zulip discussion: https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/Notation.20for.20mul_vec.20and.20vec_mul
Co-authored-by: Martin Dvorak <mdvorak@ista.ac.at>
@@ -266,7 +266,7 @@ theorem mul_val_succ [Fintype n'] (A : Matrix (Fin m.succ) n' α) (B : Matrix n'
@[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
+ of (vecCons v A) * B = of (vecCons (v ᵥ* B) (of.symm (of A * B))) := by
ext i j
refine' Fin.cases _ _ i
· rfl
@@ -280,32 +280,32 @@ section VecMul
variable [NonUnitalNonAssocSemiring α]
@[simp]
-theorem empty_vecMul (v : Fin 0 → α) (B : Matrix (Fin 0) o' α) : vecMul v B = 0 :=
+theorem empty_vecMul (v : Fin 0 → α) (B : Matrix (Fin 0) o' α) : v ᵥ* B = 0 :=
rfl
#align matrix.empty_vec_mul Matrix.empty_vecMul
@[simp]
-theorem vecMul_empty [Fintype n'] (v : n' → α) (B : Matrix n' (Fin 0) α) : vecMul v B = ![] :=
+theorem vecMul_empty [Fintype n'] (v : n' → α) (B : Matrix n' (Fin 0) α) : v ᵥ* B = ![] :=
empty_eq _
#align matrix.vec_mul_empty Matrix.vecMul_empty
@[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
+ vecCons x v ᵥ* of B = x • vecHead B + v ᵥ* of vecTail B := by
ext i
simp [vecMul]
#align matrix.cons_vec_mul Matrix.cons_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
+ v ᵥ* of (vecCons w B) = vecHead v • w + vecTail v ᵥ* of B := by
ext i
simp [vecMul]
#align matrix.vec_mul_cons Matrix.vecMul_cons
-- @[simp] -- Porting note: simp can prove this
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 simp
+ vecCons x v ᵥ* of (vecCons w B) = x • w + v ᵥ* of B := by simp
#align matrix.cons_vec_mul_cons Matrix.cons_vecMul_cons
end VecMul
@@ -315,25 +315,25 @@ section MulVec
variable [NonUnitalNonAssocSemiring α]
@[simp]
-theorem empty_mulVec [Fintype n'] (A : Matrix (Fin 0) n' α) (v : n' → α) : mulVec A v = ![] :=
+theorem empty_mulVec [Fintype n'] (A : Matrix (Fin 0) n' α) (v : n' → α) : A *ᵥ v = ![] :=
empty_eq _
#align matrix.empty_mul_vec Matrix.empty_mulVec
@[simp]
-theorem mulVec_empty (A : Matrix m' (Fin 0) α) (v : Fin 0 → α) : mulVec A v = 0 :=
+theorem mulVec_empty (A : Matrix m' (Fin 0) α) (v : Fin 0 → α) : A *ᵥ v = 0 :=
rfl
#align matrix.mul_vec_empty Matrix.mulVec_empty
@[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
+ (of <| vecCons v A) *ᵥ w = vecCons (dotProduct v w) (of A *ᵥ w) := by
ext i
refine' Fin.cases _ _ i <;> simp [mulVec]
#align matrix.cons_mul_vec Matrix.cons_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
+ (of A) *ᵥ (vecCons x v) = x • vecHead ∘ A + (of (vecTail ∘ A)) *ᵥ v := by
ext i
simp [mulVec, mul_comm]
#align matrix.mul_vec_cons Matrix.mulVec_cons
For error messages that span multiple lines, now we can use the new "string gap" escape sequence (a \
at the end of the line, which causes all the whitespace at the beginning of the next line ignored), rather than using append operations or hacks involving {
and }
for s!
and m!
strings.
Style-wise, we suggest for long messages that the body of the message start on the next line if possible, by starting the message with a string gap sequence. This eliminates needing to decide whether to indent continuing lines at the "
or at the next column. For example:
logError m!"\
Tactic 'more_magic' cannot \
apply expression{indentD e}\n\
due to some reason or another."
Note that to get whitespace to appear between one line and the next, you include it before the \
.
@@ -103,9 +103,9 @@ macro_rules
let n := if h : 0 < m then rows[0].size else 0
let rowVecs ← rows.mapM fun row : Array Term => do
unless row.size = n do
- Macro.throwErrorAt (mkNullNode row)
- s!"Rows must be of equal length; this row has {row.size} items, the previous rows {"
- "}have {n}"
+ Macro.throwErrorAt (mkNullNode row) s!"\
+ Rows must be of equal length; this row has {row.size} items, \
+ the previous rows have {n}"
`(![$row,*])
`(@Matrix.of (Fin $(quote m)) (Fin $(quote n)) _ ![$rowVecs,*])
| `(!![$[;%$semicolons]*]) => do
Nsmul
-> NSMul
, Zpow
-> ZPow
, etc (#9067)
Normalising to naming convention rule number 6.
@@ -370,7 +370,7 @@ theorem vecMulVec_cons (v : m' → α) (x : α) (w : Fin n → α) :
end VecMulVec
-section Smul
+section SMul
variable [NonUnitalNonAssocSemiring α]
@@ -386,7 +386,7 @@ theorem smul_mat_cons (x : α) (v : n' → α) (A : Fin m → n' → α) :
refine' Fin.cases _ _ i <;> simp
#align matrix.smul_mat_cons Matrix.smul_mat_cons
-end Smul
+end SMul
section Submatrix
This splits out row
/col
/updateRow
/updateColumn
to their own file, as Data/Matrix/Basic
is getting rather large.
The copyright comes from https://github.com/leanprover-community/mathlib/pull/1816 and https://github.com/leanprover-community/mathlib/pull/2480
There are no new lemmas in this PR, nor were any existing lemmas deleted.
It's possible that even more lemmas could migrate to this new file (for instance, flipping the import with Matrix.Notation
or LinearAlgebra.Matrix.Trace
), but I've taken the conservative option of leaving those lemmas alone for now.
@@ -4,9 +4,9 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Eric Wieser
-/
import Mathlib.Data.Matrix.Basic
+import Mathlib.Data.Matrix.RowCol
import Mathlib.Data.Fin.VecNotation
import Mathlib.Tactic.FinCases
-import Mathlib.Algebra.BigOperators.Fin
#align_import data.matrix.notation from "leanprover-community/mathlib"@"a99f85220eaf38f14f94e04699943e185a5e1d1a"
@@ -72,9 +72,29 @@ end toExpr
section Parser
open Lean Elab Term Macro TSyntax
+/-- Notation for m×n matrices, aka `Matrix (Fin m) (Fin n) α`.
+
+For instance:
+* `!![a, b, c; d, e, f]` is the matrix with two rows and three columns, of type
+ `Matrix (Fin 2) (Fin 3) α`
+* `!![a, b, c]` is a row vector of type `Matrix (Fin 1) (Fin 3) α` (see also `Matrix.row`).
+* `!![a; b; c]` is a column vector of type `Matrix (Fin 3) (Fin 1) α` (see also `Matrix.col`).
+
+This notation implements some special cases:
+
+* `![,,]`, with `n` `,`s, is a term of type `Matrix (Fin 0) (Fin n) α`
+* `![;;]`, with `m` `;`s, is a term of type `Matrix (Fin m) (Fin 0) α`
+* `![]` is the 0×0 matrix
+
+Note that vector notation is provided elsewhere (by `Matrix.vecNotation`) as `![a, b, c]`.
+Under the hood, `!![a, b, c; d, e, f]` is syntax for `Matrix.of ![![a, b, c], ![d, e, f]]`.
+-/
syntax (name := matrixNotation)
"!![" ppRealGroup(sepBy1(ppGroup(term,+,?), ";", "; ", allowTrailingSep)) "]" : term
+
+@[inherit_doc matrixNotation]
syntax (name := matrixNotationRx0) "!![" ";"* "]" : term
+@[inherit_doc matrixNotation]
syntax (name := matrixNotation0xC) "!![" ","+ "]" : term
macro_rules
⬝
notation in favor of HMul
(#6487)
The main difficulty here is that *
has a slightly difference precedence to ⬝
. notably around smul
and neg
.
The other annoyance is that ↑U ⬝ A ⬝ ↑U⁻¹ : Matrix m m 𝔸
now has to be written U.val * A * (U⁻¹).val
in order to typecheck.
A downside of this change to consider: if you have a goal of A * (B * C) = (A * B) * C
, mul_assoc
now gives the illusion of matching, when in fact Matrix.mul_assoc
is needed. Previously the distinct symbol made it easy to avoid this mistake.
On the flipside, there is now no need to rewrite by Matrix.mul_eq_mul
all the time (indeed, the lemma is now removed).
@@ -224,29 +224,29 @@ section Mul
variable [NonUnitalNonAssocSemiring α]
@[simp]
-theorem empty_mul [Fintype n'] (A : Matrix (Fin 0) n' α) (B : Matrix n' o' α) : A ⬝ B = of ![] :=
+theorem empty_mul [Fintype n'] (A : Matrix (Fin 0) n' α) (B : Matrix n' o' α) : A * B = of ![] :=
empty_eq _
#align matrix.empty_mul Matrix.empty_mul
@[simp]
-theorem empty_mul_empty (A : Matrix m' (Fin 0) α) (B : Matrix (Fin 0) o' α) : A ⬝ B = 0 :=
+theorem empty_mul_empty (A : Matrix m' (Fin 0) α) (B : Matrix (Fin 0) o' α) : A * B = 0 :=
rfl
#align matrix.empty_mul_empty Matrix.empty_mul_empty
@[simp]
theorem mul_empty [Fintype n'] (A : Matrix m' n' α) (B : Matrix n' (Fin 0) α) :
- A ⬝ B = of fun _ => ![] :=
+ A * B = of fun _ => ![] :=
funext fun _ => empty_eq _
#align matrix.mul_empty Matrix.mul_empty
theorem mul_val_succ [Fintype n'] (A : Matrix (Fin m.succ) n' α) (B : Matrix n' o' α) (i : Fin m)
- (j : o') : (A ⬝ B) i.succ j = (of (vecTail (of.symm A)) ⬝ B) i j :=
+ (j : o') : (A * B) i.succ j = (of (vecTail (of.symm A)) * B) i j :=
rfl
#align matrix.mul_val_succ Matrix.mul_val_succ
@[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
+ of (vecCons v A) * B = of (vecCons (vecMul v B) (of.symm (of A * B))) := by
ext i j
refine' Fin.cases _ _ i
· rfl
@@ -432,25 +432,26 @@ theorem eta_fin_three (A : Matrix (Fin 3) (Fin 3) α) :
theorem mul_fin_two [AddCommMonoid α] [Mul α] (a₁₁ a₁₂ a₂₁ a₂₂ b₁₁ b₁₂ b₂₁ b₂₂ : α) :
!![a₁₁, a₁₂;
- a₂₁, a₂₂] ⬝ !![b₁₁, b₁₂;
+ a₂₁, a₂₂] * !![b₁₁, b₁₂;
b₂₁, b₂₂] = !![a₁₁ * b₁₁ + a₁₂ * b₂₁, a₁₁ * b₁₂ + a₁₂ * b₂₂;
a₂₁ * b₁₁ + a₂₂ * b₂₁, a₂₁ * b₁₂ + a₂₂ * b₂₂] := by
ext i j
- fin_cases i <;> fin_cases j <;> simp [Matrix.mul, dotProduct, Fin.sum_univ_succ]
+ fin_cases i <;> fin_cases j <;> simp [Matrix.mul_apply, dotProduct, Fin.sum_univ_succ]
#align matrix.mul_fin_two Matrix.mul_fin_two
theorem mul_fin_three [AddCommMonoid α] [Mul α]
(a₁₁ a₁₂ a₁₃ a₂₁ a₂₂ a₂₃ a₃₁ a₃₂ a₃₃ b₁₁ b₁₂ b₁₃ b₂₁ b₂₂ b₂₃ b₃₁ b₃₂ b₃₃ : α) :
!![a₁₁, a₁₂, a₁₃;
a₂₁, a₂₂, a₂₃;
- a₃₁, a₃₂, a₃₃] ⬝ !![b₁₁, b₁₂, b₁₃;
+ a₃₁, a₃₂, a₃₃] * !![b₁₁, b₁₂, b₁₃;
b₂₁, b₂₂, b₂₃;
b₃₁, b₃₂, b₃₃] =
!![a₁₁*b₁₁ + a₁₂*b₂₁ + a₁₃*b₃₁, a₁₁*b₁₂ + a₁₂*b₂₂ + a₁₃*b₃₂, a₁₁*b₁₃ + a₁₂*b₂₃ + a₁₃*b₃₃;
a₂₁*b₁₁ + a₂₂*b₂₁ + a₂₃*b₃₁, a₂₁*b₁₂ + a₂₂*b₂₂ + a₂₃*b₃₂, a₂₁*b₁₃ + a₂₂*b₂₃ + a₂₃*b₃₃;
a₃₁*b₁₁ + a₃₂*b₂₁ + a₃₃*b₃₁, a₃₁*b₁₂ + a₃₂*b₂₂ + a₃₃*b₃₂, a₃₁*b₁₃ + a₃₂*b₂₃ + a₃₃*b₃₃] := by
ext i j
- fin_cases i <;> fin_cases j <;> simp [Matrix.mul, dotProduct, Fin.sum_univ_succ, ← add_assoc]
+ fin_cases i <;> fin_cases j
+ <;> simp [Matrix.mul_apply, dotProduct, Fin.sum_univ_succ, ← add_assoc]
#align matrix.mul_fin_three Matrix.mul_fin_three
theorem vec2_eq {a₀ a₁ b₀ b₁ : α} (h₀ : a₀ = b₀) (h₁ : a₁ = b₁) : ![a₀, a₁] = ![b₀, b₁] := by
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -355,7 +355,7 @@ section Smul
variable [NonUnitalNonAssocSemiring α]
-- @[simp] -- Porting note: simp can prove this
-theorem smul_mat_empty {m' : Type _} (x : α) (A : Fin 0 → m' → α) : x • A = ![] :=
+theorem smul_mat_empty {m' : Type*} (x : α) (A : Fin 0 → m' → α) : x • A = ![] :=
empty_eq _
#align matrix.smul_mat_empty Matrix.smul_mat_empty
@@ -473,11 +473,11 @@ theorem vec3_add [Add α] (a₀ a₁ a₂ b₀ b₁ b₂ : α) :
rw [cons_add_cons, cons_add_cons, cons_add_cons, empty_add_empty]
#align matrix.vec3_add Matrix.vec3_add
-theorem smul_vec2 {R : Type _} [SMul R α] (x : R) (a₀ a₁ : α) :
+theorem smul_vec2 {R : Type*} [SMul R α] (x : R) (a₀ a₁ : α) :
x • ![a₀, a₁] = ![x • a₀, x • a₁] := by rw [smul_cons, smul_cons, smul_empty]
#align matrix.smul_vec2 Matrix.smul_vec2
-theorem smul_vec3 {R : Type _} [SMul R α] (x : R) (a₀ a₁ a₂ : α) :
+theorem smul_vec3 {R : Type*} [SMul R α] (x : R) (a₀ a₁ a₂ : α) :
x • ![a₀, a₁, a₂] = ![x • a₀, x • a₁, x • a₂] := by
rw [smul_cons, smul_cons, smul_cons, smul_empty]
#align matrix.smul_vec3 Matrix.smul_vec3
@@ -2,17 +2,14 @@
Copyright (c) 2020 Anne Baanen. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Eric Wieser
-
-! This file was ported from Lean 3 source module data.matrix.notation
-! leanprover-community/mathlib commit a99f85220eaf38f14f94e04699943e185a5e1d1a
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Data.Matrix.Basic
import Mathlib.Data.Fin.VecNotation
import Mathlib.Tactic.FinCases
import Mathlib.Algebra.BigOperators.Fin
+#align_import data.matrix.notation from "leanprover-community/mathlib"@"a99f85220eaf38f14f94e04699943e185a5e1d1a"
+
/-!
# Matrix and vector notation
Semiring
to NonUnitalNonAssocSemiring
(#5092)
This came up in a real example. I was using Lean to make sure I had the right formulae for Strassen's algorithm. The following example was only able to succeed with (some of) these changes:
import Mathlib.Data.Matrix.Notation
import Mathlib.Tactic.NoncommRing
example (R : Type _) [NonUnitalNonAssocRing R]
(a₁₁ a₁₂ a₂₁ a₂₂ b₁₁ b₁₂ b₂₁ b₂₂ : R) :
let m₁ := (a₁₁ + a₂₂) * (b₁₁ + b₂₂)
let m₂ := (a₂₁ + a₂₂) * b₁₁
let m₃ := a₁₁ * (b₁₂ - b₂₂)
let m₄ := a₂₂ * (b₂₁ - b₁₁)
let m₅ := (a₁₁ + a₁₂) * b₂₂
let m₆ := (a₂₁ - a₁₁) * (b₁₁ + b₁₂)
let m₇ := (a₁₂ - a₂₂) * (b₂₁ + b₂₂)
!![a₁₁, a₁₂;
a₂₁, a₂₂] * !![b₁₁, b₁₂;
b₂₁, b₂₂] = !![m₁ + m₄ - m₅ + m₇, m₃ + m₅;
m₂ + m₄, m₁ - m₂ + m₃ + m₆] := by
ext i j
fin_cases i <;> fin_cases j <;> simp <;> noncomm_ring
@@ -224,7 +224,7 @@ end Transpose
section Mul
-variable [Semiring α]
+variable [NonUnitalNonAssocSemiring α]
@[simp]
theorem empty_mul [Fintype n'] (A : Matrix (Fin 0) n' α) (B : Matrix n' o' α) : A ⬝ B = of ![] :=
@@ -260,7 +260,7 @@ end Mul
section VecMul
-variable [Semiring α]
+variable [NonUnitalNonAssocSemiring α]
@[simp]
theorem empty_vecMul (v : Fin 0 → α) (B : Matrix (Fin 0) o' α) : vecMul v B = 0 :=
@@ -295,7 +295,7 @@ end VecMul
section MulVec
-variable [Semiring α]
+variable [NonUnitalNonAssocSemiring α]
@[simp]
theorem empty_mulVec [Fintype n'] (A : Matrix (Fin 0) n' α) (v : n' → α) : mulVec A v = ![] :=
@@ -325,7 +325,7 @@ end MulVec
section VecMulVec
-variable [Semiring α]
+variable [NonUnitalNonAssocSemiring α]
@[simp]
theorem empty_vecMulVec (v : Fin 0 → α) (w : n' → α) : vecMulVec v w = ![] :=
@@ -355,7 +355,7 @@ end VecMulVec
section Smul
-variable [Semiring α]
+variable [NonUnitalNonAssocSemiring α]
-- @[simp] -- Porting note: simp can prove this
theorem smul_mat_empty {m' : Type _} (x : α) (A : Fin 0 → m' → α) : x • A = ![] :=
ext
(#5258)
Co-authored-by: Xavier Roblot <46200072+xroblot@users.noreply.github.com> Co-authored-by: Joël Riou <joel.riou@universite-paris-saclay.fr> Co-authored-by: Riccardo Brasca <riccardo.brasca@gmail.com> Co-authored-by: Yury G. Kudryashov <urkud@urkud.name> Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com> Co-authored-by: Pol'tta / Miyahara Kō <pol_tta@outlook.jp> Co-authored-by: Jason Yuen <jason_yuen2007@hotmail.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com> Co-authored-by: Jireh Loreaux <loreaujy@gmail.com> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: Heather Macbeth <25316162+hrmacbeth@users.noreply.github.com> Co-authored-by: Jujian Zhang <jujian.zhang1998@outlook.com> Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
@@ -171,7 +171,7 @@ theorem col_empty (v : Fin 0 → α) : col v = vecEmpty :=
@[simp]
theorem col_cons (x : α) (u : Fin m → α) : col (vecCons x u) = vecCons (fun _ => x) (col u) := by
- ext (i j)
+ ext i j
refine' Fin.cases _ _ i <;> simp [vecHead, vecTail]
#align matrix.col_cons Matrix.col_cons
@@ -204,7 +204,7 @@ theorem transpose_empty_cols (A : Matrix (Fin 0) m' α) : Aᵀ = of fun _ => ![]
@[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)
+ ext i j
refine' Fin.cases _ _ j <;> simp
#align matrix.cons_transpose Matrix.cons_transpose
@@ -216,7 +216,7 @@ theorem head_transpose (A : Matrix m' (Fin n.succ) α) :
@[simp]
theorem tail_transpose (A : Matrix m' (Fin n.succ) α) : vecTail (of.symm Aᵀ) = (vecTail ∘ A)ᵀ := by
- ext (i j)
+ ext i j
rfl
#align matrix.tail_transpose Matrix.tail_transpose
@@ -250,7 +250,7 @@ theorem mul_val_succ [Fintype n'] (A : Matrix (Fin m.succ) n' α) (B : Matrix n'
@[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)
+ ext i j
refine' Fin.cases _ _ i
· rfl
simp [mul_val_succ]
@@ -347,7 +347,7 @@ theorem cons_vecMulVec (x : α) (v : Fin m → α) (w : n' → α) :
@[simp]
theorem vecMulVec_cons (v : m' → α) (x : α) (w : Fin n → α) :
vecMulVec v (vecCons x w) = fun i => v i • vecCons x w := by
- ext (i j)
+ ext i j
rw [vecMulVec_apply, Pi.smul_apply, smul_eq_mul]
#align matrix.vec_mul_vec_cons Matrix.vecMulVec_cons
@@ -382,7 +382,7 @@ theorem submatrix_empty (A : Matrix m' n' α) (row : Fin 0 → m') (col : o' →
@[simp]
theorem submatrix_cons_row (A : Matrix m' n' α) (i : m') (row : Fin m → m') (col : o' → n') :
submatrix A (vecCons i row) col = vecCons (fun j => A i (col j)) (submatrix A row col) := by
- ext (i j)
+ ext i j
refine' Fin.cases _ _ i <;> simp [submatrix]
#align matrix.submatrix_cons_row Matrix.submatrix_cons_row
@@ -409,19 +409,19 @@ section One
variable [Zero α] [One α]
theorem one_fin_two : (1 : Matrix (Fin 2) (Fin 2) α) = !![1, 0; 0, 1] := by
- ext (i j)
+ ext i j
fin_cases i <;> fin_cases j <;> rfl
#align matrix.one_fin_two Matrix.one_fin_two
theorem one_fin_three : (1 : Matrix (Fin 3) (Fin 3) α) = !![1, 0, 0; 0, 1, 0; 0, 0, 1] := by
- ext (i j)
+ ext i j
fin_cases i <;> fin_cases j <;> rfl
#align matrix.one_fin_three Matrix.one_fin_three
end One
theorem eta_fin_two (A : Matrix (Fin 2) (Fin 2) α) : A = !![A 0 0, A 0 1; A 1 0, A 1 1] := by
- ext (i j)
+ ext i j
fin_cases i <;> fin_cases j <;> rfl
#align matrix.eta_fin_two Matrix.eta_fin_two
@@ -429,7 +429,7 @@ theorem eta_fin_three (A : Matrix (Fin 3) (Fin 3) α) :
A = !![A 0 0, A 0 1, A 0 2;
A 1 0, A 1 1, A 1 2;
A 2 0, A 2 1, A 2 2] := by
- ext (i j)
+ ext i j
fin_cases i <;> fin_cases j <;> rfl
#align matrix.eta_fin_three Matrix.eta_fin_three
@@ -438,7 +438,7 @@ theorem mul_fin_two [AddCommMonoid α] [Mul α] (a₁₁ a₁₂ a₂₁ a₂₂
a₂₁, a₂₂] ⬝ !![b₁₁, b₁₂;
b₂₁, b₂₂] = !![a₁₁ * b₁₁ + a₁₂ * b₂₁, a₁₁ * b₁₂ + a₁₂ * b₂₂;
a₂₁ * b₁₁ + a₂₂ * b₂₁, a₂₁ * b₁₂ + a₂₂ * b₂₂] := by
- ext (i j)
+ ext i j
fin_cases i <;> fin_cases j <;> simp [Matrix.mul, dotProduct, Fin.sum_univ_succ]
#align matrix.mul_fin_two Matrix.mul_fin_two
@@ -452,7 +452,7 @@ theorem mul_fin_three [AddCommMonoid α] [Mul α]
!![a₁₁*b₁₁ + a₁₂*b₂₁ + a₁₃*b₃₁, a₁₁*b₁₂ + a₁₂*b₂₂ + a₁₃*b₃₂, a₁₁*b₁₃ + a₁₂*b₂₃ + a₁₃*b₃₃;
a₂₁*b₁₁ + a₂₂*b₂₁ + a₂₃*b₃₁, a₂₁*b₁₂ + a₂₂*b₂₂ + a₂₃*b₃₂, a₂₁*b₁₃ + a₂₂*b₂₃ + a₂₃*b₃₃;
a₃₁*b₁₁ + a₃₂*b₂₁ + a₃₃*b₃₁, a₃₁*b₁₂ + a₃₂*b₂₂ + a₃₃*b₃₂, a₃₁*b₁₃ + a₃₂*b₂₃ + a₃₃*b₃₃] := by
- ext (i j)
+ ext i j
fin_cases i <;> fin_cases j <;> simp [Matrix.mul, dotProduct, Fin.sum_univ_succ, ← add_assoc]
#align matrix.mul_fin_three Matrix.mul_fin_three
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Anne Baanen, Eric Wieser
! This file was ported from Lean 3 source module data.matrix.notation
-! leanprover-community/mathlib commit 3e068ece210655b7b9a9477c3aff38a492400aa1
+! leanprover-community/mathlib commit a99f85220eaf38f14f94e04699943e185a5e1d1a
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -386,6 +386,20 @@ theorem submatrix_cons_row (A : Matrix m' n' α) (i : m') (row : Fin m → m') (
refine' Fin.cases _ _ i <;> simp [submatrix]
#align matrix.submatrix_cons_row Matrix.submatrix_cons_row
+/-- Updating a row then removing it is the same as removing it. -/
+@[simp]
+theorem submatrix_updateRow_succAbove (A : Matrix (Fin m.succ) n' α) (v : n' → α) (f : o' → n')
+ (i : Fin m.succ) : (A.updateRow i v).submatrix i.succAbove f = A.submatrix i.succAbove f :=
+ ext fun r s => (congr_fun (updateRow_ne (Fin.succAbove_ne i r) : _ = A _) (f s) : _)
+#align matrix.submatrix_update_row_succ_above Matrix.submatrix_updateRow_succAbove
+
+/-- Updating a column then removing it is the same as removing it. -/
+@[simp]
+theorem submatrix_updateColumn_succAbove (A : Matrix m' (Fin n.succ) α) (v : m' → α) (f : o' → m')
+ (i : Fin n.succ) : (A.updateColumn i v).submatrix f i.succAbove = A.submatrix f i.succAbove :=
+ ext fun _r s => updateColumn_ne (Fin.succAbove_ne i s)
+#align matrix.submatrix_update_column_succ_above Matrix.submatrix_updateColumn_succAbove
+
end Submatrix
section Vec2AndVec3
@@ -75,7 +75,8 @@ end toExpr
section Parser
open Lean Elab Term Macro TSyntax
-syntax (name := matrixNotation) "!![" sepBy1(term,+,?, ";", "; ", allowTrailingSep) "]" : term
+syntax (name := matrixNotation)
+ "!![" ppRealGroup(sepBy1(ppGroup(term,+,?), ";", "; ", allowTrailingSep)) "]" : term
syntax (name := matrixNotationRx0) "!![" ";"* "]" : term
syntax (name := matrixNotation0xC) "!![" ","+ "]" : term
@@ -472,24 +472,24 @@ theorem smul_vec3 {R : Type _} [SMul R α] (x : R) (a₀ a₁ a₂ : α) :
variable [AddCommMonoid α] [Mul α]
-theorem vec2_dot_product' {a₀ a₁ b₀ b₁ : α} : ![a₀, a₁] ⬝ᵥ ![b₀, b₁] = a₀ * b₀ + a₁ * b₁ := by
+theorem vec2_dotProduct' {a₀ a₁ b₀ b₁ : α} : ![a₀, a₁] ⬝ᵥ ![b₀, b₁] = a₀ * b₀ + a₁ * b₁ := by
rw [cons_dotProduct_cons, cons_dotProduct_cons, dotProduct_empty, add_zero]
-#align matrix.vec2_dot_product' Matrix.vec2_dot_product'
+#align matrix.vec2_dot_product' Matrix.vec2_dotProduct'
@[simp]
theorem vec2_dotProduct (v w : Fin 2 → α) : v ⬝ᵥ w = v 0 * w 0 + v 1 * w 1 :=
- vec2_dot_product'
+ vec2_dotProduct'
#align matrix.vec2_dot_product Matrix.vec2_dotProduct
-theorem vec3_dot_product' {a₀ a₁ a₂ b₀ b₁ b₂ : α} :
+theorem vec3_dotProduct' {a₀ a₁ a₂ b₀ b₁ b₂ : α} :
![a₀, a₁, a₂] ⬝ᵥ ![b₀, b₁, b₂] = a₀ * b₀ + a₁ * b₁ + a₂ * b₂ := by
rw [cons_dotProduct_cons, cons_dotProduct_cons, cons_dotProduct_cons, dotProduct_empty,
add_zero, add_assoc]
-#align matrix.vec3_dot_product' Matrix.vec3_dot_product'
+#align matrix.vec3_dot_product' Matrix.vec3_dotProduct'
@[simp]
theorem vec3_dotProduct (v w : Fin 3 → α) : v ⬝ᵥ w = v 0 * w 0 + v 1 * w 1 + v 2 * w 2 :=
- vec3_dot_product'
+ vec3_dotProduct'
#align matrix.vec3_dot_product Matrix.vec3_dotProduct
end Vec2AndVec3
This makes a mathlib4 version of mathlib3's tactic.basic
, now called Mathlib.Tactic.Common
, which imports all tactics which do not have significant theory requirements, and then is imported all across the base of the hierarchy.
This ensures that all common tactics are available nearly everywhere in the library, rather than having to be imported one-by-one as you need them.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -11,9 +11,7 @@ Authors: Anne Baanen, Eric Wieser
import Mathlib.Data.Matrix.Basic
import Mathlib.Data.Fin.VecNotation
import Mathlib.Tactic.FinCases
-import Mathlib.Tactic.ToExpr
import Mathlib.Algebra.BigOperators.Fin
-import Qq
/-!
# Matrix and vector notation
The unported dependencies are