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.Data.Matrix.Mul

223 declarations. Mathlib docs · Source

Matrix multiplication

This file defines vector and matrix multiplication

Main definitions

  • dotProduct: the dot product between two vectors
  • Matrix.mul: multiplication of two matrices
  • Matrix.mulVec: multiplication of a matrix with a vector
  • Matrix.vecMul: multiplication of a vector with a matrix
  • Matrix.vecMulVec: multiplication of a vector with a vector to get a matrix
  • Matrix.instRing: square matrices form a ring

Notation

The scope Matrix gives the following notation:

  • ⬝ᵥ for dotProduct
  • *ᵥ for Matrix.mulVec
  • ᵥ* for Matrix.vecMul

See Mathlib/LinearAlgebra/Matrix/ConjTranspose.lean for

  • ᴴ for Matrix.conjTranspose

Implementation notes

For convenience, Matrix m n α is defined as m → n → α, as this allows elements of the matrix to be accessed with A i j. However, it is not advisable to construct matrices using terms of the form fun i j ↦ _ or even (fun i j ↦ _ : Matrix m n α), as these are not recognized by Lean as having the right type. Instead, Matrix.of should be used.

TODO

Under various conditions, multiplication of infinite matrices makes sense. These have not yet been implemented.

simp lemmas for Matrix.submatrixs interaction with Matrix.diagonal, 1, and Matrix.mul for when the mappings are bundled.

def dotProduct E3 #

{m : Type u_2} → {α : Type v} → [Fintype m] → [Mul α] → [AddCommMonoid α] → (m → α) → (m → α) → α

dotProduct v w is the sum of the entrywise products v i * w i.

This is available in bundled forms as:

  • dotProductBilin
  • dotProductEquiv

def «term_⬝ᵥ_» E1 #

Lean.TrailingParserDescr

dotProduct v w is the sum of the entrywise products v i * w i.

This is available in bundled forms as:

  • dotProductBilin
  • dotProductEquiv

theorem dotProduct_assoc E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : Fintype m] [inst_1 : Fintype n] [inst_2 : NonUnitalSemiring α]
  (u : m → α) (w : n → α) (v : Matrix m n α), (fun j ↦ u ⬝ᵥ fun i ↦ v i j) ⬝ᵥ w = u ⬝ᵥ fun i ↦ v i ⬝ᵥ w

theorem dotProduct_comm E1 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : AddCommMonoid α] [inst_2 : CommMagma α] (v w : m → α),
  v ⬝ᵥ w = w ⬝ᵥ v

theorem dotProduct_pUnit E0 #

∀ {α : Type v} [inst : AddCommMonoid α] [inst_1 : Mul α] (v w : PUnit.{u_7 + 1} → α),
  v ⬝ᵥ w = v PUnit.unit * w PUnit.unit

theorem dotProduct_one E1 #

∀ {n : Type u_3} {α : Type v} [inst : Fintype n] [inst_1 : MulOneClass α] [inst_2 : AddCommMonoid α] (v : n → α),
  v ⬝ᵥ 1 = ∑ i, v i

theorem one_dotProduct E1 #

∀ {n : Type u_3} {α : Type v} [inst : Fintype n] [inst_1 : MulOneClass α] [inst_2 : AddCommMonoid α] (v : n → α),
  1 ⬝ᵥ v = ∑ i, v i

theorem dotProduct_zero E0 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : NonUnitalNonAssocSemiring α] (v : m → α), v ⬝ᵥ 0 = 0

theorem dotProduct_zero' E0 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : NonUnitalNonAssocSemiring α] (v : m → α),
  (v ⬝ᵥ fun x ↦ 0) = 0

theorem zero_dotProduct E0 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : NonUnitalNonAssocSemiring α] (v : m → α), 0 ⬝ᵥ v = 0

theorem zero_dotProduct' E0 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : NonUnitalNonAssocSemiring α] (v : m → α),
  (fun x ↦ 0) ⬝ᵥ v = 0

theorem add_dotProduct E0 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : NonUnitalNonAssocSemiring α] (u v w : m → α),
  (u + v) ⬝ᵥ w = u ⬝ᵥ w + v ⬝ᵥ w

theorem dotProduct_add E0 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : NonUnitalNonAssocSemiring α] (u v w : m → α),
  u ⬝ᵥ (v + w) = u ⬝ᵥ v + u ⬝ᵥ w

theorem sumElim_dotProduct_sumElim E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : Fintype m] [inst_1 : Fintype n]
  [inst_2 : NonUnitalNonAssocSemiring α] (u v : m → α) (x y : n → α), Sum.elim u x ⬝ᵥ Sum.elim v y = u ⬝ᵥ v + x ⬝ᵥ y

theorem comp_equiv_symm_dotProduct E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : Fintype m] [inst_1 : Fintype n]
  [inst_2 : NonUnitalNonAssocSemiring α] (u : m → α) (x : n → α) (e : m ≃ n), u ∘ ⇑e.symm ⬝ᵥ x = u ⬝ᵥ x ∘ ⇑e

Permuting a vector on the left of a dot product can be transferred to the right.

theorem dotProduct_comp_equiv_symm E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : Fintype m] [inst_1 : Fintype n]
  [inst_2 : NonUnitalNonAssocSemiring α] (u : m → α) (x : n → α) (e : n ≃ m), u ⬝ᵥ x ∘ ⇑e.symm = u ∘ ⇑e ⬝ᵥ x

Permuting a vector on the right of a dot product can be transferred to the left.

theorem comp_equiv_dotProduct_comp_equiv E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : Fintype m] [inst_1 : Fintype n]
  [inst_2 : NonUnitalNonAssocSemiring α] (x y : n → α) (e : m ≃ n), x ∘ ⇑e ⬝ᵥ y ∘ ⇑e = x ⬝ᵥ y

Permuting vectors on both sides of a dot product is a no-op.

theorem extend_zero_dotProduct E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : Fintype m] [inst_1 : Fintype n]
  [inst_2 : NonUnitalNonAssocSemiring α] {s : m → n},
  Function.Injective s → ∀ (u : m → α) (x : n → α), Function.extend s u 0 ⬝ᵥ x = u ⬝ᵥ x ∘ s

Extending the left argument with zeros is the same as slicing the right argument.

theorem dotProduct_extend_zero E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : Fintype m] [inst_1 : Fintype n]
  [inst_2 : NonUnitalNonAssocSemiring α] {s : n → m},
  Function.Injective s → ∀ (u : m → α) (x : n → α), u ⬝ᵥ Function.extend s x 0 = u ∘ s ⬝ᵥ x

Extending the right argument with zeros is the same as slicing the left argument.

theorem dotProduct_sum E1 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : NonUnitalNonAssocSemiring α] {ι : Type u_7} (u : m → α)
  (s : Finset ι) (v : ι → m → α), u ⬝ᵥ ∑ i ∈ s, v i = ∑ i ∈ s, u ⬝ᵥ v i

theorem sum_dotProduct E1 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : NonUnitalNonAssocSemiring α] {ι : Type u_7} (s : Finset ι)
  (u : ι → m → α) (v : m → α), (∑ i ∈ s, u i) ⬝ᵥ v = ∑ i ∈ s, u i ⬝ᵥ v

theorem diagonal_dotProduct E0 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : DecidableEq m] [inst_2 : NonUnitalNonAssocSemiring α]
  (v w : m → α) (i : m), Matrix.diagonal v i ⬝ᵥ w = v i * w i

theorem dotProduct_diagonal E0 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : DecidableEq m] [inst_2 : NonUnitalNonAssocSemiring α]
  (v w : m → α) (i : m), v ⬝ᵥ Matrix.diagonal w i = v i * w i

theorem dotProduct_diagonal' E0 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : DecidableEq m] [inst_2 : NonUnitalNonAssocSemiring α]
  (v w : m → α) (i : m), (v ⬝ᵥ fun j ↦ Matrix.diagonal w j i) = v i * w i

theorem single_dotProduct E0 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : DecidableEq m] [inst_2 : NonUnitalNonAssocSemiring α]
  (v : m → α) (x : α) (i : m), Pi.single i x ⬝ᵥ v = x * v i

theorem dotProduct_single E0 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : DecidableEq m] [inst_2 : NonUnitalNonAssocSemiring α]
  (v : m → α) (x : α) (i : m), v ⬝ᵥ Pi.single i x = v i * x

