Safe Haskell | Safe-Infered |
---|

A module defining the following Combinatorial Hopf Algebras, together with coalgebra or Hopf algebra morphisms between them:

- Sh, the Shuffle Hopf algebra
- SSym, the Malvenuto-Reutnenauer Hopf algebra of permutations
- YSym, the (dual of the) Loday-Ronco Hopf algebra of binary trees
- QSym, the Hopf algebra of quasi-symmetric functions (having a basis indexed by compositions)
- Sym, the Hopf algebra of symmetric functions (having a basis indexed by integer partitions)
- NSym, the Hopf algebra of non-commutative symmetric functions

- newtype Shuffle a = Sh [a]
- sh :: [a] -> Vect Q (Shuffle a)
- shuffles :: [a] -> [a] -> [[a]]
- deconcatenations :: [a] -> [([a], [a])]
- newtype SSymF = SSymF [Int]
- ssymF :: [Int] -> Vect Q SSymF
- shiftedConcat :: SSymF -> SSymF -> SSymF
- prop_Associative :: Eq t => (t -> t -> t) -> (t, t, t) -> Bool
- flatten :: (Enum t, Num t, Ord a) => [a] -> [t]
- newtype SSymM = SSymM [Int]
- ssymM :: [Int] -> Vect Q SSymM
- inversions :: (Enum t, Num t, Ord a) => [a] -> [(t, t)]
- weakOrder :: (Ord a1, Ord a) => [a] -> [a1] -> Bool
- mu :: (Eq a, Num a1) => ([a], a -> a -> Bool) -> a -> a -> a1
- ssymMtoF :: (Eq k, Num k) => Vect k SSymM -> Vect k SSymF
- ssymFtoM :: (Eq k, Num k) => Vect k SSymF -> Vect k SSymM
- ssymFtoDual :: (Eq k, Num k) => Vect k SSymF -> Vect k (Dual SSymF)
- data PBT a
- newtype YSymF a = YSymF (PBT a)
- ysymF :: PBT a -> Vect Q (YSymF a)
- nodecount :: Num a => PBT t -> a
- leafcount :: Num a => PBT t -> a
- prefix :: PBT a -> [a]
- shapeSignature :: Num t => PBT t1 -> [t]
- nodeCountTree :: Num a => PBT t -> PBT a
- leafCountTree :: Num a => PBT t -> PBT a
- lrCountTree :: Num a => PBT t -> PBT (a, a)
- shape :: PBT a -> PBT ()
- numbered :: Num a => PBT t -> PBT a
- splits :: PBT a -> [(PBT a, PBT a)]
- multisplits :: (Eq a, Num a) => a -> PBT a1 -> [[PBT a1]]
- graft :: [PBT a] -> PBT a -> PBT a
- newtype YSymM = YSymM (PBT ())
- ysymM :: PBT () -> Vect Q YSymM
- trees :: Int -> [PBT ()]
- tamariCovers :: PBT a -> [PBT a]
- tamariUpSet :: Ord a => PBT a -> [PBT a]
- tamariOrder :: PBT a -> PBT a -> Bool
- ysymMtoF :: (Eq k, Num k) => Vect k YSymM -> Vect k (YSymF ())
- ysymFtoM :: (Eq k, Num k) => Vect k (YSymF ()) -> Vect k YSymM
- compositions :: Int -> [[Int]]
- quasiShuffles :: [Int] -> [Int] -> [[Int]]
- newtype QSymM = QSymM [Int]
- qsymM :: [Int] -> Vect Q QSymM
- coarsenings :: Num a => [a] -> [[a]]
- refinements :: [Int] -> [[Int]]
- newtype QSymF = QSymF [Int]
- qsymF :: [Int] -> Vect Q QSymF
- qsymMtoF :: (Eq k, Num k) => Vect k QSymM -> Vect k QSymF
- qsymFtoM :: (Eq k, Num k) => Vect k QSymF -> Vect k QSymM
- xvars :: (Enum a, Num a, Show a) => a -> [GlexPoly Q [Char]]
- qsymPoly :: Int -> [Int] -> GlexPoly Q String
- newtype SymM = SymM [Int]
- symM :: [Int] -> Vect Q SymM
- compositionsFromPartition :: Eq a => [a] -> [[a]]
- symMult :: [Int] -> [Int] -> [[Int]]
- newtype SymE = SymE [Int]
- symE :: [Int] -> Vect Q SymE
- symEtoM :: (Eq k, Num k) => Vect k SymE -> Vect k SymM
- newtype SymH = SymH [Int]
- symH :: [Int] -> Vect Q SymH
- symHtoM :: (Eq k, Num k) => Vect k SymH -> Vect k SymM
- newtype NSym = NSym [Int]
- nsym :: [Int] -> Vect Q NSym
- descendingTree :: Ord t => [t] -> PBT t
- descendingTreeMap :: (Eq k, Num k) => Vect k SSymF -> Vect k (YSymF ())
- minPerm :: Num a => PBT t -> [a]
- maxPerm :: Num a => PBT t -> [a]
- leftLeafComposition :: PBT t -> [Int]
- leftLeafComposition' :: YSymF t -> QSymF
- leftLeafCompositionMap :: (Eq k, Num k) => Vect k (YSymF a) -> Vect k QSymF
- descents :: Ord b => [b] -> [Int]
- descentComposition :: Ord b => [b] -> [Int]
- descentMap :: (Eq k, Num k) => Vect k SSymF -> Vect k QSymF
- underComposition :: QSymF -> SSymF
- under :: PBT a -> PBT a -> PBT a
- isUnderIrreducible :: PBT t -> Bool
- underDecomposition :: PBT a -> [PBT a]
- ysymmToSh :: Functor f => f YSymM -> f (Shuffle (PBT ()))
- symToQSymM :: (Eq k, Num k) => Vect k SymM -> Vect k QSymM
- nsymToSymH :: (Eq k, Num k) => Vect k NSym -> Vect k SymH
- nsymToSSym :: (Eq k, Num k) => Vect k NSym -> Vect k SSymF

