NLA-lib Explorer

Matrix functions and operator inequalities

Functions of matrices extend scalar functions to operators. Matrix exponentials, logarithms, powers, and sign functions have different domains; operator inequalities compare their behavior under matrix order.

Definition (Hermitian functional calculus). For Hermitian \mathbf{A}=\mathbf{U}\mathbf\Lambda\mathbf{U}^{\mathsf{H}} and a function f defined on its spectrum, set

f(\mathbf{A})=\mathbf{U}\operatorname{diag}(f(\lambda_1),\ldots,f(\lambda_n))\mathbf{U}^{\mathsf{H}}.

The expression is independent of the chosen eigenbasis. Domain restrictions, such as positive definiteness for a real logarithm, are part of each statement.

Copy link

Background

Results

Theorem (The Golden–Thompson inequality).

For Hermitian \mathbf{H} and \mathbf{K}, \operatorname{Re} \operatorname{tr} \exp(\mathbf{H} + \mathbf{K}) \le \operatorname{Re} \operatorname{tr}(\exp(\mathbf{H})\exp(\mathbf{K})) \,. [Bhatia1997, §IX.3]; [Tropp2015, §3.1 notes].

Lean statement and details
Matrix.IsHermitian.re_trace_exp_add_le.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2}
  [Fintype n] [DecidableEq n] {H K : Matrix n n 𝕜} (hH : H.IsHermitian) (hK : K.IsHermitian) :
  RCLike.re (NormedSpace.exp (H + K)).trace ≤
    RCLike.re (NormedSpace.exp H * NormedSpace.exp K).trace

Full source on GitHub

Copy link

Theorem (Perturbation of the sign of a Hermitian matrix).

for Hermitian \mathbf{A}, \mathbf{B} and a > 0 with \lvert \lambda \rvert \ge a for every eigenvalue \lambda of \mathbf{A}, \|\operatorname{sign}(\mathbf{A}) - \operatorname{sign}(\mathbf{B})\|_2 \le \frac{2\|\mathbf{A} - \mathbf{B}\|_2}{a} \,. [Shah2024, Lemma 2.2], there n\|\mathbf{A} - \mathbf{B}\|_2/(a - \|\mathbf{A} - \mathbf{B}\|_2) for \|\mathbf{A} - \mathbf{B}\|_2 < a and any matrices, by a contour integral; for Hermitian matrices the bound is dimension-free and needs no size condition.

Lean statement and details
Matrix.IsHermitian.specNorm_cfc_sign_sub_cfc_sign_le.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜]
  {n : Type u_2} [Fintype n] [DecidableEq n] {A B : Matrix n n 𝕜} (hA : A.IsHermitian)
  (hB : B.IsHermitian) {a : ℝ} (ha : 0 < a) (hspec : ∀ x ∈ spectrum ℝ A, a ≤ |x|) :
  specNorm (cfc Real.sign A - cfc Real.sign B) ≤ 2 * specNorm (A - B) / a

Full source on GitHub

Copy link

Theorem (The intrinsic dimension lemma).

For \varphi convex on [0, \infty) with \varphi(0) = 0 and positive semidefinite \mathbf{A}, \operatorname{Re} \operatorname{tr} \varphi(\mathbf{A}) \le \operatorname{intdim}(\mathbf{A}) \, \varphi(\|\mathbf{A}\|_2) \,. [Tropp2015, Lemma 7.5.1].

Lean statement and details
Matrix.PosSemidef.re_trace_cfc_le_intrinsicDimension_mul.{u_1, u_3} {𝕜 : Type u_1} [RCLike 𝕜]
  {n : Type u_3} [Fintype n] [DecidableEq n] {A : Matrix n n 𝕜} (hA : A.PosSemidef) {φ : ℝ → ℝ}
  (hφ : ConvexOn ℝ (Set.Ici 0) φ) (hφ0 : φ 0 = 0) :
  RCLike.re (cfc φ A).trace ≤ intrinsicDimension A * φ (specNorm A)

Full source on GitHub

Copy link

Theorem (Klein's inequality).

For f convex on s with derivative f' within s at every point of s, and Hermitian \mathbf{A}, \mathbf{B} with spectrum in s, \operatorname{Re} \operatorname{tr}((\mathbf{A} - \mathbf{B}) f'(\mathbf{B})) \le \operatorname{Re} \operatorname{tr} f(\mathbf{A}) - \operatorname{Re} \operatorname{tr} f(\mathbf{B}) \,. [Carlen2010, Theorem 2.11]; [Tropp2015, §8.3].

Lean statement and details
NLAlib.re_trace_mul_cfc_le_re_trace_cfc_sub.{u_1, u_3} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_3}
  [Fintype n] [DecidableEq n] {f f' : ℝ → ℝ} {s : Set ℝ} (hf : ConvexOn ℝ s f)
  (hf' : ∀ x ∈ s, HasDerivWithinAt f (f' x) s x) {A B : Matrix n n 𝕜} (hA : A.IsHermitian)
  (hB : B.IsHermitian) (hAs : spectrum ℝ A ⊆ s) (hBs : spectrum ℝ B ⊆ s) :
  RCLike.re ((A - B) * cfc f' B).trace ≤ RCLike.re (cfc f A).trace - RCLike.re (cfc f B).trace

Full source on GitHub

Copy link

Theorem (The Lie product formula).

for matrices: (\exp(\mathbf{H}/k)\exp(\mathbf{K}/k))^k \to \exp(\mathbf{H} + \mathbf{K}) as k \to \infty, for any two square matrices over an RCLike field. [Bhatia1997, §IX.1].

Lean statement and details
NLAlib.tendsto_exp_smul_mul_exp_smul_pow.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2}
  [Fintype n] [DecidableEq n] (H K : Matrix n n 𝕜) :
  Filter.Tendsto (fun k ↦ (NormedSpace.exp ((↑k)⁻¹ • H) * NormedSpace.exp ((↑k)⁻¹ • K)) ^ k)
    Filter.atTop (𝓝 (NormedSpace.exp (H + K)))

