proposition: Lemma matrix_mult_assoc {m n p q} (mat1 : Matrix R m n) (mat2 : Matrix R n p) (mat3 : Matrix R p q) : (mat1 ** mat2) ** mat3 = mat1 ** (mat2 ** mat3).
proof: Proof. intros; unfold matrix_mult. apply funextfun; intro i; apply funextfun; intro j. etrans. 2: { symmetry. apply maponpaths, funextfun. intros k. apply vecsum_ldistr. } etrans. { apply maponpaths. apply funextfun. intros k. apply vecsum_rdistr. } rewrite vecsum_interchange. apply maponpaths, funextfun; intros k. apply maponpaths, funextfun; intros l. apply rigassoc2. 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