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 _)
    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 => _⟩⟩
    · rwa [eq_top_iff, ← (IsLocalization.orderEmbedding (powers y) S).le_iff_le] at hJ
    · 

Proof state:
case mpr.refine'_2
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
I : Ideal S
hI : J < I
⊢ I = ⊤

Next tactic:
have := congr_arg (map (algebraMap R S)) (h.1.1.2 _ ⟨comap_mono (le_of_lt 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 => _⟩⟩
    · rwa [eq_top_iff, ← (IsLocalization.orderEmbedding (powers y) S).le_iff_le] at hJ
    · have := congr_arg (map (algebraMap R S)) (h.1.1.2 _ ⟨comap_mono (le_of_lt hI), ?_⟩)
      

Proof state:
case mpr.refine'_2.refine_2
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
I : Ideal S
hI : J < I
this : map (algebraMap R S) (comap (algebraMap R S) I) = map (algebraMap R S) ⊤
⊢ I = ⊤
case mpr.refine'_2.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
I : Ideal S
hI : J < I
⊢ ¬↑(comap (algebraMap R S) I) ⊆ ↑(comap (algebraMap R S) J)

Next tactic:
rwa [map_comap (powers y) S I, map_top] 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
    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 => _⟩⟩
    · rwa [eq_top_iff, ← (IsLocalization.orderEmbedding (powers y) S).le_iff_le] at hJ
    · have := congr_arg (map (algebraMap R S)) (h.1.1.2 _ ⟨comap_mono (le_of_lt hI), ?_⟩)
      rwa [map_comap (powers y) S I, map_top] at this
      

Proof state:
case mpr.refine'_2.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
I : Ideal S
hI : J < I
⊢ ¬↑(comap (algebraMap R S) I) ⊆ ↑(comap (algebraMap R S) J)

Next tactic:
refine' fun hI' => 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)]
      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 => _⟩⟩
    · rwa [eq_top_iff, ← (IsLocalization.orderEmbedding (powers y) S).le_iff_le] at hJ
    · have := congr_arg (map (algebraMap R S)) (h.1.1.2 _ ⟨comap_mono (le_of_lt hI), ?_⟩)
      rwa [map_comap (powers y) S I, map_top] at this
      refine' fun hI' => hI.right _
      

Proof state:
case mpr.refine'_2.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
I : Ideal S
hI : J < I
hI' : ↑(comap (algebraMap R S) I) ⊆ ↑(comap (algebraMap R S) J)
⊢ ↑I ⊆ ↑J

Next tactic:
rw [← map_comap (powers y) S I, ← map_comap (powers y) S J]
/-- 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 => _⟩⟩
    · rwa [eq_top_iff, ← (IsLocalization.orderEmbedding (powers y) S).le_iff_le] at hJ
    · have := congr_arg (map (algebraMap R S)) (h.1.1.2 _ ⟨comap_mono (le_of_lt hI), ?_⟩)
      rwa [map_comap (powers y) S I, map_top] at this
      refine' fun hI' => hI.right _
      rw [← map_comap (powers y) S I, ← map_comap (powers y) S J]
      

Proof state:
case mpr.refine'_2.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
I : Ideal S
hI : J < I
hI' : ↑(comap (algebraMap R S) I) ⊆ ↑(comap (algebraMap R S) J)
⊢ ↑(map (algebraMap R S) (comap (algebraMap R S) I)) ⊆ ↑(map (algebraMap R S) (comap (algebraMap R S) J))

Next tactic:
exact map_mono 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 map.
See `le_relIso_of_maximal` for the more general statement, and the reverse of this implication -/
theorem isMaximal_of_isMaximal_disjoint [IsJacobson R] (I : Ideal R) (hI : I.IsMaximal)
    (hy : y ∉ I) : (map (algebraMap R S) I).IsMaximal := 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
inst✝ : IsJacobson R
I : Ideal R
hI : IsMaximal I
hy : y ∉ I
⊢ IsMaximal (map (algebraMap R S) I)

Next tactic:
rw [isMaximal_iff_isMaximal_disjoint S y,
    comap_map_of_isPrime_disjoint (powers y) S I (IsMaximal.isPrime hI)
      ((disjoint_powers_iff_not_mem y hI.isPrime.isRadical).2 hy)]
