l3lab/ntp-mathlib huggingface dataset:
/-- A ring is a Jacobson ring if and only if for all prime ideals `P`,
 the Jacobson radical of `P` is equal to `P`. -/
theorem isJacobson_iff_prime_eq : IsJacobson R ↔ ∀ P : Ideal R, IsPrime P → P.jacobson = P := by
  refine' isJacobson_iff.trans ⟨fun h I hI => h I hI.isRadical, _⟩
  refine fun h I hI ↦ le_antisymm (fun x hx ↦ ?_) (fun x hx ↦ mem_sInf.mpr fun _ hJ ↦ hJ.left hx)
  rw [← hI.radical, radical_eq_sInf I, mem_sInf]
  intro P hP
  rw [Set.mem_setOf_eq] at hP
  erw [mem_sInf] at hx
  erw [← h P hP.right, mem_sInf]
  

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
I✝ : Ideal R
h : ∀ (P : Ideal R), IsPrime P → jacobson P = P
I : Ideal R
hI : IsRadical I
x : R
hx : ∀ ⦃I_1 : Ideal R⦄, I_1 ∈ {J | I ≤ J ∧ IsMaximal J} → x ∈ I_1
P : Ideal R
hP : I ≤ P ∧ IsPrime P
⊢ ∀ ⦃I : Ideal R⦄, I ∈ {J | P ≤ J ∧ IsMaximal J} → x ∈ I

Next tactic:
exact fun J hJ => hx ⟨le_trans hP.left hJ.left, hJ.right⟩
/-- Fields have only two ideals, and the condition holds for both of them. -/
instance (priority := 100) isJacobson_field {K : Type*} [Field K] : IsJacobson K :=
  ⟨fun I _ => Or.recOn (eq_bot_or_top I)
    (fun h => le_antisymm (sInf_le ⟨le_rfl, h.symm ▸ bot_isMaximal⟩) (h.symm ▸ bot_le)) fun h =>
      by 

Proof state:
R : Type u_1
S : Type u_2
inst✝² : CommRing R
inst✝¹ : CommRing S
I✝ : Ideal R
K : Type u_3
inst✝ : Field K
I : Ideal K
x✝ : IsRadical I
h : I = ⊤
⊢ jacobson I = I

Next tactic:
rw [h, jacobson_eq_top_iff]
theorem isJacobson_of_surjective [H : IsJacobson R] :
    (∃ f : R →+* S, Function.Surjective ↑f) → IsJacobson S := by
  

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
I : Ideal R
H : IsJacobson R
⊢ (∃ f, Function.Surjective ⇑f) → IsJacobson S

Next tactic:
rintro ⟨f, hf⟩
theorem isJacobson_of_surjective [H : IsJacobson R] :
    (∃ f : R →+* S, Function.Surjective ↑f) → IsJacobson S := by
  rintro ⟨f, hf⟩
  

Proof state:
case intro
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
I : Ideal R
H : IsJacobson R
f : R →+* S
hf : Function.Surjective ⇑f
⊢ IsJacobson S

Next tactic:
rw [isJacobson_iff_sInf_maximal]
theorem isJacobson_of_surjective [H : IsJacobson R] :
    (∃ f : R →+* S, Function.Surjective ↑f) → IsJacobson S := by
  rintro ⟨f, hf⟩
  rw [isJacobson_iff_sInf_maximal]
  

Proof state:
case intro
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
I : Ideal R
H : IsJacobson R
f : R →+* S
hf : Function.Surjective ⇑f
⊢ ∀ {I : Ideal S}, IsPrime I → ∃ M, (∀ J ∈ M, IsMaximal J ∨ J = ⊤) ∧ I = sInf M

Next tactic:
intro p hp
theorem isJacobson_of_surjective [H : IsJacobson R] :
    (∃ f : R →+* S, Function.Surjective ↑f) → IsJacobson S := by
  rintro ⟨f, hf⟩
  rw [isJacobson_iff_sInf_maximal]
  intro p hp
  

Proof state:
case intro
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
I : Ideal R
H : IsJacobson R
f : R →+* S
hf : Function.Surjective ⇑f
p : Ideal S
hp : IsPrime p
⊢ ∃ M, (∀ J ∈ M, IsMaximal J ∨ J = ⊤) ∧ p = sInf M

