l3lab/ntp-mathlib huggingface dataset:
/-- If `f : R → S` descends to an integral map in the localization at `x`,
  and `R` is a Jacobson ring, then the intersection of all maximal ideals in `S` is trivial -/
theorem jacobson_bot_of_integral_localization {R : Type*} [CommRing R] [IsDomain R] [IsJacobson R]
    (Rₘ Sₘ : Type*) [CommRing Rₘ] [CommRing Sₘ] (φ : R →+* S) (hφ : Function.Injective ↑φ) (x : R)
    (hx : x ≠ 0) [Algebra R Rₘ] [IsLocalization.Away x Rₘ] [Algebra S Sₘ]
    [IsLocalization ((Submonoid.powers x).map φ : Submonoid S) Sₘ]
    (hφ' :
      RingHom.IsIntegral (IsLocalization.map Sₘ φ (Submonoid.powers x).le_comap_map : Rₘ →+* Sₘ)) :
    (⊥ : Ideal S).jacobson = (⊥ : Ideal S) := by
  have hM : ((Submonoid.powers x).map φ : Submonoid S) ≤ nonZeroDivisors S :=
    map_le_nonZeroDivisors_of_injective φ hφ (powers_le_nonZeroDivisors_of_noZeroDivisors hx)
  letI : IsDomain Sₘ := IsLocalization.isDomain_of_le_nonZeroDivisors _ hM
  let φ' : Rₘ →+* Sₘ := IsLocalization.map _ φ (Submonoid.powers x).le_comap_map
  suffices ∀ I : Ideal Sₘ, I.IsMaximal → (I.comap (algebraMap S Sₘ)).IsMaximal by
    have hϕ' : comap (algebraMap S Sₘ) (⊥ : Ideal Sₘ) = (⊥ : Ideal S) := by
      rw [← RingHom.ker_eq_comap_bot, ← RingHom.injective_iff_ker_eq_bot]
      exact IsLocalization.injective Sₘ hM
    have hSₘ : IsJacobson Sₘ := isJacobson_of_isIntegral' φ' hφ' (isJacobson_localization x)
    refine' eq_bot_iff.mpr (le_trans _ (le_of_eq hϕ'))
    

Proof state:
R✝ : Type u_1
S : Type u_2
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing S
inst✝¹¹ : IsDomain S
Rₘ✝ : Type u_3
Sₘ✝ : Type u_4
inst✝¹⁰ : CommRing Rₘ✝
inst✝⁹ : CommRing Sₘ✝
R : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : IsDomain R
inst✝⁶ : IsJacobson R
Rₘ : Type u_6
Sₘ : Type u_7
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
φ : R →+* S
hφ : Function.Injective ⇑φ
x : R
hx : x ≠ 0
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization.Away x Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Submonoid.map φ (Submonoid.powers x)) Sₘ
hφ' :
  RingHom.IsIntegral
    (IsLocalization.map Sₘ φ (_ : Submonoid.powers x ≤ Submonoid.comap φ (Submonoid.map φ (Submonoid.powers x))))
hM : Submonoid.map φ (Submonoid.powers x) ≤ nonZeroDivisors S
this✝ : IsDomain Sₘ := IsLocalization.isDomain_of_le_nonZeroDivisors S hM
φ' : Rₘ →+* Sₘ :=
  IsLocalization.map Sₘ φ (_ : Submonoid.powers x ≤ Submonoid.comap φ (Submonoid.map φ (Submonoid.powers x)))
this : ∀ (I : Ideal Sₘ), IsMaximal I → IsMaximal (comap (algebraMap S Sₘ) I)
hϕ' : comap (algebraMap S Sₘ) ⊥ = ⊥
hSₘ : IsJacobson Sₘ
⊢ jacobson ⊥ ≤ comap (algebraMap S Sₘ) ⊥

Next tactic:
rw [← hSₘ.out isRadical_bot_of_noZeroDivisors, comap_jacobson]
/-- If `f : R → S` descends to an integral map in the localization at `x`,
  and `R` is a Jacobson ring, then the intersection of all maximal ideals in `S` is trivial -/
