/// <summary> /// Returns a permutation group on {1,2,...,|G|} isomorphic to this group G. /// </summary> /// <param name="bijection">A bijection from G to {1,2,...,|G|}.</param> /// <param name="bijectionInverse">The inverse of <paramref name="bijection"/>.</param> /// <param name="isomorphism">An isomorphism from G to the permutation group.</param> public Group <Permutation <int> > ToPermutationGroup(Func <T, int> bijection, Func <int, T> bijectionInverse, out Func <T, Permutation <int> > isomorphism) { if (bijectionInverse == null) { bijectionInverse = Discrete.Inverse(_set, bijection); } var set = new FiniteSet <int>(Enumerable.Range(1, _set.Size)); isomorphism = x => Permutation <int> .FromFunction(set, k => bijection(_product(x, bijectionInverse(k)))); var permutations = new FiniteSet <Permutation <int> >(_set.Select(isomorphism)); return(new Group <Permutation <int> >(permutations, Permutation <int> .Product, Permutation <int> .Inverse, Permutation <int> .Identity(set))); }