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

Data.Group.Free

Description

This module provides definitions for FreeGroups and FreeAbelianGroups, along with useful combinators.

Synopsis

# Free groups

newtype FreeGroup a Source #

A representation of a free group over an alphabet a.

The intuition here is that Left a represents a "negative" a, whereas Right a represents "positive" a.

Note: This does not perform simplification upon multiplication or construction. To do this, one should use simplify.

Constructors

 FreeGroup FieldsrunFreeGroup :: [Either a a]

#### Instances

Instances details
 Source # Instance detailsDefined in Data.Group.Free Methods(>>=) :: FreeGroup a -> (a -> FreeGroup b) -> FreeGroup b #(>>) :: FreeGroup a -> FreeGroup b -> FreeGroup b #return :: a -> FreeGroup a # Source # Instance detailsDefined in Data.Group.Free Methodsfmap :: (a -> b) -> FreeGroup a -> FreeGroup b #(<$) :: a -> FreeGroup b -> FreeGroup a # Source # Instance detailsDefined in Data.Group.Free Methodspure :: a -> FreeGroup a #(<*>) :: FreeGroup (a -> b) -> FreeGroup a -> FreeGroup b #liftA2 :: (a -> b -> c) -> FreeGroup a -> FreeGroup b -> FreeGroup c #(*>) :: FreeGroup a -> FreeGroup b -> FreeGroup b #(<*) :: FreeGroup a -> FreeGroup b -> FreeGroup a # Source # Instance detailsDefined in Data.Group.Free Methods(<|>) :: FreeGroup a -> FreeGroup a -> FreeGroup a #some :: FreeGroup a -> FreeGroup [a] #many :: FreeGroup a -> FreeGroup [a] # Source # Instance detailsDefined in Control.Applicative.Cancelative Methods Source # Instance detailsDefined in Data.Group.Foldable MethodsgoldMap :: Group g => (a -> g) -> FreeGroup a -> g Source #toFG :: FreeGroup a -> FG a Source # Eq a => Eq (FreeGroup a) Source # Instance detailsDefined in Data.Group.Free Methods(==) :: FreeGroup a -> FreeGroup a -> Bool #(/=) :: FreeGroup a -> FreeGroup a -> Bool # Ord a => Ord (FreeGroup a) Source # Instance detailsDefined in Data.Group.Free Methodscompare :: FreeGroup a -> FreeGroup a -> Ordering #(<) :: FreeGroup a -> FreeGroup a -> Bool #(<=) :: FreeGroup a -> FreeGroup a -> Bool #(>) :: FreeGroup a -> FreeGroup a -> Bool #(>=) :: FreeGroup a -> FreeGroup a -> Bool #max :: FreeGroup a -> FreeGroup a -> FreeGroup a #min :: FreeGroup a -> FreeGroup a -> FreeGroup a # Show a => Show (FreeGroup a) Source # Instance detailsDefined in Data.Group.Free MethodsshowsPrec :: Int -> FreeGroup a -> ShowS #show :: FreeGroup a -> String #showList :: [FreeGroup a] -> ShowS # Source # Instance detailsDefined in Data.Group.Free Methods(<>) :: FreeGroup a -> FreeGroup a -> FreeGroup a #sconcat :: NonEmpty (FreeGroup a) -> FreeGroup a #stimes :: Integral b => b -> FreeGroup a -> FreeGroup a # Source # Instance detailsDefined in Data.Group.Free Methodsmappend :: FreeGroup a -> FreeGroup a -> FreeGroup a #mconcat :: [FreeGroup a] -> FreeGroup a # Source # Instance detailsDefined in Data.Group.Free Methodsgtimes :: Integral n => n -> FreeGroup a -> FreeGroup a Source #minus :: FreeGroup a -> FreeGroup a -> FreeGroup a Source # ## Free group combinators simplify :: Eq a => FreeGroup a -> FreeGroup a Source # O(n) Simplifies a word in a free group. ### Examples: Expand >>> simplify$ FreeGroup [Right 'a', Left 'b', Right 'c', Left 'c', Right 'b', Right 'a']
FreeGroup {runFreeGroup = [Right 'a',Right 'a']}


interpret :: Group g => FreeGroup g -> g Source #

O(n) Interpret a word in a free group over some group g as an element in a group g.

interpret' :: Group g => FreeGroup g -> g Source #

O(n) Strict variant of interpret.

present :: Group g => FreeGroup g -> (FreeGroup g -> g) -> g Source #

Present a Group as a FreeGroup modulo relations.

# Free abelian groups

newtype FreeAbelianGroup a Source #

A representation of a free abelian group over an alphabet a.

The intuition here is group elements correspond with their positive or negative multiplicities, and as such are simplified by construction.

Constructors

 FreeAbelianGroup FieldsrunFreeAbelian :: Map a Int

#### Instances

Instances details
 Eq a => Eq (FreeAbelianGroup a) Source # Instance detailsDefined in Data.Group.Free Methods Ord a => Ord (FreeAbelianGroup a) Source # Instance detailsDefined in Data.Group.Free Methods(<) :: FreeAbelianGroup a -> FreeAbelianGroup a -> Bool #(>) :: FreeAbelianGroup a -> FreeAbelianGroup a -> Bool # Show a => Show (FreeAbelianGroup a) Source # Instance detailsDefined in Data.Group.Free MethodsshowList :: [FreeAbelianGroup a] -> ShowS # Ord a => Semigroup (FreeAbelianGroup a) Source # Instance detailsDefined in Data.Group.Free Methodsstimes :: Integral b => b -> FreeAbelianGroup a -> FreeAbelianGroup a # Ord a => Monoid (FreeAbelianGroup a) Source # Instance detailsDefined in Data.Group.Free Methodsmconcat :: [FreeAbelianGroup a] -> FreeAbelianGroup a # Ord a => Group (FreeAbelianGroup a) Source # Instance detailsDefined in Data.Group.Free Methodsgtimes :: Integral n => n -> FreeAbelianGroup a -> FreeAbelianGroup a Source #

## Free abelian group combinators

abmap :: Ord b => (a -> b) -> FreeAbelianGroup a -> FreeAbelianGroup b Source #

Functorial fmap for a FreeAbelianGroup.

Monadic join for a FreeAbelianGroup.

singleton :: a -> FreeAbelianGroup a Source #

Lift a singular value into a FreeAbelianGroup. Analogous to pure.

abInterpret :: Group g => FreeAbelianGroup g -> g Source #

Interpret a free group as a word in the underlying group g.