theorem jacobson_bot_of_integral_localization {R : Type*} [CommRing R] [IsDomain R] [IsJacobson R]
    (Rₘ Sₘ : Type*) [CommRing Rₘ] [CommRing Sₘ] (φ : R →+* S) (hφ : Function.Injective ↑φ) (x : R)
    (hx : x ≠ 0) [Algebra R Rₘ] [IsLocalization.Away x Rₘ] [Algebra S Sₘ]
    [IsLocalization ((Submonoid.powers x).map φ : Submonoid S) Sₘ]
    (hφ' :
      RingHom.IsIntegral (IsLocalization.map Sₘ φ (Submonoid.powers x).le_comap_map : Rₘ →+* Sₘ)) :
    (⊥ : Ideal S).jacobson = (⊥ : Ideal S) := by
  have hM : ((Submonoid.powers x).map φ : Submonoid S) ≤ nonZeroDivisors S :=
    map_le_nonZeroDivisors_of_injective φ hφ (powers_le_nonZeroDivisors_of_noZeroDivisors hx)
  letI : IsDomain Sₘ := IsLocalization.isDomain_of_le_nonZeroDivisors _ hM
  let φ' : Rₘ →+* Sₘ := IsLocalization.map _ φ (Submonoid.powers x).le_comap_map
  suffices ∀ I : Ideal Sₘ, I.IsMaximal → (I.comap (algebraMap S Sₘ)).IsMaximal by
    have hϕ' : comap (algebraMap S Sₘ) (⊥ : Ideal Sₘ) = (⊥ : Ideal S) := by
      rw [← RingHom.ker_eq_comap_bot, ← RingHom.injective_iff_ker_eq_bot]
      exact IsLocalization.injective Sₘ hM
    have hSₘ : IsJacobson Sₘ := isJacobson_of_isIntegral' φ' hφ' (isJacobson_localization x)
    refine' eq_bot_iff.mpr (le_trans _ (le_of_eq hϕ'))
    rw [← hSₘ.out isRadical_bot_of_noZeroDivisors, comap_jacobson]
    

Proof state:
R✝ : Type u_1
S : Type u_2
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing S
inst✝¹¹ : IsDomain S
Rₘ✝ : Type u_3
Sₘ✝ : Type u_4
inst✝¹⁰ : CommRing Rₘ✝
inst✝⁹ : CommRing Sₘ✝
R : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : IsDomain R
inst✝⁶ : IsJacobson R
Rₘ : Type u_6
Sₘ : Type u_7
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
φ : R →+* S
hφ : Function.Injective ⇑φ
x : R
hx : x ≠ 0
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization.Away x Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Submonoid.map φ (Submonoid.powers x)) Sₘ
hφ' :
  RingHom.IsIntegral
    (IsLocalization.map Sₘ φ (_ : Submonoid.powers x ≤ Submonoid.comap φ (Submonoid.map φ (Submonoid.powers x))))
hM : Submonoid.map φ (Submonoid.powers x) ≤ nonZeroDivisors S
this✝ : IsDomain Sₘ := IsLocalization.isDomain_of_le_nonZeroDivisors S hM
φ' : Rₘ →+* Sₘ :=
  IsLocalization.map Sₘ φ (_ : Submonoid.powers x ≤ Submonoid.comap φ (Submonoid.map φ (Submonoid.powers x)))
this : ∀ (I : Ideal Sₘ), IsMaximal I → IsMaximal (comap (algebraMap S Sₘ) I)
hϕ' : comap (algebraMap S Sₘ) ⊥ = ⊥
hSₘ : IsJacobson Sₘ
⊢ jacobson ⊥ ≤ sInf (comap (algebraMap S Sₘ) '' {J | ⊥ ≤ J ∧ IsMaximal J})

Next tactic:
exact sInf_le_sInf fun j hj => ⟨bot_le,
      let ⟨J, hJ⟩ := hj
      hJ.2 ▸ this J hJ.1.2⟩
/-- If `f : R → S` descends to an integral map in the localization at `x`,
  and `R` is a Jacobson ring, then the intersection of all maximal ideals in `S` is trivial -/
