# New Groups from Existing

## `DirectProduct(G, H): GrpPC, GrpPC -> GrpPC, [Map], [Map]`

The direct product $K$ of the pc-groups $G$ and $H$. The second argument returned is a sequence containing the inclusion maps $I_G\colon G \rightarrow K$ and $I_H\colon H \rightarrow K$. The third argument returned is a sequence containing the projection maps $P_G\colon K \rightarrow G$ and $P_H\colon K \rightarrow H$. Furthermore, the (user-) presentation of $K$ is arranged so that the first pc-generators correspond to those of $G$ and the remaining generators correspond to those of $H$.

## `DirectProduct(Q): [GrpPC] -> GrpPC, [ Map ], [ Map ]`

The direct product of pc-groups in the non-empty sequence $Q$, and the inclusion and projection maps.

## `Extension(G, H, f): GrpPC, GrpPC, [Map] -> GrpPC`

The split extension $K$ of the pc-group $G$ by the pc-group $H$, where the action of $H$ on $G$ is given by the homomorphism $\phi: H \rightarrow {\operatorname{Aut}}(G)$ specified by $f$. The extension $K$ will have a normal subgroup $G\mathord{\sim}$ isomorphic to $G$, while the quotient group $K/G\mathord{\sim}$ is isomorphic to $H$.

The homomorphism $\phi$ is given by the sequence of maps $f$. Suppose that the pc-generators for $H$ are $h_1, \ldots, h_s$. The $i$-th entry of $f$ defines the action of $h_i$ on $G$. That is, $f[i](x) = h_i^{-1}\cdot x\cdot h_i$, for $x \in G$.

## `Extension(M, H): ModGrp, GrpPC -> GrpPC`

The split extension $K$ of the $G$-module $M$ by the pc-group $H$. We use the action of $H$ on $M$ to define the action of $H$ on an elementary abelian $p$-group of order $p^d$ where $M$ is a $d$-dimensional module over $GF(p)$, $p$ prime.

## `Extension(G, H, f, t): GrpPC, GrpPC, [Map], [GrpPCElt] -> GrpPC`

## `Extension(G, H, f, t): GrpPC, GrpPC, [Map], {Tup} -> GrpPC`

The non-split extension $K$ of the pc-group $G$ by the pc-group $H$, where the action of $H$ on $G$ is given by the homomorphism $\phi: H \rightarrow {\operatorname{Aut}}(G)$ and the tails for $H$ are given as the set of tuples $t$. The extension $K$ will have a normal subgroup $G\mathord{\sim}$ isomorphic to $G$, while the quotient group $K/G\mathord{\sim}$ is isomorphic to $H$.

The homomorphism $\phi$ is given by the sequence of maps $f$. Suppose that the pc-generators for $H$ are $h_1, \ldots, h_s$. The $i$-th entry of $f$ defines the action of $h_i$ on $G$. That is, $f[i](x) = h_i^{-1}\cdot x\cdot h_i$, for $x \in G$.

The specification of $t$ involves giving the relations $h_j^{-1}h_ih_j$ $= w_{ij}$, where $w_{ij}$ is a word in $K$ for $1 \le j < i \le s$. For $i = j$, we need the relation ${h_i}^{p_i} = w_{ii}$, where $w_{ii}$ is a word in $K$ for $1 \le i \le s$. Each $w_{ij}$ is the RHS of the relation from $H$ with the tail $x_{ij}$. The tails are given by the sequence $t$ in the order $t = [x_{11}, x_{21}, x_{22}, x_{31}, \ldots , x_{ss} ]$. Alternatively, $t$ can be given as a set of tuples $< i, j, x_{ij} >$ for non-trivial $x_{ij}$.

Note that if $x_{ij} =$`Id(G)`, for $1\leq i\leq s$ and $1\leq  j\leq i$, then $K$ will just be the split extension of $G$ and $H$.

## `Extension(M, H, t): ModGrp, GrpPC, [ModGrpElt] -> GrpPC`

The non-split extension $K$ of the $G$-module $M$ by the pc-group $H$. We use the action of $H$ on $M$ to define the action of $H$ on an elementary abelian $p$-group of order $p^d$ where $M$ is a $d$-dimensional module over $GF(p)$, $p$ prime.

The specification of $t$ is similar to that for $t$ in the preceding description.

## `IsExtension(G, H, f): GrpPC, GrpPC, [Map] -> BoolElt, GrpPC`

## `IsExtension(M, H): ModGrp, GrpPC -> BoolElt, GrpPC`

## `IsExtension(G, H, f, t): GrpPC, GrpPC, [Map], [GrpPCElt] -> BoolElt, GrpPC`

## `IsExtension(G, H, f, t): GrpPC, GrpPC, [Map], {Tup} -> BoolElt, GrpPC`

## `IsExtension(M, H, t): ModGrp, GrpPC, [ModGrpElt] -> BoolElt, GrpPC`

For each `Extension` variation, there is a corresponding function `IsExtension` which attempts to construct the specified group and returns a boolean value indicating whether or not the construction succeeded. If the construction succeeds, the extension group is also returned.

The `Extension` functions will generate a runtime error if the specified construction is not legal. The `IsExtension` function allows the user to detect this error condition and continue.

## `WreathProduct(G, H): GrpPC, GrpPC -> GrpPC`

The wreath product of the pc-groups $G$ and $H$, where the regular permutation representation of $H$ is used to define the action.

## `WreathProduct(G, H, f): GrpPC, GrpPC, Map -> GrpPC`

