Integral basis for coprime biquadratic radicands congruent to two and one (source code)

= Integral basis for coprime biquadratic radicands congruent to two and one
{title2=$1,\sqrt m,(1+\sqrt n)/2,\sqrt m(1+\sqrt n)/2$}

Let $m,n$ be coprime <square-free integers>, $m\equiv2\pmod4$ and $n\equiv1\pmod4$, with $n\ne1$. Put $\alpha^2=m$, $\beta^2=n$, and $\omega=(1+\beta)/2$. Then $1,\alpha,\omega,\alpha\omega$ is an <integral basis> of $\mathbb Q(\alpha,\beta)$. All four entries are <algebraic integers>. For spanning, <field traces> to the three quadratic subfields show that an arbitrary <algebraic integer> has form $(a+b\alpha+c\beta+d\alpha\beta)/2$ with $a,b,c,d\in\mathbb Z$. Its <field norm> to $\mathbb Q(\beta)$ is $A/4+(ac-mbd)\beta/2$, where $A=a^2+nc^2-mb^2-mnd^2$. The <ring of integers of a quadratic field> formula forces $A$ even and $A\equiv2ac-2mbd\pmod4$. These give $a\equiv c\pmod2$ and then $b\equiv d\pmod2$. The element is consequently $(a-c)/2+((b-d)/2)\alpha+c\omega+d\alpha\omega$. The coefficient <determinant> $1/4$ proves rational <linear independence>.