Words in an fp-group may be compared both for equality and for their relationship with respect to a natural lexicographic ordering. It should be noted that even when a pair of words belong to a group defined by non-trivial relations, only the free reductions of the words are compared. Thus, a pair of words belonging to a group G may be declared to be distinct even though they may represent the same element of G.
The words of an fp-group G are ordered first by length and then
lexicographically.
The lexicographic ordering is determined by the following ordering on the
generators and their inverses:
G.1 < G.1^(-1) < G.2 < G.2^(-1) < ... Here, u and v are words belonging to some common fp-group.
u eq v : GrpFPElt, GrpFPElt -> BoolElt
True if the free reductions of the words u and v are identical.
True if the free reductions of the words u and v are not identical.
True if the word u precedes the word v, with respect to the ordering defined above for elements of an fp-group. The words u and v are freely reduced before the comparison is made.
True if the word u either precedes, or is equal to, the word v, with respect to the ordering defined above for elements of an fp-group. The words u and v are freely reduced before the comparison is made.
True if the word u either follows, or is equal to, the word v, with respect to the ordering defined above for elements of an fp-group. The words u and v are freely reduced before the comparison is made.
True if the word u follows the word v, with respect to the ordering defined above for elements of an fp-group. The words u and v are freely reduced before the comparison is made.
The length of the word u.
Given words u and v, and a generator x, all belonging to a group G, return the word obtained from u by replacing each occurrence of x by v and each occurrence of x^(-1) by v^(-1).
Given a set of words U, a word v, and a generator x, all belonging to a group G, return the set of words obtained by taking each element u of U in turn, and replacing each occurrence of x in u by v and each occurrence of x^(-1) by v^(-1).
Given a word u, and the name of a generator x of a group G, compute the sum of the exponents of the generator x in the word u.
Suppose w is a word belonging to a group G. Assume x is the name of the i-th generator of G. Then
- if w = Identity(G), GeneratorNumber(w) is 0;
- if w = x * w', w' a word in G, GeneratorNumber(w) is i;
- if w = x^(-1) * w', w' a word in G, GeneratorNumber(w) is -i.
Suppose u and v are words belonging to the same group G, and that f is an integer such that 1 <= f <= # u. The function seeks the least integer l such that:If such an integer l is found Match returns the value true and l. If no such l is found, Match returns the value false.
- l >= f; and
- v appears as a subword of u, starting at the l-th letter of u.
A random word of length l in the generators of the group G, where m <= l <= n.
The word obtained by cyclically permuting the word u by n places. If n is positive, the rotation is from left to right, while if n is negative the rotation is from right to left. In the case where n is zero, the function returns u.
U is a set or sequence of either words belonging to an n-generator fp-group H or relations over H. E is a sequence of n elements [e_1, ..., e_n] belonging to a group G for which a multiplication algorithm exists. Using the mapping H.i -> e_i (i = 1, ..., n), we evaluate the relations given by U. If U is a set or sequence of relations, the left and right hand sides of each relation are evaluated and compared for equality. Otherwise, each word in U is evaluated and compared to the identity. If all relations are satisfied, IsSatisfied returns the Boolean value true. On the other hand, if any relation is not satisfied, IsSatisfied returns the value false.
Given words u and v belonging to a group G, and non-negative integers f and n, this function replaces the substring of u of length n, starting at position f, by the word v. Thus, if u = x_(i_1)^(e_1) ... x_(i_f)^(e_f) ... x_(i_(f + n - 1))^(e_(f + n - 1)) ... x_(i_m)^(e_m) then the substring x_(i_f)^(e_f) ... x_(i_(f + n - 1))^(e_(f + n - 1)) is replaced by v. If the function is invoked with v = Id(G), then the substring x_(i_f)^(e_f) ... x_(i_(f + n - 1))^(e_(f + n - 1)) of u is deleted.
The subword of the word u comprising the n consecutive letters commencing at the f-th letter of u.
The sequence Q obtained by decomposing u into its constituent generators and generator inverses. Suppose u is a word in the group G. Then, if u = G.i_1^(e_1) ... G.i_m^(e_m), with each e_i equalling plus or minus 1, then Q[j] = i_j if e_j = + 1 and Q[j] = - i_j if e_j = (-1), for j = 1, ..., m.
> F<x, y, z> := FreeGroup(3); > u := (x, y*z); > w := u^(x^2*y); > #w;12
> w;
y^-1 * x^-3 * z^-1 * y^-1 * x * y * z * x^2 * y
> // We replace each occurrence of the generator x by the word y*z^-1 in w > Eliminate(w, x, y*z^-1);
y^-1 * z * y^-1 * z * y^-1 * z * y^-1 * z^-2 * y * z * y * z^-1 * y * z^-1 * y
> // We count the number of occurrences of each generator in w > [ ExponentSum(w, F.i) : i in [1..Ngens(F)] ];
[ 0, 0, 0 ]
> GeneratorNumber(w);
-2
> // We locate the start of word u in the word w > b, p := Match(w, u, 1); > b, p;
true 4
> // We now replace the subword u in w by the word y*x > t := Substitute(w, p, #u, y*x); > t;
y^-1 * x^-2 * y * x^3 * y
> // We create the set of all distinct cyclic permutations of the word u > rots := { RotateWord(u, i) : i in [1 ..#u] }; > rots;
{ y^-1 * x * y * z * x^-1 * z^-1, x * y * z * x^-1 * z^-1 * y^-1, x^-1 * z^-1 * y^-1 * x * y * z, z * x^-1 * z^-1 * y^-1 * x * y, z^-1 * y^-1 * x * y * z * x^-1, y * z * x^-1 * z^-1 * y^-1 * x }