# Finite Group Cohomology

This section describes Magma functions for computing the first cohomology group of a finite group with coefficients in a finite (not necessarily abelian) group. These functions are based on [[Haller, 2005](../../references.md#cite-sh)].

Let $\Gamma$ be a group. A group $A$ on which $\Gamma$ acts by group automorphisms from the right, is called a $\Gamma$*-group*. Given a $\Gamma$-group $A$, define

$$
H^0(\Gamma,A) :=  \{ a\in A \mid  a^\sigma = a  {\hbox{ for all }} \sigma\in\Gamma  \}.
$$

A $1$*-cocycle of* $\Gamma$ *on* $A$ is a map

$$
\alpha: \Gamma \rightarrow A, \quad  \sigma \mapsto \alpha_\sigma,
$$

such that

$$
\alpha_{\sigma\tau} = (\alpha_\sigma)^\tau  \alpha_\tau
          \quad\hbox{ for all } \sigma,\tau\in\Gamma.
$$

Two cocycles $\alpha,\beta$ on $A$ are called *cohomologous* (with respect to $a$) if there exists $a\in A$, such that $\beta_\sigma = a^{-\sigma} \cdot \alpha_\sigma \cdot a$ for all $\sigma\in\Gamma$. Note that being cohomologous is an equivalence relation.

We denote by $Z^1(\Gamma, A)$ the set of all $1$-cocycles of $\Gamma$ on $A$. We denote by $[\alpha]$ the equivalence class of $\alpha$ and by $H^1(\Gamma, A)$ the set of equivalence classes of $1$-cocycles.

$Z^1(\Gamma, A)$ and $H^1(\Gamma, A)$ are *pointed sets*.

The constant map $t: \sigma \mapsto 1$ is the distinguished element of $Z^1(\Gamma, A)$, called the *trivial* $1$*-cocycle*. Its cohomology class is the distinguished element of $H^1(\Gamma, A)$.

A twisted form $A_\beta$ of $A$ by the cocycle $\beta\in Z^1(\Gamma,A)$ is the same group $A$ but with a different action of $\Gamma$ on it, given by

$$
a * \sigma := a^{\sigma \alpha_\sigma}
     \quad\hbox{ for }\sigma\in\Gamma \hbox{ and } a\in A.
$$

## Creation of Gamma-groups

This section describes intrinsics dealing with cocycles and the first cohomology.

### `GammaGroup(Gamma, A, action): Grp, Grp, Map[Grp, GrpAuto] -> GGrp`

Given a group $A$ and a group $\Gamma$ acting on it by the map `action`, return the object of type `GGrp`, which is the Group $A$ together with this particular action of $\Gamma$. The map `action` must be a homomorphism from $\Gamma$ to the automorphism group of $A$.

If $B$ is a normal subgroup of $A$ and normalised by the action of $\Gamma$ on $A$ (thus a $\Gamma$-group itself), then the action of $\Gamma$ on $A$ induces in the natural way to $A/B$. It is possible to create such a group:

### `InducedGammaGroup(A, B): GGrp, Grp -> GGrp`

Given a $\Gamma$-group $A$ and a normal subgroup $B$ normalised by the action of $\Gamma$, return the induced $\Gamma$-group $A/B$.

### `Example: create G Grp (ex-379641)`

Let $\Gamma$ act on $A$ by conjugation:

```magma
> A := SymmetricGroup(4);
> Gamma := sub<A|(1,2,3), (1,2)>;
> action := hom< Gamma -> Aut(A) |
>             g :-> iso< A -> A | a :-> a^g, a :-> a^(g^-1) > >;
> A := GammaGroup( Gamma, A, action );
> A;
Gamma-group:  Symmetric group acting on a set of cardinality 4
Order = 24 = 2^3 * 3
(1, 2, 3, 4)
(1, 2)
Gamma-action: Mapping from: GrpPerm: $, Degree 4 to
Set of all automorphisms of GrpPerm: $, Degree 4, Order 2^3 * 3
given by a rule [no inverse]
Gamma:        Permutation group acting on a set of cardinality 4
(1, 2, 3)
(1, 2)
>

```

and $B$ be a normal subgroup of $A$:

```magma
> B := AlternatingGroup(4);
> AmodB := InducedGammaGroup( A, B );
> AmodB;
Gamma-group:  Symmetric group acting on a set of cardinality 2
Order = 2
(1, 2)
(1, 2)
Gamma-action: Mapping from: GrpPerm: $, Degree 4, Order 2 * 3 to
Set of all automorphisms of GrpPerm: $, Degree 2, Order 2
given by a rule [no inverse]
Gamma:        Permutation group acting on a set of cardinality 4
Order = 6 = 2 * 3
(1, 2, 3)
(1, 2)
Induced from another Gamma-group

```

### `IsNormalised(B, action): Grp, Map -> BoolElt`

Returns `true` if the group $B$ is normalised by the action `action`, where `action` is as above.

### `IsInduced(AmodB): GGrp -> BoolElt, GGrp, GGrp, Map, Map`

Returns `true` iff the $\Gamma$-group *AmodB* was created as an induced $\Gamma$-group. If it is, then the $\Gamma$-groups $A$, $B$, the projection and representative maps are returned as well.

## Accessing Information

### `Group(A): GGrp -> Grp`

Returns the group $A$ as a `Grp` object to be used in Magma.

### `GammaAction(A): GGrp -> Map[Grp, GrpAuto]`

Returns the action of $\Gamma$ on $A$ as a map.

### `ActingGroup(A): GGrp -> Grp`

Returns the group $\Gamma$ acting on $A$.

## One Cocycles

### `OneCocycle(A, imgs): GGrp, SeqEnum[GrpElt] -> OneCoC`

### `OneCocycle(A, alpha): GGrp, Map[Grp,Grp] -> OneCoC`

```magma
Check: BoolElt                    Default: true
```

If the map $\alpha:\Gamma \rightarrow A$ or the sequence `imgs` of images of the generators $\Gamma.1,...,\Gamma.n$ defines a $1$-cocycle, return the $1$-cocycle. By default, the map is checked to define a $1$-cocycle. If it doesn’t, `OneCocycle` will abort with an error. This check can be disabled by setting the optional argument `Check` to `false`.

### `TrivialOneCocycle(A): GGrp -> OneCoC`

Return the trivial $1$-cocycle.

### `IsOneCocycle(A, imgs): GGrp, SeqEnum[GrpElt] -> BoolElt, OneCoC`

### `IsOneCocycle(A, alpha): GGrp, Map[Grp,Grp] -> BoolElt, OneCoC`

Return true if the map $\alpha:\Gamma \rightarrow A$ or the sequence `imgs` of images of the generators $\Gamma.1,...,\Gamma.n$ defines a $1$-cocycle and `false` otherwise. If `true`, return the cocycle as the second argument.

Note that `IsOneCocycle` does not abort with an error in contrast to `OneCocycle` if the map does not define a cocycle.

### `AreCohomologous(alpha, beta): OneCoC, OneCoC -> BoolElt, GrpElt`

Return `true` if and only if the $1$-cocycles $\alpha$ and $\beta$ are cohomologous. If they are, return the intertwining element as the second return value.

### `CohomologyClass(alpha): OneCoC -> SetIndx[OneCoC]`

Return the cohomology class of the $1$-cocycle $\alpha$.

### `InducedOneCocycle(AmodB, alpha): GGrp, OneCoC -> OneCoC`

### `InducedOneCocycle(A, B, alpha): GGrp, Grp, OneCoC -> OneCoC`

Given a $1$-cocycle on $A$, return the induced $1$-cocycle on *AmodB*. The second version will generate the induced $\Gamma$-group $A/B$ first.

### `ExtendedOneCocycle(alpha): OneCoC -> SetEnum[OneCoC]`

```magma
OnlyOne: BoolElt                    Default: false
```

Given a $1$-cocycle on an induced $\Gamma$-group $A/B$, return the set of all non-cohomologous $1$-cocycles on $A$, which induce to $\alpha$. If the optional argument `OnlyOne` is `true`, the set will contain at most one $1$-cocycle. If $\alpha$ is not extendible, the returned set is empty.

### `ExtendedCohomologyClass(alpha): OneCoC -> SetEnum[OneCoC]`

Given a $1$-cocycle on an induced $\Gamma$-group $A/B$, return the the set of all non-cohomologous $1$-cocycles on $A$, which induce to a cocycle in the cohomology class of $\alpha$. If no such cocycles on $A$ exist, the returned set is empty.

### `GammaGroup(alpha): OneCoC -> GGrp`

Return the $\Gamma$-group on which $\alpha$ is defined.

### `CocycleMap(alpha): OneCoC -> Map`

Return the `Map` object corresponding to $\alpha$.

## Group Cohomology

### `Cohomology(A, n): GGrp, RngIntElt -> SetEnum[OneCoC]`

Given a finite $\Gamma$-group $A$ and an integer $n$ (currently restricted to being $1$) return the $n$-th cohomology group $H^n(\Gamma, A)$. Since the group $A$ is not assumed to be abelian, only $n=0,1$ can be used. Currently, only $n=1$ implemented. (The zero cohomology of $A$ is the subgroup of $A$ centralised by $\Gamma$ and can be constructed using group theoretical methods available in Magma.)

### `OneCohomology(A): GGrp -> SetEnum[OneCoC]`

Return the first cohomology $H^1(\Gamma, A)$. as a set of representatives of all cohomology classes. If the group $A$ is abelian, existing code by Derek Holt is used (see Chapter [Cohomology and Extensions](index-cohomology-and-extensions.md#grpcohom-main)). Otherwise use [[Haller, 2005](../../references.md#cite-sh)].

### `TwistedGroup(A, alpha): GGrp, OneCoC -> GGrp`

Given the $\Gamma$-group $A$ and a $1$-cocycle $\alpha$ on it, return the twisted $\Gamma$-group $A_\alpha$.

### `Example: large example (ex-82c924)`

First, we create the group $A=D_8$. The returned group is the usual permutation group on the octagon. $\Gamma$ is the Normaliser of $A$ in $S_8$ and is acting by conjugation.

```magma
> A := DihedralGroup(8);
> Gamma := sub< Sym(8) | (1, 2, 3, 4, 5, 6, 7, 8),
>    (1, 8)(2, 7)(3, 6)(4, 5), (2, 4)(3, 7)(6, 8) >;
> A^Gamma eq A;
true
> Gamma;
Permutation group Gamma acting on a set of cardinality 8
Order = 32 = 2^5
    (1, 2, 3, 4, 5, 6, 7, 8)
    (1, 8)(2, 7)(3, 6)(4, 5)
    (2, 4)(3, 7)(6, 8)
> action := hom< Gamma -> Aut(A) |
>             g :-> iso< A -> A | a :-> a^g, a :-> a^(g^-1) > >;
> A := GammaGroup( Gamma, A, action );

```

Now let $B$ be the center of $A$ and create the induced $\Gamma$-group $A/B$:

```magma
> B := Center(Group(A));
> AmodB := InducedGammaGroup(A, B);

```

Create the trivial $1$-cocycle on $A/B$ and compute its cohomology class:

```magma
> triv := TrivialOneCocycle(AmodB);
> CohomologyClass( triv );
{@
    One-Cocycle
    defined by [
    Id($),
    Id($),
    Id($)
    ],
    One-Cocycle
    defined by [
    Id($),
    (1, 4)(2, 7)(3, 8)(5, 6),
    (1, 4)(2, 7)(3, 8)(5, 6)
    ],
    One-Cocycle
    defined by [
    (1, 4)(2, 7)(3, 8)(5, 6),
    Id($),
    (1, 4)(2, 7)(3, 8)(5, 6)
    ],
    One-Cocycle
    defined by [
    (1, 4)(2, 7)(3, 8)(5, 6),
    (1, 4)(2, 7)(3, 8)(5, 6),
    Id($)
    ]
@}

```

Pick one of the cocycles in this class and compute the intertwining element:

```magma
> alpha := Random($1);alpha;
One-Cocycle
defined by [
(1, 4)(2, 7)(3, 8)(5, 6),
(1, 4)(2, 7)(3, 8)(5, 6),
Id($)
]
> bo, a := AreCohomologous(alpha,triv);
> bo; a;
true
(1, 5)(2, 8)(3, 7)(4, 6)

```

Now create another cocycle on $A/B$ and extend it to $A$:

```magma
> alpha := OneCocycle( AmodB,
>                [Group(AmodB)| (1, 7, 4, 2)(3, 5, 8, 6),
>                               (1, 2, 4, 7)(3, 6, 8, 5),
>                               1 ] );
> ExtendedOneCocycle(alpha);
{
    One-Cocycle
    defined by [
    (1, 4, 7, 2, 5, 8, 3, 6),
    (1, 2, 3, 4, 5, 6, 7, 8),
    Id($)
    ],
    One-Cocycle
    defined by [
    (1, 8, 7, 6, 5, 4, 3, 2),
    (1, 6, 3, 8, 5, 2, 7, 4),
    Id($)
    ]
}

```

Pick a cocycle $\beta$ in this set and check if it really induces to $\alpha$:

```magma
> beta := Rep($1);
> InducedOneCocycle(AmodB, beta) eq alpha;
true

```

Finally, create the twisted group $A_\beta$:

```magma
> A_beta := TwistedGroup(A, beta);
> A_beta;
Gamma-group:  Permutation group acting on a set of cardinality 8
Order = 16 = 2^4
(1, 2, 3, 4, 5, 6, 7, 8)
(1, 8)(2, 7)(3, 6)(4, 5)
Gamma-action: Mapping from: GrpPerm: $, Degree 8, Order 2^5 to
Set of all automorphisms of GrpPerm: $, Degree 8, Order 2^4
given by a rule [no inverse]
Gamma:        Permutation group acting on a set of cardinality 8
Order = 32 = 2^5
(1, 2, 3, 4, 5, 6, 7, 8)
(1, 8)(2, 7)(3, 6)(4, 5)
(2, 4)(3, 7)(6, 8)
>

```
