# Standard Groups and Extensions

## Construction of a Standard Group

A number of functions are provided which construct various standard groups. The effect of these functions is to construct the group on some standard set of generators. The group category of the result may be specified as an argument to the function.

### `AbelianGroup(C, Q): Cat, [ RngIntElt ] -> GrpFin`

### `AbelianGroup(Q): [ RngIntElt ] -> GrpAb`

Construct the abelian group defined by the sequence $Q = [n_1,\ldots,n_r]$ of positive integers. The function constructs the direct product of cyclic groups ${\mathbb{Z}}_{n_1} \times {\mathbb{Z}}_{n_2} \times \cdots \times {\mathbb{Z}}_{n_r}$. In some categories, $n_i$ may also be 0, denoting the infinite cyclic group ${\mathbb{Z}}$. If the single-argument version of the function is used, the group will be constructed in the category `GrpAb`; otherwise, its category will be $C$, where $C$ may be `GrpAb`, `GrpFP`, `GrpGPC`, `GrpPC` or `GrpPerm`.

### `AlternatingGroup(C, n): Cat, RngIntElt -> GrpFin`

### `AlternatingGroup(n): RngIntElt -> GrpPerm`

### `Alt(C, n): Cat, RngIntElt -> GrpFin`

### `Alt(n): RngIntElt -> GrpPerm`

Construct the alternating group on $n$ letters. If the single-argument version of the function is used, the group will be constructed in the category `GrpPerm`; otherwise, its category will be $C$, where $C$ may be `GrpFP` or `GrpPerm`.

### `CyclicGroup(C, n): Cat, RngIntElt -> GrpFin`

### `CyclicGroup(n): RngIntElt -> GrpPerm`

Construct the cyclic group of order $n$. If the single-argument version of the function is used, the group will be constructed in the category `GrpPerm`; otherwise, its category will be $C$, where $C$ may be `GrpAb`, `GrpFP`, `GrpGPC`, `GrpPC` or `GrpPerm`.

### `DihedralGroup(C, n): Cat, RngIntElt -> GrpFin`

### `DihedralGroup(n): RngIntElt -> GrpPerm`

Construct the dihedral group of order $2*n$. If the single-argument version of the function is used, the group will be constructed in the category `GrpPerm`; otherwise, its category will be $C$, where $C$ may be `GrpFP`, `GrpGPC`, `GrpPC` or `GrpPerm`.

### `DicyclicGroup(n): RngIntElt -> GrpFP`

### `DicyclicGroup(A, a): GrpAb, GrpAbElt -> GrpFP`

The first intrinsic constructs the dicyclic group of order $4n$. The second, when given an abelian group $A$ and an element $a$ of order 2, constructs the associated dicyclic group generated by $A$ and an $x$ with $x^2=a$ and $a^x=a^{-1}$ for all $x\in A$.

### `SymmetricGroup(C, n): Cat, RngIntElt -> GrpFin`

### `SymmetricGroup(n): RngIntElt -> GrpPerm`

### `Sym(GrpFin, n): Cat, RngIntElt -> GrpFin`

### `Sym(n): RngIntElt -> GrpPerm`

Construct the symmetric group on $n$ letters. If the single-argument version of the function is used, the group will be constructed in the category `GrpPerm`; otherwise, its category will be $C$, where $C$ may be `GrpFP` or `GrpPerm`.

### `ExtraSpecialGroup(C, p, n : parameters): Cat, RngIntElt, RngIntElt -> GrpFin`

### `ExtraSpecialGroup(p, n : parameters): RngIntElt, RngIntElt -> GrpPerm`

```magma
Type: MonStgElt                    Default: "+"
```

Given a prime $p$ and a small positive integer $n$, construct an extra-special group $G$ of order $p^{2n+1}$. The isomorphism type of $G$ can be selected using the parameter `Type` described below.

If the two-argument version of the function is used, the group will be constructed in the category `GrpPerm`; otherwise, its category will be $C$, where $C$ may be `GrpFP`, `GrpGPC`, `GrpPC` or `GrpPerm`. If $C$ is `GrpFP`, `GrpPC` or `GrpPerm`, the prime $p$ must be small.

Possible values for this parameter are “$+$” (default) and “$-$“.

If `Type` is set to “$+$”, the function returns for $p = 2$ the central product of $n$ copies of the dihedral group of order 8, and for $p > 2$ it returns the unique extra-special group of order $p^{2n+1}$ and exponent $p$.

If `Type` is set to “$-$”, the function returns for $p = 2$ the central product of a quaternion group of order 8 and $n-1$ copies of the dihedral group of order 8, and for $p > 2$ it returns the unique extra-special group of order $p^{2n+1}$ and exponent $p^2$.

### `Example: Standard Groups (ex-a51dba)`

The abelian group ${\mathbb{Z}}_6 \times {\mathbb{Z}}_2 \times {\mathbb{Z}}_7$ in the category `GrpAb`:

