---
title: "Homomorphisms"
canonical: "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/homomorphism.html"
source: "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/homomorphism.md"
part: "Finitely Presented Groups"
chapter: "Monoids Given by Rewrite Systems"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Finitely Presented Groups", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/index-finitely-presented-groups.md"}
  - {"title": "Monoids Given by Rewrite Systems", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/index-monoids-given-by-rewrite-systems.md"}
prev: {"title": "Basic Operations", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md"}
next: {"title": "Set Operations", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/Set.md"}
intrinsics:
  - {"name": "hom", "signature": "hom< M -> N | S >: Struct, Struct -> Map"}
---

# Homomorphisms

For a general description of homomorphisms, we refer to Chapter [Mappings](https://docs.magma-maths.org/v2.30-1/SetsSequencesMappings/Mappings/index-mappings.md#chapmap). This section describes some special aspects of homomorphisms whose domain is a rewrite monoid.

## General Remarks

Monoids in the category [`MonRWS`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/index-monoids-given-by-rewrite-systems.md#chapmonrws) currently are accepted as codomains only for monoid homomorphisms, whose codomain is a rewrite monoid as well.

## Construction of Homomorphisms

<a id="constructor-constructor-hom-struct-struct-map"></a>
### `hom< M -> N | S >: Struct, Struct -> Map`

Returns the homomorphism from the rewrite group $M$ to the monoid $N$ defined by the expression $S$ which must be the one of the following:

**(i)**
A list, sequence, or indexed set containing the images of the $n$ generators $M.1,\ldots,M.n$ of $M$. Here, the $i$-th element of $S$ is interpreted as the image of $M.i$, i.e. the order of the elements in $S$ is important.

**(ii)**
A list, sequence, enumerated set, or indexed set, containing $n$ tuples $<x_i,y_i>$ or arrow pairs $x_i \;-\!\!> y_i$, where $x_i$ is a generator of $M$ and $y_i\in N$ ($i=1,\ldots,n$) and the set $\{x_1,\ldots,x_n\}$ is the full set of generators of $M$. In this case, $y_i$ is assigned as the image of $x_i$, hence the order of the elements in $S$ is not important.

It is the user’s responsibility to ensure that the provided generator images actually give rise to a well-defined homomorphism. No checking is performed by the constructor. Presently, $N$ must be either a rewrite monoid or a group, and it is not possible to define a homomorphism by assigning images to the elements of an arbitrary generating set of $M$.
