@@ -5,6 +5,7 @@ Authors: Oliver Nash
5
5
-/
6
6
import Mathlib.Data.Nat.Choose.Sum
7
7
import Mathlib.Algebra.Algebra.Bilinear
8
+ import Mathlib.GroupTheory.Submonoid.ZeroDivisors
8
9
import Mathlib.RingTheory.Ideal.Operations
9
10
import Mathlib.Algebra.GeomSum
10
11
@@ -43,7 +44,7 @@ theorem IsNilpotent.mk [Zero R] [Pow R ℕ] (x : R) (n : ℕ) (e : x ^ n = 0) :
43
44
⟨n, e⟩
44
45
#align is_nilpotent.mk IsNilpotent.mk
45
46
46
- theorem IsNilpotent.zero [MonoidWithZero R] : IsNilpotent (0 : R) :=
47
+ @[simp] theorem IsNilpotent.zero [MonoidWithZero R] : IsNilpotent (0 : R) :=
47
48
⟨1 , pow_one 0 ⟩
48
49
#align is_nilpotent.zero IsNilpotent.zero
49
50
@@ -172,17 +173,43 @@ theorem isNilpotent_add (hx : IsNilpotent x) (hy : IsNilpotent y) : IsNilpotent
172
173
· rw [pow_eq_zero_of_le hj hm, MulZeroClass.mul_zero]
173
174
#align commute.is_nilpotent_add Commute.isNilpotent_add
174
175
176
+ protected lemma isNilpotent_sum {ι : Type _} {s : Finset ι} {f : ι → R}
177
+ (hnp : ∀ i ∈ s, IsNilpotent (f i)) (h_comm : ∀ i j, i ∈ s → j ∈ s → Commute (f i) (f j)) :
178
+ IsNilpotent (∑ i in s, f i) := by
179
+ classical
180
+ induction' s using Finset.induction with j s hj ih; simp
181
+ rw [Finset.sum_insert hj]
182
+ apply Commute.isNilpotent_add
183
+ · exact Commute.sum_right _ _ _ (fun i hi ↦ h_comm _ _ (by simp) (by simp [hi]))
184
+ · apply hnp; simp
185
+ · exact ih (fun i hi ↦ hnp i (by simp [hi]))
186
+ (fun i j hi hj ↦ h_comm i j (by simp [hi]) (by simp [hj]))
187
+
175
188
theorem isNilpotent_mul_left (h : IsNilpotent x) : IsNilpotent (x * y) := by
176
189
obtain ⟨n, hn⟩ := h
177
190
use n
178
191
rw [h_comm.mul_pow, hn, MulZeroClass.zero_mul]
179
192
#align commute.is_nilpotent_mul_left Commute.isNilpotent_mul_left
180
193
194
+ protected lemma isNilpotent_mul_left_iff (hy : y ∈ nonZeroDivisorsLeft R) :
195
+ IsNilpotent (x * y) ↔ IsNilpotent x := by
196
+ refine' ⟨_, h_comm.isNilpotent_mul_left⟩
197
+ rintro ⟨k, hk⟩
198
+ rw [mul_pow h_comm] at hk
199
+ exact ⟨k, (nonZeroDivisorsLeft R).pow_mem hy k _ hk⟩
200
+
181
201
theorem isNilpotent_mul_right (h : IsNilpotent y) : IsNilpotent (x * y) := by
182
202
rw [h_comm.eq]
183
203
exact h_comm.symm.isNilpotent_mul_left h
184
204
#align commute.is_nilpotent_mul_right Commute.isNilpotent_mul_right
185
205
206
+ protected lemma isNilpotent_mul_right_iff (hx : x ∈ nonZeroDivisorsRight R) :
207
+ IsNilpotent (x * y) ↔ IsNilpotent y := by
208
+ refine' ⟨_, h_comm.isNilpotent_mul_right⟩
209
+ rintro ⟨k, hk⟩
210
+ rw [mul_pow h_comm] at hk
211
+ exact ⟨k, (nonZeroDivisorsRight R).pow_mem hx k _ hk⟩
212
+
186
213
end Semiring
187
214
188
215
section Ring
@@ -202,7 +229,12 @@ end Commute
202
229
203
230
section CommSemiring
204
231
205
- variable [CommSemiring R]
232
+ variable [CommSemiring R] {x y : R}
233
+
234
+ lemma isNilpotent_sum {ι : Type _} {s : Finset ι} {f : ι → R}
235
+ (hnp : ∀ i ∈ s, IsNilpotent (f i)) :
236
+ IsNilpotent (∑ i in s, f i) :=
237
+ Commute.isNilpotent_sum hnp fun _ _ _ _ ↦ Commute.all _ _
206
238
207
239
/-- The nilradical of a commutative semiring is the ideal of nilpotent elements. -/
208
240
def nilradical (R : Type _) [CommSemiring R] : Ideal R :=
0 commit comments