︠4b83773a-355f-457f-afce-6801a4a8056bi︠ %html
Group Theory and SAGE: A Primer
Robert A. Beezer
University of Puget Sound
©2008 CC-A-SA
License†
Version 1.0
January 30, 2009
This compilation collects SAGE commands that are useful for a student in an introductory course in group theory. It is not intended to teach SAGE or to teach group theory. (There are many introductory texts on group theory and more information on SAGE can be found via sagemath.org.) Rather, by presenting commands roughly in the order a student would learn the corresponding mathematics they might be encouraged to experiment and learn more about mathematics and learn more about SAGE. Not coincidentally, the “E” in SAGE once stood for “Exploration.”
This guide is distributed in PDF format, and as a SAGE worksheet. The worksheet version can be imported into the SAGE notebook environment running in a web browser, and then the displayed chunks of code may be executed by SAGE if one clicks on the small “evaluate” link below each cell, for a fully interactive experience.
a % b will return the remainder upon division of a by b. In other words, the value is the unique integer r such that (1) 0 ≤ r < b, and (2) a = bq + r for some integer q (the quotient). Then (a − r)∕b will equal q. For example,
︡3892e1a1-98ae-4a79-af7d-67e1a8154c53︡{"html": "\r\n\r\n
Group Theory and SAGE: A Primer
\r\nRobert A. Beezer
\r\nUniversity of Puget Sound
\r\n©2008 CC-A-SA\r\nLicense†
\r\nVersion 1.0
\r\nJanuary 30, 2009
This compilation collects SAGE commands that are useful for a student in an introductory\r\ncourse in group theory. It is not intended to teach SAGE or to teach group theory. (There are\r\nmany introductory texts on group theory and more information on SAGE can be found via\r\nsagemath.org.) Rather, by presenting commands roughly in the order a student would learn the\r\ncorresponding mathematics they might be encouraged to experiment and learn more about\r\nmathematics and learn more about SAGE. Not coincidentally, the “E” in SAGE once stood for\r\n“Exploration.”\r\n
This guide is distributed in PDF format, and as a SAGE worksheet. The worksheet version can be\r\nimported into the SAGE notebook environment running in a web browser, and then the displayed chunks\r\nof code may be executed by SAGE if one clicks on the small “evaluate” link below each cell, for a fully\r\ninteractive experience.\r\n
\r\n\r\n
\r\na % b will return the remainder upon division of\r\na by\r\nb. In other words, the value\r\nis the unique integer r\r\nsuch that (1) 0 ≤ r < b, and\r\n(2) a = bq + r for some integer\r\nq (the quotient).\r\nThen (a − r)∕b will equal\r\nq. For example,
"}︡ ︠9adf51ed-99d6-4d82-b76c-4341dae9c7a8︠ r = 14 % 3 q = (14 - r)/3 r, q ︡c85954ca-0811-4975-acb3-f4e492920c65︡{"stdout": "(2, 4)"}︡ ︠f1b3e220-6a42-46b1-8252-8c4316712df7i︠ %htmlwill return 2 for the value of r, and 4 for the value of q. Note that the “/” is integer division, where any remainder is cast away and the result is always an integer. So, for example, 14/3 will again equal 4, not 4.66666.
The greatest common divisor of a and b is obtained with the command gcd(a,b), where in our first uses, a and b are integers. Later, a and b can be other objects with a notion of divisibility and “greatness,” such as polynomials. For example,
︡e3d9b7df-445a-4103-a20f-6ce0c6b94e84︡{"html": "will return 2 for the value of r, and 4 for the value of q. Note that the “/” is integer division, where\r\nany remainder is cast away and the result is always an integer. So, for example, 14/3 will again equal 4,\r\nnot 4.66666.\r\n
\r\nThe greatest common divisor of a\r\nand b\r\nis obtained with the command gcd(a,b), where in our first uses,\r\na and\r\nb are integers.\r\nLater, a\r\nand b\r\ncan be other objects with a notion of divisibility and “greatness,” such as polynomials. For example,
"}︡ ︠4ca6e6e3-eecc-424f-910d-d5d0f3d7704f︠ gcd(2776, 2452) ︡9f9dd197-bad5-4fbf-8d15-6023402e067e︡{"stdout": "4"}︡ ︠89346c35-d952-42b8-977f-34d6142942cbi︠ %htmlwill return 4.
The command xgcd(a,b) (“eXtended GCD”) returns a triple where the first element is the greatest common divisor of a and b (as with the gcd(a,b) command above), but the next two elements are the values of r and s such that ra + sb =\mathop{ gcd}(a,b). For example, xgcd(633,331) returns (1, 194, -371). Portions of the triple can be extracted using [ ] to access the entries of the triple, starting with the first as number 0. For example, the following should return the result True (even if you change the values of a and b). Studying this block of code will go a long way towards helping you get the most out of SAGE’s output. (Note that “=” is how a value is assigned to a variable, while as in the last line, “==” is how we determine equality of two items.)
︡f15400fa-4b94-43be-9184-292f115b8509︡{"html": "will return 4.\r\n
\r\nThe command xgcd(a,b) (“eXtended GCD”) returns a triple where the first element is the greatest common\r\ndivisor of a\r\nand b\r\n(as with the gcd(a,b) command above), but the next two elements are the values of\r\nr and\r\ns such\r\nthat ra + sb =\\mathop{ gcd}(a,b).\r\nFor example, xgcd(633,331) returns (1, 194, -371). Portions of the triple can be extracted using [ ] to\r\naccess the entries of the triple, starting with the first as number 0. For example, the following should\r\nreturn the result True (even if you change the values of a and b). Studying this block of code will go a long\r\nway towards helping you get the most out of SAGE’s output. (Note that “=” is how a value is\r\nassigned to a variable, while as in the last line, “==” is how we determine equality of two items.)
"}︡ ︠ed0d1480-1d51-4047-a79c-5849b76622ed︠ a = 633 b = 331 extended = xgcd(a, b) g = extended[0] r = extended[1] s = extended[2] g == r*a + s*b ︡2000bd85-2f55-4651-aa7a-c3ccae4d3043︡{"stdout": "True"}︡ ︠ebb4d4d3-c97b-4e5b-b573-fed21a4f233fi︠ %html
A remainder of zero indicates divisibility. So (a % b) == 0 will return True if b divides a, and will otherwise return False. For example, (9 % 3) == 0 is True, but (9 % 4) == 0 is False. Try predicting the output of the following before executing it in SAGE.
︡6df9eb44-5b6b-43b1-b17c-3110729db980︡{"html": "\r\n
\r\nA remainder of zero indicates divisibility. So (a % b) == 0 will return True if\r\nb divides\r\na,\r\nand will otherwise return False. For example, (9 % 3) == 0 is True, but (9 % 4) == 0\r\nis False. Try predicting the output of the following before executing it in SAGE.
"}︡ ︠998a82ec-c732-4c74-b598-1b5dd4cec711︠ answer1 = ((20 % 5) == 0) answer2 = ((17 % 4) == 0) answer1, answer2 ︡5cc1186f-14da-427a-945f-fffb42f070e7︡{"stdout": "(True, False)"}︡ ︠05611521-154b-400e-8625-e1b9493889bdi︠ %html
As promised by the Fundamental Theorem of Arithmetic, factor(a) will return a unique expression for a as a product of powers of primes. It will print in a nicely-readable form, but can also be manipulated with Python as a list of pairs ({p}_{i},{e}_{i}) containing primes as bases, and their associated exponents. For example,
︡bc424f7b-c4ea-4bfa-8be8-51a92fdee5a3︡{"html": "\r\n
\r\nAs promised by the Fundamental Theorem of Arithmetic, factor(a) will return a unique expression for\r\na as a product\r\nof powers of primes. It will print in a nicely-readable form, but can also be manipulated with Python as a list\r\nof pairs ({p}_{i},{e}_{i})\r\ncontaining primes as bases, and their associated exponents. For example,
"}︡ ︠d4957b33-8dfa-4d95-a559-d4ba55c990ab︠ factor(2600) ︡414fdb19-8244-402e-bf58-5a7f5cb8361f︡{"stdout": "2^3 * 5^2 * 13"}︡ ︠bb410409-201d-4e11-8276-0e99ef4b2467i︠ %htmlreturns 2^3 * 5^2 * 13. We can strip off pieces of the prime decomposition using two levels of [ ]. This is another good example to study in order to learn about how to drill down into Python lists.
︡ec1e6b0f-de77-4507-9fe6-4d065208e8f8︡{"html": "returns 2^3 * 5^2 * 13. We can strip off pieces of the prime decomposition using two levels of [ ].\r\nThis is another good example to study in order to learn about how to drill down into Python lists.
"}︡ ︠e53b944e-f3b6-4e7a-b452-e0e5635e597e︠ n = 2600 decomposition = factor(n) print n, " decomposes as ", decomposition secondterm = decomposition[1] print "Base and exponent (pair) for second prime: ", secondterm base = secondterm[0] exponent = secondterm[1] print "Base is ", base print "Exponent is ", exponent thirdbase = decomposition[2][0] thirdexponent = decomposition[2][1] print "Base of third term is ", thirdbase, " with exponent ", thirdexponent ︡42dfc4e8-4c32-4fd3-89be-a65fd6e61f57︡{"stdout": "2600 decomposes as 2^3 * 5^2 * 13\nBase and exponent (pair) for second prime: (5, 2)\nBase is 5\nExponent is 2\nBase of third term is 13 with exponent 1"}︡ ︠8419187e-8b6a-4d5e-8fb7-a8578523df43i︠ %htmlWith a bit more work, the factor() command can be used to factor more complicated items, such as polynomials.
inverse_mod(a, n) yields the multiplicative inverse of a mod n (or an error if it doesn’t exist). For example,
︡a6362091-994b-40ed-bde9-56fd7a1bdf7e︡{"html": "With a bit more work, the factor() command can be used to factor more complicated items, such as\r\npolynomials.\r\n
\r\ninverse_mod(a, n) yields the multiplicative inverse of\r\na mod\r\nn (or an error if it doesn’t exist). For example,
"}︡ ︠be47d7ec-6c63-414e-b510-752f2c4f256e︠ inverse_mod(352, 917) ︡46307695-7ce7-4c27-aa07-62e7ae12d3d0︡{"stdout": "508"}︡ ︠20460940-8639-46c2-ba3b-44059f09231fi︠ %htmlyields 508. (As a check, find the integer m such that 352*508 = m*917+1.)
Then try
︡f51b92d9-ac25-40b8-86e7-fb4a5f301f65︡{"html": "yields 508. (As a check, find the integer m\r\nsuch that 352*508 = m*917+1.)\r\n
Then try
"}︡ ︠63a1fefc-5d6a-4880-9b75-b86e6df40ae8︠ inverse_mod(4, 24) ︡ef37fc87-eeb8-4bb1-9e84-fb70e1b7ee6f︡{"stderr": "Traceback (most recent call last):\n File \"and explain the result.
power_mod(a, m, n) yields {a}^{m} mod n. For example,
︡f47af71f-9ee1-495a-bcf7-7c963e5992d2︡{"html": "and explain the result.\r\n
\r\npower_mod(a, m, n) yields {a}^{m}\r\nmod n. For example,
"}︡ ︠f805013b-338c-4370-8b08-7d3e73cbc6b3︠ power_mod(15, 831, 23) ︡c83dfe1d-0e7b-4ea0-bfd9-17c54edb66d5︡{"stdout": "10"}︡ ︠39050d1a-2189-4d18-a3eb-f577e5fcaaabi︠ %htmlreturns 10. If m = −1, then this command will duplicate the function of inverse_mod().
euler_phi(n) will return the number of positive integers less than n, and relatively prime to n (i.e. having greatest common divisor with n equal to 1). For example,
︡3faabbd3-f486-4490-91ac-494531d41694︡{"html": "returns 10. If m = −1,\r\nthen this command will duplicate the function of inverse_mod().\r\n
\r\neuler_phi(n) will return the number of positive integers less than\r\nn, and relatively prime to\r\nn (i.e. having greatest\r\ncommon divisor with n\r\nequal to 1). For example,
"}︡ ︠1c15beff-38d7-4c8d-848b-b3a1ccd34a52︠ euler_phi(345) ︡e3bcc044-2823-49aa-b6da-d109719ef31e︡{"stdout": "176"}︡ ︠84bc852e-acd6-4c67-bfd9-f6d1ddada3a7i︠ %htmlshould return 176. Experiment by running the following code several times:
︡83c7bf46-0d63-432f-a86a-f7e9625e45ca︡{"html": "should return 176.\r\nExperiment by running the following code several times:
"}︡ ︠2b41d15a-e690-4f4d-a060-73c0a173c365︠ m = random_prime(10000) n = random_prime(10000) m, n, euler_phi(m*n) == euler_phi(m)*euler_phi(n) ︡94eb5ac0-fde0-4291-a3e5-a37bd808af0e︡{"stdout": "(2221, 719, True)"}︡ ︠5752a223-a821-46e4-874c-979798dfa69ei︠ %htmlFeel a conjecture coming on? Can you generalize this result?
The command is_prime(a) returns True or False depending on if a is prime or not. For example,
︡befc742c-20c1-41cf-a517-3ca10ad90a91︡{"html": "Feel a conjecture coming on? Can you generalize this result?\r\n
\r\nThe command is_prime(a) returns True or False depending on if\r\na is prime or not. For example,
"}︡ ︠a94b644c-e9d0-44db-b507-92c48dfb99b3︠ is_prime(117371) ︡a55a55cc-073d-41b0-9b90-69892072f2b0︡{"stdout": "True"}︡ ︠a93c3f6c-ca6f-44f2-807b-843777dc05a3i︠ %htmlreturns True, while
︡404d635b-7ff4-4d75-81d6-8cef4248f21e︡{"html": "returns True, while
"}︡ ︠b38ad27a-d498-4365-8dcd-573648f9119a︠ is_prime(14547073) ︡3f4d9141-1586-457f-b638-8ee161749beb︡{"stdout": "False"}︡ ︠cb730daf-6c0f-4545-be46-56c4621477e9i︠ %htmlreturns False since 14547073 = 1597 ∗ 9109 (as you could determine with the factor() command).
The command random_prime(a,True) will return a random prime between
2 and
a.
Experiment with
returns False since 14547073 = 1597 ∗ 9109\r\n(as you could determine with the factor() command).\r\n
The command random_prime(a,True) will return a random prime between\r\n2 and\r\na.
Experiment with
(Replacing True by False will speed up the search, but there will be a very small probability the result will not be prime.)
The command prime_range(a,b) returns an ordered list of all the primes from a to b − 1, inclusive. For example,
︡50665ad3-518f-471d-8ffa-21489a47023b︡{"html": "(Replacing True by False will speed up the search, but there will be a very small probability the result\r\nwill not be prime.)\r\n
The command prime_range(a,b) returns an ordered list of all the primes from\r\na to\r\nb − 1, inclusive. For example,
"}︡ ︠54623804-e0fd-4a8d-96f6-f27fd45c1a09︠ prime_range(500,550) ︡03dd28f1-42e1-47c2-86de-e81934f45ef9︡{"stdout": "[503, 509, 521, 523, 541, 547]"}︡ ︠4c7a9fb4-f1e7-451d-a1a6-1da6efe25d04i︠ %htmlreturns [503, 509, 521, 523, 541, 547].
The commands next_prime(a) and previous_prime(a) are other ways to get a single prime number of a desired size. Give ’em a try.
A good portion of SAGE’s support for group theory is based on routines from GAP (Groups, Algorithms, and Programming at http://www.gap-system.org/). Groups can be described in many different ways, such as sets of matrices or sets of symbols subject to a few defining relations. A very concrete way to represent groups is via permutations (one-to-one and onto functions of the integers 1 through n), using function composition as the operation in the group. SAGE has many routines designed to work with groups of this type and they are also a good way for those learning group theory to gain experience with the basic ideas of group theory. For both these reasons, we will concentrate on these types of groups.
SAGE uses “disjoint cycle notation” for permutations, see any introductory text on group theory (such as Judson, Section 4.1) for more on this. Composition occurs left to right, which is not what you might expect and is exactly the reverse of what Judson and many others use. (There are good reasons to support either direction, you just need to be certain you know which one is in play.) There are two ways to write the permutation σ = (1\kern 1.95872pt 3)(2\kern 1.95872pt 5\kern 1.95872pt 4),
SAGE knows many popular groups as sets of permutations. More are listed below, but for starters, the full “symmetric group” of all possible permutations of 1 through n can be built with the command SymmetricGroup(n).
Permutation Elements Elements of a group can be created, and composed, as follows
︡0008afac-c03c-487e-b429-d17baa305d6e︡{"html": "returns [503, 509, 521, 523, 541, 547].\r\n
The commands next_prime(a) and previous_prime(a) are other ways to get a single prime number\r\nof a desired size. Give ’em a try.\r\n
\r\nA good portion of SAGE’s support for group theory is based on routines from GAP (Groups, Algorithms,\r\nand Programming at http://www.gap-system.org/). Groups can be described in many different ways,\r\nsuch as sets of matrices or sets of symbols subject to a few defining relations. A very concrete\r\nway to represent groups is via permutations (one-to-one and onto functions of the integers\r\n1 through\r\nn), using\r\nfunction composition as the operation in the group. SAGE has many routines designed to work with\r\ngroups of this type and they are also a good way for those learning group theory to gain experience with\r\nthe basic ideas of group theory. For both these reasons, we will concentrate on these types of\r\ngroups.\r\n
\r\nSAGE uses “disjoint cycle notation” for permutations, see any introductory text on group theory (such as\r\nJudson, Section 4.1) for more on this. Composition occurs left to right, which is not what you might expect\r\nand is exactly the reverse of what Judson and many others use. (There are good reasons to support either\r\ndirection, you just need to be certain you know which one is in play.) There are two ways to write the\r\npermutation σ = (1\\kern 1.95872pt 3)(2\\kern 1.95872pt 5\\kern 1.95872pt 4),\r\n
\r\n
\r\nSAGE knows many popular groups as sets of permutations. More are listed\r\nbelow, but for starters, the full “symmetric group” of all possible permutations of\r\n1 through\r\nn can be\r\nbuilt with the command SymmetricGroup(n).\r\n
\r\nPermutation Elements\r\n Elements of a group can be created, and composed, as follows
"}︡ ︠6dcd455d-8769-4d35-96c4-e8a23d40c484︠ G = SymmetricGroup(5) sigma = G("(1,3)(2,5,4)") rho = G([(1,4), (1,5)]) rho^-1*sigma*rho ︡ca28195e-d100-4ad7-86e5-5b980169e5f6︡{"stderr": "Traceback (most recent call last):\n File \"Available functions for elements of a permutation group include finding the order of an element, i.e. for a permutation σ the order is the smallest power of k such that {σ}^{k} equals the identity element (). For example,
︡bdb0231d-74d0-4e38-aba5-e40f885798dd︡{"html": "Available functions for elements of a permutation group include finding the order of an element, i.e. for a permutation\r\nσ the order is the smallest\r\npower of k such that\r\n{σ}^{k} equals the identity\r\nelement (). For example,
"}︡ ︠561f0854-db18-416f-bb15-dd155085f45e︠ sigma = G("(1,3)(2,5,4)") sigma.order() ︡c3d37d3d-c2f3-4f04-8f36-c6b61eca07dd︡{"stdout": "6"}︡ ︠c2ba1656-0311-4d1e-8fda-1178e67a3c56i︠ %htmlwill return 6.
The sign of the permutation σ is defined to be 1 for an even permutation and − 1 for an odd permutation. For example,
︡8fb3fd68-5328-44ba-bdf9-def21d505cb4︡{"html": "will return 6.\r\n
The sign of the permutation σ is defined\r\nto be 1 for an even permutation and\r\n − 1 for an odd permutation. For example,
"}︡ ︠5173074b-8b5e-4cac-89e9-bad734025543︠ sigma = G("(1,3)(2,5,4)") sigma.sign() ︡81ad1ece-0990-4ac7-ac06-dc21f1947fa1︡{"stdout": "-1"}︡ ︠36a7147c-5f3e-4982-a770-226c7c4896edi︠ %htmlwill return − 1 since σ is an odd permutation.
Many more available functions that can be applied to a permutation can be found via “tab-completion.” With sigma defined as an element of a permutation group, in a SAGE cell, type sigma. (Note the “.”) and then press the tab key. You’ll get a list of available functions (you may need to scroll down to see the whole list). Experiment and explore! It’s what SAGE is all about. You really can’t break anything.
This is an annotated list of some small well-known permutation groups that can be created simply in
SAGE.
(You can find more in the source code file
/sage/devel/sage/sage/groups/perm_gps/permgroup_named.py)
SymmetricGroup(n): All n!
permutations on n
symbols.
DihedralGroup(n): Symmetries of an n-gon.
Rotations and flips, 2n
in total.
CyclicPermutationGroup(n): Rotations of an
n-gon (no
flips), n
in total.
AlternatingGroup(n): Alternating group on n
symbols having n!∕2
elements.
KleinFourGroup(): The non-cyclic group of order 4.
Individual elements of permutation groups are important, but we primarily wish to study groups as objects on their own. So a wide-variety of computations are available for groups. Define a group, for example
︡8e0eb895-8c66-4878-bea2-9bdbc12bcce4︡{"html": "will return − 1\r\nsince σ is\r\nan odd permutation.\r\n
Many more available functions that can be applied to a permutation can be found via\r\n“tab-completion.” With sigma defined as an element of a permutation group, in a SAGE cell, type sigma.\r\n(Note the “.”) and then press the tab key. You’ll get a list of available functions (you may need to scroll\r\ndown to see the whole list). Experiment and explore! It’s what SAGE is all about. You really can’t break\r\nanything.\r\n
\r\nThis is an annotated list of some small well-known permutation groups that can be created simply in\r\nSAGE.
(You can find more in the source code file
/sage/devel/sage/sage/groups/perm_gps/permgroup_named.py)\r\n
SymmetricGroup(n): All n!\r\npermutations on n\r\nsymbols.
DihedralGroup(n): Symmetries of an n-gon.\r\nRotations and flips, 2n\r\nin total.
CyclicPermutationGroup(n): Rotations of an\r\nn-gon (no\r\nflips), n\r\nin total.
AlternatingGroup(n): Alternating group on n\r\nsymbols having n!∕2\r\nelements.
KleinFourGroup(): The non-cyclic group of order 4.\r\n\r\n
Individual elements of permutation groups are important, but we primarily wish to study groups as objects on\r\ntheir own. So a wide-variety of computations are available for groups. Define a group, for example
"}︡ ︠5eb95de8-f2eb-4be6-81df-904753f05ffb︠ H = DihedralGroup(6) ︡4bed3eab-ff54-4fab-a080-f42210095565︡︡ ︠19d9613e-56cc-4efb-b58b-49623924bec6i︠ %htmland then a variety of functions become available.
After trying the examples below, experiment with tab-completion. Having defined H, type H. (note the “.”) and then press the tab key. You’ll get a list of available functions (you may need to scroll down to see the whole list). As before, experiment and explore — its really hard to break anything.
Here’s another couple of ways to experiment and explore. Find a function that looks interesting, say is_abelian(). Type H.is_abelian( (note there is just an opening parenthesis), followed by the tab key. This will display a portion of the source code for the is_abelian() function, describing the inputs and output, possibly illustrated with example uses.
If you want to learn more about how SAGE works, or possibly extend its functionality, then you can start by examining the complete Python source code. For example, try H.is_abelian??, which will allow you to determine that the is_abelian() function is basically riding on GAP’s IsAbelian() command and asking GAP do the heavy-lifting for us. (To get the maximum advantage of using SAGE it helps to know some basic Python programming, but it is not required.)
OK, on to some popular command for groups. If you are using the worksheet, be sure you have defined the group H as the dihedral group {D}_{6}, since we won’t keep repeating its definition below.
The command
︡673b3107-79f8-4f85-8ebb-40e0f0522736︡{"html": "and then a variety of functions become available.\r\n
After trying the examples below, experiment with tab-completion. Having defined H, type H. (note the\r\n“.”) and then press the tab key. You’ll get a list of available functions (you may need to scroll\r\ndown to see the whole list). As before, experiment and explore — its really hard to break\r\nanything.\r\n
Here’s another couple of ways to experiment and explore. Find a function that looks interesting, say\r\nis_abelian(). Type H.is_abelian( (note there is just an opening parenthesis), followed by the tab key.\r\nThis will display a portion of the source code for the is_abelian() function, describing the inputs and\r\noutput, possibly illustrated with example uses.\r\n
If you want to learn more about how SAGE works, or possibly extend its functionality, then you\r\ncan start by examining the complete Python source code. For example, try H.is_abelian??,\r\nwhich will allow you to determine that the is_abelian() function is basically riding on GAP’s\r\nIsAbelian() command and asking GAP do the heavy-lifting for us. (To get the maximum\r\nadvantage of using SAGE it helps to know some basic Python programming, but it is not\r\nrequired.)\r\n
OK, on to some popular command for groups. If you are using the worksheet, be sure you have defined the\r\ngroup H as the\r\ndihedral group {D}_{6},\r\nsince we won’t keep repeating its definition below.\r\n
\r\nThe command
"}︡ ︠7e743215-d9dc-4b29-8ba2-69aef80f19dd︠ H.is_abelian() ︡65ae1a0f-0826-4c27-aba4-917b8dd42116︡{"stdout": "False"}︡ ︠18e24a89-ed98-46a2-a5c6-17210c9af137i︠ %htmlwill return False since {D}_{6} is a non-abelian group.
The command
︡f8bec08d-107f-432c-83d8-3856e806a974︡{"html": "will return False since {D}_{6}\r\nis a non-abelian group.\r\n
\r\nThe command
"}︡ ︠afcce3c4-77e3-49bc-927f-94e67ec7720f︠ H.order() ︡80cf2467-da07-411d-9b3b-0e6db26752b4︡{"stdout": "12"}︡ ︠1d9e6fe3-d62d-40c2-82f7-cb0a8c06100ei︠ %htmlwill return 12 since {D}_{6} is a group of with 12 elements.
The command
︡63248a20-a4e6-43e5-af11-b330e5744ff9︡{"html": "will return 12 since {D}_{6}\r\nis a group of with 12\r\nelements.\r\n
\r\nThe command
"}︡ ︠bcdba843-6906-47b0-af83-fc8f63eaefed︠ H.list() ︡d4407571-3eb9-4203-a0e2-6e2cb35cb39e︡{"stdout": "[(), (2,6)(3,5), (1,2)(3,6)(4,5), (1,2,3,4,5,6), (1,3)(4,6), (1,3,5)(2,4,6), (1,4)(2,3)(5,6), (1,4)(2,5)(3,6), (1,5)(2,4), (1,5,3)(2,6,4), (1,6,5,4,3,2), (1,6)(2,5)(3,4)]"}︡ ︠0652246f-b7b5-491d-84fb-beb946f7f4eei︠ %htmlwill return all of the elements of H in a fixed order as a Python list. Indexing ([ ]) can be used to extract the individual elements of the list, remembering that counting the elements of the list begins at zero.
︡fa7d88e5-b5a5-4dd2-8204-fbfe019937c8︡{"html": "will return all of the elements of H\r\nin a fixed order as a Python list. Indexing ([ ]) can be used to extract the individual\r\nelements of the list, remembering that counting the elements of the list begins at zero.
"}︡ ︠d29795ef-9490-4ab7-adef-1d9fd0df0060︠ elements = H.list() elements[3] ︡0d25e80f-3698-4a87-8786-5219a2529813︡{"stdout": "(1,2,3,4,5,6)"}︡ ︠7b5c7134-4909-4411-97ce-e0ee72c923b1i︠ %html
The command
︡bdb4c01f-f493-4694-9a93-69654f04dbec︡{"html": "\r\n
\r\nThe command
"}︡ ︠28a1c669-14a8-40b4-b8e7-07e1a00eeb35︠ H.cayley_table() ︡43195e63-9772-4b57-a227-30f68c6a8dc7︡{"stdout": "[ x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11]\n[ x1 x0 x3 x2 x5 x4 x7 x6 x9 x8 x11 x10]\n[ x2 x10 x0 x4 x3 x6 x5 x8 x7 x11 x1 x9]\n[ x3 x11 x1 x5 x2 x7 x4 x9 x6 x10 x0 x8]\n[ x4 x9 x10 x6 x0 x8 x3 x11 x5 x1 x2 x7]\n[ x5 x8 x11 x7 x1 x9 x2 x10 x4 x0 x3 x6]\n[ x6 x7 x9 x8 x10 x11 x0 x1 x3 x2 x4 x5]\n[ x7 x6 x8 x9 x11 x10 x1 x0 x2 x3 x5 x4]\n[ x8 x5 x7 x11 x9 x1 x10 x2 x0 x4 x6 x3]\n[ x9 x4 x6 x10 x8 x0 x11 x3 x1 x5 x7 x2]\n[x10 x2 x4 x0 x6 x3 x8 x5 x11 x7 x9 x1]\n[x11 x3 x5 x1 x7 x2 x9 x4 x10 x6 x8 x0]"}︡ ︠0c79587c-dd56-4e45-bbec-cdceca634548i︠ %htmlwill construct the Cayley table (or “multiplication table”) of H. The display uses the elements of the group in the same order as the list() command, and denoting them as xN where N is an integer. For example to determine the element in the table named x4,
︡6264f477-498e-420a-bb70-e593ffd62003︡{"html": "will construct the Cayley table (or “multiplication table”) of\r\nH. The\r\ndisplay uses the elements of the group in the same order as the list() command, and denoting them as xN\r\nwhere N\r\nis an integer. For example to determine the element in the table named x4,
"}︡ ︠9279c457-dd24-4c53-be81-60af786bafae︠ H.list()[4] ︡61f507df-7d8d-4e0a-8c0c-7203c5455904︡{"stdout": "(1,3)(4,6)"}︡ ︠873300a8-c832-49ed-8acd-7fc0df761953i︠ %html
The command H.center() will return a subgroup that is the center of the group H (see Exercise 2.46 in Judson). Try
︡065ba5e5-93d4-4b15-96af-0697ffeac588︡{"html": "\r\n
\r\nThe command H.center() will return a subgroup that is the center of the group\r\nH (see Exercise 2.46 in Judson). Try
"}︡ ︠a01c3f94-23c0-44dd-a2b0-4a864aeae0ab︠ H.center().list() ︡280767c1-68db-4ca1-8d74-a28acc1bb115︡{"stdout": "[(), (1,4)(2,5)(3,6)]"}︡ ︠cea27475-e34d-43f2-bbe9-c550e486bb87i︠ %htmlto see which elements of H commute with every element of H.
For fun, try show(H.cayley_graph()).
If G is a group, and a is an element of the group (try a=G.random_element()), then
︡8e572214-2aad-442f-817b-63154ac4bacc︡{"html": "to see which elements of H\r\ncommute with every element of H.\r\n
\r\n
\r\nFor fun, try show(H.cayley_graph()).\r\n
\r\n\r\n
\r\nIf G is a group, and a is an element of the group (try a=G.random_element()), then
"}︡ ︠db311716-b23b-4479-adfe-f7c5ca05f2f3︠ a=G.random_element() H=G.subgroup([a]) ︡bb6ffd10-a2a4-4b04-b21b-9e47e98db056︡︡ ︠a2eb012a-7f76-402e-87d5-b5e30147309ai︠ %htmlwill create H as the cyclic subgroup of G with generator a.
For example the code below will (1) create G as the symmetric group on five symbols, (2) specify sigma as an element of G, (3) use sigma as the generator of a cyclic subgroup H, (4) list all the elements of H. In more mathematical notation, we might write \langle (1\kern 1.95872pt 2\kern 1.95872pt 3)(4\kern 1.95872pt 5)\rangle = H ⊆ G = {S}_{5}.
︡82b7bc7e-3332-431b-8a26-48cf35b47473︡{"html": "will create H as the cyclic subgroup of G with generator a.\r\n
For example the code below will (1) create G as the symmetric group on five symbols,\r\n(2) specify sigma as an element of G, (3) use sigma as the generator of a cyclic subgroup\r\nH, (4) list all the elements of H. In more mathematical notation, we might write\r\n\\langle (1\\kern 1.95872pt 2\\kern 1.95872pt 3)(4\\kern 1.95872pt 5)\\rangle = H ⊆ G = {S}_{5}.
"}︡ ︠bfc93d12-31d8-48b8-b948-68ed8d64d9af︠ G=SymmetricGroup(5) sigma=G("(1,2,3)(4,5)") H=G.subgroup([sigma]) H.list() ︡5efd8e2f-86d4-4f94-826f-b24c0a14efee︡{"stdout": "[(), (4,5), (1,2,3), (1,2,3)(4,5), (1,3,2), (1,3,2)(4,5)]"}︡ ︠427c3fab-534a-4fc3-a64e-8a9090a77448i︠ %htmlExperiment by trying different permutations for sigma and observing the effect on H.
Groups that are cyclic themselves are both important, and rich in structure. The command CyclicPermutationGroup(n) will create a permutation group that is cyclic with n elements. Consider the following example (note that the indentation of the third line is critical) which will list the elements of a cyclic group of order 20, preceded by the order of each element.
︡7fadf4fe-326b-4216-885e-53063b12a7b0︡{"html": "Experiment by trying different permutations for sigma and observing the effect on H.\r\n
\r\nGroups that are cyclic themselves are both important, and rich in structure. The command\r\nCyclicPermutationGroup(n) will create a permutation group that is cyclic with n elements.\r\nConsider the following example (note that the indentation of the third line is critical) which\r\nwill list the elements of a cyclic group of order 20, preceded by the order of each element.
"}︡ ︠2e832394-0c08-4e4c-a36c-05427531efe0︠ n=20 CN = CyclicPermutationGroup(n) for g in CN: print g.order(), " ", g ︡cb0f41f7-47d7-4d49-a50d-55f06eacbd67︡{"stdout": "1 ()\n20 (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)\n10 (1,3,5,7,9,11,13,15,17,19)(2,4,6,8,10,12,14,16,18,20)\n20 (1,4,7,10,13,16,19,2,5,8,11,14,17,20,3,6,9,12,15,18)\n5 (1,5,9,13,17)(2,6,10,14,18)(3,7,11,15,19)(4,8,12,16,20)\n4 (1,6,11,16)(2,7,12,17)(3,8,13,18)(4,9,14,19)(5,10,15,20)\n10 (1,7,13,19,5,11,17,3,9,15)(2,8,14,20,6,12,18,4,10,16)\n20 (1,8,15,2,9,16,3,10,17,4,11,18,5,12,19,6,13,20,7,14)\n5 (1,9,17,5,13)(2,10,18,6,14)(3,11,19,7,15)(4,12,20,8,16)\n20 (1,10,19,8,17,6,15,4,13,2,11,20,9,18,7,16,5,14,3,12)\n2 (1,11)(2,12)(3,13)(4,14)(5,15)(6,16)(7,17)(8,18)(9,19)(10,20)\n20 (1,12,3,14,5,16,7,18,9,20,11,2,13,4,15,6,17,8,19,10)\n5 (1,13,5,17,9)(2,14,6,18,10)(3,15,7,19,11)(4,16,8,20,12)\n20 (1,14,7,20,13,6,19,12,5,18,11,4,17,10,3,16,9,2,15,8)\n10 (1,15,9,3,17,11,5,19,13,7)(2,16,10,4,18,12,6,20,14,8)\n4 (1,16,11,6)(2,17,12,7)(3,18,13,8)(4,19,14,9)(5,20,15,10)\n5 (1,17,13,9,5)(2,18,14,10,6)(3,19,15,11,7)(4,20,16,12,8)\n20 (1,18,15,12,9,6,3,20,17,14,11,8,5,2,19,16,13,10,7,4)\n10 (1,19,17,15,13,11,9,7,5,3)(2,20,18,16,14,12,10,8,6,4)\n20 (1,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2)"}︡ ︠7f367a93-7fc0-41a9-9787-7970c6a3bbbbi︠ %htmlBy varying the size of the group (change the value of n) you can begin to illustrate some of the structure of a cyclic group (for example, try a prime).
We can cut/paste an element of order 5 from the output above (in the case when the cyclic group has 20 elements) and quickly build a subgroup,
︡3c2e85dc-8c7b-43be-b790-58ee04028bf0︡{"html": "By varying the size of the group (change the value of n) you can begin to illustrate some of the\r\nstructure of a cyclic group (for example, try a prime).\r\n
We can cut/paste an element of order 5 from the output above (in the\r\ncase when the cyclic group has 20 elements) and quickly build a subgroup,
"}︡ ︠9b4c91d9-3cb1-4e5c-ad78-b237c70f153e︠ rho = C20("(1,17,13,9,5)(2,18,14,10,6)(3,19,15,11,7)(4,20,16,12,8)") H = C20.subgroup([rho]) H.list() ︡be55580b-18e1-4ff7-a980-8287586c7053︡{"stderr": "Traceback (most recent call last): H.list()\nNameError: name 'C20' is not defined"}︡ ︠44ca9d98-68ea-4e8f-83d5-8f06b7af6c33i︠ %htmlFor a cyclic group, the following command will list all of the subgroups.
︡516007da-c6b8-404e-8cc9-dbe78d589055︡{"html": "For a cyclic group, the following command will list all of the subgroups.
"}︡ ︠5f87701c-f231-46fb-86cc-288a0b738252︠ C20.conjugacy_classes_subgroups() ︡92265337-3de9-4061-946e-e241e408120e︡{"stderr": "Traceback (most recent call last):\n File \"Be careful, this command uses some more advanced ideas, and will not usually list all of the subgroups of a group — here we are relying on special properties of cyclic groups (but see the next section).
If H is a subgroup of G and g ∈ G, then gH{g}^{−1} = \{gh{g}^{−1}\mathrel{∣}h ∈ G\} will also be a subgroup of G. If G is a group, then the command G.conjugacy_classes_subgroups() will return a list of subgroups of G, but not all of the subgroups. However, every subgroup can be constructed from one on the list by the gH{g}^{−1} construction with a suitable g. As an illustration, the code below (1) creates K as the dihedral group of order 24, {D}_{12}, (2) stores the list of subgroups output by K.conjugacy_classes_subgroups() in the variable sg, (3) prints the elements of the list, (4) selects the second subgroup in the list, and lists its elements.
︡b5d9edba-202f-48e7-893b-fe8fe6592afb︡{"html": "Be careful, this command uses some more advanced ideas, and will not usually list all of the\r\nsubgroups of a group — here we are relying on special properties of cyclic groups (but see the next\r\nsection).\r\n
\r\nIf H is a\r\nsubgroup of G\r\nand g ∈ G, then\r\ngH{g}^{−1} = \\{gh{g}^{−1}\\mathrel{∣}h ∈ G\\} will also be a\r\nsubgroup of G.\r\nIf G is a group, then the command G.conjugacy_classes_subgroups() will return a list of subgroups of\r\nG, but not all of the subgroups. However, every subgroup can be constructed from one on the list by the\r\ngH{g}^{−1} construction\r\nwith a suitable g.\r\nAs an illustration, the code below (1) creates K as the dihedral group of order 24,\r\n{D}_{12}, (2)\r\nstores the list of subgroups output by K.conjugacy_classes_subgroups() in the variable sg, (3) prints\r\nthe elements of the list, (4) selects the second subgroup in the list, and lists its elements.
"}︡ ︠e1ea6f26-27d2-476d-8f49-22a7a4ffdbc1︠ K=DihedralGroup(12) sg = K.conjugacy_classes_subgroups() print "sg:\n", sg print "\nAn order two subgroup:\n", sg[1].list() ︡69cbe8e8-847c-4c8d-b035-eec284be9829︡{"stdout": "sg:\n[Permutation Group with generators [()], Permutation Group with generators [(1,2)(3,12)(4,11)(5,10)(6,9)(7,8)], Permutation Group with generators [(1,7)(2,8)(3,9)(4,10)(5,11)(6,12)], Permutation Group with generators [(2,12)(3,11)(4,10)(5,9)(6,8)], Permutation Group with generators [(1,5,9)(2,6,10)(3,7,11)(4,8,12)], Permutation Group with generators [(2,12)(3,11)(4,10)(5,9)(6,8), (1,7)(2,8)(3,9)(4,10)(5,11)(6,12)], Permutation Group with generators [(1,2)(3,12)(4,11)(5,10)(6,9)(7,8), (1,7)(2,8)(3,9)(4,10)(5,11)(6,12)], Permutation Group with generators [(1,10,7,4)(2,11,8,5)(3,12,9,6)], Permutation Group with generators [(1,5,9)(2,6,10)(3,7,11)(4,8,12), (1,3,5,7,9,11)(2,4,6,8,10,12)], Permutation Group with generators [(1,5,9)(2,6,10)(3,7,11)(4,8,12), (1,2)(3,12)(4,11)(5,10)(6,9)(7,8)], Permutation Group with generators [(1,5,9)(2,6,10)(3,7,11)(4,8,12), (2,12)(3,11)(4,10)(5,9)(6,8)], Permutation Group with generators [(2,12)(3,11)(4,10)(5,9)(6,8), (1,10,7,4)(2,11,8,5)(3,12,9,6)], Permutation Group with generators [(1,5,9)(2,6,10)(3,7,11)(4,8,12), (1,3,5,7,9,11)(2,4,6,8,10,12), (2,12)(3,11)(4,10)(5,9)(6,8)], Permutation Group with generators [(1,5,9)(2,6,10)(3,7,11)(4,8,12), (1,3,5,7,9,11)(2,4,6,8,10,12), (1,2)(3,12)(4,11)(5,10)(6,9)(7,8)], Permutation Group with generators [(1,5,9)(2,6,10)(3,7,11)(4,8,12), (1,3,5,7,9,11)(2,4,6,8,10,12), (1,2,3,4,5,6,7,8,9,10,11,12)], Permutation Group with generators [(1,5,9)(2,6,10)(3,7,11)(4,8,12), (1,3,5,7,9,11)(2,4,6,8,10,12), (2,12)(3,11)(4,10)(5,9)(6,8), (1,2,3,4,5,6,7,8,9,10,11,12)]]\n\nAn order two subgroup:\n[(), (1,2)(3,12)(4,11)(5,10)(6,9)(7,8)]"}︡ ︠5afdc266-0341-47b5-a862-93a329a8f9e9i︠ %htmlIt is important to note that this is a nice long list of subgroups, but will rarely create every such subgroup. For example, the code below (1) creates rho as an element of the group K, (2) creates L as a cyclic subgroup of K, (3) prints the two elements of L, and finally (4) tests to see if this subgroup is part of the output of the list sg created just above (it is not).
︡10b4277e-c2fb-41d5-9d72-7ed43ba274c4︡{"html": "It is important to note that this is a nice long list of subgroups, but will rarely create\r\nevery such subgroup. For example, the code below (1) creates rho as an element of the group\r\nK, (2) creates L as a cyclic subgroup of K, (3) prints the two elements of L, and finally (4)\r\ntests to see if this subgroup is part of the output of the list sg created just above (it is not).
"}︡ ︠91d4f689-fc65-4f77-9ae7-cb9781adee0b︠ rho = K("(1,4)(2,3)(5,12)(6,11)(7,10)(8,9)") L=PermutationGroup([rho]) print L.list() print L in sg ︡78545b37-aaa1-45fe-8412-316930003528︡{"stdout": "[(), (1,4)(2,3)(5,12)(6,11)(7,10)(8,9)]\nFalse"}︡ ︠1628d8a3-229d-4450-ae39-fa82b44567dfi︠ %html
You can give SAGE a short list of elements of a permutation group and SAGE will find the smallest subgroup that contains those elements. We say the list “generates” the subgroup. We list a few interesting subgroups you can create this way.
Label the vertices of an equilateral triangle as 1, 2 and 3. Then any permutation of the vertices will be a symmetry of the triangle. So either SymmetricGroup(3) or DihedralGroup(3) will create the full symmetry group.
A regular, n-sided figure in the plane (an n-gon) will have 2n symmetries, comprised of n rotations (including the trivial one) and n “flips” about various axes. The dihedral group DihedralGroup(n) is frequently defined as exactly the symmetry group of an n-gon.
Label the 4 vertices of a regular tetahedron as 1, 2, 3 and 4. Fix the vertex labeled 4 and roate the opposite face through 120 degrees. This will create the permutation/symmetry (1\kern 1.95872pt 2\kern 1.95872pt 3). Similarly, fixing vertex 1, and rotating the opposite face will create the permutation (2\kern 1.95872pt 3\kern 1.95872pt 4). These two permutations are enough to generate the full group of the twelve symmetries of the tetrahedron. Another symmetry can be visualized by running an axis through the midpoint of an edge of the tetrahedron through to the midpoint of the opposite edge, and then rotating by 180 degrees about this axis. For example, the 1–2 edge is opposite the 3–4 edge, and the symmetry is described by the permutation (1\kern 1.95872pt 2)(3\kern 1.95872pt 4). This permutation, along with either of the above permutations will also generate the group. So here are two ways to create this group,
︡f4d23226-71cc-4d09-a9f5-f6989167a455︡{"html": "\r\n
\r\nYou can give SAGE a short list of elements of a permutation group and SAGE will find the smallest\r\nsubgroup that contains those elements. We say the list “generates” the subgroup. We list a few interesting\r\nsubgroups you can create this way.\r\n
\r\nLabel the vertices of an equilateral triangle as 1, 2 and 3. Then any permutation of the vertices will be a\r\nsymmetry of the triangle. So either SymmetricGroup(3) or DihedralGroup(3) will create the full\r\nsymmetry group.\r\n
\r\nA regular, n-sided figure in\r\nthe plane (an n-gon) will have\r\n2n symmetries, comprised\r\nof n rotations (including\r\nthe trivial one) and n\r\n“flips” about various axes. The dihedral group DihedralGroup(n) is frequently defined as exactly the symmetry\r\ngroup of an n-gon.\r\n
\r\nLabel the 4 vertices of a regular tetahedron as 1, 2, 3 and 4. Fix the vertex labeled 4 and\r\nroate the opposite face through 120 degrees. This will create the permutation/symmetry\r\n(1\\kern 1.95872pt 2\\kern 1.95872pt 3).\r\nSimilarly, fixing vertex 1, and rotating the opposite face will create the permutation\r\n(2\\kern 1.95872pt 3\\kern 1.95872pt 4). These two\r\npermutations are enough to generate the full group of the twelve symmetries of the tetrahedron. Another\r\nsymmetry can be visualized by running an axis through the midpoint of an edge of the tetrahedron\r\nthrough to the midpoint of the opposite edge, and then rotating by 180 degrees about this axis. For\r\nexample, the 1–2 edge is opposite the 3–4 edge, and the symmetry is described by the permutation\r\n(1\\kern 1.95872pt 2)(3\\kern 1.95872pt 4). This permutation,\r\nalong with either of the above permutations will also generate the group. So here are two ways to create this group,
"}︡ ︠a35c6d15-424f-41ed-8b23-ac2ebec2435c︠ tetra_one = PermutationGroup(["(1,2,3)", "(2,3,4)"]) tetra_two = PermutationGroup(["(1,2,3)", "(1,2)(3,4)"]) ︡7c6a9b0d-07d7-4d2a-87c7-230f2dd25cd0︡︡ ︠4da7b46e-0e17-4982-a6cb-255f57ef61e1i︠ %htmlThis group has a variety of interesting properties, so it is worth experimenting with. You may also know it as the “alternating group on 4 symbols,” which SAGE will create with the command AlternatingGroup(4).
Label vertices of one face of a cube with 1, 2, 3 and 4, and on the opposite face label the vertices 5, 6, 7 and 8 (5 opposite 1, 6 opposite 2, etc.). Consider three axes that run from the center of a face to the center of the opposite face, and consider a quarter-turn rotation about each axis. These three rotations will construct the entire symmetry group. Use
︡72585d3c-dcbd-4c43-9851-b905fe92cfc4︡{"html": "This group has a variety of interesting properties, so it is worth experimenting with. You may also\r\nknow it as the “alternating group on 4 symbols,” which SAGE will create with the command\r\nAlternatingGroup(4).\r\n
\r\nLabel vertices of one face of a cube with 1, 2, 3 and 4, and on the opposite face label the\r\nvertices 5, 6, 7 and 8 (5 opposite 1, 6 opposite 2, etc.). Consider three axes that run from\r\nthe center of a face to the center of the opposite face, and consider a quarter-turn rotation\r\nabout each axis. These three rotations will construct the entire symmetry group. Use
"}︡ ︠f8b76e71-2a6e-4440-8f9f-3be0f4db302e︠ cube = PermutationGroup(["(3,2,6,7)(4,1,5,8)", "(1,2,6,5)(4,3,7,8)", "(1,2,3,4)(5,6,7,8)"]) cube.list() ︡319cfb62-44a9-4aef-bcde-5aa1b2cc7b60︡{"stdout": "[(), (2,4,5)(3,8,6), (2,5,4)(3,6,8), (1,2)(3,5)(4,6)(7,8), (1,2,3,4)(5,6,7,8), (1,2,6,5)(3,7,8,4), (1,3,6)(4,7,5), (1,3)(2,4)(5,7)(6,8), (1,3,8)(2,7,5), (1,4,3,2)(5,8,7,6), (1,4,8,5)(2,3,7,6), (1,4)(2,8)(3,5)(6,7), (1,5,6,2)(3,4,8,7), (1,5,8,4)(2,6,7,3), (1,5)(2,8)(3,7)(4,6), (1,6,3)(4,5,7), (1,6)(2,5)(3,8)(4,7), (1,6,8)(2,7,4), (1,7)(2,3)(4,6)(5,8), (1,7)(2,6)(3,5)(4,8), (1,7)(2,8)(3,4)(5,6), (1,8,6)(2,4,7), (1,8,3)(2,5,7), (1,8)(2,7)(3,6)(4,5)]"}︡ ︠7b35e59a-37bf-43a0-bab3-e7f1f63e54cei︠ %htmlA cube has four distinct diagonals (joining opposite vertices through the center of the cube). Each symmetry of the cube will cause the diagonals to arrange differently. In this way, we can view an element of the symmetry group as a permutation of four “symbols” — the diagonals. It happens that each of the 24 permutations of the diagonals is created by exactly one symmetry of the 8 vertices of the cube. So this subgroup of {S}_{8} is “the same as” {S}_{4}. In SAGE,
︡68532a8e-a13d-4cd9-8e85-43de421c8763︡{"html": "A cube has four distinct diagonals (joining opposite vertices through the center of\r\nthe cube). Each symmetry of the cube will cause the diagonals to arrange differently.\r\nIn this way, we can view an element of the symmetry group as a permutation of four\r\n“symbols” — the diagonals. It happens that each of the 24 permutations of the diagonals\r\nis created by exactly one symmetry of the 8 vertices of the cube. So this subgroup of\r\n{S}_{8} is “the same\r\nas” {S}_{4}. In SAGE,
"}︡ ︠5ed5a7ca-3353-4d24-b4eb-259157f309c2︠ cube.is_isomorphic(SymmetricGroup(4)) ︡babacba4-d692-434d-9196-a21e4f163b33︡{"stdout": "True"}︡ ︠a7a362ed-db3f-461a-8baa-277792039fd0i︠ %htmlwill test to see if the group of symmetries of the cube are “the same as” {S}_{4} and so will return True.
Here is an another way to create the symmetries of a cube. Number the six faces of the cube as follows: 1 on top, 2 on the bottom, 3 in front, 4 on the right, 5 in back, 6 on the left. Now the same rotations as before (quarter-turns about axes through the centers of two opposite faces) can be used as generators of the symmetry group,
︡aa601be6-8c9f-4eb3-87a2-5018446f25f6︡{"html": "will test to see if the group of symmetries of the cube are “the same as”\r\n{S}_{4} and so\r\nwill return True.\r\n
Here is an another way to create the symmetries of a cube. Number the six faces of\r\nthe cube as follows: 1 on top, 2 on the bottom, 3 in front, 4 on the right, 5 in back, 6\r\non the left. Now the same rotations as before (quarter-turns about axes through the\r\ncenters of two opposite faces) can be used as generators of the symmetry group,
"}︡ ︠dedfabe0-ab58-4be6-b10c-06fec7640795︠ cubeface = PermutationGroup(["(1,3,2,5)","(1,4,2,6)","(3,4,5,6)"]) cubeface.list() ︡f84beb38-b5f2-471d-8fa0-aa3117269899︡{"stdout": "[(), (3,4,5,6), (3,5)(4,6), (3,6,5,4), (1,2)(4,6), (1,2)(3,4)(5,6), (1,2)(3,5), (1,2)(3,6)(4,5), (1,3)(2,5)(4,6), (1,3,2,5), (1,3,4)(2,5,6), (1,3,6)(2,5,4), (1,4,3)(2,6,5), (1,4,5)(2,6,3), (1,4,2,6), (1,4)(2,6)(3,5), (1,5,2,3), (1,5)(2,3)(4,6), (1,5,6)(2,3,4), (1,5,4)(2,3,6), (1,6,3)(2,4,5), (1,6,5)(2,4,3), (1,6,2,4), (1,6)(2,4)(3,5)]"}︡ ︠3a998d56-74d3-406c-98b2-8869bceac6b5i︠ %htmlAgain, this subgroup of {S}_{6} is “same as” the full symmetric group, {S}_{4},
︡cd26be2a-c61d-4d3f-a799-32e233716ad7︡{"html": "Again, this subgroup of {S}_{6} is “same\r\nas” the full symmetric group, {S}_{4},
"}︡ ︠025dca7c-c678-40e9-9cd4-d4f69df898a7︠ cubeface.is_isomorphic(SymmetricGroup(4)) ︡aa2698df-90eb-4595-a8ca-c8fccd065c00︡{"stdout": "True"}︡ ︠dfd4c713-77a5-4715-b8f9-fc7ab2e675dbi︠ %htmlIt turns out that in each of the above constructions, it is sufficient to use just two of the three generators (any two). But one generator is not enough. Give it a try, and use SAGE to convince yourself that a generator can be sacrificed in each case.
The code below (1) begins with the alternating group, {A}_{4}, (2) specifies three elements of the group (the three symmetries of the tetrahedron that are 180 degree rotations about axes through midpoints of opposite edges), (3) uses these three elements to generate a subgroup, and finally (4) illustrates the command for testing if the subgroup H is a normal subgroup of the group A4.
︡8fbc3ec1-ed79-4c9c-880a-abf45e2500ea︡{"html": "It turns out that in each of the above constructions, it is sufficient to use just two of the three\r\ngenerators (any two). But one generator is not enough. Give it a try, and use SAGE to convince yourself\r\nthat a generator can be sacrificed in each case.\r\n
\r\n\r\n
\r\nThe code below (1) begins with the alternating group,\r\n{A}_{4}, (2)\r\nspecifies three elements of the group (the three symmetries of the tetrahedron that are 180 degree rotations\r\nabout axes through midpoints of opposite edges), (3) uses these three elements to generate a subgroup,\r\nand finally (4) illustrates the command for testing if the subgroup H is a normal subgroup of the group A4.
"}︡ ︠667cf391-0c43-4338-a45a-2e39244da2c0︠ A4=AlternatingGroup(4) r1=A4("(1,2)(3,4)") r2=A4("(1,3)(2,4)") r3=A4("(1,4)(2,3)") H=A4.subgroup([r1,r2,r3]) H.is_normal(A4) ︡fd25eec7-8f25-4786-aa79-23a268682eec︡{"stdout": "True"}︡ ︠e76da277-2162-4682-988b-f4d978cfa1f9i︠ %html
Extending the previous example, we can create the quotient (factor) group of {A}_{4} by H.
︡d81669d1-33b0-4f8d-9a76-5f45eaa7cbcd︡{"html": "\r\n
\r\nExtending the previous example, we can create the quotient (factor) group of\r\n{A}_{4} by\r\nH.
"}︡ ︠60a55e34-fb62-4256-aee2-0164a70063f6︠ A4.quotient_group(H) ︡301ea4d5-d14b-409c-8274-4279d347b852︡{"stdout": "Permutation Group with generators [(1,2,3)]"}︡ ︠a22cead4-5b74-468e-912f-35130bbe887di︠ %htmlwill return a permutation group generated by (1,2,3). As expected this is a group of order 3. Notice that we do not get back a group of the actual cosets, but instead we get a group isomorphic to the factor group.
It is easy to check to see if a group is void of any normal subgroups.
︡8164cc1d-918c-41c5-b6e7-65019dd6e65e︡{"html": "will return a permutation group generated by (1,2,3). As expected this is a group of order 3. Notice\r\nthat we do not get back a group of the actual cosets, but instead we get a group isomorphic to the factor\r\ngroup.\r\n
\r\nIt is easy to check to see if a group is void of any normal subgroups.
"}︡ ︠d941cf96-9352-4291-b878-6065b5050d2e︠ print AlternatingGroup(5).is_simple() print AlternatingGroup(4).is_simple() ︡e16e5526-f2d6-416e-9535-8b52a6a82405︡{"stdout": "True\nFalse"}︡ ︠a164b488-f7bf-4943-91cb-d107da3bb5a4i︠ %htmlwill print True and then False.
For any group, it is easy to obtain a composition series. There is an element of randomness in the algorithm, so you may not always get the same results. (But the list of factor groups is unique, according to the Jordan-Hölder theorem.) Also, the subgroups generated sometimes have more generators than necessary, so you might want to “study” each subgroup carefully by checking properties like its order. An interesting example is:
︡597e9577-a835-434d-9670-5649806b7cae︡{"html": "will print True and then False.\r\n
\r\nFor any group, it is easy to obtain a composition series. There is an element of randomness in the algorithm, so\r\nyou may not always get the same results. (But the list of factor groups is unique, according to the\r\nJordan-Hölder theorem.) Also, the subgroups generated sometimes have more generators than necessary, so you\r\nmight want to “study” each subgroup carefully by checking properties like its order. An interesting example is:
"}︡ ︠0028083c-f699-4b97-b7d8-92b6bdb7503f︠ DihedralGroup(105).composition_series() ︡b7c97d6e-84f9-4091-b92b-246d86bbc241︡{"stdout": "[Permutation Group with generators [(2,105)(3,104)(4,103)(5,102)(6,101)(7,100)(8,99)(9,98)(10,97)(11,96)(12,95)(13,94)(14,93)(15,92)(16,91)(17,90)(18,89)(19,88)(20,87)(21,86)(22,85)(23,84)(24,83)(25,82)(26,81)(27,80)(28,79)(29,78)(30,77)(31,76)(32,75)(33,74)(34,73)(35,72)(36,71)(37,70)(38,69)(39,68)(40,67)(41,66)(42,65)(43,64)(44,63)(45,62)(46,61)(47,60)(48,59)(49,58)(50,57)(51,56)(52,55)(53,54), (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105), (1,4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58,61,64,67,70,73,76,79,82,85,88,91,94,97,100,103)(2,5,8,11,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59,62,65,68,71,74,77,80,83,86,89,92,95,98,101,104)(3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,99,102,105), (1,16,31,46,61,76,91)(2,17,32,47,62,77,92)(3,18,33,48,63,78,93)(4,19,34,49,64,79,94)(5,20,35,50,65,80,95)(6,21,36,51,66,81,96)(7,22,37,52,67,82,97)(8,23,38,53,68,83,98)(9,24,39,54,69,84,99)(10,25,40,55,70,85,100)(11,26,41,56,71,86,101)(12,27,42,57,72,87,102)(13,28,43,58,73,88,103)(14,29,44,59,74,89,104)(15,30,45,60,75,90,105)], Permutation Group with generators [(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105), (1,4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58,61,64,67,70,73,76,79,82,85,88,91,94,97,100,103)(2,5,8,11,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59,62,65,68,71,74,77,80,83,86,89,92,95,98,101,104)(3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,99,102,105), (1,16,31,46,61,76,91)(2,17,32,47,62,77,92)(3,18,33,48,63,78,93)(4,19,34,49,64,79,94)(5,20,35,50,65,80,95)(6,21,36,51,66,81,96)(7,22,37,52,67,82,97)(8,23,38,53,68,83,98)(9,24,39,54,69,84,99)(10,25,40,55,70,85,100)(11,26,41,56,71,86,101)(12,27,42,57,72,87,102)(13,28,43,58,73,88,103)(14,29,44,59,74,89,104)(15,30,45,60,75,90,105)], Permutation Group with generators [(1,4,7,10,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58,61,64,67,70,73,76,79,82,85,88,91,94,97,100,103)(2,5,8,11,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59,62,65,68,71,74,77,80,83,86,89,92,95,98,101,104)(3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,99,102,105), (1,16,31,46,61,76,91)(2,17,32,47,62,77,92)(3,18,33,48,63,78,93)(4,19,34,49,64,79,94)(5,20,35,50,65,80,95)(6,21,36,51,66,81,96)(7,22,37,52,67,82,97)(8,23,38,53,68,83,98)(9,24,39,54,69,84,99)(10,25,40,55,70,85,100)(11,26,41,56,71,86,101)(12,27,42,57,72,87,102)(13,28,43,58,73,88,103)(14,29,44,59,74,89,104)(15,30,45,60,75,90,105)], Permutation Group with generators [(1,16,31,46,61,76,91)(2,17,32,47,62,77,92)(3,18,33,48,63,78,93)(4,19,34,49,64,79,94)(5,20,35,50,65,80,95)(6,21,36,51,66,81,96)(7,22,37,52,67,82,97)(8,23,38,53,68,83,98)(9,24,39,54,69,84,99)(10,25,40,55,70,85,100)(11,26,41,56,71,86,101)(12,27,42,57,72,87,102)(13,28,43,58,73,88,103)(14,29,44,59,74,89,104)(15,30,45,60,75,90,105)], Permutation Group with generators [()]]"}︡ ︠748962d3-2770-4c1b-a422-e65d830ee60ei︠ %htmlThe output will be a list of 5 subgroups of {D}_{105}, each a normal subgroup of its predecessor.
Several other series are possible, such as the derived series. Use tab-completion to see the possibilities.
Given a group G, we can define a relation ∼ on G by: for a,\kern 1.95872pt b ∈ G, a ∼ b if and only if there exists an element g ∈ G such that ga{g}^{−1} = b.
Since this is an equivalence relation, there is an associated partition of the elements of G into equivalence classes. For this very important relation, the classes are known as “conjugacy classes.” A representative of each of these equivalence classes can be found as follows. Suppose G is a permutation group, then G.conjugacy_classes_representatives() will return a list of elements of G, one per conjugacy class.
Given an element g ∈ G, the “centralizer” of g is the set C(g) = \{h ∈ G\mathrel{∣}hg{h}^{−1} = g\}, which is a subgroup of G. A theorem tells us that the size of each conjugagcy class is the order of the group divided by the order of the centralizer of an element of the class. With the following code we can determine the size of the conjugacy classes of the full symmetric group on 5 symbols,
︡e3180bc7-2b64-4bda-8f85-bb531718080b︡{"html": "The output will be a list of 5 subgroups of {D}_{105},\r\neach a normal subgroup of its predecessor.\r\n
Several other series are possible, such as the derived series. Use tab-completion to see the\r\npossibilities.\r\n
\r\nGiven a group G, we\r\ncan define a relation ∼\r\non G by:\r\nfor a,\\kern 1.95872pt b ∈ G,\r\na ∼ b if and only if there\r\nexists an element g ∈ G\r\nsuch that ga{g}^{−1} = b.\r\n
Since this is an equivalence relation, there is an associated partition of the elements of\r\nG into\r\nequivalence classes. For this very important relation, the classes are known as “conjugacy classes.” A\r\nrepresentative of each of these equivalence classes can be found as follows. Suppose G is a\r\npermutation group, then G.conjugacy_classes_representatives() will return a list of elements of\r\nG, one\r\nper conjugacy class.\r\n
Given an element g ∈ G,\r\nthe “centralizer” of g\r\nis the set C(g) = \\{h ∈ G\\mathrel{∣}hg{h}^{−1} = g\\}, which\r\nis a subgroup of G.\r\nA theorem tells us that the size of each conjugagcy class is the order of the group divided\r\nby the order of the centralizer of an element of the class. With the following code we can\r\ndetermine the size of the conjugacy classes of the full symmetric group on 5 symbols,
"}︡ ︠7888dbce-eeab-4de4-be2e-1d3e3a684f62︠ G = SymmetricGroup(5) group_order = G.order() reps = G.conjugacy_classes_representatives() class_sizes = [] for g in reps: class_sizes.append( group_order/G.centralizer(g).order() ) print class_sizes ︡ddc89d83-efc8-49cc-b2bd-4ae0e92dd210︡{"stdout": "[1, 10, 15, 20, 20, 30, 24]"}︡ ︠2ab014d0-efff-4875-9a8a-fc8b4c4b88a3i︠ %htmlThis should produce the list [1, 10, 15, 20, 20, 30, 24] which you can check sums to 120, the order of the group. You might be able to produce this list by counting elements of the group {S}_{5} with identical cycle structure (which will require a few simple combinatorial arguments).
Sylow’s Theorems assert the existence of certain subgroups. For example, if p is a prime, and {p}^{r} divides the order of a group G, then G must have a subgroup of order {p}^{r}. Such a subgroup could be found among the output of the conjugacy_classes_subgroups() command by checking the orders of the subgroups produced. The map() command is a quick way to do this. The symmetric group on 8 symbols, {S}_{8}, has order 8! = 40, 320 and is divisible by {2}^{7} = 128. Let’s find one example of a subgroup of permutations on 8 symbols with order 128. The next command takes a few minutes to run, so go get a cup of coffee after you set it in motion.
︡fb912950-874d-45e0-a68a-0dd94a84362e︡{"html": "This should produce the list [1, 10, 15, 20, 20, 30, 24] which you can check sums to 120, the\r\norder of the group. You might be able to produce this list by counting elements of the group\r\n{S}_{5} with\r\nidentical cycle structure (which will require a few simple combinatorial arguments).\r\n\r\n
\r\nSylow’s Theorems assert the existence of certain subgroups. For example, if\r\np is a prime, and\r\n{p}^{r} divides the order\r\nof a group G, then\r\nG must have a\r\nsubgroup of order {p}^{r}.\r\nSuch a subgroup could be found among the output of the conjugacy_classes_subgroups() command by checking\r\nthe orders of the subgroups produced. The map() command is a quick way to do this. The symmetric group on 8\r\nsymbols, {S}_{8}, has order\r\n8! = 40, 320 and is divisible by\r\n{2}^{7} = 128. Let’s find one example of a\r\nsubgroup of permutations on 8\r\nsymbols with order 128.\r\nThe next command takes a few minutes to run, so go get a cup of coffee after you set it in motion.
"}︡ ︠1c4f9c19-2c31-48b1-a600-79e29e8bb647︠ G = SymmetricGroup(8) subgroups = G.conjugacy_classes_subgroups() map( order, subgroups ) ︡28bb9f3c-0752-4f7f-baeb-3e6d4e04e0dd︡{"stdout": "[1, 2, 2, 2, 2, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 10, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 18, 18, 18, 18, 18, 18, 18, 20, 20, 20, 21, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 30, 30, 30, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 40, 42, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56, 60, 60, 60, 60, 60, 64, 64, 64, 64, 64, 64, 64, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 120, 120, 120, 120, 120, 120, 120, 128, 144, 144, 144, 168, 168, 168, 180, 192, 192, 192, 192, 192, 240, 240, 288, 288, 288, 336, 360, 360, 360, 360, 384, 576, 576, 576, 720, 720, 720, 720, 1152, 1344, 1440, 2520, 5040, 20160, 40320]"}︡ ︠8db33737-7ce4-4199-b6e3-3ff86cf81d08i︠ %htmlThe map(order, subgroups) command will apply the order() method to each of the subgroups in the list subgroups. The output is thus a large list of the orders of many subgroups (296 to be precise). if you count carefully, you will see that 259{}^{th} subgroup has order 128. You can retrieve this group for further study by referencing it as subgroups[258] (remember that counting starts at zero).
If {p}^{r} is the highest power of p to divide the order of G, then a subgroup of order {p}^{r} is known as a “Sylow p-subgroup.” Sylow’s Theorems also say any two Sylow p-subgroups are conjugate, so the output of conjugacy_classes_subgroups() should only contain each Sylow p-subgroup once. But there is an easier way, sylow_subgroup(p) will return one. Notice that the argument of the command is just the prime p, not the full power {p}^{r}. Failure to use a prime will generate an informative error message.
We list here constructions, as permutation groups, for all of the groups of order less than
16.
Size | Construction | Notes |
1 | SymmetricGroup(1) | Trivial |
2 | SymmetricGroup(2) | Also CyclicPermutationGroup(2) |
3 | CyclicPermutationGroup(3) | Prime order |
4 | CyclicPermutationGroup(4) | Cyclic |
4 | KleinFourGroup() | Abelian, non-cyclic |
5 | CyclicPermutationGroup(5) | Prime order |
6 | CyclicPermutationGroup(6) | Cyclic |
6 | SymmetricGroup(3) | Non-abelian, also DihedralGroup(3) |
7 | CyclicPermutationGroup(7) | Prime order |
8 | CyclicPermutationGroup(8) | Cyclic |
8 | D1=CyclicPermutationGroup(4) | Abelian, non-cyclic |
8 | D1=CyclicPermutationGroup(2) | Abelian, non-cyclic |
8 | DihedralGroup(4) | Non-abelian |
8 | PermutationGroup(["(1,2,5,6)(3,4,7,8)", | Quaternions |
9 | CyclicPermutationGroup(9) | Cyclic |
9 | D1=CyclicPermutationGroup(3) | Abelian, non-cyclic |
10 | CyclicPermutationGroup(10) | Cyclic |
10 | DihedralGroup(5) | Non-abelian |
11 | CyclicPermutationGroup(11) | Prime order |
12 | CyclicPermutationGroup(12) | Cyclic |
12 | D1=CyclicPermutationGroup(6) | Abelian, non-cyclic |
12 | DihedralGroup(6) | Non-abelian |
12 | AlternatingGroup(4) | Non-abelian, symmetries of tetrahedron |
12 | PermutationGroup(["(1,2,3)(4,6)(5,7)", | Non-abelian |
13 | CyclicPermutationGroup(13) | Prime order |
14 | CyclicPermutationGroup(14) | Cyclic |
14 | DihedralGroup(7) | Non-abelian |
15 | CyclicPermutationGroup(15) | Cyclic |
The construction of SAGE is the work of many people, and the group theory portion is made possible by the extensive work of the creators of GAP. However, we will single out three people from the SAGE team to thank for major contributions toward bringing you the group theory portion of SAGE: David Joyner, William Stein, and Robert Bradshaw. Thanks!
︡6ab65942-dcab-41a9-8ea2-0be6aa1224da︡{"html": "The map(order, subgroups) command will apply the order() method to each\r\nof the subgroups in the list subgroups. The output is thus a large list of the orders\r\nof many subgroups (296 to be precise). if you count carefully, you will see that\r\n259{}^{th}\r\nsubgroup has order 128. You can retrieve this group for further study by referencing it as subgroups[258]\r\n(remember that counting starts at zero).\r\n
If {p}^{r} is the highest power\r\nof p to divide the order of\r\nG, then a subgroup of order\r\n{p}^{r} is known as a “Sylow\r\np-subgroup.” Sylow’s Theorems\r\nalso say any two Sylow p-subgroups\r\nare conjugate, so the output of conjugacy_classes_subgroups() should only contain each Sylow\r\np-subgroup once.\r\nBut there is an easier way, sylow_subgroup(p) will return one. Notice that the argument of the command is just\r\nthe prime p, not\r\nthe full power {p}^{r}.\r\nFailure to use a prime will generate an informative error message.\r\n\r\n
\r\nWe list here constructions, as permutation groups, for all of the groups of order less than\r\n16.
Size | Construction | Notes |
1 | SymmetricGroup(1) | Trivial | \r\n
2 | SymmetricGroup(2) | Also CyclicPermutationGroup(2) | \r\n
3 | CyclicPermutationGroup(3) | Prime order | \r\n
4 | CyclicPermutationGroup(4) | Cyclic | \r\n
4 | KleinFourGroup() | Abelian, non-cyclic | \r\n
5 | CyclicPermutationGroup(5) | Prime order | \r\n
6 | CyclicPermutationGroup(6) | Cyclic | \r\n
6 | SymmetricGroup(3) | Non-abelian, also DihedralGroup(3) | \r\n
7 | CyclicPermutationGroup(7) | Prime order | \r\n
8 | CyclicPermutationGroup(8) | Cyclic | \r\n
8 | D1=CyclicPermutationGroup(4) | Abelian, non-cyclic | \r\n
8 | D1=CyclicPermutationGroup(2) | Abelian, non-cyclic | \r\n
8 | DihedralGroup(4) | Non-abelian | \r\n
8 | PermutationGroup(["(1,2,5,6)(3,4,7,8)", | Quaternions | \r\n
9 | CyclicPermutationGroup(9) | Cyclic | \r\n
9 | D1=CyclicPermutationGroup(3) | Abelian, non-cyclic | \r\n
10 | CyclicPermutationGroup(10) | Cyclic | \r\n
10 | DihedralGroup(5) | Non-abelian | \r\n
11 | CyclicPermutationGroup(11) | Prime order | \r\n
12 | CyclicPermutationGroup(12) | Cyclic | \r\n
12 | D1=CyclicPermutationGroup(6) | Abelian, non-cyclic | \r\n
12 | DihedralGroup(6) | Non-abelian | \r\n
12 | AlternatingGroup(4) | Non-abelian, symmetries of tetrahedron | \r\n
12 | PermutationGroup(["(1,2,3)(4,6)(5,7)", | Non-abelian | \r\n
13 | CyclicPermutationGroup(13) | Prime order | \r\n
14 | CyclicPermutationGroup(14) | Cyclic | \r\n
14 | DihedralGroup(7) | Non-abelian | \r\n
15 | CyclicPermutationGroup(15) | Cyclic | \r\n
The construction of SAGE is the work of many people, and the group theory portion is made possible by\r\nthe extensive work of the creators of GAP. However, we will single out three people from the SAGE team\r\nto thank for major contributions toward bringing you the group theory portion of SAGE: David Joyner,\r\nWilliam Stein, and Robert Bradshaw. Thanks!\r\n
"}︡