l3lab/ntp-mathlib huggingface dataset:
theorem eq_zero_of_localization (r : R)
    (h : ∀ (J : Ideal R) (hJ : J.IsMaximal), algebraMap R (Localization.AtPrime J) r = 0) :
    r = 0 := by
  

Proof state:
R S : Type u
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S
M : Submonoid R
N : Submonoid S
R' S' : Type u
inst✝³ : CommRing R'
inst✝² : CommRing S'
f : R →+* S
inst✝¹ : Algebra R R'
inst✝ : Algebra S S'
r : R
h : ∀ (J : Ideal R) (hJ : Ideal.IsMaximal J), (algebraMap R (Localization.AtPrime J)) r = 0
⊢ r = 0

Next tactic:
rw [← Ideal.span_singleton_eq_bot]
theorem eq_zero_of_localization (r : R)
    (h : ∀ (J : Ideal R) (hJ : J.IsMaximal), algebraMap R (Localization.AtPrime J) r = 0) :
    r = 0 := by
  rw [← Ideal.span_singleton_eq_bot]
  

Proof state:
R S : Type u
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S
M : Submonoid R
N : Submonoid S
R' S' : Type u
inst✝³ : CommRing R'
inst✝² : CommRing S'
f : R →+* S
inst✝¹ : Algebra R R'
inst✝ : Algebra S S'
r : R
h : ∀ (J : Ideal R) (hJ : Ideal.IsMaximal J), (algebraMap R (Localization.AtPrime J)) r = 0
⊢ Ideal.span {r} = ⊥

Next tactic:
apply ideal_eq_bot_of_localization
theorem eq_zero_of_localization (r : R)
    (h : ∀ (J : Ideal R) (hJ : J.IsMaximal), algebraMap R (Localization.AtPrime J) r = 0) :
    r = 0 := by
  rw [← Ideal.span_singleton_eq_bot]
  apply ideal_eq_bot_of_localization
  

Proof state:
case h
R S : Type u
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S
M : Submonoid R
N : Submonoid S
R' S' : Type u
inst✝³ : CommRing R'
inst✝² : CommRing S'
f : R →+* S
inst✝¹ : Algebra R R'
inst✝ : Algebra S S'
r : R
h : ∀ (J : Ideal R) (hJ : Ideal.IsMaximal J), (algebraMap R (Localization.AtPrime J)) r = 0
⊢ ∀ (J : Ideal R) (hJ : Ideal.IsMaximal J), IsLocalization.coeSubmodule (Localization.AtPrime J) (Ideal.span {r}) = ⊥

Next tactic:
intro J hJ
theorem eq_zero_of_localization (r : R)
    (h : ∀ (J : Ideal R) (hJ : J.IsMaximal), algebraMap R (Localization.AtPrime J) r = 0) :
    r = 0 := by
  rw [← Ideal.span_singleton_eq_bot]
  apply ideal_eq_bot_of_localization
  intro J hJ
  

Proof state:
case h
R S : Type u
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S
M : Submonoid R
N : Submonoid S
R' S' : Type u
inst✝³ : CommRing R'
inst✝² : CommRing S'
f : R →+* S
inst✝¹ : Algebra R R'
inst✝ : Algebra S S'
r : R
h : ∀ (J : Ideal R) (hJ : Ideal.IsMaximal J), (algebraMap R (Localization.AtPrime J)) r = 0
J : Ideal R
hJ : Ideal.IsMaximal J
⊢ IsLocalization.coeSubmodule (Localization.AtPrime J) (Ideal.span {r}) = ⊥

Next tactic:
delta IsLocalization.coeSubmodule
theorem eq_zero_of_localization (r : R)
    (h : ∀ (J : Ideal R) (hJ : J.IsMaximal), algebraMap R (Localization.AtPrime J) r = 0) :
    r = 0 := by
  rw [← Ideal.span_singleton_eq_bot]
  apply ideal_eq_bot_of_localization
  intro J hJ
  delta IsLocalization.coeSubmodule
  

Proof state:
case h
R S : Type u
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S
M : Submonoid R
N : Submonoid S
R' S' : Type u
inst✝³ : CommRing R'
inst✝² : CommRing S'
f : R →+* S
inst✝¹ : Algebra R R'
inst✝ : Algebra S S'
r : R
h : ∀ (J : Ideal R) (hJ : Ideal.IsMaximal J), (algebraMap R (Localization.AtPrime J)) r = 0
J : Ideal R
hJ : Ideal.IsMaximal J
⊢ Submodule.map (Algebra.linearMap R (Localization.AtPrime J)) (Ideal.span {r}) = ⊥

