File: fpsemi.gd

package info (click to toggle)
gap 4.15.1-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 110,212 kB
  • sloc: ansic: 97,261; xml: 48,343; cpp: 13,946; sh: 4,900; perl: 1,650; javascript: 255; makefile: 252; ruby: 9
file content (355 lines) | stat: -rw-r--r-- 11,862 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
#############################################################################
##
##  This file is part of GAP, a system for computational discrete algebra.
##  This file's authors include Andrew Solomon and Isabel Araújo.
##
##  Copyright of GAP belongs to its developers, whose names are too numerous
##  to list here. Please refer to the COPYRIGHT file for details.
##
##  SPDX-License-Identifier: GPL-2.0-or-later
##
##  This file contains the declarations for finitely
##  presented semigroups.

#############################################################################
##
#C  IsElementOfFpSemigroup(<elm>)
##
##  <#GAPDoc Label="IsElementOfFpSemigroup">
##  <ManSection>
##  <Filt Name="IsElementOfFpSemigroup" Arg='elm' Type='Category'/>
##  <Filt Name="IsElementOfFpMonoid" Arg='elm' Type='Category'/>
##
##  <Description>
##  returns true if <A>elm</A> is an element of a finitely presented
##  semigroup or monoid.
##  <P/>
##  <Example><![CDATA[
##  gap> f := FreeSemigroup( "a", "b" );;
##  gap> IsFpSemigroup( f );
##  false
##  gap> s := f / [ [ f.1^2, f.2^2 ] ];;
##  gap> IsFpSemigroup( s );
##  true
##  gap> t := Semigroup( [ s.1^2 ] );
##  <commutative semigroup with 1 generator>
##  gap> IsSubsemigroupFpSemigroup( t );
##  true
##  gap> IsSubsemigroupFpSemigroup( s );
##  true
##  gap> IsSubsemigroupFpSemigroup( f );
##  false
##  gap> IsElementOfFpSemigroup( t.1^3 );
##  true
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareCategory( "IsElementOfFpSemigroup",
    IsMultiplicativeElement and IsAssociativeElement );

#############################################################################
##
#O  FpSemigroupOfElementOfFpSemigroup( <elm> )
##
##  <ManSection>
##  <Oper Name="FpSemigroupOfElementOfFpSemigroup" Arg='elm'/>
##
##  <Description>
##  returns the finitely presented semigroup to which <A>elm</A> belongs to
##  </Description>
##  </ManSection>
##
DeclareOperation( "FpSemigroupOfElementOfFpSemigroup",
[IsElementOfFpSemigroup]);

#############################################################################
##
#C  IsElementOfFpSemigroupCollection(<e>)
##
##  <ManSection>
##  <Filt Name="IsElementOfFpSemigroupCollection" Arg='e' Type='Category'/>
##
##  <Description>
##  Created now so that lists of things in the category IsElementOfFpSemigroup
##  are given the category CategoryCollections(IsElementOfFpSemigroup)
##  Otherwise these lists (and other collections) won't create the
##  collections category. See CollectionsCategory in the manual.
##  </Description>
##  </ManSection>
##
DeclareCategoryCollections("IsElementOfFpSemigroup");

#############################################################################
##
#A  IsSubsemigroupFpSemigroup( <t> )
##
##  <#GAPDoc Label="IsSubsemigroupFpSemigroup">
##  <ManSection>
##  <Filt Name="IsSubsemigroupFpSemigroup" Arg='t'/>
##  <Filt Name="IsSubmonoidFpMonoid" Arg='t'/>
##
##  <Description>
##  The first function returns true if <A>t</A> is a finitely presented
##  semigroup or a subsemigroup of a finitely presented semigroup.
##  The second function does the equivalent thing for monoids.
##  (Generally speaking, such a subsemigroup or monoid can be constructed
##  with <C>Semigroup(<A>gens</A>)</C> or <C>Monoid(<A>gens</A>)</C>,
##  where <A>gens</A> is a list of elements
##  of a finitely presented semigroup or monoid.)
##  <P/>
##  A submonoid of a monoid has the same identity as the monoid.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareSynonymAttr( "IsSubsemigroupFpSemigroup",
    IsSemigroup and IsElementOfFpSemigroupCollection );

#############################################################################
##
#C  IsElementOfFpSemigroupFamily
##
##  <ManSection>
##  <Filt Name="IsElementOfFpSemigroupFamily" Arg='obj' Type='Category'/>
##
##  <Description>
##  </Description>
##  </ManSection>
##
DeclareCategoryFamily( "IsElementOfFpSemigroup" );

