ring_theory.jacobsonMathlib.RingTheory.Jacobson

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -398,7 +398,7 @@ theorem isIntegral_isLocalization_polynomial_quotient (P : Ideal R[X]) (pX : R[X
         (fun _ _ h1 h2 => _) fun n _ hr => _
     · convert Subring.add_mem _ h1 h2
       rw [RingHom.map_add, RingHom.map_add]
-    · rw [pow_succ X n, mul_comm X, ← mul_assoc, RingHom.map_mul, RingHom.map_mul]
+    · rw [pow_succ' X n, mul_comm X, ← mul_assoc, RingHom.map_mul, RingHom.map_mul]
       exact Subring.mul_mem _ hr (Subring.subset_closure (Set.mem_image_of_mem _ (Or.inl rfl)))
 #align ideal.polynomial.is_integral_is_localization_polynomial_quotient Ideal.Polynomial.isIntegral_isLocalization_polynomial_quotient
 -/
Diff
@@ -81,8 +81,8 @@ theorem isJacobson_iff_prime_eq : IsJacobson R ↔ ∀ P : Ideal R, IsPrime P 
   refine' fun h I hI => le_antisymm (fun x hx => _) fun x hx => mem_Inf.mpr fun _ hJ => hJ.left hx
   rw [← hI.radical, radical_eq_Inf I, mem_Inf]
   intro P hP
-  rw [Set.mem_setOf_eq] at hP 
-  erw [mem_Inf] at hx 
+  rw [Set.mem_setOf_eq] at hP
+  erw [mem_Inf] at hx
   erw [← h P hP.right, mem_Inf]
   exact fun J hJ => hx ⟨le_trans hP.left hJ.left, hJ.right⟩
 #align ideal.is_jacobson_iff_prime_eq Ideal.isJacobson_iff_prime_eq
@@ -222,10 +222,10 @@ theorem isMaximal_iff_isMaximal_disjoint [H : IsJacobson R] (J : Ideal S) :
       ⟨_, fun hy =>
         h.ne_top (Ideal.eq_top_of_isUnit_mem _ hy (map_units _ ⟨y, Submonoid.mem_powers _⟩))⟩
     have hJ : J.is_prime := is_maximal.is_prime h
-    rw [is_prime_iff_is_prime_disjoint (Submonoid.powers y)] at hJ 
+    rw [is_prime_iff_is_prime_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.is_radical, mem_Inf] at this 
-    push_neg at this 
+    erw [← H.out hJ.left.is_radical, mem_Inf] at this
+    push_neg at this
     rcases this with ⟨I, hI, hI'⟩
     convert hI.right
     by_cases hJ : J = map (algebraMap R S) I
@@ -238,9 +238,9 @@ theorem isMaximal_iff_isMaximal_disjoint [H : IsJacobson R] (J : Ideal S) :
       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 
+    · 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 
+      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]
       exact map_mono hI'
@@ -309,7 +309,7 @@ theorem isJacobson_localization [H : IsJacobson R] : IsJacobson S :=
       by_cases y ∈ J
       · exact J.mul_mem_left x h
       · exact J.mul_mem_right y ((mem_Inf.1 hx) ⟨hJ.left, ⟨hJ.right, h⟩⟩)
-    rw [hP] at hxy 
+    rw [hP] at hxy
     cases' hP'.mem_or_mem hxy with hxy hxy
     · exact hxy
     · exact (hPM.le_bot ⟨Submonoid.mem_powers _, hxy⟩).elim
@@ -386,7 +386,7 @@ theorem isIntegral_isLocalization_polynomial_quotient (P : Ideal R[X]) (pX : R[X
           φ.is_integral_elem_localization_at_leading_coeff ((Quotient.mk' P) X)
             (pX.map (Quotient.mk' P')) _ M ⟨1, pow_one _⟩
       rwa [eval₂_map, hφ', ← hom_eval₂, quotient.eq_zero_iff_mem, eval₂_C_X]
-    · rw [Set.mem_setOf_eq, degree_le_zero_iff] at hy 
+    · rw [Set.mem_setOf_eq, degree_le_zero_iff] at hy
       refine' hy.symm ▸ ⟨X - C (algebraMap _ _ ((Quotient.mk' P') (p.coeff 0))), monic_X_sub_C _, _⟩
       simp only [eval₂_sub, eval₂_C, eval₂_X]
       rw [sub_eq_zero, ← φ'.comp_apply, IsLocalization.map_comp]
@@ -443,7 +443,7 @@ theorem jacobson_bot_of_integral_localization {R : Type _} [CommRing R] [IsDomai
   have := is_maximal_comap_of_is_integral_of_is_maximal' φ' hφ' I hI
   have := ((is_maximal_iff_is_maximal_disjoint Rₘ x _).1 this).left
   have : ((I.comap (algebraMap S Sₘ)).comap φ).IsMaximal := by
-    rwa [comap_comap, hcomm, ← comap_comap] at this 
+    rwa [comap_comap, hcomm, ← comap_comap] at this
   rw [← bot_quotient_is_maximal_iff] at this ⊢
   refine'
     is_maximal_of_is_integral_of_is_maximal_comap' f _ ⊥
@@ -492,8 +492,8 @@ theorem isJacobson_polynomial_of_isJacobson (hR : IsJacobson R) : IsJacobson R[X
     by
     refine' fun f hf => polynomial_mem_ideal_of_coeff_mem_ideal I f fun n => _
     replace hf := congr_arg (fun g : Polynomial ((Quotient.mk' I).comp C).range => g.Coeff n) hf
-    change (Polynomial.map ((Quotient.mk' I).comp C).range_restrict f).Coeff n = 0 at hf 
-    rw [coeff_map, Subtype.ext_iff] at hf 
+    change (Polynomial.map ((Quotient.mk' I).comp C).range_restrict f).Coeff n = 0 at hf
+    rw [coeff_map, Subtype.ext_iff] at hf
     rwa [mem_comap, ← quotient.eq_zero_iff_mem, ← RingHom.comp_apply]
   haveI :=
     map_is_prime_of_surjective (show Function.Surjective (map_ring_hom i) from map_surjective i hi)
@@ -502,7 +502,7 @@ theorem isJacobson_polynomial_of_isJacobson (hR : IsJacobson R) : IsJacobson R[X
     by
     replace this := congr_arg (comap (Polynomial.mapRingHom i)) this
     rw [← map_jacobson_of_surjective _ hi', comap_map_of_surjective _ _,
-      comap_map_of_surjective _ _] at this 
+      comap_map_of_surjective _ _] at this
     refine'
       le_antisymm
         (le_trans (le_sup_of_le_left le_rfl) (le_trans (le_of_eq this) (sup_le le_rfl hi')))
@@ -556,7 +556,7 @@ theorem isMaximal_comap_C_of_isMaximal [Nontrivial R] (hP' : ∀ x : R, C x ∈
       map_injective (Quotient.mk' (P.comap (C : R →+* R[X]) : Ideal R))
         ((injective_iff_map_eq_zero (Quotient.mk' (P.comap (C : R →+* R[X]) : Ideal R))).2
           fun x hx => by
-          rwa [quotient.eq_zero_iff_mem, (by rwa [eq_bot_iff] : (P.comap C : Ideal R) = ⊥)] at hx )
+          rwa [quotient.eq_zero_iff_mem, (by rwa [eq_bot_iff] : (P.comap C : Ideal R) = ⊥)] at hx)
         (by simpa only [leading_coeff_eq_zero, Polynomial.map_zero] using hp0')
   have hM : (0 : R ⧸ P.comap C) ∉ M := fun ⟨n, hn⟩ => hp0 (pow_eq_zero hn)
   suffices (⊥ : Ideal (Localization M)).IsMaximal
@@ -676,7 +676,7 @@ theorem comp_C_integral_of_surjective_of_jacobson {S : Type _} [Field S] (f : R[
     RingHom.IsIntegral.trans _ g (quotient_mk_comp_C_is_integral_of_jacobson f.ker)
       (g.is_integral_of_surjective _)
   --(quotient.lift_surjective f.ker f _ hf)),
-  rw [← hfg] at hf 
+  rw [← hfg] at hf
   exact Function.Surjective.of_comp hf
 #align ideal.polynomial.comp_C_integral_of_surjective_of_jacobson Ideal.Polynomial.comp_C_integral_of_surjective_of_jacobson
 -/
@@ -771,9 +771,9 @@ theorem comp_C_integral_of_surjective_of_jacobson {R : Type _} [CommRing R] [IsJ
     refine'
       RingHom.IsIntegral.trans _ g (quotient_mk_comp_C_is_integral_of_jacobson f'.ker)
         (g.is_integral_of_surjective _)
-    rw [← hfg] at hf' 
+    rw [← hfg] at hf'
     exact Function.Surjective.of_comp hf'
-  rw [RingHom.comp_assoc] at this 
+  rw [RingHom.comp_assoc] at this
   convert this
   refine' RingHom.ext fun x => _
   exact ((rename_equiv R e).commutes' x).symm
Diff
@@ -165,7 +165,7 @@ theorem isJacobson_of_isIntegral [Algebra R S] (hRS : Algebra.IsIntegral R S) (h
   · simp [comap_eq_top_iff.1 hP_top]
   · haveI : Nontrivial (R ⧸ comap (algebraMap R S) P) := quotient.nontrivial hP_top
     rw [jacobson_eq_iff_jacobson_quotient_eq_bot]
-    refine' eq_bot_of_comap_eq_bot (isIntegral_quotient_of_isIntegral hRS) _
+    refine' eq_bot_of_comap_eq_bot (Algebra.IsIntegral.quotient hRS) _
     rw [eq_bot_iff, ←
       jacobson_eq_iff_jacobson_quotient_eq_bot.1
         ((is_jacobson_iff_prime_eq.1 hR) (comap (algebraMap R S) P) (comap_is_prime _ _)),
@@ -174,7 +174,7 @@ theorem isJacobson_of_isIntegral [Algebra R S] (hRS : Algebra.IsIntegral R S) (h
     simp only [true_and_iff, Set.mem_image, bot_le, Set.mem_setOf_eq]
     have : J.is_maximal := by simpa using hJ
     exact
-      exists_ideal_over_maximal_of_is_integral (isIntegral_quotient_of_isIntegral hRS) J
+      exists_ideal_over_maximal_of_is_integral (Algebra.IsIntegral.quotient hRS) J
         (comap_bot_le_of_injective _ algebra_map_quotient_injective)
 #align ideal.is_jacobson_of_is_integral Ideal.isJacobson_of_isIntegral
 -/
@@ -377,7 +377,7 @@ theorem isIntegral_isLocalization_polynomial_quotient (P : Ideal R[X]) (pX : R[X
     convert trans (trans (φ'.map_mul _ _).symm (congr_arg φ' hq'')) φ'.map_one using 2
     rw [← φ'.comp_apply, IsLocalization.map_comp, RingHom.comp_apply, Subtype.coe_mk]
   refine'
-    isIntegral_of_mem_closure''
+    IsIntegral.of_mem_closure''
       ((algebraMap _ Sₘ).comp (Quotient.mk' P) '' insert X {p | p.degree ≤ 0}) _ _ _
   · rintro x ⟨p, hp, rfl⟩
     refine' hp.rec_on (fun hy => _) fun hy => _
@@ -451,11 +451,11 @@ theorem jacobson_bot_of_integral_localization {R : Type _} [CommRing R] [IsDomai
   exact
     f.is_integral_tower_bot_of_is_integral g quotient_map_injective
       ((comp_quotient_map_eq_of_comp_eq hcomm I).symm ▸
-        RingHom.isIntegral_trans _ _
+        RingHom.IsIntegral.trans _ _
           (RingHom.isIntegral_of_surjective _
             (IsLocalization.surjective_quotientMap_of_maximal_of_localization (Submonoid.powers x)
               Rₘ (by rwa [comap_comap, hcomm, ← bot_quotient_is_maximal_iff])))
-          (RingHom.isIntegral_quotient_of_isIntegral _ hφ'))
+          (RingHom.IsIntegral.quotient _ hφ'))
 #align ideal.polynomial.jacobson_bot_of_integral_localization Ideal.Polynomial.jacobson_bot_of_integral_localization
 -/
 
@@ -600,8 +600,7 @@ private theorem quotient_mk_comp_C_is_integral_of_jacobson' [Nontrivial R] (hR :
   haveI hp'_prime : P'.is_prime := comap_is_prime C P
   have hM : (0 : R ⧸ P') ∉ M := fun ⟨n, hn⟩ => hp0 <| leading_coeff_eq_zero.mp (pow_eq_zero hn)
   let M' : Submonoid (R[X] ⧸ P) := M.map (QuotientMap P C le_rfl)
-  refine'
-    (QuotientMap P C le_rfl).isIntegral_tower_bot_of_isIntegral (algebraMap _ (Localization M')) _ _
+  refine' (QuotientMap P C le_rfl).tower_bot (algebraMap _ (Localization M')) _ _
   · refine'
       IsLocalization.injective (Localization M')
         (show M' ≤ _ from le_nonZeroDivisors_of_noZeroDivisors fun hM' => hM _)
@@ -610,7 +609,7 @@ private theorem quotient_mk_comp_C_is_integral_of_jacobson' [Nontrivial R] (hR :
       quotient_map_injective (trans z0 φ.map_zero.symm) ▸ zM
   · rw [← IsLocalization.map_comp M.le_comap_map]
     refine'
-      RingHom.isIntegral_trans (algebraMap (R ⧸ P') (Localization M))
+      RingHom.IsIntegral.trans (algebraMap (R ⧸ P') (Localization M))
         (IsLocalization.map (Localization M') _ M.le_comap_map) _ _
     ·
       exact
@@ -638,10 +637,10 @@ theorem quotient_mk_comp_C_isIntegral_of_jacobson :
     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_map_ring_hom] using (polynomial.ext_iff.mp hp) n
-  refine' RingHom.isIntegral_tower_bot_of_isIntegral _ _ (injective_quotient_le_comap_map P) _
+  refine' RingHom.IsIntegral.tower_bot _ _ (injective_quotient_le_comap_map P) _
   rw [← quotient_mk_maps_eq]
   refine'
-    RingHom.isIntegral_trans _ _ ((Quotient.mk' P').isIntegral_of_surjective quotient.mk_surjective)
+    RingHom.IsIntegral.trans _ _ ((Quotient.mk' P').isIntegral_of_surjective quotient.mk_surjective)
       _
   apply quotient_mk_comp_C_is_integral_of_jacobson' _ _ fun x hx => _
   any_goals exact Ideal.isJacobson_quotient
@@ -674,7 +673,7 @@ theorem comp_C_integral_of_surjective_of_jacobson {S : Type _} [Field S] (f : R[
   have hfg : g.comp (Quotient.mk' f.ker) = f := ring_hom_ext' rfl rfl
   rw [← hfg, RingHom.comp_assoc]
   refine'
-    RingHom.isIntegral_trans _ g (quotient_mk_comp_C_is_integral_of_jacobson f.ker)
+    RingHom.IsIntegral.trans _ g (quotient_mk_comp_C_is_integral_of_jacobson f.ker)
       (g.is_integral_of_surjective _)
   --(quotient.lift_surjective f.ker f _ hf)),
   rw [← hfg] at hf 
@@ -732,9 +731,10 @@ theorem quotient_mk_comp_c_isIntegral_of_jacobson {R : Type _} [CommRing R] [IsJ
       quotient_map_comp_mk le_rfl, RingHom.comp_assoc Polynomial.C, ← quotient_map_comp_mk le_rfl,
       RingHom.comp_assoc, RingHom.comp_assoc, ← quotient_map_comp_mk le_rfl, ←
       RingHom.comp_assoc (Quotient.mk' _)]
-    refine' RingHom.isIntegral_trans _ _ _ _
-    · refine' RingHom.isIntegral_trans _ _ (isIntegral_of_surjective _ quotient.mk_surjective) _
-      refine' RingHom.isIntegral_trans _ _ _ _
+    refine' RingHom.IsIntegral.trans _ _ _ _
+    · refine'
+        RingHom.IsIntegral.trans _ _ (Algebra.isIntegral_of_surjective _ quotient.mk_surjective) _
+      refine' RingHom.IsIntegral.trans _ _ _ _
       · apply (isIntegral_quotientMap_iff _).mpr (IH _)
         apply polynomial.is_maximal_comap_C_of_is_jacobson _
         · exact mv_polynomial.is_jacobson_mv_polynomial_fin n
@@ -742,13 +742,14 @@ theorem quotient_mk_comp_c_isIntegral_of_jacobson {R : Type _} [CommRing R] [IsJ
           exact (finSuccEquiv R n).symm.Surjective
       · refine' (isIntegral_quotientMap_iff _).mpr _
         rw [← quotient_map_comp_mk le_rfl]
-        refine' RingHom.isIntegral_trans _ _ _ ((isIntegral_quotientMap_iff _).mpr _)
+        refine' RingHom.IsIntegral.trans _ _ _ ((isIntegral_quotientMap_iff _).mpr _)
         · exact RingHom.isIntegral_of_surjective _ quotient.mk_surjective
         · apply polynomial.quotient_mk_comp_C_is_integral_of_jacobson _
           · exact mv_polynomial.is_jacobson_mv_polynomial_fin n
           · exact comap_is_maximal_of_surjective _ (finSuccEquiv R n).symm.Surjective
     · refine' (isIntegral_quotientMap_iff _).mpr _
-      refine' RingHom.isIntegral_trans _ _ _ (isIntegral_of_surjective _ quotient.mk_surjective)
+      refine'
+        RingHom.IsIntegral.trans _ _ _ (Algebra.isIntegral_of_surjective _ quotient.mk_surjective)
       exact RingHom.isIntegral_of_surjective _ (finSuccEquiv R n).symm.Surjective
 #align ideal.mv_polynomial.quotient_mk_comp_C_is_integral_of_jacobson Ideal.MvPolynomial.quotient_mk_comp_c_isIntegral_of_jacobson
 
@@ -768,7 +769,7 @@ theorem comp_C_integral_of_surjective_of_jacobson {R : Type _} [CommRing R] [IsJ
     have hfg : g.comp (Quotient.mk' f'.ker) = f' := ring_hom_ext (fun r => rfl) fun i => rfl
     rw [← hfg, RingHom.comp_assoc]
     refine'
-      RingHom.isIntegral_trans _ g (quotient_mk_comp_C_is_integral_of_jacobson f'.ker)
+      RingHom.IsIntegral.trans _ g (quotient_mk_comp_C_is_integral_of_jacobson f'.ker)
         (g.is_integral_of_surjective _)
     rw [← hfg] at hf' 
     exact Function.Surjective.of_comp hf'
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2020 Devon Tuma. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Devon Tuma
 -/
-import Mathbin.RingTheory.Localization.Away.Basic
-import Mathbin.RingTheory.Ideal.Over
-import Mathbin.RingTheory.JacobsonIdeal
+import RingTheory.Localization.Away.Basic
+import RingTheory.Ideal.Over
+import RingTheory.JacobsonIdeal
 
 #align_import ring_theory.jacobson from "leanprover-community/mathlib"@"1a51edf13debfcbe223fa06b1cb353b9ed9751cc"
 
Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2020 Devon Tuma. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Devon Tuma
-
-! This file was ported from Lean 3 source module ring_theory.jacobson
-! leanprover-community/mathlib commit 1a51edf13debfcbe223fa06b1cb353b9ed9751cc
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.RingTheory.Localization.Away.Basic
 import Mathbin.RingTheory.Ideal.Over
 import Mathbin.RingTheory.JacobsonIdeal
 
+#align_import ring_theory.jacobson from "leanprover-community/mathlib"@"1a51edf13debfcbe223fa06b1cb353b9ed9751cc"
+
 /-!
 # Jacobson Rings
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Devon Tuma
 
 ! This file was ported from Lean 3 source module ring_theory.jacobson
-! leanprover-community/mathlib commit a7c017d750512a352b623b1824d75da5998457d0
+! leanprover-community/mathlib commit 1a51edf13debfcbe223fa06b1cb353b9ed9751cc
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,9 @@ import Mathbin.RingTheory.JacobsonIdeal
 
 /-!
 # Jacobson Rings
+
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
 The following conditions are equivalent for a ring `R`:
 1. Every radical ideal `I` is equal to its Jacobson radical
 2. Every radical ideal `I` can be written as an intersection of maximal ideals
Diff
@@ -49,23 +49,30 @@ section IsJacobson
 
 variable {R S : Type _} [CommRing R] [CommRing S] {I : Ideal R}
 
+#print Ideal.IsJacobson /-
 /-- A ring is a Jacobson ring if for every radical ideal `I`,
  the Jacobson radical of `I` is equal to `I`.
  See `is_jacobson_iff_prime_eq` and `is_jacobson_iff_Inf_maximal` for equivalent definitions. -/
 class IsJacobson (R : Type _) [CommRing R] : Prop where
   out' : ∀ I : Ideal R, I.IsRadical → I.jacobson = I
 #align ideal.is_jacobson Ideal.IsJacobson
+-/
 
+#print Ideal.isJacobson_iff /-
 theorem isJacobson_iff {R} [CommRing R] :
     IsJacobson R ↔ ∀ I : Ideal R, I.IsRadical → I.jacobson = I :=
   ⟨fun h => h.1, fun h => ⟨h⟩⟩
 #align ideal.is_jacobson_iff Ideal.isJacobson_iff
+-/
 
+#print Ideal.IsJacobson.out /-
 theorem IsJacobson.out {R} [CommRing R] :
     IsJacobson R → ∀ {I : Ideal R}, I.IsRadical → I.jacobson = I :=
   isJacobson_iff.1
 #align ideal.is_jacobson.out Ideal.IsJacobson.out
+-/
 
+#print Ideal.isJacobson_iff_prime_eq /-
 /-- A ring is a Jacobson ring if and only if for all prime ideals `P`,
  the Jacobson radical of `P` is equal to `P`. -/
 theorem isJacobson_iff_prime_eq : IsJacobson R ↔ ∀ P : Ideal R, IsPrime P → P.jacobson = P :=
@@ -79,7 +86,9 @@ theorem isJacobson_iff_prime_eq : IsJacobson R ↔ ∀ P : Ideal R, IsPrime P 
   erw [← h P hP.right, mem_Inf]
   exact fun J hJ => hx ⟨le_trans hP.left hJ.left, hJ.right⟩
 #align ideal.is_jacobson_iff_prime_eq Ideal.isJacobson_iff_prime_eq
+-/
 
+#print Ideal.isJacobson_iff_sInf_maximal /-
 /-- A ring `R` is Jacobson if and only if for every prime ideal `I`,
  `I` can be written as the infimum of some collection of maximal ideals.
  Allowing ⊤ in the set `M` of maximal ideals is equivalent, but makes some proofs cleaner. -/
@@ -90,7 +99,9 @@ theorem isJacobson_iff_sInf_maximal :
   ⟨fun H I h => eq_jacobson_iff_sInf_maximal.1 (H.out h.IsRadical), fun H =>
     isJacobson_iff_prime_eq.2 fun P hP => eq_jacobson_iff_sInf_maximal.2 (H hP)⟩
 #align ideal.is_jacobson_iff_Inf_maximal Ideal.isJacobson_iff_sInf_maximal
+-/
 
+#print Ideal.isJacobson_iff_sInf_maximal' /-
 theorem isJacobson_iff_sInf_maximal' :
     IsJacobson R ↔
       ∀ {I : Ideal R},
@@ -98,12 +109,16 @@ theorem isJacobson_iff_sInf_maximal' :
   ⟨fun H I h => eq_jacobson_iff_sInf_maximal'.1 (H.out h.IsRadical), fun H =>
     isJacobson_iff_prime_eq.2 fun P hP => eq_jacobson_iff_sInf_maximal'.2 (H hP)⟩
 #align ideal.is_jacobson_iff_Inf_maximal' Ideal.isJacobson_iff_sInf_maximal'
+-/
 
+#print Ideal.radical_eq_jacobson /-
 theorem radical_eq_jacobson [H : IsJacobson R] (I : Ideal R) : I.radical = I.jacobson :=
   le_antisymm (le_sInf fun J ⟨hJ, hJ_max⟩ => (IsPrime.radical_le_iff hJ_max.IsPrime).mpr hJ)
     (H.out (radical_isRadical I) ▸ jacobson_mono le_radical)
 #align ideal.radical_eq_jacobson Ideal.radical_eq_jacobson
+-/
 
+#print Ideal.isJacobson_field /-
 /-- Fields have only two ideals, and the condition holds for both of them.  -/
 instance (priority := 100) isJacobson_field {K : Type _} [Field K] : IsJacobson K :=
   ⟨fun I hI =>
@@ -111,7 +126,9 @@ instance (priority := 100) isJacobson_field {K : Type _} [Field K] : IsJacobson
       (fun h => le_antisymm (sInf_le ⟨le_rfl, h.symm ▸ bot_isMaximal⟩) (h.symm ▸ bot_le)) fun h =>
       by rw [h, jacobson_eq_top_iff]⟩
 #align ideal.is_jacobson_field Ideal.isJacobson_field
+-/
 
+#print Ideal.isJacobson_of_surjective /-
 theorem isJacobson_of_surjective [H : IsJacobson R] :
     (∃ f : R →+* S, Function.Surjective f) → IsJacobson S :=
   by
@@ -124,16 +141,22 @@ theorem isJacobson_of_surjective [H : IsJacobson R] :
     (is_jacobson.out' _ <| hp.is_radical.comap f).symm ▸ (map_comap_of_surjective f hf p).symm
   exact this.trans (map_Inf hf fun J ⟨hJ, _⟩ => le_trans (Ideal.ker_le_comap f) hJ)
 #align ideal.is_jacobson_of_surjective Ideal.isJacobson_of_surjective
+-/
 
+#print Ideal.isJacobson_quotient /-
 instance (priority := 100) isJacobson_quotient [IsJacobson R] : IsJacobson (R ⧸ I) :=
   isJacobson_of_surjective ⟨Quotient.mk I, by rintro ⟨x⟩ <;> use x <;> rfl⟩
 #align ideal.is_jacobson_quotient Ideal.isJacobson_quotient
+-/
 
+#print Ideal.isJacobson_iso /-
 theorem isJacobson_iso (e : R ≃+* S) : IsJacobson R ↔ IsJacobson S :=
   ⟨fun h => @isJacobson_of_surjective _ _ _ _ h ⟨(e : R →+* S), e.Surjective⟩, fun h =>
     @isJacobson_of_surjective _ _ _ _ h ⟨(e.symm : S →+* R), e.symm.Surjective⟩⟩
 #align ideal.is_jacobson_iso Ideal.isJacobson_iso
+-/
 
+#print Ideal.isJacobson_of_isIntegral /-
 theorem isJacobson_of_isIntegral [Algebra R S] (hRS : Algebra.IsIntegral R S) (hR : IsJacobson R) :
     IsJacobson S := by
   rw [is_jacobson_iff_prime_eq]
@@ -154,11 +177,14 @@ theorem isJacobson_of_isIntegral [Algebra R S] (hRS : Algebra.IsIntegral R S) (h
       exists_ideal_over_maximal_of_is_integral (isIntegral_quotient_of_isIntegral hRS) J
         (comap_bot_le_of_injective _ algebra_map_quotient_injective)
 #align ideal.is_jacobson_of_is_integral Ideal.isJacobson_of_isIntegral
+-/
 
-theorem isJacobson_of_is_integral' (f : R →+* S) (hf : f.IsIntegral) (hR : IsJacobson R) :
+#print Ideal.isJacobson_of_isIntegral' /-
+theorem isJacobson_of_isIntegral' (f : R →+* S) (hf : f.IsIntegral) (hR : IsJacobson R) :
     IsJacobson S :=
   @isJacobson_of_isIntegral _ _ _ _ f.toAlgebra hf hR
-#align ideal.is_jacobson_of_is_integral' Ideal.isJacobson_of_is_integral'
+#align ideal.is_jacobson_of_is_integral' Ideal.isJacobson_of_isIntegral'
+-/
 
 end IsJacobson
 
@@ -170,6 +196,7 @@ variable {R S : Type _} [CommRing R] [CommRing S] {I : Ideal R}
 
 variable (y : R) [Algebra R S] [IsLocalization.Away y S]
 
+#print Ideal.disjoint_powers_iff_not_mem /-
 theorem disjoint_powers_iff_not_mem (hI : I.IsRadical) :
     Disjoint (Submonoid.powers y : Set R) ↑I ↔ y ∉ I.1 :=
   by
@@ -178,9 +205,11 @@ theorem disjoint_powers_iff_not_mem (hI : I.IsRadical) :
   rintro x ⟨⟨n, rfl⟩, hx'⟩
   exact h (hI <| mem_radical_of_pow_mem <| le_radical hx')
 #align ideal.disjoint_powers_iff_not_mem Ideal.disjoint_powers_iff_not_mem
+-/
 
 variable (S)
 
+#print Ideal.isMaximal_iff_isMaximal_disjoint /-
 /-- 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.
@@ -216,9 +245,11 @@ theorem isMaximal_iff_isMaximal_disjoint [H : IsJacobson R] (J : Ideal S) :
       rw [← map_comap (powers y) S I, ← map_comap (powers y) S J]
       exact map_mono hI'
 #align ideal.is_maximal_iff_is_maximal_disjoint Ideal.isMaximal_iff_isMaximal_disjoint
+-/
 
 variable {S}
 
+#print Ideal.isMaximal_of_isMaximal_disjoint /-
 /-- 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.
@@ -231,7 +262,9 @@ theorem isMaximal_of_isMaximal_disjoint [IsJacobson R] (I : Ideal R) (hI : I.IsM
       ((disjoint_powers_iff_not_mem y hI.is_prime.is_radical).2 hy)]
   exact ⟨hI, hy⟩
 #align ideal.is_maximal_of_is_maximal_disjoint Ideal.isMaximal_of_isMaximal_disjoint
+-/
 
+#print Ideal.orderIsoOfMaximal /-
 /-- 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` -/
 def orderIsoOfMaximal [IsJacobson R] :
@@ -250,7 +283,9 @@ def orderIsoOfMaximal [IsJacobson R] :
         map_comap (powers y) S I.val ▸ map_comap (powers y) S I'.val ▸ Ideal.map_mono h,
       fun h x hx => h hx⟩
 #align ideal.order_iso_of_maximal Ideal.orderIsoOfMaximal
+-/
 
+#print Ideal.isJacobson_localization /-
 /-- 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 :=
@@ -290,6 +325,7 @@ theorem isJacobson_localization [H : IsJacobson R] : IsJacobson S :=
       IsLocalization.comap_map_of_isPrime_disjoint _ S I (is_maximal.is_prime hI.2.1)
         ((disjoint_powers_iff_not_mem y hI.2.1.IsPrime.IsRadical).2 hI.2.2)
 #align ideal.is_jacobson_localization Ideal.isJacobson_localization
+-/
 
 end Localization
 
@@ -303,6 +339,7 @@ variable {R S : Type _} [CommRing R] [CommRing S] [IsDomain S]
 
 variable {Rₘ Sₘ : Type _} [CommRing Rₘ] [CommRing Sₘ]
 
+#print Ideal.Polynomial.isIntegral_isLocalization_polynomial_quotient /-
 /-- If `I` is a prime ideal of `R[X]` and `pX ∈ I` is a non-constant polynomial,
   then the map `R →+* R[x]/I` descends to an integral map when localizing at `pX.leading_coeff`.
   In particular `X` is integral because it satisfies `pX`, and constants are trivially integral,
@@ -340,7 +377,7 @@ theorem isIntegral_isLocalization_polynomial_quotient (P : Ideal R[X]) (pX : R[X
     convert trans (trans (φ'.map_mul _ _).symm (congr_arg φ' hq'')) φ'.map_one using 2
     rw [← φ'.comp_apply, IsLocalization.map_comp, RingHom.comp_apply, Subtype.coe_mk]
   refine'
-    is_integral_of_mem_closure''
+    isIntegral_of_mem_closure''
       ((algebraMap _ Sₘ).comp (Quotient.mk' P) '' insert X {p | p.degree ≤ 0}) _ _ _
   · rintro x ⟨p, hp, rfl⟩
     refine' hp.rec_on (fun hy => _) fun hy => _
@@ -364,7 +401,9 @@ theorem isIntegral_isLocalization_polynomial_quotient (P : Ideal R[X]) (pX : R[X
     · rw [pow_succ X n, mul_comm X, ← mul_assoc, RingHom.map_mul, RingHom.map_mul]
       exact Subring.mul_mem _ hr (Subring.subset_closure (Set.mem_image_of_mem _ (Or.inl rfl)))
 #align ideal.polynomial.is_integral_is_localization_polynomial_quotient Ideal.Polynomial.isIntegral_isLocalization_polynomial_quotient
+-/
 
+#print Ideal.Polynomial.jacobson_bot_of_integral_localization /-
 /-- 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]
@@ -418,6 +457,7 @@ theorem jacobson_bot_of_integral_localization {R : Type _} [CommRing R] [IsDomai
               Rₘ (by rwa [comap_comap, hcomm, ← bot_quotient_is_maximal_iff])))
           (RingHom.isIntegral_quotient_of_isIntegral _ hφ'))
 #align ideal.polynomial.jacobson_bot_of_integral_localization Ideal.Polynomial.jacobson_bot_of_integral_localization
+-/
 
 /-- Used to bootstrap the proof of `is_jacobson_polynomial_iff_is_jacobson`.
   That theorem is more general and should be used instead of this one. -/
@@ -440,6 +480,7 @@ private theorem is_jacobson_polynomial_of_domain (R : Type _) [CommRing R] [IsDo
     -- `convert` is noticeably faster than `exact` here:
     convert is_integral_is_localization_polynomial_quotient P p pP
 
+#print Ideal.Polynomial.isJacobson_polynomial_of_isJacobson /-
 theorem isJacobson_polynomial_of_isJacobson (hR : IsJacobson R) : IsJacobson R[X] :=
   by
   refine' is_jacobson_iff_prime_eq.mpr fun I => _
@@ -471,7 +512,9 @@ theorem isJacobson_polynomial_of_isJacobson (hR : IsJacobson R) : IsJacobson R[X
     @is_jacobson_polynomial_of_domain R' _ _ (is_jacobson_of_surjective ⟨i, hi⟩)
       (map (map_ring_hom i) I) _ (eq_zero_of_polynomial_mem_map_range I)
 #align ideal.polynomial.is_jacobson_polynomial_of_is_jacobson Ideal.Polynomial.isJacobson_polynomial_of_isJacobson
+-/
 
+#print Ideal.Polynomial.isJacobson_polynomial_iff_isJacobson /-
 theorem isJacobson_polynomial_iff_isJacobson : IsJacobson R[X] ↔ IsJacobson R :=
   by
   refine' ⟨_, is_jacobson_polynomial_of_is_jacobson⟩
@@ -481,6 +524,7 @@ theorem isJacobson_polynomial_iff_isJacobson : IsJacobson R[X] ↔ IsJacobson R
       ⟨eval₂_ring_hom (RingHom.id _) 1, fun x =>
         ⟨C x, by simp only [coe_eval₂_ring_hom, RingHom.id_apply, eval₂_C]⟩⟩
 #align ideal.polynomial.is_jacobson_polynomial_iff_is_jacobson Ideal.Polynomial.isJacobson_polynomial_iff_isJacobson
+-/
 
 instance [IsJacobson R] : IsJacobson R[X] :=
   isJacobson_polynomial_iff_isJacobson.mpr ‹IsJacobson R›
@@ -493,7 +537,8 @@ variable {R : Type _} [CommRing R] [IsJacobson R]
 
 variable (P : Ideal R[X]) [hP : P.IsMaximal]
 
-theorem isMaximal_comap_c_of_isMaximal [Nontrivial R] (hP' : ∀ x : R, C x ∈ P → x = 0) :
+#print Ideal.Polynomial.isMaximal_comap_C_of_isMaximal /-
+theorem isMaximal_comap_C_of_isMaximal [Nontrivial R] (hP' : ∀ x : R, C x ∈ P → x = 0) :
     IsMaximal (comap (C : R →+* R[X]) P : Ideal R) :=
   by
   haveI hp'_prime : (P.comap (C : R →+* R[X]) : Ideal R).IsPrime := comap_is_prime C P
@@ -539,7 +584,8 @@ theorem isMaximal_comap_c_of_isMaximal [Nontrivial R] (hP' : ∀ x : R, C x ∈
   let bot_maximal := (bot_quotient_is_maximal_iff _).mpr hP
   refine' map.is_maximal (algebraMap _ _) (IsField.localization_map_bijective hM' _) bot_maximal
   rwa [← quotient.maximal_ideal_iff_is_field_quotient, ← bot_quotient_is_maximal_iff]
-#align ideal.polynomial.is_maximal_comap_C_of_is_maximal Ideal.Polynomial.isMaximal_comap_c_of_isMaximal
+#align ideal.polynomial.is_maximal_comap_C_of_is_maximal Ideal.Polynomial.isMaximal_comap_C_of_isMaximal
+-/
 
 /-- Used to bootstrap the more general `quotient_mk_comp_C_is_integral_of_jacobson` -/
 private theorem quotient_mk_comp_C_is_integral_of_jacobson' [Nontrivial R] (hR : IsJacobson R)
@@ -575,9 +621,10 @@ private theorem quotient_mk_comp_C_is_integral_of_jacobson' [Nontrivial R] (hR :
     ·-- `convert` here is faster than `exact`, and this proof is near the time limit.
       convert is_integral_is_localization_polynomial_quotient P pX hpX
 
+#print Ideal.Polynomial.quotient_mk_comp_C_isIntegral_of_jacobson /-
 /-- 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 :
+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
@@ -605,17 +652,21 @@ theorem quotient_mk_comp_c_isIntegral_of_jacobson :
   · infer_instance
   · obtain ⟨z, rfl⟩ := quotient.mk_surjective x
     rwa [quotient.eq_zero_iff_mem, mem_comap, hPJ, mem_comap, coe_map_ring_hom, map_C]
-#align ideal.polynomial.quotient_mk_comp_C_is_integral_of_jacobson Ideal.Polynomial.quotient_mk_comp_c_isIntegral_of_jacobson
+#align ideal.polynomial.quotient_mk_comp_C_is_integral_of_jacobson Ideal.Polynomial.quotient_mk_comp_C_isIntegral_of_jacobson
+-/
 
-theorem isMaximal_comap_c_of_isJacobson : (P.comap (C : R →+* R[X])).IsMaximal :=
+#print Ideal.Polynomial.isMaximal_comap_C_of_isJacobson /-
+theorem isMaximal_comap_C_of_isJacobson : (P.comap (C : R →+* R[X])).IsMaximal :=
   by
   rw [← @mk_ker _ _ P, RingHom.ker_eq_comap_bot, comap_comap]
   exact
     is_maximal_comap_of_is_integral_of_is_maximal' _ (quotient_mk_comp_C_is_integral_of_jacobson P)
       ⊥ ((bot_quotient_is_maximal_iff _).mpr hP)
-#align ideal.polynomial.is_maximal_comap_C_of_is_jacobson Ideal.Polynomial.isMaximal_comap_c_of_isJacobson
+#align ideal.polynomial.is_maximal_comap_C_of_is_jacobson Ideal.Polynomial.isMaximal_comap_C_of_isJacobson
+-/
 
-theorem comp_c_integral_of_surjective_of_jacobson {S : Type _} [Field S] (f : R[X] →+* S)
+#print Ideal.Polynomial.comp_C_integral_of_surjective_of_jacobson /-
+theorem comp_C_integral_of_surjective_of_jacobson {S : Type _} [Field S] (f : R[X] →+* S)
     (hf : Function.Surjective f) : (f.comp C).IsIntegral :=
   by
   haveI : f.ker.IsMaximal := RingHom.ker_isMaximal_of_surjective f hf
@@ -628,7 +679,8 @@ theorem comp_c_integral_of_surjective_of_jacobson {S : Type _} [Field S] (f : R[
   --(quotient.lift_surjective f.ker f _ hf)),
   rw [← hfg] at hf 
   exact Function.Surjective.of_comp hf
-#align ideal.polynomial.comp_C_integral_of_surjective_of_jacobson Ideal.Polynomial.comp_c_integral_of_surjective_of_jacobson
+#align ideal.polynomial.comp_C_integral_of_surjective_of_jacobson Ideal.Polynomial.comp_C_integral_of_surjective_of_jacobson
+-/
 
 end
 
@@ -638,7 +690,8 @@ open MvPolynomial RingHom
 
 namespace MvPolynomial
 
-theorem isJacobson_mvPolynomial_fin {R : Type _} [CommRing R] [H : IsJacobson R] :
+#print Ideal.MvPolynomial.isJacobson_MvPolynomial_fin /-
+theorem isJacobson_MvPolynomial_fin {R : Type _} [CommRing R] [H : IsJacobson R] :
     ∀ n : ℕ, IsJacobson (MvPolynomial (Fin n) R)
   | 0 =>
     (isJacobson_iso
@@ -648,8 +701,10 @@ theorem isJacobson_mvPolynomial_fin {R : Type _} [CommRing R] [H : IsJacobson R]
   | n + 1 =>
     (isJacobson_iso (finSuccEquiv R n).toRingEquiv).2
       (Polynomial.isJacobson_polynomial_iff_isJacobson.2 (is_jacobson_mv_polynomial_fin n))
-#align ideal.mv_polynomial.is_jacobson_mv_polynomial_fin Ideal.MvPolynomial.isJacobson_mvPolynomial_fin
+#align ideal.mv_polynomial.is_jacobson_mv_polynomial_fin Ideal.MvPolynomial.isJacobson_MvPolynomial_fin
+-/
 
+#print Ideal.MvPolynomial.isJacobson /-
 /-- General form of the nullstellensatz for Jacobson rings, since in a Jacobson ring we have
   `Inf {P maximal | P ≥ I} = Inf {P prime | P ≥ I} = I.radical`. Fields are always Jacobson,
   and in that special case this is (most of) the classical Nullstellensatz,
@@ -662,6 +717,7 @@ instance isJacobson {R : Type _} [CommRing R] {ι : Type _} [Finite ι] [IsJacob
   rw [is_jacobson_iso (rename_equiv R e).toRingEquiv]
   exact is_jacobson_mv_polynomial_fin _
 #align ideal.mv_polynomial.is_jacobson Ideal.MvPolynomial.isJacobson
+-/
 
 variable {n : ℕ}
 
@@ -696,7 +752,8 @@ theorem quotient_mk_comp_c_isIntegral_of_jacobson {R : Type _} [CommRing R] [IsJ
       exact RingHom.isIntegral_of_surjective _ (finSuccEquiv R n).symm.Surjective
 #align ideal.mv_polynomial.quotient_mk_comp_C_is_integral_of_jacobson Ideal.MvPolynomial.quotient_mk_comp_c_isIntegral_of_jacobson
 
-theorem comp_c_integral_of_surjective_of_jacobson {R : Type _} [CommRing R] [IsJacobson R]
+#print Ideal.MvPolynomial.comp_C_integral_of_surjective_of_jacobson /-
+theorem comp_C_integral_of_surjective_of_jacobson {R : Type _} [CommRing R] [IsJacobson R]
     {σ : Type _} [Finite σ] {S : Type _} [Field S] (f : MvPolynomial σ R →+* S)
     (hf : Function.Surjective f) : (f.comp C).IsIntegral :=
   by
@@ -719,7 +776,8 @@ theorem comp_c_integral_of_surjective_of_jacobson {R : Type _} [CommRing R] [IsJ
   convert this
   refine' RingHom.ext fun x => _
   exact ((rename_equiv R e).commutes' x).symm
-#align ideal.mv_polynomial.comp_C_integral_of_surjective_of_jacobson Ideal.MvPolynomial.comp_c_integral_of_surjective_of_jacobson
+#align ideal.mv_polynomial.comp_C_integral_of_surjective_of_jacobson Ideal.MvPolynomial.comp_C_integral_of_surjective_of_jacobson
+-/
 
 end MvPolynomial
 
Diff
@@ -251,8 +251,6 @@ def orderIsoOfMaximal [IsJacobson R] :
       fun h x hx => h hx⟩
 #align ideal.order_iso_of_maximal Ideal.orderIsoOfMaximal
 
-include y
-
 /-- 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 :=
@@ -495,8 +493,6 @@ variable {R : Type _} [CommRing R] [IsJacobson R]
 
 variable (P : Ideal R[X]) [hP : P.IsMaximal]
 
-include P hP
-
 theorem isMaximal_comap_c_of_isMaximal [Nontrivial R] (hP' : ∀ x : R, C x ∈ P → x = 0) :
     IsMaximal (comap (C : R →+* R[X]) P : Ideal R) :=
   by
@@ -619,8 +615,6 @@ theorem isMaximal_comap_c_of_isJacobson : (P.comap (C : R →+* R[X])).IsMaximal
       ⊥ ((bot_quotient_is_maximal_iff _).mpr hP)
 #align ideal.polynomial.is_maximal_comap_C_of_is_jacobson Ideal.Polynomial.isMaximal_comap_c_of_isJacobson
 
-omit P hP
-
 theorem comp_c_integral_of_surjective_of_jacobson {S : Type _} [Field S] (f : R[X] →+* S)
     (hf : Function.Surjective f) : (f.comp C).IsIntegral :=
   by
Diff
@@ -118,7 +118,7 @@ theorem isJacobson_of_surjective [H : IsJacobson R] :
   rintro ⟨f, hf⟩
   rw [is_jacobson_iff_Inf_maximal]
   intro p hp
-  use map f '' { J : Ideal R | comap f p ≤ J ∧ J.IsMaximal }
+  use map f '' {J : Ideal R | comap f p ≤ J ∧ J.IsMaximal}
   use fun j ⟨J, hJ, hmap⟩ => hmap ▸ (map_eq_top_or_is_maximal_of_surjective f hf hJ.right).symm
   have : p = map f (comap f p).jacobson :=
     (is_jacobson.out' _ <| hp.is_radical.comap f).symm ▸ (map_comap_of_surjective f hf p).symm
@@ -196,7 +196,7 @@ theorem isMaximal_iff_isMaximal_disjoint [H : IsJacobson R] (J : Ideal S) :
     rw [is_prime_iff_is_prime_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.is_radical, mem_Inf] at this 
-    push_neg  at this 
+    push_neg at this 
     rcases this with ⟨I, hI, hI'⟩
     convert hI.right
     by_cases hJ : J = map (algebraMap R S) I
@@ -265,7 +265,7 @@ theorem isJacobson_localization [H : IsJacobson R] : IsJacobson S :=
     (IsLocalization.map_comap (powers y) S P'.jacobson).ge.trans
       ((map_mono _).trans (IsLocalization.map_comap (powers y) S P').le)
   have :
-    Inf { I : Ideal R | comap (algebraMap R S) P' ≤ I ∧ I.IsMaximal ∧ y ∉ I } ≤
+    Inf {I : Ideal R | comap (algebraMap R S) P' ≤ I ∧ I.IsMaximal ∧ y ∉ I} ≤
       comap (algebraMap R S) P' :=
     by
     intro x hx
@@ -343,7 +343,7 @@ theorem isIntegral_isLocalization_polynomial_quotient (P : Ideal R[X]) (pX : R[X
     rw [← φ'.comp_apply, IsLocalization.map_comp, RingHom.comp_apply, Subtype.coe_mk]
   refine'
     is_integral_of_mem_closure''
-      ((algebraMap _ Sₘ).comp (Quotient.mk' P) '' insert X { p | p.degree ≤ 0 }) _ _ _
+      ((algebraMap _ Sₘ).comp (Quotient.mk' P) '' insert X {p | p.degree ≤ 0}) _ _ _
   · rintro x ⟨p, hp, rfl⟩
     refine' hp.rec_on (fun hy => _) fun hy => _
     · refine'
Diff
@@ -74,8 +74,8 @@ theorem isJacobson_iff_prime_eq : IsJacobson R ↔ ∀ P : Ideal R, IsPrime P 
   refine' fun h I hI => le_antisymm (fun x hx => _) fun x hx => mem_Inf.mpr fun _ hJ => hJ.left hx
   rw [← hI.radical, radical_eq_Inf I, mem_Inf]
   intro P hP
-  rw [Set.mem_setOf_eq] at hP
-  erw [mem_Inf] at hx
+  rw [Set.mem_setOf_eq] at hP 
+  erw [mem_Inf] at hx 
   erw [← h P hP.right, mem_Inf]
   exact fun J hJ => hx ⟨le_trans hP.left hJ.left, hJ.right⟩
 #align ideal.is_jacobson_iff_prime_eq Ideal.isJacobson_iff_prime_eq
@@ -193,10 +193,10 @@ theorem isMaximal_iff_isMaximal_disjoint [H : IsJacobson R] (J : Ideal S) :
       ⟨_, fun hy =>
         h.ne_top (Ideal.eq_top_of_isUnit_mem _ hy (map_units _ ⟨y, Submonoid.mem_powers _⟩))⟩
     have hJ : J.is_prime := is_maximal.is_prime h
-    rw [is_prime_iff_is_prime_disjoint (Submonoid.powers y)] at hJ
+    rw [is_prime_iff_is_prime_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.is_radical, mem_Inf] at this
-    push_neg  at this
+    erw [← H.out hJ.left.is_radical, mem_Inf] at this 
+    push_neg  at this 
     rcases this with ⟨I, hI, hI'⟩
     convert hI.right
     by_cases hJ : J = map (algebraMap R S) I
@@ -209,9 +209,9 @@ theorem isMaximal_iff_isMaximal_disjoint [H : IsJacobson R] (J : Ideal S) :
       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
+    · 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
+      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]
       exact map_mono hI'
@@ -276,7 +276,7 @@ theorem isJacobson_localization [H : IsJacobson R] : IsJacobson S :=
       by_cases y ∈ J
       · exact J.mul_mem_left x h
       · exact J.mul_mem_right y ((mem_Inf.1 hx) ⟨hJ.left, ⟨hJ.right, h⟩⟩)
-    rw [hP] at hxy
+    rw [hP] at hxy 
     cases' hP'.mem_or_mem hxy with hxy hxy
     · exact hxy
     · exact (hPM.le_bot ⟨Submonoid.mem_powers _, hxy⟩).elim
@@ -351,7 +351,7 @@ theorem isIntegral_isLocalization_polynomial_quotient (P : Ideal R[X]) (pX : R[X
           φ.is_integral_elem_localization_at_leading_coeff ((Quotient.mk' P) X)
             (pX.map (Quotient.mk' P')) _ M ⟨1, pow_one _⟩
       rwa [eval₂_map, hφ', ← hom_eval₂, quotient.eq_zero_iff_mem, eval₂_C_X]
-    · rw [Set.mem_setOf_eq, degree_le_zero_iff] at hy
+    · rw [Set.mem_setOf_eq, degree_le_zero_iff] at hy 
       refine' hy.symm ▸ ⟨X - C (algebraMap _ _ ((Quotient.mk' P') (p.coeff 0))), monic_X_sub_C _, _⟩
       simp only [eval₂_sub, eval₂_C, eval₂_X]
       rw [sub_eq_zero, ← φ'.comp_apply, IsLocalization.map_comp]
@@ -406,8 +406,8 @@ theorem jacobson_bot_of_integral_localization {R : Type _} [CommRing R] [IsDomai
   have := is_maximal_comap_of_is_integral_of_is_maximal' φ' hφ' I hI
   have := ((is_maximal_iff_is_maximal_disjoint Rₘ x _).1 this).left
   have : ((I.comap (algebraMap S Sₘ)).comap φ).IsMaximal := by
-    rwa [comap_comap, hcomm, ← comap_comap] at this
-  rw [← bot_quotient_is_maximal_iff] at this⊢
+    rwa [comap_comap, hcomm, ← comap_comap] at this 
+  rw [← bot_quotient_is_maximal_iff] at this ⊢
   refine'
     is_maximal_of_is_integral_of_is_maximal_comap' f _ ⊥
       ((eq_bot_iff.2 (comap_bot_le_of_injective f quotient_map_injective)).symm ▸ this)
@@ -453,8 +453,8 @@ theorem isJacobson_polynomial_of_isJacobson (hR : IsJacobson R) : IsJacobson R[X
     by
     refine' fun f hf => polynomial_mem_ideal_of_coeff_mem_ideal I f fun n => _
     replace hf := congr_arg (fun g : Polynomial ((Quotient.mk' I).comp C).range => g.Coeff n) hf
-    change (Polynomial.map ((Quotient.mk' I).comp C).range_restrict f).Coeff n = 0 at hf
-    rw [coeff_map, Subtype.ext_iff] at hf
+    change (Polynomial.map ((Quotient.mk' I).comp C).range_restrict f).Coeff n = 0 at hf 
+    rw [coeff_map, Subtype.ext_iff] at hf 
     rwa [mem_comap, ← quotient.eq_zero_iff_mem, ← RingHom.comp_apply]
   haveI :=
     map_is_prime_of_surjective (show Function.Surjective (map_ring_hom i) from map_surjective i hi)
@@ -463,7 +463,7 @@ theorem isJacobson_polynomial_of_isJacobson (hR : IsJacobson R) : IsJacobson R[X
     by
     replace this := congr_arg (comap (Polynomial.mapRingHom i)) this
     rw [← map_jacobson_of_surjective _ hi', comap_map_of_surjective _ _,
-      comap_map_of_surjective _ _] at this
+      comap_map_of_surjective _ _] at this 
     refine'
       le_antisymm
         (le_trans (le_sup_of_le_left le_rfl) (le_trans (le_of_eq this) (sup_le le_rfl hi')))
@@ -515,7 +515,7 @@ theorem isMaximal_comap_c_of_isMaximal [Nontrivial R] (hP' : ∀ x : R, C x ∈
       map_injective (Quotient.mk' (P.comap (C : R →+* R[X]) : Ideal R))
         ((injective_iff_map_eq_zero (Quotient.mk' (P.comap (C : R →+* R[X]) : Ideal R))).2
           fun x hx => by
-          rwa [quotient.eq_zero_iff_mem, (by rwa [eq_bot_iff] : (P.comap C : Ideal R) = ⊥)] at hx)
+          rwa [quotient.eq_zero_iff_mem, (by rwa [eq_bot_iff] : (P.comap C : Ideal R) = ⊥)] at hx )
         (by simpa only [leading_coeff_eq_zero, Polynomial.map_zero] using hp0')
   have hM : (0 : R ⧸ P.comap C) ∉ M := fun ⟨n, hn⟩ => hp0 (pow_eq_zero hn)
   suffices (⊥ : Ideal (Localization M)).IsMaximal
@@ -632,7 +632,7 @@ theorem comp_c_integral_of_surjective_of_jacobson {S : Type _} [Field S] (f : R[
     RingHom.isIntegral_trans _ g (quotient_mk_comp_C_is_integral_of_jacobson f.ker)
       (g.is_integral_of_surjective _)
   --(quotient.lift_surjective f.ker f _ hf)),
-  rw [← hfg] at hf
+  rw [← hfg] at hf 
   exact Function.Surjective.of_comp hf
 #align ideal.polynomial.comp_C_integral_of_surjective_of_jacobson Ideal.Polynomial.comp_c_integral_of_surjective_of_jacobson
 
@@ -719,9 +719,9 @@ theorem comp_c_integral_of_surjective_of_jacobson {R : Type _} [CommRing R] [IsJ
     refine'
       RingHom.isIntegral_trans _ g (quotient_mk_comp_C_is_integral_of_jacobson f'.ker)
         (g.is_integral_of_surjective _)
-    rw [← hfg] at hf'
+    rw [← hfg] at hf' 
     exact Function.Surjective.of_comp hf'
-  rw [RingHom.comp_assoc] at this
+  rw [RingHom.comp_assoc] at this 
   convert this
   refine' RingHom.ext fun x => _
   exact ((rename_equiv R e).commutes' x).symm
Diff
@@ -43,7 +43,7 @@ namespace Ideal
 
 open Polynomial
 
-open Polynomial
+open scoped Polynomial
 
 section IsJacobson
 
Diff
@@ -502,8 +502,7 @@ theorem isMaximal_comap_c_of_isMaximal [Nontrivial R] (hP' : ∀ x : R, C x ∈
   by
   haveI hp'_prime : (P.comap (C : R →+* R[X]) : Ideal R).IsPrime := comap_is_prime C P
   obtain ⟨m, hm⟩ := Submodule.nonzero_mem_of_bot_lt (bot_lt_of_maximal P polynomial_not_is_field)
-  have : (m : R[X]) ≠ 0
-  rwa [Ne.def, Submodule.coe_eq_zero]
+  have : (m : R[X]) ≠ 0; rwa [Ne.def, Submodule.coe_eq_zero]
   let φ : R ⧸ P.comap (C : R →+* R[X]) →+* R[X] ⧸ P := QuotientMap P (C : R →+* R[X]) le_rfl
   let M : Submonoid (R ⧸ P.comap C) :=
     Submonoid.powers
@@ -525,8 +524,7 @@ theorem isMaximal_comap_c_of_isMaximal [Nontrivial R] (hP' : ∀ x : R, C x ∈
       IsLocalization.comap_map_of_isPrime_disjoint M (Localization M) ⊥ bot_prime
         (disjoint_iff_inf_le.mpr fun x hx => hM (hx.2 ▸ hx.1))]
     refine' ((is_maximal_iff_is_maximal_disjoint (Localization M) _ _).mp (by rwa [map_bot])).1
-    swap
-    exact Localization.isLocalization
+    swap; exact Localization.isLocalization
   let M' : Submonoid (R[X] ⧸ P) := M.map φ
   have hM' : (0 : R[X] ⧸ P) ∉ M' := fun ⟨z, hz⟩ =>
     hM (quotient_map_injective (trans hz.2 φ.map_zero.symm) ▸ hz.1)
Diff
@@ -441,7 +441,6 @@ private theorem is_jacobson_polynomial_of_domain (R : Type _) [CommRing R] [IsDo
         (QuotientMap P C le_rfl) quotient_map_injective x hx _
     -- `convert` is noticeably faster than `exact` here:
     convert is_integral_is_localization_polynomial_quotient P p pP
-#align ideal.polynomial.is_jacobson_polynomial_of_domain ideal.polynomial.is_jacobson_polynomial_of_domain
 
 theorem isJacobson_polynomial_of_isJacobson (hR : IsJacobson R) : IsJacobson R[X] :=
   by
@@ -581,7 +580,6 @@ private theorem quotient_mk_comp_C_is_integral_of_jacobson' [Nontrivial R] (hR :
                 (is_maximal_comap_C_of_is_maximal P hP'))).2
     ·-- `convert` here is faster than `exact`, and this proof is near the time limit.
       convert is_integral_is_localization_polynomial_quotient P pX hpX
-#align ideal.polynomial.quotient_mk_comp_C_is_integral_of_jacobson' ideal.polynomial.quotient_mk_comp_C_is_integral_of_jacobson'
 
 /-- If `R` is a Jacobson ring, and `P` is a maximal ideal of `R[X]`,
   then `R → R[X]/P` is an integral map. -/
Diff
@@ -4,11 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Devon Tuma
 
 ! This file was ported from Lean 3 source module ring_theory.jacobson
-! leanprover-community/mathlib commit 6ca1a09bc9aa75824bf97388c9e3b441fc4ccf3f
+! leanprover-community/mathlib commit a7c017d750512a352b623b1824d75da5998457d0
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
-import Mathbin.RingTheory.Localization.Away
+import Mathbin.RingTheory.Localization.Away.Basic
 import Mathbin.RingTheory.Ideal.Over
 import Mathbin.RingTheory.JacobsonIdeal
 
@@ -453,8 +453,8 @@ theorem isJacobson_polynomial_of_isJacobson (hR : IsJacobson R) : IsJacobson R[X
   have hi' : (Polynomial.mapRingHom i : R[X] →+* R'[X]).ker ≤ I :=
     by
     refine' fun f hf => polynomial_mem_ideal_of_coeff_mem_ideal I f fun n => _
-    replace hf := congr_arg (fun g : Polynomial ((Quotient.mk' I).comp C).range => g.coeff n) hf
-    change (Polynomial.map ((Quotient.mk' I).comp C).range_restrict f).coeff n = 0 at hf
+    replace hf := congr_arg (fun g : Polynomial ((Quotient.mk' I).comp C).range => g.Coeff n) hf
+    change (Polynomial.map ((Quotient.mk' I).comp C).range_restrict f).Coeff n = 0 at hf
     rw [coeff_map, Subtype.ext_iff] at hf
     rwa [mem_comap, ← quotient.eq_zero_iff_mem, ← RingHom.comp_apply]
   haveI :=
Diff
@@ -83,24 +83,24 @@ theorem isJacobson_iff_prime_eq : IsJacobson R ↔ ∀ P : Ideal R, IsPrime P 
 /-- A ring `R` is Jacobson if and only if for every prime ideal `I`,
  `I` can be written as the infimum of some collection of maximal ideals.
  Allowing ⊤ in the set `M` of maximal ideals is equivalent, but makes some proofs cleaner. -/
-theorem isJacobson_iff_infₛ_maximal :
+theorem isJacobson_iff_sInf_maximal :
     IsJacobson R ↔
       ∀ {I : Ideal R},
-        I.IsPrime → ∃ M : Set (Ideal R), (∀ J ∈ M, IsMaximal J ∨ J = ⊤) ∧ I = infₛ M :=
-  ⟨fun H I h => eq_jacobson_iff_infₛ_maximal.1 (H.out h.IsRadical), fun H =>
-    isJacobson_iff_prime_eq.2 fun P hP => eq_jacobson_iff_infₛ_maximal.2 (H hP)⟩
-#align ideal.is_jacobson_iff_Inf_maximal Ideal.isJacobson_iff_infₛ_maximal
+        I.IsPrime → ∃ M : Set (Ideal R), (∀ J ∈ M, IsMaximal J ∨ J = ⊤) ∧ I = sInf M :=
+  ⟨fun H I h => eq_jacobson_iff_sInf_maximal.1 (H.out h.IsRadical), fun H =>
+    isJacobson_iff_prime_eq.2 fun P hP => eq_jacobson_iff_sInf_maximal.2 (H hP)⟩
+#align ideal.is_jacobson_iff_Inf_maximal Ideal.isJacobson_iff_sInf_maximal
 
-theorem isJacobson_iff_infₛ_maximal' :
+theorem isJacobson_iff_sInf_maximal' :
     IsJacobson R ↔
       ∀ {I : Ideal R},
-        I.IsPrime → ∃ M : Set (Ideal R), (∀ J ∈ M, ∀ (K : Ideal R), J < K → K = ⊤) ∧ I = infₛ M :=
-  ⟨fun H I h => eq_jacobson_iff_infₛ_maximal'.1 (H.out h.IsRadical), fun H =>
-    isJacobson_iff_prime_eq.2 fun P hP => eq_jacobson_iff_infₛ_maximal'.2 (H hP)⟩
-#align ideal.is_jacobson_iff_Inf_maximal' Ideal.isJacobson_iff_infₛ_maximal'
+        I.IsPrime → ∃ M : Set (Ideal R), (∀ J ∈ M, ∀ (K : Ideal R), J < K → K = ⊤) ∧ I = sInf M :=
+  ⟨fun H I h => eq_jacobson_iff_sInf_maximal'.1 (H.out h.IsRadical), fun H =>
+    isJacobson_iff_prime_eq.2 fun P hP => eq_jacobson_iff_sInf_maximal'.2 (H hP)⟩
+#align ideal.is_jacobson_iff_Inf_maximal' Ideal.isJacobson_iff_sInf_maximal'
 
 theorem radical_eq_jacobson [H : IsJacobson R] (I : Ideal R) : I.radical = I.jacobson :=
-  le_antisymm (le_infₛ fun J ⟨hJ, hJ_max⟩ => (IsPrime.radical_le_iff hJ_max.IsPrime).mpr hJ)
+  le_antisymm (le_sInf fun J ⟨hJ, hJ_max⟩ => (IsPrime.radical_le_iff hJ_max.IsPrime).mpr hJ)
     (H.out (radical_isRadical I) ▸ jacobson_mono le_radical)
 #align ideal.radical_eq_jacobson Ideal.radical_eq_jacobson
 
@@ -108,7 +108,7 @@ theorem radical_eq_jacobson [H : IsJacobson R] (I : Ideal R) : I.radical = I.jac
 instance (priority := 100) isJacobson_field {K : Type _} [Field K] : IsJacobson K :=
   ⟨fun I hI =>
     Or.rec_on (eq_bot_or_top I)
-      (fun h => le_antisymm (infₛ_le ⟨le_rfl, h.symm ▸ bot_isMaximal⟩) (h.symm ▸ bot_le)) fun h =>
+      (fun h => le_antisymm (sInf_le ⟨le_rfl, h.symm ▸ bot_isMaximal⟩) (h.symm ▸ bot_le)) fun h =>
       by rw [h, jacobson_eq_top_iff]⟩
 #align ideal.is_jacobson_field Ideal.isJacobson_field
 
@@ -147,7 +147,7 @@ theorem isJacobson_of_isIntegral [Algebra R S] (hRS : Algebra.IsIntegral R S) (h
       jacobson_eq_iff_jacobson_quotient_eq_bot.1
         ((is_jacobson_iff_prime_eq.1 hR) (comap (algebraMap R S) P) (comap_is_prime _ _)),
       comap_jacobson]
-    refine' infₛ_le_infₛ fun J hJ => _
+    refine' sInf_le_sInf fun J hJ => _
     simp only [true_and_iff, Set.mem_image, bot_le, Set.mem_setOf_eq]
     have : J.is_maximal := by simpa using hJ
     exact
@@ -281,8 +281,8 @@ theorem isJacobson_localization [H : IsJacobson R] : IsJacobson S :=
     · exact hxy
     · exact (hPM.le_bot ⟨Submonoid.mem_powers _, hxy⟩).elim
   refine' le_trans _ this
-  rw [Ideal.jacobson, comap_Inf', infₛ_eq_infᵢ]
-  refine' infᵢ_le_infᵢ_of_subset fun I hI => ⟨map (algebraMap R S) I, ⟨_, _⟩⟩
+  rw [Ideal.jacobson, comap_Inf', sInf_eq_iInf]
+  refine' iInf_le_iInf_of_subset fun I hI => ⟨map (algebraMap R S) I, ⟨_, _⟩⟩
   ·
     exact
       ⟨le_trans (le_of_eq (IsLocalization.map_comap (powers y) S P').symm) (map_mono hI.1),
@@ -391,7 +391,7 @@ theorem jacobson_bot_of_integral_localization {R : Type _} [CommRing R] [IsDomai
     refine' eq_bot_iff.mpr (le_trans _ (le_of_eq hϕ'))
     rw [← hSₘ.out is_radical_bot_of_no_zero_divisors, comap_jacobson]
     exact
-      infₛ_le_infₛ fun j hj =>
+      sInf_le_sInf fun j hj =>
         ⟨bot_le,
           let ⟨J, hJ⟩ := hj
           hJ.2 ▸ this J hJ.1.2⟩
Diff
@@ -677,7 +677,7 @@ variable {n : ℕ}
 
 theorem quotient_mk_comp_c_isIntegral_of_jacobson {R : Type _} [CommRing R] [IsJacobson R]
     (P : Ideal (MvPolynomial (Fin n) R)) [P.IsMaximal] :
-    ((Quotient.mk P).comp MvPolynomial.c : R →+* MvPolynomial _ R ⧸ P).IsIntegral :=
+    ((Quotient.mk P).comp MvPolynomial.C : R →+* MvPolynomial _ R ⧸ P).IsIntegral :=
   by
   induction' n with n IH
   · refine' RingHom.isIntegral_of_surjective _ (Function.Surjective.comp quotient.mk_surjective _)
@@ -708,7 +708,7 @@ theorem quotient_mk_comp_c_isIntegral_of_jacobson {R : Type _} [CommRing R] [IsJ
 
 theorem comp_c_integral_of_surjective_of_jacobson {R : Type _} [CommRing R] [IsJacobson R]
     {σ : Type _} [Finite σ] {S : Type _} [Field S] (f : MvPolynomial σ R →+* S)
-    (hf : Function.Surjective f) : (f.comp c).IsIntegral :=
+    (hf : Function.Surjective f) : (f.comp C).IsIntegral :=
   by
   cases nonempty_fintype σ
   have e := (Fintype.equivFin σ).symm
Diff
@@ -310,17 +310,17 @@ variable {Rₘ Sₘ : Type _} [CommRing Rₘ] [CommRing Sₘ]
   In particular `X` is integral because it satisfies `pX`, and constants are trivially integral,
   so integrality of the entire extension follows by closure under addition and multiplication. -/
 theorem isIntegral_isLocalization_polynomial_quotient (P : Ideal R[X]) (pX : R[X]) (hpX : pX ∈ P)
-    [Algebra (R ⧸ P.comap (c : R →+* _)) Rₘ]
-    [IsLocalization.Away (pX.map (Quotient.mk (P.comap (c : R →+* R[X])))).leadingCoeff Rₘ]
+    [Algebra (R ⧸ P.comap (C : R →+* _)) Rₘ]
+    [IsLocalization.Away (pX.map (Quotient.mk (P.comap (C : R →+* R[X])))).leadingCoeff Rₘ]
     [Algebra (R[X] ⧸ P) Sₘ]
     [IsLocalization
-        ((Submonoid.powers (pX.map (Quotient.mk (P.comap (c : R →+* R[X])))).leadingCoeff).map
-            (quotientMap P c le_rfl) :
+        ((Submonoid.powers (pX.map (Quotient.mk (P.comap (C : R →+* R[X])))).leadingCoeff).map
+            (quotientMap P C le_rfl) :
           Submonoid (R[X] ⧸ P))
         Sₘ] :
-    (IsLocalization.map Sₘ (quotientMap P c le_rfl)
+    (IsLocalization.map Sₘ (quotientMap P C le_rfl)
           (Submonoid.powers
-              (pX.map (Quotient.mk (P.comap (c : R →+* R[X])))).leadingCoeff).le_comap_map :
+              (pX.map (Quotient.mk (P.comap (C : R →+* R[X])))).leadingCoeff).le_comap_map :
         Rₘ →+* _).IsIntegral :=
   by
   let P' : Ideal R := P.comap C
@@ -424,7 +424,7 @@ theorem jacobson_bot_of_integral_localization {R : Type _} [CommRing R] [IsDomai
 /-- Used to bootstrap the proof of `is_jacobson_polynomial_iff_is_jacobson`.
   That theorem is more general and should be used instead of this one. -/
 private theorem is_jacobson_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) :
+    [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 = ⊥
   ·
@@ -498,8 +498,8 @@ variable (P : Ideal R[X]) [hP : P.IsMaximal]
 
 include P hP
 
-theorem isMaximal_comap_c_of_isMaximal [Nontrivial R] (hP' : ∀ x : R, c x ∈ P → x = 0) :
-    IsMaximal (comap (c : R →+* R[X]) P : Ideal R) :=
+theorem isMaximal_comap_c_of_isMaximal [Nontrivial R] (hP' : ∀ x : R, C x ∈ P → x = 0) :
+    IsMaximal (comap (C : R →+* R[X]) P : Ideal R) :=
   by
   haveI hp'_prime : (P.comap (C : R →+* R[X]) : Ideal R).IsPrime := comap_is_prime C P
   obtain ⟨m, hm⟩ := Submodule.nonzero_mem_of_bot_lt (bot_lt_of_maximal P polynomial_not_is_field)
@@ -550,7 +550,7 @@ theorem isMaximal_comap_c_of_isMaximal [Nontrivial R] (hP' : ∀ x : R, c x ∈
 
 /-- Used to bootstrap the more general `quotient_mk_comp_C_is_integral_of_jacobson` -/
 private theorem quotient_mk_comp_C_is_integral_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 :=
+    (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
@@ -586,7 +586,7 @@ private theorem quotient_mk_comp_C_is_integral_of_jacobson' [Nontrivial R] (hR :
 /-- 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 :=
+    ((Quotient.mk P).comp C : R →+* R[X] ⧸ P).IsIntegral :=
   by
   let P' : Ideal R := P.comap C
   haveI : P'.is_prime := comap_is_prime C P
@@ -615,7 +615,7 @@ theorem quotient_mk_comp_c_isIntegral_of_jacobson :
     rwa [quotient.eq_zero_iff_mem, mem_comap, hPJ, mem_comap, coe_map_ring_hom, map_C]
 #align ideal.polynomial.quotient_mk_comp_C_is_integral_of_jacobson Ideal.Polynomial.quotient_mk_comp_c_isIntegral_of_jacobson
 
-theorem isMaximal_comap_c_of_isJacobson : (P.comap (c : R →+* R[X])).IsMaximal :=
+theorem isMaximal_comap_c_of_isJacobson : (P.comap (C : R →+* R[X])).IsMaximal :=
   by
   rw [← @mk_ker _ _ P, RingHom.ker_eq_comap_bot, comap_comap]
   exact
@@ -626,7 +626,7 @@ theorem isMaximal_comap_c_of_isJacobson : (P.comap (c : R →+* R[X])).IsMaximal
 omit P hP
 
 theorem comp_c_integral_of_surjective_of_jacobson {S : Type _} [Field S] (f : R[X] →+* S)
-    (hf : Function.Surjective f) : (f.comp c).IsIntegral :=
+    (hf : Function.Surjective f) : (f.comp C).IsIntegral :=
   by
   haveI : f.ker.IsMaximal := RingHom.ker_isMaximal_of_surjective f hf
   let g : R[X] ⧸ f.ker →+* S := Ideal.Quotient.lift f.ker f fun _ h => h
@@ -683,7 +683,7 @@ theorem quotient_mk_comp_c_isIntegral_of_jacobson {R : Type _} [CommRing R] [IsJ
   · refine' RingHom.isIntegral_of_surjective _ (Function.Surjective.comp quotient.mk_surjective _)
     exact C_surjective (Fin 0)
   · rw [← fin_succ_equiv_comp_C_eq_C, ← RingHom.comp_assoc, ← RingHom.comp_assoc, ←
-      quotient_map_comp_mk le_rfl, RingHom.comp_assoc Polynomial.c, ← quotient_map_comp_mk le_rfl,
+      quotient_map_comp_mk le_rfl, RingHom.comp_assoc Polynomial.C, ← quotient_map_comp_mk le_rfl,
       RingHom.comp_assoc, RingHom.comp_assoc, ← quotient_map_comp_mk le_rfl, ←
       RingHom.comp_assoc (Quotient.mk' _)]
     refine' RingHom.isIntegral_trans _ _ _ _

Changes in mathlib4

mathlib3
mathlib4
chore: superfluous parentheses (#12116)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -454,7 +454,7 @@ theorem isJacobson_polynomial_of_isJacobson (hR : IsJacobson R) : IsJacobson R[X
     refine le_antisymm ?_ le_jacobson
     exact le_trans (le_sup_of_le_left le_rfl) (le_trans (le_of_eq h) (sup_le le_rfl hi'))
   apply isJacobson_polynomial_of_domain R' J
-  exact (eq_zero_of_polynomial_mem_map_range I)
+  exact eq_zero_of_polynomial_mem_map_range I
 #align ideal.polynomial.is_jacobson_polynomial_of_is_jacobson Ideal.Polynomial.isJacobson_polynomial_of_isJacobson
 
 theorem isJacobson_polynomial_iff_isJacobson : IsJacobson R[X] ↔ IsJacobson R := by
chore: avoid Ne.def (adaptation for nightly-2024-03-27) (#11813)
Diff
@@ -419,7 +419,7 @@ private theorem isJacobson_polynomial_of_domain (R : Type*) [CommRing R] [IsDoma
     haveI hR' : IsJacobson (R ⧸ P') := by infer_instance
     obtain ⟨p, pP, p0⟩ := exists_nonzero_mem_of_ne_bot Pb hP
     let x := (Polynomial.map (Quotient.mk P') p).leadingCoeff
-    have hx : x ≠ 0 := by rwa [Ne.def, leadingCoeff_eq_zero]
+    have hx : x ≠ 0 := by rwa [Ne, leadingCoeff_eq_zero]
     let φ : R ⧸ P' →+* R[X] ⧸ P := Ideal.quotientMap P (C : R →+* R[X]) le_rfl
     let hφ : Function.Injective ↑φ := quotientMap_injective
     let Rₘ := Localization.Away x
change the order of operation in zsmulRec and nsmulRec (#11451)

We change the following field in the definition of an additive commutative monoid:

 nsmul_succ : ∀ (n : ℕ) (x : G),
-  AddMonoid.nsmul (n + 1) x = x + AddMonoid.nsmul n x
+  AddMonoid.nsmul (n + 1) x = AddMonoid.nsmul n x + x

where the latter is more natural

We adjust the definitions of ^ in monoids, groups, etc. Originally there was a warning comment about why this natural order was preferred

use x * npowRec n x and not npowRec n x * x in the definition to make sure that definitional unfolding of npowRec is blocked, to avoid deep recursion issues.

but it seems to no longer apply.

Remarks on the PR :

  • pow_succ and pow_succ' have switched their meanings.
  • Most of the time, the proofs were adjusted by priming/unpriming one lemma, or exchanging left and right; a few proofs were more complicated to adjust.
  • In particular, [Mathlib/NumberTheory/RamificationInertia.lean] used Ideal.IsPrime.mul_mem_pow which is defined in [Mathlib/RingTheory/DedekindDomain/Ideal.lean]. Changing the order of operation forced me to add the symmetric lemma Ideal.IsPrime.mem_pow_mul.
  • the docstring for Cauchy condensation test in [Mathlib/Analysis/PSeries.lean] was mathematically incorrect, I added the mention that the function is antitone.
Diff
@@ -293,7 +293,7 @@ lemma mem_closure_X_union_C {R : Type*} [Ring R] (p : R[X]) :
   · intros p1 p2 h1 h2
     exact Subring.add_mem _ h1 h2
   · intros n r hr
-    rw [pow_succ', ← mul_assoc]
+    rw [pow_succ, ← mul_assoc]
     apply Subring.mul_mem _ hr
     apply Subring.subset_closure
     apply Set.mem_insert
chore(*): remove empty lines between variable statements (#11418)

Empty lines were removed by executing the following Python script twice

import os
import re


# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
  for filename in files:
    if filename.endswith('.lean'):
      file_path = os.path.join(dir_path, filename)

      # Open the file and read its contents
      with open(file_path, 'r') as file:
        content = file.read()

      # Use a regular expression to replace sequences of "variable" lines separated by empty lines
      # with sequences without empty lines
      modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)

      # Write the modified content back to the file
      with open(file_path, 'w') as file:
        file.write(modified_content)
Diff
@@ -159,7 +159,6 @@ section Localization
 open IsLocalization Submonoid
 
 variable {R S : Type*} [CommRing R] [CommRing S] {I : Ideal R}
-
 variable (y : R) [Algebra R S] [IsLocalization.Away y S]
 
 theorem disjoint_powers_iff_not_mem (hI : I.IsRadical) :
@@ -300,7 +299,6 @@ lemma mem_closure_X_union_C {R : Type*} [Ring R] (p : R[X]) :
     apply Set.mem_insert
 
 variable {R S : Type*} [CommRing R] [CommRing S] [IsDomain S]
-
 variable {Rₘ Sₘ : Type*} [CommRing Rₘ] [CommRing Sₘ]
 
 /-- If `I` is a prime ideal of `R[X]` and `pX ∈ I` is a non-constant polynomial,
@@ -474,7 +472,6 @@ end CommRing
 section
 
 variable {R : Type*} [CommRing R] [IsJacobson R]
-
 variable (P : Ideal R[X]) [hP : P.IsMaximal]
 
 theorem isMaximal_comap_C_of_isMaximal [Nontrivial R] (hP' : ∀ x : R, C x ∈ P → x = 0) :
chore: more backporting of simp changes from #10995 (#11001)

Co-authored-by: Patrick Massot <patrickmassot@free.fr> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -494,7 +494,7 @@ theorem isMaximal_comap_C_of_isMaximal [Nontrivial R] (hP' : ∀ x : R, C x ∈
       ((injective_iff_map_eq_zero (Quotient.mk (P.comap (C : R →+* R[X]) : Ideal R))).2
         fun x hx => by
           rwa [Quotient.eq_zero_iff_mem, (by rwa [eq_bot_iff] : (P.comap C : Ideal R) = ⊥)] at hx)
-        (by simpa only [leadingCoeff_eq_zero, Polynomial.map_zero] using hp0')
+        (by simpa only [a, leadingCoeff_eq_zero, Polynomial.map_zero] using hp0')
   have hM : (0 : R ⧸ P') ∉ M := fun ⟨n, hn⟩ => hp0 (pow_eq_zero hn)
   suffices (⊥ : Ideal (Localization M)).IsMaximal by
     rw [← IsLocalization.comap_map_of_isPrime_disjoint M (Localization M) ⊥ bot_prime
@@ -570,7 +570,7 @@ theorem quotient_mk_comp_C_isIntegral_of_jacobson :
     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
+    simpa only [f, 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 _ _ ?_
chore: remove stream-of-consciousness uses of have, replace and suffices (#10640)

No changes to tactic file, it's just boring fixes throughout the library.

This follows on from #6964.

Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -436,8 +436,8 @@ theorem isJacobson_polynomial_of_isJacobson (hR : IsJacobson R) : IsJacobson R[X
   let R' : Subring (R[X] ⧸ I) := ((Quotient.mk I).comp C).range
   let i : R →+* R' := ((Quotient.mk I).comp C).rangeRestrict
   have hi : Function.Surjective ↑i := ((Quotient.mk I).comp C).rangeRestrict_surjective
-  have hi' : RingHom.ker (mapRingHom i) ≤ I
-  · intro f hf
+  have hi' : RingHom.ker (mapRingHom i) ≤ I := by
+    intro f hf
     apply polynomial_mem_ideal_of_coeff_mem_ideal I f
     intro n
     replace hf := congrArg (fun g : Polynomial ((Quotient.mk I).comp C).range => g.coeff n) hf
@@ -449,8 +449,8 @@ theorem isJacobson_polynomial_of_isJacobson (hR : IsJacobson R) : IsJacobson R[X
   -- Porting note: moved ↓ this up a few lines, so that it can be used in the `have`
   have h_surj : Function.Surjective (mapRingHom i) := Polynomial.map_surjective i hi
   have : IsPrime J := map_isPrime_of_surjective h_surj hi'
-  suffices h : J.jacobson = J
-  · replace h := congrArg (comap (Polynomial.mapRingHom i)) h
+  suffices h : J.jacobson = J by
+    replace h := congrArg (comap (Polynomial.mapRingHom i)) h
     rw [← map_jacobson_of_surjective h_surj hi', comap_map_of_surjective _ h_surj,
       comap_map_of_surjective _ h_surj] at h
     refine le_antisymm ?_ le_jacobson
@@ -541,20 +541,20 @@ private theorem quotient_mk_comp_C_isIntegral_of_jacobson' [Nontrivial R] (hR :
     exact
       let ⟨z, zM, z0⟩ := hM'
       quotientMap_injective (_root_.trans z0 φ.map_zero.symm) ▸ zM
-  · suffices : RingHom.comp (algebraMap (R[X] ⧸ P) (Localization M')) φ =
+  · 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
+        (algebraMap (R ⧸ P') (Localization M)) by
+      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
     rw [IsLocalization.map_comp M.le_comap_map]
 
 /-- If `R` is a Jacobson ring, and `P` is a maximal ideal of `R[X]`,
@@ -574,8 +574,8 @@ theorem quotient_mk_comp_C_isIntegral_of_jacobson :
   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)
+  have : IsMaximal (map (mapRingHom (Quotient.mk (comap C P))) P) :=
+    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 exact Ideal.isJacobson_quotient
@@ -672,11 +672,11 @@ private lemma aux_IH {R : Type u} {S : Type v} {T : Type w}
   · apply IH
     apply Polynomial.isMaximal_comap_C_of_isJacobson'
     exact hQ
-  · suffices : w'.toRingHom = Ideal.quotientMap Q (Polynomial.C) le_rfl
-    · rw [this]
+  · suffices w'.toRingHom = Ideal.quotientMap Q (Polynomial.C) le_rfl by
+      rw [this]
       rw [isIntegral_quotientMap_iff _]
       apply Polynomial.quotient_mk_comp_C_isIntegral_of_jacobson
-    · rfl
+    rfl
   · apply RingHom.isIntegral_of_surjective
     exact w.surjective
 
chore: add missing hypothesis names to by_cases (#8533)

I've also got a change to make this required, but I'd like to land this first.

Diff
@@ -248,7 +248,7 @@ theorem isJacobson_localization [H : IsJacobson R] : IsJacobson S := by
     have hxy : x * y ∈ (comap (algebraMap R S) P').jacobson := by
       rw [Ideal.jacobson, mem_sInf]
       intro J hJ
-      by_cases y ∈ J
+      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
chore(IntegralClosure): noncommutative generalizations and golfs (#8406)

Zulip

Initially I just wanted to add more dot notations for IsIntegral and IsAlgebraic (done in #8437); then I noticed near-duplicates Algebra.isIntegral_of_finite [Field R] [Ring A] and RingHom.IsIntegral.of_finite [CommRing R] [CommRing A] so I went on to generalize the latter to cover the former, and generalized everything in the IntegralClosure file to the noncommutative case whenever possible.

In the process I noticed more golfs, which result in this PR. Most notably, isIntegral_of_mem_of_FG is now proven using Cayley-Hamilton and doesn't depend on the Noetherian case isIntegral_of_noetherian; the latter is now proven using the former. In total the golfs makes mathlib 227 lines leaner (+487 -714).

The main changes are in the single file RingTheory/IntegralClosure:

  • Change the definition of Algebra.IsIntegral which makes it unfold to IsIntegral rather than RingHom.IsIntegralElem because the former has much more APIs.

  • Fix lemma names involving is_integral which are actually about IsIntegralElem: RingHom.is_integral_mapRingHom.isIntegralElem_map RingHom.is_integral_of_mem_closureRingHom.IsIntegralElem.of_mem_closure RingHom.is_integral_zero/oneRingHom.isIntegralElem_zero/one RingHom.is_integral_add/neg/sub/mul/of_mul_unitRingHom.IsIntegralElem.add/neg/sub/mul/of_mul_unit

  • Add a lemma Algebra.IsIntegral.of_injective.

  • Move isIntegral_of_(submodule_)noetherian down and golf them.

  • Remove (Algebra.)isIntegral_of_finite that work only over fields, in favor of the more general (Algebra.)isIntegral.of_finite.

  • Merge duplicate lemmas isIntegral_of_isScalarTower and isIntegral_tower_top_of_isIntegral into IsIntegral.tower_top.

  • Golf IsIntegral.of_mem_of_fg by first proving IsIntegral.of_finite using Cayley-Hamilton.

  • Add a docstring mentioning the Kurosh problem at Algebra.IsIntegral.finite. The negative solution to the problem means the theorem doesn't generalize to noncommutative algebras.

  • Golf IsIntegral.tmul and isField_of_isIntegral_of_isField(').

  • Combine isIntegral_trans_aux into isIntegral_trans and golf.

  • Add Algebra namespace to isIntegral_sup.

  • rename lemmas for dot notation: RingHom.isIntegral_transRingHom.IsIntegral.trans RingHom.isIntegral_quotient/tower_bot/top_of_isIntegralRingHom.IsIntegral.quotient/tower_bot/top isIntegral_of_mem_closure'IsIntegral.of_mem_closure' (and the '' version) isIntegral_of_surjectiveAlgebra.isIntegral_of_surjective

The next changed file is RingTheory/Algebraic:

  • Rename: of_larger_basetower_top (for consistency with IsIntegral) Algebra.isAlgebraic_of_finiteAlgebra.IsAlgebraic.of_finite Algebra.isAlgebraic_transAlgebra.IsAlgebraic.trans

  • Add new lemmasAlgebra.IsIntegral.isAlgebraic, isAlgebraic_algHom_iff, and Algebra.IsAlgebraic.of_injective to streamline some proofs.

The generalization from CommRing to Ring requires an additional lemma scaleRoots_eval₂_mul_of_commute in Polynomial/ScaleRoots.

A lemma Algebra.lmul_injective is added to Algebra/Bilinear (in order to golf the proof of IsIntegral.of_mem_of_fg).

In all other files, I merely fix the changed names, or use newly available dot notations.

Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>

Diff
@@ -137,14 +137,14 @@ theorem isJacobson_of_isIntegral [Algebra R S] (hRS : Algebra.IsIntegral R S) (h
   · simp [comap_eq_top_iff.1 hP_top]
   · haveI : Nontrivial (R ⧸ comap (algebraMap R S) P) := Quotient.nontrivial hP_top
     rw [jacobson_eq_iff_jacobson_quotient_eq_bot]
-    refine' eq_bot_of_comap_eq_bot (Algebra.IsIntegral.quotient hRS) _
+    refine' eq_bot_of_comap_eq_bot hRS.quotient _
     rw [eq_bot_iff, ← jacobson_eq_iff_jacobson_quotient_eq_bot.1
       ((isJacobson_iff_prime_eq.1 hR) (comap (algebraMap R S) P) (comap_isPrime _ _)),
       comap_jacobson]
     refine' sInf_le_sInf fun J hJ => _
     simp only [true_and_iff, Set.mem_image, bot_le, Set.mem_setOf_eq]
     have : J.IsMaximal := by simpa using hJ
-    exact exists_ideal_over_maximal_of_isIntegral (Algebra.IsIntegral.quotient hRS) J
+    exact exists_ideal_over_maximal_of_isIntegral hRS.quotient J
       (comap_bot_le_of_injective _ algebraMap_quotient_injective)
 #align ideal.is_jacobson_of_is_integral Ideal.isJacobson_of_isIntegral
 
@@ -328,13 +328,12 @@ theorem isIntegral_isLocalization_polynomial_quotient
   suffices φ'.IsIntegralElem (algebraMap (R[X] ⧸ P) Sₘ p') by
     obtain ⟨q', hq', rfl⟩ := hq
     obtain ⟨q'', hq''⟩ := isUnit_iff_exists_inv'.1 (IsLocalization.map_units Rₘ (⟨q', hq'⟩ : M))
-    refine' φ'.isIntegral_of_isIntegral_mul_unit p (algebraMap (R[X] ⧸ P) Sₘ (φ q'))
-      q'' _ (hp.symm ▸ this)
+    refine (hp.symm ▸ this).of_mul_unit φ' p (algebraMap (R[X] ⧸ P) Sₘ (φ q')) q'' ?_
     rw [← φ'.map_one, ← congr_arg φ' hq'', φ'.map_mul, ← φ'.comp_apply]
     simp only [IsLocalization.map_comp _]
     rw [RingHom.comp_apply]
   dsimp at hp
-  refine' @isIntegral_of_mem_closure'' Rₘ _ Sₘ _ φ'
+  refine' @IsIntegral.of_mem_closure'' Rₘ _ Sₘ _ φ'
     ((algebraMap (R[X] ⧸ P) Sₘ).comp (Quotient.mk P) '' insert X { p | p.degree ≤ 0 }) _
     ((algebraMap (R[X] ⧸ P) Sₘ) p') _
   · rintro x ⟨p, hp, rfl⟩
@@ -398,15 +397,14 @@ theorem jacobson_bot_of_integral_localization {R : Type*} [CommRing R] [IsDomain
   have := ((isMaximal_iff_isMaximal_disjoint Rₘ x _).1 this).left
   have : ((I.comap (algebraMap S Sₘ)).comap φ).IsMaximal := by
     rwa [comap_comap, hcomm, ← comap_comap] at this
-  rw [← bot_quotient_isMaximal_iff] at this⊢
+  rw [← bot_quotient_isMaximal_iff] at this ⊢
   refine' isMaximal_of_isIntegral_of_isMaximal_comap' f _ ⊥
     ((eq_bot_iff.2 (comap_bot_le_of_injective f quotientMap_injective)).symm ▸ this)
-  exact f.isIntegral_tower_bot_of_isIntegral g quotientMap_injective
+  exact RingHom.IsIntegral.tower_bot f g quotientMap_injective
     ((comp_quotientMap_eq_of_comp_eq hcomm I).symm ▸
-      RingHom.isIntegral_trans _ _ (RingHom.isIntegral_of_surjective _
+      (RingHom.isIntegral_of_surjective _
         (IsLocalization.surjective_quotientMap_of_maximal_of_localization (Submonoid.powers x) Rₘ
-          (by rwa [comap_comap, hcomm, ← bot_quotient_isMaximal_iff])))
-      (RingHom.isIntegral_quotient_of_isIntegral _ hφ'))
+          (by rwa [comap_comap, hcomm, ← bot_quotient_isMaximal_iff]))).trans _ _ (hφ'.quotient _))
 #align ideal.polynomial.jacobson_bot_of_integral_localization Ideal.Polynomial.jacobson_bot_of_integral_localization
 
 /-- Used to bootstrap the proof of `isJacobson_polynomial_iff_isJacobson`.
@@ -537,7 +535,7 @@ private theorem quotient_mk_comp_C_isIntegral_of_jacobson' [Nontrivial R] (hR :
   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' φ.isIntegral_tower_bot_of_isIntegral (algebraMap _ (Localization M')) _ _
+  refine' RingHom.IsIntegral.tower_bot φ (algebraMap _ (Localization M')) _ _
   · refine' IsLocalization.injective (Localization M')
       (show M' ≤ _ from le_nonZeroDivisors_of_noZeroDivisors fun hM' => hM _)
     exact
@@ -547,7 +545,7 @@ private theorem quotient_mk_comp_C_isIntegral_of_jacobson' [Nontrivial R] (hR :
       (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))
+    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
@@ -573,10 +571,9 @@ theorem quotient_mk_comp_C_isIntegral_of_jacobson :
     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_of_isIntegral _ _ (injective_quotient_le_comap_map P) _
+  refine' RingHom.IsIntegral.tower_bot _ _ (injective_quotient_le_comap_map P) _
   rw [← quotient_mk_maps_eq]
-  refine RingHom.isIntegral_trans _ _
-    ((Quotient.mk P').isIntegral_of_surjective Quotient.mk_surjective) ?_
+  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
@@ -605,7 +602,7 @@ theorem comp_C_integral_of_surjective_of_jacobson {S : Type*} [Field S] (f : R[X
   let g : R[X] ⧸ (RingHom.ker f) →+* S := Ideal.Quotient.lift (RingHom.ker f) f fun _ h => h
   have hfg : g.comp (Quotient.mk (RingHom.ker f)) = f := ringHom_ext' rfl rfl
   rw [← hfg, RingHom.comp_assoc]
-  refine RingHom.isIntegral_trans _ g (quotient_mk_comp_C_isIntegral_of_jacobson (RingHom.ker f))
+  refine (quotient_mk_comp_C_isIntegral_of_jacobson (RingHom.ker f)).trans _ g
     (g.isIntegral_of_surjective ?_)
   rw [← hfg] at hf
   norm_num at hf
@@ -670,8 +667,8 @@ private lemma aux_IH {R : Type u} {S : Type v} {T : Type w}
       RingEquiv.toRingHom_eq_coe, AlgHom.comp_algebraMap_of_tower, coe_comp, coe_coe,
       AlgEquiv.coe_ringEquiv, Function.comp_apply, AlgEquiv.commutes]
   rw [h_eq]
-  apply RingHom.isIntegral_trans
-  apply RingHom.isIntegral_trans
+  apply RingHom.IsIntegral.trans
+  apply RingHom.IsIntegral.trans
   · apply IH
     apply Polynomial.isMaximal_comap_C_of_isJacobson'
     exact hQ
@@ -715,8 +712,8 @@ theorem comp_C_integral_of_surjective_of_jacobson {R : Type*} [CommRing R] [IsJa
       Ideal.Quotient.lift (RingHom.ker f') f' fun _ h => h
     have hfg : g.comp (Quotient.mk (RingHom.ker f')) = f' := ringHom_ext (fun r => rfl) fun i => rfl
     rw [← hfg, RingHom.comp_assoc]
-    refine' RingHom.isIntegral_trans _ g (quotient_mk_comp_C_isIntegral_of_jacobson
-      (RingHom.ker f')) (g.isIntegral_of_surjective _)
+    refine' (quotient_mk_comp_C_isIntegral_of_jacobson (RingHom.ker f')).trans _ g
+      (g.isIntegral_of_surjective _)
     rw [← hfg] at hf'
     norm_num at hf'
     exact Function.Surjective.of_comp hf'
chore(RingTheory/{Algebraic, Localization/Integral}): rename decls to use dot notation (#8437)

This PR tests a string-based tool for renaming declarations.

Inspired by this Zulip thread, I am trying to reduce the diff of #8406.

This PR makes the following renames:

| From | To |

Diff
@@ -137,14 +137,14 @@ theorem isJacobson_of_isIntegral [Algebra R S] (hRS : Algebra.IsIntegral R S) (h
   · simp [comap_eq_top_iff.1 hP_top]
   · haveI : Nontrivial (R ⧸ comap (algebraMap R S) P) := Quotient.nontrivial hP_top
     rw [jacobson_eq_iff_jacobson_quotient_eq_bot]
-    refine' eq_bot_of_comap_eq_bot (isIntegral_quotient_of_isIntegral hRS) _
+    refine' eq_bot_of_comap_eq_bot (Algebra.IsIntegral.quotient hRS) _
     rw [eq_bot_iff, ← jacobson_eq_iff_jacobson_quotient_eq_bot.1
       ((isJacobson_iff_prime_eq.1 hR) (comap (algebraMap R S) P) (comap_isPrime _ _)),
       comap_jacobson]
     refine' sInf_le_sInf fun J hJ => _
     simp only [true_and_iff, Set.mem_image, bot_le, Set.mem_setOf_eq]
     have : J.IsMaximal := by simpa using hJ
-    exact exists_ideal_over_maximal_of_isIntegral (isIntegral_quotient_of_isIntegral hRS) J
+    exact exists_ideal_over_maximal_of_isIntegral (Algebra.IsIntegral.quotient hRS) J
       (comap_bot_le_of_injective _ algebraMap_quotient_injective)
 #align ideal.is_jacobson_of_is_integral Ideal.isJacobson_of_isIntegral
 
chore: removing unneeded maxHeartbeats (#7761)

Due to recent changes in core we can reduce or remove many set_option maxHeartbeats statements.

I have tried to be careful to not leave anything too close to the line, so don't be surprised if some of these can still be reduced further.

This reduces us from 96 maxHeartbeats statements to 44. (There are 10 false positives in meta or testing code.)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -303,7 +303,6 @@ variable {R S : Type*} [CommRing R] [CommRing S] [IsDomain S]
 
 variable {Rₘ Sₘ : Type*} [CommRing Rₘ] [CommRing Sₘ]
 
-set_option maxHeartbeats 300000 in
 /-- If `I` is a prime ideal of `R[X]` and `pX ∈ I` is a non-constant polynomial,
   then the map `R →+* R[x]/I` descends to an integral map when localizing at `pX.leadingCoeff`.
   In particular `X` is integral because it satisfies `pX`, and constants are trivially integral,
@@ -433,7 +432,6 @@ private theorem isJacobson_polynomial_of_domain (R : Type*) [CommRing R] [IsDoma
     haveI islocSₘ : IsLocalization (Submonoid.map φ (Submonoid.powers x)) Sₘ := by infer_instance
     exact @isIntegral_isLocalization_polynomial_quotient R _ Rₘ Sₘ _ _ P p pP _ _ _ islocSₘ
 
-set_option maxHeartbeats 300000 in
 theorem isJacobson_polynomial_of_isJacobson (hR : IsJacobson R) : IsJacobson R[X] := by
   rw [isJacobson_iff_prime_eq]
   intro I hI
chore: only four spaces for subsequent lines (#7286)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -597,7 +597,7 @@ set_option linter.uppercaseLean3 false in
 #align ideal.polynomial.is_maximal_comap_C_of_is_jacobson Ideal.Polynomial.isMaximal_comap_C_of_isJacobson
 
 lemma isMaximal_comap_C_of_isJacobson' {P : Ideal R[X]} (hP : IsMaximal P) :
-  (P.comap (C : R →+* R[X])).IsMaximal := by
+    (P.comap (C : R →+* R[X])).IsMaximal := by
   haveI := hP
   exact isMaximal_comap_C_of_isJacobson P
 
fix: disable autoImplicit globally (#6528)

Autoimplicits are highly controversial and also defeat the performance-improving work in #6474.

The intent of this PR is to make autoImplicit opt-in on a per-file basis, by disabling it in the lakefile and enabling it again with set_option autoImplicit true in the few files that rely on it.

That also keeps this PR small, as opposed to attempting to "fix" files to not need it any more.

I claim that many of the uses of autoImplicit in these files are accidental; situations such as:

  • Assuming variables are in scope, but pasting the lemma in the wrong section
  • Pasting in a lemma from a scratch file without checking to see if the variable names are consistent with the rest of the file
  • Making a copy-paste error between lemmas and forgetting to add an explicit arguments.

Having set_option autoImplicit false as the default prevents these types of mistake being made in the 90% of files where autoImplicits are not used at all, and causes them to be caught by CI during review.

I think there were various points during the port where we encouraged porters to delete the universes u v lines; I think having autoparams for universe variables only would cover a lot of the cases we actually use them, while avoiding any real shortcomings.

A Zulip poll (after combining overlapping votes accordingly) was in favor of this change with 5:5:18 as the no:dontcare:yes vote ratio.

While this PR was being reviewed, a handful of files gained some more likely-accidental autoImplicits. In these places, set_option autoImplicit true has been placed locally within a section, rather than at the top of the file.

Diff
@@ -35,6 +35,8 @@ Let `R` be a commutative ring. Jacobson rings are defined using the first of the
 Jacobson, Jacobson Ring
 -/
 
+set_option autoImplicit true
+
 universe u
 namespace Ideal
 
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -44,12 +44,12 @@ open Polynomial
 
 section IsJacobson
 
-variable {R S : Type _} [CommRing R] [CommRing S] {I : Ideal R}
+variable {R S : Type*} [CommRing R] [CommRing S] {I : Ideal R}
 
 /-- A ring is a Jacobson ring if for every radical ideal `I`,
  the Jacobson radical of `I` is equal to `I`.
  See `isJacobson_iff_prime_eq` and `isJacobson_iff_sInf_maximal` for equivalent definitions. -/
-class IsJacobson (R : Type _) [CommRing R] : Prop where
+class IsJacobson (R : Type*) [CommRing R] : Prop where
   out' : ∀ I : Ideal R, I.IsRadical → I.jacobson = I
 #align ideal.is_jacobson Ideal.IsJacobson
 
@@ -97,7 +97,7 @@ theorem radical_eq_jacobson [H : IsJacobson R] (I : Ideal R) : I.radical = I.jac
 #align ideal.radical_eq_jacobson Ideal.radical_eq_jacobson
 
 /-- Fields have only two ideals, and the condition holds for both of them. -/
-instance (priority := 100) isJacobson_field {K : Type _} [Field K] : IsJacobson K :=
+instance (priority := 100) isJacobson_field {K : Type*} [Field K] : IsJacobson K :=
   ⟨fun I _ => Or.recOn (eq_bot_or_top I)
     (fun h => le_antisymm (sInf_le ⟨le_rfl, h.symm ▸ bot_isMaximal⟩) (h.symm ▸ bot_le)) fun h =>
       by rw [h, jacobson_eq_top_iff]⟩
@@ -156,7 +156,7 @@ section Localization
 
 open IsLocalization Submonoid
 
-variable {R S : Type _} [CommRing R] [CommRing S] {I : Ideal R}
+variable {R S : Type*} [CommRing R] [CommRing S] {I : Ideal R}
 
 variable (y : R) [Algebra R S] [IsLocalization.Away y S]
 
@@ -272,7 +272,7 @@ section CommRing
 
 -- Porting note: move to better place
 -- Porting note: make `S` and `T` universe polymorphic
-lemma Subring.mem_closure_image_of {S T : Type _} [CommRing S] [CommRing T] (g : S →+* T)
+lemma Subring.mem_closure_image_of {S T : Type*} [CommRing S] [CommRing T] (g : S →+* T)
     (u : Set S) (x : S) (hx : x ∈ Subring.closure u) : g x ∈ Subring.closure (g '' u) := by
   rw [Subring.mem_closure] at hx ⊢
   intro T₁ h₁
@@ -282,7 +282,7 @@ lemma Subring.mem_closure_image_of {S T : Type _} [CommRing S] [CommRing T] (g :
   exact h₁
 
 -- Porting note: move to better place
-lemma mem_closure_X_union_C {R : Type _} [Ring R] (p : R[X]) :
+lemma mem_closure_X_union_C {R : Type*} [Ring R] (p : R[X]) :
     p ∈ Subring.closure (insert X {f | f.degree ≤ 0} : Set R[X]) := by
   refine' Polynomial.induction_on p _ _ _
   · intro r
@@ -297,9 +297,9 @@ lemma mem_closure_X_union_C {R : Type _} [Ring R] (p : R[X]) :
     apply Subring.subset_closure
     apply Set.mem_insert
 
-variable {R S : Type _} [CommRing R] [CommRing S] [IsDomain S]
+variable {R S : Type*} [CommRing R] [CommRing S] [IsDomain S]
 
-variable {Rₘ Sₘ : Type _} [CommRing Rₘ] [CommRing Sₘ]
+variable {Rₘ Sₘ : Type*} [CommRing Rₘ] [CommRing Sₘ]
 
 set_option maxHeartbeats 300000 in
 /-- If `I` is a prime ideal of `R[X]` and `pX ∈ I` is a non-constant polynomial,
@@ -364,8 +364,8 @@ theorem isIntegral_isLocalization_polynomial_quotient
 
 /-- 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)
+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φ' :
@@ -410,7 +410,7 @@ theorem jacobson_bot_of_integral_localization {R : Type _} [CommRing R] [IsDomai
 
 /-- 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]
+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 = ⊥
@@ -475,7 +475,7 @@ end CommRing
 
 section
 
-variable {R : Type _} [CommRing R] [IsJacobson R]
+variable {R : Type*} [CommRing R] [IsJacobson R]
 
 variable (P : Ideal R[X]) [hP : P.IsMaximal]
 
@@ -599,7 +599,7 @@ lemma isMaximal_comap_C_of_isJacobson' {P : Ideal R[X]} (hP : IsMaximal P) :
   haveI := hP
   exact isMaximal_comap_C_of_isJacobson P
 
-theorem comp_C_integral_of_surjective_of_jacobson {S : Type _} [Field S] (f : R[X] →+* S)
+theorem comp_C_integral_of_surjective_of_jacobson {S : Type*} [Field S] (f : R[X] →+* S)
     (hf : Function.Surjective ↑f) : (f.comp C).IsIntegral := by
   haveI : f.ker.IsMaximal := RingHom.ker_isMaximal_of_surjective f hf
   let g : R[X] ⧸ (RingHom.ker f) →+* S := Ideal.Quotient.lift (RingHom.ker f) f fun _ h => h
@@ -633,7 +633,7 @@ theorem isJacobson_MvPolynomial_fin {R : Type u} [CommRing R] [H : IsJacobson R]
   `Inf {P maximal | P ≥ I} = Inf {P prime | P ≥ I} = I.radical`. Fields are always Jacobson,
   and in that special case this is (most of) the classical Nullstellensatz,
   since `I(V(I))` is the intersection of maximal ideals containing `I`, which is then `I.radical` -/
-instance isJacobson {R : Type _} [CommRing R] {ι : Type _} [Finite ι] [IsJacobson R] :
+instance isJacobson {R : Type*} [CommRing R] {ι : Type*} [Finite ι] [IsJacobson R] :
     IsJacobson (MvPolynomial ι R) := by
   cases nonempty_fintype ι
   haveI := Classical.decEq ι
@@ -683,7 +683,7 @@ private lemma aux_IH {R : Type u} {S : Type v} {T : Type w}
   · apply RingHom.isIntegral_of_surjective
     exact w.surjective
 
-private theorem quotient_mk_comp_C_isIntegral_of_jacobson' {R : Type _} [CommRing R] [IsJacobson R]
+private theorem quotient_mk_comp_C_isIntegral_of_jacobson' {R : Type*} [CommRing R] [IsJacobson R]
     (P : Ideal (MvPolynomial (Fin n) R)) (hP : P.IsMaximal) :
     RingHom.IsIntegral (algebraMap R (MvPolynomial (Fin n) R ⧸ P)) := by
   induction' n with n IH
@@ -692,7 +692,7 @@ private theorem quotient_mk_comp_C_isIntegral_of_jacobson' {R : Type _} [CommRin
     exact C_surjective (Fin 0)
   · apply aux_IH IH (finSuccEquiv R n).symm P hP
 
-theorem quotient_mk_comp_C_isIntegral_of_jacobson {R : Type _} [CommRing R] [IsJacobson R]
+theorem quotient_mk_comp_C_isIntegral_of_jacobson {R : Type*} [CommRing R] [IsJacobson R]
     (P : Ideal (MvPolynomial (Fin n) R)) [hP : P.IsMaximal] :
     RingHom.IsIntegral (RingHom.comp (Quotient.mk P) (MvPolynomial.C)) := by
   change RingHom.IsIntegral (algebraMap R (MvPolynomial (Fin n) R ⧸ P))
@@ -701,8 +701,8 @@ theorem quotient_mk_comp_C_isIntegral_of_jacobson {R : Type _} [CommRing R] [IsJ
 set_option linter.uppercaseLean3 false in
 #align ideal.mv_polynomial.quotient_mk_comp_C_isIntegral_of_jacobson Ideal.MvPolynomial.quotient_mk_comp_C_isIntegral_of_jacobson
 
-theorem comp_C_integral_of_surjective_of_jacobson {R : Type _} [CommRing R] [IsJacobson R]
-    {σ : Type _} [Finite σ] {S : Type _} [Field S] (f : MvPolynomial σ R →+* S)
+theorem comp_C_integral_of_surjective_of_jacobson {R : Type*} [CommRing R] [IsJacobson R]
+    {σ : Type*} [Finite σ] {S : Type*} [Field S] (f : MvPolynomial σ R →+* S)
     (hf : Function.Surjective ↑f) : (f.comp C).IsIntegral := by
   cases nonempty_fintype σ
   have e := (Fintype.equivFin σ).symm
chore: fix grammar mistakes (#6121)
Diff
@@ -647,7 +647,7 @@ variable {n : ℕ}
 -- Porting note: split out `aux_IH` and `quotient_mk_comp_C_isIntegral_of_jacobson'`
 -- from the long proof of `Ideal.MvPolynomial.quotient_mk_comp_C_isIntegral_of_jacobson`
 
-/-- The constant coefficient as a R-linear morphism -/
+/-- The constant coefficient as an R-linear morphism -/
 private noncomputable def Cₐ (R : Type u) (S : Type v)
     [CommRing R] [CommRing S] [Algebra R S] : S →ₐ[R] S[X] :=
   { Polynomial.C with commutes' := fun r => by rfl }
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2020 Devon Tuma. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Devon Tuma
-
-! This file was ported from Lean 3 source module ring_theory.jacobson
-! leanprover-community/mathlib commit a7c017d750512a352b623b1824d75da5998457d0
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.RingTheory.Localization.Away.Basic
 import Mathlib.RingTheory.Ideal.Over
 import Mathlib.RingTheory.JacobsonIdeal
 
+#align_import ring_theory.jacobson from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0"
+
 /-!
 # Jacobson Rings
 The following conditions are equivalent for a ring `R`:
chore: cleanup whitespace (#5988)

Grepping for [^ .:{-] [^ :] and reviewing the results. Once I started I couldn't stop. :-)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -186,7 +186,7 @@ theorem isMaximal_iff_isMaximal_disjoint [H : IsJacobson R] (J : Ideal S) :
     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
+    push_neg at this
     rcases this with ⟨I, hI, hI'⟩
     convert hI.right
     by_cases hJ : J = map (algebraMap R S) I
@@ -515,7 +515,7 @@ theorem isMaximal_comap_C_of_isMaximal [Nontrivial R] (hP' : ∀ x : R, C x ∈
       (IsLocalization.map_injective_of_injective M (Localization M) (Localization M')
         quotientMap_injective))]
     refine' isMaximal_comap_of_isIntegral_of_isMaximal' _ _ ⊥ this
-    have isloc : IsLocalization  (Submonoid.map φ M) (Localization M') := by infer_instance
+    have isloc : IsLocalization (Submonoid.map φ M) (Localization M') := by infer_instance
     exact @isIntegral_isLocalization_polynomial_quotient R _
       (Localization M) (Localization M') _ _ P m hmem_P _ _ _ isloc
   rw [(map_bot.symm :
feat: port RingTheory.Jacobson (#4338)

Co-authored-by: Jason Yuen <jason_yuen2007@hotmail.com> Co-authored-by: int-y1 <jason_yuen2007@hotmail.com> Co-authored-by: Antoine Chambert-Loir <antoine.chambert-loir@math.univ-paris-diderot.fr> Co-authored-by: Johan Commelin <johan@commelin.net> Co-authored-by: Jujian Zhang <jujian.zhang1998@outlook.com> Co-authored-by: Parcly Taxel <reddeloostw@gmail.com> Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com>

Dependencies 10 + 635

636 files ported (98.5%)
266906 lines ported (98.7%)
Show graph

The unported dependencies are