theorem jacobson_bot_of_integral_localization {R : Type*} [CommRing R] [IsDomain R] [IsJacobson R]
    (Rₘ Sₘ : Type*) [CommRing Rₘ] [CommRing Sₘ] (φ : R →+* S) (hφ : Function.Injective ↑φ) (x : R)
    (hx : x ≠ 0) [Algebra R Rₘ] [IsLocalization.Away x Rₘ] [Algebra S Sₘ]
    [IsLocalization ((Submonoid.powers x).map φ : Submonoid S) Sₘ]
    (hφ' :
      RingHom.IsIntegral (IsLocalization.map Sₘ φ (Submonoid.powers x).le_comap_map : Rₘ →+* Sₘ)) :
    (⊥ : Ideal S).jacobson = (⊥ : Ideal S) := by
  have hM : ((Submonoid.powers x).map φ : Submonoid S) ≤ nonZeroDivisors S :=
    map_le_nonZeroDivisors_of_injective φ hφ (powers_le_nonZeroDivisors_of_noZeroDivisors hx)
  letI : IsDomain Sₘ := IsLocalization.isDomain_of_le_nonZeroDivisors _ hM
  let φ' : Rₘ →+* Sₘ := IsLocalization.map _ φ (Submonoid.powers x).le_comap_map
  suffices ∀ I : Ideal Sₘ, I.IsMaximal → (I.comap (algebraMap S Sₘ)).IsMaximal by
    have hϕ' : comap (algebraMap S Sₘ) (⊥ : Ideal Sₘ) = (⊥ : Ideal S) := by
      rw [← RingHom.ker_eq_comap_bot, ← RingHom.injective_iff_ker_eq_bot]
      exact IsLocalization.injective Sₘ hM
    have hSₘ : IsJacobson Sₘ := isJacobson_of_isIntegral' φ' hφ' (isJacobson_localization x)
    refine' eq_bot_iff.mpr (le_trans _ (le_of_eq hϕ'))
    rw [← hSₘ.out isRadical_bot_of_noZeroDivisors, comap_jacobson]
    exact sInf_le_sInf fun j hj => ⟨bot_le,
      let ⟨J, hJ⟩ := hj
      hJ.2 ▸ this J hJ.1.2⟩
  

Proof state:
R✝ : Type u_1
S : Type u_2
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing S
inst✝¹¹ : IsDomain S
Rₘ✝ : Type u_3
Sₘ✝ : Type u_4
inst✝¹⁰ : CommRing Rₘ✝
inst✝⁹ : CommRing Sₘ✝
R : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : IsDomain R
inst✝⁶ : IsJacobson R
Rₘ : Type u_6
Sₘ : Type u_7
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
φ : R →+* S
hφ : Function.Injective ⇑φ
x : R
hx : x ≠ 0
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization.Away x Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Submonoid.map φ (Submonoid.powers x)) Sₘ
hφ' :
  RingHom.IsIntegral
    (IsLocalization.map Sₘ φ (_ : Submonoid.powers x ≤ Submonoid.comap φ (Submonoid.map φ (Submonoid.powers x))))
hM : Submonoid.map φ (Submonoid.powers x) ≤ nonZeroDivisors S
this : IsDomain Sₘ := IsLocalization.isDomain_of_le_nonZeroDivisors S hM
φ' : Rₘ →+* Sₘ :=
  IsLocalization.map Sₘ φ (_ : Submonoid.powers x ≤ Submonoid.comap φ (Submonoid.map φ (Submonoid.powers x)))
⊢ ∀ (I : Ideal Sₘ), IsMaximal I → IsMaximal (comap (algebraMap S Sₘ) I)

Next tactic:
intro I hI
/-- If `f : R → S` descends to an integral map in the localization at `x`,
  and `R` is a Jacobson ring, then the intersection of all maximal ideals in `S` is trivial -/
theorem jacobson_bot_of_integral_localization {R : Type*} [CommRing R] [IsDomain R] [IsJacobson R]
    (Rₘ Sₘ : Type*) [CommRing Rₘ] [CommRing Sₘ] (φ : R →+* S) (hφ : Function.Injective ↑φ) (x : R)
    (hx : x ≠ 0) [Algebra R Rₘ] [IsLocalization.Away x Rₘ] [Algebra S Sₘ]
    [IsLocalization ((Submonoid.powers x).map φ : Submonoid S) Sₘ]
    (hφ' :
      RingHom.IsIntegral (IsLocalization.map Sₘ φ (Submonoid.powers x).le_comap_map : Rₘ →+* Sₘ)) :
    (⊥ : Ideal S).jacobson = (⊥ : Ideal S) := by
  have hM : ((Submonoid.powers x).map φ : Submonoid S) ≤ nonZeroDivisors S :=
    map_le_nonZeroDivisors_of_injective φ hφ (powers_le_nonZeroDivisors_of_noZeroDivisors hx)
  letI : IsDomain Sₘ := IsLocalization.isDomain_of_le_nonZeroDivisors _ hM
  let φ' : Rₘ →+* Sₘ := IsLocalization.map _ φ (Submonoid.powers x).le_comap_map
  suffices ∀ I : Ideal Sₘ, I.IsMaximal → (I.comap (algebraMap S Sₘ)).IsMaximal by
    have hϕ' : comap (algebraMap S Sₘ) (⊥ : Ideal Sₘ) = (⊥ : Ideal S) := by
      rw [← RingHom.ker_eq_comap_bot, ← RingHom.injective_iff_ker_eq_bot]
      exact IsLocalization.injective Sₘ hM
    have hSₘ : IsJacobson Sₘ := isJacobson_of_isIntegral' φ' hφ' (isJacobson_localization x)
    refine' eq_bot_iff.mpr (le_trans _ (le_of_eq hϕ'))
    rw [← hSₘ.out isRadical_bot_of_noZeroDivisors, comap_jacobson]
    exact sInf_le_sInf fun j hj => ⟨bot_le,
      let ⟨J, hJ⟩ := hj
      hJ.2 ▸ this J hJ.1.2⟩
  intro I hI
  -- Remainder of the proof is pulling and pushing ideals around the square and the quotient square
  

