The ring of integers of a quadratic field #
For a quadratic number field K = ℚ(√d) — presented by an algebraic integer θ : 𝓞 K with
minpoly ℤ θ = X² - d and Algebra.adjoin ℚ {θ} = ⊤ — with d squarefree, the ring of integers
depends on d mod 4:
d ≢ 1 (mod 4):𝓞 K = ℤ[θ]andNumberField.discr K = 4 * d;d ≡ 1 (mod 4):𝓞 K = ℤ[ω]withω = (1+θ)/2 = NumberField.halfGen, andNumberField.discr K = d.
The content is the "no more integers" step: an algebraic integer z with (z : K) = a + b·θ
(a, b : ℚ) has 2a ∈ ℤ and a² - d·b² ∈ ℤ (its trace and norm), whence 2a, 2b ∈ ℤ (using that
d is squarefree), and the residue a² ≡ d·b² (mod 4) fixes the coordinates: 2a, 2b are both
even when d % 4 ≠ 1, and are equal mod 2 (so z ∈ ℤ + ℤ·ω) when d ≡ 1 (mod 4).
The same coordinates give the norm form of K: writing the trace as A and twice the second
coordinate as B, the norm of z is (A² - d·B²)/4, and the factor 4 disappears when
d ≢ 1 (mod 4) because the coordinates are then integers.
Main results #
NumberField.adjoin_gen_eq_top_of_mod_four_ne_one:𝓞 K = ℤ[θ]ford % 4 ≠ 1.NumberField.discr_eq_four_mul_of_mod_four_ne_one:discr K = 4dford % 4 ≠ 1.NumberField.adjoin_halfGen_eq_top_of_mod_four_eq_one:𝓞 K = ℤ[(1+θ)/2]ford ≡ 1.NumberField.minpoly_halfGen: the minimal polynomial of(1+θ)/2isX² - X + (1-d)/4.NumberField.adjoin_rat_halfGen_eq_top:(1+θ)/2generatesKoverℚ.NumberField.discr_eq_of_squarefree_of_mod_four_eq_one:discr K = dford ≡ 1.NumberField.exists_sq_sub_mul_sq_eq_four_mul_norm: the norm form4·N(z) = A² - d·B², andNumberField.exists_sq_sub_mul_sq_eq_norm_of_mod_four_ne_one:N(z) = A² - d·B²ford ≢ 1.
For d ≡ 1 (mod 4), the half-integer generator ω = (1 + θ)/2 ∈ 𝓞 K.
Instances For
The half-integer generator coerces to (1 + θ)/2 in K.
The half-integer generator (1+θ)/2 generates K over ℚ whenever θ does.
The minimal polynomial of the half-integer generator (1+θ)/2 over ℤ is
X² - X + (1 - d)/4.
The ring of integers is ℤ[(1+θ)/2] when d ≡ 1 (mod 4). For squarefree d with
d % 4 = 1, the ring of integers of ℚ(√d) is generated over ℤ by ω = (1+θ)/2.
The discriminant of ℚ(√d) when d ≡ 1 (mod 4). For squarefree d with d % 4 = 1, the
field discriminant is disc K = d (the ring of integers is ℤ[(1+θ)/2], whose {1, ω} basis has
discriminant d).
The norm form of a quadratic field. For squarefree d, every algebraic integer z of
K = ℚ(√d) has 4·N(z) = A² - d·B² for integers A (its trace) and B: the {1, θ}-coordinates
of z are the half-integers A/2 and B/2 (exists_half_int_coords), and the norm of
a + c·θ is a² - d·c².
This is the shape in which the norm of a quadratic integer is used arithmetically; when
d ≢ 1 (mod 4) the factor 4 can be removed, see
exists_sq_sub_mul_sq_eq_norm_of_mod_four_ne_one.
The norm form of a quadratic field when d ≢ 1 (mod 4). There the ring of integers is
ℤ[θ], so every algebraic integer is A + B·θ and its norm is exactly A² - d·B².
The ring of integers is ℤ[θ] when d ≢ 1 (mod 4). For squarefree d with d % 4 ≠ 1,
the ring of integers of ℚ(√d) is generated over ℤ by θ.
The discriminant of ℚ(√d) when d ≢ 1 (mod 4). For squarefree d with d % 4 ≠ 1
(equivalently d ≡ 2, 3 (mod 4)), the field discriminant is disc K = 4d. The ring of integers is
ℤ[θ] — see adjoin_gen_eq_top_of_mod_four_ne_one.