HaskellForMaths-0.4.3: Combinatorics, group theory, commutative algebra, non-commutative algebra

Safe HaskellSafe-Infered




newtype Poset t Source

A poset is represented as a pair (set,po), where set is the underlying set of the poset, and po is the partial order relation


Poset ([t], t -> t -> Bool) 


Eq t => Eq (Poset t) 
Show t => Show (Poset t) 

isReflexive :: ([t], t -> t -> Bool) -> BoolSource

isAntisymmetric :: Eq a => ([a], a -> a -> Bool) -> BoolSource

isTransitive :: ([t], t -> t -> Bool) -> BoolSource

isPoset :: Eq t => ([t], t -> t -> Bool) -> BoolSource

poset :: Eq t => ([t], t -> t -> Bool) -> Poset tSource

intervals :: Poset t -> [(t, t)]Source

interval :: Poset t -> (t, t) -> [t]Source

chainN :: Int -> Poset IntSource

A chain is a poset in which every pair of elements is comparable (ie either x <= y or y <= x). It is therefore a linear or total order. chainN n is the poset consisting of the numbers [1..n] ordered by (<=)

antichainN :: Int -> Poset IntSource

An antichain is a poset in which distinct elements are incomparable. antichainN n is the poset consisting of [1..n], with x <= y only when x == y.

divides :: Integral a => a -> a -> BoolSource

divisors :: Integral t => t -> [t]Source

posetD :: Int -> Poset IntSource

posetD n is the lattice of (positive) divisors of n

powerset :: [a] -> [[a]]Source

posetB :: Int -> Poset [Int]Source

posetB n is the lattice of subsets of [1..n] ordered by inclusion

partitions :: Eq t => [t] -> [[[t]]]Source

isRefinement :: Ord a => [[a]] -> [[a]] -> BoolSource

posetP :: Int -> Poset [[Int]]Source

posetP n is the lattice of partitions of [1..n] ordered by refinement

intervalPartitions :: (Eq a, Num a) => [a] -> [[[a]]]Source

isInterval :: (Eq a, Num a) => [a] -> BoolSource

intervalPartitions2 :: (Eq a, Num a) => [a] -> [[[a]]]Source

subspaces :: (Eq a, Num a) => [a] -> Int -> [[[a]]]Source

isSubspace :: (Eq a, Num a) => [[a]] -> [[a]] -> BoolSource

posetL :: (Eq fq, FiniteField fq) => Int -> [fq] -> Poset [[fq]]Source

posetL n fq is the lattice of subspaces of the vector space Fq^n, ordered by inclusion. Subspaces are represented by their reduced row echelon form.

subposet :: Poset a -> (a -> Bool) -> Poset aSource

The subposet of a poset satisfying a predicate

dsum :: Poset a -> Poset b -> Poset (Either a b)Source

The direct sum of two posets

dprod :: Poset a -> Poset b -> Poset (a, b)Source

The direct product of two posets

dual :: Poset a -> Poset aSource

The dual of a poset

hasseDigraph :: Eq a => Poset a -> Digraph aSource

Given a poset (X,<=), we say that y covers x, written x -< y, if x < y and there is no z in X with x < z < y. The Hasse digraph of a poset is the digraph whose vertices are the elements of the poset, with an edge between every pair (x,y) with x -< y. The Hasse digraph can be represented diagrammatically as a Hasse diagram, by drawing x below y whenever x -< y.

reachabilityPoset :: Ord a => Digraph a -> Poset aSource

Given a DAG (directed acyclic graph), return the poset consisting of the vertices of the DAG, ordered by reachability. This can be used to recover a poset from its Hasse digraph.

isOrderPreserving :: (a -> b) -> Poset a -> Poset b -> BoolSource

orderIsos01 :: Eq a1 => Poset a -> Poset a1 -> [[(a, a1)]]Source

isOrderIso :: (Eq a, Eq b) => Poset a -> Poset b -> BoolSource

Are the two posets order-isomorphic?

orderIsos :: (Ord a, Ord a1) => Poset a -> Poset a1 -> [[(a, a1)]]Source

orderAuts1 :: Ord a => Poset a -> [[(a, a)]]Source

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

isLinext :: Poset t -> [t] -> BoolSource

A linear extension of a poset is a linear ordering of the elements which extends the partial order. Equivalently, it is an ordering [x1..xn] of the underlying set, such that if xi <= xj then i <= j.

linexts :: Poset a -> [[a]]Source

Linear extensions of a poset