This file is indexed.

/usr/share/gap/doc/ref/chap35.html is in gap-doc 4r8p8-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>GAP (ref) - Chapter 35: Magmas</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="GAPDoc2HTML" />
<link rel="stylesheet" type="text/css" href="manual.css" />
<script src="manual.js" type="text/javascript"></script>
<script type="text/javascript">overwriteStyle();</script>
</head>
<body class="chap35"  onload="jscontent()">


<div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chap7.html">7</a>  <a href="chap8.html">8</a>  <a href="chap9.html">9</a>  <a href="chap10.html">10</a>  <a href="chap11.html">11</a>  <a href="chap12.html">12</a>  <a href="chap13.html">13</a>  <a href="chap14.html">14</a>  <a href="chap15.html">15</a>  <a href="chap16.html">16</a>  <a href="chap17.html">17</a>  <a href="chap18.html">18</a>  <a href="chap19.html">19</a>  <a href="chap20.html">20</a>  <a href="chap21.html">21</a>  <a href="chap22.html">22</a>  <a href="chap23.html">23</a>  <a href="chap24.html">24</a>  <a href="chap25.html">25</a>  <a href="chap26.html">26</a>  <a href="chap27.html">27</a>  <a href="chap28.html">28</a>  <a href="chap29.html">29</a>  <a href="chap30.html">30</a>  <a href="chap31.html">31</a>  <a href="chap32.html">32</a>  <a href="chap33.html">33</a>  <a href="chap34.html">34</a>  <a href="chap35.html">35</a>  <a href="chap36.html">36</a>  <a href="chap37.html">37</a>  <a href="chap38.html">38</a>  <a href="chap39.html">39</a>  <a href="chap40.html">40</a>  <a href="chap41.html">41</a>  <a href="chap42.html">42</a>  <a href="chap43.html">43</a>  <a href="chap44.html">44</a>  <a href="chap45.html">45</a>  <a href="chap46.html">46</a>  <a href="chap47.html">47</a>  <a href="chap48.html">48</a>  <a href="chap49.html">49</a>  <a href="chap50.html">50</a>  <a href="chap51.html">51</a>  <a href="chap52.html">52</a>  <a href="chap53.html">53</a>  <a href="chap54.html">54</a>  <a href="chap55.html">55</a>  <a href="chap56.html">56</a>  <a href="chap57.html">57</a>  <a href="chap58.html">58</a>  <a href="chap59.html">59</a>  <a href="chap60.html">60</a>  <a href="chap61.html">61</a>  <a href="chap62.html">62</a>  <a href="chap63.html">63</a>  <a href="chap64.html">64</a>  <a href="chap65.html">65</a>  <a href="chap66.html">66</a>  <a href="chap67.html">67</a>  <a href="chap68.html">68</a>  <a href="chap69.html">69</a>  <a href="chap70.html">70</a>  <a href="chap71.html">71</a>  <a href="chap72.html">72</a>  <a href="chap73.html">73</a>  <a href="chap74.html">74</a>  <a href="chap75.html">75</a>  <a href="chap76.html">76</a>  <a href="chap77.html">77</a>  <a href="chap78.html">78</a>  <a href="chap79.html">79</a>  <a href="chap80.html">80</a>  <a href="chap81.html">81</a>  <a href="chap82.html">82</a>  <a href="chap83.html">83</a>  <a href="chap84.html">84</a>  <a href="chap85.html">85</a>  <a href="chap86.html">86</a>  <a href="chap87.html">87</a>  <a href="chapBib.html">Bib</a>  <a href="chapInd.html">Ind</a>  </div>

<div class="chlinkprevnexttop">&nbsp;<a href="chap0.html">[Top of Book]</a>&nbsp;  <a href="chap0.html#contents">[Contents]</a>&nbsp;  &nbsp;<a href="chap34.html">[Previous Chapter]</a>&nbsp;  &nbsp;<a href="chap36.html">[Next Chapter]</a>&nbsp;  </div>

<p id="mathjaxlink" class="pcenter"><a href="chap35_mj.html">[MathJax on]</a></p>
<p><a id="X873E502F7D21C39C" name="X873E502F7D21C39C"></a></p>
<div class="ChapSects"><a href="chap35.html#X873E502F7D21C39C">35 <span class="Heading">Magmas</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap35.html#X7E1248B186E7BB44">35.1 <span class="Heading">Magma Categories</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X87D3F38B7EAB13FA">35.1-1 IsMagma</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X86071DE7835F1C7C">35.1-2 IsMagmaWithOne</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X83E4903D7FBB2E24">35.1-3 IsMagmaWithInversesIfNonzero</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X82CBFF648574B830">35.1-4 IsMagmaWithInverses</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap35.html#X808F1A148398733D">35.2 <span class="Heading">Magma Generation</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X839147CF813312D6">35.2-1 Magma</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X7854B23286B17321">35.2-2 MagmaWithOne</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X7A2B51F67EF4DA28">35.2-3 MagmaWithInverses</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X7F629A498383A0AD">35.2-4 MagmaByGenerators</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X84DABBEB803107EB">35.2-5 MagmaWithOneByGenerators</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X82C08CFB854E3F1A">35.2-6 MagmaWithInversesByGenerators</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X8268EAA47E4A3A64">35.2-7 Submagma</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X7F295EBC7A9CE87E">35.2-8 SubmagmaWithOne</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X79441F1F7A277E28">35.2-9 SubmagmaWithInverses</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X84ED076D7E46AB79">35.2-10 AsMagma</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X87EEEC018129F0F4">35.2-11 AsSubmagma</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X8553F44D8123B2C6">35.2-12 IsMagmaWithZeroAdjoined</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X8620878D7FD98823">35.2-13 InjectionZeroMagma</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X7B353674859BF659">35.2-14 UnderlyingInjectionZeroMagma</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap35.html#X782215B982F2F01C">35.3 <span class="Heading">Magmas Defined by Multiplication Tables</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X85CD1E7678295CA6">35.3-1 MagmaByMultiplicationTable</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X865526C881645D65">35.3-2 MagmaWithOneByMultiplicationTable</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X7EDAFB987EE8A770">35.3-3 MagmaWithInversesByMultiplicationTable</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X828BED4580D28FB8">35.3-4 MagmaElement</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X849BDCC27C4C3191">35.3-5 <span class="Heading">MultiplicationTable</span></a>
</span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap35.html#X87036FCE868FFEE9">35.4 <span class="Heading">Attributes and Properties for Magmas</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X872E05B478EC20CA">35.4-1 GeneratorsOfMagma</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X87DD93EC8061DD81">35.4-2 GeneratorsOfMagmaWithOne</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X83A901B1857C8489">35.4-3 GeneratorsOfMagmaWithInverses</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X7DE33AFC823C7873">35.4-4 Centralizer</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X847ABE6F781C7FE8">35.4-5 Centre</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X7C651C9C78398FFF">35.4-6 Idempotents</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X7C83B5A47FD18FB7">35.4-7 IsAssociative</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X857B0E507D745ADB">35.4-8 IsCentral</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X830A4A4C795FBC2D">35.4-9 IsCommutative</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X7EE2EA5F7EB7FEC2">35.4-10 MultiplicativeNeutralElement</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X7B39F93C8136D642">35.4-11 MultiplicativeZero</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X867DB05A8218FB1E">35.4-12 SquareRoots</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap35.html#X837DA95883CFB985">35.4-13 TrivialSubmagmaWithOne</a></span>
</div></div>
</div>

