  
  [1X52 [33X[0;0YMonoids[133X[101X
  
  [33X[0;0YThis  chapter  describes functions for monoids. Currently there are only few
  of  them.  More  general functions for magmas and semigroups can be found in
  Chapters [14X35[114X and [14X51[114X.[133X
  
  
  [1X52.1 [33X[0;0YFunctions for Monoids[133X[101X
  
  [1X52.1-1 IsMonoid[101X
  
  [29X[2XIsMonoid[102X( [3XD[103X ) [32X property
  
  [33X[0;0YA [13Xmonoid[113X is a magma-with-one (see [14X35[114X) with associative multiplication.[133X
  
  
  [1X52.1-2 [33X[0;0YMonoid[133X[101X
  
  [29X[2XMonoid[102X( [3Xgen1[103X, [3Xgen2[103X, [3X...[103X ) [32X function
  [29X[2XMonoid[102X( [3Xgens[103X[, [3Xid[103X] ) [32X function
  
  [33X[0;0YIn  the  first  form,  [2XMonoid[102X  returns the monoid generated by the arguments
  [3Xgen1[103X, [3Xgen2[103X, [22X...[122X, that is, the closure of these elements under multiplication
  and  taking  the  0-th  power. In the second form, [2XMonoid[102X returns the monoid
  generated  by  the elements in the homogeneous list [3Xgens[103X; a square matrix as
  only  argument  is treated as one generator, not as a list of generators. In
  the  second  form,  the  identity  element  [3Xid[103X  may  be  given as the second
  argument.[133X
  
  [33X[0;0YIt  is [13Xnot[113X checked whether the underlying multiplication is associative, use
  [2XMagmaWithOne[102X  ([14X35.2-2[114X)  and  [2XIsAssociative[102X  ([14X35.4-7[114X)  if  you  want to check
  whether a magma-with-one is in fact a monoid.[133X
  
  [1X52.1-3 Submonoid[101X
  
  [29X[2XSubmonoid[102X( [3XM[103X, [3Xgens[103X ) [32X function
  [29X[2XSubmonoidNC[102X( [3XM[103X, [3Xgens[103X ) [32X function
  
  [33X[0;0Yare   just   synonyms  of  [2XSubmagmaWithOne[102X  ([14X35.2-8[114X)  and  [2XSubmagmaWithOneNC[102X
  ([14X35.2-8[114X), respectively.[133X
  
  [1X52.1-4 MonoidByGenerators[101X
  
  [29X[2XMonoidByGenerators[102X( [3Xgens[103X[, [3Xone[103X] ) [32X operation
  
  [33X[0;0Yis the underlying operation of [2XMonoid[102X ([14X52.1-2[114X).[133X
  
  [1X52.1-5 AsMonoid[101X
  
  [29X[2XAsMonoid[102X( [3XC[103X ) [32X attribute
  
  [33X[0;0YIf  [3XC[103X  is  a collection whose elements form a monoid (see [2XIsMonoid[102X ([14X52.1-1[114X))
  then [2XAsMonoid[102X returns this monoid. Otherwise [9Xfail[109X is returned.[133X
  
  [1X52.1-6 AsSubmonoid[101X
  
  [29X[2XAsSubmonoid[102X( [3XD[103X, [3XC[103X ) [32X operation
  
  [33X[0;0YLet  [3XD[103X  be  a  domain and [3XC[103X a collection. If [3XC[103X is a subset of [3XD[103X that forms a
  monoid  then  [2XAsSubmonoid[102X returns this monoid, with parent [3XD[103X. Otherwise [9Xfail[109X
  is returned.[133X
  
  [1X52.1-7 GeneratorsOfMonoid[101X
  
  [29X[2XGeneratorsOfMonoid[102X( [3XM[103X ) [32X attribute
  
  [33X[0;0YMonoid  generators  of  a monoid [3XM[103X are the same as magma-with-one generators
  (see [2XGeneratorsOfMagmaWithOne[102X ([14X35.4-2[114X)).[133X
  
  [1X52.1-8 TrivialSubmonoid[101X
  
  [29X[2XTrivialSubmonoid[102X( [3XM[103X ) [32X attribute
  
  [33X[0;0Yis just a synonym for [2XTrivialSubmagmaWithOne[102X ([14X35.4-14[114X).[133X
  
  
  [1X52.1-9 [33X[0;0YFreeMonoid[133X[101X
  
  [29X[2XFreeMonoid[102X( [[3Xwfilt[103X, ][3Xrank[103X[, [3Xname[103X] ) [32X function
  [29X[2XFreeMonoid[102X( [[3Xwfilt[103X, ][3Xname1[103X, [3Xname2[103X, [3X...[103X ) [32X function
  [29X[2XFreeMonoid[102X( [[3Xwfilt[103X, ][3Xnames[103X ) [32X function
  [29X[2XFreeMonoid[102X( [[3Xwfilt[103X, ][3Xinfinity[103X, [3Xname[103X, [3Xinit[103X ) [32X function
  
  [33X[0;0YCalled  with  a  positive  integer [3Xrank[103X, [2XFreeMonoid[102X returns a free monoid on
  [3Xrank[103X  generators. If the optional argument [3Xname[103X is given then the generators
  are printed as [3Xname[103X[10X1[110X, [3Xname[103X[10X2[110X etc., that is, each name is the concatenation of
  the  string [3Xname[103X and an integer from [10X1[110X to [3Xrange[103X. The default for [3Xname[103X is the
  string [10X"m"[110X.[133X
  
  [33X[0;0YCalled  in  the  second  form,  [2XFreeMonoid[102X  returns a free monoid on as many
  generators as arguments, printed as [3Xname1[103X, [3Xname2[103X etc.[133X
  
  [33X[0;0YCalled  in  the  third  form,  [2XFreeMonoid[102X  returns  a free monoid on as many
  generators as the length of the list [3Xnames[103X, the [22Xi[122X-th generator being printed
  as [3Xnames[103X[10X[[110X[22Xi[122X[10X][110X.[133X
  
  [33X[0;0YCalled  in  the  fourth form, [2XFreeMonoid[102X returns a free monoid on infinitely
  many  generators, where the first generators are printed by the names in the
  list [3Xinit[103X, and the other generators by [3Xname[103X and an appended number.[133X
  
  [33X[0;0YIf    the   extra   argument   [3Xwfilt[103X   is   given,   it   must   be   either
  [2XIsSyllableWordsFamily[102X    ([14X37.6-6[114X)   or   [2XIsLetterWordsFamily[102X   ([14X37.6-2[114X)   or
  [2XIsWLetterWordsFamily[102X  ([14X37.6-4[114X) or [2XIsBLetterWordsFamily[102X ([14X37.6-4[114X). This filter
  then  specifies  the representation used for the elements of the free monoid
  (see [14X37.6[114X). If no such filter is given, a letter representation is used.[133X
  
  [33X[0;0YAlso see Chapter [14X52[114X.[133X
  
  [1X52.1-10 MonoidByMultiplicationTable[101X
  
  [29X[2XMonoidByMultiplicationTable[102X( [3XA[103X ) [32X function
  
  [33X[0;0Yreturns  the  monoid  whose multiplication is defined by the square matrix [3XA[103X
  (see [2XMagmaByMultiplicationTable[102X ([14X35.3-1[114X)) if such a monoid exists. Otherwise
  [9Xfail[109X is returned.[133X
  
