---
title: "Finite Group Cohomology"
canonical: "https://docs.magma-maths.org/v2.30-1/FiniteGroups/CohomologyAndExtensions/group-cohomology.html"
source: "https://docs.magma-maths.org/v2.30-1/FiniteGroups/CohomologyAndExtensions/group-cohomology.md"
part: "Finite Groups"
chapter: "Cohomology and Extensions"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Finite Groups", "source": "https://docs.magma-maths.org/v2.30-1/FiniteGroups/index-finite-groups.md"}
  - {"title": "Cohomology and Extensions", "source": "https://docs.magma-maths.org/v2.30-1/FiniteGroups/CohomologyAndExtensions/index-cohomology-and-extensions.md"}
prev: {"title": "Constructing Distinct Extensions", "source": "https://docs.magma-maths.org/v2.30-1/FiniteGroups/CohomologyAndExtensions/extensions-2.md"}
next: {"title": "Bibliography", "source": "https://docs.magma-maths.org/v2.30-1/FiniteGroups/CohomologyAndExtensions/bibliography.md"}
intrinsics:
  - {"name": "GammaGroup", "signature": "GammaGroup(Gamma, A, action): Grp, Grp, Map[Grp, GrpAuto] -> GGrp"}
  - {"name": "InducedGammaGroup", "signature": "InducedGammaGroup(A, B): GGrp, Grp -> GGrp"}
  - {"name": "IsNormalised", "signature": "IsNormalised(B, action): Grp, Map -> BoolElt"}
  - {"name": "IsInduced", "signature": "IsInduced(AmodB): GGrp -> BoolElt, GGrp, GGrp, Map, Map"}
  - {"name": "Group", "signature": "Group(A): GGrp -> Grp"}
  - {"name": "GammaAction", "signature": "GammaAction(A): GGrp -> Map[Grp, GrpAuto]"}
  - {"name": "ActingGroup", "signature": "ActingGroup(A): GGrp -> Grp"}
  - {"name": "OneCocycle", "signature": "OneCocycle(A, imgs): GGrp, SeqEnum[GrpElt] -> OneCoC"}
  - {"name": "OneCocycle", "signature": "OneCocycle(A, alpha): GGrp, Map[Grp,Grp] -> OneCoC"}
  - {"name": "TrivialOneCocycle", "signature": "TrivialOneCocycle(A): GGrp -> OneCoC"}
  - {"name": "IsOneCocycle", "signature": "IsOneCocycle(A, imgs): GGrp, SeqEnum[GrpElt] -> BoolElt, OneCoC"}
  - {"name": "IsOneCocycle", "signature": "IsOneCocycle(A, alpha): GGrp, Map[Grp,Grp] -> BoolElt, OneCoC"}
  - {"name": "AreCohomologous", "signature": "AreCohomologous(alpha, beta): OneCoC, OneCoC -> BoolElt, GrpElt"}
  - {"name": "CohomologyClass", "signature": "CohomologyClass(alpha): OneCoC -> SetIndx[OneCoC]"}
  - {"name": "InducedOneCocycle", "signature": "InducedOneCocycle(AmodB, alpha): GGrp, OneCoC -> OneCoC"}
  - {"name": "InducedOneCocycle", "signature": "InducedOneCocycle(A, B, alpha): GGrp, Grp, OneCoC -> OneCoC"}
  - {"name": "ExtendedOneCocycle", "signature": "ExtendedOneCocycle(alpha): OneCoC -> SetEnum[OneCoC]"}
  - {"name": "ExtendedCohomologyClass", "signature": "ExtendedCohomologyClass(alpha): OneCoC -> SetEnum[OneCoC]"}
  - {"name": "GammaGroup", "signature": "GammaGroup(alpha): OneCoC -> GGrp"}
  - {"name": "CocycleMap", "signature": "CocycleMap(alpha): OneCoC -> Map"}
  - {"name": "Cohomology", "signature": "Cohomology(A, n): GGrp, RngIntElt -> SetEnum[OneCoC]"}
  - {"name": "OneCohomology", "signature": "OneCohomology(A): GGrp -> SetEnum[OneCoC]"}
  - {"name": "TwistedGroup", "signature": "TwistedGroup(A, alpha): GGrp, OneCoC -> GGrp"}
