Inner product of Hermitian Matrices #
For general matrices there are multiple reasonable notions of "inner product" (Hilbert–Schmidt inner product,
Frobenius inner product), and so Mathlib avoids giving a canonical InnerProductSpace
instance. But for the
particular case of Hermitian matrices, these all coincide, so we can put a canonical InnerProductSpace
instance.
This does however induce a Norm
on HermitianMat
as well, the Frobenius norm, and this is less obviously
a uniquely correct choice. It is something that one essentially has to live with, with the way that Mathlib
currently structures the instances. (Thankfully, all norms induce the same topology and bornology on
finite-dimensional matrices.)
Some care to be taken so that the topology induced by the InnerProductSpace is defeq with the Subtype
topology that HermitianMat inherits from the topology on Matrix. This can be done via
InnerProductSpace.ofCoreOfTopology
.
The Hermitian inner product, Tr[AB]
. This is equal to Matrix.trace (A * B)
, but gives real
values when the matrices are complex, using IsMaximalSelfAdjoint
.
Equations
- A.inner B = IsMaximalSelfAdjoint.selfadjMap (↑A * ↑B).trace
Instances For
The Hermitian inner product as bilinear form.
Equations
- HermitianMat.inner_BilinForm = { toFun := fun (A : HermitianMat n α) => { toFun := A.inner, map_add' := ⋯, map_smul' := ⋯ }, map_add' := ⋯, map_smul' := ⋯ }
Instances For
The inner product for Hermtian matrices is equal to the trace of the product.
HermitianMat.inner
reduces to Matrix.trace (A * B)
when the elements are a TrivialStar
.
The inner product of two PSD matrices is zero iff they have disjoint support, i.e., each lives entirely in the other's kernel.
Theorems about HermitianMat
s that have to do with the topological structure. Pretty much everything here will
assume these are matrices over ℂ, but changes to upgrade this to other types are welcome.
We define the Hermitian inner product as our "canonical" inner product, which does induce a norm.
This disagrees slightly with Mathlib convention on the Matrix
type, which avoids asserting one norm
as there are several reasonable ones; for Hermitian matrices, though, this seem to be the right choice.
Equations
- HermitianMat.InnerProductCore = { inner := fun (A B : HermitianMat d 𝕜) => A.inner B, conj_inner_symm := ⋯, re_inner_nonneg := ⋯, add_left := ⋯, smul_left := ⋯, definite := ⋯ }
Instances For
The HermitianMat
type inherits the Frobenius necessarily, since it's going to need the
Hermitian inner product, and in Mathlib an InnerProductSpace
always carries the corresponding
norm.
Equations
Equations
- HermitianMat.instNormedSpace = { toModule := selfAdjoint.instModuleSubtypeMemAddSubgroupOfStarModule, norm_smul_le := ⋯ }
Equations
- One or more equations did not get rendered due to their size.
Equations
- ⋯ = ⋯
Instances For
The inner product for PSD matrices is nonnegative.
Equivalently: the matrices X
such that X - A
is PSD and B - X
is PSD, form a compact set.
The PSD matrices that are ≤ 1
are a compact set. More generally, this is true of any closed interval,
but stating that is a bit different because of how numerals are treated. The 0
and 1
here are already
directly matrices, putting in an (a : ℝ) • 1 ≤ m ∧ m ≤ (b : ℝ) • 1
involves casts. But that theorem should follow
easily from this. More generally A ≤ m ∧ m ≤ B
is compact.