# Documentation

A basis for the shuffle algebra. As a vector space, the shuffle algebra is identical to the tensor algebra. However, we consider a different algebra structure, based on the shuffle product. Together with the deconcatenation coproduct, this leads to a Hopf algebra structure.

Sh [a] |

deconcatenations :: [a] -> [([a], [a])]Source

The fundamental basis for the Malvenuto-Reutenauer Hopf algebra of permutations, SSym.

Eq SSymF | |

Ord SSymF | |

Show SSymF | |

HasInverses SSymF | |

(Eq k, Num k) => HopfAlgebra k SSymF | |

(Eq k, Num k) => Bialgebra k SSymF | |

(Eq k, Num k) => Coalgebra k SSymF | |

(Eq k, Num k) => Algebra k SSymF | |

(Eq k, Num k) => HasPairing k SSymF SSymF | A pairing showing that SSym is self-adjoint |

(Eq k, Num k) => HasPairing k SSymF (Dual SSymF) | |

(Eq k, Num k) => HopfAlgebra k (Dual SSymF) | |

(Eq k, Num k) => Bialgebra k (Dual SSymF) | |

(Eq k, Num k) => Coalgebra k (Dual SSymF) | |

(Eq k, Num k) => Algebra k (Dual SSymF) |

ssymF :: [Int] -> Vect Q SSymFSource

Construct a fundamental basis element in SSym. The list of ints must be a permutation of [1..n], eg [1,2], [3,4,2,1].

shiftedConcat :: SSymF -> SSymF -> SSymFSource

prop_Associative :: Eq t => (t -> t -> t) -> (t, t, t) -> BoolSource

An alternative "monomial" basis for the Malvenuto-Reutenauer Hopf algebra of permutations, SSym. This basis is related to the fundamental basis by Mobius inversion in the poset of permutations with the weak order.

ssymM :: [Int] -> Vect Q SSymMSource

Construct a monomial basis element in SSym. The list of ints must be a permutation of [1..n], eg [1,2], [3,4,2,1].

inversions :: (Enum t, Num t, Ord a) => [a] -> [(t, t)]Source

ssymMtoF :: (Eq k, Num k) => Vect k SSymM -> Vect k SSymFSource

Convert an element of SSym represented in the monomial basis to the fundamental basis

ssymFtoM :: (Eq k, Num k) => Vect k SSymF -> Vect k SSymMSource

Convert an element of SSym represented in the fundamental basis to the monomial basis

ssymFtoDual :: (Eq k, Num k) => Vect k SSymF -> Vect k (Dual SSymF)Source

The isomorphism from SSym to its dual that takes a permutation in the fundamental basis to its inverse in the dual basis

A type for (rooted) planar binary trees. The basis elements of the Loday-Ronco Hopf algebra are indexed by these.

Although the trees are labelled, we're really only interested in the shapes of the trees, and hence in the type PBT (). The Algebra, Coalgebra and HopfAlgebra instances all ignore the labels. However, it is convenient to allow labels, as they can be useful for seeing what is going on, and they also make it possible to define various ways to create trees from lists of labels.

The fundamental basis for (the dual of) the Loday-Ronco Hopf algebra of binary trees, YSym.

ysymF :: PBT a -> Vect Q (YSymF a)Source

Construct the element of YSym in the fundamental basis indexed by the given tree

shapeSignature :: Num t => PBT t1 -> [t]Source

nodeCountTree :: Num a => PBT t -> PBT aSource

leafCountTree :: Num a => PBT t -> PBT aSource

lrCountTree :: Num a => PBT t -> PBT (a, a)Source

An alternative "monomial" basis for (the dual of) the Loday-Ronco Hopf algebra of binary trees, YSym.

ysymM :: PBT () -> Vect Q YSymMSource

Construct the element of YSym in the monomial basis indexed by the given tree

tamariCovers :: PBT a -> [PBT a]Source

The covering relation for the Tamari partial order on binary trees

tamariUpSet :: Ord a => PBT a -> [PBT a]Source

