`posets/text/lattice` := TEXT(
` `,
`FUNCTION:  lattice - test whether a poset is a lattice or semi-lattice`,
` `,
`CALLING SEQUENCE:  lattice(P);    lattice(P,'semi');`,
`                   lattice(P,X);  lattice(P,X,'semi');`,
`                   lattice(P,n);  lattice(P,n,'semi');`,
` `,
`PARAMETERS:  P = a poset`,
`             X = a set (the vertex set)`,
`             n = a positive integer (the number of vertices)`,
`   `,
`SYNOPSIS:`,
`  A poset P is a lattice if every pair of elements has a greatest lower`,
`  bound (the meet) and a least upper bound (the join).`,
`   `,
`  lattice(P,X) returns true or false according to whether the poset P`,
`  with vertex set X is a lattice.`,
`  lattice(P,n) does the same, if the vertex set of P is {1,...,n}.`,
`  lattice(P) does the same, assuming that P has no isolated vertices.`,
`   `,
`  If the final argument is the name 'semi', then the procedure returns`,
`  true or false according to whether P is a meet semi-lattice; i.e.,`,
`  whether every pair of elements has a greatest lower bound.`,
`   `,
`  Use the dual of P to test whether P is a join semi-lattice.`,
`   `,
`  The algorithm used for lattice-testing relies on the fact that it`,
`  suffices to check that there is a maximum element and that the meet`,
`  of x and y exists when there is a z covering x and y. Reference:`,
`  Bjorner-Edelman-Ziegler, Discrete Comput. Geom. 5 (1990), p. 265.`,
`   `,
`  To compute meets (or joins) in lattices, use the 'meet' function.`,
` `,
`EXAMPLES:`,
`  L:=chain(2) &* chain(3);`,
`  lattice(L,6);                  yields         true`,
`  lattice(L,7);                  yields         false`,
`  M:=({},3) &+ L;`,
`  lattice(M);                    yields         false`,
`  lattice(dual(M),'semi');       yields         true`,
` `,
`SEE ALSO:  distributive, dual, meet, modular`,
NULL):

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