Matrix second moments, cumulant sums, and Bernstein tail expression
DefinitionTroppMatrixConcentration_probabilityEquip complex matrix spaces with the Borel sigma-algebra of their product topology. For matrix-valued functions on a measure space, define the uncentered rectangular second-moment statistic , the Hermitian second-moment statistic , and the finite cumulant sum . Centering is supplied explicitly by callers; the concentration statements use zero-mean random matrices. The Bernstein tail expression is when the denominator is nonzero. When it is zero the expression is defined as at and zero otherwise. Probability, integrability, Hermitian, and positivity assumptions belong to the theorem statements, not to these total definitions.
import Definitions.Def_TroppMatrixConcentration_spectral
import Mathlib.MeasureTheory.Integral.Bochner.Basic
import Mathlib.Probability.Independence.Basic
import Mathlib.MeasureTheory.Function.LpSeminorm.Basic
import Mathlib.MeasureTheory.Constructions.BorelSpace.Complex
open MeasureTheory
open scoped Matrix.Norms.L2Operator
noncomputable section
namespace TroppMatrixConcentration
instance matrixMeasurableSpace {m n : Type*} : MeasurableSpace (Matrix m n ℂ) :=
borel (Matrix m n ℂ)
instance matrixBorelSpace {m n : Type*} : BorelSpace (Matrix m n ℂ) := ⟨rfl⟩
def rectSecondMoment {Ω m n : Type*} [MeasurableSpace Ω]
[Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n]
(μ : Measure Ω) (Z : Ω → Matrix m n ℂ) : ℝ :=
max (spectralNorm (∫ ω, Z ω * (Z ω).conjTranspose ∂μ))
(spectralNorm (∫ ω, (Z ω).conjTranspose * Z ω ∂μ))
def hermitianSecondMoment {Ω d : Type*} [MeasurableSpace Ω]
[Fintype d] [DecidableEq d] (μ : Measure Ω) (Y : Ω → Matrix d d ℂ) : ℝ :=
spectralNorm (∫ ω, Y ω ^ 2 ∂μ)
def cumulantSum {Ω d : Type*} [MeasurableSpace Ω]
[Fintype d] [DecidableEq d] {N : ℕ}
(μ : Measure Ω) (X : Fin N → Ω → Matrix d d ℂ) (θ : ℝ) : Matrix d d ℂ :=
∑ k, matrixLog (∫ ω, matrixExp (θ • X k ω) ∂μ)
def bernsteinTail (dimension : ℕ) (v L t : ℝ) : ℝ :=
if v + L * t / 3 = 0 then
if t = 0 then (dimension : ℝ) else 0
else (dimension : ℝ) * Real.exp (-(t ^ 2 / 2) / (v + L * t / 3))
end TroppMatrixConcentration
Read-back
What the Lean code literally says, in plain math · gpt-6
TroppMatrixConcentration.matrixMeasurableSpace. For arbitrary types , this equips the set of complex matrices, viewed as functions assigning a complex number to each row and column index, with the Borel sigma algebra generated by its open sets in the product topology inherited from the usual topology on . No finiteness, countability, decidable-equality, nonemptiness, or additional structure assumptions on either index type are imposed. Infinite index types are included; the sigma algebra is specified as the Borel sigma algebra of the product topology. If either index type is empty, the matrix space is a singleton and this is its unique sigma algebra.
TroppMatrixConcentration.matrixBorelSpace. For arbitrary types , this supplies the assertion that the measurable-space structure on provided by matrixMeasurableSpace is exactly the Borel sigma algebra of the product topology inherited from ; the assertion holds by the defining equality of that measurable-space structure. It requires no hypotheses on the index types, including no finiteness, countability, decidable-equality, or nonemptiness assumptions. Empty index types are included, in which case the matrix space is a singleton with its unique sigma algebra.
TroppMatrixConcentration.rectSecondMoment. For any type equipped with a measurable space, any finite index types equipped with finite enumerations and decidable equality, any measure on , and any function , this defines the real number , where is the conjugate transpose, products are matrix products, the two integrals are respectively and matrix-valued Bochner integrals, and is the operator norm induced by Euclidean norms. There is no assumption that is finite or a probability measure, or that or either product is measurable or integrable. Each integral individually has the value zero when its integrand is not Bochner integrable, so if both integrands fail integrability the defined number is zero. Empty index types are allowed; if either or is empty the number is zero. The measurable domain may also be empty, and the zero measure is permitted, in either case giving zero.
TroppMatrixConcentration.hermitianSecondMoment. For any type equipped with a measurable space, any finite index type equipped with a finite enumeration and decidable equality, any measure on , and any function , this defines the real number , with a matrix-valued Bochner integral and the Euclidean operator norm. Here is the matrix product , with no conjugate transpose. No Hermitian, positivity, centering, measurability, or integrability condition on is imposed, and need not be finite or a probability measure. If the square-valued integrand is not Bochner integrable, its integral and hence the defined number are zero. An empty , an empty , and the zero measure are all allowed and give zero.
TroppMatrixConcentration.cumulantSum. For any type equipped with a measurable space, any finite index type equipped with a finite enumeration and decidable equality, any natural number , any measure on , any family of functions indexed by , and any real , this defines the matrix . Scalar multiplication is by the real number , the exponential is the matrix exponential , and the integral is the matrix-valued Bochner integral, defined to be zero when its integrand is not Bochner integrable. The function is real continuous functional calculus applied to the total real logarithm: it returns zero if is not self-adjoint or if that logarithm is not continuous on the real spectrum of ; otherwise it applies the logarithm to the spectrum through continuous functional calculus. For a finite Hermitian matrix it therefore replaces each nonzero real eigenvalue by and each zero eigenvalue by zero, preserving the corresponding eigenspaces. In particular, , so a nonintegrable exponential integrand contributes a zero summand. There are no independence, self-adjointness, positivity, measurability, integrability, or centering hypotheses on the family, no sign restriction on , and no finiteness or probability assumption on . The case is included and yields the zero matrix; an empty yields the unique empty matrix, and an empty or zero measure yields the zero matrix.
TroppMatrixConcentration.bernsteinTail. For every natural number and arbitrary real numbers , this defines a real number by setting and returning (viewed as a real number) when and , zero when and , and when . Thus the zero-denominator cases are handled by an explicit branch, including . There are no nonnegativity assumptions on and no requirement that be positive: gives zero in every case, while gives for every . If and and , the returned value exceeds ; the definition imposes no bound by one and contains no measure or event.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.