Ring of integers of Q of square root two (source code)

= Ring of integers of Q of square root two
{title2=$\mathcal O_{\mathbb Q(\sqrt2)}=\mathbb Z[\sqrt2]$}

Since $2\not\equiv1\pmod4$, the <ring of integers> of $\mathbb Q(\sqrt2)$ is
$$
\mathbb Z[\sqrt2]=\{a+b\sqrt2:a,b\in\mathbb Z\},
$$
with <integral basis> $1,\sqrt2$ and <field discriminant> eight. Multiplication is ordinary <polynomial> multiplication followed by $(\sqrt2)^2=2$:
$$
(a+b\sqrt2)(c+e\sqrt2)=(ac+2be)+(ae+bc)\sqrt2.
$$
For example, $(1+\sqrt2)^2=3+2\sqrt2$ and $(1+\sqrt2)^3=7+5\sqrt2$. The <integer> coefficients stay integral, as required for a <ring>.

Under the two <field embeddings>, the element $a+b\sqrt2$ becomes the point $(a+b\sqrt2,a-b\sqrt2)$. The <integral basis> vectors become $(1,1)$ and $(\sqrt2,-\sqrt2)$, giving a <Minkowski embedding of a real quadratic field>. Their <determinant> has absolute value $2\sqrt2=\sqrt8$, consistent with the <field discriminant>.

\Image[/quadratic-integer-embeddings.png]
{title=The two real embeddings turn the integers adjoined square root two into a lattice}
{description=Left: the <integer lattice> of coefficients $(a,b)$. Right: the <Minkowski embedding of a real quadratic field>, $(x,y)=(a+b\sqrt2,a-b\sqrt2)$. The highlighted cells use the same <integral basis>; their areas are $1$ and $2\sqrt2$. Each image point has <field norm> $xy$, so the marked <units> lie on the <hyperbolas> $xy=\pm1$. Only a finite portion is shown.}