# Homomorphisms

Homomorphisms are a central concept in group theory, and Magma provides extensive facilities for group homomorphisms. Many useful homomorphisms are returned by constructors and intrinsic functions. Examples of these are the `quo` constructor, the `sub` constructor and intrinsic functions such as `OrbitAction`, `BlocksAction`, `FPGroup` and `RadicalQuotient`, which are described in more detail elsewhere in this chapter. In this section we describe how the user may create their own homomorphisms with domain a permutation group.

## `hom<G -> H | L>: GrpPerm, List -> Map`

Given the permutation group $G$, construct the homomorphism $f : G \to H$ given by the generator images in $L$. $H$ must be a group. The clause $L$ may be any one of the following types:

**(a)**
A list of elements of $H$, giving images of the generators of $G$;

**(b)**
A list of pairs, where the first in the pair is an element of $G$ and the second its image in $H$;

**(c)**
A sequence of elements of $H$, as in (a);

**(d)**
A set or sequence of pairs, as in (b);

Each image element specified by the list must belong to the *same* group $H$. In the cases where pairs are given the given elements of $G$ must generate $G$.

## `Domain(f): Map -> Grp`

The domain of the homomorphism $f$.

## `Codomain(f): Map -> Grp`

The codomain of the homomorphism $f$.

## `Image(f): Map -> Grp`

The image or range of the homomorphism $f$. This will be a subgroup of the codomain of $f$. The algorithm computes the image and kernel simultaneously (see [[Leedham-Green *et al.*, 1991](../../references.md#cite-grp-homs)]).

## `Kernel(f): Map -> Grp`

The kernel of the homomorphism $f$. This will be a normal subgroup of the domain of $f$. The algorithm computes the image and kernel simultaneously (see [[Leedham-Green *et al.*, 1991](../../references.md#cite-grp-homs)]).

## `IsHomomorphism(G, H, Q): GrpPerm, GrpPerm, SeqEnum[GrpPermElt] -> Bool, Map`

Return the value `true` if the sequence $Q$ defines a homomorphism from the group $G$ to the group $H$. The sequence $Q$ must have length `Ngens(G)` and must contain elements of $H$. The $i$-th element of $Q$ is interpreted as the image of the $i$-th generator of $G$ and the function decides if these images extend to a homomorphism. If so, the homomorphism is also returned. The algorithm employed is described in [[Leedham-Green *et al.*, 1991](../../references.md#cite-grp-homs)].

## `Example: Homomorphism (ex-bee0e9)`

Consider the group $G$ of order $648$ generated by the permutations (1,6,7)(2,5,8,3,4,9)(11,12) and (1,3)(4,9,12)(5,8,10,6,7,11). We construct a permutation representation of $G$ of degree 8 by considering the conjugation action of $G$ on one of its elements. We then construct the preimage of a normal subgroup of the image.

```magma
> G := PermutationGroup< 12 | (1,6,7)(2,5,8,3,4,9)(11,12),
>                             (1,3)(4,9,12)(5,8,10,6,7,11) >;
> #G;
648
> x := G ! (1, 2, 3)(7, 8, 9)(10, 11, 12);
> x_class := {@ x ^ y : y in G @};
> #x_class;
8
> S := SymmetricGroup(8);
> images := [S![Index(x_class, x_class[i]^(G.j)):i in [1..8]] :j in [1..2]];
> f := hom< G -> S | images>;

```

The map $f$ is the homomorphism of $G$ onto the group induced by the action of the element $x$. We computer the images of some elements and then find the image and kernel of $f$.

```magma
> (G.1*G.-2) @ f;
(2, 5, 7)(3, 8, 6)
> ((G.1) @ f) * ((G.2) @ f) ^ -1;
(2, 5, 7)(3, 8, 6)
> H := Image(f);
> H;
Permutation group acting on a set of cardinality 8
Order = 24 = 2^3 * 3
  (1, 2, 3, 4, 6, 5)(7, 8)
  (1, 2, 8, 4, 6, 7)(3, 5)
> Kernel(f);
Permutation group acting on a set of cardinality 12
Order = 27 = 3^3
  (1, 2, 3)(4, 6, 5)(7, 8, 9)(10, 12, 11)
  (4, 5, 6)(7, 9, 8)
  (7, 9, 8)(10, 11, 12)

```

We now find the preimage of $O_2(H)$ as a subgroup of $G$.

```magma
> pCore(H, 2) @@ f;
Permutation group acting on a set of cardinality 12
Order = 216 = 2^3 * 3^3
  (4, 5, 6)(7, 9, 8)
  (1, 2, 3)(4, 6, 5)(7, 8, 9)(10, 12, 11)
  (1, 4, 2, 5, 3, 6)(7, 12, 9, 11, 8, 10)
  (1, 10, 3, 11, 2, 12)(4, 9, 5, 8, 6, 7)
  (2, 3)(4, 5)(8, 9)(11, 12)
  (7, 9, 8)(10, 11, 12)

```
