End ExtremalStructure.
Section ExtremalClass.
Variables (gT : finGroupType) (G : {group gT}).
Inductive extremal_group_type :=
ModularGroup | Dihedral | SemiDihedral | Quaternion | NotExtremal.
Definition index_extremal_group_type c :=
match c with
| ModularGroup => 0
| Dihedral => 1
| SemiDihedral => 2
| Quaternion => 3
| NotExtremal => 4
end%N.
Definition enum_extremal_groups :=
[:: ModularGroup; Dihedral; SemiDihedral; Quaternion].

(* Specifications: *)
Lemma cancel_index_extremal_groups :
cancel index_extremal_group_type (nth NotExtremal enum_extremal_groups).
Lemma quaternion_classP :
extremal_class G = Quaternion <-> (exists2 n, n > 2 & G \isog 'Q_(2 ^ n)).
Lemma semidihedral_classP :
extremal_class G = SemiDihedral <-> (exists2 n, n > 3 & G \isog 'SD_(2 ^ n)).
Lemma odd_not_extremal2 : odd #|G| -> ~~ extremal2 G.
Lemma modular_group_classP :
extremal_class G = ModularGroup
<-> (exists2 p, prime p &
exists2 n, n >= (p == 2) + 3 & G \isog 'Mod_(p ^ n)).