English
The inverse functor invFun is the algebraic inverse to the functor toFunAlgHom, giving a canonical isomorphism between tensor products and matrices.
Русский
Обратный функционал invFun является алгебраическим обратным к toFunAlgHom, задающим каноническое тождество между тензорными произведениями и матрицами.
LaTeX
$$$ right\_inv\left( toFunAlgHom \right) = invFun \quad \text{and} \quad left\_inv\left( toFunAlgHom \right) = id $$$
Lean4
/-- (Implementation detail.)
The bare function `Matrix n n A → A ⊗[R] Matrix n n R`.
(We don't need to show that it's an algebra map, thankfully --- just that it's an inverse.)
-/
def invFun (M : Matrix n n A) : A ⊗[R] Matrix n n R :=
∑ p : n × n, M p.1 p.2 ⊗ₜ single p.1 p.2 1