theorem one_dotProduct_one E0 #

∀ {n : Type u_3} {α : Type v} [inst : Fintype n] [inst_1 : NonAssocSemiring α], 1 ⬝ᵥ 1 = ↑(Fintype.card n)

theorem dotProduct_single_one E1 #

∀ {n : Type u_3} {α : Type v} [inst : Fintype n] [inst_1 : NonAssocSemiring α] [inst_2 : DecidableEq n] (v : n → α)
  (i : n), v ⬝ᵥ Pi.single i 1 = v i

theorem single_one_dotProduct E1 #

∀ {n : Type u_3} {α : Type v} [inst : Fintype n] [inst_1 : NonAssocSemiring α] [inst_2 : DecidableEq n] (i : n)
  (v : n → α), Pi.single i 1 ⬝ᵥ v = v i

theorem neg_dotProduct E0 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : NonUnitalNonAssocRing α] (v w : m → α), -v ⬝ᵥ w = -(v ⬝ᵥ w)

theorem dotProduct_neg E0 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : NonUnitalNonAssocRing α] (v w : m → α), v ⬝ᵥ -w = -(v ⬝ᵥ w)

theorem neg_dotProduct_neg E1 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : NonUnitalNonAssocRing α] (v w : m → α), -v ⬝ᵥ -w = v ⬝ᵥ w

theorem sub_dotProduct E0 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : NonUnitalNonAssocRing α] (u v w : m → α),
  (u - v) ⬝ᵥ w = u ⬝ᵥ w - v ⬝ᵥ w

theorem dotProduct_sub E0 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : NonUnitalNonAssocRing α] (u v w : m → α),
  u ⬝ᵥ (v - w) = u ⬝ᵥ v - u ⬝ᵥ w

theorem smul_dotProduct E0 #

∀ {m : Type u_2} {R : Type u_5} {α : Type v} [inst : Fintype m] [inst_1 : Mul α] [inst_2 : AddCommMonoid α]
  [inst_3 : DistribSMul R α] [IsScalarTower R α α] (x : R) (v w : m → α), x • v ⬝ᵥ w = x • (v ⬝ᵥ w)

theorem dotProduct_smul E0 #

∀ {m : Type u_2} {R : Type u_5} {α : Type v} [inst : Fintype m] [inst_1 : Mul α] [inst_2 : AddCommMonoid α]
  [inst_3 : DistribSMul R α] [SMulCommClass R α α] (x : R) (v w : m → α), v ⬝ᵥ x • w = x • (v ⬝ᵥ w)

theorem exists_ne_zero_dotProduct_eq_zero E1 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : CommRing α] [Nontrivial m] [Nontrivial α] (a : m → α),
  ∃ b, b ≠ 0 ∧ b ⬝ᵥ a = 0

For any vector a in a nontrivial commutative ring with nontrivial index, there exists a non-zero vector b such that b ⬝ᵥ a = 0. In other words, there exists a non-zero orthogonal vector.

theorem not_injective_dotProduct_left E1 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : CommRing α] [Nontrivial m] [Nontrivial α] (a : m → α),
  ¬Function.Injective (dotProduct a)

theorem not_injective_dotProduct_right E1 #

∀ {m : Type u_2} {α : Type v} [inst : Fintype m] [inst_1 : CommRing α] [Nontrivial m] [Nontrivial α] (a : m → α),
  ¬Function.Injective fun x ↦ x ⬝ᵥ a

instance Matrix.instHMulOfFintypeOfMulOfAddCommMonoid E0 #

{l : Type u_1} →
  {m : Type u_2} →
    {n : Type u_3} →
      {α : Type v} → [Fintype m] → [Mul α] → [AddCommMonoid α] → HMul (Matrix l m α) (Matrix m n α) (Matrix l n α)

M * N is the usual product of matrices M and N, i.e. we have that (M * N) i k is the dot product of the i-th row of M by the k-th column of N. This is currently only defined when m is finite.

This is available in bundled forms as:

  • Matrix.addMonoidHomMulLeft
  • Matrix.addMonoidHomMulRight

theorem Matrix.mul_apply E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [inst : Fintype m] [inst_1 : Mul α]
  [inst_2 : AddCommMonoid α] {M : Matrix l m α} {N : Matrix m n α} {i : l} {k : n}, (M * N) i k = ∑ j, M i j * N j k

instance Matrix.instMulOfFintypeOfAddCommMonoid E0 #

{n : Type u_3} → {α : Type v} → [Fintype n] → [Mul α] → [AddCommMonoid α] → Mul (Matrix n n α)

instance Matrix.instMulOneOfFintypeOfDecidableEqOfAddCommMonoid E0 #

{n : Type u_3} → {α : Type v} → [Fintype n] → [DecidableEq n] → [MulOne α] → [AddCommMonoid α] → MulOne (Matrix n n α)

theorem Matrix.mul_apply' E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [inst : Fintype m] [inst_1 : Mul α]
  [inst_2 : AddCommMonoid α] {M : Matrix l m α} {N : Matrix m n α} {i : l} {k : n}, (M * N) i k = M i ⬝ᵥ fun j ↦ N j k

theorem Matrix.two_mul_expl E1 #

∀ {R : Type u_7} [inst : NonUnitalNonAssocSemiring R] (A B : Matrix (Fin 2) (Fin 2) R),
  (A * B) 0 0 = A 0 0 * B 0 0 + A 0 1 * B 1 0 ∧
    (A * B) 0 1 = A 0 0 * B 0 1 + A 0 1 * B 1 1 ∧
      (A * B) 1 0 = A 1 0 * B 0 0 + A 1 1 * B 1 0 ∧ (A * B) 1 1 = A 1 0 * B 0 1 + A 1 1 * B 1 1

theorem Matrix.smul_mul E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {R : Type u_5} {α : Type v} [inst : AddCommMonoid α] [inst_1 : Mul α]
  [inst_2 : Fintype n] [inst_3 : Monoid R] [inst_4 : DistribMulAction R α] [IsScalarTower R α α] (a : R)
  (M : Matrix m n α) (N : Matrix n l α), a • M * N = a • (M * N)

theorem Matrix.mul_smul E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {R : Type u_5} {α : Type v} [inst : AddCommMonoid α] [inst_1 : Mul α]
  [inst_2 : Fintype n] [inst_3 : Monoid R] [inst_4 : DistribMulAction R α] [SMulCommClass R α α] (M : Matrix m n α)
  (a : R) (N : Matrix n l α), M * a • N = a • (M * N)

theorem Matrix.mul_zero E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n]
  (M : Matrix m n α), M * 0 = 0

theorem Matrix.zero_mul E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype m]
  (M : Matrix m n α), 0 * M = 0

theorem Matrix.mul_add E1 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n]
  (L : Matrix m n α) (M N : Matrix n o α), L * (M + N) = L * M + L * N

theorem Matrix.add_mul E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype m]
  (L M : Matrix l m α) (N : Matrix m n α), (L + M) * N = L * N + M * N

instance Matrix.nonUnitalNonAssocSemiring E0 #

{n : Type u_3} → {α : Type v} → [NonUnitalNonAssocSemiring α] → [Fintype n] → NonUnitalNonAssocSemiring (Matrix n n α)

theorem Matrix.diagonal_mul E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype m]
  [inst_2 : DecidableEq m] (d : m → α) (M : Matrix m n α) (i : m) (j : n), (Matrix.diagonal d * M) i j = d i * M i j

theorem Matrix.mul_diagonal E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n]
  [inst_2 : DecidableEq n] (d : n → α) (M : Matrix m n α) (i : m) (j : n), (M * Matrix.diagonal d) i j = M i j * d j

theorem Matrix.diagonal_mul_diagonal E0 #

∀ {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n] [inst_2 : DecidableEq n]
  (d₁ d₂ : n → α), Matrix.diagonal d₁ * Matrix.diagonal d₂ = Matrix.diagonal fun i ↦ d₁ i * d₂ i

theorem Matrix.diagonal_mul_diagonal' E1 #

∀ {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n] [inst_2 : DecidableEq n]
  (d₁ d₂ : n → α), Matrix.diagonal d₁ * Matrix.diagonal d₂ = Matrix.diagonal fun i ↦ d₁ i * d₂ i

