File: Mathlib/Data/Matrix/Basic.lean

full_name: Matrix
code: /-- `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`. -/
def Matrix (m : Type u) (n : Type u') (α : Type v) : Type max u u' v 
goal: Type (max u u' v)

full_name: Matrix.ext_iff
code: theorem ext_iff : (∀ i j, M i j = N i j) ↔ M = N 
goal: (∀ (i : m) (j : n), M i j = N i j) ↔ M = N

full_name: Matrix.ext
code: @[ext]
theorem ext : (∀ i j, M i j = N i j) → M = N 
goal: (∀ (i : m) (j : n), M i j = N i j) → M = N

full_name: Matrix.of
code: /-- 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.
-/
def of : (m → n → α) ≃ Matrix m n α 
goal: (m → n → α) ≃ Matrix m n α

full_name: Matrix.of_apply
code: @[simp]
theorem of_apply (f : m → n → α) (i j) : of f i j = f i j 
goal: Matrix.of f i j = f i j

full_name: Matrix.of_symm_apply
code: @[simp]
theorem of_symm_apply (f : Matrix m n α) (i j) : of.symm f i j = f i j 
goal: Matrix.of.symm f i j = f i j

full_name: Matrix.map
code: /-- `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`
-/
def map (M : Matrix m n α) (f : α → β) : Matrix m n β 
goal: Matrix m n β

full_name: Matrix.map_apply
code: @[simp]
theorem map_apply {M : Matrix m n α} {f : α → β} {i : m} {j : n} : M.map f i j = f (M i j) 
goal: M.map f i j = f (M i j)

full_name: Matrix.map_id
code: @[simp]
theorem map_id (M : Matrix m n α) : M.map id = M 
goal: M.map id = M

full_name: Matrix.map_id'
code: @[simp]
theorem map_id' (M : Matrix m n α) : M.map (·) = M 
goal: (M.map fun x => x) = M

full_name: Matrix.map_map
code: @[simp]
theorem map_map {M : Matrix m n α} {β γ : Type*} {f : α → β} {g : β → γ} :
    (M.map f).map g = M.map (g ∘ f) 
goal: (M.map f).map g = M.map (g ∘ f)

full_name: Matrix.map_injective
code: theorem map_injective {f : α → β} (hf : Function.Injective f) :
    Function.Injective fun M : Matrix m n α => M.map f 
goal: Function.Injective fun M => M.map f

full_name: Matrix.transpose
code: /-- The transpose of a matrix. -/
def transpose (M : Matrix m n α) : Matrix n m α 
goal: Matrix n m α

full_name: Matrix.transpose_apply
code: @[simp]
theorem transpose_apply (M : Matrix m n α) (i j) : transpose M i j = M j i 
goal: Mᵀ i j = M j i

full_name: Matrix.«_aux_Mathlib_Data_Matrix_Basic___macroRules_Matrix_term_ᵀ_1»
code: @[inherit_doc]
scoped postfix:1024 "ᵀ" => Matrix.transpose
goal: Lean.Macro

full_name: Matrix._aux_Mathlib_Data_Matrix_Basic___unexpand_Matrix_transpose_1
code: @[inherit_doc]
scoped postfix:1024 "ᵀ" => Matrix.transpose
goal: Lean.PrettyPrinter.Unexpander

full_name: Matrix.conjTranspose
code: /-- The conjugate transpose of a matrix defined in term of `star`. -/
def conjTranspose [Star α] (M : Matrix m n α) : Matrix n m α 
goal: Matrix n m α

full_name: Matrix.«_aux_Mathlib_Data_Matrix_Basic___macroRules_Matrix_term_ᴴ_1»
code: @[inherit_doc]
scoped postfix:1024 "ᴴ" => Matrix.conjTranspose
goal: Lean.Macro

full_name: Matrix._aux_Mathlib_Data_Matrix_Basic___unexpand_Matrix_conjTranspose_1
code: @[inherit_doc]
scoped postfix:1024 "ᴴ" => Matrix.conjTranspose
goal: Lean.PrettyPrinter.Unexpander

full_name: Matrix.inhabited
code: instance inhabited [Inhabited α] : Inhabited (Matrix m n α) 
goal: Inhabited (Matrix m n α)

full_name: Matrix.decidableEq
code: instance decidableEq [DecidableEq α] [Fintype m] [Fintype n] : DecidableEq (Matrix m n α) 
goal: DecidableEq (Matrix m n α)

full_name: Matrix.instFintypeOfDecidableEq
code: instance {n m} [Fintype m] [DecidableEq m] [Fintype n] [DecidableEq n] (α) [Fintype α] :
    Fintype (Matrix m n α) 
goal: Fintype (Matrix m n α)

full_name: Matrix.instFinite
code: instance {n m} [Finite m] [Finite n] (α) [Finite α] :
    Finite (Matrix m n α) 
goal: Finite (Matrix m n α)

full_name: Matrix.add
code: instance add [Add α] : Add (Matrix m n α) 
goal: Add (Matrix m n α)

full_name: Matrix.addSemigroup
code: instance addSemigroup [AddSemigroup α] : AddSemigroup (Matrix m n α) 
goal: AddSemigroup (Matrix m n α)

full_name: Matrix.addCommSemigroup
code: instance addCommSemigroup [AddCommSemigroup α] : AddCommSemigroup (Matrix m n α) 
goal: AddCommSemigroup (Matrix m n α)

full_name: Matrix.zero
code: instance zero [Zero α] : Zero (Matrix m n α) 
goal: Zero (Matrix m n α)

full_name: Matrix.addZeroClass
code: instance addZeroClass [AddZeroClass α] : AddZeroClass (Matrix m n α) 
goal: AddZeroClass (Matrix m n α)

full_name: Matrix.addMonoid
code: instance addMonoid [AddMonoid α] : AddMonoid (Matrix m n α) 
goal: AddMonoid (Matrix m n α)

full_name: Matrix.addCommMonoid
code: instance addCommMonoid [AddCommMonoid α] : AddCommMonoid (Matrix m n α) 
goal: AddCommMonoid (Matrix m n α)

full_name: Matrix.neg
code: instance neg [Neg α] : Neg (Matrix m n α) 
goal: Neg (Matrix m n α)

full_name: Matrix.sub
code: instance sub [Sub α] : Sub (Matrix m n α) 
goal: Sub (Matrix m n α)

full_name: Matrix.addGroup
code: instance addGroup [AddGroup α] : AddGroup (Matrix m n α) 
goal: AddGroup (Matrix m n α)

full_name: Matrix.addCommGroup
code: instance addCommGroup [AddCommGroup α] : AddCommGroup (Matrix m n α) 
goal: AddCommGroup (Matrix m n α)

full_name: Matrix.unique
code: instance unique [Unique α] : Unique (Matrix m n α) 
goal: Unique (Matrix m n α)

full_name: Matrix.subsingleton
code: instance subsingleton [Subsingleton α] : Subsingleton (Matrix m n α) 
goal: Subsingleton (Matrix m n α)

full_name: Matrix.nonempty
code: instance nonempty [Nonempty m] [Nonempty n] [Nontrivial α] : Nontrivial (Matrix m n α) 
goal: Nontrivial (Matrix m n α)

full_name: Matrix.smul
code: instance smul [SMul R α] : SMul R (Matrix m n α) 
goal: SMul R (Matrix m n α)

full_name: Matrix.smulCommClass
code: instance smulCommClass [SMul R α] [SMul S α] [SMulCommClass R S α] :
    SMulCommClass R S (Matrix m n α) 
goal: SMulCommClass R S (Matrix m n α)

full_name: Matrix.isScalarTower
code: instance isScalarTower [SMul R S] [SMul R α] [SMul S α] [IsScalarTower R S α] :
    IsScalarTower R S (Matrix m n α) 
goal: IsScalarTower R S (Matrix m n α)

full_name: Matrix.isCentralScalar
code: instance isCentralScalar [SMul R α] [SMul Rᵐᵒᵖ α] [IsCentralScalar R α] :
    IsCentralScalar R (Matrix m n α) 
goal: IsCentralScalar R (Matrix m n α)

full_name: Matrix.mulAction
code: instance mulAction [Monoid R] [MulAction R α] : MulAction R (Matrix m n α) 
goal: MulAction R (Matrix m n α)

full_name: Matrix.distribMulAction
code: instance distribMulAction [Monoid R] [AddMonoid α] [DistribMulAction R α] :
    DistribMulAction R (Matrix m n α) 
goal: DistribMulAction R (Matrix m n α)

full_name: Matrix.module
code: instance module [Semiring R] [AddCommMonoid α] [Module R α] : Module R (Matrix m n α) 
goal: Module R (Matrix m n α)

full_name: Matrix.zero_apply
code: @[simp, nolint simpNF]
theorem zero_apply [Zero α] (i : m) (j : n) : (0 : Matrix m n α) i j = 0 
goal: 0 i j = 0

full_name: Matrix.add_apply
code: @[simp]
theorem add_apply [Add α] (A B : Matrix m n α) (i : m) (j : n) :
    (A + B) i j = (A i j) + (B i j) 
goal: (A + B) i j = A i j + B i j

full_name: Matrix.smul_apply
code: @[simp]
theorem smul_apply [SMul β α] (r : β) (A : Matrix m n α) (i : m) (j : n) :
    (r • A) i j = r • (A i j) 
goal: (r • A) i j = r • A i j

full_name: Matrix.sub_apply
code: @[simp]
theorem sub_apply [Sub α] (A B : Matrix m n α) (i : m) (j : n) :
    (A - B) i j = (A i j) - (B i j) 
goal: (A - B) i j = A i j - B i j

full_name: Matrix.neg_apply
code: @[simp]
theorem neg_apply [Neg α] (A : Matrix m n α) (i : m) (j : n) :
    (-A) i j = -(A i j) 
goal: (-A) i j = -A i j

full_name: Matrix.of_zero
code: @[simp]
theorem of_zero [Zero α] : of (0 : m → n → α) = 0 
goal: Matrix.of 0 = 0

full_name: Matrix.of_add_of
code: @[simp]
theorem of_add_of [Add α] (f g : m → n → α) : of f + of g = of (f + g) 
goal: Matrix.of f + Matrix.of g = Matrix.of (f + g)

full_name: Matrix.of_sub_of
code: @[simp]
theorem of_sub_of [Sub α] (f g : m → n → α) : of f - of g = of (f - g) 
goal: Matrix.of f - Matrix.of g = Matrix.of (f - g)

full_name: Matrix.neg_of
code: @[simp]
theorem neg_of [Neg α] (f : m → n → α) : -of f = of (-f) 
goal: -Matrix.of f = Matrix.of (-f)

full_name: Matrix.smul_of
code: @[simp]
theorem smul_of [SMul R α] (r : R) (f : m → n → α) : r • of f = of (r • f) 
goal: r • Matrix.of f = Matrix.of (r • f)

full_name: Matrix.map_zero
code: @[simp]
protected theorem map_zero [Zero α] [Zero β] (f : α → β) (h : f 0 = 0) :
    (0 : Matrix m n α).map f = 0 
goal: Matrix.map 0 f = 0

full_name: Matrix.map_add
code: protected theorem map_add [Add α] [Add β] (f : α → β) (hf : ∀ a₁ a₂, f (a₁ + a₂) = f a₁ + f a₂)
    (M N : Matrix m n α) : (M + N).map f = M.map f + N.map f 
goal: (M + N).map f = M.map f + N.map f

full_name: Matrix.map_sub
code: protected theorem map_sub [Sub α] [Sub β] (f : α → β) (hf : ∀ a₁ a₂, f (a₁ - a₂) = f a₁ - f a₂)
    (M N : Matrix m n α) : (M - N).map f = M.map f - N.map f 
goal: (M - N).map f = M.map f - N.map f

full_name: Matrix.map_smul
code: theorem map_smul [SMul R α] [SMul R β] (f : α → β) (r : R) (hf : ∀ a, f (r • a) = r • f a)
    (M : Matrix m n α) : (r • M).map f = r • M.map f 
goal: (r • M).map f = r • M.map f

full_name: Matrix.map_smul'
code: /-- The scalar action via `Mul.toSMul` is transformed by the same map as the elements
of the matrix, when `f` preserves multiplication. -/
theorem map_smul' [Mul α] [Mul β] (f : α → β) (r : α) (A : Matrix n n α)
    (hf : ∀ a₁ a₂, f (a₁ * a₂) = f a₁ * f a₂) : (r • A).map f = f r • A.map f 
goal: (r • A).map f = f r • A.map f

full_name: Matrix.map_op_smul'
code: /-- The scalar action via `mul.toOppositeSMul` is transformed by the same map as the
elements of the matrix, when `f` preserves multiplication. -/
theorem map_op_smul' [Mul α] [Mul β] (f : α → β) (r : α) (A : Matrix n n α)
    (hf : ∀ a₁ a₂, f (a₁ * a₂) = f a₁ * f a₂) :
    (MulOpposite.op r • A).map f = MulOpposite.op (f r) • A.map f 
goal: (MulOpposite.op r • A).map f = MulOpposite.op (f r) • A.map f

full_name: IsSMulRegular.matrix
code: theorem _root_.IsSMulRegular.matrix [SMul R S] {k : R} (hk : IsSMulRegular S k) :
    IsSMulRegular (Matrix m n S) k 
goal: IsSMulRegular (Matrix m n S) k

full_name: IsLeftRegular.matrix
code: theorem _root_.IsLeftRegular.matrix [Mul α] {k : α} (hk : IsLeftRegular k) :
    IsSMulRegular (Matrix m n α) k 
goal: IsSMulRegular (Matrix m n α) k

full_name: Matrix.subsingleton_of_empty_left
code: instance subsingleton_of_empty_left [IsEmpty m] : Subsingleton (Matrix m n α) 
goal: Subsingleton (Matrix m n α)

full_name: Matrix.subsingleton_of_empty_right
code: instance subsingleton_of_empty_right [IsEmpty n] : Subsingleton (Matrix m n α) 
goal: Subsingleton (Matrix m n α)

full_name: Matrix.diagonal
code: /-- `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`
-/
def diagonal [Zero α] (d : n → α) : Matrix n n α 
goal: Matrix n n α

full_name: Matrix.diagonal_apply
code: theorem diagonal_apply [Zero α] (d : n → α) (i j) : diagonal d i j = if i = j then d i else 0 
goal: Matrix.diagonal d i j = if i = j then d i else 0

full_name: Matrix.diagonal_apply_eq
code: @[simp]
theorem diagonal_apply_eq [Zero α] (d : n → α) (i : n) : (diagonal d) i i = d i 
goal: Matrix.diagonal d i i = d i

full_name: Matrix.diagonal_apply_ne
code: @[simp]
theorem diagonal_apply_ne [Zero α] (d : n → α) {i j : n} (h : i ≠ j) : (diagonal d) i j = 0 
goal: Matrix.diagonal d i j = 0

full_name: Matrix.diagonal_apply_ne'
code: theorem diagonal_apply_ne' [Zero α] (d : n → α) {i j : n} (h : j ≠ i) : (diagonal d) i j = 0 
goal: Matrix.diagonal d i j = 0

full_name: Matrix.diagonal_eq_diagonal_iff
code: @[simp]
theorem diagonal_eq_diagonal_iff [Zero α] {d₁ d₂ : n → α} :
    diagonal d₁ = diagonal d₂ ↔ ∀ i, d₁ i = d₂ i 
goal: Matrix.diagonal d₁ = Matrix.diagonal d₂ ↔ ∀ (i : n), d₁ i = d₂ i

full_name: Matrix.diagonal_injective
code: theorem diagonal_injective [Zero α] : Function.Injective (diagonal : (n → α) → Matrix n n α) 
goal: Function.Injective Matrix.diagonal

full_name: Matrix.diagonal_zero
code: @[simp]
theorem diagonal_zero [Zero α] : (diagonal fun _ => 0 : Matrix n n α) = 0 
goal: (Matrix.diagonal fun x => 0) = 0

full_name: Matrix.diagonal_transpose
code: @[simp]
theorem diagonal_transpose [Zero α] (v : n → α) : (diagonal v)ᵀ = diagonal v 
goal: (Matrix.diagonal v)ᵀ = Matrix.diagonal v

full_name: Matrix.diagonal_add
code: @[simp]
theorem diagonal_add [AddZeroClass α] (d₁ d₂ : n → α) :
    diagonal d₁ + diagonal d₂ = diagonal fun i => d₁ i + d₂ i 
goal: Matrix.diagonal d₁ + Matrix.diagonal d₂ = Matrix.diagonal fun i => d₁ i + d₂ i

full_name: Matrix.diagonal_smul
code: @[simp]
theorem diagonal_smul [Zero α] [SMulZeroClass R α] (r : R) (d : n → α) :
    diagonal (r • d) = r • diagonal d 
goal: Matrix.diagonal (r • d) = r • Matrix.diagonal d

full_name: Matrix.diagonal_neg
code: @[simp]
theorem diagonal_neg [NegZeroClass α] (d : n → α) :
    -diagonal d = diagonal fun i => -d i 
goal: -Matrix.diagonal d = Matrix.diagonal fun i => -d i

full_name: Matrix.diagonal_sub
code: @[simp]
theorem diagonal_sub [SubNegZeroMonoid α] (d₁ d₂ : n → α) :
    diagonal d₁ - diagonal d₂ = diagonal fun i => d₁ i - d₂ i 
goal: Matrix.diagonal d₁ - Matrix.diagonal d₂ = Matrix.diagonal fun i => d₁ i - d₂ i

full_name: Matrix.instNatCastOfZero
code: instance [Zero α] [NatCast α] : NatCast (Matrix n n α) 
goal: NatCast (Matrix n n α)

full_name: Matrix.diagonal_natCast
code: @[norm_cast]
theorem diagonal_natCast [Zero α] [NatCast α] (m : ℕ) : diagonal (fun _ : n => (m : α)) = m 
goal: (Matrix.diagonal fun x => ↑m) = ↑m

full_name: Matrix.diagonal_natCast'
code: @[norm_cast]
theorem diagonal_natCast' [Zero α] [NatCast α] (m : ℕ) : diagonal ((m : n → α)) = m 
goal: Matrix.diagonal ↑m = ↑m

full_name: Matrix.diagonal_ofNat
code: theorem diagonal_ofNat [Zero α] [NatCast α] (m : ℕ) [m.AtLeastTwo] :
    diagonal (fun _ : n => no_index (OfNat.ofNat m : α)) = OfNat.ofNat m 
goal: (Matrix.diagonal fun x => OfNat.ofNat m) = OfNat.ofNat m

full_name: Matrix.diagonal_ofNat'
code: theorem diagonal_ofNat' [Zero α] [NatCast α] (m : ℕ) [m.AtLeastTwo] :
    diagonal (no_index (OfNat.ofNat m : n → α)) = OfNat.ofNat m 
goal: Matrix.diagonal (OfNat.ofNat m) = OfNat.ofNat m

full_name: Matrix.instIntCastOfZero
code: instance [Zero α] [IntCast α] : IntCast (Matrix n n α) 
goal: IntCast (Matrix n n α)

full_name: Matrix.diagonal_intCast
code: @[norm_cast]
theorem diagonal_intCast [Zero α] [IntCast α] (m : ℤ) : diagonal (fun _ : n => (m : α)) = m 
goal: (Matrix.diagonal fun x => ↑m) = ↑m

full_name: Matrix.diagonal_intCast'
code: @[norm_cast]
theorem diagonal_intCast' [Zero α] [IntCast α] (m : ℤ) : diagonal ((m : n → α)) = m 
goal: Matrix.diagonal ↑m = ↑m

full_name: Matrix.diagonalAddMonoidHom_apply
code: /-- `Matrix.diagonal` as an `AddMonoidHom`. -/
@[simps]
def diagonalAddMonoidHom [AddZeroClass α] : (n → α) →+ Matrix n n α 
goal: (Matrix.diagonalAddMonoidHom n α) d = Matrix.diagonal d

full_name: Matrix.diagonalAddMonoidHom
code: /-- `Matrix.diagonal` as an `AddMonoidHom`. -/
@[simps]
def diagonalAddMonoidHom [AddZeroClass α] : (n → α) →+ Matrix n n α 
goal: (n → α) →+ Matrix n n α

full_name: Matrix.diagonalLinearMap_apply
code: /-- `Matrix.diagonal` as a `LinearMap`. -/
@[simps]
def diagonalLinearMap [Semiring R] [AddCommMonoid α] [Module R α] : (n → α) →ₗ[R] Matrix n n α 
goal: ∀ (a : n → α), (Matrix.diagonalLinearMap n R α) a = (↑(Matrix.diagonalAddMonoidHom n α)).toFun a

full_name: Matrix.diagonalLinearMap
code: /-- `Matrix.diagonal` as a `LinearMap`. -/
@[simps]
def diagonalLinearMap [Semiring R] [AddCommMonoid α] [Module R α] : (n → α) →ₗ[R] Matrix n n α 
goal: (n → α) →ₗ[R] Matrix n n α

full_name: Matrix.diagonal_map
code: @[simp]
theorem diagonal_map [Zero α] [Zero β] {f : α → β} (h : f 0 = 0) {d : n → α} :
    (diagonal d).map f = diagonal fun m => f (d m) 
goal: (Matrix.diagonal d).map f = Matrix.diagonal fun m => f (d m)

full_name: Matrix.map_natCast
code: protected theorem map_natCast [DecidableEq n] [AddMonoidWithOne α] [AddMonoidWithOne β]
    {f : α → β} (h : f 0 = 0) (d : ℕ) :
    (d : Matrix n n α).map f = diagonal (fun _ => f d) 
goal: (↑d).map f = Matrix.diagonal fun x => f ↑d

full_name: Matrix.map_ofNat
code: protected theorem map_ofNat [AddMonoidWithOne α] [AddMonoidWithOne β]
    {f : α → β} (h : f 0 = 0) (d : ℕ) [d.AtLeastTwo] :
    (no_index (OfNat.ofNat d) : Matrix n n α).map f = diagonal (fun _ => f (OfNat.ofNat d)) 
goal: (OfNat.ofNat d).map f = Matrix.diagonal fun x => f (OfNat.ofNat d)

full_name: Matrix.map_intCast
code: protected theorem map_intCast [DecidableEq n] [AddGroupWithOne α] [AddGroupWithOne β]
    {f : α → β} (h : f 0 = 0) (d : ℤ) :
    (d : Matrix n n α).map f = diagonal (fun _ => f d) 
goal: (↑d).map f = Matrix.diagonal fun x => f ↑d

full_name: Matrix.diagonal_conjTranspose
code: @[simp]
theorem diagonal_conjTranspose [AddMonoid α] [StarAddMonoid α] (v : n → α) :
    (diagonal v)ᴴ = diagonal (star v) 
goal: (Matrix.diagonal v)ᴴ = Matrix.diagonal (star v)

full_name: Matrix.one
code: instance one : One (Matrix n n α) 
goal: One (Matrix n n α)

full_name: Matrix.diagonal_one
code: @[simp]
theorem diagonal_one : (diagonal fun _ => 1 : Matrix n n α) = 1 
goal: (Matrix.diagonal fun x => 1) = 1

full_name: Matrix.one_apply
code: theorem one_apply {i j} : (1 : Matrix n n α) i j = if i = j then 1 else 0 
goal: 1 i j = if i = j then 1 else 0

full_name: Matrix.one_apply_eq
code: @[simp]
theorem one_apply_eq (i) : (1 : Matrix n n α) i i = 1 
goal: 1 i i = 1

full_name: Matrix.one_apply_ne
code: @[simp]
theorem one_apply_ne {i j} : i ≠ j → (1 : Matrix n n α) i j = 0 
goal: i ≠ j → 1 i j = 0

full_name: Matrix.one_apply_ne'
code: theorem one_apply_ne' {i j} : j ≠ i → (1 : Matrix n n α) i j = 0 
goal: j ≠ i → 1 i j = 0

full_name: Matrix.map_one
code: @[simp]
theorem map_one [Zero β] [One β] (f : α → β) (h₀ : f 0 = 0) (h₁ : f 1 = 1) :
    (1 : Matrix n n α).map f = (1 : Matrix n n β) 
goal: Matrix.map 1 f = 1

full_name: Matrix.one_eq_pi_single
code: theorem one_eq_pi_single {i j} : (1 : Matrix n n α) i j = Pi.single (f := fun _ => α) i 1 j 
goal: 1 i j = Pi.single i 1 j

full_name: Matrix.zero_le_one_elem
code: lemma zero_le_one_elem [Preorder α] [ZeroLEOneClass α] (i j : n) :
    0 ≤ (1 : Matrix n n α) i j 
goal: 0 ≤ 1 i j

full_name: Matrix.zero_le_one_row
code: lemma zero_le_one_row [Preorder α] [ZeroLEOneClass α] (i : n) :
    0 ≤ (1 : Matrix n n α) i 
goal: 0 ≤ 1 i

full_name: Matrix.instAddMonoidWithOne
code: instance instAddMonoidWithOne [AddMonoidWithOne α] : AddMonoidWithOne (Matrix n n α) 
goal: AddMonoidWithOne (Matrix n n α)

full_name: Matrix.instAddGroupWithOne
code: instance instAddGroupWithOne [AddGroupWithOne α] : AddGroupWithOne (Matrix n n α) 
goal: AddGroupWithOne (Matrix n n α)

full_name: Matrix.instAddCommMonoidWithOne
code: instance instAddCommMonoidWithOne [AddCommMonoidWithOne α] :
    AddCommMonoidWithOne (Matrix n n α) 
goal: AddCommMonoidWithOne (Matrix n n α)

full_name: Matrix.instAddCommGroupWithOne
code: instance instAddCommGroupWithOne [AddCommGroupWithOne α] :
    AddCommGroupWithOne (Matrix n n α) 
goal: AddCommGroupWithOne (Matrix n n α)

full_name: Matrix.diag
code: /-- The diagonal of a square matrix. -/
-- @[simp] -- Porting note: simpNF does not like this.
def diag (A : Matrix n n α) (i : n) : α 
goal: α

full_name: Matrix.diag_apply
code: @[simp]
theorem diag_apply (A : Matrix n n α) (i) : diag A i = A i i 
goal: A.diag i = A i i

full_name: Matrix.diag_diagonal
code: @[simp]
theorem diag_diagonal [DecidableEq n] [Zero α] (a : n → α) : diag (diagonal a) = a 
goal: (Matrix.diagonal a).diag = a

full_name: Matrix.diag_transpose
code: @[simp]
theorem diag_transpose (A : Matrix n n α) : diag Aᵀ = diag A 
goal: Aᵀ.diag = A.diag

full_name: Matrix.diag_zero
code: @[simp]
theorem diag_zero [Zero α] : diag (0 : Matrix n n α) = 0 
goal: Matrix.diag 0 = 0

full_name: Matrix.diag_add
code: @[simp]
theorem diag_add [Add α] (A B : Matrix n n α) : diag (A + B) = diag A + diag B 
goal: (A + B).diag = A.diag + B.diag

full_name: Matrix.diag_sub
code: @[simp]
theorem diag_sub [Sub α] (A B : Matrix n n α) : diag (A - B) = diag A - diag B 
goal: (A - B).diag = A.diag - B.diag

full_name: Matrix.diag_neg
code: @[simp]
theorem diag_neg [Neg α] (A : Matrix n n α) : diag (-A) = -diag A 
goal: (-A).diag = -A.diag

full_name: Matrix.diag_smul
code: @[simp]
theorem diag_smul [SMul R α] (r : R) (A : Matrix n n α) : diag (r • A) = r • diag A 
goal: (r • A).diag = r • A.diag

full_name: Matrix.diag_one
code: @[simp]
theorem diag_one [DecidableEq n] [Zero α] [One α] : diag (1 : Matrix n n α) = 1 
goal: Matrix.diag 1 = 1

full_name: Matrix.diagAddMonoidHom_apply
code: /-- `Matrix.diag` as an `AddMonoidHom`. -/
@[simps]
def diagAddMonoidHom [AddZeroClass α] : Matrix n n α →+ n → α 
goal: (Matrix.diagAddMonoidHom n α) A i = A.diag i

full_name: Matrix.diagAddMonoidHom
code: /-- `Matrix.diag` as an `AddMonoidHom`. -/
@[simps]
def diagAddMonoidHom [AddZeroClass α] : Matrix n n α →+ n → α 
goal: Matrix n n α →+ n → α

full_name: Matrix.diagLinearMap_apply
code: /-- `Matrix.diag` as a `LinearMap`. -/
@[simps]
def diagLinearMap [Semiring R] [AddCommMonoid α] [Module R α] : Matrix n n α →ₗ[R] n → α 
goal: ∀ (a : Matrix n n α) (a_1 : n), (Matrix.diagLinearMap n R α) a a_1 = (↑(Matrix.diagAddMonoidHom n α)).toFun a a_1

full_name: Matrix.diagLinearMap
code: /-- `Matrix.diag` as a `LinearMap`. -/
@[simps]
def diagLinearMap [Semiring R] [AddCommMonoid α] [Module R α] : Matrix n n α →ₗ[R] n → α 
goal: Matrix n n α →ₗ[R] n → α

full_name: Matrix.diag_map
code: theorem diag_map {f : α → β} {A : Matrix n n α} : diag (A.map f) = f ∘ diag A 
goal: (A.map f).diag = f ∘ A.diag

full_name: Matrix.diag_conjTranspose
code: @[simp]
theorem diag_conjTranspose [AddMonoid α] [StarAddMonoid α] (A : Matrix n n α) :
    diag Aᴴ = star (diag A) 
goal: Aᴴ.diag = star A.diag

full_name: Matrix.diag_list_sum
code: @[simp]
theorem diag_list_sum [AddMonoid α] (l : List (Matrix n n α)) : diag l.sum = (l.map diag).sum 
goal: l.sum.diag = (List.map Matrix.diag l).sum

full_name: Matrix.diag_multiset_sum
code: @[simp]
theorem diag_multiset_sum [AddCommMonoid α] (s : Multiset (Matrix n n α)) :
    diag s.sum = (s.map diag).sum 
goal: s.sum.diag = (Multiset.map Matrix.diag s).sum

full_name: Matrix.diag_sum
code: @[simp]
theorem diag_sum {ι} [AddCommMonoid α] (s : Finset ι) (f : ι → Matrix n n α) :
    diag (∑ i ∈ s, f i) = ∑ i ∈ s, diag (f i) 
goal: (∑ i ∈ s, f i).diag = ∑ i ∈ s, (f i).diag

full_name: Matrix.dotProduct
code: /-- `dotProduct v w` is the sum of the entrywise products `v i * w i` -/
def dotProduct [Mul α] [AddCommMonoid α] (v w : m → α) : α 
goal: α

full_name: Matrix.«_aux_Mathlib_Data_Matrix_Basic___macroRules_Matrix_term_⬝ᵥ__1»
code: @[inherit_doc]
scoped infixl:72 " ⬝ᵥ " => Matrix.dotProduct
goal: Lean.Macro

full_name: Matrix._aux_Mathlib_Data_Matrix_Basic___unexpand_Matrix_dotProduct_1
code: @[inherit_doc]
scoped infixl:72 " ⬝ᵥ " => Matrix.dotProduct
goal: Lean.PrettyPrinter.Unexpander

full_name: Matrix.dotProduct_assoc
code: theorem dotProduct_assoc [NonUnitalSemiring α] (u : m → α) (w : n → α) (v : Matrix m n α) :
    (fun j => u ⬝ᵥ fun i => v i j) ⬝ᵥ w = u ⬝ᵥ fun i => v i ⬝ᵥ w 
goal: (fun j => u ⬝ᵥ fun i => v i j) ⬝ᵥ w = u ⬝ᵥ fun i => v i ⬝ᵥ w

full_name: Matrix.dotProduct_comm
code: theorem dotProduct_comm [AddCommMonoid α] [CommSemigroup α] (v w : m → α) : v ⬝ᵥ w = w ⬝ᵥ v 
goal: v ⬝ᵥ w = w ⬝ᵥ v

full_name: Matrix.dotProduct_pUnit
code: @[simp]
theorem dotProduct_pUnit [AddCommMonoid α] [Mul α] (v w : PUnit → α) : v ⬝ᵥ w = v ⟨⟩ * w ⟨⟩ 
goal: v ⬝ᵥ w = v PUnit.unit * w PUnit.unit

full_name: Matrix.dotProduct_one
code: theorem dotProduct_one (v : n → α) : v ⬝ᵥ 1 = ∑ i, v i 
goal: v ⬝ᵥ 1 = ∑ i : n, v i

full_name: Matrix.one_dotProduct
code: theorem one_dotProduct (v : n → α) : 1 ⬝ᵥ v = ∑ i, v i 
goal: 1 ⬝ᵥ v = ∑ i : n, v i

full_name: Matrix.dotProduct_zero
code: @[simp]
theorem dotProduct_zero : v ⬝ᵥ 0 = 0 
goal: v ⬝ᵥ 0 = 0

full_name: Matrix.dotProduct_zero'
code: @[simp]
theorem dotProduct_zero' : (v ⬝ᵥ fun _ => 0) = 0 
goal: (v ⬝ᵥ fun x => 0) = 0

full_name: Matrix.zero_dotProduct
code: @[simp]
theorem zero_dotProduct : 0 ⬝ᵥ v = 0 
goal: 0 ⬝ᵥ v = 0

full_name: Matrix.zero_dotProduct'
code: @[simp]
theorem zero_dotProduct' : (fun _ => (0 : α)) ⬝ᵥ v = 0 
goal: (fun x => 0) ⬝ᵥ v = 0

full_name: Matrix.add_dotProduct
code: @[simp]
theorem add_dotProduct : (u + v) ⬝ᵥ w = u ⬝ᵥ w + v ⬝ᵥ w 
goal: (u + v) ⬝ᵥ w = u ⬝ᵥ w + v ⬝ᵥ w

full_name: Matrix.dotProduct_add
code: @[simp]
theorem dotProduct_add : u ⬝ᵥ (v + w) = u ⬝ᵥ v + u ⬝ᵥ w 
goal: u ⬝ᵥ (v + w) = u ⬝ᵥ v + u ⬝ᵥ w

full_name: Matrix.sum_elim_dotProduct_sum_elim
code: @[simp]
theorem sum_elim_dotProduct_sum_elim : Sum.elim u x ⬝ᵥ Sum.elim v y = u ⬝ᵥ v + x ⬝ᵥ y 
goal: Sum.elim u x ⬝ᵥ Sum.elim v y = u ⬝ᵥ v + x ⬝ᵥ y

full_name: Matrix.comp_equiv_symm_dotProduct
code: /-- Permuting a vector on the left of a dot product can be transferred to the right. -/
@[simp]
theorem comp_equiv_symm_dotProduct (e : m ≃ n) : u ∘ e.symm ⬝ᵥ x = u ⬝ᵥ x ∘ e 
goal: u ∘ ⇑e.symm ⬝ᵥ x = u ⬝ᵥ x ∘ ⇑e

full_name: Matrix.dotProduct_comp_equiv_symm
code: /-- Permuting a vector on the right of a dot product can be transferred to the left. -/
@[simp]
theorem dotProduct_comp_equiv_symm (e : n ≃ m) : u ⬝ᵥ x ∘ e.symm = u ∘ e ⬝ᵥ x 
goal: u ⬝ᵥ x ∘ ⇑e.symm = u ∘ ⇑e ⬝ᵥ x

full_name: Matrix.comp_equiv_dotProduct_comp_equiv
code: /-- Permuting vectors on both sides of a dot product is a no-op. -/
@[simp]
theorem comp_equiv_dotProduct_comp_equiv (e : m ≃ n) : x ∘ e ⬝ᵥ y ∘ e = x ⬝ᵥ y 
goal: x ∘ ⇑e ⬝ᵥ y ∘ ⇑e = x ⬝ᵥ y

full_name: Matrix.diagonal_dotProduct
code: @[simp]
theorem diagonal_dotProduct (i : m) : diagonal v i ⬝ᵥ w = v i * w i 
goal: Matrix.diagonal v i ⬝ᵥ w = v i * w i

full_name: Matrix.dotProduct_diagonal
code: @[simp]
theorem dotProduct_diagonal (i : m) : v ⬝ᵥ diagonal w i = v i * w i 
goal: v ⬝ᵥ Matrix.diagonal w i = v i * w i

full_name: Matrix.dotProduct_diagonal'
code: @[simp]
theorem dotProduct_diagonal' (i : m) : (v ⬝ᵥ fun j => diagonal w j i) = v i * w i 
goal: (v ⬝ᵥ fun j => Matrix.diagonal w j i) = v i * w i

full_name: Matrix.single_dotProduct
code: @[simp]
theorem single_dotProduct (x : α) (i : m) : Pi.single i x ⬝ᵥ v = x * v i 
goal: Pi.single i x ⬝ᵥ v = x * v i

full_name: Matrix.dotProduct_single
code: @[simp]
theorem dotProduct_single (x : α) (i : m) : v ⬝ᵥ Pi.single i x = v i * x 
goal: v ⬝ᵥ Pi.single i x = v i * x

full_name: Matrix.one_dotProduct_one
code: @[simp]
theorem one_dotProduct_one : (1 : n → α) ⬝ᵥ 1 = Fintype.card n 
goal: 1 ⬝ᵥ 1 = ↑(Fintype.card n)

full_name: Matrix.neg_dotProduct
code: @[simp]
theorem neg_dotProduct : -v ⬝ᵥ w = -(v ⬝ᵥ w) 
goal: -v ⬝ᵥ w = -(v ⬝ᵥ w)

full_name: Matrix.dotProduct_neg
code: @[simp]
theorem dotProduct_neg : v ⬝ᵥ -w = -(v ⬝ᵥ w) 
goal: v ⬝ᵥ -w = -(v ⬝ᵥ w)

full_name: Matrix.neg_dotProduct_neg
code: lemma neg_dotProduct_neg : -v ⬝ᵥ -w = v ⬝ᵥ w 
goal: -v ⬝ᵥ -w = v ⬝ᵥ w

full_name: Matrix.sub_dotProduct
code: @[simp]
theorem sub_dotProduct : (u - v) ⬝ᵥ w = u ⬝ᵥ w - v ⬝ᵥ w 
goal: (u - v) ⬝ᵥ w = u ⬝ᵥ w - v ⬝ᵥ w

full_name: Matrix.dotProduct_sub
code: @[simp]
theorem dotProduct_sub : u ⬝ᵥ (v - w) = u ⬝ᵥ v - u ⬝ᵥ w 
goal: u ⬝ᵥ (v - w) = u ⬝ᵥ v - u ⬝ᵥ w

full_name: Matrix.smul_dotProduct
code: @[simp]
theorem smul_dotProduct [IsScalarTower R α α] (x : R) (v w : m → α) :
    x • v ⬝ᵥ w = x • (v ⬝ᵥ w) 
goal: x • v ⬝ᵥ w = x • (v ⬝ᵥ w)

full_name: Matrix.dotProduct_smul
code: @[simp]
theorem dotProduct_smul [SMulCommClass R α α] (x : R) (v w : m → α) :
    v ⬝ᵥ x • w = x • (v ⬝ᵥ w) 
goal: v ⬝ᵥ x • w = x • (v ⬝ᵥ w)

full_name: Matrix.star_dotProduct_star
code: theorem star_dotProduct_star : star v ⬝ᵥ star w = star (w ⬝ᵥ v) 
goal: star v ⬝ᵥ star w = star (w ⬝ᵥ v)

full_name: Matrix.star_dotProduct
code: theorem star_dotProduct : star v ⬝ᵥ w = star (star w ⬝ᵥ v) 
goal: star v ⬝ᵥ w = star (star w ⬝ᵥ v)

full_name: Matrix.dotProduct_star
code: theorem dotProduct_star : v ⬝ᵥ star w = star (w ⬝ᵥ star v) 
goal: v ⬝ᵥ star w = star (w ⬝ᵥ star v)

full_name: Matrix.instHMulOfFintypeOfMulOfAddCommMonoid
code: /-- `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. -/
-- We want to be lower priority than `instHMul`, but without this we can't have operands with
-- implicit dimensions.
@[default_instance 100]
instance [Fintype m] [Mul α] [AddCommMonoid α] :
    HMul (Matrix l m α) (Matrix m n α) (Matrix l n α) 
goal: HMul (Matrix l m α) (Matrix m n α) (Matrix l n α)

full_name: Matrix.mul_apply
code: theorem mul_apply [Fintype m] [Mul α] [AddCommMonoid α] {M : Matrix l m α} {N : Matrix m n α}
    {i k} : (M * N) i k = ∑ j, M i j * N j k 
goal: (M * N) i k = ∑ j : m, M i j * N j k

full_name: Matrix.instMulOfFintypeOfAddCommMonoid
code: instance [Fintype n] [Mul α] [AddCommMonoid α] : Mul (Matrix n n α) 
goal: Mul (Matrix n n α)

full_name: Matrix.mul_apply'
code: theorem mul_apply' [Fintype m] [Mul α] [AddCommMonoid α] {M : Matrix l m α} {N : Matrix m n α}
    {i k} : (M * N) i k = (fun j => M i j) ⬝ᵥ fun j => N j k 
goal: (M * N) i k = (fun j => M i j) ⬝ᵥ fun j => N j k

full_name: Matrix.sum_apply
code: theorem sum_apply [AddCommMonoid α] (i : m) (j : n) (s : Finset β) (g : β → Matrix m n α) :
    (∑ c ∈ s, g c) i j = ∑ c ∈ s, g c i j 
goal: (∑ c ∈ s, g c) i j = ∑ c ∈ s, g c i j

full_name: Matrix.two_mul_expl
code: theorem two_mul_expl {R : Type*} [CommRing 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 
goal: (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

full_name: Matrix.smul_mul
code: @[simp]
theorem smul_mul [Fintype n] [Monoid R] [DistribMulAction R α] [IsScalarTower R α α] (a : R)
    (M : Matrix m n α) (N : Matrix n l α) : (a • M) * N = a • (M * N) 
goal: a • M * N = a • (M * N)

full_name: Matrix.mul_smul
code: @[simp]
theorem mul_smul [Fintype n] [Monoid R] [DistribMulAction R α] [SMulCommClass R α α]
    (M : Matrix m n α) (a : R) (N : Matrix n l α) : M * (a • N) = a • (M * N) 
goal: M * a • N = a • (M * N)

full_name: Matrix.mul_zero
code: @[simp]
protected theorem mul_zero [Fintype n] (M : Matrix m n α) : M * (0 : Matrix n o α) = 0 
goal: M * 0 = 0

full_name: Matrix.zero_mul
code: @[simp]
protected theorem zero_mul [Fintype m] (M : Matrix m n α) : (0 : Matrix l m α) * M = 0 
goal: 0 * M = 0

full_name: Matrix.mul_add
code: protected theorem mul_add [Fintype n] (L : Matrix m n α) (M N : Matrix n o α) :
    L * (M + N) = L * M + L * N 
goal: L * (M + N) = L * M + L * N

full_name: Matrix.add_mul
code: protected theorem add_mul [Fintype m] (L M : Matrix l m α) (N : Matrix m n α) :
    (L + M) * N = L * N + M * N 
goal: (L + M) * N = L * N + M * N

full_name: Matrix.nonUnitalNonAssocSemiring
code: instance nonUnitalNonAssocSemiring [Fintype n] : NonUnitalNonAssocSemiring (Matrix n n α) 
goal: NonUnitalNonAssocSemiring (Matrix n n α)

full_name: Matrix.diagonal_mul
code: @[simp]
theorem diagonal_mul [Fintype m] [DecidableEq m] (d : m → α) (M : Matrix m n α) (i j) :
    (diagonal d * M) i j = d i * M i j 
goal: (Matrix.diagonal d * M) i j = d i * M i j

full_name: Matrix.mul_diagonal
code: @[simp]
theorem mul_diagonal [Fintype n] [DecidableEq n] (d : n → α) (M : Matrix m n α) (i j) :
    (M * diagonal d) i j = M i j * d j 
goal: (M * Matrix.diagonal d) i j = M i j * d j

full_name: Matrix.diagonal_mul_diagonal
code: @[simp]
theorem diagonal_mul_diagonal [Fintype n] [DecidableEq n] (d₁ d₂ : n → α) :
    diagonal d₁ * diagonal d₂ = diagonal fun i => d₁ i * d₂ i 
goal: Matrix.diagonal d₁ * Matrix.diagonal d₂ = Matrix.diagonal fun i => d₁ i * d₂ i

full_name: Matrix.diagonal_mul_diagonal'
code: theorem diagonal_mul_diagonal' [Fintype n] [DecidableEq n] (d₁ d₂ : n → α) :
    diagonal d₁ * diagonal d₂ = diagonal fun i => d₁ i * d₂ i 
goal: Matrix.diagonal d₁ * Matrix.diagonal d₂ = Matrix.diagonal fun i => d₁ i * d₂ i

full_name: Matrix.smul_eq_diagonal_mul
code: theorem smul_eq_diagonal_mul [Fintype m] [DecidableEq m] (M : Matrix m n α) (a : α) :
    a • M = (diagonal fun _ => a) * M 
goal: a • M = (Matrix.diagonal fun x => a) * M

full_name: Matrix.op_smul_eq_mul_diagonal
code: theorem op_smul_eq_mul_diagonal [Fintype n] [DecidableEq n] (M : Matrix m n α) (a : α) :
    MulOpposite.op a • M = M * (diagonal fun _ : n => a) 
goal: MulOpposite.op a • M = M * Matrix.diagonal fun x => a

full_name: Matrix.addMonoidHomMulLeft_apply
code: /-- Left multiplication by a matrix, as an `AddMonoidHom` from matrices to matrices. -/
@[simps]
def addMonoidHomMulLeft [Fintype m] (M : Matrix l m α) : Matrix m n α →+ Matrix l n α 
goal: M.addMonoidHomMulLeft x = M * x

full_name: Matrix.addMonoidHomMulLeft
code: /-- Left multiplication by a matrix, as an `AddMonoidHom` from matrices to matrices. -/
@[simps]
def addMonoidHomMulLeft [Fintype m] (M : Matrix l m α) : Matrix m n α →+ Matrix l n α 
goal: Matrix m n α →+ Matrix l n α

full_name: Matrix.addMonoidHomMulRight
code: /-- Right multiplication by a matrix, as an `AddMonoidHom` from matrices to matrices. -/
@[simps]
def addMonoidHomMulRight [Fintype m] (M : Matrix m n α) : Matrix l m α →+ Matrix l n α 
goal: Matrix l m α →+ Matrix l n α

full_name: Matrix.addMonoidHomMulRight_apply
code: /-- Right multiplication by a matrix, as an `AddMonoidHom` from matrices to matrices. -/
@[simps]
def addMonoidHomMulRight [Fintype m] (M : Matrix m n α) : Matrix l m α →+ Matrix l n α 
goal: M.addMonoidHomMulRight x = x * M

full_name: Matrix.sum_mul
code: protected theorem sum_mul [Fintype m] (s : Finset β) (f : β → Matrix l m α) (M : Matrix m n α) :
    (∑ a ∈ s, f a) * M = ∑ a ∈ s, f a * M 
goal: (∑ a ∈ s, f a) * M = ∑ a ∈ s, f a * M

full_name: Matrix.mul_sum
code: protected theorem mul_sum [Fintype m] (s : Finset β) (f : β → Matrix m n α) (M : Matrix l m α) :
    (M * ∑ a ∈ s, f a) = ∑ a ∈ s, M * f a 
goal: M * ∑ a ∈ s, f a = ∑ a ∈ s, M * f a

full_name: Matrix.Semiring.isScalarTower
code: /-- This instance enables use with `smul_mul_assoc`. -/
instance Semiring.isScalarTower [Fintype n] [Monoid R] [DistribMulAction R α]
    [IsScalarTower R α α] : IsScalarTower R (Matrix n n α) (Matrix n n α) 
goal: IsScalarTower R (Matrix n n α) (Matrix n n α)

full_name: Matrix.Semiring.smulCommClass
code: /-- This instance enables use with `mul_smul_comm`. -/
instance Semiring.smulCommClass [Fintype n] [Monoid R] [DistribMulAction R α]
    [SMulCommClass R α α] : SMulCommClass R (Matrix n n α) (Matrix n n α) 
goal: SMulCommClass R (Matrix n n α) (Matrix n n α)

full_name: Matrix.one_mul
code: @[simp]
protected theorem one_mul [Fintype m] [DecidableEq m] (M : Matrix m n α) :
    (1 : Matrix m m α) * M = M 
goal: 1 * M = M

full_name: Matrix.mul_one
code: @[simp]
protected theorem mul_one [Fintype n] [DecidableEq n] (M : Matrix m n α) :
    M * (1 : Matrix n n α) = M 
goal: M * 1 = M

full_name: Matrix.nonAssocSemiring
code: instance nonAssocSemiring [Fintype n] [DecidableEq n] : NonAssocSemiring (Matrix n n α) 
goal: NonAssocSemiring (Matrix n n α)

full_name: Matrix.map_mul
code: @[simp]
theorem map_mul [Fintype n] {L : Matrix m n α} {M : Matrix n o α} [NonAssocSemiring β]
    {f : α →+* β} : (L * M).map f = L.map f * M.map f 
goal: (L * M).map ⇑f = L.map ⇑f * M.map ⇑f

full_name: Matrix.smul_one_eq_diagonal
code: theorem smul_one_eq_diagonal [DecidableEq m] (a : α) :
    a • (1 : Matrix m m α) = diagonal fun _ => a 
goal: a • 1 = Matrix.diagonal fun x => a

full_name: Matrix.op_smul_one_eq_diagonal
code: theorem op_smul_one_eq_diagonal [DecidableEq m] (a : α) :
    MulOpposite.op a • (1 : Matrix m m α) = diagonal fun _ => a 
goal: MulOpposite.op a • 1 = Matrix.diagonal fun x => a

full_name: Matrix.diagonalRingHom_apply
code: /-- `Matrix.diagonal` as a `RingHom`. -/
@[simps]
def diagonalRingHom [Fintype n] [DecidableEq n] : (n → α) →+* Matrix n n α 
goal: (Matrix.diagonalRingHom n α) d = Matrix.diagonal d

full_name: Matrix.diagonalRingHom
code: /-- `Matrix.diagonal` as a `RingHom`. -/
@[simps]
def diagonalRingHom [Fintype n] [DecidableEq n] : (n → α) →+* Matrix n n α 
goal: (n → α) →+* Matrix n n α

full_name: Matrix.mul_assoc
code: protected theorem mul_assoc (L : Matrix l m α) (M : Matrix m n α) (N : Matrix n o α) :
    L * M * N = L * (M * N) 
goal: L * M * N = L * (M * N)

full_name: Matrix.nonUnitalSemiring
code: instance nonUnitalSemiring : NonUnitalSemiring (Matrix n n α) 
goal: NonUnitalSemiring (Matrix n n α)

full_name: Matrix.semiring
code: instance semiring [Fintype n] [DecidableEq n] : Semiring (Matrix n n α) 
goal: Semiring (Matrix n n α)

full_name: Matrix.neg_mul
code: @[simp]
protected theorem neg_mul (M : Matrix m n α) (N : Matrix n o α) : (-M) * N = -(M * N) 
goal: -M * N = -(M * N)

full_name: Matrix.mul_neg
code: @[simp]
protected theorem mul_neg (M : Matrix m n α) (N : Matrix n o α) : M * (-N) = -(M * N) 
goal: M * -N = -(M * N)

full_name: Matrix.sub_mul
code: protected theorem sub_mul (M M' : Matrix m n α) (N : Matrix n o α) :
    (M - M') * N = M * N - M' * N 
goal: (M - M') * N = M * N - M' * N

full_name: Matrix.mul_sub
code: protected theorem mul_sub (M : Matrix m n α) (N N' : Matrix n o α) :
    M * (N - N') = M * N - M * N' 
goal: M * (N - N') = M * N - M * N'

full_name: Matrix.nonUnitalNonAssocRing
code: instance nonUnitalNonAssocRing : NonUnitalNonAssocRing (Matrix n n α) 
goal: NonUnitalNonAssocRing (Matrix n n α)

full_name: Matrix.instNonUnitalRing
code: instance instNonUnitalRing [Fintype n] [NonUnitalRing α] : NonUnitalRing (Matrix n n α) 
goal: NonUnitalRing (Matrix n n α)

full_name: Matrix.instNonAssocRing
code: instance instNonAssocRing [Fintype n] [DecidableEq n] [NonAssocRing α] :
    NonAssocRing (Matrix n n α) 
goal: NonAssocRing (Matrix n n α)

full_name: Matrix.instRing
code: instance instRing [Fintype n] [DecidableEq n] [Ring α] : Ring (Matrix n n α) 
goal: Ring (Matrix n n α)

full_name: Matrix.diagonal_pow
code: theorem diagonal_pow [Fintype n] [DecidableEq n] (v : n → α) (k : ℕ) :
    diagonal v ^ k = diagonal (v ^ k) 
goal: Matrix.diagonal v ^ k = Matrix.diagonal (v ^ k)

full_name: Matrix.mul_mul_left
code: @[simp]
theorem mul_mul_left [Fintype n] (M : Matrix m n α) (N : Matrix n o α) (a : α) :
    (of fun i j => a * M i j) * N = a • (M * N) 
goal: (Matrix.of fun i j => a * M i j) * N = a • (M * N)

full_name: Matrix.scalar
code: /-- The ring homomorphism `α →+* Matrix n n α`
sending `a` to the diagonal matrix with `a` on the diagonal.
-/
def scalar (n : Type u) [DecidableEq n] [Fintype n] : α →+* Matrix n n α 
goal: α →+* Matrix n n α

full_name: Matrix.scalar_apply
code: @[simp]
theorem scalar_apply (a : α) : scalar n a = diagonal fun _ => a 
goal: (Matrix.scalar n) a = Matrix.diagonal fun x => a

full_name: Matrix.scalar_inj
code: theorem scalar_inj [Nonempty n] {r s : α} : scalar n r = scalar n s ↔ r = s 
goal: (Matrix.scalar n) r = (Matrix.scalar n) s ↔ r = s

full_name: Matrix.scalar_commute_iff
code: theorem scalar_commute_iff {r : α} {M : Matrix n n α} :
    Commute (scalar n r) M ↔ r • M = MulOpposite.op r • M 
goal: Commute ((Matrix.scalar n) r) M ↔ r • M = MulOpposite.op r • M

full_name: Matrix.scalar_commute
code: theorem scalar_commute (r : α) (hr : ∀ r', Commute r r') (M : Matrix n n α) :
    Commute (scalar n r) M 
goal: Commute ((Matrix.scalar n) r) M

full_name: Matrix.smul_eq_mul_diagonal
code: theorem smul_eq_mul_diagonal [Fintype n] [DecidableEq n] (M : Matrix m n α) (a : α) :
    a • M = M * diagonal fun _ => a 
goal: a • M = M * Matrix.diagonal fun x => a

full_name: Matrix.mul_mul_right
code: @[simp]
theorem mul_mul_right [Fintype n] (M : Matrix m n α) (N : Matrix n o α) (a : α) :
    (M * of fun i j => a * N i j) = a • (M * N) 
goal: (M * Matrix.of fun i j => a * N i j) = a • (M * N)

full_name: Matrix.instAlgebra
code: instance instAlgebra : Algebra R (Matrix n n α) 
goal: Algebra R (Matrix n n α)

full_name: Matrix.algebraMap_matrix_apply
code: theorem algebraMap_matrix_apply {r : R} {i j : n} :
    algebraMap R (Matrix n n α) r i j = if i = j then algebraMap R α r else 0 
goal: (algebraMap R (Matrix n n α)) r i j = if i = j then (algebraMap R α) r else 0

full_name: Matrix.algebraMap_eq_diagonal
code: theorem algebraMap_eq_diagonal (r : R) :
    algebraMap R (Matrix n n α) r = diagonal (algebraMap R (n → α) r) 
goal: (algebraMap R (Matrix n n α)) r = Matrix.diagonal ((algebraMap R (n → α)) r)

full_name: Matrix.algebraMap_eq_diagonalRingHom
code: theorem algebraMap_eq_diagonalRingHom :
    algebraMap R (Matrix n n α) = (diagonalRingHom n α).comp (algebraMap R _) 
goal: algebraMap R (Matrix n n α) = (Matrix.diagonalRingHom n α).comp (algebraMap R (n → α))

full_name: Matrix.map_algebraMap
code: @[simp]
theorem map_algebraMap (r : R) (f : α → β) (hf : f 0 = 0)
    (hf₂ : f (algebraMap R α r) = algebraMap R β r) :
    (algebraMap R (Matrix n n α) r).map f = algebraMap R (Matrix n n β) r 
goal: ((algebraMap R (Matrix n n α)) r).map f = (algebraMap R (Matrix n n β)) r

full_name: Matrix.diagonalAlgHom
code: /-- `Matrix.diagonal` as an `AlgHom`. -/
@[simps]
def diagonalAlgHom : (n → α) →ₐ[R] Matrix n n α 
goal: (n → α) →ₐ[R] Matrix n n α

full_name: Matrix.diagonalAlgHom_apply
code: /-- `Matrix.diagonal` as an `AlgHom`. -/
@[simps]
def diagonalAlgHom : (n → α) →ₐ[R] Matrix n n α 
goal: (Matrix.diagonalAlgHom R) d = Matrix.diagonal d

full_name: Equiv.mapMatrix
code: /-- The `Equiv` between spaces of matrices induced by an `Equiv` between their
coefficients. This is `Matrix.map` as an `Equiv`. -/
@[simps apply]
def mapMatrix (f : α ≃ β) : Matrix m n α ≃ Matrix m n β 
goal: Matrix m n α ≃ Matrix m n β

full_name: Equiv.mapMatrix_apply
code: /-- The `Equiv` between spaces of matrices induced by an `Equiv` between their
coefficients. This is `Matrix.map` as an `Equiv`. -/
@[simps apply]
def mapMatrix (f : α ≃ β) : Matrix m n α ≃ Matrix m n β 
goal: f.mapMatrix M = M.map ⇑f

full_name: Equiv.mapMatrix_refl
code: @[simp]
theorem mapMatrix_refl : (Equiv.refl α).mapMatrix = Equiv.refl (Matrix m n α) 
goal: (Equiv.refl α).mapMatrix = Equiv.refl (Matrix m n α)

full_name: Equiv.mapMatrix_symm
code: @[simp]
theorem mapMatrix_symm (f : α ≃ β) : f.mapMatrix.symm = (f.symm.mapMatrix : Matrix m n β ≃ _) 
goal: f.mapMatrix.symm = f.symm.mapMatrix

full_name: Equiv.mapMatrix_trans
code: @[simp]
theorem mapMatrix_trans (f : α ≃ β) (g : β ≃ γ) :
    f.mapMatrix.trans g.mapMatrix = ((f.trans g).mapMatrix : Matrix m n α ≃ _) 
goal: f.mapMatrix.trans g.mapMatrix = (f.trans g).mapMatrix

full_name: AddMonoidHom.mapMatrix
code: /-- The `AddMonoidHom` between spaces of matrices induced by an `AddMonoidHom` between their
coefficients. This is `Matrix.map` as an `AddMonoidHom`. -/
@[simps]
def mapMatrix (f : α →+ β) : Matrix m n α →+ Matrix m n β 
goal: Matrix m n α →+ Matrix m n β

full_name: AddMonoidHom.mapMatrix_apply
code: /-- The `AddMonoidHom` between spaces of matrices induced by an `AddMonoidHom` between their
coefficients. This is `Matrix.map` as an `AddMonoidHom`. -/
@[simps]
def mapMatrix (f : α →+ β) : Matrix m n α →+ Matrix m n β 
goal: f.mapMatrix M = M.map ⇑f

full_name: AddMonoidHom.mapMatrix_id
code: @[simp]
theorem mapMatrix_id : (AddMonoidHom.id α).mapMatrix = AddMonoidHom.id (Matrix m n α) 
goal: (AddMonoidHom.id α).mapMatrix = AddMonoidHom.id (Matrix m n α)

full_name: AddMonoidHom.mapMatrix_comp
code: @[simp]
theorem mapMatrix_comp (f : β →+ γ) (g : α →+ β) :
    f.mapMatrix.comp g.mapMatrix = ((f.comp g).mapMatrix : Matrix m n α →+ _) 
goal: f.mapMatrix.comp g.mapMatrix = (f.comp g).mapMatrix

full_name: AddEquiv.mapMatrix
code: /-- The `AddEquiv` between spaces of matrices induced by an `AddEquiv` between their
coefficients. This is `Matrix.map` as an `AddEquiv`. -/
@[simps apply]
def mapMatrix (f : α ≃+ β) : Matrix m n α ≃+ Matrix m n β 
goal: Matrix m n α ≃+ Matrix m n β

full_name: AddEquiv.mapMatrix_apply
code: /-- The `AddEquiv` between spaces of matrices induced by an `AddEquiv` between their
coefficients. This is `Matrix.map` as an `AddEquiv`. -/
@[simps apply]
def mapMatrix (f : α ≃+ β) : Matrix m n α ≃+ Matrix m n β 
goal: f.mapMatrix M = M.map ⇑f

full_name: AddEquiv.mapMatrix_refl
code: @[simp]
theorem mapMatrix_refl : (AddEquiv.refl α).mapMatrix = AddEquiv.refl (Matrix m n α) 
goal: (AddEquiv.refl α).mapMatrix = AddEquiv.refl (Matrix m n α)

full_name: AddEquiv.mapMatrix_symm
code: @[simp]
theorem mapMatrix_symm (f : α ≃+ β) : f.mapMatrix.symm = (f.symm.mapMatrix : Matrix m n β ≃+ _) 
goal: f.mapMatrix.symm = f.symm.mapMatrix

full_name: AddEquiv.mapMatrix_trans
code: @[simp]
theorem mapMatrix_trans (f : α ≃+ β) (g : β ≃+ γ) :
    f.mapMatrix.trans g.mapMatrix = ((f.trans g).mapMatrix : Matrix m n α ≃+ _) 
goal: f.mapMatrix.trans g.mapMatrix = (f.trans g).mapMatrix

full_name: LinearMap.mapMatrix
code: /-- The `LinearMap` between spaces of matrices induced by a `LinearMap` between their
coefficients. This is `Matrix.map` as a `LinearMap`. -/
@[simps]
def mapMatrix (f : α →ₗ[R] β) : Matrix m n α →ₗ[R] Matrix m n β 
goal: Matrix m n α →ₗ[R] Matrix m n β

full_name: LinearMap.mapMatrix_apply
code: /-- The `LinearMap` between spaces of matrices induced by a `LinearMap` between their
coefficients. This is `Matrix.map` as a `LinearMap`. -/
@[simps]
def mapMatrix (f : α →ₗ[R] β) : Matrix m n α →ₗ[R] Matrix m n β 
goal: f.mapMatrix M = M.map ⇑f

full_name: LinearMap.mapMatrix_id
code: @[simp]
theorem mapMatrix_id : LinearMap.id.mapMatrix = (LinearMap.id : Matrix m n α →ₗ[R] _) 
goal: LinearMap.id.mapMatrix = LinearMap.id

full_name: LinearMap.mapMatrix_comp
code: @[simp]
theorem mapMatrix_comp (f : β →ₗ[R] γ) (g : α →ₗ[R] β) :
    f.mapMatrix.comp g.mapMatrix = ((f.comp g).mapMatrix : Matrix m n α →ₗ[R] _) 
goal: f.mapMatrix ∘ₗ g.mapMatrix = (f ∘ₗ g).mapMatrix

full_name: LinearEquiv.mapMatrix_apply
code: /-- The `LinearEquiv` between spaces of matrices induced by a `LinearEquiv` between their
coefficients. This is `Matrix.map` as a `LinearEquiv`. -/
@[simps apply]
def mapMatrix (f : α ≃ₗ[R] β) : Matrix m n α ≃ₗ[R] Matrix m n β 
goal: f.mapMatrix M = M.map ⇑f

full_name: LinearEquiv.mapMatrix
code: /-- The `LinearEquiv` between spaces of matrices induced by a `LinearEquiv` between their
coefficients. This is `Matrix.map` as a `LinearEquiv`. -/
@[simps apply]
def mapMatrix (f : α ≃ₗ[R] β) : Matrix m n α ≃ₗ[R] Matrix m n β 
goal: Matrix m n α ≃ₗ[R] Matrix m n β

full_name: LinearEquiv.mapMatrix_refl
code: @[simp]
theorem mapMatrix_refl : (LinearEquiv.refl R α).mapMatrix = LinearEquiv.refl R (Matrix m n α) 
goal: (LinearEquiv.refl R α).mapMatrix = LinearEquiv.refl R (Matrix m n α)

full_name: LinearEquiv.mapMatrix_symm
code: @[simp]
theorem mapMatrix_symm (f : α ≃ₗ[R] β) :
    f.mapMatrix.symm = (f.symm.mapMatrix : Matrix m n β ≃ₗ[R] _) 
goal: f.mapMatrix.symm = f.symm.mapMatrix

full_name: LinearEquiv.mapMatrix_trans
code: @[simp]
theorem mapMatrix_trans (f : α ≃ₗ[R] β) (g : β ≃ₗ[R] γ) :
    f.mapMatrix.trans g.mapMatrix = ((f.trans g).mapMatrix : Matrix m n α ≃ₗ[R] _) 
goal: f.mapMatrix ≪≫ₗ g.mapMatrix = (f ≪≫ₗ g).mapMatrix

full_name: RingHom.mapMatrix_apply
code: /-- The `RingHom` between spaces of square matrices induced by a `RingHom` between their
coefficients. This is `Matrix.map` as a `RingHom`. -/
@[simps]
def mapMatrix (f : α →+* β) : Matrix m m α →+* Matrix m m β 
goal: f.mapMatrix M = M.map ⇑f

full_name: RingHom.mapMatrix
code: /-- The `RingHom` between spaces of square matrices induced by a `RingHom` between their
coefficients. This is `Matrix.map` as a `RingHom`. -/
@[simps]
def mapMatrix (f : α →+* β) : Matrix m m α →+* Matrix m m β 
goal: Matrix m m α →+* Matrix m m β

full_name: RingHom.mapMatrix_id
code: @[simp]
theorem mapMatrix_id : (RingHom.id α).mapMatrix = RingHom.id (Matrix m m α) 
goal: (RingHom.id α).mapMatrix = RingHom.id (Matrix m m α)

full_name: RingHom.mapMatrix_comp
code: @[simp]
theorem mapMatrix_comp (f : β →+* γ) (g : α →+* β) :
    f.mapMatrix.comp g.mapMatrix = ((f.comp g).mapMatrix : Matrix m m α →+* _) 
goal: f.mapMatrix.comp g.mapMatrix = (f.comp g).mapMatrix

full_name: RingEquiv.mapMatrix_apply
code: /-- The `RingEquiv` between spaces of square matrices induced by a `RingEquiv` between their
coefficients. This is `Matrix.map` as a `RingEquiv`. -/
@[simps apply]
def mapMatrix (f : α ≃+* β) : Matrix m m α ≃+* Matrix m m β 
goal: f.mapMatrix M = M.map ⇑f

full_name: RingEquiv.mapMatrix
code: /-- The `RingEquiv` between spaces of square matrices induced by a `RingEquiv` between their
coefficients. This is `Matrix.map` as a `RingEquiv`. -/
@[simps apply]
def mapMatrix (f : α ≃+* β) : Matrix m m α ≃+* Matrix m m β 
goal: Matrix m m α ≃+* Matrix m m β

full_name: RingEquiv.mapMatrix_refl
code: @[simp]
theorem mapMatrix_refl : (RingEquiv.refl α).mapMatrix = RingEquiv.refl (Matrix m m α) 
goal: (RingEquiv.refl α).mapMatrix = RingEquiv.refl (Matrix m m α)

full_name: RingEquiv.mapMatrix_symm
code: @[simp]
theorem mapMatrix_symm (f : α ≃+* β) : f.mapMatrix.symm = (f.symm.mapMatrix : Matrix m m β ≃+* _) 
goal: f.mapMatrix.symm = f.symm.mapMatrix

full_name: RingEquiv.mapMatrix_trans
code: @[simp]
theorem mapMatrix_trans (f : α ≃+* β) (g : β ≃+* γ) :
    f.mapMatrix.trans g.mapMatrix = ((f.trans g).mapMatrix : Matrix m m α ≃+* _) 
goal: f.mapMatrix.trans g.mapMatrix = (f.trans g).mapMatrix

full_name: AlgHom.mapMatrix_apply
code: /-- The `AlgHom` between spaces of square matrices induced by an `AlgHom` between their
coefficients. This is `Matrix.map` as an `AlgHom`. -/
@[simps]
def mapMatrix (f : α →ₐ[R] β) : Matrix m m α →ₐ[R] Matrix m m β 
goal: f.mapMatrix M = M.map ⇑f

full_name: AlgHom.mapMatrix
code: /-- The `AlgHom` between spaces of square matrices induced by an `AlgHom` between their
coefficients. This is `Matrix.map` as an `AlgHom`. -/
@[simps]
def mapMatrix (f : α →ₐ[R] β) : Matrix m m α →ₐ[R] Matrix m m β 
goal: Matrix m m α →ₐ[R] Matrix m m β

full_name: AlgHom.mapMatrix_id
code: @[simp]
theorem mapMatrix_id : (AlgHom.id R α).mapMatrix = AlgHom.id R (Matrix m m α) 
goal: (AlgHom.id R α).mapMatrix = AlgHom.id R (Matrix m m α)

full_name: AlgHom.mapMatrix_comp
code: @[simp]
theorem mapMatrix_comp (f : β →ₐ[R] γ) (g : α →ₐ[R] β) :
    f.mapMatrix.comp g.mapMatrix = ((f.comp g).mapMatrix : Matrix m m α →ₐ[R] _) 
goal: f.mapMatrix.comp g.mapMatrix = (f.comp g).mapMatrix

full_name: AlgEquiv.mapMatrix_apply
code: /-- The `AlgEquiv` between spaces of square matrices induced by an `AlgEquiv` between their
coefficients. This is `Matrix.map` as an `AlgEquiv`. -/
@[simps apply]
def mapMatrix (f : α ≃ₐ[R] β) : Matrix m m α ≃ₐ[R] Matrix m m β 
goal: f.mapMatrix M = M.map ⇑f

full_name: AlgEquiv.mapMatrix
code: /-- The `AlgEquiv` between spaces of square matrices induced by an `AlgEquiv` between their
coefficients. This is `Matrix.map` as an `AlgEquiv`. -/
@[simps apply]
def mapMatrix (f : α ≃ₐ[R] β) : Matrix m m α ≃ₐ[R] Matrix m m β 
goal: Matrix m m α ≃ₐ[R] Matrix m m β

full_name: AlgEquiv.mapMatrix_refl
code: @[simp]
theorem mapMatrix_refl : AlgEquiv.refl.mapMatrix = (AlgEquiv.refl : Matrix m m α ≃ₐ[R] _) 
goal: AlgEquiv.refl.mapMatrix = AlgEquiv.refl

full_name: AlgEquiv.mapMatrix_symm
code: @[simp]
theorem mapMatrix_symm (f : α ≃ₐ[R] β) :
    f.mapMatrix.symm = (f.symm.mapMatrix : Matrix m m β ≃ₐ[R] _) 
goal: f.mapMatrix.symm = f.symm.mapMatrix

full_name: AlgEquiv.mapMatrix_trans
code: @[simp]
theorem mapMatrix_trans (f : α ≃ₐ[R] β) (g : β ≃ₐ[R] γ) :
    f.mapMatrix.trans g.mapMatrix = ((f.trans g).mapMatrix : Matrix m m α ≃ₐ[R] _) 
goal: f.mapMatrix.trans g.mapMatrix = (f.trans g).mapMatrix

full_name: Matrix.vecMulVec
code: /-- 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`. -/
def vecMulVec [Mul α] (w : m → α) (v : n → α) : Matrix m n α 
goal: Matrix m n α

full_name: Matrix.vecMulVec_apply
code: theorem vecMulVec_apply [Mul α] (w : m → α) (v : n → α) (i j) : vecMulVec w v i j = w i * v j 
goal: Matrix.vecMulVec w v i j = w i * v j

full_name: Matrix.mulVec
code: /--
`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)`.
-/
def mulVec [Fintype n] (M : Matrix m n α) (v : n → α) : m → α
  
goal: m → α

full_name: Matrix._aux_Mathlib_Data_Matrix_Basic___unexpand_Matrix_mulVec_1
code: @[inherit_doc]
scoped infixr:73 " *ᵥ " => Matrix.mulVec
goal: Lean.PrettyPrinter.Unexpander

full_name: Matrix.«_aux_Mathlib_Data_Matrix_Basic___macroRules_Matrix_term_*ᵥ__1»
code: @[inherit_doc]
scoped infixr:73 " *ᵥ " => Matrix.mulVec
goal: Lean.Macro

full_name: Matrix.vecMul
code: /--
`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)`.
-/
def vecMul [Fintype m] (v : m → α) (M : Matrix m n α) : n → α
  
goal: n → α

full_name: Matrix._aux_Mathlib_Data_Matrix_Basic___unexpand_Matrix_vecMul_1
code: @[inherit_doc]
scoped infixl:73 " ᵥ* " => Matrix.vecMul
goal: Lean.PrettyPrinter.Unexpander

full_name: Matrix.«_aux_Mathlib_Data_Matrix_Basic___macroRules_Matrix_term_ᵥ*__1»
code: @[inherit_doc]
scoped infixl:73 " ᵥ* " => Matrix.vecMul
goal: Lean.Macro

full_name: Matrix.mulVec.addMonoidHomLeft_apply
code: /-- Left multiplication by a matrix, as an `AddMonoidHom` from vectors to vectors. -/
@[simps]
def mulVec.addMonoidHomLeft [Fintype n] (v : n → α) : Matrix m n α →+ m → α 
goal: ∀ (a : m), (Matrix.mulVec.addMonoidHomLeft v) M a = (M *ᵥ v) a

full_name: Matrix.mulVec.addMonoidHomLeft
code: /-- Left multiplication by a matrix, as an `AddMonoidHom` from vectors to vectors. -/
@[simps]
def mulVec.addMonoidHomLeft [Fintype n] (v : n → α) : Matrix m n α →+ m → α 
goal: Matrix m n α →+ m → α

full_name: Matrix.mul_apply_eq_vecMul
code: /-- The `i`th row of the multiplication is the same as the `vecMul` with the `i`th row of `A`. -/
theorem mul_apply_eq_vecMul [Fintype n] (A : Matrix m n α) (B : Matrix n o α) (i : m) :
    (A * B) i = A i ᵥ* B 
goal: (A * B) i = A i ᵥ* B

full_name: Matrix.mulVec_diagonal
code: theorem mulVec_diagonal [Fintype m] [DecidableEq m] (v w : m → α) (x : m) :
    (diagonal v *ᵥ w) x = v x * w x 
goal: (Matrix.diagonal v *ᵥ w) x = v x * w x

full_name: Matrix.vecMul_diagonal
code: theorem vecMul_diagonal [Fintype m] [DecidableEq m] (v w : m → α) (x : m) :
    (v ᵥ* diagonal w) x = v x * w x 
goal: (v ᵥ* Matrix.diagonal w) x = v x * w x

full_name: Matrix.dotProduct_mulVec
code: /-- Associate the dot product of `mulVec` to the left. -/
theorem dotProduct_mulVec [Fintype n] [Fintype m] [NonUnitalSemiring R] (v : m → R)
    (A : Matrix m n R) (w : n → R) : v ⬝ᵥ A *ᵥ w = v ᵥ* A ⬝ᵥ w 
goal: v ⬝ᵥ A *ᵥ w = v ᵥ* A ⬝ᵥ w

full_name: Matrix.mulVec_zero
code: @[simp]
theorem mulVec_zero [Fintype n] (A : Matrix m n α) : A *ᵥ 0 = 0 
goal: A *ᵥ 0 = 0

full_name: Matrix.zero_vecMul
code: @[simp]
theorem zero_vecMul [Fintype m] (A : Matrix m n α) : 0 ᵥ* A = 0 
goal: 0 ᵥ* A = 0

full_name: Matrix.zero_mulVec
code: @[simp]
theorem zero_mulVec [Fintype n] (v : n → α) : (0 : Matrix m n α) *ᵥ v = 0 
goal: 0 *ᵥ v = 0

full_name: Matrix.vecMul_zero
code: @[simp]
theorem vecMul_zero [Fintype m] (v : m → α) : v ᵥ* (0 : Matrix m n α) = 0 
goal: v ᵥ* 0 = 0

full_name: Matrix.smul_mulVec_assoc
code: theorem smul_mulVec_assoc [Fintype n] [Monoid R] [DistribMulAction R α] [IsScalarTower R α α]
    (a : R) (A : Matrix m n α) (b : n → α) : (a • A) *ᵥ b = a • A *ᵥ b 
goal: (a • A) *ᵥ b = a • A *ᵥ b

full_name: Matrix.mulVec_add
code: theorem mulVec_add [Fintype n] (A : Matrix m n α) (x y : n → α) :
    A *ᵥ (x + y) = A *ᵥ x + A *ᵥ y 
goal: A *ᵥ (x + y) = A *ᵥ x + A *ᵥ y

full_name: Matrix.add_mulVec
code: theorem add_mulVec [Fintype n] (A B : Matrix m n α) (x : n → α) :
    (A + B) *ᵥ x = A *ᵥ x + B *ᵥ x 
goal: (A + B) *ᵥ x = A *ᵥ x + B *ᵥ x

full_name: Matrix.vecMul_add
code: theorem vecMul_add [Fintype m] (A B : Matrix m n α) (x : m → α) :
    x ᵥ* (A + B) = x ᵥ* A + x ᵥ* B 
goal: x ᵥ* (A + B) = x ᵥ* A + x ᵥ* B

full_name: Matrix.add_vecMul
code: theorem add_vecMul [Fintype m] (A : Matrix m n α) (x y : m → α) :
    (x + y) ᵥ* A = x ᵥ* A + y ᵥ* A 
goal: (x + y) ᵥ* A = x ᵥ* A + y ᵥ* A

full_name: Matrix.vecMul_smul
code: theorem vecMul_smul [Fintype n] [Monoid R] [NonUnitalNonAssocSemiring S] [DistribMulAction R S]
    [IsScalarTower R S S] (M : Matrix n m S) (b : R) (v : n → S) :
    (b • v) ᵥ* M = b • v ᵥ* M 
goal: (b • v) ᵥ* M = b • v ᵥ* M

full_name: Matrix.mulVec_smul
code: theorem mulVec_smul [Fintype n] [Monoid R] [NonUnitalNonAssocSemiring S] [DistribMulAction R S]
    [SMulCommClass R S S] (M : Matrix m n S) (b : R) (v : n → S) :
    M *ᵥ (b • v) = b • M *ᵥ v 
goal: M *ᵥ b • v = b • M *ᵥ v

full_name: Matrix.mulVec_single
code: @[simp]
theorem mulVec_single [Fintype n] [DecidableEq n] [NonUnitalNonAssocSemiring R] (M : Matrix m n R)
    (j : n) (x : R) : M *ᵥ Pi.single j x = fun i => M i j * x 
goal: M *ᵥ Pi.single j x = fun i => M i j * x

full_name: Matrix.single_vecMul
code: @[simp]
theorem single_vecMul [Fintype m] [DecidableEq m] [NonUnitalNonAssocSemiring R] (M : Matrix m n R)
    (i : m) (x : R) : Pi.single i x ᵥ* M = fun j => x * M i j 
goal: Pi.single i x ᵥ* M = fun j => x * M i j

full_name: Matrix.diagonal_mulVec_single
code: theorem diagonal_mulVec_single [Fintype n] [DecidableEq n] [NonUnitalNonAssocSemiring R] (v : n → R)
    (j : n) (x : R) : diagonal v *ᵥ Pi.single j x = Pi.single j (v j * x) 
goal: Matrix.diagonal v *ᵥ Pi.single j x = Pi.single j (v j * x)

full_name: Matrix.single_vecMul_diagonal
code: theorem single_vecMul_diagonal [Fintype n] [DecidableEq n] [NonUnitalNonAssocSemiring R] (v : n → R)
    (j : n) (x : R) : (Pi.single j x) ᵥ* (diagonal v) = Pi.single j (x * v j) 
goal: Pi.single j x ᵥ* Matrix.diagonal v = Pi.single j (x * v j)

full_name: Matrix.vecMul_vecMul
code: @[simp]
theorem vecMul_vecMul [Fintype n] [Fintype m] (v : m → α) (M : Matrix m n α) (N : Matrix n o α) :
    v ᵥ* M ᵥ* N = v ᵥ* (M * N) 
goal: v ᵥ* M ᵥ* N = v ᵥ* (M * N)

full_name: Matrix.mulVec_mulVec
code: @[simp]
theorem mulVec_mulVec [Fintype n] [Fintype o] (v : o → α) (M : Matrix m n α) (N : Matrix n o α) :
    M *ᵥ N *ᵥ v = (M * N) *ᵥ v 
goal: M *ᵥ N *ᵥ v = (M * N) *ᵥ v

full_name: Matrix.star_mulVec
code: theorem star_mulVec [Fintype n] [StarRing α] (M : Matrix m n α) (v : n → α) :
    star (M *ᵥ v) = star v ᵥ* Mᴴ 
goal: star (M *ᵥ v) = star v ᵥ* Mᴴ

full_name: Matrix.star_vecMul
code: theorem star_vecMul [Fintype m] [StarRing α] (M : Matrix m n α) (v : m → α) :
    star (v ᵥ* M) = Mᴴ *ᵥ star v 
goal: star (v ᵥ* M) = Mᴴ *ᵥ star v

full_name: Matrix.mulVec_conjTranspose
code: theorem mulVec_conjTranspose [Fintype m] [StarRing α] (A : Matrix m n α) (x : m → α) :
    Aᴴ *ᵥ x = star (star x ᵥ* A) 
goal: Aᴴ *ᵥ x = star (star x ᵥ* A)

full_name: Matrix.vecMul_conjTranspose
code: theorem vecMul_conjTranspose [Fintype n] [StarRing α] (A : Matrix m n α) (x : n → α) :
    x ᵥ* Aᴴ = star (A *ᵥ star x) 
goal: x ᵥ* Aᴴ = star (A *ᵥ star x)

full_name: Matrix.mul_mul_apply
code: theorem mul_mul_apply [Fintype n] (A B C : Matrix n n α) (i j : n) :
    (A * B * C) i j = A i ⬝ᵥ B *ᵥ (Cᵀ j) 
goal: (A * B * C) i j = A i ⬝ᵥ B *ᵥ Cᵀ j

full_name: Matrix.mulVec_one
code: theorem mulVec_one [Fintype n] (A : Matrix m n α) : A *ᵥ 1 = fun i => ∑ j, A i j 
goal: A *ᵥ 1 = fun i => ∑ j : n, A i j

full_name: Matrix.vec_one_mul
code: theorem vec_one_mul [Fintype m] (A : Matrix m n α) : 1 ᵥ* A = fun j => ∑ i, A i j 
goal: 1 ᵥ* A = fun j => ∑ i : m, A i j

full_name: Matrix.one_mulVec
code: @[simp]
theorem one_mulVec (v : m → α) : 1 *ᵥ v = v 
goal: 1 *ᵥ v = v

full_name: Matrix.vecMul_one
code: @[simp]
theorem vecMul_one (v : m → α) : v ᵥ* 1 = v 
goal: v ᵥ* 1 = v

full_name: Matrix.diagonal_const_mulVec
code: @[simp]
theorem diagonal_const_mulVec (x : α) (v : m → α) :
    (diagonal fun _ => x) *ᵥ v = x • v 
goal: (Matrix.diagonal fun x_1 => x) *ᵥ v = x • v

full_name: Matrix.vecMul_diagonal_const
code: @[simp]
theorem vecMul_diagonal_const (x : α) (v : m → α) :
    v ᵥ* (diagonal fun _ => x) = MulOpposite.op x • v 
goal: (v ᵥ* Matrix.diagonal fun x_1 => x) = MulOpposite.op x • v

full_name: Matrix.natCast_mulVec
code: @[simp]
theorem natCast_mulVec (x : ℕ) (v : m → α) : x *ᵥ v = (x : α) • v 
goal: ↑x *ᵥ v = ↑x • v

full_name: Matrix.vecMul_natCast
code: @[simp]
theorem vecMul_natCast (x : ℕ) (v : m → α) : v ᵥ* x = MulOpposite.op (x : α) • v 
goal: v ᵥ* ↑x = MulOpposite.op ↑x • v

full_name: Matrix.ofNat_mulVec
code: @[simp]
theorem ofNat_mulVec (x : ℕ) [x.AtLeastTwo] (v : m → α) :
    OfNat.ofNat (no_index x) *ᵥ v = (OfNat.ofNat x : α) • v 
goal: OfNat.ofNat x *ᵥ v = OfNat.ofNat x • v

full_name: Matrix.vecMul_ofNat
code: @[simp]
theorem vecMul_ofNat (x : ℕ) [x.AtLeastTwo] (v : m → α) :
    v ᵥ* OfNat.ofNat (no_index x) = MulOpposite.op (OfNat.ofNat x : α) • v 
goal: v ᵥ* OfNat.ofNat x = MulOpposite.op (OfNat.ofNat x) • v

full_name: Matrix.neg_vecMul
code: theorem neg_vecMul [Fintype m] (v : m → α) (A : Matrix m n α) : (-v) ᵥ* A = - (v ᵥ* A) 
goal: -v ᵥ* A = -(v ᵥ* A)

full_name: Matrix.vecMul_neg
code: theorem vecMul_neg [Fintype m] (v : m → α) (A : Matrix m n α) : v ᵥ* (-A) = - (v ᵥ* A) 
goal: v ᵥ* -A = -(v ᵥ* A)

full_name: Matrix.neg_vecMul_neg
code: lemma neg_vecMul_neg [Fintype m] (v : m → α) (A : Matrix m n α) : (-v) ᵥ* (-A) = v ᵥ* A 
goal: -v ᵥ* -A = v ᵥ* A

full_name: Matrix.neg_mulVec
code: theorem neg_mulVec [Fintype n] (v : n → α) (A : Matrix m n α) : (-A) *ᵥ v = - (A *ᵥ v) 
goal: -A *ᵥ v = -(A *ᵥ v)

full_name: Matrix.mulVec_neg
code: theorem mulVec_neg [Fintype n] (v : n → α) (A : Matrix m n α) : A *ᵥ (-v) = - (A *ᵥ v) 
goal: A *ᵥ -v = -(A *ᵥ v)

full_name: Matrix.neg_mulVec_neg
code: lemma neg_mulVec_neg [Fintype n] (v : n → α) (A : Matrix m n α) : (-A) *ᵥ (-v) = A *ᵥ v 
goal: -A *ᵥ -v = A *ᵥ v

full_name: Matrix.mulVec_sub
code: theorem mulVec_sub [Fintype n] (A : Matrix m n α) (x y : n → α) :
    A *ᵥ (x - y) = A *ᵥ x - A *ᵥ y 
goal: A *ᵥ (x - y) = A *ᵥ x - A *ᵥ y

full_name: Matrix.sub_mulVec
code: theorem sub_mulVec [Fintype n] (A B : Matrix m n α) (x : n → α) :
    (A - B) *ᵥ x = A *ᵥ x - B *ᵥ x 
goal: (A - B) *ᵥ x = A *ᵥ x - B *ᵥ x

full_name: Matrix.vecMul_sub
code: theorem vecMul_sub [Fintype m] (A B : Matrix m n α) (x : m → α) :
    x ᵥ* (A - B) = x ᵥ* A - x ᵥ* B 
goal: x ᵥ* (A - B) = x ᵥ* A - x ᵥ* B

full_name: Matrix.sub_vecMul
code: theorem sub_vecMul [Fintype m] (A : Matrix m n α) (x y : m → α) :
    (x - y) ᵥ* A = x ᵥ* A - y ᵥ* A 
goal: (x - y) ᵥ* A = x ᵥ* A - y ᵥ* A

full_name: Matrix.mulVec_transpose
code: theorem mulVec_transpose [Fintype m] (A : Matrix m n α) (x : m → α) : Aᵀ *ᵥ x = x ᵥ* A 
goal: Aᵀ *ᵥ x = x ᵥ* A

full_name: Matrix.vecMul_transpose
code: theorem vecMul_transpose [Fintype n] (A : Matrix m n α) (x : n → α) : x ᵥ* Aᵀ = A *ᵥ x 
goal: x ᵥ* Aᵀ = A *ᵥ x

full_name: Matrix.mulVec_vecMul
code: theorem mulVec_vecMul [Fintype n] [Fintype o] (A : Matrix m n α) (B : Matrix o n α) (x : o → α) :
    A *ᵥ (x ᵥ* B) = (A * Bᵀ) *ᵥ x 
goal: A *ᵥ x ᵥ* B = (A * Bᵀ) *ᵥ x

full_name: Matrix.vecMul_mulVec
code: theorem vecMul_mulVec [Fintype m] [Fintype n] (A : Matrix m n α) (B : Matrix m o α) (x : n → α) :
    (A *ᵥ x) ᵥ* B = x ᵥ* (Aᵀ * B) 
goal: (A *ᵥ x) ᵥ* B = x ᵥ* (Aᵀ * B)

full_name: Matrix.mulVec_smul_assoc
code: theorem mulVec_smul_assoc [Fintype n] (A : Matrix m n α) (b : n → α) (a : α) :
    A *ᵥ (a • b) = a • A *ᵥ b 
goal: A *ᵥ a • b = a • A *ᵥ b

full_name: Matrix.intCast_mulVec
code: @[simp]
theorem intCast_mulVec (x : ℤ) (v : m → α) : x *ᵥ v = (x : α) • v 
goal: ↑x *ᵥ v = ↑x • v

full_name: Matrix.vecMul_intCast
code: @[simp]
theorem vecMul_intCast (x : ℤ) (v : m → α) : v ᵥ* x = MulOpposite.op (x : α) • v 
goal: v ᵥ* ↑x = MulOpposite.op ↑x • v

full_name: Matrix.transpose_transpose
code: @[simp]
theorem transpose_transpose (M : Matrix m n α) : Mᵀᵀ = M 
goal: Mᵀᵀ = M

full_name: Matrix.transpose_injective
code: theorem transpose_injective : Function.Injective (transpose : Matrix m n α → Matrix n m α) 
goal: Function.Injective Matrix.transpose

full_name: Matrix.transpose_inj
code: @[simp] theorem transpose_inj {A B : Matrix m n α} : Aᵀ = Bᵀ ↔ A = B 
goal: Aᵀ = Bᵀ ↔ A = B

full_name: Matrix.transpose_eq_diagonal
code: @[simp]
theorem transpose_eq_diagonal [DecidableEq n] [Zero α] {M : Matrix n n α} {v : n → α} :
    Mᵀ = diagonal v ↔ M = diagonal v 
goal: Mᵀ = Matrix.diagonal v ↔ M = Matrix.diagonal v

full_name: Matrix.transpose_zero
code: @[simp]
theorem transpose_zero [Zero α] : (0 : Matrix m n α)ᵀ = 0 
goal: 0ᵀ = 0

full_name: Matrix.transpose_eq_zero
code: @[simp]
theorem transpose_eq_zero [Zero α] {M : Matrix m n α} : Mᵀ = 0 ↔ M = 0 
goal: Mᵀ = 0 ↔ M = 0

full_name: Matrix.transpose_one
code: @[simp]
theorem transpose_one [DecidableEq n] [Zero α] [One α] : (1 : Matrix n n α)ᵀ = 1 
goal: 1ᵀ = 1

full_name: Matrix.transpose_eq_one
code: @[simp]
theorem transpose_eq_one [DecidableEq n] [Zero α] [One α] {M : Matrix n n α} : Mᵀ = 1 ↔ M = 1 
goal: Mᵀ = 1 ↔ M = 1

full_name: Matrix.transpose_natCast
code: @[simp]
theorem transpose_natCast [DecidableEq n] [AddMonoidWithOne α] (d : ℕ) :
    (d : Matrix n n α)ᵀ = d 
goal: (↑d)ᵀ = ↑d

full_name: Matrix.transpose_eq_natCast
code: @[simp]
theorem transpose_eq_natCast [DecidableEq n] [AddMonoidWithOne α] {M : Matrix n n α} {d : ℕ} :
    Mᵀ = d ↔ M = d 
goal: Mᵀ = ↑d ↔ M = ↑d

full_name: Matrix.transpose_ofNat
code: @[simp]
theorem transpose_ofNat [DecidableEq n] [AddMonoidWithOne α] (d : ℕ) [d.AtLeastTwo] :
    (no_index (OfNat.ofNat d) : Matrix n n α)ᵀ = OfNat.ofNat d 
goal: (OfNat.ofNat d)ᵀ = OfNat.ofNat d

full_name: Matrix.transpose_eq_ofNat
code: @[simp]
theorem transpose_eq_ofNat [DecidableEq n] [AddMonoidWithOne α]
    {M : Matrix n n α} {d : ℕ} [d.AtLeastTwo] :
    Mᵀ = no_index (OfNat.ofNat d) ↔ M = OfNat.ofNat d 
goal: Mᵀ = OfNat.ofNat d ↔ M = OfNat.ofNat d

full_name: Matrix.transpose_intCast
code: @[simp]
theorem transpose_intCast [DecidableEq n] [AddGroupWithOne α] (d : ℤ) :
    (d : Matrix n n α)ᵀ = d 
goal: (↑d)ᵀ = ↑d

full_name: Matrix.transpose_eq_intCast
code: @[simp]
theorem transpose_eq_intCast [DecidableEq n] [AddGroupWithOne α]
    {M : Matrix n n α} {d : ℤ} :
    Mᵀ = d ↔ M = d 
goal: Mᵀ = ↑d ↔ M = ↑d

full_name: Matrix.transpose_add
code: @[simp]
theorem transpose_add [Add α] (M : Matrix m n α) (N : Matrix m n α) : (M + N)ᵀ = Mᵀ + Nᵀ 
goal: (M + N)ᵀ = Mᵀ + Nᵀ

full_name: Matrix.transpose_sub
code: @[simp]
theorem transpose_sub [Sub α] (M : Matrix m n α) (N : Matrix m n α) : (M - N)ᵀ = Mᵀ - Nᵀ 
goal: (M - N)ᵀ = Mᵀ - Nᵀ

full_name: Matrix.transpose_mul
code: @[simp]
theorem transpose_mul [AddCommMonoid α] [CommSemigroup α] [Fintype n] (M : Matrix m n α)
    (N : Matrix n l α) : (M * N)ᵀ = Nᵀ * Mᵀ 
goal: (M * N)ᵀ = Nᵀ * Mᵀ

full_name: Matrix.transpose_smul
code: @[simp]
theorem transpose_smul {R : Type*} [SMul R α] (c : R) (M : Matrix m n α) : (c • M)ᵀ = c • Mᵀ 
goal: (c • M)ᵀ = c • Mᵀ

full_name: Matrix.transpose_neg
code: @[simp]
theorem transpose_neg [Neg α] (M : Matrix m n α) : (-M)ᵀ = -Mᵀ 
goal: (-M)ᵀ = -Mᵀ

full_name: Matrix.transpose_map
code: theorem transpose_map {f : α → β} {M : Matrix m n α} : Mᵀ.map f = (M.map f)ᵀ 
goal: Mᵀ.map f = (M.map f)ᵀ

full_name: Matrix.transposeAddEquiv
code: /-- `Matrix.transpose` as an `AddEquiv` -/
@[simps apply]
def transposeAddEquiv [Add α] : Matrix m n α ≃+ Matrix n m α 
goal: Matrix m n α ≃+ Matrix n m α

full_name: Matrix.transposeAddEquiv_apply
code: /-- `Matrix.transpose` as an `AddEquiv` -/
@[simps apply]
def transposeAddEquiv [Add α] : Matrix m n α ≃+ Matrix n m α 
goal: (Matrix.transposeAddEquiv m n α) M = Mᵀ

full_name: Matrix.transposeAddEquiv_symm
code: @[simp]
theorem transposeAddEquiv_symm [Add α] : (transposeAddEquiv m n α).symm = transposeAddEquiv n m α 
goal: (Matrix.transposeAddEquiv m n α).symm = Matrix.transposeAddEquiv n m α

full_name: Matrix.transpose_list_sum
code: theorem transpose_list_sum [AddMonoid α] (l : List (Matrix m n α)) :
    l.sumᵀ = (l.map transpose).sum 
goal: l.sumᵀ = (List.map Matrix.transpose l).sum

full_name: Matrix.transpose_multiset_sum
code: theorem transpose_multiset_sum [AddCommMonoid α] (s : Multiset (Matrix m n α)) :
    s.sumᵀ = (s.map transpose).sum 
goal: s.sumᵀ = (Multiset.map Matrix.transpose s).sum

full_name: Matrix.transpose_sum
code: theorem transpose_sum [AddCommMonoid α] {ι : Type*} (s : Finset ι) (M : ι → Matrix m n α) :
    (∑ i ∈ s, M i)ᵀ = ∑ i ∈ s, (M i)ᵀ 
goal: (∑ i ∈ s, M i)ᵀ = ∑ i ∈ s, (M i)ᵀ

full_name: Matrix.transposeLinearEquiv
code: /-- `Matrix.transpose` as a `LinearMap` -/
@[simps apply]
def transposeLinearEquiv [Semiring R] [AddCommMonoid α] [Module R α] :
    Matrix m n α ≃ₗ[R] Matrix n m α 
goal: Matrix m n α ≃ₗ[R] Matrix n m α

full_name: Matrix.transposeLinearEquiv_apply
code: /-- `Matrix.transpose` as a `LinearMap` -/
@[simps apply]
def transposeLinearEquiv [Semiring R] [AddCommMonoid α] [Module R α] :
    Matrix m n α ≃ₗ[R] Matrix n m α 
goal: ∀ (a : Matrix m n α), (Matrix.transposeLinearEquiv m n R α) a = (Matrix.transposeAddEquiv m n α).toFun a

full_name: Matrix.transposeLinearEquiv_symm
code: @[simp]
theorem transposeLinearEquiv_symm [Semiring R] [AddCommMonoid α] [Module R α] :
    (transposeLinearEquiv m n R α).symm = transposeLinearEquiv n m R α 
goal: (Matrix.transposeLinearEquiv m n R α).symm = Matrix.transposeLinearEquiv n m R α

full_name: Matrix.transposeRingEquiv_symm_apply
code: /-- `Matrix.transpose` as a `RingEquiv` to the opposite ring -/
@[simps]
def transposeRingEquiv [AddCommMonoid α] [CommSemigroup α] [Fintype m] :
    Matrix m m α ≃+* (Matrix m m α)ᵐᵒᵖ 
goal: (Matrix.transposeRingEquiv m α).symm M = (MulOpposite.unop M)ᵀ

full_name: Matrix.transposeRingEquiv
code: /-- `Matrix.transpose` as a `RingEquiv` to the opposite ring -/
@[simps]
def transposeRingEquiv [AddCommMonoid α] [CommSemigroup α] [Fintype m] :
    Matrix m m α ≃+* (Matrix m m α)ᵐᵒᵖ 
goal: Matrix m m α ≃+* (Matrix m m α)ᵐᵒᵖ

full_name: Matrix.transposeRingEquiv_apply
code: /-- `Matrix.transpose` as a `RingEquiv` to the opposite ring -/
@[simps]
def transposeRingEquiv [AddCommMonoid α] [CommSemigroup α] [Fintype m] :
    Matrix m m α ≃+* (Matrix m m α)ᵐᵒᵖ 
goal: (Matrix.transposeRingEquiv m α) M = MulOpposite.op Mᵀ

full_name: Matrix.transpose_pow
code: @[simp]
theorem transpose_pow [CommSemiring α] [Fintype m] [DecidableEq m] (M : Matrix m m α) (k : ℕ) :
    (M ^ k)ᵀ = Mᵀ ^ k 
goal: (M ^ k)ᵀ = Mᵀ ^ k

full_name: Matrix.transpose_list_prod
code: theorem transpose_list_prod [CommSemiring α] [Fintype m] [DecidableEq m] (l : List (Matrix m m α)) :
    l.prodᵀ = (l.map transpose).reverse.prod 
goal: l.prodᵀ = (List.map Matrix.transpose l).reverse.prod

full_name: Matrix.transposeAlgEquiv
code: /-- `Matrix.transpose` as an `AlgEquiv` to the opposite ring -/
@[simps]
def transposeAlgEquiv [CommSemiring R] [CommSemiring α] [Fintype m] [DecidableEq m] [Algebra R α] :
    Matrix m m α ≃ₐ[R] (Matrix m m α)ᵐᵒᵖ 
goal: Matrix m m α ≃ₐ[R] (Matrix m m α)ᵐᵒᵖ

full_name: Matrix.transposeAlgEquiv_symm_apply
code: /-- `Matrix.transpose` as an `AlgEquiv` to the opposite ring -/
@[simps]
def transposeAlgEquiv [CommSemiring R] [CommSemiring α] [Fintype m] [DecidableEq m] [Algebra R α] :
    Matrix m m α ≃ₐ[R] (Matrix m m α)ᵐᵒᵖ 
goal: ∀ (a : (Matrix m m α)ᵐᵒᵖ),
  (Matrix.transposeAlgEquiv m R α).symm a = ((Matrix.transposeAddEquiv m m α).trans MulOpposite.opAddEquiv).invFun a

full_name: Matrix.transposeAlgEquiv_apply
code: /-- `Matrix.transpose` as an `AlgEquiv` to the opposite ring -/
@[simps]
def transposeAlgEquiv [CommSemiring R] [CommSemiring α] [Fintype m] [DecidableEq m] [Algebra R α] :
    Matrix m m α ≃ₐ[R] (Matrix m m α)ᵐᵒᵖ 
goal: (Matrix.transposeAlgEquiv m R α) M = MulOpposite.op Mᵀ

full_name: Matrix.conjTranspose_apply
code: /-- Tell `simp` what the entries are in a conjugate transposed matrix.

  Compare with `mul_apply`, `diagonal_apply_eq`, etc.
-/
@[simp]
theorem conjTranspose_apply [Star α] (M : Matrix m n α) (i j) :
    M.conjTranspose j i = star (M i j) 
goal: Mᴴ j i = star (M i j)

full_name: Matrix.conjTranspose_conjTranspose
code: @[simp]
theorem conjTranspose_conjTranspose [InvolutiveStar α] (M : Matrix m n α) : Mᴴᴴ = M 
goal: Mᴴᴴ = M

full_name: Matrix.conjTranspose_injective
code: theorem conjTranspose_injective [InvolutiveStar α] :
    Function.Injective (conjTranspose : Matrix m n α → Matrix n m α) 
goal: Function.Injective Matrix.conjTranspose

full_name: Matrix.conjTranspose_inj
code: @[simp] theorem conjTranspose_inj [InvolutiveStar α] {A B : Matrix m n α} : Aᴴ = Bᴴ ↔ A = B 
goal: Aᴴ = Bᴴ ↔ A = B

full_name: Matrix.conjTranspose_eq_diagonal
code: @[simp]
theorem conjTranspose_eq_diagonal [DecidableEq n] [AddMonoid α] [StarAddMonoid α]
    {M : Matrix n n α} {v : n → α} :
    Mᴴ = diagonal v ↔ M = diagonal (star v) 
goal: Mᴴ = Matrix.diagonal v ↔ M = Matrix.diagonal (star v)

full_name: Matrix.conjTranspose_zero
code: @[simp]
theorem conjTranspose_zero [AddMonoid α] [StarAddMonoid α] : (0 : Matrix m n α)ᴴ = 0 
goal: 0ᴴ = 0

full_name: Matrix.conjTranspose_eq_zero
code: @[simp]
theorem conjTranspose_eq_zero [AddMonoid α] [StarAddMonoid α] {M : Matrix m n α} :
    Mᴴ = 0 ↔ M = 0 
goal: Mᴴ = 0 ↔ M = 0

full_name: Matrix.conjTranspose_one
code: @[simp]
theorem conjTranspose_one [DecidableEq n] [Semiring α] [StarRing α] : (1 : Matrix n n α)ᴴ = 1 
goal: 1ᴴ = 1

full_name: Matrix.conjTranspose_eq_one
code: @[simp]
theorem conjTranspose_eq_one [DecidableEq n] [Semiring α] [StarRing α] {M : Matrix n n α} :
    Mᴴ = 1 ↔ M = 1 
goal: Mᴴ = 1 ↔ M = 1

full_name: Matrix.conjTranspose_natCast
code: @[simp]
theorem conjTranspose_natCast [DecidableEq n] [Semiring α] [StarRing α] (d : ℕ) :
    (d : Matrix n n α)ᴴ = d 
goal: (↑d)ᴴ = ↑d

full_name: Matrix.conjTranspose_eq_natCast
code: @[simp]
theorem conjTranspose_eq_natCast [DecidableEq n] [Semiring α] [StarRing α]
    {M : Matrix n n α} {d : ℕ} :
    Mᴴ = d ↔ M = d 
goal: Mᴴ = ↑d ↔ M = ↑d

full_name: Matrix.conjTranspose_ofNat
code: @[simp]
theorem conjTranspose_ofNat [DecidableEq n] [Semiring α] [StarRing α] (d : ℕ) [d.AtLeastTwo] :
    (no_index (OfNat.ofNat d) : Matrix n n α)ᴴ = OfNat.ofNat d 
goal: (OfNat.ofNat d)ᴴ = OfNat.ofNat d

full_name: Matrix.conjTranspose_eq_ofNat
code: @[simp]
theorem conjTranspose_eq_ofNat [DecidableEq n] [Semiring α] [StarRing α]
    {M : Matrix n n α} {d : ℕ} [d.AtLeastTwo] :
    Mᴴ = no_index (OfNat.ofNat d) ↔ M = OfNat.ofNat d 
goal: Mᴴ = OfNat.ofNat d ↔ M = OfNat.ofNat d

full_name: Matrix.conjTranspose_intCast
code: @[simp]
theorem conjTranspose_intCast [DecidableEq n] [Ring α] [StarRing α] (d : ℤ) :
    (d : Matrix n n α)ᴴ = d 
goal: (↑d)ᴴ = ↑d

full_name: Matrix.conjTranspose_eq_intCast
code: @[simp]
theorem conjTranspose_eq_intCast [DecidableEq n] [Ring α] [StarRing α]
    {M : Matrix n n α} {d : ℤ} :
    Mᴴ = d ↔ M = d 
goal: Mᴴ = ↑d ↔ M = ↑d

full_name: Matrix.conjTranspose_add
code: @[simp]
theorem conjTranspose_add [AddMonoid α] [StarAddMonoid α] (M N : Matrix m n α) :
    (M + N)ᴴ = Mᴴ + Nᴴ 
goal: (M + N)ᴴ = Mᴴ + Nᴴ

full_name: Matrix.conjTranspose_sub
code: @[simp]
theorem conjTranspose_sub [AddGroup α] [StarAddMonoid α] (M N : Matrix m n α) :
    (M - N)ᴴ = Mᴴ - Nᴴ 
goal: (M - N)ᴴ = Mᴴ - Nᴴ

full_name: Matrix.conjTranspose_smul
code: /-- 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 conjTranspose_smul [Star R] [Star α] [SMul R α] [StarModule R α] (c : R)
    (M : Matrix m n α) : (c • M)ᴴ = star c • Mᴴ 
goal: (c • M)ᴴ = star c • Mᴴ

full_name: Matrix.conjTranspose_smul_non_comm
code: @[simp]
theorem conjTranspose_smul_non_comm [Star R] [Star α] [SMul R α] [SMul Rᵐᵒᵖ α] (c : R)
    (M : Matrix m n α) (h : ∀ (r : R) (a : α), star (r • a) = MulOpposite.op (star r) • star a) :
    (c • M)ᴴ = MulOpposite.op (star c) • Mᴴ 
goal: (c • M)ᴴ = MulOpposite.op (star c) • Mᴴ

full_name: Matrix.conjTranspose_smul_self
code: theorem conjTranspose_smul_self [Mul α] [StarMul α] (c : α) (M : Matrix m n α) :
    (c • M)ᴴ = MulOpposite.op (star c) • Mᴴ 
goal: (c • M)ᴴ = MulOpposite.op (star c) • Mᴴ

full_name: Matrix.conjTranspose_nsmul
code: @[simp]
theorem conjTranspose_nsmul [AddMonoid α] [StarAddMonoid α] (c : ℕ) (M : Matrix m n α) :
    (c • M)ᴴ = c • Mᴴ 
goal: (c • M)ᴴ = c • Mᴴ

full_name: Matrix.conjTranspose_zsmul
code: @[simp]
theorem conjTranspose_zsmul [AddGroup α] [StarAddMonoid α] (c : ℤ) (M : Matrix m n α) :
    (c • M)ᴴ = c • Mᴴ 
goal: (c • M)ᴴ = c • Mᴴ

full_name: Matrix.conjTranspose_natCast_smul
code: @[simp]
theorem conjTranspose_natCast_smul [Semiring R] [AddCommMonoid α] [StarAddMonoid α] [Module R α]
    (c : ℕ) (M : Matrix m n α) : ((c : R) • M)ᴴ = (c : R) • Mᴴ 
goal: (↑c • M)ᴴ = ↑c • Mᴴ

full_name: Matrix.conjTranspose_ofNat_smul
code: @[simp]
theorem conjTranspose_ofNat_smul [Semiring R] [AddCommMonoid α] [StarAddMonoid α] [Module R α]
    (c : ℕ) [c.AtLeastTwo] (M : Matrix m n α) :
    ((no_index (OfNat.ofNat c : R)) • M)ᴴ = (OfNat.ofNat c : R) • Mᴴ 
goal: (OfNat.ofNat c • M)ᴴ = OfNat.ofNat c • Mᴴ

full_name: Matrix.conjTranspose_intCast_smul
code: @[simp]
theorem conjTranspose_intCast_smul [Ring R] [AddCommGroup α] [StarAddMonoid α] [Module R α] (c : ℤ)
    (M : Matrix m n α) : ((c : R) • M)ᴴ = (c : R) • Mᴴ 
goal: (↑c • M)ᴴ = ↑c • Mᴴ

full_name: Matrix.conjTranspose_inv_natCast_smul
code: @[simp]
theorem conjTranspose_inv_natCast_smul [DivisionSemiring R] [AddCommMonoid α] [StarAddMonoid α]
    [Module R α] (c : ℕ) (M : Matrix m n α) : ((c : R)⁻¹ • M)ᴴ = (c : R)⁻¹ • Mᴴ 
goal: ((↑c)⁻¹ • M)ᴴ = (↑c)⁻¹ • Mᴴ

full_name: Matrix.conjTranspose_inv_ofNat_smul
code: @[simp]
theorem conjTranspose_inv_ofNat_smul [DivisionSemiring R] [AddCommMonoid α] [StarAddMonoid α]
    [Module R α] (c : ℕ) [c.AtLeastTwo] (M : Matrix m n α) :
    ((no_index (OfNat.ofNat c : R))⁻¹ • M)ᴴ = (OfNat.ofNat c : R)⁻¹ • Mᴴ 
goal: ((OfNat.ofNat c)⁻¹ • M)ᴴ = (OfNat.ofNat c)⁻¹ • Mᴴ

full_name: Matrix.conjTranspose_inv_intCast_smul
code: @[simp]
theorem conjTranspose_inv_intCast_smul [DivisionRing R] [AddCommGroup α] [StarAddMonoid α]
    [Module R α] (c : ℤ) (M : Matrix m n α) : ((c : R)⁻¹ • M)ᴴ = (c : R)⁻¹ • Mᴴ 
goal: ((↑c)⁻¹ • M)ᴴ = (↑c)⁻¹ • Mᴴ

full_name: Matrix.conjTranspose_ratCast_smul
code: @[simp]
theorem conjTranspose_ratCast_smul [DivisionRing R] [AddCommGroup α] [StarAddMonoid α] [Module R α]
    (c : ℚ) (M : Matrix m n α) : ((c : R) • M)ᴴ = (c : R) • Mᴴ 
goal: (↑c • M)ᴴ = ↑c • Mᴴ

full_name: Matrix.conjTranspose_rat_smul
code: @[simp]
theorem conjTranspose_rat_smul [AddCommGroup α] [StarAddMonoid α] [Module ℚ α] (c : ℚ)
    (M : Matrix m n α) : (c • M)ᴴ = c • Mᴴ 
goal: (c • M)ᴴ = c • Mᴴ

full_name: Matrix.conjTranspose_mul
code: @[simp]
theorem conjTranspose_mul [Fintype n] [NonUnitalSemiring α] [StarRing α] (M : Matrix m n α)
    (N : Matrix n l α) : (M * N)ᴴ = Nᴴ * Mᴴ 
goal: (M * N)ᴴ = Nᴴ * Mᴴ

full_name: Matrix.conjTranspose_neg
code: @[simp]
theorem conjTranspose_neg [AddGroup α] [StarAddMonoid α] (M : Matrix m n α) : (-M)ᴴ = -Mᴴ 
goal: (-M)ᴴ = -Mᴴ

full_name: Matrix.conjTranspose_map
code: theorem conjTranspose_map [Star α] [Star β] {A : Matrix m n α} (f : α → β)
    (hf : Function.Semiconj f star star) : Aᴴ.map f = (A.map f)ᴴ 
goal: Aᴴ.map f = (A.map f)ᴴ

full_name: Matrix.conjTranspose_eq_transpose_of_trivial
code: /-- When `star x = x` on the coefficients (such as the real numbers) `conjTranspose` and `transpose`
are the same operation. -/
@[simp]
theorem conjTranspose_eq_transpose_of_trivial [Star α] [TrivialStar α] (A : Matrix m n α) :
    Aᴴ = Aᵀ 
goal: Aᴴ = Aᵀ

full_name: Matrix.conjTransposeAddEquiv
code: /-- `Matrix.conjTranspose` as an `AddEquiv` -/
@[simps apply]
def conjTransposeAddEquiv [AddMonoid α] [StarAddMonoid α] : Matrix m n α ≃+ Matrix n m α 
goal: Matrix m n α ≃+ Matrix n m α

full_name: Matrix.conjTransposeAddEquiv_apply
code: /-- `Matrix.conjTranspose` as an `AddEquiv` -/
@[simps apply]
def conjTransposeAddEquiv [AddMonoid α] [StarAddMonoid α] : Matrix m n α ≃+ Matrix n m α 
goal: (Matrix.conjTransposeAddEquiv m n α) M = Mᴴ

full_name: Matrix.conjTransposeAddEquiv_symm
code: @[simp]
theorem conjTransposeAddEquiv_symm [AddMonoid α] [StarAddMonoid α] :
    (conjTransposeAddEquiv m n α).symm = conjTransposeAddEquiv n m α 
goal: (Matrix.conjTransposeAddEquiv m n α).symm = Matrix.conjTransposeAddEquiv n m α

full_name: Matrix.conjTranspose_list_sum
code: theorem conjTranspose_list_sum [AddMonoid α] [StarAddMonoid α] (l : List (Matrix m n α)) :
    l.sumᴴ = (l.map conjTranspose).sum 
goal: l.sumᴴ = (List.map Matrix.conjTranspose l).sum

full_name: Matrix.conjTranspose_multiset_sum
code: theorem conjTranspose_multiset_sum [AddCommMonoid α] [StarAddMonoid α]
    (s : Multiset (Matrix m n α)) : s.sumᴴ = (s.map conjTranspose).sum 
goal: s.sumᴴ = (Multiset.map Matrix.conjTranspose s).sum

full_name: Matrix.conjTranspose_sum
code: theorem conjTranspose_sum [AddCommMonoid α] [StarAddMonoid α] {ι : Type*} (s : Finset ι)
    (M : ι → Matrix m n α) : (∑ i ∈ s, M i)ᴴ = ∑ i ∈ s, (M i)ᴴ 
goal: (∑ i ∈ s, M i)ᴴ = ∑ i ∈ s, (M i)ᴴ

full_name: Matrix.conjTransposeLinearEquiv
code: /-- `Matrix.conjTranspose` as a `LinearMap` -/
@[simps apply]
def conjTransposeLinearEquiv [CommSemiring R] [StarRing R] [AddCommMonoid α] [StarAddMonoid α]
    [Module R α] [StarModule R α] : Matrix m n α ≃ₗ⋆[R] Matrix n m α 
goal: Matrix m n α ≃ₗ⋆[R] Matrix n m α

full_name: Matrix.conjTransposeLinearEquiv_apply
code: /-- `Matrix.conjTranspose` as a `LinearMap` -/
@[simps apply]
def conjTransposeLinearEquiv [CommSemiring R] [StarRing R] [AddCommMonoid α] [StarAddMonoid α]
    [Module R α] [StarModule R α] : Matrix m n α ≃ₗ⋆[R] Matrix n m α 
goal: ∀ (a : Matrix m n α), (Matrix.conjTransposeLinearEquiv m n R α) a = (Matrix.conjTransposeAddEquiv m n α).toFun a

full_name: Matrix.conjTransposeLinearEquiv_symm
code: @[simp]
theorem conjTransposeLinearEquiv_symm [CommSemiring R] [StarRing R] [AddCommMonoid α]
    [StarAddMonoid α] [Module R α] [StarModule R α] :
    (conjTransposeLinearEquiv m n R α).symm = conjTransposeLinearEquiv n m R α 
goal: (Matrix.conjTransposeLinearEquiv m n R α).symm = Matrix.conjTransposeLinearEquiv n m R α

full_name: Matrix.conjTransposeRingEquiv_symm_apply
code: /-- `Matrix.conjTranspose` as a `RingEquiv` to the opposite ring -/
@[simps]
def conjTransposeRingEquiv [Semiring α] [StarRing α] [Fintype m] :
    Matrix m m α ≃+* (Matrix m m α)ᵐᵒᵖ 
goal: (Matrix.conjTransposeRingEquiv m α).symm M = (MulOpposite.unop M)ᴴ

full_name: Matrix.conjTransposeRingEquiv_apply
code: /-- `Matrix.conjTranspose` as a `RingEquiv` to the opposite ring -/
@[simps]
def conjTransposeRingEquiv [Semiring α] [StarRing α] [Fintype m] :
    Matrix m m α ≃+* (Matrix m m α)ᵐᵒᵖ 
goal: (Matrix.conjTransposeRingEquiv m α) M = MulOpposite.op Mᴴ

full_name: Matrix.conjTransposeRingEquiv
code: /-- `Matrix.conjTranspose` as a `RingEquiv` to the opposite ring -/
@[simps]
def conjTransposeRingEquiv [Semiring α] [StarRing α] [Fintype m] :
    Matrix m m α ≃+* (Matrix m m α)ᵐᵒᵖ 
goal: Matrix m m α ≃+* (Matrix m m α)ᵐᵒᵖ

full_name: Matrix.conjTranspose_pow
code: @[simp]
theorem conjTranspose_pow [Semiring α] [StarRing α] [Fintype m] [DecidableEq m] (M : Matrix m m α)
    (k : ℕ) : (M ^ k)ᴴ = Mᴴ ^ k 
goal: (M ^ k)ᴴ = Mᴴ ^ k

full_name: Matrix.conjTranspose_list_prod
code: theorem conjTranspose_list_prod [Semiring α] [StarRing α] [Fintype m] [DecidableEq m]
    (l : List (Matrix m m α)) : l.prodᴴ = (l.map conjTranspose).reverse.prod 
goal: l.prodᴴ = (List.map Matrix.conjTranspose l).reverse.prod

full_name: Matrix.instStar
code: /-- When `α` has a star operation, square matrices `Matrix n n α` have a star
operation equal to `Matrix.conjTranspose`. -/
instance [Star α] : Star (Matrix n n α) 
goal: Star (Matrix n n α)

full_name: Matrix.star_eq_conjTranspose
code: theorem star_eq_conjTranspose [Star α] (M : Matrix m m α) : star M = Mᴴ 
goal: star M = Mᴴ

full_name: Matrix.star_apply
code: @[simp]
theorem star_apply [Star α] (M : Matrix n n α) (i j) : (star M) i j = star (M j i) 
goal: star M i j = star (M j i)

full_name: Matrix.instInvolutiveStar
code: instance [InvolutiveStar α] : InvolutiveStar (Matrix n n α) 
goal: InvolutiveStar (Matrix n n α)

full_name: Matrix.instStarAddMonoid
code: /-- When `α` is a `*`-additive monoid, `Matrix.star` is also a `*`-additive monoid. -/
instance [AddMonoid α] [StarAddMonoid α] : StarAddMonoid (Matrix n n α) 
goal: StarAddMonoid (Matrix n n α)

full_name: Matrix.instStarModule
code: instance [Star α] [Star β] [SMul α β] [StarModule α β] : StarModule α (Matrix n n β) 
goal: StarModule α (Matrix n n β)

full_name: Matrix.instStarRing
code: /-- When `α` is a `*`-(semi)ring, `Matrix.star` is also a `*`-(semi)ring. -/
instance [Fintype n] [NonUnitalSemiring α] [StarRing α] : StarRing (Matrix n n α) 
goal: StarRing (Matrix n n α)

full_name: Matrix.star_mul
code: /-- A version of `star_mul` for `*` instead of `*`. -/
theorem star_mul [Fintype n] [NonUnitalSemiring α] [StarRing α] (M N : Matrix n n α) :
    star (M * N) = star N * star M 
goal: star (M * N) = star N * star M

full_name: Matrix.submatrix
code: /-- Given maps `(r_reindex : l → m)` and `(c_reindex : o → n)` reindexing the rows and columns of
a matrix `M : Matrix m n α`, the matrix `M.submatrix r_reindex c_reindex : Matrix l o α` is defined
by `(M.submatrix r_reindex c_reindex) i j = M (r_reindex i) (c_reindex j)` for `(i,j) : l × o`.
Note that the total number of row and columns does not have to be preserved. -/
def submatrix (A : Matrix m n α) (r_reindex : l → m) (c_reindex : o → n) : Matrix l o α 
goal: Matrix l o α

full_name: Matrix.submatrix_apply
code: @[simp]
theorem submatrix_apply (A : Matrix m n α) (r_reindex : l → m) (c_reindex : o → n) (i j) :
    A.submatrix r_reindex c_reindex i j = A (r_reindex i) (c_reindex j) 
goal: A.submatrix r_reindex c_reindex i j = A (r_reindex i) (c_reindex j)

full_name: Matrix.submatrix_id_id
code: @[simp]
theorem submatrix_id_id (A : Matrix m n α) : A.submatrix id id = A 
goal: A.submatrix id id = A

full_name: Matrix.submatrix_submatrix
code: @[simp]
theorem submatrix_submatrix {l₂ o₂ : Type*} (A : Matrix m n α) (r₁ : l → m) (c₁ : o → n)
    (r₂ : l₂ → l) (c₂ : o₂ → o) :
    (A.submatrix r₁ c₁).submatrix r₂ c₂ = A.submatrix (r₁ ∘ r₂) (c₁ ∘ c₂) 
goal: (A.submatrix r₁ c₁).submatrix r₂ c₂ = A.submatrix (r₁ ∘ r₂) (c₁ ∘ c₂)

full_name: Matrix.transpose_submatrix
code: @[simp]
theorem transpose_submatrix (A : Matrix m n α) (r_reindex : l → m) (c_reindex : o → n) :
    (A.submatrix r_reindex c_reindex)ᵀ = Aᵀ.submatrix c_reindex r_reindex 
goal: (A.submatrix r_reindex c_reindex)ᵀ = Aᵀ.submatrix c_reindex r_reindex

full_name: Matrix.conjTranspose_submatrix
code: @[simp]
theorem conjTranspose_submatrix [Star α] (A : Matrix m n α) (r_reindex : l → m)
    (c_reindex : o → n) : (A.submatrix r_reindex c_reindex)ᴴ = Aᴴ.submatrix c_reindex r_reindex 
goal: (A.submatrix r_reindex c_reindex)ᴴ = Aᴴ.submatrix c_reindex r_reindex

full_name: Matrix.submatrix_add
code: theorem submatrix_add [Add α] (A B : Matrix m n α) :
    ((A + B).submatrix : (l → m) → (o → n) → Matrix l o α) = A.submatrix + B.submatrix 
goal: (A + B).submatrix = A.submatrix + B.submatrix

full_name: Matrix.submatrix_neg
code: theorem submatrix_neg [Neg α] (A : Matrix m n α) :
    ((-A).submatrix : (l → m) → (o → n) → Matrix l o α) = -A.submatrix 
goal: (-A).submatrix = -A.submatrix

full_name: Matrix.submatrix_sub
code: theorem submatrix_sub [Sub α] (A B : Matrix m n α) :
    ((A - B).submatrix : (l → m) → (o → n) → Matrix l o α) = A.submatrix - B.submatrix 
goal: (A - B).submatrix = A.submatrix - B.submatrix

full_name: Matrix.submatrix_zero
code: @[simp]
theorem submatrix_zero [Zero α] :
    ((0 : Matrix m n α).submatrix : (l → m) → (o → n) → Matrix l o α) = 0 
goal: Matrix.submatrix 0 = 0

full_name: Matrix.submatrix_smul
code: theorem submatrix_smul {R : Type*} [SMul R α] (r : R) (A : Matrix m n α) :
    ((r • A : Matrix m n α).submatrix : (l → m) → (o → n) → Matrix l o α) = r • A.submatrix 
goal: (r • A).submatrix = r • A.submatrix

full_name: Matrix.submatrix_map
code: theorem submatrix_map (f : α → β) (e₁ : l → m) (e₂ : o → n) (A : Matrix m n α) :
    (A.map f).submatrix e₁ e₂ = (A.submatrix e₁ e₂).map f 
goal: (A.map f).submatrix e₁ e₂ = (A.submatrix e₁ e₂).map f

full_name: Matrix.submatrix_diagonal
code: /-- Given a `(m × m)` diagonal matrix defined by a map `d : m → α`, if the reindexing map `e` is
  injective, then the resulting matrix is again diagonal. -/
theorem submatrix_diagonal [Zero α] [DecidableEq m] [DecidableEq l] (d : m → α) (e : l → m)
    (he : Function.Injective e) : (diagonal d).submatrix e e = diagonal (d ∘ e) 
goal: (Matrix.diagonal d).submatrix e e = Matrix.diagonal (d ∘ e)

full_name: Matrix.submatrix_one
code: theorem submatrix_one [Zero α] [One α] [DecidableEq m] [DecidableEq l] (e : l → m)
    (he : Function.Injective e) : (1 : Matrix m m α).submatrix e e = 1 
goal: Matrix.submatrix 1 e e = 1

full_name: Matrix.submatrix_mul
code: theorem submatrix_mul [Fintype n] [Fintype o] [Mul α] [AddCommMonoid α] {p q : Type*}
    (M : Matrix m n α) (N : Matrix n p α) (e₁ : l → m) (e₂ : o → n) (e₃ : q → p)
    (he₂ : Function.Bijective e₂) :
    (M * N).submatrix e₁ e₃ = M.submatrix e₁ e₂ * N.submatrix e₂ e₃ 
goal: (M * N).submatrix e₁ e₃ = M.submatrix e₁ e₂ * N.submatrix e₂ e₃

full_name: Matrix.diag_submatrix
code: theorem diag_submatrix (A : Matrix m m α) (e : l → m) : diag (A.submatrix e e) = A.diag ∘ e 
goal: (A.submatrix e e).diag = A.diag ∘ e

full_name: Matrix.submatrix_diagonal_embedding
code: @[simp]
theorem submatrix_diagonal_embedding [Zero α] [DecidableEq m] [DecidableEq l] (d : m → α)
    (e : l ↪ m) : (diagonal d).submatrix e e = diagonal (d ∘ e) 
goal: (Matrix.diagonal d).submatrix ⇑e ⇑e = Matrix.diagonal (d ∘ ⇑e)

full_name: Matrix.submatrix_diagonal_equiv
code: @[simp]
theorem submatrix_diagonal_equiv [Zero α] [DecidableEq m] [DecidableEq l] (d : m → α) (e : l ≃ m) :
    (diagonal d).submatrix e e = diagonal (d ∘ e) 
goal: (Matrix.diagonal d).submatrix ⇑e ⇑e = Matrix.diagonal (d ∘ ⇑e)

full_name: Matrix.submatrix_one_embedding
code: @[simp]
theorem submatrix_one_embedding [Zero α] [One α] [DecidableEq m] [DecidableEq l] (e : l ↪ m) :
    (1 : Matrix m m α).submatrix e e = 1 
goal: Matrix.submatrix 1 ⇑e ⇑e = 1

full_name: Matrix.submatrix_one_equiv
code: @[simp]
theorem submatrix_one_equiv [Zero α] [One α] [DecidableEq m] [DecidableEq l] (e : l ≃ m) :
    (1 : Matrix m m α).submatrix e e = 1 
goal: Matrix.submatrix 1 ⇑e ⇑e = 1

full_name: Matrix.submatrix_mul_equiv
code: @[simp]
theorem submatrix_mul_equiv [Fintype n] [Fintype o] [AddCommMonoid α] [Mul α] {p q : Type*}
    (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₃ 
goal: M.submatrix e₁ ⇑e₂ * N.submatrix (⇑e₂) e₃ = (M * N).submatrix e₁ e₃

full_name: Matrix.submatrix_mulVec_equiv
code: theorem submatrix_mulVec_equiv [Fintype n] [Fintype o] [NonUnitalNonAssocSemiring α]
    (M : Matrix m n α) (v : o → α) (e₁ : l → m) (e₂ : o ≃ n) :
    M.submatrix e₁ e₂ *ᵥ v = (M *ᵥ (v ∘ e₂.symm)) ∘ e₁ 
goal: M.submatrix e₁ ⇑e₂ *ᵥ v = (M *ᵥ v ∘ ⇑e₂.symm) ∘ e₁

full_name: Matrix.submatrix_vecMul_equiv
code: theorem submatrix_vecMul_equiv [Fintype l] [Fintype m] [NonUnitalNonAssocSemiring α]
    (M : Matrix m n α) (v : l → α) (e₁ : l ≃ m) (e₂ : o → n) :
    v ᵥ* M.submatrix e₁ e₂ = ((v ∘ e₁.symm) ᵥ* M) ∘ e₂ 
goal: v ᵥ* M.submatrix (⇑e₁) e₂ = (v ∘ ⇑e₁.symm ᵥ* M) ∘ e₂

full_name: Matrix.mul_submatrix_one
code: theorem mul_submatrix_one [Fintype n] [Finite o] [NonAssocSemiring α] [DecidableEq o] (e₁ : n ≃ o)
    (e₂ : l → o) (M : Matrix m n α) :
    M * (1 : Matrix o o α).submatrix e₁ e₂ = submatrix M id (e₁.symm ∘ e₂) 
goal: M * Matrix.submatrix 1 (⇑e₁) e₂ = M.submatrix id (⇑e₁.symm ∘ e₂)

full_name: Matrix.one_submatrix_mul
code: theorem one_submatrix_mul [Fintype m] [Finite o] [NonAssocSemiring α] [DecidableEq o] (e₁ : l → o)
    (e₂ : m ≃ o) (M : Matrix m n α) :
    ((1 : Matrix o o α).submatrix e₁ e₂) * M = submatrix M (e₂.symm ∘ e₁) id 
goal: Matrix.submatrix 1 e₁ ⇑e₂ * M = M.submatrix (⇑e₂.symm ∘ e₁) id

full_name: Matrix.reindex
code: /-- The natural map that reindexes a matrix's rows and columns with equivalent types is an
equivalence. -/
def reindex (eₘ : m ≃ l) (eₙ : n ≃ o) : Matrix m n α ≃ Matrix l o α 
goal: Matrix m n α ≃ Matrix l o α

full_name: Matrix.reindex_apply
code: @[simp]
theorem reindex_apply (eₘ : m ≃ l) (eₙ : n ≃ o) (M : Matrix m n α) :
    reindex eₘ eₙ M = M.submatrix eₘ.symm eₙ.symm 
goal: (Matrix.reindex eₘ eₙ) M = M.submatrix ⇑eₘ.symm ⇑eₙ.symm

full_name: Matrix.reindex_refl_refl
code: theorem reindex_refl_refl (A : Matrix m n α) : reindex (Equiv.refl _) (Equiv.refl _) A = A 
goal: (Matrix.reindex (Equiv.refl m) (Equiv.refl n)) A = A

full_name: Matrix.reindex_symm
code: @[simp]
theorem reindex_symm (eₘ : m ≃ l) (eₙ : n ≃ o) :
    (reindex eₘ eₙ).symm = (reindex eₘ.symm eₙ.symm : Matrix l o α ≃ _) 
goal: (Matrix.reindex eₘ eₙ).symm = Matrix.reindex eₘ.symm eₙ.symm

full_name: Matrix.reindex_trans
code: @[simp]
theorem reindex_trans {l₂ o₂ : Type*} (eₘ : m ≃ l) (eₙ : n ≃ o) (eₘ₂ : l ≃ l₂) (eₙ₂ : o ≃ o₂) :
    (reindex eₘ eₙ).trans (reindex eₘ₂ eₙ₂) =
      (reindex (eₘ.trans eₘ₂) (eₙ.trans eₙ₂) : Matrix m n α ≃ _) 
goal: (Matrix.reindex eₘ eₙ).trans (Matrix.reindex eₘ₂ eₙ₂) = Matrix.reindex (eₘ.trans eₘ₂) (eₙ.trans eₙ₂)

full_name: Matrix.transpose_reindex
code: theorem transpose_reindex (eₘ : m ≃ l) (eₙ : n ≃ o) (M : Matrix m n α) :
    (reindex eₘ eₙ M)ᵀ = reindex eₙ eₘ Mᵀ 
goal: ((Matrix.reindex eₘ eₙ) M)ᵀ = (Matrix.reindex eₙ eₘ) Mᵀ

full_name: Matrix.conjTranspose_reindex
code: theorem conjTranspose_reindex [Star α] (eₘ : m ≃ l) (eₙ : n ≃ o) (M : Matrix m n α) :
    (reindex eₘ eₙ M)ᴴ = reindex eₙ eₘ Mᴴ 
goal: ((Matrix.reindex eₘ eₙ) M)ᴴ = (Matrix.reindex eₙ eₘ) Mᴴ

full_name: Matrix.submatrix_mul_transpose_submatrix
code: theorem submatrix_mul_transpose_submatrix [Fintype m] [Fintype n] [AddCommMonoid α] [Mul α]
    (e : m ≃ n) (M : Matrix m n α) : M.submatrix id e * Mᵀ.submatrix e id = M * Mᵀ 
goal: M.submatrix id ⇑e * Mᵀ.submatrix (⇑e) id = M * Mᵀ

full_name: Matrix.subLeft
code: /-- The left `n × l` part of an `n × (l+r)` matrix. -/
abbrev subLeft {m l r : Nat} (A : Matrix (Fin m) (Fin (l + r)) α) : Matrix (Fin m) (Fin l) α 
goal: Matrix (Fin m) (Fin l) α

full_name: Matrix.subRight
code: /-- The right `n × r` part of an `n × (l+r)` matrix. -/
abbrev subRight {m l r : Nat} (A : Matrix (Fin m) (Fin (l + r)) α) : Matrix (Fin m) (Fin r) α 
goal: Matrix (Fin m) (Fin r) α

full_name: Matrix.subUp
code: /-- The top `u × n` part of a `(u+d) × n` matrix. -/
abbrev subUp {d u n : Nat} (A : Matrix (Fin (u + d)) (Fin n) α) : Matrix (Fin u) (Fin n) α 
goal: Matrix (Fin u) (Fin n) α

full_name: Matrix.subDown
code: /-- The bottom `d × n` part of a `(u+d) × n` matrix. -/
abbrev subDown {d u n : Nat} (A : Matrix (Fin (u + d)) (Fin n) α) : Matrix (Fin d) (Fin n) α 
goal: Matrix (Fin d) (Fin n) α

full_name: Matrix.subUpRight
code: /-- The top-right `u × r` part of a `(u+d) × (l+r)` matrix. -/
abbrev subUpRight {d u l r : Nat} (A : Matrix (Fin (u + d)) (Fin (l + r)) α) :
    Matrix (Fin u) (Fin r) α 
goal: Matrix (Fin u) (Fin r) α

full_name: Matrix.subDownRight
code: /-- The bottom-right `d × r` part of a `(u+d) × (l+r)` matrix. -/
abbrev subDownRight {d u l r : Nat} (A : Matrix (Fin (u + d)) (Fin (l + r)) α) :
    Matrix (Fin d) (Fin r) α 
goal: Matrix (Fin d) (Fin r) α

full_name: Matrix.subUpLeft
code: /-- The top-left `u × l` part of a `(u+d) × (l+r)` matrix. -/
abbrev subUpLeft {d u l r : Nat} (A : Matrix (Fin (u + d)) (Fin (l + r)) α) :
    Matrix (Fin u) (Fin l) α 
goal: Matrix (Fin u) (Fin l) α

full_name: Matrix.subDownLeft
code: /-- The bottom-left `d × l` part of a `(u+d) × (l+r)` matrix. -/
abbrev subDownLeft {d u l r : Nat} (A : Matrix (Fin (u + d)) (Fin (l + r)) α) :
    Matrix (Fin d) (Fin l) α 
goal: Matrix (Fin d) (Fin l) α

full_name: RingHom.map_matrix_mul
code: theorem map_matrix_mul (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 
goal: f ((M * N) i j) = (M.map ⇑f * N.map ⇑f) i j

full_name: RingHom.map_dotProduct
code: theorem map_dotProduct [NonAssocSemiring R] [NonAssocSemiring S] (f : R →+* S) (v w : n → R) :
    f (v ⬝ᵥ w) = f ∘ v ⬝ᵥ f ∘ w 
goal: f (v ⬝ᵥ w) = ⇑f ∘ v ⬝ᵥ ⇑f ∘ w

full_name: RingHom.map_vecMul
code: theorem map_vecMul [NonAssocSemiring R] [NonAssocSemiring S] (f : R →+* S) (M : Matrix n m R)
    (v : n → R) (i : m) : f ((v ᵥ* M) i) =  ((f ∘ v) ᵥ* M.map f) i 
goal: f ((v ᵥ* M) i) = (⇑f ∘ v ᵥ* M.map ⇑f) i

full_name: RingHom.map_mulVec
code: theorem map_mulVec [NonAssocSemiring R] [NonAssocSemiring S] (f : R →+* S) (M : Matrix m n R)
    (v : n → R) (i : m) : f ((M *ᵥ v) i) = (M.map f *ᵥ (f ∘ v)) i 
goal: f ((M *ᵥ v) i) = (M.map ⇑f *ᵥ ⇑f ∘ v) i