Next tactic:
use map f '' { J : Ideal R | comap f p ≤ J ∧ J.IsMaximal }
theorem isJacobson_of_surjective [H : IsJacobson R] :
    (∃ f : R →+* S, Function.Surjective ↑f) → IsJacobson S := by
  rintro ⟨f, hf⟩
  rw [isJacobson_iff_sInf_maximal]
  intro p hp
  use map f '' { J : Ideal R | comap f p ≤ J ∧ J.IsMaximal }
  

Proof state:
case h
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
I : Ideal R
H : IsJacobson R
f : R →+* S
hf : Function.Surjective ⇑f
p : Ideal S
hp : IsPrime p
⊢ (∀ J ∈ map f '' {J | comap f p ≤ J ∧ IsMaximal J}, IsMaximal J ∨ J = ⊤) ∧
    p = sInf (map f '' {J | comap f p ≤ J ∧ IsMaximal J})

Next tactic:
use fun j ⟨J, hJ, hmap⟩ => hmap ▸ (map_eq_top_or_isMaximal_of_surjective f hf hJ.right).symm
theorem isJacobson_of_surjective [H : IsJacobson R] :
    (∃ f : R →+* S, Function.Surjective ↑f) → IsJacobson S := by
  rintro ⟨f, hf⟩
  rw [isJacobson_iff_sInf_maximal]
  intro p hp
  use map f '' { J : Ideal R | comap f p ≤ J ∧ J.IsMaximal }
  use fun j ⟨J, hJ, hmap⟩ => hmap ▸ (map_eq_top_or_isMaximal_of_surjective f hf hJ.right).symm
  

Proof state:
case right
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
I : Ideal R
H : IsJacobson R
f : R →+* S
hf : Function.Surjective ⇑f
p : Ideal S
hp : IsPrime p
⊢ p = sInf (map f '' {J | comap f p ≤ J ∧ IsMaximal J})

