# Matrices #

This file defines basic properties of matrices.

Matrices with rows indexed by m, columns indexed by n, and entries of type α are represented with Matrix m n α. For the typical approach of counting rows and columns, Matrix (Fin m) (Fin n) α can be used.

## Notation #

The locale Matrix gives the following notation:

• ⬝ᵥ for Matrix.dotProduct
• *ᵥ for Matrix.mulVec
• ᵥ* for Matrix.vecMul
• ᵀ for Matrix.transpose
• ᴴ 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.

def Matrix (m : Type u) (n : Type u') (α : Type v) :
Type (max u u' v)

Matrix m n R is the type of matrices with entries in R, whose rows are indexed by m and whose columns are indexed by n.

Equations
Instances For
theorem Matrix.ext_iff {m : Type u_2} {n : Type u_3} {α : Type v} {M : Matrix m n α} {N : Matrix m n α} :
(∀ (i : m) (j : n), M i j = N i j) M = N
theorem Matrix.ext {m : Type u_2} {n : Type u_3} {α : Type v} {M : Matrix m n α} {N : Matrix m n α} :
(∀ (i : m) (j : n), M i j = N i j)M = N
def Matrix.of {m : Type u_2} {n : Type u_3} {α : Type v} :
(mnα) Matrix m n α

Cast a function into a matrix.

The two sides of the equivalence are definitionally equal types. We want to use an explicit cast to distinguish the types because Matrix has different instances to pi types (such as Pi.mul, which performs elementwise multiplication, vs Matrix.mul).

If you are defining a matrix, in terms of its entries, use of (fun i j ↦ _). The purpose of this approach is to ensure that terms of the form (fun i j ↦ _) * (fun i j ↦ _) do not appear, as the type of * can be misleading.

Porting note: In Lean 3, it is also safe to use pattern matching in a definition as | i j := _, which can only be unfolded when fully-applied. leanprover/lean4#2042 means this does not (currently) work in Lean 4.

Equations
Instances For
@[simp]
theorem Matrix.of_apply {m : Type u_2} {n : Type u_3} {α : Type v} (f : mnα) (i : m) (j : n) :
Matrix.of f i j = f i j
@[simp]
theorem Matrix.of_symm_apply {m : Type u_2} {n : Type u_3} {α : Type v} (f : Matrix m n α) (i : m) (j : n) :
Matrix.of.symm f i j = f i j
def Matrix.map {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} (M : Matrix m n α) (f : αβ) :
Matrix m n β

M.map f is the matrix obtained by applying f to each entry of the matrix M.

This is available in bundled forms as:

• AddMonoidHom.mapMatrix
• LinearMap.mapMatrix
• RingHom.mapMatrix
• AlgHom.mapMatrix
• Equiv.mapMatrix
• AddEquiv.mapMatrix
• LinearEquiv.mapMatrix
• RingEquiv.mapMatrix
• AlgEquiv.mapMatrix
Equations
• = Matrix.of fun (i : m) (j : n) => f (M i j)
Instances For
@[simp]
theorem Matrix.map_apply {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} {M : Matrix m n α} {f : αβ} {i : m} {j : n} :
Matrix.map M f i j = f (M i j)
@[simp]
theorem Matrix.map_id {m : Type u_2} {n : Type u_3} {α : Type v} (M : Matrix m n α) :
Matrix.map M id = M
@[simp]
theorem Matrix.map_id' {m : Type u_2} {n : Type u_3} {α : Type v} (M : Matrix m n α) :
(Matrix.map M fun (x : α) => x) = M
@[simp]
theorem Matrix.map_map {m : Type u_2} {n : Type u_3} {α : Type v} {M : Matrix m n α} {β : Type u_10} {γ : Type u_11} {f : αβ} {g : βγ} :
Matrix.map () g = Matrix.map M (g f)
theorem Matrix.map_injective {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} {f : αβ} (hf : ) :
Function.Injective fun (M : Matrix m n α) =>
def Matrix.transpose {m : Type u_2} {n : Type u_3} {α : Type v} (M : Matrix m n α) :
Matrix n m α

The transpose of a matrix.

Equations
• = Matrix.of fun (x : n) (y : m) => M y x
Instances For
@[simp]
theorem Matrix.transpose_apply {m : Type u_2} {n : Type u_3} {α : Type v} (M : Matrix m n α) (i : n) (j : m) :
= M j i

The transpose of a matrix.

Equations
Instances For
def Matrix.conjTranspose {m : Type u_2} {n : Type u_3} {α : Type v} [Star α] (M : Matrix m n α) :
Matrix n m α

The conjugate transpose of a matrix defined in term of star.

Equations
Instances For

The conjugate transpose of a matrix defined in term of star.

Equations
Instances For
instance Matrix.inhabited {m : Type u_2} {n : Type u_3} {α : Type v} [] :
Inhabited (Matrix m n α)
Equations
• Matrix.inhabited =
instance Matrix.decidableEq {m : Type u_2} {n : Type u_3} {α : Type v} [] [] [] :
Equations
• Matrix.decidableEq = Fintype.decidablePiFintype
instance Matrix.instFintypeMatrix {n : Type u_10} {m : Type u_11} [] [] [] [] (α : Type u_12) [] :
Fintype (Matrix m n α)
Equations
instance Matrix.instFiniteMatrix {n : Type u_10} {m : Type u_11} [] [] (α : Type u_12) [] :
Finite (Matrix m n α)
Equations
• =
instance Matrix.add {m : Type u_2} {n : Type u_3} {α : Type v} [Add α] :
Equations
instance Matrix.addSemigroup {m : Type u_2} {n : Type u_3} {α : Type v} [] :
Equations
instance Matrix.addCommSemigroup {m : Type u_2} {n : Type u_3} {α : Type v} [] :
Equations
instance Matrix.zero {m : Type u_2} {n : Type u_3} {α : Type v} [Zero α] :
Zero (Matrix m n α)
Equations
• Matrix.zero = Pi.instZero
instance Matrix.addZeroClass {m : Type u_2} {n : Type u_3} {α : Type v} [] :
Equations
instance Matrix.addMonoid {m : Type u_2} {n : Type u_3} {α : Type v} [] :
Equations
instance Matrix.addCommMonoid {m : Type u_2} {n : Type u_3} {α : Type v} [] :
Equations
instance Matrix.neg {m : Type u_2} {n : Type u_3} {α : Type v} [Neg α] :
Neg (Matrix m n α)
Equations
• Matrix.neg = Pi.instNeg
instance Matrix.sub {m : Type u_2} {n : Type u_3} {α : Type v} [Sub α] :
Sub (Matrix m n α)
Equations
• Matrix.sub = Pi.instSub
instance Matrix.addGroup {m : Type u_2} {n : Type u_3} {α : Type v} [] :
Equations
instance Matrix.addCommGroup {m : Type u_2} {n : Type u_3} {α : Type v} [] :
Equations
instance Matrix.unique {m : Type u_2} {n : Type u_3} {α : Type v} [] :
Unique (Matrix m n α)
Equations
• Matrix.unique = Pi.unique
instance Matrix.subsingleton {m : Type u_2} {n : Type u_3} {α : Type v} [] :
Equations
• =
instance Matrix.nonempty {m : Type u_2} {n : Type u_3} {α : Type v} [] [] [] :
Equations
• =
instance Matrix.smul {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [SMul R α] :
SMul R (Matrix m n α)
Equations
• Matrix.smul = Pi.instSMul
instance Matrix.smulCommClass {m : Type u_2} {n : Type u_3} {R : Type u_7} {S : Type u_8} {α : Type v} [SMul R α] [SMul S α] [] :
SMulCommClass R S (Matrix m n α)
Equations
• =
instance Matrix.isScalarTower {m : Type u_2} {n : Type u_3} {R : Type u_7} {S : Type u_8} {α : Type v} [SMul R S] [SMul R α] [SMul S α] [] :
IsScalarTower R S (Matrix m n α)
Equations
• =
instance Matrix.isCentralScalar {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [SMul R α] [SMul Rᵐᵒᵖ α] [] :
Equations
• =
instance Matrix.mulAction {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [] [] :
MulAction R (Matrix m n α)
Equations
• Matrix.mulAction =
instance Matrix.distribMulAction {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [] [] [] :
Equations
• Matrix.distribMulAction =
instance Matrix.module {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [] [] [Module R α] :
Module R (Matrix m n α)
Equations
• Matrix.module = Pi.module m (fun (a : m) => nα) R
@[simp]
theorem Matrix.zero_apply {m : Type u_2} {n : Type u_3} {α : Type v} [Zero α] (i : m) (j : n) :
0 i j = 0
@[simp]
theorem Matrix.add_apply {m : Type u_2} {n : Type u_3} {α : Type v} [Add α] (A : Matrix m n α) (B : Matrix m n α) (i : m) (j : n) :
(A + B) i j = A i j + B i j
@[simp]
theorem Matrix.smul_apply {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [SMul β α] (r : β) (A : Matrix m n α) (i : m) (j : n) :
(r A) i j = r A i j
@[simp]
theorem Matrix.sub_apply {m : Type u_2} {n : Type u_3} {α : Type v} [Sub α] (A : Matrix m n α) (B : Matrix m n α) (i : m) (j : n) :
(A - B) i j = A i j - B i j
@[simp]
theorem Matrix.neg_apply {m : Type u_2} {n : Type u_3} {α : Type v} [Neg α] (A : Matrix m n α) (i : m) (j : n) :
(-A) i j = -A i j

simp-normal form pulls of to the outside.

@[simp]
theorem Matrix.of_zero {m : Type u_2} {n : Type u_3} {α : Type v} [Zero α] :
Matrix.of 0 = 0
@[simp]
theorem Matrix.of_add_of {m : Type u_2} {n : Type u_3} {α : Type v} [Add α] (f : mnα) (g : mnα) :
Matrix.of f + Matrix.of g = Matrix.of (f + g)
@[simp]
theorem Matrix.of_sub_of {m : Type u_2} {n : Type u_3} {α : Type v} [Sub α] (f : mnα) (g : mnα) :
Matrix.of f - Matrix.of g = Matrix.of (f - g)
@[simp]
theorem Matrix.neg_of {m : Type u_2} {n : Type u_3} {α : Type v} [Neg α] (f : mnα) :
-Matrix.of f = Matrix.of (-f)
@[simp]
theorem Matrix.smul_of {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [SMul R α] (r : R) (f : mnα) :
r Matrix.of f = Matrix.of (r f)
@[simp]
theorem Matrix.map_zero {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [Zero α] [Zero β] (f : αβ) (h : f 0 = 0) :
= 0
theorem Matrix.map_add {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [Add α] [Add β] (f : αβ) (hf : ∀ (a₁ a₂ : α), f (a₁ + a₂) = f a₁ + f a₂) (M : Matrix m n α) (N : Matrix m n α) :
Matrix.map (M + N) f = +
theorem Matrix.map_sub {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [Sub α] [Sub β] (f : αβ) (hf : ∀ (a₁ a₂ : α), f (a₁ - a₂) = f a₁ - f a₂) (M : Matrix m n α) (N : Matrix m n α) :
Matrix.map (M - N) f = -
theorem Matrix.map_smul {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} {β : Type w} [SMul R α] [SMul R β] (f : αβ) (r : R) (hf : ∀ (a : α), f (r a) = r f a) (M : Matrix m n α) :
Matrix.map (r M) f = r
theorem Matrix.map_smul' {n : Type u_3} {α : Type v} {β : Type w} [Mul α] [Mul β] (f : αβ) (r : α) (A : Matrix n n α) (hf : ∀ (a₁ a₂ : α), f (a₁ * a₂) = f a₁ * f a₂) :
Matrix.map (r A) f = f r

The scalar action via Mul.toSMul is transformed by the same map as the elements of the matrix, when f preserves multiplication.

theorem Matrix.map_op_smul' {n : Type u_3} {α : Type v} {β : Type w} [Mul α] [Mul β] (f : αβ) (r : α) (A : Matrix n n α) (hf : ∀ (a₁ a₂ : α), f (a₁ * a₂) = f a₁ * f a₂) :

The scalar action via mul.toOppositeSMul is transformed by the same map as the elements of the matrix, when f preserves multiplication.

theorem IsSMulRegular.matrix {m : Type u_2} {n : Type u_3} {R : Type u_7} {S : Type u_8} [SMul R S] {k : R} (hk : ) :
theorem IsLeftRegular.matrix {m : Type u_2} {n : Type u_3} {α : Type v} [Mul α] {k : α} (hk : ) :
instance Matrix.subsingleton_of_empty_left {m : Type u_2} {n : Type u_3} {α : Type v} [] :
Equations
• =
instance Matrix.subsingleton_of_empty_right {m : Type u_2} {n : Type u_3} {α : Type v} [] :
Equations
• =
def Matrix.diagonal {n : Type u_3} {α : Type v} [] [Zero α] (d : nα) :
Matrix n n α

diagonal d is the square matrix such that (diagonal d) i i = d i and (diagonal d) i j = 0 if i ≠ j.

Note that bundled versions exist as:

• Matrix.diagonalAddMonoidHom
• Matrix.diagonalLinearMap
• Matrix.diagonalRingHom
• Matrix.diagonalAlgHom
Equations
• = Matrix.of fun (i j : n) => if i = j then d i else 0
Instances For
theorem Matrix.diagonal_apply {n : Type u_3} {α : Type v} [] [Zero α] (d : nα) (i : n) (j : n) :
= if i = j then d i else 0
@[simp]
theorem Matrix.diagonal_apply_eq {n : Type u_3} {α : Type v} [] [Zero α] (d : nα) (i : n) :
= d i
@[simp]
theorem Matrix.diagonal_apply_ne {n : Type u_3} {α : Type v} [] [Zero α] (d : nα) {i : n} {j : n} (h : i j) :
= 0
theorem Matrix.diagonal_apply_ne' {n : Type u_3} {α : Type v} [] [Zero α] (d : nα) {i : n} {j : n} (h : j i) :
= 0
@[simp]
theorem Matrix.diagonal_eq_diagonal_iff {n : Type u_3} {α : Type v} [] [Zero α] {d₁ : nα} {d₂ : nα} :
∀ (i : n), d₁ i = d₂ i
theorem Matrix.diagonal_injective {n : Type u_3} {α : Type v} [] [Zero α] :
Function.Injective Matrix.diagonal
@[simp]
theorem Matrix.diagonal_zero {n : Type u_3} {α : Type v} [] [Zero α] :
(Matrix.diagonal fun (x : n) => 0) = 0
@[simp]
theorem Matrix.diagonal_transpose {n : Type u_3} {α : Type v} [] [Zero α] (v : nα) :
@[simp]
theorem Matrix.diagonal_add {n : Type u_3} {α : Type v} [] [] (d₁ : nα) (d₂ : nα) :
= Matrix.diagonal fun (i : n) => d₁ i + d₂ i
@[simp]
theorem Matrix.diagonal_smul {n : Type u_3} {R : Type u_7} {α : Type v} [] [Zero α] [] (r : R) (d : nα) :
@[simp]
theorem Matrix.diagonal_neg {n : Type u_3} {α : Type v} [] [] (d : nα) :
= Matrix.diagonal fun (i : n) => -d i
@[simp]
theorem Matrix.diagonal_sub {n : Type u_3} {α : Type v} [] [] (d₁ : nα) (d₂ : nα) :
= Matrix.diagonal fun (i : n) => d₁ i - d₂ i
instance Matrix.instNatCastMatrix {n : Type u_3} {α : Type v} [] [Zero α] [] :
NatCast (Matrix n n α)
Equations
theorem Matrix.diagonal_natCast {n : Type u_3} {α : Type v} [] [Zero α] [] (m : ) :
(Matrix.diagonal fun (x : n) => m) = m
theorem Matrix.diagonal_natCast' {n : Type u_3} {α : Type v} [] [Zero α] [] (m : ) :
= m
theorem Matrix.diagonal_ofNat {n : Type u_3} {α : Type v} [] [Zero α] [] (m : ) [] :
(Matrix.diagonal fun (x : n) => ) =
theorem Matrix.diagonal_ofNat' {n : Type u_3} {α : Type v} [] [Zero α] [] (m : ) [] :
instance Matrix.instIntCastMatrix {n : Type u_3} {α : Type v} [] [Zero α] [] :
IntCast (Matrix n n α)
Equations
theorem Matrix.diagonal_intCast {n : Type u_3} {α : Type v} [] [Zero α] [] (m : ) :
(Matrix.diagonal fun (x : n) => m) = m
theorem Matrix.diagonal_intCast' {n : Type u_3} {α : Type v} [] [Zero α] [] (m : ) :
= m
@[simp]
theorem Matrix.diagonalAddMonoidHom_apply (n : Type u_3) (α : Type v) [] [] (d : nα) :
def Matrix.diagonalAddMonoidHom (n : Type u_3) (α : Type v) [] [] :
(nα) →+ Matrix n n α

Matrix.diagonal as an AddMonoidHom.

Equations
• = { toZeroHom := { toFun := Matrix.diagonal, map_zero' := }, map_add' := }
Instances For
@[simp]
theorem Matrix.diagonalLinearMap_apply (n : Type u_3) (R : Type u_7) (α : Type v) [] [] [] [Module R α] :
∀ (a : nα), () a = .toFun a
def Matrix.diagonalLinearMap (n : Type u_3) (R : Type u_7) (α : Type v) [] [] [] [Module R α] :
(nα) →ₗ[R] Matrix n n α

Matrix.diagonal as a LinearMap.

Equations
• = let __src := ; { toAddHom := { toFun := __src.toFun, map_add' := }, map_smul' := }
Instances For
@[simp]
theorem Matrix.diagonal_map {n : Type u_3} {α : Type v} {β : Type w} [] [Zero α] [Zero β] {f : αβ} (h : f 0 = 0) {d : nα} :
= Matrix.diagonal fun (m : n) => f (d m)
@[simp]
theorem Matrix.diagonal_conjTranspose {n : Type u_3} {α : Type v} [] [] [] (v : nα) :
instance Matrix.one {n : Type u_3} {α : Type v} [] [Zero α] [One α] :
One (Matrix n n α)
Equations
@[simp]
theorem Matrix.diagonal_one {n : Type u_3} {α : Type v} [] [Zero α] [One α] :
(Matrix.diagonal fun (x : n) => 1) = 1
theorem Matrix.one_apply {n : Type u_3} {α : Type v} [] [Zero α] [One α] {i : n} {j : n} :
1 i j = if i = j then 1 else 0
@[simp]
theorem Matrix.one_apply_eq {n : Type u_3} {α : Type v} [] [Zero α] [One α] (i : n) :
1 i i = 1
@[simp]
theorem Matrix.one_apply_ne {n : Type u_3} {α : Type v} [] [Zero α] [One α] {i : n} {j : n} :
i j1 i j = 0
theorem Matrix.one_apply_ne' {n : Type u_3} {α : Type v} [] [Zero α] [One α] {i : n} {j : n} :
j i1 i j = 0
@[simp]
theorem Matrix.map_one {n : Type u_3} {α : Type v} {β : Type w} [] [Zero α] [One α] [Zero β] [One β] (f : αβ) (h₀ : f 0 = 0) (h₁ : f 1 = 1) :
= 1
theorem Matrix.one_eq_pi_single {n : Type u_3} {α : Type v} [] [Zero α] [One α] {i : n} {j : n} :
1 i j = Pi.single i 1 j
instance Matrix.instAddMonoidWithOne {n : Type u_3} {α : Type v} [] [] :
Equations
instance Matrix.instAddGroupWithOne {n : Type u_3} {α : Type v} [] [] :
Equations
instance Matrix.instAddCommMonoidWithOne {n : Type u_3} {α : Type v} [] :
Equations
instance Matrix.instAddCommGroupWithOne {n : Type u_3} {α : Type v} [] :
Equations
@[simp, deprecated]
theorem Matrix.bit0_apply {m : Type u_2} {α : Type v} [Add α] (M : Matrix m m α) (i : m) (j : m) :
bit0 M i j = bit0 (M i j)
@[deprecated]
theorem Matrix.bit1_apply {n : Type u_3} {α : Type v} [] [] [One α] (M : Matrix n n α) (i : n) (j : n) :
bit1 M i j = if i = j then bit1 (M i j) else bit0 (M i j)
@[simp, deprecated]
theorem Matrix.bit1_apply_eq {n : Type u_3} {α : Type v} [] [] [One α] (M : Matrix n n α) (i : n) :
bit1 M i i = bit1 (M i i)
@[simp, deprecated]
theorem Matrix.bit1_apply_ne {n : Type u_3} {α : Type v} [] [] [One α] (M : Matrix n n α) {i : n} {j : n} (h : i j) :
bit1 M i j = bit0 (M i j)
def Matrix.diag {n : Type u_3} {α : Type v} (A : Matrix n n α) (i : n) :
α

The diagonal of a square matrix.

Equations
• = A i i
Instances For
@[simp]
theorem Matrix.diag_apply {n : Type u_3} {α : Type v} (A : Matrix n n α) (i : n) :
= A i i
@[simp]
theorem Matrix.diag_diagonal {n : Type u_3} {α : Type v} [] [Zero α] (a : nα) :
@[simp]
theorem Matrix.diag_transpose {n : Type u_3} {α : Type v} (A : Matrix n n α) :
@[simp]
theorem Matrix.diag_zero {n : Type u_3} {α : Type v} [Zero α] :
= 0
@[simp]
theorem Matrix.diag_add {n : Type u_3} {α : Type v} [Add α] (A : Matrix n n α) (B : Matrix n n α) :
Matrix.diag (A + B) =
@[simp]
theorem Matrix.diag_sub {n : Type u_3} {α : Type v} [Sub α] (A : Matrix n n α) (B : Matrix n n α) :
Matrix.diag (A - B) =
@[simp]
theorem Matrix.diag_neg {n : Type u_3} {α : Type v} [Neg α] (A : Matrix n n α) :
@[simp]
theorem Matrix.diag_smul {n : Type u_3} {R : Type u_7} {α : Type v} [SMul R α] (r : R) (A : Matrix n n α) :
Matrix.diag (r A) = r
@[simp]
theorem Matrix.diag_one {n : Type u_3} {α : Type v} [] [Zero α] [One α] :
= 1
@[simp]
theorem Matrix.diagAddMonoidHom_apply (n : Type u_3) (α : Type v) [] (A : Matrix n n α) (i : n) :
() A i =
def Matrix.diagAddMonoidHom (n : Type u_3) (α : Type v) [] :
Matrix n n α →+ nα

Matrix.diag as an AddMonoidHom.

Equations
• = { toZeroHom := { toFun := Matrix.diag, map_zero' := }, map_add' := }
Instances For
@[simp]
theorem Matrix.diagLinearMap_apply (n : Type u_3) (R : Type u_7) (α : Type v) [] [] [Module R α] :
∀ (a : Matrix n n α) (a_1 : n), () a a_1 = ().toFun a a_1
def Matrix.diagLinearMap (n : Type u_3) (R : Type u_7) (α : Type v) [] [] [Module R α] :
Matrix n n α →ₗ[R] nα

Matrix.diag as a LinearMap.

Equations
• = let __src := ; { toAddHom := { toFun := __src.toFun, map_add' := }, map_smul' := }
Instances For
theorem Matrix.diag_map {n : Type u_3} {α : Type v} {β : Type w} {f : αβ} {A : Matrix n n α} :
@[simp]
theorem Matrix.diag_conjTranspose {n : Type u_3} {α : Type v} [] [] (A : Matrix n n α) :
@[simp]
theorem Matrix.diag_list_sum {n : Type u_3} {α : Type v} [] (l : List (Matrix n n α)) :
= List.sum (List.map Matrix.diag l)
@[simp]
theorem Matrix.diag_multiset_sum {n : Type u_3} {α : Type v} [] (s : Multiset (Matrix n n α)) :
= Multiset.sum (Multiset.map Matrix.diag s)
@[simp]
theorem Matrix.diag_sum {n : Type u_3} {α : Type v} {ι : Type u_10} [] (s : ) (f : ιMatrix n n α) :
Matrix.diag (Finset.sum s fun (i : ι) => f i) = Finset.sum s fun (i : ι) => Matrix.diag (f i)
def Matrix.dotProduct {m : Type u_2} {α : Type v} [] [Mul α] [] (v : mα) (w : mα) :
α

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

Equations
Instances For

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

Equations
Instances For
theorem Matrix.dotProduct_assoc {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (u : mα) (w : nα) (v : Matrix m n α) :
Matrix.dotProduct (fun (j : n) => Matrix.dotProduct u fun (i : m) => v i j) w = Matrix.dotProduct u fun (i : m) => Matrix.dotProduct (v i) w
theorem Matrix.dotProduct_comm {m : Type u_2} {α : Type v} [] [] [] (v : mα) (w : mα) :
@[simp]
theorem Matrix.dotProduct_pUnit {α : Type v} [] [Mul α] (v : ) (w : ) :
=
theorem Matrix.dotProduct_one {n : Type u_3} {α : Type v} [] [] [] (v : nα) :
= Finset.sum Finset.univ fun (i : n) => v i
theorem Matrix.one_dotProduct {n : Type u_3} {α : Type v} [] [] [] (v : nα) :
= Finset.sum Finset.univ fun (i : n) => v i
@[simp]
theorem Matrix.dotProduct_zero {m : Type u_2} {α : Type v} [] (v : mα) :
= 0
@[simp]
theorem Matrix.dotProduct_zero' {m : Type u_2} {α : Type v} [] (v : mα) :
(Matrix.dotProduct v fun (x : m) => 0) = 0
@[simp]
theorem Matrix.zero_dotProduct {m : Type u_2} {α : Type v} [] (v : mα) :
= 0
@[simp]
theorem Matrix.zero_dotProduct' {m : Type u_2} {α : Type v} [] (v : mα) :
Matrix.dotProduct (fun (x : m) => 0) v = 0
@[simp]
theorem Matrix.add_dotProduct {m : Type u_2} {α : Type v} [] (u : mα) (v : mα) (w : mα) :
@[simp]
theorem Matrix.dotProduct_add {m : Type u_2} {α : Type v} [] (u : mα) (v : mα) (w : mα) :
@[simp]
theorem Matrix.sum_elim_dotProduct_sum_elim {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (u : mα) (v : mα) (x : nα) (y : nα) :
@[simp]
theorem Matrix.comp_equiv_symm_dotProduct {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (u : mα) (x : nα) (e : m n) :
Matrix.dotProduct (u e.symm) x = Matrix.dotProduct u (x e)

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

@[simp]
theorem Matrix.dotProduct_comp_equiv_symm {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (u : mα) (x : nα) (e : n m) :
Matrix.dotProduct u (x e.symm) = Matrix.dotProduct (u e) x

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

@[simp]
theorem Matrix.comp_equiv_dotProduct_comp_equiv {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (x : nα) (y : nα) (e : m n) :
Matrix.dotProduct (x e) (y e) =

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

@[simp]
theorem Matrix.diagonal_dotProduct {m : Type u_2} {α : Type v} [] [] (v : mα) (w : mα) (i : m) :
= v i * w i
@[simp]
theorem Matrix.dotProduct_diagonal {m : Type u_2} {α : Type v} [] [] (v : mα) (w : mα) (i : m) :
= v i * w i
@[simp]
theorem Matrix.dotProduct_diagonal' {m : Type u_2} {α : Type v} [] [] (v : mα) (w : mα) (i : m) :
(Matrix.dotProduct v fun (j : m) => ) = v i * w i
@[simp]
theorem Matrix.single_dotProduct {m : Type u_2} {α : Type v} [] [] (v : mα) (x : α) (i : m) :
Matrix.dotProduct () v = x * v i
@[simp]
theorem Matrix.dotProduct_single {m : Type u_2} {α : Type v} [] [] (v : mα) (x : α) (i : m) :
Matrix.dotProduct v () = v i * x
@[simp]
theorem Matrix.one_dotProduct_one {n : Type u_3} {α : Type v} [] [] :
= ()
@[simp]
theorem Matrix.neg_dotProduct {m : Type u_2} {α : Type v} [] (v : mα) (w : mα) :
=
@[simp]
theorem Matrix.dotProduct_neg {m : Type u_2} {α : Type v} [] (v : mα) (w : mα) :
=
@[simp]
theorem Matrix.sub_dotProduct {m : Type u_2} {α : Type v} [] (u : mα) (v : mα) (w : mα) :
@[simp]
theorem Matrix.dotProduct_sub {m : Type u_2} {α : Type v} [] (u : mα) (v : mα) (w : mα) :
@[simp]
theorem Matrix.smul_dotProduct {m : Type u_2} {R : Type u_7} {α : Type v} [] [] [Mul α] [] [] [] (x : R) (v : mα) (w : mα) :
@[simp]
theorem Matrix.dotProduct_smul {m : Type u_2} {R : Type u_7} {α : Type v} [] [] [Mul α] [] [] [] (x : R) (v : mα) (w : mα) :
theorem Matrix.star_dotProduct_star {m : Type u_2} {α : Type v} [] [] (v : mα) (w : mα) :
theorem Matrix.star_dotProduct {m : Type u_2} {α : Type v} [] [] (v : mα) (w : mα) :
= star ()
theorem Matrix.dotProduct_star {m : Type u_2} {α : Type v} [] [] (v : mα) (w : mα) :
= star ()
@[defaultInstance 100]
instance Matrix.instHMulMatrixMatrixMatrix {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [] [Mul α] [] :
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.

Equations
• Matrix.instHMulMatrixMatrixMatrix = { hMul := fun (M : Matrix l m α) (N : Matrix m n α) (i : l) (k : n) => Matrix.dotProduct (fun (j : m) => M i j) fun (j : m) => N j k }
theorem Matrix.mul_apply {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [] [Mul α] [] {M : Matrix l m α} {N : Matrix m n α} {i : l} {k : n} :
(M * N) i k = Finset.sum Finset.univ fun (j : m) => M i j * N j k
instance Matrix.instMulMatrix {n : Type u_3} {α : Type v} [] [Mul α] [] :
Mul (Matrix n n α)
Equations
• Matrix.instMulMatrix = { mul := fun (M N : Matrix n n α) => M * N }
theorem Matrix.mul_apply' {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [] [Mul α] [] {M : Matrix l m α} {N : Matrix m n α} {i : l} {k : n} :
(M * N) i k = Matrix.dotProduct (fun (j : m) => M i j) fun (j : m) => N j k
theorem Matrix.sum_apply {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [] (i : m) (j : n) (s : ) (g : βMatrix m n α) :
Finset.sum s (fun (c : β) => g c) i j = Finset.sum s fun (c : β) => g c i j
theorem Matrix.two_mul_expl {R : Type u_10} [] (A : Matrix (Fin 2) (Fin 2) R) (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
@[simp]
theorem Matrix.smul_mul {l : Type u_1} {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [] [Mul α] [] [] [] [] (a : R) (M : Matrix m n α) (N : Matrix n l α) :
a M * N = a (M * N)
@[simp]
theorem Matrix.mul_smul {l : Type u_1} {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [] [Mul α] [] [] [] [] (M : Matrix m n α) (a : R) (N : Matrix n l α) :
M * a N = a (M * N)
@[simp]
theorem Matrix.mul_zero {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [] (M : Matrix m n α) :
M * 0 = 0
@[simp]
theorem Matrix.zero_mul {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [] (M : Matrix m n α) :
0 * M = 0
theorem Matrix.mul_add {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [] (L : Matrix m n α) (M : Matrix n o α) (N : Matrix n o α) :
L * (M + N) = L * M + L * N
theorem Matrix.add_mul {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [] (L : Matrix l m α) (M : Matrix l m α) (N : Matrix m n α) :
(L + M) * N = L * N + M * N
Equations
• Matrix.nonUnitalNonAssocSemiring = let __src := Matrix.addCommMonoid;
@[simp]
theorem Matrix.diagonal_mul {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (d : mα) (M : Matrix m n α) (i : m) (j : n) :
() i j = d i * M i j
@[simp]
theorem Matrix.mul_diagonal {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (d : nα) (M : Matrix m n α) (i : m) (j : n) :
() i j = M i j * d j
@[simp]
theorem Matrix.diagonal_mul_diagonal {n : Type u_3} {α : Type v} [] [] (d₁ : nα) (d₂ : nα) :
= Matrix.diagonal fun (i : n) => d₁ i * d₂ i
theorem Matrix.diagonal_mul_diagonal' {n : Type u_3} {α : Type v} [] [] (d₁ : nα) (d₂ : nα) :
= Matrix.diagonal fun (i : n) => d₁ i * d₂ i
theorem Matrix.smul_eq_diagonal_mul {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (M : Matrix m n α) (a : α) :
a M = (Matrix.diagonal fun (x : m) => a) * M
theorem Matrix.op_smul_eq_mul_diagonal {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (M : Matrix m n α) (a : α) :
= M * Matrix.diagonal fun (x : n) => a
@[simp]
theorem Matrix.addMonoidHomMulLeft_apply {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [] (M : Matrix l m α) (x : Matrix m n α) :
= M * x
def Matrix.addMonoidHomMulLeft {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [] (M : Matrix l m α) :
Matrix m n α →+ Matrix l n α

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

Equations
• = { toZeroHom := { toFun := fun (x : Matrix m n α) => M * x, map_zero' := }, map_add' := }
Instances For
@[simp]
theorem Matrix.addMonoidHomMulRight_apply {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [] (M : Matrix m n α) (x : Matrix l m α) :
= x * M
def Matrix.addMonoidHomMulRight {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [] (M : Matrix m n α) :
Matrix l m α →+ Matrix l n α

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

Equations
• = { toZeroHom := { toFun := fun (x : Matrix l m α) => x * M, map_zero' := }, map_add' := }
Instances For
theorem Matrix.sum_mul {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [] (s : ) (f : βMatrix l m α) (M : Matrix m n α) :
(Finset.sum s fun (a : β) => f a) * M = Finset.sum s fun (a : β) => f a * M
theorem Matrix.mul_sum {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [] (s : ) (f : βMatrix m n α) (M : Matrix l m α) :
(M * Finset.sum s fun (a : β) => f a) = Finset.sum s fun (a : β) => M * f a
instance Matrix.Semiring.isScalarTower {n : Type u_3} {R : Type u_7} {α : Type v} [] [] [] [] :
IsScalarTower R (Matrix n n α) (Matrix n n α)

This instance enables use with smul_mul_assoc.

Equations
• =
instance Matrix.Semiring.smulCommClass {n : Type u_3} {R : Type u_7} {α : Type v} [] [] [] [] :
SMulCommClass R (Matrix n n α) (Matrix n n α)

This instance enables use with mul_smul_comm.

Equations
• =
@[simp]
theorem Matrix.one_mul {m : Type u_2} {n : Type u_3} {α : Type v} [] [] [] (M : Matrix m n α) :
1 * M = M
@[simp]
theorem Matrix.mul_one {m : Type u_2} {n : Type u_3} {α : Type v} [] [] [] (M : Matrix m n α) :
M * 1 = M
instance Matrix.nonAssocSemiring {n : Type u_3} {α : Type v} [] [] [] :
Equations
• Matrix.nonAssocSemiring = let __src := Matrix.nonUnitalNonAssocSemiring; let __src_1 := Matrix.instAddCommMonoidWithOne;
@[simp]
theorem Matrix.map_mul {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} {β : Type w} [] [] {L : Matrix m n α} {M : Matrix n o α} [] {f : α →+* β} :
Matrix.map (L * M) f = Matrix.map L f * Matrix.map M f
theorem Matrix.smul_one_eq_diagonal {m : Type u_2} {α : Type v} [] [] (a : α) :
a 1 = Matrix.diagonal fun (x : m) => a
theorem Matrix.op_smul_one_eq_diagonal {m : Type u_2} {α : Type v} [] [] (a : α) :
= Matrix.diagonal fun (x : m) => a
@[simp]
theorem Matrix.diagonalRingHom_apply (n : Type u_3) (α : Type v) [] [] [] (d : nα) :
() d =
def Matrix.diagonalRingHom (n : Type u_3) (α : Type v) [] [] [] :
(nα) →+* Matrix n n α

Matrix.diagonal as a RingHom.

Equations
• One or more equations did not get rendered due to their size.
Instances For
theorem Matrix.mul_assoc {l : Type u_1} {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [] [] (L : Matrix l m α) (M : Matrix m n α) (N : Matrix n o α) :
L * M * N = L * (M * N)
instance Matrix.nonUnitalSemiring {n : Type u_3} {α : Type v} [] :
Equations
• Matrix.nonUnitalSemiring = let __src := Matrix.nonUnitalNonAssocSemiring;
instance Matrix.semiring {n : Type u_3} {α : Type v} [] [] [] :
Semiring (Matrix n n α)
Equations
• Matrix.semiring = let __src := Matrix.nonUnitalSemiring; let __src_1 := Matrix.nonAssocSemiring; Semiring.mk npowRec
@[simp]
theorem Matrix.neg_mul {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [] (M : Matrix m n α) (N : Matrix n o α) :
-M * N = -(M * N)
@[simp]
theorem Matrix.mul_neg {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [] (M : Matrix m n α) (N : Matrix n o α) :
M * -N = -(M * N)
theorem Matrix.sub_mul {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [] (M : Matrix m n α) (M' : Matrix m n α) (N : Matrix n o α) :
(M - M') * N = M * N - M' * N
theorem Matrix.mul_sub {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [] (M : Matrix m n α) (N : Matrix n o α) (N' : Matrix n o α) :
M * (N - N') = M * N - M * N'
instance Matrix.nonUnitalNonAssocRing {n : Type u_3} {α : Type v} [] :
Equations
• Matrix.nonUnitalNonAssocRing = let __src := Matrix.nonUnitalNonAssocSemiring; let __src_1 := Matrix.addCommGroup;
instance Matrix.instNonUnitalRing {n : Type u_3} {α : Type v} [] [] :
Equations
• Matrix.instNonUnitalRing = let __src := Matrix.nonUnitalSemiring; let __src_1 := Matrix.addCommGroup;
instance Matrix.instNonAssocRing {n : Type u_3} {α : Type v} [] [] [] :
Equations
• Matrix.instNonAssocRing = let __src := Matrix.nonAssocSemiring; let __src_1 := Matrix.instAddCommGroupWithOne; NonAssocRing.mk
instance Matrix.instRing {n : Type u_3} {α : Type v} [] [] [Ring α] :
Ring (Matrix n n α)
Equations
• Matrix.instRing = let __src := Matrix.semiring; let __src_1 := Matrix.instAddCommGroupWithOne; Ring.mk SubNegMonoid.zsmul
theorem Matrix.diagonal_pow {n : Type u_3} {α : Type v} [] [] [] (v : nα) (k : ) :
@[simp]
theorem Matrix.mul_mul_left {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [] [] (M : Matrix m n α) (N : Matrix n o α) (a : α) :
(Matrix.of fun (i : m) (j : n) => a * M i j) * N = a (M * N)
def Matrix.scalar {α : Type v} [] (n : Type u) [] [] :
α →+* Matrix n n α

The ring homomorphism α →+* Matrix n n α sending a to the diagonal matrix with a on the diagonal.

Equations
Instances For
@[simp]
theorem Matrix.scalar_apply {n : Type u_3} {α : Type v} [] [] [] (a : α) :
() a = Matrix.diagonal fun (x : n) => a
theorem Matrix.scalar_inj {n : Type u_3} {α : Type v} [] [] [] [] {r : α} {s : α} :
() r = () s r = s
theorem Matrix.scalar_commute_iff {n : Type u_3} {α : Type v} [] [] [] {r : α} {M : Matrix n n α} :
Commute (() r) M r M =
theorem Matrix.scalar_commute {n : Type u_3} {α : Type v} [] [] [] (r : α) (hr : ∀ (r' : α), Commute r r') (M : Matrix n n α) :
Commute (() r) M
theorem Matrix.smul_eq_mul_diagonal {m : Type u_2} {n : Type u_3} {α : Type v} [] [] [] (M : Matrix m n α) (a : α) :
a M = M * Matrix.diagonal fun (x : n) => a
@[simp]
theorem Matrix.mul_mul_right {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [] [] (M : Matrix m n α) (N : Matrix n o α) (a : α) :
(M * Matrix.of fun (i : n) (j : o) => a * N i j) = a (M * N)
instance Matrix.instAlgebra {n : Type u_3} {R : Type u_7} {α : Type v} [] [] [] [] [Algebra R α] :
Algebra R (Matrix n n α)
Equations
theorem Matrix.algebraMap_matrix_apply {n : Type u_3} {R : Type u_7} {α : Type v} [] [] [] [] [Algebra R α] {r : R} {i : n} {j : n} :
(algebraMap R (Matrix n n α)) r i j = if i = j then () r else 0
theorem Matrix.algebraMap_eq_diagonal {n : Type u_3} {R : Type u_7} {α : Type v} [] [] [] [] [Algebra R α] (r : R) :
(algebraMap R (Matrix n n α)) r = Matrix.diagonal ((algebraMap R (nα)) r)
theorem Matrix.algebraMap_eq_diagonalRingHom {n : Type u_3} {R : Type u_7} {α : Type v} [] [] [] [] [Algebra R α] :
algebraMap R (Matrix n n α) = RingHom.comp () (algebraMap R (nα))
@[simp]
theorem Matrix.map_algebraMap {n : Type u_3} {R : Type u_7} {α : Type v} {β : Type w} [] [] [] [] [] [Algebra R α] [Algebra R β] (r : R) (f : αβ) (hf : f 0 = 0) (hf₂ : f (() r) = () r) :
Matrix.map ((algebraMap R (Matrix n n α)) r) f = (algebraMap R (Matrix n n β)) r
@[simp]
theorem Matrix.diagonalAlgHom_apply {n : Type u_3} (R : Type u_7) {α : Type v} [] [] [] [] [Algebra R α] (d : nα) :
def Matrix.diagonalAlgHom {n : Type u_3} (R : Type u_7) {α : Type v} [] [] [] [] [Algebra R α] :
(nα) →ₐ[R] Matrix n n α

Matrix.diagonal as an AlgHom.

Equations
• One or more equations did not get rendered due to their size.
Instances For

### Bundled versions of Matrix.map#

@[simp]
theorem Equiv.mapMatrix_apply {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} (f : α β) (M : Matrix m n α) :
() M = Matrix.map M f
def Equiv.mapMatrix {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} (f : α β) :
Matrix m n α Matrix m n β

The Equiv between spaces of matrices induced by an Equiv between their coefficients. This is Matrix.map as an Equiv.

Equations
Instances For
@[simp]
theorem Equiv.mapMatrix_refl {m : Type u_2} {n : Type u_3} {α : Type v} :
= Equiv.refl (Matrix m n α)
@[simp]
theorem Equiv.mapMatrix_symm {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} (f : α β) :
().symm = Equiv.mapMatrix f.symm
@[simp]
theorem Equiv.mapMatrix_trans {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} {γ : Type u_9} (f : α β) (g : β γ) :
().trans () = Equiv.mapMatrix (f.trans g)
@[simp]
theorem AddMonoidHom.mapMatrix_apply {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [] [] (f : α →+ β) (M : Matrix m n α) :
= Matrix.map M f
def AddMonoidHom.mapMatrix {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [] [] (f : α →+ β) :
Matrix m n α →+ Matrix m n β

The AddMonoidHom between spaces of matrices induced by an AddMonoidHom between their coefficients. This is Matrix.map as an AddMonoidHom.

Equations
• = { toZeroHom := { toFun := fun (M : Matrix m n α) => Matrix.map M f, map_zero' := }, map_add' := }
Instances For
@[simp]
theorem AddMonoidHom.mapMatrix_id {m : Type u_2} {n : Type u_3} {α : Type v} [] :
@[simp]
theorem AddMonoidHom.mapMatrix_comp {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} {γ : Type u_9} [] [] [] (f : β →+ γ) (g : α →+ β) :
@[simp]
theorem AddEquiv.mapMatrix_apply {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [Add α] [Add β] (f : α ≃+ β) (M : Matrix m n α) :
M = Matrix.map M f
def AddEquiv.mapMatrix {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [Add α] [Add β] (f : α ≃+ β) :
Matrix m n α ≃+ Matrix m n β

The AddEquiv between spaces of matrices induced by an AddEquiv between their coefficients. This is Matrix.map as an AddEquiv.

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem AddEquiv.mapMatrix_refl {m : Type u_2} {n : Type u_3} {α : Type v} [Add α] :
@[simp]
theorem AddEquiv.mapMatrix_symm {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [Add α] [Add β] (f : α ≃+ β) :
@[simp]
theorem AddEquiv.mapMatrix_trans {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} {γ : Type u_9} [Add α] [Add β] [Add γ] (f : α ≃+ β) (g : β ≃+ γ) :
@[simp]
theorem LinearMap.mapMatrix_apply {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} {β : Type w} [] [] [] [Module R α] [Module R β] (f : α →ₗ[R] β) (M : Matrix m n α) :
M = Matrix.map M f
def LinearMap.mapMatrix {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} {β : Type w} [] [] [] [Module R α] [Module R β] (f : α →ₗ[R] β) :
Matrix m n α →ₗ[R] Matrix m n β

The LinearMap between spaces of matrices induced by a LinearMap between their coefficients. This is Matrix.map as a LinearMap.

Equations
• = { toAddHom := { toFun := fun (M : Matrix m n α) => Matrix.map M f, map_add' := }, map_smul' := }
Instances For
@[simp]
theorem LinearMap.mapMatrix_id {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [] [] [Module R α] :
LinearMap.mapMatrix LinearMap.id = LinearMap.id
@[simp]
theorem LinearMap.mapMatrix_comp {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} {β : Type w} {γ : Type u_9} [] [] [] [] [Module R α] [Module R β] [Module R γ] (f : β →ₗ[R] γ) (g : α →ₗ[R] β) :
= LinearMap.mapMatrix (f ∘ₗ g)
@[simp]
theorem LinearEquiv.mapMatrix_apply {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} {β : Type w} [] [] [] [Module R α] [Module R β] (f : α ≃ₗ[R] β) (M : Matrix m n α) :
= Matrix.map M f
def LinearEquiv.mapMatrix {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} {β : Type w} [] [] [] [Module R α] [Module R β] (f : α ≃ₗ[R] β) :
Matrix m n α ≃ₗ[R] Matrix m n β

The LinearEquiv between spaces of matrices induced by a LinearEquiv between their coefficients. This is Matrix.map as a LinearEquiv.

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem LinearEquiv.mapMatrix_refl {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [] [] [Module R α] :
@[simp]
theorem LinearEquiv.mapMatrix_symm {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} {β : Type w} [] [] [] [Module R α] [Module R β] (f : α ≃ₗ[R] β) :
@[simp]
theorem LinearEquiv.mapMatrix_trans {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} {β : Type w} {γ : Type u_9} [] [] [] [] [Module R α] [Module R β] [Module R γ] (f : α ≃ₗ[R] β) (g : β ≃ₗ[R] γ) :
= LinearEquiv.mapMatrix (f ≪≫ₗ g)
@[simp]
theorem RingHom.mapMatrix_apply {m : Type u_2} {α : Type v} {β : Type w} [] [] [] [] (f : α →+* β) (M : Matrix m m α) :
M = Matrix.map M f
def RingHom.mapMatrix {m : Type u_2} {α : Type v} {β : Type w} [] [] [] [] (f : α →+* β) :
Matrix m m α →+* Matrix m m β

The RingHom between spaces of square matrices induced by a RingHom between their coefficients. This is Matrix.map as a RingHom.

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem RingHom.mapMatrix_id {m : Type u_2} {α : Type v} [] [] [] :
= RingHom.id (Matrix m m α)
@[simp]
theorem RingHom.mapMatrix_comp {m : Type u_2} {α : Type v} {β : Type w} {γ : Type u_9} [] [] [] [] [] (f : β →+* γ) (g : α →+* β) :
@[simp]
theorem RingEquiv.mapMatrix_apply {m : Type u_2} {α : Type v} {β : Type w} [] [] [] [] (f : α ≃+* β) (M : Matrix m m α) :
M = Matrix.map M f
def RingEquiv.mapMatrix {m : Type u_2} {α : Type v} {β : Type w} [] [] [] [] (f : α ≃+* β) :
Matrix m m α ≃+* Matrix m m β

The RingEquiv between spaces of square matrices induced by a RingEquiv between their coefficients. This is Matrix.map as a RingEquiv.

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem RingEquiv.mapMatrix_refl {m : Type u_2} {α : Type v} [] [] [] :
@[simp]
theorem RingEquiv.mapMatrix_symm {m : Type u_2} {α : Type v} {β : Type w} [] [] [] [] (f : α ≃+* β) :
@[simp]
theorem RingEquiv.mapMatrix_trans {m : Type u_2} {α : Type v} {β : Type w} {γ : Type u_9} [] [] [] [] [] (f : α ≃+* β) (g : β ≃+* γ) :
@[simp]
theorem AlgHom.mapMatrix_apply {m : Type u_2} {R : Type u_7} {α : Type v} {β : Type w} [] [] [] [] [] [Algebra R α] [Algebra R β] (f : α →ₐ[R] β) (M : Matrix m m α) :
() M = Matrix.map M f
def AlgHom.mapMatrix {m : Type u_2} {R : Type u_7} {α : Type v} {β : Type w} [] [] [] [] [] [Algebra R α] [Algebra R β] (f : α →ₐ[R] β) :
Matrix m m α →ₐ[R] Matrix m m β

The AlgHom between spaces of square matrices induced by an AlgHom between their coefficients. This is Matrix.map as an AlgHom.

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem AlgHom.mapMatrix_id {m : Type u_2} {R : Type u_7} {α : Type v} [] [] [] [] [Algebra R α] :
= AlgHom.id R (Matrix m m α)
@[simp]
theorem AlgHom.mapMatrix_comp {m : Type u_2} {R : Type u_7} {α : Type v} {β : Type w} {γ : Type u_9} [] [] [] [] [] [] [Algebra R α] [Algebra R β] [Algebra R γ] (f : β →ₐ[R] γ) (g : α →ₐ[R] β) :
@[simp]
theorem AlgEquiv.mapMatrix_apply {m : Type u_2} {R : Type u_7} {α : Type v} {β : Type w} [] [] [] [] [] [Algebra R α] [Algebra R β] (f : α ≃ₐ[R] β) (M : Matrix m m α) :
M = Matrix.map M f
def AlgEquiv.mapMatrix {m : Type u_2} {R : Type u_7} {α : Type v} {β : Type w} [] [] [] [] [] [Algebra R α] [Algebra R β] (f : α ≃ₐ[R] β) :
Matrix m m α ≃ₐ[R] Matrix m m β

The AlgEquiv between spaces of square matrices induced by an AlgEquiv between their coefficients. This is Matrix.map as an AlgEquiv.

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem AlgEquiv.mapMatrix_refl {m : Type u_2} {R : Type u_7} {α : Type v} [] [] [] [] [Algebra R α] :
AlgEquiv.mapMatrix AlgEquiv.refl = AlgEquiv.refl
@[simp]
theorem AlgEquiv.mapMatrix_symm {m : Type u_2} {R : Type u_7} {α : Type v} {β : Type w} [] [] [] [] [] [Algebra R α] [Algebra R β] (f : α ≃ₐ[R] β) :
@[simp]
theorem AlgEquiv.mapMatrix_trans {m : Type u_2} {R : Type u_7} {α : Type v} {β : Type w} {γ : Type u_9} [] [] [] [] [] [] [Algebra R α] [Algebra R β] [Algebra R γ] (f : α ≃ₐ[R] β) (g : β ≃ₐ[R] γ) :
def Matrix.vecMulVec {m : Type u_2} {n : Type u_3} {α : Type v} [Mul α] (w : mα) (v : 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 col w * row v.

Equations
• = Matrix.of fun (x : m) (y : n) => w x * v y
Instances For
theorem Matrix.vecMulVec_apply {m : Type u_2} {n : Type u_3} {α : Type v} [Mul α] (w : mα) (v : nα) (i : m) (j : n) :
Matrix.vecMulVec w v i j = w i * v j
def Matrix.mulVec {m : Type u_2} {n : Type u_3} {α : Type v} [] (M : Matrix m n α) (v : 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. Put another way, M *ᵥ v is the vector whose entries are those of M * col v (see col_mulVec).

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

Equations
Instances For

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. Put another way, M *ᵥ v is the vector whose entries are those of M * col v (see col_mulVec).

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

Equations
Instances For
def Matrix.vecMul {m : Type u_2} {n : Type u_3} {α : Type v} [] (v : 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. Put another way, v ᵥ* M is the vector whose entries are those of row v * M (see row_vecMul).

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

Equations
Instances For

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. Put another way, v ᵥ* M is the vector whose entries are those of row v * M (see row_vecMul).

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

Equations
Instances For
@[simp]
theorem Matrix.mulVec.addMonoidHomLeft_apply {m : Type u_2} {n : Type u_3} {α : Type v} [] (v : nα) (M : Matrix m n α) :
∀ (a : m), =
def Matrix.mulVec.addMonoidHomLeft {m : Type u_2} {n : Type u_3} {α : Type v} [] (v : nα) :
Matrix m n α →+ mα

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

Equations
• = { toZeroHom := { toFun := fun (M : Matrix m n α) => , map_zero' := }, map_add' := }
Instances For
theorem Matrix.mul_apply_eq_vecMul {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [] (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.mulVec_diagonal {m : Type u_2} {α : Type v} [] [] (v : mα) (w : mα) (x : m) :
= v x * w x
theorem Matrix.vecMul_diagonal {m : Type u_2} {α : Type v} [] [] (v : mα) (w : mα) (x : m) :
= v x * w x
theorem Matrix.dotProduct_mulVec {m : Type u_2} {n : Type u_3} {R : Type u_7} [] [] (v : mR) (A : Matrix m n R) (w : nR) :
=

Associate the dot product of mulVec to the left.

@[simp]
theorem Matrix.mulVec_zero {m : Type u_2} {n : Type u_3} {α : Type v} [] (A : Matrix m n α) :
= 0
@[simp]
theorem Matrix.zero_vecMul {m : Type u_2} {n : Type u_3} {α : Type v} [] (A : Matrix m n α) :
= 0
@[simp]
theorem Matrix.zero_mulVec {m : Type u_2} {n : Type u_3} {α : Type v} [] (v : nα) :
= 0
@[simp]
theorem Matrix.vecMul_zero {m : Type u_2} {n : Type u_3} {α : Type v} [] (v : mα) :
= 0
theorem Matrix.smul_mulVec_assoc {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [] [] [] [] (a : R) (A : Matrix m n α) (b : nα) :
Matrix.mulVec (a A) b = a
theorem Matrix.mulVec_add {m : Type u_2} {n : Type u_3} {α : Type v} [] (A : Matrix m n α) (x : nα) (y : nα) :
Matrix.mulVec A (x + y) = +
theorem Matrix.add_mulVec {m : Type u_2} {n : Type u_3} {α : Type v} [] (A : Matrix m n α) (B : Matrix m n α) (x : nα) :
Matrix.mulVec (A + B) x = +
theorem Matrix.vecMul_add {m : Type u_2} {n : Type u_3} {α : Type v} [] (A : Matrix m n α) (B : Matrix m n α) (x : mα) :
Matrix.vecMul x (A + B) = +
theorem Matrix.add_vecMul {m : Type u_2} {n : Type u_3} {α : Type v} [] (A : Matrix m n α) (x : mα) (y : mα) :
Matrix.vecMul (x + y) A = +
theorem Matrix.vecMul_smul {m : Type u_2} {n : Type u_3} {R : Type u_7} {S : Type u_8} [] [] [] [] (M : Matrix n m S) (b : R) (v : nS) :
Matrix.vecMul (b v) M = b
theorem Matrix.mulVec_smul {m : Type u_2} {n : Type u_3} {R : Type u_7} {S : Type u_8} [] [] [] [] (M : Matrix m n S) (b : R) (v : nS) :
Matrix.mulVec M (b v) = b
@[simp]
theorem Matrix.mulVec_single {m : Type u_2} {n : Type u_3} {R : Type u_7} [] [] (M : Matrix m n R) (j : n) (x : R) :
Matrix.mulVec M () = fun (i : m) => M i j * x
@[simp]
theorem Matrix.single_vecMul {m : Type u_2} {n : Type u_3} {R : Type u_7} [] [] (M : Matrix m n R) (i : m) (x : R) :
Matrix.vecMul () M = fun (j : n) => x * M i j
theorem Matrix.diagonal_mulVec_single {n : Type u_3} {R : Type u_7} [] [] (v : nR) (j : n) (x : R) :
Matrix.mulVec () () = Pi.single j (v j * x)
theorem Matrix.single_vecMul_diagonal {n : Type u_3} {R : Type u_7} [] [] (v : nR) (j : n) (x : R) :
Matrix.vecMul () () = Pi.single j (x * v j)
@[simp]
theorem Matrix.vecMul_vecMul {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [] [] (v : mα) (M : Matrix m n α) (N : Matrix n o α) :
@[simp]
theorem Matrix.mulVec_mulVec {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [] [] (v : oα) (M : Matrix m n α) (N : Matrix n o α) :
theorem Matrix.star_mulVec {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (M : Matrix m n α) (v : nα) :
star () =
theorem Matrix.star_vecMul {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (M : Matrix m n α) (v : mα) :
star () =
theorem Matrix.mulVec_conjTranspose {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (A : Matrix m n α) (x : mα) :
theorem Matrix.vecMul_conjTranspose {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (A : Matrix m n α) (x : nα) :
theorem Matrix.mul_mul_apply {n : Type u_3} {α : Type v} [] (A : Matrix n n α) (B : Matrix n n α) (C : Matrix n n α) (i : n) (j : n) :
(A * B * C) i j = Matrix.dotProduct (A i) ()
theorem Matrix.mulVec_one {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (A : Matrix m n α) :
= fun (i : m) => Finset.sum Finset.univ fun (j : n) => A i j
theorem Matrix.vec_one_mul {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (A : Matrix m n α) :
= fun (j : n) => Finset.sum Finset.univ fun (i : m) => A i j
@[simp]
theorem Matrix.one_mulVec {m : Type u_2} {α : Type v} [] [] [] (v : mα) :
= v
@[simp]
theorem Matrix.vecMul_one {m : Type u_2} {α : Type v} [] [] [] (v : mα) :
= v
theorem Matrix.neg_vecMul {m : Type u_2} {n : Type u_3} {α : Type v} [] (v : mα) (A : Matrix m n α) :
theorem Matrix.vecMul_neg {m : Type u_2} {n : Type u_3} {α : Type v} [] (v : mα) (A : Matrix m n α) :
theorem Matrix.neg_mulVec {m : Type u_2} {n : Type u_3} {α : Type v} [] (v : nα) (A : Matrix m n α) :
theorem Matrix.mulVec_neg {m : Type u_2} {n : Type u_3} {α : Type v} [] (v : nα) (A : Matrix m n α) :
theorem Matrix.mulVec_sub {m : Type u_2} {n : Type u_3} {α : Type v} [] (A : Matrix m n α) (x : nα) (y : nα) :
Matrix.mulVec A (x - y) = -
theorem Matrix.sub_mulVec {m : Type u_2} {n : Type u_3} {α : Type v} [] (A : Matrix m n α) (B : Matrix m n α) (x : nα) :
Matrix.mulVec (A - B) x = -
theorem Matrix.vecMul_sub {m : Type u_2} {n : Type u_3} {α : Type v} [] (A : Matrix m n α) (B : Matrix m n α) (x : mα) :
Matrix.vecMul x (A - B) = -
theorem Matrix.sub_vecMul {m : Type u_2} {n : Type u_3} {α : Type v} [] (A : Matrix m n α) (x : mα) (y : mα) :
Matrix.vecMul (x - y) A = -
theorem Matrix.mulVec_transpose {m : Type u_2} {n : Type u_3} {α : Type v} [] (A : Matrix m n α) (x : mα) :
=
theorem Matrix.vecMul_transpose {m : Type u_2} {n : Type u_3} {α : Type v} [] (A : Matrix m n α) (x : nα) :
=
theorem Matrix.mulVec_vecMul {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [] [] (A : Matrix m n α) (B : Matrix o n α) (x : oα) :
theorem Matrix.vecMul_mulVec {m : Type u_2} {n : Type u_3} {o : Type u_4} {α : Type v} [] [] (A : Matrix m n α) (B : Matrix m o α) (x : nα) :
theorem Matrix.mulVec_smul_assoc {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (A : Matrix m n α) (b : nα) (a : α) :
Matrix.mulVec A (a b) = a
@[simp]
theorem Matrix.transpose_transpose {m : Type u_2} {n : Type u_3} {α : Type v} (M : Matrix m n α) :
theorem Matrix.transpose_injective {m : Type u_2} {n : Type u_3} {α : Type v} :
Function.Injective Matrix.transpose
@[simp]
theorem Matrix.transpose_inj {m : Type u_2} {n : Type u_3} {α : Type v} {A : Matrix m n α} {B : Matrix m n α} :
A = B
@[simp]
theorem Matrix.transpose_zero {m : Type u_2} {n : Type u_3} {α : Type v} [Zero α] :
@[simp]
theorem Matrix.transpose_eq_zero {m : Type u_2} {n : Type u_3} {α : Type v} [Zero α] {M : Matrix m n α} :
M = 0
@[simp]
theorem Matrix.transpose_one {n : Type u_3} {α : Type v} [] [Zero α] [One α] :
@[simp]
theorem Matrix.transpose_eq_one {n : Type u_3} {α : Type v} [] [Zero α] [One α] {M : Matrix n n α} :
M = 1
@[simp]
theorem Matrix.transpose_add {m : Type u_2} {n : Type u_3} {α : Type v} [Add α] (M : Matrix m n α) (N : Matrix m n α) :
@[simp]
theorem Matrix.transpose_sub {m : Type u_2} {n : Type u_3} {α : Type v} [Sub α] (M : Matrix m n α) (N : Matrix m n α) :
@[simp]
theorem Matrix.transpose_mul {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [] [] [] (M : Matrix m n α) (N : Matrix n l α) :
@[simp]
theorem Matrix.transpose_smul {m : Type u_2} {n : Type u_3} {α : Type v} {R : Type u_10} [SMul R α] (c : R) (M : Matrix m n α) :
@[simp]
theorem Matrix.transpose_neg {m : Type u_2} {n : Type u_3} {α : Type v} [Neg α] (M : Matrix m n α) :
theorem Matrix.transpose_map {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} {f : αβ} {M : Matrix m n α} :
=
@[simp]
theorem Matrix.transposeAddEquiv_apply (m : Type u_2) (n : Type u_3) (α : Type v) [Add α] (M : Matrix m n α) :
() M =
def Matrix.transposeAddEquiv (m : Type u_2) (n : Type u_3) (α : Type v) [Add α] :
Matrix m n α ≃+ Matrix n m α

Matrix.transpose as an AddEquiv

Equations
• = { toEquiv := { toFun := Matrix.transpose, invFun := Matrix.transpose, left_inv := , right_inv := }, map_add' := }
Instances For
@[simp]
theorem Matrix.transposeAddEquiv_symm (m : Type u_2) (n : Type u_3) (α : Type v) [Add α] :
theorem Matrix.transpose_list_sum {m : Type u_2} {n : Type u_3} {α : Type v} [] (l : List (Matrix m n α)) :
= List.sum (List.map Matrix.transpose l)
theorem Matrix.transpose_multiset_sum {m : Type u_2} {n : Type u_3} {α : Type v} [] (s : Multiset (Matrix m n α)) :
= Multiset.sum (Multiset.map Matrix.transpose s)
theorem Matrix.transpose_sum {m : Type u_2} {n : Type u_3} {α : Type v} [] {ι : Type u_10} (s : ) (M : ιMatrix m n α) :
Matrix.transpose (Finset.sum s fun (i : ι) => M i) = Finset.sum s fun (i : ι) => Matrix.transpose (M i)
@[simp]
theorem Matrix.transposeLinearEquiv_apply (m : Type u_2) (n : Type u_3) (R : Type u_7) (α : Type v) [] [] [Module R α] :
∀ (a : Matrix m n α), () a = ().toFun a
def Matrix.transposeLinearEquiv (m : Type u_2) (n : Type u_3) (R : Type u_7) (α : Type v) [] [] [Module R α] :
Matrix m n α ≃ₗ[R] Matrix n m α

Matrix.transpose as a LinearMap

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem Matrix.transposeLinearEquiv_symm (m : Type u_2) (n : Type u_3) (R : Type u_7) (α : Type v) [] [] [Module R α] :
=
@[simp]
theorem Matrix.transposeRingEquiv_apply (m : Type u_2) (α : Type v) [] [] [] (M : Matrix m m α) :
@[simp]
theorem Matrix.transposeRingEquiv_symm_apply (m : Type u_2) (α : Type v) [] [] [] (M : (Matrix m m α)ᵐᵒᵖ) :
def Matrix.transposeRingEquiv (m : Type u_2) (α : Type v) [] [] [] :
Matrix m m α ≃+* (Matrix m m α)ᵐᵒᵖ

Matrix.transpose as a RingEquiv to the opposite ring

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem Matrix.transpose_pow {m : Type u_2} {α : Type v} [] [] [] (M : Matrix m m α) (k : ) :
theorem Matrix.transpose_list_prod {m : Type u_2} {α : Type v} [] [] [] (l : List (Matrix m m α)) :
= List.prod (List.reverse (List.map Matrix.transpose l))
@[simp]
theorem Matrix.transposeAlgEquiv_apply (m : Type u_2) (R : Type u_7) (α : Type v) [] [] [] [] [Algebra R α] (M : Matrix m m α) :
() M =
@[simp]
theorem Matrix.transposeAlgEquiv_symm_apply (m : Type u_2) (R : Type u_7) (α : Type v) [] [] [] [] [Algebra R α] :
∀ (a : (Matrix m m α)ᵐᵒᵖ), () a = (AddEquiv.trans () MulOpposite.opAddEquiv).invFun a
def Matrix.transposeAlgEquiv (m : Type u_2) (R : Type u_7) (α : Type v) [] [] [] [] [Algebra R α] :

Matrix.transpose as an AlgEquiv to the opposite ring

Equations
• One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem Matrix.conjTranspose_apply {m : Type u_2} {n : Type u_3} {α : Type v} [Star α] (M : Matrix m n α) (i : m) (j : n) :
= star (M i j)

Tell simp what the entries are in a conjugate transposed matrix.

Compare with mul_apply, diagonal_apply_eq, etc.

@[simp]
theorem Matrix.conjTranspose_conjTranspose {m : Type u_2} {n : Type u_3} {α : Type v} [] (M : Matrix m n α) :
theorem Matrix.conjTranspose_injective {m : Type u_2} {n : Type u_3} {α : Type v} [] :
Function.Injective Matrix.conjTranspose
@[simp]
theorem Matrix.conjTranspose_inj {m : Type u_2} {n : Type u_3} {α : Type v} [] {A : Matrix m n α} {B : Matrix m n α} :
@[simp]
theorem Matrix.conjTranspose_zero {m : Type u_2} {n : Type u_3} {α : Type v} [] [] :
@[simp]
theorem Matrix.conjTranspose_eq_zero {m : Type u_2} {n : Type u_3} {α : Type v} [] [] {M : Matrix m n α} :
M = 0
@[simp]
theorem Matrix.conjTranspose_one {n : Type u_3} {α : Type v} [] [] [] :
@[simp]
theorem Matrix.conjTranspose_eq_one {n : Type u_3} {α : Type v} [] [] [] {M : Matrix n n α} :
M = 1
@[simp]
theorem Matrix.conjTranspose_add {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (M : Matrix m n α) (N : Matrix m n α) :
@[simp]
theorem Matrix.conjTranspose_sub {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (M : Matrix m n α) (N : Matrix m n α) :
@[simp]
theorem Matrix.conjTranspose_smul {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [Star R] [Star α] [SMul R α] [] (c : R) (M : Matrix m n α) :

Note that StarModule is quite a strong requirement; as such we also provide the following variants which this lemma would not apply to:

• Matrix.conjTranspose_smul_non_comm
• Matrix.conjTranspose_nsmul
• Matrix.conjTranspose_zsmul
• Matrix.conjTranspose_natCast_smul
• Matrix.conjTranspose_intCast_smul
• Matrix.conjTranspose_inv_natCast_smul
• Matrix.conjTranspose_inv_intCast_smul
• Matrix.conjTranspose_rat_smul
• Matrix.conjTranspose_ratCast_smul
@[simp]
theorem Matrix.conjTranspose_smul_non_comm {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [Star R] [Star α] [SMul R α] [SMul Rᵐᵒᵖ α] (c : R) (M : Matrix m n α) (h : ∀ (r : R) (a : α), star (r a) = star a) :
theorem Matrix.conjTranspose_smul_self {m : Type u_2} {n : Type u_3} {α : Type v} [Mul α] [] (c : α) (M : Matrix m n α) :
@[simp]
theorem Matrix.conjTranspose_nsmul {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (c : ) (M : Matrix m n α) :
@[simp]
theorem Matrix.conjTranspose_zsmul {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (c : ) (M : Matrix m n α) :
@[simp]
theorem Matrix.conjTranspose_natCast_smul {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [] [] [] [Module R α] (c : ) (M : Matrix m n α) :
@[simp]
theorem Matrix.conjTranspose_ofNat_smul {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [] [] [] [Module R α] (c : ) [] (M : Matrix m n α) :
@[simp]
theorem Matrix.conjTranspose_intCast_smul {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [Ring R] [] [] [Module R α] (c : ) (M : Matrix m n α) :
@[simp]
theorem Matrix.conjTranspose_inv_natCast_smul {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [] [] [] [Module R α] (c : ) (M : Matrix m n α) :
@[simp]
theorem Matrix.conjTranspose_inv_ofNat_smul {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [] [] [] [Module R α] (c : ) [] (M : Matrix m n α) :
@[simp]
theorem Matrix.conjTranspose_inv_intCast_smul {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [] [] [] [Module R α] (c : ) (M : Matrix m n α) :
@[simp]
theorem Matrix.conjTranspose_ratCast_smul {m : Type u_2} {n : Type u_3} {R : Type u_7} {α : Type v} [] [] [] [Module R α] (c : ) (M : Matrix m n α) :
@[simp]
theorem Matrix.conjTranspose_rat_smul {m : Type u_2} {n : Type u_3} {α : Type v} [] [] [] (c : ) (M : Matrix m n α) :
@[simp]
theorem Matrix.conjTranspose_mul {l : Type u_1} {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (M : Matrix m n α) (N : Matrix n l α) :
@[simp]
theorem Matrix.conjTranspose_neg {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (M : Matrix m n α) :
theorem Matrix.conjTranspose_map {m : Type u_2} {n : Type u_3} {α : Type v} {β : Type w} [Star α] [Star β] {A : Matrix m n α} (f : αβ) (hf : Function.Semiconj f star star) :
@[simp]
theorem Matrix.conjTranspose_eq_transpose_of_trivial {m : Type u_2} {n : Type u_3} {α : Type v} [Star α] [] (A : Matrix m n α) :

When star x = x on the coefficients (such as the real numbers) conjTranspose and transpose are the same operation.

@[simp]
theorem Matrix.conjTransposeAddEquiv_apply (m : Type u_2) (n : Type u_3) (α : Type v) [] [] (M : Matrix m n α) :
def Matrix.conjTransposeAddEquiv (m : Type u_2) (n : Type u_3) (α : Type v) [] [] :
Matrix m n α ≃+ Matrix n m α

Matrix.conjTranspose as an AddEquiv

Equations
• = { toEquiv := { toFun := Matrix.conjTranspose, invFun := Matrix.conjTranspose, left_inv := , right_inv := }, map_add' := }
Instances For
@[simp]
theorem Matrix.conjTransposeAddEquiv_symm (m : Type u_2) (n : Type u_3) (α : Type v) [] [] :
theorem Matrix.conjTranspose_list_sum {m : Type u_2} {n : Type u_3} {α : Type v} [] [] (l : List (Matrix m n α)) :
= List.sum (List.map Matrix.conjTranspose l)