The finite and solvable genus of finitely generated free and surface groups

Let C\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {C}}$$\end{document} be the pseudovariety F\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {F}}$$\end{document} of all finite groups or the pseudovariety S\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {S}}$$\end{document} of all finite solvable groups and let Γ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\Gamma $$\end{document} be either a finitely generated free group or a surface group. The C\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {C}}$$\end{document}-genus of Γ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\Gamma $$\end{document}, denoted by GC(Γ)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {G}}_{{\mathcal {C}}}(\Gamma )$$\end{document}, consists of the isomorphism classes of finitely generated residually-C\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathcal C$$\end{document} groups G having the same quotients in C\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {C}}$$\end{document} as Γ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\Gamma $$\end{document}. We show that the groups from GC(Γ)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {G}}_{{\mathcal {C}}}(\Gamma )$$\end{document} are residually-p for all primes p. This answers a question of Gilbert Baumslag and shows that the groups in the genus are residually finite rationally solvable groups. This leads to a positive solution of particular case of a question of Alexander Grothendieck: if F is a free group, G is a finitely generated residually-C\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {C}}$$\end{document} group and u:F→G\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$u:F\rightarrow G$$\end{document} is a homomorphism such that the induced map of pro-C\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {C}}$$\end{document} completions uC^:FC^→GC^\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$u_{\widehat{{\mathcal {C}}}} : F_{\widehat{{\mathcal {C}}}}\rightarrow G_{\widehat{{\mathcal {C}}}}$$\end{document} is an isomorphism, then u is an isomorphism.


Introduction
We say that a non-empty class of groups C is a pseudovariety if it is closed under subgroups, homomorphic images and finite direct products.We denote by F, P, N and A, respectively, the pseudovarieties of all finite groups, polycyclic groups, finitely generated nilpotent groups and finitely generated abelian groups.If C is a pseudovariety, we put C f = C ∩ F. The pseudovariety of all finite solvable groups P f will be also denoted by S. If p is a prime number, then C p will denote the pseudovariety of finite p-groups lying in C and C p will denote the pseudovariety of finite p -groups lying in C. Given two pseudovarieties C and B, we denote by CB the pseudovariety consisting of all groups G having a normal subgroup N ∈ C such that G/N ∈ B.
Let C be a pseudovariety of finite groups and a finitely generated residually-C group.The C-genus of , denoted by G C ( ), is the set of isomorphism classes of finitely generated residually-C groups G having the same quotients in C as .It is well-known (see, for example, [37,Corollary 3.2.8])that the isomorphism class of G belongs to G C ( ) if and only if the pro-C completions of G and are isomorphic: G C ∼ = C .A related but different definition of genus was introduced in [23].
A group G is called parafree if it is residually nilpotent and there exists a free group F such that G/γ n (G) ∼ = F /γ n (F ) for every positive integer n, where γ n (G) denotes the nth term of the lower central series of G.These groups were introduced by Baumslag in [5].If G is finitely generated, then it is parafree if and only if the isomorphism class of G belongs to G N f (F ) for a finitely generated free group F .Examples constructed by Baumslag show that G N f (F ) is infinite (see, for example, [7]).
A well-known question attributed to Remeslennikov ( [30, Question 5.48]) asks whether G F (F ) consists of a single class.We formulate this as a conjecture.
Conjecture 1 Let G be a finitely generated residually finite group.Assume that the profinite completion G of G is a free profinite group.Then, G is a free group.
It was shown by Wilton [40] that Conjecture 1 holds if we additionally assume that G is a limit group.Recently, this was extended to a larger class of groups by Morales in [35].
By analogy with Conjecture 1, we propose a similar conjecture for groups in the S-genus of a finitely generated free group.
Conjecture 2 Let G be a finitely generated residually S-group.Assume that G S is a free prosolvable group.Then, G is a free group.
By a surface group, we will mean the fundamental group of a compact closed surface of negative Euler characteristic.In the orientable case, surface groups admit presentations of the form S g = x 1 , . . ., x g , y 1 , . . ., y g | [x 1 y 1 ] • • • [x g , y g ] = 1 (g ≥ 2); in the non-orientable case, surface groups take the form N g = x 1 , . . ., x g | x 2  1 • • • x 2 g = 1 (g ≥ 3).Although free groups arise as fundamental groups of non-closed surfaces of negative Euler characteristic, we will not consider free groups to be surface groups.
A group G is parasurface if it is residually nilpotent and there exists a surface group S such that G/γ n (G) ∼ = S/γ n (S) for every positive integer n.It is clear that if G is finitely generated, then G ∈ G N f (S).Finitely generated non-surface parasurface groups were constructed by Bou-Rabee in [11].As in the case of free groups it is not known whether G S (S) or G F (S) consist of a single class.