Next tactic:
have : p = map f (comap f p).jacobson :=
    (IsJacobson.out' _ <| hp.isRadical.comap f).symm ▸ (map_comap_of_surjective f hf p).symm
theorem isJacobson_of_surjective [H : IsJacobson R] :
    (∃ f : R →+* S, Function.Surjective ↑f) → IsJacobson S := by
  rintro ⟨f, hf⟩
  rw [isJacobson_iff_sInf_maximal]
  intro p hp
  use map f '' { J : Ideal R | comap f p ≤ J ∧ J.IsMaximal }
  use fun j ⟨J, hJ, hmap⟩ => hmap ▸ (map_eq_top_or_isMaximal_of_surjective f hf hJ.right).symm
  have : p = map f (comap f p).jacobson :=
    (IsJacobson.out' _ <| hp.isRadical.comap f).symm ▸ (map_comap_of_surjective f hf p).symm
  

Proof state:
case right
R : Type u_1
S : Type u_2
inst✝¹ : CommRing R
inst✝ : CommRing S
I : Ideal R
H : IsJacobson R
f : R →+* S
hf : Function.Surjective ⇑f
p : Ideal S
hp : IsPrime p
this : p = map f (jacobson (comap f p))
⊢ p = sInf (map f '' {J | comap f p ≤ J ∧ IsMaximal J})

Next tactic:
exact this.trans (map_sInf hf fun J ⟨hJ, _⟩ => le_trans (Ideal.ker_le_comap f) hJ)
instance (priority := 100) isJacobson_quotient [IsJacobson R] : IsJacobson (R ⧸ I) :=
  isJacobson_of_surjective ⟨Quotient.mk I, by
    

Proof state:
R : Type u_1
S : Type u_2
inst✝² : CommRing R
inst✝¹ : CommRing S
I : Ideal R
inst✝ : IsJacobson R
⊢ Function.Surjective ⇑(Quotient.mk I)

Next tactic:
rintro ⟨x⟩
instance (priority := 100) isJacobson_quotient [IsJacobson R] : IsJacobson (R ⧸ I) :=
  isJacobson_of_surjective ⟨Quotient.mk I, by
    rintro ⟨x⟩
    

Proof state:
case mk
R : Type u_1
S : Type u_2
inst✝² : CommRing R
inst✝¹ : CommRing S
I : Ideal R
inst✝ : IsJacobson R
b✝ : R ⧸ I
x : R
⊢ ∃ a, (Quotient.mk I) a = Quot.mk Setoid.r x

Next tactic:
use x
instance (priority := 100) isJacobson_quotient [IsJacobson R] : IsJacobson (R ⧸ I) :=
  isJacobson_of_surjective ⟨Quotient.mk I, by
    rintro ⟨x⟩
    use x
    

Proof state:
case h
R : Type u_1
S : Type u_2
inst✝² : CommRing R
inst✝¹ : CommRing S
I : Ideal R
inst✝ : IsJacobson R
b✝ : R ⧸ I
x : R
⊢ (Quotient.mk I) x = Quot.mk Setoid.r x

Next tactic:
rfl
theorem isJacobson_of_isIntegral [Algebra R S] (hRS : Algebra.IsIntegral R S) (hR : IsJacobson R) :
    IsJacobson S := by
  

Proof state:
R : Type u_1
S : Type u_2
inst✝² : CommRing R
inst✝¹ : CommRing S
I : Ideal R
inst✝ : Algebra R S
hRS : Algebra.IsIntegral R S
hR : IsJacobson R
⊢ IsJacobson S

Next tactic:
rw [isJacobson_iff_prime_eq]
theorem isJacobson_of_isIntegral [Algebra R S] (hRS : Algebra.IsIntegral R S) (hR : IsJacobson R) :
    IsJacobson S := by
  rw [isJacobson_iff_prime_eq]
  

Proof state:
R : Type u_1
S : Type u_2
inst✝² : CommRing R
inst✝¹ : CommRing S
I : Ideal R
inst✝ : Algebra R S
hRS : Algebra.IsIntegral R S
hR : IsJacobson R
⊢ ∀ (P : Ideal S), IsPrime P → jacobson P = P

Next tactic:
intro P hP
theorem isJacobson_of_isIntegral [Algebra R S] (hRS : Algebra.IsIntegral R S) (hR : IsJacobson R) :
    IsJacobson S := by
  rw [isJacobson_iff_prime_eq]
  intro P hP
  

Proof state:
R : Type u_1
S : Type u_2
inst✝² : CommRing R
inst✝¹ : CommRing S
I : Ideal R
inst✝ : Algebra R S
hRS : Algebra.IsIntegral R S
hR : IsJacobson R
P : Ideal S
hP : IsPrime P
⊢ jacobson P = P

Next tactic:
by_cases hP_top : comap (algebraMap R S) P = ⊤
theorem isJacobson_of_isIntegral [Algebra R S] (hRS : Algebra.IsIntegral R S) (hR : IsJacobson R) :
    IsJacobson S := by
  rw [isJacobson_iff_prime_eq]
  intro P hP
  by_cases hP_top : comap (algebraMap R S) P = ⊤
  · 

Proof state:
case pos
R : Type u_1
S : Type u_2
inst✝² : CommRing R
inst✝¹ : CommRing S
I : Ideal R
inst✝ : Algebra R S
hRS : Algebra.IsIntegral R S
hR : IsJacobson R
P : Ideal S
hP : IsPrime P
hP_top : comap (algebraMap R S) P = ⊤
⊢ jacobson P = P

Next tactic:
simp [comap_eq_top_iff.1 hP_top]
theorem isJacobson_of_isIntegral [Algebra R S] (hRS : Algebra.IsIntegral R S) (hR : IsJacobson R) :
    IsJacobson S := by
  rw [isJacobson_iff_prime_eq]
  intro P hP
  by_cases hP_top : comap (algebraMap R S) P = ⊤
  · simp [comap_eq_top_iff.1 hP_top]
  · 

Proof state:
case neg
R : Type u_1
S : Type u_2
inst✝² : CommRing R
inst✝¹ : CommRing S
I : Ideal R
inst✝ : Algebra R S
hRS : Algebra.IsIntegral R S
hR : IsJacobson R
P : Ideal S
hP : IsPrime P
hP_top : ¬comap (algebraMap R S) P = ⊤
⊢ jacobson P = P

Next tactic:
haveI : Nontrivial (R ⧸ comap (algebraMap R S) P) := Quotient.nontrivial hP_top
theorem isJacobson_of_isIntegral [Algebra R S] (hRS : Algebra.IsIntegral R S) (hR : IsJacobson R) :
    IsJacobson S := by
  rw [isJacobson_iff_prime_eq]
  intro P hP
  by_cases hP_top : comap (algebraMap R S) P = ⊤
  · simp [comap_eq_top_iff.1 hP_top]
  · haveI : Nontrivial (R ⧸ comap (algebraMap R S) P) := Quotient.nontrivial hP_top
    

Proof state:
case neg
R : Type u_1
S : Type u_2
inst✝² : CommRing R
inst✝¹ : CommRing S
I : Ideal R
inst✝ : Algebra R S
hRS : Algebra.IsIntegral R S
hR : IsJacobson R
P : Ideal S
hP : IsPrime P
hP_top : ¬comap (algebraMap R S) P = ⊤
this : Nontrivial (R ⧸ comap (algebraMap R S) P)
⊢ jacobson P = P

Next tactic:
rw [jacobson_eq_iff_jacobson_quotient_eq_bot]
theorem isJacobson_of_isIntegral [Algebra R S] (hRS : Algebra.IsIntegral R S) (hR : IsJacobson R) :
    IsJacobson S := by
  rw [isJacobson_iff_prime_eq]
  intro P hP
  by_cases hP_top : comap (algebraMap R S) P = ⊤
  · simp [comap_eq_top_iff.1 hP_top]
  · haveI : Nontrivial (R ⧸ comap (algebraMap R S) P) := Quotient.nontrivial hP_top
    rw [jacobson_eq_iff_jacobson_quotient_eq_bot]
    

Proof state:
case neg
R : Type u_1
S : Type u_2
inst✝² : CommRing R
inst✝¹ : CommRing S
I : Ideal R
inst✝ : Algebra R S
hRS : Algebra.IsIntegral R S
hR : IsJacobson R
P : Ideal S
hP : IsPrime P
hP_top : ¬comap (algebraMap R S) P = ⊤
this : Nontrivial (R ⧸ comap (algebraMap R S) P)
⊢ jacobson ⊥ = ⊥

Next tactic:
refine' eq_bot_of_comap_eq_bot hRS.quotient _
theorem isJacobson_of_isIntegral [Algebra R S] (hRS : Algebra.IsIntegral R S) (hR : IsJacobson R) :
    IsJacobson S := by
  rw [isJacobson_iff_prime_eq]
  intro P hP
  by_cases hP_top : comap (algebraMap R S) P = ⊤
  · simp [comap_eq_top_iff.1 hP_top]
  · haveI : Nontrivial (R ⧸ comap (algebraMap R S) P) := Quotient.nontrivial hP_top
    rw [jacobson_eq_iff_jacobson_quotient_eq_bot]
    refine' eq_bot_of_comap_eq_bot hRS.quotient _
    

Proof state:
case neg
R : Type u_1
S : Type u_2
inst✝² : CommRing R
inst✝¹ : CommRing S
I : Ideal R
inst✝ : Algebra R S
hRS : Algebra.IsIntegral R S
hR : IsJacobson R
P : Ideal S
hP : IsPrime P
hP_top : ¬comap (algebraMap R S) P = ⊤
this : Nontrivial (R ⧸ comap (algebraMap R S) P)
⊢ comap (algebraMap (R ⧸ comap (algebraMap R S) P) (S ⧸ P)) (jacobson ⊥) = ⊥

Next tactic:
rw [eq_bot_iff, ← jacobson_eq_iff_jacobson_quotient_eq_bot.1
      ((isJacobson_iff_prime_eq.1 hR) (comap (algebraMap R S) P) (comap_isPrime _ _)),
      comap_jacobson]
theorem isJacobson_of_isIntegral [Algebra R S] (hRS : Algebra.IsIntegral R S) (hR : IsJacobson R) :
    IsJacobson S := by
  rw [isJacobson_iff_prime_eq]
  intro P hP
  by_cases hP_top : comap (algebraMap R S) P = ⊤
  · simp [comap_eq_top_iff.1 hP_top]
  · haveI : Nontrivial (R ⧸ comap (algebraMap R S) P) := Quotient.nontrivial hP_top
    rw [jacobson_eq_iff_jacobson_quotient_eq_bot]
    refine' eq_bot_of_comap_eq_bot hRS.quotient _
    rw [eq_bot_iff, ← jacobson_eq_iff_jacobson_quotient_eq_bot.1
      ((isJacobson_iff_prime_eq.1 hR) (comap (algebraMap R S) P) (comap_isPrime _ _)),
      comap_jacobson]
    

Proof state:
case neg
R : Type u_1
S : Type u_2
inst✝² : CommRing R
inst✝¹ : CommRing S
I : Ideal R
inst✝ : Algebra R S
hRS : Algebra.IsIntegral R S
hR : IsJacobson R
P : Ideal S
hP : IsPrime P
hP_top : ¬comap (algebraMap R S) P = ⊤
this : Nontrivial (R ⧸ comap (algebraMap R S) P)
⊢ sInf (comap (algebraMap (R ⧸ comap (algebraMap R S) P) (S ⧸ P)) '' {J | ⊥ ≤ J ∧ IsMaximal J}) ≤ jacobson ⊥

Next tactic:
refine' sInf_le_sInf fun J hJ => _
theorem isJacobson_of_isIntegral [Algebra R S] (hRS : Algebra.IsIntegral R S) (hR : IsJacobson R) :
    IsJacobson S := by
  rw [isJacobson_iff_prime_eq]
  intro P hP
  by_cases hP_top : comap (algebraMap R S) P = ⊤
  · simp [comap_eq_top_iff.1 hP_top]
  · haveI : Nontrivial (R ⧸ comap (algebraMap R S) P) := Quotient.nontrivial hP_top
    rw [jacobson_eq_iff_jacobson_quotient_eq_bot]
    refine' eq_bot_of_comap_eq_bot hRS.quotient _
    rw [eq_bot_iff, ← jacobson_eq_iff_jacobson_quotient_eq_bot.1
      ((isJacobson_iff_prime_eq.1 hR) (comap (algebraMap R S) P) (comap_isPrime _ _)),
      comap_jacobson]
    refine' sInf_le_sInf fun J hJ => _
    

Proof state:
case neg
R : Type u_1
S : Type u_2
inst✝² : CommRing R
inst✝¹ : CommRing S
I : Ideal R
inst✝ : Algebra R S
hRS : Algebra.IsIntegral R S
hR : IsJacobson R
P : Ideal S
hP : IsPrime P
hP_top : ¬comap (algebraMap R S) P = ⊤
this : Nontrivial (R ⧸ comap (algebraMap R S) P)
J : Ideal (R ⧸ comap (algebraMap R S) P)
hJ : J ∈ {J | ⊥ ≤ J ∧ IsMaximal J}
⊢ J ∈ comap (algebraMap (R ⧸ comap (algebraMap R S) P) (S ⧸ P)) '' {J | ⊥ ≤ J ∧ IsMaximal J}

Next tactic:
simp only [true_and_iff, Set.mem_image, bot_le, Set.mem_setOf_eq]
theorem isJacobson_of_isIntegral [Algebra R S] (hRS : Algebra.IsIntegral R S) (hR : IsJacobson R) :
    IsJacobson S := by
  rw [isJacobson_iff_prime_eq]
  intro P hP
  by_cases hP_top : comap (algebraMap R S) P = ⊤
  · simp [comap_eq_top_iff.1 hP_top]
  · haveI : Nontrivial (R ⧸ comap (algebraMap R S) P) := Quotient.nontrivial hP_top
    rw [jacobson_eq_iff_jacobson_quotient_eq_bot]
    refine' eq_bot_of_comap_eq_bot hRS.quotient _
    rw [eq_bot_iff, ← jacobson_eq_iff_jacobson_quotient_eq_bot.1
      ((isJacobson_iff_prime_eq.1 hR) (comap (algebraMap R S) P) (comap_isPrime _ _)),
      comap_jacobson]
    refine' sInf_le_sInf fun J hJ => _
    simp only [true_and_iff, Set.mem_image, bot_le, Set.mem_setOf_eq]
    

Proof state:
case neg
R : Type u_1
S : Type u_2
inst✝² : CommRing R
inst✝¹ : CommRing S
I : Ideal R
inst✝ : Algebra R S
hRS : Algebra.IsIntegral R S
hR : IsJacobson R
P : Ideal S
hP : IsPrime P
hP_top : ¬comap (algebraMap R S) P = ⊤
this : Nontrivial (R ⧸ comap (algebraMap R S) P)
J : Ideal (R ⧸ comap (algebraMap R S) P)
hJ : J ∈ {J | ⊥ ≤ J ∧ IsMaximal J}
⊢ ∃ x, IsMaximal x ∧ comap (algebraMap (R ⧸ comap (algebraMap R S) P) (S ⧸ P)) x = J

Next tactic:
have : J.IsMaximal := by simpa using hJ
theorem isJacobson_of_isIntegral [Algebra R S] (hRS : Algebra.IsIntegral R S) (hR : IsJacobson R) :
    IsJacobson S := by
  rw [isJacobson_iff_prime_eq]
  intro P hP
  by_cases hP_top : comap (algebraMap R S) P = ⊤
  · simp [comap_eq_top_iff.1 hP_top]
  · haveI : Nontrivial (R ⧸ comap (algebraMap R S) P) := Quotient.nontrivial hP_top
    rw [jacobson_eq_iff_jacobson_quotient_eq_bot]
    refine' eq_bot_of_comap_eq_bot hRS.quotient _
    rw [eq_bot_iff, ← jacobson_eq_iff_jacobson_quotient_eq_bot.1
      ((isJacobson_iff_prime_eq.1 hR) (comap (algebraMap R S) P) (comap_isPrime _ _)),
      comap_jacobson]
    refine' sInf_le_sInf fun J hJ => _
    simp only [true_and_iff, Set.mem_image, bot_le, Set.mem_setOf_eq]
    have : J.IsMaximal := by 

Proof state:
R : Type u_1
S : Type u_2
inst✝² : CommRing R
inst✝¹ : CommRing S
I : Ideal R
inst✝ : Algebra R S
hRS : Algebra.IsIntegral R S
hR : IsJacobson R
P : Ideal S
hP : IsPrime P
hP_top : ¬comap (algebraMap R S) P = ⊤
this : Nontrivial (R ⧸ comap (algebraMap R S) P)
J : Ideal (R ⧸ comap (algebraMap R S) P)
hJ : J ∈ {J | ⊥ ≤ J ∧ IsMaximal J}
⊢ IsMaximal J

Next tactic:
simpa using hJ
theorem isJacobson_of_isIntegral [Algebra R S] (hRS : Algebra.IsIntegral R S) (hR : IsJacobson R) :
    IsJacobson S := by
  rw [isJacobson_iff_prime_eq]
  intro P hP
  by_cases hP_top : comap (algebraMap R S) P = ⊤
  · simp [comap_eq_top_iff.1 hP_top]
  · haveI : Nontrivial (R ⧸ comap (algebraMap R S) P) := Quotient.nontrivial hP_top
    rw [jacobson_eq_iff_jacobson_quotient_eq_bot]
    refine' eq_bot_of_comap_eq_bot hRS.quotient _
    rw [eq_bot_iff, ← jacobson_eq_iff_jacobson_quotient_eq_bot.1
      ((isJacobson_iff_prime_eq.1 hR) (comap (algebraMap R S) P) (comap_isPrime _ _)),
      comap_jacobson]
    refine' sInf_le_sInf fun J hJ => _
    simp only [true_and_iff, Set.mem_image, bot_le, Set.mem_setOf_eq]
    have : J.IsMaximal := by simpa using hJ
    

Proof state:
case neg
R : Type u_1
S : Type u_2
inst✝² : CommRing R
inst✝¹ : CommRing S
I : Ideal R
inst✝ : Algebra R S
hRS : Algebra.IsIntegral R S
hR : IsJacobson R
P : Ideal S
hP : IsPrime P
hP_top : ¬comap (algebraMap R S) P = ⊤
this✝ : Nontrivial (R ⧸ comap (algebraMap R S) P)
J : Ideal (R ⧸ comap (algebraMap R S) P)
hJ : J ∈ {J | ⊥ ≤ J ∧ IsMaximal J}
this : IsMaximal J
⊢ ∃ x, IsMaximal x ∧ comap (algebraMap (R ⧸ comap (algebraMap R S) P) (S ⧸ P)) x = J

Next tactic:
exact exists_ideal_over_maximal_of_isIntegral hRS.quotient J
      (comap_bot_le_of_injective _ algebraMap_quotient_injective)
theorem disjoint_powers_iff_not_mem (hI : I.IsRadical) :
    Disjoint (Submonoid.powers y : Set R) ↑I ↔ y ∉ I.1 := by
  

Proof state:
R : Type u_1
S : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing S
I : Ideal R
y : R
inst✝¹ : Algebra R S
inst✝ : Away y S
hI : IsRadical I
⊢ Disjoint ↑(powers y) ↑I ↔ y ∉ I.toAddSubmonoid

Next tactic:
refine'
    ⟨fun h => Set.disjoint_left.1 h (mem_powers _), fun h => disjoint_iff.mpr (eq_bot_iff.mpr _)⟩
theorem disjoint_powers_iff_not_mem (hI : I.IsRadical) :
    Disjoint (Submonoid.powers y : Set R) ↑I ↔ y ∉ I.1 := by
  refine'
    ⟨fun h => Set.disjoint_left.1 h (mem_powers _), fun h => disjoint_iff.mpr (eq_bot_iff.mpr _)⟩
  

Proof state:
R : Type u_1
S : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing S
I : Ideal R
y : R
inst✝¹ : Algebra R S
inst✝ : Away y S
hI : IsRadical I
h : y ∉ I.toAddSubmonoid
⊢ ↑(powers y) ⊓ ↑I ≤ ⊥

Next tactic:
rintro x ⟨⟨n, rfl⟩, hx'⟩
theorem disjoint_powers_iff_not_mem (hI : I.IsRadical) :
    Disjoint (Submonoid.powers y : Set R) ↑I ↔ y ∉ I.1 := by
  refine'
    ⟨fun h => Set.disjoint_left.1 h (mem_powers _), fun h => disjoint_iff.mpr (eq_bot_iff.mpr _)⟩
  rintro x ⟨⟨n, rfl⟩, hx'⟩
  

Proof state:
case intro.intro
R : Type u_1
S : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing S
I : Ideal R
y : R
inst✝¹ : Algebra R S
inst✝ : Away y S
hI : IsRadical I
h : y ∉ I.toAddSubmonoid
n : ℕ
hx' : (fun x => y ^ x) n ∈ ↑I
⊢ (fun x => y ^ x) n ∈ ⊥

Next tactic:
exact h (hI <| mem_radical_of_pow_mem <| le_radical hx')
/-- If `R` is a Jacobson ring, then maximal ideals in the localization at `y`
correspond to maximal ideals in the original ring `R` that don't contain `y`.
This lemma gives the correspondence in the particular case of an ideal and its comap.
See `le_relIso_of_maximal` for the more general relation isomorphism -/
theorem isMaximal_iff_isMaximal_disjoint [H : IsJacobson R] (J : Ideal S) :
    J.IsMaximal ↔ (comap (algebraMap R S) J).IsMaximal ∧ y ∉ Ideal.comap (algebraMap R S) J := by
  

Proof state:
R : Type u_1
S : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing S
I : Ideal R
y : R
inst✝¹ : Algebra R S
inst✝ : Away y S
H : IsJacobson R
J : Ideal S
⊢ IsMaximal J ↔ IsMaximal (comap (algebraMap R S) J) ∧ y ∉ comap (algebraMap R S) J

Next tactic:
constructor
/-- If `R` is a Jacobson ring, then maximal ideals in the localization at `y`
correspond to maximal ideals in the original ring `R` that don't contain `y`.
This lemma gives the correspondence in the particular case of an ideal and its comap.
See `le_relIso_of_maximal` for the more general relation isomorphism -/
theorem isMaximal_iff_isMaximal_disjoint [H : IsJacobson R] (J : Ideal S) :
    J.IsMaximal ↔ (comap (algebraMap R S) J).IsMaximal ∧ y ∉ Ideal.comap (algebraMap R S) J := by
  constructor
  · 

Proof state:
case mp
R : Type u_1
S : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing S
I : Ideal R
y : R
inst✝¹ : Algebra R S
inst✝ : Away y S
H : IsJacobson R
J : Ideal S
⊢ IsMaximal J → IsMaximal (comap (algebraMap R S) J) ∧ y ∉ comap (algebraMap R S) J

Next tactic:
refine' fun h => ⟨_, fun hy =>
      h.ne_top (Ideal.eq_top_of_isUnit_mem _ hy (map_units _ ⟨y, Submonoid.mem_powers _⟩))⟩
/-- If `R` is a Jacobson ring, then maximal ideals in the localization at `y`
correspond to maximal ideals in the original ring `R` that don't contain `y`.
This lemma gives the correspondence in the particular case of an ideal and its comap.
See `le_relIso_of_maximal` for the more general relation isomorphism -/
theorem isMaximal_iff_isMaximal_disjoint [H : IsJacobson R] (J : Ideal S) :
    J.IsMaximal ↔ (comap (algebraMap R S) J).IsMaximal ∧ y ∉ Ideal.comap (algebraMap R S) J := by
  constructor
  · refine' fun h => ⟨_, fun hy =>
      h.ne_top (Ideal.eq_top_of_isUnit_mem _ hy (map_units _ ⟨y, Submonoid.mem_powers _⟩))⟩
    

Proof state:
case mp
R : Type u_1
S : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing S
I : Ideal R
y : R
inst✝¹ : Algebra R S
inst✝ : Away y S
H : IsJacobson R
J : Ideal S
h : IsMaximal J
⊢ IsMaximal (comap (algebraMap R S) J)

Next tactic:
have hJ : J.IsPrime := IsMaximal.isPrime h
/-- If `R` is a Jacobson ring, then maximal ideals in the localization at `y`
correspond to maximal ideals in the original ring `R` that don't contain `y`.
This lemma gives the correspondence in the particular case of an ideal and its comap.
See `le_relIso_of_maximal` for the more general relation isomorphism -/
theorem isMaximal_iff_isMaximal_disjoint [H : IsJacobson R] (J : Ideal S) :
    J.IsMaximal ↔ (comap (algebraMap R S) J).IsMaximal ∧ y ∉ Ideal.comap (algebraMap R S) J := by
  constructor
  · refine' fun h => ⟨_, fun hy =>
      h.ne_top (Ideal.eq_top_of_isUnit_mem _ hy (map_units _ ⟨y, Submonoid.mem_powers _⟩))⟩
    have hJ : J.IsPrime := IsMaximal.isPrime h
    

Proof state:
case mp
R : Type u_1
S : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing S
I : Ideal R
y : R
inst✝¹ : Algebra R S
inst✝ : Away y S
H : IsJacobson R
J : Ideal S
h : IsMaximal J
hJ : IsPrime J
⊢ IsMaximal (comap (algebraMap R S) J)

Next tactic:
rw [isPrime_iff_isPrime_disjoint (Submonoid.powers y)] at hJ
/-- If `R` is a Jacobson ring, then maximal ideals in the localization at `y`
correspond to maximal ideals in the original ring `R` that don't contain `y`.
This lemma gives the correspondence in the particular case of an ideal and its comap.
See `le_relIso_of_maximal` for the more general relation isomorphism -/
theorem isMaximal_iff_isMaximal_disjoint [H : IsJacobson R] (J : Ideal S) :
    J.IsMaximal ↔ (comap (algebraMap R S) J).IsMaximal ∧ y ∉ Ideal.comap (algebraMap R S) J := by
  constructor
  · refine' fun h => ⟨_, fun hy =>
      h.ne_top (Ideal.eq_top_of_isUnit_mem _ hy (map_units _ ⟨y, Submonoid.mem_powers _⟩))⟩
    have hJ : J.IsPrime := IsMaximal.isPrime h
    rw [isPrime_iff_isPrime_disjoint (Submonoid.powers y)] at hJ
    

Proof state:
case mp
R : Type u_1
S : Type u_2
inst✝³ : CommRing R
inst✝² : CommRing S
I : Ideal R
y : R
inst✝¹ : Algebra R S
inst✝ : Away y S
H : IsJacobson R
J : Ideal S
h : IsMaximal J
hJ : IsPrime (comap (algebraMap R S) J) ∧ Disjoint ↑(powers y) ↑(comap (algebraMap R S) J)
⊢ IsMaximal (comap (algebraMap R S) J)

Next tactic:
have : y ∉ (comap (algebraMap R S) J).1 := Set.disjoint_left.1 hJ.right (Submonoid.mem_powers _)