theorem Matrix.commute_diagonal E1 #

∀ {n : Type u_3} {α : Type u_7} [inst : NonUnitalNonAssocCommSemiring α] [inst_1 : Fintype n] [inst_2 : DecidableEq n]
  (d₁ d₂ : n → α), Commute (Matrix.diagonal d₁) (Matrix.diagonal d₂)

theorem Matrix.smul_eq_diagonal_mul E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype m]
  [inst_2 : DecidableEq m] (M : Matrix m n α) (a : α), a • M = (Matrix.diagonal fun x ↦ a) * M

theorem Matrix.op_smul_eq_mul_diagonal E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n]
  [inst_2 : DecidableEq n] (M : Matrix m n α) (a : α), MulOpposite.op a • M = M * Matrix.diagonal fun x ↦ a

def Matrix.addMonoidHomMulLeft E1 #

{l : Type u_1} →
  {m : Type u_2} →
    {n : Type u_3} →
      {α : Type v} → [inst : NonUnitalNonAssocSemiring α] → [Fintype m] → Matrix l m α → Matrix m n α →+ Matrix l n α

Left multiplication by a matrix, as an AddMonoidHom from matrices to matrices.

theorem Matrix.addMonoidHomMulLeft_apply E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype m]
  (M : Matrix l m α) (x : Matrix m n α), M.addMonoidHomMulLeft x = M * x

def Matrix.addMonoidHomMulRight E1 #

{l : Type u_1} →
  {m : Type u_2} →
    {n : Type u_3} →
      {α : Type v} → [inst : NonUnitalNonAssocSemiring α] → [Fintype m] → Matrix m n α → Matrix l m α →+ Matrix l n α

Right multiplication by a matrix, as an AddMonoidHom from matrices to matrices.

theorem Matrix.addMonoidHomMulRight_apply E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype m]
  (M : Matrix m n α) (x : Matrix l m α), M.addMonoidHomMulRight x = x * M

theorem Matrix.sum_mul E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [inst : NonUnitalNonAssocSemiring α]
  [inst_1 : Fintype m] (s : Finset β) (f : β → Matrix l m α) (M : Matrix m n α), (∑ a ∈ s, f a) * M = ∑ a ∈ s, f a * M

theorem Matrix.mul_sum E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [inst : NonUnitalNonAssocSemiring α]
  [inst_1 : Fintype m] (s : Finset β) (f : β → Matrix m n α) (M : Matrix l m α), M * ∑ a ∈ s, f a = ∑ a ∈ s, M * f a

instance Matrix.Semiring.isScalarTower E0 #

∀ {n : Type u_3} {R : Type u_5} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n]
  [inst_2 : Monoid R] [inst_3 : DistribMulAction R α] [IsScalarTower R α α],
  IsScalarTower R (Matrix n n α) (Matrix n n α)

This instance enables use with smul_mul_assoc.

instance Matrix.Semiring.smulCommClass E0 #

∀ {n : Type u_3} {R : Type u_5} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n]
  [inst_2 : Monoid R] [inst_3 : DistribMulAction R α] [SMulCommClass R α α],
  SMulCommClass R (Matrix n n α) (Matrix n n α)

This instance enables use with mul_smul_comm.

theorem Matrix.map_mul E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} {β : Type w} [inst : NonUnitalNonAssocSemiring α]
  [inst_1 : Fintype n] {L : Matrix m n α} {M : Matrix n o α} [inst_2 : NonUnitalNonAssocSemiring β] {F : Type u_7}
  [inst_3 : FunLike F α β] [NonUnitalRingHomClass F α β] {f : F}, (L * M).map ⇑f = L.map ⇑f * M.map ⇑f

theorem Matrix.one_mul E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonAssocSemiring α] [inst_1 : Fintype m] [inst_2 : DecidableEq m]
  (M : Matrix m n α), 1 * M = M

theorem Matrix.mul_one E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonAssocSemiring α] [inst_1 : Fintype n] [inst_2 : DecidableEq n]
  (M : Matrix m n α), M * 1 = M

instance Matrix.nonAssocSemiring E0 #

{n : Type u_3} → {α : Type v} → [NonAssocSemiring α] → [Fintype n] → [DecidableEq n] → NonAssocSemiring (Matrix n n α)

theorem Matrix.smul_one_eq_diagonal E1 #

∀ {m : Type u_2} {α : Type v} [inst : NonAssocSemiring α] [inst_1 : DecidableEq m] (a : α),
  a • 1 = Matrix.diagonal fun x ↦ a

theorem Matrix.op_smul_one_eq_diagonal E1 #

∀ {m : Type u_2} {α : Type v} [inst : NonAssocSemiring α] [inst_1 : DecidableEq m] (a : α),
  MulOpposite.op a • 1 = Matrix.diagonal fun x ↦ a

theorem Matrix.mul_assoc E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : NonUnitalSemiring α]
  [inst_1 : Fintype m] [inst_2 : Fintype n] (L : Matrix l m α) (M : Matrix m n α) (N : Matrix n o α),
  L * M * N = L * (M * N)

instance Matrix.nonUnitalSemiring E0 #

{n : Type u_3} → {α : Type v} → [NonUnitalSemiring α] → [Fintype n] → NonUnitalSemiring (Matrix n n α)

instance Matrix.semiring E0 #

{n : Type u_3} → {α : Type v} → [Semiring α] → [Fintype n] → [DecidableEq n] → Semiring (Matrix n n α)

theorem Matrix.neg_mul E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : NonUnitalNonAssocRing α] [inst_1 : Fintype n]
  (M : Matrix m n α) (N : Matrix n o α), -M * N = -(M * N)

theorem Matrix.mul_neg E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : NonUnitalNonAssocRing α] [inst_1 : Fintype n]
  (M : Matrix m n α) (N : Matrix n o α), M * -N = -(M * N)

theorem Matrix.sub_mul E1 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : NonUnitalNonAssocRing α] [inst_1 : Fintype n]
  (M M' : Matrix m n α) (N : Matrix n o α), (M - M') * N = M * N - M' * N

theorem Matrix.mul_sub E1 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : NonUnitalNonAssocRing α] [inst_1 : Fintype n]
  (M : Matrix m n α) (N N' : Matrix n o α), M * (N - N') = M * N - M * N'

instance Matrix.nonUnitalNonAssocRing E0 #

{n : Type u_3} → {α : Type v} → [NonUnitalNonAssocRing α] → [Fintype n] → NonUnitalNonAssocRing (Matrix n n α)

instance Matrix.instNonUnitalRing E0 #

{n : Type u_3} → {α : Type v} → [Fintype n] → [NonUnitalRing α] → NonUnitalRing (Matrix n n α)

instance Matrix.instNonAssocRing E0 #

{n : Type u_3} → {α : Type v} → [Fintype n] → [DecidableEq n] → [NonAssocRing α] → NonAssocRing (Matrix n n α)

instance Matrix.instRing E3 #

{n : Type u_3} → {α : Type v} → [Fintype n] → [DecidableEq n] → [Ring α] → Ring (Matrix n n α)

theorem Matrix.mul_mul_left E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : Semiring α] [inst_1 : Fintype n] (M : Matrix m n α)
  (N : Matrix n o α) (a : α), (Matrix.of fun i j ↦ a * M i j) * N = a • (M * N)

theorem Matrix.pow_apply_nonneg E1 #

∀ {n : Type u_3} {α : Type v} [inst : Semiring α] [inst_1 : Fintype n] [inst_2 : DecidableEq n]
  [inst_3 : PartialOrder α] [IsOrderedRing α] {A : Matrix n n α},
  (∀ (i j : n), 0 ≤ A i j) → ∀ (k : ℕ) (i j : n), 0 ≤ (A ^ k) i j

theorem Matrix.mul_pow_mul E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : Semiring α] [inst_1 : Fintype n] [inst_2 : Fintype m]
  [inst_3 : DecidableEq n] [inst_4 : DecidableEq m] (A : Matrix m n α) (B : Matrix n m α) (k : ℕ),
  (A * B) ^ k * A = A * (B * A) ^ k

