Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Matrix relative entropy, operator convexity, and perspective

Definition
TroppMatrixConcentration_ch8_entropy

by tc · Oct 7, 2026 · Mathlib 0df444a (Lean v4.33.1)

convexitymatrix-analysismatrix-concentration

For a scalar function f:R→Rf:\mathbb R\to\mathbb Rf:R→R, write f(A)f(A)f(A) for its real continuous-functional-calculus value on a complex square matrix AAA. For positive-definite A,HA,HA,H, define

D(A;H)=Re⁡tr⁡[A(log⁡A−log⁡H)−(A−H)].D(A;H)=\operatorname{Re}\operatorname{tr}[A(\log A-\log H)-(A-H)].D(A;H)=Retr[A(logA−logH)−(A−H)].

For a convex set I⊆RI\subseteq\mathbb RI⊆R, operator convexity means that f(tA+(1−t)H)⪯tf(A)+(1−t)f(H)f(tA+(1-t)H)\preceq tf(A)+(1-t)f(H)f(tA+(1−t)H)⪯tf(A)+(1−t)f(H) for every positive finite matrix dimension, Hermitian A,HA,HA,H with spectra in III, and 0≤t≤10\le t\le10≤t≤1. Define the matrix perspective by

Ψf(A;H)=A1/2f(A−1/2HA−1/2)A1/2.\Psi_f(A;H)=A^{1/2}f(A^{-1/2}HA^{-1/2})A^{1/2}.Ψf​(A;H)=A1/2f(A−1/2HA−1/2)A1/2.

These provide the deterministic interfaces for Lieb’s theorem. No trace-one normalization is imposed. On positive-definite inputs the inverse square root is the inverse of the positive square root.

Formalization Note. The operations themselves are total. Continuous functional calculus returns zero for non-Hermitian matrices; on Hermitian matrices it applies the given real function to the finite spectrum. The logarithm retains the existing spectral definition, including its values outside the intended positive-definite domain. The square root takes value zero on nonpositive real inputs, and its inverse uses total real inversion, with 0−1=00^{-1}=00−1=0. Theorems restrict entropy and perspective inputs to positive-definite matrices.

Definition code
import Definitions.Def_TroppMatrixConcentration_spectral
import Mathlib.Analysis.Convex.Function

open scoped Matrix.Norms.L2Operator ComplexOrder

noncomputable section
namespace TroppMatrixConcentration

def ch8_matrixFunction {d : Type*} [Fintype d] [DecidableEq d]
    (f : ℝ → ℝ) (A : Matrix d d ℂ) : Matrix d d ℂ := cfc f A

def ch8_relativeEntropy {d : Type*} [Fintype d] [DecidableEq d]
    (A H : Matrix d d ℂ) : ℝ :=
  (Matrix.trace (A * (matrixLog A - matrixLog H) - (A - H))).re

def ch8_operatorConvexOn (I : Set ℝ) (f : ℝ → ℝ) : Prop :=
  Convex ℝ I ∧ ∀ (d : ℕ) (_ : NeZero d) (A H : Matrix (Fin d) (Fin d) ℂ),
    A.IsHermitian → H.IsHermitian → spectrum ℝ A ⊆ I → spectrum ℝ H ⊆ I →
    ∀ (t : ℝ), 0 ≤ t → t ≤ 1 →
      loewnerLE (ch8_matrixFunction f (t • A + (1 - t) • H))
        (t • ch8_matrixFunction f A + (1 - t) • ch8_matrixFunction f H)

def ch8_perspective {d : Type*} [Fintype d] [DecidableEq d]
    (f : ℝ → ℝ) (A H : Matrix d d ℂ) : Matrix d d ℂ :=
  let S := ch8_matrixFunction Real.sqrt A
  let R := ch8_matrixFunction (fun x => (Real.sqrt x)⁻¹) A
  S * ch8_matrixFunction f (R * H * R) * S

end TroppMatrixConcentration
Source
Joel A. Tropp, An Introduction to Matrix Concentration Inequalities, arXiv:1501.01571v1 (7 January 2015); https://arxiv.org/abs/1501.01571v1; Definitions 8.1.2, 8.4.5, and 8.6.1, printed pp. 120, 129, 134.
Read-back

What the Lean code literally says, in plain math · gpt-6

TroppMatrixConcentration.ch8_matrixFunction: For any finite index type ddd equipped with decidable equality, any function f:R→Rf:\mathbb R\to\mathbb Rf:R→R, and any complex square matrix AAA indexed by ddd, this defines a complex square matrix Ff(A)F_f(A)Ff​(A) by the real continuous functional calculus cfc⁡(f,A)\operatorname{cfc}(f,A)cfc(f,A). Explicitly, if AAA is Hermitian and A=Udiag⁡(λi)U∗A=U\operatorname{diag}(\lambda_i)U^*A=Udiag(λi​)U∗ is a unitary diagonalization with real eigenvalues, then Ff(A)=Udiag⁡(f(λi))U∗F_f(A)=U\operatorname{diag}(f(\lambda_i))U^*Ff​(A)=Udiag(f(λi​))U∗; if AAA is not Hermitian, this real functional calculus returns the zero matrix. There is no assumed positivity, invertibility, or continuity of fff; every function on the finite spectrum is continuous in its subspace topology. The index type may be empty, in which case the output is the unique empty square matrix.

