Function Repository Resource:

 GroupHomomorphism

Source Notebook

Construct homomorphisms between groups

Contributed by: Naman Taggar

ResourceFunction["GroupHomomorphism"][G1,G2,f]

represents the group homomorphism from G1 to G2 specified by f.

ResourceFunction["GroupHomomorphism"][G,f]

represents the group homomorphism from G to itself specified by f.

ResourceFunction["GroupHomomorphism"][G1,G2,f][x]

calculates the image of x under ResourceFunction["GroupHomomorphism"][G1,G2,f].

Details

Creates a data structure H encapsulating the properties of the group homomorphism.
G1 and G2 must be valid group objects such as CyclicGroup, DihedralGroup, SymmetricGroup, MathieuGroupM11, etc.
f must be a list or an association specifying the image of each generator under the required homomorphism.
In ResourceFunction["GroupHomomorphism"], the following properties are supported:
"DomainGroup"domain group of the homomorphism
"CodomainGroup"co-domain group of the homomorphism
"ImageGroup"image group of the homomorphism
"KernelGroup"kernel group of the homomorphism
"InjectiveQ"whether the group homomorphism is injective
"SurjectiveQ"whether the group homomorphism is surjective
"IsomorphismQ"whether the group homomorphism is an isomorphism
"Properties"list of properties

Examples

Basic Examples (2) 

Embed CyclicGroup[2] in CyclicGroup[4] via (12)↦(13)(24):

In[1]:=
\[Phi] = ResourceFunction["GroupHomomorphism"][CyclicGroup[2], CyclicGroup[4], {Cycles[{{1, 3}, {2, 4}}]}]
Out[1]=

Click on + to reveal more information about the homomorphism. For example, ϕ is injective but not surjective.

Obtain the underlying mapping:

In[2]:=
Normal[\[Phi]]
Out[2]=

Scope (5) 

Specify the homomorphism using an association:

In[3]:=
gens = GroupGenerators[SymmetricGroup[4]]
Out[3]=
In[4]:=
assoc = AssociationThread[gens -> gens]
Out[4]=

Build the homomorphism:

In[5]:=
grouph = ResourceFunction["GroupHomomorphism"][SymmetricGroup[4], SymmetricGroup[4], assoc]
Out[5]=

This is the identity homomorphism (an isomorphism, since it is both injective and surjective):

