Section MatrixAlgebra.
Variables F : fieldType.
Local Notation "A \in R" := (@submx F _ _ _ (mxvec A) R).
Arguments memmx_subP {m1 m2 n R1 R2}.
Arguments memmx_eqP {m1 m2 n R1 R2}.
Arguments memmx_addsP {m1 m2 n A R1 R2}.
Arguments memmx_sumsP {I P n A R_}.
Definition mulsmx m1 m2 n (R1 : 'A[F]_(m1, n)) (R2 : 'A_(m2, n)) :=
(\sum_i <<R1 *m lin_mx (mulmxr (vec_mx (row i R2)))>>)%MS.
Arguments mulsmx {m1%N m2%N n%N} R1%MS R2%MS.
Local Notation "R1 * R2" := (mulsmx R1 R2) : matrix_set_scope.
Arguments mulsmx_subP {m1 m2 m n R1 R2 R}.

Lemma mulsmxP m1 m2 n A (R1 : 'A_(m1, n)) (R2 : 'A_(m2, n)) :
reflect (exists2 A1, forall i, A1 i \in R1
& exists2 A2, forall i, A2 i \in R2
& A = \sum_(i < n ^ 2) A1 i *m A2 i)
(A \in R1 * R2)%MS.