# $KG$-Modules

This section describes some functions for creating finite dimensional $K[G]$-modules for a finitely presented group $G$. These are obtained from the conjugation action of $G$ on a basis for a maximal elementary abelian quotient of a normal subgroup $H$ of $G$, where $H$ has finite index in $G$. For a complete description of the functions available for working with $K[G]$-modules we refer to Chapter [Modules over an Algebra and Group Representations](../../RepresentationTheory/ModulesOverAnAlgebraAndGroupRepresentations/index-modules-over-an-algebra-and-group-representations.md#chapmodalg).

Note that the function [`GModuleAction`](../../RepresentationTheory/ModulesOverAnAlgebraAndGroupRepresentations/representation.md#function-repthy-gmoduleaction) can be used to extract the matrix representation associated to an $K[G]$-module.

All operations described in this subsection may require a closed coset table for at least one subgroup of an fp-group. If a closed coset table is needed and has not been computed, a coset enumeration will be invoked. If the coset enumeration does not produce a closed coset table, a runtime error is reported.

Experienced users can control the behaviour of such indirectly invoked coset enumeration with a set of global parameters. These global parameters can be changed using the function [`SetGlobalTCParameters`](subgroup-general.md#function-grpfp-setglobaltcparameters). For a detailed description of the available parameters and their meanings, we refer to Subsec. [Interactive Coset Enumeration](subgroup-general.md#coset-enumeration).

## `GModulePrimes(G, A): GrpFP, GrpFP -> SetMulti`

Let $G$ be a finitely presented group and $A$ a normal subgroup of $G$ of finite index. Given any prime $p$, the maximal $p$-elementary abelian quotient of $A$ can be viewed as a ${\bf F}_{p}[G]$-module $M_p$. This function determines all primes $p$ such that $M_p$ is not trivial (i.e. zero-dimensional) and the dimensions of the corresponding modules $M_p$. The return value is a multiset $S$. If $0\notin S$, the maximal abelian quotient of $A$ is finite and the multiplicity of $p$ is the dimension of $M_p$. If $S$ contains 0 with multiplicity $m$, the maximal abelian quotient of $A$ contains $m$ copies of ${\mathbb{Z}}$. In this case, $M_p$ is non-trivial for every prime $p$. The rank of $M_p$ in this case is the sum of $m$ and the multiplicity of $p$ in $S$.

## `GModulePrimes(G, A, B): GrpFP, GrpFP, GrpFP -> SetMulti`

Let $G$ be a finitely presented group, $A$ a normal subgroup of finite index in $G$ and $B$ a normal subgroup of $G$ contained in $A$. Given any prime $p$, the maximal $p$-elementary abelian quotient of $A/B$ can be viewed as a ${\bf F}_{p}[G]$-module $M_p$. This function determines all primes $p$ such that $M_p$ is not trivial (i.e. zero-dimensional) and the dimensions of the corresponding modules $M_p$. The return value is a multiset $S$. If $0\notin S$, the maximal abelian quotient of $A/B$ is finite and the multiplicity of $p$ is the dimension of $M_p$. If $S$ contains 0 with multiplicity $m$, the maximal abelian quotient of $A/B$ contains $m$ copies of ${\mathbb{Z}}$. In this case, $M_p$ is non-trivial for every prime $p$. The rank of $M_p$ in this case is the sum of $m$ and the multiplicity of $p$ in $S$.

## `GModule(G, A, p): GrpFP, GrpFP, RngIntElt -> ModGrp, Map`

Given a finitely presented group $G$, a normal subgroup $A$ of finite index in $G$ and a prime $p$, create the ${\bf F}_{p}[G]$-module $M$ corresponding to the conjugation action of $G$ on the maximal $p$-elementary abelian quotient of $A$. The function also returns the epimorphism $\pi: A\rightarrow M$.

Note that normality of $A$ in $G$ is not checked. The results for invalid input data are undefined.

## `GModule(G, A, B, p): GrpFP, GrpFP, GrpFP, RngIntElt -> ModGrp, Map`

## `GModule(G, A, B): GrpFP, GrpFP, GrpFP -> ModGrp, Map`

Given a finitely presented group $G$, a normal subgroup $A$ of $G$ of finite index, a normal subgroup $B$ of $G$ contained in $A$ and a prime $p$, create the ${\bf F}_{p}[G]$-module $M$ corresponding to the conjugation action of $G$ on the maximal $p$-elementary abelian quotient of $A/B$.

The integer $p$ can be omitted, if the maximal elementary abelian quotient of $A/B$ is a $p$-group for some prime $p$. Note, however, that the computation is much faster, if a prime is specified.

The function also returns the epimorphism $\pi: A\rightarrow M$.

Note that normality of $A$ and $B$ in $G$ is not checked. The results for invalid input data are undefined.

## `Pullback(f, N): Map, ModGrp -> GrpFP`

Given a map $f:A\rightarrow M$ from a normal subgroup $A$ of an fp-group $G$ onto a ${\bf F}_{p}[G]$-module $M$ and a submodule $N$ of $M$, try to compute the preimage of $N$ under $f$ using a fast pullback method. If successful, the preimage is returned as subgroup of $A$.

If the pullback works, it is in general faster than a direct computation of the preimage using the preimage operator and it produces a more concise generating set for the preimage; see the following example. In cases where the pullback fails, a runtime error is reported and a preimage construction should be used instead.

## `Example: Representation Theory (ex-00eade)`

Consider the group $G$ defined by the presentation

$$
\begin{aligned}\langle a,b,c,d,e\, |\, &a^4, b^{42}, c^6, e^3, b^a=b^{-1}, [a,c],
                                                                [a,d], [a,e], \\
         &c^b=ce, d^b=d^{-1}, e^b=e^2, d^c=de, e^c=e^2, [d,e] \rangle.\end{aligned}
$$

```magma
> F<a,b,c,d,e> := FreeGroup(5);
> G<a,b,c,d,e> := quo< F | a^4, b^42, c^6, e^3,
>                          b^a=b^-1, (a,c), (a,d), (a,e),
>                          c^b=c*e, d^b=d^-1, e^b=e^2,
>                          d^c=d*e, e^c=e^2,
>                          (d,e) >;

```

The finite index subgroup $H$ of $G$ generated by $c,d,e$ is normal in $G$.

```magma
> H := sub< G | c,d,e >;
> Index(G, H);
168
> IsNormal(G, H);
true

```

We check, for which characteristics the action of $G$ on $H$ yields non-trivial modules.

```magma
> GModulePrimes(G, H);
{* 0, 2, 3 *}

```

We construct the ${\bf F}_3[G]$-module $M$ given by the action of $G$ on the maximal 3-elementary abelian quotient of $H$ and the natural epimorphism $\pi$ from $H$ onto the additive group of $M$.

```magma
> M, pi := GModule(G, H, 3);
> M;
GModule M of dimension 2 over GF(3)

```

Using the function [`Submodules`](../../RepresentationTheory/ModulesOverAnAlgebraAndGroupRepresentations/submodule-lattice.md#function-repthy-submodules), we obtain the submodules of $M$. Their preimages under $\pi$ are precisely the normal subgroups of $G$ which are contained in $H$ and contain ${\rm ker}(\pi)$.

```magma
> submod := Submodules(M);
> time nsgs := [ m @@ pi : m in submod ];
Time: 11.640
> [ Index(G, s) : s in nsgs ];
[ 1512, 504, 504, 168 ]

```

The generating sets for the normal subgroups obtained in this way, contain in general many redundant generators. (e.g. each will contain a generating set for ${\rm ker}(\pi)$.)

```magma
> [ NumberOfGenerators(s) : s in nsgs ];
[ 19, 20, 20, 21 ]

```

Optimised generating sets can be obtained using the function [`ReduceGenerators`](simplification.md#function-grpfp-1-reducegenerators).

```magma
> nsgs_red := [ ReduceGenerators(s) : s in nsgs ];
> [ NumberOfGenerators(s) : s in nsgs_red ];
[ 2, 2, 3, 2 ]

```

Alternatively, and in fact this is the recommended way, we can use the function [`Pullback`](#function-grpfp-1-pullback) to compute the preimages of the submodules under $\pi$. Note that the generating sets for the preimages computed this way contain fewer redundant generators.

```magma
> time nsgs := [ Pullback(pi, m) : m in submod ];
Time: 8.560
> [ Index(G, s) : s in nsgs ];
[ 1512, 504, 504, 168 ]
> [ NumberOfGenerators(s) : s in nsgs ];
[ 4, 4, 3, 2 ]

```

## `Example: gmoduleprimes (ex-c74200)`

Consider the group defined by the presentation

$$
\begin{aligned}< a, b, c, d, e\ | \
           & a^5, b^5, c^6, d^5, e^3, b^a = bd,\\
           & (a,c), (a,d), (a,e), (b,c), (b,d), (b,e), (c,d), (c,e), (d,e)>.\end{aligned}
$$

```magma
> G<a,b,c,d,e> := FPGroup< a,b,c,d,e |
>                            a^5, b^5, c^6, d^5, e^3, b^a = b*d,
>                            (a,c), (a,d), (a,e), (b,c), (b,d), (b,e),
>                            (c,d), (c,e), (d,e) >;

```

Obviously the subgroup of $G$ generated by $b,c,d,e$ is normal in $G$.

```magma
> H := sub< G | b,c,d,e >;
> IsNormal(G, H);
true

```

We use the function [`GModulePrimes`](#function-grpfp-1-gmoduleprimes) to determine the set of primes $p$ for which the action of $G$ on the maximal $p$-elementary abelian quotient of $H$ induces a nontrivial ${\bf F}_{p}[G]$-module.

```magma
> P := GModulePrimes(G, H);
> 0 in P;
false

```

0 is not contained in $P$, i.e. the maximal free abelian quotient of $H$ is trivial. Hence, there are only finitely many primes, satisfying the condition above.

We loop over the distinct elements of $P$ and for each element $p$ we construct the induced ${\bf F}_{p}[G]$-module, print its dimension and check whether it is decomposable. Note that the dimension of the module for $p$ must be equal to the multiplicity of $p$ in $P$.

```magma
> for p in MultisetToSet(P) do
>    M := GModule(G, H, p);
>    dim := Dimension(M);
>    decomp := IsDecomposable(M);
>
>    assert dim eq Multiplicity(P, p);
>
>    print "prime", p, ": module of dimension", dim;
>    if decomp then
>       print "  has a nontrivial decomposition";
>     else
>       print "  is indecomposable";
>    end if;
> end for;
prime 2 : module of dimension 1
  is indecomposable
prime 3 : module of dimension 2
  has a nontrivial decomposition
prime 5 : module of dimension 2
  is indecomposable

```
