コード例 #1
0
 public Group <Permutation <T> > InnerAutomorphismGroup()
 {
     return(new Group <Permutation <T> >(
                new FiniteSet <Permutation <T> >(_set.Select(g => Permutation <T> .FromFunction(_set, x => _product(_inverse(g), _product(x, g))))),
                Permutation <T> .Product,
                Permutation <T> .Inverse,
                Permutation <T> .Identity(_set)
                ));
 }
コード例 #2
0
 public Group <Permutation <U> > ActionGroup <U>(Func <T, U, U> action, FiniteSet <U> set) where U : IEquatable <U>
 {
     return(new Group <Permutation <U> >(
                new FiniteSet <Permutation <U> >(_set.Select(g => Permutation <U> .FromFunction(set, x => action(g, x)))),
                Permutation <U> .Product,
                Permutation <U> .Inverse,
                Permutation <U> .Identity(set)
                ));
 }
コード例 #3
0
 public Group <Permutation <T> > AutomorphismGroup()
 {
     // TODO: Optimize.
     return(new Group <Permutation <T> >(
                new FiniteSet <Permutation <T> >(Permutation <T> .SetPermutations(_set).Where(permutation => this.IsAutomorphism(permutation.Evaluate))),
                Permutation <T> .Product,
                Permutation <T> .Inverse,
                Permutation <T> .Identity(_set)
                ));
 }
コード例 #4
0
        /// <summary>
        /// Returns the cyclic group on the vertices {1,2,...,n} of an n-gon.
        /// </summary>
        public static Group <Permutation <int> > CyclicGroupP(int n)
        {
            FiniteSet <int> set = new FiniteSet <int>(Enumerable.Range(1, n));
            HashSet <Permutation <int> > permutations = new HashSet <Permutation <int> >();
            Permutation <int>            generator    = Permutation <int> .FromCycle(set, new Cycle <int>(Enumerable.Range(1, n)));

            Permutation <int> current = Permutation <int> .Identity(set);

            for (int i = 0; i < n; i++)
            {
                permutations.Add(current);
                current = Permutation <int> .Product(current, generator);
            }

            return(new Group <Permutation <int> >(new FiniteSet <Permutation <int> >(permutations), Permutation <int> .Product, Permutation <int> .Inverse, Permutation <int> .Identity(set)));
        }
コード例 #5
0
        /// <summary>
        /// Returns the alternating group Alt(S) of order |S|!/2.
        /// </summary>
        public static Group <Permutation <T> > AlternatingGroup <T>(FiniteSet <T> set) where T : IEquatable <T>
        {
            FiniteSet <Permutation <T> > permutations = new FiniteSet <Permutation <T> >(Permutation <T> .SetPermutations(set).Where(a => a.Sign == 1));

            return(new Group <Permutation <T> >(permutations, Permutation <T> .Product, Permutation <T> .Inverse, Permutation <T> .Identity(set)));
        }
コード例 #6
0
        /// <summary>
        /// Returns the symmetric group Sym(S) of order |S|!.
        /// </summary>
        public static Group <Permutation <T> > SymmetricGroup <T>(FiniteSet <T> set) where T : IEquatable <T>
        {
            FiniteSet <Permutation <T> > permutations = new FiniteSet <Permutation <T> >(Permutation <T> .SetPermutations(set));

            return(new Group <Permutation <T> >(permutations, Permutation <T> .Product, Permutation <T> .Inverse, Permutation <T> .Identity(set)));
        }
コード例 #7
0
        /// <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)));
        }