Section JordanHolder.
Variables (gT : finGroupType) (G : {group gT}).
Variables (n : nat) (rG : mx_representation F G n).
Local Notation modG := ((mxmodule rG) n).
Definition section_repr U V (modU : modG U) (modV : modG V) :=
submod_repr (section_module modU modV).
Definition max_submod (U V : 'M_n) :=
(U < V)%MS /\ (forall W, ~ [/\ modG W, U < W & W < V])%MS.
Definition mx_subseries := all modG.
Definition mx_composition_series V :=
mx_subseries V /\ (forall i, i < size V -> max_submod (0 :: V)`_i V`_i).
Local Notation mx_series := mx_composition_series.
Fact mx_subseries_module V i : mx_subseries V -> mxmodule rG V`_i.
Fact mx_subseries_module' V i : mx_subseries V -> mxmodule rG (0 :: V)`_i.
Let rsim_rcons U V compU compUV i : i < size U ->
mx_rsim (@series_repr U i compU) (@series_repr (rcons U V) i compUV).
Let last_mod U (compU : mx_series U) : modG (last 0 U).
Let rsim_last U V modUm modV compUV :
mx_rsim (@section_repr (last 0 U) V modUm modV)
(@series_repr (rcons U V) (size U) compUV).
Local Notation rsimT := mx_rsim_trans.
Local Notation rsimC := mx_rsim_sym.

Lemma mx_JordanHolder_max U (m := size U) V compU modV :
(last 0 U :=: 1%:M)%MS -> mx_irreducible (@factmod_repr _ G n rG V modV) ->
exists i : 'I_m, mx_rsim (factmod_repr modV) (@series_repr U i compU).