#############################################################################
##
#F  FactorFreeSemigroupByRelations( <f>, <rels> )
#F  FactorFreeMonoidByRelations( <f>, <rels> )
##
##  <#GAPDoc Label="FactorFreeSemigroupByRelations">
##  <ManSection>
##  <Func Name="FactorFreeSemigroupByRelations" Arg='f, rels'/>
##  <Func Name="FactorFreeMonoidByRelations" Arg='f, rels'/>
##
##  <Description>
##  for a free semigroup or free monoid <A>f</A>
##  and a list <A>rels</A> of pairs of elements of <A>f</A>.
##  Returns the finitely presented semigroup or monoid
##  which is the quotient of <A>f</A> by the least congruence on <A>f</A>
##  generated by the pairs in <A>rels</A>.
##  <P/>
##  Users should be aware that much of the code described in this chapter
##  is in need of substantial revision.
##  In particular, the two functions described here are <E>not</E>
##  called by the operation <C>\/</C> of the previous subsection,
##  and so are liable to be removed in due course.
##  <P/>
##  <Example><![CDATA[
##  gap> fm := FreeMonoid( 3 );;
##  gap> y := GeneratorsOfMonoid( fm );;
##  gap> m := FactorFreeMonoidByRelations( fm,
##  >           [ [ y[1] * y[2] * y[1], y[1] ],[ y[2]^4, y[1] ] ] );
##  <fp monoid on the generators [ m1, m2, m3 ]>
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareGlobalFunction("FactorFreeSemigroupByRelations");

#############################################################################
##
#O  ElementOfFpSemigroup( <fam>, <word> )
#O  ElementOfFpMonoid( <fam>, <word> )
##
##  <#GAPDoc Label="ElementOfFpSemigroup">
##  <ManSection>
##  <Oper Name="ElementOfFpSemigroup" Arg='fam, word'/>
##  <Oper Name="ElementOfFpMonoid" Arg='fam, word'/>
##
##  <Description>
##  for a family <A>fam</A> of elements of a finitely presented semigroup
##  or monoid and a word <A>word</A> in the free generators underlying this
##  finitely presented semigroup or monoid.
##  Returns the element of the finitely presented semigroup or monoid
##  with the representative <A>word</A> in the free semigroup or free monoid.
##  These operations are inverse to <C>UnderlyingElement</C>.
##  <P/>
##  <Example><![CDATA[
##  gap> fam := FamilyObj( genm[1] );;
##  gap> w := y[1]^3 * y[2]^4 * y[3]^5;
##  m1^3*m2^4*m3^5
##  gap> ew := ElementOfFpMonoid( fam, w );
##  m1^3*m2^4*m3^5
##  gap> ew in fm;
##  false
##  gap> ew in m;
##  true
##  gap> w = UnderlyingElement( ew );
##  true
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareOperation( "ElementOfFpSemigroup",
    [ IsElementOfFpSemigroupFamily, IsAssocWord ] );

#############################################################################
##
#P  IsFpSemigroup(<s>)
##
##  <#GAPDoc Label="IsFpSemigroup">
##  <ManSection>
##  <Filt Name="IsFpSemigroup" Arg='s'/>
##  <Filt Name="IsFpMonoid" Arg='m'/>
##
##  <Description>
##  The first function is a synonym for
##  <C>IsSubsemigroupFpSemigroup(<A>s</A>)</C> and
##  <C>IsWholeFamily(<A>s</A>)</C> (this is because a subsemigroup
##  of a finitely presented semigroup is not necessarily finitely presented).
##  <P/>
##  Similarly, the second function is a synonym for
##  <C>IsSubmonoidFpMonoid(<A>m</A>)</C> and <C>IsWholeFamily(<A>m</A>)</C>.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareSynonym( "IsFpSemigroup",IsSubsemigroupFpSemigroup and IsWholeFamily);

#############################################################################
##
#A  FreeGeneratorsOfFpSemigroup( <s> )
#A  FreeGeneratorsOfFpMonoid( <m> )
##
##  <#GAPDoc Label="FreeGeneratorsOfFpSemigroup">
##  <ManSection>
##  <Attr Name="FreeGeneratorsOfFpSemigroup" Arg='s'/>
##  <Attr Name="FreeGeneratorsOfFpMonoid" Arg='m'/>
##
##  <Description>
##  returns the underlying free generators corresponding to the generators of
##  the finitely presented semigroup <A>s</A> or monoid <A>m</A>.
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareAttribute("FreeGeneratorsOfFpSemigroup",  IsFpSemigroup );

