proposition: Lemma add_row_mult_matrix_sum { n : nat } ( r1 r2 : ⟦ n ⟧%stn ) (ne : r1 ≠ r2) ( s1 s2 : R ) : ((add_row_mult_matrix r1 r2 s1 ) **' (add_row_mult_matrix r1 r2 s2)) = (add_row_mult_matrix r1 r2 (s1 + s2)%ring).
proof: Proof. rewrite add_row_mult_as_matrix; try assumption. apply funextfun; intros i; apply funextfun; intros j. unfold add_row_mult, add_row_mult_matrix. destruct (stn_eq_or_neq i r2) as [i_eq_r2 | i_neq_r2]. 2: { apply idpath. } destruct i_eq_r2. rewrite stn_eq_or_neq_refl, (stn_eq_or_neq_right ne); simpl. unfold scalar_lmult_vec, pointwise, vector_fmap. rewrite (@rigrdistr R), rigcomm1, (@rigassoc1 R). reflexivity. 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