File: Mathlib/NumberTheory/Zsqrtd/GaussianInt.lean

full_name: GaussianInt
code: /-- The Gaussian integers, defined as `ℤ√(-1)`. -/
abbrev GaussianInt : Type 
goal: Type

full_name: «_aux_Mathlib_NumberTheory_Zsqrtd_GaussianInt___macroRules_termℤ[i]_1»
code: local notation "ℤ[i]" => GaussianInt
goal: Lean.Macro

full_name: _aux_Mathlib_NumberTheory_Zsqrtd_GaussianInt___unexpand_GaussianInt_1
code: local notation "ℤ[i]" => GaussianInt
goal: Lean.PrettyPrinter.Unexpander

full_name: GaussianInt.instRepr
code: instance : Repr ℤ[i] 
goal: Repr ℤ[i]

full_name: GaussianInt.instCommRing
code: instance instCommRing : CommRing ℤ[i] 
goal: CommRing ℤ[i]

full_name: GaussianInt.toComplex
code: /-- The embedding of the Gaussian integers into the complex numbers, as a ring homomorphism. -/
def toComplex : ℤ[i] →+* ℂ 
goal: ℤ[i] →+* ℂ

full_name: GaussianInt.instCoeComplex
code: instance : Coe ℤ[i] ℂ 
goal: Coe ℤ[i] ℂ

full_name: GaussianInt.toComplex_def
code: theorem toComplex_def (x : ℤ[i]) : (x : ℂ) = x.re + x.im * I 
goal: GaussianInt.toComplex x = ↑x.re + ↑x.im * Complex.I

full_name: GaussianInt.toComplex_def'
code: theorem toComplex_def' (x y : ℤ) : ((⟨x, y⟩ : ℤ[i]) : ℂ) = x + y * I 
goal: GaussianInt.toComplex { re := x, im := y } = ↑x + ↑y * Complex.I

full_name: GaussianInt.toComplex_def₂
code: theorem toComplex_def₂ (x : ℤ[i]) : (x : ℂ) = ⟨x.re, x.im⟩ 
goal: GaussianInt.toComplex x = { re := ↑x.re, im := ↑x.im }

full_name: GaussianInt.to_real_re
code: @[simp]
theorem to_real_re (x : ℤ[i]) : ((x.re : ℤ) : ℝ) = (x : ℂ).re 
goal: ↑x.re = (GaussianInt.toComplex x).re

full_name: GaussianInt.to_real_im
code: @[simp]
theorem to_real_im (x : ℤ[i]) : ((x.im : ℤ) : ℝ) = (x : ℂ).im 
goal: ↑x.im = (GaussianInt.toComplex x).im

full_name: GaussianInt.toComplex_re
code: @[simp]
theorem toComplex_re (x y : ℤ) : ((⟨x, y⟩ : ℤ[i]) : ℂ).re = x 
goal: (GaussianInt.toComplex { re := x, im := y }).re = ↑x

full_name: GaussianInt.toComplex_im
code: @[simp]
theorem toComplex_im (x y : ℤ) : ((⟨x, y⟩ : ℤ[i]) : ℂ).im = y 
goal: (GaussianInt.toComplex { re := x, im := y }).im = ↑y

full_name: GaussianInt.toComplex_add
code: theorem toComplex_add (x y : ℤ[i]) : ((x + y : ℤ[i]) : ℂ) = x + y 
goal: GaussianInt.toComplex (x + y) = GaussianInt.toComplex x + GaussianInt.toComplex y

full_name: GaussianInt.toComplex_mul
code: theorem toComplex_mul (x y : ℤ[i]) : ((x * y : ℤ[i]) : ℂ) = x * y 
goal: GaussianInt.toComplex (x * y) = GaussianInt.toComplex x * GaussianInt.toComplex y

full_name: GaussianInt.toComplex_one
code: theorem toComplex_one : ((1 : ℤ[i]) : ℂ) = 1 
goal: GaussianInt.toComplex 1 = 1

