# Finite FP-Groups

In this section a number of intrinsics that apply only to finite fp-group will be described. Of course most of the intrinsics designed for working with general fp-groups will also apply to finite fp-groups.

## Concrete Representations

If a finitely-presented group is known to have moderate order, it may be useful to write it concretely as a permutation or PC-group. There are two utilities provided for this purpose.

### `PermutationGroup(G): GrpFP -> GrpPerm, GrpHom`

Construct a faithful permutation representation of $G$, and the isomorphism from $G$ to the representation. The algorithm first computes the order of $G$, then takes the regular representation of $G$, and then tries to reduce the degree. Thus, the intrinsic is restricted to groups of order a million (depending upon the amount of memory available).

### `PCGroup(G): GrpFP -> GrpPC, GrpHom`

Construct a faithful PC-group representation of $G$, and the isomorphism from $G$ to the representation. The algorithm first computes the order of $G$, then computes the soluble quotient of $G$ with the order found. Thus the command is restricted to small soluble groups.

## The Cayley Graph

Given a finite fp-group $G$ of moderate order we can construct its Cayley graph. This graph can then be studied using the extensive tools provided in Magma for graphs.

### `CayleyGraph(G): GrpFP -> GrphVertSet, GrphEdgeSeto`

```magma
Labelled: BoolElt Default                    Default: true
```

Given a finite group $G$ defined on generating set $X$, construct the Cayley graph $C$ of $G$ relative to the generating set $X$. This graph is defined as follows: The vertices correspond to the elements of $G$ and two vertices $u$, $v$ are adjacent if and only if there exists an generator $x$ in $X$ such that $u * x = v$.

The optional parameter Labelled (Labelled := true by default) can be set to false to prevent the graph being labelled. If this is not done, then the vertices of $C$ will be labelled with the appropriate elements of $G$ and the (directed) edge from $u$ to $v$ will be labelled with the appropriate generator $x$ as defined above.

### `SchreierGraph(G, H): Grp, Grp -> Grph, GrphVertSet, GrphEdgeSet`

```magma
Labelled: BoolElt Default                    Default: true
Directed: BoolElt Default                    Default: true
```

Given a finite fp-group $G$ defined on the generating set $X$ and a subgroup $H$ of $G$, construct the Schreier coset graph $S$ for $G$ over $H$, relative to $X$. The graph $S$ is defined as follows: The vertices correspond to the cosets of $H$ in $G$, and two vertices $u$, $v$ are adjacent in $S$ if and only if there exists an element $x$ in $X$ such that $u * x = v$.

The graph returned may be a labelled or unlabelled version and directed or undirected. These versions are controlled by the parameters `Labelled` and `Directed`, which are both true by default.

### `Example: Cayley Graph (ex-6ec7fa)`

We define the Cayley graph of the dihedral group of order 12 and then construct its directed Cayley graph.

```magma
> G<x, y> := DihedralFPGroup(6);
> C, V, E := CayleyGraph(G);  C;
Digraph
Vertex  Neighbours

1       2 3 ;
2       5 6 ;
3       1 7 ;
4       1 7 ;
5       9 10 ;
6       2 3 ;
7       4 11 ;
8       4 11 ;
9       8 12 ;
10      5 6 ;
11      8 12 ;
12      9 10 ;

```

We next find the diameter $d$ of the graph and then construct the word corresponding to a path of length $d$.

```magma
> d := Diameter(C);  d;
4
> p := DiameterPath(C);  p;
[ 1, 2, 5, 9, 8 ]
> word := &* [ Label(E![p[i], p[i+1]]) : i in [1..d]];
> word;
x^4

```

We next construct the automorphism group of the unlabelled, undirected graph underlying $C$.

```magma
> D := UnderlyingGraph(C);  D;
Graph
Vertex  Neighbours

1       2 3 4 ;
2       1 5 6 ;
3       1 6 7 ;
4       1 7 8 ;
5       2 9 10 ;
6       2 3 10 ;
7       3 4 11 ;
8       4 9 11 ;
9       5 8 12 ;
10      5 6 12 ;
11      7 8 12 ;
12      9 10 11 ;

> A := AutomorphismGroup(D);  A;
Permutation group A acting on a set of cardinality 12
Order = 24 = 2^3 * 3
    (2, 4)(5, 8)(6, 7)(10, 11)
    (1, 2)(3, 6)(4, 5)(7, 10)(8, 9)(11, 12)
    (1, 3)(2, 6)(4, 7)(5, 10)(8, 11)(9, 12)

```

Finally we check that $S$ has the dihedral group of order 12 as a subgroup.

```magma
> subs := Subgroups(A);
> P := PermutationGroup(G);
> exists(j){ i : i in [1..#subs] | IsIsomorphic(P, subs[i]`subgroup)};
true
> j;
25

```

So subgroup 25 is isomorphic to G. In fact there are four conjugacy classes of subgroups in $A$ that are isomorphic to $G$.
