ℤ[√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
.
Equations
- instDecidableEqZsqrtd = decEqZsqrtd✝
Equations
- «termℤ√_» = Lean.ParserDescr.node `termℤ√_ 100 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "ℤ√") (Lean.ParserDescr.cat `term 100))
Instances For
The zero of the ring
Equations
- Zsqrtd.instZeroZsqrtd = { zero := Zsqrtd.ofInt 0 }
The one of the ring
Equations
- Zsqrtd.instOneZsqrtd = { one := Zsqrtd.ofInt 1 }
Equations
- Zsqrtd.instCommMonoidZsqrtd = inferInstance
Equations
- Zsqrtd.instCommSemigroupZsqrtd = inferInstance
Equations
- Zsqrtd.instAddCommSemigroupZsqrtd = inferInstance
Equations
- Zsqrtd.instAddSemigroupZsqrtd = inferInstance
Equations
- Zsqrtd.instCommSemiringZsqrtd = inferInstance
instance
Zsqrtd.instStarRingZsqrtdToNonUnitalNonAssocSemiringToNonUnitalNonAssocCommSemiringToNonUnitalNonAssocCommRingToNonUnitalCommRingCommRing
{d : ℤ}
:
Equations
- One or more equations did not get rendered due to their size.
Equations
- (_ : Nontrivial (ℤ√d)) = (_ : Nontrivial (ℤ√d))
theorem
Zsqrtd.sqLe_of_le
{c : ℕ}
{d : ℕ}
{x : ℕ}
{y : ℕ}
{z : ℕ}
{w : ℕ}
(xz : z ≤ x)
(yw : y ≤ w)
(xy : Zsqrtd.SqLe x c y d)
:
Zsqrtd.SqLe z c w d
theorem
Zsqrtd.sqLe_add_mixed
{c : ℕ}
{d : ℕ}
{x : ℕ}
{y : ℕ}
{z : ℕ}
{w : ℕ}
(xy : Zsqrtd.SqLe x c y d)
(zw : Zsqrtd.SqLe z c w d)
:
theorem
Zsqrtd.sqLe_add
{c : ℕ}
{d : ℕ}
{x : ℕ}
{y : ℕ}
{z : ℕ}
{w : ℕ}
(xy : Zsqrtd.SqLe x c y d)
(zw : Zsqrtd.SqLe z c w d)
:
Zsqrtd.SqLe (x + z) c (y + w) d
theorem
Zsqrtd.sqLe_cancel
{c : ℕ}
{d : ℕ}
{x : ℕ}
{y : ℕ}
{z : ℕ}
{w : ℕ}
(zw : Zsqrtd.SqLe y d x c)
(h : Zsqrtd.SqLe (x + z) c (y + w) d)
:
Zsqrtd.SqLe z c w d
theorem
Zsqrtd.sqLe_smul
{c : ℕ}
{d : ℕ}
{x : ℕ}
{y : ℕ}
(n : ℕ)
(xy : Zsqrtd.SqLe x c y d)
:
Zsqrtd.SqLe (n * x) c (n * y) d
theorem
Zsqrtd.sqLe_mul
{d : ℕ}
{x : ℕ}
{y : ℕ}
{z : ℕ}
{w : ℕ}
:
(Zsqrtd.SqLe x 1 y d → Zsqrtd.SqLe z 1 w d → Zsqrtd.SqLe (x * w + y * z) d (x * z + d * y * w) 1) ∧ (Zsqrtd.SqLe x 1 y d → Zsqrtd.SqLe w d z 1 → Zsqrtd.SqLe (x * z + d * y * w) 1 (x * w + y * z) d) ∧ (Zsqrtd.SqLe y d x 1 → Zsqrtd.SqLe z 1 w d → Zsqrtd.SqLe (x * z + d * y * w) 1 (x * w + y * z) d) ∧ (Zsqrtd.SqLe y d x 1 → Zsqrtd.SqLe w d z 1 → Zsqrtd.SqLe (x * w + y * z) d (x * z + d * y * w) 1)
theorem
Zsqrtd.nonnegg_comm
{c : ℕ}
{d : ℕ}
{x : ℤ}
{y : ℤ}
:
Zsqrtd.Nonnegg c d x y = Zsqrtd.Nonnegg d c y x
theorem
Zsqrtd.nonnegg_neg_pos
{c : ℕ}
{d : ℕ}
{a : ℕ}
{b : ℕ}
:
Zsqrtd.Nonnegg c d (-↑a) ↑b ↔ Zsqrtd.SqLe a d b c
theorem
Zsqrtd.nonnegg_pos_neg
{c : ℕ}
{d : ℕ}
{a : ℕ}
{b : ℕ}
:
Zsqrtd.Nonnegg c d (↑a) (-↑b) ↔ Zsqrtd.SqLe b c a d
theorem
Zsqrtd.nonnegg_cases_right
{c : ℕ}
{d : ℕ}
{a : ℕ}
{b : ℤ}
:
(∀ (x : ℕ), b = -↑x → Zsqrtd.SqLe x c a d) → Zsqrtd.Nonnegg c d (↑a) b
theorem
Zsqrtd.nonnegg_cases_left
{c : ℕ}
{d : ℕ}
{b : ℕ}
{a : ℤ}
(h : ∀ (x : ℕ), a = -↑x → Zsqrtd.SqLe x d b c)
:
Zsqrtd.Nonnegg c d a ↑b
@[simp]
theorem
Zsqrtd.norm_mul
{d : ℤ}
(n : ℤ√d)
(m : ℤ√d)
:
Zsqrtd.norm (n * m) = Zsqrtd.norm n * Zsqrtd.norm m
Equations
- Zsqrtd.normMonoidHom = { toOneHom := { toFun := Zsqrtd.norm, map_one' := (_ : Zsqrtd.norm 1 = 1) }, map_mul' := (_ : ∀ (n m : ℤ√d), Zsqrtd.norm (n * m) = Zsqrtd.norm n * Zsqrtd.norm m) }
Instances For
theorem
Zsqrtd.norm_eq_of_associated
{d : ℤ}
(hd : d ≤ 0)
{x : ℤ√d}
{y : ℤ√d}
(h : Associated x y)
:
Zsqrtd.norm x = Zsqrtd.norm y
Nonnegativity of an element of ℤ√d
.
Equations
- Zsqrtd.Nonneg x = match x with | { re := a, im := b } => Zsqrtd.Nonnegg d 1 a b
Instances For
Equations
- Zsqrtd.instLEZsqrtdCastIntInstNatCastInt = { le := fun (a b : ℤ√↑d) => Zsqrtd.Nonneg (b - a) }
instance
Zsqrtd.decidableNonnegg
(c : ℕ)
(d : ℕ)
(a : ℤ)
(b : ℤ)
:
Decidable (Zsqrtd.Nonnegg c d a b)
Equations
- One or more equations did not get rendered due to their size.
Equations
- Zsqrtd.decidableNonneg x = match x with | { re := re, im := im } => Zsqrtd.decidableNonnegg d 1 re im
Equations
- Zsqrtd.decidableLE x✝ x = Zsqrtd.decidableNonneg (x - x✝)
theorem
Zsqrtd.nonneg_add_lem
{d : ℕ}
{x : ℕ}
{y : ℕ}
{z : ℕ}
{w : ℕ}
(xy : Zsqrtd.Nonneg { re := ↑x, im := -↑y })
(zw : Zsqrtd.Nonneg { re := -↑z, im := ↑w })
:
Zsqrtd.Nonneg ({ re := ↑x, im := -↑y } + { re := -↑z, im := ↑w })
theorem
Zsqrtd.Nonneg.add
{d : ℕ}
{a : ℤ√↑d}
{b : ℤ√↑d}
(ha : Zsqrtd.Nonneg a)
(hb : Zsqrtd.Nonneg b)
:
Zsqrtd.Nonneg (a + b)
Equations
- Zsqrtd.preorder = Preorder.mk (_ : ∀ (a : ℤ√↑d), Zsqrtd.Nonneg (a - a)) (_ : ∀ (a b c : ℤ√↑d), a ≤ b → b ≤ c → a ≤ c)
theorem
Zsqrtd.nonneg_smul
{d : ℕ}
{a : ℤ√↑d}
{n : ℕ}
(ha : Zsqrtd.Nonneg a)
:
Zsqrtd.Nonneg (↑n * a)
theorem
Zsqrtd.nonneg_muld
{d : ℕ}
{a : ℤ√↑d}
(ha : Zsqrtd.Nonneg a)
:
Zsqrtd.Nonneg (Zsqrtd.sqrtd * a)
theorem
Zsqrtd.nonneg_mul_lem
{d : ℕ}
{x : ℕ}
{y : ℕ}
{a : ℤ√↑d}
(ha : Zsqrtd.Nonneg a)
:
Zsqrtd.Nonneg ({ re := ↑x, im := ↑y } * a)
theorem
Zsqrtd.nonneg_mul
{d : ℕ}
{a : ℤ√↑d}
{b : ℤ√↑d}
(ha : Zsqrtd.Nonneg a)
(hb : Zsqrtd.Nonneg b)
:
Zsqrtd.Nonneg (a * b)
theorem
Zsqrtd.nonneg_antisymm
{d : ℕ}
[dnsq : Zsqrtd.Nonsquare d]
{a : ℤ√↑d}
:
Zsqrtd.Nonneg a → Zsqrtd.Nonneg (-a) → a = 0
theorem
Zsqrtd.le_antisymm
{d : ℕ}
[dnsq : Zsqrtd.Nonsquare d]
{a : ℤ√↑d}
{b : ℤ√↑d}
(ab : a ≤ b)
(ba : b ≤ a)
:
a = b
instance
Zsqrtd.instNoZeroDivisorsZsqrtdCastIntInstNatCastIntInstMulZsqrtdInstZeroZsqrtd
{d : ℕ}
[dnsq : Zsqrtd.Nonsquare d]
:
NoZeroDivisors (ℤ√↑d)
Equations
- (_ : NoZeroDivisors (ℤ√↑d)) = (_ : NoZeroDivisors (ℤ√↑d))
theorem
Zsqrtd.mul_pos
{d : ℕ}
[dnsq : Zsqrtd.Nonsquare d]
(a : ℤ√↑d)
(b : ℤ√↑d)
(a0 : 0 < a)
(b0 : 0 < b)
:
instance
Zsqrtd.instLinearOrderedCommRingZsqrtdCastIntInstNatCastInt
{d : ℕ}
[dnsq : Zsqrtd.Nonsquare d]
:
Equations
- One or more equations did not get rendered due to their size.
instance
Zsqrtd.instLinearOrderedRingZsqrtdCastIntInstNatCastInt
{d : ℕ}
[dnsq : Zsqrtd.Nonsquare d]
:
LinearOrderedRing (ℤ√↑d)
Equations
- Zsqrtd.instLinearOrderedRingZsqrtdCastIntInstNatCastInt = inferInstance
instance
Zsqrtd.instOrderedRingZsqrtdCastIntInstNatCastInt
{d : ℕ}
[dnsq : Zsqrtd.Nonsquare d]
:
OrderedRing (ℤ√↑d)
Equations
- Zsqrtd.instOrderedRingZsqrtdCastIntInstNatCastInt = inferInstance
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
.
Equations
- One or more equations did not get rendered due to their size.
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.