proposition: Lemma mxdiag_sum (I : finType) (B_ : forall k i, 'M[V]_(p_ i)) (P : {pred I}) : \mxdiag_i (\sum_(k | P k) B_ k i) = \sum_(k | P k) \mxdiag_i (B_ k i).
proof: Proof. rewrite /mxdiag -mxblock_sum; apply/eq_mxblock => i j. case: eqVneq => [->|]; rewrite ?conform_mx_id//; last by rewrite big1. by apply: eq_bigr => k; rewrite conform_mx_id. Qed.
imports: HB(structures) mathcomp(ssreflect ssrbool ssrfun eqtype ssrnat seq choice) mathcomp(fintype finfun bigop finset fingroup perm order) mathcomp(div prime binomial ssralg countalg finalg zmodp)