**GAP Lesson 3
**

*Change to the directory where you store your GAP files, and then start up GAP.
*

gap> LogTo("GAPlesson3");

gap> At:=KnownAttributesOfObject;

*The last command is there because the function *KnownPropertiesOfObject* has a long name and it is inconvenient to keep typing it. It shows that a function can be assigned to a variable. There is also *KnownPropertiesOfObject* but it does something different.
*

**Some manipulation with permutation groups.**

*We start by entering a group. Every so often we will check what GAP knows about the group by doing the command* At.* The first lines are to show you how to access the generators of the group.*

gap> c:=Group((1,2,3,4,5,6,7),(2,3)(4,7));

gap> At(c);

gap> Size(c);

gap> GeneratorsOfGroup(c);

gap> c.1;

gap> c.2;

gap> At(c);

gap> s:=SylowSubgroup(c,2);

gap> Size(s);

gap> At(c);

gap> At(s);

*Comment on anything you notice.
We now learn: Orbits, Action, Tuples, UnorderedTuples, Arrangements, Combinations.
*

gap> Orbits(s,[1..7]);

gap> news:=Action(s,last[3]);

gap> Size(news);

How would things be different if you had done instead

gap> Size(news);

What do you think would happen if you were to do

Now try the following:

gap> Tuples([1..3],2);

gap> UnorderedTuples([1..3],2);

gap> Arrangements([1..3],2);

gap> Combinations([1..3],2);

Exercise: Find out what GAP command returns a list of all partitions of [1,2,3].

gap> Orbits(newers);

gap> Action(c,RightCosets(c,s),OnRight);

gap> Orbits(last);

gap> g:=SL(2,4);

gap> Size(g);

gap> sg:=SylowSubgroup(g,2);

gap> n:=Normalizer(g,sg);

gap> Size(n);

gap> newg:=Action(g,RightCosets(g,n),OnRight);

gap> Size(newg);

gap> k:=Group((1,5)(2,6),(1,3)(4,6),(2,3)(4,5));

We learn: vectors are lists, matrices are lists of lists, they can be manipulated the same way as integers, the functions BaseMat, TransposedMat, NullspaceMat, RankMat, TriangulizeMat, PrintArray, the library of matrix groups; how finite field elements are represented and manipulated; computations with matrix groups are mostly done by finding a permutation representation first.

With the calculations using SL(2,4) we have already seen that GAP can compute with matrix groups, and that some of the same commands for permutation groups also work in this context. Let us examine this group a little more.

gap> GeneratorsOfGroup(g);

gap> g.1;

gap> Print(g.1);

gap> PrintArray(g.1);

gap> FieldOfMatrixGroup(g);

gap> GF(2);

gap> Elements(GF(2));

gap> Elements(GF(4));

gap> Z(16)^3+Z(16)^4;

gap> Z(4) in GF(16);

gap> Z(4) in GF(8);

Exercise: Find the power of Z(16) that equals Z(4).

We next see how to display elements of the prime field in a user-friendly fashion.

gap> List(Elements(GF(2)),Int);

gap> List(Elements(GF(4)),Int);

gap> List(Elements(GF(11)),Int);

gap> Elements(GF(11));

gap> MatPrint:=function(mat)

> PrintArray(List(mat,x->List(x,Int)));

> end;

function( mat ) ... end

gap> g:=GL(3,2);

gap> MatPrint(g.1);

gap> MatPrint(g.2);

gap> Size(g);

gap> g.1*g.2;

gap> MatPrint(g.1*g.2);

gap> mat:=g.2+g.2^2;

gap> MatPrint(mat);

gap> MatPrint(BaseMat(mat));

gap> MatPrint(mat);

gap> MatPrint(NullspaceMat(mat));

gap> RankMat(mat);

gap> MatPrint(TransposedMat(g.2));

gap> Orbits(g,GF(2)^3);

gap> gcopy:=Action(g, last[2]);

gap> Size(gcopy);

gap> Print(g.1);

gap> Orbit(g,g.1[1]);

gap> Action(g,last);

gap> NiceObject(g);

gap> hom:=NiceMonomorphism(g);

<Action homomorphism>

gap> Image(hom,g);

Group([ (5,7)(6,8), (2,3,5)(4,7,6) ])

gap> Image(hom,g.1);

(5,7)(6,8)