The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V07. Linear algebra

Mathlib.LinearAlgebra.Matrix.Notation

72 declarations. Mathlib docs · Source

Matrix and vector notation

This file includes simp lemmas for applying operations in Data.Matrix.Basic to values built out of the matrix notation ![a, b] = vecCons a (vecCons b vecEmpty) defined in Data.Fin.VecNotation.

This also provides the new notation !![a, b; c, d] = Matrix.of ![![a, b], ![c, d]]. This notation also works for empty matrices; !![,,,] : Matrix (Fin 0) (Fin 3) and !![;;;] : Matrix (Fin 3) (Fin 0).

Implementation notes

The simp lemmas require that one of the arguments is of the form vecCons _ _. This ensures simp works with entries only when (some) entries are already given. In other words, this notation will only appear in the output of simp if it already appears in the input.

Notation

This file provide notation !![a, b; c, d] for matrices, which corresponds to Matrix.of ![![a, b], ![c, d]].

Examples

Examples of usage can be found in the MathlibTest/matrix.lean file.

def Matrix.mkLiteralQ E1 #

{u : Lean.Level} → {α : Q(Type u)} → {m n : ℕ} → Matrix (Fin m) (Fin n) Q(«$α») → Q(Matrix (Fin «$m») (Fin «$n») «$α»)

Matrix.mkLiteralQ !![a, b; c, d] produces the term q(!![$a, $b; $c, $d]).

instance Matrix.toExpr E0 #

{α : Type u} →
  {m' : Type uₘ} →
    {n' : Type uₙ} →
      [Lean.ToLevel] →
        [Lean.ToLevel] →
          [Lean.ToLevel] →
            [Lean.ToExpr α] →
              [Lean.ToExpr m'] → [Lean.ToExpr n'] → [Lean.ToExpr (m' → n' → α)] → Lean.ToExpr (Matrix m' n' α)

Matrices can be reflected whenever their entries can. We insert a Matrix.of to prevent immediate decay to a function.

def Matrix.matrixNotation E1 #

Lean.ParserDescr

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]].

def Matrix.matrixNotationRx0 E1 #

Lean.ParserDescr

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]].

def Matrix.matrixNotation0xC E1 #

Lean.ParserDescr

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]].

def Matrix.delabMatrixNotation E1 #

Lean.PrettyPrinter.Delaborator.Delab

Delaborator for the !![] notation.

instance Matrix.repr E0 #

{α : Type u} → {n m : ℕ} → [Repr α] → Repr (Matrix (Fin m) (Fin n) α)

Use ![...] notation for displaying a Fin-indexed matrix, for example:

#eval !![1, 2; 3, 4] + !![3, 4; 5, 6]  -- !![4, 6; 8, 10]

theorem Matrix.cons_val' E0 #

∀ {α : Type u} {m : ℕ} {n' : Type uₙ} (v : n' → α) (B : Fin m → n' → α) (i : Fin m.succ) (j : n'),
  Matrix.vecCons v B i j = Matrix.vecCons (v j) (fun i ↦ B i j) i

theorem Matrix.head_val' E0 #