Next tactic:
erw [Submodule.map_span, Submodule.span_eq_bot]
theorem eq_zero_of_localization (r : R)
    (h : ∀ (J : Ideal R) (hJ : J.IsMaximal), algebraMap R (Localization.AtPrime J) r = 0) :
    r = 0 := by
  rw [← Ideal.span_singleton_eq_bot]
  apply ideal_eq_bot_of_localization
  intro J hJ
  delta IsLocalization.coeSubmodule
  erw [Submodule.map_span, Submodule.span_eq_bot]
  

Proof state:
case h
R S : Type u
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S
M : Submonoid R
N : Submonoid S
R' S' : Type u
inst✝³ : CommRing R'
inst✝² : CommRing S'
f : R →+* S
inst✝¹ : Algebra R R'
inst✝ : Algebra S S'
r : R
h : ∀ (J : Ideal R) (hJ : Ideal.IsMaximal J), (algebraMap R (Localization.AtPrime J)) r = 0
J : Ideal R
hJ : Ideal.IsMaximal J
⊢ ∀ x ∈ ⇑(Algebra.linearMap R (Localization.AtPrime J)) '' {r}, x = 0

Next tactic:
rintro _ ⟨_, h', rfl⟩
theorem eq_zero_of_localization (r : R)
    (h : ∀ (J : Ideal R) (hJ : J.IsMaximal), algebraMap R (Localization.AtPrime J) r = 0) :
    r = 0 := by
  rw [← Ideal.span_singleton_eq_bot]
  apply ideal_eq_bot_of_localization
  intro J hJ
  delta IsLocalization.coeSubmodule
  erw [Submodule.map_span, Submodule.span_eq_bot]
  rintro _ ⟨_, h', rfl⟩
  

Proof state:
case h.intro.intro
R S : Type u
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S
M : Submonoid R
N : Submonoid S
R' S' : Type u
inst✝³ : CommRing R'
inst✝² : CommRing S'
f : R →+* S
inst✝¹ : Algebra R R'
inst✝ : Algebra S S'
r : R
h : ∀ (J : Ideal R) (hJ : Ideal.IsMaximal J), (algebraMap R (Localization.AtPrime J)) r = 0
J : Ideal R
hJ : Ideal.IsMaximal J
w✝ : R
h' : w✝ ∈ {r}
⊢ (Algebra.linearMap R (Localization.AtPrime J)) w✝ = 0

Next tactic:
cases Set.mem_singleton_iff.mpr h'
theorem eq_zero_of_localization (r : R)
    (h : ∀ (J : Ideal R) (hJ : J.IsMaximal), algebraMap R (Localization.AtPrime J) r = 0) :
    r = 0 := by
  rw [← Ideal.span_singleton_eq_bot]
  apply ideal_eq_bot_of_localization
  intro J hJ
  delta IsLocalization.coeSubmodule
  erw [Submodule.map_span, Submodule.span_eq_bot]
  rintro _ ⟨_, h', rfl⟩
  cases Set.mem_singleton_iff.mpr h'
  

Proof state:
case h.intro.intro.refl
R S : Type u
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S
M : Submonoid R
N : Submonoid S
R' S' : Type u
inst✝³ : CommRing R'
inst✝² : CommRing S'
f : R →+* S
inst✝¹ : Algebra R R'
inst✝ : Algebra S S'
r : R
h : ∀ (J : Ideal R) (hJ : Ideal.IsMaximal J), (algebraMap R (Localization.AtPrime J)) r = 0
J : Ideal R
hJ : Ideal.IsMaximal J
h' : r ∈ {r}
⊢ (Algebra.linearMap R (Localization.AtPrime J)) r = 0

Next tactic:
exact h J hJ
theorem localization_isReduced : LocalizationPreserves fun R hR => IsReduced R := by
  

Proof state:
R S : Type u
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S
M : Submonoid R
N : Submonoid S
R' S' : Type u
inst✝³ : CommRing R'
inst✝² : CommRing S'
f : R →+* S
inst✝¹ : Algebra R R'
inst✝ : Algebra S S'
⊢ LocalizationPreserves fun R hR => IsReduced R

