Solution (source code)

= Solution

First realize the free isometric action. Choose generators $t_1,\ldots,t_r$ of the <finitely presented group> $T$. In every dimension $d\geq3$, the <connected sum>
$$
B_d=\mathop{\#}_{j=1}^r(S^1\times S^{d-1})
$$
has <fundamental group> the <free group> $F_r$. Map its generators onto the $t_j$ and take the connected <regular covering> $N\to B_d$ corresponding to the kernel. Its <deck transformation group> is $F_r/\ker\pi\cong T$. Lift any <Riemannian metric> on $B_d$ to $N$. <Deck transformations> are then <Riemannian isometries>, and a <deck transformation> fixing one point is the identity by uniqueness of lifts. This gives the <free isometric realization of a finitely generated group>. For the trivial group use $S^d$. If $T$ is infinite the covering manifold need not be compact, which is allowed in this first construction. Simple connectivity of $N$ is not being asserted here.

\b[The requested nonhomeomorphism conclusion needs an extra hypothesis.] For a counterexample even with distinct <subgroups>, take $T=S_3$, $U_1=\langle(1\ 2)\rangle$ and $U_2=\langle(2\ 3)\rangle$. They are conjugate and therefore <Gassman equivalent>. For every free isometric action of $T$, the conjugating element induces a <Riemannian isometry> $U_1\backslash N\to U_2\backslash N$. These quotients cannot be nonhomeomorphic. Identical <subgroups> give an even simpler obstruction. Thus the stated equivalence condition alone cannot imply the claimed topology.

A sufficient version is: for a finite $T$ with <Gassmann equivalent>, nonisomorphic <subgroups> $U_1,U_2$, there are closed isospectral manifolds with <fundamental groups> $U_1,U_2$, and hence they are not homeomorphic. To prove it, realize $T$ as the <fundamental group> of a closed smooth manifold $B$ of dimension four. Here is the needed <closed-manifold realization of a finitely presented fundamental group>. Start with a four-dimensional zero-handle and one one-handle for each generator. Attach two-handles along disjoint embedded boundary circles representing the relators, with arbitrary framings. The boundary is three-dimensional, so finitely many such loops can be chosen disjoint. The resulting compact handle manifold $W$ has $\pi_1(W)=T$ by the <Seifert-van Kampen theorem>.

The inclusion $\partial W\to W$ is surjective on <fundamental groups>: relative to the boundary the dual handle decomposition uses only handles of indices two, three and four, none of which introduces a fundamental-group generator. Double $W$ along its boundary. In the amalgamated product for the double, both boundary maps are the same surjection onto $T$, so the two copies of $T$ are identified completely and $\pi_1(B)=T$. The double is closed, connected and smooth after smoothing its collar. This construction works in any dimension at least four; it does not claim that every finitely presented group is a closed three-manifold group.

Let $N$ now be the <universal cover> of $B$ with the lifted metric. Since $T$ is finite, $N$ is compact and <simply connected>, with a free isometric deck action of $T$. By <Sunada theorem>, $M_i=U_i\backslash N$ are isospectral. Because $N$ is their universal cover, $\pi_1(M_i)\cong U_i$. Nonisomorphic <fundamental groups> rule out a <homeomorphism>. For an infinite $T$ the same qualified argument applies to finite-index <subgroups> with equal coset characters: divide first by the intersection $K=\operatorname{Core}_T(U_1)\cap\operatorname{Core}_T(U_2)$ of their finite-index <subgroup cores>, producing a compact intermediate cover and a finite isometry group to which Sunada applies.

For explicit nonhomeomorphic examples, let $p$ be an odd prime. Let $H_p=(\mathbb Z/p\mathbb Z)^3$, and let $K_p$ be the <Heisenberg group over a prime field>, whose elements are triples with multiplication
$$
(a,b,c)(a',b',c')=(a+a',b+b',c+c'+ab').
$$
Both have order $p^3$, and every nonidentity element has order $p$. For $K_p$, induction gives
$$
(a,b,c)^k=(ka,kb,kc+\tbinom{k}{2}ab),
$$
so the assertion follows at $k=p$, since $p$ is odd. But $H_p$ is abelian and $K_p$ is not: $(1,0,0)$ and $(0,1,0)$ do not commute.

Embed both groups regularly in $S_{p^3}$. Every nonidentity element in either <regular representation> has cycle type $p^{p^2}$. Hence both embedded <subgroups> meet the identity class once, the class of that cycle type $p^3-1$ times, and all other classes zero times. They are <nonisomorphic Gassmann equivalent regular subgroups>. Taking $p=3$ and using the closed four-manifold construction with $T=S_{27}$ gives an explicit pair of isospectral nonhomeomorphic quotients, completing the intended construction under a sufficient hypothesis.

Finally choose distinct odd primes $p_1,\ldots,p_n$ and take
$$
T_n=\prod_{j=1}^n S_{p_j^3},\qquad
U_\epsilon=\prod_{j=1}^n L_{j,\epsilon_j},\qquad
L_{j,0}=H_{p_j},\quad L_{j,1}=K_{p_j},\quad\epsilon\in\{0,1\}^n.
$$
<Conjugacy classes> in a direct product are products of classes, so their intersection counts factor. Thus all $2^n$ <subgroups> are <Gassmann equivalent>. They are pairwise nonisomorphic: the unique Sylow $p_j$-subgroup of $U_\epsilon$ is its $j$th factor, and whether it is abelian records $\epsilon_j$. Realize $T_n$ as the <fundamental group> of a closed four-manifold and quotient its universal cover by these <subgroups>. The <binary family of nonhomeomorphic Sunada quotients> gives
$$
\boxed{2^n\text{ mutually isospectral closed four-manifolds, pairwise nonhomeomorphic and therefore nonisometric}.}
$$
This existence statement is valid; the earlier universal nonhomeomorphism assertion from Gassmann equivalence alone is not.