Debian Codegraph @

doc/ref/chap54.html

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
7 <head>
8 <title>GAP (ref) - Chapter 54: Partial permutations</title>
9 <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
10 <meta name="generator" content="GAPDoc2HTML" />
11 <link rel="stylesheet" type="text/css" href="manual.css" />
12 <script src="manual.js" type="text/javascript"></script>
13 <script type="text/javascript">overwriteStyle();</script>
14 </head>
15 <body class="chap54" onload="jscontent()">
16
17
18 <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>
19
20 <div class="chlinkprevnexttop">&nbsp;<a href="chap0.html">[Top of Book]</a>&nbsp; <a href="chap0.html#contents">[Contents]</a>&nbsp; &nbsp;<a href="chap53.html">[Previous Chapter]</a>&nbsp; &nbsp;<a href="chap55.html">[Next Chapter]</a>&nbsp; </div>
21
22 <p id="mathjaxlink" class="pcenter"><a href="chap54_mj.html">[MathJax on]</a></p>
23 <p><a id="X7D6495F77B8A77BD" name="X7D6495F77B8A77BD"></a></p>
24 <div class="ChapSects"><a href="chap54.html#X7D6495F77B8A77BD">54 <span class="Heading">Partial permutations</span></a>
25 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap54.html#X87B0D6657A3F2B0E">54.1 <span class="Heading">The family and categories of partial permutations</span></a>
26 </span>
27 <div class="ContSSBlock">
28 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7EECE133792B30FC">54.1-1 IsPartialPerm</a></span>
29 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X8262A827790DD1CC">54.1-2 IsPartialPermCollection</a></span>
30 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7E63D17780F64FBA">54.1-3 PartialPermFamily</a></span>
31 </div></div>
32 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap54.html#X7B9D451D7FDA1DD8">54.2 <span class="Heading">Creating partial permutations</span></a>
33 </span>
34 <div class="ContSSBlock">
35 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X8538BAE77F2FB2F8">54.2-1 PartialPerm</a></span>
36 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X81188D9F83F64222">54.2-2 PartialPermOp</a></span>
37 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X80ABBF4883C79060">54.2-3 RestrictedPartialPerm</a></span>
38 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X849668DD7B0B9E3B">54.2-4 JoinOfPartialPerms</a></span>
39 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X81E2B6977E28CD00">54.2-5 MeetOfPartialPerms</a></span>
40 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X80EFB142817A0A9F">54.2-6 EmptyPartialPerm</a></span>
41 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7E6ADC8583C31530">54.2-7 <span class="Heading">RandomPartialPerm</span></a>
42 </span>
43 </div></div>
44 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap54.html#X8779F0997D0FDA78">54.3 <span class="Heading">Attributes for partial permutations</span></a>
45 </span>
46 <div class="ContSSBlock">
47 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X8612A4DC864E7959">54.3-1 DegreeOfPartialPerm</a></span>
48 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X8413D0EF7DEE1FFF">54.3-2 CodegreeOfPartialPerm</a></span>
49 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7C1ABD8A80E95B39">54.3-3 RankOfPartialPerm</a></span>
50 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X784A14F787E041D7">54.3-4 DomainOfPartialPerm</a></span>
51 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7CD84B107831E0FC">54.3-5 ImageOfPartialPermCollection</a></span>
52 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X8333293F87F654FA">54.3-6 ImageListOfPartialPerm</a></span>
53 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7F0724A07A14DCF7">54.3-7 ImageSetOfPartialPerm</a></span>
54 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X82AAFF938623422E">54.3-8 FixedPointsOfPartialPerm</a></span>
55 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X82FE981A87FAA2DC">54.3-9 MovedPoints</a></span>
56 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7FAF969C84CDC742">54.3-10 NrFixedPoints</a></span>
57 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X81F5C64E7DAD27A7">54.3-11 NrMovedPoints</a></span>
58 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X84A49C977E1E29AA">54.3-12 SmallestMovedPoint</a></span>
59 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7D4290A785ABC86D">54.3-13 LargestMovedPoint</a></span>
60 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X85280F1A7B1014BA">54.3-14 SmallestImageOfMovedPoint</a></span>
61 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7A95CD437BC1CB1A">54.3-15 LargestImageOfMovedPoint</a></span>
62 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X873A9F717DA75CBC">54.3-16 IndexPeriodOfPartialPerm</a></span>
63 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7C04AA377F080722">54.3-17 SmallestIdempotentPower</a></span>
64 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X8185065E788BDD0D">54.3-18 ComponentsOfPartialPerm</a></span>
65 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7CB51EB67FFA95E9">54.3-19 NrComponentsOfPartialPerm</a></span>
66 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7AAAAE4082B30E18">54.3-20 ComponentRepsOfPartialPerm</a></span>
67 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7A8FB86C78C49F85">54.3-21 LeftOne</a></span>
68 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X857FC10C81507E8B">54.3-22 One</a></span>
69 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7D90CF497D58D759">54.3-23 MultiplicativeZero</a></span>
70 </div></div>
71 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap54.html#X8585AA8B78E9CDFB">54.4 <span class="Heading">Changing the representation of a partial permutation</span></a>
72 </span>
73 <div class="ContSSBlock">
74 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X81B32CB182489ACA">54.4-1 AsPartialPerm</a></span>
75 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X87EC67747B260E98">54.4-2 AsPartialPerm</a></span>
76 </div></div>
77 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap54.html#X848CD855802C6CE1">54.5 <span class="Heading">Operators and operations for partial permutations</span></a>
78 </span>
79 <div class="ContSSBlock">
80 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7B8630027B7F0BCC">54.5-1 Inverse</a></span>
81 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X792D3BA278DAB869"><code>54.5-2 \^</code></a></span>
82 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7DC25BC47AAA9C73"><code>54.5-3 \/</code></a></span>
83 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X8213CD6E7C461169"><code>54.5-4 \^</code></a></span>
84 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X86469D597F8BC7CE"><code>54.5-5 \*</code></a></span>
85 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X869DBDF67FA3817B"><code>54.5-6 \/</code></a></span>
86 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X82E3A3E186A4F2D2">54.5-7 LeftQuotient</a></span>
87 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X8659E9E57AC8D9CE"><code>54.5-8 \&lt;</code></a></span>
88 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7828338C7DB8AAC7"><code>54.5-9 \=</code></a></span>
89 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X8382A0F8875CEB08">54.5-10 PermLeftQuoPartialPerm</a></span>
90 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7C7F5EAB7E9A381D">54.5-11 PreImagePartialPerm</a></span>
91 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X797A6CC084068219">54.5-12 ComponentPartialPermInt</a></span>
92 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X87B1ED93785257C1">54.5-13 NaturalLeqPartialPerm</a></span>
93 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X81BD69307D294A1C">54.5-14 ShortLexLeqPartialPerm</a></span>
94 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X83560BE678ACF855">54.5-15 TrimPartialPerm</a></span>
95 </div></div>
96 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap54.html#X7849595B81D063EE">54.6 <span class="Heading">Displaying partial permutations</span></a>
97 </span>
98 </div>
99 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap54.html#X7CCC82E07A73EB55">54.7 <span class="Heading">Semigroups and inverse semigroups of partial permutations</span></a>
100 </span>
101 <div class="ContSSBlock">
102 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7D161674800B50E0">54.7-1 IsPartialPermSemigroup</a></span>
103 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7D7F0BAB82F0D820">54.7-2 DegreeOfPartialPermSemigroup</a></span>
104 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X81D271B380995F8A">54.7-3 SymmetricInverseSemigroup</a></span>
105 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7C8AEA50834060DD">54.7-4 IsSymmetricInverseSemigroup</a></span>
106 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7EA51F087CF7621F">54.7-5 NaturalPartialOrder</a></span>
107 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap54.html#X7FE18EBE79B9C17C">54.7-6 IsomorphismPartialPermSemigroup</a></span>
108 </div></div>
109 </div>
110
111 <h3>54 <span class="Heading">Partial permutations</span></h3>
112
113 <p>This chapter describes the functions in <strong class="pkg">GAP</strong> for partial permutations.</p>
114
115 <p>A <em>partial permutation</em> in <strong class="pkg">GAP</strong> is simply an injective function from any finite set of positive integers to any other finite set of positive integers. The largest point on which a partial permutation can be defined, and the largest value that the image of such a point can have, are defined by certain architecture dependent limits.</p>
116
117 <p>Every inverse semigroup is isomorphic to an inverse semigroup of partial permutations and, as such, partial permutations are to inverse semigroup theory what permutations are to group theory and transformations are to semigroup theory. In this way, partial permutations are the elements of inverse partial permutation semigroups.</p>
118
119 <p>A partial permutations in <strong class="pkg">GAP</strong> acts on a finite set of positive integers on the right. The image of a point <code class="code">i</code> under a partial permutation <code class="code">f</code> is expressed as <code class="code">i^f</code> in <strong class="pkg">GAP</strong>. This action is also implemented by the function <code class="func">OnPoints</code> (<a href="chap41.html#X7FE417DD837987B4"><span class="RefLink">41.2-1</span></a>). The preimage of a point <code class="code">i</code> under the partial permutation <code class="code">f</code> can be computed using <code class="code">i/f</code> without constructing the inverse of <code class="code">f</code>. Partial permutations in <strong class="pkg">GAP</strong> are created using the operations described in Section <a href="chap54.html#X7B9D451D7FDA1DD8"><span class="RefLink">54.2</span></a>. Partial permutations are, by default, displayed in component notation, which is described in Section <a href="chap54.html#X7849595B81D063EE"><span class="RefLink">54.6</span></a>.</p>
120
121 <p>The fundamental attributes of a partial permutation are:</p>
122
123
124 <dl>
125 <dt><strong class="Mark">Domain</strong></dt>
126 <dd><p>The <em>domain</em> of a partial permutation is just the set of positive integers where it is defined; see <code class="func">DomainOfPartialPerm</code> (<a href="chap54.html#X784A14F787E041D7"><span class="RefLink">54.3-4</span></a>). We will denote the domain of a partial permutation <code class="code">f</code> by dom(<code class="code">f</code>).</p>
127
128 </dd>
129 <dt><strong class="Mark">Degree</strong></dt>
130 <dd><p>The <em>degree</em> of a partial permutation <code class="code">f</code> is just the largest positive integer where <code class="code">f</code> is defined. In other words, the degree of <code class="code">f</code> is the largest element in the domain of <code class="code">f</code>; see <code class="func">DegreeOfPartialPerm</code> (<a href="chap54.html#X8612A4DC864E7959"><span class="RefLink">54.3-1</span></a>).</p>
131
132 </dd>
133 <dt><strong class="Mark">Image list</strong></dt>
134 <dd><p>The <em>image list</em> of a partial permutation <code class="code">f</code> is the list <code class="code">[i_1^f, i_2^f, .. , i_n^f]</code> where the domain of <code class="code">f</code> is <code class="code">[i_1, i_2, .., i_n]</code> see <code class="func">ImageListOfPartialPerm</code> (<a href="chap54.html#X8333293F87F654FA"><span class="RefLink">54.3-6</span></a>). For example, the partial perm sending <code class="code">1</code> to <code class="code">5</code> and <code class="code">2</code> to <code class="code">4</code> has image list <code class="code">[ 5, 4 ]</code>.</p>
135
136 </dd>
137 <dt><strong class="Mark">Image set</strong></dt>
138 <dd><p>The <em>image set</em> of a partial permutation <code class="code">f</code> is just the set of points in the image list (i.e. the image list after it has been sorted into increasing order); see <code class="func">ImageSetOfPartialPerm</code> (<a href="chap54.html#X7F0724A07A14DCF7"><span class="RefLink">54.3-7</span></a>). We will denote the image set of a partial permutation <code class="code">f</code> by im(<code class="code">f</code>).</p>
139
140 </dd>
141 <dt><strong class="Mark">Codegree</strong></dt>
142 <dd><p>The <em>codegree</em> of a partial permutation <code class="code">f</code> is just the largest positive integer of the form <code class="code">i^f</code> for any <code class="code">i</code> in the domain of <code class="code">f</code>. In other words, the codegree of <code class="code">f</code> is the largest element in the image of <code class="code">f</code>; see <code class="func">CodegreeOfPartialPerm</code> (<a href="chap54.html#X8413D0EF7DEE1FFF"><span class="RefLink">54.3-2</span></a>).</p>
143
144 </dd>
145 <dt><strong class="Mark">Rank</strong></dt>
146 <dd><p>The <em>rank</em> of a partial permutation <code class="code">f</code> is the size of its domain, or equivalently the size of its image set or image list; see <code class="func">RankOfPartialPerm</code> (<a href="chap54.html#X7C1ABD8A80E95B39"><span class="RefLink">54.3-3</span></a>).</p>
147
148 </dd>
149 </dl>
150 <p>A <em>functional digraph</em> is a directed graph where every vertex has out-degree <code class="code">1</code>. A partial permutation <var class="Arg">f</var> can be thought of as a functional digraph with vertices <code class="code">[1..DegreeOfPartialPerm(f)]</code> and edges from <code class="code">i</code> to <code class="code">i^f</code> for every <code class="code">i</code>. A <em>component</em> of a partial permutation is defined as a component of the corresponding functional digraph. More specifically, <code class="code">i</code> and <code class="code">j</code> are in the same component if and only if there are <span class="SimpleMath">i=v_0, v_1, ..., v_n=j</span> such that either <span class="SimpleMath">v_k+1=v_k^f</span> or <span class="SimpleMath">v_k=v_k+1^f</span> for all <code class="code">k</code>.</p>
151
152 <p>If <code class="code">S</code> is a semigroup and <code class="code">s</code> is an element of <code class="code">S</code>, then an element <code class="code">t</code> in <code class="code">S</code> is a <em>semigroup inverse</em> for <code class="code">s</code> if <code class="code">s*t*s=s</code> and <code class="code">t*s*t=t</code>; see, for example, <code class="func">InverseOfTransformation</code> (<a href="chap53.html#X860306EB7FAAD2D4"><span class="RefLink">53.5-13</span></a>). A semigroup in which every element has a unique semigroup inverse is called an <em>inverse semigroup</em>.</p>
153
154 <p>Every partial permutation belongs to a symmetric inverse monoid; see <code class="func">SymmetricInverseSemigroup</code> (<a href="chap54.html#X81D271B380995F8A"><span class="RefLink">54.7-3</span></a>). Inverse semigroups of partial permutations are hence inverse subsemigroups of the symmetric inverse monoids.</p>
155
156 <p>The inverse <code class="code">f^-1</code> of a partial permutation <code class="code">f</code> is simply the partial permutation that maps <code class="code">i^f</code> to <code class="code">i</code> for all <code class="code">i</code> in the image of <code class="code">f</code>. It follows that the domain of <code class="code">f^-1</code> equals the image of <code class="code">f</code> and that the image of <code class="code">f^-1</code> equals the domain of <code class="code">f</code>. The inverse <code class="code">f^-1</code> is the unique partial permutation with the property that <code class="code">f*f^-1*f=f</code> and <code class="code">f^-1*f*f^-1=f^-1</code>. In other words, <code class="code">f^-1</code> is the unique semigroup inverse of <code class="code">f</code> in the symmetric inverse monoid.</p>
157
158 <p>If <code class="code">f</code> and <code class="code">g</code> are partial permutations, then the domain and image of the product are:</p>
159
160 <p class="pcenter">
161 \textrm{dom}(fg)=(\textrm{im}(f)\cap \textrm{dom}(g))f^{-1}\textrm{ and }
162 \textrm{im}(fg)=(\textrm{im}(f)\cap \textrm{dom}(g))g
163 </p>
164
165 <p>A partial permutation is an idempotent if and only if it is the identity function on its domain. The products <code class="code">f*f^-1</code> and <code class="code">f^-1*f</code> are just the identity functions on the domain and image of <code class="code">f</code>, respectively. It follows that <code class="code">f*f^-1</code> is a left identity for <code class="code">f</code> and <code class="code">f^-1*f</code> is a right identity. These products will be referred to here as the <em>left one</em> and <em>right one</em> of the partial permutation <code class="code">f</code>; see <code class="func">LeftOne</code> (<a href="chap54.html#X7A8FB86C78C49F85"><span class="RefLink">54.3-21</span></a>). The <em>one</em> of a partial permutation is just the identity on the union of its domain and its image, and the <em>zero</em> of a partial permutation is just the empty partial permutation; see <code class="func">One</code> (<a href="chap54.html#X857FC10C81507E8B"><span class="RefLink">54.3-22</span></a>) and <code class="func">MultiplicativeZero</code> (<a href="chap54.html#X7D90CF497D58D759"><span class="RefLink">54.3-23</span></a>).</p>
166
167 <p>If <code class="code">S</code> is an arbitrary inverse semigroup, the <em>natural partial order</em> on <code class="code">S</code> is defined as follows: for elements <code class="code">x</code> and <code class="code">y</code> of <code class="code">S</code> we say <code class="code">x</code><span class="SimpleMath">≤</span><code class="code">y</code> if there exists an idempotent element <code class="code">e</code> in <code class="code">S</code> such that <code class="code">x=ey</code>. In the context of the symmetric inverse monoid, a partial permutation <code class="code">f</code> is less than or equal to a partial permutation <code class="code">g</code> in the natural partial order if and only if <code class="code">f</code> is a restriction of <code class="code">g</code>. The natural partial order is a meet semilattice, in other words, every pair of elements has a greatest lower bound; see <code class="func">MeetOfPartialPerms</code> (<a href="chap54.html#X81E2B6977E28CD00"><span class="RefLink">54.2-5</span></a>).</p>
168
169 <p>Note that unlike permutations, partial permutations do not fix unspecified points but are simply undefined on such points; see Chapter <a href="chap42.html#X80F808307A2D5AB8"><span class="RefLink">42</span></a>. Similar to permutations, and unlike transformations, it is possible to multiply any two partial permutations in <strong class="pkg">GAP</strong>.</p>
170
171 <p>Internally, <strong class="pkg">GAP</strong> stores a partial permutation <code class="code">f</code> as a list consisting of the codegree of <code class="code">f</code> and the images <code class="code">i^f</code> of the points <code class="code">i</code> that are less than or equal to the degree of <code class="code">f</code>; the value <code class="code">0</code> is stored where <code class="code">i^f</code> is undefined. The domain and image set of <code class="code">f</code> are also stored after either of these values is computed. When the codegree of a partial permutation <code class="code">f</code> is less than 65536, the codegree and images <code class="code">i^f</code> are stored as 16-bit integers, the domain and image set are subobjects of <code class="code">f</code> which are immutable plain lists of <strong class="pkg">GAP</strong> integers. When the codegree of <code class="code">f</code> is greater than or equal to 65536, the codegree and images are stored as 32-bit integers; the domain and image set are stored in the same way as before. A partial permutation belongs to <code class="code">IsPPerm2Rep</code> if it is stored using 16-bit integers and to <code class="code">IsPPerm4Rep</code> otherwise.</p>
172
173 <p>In the names of the <strong class="pkg">GAP</strong> functions that deal with partial permutations, the word <q>Permutation</q> is usually abbreviated to <q>Perm</q>, to save typing. For example, the category test function for partial permutations is <code class="func">IsPartialPerm</code> (<a href="chap54.html#X7EECE133792B30FC"><span class="RefLink">54.1-1</span></a>).</p>
174
175 <p><a id="X87B0D6657A3F2B0E" name="X87B0D6657A3F2B0E"></a></p>
176
177 <h4>54.1 <span class="Heading">The family and categories of partial permutations</span></h4>
178
179 <p><a id="X7EECE133792B30FC" name="X7EECE133792B30FC"></a></p>
180
181 <h5>54.1-1 IsPartialPerm</h5>
182
183 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsPartialPerm</code>( <var class="Arg">obj</var> )</td><td class="tdright">(&nbsp;category&nbsp;)</td></tr></table></div>
184 <p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>
185
186 <p>Every partial permutation in <strong class="pkg">GAP</strong> belongs to the category <code class="code">IsPartialPerm</code>. Basic operations for partial permutations are <code class="func">DomainOfPartialPerm</code> (<a href="chap54.html#X784A14F787E041D7"><span class="RefLink">54.3-4</span></a>), <code class="func">ImageListOfPartialPerm</code> (<a href="chap54.html#X8333293F87F654FA"><span class="RefLink">54.3-6</span></a>), <code class="func">ImageSetOfPartialPerm</code> (<a href="chap54.html#X7F0724A07A14DCF7"><span class="RefLink">54.3-7</span></a>), <code class="func">RankOfPartialPerm</code> (<a href="chap54.html#X7C1ABD8A80E95B39"><span class="RefLink">54.3-3</span></a>), <code class="func">DegreeOfPartialPerm</code> (<a href="chap54.html#X8612A4DC864E7959"><span class="RefLink">54.3-1</span></a>), multiplication of two partial permutations is via <code class="keyw">*</code>, and exponentiation with the first argument a positive integer <code class="code">i</code> and second argument a partial permutation <code class="code">f</code> where the result is the image <code class="code">i^f</code> of the point <code class="code">i</code> under <code class="code">f</code>. The inverse of a partial permutation <code class="code">f</code> can be obtains using <code class="code">f^-1</code>.</p>
187
188 <p><a id="X8262A827790DD1CC" name="X8262A827790DD1CC"></a></p>
189
190 <h5>54.1-2 IsPartialPermCollection</h5>
191
192 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsPartialPermCollection</code>( <var class="Arg">obj</var> )</td><td class="tdright">(&nbsp;category&nbsp;)</td></tr></table></div>
193 <p>Every collection of partial permutations belongs to the category <code class="code">IsPartialPermCollection</code>. For example, a semigroup of partial permutations belongs in <code class="code">IsPartialPermCollection</code>.</p>
194
195 <p><a id="X7E63D17780F64FBA" name="X7E63D17780F64FBA"></a></p>
196
197 <h5>54.1-3 PartialPermFamily</h5>
198
199 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PartialPermFamily</code></td><td class="tdright">(&nbsp;family&nbsp;)</td></tr></table></div>
200 <p>The family of all partial permutations is <code class="code">PartialPermFamily</code></p>
201
202 <p><a id="X7B9D451D7FDA1DD8" name="X7B9D451D7FDA1DD8"></a></p>
203
204 <h4>54.2 <span class="Heading">Creating partial permutations</span></h4>
205
206 <p>There are several ways of creating partial permutations in <strong class="pkg">GAP</strong>, which are described in this section.</p>
207
208 <p><a id="X8538BAE77F2FB2F8" name="X8538BAE77F2FB2F8"></a></p>
209
210 <h5>54.2-1 PartialPerm</h5>
211
212 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PartialPerm</code>( <var class="Arg">dom</var>, <var class="Arg">img</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
213 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PartialPerm</code>( <var class="Arg">list</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
214 <p>Returns: A partial permutation.</p>
215
216 <p>Partial permutations can be created in two ways: by giving the domain and the image, or the dense image list.</p>
217
218
219 <dl>
220 <dt><strong class="Mark">Domain and image</strong></dt>
221 <dd><p>The partial permutation defined by a domain <var class="Arg">dom</var> and image <var class="Arg">img</var>, where <var class="Arg">dom</var> is a set of positive integers and <var class="Arg">img</var> is a duplicate free list of positive integers, maps <var class="Arg">dom</var><code class="code">[i]</code> to <var class="Arg">img</var><code class="code">[i]</code>. For example, the partial permutation mapping <code class="code">1</code> and <code class="code">5</code> to <code class="code">20</code> and <code class="code">2</code> can be created using:</p>
222
223
224 <div class="example"><pre>PartialPerm([1,5],[20,2]); </pre></div>
225
226 <p>In this setting, <code class="code">PartialPerm</code> is the analogue in the context of partial permutations of <code class="func">MappingPermListList</code> (<a href="chap42.html#X8087DCC780B9656A"><span class="RefLink">42.5-3</span></a>).</p>
227
228 </dd>
229 <dt><strong class="Mark">Dense image list</strong></dt>
230 <dd><p>The partial permutation defined by a dense image list <var class="Arg">list</var>, maps the positive integer <code class="code">i</code> to <var class="Arg">list</var><code class="code">[i]</code> if <var class="Arg">list</var><code class="code">[i]&lt;&gt;0</code> and is undefined at <code class="code">i</code> if <var class="Arg">list</var><code class="code">[i]=0</code>. For example, the partial permutation mapping <code class="code">1</code> and <code class="code">5</code> to <code class="code">20</code> and <code class="code">2</code> can be created using:</p>
231
232
233 <div class="example"><pre>PartialPerm([20,0,0,0,2]);</pre></div>
234
235 <p>In this setting, <code class="code">PartialPerm</code> is the analogue in the context of partial permutations of <code class="func">PermList</code> (<a href="chap42.html#X78D611D17EA6E3BC"><span class="RefLink">42.5-2</span></a>).</p>
236
237 </dd>
238 </dl>
239 <p>Regardless of which of these two methods are used to create a partial permutation in <strong class="pkg">GAP</strong> the internal representation is the same.</p>
240
241 <p>If the largest point in the domain is larger than the rank of the partial permutation, then using the dense image list to define the partial permutation will require less typing; otherwise using the domain and the image will require less typing. For example, the partial permutation mapping <code class="code">10000</code> to <code class="code">1</code> can be defined using:</p>
242
243
244 <div class="example"><pre>PartialPerm([10000], [1]);</pre></div>
245
246 <p>but using the dense image list would require a list with <code class="code">9999</code> entries equal to <code class="code">0</code> and the final entry equal to <code class="code">1</code>. On the other hand, the identity on <code class="code">[1,2,3,4,6]</code> can be defined using:</p>
247
248
249 <div class="example"><pre>PartialPerm([1,2,3,4,0,6]);</pre></div>
250
251 <p>Please note that a partial permutation in <strong class="pkg">GAP</strong> is never a permutation nor is a permutation ever a partial permutation. For example, the permutation <code class="code">(1,4,2)</code> fixes <code class="code">3</code> but the partial permutation <code class="code">PartialPerm([4,1,0,2]);</code> is not defined on <code class="code">3</code>.</p>
252
253 <p><a id="X81188D9F83F64222" name="X81188D9F83F64222"></a></p>
254
255 <h5>54.2-2 PartialPermOp</h5>
256
257 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PartialPermOp</code>( <var class="Arg">obj</var>, <var class="Arg">list</var>[, <var class="Arg">func</var>] )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
258 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PartialPermOpNC</code>( <var class="Arg">obj</var>, <var class="Arg">list</var>[, <var class="Arg">func</var>] )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
259 <p>Returns: A partial permutation or <code class="keyw">fail</code>.</p>
260
261 <p><code class="func">PartialPermOp</code> returns the partial permutation that corresponds to the action of the object <var class="Arg">obj</var> on the domain or list <var class="Arg">list</var> via the function <var class="Arg">func</var>. If the optional third argument <var class="Arg">func</var> is not specified, then the action <code class="func">OnPoints</code> (<a href="chap41.html#X7FE417DD837987B4"><span class="RefLink">41.2-1</span></a>) is used by default. Note that the returned partial permutation refers to the positions in <var class="Arg">list</var> even if <var class="Arg">list</var> itself consists of integers.</p>
262
263 <p>This function is the analogue in the context of partial permutations of <code class="func">Permutation</code> (<a href="chap41.html#X7807A33381DCAB26"><span class="RefLink">41.9-1</span></a>) or <code class="func">TransformationOp</code> (<a href="chap53.html#X7C2A3FC9782F2099"><span class="RefLink">53.2-5</span></a>).</p>
264
265 <p>If <var class="Arg">obj</var> does not map the elements of <var class="Arg">list</var> injectively, then <code class="keyw">fail</code> is returned.</p>
266
267 <p><code class="func">PartialPermOpNC</code> does not check that <var class="Arg">obj</var> maps elements of <var class="Arg">list</var> injectively or that a partial permutation is defined by the action of <var class="Arg">obj</var> on <var class="Arg">list</var> via <var class="Arg">func</var>. This function should be used only with caution, in situations where it is guaranteed that the arguments have the required properties.</p>
268
269
270 <div class="example"><pre>
271 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=Transformation( [ 9, 10, 4, 2, 10, 5, 9, 10, 9, 6 ] );;</span>
272 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PartialPermOp(f, [ 6 .. 8 ], OnPoints);</span>
273 [1,4][2,5][3,6]</pre></div>
274
275 <p><a id="X80ABBF4883C79060" name="X80ABBF4883C79060"></a></p>
276
277 <h5>54.2-3 RestrictedPartialPerm</h5>
278
279 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RestrictedPartialPerm</code>( <var class="Arg">f</var>, <var class="Arg">set</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
280 <p>Returns: A partial permutation.</p>
281
282 <p><code class="code">RestrictedPartialPerm</code> returns a new partial permutation that acts on the points in the set of positive integers <var class="Arg">set</var> in the same way as the partial permutation <var class="Arg">f</var>, and that is undefined on those points that are not in <var class="Arg">set</var>.</p>
283
284
285 <div class="example"><pre>
286 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 3, 4, 7, 8, 9 ], [ 9, 4, 1, 6, 2, 8 ] );;</span>
287 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">RestrictedPartialPerm(f, [ 2, 3, 6, 10 ] );</span>
288 [3,4]</pre></div>
289
290 <p><a id="X849668DD7B0B9E3B" name="X849668DD7B0B9E3B"></a></p>
291
292 <h5>54.2-4 JoinOfPartialPerms</h5>
293
294 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; JoinOfPartialPerms</code>( <var class="Arg">arg</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
295 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; JoinOfIdempotentPartialPermsNC</code>( <var class="Arg">arg</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
296 <p>Returns: A partial permutation or <code class="keyw">fail</code>.</p>
297
298 <p>The join of partial permutations <var class="Arg">f</var> and <var class="Arg">g</var> is just the join, or supremum, of <var class="Arg">f</var> and <var class="Arg">g</var> under the natural partial ordering of partial permutations.</p>
299
300 <p><code class="code">JoinOfPartialPerms</code> returns the union of the partial permutations in its argument if this defines a partial permutation, and <code class="keyw">fail</code> if it is not. The argument <var class="Arg">arg</var> can be a partial permutation collection or a number of partial permutations.</p>
301
302 <p>The function <code class="code">JoinOfIdempotentPartialPermsNC</code> returns the join of its argument which is assumed to be a collection of idempotent partial permutations or a number of idempotent partial permutations. It is not checked that the arguments are idempotents. The performance of this function is higher than <code class="code">JoinOfPartialPerms</code> when it is known <em>a priori</em> that the argument consists of idempotents.</p>
303
304 <p>The union of <var class="Arg">f</var> and <var class="Arg">g</var> is a partial permutation if and only if <var class="Arg">f</var> and <var class="Arg">g</var> agree on the intersection dom(<var class="Arg">f</var>)<span class="SimpleMath">∩</span> dom(<var class="Arg">g</var>) of their domains and the images of dom(<var class="Arg">f</var>)<span class="SimpleMath">∖</span> dom(<var class="Arg">g</var>) and dom(<var class="Arg">g</var>)<span class="SimpleMath">∖</span> dom(<var class="Arg">f</var>) under <var class="Arg">f</var> and <var class="Arg">g</var>, respectively, are disjoint.</p>
305
306
307 <div class="example"><pre>
308 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 6, 8, 10 ], [ 2, 6, 7, 9, 1, 5 ] );</span>
309 [3,7][8,1,2,6,9][10,5]
310 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">g:=PartialPerm( [ 11, 12, 14, 16, 18, 19 ],</span>
311 <span class="GAPprompt">&gt;</span> <span class="GAPinput">[ 17, 20, 11, 19, 14, 12 ] );</span>
312 [16,19,12,20][18,14,11,17]
313 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">JoinOfPartialPerms(f, g);</span>
314 [3,7][8,1,2,6,9][10,5][16,19,12,20][18,14,11,17]
315 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 4, 5, 6, 7 ], [ 5, 7, 3, 1, 4 ] );</span>
316 [6,1,5,3](4,7)
317 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">g:=PartialPerm( [ 100 ], [ 1 ] );</span>
318 [100,1]
319 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">JoinOfPartialPerms(f, g);</span>
320 fail
321 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 3, 4 ], [ 3, 2, 4 ] );</span>
322 [1,3,2](4)
323 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">g:=PartialPerm( [ 1, 2, 4 ], [ 2, 3, 4 ] );</span>
324 [1,2,3](4)
325 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">JoinOfPartialPerms(f, g);</span>
326 fail
327 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1 ], [ 2 ] );</span>
328 [1,2]
329 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">JoinOfPartialPerms(f, f^-1);</span>
330 (1,2)</pre></div>
331
332 <p><a id="X81E2B6977E28CD00" name="X81E2B6977E28CD00"></a></p>
333
334 <h5>54.2-5 MeetOfPartialPerms</h5>
335
336 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MeetOfPartialPerms</code>( <var class="Arg">arg</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
337 <p>Returns: A partial permutation.</p>
338
339 <p>The meet of partial permutations <var class="Arg">f</var> and <var class="Arg">g</var> is just the meet, or infimum, of <var class="Arg">f</var> and <var class="Arg">g</var> under the natural partial ordering of partial permutations. In other words, the meet is the greatest partial permutation which is a restriction of both <var class="Arg">f</var> and <var class="Arg">g</var>.</p>
340
341 <p>Note that unlike the join of partial permutations, the meet always exists.</p>
342
343 <p><code class="func">MeetOfPartialPerms</code> returns the meet of the partial permutations in its argument. The argument <var class="Arg">arg</var> can be a partial permutation collection or a number of partial permutations.</p>
344
345
346 <div class="example"><pre>
347 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 6, 100000 ], [ 2, 6, 7, 1, 5 ] );</span>
348 [3,7][100000,5](1,2,6)
349 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">g:=PartialPerm( [ 1, 2, 3, 4, 6 ], [ 2, 4, 6, 1, 5 ] );</span>
350 [3,6,5](1,2,4)
351 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MeetOfPartialPerms(f, g);</span>
352 [1,2]
353 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">g:=PartialPerm( [ 1, 2, 3, 5, 6, 7, 9, 10 ],</span>
354 <span class="GAPprompt">&gt;</span> <span class="GAPinput">[ 4, 10, 5, 6, 7, 1, 3, 2 ] );</span>
355 [9,3,5,6,7,1,4](2,10)
356 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MeetOfPartialPerms(f, g);</span>
357 &lt;empty partial perm&gt;</pre></div>
358
359 <p><a id="X80EFB142817A0A9F" name="X80EFB142817A0A9F"></a></p>
360
361 <h5>54.2-6 EmptyPartialPerm</h5>
362
363 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; EmptyPartialPerm</code>( )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
364 <p>Returns: The empty partial permutation.</p>
365
366 <p>The empty partial permutation is returned by this function when it is called with no arguments. This is just short hand for <code class="code">PartialPerm([]);</code>.</p>
367
368
369 <div class="example"><pre>
370 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">EmptyPartialPerm();</span>
371 &lt;empty partial perm&gt;</pre></div>
372
373 <p><a id="X7E6ADC8583C31530" name="X7E6ADC8583C31530"></a></p>
374
375 <h5>54.2-7 <span class="Heading">RandomPartialPerm</span></h5>
376
377 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RandomPartialPerm</code>( <var class="Arg">n</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
378 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RandomPartialPerm</code>( <var class="Arg">set</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
379 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RandomPartialPerm</code>( <var class="Arg">dom</var>, <var class="Arg">img</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
380 <p>Returns: A random partial permutation.</p>
381
382 <p>In its first form, <code class="code">RandomPartialPerm</code> returns a randomly chosen partial permutation where points in the domain and image are bounded above by the positive integer <var class="Arg">n</var>.</p>
383
384
385 <div class="example"><pre><span class="GAPprompt">gap&gt;</span> <span class="GAPinput">RandomPartialPerm(10);</span>
386 [2,9][4,1,6,5][7,3](8)</pre></div>
387
388 <p>In its second form, <code class="code">RandomPartialPerm</code> returns a randomly chosen partial permutation with points in the domain and image contained in the set of positive integers <var class="Arg">set</var>.</p>
389
390
391 <div class="example"><pre><span class="GAPprompt">gap&gt;</span> <span class="GAPinput">RandomPartialPerm([1,2,3,1000]);</span>
392 [2,3,1000](1)</pre></div>
393
394 <p>In its third form, <code class="code">RandomPartialPerm</code> creates a randomly chosen partial permutation with domain contained in the set of positive integers <var class="Arg">dom</var> and image contained in the set of positive integers <var class="Arg">img</var>. The arguments <var class="Arg">dom</var> and <var class="Arg">img</var> do not have to have equal length.</p>
395
396 <p>Note that it is not guaranteed in either of these cases that partial permutations are chosen with a uniform distribution.</p>
397
398 <p><a id="X8779F0997D0FDA78" name="X8779F0997D0FDA78"></a></p>
399
400 <h4>54.3 <span class="Heading">Attributes for partial permutations</span></h4>
401
402 <p>In this section we describe the functions available in <strong class="pkg">GAP</strong> for finding various attributes of partial permutations.</p>
403
404 <p><a id="X8612A4DC864E7959" name="X8612A4DC864E7959"></a></p>
405
406 <h5>54.3-1 DegreeOfPartialPerm</h5>
407
408 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; DegreeOfPartialPerm</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
409 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; DegreeOfPartialPermCollection</code>( <var class="Arg">coll</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
410 <p>Returns: A non-negative integer.</p>
411
412 <p>The <em>degree</em> of a partial permutation <var class="Arg">f</var> is the largest positive integer where it is defined, i.e. the maximum element in the domain of <var class="Arg">f</var>.</p>
413
414 <p>The degree a collection of partial permutations <var class="Arg">coll</var> is the largest degree of any partial permutation in <var class="Arg">coll</var>.</p>
415
416
417 <div class="example"><pre>
418 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 6, 8, 10 ], [ 2, 6, 7, 9, 1, 5 ] );</span>
419 [3,7][8,1,2,6,9][10,5]
420 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">DegreeOfPartialPerm(f);</span>
421 10</pre></div>
422
423 <p><a id="X8413D0EF7DEE1FFF" name="X8413D0EF7DEE1FFF"></a></p>
424
425 <h5>54.3-2 CodegreeOfPartialPerm</h5>
426
427 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; CodegreeOfPartialPerm</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
428 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; CodegreeOfPartialPermCollection</code>( <var class="Arg">coll</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
429 <p>Returns: A non-negative integer.</p>
430
431 <p>The <em>codegree</em> of a partial permutation <var class="Arg">f</var> is the largest positive integer in its image.</p>
432
433 <p>The codegree a collection of partial permutations <var class="Arg">coll</var> is the largest codegree of any partial permutation in <var class="Arg">coll</var>.</p>
434
435
436 <div class="example"><pre>
437 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 4, 5, 8, 10 ], [ 7, 1, 4, 3, 2, 6, 5 ] );</span>
438 [8,6][10,5,2,1,7](3,4)
439 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CodegreeOfPartialPerm(f);</span>
440 7</pre></div>
441
442 <p><a id="X7C1ABD8A80E95B39" name="X7C1ABD8A80E95B39"></a></p>
443
444 <h5>54.3-3 RankOfPartialPerm</h5>
445
446 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RankOfPartialPerm</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
447 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RankOfPartialPermCollection</code>( <var class="Arg">coll</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
448 <p>Returns: A non-negative integer.</p>
449
450 <p>The <em>rank</em> of a partial permutation <var class="Arg">f</var> is the size of its domain, or equivalently the size of its image set or image list.</p>
451
452 <p>The rank of a partial permutation collection <var class="Arg">coll</var> is the size of the union of the domains of the elements of <var class="Arg">coll</var>, or equivalently, the total number of points on which the elements of <var class="Arg">coll</var> act. Note that this is value may not the same as the size of the union of the images of the elements in <var class="Arg">coll</var>.</p>
453
454
455 <div class="example"><pre>
456 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 4, 6, 8, 9 ], [ 7, 10, 1, 9, 4, 2 ] );</span>
457 [6,9,2,10][8,4,1,7]
458 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">RankOfPartialPerm(f);</span>
459 6</pre></div>
460
461 <p><a id="X784A14F787E041D7" name="X784A14F787E041D7"></a></p>
462
463 <h5>54.3-4 DomainOfPartialPerm</h5>
464
465 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; DomainOfPartialPerm</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
466 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; DomainOfPartialPermCollection</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
467 <p>Returns: A set of positive integers (maybe empty).</p>
468
469 <p>The <em>domain</em> of a partial permutation <var class="Arg">f</var> is the set of positive integers where <var class="Arg">f</var> is defined.</p>
470
471 <p>The domain of a partial permutation collection <var class="Arg">coll</var> is the union of the domains of its elements.</p>
472
473
474 <div class="example"><pre>
475 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 6, 8, 10 ], [ 2, 6, 7, 9, 1, 5 ] );</span>
476 [3,7][8,1,2,6,9][10,5]
477 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">DomainOfPartialPerm(f);</span>
478 [ 1, 2, 3, 6, 8, 10 ]</pre></div>
479
480 <p><a id="X7CD84B107831E0FC" name="X7CD84B107831E0FC"></a></p>
481
482 <h5>54.3-5 ImageOfPartialPermCollection</h5>
483
484 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ImageOfPartialPermCollection</code>( <var class="Arg">coll</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
485 <p>Returns: A set of positive integers (maybe empty).</p>
486
487 <p>The <em>image</em> of a partial permutation collection <var class="Arg">coll</var> is the union of the images of its elements.</p>
488
489
490 <div class="example"><pre>
491 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S := SymmetricInverseSemigroup(5);</span>
492 &lt;symmetric inverse monoid of degree 5&gt;
493 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ImageOfPartialPermCollection(GeneratorsOfInverseSemigroup(S));</span>
494 [ 1 .. 5 ]</pre></div>
495
496 <p><a id="X8333293F87F654FA" name="X8333293F87F654FA"></a></p>
497
498 <h5>54.3-6 ImageListOfPartialPerm</h5>
499
500 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ImageListOfPartialPerm</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
501 <p>Returns: The list of images of a partial permutation.</p>
502
503 <p>The <em>image list</em> of a partial permutation <var class="Arg">f</var> is the list of images of the elements of the domain <var class="Arg">f</var> where <code class="code">ImageListOfPartialPerm(<var class="Arg">f</var>)[i]=DomainOfPartialPerm(<var class="Arg">f</var>)[i]^<var class="Arg">f</var></code> for any <code class="code">i</code> in the range from <code class="code">1</code> to the rank of <var class="Arg">f</var>.</p>
504
505
506 <div class="example"><pre>
507 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 4, 5, 8, 10 ], [ 7, 1, 4, 3, 2, 6, 5 ] );</span>
508 [8,6][10,5,2,1,7](3,4)
509 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ImageListOfPartialPerm(f);</span>
510 [ 7, 1, 4, 3, 2, 6, 5 ]</pre></div>
511
512 <p><a id="X7F0724A07A14DCF7" name="X7F0724A07A14DCF7"></a></p>
513
514 <h5>54.3-7 ImageSetOfPartialPerm</h5>
515
516 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ImageSetOfPartialPerm</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
517 <p>Returns: The image set of a partial permutation.</p>
518
519 <p>The <em>image set</em> of a partial permutation <code class="code">f</code> is just the set of points in the image list (i.e. the image list after it has been sorted into increasing order).</p>
520
521
522 <div class="example"><pre>
523 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 5, 7, 10 ], [ 10, 2, 3, 5, 7, 6 ] );</span>
524 [1,10,6](2)(3)(5)(7)
525 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ImageSetOfPartialPerm(f);</span>
526 [ 2, 3, 5, 6, 7, 10 ]</pre></div>
527
528 <p><a id="X82AAFF938623422E" name="X82AAFF938623422E"></a></p>
529
530 <h5>54.3-8 FixedPointsOfPartialPerm</h5>
531
532 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FixedPointsOfPartialPerm</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
533 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FixedPointsOfPartialPerm</code>( <var class="Arg">coll</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
534 <p>Returns: A set of positive integers.</p>
535
536 <p><code class="code">FixedPointsOfPartialPerm</code> returns the set of points <code class="code">i</code> in the domain of the partial permutation <var class="Arg">f</var> such that <code class="code">i^<var class="Arg">f</var>=i</code>.</p>
537
538 <p>When the argument is a collection of partial permutations <var class="Arg">coll</var>, <code class="code">FixedPointsOfPartialPerm</code> returns the set of points fixed by every element of the collection of partial permutations <var class="Arg">coll</var>.</p>
539
540
541 <div class="example"><pre>
542 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f := PartialPerm( [ 1, 2, 3, 6, 7 ], [ 1, 3, 4, 7, 5 ] );</span>
543 [2,3,4][6,7,5](1)
544 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">FixedPointsOfPartialPerm(f);</span>
545 [ 1 ]
546 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f := PartialPerm([1 .. 10]);;</span>
547 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">FixedPointsOfPartialPerm(f);</span>
548 [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]</pre></div>
549
550 <p><a id="X82FE981A87FAA2DC" name="X82FE981A87FAA2DC"></a></p>
551
552 <h5>54.3-9 MovedPoints</h5>
553
554 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MovedPoints</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
555 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MovedPoints</code>( <var class="Arg">coll</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
556 <p>Returns: A set of positive integers.</p>
557
558 <p><code class="code">MovedPoints</code> returns the set of points <code class="code">i</code> in the domain of the partial permutation <var class="Arg">f</var> such that <code class="code">i^<var class="Arg">f</var>&lt;&gt;i</code>.</p>
559
560 <p>When the argument is a collection of partial permutations <var class="Arg">coll</var>, <code class="code">MovedPoints</code> returns the set of points moved by some element of the collection of partial permutations <var class="Arg">coll</var>.</p>
561
562
563 <div class="example"><pre>
564 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f := PartialPerm( [ 1, 2, 3, 4 ], [ 5, 7, 1, 6 ] );</span>
565 [2,7][3,1,5][4,6]
566 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MovedPoints(f);</span>
567 [ 1, 2, 3, 4 ]
568 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">FixedPointsOfPartialPerm(f);</span>
569 [ ]
570 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">FixedPointsOfPartialPerm(PartialPerm([1 .. 4]));</span>
571 [ 1, 2, 3, 4 ]</pre></div>
572
573 <p><a id="X7FAF969C84CDC742" name="X7FAF969C84CDC742"></a></p>
574
575 <h5>54.3-10 NrFixedPoints</h5>
576
577 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NrFixedPoints</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
578 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NrFixedPoints</code>( <var class="Arg">coll</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
579 <p>Returns: A positive integer.</p>
580
581 <p><code class="code">NrFixedPoints</code> returns the number of points <code class="code">i</code> in the domain of the partial permutation <var class="Arg">f</var> such that <code class="code">i^<var class="Arg">f</var>=i</code>.</p>
582
583 <p>When the argument is a collection of partial permutations <var class="Arg">coll</var>, <code class="code">NrFixedPoints</code> returns the number of points fixed by every element of the collection of partial permutations <var class="Arg">coll</var>.</p>
584
585
586 <div class="example"><pre>
587 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f := PartialPerm( [ 1, 2, 3, 4, 5 ], [ 3, 2, 4, 6, 1 ] );</span>
588 [5,1,3,4,6](2)
589 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NrFixedPoints(f);</span>
590 1
591 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NrFixedPoints(PartialPerm([1 .. 10]));</span>
592 10</pre></div>
593
594 <p><a id="X81F5C64E7DAD27A7" name="X81F5C64E7DAD27A7"></a></p>
595
596 <h5>54.3-11 NrMovedPoints</h5>
597
598 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NrMovedPoints</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
599 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NrMovedPoints</code>( <var class="Arg">coll</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
600 <p>Returns: A positive integer.</p>
601
602 <p><code class="code">NrMovedPoints</code> returns the number of points <code class="code">i</code> in the domain of the partial permutation <var class="Arg">f</var> such that <code class="code">i^<var class="Arg">f</var>&lt;&gt;i</code>.</p>
603
604 <p>When the argument is a collection of partial permutations <var class="Arg">coll</var>, <code class="code">NrMovedPoints</code> returns the number of points moved by some element of the collection of partial permutations <var class="Arg">coll</var>.</p>
605
606
607 <div class="example"><pre>
608 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f := PartialPerm( [ 1, 2, 3, 4, 5, 7, 8 ], [ 4, 5, 6, 7, 1, 3, 2 ] );</span>
609 [8,2,5,1,4,7,3,6]
610 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NrMovedPoints(f);</span>
611 7
612 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NrMovedPoints(PartialPerm([1 .. 4]));</span>
613 0</pre></div>
614
615 <p><a id="X84A49C977E1E29AA" name="X84A49C977E1E29AA"></a></p>
616
617 <h5>54.3-12 SmallestMovedPoint</h5>
618
619 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SmallestMovedPoint</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
620 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SmallestMovedPoint</code>( <var class="Arg">coll</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
621 <p>Returns: A positive integer or <code class="keyw">infinity</code>.</p>
622
623 <p><code class="code">SmallestMovedPoint</code> returns the smallest positive integer <code class="code">i</code> such that <code class="code">i^<var class="Arg">f</var>&lt;&gt;i</code> if such an <code class="code">i</code> exists. If <var class="Arg">f</var> is an identity partial permutation, then <code class="keyw">infinity</code> is returned.</p>
624
625 <p>If the argument is a collection of partial permutations <var class="Arg">coll</var>, then the smallest point which is moved by at least one element of <var class="Arg">coll</var> is returned, if such a point exists. If <var class="Arg">coll</var> only contains identity partial permutations, then <code class="code">SmallestMovedPoint</code> returns <code class="keyw">infinity</code>.</p>
626
627
628 <div class="example"><pre>
629 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f := PartialPerm( [ 1, 3 ], [ 4, 3 ] );</span>
630 [1,4](3)
631 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SmallestMovedPoint(f);</span>
632 1
633 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SmallestMovedPoint(PartialPerm([1 .. 10]));</span>
634 infinity</pre></div>
635
636 <p><a id="X7D4290A785ABC86D" name="X7D4290A785ABC86D"></a></p>
637
638 <h5>54.3-13 LargestMovedPoint</h5>
639
640 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LargestMovedPoint</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
641 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LargestMovedPoint</code>( <var class="Arg">coll</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
642 <p>Returns: A positive integer or <code class="keyw">infinity</code>.</p>
643
644 <p><code class="code">LargestMovedPoint</code> returns the largest positive integers <code class="code">i</code> such that <code class="code">i^<var class="Arg">f</var>&lt;&gt;i</code> if such an <code class="code">i</code> exists. If <var class="Arg">f</var> is the identity partial permutation, then <code class="code">0</code> is returned.</p>
645
646 <p>If the argument is a collection of partial permutations <var class="Arg">coll</var>, then the largest point which is moved by at least one element of <var class="Arg">coll</var> is returned, if such a point exists. If <var class="Arg">coll</var> only contains identity partial permutations, then <code class="code">LargestMovedPoint</code> returns <code class="code">0</code>.</p>
647
648
649 <div class="example"><pre>
650 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f := PartialPerm( [ 1, 3, 4, 5 ], [ 5, 1, 6, 4 ] );</span>
651 [3,1,5,4,6]
652 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LargestMovedPoint(f);</span>
653 5
654 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LargestMovedPoint(PartialPerm([1 .. 10]));</span>
655 0</pre></div>
656
657 <p><a id="X85280F1A7B1014BA" name="X85280F1A7B1014BA"></a></p>
658
659 <h5>54.3-14 SmallestImageOfMovedPoint</h5>
660
661 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SmallestImageOfMovedPoint</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
662 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SmallestImageOfMovedPoint</code>( <var class="Arg">coll</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
663 <p>Returns: A positive integer or <code class="keyw">infinity</code>.</p>
664
665 <p><code class="code">SmallestImageOfMovedPoint</code> returns the smallest positive integer <code class="code">i^<var class="Arg">f</var></code> such that <code class="code">i^<var class="Arg">f</var>&lt;&gt;i</code> if such an <code class="code">i</code> exists. If <var class="Arg">f</var> is the identity partial permutation, then <code class="keyw">infinity</code> is returned.</p>
666
667 <p>If the argument is a collection of partial permutations <var class="Arg">coll</var>, then the smallest integer which is the image a point moved by at least one element of <var class="Arg">coll</var> is returned, if such a point exists. If <var class="Arg">coll</var> only contains identity partial permutations, then <code class="code">SmallestImageOfMovedPoint</code> returns <code class="keyw">infinity</code>.</p>
668
669
670 <div class="example"><pre>
671 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S := SymmetricInverseSemigroup(5);</span>
672 &lt;symmetric inverse monoid of degree 5&gt;
673 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SmallestImageOfMovedPoint(S);</span>
674 1
675 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S := Semigroup(PartialPerm([10 .. 100], [10 .. 100]));;</span>
676 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SmallestImageOfMovedPoint(S);</span>
677 infinity
678 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f := PartialPerm( [ 1, 2, 3, 6 ] );</span>
679 [4,6](1)(2)(3)
680 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SmallestImageOfMovedPoint(f);</span>
681 6</pre></div>
682
683 <p><a id="X7A95CD437BC1CB1A" name="X7A95CD437BC1CB1A"></a></p>
684
685 <h5>54.3-15 LargestImageOfMovedPoint</h5>
686
687 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LargestImageOfMovedPoint</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
688 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LargestImageOfMovedPoint</code>( <var class="Arg">coll</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
689 <p>Returns: A positive integer.</p>
690
691 <p><code class="code">LargestImageOfMovedPoint</code> returns the largest positive integer <code class="code">i^<var class="Arg">f</var></code> such that <code class="code">i^<var class="Arg">f</var>&lt;&gt;i</code> if such an <code class="code">i</code> exists. If <var class="Arg">f</var> is an identity partial permutation, then <code class="code">0</code> is returned.</p>
692
693 <p>If the argument is a collection of partial permutations <var class="Arg">coll</var>, then the largest integer which is the image of a point moved by at least one element of <var class="Arg">coll</var> is returned, if such a point exists. If <var class="Arg">coll</var> only contains identity partial permutations, then <code class="code">LargestImageOfMovedPoint</code> returns <code class="code">0</code>.</p>
694
695
696 <div class="example"><pre>
697 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S := SymmetricInverseSemigroup(5);</span>
698 &lt;symmetric inverse monoid of degree 5&gt;
699 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LargestImageOfMovedPoint(S);</span>
700 5
701 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S := Semigroup(PartialPerm([10 .. 100], [10 .. 100]));;</span>
702 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LargestImageOfMovedPoint(S);</span>
703 0
704 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f := PartialPerm( [ 1, 2, 3, 6 ] );;</span>
705 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LargestImageOfMovedPoint(f);</span>
706 6</pre></div>
707
708 <p><a id="X873A9F717DA75CBC" name="X873A9F717DA75CBC"></a></p>
709
710 <h5>54.3-16 IndexPeriodOfPartialPerm</h5>
711
712 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IndexPeriodOfPartialPerm</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
713 <p>Returns: A pair of positive integers.</p>
714
715 <p>Returns the least positive integers <code class="code">m, r</code> such that <code class="code"><var class="Arg">f</var>^(m+r)=<var class="Arg">f</var>^m</code>, which are known as the <em>index</em> and <em>period</em> of the partial permutation <var class="Arg">f</var>.</p>
716
717
718 <div class="example"><pre>
719 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 5, 6, 7, 8, 11, 12, 16, 19 ],</span>
720 <span class="GAPprompt">&gt;</span> <span class="GAPinput">[ 9, 18, 20, 11, 5, 16, 8, 19, 14, 13, 1 ] );</span>
721 [2,18][3,20][6,5,11,19,1,9][7,16,13][12,14](8)
722 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IndexPeriodOfPartialPerm(f);</span>
723 [ 6, 1 ]
724 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f^6=f^7;</span>
725 true</pre></div>
726
727 <p><a id="X7C04AA377F080722" name="X7C04AA377F080722"></a></p>
728
729 <h5>54.3-17 SmallestIdempotentPower</h5>
730
731 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SmallestIdempotentPower</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
732 <p>Returns: A positive integer.</p>
733
734 <p>This function returns the least positive integer <code class="code">n</code> such that the partial permutation <code class="code"><var class="Arg">f</var>^n</code> is an idempotent. The smallest idempotent power of <var class="Arg">f</var> is the least multiple of the period of <var class="Arg">f</var> that is greater than or equal to the index of <var class="Arg">f</var>; see <code class="func">IndexPeriodOfPartialPerm</code> (<a href="chap54.html#X873A9F717DA75CBC"><span class="RefLink">54.3-16</span></a>).</p>
735
736
737 <div class="example"><pre>
738 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 4, 5, 7, 8, 10, 11, 13, 18, 19, 20 ],</span>
739 <span class="GAPprompt">&gt;</span> <span class="GAPinput">[ 5, 1, 7, 3, 10, 2, 12, 14, 11, 16, 6, 9, 15 ] );</span>
740 [4,3,7,2,1,5,10,14][8,12][13,16][18,6][19,9][20,15](11)
741 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SmallestIdempotentPower(f);</span>
742 8
743 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f^8;</span>
744 &lt;identity partial perm on [ 11 ]&gt;</pre></div>
745
746 <p><a id="X8185065E788BDD0D" name="X8185065E788BDD0D"></a></p>
747
748 <h5>54.3-18 ComponentsOfPartialPerm</h5>
749
750 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ComponentsOfPartialPerm</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
751 <p>Returns: A list of lists of positive integer.</p>
752
753 <p><code class="code">ComponentsOfPartialPerm</code> returns a list of the components of the partial permutation <var class="Arg">f</var>. Each component is a subset of the domain of <var class="Arg">f</var>, and the union of the components equals the domain.</p>
754
755
756 <div class="example"><pre>
757 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 4, 5, 7, 8, 10, 11, 12, 13, 19 ],</span>
758 <span class="GAPprompt">&gt;</span> <span class="GAPinput">[ 20, 4, 6, 19, 9, 14, 3, 12, 17, 5, 15, 13 ] );</span>
759 [1,20][2,4,19,13,15][7,14][8,3,6][10,12,5,9][11,17]
760 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ComponentsOfPartialPerm(f);</span>
761 [ [ 1, 20 ], [ 2, 4, 19, 13, 15 ], [ 7, 14 ], [ 8, 3, 6 ],
762 [ 10, 12, 5, 9 ], [ 11, 17 ] ]</pre></div>
763
764 <p><a id="X7CB51EB67FFA95E9" name="X7CB51EB67FFA95E9"></a></p>
765
766 <h5>54.3-19 NrComponentsOfPartialPerm</h5>
767
768 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NrComponentsOfPartialPerm</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
769 <p>Returns: A positive integer.</p>
770
771 <p><code class="code">NrComponentsOfPartialPerm</code> returns the number of components of the partial permutation <var class="Arg">f</var> on its domain.</p>
772
773
774 <div class="example"><pre>
775 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 4, 5, 7, 8, 10, 11, 12, 13, 19 ],</span>
776 <span class="GAPprompt">&gt;</span> <span class="GAPinput">[ 20, 4, 6, 19, 9, 14, 3, 12, 17, 5, 15, 13 ] );</span>
777 [1,20][2,4,19,13,15][7,14][8,3,6][10,12,5,9][11,17]
778 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NrComponentsOfPartialPerm(f);</span>
779 6</pre></div>
780
781 <p><a id="X7AAAAE4082B30E18" name="X7AAAAE4082B30E18"></a></p>
782
783 <h5>54.3-20 ComponentRepsOfPartialPerm</h5>
784
785 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ComponentRepsOfPartialPerm</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
786 <p>Returns: A list of positive integers.</p>
787
788 <p><code class="code">ComponentRepsOfPartialPerm</code> returns the representatives, in the following sense, of the components of the partial permutation <var class="Arg">f</var>. Every component of <var class="Arg">f</var> contains a unique element in the domain but not the image of <var class="Arg">f</var>; this element is called the <em>representative</em> of the component. If <code class="code">i</code> is a representative of a component of <var class="Arg">f</var>, then for every <code class="code">j</code><span class="SimpleMath">not=</span><code class="code">i</code> in the component of <code class="code">i</code>, there exists a positive integer <code class="code">k</code> such that <code class="code">i ^ (<var class="Arg">f</var> ^ k) = j</code>. Unlike transformations, there is exactly one representative for every component of <var class="Arg">f</var>. <code class="code">ComponentRepsOfPartialPerm</code> returns the least number of representatives.</p>
789
790
791 <div class="example"><pre>
792 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 4, 5, 7, 8, 10, 11, 12, 13, 19 ],</span>
793 <span class="GAPprompt">&gt;</span> <span class="GAPinput">[ 20, 4, 6, 19, 9, 14, 3, 12, 17, 5, 15, 13 ] );</span>
794 [1,20][2,4,19,13,15][7,14][8,3,6][10,12,5,9][11,17]
795 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ComponentRepsOfPartialPerm(f);</span>
796 [ 1, 2, 7, 8, 10, 11 ]</pre></div>
797
798 <p><a id="X7A8FB86C78C49F85" name="X7A8FB86C78C49F85"></a></p>
799
800 <h5>54.3-21 LeftOne</h5>
801
802 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LeftOne</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
803 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RightOne</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
804 <p>Returns: A partial permutation.</p>
805
806 <p><code class="code">LeftOne</code> returns the identity partial permutation <code class="code">e</code> such that the domain and image of <code class="code">e</code> equal the domain of the partial permutation <var class="Arg">f</var> and such that <code class="code">e*<var class="Arg">f</var>=f</code>.</p>
807
808 <p><code class="code">RightOne</code> returns the identity partial permutation <code class="code">e</code> such that the domain and image of <code class="code">e</code> equal the image of <var class="Arg">f</var> and such that <code class="code"><var class="Arg">f</var>*e=f</code>.</p>
809
810
811 <div class="example"><pre>
812 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 4, 5, 6, 7 ], [ 10, 1, 6, 5, 8, 7 ] );</span>
813 [2,1,10][4,6,8](5)(7)
814 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">RightOne(f);</span>
815 &lt;identity partial perm on [ 1, 5, 6, 7, 8, 10 ]&gt;
816 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LeftOne(f);</span>
817 &lt;identity partial perm on [ 1, 2, 4, 5, 6, 7 ]&gt;</pre></div>
818
819 <p><a id="X857FC10C81507E8B" name="X857FC10C81507E8B"></a></p>
820
821 <h5>54.3-22 One</h5>
822
823 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; One</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
824 <p>Returns: A partial permutation.</p>
825
826 <p>As described in <code class="func">OneImmutable</code> (<a href="chap31.html#X8046262384895B2A"><span class="RefLink">31.10-2</span></a>), <code class="code">One</code> returns the multiplicative neutral element of the partial permutation <var class="Arg">f</var>, which is the identity partial permutation on the union of the domain and image of <var class="Arg">f</var>. Equivalently, the one of <var class="Arg">f</var> is the join of the right one and left one of <var class="Arg">f</var>.</p>
827
828
829 <div class="example"><pre>
830 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm([ 1, 2, 3, 4, 5, 7, 10 ], [ 3, 7, 9, 6, 1, 10, 2 ]);;</span>
831 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">One(f);</span>
832 &lt;identity partial perm on [ 1, 2, 3, 4, 5, 6, 7, 9, 10 ]&gt;</pre></div>
833
834 <p><a id="X7D90CF497D58D759" name="X7D90CF497D58D759"></a></p>
835
836 <h5>54.3-23 MultiplicativeZero</h5>
837
838 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MultiplicativeZero</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
839 <p>Returns: The empty partial permutation.</p>
840
841 <p>As described in <code class="func">MultiplicativeZero</code> (<a href="chap35.html#X7B39F93C8136D642"><span class="RefLink">35.4-11</span></a>), <code class="code">Zero</code> returns the multiplicative zero element of the partial permutation <var class="Arg">f</var>, which is the empty partial permutation.</p>
842
843
844 <div class="example"><pre>
845 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f := PartialPerm([ 1, 2, 3, 4, 5, 7, 10 ], [ 3, 7, 9, 6, 1, 10, 2 ]);;</span>
846 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MultiplicativeZero(f);</span>
847 &lt;empty partial perm&gt;</pre></div>
848
849 <p><a id="X8585AA8B78E9CDFB" name="X8585AA8B78E9CDFB"></a></p>
850
851 <h4>54.4 <span class="Heading">Changing the representation of a partial permutation</span></h4>
852
853 <p>It is possible that a partial permutation in <strong class="pkg">GAP</strong> can be represented by other types of objects, or that other types of <strong class="pkg">GAP</strong> objects can be represented by partial permutations. Partial permutations which are mathematically permutations can be converted into permutations in <strong class="pkg">GAP</strong> using the function <code class="func">AsPermutation</code> (<a href="chap42.html#X8353AB8987E35DF3"><span class="RefLink">42.5-6</span></a>). Similarly, a partial permutation can be converted into a transformation using <code class="func">AsTransformation</code> (<a href="chap53.html#X7C5360B2799943F3"><span class="RefLink">53.3-1</span></a>).</p>
854
855 <p>In this section we describe functions for converting other types of objects in <strong class="pkg">GAP</strong> into partial permutations.</p>
856
857 <p><a id="X81B32CB182489ACA" name="X81B32CB182489ACA"></a></p>
858
859 <h5>54.4-1 AsPartialPerm</h5>
860
861 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AsPartialPerm</code>( <var class="Arg">f</var>, <var class="Arg">set</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
862 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AsPartialPerm</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
863 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AsPartialPerm</code>( <var class="Arg">f</var>, <var class="Arg">n</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
864 <p>Returns: A partial permutation.</p>
865
866 <p>A permutation <var class="Arg">f</var> defines a partial permutation when it is restricted to any finite set of positive integers. <code class="code">AsPartialPerm</code> can be used to obtain this partial permutation.</p>
867
868 <p>There are several possible arguments for <code class="code">AsPartialPerm</code>:</p>
869
870
871 <dl>
872 <dt><strong class="Mark">for a permutation and set of positive integers</strong></dt>
873 <dd><p><code class="code">AsPartialPerm</code> returns the partial permutation that equals <var class="Arg">f</var> on the set of positive integers <var class="Arg">set</var> and that is undefined on every other positive integer.</p>
874
875 <p>Note that as explained in <code class="func">PartialPerm</code> (<a href="chap54.html#X8538BAE77F2FB2F8"><span class="RefLink">54.2-1</span></a>) <em>a permutation is never a partial permutation</em> in <strong class="pkg">GAP</strong>, please keep this in mind when using <code class="code">AsPartialPerm</code>.</p>
876
877 </dd>
878 <dt><strong class="Mark">for a permutation</strong></dt>
879 <dd><p><code class="code">AsPartialPerm</code> returns the partial permutation that agrees with <var class="Arg">f</var> on <code class="code">[1..LargestMovedPoint(<var class="Arg">f</var>)]</code> and that is not defined on any other positive integer.</p>
880
881 </dd>
882 <dt><strong class="Mark">for a permutation and a positive integer</strong></dt>
883 <dd><p><code class="code">AsPartialPerm</code> returns the partial permutation that agrees with <var class="Arg">f</var> on <code class="code">[1..<var class="Arg">n</var>]</code>, when <var class="Arg">n</var> is a positive integer, and that is not defined on any other positive integer.</p>
884
885 </dd>
886 </dl>
887 <p>The operation <code class="func">PartialPermOp</code> (<a href="chap54.html#X81188D9F83F64222"><span class="RefLink">54.2-2</span></a>) can also be used to convert permutations into partial permutations.</p>
888
889
890 <div class="example"><pre>
891 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=(2,8,19,9,14,10,20,17,4,13,12,3,5,7,18,16);;</span>
892 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">AsPartialPerm(f);</span>
893 (1)(2,8,19,9,14,10,20,17,4,13,12,3,5,7,18,16)(6)(11)(15)
894 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">AsPartialPerm(f, [ 1, 2, 3 ] );</span>
895 [2,8][3,5](1)</pre></div>
896
897 <p><a id="X87EC67747B260E98" name="X87EC67747B260E98"></a></p>
898
899 <h5>54.4-2 AsPartialPerm</h5>
900
901 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AsPartialPerm</code>( <var class="Arg">f</var>, <var class="Arg">set</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
902 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AsPartialPerm</code>( <var class="Arg">f</var>, <var class="Arg">n</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
903 <p>Returns: A partial permutation or <code class="keyw">fail</code>.</p>
904
905 <p>A transformation <var class="Arg">f</var> defines a partial permutation when it is restricted to a set of positive integers where it is injective. <code class="code">AsPartialPerm</code> can be used to obtain this partial permutation.</p>
906
907 <p>There are several possible arguments for <code class="code">AsPartialPerm</code>:</p>
908
909
910 <dl>
911 <dt><strong class="Mark">for a transformation and set of positive integers</strong></dt>
912 <dd><p><code class="code">AsPartialPerm</code> returns the partial permutation obtained by restricting <var class="Arg">f</var> to the set of positive integers <var class="Arg">set</var> when:</p>
913
914
915 <ul>
916 <li><p><var class="Arg">set</var> contains no elements exceeding the degree of <var class="Arg">f</var>;</p>
917
918 </li>
919 <li><p><var class="Arg">f</var> is injective on <var class="Arg">set</var>.</p>
920
921 </li>
922 </ul>
923 </dd>
924 <dt><strong class="Mark">for a transformation and a positive integer</strong></dt>
925 <dd><p><code class="code">AsPartialPerm</code> returns the partial permutation that agrees with <var class="Arg">f</var> on <code class="code">[1..<var class="Arg">n</var>]</code> when <var class="Arg">A</var> is a positive integer and this set satisfies the conditions given above.</p>
926
927 </dd>
928 </dl>
929 <p>The operation <code class="func">PartialPermOp</code> (<a href="chap54.html#X81188D9F83F64222"><span class="RefLink">54.2-2</span></a>) can also be used to convert transformations into partial permutations.</p>
930
931
932 <div class="example"><pre>
933 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=Transformation( [ 8, 3, 5, 9, 6, 2, 9, 7, 9 ] );;</span>
934 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">AsPartialPerm(f, [1, 2, 3, 5, 8]);</span>
935 [1,8,7][2,3,5,6]
936 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">AsPartialPerm(f, 3);</span>
937 [1,8][2,3,5]
938 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">AsPartialPerm(f, [ 2 .. 4 ] );</span>
939 [2,3,5][4,9]</pre></div>
940
941 <p><a id="X848CD855802C6CE1" name="X848CD855802C6CE1"></a></p>
942
943 <h4>54.5 <span class="Heading">Operators and operations for partial permutations</span></h4>
944
945 <p><a id="X7B8630027B7F0BCC" name="X7B8630027B7F0BCC"></a></p>
946
947 <h5>54.5-1 Inverse</h5>
948
949 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Inverse</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
950 <p>returns the inverse of the partial permutation <var class="Arg">f</var>.</p>
951
952 <p><a id="X792D3BA278DAB869" name="X792D3BA278DAB869"></a></p>
953
954 <h5><code>54.5-2 \^</code></h5>
955
956 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; \^</code>( <var class="Arg">i</var>, <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
957 <p>returns the image of the positive integer <var class="Arg">i</var> under the partial permutation <var class="Arg">f</var> if it is defined and <code class="code">0</code> if it is not.</p>
958
959 <p><a id="X7DC25BC47AAA9C73" name="X7DC25BC47AAA9C73"></a></p>
960
961 <h5><code>54.5-3 \/</code></h5>
962
963 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; \/</code>( <var class="Arg">i</var>, <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
964 <p>returns the preimage of the positive integer <var class="Arg">i</var> under the partial permutation <var class="Arg">f</var> if it is defined and <code class="code">0</code> if it is not. Note that the inverse of <var class="Arg">f</var> is not calculated to find the preimage of <var class="Arg">i</var>.</p>
965
966 <p><a id="X8213CD6E7C461169" name="X8213CD6E7C461169"></a></p>
967
968 <h5><code>54.5-4 \^</code></h5>
969
970 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; \^</code>( <var class="Arg">f</var>, <var class="Arg">g</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
971 <p><code class="code"><var class="Arg">f</var> ^ <var class="Arg">g</var></code> returns <code class="code"><var class="Arg">g</var>^-1*<var class="Arg">f</var>*<var class="Arg">g</var></code> when <var class="Arg">f</var> is a partial permutation and <var class="Arg">g</var> is a permutation or partial permutation; see <code class="func">\^</code> (<a href="chap31.html#X8481C9B97B214C23"><span class="RefLink">31.12-1</span></a>). This operation requires essentially the same number of steps as multiplying partial permutations, which is around one third as many as inverting and multiplying twice.</p>
972
973 <p><a id="X86469D597F8BC7CE" name="X86469D597F8BC7CE"></a></p>
974
975 <h5><code>54.5-5 \*</code></h5>
976
977 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; \*</code>( <var class="Arg">f</var>, <var class="Arg">g</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
978 <p><code class="code"><var class="Arg">f</var> * <var class="Arg">g</var></code> returns the composition of <var class="Arg">f</var> and <var class="Arg">g</var> when <var class="Arg">f</var> and <var class="Arg">g</var> are partial permutations or permutations. The product of a permutation and a partial permutation is returned as a partial permutation.</p>
979
980 <p><a id="X869DBDF67FA3817B" name="X869DBDF67FA3817B"></a></p>
981
982 <h5><code>54.5-6 \/</code></h5>
983
984 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; \/</code>( <var class="Arg">f</var>, <var class="Arg">g</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
985 <p><code class="code"><var class="Arg">f</var> / <var class="Arg">g</var></code> returns <code class="code"><var class="Arg">f</var>*<var class="Arg">g</var>^-1</code> when <var class="Arg">f</var> is a partial permutation and <var class="Arg">g</var> is a permutation or partial permutation. This operation requires essentially the same number of steps as multiplying partial permutations, which is approximately half that required to first invert <var class="Arg">g</var> and then take the product with <var class="Arg">f</var>.</p>
986
987 <p><a id="X82E3A3E186A4F2D2" name="X82E3A3E186A4F2D2"></a></p>
988
989 <h5>54.5-7 LeftQuotient</h5>
990
991 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LeftQuotient</code>( <var class="Arg">g</var>, <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
992 <p>returns <code class="code"><var class="Arg">g</var>^-1*<var class="Arg">f</var></code> when <var class="Arg">f</var> is a partial permutation and <var class="Arg">g</var> is a permutation or partial permutation. This operation requires essentially the same number of steps as multiplying partial permutations, which is approximately half that required to first invert <var class="Arg">g</var> and then take the product with <var class="Arg">f</var>.</p>
993
994 <p><a id="X8659E9E57AC8D9CE" name="X8659E9E57AC8D9CE"></a></p>
995
996 <h5><code>54.5-8 \&lt;</code></h5>
997
998 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; \&lt;</code>( <var class="Arg">f</var>, <var class="Arg">g</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
999 <p><code class="code"><var class="Arg">f</var> &lt; <var class="Arg">g</var></code> returns <code class="keyw">true</code> if the image of <var class="Arg">f</var> on the range from 1 to the degree of <var class="Arg">f</var> is lexicographically less than the corresponding image for <var class="Arg">g</var> and <code class="keyw">false</code> if it is not. See <code class="func">NaturalLeqPartialPerm</code> (<a href="chap54.html#X87B1ED93785257C1"><span class="RefLink">54.5-13</span></a>) and <code class="func">ShortLexLeqPartialPerm</code> (<a href="chap54.html#X81BD69307D294A1C"><span class="RefLink">54.5-14</span></a>) for additional orders for partial permutations.</p>
1000
1001 <p><a id="X7828338C7DB8AAC7" name="X7828338C7DB8AAC7"></a></p>
1002
1003 <h5><code>54.5-9 \=</code></h5>
1004
1005 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; \=</code>( <var class="Arg">f</var>, <var class="Arg">g</var> )</td><td class="tdright">(&nbsp;method&nbsp;)</td></tr></table></div>
1006 <p><code class="code"><var class="Arg">f</var> = <var class="Arg">g</var></code> returns <code class="keyw">true</code> if the partial permutation <var class="Arg">f</var> equals the partial permutation <var class="Arg">g</var> and returns <code class="keyw">false</code> if it does not.</p>
1007
1008 <p><a id="X8382A0F8875CEB08" name="X8382A0F8875CEB08"></a></p>
1009
1010 <h5>54.5-10 PermLeftQuoPartialPerm</h5>
1011
1012 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PermLeftQuoPartialPerm</code>( <var class="Arg">f</var>, <var class="Arg">g</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1013 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PermLeftQuoPartialPermNC</code>( <var class="Arg">f</var>, <var class="Arg">g</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1014 <p>Returns: A permutation.</p>
1015
1016 <p>Returns the permutation on the image set of <var class="Arg">f</var> induced by <code class="code"><var class="Arg">f</var>^-1*<var class="Arg">g</var></code> when the partial permutations <var class="Arg">f</var> and <var class="Arg">g</var> have equal domain and image set.</p>
1017
1018 <p><code class="code">PermLeftQuoPartialPerm</code> verifies that <var class="Arg">f</var> and <var class="Arg">g</var> have equal domains and image sets, and returns an error if they do not. <code class="code">PermLeftQuoPartialPermNC</code> does no checks.</p>
1019
1020
1021 <div class="example"><pre>
1022 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 4, 5, 7 ], [ 7, 9, 10, 4, 2, 5 ] );</span>
1023 [1,7,5,2,9][3,10](4)
1024 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">g:=PartialPerm( [ 1, 2, 3, 4, 5, 7 ], [ 7, 4, 9, 2, 5, 10 ] );</span>
1025 [1,7,10][3,9](2,4)(5)
1026 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PermLeftQuoPartialPerm(f, g);</span>
1027 (2,5,10,9,4)</pre></div>
1028
1029 <p><a id="X7C7F5EAB7E9A381D" name="X7C7F5EAB7E9A381D"></a></p>
1030
1031 <h5>54.5-11 PreImagePartialPerm</h5>
1032
1033 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PreImagePartialPerm</code>( <var class="Arg">f</var>, <var class="Arg">i</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1034 <p>Returns: A positive integer or <code class="keyw">fail</code>.</p>
1035
1036 <p><code class="code">PreImagePartialPerm</code> returns the preimage of the positive integer <var class="Arg">i</var> under the partial permutation <var class="Arg">f</var> if <var class="Arg">i</var> belongs to the image of <var class="Arg">f</var>. If <var class="Arg">i</var> does not belong to the image of <var class="Arg">f</var>, then <code class="keyw">fail</code> is returned.</p>
1037
1038 <p>The same result can be obtained by using <code class="code"><var class="Arg">i</var>/<var class="Arg">f</var></code> as described in Section <a href="chap54.html#X848CD855802C6CE1"><span class="RefLink">54.5</span></a>.</p>
1039
1040
1041 <div class="example"><pre>
1042 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 5, 9, 10 ], [ 5, 10, 7, 8, 9, 1 ] );</span>
1043 [2,10,1,5,8][3,7](9)
1044 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PreImagePartialPerm(f, 8);</span>
1045 5
1046 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PreImagePartialPerm(f, 5);</span>
1047 1
1048 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PreImagePartialPerm(f, 1);</span>
1049 10
1050 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PreImagePartialPerm(f, 10);</span>
1051 2
1052 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PreImagePartialPerm(f, 2);</span>
1053 fail</pre></div>
1054
1055 <p><a id="X797A6CC084068219" name="X797A6CC084068219"></a></p>
1056
1057 <h5>54.5-12 ComponentPartialPermInt</h5>
1058
1059 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ComponentPartialPermInt</code>( <var class="Arg">f</var>, <var class="Arg">i</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1060 <p>Returns: A set of positive integers.</p>
1061
1062 <p><code class="code">ComponentPartialPermInt</code> returns the elements of the component of <var class="Arg">f</var> containing <var class="Arg">i</var> that can be obtained by repeatedly applying <var class="Arg">f</var> to <var class="Arg">i</var>.</p>
1063
1064
1065 <div class="example"><pre>
1066 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 4, 5, 6, 7, 8, 10, 14, 15, 16, 17, 18 ],</span>
1067 <span class="GAPprompt">&gt;</span> <span class="GAPinput">[ 11, 4, 14, 16, 15, 3, 20, 8, 17, 19, 1, 6, 12 ] );</span>
1068 [2,4,14,17,6,15,19][5,16,1,11][7,3][10,8,20][18,12]
1069 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ComponentPartialPermInt(f, 4);</span>
1070 [ 4, 14, 17, 6, 15, 19 ]
1071 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ComponentPartialPermInt(f, 3);</span>
1072 [ ]
1073 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ComponentPartialPermInt(f, 10);</span>
1074 [ 10, 8, 20 ]
1075 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ComponentPartialPermInt(f, 100);</span>
1076 [ ]</pre></div>
1077
1078 <p><a id="X87B1ED93785257C1" name="X87B1ED93785257C1"></a></p>
1079
1080 <h5>54.5-13 NaturalLeqPartialPerm</h5>
1081
1082 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NaturalLeqPartialPerm</code>( <var class="Arg">f</var>, <var class="Arg">g</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1083 <p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>
1084
1085 <p>The <em>natural partial order</em> <span class="SimpleMath">≤</span> on an inverse semigroup <code class="code">S</code> is defined by <code class="code">s</code><span class="SimpleMath">≤</span><code class="code">t</code> if there exists an idempotent <code class="code">e</code> in <code class="code">S</code> such that <code class="code">s=et</code>. Hence if <var class="Arg">f</var> and <var class="Arg">g</var> are partial permutations, then <var class="Arg">f</var><span class="SimpleMath">≤</span><var class="Arg">g</var> if and only if <var class="Arg">f</var> is a restriction of <var class="Arg">g</var>; see <code class="func">RestrictedPartialPerm</code> (<a href="chap54.html#X80ABBF4883C79060"><span class="RefLink">54.2-3</span></a>).</p>
1086
1087 <p><code class="code">NaturalLeqPartialPerm</code> returns <code class="keyw">true</code> if <var class="Arg">f</var> is a restriction of <var class="Arg">g</var> and <code class="keyw">false</code> if it is not. Note that since this is a partial order and not a total order, it is possible that <var class="Arg">f</var> and <var class="Arg">g</var> are incomparable with respect to the natural partial order.</p>
1088
1089
1090 <div class="example"><pre>
1091 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm(</span>
1092 <span class="GAPprompt">&gt;</span> <span class="GAPinput">[ 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 16, 17, 18, 19 ],</span>
1093 <span class="GAPprompt">&gt;</span> <span class="GAPinput">[ 3, 12, 14, 4, 11, 18, 17, 2, 9, 5, 15, 8, 20, 10, 19 ] );;</span>
1094 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">g:=RestrictedPartialPerm(f, [ 1, 2, 3, 9, 13, 20 ] );</span>
1095 [1,3,14][2,12]
1096 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NaturalLeqPartialPerm(g,f);</span>
1097 true
1098 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NaturalLeqPartialPerm(f,g);</span>
1099 false
1100 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">g:=PartialPerm( [ 1, 2, 3, 4, 5, 8, 10 ],</span>
1101 <span class="GAPprompt">&gt;</span> <span class="GAPinput">[ 7, 1, 4, 3, 2, 6, 5 ] );;</span>
1102 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NaturalLeqPartialPerm(f, g);</span>
1103 false
1104 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NaturalLeqPartialPerm(g, f);</span>
1105 false</pre></div>
1106
1107 <p><a id="X81BD69307D294A1C" name="X81BD69307D294A1C"></a></p>
1108
1109 <h5>54.5-14 ShortLexLeqPartialPerm</h5>
1110
1111 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ShortLexLeqPartialPerm</code>( <var class="Arg">f</var>, <var class="Arg">g</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
1112 <p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>
1113
1114 <p><code class="code">ShortLexLeqPartialPerm</code> returns <code class="keyw">true</code> if the concatenation of the domain and image list of <var class="Arg">f</var> is short-lex less than the corresponding concatenation for <var class="Arg">g</var> and <code class="keyw">false</code> otherwise.</p>
1115
1116 <p>Note that this is not the natural partial order on partial permutation or the same as comparing <var class="Arg">f</var> and <var class="Arg">g</var> using <code class="code">\&lt;</code>.</p>
1117
1118
1119 <div class="example"><pre>
1120 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 4, 6, 7, 8, 10 ],</span>
1121 <span class="GAPprompt">&gt;</span> <span class="GAPinput">[ 3, 8, 1, 9, 4, 10, 5, 6 ] );</span>
1122 [2,8,5][7,10,6,4,9](1,3)
1123 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">g:=PartialPerm( [ 1, 2, 3, 4, 5, 8, 10 ],</span>
1124 <span class="GAPprompt">&gt;</span> <span class="GAPinput">[ 7, 1, 4, 3, 2, 6, 5 ] );</span>
1125 [8,6][10,5,2,1,7](3,4)
1126 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f&lt;g;</span>
1127 true
1128 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">g&lt;f;</span>
1129 false
1130 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ShortLexLeqPartialPerm(f, g);</span>
1131 false
1132 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ShortLexLeqPartialPerm(g, f);</span>
1133 true
1134 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NaturalLeqPartialPerm(f, g);</span>
1135 false
1136 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NaturalLeqPartialPerm(g, f);</span>
1137 false</pre></div>
1138
1139 <p><a id="X83560BE678ACF855" name="X83560BE678ACF855"></a></p>
1140
1141 <h5>54.5-15 TrimPartialPerm</h5>
1142
1143 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; TrimPartialPerm</code>( <var class="Arg">f</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1144 <p>Returns: Nothing.</p>
1145
1146 <p>It can happen that the internal representation of a partial permutation uses more memory than necessary. For example, by composing a partial permutation with codegree less than 65536 with a partial permutation with codegree greater than 65535. It is possible that the resulting partial permutation <var class="Arg">f</var> has its codegree and images stored as 32-bit integers, while none of its image points exceeds 65536. The purpose of this function is to change the internal representation of such an <var class="Arg">f</var> from using 32-bit to using 16-bit integers.</p>
1147
1148 <p>Note that the partial permutation <var class="Arg">f</var> is changed in-place, and nothing is returned by this function.</p>
1149
1150
1151 <div class="example"><pre>
1152 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 2 ], [ 3, 4 ] )</span>
1153 <span class="GAPprompt">&gt;</span> <span class="GAPinput">*PartialPerm( [ 3, 5 ], [ 3, 100000 ] );</span>
1154 [1,3]
1155 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsPPerm4Rep(f);</span>
1156 true
1157 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">TrimPartialPerm(f); f;</span>
1158 [1,3]
1159 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsPPerm4Rep(f);</span>
1160 false</pre></div>
1161
1162 <p><a id="X7849595B81D063EE" name="X7849595B81D063EE"></a></p>
1163
1164 <h4>54.6 <span class="Heading">Displaying partial permutations</span></h4>
1165
1166 <p>It is possible to change the way that <strong class="pkg">GAP</strong> displays partial permutations using the user preferences <code class="code">PartialPermDisplayLimit</code> and <code class="code">NotationForPartialPerms</code>; see Section <code class="func">UserPreference</code> (<a href="chap3.html#X7B0AD104839B6C3C"><span class="RefLink">3.2-3</span></a>) for more information about user preferences.</p>
1167
1168 <p>If <code class="code">f</code> is a partial permutation of rank <code class="code">r</code> exceeding the value of the user preference <code class="code">PartialPermDisplayLimit</code>, then <code class="code">f</code> is displayed as:</p>
1169
1170
1171 <div class="example"><pre>&lt;partial perm on r pts with degree m, codegree n&gt;</pre></div>
1172
1173 <p>where the degree and codegree are <code class="code">m</code> and <code class="code">n</code>, respectively. The idea is to abbreviate the display of partial permutations defined on many points. The default value for the <code class="code">PartialPermDisplayLimit</code> is <code class="code">100</code>.</p>
1174
1175 <p>If the rank of <code class="code">f</code> does not exceed the value of <code class="code">PartialPermDisplayLimit</code>, then how <code class="code">f</code> is displayed depends on the value of the user preference <code class="code">NotationForPartialPerms</code> except in the case that <code class="code">f</code> is the empty partial permutation or an identity partial permutation.</p>
1176
1177 <p>There are three possible values for <code class="code">NotationForPartialPerms</code> user preference, which are described below.</p>
1178
1179
1180 <dl>
1181 <dt><strong class="Mark">component</strong></dt>
1182 <dd><p>Similar to permutations, and unlike transformations, partial permutations can be expressed as products of disjoint permutations and chains. A <em>chain</em> is a list <code class="code">c</code> of some length <code class="code">n</code> such that:</p>
1183
1184
1185 <ul>
1186 <li><p><code class="code">c[1]</code> is an element of the domain of <var class="Arg">f</var> but not the image</p>
1187
1188 </li>
1189 <li><p><code class="code">c[i]^<var class="Arg">f</var>=c[i+1]</code> for all <code class="code">i</code> in the range from <code class="code">1</code> to <code class="code">n-1</code>.</p>
1190
1191 </li>
1192 <li><p><code class="code">c[n]</code> is in the image of <var class="Arg">f</var> but not the domain.</p>
1193
1194 </li>
1195 </ul>
1196 <p>In the display, permutations are displayed as they usually are in <strong class="pkg">GAP</strong>, except that fixed points are displayed enclosed in round brackets, and chains are displayed enclosed in square brackets.</p>
1197
1198
1199 <div class="example"><pre>
1200 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f := PartialPerm([ 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 16, 17, 18, 19 ],</span>
1201 <span class="GAPprompt">&gt;</span> <span class="GAPinput">[ 3, 12, 14, 4, 11, 18, 17, 2, 9, 5, 15, 8, 20, 10, 19 ]);</span>
1202 [1,3,14][16,8,2,12,15](4)(5,11)[6,18,10,9][7,17,20](19)</pre></div>
1203
1204 <p>This option is the most compact way to display a partial permutation and is the default value of the user preference <code class="code">NotationForPartialPerms</code>.</p>
1205
1206 </dd>
1207 <dt><strong class="Mark">domainimage</strong></dt>
1208 <dd><p>With this option a partial permutation <code class="code">f</code> is displayed in the format: <code class="code">DomainOfPartialPerm(<var class="Arg">f</var>)-&gt; ImageListOfPartialPerm(<var class="Arg">f</var>)</code>.</p>
1209
1210
1211 <div class="example"><pre><span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 4, 5, 6, 7 ], [ 10, 1, 6, 5, 8, 7 ]);</span>
1212 [ 1, 2, 4, 5, 6, 7 ] -&gt; [ 10, 1, 6, 5, 8, 7 ]</pre></div>
1213
1214 </dd>
1215 <dt><strong class="Mark">input</strong></dt>
1216 <dd><p>With this option a partial permutation <var class="Arg">f</var> is displayed as: <code class="code">PartialPerm(DomainOfPartialPerm(<var class="Arg">f</var>), ImageListOfPartialPerm(<var class="Arg">f</var>))</code> which corresponds to the input (of the first type described in <code class="func">PartialPerm</code> (<a href="chap54.html#X8538BAE77F2FB2F8"><span class="RefLink">54.2-1</span></a>)).</p>
1217
1218
1219 <div class="example"><pre><span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 5, 6, 9, 10 ],</span>
1220 <span class="GAPprompt">&gt;</span> <span class="GAPinput">[ 4, 7, 3, 8, 2, 1, 6 ] );</span>
1221 PartialPerm( [ 1, 2, 3, 5, 6, 9, 10 ], [ 4, 7, 3, 8, 2, 1, 6 ] )</pre></div>
1222
1223 </dd>
1224 </dl>
1225
1226 <div class="example"><pre>
1227 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetUserPreference("PartialPermDisplayLimit", 12);</span>
1228 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">UserPreference("PartialPermDisplayLimit");</span>
1229 12
1230 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm([1,2,3,4,5,6], [6,7,1,4,3,2]);</span>
1231 [5,3,1,6,2,7](4)
1232 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=PartialPerm(</span>
1233 <span class="GAPprompt">&gt;</span> <span class="GAPinput">[ 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 16, 17, 18, 19 ],</span>
1234 <span class="GAPprompt">&gt;</span> <span class="GAPinput">[ 3, 12, 14, 4, 11, 18, 17, 2, 9, 5, 15, 8, 20, 10, 19 ] );</span>
1235 &lt;partial perm on 15 pts with degree 19, codegree 20&gt;
1236 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetUserPreference("PartialPermDisplayLimit", 100);</span>
1237 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f;</span>
1238 [1,3,14][6,18,10,9][7,17,20][16,8,2,12,15](4)(5,11)(19)
1239 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">UserPreference("NotationForPartialPerms");</span>
1240 "component"
1241 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetUserPreference("NotationForPartialPerms", "domainimage");</span>
1242 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f;</span>
1243 [ 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 16, 17, 18, 19 ] -&gt;
1244 [ 3, 12, 14, 4, 11, 18, 17, 2, 9, 5, 15, 8, 20, 10, 19 ]
1245 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetUserPreference("NotationForPartialPerms", "input");</span>
1246 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f;</span>
1247 PartialPerm(
1248 [ 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 16, 17, 18, 19 ],
1249 [ 3, 12, 14, 4, 11, 18, 17, 2, 9, 5, 15, 8, 20, 10, 19 ] )</pre></div>
1250
1251 <p><a id="X7CCC82E07A73EB55" name="X7CCC82E07A73EB55"></a></p>
1252
1253 <h4>54.7 <span class="Heading">Semigroups and inverse semigroups of partial permutations</span></h4>
1254
1255 <p>As mentioned at the start of the chapter, every inverse semigroup is isomorphic to a semigroup of partial permutations, and in this section we describe the functions in <strong class="pkg">GAP</strong> specific to partial permutation semigroups. For more information about semigroups and inverse semigroups see Chapter <a href="chap51.html#X8665D8737FDD5B10"><span class="RefLink">51</span></a>.</p>
1256
1257 <p>The <strong class="pkg">Semigroups</strong> package contains many additional functions and methods for computing with semigroups of partial permutations. In particular, <strong class="pkg">Semigroups</strong> contains more efficient methods than those available in the <strong class="pkg">GAP</strong> library (and in many cases more efficient than any other software) for creating semigroups of transformations, calculating their Green's classes, size, elements, group of units, minimal ideal, small generating sets, testing membership, finding the inverses of a regular element, factorizing elements over the generators, and more.</p>
1258
1259 <p>Since a partial permutation semigroup is also a partial permutation collection, there are special methods for <code class="func">DomainOfPartialPermCollection</code> (<a href="chap54.html#X784A14F787E041D7"><span class="RefLink">54.3-4</span></a>), <code class="func">ImageOfPartialPermCollection</code> (<a href="chap54.html#X7CD84B107831E0FC"><span class="RefLink">54.3-5</span></a>), <code class="func">FixedPointsOfPartialPerm</code> (<a href="chap54.html#X82AAFF938623422E"><span class="RefLink">54.3-8</span></a>), <code class="func">MovedPoints</code> (<a href="chap54.html#X82FE981A87FAA2DC"><span class="RefLink">54.3-9</span></a>), <code class="func">NrFixedPoints</code> (<a href="chap54.html#X7FAF969C84CDC742"><span class="RefLink">54.3-10</span></a>), <code class="func">NrMovedPoints</code> (<a href="chap54.html#X81F5C64E7DAD27A7"><span class="RefLink">54.3-11</span></a>), <code class="func">LargestMovedPoint</code> (<a href="chap54.html#X7D4290A785ABC86D"><span class="RefLink">54.3-13</span></a>), and <code class="func">SmallestMovedPoint</code> (<a href="chap54.html#X84A49C977E1E29AA"><span class="RefLink">54.3-12</span></a>) when applied to a partial permutation semigroup.</p>
1260
1261 <p><a id="X7D161674800B50E0" name="X7D161674800B50E0"></a></p>
1262
1263 <h5>54.7-1 IsPartialPermSemigroup</h5>
1264
1265 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsPartialPermSemigroup</code>( <var class="Arg">obj</var> )</td><td class="tdright">(&nbsp;filter&nbsp;)</td></tr></table></div>
1266 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsPartialPermMonoid</code>( <var class="Arg">obj</var> )</td><td class="tdright">(&nbsp;filter&nbsp;)</td></tr></table></div>
1267 <p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>
1268
1269 <p>A <em>partial perm semigroup</em> is simply a semigroup consisting of partial permutations, which may or may not be an inverse semigroup. An object <var class="Arg">obj</var> in <strong class="pkg">GAP</strong> is a partial perm semigroup if and only if it satisfies <code class="func">IsSemigroup</code> (<a href="chap51.html#X7B412E5B8543E9B7"><span class="RefLink">51.1-1</span></a>) and <code class="func">IsPartialPermCollection</code> (<a href="chap54.html#X8262A827790DD1CC"><span class="RefLink">54.1-2</span></a>).</p>
1270
1271 <p>A <em>partial perm monoid</em> is a monoid consisting of partial permutations. An object in <strong class="pkg">GAP</strong> is a partial perm monoid if it satisfies <code class="func">IsMonoid</code> (<a href="chap51.html#X861C523483C6248C"><span class="RefLink">51.2-1</span></a>) and <code class="func">IsPartialPermCollection</code> (<a href="chap54.html#X8262A827790DD1CC"><span class="RefLink">54.1-2</span></a>).</p>
1272
1273 <p>Note that it is possible for a partial perm semigroup to have a multiplicative neutral element (i.e. an identity element) but not to satisfy <code class="code">IsPartialPermMonoid</code>. For example,</p>
1274
1275
1276 <div class="example"><pre>
1277 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f := PartialPerm( [ 1, 2, 3, 6, 8, 10 ], [ 2, 6, 7, 9, 1, 5 ] );;</span>
1278 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S := Semigroup(f, One(f));</span>
1279 &lt;commutative partial perm monoid of rank 9 with 1 generator&gt;
1280 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsMonoid(S);</span>
1281 true
1282 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsPartialPermMonoid(S);</span>
1283 true</pre></div>
1284
1285 <p>Note that unlike transformation semigroups, the <code class="func">One</code> (<a href="chap31.html#X8046262384895B2A"><span class="RefLink">31.10-2</span></a>) of a partial permutation semigroup must coincide with the multiplicative neutral element, if either exists.</p>
1286
1287 <p>For more details see <code class="func">IsMagmaWithOne</code> (<a href="chap35.html#X86071DE7835F1C7C"><span class="RefLink">35.1-2</span></a>).</p>
1288
1289 <p><a id="X7D7F0BAB82F0D820" name="X7D7F0BAB82F0D820"></a></p>
1290
1291 <h5>54.7-2 DegreeOfPartialPermSemigroup</h5>
1292
1293 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; DegreeOfPartialPermSemigroup</code>( <var class="Arg">S</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1294 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; CodegreeOfPartialPermSemigroup</code>( <var class="Arg">S</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1295 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RankOfPartialPermSemigroup</code>( <var class="Arg">S</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1296 <p>Returns: A non-negative integer.</p>
1297
1298 <p>The <em>degree</em> of a partial permutation semigroup <var class="Arg">S</var> is the largest degree of any partial permutation in <var class="Arg">S</var>.</p>
1299
1300 <p>The <em>codegree</em> of a partial permutation semigroup <var class="Arg">S</var> is the largest positive integer in its image.</p>
1301
1302 <p>The <em>rank</em> of a partial permutation semigroup <var class="Arg">S</var> is the number of points on which it acts.</p>
1303
1304
1305 <div class="example"><pre>
1306 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S := Semigroup( PartialPerm( [ 1, 5 ], [ 10000, 3 ] ) );</span>
1307 &lt;commutative partial perm semigroup of rank 2 with 1 generator&gt;
1308 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">DegreeOfPartialPermSemigroup(S);</span>
1309 5
1310 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CodegreeOfPartialPermSemigroup(S);</span>
1311 10000
1312 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">RankOfPartialPermSemigroup(S);</span>
1313 2</pre></div>
1314
1315 <p><a id="X81D271B380995F8A" name="X81D271B380995F8A"></a></p>
1316
1317 <h5>54.7-3 SymmetricInverseSemigroup</h5>
1318
1319 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SymmetricInverseSemigroup</code>( <var class="Arg">n</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1320 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SymmetricInverseMonoid</code>( <var class="Arg">n</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
1321 <p>Returns: The symmetric inverse semigroup of degree <var class="Arg">n</var>.</p>
1322
1323 <p>If <var class="Arg">n</var> is a non-negative integer, then <code class="code">SymmetricInverseSemigroup</code> returns the inverse semigroup consisting of all partial permutations with degree and codegree at most <var class="Arg">n</var>. Note that <var class="Arg">n</var> must be non-negative, but in particular, can equal <code class="code">0</code>.</p>
1324
1325 <p>The symmetric inverse semigroup has <span class="SimpleMath">∑_r=0^nnchoose r^2⋅ r!</span> elements and is generated by any set that of partial permutations that generate the symmetric group on <var class="Arg">n</var> points and any partial permutation of rank <code class="code"><var class="Arg">n</var>-1</code>.</p>
1326
1327 <p><code class="code">SymmetricInverseMonoid</code> is a synonym for <code class="code">SymmetricInverseSemigroup</code>.</p>
1328
1329
1330 <div class="example"><pre>
1331 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S := SymmetricInverseSemigroup(5);</span>
1332 &lt;symmetric inverse monoid of degree 5&gt;
1333 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Size(S);</span>
1334 1546
1335 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">GeneratorsOfInverseMonoid(S);</span>
1336 [ (1,2,3,4,5), (1,2)(3)(4)(5), [5,4,3,2,1] ]</pre></div>
1337
1338 <p><a id="X7C8AEA50834060DD" name="X7C8AEA50834060DD"></a></p>
1339
1340 <h5>54.7-4 IsSymmetricInverseSemigroup</h5>
1341
1342 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsSymmetricInverseSemigroup</code>( <var class="Arg">S</var> )</td><td class="tdright">(&nbsp;property&nbsp;)</td></tr></table></div>
1343 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsSymmetricInverseMonoid</code>( <var class="Arg">S</var> )</td><td class="tdright">(&nbsp;property&nbsp;)</td></tr></table></div>
1344 <p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>
1345
1346 <p>If the partial perm semigroup <var class="Arg">S</var> of degree and codegree <var class="Arg">n</var> equals the symmetric inverse semigroup on <var class="Arg">n</var> points, then <code class="code">IsSymmetricInverseSemigroup</code> return <code class="keyw">true</code> and otherwise it returns <code class="keyw">false</code>.</p>
1347
1348 <p><code class="code">IsSymmetricInverseMonoid</code> is a synonym of <code class="code">IsSymmetricInverseSemigroup</code>. It is common in the literature for the symmetric inverse monoid to be referred to as the symmetric inverse semigroup.</p>
1349
1350
1351 <div class="example"><pre>
1352 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S := Semigroup(AsPartialPerm((1, 3, 4, 2), 5), AsPartialPerm((1, 3, 5), 5),</span>
1353 <span class="GAPprompt">&gt;</span> <span class="GAPinput">PartialPerm( [ 1, 2, 3, 4 ] ) );</span>
1354 &lt;partial perm semigroup of rank 5 with 3 generators&gt;
1355 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsSymmetricInverseSemigroup(S);</span>
1356 true
1357 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S;</span>
1358 &lt;symmetric inverse monoid of degree 5&gt;</pre></div>
1359
1360 <p><a id="X7EA51F087CF7621F" name="X7EA51F087CF7621F"></a></p>
1361
1362 <h5>54.7-5 NaturalPartialOrder</h5>
1363
1364 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NaturalPartialOrder</code>( <var class="Arg">S</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1365 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ReverseNaturalPartialOrder</code>( <var class="Arg">S</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1366 <p>Returns: The natural partial order on an inverse semigroup.</p>
1367
1368 <p>The <em>natural partial order</em> <span class="SimpleMath">≤</span> on an inverse semigroup <var class="Arg">S</var> is defined by <code class="code">s</code><span class="SimpleMath">≤</span><code class="code">t</code> if there exists an idempotent <code class="code">e</code> in <var class="Arg">S</var> such that <code class="code">s=et</code>. Hence if <code class="code">f</code> and <code class="code">g</code> are partial permutations, then <code class="code">f</code><span class="SimpleMath">≤</span><code class="code">g</code> if and only if <code class="code">f</code> is a restriction of <code class="code">g</code>; see <code class="func">RestrictedPartialPerm</code> (<a href="chap54.html#X80ABBF4883C79060"><span class="RefLink">54.2-3</span></a>).</p>
1369
1370 <p><code class="code">NaturalPartialOrder</code> returns the natural partial order on the inverse semigroup of partial permutations <var class="Arg">S</var> as a list of sets of positive integers where entry <code class="code">i</code> in <code class="code">NaturalPartialOrder(<var class="Arg">S</var>)</code> is the set of positions in <code class="code">Elements(<var class="Arg">S</var>)</code> of elements which are less than <code class="code">Elements(<var class="Arg">S</var>)[i]</code>. See also <code class="func">NaturalLeqPartialPerm</code> (<a href="chap54.html#X87B1ED93785257C1"><span class="RefLink">54.5-13</span></a>).</p>
1371
1372 <p><code class="code">ReverseNaturalPartialOrder</code> returns the reverse of the natural partial order on the inverse semigroup of partial permutations <var class="Arg">S</var> as a list of sets of positive integers where entry <code class="code">i</code> in <code class="code">ReverseNaturalPartialOrder(<var class="Arg">S</var>)</code> is the set of positions in <code class="code">Elements(<var class="Arg">S</var>)</code> of elements which are greater than <code class="code">Elements(<var class="Arg">S</var>)[i]</code>. See also <code class="func">NaturalLeqPartialPerm</code> (<a href="chap54.html#X87B1ED93785257C1"><span class="RefLink">54.5-13</span></a>).</p>
1373
1374
1375 <div class="example"><pre>
1376 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S := InverseSemigroup([ PartialPerm( [ 1, 3 ], [ 1, 3 ] ),</span>
1377 <span class="GAPprompt">&gt;</span> <span class="GAPinput">PartialPerm( [ 1, 2 ], [ 3, 2 ] ) ] );</span>
1378 &lt;inverse partial perm semigroup of rank 3 with 2 generators&gt;
1379 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Size(S);</span>
1380 11
1381 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NaturalPartialOrder(S);</span>
1382 [ [ ], [ 1 ], [ 1 ], [ 1 ], [ 1, 2, 4 ], [ 1, 3, 4 ], [ 1 ], [ 1 ],
1383 [ 1, 4, 7 ], [ 1, 4, 8 ], [ 1, 2, 8 ] ]
1384 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NaturalLeqPartialPerm(Elements(S)[4], Elements(S)[10]);</span>
1385 true
1386 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NaturalLeqPartialPerm(Elements(S)[4], Elements(S)[1]);</span>
1387 false</pre></div>
1388
1389 <p><a id="X7FE18EBE79B9C17C" name="X7FE18EBE79B9C17C"></a></p>
1390
1391 <h5>54.7-6 IsomorphismPartialPermSemigroup</h5>
1392
1393 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsomorphismPartialPermSemigroup</code>( <var class="Arg">S</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1394 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsomorphismPartialPermMonoid</code>( <var class="Arg">S</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
1395 <p>Returns: An isomorphism.</p>
1396
1397 <p><code class="code">IsomorphismPartialPermSemigroup(<var class="Arg">S</var>)</code> returns an isomorphism from the inverse semigroup <var class="Arg">S</var> to an inverse semigroup of partial permutations.</p>
1398
1399 <p><code class="code">IsomorphismPartialPermMonoid(<var class="Arg">S</var>)</code> returns an isomorphism from the inverse semigroup <var class="Arg">S</var> to an inverse monoid of partial permutations, if possible.</p>
1400
1401 <p>We only describe <code class="code">IsomorphismPartialPermMonoid</code>, the corresponding statements for <code class="code">IsomorphismPartialPermSemigroup</code> also hold.</p>
1402
1403
1404 <dl>
1405 <dt><strong class="Mark">Partial permutation semigroups</strong></dt>
1406 <dd><p>If <var class="Arg">S</var> is a partial permutation semigroup that does not satisfy <code class="func">IsMonoid</code> (<a href="chap51.html#X861C523483C6248C"><span class="RefLink">51.2-1</span></a>) but where <code class="code">MultiplicativeNeutralElement(<var class="Arg">S</var>)&lt;&gt;fail</code>, then <code class="code">IsomorphismPartialPermMonoid(<var class="Arg">S</var>)</code> returns an isomorphism from <var class="Arg">S</var> to an inverse monoid of partial permutations.</p>
1407
1408 </dd>
1409 <dt><strong class="Mark">Permutation groups</strong></dt>
1410 <dd><p>If <var class="Arg">S</var> is a permutation group, then <code class="code">IsomorphismPartialPermMonoid</code> returns an isomorphism from <var class="Arg">S</var> to an inverse monoid of partial permutations on the set <code class="code">MovedPoints(<var class="Arg">S</var>)</code> obtained using <code class="func">AsPartialPerm</code> (<a href="chap54.html#X81B32CB182489ACA"><span class="RefLink">54.4-1</span></a>). The inverse of this isomorphism is obtained using <code class="func">AsPermutation</code> (<a href="chap42.html#X8353AB8987E35DF3"><span class="RefLink">42.5-6</span></a>).</p>
1411
1412 </dd>
1413 <dt><strong class="Mark">Transformation semigroups</strong></dt>
1414 <dd><p>If <var class="Arg">S</var> is a transformation semigroup which is mathematically a monoid but which does not necessarily belong to the category <code class="func">IsMonoid</code> (<a href="chap51.html#X861C523483C6248C"><span class="RefLink">51.2-1</span></a>), then <code class="code">IsomorphismPartialPermMonoid</code> returns an isomorphism from <var class="Arg">S</var> to an inverse monoid of partial permutations.</p>
1415
1416 </dd>
1417 </dl>
1418
1419 <div class="example"><pre>
1420 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S := InverseSemigroup(</span>
1421 <span class="GAPprompt">&gt;</span> <span class="GAPinput">PartialPerm( [ 1, 2, 3, 4, 5 ], [ 4, 2, 3, 1, 5 ] ),</span>
1422 <span class="GAPprompt">&gt;</span> <span class="GAPinput">PartialPerm( [ 1, 2, 4, 5 ], [ 3, 1, 4, 2 ] ) );;</span>
1423 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsMonoid(S);</span>
1424 false
1425 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Size(S);</span>
1426 508
1427 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">iso := IsomorphismPartialPermMonoid(S);</span>
1428 MappingByFunction( &lt;inverse partial perm semigroup of size 508,
1429 rank 5 with 2 generators&gt;, &lt;inverse partial perm monoid of size 508,
1430 rank 5 with 2 generators&gt;
1431 , function( object ) ... end, function( object ) ... end )
1432 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Size(S);</span>
1433 508
1434 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Size(Range(iso));</span>
1435 508
1436 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">G := Group((1,2)(3,8)(4,6)(5,7), (1,3,4,7)(2,5,6,8), (1,4)(2,6)(3,7)(5,8));;</span>
1437 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsomorphismPartialPermSemigroup(G);</span>
1438 MappingByFunction( Group([ (1,2)(3,8)(4,6)(5,7), (1,3,4,7)
1439 (2,5,6,8), (1,4)(2,6)(3,7)
1440 (5,8) ]), &lt;partial perm group of rank 8 with 3 generators&gt;
1441 , function( p ) ... end, &lt;Attribute "AsPermutation"&gt; )
1442 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">S := Semigroup(Transformation( [ 2, 5, 1, 7, 3, 7, 7 ] ),</span>
1443 <span class="GAPprompt">&gt;</span> <span class="GAPinput">Transformation( [ 3, 6, 5, 7, 2, 1, 7 ] ) );;</span>
1444 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">iso := IsomorphismPartialPermMonoid(S);;</span>
1445 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MultiplicativeNeutralElement(S) ^ iso;</span>
1446 &lt;identity partial perm on [ 1, 2, 3, 4, 5, 6 ]&gt;
1447 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">One(Range(iso));</span>
1448 &lt;identity partial perm on [ 1, 2, 3, 4, 5, 6 ]&gt;
1449 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MovedPoints(Range(iso));</span>
1450 [ 1 .. 5 ]</pre></div>
1451
1452
1453 <div class="chlinkprevnextbot">&nbsp;<a href="chap0.html">[Top of Book]</a>&nbsp; <a href="chap0.html#contents">[Contents]</a>&nbsp; &nbsp;<a href="chap53.html">[Previous Chapter]</a>&nbsp; &nbsp;<a href="chap55.html">[Next Chapter]</a>&nbsp; </div>
1454
1455
1456 <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>
1457
1458 <hr />
1459 <p class="foot">generated by <a href="https://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
1460 </body>
1461 </html>