Fixpoint abelian_type_rec n G :=
if n is n'.+1 then if abelian G && (G :!=: 1) then
exponent G :: abelian_type_rec n' (tag (abelian_type_subproof G))
else [::] else [::].
Definition abelian_type (A : {set gT}) := abelian_type_rec #|A| <<A>>.

Lemma abelian_type_dprod_homocyclic p K H G :
K \x H = G -> p.-group G -> homocyclic G ->
abelian_type K = nseq 'r(K) (exponent G)
/\ abelian_type H = nseq 'r(H) (exponent G).