theorem Matrix.smul_eq_mul_diagonal E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : CommSemiring α] [inst_1 : Fintype n] [inst_2 : DecidableEq n]
  (M : Matrix m n α) (a : α), a • M = M * Matrix.diagonal fun x ↦ a

theorem Matrix.mul_mul_right E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : CommSemiring α] [inst_1 : Fintype n]
  (M : Matrix m n α) (N : Matrix n o α) (a : α), (M * Matrix.of fun i j ↦ a * N i j) = a • (M * N)

class IsStablyFiniteRing E1 #

(R : Type u_7) → [MulOne R] → [AddCommMonoid R] → Prop

A semiring is stably finite if every matrix ring over it is Dedekind-finite.

theorem isStablyFiniteRing_iff E0 #

∀ (R : Type u_7) [inst : MulOne R] [inst_1 : AddCommMonoid R],
  IsStablyFiniteRing R ↔ ∀ (n : ℕ), IsDedekindFiniteMonoid (Matrix (Fin n) (Fin n) R)

ctor IsStablyFiniteRing.mk E0 #

∀ {R : Type u_7} [inst : MulOne R] [inst_1 : AddCommMonoid R],
  (∀ (n : ℕ), IsDedekindFiniteMonoid (Matrix (Fin n) (Fin n) R)) → IsStablyFiniteRing R

instance IsStablyFiniteRing.isDedekindFiniteMonoid E0 #

∀ {R : Type u_7} {inst : MulOne R} {inst_1 : AddCommMonoid R} [self : IsStablyFiniteRing R] (n : ℕ),
  IsDedekindFiniteMonoid (Matrix (Fin n) (Fin n) R)

instance instIsDedekindFiniteMonoidOfIsStablyFiniteRing E0 #

∀ (R : Type u_7) [inst : NonAssocSemiring R] [IsStablyFiniteRing R], IsDedekindFiniteMonoid R

theorem IsStablyFiniteRing.of_injective E1 #

∀ {R : Type u_7} {S : Type u_8} {F : Type u_9} [inst : NonAssocSemiring R] [inst_1 : NonAssocSemiring S]
  [inst_2 : FunLike F R S] [RingHomClass F R S] (f : F),
  Function.Injective ⇑f → ∀ [IsStablyFiniteRing S], IsStablyFiniteRing R

theorem RingEquiv.isStablyFiniteRing_iff E0 #

∀ {R : Type u_7} {S : Type u_8} {F : Type u_9} [inst : NonAssocSemiring R] [inst_1 : NonAssocSemiring S]
  [inst_2 : EquivLike F R S] [RingEquivClass F R S] (f : F), IsStablyFiniteRing R ↔ IsStablyFiniteRing S

instance instIsStablyFiniteRingSubtypeMem E0 #

∀ {R : Type u_7} {F : Type u_9} [inst : NonAssocSemiring R] [inst_1 : SetLike F R] [inst_2 : SubsemiringClass F R]
  (S : F) [IsStablyFiniteRing R], IsStablyFiniteRing ↥S

def Matrix.vecMulVec E3 #

{m : Type u_2} → {n : Type u_3} → {α : Type v} → [Mul α] → (m → α) → (n → α) → Matrix m n α

For two vectors w and v, vecMulVec w v i j is defined to be w i * v j. Put another way, vecMulVec w v is exactly replicateCol ι w * replicateRow ι v for Unique ι; see vecMulVec_eq.

This is available in a bundled form as vecMulVecBilin.

theorem Matrix.vecMulVec_apply E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : Mul α] (w : m → α) (v : n → α) (i : m) (j : n),
  Matrix.vecMulVec w v i j = w i * v j

theorem Matrix.row_vecMulVec E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : Mul α] (w : m → α) (v : n → α) (i : m),
  (Matrix.vecMulVec w v).row i = w i • v

theorem Matrix.col_vecMulVec E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : Mul α] (w : m → α) (v : n → α) (j : n),
  (Matrix.vecMulVec w v).col j = MulOpposite.op (v j) • w

theorem Matrix.zero_vecMulVec E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : MulZeroClass α] (v : n → α), Matrix.vecMulVec 0 v = 0

theorem Matrix.vecMulVec_zero E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : MulZeroClass α] (w : m → α), Matrix.vecMulVec w 0 = 0

theorem Matrix.vecMulVec_ne_zero E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : Mul α] [inst_1 : Zero α] [NoZeroDivisors α] {a : m → α}
  {b : n → α}, a ≠ 0 → b ≠ 0 → Matrix.vecMulVec a b ≠ 0

theorem Matrix.vecMulVec_eq_zero E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : MulZeroClass α] [NoZeroDivisors α] {a : m → α} {b : n → α},
  Matrix.vecMulVec a b = 0 ↔ a = 0 ∨ b = 0

theorem Matrix.add_vecMulVec E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : Mul α] [inst_1 : Add α] [RightDistribClass α] (w₁ w₂ : m → α)
  (v : n → α), Matrix.vecMulVec (w₁ + w₂) v = Matrix.vecMulVec w₁ v + Matrix.vecMulVec w₂ v

theorem Matrix.vecMulVec_add E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : Mul α] [inst_1 : Add α] [LeftDistribClass α] (w : m → α)
  (v₁ v₂ : n → α), Matrix.vecMulVec w (v₁ + v₂) = Matrix.vecMulVec w v₁ + Matrix.vecMulVec w v₂

theorem Matrix.neg_vecMulVec E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : Mul α] [inst_1 : HasDistribNeg α] (w : m → α) (v : n → α),
  Matrix.vecMulVec (-w) v = -Matrix.vecMulVec w v

theorem Matrix.vecMulVec_neg E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : Mul α] [inst_1 : HasDistribNeg α] (w : m → α) (v : n → α),
  Matrix.vecMulVec w (-v) = -Matrix.vecMulVec w v

theorem Matrix.smul_vecMulVec E0 #

∀ {m : Type u_2} {n : Type u_3} {R : Type u_5} {α : Type v} [inst : Mul α] [inst_1 : SMul R α] [IsScalarTower R α α]
  (r : R) (w : m → α) (v : n → α), Matrix.vecMulVec (r • w) v = r • Matrix.vecMulVec w v

theorem Matrix.vecMulVec_smul E0 #

∀ {m : Type u_2} {n : Type u_3} {R : Type u_5} {α : Type v} [inst : Mul α] [inst_1 : SMul R α] [SMulCommClass R α α]
  (r : R) (w : m → α) (v : n → α), Matrix.vecMulVec w (r • v) = r • Matrix.vecMulVec w v

theorem Matrix.vecMulVec_smul' E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : Semigroup α] (w : m → α) (r : α) (v : n → α),
  Matrix.vecMulVec w (r • v) = Matrix.vecMulVec (MulOpposite.op r • w) v

theorem Matrix.transpose_vecMulVec E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : CommMagma α] (w : m → α) (v : n → α),
  (Matrix.vecMulVec w v).transpose = Matrix.vecMulVec v w

theorem Matrix.diag_vecMulVec E0 #

∀ {n : Type u_3} {α : Type v} [inst : Mul α] (u v : n → α), (Matrix.vecMulVec u v).diag = u * v

def Matrix.mulVec E3 #

{m : Type u_2} →
  {n : Type u_3} → {α : Type v} → [NonUnitalNonAssocSemiring α] → [Fintype n] → Matrix m n α → (n → α) → m → α

M *ᵥ v (notation for mulVec M v) is the matrix-vector product of matrix M and vector v, where v is seen as a column vector.

The notation has precedence 73, which comes immediately before ⬝ᵥ for dotProduct, so that A *ᵥ v ⬝ᵥ B *ᵥ w is parsed as (A *ᵥ v) ⬝ᵥ (B *ᵥ w).

This is available in bundled forms as:

  • Matrix.mulVec.addMonoidHomLeft
  • Matrix.mulVecLin
  • Matrix.mulVecBilin

def Matrix.«term_*ᵥ_» E1 #

Lean.TrailingParserDescr

M *ᵥ v (notation for mulVec M v) is the matrix-vector product of matrix M and vector v, where v is seen as a column vector.

The notation has precedence 73, which comes immediately before ⬝ᵥ for dotProduct, so that A *ᵥ v ⬝ᵥ B *ᵥ w is parsed as (A *ᵥ v) ⬝ᵥ (B *ᵥ w).

