Theorem (integral_spectralMeasure). The spectral measure integrates the quadratic form: for every square \mathbf{A} (both sides vanish off Hermitian, so no hypothesis), every \mathbf{b} and every f : \mathbb{R} \to \mathbb{R}, \int f\,d\mu_{\mathbf{A},\mathbf{b}} = \operatorname{Re}\,\mathbf{b}^{\mathsf{H}} f(\mathbf{A})\mathbf{b}, with f(\mathbf{A}) Mathlib's cfc f A. No continuity or measurability of f is needed: the measure is atomic. [GolubMeurant2010, Ch. 7]; there for real symmetric \mathbf{A} as a Riemann–Stieltjes integral, here over any RCLike field.
Headline
Lean statement and details
NLAlib.integral_spectralMeasure.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2} [Fintype n]
[DecidableEq n] (A : Matrix n n 𝕜) (b : n → 𝕜) (f : ℝ → ℝ) :
∫ (x : ℝ), f x ∂spectralMeasure A b = RCLike.re (quadForm (cfc f A) b)