Algorithms determining finite simple images of finitely presented groups

We address the question: for which collections of finite simple groups does there exist an algorithm that determines the images of an arbitrary finitely presented group that lie in the collection? We prove both positive and negative results. For a collection of finite simple groups that contains infinitely many alternating groups, or contains classical groups of unbounded dimensions, we prove that there is no such algorithm. On the other hand, for families of simple groups of Lie type of bounded rank, we obtain positive results. For example, given any fixed untwisted Lie type $X$ there is an algorithm that determines whether or not an arbitrary finitely presented group has infinitely many simple images isomorphic to $X(q)$ for some $q$, and if there are finitely many, the algorithm determines them.


Introduction
According to a result of the first author and Wilton [3], there is no algorithm that, given a finite presentation, determines whether or not the group presented has a nontrivial finite quotient. Consequently there is no algorithm that determines the finite simple images of a finitely presented group. On the other hand, by [11,23] there is an algorithm that determines the images of a finitely presented group that are isomorphic to PSL 2 (q) or PGL 2 (q) for some q. More precisely, the algorithm determines whether there are finitely or infinitely many values of q such that PSL 2 (q) or PGL 2 (q) is an image, and in the finite case it enumerates all the values of q. A similar algorithm is given in [12] concerning the images in {PSL 3 (q), PGL 3 (q), PSU 3 (q), PGU 3 (q)} of groups with a 2-generator finite presentation.
Thus the question arises -for which collections of finite simple groups is there an algorithm that determines the members of the collection that are images of an arbitrary finitely presented group G? In this paper we provide answers to this question.
Note that there is an obvious algorithm that determines the finite cyclic images of G (just work with the abelianisation of G), so we restrict attention to the non-abelian simple groups.
First, for groups of unbounded rank, we have a negative answer. In the following statement, by the dimension of a classical group we mean the dimension of its natural module.
Theorem 1. Let F be a set of finite simple groups that either contains an infinite number of alternating groups, or contains a classical group of dimension n for infinitely many values of n. Then there is no algorithm that, given a finite presentation, does either of the following: (i) determines whether or not the group presented has at least one quotient in F; (ii) determines whether or not the group presented has infinitely many quotients in F.
On the other hand, we are able to prove a positive result for simple groups of fixed rank, reflecting the results on PSL 2 , PSL 3 and PSU 3 already mentioned. In order to state our result we need to define some notation. Let X be a fixed untwisted Lie type (e.g. A n or E 8 ), and for a prime power q let X(q) be the simple group of type X over F q . If X(q) possesses a graph automorphism of order d ∈ {2, 3}, denote by d X(q) the corresponding twisted simple group over F q . (Here we are using the notation q rather than q d , as used for example in [4,Chapter 14].) For convenience write 1 X(q) = X(q). Denote by ID( d X(q)) the group generated by inner and diagonal automorphisms of d X(q). Recall that ID( d X(q)) is the fixed point group of a Frobenius endomorphism of the adjoint simple algebraic group of type X (see [9,Defn. 2.5.10]).
Definition For a fixed Lie type d X (with d ∈ {1, 2, 3}) define the classes of groups X d and Y d as follows.
(i) For any d, let ) for some q}.
For example, if X = A n−1 (n ≥ 3), there are two X-classes: Note that apart from types d X = 2 A n , 2 D n and 2 E 6 , all classes X d consist of simple groups.
Theorem 2. Let d X be a fixed Lie type, and let X = X d be the corresponding class of groups defined above. Then there is an algorithm that determines whether or not any given finitely presented group has infinitely many quotients in X ; moreover, if there are finitely many such quotients, the algorithm determines them. In particular, the algorithm determines whether or not any given finitely presented group has at least one quotient in X .
Remarks 1. The proof of Theorem 2 shows that the same result holds for various subsets of the classes X d -for example, for the collection of groups in X d of fixed characteristic. 2. Theorem 2 shows, for example, that there is an algorithm that determines whether a finitely presented group has infinitely many quotients PSL n (q) (n fixed, q varying); on the other hand, by Theorem 1 there is no such algorithm for PSL n (q) (q fixed, n varying). 3. The algorithms in Theorem 2 can be taken to be primitive recursive, that is, they do not involve an unbounded search. While the algorithms are in principle explicit, they are not practical because of our reliance in the proof on results in model theory such as Theorem 3.5 and because of the complexity of the formulas involved. There is much interest in producing practical algorithms for finitely presented groups -for example, the algorithms in [11,12,23] have found many applications. Thus -given a class X d for some fixed Lie type d X -now that we know that there is an algorithm that determines whether or not any given finitely presented group has infinitely many quotients in X d , a practical such algorithm would be of great interest.
Clearly, if a perfect group G has a quotient Y such that d X(q) ≤ Y ≤ ID( d X(q)), then Y = d X(q). Hence for perfect finitely presented groups we have a complete solution to our question: Corollary 3. For a fixed Lie type d X, there is an algorithm that determines whether or not any given perfect finitely presented group has infinitely many quotients of the form d X(q), and if there are finitely many, the algorithm determines them.
An important ingredient of the proof of Theorem 2 is the following result, which enables us to distinguish between images in families of simple groups of twisted and untwisted types. We are very grateful to Alex Lubotzky for suggesting this result together with a sketch of a proof using strong approximation, and to Andrei Rapinchuk for much useful information.
Theorem 4. Let d X be a fixed Lie type, and let G be a finitely generated group. If G has infinitely many quotients in the class Y d , then G also has infinitely many simple quotients X(q) = 1 X(q).
For example, applying the result with d X = 2 A n−1 shows that a finitely generated group with infinitely many images PSU n (q) also has infinitely many images PSL n (q). Applying it with d X = 1 A n−1 shows that a finitely generated group with infinitely many images in the set {Y : PSL n (q) ≤ Y ≤ PGL n (q) for some q} also has infinitely many images PSL n (q).
Our algorithmic results would have been more elegant if it were possible to establish the latter conclusion with unitary groups PGU n (q), PSU n (q) replacing PGL n (q), PSL n (q) (in Theorem 2 this would enable us to replace our classes of twisted groups X d (d > 1) by just the simple groups in the class). However this is in fact false, as is shown by Corollary 5.2, which for any n divisible by 4, produces a finitely presented group that has infinitely many images in the set {Y : PSU n (q) ≤ Y ≤ PGU n (q) for some q}, but has only finitely many images PSU n (q).

