Lemma invertible_to_transpose_invertible { n } (mat : Matrix CR n n) : (@matrix_inverse CR n mat) -> (@matrix_inverse CR n (transpose mat)). Proof. intros [mat_inv [e_mi e_im]]. exists (transpose mat_inv). split; refine (!matrix_product_transpose _ _ @ maponpaths _ _ @ identity_matrix_symmetric); assumption. Defined.
Require Import UniMath.Foundations.All. Require Import UniMath.MoreFoundations.All. Require Import UniMath.Combinatorics.StandardFiniteSets. Require Import UniMath.Combinatorics.Vectors. Require Import UniMath.Algebra.RigsAndRings. Require Import UniMath.Algebra.IteratedBinaryOperations. Require Import UniMath.Algebra.Matrix. Require Import UniMath.Algebra.Domains_and_Fields. Require Import UniMath.Algebra.GaussianElimination.Auxiliary. Require Import UniMath.Algebra.GaussianElimination.Vectors.