Section SquareBlockMatrixRing.
Context {R : ringType} {p : nat} {p_ : 'I_p -> nat}.
Notation sp := (\sum_i p_ i)%N.
Implicit Type (s : 'I_sp).
End SquareBlockMatrixRing.

Lemma mul_mxblock_mxdiag {R : ringType} {p q : nat}
{p_ : 'I_p -> nat} {q_ : 'I_q -> nat}
(B_ : forall i j, 'M[R]_(p_ i, q_ j)) (D_ : forall j, 'M[R]_(q_ j)) :
\mxblock_(i, j) B_ i j *m \mxdiag_j D_ j = \mxblock_(i, j) (B_ i j *m D_ j).