Conjecture 3 Let S be a surface group. The genera G S (S) and G F (S) each consists of a single class.
A finitely generated residually finite group is called profinitely rigid if G F ( ) consists only of the isomorphism class of .It is straightforward to see that finitely generated abelian groups are profinitely rigid.However, there are examples of virtually cyclic groups [6] and of finitely generated torsion-free nilpotent groups of class 2 [22] that are not profinitely rigid.The first examples of profinitely rigid groups containing a non-abelian free group have recently been constructed in [9,10].Some of them are virtually surface groups.As yet no examples of profinitely rigid virtually non-abelian free groups are known.
In this paper, we prove that the groups in G F ( ) and G S ( ), where is either a finitely generated free group or a surface group, are residually-p for every prime p.This result answers a question of Baumslag (see [7,Problem 5]).

Theorem 1.1 Let be either a finitely generated free group or a surface group and assume that the isomorphism class of G belongs to G F ( ) or G S ( ). Then, G is residually-p for every prime p. Thus, G
Observe that Theorem 1.1 implies that Conjecture 1 is a consequence of Conjecture 2. Let P be a property of groups.We say that P is profinite if for two finitely generated residually finite groups G 1 and G 2 , having the same finite quotients the following holds: if G 1 satisfies P, then G 2 also does.In view of Theorem 1.1, we want to mention a result of Lubotzky [34] who showed that the property of being residually-p is not profinite.
A group G is called locally indicable if every non-trivial finitely generated subgroup of G maps onto Z.An immediate consequence of Theorem 1.1 is the following corollary.

Corollary 1.2 Let be either a finitely generated free group or a surface group and assume that the isomorphism class of G belongs to G F ( ). Then, is locally indicable.
Proof By Theorem 1.1, G is residually-p , and so it is a subgroup of the completion G N p of G. Since the isomorphism class of G belongs to G F ( ), G N p is either a free pro-p group or a non-finite Demushkin pro-p group.Thus, every non-trivial subgroup of G N p has infinite abelianization.Therefore, G N p is locally indicable, and so is G.
In fact, we believe that the following more general result should hold.

Conjecture 4 A finitely generated free profinite group is locally indicable (as an abstract group).
Observe that a non-abelian free profinite group, as opposed to free pro-p groups, has finitely generated closed subgroups with trivial abelianization: consider the universal Frattini cover of a perfect finite group [18,Section 22.6].Therefore, the argument of the proof of Corollary 1.2 does not work in this case.
In [21], Grothendieck posed the following problem: let 1 and 2 be finitely presented, residually finite groups, and let u : 1 → 2 be a homomorphism such that the induced map between the profinite completions u : 1 → 2 is an isomorphism; does it follow that u is an isomorphism?Bridson and Grunewald [8] provided a negative answer on this question.In this paper, we will settle positively a more general instance of Grothendieck's problem, in the special case where 1 is free.Theorem 1.3 Let C be either S or F. Let F be a finitely generated free group, G a residually-C group and u : F → G a homomorphism.Suppose that the induced homomorphism u C : F C → G C between pro-C completions is an isomorphism.Then, u is an isomorphism.Remark 1.4 Alex Lubotzky informed us that the case where C = F can already be obtained from Grothendieck's results in [21].For more details, see [26].
The proof of Theorem 1.3 uses another direct consequence of Theorem 1.1: the groups from G F ( ) and G S ( ), where is either a finitely generated free group or a surface group are residually finite rationally solvable (RFRS) groups (see Sect. 4.1 for the definition).The notion of RFRS groups arose in a work of Agol [1], in connection with the virtual-fibering of 3-manifolds [2].
The results on profinite rigidity of finitely generated free groups are related to the questions about the characterization of measure preserving word maps.Let F be a finitely generated free group on d free generators x 1 , . . ., x d and w = (w 1 , . . ., w k ) a non-empty tuple of elements of F .We say that w is primitive in F if it is a part of a free generating tuple of F .In the same way, we define primitive tuples in a free profinite group F and in a free pro C-group F C , where C is a pseudovariety of finite groups.
Given a finite group G, we define a map w G : G d → G k that sends (g 1 , . . ., g d ) to the image of w under the homomorphism F → G sending x i to g i .If the tuple w is primitive, then the map w G is measure preserving (i.e.all the fibers of this map are of equal size) for every finite group G.If C is a family of finite groups, we say that w is measure preserving in C if w G is measure preserving for all G ∈ C. We ask the following natural question.
Question 5 Which families C of finite groups have the property that for every finite tuple w = (w 1 , . . ., w k ) of elements in a finitely generated free groupF the following is true: if w is measure preserving in C, then w is primitive in F ?
A positive answer to this question for the family of finite symmetric groups was given by Puder and Parzanchevski in [36].The following result shows that the most difficult case of Question 5 corresponds to the special case where w = (w 1 ) consists a single word.Theorem 1.5 Let C be a non-empty family of finite groups, F a finitely generated free group and k ≥ 1.Let w = (w 1 , . . ., w k ) be a tuple of elements of F such that w is measure preserving in C. Assume that for any finitely generated free group U only primitive words u ∈ U satisfy that u is measure preserving in C.Then, w is primitive in F .
In the case where C is a pseudovariety of finite groups, w is measure preserving in C if and only if w is primitive in F C (see, Proposition 5.1).In particular, the result of Puder and Parzanchevski implies that (w 1 , . . ., w k ) is primitive in F if (w 1 , . . ., w k ) is primitive in F .In [40] Wilton gave an alternative proof of this using his result, which we have mentioned before, that limit groups with free profinite completion are free.It is natural to ask whether (w 1 , . . ., w k ) should be primitive in F if (w 1 , . . ., w k ) is primitive in F S .