This is available in bundled forms as:

  • Matrix.mulVec.addMonoidHomLeft
  • Matrix.mulVecLin
  • Matrix.mulVecBilin

theorem Matrix.mulVec_apply E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n]
  (M : Matrix m n α) (v : n → α) (i : m), M.mulVec v i = M.row i ⬝ᵥ v

theorem Matrix.mulVec_apply_eq_sum E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n]
  (M : Matrix m n α) (v : n → α) (i : m), M.mulVec v i = ∑ j, M i j * v j

def Matrix.vecMul E3 #

{m : Type u_2} →
  {n : Type u_3} → {α : Type v} → [NonUnitalNonAssocSemiring α] → [Fintype m] → (m → α) → Matrix m n α → n → α

v ᵥ* M (notation for vecMul v M) is the vector-matrix product of vector v and matrix M, where v is seen as a row vector.

The notation has precedence 73, which comes immediately before ⬝ᵥ for dotProduct, so that v ᵥ* A ⬝ᵥ w ᵥ* B is parsed as (v ᵥ* A) ⬝ᵥ (w ᵥ* B).

This is available in bundled forms as:

  • Matrix.vecMulLinear
  • Matrix.vecMulBilin

def Matrix.«term_ᵥ*_» E1 #

Lean.TrailingParserDescr

v ᵥ* M (notation for vecMul v M) is the vector-matrix product of vector v and matrix M, where v is seen as a row vector.

The notation has precedence 73, which comes immediately before ⬝ᵥ for dotProduct, so that v ᵥ* A ⬝ᵥ w ᵥ* B is parsed as (v ᵥ* A) ⬝ᵥ (w ᵥ* B).

This is available in bundled forms as:

  • Matrix.vecMulLinear
  • Matrix.vecMulBilin

theorem Matrix.vecMul_apply E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype m] (v : m → α)
  (M : Matrix m n α) (i : n), Matrix.vecMul v M i = v ⬝ᵥ M.col i

theorem Matrix.vecMul_apply_eq_sum E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype m] (v : m → α)
  (M : Matrix m n α) (i : n), Matrix.vecMul v M i = ∑ j, v j * M j i

def Matrix.mulVec.addMonoidHomLeft E1 #

{m : Type u_2} →
  {n : Type u_3} → {α : Type v} → [inst : NonUnitalNonAssocSemiring α] → [Fintype n] → (n → α) → Matrix m n α →+ m → α

Left multiplication by a matrix, as an AddMonoidHom from matrices to vectors.

theorem Matrix.mulVec.addMonoidHomLeft_apply E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n] (v : n → α)
  (M : Matrix m n α) (a : m), (Matrix.mulVec.addMonoidHomLeft v) M a = M.mulVec v a

theorem Matrix.mul_apply_eq_vecMul E1 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n]
  (A : Matrix m n α) (B : Matrix n o α) (i : m), (A * B) i = Matrix.vecMul (A i) B

The ith row of the multiplication is the same as the vecMul with the ith row of A.

theorem Matrix.vecMul_eq_sum E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype m] (v : m → α)
  (M : Matrix m n α), Matrix.vecMul v M = ∑ i, v i • M i

theorem Matrix.mulVec_eq_sum E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n] (v : n → α)
  (M : Matrix m n α), M.mulVec v = ∑ i, MulOpposite.op (v i) • M.transpose i

theorem Matrix.mulVec_diagonal E1 #

∀ {m : Type u_2} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype m] [inst_2 : DecidableEq m]
  (v w : m → α) (x : m), (Matrix.diagonal v).mulVec w x = v x * w x

theorem Matrix.vecMul_diagonal E1 #

∀ {m : Type u_2} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype m] [inst_2 : DecidableEq m]
  (v w : m → α) (x : m), Matrix.vecMul v (Matrix.diagonal w) x = v x * w x

theorem Matrix.dotProduct_mulVec E1 #

∀ {m : Type u_2} {n : Type u_3} {R : Type u_5} [inst : Fintype n] [inst_1 : Fintype m] [inst_2 : NonUnitalSemiring R]
  (v : m → R) (A : Matrix m n R) (w : n → R), v ⬝ᵥ A.mulVec w = Matrix.vecMul v A ⬝ᵥ w

Associate the dot product of mulVec to the left.

theorem Matrix.dot_mulVec_eq_sum_sum E1 #

∀ {m : Type u_2} {n : Type u_3} {R : Type u_5} [inst : Fintype n] [inst_1 : Fintype m] [inst_2 : NonUnitalSemiring R]
  (v : m → R) (A : Matrix m n R) (w : n → R), v ⬝ᵥ A.mulVec w = ∑ j, ∑ i, v i * A i j * w j

theorem Matrix.mulVec_zero E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n]
  (A : Matrix m n α), A.mulVec 0 = 0

theorem Matrix.zero_vecMul E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype m]
  (A : Matrix m n α), Matrix.vecMul 0 A = 0

theorem Matrix.zero_mulVec E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n] (v : n → α),
  Matrix.mulVec 0 v = 0

theorem Matrix.vecMul_zero E0 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype m] (v : m → α),
  Matrix.vecMul v 0 = 0

theorem Matrix.mulVec_add E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n]
  (A : Matrix m n α) (x y : n → α), A.mulVec (x + y) = A.mulVec x + A.mulVec y

theorem Matrix.add_mulVec E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n]
  (A B : Matrix m n α) (x : n → α), (A + B).mulVec x = A.mulVec x + B.mulVec x

theorem Matrix.vecMul_add E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype m]
  (A B : Matrix m n α) (x : m → α), Matrix.vecMul x (A + B) = Matrix.vecMul x A + Matrix.vecMul x B

theorem Matrix.add_vecMul E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype m]
  (A : Matrix m n α) (x y : m → α), Matrix.vecMul (x + y) A = Matrix.vecMul x A + Matrix.vecMul y A

theorem Matrix.mulVec_smul E1 #

∀ {m : Type u_2} {n : Type u_3} {R : Type u_5} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n]
  [inst_2 : DistribSMul R α] [SMulCommClass R α α] (M : Matrix m n α) (b : R) (v : n → α),
  M.mulVec (b • v) = b • M.mulVec v

theorem Matrix.smul_mulVec E1 #

∀ {m : Type u_2} {n : Type u_3} {R : Type u_5} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n]
  [inst_2 : DistribSMul R α] [IsScalarTower R α α] (b : R) (M : Matrix m n α) (v : n → α),
  (b • M).mulVec v = b • M.mulVec v

theorem Matrix.smul_vecMul E1 #

∀ {m : Type u_2} {n : Type u_3} {R : Type u_5} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype m]
  [inst_2 : DistribSMul R α] [IsScalarTower R α α] (b : R) (v : m → α) (M : Matrix m n α),
  Matrix.vecMul (b • v) M = b • Matrix.vecMul v M

theorem Matrix.vecMul_smul E1 #

∀ {m : Type u_2} {n : Type u_3} {R : Type u_5} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype m]
  [inst_2 : DistribSMul R α] [SMulCommClass R α α] (v : m → α) (b : R) (M : Matrix m n α),
  Matrix.vecMul v (b • M) = b • Matrix.vecMul v M

theorem Matrix.mulVec_extend_zero E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype n]
  [inst_2 : Fintype o] {c : o → n},
  Function.Injective c →
    ∀ (M : Matrix m n α) (w : o → α), M.mulVec (Function.extend c w 0) = (M.submatrix id c).mulVec w

theorem Matrix.extend_zero_vecMul E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : NonUnitalNonAssocSemiring α] [inst_1 : Fintype m]
  [inst_2 : Fintype o] {r : o → m},
  Function.Injective r →
    ∀ (v : o → α) (M : Matrix m n α), Matrix.vecMul (Function.extend r v 0) M = Matrix.vecMul v (M.submatrix r id)

theorem Matrix.mulVec_single E0 #

∀ {m : Type u_2} {n : Type u_3} {R : Type u_5} [inst : Fintype n] [inst_1 : DecidableEq n]
  [inst_2 : NonUnitalNonAssocSemiring R] (M : Matrix m n R) (j : n) (x : R),
  M.mulVec (Pi.single j x) = MulOpposite.op x • M.col j

theorem Matrix.single_vecMul E0 #

