Trace of a matrix #
This file defines the trace of a matrix, the map sending a matrix to the sum of its diagonal entries.
See also LinearAlgebra.Trace for the trace of an endomorphism.
Tags #
matrix, trace, diagonal
The trace of a square matrix. For more bundled versions, see:
Instances For
Matrix.trace as an AddMonoidHom
Equations
- Matrix.traceAddMonoidHom n R = { toFun := Matrix.trace, map_zero' := ⋯, map_add' := ⋯ }
Instances For
Matrix.trace as a LinearMap
Equations
- Matrix.traceLinearMap n α R = { toFun := Matrix.trace, map_add' := ⋯, map_smul' := ⋯ }
Instances For
The trace of a positive power of A * B is unchanged when the factors are reversed.
The matrices A and B may be rectangular.
This requires a positive exponent because the identity does not hold at exponent zero when the index types have different cardinalities.
For square matrices, the trace of any power of A * B is unchanged when the factors
are reversed.
Unlike the rectangular version trace_mul_pow_comm_of_ne_zero, this also holds at exponent zero.
The trace is invariant under conjugation by a unit, variant of Matrix.trace_units_conj
with the inverse on the left.