Ask Your Question

Revision history [back]

Equality of permutation groups

What does it mean for two permutation groups to be "equal", as in G==H ? I have searched the documentation back and forth, and could not find an answer. Even looking at the source I could not decipher how the comparison is done.

I can think of two meaningful definitions:

  1. Permutation groups are equal if they contain the same permutations (as in == between permutations)
  2. Permutation groups are equal if they contain the same permutations and have the same domain.

But neither definition complies with actual performance. Here is a minimal demonstration in SageMath version 9.0, Release Date: 2020-01-01, using Python 3.8.10.

sage: A = PermutationGroup([(1,3)], domain=[1,3])
sage: B = PermutationGroup([(1,3)], domain=[1,2,3])
sage: C = PermutationGroup([(1,3)], domain=[1,2,3,4])
sage: list(A)
[(), (1,3)]
sage: list(B)
[(), (1,3)]
sage: list(C)
[(), (1,3)]

Looks like all three groups contain the same two permutations as their elements. Let us verify.

sage: [A[i]==B[i] for i in [0,1]]
[True, True]
sage: [A[i]==C[i] for i in [0,1]]
[True, True]
sage: [B[i]==C[i] for i in [0,1]]
[True, True]

Yes, the elements compare equal. However, some of the groups compare equal, and some do not.

sage: A==B
False
sage: A==C
False
sage: B==C
True

Note: This might be related to SageMath issue #36527 (sorry, not enough karma to post the link), where IntegerVectorsModPermutationGroup is getting confused with permutations groups that have different domains but otherwise look the same. However, the above demonstration suggests that this is a more general thing.

Perhaps the question is: is there, or is there supposed to be, a meaningful notion of permutation group equality in Sage? If yes, what is it exactly?