`coxeter/text/reduce` := TEXT(`    `,
`FUNCTION:  reduce - find a reduced expression for a group element`,`    `,
`CALLING SEQUENCE:  reduce(w,R);`,`                   reduce(w,R,'subword');`,
`    `,`PARAMETERS:  R = a root system data structure`,
`             w = a list of integers representing a member of W(R)`,`   `,
`SYNOPSIS:   `,
`  If R is a root system of rank n, members of the Coxeter group W(R) are`,
`  represented as lists of integers in the range 1..n. The group element`,
`  corresponding to w = [i_1,...,i_l] is the product of the generators`,
`  indexed by i_1,...,i_l. The indexing follows base(R).`,`   `,
`  reduce(w,R) returns a reduced expression for w; i.e., a minimum-length`,
`  representation of w. Among all reduced expressions for w, the one`,
`  returned is the first in lexicographic order. In particular, two`,
`  sequences w1 and w2 represent the same element of W(R) if and only if`,
`                      reduce(w1,R) = reduce(w2,R).`,`   `,
`  If a third argument is present, the result returned is a reduced subword;`,
`  i.e., a reduced expression that can be obtained as a SUBSEQUENCE of w.`,
`  The algorithm for finding reduced subwords is based on the exchange`,
`  property, and has a running time that is quadratic in the length of w.`,
`  The default algorithm is linear with respect to length.`,`   `,
`  For a description of root system data structures, see coxeter[structure].`,
`   `,`EXAMPLES:   `,
`  reduce([1,2,3,1,2,3],A3);              yields        [2,1,3,2]`,
`  reduce([1,2,3,1,2,3],A3,'subword');    yields        [2,3,1,2]`,`    `,
`SEE ALSO:  base, structure, vec2fc`):

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