File: Mathlib/LinearAlgebra/Matrix/IsDiag.lean

full_name: Matrix.IsDiag
code: /-- `A.IsDiag` means square matrix `A` is a diagonal matrix. -/
def IsDiag [Zero α] (A : Matrix n n α) : Prop 
goal: Prop

full_name: Matrix.isDiag_diagonal
code: @[simp]
theorem isDiag_diagonal [Zero α] [DecidableEq n] (d : n → α) : (diagonal d).IsDiag 
goal: (Matrix.diagonal d).IsDiag

full_name: Matrix.IsDiag.diagonal_diag
code: /-- Diagonal matrices are generated by the `Matrix.diagonal` of their `Matrix.diag`. -/
theorem IsDiag.diagonal_diag [Zero α] [DecidableEq n] {A : Matrix n n α} (h : A.IsDiag) :
    diagonal (diag A) = A 
goal: Matrix.diagonal A.diag = A

full_name: Matrix.isDiag_iff_diagonal_diag
code: /-- `Matrix.IsDiag.diagonal_diag` as an iff. -/
theorem isDiag_iff_diagonal_diag [Zero α] [DecidableEq n] (A : Matrix n n α) :
    A.IsDiag ↔ diagonal (diag A) = A 
goal: A.IsDiag ↔ Matrix.diagonal A.diag = A

full_name: Matrix.isDiag_of_subsingleton
code: /-- Every matrix indexed by a subsingleton is diagonal. -/
theorem isDiag_of_subsingleton [Zero α] [Subsingleton n] (A : Matrix n n α) : A.IsDiag 
goal: A.IsDiag

full_name: Matrix.isDiag_zero
code: /-- Every zero matrix is diagonal. -/
@[simp]
theorem isDiag_zero [Zero α] : (0 : Matrix n n α).IsDiag 
goal: Matrix.IsDiag 0

full_name: Matrix.isDiag_one
code: /-- Every identity matrix is diagonal. -/
@[simp]
theorem isDiag_one [DecidableEq n] [Zero α] [One α] : (1 : Matrix n n α).IsDiag 
goal: Matrix.IsDiag 1

full_name: Matrix.IsDiag.map
code: theorem IsDiag.map [Zero α] [Zero β] {A : Matrix n n α} (ha : A.IsDiag) {f : α → β} (hf : f 0 = 0) :
    (A.map f).IsDiag 
goal: (A.map f).IsDiag

full_name: Matrix.IsDiag.neg
code: theorem IsDiag.neg [AddGroup α] {A : Matrix n n α} (ha : A.IsDiag) : (-A).IsDiag 
goal: (-A).IsDiag

full_name: Matrix.isDiag_neg_iff
code: @[simp]
theorem isDiag_neg_iff [AddGroup α] {A : Matrix n n α} : (-A).IsDiag ↔ A.IsDiag 
goal: (-A).IsDiag ↔ A.IsDiag

full_name: Matrix.IsDiag.add
code: theorem IsDiag.add [AddZeroClass α] {A B : Matrix n n α} (ha : A.IsDiag) (hb : B.IsDiag) :
    (A + B).IsDiag 
goal: (A + B).IsDiag

full_name: Matrix.IsDiag.sub
code: theorem IsDiag.sub [AddGroup α] {A B : Matrix n n α} (ha : A.IsDiag) (hb : B.IsDiag) :
    (A - B).IsDiag 
goal: (A - B).IsDiag

full_name: Matrix.IsDiag.smul
code: theorem IsDiag.smul [Monoid R] [AddMonoid α] [DistribMulAction R α] (k : R) {A : Matrix n n α}
    (ha : A.IsDiag) : (k • A).IsDiag 
goal: (k • A).IsDiag

full_name: Matrix.isDiag_smul_one
code: @[simp]
theorem isDiag_smul_one (n) [Semiring α] [DecidableEq n] (k : α) :
    (k • (1 : Matrix n n α)).IsDiag 
goal: (k • 1).IsDiag

full_name: Matrix.IsDiag.transpose
code: theorem IsDiag.transpose [Zero α] {A : Matrix n n α} (ha : A.IsDiag) : Aᵀ.IsDiag 
goal: A.transpose.IsDiag

full_name: Matrix.isDiag_transpose_iff
code: @[simp]
theorem isDiag_transpose_iff [Zero α] {A : Matrix n n α} : Aᵀ.IsDiag ↔ A.IsDiag 
goal: A.transpose.IsDiag ↔ A.IsDiag

