GAP Lesson 3

Change to the directory where you store your GAP files, and then start up GAP. In the session which follows, pause for discussion at the spaces between command groupings.

gap> LogTo("GAPlesson3");

gap> At:=KnownAttributesOfObject;

There is also KnownPropertiesOfObject.

Some manipulation with permutation groups.
You learn: Orbits, Action, Tuples, UnorderedTuples, Arrangements, Combinations. In an earlier version of GAP4 and also in GAP3 the command Action was Operation. It may be that in the implementation you use you need to type Operation.

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> At(c);
gap> At(s);
gap> Orbits(s,[1..7]);
gap> news:=Action(s,last[3]);
gap> Size(news);

How would it be different if you had done instead
gap> news:=Action(s,last[2]);
gap> Size(news);

What do you think would happen if you were to do
gap> Orbits(s,[1..8]);
gap> Orbits(s,[2..7]);
gap> Orbits(s,[3..7]);

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> newers:=Action(news,Tuples([1..4],2),OnTuples);
gap> Orbits(newers);

Other possibilities in Action instead of OnTuples: OnPairs, OnTuples, OnSets, OnRight, OnLeft. Investigate by doing ?Actions.

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

We use these commands to show computationally that SL(2,4) is isomorphic to the alternating group A_5. We first call up SL(2,4) from a library of matrix groups. We will learn about matrix groups in just a moment.

gap> h:=SL(2,4);
gap> Size(h);
gap> sh:=SylowSubgroup(h,2);
gap> n:=Normalizer(h,sh);
gap> Size(n);
gap> newh:=Action(h,RightCosets(h,n),OnRight);
gap> Size(newh);

Exercise: Show that the group
gap> k:=Group((1,5)(2,6),(1,3)(4,6),(2,3)(4,5));
is isomorphic to the symmetric group S_4.

Matrices, Finite Fields and Matrix Groups

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.

gap> g:=GL(3,2);
gap> Size(g);
gap> GeneratorsOfGroup(g);
gap> g.1;

We now set about trying to get GAP to print out what these matrices really are.

gap> Print(g.1);
gap> PrintArray(g.1);

The same commands we have used for permutation groups also work for matrix groups!

gap> SylowSubgroup(g,2);
gap> At(g);

We now learn about finite fields.

gap> FieldOfMatrixGroup(g);
gap> GF(2);
gap> Elements(GF(2));
gap> Elements(GF(4));
gap> Z(16)^3+Z(16)^4;

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

Using the function Int we now write a function which prints out (some) matrices nicely.

gap> MatPrint:=function(mat)
> PrintArray(List(mat,x->List(x,Int)));
> end;
function( mat ) ... end
gap> MatPrint(g.1);
gap> MatPrint(g.2);

The following lines illustrate some standard matrix operations. These lines can be omitted.

gap> g.1*g.2;
gap> MatPrint(g.1*g.2);
gap> MatPrint((g.1*g.2)^-1);
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));

Algorithms for permutation groups generally work much faster than algorithms for matrix groups. Because of this, one of the first things frequently done with a matrix group is to convert it to a permutation group. We now seem some ways to do this.

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);

The latter may be created by doing the next two lines:

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);