---
title: "Specification of a Presentation"
canonical: "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/FinitelyPresentedSemigroups/presentation.html"
source: "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/FinitelyPresentedSemigroups/presentation.md"
part: "Finitely Presented Groups"
chapter: "Finitely Presented Semigroups"
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": "Finitely Presented Semigroups", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/FinitelyPresentedSemigroups/index-finitely-presented-semigroups.md"}
prev: {"title": "Elementary Operators for Words", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/FinitelyPresentedSemigroups/operation.md"}
next: {"title": "Subsemigroups, Ideals, and Quotients", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/FinitelyPresentedSemigroups/subsemigroup-ideal-quotient.md"}
intrinsics:
  - {"name": "=", "signature": "w₁ = w₂: SgpFPElt, SgpFPElt -> Rel"}
  - {"name": "LHS", "signature": "LHS(r): Rel -> SgpFPElt"}
  - {"name": "RHS", "signature": "RHS(r): Rel -> SgpFPElt"}
  - {"name": "Semigroup", "signature": "Semigroup< generators | relations >: SgpFPElt, ..., SgpFPElt, Rel, ...Rel -> SgpFP"}
  - {"name": "Monoid", "signature": "Monoid< generators | relations >: MonFPElt, ..., MonFPElt, Rel, ..., Rel -> MonFP"}
  - {"name": ".", "signature": "S . i: SgpFP, RngIntElt -> SgpFPElt"}
  - {"name": "Generators", "signature": "Generators(S): SgpFP -> { SgpFPElt}"}
  - {"name": "NumberOfGenerators", "signature": "NumberOfGenerators(S): SgpFP -> RngIntElt"}
  - {"name": "Ngens", "signature": "Ngens(S): SgpFP -> RngIntElt"}
  - {"name": "Parent", "signature": "Parent(u): SgpFPElt -> SgpFP"}
  - {"name": "Relations", "signature": "Relations(S): SgpFP -> [ Rel ]"}
examples:
  - "ex-a36e1d"
---

# Specification of a Presentation

## Relations

<a id="operation-op-sgpfpelt-sgpfpelt"></a>
### `w₁ = w₂: SgpFPElt, SgpFPElt -> Rel`

Given words $w_1$ and $w_2$ over the generators of an fp-semigroup $S$, create the relation $w_1 = w_2$. Note that this relation is not automatically added to the existing set of defining relations $R$ for $S$. It may be added to $R$, for example, through use of the `quo`-constructor (see below).

<a id="function-lhs-rel"></a>
### `LHS(r): Rel -> SgpFPElt`

Given a relation $r$ over the generators of $S$, return the left hand side of the relation $r$. The object returned is a word over the generators of $S$.

<a id="function-rhs-rel"></a>
### `RHS(r): Rel -> SgpFPElt`

Given a relation $r$ over the generators of $S$, return the right hand side of the relation $r$. The object returned is a word over the generators of $S$.

## Presentations

A semigroup with non-trivial relations is constructed as a quotient of an existing semigroup, possibly a free semigroup.

<a id="constructor-constructor-semigroup-sgpfpelt-sgpfpelt-rel-rel-sgpfp"></a>
### `Semigroup< generators | relations >: SgpFPElt, ..., SgpFPElt, Rel, ...Rel -> SgpFP`

Given a clause consisting of a list of variables $x_1, \cdots, x_r$, and a set of relations over these generators, first construct the free semigroup $F$ on the generators $x_1, \cdots, x_r$ and then construct the quotient of $F$ corresponding to the ideal of $F$ defined by . The syntax for the clause is the same as for the `quo`-constructor. The function returns:

**(a)**
The quotient semigroup $S$;

**(b)**
The natural homomorphism $\phi : F \rightarrow S$.

Thus, the statement

```
    S< y₁, ..., yᵣ > := Semigroup< x₁, ..., xᵣ | w₁, ..., wₛ >;
```

is an abbreviation for

```
   F< x₁, ..., xᵣ > := FreeSemigroup(r);

   S< y₁, ..., yᵣ > := quo< F | w₁, ..., wₛ >;
```

<a id="constructor-constructor-monoid-monfpelt-monfpelt-rel-rel-monfp"></a>
### `Monoid< generators | relations >: MonFPElt, ..., MonFPElt, Rel, ..., Rel -> MonFP`

Given a clause consisting of a list of variables $x_1, \cdots, x_r$, and a set of relations over these generators, first construct the free monoid $F$ on the generators $x_1, \cdots, x_r$ and then construct the quotient of $F$ corresponding to the ideal of $F$ defined by . The syntax for the clause is the same as for the `quo`-constructor. The function returns:

**(a)**
The quotient monoid $M$;

**(b)**
The natural homomorphism $\phi : F \rightarrow M$.

Thus, the statement

```
    M< y1, ..., yr > := Monoid< x1, ..., xr | w1, ..., ws >;
```

is an abbreviation for

```
   F< x₁, ..., xᵣ > := FreeMonoid(r);

   M< y₁, ..., yᵣ > := quo< F | w₁, ..., wₛ >;
```

<a id="example-ex-a36e1d"></a>
### `Example: Finitely Presented Monoid (ex-a36e1d)`

We create the monoid defined by the presentation $< x, y\ |\ x^2, y^2, (xy)^2 >$.

```magma
> M<x,y> := Monoid< x, y | x^2, y^2, (x*y)^2 >;
> M;
Finitely presented monoid
Relations:
    x^2 = Id(M)
    y^2 = Id(M)
    (x * y)^2 = Id(M)
```

## Accessing the Defining Generators and Relations

The functions in this group provide access to basic information stored for a finitely-presented semigroup $G$.

<a id="operation-operation-sgpfp-rngintelt-sgpfpelt"></a>
### `S . i: SgpFP, RngIntElt -> SgpFPElt`

The $i$-th defining generator for $S$.

<a id="function-generators-sgpfp"></a>
### `Generators(S): SgpFP -> { SgpFPElt}`

A set containing the generators for $S$.

<a id="function-numberofgenerators-sgpfp"></a>
### `NumberOfGenerators(S): SgpFP -> RngIntElt`

<a id="function-ngens-sgpfp"></a>
### `Ngens(S): SgpFP -> RngIntElt`

The number of generators for $S$.

<a id="function-parent-sgpfpelt"></a>
### `Parent(u): SgpFPElt -> SgpFP`

The parent semigroup $S$ of the word $u$.

<a id="function-relations-sgpfp"></a>
### `Relations(S): SgpFP -> [ Rel ]`

A sequence containing the defining relations for $S$.