Proof state:
R✝ : Type u_1
S : Type u_2
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing S
inst✝¹¹ : IsDomain S
Rₘ✝ : Type u_3
Sₘ✝ : Type u_4
inst✝¹⁰ : CommRing Rₘ✝
inst✝⁹ : CommRing Sₘ✝
R : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : IsDomain R
inst✝⁶ : IsJacobson R
Rₘ : Type u_6
Sₘ : Type u_7
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
φ : R →+* S
hφ : Function.Injective ⇑φ
x : R
hx : x ≠ 0
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization.Away x Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Submonoid.map φ (Submonoid.powers x)) Sₘ
hφ' :
  RingHom.IsIntegral
    (IsLocalization.map Sₘ φ (_ : Submonoid.powers x ≤ Submonoid.comap φ (Submonoid.map φ (Submonoid.powers x))))
hM : Submonoid.map φ (Submonoid.powers x) ≤ nonZeroDivisors S
this : IsDomain Sₘ := IsLocalization.isDomain_of_le_nonZeroDivisors S hM
φ' : Rₘ →+* Sₘ :=
  IsLocalization.map Sₘ φ (_ : Submonoid.powers x ≤ Submonoid.comap φ (Submonoid.map φ (Submonoid.powers x)))
I : Ideal Sₘ
hI : IsMaximal I
⊢ IsMaximal (comap (algebraMap S Sₘ) I)

Next tactic:
haveI : (I.comap (algebraMap S Sₘ)).IsPrime := comap_isPrime _ I
/-- If `f : R → S` descends to an integral map in the localization at `x`,
  and `R` is a Jacobson ring, then the intersection of all maximal ideals in `S` is trivial -/
theorem jacobson_bot_of_integral_localization {R : Type*} [CommRing R] [IsDomain R] [IsJacobson R]
    (Rₘ Sₘ : Type*) [CommRing Rₘ] [CommRing Sₘ] (φ : R →+* S) (hφ : Function.Injective ↑φ) (x : R)
    (hx : x ≠ 0) [Algebra R Rₘ] [IsLocalization.Away x Rₘ] [Algebra S Sₘ]
    [IsLocalization ((Submonoid.powers x).map φ : Submonoid S) Sₘ]
    (hφ' :
      RingHom.IsIntegral (IsLocalization.map Sₘ φ (Submonoid.powers x).le_comap_map : Rₘ →+* Sₘ)) :
    (⊥ : Ideal S).jacobson = (⊥ : Ideal S) := by
  have hM : ((Submonoid.powers x).map φ : Submonoid S) ≤ nonZeroDivisors S :=
    map_le_nonZeroDivisors_of_injective φ hφ (powers_le_nonZeroDivisors_of_noZeroDivisors hx)
  letI : IsDomain Sₘ := IsLocalization.isDomain_of_le_nonZeroDivisors _ hM
  let φ' : Rₘ →+* Sₘ := IsLocalization.map _ φ (Submonoid.powers x).le_comap_map
  suffices ∀ I : Ideal Sₘ, I.IsMaximal → (I.comap (algebraMap S Sₘ)).IsMaximal by
    have hϕ' : comap (algebraMap S Sₘ) (⊥ : Ideal Sₘ) = (⊥ : Ideal S) := by
      rw [← RingHom.ker_eq_comap_bot, ← RingHom.injective_iff_ker_eq_bot]
      exact IsLocalization.injective Sₘ hM
    have hSₘ : IsJacobson Sₘ := isJacobson_of_isIntegral' φ' hφ' (isJacobson_localization x)
    refine' eq_bot_iff.mpr (le_trans _ (le_of_eq hϕ'))
    rw [← hSₘ.out isRadical_bot_of_noZeroDivisors, comap_jacobson]
    exact sInf_le_sInf fun j hj => ⟨bot_le,
      let ⟨J, hJ⟩ := hj
      hJ.2 ▸ this J hJ.1.2⟩
  intro I hI
  -- Remainder of the proof is pulling and pushing ideals around the square and the quotient square
  haveI : (I.comap (algebraMap S Sₘ)).IsPrime := comap_isPrime _ I
  

