Fixed points in GAP

430 Views Asked by At

How we can write a command in GAP for those permutations that are fixed, For instance: if we have x:=(3,4)(5,7)(6.8)(9,12)(10,13)(11,14); here 1 and 2 are fixed Moreover, if these point lies in other permutation i.e t:=(1,2)(5,6)(7,8)(9,12),10,11)(13,14);

Here point 1 and 2 are fixed in x and lies in t permutations.

I want GAP to examine these points by itself. How can we do it?

I am writing this programe like this

For i in x and i->i do    
  if i in t then     
    Print(i);    
  fi;    
od;

but it does'nt work. Can anyone assist me?

1

There are 1 best solutions below

3
On BEST ANSWER

Here is some code that does what you ask. It first defines a function to handle this problem in general, and then calls it for your specific X and T. It returns the answer as a list, since lists are easier to work with later (just printing the answers is fine, but what if you want to do something with them later? It is nice if they are stored somewhere). I include links to the reference manual in the following code:

gap> fixedByXandMovedByT := function( X, T )
>  return Filtered( MovedPoints( T ), i -> i = i^X );
> end;
gap> fixedByXandMovedByT( (3,4)(5,7)(6,8)(9,12)(10,13)(11,14), (1,2)(5,6)(7,8)(9,12)(10,11)(13,14) );
[ 1, 2 ]

If i is a positive integer and X is a permutation, then i^X means the evaluation of X at the point i. So i = i^X means i is a fixed point of X. Yes, if you type this into gap it defines a function. The beginning of the function is marked by function, the value of the function is marked by return and the end of the function is marked by end.

The tutorial on functions at the gap website, gap-system.org is pretty clear.