<h3>35 <span class="Heading">Magmas</span></h3>

<p>This chapter deals with domains (see <a href="chap31.html#X7E651AC287AFDCC1"><span class="RefLink">31</span></a>) that are closed under multiplication <code class="code">*</code>. Following <a href="chapBib.html#biBBourbaki70">[Bou70]</a>, we call them <em>magmas</em> in <strong class="pkg">GAP</strong>. Together with the domains closed under addition <code class="code">+</code> (see <a href="chap55.html#X7D0D096B81365B02"><span class="RefLink">55</span></a>), they are the basic algebraic structures; every semigroup, monoid (see <a href="chap51.html#X8665D8737FDD5B10"><span class="RefLink">51</span></a>), group (see <a href="chap39.html#X8716635F7951801B"><span class="RefLink">39</span></a>), ring (see <a href="chap56.html#X81897F6082CACB59"><span class="RefLink">56</span></a>), or field (see <a href="chap58.html#X80A8E676814A19FD"><span class="RefLink">58</span></a>) is a magma. In the cases of a <em>magma-with-one</em> or <em>magma-with-inverses</em>, additional multiplicative structure is present, see <a href="chap35.html#X7E1248B186E7BB44"><span class="RefLink">35.1</span></a>. For functions to create free magmas, see <a href="chap36.html#X7F51B17983019D3E"><span class="RefLink">36.4</span></a>.</p>

<p><a id="X7E1248B186E7BB44" name="X7E1248B186E7BB44"></a></p>

<h4>35.1 <span class="Heading">Magma Categories</span></h4>

<p><a id="X87D3F38B7EAB13FA" name="X87D3F38B7EAB13FA"></a></p>

<h5>35.1-1 IsMagma</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsMagma</code>( <var class="Arg">obj</var> )</td><td class="tdright">(&nbsp;category&nbsp;)</td></tr></table></div>
<p>A <em>magma</em> in <strong class="pkg">GAP</strong> is a domain <span class="SimpleMath">M</span> with (not necessarily associative) multiplication <code class="code">*</code><span class="SimpleMath">: M × M → M</span>.</p>

<p><a id="X86071DE7835F1C7C" name="X86071DE7835F1C7C"></a></p>

<h5>35.1-2 IsMagmaWithOne</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsMagmaWithOne</code>( <var class="Arg">obj</var> )</td><td class="tdright">(&nbsp;category&nbsp;)</td></tr></table></div>
<p>A <em>magma-with-one</em> in <strong class="pkg">GAP</strong> is a magma <span class="SimpleMath">M</span> with an operation <code class="code">^0</code> (or <code class="func">One</code> (<a href="chap31.html#X8046262384895B2A"><span class="RefLink">31.10-2</span></a>)) that yields the identity of <span class="SimpleMath">M</span>.</p>

<p>So a magma-with-one <span class="SimpleMath">M</span> does always contain a unique multiplicatively neutral element <span class="SimpleMath">e</span>, i.e., <span class="SimpleMath">e</span><code class="code"> * </code><span class="SimpleMath">m = m = m</span><code class="code"> * </code><span class="SimpleMath">e</span> holds for all <span class="SimpleMath">m ∈ M</span> (see <code class="func">MultiplicativeNeutralElement</code> (<a href="chap35.html#X7EE2EA5F7EB7FEC2"><span class="RefLink">35.4-10</span></a>)). This element <span class="SimpleMath">e</span> can be computed with the operation <code class="func">One</code> (<a href="chap31.html#X8046262384895B2A"><span class="RefLink">31.10-2</span></a>) as <code class="code">One( </code><span class="SimpleMath">M</span><code class="code"> )</code>, and <span class="SimpleMath">e</span> is also equal to <code class="code">One( </code><span class="SimpleMath">m</span><code class="code"> )</code> and to <span class="SimpleMath">m</span><code class="code">^0</code> for each element <span class="SimpleMath">m ∈ M</span>.</p>

<p><em>Note</em> that a magma may contain a multiplicatively neutral element but <em>not</em> an identity (see <code class="func">One</code> (<a href="chap31.html#X8046262384895B2A"><span class="RefLink">31.10-2</span></a>)), and a magma containing an identity may <em>not</em> lie in the category <code class="func">IsMagmaWithOne</code> (see Section <a href="chap31.html#X7D72F11B82F4A036"><span class="RefLink">31.6</span></a>).</p>

<p><a id="X83E4903D7FBB2E24" name="X83E4903D7FBB2E24"></a></p>

<h5>35.1-3 IsMagmaWithInversesIfNonzero</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsMagmaWithInversesIfNonzero</code>( <var class="Arg">obj</var> )</td><td class="tdright">(&nbsp;category&nbsp;)</td></tr></table></div>
<p>An object in this <strong class="pkg">GAP</strong> category is a magma-with-one <span class="SimpleMath">M</span> with an operation <code class="code">^-1</code><span class="SimpleMath">: M ∖ Z → M ∖ Z</span> that maps each element <span class="SimpleMath">m</span> of <span class="SimpleMath">M ∖ Z</span> to its inverse <span class="SimpleMath">m</span><code class="code">^-1</code> (or <code class="code">Inverse( </code><span class="SimpleMath">m</span><code class="code"> )</code>, see <code class="func">Inverse</code> (<a href="chap31.html#X78EE524E83624057"><span class="RefLink">31.10-8</span></a>)), where <span class="SimpleMath">Z</span> is either empty or consists exactly of one element of <span class="SimpleMath">M</span>.</p>

