maths.freeAbstract Algebra › 6. Cosets and Lagrange's Theorem › Sage

Sage

Sage can create all of the cosets of a subgroup, and all of the subgroups of a group.

Sage

Sage can create all of the cosets of a subgroup, and all of the subgroups of a group. While these methods can be somewhat slow, they are in many, many ways much better than experimenting with pencil and paper, and can greatly assist us in understanding the structure of finite groups.

Cosets

Sage will create all the right (or left) cosets of a subgroup. Written mathematically, cosets are sets, and the order of the elements within the set is irrelevant. With Sage, lists are more natural, and here it is to our advantage.

Sage creates the cosets of a subgroup as a list of lists. Each inner list is a single coset. The first coset is always the coset that is the subgroup itself, and the first element of this coset is the identity. Each of the other cosets can be construed to have their first element as their representative, and if you use this element as the representative, the elements of the coset are in the same order they would be created by multiplying this representative by the elements of the first coset (the subgroup).

The keyword side can be 'right' or 'left', and if not given, then the default is right cosets. The options refer to which side of the product has the representative. Notice that now Sage's results will be backwards compared with the text. Here is reprised, but in a slightly different order.

So if we work our way through the brackets carefully we can see the difference between the right cosets and the left cosets. Compare these cosets with the ones in the text and see that left and right are reversed. Shouldn't be a problem just keep it in mind.

If we study the bracketing, we can see that the left and right cosets are equal. Let's see what Sage thinks:

Mathematically, we need sets, but Sage is working with ordered lists, and the order matters. However, if we know our lists do not have duplicates (the .cosets() method will never produce duplicates) then we can sort the lists and a test for equality will perform as expected. The elements of a permutation group have an ordering defined for them it is not so important what this is, just that some ordering is defined. The sorted() function will take any list and return a sorted version. So for each list of cosets, we will sort the individual cosets and then sort the list of sorted cosets. This is a typical maneuver, though a bit complicated with the nested lists.

Condensed — the full section is in Judson, Abstract Algebra: Theory and Applications.

Subgroups

Sage can compute all of the subgroups of a group. This can produce even more output than the coset method and can sometimes take much longer, depending on the structure of the group. The list is in order of the size of the subgroups, with smallest first. As a demonstration we will first compute and list all of the subgroups of a small group, and then extract just one of these subgroups from the list for some futher study.

The output of the .subgroups() method can be voluminous, so sometimes we are interested in properties of specific subgroups (as in the previous example) or broader questions of the group's subgroup structure. Here we expand on . Notice that just because Sage does not compute a subgroup of order 6 in \(A_4\), this is no substitute whatsoever for a proof such as given for the corollary. But the computational result emboldens us to search for the theoretical result with confidence.

So we see no subgroup of order 6 in the list of subgroups of \(A_4\). Notice how Lagrange's Theorem () is in evidence all the subgroup orders divide \(12\), the order of \(A_4\). Be patient, the next subgroup computation may take a while.

Again, note Lagrange's Theorem in action. But more interestingly, \(S_4\) has a subgroup of order 6. Four of them, to be precise. These four subgroups of order 6 are similar to each other, can you describe them simply (before digging into the sg list for more information)? If you were curious how many subgroups \(S_4\) has, you could simply count the number of subgroups in the sg list. The len() function does this for any list and is often an easy way to count things.

Subgroups of Cyclic Groups

Now that we are more familiar with permutation groups, and know about the .subgroups() method, we can revisit an idea from . The subgroups of a cyclic group are always cyclic, but how many are there and what are their orders?

We could do this all day, but you have Sage at your disposal, so vary the order of G by changing n and study the output across many runs. Maybe try a cyclic group of order 24 and compare with the symmetric group \(S_4\) (above) which also has order 24. Do you feel a conjecture coming on?

Euler Phi Function

To add to our number-theoretic functions from , we note that Sage makes the Euler \(\phi\)-function available as the function euler_phi().

Here's an interesting experiment that you can try running several times.

Feel another conjecture coming on? Can you generalize this result?

Symbols used here

\mathbb{N},\ \mathbb{Z},\ \mathbb{Q},\ \mathbb{R},\ \mathbb{C}
number sets
Naturals, integers, rationals, reals, complex numbers.
x \in A,\ A \subseteq B
element of, subset
x belongs to A; every element of A is in B.
\blacksquare\ \text{or}\ \square
end of proof (halmos)
Marks the point where the statement has been established.
a \equiv b \pmod n
congruent modulo n
n divides a − b; a and b have the same remainder.
a \mid b,\ \gcd(a,b)
divides, greatest common divisor
b is a multiple of a; the largest number dividing both.
(G, \cdot),\ e,\ g^{-1}
group, identity, inverse
A set with an operation; the do-nothing element; the element that undoes g.
G \cong H,\ G / N
isomorphic, quotient group
Same structure; the group of cosets of a normal subgroup N.
\mathbb{Z}/n\mathbb{Z},\ \mathbb{Z}_n
integers modulo n
The remainders 0…n−1 with clock arithmetic.
\operatorname{Hom}(A, B),\ f \circ g
arrows from A to B, composition
The set of morphisms; do g then f.

Questions people ask

What is a group, in plain words?

A set with one operation that is associative, has an identity, and lets every element be undone. Symmetries of any object form a group — that is where the idea came from.

What is the difference between a ring and a field?

A ring has addition and multiplication that behave like the integers (you cannot always divide); a field is a ring where every non-zero element has a reciprocal, like the rationals or the reals.

נסה את שלך.

Parts of this page are adapted from Judson, Abstract Algebra: Theory and Applications (GFDL 1.3). Condensed and re-explained here; errors are ours.

יותר בפנים. Abstract Algebra