Diagonal matrices #
This file contains the definition and basic results about diagonal matrices.
Main results #
Matrix.IsDiag
: a proposition that states a given square matrixA
is diagonal.
Tags #
diag, diagonal, matrix
@[simp]
theorem
Matrix.isDiag_diagonal
{α : Type u_1}
{n : Type u_4}
[Zero α]
[DecidableEq n]
(d : n → α)
:
(Matrix.diagonal d).IsDiag
theorem
Matrix.IsDiag.diagonal_diag
{α : Type u_1}
{n : Type u_4}
[Zero α]
[DecidableEq n]
{A : Matrix n n α}
(h : 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
{α : Type u_1}
{n : Type u_4}
[Zero α]
[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
{α : Type u_1}
{n : Type u_4}
[Zero α]
[Subsingleton n]
(A : Matrix n n α)
:
A.IsDiag
Every matrix indexed by a subsingleton is diagonal.
@[simp]
Every zero matrix is diagonal.
@[simp]
Every identity matrix is diagonal.
theorem
Matrix.IsDiag.add
{α : Type u_1}
{n : Type u_4}
[AddZeroClass α]
{A : Matrix n n α}
{B : Matrix n n α}
(ha : A.IsDiag)
(hb : B.IsDiag)
:
(A + B).IsDiag
theorem
Matrix.IsDiag.smul
{α : Type u_1}
{R : Type u_3}
{n : Type u_4}
[Monoid R]
[AddMonoid α]
[DistribMulAction R α]
(k : R)
{A : Matrix n n α}
(ha : A.IsDiag)
:
(k • A).IsDiag
@[simp]
theorem
Matrix.isDiag_smul_one
{α : Type u_1}
(n : Type u_6)
[Semiring α]
[DecidableEq n]
(k : α)
:
(k • 1).IsDiag
theorem
Matrix.IsDiag.submatrix
{α : Type u_1}
{n : Type u_4}
{m : Type u_5}
[Zero α]
{A : Matrix n n α}
(ha : A.IsDiag)
{f : m → n}
(hf : Function.Injective f)
:
(A.submatrix f f).IsDiag
theorem
Matrix.IsDiag.kronecker
{α : Type u_1}
{n : Type u_4}
{m : Type u_5}
[MulZeroClass α]
{A : Matrix m m α}
{B : Matrix n n α}
(hA : A.IsDiag)
(hB : B.IsDiag)
:
(Matrix.kroneckerMap (fun (x x_1 : α) => x * x_1) A B).IsDiag
(A ⊗ B).IsDiag
if both A
and B
are diagonal.
theorem
Matrix.IsDiag.fromBlocks
{α : Type u_1}
{n : Type u_4}
{m : Type u_5}
[Zero α]
{A : Matrix m m α}
{D : Matrix n n α}
(ha : A.IsDiag)
(hd : 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_of_isSymm
{α : Type u_1}
{n : Type u_4}
{m : Type u_5}
[Zero α]
{A : Matrix m m α}
{C : Matrix n m α}
{D : Matrix n n α}
(h : (Matrix.fromBlocks A 0 C D).IsSymm)
(ha : A.IsDiag)
(hd : 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
.