full_name: GaussianInt.toComplex_zero
code: theorem toComplex_zero : ((0 : ℤ[i]) : ℂ) = 0 
goal: GaussianInt.toComplex 0 = 0

full_name: GaussianInt.toComplex_neg
code: theorem toComplex_neg (x : ℤ[i]) : ((-x : ℤ[i]) : ℂ) = -x 
goal: GaussianInt.toComplex (-x) = -GaussianInt.toComplex x

full_name: GaussianInt.toComplex_sub
code: theorem toComplex_sub (x y : ℤ[i]) : ((x - y : ℤ[i]) : ℂ) = x - y 
goal: GaussianInt.toComplex (x - y) = GaussianInt.toComplex x - GaussianInt.toComplex y

full_name: GaussianInt.toComplex_star
code: @[simp]
theorem toComplex_star (x : ℤ[i]) : ((star x : ℤ[i]) : ℂ) = conj (x : ℂ) 
goal: GaussianInt.toComplex (star x) = (starRingEnd ℂ) (GaussianInt.toComplex x)

full_name: GaussianInt.toComplex_inj
code: @[simp]
theorem toComplex_inj {x y : ℤ[i]} : (x : ℂ) = y ↔ x = y 
goal: GaussianInt.toComplex x = GaussianInt.toComplex y ↔ x = y

full_name: GaussianInt.toComplex_injective
code: lemma toComplex_injective : Function.Injective GaussianInt.toComplex 
goal: Function.Injective ⇑GaussianInt.toComplex

full_name: GaussianInt.toComplex_eq_zero
code: @[simp]
theorem toComplex_eq_zero {x : ℤ[i]} : (x : ℂ) = 0 ↔ x = 0 
goal: GaussianInt.toComplex x = 0 ↔ x = 0

full_name: GaussianInt.intCast_real_norm
code: @[simp]
theorem intCast_real_norm (x : ℤ[i]) : (x.norm : ℝ) = Complex.normSq (x : ℂ) 
goal: ↑(Zsqrtd.norm x) = Complex.normSq (GaussianInt.toComplex x)

full_name: GaussianInt.intCast_complex_norm
code: @[simp]
theorem intCast_complex_norm (x : ℤ[i]) : (x.norm : ℂ) = Complex.normSq (x : ℂ) 
goal: ↑(Zsqrtd.norm x) = ↑(Complex.normSq (GaussianInt.toComplex x))

full_name: GaussianInt.norm_nonneg
code: theorem norm_nonneg (x : ℤ[i]) : 0 ≤ norm x 
goal: 0 ≤ Zsqrtd.norm x

full_name: GaussianInt.norm_eq_zero
code: @[simp]
theorem norm_eq_zero {x : ℤ[i]} : norm x = 0 ↔ x = 0 
goal: Zsqrtd.norm x = 0 ↔ x = 0

full_name: GaussianInt.norm_pos
code: theorem norm_pos {x : ℤ[i]} : 0 < norm x ↔ x ≠ 0 
goal: 0 < Zsqrtd.norm x ↔ x ≠ 0

full_name: GaussianInt.abs_natCast_norm
code: theorem abs_natCast_norm (x : ℤ[i]) : (x.norm.natAbs : ℤ) = x.norm 
goal: ↑(Zsqrtd.norm x).natAbs = Zsqrtd.norm x

full_name: GaussianInt.natCast_natAbs_norm
code: @[simp]
theorem natCast_natAbs_norm {α : Type*} [Ring α] (x : ℤ[i]) : (x.norm.natAbs : α) = x.norm 
goal: ↑(Zsqrtd.norm x).natAbs = ↑(Zsqrtd.norm x)

full_name: GaussianInt.natAbs_norm_eq
code: theorem natAbs_norm_eq (x : ℤ[i]) :
    x.norm.natAbs = x.re.natAbs * x.re.natAbs + x.im.natAbs * x.im.natAbs 
goal: (Zsqrtd.norm x).natAbs = x.re.natAbs * x.re.natAbs + x.im.natAbs * x.im.natAbs