#############################################################################
##
#A  FreeSemigroupOfFpSemigroup( <s> )
#A  FreeMonoidOfFpMonoid( <m> )
##
##  <#GAPDoc Label="FreeSemigroupOfFpSemigroup">
##  <ManSection>
##  <Attr Name="FreeSemigroupOfFpSemigroup" Arg='s'/>
##  <Attr Name="FreeMonoidOfFpMonoid" Arg='m'/>
##
##  <Description>
##  returns the underlying free semigroup or free monoid
##  for the finitely presented semigroup <A>s</A> or monoid <A>m</A>,
##  i.e. the free semigroup or free monoid over which <A>s</A> or <A>m</A>
##  is defined as a quotient.
##  (This is the free semigroup or free monoid generated by the free generators
##  provided by <C>FreeGeneratorsOfFpSemigroup(<A>s</A>)</C>
##  or <C>FreeGeneratorsOfFpMonoid(<A>m</A>)</C>).
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareAttribute("FreeSemigroupOfFpSemigroup", IsFpSemigroup);

############################################################################
##
#A  RelationsOfFpSemigroup(<s>)
#A  RelationsOfFpMonoid(<m>)
##
##  <#GAPDoc Label="RelationsOfFpSemigroup">
##  <ManSection>
##  <Attr Name="RelationsOfFpSemigroup" Arg='s'/>
##  <Attr Name="RelationsOfFpMonoid" Arg='m'/>
##
##  <Description>
##  returns the relations of the finitely presented semigroup <A>s</A>
##  or monoid <A>m</A> as pairs of words in the free generators provided by
##  <C>FreeGeneratorsOfFpSemigroup(<A>s</A>)</C> or
##  <C>FreeGeneratorsOfFpMonoid(<A>m</A>)</C>.
##  <P/>
##  <Example><![CDATA[
##  gap> fs = FreeSemigroupOfFpSemigroup( s );
##  true
##  gap> FreeGeneratorsOfFpMonoid( m );
##  [ m1, m2, m3 ]
##  gap> RelationsOfFpSemigroup( s );
##  [ [ s1*s2*s1, s1 ], [ s2^4, s1 ] ]
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareAttribute("RelationsOfFpSemigroup",IsFpSemigroup);

############################################################################
##
#A  IsomorphismFpSemigroup( <m> )
#A  IsomorphismFpMonoid( <g> )
##
##  <#GAPDoc Label="IsomorphismFpSemigroup">
##  <ManSection>
##  <Attr Name="IsomorphismFpSemigroup" Arg='m'/>
##  <Attr Name="IsomorphismFpMonoid" Arg='g'/>
##
##  <Description>
##  for a finitely presented monoid <A>m</A>
##  or a finitely presented group <A>g</A>.
##  Returns an isomorphism from <A>m</A> or <A>g</A>
##  to a finitely presented semigroup or monoid.
##  <P/>
##  <Example><![CDATA[
##  gap> phis := IsomorphismFpSemigroup( m );
##  MappingByFunction( <fp monoid on the generators
##  [ m1, m2, m3 ]>, <fp semigroup on the generators [ <identity ...>, m1, m2, m3
##   ]>, function( x ) ... end, function( x ) ... end )
##  gap> fg := FreeGroup( 2 );;
##  gap> g := fg / [ fg.1^4, fg.2^5 ];
##  <fp group on the generators [ f1, f2 ]>
##  gap> phim := IsomorphismFpMonoid( g );
##  MappingByFunction( <fp group on the generators
##  [ f1, f2 ]>, <fp monoid on the generators [ f1, f1^-1, f2, f2^-1
##   ]>, function( x ) ... end, function( x ) ... end )
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareAttribute("IsomorphismFpSemigroup",IsSemigroup);

############################################################################
##
#O  FpGrpMonSmgOfFpGrpMonSmgElement( <elm> )
##
##  <#GAPDoc Label="FpGrpMonSmgOfFpGrpMonSmgElement">
##  <ManSection>
##  <Oper Name="FpGrpMonSmgOfFpGrpMonSmgElement" Arg='elm'/>
##
##  <Description>
##  returns the finitely presented group, monoid or semigroup to which
##  <A>elm</A> belongs.
##  <P/>
##  <Example><![CDATA[
##  gap> s = FpGrpMonSmgOfFpGrpMonSmgElement( s.1 );
##  true
##  gap> s = FpGrpMonSmgOfFpGrpMonSmgElement( t.1 );
##  true
##  gap> f := FreeMonoid( 2 );;
##  gap> m := f / [ [ f.1^2, f.2^2 ] ];
##  <fp monoid on the generators [ m1, m2 ]>
##  gap> m = FpGrpMonSmgOfFpGrpMonSmgElement( m.1 * m.2 );
##  true
##  ]]></Example>
##  </Description>
##  </ManSection>
##  <#/GAPDoc>
##
DeclareOperation("FpGrpMonSmgOfFpGrpMonSmgElement",[IsMultiplicativeElement]);