ring_theory.ring_hom_propertiesMathlib.RingTheory.RingHomProperties

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
@@ -5,7 +5,7 @@ Authors: Andrew Yang
 -/
 import Algebra.Category.Ring.Constructions
 import Algebra.Category.Ring.Colimits
-import CategoryTheory.Isomorphism
+import CategoryTheory.Iso
 import RingTheory.Localization.Away.Basic
 import RingTheory.IsTensorProduct
 
Diff
@@ -3,11 +3,11 @@ Copyright (c) 2022 Andrew Yang. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Andrew Yang
 -/
-import Mathbin.Algebra.Category.Ring.Constructions
-import Mathbin.Algebra.Category.Ring.Colimits
-import Mathbin.CategoryTheory.Isomorphism
-import Mathbin.RingTheory.Localization.Away.Basic
-import Mathbin.RingTheory.IsTensorProduct
+import Algebra.Category.Ring.Constructions
+import Algebra.Category.Ring.Colimits
+import CategoryTheory.Isomorphism
+import RingTheory.Localization.Away.Basic
+import RingTheory.IsTensorProduct
 
 #align_import ring_theory.ring_hom_properties from "leanprover-community/mathlib"@"d07a9c875ed7139abfde6a333b2be205c5bd404e"
 
Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2022 Andrew Yang. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Andrew Yang
-
-! This file was ported from Lean 3 source module ring_theory.ring_hom_properties
-! leanprover-community/mathlib commit d07a9c875ed7139abfde6a333b2be205c5bd404e
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Algebra.Category.Ring.Constructions
 import Mathbin.Algebra.Category.Ring.Colimits
@@ -14,6 +9,8 @@ import Mathbin.CategoryTheory.Isomorphism
 import Mathbin.RingTheory.Localization.Away.Basic
 import Mathbin.RingTheory.IsTensorProduct
 
+#align_import ring_theory.ring_hom_properties from "leanprover-community/mathlib"@"d07a9c875ed7139abfde6a333b2be205c5bd404e"
+
 /-!
 # Properties of ring homomorphisms
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Andrew Yang
 
 ! This file was ported from Lean 3 source module ring_theory.ring_hom_properties
-! leanprover-community/mathlib commit a7c017d750512a352b623b1824d75da5998457d0
+! leanprover-community/mathlib commit d07a9c875ed7139abfde6a333b2be205c5bd404e
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -17,6 +17,9 @@ import Mathbin.RingTheory.IsTensorProduct
 /-!
 # Properties of ring homomorphisms
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 We provide the basic framework for talking about properties of ring homomorphisms.
 The following meta-properties of predicates on ring homomorphisms are defined
 
Diff
@@ -37,8 +37,6 @@ namespace RingHom
 
 variable (P : ∀ {R S : Type u} [CommRing R] [CommRing S] (f : R →+* S), Prop)
 
-include P
-
 section RespectsIso
 
 #print RingHom.RespectsIso /-
