Exploring Abstract Algebra with Mathematica

Medhat Ahmed Rakha

Abstract

In this talk I introduced a new learning environment due to A. C. Hibbard, Exploring Abstract Algebra with Mathematica  for introductory abstract algebra built around a collection of Mathematica packages entitled AbstractAlgebra. These packages are a foundation for this collection of twenty-seven interactive labs on group and ring theory. This work can be used to supplement any introductory abstract algebra text and is not dependent on any particular text.

Packages in AbstractAlgebra

Typically, to use a function from AbstractAlgebra, the Master package needs to be evaluated. This loads all the names of functions that are found in the packages and is done as follows.

Needs["AbstractAlgebra`Master`"]

Reading in the Master packages causes all the names in all the packages to be recognized.
When a particular function is used, the appropriate package is then called. 
For example, if we want to figure the Cayley table for Z[3], we provide as input 
CayleyTable[Z[3],Mode->Visual];.

CayleyTable[Z[3], Mode -> Visual];

For each element, a different color is used. The entries in the table corresponding to the elements are then colored and labeled accordingly.

Basic structures used in AbstractAlgebra

Overview

The goal of the packages in AbstractAlgebra is to provide an environment for working with groups, rings, fields, and homomorphisms. The fundamental structures are called Groupoids, Ringoids, and Morphoids.
A Groupoid consists of a set (List) of elements followed by an operation, whereas a Ringoid consists of a set of elements followed by two operations. A Morphoid consists of a function (or a list of rules) followed by the domain and codomain, which are either both groupoids or both ringoids.

For an example of a groupoid, consider the set {2,3,4} and the built-in Mathematica operator Plus, which performs addition.

G = Groupoid[{2, 3, 4}, Plus]

This structure, defined as G, clearly does not form a group. Also, Plus is not a binary operation (over this set), since 3 + 2 = 5 and 5 is not a member of the set {2,3,4}. We can make sure about this by asking the following question.

GroupQ[G]

How to form Groupoids, Ringoids and Morphoids

As before, we formed the Groupoid G by

G = Groupoid[{2, 3, 4}, Plus]

The recommended method is to use the FormGroupoid function as follows

G = FormGroupoid[{2, 3, 4}, Plus]

To form (Subscript[Z, 5]), we could use the following.

G = Z[5]

GroupQ[G]

We can easily verify that by describing the Cayley Table of such group as follows

CayleyTable[G, Mode -> Visual]

For each element, a different color is used. The entries in the table corresponding to the elements are then colored and labeled accordingly.

Also, easily one can have more informations about G

GroupInfo[G]

Here is another example about Ringoid

R1 = FormRingoid[{-1, 0, 1}, Plus, Times]

RingQ[R1]

Which we can easily verify by making its Cayley table.

CayleyTables[R1, Mode -> Visual]

Similar to GroupInfo we can use for ringoid

RingInfo[R1]

As we see before how the graphics produced by Cayley Tables helps us to determine weather the structures is valid or not, here we can have some other example for the Cayley Table of the symmetric group S[3]

CayleyTable[G = Symmetric[3], Mode -> Visual];

Testing the defining properties of a group

The four standard functions

The standard definition of a group is that is a set of elements with an operation such that the set of elements is closed under this operation (binary operation), there is an identity element, every element has an inverse, and the operation is associative. There are Boolean functions corresponding to each of these requirements.

ClosedQ[G]			: Give True if the groupoid G is closed under its operation,  
				  and False otherwise.
ClosedQ[{(Subscript[G, 1]),(Subscript[G, 2]),...,(Subscript[G, n])}]	: List of values True or False depending on the values of 
				  ClosedQ[(Subscript[G, i])].
HasIdentityQ[G]		: Give True if G has an identity, and False otherwise.
HasInverseQ[G]		: Give True if every element in G has an inverse, 
				  and False otherwise.
AssociativeQ[G]		: Give True if the operation of G is associative,
				  and False otherwise.

Consider the following groupoids

G1 = FormGroupoid[{1, 2, 3, 4}, Plus, "+"]
G2 = Z[4]

Let us now discuss the Closure property and other properties of the group

The groupoid G1 is not closed under the operation Plus. 
There are two ways to test the ClosedQ one in Text Mode:

ClosedQ[G1, Mode -> Textual]

ClosedQ[G2, Mode -> Textual]

and the other way to examine the command ClosedQ, in the Visual Mode

