<h3>11 <span class="Heading">
Attributes and operations for semigroups
</span></h3>
<p>In this chapter we describe the methods that are available in <strong class="pkg">Semigroups</strong> for determining the attributes of a semigroup, and the operations which can be applied to a semigroup.</p>
<p>When the argument <var class="Arg">S</var> is a semigroup satisfying <code class="func">CanUseFroidurePin</code> (<a href="chap6_mj.html#X7FEE8CFA87E7B872"><span class="RefLink">6.1-4</span></a>), <code class="code">AsListCanonical</code> returns a list of the elements of <var class="Arg">S</var> in the order they are enumerated by the Froidure-Pin Algorithm. This is the same as the order used to index the elements of <var class="Arg">S</var> in <code class="func">RightCayleyDigraph</code> (<a href="chap11_mj.html#X7EA002E27B10CCE0"><span class="RefLink">11.2-1</span></a>) and <code class="func">LeftCayleyDigraph</code> (<a href="chap11_mj.html#X7EA002E27B10CCE0"><span class="RefLink">11.2-1</span></a>).</p>
<p><code class="code">EnumeratorCanonical</code> and <code class="code">IteratorCanonical</code> return an enumerator and an iterator where the elements are ordered in the same way as <code class="code">AsListCanonical</code>. Using <code class="code">EnumeratorCanonical</code> or <code class="code">IteratorCanonical</code> will often use less memory than <code class="code">AsListCanonical</code>, but may have slightly worse performance if the elements of the semigroup are looped over repeatedly. <code class="code">EnumeratorCanonical</code> returns the same list as <code class="code">AsListCanonical</code> if <code class="code">AsListCanonical</code> has ever been called for <var class="Arg">S</var>.</p>
<p>If <var class="Arg">S</var> is an acting semigroup, then the value returned by <code class="code">AsList</code> may not equal the value returned by <code class="code">AsListCanonical</code>. <codeclass="code">AsListCanonical</code> exists so that there is a method for obtaining the elements of <var class="Arg">S</var> in the particular order used by <code class="func">RightCayleyDigraph</code> (<a href="chap11_mj.html#X7EA002E27B10CCE0"><span class="RefLink">11.2-1</span></a>) and <code class="func">LeftCayleyDigraph</code> (<a href="chap11_mj.html#X7EA002E27B10CCE0"><span class="RefLink">11.2-1</span></a>).</p>
<p>See also <code class="func">PositionCanonical</code> (<a href="chap11_mj.html#X7B4B10AE81602D4E"><span class="RefLink">11.1-2</span></a>).</p>
<p>When the argument <var class="Arg">S</var> is a semigroup satisfying <code class="func">CanUseFroidurePin</code> (<a href="chap6_mj.html#X7FEE8CFA87E7B872"><span class="RefLink">6.1-4</span></a>) and <var class="Arg">x</var> is an element of <var class="Arg">S</var>, <code class="code">PositionCanonical</code> returns the position of <var class="Arg">x</var> in <code class="code">AsListCanonical(<var class="Arg">S</var>)</code> or equivalently the position of <var class="Arg">x</var> in <code class="code">EnumeratorCanonical(<var class="Arg">S</var>)</code>.</p>
<p>See also <code class="func">AsListCanonical</code> (<a href="chap11_mj.html#X7AC3FAA5826516AD"><span class="RefLink">11.1-1</span></a>) and <code class="func">EnumeratorCanonical</code> (<a href="chap11_mj.html#X7AC3FAA5826516AD"><span class="RefLink">11.1-1</span></a>).</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Enumerate</code>( <var class="Arg">S</var>[, <var class="Arg">limit</var>] )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: A semigroup (the argument).</p>
<p>If <var class="Arg">S</var> is a semigroup with representation <code class="func">CanUseFroidurePin</code> (<a href="chap6_mj.html#X7FEE8CFA87E7B872"><span class="RefLink">6.1-4</span></a>) and <var class="Arg">limit</var> is a positive integer, then this operation can be used to enumerate at least <var class="Arg">limit</var> elements of <var class="Arg">S</var>, or <code class="code">Size(<var class="Arg">S</var>)</code> elements if this is less than <var class="Arg">limit</var>, using the Froidure-Pin Algorithm.</p>
<p>If the optional second argument <var class="Arg">limit</var> is not given, then the semigroup is enumerated until all of its elements have been found.</p>
<p>If <var class="Arg">S</var> is a semigroup with representation <code class="func">CanUseFroidurePin</code> (<a href="chap6_mj.html#X7FEE8CFA87E7B872"><span class="RefLink">6.1-4</span></a>), then this operation returns <code class="keyw">true</code> if the Froidure-Pin Algorithm has been run to completion (i.e. all of the elements of <var class="Arg">S</var> have been found) and <codeclass="keyw">false</code> if <var class="Arg">S</var> has not been fully enumerated.</p>
<p>When the argument <var class="Arg">S</var> is a semigroup satisfying <code class="func">CanUseFroidurePin</code> (<a href="chap6_mj.html#X7FEE8CFA87E7B872"><span class="RefLink">6.1-4</span></a>), <code class="code">RightCayleyDigraph</code> returns the right Cayley graph of <var class="Arg">S</var>, as a <code class="func">Digraph</code> (<a href="https://gap-packages.github.io/io/doc/chap3_mj.html#X834843057CE86655"><span class="RefLink">Digraphs: Digraph</span></a>) <code class="code">digraph</code> where vertex <code class="code">OutNeighbours(digraph)[i][j]</code> is <code class="code">PositionCanonical(<var class="Arg">S</var>, AsListCanonical(<var class="Arg">S</var>)[i] * GeneratorsOfSemigroup(<var class="Arg">S</var>)[j])</code>. The digraph returned by <code class="code">LeftCayleyDigraph</code> is defined analogously.</p>
<p>The digraph returned by this attribute belongs to the category <code class="func">IsCayleyDigraph</code> (<a href="https://gap-packages.github.io/io/doc/chap3_mj.html#X7E749324800B38A5"><span class="RefLink">Digraphs: IsCayleyDigraph</span></a>), the semigroup <var class="Arg">S</var> and the generators used to create the digraph can be recovered from the digraph using <code class="func">SemigroupOfCayleyDigraph</code> (<a href="https://gap-packages.github.io/io/doc/chap5_mj.html#X7A000B1D7CCF7093"><span class="RefLink">Digraphs: SemigroupOfCayleyDigraph</span></a>) and <code class="func">GeneratorsOfCayleyDigraph</code> (<a href="https://gap-packages.github.io/io/doc/chap5_mj.html#X8528455987D7D2BF"><span class="RefLink">Digraphs: GeneratorsOfCayleyDigraph</span></a>).</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Random</code>( <var class="Arg">S</var> )</td><td class="tdright">( method )</td></tr></table></div>
<p>Returns: A random element.</p>
<p>This function returns a random element of the semigroup <var class="Arg">S</var>. If the elements of <var class="Arg">S</var> have been calculated, then one of these is chosen randomly. Otherwise, if the data structure for <var class="Arg">S</var> is known, then a random element of a randomly chosen \(\mathscr{R}\)-class is returned. If the data structure for <var class="Arg">S</var> has not been calculated, then a short product (at most <code class="code">2 * Length(GeneratorsOfSemigroup(<var class="Arg">S</var>))</code>) of generators is returned.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IndexPeriodOfSemigroupElement</code>( <var class="Arg">x</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: A list of two positive integers.</p>
<p>If <var class="Arg">x</var> is a semigroup element, then <code class="code">IndexPeriodOfSemigroupElement(<var class="Arg">x</var>)</code> returns the pair <code class="code">[m, r]</code>, where <code class="code">m</code> and <code class="code">r</code> are the least positive integers such that <code class="code"><var class="Arg">x</var>^(m + r) = <var class="Arg">x</var> ^ m</code>. The number <code class="code">m</code> is known as the <em>index</em> of <var class="Arg">x</var>, and the number<code class="code">r</code> is known as the <em>period</em> of <var class="Arg">x</var>.</p>
<p>If <var class="Arg">x</var> is a semigroup element, then <code class="code">SmallestIdempotentPower(<var class="Arg">x</var>)</code> returns the least positive integer <code class="code">n</code> such that <code class="code"><var class="Arg">x</var>^n</code> is an idempotent. The smallest idempotent power of <var class="Arg">x</var> is the least multiple of the period of <var class="Arg">x</var> that is greater than or equal to the index of <var class="Arg">x</var>; see <code class="func">IndexPeriodOfSemigroupElement</code> (<a href="chap11_mj.html#X869AC4247E2BA4A2"><span class="RefLink">11.4-1</span></a>).</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ OneInverseOfSemigroupElement</code>( <var class="Arg">S</var>, <var class="Arg">x</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: One inverse of an element of a semigroup.</p>
<p><code class="code">OneInverseOfSemigroupElement</code> returns one inverse of the element <code class="code">x</code> in the semigroup <var class="Arg">S</var> and returns fail if this element has no inverse in <var class="Arg">S</var>. <var class="Arg">x</var> in the semigroup <var class="Arg">S</var>.</p>
<h4>11.6 <span class="Heading">
Expressing semigroup elements as words in generators
</span></h4>
<p>It is possible to express an element of a semigroup as a word in the generators of that semigroup. This section describes how to accomplish this in <strong class="pkg">Semigroups</strong>.</p>
<p>The argument <var class="Arg">gens</var> should be a collection of generators of a semigroup and the argument <var class="Arg">w</var> should be a list of positive integers less than or equal to the length of <var class="Arg">gens</var>. This operation evaluates the word <var class="Arg">w</var> in the generators <var class="Arg">gens</var>. More precisely, <code class="code">EvaluateWord(<var class="Arg">gens</var>, <var class="Arg">w</var>)</code> returns the equivalent of:</p>
<div class="example"><pre>Product(List(w, i -> gens[i]));</pre></div>
<p>see also <code class="func">Factorization</code> (<a href="chap11_mj.html#X8357294D7B164106"><span class="RefLink">11.6-2</span></a>).</p>
<dl>
<dt><strong class="Mark">for elements of a semigroup</strong></dt>
<dd><p>When <var class="Arg">gens</var> is a list of elements of a semigroup and <var class="Arg">w</var> is a list of positive integers less than or equal to the length of <var class="Arg">gens</var>, this operation returns the product <code class="code">gens[w[1]] * gens[w[2]] * .. . * gens[w[n]]</code> when the length of <var class="Arg">w</var> is <code class="code">n</code>.</p>
</dd>
<dt><strong class="Mark">for elements of an inverse semigroup</strong></dt>
<dd><p>When <var class="Arg">gens</var> is a list of elements with a semigroup inverse and <var class="Arg">w</var> is a list of non-zero integers whose absolute value does not exceed the length of <var class="Arg">gens</var>, this operation returns the product <code class="code">gens[AbsInt(w[1])] ^ SignInt(w[1]) * .. . * gens[AbsInt(w[n])] ^ SignInt(w[n])</code> where <code class="code">n</code> is the length of <var class="Arg">w</var>.</p>
</dd>
</dl>
<p>Note that <code class="code">EvaluateWord(<var class="Arg">gens</var>, [])</code> returns <codeclass="code">One(<var class="Arg">gens</var>)</code> if <var class="Arg">gens</var> belongs to the category <code class="func">IsMultiplicativeElementWithOne</code> (<a href="../../../doc/ref/chap31_mj.html#X82BC294F7D388AE8"><span class="RefLink">Reference: IsMultiplicativeElementWithOne</span></a>).</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Factorization</code>( <var class="Arg">S</var>, <var class="Arg">x</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: A word in the generators.</p>
<dl>
<dt><strong class="Mark">for semigroups</strong></dt>
<dd><p>When <var class="Arg">S</var> is a semigroup and <var class="Arg">x</var> belongs to <var class="Arg">S</var>, <code class="code">Factorization</code> return a word in the generators of <var class="Arg">S</var> that is equal to <var class="Arg">x</var>. In this case, a word is a list of positive integers where an entry <code class="code">i</code> corresponds to <code class="code">GeneratorsOfSemigroups(S)[i]</code>. More specifically,</p>
</dd>
<dt><strong class="Mark">for inverse semigroups</strong></dt>
<dd><p>When <var class="Arg">S</var> is an inverse semigroup and <var class="Arg">x</var> belongs to <varclass="Arg">S</var>, <code class="code">Factorization</code> return a word in the generators of <var class="Arg">S</var> that is equal to <var class="Arg">x</var>. In this case, a word is a list of non-zero integers where an entry <code class="code">i</code> corresponds to <code class="code">GeneratorsOfSemigroup(S)[i]</code> and <code class="code">-i</code> corresponds to <code class="code">GeneratorsOfSemigroup(S)[i] ^ -1</code>. As in the previous case,</p>
</dd>
</dl>
<p>Note that <code class="code">Factorization</code> does not always return a word of minimum length; see <code class="func">MinimalFactorization</code> (<a href="chap11_mj.html#X83A4D71382C5B6C3"><span class="RefLink">11.6-3</span></a>).</p>
<p>See also <code class="func">EvaluateWord</code> (<a href="chap11_mj.html#X799D2F3C866B9AED"><span class="RefLink">11.6-1</span></a>) and <code class="func">GeneratorsOfSemigroup</code> (<a href="../../../doc/ref/chap51_mj.html#X78147A247963F23B"><span class="RefLink">Reference: GeneratorsOfSemigroup</span></a>).</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ MinimalFactorization</code>( <var class="Arg">S</var>, <var class="Arg">x</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: A minimal word in the generators.</p>
<p>This operation returns a minimal length word in the generators of the semigroup <var class="Arg">S</var> that equals the element <var class="Arg">x</var>. In this case, a word is a list of positive integers where an entry <code class="code">i</code> corresponds to <code class="code">GeneratorsOfSemigroups(<var class="Arg">S</var>)[i]</code>. More specifically,</p>
<p><code class="code">MinimalFactorization</code> involves exhaustively enumerating <var class="Arg">S</var> until the element <var class="Arg">x</var> is found, and so <code class="code">MinimalFactorization</code> may be less efficient than <code class="func">Factorization</code> (<a href="chap11_mj.html#X8357294D7B164106"><span class="RefLink">11.6-2</span></a>) for some semigroups.</p>
<p>Unlike <code class="func">Factorization</code> (<a href="chap11_mj.html#X8357294D7B164106"><span class="RefLink">11.6-2</span></a>) this operation does not distinguish between semigroups and inverse semigroups. See also <code class="func">EvaluateWord</code> (<a href="chap11_mj.html#X799D2F3C866B9AED"><span class="RefLink">11.6-1</span></a>) and <code class="func">GeneratorsOfSemigroup</code> (<a href="../../../doc/ref/chap51_mj.html#X78147A247963F23B"><span class="RefLink">Reference: GeneratorsOfSemigroup</span></a>).</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ NonTrivialFactorization</code>( <var class="Arg">S</var>, <var class="Arg">x</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: A non-trivial word in the generators, or <code class="keyw">fail</code>.</p>
<p>When <var class="Arg">S</var> is a semigroup and <var class="Arg">x</var> belongs to <var class="Arg">S</var>, this operation returns a non-trivial word in the generators of the semigroup <var class="Arg">S</var> that equals <var class="Arg">x</var>, if one exists. The definition of a word in the generators is the same as given in <code class="func">Factorization</code> (<a href="chap11_mj.html#X8357294D7B164106"><span class="RefLink">11.6-2</span></a>) for semigroups and inverse semigroups. A word is non-trivial if it has length two or more.</p>
<p>If no non-trivial word for <var class="Arg">x</var> exists, then <var class="Arg">x</var> is an indecomposable element of <var class="Arg">S</var> and this operation returns <code class="keyw">fail</code>; see <code class="func">IndecomposableElements</code> (<a href="chap11_mj.html#X7B4CD8937858A895"><span class="RefLink">11.7-6</span></a>).</p>
<p>When <var class="Arg">x</var> does not belong to <code class="code">GeneratorsOfSemigroup(<varclass="Arg">S</var>)</code>, any factorization of <var class="Arg">x</var> is non-trivial. In this case, <code class="code">NonTrivialFactorization</code> returns the same word as <code class="func">Factorization</code> (<a href="chap11_mj.html#X8357294D7B164106"><span class="RefLink">11.6-2</span></a>).</p>
<p>See also <code class="func">EvaluateWord</code> (<a href="chap11_mj.html#X799D2F3C866B9AED"><span class="RefLink">11.6-1</span></a>) and <code class="func">GeneratorsOfSemigroup</code> (<a href="../../../doc/ref/chap51_mj.html#X78147A247963F23B"><span class="RefLink">Reference: GeneratorsOfSemigroup</span></a>).</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Generators</code>( <var class="Arg">S</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: A list of generators.</p>
<p><code class="code">Generators</code> returns a generating set that can be used to define the semigroup <var class="Arg">S</var>. The generators of a monoid or inverse semigroup <var class="Arg">S</var>, say, can be defined in several ways, for example, including or excluding the identity element, including or not the inverses of the generators. <code class="code">Generators</code> uses the definition that returns the least number of generators. If no generating set for <var class="Arg">S</var> is known, then <code class="code">GeneratorsOfSemigroup</code> is used by default.</p>
<dl>
<dt><strong class="Mark">for a group</strong></dt>
<dd><p><code class="code">Generators(<var class="Arg">S</var>)</code> is a synonym for <code class="func">GeneratorsOfGroup</code> (<a href="../../../doc/ref/chap39_mj.html#X79C44528864044C5"><span class="RefLink">Reference: GeneratorsOfGroup</span></a>).</p>
</dd>
<dt><strong class="Mark">for an ideal of semigroup</strong></dt>
<dd><p><code class="code">Generators(<var class="Arg">S</var>)</code> is a synonym for <code class="func">GeneratorsOfSemigroupIdeal</code> (<a href="chap9_mj.html#X87BB45DB844D41BC"><span class="RefLink">9.2-1</span></a>).</p>
</dd>
<dt><strong class="Mark">for a semigroup</strong></dt>
<dd><p><code class="code">Generators(<var class="Arg">S</var>)</code> is a synonym for <code class="func">GeneratorsOfSemigroup</code> (<a href="../../../doc/ref/chap51_mj.html#X78147A247963F23B"><span class="RefLink">Reference: GeneratorsOfSemigroup</span></a>).</p>
</dd>
<dt><strong class="Mark">for a monoid</strong></dt>
<dd><p><code class="code">Generators(<var class="Arg">S</var>)</code> is a synonym for <code class="func">GeneratorsOfMonoid</code> (<a href="../../../doc/ref/chap51_mj.html#X83CA2E7279C44718"><span class="RefLink">Reference: GeneratorsOfMonoid</span></a>).</p>
</dd>
<dt><strong class="Mark">for an inverse semigroup</strong></dt>
<dd><p><code class="code">Generators(<var class="Arg">S</var>)</code> is a synonym for <code class="func">GeneratorsOfInverseSemigroup</code> (<a href="../../../doc/ref/chap51_mj.html#X87C373597F787250"><span class="RefLink">Reference: GeneratorsOfInverseSemigroup</span></a>).</p>
</dd>
<dt><strong class="Mark">for an inverse monoid</strong></dt>
<dd><p><code class="code">Generators(<var class="Arg">S</var>)</code> is a synonym for <code class="func">GeneratorsOfInverseMonoid</code> (<a href="../../../doc/ref/chap51_mj.html#X7A3B262C85B6D475"><span class="RefLink">Reference: GeneratorsOfInverseMonoid</span></a>).</p>
<p>The attributes <code class="code">SmallXGeneratingSet</code> return a relatively small generating subset of the collection of elements <var class="Arg">coll</var>, which can also be a semigroup. The returned value of <code class="code">SmallXGeneratingSet</code>, where applicable, has the property that</p>
<p>where <code class="code">X</code> is any of <code class="func">Semigroup</code> (<a href="../../../doc/ref/chap51_mj.html#X7F55D28F819B2817"><span class="RefLink">Reference: Semigroup</span></a>), <code class="func">Monoid</code> (<a href="../../../doc/ref/chap51_mj.html#X7F95328B7C7E49EA"><span class="RefLink">Reference: Monoid</span></a>), <code class="func">InverseSemigroup</code> (<a href="../../../doc/ref/chap51_mj.html#X78B13FED7AFB4326"><span class="RefLink">Reference: InverseSemigroup</span></a>), or <code class="func">InverseMonoid</code> (<a href="../../../doc/ref/chap51_mj.html#X80D9B9A98736051B"><span class="RefLink">Reference: InverseMonoid</span></a>).</p>
<p>If the number of generators for <var class="Arg">S</var> is already relatively small, then these functions will often return the original generating set. These functions may return different results in different <strong class="pkg">GAP</strong> sessions.</p>
<p><code class="code">SmallGeneratingSet</code> returns the smallest of the returned values of <code class="code">SmallXGeneratingSet</code> which is applicable to <var class="Arg">coll</var>; see <code class="func">Generators</code> (<a href="chap11_mj.html#X7BD5B55C802805B4"><span class="RefLink">11.7-1</span></a>).</p>
<p>As neither irredundancy, nor minimal length are proven, these functions usually return an answer much more quickly than <code class="func">IrredundantGeneratingSubset</code> (<a href="chap11_mj.html#X7F88DA9487720D2B"><span class="RefLink">11.7-3</span></a>). These functions can be used whenever a small generating set is desired which does not necessarily needs to be minimal.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IrredundantGeneratingSubset</code>( <var class="Arg">coll</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: A list of irredundant generators.</p>
<p>If <var class="Arg">coll</var> is a collection of elements of a semigroup, then this function returns a subset <code class="code">U</code> of <var class="Arg">coll</var> such that no element of <code class="code">U</code> is generated by the other elements of <code class="code">U</code>.</p>
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.