From Gallian’s Contemporary Abstract Algebra, Exercise 6.26:
Let $$ G= \lbrace a + b\sqrt{2} \mid \text{$a$, $b$ rational} \rbrace $$ and $$ H = \left\lbrace \begin{bmatrix} a & 2b \\ b & a \end{bmatrix} \,\middle|\, \text{$a, b$ rational} \right\rbrace. $$
The task is to show “that $G$ and $H$ are isomorphic under addition”. Here my question is not about the calculations that show that the isomorphism is operation preserving (these I believe are routine), but the form of the mapping itself.
I think the easy way is a mapping from $H$ to $G$, because if you have separate components $a$ and $b$, you can easily form the sum $a + b \sqrt{2}$. But what about the mapping from $G$ to $H$?
Instead, I am concerned with how to pull out rational coefficients from the sum of $a + b\sqrt{2}$. Isn’t that a bit weird? Is something like that possible, if the sum is represented in some number format, either floating point, or a string of digits? How does one do it? Perhaps I am missing some rational/irrational background.
The important part here is that the two numbers $1$ and $\sqrt{2}$ are linearly independent over $ℚ$. That is, whenever we have $$ a ⋅ 1 + b ⋅ \sqrt{2} = c ⋅ 1 + d ⋅ \sqrt{2} $$ for some rational numbers $a, b, c, d$, then automatically $$ a = c \quad\text{and}\quad b = d \,. $$ For every element $x$ of the set $\{ a + b \sqrt{2} \mid a, b ∈ ℚ \}$ we have therefore unique (!) rational numbers $a$ and $b$ with $x = a + b \sqrt{2}$. This uniqueness allows us to implicitly extract the coefficients $a$ and $b$ from $x$.