Proof of Theorem 1
Our proof of Theorem 1 is based on the following result, taken from [19] and [28]. There is a function f : N × N → N with the property that for any two finite non-abelian simple groups T 1 , T 2 of orders t 1 , t 2 , the following hold.
(i) Every classical simple group of dimension greater than f (t 1 , t 2 ) is generated by a copy of T 1 and a copy of T 2 . (ii) Every alternating group A n with n > f (t 1 , t 2 ) is generated by a copy of T 1 and a copy of T 2 .
Corollary 2.2. Let T 1 , T 2 be finite non-abelian simple groups of orders t 1 , t 2 , and let n > f (t 1 , t 2 ). Then both the alternating group A n , and any classical group Cl n (q) of dimension n, are images of the free product T 1 * T 2 .

Deduction of Theorem 1
Let F be a set of finite simple groups satisfying (i) or (ii) of Theorem 1. Suppose for a contradiction that there is an algorithm that determines whether or not any given finitely presented group has at least one quotient in F. We shall show that under this assumption there is an algorithm that determines whether or not a finitely presented group has a nontrivial finite image, contrary to the Bridson-Wilton result in [3].
Let G be a finitely presented group. By assumption, there is an algorithm that determines whether or not the finitely presented group G * G has an image in F. If the algorithm answers yes, meaning that G * G has an image in F, then G has a nontrivial finite image. If the answer is no, then we claim that G can have no finite non-abelian simple image: for if G had such an image, call it S, then G * G would have an image S * S, and hence by Corollary 2.2, G * G would have infinitely many images in F, contradicting the output of the algorithm. Finally, we can easily determine whether or not G has a nontrivial finite abelian image by considering the abelianisation of G.
Thus we have established that if Theorem 1 were false, then there would be an algorithm that determines whether or not G has a nontrivial finite image, and as remarked above, this contradicts [3]. This completes the proof of Theorem 1.

