-2

I have the following input in GAP's environment:

enter image description here

I wanted to check whether a certain element of my Free group is in the group or not, so I used the code:

    > a in e;

and expected to get

    [ true

But it didn't work:

    [ false

But when I eliminated the long green [ in above pic on the right by hand, the answer got clear:

enter image description here

May I ask a help not to do it by hand? Thanks.

Edit: Here is the codes I did for a Free group for two generators. Look at the results at the end.

enter image description here

Mikasa
  • 109
  • 1
  • 1
  • 5
  • Please clarify what do you mean by "eliminated the long green [" ? Also, how `a` and `w` were created? Thanks. – Olexandr Konovalov Aug 04 '13 at 12:52
  • @AlexanderKonovalov: I have a free group f:=Freegroup(3) and indeed a is as a:=f.1. I wan to examine for my self if this a is in w or not. In fact, I wanted to check this for other elements in a loop. But I couldn't do this as I wanted. I thought maybe the Long [ in the right of the first pic make my answer wrong. I removed it by hand as you see in the 2th pic and see that the answer is clear. – Mikasa Aug 04 '13 at 12:57
  • 1
    You are using some kind of a GAP shell which is not redistributed with GAP (apparently, GGAP), so we have to figure out whether this is a problem of theirs interface to GAP, or a problem in GAP. Unfortunately, I can't see the complete example to try in in GAP command line directly. Can you start GAP with gap.bat, and is your problem reproducible in this case? – Olexandr Konovalov Aug 04 '13 at 16:12
  • P.S. Apparently `w` is not a free group, otherwise you can't have a list of ALL of its elements. Are you sure that `a` belongs to the right group? Is `a` in `w` or in `f`? – Olexandr Konovalov Aug 04 '13 at 16:15
  • @AlexanderKonovalov: Dear Prof. I added something above in the body which was done in your recent GAP. I think it is the version you suggested me to use. At the end, I called "a in e" but I got false! :( Why is this happened? Shouldn't we call thin code "in" when we want to check if an element is in the structure or not? Am I missing important here? Thanks for your time. – Mikasa Aug 05 '13 at 08:12
  • 1
    Thanks. GAP behaves correctly: `a` is an element of `f` and not of `w`. You may use `GeneratorsOfGroup(w)` and get **its** generators. I will post a proper answer later. – Olexandr Konovalov Aug 05 '13 at 15:56

1 Answers1

1

Indeed, GAP behaves correctly here: a is an element of f and not of w. If you want to access generators of the newly created finitely presented group, use GeneratorsOfGroup(w) to get their list.

An example based on the original question, but also demonstrating how to use ParseRelators to simplify input:

gap> f:=FreeGroup("a","b");
<free group on the generators [ a, b ]>
gap> w:=f/ParseRelators(f,"a^2,b^3,(ab)^4");
<fp group on the generators [ a, b ]>
gap> Size(w);
24
gap> e:=Elements(w);
[ <identity ...>, a*b*a*b^-1*a*b, b, (a*b)^2, b*a*b^-1*a*b, a*b^-1*a*b*a, 
  b^-1*a*b^-1, a, b^-1, a*b^-1*a, a*b*a*b^-1, (a*b^-1)^2, a*b*a*b^-1*a, 
  b*a*b^-1, b^-1*a, b*a*b, b*a*b^-1*a, a*b^-1*a*b, b^-1*a*b*a, a*b^-1, b*a, 
  a*b, a*b*a, b^-1*a*b ]
gap> gens:=GeneratorsOfGroup(w);
[ a, b ]
gap> a:=gens[1];
a
gap> a in e;
true

Now quite technical detail: indeed, a from f and a from w belong to different families:

gap> FamilyObj(GeneratorsOfGroup(f)[1]) = FamilyObj(GeneratorsOfGroup(w)[1]);
false

This is why you were getting false in your examples.

Mike Pierce
  • 1,390
  • 1
  • 12
  • 35
  • P.S. Nice to see the usage of GAP 4.6 here. Note that while running GAP in `mintty` shell it is very easy to copy and paste the text from the terminal instead of making a snapshot of the screen (then I wouldn't have to retype the input manually). Also, you can customise font size and colours, and these settings will be preserved for future GAP installations. – Olexandr Konovalov Aug 08 '13 at 22:58
  • P.P.S.: Any particular reasons why this has not been asked under ["gap" tag at MSE](http://math.stackexchange.com/questions/tagged/gap)? I think dispersing GAP related questions across several Q&A sites is not helpful, and MSE already has more questions with more views, so GAP users among MSE audience will easier discover questions asked there, not here. – Olexandr Konovalov Aug 08 '13 at 23:47
  • Thanks so much Prof. Konovalov. Indeed, your first comments above gave me the right key and showed me to work with the version you suggested me before. I see now that the version of Prof. Alexander Hulpke has some very small defects. Let me see your attempt above step be step. Thanks again and have a good time in Groups St Andrews 2013. I wish I had been there to attend your sessions. – Mikasa Aug 09 '13 at 21:01
  • 1
    Thanks - you're welcome. As for the suggested "defect", I think that's not true - underneath the Windows Installer by Alexander Hulpke is same GAP 4.4.12 with slightly smaller selection of packages and with the GGAP GUI to GAP (not yet updated for GAP 4.5+). What you observe is likely a side-effect of a common "feature" of all GUIs for CASs: if you execute a sequence of commands A;B; where the result of B depends on the result of A, and then return to A, change it and execute A again, C and its output remain unchanged, so the view of your CAS session is no longer consistent. – Olexandr Konovalov Aug 10 '13 at 13:48