Conjecture 6
Let F be a finitely generated free group, k ≥ 1 and w = (w 1 , . . ., w k ) a tuple of elements of F .Assume that w is measure preserving in S.Then, w is primitive in F .
Our next results provide support for the plausibility of Conjecture 6.
(a) Conjecture 6 is equivalent to the assertion in Conjecture 2 for groups G of the form G = U * u U , where U is free and u ∈ U is not a proper power.(b) Let F k be a free group of rank k and assume that a tuple w = (w 1 , . . ., w k ) of k elements of F k is measure preserving in A q (A q N p ) for some primes p and q.Then, w is primitive in F k .In particular, the assertion in Conjecture 6 holds in the special case where the rank of F equals k.
We remark that, if U is a free group and u is not a proper power, then the double U * u U featuring in Theorem 1.6 (a) is residually free [4], and hence residually an S-group, as required The paper is organized as follows.Our proof of Theorem 1.1 is divided into two parts, which require different techniques.In the first part, covered in Sect.2, the isomorphism class of G belongs to the finite genus G F ( ) and our argument is based on the study of representation varieties of G.In the second part, covered in Sect.3, the isomorphism class of G belongs to the solvable genus G S ( ) and we use properties of L 2 -Betti numbers.In Sect.4, we prove Theorem 1.3, and in Sect.5, we prove Theorems 1.5 and 1.6.

Proof of Theorem 1.1: the finite genus
As indicated above, we divide the proof of Theorem 1.1 into two parts.In this section, we prove the case of finite genus.

Commutative algebra preliminaries
Let R be a finitely generated commutative ring.Denote by R the profinite completion of R and by Max R the set of maximal ideals of R.
Let m ∈ Max R. Observe that, since the field R/m is finitely generated as a ring, it is of positive characteristic and thus, by Hilbert's Nullstellensatz [3,Corollary 5.24], it is also finite.
Let R m denote the localization of R at the maximal ideal m, and let R m = lim ← − R/m i be the m-adic completion of R. By [3,Corollary 10.20], the natural homomorphism R m → R m is injective.On the other hand, by [3, Proposition 3.9], the natural isomorphism R → m∈Max(R) R m is also injective.Thus, we obtain that the map R → m∈Max(R) R m is injective, and so, R is residually finite.
If R is finite, then, in fact, we have that This implies that if R is finitely generated, then its profinite completion R is isomorphic to m∈Max(R) R m (as a topological ring).This description of R implies the following criterion for two finitely generated commutative rings R and S to have isomorphic profinite completions R ∼ = S.
Lemma 2.1 Let R and S be two finitely generated commutative rings.Then, R ∼ = S if and only if there exists a bijection α : Max(R) → Max(S) such that for every m ∈ Max(R), (R) m ∼ = (S) α(m) .
In this section, we fix a finite field F and denote by F its algebraic closure.Let R be a finitely generated commutative F-algebra.We denote by X R the affine F-set We endow X R with the Zariski topology and denote by F[X R ] the ring of regular functions on X R .Recall that F[X R ] ∼ = F ⊗ F R/ rad(F ⊗ F R) and that there exists a natural bijection between X R and Max(F ⊗ F R): a point p ∈ X R corresponds to the ideal ker p.
The F-affine set X R is irreducible if and only if F[X R ] is a domain.In this case R/ rad(R) is also a domain.However, the converse is not always true: R/ rad(R) may be a domain, while F[X R ] is not.
For any p ∈ X R , ker p ∩ R is a maximal ideal of R. The field of definition of p, denoted by F(p), is equal to R/(ker p ∩ R).It is a finite extension of F.
Let F be a finite extension of F. The set X R ( F) consists of all p ∈ X R such that F(p) can be embedded in F. The homomorphisms from X R ( F) can be identified naturally with homomorphism from Hom F-algebras (R, F).
The Krull dimension of a commutative ring R, denoted dim R, is the supremum of the lengths of all chains of prime ideals (see [3,page 90 and Chapter 11]).The dimension of an affine F-set X is the Krull dimension of F[X].We will use the following two facts about the Krull dimension.Proposition 2.2 Let R be a finitely generated commutative F-algebra and R a commutative F-algebra.
(2) We have that by [3,Corollary 11.19] The main result of this section is the following proposition.

Proposition 2.3 Let R and S be two finitely generated F-algebras and k
Then, X S is irreducible of dimension k.In particular, S/ rad S is a domain of Krull dimension k.
Proof Put R = F ⊗ F R and S = F ⊗ F S. We proceed by establishing three claims, the last two of which yield the desired assertions about X S .

Claim 2.4 For every
Now, the claim follows from Lemma 2.1.