Next tactic:
introv R _ _
theorem localization_isReduced : LocalizationPreserves fun R hR => IsReduced R := by
  introv R _ _
  

Proof state:
R✝ S✝ : Type u
inst✝⁷ : CommRing R✝
inst✝⁶ : CommRing S✝
M✝ : Submonoid R✝
N : Submonoid S✝
R' S' : Type u
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
f : R✝ →+* S✝
inst✝³ : Algebra R✝ R'
inst✝² : Algebra S✝ S'
R : Type u_1
hR : CommRing R
M : Submonoid R
S : Type u_1
hS : CommRing S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
a✝ : IsReduced R
⊢ IsReduced S

Next tactic:
constructor
theorem localization_isReduced : LocalizationPreserves fun R hR => IsReduced R := by
  introv R _ _
  constructor
  

Proof state:
case eq_zero
R✝ S✝ : Type u
inst✝⁷ : CommRing R✝
inst✝⁶ : CommRing S✝
M✝ : Submonoid R✝
N : Submonoid S✝
R' S' : Type u
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
f : R✝ →+* S✝
inst✝³ : Algebra R✝ R'
inst✝² : Algebra S✝ S'
R : Type u_1
hR : CommRing R
M : Submonoid R
S : Type u_1
hS : CommRing S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
a✝ : IsReduced R
⊢ ∀ (x : S), IsNilpotent x → x = 0

Next tactic:
rintro x ⟨_ | n, e⟩
theorem localization_isReduced : LocalizationPreserves fun R hR => IsReduced R := by
  introv R _ _
  constructor
  rintro x ⟨_ | n, e⟩
  · 

Proof state:
case eq_zero.intro.zero
R✝ S✝ : Type u
inst✝⁷ : CommRing R✝
inst✝⁶ : CommRing S✝
M✝ : Submonoid R✝
N : Submonoid S✝
R' S' : Type u
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
f : R✝ →+* S✝
inst✝³ : Algebra R✝ R'
inst✝² : Algebra S✝ S'
R : Type u_1
hR : CommRing R
M : Submonoid R
S : Type u_1
hS : CommRing S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
a✝ : IsReduced R
x : S
e : x ^ Nat.zero = 0
⊢ x = 0

Next tactic:
simpa using congr_arg (· * x) e
theorem localization_isReduced : LocalizationPreserves fun R hR => IsReduced R := by
  introv R _ _
  constructor
  rintro x ⟨_ | n, e⟩
  · simpa using congr_arg (· * x) e
  

Proof state:
case eq_zero.intro.succ
R✝ S✝ : Type u
inst✝⁷ : CommRing R✝
inst✝⁶ : CommRing S✝
M✝ : Submonoid R✝
N : Submonoid S✝
R' S' : Type u
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
f : R✝ →+* S✝
inst✝³ : Algebra R✝ R'
inst✝² : Algebra S✝ S'
R : Type u_1
hR : CommRing R
M : Submonoid R
S : Type u_1
hS : CommRing S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
a✝ : IsReduced R
x : S
n : ℕ
e : x ^ Nat.succ n = 0
⊢ x = 0

Next tactic:
obtain ⟨⟨y, m⟩, hx⟩ := IsLocalization.surj M x
theorem localization_isReduced : LocalizationPreserves fun R hR => IsReduced R := by
  introv R _ _
  constructor
  rintro x ⟨_ | n, e⟩
  · simpa using congr_arg (· * x) e
  obtain ⟨⟨y, m⟩, hx⟩ := IsLocalization.surj M x
  

Proof state:
case eq_zero.intro.succ.intro.mk
R✝ S✝ : Type u
inst✝⁷ : CommRing R✝
inst✝⁶ : CommRing S✝
M✝ : Submonoid R✝
N : Submonoid S✝
R' S' : Type u
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
f : R✝ →+* S✝
inst✝³ : Algebra R✝ R'
inst✝² : Algebra S✝ S'
R : Type u_1
hR : CommRing R
M : Submonoid R
S : Type u_1
hS : CommRing S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
a✝ : IsReduced R
x : S
n : ℕ
e : x ^ Nat.succ n = 0
y : R
m : ↥M
hx : x * (algebraMap R S) ↑(y, m).2 = (algebraMap R S) (y, m).1
⊢ x = 0

