# Constructing Extensions

## `Extension(CM, s): ModCoho, SeqEnum -> Grp, HomGrp, Map`

## `Extension(CM, s): ModCoho, ModTupRngElt -> Grp, HomGrp, Map`

Given the cohomology module ${\rm CM}$ for the group $G$ acting on the module $M$ and an element $s$ of $H^2(G,M)$, this function returns the corresponding extension $E$ of the module $M$ by $G$ as a finitely presented group. The generators of $E$ are chosen so that the generators of the acting group $G$ (or rather strong generators for $G$ when $G$ is a permutation or matrix group) come first, and the generators of $M$ come last. The argument $s$ should be either an element of $H^2(G,M)$ or a sequence of integers defining such an element.

The projection from $E$ to $G$ and the injection from an abelian group isomorphic to $M$ to $E$ are also returned.

This function may only be applied when the module $M$ used to define ${\rm CM}$ is defined over a finite field of prime order, the integers, or as an abelian group in a call of `CohomologyModule(G, Q, T)`.

## `Extension(GrpPerm, CM, s): Cat, ModCoho, SeqEnum -> GrpPerm, HomGrp, Map`

## `Extension(GrpPerm, CM, s): Cat, ModCoho, ModTupRngElt -> GrpPerm, HomGrp, Map`

```magma
UseSubgp: BoolElt                    Default: false
Subgp   : Grp                        Default: sub< G | >
```

Given the cohomology module ${\rm CM}$ for the group $G$ acting on the module $M$, this function attempts to construct a permutation group $P$ isomorphic to the extension of $M$ by $G$ defined by the argument $s$, which should be either an element of $H^2(G,M)$ or a sequence of integers defining such an element. The natural homomorphism from $P$ to $G$ and the embedding of an abelian group isomorphic to $M$ into $P$ are also returned. This will of course work only if $M$ is finite, and currently it only works if the group $G$ has type `GrpPerm` or `GrpMat`.

If $G$ is moderately small then the action on the cosets of a subgroup of $M$ with index as large as possible is used.

For larger groups $G$, it can help to use the `UseSubgp` option, in which case the `Subgp` optional parameter should be set to be a subgroup $H$ of $G$. By default, this option will be tried if the degree of $P$ would otherwise have been greater than 500000, and $H$ will be chosen to have index about $100$ in $G$.

## `Example: A7cover (ex-f0c0e3)`

In the first example, we construct a faithful permutation representation of the Schur cover $6.A_7$ of $A_7$ in two steps, and then find the smallest degree of a faithful representation of this group.

```magma
> G := Alt(7);
> M := TrivialModule(G, GF(3));
> CM := CohomologyModule(G, M);
> CohomologyGroup(CM, 2);
Full Vector space of degree 1 over GF(3)
> P := Extension(GrpPerm, CM, [1]);
> Degree(P);
45
>   M := TrivialModule(P, GF(2));
>   CM := CohomologyModule(P, M);
>   CohomologyGroup(CM, 2);
Full Vector space of degree 1 over GF(2)
>   P := Extension(GrpPerm, CM, [1]);
>   Degree(P);
720
> ChiefFactors(P);
    G
    |  Alternating(7)
    *
    |  Cyclic(2)
    *
    |  Cyclic(3)
    1
> _, PP := MinimalDegreePermutationRepresentation(P);
> Degree(PP);
285

```

## `Example: Dempwolff (ex-a52bf2)`

In the second example we use the `UseSubgp` option to find a faithful permutation representation of the *Dempwolff group* which is a non-split extension of the natural module of $G = {\rm GL}(5,2)$ by $G$. Again we go on to find the smallest degree of a faithful representation.