Claim 2.5 Let Y be an irreducible component of X S . Then
Proof Decompose X S as the union of its irreducible components , and let m = ker p be the corresponding maximal ideal of S.
Put m = S ∩ m.Then, m ∈ Max(S) because S is integral over S. Let P = q∈Y ker q be the prime ideal of S corresponding to Y .Thus, F[Y ] ∼ = S/ P. Since p is not contained in other irreducible components Y i for 2 ≤ i ≤ l, P is the only minimal prime ideal of S contained in m.Put P = S ∩ P.Then, P is the only minimal prime ideal of S contained in m.This implies that P m = S m P is the only minimal prime ideal of S m and so P m = rad S m is nilpotent.Hence, the image of P in S m is also nilpotent. ( Therefore, we conclude that Claim 2. 6 The affine F-set X S is irreducible. Proof Let E i /F be a field extension of degree i.By the Lang-Weil inequality (see [32]), Therefore, using again the Lang-Weil inequality, we conclude that X S has only one irreducible component of dimension k.Combining this with Claim 2.5, we obtain that X S is irreducible Since X S is irreducible, S/ rad S is a domain.The Krull dimension of S/ rad S is equal to the dimension of X S .

A criterion to be residually-p
Let F be a finite field of characteristic p and A an affine algebraic group defined over F.
Let G be a finitely generated group and assume that it is given by a presentation where W is a set of words in {x ±1 1 , . . ., x ±1 d }.We will study properties of the group G with the aid of certain ring R A (G) which encodes all the information about representations G → A(F).To simplify the reader can think that A = SL n (compare the example below).
We denote by F[A] the ring of F-regular functions on A. Assume that it has the following presentation where s 1 , . . ., s m are polynomials in commuting variables y 1 , . . ., y l over F.
Thus, if T is a commutative F-algebra, any element of A(T ) can be represented by an l-tuple (t 1 , . . ., t l ) of elements of T satisfying The ring R A (G) is the commutative F-algebra generated by {y 1,1 , . . ., y 1,l , . . ., y d,1 , . . ., y d,l } with relations s 1 (y 1,1 , . . ., y 1,l ) = 0, . . ., s m (y d,1 , . . ., y d,l ) = 0 expressing that the tuples , y d,l ) satisfy the relations of elements of A, and relations associated with the relations of the group G.
Observe that the construction gives R A (G), up to isomorphism, independently of the chosen presentations for G and F[A].
Example (1) Consider A = SL n .In this case l = n 2 and Then, the ring R SL n (G) is the commutative F-algebra generated by with relations det X l = 1, expressing that the images of generators (X l = (y l ij )) have determinant 1 and the relations w(X 1 , . . ., X d ) = 1 SL n (F) for any w ∈ W associated with the relations of the group G. ( We denote by X G A the affine F-set

There is a natural bijection between X G
A and Hom F-algebras (R A (G)/ rad(R A (G)), F), and in the following if p ∈ X G A we will think about it as a F-homomorphism p : R A (G)/ rad(R A (G)) → F.

The tuples X i can be seen as elements of
which sends x i to the matrix X i .Then, for any representation φ : G → A(F), there exists a unique homomorphism is commutative.(In this diagram p φ A should be thought of as applying p φ to the entries of the l-tuples).

Lemma 2.7 Let H be the image of G in its pro-p completion, where p is the characteristic of the field of definition F of A. Denote by π : G → H the canonical map and let
be the induced surjective map.Suppose that the ring R A (G) has only one minimal prime ideal, in other words that rad(R A (G)) is a prime ideal.Then, π * is also injective.
Proof For simplicity of notation, we put Let φ : G → A(F) be the trivial representation and let m = ker p φ , where p φ : R G → F is as in the description of the diagram (3).
Denote by (R G ) m the ring (R G ) m / rad((R G ) m ).We denote by α the canonical map The maps α and π * induce two homomorphisms respectively.Since α is injective, α A is injective as well.
Observe that the group is a pro-p group and the image of the map .
Since α A is injective, π * A is also injective.Without loss of generality, we may assume that the trivial l-tuple represents 1 A(F) .Hence, ker π * is equal to the radical Hence, π * is also injective.Now we are ready to present the main result of this section.

Proposition 2.8
Let G be a finitely generated residually finite group and let p be a prime.For each n ∈ N let A n be an affine algebraic group defined over a finite field F of characteristic p. Assume that (a) for every finite quotient G of G, there exists n ∈ N such that G is a subgroup of A n (F) and (b) for each n ∈ N the ring R A n (G) has only one minimal prime ideal.
Then, G is residually-p .
Proof Let H be the image of G in its pro-p completion and denote by π : G → H the canonical map.
Assume, by way of contradiction, that there exists a non-trivial element g in the kernel of the canonical map π : G → H.There exists a finite quotient G of G such that the image of g in G is non-trivial.The group G can be embedded in A n (F) for some n.Let ) be the map induced by π.Since the representation φ does not factor through π, ker π * is not trivial.However, by Lemma 2.7, π * is injective.This is a contradiction.