Full source on GitHub

Copy link

Theorem (Lieb's concavity theorem).

For a fixed Hermitian \mathbf{H}, the function \mathbf{A} \mapsto \operatorname{Re} \operatorname{tr} \exp(\mathbf{H} + \log(\mathbf{A})) is concave on the positive definite matrices. [Lieb1973, Theorem 6]; [Tropp2015, Theorem 8.1.1]; Lieb states it for the trace on a finite-dimensional complex Hilbert space, here over \Bbbk with the real part of the trace.

Lean statement and details
Matrix.IsHermitian.concaveOn_re_trace_exp_add_cfc_log.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜]
  {n : Type u_2} [Fintype n] [DecidableEq n] {H : Matrix n n 𝕜} (hH : H.IsHermitian) :
  ConcaveOn ℝ {A | A.PosDef} fun A ↦ RCLike.re (NormedSpace.exp (H + cfc Real.log A)).trace

Full source on GitHub

Copy link

Theorem (A 1-Lipschitz function is 1-Lipschitz in the Frobenius norm on Hermitian matrices).

for Hermitian \mathbf{A}, \mathbf{B} over \Bbbk and f : \mathbb{R} \to \mathbb{R} with \lvert f(x) - f(y)\rvert \le \lvert x - y\rvert, \|f(\mathbf{A}) - f(\mathbf{B})\|_{\mathsf{F}} \le \|\mathbf{A} - \mathbf{B}\|_{\mathsf{F}}. The finite-dimensional Hermitian specialization of [Kittaneh1985, abstract], with Lipschitz constant one. The statement includes both real and complex matrices and empty index types.

Lean statement and details
Matrix.IsHermitian.frobNorm_cfc_sub_cfc_le.{u_1, u_4} {𝕜 : Type u_1} [RCLike 𝕜] {ι : Type u_4}
  [Fintype ι] [DecidableEq ι] {A B : Matrix ι ι 𝕜} (hA : A.IsHermitian) (hB : B.IsHermitian)
  {f : ℝ → ℝ} (hf : LipschitzWith 1 f) : frobNorm (cfc f A - cfc f B) ≤ frobNorm (A - B)

Full source on GitHub

Copy link

Theorem (The logarithm is operator monotone).

on positive definite matrices: if \mathbf{A} is positive definite and \mathbf{A} \preceq \mathbf{B}, then \log(\mathbf{A}) \preceq \log(\mathbf{B}). [Bhatia1997, Exercise V.1.10].

Lean statement and details
Matrix.PosDef.cfc_log_le_cfc_log.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n]
  [DecidableEq n] {A B : Matrix n n 𝕜} (hA : A.PosDef) (h : A ≤ B) : cfc Real.log A ≤ cfc Real.log B

Full source on GitHub

Copy link

Theorem (The log-determinant is strictly concave).

\mathbf{A} \mapsto \log \det \mathbf{A} is strictly concave on the positive definite matrices. [HornJohnson2013, Theorem 7.6.6].

Lean statement and details
NLAlib.strictConcaveOn_log_re_det.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n]
  [DecidableEq n] : StrictConcaveOn ℝ {A | A.PosDef} fun A ↦ Real.log (RCLike.re A.det)

Full source on GitHub

Copy link

Theorem (Fréchet derivative of the exponential).

For arbitrary real or complex square matrices the derivative in a direction is its integral between left and right exponential factors. [Higham2008, Chapter 10].

Lean statement and details
NLAlib.fderiv_exp_apply.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n]
  [DecidableEq n] (A E : Matrix n n 𝕜) :
  (fderiv 𝕜 NormedSpace.exp A) E =
    ∫ (s : ℝ) in 0..1, NormedSpace.exp ((1 - s) • A) * E * NormedSpace.exp (s • A)

Full source on GitHub

Copy link

Theorem (Exponential growth and the Hermitian part).

The Euclidean operator norm of the semigroup generated by a square matrix grows at most as e^{ct} at every nonnegative time if and only if its Hermitian part is bounded above by c\mathbf{I}. For c=0 this is the contraction criterion. [Higham2022, Theorems 3 and 6].

Lean statement and details
NLAlib.forall_specNorm_exp_smul_le_iff.{u_1, u_2} {𝕜 : Type u_1} {n : Type u_2} [RCLike 𝕜]
  [Fintype n] [DecidableEq n] (A : Matrix n n 𝕜) (c : ℝ) :
  (∀ (t : ℝ), 0 ≤ t → specNorm (NormedSpace.exp (t • A)) ≤ rexp (t * c)) ↔ hermitianPart A ≤ c • 1

Full source on GitHub

Copy link

Theorem (The actual second Fréchet derivative is the sum of the two ordered second block differences).

[Tropp2026, §§4.2–4.4].

Lean statement and details
NLAlib.fderiv_fderiv_rationalMatrixEval_apply.{u_1, u_2} {𝕜 : Type u_1} {n : Type u_2} [RCLike 𝕜]
  [Fintype n] [DecidableEq n] (P Q : Polynomial 𝕜) (A G H : Matrix n n 𝕜)
  (hA : IsUnit ((Polynomial.aeval A) Q)) :
  ((fderiv 𝕜 (fun B ↦ fderiv 𝕜 (rationalMatrixEval P Q) B) A) G) H =
    rationalSecondBlockDifference P Q A A A G H + rationalSecondBlockDifference P Q A A A H G

