`posets/text/flag_h` := TEXT(
` `,
`FUNCTION:  flag_f - flag f-polynomial of a bounded, ranked poset`,
`           flag_h - flag h-polynomial of a bounded, ranked poset`,
` `,
`CALLING SEQUENCE:  flag_f(P,z);      flag_h(P,z);`,
`                   flag_f(P,X,z);    flag_h(P,X,z);`,
`                   flag_f(P,n,z);    flag_h(P,n,z);`,
` `,
`PARAMETERS:  P = a bounded, ranked poset`,
`             X = a set (the vertex set)`,
`             n = a positive integer (the number of vertices)`,
`             z = a variable name`,
`   `,
`SYNOPSIS:`,
`  Let P be a ranked poset with vertex set X, and assume it is bounded;`,
`  i.e., P has a minimum and a maximum element. The flag f-polynomial`,
`  of P is defined to be the sum of`,
`   `,
`     z[rank(x_1)] * z[rank(x_2)] * ... * z[rank(x_k)],`,
`   `,
`  where x_0 < x_1 < ... < x_k ranges over all chains in P of any length`,
`  k such that x_0 is the minimum element of P and x_k is the maximum`,
`  element of P. In particular, if the maximum element has rank r>0, then`,
`  every term in the sum includes the factor z[r].`,
`   `,
`  The flag h-polynomial of P may be expressed in terms of the flag`,
`  f-polynomial F(z[1],...,z[r]) as follows:`,
`   `,
`    (1-z[1])* ... *(1-z[r]) * F( z[1]/(1-z[1]), ..., z[r]/(1-z[r]) ).`,
`   `,
`  flag_f(P,X,z) returns the flag f-polynomial of the poset P, expressed`,
`  in terms of the variables z[1], z[2],..., z[r], where r=rank(P).`,
`  flag_f(P,n,z) does the same, if the vertex set of P is {1,...,n}.`,
`  flag_f(P,z) does the same, assuming that P has no isolated vertices.`,
`   `,
`  The syntax for computing the flag h-polynomial is the same.`,
`   `,
`  If the poset is not ranked or not bounded, an error is signaled.`,
`  In particular, a poset with isolated vertices and nops(X)>1 will`,
`  always trigger an error.`,
`   `,
`  If the variables z[1],...,z[r] are all specialized to the same value,`,
`  the flag f-polynomial specializes to the f-polynomial and the flag`,
`  h-polynomial specializes to the h-polynomial (see 'f_poly').`,
`   `,
`  The W-polynomial W(Q,Y,q,t) is the flag h-polynomial of J(Q,Y) with`,
`  the variables z[1],...,z[r] specialized so that z[i]=q^i*t.`,
`   `,
`EXAMPLES:`,
`  P:=({},1) &+ ({},3) &+ chain(2);`,
`  flag_f(P,z);                  yields`,
`                             z[3]+3*z[1]*z[3]+z[2]*z[3]+3*z[1]*z[2]*z[3]`,
`  flag_h(P,z);                  yields        z[3]+2*z[1]*z[3]`,
`  flag_h(chain(4),4,q);         yields              q[3]`,
`   `,
`SEE ALSO:  chains, f_poly, h_poly, ranked, omega, W, zeta`,
NULL):

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