Changing the notation of a permutation in GAP

113 Views Asked by At

I have written a program in GAP which has output three permutation elements. An example is (1,3,4,2),(3,5),(2,4). What I would like is that the notation for the permutations includes all numbers, even if they are sent to themselves, so for the example above to be printed as (1,3,4,2)(5),(3,5)(1)(2)(4),(2,4)(1)(3)(5).

The order in which all the added "identity" terms is not important. Given a permutation a in GAP, is there a way to get it to put it in this notation?

Thanks

2

There are 2 best solutions below

1
On BEST ANSWER

In GAP, permutations all live in an infinite symmetric group so they fix infinitely many positive integers.

However, GAP supports a closely related datatype that keeps track of its domain and range, partial permutations. If you are just doing element-wise operations then partial permutations work very well. If you want to do group theory, stick with permutations, but if you need to do something close-but-not-quite-group theory, then having the transformations keep track of domain and range is very nice. As far as printing, you could use:

gap> AsPartialPerm((1,2,3)(6,7),10);
(1,2,3)(4)(5)(6,7)(8)(9)(10)

or if your domain is not [1..n] you can specify it exactly (only positive integers):

gap> AsPartialPerm((1,2,3)(6,7),[1,2,3,4,6,7,11,13]);
(1,2,3)(4)(6,7)(11)(13)
2
On

Define a function, for example

MyPermPrint:=function(perm,max)
local i;
  Print(perm);
  for i in Filtered([1..max],x->x^perm=x) do
    Print("(",i,")");
  od;
end;

then MyPermPrint((2,4),5); displays (2,4)(1)(3)(5) as desired.

You could in principle install such a fiunction as default View method, but there is no way to get the larghest point from the permutation.