full_name: GaussianInt.instDiv
code: instance : Div ℤ[i] 
goal: Div ℤ[i]

full_name: GaussianInt.div_def
code: theorem div_def (x y : ℤ[i]) :
    x / y = ⟨round ((x * star y).re / norm y : ℚ), round ((x * star y).im / norm y : ℚ)⟩ 
goal: x / y = { re := round (↑(x * star y).re / ↑(Zsqrtd.norm y)), im := round (↑(x * star y).im / ↑(Zsqrtd.norm y)) }

full_name: GaussianInt.toComplex_div_re
code: theorem toComplex_div_re (x y : ℤ[i]) : ((x / y : ℤ[i]) : ℂ).re = round (x / y : ℂ).re 
goal: (GaussianInt.toComplex (x / y)).re = ↑(round (GaussianInt.toComplex x / GaussianInt.toComplex y).re)

full_name: GaussianInt.toComplex_div_im
code: theorem toComplex_div_im (x y : ℤ[i]) : ((x / y : ℤ[i]) : ℂ).im = round (x / y : ℂ).im 
goal: (GaussianInt.toComplex (x / y)).im = ↑(round (GaussianInt.toComplex x / GaussianInt.toComplex y).im)

full_name: GaussianInt.normSq_le_normSq_of_re_le_of_im_le
code: theorem normSq_le_normSq_of_re_le_of_im_le {x y : ℂ} (hre : |x.re| ≤ |y.re|)
    (him : |x.im| ≤ |y.im|) : Complex.normSq x ≤ Complex.normSq y 
goal: Complex.normSq x ≤ Complex.normSq y

full_name: GaussianInt.normSq_div_sub_div_lt_one
code: theorem normSq_div_sub_div_lt_one (x y : ℤ[i]) :
    Complex.normSq ((x / y : ℂ) - ((x / y : ℤ[i]) : ℂ)) < 1 
goal: Complex.normSq (GaussianInt.toComplex x / GaussianInt.toComplex y - GaussianInt.toComplex (x / y)) < 1

full_name: GaussianInt.instMod
code: instance : Mod ℤ[i] 
goal: Mod ℤ[i]

full_name: GaussianInt.mod_def
code: theorem mod_def (x y : ℤ[i]) : x % y = x - y * (x / y) 
goal: x % y = x - y * (x / y)

full_name: GaussianInt.norm_mod_lt
code: theorem norm_mod_lt (x : ℤ[i]) {y : ℤ[i]} (hy : y ≠ 0) : (x % y).norm < y.norm 
goal: Zsqrtd.norm (x % y) < Zsqrtd.norm y

full_name: GaussianInt.natAbs_norm_mod_lt
code: theorem natAbs_norm_mod_lt (x : ℤ[i]) {y : ℤ[i]} (hy : y ≠ 0) :
    (x % y).norm.natAbs < y.norm.natAbs 
goal: (Zsqrtd.norm (x % y)).natAbs < (Zsqrtd.norm y).natAbs

full_name: GaussianInt.norm_le_norm_mul_left
code: theorem norm_le_norm_mul_left (x : ℤ[i]) {y : ℤ[i]} (hy : y ≠ 0) :
    (norm x).natAbs ≤ (norm (x * y)).natAbs 
goal: (Zsqrtd.norm x).natAbs ≤ (Zsqrtd.norm (x * y)).natAbs

full_name: GaussianInt.instNontrivial
code: instance instNontrivial : Nontrivial ℤ[i] 
goal: Nontrivial ℤ[i]

full_name: GaussianInt.instEuclideanDomain
code: instance : EuclideanDomain ℤ[i] 
goal: EuclideanDomain ℤ[i]

full_name: GaussianInt.sq_add_sq_of_nat_prime_of_not_irreducible
code: theorem sq_add_sq_of_nat_prime_of_not_irreducible (p : ℕ) [hp : Fact p.Prime]
    (hpi : ¬Irreducible (p : ℤ[i])) : ∃ a b, a ^ 2 + b ^ 2 = p 
goal: ∃ a b, a ^ 2 + b ^ 2 = p