*It's a long post but I felt like I needed to provide some context to my problem. The explicit questions start at the bold font questions below.*

In the classical world, it seems that one is usually interested in automorphic forms for arithmetic subgroups of $\text{SL}_n(\mathbb{R})$ such as $\text{SL}_n(\mathbb{Z})$. Using strong approximation, one can move to the adelic world and all is fine because $$ \text{SL}_n(\mathbb{Z}) \backslash \text{SL}_n(\mathbb{R}) \cong \text{SL}_n(\mathbb{Q}) \backslash \text{SL}_n(\mathbb{A}) / \text{SL}_n(\hat{\mathbb{Z}}). $$

Nevertheless, for Hecke theory, the more natural group to work on is the general linear group. This is also not a problem, since one can prove that $$ \text{SL}_n(\mathbb{Z}) \backslash \text{SL}_n(\mathbb{R}) \cong Z(\mathbb{A}) \text{GL}_n(\mathbb{Q}) \backslash \text{GL}_n(\mathbb{A}) / \text{GL}_n(\hat{\mathbb{Z}}). $$ See for instance Prop. 3.3.1 in Bump's book. There is a little trick involved in showing this. It seems to me that it is quite common to do this by passing to the group $\text{GL}^{+}_n(\mathbb{R})$ of matrices with positive determinant. Then we have $$ \text{SL}_n(\mathbb{Z}) \backslash \text{SL}_n(\mathbb{R}) \cong Z(\mathbb{R})^+\text{SL}_n(\mathbb{Z}) \backslash \text{GL}^+_n(\mathbb{R}), \tag{1}\label{eq1} $$ where $Z(\mathbb{R})^+$ are the multiples of the identity by positive scalars. Without going into details, the important step afterwards is to note that $$ \text{GL}_n(\mathbb{Q}) \cap (\text{GL}_n^+(\mathbb{R}) \times \text{GL}_n(\hat{\mathbb{Z}})) = \text{SL}_n(\mathbb{Z}), \tag{2}\label{eq2} $$ since the determinant of an element on the LHS is positive and a unit in $\mathbb{Z}$, so it must be $1$. Another place where you can see the usefulness of this last identity is in Miyake's book, where he proves the isomorphism between the classical and adelic Hecke algebras (Thm. 5.3.5; see equation (5.3.2) and the displays after that).

As in the theory of Hilbert modular forms and the classification of arithmetic subgroups of $\text{SL}_2(\mathbb{R})$, it is interesting to look at this process over number fields. For simplicity, let $F$ be a real quadratic number field with ring of integers $\mathcal{O}$. Then $\text{SL}_n(\mathcal{O})$ can be viewed as an arithmetic subgroup of $\text{SL}_n(\mathbb{R}) \times \text{SL}_n(\mathbb{R})$ or one could have the group of norm $1$ units of a suitable quaternion algebra over $F$ being an arithmetic subgroup of $\text{SL}_2(\mathbb{R})$. In any case, the main complication that arises in this situation seems to be that the (narrow) class group of $F$ might be non-trivial, but also that its group of units is larger.

Let us assume, as most books do, that $F$ has narrow class number $1$ and let $\sigma_1, \sigma_2$ be the two real embeddings. Then one can prove that $\mathcal{O}^\times_+ = \{ \xi \in \mathcal{O}^\times: \sigma_1(\xi), \sigma_2(\xi) > 0 \} = (\mathcal{O}^\times)^2 $. This implies that $\text{GL}^+_2(\mathcal{O}) = Z(\mathcal{O}^\times) \text{SL}_2(\mathcal{O})$, where $\text{GL}^+_2(\mathcal{O})$ are matrices with determinant in $\mathcal{O}^\times_+$ (see e.g. Dembélé-Voight, Explicit methods for Hilber modular forms, Sect. 2 just before Def. 2.1). One can now take the analogue of $\eqref{eq1}$ (nothing new here) and afterwards we also have the analogue of $\eqref{eq2}$ $$ \text{GL}_2(F) \cap (\text{GL}_2^+(\mathbb{R}) \times \text{GL}_2^+(\mathbb{R}) \times \text{GL}_n(\hat{\mathcal{O}})) = \text{GL}^+_2(\mathcal{O}) = Z(\mathcal{O}^\times) \text{SL}_2(\mathcal{O}), $$ which also appears in Gelbart's book, Automorphic forms on adeles groups, (3.19), though intentionally ignoring the centre $Z(\mathcal{O}^\times)$ for some reason. In conclusion, I can see how one could go from $\text{SL}_2$ to $\text{GL}_2$.

There are two **questions** that I have. **(I)** First of all, what happens if $F$ has non-trivial narrow class group? Garrett's book on Hilbert modular forms contains the homeomorphism (Sect. 3.1, Prop. on page 92)
$$
Z(\mathbb{R})^2 \text{GL}_2(F) \backslash \text{GL}_2(\mathbb{A}_F) / \text{GL}_2(\hat{\mathbb{O}}) \cong \bigsqcup Z(\mathbb{R})^2 \Gamma_\xi \backslash \text{GL}_2^+(\mathbb{R})^2,
$$
where $\xi$ runs through elements of $\text{GL}_2(\mathbb{A}_F)$ such that the set of their determinants is a system of representatives for the narrow ideal class group, and
$$
\Gamma_\xi = \text{GL}_2(F) \cap \text{GL}_2^+(\mathbb{R})^2 \xi \text{GL}_2(\hat{\mathcal{O}}) \xi^{-1}.
$$
This is what follows from approximation theorems.

Of course, taking $\xi = 1$ (so corresponding to principal ideals) would give us $\Gamma_1 = \text{GL}_2^+(\mathcal{O})$. Nevertheless, it is unclear to me how to view the "classical" quotient $ \text{SL}_2(\mathcal{O}) \backslash \text{SL}_2(\mathbb{R})^2$ inside this decomposition. There is a map $$ \text{SL}_2(\mathcal{O}) \backslash \text{SL}_2(\mathbb{R})^2 \longrightarrow Z(\mathbb{R})^2 \text{GL}^+_2(\mathcal{O}) \backslash \text{GL}_2^+(\mathbb{R})^2, $$ which is surjective, but not injective anymore. What exactly is happening here?

Another question I have is **(II)** what happens for $\text{SL}_n$ for $n > 2$? Here I am not even sure how to handle the class number one case, since it seems that we cannot use the trick
$$
\mathcal{O}^\times_+ \subset (\mathcal{O}^\times)^n
$$
for $n > 2$, if I am not mistaken (e.g. the square of a fundamental unit would be totally positive but not a cube in the case $n=3$).

I would be grateful for any references or help in general.