Next tactic:
dsimp only at hx
theorem localization_isReduced : LocalizationPreserves fun R hR => IsReduced R := by
  introv R _ _
  constructor
  rintro x ⟨_ | n, e⟩
  · simpa using congr_arg (· * x) e
  obtain ⟨⟨y, m⟩, hx⟩ := IsLocalization.surj M x
  dsimp only at hx
  

Proof state:
case eq_zero.intro.succ.intro.mk
R✝ S✝ : Type u
inst✝⁷ : CommRing R✝
inst✝⁶ : CommRing S✝
M✝ : Submonoid R✝
N : Submonoid S✝
R' S' : Type u
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
f : R✝ →+* S✝
inst✝³ : Algebra R✝ R'
inst✝² : Algebra S✝ S'
R : Type u_1
hR : CommRing R
M : Submonoid R
S : Type u_1
hS : CommRing S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
a✝ : IsReduced R
x : S
n : ℕ
e : x ^ Nat.succ n = 0
y : R
m : ↥M
hx : x * (algebraMap R S) ↑m = (algebraMap R S) y
⊢ x = 0

Next tactic:
let hx' := congr_arg (· ^ n.succ) hx
theorem localization_isReduced : LocalizationPreserves fun R hR => IsReduced R := by
  introv R _ _
  constructor
  rintro x ⟨_ | n, e⟩
  · simpa using congr_arg (· * x) e
  obtain ⟨⟨y, m⟩, hx⟩ := IsLocalization.surj M x
  dsimp only at hx
  let hx' := congr_arg (· ^ n.succ) hx
  

Proof state:
case eq_zero.intro.succ.intro.mk
R✝ S✝ : Type u
inst✝⁷ : CommRing R✝
inst✝⁶ : CommRing S✝
M✝ : Submonoid R✝
N : Submonoid S✝
R' S' : Type u
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
f : R✝ →+* S✝
inst✝³ : Algebra R✝ R'
inst✝² : Algebra S✝ S'
R : Type u_1
hR : CommRing R
M : Submonoid R
S : Type u_1
hS : CommRing S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
a✝ : IsReduced R
x : S
n : ℕ
e : x ^ Nat.succ n = 0
y : R
m : ↥M
hx : x * (algebraMap R S) ↑m = (algebraMap R S) y
hx' : (fun x => x ^ Nat.succ n) (x * (algebraMap R S) ↑m) = (fun x => x ^ Nat.succ n) ((algebraMap R S) y) :=
  congr_arg (fun x => x ^ Nat.succ n) hx
⊢ x = 0

Next tactic:
simp only [mul_pow, e, zero_mul, ← RingHom.map_pow] at hx'
theorem localization_isReduced : LocalizationPreserves fun R hR => IsReduced R := by
  introv R _ _
  constructor
  rintro x ⟨_ | n, e⟩
  · simpa using congr_arg (· * x) e
  obtain ⟨⟨y, m⟩, hx⟩ := IsLocalization.surj M x
  dsimp only at hx
  let hx' := congr_arg (· ^ n.succ) hx
  simp only [mul_pow, e, zero_mul, ← RingHom.map_pow] at hx'
  

Proof state:
case eq_zero.intro.succ.intro.mk
R✝ S✝ : Type u
inst✝⁷ : CommRing R✝
inst✝⁶ : CommRing S✝
M✝ : Submonoid R✝
N : Submonoid S✝
R' S' : Type u
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
f : R✝ →+* S✝
inst✝³ : Algebra R✝ R'
inst✝² : Algebra S✝ S'
R : Type u_1
hR : CommRing R
M : Submonoid R
S : Type u_1
hS : CommRing S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
a✝ : IsReduced R
x : S
n : ℕ
e : x ^ Nat.succ n = 0
y : R
m : ↥M
hx : x * (algebraMap R S) ↑m = (algebraMap R S) y
hx' : 0 = (algebraMap R S) (y ^ Nat.succ n)
⊢ x = 0

Next tactic:
rw [← (algebraMap R S).map_zero] at hx'
theorem localization_isReduced : LocalizationPreserves fun R hR => IsReduced R := by
  introv R _ _
  constructor
  rintro x ⟨_ | n, e⟩
  · simpa using congr_arg (· * x) e
  obtain ⟨⟨y, m⟩, hx⟩ := IsLocalization.surj M x
  dsimp only at hx
  let hx' := congr_arg (· ^ n.succ) hx
  simp only [mul_pow, e, zero_mul, ← RingHom.map_pow] at hx'
  rw [← (algebraMap R S).map_zero] at hx'
  

