(* For us, "semisimple" means "sum of simple modules"; this is classically,   *)
(* but not intuitionistically, equivalent to the "completely reducible"       *)
(* alternate characterization.                                                *)
Implicit Type I : finType.
Variant mxsemisimple (V : 'M_n) :=
MxSemisimple I U (W := (\sum_(i : I) U i)%MS) of
forall i, mxsimple (U i) & (W :=: V)%MS & mxdirect W.

(* Specifications: *)
(* This is a slight generalization of Aschbacher 12.5 for finite sets. *)
Lemma sum_mxsimple_direct_compl m I W (U : 'M_(m, n)) :
let V := (\sum_(i : I) W i)%MS in
(forall i : I, mxsimple (W i)) -> mxmodule U -> (U <= V)%MS ->
{J : {set I} | let S := U + \sum_(i in J) W i in S :=: V /\ mxdirect S}%MS.
Lemma sum_mxsimple_direct_sub I W (V : 'M_n) :
(forall i : I, mxsimple (W i)) -> (\sum_i W i :=: V)%MS ->
{J : {set I} | let S := \sum_(i in J) W i in S :=: V /\ mxdirect S}%MS.
Lemma mxsemisimple0 : mxsemisimple 0.
Lemma intro_mxsemisimple (I : Type) r (P : pred I) W V :
(\sum_(i <- r | P i) W i :=: V)%MS ->
(forall i, P i -> W i != 0 -> mxsimple (W i)) ->
mxsemisimple V.
Lemma mxsimple_semisimple U : mxsimple U -> mxsemisimple U.
Lemma addsmx_semisimple U V :
mxsemisimple U -> mxsemisimple V -> mxsemisimple (U + V)%MS.
Lemma sumsmx_semisimple (I : finType) (P : pred I) V :
(forall i, P i -> mxsemisimple (V i)) -> mxsemisimple (\sum_(i | P i) V i)%MS.
Lemma eqmx_semisimple U V : (U :=: V)%MS -> mxsemisimple U -> mxsemisimple V.
Lemma hom_mxsemisimple (V f : 'M_n) :
mxsemisimple V -> (V <= dom_hom_mx f)%MS -> mxsemisimple (V *m f).
Lemma mxsemisimple_module U : mxsemisimple U -> mxmodule U.
Variant mxsplits (V U : 'M_n) :=
MxSplits (W : 'M_n) of mxmodule W & (U + W :=: V)%MS & mxdirect (U + W).