Skip to content

Commit 730d598

Browse files
committed
feat: port RingTheory.Ideal.IdempotentFg (#2980)
Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>
1 parent c500055 commit 730d598

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,6 +1275,7 @@ import Mathlib.RingTheory.Finiteness
12751275
import Mathlib.RingTheory.Fintype
12761276
import Mathlib.RingTheory.FreeRing
12771277
import Mathlib.RingTheory.Ideal.Basic
1278+
import Mathlib.RingTheory.Ideal.IdempotentFg
12781279
import Mathlib.RingTheory.Ideal.Operations
12791280
import Mathlib.RingTheory.Ideal.Prod
12801281
import Mathlib.RingTheory.Ideal.Quotient
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/-
2+
Copyright (c) 2018 Mario Carneiro, Kevin Buzzard. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Mario Carneiro, Kevin Buzzard
5+
6+
! This file was ported from Lean 3 source module ring_theory.ideal.idempotent_fg
7+
! leanprover-community/mathlib commit 25cf7631da8ddc2d5f957c388bf5e4b25a77d8dc
8+
! Please do not edit these lines, except to modify the commit id
9+
! if you have ported upstream changes.
10+
-/
11+
import Mathlib.Algebra.Ring.Idempotents
12+
import Mathlib.RingTheory.Finiteness
13+
14+
/-!
15+
## Lemmas on idempotent finitely generated ideals
16+
-/
17+
18+
19+
namespace Ideal
20+
21+
/-- A finitely generated idempotent ideal is generated by an idempotent element -/
22+
theorem isIdempotentElem_iff_of_fg {R : Type _} [CommRing R] (I : Ideal R) (h : I.Fg) :
23+
IsIdempotentElem I ↔ ∃ e : R, IsIdempotentElem e ∧ I = R ∙ e := by
24+
constructor
25+
· intro e
26+
obtain ⟨r, hr, hr'⟩ :=
27+
Submodule.exists_mem_and_smul_eq_self_of_fg_of_le_smul I I h
28+
(by
29+
rw [smul_eq_mul]
30+
exact e.ge)
31+
simp_rw [smul_eq_mul] at hr'
32+
refine' ⟨r, hr' r hr, antisymm _ ((Submodule.span_singleton_le_iff_mem _ _).mpr hr)⟩
33+
intro x hx
34+
rw [← hr' x hx]
35+
exact Ideal.mem_span_singleton'.mpr ⟨_, mul_comm _ _⟩
36+
· rintro ⟨e, he, rfl⟩
37+
simp [IsIdempotentElem, Ideal.span_singleton_mul_span_singleton, he.eq]
38+
#align ideal.is_idempotent_elem_iff_of_fg Ideal.isIdempotentElem_iff_of_fg
39+
40+
theorem isIdempotentElem_iff_eq_bot_or_top {R : Type _} [CommRing R] [IsDomain R] (I : Ideal R)
41+
(h : I.Fg) : IsIdempotentElem I ↔ I = ⊥ ∨ I = ⊤ := by
42+
constructor
43+
· intro H
44+
obtain ⟨e, he, rfl⟩ := (I.isIdempotentElem_iff_of_fg h).mp H
45+
simp only [Ideal.submodule_span_eq, Ideal.span_singleton_eq_bot]
46+
apply Or.imp id _ (IsIdempotentElem.iff_eq_zero_or_one.mp he)
47+
rintro rfl
48+
simp
49+
· rintro (rfl | rfl) <;> simp [IsIdempotentElem]
50+
#align ideal.is_idempotent_elem_iff_eq_bot_or_top Ideal.isIdempotentElem_iff_eq_bot_or_top
51+
52+
end Ideal

0 commit comments

Comments
 (0)