GAP:IsPermutable

Function type
This function takes as input a pair of groups, both of which are subgroups of a common big group, and outputs a Boolean variable (true/false).

Behavior

 * The function returns true if the second subgroup permutes with every subgroup of the first subgroup. In particular, if the second subgroup is contained in the first, the function returns true if the second subgroup is a permutable subgroup of the first subgroup.
 * The function returns false if the second subgroup does not permute with every subgroup of the first subgroup. In particular, if the second subgroup is contained in the first, the function returns false if the second subgroup is not a permutable subgroup of the first subgroup.
 * If the two groups are not subgroups of a common parent group, GAP returns a NoMethodFound error.

Typical use
The function is typically used as follows:

IsPermutable(group,subgroup);

Code
ProductOfSubsets := function(A,B) local a,b,L; L := []; for a in Set(A) do           for b in Set(B) do                Add(L,Product([a,b])); od; od; return Set(L); end;;

PermutingSubsets := function(H,K) return(ProductOfSubsets(H,K) = ProductOfSubsets(K,H)); end;;

IsPermutable := function(G,H) if (IsNormal(G,H)) then return true; fi; return (ForAll(Set(G),g -> PermutingSubsets(Group(g),H))); end;;