From now on, fix Σ = {a < b < c} and let the notation α be defined by α = c if α = a a if α = c. We will first present Salomaa's characterization of M-equivalence for ...
Elsevier Editorial System(tm) for Theoretical Computer Science Manuscript Draft Manuscript Number: Title: On a Conjecture about Parikh Matrices Article Type: Regular Paper (10 - 40 pages) Section/Category: C - Theory of natural computing Keywords: Parikh matrix mapping; Parikh matrices; injectivity problem; $M$-equivalence; Atanasiu's system; subword occurrences Corresponding Author: Dr. Wen Chean Teh, Corresponding Author's Institution: Universiti Sains Malaysia First Author: Wen Chean Teh Order of Authors: Wen Chean Teh; Adrian Atanasiu
Manuscript (PDF)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
ON A CONJECTURE ABOUT PARIKH MATRICES WEN CHEAN TEH AND ADRIAN ATANASIU Abstract. Based on Salomaa’s characterization of M -equivalence, Atanasiu conjectured that a certain natural generalization of ME-equivalence solves the injectivity problem of Parikh matrices for the ternary alphabet. This paper refutes his conjecture but continue to study the interesting proposed Thue system. Characterization of certain irreducible elementary transformations under this system is obtained. Furthermore, these transformations are further scrutinized in terms of their replaceability by simpler ones.
1. Introduction The Parikh matrix mapping [7, 8] was introduced by Mateescu et al. as an extension of the classical Parikh mapping [9]. Two words are M -equivalent if and only if they have the same Parikh matrix. As the Parikh matrix of a word contains much structural information about the word, the characterization of M -equivalence, also known as the injectivity problem, is essential to the study of combinatorics of words through Parikh matrices. Although receiving significant interest (for example, see [1–6,11–18]), no satisfactory solution to the injectivity problem has been found, even for the ternary alphabet. The first complete characterization of M -equivalence for the ternary alphabet was provided by Salomaa [12] in terms of a Thue system. Nevertheless, the associated rewriting rules do not preserve M -equivalence. In [3] we observed that this can be overcome simply by taking a combination of Salomaa’s rule. Therefore, a wider class of M -equivalence preserving rewriting rules for the ternary alphabet was proposed, associated with a conjecture that this solves the injectivity problem for that alphabet. Although the conjecture is false, that Thue system — denoted here as “Atanasiu’s system” — is natural and richer than ME-equivalence for the ternary alphabet. This paper presents results regarding the elementary transformations of Atanasiu’s system in terms of what we call irreducibility and irreplaceability. The remainder of this paper is structured as follows. Section 2 provides the basic terminology and preliminary. The next section introduces Atanasiu’s system and connects it to Salomaa’s characterization. The irreducible transformations of Atanasiu’s system will be characterized in the subsequent section. Section 5 addresses the irreplaceability of an irreducible transformation by the ones of lower order. Finally, our conclusions follow after that. 2000 Mathematics Subject Classification. 68R15, 68Q45, 05A05. Key words and phrases. Parikh matrix mapping, Parikh matrices, injectivity problem, M -equivalence, Atanasiu’s system, subword occurrences. 1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
ON A CONJECTURE ABOUT PARIKH MATRICES
2
2. Parikh Matrices The cardinality of a set X is denoted by ∣X∣. Suppose Σ is a finite alphabet. The set of words over Σ is denoted by Σ∗ . The empty word is denoted by λ. If v, w ∈ Σ∗ , the concatenation of v and w is denoted by vw. An ordered alphabet is an alphabet Σ = {a1 , a2 , . . . , as } with a total ordering on it. For example, if a1 < a2 < ⋯ < as , then we may write Σ = {a1 < a2 < ⋯ < as }. On the other hand, if Σ = {a1 < a2 < ⋯ < as } is an ordered alphabet, then the underlying alphabet is {a1 , a2 , . . . , as }. Frequently, we will abuse notation and use Σ to stand for both the ordered alphabet and its underlying alphabet, for example, as in “w ∈ Σ∗ ” when Σ is an ordered alphabet. If w ∈ Σ∗ , then ∣w∣ is the length of w and w[i] is the i-th letter of w. For 1 ≤ i ≤ j ≤ s, let ai,j denote the word ai ai+1 ⋯aj . Definition 2.1. A word w′ is a subword of w ∈ Σ∗ iff there exist x1 , x2 , . . . , xn , y0 , y1 , . . . , yn ∈ Σ∗ , some of them possibly empty, such that w′ = x1 x2 ⋯xn and w = y0 x1 y1 ⋯yn−1 xn yn . In the literature, our subwords are usually called “scattered subwords”. A factor is a contiguous subword. The number of occurrences of a word v as a subword of w is denoted by ∣w∣v . Two occurrences of v are considered different iff they differ by at least one position of some letter. For example, ∣aabab∣ab = 5 and ∣baacbc∣abc = 2. By convention, ∣w∣λ = 1 for all w ∈ Σ∗ . The reader is referred to [10] for language theoretic notions not detailed here. For any integer k ≥ 2, let Mk denote the multiplicative monoid of k × k upper triangular matrices with nonnegative integral entries and unit diagonal. Definition 2.2. Suppose Σ = {a1 < a2 < ⋯ < as } is an ordered alphabet. The Parikh matrix mapping, denoted ΨΣ , is the monoid morphism ΨΣ ∶ Σ∗ → Ms+1 defined as follows: ΨΣ (λ) = Is+1 ; if ΨΣ (aq ) = (mi,j )1≤i,j≤s+1 , then mi,i = 1 for each 1 ≤ i ≤ s + 1, mq,q+1 = 1 and all other entries of the matrix ΨΣ (aq ) are zero. Matrices of the form ΨΣ (w) for w ∈ Σ∗ are called Parikh matrices. Theorem 2.3. [7] Suppose Σ = {a1 < a2 < ⋯ < as } is an ordered alphabet and w ∈ Σ∗ . The matrix ΨΣ (w) = (mi,j )1≤i,j≤s+1 has the following properties: ● mi,i = 1 for each 1 ≤ i ≤ s + 1; ● mi,j = 0 for each 1 ≤ j < i ≤ s + 1; ● mi,j+1 = ∣w∣ai,j for each 1 ≤ i ≤ j ≤ s. The Parikh vector Ψ(w) = (∣w∣a1 , ∣w∣a2 , . . . , ∣w∣as ) of a word w ∈ Σ∗ is contained in the second diagonal of the Parikh matrix ΨΣ (w).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
ON A CONJECTURE ABOUT PARIKH MATRICES
3
Example 2.4. Suppose Σ = {a < b < c} and w = abcbac. Then ΨΣ (w) = ΨΣ (a)ΨΣ (b)ΨΣ (c)ΨΣ (b)ΨΣ (a)ΨΣ (c) ⎛1 ⎜0 =⎜ ⎜0 ⎝0
1 1 0 0
0 0 1 0
0⎞ ⎛1 0⎟ ⎜0 ⎟⎜ 0⎟ ⎜0 1⎠ ⎝0
⎛1 ⎜0 =⎜ ⎜0 ⎝0
2 1 0 0
2 2 1 0
3⎞ ⎛1 ∣w∣a ∣w∣ab ∣w∣abc ⎞ 3⎟ ⎜0 1 ∣w∣b ∣w∣bc ⎟ ⎟=⎜ ⎟. ⎟ ⎜ 0 0 1 ∣w∣c ⎟ 2 1⎠ ⎝0 0 0 1 ⎠
0 1 0 0
0 1 1 0
0⎞ ⎛1 0⎟ ⎜0 ⎟⋯⎜ 0⎟ ⎜0 1⎠ ⎝0
0 1 0 0
0 0 1 0
0⎞ 0⎟ ⎟ 1⎟ 1⎠
Definition 2.5. Suppose Σ = {a1 < a2 < ⋯ < as } is an ordered alphabet. Two words w, w′ ∈ Σ∗ are M -equivalent, denoted w ≡M w′ , iff ΨΣ (w) = ΨΣ (w′ ). The following are two elementary rules for deciding whether two words are M -equivalent, stated only for the ternary alphabet. Suppose Σ = {a < b < c} and w, w′ ∈ Σ∗ . E1. If w = xacy and w′ = xcay for some x, y ∈ Σ∗ , then w ≡M w′ . E2. If w = xαbybαz and w′ = xbαyαbz for some α ∈ {a, c}, x, z ∈ Σ∗ , and y ∈ {α, b}∗ , then w ≡M w′ . Definition 2.6. Suppose Σ = {a < b < c} and w, w′ ∈ Σ∗ . We say that w and w′ are elementarily matrix equivalent (ME-equivalent), denoted w ≡ME w′ , iff w′ can be obtained from w by finitely many applications of Rule E1 and Rule E2 (more precisely, the rewriting rules implicitly stated in these rules). The rules E1 and E2 are first formally defined in [4] (with a different notation). The term ME-equivalence is due to Salomaa [12]. There has been a few studies on the extent to which ME-equivalence characterizes M -equivalance (see [4, 12, 17]). 3. From Salomaa’s Characterization to Atanasiu’s System From now on, fix Σ = {a < b < c} and let the notation α be defined by α={
c a
if α = a if α = c.
We will first present Salomaa’s characterization of M -equivalence for the ternary alphabet. Lemma 3.1. If x, y, z ∈ Σ∗ and α ∈ {a, c}, then ∣xαbybαz∣abc = ∣xbαyαbz∣abc +∣y∣α . Proof. Straightforward.
Lemma 3.1 justifies the following definition, where the numbers above the arrows indicate the corresponding change in the number of occurrences of the subword abc. Definition 3.2. Suppose w, w′ ∈ Σ∗ .
(1) We denote by w → w′ iff w′ is obtained from w using Rule E1. 0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
ON A CONJECTURE ABOUT PARIKH MATRICES
4
(2) We denote by w → w′ iff w = xbαyαbz and w′ = xαbybαz for some x, y, z ∈ Σ∗ and α ∈ {a, c} such that m = ∣y∣α . −m (3) We denote by w → w′ iff w = xαbybαz and w′ = xbαyαbz for some x, y, z ∈ Σ∗ and α ∈ {a, c} such that m = ∣y∣α . m
−1
0
1
Example 3.3. abcbaaccb → bacabaccb → bacabcacb → bacacbabc. Definition 3.4. Suppose w, w′ ∈ Σ∗ . We say that w and w′ are almost elementarily matrix equivalent (or MAE-equivalent), denoted w ≡MAE w′ , iff there m1 m2 m3 mn exist w0 , w1 , . . . , wn ∈ Σ∗ such that w = w0 → w1 → w2 → ⋯ → wn = w′ and n ∑i=1 mi = 0. Theorem 3.5. [12] Suppose w, w′ ∈ Σ∗ . Then w ≡M w′ if and only if w ≡MAE w′ . The proof of the forward direction actually exhibits that for every w, w′ ∈ Σ∗ that are “almost M -equivalent” (meaning that all except the top right corner of ΨΣ (w) and ΨΣ (w′ ) are equal), there exist w0 , w1 , . . . , wn ∈ Σ∗ such that m3 m2 m1 mn w = w0 → w1 → w2 → ⋯ → wn . If w ≡M w′ (and so ∣w∣abc = ∣w′ ∣abc ), then n ∑i=1 mi = 0 and thus w ≡MAE w′ . Therefore, we observe that Theorem 3.5 can be generalized to the following theorem with essentially the same proof. ⎛0 0 ⎜0 0 Theorem 3.6. Suppose w, w′ ∈ Σ∗ . Then ΨΣ (w′ ) − ΨΣ (w) = ⎜ ⎜0 0 ⎝0 0 some integer t if and only if there exist w0 , w1 , . . . , wn ∈ Σ∗ such that m3 m2 mn w1 → w2 → ⋯ → wn = w′ and ∑ni=1 mi = t.
0 t⎞ 0 0⎟ ⎟ for 0 0⎟ 0 0⎠ m1 w = w0 →
Based on Salomaa’s characterization, we have proposed in [3] a natural wider class of rewriting rules for the ternary alphabet. These rules preserve M -equivalence due to the following result (originally stated in a different form). Theorem 3.7. Suppose w, w′ ∈ Σ∗ and t ≥ 1. Suppose w contains t factors1 of the form αk bxk bαk for 1 ≤ k ≤ t′ βk = { bαk xk αk b for t′ + 1 ≤ k ≤ t such that the following holds: (1) xk ∈ Σ∗ and αk ∈ {a, c} for each 1 ≤ k ≤ t; (2) αm b, bαm , αn b, and bαn all occur in non-overlapping positions in w whenever m ≠ n; ′ (3) ∑tk=1 ∣xk ∣αk = ∑tk=t′ +1 ∣xk ∣αk . If w′ is obtained from w by (simultaneously) rewriting every βk into βk′ , where βk′ = { then w ≡M w′ . 1Here,
bαk xk αk b αk bxk bαk
for 1 ≤ k ≤ t′ for t′ + 1 ≤ k ≤ t,
distinct occurrences of a word as a factor are considered as distinct factors.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
ON A CONJECTURE ABOUT PARIKH MATRICES
5
Proof. Suppose w = w0 → w1 → w2 → ⋯ → wt = w′ , where each wk is obtained from w by (simultaneously) rewriting every βi into βi′ for 1 ≤ i ≤ k. Suppose β˜k is the factor in wk−1 occupying the same positions as those occupied by βk in w. Note that αk b˜ xk bαk for 1 ≤ k ≤ t′ β˜k = { bαk x˜k αk b for t′ + 1 ≤ k ≤ t m1
m2
m3
mt
for some x˜k ∈ Σ∗ such that Ψ(˜ xk ) = Ψ(xk ). Let bαk x˜k αk b β˜k′ = { αk b˜ xk bαk
for 1 ≤ k ≤ t′ for t′ + 1 ≤ k ≤ t.
Then wk is obtained from wk−1 by rewriting β˜k into β˜k′ . By Lemma 3.1, ∣wk ∣abc = ∣wk−1 ∣abc −∣˜ xk ∣α for each 1 ≤ k ≤ t′ and ∣wk ∣abc = ∣wk−1 ∣abc +∣˜ xk ∣α for each t′ +1 ≤ k ≤ t. t t′ ′ xk ∣αk + ∑tk=t′ +1 ∣˜ xk ∣αk . By Thus ∣w ∣abc − ∣w∣abc = ∑k=1 (∣wk ∣abc − ∣wk−1 ∣abc ) = − ∑k=1 ∣˜ ′ hypothesis (3), it follows that ∣w ∣abc = ∣w∣abc . Definition 3.8. Suppose w, w′ ∈ Σ∗ and t ≥ 1. A transformation from w into w′ is said to be a (2 ⋅ t) transformation, denoted w Ð→ w′ , iff w′ is obtained (2⋅t)
from w according to Theorem 3.7 when the number of factors βk involved is t. If w Ð→ w′ , we may also say that w′ is obtained from w using Rule E2 ⋅ t. (2⋅t)
Remark 3.9. In any (2 ⋅ t) transformation, a total of 2t non-overlapping pairs of characters are being rewritten. However, the associated set of t factors is not unique, as shown by the following example. Example 3.10. abcbabacab Ð→ bacababcba, where β1 = abcba and β2 = bacab. (2⋅2)
However, β1 and β2 can also be chosen as abcbaba and babacab respectively. If w′ is obtained from w using Rule E1, we may denote it by w Ð→ w′ and (1)
call this a (1) transformation. Meanwhile, Rule E2 is the same as Rule E2 ⋅ 1. The following conjecture was proposed in [3]. Conjecture 3.11. Suppose w, w′ ∈ Σ∗ . Then w ≡M w′ if and only if w′ can be obtained from w by finitely many applications of Rule E1 and Rule E2 ⋅ t. −1
Since w = bacabbc → abcbabc → abbcacb = w′ , the words w and w′ are MAE-equivalent and thus M -equivalent but w Ð→ w′ is not a (2 ⋅ 2) transformation. This is not a counterexample to the conjecture because 1
w = bacabbc Ð→ baacbbc Ð→ baabccb Ð→ abbaccb Ð→ abbcacb = w′ . (1)
(2⋅1)
(2⋅1)
(1)
−1
1
However, the conjecture is false. Consider w = abcbaacab → bacabacab → bacaabcba = w′ . Note that any word that can be obtained from w using Rule E1 is among abcbcaaab, abcbacaab, abcbaacab, and abcbaaacb. It can be verified that no Rule E2 ⋅ t can be applied to any of those words. Therefore, w ≡M w′ but w′ cannot be obtained from w by finitely many applications of Rule E1 and Rule E2 ⋅ t.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
ON A CONJECTURE ABOUT PARIKH MATRICES
6
4. Irreducible 2 ⋅ t Transformations and Their Characterization The following concept of irreducible (2 ⋅ t) transformation was introduced in [3]. Every (2 ⋅ t) transformation can be decomposed into the irreducible ones. In this section, a characterization of these irreducible transformations will be provided. Definition 4.1. Suppose w, w′ ∈ Σ∗ and w Ð→ w′ . We say that this transfor(2⋅t)
mation is reducible iff there exists w′′ ∈ Σ∗ such that w Ð→ w′′ Ð→ w′ for some (2⋅t1 )
(2⋅t2 )
positive integers t1 , t2 with t1 + t2 = t. Otherwise, we say that it is irreducible. Proposition 4.2. Suppose w, w′ ∈ Σ∗ and w Ð→ w′ . Then there exist w0 , w1 , w2 (2⋅t)
. . . , wn ∈ Σ∗ such that w = w0 Ð→ w1 Ð→ w2 Ð→ ⋯ Ð→ wn = w′ , where (2⋅t1 )
(2⋅t2 )
(2⋅t3 )
(2⋅tn )
wi−1 Ð→ wi is irreducible for each 1 ≤ i ≤ n and ∑ni=1 ti = t. (2⋅ti )
Proof. We argue by induction on t. A (2 ⋅ 1) transformation is irreducible and hence the base step holds. For the inductive step, if w Ð→ w′ is irreducible, we (2⋅t)
are done. Otherwise, w Ð→ w′′ Ð→ w′ for some w′′ ∈ Σ∗ and positive integers (2⋅t1 )
(2⋅t2 )
t1 , t2 with t1 + t2 = t. Applying the induction hypothesis on w Ð→ w′′ and (2⋅t1 )
w′′ Ð→ w′ , the result follows immediately.
(2⋅t2 )
As hinted by Remark 3.9, to characterize the irreducible (2 ⋅ t) transformations, an alternative description of them is needed. Suppose w, w′ ∈ Σ∗ and w Ð→ w′ . Then w′ is obtained by rewriting 2t non(2⋅t)
overlapping occurrences of factors of length two (or simply pairs), each of which is either ab, ba, bc, or cb. For each such occurrence γ, say w = xγy, we associate to it a triplet (p, q, r) defined by ⎧ ⎪ −∣y∣c if γ = ab ⎪ ⎧ ⎧ ⎪ ⎪ ⎪ ⎪ −1 if γ = ab −1 if γ = bc ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ if γ = ba ⎪ ⎪ ⎪∣y∣c p = ⎨1 q = ⎨1 r=⎨ if γ = ba if γ = cb ⎪ ⎪ ⎪ −∣x∣a if γ = bc ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ if γ = bc, cb, if γ = ab, ba, ⎪ ⎩0 ⎩0 ⎪ ⎪ if γ = cb. ⎩∣x∣a The first (respectively second and third) coordinate accounts for the change in the number of occurrences of ab (respectively bc and abc) as a subword when the two characters of γ in w is swapped. Concisely, the same triplet can be defined by p = (1 − ∣γ∣c )(∣γ∣ba − ∣γ∣ab ),
q = (1 − ∣γ∣a )(∣γ∣cb − ∣γ∣bc ),
r={
p∣y∣c q∣x∣a
if ∣γ∣a = 1 otherwise.
Enumerating the 2t occurrences of pairs being rewritten from left to right, each (2 ⋅ t) transformation thus induces a sequence of 2t triplets. Example 4.3. Consider w = abacbbabcbaccab Ð→ baabcabcbabccba = w′ . The (2⋅3)
induced triplets are (−1, 0, −4), (0, 1, 2), (1, 0, 3), (0, −1, −3), (1, 0, 2), (−1, 0, 0),
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
ON A CONJECTURE ABOUT PARIKH MATRICES
7
corresponding to the highlighted occurrences ab, cb, ba, bc, ba, ab in w from left to right. Remark 4.4. Suppose w, w′ ∈ Σ∗ and w Ð→ w′ . Let (pi , qi , ri ), 1 ≤ i ≤ 2t (2⋅t)
be the induced triplets. Obviously, w′ Ð→ w and the induced triplets are (2⋅t)
(−pi , −qi , −ri ), 1 ≤ i ≤ 2t.
Remark 4.5. The set of induced triplets does not uniquely identify a (2⋅t) transformation. For example, (1, 0, 4), (0, −1, −1), (−1, 0, −3), (−1, 0, −3), (0, 1, 3), (1, 0, 0) are the induced triplets of each of the following transformations: babcababcbccba Ð→ abcbbababcccab, (2⋅3)
babcababccbcba Ð→ abcbbabacbccab, (2⋅3)
babcababcccbba Ð→ abcbbabaccbcab. (2⋅3)
Meanwhile, it can be verified that no transformation w Ð→ w′ with ∣w∣ < 14 (2⋅3)
shares the same induced triplets. Theorem 4.6. Suppose w ∈ Σ∗ and t is a positive integer. Let γi , 1 ≤ i ≤ 2t, where γi ∈ {ab, ba, bc, cb}, enumerate some non-overlapping occurrences of those pairs in w from left to right. Let (pi , qi , ri ), 1 ≤ i ≤ 2t be the induced triplets. If w′ is obtained from w by swapping the two characters of every γi , for 1 ≤ i ≤ 2t, then ′
2t
2t
2t
i=1
i=1
i=1
w Ð→ w if and only if ∑ pi = ∑ qi = ∑ ri = 0. (2⋅t)
Proof. First, we prove the forward direction. Since the 2t pairs being rewritten are non-overlapping, from the definition of the triplets, it can be verified that 2t 2t ′ ′ ∣w′ ∣ab = ∣w∣ab + ∑2t i=1 pi , ∣w ∣bc = ∣w∣bc + ∑i=1 qi , and ∣w ∣abc = ∣w∣abc + ∑i=1 ri . By 2t Theorem 3.7, w ≡M w′ . Hence, ∣w∣ab = ∣w′ ∣ab , forcing that ∑i=1 pi = 0. Similarly, 2t 2t ∑i=1 qi = ∑i=1 ri = 0. Conversely, let I = {1, 2, . . . , 2t} and assume ∑i∈I pi = ∑i∈I qi = ∑i∈I ri = 0. Since ∑i∈I pi = 0, it follows that ∣{ i ∈ I ∣ γi = ab }∣ = ∣{ i ∈ I ∣ γi = ba }∣. Similarly, since ∑i∈I qi = 0, it follows that ∣{ i ∈ I ∣ γi = bc }∣ = ∣{ i ∈ I ∣ γi = cb }∣. Make arbitrary one-one pairings between elements of { i ∈ I ∣ γi = ab } and { i ∈ I ∣ γi = ba } and between elements of { i ∈ I ∣ γi = bc } and { i ∈ I ∣ γi = cb }. Every such pair can be represented by a tuple (i, j), where γi is either ab or cb and γj is either ba or bc. Let P be the collection of those tuples. Note that ∣P ∣ = t. Each such tuple (i, j) induces a factor β(i,j) of w as follows. If i < j, then β(i,j) is the factor of w starting from γi and ends with γj ; it has the form α(i,j) bx(i,j) bα(i,j) for some α(i,j) ∈ {a, c} and x(i,j) ∈ Σ∗ with ∣x(i,j) ∣α(i,j) = −ri − rj . Otherwise, if j < i, then β(i,j) is the factor of w starting from γj and ends with γi ; it has the form bα(i,j) x(i,j) α(i,j) b for some α(i,j) ∈ {a, c} and x(i,j) ∈ Σ∗ with ∣x(i,j) ∣α(i,j) = ri + rj . To have w Ð→ w′ , it remains to show that the t factors (2⋅t)
β(i,j) satisfy hypothesis (3) in Theorem 3.7, and we need ∑(i,j)∈P ∣x(i,j) ∣α(i,j) = i