The up-set of a binary tree in the Tamari partial order

tamariOrder :: PBT a -> PBT a -> BoolSource

The Tamari partial order on binary trees. This is only defined between trees of the same size (number of nodes). The result between trees of different sizes is undefined (we don't check).

ysymMtoF :: (Eq k, Num k) => Vect k YSymM -> Vect k (YSymF ())Source

Convert an element of YSym represented in the monomial basis to the fundamental basis

ysymFtoM :: (Eq k, Num k) => Vect k (YSymF ()) -> Vect k YSymMSource

Convert an element of YSym represented in the fundamental basis to the monomial basis

compositions :: Int -> [[Int]]Source

List the compositions of an integer n. For example, the compositions of 4 are [[1,1,1,1],[1,1,2],[1,2,1],[1,3],[2,1,1],[2,2],[3,1],[4]]

quasiShuffles :: [Int] -> [Int] -> [[Int]]Source

A type for the monomial basis for the quasi-symmetric functions, indexed by compositions.

Eq QSymM | |

Ord QSymM | |

Show QSymM | |

(Eq k, Num k) => HopfAlgebra k QSymM | |

(Eq k, Num k) => Bialgebra k QSymM | |

(Eq k, Num k) => Coalgebra k QSymM | |

(Eq k, Num k) => Algebra k QSymM | |

(Eq k, Num k) => HasPairing k NSym QSymM | A duality pairing between NSym and QSymM (monomial basis), showing that NSym and QSym are dual. |

qsymM :: [Int] -> Vect Q QSymMSource

Construct the element of QSym in the monomial basis indexed by the given composition

coarsenings :: Num a => [a] -> [[a]]Source

refinements :: [Int] -> [[Int]]Source

A type for the fundamental basis for the quasi-symmetric functions, indexed by compositions.

qsymF :: [Int] -> Vect Q QSymFSource

Construct the element of QSym in the fundamental basis indexed by the given composition

qsymMtoF :: (Eq k, Num k) => Vect k QSymM -> Vect k QSymFSource

Convert an element of QSym represented in the monomial basis to the fundamental basis

qsymFtoM :: (Eq k, Num k) => Vect k QSymF -> Vect k QSymMSource

Convert an element of QSym represented in the fundamental basis to the monomial basis

qsymPoly :: Int -> [Int] -> GlexPoly Q StringSource

`qsymPoly n is`

is the quasi-symmetric polynomial in n variables for the indices is. (This corresponds to the
monomial basis for QSym.) For example, qsymPoly 3 [2,1] == x1^2*x2+x1^2*x3+x2^2*x3.

A type for the monomial basis for Sym, the Hopf algebra of symmetric functions, indexed by integer partitions

symM :: [Int] -> Vect Q SymMSource

Construct the element of Sym in the monomial basis indexed by the given integer partition

compositionsFromPartition :: Eq a => [a] -> [[a]]Source

symEtoM :: (Eq k, Num k) => Vect k SymE -> Vect k SymMSource

Convert from the elementary to the monomial basis of Sym

symHtoM :: (Eq k, Num k) => Vect k SymH -> Vect k SymMSource

Convert from the complete to the monomial basis of Sym

A basis for NSym, the Hopf algebra of non-commutative symmetric functions, indexed by compositions

descendingTree :: Ord t => [t] -> PBT tSource

descendingTreeMap :: (Eq k, Num k) => Vect k SSymF -> Vect k (YSymF ())Source

Given a permutation p of [1..n], we can construct a tree (the descending tree of p) as follows:

- Split the permutation as p = ls ++ [n] ++ rs
- Place n at the root of the tree, and recursively place the descending trees of ls and rs as the left and right children of the root
- To bottom out the recursion, the descending tree of the empty permutation is of course the empty tree

This map between bases SSymF -> YSymF turns out to induce a morphism of Hopf algebras.

leftLeafComposition :: PBT t -> [Int]Source

leftLeafComposition' :: YSymF t -> QSymFSource

leftLeafCompositionMap :: (Eq k, Num k) => Vect k (YSymF a) -> Vect k QSymFSource

A Hopf algebra morphism from YSymF to QSymF

descentComposition :: Ord b => [b] -> [Int]Source

descentMap :: (Eq k, Num k) => Vect k SSymF -> Vect k QSymFSource

Given a permutation of [1..n], its descents are those positions where the next number is less than the previous number. For example, the permutation [2,3,5,1,6,4] has descents from 5 to 1 and from 6 to 4. The descents can be regarded as cutting the permutation sequence into segments - 235-16-4 - and by counting the lengths of the segments, we get a composition 3+2+1. This map between bases SSymF -> QSymF turns out to induce a morphism of Hopf algebras.

underComposition :: QSymF -> SSymFSource

isUnderIrreducible :: PBT t -> BoolSource

underDecomposition :: PBT a -> [PBT a]Source

symToQSymM :: (Eq k, Num k) => Vect k SymM -> Vect k QSymMSource

The injection of Sym into QSym (defined over the monomial basis)