proposition: Lemma matrix_mult_rdistr {m n p} (mat1 : Matrix R m n) (mat2 : Matrix R m n) (mat3 : Matrix R n p) : (mat1 ++' mat2) ** mat3 = (mat1 ** mat3) ++' (mat2 ** mat3).
proof: Proof. intros. rewrite matrix_mult_eq. unfold matrix_mult_unf, matrix_add. unfold entrywise, pointwise. apply funextfun. intros i. apply funextfun. intros j. etrans. { apply maponpaths, funextfun; intros k. rewrite rigrdistr. exact (idpath _). } apply vecsum_add. Defined.
imports: UniMath.Foundations.All UniMath.MoreFoundations.All UniMath.Combinatorics.StandardFiniteSets UniMath.Combinatorics.Vectors UniMath.Algebra.RigsAndRings UniMath.Algebra.IteratedBinaryOperations UniMath.Algebra.Matrix UniMath.Algebra.Domains_and_Fields UniMath.Algebra.GaussianElimination.Auxiliary UniMath.Algebra.GaussianElimination.Vectors