examples:
  - "ex-379641"
  - "ex-82c924"
---

<a id="group-cohomology"></a>
<a id="sectgrpcohom"></a>
# 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 [[Hal05](https://docs.magma-maths.org/v2.30-1/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.
$$

<a id="gamma-groups"></a>
<a id="subsectggrp"></a>
## Creation of Gamma-groups

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

<a id="function-gammagroup-grp-grp-map-grp-grpauto"></a>
### `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:

<a id="function-inducedgammagroup-ggrp-grp"></a>
### `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$.

<a id="example-ex-379641"></a>
### `Example: Creating a Gamma-Group (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
```

<a id="function-isnormalised-grp-map"></a>
### `IsNormalised(B, action): Grp, Map -> BoolElt`

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

<a id="function-isinduced-ggrp"></a>
### `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.

<a id="access"></a>
<a id="subsectinfoggrp"></a>
## Accessing Information

<a id="function-group-ggrp"></a>
### `Group(A): GGrp -> Grp`

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

<a id="function-gammaaction-ggrp"></a>
### `GammaAction(A): GGrp -> Map[Grp, GrpAuto]`

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

<a id="function-actinggroup-ggrp"></a>
### `ActingGroup(A): GGrp -> Grp`

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

<a id="subsectonecoc"></a>
<a id="id2"></a>
## One Cocycles

<a id="function-onecocycle-ggrp-seqenum-grpelt"></a>
### `OneCocycle(A, imgs): GGrp, SeqEnum[GrpElt] -> OneCoC`

<a id="function-onecocycle-ggrp-map-grp-grp"></a>
### `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`.

<a id="function-trivialonecocycle-ggrp"></a>
### `TrivialOneCocycle(A): GGrp -> OneCoC`

Return the trivial $1$-cocycle.

<a id="function-isonecocycle-ggrp-seqenum-grpelt"></a>
### `IsOneCocycle(A, imgs): GGrp, SeqEnum[GrpElt] -> BoolElt, OneCoC`

<a id="function-isonecocycle-ggrp-map-grp-grp"></a>
### `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.

<a id="function-arecohomologous-onecoc-onecoc"></a>
### `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.

<a id="function-cohomologyclass-onecoc"></a>
### `CohomologyClass(alpha): OneCoC -> SetIndx[OneCoC]`

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

<a id="function-inducedonecocycle-ggrp-onecoc"></a>
### `InducedOneCocycle(AmodB, alpha): GGrp, OneCoC -> OneCoC`

<a id="function-inducedonecocycle-ggrp-grp-onecoc"></a>
### `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.

<a id="function-extendedonecocycle-onecoc"></a>
### `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.

<a id="function-extendedcohomologyclass-onecoc"></a>
### `ExtendedCohomologyClass(alpha): OneCoC -> SetEnum[OneCoC]`

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 a cocycle in the cohomology class of $\alpha$. If no such cocycles on $A$ exist, the returned set is empty.

<a id="function-gammagroup-onecoc"></a>
### `GammaGroup(alpha): OneCoC -> GGrp`

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

<a id="function-cocyclemap-onecoc"></a>
### `CocycleMap(alpha): OneCoC -> Map`

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

<a id="one-cocycles-2"></a>
<a id="secttwistedtori"></a>
<a id="sectgaloiscohom"></a>
<a id="id3"></a>
## Group Cohomology

<a id="function-cohomology-ggrp-rngintelt"></a>
### `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.)

<a id="function-onecohomology-ggrp"></a>
### `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](https://docs.magma-maths.org/v2.30-1/FiniteGroups/CohomologyAndExtensions/index-cohomology-and-extensions.md#grpcohom-main)). Otherwise use [[Hal05](https://docs.magma-maths.org/v2.30-1/references.md#cite-sh)].

<a id="function-twistedgroup-ggrp-onecoc"></a>
### `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$.

<a id="example-ex-82c924"></a>
### `Example: Gamma-Group Cohomology of D8 (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)
>
```
