Quelle chap54_mj.html
Sprache: HTML
|
|
| products/sources/formale Sprachen/GAP/doc/ref/chap54_mj.html |
 |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<script type="text/javascript"
src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<title>GAP (ref) - Chapter 54: Partial permutations</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="GAPDoc2HTML" />
<link rel="stylesheet" type="text/css" href="manual.css" />
<script src="manual.js" type="text/javascript"></script>
<script type="text/javascript">overwriteStyle();</script>
</head>
<body class="chap54" onload="jscontent()">
<div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a> <a href="chap1_mj.html">1</a> <a href="chap2_mj.html">2</a> <a href="chap3_mj.html">3</a> <a href="chap4_mj.html">4</a> <a href="chap5_mj.html">5</a> <a href="chap6_mj.html">6</a> <a href="chap7_mj.html">7</a> <a href="chap8_mj.html">8</a> <a href="chap9_mj.html">9</a> <a href="chap10_mj.html">10</a> <a href="chap11_mj.html">11</a> <a href="chap12_mj.html">12</a> <a href="chap13_mj.html">13</a> <a href="chap14_mj.html">14</a> <a href="chap15_mj.html">15</a> <a href="chap16_mj.html">16</a> <a href="chap17_mj.html">17</a> <a href="chap18_mj.html">18</a> <a href="chap19_mj.html">19</a> <a href="chap20_mj.html">20</a> <a href="chap21_mj.html">21</a> <a href="chap22_mj.html">22</a> <a href="chap23_mj.html">23</a> <a href="chap24_mj.html">24</a> <a href="chap25_mj.html">25</a> <a href="chap26_mj.html">26</a> <a href="chap27_mj.html">27</a> <a href="chap28_mj.html">28</a> <a href="chap29_mj.html">29</a> <a href="chap30_mj.html">30</a> <a href="chap31_mj.html">31</a> <a href="chap32_mj.html">32</a> <a href="chap33_mj.html">33</a> <a href="chap34_mj.html">34</a> <a href="chap35_mj.html">35</a> <a href="chap36_mj.html">36</a> <a href="chap37_mj.html">37</a> <a href="chap38_mj.html">38</a> <a href="chap39_mj.html">39</a> <a href="chap40_mj.html">40</a> <a href="chap41_mj.html">41</a> <a href="chap42_mj.html">42</a> <a href="chap43_mj.html">43</a> <a href="chap44_mj.html">44</a> <a href="chap45_mj.html">45</a> <a href="chap46_mj.html">46</a> <a href="chap47_mj.html">47</a> <a href="chap48_mj.html">48</a> <a href="chap49_mj.html">49</a> <a href="chap50_mj.html">50</a> <a href="chap51_mj.html">51</a> <a href="chap52_mj.html">52</a> <a href="chap53_mj.html">53</a> <a href="chap54_mj.html">54</a> <a href="chap55_mj.html">55</a> <a href="chap56_mj.html">56</a> <a href="chap57_mj.html">57</a> <a href="chap58_mj.html">58</a> <a href="chap59_mj.html">59</a> <a href="chap60_mj.html">60</a> <a href="chap61_mj.html">61</a> <a href="chap62_mj.html">62</a> <a href="chap63_mj.html">63</a> <a href="chap64_mj.html">64</a> <a href="chap65_mj.html">65</a> <a href="chap66_mj.html">66</a> <a href="chap67_mj.html">67</a> <a href="chap68_mj.html">68</a> <a href="chap69_mj.html">69</a> <a href="chap70_mj.html">70</a> <a href="chap71_mj.html">71</a> <a href="chap72_mj.html">72</a> <a href="chap73_mj.html">73</a> <a href="chap74_mj.html">74</a> <a href="chap75_mj.html">75</a> <a href="chap76_mj.html">76</a> <a href="chap77_mj.html">77</a> <a href="chap78_mj.html">78</a> <a href="chap79_mj.html">79</a> <a href="chap80_mj.html">80</a> <a href="chap81_mj.html">81</a> <a href="chap82_mj.html">82</a> <a href="chap83_mj.html">83</a> <a href="chap84_mj.html">84</a> <a href="chap85_mj.html">85</a> <a href="chap86_mj.html">86</a> <a href="chap87_mj.html">87</a> <a href="chapBib_mj.html">Bib</a> <a href="chapInd_mj.html">Ind</a> </div>
<div class="chlinkprevnexttop"> <a href="chap0_mj.html">[Top of Book]</a> <a href="chap0_mj.html#contents">[Contents]</a> <a href="chap53_mj.html">[Previous Chapter]</a> <a href="chap55_mj.html">[Next Chapter]</a> </div>
<p id="mathjaxlink" class="pcenter"><a href="chap54.html">[MathJax off]</a></p>
<p><a id="X7D6495F77B8A77BD" name="X7D6495F77B8A77BD"></a></p>
<div class="ChapSects"><a href="chap54_mj.html#X7D6495F77B8A77BD">54 <span class="Heading">Partial permutations</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap54_mj.html#X87B0D6657A3F2B0E">54.1 <span class="Heading">The family and categories of partial permutations</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7EECE133792B30FC">54.1-1 IsPartialPerm</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X8262A827790DD1CC">54.1-2 IsPartialPermCollection</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7E63D17780F64FBA">54.1-3 PartialPermFamily</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap54_mj.html#X7B9D451D7FDA1DD8">54.2 <span class="Heading">Creating partial permutations</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X8538BAE77F2FB2F8">54.2-1 PartialPerm</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X81188D9F83F64222">54.2-2 PartialPermOp</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X80ABBF4883C79060">54.2-3 RestrictedPartialPerm</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X849668DD7B0B9E3B">54.2-4 JoinOfPartialPerms</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X81E2B6977E28CD00">54.2-5 MeetOfPartialPerms</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X80EFB142817A0A9F">54.2-6 EmptyPartialPerm</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7E6ADC8583C31530">54.2-7 <span class="Heading">RandomPartialPerm</span></a>
</span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap54_mj.html#X8779F0997D0FDA78">54.3 <span class="Heading">Attributes for partial permutations</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X8612A4DC864E7959">54.3-1 DegreeOfPartialPerm</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X8413D0EF7DEE1FFF">54.3-2 CodegreeOfPartialPerm</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7C1ABD8A80E95B39">54.3-3 RankOfPartialPerm</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X784A14F787E041D7">54.3-4 DomainOfPartialPerm</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7CD84B107831E0FC">54.3-5 ImageOfPartialPermCollection</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X8333293F87F654FA">54.3-6 ImageListOfPartialPerm</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7F0724A07A14DCF7">54.3-7 ImageSetOfPartialPerm</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X82AAFF938623422E">54.3-8 FixedPointsOfPartialPerm</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X82FE981A87FAA2DC">54.3-9 MovedPoints</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7FAF969C84CDC742">54.3-10 NrFixedPoints</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X81F5C64E7DAD27A7">54.3-11 NrMovedPoints</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X84A49C977E1E29AA">54.3-12 SmallestMovedPoint</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7D4290A785ABC86D">54.3-13 LargestMovedPoint</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X85280F1A7B1014BA">54.3-14 SmallestImageOfMovedPoint</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7A95CD437BC1CB1A">54.3-15 LargestImageOfMovedPoint</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X873A9F717DA75CBC">54.3-16 IndexPeriodOfPartialPerm</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7C04AA377F080722">54.3-17 SmallestIdempotentPower</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X8185065E788BDD0D">54.3-18 ComponentsOfPartialPerm</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7CB51EB67FFA95E9">54.3-19 NrComponentsOfPartialPerm</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7AAAAE4082B30E18">54.3-20 ComponentRepsOfPartialPerm</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7A8FB86C78C49F85">54.3-21 LeftOne</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X857FC10C81507E8B">54.3-22 One</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7D90CF497D58D759">54.3-23 MultiplicativeZero</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap54_mj.html#X8585AA8B78E9CDFB">54.4 <span class="Heading">Changing the representation of a partial permutation</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X81B32CB182489ACA">54.4-1 AsPartialPerm</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X87EC67747B260E98">54.4-2 AsPartialPerm</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap54_mj.html#X848CD855802C6CE1">54.5 <span class="Heading">Operators and operations for partial permutations</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7B8630027B7F0BCC">54.5-1 Inverse</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X792D3BA278DAB869"><code>54.5-2 \^</code></a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7DC25BC47AAA9C73"><code>54.5-3 \/</code></a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X8213CD6E7C461169"><code>54.5-4 \^</code></a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X86469D597F8BC7CE"><code>54.5-5 \*</code></a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X869DBDF67FA3817B"><code>54.5-6 \/</code></a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X82E3A3E186A4F2D2">54.5-7 LeftQuotient</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X8659E9E57AC8D9CE"><code>54.5-8 \<</code></a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7828338C7DB8AAC7"><code>54.5-9 \=</code></a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X8382A0F8875CEB08">54.5-10 PermLeftQuoPartialPerm</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7C7F5EAB7E9A381D">54.5-11 PreImagePartialPerm</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X797A6CC084068219">54.5-12 ComponentPartialPermInt</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X87B1ED93785257C1">54.5-13 NaturalLeqPartialPerm</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X81BD69307D294A1C">54.5-14 ShortLexLeqPartialPerm</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X83560BE678ACF855">54.5-15 TrimPartialPerm</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap54_mj.html#X7849595B81D063EE">54.6 <span class="Heading">Displaying partial permutations</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap54_mj.html#X7CCC82E07A73EB55">54.7 <span class="Heading">Semigroups and inverse semigroups of partial permutations</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7D161674800B50E0">54.7-1 IsPartialPermSemigroup</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7D7F0BAB82F0D820">54.7-2 DegreeOfPartialPermSemigroup</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X81D271B380995F8A">54.7-3 SymmetricInverseSemigroup</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7C8AEA50834060DD">54.7-4 IsSymmetricInverseSemigroup</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7EA51F087CF7621F">54.7-5 NaturalPartialOrder</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap54_mj.html#X7FE18EBE79B9C17C">54.7-6 IsomorphismPartialPermSemigroup</a></span>
</div></div>
</div>
<h3>54 <span class="Heading">Partial permutations</span></h3>
<p>This chapter describes the functions in <strong class="pkg">GAP</strong> for partial permutations.</p>
<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>
<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>
<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_mj.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_mj.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_mj.html#X7849595B81D063EE"><span class="RefLink">54.6</span></a>.</p>
<p>The fundamental attributes of a partial permutation are:</p>
<dl>
<dt><strong class="Mark">Domain</strong></dt>
<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_mj.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>
</dd>
<dt><strong class="Mark">Degree</strong></dt>
<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_mj.html#X8612A4DC864E7959"><span class="RefLink">54.3-1</span></a>).</p>
</dd>
<dt><strong class="Mark">Image list</strong></dt>
<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_mj.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>
</dd>
<dt><strong class="Mark">Image set</strong></dt>
<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_mj.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>
</dd>
<dt><strong class="Mark">Codegree</strong></dt>
<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_mj.html#X8413D0EF7DEE1FFF"><span class="RefLink">54.3-2</span></a>).</p>
</dd>
<dt><strong class="Mark">Rank</strong></dt>
<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_mj.html#X7C1ABD8A80E95B39"><span class="RefLink">54.3-3</span></a>).</p>
</dd>
</dl>
<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, \ldots, 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>
<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_mj.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>
<p>Every partial permutation belongs to a symmetric inverse monoid; see <code class="func">SymmetricInverseSemigroup</code> (<a href="chap54_mj.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>
<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>
<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>
<p class="center">\[
\textrm{dom}(fg)=(\textrm{im}(f)\cap \textrm{dom}(g))f^{-1}\textrm{ and }
\textrm{im}(fg)=(\textrm{im}(f)\cap \textrm{dom}(g))g
\]</p>
<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_mj.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_mj.html#X857FC10C81507E8B"><span class="RefLink">54.3-22</span></a>) and <code class="func">MultiplicativeZero</code> (<a href="chap54_mj.html#X7D90CF497D58D759"><span class="RefLink">54.3-23</span></a>).</p>
<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">\(\leq\)</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_mj.html#X81E2B6977E28CD00"><span class="RefLink">54.2-5</span></a>).</p>
<p>Note that unlike permutations, partial permutations do not fix unspecified points but are simply undefined on such points; see Chapter <a href="chap42_mj.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>
<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>
<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_mj.html#X7EECE133792B30FC"><span class="RefLink">54.1-1</span></a>).</p>
<p><a id="X87B0D6657A3F2B0E" name="X87B0D6657A3F2B0E"></a></p>
<h4>54.1 <span class="Heading">The family and categories of partial permutations</span></h4>
<p><a id="X7EECE133792B30FC" name="X7EECE133792B30FC"></a></p>
<h5>54.1-1 IsPartialPerm</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsPartialPerm</code>( <var class="Arg">obj</var> )</td><td class="tdright">( category )</td></tr></table></div>
<p>Returns: <code class="keyw">true</code> or <code class="keyw">false</code>.</p>
<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_mj.html#X784A14F787E041D7"><span class="RefLink">54.3-4</span></a>), <code class="func">ImageListOfPartialPerm</code> (<a href="chap54_mj.html#X8333293F87F654FA"><span class="RefLink">54.3-6</span></a>), <code class="func">ImageSetOfPartialPerm</code> (<a href="chap54_mj.html#X7F0724A07A14DCF7"><span class="RefLink">54.3-7</span></a>), <code class="func">RankOfPartialPerm</code> (<a href="chap54_mj.html#X7C1ABD8A80E95B39"><span class="RefLink">54.3-3</span></a>), <code class="func">DegreeOfPartialPerm</code> (<a href="chap54_mj.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>
<p><a id="X8262A827790DD1CC" name="X8262A827790DD1CC"></a></p>
<h5>54.1-2 IsPartialPermCollection</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ IsPartialPermCollection</code>( <var class="Arg">obj</var> )</td><td class="tdright">( category )</td></tr></table></div>
<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>
<p><a id="X7E63D17780F64FBA" name="X7E63D17780F64FBA"></a></p>
<h5>54.1-3 PartialPermFamily</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ PartialPermFamily</code></td><td class="tdright">( family )</td></tr></table></div>
<p>The family of all partial permutations is <code class="code">PartialPermFamily</code></p>
<p><a id="X7B9D451D7FDA1DD8" name="X7B9D451D7FDA1DD8"></a></p>
<h4>54.2 <span class="Heading">Creating partial permutations</span></h4>
<p>There are several ways of creating partial permutations in <strong class="pkg">GAP</strong>, which are described in this section.</p>
<p><a id="X8538BAE77F2FB2F8" name="X8538BAE77F2FB2F8"></a></p>
<h5>54.2-1 PartialPerm</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ PartialPerm</code>( <var class="Arg">dom</var>, <var class="Arg">img</var> )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ PartialPerm</code>( <var class="Arg">list</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: A partial permutation.</p>
<p>Partial permutations can be created in two ways: by giving the domain and the image, or the dense image list.</p>
<dl>
<dt><strong class="Mark">Domain and image</strong></dt>
<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>
<div class="example"><pre>PartialPerm([1,5],[20,2]); </pre></div>
<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_mj.html#X8087DCC780B9656A"><span class="RefLink">42.5-3</span></a>).</p>
</dd>
<dt><strong class="Mark">Dense image list</strong></dt>
<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]<>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>
<div class="example"><pre>PartialPerm([20,0,0,0,2]);</pre></div>
<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_mj.html#X78D611D17EA6E3BC"><span class="RefLink">42.5-2</span></a>).</p>
</dd>
</dl>
<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>
<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>
<div class="example"><pre>PartialPerm([10000], [1]);</pre></div>
<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>
<div class="example"><pre>PartialPerm([1,2,3,4,0,6]);</pre></div>
<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>
<p><a id="X81188D9F83F64222" name="X81188D9F83F64222"></a></p>
<h5>54.2-2 PartialPermOp</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ PartialPermOp</code>( <var class="Arg">obj</var>, <var class="Arg">list</var>[, <var class="Arg">func</var>] )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ PartialPermOpNC</code>( <var class="Arg">obj</var>, <var class="Arg">list</var>[, <var class="Arg">func</var>] )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: A partial permutation or <code class="keyw">fail</code>.</p>
<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_mj.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>
<p>This function is the analogue in the context of partial permutations of <code class="func">Permutation</code> (<a href="chap41_mj.html#X7807A33381DCAB26"><span class="RefLink">41.9-1</span></a>) or <code class="func">TransformationOp</code> (<a href="chap53_mj.html#X7C2A3FC9782F2099"><span class="RefLink">53.2-5</span></a>).</p>
<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>
<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>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">f:=Transformation( [ 9, 10, 4, 2, 10, 5, 9, 10, 9, 6 ] );;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">PartialPermOp(f, [ 6 .. 8 ], OnPoints);</span>
[1,4][2,5][3,6]</pre></div>
<p><a id="X80ABBF4883C79060" name="X80ABBF4883C79060"></a></p>
<h5>54.2-3 RestrictedPartialPerm</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ RestrictedPartialPerm</code>( <var class="Arg">f</var>, <var class="Arg">set</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: A partial permutation.</p>
<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>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">f:=PartialPerm( [ 1, 3, 4, 7, 8, 9 ], [ 9, 4, 1, 6, 2, 8 ] );;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">RestrictedPartialPerm(f, [ 2, 3, 6, 10 ] );</span>
[3,4]</pre></div>
<p><a id="X849668DD7B0B9E3B" name="X849668DD7B0B9E3B"></a></p>
<h5>54.2-4 JoinOfPartialPerms</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ JoinOfPartialPerms</code>( <var class="Arg">arg</var> )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ JoinOfIdempotentPartialPermsNC</code>( <var class="Arg">arg</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: A partial permutation or <code class="keyw">fail</code>.</p>
<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>
<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>
<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>
<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">\(\cap\)</span> dom(<var class="Arg">g</var>) of their domains and the images of dom(<var class="Arg">f</var>)<span class="SimpleMath">\(\setminus\)</span> dom(<var class="Arg">g</var>) and dom(<var class="Arg">g</var>)<span class="SimpleMath">\(\setminus\)</span> dom(<var class="Arg">f</var>) under <var class="Arg">f</var> and <var class="Arg">g</var>, respectively, are disjoint.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 6, 8, 10 ], [ 2, 6, 7, 9, 1, 5 ] );</span>
[3,7][8,1,2,6,9][10,5]
<span class="GAPprompt">gap></span> <span class="GAPinput">g:=PartialPerm( [ 11, 12, 14, 16, 18, 19 ],</span>
<span class="GAPprompt">></span> <span class="GAPinput">[ 17, 20, 11, 19, 14, 12 ] );</span>
[16,19,12,20][18,14,11,17]
<span class="GAPprompt">gap></span> <span class="GAPinput">JoinOfPartialPerms(f, g);</span>
[3,7][8,1,2,6,9][10,5][16,19,12,20][18,14,11,17]
<span class="GAPprompt">gap></span> <span class="GAPinput">f:=PartialPerm( [ 1, 4, 5, 6, 7 ], [ 5, 7, 3, 1, 4 ] );</span>
[6,1,5,3](4,7)
<span class="GAPprompt">gap></span> <span class="GAPinput">g:=PartialPerm( [ 100 ], [ 1 ] );</span>
[100,1]
<span class="GAPprompt">gap></span> <span class="GAPinput">JoinOfPartialPerms(f, g);</span>
fail
<span class="GAPprompt">gap></span> <span class="GAPinput">f:=PartialPerm( [ 1, 3, 4 ], [ 3, 2, 4 ] );</span>
[1,3,2](4)
<span class="GAPprompt">gap></span> <span class="GAPinput">g:=PartialPerm( [ 1, 2, 4 ], [ 2, 3, 4 ] );</span>
[1,2,3](4)
<span class="GAPprompt">gap></span> <span class="GAPinput">JoinOfPartialPerms(f, g);</span>
fail
<span class="GAPprompt">gap></span> <span class="GAPinput">f:=PartialPerm( [ 1 ], [ 2 ] );</span>
[1,2]
<span class="GAPprompt">gap></span> <span class="GAPinput">JoinOfPartialPerms(f, f^-1);</span>
(1,2)</pre></div>
<p><a id="X81E2B6977E28CD00" name="X81E2B6977E28CD00"></a></p>
<h5>54.2-5 MeetOfPartialPerms</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ MeetOfPartialPerms</code>( <var class="Arg">arg</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: A partial permutation.</p>
<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>
<p>Note that unlike the join of partial permutations, the meet always exists.</p>
<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>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 6, 100000 ], [ 2, 6, 7, 1, 5 ] );</span>
[3,7][100000,5](1,2,6)
<span class="GAPprompt">gap></span> <span class="GAPinput">g:=PartialPerm( [ 1, 2, 3, 4, 6 ], [ 2, 4, 6, 1, 5 ] );</span>
[3,6,5](1,2,4)
<span class="GAPprompt">gap></span> <span class="GAPinput">MeetOfPartialPerms(f, g);</span>
[1,2]
<span class="GAPprompt">gap></span> <span class="GAPinput">g:=PartialPerm( [ 1, 2, 3, 5, 6, 7, 9, 10 ],</span>
<span class="GAPprompt">></span> <span class="GAPinput">[ 4, 10, 5, 6, 7, 1, 3, 2 ] );</span>
[9,3,5,6,7,1,4](2,10)
<span class="GAPprompt">gap></span> <span class="GAPinput">MeetOfPartialPerms(f, g);</span>
<empty partial perm></pre></div>
<p><a id="X80EFB142817A0A9F" name="X80EFB142817A0A9F"></a></p>
<h5>54.2-6 EmptyPartialPerm</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ EmptyPartialPerm</code>( )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: The empty partial permutation.</p>
<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>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">EmptyPartialPerm();</span>
<empty partial perm></pre></div>
<p><a id="X7E6ADC8583C31530" name="X7E6ADC8583C31530"></a></p>
<h5>54.2-7 <span class="Heading">RandomPartialPerm</span></h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ RandomPartialPerm</code>( <var class="Arg">n</var> )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ RandomPartialPerm</code>( <var class="Arg">set</var> )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ RandomPartialPerm</code>( <var class="Arg">dom</var>, <var class="Arg">img</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: A random partial permutation.</p>
<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>
<div class="example"><pre><span class="GAPprompt">gap></span> <span class="GAPinput">RandomPartialPerm(10);</span>
[2,9][4,1,6,5][7,3](8)</pre></div>
<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>
<div class="example"><pre><span class="GAPprompt">gap></span> <span class="GAPinput">RandomPartialPerm([1,2,3,1000]);</span>
[2,3,1000](1)</pre></div>
<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>
<p>Note that it is not guaranteed in either of these cases that partial permutations are chosen with a uniform distribution.</p>
<p><a id="X8779F0997D0FDA78" name="X8779F0997D0FDA78"></a></p>
<h4>54.3 <span class="Heading">Attributes for partial permutations</span></h4>
<p>In this section we describe the functions available in <strong class="pkg">GAP</strong> for finding various attributes of partial permutations.</p>
<p><a id="X8612A4DC864E7959" name="X8612A4DC864E7959"></a></p>
<h5>54.3-1 DegreeOfPartialPerm</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DegreeOfPartialPerm</code>( <var class="Arg">f</var> )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DegreeOfPartialPermCollection</code>( <var class="Arg">coll</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: A non-negative integer.</p>
<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>
<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>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 6, 8, 10 ], [ 2, 6, 7, 9, 1, 5 ] );</span>
[3,7][8,1,2,6,9][10,5]
<span class="GAPprompt">gap></span> <span class="GAPinput">DegreeOfPartialPerm(f);</span>
10</pre></div>
<p><a id="X8413D0EF7DEE1FFF" name="X8413D0EF7DEE1FFF"></a></p>
<h5>54.3-2 CodegreeOfPartialPerm</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CodegreeOfPartialPerm</code>( <var class="Arg">f</var> )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ CodegreeOfPartialPermCollection</code>( <var class="Arg">coll</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: A non-negative integer.</p>
<p>The <em>codegree</em> of a partial permutation <var class="Arg">f</var> is the largest positive integer in its image.</p>
<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>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 4, 5, 8, 10 ], [ 7, 1, 4, 3, 2, 6, 5 ] );</span>
[8,6][10,5,2,1,7](3,4)
<span class="GAPprompt">gap></span> <span class="GAPinput">CodegreeOfPartialPerm(f);</span>
7</pre></div>
<p><a id="X7C1ABD8A80E95B39" name="X7C1ABD8A80E95B39"></a></p>
<h5>54.3-3 RankOfPartialPerm</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ RankOfPartialPerm</code>( <var class="Arg">f</var> )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ RankOfPartialPermCollection</code>( <var class="Arg">coll</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: A non-negative integer.</p>
<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>
<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>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 4, 6, 8, 9 ], [ 7, 10, 1, 9, 4, 2 ] );</span>
[6,9,2,10][8,4,1,7]
<span class="GAPprompt">gap></span> <span class="GAPinput">RankOfPartialPerm(f);</span>
6</pre></div>
<p><a id="X784A14F787E041D7" name="X784A14F787E041D7"></a></p>
<h5>54.3-4 DomainOfPartialPerm</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DomainOfPartialPerm</code>( <var class="Arg">f</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ DomainOfPartialPermCollection</code>( <var class="Arg">f</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: A set of positive integers (maybe empty).</p>
<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>
<p>The domain of a partial permutation collection <var class="Arg">coll</var> is the union of the domains of its elements.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 6, 8, 10 ], [ 2, 6, 7, 9, 1, 5 ] );</span>
[3,7][8,1,2,6,9][10,5]
<span class="GAPprompt">gap></span> <span class="GAPinput">DomainOfPartialPerm(f);</span>
[ 1, 2, 3, 6, 8, 10 ]</pre></div>
<p><a id="X7CD84B107831E0FC" name="X7CD84B107831E0FC"></a></p>
<h5>54.3-5 ImageOfPartialPermCollection</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ImageOfPartialPermCollection</code>( <var class="Arg">coll</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: A set of positive integers (maybe empty).</p>
<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>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">S := SymmetricInverseSemigroup(5);</span>
<symmetric inverse monoid of degree 5>
<span class="GAPprompt">gap></span> <span class="GAPinput">ImageOfPartialPermCollection(GeneratorsOfInverseSemigroup(S));</span>
[ 1 .. 5 ]</pre></div>
<p><a id="X8333293F87F654FA" name="X8333293F87F654FA"></a></p>
<h5>54.3-6 ImageListOfPartialPerm</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ImageListOfPartialPerm</code>( <var class="Arg">f</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: The list of images of a partial permutation.</p>
<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>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 4, 5, 8, 10 ], [ 7, 1, 4, 3, 2, 6, 5 ] );</span>
[8,6][10,5,2,1,7](3,4)
<span class="GAPprompt">gap></span> <span class="GAPinput">ImageListOfPartialPerm(f);</span>
[ 7, 1, 4, 3, 2, 6, 5 ]</pre></div>
<p><a id="X7F0724A07A14DCF7" name="X7F0724A07A14DCF7"></a></p>
<h5>54.3-7 ImageSetOfPartialPerm</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ImageSetOfPartialPerm</code>( <var class="Arg">f</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: The image set of a partial permutation.</p>
<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>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">f:=PartialPerm( [ 1, 2, 3, 5, 7, 10 ], [ 10, 2, 3, 5, 7, 6 ] );</span>
[1,10,6](2)(3)(5)(7)
<span class="GAPprompt">gap></span> <span class="GAPinput">ImageSetOfPartialPerm(f);</span>
[ 2, 3, 5, 6, 7, 10 ]</pre></div>
<p><a id="X82AAFF938623422E" name="X82AAFF938623422E"></a></p>
<h5>54.3-8 FixedPointsOfPartialPerm</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FixedPointsOfPartialPerm</code>( <var class="Arg">f</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FixedPointsOfPartialPerm</code>( <var class="Arg">coll</var> )</td><td class="tdright">( method )</td></tr></table></div>
<p>Returns: A set of positive integers.</p>
<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>
<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>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">f := PartialPerm( [ 1, 2, 3, 6, 7 ], [ 1, 3, 4, 7, 5 ] );</span>
[2,3,4][6,7,5](1)
<span class="GAPprompt">gap></span> <span class="GAPinput">FixedPointsOfPartialPerm(f);</span>
[ 1 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">f := PartialPerm([1 .. 10]);;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">FixedPointsOfPartialPerm(f);</span>
[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]</pre></div>
<p><a id="X82FE981A87FAA2DC" name="X82FE981A87FAA2DC"></a></p>
<h5>54.3-9 MovedPoints</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ MovedPoints</code>( <var class="Arg">f</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ MovedPoints</code>( <var class="Arg">coll</var> )</td><td class="tdright">( method )</td></tr></table></div>
<p>Returns: A set of positive integers.</p>
<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><>i</code>.</p>
<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>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">f := PartialPerm( [ 1, 2, 3, 4 ], [ 5, 7, 1, 6 ] );</ | |