@@ -535,12 +535,12 @@ end ideal
535535
536536end ring
537537
538- section division_ring
539- variables {K : Type u} [division_ring K] (I : ideal K)
538+ section division_semiring
539+ variables {K : Type u} [division_semiring K] (I : ideal K)
540540
541541namespace ideal
542542
543- /-- All ideals in a division ring are trivial. -/
543+ /-- All ideals in a division (semi) ring are trivial. -/
544544lemma eq_bot_or_top : I = ⊥ ∨ I = ⊤ :=
545545begin
546546 rw or_iff_not_imp_right,
@@ -553,8 +553,8 @@ begin
553553 simpa [H, h1] using I.mul_mem_left r⁻¹ hr,
554554end
555555
556- /-- Ideals of a `division_ring ` are a simple order. Thanks to the way abbreviations work, this
557- automatically gives a `is_simple_module K` instance. -/
556+ /-- Ideals of a `division_semiring ` are a simple order. Thanks to the way abbreviations work,
557+ this automatically gives a `is_simple_module K` instance. -/
558558instance : is_simple_order (ideal K) := ⟨eq_bot_or_top⟩
559559
560560lemma eq_bot_of_prime [h : I.is_prime] : I = ⊥ :=
@@ -566,7 +566,7 @@ lemma bot_is_maximal : is_maximal (⊥ : ideal K) :=
566566
567567end ideal
568568
569- end division_ring
569+ end division_semiring
570570
571571section comm_ring
572572
@@ -583,12 +583,11 @@ end ideal
583583
584584end comm_ring
585585
586+ -- TODO: consider moving the lemmas below out of the `ring` namespace since they are
587+ -- about `comm_semiring`s.
586588namespace ring
587589
588- variables {R : Type *} [comm_ring R]
589-
590- lemma not_is_field_of_subsingleton {R : Type *} [ring R] [subsingleton R] : ¬ is_field R :=
591- λ ⟨⟨x, y, hxy⟩, _, _⟩, hxy (subsingleton.elim x y)
590+ variables {R : Type *} [comm_semiring R]
592591
593592lemma exists_not_is_unit_of_not_is_field [nontrivial R] (hf : ¬ is_field R) :
594593 ∃ x ≠ (0 : R), ¬ is_unit x :=
@@ -624,6 +623,22 @@ not_is_field_iff_exists_ideal_bot_lt_and_lt_top.trans
624623 ⟨p, bot_lt_iff_ne_bot.mp (lt_of_lt_of_le bot_lt le_p), hp.is_prime⟩,
625624 λ ⟨p, ne_bot, prime⟩, ⟨p, bot_lt_iff_ne_bot.mpr ne_bot, lt_top_iff_ne_top.mpr prime.1 ⟩⟩
626625
626+ /-- Also see `ideal.is_simple_order` for the forward direction as an instance when `R` is a
627+ division (semi)ring.
628+
629+ This result actually holds for all division semirings, but we lack the predicate to state it. -/
630+ lemma is_field_iff_is_simple_order_ideal :
631+ is_field R ↔ is_simple_order (ideal R) :=
632+ begin
633+ casesI subsingleton_or_nontrivial R,
634+ { exact ⟨λ h, (not_is_field_of_subsingleton _ h).elim,
635+ λ h, by exactI (false_of_nontrivial_of_subsingleton $ ideal R).elim⟩ },
636+ rw [← not_iff_not, ring.not_is_field_iff_exists_ideal_bot_lt_and_lt_top, ← not_iff_not],
637+ push_neg,
638+ simp_rw [lt_top_iff_ne_top, bot_lt_iff_ne_bot, ← or_iff_not_imp_left, not_ne_iff],
639+ exact ⟨λ h, ⟨h⟩, λ h, h.2 ⟩
640+ end
641+
627642/-- When a ring is not a field, the maximal ideals are nontrivial. -/
628643lemma ne_bot_of_is_maximal_of_not_is_field [nontrivial R] {M : ideal R} (max : M.is_maximal)
629644 (not_field : ¬ is_field R) : M ≠ ⊥ :=
0 commit comments