/-- 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 map.
See `le_relIso_of_maximal` for the more general statement, and the reverse of this implication -/
theorem isMaximal_of_isMaximal_disjoint [IsJacobson R] (I : Ideal R) (hI : I.IsMaximal)
    (hy : y ∉ I) : (map (algebraMap R S) I).IsMaximal := by
  rw [isMaximal_iff_isMaximal_disjoint S y,
    comap_map_of_isPrime_disjoint (powers y) S I (IsMaximal.isPrime hI)
      ((disjoint_powers_iff_not_mem y hI.isPrime.isRadical).2 hy)]
  

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
inst✝ : IsJacobson R
I : Ideal R
hI : IsMaximal I
hy : y ∉ I
⊢ IsMaximal I ∧ y ∉ I

Next tactic:
exact ⟨hI, hy⟩
/-- If `S` is the localization of the Jacobson ring `R` at the submonoid generated by `y : R`, then
`S` is Jacobson. -/
theorem isJacobson_localization [H : IsJacobson R] : IsJacobson S := 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
⊢ IsJacobson S

Next tactic:
rw [isJacobson_iff_prime_eq]
/-- If `S` is the localization of the Jacobson ring `R` at the submonoid generated by `y : R`, then
`S` is Jacobson. -/
theorem isJacobson_localization [H : 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
y : R
inst✝¹ : Algebra R S
inst✝ : Away y S
H : IsJacobson R
⊢ ∀ (P : Ideal S), IsPrime P → jacobson P = P

Next tactic:
refine' fun P' hP' => le_antisymm _ le_jacobson
/-- If `S` is the localization of the Jacobson ring `R` at the submonoid generated by `y : R`, then
`S` is Jacobson. -/
theorem isJacobson_localization [H : IsJacobson R] : IsJacobson S := by
  rw [isJacobson_iff_prime_eq]
  refine' fun P' hP' => le_antisymm _ le_jacobson
  

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
P' : Ideal S
hP' : IsPrime P'
⊢ jacobson P' ≤ P'

Next tactic:
obtain ⟨hP', hPM⟩ := (IsLocalization.isPrime_iff_isPrime_disjoint (powers y) S P').mp hP'
/-- If `S` is the localization of the Jacobson ring `R` at the submonoid generated by `y : R`, then
`S` is Jacobson. -/
theorem isJacobson_localization [H : IsJacobson R] : IsJacobson S := by
  rw [isJacobson_iff_prime_eq]
  refine' fun P' hP' => le_antisymm _ le_jacobson
  obtain ⟨hP', hPM⟩ := (IsLocalization.isPrime_iff_isPrime_disjoint (powers y) S P').mp hP'
  

Proof state:
case 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
P' : Ideal S
hP'✝ : IsPrime P'
hP' : IsPrime (comap (algebraMap R S) P')
hPM : Disjoint ↑(powers y) ↑(comap (algebraMap R S) P')
⊢ jacobson P' ≤ P'

Next tactic:
have hP := H.out hP'.isRadical
/-- If `S` is the localization of the Jacobson ring `R` at the submonoid generated by `y : R`, then
`S` is Jacobson. -/
theorem isJacobson_localization [H : IsJacobson R] : IsJacobson S := by
  rw [isJacobson_iff_prime_eq]
  refine' fun P' hP' => le_antisymm _ le_jacobson
  obtain ⟨hP', hPM⟩ := (IsLocalization.isPrime_iff_isPrime_disjoint (powers y) S P').mp hP'
  have hP := H.out hP'.isRadical
  

