Remark. Trace in declared bases [fdip-00KG]

Choose bases \((m_i)_{i\in I}\) of \(M\) and \((n_j)_{j\in J}\) of \(N\), with coefficient isomorphisms \(C_M:M\to k^I\) and \(C_N:N\to k^J\). If \(A=C_MTC_M^{-1}\), its coefficient \(A_{ii}\) is \(\ell _i(Tm_i)\), so the intrinsic trace is \(\sum _i A_{ii}\). For the arrays \(F=C_NfC_M^{-1}\) and \(G=C_MgC_N^{-1}\), Proposition [fdip-00KF] reads \[\operatorname {tr}(GF)=\operatorname {tr}(FG),\qquad \operatorname {tr}(cA)=c\operatorname {tr}(A).\] The two products may have different sizes. Mathlib's Matrix.trace_mul_comm and Matrix.trace_smul express these coordinate identities. A trace pairing is not an assumption; no totalized trace on arbitrary modules or extension to finite projective modules is asserted here.

This is the basis realization of the finite-free calculation associated with [stacks2017stacks, Exercise 22.6], Tag 02DU. The trace ratio additionally requires a unit denominator.