ℤ[√d] #
The ring of integers adjoined with a square root of d : ℤ.
After defining the norm, we show that it is a linearly ordered commutative ring, as well as an integral domain.
We provide the universal property, that ring homomorphisms ℤ√d →+* R correspond
to choices of square roots of d in R.
Instances For
The zero of the ring
The one of the ring
Addition of elements of ℤ√d
Multiplication in ℤ√d
Conjugation in ℤ√d. The conjugate of a + b √d is a - b √d.
"Generalized" nonneg. nonnegg c d x y means a √c + b √d ≥ 0;
we are interested in the case c = 1 but this is more symmetric
Instances For
Nonnegativity of an element of ℤ√d.
Instances For
A nonsquare is a natural number that is not equal to the square of an integer. This is implemented as a typeclass because it's a necessary condition for much of the Pell equation theory.
- ns (n : ℕ) : x ≠ n * n
Instances
The unique RingHom from ℤ√d to a ring R, constructed by replacing √d with the provided
root. Conversely, this associates to every mapping ℤ√d →+* R a value of √d in R.
Instances For
An element of ℤ√d has norm equal to 1 if and only if it is contained in the submonoid
of unitary elements.
The kernel of the norm map on ℤ√d equals the submonoid of unitary elements.