Documentation

Mathlib.NumberTheory.Zsqrtd.Basic

ℤ[√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.

structure Zsqrtd (d : ℤ) :

The ring of integers adjoined with a square root of d. These have the form a + b √d where a b : ℤ. The components are called re and im by analogy to the negative d case.

Instances For
    Equations
    • instDecidableEqZsqrtd = decEqZsqrtd✝
    theorem Zsqrtd.ext {d : ℤ} {z : ℤ√d} {w : ℤ√d} :
    z = w ↔ z.re = w.re ∧ z.im = w.im
    def Zsqrtd.ofInt {d : ℤ} (n : ℤ) :

    Convert an integer to a ℤ√d

    Equations
    Instances For
      theorem Zsqrtd.ofInt_re {d : ℤ} (n : ℤ) :
      (Zsqrtd.ofInt n).re = n
      theorem Zsqrtd.ofInt_im {d : ℤ} (n : ℤ) :
      (Zsqrtd.ofInt n).im = 0

      The zero of the ring

      Equations
      @[simp]
      theorem Zsqrtd.zero_re {d : ℤ} :
      0.re = 0
      @[simp]
      theorem Zsqrtd.zero_im {d : ℤ} :
      0.im = 0
      Equations
      • Zsqrtd.instInhabitedZsqrtd = { default := 0 }
      instance Zsqrtd.instOneZsqrtd {d : ℤ} :

      The one of the ring

      Equations
      @[simp]
      theorem Zsqrtd.one_re {d : ℤ} :
      1.re = 1
      @[simp]
      theorem Zsqrtd.one_im {d : ℤ} :
      1.im = 0
      def Zsqrtd.sqrtd {d : ℤ} :

      The representative of √d in the ring

      Equations
      • Zsqrtd.sqrtd = { re := 0, im := 1 }
      Instances For
        @[simp]
        theorem Zsqrtd.sqrtd_re {d : ℤ} :
        Zsqrtd.sqrtd.re = 0
        @[simp]
        theorem Zsqrtd.sqrtd_im {d : ℤ} :
        Zsqrtd.sqrtd.im = 1
        instance Zsqrtd.instAddZsqrtd {d : ℤ} :

        Addition of elements of ℤ√d

        Equations
        • Zsqrtd.instAddZsqrtd = { add := fun z w => { re := z.re + w.re, im := z.im + w.im } }
        @[simp]
        theorem Zsqrtd.add_def {d : ℤ} (x : ℤ) (y : ℤ) (x' : ℤ) (y' : ℤ) :
        { re := x, im := y } + { re := x', im := y' } = { re := x + x', im := y + y' }
        @[simp]
        theorem Zsqrtd.add_re {d : ℤ} (z : ℤ√d) (w : ℤ√d) :
        (z + w).re = z.re + w.re
        @[simp]
        theorem Zsqrtd.add_im {d : ℤ} (z : ℤ√d) (w : ℤ√d) :
        (z + w).im = z.im + w.im
        @[simp]
        theorem Zsqrtd.bit0_re {d : ℤ} (z : ℤ√d) :
        (bit0 z).re = bit0 z.re
        @[simp]
        theorem Zsqrtd.bit0_im {d : ℤ} (z : ℤ√d) :
        (bit0 z).im = bit0 z.im
        @[simp]
        theorem Zsqrtd.bit1_re {d : ℤ} (z : ℤ√d) :
        (bit1 z).re = bit1 z.re
        @[simp]
        theorem Zsqrtd.bit1_im {d : ℤ} (z : ℤ√d) :
        (bit1 z).im = bit0 z.im
        instance Zsqrtd.instNegZsqrtd {d : ℤ} :

        Negation in ℤ√d

        Equations
        • Zsqrtd.instNegZsqrtd = { neg := fun z => { re := -z.re, im := -z.im } }
        @[simp]
        theorem Zsqrtd.neg_re {d : ℤ} (z : ℤ√d) :
        (-z).re = -z.re
        @[simp]
        theorem Zsqrtd.neg_im {d : ℤ} (z : ℤ√d) :
        (-z).im = -z.im
        instance Zsqrtd.instMulZsqrtd {d : ℤ} :

        Multiplication in ℤ√d

        Equations
        • Zsqrtd.instMulZsqrtd = { mul := fun z w => { re := z.re * w.re + d * z.im * w.im, im := z.re * w.im + z.im * w.re } }
        @[simp]
        theorem Zsqrtd.mul_re {d : ℤ} (z : ℤ√d) (w : ℤ√d) :
        (z * w).re = z.re * w.re + d * z.im * w.im
        @[simp]
        theorem Zsqrtd.mul_im {d : ℤ} (z : ℤ√d) (w : ℤ√d) :
        (z * w).im = z.re * w.im + z.im * w.re
        Equations
        Equations
        instance Zsqrtd.commRing {d : ℤ} :
        Equations
        • Zsqrtd.commRing = let src := Zsqrtd.addGroupWithOne; CommRing.mk (_ : ∀ (a b : ℤ√d), a * b = b * a)
        Equations
        • Zsqrtd.instAddMonoidZsqrtd = inferInstance
        Equations
        • Zsqrtd.instMonoidZsqrtd = inferInstance
        Equations
        • Zsqrtd.instCommMonoidZsqrtd = inferInstance
        Equations
        • Zsqrtd.instCommSemigroupZsqrtd = inferInstance
        Equations
        • Zsqrtd.instSemigroupZsqrtd = inferInstance
        Equations
        • Zsqrtd.instAddCommSemigroupZsqrtd = inferInstance
        Equations
        • Zsqrtd.instAddSemigroupZsqrtd = inferInstance
        Equations
        • Zsqrtd.instCommSemiringZsqrtd = inferInstance
        Equations
        • Zsqrtd.instSemiringZsqrtd = inferInstance
        Equations
        • Zsqrtd.instRingZsqrtd = inferInstance
        Equations
        • Zsqrtd.instDistribZsqrtd = inferInstance

        Conjugation in ℤ√d. The conjugate of a + b √d is a - b √d.

        Equations
        • Zsqrtd.instStarZsqrtd = { star := fun z => { re := z.re, im := -z.im } }
        @[simp]
        theorem Zsqrtd.star_mk {d : ℤ} (x : ℤ) (y : ℤ) :
        star { re := x, im := y } = { re := x, im := -y }
        @[simp]
        theorem Zsqrtd.star_re {d : ℤ} (z : ℤ√d) :
        (star z).re = z.re
        @[simp]
        theorem Zsqrtd.star_im {d : ℤ} (z : ℤ√d) :
        (star z).im = -z.im
        Equations
        • Zsqrtd.instStarRingZsqrtdToNonUnitalNonAssocSemiringToNonUnitalNonAssocRingToNonAssocRingInstRingZsqrtd = StarRing.mk (_ : ∀ (a b : ℤ√d), star (a + b) = star a + star b)
        @[simp]
        theorem Zsqrtd.coe_nat_re {d : ℤ} (n : ℕ) :
        (↑n).re = ↑n
        @[simp]
        theorem Zsqrtd.ofNat_re {d : ℤ} (n : ℕ) [Nat.AtLeastTwo n] :
        (OfNat.ofNat n).re = ↑n
        @[simp]
        theorem Zsqrtd.coe_nat_im {d : ℤ} (n : ℕ) :
        (↑n).im = 0
        @[simp]
        theorem Zsqrtd.ofNat_im {d : ℤ} (n : ℕ) [Nat.AtLeastTwo n] :
        (OfNat.ofNat n).im = 0
        theorem Zsqrtd.coe_nat_val {d : ℤ} (n : ℕ) :
        ↑n = { re := ↑n, im := 0 }
        @[simp]
        theorem Zsqrtd.coe_int_re {d : ℤ} (n : ℤ) :
        (↑n).re = n
        @[simp]
        theorem Zsqrtd.coe_int_im {d : ℤ} (n : ℤ) :
        (↑n).im = 0
        theorem Zsqrtd.coe_int_val {d : ℤ} (n : ℤ) :
        ↑n = { re := n, im := 0 }
        @[simp]
        theorem Zsqrtd.ofInt_eq_coe {d : ℤ} (n : ℤ) :
        @[simp]
        theorem Zsqrtd.smul_val {d : ℤ} (n : ℤ) (x : ℤ) (y : ℤ) :
        ↑n * { re := x, im := y } = { re := n * x, im := n * y }
        theorem Zsqrtd.smul_re {d : ℤ} (a : ℤ) (b : ℤ√d) :
        (↑a * b).re = a * b.re
        theorem Zsqrtd.smul_im {d : ℤ} (a : ℤ) (b : ℤ√d) :
        (↑a * b).im = a * b.im
        @[simp]
        theorem Zsqrtd.muld_val {d : ℤ} (x : ℤ) (y : ℤ) :
        Zsqrtd.sqrtd * { re := x, im := y } = { re := d * y, im := x }
        @[simp]
        theorem Zsqrtd.dmuld {d : ℤ} :
        Zsqrtd.sqrtd * Zsqrtd.sqrtd = ↑d
        @[simp]
        theorem Zsqrtd.smuld_val {d : ℤ} (n : ℤ) (x : ℤ) (y : ℤ) :
        Zsqrtd.sqrtd * ↑n * { re := x, im := y } = { re := d * n * y, im := n * x }
        theorem Zsqrtd.decompose {d : ℤ} {x : ℤ} {y : ℤ} :
        { re := x, im := y } = ↑x + Zsqrtd.sqrtd * ↑y
        theorem Zsqrtd.mul_star {d : ℤ} {x : ℤ} {y : ℤ} :
        { re := x, im := y } * star { re := x, im := y } = ↑x * ↑x - ↑d * ↑y * ↑y
        theorem Zsqrtd.coe_int_add {d : ℤ} (m : ℤ) (n : ℤ) :
        ↑(m + n) = ↑m + ↑n
        theorem Zsqrtd.coe_int_sub {d : ℤ} (m : ℤ) (n : ℤ) :
        ↑(m - n) = ↑m - ↑n
        theorem Zsqrtd.coe_int_mul {d : ℤ} (m : ℤ) (n : ℤ) :
        ↑(m * n) = ↑m * ↑n
        theorem Zsqrtd.coe_int_inj {d : ℤ} {m : ℤ} {n : ℤ} (h : ↑m = ↑n) :
        m = n
        theorem Zsqrtd.coe_int_dvd_iff {d : ℤ} (z : ℤ) (a : ℤ√d) :
        ↑z ∣ a ↔ z ∣ a.re ∧ z ∣ a.im
        @[simp]
        theorem Zsqrtd.coe_int_dvd_coe_int {d : ℤ} (a : ℤ) (b : ℤ) :
        ↑a ∣ ↑b ↔ a ∣ b
        theorem Zsqrtd.eq_of_smul_eq_smul_left {d : ℤ} {a : ℤ} {b : ℤ√d} {c : ℤ√d} (ha : a ≠ 0) (h : ↑a * b = ↑a * c) :
        b = c
        theorem Zsqrtd.gcd_eq_zero_iff {d : ℤ} (a : ℤ√d) :
        Int.gcd a.re a.im = 0 ↔ a = 0
        theorem Zsqrtd.gcd_pos_iff {d : ℤ} (a : ℤ√d) :
        0 < Int.gcd a.re a.im ↔ a ≠ 0
        theorem Zsqrtd.coprime_of_dvd_coprime {d : ℤ} {a : ℤ√d} {b : ℤ√d} (hcoprime : IsCoprime a.re a.im) (hdvd : b ∣ a) :
        IsCoprime b.re b.im
        theorem Zsqrtd.exists_coprime_of_gcd_pos {d : ℤ} {a : ℤ√d} (hgcd : 0 < Int.gcd a.re a.im) :
        ∃ b, a = ↑↑(Int.gcd a.re a.im) * b ∧ IsCoprime b.re b.im
        def Zsqrtd.SqLe (a : ℕ) (c : ℕ) (b : ℕ) (d : ℕ) :

        Read SqLe a c b d as a √c ≤ b √d

        Equations
        Instances For
          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) :
          c * (x * z) ≤ d * (y * w)
          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)
          def Zsqrtd.Nonnegg (c : ℕ) (d : ℕ) :
          ℤ → ℤ → Prop

          "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

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            theorem Zsqrtd.nonnegg_comm {c : ℕ} {d : ℕ} {x : ℤ} {y : ℤ} :
            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
            def Zsqrtd.norm {d : ℤ} (n : ℤ√d) :

            The norm of an element of ℤ[√d].

            Equations
            Instances For
              theorem Zsqrtd.norm_def {d : ℤ} (n : ℤ√d) :
              Zsqrtd.norm n = n.re * n.re - d * n.im * n.im
              @[simp]
              theorem Zsqrtd.norm_zero {d : ℤ} :
              @[simp]
              theorem Zsqrtd.norm_one {d : ℤ} :
              @[simp]
              theorem Zsqrtd.norm_int_cast {d : ℤ} (n : ℤ) :
              Zsqrtd.norm ↑n = n * n
              @[simp]
              theorem Zsqrtd.norm_nat_cast {d : ℤ} (n : ℕ) :
              Zsqrtd.norm ↑n = ↑n * ↑n
              @[simp]
              theorem Zsqrtd.norm_mul {d : ℤ} (n : ℤ√d) (m : ℤ√d) :

              norm as a MonoidHom.

              Equations
              Instances For
                theorem Zsqrtd.norm_eq_mul_conj {d : ℤ} (n : ℤ√d) :
                ↑(Zsqrtd.norm n) = n * star n
                @[simp]
                theorem Zsqrtd.norm_neg {d : ℤ} (x : ℤ√d) :
                @[simp]
                theorem Zsqrtd.norm_nonneg {d : ℤ} (hd : d ≤ 0) (n : ℤ√d) :
                theorem Zsqrtd.norm_eq_one_iff' {d : ℤ} (hd : d ≤ 0) (z : ℤ√d) :
                theorem Zsqrtd.norm_eq_zero_iff {d : ℤ} (hd : d < 0) (z : ℤ√d) :
                Zsqrtd.norm z = 0 ↔ z = 0
                theorem Zsqrtd.norm_eq_of_associated {d : ℤ} (hd : d ≤ 0) {x : ℤ√d} {y : ℤ√d} (h : Associated x y) :
                def Zsqrtd.Nonneg {d : ℕ} :
                ℤ√↑d → Prop

                Nonnegativity of an element of ℤ√d.

                Equations
                Instances For
                  Equations
                  • Zsqrtd.instLEZsqrtdCastIntInstNatCastInt = { le := fun a b => Zsqrtd.Nonneg (b - a) }
                  Equations
                  • Zsqrtd.instLTZsqrtdCastIntInstNatCastInt = { lt := fun a b => ¬b ≤ a }
                  instance Zsqrtd.decidableNonnegg (c : ℕ) (d : ℕ) (a : ℤ) (b : ℤ) :
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Equations
                  instance Zsqrtd.decidableLE {d : ℕ} :
                  DecidableRel fun x x_1 => x ≤ x_1
                  Equations
                  theorem Zsqrtd.nonneg_cases {d : ℕ} {a : ℤ√↑d} :
                  Zsqrtd.Nonneg a → ∃ x y, a = { re := ↑x, im := ↑y } ∨ a = { re := ↑x, im := -↑y } ∨ a = { re := -↑x, im := ↑y }
                  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) :
                  theorem Zsqrtd.le_of_le_le {d : ℕ} {x : ℤ} {y : ℤ} {z : ℤ} {w : ℤ} (xz : x ≤ z) (yw : y ≤ w) :
                  { re := x, im := y } ≤ { re := z, im := w }
                  theorem Zsqrtd.le_total {d : ℕ} (a : ℤ√↑d) (b : ℤ√↑d) :
                  a ≤ b ∨ b ≤ a
                  instance Zsqrtd.preorder {d : ℕ} :
                  Equations
                  theorem Zsqrtd.le_arch {d : ℕ} (a : ℤ√↑d) :
                  ∃ n, a ≤ ↑n
                  theorem Zsqrtd.add_le_add_left {d : ℕ} (a : ℤ√↑d) (b : ℤ√↑d) (ab : a ≤ b) (c : ℤ√↑d) :
                  c + a ≤ c + b
                  theorem Zsqrtd.le_of_add_le_add_left {d : ℕ} (a : ℤ√↑d) (b : ℤ√↑d) (c : ℤ√↑d) (h : c + a ≤ c + b) :
                  a ≤ b
                  theorem Zsqrtd.add_lt_add_left {d : ℕ} (a : ℤ√↑d) (b : ℤ√↑d) (h : a < b) (c : ℤ√↑d) :
                  c + a < c + b
                  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) :
                  theorem Zsqrtd.mul_nonneg {d : ℕ} (a : ℤ√↑d) (b : ℤ√↑d) :
                  0 ≤ a → 0 ≤ b → 0 ≤ a * b
                  theorem Zsqrtd.not_sqLe_succ (c : ℕ) (d : ℕ) (y : ℕ) (h : 0 < c) :
                  ¬Zsqrtd.SqLe (y + 1) c 0 d

                  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.

                  Instances
                    theorem Zsqrtd.Nonsquare.ns (x : ℕ) [Zsqrtd.Nonsquare x] (n : ℕ) :
                    x ≠ n * n
                    theorem Zsqrtd.d_pos {d : ℕ} [dnsq : Zsqrtd.Nonsquare d] :
                    0 < d
                    theorem Zsqrtd.divides_sq_eq_zero {d : ℕ} [dnsq : Zsqrtd.Nonsquare d] {x : ℕ} {y : ℕ} (h : x * x = d * y * y) :
                    x = 0 ∧ y = 0
                    theorem Zsqrtd.divides_sq_eq_zero_z {d : ℕ} [dnsq : Zsqrtd.Nonsquare d] {x : ℤ} {y : ℤ} (h : x * x = ↑d * y * y) :
                    x = 0 ∧ y = 0
                    theorem Zsqrtd.not_divides_sq {d : ℕ} [dnsq : Zsqrtd.Nonsquare d] (x : ℕ) (y : ℕ) :
                    (x + 1) * (x + 1) ≠ d * (y + 1) * (y + 1)
                    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.linearOrder {d : ℕ} [dnsq : Zsqrtd.Nonsquare d] :
                    Equations
                    • Zsqrtd.linearOrder = let src := Zsqrtd.preorder; LinearOrder.mk (_ : ∀ (a b : ℤ√↑d), a ≤ b ∨ b ≤ a) Zsqrtd.decidableLE decidableEqOfDecidableLE decidableLTOfDecidableLE
                    theorem Zsqrtd.eq_zero_or_eq_zero_of_mul_eq_zero {d : ℕ} [dnsq : Zsqrtd.Nonsquare d] {a : ℤ√↑d} {b : ℤ√↑d} :
                    a * b = 0 → a = 0 ∨ b = 0
                    theorem Zsqrtd.mul_pos {d : ℕ} [dnsq : Zsqrtd.Nonsquare d] (a : ℤ√↑d) (b : ℤ√↑d) (a0 : 0 < a) (b0 : 0 < b) :
                    0 < a * b
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Equations
                    • Zsqrtd.instLinearOrderedRingZsqrtdCastIntInstNatCastInt = inferInstance
                    Equations
                    • Zsqrtd.instOrderedRingZsqrtdCastIntInstNatCastInt = inferInstance
                    theorem Zsqrtd.norm_eq_zero {d : ℤ} (h_nonsquare : ∀ (n : ℤ), d ≠ n * n) (a : ℤ√d) :
                    Zsqrtd.norm a = 0 ↔ a = 0
                    theorem Zsqrtd.hom_ext {R : Type} [Ring R] {d : ℤ} (f : ℤ√d →+* R) (g : ℤ√d →+* R) (h : ↑f Zsqrtd.sqrtd = ↑g Zsqrtd.sqrtd) :
                    f = g
                    @[simp]
                    theorem Zsqrtd.lift_apply_apply {R : Type} [CommRing R] {d : ℤ} (r : { r // r * r = ↑d }) (a : ℤ√d) :
                    ↑(↑Zsqrtd.lift r) a = ↑a.re + ↑a.im * ↑r
                    @[simp]
                    theorem Zsqrtd.lift_symm_apply_coe {R : Type} [CommRing R] {d : ℤ} (f : ℤ√d →+* R) :
                    ↑(↑Zsqrtd.lift.symm f) = ↑f Zsqrtd.sqrtd
                    def Zsqrtd.lift {R : Type} [CommRing R] {d : ℤ} :
                    { r // r * r = ↑d } ≃ (ℤ√d →+* R)

                    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
                      theorem Zsqrtd.lift_injective {R : Type} [CommRing R] [CharZero R] {d : ℤ} (r : { r // r * r = ↑d }) (hd : ∀ (n : ℤ), d ≠ n * n) :
                      Function.Injective ↑(↑Zsqrtd.lift r)

                      lift r is injective if d is non-square, and R has characteristic zero (that is, the map from ℤ into R is injective).

                      An element of ℤ√d has norm equal to 1 if and only if it is contained in the submonoid of unitary elements.

                      theorem Zsqrtd.mker_norm_eq_unitary {d : ℤ} :
                      MonoidHom.mker Zsqrtd.normMonoidHom = unitary (ℤ√d)

                      The kernel of the norm map on ℤ√d equals the submonoid of unitary elements.