`posets/text/antichains` := TEXT(
` `,
`FUNCTION:  antichains - list/count antichains in a partially ordered set`,
` `,
`CALLING SEQUENCE:  antichains(P,<option>);`,
`                   antichains(P,n,<option>);`,
`                   antichains(P,X,<option>);`,
` `,
`PARAMETERS:  P    = a poset`,
`             X    = a set (the vertex set); or, a linear extension of P`,
`             n    = a positive integer (the number of vertices)`,
`         <option> = at most one of the following:`,
`            (1) a range, such as 2..7`,
`            (2) the name 'max'`,
`            (3) a variable name, such as q`,
`   `,
`SYNOPSIS:`,
`  Let P be a poset with vertex set X. An antichain in P is a subset A`,
`  of X such that no pair x,y in A satisfies x < y in P. The number of`,
`  antichains in P equals the number of order ideals of P.`,
`   `,
`  antichains(P,X) returns a list of all antichains in the poset P.`,
`  antichains(P,n) does the same, if the vertex set of P is {1,2,...,n}.`,
`  antichains(P) does the same, assuming that P has no isolated vertices.`,
`   `,
`  The antichains are listed in a lexicographic order so that antichain A`,
`  precedes antichain B if B contains the "last" vertex of the symmetric`,
`  difference of A and B. Here, "last" is determined by some linear`,
`  extension of P; i.e., a linear ordering of X such that if x < y in P,`,
`  then x precedes y in the linear ordering. So for example, all antichains`,
`  that contain the last vertex appear after all antichains that do not.`,
`   `,
`  In order to force the use of the lexordering induced by a particular`,
`  linear extension of P, the vertex set X may be specified as a list in`,
`  the desired order, rather than as a set.`,
`   `,
`  Optionally, if the last argument is a range a..b, then only those`,
`  antichains whose sizes fit within this range are listed.`,
`   `,
`  Optionally, if the last argument is the name 'max', then only maximal`,
`  antichains are listed.`,
`   `,
`  Optionally, if the last argument is a variable name, such as q, then`,
`  the result is the generating series for antichains; i.e., the sum`,
`  of q^nops(A) over all antichains A in P.`,
`   `,
`EXAMPLES:`,
`  antichains({[a,b],[b,c]},{a,b,c});`,
`                                   yields           [{},{a},{b},{c}]`,
`  antichains({[a,b]},[a,b,c]);     yields     [{},{a},{b},{c},{a,c},{b,c}]`,
`  antichains({[a,b]},[c,a,b]);     yields     [{},{c},{a},{a,c},{b},{b,c}]`,
`  P:=chain(2) &* chain(3);`,
`  antichains(P,7,q);               yields           1+7*q+9*q^2+3*q^3`,
`  antichains(P,'max');             yields      [{1},{2,3},{2,5},{4,5},{6}]`,
`  P:=chain(3) &* chain(4);`,
`  antichains(P,3..3);              yields`,
`                                      [{3,5,7},{3,5,10},{3,8,10},{6,8,10}]`,
`   `,
`SEE ALSO:  chains, extensions, ideals, J`,
NULL):

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