```magma
> G := GL(5,2);
> M := GModule(G);
> CM := CohomologyModule(G, M);
> CohomologyGroup(CM, 2);
Full Vector space of degree 1 over GF(2)
> max := [m`subgroup : m in MaximalSubgroups(G)];
> [Index(G,m) : m in max];
[ 64512, 155, 155, 31, 31 ]
> P := Extension(GrpPerm, CM, [1] : UseSubgp := true, Subgp := max[2]);
> Degree(P);
138880
> ChiefFactors(P);
    G
    |  A(4, 2)                    = L(5, 2)
    *
    |  Cyclic(2) (5 copies)
    1
> _, PP := MinimalDegreePermutationRepresentation(P);
> Degree(PP);
3968

```

## `SplitExtension(CM): ModCoho -> Grp, HomGrp, Map`

Given the cohomology module ${\rm CM}$ for the group $G$ acting on the module $M$, this function returns the split extension $E$ of the module $M$ by $G$ as a finitely presented group. The generators of $E$ are chosen so that the generators of the acting group $G$ (or strong generators for $G$ when $G$ is a permutation or matrix group) come first, and the generators of $M$ come last. The extension returned is the same as for `Extension(CM, s)` with $s$ taken as the zero element of $H^2(G,M)$, but `SplitExtension` is much faster, and does not require $H^2(G,M)$ to be calculated first. This function will also work when the group used to define ${\rm CM}$ was a finitely presented group.

The projection from $E$ to $G$ and the injection from an abelian group isomorphic to $M$ to $E$ are also returned.

This function may only be applied when the module $M$ used to define ${\rm CM}$ is defined over a finite field of prime order, the integers, or as an abelian group in a call of `CohomologyModule(G, Q, T)`.

## `SplitExtension(G, M): ModCoho -> Grp, ModGrp -> HomGrp, Map`

## `SplitExtension(M): ModCoho -> ModGrp -> HomGrp, Map`

A presentation of the split extension of the module $M$ for the group $G$. In the first version $G$ should be equal to `Group(M)`. These functions simply call and return `SplitExtension(CohomologyModule(G,M))`.

## `SplitExtension(GrpPerm, CM): Cat, ModCoho -> GrpPerm, HomGrp, Map`

## `SplitExtension(GrpPerm, G, M): Cat, ModCoho -> GrpPerm, HomGrp, Map`

## `SplitExtension(GrpPerm, M): Cat, ModCoho -> GrpPerm, HomGrp, Map`

These functions attempt to construct a permutation group $P$ isomorphic to the split extension of $M$ by $G$ where ${\rm CM}$ is the cohomology module for $G$ on $M$ in the first version, and $G$ is equal to `Group(M)` in the third version. The natural homomorphism from $P$ to $G$ and the embedding of an abelian group isomorphic to $M$ into $P$ are also returned. They will of course work only if $M$ is finite, and currently they only work if the group $G$ has type `GrpPerm` or `GrpMat`.

If $M$ is moderately small then the elements of $M$ will be used as all or part of the set on which $P$ acts. Other possible actions are tried if $M$ if too large.

## `Example: Split Extension (ex-b445d6)`

In the first example, $|G|$ is large compared with $|M|$, so we use the natural action of $M:G$ on the elements of $M$.

```magma
> G:=GL(8,2);
> G := GL(8,2);
> M := GModule(GL(8,2));
> P := SplitExtension(GrpPerm, M);
> Degree(P);
256
> #P;
1369104324918194995200

```

## `Example: Split Extension (ex-6ad635)`

In the second example, $|M|$ is large compared with $|G|$, and we use the action on the cosets of a maximal subgroup of $M$.

```magma
> G := Alt(7);
> I := IrreducibleModules(G, GF(3));
> I;
[
    GModule of dimension 1 over GF(3),
    GModule of dimension 6 over GF(3),
    GModule of dimension 13 over GF(3),
    GModule of dimension 15 over GF(3),
    GModule of dimension 20 over GF(3)
]
> P := SplitExtension(GrpPerm, G, I[5]);
> Degree(P);
7560
> #P;
8786696690520

```

## `pMultiplicator(G, p): GrpPerm, RngIntElt -> [ RngIntElt ]`

Given the permutation group $G$ and a prime $p$ dividing the order of $G$, return the invariant factors of the $p$-part of the Schur multiplicator of $G$. This function calls Derek Holt’s original cohomology code (see [[Holt, 1984](../../references.md#cite-holt-multiplier)]).

## `pCover(G, F, p): GrpPerm, GrpFP, RngIntElt -> GrpFP`

Given the permutation group $G$ and the finitely presented group $F$ such that $G$ is an epimorphic image of $F$ in the sense described below, and a prime $p$, return a presentation for the $p$-cover of $G$, constructed as an extension of the $p$-multiplier by $F$. Note that the epimorphism of $F$ onto $G$ must satisfy the conditions that, firstly, the generators of $F$ are in one-to-one correspondence with those of $G$ and, secondly, the relations of $F$ are satisfied by the generators of $G$. In other words, the mapping taking the $i$-th generator of $F$ to the $i$-th generator of $G$ must be an epimorphism. Usually this mapping will be an isomorphism, although this is not mandatory. This function calls Derek Holt’s original cohomology code (see [[Holt, 1985](../../references.md#cite-holt-cover)]).

## `Example: straightforward (ex-f7eaba)`

We apply the machinery to construct a non-split extension of the elementary abelian group of order $3^8$ by $A_8$.

```magma
> G := Alt(8);
> M := PermutationModule(G,GF(3));
> X := CohomologyModule(G,M);
> C := CohomologyGroup(X,2);
> C;
Full Vector space of degree 1 over GF(3)

```

The function `Extension` is used to construct a non-split extension $E$ of the module $M$ by the group $G$.

```magma
> E := Extension(X,[1]);

```

The object $E$ is a finitely presented group, in which the 8 module generators come last. We now construct a faithful permutation representation of $E$. This is initially rather large, but we can reduce the degree by using `DegreeReduction`.

```magma
> n := Ngens(E);
> D := sub< E | [E.i : i in [n-7..n-1]] >;
> ct := CosetTable(E, D : CosetLimit:=10^6, Hard:=true);
> P := CosetTableToPermutationGroup(E,ct);
> Degree(P);
60480
> #P eq 3^8 * #G;
true
> P := DegreeReduction(P);
> Degree(P);

```

We extract the normal subgroup of order $3^8$ of the extension $E$, and verify that the extension is non-split.

```magma
> Q := sub<P | [P.i : i in [n-7..n]] >;
> #Q eq 3^8;
true
> IsNormal(P,Q);
true
> Complements(P,Q);
[]

```

## `Example: Nonsplit 2^5.L 5(2) (ex-1cc4cf)`

As a more challenging example, we construct a permutation representation of the Dempwolff group. i.e., the non-split extension of $L_5(2)$ by its natural module (see also Example [Example: Dempwolff](#example-ex-a52bf2) above).

```magma
> G := SL(5,2);
> M := GModule(G);
> CM := CohomologyModule(G,M);
> time CohomologyGroup(CM,2);
Full Vector space of degree 1 over GF(2)
Time: 10.370
> E, rho := Extension(CM,[1]);
> n := Ngens(E);

