Theorem (Matrix.IsHermitian.re_trace_cfc). 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.
Headline 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)