ClosedQ[G1, Mode -> Visual]

ClosedQ[G2, Mode -> Visual]

To discuss the identity property, one should keep in mind that a group identity must be both a left identity and a right identity (Commutative).

HasIdentityQ[G1]

HasIdentityQ[G2, Mode -> Visual]

For the inverse property; as well as, there will be two ways to examine the  availabilty of the inverse element in a group. One way is the Textual Mod:

HasInversesQ[G1, Mode -> Textual]

and for G2;

HasInversesQ[G2, Mode -> Textual]

and here is the same thing in Visual Mode:

HasInversesQ[G2, Mode -> Visual]

One can easily check the associative property as:

AssociativeQ[G1, Mode -> Visual]

What is a Permutation?

Let us start this section by a question : What is a permutation? 
Suppose we had five colored squares labeled 1 through 5.

RandomColoredSquares[5];

Suppose further that we decide to change the order in which these squares appear. 
Let's say we want 1 to go to the second location, square 2 to the third location, square 3 to the first, square 5 to the fifth, and square 5 to the fourth.

PermuteColoredSquares[{1 -> 2, 2 -> 3, 3 -> 1, 4 -> 5, 
          5 -> 4}];

Note how the first square went to the second location (1->2), the second square went to the third position (2->3), the third square went to the first position (3->1), and so on.
Here we say that the second row of squares is a permutation of the squares of the first row. Mathematically, a Permutation of a set X is a function g from X to X that is both 1-1 and onto. In our case above we could have the permutation defined as follows :

g:X->X by 
g(1)=2	, g(2)=3, g(3)=1, g(4)=5, and g(5)=4 where X={1,2,3,4,5}, this is often represented by a matrix.

Here is how we can obtain the matrix for such permutation:

PermutationMatrix[{1 -> 2, 2 -> 3, 3 -> 1, 4 -> 5, 5 -> 4}]

Computations with Permutations

Suppose we have two permutations.

p = {1 -> 2, 2 -> 4, 3 -> 3, 4 -> 5, 5 -> 1}
q = {1 -> 5, 2 -> 4, 3 -> 1, 4 -> 2, 5 -> 3}

We can view each permutation as a matrix;

PermutationMatrix[p]
PermutationMatrix[q]

To perform the product of p followed by q

SideBySideMatrices[p, q]

Or directly one can have

PermutationMatrix[MultiplyPermutations[q, p]]

PermutationMatrix[MultiplyPermutations[q, p]]

PermutationMatrix[
      MultiplyPermutations[{2, 3, 1, 4}, {4, 2, 3, 1}, 
        Mode -> Textual]]

Also, easily we can examine weather a permutation is even or odd:

P = {3, 1, 2, 5, 4, 6}

OddPermutationQ[P]

EvenPermutationQ[P]

ShowColoredPermutation[P]

More and More ...

In this last section, we will give some and not all of the interested commands in such interested package. Here are some interested famous groups :

Dihedral[3,  Mode -> Visual]

and this is the Klein 4 group :

CayleyTable[Klein4,  Mode -> Visual]

Easily, we can generates all subgroups of Z[8]

SubgroupGenerated[Z[8], 6, Mode -> Visual,  
      Output -> GraphicsArray]

Here are the Left Coset of the subgroup {0,4} of the group Z[8] containing 7 is the set 7 + {0,4}

LeftCoset[Z[8], {0, 4}, 7, Mode -> Visual]

Finally, here are some interested commands about Homomorphisms.
This is the natural homomorphism from (Subscript[Z, 18])into (Subscript[Z, 3])

f = ZMap[18, 3]

Here is how the function actually works on each domain element.

ToRules[f]

What about visual mode, sure it will clear what is happening with the function f.

VisualizeMorphoid[f, ColorCodomain -> Automatic];

The Kernel function has a visual mode too.

K = Kernel[ZMap[18, 3], Mode -> Visual]

More Information

More information about Exploring Abstract Algebra with Mathematica, can be found on the web site at http://www.central.edu/eaam.html (which is also mirrored at http://www.uml.edu/Dept/Math/eaam/eaam.html).

Acknowledgment

I would like to thank Prof. Al Hibbard, author of Exploring Abstract Algebra with Mathematica, who accepted kindly my invitation to attend my workshop, Mathematica in Education and Research - (Ismailia, May 3rd - 2001), but he could not attend it since he was arranged to attend another conference in Africa.