proposition: 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: 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.
imports: UniMath.Foundations.All UniMath.MoreFoundations.All UniMath.Combinatorics.StandardFiniteSets UniMath.Combinatorics.Vectors UniMath.Algebra.Matrix UniMath.Algebra.RigsAndRings UniMath.Algebra.IteratedBinaryOperations UniMath.Algebra.Domains_and_Fields UniMath.Algebra.GaussianElimination.Auxiliary UniMath.Algebra.GaussianElimination.Vectors UniMath.Algebra.GaussianElimination.Matrices