Safe Haskell | None |
---|---|
Language | Haskell98 |
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
Synopsis
- class Graded b where
- class (Eq k, Num k, Ord b, Graded b, HopfAlgebra k b) => CombinatorialHopfAlgebra k b where
- gradedConnectedAntipode :: (Eq k, Num k, Ord b, Bialgebra k b, Graded b) => Vect k b -> Vect k b
- 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 a => (a -> a -> a) -> (a, a, a) -> Bool
- flatten :: (Num a1, Enum a1, Ord a2) => [a2] -> [a1]
- newtype SSymM = SSymM [Int]
- ssymM :: [Int] -> Vect Q SSymM
- inversions :: (Num b, Enum b, Ord a) => [a] -> [(b, b)]
- weakOrder :: (Ord a1, Ord a2) => [a1] -> [a2] -> Bool
- mu :: (Num p, Eq t) => ([t], t -> t -> Bool) -> t -> t -> p
- 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 p => PBT a -> p
- leafcount :: Num p => PBT a -> p
- prefix :: PBT a -> [a]
- shapeSignature :: Num a1 => PBT a2 -> [a1]
- nodeCountTree :: Num a1 => PBT a2 -> PBT a1
- leafCountTree :: Num a1 => PBT a2 -> PBT a1
- lrCountTree :: Num b => PBT a -> PBT (b, b)
- shape :: PBT a -> PBT ()
- numbered :: Num a1 => PBT a2 -> PBT a1
- splits :: PBT a -> [(PBT a, PBT a)]
- multisplits :: (Eq t, Num t) => t -> PBT a -> [[PBT a]]
- 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
- 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 a => [a] -> PBT a
- descendingTreeMap :: (Eq k, Num k) => Vect k SSymF -> Vect k (YSymF ())
- minPerm :: Num a1 => PBT a2 -> [a1]
- maxPerm :: Num a1 => PBT a2 -> [a1]
- leftLeafComposition :: PBT a -> [Int]
- leftLeafComposition' :: YSymF a -> QSymF
- leftLeafCompositionMap :: (Eq k, Num k) => Vect k (YSymF a) -> Vect k QSymF
- descents :: Ord a => [a] -> [Int]
- descentComposition :: (Ord a1, Num a2) => [a1] -> [a2]
- descentMap :: (Eq k, Num k) => Vect k SSymF -> Vect k QSymF
- underComposition :: QSymF -> SSymF
- under :: PBT a -> PBT a -> PBT a
- isUnderIrreducible :: PBT a -> 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
class (Eq k, Num k, Ord b, Graded b, HopfAlgebra k b) => CombinatorialHopfAlgebra k b where Source #
gradedConnectedAntipode :: (Eq k, Num k, Ord b, Bialgebra k b, Graded b) => Vect k b -> Vect k b Source #
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] |
Instances
(Eq k, Num k, Ord a) => HopfAlgebra k (Shuffle a) Source # | |
(Eq k, Num k, Ord a) => Bialgebra k (Shuffle a) Source # | |
Defined in Math.Combinatorics.CombinatorialHopfAlgebra | |
(Eq k, Num k, Ord a) => Coalgebra k (Shuffle a) Source # | |
(Eq k, Num k, Ord a) => Algebra k (Shuffle a) Source # | |
Eq a => Eq (Shuffle a) Source # | |
Ord a => Ord (Shuffle a) Source # | |
Defined in Math.Combinatorics.CombinatorialHopfAlgebra | |
Show a => Show (Shuffle a) Source # | |
Graded (Shuffle a) Source # | |
deconcatenations :: [a] -> [([a], [a])] Source #
The fundamental basis for the Malvenuto-Reutenauer Hopf algebra of permutations, SSym.
Instances
Eq SSymF Source # | |
Ord SSymF Source # | |
Show SSymF Source # | |
HasInverses SSymF Source # | |
Graded SSymF Source # | |
(Eq k, Num k) => HopfAlgebra k SSymF Source # | |
(Eq k, Num k) => Bialgebra k SSymF Source # | |
Defined in Math.Combinatorics.CombinatorialHopfAlgebra | |
(Eq k, Num k) => Coalgebra k SSymF Source # | |
(Eq k, Num k) => Algebra k SSymF Source # | |
(Eq k, Num k) => HasPairing k SSymF SSymF Source # | A pairing showing that SSym is self-adjoint |
(Eq k, Num k) => HasPairing k SSymF (Dual SSymF) Source # | |
(Eq k, Num k) => HopfAlgebra k (Dual SSymF) Source # | |
(Eq k, Num k) => Bialgebra k (Dual SSymF) Source # | |
Defined in Math.Combinatorics.CombinatorialHopfAlgebra | |
(Eq k, Num k) => Coalgebra k (Dual SSymF) Source # | |
(Eq k, Num k) => Algebra k (Dual SSymF) Source # | |
ssymF :: [Int] -> Vect Q SSymF Source #
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].
prop_Associative :: Eq a => (a -> a -> a) -> (a, a, a) -> Bool Source #
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.
Instances
Eq SSymM Source # | |
Ord SSymM Source # | |
Show SSymM Source # | |
Graded SSymM Source # | |
(Eq k, Num k) => HopfAlgebra k SSymM Source # | |
(Eq k, Num k) => Bialgebra k SSymM Source # | |
Defined in Math.Combinatorics.CombinatorialHopfAlgebra | |
(Eq k, Num k) => Coalgebra k SSymM Source # | |
(Eq k, Num k) => Algebra k SSymM Source # | |
ssymM :: [Int] -> Vect Q SSymM Source #
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].
ssymMtoF :: (Eq k, Num k) => Vect k SSymM -> Vect k SSymF Source #
Convert an element of SSym represented in the monomial basis to the fundamental basis
ssymFtoM :: (Eq k, Num k) => Vect k SSymF -> Vect k SSymM Source #
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.
Instances
Functor YSymF Source # | |
(Eq k, Num k, Ord a) => HopfAlgebra k (YSymF a) Source # | |
(Eq k, Num k, Ord a) => Bialgebra k (YSymF a) Source # | |
Defined in Math.Combinatorics.CombinatorialHopfAlgebra | |
(Eq k, Num k, Ord a) => Coalgebra k (YSymF a) Source # | |
(Eq k, Num k, Ord a) => Algebra k (YSymF a) Source # | |
Eq a => Eq (YSymF a) Source # | |
Ord a => Ord (YSymF a) Source # | |
Defined in Math.Combinatorics.CombinatorialHopfAlgebra | |
Show a => Show (YSymF a) Source # | |
Graded (YSymF a) Source # | |
ysymF :: PBT a -> Vect Q (YSymF a) Source #
Construct the element of YSym in the fundamental basis indexed by the given tree
shapeSignature :: Num a1 => PBT a2 -> [a1] Source #
An alternative "monomial" basis for (the dual of) the Loday-Ronco Hopf algebra of binary trees, YSym.
Instances
Eq YSymM Source # | |
Ord YSymM Source # | |
Show YSymM Source # | |
Graded YSymM Source # | |
(Eq k, Num k) => HopfAlgebra k YSymM Source # | |
(Eq k, Num k) => Bialgebra k YSymM Source # | |
Defined in Math.Combinatorics.CombinatorialHopfAlgebra | |
(Eq k, Num k) => Coalgebra k YSymM Source # | |
(Eq k, Num k) => Algebra k YSymM Source # | |
ysymM :: PBT () -> Vect Q YSymM Source #
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 -> Bool Source #
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 YSymM Source #
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]]
A type for the monomial basis for the quasi-symmetric functions, indexed by compositions.
Instances
Eq QSymM Source # | |
Ord QSymM Source # | |
Show QSymM Source # | |
Graded QSymM Source # | |
(Eq k, Num k) => HopfAlgebra k QSymM Source # | |
(Eq k, Num k) => Bialgebra k QSymM Source # | |
Defined in Math.Combinatorics.CombinatorialHopfAlgebra | |
(Eq k, Num k) => Coalgebra k QSymM Source # | |
(Eq k, Num k) => Algebra k QSymM Source # | |
(Eq k, Num k) => HasPairing k NSym QSymM Source # | A duality pairing between NSym and QSymM (monomial basis), showing that NSym and QSym are dual. |
qsymM :: [Int] -> Vect Q QSymM Source #
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.
Instances
Eq QSymF Source # | |
Ord QSymF Source # | |
Show QSymF Source # | |
Graded QSymF Source # | |
(Eq k, Num k) => HopfAlgebra k QSymF Source # | |
(Eq k, Num k) => Bialgebra k QSymF Source # | |
Defined in Math.Combinatorics.CombinatorialHopfAlgebra | |
(Eq k, Num k) => Coalgebra k QSymF Source # | |
(Eq k, Num k) => Algebra k QSymF Source # | |
qsymF :: [Int] -> Vect Q QSymF Source #
Construct the element of QSym in the fundamental basis indexed by the given composition
qsymMtoF :: (Eq k, Num k) => Vect k QSymM -> Vect k QSymF Source #
Convert an element of QSym represented in the monomial basis to the fundamental basis
qsymFtoM :: (Eq k, Num k) => Vect k QSymF -> Vect k QSymM Source #
Convert an element of QSym represented in the fundamental basis to the monomial basis
qsymPoly :: Int -> [Int] -> GlexPoly Q String Source #
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
Instances
Eq SymM Source # | |
Ord SymM Source # | |
Show SymM Source # | |
Graded SymM Source # | |
(Eq k, Num k) => HopfAlgebra k SymM Source # | |
(Eq k, Num k) => Bialgebra k SymM Source # | |
Defined in Math.Combinatorics.CombinatorialHopfAlgebra | |
(Eq k, Num k) => Coalgebra k SymM Source # | |
(Eq k, Num k) => Algebra k SymM Source # | |
(Eq k, Num k) => HasPairing k SymH SymM Source # | A duality pairing between the complete and monomial bases of Sym, showing that Sym is self-dual. |
symM :: [Int] -> Vect Q SymM Source #
Construct the element of Sym in the monomial basis indexed by the given integer partition
compositionsFromPartition :: Eq a => [a] -> [[a]] Source #
The elementary basis for Sym, the Hopf algebra of symmetric functions. Defined informally as > symE [n] = symM (replicate n 1) > symE lambda = product [symE [p] | p <- lambda]
symEtoM :: (Eq k, Num k) => Vect k SymE -> Vect k SymM Source #
Convert from the elementary to the monomial basis of Sym
The complete basis for Sym, the Hopf algebra of symmetric functions. Defined informally as > symH [n] = sum [symM lambda | lambda <- integerPartitions n] -- == all monomials of weight n > symH lambda = product [symH [p] | p <- lambda]
Instances
Eq SymH Source # | |
Ord SymH Source # | |
Show SymH Source # | |
(Eq k, Num k) => Bialgebra k SymH Source # | |
Defined in Math.Combinatorics.CombinatorialHopfAlgebra | |
(Eq k, Num k) => Coalgebra k SymH Source # | |
(Eq k, Num k) => Algebra k SymH Source # | |
(Eq k, Num k) => HasPairing k SymH SymM Source # | A duality pairing between the complete and monomial bases of Sym, showing that Sym is self-dual. |
symHtoM :: (Eq k, Num k) => Vect k SymH -> Vect k SymM Source #
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
Instances
Eq NSym Source # | |
Ord NSym Source # | |
Show NSym Source # | |
Graded NSym Source # | |
(Eq k, Num k) => HopfAlgebra k NSym Source # | |
(Eq k, Num k) => Bialgebra k NSym Source # | |
Defined in Math.Combinatorics.CombinatorialHopfAlgebra | |
(Eq k, Num k) => Coalgebra k NSym Source # | |
(Eq k, Num k) => Algebra k NSym Source # | |
(Eq k, Num k) => HasPairing k NSym QSymM Source # | A duality pairing between NSym and QSymM (monomial basis), showing that NSym and QSym are dual. |
descendingTree :: Ord a => [a] -> PBT a Source #
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 a -> [Int] Source #
leftLeafComposition' :: YSymF a -> QSymF Source #
leftLeafCompositionMap :: (Eq k, Num k) => Vect k (YSymF a) -> Vect k QSymF Source #
A Hopf algebra morphism from YSymF to QSymF
descentComposition :: (Ord a1, Num a2) => [a1] -> [a2] Source #
descentMap :: (Eq k, Num k) => Vect k SSymF -> Vect k QSymF Source #
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 -> SSymF Source #
isUnderIrreducible :: PBT a -> Bool Source #
underDecomposition :: PBT a -> [PBT a] Source #
symToQSymM :: (Eq k, Num k) => Vect k SymM -> Vect k QSymM Source #
The injection of Sym into QSym (defined over the monomial basis)