Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat(ring_theory): every division_ring is_noetherian #7661

Closed
wants to merge 220 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
220 commits
Select commit Hold shift + click to select a range
ce8b14e
feat(category_theory/.../images): image.pre_comp_epi_of_epi
semorrison May 4, 2021
2ab67aa
feat(category_theory/.../zero): if a zero morphism is a mono, the sou…
semorrison May 4, 2021
dc8ac57
add simp lemmas
semorrison May 4, 2021
410a946
feat(category_theory/.../additive_functor): additive functors preserv…
semorrison May 4, 2021
25a6827
feat(category_theory/preadditive): reformulation of mono_of_kernel_zero
semorrison May 4, 2021
7e13d1b
feat(category_theory/quotient): the quotient functor is full and esse…
semorrison May 4, 2021
6fa9bfe
feat(category_theory/subobject): minor tweaks
semorrison May 4, 2021
62850b8
Merge branch 'subobject2' into subobject_limits
semorrison May 4, 2021
d6169aa
feat(category_theory/subobjects): more about kernel and image subobjects
semorrison May 4, 2021
3caf09d
minor
semorrison May 4, 2021
292109b
Merge branch 'subobject_limits' into homology_redesign
semorrison May 4, 2021
79e72a0
Merge branch 'subobject2' into subobject_limits
semorrison May 4, 2021
01f2cc4
Merge branch 'subobject_limits' into homology_redesign
semorrison May 4, 2021
723796d
Merge branch 'mono_of_kernel_iso_zero' into homology_redesign
semorrison May 4, 2021
a4635dc
Merge branch 'zero' into homology_redesign
semorrison May 4, 2021
b9c853b
feat(algebra/homology): redesign of homological complexes
semorrison May 4, 2021
5feee94
feat(algebra/homology/single): chain complexes supported in a single …
semorrison May 4, 2021
bc59d44
oops
semorrison May 4, 2021
7e30250
Merge branch 'homology_redesign' into homology_single
semorrison May 4, 2021
5f441a0
feat(algebra/homology): chain complexes are an additive category
semorrison May 4, 2021
f2c531f
Merge branch 'functor.map_zero_object' into homology_additive
semorrison May 4, 2021
f203e6d
feat(algebra/homology): truncation and augmentation of chain complexes
semorrison May 4, 2021
10b42c1
feat(algebra/homology): homotopies between chain maps
semorrison May 4, 2021
f1ebd3c
Merge branch 'quotient_functor' into homotopy_category
semorrison May 4, 2021
08065fd
feat(algebra/homology): the homotopy category
semorrison May 4, 2021
76676a9
Update src/category_theory/quotient.lean
jcommelin May 4, 2021
f2be42d
feat(category_theory/*/projective): refactor treatment of projective …
semorrison May 4, 2021
a0a456b
Merge branch 'homotopy_category' into projective_resolution3
semorrison May 4, 2021
dac539f
feat(algebra/homology): projective resolutions
semorrison May 4, 2021
8e77d33
feat(category_theory): left-derived functors
semorrison May 4, 2021
1cf546a
Merge branch 'homology_augment' into abelian_projective
semorrison May 4, 2021
2ad7680
feat(category_theory/abelian): abelian categories with enough project…
semorrison May 4, 2021
683ac43
Apply suggestions from code review
semorrison May 4, 2021
d863225
should have linted first
semorrison May 4, 2021
5dae933
Merge branch 'functor.map_zero_object' into homology_additive
semorrison May 4, 2021
6b3b49e
Merge branch 'homology_additive' into homotopy
semorrison May 4, 2021
7017a60
Merge branch 'homotopy' into homotopy_category
semorrison May 4, 2021
1e60c98
Merge branch 'homotopy_category' into projective_resolution3
semorrison May 4, 2021
bf979cf
Merge branch 'projective_resolution3' into derived
semorrison May 4, 2021
5619b93
Merge branch 'projective_resolution3' into abelian_projective
semorrison May 4, 2021
4a1cced
feat(category_theory/quotient): congruence relations
dwarn May 4, 2021
121b4d6
lint
semorrison May 5, 2021
c7d83b7
Merge branch 'zero' of github.com:leanprover-community/mathlib into zero
semorrison May 5, 2021
139c457
removing a simps that was unnecessary, and resulting in a linter timeout
semorrison May 5, 2021
52f82ac
Merge branch 'zero' into homology_redesign
semorrison May 5, 2021
4932b5c
Merge branch 'subobject_limits' into homology_redesign
semorrison May 5, 2021
3d1e61b
Merge branch 'homology_redesign' into homology_single
semorrison May 5, 2021
33bae46
lint
semorrison May 5, 2021
7851222
Merge branch 'homology_single' into homology_additive
semorrison May 5, 2021
f876567
linting
semorrison May 5, 2021
a73bf4e
Merge branch 'homology_single' into homology_augment
semorrison May 5, 2021
02bee65
lint
semorrison May 5, 2021
785df14
Merge branch 'homotopy' into homotopy_category
semorrison May 5, 2021
67af120
Merge branch 'homology_redesign' into projective_refactor
semorrison May 5, 2021
7cfd26a
has_zero_object
semorrison May 5, 2021
d12d371
Merge branch 'homology_redesign' into homotopy_category
semorrison May 5, 2021
9e62459
lint
semorrison May 5, 2021
0a035c2
Merge branch 'homotopy_category' into projective_resolution3
semorrison May 5, 2021
efeca52
Merge branch 'projective_refactor' into projective_resolution3
semorrison May 5, 2021
e8e4da6
Merge branch 'projective_resolution3' into derived
semorrison May 5, 2021
f5be39a
minor
semorrison May 5, 2021
4151695
Merge branch 'projective_resolution3' into abelian_projective
semorrison May 5, 2021
a001921
Merge branch 'homology_augment' into abelian_projective
semorrison May 5, 2021
944a0d7
Merge branch 'homology_additive' into homotopy
semorrison May 5, 2021
7a49620
Merge branch 'homotopy' into homotopy_category
semorrison May 5, 2021
c75e4ba
Merge branch 'homotopy_category' into projective_resolution3
semorrison May 5, 2021
d239c1b
Merge branch 'projective_resolution3' into derived
semorrison May 5, 2021
9c31dd0
Merge branch 'projective_resolution3' into abelian_projective
semorrison May 5, 2021
b10114e
docstrings
dwarn May 5, 2021
7c2d060
add two simp lemmas
semorrison May 5, 2021
754e6bb
feat(category_theory): the opposite of an abelian category is abelian
semorrison May 5, 2021
a97a37c
lint
semorrison May 5, 2021
87adcff
Merge branch 'derived' into ext
semorrison May 6, 2021
4b48662
Merge branch 'abelian_projective' into ext
semorrison May 6, 2021
dfeaff5
feat(category_theory/abelian): the definition of ext
semorrison May 6, 2021
26a060d
err
semorrison May 6, 2021
e7e95af
merge
semorrison May 6, 2021
9d55e3f
Merge branch 'homotopy_category' into projective_resolution3
semorrison May 6, 2021
038d380
Merge branch 'projective_resolution3' into derived
semorrison May 6, 2021
31c5ae3
Merge branch 'projective_resolution3' into abelian_projective
semorrison May 6, 2021
37902ec
Merge branch 'derived' into ext
semorrison May 6, 2021
5e73b16
Merge branch 'abelian_projective' into ext
semorrison May 6, 2021
678691d
Merge remote-tracking branch 'origin/master' into subobject_limits
semorrison May 6, 2021
0dda372
Merge branch 'subobject_limits' into homology_redesign
semorrison May 6, 2021
04370fd
Merge remote-tracking branch 'origin/master' into quotient_cats
dwarn May 6, 2021
ead1692
oops
dwarn May 6, 2021
b66bf56
merge
semorrison May 7, 2021
09594ab
Merge branch 'master' into homology_redesign
jcommelin May 7, 2021
784ba97
Merge remote-tracking branch 'origin/master' into quotient_cats
dwarn May 8, 2021
1b201b5
capitalise
semorrison May 10, 2021
e757bab
process most of the comments
jcommelin May 10, 2021
93bd9c7
one more
jcommelin May 10, 2021
9501d73
process comments
jcommelin May 11, 2021
9b6df47
add tfae
jcommelin May 11, 2021
3eeb4aa
Merge branch 'homology_redesign' into homology_single
semorrison May 11, 2021
c8b63e3
fix comment
semorrison May 11, 2021
b937790
Merge branch 'homology_redesign' into homology_single
semorrison May 11, 2021
a924290
Merge branch 'homology_single' into homology_additive
semorrison May 11, 2021
a2387cb
Merge branch 'homology_single' into homology_augment
semorrison May 11, 2021
91d4c0c
Merge branch 'homology_additive' into homotopy
semorrison May 11, 2021
f216c73
Merge branch 'homotopy' into homotopy_category
semorrison May 11, 2021
43a6c6d
fix
semorrison May 11, 2021
9954845
Merge branch 'homology_redesign' into projective_refactor
semorrison May 11, 2021
18c4030
Merge branch 'homotopy_category' into projective_resolution3
semorrison May 11, 2021
713601a
Merge branch 'projective_refactor' into projective_resolution3
semorrison May 11, 2021
b53a0be
Merge branch 'projective_resolution3' into derived
semorrison May 11, 2021
6a6b5e6
Merge branch 'homology_augment' into abelian_projective
semorrison May 11, 2021
bbf5291
Merge branch 'projective_resolution3' into abelian_projective
semorrison May 11, 2021
03697d4
fix
semorrison May 11, 2021
4d5383f
Merge branch 'derived' into ext
semorrison May 11, 2021
7ff3df9
Merge branch 'abelian_projective' into ext
semorrison May 11, 2021
17532b5
fix
semorrison May 11, 2021
35eb0b8
Merge branch 'abelian_projective' into ext
semorrison May 11, 2021
4b82f02
Merge branch 'ext' of github.com:leanprover-community/mathlib into ext
semorrison May 11, 2021
5983ab6
fix
semorrison May 11, 2021
d1deb9e
merge
semorrison May 11, 2021
41372a0
Merge branch 'homology_single' into homology_augment
semorrison May 11, 2021
fcc3267
merge
semorrison May 11, 2021
0fa0223
Merge branch 'homology_additive' into homotopy
semorrison May 11, 2021
5616666
Merge branch 'homotopy' into homotopy_category
semorrison May 11, 2021
bffc273
merge
semorrison May 11, 2021
7fc79d2
Merge branch 'projective_resolution3' into derived
semorrison May 11, 2021
1cc504e
Merge branch 'projective_resolution3' into abelian_projective
semorrison May 11, 2021
94d4663
Merge branch 'homology_augment' into abelian_projective
semorrison May 11, 2021
cbc18a0
Merge branch 'derived' into ext
semorrison May 11, 2021
105b87e
Merge branch 'abelian_projective' into ext
semorrison May 11, 2021
b7db063
rename to single₀, add natural isomorphism
semorrison May 12, 2021
e2e2f5a
Merge remote-tracking branch 'origin/master' into homology_single
semorrison May 12, 2021
b8efab9
full and faithful instances
semorrison May 12, 2021
2c9eceb
oops
semorrison May 13, 2021
9ac32cc
doc-string
semorrison May 13, 2021
59f9bda
Merge branch 'homology_single' into homology_additive
semorrison May 13, 2021
85a37ea
update
semorrison May 13, 2021
a1913ec
merge
semorrison May 14, 2021
1bdcdba
Merge branch 'homology_single' into homology_augment
semorrison May 14, 2021
dff5aa6
Merge remote-tracking branch 'origin/master' into homology_additive
semorrison May 14, 2021
1688047
Merge branch 'homology_additive' into homotopy
semorrison May 14, 2021
b739577
Apply suggestions from code review
semorrison May 14, 2021
e1a97af
simp lemmas
semorrison May 14, 2021
d1f2adf
Merge branch 'homology_additive' of github.com:leanprover-community/m…
semorrison May 14, 2021
5fa5aa2
add single_map_homological_complex
semorrison May 14, 2021
78fb66f
add single_map_homological_complex
semorrison May 14, 2021
b7a7d46
Update src/algebra/homology/additive.lean
semorrison May 14, 2021
3eb4ec2
Merge remote-tracking branch 'origin/master' into homology_augment
semorrison May 14, 2021
3a74258
fix
semorrison May 14, 2021
a29887a
Merge branch 'homotopy' into homotopy_category
semorrison May 14, 2021
4c75b75
Merge branch 'homotopy_category' into projective_resolution3
semorrison May 14, 2021
824d882
Merge branch 'projective_resolution3' into derived
semorrison May 14, 2021
a653d51
Merge branch 'homology_augment' into abelian_projective
semorrison May 14, 2021
9b02916
Merge branch 'projective_resolution3' into abelian_projective
semorrison May 14, 2021
9a88097
fix comment
semorrison May 14, 2021
729a2b5
Merge branch 'homology_additive' of github.com:leanprover-community/m…
semorrison May 14, 2021
8bfae6f
Merge branch 'homology_additive' into homotopy
semorrison May 14, 2021
ef7e892
Merge branch 'homotopy' into homotopy_category
semorrison May 14, 2021
d0f3690
Merge branch 'homotopy_category' into projective_resolution3
semorrison May 14, 2021
d7d335f
renaming
semorrison May 14, 2021
c9a2077
Merge branch 'projective_resolution3' into derived
semorrison May 14, 2021
6a43afd
Merge branch 'projective_resolution3' into abelian_projective
semorrison May 14, 2021
28d8dde
finish rename
semorrison May 14, 2021
919eed8
Merge branch 'derived' into ext
semorrison May 14, 2021
aa2320d
Merge branch 'abelian_projective' into ext
semorrison May 14, 2021
0ae2457
finish rename
semorrison May 14, 2021
622f552
Merge branch 'abelian_projective' into ext
semorrison May 14, 2021
2412361
Merge branch 'master' into homotopy
jcommelin May 14, 2021
7101cf3
Apply suggestions from code review
semorrison May 15, 2021
a549c11
cleanup
semorrison May 15, 2021
05b513d
Merge branch 'homotopy' of github.com:leanprover-community/mathlib in…
semorrison May 15, 2021
004ff03
remove unnecessary arguments
semorrison May 15, 2021
21a8591
Merge branch 'homotopy' into homotopy_category
semorrison May 15, 2021
28225ba
Merge branch 'homotopy_category' into projective_resolution3
semorrison May 15, 2021
6186c5f
use #7501
semorrison May 15, 2021
44b8d61
Blah
adamtopaz May 15, 2021
7fd6059
Merge remote-tracking branch 'origin/master' into homotopy_category
semorrison May 16, 2021
735b504
Swap term order to match, and fill in some sorries
semorrison May 16, 2021
f3e855b
working again
semorrison May 16, 2021
7aaae8e
Merge branch 'homotopy_fix' into homotopy_category
semorrison May 16, 2021
f64fec3
merge
semorrison May 17, 2021
6fa5125
Merge remote-tracking branch 'origin/master' into projective_resolution3
semorrison May 17, 2021
2d225a4
Merge branch 'projective_resolution3' into derived
semorrison May 17, 2021
db523e0
Merge branch 'projective_resolution3' into abelian_projective
semorrison May 17, 2021
5efd787
Merge branch 'derived' into ext
semorrison May 17, 2021
ea3a819
Merge branch 'abelian_projective' into ext
semorrison May 17, 2021
3377bc5
fix
semorrison May 17, 2021
1b94235
Merge branch 'projective_resolution3' into derived
semorrison May 17, 2021
5892eff
Merge branch 'projective_resolution3' into abelian_projective
semorrison May 17, 2021
bd180f9
Merge branch 'projective_resolution3' into ext
semorrison May 17, 2021
d6dedee
Merge branch 'derived' into ext
semorrison May 17, 2021
1eaba69
Make `d_next` and friends into `add_monoid_hom`s
jcommelin May 17, 2021
376f50e
Merge branch 'homotopy_fix' into homotopy_category
semorrison May 17, 2021
6613d2c
lint
semorrison May 17, 2021
61a1a57
Merge branch 'homotopy_category' into projective_resolution3
semorrison May 18, 2021
6cfa886
Merge branch 'projective_resolution3' into derived
semorrison May 18, 2021
2b8b4d8
Merge branch 'projective_resolution3' into abelian_projective
semorrison May 18, 2021
b936c10
Merge branch 'derived' into ext
semorrison May 18, 2021
0e79ff5
Merge branch 'abelian_projective' into ext
semorrison May 18, 2021
50a46a7
lint
semorrison May 18, 2021
0c161fd
.
semorrison May 18, 2021
b4056c3
.
semorrison May 18, 2021
6bf2aa8
.
semorrison May 19, 2021
6c40dd6
fix
semorrison May 19, 2021
2a2d03a
fix paren type
semorrison May 19, 2021
24ad316
Merge branch 'derived' into ext
semorrison May 19, 2021
7e68e5a
feat(ring_theory): every division_ring is_noetherian
semorrison May 19, 2021
0fc2736
fix
semorrison May 19, 2021
7036759
Merge branch 'left_ideal' into division_ring_noetherian
semorrison May 19, 2021
3624407
Update src/algebra/group/units.lean
semorrison May 20, 2021
8934366
Update src/ring_theory/ideal/operations.lean
semorrison May 20, 2021
38d21e8
lint
semorrison May 20, 2021
2348f09
speedup
semorrison May 20, 2021
e62d0c4
Merge branches 'ext' and 'left_ideal' of github.com:leanprover-commun…
semorrison May 20, 2021
c28befd
comment
semorrison May 20, 2021
fab4091
merge
semorrison May 20, 2021
ec9bd3a
merge went horribly wrong
semorrison May 20, 2021
13d7179
Merge remote-tracking branch 'origin/master' into left_ideal
semorrison May 29, 2021
c26c6f7
fix
semorrison May 29, 2021
9599754
Merge branch 'left_ideal' into division_ring_noetherian
semorrison May 29, 2021
86b8f80
fix
semorrison May 29, 2021
d092a78
merge
semorrison Jun 2, 2021
e5891d8
Merge branch 'left_ideal' into division_ring_noetherian
semorrison Jun 2, 2021
fae2f92
merge
semorrison Jun 10, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
57 changes: 33 additions & 24 deletions src/ring_theory/ideal/basic.lean
Expand Up @@ -88,7 +88,7 @@ lemma span_mono {s t : set α} : s ⊆ t → span s ≤ span t := submodule.span

@[simp] lemma span_eq : span (I : set α) = I := submodule.span_eq _

@[simp] lemma span_singleton_one : span (1 : set α) = ⊤ :=
@[simp] lemma span_singleton_one : span ({1} : set α) = ⊤ :=
(eq_top_iff_one _).2 $ subset_span $ mem_singleton _

lemma mem_span_insert {s : set α} {x y} :
Expand All @@ -104,6 +104,8 @@ submodule.span_singleton_eq_bot

@[simp] lemma span_zero : span (0 : set α) = ⊥ := by rw [←set.singleton_zero, span_singleton_eq_bot]

@[simp] lemma span_one : span (1 : set α) = ⊤ := by rw [←set.singleton_one, span_singleton_one]

/--
The ideal generated by an arbitrary binary relation.
-/
Expand Down Expand Up @@ -313,7 +315,7 @@ lemma span_singleton_mul_left_unit {a : α} (h2 : is_unit a) (x : α) :
span ({a * x} : set α) = span {x} := by rw [mul_comm, span_singleton_mul_right_unit h2]

lemma span_singleton_eq_top {x} : span ({x} : set α) = ⊤ ↔ is_unit x :=
by rw [is_unit_iff_dvd_one, ← span_singleton_le_span_singleton, singleton_one, span_singleton_one,
by rw [is_unit_iff_dvd_one, ← span_singleton_le_span_singleton, span_singleton_one,
eq_top_iff]

theorem span_singleton_prime {p : α} (hp : p ≠ 0) :
Expand Down Expand Up @@ -390,6 +392,35 @@ end ideal

end ring

section division_ring
variables {K : Type u} [division_ring K] (I : ideal K)

namespace ideal

/-- All ideals in a division ring are trivial. -/
lemma eq_bot_or_top : I = ⊥ ∨ I = ⊤ :=
begin
rw or_iff_not_imp_right,
change _ ≠ _ → _,
rw ideal.ne_top_iff_one,
intro h1,
rw eq_bot_iff,
intros r hr,
by_cases H : r = 0, {simpa},
simpa [H, h1] using I.mul_mem_left r⁻¹ hr,
end

lemma eq_bot_of_prime [h : I.is_prime] : I = ⊥ :=
or_iff_not_imp_right.mp I.eq_bot_or_top h.1

lemma bot_is_maximal : is_maximal (⊥ : ideal K) :=
⟨⟨λ h, absurd ((eq_top_iff_one (⊤ : ideal K)).mp rfl) (by rw ← h; simp),
λ I hI, or_iff_not_imp_left.mp (eq_bot_or_top I) (ne_of_gt hI)⟩⟩

end ideal

end division_ring

section comm_ring

namespace ideal
Expand Down Expand Up @@ -534,28 +565,6 @@ def lift (S : ideal α) (f : α →+* β) (H : ∀ (a : α), a ∈ S → f a = 0

end quotient

/-- All ideals in a field are trivial. -/
lemma eq_bot_or_top {K : Type u} [field K] (I : ideal K) :
I = ⊥ ∨ I = ⊤ :=
begin
rw or_iff_not_imp_right,
change _ ≠ _ → _,
rw ideal.ne_top_iff_one,
intro h1,
rw eq_bot_iff,
intros r hr,
by_cases H : r = 0, {simpa},
simpa [H, h1] using I.mul_mem_left r⁻¹ hr,
end

lemma eq_bot_of_prime {K : Type u} [field K] (I : ideal K) [h : I.is_prime] :
I = ⊥ :=
or_iff_not_imp_right.mp I.eq_bot_or_top h.1

lemma bot_is_maximal {K : Type u} [field K] : is_maximal (⊥ : ideal K) :=
⟨⟨λ h, absurd ((eq_top_iff_one (⊤ : ideal K)).mp rfl) (by rw ← h; simp),
λ I hI, or_iff_not_imp_left.mp (eq_bot_or_top I) (ne_of_gt hI)⟩⟩

section pi
variables (ι : Type v)

Expand Down
4 changes: 2 additions & 2 deletions src/ring_theory/ideal/operations.lean
Expand Up @@ -317,7 +317,7 @@ by { unfold span, rw [submodule.span_mul_span, set.singleton_mul_singleton], }
lemma span_singleton_pow (s : R) (n : ℕ):
span {s} ^ n = (span {s ^ n} : ideal R) :=
begin
induction n with n ih, { simp [set.singleton_one] },
induction n with n ih, { simp [set.singleton_one], },
simp only [pow_succ, ih, span_singleton_mul_span_singleton],
end

Expand Down Expand Up @@ -1267,7 +1267,7 @@ end
(⊥ : ideal I.quotient).is_maximal ↔ I.is_maximal :=
⟨λ hI, (@mk_ker _ _ I) ▸
@comap_is_maximal_of_surjective _ _ _ _ (quotient.mk I) ⊥ quotient.mk_surjective hI,
λ hI, @bot_is_maximal _ (@quotient.field _ _ I hI) ⟩
λ hI, @bot_is_maximal _ (@field.to_division_ring _ (@quotient.field _ _ I hI)) ⟩

section quotient_algebra

Expand Down
56 changes: 42 additions & 14 deletions src/ring_theory/principal_ideal_domain.lean
Expand Up @@ -8,7 +8,7 @@ import ring_theory.unique_factorization_domain
/-!
# Principal ideal rings and principal ideal domains

A principal ideal ring (PIR) is a commutative ring in which all ideals are principal. A
A principal ideal ring (PIR) is a ring in which all left ideals are principal. A
principal ideal domain (PID) is an integral domain which is a principal ideal ring.

# Main definitions
Expand All @@ -17,8 +17,7 @@ Note that for principal ideal domains, one should use
`[integral_domain R] [is_principal_ideal_ring R]`. There is no explicit definition of a PID.
Theorems about PID's are in the `principal_ideal_ring` namespace.

- `is_principal_ideal_ring`: a predicate on commutative rings, saying that every
ideal is principal.
- `is_principal_ideal_ring`: a predicate on rings, saying that every left ideal is principal.
- `generator`: a generator of a principal ideal (or more generally submodule)
- `to_unique_factorization_monoid`: a PID is a unique factorization domain

Expand All @@ -35,19 +34,39 @@ open set function
open submodule
open_locale classical

section
variables [ring R] [add_comm_group M] [module R M]

/-- An `R`-submodule of `M` is principal if it is generated by one element. -/
class submodule.is_principal [ring R] [add_comm_group M] [module R M] (S : submodule R M) : Prop :=
class submodule.is_principal (S : submodule R M) : Prop :=
(principal [] : ∃ a, S = span R {a})

/-- A commutative ring is a principal ideal ring if all ideals are principal. -/
class is_principal_ideal_ring (R : Type u) [comm_ring R] : Prop :=
instance bot_is_principal : (⊥ : submodule R M).is_principal :=
⟨⟨0, by simp⟩⟩

instance top_is_principal : (⊤ : submodule R R).is_principal :=
⟨⟨1, ideal.span_singleton_one.symm⟩⟩

variables (R)

/-- A ring is a principal ideal ring if all (left) ideals are principal. -/
class is_principal_ideal_ring (R : Type u) [ring R] : Prop :=
(principal : ∀ (S : ideal R), S.is_principal)

attribute [instance] is_principal_ideal_ring.principal

@[priority 100]
instance division_ring.is_principal_idea_ring (K : Type u) [division_ring K] :
is_principal_ideal_ring K :=
{ principal := λ S, by rcases ideal.eq_bot_or_top S with (rfl|rfl); apply_instance }

end

namespace submodule.is_principal
variables [add_comm_group M]

variables [comm_ring R] [add_comm_group M] [module R M]
section ring
variables [ring R] [module R M]

/-- `generator I`, if `I` is a principal submodule, is an `x ∈ M` such that `span R {x} = I` -/
noncomputable def generator (S : submodule R M) [S.is_principal] : M :=
Expand All @@ -63,20 +82,27 @@ lemma mem_iff_eq_smul_generator (S : submodule R M) [S.is_principal] {x : M} :
x ∈ S ↔ ∃ s : R, x = s • generator S :=
by simp_rw [@eq_comm _ x, ← mem_span_singleton, span_singleton_generator]

lemma mem_iff_generator_dvd (S : ideal R) [S.is_principal] {x : R} : x ∈ S ↔ generator S ∣ x :=
(mem_iff_eq_smul_generator S).trans (exists_congr (λ a, by simp only [mul_comm, smul_eq_mul]))

lemma eq_bot_iff_generator_eq_zero (S : submodule R M) [S.is_principal] :
S = ⊥ ↔ generator S = 0 :=
by rw [← @span_singleton_eq_bot R M, span_singleton_generator]

end ring

section comm_ring
variables [comm_ring R] [module R M]

lemma mem_iff_generator_dvd (S : ideal R) [S.is_principal] {x : R} : x ∈ S ↔ generator S ∣ x :=
(mem_iff_eq_smul_generator S).trans (exists_congr (λ a, by simp only [mul_comm, smul_eq_mul]))

lemma prime_generator_of_is_prime (S : ideal R) [submodule.is_principal S] [is_prime : S.is_prime]
(ne_bot : S ≠ ⊥) :
prime (generator S) :=
⟨λ h, ne_bot ((eq_bot_iff_generator_eq_zero S).2 h),
λ h, is_prime.ne_top (S.eq_top_of_is_unit_mem (generator_mem S) h),
by simpa only [← mem_iff_generator_dvd S] using is_prime.2⟩

end comm_ring

end submodule.is_principal

namespace is_prime
Expand Down Expand Up @@ -137,18 +163,18 @@ end
namespace principal_ideal_ring
open is_principal_ideal_ring

variables [integral_domain R] [is_principal_ideal_ring R]

@[priority 100] -- see Note [lower instance priority]
instance is_noetherian_ring : is_noetherian_ring R :=
instance is_noetherian_ring [ring R] [is_principal_ideal_ring R] :
is_noetherian_ring R :=
is_noetherian_ring_iff.2 ⟨assume s : ideal R,
begin
rcases (is_principal_ideal_ring.principal s).principal with ⟨a, rfl⟩,
rw [← finset.coe_singleton],
exact ⟨{a}, set_like.coe_injective rfl⟩
end⟩

lemma is_maximal_of_irreducible {p : R} (hp : irreducible p) :
lemma is_maximal_of_irreducible [comm_ring R] [is_principal_ideal_ring R]
{p : R} (hp : irreducible p) :
ideal.is_maximal (span R ({p} : set R)) :=
⟨⟨mt ideal.span_singleton_eq_top.1 hp.1, λ I hI, begin
rcases principal I with ⟨a, rfl⟩,
Expand All @@ -158,6 +184,8 @@ lemma is_maximal_of_irreducible {p : R} (hp : irreducible p) :
erw [ideal.span_singleton_le_span_singleton, is_unit.mul_right_dvd hb]
end⟩⟩

variables [integral_domain R] [is_principal_ideal_ring R]

lemma irreducible_iff_prime {p : R} : irreducible p ↔ prime p :=
⟨λ hp, (ideal.span_singleton_prime hp.ne_zero).1 $
(is_maximal_of_irreducible hp).is_prime,
Expand Down