∀ {m : Type u_2} {n : Type u_3} {R : Type u_5} [inst : Fintype m] [inst_1 : DecidableEq m]
  [inst_2 : NonUnitalNonAssocSemiring R] (M : Matrix m n R) (i : m) (x : R),
  Matrix.vecMul (Pi.single i x) M = x • M.row i

theorem Matrix.mulVec_single_one E1 #

∀ {m : Type u_2} {n : Type u_3} {R : Type u_5} [inst : Fintype n] [inst_1 : DecidableEq n] [inst_2 : NonAssocSemiring R]
  (M : Matrix m n R) (j : n), M.mulVec (Pi.single j 1) = M.col j

theorem Matrix.single_one_vecMul E1 #

∀ {m : Type u_2} {n : Type u_3} {R : Type u_5} [inst : Fintype m] [inst_1 : DecidableEq m] [inst_2 : NonAssocSemiring R]
  (i : m) (M : Matrix m n R), Matrix.vecMul (Pi.single i 1) M = M.row i

theorem Matrix.diagonal_mulVec_single E1 #

∀ {n : Type u_3} {R : Type u_5} [inst : Fintype n] [inst_1 : DecidableEq n] [inst_2 : NonUnitalNonAssocSemiring R]
  (v : n → R) (j : n) (x : R), (Matrix.diagonal v).mulVec (Pi.single j x) = Pi.single j (v j * x)

theorem Matrix.single_vecMul_diagonal E1 #

∀ {n : Type u_3} {R : Type u_5} [inst : Fintype n] [inst_1 : DecidableEq n] [inst_2 : NonUnitalNonAssocSemiring R]
  (v : n → R) (j : n) (x : R), Matrix.vecMul (Pi.single j x) (Matrix.diagonal v) = Pi.single j (x * v j)

theorem Matrix.col_mul_eq_mulVec_col E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {R : Type u_5} [inst : NonUnitalNonAssocSemiring R] [inst_1 : Fintype m]
  {M : Matrix l m R} {N : Matrix m n R} {i : n}, (M * N).col i = M.mulVec (N.col i)

theorem Matrix.row_mul_eq_vecMul_row E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {R : Type u_5} [inst : NonUnitalNonAssocSemiring R] [inst_1 : Fintype m]
  {M : Matrix l m R} {N : Matrix m n R} {i : l}, (M * N).row i = Matrix.vecMul (M.row i) N

theorem Matrix.vecMul_vecMul E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : NonUnitalSemiring α] [inst_1 : Fintype n]
  [inst_2 : Fintype m] (v : m → α) (M : Matrix m n α) (N : Matrix n o α),
  Matrix.vecMul (Matrix.vecMul v M) N = Matrix.vecMul v (M * N)

theorem Matrix.mulVec_mulVec E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : NonUnitalSemiring α] [inst_1 : Fintype n]
  [inst_2 : Fintype o] (v : o → α) (M : Matrix m n α) (N : Matrix n o α), M.mulVec (N.mulVec v) = (M * N).mulVec v

theorem Matrix.mul_mul_apply E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : NonUnitalSemiring α]
  [inst_1 : Fintype m] [inst_2 : Fintype n] (A : Matrix l m α) (B : Matrix m n α) (C : Matrix n o α) (i : l) (j : o),
  (A * B * C) i j = A i ⬝ᵥ B.mulVec (C.transpose j)

theorem Matrix.vecMul_vecMulVec E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalSemiring α] [inst_1 : Fintype m] (u v : m → α)
  (w : n → α), Matrix.vecMul u (Matrix.vecMulVec v w) = (u ⬝ᵥ v) • w

theorem Matrix.vecMulVec_mulVec E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalSemiring α] [inst_1 : Fintype n] (u : m → α)
  (v w : n → α), (Matrix.vecMulVec u v).mulVec w = MulOpposite.op (v ⬝ᵥ w) • u

theorem Matrix.mul_vecMulVec E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalSemiring α] [inst_1 : Fintype m]
  (M : Matrix l m α) (x : m → α) (y : n → α), M * Matrix.vecMulVec x y = Matrix.vecMulVec (M.mulVec x) y

theorem Matrix.vecMulVec_mul E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalSemiring α] [inst_1 : Fintype m]
  (x : l → α) (y : m → α) (M : Matrix m n α), Matrix.vecMulVec x y * M = Matrix.vecMulVec x (Matrix.vecMul y M)

theorem Matrix.vecMulVec_mul_vecMulVec E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalSemiring α] [inst_1 : Fintype m]
  (u : l → α) (v w : m → α) (x : n → α), Matrix.vecMulVec u v * Matrix.vecMulVec w x = Matrix.vecMulVec u ((v ⬝ᵥ w) • x)

theorem Matrix.mul_right_injective_iff_mulVec_injective E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalSemiring α] [inst_1 : Fintype m]
  [Nonempty n] {A : Matrix l m α}, (Function.Injective fun B ↦ A * B) ↔ Function.Injective A.mulVec

theorem Matrix.mul_left_injective_iff_vecMul_injective E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalSemiring α] [Nonempty l]
  [inst_2 : Fintype m] {A : Matrix m n α},
  (Function.Injective fun B ↦ B * A) ↔ Function.Injective fun v ↦ Matrix.vecMul v A

theorem Matrix.isLeftRegular_iff_mulVec_injective E1 #

∀ {m : Type u_2} {α : Type v} [inst : NonUnitalSemiring α] [inst_1 : Fintype m] {A : Matrix m m α},
  IsLeftRegular A ↔ Function.Injective A.mulVec

theorem Matrix.isRightRegular_iff_vecMul_injective E1 #

∀ {m : Type u_2} {α : Type v} [inst : NonUnitalSemiring α] [inst_1 : Fintype m] {A : Matrix m m α},
  IsRightRegular A ↔ Function.Injective fun v ↦ Matrix.vecMul v A

theorem Matrix.mulVec_one E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonAssocSemiring α] [inst_1 : Fintype n] (A : Matrix m n α),
  A.mulVec 1 = ∑ j, A.transpose j

theorem Matrix.one_vecMul E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonAssocSemiring α] [inst_1 : Fintype m] (A : Matrix m n α),
  Matrix.vecMul 1 A = ∑ i, A i

theorem Matrix.ext_of_mulVec_single E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonAssocSemiring α] [inst_1 : DecidableEq n] [inst_2 : Fintype n]
  {M N : Matrix m n α}, (∀ (i : n), M.mulVec (Pi.single i 1) = N.mulVec (Pi.single i 1)) → M = N

theorem Matrix.ext_of_single_vecMul E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonAssocSemiring α] [inst_1 : DecidableEq m] [inst_2 : Fintype m]
  {M N : Matrix m n α}, (∀ (i : m), Matrix.vecMul (Pi.single i 1) M = Matrix.vecMul (Pi.single i 1) N) → M = N

theorem Matrix.mulVec_injective E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonAssocSemiring α] [inst_1 : Fintype n],
  Function.Injective Matrix.mulVec

theorem Matrix.ext_iff_mulVec E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonAssocSemiring α] [inst_1 : Fintype n] {A B : Matrix m n α},
  A = B ↔ ∀ (v : n → α), A.mulVec v = B.mulVec v

theorem Matrix.vecMul_injective E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonAssocSemiring α] [inst_1 : Fintype m],
  Function.Injective fun x v ↦ Matrix.vecMul v x

theorem Matrix.ext_iff_vecMul E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonAssocSemiring α] [inst_1 : Fintype m] {A B : Matrix m n α},
  A = B ↔ ∀ (v : m → α), Matrix.vecMul v A = Matrix.vecMul v B

theorem Matrix.one_mulVec E0 #

∀ {m : Type u_2} {α : Type v} [inst : NonAssocSemiring α] [inst_1 : Fintype m] [inst_2 : DecidableEq m] (v : m → α),
  Matrix.mulVec 1 v = v

theorem Matrix.vecMul_one E0 #

∀ {m : Type u_2} {α : Type v} [inst : NonAssocSemiring α] [inst_1 : Fintype m] [inst_2 : DecidableEq m] (v : m → α),
  Matrix.vecMul v 1 = v

theorem Matrix.diagonal_const_mulVec E0 #

