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

Lemma diag_mxrow (B_ : forall j, 'rV[R]_(p_ j)) :
diag_mx (\mxrow_j B_ j) = \mxdiag_j (diag_mx (B_ j)).