<p>This category was introduced mainly to describe division rings, since the nonzero elements in a division ring form a group; So an object <span class="SimpleMath">M</span> in <code class="func">IsMagmaWithInversesIfNonzero</code> will usually have both a multiplicative and an additive structure (see <a href="chap55.html#X7D0D096B81365B02"><span class="RefLink">55</span></a>), and the set <span class="SimpleMath">Z</span>, if it is nonempty, contains exactly the zero element (see <code class="func">Zero</code> (<a href="chap31.html#X8040AC7A79FFC442"><span class="RefLink">31.10-3</span></a>)) of <span class="SimpleMath">M</span>.</p>

<p><a id="X82CBFF648574B830" name="X82CBFF648574B830"></a></p>

<h5>35.1-4 IsMagmaWithInverses</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsMagmaWithInverses</code>( <var class="Arg">obj</var> )</td><td class="tdright">(&nbsp;category&nbsp;)</td></tr></table></div>
<p>A <em>magma-with-inverses</em> in <strong class="pkg">GAP</strong> is a magma-with-one <span class="SimpleMath">M</span> with an operation <code class="code">^-1</code><span class="SimpleMath">: M → M</span> that maps each element <span class="SimpleMath">m</span> of <span class="SimpleMath">M</span> to its inverse <span class="SimpleMath">m</span><code class="code">^-1</code> (or <code class="code">Inverse( </code><span class="SimpleMath">m</span><code class="code"> )</code>, see <code class="func">Inverse</code> (<a href="chap31.html#X78EE524E83624057"><span class="RefLink">31.10-8</span></a>)).</p>

<p>Note that not every trivial magma is a magma-with-one, but every trivial magma-with-one is a magma-with-inverses. This holds also if the identity of the magma-with-one is a zero element. So a magma-with-inverses-if-nonzero can be a magma-with-inverses if either it contains no zero element or consists of a zero element that has itself as zero-th power.</p>

<p><a id="X808F1A148398733D" name="X808F1A148398733D"></a></p>

<h4>35.2 <span class="Heading">Magma Generation</span></h4>

<p>This section describes functions that create magmas from generators (see <code class="func">Magma</code> (<a href="chap35.html#X839147CF813312D6"><span class="RefLink">35.2-1</span></a>), <code class="func">MagmaWithOne</code> (<a href="chap35.html#X7854B23286B17321"><span class="RefLink">35.2-2</span></a>), <code class="func">MagmaWithInverses</code> (<a href="chap35.html#X7A2B51F67EF4DA28"><span class="RefLink">35.2-3</span></a>)), the underlying operations for which methods can be installed (see <code class="func">MagmaByGenerators</code> (<a href="chap35.html#X7F629A498383A0AD"><span class="RefLink">35.2-4</span></a>), <code class="func">MagmaWithOneByGenerators</code> (<a href="chap35.html#X84DABBEB803107EB"><span class="RefLink">35.2-5</span></a>), <code class="func">MagmaWithInversesByGenerators</code> (<a href="chap35.html#X82C08CFB854E3F1A"><span class="RefLink">35.2-6</span></a>)), functions for forming submagmas (see <code class="func">Submagma</code> (<a href="chap35.html#X8268EAA47E4A3A64"><span class="RefLink">35.2-7</span></a>), <code class="func">SubmagmaWithOne</code> (<a href="chap35.html#X7F295EBC7A9CE87E"><span class="RefLink">35.2-8</span></a>), <code class="func">SubmagmaWithInverses</code> (<a href="chap35.html#X79441F1F7A277E28"><span class="RefLink">35.2-9</span></a>)), and functions that form a magma equal to a given collection (see <code class="func">AsMagma</code> (<a href="chap35.html#X84ED076D7E46AB79"><span class="RefLink">35.2-10</span></a>), <code class="func">AsSubmagma</code> (<a href="chap35.html#X87EEEC018129F0F4"><span class="RefLink">35.2-11</span></a>)).</p>

<p><code class="func">InjectionZeroMagma</code> (<a href="chap35.html#X8620878D7FD98823"><span class="RefLink">35.2-13</span></a>) creates a new magma which is the original magma with a zero adjoined.</p>

<p><a id="X839147CF813312D6" name="X839147CF813312D6"></a></p>

