---
title: "Monoids Given by Rewrite Systems"
canonical: "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/index-monoids-given-by-rewrite-systems.html"
source: "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/index-monoids-given-by-rewrite-systems.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"}
prev: {"title": "String Operations on Words", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/FinitelyPresentedSemigroups/operation-element.md"}
next: {"title": "Introduction", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/introduction.md"}
---

<a id="rewrite-system"></a>
<a id="chapmonrws"></a>
# Monoids Given by Rewrite Systems

- [Introduction](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/introduction.md)
  - [Terminology](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/introduction.md#terminology)
  - [The Category of Rewrite Monoids](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/introduction.md#the-category-of-rewrite-monoids)
  - [The Construction of a Rewrite Monoid](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/introduction.md#the-construction-of-a-rewrite-monoid)
- [Construction of a Rewrite Monoid](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/creation.md)
  - [`RWSMonoid(Q: parameters): MonFP → MonRWS`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/creation.md#function-rwsmonoid-monfp)
  - [`SetVerbose("KBMAG", v): MonStgElt, RngIntElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/creation.md#procedure-setverbose-monstgelt-rngintelt-kbmag)
  - [Example: Rewrite Monoid for A4](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/creation.md#example-ex-1dd9f1)
  - [Example: Neumann's Presentation of the Trivial Monoid](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/creation.md#example-ex-917c6e)
  - [Example: Confluent Submonoid of a Nilpotent Group](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/creation.md#example-ex-fe6d08)
  - [Example: Monoid Presentation of Fibonacci F(2,7)](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/creation.md#example-ex-d43295)
- [Basic Operations](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md)
  - [Accessing Monoid Information](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#accessing-monoid-information)
    - [`M . i: MonRWS, RngIntElt → MonRWSElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#operation-operation-monrws-rngintelt-monrwselt)
    - [`Generators(M): MonRWS → [ MonRWSElt]`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#function-generators-monrws)
    - [`NumberOfGenerators(M): MonRWS → RngIntElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#function-numberofgenerators-monrws)
    - [`Ngens(M): MonRWS → RngIntElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#function-ngens-monrws)
    - [`Relations(M): MonRWS → [MonFPRel]`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#function-monrws-relations)
    - [`NumberOfRelations(M): MonRWS → RngIntElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#function-numberofrelations-monrws)
    - [`Nrels(M): MonRWS → RngIntElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#function-nrels-monrws)
    - [`Ordering(M): MonRWS → String`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#function-ordering-monrws)
    - [`Parent(w): MonRWSElt → MonRWS`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#function-parent-monrwselt)
    - [Example: Accessing Rewrite Monoid Information](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#example-ex-de40ce)
  - [Properties of a Rewrite Monoid](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#properties-of-a-rewrite-monoid)
    - [`IsConfluent(M): MonRWS → BoolElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#function-isconfluent-monrws)
    - [`IsFinite(M): MonRWS → BoolElt, RngIntElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#function-isfinite-monrws)
    - [`Order(M): MonRWS → RngIntElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#function-order-monrws)
    - [`# M: MonRWS → RngIntElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#operation-operation-monrws-rngintelt)
    - [Example: Order of a Threefold Cover of A6](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#example-ex-7a9289)
    - [Example: Order of a Free Abelian Group](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#example-ex-541f65)
    - [Example: Finiteness of the Weyl Group E8](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#example-ex-2a5004)
  - [Construction of a Word](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#construction-of-a-word)
    - [`Identity(M): MonRWS → MonRWSElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#function-identity-monrws)
    - [`Id(M): MonRWS → MonRWSElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#function-id-monrws)
    - [`M ! 1: MonRWS, RngIntElt → MonRWSElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#operation-op-monrws-rngintelt)
    - [`M ! [ i₁, ..., iₛ ]: MonRWS, [ RngIntElt ] → MonRWSElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#operation-op-monrws-rngintelt-2)
    - [Example: Constructing Words in a Rewrite Monoid](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#example-ex-00230f)
  - [Arithmetic with Words](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#arithmetic-with-words)
    - [`u * v: MonRWSElt, MonRWSElt → MonRWSElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#operation-op-times-monrwselt-monrwselt)
    - [`u ^ n: MonRWSElt, RngIntElt → MonRWSElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#operation-op-pow-monrwselt-rngintelt)
    - [`u eq v: MonRWSElt, MonRWSElt → BoolElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#operation-op-eq-monrwselt-monrwselt)
    - [`u ne v: MonRWSElt, MonRWSElt → BoolElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#operation-op-ne-monrwselt-monrwselt)
    - [`IsId(w): MonRWSElt → BoolElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#function-isid-monrwselt)
    - [`IsIdentity(w): MonRWSElt → BoolElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#function-isidentity-monrwselt)
    - [`# u: MonRWSElt → RngIntElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#operation-operation-monrwselt-rngintelt)
    - [`ElementToSequence(u): MonRWSElt → [ RngIntElt ]`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#function-elementtosequence-monrwselt)
    - [`Eltseq(u): MonRWSElt → [ RngIntElt ]`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#function-eltseq-monrwselt)
    - [Example: Word Arithmetic in a Fibonacci Monoid](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/operation.md#example-ex-3c8630)
- [Homomorphisms](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/homomorphism.md)
  - [General Remarks](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/homomorphism.md#general-remarks)
  - [Construction of Homomorphisms](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/homomorphism.md#construction-of-homomorphisms)
    - [`hom< M -> N | S >: Struct, Struct → Map`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/homomorphism.md#constructor-constructor-hom-struct-struct-map)
- [Set Operations](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/Set.md)
  - [`Random(M, n): MonRWS, RngIntElt → MonRWSElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/Set.md#function-random-monrws-rngintelt)
  - [`Random(M): MonRWS → MonRWSElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/Set.md#function-random-monrws)
  - [`Representative(M): MonRWS → MonRWSElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/Set.md#function-representative-monrws)
  - [`Rep(M): MonRWS → MonRWSElt`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/Set.md#function-rep-monrws)
  - [`Set(M, a, b): MonRWS, RngIntElt, RngIntElt → SetEnum`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/Set.md#function-set-monrws-rngintelt-rngintelt)
  - [`Set(M): MonRWS → SetEnum`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/Set.md#function-set-monrws)
  - [`Seq(M, a, b): MonRWS, RngIntElt, RngIntElt → SeqEnum`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/Set.md#function-seq-monrws-rngintelt-rngintelt)
  - [`Seq(M): MonRWS → SeqEnum`](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/Set.md#function-seq-monrws)
  - [Example: Element Sets of a Rewrite Monoid](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/Set.md#example-ex-e2ec60)
- [Conversion to a Finitely Presented Monoid](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/conversion.md)
  - [Example: Converting a Rewrite Monoid to an FP-Monoid](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/conversion.md#example-ex-c939dc)
- [Bibliography](https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/MonoidsGivenByRewriteSystems/bibliography.md)
