l3lab/ntp-mathlib huggingface dataset:
/-- 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
    have : y ∉ (comap (algebraMap R S) J).1 := Set.disjoint_left.1 hJ.right (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
hJ : IsPrime (comap (algebraMap R S) J) ∧ Disjoint ↑(powers y) ↑(comap (algebraMap R S) J)
this : y ∉ (comap (algebraMap R S) J).toAddSubmonoid
⊢ IsMaximal (comap (algebraMap R S) J)

Next tactic:
erw [← H.out hJ.left.isRadical, mem_sInf] at this
/-- 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
    have : y ∉ (comap (algebraMap R S) J).1 := Set.disjoint_left.1 hJ.right (Submonoid.mem_powers _)
    erw [← H.out hJ.left.isRadical, mem_sInf] at this
    

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)
this : ¬∀ ⦃I : Ideal R⦄, I ∈ {J_1 | comap (algebraMap R S) J ≤ J_1 ∧ IsMaximal J_1} → y ∈ I
⊢ IsMaximal (comap (algebraMap R S) J)

Next tactic:
push_neg at this
/-- 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
    have : y ∉ (comap (algebraMap R S) J).1 := Set.disjoint_left.1 hJ.right (Submonoid.mem_powers _)
    erw [← H.out hJ.left.isRadical, mem_sInf] at this
    push_neg at this
    

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)
this : ∃ I ∈ {J_1 | comap (algebraMap R S) J ≤ J_1 ∧ IsMaximal J_1}, y ∉ I
⊢ IsMaximal (comap (algebraMap R S) J)

Next tactic:
rcases this with ⟨I, hI, hI'⟩
/-- 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
    have : y ∉ (comap (algebraMap R S) J).1 := Set.disjoint_left.1 hJ.right (Submonoid.mem_powers _)
    erw [← H.out hJ.left.isRadical, mem_sInf] at this
    push_neg at this
    rcases this with ⟨I, hI, hI'⟩
    

Proof state:
case mp.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
H : IsJacobson R
J : Ideal S
h : IsMaximal J
hJ : IsPrime (comap (algebraMap R S) J) ∧ Disjoint ↑(powers y) ↑(comap (algebraMap R S) J)
I : Ideal R
hI : I ∈ {J_1 | comap (algebraMap R S) J ≤ J_1 ∧ IsMaximal J_1}
hI' : y ∉ I
⊢ IsMaximal (comap (algebraMap R S) J)

Next tactic:
convert hI.right
/-- 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
    have : y ∉ (comap (algebraMap R S) J).1 := Set.disjoint_left.1 hJ.right (Submonoid.mem_powers _)
    erw [← H.out hJ.left.isRadical, mem_sInf] at this
    push_neg at this
    rcases this with ⟨I, hI, hI'⟩
    convert hI.right
    

Proof state:
case h.e'_3.h
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)
I : Ideal R
hI : I ∈ {J_1 | comap (algebraMap R S) J ≤ J_1 ∧ IsMaximal J_1}
hI' : y ∉ I
e_2✝ : CommSemiring.toSemiring = Ring.toSemiring
⊢ comap (algebraMap R S) J = I

Next tactic:
by_cases hJ : J = map (algebraMap R S) I
/-- 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
    have : y ∉ (comap (algebraMap R S) J).1 := Set.disjoint_left.1 hJ.right (Submonoid.mem_powers _)
    erw [← H.out hJ.left.isRadical, mem_sInf] at this
    push_neg at this
    rcases this with ⟨I, hI, hI'⟩
    convert hI.right
    by_cases hJ : J = map (algebraMap R S) I
    · 

Proof state:
case pos
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)
I : Ideal R
hI : I ∈ {J_1 | comap (algebraMap R S) J ≤ J_1 ∧ IsMaximal J_1}
hI' : y ∉ I
e_2✝ : CommSemiring.toSemiring = Ring.toSemiring
hJ : J = map (algebraMap R S) I
⊢ comap (algebraMap R S) J = I

Next tactic:
rw [hJ, comap_map_of_isPrime_disjoint (powers y) S I (IsMaximal.isPrime hI.right)]
/-- 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
    have : y ∉ (comap (algebraMap R S) J).1 := Set.disjoint_left.1 hJ.right (Submonoid.mem_powers _)
    erw [← H.out hJ.left.isRadical, mem_sInf] at this
    push_neg at this
    rcases this with ⟨I, hI, hI'⟩
    convert hI.right
    by_cases hJ : J = map (algebraMap R S) I
    · rw [hJ, comap_map_of_isPrime_disjoint (powers y) S I (IsMaximal.isPrime hI.right)]
      

Proof state:
case pos
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)
I : Ideal R
hI : I ∈ {J_1 | comap (algebraMap R S) J ≤ J_1 ∧ IsMaximal J_1}
hI' : y ∉ I
e_2✝ : CommSemiring.toSemiring = Ring.toSemiring
hJ : J = map (algebraMap R S) I
⊢ Disjoint ↑(powers y) ↑I

