Theorem: mem_pNilradical
File: Mathlib/FieldTheory/IsPerfectClosure.lean

tactic: by_cases hp : 1 < p
state_before: R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
⊢ x ∈ pNilradical R p ↔ ∃ n, x ^ p ^ n = 0
state_after: case pos
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp : 1 < p
⊢ x ∈ pNilradical R p ↔ ∃ n, x ^ p ^ n = 0

case neg
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp : ¬1 < p
⊢ x ∈ pNilradical R p ↔ ∃ n, x ^ p ^ n = 0

tactic: rw [pNilradical_eq_bot hp, Ideal.mem_bot]
state_before: case neg
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp : ¬1 < p
⊢ x ∈ pNilradical R p ↔ ∃ n, x ^ p ^ n = 0
state_after: case neg
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp : ¬1 < p
⊢ x = 0 ↔ ∃ n, x ^ p ^ n = 0

tactic: refine ⟨fun h ↦ ⟨0, by rw [pow_zero, pow_one, h]⟩, fun ⟨n, h⟩ ↦ ?_⟩
state_before: case neg
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp : ¬1 < p
⊢ x = 0 ↔ ∃ n, x ^ p ^ n = 0
state_after: case neg
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp : ¬1 < p
x✝ : ∃ n, x ^ p ^ n = 0
n : ℕ
h : x ^ p ^ n = 0
⊢ x = 0

tactic: rcases Nat.le_one_iff_eq_zero_or_eq_one.1 (not_lt.1 hp) with hp | hp
state_before: case neg
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp : ¬1 < p
x✝ : ∃ n, x ^ p ^ n = 0
n : ℕ
h : x ^ p ^ n = 0
⊢ x = 0
state_after: case neg.inl
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp✝ : ¬1 < p
x✝ : ∃ n, x ^ p ^ n = 0
n : ℕ
h : x ^ p ^ n = 0
hp : p = 0
⊢ x = 0

case neg.inr
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp✝ : ¬1 < p
x✝ : ∃ n, x ^ p ^ n = 0
n : ℕ
h : x ^ p ^ n = 0
hp : p = 1
⊢ x = 0

tactic: rwa [hp, one_pow, pow_one] at h
state_before: case neg.inr
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp✝ : ¬1 < p
x✝ : ∃ n, x ^ p ^ n = 0
n : ℕ
h : x ^ p ^ n = 0
hp : p = 1
⊢ x = 0
state_after: no goals

tactic: rw [pNilradical_eq_nilradical hp]
state_before: case pos
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp : 1 < p
⊢ x ∈ pNilradical R p ↔ ∃ n, x ^ p ^ n = 0
state_after: case pos
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp : 1 < p
⊢ x ∈ nilradical R ↔ ∃ n, x ^ p ^ n = 0

tactic: refine ⟨fun ⟨n, h⟩ ↦ ⟨n, ?_⟩, fun ⟨n, h⟩ ↦ ⟨p ^ n, h⟩⟩
state_before: case pos
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp : 1 < p
⊢ x ∈ nilradical R ↔ ∃ n, x ^ p ^ n = 0
state_after: case pos
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp : 1 < p
x✝ : x ∈ nilradical R
n : ℕ
h : x ^ n ∈ 0
⊢ x ^ p ^ n = 0

tactic: rw [← Nat.sub_add_cancel ((Nat.lt_pow_self hp n).le), pow_add, h, mul_zero]
state_before: case pos
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp : 1 < p
x✝ : x ∈ nilradical R
n : ℕ
h : x ^ n ∈ 0
⊢ x ^ p ^ n = 0
state_after: no goals

tactic: rw [pow_zero, pow_one, h]
state_before: R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp : ¬1 < p
h : x = 0
⊢ x ^ p ^ 0 = 0
state_after: no goals

tactic: by_cases hn : n = 0
state_before: case neg.inl
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp✝ : ¬1 < p
x✝ : ∃ n, x ^ p ^ n = 0
n : ℕ
h : x ^ p ^ n = 0
hp : p = 0
⊢ x = 0
state_after: case pos
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp✝ : ¬1 < p
x✝ : ∃ n, x ^ p ^ n = 0
n : ℕ
h : x ^ p ^ n = 0
hp : p = 0
hn : n = 0
⊢ x = 0

case neg
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp✝ : ¬1 < p
x✝ : ∃ n, x ^ p ^ n = 0
n : ℕ
h : x ^ p ^ n = 0
hp : p = 0
hn : ¬n = 0
⊢ x = 0

tactic: rw [hp, zero_pow hn, pow_zero] at h
state_before: case neg
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp✝ : ¬1 < p
x✝ : ∃ n, x ^ p ^ n = 0
n : ℕ
h : x ^ p ^ n = 0
hp : p = 0
hn : ¬n = 0
⊢ x = 0
state_after: case neg
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp✝ : ¬1 < p
x✝ : ∃ n, x ^ p ^ n = 0
n : ℕ
h : 1 = 0
hp : p = 0
hn : ¬n = 0
⊢ x = 0

tactic: haveI := subsingleton_of_zero_eq_one h.symm
state_before: case neg
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp✝ : ¬1 < p
x✝ : ∃ n, x ^ p ^ n = 0
n : ℕ
h : 1 = 0
hp : p = 0
hn : ¬n = 0
⊢ x = 0
state_after: case neg
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp✝ : ¬1 < p
x✝ : ∃ n, x ^ p ^ n = 0
n : ℕ
h : 1 = 0
hp : p = 0
hn : ¬n = 0
this : Subsingleton R
⊢ x = 0

tactic: exact Subsingleton.elim _ _
state_before: case neg
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp✝ : ¬1 < p
x✝ : ∃ n, x ^ p ^ n = 0
n : ℕ
h : 1 = 0
hp : p = 0
hn : ¬n = 0
this : Subsingleton R
⊢ x = 0
state_after: no goals

tactic: rwa [hn, pow_zero, pow_one] at h
state_before: case pos
R : Type u_1
inst✝ : CommSemiring R
p : ℕ
x : R
hp✝ : ¬1 < p
x✝ : ∃ n, x ^ p ^ n = 0
n : ℕ
h : x ^ p ^ n = 0
hp : p = 0
hn : n = 0
⊢ x = 0
state_after: no goals