<h5>35.2-1 Magma</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Magma</code>( [<var class="Arg">Fam</var>, ]<var class="Arg">gens</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
<p>returns the magma <span class="SimpleMath">M</span> that is generated by the elements in the list <var class="Arg">gens</var>, that is, the closure of <var class="Arg">gens</var> under multiplication <code class="func">\*</code> (<a href="chap31.html#X8481C9B97B214C23"><span class="RefLink">31.12-1</span></a>). The family <var class="Arg">Fam</var> of <span class="SimpleMath">M</span> can be entered as the first argument; this is obligatory if <var class="Arg">gens</var> is empty (and hence also <span class="SimpleMath">M</span> is empty).</p>

<p><a id="X7854B23286B17321" name="X7854B23286B17321"></a></p>

<h5>35.2-2 MagmaWithOne</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MagmaWithOne</code>( [<var class="Arg">Fam</var>, ]<var class="Arg">gens</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
<p>returns the magma-with-one <span class="SimpleMath">M</span> that is generated by the elements in the list <var class="Arg">gens</var>, that is, the closure of <var class="Arg">gens</var> under multiplication <code class="func">\*</code> (<a href="chap31.html#X8481C9B97B214C23"><span class="RefLink">31.12-1</span></a>) and <code class="func">One</code> (<a href="chap31.html#X8046262384895B2A"><span class="RefLink">31.10-2</span></a>). The family <var class="Arg">Fam</var> of <span class="SimpleMath">M</span> can be entered as first argument; this is obligatory if <var class="Arg">gens</var> is empty (and hence <span class="SimpleMath">M</span> is trivial).</p>

<p><a id="X7A2B51F67EF4DA28" name="X7A2B51F67EF4DA28"></a></p>

<h5>35.2-3 MagmaWithInverses</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MagmaWithInverses</code>( [<var class="Arg">Fam</var>, ]<var class="Arg">gens</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
<p>returns the magma-with-inverses <span class="SimpleMath">M</span> that is generated by the elements in the list <var class="Arg">gens</var>, that is, the closure of <var class="Arg">gens</var> under multiplication <code class="func">\*</code> (<a href="chap31.html#X8481C9B97B214C23"><span class="RefLink">31.12-1</span></a>), <code class="func">One</code> (<a href="chap31.html#X8046262384895B2A"><span class="RefLink">31.10-2</span></a>), and <code class="func">Inverse</code> (<a href="chap31.html#X78EE524E83624057"><span class="RefLink">31.10-8</span></a>). The family <var class="Arg">Fam</var> of <span class="SimpleMath">M</span> can be entered as first argument; this is obligatory if <var class="Arg">gens</var> is empty (and hence <span class="SimpleMath">M</span> is trivial).</p>

<p><a id="X7F629A498383A0AD" name="X7F629A498383A0AD"></a></p>

<h5>35.2-4 MagmaByGenerators</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MagmaByGenerators</code>( [<var class="Arg">Fam</var>, ]<var class="Arg">gens</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
<p>An underlying operation for <code class="func">Magma</code> (<a href="chap35.html#X839147CF813312D6"><span class="RefLink">35.2-1</span></a>).</p>

<p><a id="X84DABBEB803107EB" name="X84DABBEB803107EB"></a></p>

<h5>35.2-5 MagmaWithOneByGenerators</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MagmaWithOneByGenerators</code>( [<var class="Arg">Fam</var>, ]<var class="Arg">gens</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
<p>An underlying operation for <code class="func">MagmaWithOne</code> (<a href="chap35.html#X7854B23286B17321"><span class="RefLink">35.2-2</span></a>).</p>

<p><a id="X82C08CFB854E3F1A" name="X82C08CFB854E3F1A"></a></p>

<h5>35.2-6 MagmaWithInversesByGenerators</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MagmaWithInversesByGenerators</code>( [<var class="Arg">Fam</var>, ]<var class="Arg">gens</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
<p>An underlying operation for <code class="func">MagmaWithInverses</code> (<a href="chap35.html#X7A2B51F67EF4DA28"><span class="RefLink">35.2-3</span></a>).</p>

<p><a id="X8268EAA47E4A3A64" name="X8268EAA47E4A3A64"></a></p>

<h5>35.2-7 Submagma</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Submagma</code>( <var class="Arg">D</var>, <var class="Arg">gens</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SubmagmaNC</code>( <var class="Arg">D</var>, <var class="Arg">gens</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
<p><code class="func">Submagma</code> returns the magma generated by the elements in the list <var class="Arg">gens</var>, with parent the domain <var class="Arg">D</var>. <code class="func">SubmagmaNC</code> does the same, except that it is not checked whether the elements of <var class="Arg">gens</var> lie in <var class="Arg">D</var>.</p>

<p><a id="X7F295EBC7A9CE87E" name="X7F295EBC7A9CE87E"></a></p>

<h5>35.2-8 SubmagmaWithOne</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SubmagmaWithOne</code>( <var class="Arg">D</var>, <var class="Arg">gens</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SubmagmaWithOneNC</code>( <var class="Arg">D</var>, <var class="Arg">gens</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
<p><code class="func">SubmagmaWithOne</code> returns the magma-with-one generated by the elements in the list <var class="Arg">gens</var>, with parent the domain <var class="Arg">D</var>. <code class="func">SubmagmaWithOneNC</code> does the same, except that it is not checked whether the elements of <var class="Arg">gens</var> lie in <var class="Arg">D</var>.</p>

<p><a id="X79441F1F7A277E28" name="X79441F1F7A277E28"></a></p>

<h5>35.2-9 SubmagmaWithInverses</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SubmagmaWithInverses</code>( <var class="Arg">D</var>, <var class="Arg">gens</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SubmagmaWithInversesNC</code>( <var class="Arg">D</var>, <var class="Arg">gens</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
<p><code class="func">SubmagmaWithInverses</code> returns the magma-with-inverses generated by the elements in the list <var class="Arg">gens</var>, with parent the domain <var class="Arg">D</var>. <code class="func">SubmagmaWithInversesNC</code> does the same, except that it is not checked whether the elements of <var class="Arg">gens</var> lie in <var class="Arg">D</var>.</p>

<p><a id="X84ED076D7E46AB79" name="X84ED076D7E46AB79"></a></p>

<h5>35.2-10 AsMagma</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AsMagma</code>( <var class="Arg">C</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
<p>For a collection <var class="Arg">C</var> whose elements form a magma, <code class="func">AsMagma</code> returns this magma. Otherwise <code class="keyw">fail</code> is returned.</p>

<p><a id="X87EEEC018129F0F4" name="X87EEEC018129F0F4"></a></p>

<h5>35.2-11 AsSubmagma</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AsSubmagma</code>( <var class="Arg">D</var>, <var class="Arg">C</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
<p>Let <var class="Arg">D</var> be a domain and <var class="Arg">C</var> a collection. If <var class="Arg">C</var> is a subset of <var class="Arg">D</var> that forms a magma then <code class="func">AsSubmagma</code> returns this magma, with parent <var class="Arg">D</var>. Otherwise <code class="keyw">fail</code> is returned.</p>

<p><a id="X8553F44D8123B2C6" name="X8553F44D8123B2C6"></a></p>

<h5>35.2-12 IsMagmaWithZeroAdjoined</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsMagmaWithZeroAdjoined</code>( <var class="Arg">M</var> )</td><td class="tdright">(&nbsp;category&nbsp;)</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>

<p><code class="code">IsMagmaWithZeroAdjoined</code> returns <code class="keyw">true</code> if the magma <var class="Arg">M</var> was created using <code class="func">InjectionZeroMagma</code> (<a href="chap35.html#X8620878D7FD98823"><span class="RefLink">35.2-13</span></a>) or <code class="func">MagmaWithZeroAdjoined</code> (<a href="chap35.html#X8620878D7FD98823"><span class="RefLink">35.2-13</span></a>) and returns <code class="keyw">false</code> if it was not.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S:=Semigroup(Transformation([1,1,1]), Transformation([1,3,2]));;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsMagmaWithZeroAdjoined(S);</span>
false
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">M:=MagmaWithZeroAdjoined(S);</span>
&lt;&lt;transformation semigroup of degree 3 with 2 generators&gt;
  with 0 adjoined&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsMagmaWithZeroAdjoined(M);</span>
true
</pre></div>

<p><a id="X8620878D7FD98823" name="X8620878D7FD98823"></a></p>

<h5>35.2-13 InjectionZeroMagma</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; InjectionZeroMagma</code>( <var class="Arg">M</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MagmaWithZeroAdjoined</code>( <var class="Arg">M</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
<p><code class="func">InjectionZeroMagma</code> returns an embedding from the magma <var class="Arg">M</var> into a new magma formed from <var class="Arg">M</var> by adjoining a single new element which is the multiplicative zero of the resulting magma. The elements of the new magma form a family of elements in the category <code class="func">IsMultiplicativeElementWithZero</code> (<a href="chap31.html#X8703BFC2841BBD63"><span class="RefLink">31.14-12</span></a>) and the magma itself satisfies <code class="func">IsMagmaWithZeroAdjoined</code> (<a href="chap35.html#X8553F44D8123B2C6"><span class="RefLink">35.2-12</span></a>).</p>

<p><code class="code">MagmaWithZeroAdjoined</code> is just shorthand for <code class="code">Range(InjectionZeroMagma(<var class="Arg">M</var>)))</code>.</p>

<p>If <code class="code">N</code> is a magma with zero adjoined, then the embedding used to create <code class="code">N</code> can be recovered using <code class="func">UnderlyingInjectionZeroMagma</code> (<a href="chap35.html#X7B353674859BF659"><span class="RefLink">35.2-14</span></a>).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S:=Monoid(Transformation( [ 7, 7, 5, 3, 1, 3, 7 ] ),</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">Transformation( [ 5, 1, 4, 1, 4, 4, 7 ] ));;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MultiplicativeZero(S);</span>
Transformation( [ 7, 7, 7, 7, 7, 7, 7 ] )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T:=MagmaWithZeroAdjoined(S);</span>
&lt;&lt;transformation monoid of degree 7 with 2 generators&gt;
  with 0 adjoined&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">map:=UnderlyingInjectionZeroMagma(T);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">x:=Transformation( [ 7, 7, 7, 3, 7, 3, 7 ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">x^map;</span>
&lt;monoid with 0 adjoined elt: Transformation( [ 7, 7, 7, 3, 7, 3, 7 ]
 )&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PreImage(map, x^map)=x;</span>
true
</pre></div>

<p><a id="X7B353674859BF659" name="X7B353674859BF659"></a></p>

<h5>35.2-14 UnderlyingInjectionZeroMagma</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; UnderlyingInjectionZeroMagma</code>( <var class="Arg">M</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
<p><code class="code">UnderlyingInjectionZeroMagma</code> returns the embedding used to create the magma with zero adjoined <var class="Arg">M</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S:=Monoid(Transformation( [ 8, 7, 5, 3, 1, 3, 8, 8 ] ),</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">Transformation( [ 5, 1, 4, 1, 4, 4, 7, 8 ] ));;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MultiplicativeZero(S);</span>
Transformation( [ 8, 8, 8, 8, 8, 8, 8, 8 ] )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T:=MagmaWithZeroAdjoined(S);</span>
&lt;&lt;transformation monoid of degree 8 with 2 generators&gt;
  with 0 adjoined&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">UnderlyingInjectionZeroMagma(T);</span>
MappingByFunction( &lt;transformation monoid of degree 8 with 2 
 generators&gt;, &lt;&lt;transformation monoid of degree 8 with 2 generators&gt;
  with 0 adjoined&gt;, function( elt ) ... end, function( x ) ... end )
</pre></div>

<p><a id="X782215B982F2F01C" name="X782215B982F2F01C"></a></p>

<h4>35.3 <span class="Heading">Magmas Defined by Multiplication Tables</span></h4>

<p>The most elementary (but of course usually not recommended) way to implement a magma with only few elements is via a multiplication table.</p>

<p><a id="X85CD1E7678295CA6" name="X85CD1E7678295CA6"></a></p>

<h5>35.3-1 MagmaByMultiplicationTable</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MagmaByMultiplicationTable</code>( <var class="Arg">A</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
<p>For a square matrix <var class="Arg">A</var> with <span class="SimpleMath">n</span> rows such that all entries of <var class="Arg">A</var> are in the range <span class="SimpleMath">[ 1 .. n ]</span>, <code class="func">MagmaByMultiplicationTable</code> returns a magma <span class="SimpleMath">M</span> with multiplication <code class="code">*</code> defined by <var class="Arg">A</var>. That is, <span class="SimpleMath">M</span> consists of the elements <span class="SimpleMath">m_1, m_2, ..., m_n</span>, and <span class="SimpleMath">m_i * m_j = m_k</span>, with <span class="SimpleMath">k =</span> <var class="Arg">A</var><span class="SimpleMath">[i][j]</span>.</p>

<p>The ordering of elements is defined by <span class="SimpleMath">m_1 &lt; m_2 &lt;&lt; m_n</span>, so <span class="SimpleMath">m_i</span> can be accessed as <code class="code">MagmaElement( <var class="Arg">M</var>, <var class="Arg">i</var> )</code>, see <code class="func">MagmaElement</code> (<a href="chap35.html#X828BED4580D28FB8"><span class="RefLink">35.3-4</span></a>).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MagmaByMultiplicationTable([[1,2,3],[2,3,1],[1,1,1]]);</span>
&lt;magma with 3 generators&gt;
</pre></div>

<p><a id="X865526C881645D65" name="X865526C881645D65"></a></p>

<h5>35.3-2 MagmaWithOneByMultiplicationTable</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MagmaWithOneByMultiplicationTable</code>( <var class="Arg">A</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
<p>The only differences between <code class="func">MagmaByMultiplicationTable</code> (<a href="chap35.html#X85CD1E7678295CA6"><span class="RefLink">35.3-1</span></a>) and <code class="func">MagmaWithOneByMultiplicationTable</code> are that the latter returns a magma-with-one (see <code class="func">MagmaWithOne</code> (<a href="chap35.html#X7854B23286B17321"><span class="RefLink">35.2-2</span></a>)) if the magma described by the matrix <var class="Arg">A</var> has an identity, and returns <code class="keyw">fail</code> if not.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MagmaWithOneByMultiplicationTable([[1,2,3],[2,3,1],[3,1,1]]);</span>
&lt;magma-with-one with 3 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MagmaWithOneByMultiplicationTable([[1,2,3],[2,3,1],[1,1,1]]);</span>
fail
</pre></div>

<p><a id="X7EDAFB987EE8A770" name="X7EDAFB987EE8A770"></a></p>

<h5>35.3-3 MagmaWithInversesByMultiplicationTable</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MagmaWithInversesByMultiplicationTable</code>( <var class="Arg">A</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
<p><code class="func">MagmaByMultiplicationTable</code> (<a href="chap35.html#X85CD1E7678295CA6"><span class="RefLink">35.3-1</span></a>) and <code class="func">MagmaWithInversesByMultiplicationTable</code> differ only in that the latter returns magma-with-inverses (see <code class="func">MagmaWithInverses</code> (<a href="chap35.html#X7A2B51F67EF4DA28"><span class="RefLink">35.2-3</span></a>)) if each element in the magma described by the matrix <var class="Arg">A</var> has an inverse, and returns <code class="keyw">fail</code> if not.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MagmaWithInversesByMultiplicationTable([[1,2,3],[2,3,1],[3,1,2]]);</span>
&lt;magma-with-inverses with 3 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MagmaWithInversesByMultiplicationTable([[1,2,3],[2,3,1],[3,2,1]]);</span>
fail
</pre></div>

<p><a id="X828BED4580D28FB8" name="X828BED4580D28FB8"></a></p>

<h5>35.3-4 MagmaElement</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MagmaElement</code>( <var class="Arg">M</var>, <var class="Arg">i</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
<p>For a magma <var class="Arg">M</var> and a positive integer <var class="Arg">i</var>, <code class="func">MagmaElement</code> returns the <var class="Arg">i</var>-th element of <var class="Arg">M</var>, w.r.t. the ordering <code class="code">&lt;</code>. If <var class="Arg">M</var> has less than <var class="Arg">i</var> elements then <code class="keyw">fail</code> is returned.</p>

<p><a id="X849BDCC27C4C3191" name="X849BDCC27C4C3191"></a></p>

<h5>35.3-5 <span class="Heading">MultiplicationTable</span></h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MultiplicationTable</code>( <var class="Arg">elms</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MultiplicationTable</code>( <var class="Arg">M</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
<p>For a list <var class="Arg">elms</var> of elements that form a magma <span class="SimpleMath">M</span>, <code class="func">MultiplicationTable</code> returns a square matrix <span class="SimpleMath">A</span> of positive integers such that <span class="SimpleMath">A[i][j] = k</span> holds if and only if <var class="Arg">elms</var><span class="SimpleMath">[i] *</span> <var class="Arg">elms</var><span class="SimpleMath">[j] =</span> <var class="Arg">elms</var><span class="SimpleMath">[k]</span>. This matrix can be used to construct a magma isomorphic to <span class="SimpleMath">M</span>, using <code class="func">MagmaByMultiplicationTable</code> (<a href="chap35.html#X85CD1E7678295CA6"><span class="RefLink">35.3-1</span></a>).</p>

<p>For a magma <var class="Arg">M</var>, <code class="func">MultiplicationTable</code> returns the multiplication table w.r.t. the sorted list of elements of <var class="Arg">M</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">l:= [ (), (1,2)(3,4), (1,3)(2,4), (1,4)(2,3) ];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">a:= MultiplicationTable( l );</span>
[ [ 1, 2, 3, 4 ], [ 2, 1, 4, 3 ], [ 3, 4, 1, 2 ], [ 4, 3, 2, 1 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m:= MagmaByMultiplicationTable( a );</span>
&lt;magma with 4 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">One( m );</span>
m1
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">elm:= MagmaElement( m, 2 );  One( elm );  elm^2;</span>
m2
m1
m1
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Inverse( elm );</span>
m2
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">AsGroup( m );</span>
&lt;group of size 4 with 2 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">a:= [ [ 1, 2 ], [ 2, 2 ] ];</span>
[ [ 1, 2 ], [ 2, 2 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m:= MagmaByMultiplicationTable( a );</span>
&lt;magma with 2 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">One( m );  Inverse( MagmaElement( m, 2 ) );</span>
m1
fail
</pre></div>

<p><a id="X87036FCE868FFEE9" name="X87036FCE868FFEE9"></a></p>

<h4>35.4 <span class="Heading">Attributes and Properties for Magmas</span></h4>

<p><em>Note</em> that <code class="func">IsAssociative</code> (<a href="chap35.html#X7C83B5A47FD18FB7"><span class="RefLink">35.4-7</span></a>) and <code class="func">IsCommutative</code> (<a href="chap35.html#X830A4A4C795FBC2D"><span class="RefLink">35.4-9</span></a>) always refer to the multiplication of a domain. If a magma <var class="Arg">M</var> has also an <em>additive structure</em>, e.g., if <var class="Arg">M</var> is a ring (see <a href="chap56.html#X81897F6082CACB59"><span class="RefLink">56</span></a>), then the addition <code class="code">+</code> is always assumed to be associative and commutative, see <a href="chap31.html#X7A2914307963E370"><span class="RefLink">31.12</span></a>.</p>

<p><a id="X872E05B478EC20CA" name="X872E05B478EC20CA"></a></p>

<h5>35.4-1 GeneratorsOfMagma</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; GeneratorsOfMagma</code>( <var class="Arg">M</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
<p>is a list <var class="Arg">gens</var> of elements of the magma <var class="Arg">M</var> that generates <var class="Arg">M</var> as a magma, that is, the closure of <var class="Arg">gens</var> under multiplication <code class="func">\*</code> (<a href="chap31.html#X8481C9B97B214C23"><span class="RefLink">31.12-1</span></a>) is <var class="Arg">M</var>.</p>

<p>For a free magma, each generator can also be accessed using the <code class="code">.</code> operator (see <code class="func">GeneratorsOfDomain</code> (<a href="chap31.html#X7E353DD1838AB223"><span class="RefLink">31.9-2</span></a>)).</p>

<p><a id="X87DD93EC8061DD81" name="X87DD93EC8061DD81"></a></p>

<h5>35.4-2 GeneratorsOfMagmaWithOne</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; GeneratorsOfMagmaWithOne</code>( <var class="Arg">M</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
<p>is a list <var class="Arg">gens</var> of elements of the magma-with-one <var class="Arg">M</var> that generates <var class="Arg">M</var> as a magma-with-one, that is, the closure of <var class="Arg">gens</var> under multiplication <code class="func">\*</code> (<a href="chap31.html#X8481C9B97B214C23"><span class="RefLink">31.12-1</span></a>) and <code class="func">One</code> (<a href="chap31.html#X8046262384895B2A"><span class="RefLink">31.10-2</span></a>) is <var class="Arg">M</var>.</p>

<p>For a free magma with one, each generator can also be accessed using the <code class="code">.</code> operator (see <code class="func">GeneratorsOfDomain</code> (<a href="chap31.html#X7E353DD1838AB223"><span class="RefLink">31.9-2</span></a>)).</p>

<p><a id="X83A901B1857C8489" name="X83A901B1857C8489"></a></p>

<h5>35.4-3 GeneratorsOfMagmaWithInverses</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; GeneratorsOfMagmaWithInverses</code>( <var class="Arg">M</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
<p>is a list <var class="Arg">gens</var> of elements of the magma-with-inverses <var class="Arg">M</var> that generates <var class="Arg">M</var> as a magma-with-inverses, that is, the closure of <var class="Arg">gens</var> under multiplication <code class="func">\*</code> (<a href="chap31.html#X8481C9B97B214C23"><span class="RefLink">31.12-1</span></a>) and taking inverses (see <code class="func">Inverse</code> (<a href="chap31.html#X78EE524E83624057"><span class="RefLink">31.10-8</span></a>)) is <var class="Arg">M</var>.</p>

<p><a id="X7DE33AFC823C7873" name="X7DE33AFC823C7873"></a></p>

<h5>35.4-4 Centralizer</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Centralizer</code>( <var class="Arg">M</var>, <var class="Arg">elm</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Centralizer</code>( <var class="Arg">M</var>, <var class="Arg">S</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Centralizer</code>( <var class="Arg">class</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
<p>For an element <var class="Arg">elm</var> of the magma <var class="Arg">M</var> this operation returns the <em>centralizer</em> of <var class="Arg">elm</var>. This is the domain of those elements <var class="Arg">m</var> <span class="SimpleMath"></span> <var class="Arg">M</var> that commute with <var class="Arg">elm</var>.</p>

<p>For a submagma <var class="Arg">S</var> it returns the domain of those elements that commute with <em>all</em> elements <var class="Arg">s</var> of <var class="Arg">S</var>.</p>

<p>If <var class="Arg">class</var> is a class of objects of a magma (this magma then is stored as the <code class="code">ActingDomain</code> of <var class="Arg">class</var>) such as given by <code class="func">ConjugacyClass</code> (<a href="chap39.html#X7B2F207F7F85F5B8"><span class="RefLink">39.10-1</span></a>), <code class="func">Centralizer</code> returns the centralizer of <code class="code">Representative(<var class="Arg">class</var>)</code> (which is a slight abuse of the notation).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">g:=Group((1,2,3,4),(1,2));;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Centralizer(g,(1,2,3));</span>
Group([ (1,2,3) ])
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Centralizer(g,Subgroup(g,[(1,2,3)]));</span>
Group([ (1,2,3) ])
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Centralizer(g,Subgroup(g,[(1,2,3),(1,2)]));</span>
Group(())
</pre></div>

<p><a id="X847ABE6F781C7FE8" name="X847ABE6F781C7FE8"></a></p>

<h5>35.4-5 Centre</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Centre</code>( <var class="Arg">M</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Center</code>( <var class="Arg">M</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
<p><code class="func">Centre</code> returns the <em>centre</em> of the magma <var class="Arg">M</var>, i.e., the domain of those elements <var class="Arg">m</var> <span class="SimpleMath"></span> <var class="Arg">M</var> that commute and associate with all elements of <var class="Arg">M</var>. That is, the set <span class="SimpleMath">{ m ∈ M; ∀ a, b ∈ M: ma = am, (ma)b = m(ab), (am)b = a(mb), (ab)m = a(bm) }</span>.</p>

<p><code class="func">Center</code> is just a synonym for <code class="func">Centre</code>.</p>

<p>For associative magmas we have that <code class="code">Centre( <var class="Arg">M</var> ) = Centralizer( <var class="Arg">M</var>, <var class="Arg">M</var> )</code>, see <code class="func">Centralizer</code> (<a href="chap35.html#X7DE33AFC823C7873"><span class="RefLink">35.4-4</span></a>).</p>

<p>The centre of a magma is always commutative (see <code class="func">IsCommutative</code> (<a href="chap35.html#X830A4A4C795FBC2D"><span class="RefLink">35.4-9</span></a>)). (When one installs a new method for <code class="func">Centre</code>, one should set the <code class="func">IsCommutative</code> (<a href="chap35.html#X830A4A4C795FBC2D"><span class="RefLink">35.4-9</span></a>) value of the result to <code class="keyw">true</code>, in order to make this information available.)</p>

<p><a id="X7C651C9C78398FFF" name="X7C651C9C78398FFF"></a></p>

<h5>35.4-6 Idempotents</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Idempotents</code>( <var class="Arg">M</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
<p>The set of elements of <var class="Arg">M</var> which are their own squares.</p>

<p><a id="X7C83B5A47FD18FB7" name="X7C83B5A47FD18FB7"></a></p>

<h5>35.4-7 IsAssociative</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsAssociative</code>( <var class="Arg">M</var> )</td><td class="tdright">(&nbsp;property&nbsp;)</td></tr></table></div>
<p>A magma <var class="Arg">M</var> is <em>associative</em> if for all elements <span class="SimpleMath">a, b, c ∈</span> <var class="Arg">M</var> the equality <span class="SimpleMath">(a</span><code class="code"> * </code><span class="SimpleMath">b)</span><code class="code"> * </code><span class="SimpleMath">c = a</span><code class="code"> * </code><span class="SimpleMath">(b</span><code class="code"> * </code><span class="SimpleMath">c)</span> holds.</p>

<p>An associative magma is called a <em>semigroup</em> (see <a href="chap51.html#X8665D8737FDD5B10"><span class="RefLink">51</span></a>), an associative magma-with-one is called a <em>monoid</em> (see <a href="chap51.html#X8665D8737FDD5B10"><span class="RefLink">51</span></a>), and an associative magma-with-inverses is called a <em>group</em> (see <a href="chap39.html#X8716635F7951801B"><span class="RefLink">39</span></a>).</p>

<p><a id="X857B0E507D745ADB" name="X857B0E507D745ADB"></a></p>

<h5>35.4-8 IsCentral</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsCentral</code>( <var class="Arg">M</var>, <var class="Arg">obj</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
<p><code class="func">IsCentral</code> returns <code class="keyw">true</code> if the object <var class="Arg">obj</var>, which must either be an element or a magma, commutes with all elements in the magma <var class="Arg">M</var>.</p>

<p><a id="X830A4A4C795FBC2D" name="X830A4A4C795FBC2D"></a></p>

<h5>35.4-9 IsCommutative</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsCommutative</code>( <var class="Arg">M</var> )</td><td class="tdright">(&nbsp;property&nbsp;)</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsAbelian</code>( <var class="Arg">M</var> )</td><td class="tdright">(&nbsp;property&nbsp;)</td></tr></table></div>
<p>A magma <var class="Arg">M</var> is <em>commutative</em> if for all elements <span class="SimpleMath">a, b ∈</span> <var class="Arg">M</var> the equality <span class="SimpleMath">a</span><code class="code"> * </code><span class="SimpleMath">b = b</span><code class="code"> * </code><span class="SimpleMath">a</span> holds. <code class="func">IsAbelian</code> is a synonym of <code class="func">IsCommutative</code>.</p>

<p>Note that the commutativity of the <em>addition</em> <code class="func">\+</code> (<a href="chap31.html#X8481C9B97B214C23"><span class="RefLink">31.12-1</span></a>) in an additive structure can be tested with <code class="func">IsAdditivelyCommutative</code> (<a href="chap55.html#X82D471327A9CA960"><span class="RefLink">55.3-1</span></a>).</p>

<p><a id="X7EE2EA5F7EB7FEC2" name="X7EE2EA5F7EB7FEC2"></a></p>

<h5>35.4-10 MultiplicativeNeutralElement</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MultiplicativeNeutralElement</code>( <var class="Arg">M</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
<p>returns the element <span class="SimpleMath">e</span> in the magma <var class="Arg">M</var> with the property that <span class="SimpleMath">e</span><code class="code"> * </code><span class="SimpleMath">m = m = m</span><code class="code"> * </code><span class="SimpleMath">e</span> holds for all <span class="SimpleMath">m ∈</span> <var class="Arg">M</var>, if such an element exists. Otherwise <code class="keyw">fail</code> is returned.</p>

<p>A magma that is not a magma-with-one can have a multiplicative neutral element <span class="SimpleMath">e</span>; in this case, <span class="SimpleMath">e</span> <em>cannot</em> be obtained as <code class="code">One( <var class="Arg">M</var> )</code>, see <code class="func">One</code> (<a href="chap31.html#X8046262384895B2A"><span class="RefLink">31.10-2</span></a>).</p>

<p><a id="X7B39F93C8136D642" name="X7B39F93C8136D642"></a></p>

<h5>35.4-11 MultiplicativeZero</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MultiplicativeZero</code>( <var class="Arg">M</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsMultiplicativeZero</code>( <var class="Arg">M</var>, <var class="Arg">z</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
<p><code class="code">MultiplicativeZero</code> returns the multiplicative zero of the magma <var class="Arg">M</var> which is the element <code class="code">z</code> in <var class="Arg">M</var> such that <code class="code"><var class="Arg">z</var> * <var class="Arg">m</var> = <var class="Arg">m</var> * <var class="Arg">z</var> = <var class="Arg">z</var></code> for all <var class="Arg">m</var> in <var class="Arg">M</var>.</p>

<p><code class="code">IsMultiplicativeZero</code> returns <code class="keyw">true</code> if the element <var class="Arg">z</var> of the magma <var class="Arg">M</var> equals the multiplicative zero of <var class="Arg">M</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S:=Semigroup( Transformation( [ 1, 1, 1 ] ), </span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">Transformation( [ 2, 3, 1 ] ) );</span>
&lt;transformation semigroup of degree 3 with 2 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MultiplicativeZero(S);</span>
fail
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S:=Semigroup( Transformation( [ 1, 1, 1 ] ), </span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">Transformation( [ 1, 3, 2 ] ) );</span>
&lt;transformation semigroup of degree 3 with 2 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MultiplicativeZero(S);</span>
Transformation( [ 1, 1, 1 ] )
</pre></div>

<p><a id="X867DB05A8218FB1E" name="X867DB05A8218FB1E"></a></p>

<h5>35.4-12 SquareRoots</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SquareRoots</code>( <var class="Arg">M</var>, <var class="Arg">elm</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
<p>is the proper set of all elements <span class="SimpleMath">r</span> in the magma <var class="Arg">M</var> such that <span class="SimpleMath">r * r =</span> <var class="Arg">elm</var> holds.</p>

<p><a id="X837DA95883CFB985" name="X837DA95883CFB985"></a></p>

<h5>35.4-13 TrivialSubmagmaWithOne</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; TrivialSubmagmaWithOne</code>( <var class="Arg">M</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
<p>is the magma-with-one that has the identity of the magma-with-one <var class="Arg">M</var> as only element.</p>


<div class="chlinkprevnextbot">&nbsp;<a href="chap0.html">[Top of Book]</a>&nbsp;  <a href="chap0.html#contents">[Contents]</a>&nbsp;  &nbsp;<a href="chap34.html">[Previous Chapter]</a>&nbsp;  &nbsp;<a href="chap36.html">[Next Chapter]</a>&nbsp;  </div>


<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chap7.html">7</a>  <a href="chap8.html">8</a>  <a href="chap9.html">9</a>  <a href="chap10.html">10</a>  <a href="chap11.html">11</a>  <a href="chap12.html">12</a>  <a href="chap13.html">13</a>  <a href="chap14.html">14</a>  <a href="chap15.html">15</a>  <a href="chap16.html">16</a>  <a href="chap17.html">17</a>  <a href="chap18.html">18</a>  <a href="chap19.html">19</a>  <a href="chap20.html">20</a>  <a href="chap21.html">21</a>  <a href="chap22.html">22</a>  <a href="chap23.html">23</a>  <a href="chap24.html">24</a>  <a href="chap25.html">25</a>  <a href="chap26.html">26</a>  <a href="chap27.html">27</a>  <a href="chap28.html">28</a>  <a href="chap29.html">29</a>  <a href="chap30.html">30</a>  <a href="chap31.html">31</a>  <a href="chap32.html">32</a>  <a href="chap33.html">33</a>  <a href="chap34.html">34</a>  <a href="chap35.html">35</a>  <a href="chap36.html">36</a>  <a href="chap37.html">37</a>  <a href="chap38.html">38</a>  <a href="chap39.html">39</a>  <a href="chap40.html">40</a>  <a href="chap41.html">41</a>  <a href="chap42.html">42</a>  <a href="chap43.html">43</a>  <a href="chap44.html">44</a>  <a href="chap45.html">45</a>  <a href="chap46.html">46</a>  <a href="chap47.html">47</a>  <a href="chap48.html">48</a>  <a href="chap49.html">49</a>  <a href="chap50.html">50</a>  <a href="chap51.html">51</a>  <a href="chap52.html">52</a>  <a href="chap53.html">53</a>  <a href="chap54.html">54</a>  <a href="chap55.html">55</a>  <a href="chap56.html">56</a>  <a href="chap57.html">57</a>  <a href="chap58.html">58</a>  <a href="chap59.html">59</a>  <a href="chap60.html">60</a>  <a href="chap61.html">61</a>  <a href="chap62.html">62</a>  <a href="chap63.html">63</a>  <a href="chap64.html">64</a>  <a href="chap65.html">65</a>  <a href="chap66.html">66</a>  <a href="chap67.html">67</a>  <a href="chap68.html">68</a>  <a href="chap69.html">69</a>  <a href="chap70.html">70</a>  <a href="chap71.html">71</a>  <a href="chap72.html">72</a>  <a href="chap73.html">73</a>  <a href="chap74.html">74</a>  <a href="chap75.html">75</a>  <a href="chap76.html">76</a>  <a href="chap77.html">77</a>  <a href="chap78.html">78</a>  <a href="chap79.html">79</a>  <a href="chap80.html">80</a>  <a href="chap81.html">81</a>  <a href="chap82.html">82</a>  <a href="chap83.html">83</a>  <a href="chap84.html">84</a>  <a href="chap85.html">85</a>  <a href="chap86.html">86</a>  <a href="chap87.html">87</a>  <a href="chapBib.html">Bib</a>  <a href="chapInd.html">Ind</a>  </div>

<hr />
<p class="foot">generated by <a href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
</body>
</html>