full_name: Matrix.IsDiag.conjTranspose
code: theorem IsDiag.conjTranspose [Semiring α] [StarRing α] {A : Matrix n n α} (ha : A.IsDiag) :
    Aᴴ.IsDiag 
goal: A.conjTranspose.IsDiag

full_name: Matrix.isDiag_conjTranspose_iff
code: @[simp]
theorem isDiag_conjTranspose_iff [Semiring α] [StarRing α] {A : Matrix n n α} :
    Aᴴ.IsDiag ↔ A.IsDiag 
goal: A.conjTranspose.IsDiag ↔ A.IsDiag

full_name: Matrix.IsDiag.submatrix
code: theorem IsDiag.submatrix [Zero α] {A : Matrix n n α} (ha : A.IsDiag) {f : m → n}
    (hf : Injective f) : (A.submatrix f f).IsDiag 
goal: (A.submatrix f f).IsDiag

full_name: Matrix.IsDiag.kronecker
code: /-- `(A ⊗ B).IsDiag` if both `A` and `B` are diagonal. -/
theorem IsDiag.kronecker [MulZeroClass α] {A : Matrix m m α} {B : Matrix n n α} (hA : A.IsDiag)
    (hB : B.IsDiag) : (A ⊗ₖ B).IsDiag 
goal: (Matrix.kroneckerMap (fun x x_1 => x * x_1) A B).IsDiag

full_name: Matrix.IsDiag.isSymm
code: theorem IsDiag.isSymm [Zero α] {A : Matrix n n α} (h : A.IsDiag) : A.IsSymm 
goal: A.IsSymm

full_name: Matrix.IsDiag.fromBlocks
code: /-- The block matrix `A.fromBlocks 0 0 D` is diagonal if `A` and `D` are diagonal. -/
theorem IsDiag.fromBlocks [Zero α] {A : Matrix m m α} {D : Matrix n n α} (ha : A.IsDiag)
    (hd : D.IsDiag) : (A.fromBlocks 0 0 D).IsDiag 
goal: (Matrix.fromBlocks A 0 0 D).IsDiag

full_name: Matrix.isDiag_fromBlocks_iff
code: /-- This is the `iff` version of `Matrix.IsDiag.fromBlocks`. -/
theorem isDiag_fromBlocks_iff [Zero α] {A : Matrix m m α} {B : Matrix m n α} {C : Matrix n m α}
    {D : Matrix n n α} : (A.fromBlocks B C D).IsDiag ↔ A.IsDiag ∧ B = 0 ∧ C = 0 ∧ D.IsDiag 
goal: (Matrix.fromBlocks A B C D).IsDiag ↔ A.IsDiag ∧ B = 0 ∧ C = 0 ∧ D.IsDiag

full_name: Matrix.IsDiag.fromBlocks_of_isSymm
code: /-- A symmetric block matrix `A.fromBlocks B C D` is diagonal
    if `A` and `D` are diagonal and `B` is `0`. -/
theorem IsDiag.fromBlocks_of_isSymm [Zero α] {A : Matrix m m α} {C : Matrix n m α}
    {D : Matrix n n α} (h : (A.fromBlocks 0 C D).IsSymm) (ha : A.IsDiag) (hd : D.IsDiag) :
    (A.fromBlocks 0 C D).IsDiag 
goal: (Matrix.fromBlocks A 0 C D).IsDiag

full_name: Matrix.mul_transpose_self_isDiag_iff_hasOrthogonalRows
code: theorem mul_transpose_self_isDiag_iff_hasOrthogonalRows [Fintype n] [Mul α] [AddCommMonoid α]
    {A : Matrix m n α} : (A * Aᵀ).IsDiag ↔ A.HasOrthogonalRows 
goal: (A * A.transpose).IsDiag ↔ A.HasOrthogonalRows

full_name: Matrix.transpose_mul_self_isDiag_iff_hasOrthogonalCols
code: theorem transpose_mul_self_isDiag_iff_hasOrthogonalCols [Fintype m] [Mul α] [AddCommMonoid α]
    {A : Matrix m n α} : (Aᵀ * A).IsDiag ↔ A.HasOrthogonalCols 
goal: (A.transpose * A).IsDiag ↔ A.HasOrthogonalCols