∀ {α : Type u} {m : ℕ} {n' : Type uₙ} (B : Fin m.succ → n' → α) (j : n'),
  (Matrix.vecHead fun i ↦ B i j) = Matrix.vecHead B j

theorem Matrix.tail_val' E0 #

∀ {α : Type u} {m : ℕ} {n' : Type uₙ} (B : Fin m.succ → n' → α) (j : n'),
  (Matrix.vecTail fun i ↦ B i j) = fun i ↦ Matrix.vecTail B i j

theorem Matrix.dotProduct_of_isEmpty E0 #

∀ {α : Type u} {n' : Type uₙ} [inst : AddCommMonoid α] [inst_1 : Mul α] [inst_2 : Fintype n'] [IsEmpty n']
  (v w : n' → α), v ⬝ᵥ w = 0

theorem Matrix.cons_dotProduct E0 #

∀ {α : Type u} {n : ℕ} [inst : AddCommMonoid α] [inst_1 : Mul α] (x : α) (v : Fin n → α) (w : Fin n.succ → α),
  Matrix.vecCons x v ⬝ᵥ w = x * Matrix.vecHead w + v ⬝ᵥ Matrix.vecTail w

theorem Matrix.dotProduct_cons E0 #

∀ {α : Type u} {n : ℕ} [inst : AddCommMonoid α] [inst_1 : Mul α] (v : Fin n.succ → α) (x : α) (w : Fin n → α),
  v ⬝ᵥ Matrix.vecCons x w = Matrix.vecHead v * x + Matrix.vecTail v ⬝ᵥ w

theorem Matrix.cons_dotProduct_cons E1 #

∀ {α : Type u} {n : ℕ} [inst : AddCommMonoid α] [inst_1 : Mul α] (x : α) (v : Fin n → α) (y : α) (w : Fin n → α),
  Matrix.vecCons x v ⬝ᵥ Matrix.vecCons y w = x * y + v ⬝ᵥ w

theorem Matrix.diagonal_fin_one E1 #

∀ {α : Type u} [inst : Zero α] (d : Fin 1 → α), Matrix.diagonal d = !![d 0]

theorem Matrix.diagonal_vec1 E1 #

∀ {α : Type u} [inst : Zero α] (a : α), Matrix.diagonal ![a] = !![a]

theorem Matrix.diagonal_fin_two E1 #

∀ {α : Type u} [inst : Zero α] (d : Fin 2 → α), Matrix.diagonal d = !![d 0, 0; 0, d 1]

theorem Matrix.diagonal_vec2 E1 #

∀ {α : Type u} [inst : Zero α] (a b : α), Matrix.diagonal ![a, b] = !![a, 0; 0, b]

theorem Matrix.diagonal_fin_three E1 #

∀ {α : Type u} [inst : Zero α] (d : Fin 3 → α), Matrix.diagonal d = !![d 0, 0, 0; 0, d 1, 0; 0, 0, d 2]

theorem Matrix.diagonal_vec3 E1 #

∀ {α : Type u} [inst : Zero α] (a b c : α), Matrix.diagonal ![a, b, c] = !![a, 0, 0; 0, b, 0; 0, 0, c]

theorem Matrix.replicateCol_empty E0 #

∀ {α : Type u} {ι : Type u_1} (v : Fin 0 → α), Matrix.replicateCol ι v = Matrix.of ![]

theorem Matrix.replicateCol_cons E0 #

∀ {α : Type u} {m : ℕ} {ι : Type u_1} (x : α) (u : Fin m → α),
  Matrix.replicateCol ι (Matrix.vecCons x u) = Matrix.of (Matrix.vecCons (fun x_1 ↦ x) (Matrix.replicateCol ι u))

theorem Matrix.replicateRow_empty E0 #

∀ {α : Type u} {ι : Type u_1}, Matrix.replicateRow ι ![] = Matrix.of fun x ↦ ![]

theorem Matrix.replicateRow_cons E0 #

∀ {α : Type u} {m : ℕ} {ι : Type u_1} (x : α) (u : Fin m → α),
  Matrix.replicateRow ι (Matrix.vecCons x u) = Matrix.of fun x_1 ↦ Matrix.vecCons x u

theorem Matrix.transpose_empty_rows E0 #

∀ {α : Type u} {m' : Type uₘ} (A : Matrix m' (Fin 0) α), A.transpose = Matrix.of ![]

theorem Matrix.transpose_empty_cols E0 #

∀ {α : Type u} {m' : Type uₘ} (A : Matrix (Fin 0) m' α), A.transpose = Matrix.of fun x ↦ ![]

theorem Matrix.cons_transpose E1 #

∀ {α : Type u} {m : ℕ} {n' : Type uₙ} (v : n' → α) (A : Matrix (Fin m) n' α),
  (Matrix.of (Matrix.vecCons v A)).transpose = Matrix.of fun i ↦ Matrix.vecCons (v i) (A.transpose i)

theorem Matrix.head_transpose E1 #

∀ {α : Type u} {n : ℕ} {m' : Type uₘ} (A : Matrix m' (Fin n.succ) α),
  Matrix.vecHead (Matrix.of.symm A.transpose) = Matrix.vecHead ∘ Matrix.of.symm A

theorem Matrix.tail_transpose E1 #

∀ {α : Type u} {n : ℕ} {m' : Type uₘ} (A : Matrix m' (Fin n.succ) α),
  Matrix.vecTail (Matrix.of.symm A.transpose) = Matrix.transpose (Matrix.vecTail ∘ A)

theorem Matrix.empty_mul E0 #

∀ {α : Type u} {n' : Type uₙ} {o' : Type uₒ} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n']
  (A : Matrix (Fin 0) n' α) (B : Matrix n' o' α), A * B = Matrix.of ![]

theorem Matrix.empty_mul_empty E0 #

∀ {α : Type u} {m' : Type uₘ} {o' : Type uₒ} [inst : NonUnitalNonAssocSemiring α] (A : Matrix m' (Fin 0) α)
  (B : Matrix (Fin 0) o' α), A * B = 0

theorem Matrix.mul_empty E0 #

∀ {α : Type u} {m' : Type uₘ} {n' : Type uₙ} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n']
  (A : Matrix m' n' α) (B : Matrix n' (Fin 0) α), A * B = Matrix.of fun x ↦ ![]

theorem Matrix.mul_val_succ E1 #

∀ {α : Type u} {m : ℕ} {n' : Type uₙ} {o' : Type uₒ} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n']
  (A : Matrix (Fin m.succ) n' α) (B : Matrix n' o' α) (i : Fin m) (j : o'),
  (A * B) i.succ j = (Matrix.of (Matrix.vecTail (Matrix.of.symm A)) * B) i j

theorem Matrix.cons_mul E0 #

∀ {α : Type u} {m : ℕ} {n' : Type uₙ} {o' : Type uₒ} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n']
  (v : n' → α) (A : Fin m → n' → α) (B : Matrix n' o' α),
  Matrix.of (Matrix.vecCons v A) * B = Matrix.of (Matrix.vecCons (Matrix.vecMul v B) (Matrix.of.symm (Matrix.of A * B)))

theorem Matrix.empty_vecMul E0 #

∀ {α : Type u} {o' : Type uₒ} [inst : NonUnitalNonAssocSemiring α] (v : Fin 0 → α) (B : Matrix (Fin 0) o' α),
  Matrix.vecMul v B = 0

theorem Matrix.vecMul_empty E0 #

∀ {α : Type u} {n' : Type uₙ} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n'] (v : n' → α)
  (B : Matrix n' (Fin 0) α), Matrix.vecMul v B = ![]

theorem Matrix.cons_vecMul E0 #

∀ {α : Type u} {n : ℕ} {o' : Type uₒ} [inst : NonUnitalNonAssocSemiring α] (x : α) (v : Fin n → α)
  (B : Fin n.succ → o' → α),
  Matrix.vecMul (Matrix.vecCons x v) (Matrix.of B) =
    x • Matrix.vecHead B + Matrix.vecMul v (Matrix.of (Matrix.vecTail B))

theorem Matrix.vecMul_cons E0 #

∀ {α : Type u} {n : ℕ} {o' : Type uₒ} [inst : NonUnitalNonAssocSemiring α] (v : Fin n.succ → α) (w : o' → α)
  (B : Fin n → o' → α),
  Matrix.vecMul v (Matrix.of (Matrix.vecCons w B)) =
    Matrix.vecHead v • w + Matrix.vecMul (Matrix.vecTail v) (Matrix.of B)

theorem Matrix.cons_vecMul_cons E1 #

∀ {α : Type u} {n : ℕ} {o' : Type uₒ} [inst : NonUnitalNonAssocSemiring α] (x : α) (v : Fin n → α) (w : o' → α)
  (B : Fin n → o' → α),
  Matrix.vecMul (Matrix.vecCons x v) (Matrix.of (Matrix.vecCons w B)) = x • w + Matrix.vecMul v (Matrix.of B)

theorem Matrix.empty_mulVec E0 #

∀ {α : Type u} {n' : Type uₙ} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n'] (A : Matrix (Fin 0) n' α)
  (v : n' → α), A.mulVec v = ![]

theorem Matrix.mulVec_empty E0 #

∀ {α : Type u} {m' : Type uₘ} [inst : NonUnitalNonAssocSemiring α] (A : Matrix m' (Fin 0) α) (v : Fin 0 → α),
  A.mulVec v = 0

theorem Matrix.cons_mulVec E0 #

∀ {α : Type u} {m : ℕ} {n' : Type uₙ} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n'] (v : n' → α)
  (A : Fin m → n' → α) (w : n' → α),
  (Matrix.of (Matrix.vecCons v A)).mulVec w = Matrix.vecCons (v ⬝ᵥ w) ((Matrix.of A).mulVec w)

theorem Matrix.mulVec_cons E0 #

∀ {n : ℕ} {m' : Type uₘ} {α : Type u_1} [inst : NonUnitalCommSemiring α] (A : m' → Fin n.succ → α) (x : α)
  (v : Fin n → α),
  (Matrix.of A).mulVec (Matrix.vecCons x v) = x • Matrix.vecHead ∘ A + (Matrix.of (Matrix.vecTail ∘ A)).mulVec v

theorem Matrix.empty_vecMulVec E0 #

∀ {α : Type u} {n' : Type uₙ} [inst : NonUnitalNonAssocSemiring α] (v : Fin 0 → α) (w : n' → α),
  Matrix.vecMulVec v w = Matrix.of ![]

theorem Matrix.vecMulVec_empty E0 #

∀ {α : Type u} {m' : Type uₘ} [inst : NonUnitalNonAssocSemiring α] (v : m' → α) (w : Fin 0 → α),
  Matrix.vecMulVec v w = Matrix.of fun x ↦ ![]

theorem Matrix.cons_vecMulVec E0 #

∀ {α : Type u} {m : ℕ} {n' : Type uₙ} [inst : NonUnitalNonAssocSemiring α] (x : α) (v : Fin m → α) (w : n' → α),
  Matrix.vecMulVec (Matrix.vecCons x v) w = Matrix.vecCons (x • w) (Matrix.vecMulVec v w)

theorem Matrix.vecMulVec_cons E0 #

∀ {α : Type u} {n : ℕ} {m' : Type uₘ} [inst : NonUnitalNonAssocSemiring α] (v : m' → α) (x : α) (w : Fin n → α),
  Matrix.vecMulVec v (Matrix.vecCons x w) = Matrix.of fun i ↦ v i • Matrix.vecCons x w

theorem Matrix.smul_mat_empty E1 #

∀ {α : Type u} [inst : NonUnitalNonAssocSemiring α] {m' : Type u_1} (x : α) (A : Fin 0 → m' → α), x • A = ![]

theorem Matrix.submatrix_empty E0 #

∀ {α : Type u} {m' : Type uₘ} {n' : Type uₙ} {o' : Type uₒ} (A : Matrix m' n' α) (row : Fin 0 → m') (col : o' → n'),
  A.submatrix row col = Matrix.of ![]

theorem Matrix.submatrix_cons_row E0 #

∀ {α : Type u} {m : ℕ} {m' : Type uₘ} {n' : Type uₙ} {o' : Type uₒ} (A : Matrix m' n' α) (i : m') (row : Fin m → m')
  (col : o' → n'), A.submatrix (Matrix.vecCons i row) col = Matrix.vecCons (fun j ↦ A i (col j)) (A.submatrix row col)

theorem Matrix.submatrix_updateRow_succAbove E0 #

∀ {α : Type u} {m : ℕ} {n' : Type uₙ} {o' : Type uₒ} (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

Updating a row then removing it is the same as removing it.

theorem Matrix.submatrix_updateCol_succAbove E0 #

∀ {α : Type u} {n : ℕ} {m' : Type uₘ} {o' : Type uₒ} (A : Matrix m' (Fin n.succ) α) (v : m' → α) (f : o' → m')
  (i : Fin n.succ), (A.updateCol i v).submatrix f i.succAbove = A.submatrix f i.succAbove

Updating a column then removing it is the same as removing it.

theorem Matrix.one_fin_two E1 #

∀ {α : Type u} [inst : Zero α] [inst_1 : One α], 1 = !![1, 0; 0, 1]

theorem Matrix.one_fin_three E1 #

∀ {α : Type u} [inst : Zero α] [inst_1 : One α], 1 = !![1, 0, 0; 0, 1, 0; 0, 0, 1]

theorem Matrix.natCast_fin_two E1 #

∀ {α : Type u} [inst : AddMonoidWithOne α] (n : ℕ), ↑n = !![↑n, 0; 0, ↑n]

theorem Matrix.natCast_fin_three E1 #

∀ {α : Type u} [inst : AddMonoidWithOne α] (n : ℕ), ↑n = !![↑n, 0, 0; 0, ↑n, 0; 0, 0, ↑n]

theorem Matrix.ofNat_fin_two E1 #

∀ {α : Type u} [inst : AddMonoidWithOne α] (n : ℕ) [inst_1 : n.AtLeastTwo],
  OfNat.ofNat n = !![OfNat.ofNat n, 0; 0, OfNat.ofNat n]

theorem Matrix.ofNat_fin_three E1 #

∀ {α : Type u} [inst : AddMonoidWithOne α] (n : ℕ) [inst_1 : n.AtLeastTwo],
  OfNat.ofNat n = !![OfNat.ofNat n, 0, 0; 0, OfNat.ofNat n, 0; 0, 0, OfNat.ofNat n]

theorem Matrix.eta_fin_two E1 #

∀ {α : Type u} (A : Matrix (Fin 2) (Fin 2) α), A = !![A 0 0, A 0 1; A 1 0, A 1 1]

theorem Matrix.eta_fin_three E1 #

∀ {α : Type u} (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]

theorem Matrix.mul_fin_two E1 #

∀ {α : Type u} [inst : AddCommMonoid α] [inst_1 : 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₂₂]

theorem Matrix.mul_fin_three E1 #

∀ {α : Type u} [inst : AddCommMonoid α] [inst_1 : 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₁₃; 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₃₃]

theorem Matrix.vec2_eq E0 #

∀ {α : Type u} {a₀ a₁ b₀ b₁ : α}, a₀ = b₀ → a₁ = b₁ → ![a₀, a₁] = ![b₀, b₁]

theorem Matrix.vec3_eq E0 #

∀ {α : Type u} {a₀ a₁ a₂ b₀ b₁ b₂ : α}, a₀ = b₀ → a₁ = b₁ → a₂ = b₂ → ![a₀, a₁, a₂] = ![b₀, b₁, b₂]

theorem Matrix.vec2_add E1 #

∀ {α : Type u} [inst : Add α] (a₀ a₁ b₀ b₁ : α), ![a₀, a₁] + ![b₀, b₁] = ![a₀ + b₀, a₁ + b₁]

theorem Matrix.vec3_add E1 #

∀ {α : Type u} [inst : Add α] (a₀ a₁ a₂ b₀ b₁ b₂ : α), ![a₀, a₁, a₂] + ![b₀, b₁, b₂] = ![a₀ + b₀, a₁ + b₁, a₂ + b₂]

theorem Matrix.smul_vec2 E1 #

∀ {α : Type u} {R : Type u_1} [inst : SMul R α] (x : R) (a₀ a₁ : α), x • ![a₀, a₁] = ![x • a₀, x • a₁]

theorem Matrix.smul_vec3 E1 #

∀ {α : Type u} {R : Type u_1} [inst : SMul R α] (x : R) (a₀ a₁ a₂ : α), x • ![a₀, a₁, a₂] = ![x • a₀, x • a₁, x • a₂]

theorem Matrix.vec2_dotProduct' E1 #

∀ {α : Type u} [inst : AddCommMonoid α] [inst_1 : Mul α] {a₀ a₁ b₀ b₁ : α}, ![a₀, a₁] ⬝ᵥ ![b₀, b₁] = a₀ * b₀ + a₁ * b₁

theorem Matrix.vec2_dotProduct E0 #

∀ {α : Type u} [inst : AddCommMonoid α] [inst_1 : Mul α] (v w : Fin 2 → α), v ⬝ᵥ w = v 0 * w 0 + v 1 * w 1

theorem Matrix.vec3_dotProduct' E1 #

∀ {α : Type u} [inst : AddCommMonoid α] [inst_1 : Mul α] {a₀ a₁ a₂ b₀ b₁ b₂ : α},
  ![a₀, a₁, a₂] ⬝ᵥ ![b₀, b₁, b₂] = a₀ * b₀ + a₁ * b₁ + a₂ * b₂

theorem Matrix.vec3_dotProduct E1 #

∀ {α : Type u} [inst : AddCommMonoid α] [inst_1 : Mul α] (v w : Fin 3 → α), v ⬝ᵥ w = v 0 * w 0 + v 1 * w 1 + v 2 * w 2