# How to list automorphisms on a finite set and analyze them

Let s be a finite set of integer lattice points, for example s = { {0,0} , {0,3} , {1,1} , {0,2} }.

I am trying to do two things:

1. Create a list of all the automorphisms on s. That is, if $$s$$ is our set, I want to list all onto functions $$f:s \rightarrow s$$, not including duplicates. (Consider $$f$$ and $$g$$ duplicates if for each point in $$s$$, that point is taken by $$f$$ and $$g$$ to the same point.)
2. Among the automorphisms, find those $$f$$ for which Condition[ x , f[x] ] is True for all x in s.

Here, Condition is just an aribtrary function that takes in two $$2$$-tuples and returns True or False.

I am trying to do (1) to accomplish (2). But, I have never tried to handle lists of functions before, and am not sure how to do it in Mathematica. I am trying to do this by treating a 'function' as a collection of $$2$$-tuples of $$2$$-tuples, where the second element is the target of the function acting on the first. But this is very, very, tedious, and I am hoping there is a better way.

• I think you can find a group that is isomorphic to s and calculate its automorphism group with the help of Magma. Oct 6, 2020 at 4:38

To make it simple, I choose a set of symbols (you can replace them with points in 1,2,3.. n dimensions):

sym = Array[Subscript[s, #] &, 4]


We get all automorphism by Permutations[sym]. A permutation gives the image of the first element, the second element ...

automorph= Permutations[sym]


Finally to pick all automorphism that fulfill some predicate "pred" we can use "Select". E.g. to get all automorphism that leave the first 2 elements in place we define the predicate:

pred[x_] := x[] === sym[] && x[] === sym[]


Or all together:

sym = Array[Subscript[s, #] &, 4];
automorph = Permutations[sym];
pred[x_] := x[] === sym[] && x[] === sym[]
Select[automorph, pred]

• Thanks for the 'step-by-step'. Very helpful. Oct 7, 2020 at 0:11
• Your answer is great. What is the automorphism group of the symmetric group S4? Is it S4? Oct 7, 2020 at 1:04
• Yes indeed. See e.g.: en.wikipedia.org/wiki/… Oct 7, 2020 at 7:43