368ef2ac236d3b29.tex
1: \begin{abstract}
2: 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 $H\leq 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. 
3: 
4: Then we study applications to profinite rigidity. Remeslennikov conjectured that  a finitely generated residually finite $G$ with profinite completion $\hat G\cong \hat S$ is necessarily $G\cong S$. We confirm this when $G$ belongs to a class of groups $\Hia$ 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 $S\times \Z^n$ is profinitely rigid within finitely generated residually free groups. 
5: \end{abstract}
6: