# Creation of a Group

A user can create a `GrpPC` representation of a finite soluble group in a variety of ways. There are several built-in construction functions for creating standard examples such as cyclic or dihedral groups. For greater flexibility, it is possible to define a group directly from a power-commutator presentation. One can also build new groups out of old groups using standard constructions such as direct product. Finally, there are several conversion functions which will automatically compute a pc-presentation for an existing soluble group in some other category (such as permutation group or matrix group). We will start with the first two styles of construction and describe the remaining two in later sections.

In each case, regardless of how the group was originally defined, Magma will store the group internally as a pc-presentation and will display the pc-presentation whenever the group is printed. Normally when printing a pc-presentation, trivial conjugate relations are omitted. In the case of a $p$-group, then trivial power relations (those indicating that a generator has order $p$) are also omitted. The one exception to this policy is in the case of elementary abelian $p$-groups (which would have no relations displayed under the above policies). In the elementary abelian case, Magma will display the power relations, even though they are trivial.

## Construction Functions

The simplest method of producing a pc-presentation for a group is to use one of the built-in construction functions. By specifying the category `GrpPC` as the first parameter of each function, we produce the desired representation.

It is also possible to obtain a pc-presentation for many small soluble groups by using the function [`SmallGroup`](../DatabasesOfGroups/smlgps-database.md#function-grpdata-smallgroup) described in Chapter [Databases of Groups](../DatabasesOfGroups/index-databases-of-groups.md#chapgrpdata).

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

The cyclic group of order $n$ as a pc-group.

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

Construct the abelian group defined by the sequence $Q = [n_1,\ldots,n_r]$ of positive integers as a pc-group. The function returns the abelian group which is the direct product of the cyclic groups $C_{n_1} \times C_{n_2} \times \cdots \times C_{n_r}$.

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

The dihedral group of order $2*n$ as a pc-group.

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

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

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

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 (ex-a851f0)`

A pc-representation for the cyclic group $C_{12}$ can be computed as follows.

```magma
> G := CyclicGroup(GrpPC, 12);

```

We can then check various properties of $G$.

```magma
> Order(G);
12
> IsAbelian(G);
true
> IsSimple(G);
false

```

If we simply print $G$, we will see the presentation which Magma has generated for this group.

```magma
> G;
GrpPC : G of order 12 = 2^2 * 3
PC-Relations:
    G.1^2 = G.2,
    G.2^2 = G.3,
    G.3^3 = Id(G)

```

Or, we could build a slightly different group.

```magma
> H := AbelianGroup(GrpPC, [2,2,3]);
> Order(H);
12
> IsCyclic(H);
false

```

## Definition by Presentation

While the standard construction functions are convenient, most groups cannot be defined in that way. Complete flexibility in defining a soluble group can be obtained by directly specifying the group’s pc-presentation.

One uses a power-conjugate presentation to define a soluble group by means of the `PolycyclicGroup` constructor, or the `quo` constructor for finitely presented groups.

### `PolycyclicGroup< x₁, ..., xₙ | R : parameters >: List(Identifiers), List(GrpFPRel) -> GrpPC, Map`

```magma
Check        : BoolElt                      Default: true
ExponentLimit: RngIntElt                    Default: 20
Class        : MonStgElt                    Default: 
```

Construct the soluble group $G$ defined by the power-conjugate presentation $<~x_1,~\ldots,~x_n~|~R~>$.

The construct $x_1, \ldots, x_n$ defines names for the generators of $G$ that are local to the constructor, i.e. they are used when writing down the relations to the right of the bar. However, no assignment of *values* to these variables is made. If the user wants to refer to the generators by these (or other) names, then the *generators assignment* construct must be used on the left hand side of an assignment statement.

The construct $R$ denotes a list of pc-relations. Thus, an element of $R$ must be one of:

**(a)**
A *power relation* $a_j^{p_j} = w_{jj}$, $1 \leq j \leq n$, where $w_{jj}$ is $1$ or a word in generators $a_{j+1}, \ldots,a_n$ for $j < n$, and $w_{jj} = 1$ for $j = n$, and $p_j$ a prime.

**(b)**
A *conjugate relation* $a_j^{a_i} = w_{ij}$, $1 \leq i < j \leq n$, where $w_{ij}$ is a word in the generators $a_{i+1}, \ldots, a_n$.

**(c)**
A *power* $a_j^{p_j}$, $1 \leq j \leq n$ and $p_j$ a prime, which is treated as the *power relation* $a_j^{p_j} = Id(F)$.

**(d)**
A set of (a) – (c).

**(e)**
A sequence of (a) – (c).

Note the following points:

**(i)**
A power relation must be present for each generator $a_i$, $i = 1, \ldots, n$;

**(ii)**
Conjugate relations involving commuting generators (i.e. of the form $y^x=y$) may be omitted;

**(iii)**
The words $w_{ij}$ must be in normal form.

In addition, one can alternatively specify a power-commutator presentation using commutator relations rather than conjugate relations.

**(b’)**
A *commutator relation* $(a_j, a_i) = w_{ij}$, $1 \leq i < j \leq n$, where $w_{ij}$ is a word in the generators $a_{i+1}, \ldots, a_n$.

However, commutators and conjugates cannot be mixed in a single presentation.

A map $f$ from the free group of rank $n$ to $G$ is returned as well.

The parameters `Check` and `ExponentLimit` may be used. `Check` indicates whether or not the presentation is checked for consistency. Setting `Check` to `false` will reduce the overheads incurred in constructing the group, but should only be done when the user is sure the given presentation is consistent.

`ExponentLimit` determines the amount of space that will be used by the group to speed calculations. Given `ExponentLimit := e`, the group will precompute and store normal words for appropriate products $a^i * b^j$ where $a$ and $b$ are generators and $i$ and $j$ are in the range 1 to $e$.

If the construction of an object in the category `GrpPC` fails because $R$ is not a valid power-conjugate presentation, an attempt is made to construct a group in the category `GrpGPC` (cf. Chapter [Polycyclic Groups](../../FinitelyPresentedGroups/PolycyclicGroups/index-polycyclic-groups.md#chapgrpgpc)). This feature can be turned off by setting the parameter `Class` to `"GrpPC"`; an invalid power-conjugate presentation then causes a runtime error. Since, by default, the constructor always returns a group in the category `GrpPC` if possible, this is the only effect of setting the parameter `Class` to `"GrpPC"`.

### `quo< GrpPC : F | R : parameters >: GrpFP, List(GrpFPRel) -> GrpPC, Map`

```magma
Check        : BoolElt                      Default: true
ExponentLimit: RngIntElt                    Default: 20
```

Given a free group $F$ of rank $n$ with generating set $X$, and a collection $R$ of pc-relations on $X$, construct the soluble group $G$ defined by the power-conjugate presentation $< X | R >$.

The construct $R$ denotes a list of pc-relations. The syntax and semantics for the relations clause is identical to that appearing in the `PolycyclicGroup`-construct.

This constructor returns a pc-group because the category `GrpPC` is stated. If no category were stated, it would return an fp-group. The parameters `Check` and `ExponentLimit` may be used as described in the `PolycyclicGroup`-construct. The natural homomorphism, $F \rightarrow G$, is also returned.

### `Example: Polycyclic Group (ex-a8ae01)`

Consider the group of order 80 defined by the presentation

$$
\begin{aligned}< a, b, c, d, e\  |\ &a^2 = c, b^2, c^2 = e, d^5, e^2, b^a = b*e, c^a = c, c^b = c, \\
              &d^a = d^2, d^b = d, d^c = d^4, e^a = e, e^b = e, e^c = e, e^d = e >.\end{aligned}
$$

Giving the relations in the form of a list, this presentation would be specified as follows:

```magma
> G<a,b,c,d,e> := PolycyclicGroup<a, b, c, d, e |
> \indent\indent\indent a^2 = c, b^2, c^2 = e, d^5, e^2,
> \indent\indent\indent b^a = b*e, d^a = d^2, d^c = d^4 >;

```

Starting from a free group and giving the relations in the form of a set of relations, this presentation would be specified as follows:

```magma
> F<a,b,c,d,e> := FreeGroup(5);
> rels := { a^2 = c, b^2 = Id(F), c^2 = e, d^5 = Id(F), e^2 = Id(F),
> \indent b^a = b*e, d^a = d^2, d^c = d^4 };
> G<a,b,c,d,e> := quo< GrpPC : F | rels >;

```

Notice that here we have redefined the variables $a,\ldots ,e$ to be the pc-generators in $G$. Thus, when $G$ is printed, Magma displays the following presentation:

```magma
> G;
GrpPC : G of order 80 = 2^4 * 5
PC-Relations:
    a^2 = c,
    b^2 = Id(G),
    c^2 = e,
    d^5 = Id(G),
    e^2 = Id(G),
    b^a = b * e,
    d^a = d^2,
    d^c = d^4
> Order(G);
80
> IsAbelian(G);
false

```

## Possibly Inconsistent Presentations

The `PolycyclicGroup` and `quo` constructors accept a parameter `Check` which enables the user to suppress the automatic consistency checking for input presentations. This is primarily intended to be used when it is certain that the input presentation is consistent, in order to save time. For instance, the presentation may have been generated from some other reliable program, or even from an earlier Magma session. This parameter should be used with care, since all of the Magma functions assume that every `GrpPC` group is consistent. The user will encounter numerous bizarre results if an attempt is made to compute with an inconsistent presentation.

On occasion, a user may wish to “try out” a series of pc-presentations, some of which may not be consistent. The `Check` parameter can be used, along with the function `IsConsistent`, to test a presentation for consistency.

### `IsConsistent(G): GrpPC -> BoolElt`

Returns `true` if $G$ has a consistent presentation, `false` otherwise.

### `Example: Is Consistent (ex-a62513)`

The following example demonstrates generating a family of presentations, and then checking consistency. Of course, it is easy to predict the outcome in this simple example.

```magma
> F := FreeGroup(2);
> for p in [n: n in [3..10] | IsPrime(n)] do
>   r := [F.1^3=Id(F), F.2^p=Id(F), F.2^F.1=F.2^2];
>   G := quo<GrpPC: F | r: Check:=false>;
>   if IsConsistent(G) then
>     print "For p=",p," the group is consistent.";
>   else
>     print "For p=",p," the group is inconsistent.";
>   end if;
> end for;
For p= 3  the group is inconsistent.
For p= 5  the group is inconsistent.
For p= 7  the group is consistent.

```
