NLA-lib Explorer

IsIdempotentElem.trace_mul_add_trace_one_sub_mul_mul_one_sub

Library · theorem

The trace split for an idempotent \mathbf{P} (\mathbf{P}^2 = \mathbf{P}, not necessarily Hermitian) over any commutative ring: for every square \mathbf{A}, \operatorname{tr}(\mathbf{P}\mathbf{A}) + \operatorname{tr}\bigl((\mathbf{I} - \mathbf{P})\mathbf{A}(\mathbf{I} - \mathbf{P})\bigr) = \operatorname{tr}\mathbf{A}\,, by cyclicity of the trace and (\mathbf{I} - \mathbf{P})^2 = \mathbf{I} - \mathbf{P}. With \mathbf{P} = \mathbf{P}_{\mathbf{A}\mathbf{S}} it splits \operatorname{tr}\mathbf{A} into the part Hutch++ computes exactly and the compressed residual its probes estimate (NLAlib.trace_sub_hutchpp). [MeyerMuscoMuscoWoodruff2021, §3, proof of Theorem 1]; there for \mathbf{P} = \mathbf{Q}\mathbf{Q}^{\mathsf{T}} with orthonormal \mathbf{Q}.

IsIdempotentElem.trace_mul_add_trace_one_sub_mul_mul_one_sub.{u_2, u_5} {m : Type u_2}
  {R : Type u_5} [CommRing R] [Fintype m] [DecidableEq m] {P : Matrix m m R}
  (hP : IsIdempotentElem P) (A : Matrix m m R) :
  (P * A).trace + ((1 - P) * A * (1 - P)).trace = A.trace

Full source on GitHub

Import NLAlib.Matrix.Basic.ComplementaryProjector.