Introduction
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.
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
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
Theoretical Background
A group is a set with a binary operation such that:
G
·
1
.Closure: For all .
a,b∈G,a·b∈G
2
. Associativity: For all .
a,b∈G,(a·b)·ca·(b·c)
3
.Identity: There exists an element such that for all .
e∈G
e·aa·ea
a∈G
4
.Inverse: For each , there exists ∈G such that .
a∈G
-1
a
a·e
-1
a
A group is abelian if for all .
a·bb·a
a,b∈G
The center of a group is the set of all elements that commute with every element in .
Z(G)
G
The Cayley Table is a tabular representation of the group operation.
Function Reference
Function Reference
IdentityElement[group]
IdentityElement[group]
Definition : Returns the identity element of a group or monoid
Syntax :
Arguments:
Syntax :
IdentityElement[group]
Arguments:
◼
group
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]
IsIdentityByGroup[group, elem]
Definition : Tests whether is the identity element of .
Syntax :
Returns: True or False
elem
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]
IsIdentity[list, elem, operation]
Definition : Tests whether is the identity element in a magma defined by and binary operation .
Syntax :
Arguments:
elem
list
operation
Syntax :
IsIdentity[list, elem, operation]
Arguments:
◼
list
◼
elem
◼
operation
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]
CayleyMultiplicationTable[group]
Definition : Constructs the Cayley table of a group or monoid, with the operation symbol shown in the top-left corner.
Syntax :
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
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
Future Work
◼
Add visualization tools (colored Cayley tables, subgroup lattices).
◼
Develop further educational notebooks (tutorials, exercises, applications in physics)
CITE THIS NOTEBOOK
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
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