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

Commit a46e8f7

Browse files
committed
cleanup(ring_theory/principal_ideal_domain): restructure
1 parent a3ac630 commit a46e8f7

File tree

1 file changed

+29
-21
lines changed

1 file changed

+29
-21
lines changed

ring_theory/principal_ideal_domain.lean

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Author: Chris Hughes, Morenikeji Neri
55
-/
66

7-
import algebra.euclidean_domain ring_theory.ideals
7+
import algebra.euclidean_domain
8+
import ring_theory.ideals
89

910
variables {α : Type*} [comm_ring α]
1011

@@ -44,7 +45,33 @@ instance to_is_ideal (S : set α) [is_principal_ideal S] : is_ideal S :=
4445

4546
end is_principal_ideal
4647

47-
open euclidean_domain is_principal_ideal is_ideal
48+
namespace is_prime_ideal
49+
open is_principal_ideal is_ideal
50+
51+
lemma to_maximal_ideal {α : Type*} [principal_ideal_domain α] {S : set α}
52+
[hpi : is_prime_ideal S] (hS : S ≠ trivial α) : is_maximal_ideal S :=
53+
is_maximal_ideal.mk _ (is_proper_ideal_iff_one_not_mem.1 (by apply_instance))
54+
begin
55+
assume x T i hST hxS hxT,
56+
haveI := principal_ideal_domain.principal S,
57+
haveI := principal_ideal_domain.principal T,
58+
cases (mem_iff_generator_dvd _).1 (hST ((mem_iff_generator_dvd _).2 (dvd_refl _))) with z hz,
59+
cases is_prime_ideal.mem_or_mem_of_mul_mem (show generator T * z ∈ S,
60+
by rw [mem_iff_generator_dvd S, ← hz]),
61+
{ have hST' : S = T := set.subset.antisymm hST
62+
(λ y hyT, (mem_iff_generator_dvd _).2
63+
(dvd.trans ((mem_iff_generator_dvd _).1 h) ((mem_iff_generator_dvd _).1 hyT))),
64+
cc },
65+
{ cases (mem_iff_generator_dvd _).1 h with y hy,
66+
rw [← mul_one (generator S), hy, mul_left_comm,
67+
domain.mul_left_inj (mt (eq_trivial_iff_generator_eq_zero S).2 hS)] at hz,
68+
exact hz.symm ▸ is_ideal.mul_right (generator_mem T) }
69+
end
70+
71+
end is_prime_ideal
72+
73+
section
74+
open euclidean_domain
4875

4976
lemma mod_mem_iff {α : Type*} [euclidean_domain α] {S : set α} [is_ideal S] {x y : α}
5077
(hy : y ∈ S) : x % y ∈ S ↔ x ∈ S :=
@@ -71,23 +98,4 @@ instance euclidean_domain.to_principal_ideal_domain {α : Type*} [euclidean_doma
7198
have x % well_founded.min wf {x : α | x ∈ S ∧ x ≠ 0} h = 0, by finish [(mod_mem_iff hmin.1).2 hx],
7299
by simp *),
73100
λ hx, let ⟨y, hy⟩ := hx in hy.symm ▸ is_ideal.mul_right hmin.1⟩⟩⟩ }
74-
75-
lemma is_prime_ideal.to_maximal_ideal {α : Type*} [principal_ideal_domain α] {S : set α}
76-
[hpi : is_prime_ideal S] (hS : S ≠ trivial α) : is_maximal_ideal S :=
77-
is_maximal_ideal.mk _ (is_proper_ideal_iff_one_not_mem.1 (by apply_instance))
78-
begin
79-
assume x T i hST hxS hxT,
80-
haveI := principal_ideal_domain.principal S,
81-
haveI := principal_ideal_domain.principal T,
82-
cases (mem_iff_generator_dvd _).1 (hST ((mem_iff_generator_dvd _).2 (dvd_refl _))) with z hz,
83-
cases is_prime_ideal.mem_or_mem_of_mul_mem (show generator T * z ∈ S,
84-
by rw [mem_iff_generator_dvd S, ← hz]),
85-
{ have hST' : S = T := set.subset.antisymm hST
86-
(λ y hyT, (mem_iff_generator_dvd _).2
87-
(dvd.trans ((mem_iff_generator_dvd _).1 h) ((mem_iff_generator_dvd _).1 hyT))),
88-
cc },
89-
{ cases (mem_iff_generator_dvd _).1 h with y hy,
90-
rw [← mul_one (generator S), hy, mul_left_comm,
91-
domain.mul_left_inj (mt (eq_trivial_iff_generator_eq_zero S).2 hS)] at hz,
92-
exact hz.symm ▸ is_ideal.mul_right (generator_mem T) }
93101
end

0 commit comments

Comments
 (0)