Unit from norm one or minus one (source code)

= Unit from norm one or minus one
{title2=$\alpha\in\mathcal O_K^\times\iff N_{K/\mathbb Q}(\alpha)=\pm1$}

For a <number field> $K$ and an <algebraic integer> $\alpha\in\mathcal O_K$, the criterion is
$$
\alpha\in\mathcal O_K^\times\quad\Longleftrightarrow\quad N_{K/\mathbb Q}(\alpha)=\pm1.
$$
Here the absolute field norm means the <field norm> down to $\mathbb Q$; its <absolute value> is one. Necessity follows from $N(\alpha)N(\alpha^{-1})=1$ with both factors <integers>. Conversely, multiplication by $\alpha$ on an <integral basis> is a <matrix> with <integer> entries and <determinant> $\pm1$. Its inverse also has <integer> entries, and applying that inverse to $1$ gives $\alpha^{-1}\in\mathcal O_K$. The integrality hypothesis matters: $\alpha=(3+\sqrt2)/(3-\sqrt2)=(11+6\sqrt2)/7$ has field norm one, but is not in $\mathbb Z[\sqrt2]$.

In $\mathbb Z[\sqrt2]$, the criterion becomes $a^2-2b^2=\pm1$. Thus $(1+\sqrt2)^{-1}=\sqrt2-1$ and $(3+2\sqrt2)^{-1}=3-2\sqrt2$ are again <algebraic integers>. These <units> produce infinite families of solutions to the <Pell equation>.