# Warning! Mult of perms right to left! (1,2)*(1,3); (1,3)*(1,2); # Sn generated by (1,2,3,..,n) and (1,2) S4 := Group([(1,2,3,4),(1,2)]); # How many elems in grp? Order(S4); # Pick one elem. S4.1; # List elems, order. ES4 := Elements(S4); for x in ES4 do; Print(Order(x),"\t",x,"\n"); od; # Anonymous fnct applied to list L := [1..10]; List(L, i->i^2); # Previous example, concisely List(ES4,Order); List(ES4, y->[Order(y),y]); # Select those of order 2 Filtered(ES4, x -> ( Order(x) = 2)); # List elems, order, cycletype for x in ES4 do; Print(x,"\t\t ", Order(x), "\t ", CycleStructurePerm(x), "\n"); od; # Select transpositions Filtered(ES4, x -> ( CycleStructurePerm(x) = [1])); # Select prod 2 disj trans Filtered(ES4, x -> ( CycleStructurePerm(x) = [2])); # Select even perms, create grp generated by them A4 := Subgroup(S4,Filtered(ES4,y->SignPerm(y)=1)); Order(A4); # Alternating group An genererated by 3-cycles AA4 := Subgroup(S4,[(1,2,3),(1,2,4),(1,3,4),(2,3,4)]); Elements(AA4); Order(AA4); # An normal i Sn, index 2 ConjugateSubgroups(S4,A4); Index(S4,A4); # S3 not normal i S4 S3 := Subgroup(S4,[(1,2,3),(1,2)]); ConjugateSubgroups(S4,S3); # So, left and right coset decomposition differs # Right cosets, command exists RC4 := RightCosets(S4,S3); for x in RC4 do Print(Elements(x),"\n\n"); od; # Right traversal: pick one representative from each class RT4 := List(RightTransversal(S4,S3),i->CanonicalRightCosetElement(S3,i)); # Gives right cosets, by Lagrange bijection map for x in RT4 do y := List(Elements(S3), z->z*x); Print(y,"\n\n"); od; # Why is this a left transversal? LT4 := List(RT4, x->x^(-1)); # Finally, our left cosets for x in LT4 do y := List(Elements(S3), z->x*z); Print(y,"\n\n"); od; # Dihedral group of order 10 r := ( 1,2,3,4,5); s := (2,5)(3,4); D5 := Group([r,s]); Order(D5); # Relations: rs = sr^(-1), r^5=1=s^2 r*s; s*r^(-1); r^5; s^2; # Is normal? rotations := Subgroup(D5,[r]); Index(D5,rotations); # Is normal? sflex := Subgroup(D5,[s]); Index(D5,sflex); ConjugateSubgroups(D5,sflex); # What is the product of these subgroups? Intersection? Intersection(rotations,sflex); er := Elements(rotations); es := Elements(sflex); cp := Cartesian(er,es); List(cp, x-> x[1]*x[2]); # So, if both subgroups had been normal, then # D5 would have been the internal dp, i.e. iso # to Z5xZ2 = Z10. But: IsomorphismGroups(D5, CyclicGroup(10)); # Quotient groups, example from lecture H := Subgroup(S4,[(1,2)(3,4),(1,3)(2,4),(1,4)(2,3)]); ConjugateSubgroups(S4,H); KVOT := S4/H; ELK:=Elements(KVOT); List(ELK,Order); IsomorphismGroups(S3, KVOT); # Some magic... FactorizeInGenerators := function(G,gens,e) local i,n,F,hom,fgens,prerep,K; n := Length(gens); F :=FreeGroup(n); fgens := GeneratorsOfGroup(F); hom := GroupHomomorphismByImages(F,G,fgens,gens); prerep := PreImagesRepresentative(hom,e); return prerep; end; # All elements of D5 are products of r and s r; s; Elements(D5); List(Elements(D5), e->[e,FactorizeInGenerators(D5,[r,s],e)]); r^-1*s^-1*r^-1; s; # For small groups, the following command works better List(Elements(D5), e->[e,Factorization(D5,e)]); # ConjugacyClasses CD5 := ConjugacyClasses(D5); List(Elements(CD5), x -> [x, Length(Elements(x)), Elements(x)]); # Class equation List(Elements(CD5), x -> Length(Elements(x))); CD5[2]; Elements(CD5[2]); Centralizer(D5, (2,5)(3,4)); Elements(CD5[3]); Foo:=Centralizer(D5, (1,2,3,4,5)); Order(Foo); # Group actions Orbit(rotations,1); Orbit(sflex,1); Stabilizer(D5,1); # A permutation puzzle G := SymmetricGroup(16); a := (1,2,3,4); b := (4,8,12,16); c := (13,14,15,16); d := (1,5,9,13); e := (1,2,3,7,11,10,9,5); H := Subgroup(G,[a,b,c,d,e]); Order(H); Index(G,H); Orbits(H); Orbit(H,1); Orbit(H,6); Elements([1..16]); List(Elements([1..16]),x -> [x, Stabilizer(H,x)]); List(Elements([1..16]),x -> [x, Order(Stabilizer(H,x))]); HH := Stabilizer(G,6); Order(H); Order(HH); IsomorphismGroups(H,HH); randomelem := (1,5,4)(3,9,16)(2,8)(7,13,11,15); Factorization(H,randomelem); FactorizeInGenerators(H,[a,b,c,d,e],randomelem); d^-1*e^-2*c*b*e^-1*a^-1*e*a^2*d^-1*e*d^-1*e^-1*b^-1*c^-1*b^ -1*a^-1*b*c*d*c^-1*a^-1*d^3*a*e*a^-1*e^-1*d^-1*a^-1; HS := Subgroup(H,[a,b,c,d]); Index(H,HS); ConjugateSubgroups(H,HS); Orbits(HS); IsTransitive(HS); Order(HS); Factorial(12); FactorizeInGenerators(HS,[a,b,c,d],(1,2)); FactorizeInGenerators(HS,[a,b,c,d],(1,2,3,4,5,8,9,12,13,14,15,16));