Full source on GitHub

Copy link

Theorem (Daleckii–Krein derivative).

The real Fréchet derivative on the Hermitian matrix space is the conjugated divided-difference Hadamard operator. Differentiability at each eigenvalue is enough, hence in particular the continuously differentiable hypothesis on any open spectral interval is sufficient. The supplied unitary basis need not order or separate repeated eigenvalues. [Tropp2022, Theorem 14.13].

Lean statement and details
NLAlib.hasFDerivAt_cfc_subtype.{u_1, u_2} {𝕜 : Type u_1} {n : Type u_2} [RCLike 𝕜] [Fintype n]
  [DecidableEq n] (A : ↥(selfAdjoint.submodule ℝ (Matrix n n 𝕜))) {f : ℝ → ℝ}
  (hf : ∀ x ∈ spectrum ℝ ↑A, DifferentiableAt ℝ f x) (ev : n → ℝ) (U : ↥(unitary (Matrix n n 𝕜)))
  (hdiag : ↑A = (↑U * diagonal fun i ↦ ↑(ev i)) * (↑U)ᴴ) :
  HasFDerivAt (fun B ↦ cfc f ↑B)
    (loewnerDerivative f ev U ∘SL (selfAdjoint.submodule ℝ (Matrix n n 𝕜)).subtypeL) A

Full source on GitHub

Copy link

Theorem (Greatest positive block completion).

For positive definite \mathbf{A} and positive semidefinite \mathbf{B}, their geometric mean is the greatest Hermitian \mathbf{X} for which the block matrix with diagonal \mathbf{A},\mathbf{B} and off-diagonal \mathbf{X} is positive semidefinite. [Tropp2022, Definition 16.15 and Theorem 12.16].

Lean statement and details
Matrix.PosDef.isGreatest_setOf_posSemidef_fromBlocks.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜]
  {n : Type u_2} [Fintype n] [DecidableEq n] {A B : Matrix n n 𝕜} (hA : A.PosDef)
  (hB : B.PosSemidef) :
  IsGreatest {X | X.IsHermitian ∧ (fromBlocks A X X B).PosSemidef} (matrixPerspective Real.sqrt A B)

Full source on GitHub

Copy link

Theorem (Residual squaring).

After k inverse refinements the right residual is exactly the 2^k-th power of the initial residual. [Higham2008, §5.3].

Lean statement and details
NLAlib.one_sub_mul_inverseSchulzIterate.{u_1, u_2} {n : Type u_1} [Fintype n] [DecidableEq n]
  {R : Type u_2} [Ring R] (A X : Matrix n n R) (k : ℕ) :
  1 - A * inverseSchulzIterate A X k = (1 - A * X) ^ 2 ^ k

Full source on GitHub

Copy link

Theorem (K-transform derivative witness).

A positive definite strict supersolution exists exactly when the derivative sends some positive definite direction to a positive definite matrix. [MontanariSaeed2026, Lemma 6].

Lean statement and details
NLAlib.exists_posDef_sub_matrixKStabilityMap_iff_exists_posDef_matrixKTransformDeriv.{u_1}
  {n : Type u_1} [Fintype n] [DecidableEq n] (ν : Measure ↥(selfAdjoint (Matrix n n ℂ)))
  [IsFiniteMeasure ν] (hν : IsCompact ν.support) (α : ℝ) (hα : 0 < α) (S : Matrix n n ℂ)
  (hS : S.PosDef) (hgap : IsKTransformAdmissible ν S) :
  (∃ Y, Y.PosDef ∧ (Y - (matrixKStabilityMap ν α S) Y).PosDef) ↔
    ∃ B, B.PosDef ∧ ((matrixKTransformDeriv ν α S) B).PosDef

Full source on GitHub

Copy link

Theorem (Löwner criterion).

On an open convex real set a differentiable function is operator monotone in every finite size precisely when all its Löwner matrices are positive. Repeated nodes and unbounded intervals are permitted. [Tropp2022, §14].

Lean statement and details
NLAlib.operatorMonotoneOn_iff_posSemidef_loewnerMatrix {I : Set ℝ} {f : ℝ → ℝ} (hI : IsOpen I)
  (hcI : Convex ℝ I) (hf : DifferentiableOn ℝ f I) :
  OperatorMonotoneOn I f ↔
    ∀ (d : ℕ) (ev : Fin d → ℝ), (∀ (i : Fin d), ev i ∈ I) → (loewnerMatrix f ev).PosSemidef

Full source on GitHub

Copy link

Theorem (Exact sign Newton iterates).

The commuting sign and the doubly powered Cayley coordinate give the actual inverse-averaging iteration. [Higham2008, §5.3].

Lean statement and details
NLAlib.IsMatrixSign.signNewtonIterate_eq.{u_4} {n : Type u_4} [Fintype n] [DecidableEq n]
  {A S : Matrix n n ℂ} (hS : IsMatrixSign A S) (k : ℕ) :
  signNewtonIterate A k = inverseCayley (((A - S) * (A + S)⁻¹) ^ 2 ^ k) * S

Full source on GitHub

Copy link

Theorem (Uniqueness of the matrix sign).

Two commuting involutions satisfying the positive-stability characterization for the same input coincide. [Higham2008, Theorem 5.1].

