This is Posets.info, produced by Macaulay2, version 1.22

Posets -- a package for working with partially ordered sets
***********************************************************

Description
===========

This package defines Poset, as a new data type and provides
routines which use or produce posets.  A poset (partially ordered set) is a set
together with a binary relation satisfying reflexivity, antisymmetry, and
transitivity.

Contributors:

The following people have generously contributed code to the package: Kristine
Fisher (see http://www.math.cornell.edu/People/Grads/fisher.html ), Andrew
Hoefel (see http://www.mathstat.dal.ca/~handrew/ ), Manoj Kummini (see
http://www.math.purdue.edu/~nkummini/ ), Stephen Sturgeon, and Josephine Yu
(see http://people.math.gatech.edu/~jyu67/Josephine_Yu/Main.html ).

Other acknowledgements:

A few methods in this package have been ported from John Stembridge's Maple
package implementing posets, which is available at
http://www.math.lsa.umich.edu/~jrs/maple.html#posets.  Such methods are noted
both in the source code and in the documentation.

See also
========

  * Example_colon_ Constructing common posets
  * Example_colon_ Hibi ideals
  * Example_colon_ Intersection lattices
  * Example_colon_ LCM-lattices

Authors
=======

  * David Cook II (see http://ux1.eiu.edu/~dwcook/ ) <dwcook@eiu.edu>
  * Sonja Mapes (see http://www.nd.edu/~smapes1/ ) <smapes1@nd.edu>
  * Gwyn Whieldon (see http://www.hood.edu/Academics/Departments/Mathematics/
    Faculty/Gwyneth-Whieldon.html ) <whieldon@hood.edu>

Certification a gold star
=========================

Version 1.1.2 of this package was accepted for publication in volume 7 (see
http://msp.org/jsag/2015/7-1/ ) of The Journal of Software for Algebra and
Geometry (see http://j-sag.org/ ) on 5 June 2015, in the article Partially
ordered sets in Macaulay2 (see http://msp.org/jsag/2015/7-1/p02.xhtml ). That
version can be obtained from the journal (see
http://msp.org/jsag/2015/7-1/jsag-v7-n1-x02-Posets.m2 ) or from the Macaulay2
source code repository (see
https://github.com/Macaulay2/M2/blob/3a8d880a524f36a9668750375bb6079a7b00ea0f/
M2/Macaulay2/packages/Posets.m2 ).

Version
=======

This documentation describes version 1.1.3 of Posets.

Source code
===========

The source code from which this documentation is derived is in the file
Posets.m2 (see common/share/Macaulay2/Posets.m2 ).

Exports
=======

  * Types
      * "NCPartition" -- see ncPartitions, -- generates the
        non-crossing partitions of size $n$
      * Poset -- a class for partially ordered sets (posets)
  * Functions and commands
      * adjoinMax -- computes the poset with a new maximum
        element
      * adjoinMin -- computes the poset with a new minimum
        element
      * allRelations -- computes all relations of a poset
      * antichains -- computes all antichains of a poset
      * areIsomorphic -- determines if two posets are
        isomorphic
      * atoms -- computes the list of elements covering the
        minimal elements of a poset
      * augmentPoset -- computes the poset with an
        adjoined minimum and maximum
      * booleanLattice -- generates the boolean lattice
        on $n$ elements
      * boundedRegions -- computes the number of bounded
        regions a hyperplane arrangement divides the space into
      * chain -- generates the chain poset on $n$ elements
      * chains -- computes all chains of a poset
      * characteristicPolynomial -- computes
        the characteristic polynomial of a ranked poset with a unique minimal
        element
      * closedInterval -- computes the subposet
        contained between two points
      * comparabilityGraph -- produces the
        comparability graph of a poset
      * compare -- compares two elements in a poset
      * coveringRelations -- computes the minimal
        list of generating relations of a poset
      * coxeterPolynomial -- computes the Coxeter
        polynomial of a poset
      * degreePolynomial -- computes the degree
        polynomial of a poset
      * diamondProduct -- computes the diamond product
        of two ranked posets
      * dilworthLattice -- computes the Dilworth
        lattice of a poset
      * dilworthNumber -- computes the Dilworth number
        of a poset
      * displayPoset -- generates a PDF representation of
        a poset and attempts to display it
      * distributiveLattice -- computes the lattice
        of order ideals of a poset
      * divisorPoset -- generates the poset of divisors
      * dominanceLattice -- generates the dominance
        lattice of partitions of $n$
      * dropElements -- computes the induced subposet of a
        poset given a list of elements to remove
      * facePoset -- generates the face poset of a simplicial
        complex
      * filter -- computes the elements above given elements in
        a poset
      * filtration -- generates the filtration of a poset
      * flagChains -- computes the maximal chains in a list
        of flags of a ranked poset
      * flagfPolynomial -- computes the flag-f
        polynomial of a ranked poset
      * flaghPolynomial -- computes the flag-h
        polynomial of a ranked poset
      * flagPoset -- computes the subposet of specified ranks
        of a ranked poset
      * fPolynomial -- computes the f-polynomial of a poset
      * gapConvertPoset -- converts between Macaulay2's
        Posets and GAP's Posets
      * greeneKleitmanPartition -- computes the
        Greene-Kleitman partition of a poset
      * hasseDiagram -- produces the Hasse diagram of a
        poset
      * hibiIdeal -- produces the Hibi ideal of a poset
      * hibiRing -- produces the Hibi ring of a poset
      * hPolynomial -- computes the h-polynomial of a poset
      * incomparabilityGraph -- produces the
        incomparability graph of a poset
      * indexLabeling -- relabels a poset with the
        labeling based on the indices of the vertices
      * intersectionLattice -- generates the
        intersection lattice of a hyperplane arrangement
      * isAntichain -- determines if a given list of
        vertices is an antichain of a poset
      * isAtomic -- determines if a lattice is atomic
      * isBounded -- determines if a poset is bounded
      * isComparabilityGraph -- determines if a
        graph is the comparability graph of a poset
      * isDistributive -- determines if a lattice is
        distributive
      * isGeometric -- determines if a lattice is geometric
      * isGraded -- determines if a poset is graded
      * isLattice -- determines if a poset is a lattice
      * isLowerSemilattice -- determines if a poset
        is a lower (or meet) semilattice
      * isLowerSemimodular -- determines if a ranked
        lattice is lower semimodular
      * isModular -- determines if a lattice is modular
      * isomorphism -- computes an isomorphism between
        isomorphic posets
      * isRanked -- determines if a poset is ranked
      * isSperner -- determines if a ranked poset has the
        Sperner property
      * isStrictSperner -- determines if a ranked poset
        has the strict Sperner property
      * isUpperSemilattice -- determines if a poset
        is an upper (or join) semilattice
      * isUpperSemimodular -- determines if a
        lattice is upper semimodular
      * joinExists -- determines if the join exists for two
        elements of a poset
      * joinIrreducibles -- determines the join
        irreducible elements of a poset
      * labelPoset -- relabels a poset with the specified
        labeling
      * lcmLattice -- generates the lattice of lcms in an
        ideal
      * linearExtensions -- computes all linear
        extensions of a poset
      * magnitude -- computes the magnitude of a poset
      * maximalAntichains -- computes all maximal
        antichains of a poset
      * maximalChains -- computes all maximal chains of a
        poset
      * maximalElements -- determines the maximal
        elements of a poset
      * meetExists -- determines if the meet exists for two
        elements of a poset
      * meetIrreducibles -- determines the meet
        irreducible elements of a poset
      * minimalElements -- determines the minimal
        elements of a poset
      * moebiusFunction -- computes the Moebius
        function at every pair of elements of a poset
      * naturalLabeling -- relabels a poset with a
        natural labeling
      * ncPartitions -- generates the non-crossing
        partitions of size $n$
      * ncpLattice -- computes the non-crossing partition
        lattice of set-partitions of size $n$
      * openInterval -- computes the subposet contained
        strictly between two points
      * orderComplex -- produces the order complex of a
        poset
      * orderIdeal -- computes the elements below given
        elements in a poset
      * outputTexPoset -- writes a LaTeX file with a
        TikZ-representation of a poset
      * partitionLattice -- computes the lattice of
        set-partitions of size $n$
      * plueckerPoset -- computes a poset associated to
        the Plücker relations
      * poincarePolynomial -- computes the Poincaré
        polynomial of a ranked poset with a unique minimal element
      * poset -- creates a new Poset object
      * posetJoin -- determines the join for two elements of
        a poset
      * posetMeet -- determines the meet for two elements of
        a poset
      * pPartitionRing -- produces the p-partition ring
        of a poset
      * principalFilter -- computes the elements above
        a given element in a poset
      * principalOrderIdeal -- computes the
        elements below a given element in a poset
      * projectivizeArrangement -- computes the
        intersection poset of a projectivized hyperplane arrangement
      * randomPoset -- generates a random poset with a
        given relation probability
      * rankFunction -- computes the rank function of a
        ranked poset
      * rankGeneratingFunction -- computes the
        rank generating function of a ranked poset
      * rankPoset -- generates a list of lists representing
        the ranks of a ranked poset
      * realRegions -- computes the number of regions a
        hyperplane arrangement divides the space into
      * removeIsomorphicPosets -- returns a
        sub-list of non-isomorphic posets
      * resolutionPoset -- generates a poset from a
        resolution
      * setPartition -- computes the list of
        set-partitions of size $n$
      * setPrecompute -- sets the Precompute
        configuration
      * setSuppressLabels -- sets the SuppressLabels
        configuration
      * standardMonomialPoset -- generates the
        poset of divisibility in the monomial basis of an ideal
      * subposet -- computes the induced subposet of a poset
        given a list of elements
      * texPoset -- generates a string containing a
        TikZ-figure of a poset
      * transitiveClosure -- computes the transitive
        closure of a set of relations
      * transitiveOrientation -- generates a
        poset whose comparability graph is the given graph
      * tuttePolynomial -- computes the Tutte
        polynomial of a poset
      * union -- computes the union of two posets
      * youngSubposet -- generates a subposet of Young's
        lattice
      * zetaPolynomial -- computes the zeta polynomial
        of a poset
  * Methods
      * "adjoinMax(Poset)" -- see adjoinMax, -- computes the
        poset with a new maximum element
      * "adjoinMax(Poset,Thing)" -- see adjoinMax, -- computes
        the poset with a new maximum element
      * "adjoinMin(Poset)" -- see adjoinMin, -- computes the
        poset with a new minimum element
      * "adjoinMin(Poset,Thing)" -- see adjoinMin, -- computes
        the poset with a new minimum element
      * "allRelations(Poset)" -- see allRelations, --
        computes all relations of a poset
      * "allRelations(Poset,Boolean)" -- see allRelations,
        -- computes all relations of a poset
      * "antichains(Poset)" -- see antichains, -- computes
        all antichains of a poset
      * "antichains(Poset,ZZ)" -- see antichains, -- computes
        all antichains of a poset
      * "areIsomorphic(Poset,Poset)" -- see areIsomorphic,
        -- determines if two posets are isomorphic
      * "Poset == Poset" -- see areIsomorphic, --
        determines if two posets are isomorphic
      * "atoms(Poset)" -- see atoms, -- computes the list of
        elements covering the minimal elements of a poset
      * "augmentPoset(Poset)" -- see augmentPoset, --
        computes the poset with an adjoined minimum and maximum
      * "augmentPoset(Poset,Thing,Thing)" -- see augmentPoset,
        -- computes the poset with an adjoined minimum and
        maximum
      * "booleanLattice(ZZ)" -- see booleanLattice, --
        generates the boolean lattice on $n$ elements
      * "boundedRegions(List,Ring)" -- see boundedRegions,
        -- computes the number of bounded regions a hyperplane
        arrangement divides the space into
      * "chain(ZZ)" -- see chain, -- generates the chain poset on
        $n$ elements
      * "chains(Poset)" -- see chains, -- computes all chains of
        a poset
      * "chains(Poset,ZZ)" -- see chains, -- computes all chains
        of a poset
      * "characteristicPolynomial(Poset)" -- see
        characteristicPolynomial, -- computes the
        characteristic polynomial of a ranked poset with a unique minimal
        element
      * "closedInterval(Poset,Thing,Thing)" -- see closedInterval,
        -- computes the subposet contained between two points
      * "comparabilityGraph(Poset)" -- see comparabilityGraph,
        -- produces the comparability graph of a poset
      * "compare(Poset,Thing,Thing)" -- see compare, -- compares
        two elements in a poset
      * connectedComponents(Poset), --
        generates a list of connected components of a poset
      * "coveringRelations(Poset)" -- see coveringRelations,
        -- computes the minimal list of generating relations
        of a poset
      * "coxeterPolynomial(Poset)" -- see coxeterPolynomial,
        -- computes the Coxeter polynomial of a poset
      * "degreePolynomial(Poset)" -- see degreePolynomial,
        -- computes the degree polynomial of a poset
      * "diamondProduct(Poset,Poset)" -- see diamondProduct,
        -- computes the diamond product of two ranked posets
      * "dilworthLattice(Poset)" -- see dilworthLattice,
        -- computes the Dilworth lattice of a poset
      * "dilworthNumber(Poset)" -- see dilworthNumber, --
        computes the Dilworth number of a poset
      * "displayPoset(Poset)" -- see displayPoset, --
        generates a PDF representation of a poset and attempts to display it
      * "distributiveLattice(Poset)" -- see distributiveLattice,
        -- computes the lattice of order ideals of a poset
      * "divisorPoset(ZZ)" -- see divisorPoset, --
        generates the poset of divisors
      * divisorPoset(List,List,PolynomialRing)
        -- generates the poset
        of divisors
      * divisorPoset(RingElement), --
        generates the poset of divisors
      * divisorPoset(RingElement,RingElement)
        -- generates the poset of
        divisors with a lower and upper bound
      * "dominanceLattice(ZZ)" -- see dominanceLattice,
        -- generates the dominance lattice of partitions of $n$
      * "dropElements(Poset,Function)" -- see dropElements,
        -- computes the induced subposet of a poset given a list of elements to
        remove
      * "dropElements(Poset,List)" -- see dropElements, --
        computes the induced subposet of a poset given a list of elements to
        remove
      * "Poset - List" -- see dropElements, -- computes the
        induced subposet of a poset given a list of elements to remove
      * dual(Poset) -- produces the derived poset with
        relations reversed
      * "facePoset(SimplicialComplex)" -- see facePoset, --
        generates the face poset of a simplicial complex
      * "filter(Poset,List)" -- see filter, -- computes the
        elements above given elements in a poset
      * "filtration(Poset)" -- see filtration, -- generates
        the filtration of a poset
      * "flagChains(Poset,List)" -- see flagChains, --
        computes the maximal chains in a list of flags of a ranked poset
      * "flagfPolynomial(Poset)" -- see flagfPolynomial,
        -- computes the flag-f polynomial of a ranked poset
      * "flaghPolynomial(Poset)" -- see flaghPolynomial,
        -- computes the flag-h polynomial of a ranked poset
      * "flagPoset(Poset,List)" -- see flagPoset, -- computes
        the subposet of specified ranks of a ranked poset
      * "fPolynomial(Poset)" -- see fPolynomial, -- computes
        the f-polynomial of a poset
      * "gapConvertPoset(Array)" -- see gapConvertPoset,
        -- converts between Macaulay2's Posets and GAP's Posets
      * "gapConvertPoset(Poset)" -- see gapConvertPoset,
        -- converts between Macaulay2's Posets and GAP's Posets
      * "gapConvertPoset(String)" -- see gapConvertPoset,
        -- converts between Macaulay2's Posets and GAP's
        Posets
      * "greeneKleitmanPartition(Poset)" -- see greeneKleitmanPartition,
        -- computes the Greene-Kleitman partition of a
        poset
      * "hasseDiagram(Poset)" -- see hasseDiagram, --
        produces the Hasse diagram of a poset
      * height(Poset) -- computes the height of a
        poset
      * "hibiIdeal(Poset)" -- see hibiIdeal, -- produces the
        Hibi ideal of a poset
      * "hibiRing(Poset)" -- see hibiRing, -- produces the Hibi
        ring of a poset
      * "hPolynomial(Poset)" -- see hPolynomial, -- computes
        the h-polynomial of a poset
      * "incomparabilityGraph(Poset)" -- see incomparabilityGraph,
        -- produces the incomparability graph of a poset
      * "indexLabeling(Poset)" -- see indexLabeling, --
        relabels a poset with the labeling based on the indices of the vertices
      * "intersectionLattice(List,Ring)" -- see intersectionLattice,
        -- generates the intersection lattice of a
        hyperplane arrangement
      * "isAntichain(Poset,List)" -- see isAntichain, --
        determines if a given list of vertices is an antichain of a poset
      * "isAtomic(Poset)" -- see isAtomic, -- determines if a
        lattice is atomic
      * "isBounded(Poset)" -- see isBounded, -- determines if
        a poset is bounded
      * "isComparabilityGraph(Graph)" -- see isComparabilityGraph,
        -- determines if a graph is the comparability
        graph of a poset
      * isConnected(Poset) -- determines if a
        poset is connected
      * "isDistributive(Poset)" -- see isDistributive, --
        determines if a lattice is distributive
      * isEulerian(Poset) -- determines if a
        ranked poset is Eulerian
      * "isGeometric(Poset)" -- see isGeometric, --
        determines if a lattice is geometric
      * "isGraded(Poset)" -- see isGraded, -- determines if a
        poset is graded
      * "isLattice(Poset)" -- see isLattice, -- determines if
        a poset is a lattice
      * "isLowerSemilattice(Poset)" -- see isLowerSemilattice,
        -- determines if a poset is a lower (or meet)
        semilattice
      * "isLowerSemimodular(Poset)" -- see isLowerSemimodular,
        -- determines if a ranked lattice is lower
        semimodular
      * "isModular(Poset)" -- see isModular, -- determines if
        a lattice is modular
      * "isomorphism(Poset,Poset)" -- see isomorphism, --
        computes an isomorphism between isomorphic posets
      * "isRanked(Poset)" -- see isRanked, -- determines if a
        poset is ranked
      * "isSperner(Poset)" -- see isSperner, -- determines if
        a ranked poset has the Sperner property
      * "isStrictSperner(Poset)" -- see isStrictSperner,
        -- determines if a ranked poset has the strict Sperner property
      * "isUpperSemilattice(Poset)" -- see isUpperSemilattice,
        -- determines if a poset is an upper (or join)
        semilattice
      * "isUpperSemimodular(Poset)" -- see isUpperSemimodular,
        -- determines if a lattice is upper semimodular
      * "joinExists(Poset,Thing,Thing)" -- see joinExists, --
        determines if the join exists for two elements of a poset
      * "joinIrreducibles(Poset)" -- see joinIrreducibles,
        -- determines the join irreducible elements of a
        poset
      * "labelPoset(Poset,HashTable)" -- see labelPoset, --
        relabels a poset with the specified labeling
      * "lcmLattice(Ideal)" -- see lcmLattice, -- generates
        the lattice of lcms in an ideal
      * "linearExtensions(Poset)" -- see linearExtensions,
        -- computes all linear extensions of a poset
      * "magnitude(Poset)" -- see magnitude, -- computes the
        magnitude of a poset
      * "maximalAntichains(Poset)" -- see maximalAntichains,
        -- computes all maximal antichains of a poset
      * "maximalChains(Poset)" -- see maximalChains, --
        computes all maximal chains of a poset
      * "maximalElements(Poset)" -- see maximalElements,
        -- determines the maximal elements of a poset
      * "meetExists(Poset,Thing,Thing)" -- see meetExists, --
        determines if the meet exists for two elements of a poset
      * "meetIrreducibles(Poset)" -- see meetIrreducibles,
        -- determines the meet irreducible elements of a
        poset
      * "minimalElements(Poset)" -- see minimalElements,
        -- determines the minimal elements of a poset
      * "moebiusFunction(Poset)" -- see moebiusFunction,
        -- computes the Moebius function at every pair of elements of a poset
      * "naturalLabeling(Poset)" -- see naturalLabeling,
        -- relabels a poset with a natural labeling
      * "naturalLabeling(Poset,ZZ)" -- see naturalLabeling,
        -- relabels a poset with a natural labeling
      * "ncPartitions(ZZ)" -- see ncPartitions, --
        generates the non-crossing partitions of size $n$
      * "ncpLattice(ZZ)" -- see ncpLattice, -- computes the
        non-crossing partition lattice of set-partitions of size $n$
      * "openInterval(Poset,Thing,Thing)" -- see openInterval,
        -- computes the subposet contained strictly between two
        points
      * "orderComplex(Poset)" -- see orderComplex, --
        produces the order complex of a poset
      * "orderIdeal(Poset,List)" -- see orderIdeal, --
        computes the elements below given elements in a poset
      * "outputTexPoset(Poset,String)" -- see outputTexPoset,
        -- writes a LaTeX file with a TikZ-representation of a
        poset
      * "partitionLattice(ZZ)" -- see partitionLattice,
        -- computes the lattice of set-partitions of size $n$
      * "plueckerPoset(ZZ)" -- see plueckerPoset, --
        computes a poset associated to the Plücker relations
      * "poincare(Poset)" -- see poincarePolynomial,
        -- computes the Poincaré polynomial of a ranked poset with a unique
        minimal element
      * "poincarePolynomial(Poset)" -- see poincarePolynomial,
        -- computes the Poincaré polynomial of a ranked
        poset with a unique minimal element
      * "poset(List)" -- see poset, -- creates a new Poset object
      * "poset(List,Function)" -- see poset, -- creates a new
        Poset object
      * "poset(List,List)" -- see poset, -- creates a new Poset
        object
      * "poset(List,List,Matrix)" -- see poset, -- creates a new
        Poset object
      * Poset _ List -- returns elements of the ground
        set
      * Poset _ ZZ -- returns an element of the ground set
      * Poset _* -- returns the ground set of a poset
      * "vertices(Poset)" -- see Poset _*, -- returns the
        ground set of a poset
      * "posetJoin(Poset,Thing,Thing)" -- see posetJoin, --
        determines the join for two elements of a poset
      * "posetMeet(Poset,Thing,Thing)" -- see posetMeet, --
        determines the meet for two elements of a poset
      * "pPartitionRing(Poset)" -- see pPartitionRing, --
        produces the p-partition ring of a poset
      * "principalFilter(Poset,Thing)" -- see principalFilter,
        -- computes the elements above a given element in a
        poset
      * "principalOrderIdeal(Poset,Thing)" -- see principalOrderIdeal,
        -- computes the elements below a given element in
        a poset
      * "Poset * Poset" -- see product(Poset,Poset),
        -- computes the product of two posets
      * product(Poset,Poset) -- computes the
        product of two posets
      * "projectivizeArrangement(List,Ring)" -- see
        projectivizeArrangement, -- computes the
        intersection poset of a projectivized hyperplane arrangement
      * "randomPoset(List)" -- see randomPoset, -- generates
        a random poset with a given relation probability
      * "randomPoset(ZZ)" -- see randomPoset, -- generates a
        random poset with a given relation probability
      * "rankFunction(Poset)" -- see rankFunction, --
        computes the rank function of a ranked poset
      * "rankGeneratingFunction(Poset)" -- see rankGeneratingFunction,
        -- computes the rank generating function of a
        ranked poset
      * "rank(Poset)" -- see rankPoset, -- generates a list of
        lists representing the ranks of a ranked poset
      * "rankPoset(Poset)" -- see rankPoset, -- generates a
        list of lists representing the ranks of a ranked poset
      * "realRegions(List,Ring)" -- see realRegions, --
        computes the number of regions a hyperplane arrangement divides the
        space into
      * "removeIsomorphicPosets(List)" -- see removeIsomorphicPosets,
        -- returns a sub-list of non-isomorphic posets
      * "resolutionPoset(ChainComplex)" -- see resolutionPoset,
        -- generates a poset from a resolution
      * "resolutionPoset(Ideal)" -- see resolutionPoset,
        -- generates a poset from a resolution
      * "resolutionPoset(MonomialIdeal)" -- see resolutionPoset,
        -- generates a poset from a resolution
      * "setPartition(List)" -- see setPartition, --
        computes the list of set-partitions of size $n$
      * "setPartition(ZZ)" -- see setPartition, -- computes
        the list of set-partitions of size $n$
      * "setPrecompute(Boolean)" -- see setPrecompute, --
        sets the Precompute configuration
      * "setSuppressLabels(Boolean)" -- see setSuppressLabels,
        -- sets the SuppressLabels configuration
      * "standardMonomialPoset(MonomialIdeal)" -- see
        standardMonomialPoset, -- generates the poset of
        divisibility in the monomial basis of an ideal
      * "standardMonomialPoset(MonomialIdeal,ZZ,ZZ)" -- see
        standardMonomialPoset, -- generates the poset of
        divisibility in the monomial basis of an ideal
      * "subposet(Poset,List)" -- see subposet, -- computes the
        induced subposet of a poset given a list of elements
      * "tex(Poset)" -- see texPoset, -- generates a string
        containing a TikZ-figure of a poset
      * "texPoset(Poset)" -- see texPoset, -- generates a
        string containing a TikZ-figure of a poset
      * "transitiveClosure(List,List)" -- see transitiveClosure,
        -- computes the transitive closure of a set of
        relations
      * "transitiveOrientation(Graph)" -- see transitiveOrientation,
        -- generates a poset whose comparability graph
        is the given graph
      * "tuttePolynomial(Poset)" -- see tuttePolynomial,
        -- computes the Tutte polynomial of a poset
      * "Poset + Poset" -- see union, -- computes the union of two
        posets
      * "union(Poset,Poset)" -- see union, -- computes the union
        of two posets
      * "youngSubposet(List)" -- see youngSubposet, --
        generates a subposet of Young's lattice
      * "youngSubposet(List,List)" -- see youngSubposet,
        -- generates a subposet of Young's lattice
      * "youngSubposet(ZZ)" -- see youngSubposet, --
        generates a subposet of Young's lattice
      * "zetaPolynomial(Poset)" -- see zetaPolynomial, --
        computes the zeta polynomial of a poset
  * Symbols
      * "PDFDirectory" -- see displayPoset, -- generates a
        PDF representation of a poset and attempts to display it
      * "OriginalPoset" -- see distributiveLattice,
        -- computes the lattice of order ideals of a poset
      * "GroundSet" -- see Poset, -- a class for partially ordered
        sets (posets)
      * "RelationMatrix" -- see Poset, -- a class for partially
        ordered sets (posets)
      * "Relations" -- see Poset, -- a class for partially ordered
        sets (posets)
      * "AntisymmetryStrategy" -- see poset, -- creates a new
        Poset object
      * Precompute -- a package-wide configuration that
        toggles precomputation
      * "Bias" -- see randomPoset, -- generates a random
        poset with a given relation probability
      * "Jitter" -- see texPoset, -- generates a string
        containing a TikZ-figure of a poset
      * "SuppressLabels" -- see texPoset, -- generates a string
        containing a TikZ-figure of a poset

For the programmer
==================

The object Posets, is a package (Macaulay2Doc).

adjoinMax -- computes the poset with a new maximum element
**********************************************************

Synopsis
========

  * Usage:
        Q = adjoinMax P
        Q = adjoinMax(P, a)
  * Inputs:
      * P, an instance of the type Poset,
      * a, a thing (Macaulay2Doc), the new maximal element of $P$
  * Outputs:
      * Q, an instance of the type Poset,

Description
===========

This method simply creates a new poset $Q$ with the maximal element $a$.  If
$a$ is unspecified, $1$ or $1$ more than the largest integer vertex is used.

+-----------------------------------+
|i1 : P = poset {{1,2},{1,3},{1,4}};|
+-----------------------------------+
|i2 : adjoinMax(P, 100)             |
|                                   |
|o2 = Relation Matrix: | 1 1 1 1 1 ||
|                      | 0 1 0 0 1 ||
|                      | 0 0 1 0 1 ||
|                      | 0 0 0 1 1 ||
|                      | 0 0 0 0 1 ||
|                                   |
|o2 : Poset                         |
+-----------------------------------+

See also
========

  * adjoinMin -- computes the poset with a new minimum
    element
  * augmentPoset -- computes the poset with an adjoined
    minimum and maximum

Ways to use adjoinMax :
=======================

  * "adjoinMax(Poset)"
  * "adjoinMax(Poset,Thing)"

For the programmer
==================

The object adjoinMax, is a method function (Macaulay2Doc).

adjoinMin -- computes the poset with a new minimum element
**********************************************************

Synopsis
========

  * Usage:
        Q = adjoinMin P
        Q = adjoinMin(P, a)
  * Inputs:
      * P, an instance of the type Poset,
      * a, a thing (Macaulay2Doc), the new minimal element of $P$
  * Outputs:
      * Q, an instance of the type Poset,

Description
===========

This method simply creates a new poset $Q$ with the minimal element $a$.  If
$a$ is unspecified, the element $0$ or $1$ less than the smallest integer
vertex is used.

+-----------------------------------+
|i1 : P = poset {{1,4},{2,4},{3,4}};|
+-----------------------------------+
|i2 : adjoinMin(P, 0)               |
|                                   |
|o2 = Relation Matrix: | 1 1 0 0 0 ||
|                      | 0 1 0 0 0 ||
|                      | 0 1 1 0 0 ||
|                      | 0 1 0 1 0 ||
|                      | 1 1 1 1 1 ||
|                                   |
|o2 : Poset                         |
+-----------------------------------+

See also
========

  * adjoinMax -- computes the poset with a new maximum
    element
  * augmentPoset -- computes the poset with an adjoined
    minimum and maximum

Ways to use adjoinMin :
=======================

  * "adjoinMin(Poset)"
  * "adjoinMin(Poset,Thing)"

For the programmer
==================

The object adjoinMin, is a method function (Macaulay2Doc).

allRelations -- computes all relations of a poset
*************************************************

Synopsis
========

  * Usage:
        R = allRelations P
        R = allRelations(P, NoLoops)
  * Inputs:
      * P, an instance of the type Poset,
      * NoLoops, a Boolean value (Macaulay2Doc), whether loops,
        i.e., relations of the form $\{a,a\}$, should be returned
  * Outputs:
      * R, a list (Macaulay2Doc), containing all relations between
        elements of $P$

Description
===========

This method returns all relations of a poset, though loops may be suppressed
with the input NoLoops.

+-----------------------------------------------------------------------------+
|i1 : P = divisorPoset 12;                                                    |
+-----------------------------------------------------------------------------+
|i2 : allRelations P                                                          |
|                                                                             |
|o2 = {{1, 1}, {1, 2}, {1, 3}, {1, 4}, {1, 6}, {1, 12}, {2, 2}, {2, 4}, {2,   |
|     ------------------------------------------------------------------------|
|     6}, {2, 12}, {3, 3}, {3, 6}, {3, 12}, {4, 4}, {4, 12}, {6, 6}, {6, 12}, |
|     ------------------------------------------------------------------------|
|     {12, 12}}                                                               |
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+
|i3 : allRelations(P, true)                                                   |
|                                                                             |
|o3 = {{1, 2}, {1, 3}, {1, 4}, {1, 6}, {1, 12}, {2, 4}, {2, 6}, {2, 12}, {3,  |
|     ------------------------------------------------------------------------|
|     6}, {3, 12}, {4, 12}, {6, 12}}                                          |
|                                                                             |
|o3 : List                                                                    |
+-----------------------------------------------------------------------------+

See also
========

  * compare -- compares two elements in a poset
  * coveringRelations -- computes the minimal list of
    generating relations of a poset

Ways to use allRelations :
==========================

  * "allRelations(Poset)"
  * "allRelations(Poset,Boolean)"

For the programmer
==================

The object allRelations, is a method function (Macaulay2Doc).

antichains -- computes all antichains of a poset
************************************************

Synopsis
========

  * Usage:
        L = antichains P
  * Inputs:
      * P, an instance of the type Poset,
      * k, an integer (Macaulay2Doc), if specified length of returned
        antichains
  * Outputs:
      * L, a list (Macaulay2Doc), containing all antichains of $P$

Description
===========

A set of elements of $P$ is called an antichain if no two distinct elements of
the set are comparable.

+----------------------------------------------------------------+
|i1 : D = divisorPoset 12;                                       |
+----------------------------------------------------------------+
|i2 : antichains D                                               |
|                                                                |
|o2 = {{}, {1}, {2}, {2, 3}, {3}, {3, 4}, {4}, {4, 6}, {6}, {12}}|
|                                                                |
|o2 : List                                                       |
+----------------------------------------------------------------+

With the input k, the method restricts to only antichains of that length.  In a
divisorPoset, all chains of length $2$ describe exactly
the non-divisor-multiple pairs.

+-----------------------------+
|i3 : antichains(D, 2)        |
|                             |
|o3 = {{2, 3}, {3, 4}, {4, 6}}|
|                             |
|o3 : List                    |
+-----------------------------+

Since every distinct pair of vertices in a chain, is comparable,
the only antichains of a chain are the singleton sets and the empty set.

+----------------------------------+
|i4 : antichains chain 5           |
|                                  |
|o4 = {{}, {1}, {2}, {3}, {4}, {5}}|
|                                  |
|o4 : List                         |
+----------------------------------+

See also
========

  * chains -- computes all chains of a poset
  * isAntichain -- determines if a given list of vertices
    is an antichain of a poset

Ways to use antichains :
========================

  * "antichains(Poset)"
  * "antichains(Poset,ZZ)"

For the programmer
==================

The object antichains, is a method function (Macaulay2Doc).

areIsomorphic -- determines if two posets are isomorphic
********************************************************

Synopsis
========

  * Usage:
        r = areIsomorphic(P, Q)
        r = P == Q
  * Inputs:
      * P, an instance of the type Poset,
      * Q, an instance of the type Poset,
  * Outputs:
      * r, a Boolean value (Macaulay2Doc), whether $P$ and $Q$
        are isomorphic as posets

Description
===========

Two posets are isomorphic if there is a partial order preserving bijection
between the ground sets of the posets which preserves the specified ground set
partitions.

+-----------------------------------------+
|i1 : C = chain 5;                        |
+-----------------------------------------+
|i2 : P = poset {{a,b},{b,c},{c,d},{d,e}};|
+-----------------------------------------+
|i3 : areIsomorphic(C, P)                 |
|                                         |
|o3 = true                                |
+-----------------------------------------+

The product of $n$ chains of length $2$ is isomorphic to the boolean lattice on
$n$ elements.  These are also isomorphic to the divisor lattice on the product
of $n$ distinct primes.

+----------------------------------+
|i4 : B = booleanLattice 4;        |
+----------------------------------+
|i5 : B == product(4, i -> chain 2)|
|                                  |
|o5 = true                         |
+----------------------------------+
|i6 : B == divisorPoset (2*3*5*7)  |
|                                  |
|o6 = true                         |
+----------------------------------+
|i7 : B == divisorPoset (2^2*3*5)  |
|                                  |
|o7 = false                        |
+----------------------------------+

See also
========

  * isomorphism -- computes an isomorphism between
    isomorphic posets
  * removeIsomorphicPosets -- returns a sub-list
    of non-isomorphic posets

Ways to use areIsomorphic :
===========================

  * "areIsomorphic(Poset,Poset)"

For the programmer
==================

The object areIsomorphic, is a method function (Macaulay2Doc).

atoms -- computes the list of elements covering the minimal elements of a poset
*******************************************************************************

Synopsis
========

  * Usage:
        A = atoms P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * A, a list (Macaulay2Doc), elements covering the minimal
        elements of a poset

Description
===========

An atom of a poset is an element which covers a minimal element of the poset.

+---------------------------+
|i1 : atoms booleanLattice 3|
|                           |
|o1 = {001, 010, 100}       |
|                           |
|o1 : List                  |
+---------------------------+
|i2 : atoms chain 5         |
|                           |
|o2 = {2}                   |
|                           |
|o2 : List                  |
+---------------------------+

See also
========

  * coveringRelations -- computes the minimal list of
    generating relations of a poset
  * minimalElements -- determines the minimal elements
    of a poset

Ways to use atoms :
===================

  * "atoms(Poset)"

For the programmer
==================

The object atoms, is a method function (Macaulay2Doc).

augmentPoset -- computes the poset with an adjoined minimum and maximum
***********************************************************************

Synopsis
========

  * Usage:
        Q = augmentPoset P
        Q = augmentPoset(P, a, b)
  * Inputs:
      * P, an instance of the type Poset,
      * a, a thing (Macaulay2Doc), the new minimal element of $P$
      * b, a thing (Macaulay2Doc), the new maximal element of $P$
  * Outputs:
      * Q, an instance of the type Poset,

Description
===========

This method simply creates a new poset $Q$ with the minimal element $a$ and the
maximal element $b$.  If $a$ and $b$ are unspecified, the elements $0$ and $1$
are used, respectively.

See also
========

  * adjoinMax -- computes the poset with a new maximum
    element
  * adjoinMin -- computes the poset with a new minimum
    element

Ways to use augmentPoset :
==========================

  * "augmentPoset(Poset)"
  * "augmentPoset(Poset,Thing,Thing)"

For the programmer
==================

The object augmentPoset, is a method function (Macaulay2Doc).

booleanLattice -- generates the boolean lattice on $n$ elements
***************************************************************

Synopsis
========

  * Usage:
        B = booleanLattice n
  * Inputs:
      * n, an integer (Macaulay2Doc),
  * Outputs:
      * B, an instance of the type Poset,

Description
===========

The boolean lattice on $n$ elements is the poset of binary strings of length
$n$ with order given by componentwise ordering.

+-------------------------+
|i1 : n = 3;              |
+-------------------------+
|i2 : B = booleanLattice n|
|                         |
|o2 = B                   |
|                         |
|o2 : Poset               |
+-------------------------+

It can also be seen as the poset of subsets of a set of $n$ elements with order
given by containment.

+------------------------------------+
|i3 : B == poset(subsets n, isSubset)|
|                                    |
|o3 = true                           |
+------------------------------------+

It is also the $n$-fold product of the chain, of length $2$.

+----------------------------------+
|i4 : B == product(n, i -> chain 2)|
|                                  |
|o4 = true                         |
+----------------------------------+

Further, it is the divisorPoset, of the product of $n$
distinct primes.

+------------------------------+
|i5 : B == divisorPoset (2*3*5)|
|                              |
|o5 = true                     |
+------------------------------+

See also
========

  * chain -- generates the chain poset on $n$ elements
  * divisorPoset -- generates the poset of divisors

Ways to use booleanLattice :
============================

  * "booleanLattice(ZZ)"

For the programmer
==================

The object booleanLattice, is a method function (Macaulay2Doc).

boundedRegions -- computes the number of bounded regions a hyperplane arrangement divides the space into
********************************************************************************************************

Synopsis
========

  * Usage:
        b = boundedRegions(A, R)
  * Inputs:
      * A, a list (Macaulay2Doc), of polynomials defining the
        hyperplanes
      * R, a ring (Macaulay2Doc),
  * Outputs:
      * b, an integer (Macaulay2Doc), the number of bounded regions

Description
===========

This method computes the number of bounded regions cut out by the hyperplane
arrangement.

+----------------------------------------------------------------+
|i1 : R = RR[x,y];                                               |
+----------------------------------------------------------------+
|i2 : A = {x+y,x,x-y,y+1};                                       |
+----------------------------------------------------------------+
|i3 : boundedRegions(A, R)                                       |
|-- warning: experimental computation over inexact field begun   |
|--          results not reliable (one warning given per session)|
|                                                                |
|o3 = 2                                                          |
+----------------------------------------------------------------+

See also
========

  * intersectionLattice -- generates the
    intersection lattice of a hyperplane arrangement
  * realRegions -- computes the number of regions a
    hyperplane arrangement divides the space into

Ways to use boundedRegions :
============================

  * "boundedRegions(List,Ring)"

For the programmer
==================

The object boundedRegions, is a method function (Macaulay2Doc).

chain -- generates the chain poset on $n$ elements
**************************************************

Synopsis
========

  * Usage:
        C = chain n
  * Inputs:
      * n, an integer (Macaulay2Doc), the length of the chain
  * Outputs:
      * C, an instance of the type Poset,

Description
===========

The chain poset on $n$ elements is the total order on the integers $1..n$.

+----------------------------------------------+
|i1 : n = 5;                                   |
+----------------------------------------------+
|i2 : C = chain n                              |
|                                              |
|o2 = C                                        |
|                                              |
|o2 : Poset                                    |
+----------------------------------------------+
|i3 : C == poset(toList(1..n), (a,b) -> a <= b)|
|                                              |
|o3 = true                                     |
+----------------------------------------------+

It is also the divisorPoset, of a prime $p$ to the $n-1$
power.

+-------------------------------+
|i4 : C == divisorPoset(2^(n-1))|
|                               |
|o4 = true                      |
+-------------------------------+

See also
========

  * divisorPoset -- generates the poset of divisors

Ways to use chain :
===================

  * "chain(ZZ)"

For the programmer
==================

The object chain, is a method function (Macaulay2Doc).

chains -- computes all chains of a poset
****************************************

Synopsis
========

  * Usage:
        L = chains P
        L = chains(P, k)
  * Inputs:
      * P, an instance of the type Poset,
      * k, an integer (Macaulay2Doc), if specified length of returned
        chains
  * Outputs:
      * L, a list (Macaulay2Doc), containing all chains of $P$

Description
===========

A set of elements of $P$ is called a chain if every pair of elements in the set
are comparable.

+-----------------------------------------------------------------------------+
|i1 : D = divisorPoset 12;                                                    |
+-----------------------------------------------------------------------------+
|i2 : chains D                                                                |
|                                                                             |
|o2 = {{}, {1}, {1, 2}, {1, 2, 4}, {1, 2, 4, 12}, {1, 2, 6}, {1, 2, 6, 12},   |
|     ------------------------------------------------------------------------|
|     {1, 2, 12}, {1, 3}, {1, 3, 6}, {1, 3, 6, 12}, {1, 3, 12}, {1, 4}, {1, 4,|
|     ------------------------------------------------------------------------|
|     12}, {1, 6}, {1, 6, 12}, {1, 12}, {2}, {2, 4}, {2, 4, 12}, {2, 6}, {2,  |
|     ------------------------------------------------------------------------|
|     6, 12}, {2, 12}, {3}, {3, 6}, {3, 6, 12}, {3, 12}, {4}, {4, 12}, {6},   |
|     ------------------------------------------------------------------------|
|     {6, 12}, {12}}                                                          |
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+

With the input k, the method restricts to only chains of that length.  In a
divisorPoset, all chains of length $2$ describe exactly
the divisor-multiple pairs.

+-----------------------------------------------------------------------------+
|i3 : chains(D, 2)                                                            |
|                                                                             |
|o3 = {{1, 2}, {1, 3}, {1, 4}, {1, 6}, {1, 12}, {2, 4}, {2, 6}, {2, 12}, {3,  |
|     ------------------------------------------------------------------------|
|     6}, {3, 12}, {4, 12}, {6, 12}}                                          |
|                                                                             |
|o3 : List                                                                    |
+-----------------------------------------------------------------------------+

See also
========

  * antichains -- computes all antichains of a poset

Ways to use chains :
====================

  * "chains(Poset)"
  * "chains(Poset,ZZ)"

For the programmer
==================

The object chains, is a method function (Macaulay2Doc).

characteristicPolynomial -- computes the characteristic polynomial of a ranked poset with a unique minimal element
******************************************************************************************************************

Synopsis
========

  * Usage:
        p = characteristicPolynomial P
        p = characteristicPolynomial(P, VariableName => symbol)
  * Inputs:
      * P, an instance of the type Poset, a ranked poset
  * Optional inputs (Macaulay2Doc),:
      * VariableName => a symbol (Macaulay2Doc), default value q
  * Outputs:
      * p, a ring element (Macaulay2Doc), the characteristic
        polynomial of $P$

Description
===========

The characteristic polynomial of a ranked poset is the generating function with
variable $q$ such that the coefficient of $q^r$ is the sum overall vertices of
rank $r$ of the Moebius function of $v$.

The characteristic polynomial of the chain, of $n$ is
$q^{n-1}(q-1)$.

+--------------------------------------------+
|i1 : n = 5;                                 |
+--------------------------------------------+
|i2 : factor characteristicPolynomial chain n|
|                                            |
|        3                                   |
|o2 = (q) (q - 1)                            |
|                                            |
|o2 : Expression of class Product            |
+--------------------------------------------+

And the characteristic polynomial of the booleanLattice,
of $n$ is $(q-1)^n$.

+-----------------------------------------------------+
|i3 : factor characteristicPolynomial booleanLattice n|
|                                                     |
|            5                                        |
|o3 = (q - 1)                                         |
|                                                     |
|o3 : Expression of class Product                     |
+-----------------------------------------------------+

See also
========

  * isRanked -- determines if a poset is ranked
  * moebiusFunction -- computes the Moebius function at
    every pair of elements of a poset

Ways to use characteristicPolynomial :
======================================

  * "characteristicPolynomial(Poset)"

For the programmer
==================

The object characteristicPolynomial, is a
method function with options (Macaulay2Doc).

closedInterval -- computes the subposet contained between two points
********************************************************************

Synopsis
========

  * Usage:
        I = closedInterval(P, p, q)
  * Inputs:
      * P, an instance of the type Poset,
      * p, a thing (Macaulay2Doc), an element of the poset
      * q, a thing (Macaulay2Doc), an element of the poset
  * Outputs:
      * I, an instance of the type Poset, the closed interval in
        $P$ between $p$ and $q$

Description
===========

The closed interval between $p$ and $q$ is the subposet of $P$ induced by the
elements $z$ such that $p \leq z \leq q$.  If $p$ and $q$ are incomparable,
then an error is thrown.

+------------------------------------+
|i1 : P = booleanLattice 3;          |
+------------------------------------+
|i2 : closedInterval(P, "001", "111")|
|                                    |
|o2 = Relation Matrix: | 1 1 1 1 |   |
|                      | 0 1 0 1 |   |
|                      | 0 0 1 1 |   |
|                      | 0 0 0 1 |   |
|                                    |
|o2 : Poset                          |
+------------------------------------+

See also
========

  * openInterval -- computes the subposet contained
    strictly between two points

Ways to use closedInterval :
============================

  * "closedInterval(Poset,Thing,Thing)"

For the programmer
==================

The object closedInterval, is a method function (Macaulay2Doc).

comparabilityGraph -- produces the comparability graph of a poset
*****************************************************************

Synopsis
========

  * Usage:
        G = comparabilityGraph P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * G, a graph (Graphs), which has an edge between two
        vertices if they are comparable in $P$

Description
===========

The comparability graph of a poset $P$ is the Graph (Graphs), with
vertices given by the ground set of $P$ and which has edges between two
vertices if they are comparable in $P$.

+----------------------------------------+
|i1 : comparabilityGraph booleanLattice 3|
|                                        |
|o1 = Graph{0 => {1, 2, 3, 4, 5, 6, 7}}  |
|           1 => {0, 3, 5, 7}            |
|           2 => {0, 3, 6, 7}            |
|           3 => {0, 1, 2, 7}            |
|           4 => {0, 5, 6, 7}            |
|           5 => {0, 1, 4, 7}            |
|           6 => {0, 2, 4, 7}            |
|           7 => {0, 1, 2, 3, 4, 5, 6}   |
|                                        |
|o1 : Graph                              |
+----------------------------------------+

Caveat
======

This method renames the vertices with integers $0, 1, \ldots$ corresponding to
the index of the vertices in the GroundSet.

See also
========

  * compare -- compares two elements in a poset
  * incomparabilityGraph -- produces the
    incomparability graph of a poset
  * isComparabilityGraph -- determines if a graph
    is the comparability graph of a poset
  * transitiveOrientation -- generates a poset
    whose comparability graph is the given graph

Ways to use comparabilityGraph :
================================

  * "comparabilityGraph(Poset)"

For the programmer
==================

The object comparabilityGraph, is a method function (Macaulay2Doc).

compare -- compares two elements in a poset
*******************************************

Synopsis
========

  * Usage:
        r = compare(P, a, b)
  * Inputs:
      * P, an instance of the type Poset,
      * a, a thing (Macaulay2Doc), an element of the poset
      * b, a thing (Macaulay2Doc), an element of the poset
  * Outputs:
      * r, a Boolean value (Macaulay2Doc), whether $a \leq b$ in
        $P$

Description
===========

This method determines if two elements are comparable and further if $a$ is
less than or equal to $b$ in $P$.

+-----------------------------+
|i1 : P = poset {{a,b},{a,c}};|
+-----------------------------+
|i2 : compare(P, a, b)        |
|                             |
|o2 = true                    |
+-----------------------------+
|i3 : compare(P, c, a)        |
|                             |
|o3 = false                   |
+-----------------------------+

If two elements are incomparable, then the result is false.

+---------------------+
|i4 : compare(P, b, c)|
|                     |
|o4 = false           |
+---------------------+

Ways to use compare :
=====================

  * "compare(Poset,Thing,Thing)"

For the programmer
==================

The object compare, is a method function (Macaulay2Doc).

connectedComponents(Poset) -- generates a list of connected components of a poset
*********************************************************************************

Synopsis
========

  * Function: connectedComponents (SimplicialComplexes),
  * Usage:
        C = connectedComponents P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * C, a list (Macaulay2Doc), containing lists of vertices,
        each of which is a connected component of $P$

Description
===========

A connected component of $P$ is a set of vertices of $P$ such that every
between every pair of vertices $u$ and $v$ in the set there exists a chain of
vertices $(a_0=u,a_1,\ldots,a_n=v)$ such that $a_{i-1}$ and $a_i$ are
comparable in $P$ for each $i$.

+------------------------------------------------------------------------+
|i1 : C = chain 3;                                                       |
+------------------------------------------------------------------------+
|i2 : connectedComponents C                                              |
|                                                                        |
|o2 = {{1, 2, 3}}                                                        |
|                                                                        |
|o2 : List                                                               |
+------------------------------------------------------------------------+
|i3 : S = sum(5, i -> naturalLabeling(C, 10*i));                         |
+------------------------------------------------------------------------+
|i4 : connectedComponents S                                              |
|                                                                        |
|o4 = {{0, 1, 2}, {10, 11, 12}, {20, 21, 22}, {30, 31, 32}, {40, 41, 42}}|
|                                                                        |
|o4 : List                                                               |
+------------------------------------------------------------------------+

This method was ported from John Stembridge's Maple package available at
http://www.math.lsa.umich.edu/~jrs/maple.html#posets.

Ways to use this method:
========================

  * connectedComponents(Poset), --
    generates a list of connected components of a poset

coveringRelations -- computes the minimal list of generating relations of a poset
*********************************************************************************

Synopsis
========

  * Usage:
        R = coveringRelations P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * R, a list (Macaulay2Doc), the minimal list of generating
        relations of $P$

Description
===========

A relation $a < b$ of elements in $P$ is a covering relation if there exists no
$c$ in $P$ such that $a < c < b$.  The set of covering relations is the minimal
list of relations in $P$ that describes all relations of $P$.

+---------------------------------------------------------------+
|i1 : coveringRelations divisorPoset 12                         |
|                                                               |
|o1 = {{1, 2}, {1, 3}, {2, 4}, {2, 6}, {3, 6}, {4, 12}, {6, 12}}|
|                                                               |
|o1 : List                                                      |
+---------------------------------------------------------------+

See also
========

  * allRelations -- computes all relations of a poset

Ways to use coveringRelations :
===============================

  * "coveringRelations(Poset)"

For the programmer
==================

The object coveringRelations, is a method function (Macaulay2Doc).

coxeterPolynomial -- computes the Coxeter polynomial of a poset
***************************************************************

Synopsis
========

  * Usage:
        z = coxeterPolynomial P
        z = coxeterPolynomial(P, VariableName => symbol)
  * Inputs:
      * P, an instance of the type Poset,
  * Optional inputs (Macaulay2Doc),:
      * VariableName => a symbol (Macaulay2Doc), default value t
  * Outputs:
      * z, a ring element (Macaulay2Doc), the Coxeter
        polynomial of $P$

Description
===========

The Coxeter polynomial of $P$ is the characteristic polynomial of the Coxeter
transformation matrix $ -M M^{-t}$, where $M$ is the relation matrix. This
depends only on the derived category of modules over the incidence algebra.

+------------------------------------------------+
|i1 : B = booleanLattice 3;                      |
+------------------------------------------------+
|i2 : z = coxeterPolynomial B                    |
|                                                |
|      8    7    6     5     4     3    2        |
|o2 = t  + t  + t  - 2t  - 2t  - 2t  + t  + t + 1|
|                                                |
|o2 : ZZ[t]                                      |
+------------------------------------------------+

Ways to use coxeterPolynomial :
===============================

  * "coxeterPolynomial(Poset)"

For the programmer
==================

The object coxeterPolynomial, is a method function with options (Macaulay2Doc).

degreePolynomial -- computes the degree polynomial of a poset
*************************************************************

Synopsis
========

  * Usage:
        z = degreePolynomial P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * z, a ring element (Macaulay2Doc), the degree
        polynomial of $P$

Description
===========

The degree polynomial of $P$ is the sum over elements $v$ of
$x^{\operatorname{in}(v)} y^{\operatorname{out}(v)}$, when the exponents are
the incoming and outgoing valences of $v$ in the Hasse diagram.

This polynomial is multiplicative for Cartesian product of posets.

+----------------------------------+
|i1 : B = booleanLattice 3;        |
+----------------------------------+
|i2 : z = factor degreePolynomial B|
|                                  |
|            3                     |
|o2 = (x + y)                      |
|                                  |
|o2 : Expression of class Product  |
+----------------------------------+

Ways to use degreePolynomial :
==============================

  * "degreePolynomial(Poset)"

For the programmer
==================

The object degreePolynomial, is a method function (Macaulay2Doc).

diamondProduct -- computes the diamond product of two ranked posets
*******************************************************************

Synopsis
========

  * Usage:
        D = diamondProduct(P, Q)
  * Inputs:
      * P, an instance of the type Poset, which is ranked
      * Q, an instance of the type Poset, which is ranked
  * Outputs:
      * D, an instance of the type Poset,

Description
===========

The diamond product of two ranked posets is the Cartesian product of the posets
with their minimal elements removed and a new minimal element adjoined to the
product.

+-------------------------------------+
|i1 : diamondProduct(chain 3, chain 3)|
|                                     |
|o1 = Relation Matrix: | 1 1 1 1 1 |  |
|                      | 0 1 1 1 1 |  |
|                      | 0 0 1 0 1 |  |
|                      | 0 0 0 1 1 |  |
|                      | 0 0 0 0 1 |  |
|                                     |
|o1 : Poset                           |
+-------------------------------------+

See also
========

  * isRanked -- determines if a poset is ranked
  * product (Macaulay2Doc)

Ways to use diamondProduct :
============================

  * "diamondProduct(Poset,Poset)"

For the programmer
==================

The object diamondProduct, is a method function (Macaulay2Doc).

dilworthLattice -- computes the Dilworth lattice of a poset
***********************************************************

Synopsis
========

  * Usage:
        D = dilworthLattice P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * D, an instance of the type Poset, the Dilworth lattice of
        $P$

Description
===========

The Dilworth lattice of $P$ is the lattice of maximum length (the
dilworthNumber) antichains in $P$.  Two such antichains have
$A \leq B$ if and only if every member of $A$ is less than or equal (in $P$) to
some member of $B$.

+----------------------------------------------------------------+
|i1 : P = poset {{0, 2}, {1, 2}, {1, 3}, {2, 5}, {3, 4}, {3, 5}};|
+----------------------------------------------------------------+
|i2 : dilworthLattice P                                          |
|                                                                |
|o2 = Relation Matrix: | 1 0 0 1 0 1 |                           |
|                      | 1 1 1 1 1 1 |                           |
|                      | 1 0 1 1 1 1 |                           |
|                      | 0 0 0 1 0 1 |                           |
|                      | 0 0 0 1 1 1 |                           |
|                      | 0 0 0 0 0 1 |                           |
|                                                                |
|o2 : Poset                                                      |
+----------------------------------------------------------------+

See also
========

  * dilworthNumber -- computes the Dilworth number of a
    poset
  * maximalAntichains -- computes all maximal
    antichains of a poset

Ways to use dilworthLattice :
=============================

  * "dilworthLattice(Poset)"

For the programmer
==================

The object dilworthLattice, is a method function (Macaulay2Doc).

dilworthNumber -- computes the Dilworth number of a poset
*********************************************************

Synopsis
========

  * Usage:
        d = dilworthNumber P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * d, an integer (Macaulay2Doc), the maximum length of an
        antichain

Description
===========

The Dilworth number of a poset is the maximum length of an antichain.

The Dilworth number of a chain, is always 1.

+---------------------------+
|i1 : n = 5;                |
+---------------------------+
|i2 : dilworthNumber chain n|
|                           |
|o2 = 1                     |
+---------------------------+

The Dilworth number of the $n$ See booleanLattice, is
$n*(n-1)/2$.

+------------------------------------+
|i3 : dilworthNumber booleanLattice n|
|                                    |
|o3 = 10                             |
+------------------------------------+
|i4 : n*(n-1)//2                     |
|                                    |
|o4 = 10                             |
+------------------------------------+

See also
========

  * antichains -- computes all antichains of a poset
  * dilworthLattice -- computes the Dilworth lattice of
    a poset
  * maximalAntichains -- computes all maximal
    antichains of a poset

Ways to use dilworthNumber :
============================

  * "dilworthNumber(Poset)"

For the programmer
==================

The object dilworthNumber, is a method function (Macaulay2Doc).

displayPoset -- generates a PDF representation of a poset and attempts to display it
************************************************************************************

Synopsis
========

  * Usage:
        displayPoset P
        displayPoset(P, SuppressLabels => Boolean)
        displayPoset(P, PDFDirectory => String)
        displayPoset(P, Jitter => Boolean)
  * Inputs:
      * P, an instance of the type Poset,
  * Optional inputs (Macaulay2Doc),:
      * SuppressLabels => a Boolean value (Macaulay2Doc),
        default value true, whether to display or suppress the labels of the
        poset
      * Jitter => a Boolean value (Macaulay2Doc), default value
        false, whether to randomly jitter the poset vertices
      * PDFDirectory => a string (Macaulay2Doc), default value
        "", which gives the path for the PDF

Description
===========

This method generates a PDF of the Hasse Diagram of the Poset view LaTeX code
which uses TikZ.  The method attempts to display the PDF using show (Macaulay2Doc).
See texPoset, for more about the
representation.

Normally, the vertices of the Poset are placed at regular intervals along
horizontal lines.  However, this can sometimes cause edges to appear in the
Hasse diagram that are not truly there.  The Jitter option can be used to
randomly shift the positions of the vertices horizontally, which can often
cause the edges to be more clear.

See also
========

  * outputTexPoset -- writes a LaTeX file with a
    TikZ-representation of a poset
  * texPoset -- generates a string containing a TikZ-figure of
    a poset
  * Jitter -- generates a string containing a TikZ-figure of a
    poset
  * SuppressLabels -- generates a string containing a
    TikZ-figure of a poset
  * hasseDiagram -- produces the Hasse diagram of a poset

Ways to use displayPoset :
==========================

  * "displayPoset(Poset)"

For the programmer
==================

The object displayPoset, is a method function with options (Macaulay2Doc).

distributiveLattice -- computes the lattice of order ideals of a poset
**********************************************************************

Synopsis
========

  * Usage:
        L = distributiveLattice P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * L, an instance of the type Poset, the distributive
        lattice of $P$

Description
===========

The distributive lattice of a poset $P$ is the poset of all order ideals of $P$
ordered by inclusion.

+-----------------------------------+
|i1 : P = poset {{1,2}, {1,3}};     |
+-----------------------------------+
|i2 : distributiveLattice P         |
|                                   |
|o2 = Relation Matrix: | 1 1 1 1 1 ||
|                      | 0 1 1 1 1 ||
|                      | 0 0 1 1 0 ||
|                      | 0 0 0 1 0 ||
|                      | 0 0 0 1 1 ||
|                                   |
|o2 : Poset                         |
+-----------------------------------+

The distributive lattice of a chain, poset of length $n$ is the
chain poset of length $n+1$.

+---------------------------------+
|i3 : distributiveLattice chain 3 |
|                                 |
|o3 = Relation Matrix: | 1 1 1 1 ||
|                      | 0 1 1 1 ||
|                      | 0 0 1 1 ||
|                      | 0 0 0 1 ||
|                                 |
|o3 : Poset                       |
+---------------------------------+

See also
========

  * orderIdeal -- computes the elements below given elements
    in a poset

Ways to use distributiveLattice :
=================================

  * "distributiveLattice(Poset)"

For the programmer
==================

The object distributiveLattice, is a method function (Macaulay2Doc).

divisorPoset -- generates the poset of divisors
***********************************************

Synopsis
========

  * Usage:
        P = divisorPoset n
  * Inputs:
      * n, an integer (Macaulay2Doc), which is not zero
  * Outputs:
      * P, an instance of the type Poset,

Description
===========

The divisor poset of an integer is the poset of positive divisors of an integer
$n$ with order induced by divisibility.

+-----------------------------------------+
|i1 : divisorPoset 12                     |
|                                         |
|o1 = Relation Matrix: | 1 1 1 1 1 1 |    |
|                      | 0 1 0 1 1 1 |    |
|                      | 0 0 1 0 1 1 |    |
|                      | 0 0 0 1 0 1 |    |
|                      | 0 0 0 0 1 1 |    |
|                      | 0 0 0 0 0 1 |    |
|                                         |
|o1 : Poset                               |
+-----------------------------------------+
|i2 : divisorPoset 30                     |
|                                         |
|o2 = Relation Matrix: | 1 1 1 1 1 1 1 1 ||
|                      | 0 1 0 0 1 1 0 1 ||
|                      | 0 0 1 0 1 0 1 1 ||
|                      | 0 0 0 1 0 1 1 1 ||
|                      | 0 0 0 0 1 0 0 1 ||
|                      | 0 0 0 0 0 1 0 1 ||
|                      | 0 0 0 0 0 0 1 1 ||
|                      | 0 0 0 0 0 0 0 1 ||
|                                         |
|o2 : Poset                               |
+-----------------------------------------+

See also
========

  * divisorPoset(RingElement), --
    generates the poset of divisors
  * divisorPoset(RingElement,RingElement)
    -- generates the poset of
    divisors with a lower and upper bound
  * divisorPoset(List,List,PolynomialRing)
    -- generates the poset of
    divisors

Ways to use divisorPoset :
==========================

  * "divisorPoset(ZZ)"
  * divisorPoset(List,List,PolynomialRing)
    -- generates the poset of
    divisors
  * divisorPoset(RingElement), --
    generates the poset of divisors
  * divisorPoset(RingElement,RingElement)
    -- generates the poset of
    divisors with a lower and upper bound

For the programmer
==================

The object divisorPoset, is a method function (Macaulay2Doc).

divisorPoset(List,List,PolynomialRing) -- generates the poset of divisors
*************************************************************************

Synopsis
========

  * Function: divisorPoset,
  * Usage:
        P = divisorPoset(m, n, R)
  * Inputs:
      * m, a list (Macaulay2Doc), an exponent vector of the lower
        bound monomial in $R$
      * n, a list (Macaulay2Doc), an exponent vector of the upper
        bound monomial in $R$
      * R, a polynomial ring (Macaulay2Doc),
  * Outputs:
      * P, an instance of the type Poset,

Description
===========

This method generates the divisor poset of the monomials in $R$ whose exponent
vectors are given by $m$ and $n$.

+--------------------------------------+
|i1 : R = QQ[x,y];                     |
+--------------------------------------+
|i2 : D = divisorPoset({0,1}, {2,2}, R)|
|                                      |
|o2 = D                                |
|                                      |
|o2 : Poset                            |
+--------------------------------------+
|i3 : D == divisorPoset(y, x^2*y^2)    |
|                                      |
|o3 = true                             |
+--------------------------------------+

See also
========

  * divisorPoset -- generates the poset of divisors
  * divisorPoset(ZZ) -- generates the poset of divisors
  * divisorPoset(RingElement), --
    generates the poset of divisors
  * divisorPoset(RingElement,RingElement)
    -- generates the poset of
    divisors with a lower and upper bound

Ways to use this method:
========================

  * divisorPoset(List,List,PolynomialRing)
    -- generates the poset of
    divisors

divisorPoset(RingElement) -- generates the poset of divisors
************************************************************

Synopsis
========

  * Function: divisorPoset,
  * Usage:
        P = divisorPoset m
  * Inputs:
      * m, a ring element (Macaulay2Doc), which is a
        polynomial
  * Outputs:
      * P, an instance of the type Poset,

Description
===========

The divisor poset of a polynomial $m$ is the poset of divisors with order
induced by divisibility.

+-------------------------------------+
|i1 : R = QQ[x,y];                    |
+-------------------------------------+
|i2 : divisorPoset(x^2*y)             |
|                                     |
|o2 = Relation Matrix: | 1 1 1 1 1 1 ||
|                      | 0 1 0 1 0 1 ||
|                      | 0 0 1 1 1 1 ||
|                      | 0 0 0 1 0 1 ||
|                      | 0 0 0 0 1 1 ||
|                      | 0 0 0 0 0 1 ||
|                                     |
|o2 : Poset                           |
+-------------------------------------+

The method works with non-monomial divisors as well.

+-------------------------------------+
|i3 : divisorPoset(x*y^2 - 2*x*y + x) |
|                                     |
|o3 = Relation Matrix: | 1 1 1 1 1 1 ||
|                      | 0 1 0 1 1 1 ||
|                      | 0 0 1 0 1 1 ||
|                      | 0 0 0 1 0 1 ||
|                      | 0 0 0 0 1 1 ||
|                      | 0 0 0 0 0 1 ||
|                                     |
|o3 : Poset                           |
+-------------------------------------+

See also
========

  * divisorPoset -- generates the poset of divisors
  * divisorPoset(ZZ) -- generates the poset of divisors
  * divisorPoset(RingElement,RingElement)
    -- generates the poset of
    divisors with a lower and upper bound
  * divisorPoset(List,List,PolynomialRing)
    -- generates the poset of
    divisors

Ways to use this method:
========================

  * divisorPoset(RingElement), --
    generates the poset of divisors

divisorPoset(RingElement,RingElement) -- generates the poset of divisors with a lower and upper bound
*****************************************************************************************************

Synopsis
========

  * Function: divisorPoset,
  * Usage:
        P = divisorPoset(m, n)
  * Inputs:
      * m, a ring element (Macaulay2Doc), the lower bound,
        which divides $n$
      * n, a ring element (Macaulay2Doc), the upper bound,
        which is a multiple of $m$
  * Outputs:
      * P, an instance of the type Poset,

Description
===========

This method generates the divisor poset of $n$ with elements which are
multiples of $n$.

+-------------------------------------------------+
|i1 : R = QQ[x,y];                                |
+-------------------------------------------------+
|i2 : divisorPoset(x*y-x, x^2*y^2 - 2*x^2*y + x^2)|
|                                                 |
|o2 = Relation Matrix: | 1 1 1 1 |                |
|                      | 0 1 0 1 |                |
|                      | 0 0 1 1 |                |
|                      | 0 0 0 1 |                |
|                                                 |
|o2 : Poset                                       |
+-------------------------------------------------+

See also
========

  * divisorPoset -- generates the poset of divisors
  * divisorPoset(ZZ) -- generates the poset of divisors
  * divisorPoset(RingElement), --
    generates the poset of divisors
  * divisorPoset(List,List,PolynomialRing)
    -- generates the poset of
    divisors

Ways to use this method:
========================

  * divisorPoset(RingElement,RingElement)
    -- generates the poset of
    divisors with a lower and upper bound

dominanceLattice -- generates the dominance lattice of partitions of $n$
************************************************************************

Synopsis
========

  * Usage:
        P = dominanceLattice n
  * Inputs:
      * n, an integer (Macaulay2Doc),
  * Outputs:
      * P, an instance of the type Poset,

Description
===========

The dominance lattice of partitions of $n$ is the lattice of partitions of $n$
under the dominance ordering.  Suppose $p$ and $q$ are two partitions of $n$.
Then $p$ is less than or equal to $q$ if and only if the $k$-th partial sum of
$p$ is at most the $k$-th partial sum of $q$, where the partitions are extended
with zeros, as needed.

+----------------------------------------+
|i1 : D = dominanceLattice 6;            |
+----------------------------------------+
|i2 : closedInterval(D, {2,2,1,1}, {4,2})|
|                                        |
|o2 = Relation Matrix: | 1 0 0 0 0 0 0 | |
|                      | 1 1 0 0 0 0 0 | |
|                      | 1 0 1 0 0 0 0 | |
|                      | 1 1 1 1 0 0 0 | |
|                      | 1 1 1 1 1 0 0 | |
|                      | 1 1 1 1 0 1 0 | |
|                      | 1 1 1 1 1 1 1 | |
|                                        |
|o2 : Poset                              |
+----------------------------------------+

For $n \leq 5$, the dominance lattice of $n$ is isomorphic to an appropriately
long chain poset.

+----------------------------------+
|i3 : dominanceLattice 2 == chain 2|
|                                  |
|o3 = true                         |
+----------------------------------+
|i4 : dominanceLattice 3 == chain 3|
|                                  |
|o4 = true                         |
+----------------------------------+
|i5 : dominanceLattice 4 == chain 5|
|                                  |
|o5 = true                         |
+----------------------------------+
|i6 : dominanceLattice 5 == chain 7|
|                                  |
|o6 = true                         |
+----------------------------------+

See also
========

  * partitionLattice -- computes the lattice of
    set-partitions of size $n$
  * partitions (Macaulay2Doc) -- list the partitions of an
    integer
  * youngSubposet -- generates a subposet of Young's
    lattice

Ways to use dominanceLattice :
==============================

  * "dominanceLattice(ZZ)"

For the programmer
==================

The object dominanceLattice, is a method function (Macaulay2Doc).

dropElements -- computes the induced subposet of a poset given a list of elements to remove
*******************************************************************************************

Synopsis
========

  * Usage:
        Q = dropElements(P, f)
        Q = dropElements(P, L)
        Q = P - L
  * Inputs:
      * P, an instance of the type Poset,
      * L, a list (Macaulay2Doc), containing elements of $P$ to
        remove
      * f, a function (Macaulay2Doc), which returns true for
        elements to remove and false otherwise
  * Outputs:
      * Q, an instance of the type Poset,

Description
===========

This method computes the induced subposet $Q$ of $P$ with the elements of $L$
removed from the poset.

+---------------------------------+
|i1 : P = chain 5;                |
+---------------------------------+
|i2 : dropElements(P, {3})        |
|                                 |
|o2 = Relation Matrix: | 1 1 1 1 ||
|                      | 0 1 1 1 ||
|                      | 0 0 1 1 ||
|                      | 0 0 0 1 ||
|                                 |
|o2 : Poset                       |
+---------------------------------+
|i3 : P - {4, 5}                  |
|                                 |
|o3 = Relation Matrix: | 1 1 1 |  |
|                      | 0 1 1 |  |
|                      | 0 0 1 |  |
|                                 |
|o3 : Poset                       |
+---------------------------------+

Alternatively, this method computes the induced subposet $Q$ of $P$ with the
elements removed which return true when $f$ is applied.

+-----------------------------------------+
|i4 : P = divisorPoset (2*3*5*7);         |
+-----------------------------------------+
|i5 : Q = dropElements(P, e -> e % 3 == 0)|
|                                         |
|o5 = Q                                   |
|                                         |
|o5 : Poset                               |
+-----------------------------------------+
|i6 : Q == divisorPoset(2*5*7)            |
|                                         |
|o6 = true                                |
+-----------------------------------------+

See also
========

  * subposet -- computes the induced subposet of a poset given
    a list of elements

Ways to use dropElements :
==========================

  * "dropElements(Poset,Function)"
  * "dropElements(Poset,List)"

For the programmer
==================

The object dropElements, is a method function (Macaulay2Doc).

dual(Poset) -- produces the derived poset with relations reversed
*****************************************************************

Synopsis
========

  * Function: dual (Macaulay2Doc),
  * Usage:
        P' = dual P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * P', an instance of the type Poset, the dual of $P$

Description
===========

The dual of a poset is the poset on the same ground set but with all relations
reversed.

+-------------------------------------+
|i1 : P = divisorPoset 12;            |
+-------------------------------------+
|i2 : dual P                          |
|                                     |
|o2 = Relation Matrix: | 1 0 0 0 0 0 ||
|                      | 1 1 0 0 0 0 ||
|                      | 1 0 1 0 0 0 ||
|                      | 1 1 0 1 0 0 ||
|                      | 1 1 1 0 1 0 ||
|                      | 1 1 1 1 1 1 ||
|                                     |
|o2 : Poset                           |
+-------------------------------------+

Clearly then, the chain, posets and booleanLattice,
s are all self-dual.

+-----------------------------+
|i3 : C = chain 5;            |
+-----------------------------+
|i4 : areIsomorphic(C, dual C)|
|                             |
|o4 = true                    |
+-----------------------------+
|i5 : B = booleanLattice 4;   |
+-----------------------------+
|i6 : areIsomorphic(B, dual B)|
|                             |
|o6 = true                    |
+-----------------------------+

Ways to use this method:
========================

  * dual(Poset) -- produces the derived poset with
    relations reversed

Example: Constructing common posets
***********************************

The standard way to construct a Poset, is the poset,
method. However, this package also provides many enumerators for common posets.

For example, we can construct a boolean lattice in many ways. First, we
construct it with the booleanLattice, method.

+--------------------------+
|i1 : n = 3;               |
+--------------------------+
|i2 : B = booleanLattice n;|
+--------------------------+

We can also construct it as a product of length 2 chain,s.

+-----------------------------+
|i3 : C2 = chain 2;           |
+-----------------------------+
|i4 : C = product(n, i -> C2);|
+-----------------------------+
|i5 : areIsomorphic(B, C)     |
|                             |
|o5 = true                    |
+-----------------------------+

Further, we can construct it as the divisorPoset, of a
product of primes.

+-----------------------------------------+
|i6 : P = {2, 3, 5, 7, 11, 13, 17, 19};   |
+-----------------------------------------+
|i7 : D = divisorPoset product take(P, n);|
+-----------------------------------------+
|i8 : areIsomorphic(B, D)                 |
|                                         |
|o8 = true                                |
+-----------------------------------------+

It is also the standardMonomialPoset, of the
Ideal (Macaulay2Doc), of squares of the variables.

+---------------------------------------------+
|i9 : R = QQ[x_1..x_n];                       |
+---------------------------------------------+
|i10 : I = monomialIdeal apply(R_*, x -> x^2);|
|                                             |
|o10 : MonomialIdeal of R                     |
+---------------------------------------------+
|i11 : M = standardMonomialPoset I;           |
+---------------------------------------------+
|i12 : areIsomorphic(B, M)                    |
|                                             |
|o12 = true                                   |
+---------------------------------------------+

There are many other common posets that can be generated with this package. See
the below list for the methods.

See also
========

  * booleanLattice -- generates the boolean lattice on
    $n$ elements
  * chain -- generates the chain poset on $n$ elements
  * divisorPoset -- generates the poset of divisors
  * dominanceLattice -- generates the dominance
    lattice of partitions of $n$
  * facePoset -- generates the face poset of a simplicial
    complex
  * intersectionLattice -- generates the
    intersection lattice of a hyperplane arrangement
  * lcmLattice -- generates the lattice of lcms in an ideal
  * ncpLattice -- computes the non-crossing partition
    lattice of set-partitions of size $n$
  * partitionLattice -- computes the lattice of
    set-partitions of size $n$
  * plueckerPoset -- computes a poset associated to the
    Plücker relations
  * randomPoset -- generates a random poset with a given
    relation probability
  * resolutionPoset -- generates a poset from a
    resolution
  * standardMonomialPoset -- generates the poset
    of divisibility in the monomial basis of an ideal
  * youngSubposet -- generates a subposet of Young's
    lattice

Example: Hibi ideals
********************

The Hibi ideal of $P$ is a MonomialIdeal (Macaulay2Doc),
built over a ring in $2n$ variables $x_0, \ldots, x_{n-1}, y_0, \ldots,
y_{n-1}$, where $n$ is the size of the ground set of $P$. The generators of the
ideal are in bijection with order ideals in $P$.  Let $I$ be an order ideal of
$P$.  Then the associated monomial is the product of the $x_i$ associated with
members of $I$ and the $y_i$ associated with non-members of $I$.

+-----------------------------------------------------------------------------+
|i1 : P = divisorPoset 12;                                                    |
+-----------------------------------------------------------------------------+
|i2 : HP = hibiIdeal P                                                        |
|                                                                             |
|o2 = monomialIdeal (x x x x x x , x x x x x y , x x x x y y , x x x x y y ,  |
|                     0 1 2 3 4 5   0 1 2 3 4 5   0 1 2 4 3 5   0 1 2 3 4 5   |
|     ------------------------------------------------------------------------|
|     x x x y y y , x x x y y y , x x y y y y , x x y y y y , x y y y y y ,   |
|      0 1 3 2 4 5   0 1 2 3 4 5   0 2 1 3 4 5   0 1 2 3 4 5   0 1 2 3 4 5    |
|     ------------------------------------------------------------------------|
|     y y y y y y )                                                           |
|      0 1 2 3 4 5                                                            |
|                                                                             |
|o2 : MonomialIdeal of QQ[x ..x , y ..y ]                                     |
|                          0   5   0   5                                      |
+-----------------------------------------------------------------------------+

Herzog and Hibi proved that every power of a Hibi ideal has a linear
resolution.

+----------------------------------+
|i3 : betti res HP                 |
|                                  |
|            0  1  2 3             |
|o3 = total: 1 10 12 3             |
|         0: 1  .  . .             |
|         1: .  .  . .             |
|         2: .  .  . .             |
|         3: .  .  . .             |
|         4: .  .  . .             |
|         5: . 10 12 3             |
|                                  |
|o3 : BettiTally                   |
+----------------------------------+
|i4 : betti res (HP^2)             |
|                                  |
|            0  1   2  3  4 5      |
|o4 = total: 1 50 100 66 16 1      |
|         0: 1  .   .  .  . .      |
|         1: .  .   .  .  . .      |
|         2: .  .   .  .  . .      |
|         3: .  .   .  .  . .      |
|         4: .  .   .  .  . .      |
|         5: .  .   .  .  . .      |
|         6: .  .   .  .  . .      |
|         7: .  .   .  .  . .      |
|         8: .  .   .  .  . .      |
|         9: .  .   .  .  . .      |
|        10: .  .   .  .  . .      |
|        11: . 50 100 66 16 1      |
|                                  |
|o4 : BettiTally                   |
+----------------------------------+
|i5 : betti res (HP^3)             |
|                                  |
|            0   1   2   3   4  5 6|
|o5 = total: 1 175 450 425 180 33 2|
|         0: 1   .   .   .   .  . .|
|         1: .   .   .   .   .  . .|
|         2: .   .   .   .   .  . .|
|         3: .   .   .   .   .  . .|
|         4: .   .   .   .   .  . .|
|         5: .   .   .   .   .  . .|
|         6: .   .   .   .   .  . .|
|         7: .   .   .   .   .  . .|
|         8: .   .   .   .   .  . .|
|         9: .   .   .   .   .  . .|
|        10: .   .   .   .   .  . .|
|        11: .   .   .   .   .  . .|
|        12: .   .   .   .   .  . .|
|        13: .   .   .   .   .  . .|
|        14: .   .   .   .   .  . .|
|        15: .   .   .   .   .  . .|
|        16: .   .   .   .   .  . .|
|        17: . 175 450 425 180 33 2|
|                                  |
|o5 : BettiTally                   |
+----------------------------------+

Moreover, they proved that the projective dimension of the Hibi ideal is the
Dilworth number of the poset, i.e., the maximum length of an antichain of $P$.

+---------------------+
|i6 : pdim module HP  |
|                     |
|o6 = 2               |
+---------------------+
|i7 : dilworthNumber P|
|                     |
|o7 = 2               |
+---------------------+

They further proved that the $i^{\rm th}$ Betti number of the quotient of a
Hibi ideal is the number of intervals of the distributiveLattice,
of $P$ isomorphic to the rank $i$ boolean lattice.  Using
an exercise in Stanley's ``Enumerative Combinatorics'', we recover this instead
by looking at the number of elements of the distributive lattice that cover
exactly $i$ elements.

+---------------------------------------------------------------+
|i8 : LP = distributiveLattice P;                               |
+---------------------------------------------------------------+
|i9 : cvrs = partition(last, coveringRelations LP);             |
+---------------------------------------------------------------+
|i10 : iCvrs = tally apply(keys cvrs, i -> #cvrs#i);            |
+---------------------------------------------------------------+
|i11 : gk = prepend(1, apply(sort keys iCvrs, k -> iCvrs#k))    |
|                                                               |
|o11 = {1, 6, 3}                                                |
|                                                               |
|o11 : List                                                     |
+---------------------------------------------------------------+
|i12 : apply(#gk, i -> sum(i..<#gk, j -> binomial(j, i) * gk_j))|
|                                                               |
|o12 = {10, 12, 3}                                              |
|                                                               |
|o12 : List                                                     |
+---------------------------------------------------------------+

See also
========

  * dilworthNumber -- computes the Dilworth number of a
    poset
  * distributiveLattice -- computes the lattice of
    order ideals of a poset
  * hibiIdeal -- produces the Hibi ideal of a poset

Example: Intersection lattices
******************************

The intersection lattice of a hyperplane arrangement $A$ is the lattice of
intersections in the arrangement partially ordered by containment.

+----------------------------------------------------------------+
|i1 : R = RR[x,y];                                               |
+----------------------------------------------------------------+
|i2 : A = {x + y, x, x - y, y + 1};                              |
+----------------------------------------------------------------+
|i3 : LA = intersectionLattice(A, R)                             |
|-- warning: experimental computation over inexact field begun   |
|--          results not reliable (one warning given per session)|
|                                                                |
|o3 = LA                                                         |
|                                                                |
|o3 : Poset                                                      |
+----------------------------------------------------------------+

A theorem of Zaslavsky provides information about the topology of the
complement of hyperplane arrangements over RR (Macaulay2Doc).  In
particular, the number of regions that $A$ divides RR (Macaulay2Doc),
into is derived from the moebiusFunction, of the
lattice.  This can also be accessed with the realRegions,
method.

+-------------------------------------------------+
|i4 : MF = moebiusFunction LA;                    |
+-------------------------------------------------+
|i5 : sum apply(LA_*, i -> abs(MF#(ideal 0_R, i)))|
|                                                 |
|o5 = 10                                          |
+-------------------------------------------------+

Furthermore, the number of these bounded regions can also be extracted from the
moebiusFunction, of the lattice; see also
boundedRegions.

+----------------------------------------------------+
|i6 : MF' = moebiusFunction adjoinMax(LA, ideal 1_R);|
+----------------------------------------------------+
|i7 : abs(MF'#(ideal 0_R, ideal 1_R))                |
|                                                    |
|o7 = 2                                              |
+----------------------------------------------------+

See also
========

  * boundedRegions -- computes the number of bounded
    regions a hyperplane arrangement divides the space into
  * intersectionLattice -- generates the
    intersection lattice of a hyperplane arrangement
  * moebiusFunction -- computes the Moebius function at
    every pair of elements of a poset
  * realRegions -- computes the number of regions a
    hyperplane arrangement divides the space into

Example: LCM-lattices
*********************

The LCM lattice of an Ideal (Macaulay2Doc), is the set of all LCMs
of subsets of the generators of the ideal with partial ordering given by
divisibility.  These are particularly useful in the study of resolutions of
monomial ideals.

+--------------------------------------------------------------------+
|i1 : R = QQ[a,b,c,d];                                               |
+--------------------------------------------------------------------+
|i2 : M = ideal(a^3*b^2*c, a^3*b^2*d, a^2*c*d, a*b*c^2*d, b^2*c^2*d);|
|                                                                    |
|o2 : Ideal of R                                                     |
+--------------------------------------------------------------------+
|i3 : LM = lcmLattice M;                                             |
+--------------------------------------------------------------------+

In particular, Gasharov, Peeva, and Welker provided a key connection between
the lcm-lattice of a monomial ideal and its minimal free resolution. In
particular, it is possible to use the lcm-lattice to compute the multigraded
Betti numbers of the ideal.

In particular, in the first example we show the $i^{\rm th}$ Betti number
associated to $a^2b^2c^2d$ is always $0$.

+-------------------------------------------------------------+
|i4 : D1 = orderComplex(openInterval(LM, 1_R, a^2*b^2*c^2*d));|
+-------------------------------------------------------------+
|i5 : prune HH(D1)                                            |
|                                                             |
|o5 = -1 : 0                                                  |
|                                                             |
|      0 : 0                                                  |
|                                                             |
|      1 : 0                                                  |
|                                                             |
|o5 : GradedModule                                            |
+-------------------------------------------------------------+

In the second example, we show that the $(1, a^3b^2cd)$ Betti number is $2$.

+-----------------------------------------------------------+
|i6 : D2 = orderComplex(openInterval(LM, 1_R, a^3*b^2*c*d));|
+-----------------------------------------------------------+
|i7 : prune HH(D2)                                          |
|                                                           |
|o7 = -1 : 0                                                |
|                                                           |
|            2                                              |
|      0 : QQ                                               |
|                                                           |
|o7 : GradedModule                                          |
+-----------------------------------------------------------+

See also
========

  * lcmLattice -- generates the lattice of lcms in an ideal
  * SimplicialComplexes -- exploring abstract
    simplicial complexes within commutative algebra

facePoset -- generates the face poset of a simplicial complex
*************************************************************

Synopsis
========

  * Usage:
        F = facePoset D
  * Inputs:
      * D, an abstract simplicial complex (SimplicialComplexes),
  * Outputs:
      * F, an instance of the type Poset,

Description
===========

The face poset of a SimplicialComplex (SimplicialComplexes),
is the poset of faces with partial
ordering given by inclusion.

+---------------------------------------------+
|i1 : R = QQ[a..d];                           |
+---------------------------------------------+
|i2 : facePoset simplicialComplex {a*b*c, c*d}|
|                                             |
|o2 = Relation Matrix: | 1 1 1 1 1 1 1 1 1 1 ||
|                      | 0 1 0 0 0 1 1 0 0 1 ||
|                      | 0 0 1 0 0 1 0 1 0 1 ||
|                      | 0 0 0 1 0 0 1 1 1 1 ||
|                      | 0 0 0 0 1 0 0 0 1 0 ||
|                      | 0 0 0 0 0 1 0 0 0 1 ||
|                      | 0 0 0 0 0 0 1 0 0 1 ||
|                      | 0 0 0 0 0 0 0 1 0 1 ||
|                      | 0 0 0 0 0 0 0 0 1 0 ||
|                      | 0 0 0 0 0 0 0 0 0 1 ||
|                                             |
|o2 : Poset                                   |
+---------------------------------------------+

See also
========

  * faces (Polyhedra) -- computes all faces of a certain
    codimension of a Cone or Polyhedron

Ways to use facePoset :
=======================

  * "facePoset(SimplicialComplex)"

For the programmer
==================

The object facePoset, is a method function (Macaulay2Doc).

filter -- computes the elements above given elements in a poset
***************************************************************

Synopsis
========

  * Usage:
        F = filter(P, L)
  * Inputs:
      * P, an instance of the type Poset,
      * L, a list (Macaulay2Doc), elements of the poset
  * Outputs:
      * F, a list (Macaulay2Doc), containing all elements greater
        than or equal to at least one of the given elements

Description
===========

The filter of a given set of elements of a poset is all the elements in the
poset which are greater than or equal to at least one of the elements in the
given set.

+-----------------------------------+
|i1 : P = booleanLattice 3;         |
+-----------------------------------+
|i2 : filter(P, {"001", "100"})     |
|                                   |
|o2 = {001, 011, 101, 111, 100, 110}|
|                                   |
|o2 : List                          |
+-----------------------------------+

See also
========

  * orderIdeal -- computes the elements below given elements
    in a poset
  * principalFilter -- computes the elements above a
    given element in a poset
  * principalOrderIdeal -- computes the elements
    below a given element in a poset

Ways to use filter :
====================

  * "filter(Poset,List)"

For the programmer
==================

The object filter, is a method function (Macaulay2Doc).

filtration -- generates the filtration of a poset
*************************************************

Synopsis
========

  * Usage:
        F = filtration P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * F, a list (Macaulay2Doc), the filtration of $P$

Description
===========

The filtration of $P$ is a partitioning $F$ of the vertices such that $F_0$ is
the set of minimal elements of $P$, $F_1$ is the set of minimal elements of $P
- F_0$, and so forth.

+---------------------------------------------------+
|i1 : P = poset {{a,b}, {b,c}, {c,d}, {a,e}, {e,d}};|
+---------------------------------------------------+
|i2 : filtration P                                  |
|                                                   |
|o2 = {{a}, {e, b}, {c}, {d}}                       |
|                                                   |
|o2 : List                                          |
+---------------------------------------------------+

The filtration of a ranked poset is the same as the ranking of the poset.

+-----------------------------------------------------+
|i3 : B = booleanLattice 3;                           |
+-----------------------------------------------------+
|i4 : F = filtration B                                |
|                                                     |
|o4 = {{000}, {001, 010, 100}, {011, 101, 110}, {111}}|
|                                                     |
|o4 : List                                            |
+-----------------------------------------------------+
|i5 : R = rankPoset B                                 |
|                                                     |
|o5 = {{000}, {001, 010, 100}, {011, 101, 110}, {111}}|
|                                                     |
|o5 : List                                            |
+-----------------------------------------------------+
|i6 : sort \ F === sort \ R                           |
|                                                     |
|o6 = true                                            |
+-----------------------------------------------------+

The flatten (Macaulay2Doc), of the filtration is a linear
extension of the poset.

+------------------------------------------+
|i7 : member(flatten F, linearExtensions B)|
|                                          |
|o7 = true                                 |
+------------------------------------------+

This method was ported from John Stembridge's Maple package available at
http://www.math.lsa.umich.edu/~jrs/maple.html#posets.

See also
========

  * linearExtensions -- computes all linear extensions
    of a poset
  * minimalElements -- determines the minimal elements
    of a poset
  * rankPoset -- generates a list of lists representing the
    ranks of a ranked poset

Ways to use filtration :
========================

  * "filtration(Poset)"

For the programmer
==================

The object filtration, is a method function (Macaulay2Doc).

flagChains -- computes the maximal chains in a list of flags of a ranked poset
******************************************************************************

Synopsis
========

  * Usage:
        C = flagChains(P, L)
  * Inputs:
      * P, an instance of the type Poset,
      * L, a list (Macaulay2Doc), containing rank indices
  * Outputs:
      * C, a list (Macaulay2Doc), all maximal chains of $P$
        containing only elements in the flags indexed by $L$

Description
===========

The flag chains of $P$ with respect to $L$ are exactly the maximalChains,
of the flagPoset, of $P$ with respect to $L$.

+-----------------------------------------------------------------------------+
|i1 : D = divisorPoset(2^2*3*5);                                              |
+-----------------------------------------------------------------------------+
|i2 : rankFunction D                                                          |
|                                                                             |
|o2 = {0, 1, 1, 2, 1, 2, 2, 3, 2, 3, 3, 4}                                    |
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+
|i3 : flagChains(D, {1,2,3})                                                  |
|                                                                             |
|o3 = {{2, 4, 12}, {2, 6, 12}, {3, 6, 12}, {2, 4, 20}, {2, 10, 20}, {5, 10,   |
|     ------------------------------------------------------------------------|
|     20}, {2, 6, 30}, {3, 6, 30}, {2, 10, 30}, {5, 10, 30}, {3, 15, 30}, {5, |
|     ------------------------------------------------------------------------|
|     15, 30}}                                                                |
|                                                                             |
|o3 : List                                                                    |
+-----------------------------------------------------------------------------+

See also
========

  * flagPoset -- computes the subposet of specified ranks of
    a ranked poset
  * isRanked -- determines if a poset is ranked
  * maximalChains -- computes all maximal chains of a
    poset
  * rankPoset -- generates a list of lists representing the
    ranks of a ranked poset

Ways to use flagChains :
========================

  * "flagChains(Poset,List)"

For the programmer
==================

The object flagChains, is a method function (Macaulay2Doc).

flagfPolynomial -- computes the flag-f polynomial of a ranked poset
*******************************************************************

Synopsis
========

  * Usage:
        ff = flagfPolynomial P
        ff = flagfPolynomial(P, VariableName => symbol)
  * Inputs:
      * P, an instance of the type Poset, a ranked poset
  * Optional inputs (Macaulay2Doc),:
      * VariableName => a symbol (Macaulay2Doc), default value q
  * Outputs:
      * ff, a ring element (Macaulay2Doc), the flag-f
        polynomial of $P$

Description
===========

Suppose $P$ is a rank $r$ poset.  For each strictly increasing sequence $(i_1,
\ldots, i_k)$ with $0 \leq i_j \leq i_k$, the coefficient of $q_i_1 \cdots
q_i_k$ is the number of flagChains, in the ranks $i_1,
\cdots, i_k$.

The flag-f polynomial of the $n$ See chain, is $(q_0 +
1)\cdots(q_{n-1}+1)$.

+-------------------------------------+
|i1 : n = 4;                          |
+-------------------------------------+
|i2 : factor flagfPolynomial chain n  |
|                                     |
|o2 = (q  + 1)(q  + 1)(q  + 1)(q  + 1)|
|       3       2       1       0     |
|                                     |
|o2 : Expression of class Product     |
+-------------------------------------+

See also
========

  * flagChains -- computes the maximal chains in a list of
    flags of a ranked poset
  * flaghPolynomial -- computes the flag-h polynomial
    of a ranked poset
  * isRanked -- determines if a poset is ranked

Ways to use flagfPolynomial :
=============================

  * "flagfPolynomial(Poset)"

For the programmer
==================

The object flagfPolynomial, is a method function with options (Macaulay2Doc).

flaghPolynomial -- computes the flag-h polynomial of a ranked poset
*******************************************************************

Synopsis
========

  * Usage:
        fh = flaghPolynomial P
        fh = flaghPolynomial(P, VariableName => symbol)
  * Inputs:
      * P, an instance of the type Poset, a ranked poset
  * Optional inputs (Macaulay2Doc),:
      * VariableName => a symbol (Macaulay2Doc), default value q
  * Outputs:
      * fh, a ring element (Macaulay2Doc), the flag-h
        polynomial of $P$

Description
===========

Suppose $f$ is the flagfPolynomial, of $P$.  The flag-h
polynomial of $P$ is the polynomial $(1-q_0)\cdots(1-q_r)f(q_0/(1-q_0), \ldots,
q_r/(1-q_r))$.

+-------------------------------------+
|i1 : flaghPolynomial booleanLattice 3|
|                                     |
|o1 = q q  + 2q  + 2q  + 1            |
|      1 2     1     2                |
|                                     |
|o1 : ZZ[q ..q ]                      |
|         0   3                       |
+-------------------------------------+

The flag-h polynomial of the $n$ See chain, is $1$.

+----------------------------+
|i2 : flaghPolynomial chain 5|
|                            |
|o2 = 1                      |
|                            |
|o2 : ZZ[q ..q ]             |
|         0   4              |
+----------------------------+

See also
========

  * flagChains -- computes the maximal chains in a list of
    flags of a ranked poset
  * flagfPolynomial -- computes the flag-f polynomial
    of a ranked poset
  * isRanked -- determines if a poset is ranked

Ways to use flaghPolynomial :
=============================

  * "flaghPolynomial(Poset)"

For the programmer
==================

The object flaghPolynomial, is a method function with options (Macaulay2Doc).

flagPoset -- computes the subposet of specified ranks of a ranked poset
***********************************************************************

Synopsis
========

  * Usage:
        F = flagPoset(P, L)
  * Inputs:
      * P, an instance of the type Poset,
      * L, a list (Macaulay2Doc), containing rank indices
  * Outputs:
      * F, an instance of the type Poset, the subposet of $P$ of
        only the ranks specified in $L$

Description
===========

The flag poset with respect to a list of rank indices is the subposet induced
by the specified ranks.  The maximal chains of the flag poset can be computed
with the flagChains, method.

+-----------------------------------------------------+
|i1 : P = booleanLattice 4;                           |
+-----------------------------------------------------+
|i2 : rankFunction P                                  |
|                                                     |
|o2 = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4}|
|                                                     |
|o2 : List                                            |
+-----------------------------------------------------+
|i3 : flagPoset(P, {2,3})                             |
|                                                     |
|o3 = Relation Matrix: | 1 0 0 1 0 0 1 0 0 0 |        |
|                      | 0 1 0 1 0 0 0 0 1 0 |        |
|                      | 0 0 1 1 0 0 0 0 0 1 |        |
|                      | 0 0 0 1 0 0 0 0 0 0 |        |
|                      | 0 0 0 0 1 0 1 0 1 0 |        |
|                      | 0 0 0 0 0 1 1 0 0 1 |        |
|                      | 0 0 0 0 0 0 1 0 0 0 |        |
|                      | 0 0 0 0 0 0 0 1 1 1 |        |
|                      | 0 0 0 0 0 0 0 0 1 0 |        |
|                      | 0 0 0 0 0 0 0 0 0 1 |        |
|                                                     |
|o3 : Poset                                           |
+-----------------------------------------------------+
|i4 : flagPoset(P, {1})                               |
|                                                     |
|o4 = Relation Matrix: | 1 0 0 0 |                    |
|                      | 0 1 0 0 |                    |
|                      | 0 0 1 0 |                    |
|                      | 0 0 0 1 |                    |
|                                                     |
|o4 : Poset                                           |
+-----------------------------------------------------+

See also
========

  * flagChains -- computes the maximal chains in a list of
    flags of a ranked poset
  * isRanked -- determines if a poset is ranked
  * rankPoset -- generates a list of lists representing the
    ranks of a ranked poset

Ways to use flagPoset :
=======================

  * "flagPoset(Poset,List)"

For the programmer
==================

The object flagPoset, is a method function (Macaulay2Doc).

fPolynomial -- computes the f-polynomial of a poset
***************************************************

Synopsis
========

  * Usage:
        f = fPolynomial P
        f = fPolynomial(P, VariableName => symbol)
  * Inputs:
      * P, an instance of the type Poset,
  * Optional inputs (Macaulay2Doc),:
      * VariableName => a symbol (Macaulay2Doc), default value q
  * Outputs:
      * f, a ring element (Macaulay2Doc), the f-polynomial
        of $P$

Description
===========

The f-polynomial of $P$ is the polynomial such that the coefficient on $q^i$ is
the number of chains, of length $i$ in $P$.

The f-polynomial of the $n$ See chain, is $(q+1)^n$.

+--------------------------------+
|i1 : n = 5;                     |
+--------------------------------+
|i2 : factor fPolynomial chain n |
|                                |
|            5                   |
|o2 = (q + 1)                    |
|                                |
|o2 : Expression of class Product|
+--------------------------------+

See also
========

  * chains -- computes all chains of a poset
  * hPolynomial -- computes the h-polynomial of a poset

Ways to use fPolynomial :
=========================

  * "fPolynomial(Poset)"

For the programmer
==================

The object fPolynomial, is a method function with options (Macaulay2Doc).

gapConvertPoset -- converts between Macaulay2's Posets and GAP's Posets
***********************************************************************

Synopsis
========

  * Usage:
        P = gapConvertPoset A
        P = gapConvertPoset S
        S = gapConvertPoset P
  * Inputs:
      * A, an array (Macaulay2Doc), representing a poset in
        GAP-format
      * S, a string (Macaulay2Doc), representing a poset in
        GAP-format
      * P, an instance of the type Poset,
  * Outputs:
      * S, a string (Macaulay2Doc), representing a poset in
        GAP-format
      * P, an instance of the type Poset,

Description
===========

The GAP package Simplicial Homology, available at
http://www.eecis.udel.edu/~dumas/Homology/, provides methods for using posets
within GAP.  According to the documentation, posets are stored in GAP in the
following manor:  The ground set is the set of integers $1..n+1$ and the
relations are stored in a list of length $n$, where the $i$th entry is the set
of vertices which cover $i$ in the poset.  In particular, $1$ should be the
unique minimal element and $n+1$ should be the unique maximal element.

When converting from GAP format, the conversion is direct using the above
convention. In this example, S is generated with the GAP command
OrderRelationToPoset(Subsets([1,2,3]), IsSubset);.

+-----------------------------------------------------------------------------+
|i1 : S = "[ [ 3 ], [ 10 ], [ 4, 7, 9 ], [ 5, 6 ], [ 2 ], [ 2 ], [ 5, 8 ], [ 2|
|-----------------------------------------------------------------------------|
|], [ 6, 8 ], [  ] ]";                                                        |
+-----------------------------------------------------------------------------+
|i2 : P = gapConvertPoset S                                                   |
|                                                                             |
|o2 = P                                                                       |
|                                                                             |
|o2 : Poset                                                                   |
+-----------------------------------------------------------------------------+
|i3 : P == augmentPoset booleanLattice 3                                      |
|                                                                             |
|o3 = true                                                                    |
+-----------------------------------------------------------------------------+

When converting to GAP format, the method automatically augments the poset.  In
this example, the $3$ chain becomes a $5$ chain in GAP format.

+-----------------------------+
|i4 : gapConvertPoset chain 3 |
|                             |
|o4 = [[2], [3], [4], [5], []]|
+-----------------------------+

See also
========

  * poset -- creates a new Poset object

Ways to use gapConvertPoset :
=============================

  * "gapConvertPoset(Array)"
  * "gapConvertPoset(Poset)"
  * "gapConvertPoset(String)"

For the programmer
==================

The object gapConvertPoset, is a method function (Macaulay2Doc).

greeneKleitmanPartition -- computes the Greene-Kleitman partition of a poset
****************************************************************************

Synopsis
========

  * Usage:
        l = greeneKleitmanPartition P
        l = greeneKleitmanPartition(P, Strategy => "chains")
        l = greeneKleitmanPartition(P, Strategy => "antichains")
  * Inputs:
      * P, an instance of the type Poset,
  * Optional inputs (Macaulay2Doc),:
      * Strategy => a string (Macaulay2Doc), default value
        "antichains", either "chains" or "antichains"
  * Outputs:
      * l, an instance of the type Partition (Macaulay2Doc),
        the Greene-Kleitman partition of $P$

Description
===========

The Greene-Kleitman partition $l$ of $P$ is the partition such that the sum of
the first $k$ parts of $l$ is the maximum number of elements in a union of $k$
See chains, in $P$.

+-----------------------------------------------+
|i1 : P = poset {{1,2},{2,3},{3,4},{2,5},{6,3}};|
+-----------------------------------------------+
|i2 : greeneKleitmanPartition P                 |
|                                               |
|o2 = Partition{4, 2}                           |
|                                               |
|o2 : Partition                                 |
+-----------------------------------------------+

The conjugate of $l$ has the same property, but with chains replaced by
antichains.  Because of this, it is often better to count via
antichains instead of chains.  This can be done by passing "antichains" as the
Strategy.

+--------------------------------------------------------------+
|i3 : D = dominanceLattice 6;                                  |
+--------------------------------------------------------------+
|i4 : time greeneKleitmanPartition(D, Strategy => "antichains")|
|     -- used 0.143273 seconds                                 |
|                                                              |
|o4 = Partition{9, 2}                                          |
|                                                              |
|o4 : Partition                                                |
+--------------------------------------------------------------+
|i5 : time greeneKleitmanPartition(D, Strategy => "chains")    |
|     -- used 5.899e-6 seconds                                 |
|                                                              |
|o5 = Partition{9, 2}                                          |
|                                                              |
|o5 : Partition                                                |
+--------------------------------------------------------------+

The Greene-Kleitman partition of the $n$ See chain, is the partition
of $n$ with $1$ part.

+-------------------------------------+
|i6 : greeneKleitmanPartition chain 10|
|                                     |
|o6 = Partition{10}                   |
|                                     |
|o6 : Partition                       |
+-------------------------------------+

See also
========

  * chains -- computes all chains of a poset
  * antichains -- computes all antichains of a poset

Ways to use greeneKleitmanPartition :
=====================================

  * "greeneKleitmanPartition(Poset)"

For the programmer
==================

The object greeneKleitmanPartition, is a
method function with options (Macaulay2Doc).

hasseDiagram -- produces the Hasse diagram of a poset
*****************************************************

Synopsis
========

  * Usage:
        D = hasseDiagram P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * D, a digraph (Graphs), which has the direct edge $(a,b)$
        if and only if $a < b$ in $P$ and if $a \leq c \leq b$ then $c = a$ or
        $c = b$.

Description
===========

The Hasse diagram of a poset is a Digraph (Graphs), with vertices
given by the ground set of $P$ and which has the direct edge $(a,b)$ if and
only if $a < b$ in $P$ and there exists no $c$ such that $a < c < b$.

+----------------------------------+
|i1 : hasseDiagram booleanLattice 3|
|                                  |
|o1 = Digraph{0 => {1, 2, 4}}      |
|             1 => {3, 5}          |
|             2 => {3, 6}          |
|             3 => {7}             |
|             4 => {5, 6}          |
|             5 => {7}             |
|             6 => {7}             |
|             7 => {}              |
|                                  |
|o1 : Digraph                      |
+----------------------------------+

Caveat
======

This method renames the vertices with integers $0, 1, \ldots$ corresponding to
the index of the vertices in the GroundSet.

See also
========

  * coveringRelations -- computes the minimal list of
    generating relations of a poset
  * displayPoset -- generates a PDF representation of a
    poset and attempts to display it

Ways to use hasseDiagram :
==========================

  * "hasseDiagram(Poset)"

For the programmer
==================

The object hasseDiagram, is a method function (Macaulay2Doc).

height(Poset) -- computes the height of a poset
***********************************************

Synopsis
========

  * Function: height (Macaulay2Doc),
  * Usage:
        h = height P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * h, an integer (Macaulay2Doc), the height of $P$

Description
===========

The height of a poset is one less than the length of the longest chain.

The $n$ See chain, has height $n-1$.

+-------------------+
|i1 : n = 5;        |
+-------------------+
|i2 : height chain n|
|                   |
|o2 = 4             |
+-------------------+

See also
========

  * chains -- computes all chains of a poset
  * maximalChains -- computes all maximal chains of a
    poset

Ways to use this method:
========================

  * height(Poset) -- computes the height of a poset

hibiIdeal -- produces the Hibi ideal of a poset
***********************************************

Synopsis
========

  * Usage:
        H = hibiIdeal P
  * Inputs:
      * P, an instance of the type Poset,
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing => a ring (Macaulay2Doc), default value QQ,
        which specifies the coefficient ring of the PolynomialRing (Macaulay2Doc),
        $H$ is constructed in
  * Outputs:
      * H, a monomial ideal (Macaulay2Doc), the Hibi ideal
        of $P$

Description
===========

The Hibi ideal of $P$ is a MonomialIdeal (Macaulay2Doc),
built over a ring in $2n$ variables $x_0, \ldots, x_{n-1}, y_0, \ldots,
y_{n-1}$, where $n$ is the size of the ground set of $P$. The generators of the
ideal are in bijection with order ideals in $P$.  Let $I$ be an order ideal of
$P$.  Then the associated monomial is the product of the $x_i$ associated with
members of $I$ and the $y_i$ associated with non-members of $I$.

+---------------------------------------------------+
|i1 : hibiIdeal chain 3                             |
|                                                   |
|o1 = monomialIdeal (x x x , x x y , x y y , y y y )|
|                     0 1 2   0 1 2   0 1 2   0 1 2 |
|                                                   |
|o1 : MonomialIdeal of QQ[x ..x , y ..y ]           |
|                          0   2   0   2            |
+---------------------------------------------------+

See also
========

  * hibiRing -- produces the Hibi ring of a poset
  * orderIdeal -- computes the elements below given elements
    in a poset
  * principalOrderIdeal -- computes the elements
    below a given element in a poset

Ways to use hibiIdeal :
=======================

  * "hibiIdeal(Poset)"

For the programmer
==================

The object hibiIdeal, is a method function with options (Macaulay2Doc).

hibiRing -- produces the Hibi ring of a poset
*********************************************

Synopsis
========

  * Usage:
        H = hibiRing P
        H = hibiRing(P, Strategy => "kernel")
        H = hibiRing(P, Strategy => "4ti2")
  * Inputs:
      * P, an instance of the type Poset,
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing => a ring (Macaulay2Doc), default value QQ,
        which specifies the coefficient ring of the PolynomialRing (Macaulay2Doc),
        $H$
      * Strategy => a string (Macaulay2Doc), default value
        "kernel", which specifies whether to use Macaulay2's native
        kernel (Macaulay2Doc), method (Strategy => "kernel") or the
        package FourTiTwo, (Strategy => "4ti2")
  * Outputs:
      * H, a quotient ring (Macaulay2Doc), the toric
        algebra which is isomorphic to the Hibi ring of $P$

Description
===========

The Hibi ring of $P$ is a monomial algebra generated by the monomials which
generate the Hibi ideal (see hibiIdeal).  That is, the monomials
built in $2n$ variables $x_0, \ldots, x_{n-1}, y_0, \ldots, y_{n-1}$, where $n$
is the size of the ground set of $P$. The monomials are in bijection with order
ideals in $P$.  Let $I$ be an order ideal of $P$. Then the associated monomial
is the product of the $x_i$ associated with members of $I$ and the $y_i$
associated with non-members of $I$.

This method returns the toric quotient algebra isomorphic to the Hibi ring.
The ideal is the ideal of Hibi relations.  The generators of the
PolynomialRing (Macaulay2Doc), $H$ is built over are of the form
$t_I$ where $I$ is an order ideal of $P$.

+---------------------------------------------------------------+
|i1 : hibiRing booleanLattice 2                                 |
|                                                               |
|     QQ[t  , t   , t      , t         , t      , t            ]|
|         {}   {0}   {0, 1}   {0, 1, 2}   {0, 2}   {0, 1, 2, 3} |
|o1 = ----------------------------------------------------------|
|                   t   t          - t      t                   |
|                    {0} {0, 1, 2}    {0, 1} {0, 2}             |
|                                                               |
|o1 : QuotientRing                                              |
+---------------------------------------------------------------+

The Hibi ring of the $n$ chain is just a polynomial ring in $n+1$ variables.

+------------------------------------------------------+
|i2 : hibiRing chain 4                                 |
|                                                      |
|o2 = QQ[t  , t   , t      , t         , t            ]|
|         {}   {0}   {0, 1}   {0, 1, 2}   {0, 1, 2, 3} |
|                                                      |
|o2 : PolynomialRing                                   |
+------------------------------------------------------+

In some cases, it may be faster to use the FourTiTwo,
method toricGroebner (FourTiTwo), to generate the Hibi
relations.  Using the Strategy "4ti2" tells the method to use this approach.

+---------------------------------------------------------------+
|i3 : hibiRing(divisorPoset 6, Strategy => "4ti2")              |
|                                                               |
|     QQ[t  , t   , t      , t         , t      , t            ]|
|         {}   {0}   {0, 1}   {0, 1, 2}   {0, 2}   {0, 1, 2, 3} |
|o3 = ----------------------------------------------------------|
|                  - t   t          + t      t                  |
|                     {0} {0, 1, 2}    {0, 1} {0, 2}            |
|                                                               |
|o3 : QuotientRing                                              |
+---------------------------------------------------------------+

See also
========

  * hibiIdeal -- produces the Hibi ideal of a poset
  * orderIdeal -- computes the elements below given elements
    in a poset
  * principalOrderIdeal -- computes the elements
    below a given element in a poset
  * pPartitionRing -- produces the p-partition ring of a
    poset

Ways to use hibiRing :
======================

  * "hibiRing(Poset)"

For the programmer
==================

The object hibiRing, is a method function with options (Macaulay2Doc).

hPolynomial -- computes the h-polynomial of a poset
***************************************************

Synopsis
========

  * Usage:
        h = hPolynomial P
        h = hPolynomial(P, VariableName => symbol)
  * Inputs:
      * P, an instance of the type Poset,
  * Optional inputs (Macaulay2Doc),:
      * VariableName => a symbol (Macaulay2Doc), default value q
  * Outputs:
      * h, a ring element (Macaulay2Doc), the h-polynomial
        of $P$

Description
===========

Suppose $f$ is the fPolynomial, of $P$, and $d$ is the
degree of $f$.  Then the h-polynomial of $P$ is the polynomial $(1-q)^d
f(q/(1-q))$.

+---------------------------------+
|i1 : hPolynomial booleanLattice 3|
|                                 |
|      2                          |
|o1 = q  + 4q + 1                 |
|                                 |
|o1 : ZZ[q]                       |
+---------------------------------+

The h-polynomial of the $n$ See chain, is $1$.

+------------------------+
|i2 : hPolynomial chain 5|
|                        |
|o2 = 1                  |
|                        |
|o2 : ZZ[q]              |
+------------------------+

See also
========

  * chains -- computes all chains of a poset
  * fPolynomial -- computes the f-polynomial of a poset

Ways to use hPolynomial :
=========================

  * "hPolynomial(Poset)"

For the programmer
==================

The object hPolynomial, is a method function with options (Macaulay2Doc).

incomparabilityGraph -- produces the incomparability graph of a poset
*********************************************************************

Synopsis
========

  * Usage:
        G = incomparabilityGraph P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * G, a graph (Graphs), which has an edge between two
        vertices if they are incomparable in $P$

Description
===========

The comparability graph of a poset $P$ is the Graph (Graphs), with
vertices given by the ground set of $P$ and which has edges between two
vertices if they are incomparable in $P$.

+------------------------------------------+
|i1 : incomparabilityGraph booleanLattice 3|
|                                          |
|o1 = Graph{0 => {}       }                |
|           1 => {2, 4, 6}                 |
|           2 => {1, 4, 5}                 |
|           3 => {4, 6, 5}                 |
|           4 => {1, 2, 3}                 |
|           5 => {2, 6, 3}                 |
|           6 => {1, 5, 3}                 |
|           7 => {}                        |
|                                          |
|o1 : Graph                                |
+------------------------------------------+

Caveat
======

This method renames the vertices with integers $0, 1, \ldots$ corresponding to
the index of the vertices in the GroundSet.

See also
========

  * comparabilityGraph -- produces the comparability
    graph of a poset
  * compare -- compares two elements in a poset

Ways to use incomparabilityGraph :
==================================

  * "incomparabilityGraph(Poset)"

For the programmer
==================

The object incomparabilityGraph, is a method function (Macaulay2Doc).

indexLabeling -- relabels a poset with the labeling based on the indices of the vertices
****************************************************************************************

Synopsis
========

  * Usage:
        Q = indexLabeling P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * Q, an instance of the type Poset,

Description
===========

This method simply relabels the ground set of the poset based on the indices of
the vertices.

+---------------------------------------------+
|i1 : P = booleanLattice 3;                   |
+---------------------------------------------+
|i2 : Q = indexLabeling P;                    |
+---------------------------------------------+
|i3 : P.GroundSet                             |
|                                             |
|o3 = {000, 001, 010, 011, 100, 101, 110, 111}|
|                                             |
|o3 : List                                    |
+---------------------------------------------+
|i4 : Q.GroundSet                             |
|                                             |
|o4 = {0, 1, 2, 3, 4, 5, 6, 7}                |
|                                             |
|o4 : List                                    |
+---------------------------------------------+

Clearly, $P$ and $Q$ See areIsomorphic.

+-----------+
|i5 : P == Q|
|           |
|o5 = true  |
+-----------+

This can be useful for posets whose vertices have unruly names. Note the cache
of $P$ is copied to the cache of $Q$ with the appropriate adjustments being
made.

See also
========

  * Poset _ ZZ -- returns an element of the ground set
  * Poset _ List -- returns elements of the ground set
  * labelPoset -- relabels a poset with the specified
    labeling
  * naturalLabeling -- relabels a poset with a natural
    labeling

Ways to use indexLabeling :
===========================

  * "indexLabeling(Poset)"

For the programmer
==================

The object indexLabeling, is a method function (Macaulay2Doc).

intersectionLattice -- generates the intersection lattice of a hyperplane arrangement
*************************************************************************************

Synopsis
========

  * Usage:
        P = intersectionLattice(L, R)
  * Inputs:
      * L, a list (Macaulay2Doc), which gives the equations
        defining the hyperplane arrangement
      * R, a ring (Macaulay2Doc), which the hyperplanes are defined
        over
  * Outputs:
      * P, an instance of the type Poset,

Description
===========

The intersection lattice of a hyperplane arrangement is the lattice of
intersections in the arrangement partially ordered by containment.

+--------------------------------------------+
|i1 : R = QQ[x,y,z];                         |
+--------------------------------------------+
|i2 : intersectionLattice({x+y, x+z, y+z}, R)|
|                                            |
|o2 = Relation Matrix: | 1 0 1 0 1 0 1 0 |   |
|                      | 0 1 1 0 0 1 1 0 |   |
|                      | 0 0 1 0 0 0 1 0 |   |
|                      | 0 0 0 1 1 1 1 0 |   |
|                      | 0 0 0 0 1 0 1 0 |   |
|                      | 0 0 0 0 0 1 1 0 |   |
|                      | 0 0 0 0 0 0 1 0 |   |
|                      | 1 1 1 1 1 1 1 1 |   |
|                                            |
|o2 : Poset                                  |
+--------------------------------------------+

See also
========

  * projectivizeArrangement -- computes the
    intersection poset of a projectivized hyperplane arrangement

Ways to use intersectionLattice :
=================================

  * "intersectionLattice(List,Ring)"

For the programmer
==================

The object intersectionLattice, is a method function (Macaulay2Doc).

isAntichain -- determines if a given list of vertices is an antichain of a poset
********************************************************************************

Synopsis
========

  * Usage:
        i = isAntichain(P, L)
  * Inputs:
      * P, an instance of the type Poset,
      * L, a list (Macaulay2Doc), containing elements of $P$
  * Outputs:
      * i, a Boolean value (Macaulay2Doc), whether $L$ is an
        antichain of $P$

Description
===========

A set of elements of $P$ is called an antichain if no two distinct elements of
the set are comparable.

+--------------------------+
|i1 : D = divisorPoset 12; |
+--------------------------+
|i2 : isAntichain(D, {2,3})|
|                          |
|o2 = true                 |
+--------------------------+
|i3 : isAntichain(D, {2,6})|
|                          |
|o3 = false                |
+--------------------------+

See also
========

  * antichains -- computes all antichains of a poset

Ways to use isAntichain :
=========================

  * "isAntichain(Poset,List)"

For the programmer
==================

The object isAntichain, is a method function (Macaulay2Doc).

isAtomic -- determines if a lattice is atomic
*********************************************

Synopsis
========

  * Usage:
        i = isAtomic P
  * Inputs:
      * P, an instance of the type Poset, a lattice
  * Outputs:
      * i, a Boolean value (Macaulay2Doc), whether $P$ is atomic

Description
===========

The lattice $P$ is atomic if every non-minimal vertex of $P$ is the join of
atoms of $P$.  Equivalently, $P$ is atomic if every non-minimal, non-atom
vertex of $P$ covers at least two vertices.

The diamond poset is atomic.  Also $n$ See booleanLattice,s
are atomic.

+----------------------------------------------------------------+
|i1 : P = poset {{1, 2}, {1, 3}, {1, 4}, {2, 5}, {3, 5}, {4, 5}};|
+----------------------------------------------------------------+
|i2 : isLattice P                                                |
|                                                                |
|o2 = true                                                       |
+----------------------------------------------------------------+
|i3 : isAtomic P                                                 |
|                                                                |
|o3 = true                                                       |
+----------------------------------------------------------------+
|i4 : isAtomic booleanLattice 4                                  |
|                                                                |
|o4 = true                                                       |
+----------------------------------------------------------------+

The following lattice is non-atomic.  Also, $n$ See chain,s are
non-atomic, for $n \geq 3$.

+------------------------------------------------------------------------+
|i5 : Q = poset {{1, 2}, {1, 3}, {2, 4}, {2, 5}, {3, 4}, {4, 6}, {5, 6}};|
+------------------------------------------------------------------------+
|i6 : isLattice Q                                                        |
|                                                                        |
|o6 = true                                                               |
+------------------------------------------------------------------------+
|i7 : isAtomic Q                                                         |
|                                                                        |
|o7 = false                                                              |
+------------------------------------------------------------------------+
|i8 : isAtomic chain 5                                                   |
|                                                                        |
|o8 = false                                                              |
+------------------------------------------------------------------------+

See also
========

  * atoms -- computes the list of elements covering the minimal
    elements of a poset
  * isLattice -- determines if a poset is a lattice

Ways to use isAtomic :
======================

  * "isAtomic(Poset)"

For the programmer
==================

The object isAtomic, is a method function (Macaulay2Doc).

isBounded -- determines if a poset is bounded
*********************************************

Synopsis
========

  * Usage:
        i = isBounded P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * i, a Boolean value (Macaulay2Doc), whether $P$ is
        bounded

Description
===========

The poset $P$ is bounded if it has a unique minimal element and a unique
maximal element.

The $n$ See chain, and $n$ See booleanLattice, are
bounded.

+--------------------------+
|i1 : n = 5;               |
+--------------------------+
|i2 : isBounded chain n    |
|                          |
|o2 = true                 |
+--------------------------+
|i3 : B = booleanLattice n;|
+--------------------------+
|i4 : isBounded B          |
|                          |
|o4 = true                 |
+--------------------------+

The middle ranks of an $n$ boolean lattice are not bounded.

+--------------------------------------+
|i5 : isBounded flagPoset(B, {1,2,3,4})|
|                                      |
|o5 = false                            |
+--------------------------------------+

See also
========

  * maximalElements -- determines the maximal elements
    of a poset
  * minimalElements -- determines the minimal elements
    of a poset

Ways to use isBounded :
=======================

  * "isBounded(Poset)"

For the programmer
==================

The object isBounded, is a method function (Macaulay2Doc).

isComparabilityGraph -- determines if a graph is the comparability graph of a poset
***********************************************************************************

Synopsis
========

  * Usage:
        i = isComparabilityGraph G
  * Inputs:
      * G, a graph (Graphs),
  * Outputs:
      * i, a Boolean value (Macaulay2Doc), whether $G$ is a
        comparability graph of a poset

Description
===========

A Graph (Graphs), $G$ is a comparabilityGraph,
of a poset if it is has a transitiveOrientation.

+---------------------------------------------+
|i1 : G = comparabilityGraph booleanLattice 5;|
+---------------------------------------------+
|i2 : isComparabilityGraph G                  |
|                                             |
|o2 = true                                    |
+---------------------------------------------+

However, a non-triangular odd cycle is never a comparability graph.

+---------------------------------------------------+
|i3 : G = graph {{1,2}, {2,3}, {3,4}, {4,5}, {1,5}};|
+---------------------------------------------------+
|i4 : isComparabilityGraph G                        |
|                                                   |
|o4 = false                                         |
+---------------------------------------------------+

This method calls transitiveOrientation, and
checks that an error is not thrown.  See the documentation for that method for
a note on the implemented algorithm.

See also
========

  * comparabilityGraph -- produces the comparability
    graph of a poset
  * transitiveOrientation -- generates a poset
    whose comparability graph is the given graph

Ways to use isComparabilityGraph :
==================================

  * "isComparabilityGraph(Graph)"

For the programmer
==================

The object isComparabilityGraph, is a method function (Macaulay2Doc).

isConnected(Poset) -- determines if a poset is connected
********************************************************

Synopsis
========

  * Function: isConnected (Graphs),
  * Usage:
        i = isConnected P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * i, a Boolean value (Macaulay2Doc), whether $P$ is
        connected

Description
===========

The poset $P$ is connected if the number of connectedComponents (SimplicialComplexes),
is $1$.
Equivalently, the poset $P$ is connected if between every pair of vertices in
$P$ there exists a chain of relations going from one to the other.

The divisorPoset, of $n$ is always connected.

+--------------------------------+
|i1 : isConnected divisorPoset 18|
|                                |
|o1 = true                       |
+--------------------------------+

The disjoint union of any two posets on disjoint vertex sets is disconnected.

+-----------------------------------------------+
|i2 : C = chain 3;                              |
+-----------------------------------------------+
|i3 : P = sum(5, i -> naturalLabeling(C, 10*i));|
+-----------------------------------------------+
|i4 : isConnected P                             |
|                                               |
|o4 = false                                     |
+-----------------------------------------------+

See also
========

  * connectedComponents (SimplicialComplexes)
    -- find
    the connected components of an abstract simplicial complex

Ways to use this method:
========================

  * isConnected(Poset) -- determines if a poset
    is connected

isDistributive -- determines if a lattice is distributive
*********************************************************

Synopsis
========

  * Usage:
        i = isDistributive P
  * Inputs:
      * P, an instance of the type Poset, a lattice
  * Outputs:
      * i, a Boolean value (Macaulay2Doc), whether $P$ is
        distributive

Description
===========

The lattice $P$ is distributive if the meet operation distributes over the join
operation.  Equivalently, $P$ is distributive if the join operation distributes
over the meet operation.

The $n$ See booleanLattice, is distributive.

+------------------------------------+
|i1 : isDistributive booleanLattice 3|
|                                    |
|o1 = true                           |
+------------------------------------+

The pentagon lattice and diamond lattice are prototypical non-distributive
lattices.

+----------------------------------------------------------+
|i2 : P = poset {{1,2}, {1,3}, {3,4}, {2,5}, {4, 5}};      |
+----------------------------------------------------------+
|i3 : isLattice P                                          |
|                                                          |
|o3 = true                                                 |
+----------------------------------------------------------+
|i4 : isDistributive P                                     |
|                                                          |
|o4 = false                                                |
+----------------------------------------------------------+
|i5 : D = poset {{1,2}, {1,3}, {1,4}, {2,5}, {3,5}, {4,5}};|
+----------------------------------------------------------+
|i6 : isLattice D                                          |
|                                                          |
|o6 = true                                                 |
+----------------------------------------------------------+
|i7 : isDistributive D                                     |
|                                                          |
|o7 = false                                                |
+----------------------------------------------------------+

See also
========

  * posetJoin -- determines the join for two elements of a
    poset
  * posetMeet -- determines the meet for two elements of a
    poset
  * isLattice -- determines if a poset is a lattice

Ways to use isDistributive :
============================

  * "isDistributive(Poset)"

For the programmer
==================

The object isDistributive, is a method function (Macaulay2Doc).

isEulerian(Poset) -- determines if a ranked poset is Eulerian
*************************************************************

Synopsis
========

  * Function: isEulerian (Graphs),
  * Usage:
        i = isEulerian P
  * Inputs:
      * P, an instance of the type Poset, a ranked poset
  * Outputs:
      * i, a Boolean value (Macaulay2Doc), whether $P$ is
        Eulerian

Description
===========

The poset $P$ is Eulerian if every non-trivial closedInterval,
of $P$ has an equal number of vertices of even and odd rank.

The $n$ See chain, is non-Eulerian for $n \geq 3$.

+------------------------+
|i1 : isEulerian chain 10|
|                        |
|o1 = false              |
+------------------------+

The facePoset, of the simplicialComplex (SimplicialComplexes),
of an $n$ cycle is Eulerian.

+----------------------------------------------------------------------+
|i2 : n = 10;                                                          |
+----------------------------------------------------------------------+
|i3 : R = QQ[x_0..x_(n-1)];                                            |
+----------------------------------------------------------------------+
|i4 : F = facePoset simplicialComplex apply(n, i -> x_i * x_((i+1)%n));|
+----------------------------------------------------------------------+
|i5 : isEulerian F                                                     |
|                                                                      |
|o5 = true                                                             |
+----------------------------------------------------------------------+

See also
========

  * closedInterval -- computes the subposet contained
    between two points
  * isRanked -- determines if a poset is ranked
  * moebiusFunction -- computes the Moebius function at
    every pair of elements of a poset

Ways to use this method:
========================

  * isEulerian(Poset) -- determines if a ranked
    poset is Eulerian

isGeometric -- determines if a lattice is geometric
***************************************************

Synopsis
========

  * Usage:
        i = isGeometric P
  * Inputs:
      * P, an instance of the type Poset, a lattice
  * Outputs:
      * i, a Boolean value (Macaulay2Doc), whether $P$ is
        geometric

Description
===========

The lattice $P$ is geometric if it isAtomic, and
isUpperSemimodular.

The diamond poset is geometric.  Also $n$ See booleanLattice,
s are geometric.

+----------------------------------------------------------------+
|i1 : P = poset {{1, 2}, {1, 3}, {1, 4}, {2, 5}, {3, 5}, {4, 5}};|
+----------------------------------------------------------------+
|i2 : isLattice P                                                |
|                                                                |
|o2 = true                                                       |
+----------------------------------------------------------------+
|i3 : isGeometric P                                              |
|                                                                |
|o3 = true                                                       |
+----------------------------------------------------------------+
|i4 : isGeometric booleanLattice 4                               |
|                                                                |
|o4 = true                                                       |
+----------------------------------------------------------------+

The following lattice is non-geometric.

+------------------------------------------------------------------------+
|i5 : Q = poset {{1, 2}, {1, 3}, {2, 4}, {2, 5}, {3, 4}, {4, 6}, {5, 6}};|
+------------------------------------------------------------------------+
|i6 : isLattice Q                                                        |
|                                                                        |
|o6 = true                                                               |
+------------------------------------------------------------------------+
|i7 : isGeometric                                                        |
|                                                                        |
|o7 = isGeometric                                                        |
|                                                                        |
|o7 : MethodFunction                                                     |
+------------------------------------------------------------------------+

See also
========

  * isAtomic -- determines if a lattice is atomic
  * isLattice -- determines if a poset is a lattice
  * isUpperSemimodular -- determines if a lattice is
    upper semimodular

Ways to use isGeometric :
=========================

  * "isGeometric(Poset)"

For the programmer
==================

The object isGeometric, is a method function (Macaulay2Doc).

isGraded -- determines if a poset is graded
*******************************************

Synopsis
========

  * Usage:
        i = isGraded P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * i, a Boolean value (Macaulay2Doc), whether the maximal
        chains of $P$ are the same length

Description
===========

The poset $P$ is graded if all of its maximalChains, are
the same length.

Clearly, the $n$ See chain, and the $n$ See booleanLattice,
are graded.

+------------------------------+
|i1 : n = 5;                   |
+------------------------------+
|i2 : isGraded chain n         |
|                              |
|o2 = true                     |
+------------------------------+
|i3 : isGraded booleanLattice n|
|                              |
|o3 = true                     |
+------------------------------+

However, the pentagon lattice is not graded.

+----------------------------------------------------+
|i4 : P = poset {{1,2}, {1,3}, {3,4}, {2,5}, {4, 5}};|
+----------------------------------------------------+
|i5 : isGraded P                                     |
|                                                    |
|o5 = false                                          |
+----------------------------------------------------+

See also
========

  * chains -- computes all chains of a poset
  * maximalChains -- computes all maximal chains of a
    poset

Ways to use isGraded :
======================

  * "isGraded(Poset)"

For the programmer
==================

The object isGraded, is a method function (Macaulay2Doc).

isLattice -- determines if a poset is a lattice
***********************************************

Synopsis
========

  * Usage:
        i = isLattice P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * i, a Boolean value (Macaulay2Doc), whether $P$ is a
        lattice

Description
===========

The poset $P$ is a lattice if every pair of vertices has a unique least upper
bound and a unique greatest lower bound, i.e., every pair of vertices has a
unique meet and a unique join.  Equivalently, the poset $P$ is a lattice if it
is both a lower semilattice and an upper semilattice.

Clearly, the $n$ See chain, and the $n$ See booleanLattice,
are lattices.

+--------------------------+
|i1 : n = 4;               |
+--------------------------+
|i2 : isLattice chain n    |
|                          |
|o2 = true                 |
+--------------------------+
|i3 : B = booleanLattice n;|
+--------------------------+
|i4 : isLattice B          |
|                          |
|o4 = true                 |
+--------------------------+

The middle ranks of the $n$ See booleanLattice, are not
lattices.

+------------------------------------+
|i5 : isLattice flagPoset(B, {1,2,3})|
|                                    |
|o5 = false                          |
+------------------------------------+

See also
========

  * isBounded -- determines if a poset is bounded
  * isLowerSemilattice -- determines if a poset is a
    lower (or meet) semilattice
  * isUpperSemilattice -- determines if a poset is
    an upper (or join) semilattice
  * joinExists -- determines if the join exists for two
    elements of a poset
  * meetExists -- determines if the meet exists for two
    elements of a poset

Ways to use isLattice :
=======================

  * "isLattice(Poset)"

For the programmer
==================

The object isLattice, is a method function (Macaulay2Doc).

isLowerSemilattice -- determines if a poset is a lower (or meet) semilattice
****************************************************************************

Synopsis
========

  * Usage:
        i = isLowerSemilattice P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * i, a Boolean value (Macaulay2Doc), whether $P$ is a
        lower semilattice

Description
===========

The poset $P$ is a lower semilattice if every pair of vertices has a unique
greatest lower bound (meet).

Clearly, the $n$ See chain, and the $n$ See booleanLattice,
are lower semilattices.

+-------------------------------+
|i1 : n = 4;                    |
+-------------------------------+
|i2 : isLowerSemilattice chain n|
|                               |
|o2 = true                      |
+-------------------------------+
|i3 : B = booleanLattice n;     |
+-------------------------------+
|i4 : isLowerSemilattice B      |
|                               |
|o4 = true                      |
+-------------------------------+

The middle ranks of the $n$ See booleanLattice, are not lower
semilattices.

+---------------------------------------------+
|i5 : isLowerSemilattice flagPoset(B, {1,2,3})|
|                                             |
|o5 = false                                   |
+---------------------------------------------+

However, the lower ranks of the $n$ See booleanLattice, are
non-lattice lower semilattices.

+----------------------------------+
|i6 : B' = flagPoset(B, {0,1,2,3});|
+----------------------------------+
|i7 : isLattice B'                 |
|                                  |
|o7 = false                        |
+----------------------------------+
|i8 : isLowerSemilattice B'        |
|                                  |
|o8 = true                         |
+----------------------------------+

See also
========

  * isLattice -- determines if a poset is a lattice
  * isUpperSemilattice -- determines if a poset is
    an upper (or join) semilattice
  * meetExists -- determines if the meet exists for two
    elements of a poset

Ways to use isLowerSemilattice :
================================

  * "isLowerSemilattice(Poset)"

For the programmer
==================

The object isLowerSemilattice, is a method function (Macaulay2Doc).

isLowerSemimodular -- determines if a ranked lattice is lower semimodular
*************************************************************************

Synopsis
========

  * Usage:
        i = isLowerSemimodular P
  * Inputs:
      * P, an instance of the type Poset, a ranked lattice
  * Outputs:
      * i, a Boolean value (Macaulay2Doc), whether $P$ is lower
        semimodular

Description
===========

Let $r$ be the ranking of $P$.  Then $P$ is lower semimodular if for every pair
of vertices $a$ and $b$, $r(a) + r(b) \leq r(join(a,b)) + r(meet(a,b,))$.

The $n$ See chain, and the $n$ See booleanLattice,
are lower semimodular.

+----------------------------------------+
|i1 : n = 4;                             |
+----------------------------------------+
|i2 : isLowerSemimodular chain n         |
|                                        |
|o2 = true                               |
+----------------------------------------+
|i3 : isLowerSemimodular booleanLattice n|
|                                        |
|o3 = true                               |
+----------------------------------------+

The following lattice is not lower semimodular.

+-----------------------------------------------------------------------------+
|i4 : P = poset {{1, 2}, {1, 5}, {2, 3}, {2, 4}, {3, 7}, {4, 7}, {5, 4}, {5,  |
|-----------------------------------------------------------------------------|
|6}, {6, 7}};                                                                 |
+-----------------------------------------------------------------------------+
|i5 : isLattice P                                                             |
|                                                                             |
|o5 = true                                                                    |
+-----------------------------------------------------------------------------+
|i6 : isLowerSemimodular P                                                    |
|                                                                             |
|o6 = false                                                                   |
+-----------------------------------------------------------------------------+

This method was ported from John Stembridge's Maple package available at
http://www.math.lsa.umich.edu/~jrs/maple.html#posets.

See also
========

  * isLattice -- determines if a poset is a lattice
  * isModular -- determines if a lattice is modular
  * isRanked -- determines if a poset is ranked
  * posetJoin -- determines the join for two elements of a
    poset
  * posetMeet -- determines the meet for two elements of a
    poset
  * rankFunction -- computes the rank function of a ranked
    poset

Ways to use isLowerSemimodular :
================================

  * "isLowerSemimodular(Poset)"

For the programmer
==================

The object isLowerSemimodular, is a method function (Macaulay2Doc).

isModular -- determines if a lattice is modular
***********************************************

Synopsis
========

  * Usage:
        i = isModular P
  * Inputs:
      * P, an instance of the type Poset, a ranked lattice
  * Outputs:
      * i, a Boolean value (Macaulay2Doc), whether $P$ is
        modular

Description
===========

Let $r$ be the ranking of $P$.  Then $P$ is modular if for every pair of
vertices $a$ and $b$, $r(a) + r(b) = r(join(a,b)) + r(meet(a,b,))$. That is,
$P$ is modular if it isLowerSemimodular, and
isUpperSemimodular.

The $n$ See chain, and the $n$ See booleanLattice,
are modular.

+-------------------------------+
|i1 : n = 4;                    |
+-------------------------------+
|i2 : isModular chain n         |
|                               |
|o2 = true                      |
+-------------------------------+
|i3 : isModular booleanLattice n|
|                               |
|o3 = true                      |
+-------------------------------+

The following lattice is not modular.

+-----------------------------------------------------------------------------+
|i4 : P = poset {{1, 2}, {1, 5}, {2, 3}, {2, 4}, {3, 7}, {4, 7}, {5, 4}, {5,  |
|-----------------------------------------------------------------------------|
|6}, {6, 7}};                                                                 |
+-----------------------------------------------------------------------------+
|i5 : isLattice P                                                             |
|                                                                             |
|o5 = true                                                                    |
+-----------------------------------------------------------------------------+
|i6 : isModular P                                                             |
|                                                                             |
|o6 = false                                                                   |
+-----------------------------------------------------------------------------+

This method uses the methods isLowerSemimodular, and
isUpperSemimodular, which were ported from John
Stembridge's Maple package available at
http://www.math.lsa.umich.edu/~jrs/maple.html#posets.

See also
========

  * isLattice -- determines if a poset is a lattice
  * isLowerSemimodular -- determines if a ranked
    lattice is lower semimodular
  * isRanked -- determines if a poset is ranked
  * isUpperSemimodular -- determines if a lattice is
    upper semimodular
  * posetJoin -- determines the join for two elements of a
    poset
  * posetMeet -- determines the meet for two elements of a
    poset
  * rankFunction -- computes the rank function of a ranked
    poset

Ways to use isModular :
=======================

  * "isModular(Poset)"

For the programmer
==================

The object isModular, is a method function (Macaulay2Doc).

isomorphism -- computes an isomorphism between isomorphic posets
****************************************************************

Synopsis
========

  * Usage:
        pi' = isomorphism(P, Q)
  * Inputs:
      * P, an instance of the type Poset,
      * Q, an instance of the type Poset,
  * Outputs:
      * pi', a hash table (Macaulay2Doc), which specifies a
        partial order preserving bijection from the ground set of $P$ to the
        ground set of $Q$

Description
===========

Two posets are isomorphic if there is a partial order preserving bijection
between the ground sets of the posets which preserves the specified ground set
partitions.

+--------------------------------------------------------+
|i1 : isomorphism(divisorPoset (2*3*5), booleanLattice 3)|
|                                                        |
|o1 = HashTable{1 => 000 }                               |
|               2 => 001                                 |
|               3 => 010                                 |
|               5 => 100                                 |
|               6 => 011                                 |
|               10 => 101                                |
|               15 => 110                                |
|               30 => 111                                |
|                                                        |
|o1 : HashTable                                          |
+--------------------------------------------------------+

This method was inspired by John Stembridge's Maple package available at
http://www.math.lsa.umich.edu/~jrs/maple.html#posets.

See also
========

  * areIsomorphic -- determines if two posets are
    isomorphic
  * removeIsomorphicPosets -- returns a sub-list
    of non-isomorphic posets

Ways to use isomorphism :
=========================

  * "isomorphism(Poset,Poset)"

For the programmer
==================

The object isomorphism, is a method function (Macaulay2Doc).

isRanked -- determines if a poset is ranked
*******************************************

Synopsis
========

  * Usage:
        i = isRanked P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * i, a Boolean value (Macaulay2Doc), whether $P$ is ranked

Description
===========

The poset $P$ is ranked if there exists an integer function $r$ on the vertex
set of $P$ such that for each $a$ and $b$ in the poset if $b$ covers $a$ then
$r(b) - r(a) = 1$.

The $n$ See chain, and the $n$ See booleanLattice,
are ranked.

+-----------------------------+
|i1 : n = 5;                  |
+-----------------------------+
|i2 : C = chain n;            |
+-----------------------------+
|i3 : isRanked C              |
|                             |
|o3 = true                    |
+-----------------------------+
|i4 : rankFunction C          |
|                             |
|o4 = {0, 1, 2, 3, 4}         |
|                             |
|o4 : List                    |
+-----------------------------+
|i5 : B = booleanLattice n;   |
+-----------------------------+
|i6 : isRanked B              |
|                             |
|o6 = true                    |
+-----------------------------+
|i7 : rankGeneratingFunction C|
|                             |
|      4    3    2            |
|o7 = q  + q  + q  + q + 1    |
|                             |
|o7 : ZZ[q]                   |
+-----------------------------+

However, the pentagon lattice is not ranked.

+---------------------------------------------------+
|i8 : P = poset {{1,2}, {1,3}, {3,4}, {2,5}, {4,5}};|
+---------------------------------------------------+
|i9 : isRanked P                                    |
|                                                   |
|o9 = false                                         |
+---------------------------------------------------+

This method uses the method rankPoset, which was ported from
John Stembridge's Maple package available at
http://www.math.lsa.umich.edu/~jrs/maple.html#posets.

See also
========

  * rankFunction -- computes the rank function of a ranked
    poset
  * rankGeneratingFunction -- computes the rank
    generating function of a ranked poset
  * rankPoset -- generates a list of lists representing the
    ranks of a ranked poset

Ways to use isRanked :
======================

  * "isRanked(Poset)"

For the programmer
==================

The object isRanked, is a method function (Macaulay2Doc).

isSperner -- determines if a ranked poset has the Sperner property
******************************************************************

Synopsis
========

  * Usage:
        i = isSperner P
  * Inputs:
      * P, an instance of the type Poset, a ranked poset
  * Outputs:
      * i, a Boolean value (Macaulay2Doc), whether $P$ is
        Sperner

Description
===========

The ranked poset $P$ is Sperner if the maximum size of a set of elements with
the same rank is the dilworthNumber, of $P$.  That is,
$P$ is Sperner if the maximum size of a set of elements with the same rank is
the maximum size of an antichain.

The $n$ See chain, and the $n$ See booleanLattice,
are Sperner.

+-------------------------------+
|i1 : n = 5;                    |
+-------------------------------+
|i2 : isSperner chain n         |
|                               |
|o2 = true                      |
+-------------------------------+
|i3 : isSperner booleanLattice n|
|                               |
|o3 = true                      |
+-------------------------------+

However, the following poset is non-Sperner as it has an antichain of size $4$
but the set of elements of rank $0$ and the set of elements of rank $1$ are
both of size $3$.

+---------------------------------------------------+
|i4 : P = poset {{1,4}, {1,5}, {1,6}, {2,6}, {3,6}};|
+---------------------------------------------------+
|i5 : isSperner P                                   |
|                                                   |
|o5 = false                                         |
+---------------------------------------------------+
|i6 : isAntichain(P, {2,3,4,5})                     |
|                                                   |
|o6 = true                                          |
+---------------------------------------------------+
|i7 : rankGeneratingFunction P                      |
|                                                   |
|o7 = 3q + 3                                        |
|                                                   |
|o7 : ZZ[q]                                         |
+---------------------------------------------------+

See also
========

  * dilworthNumber -- computes the Dilworth number of a
    poset
  * isRanked -- determines if a poset is ranked
  * isStrictSperner -- determines if a ranked poset has
    the strict Sperner property
  * maximalAntichains -- computes all maximal
    antichains of a poset
  * rankFunction -- computes the rank function of a ranked
    poset

Ways to use isSperner :
=======================

  * "isSperner(Poset)"

For the programmer
==================

The object isSperner, is a method function (Macaulay2Doc).

isStrictSperner -- determines if a ranked poset has the strict Sperner property
*******************************************************************************

Synopsis
========

  * Usage:
        i = isStrictSperner P
  * Inputs:
      * P, an instance of the type Poset, a ranked poset
  * Outputs:
      * i, a Boolean value (Macaulay2Doc), whether $P$ is strict
        Sperner

Description
===========

The ranked poset $P$ is strict Sperner if the maximalAntichains,
are the sets of elements with the same rank.

The $n$ See chain, is strict Sperner as the maximal antichains and the
sets of elements with the same rank are singletons.

+----------------------------+
|i1 : isStrictSperner chain 5|
|                            |
|o1 = true                   |
+----------------------------+

The $n$ See booleanLattice, for $n \geq 3$, is not strict
Sperner as it has maximal antichains which are not sets of elements with the
same rank.

+-----------------------------------------------------------------------------+
|i2 : B = booleanLattice 3;                                                   |
+-----------------------------------------------------------------------------+
|i3 : isStrictSperner B                                                       |
|                                                                             |
|o3 = false                                                                   |
+-----------------------------------------------------------------------------+
|i4 : rankPoset B                                                             |
|                                                                             |
|o4 = {{000}, {001, 010, 100}, {011, 101, 110}, {111}}                        |
|                                                                             |
|o4 : List                                                                    |
+-----------------------------------------------------------------------------+
|i5 : maximalAntichains B                                                     |
|                                                                             |
|o5 = {{000}, {111}, {001, 110}, {010, 101}, {011, 100}, {001, 010, 100},     |
|     ------------------------------------------------------------------------|
|     {011, 101, 110}}                                                        |
|                                                                             |
|o5 : List                                                                    |
+-----------------------------------------------------------------------------+

See also
========

  * dilworthNumber -- computes the Dilworth number of a
    poset
  * isRanked -- determines if a poset is ranked
  * isSperner -- determines if a ranked poset has the Sperner
    property
  * maximalAntichains -- computes all maximal
    antichains of a poset
  * rankFunction -- computes the rank function of a ranked
    poset

Ways to use isStrictSperner :
=============================

  * "isStrictSperner(Poset)"

For the programmer
==================

The object isStrictSperner, is a method function (Macaulay2Doc).

isUpperSemilattice -- determines if a poset is an upper (or join) semilattice
*****************************************************************************

Synopsis
========

  * Usage:
        i = isUpperSemilattice P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * i, a Boolean value (Macaulay2Doc), whether $P$ is an
        upper semilattice

Description
===========

The poset $P$ is an upper semilattice if every pair of vertices has a unique
least upper bound (join).

Clearly, the $n$ See chain, and the $n$ See booleanLattice,
are upper semilattices.

+-------------------------------+
|i1 : n = 4;                    |
+-------------------------------+
|i2 : isUpperSemilattice chain n|
|                               |
|o2 = true                      |
+-------------------------------+
|i3 : B = booleanLattice n;     |
+-------------------------------+
|i4 : isUpperSemilattice B      |
|                               |
|o4 = true                      |
+-------------------------------+

The middle ranks of the $n$ See booleanLattice, are not upper
semilattices.

+---------------------------------------------+
|i5 : isUpperSemilattice flagPoset(B, {1,2,3})|
|                                             |
|o5 = false                                   |
+---------------------------------------------+

However, the upper ranks of the $n$ See booleanLattice, are
non-lattice upper semilattices.

+----------------------------------+
|i6 : B' = flagPoset(B, {1,2,3,4});|
+----------------------------------+
|i7 : isLattice B'                 |
|                                  |
|o7 = false                        |
+----------------------------------+
|i8 : isUpperSemilattice B'        |
|                                  |
|o8 = true                         |
+----------------------------------+

See also
========

  * isLattice -- determines if a poset is a lattice
  * isLowerSemilattice -- determines if a poset is a
    lower (or meet) semilattice
  * joinExists -- determines if the join exists for two
    elements of a poset

Ways to use isUpperSemilattice :
================================

  * "isUpperSemilattice(Poset)"

For the programmer
==================

The object isUpperSemilattice, is a method function (Macaulay2Doc).

isUpperSemimodular -- determines if a lattice is upper semimodular
******************************************************************

Synopsis
========

  * Usage:
        i = isUpperSemimodular P
  * Inputs:
      * P, an instance of the type Poset, a ranked lattice
  * Outputs:
      * i, a Boolean value (Macaulay2Doc), whether $P$ is upper
        semimodular

Description
===========

Let $r$ be the ranking of $P$.  Then $P$ is upper semimodular if for every pair
of vertices $a$ and $b$, $r(a) + r(b) \geq r(join(a,b)) + r(meet(a,b,))$.

The $n$ See chain, and the $n$ See booleanLattice,
are upper semimodular.

+----------------------------------------+
|i1 : n = 4;                             |
+----------------------------------------+
|i2 : isUpperSemimodular chain n         |
|                                        |
|o2 = true                               |
+----------------------------------------+
|i3 : isUpperSemimodular booleanLattice n|
|                                        |
|o3 = true                               |
+----------------------------------------+

The following lattice is not upper semimodular.

+-----------------------------------------------------------------------------+
|i4 : P = poset {{1, 2}, {1, 3}, {1, 4}, {2, 5}, {2, 6}, {3, 5}, {4, 6}, {5,  |
|-----------------------------------------------------------------------------|
|7}, {6, 7}};                                                                 |
+-----------------------------------------------------------------------------+
|i5 : isLattice P                                                             |
|                                                                             |
|o5 = true                                                                    |
+-----------------------------------------------------------------------------+
|i6 : isUpperSemimodular P                                                    |
|                                                                             |
|o6 = false                                                                   |
+-----------------------------------------------------------------------------+

This method was ported from John Stembridge's Maple package available at
http://www.math.lsa.umich.edu/~jrs/maple.html#posets.

See also
========

  * isLattice -- determines if a poset is a lattice
  * isModular -- determines if a lattice is modular
  * isRanked -- determines if a poset is ranked
  * posetJoin -- determines the join for two elements of a
    poset
  * posetMeet -- determines the meet for two elements of a
    poset
  * rankFunction -- computes the rank function of a ranked
    poset

Ways to use isUpperSemimodular :
================================

  * "isUpperSemimodular(Poset)"

For the programmer
==================

The object isUpperSemimodular, is a method function (Macaulay2Doc).

joinExists -- determines if the join exists for two elements of a poset
***********************************************************************

Synopsis
========

  * Usage:
        j = joinExists(P, a, b)
  * Inputs:
      * P, an instance of the type Poset,
      * a, a thing (Macaulay2Doc), an element of the poset
      * b, a thing (Macaulay2Doc), an element of the poset
  * Outputs:
      * j, a Boolean value (Macaulay2Doc), whether the join
        exists for $a$ and $b$ in $P$

Description
===========

The join of $a$ and $b$ in $P$, if it exists, is the unique least element
greater than both $a$ and $b$.

+----------------------------------------------------------+
|i1 : P = poset {{a,b}, {a,c}, {a,d}, {c,e}, {d,e}};       |
+----------------------------------------------------------+
|i2 : joinExists(P, b, c)                                  |
|                                                          |
|o2 = false                                                |
+----------------------------------------------------------+
|i3 : joinExists(P, c, d)                                  |
|                                                          |
|o3 = true                                                 |
+----------------------------------------------------------+
|i4 : Q = poset {{a,b}, {a,c}, {b,d}, {c,d}, {b,e}, {c,e}};|
+----------------------------------------------------------+
|i5 : joinExists(P, b, c)                                  |
|                                                          |
|o5 = false                                                |
+----------------------------------------------------------+

See also
========

  * meetExists -- determines if the meet exists for two
    elements of a poset
  * posetJoin -- determines the join for two elements of a
    poset
  * posetMeet -- determines the meet for two elements of a
    poset

Ways to use joinExists :
========================

  * "joinExists(Poset,Thing,Thing)"

For the programmer
==================

The object joinExists, is a method function (Macaulay2Doc).

joinIrreducibles -- determines the join irreducible elements of a poset
***********************************************************************

Synopsis
========

  * Usage:
        J = joinIrreducibles P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * J, a list (Macaulay2Doc),

Description
===========

An element $a$ of $P$ is join irreducible if it is not the join of any set of
elements not containing $a$.

+--------------------------------------+
|i1 : joinIrreducibles booleanLattice 3|
|                                      |
|o1 = {000, 001, 100, 010}             |
|                                      |
|o1 : List                             |
+--------------------------------------+

See also
========

  * joinExists -- determines if the join exists for two
    elements of a poset
  * meetIrreducibles -- determines the meet
    irreducible elements of a poset
  * posetJoin -- determines the join for two elements of a
    poset

Ways to use joinIrreducibles :
==============================

  * "joinIrreducibles(Poset)"

For the programmer
==================

The object joinIrreducibles, is a method function (Macaulay2Doc).

labelPoset -- relabels a poset with the specified labeling
**********************************************************

Synopsis
========

  * Usage:
        Q = labelPoset(P, l)
  * Inputs:
      * P, an instance of the type Poset,
      * l, a hash table (Macaulay2Doc), with $P.GroundSet$ as
        the keys and the new labels as the values
  * Outputs:
      * Q, an instance of the type Poset, a poset isomorphic to
        $P$

Description
===========

This method simply relabels the ground set of the poset based on given
labeling.

+-------------------------------------------------------------+
|i1 : P = chain 5;                                            |
+-------------------------------------------------------------+
|i2 : l = hashTable { 1 => a, 2 => b, 3 => c, 4 => d, 5 => e};|
+-------------------------------------------------------------+
|i3 : Q = labelPoset(P, l);                                   |
+-------------------------------------------------------------+
|i4 : P.GroundSet                                             |
|                                                             |
|o4 = {1, 2, 3, 4, 5}                                         |
|                                                             |
|o4 : List                                                    |
+-------------------------------------------------------------+
|i5 : Q.GroundSet                                             |
|                                                             |
|o5 = {a, b, c, d, e}                                         |
|                                                             |
|o5 : List                                                    |
+-------------------------------------------------------------+

Clearly, $P$ and $Q$ See areIsomorphic.

+-----------+
|i6 : P == Q|
|           |
|o6 = true  |
+-----------+

See also
========

  * Poset _ ZZ -- returns an element of the ground set
  * Poset _ List -- returns elements of the ground set
  * indexLabeling -- relabels a poset with the labeling
    based on the indices of the vertices
  * isomorphism -- computes an isomorphism between
    isomorphic posets
  * naturalLabeling -- relabels a poset with a natural
    labeling

Ways to use labelPoset :
========================

  * "labelPoset(Poset,HashTable)"

For the programmer
==================

The object labelPoset, is a method function (Macaulay2Doc).

lcmLattice -- generates the lattice of lcms in an ideal
*******************************************************

Synopsis
========

  * Usage:
        P = lcmLattice I
  * Inputs:
      * I, an ideal (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * Strategy => an integer (Macaulay2Doc), default value
        "recursive", either "subsets" or "recursive" (default)
  * Outputs:
      * P, an instance of the type Poset,

Description
===========

The LCM lattice of an Ideal (Macaulay2Doc), is the set of all LCMs
of subsets of the generators of the ideal with partial ordering given by
divisibility.  These are particularly useful in the study of resolutions of
monomial ideals.  Note that the minimal element of an LCM lattice will always
be defined to be $1$ in the ring $R$ containing $I$ rather than $1$ in ZZ.

+------------------------------------------------+
|i1 : R = QQ[x,y];                               |
+------------------------------------------------+
|i2 : L = lcmLattice monomialIdeal(x^2, x*y, y^2)|
|                                                |
|o2 = L                                          |
|                                                |
|o2 : Poset                                      |
+------------------------------------------------+
|i3 : compare (L, 1_R, x^2*y);                   |
+------------------------------------------------+

Note that if $I$ is not a MonomialIdeal (Macaulay2Doc),
then the method automatically uses the Strategy "subsets."

See also
========

  * lcm (Macaulay2Doc) -- least common multiple

Ways to use lcmLattice :
========================

  * "lcmLattice(Ideal)"

For the programmer
==================

The object lcmLattice, is a method function with options (Macaulay2Doc).

linearExtensions -- computes all linear extensions of a poset
*************************************************************

Synopsis
========

  * Usage:
        L = linearExtensions P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * L, a list (Macaulay2Doc), all possible linear extensions of
        $P$

Description
===========

A linear extension of the partial order on $P$ is a total order on the elements
of $P$ that is compatible with the partial order.

+-----------------------------------------------------------------------------+
|i1 : P = divisorPoset 12;                                                    |
+-----------------------------------------------------------------------------+
|i2 : L = linearExtensions P                                                  |
|                                                                             |
|o2 = {{1, 2, 3, 6, 4, 12}, {1, 2, 3, 4, 6, 12}, {1, 2, 4, 3, 6, 12}, {1, 3,  |
|     ------------------------------------------------------------------------|
|     2, 6, 4, 12}, {1, 3, 2, 4, 6, 12}}                                      |
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+

The flatten (Macaulay2Doc), of the filtration,
of $P$ is always a linear extension.  This approach is much faster, especially
for posets with many linear extensions.

+-----------------------------+
|i3 : F = flatten filtration P|
|                             |
|o3 = {1, 2, 3, 4, 6, 12}     |
|                             |
|o3 : List                    |
+-----------------------------+
|i4 : member(F, L)            |
|                             |
|o4 = true                    |
+-----------------------------+

The partial order of a chain, is the total order of the elements.

+--------------------------------------+
|i5 : linearExtensions chain 10        |
|                                      |
|o5 = {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}|
|                                      |
|o5 : List                             |
+--------------------------------------+

This method was ported from John Stembridge's Maple package available at
http://www.math.lsa.umich.edu/~jrs/maple.html#posets.

See also
========

  * filtration -- generates the filtration of a poset

Ways to use linearExtensions :
==============================

  * "linearExtensions(Poset)"

For the programmer
==================

The object linearExtensions, is a method function (Macaulay2Doc).

magnitude -- computes the magnitude of a poset
**********************************************

Synopsis
========

  * Usage:
        z = magnitude P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * z, an integer (Macaulay2Doc), the magnitude of $P$

Description
===========

The magnitude of $P$ is the sum over all relations $v \leq w$ of the Möbius
number $\mu(v,w)$.

This integer is multiplicative for Cartesian product of posets, and additive
for disjoint union.

+--------------------------+
|i1 : B = booleanLattice 3;|
+--------------------------+
|i2 : z = magnitude B      |
|                          |
|o2 = 1                    |
+--------------------------+

Ways to use magnitude :
=======================

  * "magnitude(Poset)"

For the programmer
==================

The object magnitude, is a method function (Macaulay2Doc).

maximalAntichains -- computes all maximal antichains of a poset
***************************************************************

Synopsis
========

  * Usage:
        M = maximalAntichains P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * M, a list (Macaulay2Doc), all maximal antichains of $P$

Description
===========

A set of elements of $P$ is called an antichain if no two distinct elements of
the set are comparable.  An antichain is maximal if it is not properly
contained in any other antichain of $P$.

+------------------------------------------------------------------+
|i1 : maximalAntichains divisorPoset 30                            |
|                                                                  |
|o1 = {{1}, {30}, {2, 15}, {3, 10}, {5, 6}, {2, 3, 5}, {6, 10, 15}}|
|                                                                  |
|o1 : List                                                         |
+------------------------------------------------------------------+

See also
========

  * antichains -- computes all antichains of a poset
  * maximalChains -- computes all maximal chains of a
    poset

Ways to use maximalAntichains :
===============================

  * "maximalAntichains(Poset)"

For the programmer
==================

The object maximalAntichains, is a method function (Macaulay2Doc).

maximalChains -- computes all maximal chains of a poset
*******************************************************

Synopsis
========

  * Usage:
        M = maximalChains P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * M, a list (Macaulay2Doc), all maximal chains of $P$

Description
===========

A set of elements of $P$ is called a chain if every pair of elements of the set
are comparable.  A chain is maximal if it is not properly contained in any
other chain of $P$.

+-----------------------------------------------------------------------------+
|i1 : maximalChains divisorPoset 30                                           |
|                                                                             |
|o1 = {{1, 2, 6, 30}, {1, 2, 10, 30}, {1, 3, 6, 30}, {1, 3, 15, 30}, {1, 5,   |
|     ------------------------------------------------------------------------|
|     10, 30}, {1, 5, 15, 30}}                                                |
|                                                                             |
|o1 : List                                                                    |
+-----------------------------------------------------------------------------+

See also
========

  * chains -- computes all chains of a poset
  * maximalAntichains -- computes all maximal
    antichains of a poset

Ways to use maximalChains :
===========================

  * "maximalChains(Poset)"

For the programmer
==================

The object maximalChains, is a method function (Macaulay2Doc).

maximalElements -- determines the maximal elements of a poset
*************************************************************

Synopsis
========

  * Usage:
        M = maximalElements P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * M, a list (Macaulay2Doc),

Description
===========

An element of $P$ is a maximal element if it no other element of $P$ is greater
than it.

+-------------------------------------+
|i1 : P = poset {{a,b}, {a,c}, {c,d}};|
+-------------------------------------+
|i2 : maximalElements P               |
|                                     |
|o2 = {b, d}                          |
|                                     |
|o2 : List                            |
+-------------------------------------+

See also
========

  * minimalElements -- determines the minimal elements
    of a poset

Ways to use maximalElements :
=============================

  * "maximalElements(Poset)"

For the programmer
==================

The object maximalElements, is a method function (Macaulay2Doc).

meetExists -- determines if the meet exists for two elements of a poset
***********************************************************************

Synopsis
========

  * Usage:
        m = meetExists(P, a, b)
  * Inputs:
      * P, an instance of the type Poset,
      * a, a thing (Macaulay2Doc), an element of the poset
      * b, a thing (Macaulay2Doc), an element of the poset
  * Outputs:
      * m, a Boolean value (Macaulay2Doc), whether the meet
        exists for $a$ and $b$ in $P$

Description
===========

The meet of $a$ and $b$ in $P$, if it exists, is the unique greatest element
less than both $a$ and $b$.

+----------------------------------------------------------+
|i1 : P = poset {{a,b}, {a,c}, {b,d}, {c,d}, {e,d}};       |
+----------------------------------------------------------+
|i2 : meetExists(P, b, c)                                  |
|                                                          |
|o2 = true                                                 |
+----------------------------------------------------------+
|i3 : meetExists(P, b, e)                                  |
|                                                          |
|o3 = false                                                |
+----------------------------------------------------------+
|i4 : Q = poset {{a,b}, {a,c}, {d,b}, {d,c}, {b,e}, {c,e}};|
+----------------------------------------------------------+
|i5 : meetExists(Q, b, c)                                  |
|                                                          |
|o5 = false                                                |
+----------------------------------------------------------+

See also
========

  * joinExists -- determines if the join exists for two
    elements of a poset
  * posetJoin -- determines the join for two elements of a
    poset
  * posetMeet -- determines the meet for two elements of a
    poset

Ways to use meetExists :
========================

  * "meetExists(Poset,Thing,Thing)"

For the programmer
==================

The object meetExists, is a method function (Macaulay2Doc).

meetIrreducibles -- determines the meet irreducible elements of a poset
***********************************************************************

Synopsis
========

  * Usage:
        M = meetIrreducibles P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * M, a list (Macaulay2Doc),

Description
===========

An element $a$ of $P$ is meet irreducible if it is not the meet of any set of
elements not containing $a$.

+--------------------------------------+
|i1 : meetIrreducibles booleanLattice 3|
|                                      |
|o1 = {110, 011, 111, 101}             |
|                                      |
|o1 : List                             |
+--------------------------------------+

See also
========

  * joinIrreducibles -- determines the join
    irreducible elements of a poset
  * meetExists -- determines if the meet exists for two
    elements of a poset
  * posetMeet -- determines the meet for two elements of a
    poset

Ways to use meetIrreducibles :
==============================

  * "meetIrreducibles(Poset)"

For the programmer
==================

The object meetIrreducibles, is a method function (Macaulay2Doc).

minimalElements -- determines the minimal elements of a poset
*************************************************************

Synopsis
========

  * Usage:
        M = minimalElements P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * M, a list (Macaulay2Doc),

Description
===========

An element of $P$ is a minimal element if it no other element of $P$ is less
than it.

+-------------------------------------+
|i1 : P = poset {{a,b}, {b,c}, {d,c}};|
+-------------------------------------+
|i2 : minimalElements P               |
|                                     |
|o2 = {a, d}                          |
|                                     |
|o2 : List                            |
+-------------------------------------+

See also
========

  * maximalElements -- determines the maximal elements
    of a poset

Ways to use minimalElements :
=============================

  * "minimalElements(Poset)"

For the programmer
==================

The object minimalElements, is a method function (Macaulay2Doc).

moebiusFunction -- computes the Moebius function at every pair of elements of a poset
*************************************************************************************

Synopsis
========

  * Usage:
        mu = moebiusFunction P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * mu, a hash table (Macaulay2Doc), the Moebius function
        of $P$

Description
===========

The Moebius function of $P$ is a function defined at pairs of vertices of $P$
with the properties: $mu(a,a) = 1$ for all $a$ in $P$, and $mu(a,b) =
-sum(mu(a,c))$ over all $a \leq c < b$.

The Moebius function of the $n$ See chain, is $1$ at $(a,a)$ for all
$a$, $-1$ at $(a, a+1)$ for $1 \leq a < n$, and $0$ every where else.

+----------------------------+
|i1 : moebiusFunction chain 3|
|                            |
|o1 = HashTable{(1, 1) => 1 }|
|               (1, 2) => -1 |
|               (1, 3) => 0  |
|               (2, 1) => 0  |
|               (2, 2) => 1  |
|               (2, 3) => -1 |
|               (3, 1) => 0  |
|               (3, 2) => 0  |
|               (3, 3) => 1  |
|                            |
|o1 : HashTable              |
+----------------------------+

Ways to use moebiusFunction :
=============================

  * "moebiusFunction(Poset)"

For the programmer
==================

The object moebiusFunction, is a method function (Macaulay2Doc).

naturalLabeling -- relabels a poset with a natural labeling
***********************************************************

Synopsis
========

  * Usage:
        Q = naturalLabeling P
        Q = naturalLabeling(P, startIndex)
  * Inputs:
      * P, an instance of the type Poset,
      * startIndex, an integer (Macaulay2Doc), the starting index
        from which the poset is relabeled (default 0)
  * Outputs:
      * Q, an instance of the type Poset,

Description
===========

A poset is naturally labeled if the ground set is ordered $v_1, \ldots, v_n$
and if $v_i \leq v_j$ in $P$ implies $i \leq j$.  This method relabels the
ground set of the poset (suppose it has $n$ vertices) to be $0, 1, \ldots,
n-1$.

+-----------------------------------------+
|i1 : P = booleanLattice 3;               |
+-----------------------------------------+
|i2 : Q = naturalLabeling P               |
|                                         |
|o2 = Q                                   |
|                                         |
|o2 : Poset                               |
+-----------------------------------------+
|i3 : all(allRelations Q, r -> r_0 <= r_1)|
|                                         |
|o3 = true                                |
+-----------------------------------------+

If startIndex is specified, then the values are shifted by that amount.  This
can be useful for making a disjoint union of posets.

+----------------------------------------------+
|i4 : C = chain 3;                             |
+----------------------------------------------+
|i5 : Q' = sum(3, i -> naturalLabeling(C, 3*i))|
|                                              |
|o5 = Q'                                       |
|                                              |
|o5 : Poset                                    |
+----------------------------------------------+
|i6 : all(allRelations Q', r -> r_0 <= r_1)    |
|                                              |
|o6 = true                                     |
+----------------------------------------------+

Note the cache of $P$ is copied to the cache of $Q$ with the appropriate
adjustments being made.

See also
========

  * filtration -- generates the filtration of a poset
  * indexLabeling -- relabels a poset with the labeling
    based on the indices of the vertices
  * labelPoset -- relabels a poset with the specified
    labeling

Ways to use naturalLabeling :
=============================

  * "naturalLabeling(Poset)"
  * "naturalLabeling(Poset,ZZ)"

For the programmer
==================

The object naturalLabeling, is a method function (Macaulay2Doc).

ncPartitions -- generates the non-crossing partitions of size $n$
*****************************************************************

Synopsis
========

  * Usage:
        N = ncpPartitions n
  * Inputs:
      * n, an integer (Macaulay2Doc), the size of the set to
        partition
  * Outputs:
      * N, a list (Macaulay2Doc),

Description
===========

A non-crossing partition of size $n$ is a partitioning of the set
$\{0,\ldots,n-1\}$ into a finite number of non-empty disjoint pieces such that
if $a < b$ belong to one part, and $c < d$ belong to a different part, then $a
< b < c < d$, $a < c < d < b$, or $c < d < a < b$.

+-----------------------------------------------------------------------------+
|i1 : ncPartitions 5                                                          |
|                                                                             |
|o1 = {01234, 0/1234, 0234/1, 0134/2, 0124/3, 0123/4, 01/234, 034/12, 014/23, |
|     ------------------------------------------------------------------------|
|     012/34, 04/123, 0/1/234, 0/134/2, 0/124/3, 0/123/4, 0/12/34, 0/14/23,   |
|     ------------------------------------------------------------------------|
|     034/1/2, 024/1/3, 023/1/4, 02/1/34, 04/1/23, 014/2/3, 013/2/4, 01/2/34, |
|     ------------------------------------------------------------------------|
|     04/13/2, 012/3/4, 01/24/3, 04/12/3, 01/23/4, 03/12/4, 0/1/2/34,         |
|     ------------------------------------------------------------------------|
|     0/1/24/3, 0/1/23/4, 0/14/2/3, 0/13/2/4, 0/12/3/4, 04/1/2/3, 03/1/2/4,   |
|     ------------------------------------------------------------------------|
|     02/1/3/4, 01/2/3/4, 0/1/2/3/4}                                          |
|                                                                             |
|o1 : List                                                                    |
+-----------------------------------------------------------------------------+

See also
========

  * ncpLattice -- computes the non-crossing partition
    lattice of set-partitions of size $n$

Ways to use ncPartitions :
==========================

  * "ncPartitions(ZZ)"

For the programmer
==================

The object ncPartitions, is a method function (Macaulay2Doc).

ncpLattice -- computes the non-crossing partition lattice of set-partitions of size $n$
***************************************************************************************

Synopsis
========

  * Usage:
        P = ncpLattice n
  * Inputs:
      * n, an integer (Macaulay2Doc), the size of the set to
        partition
  * Outputs:
      * P, an instance of the type Poset,

Description
===========

The non-crossing partition lattice of order $n$ is the lattice of
ncPartitions, of the set $\{0,\ldots,n-1\}$ with ordering given
by refinement.  That is, the non-crossing partition $p$ is greater than or
equal to the non-crossing partition $q$ if each part of $p$ is contained in
exactly one part of $q$.

+-----------------------------------+
|i1 : ncpLattice 3                  |
|                                   |
|o1 = Relation Matrix: | 1 1 1 1 1 ||
|                      | 0 1 0 0 1 ||
|                      | 0 0 1 0 1 ||
|                      | 0 0 0 1 1 ||
|                      | 0 0 0 0 1 ||
|                                   |
|o1 : Poset                         |
+-----------------------------------+

See also
========

  * ncPartitions -- generates the non-crossing partitions
    of size $n$

Ways to use ncpLattice :
========================

  * "ncpLattice(ZZ)"

For the programmer
==================

The object ncpLattice, is a method function (Macaulay2Doc).

openInterval -- computes the subposet contained strictly between two points
***************************************************************************

Synopsis
========

  * Usage:
        I = openInterval(P, a, b)
  * Inputs:
      * P, an instance of the type Poset,
      * a, a thing (Macaulay2Doc), an element of the poset
      * b, a thing (Macaulay2Doc), an element of the poset
  * Outputs:
      * I, an instance of the type Poset, the open interval in
        $P$ between $a$ and $b$

Description
===========

The open interval between $a$ and $b$ is the subposet of $P$ induced by the
elements $z$ such that $p < z < q$.  If $a$ and $b$ are incomparable, then an
error is thrown.

+----------------------------------+
|i1 : P = booleanLattice 3;        |
+----------------------------------+
|i2 : openInterval(P, "001", "111")|
|                                  |
|o2 = Relation Matrix: | 1 0 |     |
|                      | 0 1 |     |
|                                  |
|o2 : Poset                        |
+----------------------------------+

See also
========

  * closedInterval -- computes the subposet contained
    between two points

Ways to use openInterval :
==========================

  * "openInterval(Poset,Thing,Thing)"

For the programmer
==================

The object openInterval, is a method function (Macaulay2Doc).

orderComplex -- produces the order complex of a poset
*****************************************************

Synopsis
========

  * Usage:
        O = orderComplex P
  * Inputs:
      * P, an instance of the type Poset,
  * Optional inputs (Macaulay2Doc),:
      * VariableName => a symbol (Macaulay2Doc), default value v
      * CoefficientRing => a ring (Macaulay2Doc), default value QQ
  * Outputs:
      * O, an abstract simplicial complex (SimplicialComplexes),
        the order complex of $P$

Description
===========

The order complex of a poset is the SimplicialComplex (SimplicialComplexes),
with vertices corresponding to the
ground set of $P$ and faces corresponding to the chains, of $P$.

+-----------------------------------------------------------------------------+
|i1 : orderComplex booleanLattice 3                                           |
|                                                                             |
|o1 = simplicialComplex | v_0v_4v_6v_7 v_0v_2v_6v_7 v_0v_4v_5v_7 v_0v_1v_5v_7 |
|                                                                             |
|o1 : SimplicialComplex                                                       |
|-----------------------------------------------------------------------------|
|v_0v_2v_3v_7 v_0v_1v_3v_7 |                                                  |
+-----------------------------------------------------------------------------+

The minimal non-faces are given by the incomparable pairs of vertices in $P$.
Thus the order complex is the independence complex of the
incomparabilityGraph, of $P$ and the clique complex of
the comparabilityGraph, of $P$.  Moreover, the facets
are given by the maximalChains, of $P$.  Thus, the order
complex of a chain, poset is a simplex.

+------------------------------------------+
|i2 : orderComplex chain 5                 |
|                                          |
|o2 = simplicialComplex | v_0v_1v_2v_3v_4 ||
|                                          |
|o2 : SimplicialComplex                    |
+------------------------------------------+

Caveat
======

This method renames the vertices with integers $0, 1, \ldots$ corresponding to
the index of the vertices in the GroundSet.

See also
========

  * chains -- computes all chains of a poset
  * comparabilityGraph -- produces the comparability
    graph of a poset
  * incomparabilityGraph -- produces the
    incomparability graph of a poset
  * maximalChains -- computes all maximal chains of a
    poset

Ways to use orderComplex :
==========================

  * "orderComplex(Poset)"

For the programmer
==================

The object orderComplex, is a method function with options (Macaulay2Doc).

orderIdeal -- computes the elements below given elements in a poset
*******************************************************************

Synopsis
========

  * Usage:
        I = orderIdeal(P, L)
  * Inputs:
      * P, an instance of the type Poset,
      * L, a list (Macaulay2Doc), elements of the poset
  * Outputs:
      * I, a list (Macaulay2Doc), containing all elements less than
        or equal to at least one of the given elements

Description
===========

The order ideal of a given set of elements of a poset is all the elements in
the poset which are less than or equal to at least one of the elements in the
given set.

+----------------------------------+
|i1 : P = booleanLattice 3;        |
+----------------------------------+
|i2 : orderIdeal(P, {"001", "100"})|
|                                  |
|o2 = {000, 001, 100}              |
|                                  |
|o2 : List                         |
+----------------------------------+

See also
========

  * filter -- computes the elements above given elements in a
    poset
  * principalFilter -- computes the elements above a
    given element in a poset
  * principalOrderIdeal -- computes the elements
    below a given element in a poset

Ways to use orderIdeal :
========================

  * "orderIdeal(Poset,List)"

For the programmer
==================

The object orderIdeal, is a method function (Macaulay2Doc).

outputTexPoset -- writes a LaTeX file with a TikZ-representation of a poset
***************************************************************************

Synopsis
========

  * Usage:
        outputTexPoset(P, f)
        outputTexPoset(P, f, SuppressLabels => Boolean)
        outputTexPoset(P, f, Jitter => Boolean)
  * Inputs:
      * P, an instance of the type Poset,
      * f, a string (Macaulay2Doc), the name of the file to be
        created
  * Optional inputs (Macaulay2Doc),:
      * SuppressLabels => a Boolean value (Macaulay2Doc),
        default value true, whether to display or suppress the labels of the
        poset
      * Jitter => a Boolean value (Macaulay2Doc), default value
        false, whether to randomly jitter the poset vertices
  * Outputs:
      * n,

Description
===========

This method writes a TikZ-representation of the given poset to the specified
file.  See texPoset, for more about the representation.

See also
========

  * displayPoset -- generates a PDF representation of a
    poset and attempts to display it
  * texPoset -- generates a string containing a TikZ-figure of
    a poset
  * Jitter -- generates a string containing a TikZ-figure of a
    poset
  * SuppressLabels -- generates a string containing a
    TikZ-figure of a poset

Ways to use outputTexPoset :
============================

  * "outputTexPoset(Poset,String)"

For the programmer
==================

The object outputTexPoset, is a method function with options (Macaulay2Doc).

partitionLattice -- computes the lattice of set-partitions of size $n$
**********************************************************************

Synopsis
========

  * Usage:
        P = partitionLattice n
  * Inputs:
      * n, an integer (Macaulay2Doc), the size of the set to
        partition
  * Outputs:
      * P, an instance of the type Poset,

Description
===========

The partition lattice of order $n$ is the lattice of setPartition,
s of the set $\{1,\ldots,n\}$ with ordering given by refinement.
That is, the set-partition $p$ is greater than or equal to the set-partition
$q$ if each part of $p$ is contained in exactly one part of $q$.

+-----------------------------------+
|i1 : partitionLattice 3            |
|                                   |
|o1 = Relation Matrix: | 1 1 1 1 1 ||
|                      | 0 1 0 0 1 ||
|                      | 0 0 1 0 1 ||
|                      | 0 0 0 1 1 ||
|                      | 0 0 0 0 1 ||
|                                   |
|o1 : Poset                         |
+-----------------------------------+

See also
========

  * setPartition -- computes the list of set-partitions of
    size $n$

Ways to use partitionLattice :
==============================

  * "partitionLattice(ZZ)"

For the programmer
==================

The object partitionLattice, is a method function (Macaulay2Doc).

plueckerPoset -- computes a poset associated to the Plücker relations
*********************************************************************

Synopsis
========

  * Usage:
        P = plueckerPoset n
  * Inputs:
      * n, an integer (Macaulay2Doc), the size of the set to
        partition
  * Outputs:
      * P, an instance of the type Poset,

Description
===========

The ideal of Plücker relations has a quadratic Groebner basis.  Under a
suitable term order, the incomparable pairs of the poset $P$ generate the
initial ideal of the ideal of Plücker relations.

Given two subsets $S$ and $T$ of ${0,\ldots,n-1}$, we partially order $S \leq
T$ if $\#S \geq \#T$ and $S_i \leq T_i$ for all $i$ from $1$ to $\#T$.

+-----------------------------------------------------------------------------+
|i1 : P = plueckerPoset 4;                                                    |
+-----------------------------------------------------------------------------+
|i2 : coveringRelations P                                                     |
|                                                                             |
|o2 = {{{0}, {1}}, {{1}, {2}}, {{0, 1}, {0, 2}}, {{2}, {3}}, {{0, 2}, {0, 3}},|
|     ------------------------------------------------------------------------|
|     {{0, 2}, {1, 2}}, {{1, 2}, {1, 3}}, {{0, 1, 2}, {0, 1, 3}}, {{3}, {}},  |
|     ------------------------------------------------------------------------|
|     {{0, 3}, {0}}, {{0, 3}, {1, 3}}, {{1, 3}, {2, 3}}, {{1, 3}, {1}}, {{0,  |
|     ------------------------------------------------------------------------|
|     1, 3}, {0, 2, 3}}, {{0, 1, 3}, {0, 1}}, {{2, 3}, {2}}, {{0, 2, 3}, {0,  |
|     ------------------------------------------------------------------------|
|     2}}, {{0, 2, 3}, {1, 2, 3}}, {{1, 2, 3}, {1, 2}}, {{0, 1, 2, 3}, {0, 1, |
|     ------------------------------------------------------------------------|
|     2}}}                                                                    |
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use plueckerPoset :
===========================

  * "plueckerPoset(ZZ)"

For the programmer
==================

The object plueckerPoset, is a method function (Macaulay2Doc).

poincarePolynomial -- computes the Poincaré polynomial of a ranked poset with a unique minimal element
******************************************************************************************************

Synopsis
========

  * Usage:
        p = poincarePolynomial P
        p = poincarePolynomial(P, VariableName => symbol)
        p = poincare P
  * Inputs:
      * P, an instance of the type Poset, a ranked poset
  * Optional inputs (Macaulay2Doc),:
      * VariableName => a symbol (Macaulay2Doc), default value t
  * Outputs:
      * p, a ring element (Macaulay2Doc), the Poincaré
        polynomial of $P$

Description
===========

The Poincaré polynomial of $P$ is the polynomial in a single variable $t$
derived from the rankFunction, and the
moebiusFunction, of $P$.

The Poincaré polynomial of the $n$ See booleanLattice, is
$(1+t)^n$.

+-----------------------------------------------+
|i1 : n = 5;                                    |
+-----------------------------------------------+
|i2 : factor poincarePolynomial booleanLattice n|
|                                               |
|            5                                  |
|o2 = (t + 1)                                   |
|                                               |
|o2 : Expression of class Product               |
+-----------------------------------------------+

The Poincaré polynomial of the $B3$ arrangement is $(1+t)(1+3t)(1+5t)$.

+-----------------------------------------+
|i3 : R = QQ[x,y,z];                      |
+-----------------------------------------+
|i4 : A = {x,y,z,x+y,x+z,y+z,x-y,x-z,y-z};|
+-----------------------------------------+
|i5 : LA = intersectionLattice(A, R);     |
+-----------------------------------------+
|i6 : factor poincarePolynomial LA        |
|                                         |
|o6 = (t + 1)(3t + 1)(5t + 1)             |
|                                         |
|o6 : Expression of class Product         |
+-----------------------------------------+

See also
========

  * intersectionLattice -- generates the
    intersection lattice of a hyperplane arrangement
  * isRanked -- determines if a poset is ranked
  * moebiusFunction -- computes the Moebius function at
    every pair of elements of a poset
  * rankFunction -- computes the rank function of a ranked
    poset

Ways to use poincarePolynomial :
================================

  * "poincarePolynomial(Poset)"

For the programmer
==================

The object poincarePolynomial, is a method function with options (Macaulay2Doc).

Poset -- a class for partially ordered sets (posets)
****************************************************

Description
===========

This class is a type of HashTable (Macaulay2Doc), which
represents finite posets.  It consists of a ground set, a list of relationships
$\{a,b\}$ where $a \leq b$, and a matrix encoding these relations.

+-----------------------------------------------------------------------------+
|i1 : G = {1,2,3,4};                  -- the ground set                       |
+-----------------------------------------------------------------------------+
|i2 : R = {{1,2},{1,3},{2,4},{3,4}};  -- a list of cover relations            |
+-----------------------------------------------------------------------------+
|i3 : P = poset(G, R)                 -- the poset with its relations matrix  |
|                                                                             |
|o3 = P                                                                       |
|                                                                             |
|o3 : Poset                                                                   |
|-----------------------------------------------------------------------------|
|computed                                                                     |
+-----------------------------------------------------------------------------+

See also
========

  * poset -- creates a new Poset object

Functions and methods returning an object of class Poset :
==========================================================

  * "adjoinMax(Poset)" -- see adjoinMax, -- computes the poset
    with a new maximum element
  * "adjoinMax(Poset,Thing)" -- see adjoinMax, -- computes the
    poset with a new maximum element
  * "adjoinMin(Poset)" -- see adjoinMin, -- computes the poset
    with a new minimum element
  * "adjoinMin(Poset,Thing)" -- see adjoinMin, -- computes the
    poset with a new minimum element
  * "augmentPoset(Poset)" -- see augmentPoset, -- computes
    the poset with an adjoined minimum and maximum
  * "augmentPoset(Poset,Thing,Thing)" -- see augmentPoset,
    -- computes the poset with an adjoined minimum and maximum
  * "booleanLattice(ZZ)" -- see booleanLattice, --
    generates the boolean lattice on $n$ elements
  * "chain(ZZ)" -- see chain, -- generates the chain poset on $n$
    elements
  * "closedInterval(Poset,Thing,Thing)" -- see closedInterval,
    -- computes the subposet contained between two points
  * "diamondProduct(Poset,Poset)" -- see diamondProduct,
    -- computes the diamond product of two ranked posets
  * "dilworthLattice(Poset)" -- see dilworthLattice, --
    computes the Dilworth lattice of a poset
  * "distributiveLattice(Poset)" -- see distributiveLattice,
    -- computes the lattice of order ideals of a poset
  * "divisorPoset(ZZ)" -- see divisorPoset, -- generates
    the poset of divisors
  * divisorPoset(List,List,PolynomialRing)
    -- generates the poset of
    divisors
  * divisorPoset(RingElement), --
    generates the poset of divisors
  * divisorPoset(RingElement,RingElement)
    -- generates the poset of
    divisors with a lower and upper bound
  * "dominanceLattice(ZZ)" -- see dominanceLattice, --
    generates the dominance lattice of partitions of $n$
  * "dropElements(Poset,Function)" -- see dropElements, --
    computes the induced subposet of a poset given a list of elements to remove
  * "dropElements(Poset,List)" -- see dropElements, --
    computes the induced subposet of a poset given a list of elements to remove
  * dual(Poset) -- produces the derived poset with
    relations reversed
  * "facePoset(SimplicialComplex)" -- see facePoset, --
    generates the face poset of a simplicial complex
  * "flagPoset(Poset,List)" -- see flagPoset, -- computes the
    subposet of specified ranks of a ranked poset
  * "gapConvertPoset(Array)" -- see gapConvertPoset, --
    converts between Macaulay2's Posets and GAP's Posets
  * "gapConvertPoset(String)" -- see gapConvertPoset, --
    converts between Macaulay2's Posets and GAP's Posets
  * "indexLabeling(Poset)" -- see indexLabeling, --
    relabels a poset with the labeling based on the indices of the vertices
  * "intersectionLattice(List,Ring)" -- see intersectionLattice,
    -- generates the intersection lattice of a hyperplane
    arrangement
  * "labelPoset(Poset,HashTable)" -- see labelPoset, --
    relabels a poset with the specified labeling
  * "lcmLattice(Ideal)" -- see lcmLattice, -- generates the
    lattice of lcms in an ideal
  * "naturalLabeling(Poset)" -- see naturalLabeling, --
    relabels a poset with a natural labeling
  * "naturalLabeling(Poset,ZZ)" -- see naturalLabeling,
    -- relabels a poset with a natural labeling
  * "ncpLattice(ZZ)" -- see ncpLattice, -- computes the
    non-crossing partition lattice of set-partitions of size $n$
  * "openInterval(Poset,Thing,Thing)" -- see openInterval,
    -- computes the subposet contained strictly between two points
  * "partitionLattice(ZZ)" -- see partitionLattice, --
    computes the lattice of set-partitions of size $n$
  * "plueckerPoset(ZZ)" -- see plueckerPoset, -- computes
    a poset associated to the Plücker relations
  * "poset(List)" -- see poset, -- creates a new Poset object
  * "poset(List,Function)" -- see poset, -- creates a new Poset
    object
  * "poset(List,List)" -- see poset, -- creates a new Poset object
  * "poset(List,List,Matrix)" -- see poset, -- creates a new Poset
    object
  * product(Poset,Poset) -- computes the
    product of two posets
  * "projectivizeArrangement(List,Ring)" -- see projectivizeArrangement,
    -- computes the intersection poset of a
    projectivized hyperplane arrangement
  * "randomPoset(List)" -- see randomPoset, -- generates a
    random poset with a given relation probability
  * "randomPoset(ZZ)" -- see randomPoset, -- generates a
    random poset with a given relation probability
  * "resolutionPoset(ChainComplex)" -- see resolutionPoset,
    -- generates a poset from a resolution
  * "resolutionPoset(Ideal)" -- see resolutionPoset, --
    generates a poset from a resolution
  * "resolutionPoset(MonomialIdeal)" -- see resolutionPoset,
    -- generates a poset from a resolution
  * "standardMonomialPoset(MonomialIdeal)" -- see standardMonomialPoset,
    -- generates the poset of divisibility in the
    monomial basis of an ideal
  * "standardMonomialPoset(MonomialIdeal,ZZ,ZZ)" -- see
    standardMonomialPoset, -- generates the poset of
    divisibility in the monomial basis of an ideal
  * "subposet(Poset,List)" -- see subposet, -- computes the
    induced subposet of a poset given a list of elements
  * "transitiveOrientation(Graph)" -- see transitiveOrientation,
    -- generates a poset whose comparability graph is
    the given graph
  * "union(Poset,Poset)" -- see union, -- computes the union of
    two posets
  * "youngSubposet(List)" -- see youngSubposet, --
    generates a subposet of Young's lattice
  * "youngSubposet(List,List)" -- see youngSubposet, --
    generates a subposet of Young's lattice
  * "youngSubposet(ZZ)" -- see youngSubposet, -- generates
    a subposet of Young's lattice

Methods that use an object of class Poset :
===========================================

  * "allRelations(Poset)" -- see allRelations, -- computes
    all relations of a poset
  * "allRelations(Poset,Boolean)" -- see allRelations, --
    computes all relations of a poset
  * "antichains(Poset)" -- see antichains, -- computes all
    antichains of a poset
  * "antichains(Poset,ZZ)" -- see antichains, -- computes all
    antichains of a poset
  * "areIsomorphic(Poset,Poset)" -- see areIsomorphic, --
    determines if two posets are isomorphic
  * "Poset == Poset" -- see areIsomorphic, -- determines
    if two posets are isomorphic
  * "atoms(Poset)" -- see atoms, -- computes the list of elements
    covering the minimal elements of a poset
  * "chains(Poset)" -- see chains, -- computes all chains of a
    poset
  * "chains(Poset,ZZ)" -- see chains, -- computes all chains of a
    poset
  * "characteristicPolynomial(Poset)" -- see characteristicPolynomial,
    -- computes the characteristic polynomial of a
    ranked poset with a unique minimal element
  * "comparabilityGraph(Poset)" -- see comparabilityGraph,
    -- produces the comparability graph of a poset
  * "compare(Poset,Thing,Thing)" -- see compare, -- compares two
    elements in a poset
  * connectedComponents(Poset), --
    generates a list of connected components of a poset
  * "coveringRelations(Poset)" -- see coveringRelations,
    -- computes the minimal list of generating relations of
    a poset
  * "coxeterPolynomial(Poset)" -- see coxeterPolynomial,
    -- computes the Coxeter polynomial of a poset
  * "degreePolynomial(Poset)" -- see degreePolynomial,
    -- computes the degree polynomial of a poset
  * "dilworthNumber(Poset)" -- see dilworthNumber, --
    computes the Dilworth number of a poset
  * "displayPoset(Poset)" -- see displayPoset, -- generates
    a PDF representation of a poset and attempts to display it
  * "Poset - List" -- see dropElements, -- computes the
    induced subposet of a poset given a list of elements to remove
  * "filter(Poset,List)" -- see filter, -- computes the elements
    above given elements in a poset
  * "filtration(Poset)" -- see filtration, -- generates the
    filtration of a poset
  * "flagChains(Poset,List)" -- see flagChains, -- computes
    the maximal chains in a list of flags of a ranked poset
  * "flagfPolynomial(Poset)" -- see flagfPolynomial, --
    computes the flag-f polynomial of a ranked poset
  * "flaghPolynomial(Poset)" -- see flaghPolynomial, --
    computes the flag-h polynomial of a ranked poset
  * "fPolynomial(Poset)" -- see fPolynomial, -- computes the
    f-polynomial of a poset
  * "gapConvertPoset(Poset)" -- see gapConvertPoset, --
    converts between Macaulay2's Posets and GAP's Posets
  * "greeneKleitmanPartition(Poset)" -- see greeneKleitmanPartition,
    -- computes the Greene-Kleitman partition of a
    poset
  * "hasseDiagram(Poset)" -- see hasseDiagram, -- produces
    the Hasse diagram of a poset
  * height(Poset) -- computes the height of a poset
  * "hibiIdeal(Poset)" -- see hibiIdeal, -- produces the Hibi
    ideal of a poset
  * "hibiRing(Poset)" -- see hibiRing, -- produces the Hibi
    ring of a poset
  * "hPolynomial(Poset)" -- see hPolynomial, -- computes the
    h-polynomial of a poset
  * "incomparabilityGraph(Poset)" -- see incomparabilityGraph,
    -- produces the incomparability graph of a poset
  * "isAntichain(Poset,List)" -- see isAntichain, --
    determines if a given list of vertices is an antichain of a poset
  * "isAtomic(Poset)" -- see isAtomic, -- determines if a
    lattice is atomic
  * "isBounded(Poset)" -- see isBounded, -- determines if a
    poset is bounded
  * isConnected(Poset) -- determines if a poset
    is connected
  * "isDistributive(Poset)" -- see isDistributive, --
    determines if a lattice is distributive
  * isEulerian(Poset) -- determines if a ranked
    poset is Eulerian
  * "isGeometric(Poset)" -- see isGeometric, -- determines
    if a lattice is geometric
  * "isGraded(Poset)" -- see isGraded, -- determines if a poset
    is graded
  * "isLattice(Poset)" -- see isLattice, -- determines if a
    poset is a lattice
  * "isLowerSemilattice(Poset)" -- see isLowerSemilattice,
    -- determines if a poset is a lower (or meet)
    semilattice
  * "isLowerSemimodular(Poset)" -- see isLowerSemimodular,
    -- determines if a ranked lattice is lower semimodular
  * "isModular(Poset)" -- see isModular, -- determines if a
    lattice is modular
  * "isomorphism(Poset,Poset)" -- see isomorphism, --
    computes an isomorphism between isomorphic posets
  * "isRanked(Poset)" -- see isRanked, -- determines if a poset
    is ranked
  * "isSperner(Poset)" -- see isSperner, -- determines if a
    ranked poset has the Sperner property
  * "isStrictSperner(Poset)" -- see isStrictSperner, --
    determines if a ranked poset has the strict Sperner property
  * "isUpperSemilattice(Poset)" -- see isUpperSemilattice,
    -- determines if a poset is an upper (or join)
    semilattice
  * "isUpperSemimodular(Poset)" -- see isUpperSemimodular,
    -- determines if a lattice is upper semimodular
  * "joinExists(Poset,Thing,Thing)" -- see joinExists, --
    determines if the join exists for two elements of a poset
  * "joinIrreducibles(Poset)" -- see joinIrreducibles,
    -- determines the join irreducible elements of a poset
  * "linearExtensions(Poset)" -- see linearExtensions,
    -- computes all linear extensions of a poset
  * "magnitude(Poset)" -- see magnitude, -- computes the
    magnitude of a poset
  * "maximalAntichains(Poset)" -- see maximalAntichains,
    -- computes all maximal antichains of a poset
  * "maximalChains(Poset)" -- see maximalChains, --
    computes all maximal chains of a poset
  * "maximalElements(Poset)" -- see maximalElements, --
    determines the maximal elements of a poset
  * "meetExists(Poset,Thing,Thing)" -- see meetExists, --
    determines if the meet exists for two elements of a poset
  * "meetIrreducibles(Poset)" -- see meetIrreducibles,
    -- determines the meet irreducible elements of a poset
  * "minimalElements(Poset)" -- see minimalElements, --
    determines the minimal elements of a poset
  * "moebiusFunction(Poset)" -- see moebiusFunction, --
    computes the Moebius function at every pair of elements of a poset
  * "orderComplex(Poset)" -- see orderComplex, -- produces
    the order complex of a poset
  * "orderIdeal(Poset,List)" -- see orderIdeal, -- computes
    the elements below given elements in a poset
  * "outputTexPoset(Poset,String)" -- see outputTexPoset,
    -- writes a LaTeX file with a TikZ-representation of a poset
  * "poincare(Poset)" -- see poincarePolynomial, --
    computes the Poincaré polynomial of a ranked poset with a unique minimal
    element
  * "poincarePolynomial(Poset)" -- see poincarePolynomial,
    -- computes the Poincaré polynomial of a ranked poset
    with a unique minimal element
  * Poset _ List -- returns elements of the ground set
  * Poset _ ZZ -- returns an element of the ground set
  * Poset _* -- returns the ground set of a poset
  * "vertices(Poset)" -- see Poset _*, -- returns the
    ground set of a poset
  * "posetJoin(Poset,Thing,Thing)" -- see posetJoin, --
    determines the join for two elements of a poset
  * "posetMeet(Poset,Thing,Thing)" -- see posetMeet, --
    determines the meet for two elements of a poset
  * "pPartitionRing(Poset)" -- see pPartitionRing, --
    produces the p-partition ring of a poset
  * "principalFilter(Poset,Thing)" -- see principalFilter,
    -- computes the elements above a given element in a poset
  * "principalOrderIdeal(Poset,Thing)" -- see principalOrderIdeal,
    -- computes the elements below a given element in a
    poset
  * "Poset * Poset" -- see product(Poset,Poset),
    -- computes the product of two posets
  * "rankFunction(Poset)" -- see rankFunction, -- computes
    the rank function of a ranked poset
  * "rankGeneratingFunction(Poset)" -- see rankGeneratingFunction,
    -- computes the rank generating function of a
    ranked poset
  * "rank(Poset)" -- see rankPoset, -- generates a list of
    lists representing the ranks of a ranked poset
  * "rankPoset(Poset)" -- see rankPoset, -- generates a list
    of lists representing the ranks of a ranked poset
  * "tex(Poset)" -- see texPoset, -- generates a string
    containing a TikZ-figure of a poset
  * "texPoset(Poset)" -- see texPoset, -- generates a string
    containing a TikZ-figure of a poset
  * "tuttePolynomial(Poset)" -- see tuttePolynomial, --
    computes the Tutte polynomial of a poset
  * "Poset + Poset" -- see union, -- computes the union of two
    posets
  * vertexSet(Poset) (missing documentation)
  * "zetaPolynomial(Poset)" -- see zetaPolynomial, --
    computes the zeta polynomial of a poset

For the programmer
==================

The object Poset, is a type (Macaulay2Doc), with
ancestor classes HashTable (Macaulay2Doc), < Thing (Macaulay2Doc).

poset -- creates a new Poset object
***********************************

Synopsis
========

  * Usage:
        P = poset R
        P = poset(G, cmp)
        P = poset(G, R)
        P = poset(G, R, M)
  * Inputs:
      * G, a list (Macaulay2Doc), elements in the ground set of $P$
      * R, a list (Macaulay2Doc), pairs {$a,b$} which indicate that
        $a \leq b$
      * M, a matrix (Macaulay2Doc), with entries $(i,j)$ equal to
        1 if $G_j \leq G_i$ and 0 otherwise
      * cmp, a function (Macaulay2Doc), a binary function such
        that $cmp(G_i, G_j)$ is true if and only if $G_i \leq G_j$ in the
        partial order
  * Optional inputs (Macaulay2Doc),:
      * AntisymmetryStrategy => a string (Macaulay2Doc), default
        value "rank", either "digraph", "none", or "rank"
  * Outputs:
      * P, an instance of the type Poset,

Description
===========

This method creates a Poset, by defining the set and giving the
order relations between the elements in the set.  The function assumes that
each element in the ground set $G$ is distinct and operates by taking the
transitive and reflexive closure of the relations in $R$.  The function returns
an error if the input relations are incompatible with creating a poset.

+-------------------------------+
|i1 : G = {a,b,c,d};            |
+-------------------------------+
|i2 : R = {{a,b}, {a,c}, {c,d}};|
+-------------------------------+
|i3 : P = poset(G, R)           |
|                               |
|o3 = P                         |
|                               |
|o3 : Poset                     |
+-------------------------------+

It is unnecessary to pass the ground set if every vertex of the poset is a
member of at least one relation in $R$.

+---------------------------------+
|i4 : poset {{1,2},{2,3},{3,4}}   |
|                                 |
|o4 = Relation Matrix: | 1 1 1 1 ||
|                      | 0 1 1 1 ||
|                      | 0 0 1 1 ||
|                      | 0 0 0 1 ||
|                                 |
|o4 : Poset                       |
+---------------------------------+

Sometimes it is easier to create a poset by passing the ground set and a binary
function which compares elements in the ground set.

+-------------------------------+
|i5 : cmp = (a,b) -> b % a == 0;|
+-------------------------------+
|i6 : G = toList(1..10);        |
+-------------------------------+
|i7 : P = poset(G, cmp)         |
|                               |
|o7 = P                         |
|                               |
|o7 : Poset                     |
+-------------------------------+

And, in other cases, it may be easy to find all relations in the poset.  In
this case, if the matrix encoding all the relations is passed to the poset
method, then it is not necessary to compute the transitive closure.  However,
it should be noted that the method makes no checks on either the relations or
the matrix in this case.

+-----------------------------------------------------------------------------+
|i8 : S = QQ[x,y,z];                                                          |
+-----------------------------------------------------------------------------+
|i9 : G = {x^2, x*y, z^2, x^2*y*z, x*y*z^3, x^2*y^2*z^3};                     |
+-----------------------------------------------------------------------------+
|i10 : R = flatten for g in G list for h in G list if h %g == 0 then {g,h}    |
|-----------------------------------------------------------------------------|
|else continue;                                                               |
+-----------------------------------------------------------------------------+
|i11 : M = matrix apply(G, g -> apply(G, h -> if h %g == 0 then 1 else 0));   |
|                                                                             |
|               6        6                                                    |
|o11 : Matrix ZZ  <--- ZZ                                                     |
+-----------------------------------------------------------------------------+
|i12 : P = poset(G, R, M)                                                     |
|                                                                             |
|o12 = P                                                                      |
|                                                                             |
|o12 : Poset                                                                  |
+-----------------------------------------------------------------------------+

In the previous example the vertices of the poset were RingElement (Macaulay2Doc),
s.  In fact, the Posets package does not require the
vertices to be of any particular type.  However, this also means when the
package makes calls to external methods, it sometimes must relabel the vertices
(usually to the index of the vertex in $G$).

The option AntisymmetryStrategy determines how the method checks the input
relations for antisymmetry (a necessary condition for a poset).  The default,
"rank", checks that the RelationMatrix has maximal rank.  The choice "digraph"
uses the isCyclic (Graphs), method on the Digraph (Graphs),
of the given relations.  Last, the choice "none" skips the
check all together.

Caveat
======

Care should be taken when using the AntisymmetryStrategy option.  If "none" is
specified but the relations are cyclic, then the returned Poset will not
actually be a Poset.  In this case, the behavior of the package is unknown.

See also
========

  * Poset -- a class for partially ordered sets (posets)

Ways to use poset :
===================

  * "poset(List)"
  * "poset(List,Function)"
  * "poset(List,List)"
  * "poset(List,List,Matrix)"

For the programmer
==================

The object poset, is a method function with options (Macaulay2Doc).

Poset _ List -- returns elements of the ground set
**************************************************

Synopsis
========

  * Operator: _ (Macaulay2Doc),
  * Usage:
        V = P_L
  * Inputs:
      * P, an instance of the type Poset,
      * L, a list (Macaulay2Doc), indices in the ground set
  * Outputs:
      * V, a list (Macaulay2Doc), the vertices indexed by $L$ in
        the ground set

Description
===========

This method allows easy access to the vertices of the poset.

+--------------------------+
|i1 : P = booleanLattice 3;|
+--------------------------+
|i2 : P_{2,4,5}            |
|                          |
|o2 = {010, 100, 101}      |
|                          |
|o2 : List                 |
+--------------------------+

See also
========

  * Poset _ ZZ -- returns an element of the ground set
  * Poset _* -- returns the ground set of a poset
  * Poset -- a class for partially ordered sets (posets)

Ways to use this method:
========================

  * Poset _ List -- returns elements of the ground set

Poset _ ZZ -- returns an element of the ground set
**************************************************

Synopsis
========

  * Operator: _ (Macaulay2Doc),
  * Usage:
        a = P_i
  * Inputs:
      * P, an instance of the type Poset,
      * i, an integer (Macaulay2Doc), index in the ground set
  * Outputs:
      * a, a thing (Macaulay2Doc), the $i$-th vertex in the ground
        set

Description
===========

This method allows easy access to the vertices of the poset.

+--------------------------+
|i1 : P = booleanLattice 3;|
+--------------------------+
|i2 : P_0                  |
|                          |
|o2 = 000                  |
+--------------------------+
|i3 : P_3                  |
|                          |
|o3 = 011                  |
+--------------------------+

See also
========

  * Poset _ List -- returns elements of the ground set
  * Poset _* -- returns the ground set of a poset
  * Poset -- a class for partially ordered sets (posets)

Ways to use this method:
========================

  * Poset _ ZZ -- returns an element of the ground set

Poset _* -- returns the ground set of a poset
*********************************************

Synopsis
========

  * Operator: _* (Macaulay2Doc),
  * Usage:
        G = P_*
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * G, a list (Macaulay2Doc), the ground set of $P$

Description
===========

This method allows easy access to ground set of a poset.

+---------------------------------------------+
|i1 : P = booleanLattice 3;                   |
+---------------------------------------------+
|i2 : P_*                                     |
|                                             |
|o2 = {000, 001, 010, 011, 100, 101, 110, 111}|
|                                             |
|o2 : List                                    |
+---------------------------------------------+

See also
========

  * Poset _ ZZ -- returns an element of the ground set
  * Poset _ List -- returns elements of the ground set
  * Poset -- a class for partially ordered sets (posets)

Ways to use this method:
========================

  * Poset _* -- returns the ground set of a poset

posetJoin -- determines the join for two elements of a poset
************************************************************

Synopsis
========

  * Usage:
        j = posetJoin(P, a, b)
  * Inputs:
      * P, an instance of the type Poset,
      * a, a thing (Macaulay2Doc), an element of the poset
      * b, a thing (Macaulay2Doc), an element of the poset
  * Outputs:
      * j, a thing (Macaulay2Doc), the least element greater than
        both $a$ and $b$, if it exists

Description
===========

The join of $a$ and $b$ in $P$, if it exists, is the unique least element
greater than both $a$ and $b$.

+-------------------------------+
|i1 : B = booleanLattice 3;     |
+-------------------------------+
|i2 : posetJoin(B, "001", "100")|
|                               |
|o2 = {101}                     |
|                               |
|o2 : List                      |
+-------------------------------+

See also
========

  * joinExists -- determines if the join exists for two
    elements of a poset
  * posetMeet -- determines the meet for two elements of a
    poset

Ways to use posetJoin :
=======================

  * "posetJoin(Poset,Thing,Thing)"

For the programmer
==================

The object posetJoin, is a method function (Macaulay2Doc).

posetMeet -- determines the meet for two elements of a poset
************************************************************

Synopsis
========

  * Usage:
        m = posetMeet(P, a, b)
  * Inputs:
      * P, an instance of the type Poset,
      * a, a thing (Macaulay2Doc), an element of the poset
      * b, a thing (Macaulay2Doc), an element of the poset
  * Outputs:
      * m, a thing (Macaulay2Doc), the greatest element less than
        both $a$ and $b$, if it exists

Description
===========

The meet of $a$ and $b$ in $P$, if it exists, is the unique greatest element
less than both $a$ and $b$.

+-------------------------------+
|i1 : B = booleanLattice 3;     |
+-------------------------------+
|i2 : posetMeet(B, "011", "110")|
|                               |
|o2 = {010}                     |
|                               |
|o2 : List                      |
+-------------------------------+

See also
========

  * meetExists -- determines if the meet exists for two
    elements of a poset
  * posetJoin -- determines the join for two elements of a
    poset

Ways to use posetMeet :
=======================

  * "posetMeet(Poset,Thing,Thing)"

For the programmer
==================

The object posetMeet, is a method function (Macaulay2Doc).

pPartitionRing -- produces the p-partition ring of a poset
**********************************************************

Synopsis
========

  * Usage:
        R = pPartitionRing P
        R = pPartitionRing(P, Strategy => "kernel")
        R = pPartitionRing(P, Strategy => "4ti2")
  * Inputs:
      * P, an instance of the type Poset,
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing => a ring (Macaulay2Doc), default value QQ
      * Strategy => a string (Macaulay2Doc), default value
        "kernel", which specifies whether to use Macaulay2's native
        kernel (Macaulay2Doc), method (Strategy => "kernel") or the
        package FourTiTwo, (Strategy => "4ti2")
  * Outputs:
      * R, a quotient ring (Macaulay2Doc), the toric
        algebra which is isomorphic to the $P$-partition ring

Description
===========

Recall that a $P$-partition for a naturally labeled poset $P$ on vertices $1,
\ldots, n$ is a function $f: P \rightarrow \mathbb{NN}$ which is
order-reversing, i.e., if $i < j$ in $P$ then $f(i) \geq f(j)$ in
$\mathbb{NN}$. To a $P$-partition $f$ we can assign the monomial $t_1^{f(1)}
\ldots t_n^{f(n)}$. The $P$-partition ring is the ring spanned by the monomials
corresponding to $P$-partitions.

The $P$-partition ring is more simply generated by the monomials corresponding
to the connected order ideals of $P$.  This method returns the toric quotient
algebra, whose toric ideal is minimally generated, isomorphic to the
$P$-partition ring.

+----------------------------------------------------------------------+
|i1 : P = poset {{1,2}, {2,4}, {3,4}, {3,5}};                          |
+----------------------------------------------------------------------+
|i2 : pPartitionRing P                                                 |
|                                                                      |
|     QQ[t   , t      , t   , t      , t            , t               ]|
|         {3}   {3, 4}   {0}   {0, 1}   {0, 1, 2, 3}   {0, 1, 2, 3, 4} |
|o2 = -----------------------------------------------------------------|
|                t      t             - t   t                          |
|                 {3, 4} {0, 1, 2, 3}    {3} {0, 1, 2, 3, 4}           |
|                                                                      |
|o2 : QuotientRing                                                     |
+----------------------------------------------------------------------+

In some cases, it may be faster to use the FourTiTwo,
method toricGroebner (FourTiTwo), to generate the toric
relations.  Using the Strategy "4ti2" tells the method to use this approach.

+----------------------------------------------------------+
|i3 : pPartitionRing(divisorPoset 6, Strategy => "4ti2")   |
|                                                          |
|     QQ[t   , t      , t      , t         , t            ]|
|         {0}   {0, 1}   {0, 2}   {0, 1, 2}   {0, 1, 2, 3} |
|o3 = -----------------------------------------------------|
|                t      t       - t   t                    |
|                 {0, 1} {0, 2}    {0} {0, 1, 2}           |
|                                                          |
|o3 : QuotientRing                                         |
+----------------------------------------------------------+

See also
========

  * hibiRing -- produces the Hibi ring of a poset
  * isConnected(Poset) -- determines if a poset
    is connected
  * naturalLabeling -- relabels a poset with a natural
    labeling
  * orderIdeal -- computes the elements below given elements
    in a poset
  * principalOrderIdeal -- computes the elements
    below a given element in a poset

Ways to use pPartitionRing :
============================

  * "pPartitionRing(Poset)"

For the programmer
==================

The object pPartitionRing, is a method function with options (Macaulay2Doc).

Precompute -- a package-wide configuration that toggles precomputation
**********************************************************************

Description
===========

Many routines in this package are written to take advantage of known structure
on some posets to quickly precompute some of the cached data.  However, this
may not always be desirable, and so this flag toggles whether precomputation
occurs.  It can be set with the setPrecompute, method.

As an example, see chain, posets are known to be distributive
lattices.  If the precomputation flag is set, then the method fills this in
automatically.

+-----------------------------------------------------------------------------+
|i1 : setPrecompute true;                                                     |
+-----------------------------------------------------------------------------+
|i2 : C = chain 10;                                                           |
+-----------------------------------------------------------------------------+
|i3 : peek C.cache                                                            |
|                                                                             |
|o3 = CacheTable{connectedComponents => {{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}}      |
|                coveringRelations => {{0, 1}, {1, 2}, {2, 3}, {3, 4}, {4, 5},|
|                filtration => {{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {|
|                greeneKleitmanPartition => Partition{10}                     |
|                isAtomic => false                                            |
|                isDistributive => true                                       |
|                isEulerian => false                                          |
|                isLowerSemilattice => true                                   |
|                isLowerSemimodular => true                                   |
|                isUpperSemilattice => true                                   |
|                isUpperSemimodular => true                                   |
|                maximalAntichains => {{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7},|
|                maximalChains => {{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}}            |
|                maximalElements => {9}                                       |
|                minimalElements => {0}                                       |
|                name => C                                                    |
|                rankFunction => {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}               |
|-----------------------------------------------------------------------------|
|                                }                                            |
| {5, 6}, {6, 7}, {7, 8}, {8, 9}}                                             |
|9}}                                                                          |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
| {8}, {9}}                                                                   |
+-----------------------------------------------------------------------------+
|i4 : P = poset apply(9, i -> {i+1, i+2});                                    |
+-----------------------------------------------------------------------------+
|i5 : peek P.cache                                                            |
|                                                                             |
|o5 = CacheTable{name => P}                                                   |
+-----------------------------------------------------------------------------+
|i6 : C == P                                                                  |
|                                                                             |
|o6 = true                                                                    |
+-----------------------------------------------------------------------------+
|i7 : time isDistributive C                                                   |
|     -- used 0.000011999 seconds                                             |
|                                                                             |
|o7 = true                                                                    |
+-----------------------------------------------------------------------------+
|i8 : time isDistributive P                                                   |
|     -- used 2.59835 seconds                                                 |
|                                                                             |
|o8 = true                                                                    |
+-----------------------------------------------------------------------------+

We also know that the dual of a distributive lattice is again a distributive
lattice.  Other information is copied when possible.

+-----------------------------------------------------------------------------+
|i9 : C' = dual C;                                                            |
+-----------------------------------------------------------------------------+
|i10 : time isDistributive C'                                                 |
|     -- used 2.706e-6 seconds                                                |
|                                                                             |
|o10 = true                                                                   |
+-----------------------------------------------------------------------------+
|i11 : peek C'.cache                                                          |
|                                                                             |
|o11 = CacheTable{connectedComponents => {{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}}     |
|                 coveringRelations => {{1, 0}, {2, 1}, {3, 2}, {4, 3}, {5, 4 |
|                 filtration => {{9}, {8}, {7}, {6}, {5}, {4}, {3}, {2}, {1}, |
|                 greeneKleitmanPartition => Partition{10}                    |
|                 isDistributive => true                                      |
|                 isEulerian => false                                         |
|                 isLowerSemilattice => true                                  |
|                 isLowerSemimodular => true                                  |
|                 isUpperSemilattice => true                                  |
|                 isUpperSemimodular => true                                  |
|                 maximalAntichains => {{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7 |
|                 maximalChains => {{9, 8, 7, 6, 5, 4, 3, 2, 1, 0}}           |
|                 maximalElements => {0}                                      |
|                 minimalElements => {9}                                      |
|                 name => C'                                                  |
|                 rankFunction => {9, 8, 7, 6, 5, 4, 3, 2, 1, 0}              |
|-----------------------------------------------------------------------------|
|                                  }                                          |
|}, {6, 5}, {7, 6}, {8, 7}, {9, 8}}                                           |
| {0}}                                                                        |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|}, {8}, {9}}                                                                 |
+-----------------------------------------------------------------------------+

See also
========

  * setPrecompute -- sets the Precompute configuration

For the programmer
==================

The object Precompute, is a symbol (Macaulay2Doc).

principalFilter -- computes the elements above a given element in a poset
*************************************************************************

Synopsis
========

  * Usage:
        F = principalFilter(P, a)
  * Inputs:
      * P, an instance of the type Poset,
      * a, a thing (Macaulay2Doc), an element of the poset
  * Outputs:
      * F, a list (Macaulay2Doc), containing all elements greater
        than or equal to the given element

Description
===========

The filter of a given element of a poset is all the elements in the poset which
are greater than or equal to the element.

+------------------------------+
|i1 : P = booleanLattice 3;    |
+------------------------------+
|i2 : principalFilter(P, "101")|
|                              |
|o2 = {101, 111}               |
|                              |
|o2 : List                     |
+------------------------------+

See also
========

  * filter -- computes the elements above given elements in a
    poset
  * orderIdeal -- computes the elements below given elements
    in a poset
  * principalOrderIdeal -- computes the elements
    below a given element in a poset

Ways to use principalFilter :
=============================

  * "principalFilter(Poset,Thing)"

For the programmer
==================

The object principalFilter, is a method function (Macaulay2Doc).

principalOrderIdeal -- computes the elements below a given element in a poset
*****************************************************************************

Synopsis
========

  * Usage:
        I = principalOrderIdeal(P, a)
  * Inputs:
      * P, an instance of the type Poset,
      * a, a thing (Macaulay2Doc), an element of the poset
  * Outputs:
      * I, a list (Macaulay2Doc), containing all elements less than
        or equal to the given elements

Description
===========

The order ideal of a element of a poset is all the elements in the poset which
are less than or equal to the given element.

+----------------------------------+
|i1 : P = booleanLattice 3;        |
+----------------------------------+
|i2 : principalOrderIdeal(P, "101")|
|                                  |
|o2 = {000, 001, 100, 101}         |
|                                  |
|o2 : List                         |
+----------------------------------+

See also
========

  * filter -- computes the elements above given elements in a
    poset
  * orderIdeal -- computes the elements below given elements
    in a poset
  * principalFilter -- computes the elements above a
    given element in a poset

Ways to use principalOrderIdeal :
=================================

  * "principalOrderIdeal(Poset,Thing)"

For the programmer
==================

The object principalOrderIdeal, is a method function (Macaulay2Doc).

product(Poset,Poset) -- computes the product of two posets
**********************************************************

Synopsis
========

  * Function: product (Macaulay2Doc),
  * Usage:
        R = product(P, Q)
        R = P * Q
  * Inputs:
      * P, an instance of the type Poset,
      * Q, an instance of the type Poset,
  * Outputs:
      * R, an instance of the type Poset, the Cartesian product
        of $P$ and $Q$

Description
===========

The Cartesian product of the posets $P$ and $Q$ is the new poset whose ground
set is the Cartesian product of the ground sets of $P$ and $Q$ and with partial
order given by $(a,b) \leq (c,d)$ if and only if $a \leq c$ and $b \leq d$.

+-------------------------------------------+
|i1 : product(chain 3, poset {{a,b},{b,c}}) |
|                                           |
|o1 = Relation Matrix: | 1 1 1 1 1 1 1 1 1 ||
|                      | 0 1 1 0 1 1 0 1 1 ||
|                      | 0 0 1 0 0 1 0 0 1 ||
|                      | 0 0 0 1 1 1 1 1 1 ||
|                      | 0 0 0 0 1 1 0 1 1 ||
|                      | 0 0 0 0 0 1 0 0 1 ||
|                      | 0 0 0 0 0 0 1 1 1 ||
|                      | 0 0 0 0 0 0 0 1 1 ||
|                      | 0 0 0 0 0 0 0 0 1 ||
|                                           |
|o1 : Poset                                 |
+-------------------------------------------+

The product of $n$ chains of length $2$ is isomorphic to the boolean lattice on
$n$ elements.  These are also isomorphic to the divisor lattice on the product
of $n$ distinct primes.

+----------------------------------+
|i2 : B = booleanLattice 4;        |
+----------------------------------+
|i3 : B == product(4, i -> chain 2)|
|                                  |
|o3 = true                         |
+----------------------------------+

See also
========

  * diamondProduct -- computes the diamond product of
    two ranked posets

Ways to use this method:
========================

  * product(Poset,Poset) -- computes the
    product of two posets

projectivizeArrangement -- computes the intersection poset of a projectivized hyperplane arrangement
****************************************************************************************************

Synopsis
========

  * Usage:
        P = projectivizeArrangement(L, R)
  * Inputs:
      * L, a list (Macaulay2Doc), which gives the equations
        defining the (possibly non-projective) hyperplane arrangement
      * R, a ring (Macaulay2Doc), which the hyperplanes are defined
        over
  * Outputs:
      * P, an instance of the type Poset,

Description
===========

This method returns the intersectionLattice, of the
projectivization of the specified hyperplane arrangement.

+-----------------------------------------------+
|i1 : R = QQ[x,y,z];                            |
+-----------------------------------------------+
|i2 : projectivizeArrangement({x^2-y, y^2-z}, R)|
|                                               |
|o2 = Relation Matrix: | 1 0 1 0 |              |
|                      | 0 1 1 0 |              |
|                      | 0 0 1 0 |              |
|                      | 1 1 1 1 |              |
|                                               |
|o2 : Poset                                     |
+-----------------------------------------------+

Caveat
======

The variable used for homogenization is $Z$, and so the ring $R$ should not
already have this variable in use.

See also
========

  * intersectionLattice -- generates the
    intersection lattice of a hyperplane arrangement

Ways to use projectivizeArrangement :
=====================================

  * "projectivizeArrangement(List,Ring)"

For the programmer
==================

The object projectivizeArrangement, is a
method function (Macaulay2Doc).

randomPoset -- generates a random poset with a given relation probability
*************************************************************************

Synopsis
========

  * Usage:
        P = randomPoset n
        P = randomPoset G
        P = randomPoset(n, Bias => RR)
        P = randomPoset(G, Bias => RR)
  * Inputs:
      * n, an integer (Macaulay2Doc), the number of vertices in the
        poset
      * G, a list (Macaulay2Doc), the ground set of the poset
  * Optional inputs (Macaulay2Doc),:
      * Bias => a real number (Macaulay2Doc), default value .5, the
        probability that a given relation will be present
  * Outputs:
      * P, an instance of the type Poset,

Description
===========

This method generates a random poset with a given ground set ($\{1, \ldots,
n\}$, if $n$ is specified).

+---------------------------------------------+
|i1 : randomPoset 10                          |
|                                             |
|o1 = Relation Matrix: | 1 0 0 1 0 1 1 1 1 1 ||
|                      | 0 1 0 0 1 1 1 1 1 1 ||
|                      | 0 0 1 1 0 1 1 1 1 1 ||
|                      | 0 0 0 1 0 0 0 1 0 0 ||
|                      | 0 0 0 0 1 1 1 0 1 1 ||
|                      | 0 0 0 0 0 1 1 0 1 0 ||
|                      | 0 0 0 0 0 0 1 0 1 0 ||
|                      | 0 0 0 0 0 0 0 1 0 0 ||
|                      | 0 0 0 0 0 0 0 0 1 0 ||
|                      | 0 0 0 0 0 0 0 0 0 1 ||
|                                             |
|o1 : Poset                                   |
+---------------------------------------------+

The option Bias determines the probability that a given relation will be
present.  A higher Bias will lead to more relations.

+---------------------------------------------+
|i2 : randomPoset(10, Bias => 0.1)            |
|                                             |
|o2 = Relation Matrix: | 1 0 0 0 1 0 1 1 0 0 ||
|                      | 0 1 0 0 0 0 0 0 0 0 ||
|                      | 0 0 1 0 0 0 0 0 0 0 ||
|                      | 0 0 0 1 1 0 0 0 0 0 ||
|                      | 0 0 0 0 1 0 0 0 0 0 ||
|                      | 0 0 0 0 0 1 0 0 0 1 ||
|                      | 0 0 0 0 0 0 1 1 0 0 ||
|                      | 0 0 0 0 0 0 0 1 0 0 ||
|                      | 0 0 0 0 0 0 0 0 1 0 ||
|                      | 0 0 0 0 0 0 0 0 0 1 ||
|                                             |
|o2 : Poset                                   |
+---------------------------------------------+
|i3 : randomPoset(10, Bias => 0.9)            |
|                                             |
|o3 = Relation Matrix: | 1 1 1 1 1 1 1 1 1 1 ||
|                      | 0 1 1 1 1 1 1 1 1 1 ||
|                      | 0 0 1 1 1 1 1 1 1 1 ||
|                      | 0 0 0 1 1 1 1 1 1 1 ||
|                      | 0 0 0 0 1 1 1 1 1 1 ||
|                      | 0 0 0 0 0 1 1 1 1 1 ||
|                      | 0 0 0 0 0 0 1 1 1 1 ||
|                      | 0 0 0 0 0 0 0 1 1 1 ||
|                      | 0 0 0 0 0 0 0 0 1 1 ||
|                      | 0 0 0 0 0 0 0 0 0 1 ||
|                                             |
|o3 : Poset                                   |
+---------------------------------------------+

See also
========

  * random (Macaulay2Doc) -- get a random object

Ways to use randomPoset :
=========================

  * "randomPoset(List)"
  * "randomPoset(ZZ)"

For the programmer
==================

The object randomPoset, is a method function with options (Macaulay2Doc).

rankFunction -- computes the rank function of a ranked poset
************************************************************

Synopsis
========

  * Usage:
        rk = rankFunction P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * rk, a list (Macaulay2Doc), such that entry $i$ is the rank
        of the $i$th member of the ground set

Description
===========

The poset $P$ is ranked if there exists an integer function $r$ on the vertex
set of $P$ such that for each $a$ and $b$ in the poset if $b$ covers $a$ then
$r(b) - r(a) = 1$.

This method returns one such ranking function.

+---------------------------------------------+
|i1 : (chain 5).GroundSet                     |
|                                             |
|o1 = {1, 2, 3, 4, 5}                         |
|                                             |
|o1 : List                                    |
+---------------------------------------------+
|i2 : rankFunction chain 5                    |
|                                             |
|o2 = {0, 1, 2, 3, 4}                         |
|                                             |
|o2 : List                                    |
+---------------------------------------------+
|i3 : (booleanLattice 3).GroundSet            |
|                                             |
|o3 = {000, 001, 010, 011, 100, 101, 110, 111}|
|                                             |
|o3 : List                                    |
+---------------------------------------------+
|i4 : rankFunction booleanLattice 3           |
|                                             |
|o4 = {0, 1, 1, 2, 1, 2, 2, 3}                |
|                                             |
|o4 : List                                    |
+---------------------------------------------+

This method was ported from John Stembridge's Maple package available at
http://www.math.lsa.umich.edu/~jrs/maple.html#posets.

See also
========

  * isRanked -- determines if a poset is ranked
  * rankPoset -- generates a list of lists representing the
    ranks of a ranked poset

Ways to use rankFunction :
==========================

  * "rankFunction(Poset)"

For the programmer
==================

The object rankFunction, is a method function (Macaulay2Doc).

rankGeneratingFunction -- computes the rank generating function of a ranked poset
*********************************************************************************

Synopsis
========

  * Usage:
        r = rankGeneratingFunction P
        r = rankGeneratingFunction(P, VariableName => symbol)
  * Inputs:
      * P, an instance of the type Poset, a ranked poset
  * Optional inputs (Macaulay2Doc),:
      * VariableName => a symbol (Macaulay2Doc), default value q
  * Outputs:
      * r, a ring element (Macaulay2Doc), the rank
        generating function of $P$

Description
===========

The rank generating function of $P$ is the polynomial with the coefficient of
$q^i$ given by the number of vertices in rank $i$ of $P$.

The rank generating function of the $n$ See chain, is $q^{n-1} +
\cdots + q + 1$.

+-----------------------------------+
|i1 : n = 5;                        |
+-----------------------------------+
|i2 : rankGeneratingFunction chain n|
|                                   |
|      4    3    2                  |
|o2 = q  + q  + q  + q + 1          |
|                                   |
|o2 : ZZ[q]                         |
+-----------------------------------+

The rank generating function of the $n$ See booleanLattice,
is $(q+1)^n$.

+---------------------------------------------------+
|i3 : factor rankGeneratingFunction booleanLattice n|
|                                                   |
|            5                                      |
|o3 = (q + 1)                                       |
|                                                   |
|o3 : Expression of class Product                   |
+---------------------------------------------------+

See also
========

  * isRanked -- determines if a poset is ranked
  * rankPoset -- generates a list of lists representing the
    ranks of a ranked poset

Ways to use rankGeneratingFunction :
====================================

  * "rankGeneratingFunction(Poset)"

For the programmer
==================

The object rankGeneratingFunction, is a
method function with options (Macaulay2Doc).

rankPoset -- generates a list of lists representing the ranks of a ranked poset
*******************************************************************************

Synopsis
========

  * Usage:
        L = rankPoset P
        L = rank Poset
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * L, a list (Macaulay2Doc), containing lists such that the
        $i$th list is the set of vertices in the $i$th rank of $P$

Description
===========

The poset $P$ is ranked if there exists an integer function $r$ on the vertex
set of $P$ such that for each $a$ and $b$ in the poset if $b$ covers $a$ then
$r(b) - r(a) = 1$.

This method returns the list of vertices in each rank.

+-----------------------------------------------------+
|i1 : rankPoset chain 5                               |
|                                                     |
|o1 = {{1}, {2}, {3}, {4}, {5}}                       |
|                                                     |
|o1 : List                                            |
+-----------------------------------------------------+
|i2 : rankPoset booleanLattice 3                      |
|                                                     |
|o2 = {{000}, {001, 010, 100}, {011, 101, 110}, {111}}|
|                                                     |
|o2 : List                                            |
+-----------------------------------------------------+

This method uses the method rankFunction, which was ported
from John Stembridge's Maple package available at
http://www.math.lsa.umich.edu/~jrs/maple.html#posets.

See also
========

  * isRanked -- determines if a poset is ranked
  * rankFunction -- computes the rank function of a ranked
    poset

Ways to use rankPoset :
=======================

  * "rankPoset(Poset)"

For the programmer
==================

The object rankPoset, is a method function (Macaulay2Doc).

realRegions -- computes the number of regions a hyperplane arrangement divides the space into
*********************************************************************************************

Synopsis
========

  * Usage:
        b = realRegions(A, R)
  * Inputs:
      * A, a list (Macaulay2Doc), of polynomials defining the
        hyperplanes
      * R, a ring (Macaulay2Doc),
  * Outputs:
      * b, an integer (Macaulay2Doc), the number of regions

Description
===========

This method computes the number of regions cut out by the hyperplane
arrangement.

+----------------------------------------------------------------+
|i1 : R = RR[x,y];                                               |
+----------------------------------------------------------------+
|i2 : A = {x+y,x,x-y,y+1};                                       |
+----------------------------------------------------------------+
|i3 : realRegions(A, R)                                          |
|-- warning: experimental computation over inexact field begun   |
|--          results not reliable (one warning given per session)|
|                                                                |
|o3 = 10                                                         |
+----------------------------------------------------------------+

See also
========

  * boundedRegions -- computes the number of bounded
    regions a hyperplane arrangement divides the space into
  * intersectionLattice -- generates the
    intersection lattice of a hyperplane arrangement

Ways to use realRegions :
=========================

  * "realRegions(List,Ring)"

For the programmer
==================

The object realRegions, is a method function (Macaulay2Doc).

removeIsomorphicPosets -- returns a sub-list of non-isomorphic posets
*********************************************************************

Synopsis
========

  * Usage:
        N = removeIsomorphicPosets L
  * Inputs:
      * L, a list (Macaulay2Doc), containing posets
  * Outputs:
      * N, a list (Macaulay2Doc), containing posets with
        non-isomorphic elements

Description
===========

This method returns a sublist $N$ of $L$ containing the elements of $L$, in
order, where the first instance of each isomorphism class is retained.

+-----------------------------------------------------------------------------+
|i1 : L = {chain 4, divisorPoset (2^3), booleanLattice 3, booleanLattice 2,   |
|-----------------------------------------------------------------------------|
|product(3, i -> chain 2)};                                                   |
+-----------------------------------------------------------------------------+
|i2 : removeIsomorphicPosets L                                                |
|                                                                             |
|o2 = {Relation Matrix: | 1 1 1 1 |, Relation Matrix: | 1 1 1 1 1 1 1 1 |,    |
|                       | 0 1 1 1 |                   | 0 1 0 1 0 1 0 1 |     |
|                       | 0 0 1 1 |                   | 0 0 1 1 0 0 1 1 |     |
|                       | 0 0 0 1 |                   | 0 0 0 1 0 0 0 1 |     |
|                                                     | 0 0 0 0 1 1 1 1 |     |
|                                                     | 0 0 0 0 0 1 0 1 |     |
|                                                     | 0 0 0 0 0 0 1 1 |     |
|                                                     | 0 0 0 0 0 0 0 1 |     |
|     ------------------------------------------------------------------------|
|     Relation Matrix: | 1 1 1 1 |}                                           |
|                      | 0 1 0 1 |                                            |
|                      | 0 0 1 1 |                                            |
|                      | 0 0 0 1 |                                            |
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+

See also
========

  * areIsomorphic -- determines if two posets are
    isomorphic
  * isomorphism -- computes an isomorphism between
    isomorphic posets
  * Posets -- a package for working with partially ordered sets

Ways to use removeIsomorphicPosets :
====================================

  * "removeIsomorphicPosets(List)"

For the programmer
==================

The object removeIsomorphicPosets, is a
method function (Macaulay2Doc).

resolutionPoset -- generates a poset from a resolution
******************************************************

Synopsis
========

  * Usage:
        P = resolutionPoset C
        P = resolutionPoset I
  * Inputs:
      * C, a chain complex (Macaulay2Doc),
      * I, a monomial ideal (Macaulay2Doc),
      * I, an ideal (Macaulay2Doc),
  * Outputs:
      * P, an instance of the type Poset,

Description
===========

Given a resolution $C$, a poset can be defined by the non-zero entries of the
matrices of each component of the resolution.

+-----------------------------------------------------+
|i1 : R = QQ[x,y,z];                                  |
+-----------------------------------------------------+
|i2 : C = res ideal(y*z,x*z,x^2*y)                    |
|                                                     |
|      1      3      2                                |
|o2 = R  <-- R  <-- R  <-- 0                          |
|                                                     |
|     0      1      2      3                          |
|                                                     |
|o2 : ChainComplex                                    |
+-----------------------------------------------------+
|i3 : resolutionPoset C                               |
|                                                     |
|o3 = Relation Matrix: | 1 1 1 1 1 1 |                |
|                      | 0 1 0 0 1 0 |                |
|                      | 0 0 1 0 1 1 |                |
|                      | 0 0 0 1 0 1 |                |
|                      | 0 0 0 0 1 0 |                |
|                      | 0 0 0 0 0 1 |                |
|                                                     |
|o3 : Poset                                           |
+-----------------------------------------------------+
|i4 : (resolutionPoset C).GroundSet                   |
|                                                     |
|o4 = {{0, 0}, {1, 0}, {1, 1}, {1, 2}, {2, 0}, {2, 1}}|
|                                                     |
|o4 : List                                            |
+-----------------------------------------------------+

Moreover, the resolution-poset of a MonomialIdeal (Macaulay2Doc),
can be labeled as the lcm (Macaulay2Doc),
of the generators involved at each level.  As the lcm
needn't be unique at each step, we simply append it to the base labeling, as
above.

+-----------------------------------------------------------------------------+
|i5 : P = resolutionPoset monomialIdeal(y*z,x*z,x^2*y)                        |
|                                                                             |
|o5 = P                                                                       |
|                                                                             |
|o5 : Poset                                                                   |
+-----------------------------------------------------------------------------+
|i6 : P.GroundSet                                                             |
|                                                                             |
|                              2                                      2       |
|o6 = {{0, 0, {0, 0}}, {1, 0, x y}, {1, 1, x*z}, {1, 2, y*z}, {2, 0, x y*z},  |
|     ------------------------------------------------------------------------|
|     {2, 1, x*y*z}}                                                          |
|                                                                             |
|o6 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use resolutionPoset :
=============================

  * "resolutionPoset(ChainComplex)"
  * "resolutionPoset(Ideal)"
  * "resolutionPoset(MonomialIdeal)"

For the programmer
==================

The object resolutionPoset, is a method function (Macaulay2Doc).

setPartition -- computes the list of set-partitions of size $n$
***************************************************************

Synopsis
========

  * Usage:
        L = setPartition n
        L = setPartition S
  * Inputs:
      * S, a list (Macaulay2Doc), to be partitioned
      * n, an integer (Macaulay2Doc), the size of the set to
        partition
  * Outputs:
      * L, a list (Macaulay2Doc),

Description
===========

A set-partition of a List (Macaulay2Doc), is a partitioning of the
list into a finite number of non-empty disjoint pieces whose union is the
original list.

+-----------------------------------------------------------------------------+
|i1 : setPartition {2,3,5}                                                    |
|                                                                             |
|o1 = {{{2, 3, 5}}, {{2, 3}, {5}}, {{2, 5}, {3}}, {{2}, {3, 5}}, {{2}, {3},   |
|     ------------------------------------------------------------------------|
|     {5}}}                                                                   |
|                                                                             |
|o1 : List                                                                    |
+-----------------------------------------------------------------------------+

The set-partitions of $n$ is the collection of set-partitions of the set
$\{1,\ldots,n\}$.

+-----------------------------------------------------------------------------+
|i2 : setPartition 4                                                          |
|                                                                             |
|o2 = {{{1, 2, 3, 4}}, {{1, 2, 3}, {4}}, {{1, 2, 4}, {3}}, {{1, 2}, {3, 4}},  |
|     ------------------------------------------------------------------------|
|     {{1, 2}, {3}, {4}}, {{1, 3}, {2, 4}}, {{1, 3, 4}, {2}}, {{1, 3}, {2},   |
|     ------------------------------------------------------------------------|
|     {4}}, {{1, 4}, {2, 3}}, {{1}, {2, 3, 4}}, {{1}, {2, 3}, {4}}, {{1, 4},  |
|     ------------------------------------------------------------------------|
|     {2}, {3}}, {{1}, {2, 4}, {3}}, {{1}, {2}, {3, 4}}, {{1}, {2}, {3}, {4}}}|
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+

See also
========

  * partitionLattice -- computes the lattice of
    set-partitions of size $n$

Ways to use setPartition :
==========================

  * "setPartition(List)"
  * "setPartition(ZZ)"

For the programmer
==================

The object setPartition, is a method function (Macaulay2Doc).

setPrecompute -- sets the Precompute configuration
**************************************************

Synopsis
========

  * Usage:
        alt = setPrecompute pc
  * Inputs:
      * pc, a Boolean value (Macaulay2Doc), the new setting
  * Outputs:
      * alt, a Boolean value (Macaulay2Doc), the old setting

Description
===========

This method sets the default Precompute option.

+------------------------+
|i1 : setPrecompute false|
|                        |
|o1 = true               |
+------------------------+

See also
========

  * Precompute -- a package-wide configuration that toggles
    precomputation

Ways to use setPrecompute :
===========================

  * "setPrecompute(Boolean)"

For the programmer
==================

The object setPrecompute, is a method function (Macaulay2Doc).

setSuppressLabels -- sets the SuppressLabels configuration
**********************************************************

Synopsis
========

  * Usage:
        alt = setSuppressLabels sl
  * Inputs:
      * sl, a Boolean value (Macaulay2Doc), the new setting
  * Outputs:
      * alt, a Boolean value (Macaulay2Doc), the old setting

Description
===========

This method sets the default SuppressLabels option.

+----------------------------+
|i1 : setSuppressLabels false|
|                            |
|o1 = true                   |
+----------------------------+

See also
========

  * SuppressLabels -- generates a string containing a
    TikZ-figure of a poset

Ways to use setSuppressLabels :
===============================

  * "setSuppressLabels(Boolean)"

For the programmer
==================

The object setSuppressLabels, is a method function (Macaulay2Doc).

standardMonomialPoset -- generates the poset of divisibility in the monomial basis of an ideal
**********************************************************************************************

Synopsis
========

  * Usage:
        P = standardMonomialPoset I
        P = standardMonomialPoset(I, minDeg, maxDeg)
  * Inputs:
      * I, a monomial ideal (Macaulay2Doc),
      * minDeg, an integer (Macaulay2Doc), the minimum degree of a
        monomial in the poset
      * maxDeg, an integer (Macaulay2Doc), the maximum degree of a
        monomial in the poset
  * Outputs:
      * P, an instance of the type Poset,

Description
===========

The standard monomial poset of a MonomialIdeal (Macaulay2Doc),
is the poset of monomials in the quotient (Macaulay2Doc),
with partial ordering given by divisibility.

+--------------------------------------------------------------+
|i1 : R = QQ[x,y,z];                                           |
+--------------------------------------------------------------+
|i2 : standardMonomialPoset monomialIdeal(x^2, y^2, z^2, x*y*z)|
|                                                              |
|o2 = Relation Matrix: | 1 1 1 1 1 1 1 |                       |
|                      | 0 1 1 1 0 0 0 |                       |
|                      | 0 0 1 0 0 0 0 |                       |
|                      | 0 0 0 1 0 0 0 |                       |
|                      | 0 0 1 0 1 1 0 |                       |
|                      | 0 0 0 0 0 1 0 |                       |
|                      | 0 0 0 1 0 1 1 |                       |
|                                                              |
|o2 : Poset                                                    |
+--------------------------------------------------------------+

If the integers minDeg and maxDeg are specified, then only the monomials with
degrees between minDeg and maxDeg are used.  As the standard monomial poset is
ranked, this is the same as taking all the ranks between minDeg and maxDeg.

+---------------------------------------------------------------------+
|i3 : standardMonomialPoset(monomialIdeal(x^4, y^4, z^4, x*y*z), 3, 4)|
|                                                                     |
|o3 = Relation Matrix: | 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |        |
|                      | 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |        |
|                      | 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |        |
|                      | 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 |        |
|                      | 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 |        |
|                      | 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 |        |
|                      | 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 |        |
|                      | 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 |        |
|                      | 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 |        |
|                      | 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 |        |
|                      | 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 |        |
|                      | 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 |        |
|                      | 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 |        |
|                      | 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 |        |
|                      | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 |        |
|                      | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 |        |
|                      | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 |        |
|                      | 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 |        |
|                                                                     |
|o3 : Poset                                                           |
+---------------------------------------------------------------------+

See also
========

  * basis (Macaulay2Doc) -- basis or generating set of all or part
    of a ring, ideal or module
  * monomialIdeal (Macaulay2Doc) -- make a monomial ideal

Ways to use standardMonomialPoset :
===================================

  * "standardMonomialPoset(MonomialIdeal)"
  * "standardMonomialPoset(MonomialIdeal,ZZ,ZZ)"

For the programmer
==================

The object standardMonomialPoset, is a
method function (Macaulay2Doc).

subposet -- computes the induced subposet of a poset given a list of elements
*****************************************************************************

Synopsis
========

  * Usage:
        Q = subposet(P, L)
  * Inputs:
      * P, an instance of the type Poset,
      * L, a list (Macaulay2Doc), containing elements in the poset
  * Outputs:
      * Q, an instance of the type Poset, the induced subposet of
        $P$ with ground set $L$

Description
===========

The induced subposet $Q$ on ground set $L$ of a poset $P$ has a partial order
induced by the partial order on $P$.

+---------------------------------+
|i1 : C = chain 7;                |
+---------------------------------+
|i2 : subposet(C, {2,3,5,6})      |
|                                 |
|o2 = Relation Matrix: | 1 1 1 1 ||
|                      | 0 1 1 1 ||
|                      | 0 0 1 1 ||
|                      | 0 0 0 1 ||
|                                 |
|o2 : Poset                       |
+---------------------------------+

See also
========

  * dropElements -- computes the induced subposet of a
    poset given a list of elements to remove
  * poset -- creates a new Poset object

Ways to use subposet :
======================

  * "subposet(Poset,List)"

For the programmer
==================

The object subposet, is a method function (Macaulay2Doc).

texPoset -- generates a string containing a TikZ-figure of a poset
******************************************************************

Synopsis
========

  * Usage:
        texPoset P
        texPoset(P, SuppressLabels => Boolean)
        texPoset(P, Jitter => Boolean)
        tex P
  * Inputs:
      * P, an instance of the type Poset,
  * Optional inputs (Macaulay2Doc),:
      * SuppressLabels => a Boolean value (Macaulay2Doc),
        default value true, whether to display or suppress the labels of the
        poset
      * Jitter => a Boolean value (Macaulay2Doc), default value
        false, whether to randomly jitter the poset vertices
  * Outputs:
      * S, a string (Macaulay2Doc), a TikZ-figure of $P$

Description
===========

This method creates a TikZ-figure of the Hasse diagram of the given poset which
can be included in a LaTeX file.  The representation places the vertices on
horizontal lines corresponding to the filtration, of the
poset.  The only displayed edges are the coveringRelations,
which are oriented so that lower vertices less than higher
vertices.

The method attempts to display labels in a sane way, if they are not suppressed
by the SuppressLabels option. Note that the SuppressLabels option's default
value can be set in the "~/.Macaulay2/init-Posets.m2" file.

Further, sometimes the vertices of the poset line up in unfortunate ways that
causes edges to touch other vertices.  Using the Jitter option can relieve this
by adding a small random horizontal shift to each vertex.

+-----------------------------------------------------------------------------+
|i1 : texPoset booleanLattice 2                                               |
|                                                                             |
|o1 = \begin{tikzpicture}[scale=1, vertices/.style={draw, fill=black, circle, |
|             \node [vertices] (0) at (-0+0,0){};                             |
|             \node [vertices] (1) at (-.75+0,1.33333){};                     |
|             \node [vertices] (2) at (-.75+1.5,1.33333){};                   |
|             \node [vertices] (3) at (-0+0,2.66667){};                       |
|     \foreach \to/\from in {0/1, 2/3, 0/2, 1/3}                              |
|     \draw [-] (\to)--(\from);                                               |
|     \end{tikzpicture}                                                       |
|-----------------------------------------------------------------------------|
|inner sep=0pt}]                                                              |
+-----------------------------------------------------------------------------+
|i2 : texPoset(booleanLattice 2, Jitter => true)                              |
|                                                                             |
|o2 = \begin{tikzpicture}[scale=1, vertices/.style={draw, fill=black, circle, |
|             \node [vertices] (0) at (-0+.267814,0){};                       |
|             \node [vertices] (1) at (-.75+.202018,1.33333){};               |
|             \node [vertices] (2) at (-.75+1.58819,1.33333){};               |
|             \node [vertices] (3) at (-0+.189883,2.66667){};                 |
|     \foreach \to/\from in {0/1, 2/3, 0/2, 1/3}                              |
|     \draw [-] (\to)--(\from);                                               |
|     \end{tikzpicture}                                                       |
|-----------------------------------------------------------------------------|
|inner sep=0pt}]                                                              |
+-----------------------------------------------------------------------------+

Caveat
======

Calling texPoset via the command tex (Macaulay2Doc), expects that no
options are given.

See also
========

  * coveringRelations -- computes the minimal list of
    generating relations of a poset
  * displayPoset -- generates a PDF representation of a
    poset and attempts to display it
  * filtration -- generates the filtration of a poset
  * outputTexPoset -- writes a LaTeX file with a
    TikZ-representation of a poset

Ways to use texPoset :
======================

  * "texPoset(Poset)"

For the programmer
==================

The object texPoset, is a method function with options (Macaulay2Doc).

transitiveClosure -- computes the transitive closure of a set of relations
**************************************************************************

Synopsis
========

  * Usage:
        M = transitiveClosure(G, R)
  * Inputs:
      * G, a list (Macaulay2Doc), the ground set
      * R, a list (Macaulay2Doc), pairs {$a,b$} which indicate that
        $a \leq b$
  * Outputs:
      * M, a matrix (Macaulay2Doc), with entries $(i,j)$ equal to
        1 if $G_j \leq G_i$ and 0 otherwise

Description
===========

This method uses the descendants (Graphs), method from the
Graphs, package to compute the RelationMatrix,
from the relations $R$.

+---------------------------------------------+
|i1 : G = {1,2,3,4,5};                        |
+---------------------------------------------+
|i2 : R = {{1,2}, {1,3}, {2,4}, {3,4}, {4,5}};|
+---------------------------------------------+
|i3 : transitiveClosure(G, R)                 |
|                                             |
|o3 = | 1 1 1 1 1 |                           |
|     | 0 1 0 1 1 |                           |
|     | 0 0 1 1 1 |                           |
|     | 0 0 0 1 1 |                           |
|     | 0 0 0 0 1 |                           |
|                                             |
|              5        5                     |
|o3 : Matrix ZZ  <--- ZZ                      |
+---------------------------------------------+

See also
========

  * poset -- creates a new Poset object

Ways to use transitiveClosure :
===============================

  * "transitiveClosure(List,List)"

For the programmer
==================

The object transitiveClosure, is a method function (Macaulay2Doc).

transitiveOrientation -- generates a poset whose comparability graph is the given graph
***************************************************************************************

Synopsis
========

  * Usage:
        P = transitiveOrientation G
  * Inputs:
      * G, a graph (Graphs),
  * Optional inputs (Macaulay2Doc),:
      * Random => a Boolean value (Macaulay2Doc), default value
        false, whether to randomise the edges first
      * Strategy => a string (Macaulay2Doc), default value
        "error", whether to throw an error ('error') if the graph has no
        transitive orientation or to return a null ('null')
  * Outputs:
      * P, an instance of the type Poset, such that
        comparabilityGraph, $P$ is isomorphic to $G$

Description
===========

A transitive orientation of a graph $G$ is an orientation on the edges of $G$
such that if $a < b$ and $b < c$, then $a < c$. Not all graphs have transitive
orientations, but those that do are comparabilityGraph,
s of posets.

+--------------------------------------------+
|i1 : G = graph {{1,2}, {2,3}, {3,4}, {1,4}};|
+--------------------------------------------+
|i2 : transitiveOrientation G                |
|                                            |
|o2 = Relation Matrix: | 1 1 1 0 |           |
|                      | 0 1 0 0 |           |
|                      | 0 0 1 0 |           |
|                      | 0 1 1 1 |           |
|                                            |
|o2 : Poset                                  |
+--------------------------------------------+

A transitive orientation of a graph $G$ need not be unique. To see other random
orientations, set the option Random to true.

+-----------------------------------------------------------------------------+
|i3 : setRandomSeed 0;                                                        |
+-----------------------------------------------------------------------------+
|i4 : G = graph {{1,2},{2,3},{3,4},{1,3},{1,3}};                              |
+-----------------------------------------------------------------------------+
|i5 : removeIsomorphicPosets apply(4, i -> transitiveOrientation(G, Random => |
|                                                                             |
|o5 = {Relation Matrix: | 1 1 1 1 |, Relation Matrix: | 1 1 0 1 |}            |
|                       | 0 1 1 0 |                   | 0 1 0 1 |             |
|                       | 0 0 1 0 |                   | 0 0 1 1 |             |
|                       | 0 0 0 1 |                   | 0 0 0 1 |             |
|                                                                             |
|o5 : List                                                                    |
|-----------------------------------------------------------------------------|
|true))                                                                       |
+-----------------------------------------------------------------------------+

If the give graph is not a comparability graph, e.g. an odd cycle of length at
least $5$, then the method returns an error.

The method implemented is Algorithm 5.3 (pages 129-130) from Martin Charles
Golumbic, "Algorithmic graph theory and perfect graphs."  Second edition.
Annals of Discrete Mathematics, 57.  Elsevier Science B.V., Amsterdam, 2004.
xxvi+314pp.

See also
========

  * comparabilityGraph -- produces the comparability
    graph of a poset
  * isComparabilityGraph -- determines if a graph
    is the comparability graph of a poset

Ways to use transitiveOrientation :
===================================

  * "transitiveOrientation(Graph)"

For the programmer
==================

The object transitiveOrientation, is a
method function with options (Macaulay2Doc).

tuttePolynomial -- computes the Tutte polynomial of a poset
***********************************************************

Synopsis
========

  * Usage:
        f = tuttePolynomial P
  * Inputs:
      * P, an instance of the type Poset,
  * Outputs:
      * f, a ring element (Macaulay2Doc), the Tutte
        polynomial of $P$

Description
===========

The Tutte polynomial of $P$ is a polynomial $f$ in two variables obtained by a
summation over antichains.

+-----------------------------------------------------------------------------+
|i1 : B = booleanLattice 3;                                                   |
+-----------------------------------------------------------------------------+
|i2 : f = tuttePolynomial B                                                   |
|                                                                             |
|      8 7     8 6      8 5      8 4      8 3    7 4      8 2     7 3     6 4 |
|o2 = t z  + 7t z  + 21t z  + 35t z  + 35t z  + t z  + 21t z  + 4t z  + 3t z  |
|     ------------------------------------------------------------------------|
|         8      7 2      6 3    8     7       6 2     5 3    7      6        |
|     + 7t z + 6t z  + 12t z  + t  + 4t z + 18t z  + 3t z  + t  + 12t z +     |
|     ------------------------------------------------------------------------|
|       5 2     4 3     6     5      4 2     5      4      4     3      3     |
|     9t z  + 3t z  + 3t  + 9t z + 9t z  + 3t  + 10t z + 4t  + 3t z + 3t  +   |
|     ------------------------------------------------------------------------|
|       2      2                                                              |
|     3t z + 3t  + t + 1                                                      |
|                                                                             |
|o2 : QQ[t, z]                                                                |
+-----------------------------------------------------------------------------+

The Tutte polynomial evaluated at $t = 1$ and $z = 1$ is always the number of
subsets of the groundset of $P$.

+---------------------------------+
|i3 : R = ring f;                 |
+---------------------------------+
|i4 : sub(f, {R_0 => 1, R_1 => 1})|
|                                 |
|o4 = 256                         |
|                                 |
|o4 : QQ                          |
+---------------------------------+

See also
========

  * antichains -- computes all antichains of a poset

Ways to use tuttePolynomial :
=============================

  * "tuttePolynomial(Poset)"

For the programmer
==================

The object tuttePolynomial, is a method function (Macaulay2Doc).

union -- computes the union of two posets
*****************************************

Synopsis
========

  * Usage:
        R = union(P, Q)
        R = P + Q
  * Inputs:
      * P, an instance of the type Poset,
      * Q, an instance of the type Poset,
  * Outputs:
      * R, an instance of the type Poset, the union of $P$ and
        $Q$

Description
===========

The union of two posets is the poset induced by the union of the ground sets
and the covering relations.

+----------------------------------------------+
|i1 : union(chain 3, poset {{1,4},{4,5},{5,3}})|
|                                              |
|o1 = Relation Matrix: | 1 1 1 1 1 |           |
|                      | 0 1 1 0 0 |           |
|                      | 0 0 1 0 0 |           |
|                      | 0 0 1 1 1 |           |
|                      | 0 0 1 0 1 |           |
|                                              |
|o1 : Poset                                    |
+----------------------------------------------+

See also
========

  * product (Macaulay2Doc)

Ways to use union :
===================

  * "union(Poset,Poset)"

For the programmer
==================

The object union, is a method function (Macaulay2Doc).

youngSubposet -- generates a subposet of Young's lattice
********************************************************

Synopsis
========

  * Usage:
        P = youngSubposet(lo, hi)
        P = youngSubposet hi
        P = youngSubposet n
  * Inputs:
      * lo, a list (Macaulay2Doc), which represents a partition
      * hi, a list (Macaulay2Doc), which represents a partition
      * n, an integer (Macaulay2Doc), the maximum size of a partition
  * Outputs:
      * P, an instance of the type Poset,

Description
===========

Young's lattice is the infinite lattice of all partitions (Macaulay2Doc),
with partial ordering given by componentwise linear
ordering.

If $n$ is specified, then the poset returned is the subposet of Young's lattice
given by the induced subposet, of all partitions of size at
most $n$.

+-------------------------------------------------+
|i1 : youngSubposet 4                             |
|                                                 |
|o1 = Relation Matrix: | 1 1 1 1 1 1 1 1 1 1 1 1 ||
|                      | 0 1 1 1 1 1 1 1 1 1 1 1 ||
|                      | 0 0 1 0 1 1 0 1 1 1 1 0 ||
|                      | 0 0 0 1 0 1 1 0 1 1 1 1 ||
|                      | 0 0 0 0 1 0 0 1 1 0 0 0 ||
|                      | 0 0 0 0 0 1 0 0 1 1 1 0 ||
|                      | 0 0 0 0 0 0 1 0 0 0 1 1 ||
|                      | 0 0 0 0 0 0 0 1 0 0 0 0 ||
|                      | 0 0 0 0 0 0 0 0 1 0 0 0 ||
|                      | 0 0 0 0 0 0 0 0 0 1 0 0 ||
|                      | 0 0 0 0 0 0 0 0 0 0 1 0 ||
|                      | 0 0 0 0 0 0 0 0 0 0 0 1 ||
|                                                 |
|o1 : Poset                                       |
+-------------------------------------------------+

If an upper partition, hi, is specified, then the returned poset is the
closedInterval, of the Young's lattice between lo and hi, where
lo either is the empty partition or is specified.

+-----------------------------------------+
|i2 : youngSubposet({3,1}, {4,2,1})       |
|                                         |
|o2 = Relation Matrix: | 1 1 1 1 1 1 1 1 ||
|                      | 0 1 0 1 0 1 0 1 ||
|                      | 0 0 1 1 0 0 1 1 ||
|                      | 0 0 0 1 0 0 0 1 ||
|                      | 0 0 0 0 1 1 1 1 ||
|                      | 0 0 0 0 0 1 0 1 ||
|                      | 0 0 0 0 0 0 1 1 ||
|                      | 0 0 0 0 0 0 0 1 ||
|                                         |
|o2 : Poset                               |
+-----------------------------------------+

See also
========

  * partitions (Macaulay2Doc) -- list the partitions of an
    integer

Ways to use youngSubposet :
===========================

  * "youngSubposet(List)"
  * "youngSubposet(List,List)"
  * "youngSubposet(ZZ)"

For the programmer
==================

The object youngSubposet, is a method function (Macaulay2Doc).

zetaPolynomial -- computes the zeta polynomial of a poset
*********************************************************

Synopsis
========

  * Usage:
        z = zetaPolynomial P
        z = zetaPolynomial(P, VariableName => symbol)
  * Inputs:
      * P, an instance of the type Poset,
  * Optional inputs (Macaulay2Doc),:
      * VariableName => a symbol (Macaulay2Doc), default value q
  * Outputs:
      * z, a ring element (Macaulay2Doc), the zeta
        polynomial of $P$

Description
===========

The zeta polynomial of $P$ is the polynomial $z$ such that for every $i > 1$,
$z(i)$ is the number of weakly increasing chains of $i-1$ vertices in $P$.

The zeta polynomial of the $n$ See booleanLattice, is $q^n$.

+--------------------------+
|i1 : B = booleanLattice 3;|
+--------------------------+
|i2 : z = zetaPolynomial B |
|                          |
|      3                   |
|o2 = q                    |
|                          |
|o2 : QQ[q]                |
+--------------------------+

Thus, $z(2)$ is the number of vertices of $P$, and $z(3)$ is the number of
total relations in $P$.

+-----------------------------------------------+
|i3 : #B.GroundSet == sub(z, (ring z)_0 => 2)   |
|                                               |
|o3 = true                                      |
+-----------------------------------------------+
|i4 : #allRelations B == sub(z, (ring z)_0 => 3)|
|                                               |
|o4 = true                                      |
+-----------------------------------------------+

See also
========

  * chains -- computes all chains of a poset

Ways to use zetaPolynomial :
============================

  * "zetaPolynomial(Poset)"

For the programmer
==================

The object zetaPolynomial, is a method function with options (Macaulay2Doc).