Clarification on arithmetic groups example $\DeclareMathOperator\SU{SU}\DeclareMathOperator\SL{SL}$I'm working through some of the constructions in Introduction to Arithmetic Groups by Dave Witte Morris, and I'm confused by the construction of example 6.3.1 on page 121. For reference, here's the setup:
Take $a,b \in \mathbb{Q}^+$, yielding the totally real number field $L=Q(\sqrt a) \subset \mathbb{R}$ with ring of integers $\mathcal{O}$ commensurable to $\mathbb{Z}[\sqrt a]$. Let $\tau$ be the nontrivial element of $\operatorname{Gal}(L/\mathbb{Q})$, and let $A=(\begin{smallmatrix} b & 0 \\ 0 & -1 \end{smallmatrix})$. Define a ''unitary group'' with entries in $\mathcal O$ as
$$G_{\mathcal O} = \SU(A,\tau;\mathcal O) = \{g \in \SL(2,\mathcal O) \mid \tau(g^T)Ag=A \} \subset \SL(2,\mathbb{R}).$$
The statement is that $G_\mathcal{O}$ is an arithmetic subgroup of $G=\SL(2,\mathbb{R})$.
There are a few points in the provided construction that are confusing me, but I think I might be able to work them out if someone could explain one thing to me:
Why do we expect $G_{\mathcal O}$ to be an arithmetic subgroup of $G$?
From the avenue of restriction of scalars I would expect $G_\mathcal{O}$ to be arithmetic in $G \times G$, one factor for each of the Galois conjugates of the number field. I don't think either of the conjugates lands in a compact factor since the form $A$ that's being preserved doesn't change under automorphisms of $L/\mathbb{Q}$.
 A: YCor gave a brief explanation in the comments. Based on your comment about seeking intuition, I think it would be helpful to explain concretely the backstory to the calculation YCor did:
Given any kind of arithmetically-defined group $\Gamma$, you want to find a real algebraic group / Lie group $G$ in which $\Gamma$ is arithmetic. For this, a necessary condition is that $\Gamma$ is discrete in $G$, but it's not sufficient. If $\Gamma \subset H \subset G$, then $\Gamma$ is not arithmetic in $G$ unless $G/H$ is compact, so we want to take $G$ as small as possible containing $\Gamma$.
Making $\Gamma$ discrete is easy. You just have to express elements of $\Gamma$ by integer coordinates, since $\mathbb Z^n$ is discrete in $\mathbb R^n$, so any subset of $\mathbb Z^n$ is discrete in any subspace of $\mathbb R^n$ containing it.
For example, for $\Gamma = SL(2, \mathcal O)$ or $\Gamma$ any subgroup of $SL(2, \mathcal O)$ (in, for simplicity, the special case $\mathcal O = \mathbb Z[\sqrt{a}]$), we can write any matrix $g$ as $M + N \sqrt{a}$ where $M, N $ are $2 \times 2$ matrices over the integers. This embeds $SL(2,\mathcal O)$ into $\mathbb Z^8$.  For an arbitrary group over an arbitrary ring of integers $\mathcal O$ you can do the same thing, you just need to pick a $\mathbb Z$-basis of $\mathcal O$. So $SL_2 (\mathcal O)$ is discrete inside the manifold $\mathbb R^8$ parameterizing pairs $M ,N$ of $2\times 2$ matrices over the reals.
Of course we care about $\Gamma$ as a group and not just an abstract set. So you need to find a polynomial formula for the multiplication map. We have $$ (M_1+ N_1\sqrt{a} ) \cdot (M_2+ N_2\sqrt{a} ) = (M_1 M_2 + a N_1 N_2) + (M_1 N_2 + N_1 M_2) \sqrt{a}$$ so we ca write multiplication as $$(M_1,N_1) \cdot (M_2, N_2) = ( (M_1 M_2 + a N_1 N_2) , (M_1 N_2 + N_1 M_2) ).$$
Then $\Gamma$ is discrete inside the group of pairs of $2\times 2$ real matrices that have inverses under this multiplication map, i.e. those such that $M + N  \sqrt{a}$ and $M - N \sqrt{a}$ are both invertible. This is isomorphic to $GL(2,\mathbb R) \times GL(2,\mathbb R)$.
But this is not the minimal group inside which $\Gamma$ is discrete. To find that, we need to take the Zariski closure of $\Gamma$, i.e. for all polynomial relations satisfied by $(M ,N) \in \Gamma$, we look at only those $M, N \in M_2(\mathbb R)$. This defines an algebraic group $G$, which always contains $\Gamma$, and that's the group in which $\Gamma$ is arithmetic.
These include $\det (M + N \sqrt{a})=1$ and $\det (M - N \sqrt{a}) =1$, which cut the group down to $SL(2,\mathbb R) \times SL(2,\mathbb R)$, which if $\Gamma =SL(2,\mathcal O)$ is as far as we go, but for $\Gamma$ the unitary group, there is another polynomial relation:
$$ \tau( g^T) Ag = A$$
i.e.
$$ ( M^T- N^T \sqrt{a}) A ( M+ N \sqrt{a} ) = A $$
and
$$ ( M^T+ N^T \sqrt{a}) A ( M- N \sqrt{a} ) = A $$
These two relations cut you down to a smaller group. Whatever it is, it's clearly not $SL (2,\mathbb R) \times SL(2, \mathbb R)$, because these relations are not satisfied for every element in $SL(2, \mathbb R)$. In fact, it's $SL(2,\mathbb R)$, for the reason YCor gave: Essentially, either $M+N \sqrt{a}$ or $M- N \sqrt{a}$ is determined by the other one, so you only need one $2\times 2$ matrix to determine the element.

