In this section, we describe some rather low level operations on presentations and on elements of fp-groups. The main purpose of the functions described here, is to provide some efficient machinery for manipulating presentations and elements of fp-groups for user written functions.
The functions described in this section construct a new fp-group from an existing one by adding or deleting a generator or by adding, deleting or changing a relation. The new group is created without any relationship to the existing group.
Given an fp-group G with presentation < X | R >, create a new fp-group with presentation < X ∪{ z } | R >, where z is a symbol not in X.
Given an fp-group G with presentation < X | R >, and given also a word w in the generators X, create a new fp-group having the presentation < X ∪{ z } | R ∪{ z = w } >, where z is a symbol not in X.
Given an fp-group G, and a relation r on the generators of G, create a new fp-group whose presentation consists of the relations of G together with the relation r.
Given an fp-group G, and an element g of G, create a new fp-group whose presentation consists of the relations of G together with the relation g=( Id)(G).
Given an fp-group G, and a relation r on the generators of G, create a new fp-group which has as its presentation the relations of G together with the relation r inserted after the i-th existing relation of G.
Given an fp-group G, and an element g of G, create a new fp-group which has as its presentation the relations of G together with the relation g=( Id)(G) inserted after the i-th existing relation of G.
Given an fp-group G with presentation < X | R >, and given also an element z in X, create a new fp-group with presentation < X - {z} | R' >, where the relations R' are obtained from R by deleting all relations containing an occurrence of z.
Given an fp-group G, which includes the relation r amongst its relations, create a new fp-group which has as its presentation the relations of G with relation r omitted.
Given an fp-group G, which includes the relation g=( Id)(G) amongst its relations, create a new fp-group which has as its presentation the relations of G with this relation omitted.
Given an fp-group G, create a new fp-group which has as its presentation the relations for G with the i-th relation deleted.
Given an fp-group G, which includes the relation s or h=( Id)(G) amongst its relations, create a new fp-group which has as its presentation the relations for G with the relation s replaced by the relation r or g=( Id)(G).
Given an fp-group G and a relation r in the generators of G, create a new fp-group which has as its presentation the relations for G with relation number i replaced by the relation r.
Given an fp-group G and an element g of G, create a new fp-group which has as its presentation the relations for G with relation number i replaced by the relation g=( Id)(G).
> G<x,y,z,h,k,a> := Group< x, y, z, h, k, a | > x^2, y^2, z^2, (x,y), (y,z), (x,z), h^3, k^3, (h,k), > (x,k), (y,k), (z,k), x^h*y, y^h*z, z^h*x, a^2, a*x*a*y, > a*y*a*x, (a,z), (a,k), (a*h)^2 >; > for i := 0 to 1 do > for j := 0 to 1 do > for k := 0 to 1 do > for l := 0 to 2 do > rel := G.1^i*G.2^j*G.3^k*G.5^l*(G.6*G.4)^2 = Id(G); > K := ReplaceRelation(G, 21, rel); > print Order(K), Index(K, sub< K | K.6, K.4>); > end for; > end for; > end for; > end for; <0, 0, 0, 0> 144 24 <0, 0, 0, 1> 144 8 <0, 0, 0, 2> 144 8 <0, 0, 1, 0> 18 3 <0, 0, 1, 1> 18 1 <0, 0, 1, 2> 18 1 <0, 1, 0, 0> 72 3 <0, 1, 0, 1> 72 1 <0, 1, 0, 2> 72 1 <0, 1, 1, 0> 36 6 <0, 1, 1, 1> 36 2 <0, 1, 1, 2> 36 2 <1, 0, 0, 0> 18 3 <1, 0, 0, 1> 18 1 <1, 0, 0, 2> 18 1 <1, 0, 1, 0> 144 6 <1, 0, 1, 1> 144 2 <1, 0, 1, 2> 144 2 <1, 1, 0, 0> 36 6 <1, 1, 0, 1> 36 2 <1, 1, 0, 2> 36 2 <1, 1, 1, 0> 72 12 <1, 1, 1, 1> 72 4 <1, 1, 1, 2> 72 4
The functions described in this section perform low level string operations like substitution, elimination or substring matching on elements of fp-groups.
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.
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.
- (a)
- l≥f; and
- (b)
- v appears as a subword of u, starting at the l-th letter of u.
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.
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 = xi1e1 ... xifef ... x_(if + n - 1)ef + n - 1 ... ximem then the substring xifef ... x_(if + n - 1)ef + n - 1 is replaced by v. If the function is invoked with v = Id(G), then the substring xifef ... x_(if + n - 1)ef + 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.
> 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 * yWe replace each occurrence of the generator x in w by the word y * z^ - 1.
> 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 * yWe count the number of occurrences of each generator in w.
> [ ExponentSum(w, F.i) : i in [1..Ngens(F)] ]; [ 0, 0, 0 ] > GeneratorNumber(w); -2We locate the start of the word u in the word w.
> b, p := Match(w, u, 1); > b, p; true 4We 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 * yWe 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 }