Next tactic:
rwa [disjoint_powers_iff_not_mem y hI.right.isPrime.isRadical]
/-- 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
    have : y ∉ (comap (algebraMap R S) J).1 := Set.disjoint_left.1 hJ.right (Submonoid.mem_powers _)
    erw [← H.out hJ.left.isRadical, mem_sInf] at this
    push_neg at this
    rcases this with ⟨I, hI, hI'⟩
    convert hI.right
    by_cases hJ : J = map (algebraMap R S) I
    · rw [hJ, comap_map_of_isPrime_disjoint (powers y) S I (IsMaximal.isPrime hI.right)]
      rwa [disjoint_powers_iff_not_mem y hI.right.isPrime.isRadical]
    · 

Proof state:
case neg
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)
I : Ideal R
hI : I ∈ {J_1 | comap (algebraMap R S) J ≤ J_1 ∧ IsMaximal J_1}
hI' : y ∉ I
e_2✝ : CommSemiring.toSemiring = Ring.toSemiring
hJ : ¬J = map (algebraMap R S) I
⊢ comap (algebraMap R S) J = I

Next tactic:
have hI_p : (map (algebraMap R S) I).IsPrime := by
        refine' isPrime_of_isPrime_disjoint (powers y) _ I hI.right.isPrime _
        rwa [disjoint_powers_iff_not_mem y hI.right.isPrime.isRadical]
/-- 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
    have : y ∉ (comap (algebraMap R S) J).1 := Set.disjoint_left.1 hJ.right (Submonoid.mem_powers _)
    erw [← H.out hJ.left.isRadical, mem_sInf] at this
    push_neg at this
    rcases this with ⟨I, hI, hI'⟩
    convert hI.right
    by_cases hJ : J = map (algebraMap R S) I
    · rw [hJ, comap_map_of_isPrime_disjoint (powers y) S I (IsMaximal.isPrime hI.right)]
      rwa [disjoint_powers_iff_not_mem y hI.right.isPrime.isRadical]
    · have hI_p : (map (algebraMap R S) I).IsPrime := 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
h : IsMaximal J
hJ✝ : IsPrime (comap (algebraMap R S) J) ∧ Disjoint ↑(powers y) ↑(comap (algebraMap R S) J)
I : Ideal R
hI : I ∈ {J_1 | comap (algebraMap R S) J ≤ J_1 ∧ IsMaximal J_1}
hI' : y ∉ I
e_2✝ : CommSemiring.toSemiring = Ring.toSemiring
hJ : ¬J = map (algebraMap R S) I
⊢ IsPrime (map (algebraMap R S) I)

Next tactic:
refine' isPrime_of_isPrime_disjoint (powers y) _ I hI.right.isPrime _
/-- 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
    have : y ∉ (comap (algebraMap R S) J).1 := Set.disjoint_left.1 hJ.right (Submonoid.mem_powers _)
    erw [← H.out hJ.left.isRadical, mem_sInf] at this
    push_neg at this
    rcases this with ⟨I, hI, hI'⟩
    convert hI.right
    by_cases hJ : J = map (algebraMap R S) I
    · rw [hJ, comap_map_of_isPrime_disjoint (powers y) S I (IsMaximal.isPrime hI.right)]
      rwa [disjoint_powers_iff_not_mem y hI.right.isPrime.isRadical]
    · have hI_p : (map (algebraMap R S) I).IsPrime := by
        refine' isPrime_of_isPrime_disjoint (powers y) _ I hI.right.isPrime _
        

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
h : IsMaximal J
hJ✝ : IsPrime (comap (algebraMap R S) J) ∧ Disjoint ↑(powers y) ↑(comap (algebraMap R S) J)
I : Ideal R
hI : I ∈ {J_1 | comap (algebraMap R S) J ≤ J_1 ∧ IsMaximal J_1}
hI' : y ∉ I
e_2✝ : CommSemiring.toSemiring = Ring.toSemiring
hJ : ¬J = map (algebraMap R S) I
⊢ Disjoint ↑(powers y) ↑I

Next tactic:
rwa [disjoint_powers_iff_not_mem y hI.right.isPrime.isRadical]
/-- 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
    have : y ∉ (comap (algebraMap R S) J).1 := Set.disjoint_left.1 hJ.right (Submonoid.mem_powers _)
    erw [← H.out hJ.left.isRadical, mem_sInf] at this
    push_neg at this
    rcases this with ⟨I, hI, hI'⟩
    convert hI.right
    by_cases hJ : J = map (algebraMap R S) I
    · rw [hJ, comap_map_of_isPrime_disjoint (powers y) S I (IsMaximal.isPrime hI.right)]
      rwa [disjoint_powers_iff_not_mem y hI.right.isPrime.isRadical]
    · have hI_p : (map (algebraMap R S) I).IsPrime := by
        refine' isPrime_of_isPrime_disjoint (powers y) _ I hI.right.isPrime _
        rwa [disjoint_powers_iff_not_mem y hI.right.isPrime.isRadical]
      