@@ -71,6 +69,7 @@ theorem RespectsIso.cancel_right_isIso (hP : RespectsIso @P) {R S T : CommRingCa
 #align ring_hom.respects_iso.cancel_right_is_iso RingHom.RespectsIso.cancel_right_isIso
 -/
 
+#print RingHom.RespectsIso.is_localization_away_iff /-
 theorem RespectsIso.is_localization_away_iff (hP : RingHom.RespectsIso @P) {R S : Type _}
     (R' S' : Type _) [CommRing R] [CommRing S] [CommRing R'] [CommRing S'] [Algebra R R']
     [Algebra S S'] (f : R →+* S) (r : R) [IsLocalization.Away r R'] [IsLocalization.Away (f r) S'] :
@@ -93,6 +92,7 @@ theorem RespectsIso.is_localization_away_iff (hP : RingHom.RespectsIso @P) {R S
     IsLocalization.ringEquivOfRingEquiv_apply, RingHom.coe_mk, RingEquiv.toFun_eq_coe,
     IsLocalization.ringEquivOfRingEquiv_eq, IsLocalization.map_eq]
 #align ring_hom.respects_iso.is_localization_away_iff RingHom.RespectsIso.is_localization_away_iff
+-/
 
 end RespectsIso
 
@@ -109,6 +109,7 @@ def StableUnderComposition : Prop :=
 
 variable {P}
 
+#print RingHom.StableUnderComposition.respectsIso /-
 theorem StableUnderComposition.respectsIso (hP : RingHom.StableUnderComposition @P)
     (hP' : ∀ {R S : Type _} [CommRing R] [CommRing S] (e : R ≃+* S), P e.to_ring_hom) :
     RingHom.RespectsIso @P := by
@@ -116,6 +117,7 @@ theorem StableUnderComposition.respectsIso (hP : RingHom.StableUnderComposition
   · introv H; skip; apply hP; exacts [H, hP' e]
   · introv H; skip; apply hP; exacts [hP' e, H]
 #align ring_hom.stable_under_composition.respects_iso RingHom.StableUnderComposition.respectsIso
+-/
 
 end StableUnderComposition
 
@@ -132,6 +134,7 @@ def StableUnderBaseChange : Prop :=
 #align ring_hom.stable_under_base_change RingHom.StableUnderBaseChange
 -/
 
+#print RingHom.StableUnderBaseChange.mk /-
 theorem StableUnderBaseChange.mk (h₁ : RespectsIso @P)
     (h₂ :
       ∀ ⦃R S T⦄ [CommRing R] [CommRing S] [CommRing T],
@@ -163,8 +166,7 @@ theorem StableUnderBaseChange.mk (h₁ : RespectsIso @P)
     dsimp only [e]
     rw [h.symm.1.equiv_tmul, Algebra.smul_def, AlgHom.toLinearMap_apply, map_one, mul_one]
 #align ring_hom.stable_under_base_change.mk RingHom.StableUnderBaseChange.mk
-
-omit P
+-/
 
 attribute [local instance] Algebra.TensorProduct.rightAlgebra
 
Diff
@@ -41,6 +41,7 @@ include P
 
 section RespectsIso
 
+#print RingHom.RespectsIso /-
 /-- A property `respects_iso` if it still holds when composed with an isomorphism -/
 def RespectsIso : Prop :=
   (∀ {R S T : Type u} [CommRing R] [CommRing S] [CommRing T],
@@ -48,22 +49,27 @@ def RespectsIso : Prop :=
     ∀ {R S T : Type u} [CommRing R] [CommRing S] [CommRing T],
       ∀ (f : S →+* T) (e : R ≃+* S) (hf : P f), P (f.comp e.toRingHom)
 #align ring_hom.respects_iso RingHom.RespectsIso
+-/
 
 variable {P}
 
+#print RingHom.RespectsIso.cancel_left_isIso /-
 theorem RespectsIso.cancel_left_isIso (hP : RespectsIso @P) {R S T : CommRingCat} (f : R ⟶ S)
     (g : S ⟶ T) [IsIso f] : P (f ≫ g) ↔ P g :=
   ⟨fun H => by
     convert hP.2 (f ≫ g) (as_iso f).symm.commRingCatIsoToRingEquiv H
     exact (is_iso.inv_hom_id_assoc _ _).symm, hP.2 g (asIso f).commRingCatIsoToRingEquiv⟩
 #align ring_hom.respects_iso.cancel_left_is_iso RingHom.RespectsIso.cancel_left_isIso
+-/
 
+#print RingHom.RespectsIso.cancel_right_isIso /-
 theorem RespectsIso.cancel_right_isIso (hP : RespectsIso @P) {R S T : CommRingCat} (f : R ⟶ S)
     (g : S ⟶ T) [IsIso g] : P (f ≫ g) ↔ P f :=
   ⟨fun H => by
     convert hP.1 (f ≫ g) (as_iso g).symm.commRingCatIsoToRingEquiv H
     change f = f ≫ g ≫ inv g; simp, hP.1 f (asIso g).commRingCatIsoToRingEquiv⟩
 #align ring_hom.respects_iso.cancel_right_is_iso RingHom.RespectsIso.cancel_right_isIso
+-/
 
 theorem RespectsIso.is_localization_away_iff (hP : RingHom.RespectsIso @P) {R S : Type _}
     (R' S' : Type _) [CommRing R] [CommRing S] [CommRing R'] [CommRing S'] [Algebra R R']
@@ -92,12 +98,14 @@ end RespectsIso
 
 section StableUnderComposition
 
+#print RingHom.StableUnderComposition /-
 /-- A property is `stable_under_composition` if the composition of two such morphisms
 still falls in the class. -/
 def StableUnderComposition : Prop :=
   ∀ ⦃R S T⦄ [CommRing R] [CommRing S] [CommRing T],
     ∀ (f : R →+* S) (g : S →+* T) (hf : P f) (hg : P g), P (g.comp f)
 #align ring_hom.stable_under_composition RingHom.StableUnderComposition
+-/
 
 variable {P}
 
@@ -113,6 +121,7 @@ end StableUnderComposition
 
 section StableUnderBaseChange
 
+#print RingHom.StableUnderBaseChange /-
 /-- A morphism property `P` is `stable_under_base_change` if `P(S →+* A)` implies
 `P(B →+* A ⊗[S] B)`. -/
 def StableUnderBaseChange : Prop :=
@@ -121,6 +130,7 @@ def StableUnderBaseChange : Prop :=
       ∀ [IsScalarTower R S S'] [IsScalarTower R R' S'],
         ∀ [Algebra.IsPushout R S R' S'], P (algebraMap R S) → P (algebraMap R' S')
 #align ring_hom.stable_under_base_change RingHom.StableUnderBaseChange
+-/
 
 theorem StableUnderBaseChange.mk (h₁ : RespectsIso @P)
     (h₂ :
@@ -158,6 +168,7 @@ omit P
 
 attribute [local instance] Algebra.TensorProduct.rightAlgebra
 
+#print RingHom.StableUnderBaseChange.pushout_inl /-
 theorem StableUnderBaseChange.pushout_inl (hP : RingHom.StableUnderBaseChange @P)
     (hP' : RingHom.RespectsIso @P) {R S T : CommRingCat} (f : R ⟶ S) (g : R ⟶ T) (H : P g) :
     P (pushout.inl : S ⟶ pushout f g) :=
@@ -173,6 +184,7 @@ theorem StableUnderBaseChange.pushout_inl (hP : RingHom.StableUnderBaseChange @P
   apply hP R T S (TensorProduct R S T)
   exact H
 #align ring_hom.stable_under_base_change.pushout_inl RingHom.StableUnderBaseChange.pushout_inl
+-/
 
 end StableUnderBaseChange
 
Diff
@@ -105,8 +105,8 @@ theorem StableUnderComposition.respectsIso (hP : RingHom.StableUnderComposition
     (hP' : ∀ {R S : Type _} [CommRing R] [CommRing S] (e : R ≃+* S), P e.to_ring_hom) :
     RingHom.RespectsIso @P := by
   constructor
-  · introv H; skip; apply hP; exacts[H, hP' e]
-  · introv H; skip; apply hP; exacts[hP' e, H]
+  · introv H; skip; apply hP; exacts [H, hP' e]
+  · introv H; skip; apply hP; exacts [hP' e, H]
 #align ring_hom.stable_under_composition.respects_iso RingHom.StableUnderComposition.respectsIso
 
 end StableUnderComposition
Diff
@@ -84,7 +84,7 @@ theorem RespectsIso.is_localization_away_iff (hP : RingHom.RespectsIso @P) {R S
   revert e₁ e₂
   dsimp [RingEquiv.toRingHom, IsLocalization.Away.map]
   simp only [CategoryTheory.comp_apply, RingEquiv.refl_apply, IsLocalization.algEquiv_apply,
-    IsLocalization.ringEquivOfRingEquiv_apply, RingHom.coe_mk, [anonymous],
+    IsLocalization.ringEquivOfRingEquiv_apply, RingHom.coe_mk, RingEquiv.toFun_eq_coe,
     IsLocalization.ringEquivOfRingEquiv_eq, IsLocalization.map_eq]
 #align ring_hom.respects_iso.is_localization_away_iff RingHom.RespectsIso.is_localization_away_iff
 
Diff
@@ -62,8 +62,7 @@ theorem RespectsIso.cancel_right_isIso (hP : RespectsIso @P) {R S T : CommRingCa
     (g : S ⟶ T) [IsIso g] : P (f ≫ g) ↔ P f :=
   ⟨fun H => by
     convert hP.1 (f ≫ g) (as_iso g).symm.commRingCatIsoToRingEquiv H
-    change f = f ≫ g ≫ inv g
-    simp, hP.1 f (asIso g).commRingCatIsoToRingEquiv⟩
+    change f = f ≫ g ≫ inv g; simp, hP.1 f (asIso g).commRingCatIsoToRingEquiv⟩
 #align ring_hom.respects_iso.cancel_right_is_iso RingHom.RespectsIso.cancel_right_isIso
 
 theorem RespectsIso.is_localization_away_iff (hP : RingHom.RespectsIso @P) {R S : Type _}
@@ -106,14 +105,8 @@ theorem StableUnderComposition.respectsIso (hP : RingHom.StableUnderComposition
     (hP' : ∀ {R S : Type _} [CommRing R] [CommRing S] (e : R ≃+* S), P e.to_ring_hom) :
     RingHom.RespectsIso @P := by
   constructor
-  · introv H
-    skip
-    apply hP
-    exacts[H, hP' e]
-  · introv H
-    skip
-    apply hP
-    exacts[hP' e, H]
+  · introv H; skip; apply hP; exacts[H, hP' e]
+  · introv H; skip; apply hP; exacts[hP' e, H]
 #align ring_hom.stable_under_composition.respects_iso RingHom.StableUnderComposition.respectsIso
 
 end StableUnderComposition
Diff
@@ -4,14 +4,14 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Andrew Yang
 
 ! This file was ported from Lean 3 source module ring_theory.ring_hom_properties
-! leanprover-community/mathlib commit b5aecf07a179c60b6b37c1ac9da952f3b565c785
+! 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.Algebra.Category.Ring.Constructions
 import Mathbin.Algebra.Category.Ring.Colimits
 import Mathbin.CategoryTheory.Isomorphism
-import Mathbin.RingTheory.Localization.Away
+import Mathbin.RingTheory.Localization.Away.Basic
 import Mathbin.RingTheory.IsTensorProduct
 
 /-!
Diff
@@ -54,16 +54,16 @@ variable {P}
 theorem RespectsIso.cancel_left_isIso (hP : RespectsIso @P) {R S T : CommRingCat} (f : R ⟶ S)
     (g : S ⟶ T) [IsIso f] : P (f ≫ g) ↔ P g :=
   ⟨fun H => by
-    convert hP.2 (f ≫ g) (as_iso f).symm.commRingIsoToRingEquiv H
-    exact (is_iso.inv_hom_id_assoc _ _).symm, hP.2 g (asIso f).commRingIsoToRingEquiv⟩
+    convert hP.2 (f ≫ g) (as_iso f).symm.commRingCatIsoToRingEquiv H
+    exact (is_iso.inv_hom_id_assoc _ _).symm, hP.2 g (asIso f).commRingCatIsoToRingEquiv⟩
 #align ring_hom.respects_iso.cancel_left_is_iso RingHom.RespectsIso.cancel_left_isIso
 
 theorem RespectsIso.cancel_right_isIso (hP : RespectsIso @P) {R S T : CommRingCat} (f : R ⟶ S)
     (g : S ⟶ T) [IsIso g] : P (f ≫ g) ↔ P f :=
   ⟨fun H => by
-    convert hP.1 (f ≫ g) (as_iso g).symm.commRingIsoToRingEquiv H
+    convert hP.1 (f ≫ g) (as_iso g).symm.commRingCatIsoToRingEquiv H
     change f = f ≫ g ≫ inv g
-    simp, hP.1 f (asIso g).commRingIsoToRingEquiv⟩
+    simp, hP.1 f (asIso g).commRingCatIsoToRingEquiv⟩
 #align ring_hom.respects_iso.cancel_right_is_iso RingHom.RespectsIso.cancel_right_isIso
 
 theorem RespectsIso.is_localization_away_iff (hP : RingHom.RespectsIso @P) {R S : Type _}

Changes in mathlib4

mathlib3
mathlib4
chore: remove tactics (#11365)

More tactics that are not used, found using the linter at #11308.

The PR consists of tactic removals, whitespace changes and replacing a porting note by an explanation.

Diff
@@ -109,11 +109,9 @@ theorem StableUnderComposition.respectsIso (hP : RingHom.StableUnderComposition
     RingHom.RespectsIso @P := by
   constructor
   · introv H
-    skip
     apply hP
     exacts [H, hP' e]
   · introv H
-    skip
     apply hP
     exacts [hP' e, H]
 #align ring_hom.stable_under_composition.respects_iso RingHom.StableUnderComposition.respectsIso
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -161,7 +161,7 @@ theorem StableUnderBaseChange.mk (h₁ : RespectsIso @P)
     exact map_mul f' _ _
   · ext x
     change _ = e (x ⊗ₜ[R] 1)
-    --Porting note: Had `dsimp only [e]` here, which didn't work anymore
+    -- Porting note: Had `dsimp only [e]` here, which didn't work anymore
     rw [h.symm.1.equiv_tmul, Algebra.smul_def, AlgHom.toLinearMap_apply, map_one, mul_one]
 #align ring_hom.stable_under_base_change.mk RingHom.StableUnderBaseChange.mk
 
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
@@ -87,7 +87,7 @@ theorem RespectsIso.is_localization_away_iff (hP : RingHom.RespectsIso @P) {R S
     convert this
   apply IsLocalization.ringHom_ext (Submonoid.powers r) _
   ext1 x
-  dsimp [IsLocalization.Away.map]
+  dsimp [e, e₁, e₂, IsLocalization.Away.map]
   simp only [IsLocalization.map_eq, id_apply, RingHomCompTriple.comp_apply]
 #align ring_hom.respects_iso.is_localization_away_iff RingHom.RespectsIso.is_localization_away_iff
 
@@ -149,7 +149,7 @@ theorem StableUnderBaseChange.mk (h₁ : RespectsIso @P)
     congr 1
     apply TensorProduct.ext'
     intro x y
-    simp [IsBaseChange.equiv_tmul, Algebra.smul_def]
+    simp [e, f', IsBaseChange.equiv_tmul, Algebra.smul_def]
   -- Porting Note: This had a lot of implicit inferences which didn't resolve anymore.
   -- Added those in
   convert h₁.1 (_ : R' →+* TensorProduct R R' S) (_ : TensorProduct R R' S ≃+* S')
style: reduce spacing variation in "porting note" comments (#10886)

In this pull request, I have systematically eliminated the leading whitespace preceding the colon (:) within all unlabelled or unclassified porting notes. This adjustment facilitates a more efficient review process for the remaining notes by ensuring no entries are overlooked due to formatting inconsistencies.

Diff
@@ -74,7 +74,7 @@ theorem RespectsIso.is_localization_away_iff (hP : RingHom.RespectsIso @P) {R S
   refine' (hP.cancel_right_isIso (CommRingCat.ofHom _) e₂.toCommRingCatIso.hom).symm.trans _
   rw [← eq_iff_iff]
   congr 1
-  -- Porting Note : Here, the proof used to have a huge `simp` involving `[anonymous]`, which didn't
+  -- Porting note: Here, the proof used to have a huge `simp` involving `[anonymous]`, which didn't
   -- work out anymore. The issue seemed to be that it couldn't handle a term in which Ring
   -- homomorphisms were repeatedly casted to the bundled category and back. Here we resolve the
   -- problem by converting the goal to a more straightforward form.
chore: remove many Type _ before the colon (#7718)

We have turned to Type* instead of Type _, but many of them remained in mathlib because the straight replacement did not work. In general, having Type _ before the colon is a code smell, though, as it hides which types should be in the same universe and which shouldn't, and is not very robust.

This PR replaces most of the remaining Type _ before the colon (except those in category theory) by Type* or Type u. This has uncovered a few bugs (where declarations were not as polymorphic as they should be).

I had to increase heartbeats at two places when replacing Type _ by Type*, but I think it's worth it as it's really more robust.

Diff
@@ -62,8 +62,8 @@ theorem RespectsIso.cancel_right_isIso (hP : RespectsIso @P) {R S T : CommRingCa
     simp, hP.1 f (asIso g).commRingCatIsoToRingEquiv⟩
 #align ring_hom.respects_iso.cancel_right_is_iso RingHom.RespectsIso.cancel_right_isIso
 
-theorem RespectsIso.is_localization_away_iff (hP : RingHom.RespectsIso @P) {R S : Type _}
-    (R' S' : Type _) [CommRing R] [CommRing S] [CommRing R'] [CommRing S'] [Algebra R R']
+theorem RespectsIso.is_localization_away_iff (hP : RingHom.RespectsIso @P) {R S : Type u}
+    (R' S' : Type u) [CommRing R] [CommRing S] [CommRing R'] [CommRing S'] [Algebra R R']
     [Algebra S S'] (f : R →+* S) (r : R) [IsLocalization.Away r R'] [IsLocalization.Away (f r) S'] :
     P (Localization.awayMap f r) ↔ P (IsLocalization.Away.map R' S' f r) := by
   let e₁ : R' ≃+* Localization.Away r :=
@@ -105,7 +105,7 @@ def StableUnderComposition : Prop :=
 variable {P}
 
 theorem StableUnderComposition.respectsIso (hP : RingHom.StableUnderComposition @P)
-    (hP' : ∀ {R S : Type _} [CommRing R] [CommRing S] (e : R ≃+* S), P e.toRingHom) :
+    (hP' : ∀ {R S : Type u} [CommRing R] [CommRing S] (e : R ≃+* S), P e.toRingHom) :
     RingHom.RespectsIso @P := by
   constructor
   · introv H
feat(RingTheory/TensorProduct): heterogenize (#6417)

This:

  • Improves the module docstring, which was both out of date and not very informative
  • Addresses a TODO to generalize includeLeft to commuting actions. As a result a few downstream results are changed to be about includeLeftRingHom or a ⊗ₜ 1, as carrying around the extra useless ring just makes the lemmas harder to use. Nothing seems to suffer from this change.
  • Introduces TensorProduct.AlgebraTensorModule.rid
  • Generalizes the following to work for towers of rings:
    • Algebra.TensorProduct.algHomOfLinearMapTensorProduct
    • Algebra.TensorProduct.map
    • Algebra.TensorProduct.congr
    • Algebra.TensorProduct.endTensorEndAlgHom
    • Algebra.TensorProduct.ext (and renames it to Algebra.TensorProduct.ext')
    • Algebra.TensorProduct.rid
  • Introduces a new Algebra.TensorProduct.ext which follows "partially-applied ext lemmas", and uses it to golf a proof in RingTheory/Etale.lean

I need many of these results for building AlgEquivs relating to the base change of clifford algebras.

Diff
@@ -136,7 +136,7 @@ theorem StableUnderBaseChange.mk (h₁ : RespectsIso @P)
       ∀ ⦃R S T⦄ [CommRing R] [CommRing S] [CommRing T],
         ∀ [Algebra R S] [Algebra R T],
           P (algebraMap R T) →
-            P (Algebra.TensorProduct.includeLeft.toRingHom : S →+* TensorProduct R S T)) :
+            P (Algebra.TensorProduct.includeLeftRingHom : S →+* TensorProduct R S T)) :
     StableUnderBaseChange @P := by
   introv R h H
   let e := h.symm.1.equiv
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,11 +2,6 @@
 Copyright (c) 2022 Andrew Yang. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Andrew Yang
-
-! This file was ported from Lean 3 source module ring_theory.ring_hom_properties
-! 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.Algebra.Category.Ring.Constructions
 import Mathlib.Algebra.Category.Ring.Colimits
@@ -14,6 +9,8 @@ import Mathlib.CategoryTheory.Iso
 import Mathlib.RingTheory.Localization.Away.Basic
 import Mathlib.RingTheory.IsTensorProduct
 
+#align_import ring_theory.ring_hom_properties from "leanprover-community/mathlib"@"a7c017d750512a352b623b1824d75da5998457d0"
+
 /-!
 # Properties of ring homomorphisms
 
chore: tidy various files (#5458)
Diff
@@ -20,10 +20,10 @@ import Mathlib.RingTheory.IsTensorProduct
 We provide the basic framework for talking about properties of ring homomorphisms.
 The following meta-properties of predicates on ring homomorphisms are defined
 
-* `ring_hom.respects_iso`: `P` respects isomorphisms if `P f → P (e ≫ f)` and
+* `RingHom.RespectsIso`: `P` respects isomorphisms if `P f → P (e ≫ f)` and
   `P f → P (f ≫ e)`, where `e` is an isomorphism.
-* `ring_hom.stable_under_composition`: `P` is stable under composition if `P f → P g → P (f ≫ g)`.
-* `ring_hom.stable_under_base_change`: `P` is stable under base change if `P (S ⟶ Y)`
+* `RingHom.StableUnderComposition`: `P` is stable under composition if `P f → P g → P (f ≫ g)`.
+* `RingHom.StableUnderBaseChange`: `P` is stable under base change if `P (S ⟶ Y)`
   implies `P (X ⟶ X ⊗[S] Y)`.
 
 -/
@@ -40,7 +40,7 @@ variable (P : ∀ {R S : Type u} [CommRing R] [CommRing S] (_ : R →+* S), Prop
 
 section RespectsIso
 
-/-- A property `respects_iso` if it still holds when composed with an isomorphism -/
+/-- A property `RespectsIso` if it still holds when composed with an isomorphism -/
 def RespectsIso : Prop :=
   (∀ {R S T : Type u} [CommRing R] [CommRing S] [CommRing T],
       ∀ (f : R →+* S) (e : S ≃+* T) (_ : P f), P (e.toRingHom.comp f)) ∧
@@ -98,7 +98,7 @@ end RespectsIso
 
 section StableUnderComposition
 
-/-- A property is `stable_under_composition` if the composition of two such morphisms
+/-- A property is `StableUnderComposition` if the composition of two such morphisms
 still falls in the class. -/
 def StableUnderComposition : Prop :=
   ∀ ⦃R S T⦄ [CommRing R] [CommRing S] [CommRing T],
@@ -114,18 +114,18 @@ theorem StableUnderComposition.respectsIso (hP : RingHom.StableUnderComposition
   · introv H
     skip
     apply hP
-    exacts[H, hP' e]
+    exacts [H, hP' e]
   · introv H
     skip
     apply hP
-    exacts[hP' e, H]
+    exacts [hP' e, H]
 #align ring_hom.stable_under_composition.respects_iso RingHom.StableUnderComposition.respectsIso
 
 end StableUnderComposition
 
 section StableUnderBaseChange
 
-/-- A morphism property `P` is `stable_under_base_change` if `P(S →+* A)` implies
+/-- A morphism property `P` is `StableUnderBaseChange` if `P(S →+* A)` implies
 `P(B →+* A ⊗[S] B)`. -/
 def StableUnderBaseChange : Prop :=
   ∀ (R S R' S') [CommRing R] [CommRing S] [CommRing R'] [CommRing S'],
@@ -142,7 +142,6 @@ theorem StableUnderBaseChange.mk (h₁ : RespectsIso @P)
             P (Algebra.TensorProduct.includeLeft.toRingHom : S →+* TensorProduct R S T)) :
     StableUnderBaseChange @P := by
   introv R h H
-  skip
   let e := h.symm.1.equiv
   let f' :=
     Algebra.TensorProduct.productMap (IsScalarTower.toAlgHom R R' S')
feat: port RingTheory.RingHomProperties (#4404)

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

Dependencies 10 + 677

678 files ported (98.5%)
276824 lines ported (98.8%)
Show graph

The unported dependencies are