```magma
> A := AbelianGroup([6, 2, 7]);
> A;
Abelian Group isomorphic to Z/2 + Z/42
Defined on 3 generators
Relations:
    6*A.1 = 0
    2*A.2 = 0
    7*A.3 = 0

```

The alternating group on $6$ letters as a permutation group:

```magma
> A6 := Alt(6);
> A6;
Permutation group A6 acting on a set of cardinality 6
Order = 360 = 2^3 * 3^2 * 5
    (1, 2)(3, 4, 5, 6)
    (1, 2, 3)

```

The dihedral group of order $8$ as a `GrpPC`:

```magma
> D8 := DihedralGroup(GrpPC, 4);
> D8;
GrpPC : D8 of order 8 = 2^3
PC-Relations:
  D8.2^2 = D8.3,
  D8.2^D8.1 = D8.2 * D8.3

```

The symmetric group on $7$ letters as a finitely presented group on generators $a$ and $b$:

```magma
> S7<a, b> := SymmetricGroup(GrpFP, 7);
> S7;
Finitely presented group S7 on 2 generators
Relations
    a^7 = Id(S7)
    b^2 = Id(S7)
    (a * b)^6 = Id(S7)
    (a^-1 * b * a * b)^3 = Id(S7)
    (b * a^-2 * b * a^2)^2 = Id(S7)
    (b * a^-3 * b * a^3)^2 = Id(S7)

```

## Construction of Extensions

### `DirectProduct(G, H): Grp, Grp -> Grp`

Given two groups $G$ and $H$ belonging to the category $C$, construct the direct product of $G$ and $H$ as a group in $C$.

### `DirectProduct(Q): [ Grp ] -> Grp`

Given a sequence $Q$ of $n$ groups belonging to the category $C$, construct the direct product $Q[1] \times Q[2] \times \ldots \times Q[n]$ as a group in the category $C$.

### `SemidirectProduct(K, H, f: parameters): Grp, Grp, Map -> Grp, Map, Map, Map`

```magma
MaxDeg    : RngIntElt                    Default: 1000000
Print     : BoolElt                      Default: false
UseRegular: BoolElt                      Default: false
```

Given two groups $K$ and $H$ and a homomorphism $f:H\to {\operatorname{Aut}}(K)$, construct the semidirect product of $K$ and $H$ where the elements of $H$ act on $K$ via the map $f$. The semidirect product $S$ is returned together with maps embedding $K$ and $H$ into $S$, and the projection $S \to H$.

The maximum degree permutation representation the algorithm will attempt.

Setting `UseRegular` to true forces the algorithm to go via the regular representations of $K$ and $H$.

### `Example: semidirect (ex-ba6db1)`

```magma
> K := CyclicGroup(3);
> H := CyclicGroup(4);
> A := AutomorphismGroup(K);
> f := hom< H->A | [ hom<K->K | [K.1^2]> ] >;
> S := SemidirectProduct(K,H,f);
> S;
Permutation group S acting on a set of cardinality 7
    (1, 2, 3)
    (2, 3)(4, 5, 6, 7)

```

### `AffineSplitExtension(M: parameters): ModGrp -> Grp, Map, Map, Map`

```magma
MaxDeg: RngIntElt                    Default: 1000000
Print : BoolElt                      Default: false
```

Given a module $M$ over a finite group ring $KG$, construct the semidirect product of $M$ and $G$, where the elements of $G$ act on $M$ as in the module. The semidirect product $S$ is returned together with maps embedding $M$ and $G$ into $S$, and the projection $S \to G$.

The module $M$ will act as a regular normal subgroup on the first orbit of $S$. If the action of $G$ on $M$ is faithful, then $S$ will be transitive, and otherwise there will be a second orbit on which $H$ acts faithfully.

The maximum degree permutation representation the algorithm will attempt.

### `Example: Affine Split (ex-e704a5)`

```magma
> G := SL(2,3);
> I := IrreducibleModules(G,GF(2));
> I[2];
GModule of dimension 2 over GF(2)
> E := AffineSplitExtension(I[2]);
> E;
Permutation group E acting on a set of cardinality 12
Order = 96 = 2^5 * 3
    (1, 2)(3, 4)
    (1, 3)(2, 4)
    (2, 3, 4)(6, 9, 11)(8, 10, 12)
    (5, 6, 7, 8)(9, 12, 10, 11)

```

### `Example: Extensions (ex-a6b832)`

We define $G$ to be the symmetric group of degree $4$ and $H$ to be the dihedral group of order $8$. We then form the direct product of $G$ and $H$.

```magma
> G := SymmetricGroup(4);
> H := DihedralGroup(3);
> D := DirectProduct(G, H);
> D;
Permutation group D acting on a set of cardinality 7
    (1, 2, 3, 4)
    (1, 2)
    (5, 6, 7)
    (5, 6)
> Order(D);
144

```
