On the profinite rigidity of free and surface groups

Let S be either a free group or the fundamental group of a closed hyperbolic surface. We show that if G is a finitely generated residually-p group with the same pro-p completion as S, then two-generated subgroups of G are free. This generalises (and gives a new proof of) the analogous result of Baumslag for parafree groups. Our argument relies on the following new ingredient: if G is a residually-(torsion-free nilpotent) group and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$H\le G$$\end{document}H≤G is a virtually polycyclic subgroup, then H is nilpotent and the pro-p topology of G induces on H its full pro-p topology. Then we study applications to profinite rigidity. Remeslennikov conjectured that a finitely generated residually finite G with profinite completion \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\hat{G}}\cong {\hat{S}}$$\end{document}G^≅S^ is necessarily \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$G\cong S$$\end{document}G≅S. We confirm this when G belongs to a class of groups \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathcal {H}_\textbf{ab}}$$\end{document}Hab that has a finite abelian hierarchy starting with finitely generated residually free groups. This strengthens a previous result of Wilton that relies on the hyperbolicity assumption. Lastly, we prove that the group \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$S\times \mathbb {Z}^n$$\end{document}S×Zn is profinitely rigid within finitely generated residually free groups.


Introduction
A fundamental idea in the study of infinite groups consists of understanding how much algebraic structure of a group G can be detected in its collection of finite quotients.We address the following question: Suppose that S is either a free group or the fundamental group of a closed hyperbolic surface.Given a finitely generated residually finite group G with the same profinite completion G ∼ = S, what can be said about G? Our main result is Theorem A and provides a partial answer which concerns the subgroup structure of G. Before stating it, we remark that a recent breakthrough of Jaikin-Zapirain [JZ21a, Theorem 1.1] implies that such G is residually-p, so a group G as above will lie under the assumptions of the following theorem.
Theorem A. Let p be a prime and let S be either a free or hyperbolic surface group.Suppose that G is a finitely generated residually-p group with the same pro-p completion as S. Then two-generated subgroups of G are free.This is proven in Theorem 4.1.Theorem A generalises (and gives a new proof of) the analogous result of Baumslag [Bau69, Theorem 4.2] for parafree Theorem C. Let G be a virtually polycyclic group.Then the following two statements are equivalent: • The group G is nilpotent.
• For all subgroups H G and all primes p, the pro-p topology of G induces on H its full pro-p topology.
One implication is proven in Theorem 3.2 and the other in Theorem 3.7.Virtually polycyclic groups have been known to be subgroup separable for long (after the work of Hirsch and Malcev [Seg83, Chapter 1]).However, the situation about their pro-p topology does not seem to be as clear and, to the best of the author's knowledge, this result has not appeared explicitly in the literature before.
We now put Theorem A in more context regarding previous research on relating subgroup structure and profinite completions, which so far has been done specially for three-manifolds.For example, a remarkable result is the profinite recognition of the topology of geometric three-manifolds by Wilton-Zalesskii [WZ17], where they show that a compact orientable aspherical three-manifold M is hyperbolic if and only if π 1 M contains no Z 2 p .This was generalised by Zalesskii [Zal22, Theorem 1.1], showing that a relatively hyperbolic virtually compact special group G is hyperbolic if and only if its profinite completion G contains no Z 2 p .In this sense, one of the difficulties of Theorem A is relating subgroup obstructions of an abstract group to subgroup obstructions of its pro-p completion in the flavour of the previous results but in the generality of finitely generated residually-p groups, where there is a priori no hierarchy at our disposal.
Note that Theorem A is not immediate even for residually free groups.An elementary property of residually free groups is that non-abelian twogenerated subgroups are free (see [Bau62,Section 4]).However, these can clearly contain the group Z 2 and, even in this context, one needs an additional argument to rule it out.One may expect the analogous result of Theorem A to hold for limit groups.As observed in Remark 4.4, our methods establish Theorem A for the p-genus of more hyperbolic limit groups, other than free and surface groups.However, we cannot solve the general case.
Question 1.1.Let p be a prime and let G be a group in the p-genus of a hyperbolic limit group L. Are two-generated subgroups of G free?An important property of our argument is that, when S is a free or surface group, S p is residually-(torsion-free nilpotent), proven in Propositions 2.15 and 2.16.For a general limit group L, this feature about L p is not known.Kochloukova-Zalesskii study in [KZ11,Theorem 4.2] the residual properties of a class of pro-p analogues of limit groups (which includes, for example, prop completions of ICE groups).However, it is an open problem to determine whether their class contains the pro-p completions of all limit groups (we refer to [KZ11,Section 9] for more open questions).
1.1.Applications to profinite rigidity.It is a well-known conjecture of Remeslennikov that free groups are profinitely rigid (see, for example, [KM14, Question 5.48] and [NRR79,Question 12]).This can be naturally restated to include surface groups as follows.
Conjecture 1.2.Let S be either a free or a surface group and let G be a finitely generated residually finite group with G ∼ = S. Then G ∼ = S.
Wilton [Wil18b,Wil21] solved Conjecture 1.2 for limit groups G.There is a second proof of Conjecture 1.2 when S is a surface group and G is a finitely generated residually free group by Fruchter and the author [FM23,Corollary D].In Corollary D, we establish Conjecture 1.2 when G belongs to the following abelian hierarchy, which naturally includes limit groups (since these admit an abelian hierarchy terminating in free groups [Sel01, Theorem 4.1]).
Definition 1.3.Let H ab denote the smallest class of groups such that (1) H ab contains all finitely generated residually free groups.
(2) If A, B are in H ab and C is a virtually abelian subgroup of A and B, then the amalgamated product A * C B belongs to H ab .(3) If A is in H ab and θ : C −→ C ′ is an isomorphism between virtually abelian subgroups of A, then the HNN extension A * C,θ belongs to H ab .(4) If A is in H ab and A embeds as a finite-index subgroup in B, then B belongs to H ab .
Once we know that a group G as in Conjecture 1.2 does not have Baumslag-Solitar subgroups by Theorem A and [JZ21a, Theorem 1.1], G will be hyperbolic by the Bestvina-Feighn combination theorem [BF92].From this, we follow the outline of the proof of Wilton (while also incorporating Wise-Haglund's separability and structural properties of hyperbolic groups with a malnormal quasi-convex hierarchy [HW08,Wis21]) to prove the following generalisation.
Corollary D. Conjecture 1.2 holds for groups G belonging to the class H ab .This is proven in Theorems 11.1 and 11.2.There are several reasons why it is natural to study H ab , other than being a family that naturally incorporates other groups for which Conjecture 1.2 was solved.The consideration of hierarchies with abelian edges has provided a fruitful setting in which combination theorems for relevant classes of groups have been established: for coherent groups [Wis20, Corollary 5.4], for hyperbolic groups [BF92], for free groups [She55,Swa86,Sta91] and for parafree groups [JZM21].We pose a question that already seems to contain most of the difficulties that Conjecture 1.2 presents for more complicated group hierarchies.
Question 1.4.Let F be a finitely generated free group and let H be a finitely generated malnormal subgroup.Consider the double Γ = F * H=H F of the group F along its subgroup H.In particular, Γ is hyperbolic and virtually compact special by [Git97,Corollary 5.3] and [HW15,Corollary B].Is Conjecture 1.2 true for Γ?
Another class of groups where the conclusion of Theorem A ensures hyperbolicity is one-relator groups (by the advances of Louder-Wilton [LW22a,LW22b] and Linton [Lin22]).Corollary D covers some one-relator groups such as amalgamated products or HNN extensions of free groups along cyclic subgroups, which have the form Nevertheless, we do not know whether residually finite one-relator groups G with the same profinite completion as a free or surface group S necessarily satisfy G ∼ = S. Opportunely, Corollary E at least ensures that such Γ are hyperbolic and virtually special.
Corollary E. Let p be a prime and let G be a one-relator group in p-genus of a free or hyperbolic surface group.Then G is hyperbolic and virtually special.
Again we stress that Corollary E extends to other genera by [JZ21a, Theorem 1.1].Our last result is Theorem F, which provides infinitely many examples of groups that are determined within the class of residually free groups by their finite quotients.We extend this class of groups using similar methods in [Mor23] by looking at examples coming from three-manifold groups.
Theorem F. Let G be a finitely generated residually free group and let S be a free or surface group.Suppose that We prove this theorem in Section 7. The first step consists on showing that G and S ×Z n have isomorphic centre, for which we use the theory of L 2 -Betti numbers.This does not occur in general because Lubotzky proved in [Lub14, Proposition 1.5] that having a non-trivial centre is not a profinite property.As we mentioned above, our methods give an extension of Theorem F to direct products of free and surface groups, under the extra assumption of G being finitely presented, in a joint work with Fruchter [FM23, Theorem E].
1.2.Acknowledgements.The author is funded by the Oxford-Cocker Graduate Scholarship.This work has also received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (Grant agreement No. 850930).I am grateful to Andrei Jaikin-Zapirain introducing me to these questions on profinite rigidity and for suggesting Theorem C. I would like to thank Jonathan Fruchter, for many insightful conversations; Sam Hughes and Gareth Wilkes, for multiple corrections and suggestions; and also Alejandra Garrido and Pavel Zalesskii, for a helpful correspondence.Lastly, special thanks are due to my supervisors Dawid Kielak and Ric Wade for their stimulating guidance and for carefully reading this paper.1.3.Organisation of the paper.In Section 2 we revise some properties of profinite (and pro-p) groups and in Section 3 we study the induced prop topology on subgroups of nilpotent groups, proving Theorems B and C.Then, we show Theorem A in Section 4. Next, we review L 2 -Betti numbers in Section 5 and the structure of residually free groups in Section 6 to prove Theorem F in Section 7. In subsequent sections, we review the tools that are needed to establish Corollary D and Corollary E.

Pro-C groups, topologies and completions
A non-empty class of finite groups C is a formation if it is closed under taking homomorphic images and subdirect products.Given a finitely generated group Λ, we say that it is residually-C if, for all 1 = λ ∈ Λ, there exists N Λ such that λ / ∈ N and Λ/N ∈ C. In this case, following the terminology of [GZ11], we define the C-genus of Λ as the collection of finitely generated residually-C groups Γ with isomorphic pro-C completion Γ C ∼ = Λ C .Equivalently, the latter happens if Γ and Λ have the same collection of isomorphism types of finite quotients belonging to C (Theorem 2.4).We will mostly think of C as being the formations of all finite groups, all finite soluble groups, all finite nilpotent groups or all finite p-groups (for some prime p).In these cases, we refer to the C-genus as the finite, soluble, nilpotent and p-genus, respectively.Lastly, we say that a finitely generated residually finite Λ is profinitely rigid if the only Γ in its finite genus is Γ ∼ = Λ.
Notation 2.1.Given an abstract group Γ, we denote its profinite completion (resp.pro-p completion) by Γ (resp.Γ p ). Bold letters G, H, K, U will denote profinite groups.In addition, we write It will be important to keep in mind during the rest of the exposition the following theorem, which has already been discussed during the introduction.
Theorem 2.2 (Theorem 1.1, [JZ21a]).Let S be a finitely generated free or surface group.Suppose that G belongs to the finite, soluble or nilpotent genus of S. Then G belongs to the p-genus of S for all primes p.These inclusions between genera are not true in general, since Lubotzky [Lub14] showed that the properties of being residually soluble or residually-p are not profinite invariants.
2.1.Pro-C completions.We now fix a formation C of finite groups.A pro-C group can be defined as a profinite group G such that for all its open normal subgroups U o G, one has that G/U ∈ C. Alternatively, a pro-C group is just an inverse limit of groups belonging to C that is endowed with the profinite topology.
In order to relate residual properties of abstract groups and profinite invariants, we recall the pro-C completion functor.Given an abstract group G, its collection of quotients belonging to C is encoded in its pro-C completion G C .As an abstract group, it is defined to be the inverse limit of finite groups (1) Γ C is a pro-C group.
(2) The map ι C has dense image.
(3) For any pro-C group K and every group homomorphism f : Γ −→ K with dense image, there exists a continuous homomorphism f When we say that the pair (Γ C , ι C ) is unique, we mean the following: if H is a pro-C group and ι : Γ −→ H is a group homomorphism such that the pair (H, ι) verifies the three properties above, then there exists an isomorphism of pro-C groups α : We stress the fact that the previous discussion does not rely on whether ι C is injective (equivalently G is residually-C) or not.A priori the pro-C completion only captures information about finite quotients of G in C and not about how we can distinguish elements of G in these quotients.There are, for example, finitely generated residually finite groups with free pro-p completion for all primes p that are not residually-p for any prime p, such as the trefoil knot group a, b |a 2 b 3 .The philosophy that finite quotients of a group are encoded in their profinite completion is precised in the following folkloric theorem.
Theorem 2.4 (Dixon-Formanek-Poland-Ribes [DFPR82]).Let C be a formation of finite groups.Two abstract groups Γ and Λ have the same class of isomorphism types of quotients belonging to C if and only if So we can completely reformulate in terms of the pro-C completions what it means for a group to be in the C-genus of another one.This is important because now we have turned a bare collection of finite groups into a group and now we can do, say, group cohomology with this information.Crucially, this functor "pro-C completion" is right-exact.
Proposition 2.5 ([RZ00], Proposition 3.2.5).Let C be a formation that is closed under taking normal subgroups.Given a exact sequence of abstract groups of the form Given an injective map N −→ G, the question of whether the induced map N C −→ G C is also injective will be a crucial topic of discussion later in this section and during Section 3, especially with the aim of proving Theorem A. On the other hand, Proposition 2.5 also tells us that pro-C completions are better understood when studying quotients than when studying subgroups, as the following direct consequence exhibits.
Proposition 2.6 (Pro-C completion of a quotient).Let G be an abstract group and let N G be a normal subgroup.Suppose that C is a formation as in Proposition 2.5.Denote by ι : N −→ G the inclusion.Then the canonical and natural map is an isomorphism.
2.2.The notion of index in profinite groups.Given a profinite group G and a subgroup H, we will not need for our purposes to define the formal meaning of |G : H| as a supernatural number (as in, for example, [RZ00, Section 2.3]).
However, recall we say that p ∞ divides the index |G : H| if and only if for all n there exists a normal open U o G such that p n divides the index of HU/U in the finite group G/U.Observe that, if G is a pro-p group, then H c G has infinite index if and only if p ∞ divides the index |G : H|.However, for general profinite groups, the latter is much stronger, as the following example shows.
Example 2.7.The profinite group Z is canonically isomorphic to p Z p , where Z p denotes the additive part of the ring of p-adic integers (isomorphic to the pro-p completion of Z).So Z surjects in a natural way onto the profinite group p Z/pZ, where the kernel K is isomorphic to Z and will have an index in Z equal to the supernatural number p p. In particular, no prime p will satisfy that p 2 divides the index | Z : K|.

2.3.
Nilpotent groups and lower central series.The terms of the lower central series of a group G are defined recursively as Similarly, the terms of the p-lower central series of G are defined as The expression γ n Γ p may be ambiguous.We clarify that it means γ n G with G = Γ p , defined as a subgroup of Γ p (so we do not mean to denote the pro-p completion of γ n Γ).
A group G is nilpotent if there exists an integer c 0 such that γ c+1 G = 1.For example, abelian groups are nilpotent groups of nilpotency class 1.We will study the profinite and pro-p topology of nilpotent groups in Sections 2.4 and 3.
Proposition 2.8 ([DSMS99], Proposition 1.19 and Exercise 17).Let G be a finitely generated pro-p group.Then γ k G is a closed subgroup of G.
In fact, the previous is true for finitely generated profinite groups, although this is a much deeper result due to Nikolov and Segal [NS07, Theorem 1.4].
Lemma 2.9.Let Γ be a finitely generated group and let k 0 be an integer.Then the canonical map Γ/γ k Γ −→ Γ p /γ k Γ p is a pro-p completion map.
Proof.The group γ k Γ p are closed subgroups of Γ p by Proposition 2.8 and contain γ k Γ as a dense subgroup, so γ k Γ p is the closure of γ k Γ.By Proposition 2.6, the conclusion follows.
2.4.Induced profinite topologies.Given a formation C and a group G the full pro-C topology of G is defined to be the initial topology of the map G −→ G C .In other words, it is the smallest topology that contains among its open subsets all the cosets of U G such that G/U ∈ C. When C is the formation of all finite groups (resp.finite p-groups), we call it the profinite (resp.pro-p) topology.
Definition 2.12.Let C be a formation of finite groups.Assume that H G. Denote by ι : Observe that this is a transitive relation in the sense that whenever A B C, with A being pro-C embeddable into B and B being pro-C embeddable into C, then A is pro-C embeddable into C.Other than stating Proposition 2.11, we introduced the pro-C topology on abstract groups because it allows us to reformulate pro-C embeddability intrinsically in G as follows.
Lemma 2.13 (See [RZ00], Lemma 3.2.6).Let H G be two groups.Then H is pro-C embeddable into G if and only if the pro-C topology of G induces on H its full pro-C topology.
Observation 2.14.If H is finitely generated, in order to prove that the pro-C-topology of G induces the full pro-C topology of H, it suffices to check the following: For any characteristic subgroup We will show in Theorem 3.2 that subgroups of finitely generated nilpotent groups are pro-p embeddable.We finish this section by analysing some of its consequences (for instance, the fact that Hirsch lengths will be pro-p invariants of finitely generated torsion-free nilpotent groups).
Proposition 2.15.Let G be a finitely generated group such that the central quotients G/γ k G are torsion-free for all k.Then, for all primes p, G p is residually-(torsion-free nilpotent).In fact, the quotients G p /γ n G p are torsion-free for all n.
is a finitely generated torsion-free nilpotent group.We are going to prove that this is enough to conclude that its pro-p completion Γ p is torsion-free.The proof of the proposition would then be complete because the canonical map Γ p −→ G p /γ k G p is an isomorphism by Proposition 2.6.Now let Γ be a finitely generated torsion-free nilpotent group.Then Γ/Z(Γ) is also torsion-free (see [CMZ17, Corollary 2.22]).Then, iterating the previous observation, we deduce that the lower central series k c and some nonnegative integers n 1 , . . ., n c .
Notice that the canonical maps (γ k Γ) p −→ γ k Γ p are isomorphisms (for example, by Theorem 3.2).From this and Proposition 2.6, we derive that are isomorphisms of pro-p groups for all 1 k c (recall that these groups are, by Lemma 2.9, the pro-p completions of γ k+1 Γ/γ k Γ) So there is a lower central series of Γ p by closed subgroups p is torsion-free.So Γ p is torsionfree, as we claimed before.
It is not hard to see that the class of groups satisfying the assumptions of Proposition 2.15 is closed under taking free products.However, the following proposition ensures many one-ended examples as well.
Proposition 2.16.Let G be isomorphic to a RAAG or to a one-relator group F/ r such that if k is the biggest non-negative integer such that r ∈ γ k F , then r • γ k+1 F is not a proper power in γ k F/γ k+1 F .In these cases, G satisfies the assumptions of Proposition 2.15.In particular, this is true if G is a surface group.
The reason is the following.The main theorem of [Lab70] states that, under our assumptions on the relator r, the graded algebra n γ n G/γ n+1 G is a free Z-Lie algebra.In particular, the subsequent quotients γ n G/γ n+1 G are free abelian (the author also computes their rank).Since surface groups are defined by a single relator that satisfies the assumptions of r in Proposition 2.16, the last conclusion follows.
We observe that the class of one-relator groups of Proposition 2.16 includes many limit groups.For example, those arising as doubles F * u=u F of a free group F along a relator u ∈ F that satisfies the assumptions of r in Proposition 2.16.We remark in Remark 4.4 how this can be used to establish Theorem A for the p-genus of many hyperbolic limit groups, other than free and non-abelian surface groups.

Profinite and pro-p topologies on polycyclic groups
We return to analysing the structure and pro-p topology of nilpotent groups, as we initiated in Section 2.3.We prove Theorem 3.2 and Theorem 3.7 (which constitute Theorem C from the introduction) and then show Theorem 3.12 (Theorem B), which allows to witness polycyclic subgroups from the pro-p completion and plays a crucial role in the proof of Theorem A during Section 4.
It was proven by Hirsch [Hir46,Theorem 3.25] that polycyclic groups are residually finite, and Malcev later in 1948 proved that they are, in fact, LERF [Seg83, Exercise 11, Chapter 1].The former result of Hirsch has a pro-p variant for nilpotent groups, given by Gruenberg (Theorem 3.1), while Malcev's result does not.Still, it follows from Malcev's theorem the weaker property that the induced topology on subgroups of polycyclic groups is the full profinite topology.We study in Theorem 3.2 a pro-p version of this statement.Before stating it, we first review Gruenberg's result and some definitions.
Given a set of primes P and a non-negative integer n, we say that n is a P -number if all the primes dividing n are contained in P .We say that a group G is residually-P if, for all 1 = g ∈ G, there exists a prime p ∈ P and a finite-index normal subgroup U G, where |G : U | is a power of p, such that g / ∈ U .Notice that, by Cauchy's theorem, the set of primes P appearing as the orders of elements of a group G is exactly the smallest set of primes P such that every element with finite order in G has a P -number order.
(a) If G is torsion-free, then G is residually-p for all primes p.(b) Otherwise, let P be the (non-empty) collection of primes p that appear as orders of elements in G. Then G is residually-P .
3.1.Induced pro-p topology on nilpotent groups.Continuing the discussion at the beginning of the section, one may also try to extend the result of Malcev to the pro-p setting by, in the first place, figuring out a definition of p-LERF groups.A tentative definition is to say that a group G is p-LERF if all its finitely generated subgroups are closed in the pro-p topology.However, this may not be an interesting notion for infinite groups, since a virtually polycyclic group is p-LERF if and only if it is a finite p-group (see Remark 3.15).In any case, many infinite groups have the weaker property that the induced pro-p topology on subgroups is their full pro-p topology.We confirm this in the next theorem.
Theorem 3.2.Let G be a finitely generated nilpotent group and let H be any subgroup.Then the pro-p topology of G induces on H its full pro-p topology.
By Lemma 2.13, the previous condition on each H G is equivalent to the injectivity of the induced map H p −→ G p .Recall in this case we say that H is pro-p embeddable into G (Definition 2.12).Theorem 3.2 says that the functor "pro-p completion" is exact in the category of finitely generated nilpotent groups (since it is always right-exact by Proposition 2.5).Before the proof of Theorem 3.2, we will review how one can extract roots of subgroups in nilpotent groups in Proposition 3.4.Definition 3.3.Let G be a group, let P be a collection of primes and assume H G. We define the P -radical of H in G as the set R P (H) = {g ∈ G | there exists a P -number n with g n ∈ H}.
Proposition 3.4.Let G be a finitely generated nilpotent group and let H G. Then R P (H) is a subgroup of G and the finite index |R P (H) : H| is a P -number.
Proof.Let K be the subgroup generated by R P (H).Since G is noetherian, then K is finitely generated.So K is generated by a finite subset of R P (H).Then, by [CMZ17, Theorem 2.24], it follows that K = R P (H) and that H has a finite index in R P (H) which is a P -number.
Proof of Theorem 3.2.We divide the proof in two steps.First, we prove in Claim 3.5 that the conclusion follows if we additionally suppose that H is normal, and then we prove the general case when H is any subgroup.
Claim 3.5.The conclusion follows if H is normal in G.
Proof of Claim 3.5.We follow the strategy depicted in Observation 2.14.Let Λ H be a characteristic subgroup of H whose index |H : Λ| is finite and a p-power.In particular, Λ is normal in G. Let P be the collection of primes different from p.The subgroup N = R P (Λ) is normal in G and it contains Λ with finite-index.It is immediate to see that N ∩ H = Λ and that the finite group G/N does not contain elements of order coprime with p.The latter implies, by Theorem 3.1, that the nilpotent group G/N is residually-p.We have an injection HN/N ֒− → G/N , where HN/N is a finite subgroup.There exists a finite p-power index normal subgroup K G containing N such that K/N intersects HN/N trivially (or, equivalently, K ∩ HN = N ).Lastly, we check that K ∩ H = Λ, which would complete the proof of the claim.For this, observe that We now finish the proof of the theorem.Consider any subgroup H G. Let c denote the nilpotency class of G.By [Hal76, Theorem 10.3.3],there is an ascending chain Remark 3.6.Gareth Wilkes pointed out to the author another proof of Theorem 3.2.The argument can be sketched as follows.Let H be a subgroup of a finitely generated nilpotent group G. Since pro-nilpotent groups are direct products of their p-Sylows (see [RZ00, Proposition 2.3.8]),then there is a commutative diagram (1) where we denoted by ι : H −→ G the injection map and by ι p and ι the natural induced maps between profinite and pro-p completions, respectively.Since G is LERF, the map ι is injective and, consequently, ι p is also injective, as we wanted to prove.
3.2.Induced pro-p topology on polycyclic groups.As we anticipated, although the profinite version of Theorem 3.2 holds for virtually polycyclic groups, we state the following converse to the pro-p version that shows the limitations of this phenomenon outside of the world of nilpotent groups.
Theorem 3.7.Let G be a virtually polycyclic group.Suppose that for every prime p and every subgroup H G, the pro-p topology of G induces on H its full pro-p topology.Then G is nilpotent.
Theorem 3.7 in conjunction with Theorem 3.2 constitute Theorem C from the introduction.Before the proof of Theorem 3.7, we start with a chain of preliminary lemmas.
Lemma 3.8.Let P be a finite p-group and let Q be a finite q-group, with p and q being different primes.Let θ : Q −→ Aut(P ) be a group homomorphism and let G = P ⋊ Q be the corresponding semi-direct product.Then the following are equivalent: (1) The map θ is trivial.
(2) G is isomorphic to Proof.The equivalence between (1) and ( 2) is well-known and follows from the definition of semi-direct product (since Q is normal if and only if it is central).By [Hal76, Theorem 10.3.4], a finite group is nilpotent if and only it is a direct product of finite t-groups with t ranging over prime numbers.So the equivalence between (2) and ( 3) is also clear.We notice that if (1) is given, then (4) is obviously ensured.So it suffices to prove that (4) implies (1).We consider the trivial subgroup {1}, which has p-power index in P and it is normal.By assumption, there must exist a normal subgroup N G of p-power index such that N ∩ P ⊆ {1}, so N ∩ P = {1}.Since the index is coprime to q, then N is a q-Sylow subgroup of G, as well as Q.So N and Q are conjugated to each other by the second Sylow's theorem, which shows that Q is also normal and (1) follows.
Lemma 3.9.Let p be a prime.Suppose that N G and N H G have the property that the induced maps N p −→ H p and N p −→ G p are injective.Then, the induced map H p −→ G p is injective if and only if the induced map H/N p −→ G/N p is injective.
Proof.If the induced maps N p −→ H p and N p −→ G p are injective, we have, by Proposition 2.5, a commutative diagram of the form (2) where all the arrows are the natural ones and the rows are exact.A simple diagram chase gives the desired conclusion.
Lemma 3.10.Let P be a direct product P 1 × • • • × P m , where each P i is a finite p i -group and p i = p j if i = j.Suppose that q is a prime not belonging to the set {p 1 , . . ., p n } and let Q be a finite q-group.Let θ : Q −→ Aut(P ) be a group homomorphism and let G = P ⋊ Q be the corresponding semi-direct product.Then the following are equivalent: (1) The map θ is trivial.
(2) G is isomorphic to P × Q.
(4) The subgroup P is pro-p i embeddable into G for all i.
Proof.The equivalence between the first three items is established in the exact same way as in Lemma 3.8.Again, it is clear that (2) implies (4).We suppose now that (4) holds.For every 1 i n, we consider N i = j =i P j , which is a characteristic subgroup of G that is pro-t embeddable into P for all primes t.So N i is normal in G and, by Lemma 3.9, P/N i ∼ = P i is pro-p i embeddable into G/N i ∼ = P i ⋊ Q.By Lemma 3.8, the action of Q on P i is trivial.We have proven this for all i, so the action of Q on P is trivial and hence we have (2).
Lemma 3.11.Let G be a finite group such that for every subgroup H G and all primes p, the induced map Proof.We can prove this by induction on the order of G.When |G| = 1 or, in fact, when it is a finite p-group for some p, the statement is trivial.Suppose then that |G| is divisible by at least two primes p and q.We consider a p-Sylow P G (which exists by the first Sylow theorem).Since {1} is open in P , there must exist a normal subgroup N G of p-power index such that N ∩ P = {1}.Since p-subgroups of G can be conjugated into P (by the second Sylow theorem), then the order of N is coprime with p. Consequently, |P | = |G : N | and then G = N, P is isomorphic to a semi-direct product N ⋊ P .We know that |N | < |G| and then by the induction hypothesis, N is nilpotent and so a direct product of its Sylow subgroups.By Lemma 3.10, we conclude that G is nilpotent.
We have gathered all the ingredients required to show Theorem 3.7.
Proof of Theorem 3.7.By Lemma 3.9, any finite quotient Q of G will still have the property that for every subgroup H Q, the induced map H p −→ Q p is injective.So, by Lemma 3.11, every finite quotient of G is nilpotent.Finally, by a result of Hirsch (see [Seg83, Theorem 2, Chapter 1]), a virtually polycyclic group has the property that all its finite quotients are nilpotent if and only if it is nilpotent itself.So G is nilpotent.
3.3.Pro-p embeddability of polycyclic subgroups.We are ready to show that in residually-(torsion-free nilpotent) groups, polycyclic groups are pro-p embeddable (see Theorem 3.12 below).Before doing so, we remind the reader of several classical properties of the class of virtually polycyclic groups (we refer the reader to the book of D. Segal [Seg83] for a more thorough account).This class is closed under taking subgroups, quotients and extensions; they are noetherian (i.e.all their subgroups are finitely generated); and, crucially, that they are endowed with the useful notion of Hirsch length, which can be defined as follows.
Given a virtually polycyclic group G and a subnormal series is infinite is an invariant of such a series (by the Jordan-Hölder theorem).We call this number the Hirsch length of G, denoted by h(G).Recall that h(G) = 0 if and only if G is finite and that h(G) = h(N ) + h(G/N ) for all normal subgroups N G.In particular, a surjective map between torsion-free virtually polycyclic groups G 1 −→ G 2 with h(G 1 ) = h(G 2 ) must be an isomorphism.This will be important during the proof of the following.
Theorem 3.12 (Theorem B).Let G be a finitely generated residually-(torsionfree nilpotent) group and let H G be a virtually polycyclic subgroup.Then H is nilpotent and, for all primes p, the induced map H p −→ G p is injective.
Proof.Let ι : H −→ G denote the injection and let π n , for any positive integer n, denote the canonical projection π n : G −→ G/γ n G. Claim 3.13.There exists a positive integer n such that the composition We will show by induction on the Hirsch length of H the stronger statement that there exists a torsion-free nilpotent quotient G/N such that the projection π N : G −→ G/N is injective on H.This is trivial if h(H) = 0.If h(H) > 0, there exists a subgroup H 1 H with h(H 1 ) = h(H) − 1.By the induction hyphotesis, there exists a normal subgroup N G such that the surjection π N : G −→ G/N is injective on H 1 .In particular, h(π N (H)) h(H 1 ).If π N is already injective on H then we are done.Otherwise, there exists 1 = x ∈ H ∩ker π N .Since G is residually-(torsion-free nilpotent), there exists a normal subgroup K G such that π K : G −→ G/K is injective on the subgroup x ∼ = Z.Now look at the induced surjection of torsion-free nilpotent groups This implies that the surjection π N ∩K : H −→ π N ∩K (H) of torsion-free virtually polycyclic groups is injective, completing the proof of Claim 3.13.In particular, H is nilpotent.Now we are ready to show that the induced map H p −→ G p is injective.Let n 1 be an integer and consider the following natural commutative diagram. (3) The horizontal arrows are the canonical pro-p completion maps (the fact that the lowest arrow represents a pro-p completion map follows from Lemma 2.9).We can choose an n such that the map f n : H −→ G/γ n G is injective by Claim 3.13.Since G/γ n G is finitely generated and nilpotent, it follows by Theorem 3.2 that the induced f p is injective, too.In particular, ι p must be injective, as we wanted.
3.4.Induced pro-p topology on other infinite groups.The pro-p embeddability result of Theorem 3.12 is a key component of the proof of Theorem 4.1 on the 2-freeness of groups in the p-genus of a free or hyperbolic surface group.Here we introduce more context and motivation for the study of pro-p separability properties and their applications, building on the setting of profinite topologies, which so far has been investigated more deeply.There are geometric ways to produce families of LERF groups.Three big classes are limit groups [Wil08a], locally quasi-convex hyperbolic virtually compact special groups (which includes hyperbolic fundamental groups of graphs of free groups with cyclic edge subgroups Nevertheless, it seems very hard to use geometric methods to construct groups with good pro-p embeddability or separability properties on its subgroups (as, for example, finitely generated nilpotent groups enjoy by Theorem 3.2).These difficulties appear when constructing parafree groups (for which, so far, we only have cyclic hierarchies [JZM21]), when classifying residually nilpotent 3-manifolds (see [Wil08b, Question 2.12]) or when it comes to find the right pro-p analogue of limit groups [KZ11].On the other hand, there is research made on related principles, such as the virtual pefficiency of JSJ-decompositions of graph manifolds [AF13] and also of fibred 3-manifolds [Wil17, Theorem A].
Apart from their own intrinsic interest, the motivation for studying these pro-p separability principles is that they have a number of applications, for instance, on the residual properties and subgroup structure theory of pro-p completions of ICE groups [KZ11]; on the conjugacy p-separability of certain classes of three-manifold groups [Wil17, Theorems B and C]; on the profinite detection of JSJ decompositions of graph manifolds [Wil18a, Theorem A]; and on the profinite rigidity of direct products of free and surface groups [FM23, Theorem E].These properties are useful and singular, and we consider that one should try to understand the following problem.
Question 3.14.Let p be a prime.Are there finitely generated residually finite groups G that contain non-abelian free subgroups and have the property of Theorem 3.2, i.e. that, for all finitely generated H G, the pro-p topology of G induces on H its full pro-p topology?Remark 3.15.Recall that a group is p-LERF if all its finitely generated subgroups are closed in the pro-p topology.As we mentioned above, this property is too strong in the universe of infinite groups, since it does not even hold in Z (because pZ is not a closed subgroup in the pro-q topology for any prime q = p).In fact, for similar reasons, a virtually polycyclic group is p-LERF if and only if it is a finite p-group.For a more general infinite group G that is p-LERF, we can prove that all its finite quotients are p-groups (as in the proof of Theorem 3.7).Equivalently, this means that its profinite completion is a pro-p group.However, the property of being p-LERF is stronger than that of having a pro-p group as profinite completion.In fact, Francoeur and Garrido [FG18] showed that all Sunic groups (with the exception of the infinite dihedral group) have the property that their profinite completion is a pro-2 group and, if they are not torsion, then they contain maximal finitely generated subgroups that are dense in the profinite topology (and hence they are not 2-LERF).Fernández-Alcober, Garrido and Uria-Albizuri [FAGUA17] had already found examples with similar properties among GGS groups (standing for Grigorchuk-Gupta-Sidki groups).They provide examples of finitely generated, residually finite and torsion-free groups G whose profinite completion is a pro-p group.Nevertheless, it is not clear to the author whether these groups are p-LERF.
The author is grateful to Alejandra Garrido for clarifying the picture that we describe in Remark 3.15.

The p-genus of free or surface groups
In this section we prove Theorem A from the introduction, although here he state it and prove it as part of a more general dichotomy on subgroups.
Theorem 4.1.Let p be a prime and let S be a free or hyperbolic surface group.Suppose that G is a finitely generated residually-p group with G p ∼ = S p .Assume that H G. The following holds.
If H is finitely presented and non-cyclic, then it is large.
The property (i) of this theorem will follow from (ii) by the following lemma.
Lemma 4.2.Let G be a finitely generated residually-(torsion-free polycyclic) group and let H G be locally-cyclic.Then H is either trivial or infinite cyclic.
Proof.If H is finitely generated, then the conclusion follows immediately.We proceed by contradiction.Suppose, otherwise, that H is not finitely generated.Take 1 = h 1 ∈ H. Since H is locally cyclic but not cyclic, there exists a 2 / ∈ h 1 and also h 2 ∈ H such that h 2 = h 1 , a 2 .So there exists n 1 ∈ Z with h n 1 2 = h 1 and, due to the fact that a 2 / ∈ h 1 , we derive that |n 1 | > 1. Iterating this process, we show that then there must exist a sequence (h i ) i 1 in H of non-trivial elements and a sequence of integers (n i ) i 1 with |n i | > 1 such that h n i i+1 = h i for all i 1.Let φ : G −→ Q be a surjective map to a torsion-free polycyclic group Q such that φ(h 1 ) = 1 (and hence φ(h i ) = 1 for all i).Now consider the ascending chain of subgroups this implies that φ(h k+1 ) has finite order in Q, and so φ(h k+1 ) = 1, which is a contradiction.
Before proving Theorem 4.1, we state the following well-known principle.
Lemma 4.3.Let S be a non-abelian free or surface group.Suppose that H is a topologically two-generated closed subgroup of S p .Then H is a free pro-p group.
Proof.If S is free, this follows from Theorem 8.5.If S is a hyperbolic surface group of genus g, then the abelianisation of S has rank 2g 4.This implies that the image of H in the abelianisation of S p has infinite index and, in particular, H already had infinite index in S p .By Lemma 8.7, cd p (H) 1. Lastly, again by Theorem 8.5, H is a free pro-p group.
Proof of Theorem 4.1.We first explain how the property (i) follows from (ii).Remark that amenable groups cannot contain non-abelian free subgroups.So, if H is amenable, then, by property (ii), H is locally cyclic.In addition, G is a subgroup of G p , which is residually-(torsion-free nilpotent) by Proposition 2.16.Finally, by Lemma 4.2, H is cyclic.Now we move on to prove (ii).Let S be a free or surface group and suppose that G belongs to the p-genus of S. The statement is clear when S ∼ = Z because, in this case, G ∼ = Z.Let us suppose that S is a non-abelian free group or a hyperbolic surface group.Let H G be a two-generated subgroup.We separately analyse two cases, depending on whether H is abelian or not.
(a) Firstly, consider the case when H is non-abelian.We consider H ⊆ G p .By Lemma 4.3, H is a two-generated free pro-p group.Notice that H H is not abelian, so the rank of H has to be exactly equal to two and then H is the free pro-p group of rank 2. Let x and y be two elements that generate H, then x and y are topological generators of H and hence, by the Hopfian property, they are also free topological generators of H.In particular, the group H generated by x and y is free of rank two, as we wanted.(b) Lastly, suppose that H is abelian.By Theorem 3.12, the induced map 1 (H) b (2) Thus H is a finitely presented residually-p group with b (2) 1 (H) > 0 and, by [Lac10, Theorem 1.6], it is large.
Remark 4.4.We should note that our methods can also establish parts (i) and (ii) of Theorem 4.1 for other hyperbolic limit groups S. For example, one can take S to be the free product S = S 1 * • • • * S n , with each S i ∼ = F i * u i =u i F i is the double of a free group F i along a relator u i ∈ F i that satisfies the same assumptions as r in Proposition 2.16.The pro-p completion S p will be residually-(torsion-free nilpotent) by Proposition 2.15 and, by the proof of [KZ11, Theorem 7.3], the 2-generated subgroups of S p are cyclic or free pro-p.So our proof of Theorem 4.1 applies to such S to show parts (i) and (ii).

The first L 2 -Betti number as a pro-C invariant
We will describe some scenarios in which the first L 2 -Betti number of a group G, denoted by b (2) 1 (G), is a profinite invariant.This plays an important role in the proof of Theorem F. An standard reference about L 2 -invariants is the book of Lück [Lüc02] and, in alignment with the approach taken in this section, the survey paper of Jaikin-Zapirain [JZ19].
For torsion-free groups G satisfying the Strong Atiyah conjecture, Linnell [Lin93] shows that one can define b (2) 1 (G) as follows.Suppose that the group ring QG of G with rational coefficients has a universal division ring of fractions QG ֒− → D QG .This provides a notion of dimension for all QG-modules as follows: given a left QG-module M , we extend scalars D QG ⊗ QG M and take its linear-algebraic dimension as a left D QG -module.We can define the first L 2 -Betti number for these groups G as Since locally indicable groups satisfy the Strong Atiyah conjecture by a result of Jaikin-Zapirain and López-Álvarez [JZL19], the previous is a definition of b (2) 1 for these groups.A general philosophy that explains why we work with first L 2 -Betti numbers instead of usual Betti numbers is that the former behave in a better way while containing similar information.For example, they are multiplicative in the following sense.
Proposition 5.1 (Theorem 1.35(9), [Lüc02]).Let G be a finitely generated group and let H be a finite-index subgroup.Then b (2) 1 (G) as a limit of (normalised) usual Betti numbers over a filtration of G by normal finite-index subgroups.A pioneering result in this direction is due to Lück [Lüc94].
Theorem 5.2 (Lück's approximation theorem).Let G be a group of type Importantly, for residually-finite groups that are not FP 2 , we still have a one-sided estimate of the same type.

Theorem 5.3 ([LO11]). Let G be finitely generated and let
We move on to the observation that groups G satisfying the following inequality also have a Lück approximation theorem: 1 (G 0 ) + 1 for every finite-index G 0 G. Examples of groups G with this property are limits of left-orderable amenable groups in the space of marked group presentations (by a result of Osin [OT11, Theorem 1.4]).Interestingly, the property of (4) can be proven in greater generality.

Residually free and limit groups
The purpose of this section is reviewing separability and structural properties of residually free groups and a criteria to detect hyperbolic and limit groups among them.In Section 9, we will see to what extend some of these strong features are still true in some of the groups of the class H ab .Proposition 6.1 relates the structure of finitely generated residually free groups to the structure of limit groups.Proposition 6.1 ([BMR99], Corollary 19; and [Sel01], Claim 7.5).Let G be a finitely generated residually free group.Then G is a subdirect product of finitely many limit groups.
A classical question attributed to Gromov asks whether one-ended hyperbolic groups must contain surface subgroups, and Wilton answers this question positively for many cyclic splittings in the following way.Theorem 6.2 ([Wil18b], Theorem 6.1).Let G be the fundamental group of a graph of virtually free groups and virtually cyclic edge subgroups.Suppose that G is hyperbolic and one-ended.Then G contains a surface subgroup.
As proven in [Wil18b, Corollary C], the theorem above can be applied, in combination with Sela's hierarchy on limit groups [Sel01], to find surface subgroups in non-free limit groups.Theorem 6.2 is slightly improved by Fruchter and the author [FM23, Theorem A].
6.1.Criterion for the hyperbolicity of residually free groups.We state a criterion that helps to recognise a hyperbolic group given a cyclic splitting.It is a consequence of the combination theorem for negatively curved groups of Bestvina-Feighn [BF92].Theorem 6.3.Let (G, Y ) be a finite graph of groups with hyperbolic vertex groups and virtually cyclic edge subgroups.Then its fundamental group π is hyperbolic if and only if it contains no Baumslag-Solitar subgroups.
This combination theorem was used by Sela [Sel01, Corollary 4.4.(iii)] to show that a limit group is hyperbolic if and only if it contains no Z 2 .This criterion can be extended to residually free groups as in the following result.Proposition 6.4 ([BCR14], Lemma 4.15).Let G be a finitely generated residually free group.Then G is a hyperbolic limit group if and only if it contains no Z 2 .6.2.Separability properties.Wilton [Wil08a] proved that finitely generated subgroups of limit groups are quasiconvex and separable by establishing the following stronger property.Definition 6.5.Let A be a subgroup of B. We say that A is a virtual retract of B if there exists a finite-index subgroup B 1 of B containing A and a group homomorphism r : B 1 −→ A such that r restricts to the identity function on A. Theorem 6.6 ( [Wil08a]).Let G be a limit group and let H be a finitely generated subgroup.Then H is a virtual retract of G.
This principle was later extended to subgroups of type FP of finitely generated residually free groups by Bridson-Wilton [BW08, Theorem B].In the following section we treat other classes of groups with similar retraction properties (see Theorem 9.3).

Proof of Theorem F
In this final section we prove Theorem F. Let us review the statement.
Theorem 7.1 (Theorem F).Let G be a finitely generated residually free group and let S be a free or surface group.Suppose that We will state two lemmas that we will use during the proof of Theorem F. The first allows us to prove that the centre of a residually free group is a profinite invariant.Lemma 7.2 ([Bau67a], Lemma 4).Let G be a residually free group.Then G/Z(G) is a residually free group with trivial centre.
The second lemma is a profinite criterion that detects when short exact sequences split.It was used by Wilton-Zalesskii [WZ17] to distinguish circle bundles over the surface by looking at finite quotients of their fundamental group (later on used in dimension 4 by Jiming-Zixi [MW22, Proposition 25]).
Lemma 7.3 ([WZ17], Lemma 8.3).Let n 0 be an integer and let S be a surface group.Let be a central extension of S by the group Z n .Suppose that the induced short sequence in profinite completions is also exact and that it splits.Then the sequence (6) splits, too.
We remark that the exactness of ( 7) is always ensured if (6) is exact, by the goodness of S (as observed by Serre [Ser97, Chapter 1, Section 2, Exercise 2(b)]).However, we stated this as an assumption for clearness, as it is also enough for our application.Regarding this lemma of Serre, we also refer the reader to [Lor08, Proposition 2.4] for a precise proof and a converse.
Proof of Theorem F. Let S be a free or surface group and let G be a finitely generated residually free group in the finite genus of S × Z n .If S is abelian, then it is clear that G ∼ = S × Z n .So we can suppose that S is hyperbolic and non-abelian.In particular, b for some naturally defined f and g from the canonical maps ι, p and r.We can read off from the diagram that g • f is injective, so f is injective, too.This implies that Z(G) is a subgroup of the finitely generated abelian group G/[G, G], so it is finitely generated, too.Now we consider a second natural commutative diagram: (9) We know that f is injective, so f is also injective (since finitely generated abelian groups are LERF).Thus ι is injective and Claim 7.4 is proven.
Claim 7.5.The profinite group Z( G)/Z(G) is the profinite completion of a finitely generated abelian group A.
The image of ι can be alternatively described as the closure of Z(G) ֒− → G and it is easy to see that it is a normal subgroup of G that is contained in Z( G) = Z n .We consider the group H = G/Z(G), which is a finitely This proves Claim 7.6.Since H = G/Z(G) is a finitely generated residually free group and H ∼ = S by Claim 7.6, it follows from the work of Wilton [Wil18b,Wil21] that H ∼ = S.
Claim 7.7.The short exact sequence The proof of the claim would complete the proof of Theorem F. This claim is obvious when S is free and, when S is a surface group, it is a direct consequence of Lemma 7.3.

Cohomological dimension and Poincaré duality
Here we recall the finiteness properties of groups that we shall use.We denote by R a unital and associative ring (not necessarily commutative).
Definition 8.1.We say that an R-module M is of type FP n (R) if there exists a projective resolution with P i finitely generated for 0 i n.Moreover, we say that an R-module M is of type FP ∞ (R) if it is of type FP n (R) for all n.Analogously, we say that a group G is of type FP n (R) (resp. of type FP ∞ (R)) if the trivial RG-module R is of type FP n (R) (resp. of type FP n (R) for all n).8.1.Profinite groups.We refer the reader to [NSW08, Chapter 2, Section 7] for details about the cohomology theory of profinite groups with profinite coefficient modules.Computations on profinite group cohomology can be reduced to analogous computations on abstract group cohomology via Serre's fundamental notion of goodness [Ser97, Section I. 2. 6].A group is said to be cohomologically good (or simply good) if for every finite discrete G-module A, the natural homomorphism induced by G −→ G, is an isomorphism.A group G is said to be subgroup separable or LERF (standing for locally extended residually finite) if every finitely generated subgroup H G is closed in the profinite topology.This implies that the topology induced on H from the profinite topology of G is the full profinite topology of H. Hence, by Lemma 2.13, if G is LERF, then the natural map H −→ H ⊆ G is an isomorphism of profinite groups for all finitely generated H G. Given a profinite group G, the completed group algebra of G over Z p is a profinite ring defined as the inverse limit of the usual group rings Z/p i Z [G/U], where i 0 and U ranges over open normal subgroup of G.We say that G is of type p-FP n if the ZG -module Z (resp.the Z p G -module Z p ) is of type FP n .Proposition 8.2 ([JZ18], Proposition 3.1).If Γ is an abstract FP ∞ and good group then its profinite completion Γ is of type p-FP ∞ for every prime p.
Recall we say a module M is simple if and only if it has exactly two submodules.
Definition 8.3.We say that a profinite group G has p-cohomological dimension n = cd p (G) if n is the largest non-negative integer m such that H m+1 (G, A) = 0 for all simple discrete ZG -modules that are annihilated by p.
Recall from [Ser97, Corollary 1 of Chapter 3, and Proposition 21] that if G p is the p-Sylow of a profinite group G, then cd p (G) = cd p (G p ). Good groups G enjoy the convenient property that cd p ( G) = cd p (G) for all primes p.In particular, a free profinite group has cd p = 1 and profinite surfaces have cd p = 2.We should remark that focusing on p-primary modules in the Definition 8.3 of the "cohomological dimension function" cd p allows to avoid the pathology of H 2 ( Z; Z) being non-zero (as this is isomorphic to H 1 ( Z, Q/Z) ∼ = Q/Z [Ser97, Chapter 1, Section 3.2]).The dimension function cd p enjoys nice "geometric" properties.For example, by Shapiro's lemma given a closed subgroup H of a profinite group G, we have cd p (H) cd p (G) (see [RZ00, Theorem 7.3.1]).Furthermore, cd p is sometimes additive with respect to short exact sequences (as reflected by [WZ04, Theorem 1.1]).
A classical characteristic feature of groups of finite cohomological dimension is the following well-known lemma.
Lemma 8.4.Let G be a profinite group with cd p (G) < ∞ for all primes p. Then G is torsion-free.This is esentially the only tool we have to recognise torsion-freeness of an abstract group from the profinite completion.Interestingly, Lubotzky shows that being torsion-free is not a profinite property ([Lub14, Proposition 1.5]).The following is the analogous theorem of Stallings' [Sta68] and Swan's [Swa69] for the category of pro-p groups.
Theorem 8.5 (Theorem 7.7.4,[RZ00]).Let G be a pro-p group with cd p (G) 1.Then G is a free pro-p group.8.2.Poincaré Duality and the recognition of surfaces.Eckman and Müller [EM80] proved that surface groups are the only Poincaré duality groups of dimension two.Before discussing the analogous principles for profinite groups, we recall the following definition.Definition 8.6.Let G be a profinite group of type p-FP ∞ .We say that G is a Poincaré duality group at p of dimension n (written as PD n at p) if cd p (G) = n and  [Dem61,Dem63,Ser62,Lab67].However, this question is poorly understood for general profinite groups.Similarly, it is not known whether a finitely generated residually finite group whose profinite completion is PD 2 at a prime p is itself PD 2 .Wilton [Wil21] showed that if such group is additionally residually free then it is a surface group, which we restate in Proposition 8.10.This has been recently generalised in [JZM23] with a different argument.In order to restate Wilton's criterion, we require the following profinite variant of Strebel's theorem [Str77] on infinite-index subgroups of PD n abstract groups (which can be found in [Ser97, Page 44, exercise 5(b)] and [NSW08, Chapter 3, Section 7, Exercise 3]).
Lemma 8.7 (Serre).Let G be a profinite PD n group at a prime p and let H be a closed subgroup such that p ∞ divides the index |G : H|.Then cd p (H) < n.
The previous lemma was of fundamental importance in the work of Wilton-Zalesskii [WZ19] on the profinite detection of prime and JSJ decompositions of three-manifolds.
Remark 8.8.When G is a pro-p group, Lemma 8.7 only requires H to have infinite index.Nevertheless, for general profinite groups G, the conclusion of the theorem would not be true by only requiring infinite index.In fact, from Example 2.7, we know that Z, which is PD 1 at p, contains closed subgroups isomorphic to Z of index p p.
The most natural source of examples of profinite Poincaré duality groups consists of profinite completions of abstract Poincaré duality groups, as the following result from [KZ08, Theorem 4.1] ensures.Theorem 8.9.Let Γ be an abstract cohomologically good PD n group.Then Γ is a profinite PD n group at every prime and Γ p is PD n at p. Finally, we are ready to give a more refined criterion to detect surfaces, used by Wilton [Wil21] to establish ?? when G is a limit group.Proposition 8.10.Let p be a prime and let G be a torsion-free residually finite group with separable cyclic subgroups such that its profinite completion G is PD 2 at p. Suppose that G contains a surface subgroup as a virtual retract.Then G is a surface group.
Proof.By assumption, there exists a finite-index subgroup L of G containing a surface group π 1 Σ as a retract.Let K be the kernel of the retraction L −→ π 1 Σ.Our aim is to prove that K = 1.This way, we would have that L ∼ = π 1 Σ and that the torsion-free group G would be virtually a surface group.So the conclusion would follow from Kerckhoff's solution to the Nielsen realisation problem for surfaces.
Hence, it remains to show that K = 1.We proceed by contradiction.Suppose that K = 1.The retraction at the level of the profinite completions.Take 1 = k ∈ K. Since G is torsion-free and cyclic subgroups are separable, then k ∼ = Z and the supernatural number p ∞ divides the order of k also divisible by p ∞ .We now claim that p ∞ also divides the index | L : π 1 Σ|.This way, it would also divide the index | G : π 1 Σ| and, by Lemma 8.7, the p-cohomological dimension of π 1 Σ should be at most cd p ( G) − 1 = 1, which is a contradiction.Thus, it simply remains to prove that p ∞ divides | L : π 1 Σ|.From the comments above, we know that, for every n 1, there exists a characteristic open subgroup U o K such that p n divides |K : U|.We observe that is an open subgroup of L. After taking a normal open subgroup H 0 o L contained in H (for example, its core), we are going to check that p n divides | L : H 0 • π 1 Σ|.For this, is suffices to notice that the previous index is divisible by We chose U so p n divides |K : U|, so this proves that p ∞ divides | L : π 1 Σ|, as we wanted.
For the purpose of proving Corollary D using Proposition 8.10, we remark that the profinite completion of a surface π 1 Σ is PD 2 at p for all primes p.

Hyperbolic and special groups
The study of special cube complexes was initiated by Haglund-Wise in their seminal paper [HW08] and plays a fundamental role in the solution of many results about three-manifolds, such as Agol's proof of the virtual Haken conjecture [Ago13].We refer the reader to the book of Aschenbrenner-Friedl-Wilton [AFW15] for more examples and discussion.A group is said to be special (resp.compact special) if it is the fundamental group of a non-positively curved (resp.compact) cube complex that satisfies Haglund-Wise's special condition on its hyperplanes.We will not delve into this definition because we are only interested in the retraction properties of these groups (as reflected by Theorem 9.3) and their consequences in the proof of Corollary D. Nevertheless, in order to offer a more precise idea of what these groups look like, we recall the following alternative description.
Theorem 9.1 ([HW08], Theorem 4.2).A group G is special (resp.compact special) if and only if it is a subgroup (resp.a quasiconvex subgroup) of a right-angled Artin group.
As anticipated in the introduction, many groups from H ab will be hyperbolic and virtually compact special.Proposition 9.2.Let G be a group belonging to H ab with the following properties: (1) It is torsion-free.
Then G is hyperbolic and virtually compact special.
Proof.The group G is hyperbolic by Theorem 6.3.Now the conclusion that G is virtually compact special follows directly from Wise's classification of hyperbolic groups with a malnormal quasi-convex hierarchy [Wis21, Theorem 11.2].
From the proof of [HW08, Theorem 7.3], we know that quasi-convex subgroups of hyperbolic compact special groups are virtual retracts (recall Definition 6.5).
Theorem 9.3.Let G be a hyperbolic virtually compact special group and let H G be a quasi-convex subgroup.Then there exists a finite-index subgroup We can use Wilton's partial solution to Gromov's surface conjecture (Theorem 6.2) to find surface subgroups in certain groups of H ab that will be relevant for the proof of Corollary D. Proposition 9.4.Let G be as in Proposition 9.2.Suppose that G is not free.Then G contains a surface subgroup as a virtual retract.
Proof.By Proposition 9.2, G is hyperbolic and virtually compact special.So, by Theorem 9.3, in order to conclude that G contains a hyperbolic surface subgroup as a virtual retract, it is enough to ensure that G contains a quasi-convex surface subgroup.Furthermore, we know that for finitely generated subgroups of a hyperbolic group, being quasi-convex and quasiisometrically embedded is equivalent.Hence, it suffices to ensure that there exists a quasi-isometrically embedded surface subgroup in G to prove Proposition 9.4, which we prove by induction on the level of the hierarchy.
Let us start with the level 0, that is, when G is a finitely generated residually free group.Since G contains no Z 2 , then G is limit by Proposition 6.4 and the statement follows directly from Theorem 6.2.Now we establish the inductive step by distinguishing two cases.
• Suppose that G = A * C B (resp.G = A C,θ for some injection θ : C −→ A), where A and B (resp.A) are groups in H ab for which the statement holds and C is cyclic.Since both A and B are quasiisometrically embedded in G (for example, by [Kap01, Theorem 1.2]), then G will contain a quasi-isometrically embedded surface if at least one of A or B does.So it remains to ensure the conclusion in the case when A and B (resp.A) are free.Viewing G as the fundamental group of a graph of two free groups (resp.one free group) with infinite cyclic edge groups, we apply a variant of Shenitzer's theorem [Wil12,Theorem 18] to deduce that, if G is not one-ended, then some vertex will split freely relative to its incident edge groups.In particular, applying this result a finite number of times (and taking out an infinite cyclic free factor of G each time), we deduce that G is isomorphic to the free product F * G ′ for a free group F and a one-ended group G ′ = A ′ * C B ′ (resp.G = A ′ C,θ for the injection θ : C −→ A ′ ), where A ′ and B ′ are free factors of A and B (resp.A ′ is a free factor of A).Since G was hyperbolic, and G ′ is a quasiconvex subgroup, then G ′ is also hyperbolic.So G ′ is a hyperbolic one-ended fundamental group of a graph of free groups with cyclic edges.By Theorem 6.2, the group G ′ (and hence also G) contains a quasi-convex surface subgroup.
• Suppose that G has a finite-index subgroup H ∈ H ab for which the statement is already true.Since G is torsion-free and not free, then H is not free by [Sta68,Theorem 2].So H (and hence also G) must contain a surface subgroup that is a virtual retract.

Pro-p detection of algebraic and topological properties
We recall that by Theorem 2.2, groups in the finite, soluble or nilpotent genus of a free or surface group S, do belong to the p-genus of S for all primes p.So all the results here about any p-genus of S include all these genera.10.1.Lücky groups.It is generally not well understood if being Lücky (Definition 5.6) is a profinite invariant (see Question 10.2 below).However, Jaikin-Zapirain [JZ21a] can answer affirmatively to this question for the genera of free and surface groups as a consequence of the following.
Proposition 10.1.Let S be a free or surface group and let G be an abstract subgroup of S p .Then G is Lücky.
It is not difficult to see that the previous G have to be RFRS (there is, in fact, a stronger statement in [JZ21a, Proposition 4.1]).
This relates the question of whether being RFRS is a profinite property.
Question 10.3.Let Γ and Λ be finitely generated residually finite groups with Γ ∼ = Λ.If Γ is RFRS, does it follow that Λ is RFRS?10.2.Hyperbolic and special groups.Here we see how Theorem 4.1 allows us to study when groups from H ab (Definition 1.3) or one-relator groups can be proven to be hyperbolic and virtually special by looking at their pro-p completion.
Corollary 10.4.Let p be a prime and let G be a group in the class H ab that belongs to the p-genus of a free or hyperbolic surface group.Then G is hyperbolic and virtually compact special.
Proof.By Theorem 4.1, G is torsion-free, contains no Baumslag-Solitar groups and contains no non-cyclic abelian subgroups.Hence, by Proposition 9.2, G is hyperbolic virtually compact special.
Recently, Linton [Lin22,Theorem 8.2] established that all one-relator groups with no negative immersions are hyperbolic and virtually special.By [LW22a, Theorem 1.3], a one-relator group that is two-free has no negative immersions.Hence the following is a consequence of these results and Theorem 4.1.
Corollary 10.5 (Corollary E).Let G be a one-relator group that belongs to the p-genus of a free group or a hyperbolic surface group.Then G is hyperbolic and virtually special.

On the profinite rigidity of free and surface groups
We are now ready to establish the profinite rigidity of free and surface groups within the family H ab .The proof of Corollary D is divided in Theorem 11.1 and Theorem 11.2.
Theorem 11.1.Let G be a group belonging to the class H ab and let F be a finitely generated free group.If G is residually finite and G ∼ = F , then G ∼ = F .Proof.Since free groups are distinguished from each other by their abelianisation, it suffices to show that G is free.Let G be a group in H ab that belongs to the finite genus of a free group F .By [JZ21a, Theorem 1.1], G also belongs to the p-genus of F .Consequently, by Corollary 10.4,G is hyperbolic virtually compact special.To prove that G is free, we proceed by contradiction.Suppose that is G is not free.Then, by Proposition 9.4, there exists a surface subgroup π 1 S that it is a virtual retract of G.In particular, π 1 S ֒− → G ∼ = F .This implies by the goodness of the surface π 1 S and the monotonicity of cd p the following contradiction: 2 = cd p (π 1 S) = cd p ( π 1 S) cd p ( F ) = 1.
Theorem 11.2.Let G be a group belonging to the class H ab and let π 1 Σ be the fundamental group of a closed orientable surface.If G is residually finite and G ∼ = π 1 Σ, then G ∼ = π 1 Σ.
Proof.Since surface groups are distinguished from each other by their abelianisation, it suffices to show that G is a surface group.Let G be a group in H ab that belongs to the finite genus of a free group π 1 Σ.By [JZ21a, Theorem 1.1], G also belongs to the p-genus of π 1 Σ.Consequently, by Corollary 10.4,G is hyperbolic virtually compact special.Since G cannot be free, it follows from Proposition 9.4 that there exists a surface subgroup π 1 S that it is a virtual retract of G. Lastly, by Proposition 8.10, G is a surface group.
) |G : H|. 5.1.Estimations using Lück approximation.When it comes to relate the first L 2 -Betti number b (2) 1 (G) of a group G to its profinite completion G, it is particularly helpful the characterisation of b ) > 0 and S has trivial centre.We denote by ι : Z(G) ֒− → G the canonical injection.Claim 7.4.The centre Z(G) is a finitely generated subgroup of G and the induced map ι : Z(G) −→ G is injective.To prove the claim, first recall that Z( G) = Z n is a retract of G. Denoting this retraction by r : G −→ Z( G), we have the following natural commutative diagram: Let Γ be an abstract group.Let ι C : Γ −→ Γ C be the canonical map.The data (Γ C , ι C ) is characterised by the following properties.
Notation 2.10.When the formation C is understood from the context, we writeH c G or H o G (resp.H c G or H o G) to denote that the A useful result that relates the open subgroups of a group G with the open subgroups of G in a explicit way is the following correspondence.Proposition 2.11 ([RZ00], Proposition 3.2.2).Let G be a residually-C group and identify G with its image in injective.Moreover, by Lemma 4.3, H p is free.Hence H p is a cyclic pro-p group and H is cyclic.
The previous shows (ii).Finally, we explain how (iii) follows.Let H be a non-cyclic finitely presented subgroup.By (i), H is not abelian, so H S p is not abelian either.The pro-p group H must either be a non-abelian free pro-p group or an open subgroup of S p .In any case, H is isomorphic to the pro-p completion of a non-abelian free or surface group S ′ .By Corollary 5.7, b as abelian groups).These denote the continuous cochain cohomology groups in the sense of [NSW08, Definition 2.7.1].A pro-p group G is PD 1 if and only if G ∼ = Z p (see [SW00, Example 4.4.4]) and Poincaré duality pro-p groups of dimension 2 are known to coincide with the class of Demushkin groups (see [Ser97, Section I.4.5, Example 2]), which is a class of one-relator pro-p groups that was classified by Demushkin, Serre and Labute