Introduction

This project extends the group theory capabilities of Mathematica by providing additional functions to work with groups, monoids, and magmas. It includes tools for identifying group attributes, generating Cayley multiplication tables, testing structural properties (abelian, center, identity), and exploring algebraic examples.
​
The aim is both educational and exploratory: to make it easier for students and researchers to experiment with algebraic structures using the Wolfram Language.

Installation & Usage

To use the functions, load the notebook or package file:
Get["path/to/Functions.wl"];
Once loaded, all custom functions are available like built-in Wolfram Language symbols.

Theoretical Background

A group is a set
G
with a binary operation
·
such that:
1
.
Closure: For all
a,b∈G,a·b∈G
.
2
.
Associativity: For all
a,b∈G,(a·b)·ca·(b·c)
.
3
.
Identity: There exists an element
e∈G
such that
e·aa·ea
for all
a∈G
.
4
.
Inverse: For each
a∈G
, there exists
-1
a
∈G
such that
a·
-1
a
e
.
A group is abelian if
a·bb·a
for all
a,b∈G
.
The center of a group
Z(G)
is the set of all elements that commute with every element in
G
.
The Cayley Table is a tabular representation of the group operation.

Function Reference

IdentityElement[group]

Definition : Returns the identity element of a group or monoid
​Syntax :
IdentityElement[group]
​
​Arguments:
◼
  • group
    --- a group or monoid (e.g. CyclicGroup[n], DihedralGroup[n], “AddMod”, “MultMod”, etc.).
    ​Returns: The neutral element of the structure.
  • IdentityElement[group_]:=Module[{elems,n},​​Which[​​(*Groupesfinisstandard*)​​Head[group]===CyclicGroup,0,Head[group]===DihedralGroup,Cycles[{}],Head[group]===SymmetricGroup||Head[group]===AlternatingGroup,Cycles[{}],​​(*PermutationGroup*)Head[group]===PermutationGroup,Cycles[{}],(*AbelianGroup*)Head[group]===AbelianGroup||(ValueQ[AbelianGroupQ[_]]&&TrueQ[AbelianGroupQ[group]]),Table[0,{i,Length[group[[1]]]}],​​(*(Zn,+):groupeadditifmodulon*)MatchQ[group,{"AddMod",n_}],0,​​(*(Zn,×)monoïdeougroupemultiplicatif*)MatchQ[group,{"MultMod",n_}],1,​​(*Casgénéral:prendrelepremierélémentdeGroupElements*)True,First[GroupElements[group]]]]
    Examples:
    In[]:=
    IdentityElement[CyclicGroup[5]](*0*)​​IdentityElement[SymmetricGroup[3]](*PermutationCycles[]*)​​IdentityElement[AbelianGroup[{2,3}]](*{0,0}*)​​IdentityElement[{"AddMod",7}](*0*)​​IdentityElement[{"MultMod",8}](*1*)​​
    Out[]=
    0
    Out[]=
    Cycles[{}]
    Out[]=
    {0,0}
    Out[]=
    0
    Out[]=
    1

    IsIdentityByGroup[group, elem]

    Definition : Tests whether
    elem
    is the identity element of
    group
    .
    ​Syntax :
    IsIdentityByGroup[group, elem]
    ​
    ​Returns: True or False
    (*IlfautavoirdéfinilafonctionIdentityElement[group]*)IsIdentityByGroup[group_,elem_]:=(elem===IdentityElement[group])
    Examples:
    In[]:=
    IsIdentityByGroup[CyclicGroup[5],1](*False*)​​IsIdentityByGroup[DihedralGroup[5],Cycles[{}]](*True*)​​IsIdentityByGroup[SymmetricGroup[3],Cycles[{}]](*True*)​​IsIdentityByGroup[AlternatingGroup[3],Cycles[{}]](*True*)​​
    Out[]=
    False
    Out[]=
    True
    Out[]=
    True
    Out[]=
    True

    IsIdentity[list, elem, operation]

    Definition : Tests whether
    elem
    is the identity element in a magma defined by
    list
    and binary operation
    operation
    .
    ​Syntax :
    IsIdentity[list, elem, operation]
    ​
    ​Arguments:
    ◼
  • list
    --- carrier set,
  • ◼
  • elem
    --- candidate identity,
  • ◼
  • operation
    --- binary operation (default: Plus).
  • Returns: True or False
    IsIdentity[list_List,elem_,operation_:Plus]/;MemberQ[list,elem]:=AllTrue[list,((operation[elem,#])==#&)]
    Examples:
    In[]:=
    IsIdentity[Range[0,11],0,Plus](*True*)​​IsIdentity[{2,4,7,10,24},4,Plus](*False*)​​
    Out[]=
    True
    Out[]=
    False

    CayleyMultiplicationTable[group]

    Definition : Constructs the Cayley table of a group or monoid, with the operation symbol shown in the top-left corner.
    ​Syntax :
    CayleyMultiplicationTable[group]
    CayleyMultiplicationTable[group_]:=Module[{elements,Operation,n,i,table,opSymbol},(*Détectiondutypedegroupeetdéfinitiondel'opération*)Which[(*Groupeabélien*)Head[group]===AbelianGroup,n=group[[1]];​​elements=Tuples[Table[Range[0,n[[i]]-1],{i,Length[n]}]];​​Operation[x_,y_]:=Mod[x+y,n];​​opSymbol="+ (mod "<>ToString[n]<>")",(*Groupecyclique*)Head[group]===CyclicGroup,elements=Range[0,group[[1]]-1];​​Operation[x_,y_]:=Mod[x+y,group[[1]]];​​opSymbol="+ (mod "<>ToString[group[[1]]]<>")",(*Groupesmodulairespersonnalisés*)MatchQ[group,{_String,_Integer}],elements=Range[0,group[[2]]-1];​​Operation[x_,y_]:=Which[group[[1]]=="AddMod",Mod[x+y,group[[2]]],group[[1]]=="MultMod",Mod[x*y,group[[2]]]];​​opSymbol=Which[group[[1]]=="AddMod","+ (mod "<>ToString[group[[2]]]<>")",group[[1]]=="MultMod","× (mod "<>ToString[group[[2]]]<>")"],(*DomaineBooléen*)MatchQ[group,{_String,_String}],elements={True,False};​​Operation[x_,y_]:=Which[group[[1]]=="And",And[x,y],group[[1]]=="Or",Or[x,y],group[[1]]=="Xor",Xor[x,y]];​​opSymbol=group[[1]],(*Groupesdepermutations*)MemberQ[{DihedralGroup,SymmetricGroup,AlternatingGroup,PermutationGroup},Head[group]],elements=GroupElements[group];​​Operation[x_,y_]:=PermutationProduct[x,y];​​opSymbol="∘"];​​(*Constructiondelatableavecen-têtes*)table=Prepend[MapIndexed[Prepend[#,elements[[First[#2]]]]&,Table[Operation[elements[[i]],elements[[j]]],{i,Length[elements]},{j,Length[elements]}]],Prepend[elements,Style[opSymbol,Bold]](*Casesupérieuregaucheaveccouleur*)];​​Grid[table,Frame->All,Spacings->{2,2}]]
    Examples:
    In[]:=
    CayleyMultiplicationTable[AbelianGroup[{2,4}]]​​CayleyMultiplicationTable[CyclicGroup[5]]​​CayleyMultiplicationTable[{"AddMod",7}]​​CayleyMultiplicationTable[{"MultMod",8}]​​CayleyMultiplicationTable[DihedralGroup[3]]​​CayleyMultiplicationTable[{"And","BooleanDomain"}]
    Out[]=
    + (mod {2, 4})
    {0,0}
    {0,1}
    {0,2}
    {0,3}
    {1,0}
    {1,1}
    {1,2}
    {1,3}
    {0,0}
    {0,0}
    {0,1}
    {0,2}
    {0,3}
    {1,0}
    {1,1}
    {1,2}
    {1,3}
    {0,1}
    {0,1}
    {0,2}
    {0,3}
    {0,0}
    {1,1}
    {1,2}
    {1,3}
    {1,0}
    {0,2}
    {0,2}
    {0,3}
    {0,0}
    {0,1}
    {1,2}
    {1,3}
    {1,0}
    {1,1}
    {0,3}
    {0,3}
    {0,0}
    {0,1}
    {0,2}
    {1,3}
    {1,0}
    {1,1}
    {1,2}
    {1,0}
    {1,0}
    {1,1}
    {1,2}
    {1,3}
    {0,0}
    {0,1}
    {0,2}
    {0,3}
    {1,1}
    {1,1}
    {1,2}
    {1,3}
    {1,0}
    {0,1}
    {0,2}
    {0,3}
    {0,0}
    {1,2}
    {1,2}
    {1,3}
    {1,0}
    {1,1}
    {0,2}
    {0,3}
    {0,0}
    {0,1}
    {1,3}
    {1,3}
    {1,0}
    {1,1}
    {1,2}
    {0,3}
    {0,0}
    {0,1}
    {0,2}
    Out[]=
    + (mod 5)
    0
    1
    2
    3
    4
    0
    0
    1
    2
    3
    4
    1
    1
    2
    3
    4
    0
    2
    2
    3
    4
    0
    1
    3
    3
    4
    0
    1
    2
    4
    4
    0
    1
    2
    3
    Examples:
    Examples:
    Examples:

    More Information

    See also our Github Repository
    Made by Jules Charlier, Oscar Eatwell, Jawad Ben Brahim and Rafael Salavarria Lorenzoni during Wolfram Language Summer School Oxford 2025 - 9th Edition.
    Supervised by Mario Veruete, Quentin Rible & Alex Upellini.

    Future Work

    ◼
  • Add visualization tools (colored Cayley tables, subgroup lattices).
  • ◼
  • Develop further educational notebooks (tutorials, exercises, applications in physics)
  • CITE THIS NOTEBOOK

    Enhancing group theory capabilities in Wolfram​
    by Jules Charlier, Oscar Eatwell, Jawad Ben Brahim, and Rafael Salavarria Lorenzoni
    Wolfram Community, STAFF PICKS, September 14, 2025
    ​https://community.wolfram.com/groups/-/m/t/3545247