The Mathlib Handbook

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

The areas / V07. Linear algebra

Mathlib.LinearAlgebra.Matrix.IsDiag

26 declarations. Mathlib docs · Source

Diagonal matrices

This file contains the definition and basic results about diagonal matrices.

Main results

  • Matrix.IsDiag: a proposition that states a given square matrix A is diagonal.

Tags

diag, diagonal, matrix

def Matrix.IsDiag E3 #

{α : Type u_1} → {n : Type u_4} → [Zero α] → Matrix n n α → Prop

A.IsDiag means square matrix A is a diagonal matrix.

theorem Matrix.isDiag_diagonal E0 #

∀ {α : Type u_1} {n : Type u_4} [inst : Zero α] [inst_1 : DecidableEq n] (d : n → α), (Matrix.diagonal d).IsDiag

theorem Matrix.IsDiag.diagonal_diag E1 #

∀ {α : Type u_1} {n : Type u_4} [inst : Zero α] [inst_1 : DecidableEq n] {A : Matrix n n α},
  A.IsDiag → Matrix.diagonal A.diag = A

Diagonal matrices are generated by the Matrix.diagonal of their Matrix.diag.

theorem Matrix.isDiag_iff_diagonal_diag E1 #

∀ {α : Type u_1} {n : Type u_4} [inst : Zero α] [inst_1 : DecidableEq n] (A : Matrix n n α),
  A.IsDiag ↔ Matrix.diagonal A.diag = A

Matrix.IsDiag.diagonal_diag as an iff.

theorem Matrix.isDiag_of_subsingleton E1 #

∀ {α : Type u_1} {n : Type u_4} [inst : Zero α] [Subsingleton n] (A : Matrix n n α), A.IsDiag

Every matrix indexed by a subsingleton is diagonal.

theorem Matrix.isDiag_zero E0 #

∀ {α : Type u_1} {n : Type u_4} [inst : Zero α], Matrix.IsDiag 0

Every zero matrix is diagonal.

theorem Matrix.isDiag_one E0 #

∀ {α : Type u_1} {n : Type u_4} [inst : DecidableEq n] [inst_1 : Zero α] [inst_2 : One α], Matrix.IsDiag 1

Every identity matrix is diagonal.

theorem Matrix.IsDiag.map E1 #

∀ {α : Type u_1} {β : Type u_2} {n : Type u_4} [inst : Zero α] [inst_1 : Zero β] {A : Matrix n n α},
  A.IsDiag → ∀ {f : α → β}, f 0 = 0 → (A.map f).IsDiag

theorem Matrix.IsDiag.neg E1 #

∀ {α : Type u_1} {n : Type u_4} [inst : SubtractionMonoid α] {A : Matrix n n α}, A.IsDiag → (-A).IsDiag

theorem Matrix.isDiag_neg_iff E0 #

∀ {α : Type u_1} {n : Type u_4} [inst : SubtractionMonoid α] {A : Matrix n n α}, (-A).IsDiag ↔ A.IsDiag

theorem Matrix.IsDiag.add E1 #

∀ {α : Type u_1} {n : Type u_4} [inst : AddZeroClass α] {A B : Matrix n n α}, A.IsDiag → B.IsDiag → (A + B).IsDiag

theorem Matrix.IsDiag.sub E1 #

∀ {α : Type u_1} {n : Type u_4} [inst : SubtractionMonoid α] {A B : Matrix n n α}, A.IsDiag → B.IsDiag → (A - B).IsDiag

theorem Matrix.IsDiag.smul E1 #

∀ {α : Type u_1} {R : Type u_3} {n : Type u_4} [inst : Zero α] [inst_1 : SMulZeroClass R α] (k : R) {A : Matrix n n α},
  A.IsDiag → (k • A).IsDiag

theorem Matrix.isDiag_smul_one E0 #

∀ {α : Type u_1} (n : Type u_6) [inst : MulZeroOneClass α] [inst_1 : DecidableEq n] (k : α), (k • 1).IsDiag

theorem Matrix.IsDiag.transpose E1 #