Proof state:
R✝ : Type u_1
S : Type u_2
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing S
inst✝¹¹ : IsDomain S
Rₘ✝ : Type u_3
Sₘ✝ : Type u_4
inst✝¹⁰ : CommRing Rₘ✝
inst✝⁹ : CommRing Sₘ✝
R : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : IsDomain R
inst✝⁶ : IsJacobson R
Rₘ : Type u_6
Sₘ : Type u_7
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
φ : R →+* S
hφ : Function.Injective ⇑φ
x : R
hx : x ≠ 0
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization.Away x Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Submonoid.map φ (Submonoid.powers x)) Sₘ
hφ' :
  RingHom.IsIntegral
    (IsLocalization.map Sₘ φ (_ : Submonoid.powers x ≤ Submonoid.comap φ (Submonoid.map φ (Submonoid.powers x))))
hM : Submonoid.map φ (Submonoid.powers x) ≤ nonZeroDivisors S
this✝ : IsDomain Sₘ := IsLocalization.isDomain_of_le_nonZeroDivisors S hM
φ' : Rₘ →+* Sₘ :=
  IsLocalization.map Sₘ φ (_ : Submonoid.powers x ≤ Submonoid.comap φ (Submonoid.map φ (Submonoid.powers x)))
I : Ideal Sₘ
hI : IsMaximal I
this : IsPrime (comap (algebraMap S Sₘ) I)
⊢ IsMaximal (comap (algebraMap S Sₘ) I)

Next tactic:
haveI : (I.comap φ').IsPrime := comap_isPrime φ' I
/-- If `f : R → S` descends to an integral map in the localization at `x`,
  and `R` is a Jacobson ring, then the intersection of all maximal ideals in `S` is trivial -/
theorem jacobson_bot_of_integral_localization {R : Type*} [CommRing R] [IsDomain R] [IsJacobson R]
    (Rₘ Sₘ : Type*) [CommRing Rₘ] [CommRing Sₘ] (φ : R →+* S) (hφ : Function.Injective ↑φ) (x : R)
    (hx : x ≠ 0) [Algebra R Rₘ] [IsLocalization.Away x Rₘ] [Algebra S Sₘ]
    [IsLocalization ((Submonoid.powers x).map φ : Submonoid S) Sₘ]
    (hφ' :
      RingHom.IsIntegral (IsLocalization.map Sₘ φ (Submonoid.powers x).le_comap_map : Rₘ →+* Sₘ)) :
    (⊥ : Ideal S).jacobson = (⊥ : Ideal S) := by
  have hM : ((Submonoid.powers x).map φ : Submonoid S) ≤ nonZeroDivisors S :=
    map_le_nonZeroDivisors_of_injective φ hφ (powers_le_nonZeroDivisors_of_noZeroDivisors hx)
  letI : IsDomain Sₘ := IsLocalization.isDomain_of_le_nonZeroDivisors _ hM
  let φ' : Rₘ →+* Sₘ := IsLocalization.map _ φ (Submonoid.powers x).le_comap_map
  suffices ∀ I : Ideal Sₘ, I.IsMaximal → (I.comap (algebraMap S Sₘ)).IsMaximal by
    have hϕ' : comap (algebraMap S Sₘ) (⊥ : Ideal Sₘ) = (⊥ : Ideal S) := by
      rw [← RingHom.ker_eq_comap_bot, ← RingHom.injective_iff_ker_eq_bot]
      exact IsLocalization.injective Sₘ hM
    have hSₘ : IsJacobson Sₘ := isJacobson_of_isIntegral' φ' hφ' (isJacobson_localization x)
    refine' eq_bot_iff.mpr (le_trans _ (le_of_eq hϕ'))
    rw [← hSₘ.out isRadical_bot_of_noZeroDivisors, comap_jacobson]
    exact sInf_le_sInf fun j hj => ⟨bot_le,
      let ⟨J, hJ⟩ := hj
      hJ.2 ▸ this J hJ.1.2⟩
  intro I hI
  -- Remainder of the proof is pulling and pushing ideals around the square and the quotient square
  haveI : (I.comap (algebraMap S Sₘ)).IsPrime := comap_isPrime _ I
  haveI : (I.comap φ').IsPrime := comap_isPrime φ' I
  

Proof state:
R✝ : Type u_1
S : Type u_2
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing S
inst✝¹¹ : IsDomain S
Rₘ✝ : Type u_3
Sₘ✝ : Type u_4
inst✝¹⁰ : CommRing Rₘ✝
inst✝⁹ : CommRing Sₘ✝
R : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : IsDomain R
inst✝⁶ : IsJacobson R
Rₘ : Type u_6
Sₘ : Type u_7
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
φ : R →+* S
hφ : Function.Injective ⇑φ
x : R
hx : x ≠ 0
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization.Away x Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Submonoid.map φ (Submonoid.powers x)) Sₘ
hφ' :
  RingHom.IsIntegral
    (IsLocalization.map Sₘ φ (_ : Submonoid.powers x ≤ Submonoid.comap φ (Submonoid.map φ (Submonoid.powers x))))