Proof state:
case 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
P' : Ideal S
hP'✝ : IsPrime P'
hP' : IsPrime (comap (algebraMap R S) P')
hPM : Disjoint ↑(powers y) ↑(comap (algebraMap R S) P')
hP : jacobson (comap (algebraMap R S) P') = comap (algebraMap R S) P'
⊢ jacobson P' ≤ P'

Next tactic:
refine' (IsLocalization.map_comap (powers y) S P'.jacobson).ge.trans
    ((map_mono _).trans (IsLocalization.map_comap (powers y) S P').le)
/-- If `S` is the localization of the Jacobson ring `R` at the submonoid generated by `y : R`, then
`S` is Jacobson. -/
theorem isJacobson_localization [H : IsJacobson R] : IsJacobson S := by
  rw [isJacobson_iff_prime_eq]
  refine' fun P' hP' => le_antisymm _ le_jacobson
  obtain ⟨hP', hPM⟩ := (IsLocalization.isPrime_iff_isPrime_disjoint (powers y) S P').mp hP'
  have hP := H.out hP'.isRadical
  refine' (IsLocalization.map_comap (powers y) S P'.jacobson).ge.trans
    ((map_mono _).trans (IsLocalization.map_comap (powers y) S P').le)
  

Proof state:
case 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
P' : Ideal S
hP'✝ : IsPrime P'
hP' : IsPrime (comap (algebraMap R S) P')
hPM : Disjoint ↑(powers y) ↑(comap (algebraMap R S) P')
hP : jacobson (comap (algebraMap R S) P') = comap (algebraMap R S) P'
⊢ comap (algebraMap R S) (jacobson P') ≤ comap (algebraMap R S) P'

Next tactic:
have : sInf { I : Ideal R | comap (algebraMap R S) P' ≤ I ∧ I.IsMaximal ∧ y ∉ I } ≤
      comap (algebraMap R S) P' := by
    intro x hx
    have hxy : x * y ∈ (comap (algebraMap R S) P').jacobson := by
      rw [Ideal.jacobson, mem_sInf]
      intro J hJ
      by_cases h : y ∈ J
      · exact J.mul_mem_left x h
      · exact J.mul_mem_right y ((mem_sInf.1 hx) ⟨hJ.left, ⟨hJ.right, h⟩⟩)
    rw [hP] at hxy
    cases' hP'.mem_or_mem hxy with hxy hxy
    · exact hxy
    · exact (hPM.le_bot ⟨Submonoid.mem_powers _, hxy⟩).elim
/-- If `S` is the localization of the Jacobson ring `R` at the submonoid generated by `y : R`, then
`S` is Jacobson. -/
theorem isJacobson_localization [H : IsJacobson R] : IsJacobson S := by
  rw [isJacobson_iff_prime_eq]
  refine' fun P' hP' => le_antisymm _ le_jacobson
  obtain ⟨hP', hPM⟩ := (IsLocalization.isPrime_iff_isPrime_disjoint (powers y) S P').mp hP'
  have hP := H.out hP'.isRadical
  refine' (IsLocalization.map_comap (powers y) S P'.jacobson).ge.trans
    ((map_mono _).trans (IsLocalization.map_comap (powers y) S P').le)
  have : sInf { I : Ideal R | comap (algebraMap R S) P' ≤ I ∧ I.IsMaximal ∧ y ∉ I } ≤
      comap (algebraMap R S) P' := 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
P' : Ideal S
hP'✝ : IsPrime P'
hP' : IsPrime (comap (algebraMap R S) P')
hPM : Disjoint ↑(powers y) ↑(comap (algebraMap R S) P')
hP : jacobson (comap (algebraMap R S) P') = comap (algebraMap R S) P'
⊢ sInf {I | comap (algebraMap R S) P' ≤ I ∧ IsMaximal I ∧ y ∉ I} ≤ comap (algebraMap R S) P'

Next tactic:
intro x hx
/-- If `S` is the localization of the Jacobson ring `R` at the submonoid generated by `y : R`, then
`S` is Jacobson. -/
theorem isJacobson_localization [H : IsJacobson R] : IsJacobson S := by
  rw [isJacobson_iff_prime_eq]
  refine' fun P' hP' => le_antisymm _ le_jacobson
  obtain ⟨hP', hPM⟩ := (IsLocalization.isPrime_iff_isPrime_disjoint (powers y) S P').mp hP'
  have hP := H.out hP'.isRadical
  refine' (IsLocalization.map_comap (powers y) S P'.jacobson).ge.trans
    ((map_mono _).trans (IsLocalization.map_comap (powers y) S P').le)
  have : sInf { I : Ideal R | comap (algebraMap R S) P' ≤ I ∧ I.IsMaximal ∧ y ∉ I } ≤
      comap (algebraMap R S) P' := by
    intro x hx
    

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
P' : Ideal S
hP'✝ : IsPrime P'
hP' : IsPrime (comap (algebraMap R S) P')
hPM : Disjoint ↑(powers y) ↑(comap (algebraMap R S) P')
hP : jacobson (comap (algebraMap R S) P') = comap (algebraMap R S) P'
x : R
hx : x ∈ sInf {I | comap (algebraMap R S) P' ≤ I ∧ IsMaximal I ∧ y ∉ I}
⊢ x ∈ comap (algebraMap R S) P'

Next tactic:
have hxy : x * y ∈ (comap (algebraMap R S) P').jacobson := by
      rw [Ideal.jacobson, mem_sInf]
      intro J hJ
      by_cases h : y ∈ J
      · exact J.mul_mem_left x h
      · exact J.mul_mem_right y ((mem_sInf.1 hx) ⟨hJ.left, ⟨hJ.right, h⟩⟩)
/-- If `S` is the localization of the Jacobson ring `R` at the submonoid generated by `y : R`, then
`S` is Jacobson. -/
theorem isJacobson_localization [H : IsJacobson R] : IsJacobson S := by
  rw [isJacobson_iff_prime_eq]
  refine' fun P' hP' => le_antisymm _ le_jacobson
  obtain ⟨hP', hPM⟩ := (IsLocalization.isPrime_iff_isPrime_disjoint (powers y) S P').mp hP'
  have hP := H.out hP'.isRadical
  refine' (IsLocalization.map_comap (powers y) S P'.jacobson).ge.trans
    ((map_mono _).trans (IsLocalization.map_comap (powers y) S P').le)
  have : sInf { I : Ideal R | comap (algebraMap R S) P' ≤ I ∧ I.IsMaximal ∧ y ∉ I } ≤
      comap (algebraMap R S) P' := by
    intro x hx
    have hxy : x * y ∈ (comap (algebraMap R S) P').jacobson := 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
P' : Ideal S
hP'✝ : IsPrime P'
hP' : IsPrime (comap (algebraMap R S) P')
hPM : Disjoint ↑(powers y) ↑(comap (algebraMap R S) P')
hP : jacobson (comap (algebraMap R S) P') = comap (algebraMap R S) P'
x : R
hx : x ∈ sInf {I | comap (algebraMap R S) P' ≤ I ∧ IsMaximal I ∧ y ∉ I}
⊢ x * y ∈ jacobson (comap (algebraMap R S) P')

Next tactic:
rw [Ideal.jacobson, mem_sInf]
/-- If `S` is the localization of the Jacobson ring `R` at the submonoid generated by `y : R`, then
`S` is Jacobson. -/
theorem isJacobson_localization [H : IsJacobson R] : IsJacobson S := by
  rw [isJacobson_iff_prime_eq]
  refine' fun P' hP' => le_antisymm _ le_jacobson
  obtain ⟨hP', hPM⟩ := (IsLocalization.isPrime_iff_isPrime_disjoint (powers y) S P').mp hP'
  have hP := H.out hP'.isRadical
  refine' (IsLocalization.map_comap (powers y) S P'.jacobson).ge.trans
    ((map_mono _).trans (IsLocalization.map_comap (powers y) S P').le)
  have : sInf { I : Ideal R | comap (algebraMap R S) P' ≤ I ∧ I.IsMaximal ∧ y ∉ I } ≤
      comap (algebraMap R S) P' := by
    intro x hx
    have hxy : x * y ∈ (comap (algebraMap R S) P').jacobson := by
      rw [Ideal.jacobson, mem_sInf]
      

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
P' : Ideal S
hP'✝ : IsPrime P'
hP' : IsPrime (comap (algebraMap R S) P')
hPM : Disjoint ↑(powers y) ↑(comap (algebraMap R S) P')
hP : jacobson (comap (algebraMap R S) P') = comap (algebraMap R S) P'
x : R
hx : x ∈ sInf {I | comap (algebraMap R S) P' ≤ I ∧ IsMaximal I ∧ y ∉ I}
⊢ ∀ ⦃I : Ideal R⦄, I ∈ {J | comap (algebraMap R S) P' ≤ J ∧ IsMaximal J} → x * y ∈ I

Next tactic:
intro J hJ