∀ {m : Type u_2} {α : Type v} [inst : NonAssocSemiring α] [inst_1 : Fintype m] [inst_2 : DecidableEq m] (x : α)
  (v : m → α), (Matrix.diagonal fun x_1 ↦ x).mulVec v = x • v

theorem Matrix.vecMul_diagonal_const E0 #

∀ {m : Type u_2} {α : Type v} [inst : NonAssocSemiring α] [inst_1 : Fintype m] [inst_2 : DecidableEq m] (x : α)
  (v : m → α), Matrix.vecMul v (Matrix.diagonal fun x_1 ↦ x) = MulOpposite.op x • v

theorem Matrix.natCast_mulVec E0 #

∀ {m : Type u_2} {α : Type v} [inst : NonAssocSemiring α] [inst_1 : Fintype m] [inst_2 : DecidableEq m] (x : ℕ)
  (v : m → α), (↑x).mulVec v = ↑x • v

theorem Matrix.vecMul_natCast E0 #

∀ {m : Type u_2} {α : Type v} [inst : NonAssocSemiring α] [inst_1 : Fintype m] [inst_2 : DecidableEq m] (x : ℕ)
  (v : m → α), Matrix.vecMul v ↑x = MulOpposite.op ↑x • v

theorem Matrix.ofNat_mulVec E0 #

∀ {m : Type u_2} {α : Type v} [inst : NonAssocSemiring α] [inst_1 : Fintype m] [inst_2 : DecidableEq m] (x : ℕ)
  [inst_3 : x.AtLeastTwo] (v : m → α), (OfNat.ofNat x).mulVec v = OfNat.ofNat x • v

theorem Matrix.vecMul_ofNat E0 #

∀ {m : Type u_2} {α : Type v} [inst : NonAssocSemiring α] [inst_1 : Fintype m] [inst_2 : DecidableEq m] (x : ℕ)
  [inst_3 : x.AtLeastTwo] (v : m → α), Matrix.vecMul v (OfNat.ofNat x) = MulOpposite.op (OfNat.ofNat x) • v

theorem Matrix.neg_vecMul E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocRing α] [inst_1 : Fintype m] (v : m → α)
  (A : Matrix m n α), Matrix.vecMul (-v) A = -Matrix.vecMul v A

theorem Matrix.vecMul_neg E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocRing α] [inst_1 : Fintype m] (v : m → α)
  (A : Matrix m n α), Matrix.vecMul v (-A) = -Matrix.vecMul v A

theorem Matrix.neg_vecMul_neg E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocRing α] [inst_1 : Fintype m] (v : m → α)
  (A : Matrix m n α), Matrix.vecMul (-v) (-A) = Matrix.vecMul v A

theorem Matrix.neg_mulVec E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocRing α] [inst_1 : Fintype n] (v : n → α)
  (A : Matrix m n α), (-A).mulVec v = -A.mulVec v

theorem Matrix.mulVec_neg E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocRing α] [inst_1 : Fintype n] (v : n → α)
  (A : Matrix m n α), A.mulVec (-v) = -A.mulVec v

theorem Matrix.neg_mulVec_neg E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocRing α] [inst_1 : Fintype n] (v : n → α)
  (A : Matrix m n α), (-A).mulVec (-v) = A.mulVec v

theorem Matrix.mulVec_sub E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocRing α] [inst_1 : Fintype n] (A : Matrix m n α)
  (x y : n → α), A.mulVec (x - y) = A.mulVec x - A.mulVec y

theorem Matrix.sub_mulVec E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocRing α] [inst_1 : Fintype n] (A B : Matrix m n α)
  (x : n → α), (A - B).mulVec x = A.mulVec x - B.mulVec x

theorem Matrix.vecMul_sub E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocRing α] [inst_1 : Fintype m] (A B : Matrix m n α)
  (x : m → α), Matrix.vecMul x (A - B) = Matrix.vecMul x A - Matrix.vecMul x B

theorem Matrix.sub_vecMul E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocRing α] [inst_1 : Fintype m] (A : Matrix m n α)
  (x y : m → α), Matrix.vecMul (x - y) A = Matrix.vecMul x A - Matrix.vecMul y A

theorem Matrix.sub_vecMulVec E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocRing α] (w₁ w₂ : m → α) (v : n → α),
  Matrix.vecMulVec (w₁ - w₂) v = Matrix.vecMulVec w₁ v - Matrix.vecMulVec w₂ v

theorem Matrix.vecMulVec_sub E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalNonAssocRing α] (w : m → α) (v₁ v₂ : n → α),
  Matrix.vecMulVec w (v₁ - v₂) = Matrix.vecMulVec w v₁ - Matrix.vecMulVec w v₂

theorem Matrix.mulVec_transpose E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalCommSemiring α] [inst_1 : Fintype m] (A : Matrix m n α)
  (x : m → α), A.transpose.mulVec x = Matrix.vecMul x A

theorem Matrix.vecMul_transpose E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalCommSemiring α] [inst_1 : Fintype n] (A : Matrix m n α)
  (x : n → α), Matrix.vecMul x A.transpose = A.mulVec x

theorem Matrix.dotProduct_transpose_mulVec E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalCommSemiring α] [inst_1 : Fintype m] [inst_2 : Fintype n]
  (A : Matrix m n α) (x : n → α) (y : m → α), x ⬝ᵥ A.transpose.mulVec y = y ⬝ᵥ A.mulVec x

Bilinear form identity: x ⬝ᵥ Aᵀ *ᵥ y = y ⬝ᵥ A *ᵥ x for commutative semirings.

theorem Matrix.dotProduct_vecMul_transpose E1 #

∀ {m : Type u_2} {n : Type u_3} {α : Type v} [inst : NonUnitalCommSemiring α] [inst_1 : Fintype m] [inst_2 : Fintype n]
  (A : Matrix m n α) (x : n → α) (y : m → α), Matrix.vecMul x A.transpose ⬝ᵥ y = Matrix.vecMul y A ⬝ᵥ x

Bilinear form identity: (x ᵥ* Aᵀ) ⬝ᵥ y = (y ᵥ* A) ⬝ᵥ x for commutative semirings.

theorem Matrix.mulVec_vecMul E1 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : NonUnitalCommSemiring α] [inst_1 : Fintype n]
  [inst_2 : Fintype o] (A : Matrix m n α) (B : Matrix o n α) (x : o → α),
  A.mulVec (Matrix.vecMul x B) = (A * B.transpose).mulVec x

theorem Matrix.vecMul_mulVec E1 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : NonUnitalCommSemiring α] [inst_1 : Fintype m]
  [inst_2 : Fintype n] (A : Matrix m n α) (B : Matrix m o α) (x : n → α),
  Matrix.vecMul (A.mulVec x) B = Matrix.vecMul x (A.transpose * B)

theorem Matrix.dotProduct_diagonal_mul_mulVec E1 #

∀ {m : Type u_2} {α : Type v} [inst : NonUnitalCommSemiring α] [inst_1 : Fintype m] [inst_2 : DecidableEq m]
  (d x : m → α) (M : Matrix m m α), x ⬝ᵥ (Matrix.diagonal d * M).mulVec x = ∑ i, d i * (x i * M.mulVec x i)

theorem Matrix.mulVec_injective_of_isUnit E1 #

∀ {m : Type u_2} {R : Type u_5} [inst : Semiring R] [inst_1 : Fintype m] [inst_2 : DecidableEq m] {A : Matrix m m R},
  IsUnit A → Function.Injective A.mulVec

theorem Matrix.vecMul_injective_of_isUnit E1 #

∀ {m : Type u_2} {R : Type u_5} [inst : Semiring R] [inst_1 : Fintype m] [inst_2 : DecidableEq m] {A : Matrix m m R},
  IsUnit A → Function.Injective fun v ↦ Matrix.vecMul v A

theorem Matrix.pow_row_eq_zero_of_le E1 #

∀ {n : Type u_3} {R : Type u_5} [inst : Semiring R] [inst_1 : Fintype n] [inst_2 : DecidableEq n] {M : Matrix n n R}
  {k l : ℕ} {i : n}, (M ^ k).row i = 0 → k ≤ l → (M ^ l).row i = 0

theorem Matrix.pow_col_eq_zero_of_le E1 #

