Spectral functions and semidefinite order
DefinitionTroppMatrixConcentration_spectralFor finite complex matrices, define the Euclidean operator norm; the largest and smallest real spectral values; the matrix power-series exponential; the spectral logarithm via continuous functional calculus; the real part of the trace exponential; and the order meaning that is positive semidefinite. Extreme spectral values are used on nonempty Hermitian matrices, and the logarithm on positive-definite matrices. These are concrete Mathlib operations, with no axioms or theorem assumptions. Outside those intended domains the operations retain Mathlib's total-function conventions, as detailed in the read-back.
import Mathlib.Analysis.Matrix.Order
import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.ExpLog.Basic
import Mathlib.Analysis.Normed.Algebra.MatrixExponential
open scoped Matrix.Norms.L2Operator ComplexOrder
noncomputable section
namespace TroppMatrixConcentration
def spectralNorm {m n : Type*} [Fintype m] [Fintype n] [DecidableEq n]
(A : Matrix m n ℂ) : ℝ := ‖A‖
def lambdaMax {d : Type*} [Fintype d] [DecidableEq d]
(A : Matrix d d ℂ) : ℝ := sSup (spectrum ℝ A)
def lambdaMin {d : Type*} [Fintype d] [DecidableEq d]
(A : Matrix d d ℂ) : ℝ := sInf (spectrum ℝ A)
def matrixExp {d : Type*} [Fintype d] [DecidableEq d]
(A : Matrix d d ℂ) : Matrix d d ℂ := NormedSpace.exp A
def matrixLog {d : Type*} [Fintype d] [DecidableEq d]
(A : Matrix d d ℂ) : Matrix d d ℂ := cfc Real.log A
def traceExp {d : Type*} [Fintype d] [DecidableEq d]
(A : Matrix d d ℂ) : ℝ := (Matrix.trace (matrixExp A)).re
def loewnerLE {d : Type*} [Fintype d]
(A B : Matrix d d ℂ) : Prop := (B - A).PosSemidef
end TroppMatrixConcentration
Read-back
What the Lean code literally says, in plain math · gpt-6
TroppMatrixConcentration.spectralNorm. For arbitrary finite index types and , each equipped with a finite enumeration, with decidable equality on , and any complex matrix , this defines a real number equal to the operator norm of the linear map from to , both with their Euclidean norms: . Neither index type is required to be nonempty; if either is empty, the value is . There is no hypothesis on the entries or shape of beyond these types.
TroppMatrixConcentration.lambdaMax. For any finite index type equipped with a finite enumeration and decidable equality, and any complex square matrix , this defines the real supremum of . Thus it uses the real members of the spectrum, even when has nonreal eigenvalues; no Hermitian hypothesis is imposed. When is nonempty, this finite set has a largest member and the value equals that member. When is empty, the value is , by the total real supremum convention; this includes an empty index type and matrices with no real eigenvalues. The underlying real supremum also defaults to for a set unbounded above, although is finite here. No nonemptiness hypothesis is required on or .
TroppMatrixConcentration.lambdaMin. For any finite index type equipped with a finite enumeration and decidable equality, and any complex square matrix , this defines the real infimum of . Thus it uses the real members of the spectrum, even when has nonreal eigenvalues; no Hermitian hypothesis is imposed. When is nonempty, this finite set has a smallest member and the value equals that member. When is empty, the value is , by the total real infimum convention; this includes an empty index type and matrices with no real eigenvalues. The underlying real infimum also defaults to for a set unbounded below, although is finite here. No nonemptiness hypothesis is required on or .
TroppMatrixConcentration.matrixExp. For any finite index type equipped with a finite enumeration and decidable equality, and any complex square matrix , this defines a complex square matrix by the normed-algebra exponential , with matrix multiplication and . This series converges for every such finite matrix; no Hermitian, positivity, or invertibility hypothesis is required. The type may be empty, in which case the result is the unique empty square matrix, which is both its zero and its identity matrix.
TroppMatrixConcentration.matrixLog. For any finite index type equipped with a finite enumeration and decidable equality, and any complex square matrix , this defines the real continuous functional calculus applied to and the total real function given by and for . The functional calculus returns the zero matrix when is not self-adjoint, equivalently not Hermitian; its general definition also returns zero when the scalar function is not continuous on , but continuity on this finite set holds here. For Hermitian with unitary and all real, the value is : negative eigenvalues are sent to the logarithm of their absolute value, and zero eigenvalues are sent to zero. The declaration imposes no Hermitian, positivity, invertibility, or nonemptiness hypothesis. When is empty, the result is the unique empty square matrix.
TroppMatrixConcentration.traceExp. For any finite index type equipped with a finite enumeration and decidable equality, and any complex square matrix , this defines the real number , namely the real part of the trace of the normed-algebra matrix exponential, whose series converges for every such . No Hermitian or positivity hypothesis is imposed, so the definition explicitly takes a real part even when the trace is complex. The index type may be empty, in which case the trace is an empty sum and the value is .
TroppMatrixConcentration.loewnerLE. For any finite index type equipped with a finite enumeration, and any two complex square matrices , this defines a proposition saying that is positive semidefinite: , and for every vector , the scalar is real and nonnegative. The underlying definition quantifies over finitely supported vectors, which includes every vector on the finite type . There is no decidable-equality assumption on , no nonemptiness assumption, and no separate assumption that either or is Hermitian. When is empty, the Hermitian equality holds for the unique matrices, the quadratic form is zero, and the proposition holds.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.