Proof state:
case eq_zero.intro.succ.intro.mk
R✝ S✝ : Type u
inst✝⁷ : CommRing R✝
inst✝⁶ : CommRing S✝
M✝ : Submonoid R✝
N : Submonoid S✝
R' S' : Type u
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
f : R✝ →+* S✝
inst✝³ : Algebra R✝ R'
inst✝² : Algebra S✝ S'
R : Type u_1
hR : CommRing R
M : Submonoid R
S : Type u_1
hS : CommRing S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
a✝ : IsReduced R
x : S
n : ℕ
e : x ^ Nat.succ n = 0
y : R
m : ↥M
hx : x * (algebraMap R S) ↑m = (algebraMap R S) y
hx' : (algebraMap R S) 0 = (algebraMap R S) (y ^ Nat.succ n)
⊢ x = 0

Next tactic:
obtain ⟨m', hm'⟩ := (IsLocalization.eq_iff_exists M S).mp hx'
theorem localization_isReduced : LocalizationPreserves fun R hR => IsReduced R := by
  introv R _ _
  constructor
  rintro x ⟨_ | n, e⟩
  · simpa using congr_arg (· * x) e
  obtain ⟨⟨y, m⟩, hx⟩ := IsLocalization.surj M x
  dsimp only at hx
  let hx' := congr_arg (· ^ n.succ) hx
  simp only [mul_pow, e, zero_mul, ← RingHom.map_pow] at hx'
  rw [← (algebraMap R S).map_zero] at hx'
  obtain ⟨m', hm'⟩ := (IsLocalization.eq_iff_exists M S).mp hx'
  

Proof state:
case eq_zero.intro.succ.intro.mk.intro
R✝ S✝ : Type u
inst✝⁷ : CommRing R✝
inst✝⁶ : CommRing S✝
M✝ : Submonoid R✝
N : Submonoid S✝
R' S' : Type u
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
f : R✝ →+* S✝
inst✝³ : Algebra R✝ R'
inst✝² : Algebra S✝ S'
R : Type u_1
hR : CommRing R
M : Submonoid R
S : Type u_1
hS : CommRing S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
a✝ : IsReduced R
x : S
n : ℕ
e : x ^ Nat.succ n = 0
y : R
m : ↥M
hx : x * (algebraMap R S) ↑m = (algebraMap R S) y
hx' : (algebraMap R S) 0 = (algebraMap R S) (y ^ Nat.succ n)
m' : ↥M
hm' : ↑m' * 0 = ↑m' * y ^ Nat.succ n
⊢ x = 0

