Skip to content

Commit 89f60e1

Browse files
committed
feat(RingTheory/Ideal): 37 cast to an ideal is just the whole ring. (#20244)
https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/IdemSemiring.20.2B.20OfNat
1 parent 6924148 commit 89f60e1

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Mathlib/Algebra/Order/Kleene.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ scoped[Computability] attribute [simp] add_eq_sup
133133

134134
theorem add_idem (a : α) : a + a = a := by simp
135135

136+
lemma natCast_eq_one {n : ℕ} (nezero : n ≠ 0) : (n : α) = 1 := by
137+
induction n, Nat.one_le_iff_ne_zero.mpr nezero using Nat.le_induction with
138+
| base => exact Nat.cast_one
139+
| succ x _ hx => rw [Nat.cast_add, hx, Nat.cast_one, add_idem 1]
140+
141+
lemma ofNat_eq_one {n : ℕ} [n.AtLeastTwo] : (ofNat(n) : α) = 1 :=
142+
natCast_eq_one <| Nat.not_eq_zero_of_lt Nat.AtLeastTwo.prop
143+
136144
theorem nsmul_eq_self : ∀ {n : ℕ} (_ : n ≠ 0) (a : α), n • a = a
137145
| 0, h => (h rfl).elim
138146
| 1, _ => one_nsmul

Mathlib/RingTheory/Ideal/Operations.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,14 @@ variable (R) in
851851
theorem top_pow (n : ℕ) : (⊤ ^ n : Ideal R) = ⊤ :=
852852
Nat.recOn n one_eq_top fun n ih => by rw [pow_succ, ih, top_mul]
853853

854+
theorem natCast_eq_top {n : ℕ} (hn : n ≠ 0) : (n : Ideal R) = ⊤ :=
855+
natCast_eq_one hn |>.trans one_eq_top
856+
857+
/-- `3 : Ideal R` is *not* the ideal generated by 3 (which would be spelt
858+
`Ideal.span {3}`), it is simply `1 + 1 + 1 = ⊤`. -/
859+
theorem ofNat_eq_top {n : ℕ} [n.AtLeastTwo] : (ofNat(n) : Ideal R) = ⊤ :=
860+
ofNat_eq_one.trans one_eq_top
861+
854862
variable (I)
855863

856864
lemma radical_pow : ∀ {n}, n ≠ 0 → radical (I ^ n) = radical I

0 commit comments

Comments
 (0)