`posets/text/omega` := TEXT(
` `,
`FUNCTION:  omega - order polynomial of a poset`,
` `,
`CALLING SEQUENCE:  omega(P,z,<options>);`,
`                   omega(P,X,z,<options>);`,
`                   omega(P,n,z,<options>);`,
` `,
`PARAMETERS:  P     = a poset`,
`             X     = a set (the vertex set)`,
`             n     = a positive integer (the number of vertices)`,
`             z     = a variable name or expression`,
`         <options> = any of the following, in any order:`,
`            (1) 'ideals' or 'linear' (specifying an algorithm)`,
`            (2) a subset of P (specifying descent positions)`,
`   `,
`SYNOPSIS:`,
`  The order polynomial of a poset P with vertex set X is the unique`,
`  polynomial F(z) such that for all integers m>0, F(m) equals the number`,
`  of order-preserving maps from P to an m-element chain.`,
`   `,
`  omega(P,X,z) returns the order polynomial of P, evaluated at z.`,
`  omega(P,n,z) does the same, if the vertex set of P is X={1,...,n}.`,
`  omega(P,z) does the same, assuming that P has no isolated vertices.`,
`   `,
`  Note that omega(P,X,z) = zeta(J(P,X),z).`,
`   `,
`  Two algorithms are provided for computing order polynomials: 'linear'`,
`  and 'ideals'. The 'linear' algorithm has minimal space requirements and`,
`  a running time that is linear in the number of linear extensions of P.`,
`  The 'ideals' algorithm is more appropriate for larger posets, and has`,
`  worst-case time and space requirements that are quadratic in the number`,
`  of order ideals of P. If neither algorithm is specified, the default is`,
`  to use the 'linear' option for posets with <= 6 vertices, and the`,
`  'ideals' option otherwise. `,
`   `,
`  The second optional argument is a subset S of P. This option is for`,
`  computing the order polynomials of *labeled* posets, in the following`,
`  sense. Let L be a labeling of the poset P with vertex set X; that is,`,
`  an integer numbering of the vertex set X without repetitions. Let S be`,
`  the subset of the covering relation of P consisting of all pairs [a,b]`,
`  such that b covers a in P and L[a] > L[b]. The order polynomial of P`,
`  with respect to L is the unique polynomial F(z) such that for all`,
`  integers m>0, F(m) equals the number of order-preserving maps f from P`,
`  to an m-element chain such that f(a) < f(b) whenever [a,b] is in S.`,
`  If S = {}, we obtain the usual order polynomial as defined above.`,
`   `,
`  If there does not exist a labeling L of P for which S is the set of`,
`  covering pairs [a,b] such that L[a] > L[b], then S is inadmissible and`,
`  an error is signaled.`,
`   `,
`EXAMPLES:`,
`  f:=omega(chain(4),5,z);`,
`  factor(f);                          yields    1/24*z^2*(z+3)*(z+2)*(z+1)`,
`  f:=omega(chain(4),z,{[3,4]}); `,
`  factor(f);                          yields     1/24*z*(z-1)*(z+2)*(z+1)`,
`  f:=omega(chain(4),6,z,'ideals');`,
`  factor(f);                          yields    1/24*z^3*(z+3)*(z+2)*(z+1)`,
`  omega({[a,b],[a,c]},{a,b,c,d},3);   yields                42`,
`  P:=chain(9); S:=chain(5);`,
`  9!*omega(P,q,'linear',S);           yields`,
`                                  q^9 - 30*q^7 + 273*q^5 - 820*q^3 + 576*q`,
`   `,
`SEE ALSO:  extensions, ideals, J, W, zeta`,
NULL):

if `+`(0)=0 then # Maple V.4 or later
  print(INTERFACE_HELP(insert, topic=`posets/omega`,
  helpfile=HomeLib, text=`posets/text/omega`))
elif ceil(0)=0 then # Maple V.2 or V.3
  `help/posets/text/omega`:=`posets/text/omega`:
  save `help/posets/text/omega`, cat(HomeLib,`/help/posets/text/omega.m`)
fi:
