# Groups

One of the most powerful uses of Magma is with group theory. We will only be able to touch the surface of what Magma can do, but this should give you enough to see the power. Let’s start simply. We’ll define the symmetric group on 4 elements and pull out an element to examine.

```> S4 := SymmetricGroup(4); > S4; Symmetric group S4 acting on a set of cardinality 4 Order = 24 = 2^3 * 3 > p := S4!(1,2,3); > Order(p); 3```

It’s easy to create subgroups generated by elements.

```> S := sub<S4 | p>; > S; Permutation group S acting on a set of cardinality 4 Order = 3 (1, 2, 3)```

We can also create permutation groups by giving a list of generators. Let’s look at the Klein 4 group and show that it is not cyclic.

```Klein4 := PermutationGroup<4 | (1,2)(3,4), (1,3)(2,4) >; > #Klein4; 4 > IsAbelian(Klein4); true > IsCyclic(Klein4); false > C4 := CyclicGroup(4); > Klein4,C4; Permutation group Klein4 acting on a set of cardinality 4 Order = 4 = 2^2 (1, 2)(3, 4) (1, 3)(2, 4) Permutation group C4 acting on a set of cardinality 4 Order = 4 = 2^2 (1, 2, 3, 4) > IsIsomorphic(Klein4,C4); false```

Exercise: Since Magma was written by mathematicians for mathematicians, it’s often easy to guess the commands for certain things. Try to do the following without looking up the commands:

1. Use Magma to show that the symmetric group acting on a set of cardinality 3 is the same as the dihedral group acting on a set of cardinality 3.
2. Construct a permutation group acting on 4 elements generated by the cycle elements (1,2)(3,4) and (1,2,3). Check if this group is the same as the alternating group A4.