TroppMatrixConcentration.ch8_relativeEntropy: For any finite index type ddd equipped with decidable equality and any two complex square matrices A,HA,HA,H indexed by ddd, this defines the real number Re⁡tr⁡(A(L(A)−L(H))−(A−H))\operatorname{Re}\operatorname{tr}\bigl(A(L(A)-L(H))-(A-H)\bigr)Retr(A(L(A)−L(H))−(A−H)), where L(B)=cfc⁡(log⁡,B)L(B)=\operatorname{cfc}(\log,B)L(B)=cfc(log,B) uses the real continuous functional calculus: for Hermitian B=Udiag⁡(λi)U∗B=U\operatorname{diag}(\lambda_i)U^*B=Udiag(λi​)U∗, it is Udiag⁡(ℓ(λi))U∗U\operatorname{diag}(\ell(\lambda_i))U^*Udiag(ℓ(λi​))U∗, with ℓ(0)=0\ell(0)=0ℓ(0)=0 and ℓ(x)=log⁡∣x∣\ell(x)=\log|x|ℓ(x)=log∣x∣ for x≠0x\ne0x=0; for non-Hermitian BBB, it is the zero matrix. No Hermitian, positive semidefinite, positive definite, invertibility, support, or normalization assumptions are imposed on AAA or HHH. In particular, zero or negative eigenvalues are handled by this total real logarithm rather than excluded, and no infinite value is used. If ddd is empty, the trace is an empty sum and the defined real number is zero.

TroppMatrixConcentration.ch8_operatorConvexOn: For any set I⊆RI\subseteq\mathbb RI⊆R and any function f:R→Rf:\mathbb R\to\mathbb Rf:R→R, this predicate is the conjunction of convexity of III over R\mathbb RR and the following property: for every natural number nnn with a supplied witness that n≠0n\ne0n=0, every pair of complex n×nn\times nn×n matrices A,HA,HA,H indexed by {0,…,n−1}\{0,\ldots,n-1\}{0,…,n−1}, if A,HA,HA,H are Hermitian and their real spectra are subsets of III, then for every real ttt satisfying 0≤t≤10\le t\le10≤t≤1, the matrix tFf(A)+(1−t)Ff(H)−Ff(tA+(1−t)H)tF_f(A)+(1-t)F_f(H)-F_f(tA+(1-t)H)tFf​(A)+(1−t)Ff​(H)−Ff​(tA+(1−t)H) is positive semidefinite, meaning that it is Hermitian and its quadratic form v∗(tFf(A)+(1−t)Ff(H)−Ff(tA+(1−t)H))vv^*\bigl(tF_f(A)+(1-t)F_f(H)-F_f(tA+(1-t)H)\bigr)vv∗(tFf​(A)+(1−t)Ff​(H)−Ff​(tA+(1−t)H))v is real and nonnegative for every v∈Cnv\in\mathbb C^nv∈Cn. Here the real spectrum of a matrix BBB is the set of real λ\lambdaλ for which λ1−B\lambda\mathbf1-Bλ1−B is not invertible, and Ff(B)F_f(B)Ff​(B) denotes real continuous functional calculus: for Hermitian B=Udiag⁡(λi)U∗B=U\operatorname{diag}(\lambda_i)U^*B=Udiag(λi​)U∗ it is Udiag⁡(f(λi))U∗U\operatorname{diag}(f(\lambda_i))U^*Udiag(f(λi​))U∗, while for non-Hermitian BBB it is zero. Convexity means that ax+by∈Iax+by\in Iax+by∈I whenever x,y∈Ix,y\in Ix,y∈I and a,b≥0a,b\ge0a,b≥0 satisfy a+b=1a+b=1a+b=1. The matrix dimension zero is excluded by the witness; both endpoint weights t=0t=0t=0 and t=1t=1t=1 are included; no positivity of A,HA,HA,H or continuity assumption on fff is added. The empty set III is allowed: it is convex, and no Hermitian matrix of positive dimension has spectrum contained in it, so the matrix implication is vacuous in that case.

TroppMatrixConcentration.ch8_perspective: For any finite index type ddd equipped with decidable equality, any function f:R→Rf:\mathbb R\to\mathbb Rf:R→R, and any complex square matrices A,HA,HA,H indexed by ddd, this defines the complex square matrix S Ff(RHR) SS\,F_f(RHR)\,SSFf​(RHR)S, where S=Fs(A)S=F_s(A)S=Fs​(A), R=Fr(A)R=F_r(A)R=Fr​(A), s(x)=xs(x)=\sqrt{x}s(x)=x​ for x≥0x\ge0x≥0 and s(x)=0s(x)=0s(x)=0 for x<0x<0x<0, and r(x)=s(x)−1r(x)=s(x)^{-1}r(x)=s(x)−1 using the total real inverse 0−1=00^{-1}=00−1=0. Thus r(x)=1/xr(x)=1/\sqrt{x}r(x)=1/x​ for x>0x>0x>0 and r(x)=0r(x)=0r(x)=0 for x≤0x\le0x≤0. For every real function ggg, Fg(B)F_g(B)Fg​(B) here is real continuous functional calculus: it equals Udiag⁡(g(λi))U∗U\operatorname{diag}(g(\lambda_i))U^*Udiag(g(λi​))U∗ for Hermitian B=Udiag⁡(λi)U∗B=U\operatorname{diag}(\lambda_i)U^*B=Udiag(λi​)U∗ and equals the zero matrix for non-Hermitian BBB. No Hermitian, positive definite, positive semidefinite, invertibility, or continuity assumptions are imposed on the arguments. Zero and negative eigenvalues of Hermitian AAA are both sent to zero by sss and rrr; if AAA is non-Hermitian then S=R=0S=R=0S=R=0 and the output is zero; if RHRRHRRHR is non-Hermitian its functional calculus is zero. Empty ddd is allowed, yielding the unique empty square matrix.

Human review
  • Endorsed by Shuze Chen · Oct 7, 2026

    Confirmed by the moderator at approval.

  • Endorsed by tc · Oct 7, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me