```

We look for a core-free subgroup $D$ of $E$ of order $16 \times 21$, which would have index 952320 in $E$. One of the four subgroups in the list `cands` below must have that property. The other three will have index 476160 and will not be core-free.

```magma
> S := Stabiliser(G, sub<V|V.2,V.3,V.4,V.5>) where V := VectorSpace(G);
> H := Subgroups(S : OrderEqual:=21)[1]`subgroup;
> EH1 := H.1 @@ rho;
> EH2 := H.2 @@ rho;
> cands := [ sub< E | [E.i : i in [n-3 .. n]], EH1, EH2 >,
>            sub< E | [E.i : i in [n-3 .. n]], E.(n-4)*EH1, EH2 >,
>            sub< E | [E.i : i in [n-3 .. n]], EH1, E.(n-4)*EH2 >,
>            sub< E | [E.i : i in [n-3 .. n]], E.(n-4)*EH1, E.(n-4)*EH2 > ];
> time for D in cands do
>   ct := CosetTable(E, D : CosetLimit:=10^7, Hard:=true);
>   if #ct eq 2 * Index(G,H) then
>     "Got it!";
>     break;
>   end if;
> end for;
Got it!
Time: 76.980
> P := CosetTableToPermutationGroup(E,ct);
> Degree(P);
952320
> time P := DegreeReduction(P);
Time: 20.850
> Degree(P);
7440

```

The smallest degree of a faithful permutation representation of this group is 3938, so we have not done badly!

## `Example: Module Integers (ex-75b180)`

We investigate the cohomology of the permutation module for $A_5$ taken over the integers.

```magma
> G := Alt(5);
> M := PermutationModule(G,Integers());
> X := CohomologyModule(G,M);
> CohomologyGroup(X,0);
Full Quotient RSpace of degree 1 over Integer Ring
Column moduli:
[ 0 ]
> CohomologyGroup(X,1);
Full Quotient RSpace of degree 0 over Integer Ring
Column moduli:
[ ]
> CohomologyGroup(X,2);
Full Quotient RSpace of degree 1 over Integer Ring
Column moduli:
[ 3 ]

```

While we can form extensions of $M$ in this case, we are unable to determine the distinct extensions.

```magma
> E := Extension(X,[1]);
> E;
Finitely presented group E on 8 generators
Relations
    (E.4, E.5) = Id(E)
    (E.4, E.6) = Id(E)
    (E.4, E.7) = Id(E)
    (E.4, E.8) = Id(E)
    (E.5, E.6) = Id(E)
    (E.5, E.7) = Id(E)
    (E.5, E.8) = Id(E)
    (E.6, E.7) = Id(E)
    (E.6, E.8) = Id(E)
    (E.7, E.8) = Id(E)
    (E.1, E.4^-1) = Id(E)
    (E.1, E.5^-1) = Id(E)
    E.1^-1 * E.6 * E.1 * E.7^-1 = Id(E)
    E.1^-1 * E.7 * E.1 * E.8^-1 = Id(E)
    E.1^-1 * E.8 * E.1 * E.6^-1 = Id(E)
    E.2^-1 * E.4 * E.2 * E.5^-1 = Id(E)
    E.2^-1 * E.5 * E.2 * E.6^-1 = Id(E)
    E.2^-1 * E.6 * E.2 * E.4^-1 = Id(E)
    (E.2, E.7^-1) = Id(E)
    (E.2, E.8^-1) = Id(E)
    (E.3, E.4^-1) = Id(E)
    E.3^-1 * E.5 * E.3 * E.6^-1 = Id(E)
    E.3^-1 * E.6 * E.3 * E.7^-1 = Id(E)
    E.3^-1 * E.7 * E.3 * E.5^-1 = Id(E)
    (E.3, E.8^-1) = Id(E)
    E.1^-3 * E.4^-1 * E.5^-2 = Id(E)
    (E.1^-1 * E.3^-1)^2 = Id(E)
    E.3^-3 * E.4 * E.8^2 = Id(E)
    E.2^-1 * E.1 * E.3^-1 * E.2 * E.1^-1 * E.4^-1 * E.8^2 = Id(E)
    E.2 * E.3 * E.2 * E.3 * E.8^-4 = Id(E)
    E.2^-1 * E.3^-1 * E.2^2 * E.3^-1 * E.4 * E.5 * E.6^-2 * E.7 = Id(E)
> DE := DistinctExtensions(X);
Sorry, can only compute distinct extensions over prime field or finite abelian
group

```
