Lemma matrix_right_left_inverse_to_inverse {n : nat} (A : Matrix R n n) : matrix_left_inverse A -> matrix_right_inverse A -> (matrix_inverse A). Proof. intros lft rght. use tpair; simpl. {apply lft. } split. 2: {apply lft. } rewrite (@matrix_left_inverse_equals_right_inverse n _ n _ lft rght). apply rght. 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.