Proof state:
case neg
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)
I : Ideal R
hI : I ∈ {J_1 | comap (algebraMap R S) J ≤ J_1 ∧ IsMaximal J_1}
hI' : y ∉ I
e_2✝ : CommSemiring.toSemiring = Ring.toSemiring
hJ : ¬J = map (algebraMap R S) I
hI_p : IsPrime (map (algebraMap R S) I)
⊢ comap (algebraMap R S) J = I

Next tactic:
have : J ≤ map (algebraMap R S) I := map_comap (Submonoid.powers y) S J ▸ map_mono hI.left
/-- 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
    have : y ∉ (comap (algebraMap R S) J).1 := Set.disjoint_left.1 hJ.right (Submonoid.mem_powers _)
    erw [← H.out hJ.left.isRadical, mem_sInf] at this
    push_neg at this
    rcases this with ⟨I, hI, hI'⟩
    convert hI.right
    by_cases hJ : J = map (algebraMap R S) I
    · rw [hJ, comap_map_of_isPrime_disjoint (powers y) S I (IsMaximal.isPrime hI.right)]
      rwa [disjoint_powers_iff_not_mem y hI.right.isPrime.isRadical]
    · have hI_p : (map (algebraMap R S) I).IsPrime := by
        refine' isPrime_of_isPrime_disjoint (powers y) _ I hI.right.isPrime _
        rwa [disjoint_powers_iff_not_mem y hI.right.isPrime.isRadical]
      have : J ≤ map (algebraMap R S) I := map_comap (Submonoid.powers y) S J ▸ map_mono hI.left
      

Proof state:
case neg
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)
I : Ideal R
hI : I ∈ {J_1 | comap (algebraMap R S) J ≤ J_1 ∧ IsMaximal J_1}
hI' : y ∉ I
e_2✝ : CommSemiring.toSemiring = Ring.toSemiring
hJ : ¬J = map (algebraMap R S) I
hI_p : IsPrime (map (algebraMap R S) I)
this : J ≤ map (algebraMap R S) I
⊢ comap (algebraMap R S) J = I

Next tactic:
exact absurd (h.1.2 _ (lt_of_le_of_ne this hJ)) hI_p.1
/-- 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
    have : y ∉ (comap (algebraMap R S) J).1 := Set.disjoint_left.1 hJ.right (Submonoid.mem_powers _)
    erw [← H.out hJ.left.isRadical, mem_sInf] at this
    push_neg at this
    rcases this with ⟨I, hI, hI'⟩
    convert hI.right
    by_cases hJ : J = map (algebraMap R S) I
    · rw [hJ, comap_map_of_isPrime_disjoint (powers y) S I (IsMaximal.isPrime hI.right)]
      rwa [disjoint_powers_iff_not_mem y hI.right.isPrime.isRadical]
    · have hI_p : (map (algebraMap R S) I).IsPrime := by
        refine' isPrime_of_isPrime_disjoint (powers y) _ I hI.right.isPrime _
        rwa [disjoint_powers_iff_not_mem y hI.right.isPrime.isRadical]
      have : J ≤ map (algebraMap R S) I := map_comap (Submonoid.powers y) S J ▸ map_mono hI.left
      exact absurd (h.1.2 _ (lt_of_le_of_ne this hJ)) hI_p.1
  · 

Proof state:
case mpr
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 (comap (algebraMap R S) J) ∧ y ∉ comap (algebraMap R S) J → IsMaximal J

Next tactic:
refine' fun h => ⟨⟨fun hJ => h.1.ne_top (eq_top_iff.2 _), fun I hI => _⟩⟩
/-- 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
    have : y ∉ (comap (algebraMap R S) J).1 := Set.disjoint_left.1 hJ.right (Submonoid.mem_powers _)
    erw [← H.out hJ.left.isRadical, mem_sInf] at this
    push_neg at this
    rcases this with ⟨I, hI, hI'⟩
    convert hI.right
    by_cases hJ : J = map (algebraMap R S) I
    · rw [hJ, comap_map_of_isPrime_disjoint (powers y) S I (IsMaximal.isPrime hI.right)]
      rwa [disjoint_powers_iff_not_mem y hI.right.isPrime.isRadical]
    · have hI_p : (map (algebraMap R S) I).IsPrime := by
        refine' isPrime_of_isPrime_disjoint (powers y) _ I hI.right.isPrime _
        rwa [disjoint_powers_iff_not_mem y hI.right.isPrime.isRadical]
      have : J ≤ map (algebraMap R S) I := map_comap (Submonoid.powers y) S J ▸ map_mono hI.left
      exact absurd (h.1.2 _ (lt_of_le_of_ne this hJ)) hI_p.1
  · refine' fun h => ⟨⟨fun hJ => h.1.ne_top (eq_top_iff.2 _), fun I hI => _⟩⟩
    · 

Proof state:
case mpr.refine'_1
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 (comap (algebraMap R S) J) ∧ y ∉ comap (algebraMap R S) J
hJ : J = ⊤
⊢ ⊤ ≤ comap (algebraMap R S) J

Next tactic:
rwa [eq_top_iff, ← (IsLocalization.orderEmbedding (powers y) S).le_iff_le] at hJ