math / data /lean /OAI /LinearAlgebra /CirculantHadamard /IntegerTwoLocal.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
3.57 kB

The prime ideal (2) in the integers.

24
def ideal : Ideal ℤ := Ideal.span {(2 : ℤ)}
26
instance ideal_isPrime : ideal.IsPrime := by
body · 2 lines
  apply (Ideal.span_singleton_prime (by norm_num : (2 : ℤ) ≠ 0)).mpr
  exact Nat.prime_iff_prime_int.mp Nat.prime_two

The actual ring ℤ_(2).

31
abbrev Ring := Localization.AtPrime ideal

The localization has no zero divisors.

34
theorem isDomain : IsDomain Ring := inferInstance

The complement-of-prime localization is local.

37
theorem isLocalRing : IsLocalRing Ring := inferInstance

Integer coefficients embed faithfully in the concrete localization.

40
theorem algebraMap_injective : Function.Injective (algebraMap ℤ Ring) :=
proof · 1 line
  IsLocalization.injective Ring ideal.primeCompl_le_nonZeroDivisors
43
instance charZero : CharZero Ring :=
body · 1 line
  charZero_of_injective_algebraMap algebraMap_injective

Noetherianity is inherited from the integer ring by localization.

47
instance isNoetherianRing : IsNoetherianRing Ring :=
body · 2 lines
  IsLocalization.isNoetherianRing ideal.primeCompl Ring
    (inferInstance : IsNoetherianRing ℤ)

The maximal ideal is exactly the principal ideal generated by two.

52
theorem maximalIdeal_eq_span :
    IsLocalRing.maximalIdeal Ring = Ideal.span {(2 : Ring)} := by
proof · 5 lines
  calc
    IsLocalRing.maximalIdeal Ring = Ideal.map (algebraMap ℤ Ring) ideal :=
      (Localization.AtPrime.map_eq_maximalIdeal (I := ideal)).symm
    _ = Ideal.span {(2 : Ring)} := by
      simp only [ideal, Ideal.map_span, Set.image_singleton, map_ofNat]
60
theorem two_ne_zero : (2 : Ring) ≠ 0 := by norm_num
62
theorem two_not_isUnit : ¬ IsUnit (2 : Ring) := by
proof · 2 lines
  rw [← mem_nonunits_iff, ← IsLocalRing.mem_maximalIdeal, maximalIdeal_eq_span]
  exact Ideal.mem_span_singleton_self _

The concrete localization is a discrete valuation ring with uniformizer (two); this conclusion is obtained from its proved principal maximal ideal.

68
instance isDiscreteValuationRing : IsDiscreteValuationRing Ring :=
body · 2 lines
  LocalDVR.isDiscreteValuationRing_of_maximalIdeal_eq_span two_ne_zero
    maximalIdeal_eq_span
72
@[simp] theorem mem_ideal_iff_even (z : ℤ) : z ∈ ideal ↔ Even z := by
proof · 1 line
  simp only [ideal, Ideal.mem_span_singleton, even_iff_two_dvd]

Exactly the odd integers become units.

76
theorem isUnit_algebraMap_iff_odd (z : ℤ) :
    IsUnit (algebraMap ℤ Ring z) ↔ Odd z := by
proof · 3 lines
  rw [IsLocalization.AtPrime.isUnit_to_map_iff Ring ideal z]
  change z ∉ ideal ↔ Odd z
  rw [mem_ideal_iff_even, Int.not_even_iff_odd]
82
theorem isUnit_intCast_of_odd (z : ℤ) (hz : Odd z) : IsUnit (z : Ring) := by
proof · 1 line
  simpa using (isUnit_algebraMap_iff_odd z).mpr hz
85
theorem isUnit_natCast_of_odd (u : ℕ) (hu : Odd u) : IsUnit (u : Ring) := by
proof · 2 lines
  simpa only [Int.cast_natCast] using
    isUnit_intCast_of_odd (u : ℤ) ((Int.odd_coe_nat u).mpr hu)