Next tactic:
apply_fun (· * (m' : R) ^ n) at hm'
theorem localization_isReduced : LocalizationPreserves fun R hR => IsReduced R := by
  introv R _ _
  constructor
  rintro x ⟨_ | n, e⟩
  · simpa using congr_arg (· * x) e
  obtain ⟨⟨y, m⟩, hx⟩ := IsLocalization.surj M x
  dsimp only at hx
  let hx' := congr_arg (· ^ n.succ) hx
  simp only [mul_pow, e, zero_mul, ← RingHom.map_pow] at hx'
  rw [← (algebraMap R S).map_zero] at hx'
  obtain ⟨m', hm'⟩ := (IsLocalization.eq_iff_exists M S).mp hx'
  apply_fun (· * (m' : R) ^ n) at hm'
  

Proof state:
case eq_zero.intro.succ.intro.mk.intro
R✝ S✝ : Type u
inst✝⁷ : CommRing R✝
inst✝⁶ : CommRing S✝
M✝ : Submonoid R✝
N : Submonoid S✝
R' S' : Type u
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
f : R✝ →+* S✝
inst✝³ : Algebra R✝ R'
inst✝² : Algebra S✝ S'
R : Type u_1
hR : CommRing R
M : Submonoid R
S : Type u_1
hS : CommRing S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
a✝ : IsReduced R
x : S
n : ℕ
e : x ^ Nat.succ n = 0
y : R
m : ↥M
hx : x * (algebraMap R S) ↑m = (algebraMap R S) y
hx' : (algebraMap R S) 0 = (algebraMap R S) (y ^ Nat.succ n)
m' : ↥M
hm' : ↑m' * 0 * ↑m' ^ n = ↑m' * y ^ Nat.succ n * ↑m' ^ n
⊢ x = 0

Next tactic:
simp only [mul_assoc, zero_mul, mul_zero] at hm'
theorem localization_isReduced : LocalizationPreserves fun R hR => IsReduced R := by
  introv R _ _
  constructor
  rintro x ⟨_ | n, e⟩
  · simpa using congr_arg (· * x) e
  obtain ⟨⟨y, m⟩, hx⟩ := IsLocalization.surj M x
  dsimp only at hx
  let hx' := congr_arg (· ^ n.succ) hx
  simp only [mul_pow, e, zero_mul, ← RingHom.map_pow] at hx'
  rw [← (algebraMap R S).map_zero] at hx'
  obtain ⟨m', hm'⟩ := (IsLocalization.eq_iff_exists M S).mp hx'
  apply_fun (· * (m' : R) ^ n) at hm'
  simp only [mul_assoc, zero_mul, mul_zero] at hm'
  

Proof state:
case eq_zero.intro.succ.intro.mk.intro
R✝ S✝ : Type u
inst✝⁷ : CommRing R✝
inst✝⁶ : CommRing S✝
M✝ : Submonoid R✝
N : Submonoid S✝
R' S' : Type u
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
f : R✝ →+* S✝
inst✝³ : Algebra R✝ R'
inst✝² : Algebra S✝ S'
R : Type u_1
hR : CommRing R
M : Submonoid R
S : Type u_1
hS : CommRing S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
a✝ : IsReduced R
x : S
n : ℕ
e : x ^ Nat.succ n = 0
y : R
m : ↥M
hx : x * (algebraMap R S) ↑m = (algebraMap R S) y
hx' : (algebraMap R S) 0 = (algebraMap R S) (y ^ Nat.succ n)
m' : ↥M
hm' : 0 = ↑m' * (y ^ Nat.succ n * ↑m' ^ n)
⊢ x = 0

Next tactic:
rw [← mul_left_comm, ← pow_succ, ← mul_pow] at hm'
theorem localization_isReduced : LocalizationPreserves fun R hR => IsReduced R := by
  introv R _ _
  constructor
  rintro x ⟨_ | n, e⟩
  · simpa using congr_arg (· * x) e
  obtain ⟨⟨y, m⟩, hx⟩ := IsLocalization.surj M x
  dsimp only at hx
  let hx' := congr_arg (· ^ n.succ) hx
  simp only [mul_pow, e, zero_mul, ← RingHom.map_pow] at hx'
  rw [← (algebraMap R S).map_zero] at hx'
  obtain ⟨m', hm'⟩ := (IsLocalization.eq_iff_exists M S).mp hx'
  apply_fun (· * (m' : R) ^ n) at hm'
  simp only [mul_assoc, zero_mul, mul_zero] at hm'
  rw [← mul_left_comm, ← pow_succ, ← mul_pow] at hm'
  

Proof state:
case eq_zero.intro.succ.intro.mk.intro
R✝ S✝ : Type u
inst✝⁷ : CommRing R✝
inst✝⁶ : CommRing S✝
M✝ : Submonoid R✝
N : Submonoid S✝
R' S' : Type u
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
f : R✝ →+* S✝
inst✝³ : Algebra R✝ R'
inst✝² : Algebra S✝ S'
R : Type u_1
hR : CommRing R
M : Submonoid R
S : Type u_1
hS : CommRing S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
a✝ : IsReduced R
x : S
n : ℕ
e : x ^ Nat.succ n = 0
y : R
m : ↥M
hx : x * (algebraMap R S) ↑m = (algebraMap R S) y
hx' : (algebraMap R S) 0 = (algebraMap R S) (y ^ Nat.succ n)
m' : ↥M
hm' : 0 = (y * ↑m') ^ Nat.succ n
⊢ x = 0

Next tactic:
replace hm' := IsNilpotent.eq_zero ⟨_, hm'.symm⟩
theorem localization_isReduced : LocalizationPreserves fun R hR => IsReduced R := by
  introv R _ _
  constructor
  rintro x ⟨_ | n, e⟩
  · simpa using congr_arg (· * x) e
  obtain ⟨⟨y, m⟩, hx⟩ := IsLocalization.surj M x
  dsimp only at hx
  let hx' := congr_arg (· ^ n.succ) hx
  simp only [mul_pow, e, zero_mul, ← RingHom.map_pow] at hx'
  rw [← (algebraMap R S).map_zero] at hx'
  obtain ⟨m', hm'⟩ := (IsLocalization.eq_iff_exists M S).mp hx'
  apply_fun (· * (m' : R) ^ n) at hm'
  simp only [mul_assoc, zero_mul, mul_zero] at hm'
  rw [← mul_left_comm, ← pow_succ, ← mul_pow] at hm'
  replace hm' := IsNilpotent.eq_zero ⟨_, hm'.symm⟩
  

Proof state:
case eq_zero.intro.succ.intro.mk.intro
R✝ S✝ : Type u
inst✝⁷ : CommRing R✝
inst✝⁶ : CommRing S✝
M✝ : Submonoid R✝
N : Submonoid S✝
R' S' : Type u
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
f : R✝ →+* S✝
inst✝³ : Algebra R✝ R'
inst✝² : Algebra S✝ S'
R : Type u_1
hR : CommRing R
M : Submonoid R
S : Type u_1
hS : CommRing S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
a✝ : IsReduced R
x : S
n : ℕ
e : x ^ Nat.succ n = 0
y : R
m : ↥M
hx : x * (algebraMap R S) ↑m = (algebraMap R S) y
hx' : (algebraMap R S) 0 = (algebraMap R S) (y ^ Nat.succ n)
m' : ↥M
hm' : y * ↑m' = 0
⊢ x = 0

Next tactic:
rw [← (IsLocalization.map_units S m).mul_left_inj, hx, zero_mul,
    IsLocalization.map_eq_zero_iff M]
theorem localization_isReduced : LocalizationPreserves fun R hR => IsReduced R := by
  introv R _ _
  constructor
  rintro x ⟨_ | n, e⟩
  · simpa using congr_arg (· * x) e
  obtain ⟨⟨y, m⟩, hx⟩ := IsLocalization.surj M x
  dsimp only at hx
  let hx' := congr_arg (· ^ n.succ) hx
  simp only [mul_pow, e, zero_mul, ← RingHom.map_pow] at hx'
  rw [← (algebraMap R S).map_zero] at hx'
  obtain ⟨m', hm'⟩ := (IsLocalization.eq_iff_exists M S).mp hx'
  apply_fun (· * (m' : R) ^ n) at hm'
  simp only [mul_assoc, zero_mul, mul_zero] at hm'
  rw [← mul_left_comm, ← pow_succ, ← mul_pow] at hm'
  replace hm' := IsNilpotent.eq_zero ⟨_, hm'.symm⟩
  rw [← (IsLocalization.map_units S m).mul_left_inj, hx, zero_mul,
    IsLocalization.map_eq_zero_iff M]
  

Proof state:
case eq_zero.intro.succ.intro.mk.intro
R✝ S✝ : Type u
inst✝⁷ : CommRing R✝
inst✝⁶ : CommRing S✝
M✝ : Submonoid R✝
N : Submonoid S✝
R' S' : Type u
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
f : R✝ →+* S✝
inst✝³ : Algebra R✝ R'
inst✝² : Algebra S✝ S'
R : Type u_1
hR : CommRing R
M : Submonoid R
S : Type u_1
hS : CommRing S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
a✝ : IsReduced R
x : S
n : ℕ
e : x ^ Nat.succ n = 0
y : R
m : ↥M
hx : x * (algebraMap R S) ↑m = (algebraMap R S) y
hx' : (algebraMap R S) 0 = (algebraMap R S) (y ^ Nat.succ n)
m' : ↥M
hm' : y * ↑m' = 0
⊢ ∃ m, ↑m * y = 0

Next tactic:
exact ⟨m', by rw [← hm', mul_comm]⟩
theorem localization_isReduced : LocalizationPreserves fun R hR => IsReduced R := by
  introv R _ _
  constructor
  rintro x ⟨_ | n, e⟩
  · simpa using congr_arg (· * x) e
  obtain ⟨⟨y, m⟩, hx⟩ := IsLocalization.surj M x
  dsimp only at hx
  let hx' := congr_arg (· ^ n.succ) hx
  simp only [mul_pow, e, zero_mul, ← RingHom.map_pow] at hx'
  rw [← (algebraMap R S).map_zero] at hx'
  obtain ⟨m', hm'⟩ := (IsLocalization.eq_iff_exists M S).mp hx'
  apply_fun (· * (m' : R) ^ n) at hm'
  simp only [mul_assoc, zero_mul, mul_zero] at hm'
  rw [← mul_left_comm, ← pow_succ, ← mul_pow] at hm'
  replace hm' := IsNilpotent.eq_zero ⟨_, hm'.symm⟩
  rw [← (IsLocalization.map_units S m).mul_left_inj, hx, zero_mul,
    IsLocalization.map_eq_zero_iff M]
  exact ⟨m', by 

Proof state:
R✝ S✝ : Type u
inst✝⁷ : CommRing R✝
inst✝⁶ : CommRing S✝
M✝ : Submonoid R✝
N : Submonoid S✝
R' S' : Type u
inst✝⁵ : CommRing R'
inst✝⁴ : CommRing S'
f : R✝ →+* S✝
inst✝³ : Algebra R✝ R'
inst✝² : Algebra S✝ S'
R : Type u_1
hR : CommRing R
M : Submonoid R
S : Type u_1
hS : CommRing S
inst✝¹ : Algebra R S
inst✝ : IsLocalization M S
a✝ : IsReduced R
x : S
n : ℕ
e : x ^ Nat.succ n = 0
y : R
m : ↥M
hx : x * (algebraMap R S) ↑m = (algebraMap R S) y
hx' : (algebraMap R S) 0 = (algebraMap R S) (y ^ Nat.succ n)
m' : ↥M
hm' : y * ↑m' = 0
⊢ ↑m' * y = 0

Next tactic:
rw [← hm', mul_comm]
theorem isReduced_ofLocalizationMaximal : OfLocalizationMaximal fun R hR => IsReduced R := by
  

Proof state:
R S : Type u
inst✝⁵ : CommRing R
inst✝⁴ : CommRing S
M : Submonoid R
N : Submonoid S
R' S' : Type u
inst✝³ : CommRing R'
inst✝² : CommRing S'
f : R →+* S
inst✝¹ : Algebra R R'
inst✝ : Algebra S S'
⊢ OfLocalizationMaximal fun R hR => IsReduced R

Next tactic:
introv R h
theorem isReduced_ofLocalizationMaximal : OfLocalizationMaximal fun R hR => IsReduced R := by
  introv R h
  

Proof state:
R✝ S : Type u
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
M : Submonoid R✝
N : Submonoid S
R' S' : Type u
inst✝⁴ : CommRing R'
inst✝³ : CommRing S'
f : R✝ →+* S
inst✝² : Algebra R✝ R'
inst✝¹ : Algebra S S'
R : Type u_1
inst✝ : CommRing R
h :
  ∀ (J : Ideal R) (x : Ideal.IsMaximal J),
    (fun R hR => IsReduced R) (Localization.AtPrime J) Localization.instCommRingLocalizationToCommMonoid
⊢ IsReduced R

Next tactic:
constructor
theorem isReduced_ofLocalizationMaximal : OfLocalizationMaximal fun R hR => IsReduced R := by
  introv R h
  constructor
  

Proof state:
case eq_zero
R✝ S : Type u
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
M : Submonoid R✝
N : Submonoid S
R' S' : Type u
inst✝⁴ : CommRing R'
inst✝³ : CommRing S'
f : R✝ →+* S
inst✝² : Algebra R✝ R'
inst✝¹ : Algebra S S'
R : Type u_1
inst✝ : CommRing R
h :
  ∀ (J : Ideal R) (x : Ideal.IsMaximal J),
    (fun R hR => IsReduced R) (Localization.AtPrime J) Localization.instCommRingLocalizationToCommMonoid
⊢ ∀ (x : R), IsNilpotent x → x = 0

Next tactic:
intro x hx
theorem isReduced_ofLocalizationMaximal : OfLocalizationMaximal fun R hR => IsReduced R := by
  introv R h
  constructor
  intro x hx
  

Proof state:
case eq_zero
R✝ S : Type u
inst✝⁶ : CommRing R✝
inst✝⁵ : CommRing S
M : Submonoid R✝
N : Submonoid S
R' S' : Type u
inst✝⁴ : CommRing R'
inst✝³ : CommRing S'
f : R✝ →+* S
inst✝² : Algebra R✝ R'
inst✝¹ : Algebra S S'
R : Type u_1
inst✝ : CommRing R
h :
  ∀ (J : Ideal R) (x : Ideal.IsMaximal J),
    (fun R hR => IsReduced R) (Localization.AtPrime J) Localization.instCommRingLocalizationToCommMonoid
x : R
hx : IsNilpotent x
⊢ x = 0

Next tactic:
apply eq_zero_of_localization