group-theory-0.2.1.0: The theory of groups
Copyright (c) 2020-2021 Emily PillmoreKoji Miyazato BSD-style Emily Pillmore , Reed Mullanix stable non-portable Safe Haskell2010

Data.Group.Order

Description

This module contains definitions for GroupOrder.

Synopsis

# Group order

class (Eq g, Group g) => GroupOrder g where Source #

The typeclass of groups, equipped with the function computing the order of a specific element of a group.

The order of x is the smallest positive integer k such that gtimes k x == mempty. If there are no such integers, the order of x is defined to be infinity.

Note: For any valid instances of GroupOrder, order x == Finite 1 holds if and only if x == mempty.

### Examples:

>>> order (3 :: Sum Word8)
Finite 256
>>> order (16 :: Sum Word8)
Finite 16
>>> order (0 :: Sum Integer)
Finite 1
>>> order (1 :: Sum Integer)
Infinite


Methods

order :: g -> Order Source #

The order of an element of a group.

order x must be Finite k if the order of x is finite k, and must be Infinite otherwise.

For a type which is also FiniteGroup, Finite . finiteOrder is a valid implementation of order, if not efficient.

#### Instances

Instances details
 Source # Instance detailsDefined in Data.Group.Order Methodsorder :: () -> Order Source # GroupOrder a => GroupOrder (Identity a) Source # Instance detailsDefined in Data.Group.Order Methods GroupOrder a => GroupOrder (Dual a) Source # Instance detailsDefined in Data.Group.Order Methodsorder :: Dual a -> Order Source # Source # Instance detailsDefined in Data.Group.Order Methods Source # Instance detailsDefined in Data.Group.Order Methods Source # Instance detailsDefined in Data.Group.Order Methods Source # Instance detailsDefined in Data.Group.Order Methods Source # Instance detailsDefined in Data.Group.Order Methods Source # Instance detailsDefined in Data.Group.Order Methods Source # Instance detailsDefined in Data.Group.Order Methods Source # Instance detailsDefined in Data.Group.Order Methods Source # Instance detailsDefined in Data.Group.Order Methods Source # Instance detailsDefined in Data.Group.Order Methods Source # Instance detailsDefined in Data.Group.Order Methods Source # Instance detailsDefined in Data.Group.Order Methods Source # Instance detailsDefined in Data.Group.Order Methods GroupOrder a => GroupOrder (Down a) Source # Instance detailsDefined in Data.Group.Order Methodsorder :: Down a -> Order Source # Source # Instance detailsDefined in Data.Group.Free.Internal Methods Eq a => GroupOrder (FreeGroup a) Source # Instance detailsDefined in Data.Group.Free Methods (GroupOrder a, GroupOrder b) => GroupOrder (a, b) Source # Instance detailsDefined in Data.Group.Order Methodsorder :: (a, b) -> Order Source # Source # Instance detailsDefined in Data.Group.Order Methodsorder :: Proxy a -> Order Source # (GroupOrder g, GroupOrder h) => GroupOrder (FreeProduct g h) Source # Instance detailsDefined in Data.Group.Free.Product Methodsorder :: FreeProduct g h -> Order Source # (GroupOrder a, GroupOrder b, GroupOrder c) => GroupOrder (a, b, c) Source # Instance detailsDefined in Data.Group.Order Methodsorder :: (a, b, c) -> Order Source # GroupOrder a => GroupOrder (Const a b) Source # Instance detailsDefined in Data.Group.Order Methodsorder :: Const a b -> Order Source # (GroupOrder a, GroupOrder b, GroupOrder c, GroupOrder d) => GroupOrder (a, b, c, d) Source # Instance detailsDefined in Data.Group.Order Methodsorder :: (a, b, c, d) -> Order Source # (GroupOrder a, GroupOrder b, GroupOrder c, GroupOrder d, GroupOrder e) => GroupOrder (a, b, c, d, e) Source # Instance detailsDefined in Data.Group.Order Methodsorder :: (a, b, c, d, e) -> Order Source #

## Order

data Order Source #

The order of a group element.

The order of a group element can either be infinite, as in the case of Sum Integer, or finite, as in the case of Sum Word8.

Constructors

 Infinite Finite !Natural

#### Instances

Instances details
 Source # Instance detailsDefined in Data.Group.Order Methods(==) :: Order -> Order -> Bool #(/=) :: Order -> Order -> Bool # Source # Instance detailsDefined in Data.Group.Order MethodsshowsPrec :: Int -> Order -> ShowS #show :: Order -> String #showList :: [Order] -> ShowS #

pattern Infinitary :: GroupOrder g => g Source #

Unidirectional pattern synonym for the infinite order of a group element.

pattern Finitary :: GroupOrder g => Natural -> g Source #

Unidirectional pattern synonym for the finite order of a group element.

orderForBits :: (Integral a, FiniteBits a) => Sum a -> Order Source #

An efficient implementation of order for additive group of fixed-width integers, like Int or Word8.

lcmOrder x y calculates the least common multiple of two Orders.

If both x and y are finite, it returns Finite r where r is the least common multiple of them. Otherwise, it returns Infinite.

### Examples:

>>> lcmOrder (Finite 2) (Finite 5)
Finite 10
>>> lcmOrder (Finite 2) (Finite 10)
Finite 10
>>> lcmOrder (Finite 1) Infinite
Infinite


class (Group g, Bounded g) => FiniteGroup g Source #

A FiniteGroup is a Group whose underlying set is finite. This is equivalently a group object in $$FinSet$$.

Finite groups often arise when considering symmetry of mathematical or physical objects, when those objects admit just a finite number of structure-preserving transformations. Important examples of finite groups include cyclic groups and permutation groups.

#### Instances

Instances details
 Source # Instance detailsDefined in Data.Group.Finite Source # Instance detailsDefined in Data.Group.Finite FiniteGroup a => FiniteGroup (Dual a) Source # Instance detailsDefined in Data.Group.Finite (Bounded a, Num a) => FiniteGroup (Sum a) Source # Instance detailsDefined in Data.Group.Finite (FiniteGroup a, FiniteGroup b) => FiniteGroup (a, b) Source # Instance detailsDefined in Data.Group.Finite FiniteGroup a => FiniteGroup (Proxy a) Source # Instance detailsDefined in Data.Group.Finite (FiniteGroup a, FiniteGroup b, FiniteGroup c) => FiniteGroup (a, b, c) Source # Instance detailsDefined in Data.Group.Finite FiniteGroup a => FiniteGroup (Const a b) Source # Instance detailsDefined in Data.Group.Finite (FiniteGroup a, FiniteGroup b, FiniteGroup c, FiniteGroup d) => FiniteGroup (a, b, c, d) Source # Instance detailsDefined in Data.Group.Finite (FiniteGroup a, FiniteGroup b, FiniteGroup c, FiniteGroup d, FiniteGroup e) => FiniteGroup (a, b, c, d, e) Source # Instance detailsDefined in Data.Group.Finite

finiteOrder :: (Eq g, FiniteGroup g) => g -> Natural Source #

Calculate the exponent of a particular element in a finite group.

### Examples:

>>> finiteOrder @(Sum Word8) 3
256