I apologize if this question is basic in some sense. I was looking for an example of a non-proper HNN-extension and I found [this](https://mathoverflow.net/questions/405536/examples-of-non-proper-profinite-hnn-extensions).


In the comments, markvs mentioned the Baumslag-Solitar group $B(2,3)$. We can show that this is non-Hopfian using Britton's lemma so that is not residually finite. So, its natural try to use this to get a non-proper example. We know also that $B(2,3)$ is an HNN-extension of $\Bbb{Z}$ with respect to the natural $f: \langle a^2 \rangle \to \langle a^3 \rangle$. Now, how to proceed now? I mean, there is a way to decompose $\widehat{B(2,3)}$ as an HNN-extension of $\widehat{\Bbb{Z}}$ or something?


Intuitively, makes sense to me to do $B(2,3) = \operatorname{HNN}(\Bbb{Z})$ then $\widehat{B(2,3)} = \operatorname{HNN}(\Bbb{\widehat{Z}})$, but I don't know if it works.



Profinite completion of Baumslag-Solitar group as a profinite HNN-extension
The largest residually finite quotient of $\mathrm{BS}(2,3)$ is the semidirect product $\mathbf{Z}\ltimes\_{2/3}\mathbf{Z}[1/6]$.


So, if I'm correct, its profinite completion is
$$\widehat{\mathbf{Z}}\ltimes\_{2/3}\widehat{\mathbf{Z}[1/6]}.$$


Each time, the $2/3$ means that the generator $1$ acts by multiplication by $2/3$. Denoting by $P$ the set of primes, note that $\widehat{\mathbf{Z}}=\prod\_{p\in P}\mathbf{Z}\_p$ and $\widehat{\mathbf{Z}[1/6]}=\prod\_{p\in P-\{2,3\}}\mathbf{Z}\_p$. The group of automorphisms of the latter is also profinite, namely $\prod\_{p\in P-\{2,3\}}\mathbf{Z}\_p^\times$, so indeed the homomorphism $\mathbf{Z}\to \widehat{\mathbf{Z}[1/6]}^\times$ mapping $1$ to multiplication by $2/3$ extends uniquely to a continuous homomorphism $\widehat{\mathbf{Z}}\to \widehat{\mathbf{Z}[1/6]}^\times$.


A similar description should hold for all $\mathrm{BS}(m,n)$ whenever $\gcd(m,n)=1$. (Otherwise it's quite different since then the profinite completion is not solvable.)


