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_diag
{α : Type u_1}
{n : Type u_4}
[Zero α]
[DecidableEq n]
{A : Matrix n n α}
(h : Matrix.IsDiag A)
:
Matrix.diagonal (Matrix.diag A) = 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 α)
:
Matrix.IsDiag A ↔ Matrix.diagonal (Matrix.diag A) = 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 α)
:
Every matrix indexed by a subsingleton is diagonal.
@[simp]
Every zero matrix is diagonal.
@[simp]
Every identity matrix is diagonal.
theorem
Matrix.IsDiag.map
{α : Type u_1}
{β : Type u_2}
{n : Type u_4}
[Zero α]
[Zero β]
{A : Matrix n n α}
(ha : Matrix.IsDiag A)
{f : α → β}
(hf : f 0 = 0)
:
Matrix.IsDiag (Matrix.map A f)
theorem
Matrix.IsDiag.neg
{α : Type u_1}
{n : Type u_4}
[AddGroup α]
{A : Matrix n n α}
(ha : Matrix.IsDiag A)
:
Matrix.IsDiag (-A)
@[simp]
theorem
Matrix.isDiag_neg_iff
{α : Type u_1}
{n : Type u_4}
[AddGroup α]
{A : Matrix n n α}
:
Matrix.IsDiag (-A) ↔ Matrix.IsDiag A
theorem
Matrix.IsDiag.add
{α : Type u_1}
{n : Type u_4}
[AddZeroClass α]
{A : Matrix n n α}
{B : Matrix n n α}
(ha : Matrix.IsDiag A)
(hb : Matrix.IsDiag B)
:
Matrix.IsDiag (A + B)
theorem
Matrix.IsDiag.sub
{α : Type u_1}
{n : Type u_4}
[AddGroup α]
{A : Matrix n n α}
{B : Matrix n n α}
(ha : Matrix.IsDiag A)
(hb : Matrix.IsDiag B)
:
Matrix.IsDiag (A - B)
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 : Matrix.IsDiag A)
:
Matrix.IsDiag (k • A)
@[simp]
theorem
Matrix.isDiag_smul_one
{α : Type u_1}
(n : Type u_6)
[Semiring α]
[DecidableEq n]
(k : α)
:
Matrix.IsDiag (k • 1)
theorem
Matrix.IsDiag.transpose
{α : Type u_1}
{n : Type u_4}
[Zero α]
{A : Matrix n n α}
(ha : Matrix.IsDiag A)
:
@[simp]
theorem
Matrix.IsDiag.conjTranspose
{α : Type u_1}
{n : Type u_4}
[Semiring α]
[StarRing α]
{A : Matrix n n α}
(ha : Matrix.IsDiag A)
:
theorem
Matrix.IsDiag.submatrix
{α : Type u_1}
{n : Type u_4}
{m : Type u_5}
[Zero α]
{A : Matrix n n α}
(ha : Matrix.IsDiag A)
{f : m → n}
(hf : Function.Injective f)
:
Matrix.IsDiag (Matrix.submatrix A f f)
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 : Matrix.IsDiag A)
(hB : Matrix.IsDiag B)
:
Matrix.IsDiag (Matrix.kroneckerMap (fun (x x_1 : α) => x * x_1) A B)
(A ⊗ B).IsDiag
if both A
and B
are diagonal.
theorem
Matrix.IsDiag.isSymm
{α : Type u_1}
{n : Type u_4}
[Zero α]
{A : Matrix n n α}
(h : Matrix.IsDiag A)
:
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 : Matrix.IsDiag A)
(hd : Matrix.IsDiag D)
:
Matrix.IsDiag (Matrix.fromBlocks A 0 0 D)
The block matrix A.fromBlocks 0 0 D
is diagonal if A
and D
are diagonal.
theorem
Matrix.isDiag_fromBlocks_iff
{α : Type u_1}
{n : Type u_4}
{m : Type u_5}
[Zero α]
{A : Matrix m m α}
{B : Matrix m n α}
{C : Matrix n m α}
{D : Matrix n n α}
:
Matrix.IsDiag (Matrix.fromBlocks A B C D) ↔ Matrix.IsDiag A ∧ B = 0 ∧ C = 0 ∧ Matrix.IsDiag D
This is the iff
version of Matrix.IsDiag.fromBlocks
.
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.IsSymm (Matrix.fromBlocks A 0 C D))
(ha : Matrix.IsDiag A)
(hd : Matrix.IsDiag D)
:
Matrix.IsDiag (Matrix.fromBlocks A 0 C D)
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
{α : Type u_1}
{n : Type u_4}
{m : Type u_5}
[Fintype n]
[Mul α]
[AddCommMonoid α]
{A : Matrix m n α}
:
theorem
Matrix.transpose_mul_self_isDiag_iff_hasOrthogonalCols
{α : Type u_1}
{n : Type u_4}
{m : Type u_5}
[Fintype m]
[Mul α]
[AddCommMonoid α]
{A : Matrix m n α}
: