Pedro V Silva
email: pvsilva@fc.up.pt

Pascal Weil
email: pascal.weil@labri.fr

Automorphic orbits in free groups: words versus subgroups *

Keywords:

We show that the following problems are decidable in a rank 2 free group F 2 : does a given finitely generated subgroup H contain primitive elements? and does H meet the orbit of a given word u under the action of G, the group of automorphisms of F 2 ? Moreover, decidability subsists if we allow H to be a rational subset of F 2 , or alternatively if we restrict G to be a rational subset of the set of invertible substitutions (a.k.a. positive automorphisms). In higher rank, the following weaker problem is decidable: given a finitely generated subgroup H, a word u and an integer k, does H contain the image of u by some k-almost bounded automorphism? An automorphism is k-almost bounded if at most one of the letters has an image of length greater than k.

Orbit problems in general concern the orbit of an element u or a subgroup H of a group F , under the action of a subset G of Aut F . Conjugacy problems are a special instance of such problems, where G consists of the inner automorphisms of F . In this paper, we restrict our attention to the case where F is the free group F A with finite basis A.

In this context, orbit problems were maybe first considered by Whitehead [START_REF] Whitehead | On equivalent sets of elements in a free group[END_REF], who proved that membership in the orbit of u under the action of Aut F A is decidable. The analogous result regarding the orbit of a finitely generated subgroup H was established by Gersten [START_REF] Gersten | On Whitehead's algorithm[END_REF]. Much literature has been devoted as well to the case where G = ϕ is a cyclic subgroup of Aut F A , e.g. Myasnikov and Shpilrain's work [START_REF] Miasnikov | Algebraic extensions in free groups[END_REF] on finite orbits of the form ϕ • u and Brinkmann's recent proof [START_REF] Brinkmann | Detecting automorphic orbits in free groups[END_REF] of the decidability of membership in ϕ • u.

The orbit problems considered in this paper are of the following form: given an element u ∈ F A , a finitely generated subgroup H of F A and a subset G of Aut F A , does H meet the orbit of u under the action of G; that is: does H contain ϕ(u) for some automorphism ϕ ∈ G? A particular instance of this problem, when G = Aut F A , is the question whether H contains a primitive element, since the set of primitive elements of F A is the automorphic orbit of each letter a ∈ A. The latter problem was recently solved by Clifford and Goldstein in full generality [START_REF] Clifford | Subgroups of free groups and primitive elements[END_REF]. These problems were posed to the second author by O. Bogopolski, and they appear as Problem F39 in the list of open problems on grouptheory.info.

Our main results state that these problems are decidable in the rank 2 free group F 2 , if G = Aut F 2 (Theorem 2.3) or if G belongs to a certain family of rational subsets of Aut F 2 , which includes the rational subsets of invertible substitutions (a.k.a. positive automorphisms, which map each letter to a positive word) or of inverses of invertible substitutions, see Sections 5.1 and 5.2. For these rational values of G, we also show the decidability of subgroup orbit problems: given two finitely generated subgroups H, K of F 2 , does there exist µ ∈ G such that K is contained in (resp. equal to) µ(H).

In free groups with larger rank, we are only able to decide a weaker problem. Say that an automorphism ϕ of F A is k-almost bounded if |ϕ(a)| > k for at most one letter a ∈ A. We show that given k > 0, u ∈ F A and H a finitely generated subgroup of F A , one can decide whether there exists a k-almost bounded automorphism µ such that µ(u) ∈ H. Some of our results hold also if we replace the subgroup H by a rational subset of F A .

We use two main methods. Some of our main results can be derived from general results on the decidability of the solvability of equations with rational constraints in free groups (Diekert, Gutiérrez and Hagenah [START_REF] Diekert | The existential theory of equations with rational constraints in free groups is PSPACE-complete[END_REF], building on Makanin's famous result [START_REF] Makanin | Equations in a free group (Russian)[END_REF]). This is an interesting application of equations in free groups.

For other results, we give a direct combinatorial proof. We use a particular factorization of the automorphism group Aut F 2 (Theorem 3.4) and a detailed combinatorial analysis of the effect of certain simple automorphisms on the graphical representation of the subgroup H (the representation by means of so-called Stallings foldings [START_REF] Stallings | Topology of finite graphs[END_REF][START_REF] Kapovich | Stallings foldings and subgroups of free groups[END_REF], see Section 1.2). The set of these automorphisms is Σ = {ϕ a,ba , ϕ b -1 ,a -1 , ϕ b,a } (ϕ x,y maps generator a to x and generator b to y).

This combinatorial analysis leads to the definition of a (large but finite) automaton whose vertices are finite automata associated with the Stallings automata of the subgroups in the Σ * -orbit of H. The construction of this automaton exploits the fact that a certain combinatorial parameter of Stallings automata (which we call the number of singularities) is preserved under the action of automorphisms in Σ. And it is the possibility of reading these actions on this finite automaton which yields our decidability results for the cases where G is a rational subset of Σ * . Invertible substitutions form a particular rational submonoid of Σ * .

Interesting intermediary results state that the set of primitive elements in F 2 is a context-sensitive language (Proposition 3.8) and that if |A| = m and v 1 , . . . , v m-1 ∈ F A , then the set of elements x such that v 1 , . . . , v m-1 , x form a basis of F A is a constructible rational set (Proposition 2.11).

Preliminaries 1.Free groups

Let A denote a finite alphabet. The free monoid on A, written A * , is the set of all finite sequences of elements of A (including the empty sequence, written 1), under the operation of concatenation. We also write A + for the set of non-empty sequences of elements of A.

Let A -1 be a disjoint set of formal inverses of A and let à = A ∪ A -1 . The operation u → u -1 is extended to à * as usual, by letting (a -1 ) -1 = a and (ua) -1 = a -1 u -1 for all a ∈ A and u ∈ à * .

The free group on A is the quotient F A of à * by the congruence generated by the pairs (aa -1 , 1), a ∈ Ã, and we write π : à * → F A for the canonical projection. A word u ∈ à * is reduced if it does not contain a factor aa -1 (a ∈ Ã) and we denote by R A the set of reduced words. We also say that u ∈ R A is cyclically reduced if uu is reduced as well. And we denote by cc(u) the cyclic core of u, that is, the unique word such that u is of the form

u = v -1 cc(u)v in à * .
We write u → ū the reduction map, where ū is the (uniquely defined) word obtained from u by iteratively deleting factors of the form aa -1 (a ∈ Ã) until none is left. It is well-known that the reduction map is well defined, and that the restriction π : R A → F A is a bijection. To simplify notation, if g ∈ F A , we also write ḡ for the reduced word such that π(ḡ) = g, and we let the length of g be |g| = |ḡ|.

Given X ⊆ F A , we denote by X the subgroup of F A generated by X. We also let Aut F A denote the automorphism group of F A . If ϕ ∈ Aut F A and no confusion arises, we shall denote also by ϕ the corresponding bijection of

R A . Given B ⊆ F A , we say that B is a basis of F A if the homomorphism from F B to F A induced by the inclusion map B → F A is an isomorphism. Equivalently, B is a basis of F A if and only if B = ϕ(A) for some ϕ ∈ Aut F A .
The primitive elements of F A are those that sit in some basis of F A . It follows that the set of primitive elements of F A is the orbit of each letter a ∈ A under the action of Aut F A .

In much of this paper, we shall be discussing the free group on 2 generators. We fix the alphabet A 2 = {a, b} and use the notation

F 2 = F A 2 , R 2 = R A 2 .

Automata and rational subsets

The product of two subsets K, L of a monoid M is the subset KL = {xy | x ∈ K, y ∈ L}. The star operator on subsets is defined by L * = n≥0 L n , where L 0 = {1}. A subset L of a monoid is said to be rational if L can be obtained from finite subsets using finitely many times the operators union, product and star. We denote by Rat M the set of rational subsets of M . If M is the free monoid A * on a finite alphabet A, subsets of A * are called languages, and elements of Rat A * are called rational languages.

Note that if ϕ : A * → M is an onto morphism, then Rat M is the set of all ϕ(L) where L ∈ Rat A * . For instance, every finitely generated subgroup of F A is rational.

It is well-known that rational languages can be characterized by means of finite automata. A (finite) A-automaton is a tuple A = (Q, q 0 , T, E) where

Q is a (finite) set, q 0 ∈ Q, T ⊆ Q and E ⊆ Q × A × Q.
It can be viewed as a graph with vertex set Q (the states), with a designated vertex q 0 (the initial state) and a set of designated vertices T (the terminal states), whose edges are labeled by letters in A, and are given by the set E (the transitions).

A nontrivial path in A is a sequence

p 0 a 1 -→p 1 a 2 -→ . . . an -→p n with n ≥ 1, (p i-1 , a i , p i ) ∈ E for i = 1, . . . , n.
Its label is the word a 1 . . . a n ∈ A + . We consider also the trivial path p 0 1 -→p 0 for each p 0 ∈ Q, whose label is the empty word. A path is said to be successful if p 0 = q 0 and p n ∈ T . The language L(A) recognized by A is the set of all labels of successful paths in A.

The automaton A = (Q, q 0 , T, E) is said to be deterministic if, for all p ∈ Q and a ∈ A, there is at most one edge of the form (p, a, q). In that case, we write q = p • a. We say that A is trim if every q ∈ Q lies in some successful path.

Kleene's theorem states that a language is rational if and only if it is accepted by a finite automaton, which can be required to be deterministic and trim, see [START_REF] Hopcroft | Introduction to Automata Theory, Languages and Computation[END_REF]. In the context of a particular result or claim, we say that a rational language L is effectively constructible if there exists an algorithm to produce a finite automaton recognizing L from the concrete structures containing the input. More generally, if ϕ : A * → M is an onto morphism, we say that a rational subset of M is effectively constructible (with respect to A) if it is the image of an effectively constructible rational language over A.

Remark 1.1 A subset L ⊆ F A is rational if L = π(K) for some rational subset K of à * . Benois' theorem [START_REF] Benois | Parties rationnelles du groupe libre[END_REF] states that this is the case if and only if K (= π -1 (π(K)) ∩ R A , in bijection with L via π) is a rational subset of à * . In the sequel we sometimes confuse the notions of a rational subset of F A and a rational language in à * that consists only of reduced words.

Automata and subgroups of F A

To discuss subgroups of free groups, we use inverse automata. In an Ãautomaton A = (Q, q 0 , T, E), the dual of an edge (p, a, q) ∈ E is (q, a -1 , p).

Then A is said to be dual if E contains the duals of all edges, and inverse if it is dual, deterministic, trim (equivalent to connected in this case) and

|T | = 1.
Given a finitely generated subgroup H of F A (we write H ≤ fg F A ), we denote by A(H) the Stallings automaton associated to H by the construction often referred to as Stallings foldings. This construction, that can be traced

q p a @ @ Ð Ð Ð Ð Ð Ð Ð a / / r p a / / q ∼ r
Figure 1: A folding step, with a ∈ Ã back to the early part of the twentieth century [START_REF] Rotman | An introduction to the theory of groups[END_REF]Chapter 11], was made explicit by Serre [START_REF] Serre | Arbres, amalgames[END_REF] and Stallings [START_REF] Stallings | Topology of finite graphs[END_REF] (see also [START_REF] Kapovich | Stallings foldings and subgroups of free groups[END_REF]). A brief description is as follows. If h 1 , . . . , h r ∈ R A is a set of generators of the subgroup H (that is, H = π(h 1 ), . . . , π(h r ) ), one constructs a dual automaton in the form of r subdivided circles around a common distinguished vertex 1 (both initial and terminal), each labeled by one of the h i . Then we iteratively identify identically labeled pairs of edges starting (resp. ending) at the same vertex (this is called the folding process, see Figure 1), until no further folding is possible.

The following proposition summarizes important properties, see [START_REF] Kapovich | Stallings foldings and subgroups of free groups[END_REF]. (iv) for every cyclically reduced u ∈ F A , wuw -1 ∈ H for some w ∈ F A if and only if u labels some loop in A(H).

Proposition 1.2 Let H ≤ fg F A . Then: (i) A(H)

The mixed orbit problem as an equation problem

Our original motivation on writing this paper was solving the mixed orbit problem ϕ(u) ∈ H for given u ∈ F and H ≤ fg F . We managed to solve it in rank 2, see Section 2.1 below. We also solve it in arbitrary rank, if we impose a restriction on the class of automorphisms, see Section 2.2 below. Our initial proof in rank 2 was purely combinatorial, and is presented in Section 5.3 below, whereas our result in higher ranks made use of a result of Diekert, Gutiérrez and Hagenah [START_REF] Diekert | The existential theory of equations with rational constraints in free groups is PSPACE-complete[END_REF] on equations with rational constraints which we will discuss below. Upon reading a first version of this paper1 , Dahmani and Girardel, and independently Enric Ventura (recalling a foregone conversation with Alexei Miasnikov), called our attention to the fact that Diekert, Gutiérrez and Hagenah's result could also be used to prove our result in rank 2.

Equations with rational constraints and automorphisms of F 2

A system of equations in a free group F A , with set of unknowns X (disjoint from A), is a tuple E = (e 1 , . . . , e k ) of elements of F A∪X . A solution of E is a morphism from F A∪X to F A which maps each letter of A to itself and every element of E to 1.

A rational constraint on a system of equations with unknowns in X is a collection L = (L x ) x∈X of rational subsets of F A and we say that a morphism ϕ : F A∪X → F A is a solution of the system E with rational constraints L if ϕ is a solution of E and ϕ(x) ∈ L x for each x ∈ X. Diekert, Gutiérrez and Hagenah [START_REF] Diekert | The existential theory of equations with rational constraints in free groups is PSPACE-complete[END_REF] showed the following result.

Theorem 2.1 The satisfiability problem for systems of equations with rational constraints in a free group is decidable.

This leads to a quick solution of the mixed orbit problem in F 2 .

Theorem 2.2 Given u ∈ F 2 and a rational subset L of F 2 , it is decidable whether or not ϕ(u) ∈ L for some ϕ ∈ Aut F 2 .

Proof. By a result attributed to Dehn, Magnus and Nielsen (see [START_REF] Shpilrain | Recognizing automorphisms of the free groups[END_REF]), {x, y} is a basis of F 2 if and only if there exists some g ∈ F 2 such that g

-1 [x, y]g = [a, b] ±1 .
Now observe that if u ∈ F 2 , then ϕ(u) ∈ H for some ϕ ∈ Aut F 2 if and only if u(x, y) ∈ H for some basis {x, y} -where u(x, y) denotes the word u in which each occurrence of a has been replaced by x and each occurrence of b by y.

Thus there exists an automorphism ϕ such that ϕ(u) ∈ H if and only if one of the following systems (in the unknowns x, y, v, g, and for ε = ±1) admits a solution

g -1 [x, y]g = [a, b] ε u(x, y) = v
with the rational constraint that v ∈ L. This is decidable by Theorem 2.1.

Since a finitely generated subgroup is rational (it is the star of its generators and their inverses), Theorem 2.2 yields the following corollary.

Corollary 2.3 Given u ∈ F 2 and H ≤ fg F 2 , it is decidable whether or not ϕ(u) ∈ H for some ϕ ∈ Aut F 2 .
Since the primitive elements of F 2 are the orbit of each letter a ∈ A under Aut F 2 , we also note the following result.

Corollary 2.4 Given a rational subset L of F 2 (e.g. a finitely generated subgroup), it is decidable whether or not L contains a primitive element.

Remark 2.5 Clifford and Goldstein also proved a comparable result for primitive elements, by completely different methods: they show that it is decidable whether a finitely generated subgroup H of F A (for any finite alphabet A) contains a primitive element [START_REF] Clifford | Subgroups of free groups and primitive elements[END_REF].

One can also consider, in the statement of Theorem 2.2, the rational subset of positive elements of F 2 (namely, the submonoid A * ). Then our result shows that it is decidable whether an element u ∈ F 2 is potentially positive, that is, whether it has a positive automorphic image. Different proofs of this result already appear in Goldstein [START_REF] Goldstein | An algorithm for potentially positive words in F 2 , In Combinatorial group theory, discrete groups, and number theory[END_REF] and Lee [START_REF] Lee | On several problems about automorphisms of the free group of rank two[END_REF].

Another idea is to consider a tuple of elements of F 2 rather than a single element u, or equivalently a subgroup K ≤ fg F 2 .

Theorem 2.6 Let u 1 , . . . , u k ∈ F 2 , L 1 , . . . , L k ∈ Rat F 2 and H, K ≤ fg F 2 .
The following problems are decidable:

(1) whether ϕ(u 1 ) ∈ L 1 , . . . , ϕ(u k ) ∈ L k , for some ϕ ∈ Aut F 2 ;

(2) whether conjugates of ϕ(u 1 ), . . . , ϕ(u k ) sit in L 1 , . . . , L k , respectively, for some ϕ ∈ Aut F 2 ;

(3) whether ϕ(K) ⊆ H, for some ϕ ∈ Aut F 2 .

Proof. These statements are proved like Theorem 2.2, by reduction to a system of equations with rational constraints.

For (1), we consider the system

       g -1 [x, y]g = [a, b] ε u 1 (x, y) = v 1 . . . u k (x, y) = v k in the unknowns x, y, g, v 1 , . . . , v k with the rational constraints v 1 ∈ L 1 , . . . , v k ∈ L k .
For (2), we consider the system

       g -1 [x, y]g = [a, b] ε h -1 1 u 1 (x, y)h 1 = v 1 . . . h -1 k u k (x, y)h k = v k in the unknowns x, y, g, h 1 , . . . , h k , v 1 , . . . , v k with the rational constraints v 1 ∈ L 1 , . . . , v k ∈ L k . Statement (3) is a particular case of (1), when u 1 , . . . , u k is a generating set of K and L 1 = . . . = L k = H.
Remark 2.7 Instead of asking whether there exists an automorphism in Aut F 2 mapping u into L, one may want to exhibit such an automorphism, if it exists.

The existence question reduces to the satisfiability of equations with rational constraints, and Diekert, Gutiérrez and Hagenah showed that this can be done in PSPACE [START_REF] Diekert | The existential theory of equations with rational constraints in free groups is PSPACE-complete[END_REF]. One can extract from that paper a description of such a solution (an automorphism) as an exponential length product of simple automorphisms: the images of the letters may therefore have double exponential length.

Beyond rank 2

We do not know how to extend Theorem 2.2 or Corollary 2.3 to arbitrary finite alphabets, but we can get decidability for weakened versions of the problem. The first such result involves a restriction on the subgroups considered.

Theorem 2.8 Let u ∈ F A and let H ≤ fg F A . If H is cyclic or a free factor of F A , it is decidable whether or not ϕ(u) ∈ H for some ϕ ∈ Aut F A .
Proof. Let us first assume that H is a free factor of F A , with rank k. It is easily verified that ϕ(u) ∈ H for some automorphism ϕ if and only if u sits in some rank k free factor of F A . This is known to be decidable: it suffices to compute a minimum length element v in the automorphic orbit of u (the so-called easy part of Whitehead's algorithm, see [START_REF] Lyndon | Combinatorial Group Theory[END_REF][START_REF] Roig | On the complexity of the Whitehead minimization problem[END_REF]) and to verify whether v uses at least k letters (Shenitzer [START_REF] Shenitzer | Decomposition of a group with a single defining relation into a free product[END_REF], see also [START_REF] Lyndon | Combinatorial Group Theory[END_REF]Prop. I.5.4]).

Let us now assume that H = v . Without loss of generality, we may assume that u and v are cyclically reduced. Say that a word x is root-free if it is not equal to a non-trivial power of a shorter word. Then u = x k for some uniquely determined integer k ≥ 1 and root-free word x, and similarly, v = y ℓ for some uniquely determined ℓ ≥ 1 and root-free y. It is an elementary verification that the image of a root-free word by an automorphism is also root-free. Thus, an automorphism maps u into H if and only if it maps x to y or y -1 , and k is a multiple of ℓ. Decidability follows from the fact that we can decide whether two given words are in each other's automorphic orbit, using Whitehead's algorithm [START_REF] Lyndon | Combinatorial Group Theory[END_REF].

The second result on a weakened version of our orbit problem involves almost bounded automorphisms. Given a finite alphabet A and k ∈ N, we say that an automorphism ϕ of

F A is k-almost bounded if |ϕ(a)| > k for at most one letter a ∈ A. We let AlmB k F A denote the set of k-almost bounded automorphisms of F A . Theorem 2.9 Given u ∈ F A , L ∈ Rat F A and k ∈ N, it is decidable whether or not ϕ(u) ∈ L for some ϕ ∈ AlmB k F A .
The proof of this theorem relies on Diekert, Gutiérrez and Hagenah's result on the satisfiability of equations with rational constraints in free groups discussed in Section 2.1. We also require two technical results.

Lemma 2.10 Let

A = {a 1 , . . . , a m } and u ∈ R A . Then {a 1 , . . . , a m-1 , u} is a basis of F A if and only if u = va ε m w for some v, w ∈ R {a 1 ,...,a m-1 } and ε ∈ {1, -1}. Proof. It is immediate that if u = va ε m w with v, w ∈ R {a 1 ,.
..,a m-1 } , then {a 1 , ..., a m-1 , u} generates F A , and by the Hopfian property of free groups (see [13,

Prop. I.3.5]), {a 1 , ..., a m-1 , u} is a basis of F A .
Conversely, let u ∈ R A contain at least an occurrence of a m or a -1 m , and let u = vzw be the factorization with v, w ∈ R {a 1 ,...,a m-1 } of maximal length. It is immediate that if H = a 1 , ..., a m-1 , u , then H = a 1 , ..., a m-1 , z and A(H) is equal to A( z ) with loops labelled a 1 , ..., a m-1 attached at the origin. Thus, if {a 1 , ..., a m-1 , u} is a basis of F A , then A( z ) must consist of a single loop labeled a m , and hence z must be equal to a m or a -1 m .

This leads to the following generalization.

Proposition 2.11 Let m = |A| and v 1 , . . . , v m-1 ∈ R A . Then X = {x ∈ R A | (v 1 , . . . , v m-1 , x) is a basis of F A }
is rational and effectively constructible.

Proof. First note that X is nonempty if and only if (v 1 , ..., v m-1 ) is a basis of a free factor of F A . This is well-known to be decidable. Moreover, if X = ∅, then we can effectively construct an element z of X: it is verified in [START_REF] Silva | On an algorithm to decide whether a free group is a free factor of another[END_REF] that if K = v 1 , ..., v m-1 , then K is a free factor of F A if and only if there are vertices p and q of A(K) whose identification leads (via foldings) to the bouquet of circles A(F A ), and in that case, if u p and u q are the labels of geodesic paths of A(K) from the origin to p and q, then z

= u p u -1 q ∈ X. Let ϕ ∈ Aut F A be defined by ϕ(a i ) = v i (i = 1, . . . , m -1) and ϕ(a m ) = z. Then x ∈ X if and only if (a 1 , . . . , a m-1 , ϕ -1 (x)) is a basis of F A . By Lemma 2.10, this is equivalent to say that ϕ -1 (x) ∈ R(a m ∪ a -1 m )R
, where R = a 1 , . . . , a m-1 , and therefore

X = ϕ(R(a m ∪ a -1 m )R) = V (z ∪ z -1 )V for V = v 1 , . . . , v m-1 .
In particular, X is rational and the formula X = V (z ∪ z -1 )V provides an effective construction for it.

Proof of Theorem 2.9. Write A = {a 1 , . . . , a m }. Without loss of generality, we may restrict ourselves to the case |ϕ(a i )| ≤ k for i = 1, . . . , m -1. Since there are only finitely many choices for these ϕ(a i ), we may as well assume them to be fixed, say ϕ(a

i ) = v i for i = 1, . . . , m -1. Let then X = {x ∈ R A | (v 1 , . . . , v m-1 , x) is a basis of F A }: then X is rational by Proposition 2.11. Write u = u 0 a ε 1 m u 1 . . . a εn m u n with n ≥ 0, u i ∈ F {a 1 ,.
..,a m-1 } and ε i = ±1 for every i. Then we must decide whether there exists some y ∈ X such that

u ′ 0 y ε 1 u ′ 1 . . . y εn u ′ n ∈ L, where u ′ i = u i (v 1 , . . . , v m-1
) is the word obtained from u i by replacing each a j by v j . This is equivalent to deciding whether the equation

u ′ 0 y ε 1 u ′ 1 . . . y εn u ′ n = z (1)
on the variables y, z has a solution in F A with the rational constraints y ∈ X and z ∈ L. This is decidable by Theorem 2.1.

As in Section 2.1, Theorem 2.9 yields a decidability result for finitely generated subgroups.

Corollary 2.12 Given u ∈ F A , H ≤ fg F A and k ∈ N, it is decidable whether or not ϕ(u) ∈ H for some ϕ ∈ AlmB k F A .
And as in Theorem 2.6, we use the same ideas to prove the following theorem. If w ∈ F 2 , λ w denotes the inner automorphism u → w -1 uw.

Theorem 2.13 Let u 1 , . . . , u m ∈ F A , L ∈ Rat F A , H, K ≤ fg F A and k ∈ N.
The following problems are decidable:

(1) whether ϕ(u 1 ), . . . , ϕ(u m ) ∈ L, for some ϕ ∈ AlmB k F A ;

(2) whether λ w ϕ(u 1 ), . . . , λ w ϕ(u m ) ∈ L, for some w ∈ F A and ϕ ∈ AlmB k F A ;

(3) whether conjugates of ϕ(u 1 ), . . . , ϕ(u m ) sit in L, for some ϕ ∈ AlmB k F A ;

(4) whether ϕ(K) ⊆ H, for some ϕ ∈ AlmB k F A ;

(5) whether λ w ϕ(K) ⊆ H, for some w ∈ F A and ϕ ∈ AlmB k F A .

Proof. These statements are proved like Theorem 2.9, by reduction to a system of equations with rational constraints.

For the first statement, we consider a system of equations of the form of equation ( 1) in the proof of Theorem 2.9, one for which u j , 1 ≤ j ≤ m (the unknowns are y, z 1 , . . . , z m ).

For the second (resp. third) statement, we consider the same system, with each equation conjugated by a new unknown v (resp. by distinct new unknowns v j , 1 ≤ j ≤ m).

The fourth and fifth statements are applications of the first and second when the rational subset L is the subgroup H. Remark 2.14 Following-up with the discussion in Remark 2.7, we note that the complexity upper bounds for the decision problems described in this section are PSPACE again: we need to (attempt to) solve, successively, systems of equations for the different values of v 1 , . . . , v m-1 (with the notation of the proof of Theorem 2.9. These (m -1)-tuples of words of length at most k are exponentially many (in the variable k) but they can be listed in polynomial space.

3 Combinatorial approach: the role of Σ

We now restrict our attention to F 2 . If x, y ∈ F 2 , we denote by ϕ x,y the endomorphism mapping a to x and b to y. In this section, we discuss some properties of the following sets of automorphisms of F 2 :

Σ 0 = ϕ a,ba , ϕ b -1 ,a -1 and Σ = Σ 0 ∪ ϕ b,a ; Φ = ϕ a,ba , ϕ ab,b , ϕ a,ab , ϕ ba,b ; ∆ = ϕ a,a m b ε a n | m, n ∈ Z, ε ∈ {1, -1} ; Ψ = ϕ ∈ Aut F 2 : |ϕ(a)| = |ϕ(b)| = 1 and Λ = λ w | w ∈ R A .
The following will be useful in the sequel.

Proposition 3.1 (i) XΛ = ΛX for every X ⊆ Aut F 2 ; (ii) ΛΨΦ * ⊆ ΛΨ(Σ -1 0 ) * ϕ a -1 ,b ; (iii) ∆ ⊆ Λ(ϕ * a,ba ∪ ϕ a -1 ,b ϕ * a,ba ϕ a -1 ,b )(1 ∪ ϕ a,b -1 ).
Proof. (i) follows from the fact that θλ w = λ θ(w) θ for each w ∈ F 2 and θ ∈ Aut F 2 .

(ii) Notice that ϕ ab,b = ϕ b,a ϕ a,ba ϕ b,a , ϕ a,ab = λ a -1 ϕ a,ba and

ϕ ba,b = λ b -1 ϕ ab,b . It follows that ΛΨΦ * ⊆ ΛΨ{ϕ a,ba , ϕ b,a } * . Observe also that ϕ a,ba = ϕ a -1 ,b ϕ -1 a,ba ϕ a -1 ,b , ϕ b,a = ϕ a -1 ,b ϕ -1 b -1 ,a -1 ϕ a -1 ,b and ϕ 2 a -1 ,b = 1. So we have {ϕ a,ba , ϕ b,a } * = ϕ a -1 ,b {ϕ -1 a,ba , ϕ -1 b -1 ,a -1 } * ϕ a -1 ,b = ϕ a -1 ,b (Σ -1 0 ) * ϕ a -1 ,b . Therefore ΛΨΦ * ⊆ ΛΨϕ a -1 ,b (Σ -1 0 ) * ϕ a -1 ,b = ΛΨ(Σ -1 0 ) * ϕ a -1 ,b .
(iii) Observe that if m, n ∈ Z, then ϕ a,a m ba n = λ a -m ϕ a,ba m+n = λ a -m ϕ m+n a,ba , so that ϕ a,a m ba n ∈ Λ(ϕ * a,ba ∪ (ϕ -1 a,ba ) * ). We already noted that ϕ

-1 a,ba = ϕ a -1 ,b ϕ a,ba ϕ a -1 ,b and ϕ 2 a -1 ,b = 1, so ϕ a,a m ba n ∈ Λ(ϕ * a,ba ∪ ϕ a -1 ,b ϕ * a,ba ϕ a -1 ,b ). Similarly, ϕ a,a m b -1 a n = λ a n ϕ -(m+n) a,ba ϕ a,b -1 and hence ϕ a,a m b -1 a n ∈ Λ(ϕ * a,ba ∪ ϕ a -1 ,b ϕ * a,ba ϕ a -1 ,b )ϕ a,b -1 ,
which concludes the proof.

Primitive words and a factorization of Aut F 2

Let us first consider a particular automorphic orbit in F A , namely the set P A of primitive words. Recall that a word is primitive if it belongs to some basis of F A . In particular, P A is the automorphic orbit of each letter from A. We shall often view P A as a subset of R A . We denote by P 2 the set of all primitive words in F 2 .

We use a known characterization of the words in P 2 to derive a technical factorization of the group Aut F 2 of automorphisms of F 2 , that will be used in Section 5. We further exploit this characterization to point out certain language-theoretic properties of P 2 . Proposition 3.2 reports two results: the first is due to Nielsen [START_REF] Nielsen | Die Isomorphismen der allgemeinen unendlichen Gruppe mit zwei Erzeugenden[END_REF] (see also [5, 2.2] and [START_REF] Osborne | Primitives in the free group on two generators[END_REF]) and the second is due to Wen and Wen [START_REF] Wen | Local isomorphisms of invertible substitutions[END_REF]. An interesting perspective on either is offered in [ We can now prove a useful decomposition result for Aut F 2 .

Theorem 3.4 Aut F 2 = ΛΨΦ * ∆ = Ψ(Σ -1 0 ) * Λϕ * a,ba (ϕ a -1 ,b ∪ ϕ a -1 ,b -1 ).
Proof. To establish the first equality, we consider θ ∈ Aut F 2 . Then θ(a) ∈ P 2 and so θ(a) = σ(a) for some σ ∈ ΛΨΦ * by Corollary 3.3. Corollary 2.10 then shows that σ -1 θ = ϕ a,a m b ε a n for some m, n ∈ Z and ε ∈ {1, -1}. So σ -1 θ ∈ ∆ and θ ∈ ΛΨΦ * ∆. It follows that

Aut F 2 ⊆ ΛΨΦ * (ϕ * a,ba ∪ ϕ a -1 ,b ϕ * a,ba ϕ a -1 ,b )(1 ∪ ϕ a,b -1 ) by Proposition 3.1 ⊆ ΛΨΦ * (1 ∪ ϕ a -1 ,b ϕ * a,ba ϕ a -1 ,b )(1 ∪ ϕ a,b -1 ) since ϕ a,ba ∈ Φ ⊆ ΛΨΦ * (ϕ a -1 ,b ϕ * a,ba ϕ a -1 ,b )(1 ∪ ϕ a,b -1 ) since ϕ 2 a -1 ,b = 1 ⊆ ΛΨ(Σ -1 0 ) * ϕ * a,ba ϕ a -1 ,b (1 ∪ ϕ a,b -1 ) by Proposition 3.1 (ii) ⊆ Ψ(Σ -1 0 ) * Λϕ * a,ba (ϕ a -1 ,b ∪ ϕ a -1 ,b -1 ).
The converse inclusion is of course trivial.

Invertible substitutions

A substitution2 of F A is an endomorphism ϕ such that ϕ(a) ∈ A * for every a ∈ A. If ϕ is an automorphism, it is said to be an invertible substitution.

We denote by IS(F 2 ) the monoid of all invertible substitutions of F 2 , and by IS -1 (F 2 ) the monoid of their inverses. Note that the inverse of an invertible substitution is not necessarily a substitution: indeed ϕ -1 a,ba = ϕ a,ba -1 .

Lemma 3.5 IS(F 2 ) is a rational submonoid of Σ * . Moreover, there exists a rational submonoid

S of Σ * such that IS -1 (F 2 ) = ϕ a,b -1 S ϕ a,b -1 .
In addition, every rational subset R ∈ Rat IS(F 2 ) is also in Rat Σ * , and every rational subset

R ∈ Rat IS -1 (F 2 ) is of the form ϕ a,b -1 R ′ ϕ a,b -1 for some R ′ ∈ Rat S ⊆ Rat Σ * .
Proof. It is known [START_REF] Wen | Local isomorphisms of invertible substitutions[END_REF] that the monoid IS(F 2 ) is generated by ϕ b,a , ϕ a,ba and ϕ a,ab (see also [START_REF] Berstel | Combinatorics on words: Christoffel words and repetitions in words[END_REF]Chapter I.5], [12, Sec. 2.3.5]). But ϕ b,a , ϕ a,ba ∈ Σ and

ϕ a,ab = ϕ b,a ϕ b -1 ,a -1 ϕ a,ba ϕ b -1 ,a -1 ϕ b,a ∈ Σ * , so IS(F 2 ) = {ϕ b,a , ϕ a,ba , ϕ a,ab } * ∈ Rat Σ * .
Next we observe that

ϕ -1 b,a = ϕ b,a = ϕ a,b -1 ϕ b -1 ,a -1 ϕ a,b -1 ϕ -1 a,ba = ϕ a,ba -1 = ϕ a,b -1 ϕ a,ab ϕ a,b -1 ϕ -1 a,ab = ϕ a,a -1 b = ϕ a,b -1 ϕ a,ba ϕ a,b -1 Since ϕ a,b -1 has order 2, it follows that IS(F 2 ) -1 = ϕ a,b -1 Rϕ a,b -1 with R = {ϕ b -1 ,a -1 , ϕ a,ab , ϕ a,ba } * ∈ Rat Σ * .

Primitive words form a context-sensitive language

Digressing from our main topic, we use Corollary 3.3 to establish a languagetheoretic property of primitive words.

Recall that a context-sensitive A-grammar is a triple G = (V, P, S) where V is a finite set containing A, S is an element of V that is not in A and P is the set of rules of the grammar: a finite set of pairs (ℓ, r) ∈ V + × V + such that ℓ ∈ A + and |ℓ| ≤ |r|.

For all x, y ∈ V + , we write x ⇒ y if there exist u, v ∈ V * and (ℓ, r) ∈ P such that x = uℓv and y = urv. We denote by * ⇒ the transitive and reflexive closure of ⇒. The language generated by G is

L(G) = {w ∈ A + | S * ⇒ w}.
A language L ⊆ A + is said to be context-sensitive if it is generated by some context-sensitive A-grammar. As usual, a language

L ⊆ A * is called context-sensitive if L ∩ A + is context-sensitive.
The right and left quotients of a language L by a word u are defined by

u\L = {x ∈ A * | ux ∈ L}, L/u = {x ∈ A * | xu ∈ L}.

Lemma 3.6 The class of context-sensitive languages is closed under union, intersection, concatenation, right and left quotient by a word, 1-free substitutions and inverse morphisms.

Proof. Closure under union, intersection, concatenation, 1-free substitutions, and inverse homomorphisms is well-known [9, Exercise 9.10]. In particular, the family of context-sensitive languages forms a trio [9, Section 11.1] and as such, it is closed under limited erasing [START_REF] Hopcroft | Introduction to Automata Theory, Languages and Computation[END_REF]Lemma 11.2]. By definition, this means that if k ≥ 1, L is context-sensitive and ϕ is a morphism such that ϕ(v) = 1 for each u ∈ L and each factor v of u of length greater than k, then ϕ(L) is context-sensitive as well.

For the quotients, it suffices to consider letters, hence let L ⊆ A * , a ∈ A and $ ∈ A. Let σ be the substitution that maps a to σ(a) = {a, $} and which fixes every other letter of A. Let also ϕ : (A ∪ {$}) * → A * be the morphism which fixes every letter of A and erases $. Then a\L = ϕ(σ(L) ∩ $A * ) and L/a = ϕ(σ(L) ∩ A * $). Since the σ-images of the letters are finite, and hence context-sensitive, the languages σ(L) ∩ $A * and σ(L) ∩ A * $ are contextsensitive; moreover ϕ exhibits limited erasing on these languages, so a\L and L/a are context-sensitive as well.

Proposition 3.7 Let A be a finite alphabet and let Γ be a finite set of endomorphisms of A + . For every u ∈ A + , Γ * (u) is a context-sensitive language.

Proof. Take b / ∈ A. We define a context-sensitive (A ∪ {b})-grammar G = (V, P, S) by V = A ∪ {R, S, T } ∪ {F ϕ | ϕ ∈ Γ} and

P = {S → bF ϕ uR, S → bub 2 , F ϕ a → ϕ(a)F ϕ , F ϕ R → T R, F ϕ R → b 2 , aT → T a, bT → bF ϕ ; a ∈ A, ϕ ∈ Γ }. We show that L(G) = bΓ * (u)b 2 .
Clearly,

F ϕ v * ⇒ ϕ(v)F ϕ for all ϕ ∈ Γ and v ∈ A * and so bvT R * ⇒ bT vR ⇒ bF ϕ vR * ⇒ bϕ(v)F ϕ R ⇒ bϕ(v)T R. Since S ⇒ bF ϕ uR * ⇒ bϕ(u)F ϕ R ⇒ bϕ(u)T R for every ϕ ∈ Γ, it follows that S * ⇒ bθ(u)F ϕ R ⇒ bθ(u)b 2 for every θ ∈ Γ + . Together with S ⇒ bub 2 , this yields bΓ * (u)b 2 ⊆ L(G).
To prove the opposite inclusion, let Proof. Since the class of context-sensitive languages is closed under union (Lemma 3.6), it follows from Proposition 3.2(ii) and Proposition 3.7 that P 2 ∩ {a, b} + = P 2 ∩ {a, b} + is context-sensitive. Moreover, Proposition 3.2(i) shows that P 2 = ΛΨ(P 2 ∩ {a, b} + ) = ΨΛ(P 2 ∩ {a, b} + ). Since Ψ is finite, we need only prove that each ψΛ(P 2 ∩ {a, b} + ), ψ ∈ Ψ, is context-sensitive.

Z = S ∪ bxyb 2 , bxT yR, bϕ(x)F ϕ yR | xy ∈ Γ * (u) . Then Z is closed under ⇒. That is: if X ∈ Z and X ⇒ Y , then Y ∈ Z. Since S ∈ Z, it follows that L(G) ⊆ Z ∩ A * = bΓ * (u)b
Notice that, for each ψ ∈ Ψ and each word w, ψ(w) = ψ(w). By Lemma 3.6 again, we need only to prove that Λ(P 2 ∩ {a, b} + ) is contextsensitive.

Let w ∈ R 2 and p ∈ P 2 ∩ {a, b} + . If wpw -1 is not reduced, then one of wp and pw -1 is not reduced. In the first case, let q be the longest prefix of p such that q -1 is a suffix of w, say p = qr and w = vq -1 . Then wpw -1 = vq -1 qrqv -1 = vrqv -1 . The second case (if wp is reduced but pw -1 is not) is treated similarly. Iterating this reasoning, we find that wpw -1 = vp ′ v -1 , where v is a prefix of w and p ′ is a cyclic shift of the word p -that is, there are words q, r such that p = qr and p ′ = rq.

Since P 2 ∩ {a, b} + is closed under taking cyclic shifts, it follows that Λ(P 2 ∩ {a, b} + ) is the set of reduced words of the form vpv -1 with p ∈ P 2 ∩ {a, b} + .

Thus, if G = (V, P, S) is a context-sensitive A-grammar generating P 2 ∩ {a, b} + , then Λ(P 2 ∩ {a, b}

+ ) = L(G ′ ) ∩ R 2 , where G ′ = (V ′ , P ′ , S ′ ) is the context-sensitive A-grammar given by S ′ ∈ V , V ′ = {S ′ } ∪ V and P ′ = P ∪ {S ′ → S} ∪ {S ′ → cS ′ c -1 ; c ∈ A 2 ∪ A -1 2 }.
In view of the closure properties in Lemma 3.6, Λ(P 2 ∩ {a, b} + ) is context-sensitive, and hence so is P 2 . This result cannot be improved to the next level of Chomsky's hierarchy: Proposition 3.9 P 2 is not a context-free language.

Proof. We show that P 2 ∩ ab + ab + ab + is not a context-free language. Since the class of context-free languages is closed under intersection with rational languages, it shows that P 2 is not context-free either.

It follows easily from Proposition 3.2(i) that P 2 ∩ ab * ab * ab * is equal to

ab m ab n ab k | m, n, k ∈ N, max(m, n, k) = min(m, n, k) + 1 . (2)
It is now a classical exercise to show that P 2 ∩ ab + ab + ab + is not context-free since it fails the Pumping Lemma for context-free languages [9, Section 6.1].

Singularities, bridges and automorphisms in Σ

We now discuss the evolution of the Stallings automaton of a subgroup H under the iterated action of the automorphisms in Σ. It is well-known that the automata A(ϕ(H)) may grow unboundedly as the length of ϕ (as a product of elements of Σ) grows. But in the context of the mixed orbit problem with respect to the automorphisms in Σ * , we are only interested in the possibility of reading a u-labeled loop (where u is a fixed word) in A(ϕ(H)): if the growth of the automata results in long stretches without branchpoints, then this growth does not affect the membership of u in ϕ(H) after a certain point. Indeed, we show that the fragments of the A(ϕ(H)) (ϕ ∈ Σ * ) that could conceivably allow the reading of a u-loop take only finitely many valuesand these fragments (which we call truncated automata) can be organised as the states of an automaton on alphabet Σ. The mixed orbit problem with respect to Σ * then reduces to deciding whether this automaton accepts a non-empty language.

We now get into the technical considerations that give substance to this overview of our method. Given H ≤ fg F 2 , we say that a state q of A(H) is

• a source if q • a, q • b = ∅, a ←-q b -→ • a sink if q • a -1 , q • b -1 = ∅. a -→q b ←-
Note that a source may have incoming edges and a sink may have outgoing edges. We use the general term singularities to refer to both sources and sinks and we denote by Sing(H) the set of all singularities of A(H) plus the origin.

If we emphasize the vertices of Sing(H) in A(H), it is immediate that A(H) can be described as the union of positive paths, i.e. paths with label in (a ∪ b) + , between the vertices of Sing(H), and these positive paths do not intersect each other except at Sing(H). We call such paths bridges. Note that every positive path whose internal states are not singularities can be extended into a uniquely determined bridge.

Bridges in A(H)

The next two results are easily verified. Dealing with ϕ a,ba is naturally a little more complex. However, as we will see in the next two statements, the foldings implied in computing A(ϕ a,ba (H)) are very local: they can be performed in a single round of independent foldings. Moreover, sources in A(ϕ a,ba (H)) were already sources in A(H) and sinks in A(ϕ a,ba (H)) are at distance 1 of sinks in A(H). Proof. Following [18, Subsection 1.2], the automaton A(ϕ(H)) may be obtained from A(H) in three steps:

(1) We replace each edge labelled by b by a path labelled ba (introducing a new intermediate vertex for each such edge), producing a dual automaton B.

(2) We execute the complete folding of B.

(3) We successively remove all the vertices of degree 1 different from the origin.

How much folding is involved in the process? Let us consider the first level of folding, i.e. those pairs of edges that can be immediately identified in B.

• There are no b-edges involved in the first level of folding: indeed, the b-edges keep their origin when we go from A(H) to B, and their target is always a new vertex where folding cannot take place.

• Let C denote the automaton obtained by performing all the instances of first level folding in B. It follows from the above remarks that C can be obtained from A(H) by application of (S1) and (S2).

We actually need no second level of folding because C is already deterministic. Indeed, it is clear from (S1) and (S2) that configurations such as ←in A(H) and q would be a sink, contradicting the application of (S1). Thus C is deterministic and so A(ϕ(H)) is obtained from A(H) by successive application of (S1), (S2) and (S3). (ii) The sources of A(ϕ a,ba (H)) are precisely the sources p of A(H) such that p • a is not a sink or has outgoing edges in A(H).

(iii) The sinks of A(ϕ a,ba (H)) are precisely the states p of A(H) with incoming edges such that p • a is a sink of A(H).

Proof. (i) The origin cannot be trimmed and the number of outgoing edges never decreases, so the only possible candidates to (S3) are the states that see a decrease in their number of incoming edges, which are precisely the sinks of A(H). Their fate will then depend on the previous existence of some outgoing edge. Note that A(H) cannot possess two consecutive sinks with no outgoing edges, hence the trimming of a vertex will not be followed by the trimming of any of its neighbours.

(ii) Since outgoing edges can be at most redirected through (S1) and (S2), it is clear that every source p of A(ϕ a,ba (H)) must be a source of A(H). Thus everything will depend on p • a being trimmed or not, and part (i) yields the claim.

(iii) No new intermediate vertex obtained through (S1) can become a sink, and any sink of A(H) will not remain such after application of (S2). Thus the only remaining candidates are the non-sinks of A(H) that see an increase of their number of incoming edges, which are precisely those of the form q • a -1 , where q is a sink of A(H). Clearly, to have two distinct incoming edges in A(ϕ a,ba (H)), p = q • a -1 must have at least one incoming edge in A(H). In such a case, it is easy to check that after (S1)/(S2), p has indeed become a sink of A(ϕ a,ba (H)). We remark also that the subsequent trimming by (S3) does not affect the presence of singularities. Clearly, if p is the origin, it must remain so. If p is a source, it follows from Fact 4.4 (ii) that p remains a source (since p • a is not a sink in A(H)).

Finally, if p is a sink, it will no longer be a singularity in A(ϕ a,ba (H)) by Fact 4.4 (iii). Therefore p ∈ Sing(ϕ a,ba (H)) if and only if it is a source or the origin in A(H).

Similarly, q can never become the origin or a source. Since q has incoming edges in A(H), it follows from Fact 4.4(iii) that s becomes a sink in A(ϕ a,ba (H)) if and only if s • a is a sink in A(H). Since the unique outgoing edge of s in A(H) has label d, then s ∈ Sing(ϕ a,ba (H)) if and only if d = a and q is a sink in A(H).

Homogeneous cycles and cycle-free paths

Let σ(H) = max(1, source(H) + sink(H)), where source(H) (resp. sink(H)) is the number of sources (resp. sinks) of A(H). We call σ(H) the number of singularities of A(H). Note that a vertex may be a source and a sink, and in that case, it contributes twice to σ(H).

We say that a path p w -→r is homogeneous if w ∈ R a ∪R b , and it is special homogeneous if, in addition, it starts at a source or the origin, and it ends at a sink or the origin. Let hc(A) (resp. hcfp(A), shcfp(A)) be the maximum length of a homogeneous cycle (resp. homogeneous cycle-free path, special homogeneous cycle-free path) in automaton A.

Given H ≤ f.g. We record the following inequalities. -→q is a cycle-free path, say

p = q 0 b -→q 1 b -→ . . . b -→q k = q.
Since any b-edge obtained through (S1) must be followed only by an a-edge (see Fact 4.3), only the last edge q k-1 b -→q k may be obtained through (S1), and the other edges arise from applications of (S2). Thus there exist edges in A(H) (represented through discontinuous lines) of the form

p 1 p 2 p k-2 p k-1 q 0 b > > } } } } b / / q 1 b > > } } } } a O O 1 1 1 b / / q 2 a O O 1 1 1 . . . q n-2 b / / a O O 1 1 1 b ; ; v v v v v q k-1 a O O 1 1 1 b / / q k
In particular, the vertices p 1 , . . . , p k-1 are distinct sinks in A(H), and the vertices q 1 , . . . , q k-1 are distinct sources in A(H). Therefore 2k -2 ≤ σ(H) and hence k ≤ σ(H).

If α is a cycle, then not even the last edge of α arises from an application of (S1), and the same reasoning shows that 2k ≤ σ(H), so k ≤ σ(H). Lemma 4.7 Let H ≤ f.g. F 2 and ϕ ∈ Σ. Then

σ(ϕ(H)) ≤ σ(H), δ 0 (ϕ(H)) ≤ δ 0 (H), ζ(ϕ(H)) ≤ ζ(H).
Proof. The first inequality is a direct consequence of Facts 4.1, 4.2 and 4.4.

By Facts 4.1 and 4.2, the other inequalities are trivial if ϕ = ϕ b,a or ϕ b -1 ,a -1 . We now assume that ϕ = ϕ a,ba . Since σ(ϕ(H)) ≤ σ(H), we only need to show that the maximum length of a homogeneous cycle (resp. cyclefree special homogeneous) path α = p-→q in A(ϕ(H)) (p = q in the case of a cycle) is at most equal to δ 0 (H) (resp. ζ(H)).

If the label of α is b k , then Lemma 4.6 shows that k ≤ σ(H), so k ≤ δ 0 (H) ≤ ζ(H).

Suppose now that the label of α is a k . In view of Fact 4.3, none of its edges was obtained trough (S1): indeed the a-edge in • b -→ • a -→• produced by (S1) cannot occur in a homogeneous cycle, nor in a homogeneous path unless it is its first edge. But its initial vertex is not a singularity, so this edge cannot occur in a special homogeneous path. Hence the path α already existed in A(H). If α is a cycle, then k ≤ δ 0 (H).

If instead α is a special homogeneous cycle-free path, then Fact 4.4 (ii) shows that p is either the origin or a source in A(H). If q is the origin, we immediately get k ≤ ζ(H). If instead q is a sink in A(ϕ(H)), then s = q • a is a sink of A(H) by Fact 4.4 (iii), and we have a path

α ′ = p a k ---→q a --→s
is at distance at most t from a singularity, and hence the size of A t (K) is bounded. Thus X (t, H) is finite.

The proof of Theorem 4.10 provides a straighforward algorithm to compute all its elements. Indeed, all we need is to compute the finite sets

X n (t, H) = {A t (K) | K ∈ Σ n (H)} until reaching X n+1 (t, H) ⊆ n i=0 X i (t, H), (3)
which must occur eventually since

X (t, H) = ∪ i≥0 X i (t, H) is finite. Why does (3) imply X (t, H) = ∪ n i≥0 X i (t, H)? Suppose that B ∈ X m (t, H) \ (∪ n i≥0 X i (t, H)) with m minimal, say B = A t (ϕ(K)) with K ∈ Σ m-1 (H) and ϕ ∈ Σ. By minimality of m, we have A t (K) ∈ ∪ n i≥0 X i (t, H). Thus A t (K) = A t (K ′ ) for some K ′ ∈ ∪ n i=0 Σ i (H). Now Theorem 4.10 yields B = A t (ϕ(K)) = A t (ϕ(K ′ )) ∈ n+1 i=0 X i (t, H) = n i=0 X i (t, H), a contradiction. Therefore X (t, H) = ∪ n i≥0 X i (H) as claimed.
5 Back to orbit problems in F 2

We saw in Section 2 that it is decidable whether a given element u ∈ F 2 has an automorphic image in a given rational subset of F 2 , and in particular in a given finitely generated subgroup of F 2 (Corollary 2.3 above). We use truncated automata to give a different proof of this result in the finitely generated subgroup case. We also prove the decidability of mixed orbit problems under the action of certain rational subsets of Σ * .

Some mixed orbit problems

The archetypal result in this section is the solution of the following mixed orbit problem.

Proposition 5.1 Let u ∈ F 2 an H ≤ fg F 2 . The set of automorphisms ϕ ∈ Σ * such that u ∈ ϕ(H) (resp. a conjugate of u lies in ϕ(H))
, is an effectively constructible rational subset of Σ * .

(2 ′ ) whether a conjugate of K is contained in µ(H) for some µ ∈ R; that is, whether K ⊆ µ(H) for some µ ∈ ΛR;

(3) whether K = µ(H) for some µ ∈ R;

(3 ′ ) whether a conjugate of K is equal to µ(H) for some µ ∈ R; that is, whether K = µ(H) for some µ ∈ ΛR;

(4) whether there exist w 1 , . . . , w k ∈ F 2 such that λ w 1 (u 1 ), . . . , λ w k (u k ) ∈ µ(H) for some µ ∈ R.

In addition, for each of these problems, the set of morphisms µ ∈ Σ * that it defines is rational and effectively constructible.

Proof. The solutions of Problems ( 1) and (1 ′ ) follow from Proposition 5.1: the set X of automorphisms ϕ ∈ Σ * such that ϕ(H) contains u (resp. a conjugate of u) is rational and we can compute a Σ-automaton recognizing that set. Since B t (H) is deterministic and complete, we only have to decide whether X has a non-empty intersection with the given rational set R, a classical decidable result from automata theory. The other proofs follow the same pattern, and correspond to variants of Proposition 5.1. Let us consider Problem (2) and let u 1 , . . . , u k be generators of K. Then we need to consider the Σ-transition system B t (H) with t > max( 12 ζ(H), 1 2 |u 1 |, . . . , 1 2 |u k |), and to choose as terminal states the elements A ∈ X (t, H) such that ū1 , . . . , ūk label loops at the origin in A.

For Problem (2 ′ ), we consider a cyclically reduced conjugate K ′ of K, that is, one such that the origin in A(K ′ ) has degree at least 2 (if the origin in A(K) has degree 1, choose any vertex v with degree at least 2 as the new origin and let K ′ be the corresponding conjugate). Let u 1 , . . . , u k be generators of K ′ . Then a conjugate of K lies in µ(H) if and only if the ūi label loops around the same vertex of A(µ(H)). Thus it suffices to choose t > max( , where u 1 , . . . , u k are generators of K. In particular, t is large enough to have A t (K) = A(K), and we choose a single terminal state, A t (K) (if A t (K) ∈ X (t, H); if that is not the case, then Problem (3) is decidable, in the negative). Then we have an automaton which recognizes the set L(t, K) of all µ ∈ Σ * such that A t (µ(H)) = A t (K) = A(K). Observe now that truncation creates (pairs of) degree 1 vertices: the automorphisms µ ∈ L(t, K) are such that A t (µ(H)) has at most one degree 1 vertex (the origin), and hence A t (µ(H)) = A(µ(H)). Thus our automaton recognizes the set of all µ ∈ Σ * such that A(µ(H)) = A(K), that is, such that µ(H) = K.

For Problem (3 ′ ), we consider a cyclically reduced conjugate K ′ of K and an integer t as in Problem (2 ′ ). Again, we have A t (K ′ ) = A(K ′ ). We choose as terminal states the elements of X (t, H) of the form A t (λ w (K)) (w ∈ F 2 ). These automata are of one of the following types:

A(K ′ ) A(K ′ ) A(K ′ ) form (a) form (b) form (c) x z x
with |x| ≤ t and |z| = t. As in the discussion of Problem (3), the existence of a µ-labeled path in B t (H) from A t (H) to an automaton of type (a) or (b) shows that µ(H) is a conjugate of K ′ , and hence of K. If the path in B t (H) ends in an automaton of type (c), then µ(H) is a conjugate of K ′ of the form zyxwK ′ (zyxw) -1 or z -1 yxwK ′ (z -1 yxw) -1 for some y, w such that zyxw or z -1 yxw is reduced. We then conclude the proof of the decidability of Problem (3 ′ ) as usual. Finally, for Problem (4), we choose t > max( 1 2 ζ(H), 1 2 |cc(u 1 )|, . . . , 1 2 |cc(u k )|) and we choose as terminal states the elements A ∈ X (t, H) such that each cc(u i ) (i = 1, . . . , k) labels a loop at some vertex in A.

We can also consider finitely many subgroups H i in (4) and many other variations.

A simple rewriting of Theorem 5.2 in terms of orbit problems (see the introduction) yields the following corollary.

Corollary 5.3 Let H ≤ fg F 2 , u ∈ F 2 and R ∈ Rat Σ * . Then it is decidable whether the orbit of u under the action of R -1 (resp. ΛR -1 ) meets H.

If in addition K ≤ fg F 2 , then it is decidable whether H contains an element of the orbit of K under the action of R -1 or ΛR -1 ; whether H is contained in an element of the orbit of K under the action of R or ΛR; and whether K is an element of the orbit of H under the action of R, R -1 , ΛR or ΛR -1 .

Applying Corollary 5.3 to the case where u is a letter in A, we get a statement about primitive elements.

Corollary 5.4 Let H ≤ fg F 2 and R ∈ Rat Σ * . Then it is decidable whether H contains a primitive element of the form µ(a), µ -1 ∈ R (resp. µ -1 ∈ ΛR). Remark 5.5 Let S be a subset of R 2 such that, for each rational set S ′ , one can decide whether S ∩ S ′ is empty or not. Then Problems (1 ′ ), (2 ′ ) and (3 ′ ) in Theorem 5.2 are decidable even if we restrict the conjugating factors to be in S, that is, if we replace Λ by {λ s | s ∈ S} in the statement of these problems. The same restriction can be imposed to Λ in the statements of Corollaries 5.3 and 5.4.

Similarly, Problem (4) in Theorem 5.2 remains decidable even if we require the w i to be in fixed subsets S i (i = 1, . . . , k) such that, for each rational set S ′ , one can decide whether S i ∩ S ′ is empty or not.

Orbits under invertible substitutions

Invertible substitutions are an interesting special case of the rational subsets of Aut F 2 discussed in Section 5.1. This leads to the following statement. If R ∈ IS -1 (F 2 ), then R = ϕ a,b -1 R ′ ϕ a,b -1 for some R ′ ∈ Rat Σ * by Lemma 3.5 (R ′ is the set of inverses of the elements of R). Problem (1) in Theorem 5.2 on instance u, H and R, for example, is equivalent to the same problem on instances ϕ a,b -1 (u), ϕ a,b -1 (H) and R ′ , which we know to be decidable. The other problems are handled in the same fashion.

Another solution of the mixed orbit problem for Aut F 2

Our proof relies on truncated automata and Theorem 3.4. The key is to bound the powers of ϕ a,ba that we need to consider, and is achieved in view of our previous bound for the length of homogeneous cycles.

Let u ∈ F 2 and H ≤ f.g. F 2 . We want to show that it is decidable whether µ(u) ∈ H for some µ ∈ Aut F 2 . By Theorem 3.4, and since Ψ -1 = Ψ, it suffices to decide whether there exist w ∈ F 2 and n ≥ 0 such that one of the following conditions hold:

• λ w ϕ n a,ba ϕ a -1 ,b (u) ∈ Σ * 0 Ψ(H);

• λ w ϕ n a,ba ϕ a -1 ,b -1 (u) ∈ Σ * 0 Ψ(H).

Remark 5.7 The a priori complexity of the algorithms discussed in Section 5 is very high: if u has length at most n and A(H) has at most n states, then σ(H), ζ(H) ≤ n and the truncated automata can have exponentially many states. There can therefore be super-exponentially many truncated automata, forming the states of the transition system B t (H) -in which we must solve a reachability problem (polynomial in the number of states of the transition system).

12 ,

 12 Chapter 2] and [2, Chapter I-5]. Proposition 3.2 (i) Up to conjugation, every primitive element u ∈ P 2 is either a letter, or of the form u = a n 1 b m 1 ...a n k b m k where -either n 1 = ... = n k ∈ {1, -1} and {m 1 , ..., m k } ⊆ {n, n + 1} for some integer n, -or m 1 = ... = m k ∈ {1, -1} and {n 1 , ..., n k } ⊆ {n, n + 1} for some integer n. (ii) The set of positive primitive words P 2 ∩{a, b} + is equal to Φ * ({a, b}) = b ∪ Φ * (a). Corollary 3.3 P 2 = ΛΨΦ * (a).Proof. By Proposition 3.2 (i), every primitive element of F 2 is a conjugate of ψ(ab m 1 ...ab m k ), where {m 1 , ..., m k } ⊆ {n, n + 1} for some integer n ≥ 0 and ψ ∈ Ψ. That is, P 2 = ΛΨ(P 2 ∩ {a, b} + ). By Proposition 3.2 (ii), it follows that P 2 = ΛΨ(b ∪ Φ * (a)) = ΛΨΦ * (a).

2

 2 and so L(G) = bΓ * (u)b 2 . Thus bΓ * (u)b 2 is context-sensitive and by Lemma 3.6, Γ * (u) = b\(bΓ * (u)b 2 )/b 2 is context-sensitive as well. Theorem 3.8 P 2 is a context-sensitive language.

Fact 4 . 1

 41 The automaton A(ϕ b -1 ,a -1 (H)) has the same vertex set as A(H), edges are reverted and labels changed. In particular, sources and sinks are exchanged. If β is a bridge in A(H), β = p w -→q, then there is a bridge of equal length q-→p in A(ϕ b -1 ,a -1 (H)), labeled ϕ b -1 ,a -1 (w -1 ), which we denote by ϕ b -1 ,a -1 (β).

Fact 4 . 2

 42 The automaton A(ϕ b,a (H)) has the same vertex set as A(H) and labels are exchanged. Sources and sinks remain the same. If β is a bridge in A(H), β = p w -→q, then there is a bridge of equal length p-→q in A(ϕ b,a (H)), labeled ϕ b,a (w), which we denote by ϕ b,a (β).

Fact 4 . 3

 43 The automaton A(ϕ a,ba (H)) is obtained from A(H) by the following 3 steps: (S1) If p b -→q is an edge of A(H) and q is not a sink, we replace that edge by a path p b -→ • a -→q, adding a new intermediate vertex for each such edge. is a sink in A(H), we replace this configuration by p We iteratively remove all the vertices of degree 1 different from the origin.

If we have a sink p•

  These are the only instances of first level folding: we cannot fold two "new" a-edges a -→q a ←in B since that would imply the existence of two b-edges b -→q b ←in A(H).

  occur. Then both edges must have been obtained through (S2) and the origin of these edges is the vertex q • (ab -1 ) in A(H), a contradiction.Finally, suppose that a -→q a ←does occur. At least one of these edges must have been obtained through (S1), but not both, otherwise we would have a configuration b -→q b ←in A(H). But then we would have a configuration a -→q b

Fact 4 . 4

 44 (i) When applying ϕ a,ba , a state of A(H) is trimmed in step (S3) if and only if it is a sink of A(H) without outgoing edges. Moreover, no consecutive states can be trimmed.

Fact 4 . 5

 45 Let β = p w -→q be a bridge in A(H) of length at least 2, and let w = w ′ cd where c, d ∈ A.

  (i) A(ϕ a,ba (H)) has a positive path p ϕ a,ba (w ′ c) ----→s, which extends to a uniquely determined bridge, denoted by ϕ a,ba (β).

(

  ii) |ϕ a,ba (β)| ≥ |β| -1, and we have |ϕ a,ba (β)| = |β| -1 exactly if w ∈ a + , p is a source or the origin in A(H), and q is a sink in A(H).Proof. Write β = p By Fact 4.4, no state of the path p ϕ a,ba (w ′ c) ----→s risks trimming. Hence it suffices to check that no internal state of this path can become a singularity. This follows easily from Fact 4.4 (ii) and (iii).(ii) The inequality |ϕ a,ba (β)| ≥ |β| -1 follows at once from part (i). It follows also that |ϕ a,ba (β)| = |β| -1 if and only if w ′ c ∈ a + (otherwise |ϕ a,ba (β)| ≥ |ϕ a,ba (w ′ c)| > |w ′ c| = |β| -1)and p, s ∈ Sing(ϕ a,ba (H)). Thus we assume that w ′ c ∈ a + .

