`posets/text/modular` := TEXT(
`   `,
`FUNCTION:  modular - test modularity and semi-modularity of lattices`,
` `,
`CALLING SEQUENCE:`,
`              modular(L);    modular(L,'lower');    modular(L,'upper');`,
`              modular(L,X);  modular(L,X,'lower');  modular(L,X,'upper');`,
`              modular(L,n);  modular(L,n,'lower');  modular(L,n,'upper');`,
` `,
`PARAMETERS:  L = a lattice`,
`             X = a set (the vertex set)`,
`             n = a positive integer (the number of vertices)`,
`   `,
`SYNOPSIS:`,
`  A lattice L is upper (resp., lower) semi-modular if it is ranked, and the`,
`  rank function r satisfies r[a] + r[b] >= r[meet(a,b)] + r[join(a,b)] for`,
`  all vertices a and b (resp., with <= in place of >=). L is modular if it`,
`  is both upper and lower semi-modular. L is geometric if and only if it is`,
`  atomic and upper semi-modular.`,
`   `,
`  modular(L) returns true or false according to whether the lattice L is`,
`  modular. If the final argument is 'upper' (resp., 'lower'), the procedure`,
`  tests only for upper (resp., lower) semi-modularity. `,
`   `,
`  modular(L,X) does the same, if the vertex set of L is X.`,
`  modular(L,n) does the same, if the vertex set of L is {1,...,n}.`,
`   `,
`  The procedure *does not* test to see whether L is actually a lattice.`,
` `,
`EXAMPLES:`,
`  L:=({},1) &+ ({},3) &+ ({},1);`,
`  modular(L);                                         yields    true`,
`  L:=({},1) &+ (chain(2),3) &+ ({},1);`,
`  modular(L);                                         yields    false`,
`  L:=({},1) &+ {[1,2],[1,3],[4,3],[4,5]} &+ ({},1);`,
`  modular(L,'upper');                                 yields    true`,
`  modular(L,'lower');                                 yields    false`,
` `,
`SEE ALSO:  atomic, distributive, lattice, meet, ranked`,
NULL):

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