Applications to free and surface groups
Let F be a finite field of characteristic p and A an affine algebraic group defined over F. We will use the same notation for A as in Sect.2.2.
Let G be a finitely generated profinite group and assume that it is given by a profinite presentation where W is a set of profinite words in {x ±1  1 , . . ., x ±1 d }.The ring R A (G) is the profinite commutative F-algebra generated by This implies the following lemma.Lemma 2.9 Let F be a finite field and A an affine algebraic group defined over F. Let G 1 and G 2 be two finitely generated groups with isomorphic profinite completions.Then, R A (G 1 ) ∼ = R A (G 2 ).Now we are ready to present the main tool for our proof of the first part of Theorem 1.1.Proposition 2.10 Let be a finitely generated residually finite group and let p be a prime.For each n ∈ N, let A n be an affine algebraic group defined over a finite field F of characteristic p. Assume that (a) for every finite quotient of , there exists n ∈ N such that is a subgroup of A n (F) and (b) for each n ∈ N the affine F-set Proof Lemma 2.9 shows that R A n ( ) ∼ = R A n (G) for all n ∈ N. Hence, by Proposition 2.

3, X G
A n is irreducible for every n ∈ N, and so, R A n (G) contains a unique prime ideal.Therefore, by Proposition 2.8, G is residually-p .Now we are ready to prove the first part of Theorem 1.1.
Theorem 2.12 Let be either a finitely generated free group or a surface group and assume that G belongs to G F ( ).Then, G is residually-p for every prime p.
Proof In this proof, GL n and SL n are affine algebraic groups defined over F p .
First consider the case where = F is free.In this case

and so X F
GL n is irreducible.Thus, we can apply Proposition 2.10.Now assume that = S g is an orientable surface group of genus g.Consider the F palgebra R generated by with relations d l • det X l = 1 for l = 1, . . ., 2g and the relations coming from the equality where X l represents a n by n matrix X l = (y l ij ).Since R is generated by 2gn 2 + 2g + 1 variables and defined by 2g + n 2 equations, by [39, Corollary 1.14], the dimension of an irreducible component of X R is at least (2g − 1)n 2 + 1.
The ring R GL n (S g ) is obtained from R by adding the relation e = 1.Since there is a natural bijective correspondence between the irreducible components of X S g GL n and those of X R satisfying e = 1, which preserves dimensions.By [33, Theorem 1.8], the dimension of X S g GL n is (2g − 1)n 2 + 1 and there exists only one irreducible component of dimension (2g − 1)n 2 + 1.Therefore, X S g GL n is irreducible.Now the result follows from Proposition 2.10.
Finally, assume that is non-orientable surface group.Combining the previous argument with [33,Corollary 1.11] we obtain that X SL n is irreducible.Thus, we can again apply Proposition 2.10.

Proof of Theorem 1.1: the solvable genus
We start this section by explaining several results about the first L 2 -Betti numbers b (2) 1 (H) of a group H which we will use in this paper.The reader can find the definition of L 2 -Betti numbers and their basic properties in [28].In the following, p denotes a prime.
(c) Let be either a free or a surface group and H a dense subgroup of We will also need the following lemma.Recall that S denotes the pseudovariety of all finite soluble groups.

Lemma 3.2 Let S be a surface group and N a non-trivial closed normal subgroup of S S .
Then, there exist a normal open subgroup K of S S , such that NK/K ∼ = C s q , where q is a prime and s ≥ 2.
Proof There exists a prime q such that q divides the (profinite) order of N /[N, N ], We want to show that the order of N /[N, N ]N q is at least q 2 .
There exists an open subgroup U of S S , such the image of the induced map is not trivial.This implies that the image M of N in the pro-q quotient U N q of U is non-trivial.If M is of finite index in U N q , then clearly If M is of infinite index, it cannot be finitely generated (see for example, [19, Theorem 1.1]), and so, M/[M, M]M q is infinite.Since M is a quotient of N , we conclude that the order of N /[N, N ]N q is at least q 2 .Thus, there exist a normal open subgroup K of S S containing [N, N ]N q such that NK /K ∼ = C s q and s ≥ 2. Now we are ready to prove the second part of Theorem 1.1.

Theorem 3.3 Let be a finitely generated free group or a surface group and let p be a prime. If G ∈ G S ( ), then G is residually-p .
Proof We will prove the theorem in the case where = N g is a non-orientable surface group.The case where is a free group or an orientable surface group can be proved in the same way.
Let H be the image of G in the pro-p completion of G and regard G as a subgroup of G S .Observe that, via the isomorphism G S ∼ = S , the group H maps to a dense subgroup of N p .Let N be the kernel of the map G S → H S .it suffices to show that N = {1}.For a contradiction, we assume that N = {1}.
Since G S ∼ = S , by Lemma 3.2 there exists a normal open subgroup K of G S , such that NK /K ∼ = C s q , where q is prime and s ≥ 2. Put T = G ∩ NK and let T be the image of T in H.
Observe that NK is isomorphic to the prosolvable completion of T .Thus, Therefore, since G S ∼ = S , we also have that Hence, On the other hand, taking into account that T is a subgroup of N p and b We have arrived to a contradiction.

