Lemma add_row_mult_matrix_invertible { n } (r1 r2 : ⟦ n ⟧%stn) (ne : r1 ≠ r2) (s : R) : @matrix_inverse R n (add_row_mult_matrix r1 r2 s). Proof. exists (add_row_mult_matrix r1 r2 (- s)%ring). split; refine (add_row_mult_matrix_sum _ _ ne _ _ @ _); refine (_ @ add_row_mult_matrix_zero _ _ ne); apply maponpaths. - apply (@ringrinvax1 R). - apply (@ringlinvax1 R). 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.Matrix. Require Import UniMath.Algebra.RigsAndRings. Require Import UniMath.Algebra.IteratedBinaryOperations. Require Import UniMath.Algebra.Domains_and_Fields. Require Import UniMath.Algebra.GaussianElimination.Auxiliary. Require Import UniMath.Algebra.GaussianElimination.Vectors. Require Import UniMath.Algebra.GaussianElimination.Matrices.