∀ {α : Type u_1} {n : Type u_4} [inst : Zero α] {A : Matrix n n α}, A.IsDiag → A.transpose.IsDiag

theorem Matrix.isDiag_transpose_iff E0 #

∀ {α : Type u_1} {n : Type u_4} [inst : Zero α] {A : Matrix n n α}, A.transpose.IsDiag ↔ A.IsDiag

theorem Matrix.IsDiag.conjTranspose E1 #

∀ {α : Type u_1} {n : Type u_4} [inst : NonUnitalNonAssocSemiring α] [inst_1 : StarRing α] {A : Matrix n n α},
  A.IsDiag → A.conjTranspose.IsDiag

theorem Matrix.isDiag_conjTranspose_iff E0 #

∀ {α : Type u_1} {n : Type u_4} [inst : NonUnitalNonAssocSemiring α] [inst_1 : StarRing α] {A : Matrix n n α},
  A.conjTranspose.IsDiag ↔ A.IsDiag

theorem Matrix.IsDiag.submatrix E1 #

∀ {α : Type u_1} {n : Type u_4} {m : Type u_5} [inst : Zero α] {A : Matrix n n α},
  A.IsDiag → ∀ {f : m → n}, Function.Injective f → (A.submatrix f f).IsDiag

theorem Matrix.IsDiag.kronecker E1 #

∀ {α : Type u_1} {n : Type u_4} {m : Type u_5} [inst : MulZeroClass α] {A : Matrix m m α} {B : Matrix n n α},
  A.IsDiag → B.IsDiag → (Matrix.kroneckerMap (fun x1 x2 ↦ x1 * x2) A B).IsDiag

(A ⊗ B).IsDiag if both A and B are diagonal.

theorem Matrix.IsDiag.isSymm E1 #

∀ {α : Type u_1} {n : Type u_4} [inst : Zero α] {A : Matrix n n α}, A.IsDiag → A.IsSymm

theorem Matrix.IsDiag.fromBlocks E1 #

∀ {α : Type u_1} {n : Type u_4} {m : Type u_5} [inst : Zero α] {A : Matrix m m α} {D : Matrix n n α},
  A.IsDiag → D.IsDiag → (Matrix.fromBlocks A 0 0 D).IsDiag

The block matrix A.fromBlocks 0 0 D is diagonal if A and D are diagonal.

theorem Matrix.isDiag_fromBlocks_iff E0 #

∀ {α : Type u_1} {n : Type u_4} {m : Type u_5} [inst : Zero α] {A : Matrix m m α} {B : Matrix m n α} {C : Matrix n m α}
  {D : Matrix n n α}, (Matrix.fromBlocks A B C D).IsDiag ↔ A.IsDiag ∧ B = 0 ∧ C = 0 ∧ D.IsDiag

This is the iff version of Matrix.IsDiag.fromBlocks.

theorem Matrix.IsDiag.fromBlocks_of_isSymm E1 #

∀ {α : Type u_1} {n : Type u_4} {m : Type u_5} [inst : Zero α] {A : Matrix m m α} {C : Matrix n m α} {D : Matrix n n α},
  (Matrix.fromBlocks A 0 C D).IsSymm → A.IsDiag → D.IsDiag → (Matrix.fromBlocks A 0 C D).IsDiag

A symmetric block matrix A.fromBlocks B C D is diagonal if A and D are diagonal and B is 0.

theorem Matrix.mul_transpose_self_isDiag_iff_hasOrthogonalRows E1 #

∀ {α : Type u_1} {n : Type u_4} {m : Type u_5} [inst : Fintype n] [inst_1 : Mul α] [inst_2 : AddCommMonoid α]
  {A : Matrix m n α}, (A * A.transpose).IsDiag ↔ A.HasOrthogonalRows

theorem Matrix.transpose_mul_self_isDiag_iff_hasOrthogonalCols E1 #

∀ {α : Type u_1} {n : Type u_4} {m : Type u_5} [inst : Fintype m] [inst_1 : Mul α] [inst_2 : AddCommMonoid α]
  {A : Matrix m n α}, (A.transpose * A).IsDiag ↔ A.HasOrthogonalCols