RFRS groups
A group G is called residually finite rationally solvable or RFRS if there exists a chain G = H 0 > H 1 > . . . of finite index normal subgroups of G with trivial intersection such that each term H i+1 contains a normal subgroup K i+1 of H i with the property that H i /K i+1 is torsion-free abelian.Any chain {H i } meeting these conditions is called a witnessing chain (for G).
Let C a pseudovariety of finite solvable groups.We say that a group G is C-RFRS if G has a witnessing chain {H i } such that G/H i ∈ C for all i.Observe that in this case G is residually-C.It is clear that an RFRS group is also S-RFRS.The class of N p -RFRS groups has already appeared in the literature with the name RFRp groups (see [31]).Proposition 4.1 Let G be a group from G F ( ) or G S ( ), where is a finitely generated free or a surface group.Let p be a prime and assume that p = 2 if is a non-orientable surface group.Then, G is N p -RFRS.
Proof The pro-p completion of G can be describe as follows:

Universal K [G]-ring of fractions
Let R be a unital ring.A division R-ring φ : R → D is called epic if φ(R) generates D as a division ring.Each division R-ring D induces a (generalized) Sylvester module rank function dim D for R: for an R-module M we define dim D M to be the dimension of D⊗ R M as a D-space.
Given a ring R, Cohn introduced the notion of a universal division R-ring (see, for example, [15,Section 7.2]).In the language of Sylvester rank functions, an epic division Rring D is universal if for every division R-ring E and for every finitely generated R-module Let K be a field and G an RFRS group.By [24, Corollary 1.3], the universal division K [G]-ring of fractions exists.We denote it by D K [G] .In the case where A similar description for an arbitrary field K was given in [24].Although this description may appear complicated, it is very useful (as, for example, the results of [17,29] show) and it is a key ingredient in our proof of Theorem 1.
Let α : H → Z be an epimorphism and N = ker α.Then, the ring H with respect to the metric induced by the norm α .Then, This leads us to the following commutative diagram.
then for all relevant indices i and j,

Grothendieck's problem for free modules
In this section, let Z be a finite field or Z and let K denotes its field of fractions.Let R be a unital ring and D a division R-ring.We say that an R-module M is D-torsion-free if the canonical map M → D ⊗ R M is injective.The following result, which we think is of independent interest, is the main step in the proof of Theorem 1.3.Recall that A denotes the pseudovariety of finitely generated abelian groups.

Theorem 4.3 Let C be a pseudovariety of finite solvable groups, E = AC and G a finitely generated C-RFRS group. Let M be a finitely generated D K [G] -torsion-free Z[G]-module, L a free Z[G]-module and α : L → M a homomorphism of Z[G]-modules. Assume that for every quotient P ∈ E f of G, the induced map
is onto and Then, α is an isomorphism.
Proof Let G 0 be a subgroup of G of finite index and let φ : The following notation will be used later for various choices of G 0 .The map α induces the map The coefficients a φ i (m) depend on the basis l 1 , . . ., l d .It will always be clear from the context which choice of G 0 we have made and with respect to what basis we carry out the calculation.
Proof If φ is an isomorphism, then it is clear that ψ • φ is also an isomorphism.The equality follows from the uniqueness of a ψ•φ (m).

Claim 4.5 Let P ∈ E be a quotient of G and π
Proof First assume that P is finite.Then from the hypothesis of the theorem, it follows that π P is onto.Let N be such that P = G/N .Then using that D K [N ] is the universal division ring of fractions of K [N ], we obtain that . Since P is polycyclic, it is residually finite.Therefore, there exists a finite quotient P of P such that if η P : Z[P] → Z[P] denotes the canonical map, then for some i, η P (x i ) = 0. Hence, Observe that Since P ∈ E f , as we have proved before π P is an isomorphism.Thus, π P (x) = 0. Now we want to show that π P is surjective.Let Since P is polycyclic, by [38, Theorem A and Corollary A], an irreducible Z[P]-module is finite.Thus if U = {0}, there exists a finite quotient P of P such that Z[P]⊗ Z[P] U = 0.But this is impossible because π P is an isomorphism.Thus, U is trivial, and so π P is surjective.
Let S ⊂ M be a finite generating set of M. Let l 1 , . . ., l d be a free basis of L as a Z[G]module.By Proposition 4.2, there exists a finite-index normal subgroup H of G and an epimorphism τ : then for every m ∈ S, and all i, j such that 1 ≤ i ≤ d and 1 ≤ j ≤ |G : H|, We put There is also another way to construct S from the elements of S. Observe that {t j • l i : 1 ≤ i ≤ d, 1 ≤ j ≤ |G : H|} is a basis of L as a Z[H]-module and also θ H is an isomorphism.Hence, By our assumption, G is residually-C.Thus, there exists a chain of normal subgroups For each k ≥ 1 and β = ±τ , there exists a canonical map Claim 4.7 For every a ∈ S and every k ≥ 1, we have that By Claim 4.5, π G/H k is an isomorphism.Again this implies that π H/H k is also an isomorphism.Thus, Claim 4.4 implies that Thus, from ( 5) and ( 6) we obtain that Therefore, π H/H k (q i ) = 0 if i > l 2 .Since ∩H k = {1}, this implies that q i = 0. Thus, Consider the following commutative diagram of Z[G]-modules: Corollary 4.10 Let G be a group from G F ( ) or G S ( ), where is a finitely generated free or a surface group.Let p and q be primes, possibly equal to one another.Let M be a finitely generated D F q [G] -torsion-free F q [G]-module, L a free F q [G]-module and α : L → M a homomorphism of F q [G]-modules.Assume that for every quotient P ∈ A q N p of G the induced map Proof If is a non-orientable surface group, then G has a subgroup G 0 of index 2 such that G 0 belongs to G F (S) or G S (S), where S is an orientable surface group.Hence if p = 2, then for every quotient M is also onto.This means that in the case of p = 2, we can assume that is a free group or an orientable surface group.Thus, by Proposition 4.1, G is N p -RFRS.
Let E = AN p and P ∈ E f .Then, there exists a normal subgroup N ∈ A q of P such that P = P/N ∈ A q N p .The following assertions are equivalent to one another: (1) the map Id F q [P] ⊗α is onto; ] (M/α(M)) = 0 (because the Jacobson ideal of F q [P] contains {n−1 : n ∈ N }); (4) Id F q [P] ⊗α is onto.
Hence, Id F q [P] ⊗α is onto.By Theorem 4.3, α is an isomorphism.Lemma 4.11 Let q be a prime, G and H groups and u : H → G a homomorphism.Let N be a normal subgroup of G. Assume that G = u(H)[N, N ]N q .Then, the induced map is onto, where on the left-hand side F q [G/N ] is regarded as a right F[H]-module via u.
Proof For simplicity, we assume that H is a subgroup of G and u is the inclusion map.Consider the following commutative diagram of left , and taking into account that G = HN , we obtain the following commutative diagram with exact horizontal sequences.
Thus, we will prove the lemma if we show that the map ) is onto.Since G = HN and using Shapiro's Lemma we obtain Proof of Theorem 1.3 Let q be a prime.Observe that u : F → G induces the homomorphism and so G = u(F )[N, N ]N q .Thus, by Lemma 4.11, the induced map ] is also equal to d.Hence, by Corollary 4.10, the map α is an isomorphism.Therefore, u is an isomorphism.