Lean statement and details
NLAlib.IsMatrixSign.eq.{u_1} {n : Type u_1} [Fintype n] [DecidableEq n] {A S T : Matrix n n ℂ}
  (hS : IsMatrixSign A S) (hT : IsMatrixSign A T) : S = T

Full source on GitHub

Copy link

Theorem (The matrix sign of a Sylvester block).

For positive-stable diagonal coefficients and a solution of the Sylvester sum equation, the off-diagonal block of the matrix sign is twice the solution. [Higham2008, §5.1].

Lean statement and details
NLAlib.matrixSign_fromBlocks_zero₂₁.{u_2, u_3} {m : Type u_2} {n : Type u_3} [Fintype m]
  [DecidableEq m] [Fintype n] [DecidableEq n] {A : Matrix m m ℂ} {B : Matrix n n ℂ}
  (hA : IsPositiveStable A) (hB : IsPositiveStable B) {C X : Matrix m n ℂ}
  (hX : A * X + X * B = C) : matrixSign (fromBlocks A C 0 (-B)) = fromBlocks 1 (2 • X) 0 (-1)

Full source on GitHub

Copy link

Theorem (The mean value trace inequality).

For g non-decreasing on s, h with derivative h' within s and h' convex on s, and Hermitian \mathbf{A}, \mathbf{B} with spectrum in s, \begin{aligned} &\operatorname{Re} \operatorname{tr}\bigl((g(\mathbf{A}) - g(\mathbf{B})) (h(\mathbf{A}) - h(\mathbf{B}))\bigr) \\ &\quad \le \tfrac12 \operatorname{Re} \operatorname{tr}\bigl((g(\mathbf{A}) - g(\mathbf{B})) (\mathbf{A} - \mathbf{B})(h'(\mathbf{A}) + h'(\mathbf{B}))\bigr) \,. \end{aligned} [MackeyEtAl2014, Lemma 3.4].