F 2

 2 , we define δ 0 (H) = max(σ(H), hc(A(H)), δ(H) = max(δ 0 (H), hcfp(A(H)), ζ(H) = max(δ 0 (H), shcfp(A(H)).

Lemma 4 . 6

 46 Let H ≤ f.g. F 2 . Every cycle or a cycle-free path labeled b k in A(ϕ a,ba (H)) satisfies k ≤ σ(H). Proof. Let us first assume that α = p b k

Corollary 5 . 6

 56 The problems discussed in Theorem 5.2 and Corollaries 5.3 and 5.4 are decidable also if R is assumed to be a rational subset of IS(F 2 ) or IS(F 2 ) -1 .Proof. If R ∈ Rat IS(F 2 ), then R ∈ Rat Σ * by Lemma 3.5, and we simply apply Theorem 5.2 and Corollaries 5.3 and 5.4.

  1 2 ζ(H),1 2 |u 1 |, . . . , 1 2 |u k |), and to take as terminal states the elements A ∈ X (t, H) such that ū1 , . . . , ūk label loops around the same vertex of A.

	For Problem (3), we choose again t > max( 1 2 ζ(H), 1 2 |u 1 |, . . . , 1 2 |u k |)

arXiv:0809.4386v1 [math.GR]

also called a positive endomorphism

* The first author acknowledges support from Project ASA (PTDC/MAT/65481/2006) and C.M.U.P., financed by F.C.T. (Portugal) through the programmes POCTI and POSI, with national and European Community structural funds. This paper was prepared while the second author was a visiting professor in the CSE Department, IIT Delhi. Both authors acknowledge support from the ESF project AutoMathA.

in A(H). If α ′ is cycle-free, then k < k + 1 ≤ ζ(H). If, on the contrary, α ′ is not cycle-free, then s is the only repetition since the length k prefix of α ′ , namely α, is cycle-free. If s = p, then q would also be a repetition since A(H) is an inverse automaton. Therefore s = p, so α ′ is a homogeneous cycle in A(H) and hence k < k + 1 ≤ δ 0 (H) ≤ ζ(H). This concludes the proof.

Remark 4.8 Note that it is not the case that δ(ϕ(H)) ≤ δ(H) always holds when ϕ ∈ Σ: see the case where H = ba and ϕ = ϕ a,ba .

Truncated automata

Given H ≤ f.g. F 2 , we consider the geodesic metric d defined on the vertex set of A(H) by taking d(u, v) to be the length of the shortest path connecting u and v. Since A(H) is inverse, it is irrelevant to consider directed or undirected paths. As usual, we have

Given t > 0, the t-truncation of A(H), denoted by A t (H), is the automaton obtained by removing from A(H) all vertices u such that d(u, Sing(H)) > t and their adjacent edges. Note that this automaton does not need to be connected.

We first observe that if β is a bridge which is long enough to be affected by the t-truncation of A(H), then for each ϕ ∈ Σ, ϕ(β) is affected by the t-truncation of A(ϕ(H)) as well. -→q, where k > ζ(H), p is a source or the origin in A(K), and q is a sink of A(K). In particular, β is a special homogeneous cycle-free path, so that |β| ≤ ζ(K).

Since

Proof. As in several previous proofs, the result is trivial if ϕ = ϕ b,a or ϕ b -1 ,a -1 , and we may assume that ϕ = ϕ a,ba . By Proposition 4.9, we know that, once the length of a bridge reaches the threshold ζ(H)+1, it can only get longer. Since t > 1 2 ζ(H), t-truncation affects only bridges of length at least ζ(H) + 1. We must therefore discuss the truncation mechanism for such long bridges.

Assume that β = p w -→q is a bridge in A(µ(H)) (µ ∈ Σ * ) with |w| ≥ 2t + 1. Then we may write w = uzv with |u| = |v| = t. By Proposition 4.9, the label of ϕ(β) is of the form

We only need to prove that u ′ and v ′ depend only on A t (µ(H)) and are therefore independent from z.

In view of Fact 4.4, it is clear that u ′ depends only on A t (µ(H)) (remember that w = uzv is a positive word and singularities cannot move forward along a positive path). The nontrivial case is of course the case of q being a sink in A(µ(H)), since by Fact 4.4 (iii) a sink can actually be transferred to the preceding state along a positive path. We claim that even in this case v ′ is independent from z.

Indeed, assume first that b occurs in v. Then |ϕ(v)| > |v| provides enough compensation for the sink moving backwards one position. Hence we may assume that v = a t . We claim that v ′ = a t as well, independently from z. Suppose not. Since we are assuming that the sink has moved from q to its predecessor, and ϕ(a t-1 ) = a t-1 , it follows that v ′ = ba t-1 . Hence b occurs in w. Write w = xba m . Since ϕ(ba m ) = ba m+1 , and taking into account the mobile sink, we obtain by comparison ba m = ba t-1 and so m = t -1, a contradiction, since a t is a suffix of w. Therefore v ′ = a t and so is independent from z as required.

Corollary 4.11 Let H ≤ f.g. F 2 and t > 1 2 ζ(H). Then the set

is finite and effectively constructible.

Proof. By Lemma 4.7, every automaton A(K), K ∈ Σ * (H), has at most σ(H) singularities. By definition of a t-truncation, every state in A t (K)

if and only if u labels a loop at the origin in A(ϕ(H)). Note that this is the case if and only if u labels a loop at the origin in A t (ϕ(H)).

We now view Σ as a finite alphabet (besides being a subset of Aut F 2 ) and we consider the Σ-transition system B t (H) defined as follows. (A Σtransition system is defined like a Σ-automaton, omitting the specification of the initial and terminal states.) The state set of B t (H) is X (t, H) (see Corollary 4.11) and its transitions are the triples A t (K) ϕ -→A t (ϕ(K)), for each A t (K) ∈ X (t, H) and ϕ ∈ Σ. Note that X (t, H) is finite and effectively constructible by Corollary 4.11 and the transitions of B t (H) are well-defined by Theorem 4.10. Moreover, this transition system is complete and deterministic by construction (and so defines recognizable subsets of Σ * as a submonoid of Aut F 2 ). It is immediate that if the word (ϕ 1 , . . . , ϕ n ) ∈ Σ * labels a path from

Now consider the automaton formed by the transition system B t (H) with initial state A t (H) and terminal states the elements A t (K) of X (t, H) such that u labels a loop at the origin in A t (K) (i.e. u ∈ K). The above discussion shows that the language accepted by this automaton is the set of words (ϕ

Thus the set of all ϕ ∈ Σ * such that u ∈ ϕ(H) is rational and effectively constructible.

Observe that a conjugate of u lies in ϕ(H) (ϕ ∈ Aut F 2 ), if and only if u labels a loop at the origin in A(λ w ϕ(H)) for some w ∈ F 2 , if and only if cc(u) labels a loop somewhere in A(ϕ(H)). We now consider the Σ-transition system B t (H) as above, with the same initial state, and we take as terminal states the elements A t (K) of X (t, H) such that cc(u) labels a loop anywhere in A t (K). The language in Σ * accepted by the resulting automaton is the set of ϕ ∈ Σ * such that ϕ(H) contains a conjugate of u.

The same idea -and the same transition system-can be used to algorithmically solve a number of other orbit problems.

Then the following problems are decidable:

(1) whether u ∈ µ(H) for some µ ∈ R;

(1 ′ ) whether a conjugate of u lies in µ(H) for some µ ∈ R; that is, whether u ∈ µ(H) for some µ ∈ ΛR;

(2) whether K ⊆ µ(H) for some µ ∈ R;

Since Ψ is finite, it suffices to be able to decide whether there exist w ∈ F 2 , n ≥ 0 and µ ∈ Σ * 0 such that λ w ϕ n a,ba (u) ∈ µ(H). (4)

We start by considering the case n = 0. By Proposition 3.1 (i), we may replace λ w ϕ n a,ba by ϕ n a,ba λ w , so we may assume that u is cyclically reduced. And by Proposition 1.2 (iv), our problem further reduces to asking if one can decide whether u labels a loop in A(µ(H)) for some µ ∈ Σ * 0 .

(

We note that every loop contains either the origin or a singularity: if it does not contain the origin, then there is a path from the origin to a state in the loop, and the first contact between that path and the loop is a source or a sink. Now let us fix t > max( 5) is decidable, and hence ( 4) is decidable for n = 0. It is also decidable for any fixed n (applying the case n = 0 to ϕ n a,ba (u) instead of u). We now consider (4) in its full generality. If u ∈ R a , then we are reduced to the case n = 0 since ϕ a,ba (u) = u. So we assume that b or b -1 occurs in u, and by conjugation again, we may assume that u starts with b or ends with b -1 (and not both since u is cyclically reduced).

Let M be the least common multiple of 1, 2, . . . , δ 0 (H). In order to prove (4), it suffices to show that if there exist w ∈ F 2 , n ≥ 0 and µ ∈ Σ * 0 such that λ w ϕ n a,ba (u) ∈ µ(H), then there exists such a triple (w, n, µ) with n < |u| + max(M, δ(H)).

Since we have proved (4) for bounded n, the latter property is decidable, and hence (4) is decidable in general.

So we are left with the task of proving this reduced claim. Let (w, n, µ) be such that λ w ϕ n a,ba (u) ∈ µ(H), with n minimal, and let us suppose that n ≥ |u| + max(M, δ(H)).

Write

Recall that u is cyclically reduced, and that it starts with b (i 0 = 0 and ε 1 = 1) or ends with b -1 (i k = 0 and ε k = -1). It follows that ϕ a,ba m (u) is cyclically reduced and that it too starts with b or ends with b -1 . By Proposition 1.2 (iv), ϕ n a,ba (u) labels a loop α in A(µ(H)). Moreover, we have

In the first and second cases, |r ℓ | > n -|u| ≥ max(M, δ(H)); and in the last case, |r ℓ | < |u|. Thus, for the indices ℓ such that r ℓ = s ℓ , we have r ℓ > δ(H).

We now show that the fragments of the loop α labeled by the factors a r ℓ such that r ℓ = s ℓ , fail to be cycle-free in A(µ(H)).

Recall that µ ∈ Σ * 0 . If µ = id or ϕ b -1 ,a -1 , the result is immediate since r ℓ > δ(H) = δ(µ(H)). If µ = ϕ a,ba ν with ν ∈ Σ * 0 , then we can use Proposition 3.1 (i) to reduce n, a contradiction. Hence we may assume that µ = ϕ b -1 ,a -1 ν with ν ∈ Σ * 0 , ν = id. Since ϕ 2 b -1 ,a -1 = id, we may further assume that µ = ϕ b -1 ,a -1 ϕ a,ba ν ′ with ν ′ ∈ Σ * 0 . Then the vertices involved in the a r ℓ -labeled fragment of α form a path in A(ϕ a,ba ν ′ (H)) labeled b r ℓ . Since r ℓ > δ(H), we also have r ℓ > σ(H) ≥ σ(ν ′ (H)) (Lemma 4.7), and hence this path is not cycle-free by Lemma 4.6.

So, for each ℓ such that r ℓ = s ℓ , the fragment of α labeled by the factor a r ℓ of ϕ n a,ba (u) fails to be cycle-free, and must be read along a cycle of A(µ(H)) (in an inverse automaton, if a homogeneous path contains a cycle, then it reads entirely along that cycle).

By definition, M is a multiple of the length c ℓ of that cycle. Now compare ϕ n-M a,ba (u) and ϕ n a,ba (u): wherever the a-factors a r ℓ and a s ℓ are different, their difference is either a M or a -M , and hence it consists of a whole number of passages around the length c ℓ cycle. Therefore ϕ n-M a,ba (u) labels a path in A(µ(H)) as well. This contradicts the minimality of n and completes the proof.