Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 9cc44ba

Browse files
committed
feat(ring_theory/nilpotent): basic results about nilpotency in associative rings (#8055)
1 parent 1774cf9 commit 9cc44ba

File tree

2 files changed

+107
-0
lines changed

2 files changed

+107
-0
lines changed

src/algebra/group_power/basic.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,10 @@ begin
411411
{ rw [zero_pow (nat.pos_of_ne_zero h)] },
412412
end
413413

414+
lemma pow_eq_zero_of_le [monoid_with_zero M] {x : M} {n m : ℕ}
415+
(hn : n ≤ m) (hx : x^n = 0) : x^m = 0 :=
416+
by rw [← nat.sub_add_cancel hn, pow_add, hx, mul_zero]
417+
414418
namespace ring_hom
415419

416420
variables [semiring R] [semiring S]

src/ring_theory/nilpotent.lean

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/-
2+
Copyright (c) 2021 Oliver Nash. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Oliver Nash
5+
-/
6+
import data.nat.choose.sum
7+
8+
/-!
9+
# Nilpotent elements
10+
11+
## Main definitions
12+
13+
* `is_nilpotent`
14+
* `is_nilpotent_neg_iff`
15+
* `commute.is_nilpotent_add`
16+
* `commute.is_nilpotent_mul_left`
17+
* `commute.is_nilpotent_mul_right`
18+
* `commute.is_nilpotent_sub`
19+
20+
-/
21+
22+
universes u
23+
24+
variables {R : Type u} {x y : R}
25+
26+
/-- An element is said to be nilpotent if some natural-number-power of it equals zero.
27+
28+
Note that we require only the bare minimum assumptions for the definition to make sense. Even
29+
`monoid_with_zero` is too strong since nilpotency is important in the study of rings that are only
30+
power-associative. -/
31+
def is_nilpotent [has_zero R] [has_pow R ℕ] (x : R) : Prop := ∃ (n : ℕ), x^n = 0
32+
33+
lemma is_nilpotent.zero [monoid_with_zero R] : is_nilpotent (0 : R) := ⟨1, pow_one 0
34+
35+
lemma is_nilpotent.neg [ring R] (h : is_nilpotent x) : is_nilpotent (-x) :=
36+
begin
37+
obtain ⟨n, hn⟩ := h,
38+
use n,
39+
rw [neg_pow, hn, mul_zero],
40+
end
41+
42+
@[simp] lemma is_nilpotent_neg_iff [ring R] : is_nilpotent (-x) ↔ is_nilpotent x :=
43+
⟨λ h, neg_neg x ▸ h.neg, λ h, h.neg⟩
44+
45+
lemma is_nilpotent.eq_zero [monoid_with_zero R] [no_zero_divisors R]
46+
(h : is_nilpotent x) : x = 0 :=
47+
by { obtain ⟨n, hn⟩ := h, exact pow_eq_zero hn, }
48+
49+
@[simp] lemma is_nilpotent_iff_eq_zero [monoid_with_zero R] [no_zero_divisors R] :
50+
is_nilpotent x ↔ x = 0 :=
51+
⟨λ h, h.eq_zero, λ h, h.symm ▸ is_nilpotent.zero⟩
52+
53+
namespace commute
54+
55+
section semiring
56+
57+
variables [semiring R] (h_comm : commute x y)
58+
59+
include h_comm
60+
61+
lemma is_nilpotent_add (hx : is_nilpotent x) (hy : is_nilpotent y) : is_nilpotent (x + y) :=
62+
begin
63+
obtain ⟨n, hn⟩ := hx,
64+
obtain ⟨m, hm⟩ := hy,
65+
use n + m - 1,
66+
rw h_comm.add_pow',
67+
apply finset.sum_eq_zero,
68+
rintros ⟨i, j⟩ hij,
69+
suffices : x^i * y^j = 0, { simp only [this, nsmul_eq_mul, mul_zero], },
70+
cases nat.le_or_le_of_add_eq_add_pred (finset.nat.mem_antidiagonal.mp hij) with hi hj,
71+
{ rw [pow_eq_zero_of_le hi hn, zero_mul], },
72+
{ rw [pow_eq_zero_of_le hj hm, mul_zero], },
73+
end
74+
75+
lemma is_nilpotent_mul_left (h : is_nilpotent x) : is_nilpotent (x * y) :=
76+
begin
77+
obtain ⟨n, hn⟩ := h,
78+
use n,
79+
rw [h_comm.mul_pow, hn, zero_mul],
80+
end
81+
82+
lemma is_nilpotent_mul_right (h : is_nilpotent y) : is_nilpotent (x * y) :=
83+
by { rw h_comm.eq, exact h_comm.symm.is_nilpotent_mul_left h, }
84+
85+
end semiring
86+
87+
section ring
88+
89+
variables [ring R] (h_comm : commute x y)
90+
91+
include h_comm
92+
93+
lemma is_nilpotent_sub (hx : is_nilpotent x) (hy : is_nilpotent y) : is_nilpotent (x - y) :=
94+
begin
95+
rw ← neg_right_iff at h_comm,
96+
rw ← is_nilpotent_neg_iff at hy,
97+
rw sub_eq_add_neg,
98+
exact h_comm.is_nilpotent_add hx hy,
99+
end
100+
101+
end ring
102+
103+
end commute

0 commit comments

Comments
 (0)