hM : Submonoid.map φ (Submonoid.powers x) ≤ nonZeroDivisors S
this✝¹ : IsDomain Sₘ := IsLocalization.isDomain_of_le_nonZeroDivisors S hM
φ' : Rₘ →+* Sₘ :=
  IsLocalization.map Sₘ φ (_ : Submonoid.powers x ≤ Submonoid.comap φ (Submonoid.map φ (Submonoid.powers x)))
I : Ideal Sₘ
hI : IsMaximal I
this✝ : IsPrime (comap (algebraMap S Sₘ) I)
this : IsPrime (comap φ' I)
⊢ IsMaximal (comap (algebraMap S Sₘ) I)

Next tactic:
haveI : (⊥ : Ideal (S ⧸ I.comap (algebraMap S Sₘ))).IsPrime := bot_prime
/-- If `f : R → S` descends to an integral map in the localization at `x`,
  and `R` is a Jacobson ring, then the intersection of all maximal ideals in `S` is trivial -/
theorem jacobson_bot_of_integral_localization {R : Type*} [CommRing R] [IsDomain R] [IsJacobson R]
    (Rₘ Sₘ : Type*) [CommRing Rₘ] [CommRing Sₘ] (φ : R →+* S) (hφ : Function.Injective ↑φ) (x : R)
    (hx : x ≠ 0) [Algebra R Rₘ] [IsLocalization.Away x Rₘ] [Algebra S Sₘ]
    [IsLocalization ((Submonoid.powers x).map φ : Submonoid S) Sₘ]
    (hφ' :
      RingHom.IsIntegral (IsLocalization.map Sₘ φ (Submonoid.powers x).le_comap_map : Rₘ →+* Sₘ)) :
    (⊥ : Ideal S).jacobson = (⊥ : Ideal S) := by
  have hM : ((Submonoid.powers x).map φ : Submonoid S) ≤ nonZeroDivisors S :=
    map_le_nonZeroDivisors_of_injective φ hφ (powers_le_nonZeroDivisors_of_noZeroDivisors hx)
  letI : IsDomain Sₘ := IsLocalization.isDomain_of_le_nonZeroDivisors _ hM
  let φ' : Rₘ →+* Sₘ := IsLocalization.map _ φ (Submonoid.powers x).le_comap_map
  suffices ∀ I : Ideal Sₘ, I.IsMaximal → (I.comap (algebraMap S Sₘ)).IsMaximal by
    have hϕ' : comap (algebraMap S Sₘ) (⊥ : Ideal Sₘ) = (⊥ : Ideal S) := by
      rw [← RingHom.ker_eq_comap_bot, ← RingHom.injective_iff_ker_eq_bot]
      exact IsLocalization.injective Sₘ hM
    have hSₘ : IsJacobson Sₘ := isJacobson_of_isIntegral' φ' hφ' (isJacobson_localization x)
    refine' eq_bot_iff.mpr (le_trans _ (le_of_eq hϕ'))
    rw [← hSₘ.out isRadical_bot_of_noZeroDivisors, comap_jacobson]
    exact sInf_le_sInf fun j hj => ⟨bot_le,
      let ⟨J, hJ⟩ := hj
      hJ.2 ▸ this J hJ.1.2⟩
  intro I hI
  -- Remainder of the proof is pulling and pushing ideals around the square and the quotient square
  haveI : (I.comap (algebraMap S Sₘ)).IsPrime := comap_isPrime _ I
  haveI : (I.comap φ').IsPrime := comap_isPrime φ' I
  haveI : (⊥ : Ideal (S ⧸ I.comap (algebraMap S Sₘ))).IsPrime := bot_prime
  

Proof state:
R✝ : Type u_1
S : Type u_2
inst✝¹³ : CommRing R✝
inst✝¹² : CommRing S
inst✝¹¹ : IsDomain S
Rₘ✝ : Type u_3
Sₘ✝ : Type u_4
inst✝¹⁰ : CommRing Rₘ✝
inst✝⁹ : CommRing Sₘ✝
R : Type u_5
inst✝⁸ : CommRing R
inst✝⁷ : IsDomain R
inst✝⁶ : IsJacobson R
Rₘ : Type u_6
Sₘ : Type u_7
inst✝⁵ : CommRing Rₘ
inst✝⁴ : CommRing Sₘ
φ : R →+* S
hφ : Function.Injective ⇑φ
x : R
hx : x ≠ 0
inst✝³ : Algebra R Rₘ
inst✝² : IsLocalization.Away x Rₘ
inst✝¹ : Algebra S Sₘ
inst✝ : IsLocalization (Submonoid.map φ (Submonoid.powers x)) Sₘ
hφ' :
  RingHom.IsIntegral
    (IsLocalization.map Sₘ φ (_ : Submonoid.powers x ≤ Submonoid.comap φ (Submonoid.map φ (Submonoid.powers x))))
hM : Submonoid.map φ (Submonoid.powers x) ≤ nonZeroDivisors S
this✝² : IsDomain Sₘ := IsLocalization.isDomain_of_le_nonZeroDivisors S hM
φ' : Rₘ →+* Sₘ :=
  IsLocalization.map Sₘ φ (_ : Submonoid.powers x ≤ Submonoid.comap φ (Submonoid.map φ (Submonoid.powers x)))
I : Ideal Sₘ
hI : IsMaximal I
this✝¹ : IsPrime (comap (algebraMap S Sₘ) I)
this✝ : IsPrime (comap φ' I)
this : IsPrime ⊥
⊢ IsMaximal (comap (algebraMap S Sₘ) I)

Next tactic:
have hcomm : φ'.comp (algebraMap R Rₘ) = (algebraMap S Sₘ).comp φ := IsLocalization.map_comp _
/-- Used to bootstrap the proof of `isJacobson_polynomial_iff_isJacobson`.
  That theorem is more general and should be used instead of this one. -/
private theorem isJacobson_polynomial_of_domain (R : Type*) [CommRing R] [IsDomain R]
    [hR : IsJacobson R] (P : Ideal R[X]) [IsPrime P] (hP : ∀ x : R, C x ∈ P → x = 0) :
    P.jacobson = P := by
  

Proof state:
R✝ : Type u_1
S : Type u_2
inst✝⁷ : CommRing R✝
inst✝⁶ : CommRing S
inst✝⁵ : IsDomain S
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁴ : CommRing Rₘ
inst✝³ : CommRing Sₘ
R : Type u_5
inst✝² : CommRing R
inst✝¹ : IsDomain R
hR : IsJacobson R
P : Ideal R[X]
inst✝ : IsPrime P
hP : ∀ (x : R), C x ∈ P → x = 0
⊢ jacobson P = P

Next tactic:
by_cases Pb : P = ⊥
/-- Used to bootstrap the proof of `isJacobson_polynomial_iff_isJacobson`.
  That theorem is more general and should be used instead of this one. -/
private theorem isJacobson_polynomial_of_domain (R : Type*) [CommRing R] [IsDomain R]
    [hR : IsJacobson R] (P : Ideal R[X]) [IsPrime P] (hP : ∀ x : R, C x ∈ P → x = 0) :
    P.jacobson = P := by
  by_cases Pb : P = ⊥
  · 

Proof state:
case pos
R✝ : Type u_1
S : Type u_2
inst✝⁷ : CommRing R✝
inst✝⁶ : CommRing S
inst✝⁵ : IsDomain S
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁴ : CommRing Rₘ
inst✝³ : CommRing Sₘ
R : Type u_5
inst✝² : CommRing R
inst✝¹ : IsDomain R
hR : IsJacobson R
P : Ideal R[X]
inst✝ : IsPrime P
hP : ∀ (x : R), C x ∈ P → x = 0
Pb : P = ⊥
⊢ jacobson P = P

Next tactic:
exact Pb.symm ▸
      jacobson_bot_polynomial_of_jacobson_bot (hR.out isRadical_bot_of_noZeroDivisors)
/-- Used to bootstrap the proof of `isJacobson_polynomial_iff_isJacobson`.
  That theorem is more general and should be used instead of this one. -/
private theorem isJacobson_polynomial_of_domain (R : Type*) [CommRing R] [IsDomain R]
    [hR : IsJacobson R] (P : Ideal R[X]) [IsPrime P] (hP : ∀ x : R, C x ∈ P → x = 0) :
    P.jacobson = P := by
  by_cases Pb : P = ⊥
  · exact Pb.symm ▸
      jacobson_bot_polynomial_of_jacobson_bot (hR.out isRadical_bot_of_noZeroDivisors)
  · 

Proof state:
case neg
R✝ : Type u_1
S : Type u_2
inst✝⁷ : CommRing R✝
inst✝⁶ : CommRing S
inst✝⁵ : IsDomain S
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁴ : CommRing Rₘ
inst✝³ : CommRing Sₘ
R : Type u_5
inst✝² : CommRing R
inst✝¹ : IsDomain R
hR : IsJacobson R
P : Ideal R[X]
inst✝ : IsPrime P
hP : ∀ (x : R), C x ∈ P → x = 0
Pb : ¬P = ⊥
⊢ jacobson P = P

Next tactic:
rw [jacobson_eq_iff_jacobson_quotient_eq_bot]
/-- Used to bootstrap the proof of `isJacobson_polynomial_iff_isJacobson`.
  That theorem is more general and should be used instead of this one. -/
private theorem isJacobson_polynomial_of_domain (R : Type*) [CommRing R] [IsDomain R]
    [hR : IsJacobson R] (P : Ideal R[X]) [IsPrime P] (hP : ∀ x : R, C x ∈ P → x = 0) :
    P.jacobson = P := by
  by_cases Pb : P = ⊥
  · exact Pb.symm ▸
      jacobson_bot_polynomial_of_jacobson_bot (hR.out isRadical_bot_of_noZeroDivisors)
  · 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
inst✝⁵ : IsDomain S
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁴ : CommRing Rₘ
inst✝³ : CommRing Sₘ
R : Type u_5
inst✝² : CommRing R
inst✝¹ : IsDomain R
hR : IsJacobson R
P : Ideal R[X]
inst✝ : IsPrime P
hP : ∀ (x : R), C x ∈ P → x = 0
Pb : ¬P = ⊥
⊢ jacobson ⊥ = ⊥

Next tactic:
let P' := P.comap (C : R →+* R[X])
/-- Used to bootstrap the proof of `isJacobson_polynomial_iff_isJacobson`.
  That theorem is more general and should be used instead of this one. -/
private theorem isJacobson_polynomial_of_domain (R : Type*) [CommRing R] [IsDomain R]
    [hR : IsJacobson R] (P : Ideal R[X]) [IsPrime P] (hP : ∀ x : R, C x ∈ P → x = 0) :
    P.jacobson = P := by
  by_cases Pb : P = ⊥
  · exact Pb.symm ▸
      jacobson_bot_polynomial_of_jacobson_bot (hR.out isRadical_bot_of_noZeroDivisors)
  · rw [jacobson_eq_iff_jacobson_quotient_eq_bot]
    let P' := P.comap (C : R →+* R[X])
    

Proof state:
case neg
R✝ : Type u_1
S : Type u_2
inst✝⁷ : CommRing R✝
inst✝⁶ : CommRing S
inst✝⁵ : IsDomain S
Rₘ : Type u_3
Sₘ : Type u_4
inst✝⁴ : CommRing Rₘ
inst✝³ : CommRing Sₘ
R : Type u_5
inst✝² : CommRing R
inst✝¹ : IsDomain R
hR : IsJacobson R
P : Ideal R[X]
inst✝ : IsPrime P
hP : ∀ (x : R), C x ∈ P → x = 0
Pb : ¬P = ⊥
P' : Ideal R := comap C P
⊢ jacobson ⊥ = ⊥

Next tactic:
haveI : P'.IsPrime := comap_isPrime C P