Images in finite solvable groups
In this section, we prove Theorems 1.5 and 1.6.

Measure preserving tuples in free pro-C-groups
Let C be a pseudovariety of finite groups, F C a free pro-C group with free generators x 1 , . . ., x d , k ≥ 1 and w = (w 1 , . . ., w k ) a tuple of elements of F C .Given a finite group G ∈ C, we can define a map w G : G d → G k that sends (g 1 , . . ., g d ) to the image of w under the homomorphism F C → G sending x i to g i .In this section, we prove the following result mentioned in the introduction.First, we will show that H 2 is also free pro-C of rank k.Let α : H 1 → H 2 be the map hat sends x i to w i .Let N be an open normal subgroup of H 1 and G = H 1 /N .Since w G is measure preserving, there exists a homomorphism from F C to G whose restriction to H 2 gives a homomorphism H 2 → G sending w i to x i N .This implies that α is an isomorphism.
Since the map w P is measure preserving for every P ∈ C, the condition (b) of [20, Proposition 3.2] holds.This implies that there exists α ∈ Aut(F C ) whose restriction on H 1 is α.Thus, w is primitive in F C .

Measure preserving tuples in free groups
In order to prove Theorems 1.5 and 1.6 (a), we will need the following result, which is known to the specialists.We include its proof for the convenience of the reader.Proposition 5.2 Let F be a free group of rank d and w 1 , . . ., w k ∈ F .Let H be a subgroup of F generated by w 1 , . . ., w k and G = F * H F the double of F over H. Assume that G is free of rank 2d − k.Then, the tuple (w 1 , . . ., w k ) is primitive in F .
Proof Let F be a field.There is a natural homomorphism G → F , determined by the property that it restricts to the identity map on each of the two factors isomorphic to F .Thus, F[F ] naturally carries the structure of an F[G]-module.We denote two copies of F inside G by F 1 and F 2 .A standard calculation of the cohomology groups of an amalgamated product (see for example, [12,Theorem 2]) gives an exact sequence Since G is free H 2 (G; F[F ]) = 0.The images of the restriction maps

Proof of Theorem 1.5
Let F be a free group of rank d.We prove the theorem by induction on k.Thus, by our assumption, the base of induction (k = 1) holds true.Assume now that k ≥ 2. Let F be a copy of F .We will denote by g ∈ F a copy of the element g ∈ F .Since w is measure preserving in C, (w 1 , . . ., w k−1 ) is also measure preserving in C. Therefore, by induction hypothesis, k w k ∈ U .Since τ is measure preserving in C, (w 1 , . . ., w k , u) is also measure preserving in C. In particular, u is measure preserving in C. By the hypothesis of the theorem, this implies that u is primitive in U .Thus, U / u U is free of rank 2d − k.By Proposition 5.2, (w 1 , . . ., w k ) is primitive in F .