Lean statement and details
NLAlib.re_trace_cfc_sub_mul_cfc_sub_le.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2}
  [Fintype n] [DecidableEq n] {g h h' : ℝ → ℝ} {s : Set ℝ} (hg : MonotoneOn g s)
  (hh : ∀ x ∈ s, HasDerivWithinAt h (h' x) s x) (hh' : ConvexOn ℝ s h') {A B : Matrix n n 𝕜}
  (hA : A.IsHermitian) (hB : B.IsHermitian) (hAs : spectrum ℝ A ⊆ s) (hBs : spectrum ℝ B ⊆ s) :
  RCLike.re ((cfc g A - cfc g B) * (cfc h A - cfc h B)).trace ≤
    1 / 2 * RCLike.re ((cfc g A - cfc g B) * (A - B) * (cfc h' A + cfc h' B)).trace

Full source on GitHub

Copy link

Theorem (Multivariate Araki–Lieb–Thirring).

For positive semidefinite factors A_j, p \ge 1 and 0 < r < 1, with both products in the given order, \log \left\|\left\lvert\prod_j A_j^r\right\rvert^{1/r}\right\|_{S_p} \le \int_{\mathbb{R}} \beta_r(t) \log \left\|\prod_j A_j^{1+it}\right\|_{S_p}\,dt. Here \beta_r is the strip Poisson density and the extended logarithm takes the value -\infty at zero. [SutterBertaTomamichel2017, Theorem 3.2]. The formal proof adapts tchen-research/NLAlib@77514ce.

Lean statement and details
NLAlib.log_schattenNorm_rpow_abs_prod_rpow_le_extendedLogIntegral.{u_1} {n : Type u_1} [Fintype n]
  [DecidableEq n] (L : List (Matrix n n ℂ)) (hL : ∀ A ∈ L, A.PosSemidef) {p r : ℝ} (hp : 1 ≤ p)
  (hr : r ∈ Set.Ioo 0 1) :
  (ENNReal.ofReal
        (schattenNorm (ENNReal.ofReal p)
          (CFC.abs (List.map (fun A ↦ A ^ r) L).prod ^ (1 / r)))).log ≤
    extendedLogIntegral r.stripHarmonicMeasure fun t ↦
      schattenNorm (ENNReal.ofReal p) (orderedMatrixCpow L (1 + ↑t * Complex.I))

Full source on GitHub

Copy link

Theorem (Multivariate Golden–Thompson).

For Hermitian matrices \mathbf H_j and 1\le p<\infty, \log\Big\|\exp\Big(\sum_j\mathbf H_j\Big)\Big\|_{S_p} \le \int_{\mathbb R}\!\beta_0(t)\log\Big\|\prod_j\exp((1+it)\mathbf H_j)\Big\|_{S_p}\,dt, where \beta_0(t)=\pi/(2(\cosh(\pi t)+1)) and multiplication follows the order of the list. [SutterBertaTomamichel2017, Corollary 3.3]. The formal proof adapts tchen-research/NLAlib@77514ce.

Lean statement and details
NLAlib.log_schattenNorm_exp_sum_le_integral.{u_1} {n : Type u_1} [Fintype n] [DecidableEq n]
  (H : List (Matrix n n ℂ)) (hH : ∀ A ∈ H, A.IsHermitian) {p : ℝ} (hp : 1 ≤ p) :
  Real.log (schattenNorm (ENNReal.ofReal p) (NormedSpace.exp H.sum)) ≤
    ∫ (t : ℝ),
      t.stripPoissonDensityZero *
        Real.log (schattenNorm (ENNReal.ofReal p) (orderedMatrixExp H (1 + ↑t * Complex.I)))

Full source on GitHub

Copy link

Theorem (Nearest matrix above a spectral floor).

For any matrix \mathbf{A} and real a, let \mathbf{H}=(\mathbf{A}+\mathbf{A}^{\mathsf{H}})/2 and \mathbf{P}=\max(a,\cdot)(\mathbf{H}). For every \mathbf{X}\succeq a\mathbf{I}, \|\mathbf{A}-\mathbf{P}\|_{\mathsf{F}}\le\|\mathbf{A}-\mathbf{X}\|_{\mathsf{F}}. [Higham1988, Theorem 2.1]; [ChengHigham1998, Theorem 3.1]. Here stated over either scalar field, for arbitrary real floors and input matrices, including empty dimensions. Adapted from tchen-research/NLAlib at 77514ce42a0e437d837797a063ac161f41022730, NLAlib.nearestPSD_unique_minimizer, with uniqueness stated separately.

Lean statement and details
NLAlib.frobNorm_sub_cfc_max_hermitianPart_le.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2}
  [Fintype n] [DecidableEq n] (A : Matrix n n 𝕜) (a : ℝ) {X : Matrix n n 𝕜} (hX : a • 1 ≤ X) :
  frobNorm (A - cfc (max a) (hermitianPart A)) ≤ frobNorm (A - X)

Full source on GitHub

Copy link

Theorem (Capacity-to-balance converse).

For a trace-preserving Kraus family with e^{-\delta}\le\operatorname{cap}(T) and \delta\le1/6, its two marginals satisfy \|T(I)-I\|_{\mathsf{F}}^2+\|T^{\mathsf{H}}(I)-I\|_{\mathsf{F}}^2\le6\delta. [GargGurvitsOliveiraWigderson2015, Lemma 3.6].

Lean statement and details
NLAlib.frobNorm_sub_one_sq_add_le_of_adjoint_unital_of_exp_neg_le_operatorCapacity.{u_1, u_2}
  {n : Type u_1} [Fintype n] [DecidableEq n] {ι : Type u_2} [Fintype ι] (A : ι → Matrix n n ℂ)
  (hA : (krausMap fun i ↦ (A i)ᴴ) 1 = 1) {eps : ℝ} (heps : eps ≤ 1 / 6)
  (hcap : rexp (-eps) ≤ operatorCapacity (krausMap A)) :
  frobNorm ((krausMap A) 1 - 1) ^ 2 + frobNorm ((krausMap fun i ↦ (A i)ᴴ) 1 - 1) ^ 2 ≤ 6 * eps

Full source on GitHub

Copy link

Theorem (Operator capacity under invertible scaling).

For a positive real-linear map on complex n by n matrices, n>0, scale the map \Phi by invertible matrices \mathbf{B},\mathbf{C} to obtain \Psi(\mathbf{X})=\mathbf{B}\Phi(\mathbf{C}\mathbf{X}\mathbf{C}^{\mathsf{H}}) \mathbf{B}^{\mathsf{H}}. Then \operatorname{cap}(\Psi)=\lvert\det\mathbf{B}\rvert^2 \lvert\det\mathbf{C}\rvert^2\operatorname{cap}(\Phi). This includes maps of zero capacity. [GargGurvitsOliveiraWigderson2015, Proposition 2.7], extended from completely positive maps to positive real-linear maps.

General form: sizes are index types

Lean statement and details
NLAlib.operatorCapacity_congruence_scaling.{u_1} {n : Type u_1} [Fintype n] [DecidableEq n]
  (hN : 0 < Fintype.card n) (T S : Matrix n n ℂ →ₗ[ℝ] Matrix n n ℂ)
  (hT : ∀ (X : Matrix n n ℂ), X.PosSemidef → (T X).PosSemidef) (B C : Matrix n n ℂ) (hB : IsUnit B)
  (hC : IsUnit C) (hS : ∀ (X : Matrix n n ℂ), S X = B * T (C * X * Cᴴ) * Bᴴ) :
  operatorCapacity S = Complex.normSq B.det * Complex.normSq C.det * operatorCapacity T

Full source on GitHub

Copy link

Theorem (The operator Jensen inequality for an isometry).

(Hansen–Pedersen). If f is operator convex on s, \mathbf{A} is Hermitian with spectrum in s, and \mathbf{K} has orthonormal columns, then f(\mathbf{K}^{\mathsf{H}}\mathbf{A}\mathbf{K}) \preceq \mathbf{K}^{\mathsf{H}} f(\mathbf{A}) \mathbf{K} \,. [Tropp2015, Theorem 8.5.2]; [Bhatia1997, Theorem V.2.3].

Lean statement and details
NLAlib.OperatorConvexOn.cfc_conjTranspose_mul_mul_le.{u_1, u_2, u_3} {𝕜 : Type u_1} [RCLike 𝕜]
  {m : Type u_2} {n : Type u_3} [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] {s : Set ℝ}
  {f : ℝ → ℝ} (hf : OperatorConvexOn s f) {A : Matrix m m 𝕜} (hA : A.IsHermitian)
  (hAs : spectrum ℝ A ⊆ s) {K : Matrix m n 𝕜} (hK : HasOrthonormalCols K) :
  cfc f (Kᴴ * A * K) ≤ Kᴴ * cfc f A * K

Full source on GitHub

Copy link

Theorem (Operator-monotone modulus of continuity).

For a continuous matrix monotone function on the nonnegative half-line with f(0)\ge 0 and positive semidefinite matrices, the spectral-norm difference of the function values satisfies \|f(\mathbf{A})-f(\mathbf{B})\|_2 \le f(\|\mathbf{A}-\mathbf{B}\|_2). [Bhatia1997, Theorem X.1.1], allowing a nonnegative boundary value.

Lean statement and details
NLAlib.OperatorMonotoneOn.specNorm_cfc_sub_le.{u_1, u_2} {𝕜 : Type u_1} {n : Type u_2} [RCLike 𝕜]
  [Fintype n] [DecidableEq n] {f : ℝ → ℝ} (hm : OperatorMonotoneOn (Set.Ici 0) f)
  (hf : ContinuousOn f (Set.Ici 0)) (h₀ : 0 ≤ f 0) {A B : Matrix n n 𝕜} (hA : A.PosSemidef)
  (hB : B.PosSemidef) : specNorm (cfc f A - cfc f B) ≤ f (specNorm (A - B))

Full source on GitHub

Copy link

Theorem (Peierls' inequality).

For \varphi convex on a set containing the spectrum of the Hermitian matrix \mathbf{A} and \mathbf{U} with orthonormal columns \mathbf{u}_i = \mathbf{U}\mathbf{e}_i, \sum_i \varphi(\operatorname{Re}(\mathbf{u}_i^{\mathsf{H}}\mathbf{A}\mathbf{u}_i)) \le \operatorname{Re} \operatorname{tr}(\mathbf{U}^{\mathsf{H}} \varphi(\mathbf{A}) \mathbf{U}) \,; for a unitary \mathbf{U} the right side is \operatorname{tr} \varphi(\mathbf{A}). [Carlen2010, Theorem 2.9]; stated there for an orthonormal basis, here for any orthonormal family.

Lean statement and details
NLAlib.sum_apply_re_quadForm_le_re_trace_cfc.{u_1, u_3, u_4} {𝕜 : Type u_1} [RCLike 𝕜]
  {n : Type u_3} {p : Type u_4} [Fintype n] [Fintype p] [DecidableEq n] [DecidableEq p] {φ : ℝ → ℝ}
  {s : Set ℝ} (hφ : ConvexOn ℝ s φ) {A : Matrix n n 𝕜} (hA : A.IsHermitian) (hAs : spectrum ℝ A ⊆ s)
  {U : Matrix n p 𝕜} (hU : HasOrthonormalCols U) :
  ∑ i, φ (RCLike.re (quadForm A (U *ᵥ Pi.single i 1))) ≤ RCLike.re (Uᴴ * cfc φ A * U).trace

Full source on GitHub

Copy link

Theorem (The perspective of an operator convex function is jointly operator convex).

for f operator convex on (0, \infty), positive definite \mathbf{A}_1, \mathbf{A}_2, \mathbf{H}_1, \mathbf{H}_2 and weights a, b \ge 0 with a + b = 1, \psi_f(a\mathbf{A}_1 + b\mathbf{A}_2, a\mathbf{H}_1 + b\mathbf{H}_2) \preceq a \, \psi_f(\mathbf{A}_1, \mathbf{H}_1) + b \, \psi_f(\mathbf{A}_2, \mathbf{H}_2) \,. [Tropp2015, Theorem 8.6.2].

Lean statement and details
NLAlib.OperatorConvexOn.matrixPerspective_smul_add_smul_le.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜]
  {n : Type u_2} [Fintype n] [DecidableEq n] {f : ℝ → ℝ} (hf : OperatorConvexOn (Set.Ioi 0) f)
  {A₁ A₂ H₁ H₂ : Matrix n n 𝕜} (hA₁ : A₁.PosDef) (hA₂ : A₂.PosDef) (hH₁ : H₁.PosDef)
  (hH₂ : H₂.PosDef) {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a + b = 1) :
  matrixPerspective f (a • A₁ + b • A₂) (a • H₁ + b • H₂) ≤
    a • matrixPerspective f A₁ H₁ + b • matrixPerspective f A₂ H₂

Full source on GitHub

Copy link

Theorem (Greedy minimax polar error).

For a genuinely minimizing update on each attained interval, if the positive singular values of the input belong to [a,1] with 0<a\le1, then after k\ge1 updates the spectral error is at most 1-l_k. The endpoint bound IsGreedyOddMinimax.one_sub_le_pow gives the rate (1-a^2)^{(q+1)^k}. [AmselPerssonMuscoGower2026, Theorem 3.3 and Appendix D], with the theorem's exponent.

Lean statement and details
NLAlib.IsGreedyOddMinimax.specNorm_polarFactor_sub_oddMatrixIterate_le.{u_1, u_2, u_3}
  {𝕜 : Type u_1} {m : Type u_2} {n : Type u_3} [RCLike 𝕜] [Fintype m] [Fintype n] [DecidableEq n]
  {q : ℕ} {a : ℝ} {c : ℕ → ℕ → ℝ} {l u : ℕ → ℝ} (h : IsGreedyOddMinimax q a c l u) (ha : 0 < a)
  (ha1 : a ≤ 1) (A : Matrix m n 𝕜)
  (hA : ∀ (i : ℕ), 0 < singularValues A i → singularValues A i ∈ Set.Icc a 1) {T : ℕ} (hT : 1 ≤ T) :
  specNorm (polarFactor A - oddMatrixIterate q c A T) ≤ 1 - l T

Full source on GitHub

Copy link

Theorem (Polar Newton closed form).

In a compact SVD with strictly positive singular values, the actual kth iterate retains the singular directions and applies the scalar Cayley formula. For c_i=(\sigma_i-1)/(\sigma_i+1) the new coefficients are \frac{1+c_i^{2^k}}{1-c_i^{2^k}}. [Higham2008, §8.3].

Lean statement and details
NLAlib.IsSVD.polarNewtonIterate_eq.{u_1, u_2, u_3, u_4} {𝕜 : Type u_1} {m : Type u_2} {n : Type u_3}
  {r : Type u_4} [RCLike 𝕜] [Fintype m] [Fintype n] [Fintype r] [DecidableEq r] {A : Matrix m n 𝕜}
  {U : Matrix m r 𝕜} {V : Matrix n r 𝕜} {σ : r → ℝ} (h : IsSVD A U σ V) (hσ : ∀ (i : r), 0 < σ i)
  (k : ℕ) :
  polarNewtonIterate A k =
    (U *
        diagonal fun i ↦
          ↑((1 + ((σ i - 1) / (σ i + 1)) ^ 2 ^ k) / (1 - ((σ i - 1) / (σ i + 1)) ^ 2 ^ k))) *
      Vᴴ

Full source on GitHub

Copy link

Theorem (Singular directions of the inverse-free polar iteration).

The kth matrix iterate acts by the kth iterate of the real cubic on each supplied singular coordinate. [Higham2008, §8.3].

Lean statement and details
NLAlib.IsSVD.polarSchulzIterate_eq.{u_1, u_2, u_3, u_4} {𝕜 : Type u_1} {m : Type u_2} {n : Type u_3}
  {r : Type u_4} [RCLike 𝕜] [Fintype m] [Fintype n] [Fintype r] [DecidableEq n] [DecidableEq r]
  {A : Matrix m n 𝕜} {U : Matrix m r 𝕜} {V : Matrix n r 𝕜} {σ : r → ℝ} (h : IsSVD A U σ V) (k : ℕ) :
  polarSchulzIterate A k = (U * diagonal fun i ↦ ↑(newtonSchulz^[k] (σ i))) * Vᴴ

Full source on GitHub

Copy link

Theorem (The norm of a polynomial in a Hermitian matrix).

is at most the largest value of \lvert p \rvert on its eigenvalues: if c \ge 0 and \lvert p(x) \rvert \le c for every x in the spectrum of \mathbf{A}, then \|p(\mathbf{A})\|_2 \le c. [Saad2003, §6.11]; [Saad2011, §6.6].

Lean statement and details
Matrix.IsHermitian.specNorm_aeval_le.{u_1, u_3} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_3} [Fintype n]
  [DecidableEq n] {A : Matrix n n 𝕜} (hA : A.IsHermitian) (p : Polynomial ℝ) {c : ℝ} (hc : 0 ≤ c)
  (h : ∀ x ∈ spectrum ℝ A, |Polynomial.eval x p| ≤ c) : specNorm ((Polynomial.aeval A) p) ≤ c

Full source on GitHub

Copy link

Theorem (Inverse Jensen inequality).

A positive unital linear matrix map evaluated at a positive definite matrix has inverse bounded above by the map of the inverse. [Tropp2022, Theorem 12.19].

Lean statement and details
NLAlib.inv_map_le_map_inv.{u_1, u_2, u_3} {𝕜 : Type u_1} {m : Type u_2} {n : Type u_3} [RCLike 𝕜]
  [Fintype n] [DecidableEq n] [Fintype m] [DecidableEq m] (Φ : Matrix n n 𝕜 →ₚ[𝕜] Matrix m m 𝕜)
  (hΦ : Φ 1 = 1) {A : Matrix n n 𝕜} (hA : A.PosDef) : (Φ A)⁻¹ ≤ Φ A⁻¹

Full source on GitHub

Copy link

Theorem (Kadison's inequality).

For a positive unital linear matrix map and Hermitian input, the square of the image is bounded above by the image of the square. [Tropp2022, Theorem 12.17].

Lean statement and details
NLAlib.sq_map_le_map_sq.{u_1, u_2, u_3} {𝕜 : Type u_1} {m : Type u_2} {n : Type u_3} [RCLike 𝕜]
  [Fintype n] [DecidableEq n] [Fintype m] [DecidableEq m] (Φ : Matrix n n 𝕜 →ₚ[𝕜] Matrix m m 𝕜)
  (hΦ : Φ 1 = 1) {A : Matrix n n 𝕜} (hA : A.IsHermitian) : Φ A ^ 2 ≤ Φ (A ^ 2)

Full source on GitHub

Copy link

Theorem (Russo–Dye norm attainment).

A positive complex-linear map attains its largest spectral norm on the closed spectral-norm unit ball at the identity matrix. Neither unitality nor strict positivity of the image of the identity is required. [Tropp2022, Theorem 12.22].

Lean statement and details
NLAlib.isGreatest_image_specNorm_map.{u_2, u_3} {m : Type u_2} {n : Type u_3} [Fintype n]
  [DecidableEq n] [Fintype m] (Φ : Matrix n n ℂ →ₚ[ℂ] Matrix m m ℂ) :
  IsGreatest ((fun A ↦ specNorm (Φ A)) '' {A | specNorm A ≤ 1}) (specNorm (Φ 1))

Full source on GitHub

Copy link

Theorem (The matrix relative entropy is nonnegative).

(Klein's inequality): for positive definite \mathbf{A} and \mathbf{H}, D(\mathbf{A}; \mathbf{H}) = \operatorname{tr}\bigl(\mathbf{A}(\log(\mathbf{A}) - \log(\mathbf{H})) - (\mathbf{A} - \mathbf{H})\bigr) \ge 0 \,. [Tropp2015, Proposition 8.3.5].

Lean statement and details
Matrix.PosDef.relativeEntropy_nonneg.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n]
  [DecidableEq n] {A H : Matrix n n 𝕜} (hA : A.PosDef) (hH : H.PosDef) : 0 ≤ relativeEntropy A H

Full source on GitHub

Copy link

Theorem (A convex function gives a convex trace function).

for f convex on s, the function \mathbf{A} \mapsto \operatorname{Re} \operatorname{tr} f(\mathbf{A}) is convex on the Hermitian matrices with spectrum in s. [Carlen2010, Theorem 2.10]; [Bhatia1997, Problem IX.8.14 context].

Lean statement and details
NLAlib.convexOn_re_trace_cfc.{u_1, u_3} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_3} [Fintype n]
  [DecidableEq n] {f : ℝ → ℝ} {s : Set ℝ} (hf : ConvexOn ℝ s f) :
  ConvexOn ℝ {A | A.IsHermitian ∧ spectrum ℝ A ⊆ s} fun A ↦ RCLike.re (cfc f A).trace

Full source on GitHub

Copy link

Theorem (Stahl's trace-exponential representation).

For real or complex Hermitian matrices \mathbf{A},\mathbf{H}, the real trace of \exp(\mathbf{A}+t\mathbf{H}) is the Laplace transform of a finite positive measure supported between the spectral extremes of \mathbf{H}, for every real t. This includes repeated eigenvalues and the empty matrix. The mass, tilted moments and even-derivative bounds follow from the scalar measure API. [Stahl2013, Theorems 1 and 2].

Lean statement and details
NLAlib.exists_isCompactExpRepresentation_re_trace_exp.{u_1, u_2} {𝕜 : Type u_1} {n : Type u_2}
  [RCLike 𝕜] [Fintype n] [DecidableEq n] (A H : Matrix n n 𝕜) (hA : A.IsHermitian)
  (hH : H.IsHermitian) :
  ∃ ν,
    IsCompactExpRepresentation ν (fun t ↦ RCLike.re (NormedSpace.exp (A + t • H)).trace)
      (sInf (spectrum ℝ H)) (sSup (spectrum ℝ H))

Full source on GitHub

Copy link

Theorem (The trace of the inverse is strictly convex).

\mathbf{A} \mapsto \operatorname{tr} \mathbf{A}^{-1} is strictly convex on the positive definite matrices.

Lean statement and details
NLAlib.strictConvexOn_re_trace_inv.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n]
  [DecidableEq n] : StrictConvexOn ℝ {A | A.PosDef} fun A ↦ RCLike.re A⁻¹.trace

Full source on GitHub

Copy link

Theorem (A monotone function gives a monotone trace function).

if \mathbf{A} is Hermitian, \mathbf{A} \preceq \mathbf{B}, both have spectrum in s and f is non-decreasing on s, then \operatorname{Re} \operatorname{tr} f(\mathbf{A}) \le \operatorname{Re} \operatorname{tr} f(\mathbf{B}). [Tropp2015, §2.1 and §8.3]; [Carlen2010, Theorem 2.10].

Lean statement and details
Matrix.IsHermitian.re_trace_cfc_le_re_trace_cfc_of_le.{u_1, u_3} {𝕜 : Type u_1} [RCLike 𝕜]
  {n : Type u_3} [Fintype n] [DecidableEq n] {A B : Matrix n n 𝕜} (hA : A.IsHermitian) (h : A ≤ B)
  {f : ℝ → ℝ} {s : Set ℝ} (hf : MonotoneOn f s) (hAs : spectrum ℝ A ⊆ s) (hBs : spectrum ℝ B ⊆ s) :
  RCLike.re (cfc f A).trace ≤ RCLike.re (cfc f B).trace

Full source on GitHub

Copy link

Theorem (The trace of f(\mathbf{A})).

is the sum of f over the eigenvalues: for Hermitian \mathbf{A}, \operatorname{Re} \operatorname{tr} f(\mathbf{A}) = \sum_{i < \lvert n \rvert} f(\lambda_i(\mathbf{A})). [Tropp2015, Definition 8.3.1]; there the sum defines the trace function, with the remark that it agrees with the trace of the standard matrix function.

General form: sizes are index types

Lean statement and details
Matrix.IsHermitian.re_trace_cfc.{u_1, u_3} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_3} [Fintype n]
  [DecidableEq n] {A : Matrix n n 𝕜} (hA : A.IsHermitian) (f : ℝ → ℝ) :
  RCLike.re (cfc f A).trace = ∑ i ∈ Finset.range (Fintype.card n), f (eigenvalue A i)

Full source on GitHub

Copy link

Theorem (McCarthy's trace superadditivity).

For positive semidefinite \mathbf{X},\mathbf{Y} and real p \ge 1, \operatorname{Re}\operatorname{tr}(\mathbf{X}^p) + \operatorname{Re}\operatorname{tr}(\mathbf{Y}^p) \le \operatorname{Re}\operatorname{tr}((\mathbf{X}+\mathbf{Y})^p). [PerssonMeyerMusco2025, proof of Lemma 2.3].

Lean statement and details
Matrix.PosSemidef.re_trace_rpow_add_le.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2}
  [Fintype n] [DecidableEq n] {X Y : Matrix n n 𝕜} (hX : X.PosSemidef) (hY : Y.PosSemidef) {p : ℝ}
  (hp : 1 ≤ p) : RCLike.re (X ^ p).trace + RCLike.re (Y ^ p).trace ≤ RCLike.re ((X + Y) ^ p).trace

Full source on GitHub

Copy link

Formal definitions

Used by algorithms

Broader topics