## `WreathProduct(G, H, f): GrpPC, GrpPC, [GrpPermElt] -> GrpPC`

The wreath product of the pc-groups $G$ and $H$ where the action of $H$ is given by $f$, which may be either a homomorphism from $H$ into a permutation group $P$ or a sequence of permutations defining a homomorphism from $H$ into $P$. If $f$ is a sequence, the homomorphism $\phi: H \rightarrow P$ is defined by $H.i \rightarrow f[i]$ for $i = 1, \ldots, s$.

## `Example: extension (ex-73458c)`

To demonstrate some of the versions of `Extension` we first build a split extension of a cyclic group of order 4 acting on an elementary abelian group of order 9.

```magma
> C4 := CyclicGroup(GrpPC,4);
> E9 := AbelianGroup(GrpPC,[3,3]);
> f1 := hom<E9->E9|[E9.1*E9.2^2, E9.1^2*E9.2^2]>;
> f2 := hom<E9->E9|[E9.1^2,E9.2^2]>;
> G := Extension(E9,C4,[f1,f2]);
> G;
GrpPC : G of order 36 = 2^2 * 3^2
PC-Relations:
    G.1^2 = G.2,
    G.2^2 = Id(G),
    G.3^3 = Id(G),
    G.4^3 = Id(G),
    G.3^G.1 = G.3 * G.4^2,
    G.3^G.2 = G.3^2,
    G.4^G.1 = G.3^2 * G.4^2,
    G.4^G.2 = G.4^2

```

Then, we define a module for this group and use it to build a nonsplit extension.

```magma
> MR := MatrixRing(GF(3),2);
> m1 := MR![1,1,1,2];
> m2 := MR![2,0,0,2];
> V := GModule(G,[m1,m2,Id(MR),Id(MR)]);
> IsIrreducible(V);
true
> v0 := V!0;
> tails := [v0,v0,v0,v0,V![1,0],V![2,0],V![1,2],V![0,2],v0,V![0,1]];
> H := Extension(V,G,tails);
> H;
GrpPC : H of order 324 = 2^2 * 3^4
PC-Relations:
    H.1^2 = H.2,
    H.2^2 = Id(H),
    H.3^3 = H.5^2,
    H.4^3 = H.6,
    H.5^3 = Id(H),
    H.6^3 = Id(H),
    H.3^H.1 = H.3 * H.4^2,
    H.3^H.2 = H.3^2 * H.5,
    H.4^H.1 = H.3^2 * H.4^2 * H.5 * H.6^2,
    H.4^H.2 = H.4^2 * H.6^2,
    H.5^H.1 = H.5 * H.6,
    H.5^H.2 = H.5^2,
    H.6^H.1 = H.5 * H.6^2,
    H.6^H.2 = H.6^2

```

Notice that the relations of $H$ involving the first four generators are those of $G$ with the specified tails appended. We are then ready to compute various properties of $H$.

```magma
> [N`order:N in NormalSubgroups(H)];
[ 1, 9, 81, 162, 324 ]

```

## `Example: Cossey Hawkes (ex-9a45eb)`

In this example we verify an example of Cossey and Hawkes in [[Cossey and Hawkes, 2000](../../references.md#cite-ch-classes)]. The paper shows that the largest size of a conjugacy class in an abelian by nilpotent finite group is at least as large as the product of the largest class sizes for the Sylow subgroups. The example is a group having derived length 3 in which this fails.

We start with a dihedral group of order 10 acting on a cyclic group of order 8.

```magma
> E := DihedralGroup(GrpPC,5);
> A := CyclicGroup(GrpPC,8);

```

Define an action of E on A and create the split extension.

```magma
> f1 := hom<A->A|A.1->(A.1)^-1>;
> f2 := hom<A->A|A.1->A.1>;
> H := Extension(A, E, [f1, f2]);

```

Then construct a certain H-module…

```magma
> QH := SylowSubgroup(H,2);
> t := TrivialModule(QH, FiniteField(5));
> B := Induction(t, H);

```

…and form the split extension of H acting on that module.

```magma
> G := Extension(B, H);
> print G;
GrpPC : G of order 250000 = 2^4 * 5^6
PC-Relations:
    G.1^2 = Id(G),
    G.2^5 = Id(G),
    G.3^2 = G.4,
    G.4^2 = G.5,
    G.5^2 = Id(G),
    G.6^5 = Id(G),
    G.7^5 = Id(G),
    G.8^5 = Id(G),
    G.9^5 = Id(G),
    G.10^5 = Id(G),
    G.2^G.1 = G.2^4,
    G.3^G.1 = G.3 * G.4 * G.5,
    G.4^G.1 = G.4 * G.5,
    G.6^G.2 = G.10,
    G.7^G.1 = G.10,
    G.7^G.2 = G.6,
    G.8^G.1 = G.9,
    G.8^G.2 = G.7,
    G.9^G.1 = G.8,
    G.9^G.2 = G.8,
    G.10^G.1 = G.7,
    G.10^G.2 = G.9
> print DerivedLength(G);
3

```

Now check the relevant class sizes.

```magma
> P := SylowSubgroup(G,5);
> Q := SylowSubgroup(G,2);
> print  Maximum({x[2]:x in Classes(G)});
1250
> print  Maximum({x[2]:x in Classes(P)});
625
> print  Maximum({x[2]:x in Classes(Q)});
4

```

Note that 1250 is less than the product 625*4.