In[6]:=
Normal@Normal[grouph]
Out[6]=
In[7]:=
Select[%, #[[1]] != #[[2]] &]
Out[7]=

Specify an endomorphism (from G to itself):

In[8]:=
ResourceFunction["GroupHomomorphism"][CyclicGroup[2], {Cycles[{{1, 2}}]}]
Out[8]=

Calculate the image of an element under a given homomorphism:

In[9]:=
\[Phi] = ResourceFunction["GroupHomomorphism"][CyclicGroup[2], CyclicGroup[4], {Cycles[{{1, 3}, {2, 4}}]}];
\[Phi][RandomChoice@GroupElements[\[Phi]["DomainGroup"]]]
Out[10]=

To show a large group action, here is the identity homomorphism from SymmetricGroup[20] to itself:

In[11]:=
id = AbsoluteTiming@
  ResourceFunction["GroupHomomorphism"][SymmetricGroup[20], SymmetricGroup[20], GroupGenerators[SymmetricGroup[20]]]
Out[11]=

Display the image and kernel groups:

In[12]:=
AbsoluteTiming@id[[2]]["ImageGroup"]
Out[12]=
In[13]:=
AbsoluteTiming@id[[2]]["KernelGroup"]
Out[13]=

Construct a homomorphism between named groups (the inclusion map):

In[14]:=
nhomo = ResourceFunction["GroupHomomorphism"][
  MathieuGroupM23[],
  MathieuGroupM24[],
  GroupGenerators[MathieuGroupM23[]]
  ]
Out[14]=

Applications (3) 

Construct the sign homomorphism from SymmetricGroup[4] to CyclicGroup[2]:

In[15]:=
S4 = SymmetricGroup[4];
C2 = CyclicGroup[2];

Odd generators must map to (12):

In[16]:=
GroupGenerators[S4]
Out[16]=
In[17]:=
sgn = ResourceFunction["GroupHomomorphism"][S4, C2, {Cycles[{{1, 2}}], Cycles[{{1, 2}}]}]
Out[17]=

Find all even permutations:

In[18]:=
sgn["KernelGroup"] // GroupElements
Out[18]=

Confirm that there are exactly 12 even permutations:

In[19]:=
Length[%]
Out[19]=

Quotient DihedralGroup[3] by CyclicGroup[2], sending all rotations to the Identity and reflections to (1,2):

In[20]:=
GroupGenerators[DihedralGroup[3]]
Out[20]=
In[21]:=
quo = ResourceFunction["GroupHomomorphism"][DihedralGroup[3], CyclicGroup[2], <|Cycles[{{2, 3}}] -> Cycles[{{1, 2}}], Cycles[{{1, 2, 3}}] -> Cycles[{{}}]|>]
Out[21]=

Again, the kernel is all three rotations:

In[22]:=
quo["KernelGroup"] // GroupOrder
Out[22]=

For an Abelian group to itself, the map x↦xk is a homomorphism:

In[23]:=
GroupGenerators[Ab = AbelianGroup[{2, 2, 3}]]
Out[23]=
In[24]:=
pow = ResourceFunction["GroupHomomorphism"][Ab,
  AssociationMap[PermutationPower[#, 3] &, GroupGenerators[Ab]]]
Out[24]=

Its kernel:

In[25]:=
pow["KernelGroup"]
Out[25]=

Properties and Relations (4) 

Below is a table of all properties supported for GroupHomomorphism:

In[26]:=
\[Phi] = ResourceFunction["GroupHomomorphism"][CyclicGroup[2], CyclicGroup[4], {Cycles[{{1, 3}, {2, 4}}]}];
In[27]:=
Grid[{\[Phi]["Properties"],
   Activate@Thread@Inactive[\[Phi]][\[Phi]["Properties"]]} // Transpose, Alignment -> Left, Frame -> All]
Out[27]=

GroupHomomorphism preserves operation:

In[28]:=
{c1, c2} = RandomChoice[GroupElements[S4], 2]
Out[28]=
In[29]:=
sgn[c1\[PermutationProduct]c2] == sgn[c1]\[PermutationProduct]sgn[c2]
Out[29]=

GroupHomomorphism preserves inverses:

In[30]:=
sgn@PermutationPower[c1, -1] == PermutationPower[sgn[c1], -1]
Out[30]=

Applying the homomorphism to an arbitrary object returns unevaluated:

In[31]:=
sgn[x]
Out[31]=

Replace x by an element:

In[32]:=
% /. x -> Cycles[{{}}]
Out[32]=

Possible Issues (5) 

Consider the homomorphism from SymmetricGroup[3] to CyclicGroup[6]:

In[33]:=
bad = ResourceFunction["GroupHomomorphism"][SymmetricGroup[3], CyclicGroup[6],
  {PermutationPower[Cycles[{{1, 2, 3, 4, 5, 6}}], 3], PermutationPower[Cycles[{{1, 2, 3, 4, 5, 6}}], 2]}]
Out[33]=

We mapped an order 2 generator to order 2 element, and 3 to 3. This violates the group relations of SymmetricGroup[3]. Consider for example:

In[34]:=
bad[PermutationProduct[Cycles[{{1, 2}}], Cycles[{{1, 2, 3}}]]]
Out[34]=

But:

In[35]:=
PermutationProduct[bad[Cycles[{{1, 2}}]], bad[Cycles[{{1, 2, 3}}]]]
Out[35]=

Try to specify an invalid homomorphism:

In[36]:=
ResourceFunction["GroupHomomorphism"][CyclicGroup[2], CyclicGroup[3], <|Cycles[{{1, 2}}] -> Cycles[{{1, 2, 3}}]|>]
Out[36]=

The homomorphism sgn:SymmetricGroup[10]→CyclicGroup[2] has kernel equal to AlternatingGroup[10]:

In[37]:=
sgn = ResourceFunction["GroupHomomorphism"][SymmetricGroup[10], CyclicGroup[2], {Cycles[{{1, 2}}], Cycles[{{1, 2}}]}]
Out[37]=
In[38]:=
GroupOrder[sgn["KernelGroup"]] == GroupOrder[AlternatingGroup[10]]
Out[38]=

However the generator representation of kernel may not be optimal:

In[39]:=
sgn["KernelGroup"] // GroupGenerators
Out[39]=
In[40]:=
AlternatingGroup[10] // GroupGenerators
Out[40]=

To define a group homomorphism, Mathematica must be able to return group generators of the domain group. This is not possible for monster group:

In[41]:=
GroupGenerators[MonsterGroupM[]]
Out[41]=

Hence a homomorphism from monster group cannot be constructed:

In[42]:=
ResourceFunction["GroupHomomorphism"][MonsterGroupM[], MonsterGroupM[], {Cycles[{{}}]}]
Out[42]=

The specified images of generators must belong to G2:

In[43]:=
ResourceFunction["GroupHomomorphism"][
 CyclicGroup[2], {Cycles[{{1, 2, 3}}]}]
Out[43]=

Publisher

Naman T.

Version History

  • 1.0.0 – 06 July 2026

Related Resources

License Information