End ModularGroup.
(* Basic properties of dihedral groups; these will be refined for dihedral    *)
(* 2-groups in the section on extremal 2-groups.                              *)
Section DihedralGroup.
Variable q : nat.
Hypothesis q_gt1 : q > 1.
Let m := q.*2.
Let def2 : pdiv m = 2.
Let def_q : m %/ pdiv m = q. Proof. by rewrite def2 divn2 half_double. Qed.
Section Dihedral_extension.
Variable p : nat.
Hypotheses (p_gt1 : p > 1) (even_p : 2 %| p).
Local Notation ED := [set: gsort (Extremal.gtype q p q.-1)].

(* Specifications: *)
Lemma card_ext_dihedral : #|ED| = (p./2 * m)%N.
End Dihedral_extension.
Lemma card_dihedral : #|'D_m| = m.
End DihedralGroup.
Lemma involutions_gen_dihedral gT (x y : gT) :
let G := <<[set x; y]>> in
#[x] = 2 -> #[y] = 2 -> x != y -> G \isog 'D_#|G|.
Lemma Grp_2dihedral n : n > 1 ->
'D_(2 ^ n) \isog Grp (x : y : (x ^+ (2 ^ n.-1), y ^+ 2, x ^ y = x^-1)).
Lemma card_2dihedral n : n > 1 -> #|'D_(2 ^ n)| = (2 ^ n)%N.
Lemma card_semidihedral n : n > 3 -> #|'SD_(2 ^ n)| = (2 ^ n)%N.
Lemma Grp_semidihedral n : n > 3 ->
'SD_(2 ^ n) \isog
Grp (x : y : (x ^+ (2 ^ n.-1), y ^+ 2, x ^ y = x ^+ (2 ^ n.-2).-1)).