l3lab/ntp-mathlib huggingface dataset:
/-- Used to bootstrap the more general `quotient_mk_comp_C_isIntegral_of_jacobson` -/
private theorem quotient_mk_comp_C_isIntegral_of_jacobson' [Nontrivial R] (hR : IsJacobson R)
    (hP' : ∀ x : R, C x ∈ P → x = 0) : ((Quotient.mk P).comp C : R →+* R[X] ⧸ P).IsIntegral := by
  refine' (isIntegral_quotientMap_iff _).mp _
  let P' : Ideal R := P.comap C
  obtain ⟨pX, hpX, hp0⟩ :=
    exists_nonzero_mem_of_ne_bot (ne_of_lt (bot_lt_of_maximal P polynomial_not_isField)).symm hP'
  let a : R ⧸ P' := (pX.map (Quotient.mk P')).leadingCoeff
  let M : Submonoid (R ⧸ P') := Submonoid.powers a
  let φ : R ⧸ P' →+* R[X] ⧸ P := quotientMap P C le_rfl
  haveI hP'_prime : P'.IsPrime := comap_isPrime C P
  have hM : (0 : R ⧸ P') ∉ M := fun ⟨n, hn⟩ => hp0 <| leadingCoeff_eq_zero.mp (pow_eq_zero hn)
  let M' : Submonoid (R[X] ⧸ P) := M.map φ
  refine' RingHom.IsIntegral.tower_bot φ (algebraMap _ (Localization M')) _ _
  · refine' IsLocalization.injective (Localization M')
      (show M' ≤ _ from le_nonZeroDivisors_of_noZeroDivisors fun hM' => hM _)
    exact
      let ⟨z, zM, z0⟩ := hM'
      quotientMap_injective (_root_.trans z0 φ.map_zero.symm) ▸ zM
  · suffices : RingHom.comp (algebraMap (R[X] ⧸ P) (Localization M')) φ =
      (IsLocalization.map (Localization M') φ M.le_comap_map).comp
        (algebraMap (R ⧸ P') (Localization M))
    rw [this]
    refine' RingHom.IsIntegral.trans (algebraMap (R ⧸ P') (Localization M))
      (IsLocalization.map (Localization M') φ M.le_comap_map) _ _
    · exact (algebraMap (R ⧸ P') (Localization M)).isIntegral_of_surjective
        (IsField.localization_map_bijective hM ((Quotient.maximal_ideal_iff_isField_quotient _).mp
          (isMaximal_comap_C_of_isMaximal P hP'))).2
    · -- `convert` here is faster than `exact`, and this proof is near the time limit.
      -- convert isIntegral_isLocalization_polynomial_quotient P pX hpX
      have isloc : IsLocalization M' (Localization M') := by infer_instance
      exact @isIntegral_isLocalization_polynomial_quotient R _
        (Localization M) (Localization M') _ _ P pX hpX _ _ _ isloc
    

Proof state:
case this
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsJacobson R
P : Ideal R[X]
hP : IsMaximal P
inst✝ : Nontrivial R
hR : IsJacobson R
hP' : ∀ (x : R), C x ∈ P → x = 0
P' : Ideal R := comap C P
pX : R[X]
hpX : pX ∈ P
hp0 : Polynomial.map (Quotient.mk (comap C P)) pX ≠ 0
a : R ⧸ P' := Polynomial.leadingCoeff (Polynomial.map (Quotient.mk P') pX)
M : Submonoid (R ⧸ P') := Submonoid.powers a
φ : R ⧸ P' →+* R[X] ⧸ P := quotientMap P C (_ : P' ≤ P')
hP'_prime : IsPrime P'
hM : 0 ∉ M
M' : Submonoid (R[X] ⧸ P) := Submonoid.map φ M
⊢ RingHom.comp (algebraMap (R[X] ⧸ P) (Localization M')) φ =
    RingHom.comp (IsLocalization.map (Localization M') φ (_ : M ≤ Submonoid.comap φ (Submonoid.map φ M)))
      (algebraMap (R ⧸ P') (Localization M))

Next tactic:
rw [IsLocalization.map_comp M.le_comap_map]
/-- If `R` is a Jacobson ring, and `P` is a maximal ideal of `R[X]`,
  then `R → R[X]/P` is an integral map. -/
theorem quotient_mk_comp_C_isIntegral_of_jacobson :
    ((Quotient.mk P).comp C : R →+* R[X] ⧸ P).IsIntegral := by
  

Proof state:
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsJacobson R
P : Ideal R[X]
hP : IsMaximal P
⊢ RingHom.IsIntegral (RingHom.comp (Quotient.mk P) C)

Next tactic:
let P' : Ideal R := P.comap C
/-- If `R` is a Jacobson ring, and `P` is a maximal ideal of `R[X]`,
  then `R → R[X]/P` is an integral map. -/
theorem quotient_mk_comp_C_isIntegral_of_jacobson :
    ((Quotient.mk P).comp C : R →+* R[X] ⧸ P).IsIntegral := by
  let P' : Ideal R := P.comap C
  

Proof state:
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsJacobson R
P : Ideal R[X]
hP : IsMaximal P
P' : Ideal R := comap C P
⊢ RingHom.IsIntegral (RingHom.comp (Quotient.mk P) C)

Next tactic:
haveI : P'.IsPrime := comap_isPrime C P
/-- If `R` is a Jacobson ring, and `P` is a maximal ideal of `R[X]`,
  then `R → R[X]/P` is an integral map. -/
theorem quotient_mk_comp_C_isIntegral_of_jacobson :
    ((Quotient.mk P).comp C : R →+* R[X] ⧸ P).IsIntegral := by
  let P' : Ideal R := P.comap C
  haveI : P'.IsPrime := comap_isPrime C P
  

Proof state:
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsJacobson R
P : Ideal R[X]
hP : IsMaximal P
P' : Ideal R := comap C P
this : IsPrime P'
⊢ RingHom.IsIntegral (RingHom.comp (Quotient.mk P) C)

Next tactic:
let f : R[X] →+* Polynomial (R ⧸ P') := Polynomial.mapRingHom (Quotient.mk P')
/-- If `R` is a Jacobson ring, and `P` is a maximal ideal of `R[X]`,
  then `R → R[X]/P` is an integral map. -/
theorem quotient_mk_comp_C_isIntegral_of_jacobson :
    ((Quotient.mk P).comp C : R →+* R[X] ⧸ P).IsIntegral := by
  let P' : Ideal R := P.comap C
  haveI : P'.IsPrime := comap_isPrime C P
  let f : R[X] →+* Polynomial (R ⧸ P') := Polynomial.mapRingHom (Quotient.mk P')
  

Proof state:
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsJacobson R
P : Ideal R[X]
hP : IsMaximal P
P' : Ideal R := comap C P
this : IsPrime P'
f : R[X] →+* (R ⧸ P')[X] := mapRingHom (Quotient.mk P')
⊢ RingHom.IsIntegral (RingHom.comp (Quotient.mk P) C)

Next tactic:
have hf : Function.Surjective ↑f := map_surjective (Quotient.mk P') Quotient.mk_surjective
/-- If `R` is a Jacobson ring, and `P` is a maximal ideal of `R[X]`,
  then `R → R[X]/P` is an integral map. -/
theorem quotient_mk_comp_C_isIntegral_of_jacobson :
    ((Quotient.mk P).comp C : R →+* R[X] ⧸ P).IsIntegral := by
  let P' : Ideal R := P.comap C
  haveI : P'.IsPrime := comap_isPrime C P
  let f : R[X] →+* Polynomial (R ⧸ P') := Polynomial.mapRingHom (Quotient.mk P')
  have hf : Function.Surjective ↑f := map_surjective (Quotient.mk P') Quotient.mk_surjective
  

Proof state:
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsJacobson R
P : Ideal R[X]
hP : IsMaximal P
P' : Ideal R := comap C P
this : IsPrime P'
f : R[X] →+* (R ⧸ P')[X] := mapRingHom (Quotient.mk P')
hf : Function.Surjective ⇑f
⊢ RingHom.IsIntegral (RingHom.comp (Quotient.mk P) C)

Next tactic:
have hPJ : P = (P.map f).comap f := by
    rw [comap_map_of_surjective _ hf]
    refine' le_antisymm (le_sup_of_le_left le_rfl) (sup_le le_rfl _)
    refine' fun p hp =>
      polynomial_mem_ideal_of_coeff_mem_ideal P p fun n => Quotient.eq_zero_iff_mem.mp _
    simpa only [coeff_map, coe_mapRingHom] using (Polynomial.ext_iff.mp hp) n
/-- If `R` is a Jacobson ring, and `P` is a maximal ideal of `R[X]`,
  then `R → R[X]/P` is an integral map. -/
theorem quotient_mk_comp_C_isIntegral_of_jacobson :
    ((Quotient.mk P).comp C : R →+* R[X] ⧸ P).IsIntegral := by
  let P' : Ideal R := P.comap C
  haveI : P'.IsPrime := comap_isPrime C P
  let f : R[X] →+* Polynomial (R ⧸ P') := Polynomial.mapRingHom (Quotient.mk P')
  have hf : Function.Surjective ↑f := map_surjective (Quotient.mk P') Quotient.mk_surjective
  have hPJ : P = (P.map f).comap f := by
    

Proof state:
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsJacobson R
P : Ideal R[X]
hP : IsMaximal P
P' : Ideal R := comap C P
this : IsPrime P'
f : R[X] →+* (R ⧸ P')[X] := mapRingHom (Quotient.mk P')
hf : Function.Surjective ⇑f
⊢ P = comap f (map f P)

Next tactic:
rw [comap_map_of_surjective _ hf]
/-- If `R` is a Jacobson ring, and `P` is a maximal ideal of `R[X]`,
  then `R → R[X]/P` is an integral map. -/
theorem quotient_mk_comp_C_isIntegral_of_jacobson :
    ((Quotient.mk P).comp C : R →+* R[X] ⧸ P).IsIntegral := by
  let P' : Ideal R := P.comap C
  haveI : P'.IsPrime := comap_isPrime C P
  let f : R[X] →+* Polynomial (R ⧸ P') := Polynomial.mapRingHom (Quotient.mk P')
  have hf : Function.Surjective ↑f := map_surjective (Quotient.mk P') Quotient.mk_surjective
  have hPJ : P = (P.map f).comap f := by
    rw [comap_map_of_surjective _ hf]
    

Proof state:
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsJacobson R
P : Ideal R[X]
hP : IsMaximal P
P' : Ideal R := comap C P
this : IsPrime P'
f : R[X] →+* (R ⧸ P')[X] := mapRingHom (Quotient.mk P')
hf : Function.Surjective ⇑f
⊢ P = P ⊔ comap f ⊥

Next tactic:
refine' le_antisymm (le_sup_of_le_left le_rfl) (sup_le le_rfl _)
/-- If `R` is a Jacobson ring, and `P` is a maximal ideal of `R[X]`,
  then `R → R[X]/P` is an integral map. -/
theorem quotient_mk_comp_C_isIntegral_of_jacobson :
    ((Quotient.mk P).comp C : R →+* R[X] ⧸ P).IsIntegral := by
  let P' : Ideal R := P.comap C
  haveI : P'.IsPrime := comap_isPrime C P
  let f : R[X] →+* Polynomial (R ⧸ P') := Polynomial.mapRingHom (Quotient.mk P')
  have hf : Function.Surjective ↑f := map_surjective (Quotient.mk P') Quotient.mk_surjective
  have hPJ : P = (P.map f).comap f := by
    rw [comap_map_of_surjective _ hf]
    refine' le_antisymm (le_sup_of_le_left le_rfl) (sup_le le_rfl _)
    

Proof state:
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsJacobson R
P : Ideal R[X]
hP : IsMaximal P
P' : Ideal R := comap C P
this : IsPrime P'
f : R[X] →+* (R ⧸ P')[X] := mapRingHom (Quotient.mk P')
hf : Function.Surjective ⇑f
⊢ comap f ⊥ ≤ P

Next tactic:
refine' fun p hp =>
      polynomial_mem_ideal_of_coeff_mem_ideal P p fun n => Quotient.eq_zero_iff_mem.mp _
/-- If `R` is a Jacobson ring, and `P` is a maximal ideal of `R[X]`,
  then `R → R[X]/P` is an integral map. -/
theorem quotient_mk_comp_C_isIntegral_of_jacobson :
    ((Quotient.mk P).comp C : R →+* R[X] ⧸ P).IsIntegral := by
  let P' : Ideal R := P.comap C
  haveI : P'.IsPrime := comap_isPrime C P
  let f : R[X] →+* Polynomial (R ⧸ P') := Polynomial.mapRingHom (Quotient.mk P')
  have hf : Function.Surjective ↑f := map_surjective (Quotient.mk P') Quotient.mk_surjective
  have hPJ : P = (P.map f).comap f := by
    rw [comap_map_of_surjective _ hf]
    refine' le_antisymm (le_sup_of_le_left le_rfl) (sup_le le_rfl _)
    refine' fun p hp =>
      polynomial_mem_ideal_of_coeff_mem_ideal P p fun n => Quotient.eq_zero_iff_mem.mp _
    

Proof state:
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsJacobson R
P : Ideal R[X]
hP : IsMaximal P
P' : Ideal R := comap C P
this : IsPrime P'
f : R[X] →+* (R ⧸ P')[X] := mapRingHom (Quotient.mk P')
hf : Function.Surjective ⇑f
p : R[X]
hp : p ∈ comap f ⊥
n : ℕ
⊢ (Quotient.mk (comap C P)) (coeff p n) = 0

Next tactic:
simpa only [coeff_map, coe_mapRingHom] using (Polynomial.ext_iff.mp hp) n
/-- If `R` is a Jacobson ring, and `P` is a maximal ideal of `R[X]`,
  then `R → R[X]/P` is an integral map. -/
theorem quotient_mk_comp_C_isIntegral_of_jacobson :
    ((Quotient.mk P).comp C : R →+* R[X] ⧸ P).IsIntegral := by
  let P' : Ideal R := P.comap C
  haveI : P'.IsPrime := comap_isPrime C P
  let f : R[X] →+* Polynomial (R ⧸ P') := Polynomial.mapRingHom (Quotient.mk P')
  have hf : Function.Surjective ↑f := map_surjective (Quotient.mk P') Quotient.mk_surjective
  have hPJ : P = (P.map f).comap f := by
    rw [comap_map_of_surjective _ hf]
    refine' le_antisymm (le_sup_of_le_left le_rfl) (sup_le le_rfl _)
    refine' fun p hp =>
      polynomial_mem_ideal_of_coeff_mem_ideal P p fun n => Quotient.eq_zero_iff_mem.mp _
    simpa only [coeff_map, coe_mapRingHom] using (Polynomial.ext_iff.mp hp) n
  

Proof state:
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsJacobson R
P : Ideal R[X]
hP : IsMaximal P
P' : Ideal R := comap C P
this : IsPrime P'
f : R[X] →+* (R ⧸ P')[X] := mapRingHom (Quotient.mk P')
hf : Function.Surjective ⇑f
hPJ : P = comap f (map f P)
⊢ RingHom.IsIntegral (RingHom.comp (Quotient.mk P) C)

Next tactic:
refine' RingHom.IsIntegral.tower_bot _ _ (injective_quotient_le_comap_map P) _
/-- If `R` is a Jacobson ring, and `P` is a maximal ideal of `R[X]`,
  then `R → R[X]/P` is an integral map. -/
theorem quotient_mk_comp_C_isIntegral_of_jacobson :
    ((Quotient.mk P).comp C : R →+* R[X] ⧸ P).IsIntegral := by
  let P' : Ideal R := P.comap C
  haveI : P'.IsPrime := comap_isPrime C P
  let f : R[X] →+* Polynomial (R ⧸ P') := Polynomial.mapRingHom (Quotient.mk P')
  have hf : Function.Surjective ↑f := map_surjective (Quotient.mk P') Quotient.mk_surjective
  have hPJ : P = (P.map f).comap f := by
    rw [comap_map_of_surjective _ hf]
    refine' le_antisymm (le_sup_of_le_left le_rfl) (sup_le le_rfl _)
    refine' fun p hp =>
      polynomial_mem_ideal_of_coeff_mem_ideal P p fun n => Quotient.eq_zero_iff_mem.mp _
    simpa only [coeff_map, coe_mapRingHom] using (Polynomial.ext_iff.mp hp) n
  refine' RingHom.IsIntegral.tower_bot _ _ (injective_quotient_le_comap_map P) _
  

Proof state:
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsJacobson R
P : Ideal R[X]
hP : IsMaximal P
P' : Ideal R := comap C P
this : IsPrime P'
f : R[X] →+* (R ⧸ P')[X] := mapRingHom (Quotient.mk P')
hf : Function.Surjective ⇑f
hPJ : P = comap f (map f P)
⊢ RingHom.IsIntegral
    (RingHom.comp
      (quotientMap (map (mapRingHom (Quotient.mk (comap C P))) P) (mapRingHom (Quotient.mk (comap C P)))
        (_ : P ≤ comap (mapRingHom (Quotient.mk (comap C P))) (map (mapRingHom (Quotient.mk (comap C P))) P)))
      (RingHom.comp (Quotient.mk P) C))

Next tactic:
rw [← quotient_mk_maps_eq]
/-- If `R` is a Jacobson ring, and `P` is a maximal ideal of `R[X]`,
  then `R → R[X]/P` is an integral map. -/
theorem quotient_mk_comp_C_isIntegral_of_jacobson :
    ((Quotient.mk P).comp C : R →+* R[X] ⧸ P).IsIntegral := by
  let P' : Ideal R := P.comap C
  haveI : P'.IsPrime := comap_isPrime C P
  let f : R[X] →+* Polynomial (R ⧸ P') := Polynomial.mapRingHom (Quotient.mk P')
  have hf : Function.Surjective ↑f := map_surjective (Quotient.mk P') Quotient.mk_surjective
  have hPJ : P = (P.map f).comap f := by
    rw [comap_map_of_surjective _ hf]
    refine' le_antisymm (le_sup_of_le_left le_rfl) (sup_le le_rfl _)
    refine' fun p hp =>
      polynomial_mem_ideal_of_coeff_mem_ideal P p fun n => Quotient.eq_zero_iff_mem.mp _
    simpa only [coeff_map, coe_mapRingHom] using (Polynomial.ext_iff.mp hp) n
  refine' RingHom.IsIntegral.tower_bot _ _ (injective_quotient_le_comap_map P) _
  rw [← quotient_mk_maps_eq]
  

Proof state:
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsJacobson R
P : Ideal R[X]
hP : IsMaximal P
P' : Ideal R := comap C P
this : IsPrime P'
f : R[X] →+* (R ⧸ P')[X] := mapRingHom (Quotient.mk P')
hf : Function.Surjective ⇑f
hPJ : P = comap f (map f P)
⊢ RingHom.IsIntegral
    (RingHom.comp (RingHom.comp (Quotient.mk (map (mapRingHom (Quotient.mk (comap C P))) P)) C)
      (Quotient.mk (comap C P)))

Next tactic:
refine ((Quotient.mk P').isIntegral_of_surjective Quotient.mk_surjective).trans _ _ ?_
/-- If `R` is a Jacobson ring, and `P` is a maximal ideal of `R[X]`,
  then `R → R[X]/P` is an integral map. -/
theorem quotient_mk_comp_C_isIntegral_of_jacobson :
    ((Quotient.mk P).comp C : R →+* R[X] ⧸ P).IsIntegral := by
  let P' : Ideal R := P.comap C
  haveI : P'.IsPrime := comap_isPrime C P
  let f : R[X] →+* Polynomial (R ⧸ P') := Polynomial.mapRingHom (Quotient.mk P')
  have hf : Function.Surjective ↑f := map_surjective (Quotient.mk P') Quotient.mk_surjective
  have hPJ : P = (P.map f).comap f := by
    rw [comap_map_of_surjective _ hf]
    refine' le_antisymm (le_sup_of_le_left le_rfl) (sup_le le_rfl _)
    refine' fun p hp =>
      polynomial_mem_ideal_of_coeff_mem_ideal P p fun n => Quotient.eq_zero_iff_mem.mp _
    simpa only [coeff_map, coe_mapRingHom] using (Polynomial.ext_iff.mp hp) n
  refine' RingHom.IsIntegral.tower_bot _ _ (injective_quotient_le_comap_map P) _
  rw [← quotient_mk_maps_eq]
  refine ((Quotient.mk P').isIntegral_of_surjective Quotient.mk_surjective).trans _ _ ?_
  

Proof state:
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsJacobson R
P : Ideal R[X]
hP : IsMaximal P
P' : Ideal R := comap C P
this : IsPrime P'
f : R[X] →+* (R ⧸ P')[X] := mapRingHom (Quotient.mk P')
hf : Function.Surjective ⇑f
hPJ : P = comap f (map f P)
⊢ RingHom.IsIntegral (RingHom.comp (Quotient.mk (map (mapRingHom (Quotient.mk (comap C P))) P)) C)

Next tactic:
have : IsMaximal (map (mapRingHom (Quotient.mk (comap C P))) P)
/-- If `R` is a Jacobson ring, and `P` is a maximal ideal of `R[X]`,
  then `R → R[X]/P` is an integral map. -/
theorem quotient_mk_comp_C_isIntegral_of_jacobson :
    ((Quotient.mk P).comp C : R →+* R[X] ⧸ P).IsIntegral := by
  let P' : Ideal R := P.comap C
  haveI : P'.IsPrime := comap_isPrime C P
  let f : R[X] →+* Polynomial (R ⧸ P') := Polynomial.mapRingHom (Quotient.mk P')
  have hf : Function.Surjective ↑f := map_surjective (Quotient.mk P') Quotient.mk_surjective
  have hPJ : P = (P.map f).comap f := by
    rw [comap_map_of_surjective _ hf]
    refine' le_antisymm (le_sup_of_le_left le_rfl) (sup_le le_rfl _)
    refine' fun p hp =>
      polynomial_mem_ideal_of_coeff_mem_ideal P p fun n => Quotient.eq_zero_iff_mem.mp _
    simpa only [coeff_map, coe_mapRingHom] using (Polynomial.ext_iff.mp hp) n
  refine' RingHom.IsIntegral.tower_bot _ _ (injective_quotient_le_comap_map P) _
  rw [← quotient_mk_maps_eq]
  refine ((Quotient.mk P').isIntegral_of_surjective Quotient.mk_surjective).trans _ _ ?_
  have : IsMaximal (map (mapRingHom (Quotient.mk (comap C P))) P)
  · 

Proof state:
case this
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsJacobson R
P : Ideal R[X]
hP : IsMaximal P
P' : Ideal R := comap C P
this : IsPrime P'
f : R[X] →+* (R ⧸ P')[X] := mapRingHom (Quotient.mk P')
hf : Function.Surjective ⇑f
hPJ : P = comap f (map f P)
⊢ IsMaximal (map (mapRingHom (Quotient.mk (comap C P))) P)

Next tactic:
exact Or.recOn (map_eq_top_or_isMaximal_of_surjective f hf hP)
      (fun h => absurd (_root_.trans (h ▸ hPJ : P = comap f ⊤) comap_top : P = ⊤) hP.ne_top) id
/-- If `R` is a Jacobson ring, and `P` is a maximal ideal of `R[X]`,
  then `R → R[X]/P` is an integral map. -/
theorem quotient_mk_comp_C_isIntegral_of_jacobson :
    ((Quotient.mk P).comp C : R →+* R[X] ⧸ P).IsIntegral := by
  let P' : Ideal R := P.comap C
  haveI : P'.IsPrime := comap_isPrime C P
  let f : R[X] →+* Polynomial (R ⧸ P') := Polynomial.mapRingHom (Quotient.mk P')
  have hf : Function.Surjective ↑f := map_surjective (Quotient.mk P') Quotient.mk_surjective
  have hPJ : P = (P.map f).comap f := by
    rw [comap_map_of_surjective _ hf]
    refine' le_antisymm (le_sup_of_le_left le_rfl) (sup_le le_rfl _)
    refine' fun p hp =>
      polynomial_mem_ideal_of_coeff_mem_ideal P p fun n => Quotient.eq_zero_iff_mem.mp _
    simpa only [coeff_map, coe_mapRingHom] using (Polynomial.ext_iff.mp hp) n
  refine' RingHom.IsIntegral.tower_bot _ _ (injective_quotient_le_comap_map P) _
  rw [← quotient_mk_maps_eq]
  refine ((Quotient.mk P').isIntegral_of_surjective Quotient.mk_surjective).trans _ _ ?_
  have : IsMaximal (map (mapRingHom (Quotient.mk (comap C P))) P)
  · exact Or.recOn (map_eq_top_or_isMaximal_of_surjective f hf hP)
      (fun h => absurd (_root_.trans (h ▸ hPJ : P = comap f ⊤) comap_top : P = ⊤) hP.ne_top) id
  

Proof state:
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsJacobson R
P : Ideal R[X]
hP : IsMaximal P
P' : Ideal R := comap C P
this✝ : IsPrime P'
f : R[X] →+* (R ⧸ P')[X] := mapRingHom (Quotient.mk P')
hf : Function.Surjective ⇑f
hPJ : P = comap f (map f P)
this : IsMaximal (map (mapRingHom (Quotient.mk (comap C P))) P)
⊢ RingHom.IsIntegral (RingHom.comp (Quotient.mk (map (mapRingHom (Quotient.mk (comap C P))) P)) C)

Next tactic:
apply quotient_mk_comp_C_isIntegral_of_jacobson' _ ?_ (fun x hx => ?_)
/-- If `R` is a Jacobson ring, and `P` is a maximal ideal of `R[X]`,
  then `R → R[X]/P` is an integral map. -/
theorem quotient_mk_comp_C_isIntegral_of_jacobson :
    ((Quotient.mk P).comp C : R →+* R[X] ⧸ P).IsIntegral := by
  let P' : Ideal R := P.comap C
  haveI : P'.IsPrime := comap_isPrime C P
  let f : R[X] →+* Polynomial (R ⧸ P') := Polynomial.mapRingHom (Quotient.mk P')
  have hf : Function.Surjective ↑f := map_surjective (Quotient.mk P') Quotient.mk_surjective
  have hPJ : P = (P.map f).comap f := by
    rw [comap_map_of_surjective _ hf]
    refine' le_antisymm (le_sup_of_le_left le_rfl) (sup_le le_rfl _)
    refine' fun p hp =>
      polynomial_mem_ideal_of_coeff_mem_ideal P p fun n => Quotient.eq_zero_iff_mem.mp _
    simpa only [coeff_map, coe_mapRingHom] using (Polynomial.ext_iff.mp hp) n
  refine' RingHom.IsIntegral.tower_bot _ _ (injective_quotient_le_comap_map P) _
  rw [← quotient_mk_maps_eq]
  refine ((Quotient.mk P').isIntegral_of_surjective Quotient.mk_surjective).trans _ _ ?_
  have : IsMaximal (map (mapRingHom (Quotient.mk (comap C P))) P)
  · exact Or.recOn (map_eq_top_or_isMaximal_of_surjective f hf hP)
      (fun h => absurd (_root_.trans (h ▸ hPJ : P = comap f ⊤) comap_top : P = ⊤) hP.ne_top) id
  apply quotient_mk_comp_C_isIntegral_of_jacobson' _ ?_ (fun x hx => ?_)
  

Proof state:
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsJacobson R
P : Ideal R[X]
hP : IsMaximal P
P' : Ideal R := comap C P
this✝ : IsPrime P'
f : R[X] →+* (R ⧸ P')[X] := mapRingHom (Quotient.mk P')
hf : Function.Surjective ⇑f
hPJ : P = comap f (map f P)
this : IsMaximal (map (mapRingHom (Quotient.mk (comap C P))) P)
⊢ IsJacobson (R ⧸ P')
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsJacobson R
P : Ideal R[X]
hP : IsMaximal P
P' : Ideal R := comap C P
this✝ : IsPrime P'
f : R[X] →+* (R ⧸ P')[X] := mapRingHom (Quotient.mk P')
hf : Function.Surjective ⇑f
hPJ : P = comap f (map f P)
this : IsMaximal (map (mapRingHom (Quotient.mk (comap C P))) P)
x : R ⧸ P'
hx : C x ∈ map (mapRingHom (Quotient.mk (comap C P))) P
⊢ x = 0

Next tactic:
any_goals exact Ideal.isJacobson_quotient
/-- If `R` is a Jacobson ring, and `P` is a maximal ideal of `R[X]`,
  then `R → R[X]/P` is an integral map. -/
theorem quotient_mk_comp_C_isIntegral_of_jacobson :
    ((Quotient.mk P).comp C : R →+* R[X] ⧸ P).IsIntegral := by
  let P' : Ideal R := P.comap C
  haveI : P'.IsPrime := comap_isPrime C P
  let f : R[X] →+* Polynomial (R ⧸ P') := Polynomial.mapRingHom (Quotient.mk P')
  have hf : Function.Surjective ↑f := map_surjective (Quotient.mk P') Quotient.mk_surjective
  have hPJ : P = (P.map f).comap f := by
    rw [comap_map_of_surjective _ hf]
    refine' le_antisymm (le_sup_of_le_left le_rfl) (sup_le le_rfl _)
    refine' fun p hp =>
      polynomial_mem_ideal_of_coeff_mem_ideal P p fun n => Quotient.eq_zero_iff_mem.mp _
    simpa only [coeff_map, coe_mapRingHom] using (Polynomial.ext_iff.mp hp) n
  refine' RingHom.IsIntegral.tower_bot _ _ (injective_quotient_le_comap_map P) _
  rw [← quotient_mk_maps_eq]
  refine ((Quotient.mk P').isIntegral_of_surjective Quotient.mk_surjective).trans _ _ ?_
  have : IsMaximal (map (mapRingHom (Quotient.mk (comap C P))) P)
  · exact Or.recOn (map_eq_top_or_isMaximal_of_surjective f hf hP)
      (fun h => absurd (_root_.trans (h ▸ hPJ : P = comap f ⊤) comap_top : P = ⊤) hP.ne_top) id
  apply quotient_mk_comp_C_isIntegral_of_jacobson' _ ?_ (fun x hx => ?_)
  any_goals 

Proof state:
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsJacobson R
P : Ideal R[X]
hP : IsMaximal P
P' : Ideal R := comap C P
this✝ : IsPrime P'
f : R[X] →+* (R ⧸ P')[X] := mapRingHom (Quotient.mk P')
hf : Function.Surjective ⇑f
hPJ : P = comap f (map f P)
this : IsMaximal (map (mapRingHom (Quotient.mk (comap C P))) P)
⊢ IsJacobson (R ⧸ P')

Next tactic:
exact Ideal.isJacobson_quotient