∀ {n : Type u_3} {R : Type u_5} [inst : Semiring R] [inst_1 : Fintype n] [inst_2 : DecidableEq n] {M : Matrix n n R}
  {k l : ℕ} {i : n}, (M ^ k).col i = 0 → k ≤ l → (M ^ l).col i = 0

theorem Matrix.intCast_mulVec E0 #

∀ {m : Type u_2} {α : Type v} [inst : NonAssocRing α] [inst_1 : Fintype m] [inst_2 : DecidableEq m] (x : ℤ) (v : m → α),
  (↑x).mulVec v = ↑x • v

theorem Matrix.vecMul_intCast E0 #

∀ {m : Type u_2} {α : Type v} [inst : NonAssocRing α] [inst_1 : Fintype m] [inst_2 : DecidableEq m] (x : ℤ) (v : m → α),
  Matrix.vecMul v ↑x = MulOpposite.op ↑x • v

theorem Matrix.transpose_mul E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [inst : AddCommMonoid α] [inst_1 : CommMagma α]
  [inst_2 : Fintype n] (M : Matrix m n α) (N : Matrix n l α), (M * N).transpose = N.transpose * M.transpose

theorem Matrix.submatrix_mul E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : Fintype n] [inst_1 : Fintype o]
  [inst_2 : Mul α] [inst_3 : AddCommMonoid α] {p : Type u_7} {q : Type u_8} (M : Matrix m n α) (N : Matrix n p α)
  (e₁ : l → m) (e₂ : o → n) (e₃ : q → p),
  Function.Bijective e₂ → (M * N).submatrix e₁ e₃ = M.submatrix e₁ e₂ * N.submatrix e₂ e₃

theorem Matrix.submatrix_mul_equiv E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : Fintype n] [inst_1 : Fintype o]
  [inst_2 : AddCommMonoid α] [inst_3 : Mul α] {p : Type u_7} {q : Type u_8} (M : Matrix m n α) (N : Matrix n p α)
  (e₁ : l → m) (e₂ : o ≃ n) (e₃ : q → p), M.submatrix e₁ ⇑e₂ * N.submatrix (⇑e₂) e₃ = (M * N).submatrix e₁ e₃

theorem Matrix.submatrix_mulVec_equiv E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : Fintype n] [inst_1 : Fintype o]
  [inst_2 : NonUnitalNonAssocSemiring α] (M : Matrix m n α) (v : o → α) (e₁ : l → m) (e₂ : o ≃ n),
  (M.submatrix e₁ ⇑e₂).mulVec v = M.mulVec (v ∘ ⇑e₂.symm) ∘ e₁

theorem Matrix.submatrix_id_mul_left E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : Fintype n] [inst_1 : Fintype o]
  [inst_2 : Mul α] [inst_3 : AddCommMonoid α] {p : Type u_7} (M : Matrix m n α) (N : Matrix o p α) (e₁ : l → m)
  (e₂ : n ≃ o), M.submatrix e₁ id * N.submatrix (⇑e₂) id = M.submatrix e₁ ⇑e₂.symm * N

theorem Matrix.submatrix_id_mul_right E0 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : Fintype n] [inst_1 : Fintype o]
  [inst_2 : Mul α] [inst_3 : AddCommMonoid α] {p : Type u_7} (M : Matrix m n α) (N : Matrix o p α) (e₁ : l → p)
  (e₂ : o ≃ n), M.submatrix id ⇑e₂ * N.submatrix id e₁ = M * N.submatrix (⇑e₂.symm) e₁

theorem Matrix.submatrix_vecMul_equiv E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : Fintype l] [inst_1 : Fintype m]
  [inst_2 : NonUnitalNonAssocSemiring α] (M : Matrix m n α) (v : l → α) (e₁ : l ≃ m) (e₂ : o → n),
  Matrix.vecMul v (M.submatrix (⇑e₁) e₂) = Matrix.vecMul (v ∘ ⇑e₁.symm) M ∘ e₂

theorem Matrix.mul_submatrix_one E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : Fintype n] [Finite o]
  [inst_2 : NonAssocSemiring α] [inst_3 : DecidableEq o] (e₁ : n ≃ o) (e₂ : l → o) (M : Matrix m n α),
  M * Matrix.submatrix 1 (⇑e₁) e₂ = M.submatrix id (⇑e₁.symm ∘ e₂)

theorem Matrix.one_submatrix_mul E1 #

∀ {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : Fintype m] [Finite o]
  [inst_2 : NonAssocSemiring α] [inst_3 : DecidableEq o] (e₁ : l → o) (e₂ : m ≃ o) (M : Matrix m n α),
  Matrix.submatrix 1 e₁ ⇑e₂ * M = M.submatrix (⇑e₂.symm ∘ e₁) id

theorem Matrix.submatrix_mul_transpose_submatrix E1 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [inst : Fintype n] [inst_1 : Fintype o]
  [inst_2 : AddCommMonoid α] [inst_3 : Mul α] (e : o ≃ n) (M : Matrix m n α),
  M.submatrix id ⇑e * M.transpose.submatrix (⇑e) id = M * M.transpose

instance Matrix.instIsDedekindFiniteMonoidOfIsStablyFiniteRing E0 #

∀ (n : Type u_8) (R : Type u_9) [inst : Fintype n] [inst_1 : DecidableEq n] [inst_2 : MulOne R]
  [inst_3 : AddCommMonoid R] [IsStablyFiniteRing R], IsDedekindFiniteMonoid (Matrix n n R)

theorem Matrix.mul_eq_one_comm_of_equiv E1 #

∀ {m : Type u_7} {n : Type u_8} {R : Type u_9} [inst : Fintype m] [inst_1 : DecidableEq m] [inst_2 : Fintype n]
  [inst_3 : DecidableEq n] [inst_4 : MulOne R] [inst_5 : AddCommMonoid R] [IsStablyFiniteRing R] {A : Matrix m n R}
  {B : Matrix n m R} (e : m ≃ n), A * B = 1 ↔ B * A = 1

A version of mul_eq_one_comm that works for square matrices with rectangular types.

theorem Matrix.mul_eq_one_comm_of_card_eq E0 #

∀ (m : Type u_7) (n : Type u_8) (R : Type u_9) [inst : Fintype m] [inst_1 : DecidableEq m] [inst_2 : Fintype n]
  [inst_3 : DecidableEq n] [inst_4 : MulOne R] [inst_5 : AddCommMonoid R] [IsStablyFiniteRing R] {A : Matrix m n R}
  {B : Matrix n m R}, Fintype.card m = Fintype.card n → (A * B = 1 ↔ B * A = 1)

theorem RingHom.map_matrix_mul E0 #

∀ {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} {β : Type w} [inst : Fintype n]
  [inst_1 : NonAssocSemiring α] [inst_2 : NonAssocSemiring β] (M : Matrix m n α) (N : Matrix n o α) (i : m) (j : o)
  (f : α →+* β), f ((M * N) i j) = (M.map ⇑f * N.map ⇑f) i j

theorem RingHom.map_dotProduct E0 #

∀ {n : Type u_3} {R : Type u_5} {S : Type u_6} [inst : Fintype n] [inst_1 : NonAssocSemiring R]
  [inst_2 : NonAssocSemiring S] (f : R →+* S) (v w : n → R), f (v ⬝ᵥ w) = ⇑f ∘ v ⬝ᵥ ⇑f ∘ w

theorem RingHom.map_vecMul E0 #

∀ {m : Type u_2} {n : Type u_3} {R : Type u_5} {S : Type u_6} [inst : Fintype n] [inst_1 : NonAssocSemiring R]
  [inst_2 : NonAssocSemiring S] (f : R →+* S) (M : Matrix n m R) (v : n → R) (i : m),
  f (Matrix.vecMul v M i) = Matrix.vecMul (⇑f ∘ v) (M.map ⇑f) i

theorem RingHom.map_mulVec E0 #

∀ {m : Type u_2} {n : Type u_3} {R : Type u_5} {S : Type u_6} [inst : Fintype n] [inst_1 : NonAssocSemiring R]
  [inst_2 : NonAssocSemiring S] (f : R →+* S) (M : Matrix m n R) (v : n → R) (i : m),
  f (M.mulVec v i) = (M.map ⇑f).mulVec (⇑f ∘ v) i