Proof of Theorem 1.6(a)
First assume that the assertion in Conjecture 2 holds for the groups U * u U , where U is free and u ∈ U is not a proper power.In view of Theorem 1.5, it is enough to establish the assertion of Conjecture 6 in the special case k = 1.
Assume that U is a free group and u ∈ U is measure preserving in S.Then, it is clear that u is not a proper power.By Proposition 5.1, u is primitive in U S .Let G = U * u U .By [4], we know that G is residually free and so, it is residually-(finite solvable).Since, u is primitive in U S , G S is free prosolvable of rank 2d − 1.Since we assume that Conjecture 2 holds for G, G is free of rank 2d − 1.Thus, by Proposition 5.2, u is primitive in U .Now assume that Conjecture 6 holds.Let F be a finitely generated free group on d free generators x 1 , . . ., x d and let 1 = w ∈ F .Assume that (F * w F ) S ∼ = U S , where U is a free group.It is clear that since w is not trivial the rank of U is 2d − 1.Then, for every finite solvable group G, we have that Thus, 1 1) .
By the Cauchy-Schwarz inequality, 1) , and equality holds if and only if |w −1 G (g)| is constant.This implies that w is measure preserving in S and by Conjecture 6, w is primitive.Hence, F * w F is free.

Proof of Theorem 1.6(b)
Let F = x 1 , . . ., x k be a free group of rank k, u : F → F the homomorphism that sends x i to w i for 1 ≤ i ≤ k and the homomorphism of F q [F ]-modules that sends (a 1 , . . ., a k ) to k i=1 a i (w i − 1).Since w is measure preserving in A q (A q N p ), by Proposition 5.1, w is primitive in F A q (A q N p ) .Thus for any normal subgroup N of F such that F /N ∈ A q (A q N p ), F = u(F )N .By Lemma 4.11, for any quotient P ∈ A q N p of F , the induced map is onto.Hence by Corollary 4.10, α is an isomorphism, and so, u is an isomorphism.Thus, w is primitive in F .

Remark 2 .
11 If A n = GL n or A n = SL n , then the condition (a) holds automatically.

Proposition 3 . 1
The following holds.(a) Let H be a group and T a subgroup of finite index in H.Then, b ) = |H : T | • b Let S be a surface group and H a non-trivial subgroup of S N p .Then, b(2)

Proof
(a)  This is[28, Theorem 4.15(iii)].(b) By [27, Corollary 5.2], H is residually-(amenable locally indicable).Hence by [24, Corollary 1.4], the Neumann rank function rk H and the Sylvester matrix rank function rk {1} induced by the augmentation map satisfy rk H ≥ rk {1} .Arguing as in the proof of [24, Corollary 1.6], we conclude that b 3. Let H be a subgroup of finite index in G and T = {t 1 , . . ., t |G:H| } a right transversal to H in G.The division subring of D K [G] generated by K [H] is isomorphic to D K [H] as a K [H]-ring, and so, we will denote it also by D K [H] .Moreover we have that

For a group
algebra K [G] we denote by I K [G] its augmentation ideal and, if H is a subgroup of G, by G I K [H] the left ideal of K [G] generated by I K [H] .
Proposition 4.2 [29] Let K be a field, G an RFRS group and G = H 0 > H 1 > H 2 > . . .a witnessing chain.Let a 1 , . . ., a s ∈ D K [G] .Then, there exists n ∈ N and an epimorphism α : H → Z for H = H n such that if T = {t 1 , . . ., t |G:H| } is a transversal to H in G and Proof As we have already observed, Claim 4.6 implies that θ H is an isomorphism.Thus, (4)implies that δ H,β is onto.Claim 4.4 implies that δ H,β • θ H = θ H,β • δ H,β is an isomorphism.Hence since θ H,β is injective, δ H,β is also injective and so bijective.Applying Claim 4.4, twice we obtain that δ H,β (a θ H Indeed, by Claim 4.7, for all k ≥ 1, almost all π H/H k (q i ) and π H/H k (r i ) are trivial and, moreover, we have the following equality in Z[H/H k ]: is an isomorphism.This implies that the map L → M is onto.The following result gives a criterion for invertibility of a matrix over Z[G].Let C be a pseudovariety of finite solvable groups, E = AC and G a finitely generated C-RFRS group.LetA ∈ Mat n (Z[G]).If for every quotient P ∈ E f of G the image of A in Mat n (Z[P]) is invertible, then A is invertible over Z[G].Proof Multiplication by the matrix A from the right induces a homomorphism α : Z[G] n → Z[G] n .Theorem 4.3 implies that α is an isomorphism of Z[G]-modules.Hence, A is invertible.
Proposition 5.1 Let C be a pseudovariety of finite groups, F C a free pro-C group with free generators x 1 , . . ., x d , k ≥ 1 and w = (w 1 , . . ., w k ) a tuple of elements of F C .Then, w is measure preserving in C if and only if w is primitive in F C .Proof The "if" part of the proposition is clear.Let us prove the "only if "part.We use the results of [20, Section 3].There it is assumed that C is extension-closed, but all proofs work perfectly without this assumption.It is clear that k ≤ d.Let H 1 be the closed subgroup of F C generated by x 1 , . . ., x k and H 2 the closed subgroup of F C generated by w 1 , . . ., w k .Observe that H 1 is free pro-C with free generators x 1 , . . ., x k .