Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 219e298

Browse files
kbuzzardkim-em
andcommitted
feat(ring_theory/discrete_valuation_ring): add DVR (#3476)
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
1 parent 84d6497 commit 219e298

File tree

3 files changed

+200
-1
lines changed

3 files changed

+200
-1
lines changed

src/algebra/associated.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@ lemma associated_mul_mul [comm_monoid α] {a₁ a₂ b₁ b₂ : α} :
239239
a₁ ~ᵤ b₁ → a₂ ~ᵤ b₂ → (a₁ * a₂) ~ᵤ (b₁ * b₂)
240240
| ⟨c₁, h₁⟩ ⟨c₂, h₂⟩ := ⟨c₁ * c₂, by simp [h₁.symm, h₂.symm, mul_assoc, mul_comm, mul_left_comm]⟩
241241

242+
lemma dvd_of_associated [comm_ring α] {a b : α} : a ~ᵤ b → a ∣ b := λ ⟨u, hu⟩, ⟨u, hu.symm⟩
243+
244+
lemma dvd_dvd_of_associated [comm_ring α] {a b : α} (h : a ~ᵤ b) : a ∣ b ∧ b ∣ a :=
245+
⟨dvd_of_associated h, dvd_of_associated h.symm⟩
246+
242247
theorem associated_of_dvd_dvd [integral_domain α] {a b : α} (hab : a ∣ b) (hba : b ∣ a) : a ~ᵤ b :=
243248
begin
244249
haveI := classical.dec_eq α,
@@ -252,6 +257,9 @@ begin
252257
exact ⟨units.mk_of_mul_eq_one c d (this.symm), by rw [units.mk_of_mul_eq_one, units.val_coe]⟩
253258
end
254259

260+
theorem dvd_dvd_iff_associated [integral_domain α] {a b : α} : a ∣ b ∧ b ∣ a ↔ a ~ᵤ b :=
261+
⟨λ ⟨h1, h2⟩, associated_of_dvd_dvd h1 h2, dvd_dvd_of_associated⟩
262+
255263
lemma exists_associated_mem_of_dvd_prod [integral_domain α] {p : α}
256264
(hp : prime p) {s : multiset α} : (∀ r ∈ s, prime r) → p ∣ s.prod → ∃ q ∈ s, p ~ᵤ q :=
257265
multiset.induction_on s (by simp [mt is_unit_iff_dvd_one.2 hp.not_unit])
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
/-
2+
Copyright (c) 2020 Kevin Buzzard. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Kevin Buzzard
5+
-/
6+
7+
import ring_theory.principal_ideal_domain order.conditionally_complete_lattice
8+
import ring_theory.multiplicity
9+
import ring_theory.valuation.basic
10+
import tactic
11+
12+
/-!
13+
# Discrete valuation rings
14+
15+
This file defines discrete valuation rings (DVRs) and develops a basic interface
16+
for them.
17+
18+
## Important definitions
19+
20+
There are various definitions of a DVR in the literature; we define a DVR to be a local PID
21+
which is not a field (the first definition in Wikipedia) and prove that this is equivalent
22+
to being a PID with a unique non-zero prime ideal (the definition in Serre's
23+
book "Local Fields").
24+
25+
Let R be an integral domain, assumed to be a principal ideal ring and a local ring.
26+
27+
* `discrete_valuation_ring R` : a predicate expressing that R is a DVR
28+
29+
### Notation
30+
31+
It's a theorem that an element of a DVR is a uniformiser if and only if it's irreducible.
32+
We do not hence define `uniformiser` at all, because we can use `irreducible` instead.
33+
34+
### Definitions
35+
36+
## Implementation notes
37+
38+
## Tags
39+
40+
discrete valuation ring
41+
-/
42+
43+
open_locale classical
44+
45+
universe u
46+
47+
open ideal local_ring
48+
49+
section prio
50+
set_option default_priority 100 -- see Note [default priority]
51+
/-- An integral domain is a discrete valuation ring if it's a local PID which is not a field -/
52+
class discrete_valuation_ring (R : Type u) [integral_domain R]
53+
extends is_principal_ideal_ring R, local_ring R : Prop :=
54+
(not_a_field' : maximal_ideal R ≠ ⊥)
55+
end prio
56+
57+
namespace discrete_valuation_ring
58+
59+
variables (R : Type u) [integral_domain R] [discrete_valuation_ring R]
60+
61+
lemma not_a_field : maximal_ideal R ≠ ⊥ := not_a_field'
62+
63+
variable {R}
64+
65+
open principal_ideal_ring
66+
67+
/-- An element of a DVR is irreducible iff it is a uniformiser, that is, generates the
68+
maximal ideal of R -/
69+
theorem irreducible_iff_uniformiser (ϖ : R) :
70+
irreducible ϖ ↔ maximal_ideal R = ideal.span {ϖ} :=
71+
⟨λ hϖ, (eq_maximal_ideal (is_maximal_of_irreducible hϖ)).symm,
72+
begin
73+
intro h,
74+
have h2 : ¬(is_unit ϖ) := show ϖ ∈ maximal_ideal R,
75+
from h.symm ▸ submodule.mem_span_singleton_self ϖ,
76+
split, exact h2,
77+
intros a b hab,
78+
by_contra h,
79+
push_neg at h,
80+
cases h with ha hb,
81+
change a ∈ maximal_ideal R at ha,
82+
change b ∈ maximal_ideal R at hb,
83+
rw h at ha hb,
84+
rw mem_span_singleton' at ha hb,
85+
rcases ha with ⟨a, rfl⟩,
86+
rcases hb with ⟨b, rfl⟩,
87+
rw (show a * ϖ * (b * ϖ) = ϖ * (ϖ * (a * b)), by ring) at hab,
88+
have h3 := eq_zero_of_mul_eq_self_right _ hab.symm,
89+
{ apply not_a_field R,
90+
simp [h, h3]},
91+
{ intro hh, apply h2,
92+
refine is_unit_of_dvd_one ϖ _,
93+
use a * b, exact hh.symm}
94+
end
95+
96+
variable (R)
97+
98+
/-- Uniformisers exist in a DVR -/
99+
theorem exists_irreducible : ∃ ϖ : R, irreducible ϖ :=
100+
by {simp_rw [irreducible_iff_uniformiser],
101+
exact (is_principal_ideal_ring.principal $ maximal_ideal R).principal}
102+
103+
/-- an integral domain is a DVR iff it's a PID with a unique non-zero prime ideal -/
104+
theorem iff_PID_with_one_nonzero_prime (R : Type u) [integral_domain R] :
105+
discrete_valuation_ring R ↔ is_principal_ideal_ring R ∧ ∃! P : ideal R, P ≠ ⊥ ∧ is_prime P :=
106+
begin
107+
split,
108+
{ intro RDVR,
109+
rcases id RDVR with ⟨RPID, Rlocal, Rnotafield⟩,
110+
split, assumption,
111+
resetI,
112+
use local_ring.maximal_ideal R,
113+
split, split,
114+
{ assumption},
115+
{ apply_instance},
116+
{ rintro Q ⟨hQ1, hQ2⟩,
117+
obtain ⟨q, rfl⟩ := (is_principal_ideal_ring.principal Q).1,
118+
have hq : q ≠ 0,
119+
{ rintro rfl,
120+
apply hQ1,
121+
simp,
122+
},
123+
erw span_singleton_prime hq at hQ2,
124+
replace hQ2 := irreducible_of_prime hQ2,
125+
rw irreducible_iff_uniformiser at hQ2,
126+
exact hQ2.symm}},
127+
{ rintro ⟨RPID, Punique⟩,
128+
haveI : local_ring R := local_of_unique_nonzero_prime R Punique,
129+
refine {not_a_field' := _},
130+
rcases Punique with ⟨P, ⟨hP1, hP2⟩, hP3⟩,
131+
have hPM : P ≤ maximal_ideal R := le_maximal_ideal (hP2.1),
132+
intro h, rw [h, le_bot_iff] at hPM, exact hP1 hPM}
133+
end
134+
135+
lemma associated_of_irreducible {a b : R} (ha : irreducible a) (hb : irreducible b) :
136+
associated a b :=
137+
begin
138+
rw irreducible_iff_uniformiser at ha hb,
139+
rw [←span_singleton_eq_span_singleton, ←ha, hb],
140+
end
141+
142+
end discrete_valuation_ring

src/ring_theory/ideals.lean

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ lemma span_singleton_le_span_singleton {x y : α} :
6868
span ({x} : set α) ≤ span ({y} : set α) ↔ y ∣ x :=
6969
span_le.trans $ singleton_subset_iff.trans mem_span_singleton
7070

71+
lemma span_singleton_eq_span_singleton {α : Type u} [integral_domain α] {x y : α} :
72+
span ({x} : set α) = span ({y} : set α) ↔ associated x y :=
73+
begin
74+
rw [←dvd_dvd_iff_associated, le_antisymm_iff, and_comm],
75+
apply and_congr;
76+
rw span_singleton_le_span_singleton,
77+
end
78+
7179
lemma span_eq_bot {s : set α} : span s = ⊥ ↔ ∀ x ∈ s, (x:α) = 0 := submodule.span_eq_bot
7280

7381
@[simp] lemma span_singleton_eq_bot {x} : span ({x} : set α) = ⊥ ↔ x = 0 :=
@@ -79,6 +87,17 @@ lemma span_singleton_eq_top {x} : span ({x} : set α) = ⊤ ↔ is_unit x :=
7987
by rw [is_unit_iff_dvd_one, ← span_singleton_le_span_singleton, singleton_one, span_singleton_one,
8088
eq_top_iff]
8189

90+
lemma span_singleton_mul_right_unit {a : α} (h2 : is_unit a) (x : α) :
91+
span ({x * a} : set α) = span {x} :=
92+
begin
93+
apply le_antisymm,
94+
{ rw span_singleton_le_span_singleton, use a},
95+
{ rw span_singleton_le_span_singleton, rw mul_dvd_of_is_unit_right h2}
96+
end
97+
98+
lemma span_singleton_mul_left_unit {a : α} (h2 : is_unit a) (x : α) :
99+
span ({a * x} : set α) = span {x} := by rw [mul_comm, span_singleton_mul_right_unit h2]
100+
82101
/-- An ideal `P` of a ring `R` is prime if `P ≠ R` and `xy ∈ P → x ∈ P ∨ y ∈ P` -/
83102
@[class] def is_prime (I : ideal α) : Prop :=
84103
I ≠ ⊤ ∧ ∀ {x y : α}, x * y ∈ I → x ∈ I ∨ y ∈ I
@@ -158,6 +177,16 @@ begin
158177
exact SC JS ((eq_top_iff_one _).2 J0) }
159178
end
160179

180+
/-- If P is not properly contained in any maximal ideal then it is not properly contained
181+
in any proper ideal -/
182+
lemma maximal_of_no_maximal {R : Type u} [comm_ring R] {P : ideal R}
183+
(hmax : ∀ m : ideal R, P < m → ¬is_maximal m) (J : ideal R) (hPJ : P < J) : J = ⊤ :=
184+
begin
185+
by_contradiction hnonmax,
186+
rcases exists_le_maximal J hnonmax with ⟨M, hM1, hM2⟩,
187+
exact hmax M (lt_of_lt_of_le hPJ hM2) hM1,
188+
end
189+
161190
theorem mem_span_pair {x y z : α} :
162191
z ∈ span ({x, y} : set α) ↔ ∃ a b, a * x + b * y = z :=
163192
by simp [mem_span_insert, mem_span_singleton', @eq_comm _ _ z]
@@ -402,14 +431,23 @@ begin
402431
simpa using I.smul_mem ↑u⁻¹ H }
403432
end
404433

405-
lemma max_ideal_unique :
434+
lemma maximal_ideal_unique :
406435
∃! I : ideal α, I.is_maximal :=
407436
⟨maximal_ideal α, maximal_ideal.is_maximal α,
408437
λ I hI, hI.eq_of_le (maximal_ideal.is_maximal α).1 $
409438
λ x hx, hI.1 ∘ I.eq_top_of_is_unit_mem hx⟩
410439

411440
variable {α}
412441

442+
lemma eq_maximal_ideal {I : ideal α} (hI : I.is_maximal) : I = maximal_ideal α :=
443+
unique_of_exists_unique (maximal_ideal_unique α) hI $ maximal_ideal.is_maximal α
444+
445+
lemma le_maximal_ideal {J : ideal α} (hJ : J ≠ ⊤) : J ≤ maximal_ideal α :=
446+
begin
447+
rcases ideal.exists_le_maximal J hJ with ⟨M, hM1, hM2⟩,
448+
rwa ←eq_maximal_ideal hM1
449+
end
450+
413451
@[simp] lemma mem_maximal_ideal (x) :
414452
x ∈ maximal_ideal α ↔ x ∈ nonunits α := iff.rfl
415453

@@ -437,6 +475,17 @@ have xmemI : x ∈ I, from ((Iuniq Ix Ixmax) ▸ Hx),
437475
have ymemI : y ∈ I, from ((Iuniq Iy Iymax) ▸ Hy),
438476
Imax.1 $ I.eq_top_of_is_unit_mem (I.add_mem xmemI ymemI) H
439477

478+
lemma local_of_unique_nonzero_prime (R : Type u) [comm_ring R]
479+
(h : ∃! P : ideal R, P ≠ ⊥ ∧ ideal.is_prime P) : local_ring R :=
480+
local_of_unique_max_ideal begin
481+
rcases h with ⟨P, ⟨hPnonzero, hPnot_top, _⟩, hPunique⟩,
482+
refine ⟨P, ⟨hPnot_top, _⟩, λ M hM, hPunique _ ⟨_, ideal.is_maximal.is_prime hM⟩⟩,
483+
{ refine ideal.maximal_of_no_maximal (λ M hPM hM, ne_of_lt hPM _),
484+
exact (hPunique _ ⟨ne_bot_of_gt hPM, ideal.is_maximal.is_prime hM⟩).symm },
485+
{ rintro rfl,
486+
exact hPnot_top (hM.2 P (bot_lt_iff_ne_bot.2 hPnonzero)) },
487+
end
488+
440489
section prio
441490
set_option default_priority 100 -- see Note [default priority]
442491
/-- A local ring homomorphism is a homomorphism between local rings

0 commit comments

Comments
 (0)