Let G be the free profinite group on 2 generators, $A=G/[G,[G,G]],B=G/[[G,G],[G,G]]$, then what is the structure of the groups $A$ and $B$?


I heard that $A$ is isomorphic to the group of such ($3\times 3$ below) matrices with entries in $\hat{\mathbb{Z}}$, is this right and why?
$$
\begin{pmatrix}
1 & \* & \*\\
0 & 1 & \*\\
0 & 0 & 1
\end{pmatrix}
$$



Linear representation of the free metabelian / 2-step nilpotent profinite groups on 2 generators
The group $B$, the free pro-metabelian group, has the following description, due to Jorge Almeida. I’ll do it for an arbitrary finite set $|X|$ of cadinality at least $2$. Consider $\widehat{\mathbb Z}^X$, the free pro-abelian group on $X$. Then we can consider the edge set of its Cayley graph $E=\widehat{\mathbb Z}^X\times X$, which is a profinite space with the product topology. Let $H$ be the free pro-abelian group on the profinite space $E$. Then $\widehat{\mathbb Z}^X$ acts continuously on $E$ via the usual action on its Cayley graph, i.e., via left multiplication in the first coordinate and this extends to a continuous action on $H$ by automorphisms. Form the semidirect product $H\rtimes \widehat{\mathbb Z}^X$. Then your group $B$ embeds in $H\rtimes \widehat{Z}^X$ in the following way. Send $x\in X$ to the pair $((1,x),x)$ where $(1,x)$ should be thought of as the edge from $1$ to $x$ labeled by $x$ in the Cayley graph and the second $x$ is the corresponding generator of $\widehat{\mathbb Z}^X$. This extends to an embedding of $G$.


Your question about $A$ boils down to whether the $3\times 3$ Heisenberg group has the congruence subgroup property, which I leave to more knowledgeable people than I.


