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 perm_eq_abelian_type p b G :
p.-group G -> \big[dprod/1]_(x <- b) <[x]> = G -> 1 \notin b ->
perm_eq (map order b) (abelian_type G).