Proof of Theorem 2
The proof of Theorem 2 relies on some representation theory, and also some model theory. We present the required results in Sections 3.1 and 3.2, and then complete the proof of Theorem 2 in Sections 3.3-3.5.
3.1. Actions on adjoint modules. The main result we shall need is Theorem 3.1 below, most of which follows from [17,Theorem 4] and [18].
In the statement of Theorem 3.1, we letX be a simple adjoint algebraic group over an algebraically closed field of characteristic p > 0, and F a Frobenius endomorphism ofX such that X :=X F = ID( d X(q)) is a group of Lie type over F q , where q is a power of p and d ∈ {1, 2, 3} (notation of Section 1). We say that a subgroup H of X is of the same type as X if F * (H) ∼ = (X F 0 ) for some Frobenius endomorphism F 0 . Specifically, for such a subgroup H, one of the following holds (see [15,Theorem 5 (i) X is untwisted, and e X(q 0 ) ≤ H ≤ ID( e X(q 0 )) for some e ∈ {1, 2, 3} and some subfield In each case, we say that H is over the field F q 0 . Recall thatX acts on its adjoint module, the Lie algebra L(X). This action is usually irreducible, but there are exceptions in a small number of characteristics; the precise composition factors can be found in [17, 1.10].
Theorem 3.1. There is an explicitly computable function f : N → N such that the following holds. Let X =X F = ID( d X(q)) as above, and let r be the rank ofX. Suppose H is a subgroup of X such that H acts absolutely irreducibly on everyX-composition factor of the adjoint module L(X). Then one of the following holds: (i) |H| < f (r); (ii) H is of the same type as X; (iii) H is as in Table 1.
Proof. Assume that H is not of the same type as X. Choose X 0 ≤ X of the same type as X, such that H ≤ X 0 and X 0 is minimal with these properties, and write F * (X 0 ) = d X(q 0 ) = (X F 0 ) for some Frobenius endomorphism F 0 and F q 0 ⊆ F q . Let M be a maximal subgroup of X 0 such that H ≤ M . Then M is not of the same type as X, by the choice of X 0 .
SupposeX is of exceptional type. Here we apply [18,Corollary 2], which determines the maximal subgroups of X 0 that are irreducible on some composition factor of L(X). It follows from this that there is a computable constant C such that either |M | < C, or (X, p) is (F 4 , 2) or (G 2 , 3); in the latter cases, whenX = F 4 , we have M = D 4 (q 0 ).S 3 , C 4 (q 0 ) or B 4 (q 0 ), and whenX = G 2 we have M = A 2 (q 0 ).2. However, in none of these cases is M irreducible on both of the composition factors of L(X), contrary to the hypothesis of the theorem. Hence, taking the function f to satisfy f (r) ≥ C, the result is proved for this case.
Now supposeX is a classical group. We refer to the proof of [14,Theorem 4.8(i)]: this shows that there is a computable function f 1 such that either |M | < f 1 (r), or there exists a connected F 0 -stable subgroupM ofX such that M = N X 0 (M F 0 ), and moreover M stabilizes the Lie algebra L(M ). Assume |M | ≥ f 1 (r) (and take the function f to satisfy f (r) ≥ f 1 (r) for all r), so that the latter holds. Then L(X) cannot beX-irreducible, and so [17,Prop. 1.10] shows thatX is as in the following table: IfX = A n−1 thenM must have dimension 1 or n 2 − 2, and it follows easily that n = 2, M = T 1 (a rank 1 torus) and M = (q 0 ±1).2, as in Table 1. IfX = C 2 (so that X 0 = C 2 (q 0 ) or 2 B 2 (q 0 )), then the composition factors of L(X) have dimensions 4, 4, 1 2 and we see from the lists of maximal subgroups of these groups in [2] that H is as in Table 1. And if X = D n with n ≥ 4, it is easy to see thatX has no connected subgroups of dimension or codimension 1 or 2 satifying the irreducibility hypothesis of the theorem. So assume now thatX = B n or C n with n ≥ 3 (and p = 2). The possibilities for the connected subgroupsM are given by [16,Theorem 2]: either they belong to one of seven classes of subgroups C i , or they are simple and act irreducibly on the natural module for X. Inspection of the non-simple subgroups in the classes C i shows that none of these has a dimension that is a sum of some of the composition factor dimensions in L(X) given above. HenceM is simple. Now [17,Lemma 7.1] shows that the only possibililties for (X,M ) are (C n , D n ), (B n , D n ) and (C 3 , G 2 ). Hence X = C n (q) and M = D n (q 0 ).2 or G 2 (q 0 ) (with n = 3 in the latter case). By what we have already proved, the only subgroups of M that satify the irreducibility hypothesis are of the same type as M . Hence H is as in Table 1, and the proof is complete.
Remark Note that in Theorem 3.1(ii), if H is of the same type as X, then H does act absolutely irreducibly on eachX-composition factor of L(X). Lemma 3.2. Let X = C n (q) with q even, n ≥ 3, and let V = V (λ n ) be a spin module for X over F q of dimension 2 n . Suppose H is as in the first three rows of Table 1. Then H has a subgroup of index at most 2 that is not absolutely irreducible on V .
Proof. For the first two rows, observe that V ↓ D n (q) is the sum of two half-spin modules for D n (q). And for the third row, V ↓ G 2 (q) has composition factors of dimensions 6, 1, 1.
We also require the following fact about containment between the groups d X(q). Theorem 3.3. Let d X be a fixed Lie type, and p a prime, and let Y be a group such that if and only if e divides f and d is coprime to f /e.

Proof.
Suppose e divides f and d is coprime to f /e, and write k = f /e. LetX be the adjoint simple algebraic group overF p of type X, and let F be a Frobenius endomorphism Now [15,Lemma 5.3] says that there is a Frobenius automorphism τ of Z (as defined in [15, §5] The existence of such a Frobenius automorphism implies that e divides f and d is coprime to f /e, as required.
For d = 1, 2, 3 we say that the d-part of e ∈ N is the largest power of d which divides e.
Proof. Let g be a common multiple of e 1 , . . . , e r such that g/e i is coprime to d for all i. Then Theorem 3.3 implies that K i ≤ ID( d X(p g )) for all i, as required.

Model theory.
In this section we present some results from model theory that we need. We work with the usual language of rings L = {0, 1, +, −, ·}. 'Definable' means 'definable without parameters' unless explicitly stated otherwise. Notation: Denote the set of prime numbers by P and the set of prime powers by Q. We say that a subset of Q is small if only a finite number of primes divide its elements. A property which holds for all but a small subset of Q is said to hold for almost all elements of Q.
In [1], Ax showed that there is an algorithm to decide, given a closed L-formula, whether or not there are infinitely many finite fields in which it holds. The algorithm makes use of Gödel's Completeness Theorem and involves an unbounded (but terminating) search. A primitive recursive algorithm (so not involving unbounded searches) was given by Fried and Sacerdote in [8]. (Recursive procedures for the other results below had also been given by Ax.) We state their results in the following way: (i) There is a primitive recursive procedure to decide whether or not there is a finite set of primes such that θ is true in F q for all q ∈ Q which are not divisible by a prime in the finite set. If there is such a finite set, then the procedure also determines it. (ii) Given a prime p, there is a primitive recursive procedure to decide whether or not θ is true in F p e for all but finitely many e. If it is, then the procedure also determines the finite set of exceptional exponents. (iii) There is a primitive recursive procedure to decide whether or not there are infinitely many finite fields F q in which θ is true. If there are only finitely many, then the procedure will determine them.
Note that (i) says that we can determine whether or not {q ∈ Q : F q |= θ} is small. As a special case of (i), we can determine whether or not θ is true in all finite fields.
(iii) This is stated in [8] (bottom of page 204), but we give a few more details. First, apply (i) to ¬θ. If the procedure finds that the set of all q ∈ Q such that F q |= ¬θ is not small, then there are infinitely many primes p 1 < p 2 < . . . and exponents e i such that F p e i i |= θ, and we can stop. Otherwise, (i) identifies a prime p 0 such that ¬θ is true in F p e for all primes p ≥ p 0 . For each prime p < p 0 , we then apply (ii) to ¬θ to determine whether or not θ holds in infinitely many F p e . If it does not, the algorithm determines the finite set of F p e in which θ holds (cf. Theorem 4 of [8]).
We also require the following result, which follows from Theorem 6.7 of [6].
Theorem 3.6. Suppose θ is a closed L-formula and p is a fixed prime. Then there are effectively computable constants N > 0 and B such that, for e ≥ B, The following is the effective version of the main result of [5]. Here, 'effective' means computable in a primitive recursive way.
In the above, we may assume that the formula (∀x)(¬θ(x,ȳ)) is one of the θ i (ȳ). This then picks out those q,b where N q (b) is zero.
Remark 3.8. It is well known that, for fixed d ∈ N, the field F q d and its Frobenius map x → x q are first-order definable in the field F q in a uniform way, using parameters from F q . For example, letā = (a 0 , . . . , a d−1 ) be a d-tuple of parameters representing the coefficients in F q of a polynomial fā = a 0 +. . .+a d−1 x d−1 +x d which is irreducible over F q . We identify the field F q d with the set F d q with coordinatewise addition and multiplication modulo fā. The Frobenius map on F q d can then be described using a d 2 -tupleb of parameters giving the entries of a d × d matrix which gives an automorphism of F q d of order d. These conditions on the parametersā,b can be expressed as When we make use of this, the actual choice of the parametersā,b will be irrelevant and we will suppress them in the notation. Moreover, the results for parameter-free formulas in Theorems 3.5 and 3.7 will still be applicable. For example, the unitary group GU n (q) thought of as a subgroup of GL n (q 2 ) is definable in F q using parametersā,b as above (with d = 2). A first-order statement θ about GU n (q) (say, in the language of groups) can be translated into an L-formulaθ(ā,b) (with parameters) whose truth value does not depend on the choice of the particularā,b which satisfy γ. Then GU n (q) |= θ ⇔ F q |= ∀xȳ(γ(x,ȳ) →θ(x,ȳ)), and the decidability results in Theorem 3.5 apply to the L-formula on the right-hand side here.
3.3. Deduction of Theorem 2. Let G = x 1 , . . . , x s | ρ 1 , . . . , ρ k be a finitely presented group, with generators x i and relators ρ i . Let d X be a fixed Lie type, and recall the class Y d of groups defined in the Introduction. Now let where on the first line, the union is over all e for which the type e X exists. Exclude the case where d X is of Suzuki or Ree type 2 B 2 , 2 G 2 or 2 F 4 ; these will be considered in Section 3.4.
For a field K, let ID(X(K)) denote the inner-diagonal group of (untwisted) type X over K, and let V = V (K) be the adjoint module for ID(X(K)). For K = F q , we can regard ID(X(K)) as a definable subset H(K) of K l 2 (where l = dim V ) in a uniform way via the action on V , as the solutions of polynomial equations defining the connected adjoint algebraic group of type X.
If X = A n , D n or E 6 and K = F q , then X possesses a graph automorphism of order d ∈ {2, 3}, and the twisted groups ID( d X(q)) can also be regarded as uniformly definable subsets H(F q ) of some power of K, using Remark 3.8. This is covered in detail in Section 5.3 of [26].
In one exceptional case we vary the above definition of H(K) and V (K). This is the case where X = C n (n ≥ 2) and char(K) = 2. In this case we have ID(X(K)) = X(K); let V 2n (K) be the natural module, and S(K) a spin module for X(K), and for K = F q regard X(K) as a uniformly definable subset H(K) of K l 2 via the action on V = V 2n (K) ⊕ S(K), where l = 2n + 2 n .
For H(K) defined as above, let Φ 0 (K) be the set of tuples of elements which satisfy the defining relations of G. That is, This is a definable subset of K sl 2 .
For a tupleḡ = (g 1 , . . . , g s ) ∈ Φ 0 (K), define ḡ := g 1 , . . . , g s . There is an L-formula that expresses the condition that the subgroup ḡ of GL(V ) is absolutely irreducible on every H(K)-composition factor of V . One way of writing down such a formula is as follows. Fix a basis B of V . Let K 1 be an extension field of K with |K 1 : K| ≤ n (definable in K as in Remark 3.8), let V (K 1 ) be the K 1 -vector space V ⊗ K K 1 , and let W be the collection of subspaces of V (K 1 ) that are spanned by some proper non-empty subset of B. The formula says that for any such K 1 , there is no pair h ∈ GL(V (K 1 )), W ∈ W such that each of the conjugates g h i stabilizes W . There is also a formula expressing the condition | ḡ | > f (r), where f is the function in Theorem 3.1. Hence if we define Φ(K) to be the set of all tuples g ∈ Φ 0 (K) such that ḡ is absolutely irreducible on every H(K)-composition factor of V and has order greater than f (r), then Φ(K) is uniformly definable in K. We can regard Φ here as a parameter-free L-formula (with the parameters needed to define the required field extensions absorbed into the formula by making use of Remark 3.8). In principle, we could write down this formula Φ explicitly.
In the case where X = C n and char(K) = 2, we adjust Φ to include the condition that subgroups of index at most 4 in ḡ arising from subgroups of such index in G are also absolutely irreducible on every composition factor of V .
By Theorem 3.1 and Lemma 3.2, for any finite field K = F q , and any tupleḡ ∈ Φ(K), the group ḡ is of the same type as X, hence is a group in the class Y over some subfield F q 0 of F q . Summarising: Lemma 3.9. For each prime power q, the finitely presented group G has a homomorphic image in the class Y over some subfield F q 0 of F q if and only if F q |= ∃xΦ(x).
At this point we apply Theorem 3.7 (taking m = 0) to the parameter-free formula Φ(x) and obtain (effectively) a finite set {(θ i , µ i , ε i , r i ) : i ∈ I} as in the theorem. Note that as there are no parameter variables in Φ, the θ i are L-sentences. Informally, this expresses Φ(F q ) as a finite union of subsets of dimensions r i (i ∈ I), for any q ∈ Q.
On the other hand, we have the following simple observation.
Lemma 3.10. For q ∈ Q, the group H(F q ) acts by conjugation on the set Φ(F q ). The size of each orbit is |H(F q )|.
Proof. Ifḡ ∈ Φ(F q ), then ḡ ≤ H(F q ) is a subgroup of H(F q ) of the same type as X, which has trivial centralizer in H(F q ) (by Schur's lemma applied to the adjoint representation of H(F q )). So the stabilizer under conjugation ofḡ is trivial.
It follows that we may assume that the 'dimensions' r i in the above are either 0 or at least x, where x is the dimension of the simple algebraic group of type X. We let I x = {i ∈ I : r i = x} and I y = {i ∈ I : r i > x}. Let Define Q(G) to be the set of prime powers q such that G has as a homomorphic image a group in the class Y over F q . Let S = {q : F q |= ∃xΦ(x)}, and for a prime p, let S p = {e : F p e |= ∃xΦ(x)}.  Proof. If the set in (a) is not small, then the number of primes dividing elements of the set Q(G) is infinite, by Lemma 3.9.
Suppose p is as in (b). Then |Φ(F q )| is (at least) O(q x+1 ) for infinitely many powers q of p. As |H(F q )| is O(q x ), it follows that the number of H(F q )-orbits on Φ(F q ) can be arbitrarily large. As d X(q) has boundedly many orbits on subgroups of the same type over a fixed subfield F q 0 (by [15, Theorem 5.1]), there is no bound on the size of powers of p in Q(G).
Suppose d ≥ 2 and p is as in (c). For i ∈ N we can find e i ∈ S p with d-part d j i where j 1 < j 2 < . . .. By Lemma 3.9, there is a subgroup K i of ID( d X(p e i )) which is in the class Y and which is an image of G. This must be over a subfield Thus by Theorem 3.3, f i divides e i and d is coprime to e i /f i . If i < k then e k is divisible by a higher power of d than e i , and so d X(p f i ) ≤ d X(p e k ) by Theorem 3.3. Hence K k is not isomorphic to K i and it follows that Q(G) is infinite.
Conversely suppose that Q(G) is infinite. If Q(G) is not small then we are in case (a). If Q(G) is small then there is a prime p such that {e : p e ∈ Q(G)} is infinite.
Suppose first that there is an infinite subset of {e : p e ∈ Q(G)} whose elements have the same d-part. We claim that for infinitely many powers q of p we have F q |= Θ y . Assume for a contradiction that this is not the case.
By Corollary 3.4 we have an infinite increasing sequence q 1 , q 2 , q 3 , . . . of powers of p with the property that Φ(F q k ) contains tuples generating a group in Y over F q for at least k different values of q. In particular, the number of orbits of d X(q k ) on this is at least k, so But we can also assume that these F q k all satisfy the same θ i with i ∈ I x . The estimate in Theorem 3.7 gives constants α, β such that This implies that n k /| d X(q k )| is bounded above as k → ∞ and so we have a contradiction.
In the remaining case, {e : p e ∈ Q(G)} has elements of arbitrarily large d-part. So d ≥ 2. If p e ∈ Q(G) there is f ∈ N and a quotient K of G such that d X(p f ) ≥ K ≥ ID( d X(p e )). By Theorem 3.3, the d-parts of e and f are the same. Moreover, f ∈ S p . Thus (c) holds.
Corollary 3.12. There is a primitive recursive algorithm to decide whether the set Q(G) is infinite or not.
Proof. We say how to check the conditions in Lemma 3.11. We use the notation and terminology from there. First, by Theorem 3.5(i), we can test whether the set S is small or not using a primitive recursive algorithm. If it is not small, then Q(G) is infinite and we can stop. If it is small, then our algorithm gives us an upper bound p 0 on the primes which divide its elements.
For each prime p ≤ p 0 we decide whether or not (c) of Lemma 3.11 holds. We may of course assume that d ≥ 2. By applying Theorem 3.6 to the formula ∃xΦ(x) ∧ 'characteristic is p' we can determine effectively: some N ∈ N and a (possibly empty) set of residue classes a + N Z such that, for sufficiently large e ∈ N, we have e ∈ S p if and only if e lies in one of these classes. So it remains to decide, given a residue class a + N Z, whether or not it has elements of unbounded d-part. But it is easy to show that this happens if and only if the d-part of a is greater than or equal to the d-part of N .
Finally, for primes p ≤ p 0 we can check in a primitive recursive way whether there are infinitely many e with F p e |= Θ y , by Theorem 3.5(ii).
At this point we can complete the proof of Theorem 2 (apart from the Suzuki and Ree families, postponed until the next subsection). We assume Theorem 4, which will be proved in Section 4. Fix a Lie type d X, and let X d , Y d be the corresponding classes of groups defined in the Introduction. If d > 1, then Y = Y d = X d , so Corollary 3.12 shows that there is an algorithm that determines whether or not G has infinitely many quotients in X d . Now suppose d = 1, so that Y = e Y e . By Corollary 3.12, there is an algorithm that determines whether or not G has infinitely many quotients in Y. If there are infinitely many such quotients, then Theorem 4 shows that there are also infinitely many quotients in X 1 .
This completes the proof of Theorem 2 apart from the last assertion -that if the set Q(G) is finite, we can compute this set. So suppose Q(G) is finite. Note that if N is a positive integer, we can write down a sentence Ψ N which, in a field F q , says that there is a tuple in H(F q ) which satisfies the formula Φ(x) and which generates a subgroup of H(F q ) with at least N elements. As in Lemma 3.9, we have that Ψ N is true in F q if and only if there is a homomorphic image of G in Y of size at least N . So by our assumption, there is some N with the property that Ψ N is false in all finite fields. Using Theorem 3.5, we can find such an N by testing whether Ψ n is false in all finite fields for successive values of n until one is found (this involves an unbounded search). This gives a bound N on the size of the groups in Y which are homomorphic images of G, so we can test groups in Y of size at most N individually (a series of finite computations) to determine whether or not they are homomorphic images of G.
In Subsection 3.5, we give a more complicated argument which avoids the unbounded search in the previous paragraph, hence providing a primitive recursive algorithm for determining Q(G) in the case where it is finite.
3.4. The Suzuki and Ree groups. We are very grateful to Ivan Tomašić for his help with the material of this section. The aim is to adapt the above arguments to handle the classes X 2 where X is B 2 , G 2 , or F 4 (and the characteristic is 2, 3 or 2 respectively). So these are the classes consisting of the Suzuki and Ree groups 2 B 2 (q), 2 G 2 (q), 2 F 4 (q) -note that for these groups, ID( 2 X(q)) = 2 X(q), so the classes consist only of the simple groups.
The appropriate model-theoretic framework is that of algebraically closed fields with a Frobenius automorphism ( [10]), rather than the model theory of finite fields used in the previous subsection.
Let L σ be the first-order language consisting of L, the language of rings used previously, together with a unary function symbol σ. If q is a power of a prime number p and K is an algebraically closed field of characteristic p, we denote by K q the L σ -structure (K; 0, 1, +, −, ·, σ) where σ : K → K is x → x q . In particular, the fixed field of σ is F q , so the field F q is uniformly definable in K q (that is, using an L σ -formula which is independent of q). Similarly, for fixed p, let ν denote the Frobenius map x → x p . If q = p n then the field F p 2n+1 is uniformly interpreted in K q as the fixed field of ν • σ 2 . Moreover, (ν • σ) 2 (x) = ν(x) for all x ∈ F p 2n+1 . Thus we have a uniform interpretation of the fields F p 2n+1 together with a square root of the Frobenius map on these in the structures K p n .
It follows that if 2 X(p 2n+1 ) is a family of Suzuki or Ree groups, then there is a (parameterfree) L σ -formula H such that, for an algebraically closed field K of characteristic p (equal to 2 or 3, as appropriate), the solution set H(K p n ) is the subgroup 2 X(p 2n+1 ) of the group X(K) (represented by its action on its adjoint module, as in the previous section).
The algorithm to determine whether our finitely presented group G has infinitely many images in the X-class X 2 is then exactly as before, except that we require results for the L σ -structures K q in place of Theorem 3.5 (ii) and Theorem 3.7. The following has been communicated to us by Ivan Tomašić.
The following is Theorem 1.1 of [27] .
Theorem 3.13. For each L σ -formula θ(x 1 , . . . , x n , y 1 , . . . , y m ) there exists a positive constant C and a finite set D of pairs (d, µ) with d ∈ Z ∪ {∞} and µ ∈ Q + ∪ {∞} such that for each q ∈ Q andb ∈ K m q , if N q (b) is the size (possibly ∞) of the set Moreover, for each (d, µ) ∈ D there is an L σ -formula ϕ d,µ (ȳ) with the property that, for each q andb ∈ K m q , the above estimate for N q (b) holds if and only if K q |= ϕ d,µ (b).
Note that in the above, the obvious conventions about ∞ are being used when N q (b) is infinite. The paper [27] makes no claims about determining C, D and the formulas ϕ d,µ . However, Tomašić informs us that, using the methods of [30], a version of the above can be proved in which these are determined in a primitive recursive way (so providing a replacement for Theorem 3.7). Moreover, in the case where there are no parameter variablesȳ, the ϕ d,µ will be such that testing whether or not there are infinitely many q with K q |= φ d,µ can also be done in an effective way (giving a replacement for Theorem 3.5(ii)).
In summary, we have proved the following result, which is Theorem 2 for the Suzuki and Ree families: Theorem 5. Suppose X = B 2 , F 4 or G 2 and the characteristic is 2, 2 or 3 respectively. Then there is a primitive recursive algorithm to decide whether or not the finitely presented group G has infinitely images in the class X 2 .
3.5. Determining finitely many images. We continue with the notation of Section 3.3. In particular Y is the class defined at the start of that section (or, given the remarks in Section 3.4, one of the classes of Suzuki or Ree groups). We will denote ID( d X(q)) by H(q) (this is consistent with the above notation where H(F q ) is the interpretation of ID( d X(q)) in F q ).
We suppose that Q(G) is finite and give a primitive recursive algorithm to determine it. From the above, we have a finite list of the possible primes dividing the elements of Q(G), so we fix p to be one of these and determine Q p (G), the images in Y in this characteristic. By Lemma 3.9, we can test whether this is empty or not by applying Theorem 3.5(ii) to the formula ¬(∃xΦ(x)).
From now on, we assume that Q p (G) is non-empty. Let E = {e : F p e |= (∃x)(Φ(x))}. Note that this is infinite. By Lemma 3.11, the d-part of elements of this set is bounded (and we can compute a bound effectively, as in the proof of Lemma 3.11). Thus it will suffice to show that we can effectively determine the elements of Q p (G) which are defined over fields F p e where the d-part of e is some fixed power a of d. Call this Q a p (G). In what follows, q = p e (sometimes with embellishments) will always denote a power of p with d-part a. Note that there is a formula χ a such that F p f |= χ a if and only if f has d-part a.
Notation 3.14. List the groups in Q a p (G) as T 1 , . . . , T m , where T i is over the field F π i for some power π i of p.
We shall show how to determine some q such that H(q) contains a copy of each T i . Note that such a q exists, by Corollary 3.4.
Apply Theorem 3.7 to the formula Φ(x) ∧ 'characteristic is p' ∧ ∃xΦ(x) ∧ χ a . This gives a finite set {(θ i , µ i , ε i , r i ) : i ∈ I} as in Theorem 3.7 such that if e ∈ E and q = p e , then there is a unique i ∈ I with F q |= θ i , and for this i, In the next lemma, dim(X) denotes the dimension of the simple algebraic group of type X.
Lemma 3.15. Let i ∈ I, and suppose there are infinitely many e ∈ E with F p e |= θ i . Then r i = dim(X).
Proof. By assumption, G has finitely many images in Q p (G). Also H(q) has boundedly many orbits on subgroups of the same type over a given subfield (by [15,Theorem 5.1]). Hence by Lemma 3.10, there is a constant c such that |H(q)| ≤ |Φ(F q )| ≤ c|H(q)|.
Remark 3.16. For i as in Lemma 3.15, we may adjust the formula θ i so that there exists a rational number c i with the property that if (q j ) is an increasing sequence of powers of p with F q j |= θ i for all j, then Assume from now on that this is the case.
For j ≤ m, let C j (q) be a system of representatives for the conjugacy classes of subgroups of H(q) which are isomorphic to the group T j (of course, this could be empty). Let Let s j denote the number of orbits (under conjugation) of T j on the set of s-tuples in T j which satisfy the defining relations of G and which generate T j .
Lemma 3.17. We have Proof. The number of subgroups of H(q) which are isomorphic to T j is equal to As the number of tuples in Φ(F q ) which generate some T ∼ = T j is |T |s j , we obtain the required result.
Lemma 3.18. There are infinitely many powers q of p with the property that for all j ≤ m and for all powers q of p, we have t j (q) ≥ t j (q ).
Proof. Let γ j = |C j (q)|. Using the above notation, if γ j = 0, then H(q) has one conjugacy class of subgroups isomorphic to Y j , each having normalizer isomorphic to Y I j in H(q). Thus γ j is equal to the number of conjugacy classes of subgroups isomorphic to T j in Y I j . So in this case it follows that depends only on j.
So either H(q) does not contain a copy of T j and t j (q) = 0, or t j (q) = τ j . As there are infinitely many q where H(q) contains a copy of T j for all j ≤ m, the result follows.
With τ j as in the proof of the above lemma, let Q = {q : t j (q) = τ j for all j ≤ m}.
Let α = m j=1 τ j s j . Lemma 3.19. There is some i ∈ I with the property that F q |= θ i for infinitely many q ∈ Q. For such i we have α = µ i c i ≥ µ j c j for all j ∈ I for which there are infinitely many powers q of p with F q |= θ j .
Proof. Suppose s ∈ I and (q u ) u∈N is an increasing sequence with F qu |= θ s and each t j (q u ) is constant on the sequence. Let β = j t j (q u )s j and x = dim(X). By Lemmas 3.15 and 3.17 we have: Letting u → ∞, we obtain β = µ s /c s . It follows that if i, j are as in the statement of the Lemma, then µ i /c i = α. Moreover, we may take an infinite sequence of powers q of p where F q satisfies θ j and where the t k (q) are constant. Then for such q, For notational convenience, take i = 0 where i is as in Lemma 3.19. Note that by Lemma 3.19, this i can be determined explicitly (as the constants µ j , c j are effectively computable). We obtain: Lemma 3.20. There is an effectively computable constant A such that if q = p e and e ≥ A and F q |= θ 0 , then t j (q) = τ j for all j ≤ m. In particular, H(q) contains a copy of each T j .
Proof. Suppose F q |= θ 0 . Then, writing x = dim(X) as usual, if q is sufficiently large. Note that the left-hand side here is an integer and the right-hand side tends to zero. Thus, as we know explicitly all of the constants involved, we can compute A such that if q ≥ A, then the left-hand side is zero. As τ j ≥ t j (q) for all j and q, this implies that t j (q) = τ j , as required.
We can now give the primitive recursive algorithm to determine Q a p (G), assuming that we have already tested to determine that it is non-empty.
(2) Determine for which θ i there are infinitely many e ∈ E with F p e |= θ i (and discard the rest). It follows that H(q) contains a copy of each T j : so we can find these by inspection.

Proof of Theorem 4
Let d X be a fixed Lie type, and let Y d be the corresponding class of groups defined in the Introduction. Let G be a finitely generated group, and assume that G has infinitely many quotients dX ( . For each i, let α i : G → dX (q i ) be a surjection. Let K i =F q i , and note that dX (q i ) < X(K i ), the adjoint simple algebraic group over K i . Let V (K i ) be the adjoint module for X(K i ), so for each i ∈ N we have Now let U be a non-principal ultrafilter on N, and take the corresponding ultralimit of the above sequences. This yields α : G → X(K) < SL(V (K)), where K = K i /U, an algebraically closed field. We know that Gα i = dX (q i ) acts irreducibly on every X(K i )-composition factor of V (K i ).
Denote the distinguished generators of G byx and letā i be the image of these under α i . Letā be the image of (ā i ) i∈N in the ultra product. Eachā i acts irreducibly on the X(K i )composition factors of V i and this can be expressed in a first-order way. So by the Los theorem,ā acts irreducibly on the X(K)-composition factors of V (K). The subgroup A generated byā is an infinite image of G, and its Zariski closureĀ is an algebraic subgroup of X(K) which is irreducible on all composition factors of the adjoint module. It follows thatĀ = X(K), apart possibly from the exceptions corresponding to entries in Table 1 of Theorem 3.1, in which X = C n , p = 2; these can be excluded by adding the extra first-order condition given in the preamble to Lemma 3.9. Therefore A is Zariski dense in X(K).
Thus we have an algebraically closed field K and a homomorphism α : G → X(K) with Zariski-dense image. As G is finitely generated, it follows from [13,Theorem 4.1] that there is a global field k 0 (of the same characteristic as K) and a homomorphism ψ : G → X(k 0 ) with Zariski-dense image. (Note that in all of this, we are thinking of X as an algebraic group in its adjoint representation.) Let Γ = Gψ. We wish to apply Pink's Strong Approximation Theorem [21, Theorem 0.2], so we first need to replace the triple (k 0 , X, Γ) with a minimal quasi-model (k, Y, Γ), as in [21,Section 3]. So in particular, k ⊆ k 0 is a global field, Y is an adjoint algebraic group over k with an isogeny to X over k 0 and we can think of Γ as a subgroup of Y (k). Then There exists a finite extension k 1 of k such that ∆ ≤Ŷ (k 1 ) andŶ is split over k 1 . For a prime w of k 1 , write O w for the ring of integers in the completion (k 1 ) w . Again we think of k 1 as a subset of (k 1 ) w .
Denote by T 1 the set of primes w of k 1 such that ∆ ≤Ŷ (O w ), and define T = {w ∩ o : w ∈ T 1 }. As ∆ is finitely generated, T 1 and T are finite sets.
Let V be the set of primes of k that split completely in k 1 . By the Chebotarev density theorem, V has positive density among the primes of k.
Let v ∈ V \ T , and let w be a prime of k 1 above v. Since v splits completely, k v ∼ = (k 1 ) w , so we can identify k 1 with a subset of k v . Then ∆ ≤Ŷ (k v ), and since v ∈ T , it follows that ∆ ≤Ŷ (o v ). Hence by (2), for almost all such v we have ∆ Ŷ (F v ). AsŶ is split over k 1 , the imageŶ (F v ) is of untwisted type, and soŶ (F v )/Z ∼ = X(q), where q = |F v | and Z is the centre ofŶ (F v ). Thus ∆ maps onto X(q) for all such q. We now note that if S is a finite simple image of ∆, then S is also an image of Γ, and hence of G. Indeed, if N is a normal subgroup of ∆ with ∆/N = S, then ZN/N is a central subgroup of S (where Z = Z(∆)), so Z ≤ N . But then S ∼ = (∆/Z)/(N/Z), which is a quotient of Γ.
This completes the proof of Theorem 4.

Almost simple quotients of some unitary groups
In this section we exhibit some finitely presented groups that have infinitely many images in the set {Y : PSU n (q) ≤ Y ≤ PGU n (q) for some q}, but only finitely many images PSU n (q). This explains why, at least with the methods of this paper, in Theorem 2 we are unable to replace our classes of twisted groups X d (d > 1) by just the simple groups in the class.
Fix m ≥ 2 and an algebraic number field k with i = √ −1 / ∈ k. Denote by * the non-trivial k-automorphism of k(i), and extend * to an automorphism of C. Define G(k) = g ∈ GL m (k(i)) | g · g * T = 1 , G 1 (k) = G(k) ∩ SL m (k(i)). ( These are the k-rational points of algebraic groups G = U m > G 1 = SU m defined over k. If K ⊆ C is a Galois extension of k with i / ∈ K, then G 1 (K) < G(K) are defined by (3) (with K replacing k), while if i ∈ K we have GL m (K) ∼ = G(K) > G 1 (K) ∼ = SL m (K), embedded diagonally in GL 2m (K). Suppose R is a subring of k and π : R → F is a homomorphism onto a field F ; then π induces a homomorphism R[i] → F ( √ −1) and hence a homomorphism (still denoted by π) from G(R) = G(k) ∩ GL m (R([i]) into G(F ). Here G(F ) is defined by (3) where * is the non-trivial F -automorphism of F (i) if √ −1 / ∈ F , while if −1 is a square in F then G 1 (F ) ∼ = SL m (F ) (see [22,Section 2.3.3]).
Let S be a finite set of primes of k and let R be the ring of S-integers of k. Then R 1 ⊇ R[i] ⊇ 2R 1 where R 1 is ring of S-integers of k(i). For a prime P of R 1 with 2 ∈ P ∩ R = p set F p = R/p, q p = |F p | , where i is a square root of −1. Let P 1 = {p | q p ≡ 1 (mod 4)} P 3 = {p | q p ≡ 3 (mod 8)} P 7 = {p | q p ≡ 7 (mod 8)} .
Let π p : GL m (R 1 ) → GL m (E p ) be the quotient map induced by R 1 → R 1 /P. Write ρ q : U m (F q ) → PGU m (F q ) for the quotient map modulo the centre.
Proposition 5.1. Assume that either k is not totally real, or S contains a prime p such that |R/p| ≡ 1 (mod 4). Let Then Γ is a finitely presented infinite group and the following hold.
(i) For almost all primes p of R, (ii) If p ∈ P 1 then G 1 (F p ) = SL m (F p ). (iii) If p ∈ P 3 ∪P 7 then G 1 (F p ) = SU m (F p ) ∼ = SU m (q p ) and G(F p ) = U m (F p ) ∼ = U m (q p ). (iv) If p ∈ P 3 and 4 | m then Γπ p ρ qp PSU m (F p ).
(v) Suppose that m ≥ 4. Then with at most finitely many exceptions, every finite non-abelian simple image of Γ is of the form Γπ p ρ qp for some prime p of R. (vi) P 1 is infinite and P 3 ∪ P 7 is infinite. If √ −2 ∈ k then P 7 is empty.