In summary, you always want to express your group with coordinates over the integers, and relations defined by polynomials (ideally over the integers, or else remember to write down all Galois conjugates of your polynomial relations). Then you consider the real solutions of the same set of polynomial equations, and that will give you the right algebraic group. Before tricky relations that involve the Galois group like the one appearing in the definition of the unitary group, this will split as a product over the real places of your number field, but these extra relations will relate the projections to different places, giving a smaller group.
A: I think there's a nice geometric way to see this, as follows. The group $SU(A,\tau;\mathscr{O})$ is exactly the subgroup of $SL_2(\mathscr{O})$ that preserves a particular hyperbolic plane $P$ embedded in $\mathbb{H}^2\times \mathbb{H}^2$.
Let's first look at a simpler version: Note that the map $x+y\sqrt{a}\to (x+y\sqrt{a},x-y\sqrt{a})$ embeds $\mathscr{O}$ in $\mathbb R^2$ as a discrete subgroup. For each line in $\mathbb R^2$, we can consider the subgroup of $\mathscr{O}$ which preserves this line - this will either be trivial or it will be a lattice in that line.
There is a corresponding embedding of $SL_2(\mathscr{O})\to SL_2(\mathbb{R})\times SL_2(\mathbb{R})$ as a discrete group, and hence a proper action of $SL_2(\mathscr{O})$ on $\mathbb{H}^2\times \mathbb{H}^2$, via $g.(x,y)=(gx,\tau(g^T)^{-1}y)$.
The quadratic form $A=\begin{pmatrix}b & 0 \\ 0 & -1\end{pmatrix}$ can also be viewed as an isometry of $\mathbb{H}^2$, and thus it specifies an embedding $\mathbb{H}^2\to \mathbb{H}^2\times \mathbb{H}^2$, where $x\mapsto (x,Ax)$. We'll call the image $P$.
We observe that $g.(x,Ax)=(gx,\tau(g^T)^{-1}Ax)\in P$ exactly when $\tau(g^T)^{-1}Ax=Agx$ for every $x\in \mathbb{H}^2$, or in other words, when $A=\tau(g^T)Ag$. So the subgroup of $SL_2(\mathscr{O})$ that preserves this plane $P$ is exactly $SU(A,\tau;\mathscr{O})$.
When $b$ is rational, the subgroup of $SL_2(\mathscr{O})$ which preserves $P$ acts cocompactly on $P$
Note we should really assume $a$ is not a square in $\mathbb{Q}$.
