Skip to content

Commit 7ea6142

Browse files
committed
feat(Algebra/Category/Ring): Under.pushout preserves finite limits for properties with stable equalizers (#39572)
We introduce a predicate `RingHom.HasStableEqualizers` for properties of ring homomorphisms: This is satisfied for `P` if base change along *arbitrary* ring homomorphisms preserves the equalizer of any two algebra maps between algebras satisfying `P`. In a follow-up PR we will show that finite étale ring homomorphisms satisfy this predicate. We relate `RingHom.HasStableEqualizers` to preservation of finite limits in `P.Under R` for `R : CommRingCat`. From Pi1.
1 parent 9de16f2 commit 7ea6142

6 files changed

Lines changed: 135 additions & 2 deletions

File tree

Mathlib/Algebra/Category/Ring/Under/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def toUnder {A B : Type u} [CommRing A] [CommRing B] [Algebra R A] [Algebra R B]
8080
@[simp]
8181
lemma toUnder_right {A B : Type u} [CommRing A] [CommRing B] [Algebra R A]
8282
[Algebra R B] (f : A →ₐ[R] B) (a : A) :
83-
f.toUnder.right a = f a :=
83+
Under.Hom.right f.toUnder a = f a :=
8484
rfl
8585

8686
@[simp]
@@ -130,7 +130,7 @@ variable [Algebra R S]
130130

131131
variable (R S) in
132132
/-- The base change functor `A ↦ S ⊗[R] A`. -/
133-
@[simps! map_right]
133+
@[simps! obj_right map_right]
134134
def tensorProd : Under R ⥤ Under S where
135135
obj A := mkUnder S (S ⊗[R] A)
136136
map f := Algebra.TensorProduct.map (AlgHom.id S S) (toAlgHom f) |>.toUnder

Mathlib/Algebra/Category/Ring/Under/Property.lean

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module
88
public import Mathlib.Algebra.Category.Ring.Under.Limits
99
public import Mathlib.CategoryTheory.Limits.MorphismProperty
1010
public import Mathlib.CategoryTheory.ObjectProperty.FiniteProducts
11+
public import Mathlib.CategoryTheory.ConcreteCategory.EpiMono
1112

1213
/-!
1314
# Properties of `P.Under ⊤ R` for `R : CommRingCat`
@@ -19,6 +20,8 @@ In this file we translate ring theoretic properties of a property of ring homomo
1920
2021
- `CommRingCat.Under.hasFiniteLimits`: If `P` is stable under finite products and equalizers,
2122
`P.Under ⊤ R` has finite limits.
23+
- `RingHom.HasStableEqualizers.preservesFiniteLimits_pushout`: If `P` has stable equalizers,
24+
base change along arbitrary morphisms preserve finite limits.
2225
-/
2326

2427
@[expose] public section
@@ -80,6 +83,18 @@ lemma RingHom.HasFiniteProducts.hasFiniteProducts (hQi : RespectsIso Q) (hQp : H
8083
have := hQp.createsFiniteProductsForget hQi R
8184
exact CategoryTheory.hasLimit_of_created D (Under.forget _ _ R)
8285

86+
lemma RingHom.HasFiniteProducts.preservesFiniteProducts_pushout (hQi : RingHom.RespectsIso Q)
87+
(hQp : RingHom.HasFiniteProducts Q) [(toMorphismProperty Q).IsStableUnderCobaseChange]
88+
{R S : CommRingCat.{u}} (f : R ⟶ S) :
89+
PreservesFiniteProducts (Under.pushout (toMorphismProperty Q) ⊤ f) := by
90+
have := hQp.createsFiniteProductsForget hQi R
91+
refine ⟨fun n ↦ ⟨fun {K} ↦ ?_⟩⟩
92+
have : PreservesLimit K (Under.pushout (toMorphismProperty Q) ⊤ f ⋙
93+
Under.forget (toMorphismProperty Q) ⊤ S) := by
94+
rw [preservesLimit_iff_of_natIso _ (Under.pushoutCompForgetIso _)]
95+
infer_instance
96+
exact preservesLimit_of_reflects_of_preserves _ (MorphismProperty.Under.forget _ ⊤ S)
97+
8398
/-- If `Q` is stable under equalizers, the inclusion from the subcategory of `Under R` defined
8499
by `Q` creates equalizers. -/
85100
@[implicit_reducible]
@@ -117,3 +132,74 @@ lemma Under.hasFiniteLimits (hQi : RingHom.RespectsIso Q)
117132
hasFiniteLimits_of_hasEqualizers_and_finite_products
118133

119134
end CommRingCat
135+
136+
variable (P : ∀ {R S : Type u} [CommRing R] [CommRing S], (R →+* S) → Prop)
137+
138+
open RingHom
139+
140+
variable {P}
141+
142+
lemma CommRingCat.preservesLimit_parallelPair_tensorProd_iff_tensorEqualizer_bijective
143+
{R S : CommRingCat.{u}} [Algebra R S] {A B : Under R} {f g : A ⟶ B} :
144+
PreservesLimit (parallelPair f g) (tensorProd R S) ↔
145+
Function.Bijective ((toAlgHom f).tensorEqualizer R S (toAlgHom g)) := by
146+
let c : Fork f g := Under.equalizerFork f g
147+
let hc : IsLimit c := Under.equalizerForkIsLimit f g
148+
let ι : R.mkUnder (AlgHom.equalizer (toAlgHom f) (toAlgHom g)) ⟶ A :=
149+
(AlgHom.equalizer (toAlgHom f) (toAlgHom g)).val.toUnder
150+
let h' := (R.tensorProd S).map ι
151+
have w' : h' ≫ (tensorProd R S).map f = h' ≫ (tensorProd R S).map g := by
152+
simpa using congr((R.tensorProd S).map $(CommRingCat.Under.equalizer_comp f g))
153+
let e : IsLimit ((R.tensorProd S).mapCone c) ≃ IsLimit (Fork.ofι h' w') :=
154+
isLimitMapConeForkEquiv (tensorProd R S) (Under.equalizer_comp f g)
155+
rw [preservesLimit_iff_isLimit_mapCone hc, e.nonempty_congr,
156+
(Under.equalizerForkIsLimit _ _).nonempty_isLimit_iff_isIso_lift]
157+
have heq : (Under.equalizerForkIsLimit _ _).lift (Fork.ofι h' w') =
158+
(AlgHom.tensorEqualizer S S (toAlgHom f) (toAlgHom g)).toUnder ≫
159+
Under.homMk (CommRingCat.ofHom (.id _)) := by
160+
refine Fork.IsLimit.hom_ext (Under.equalizerForkIsLimit _ _) ?_
161+
rw [Fork.IsLimit.lift_ι]
162+
ext : 2
163+
dsimp
164+
ext x <;> rfl
165+
rw [heq, ← isIso_iff_of_reflects_iso _ (CategoryTheory.Under.forget S),
166+
ConcreteCategory.isIso_iff_bijective]
167+
rfl
168+
169+
lemma RingHom.HasStableEqualizers.preservesLimit_parallelPair_tensorProd
170+
(hPse : HasStableEqualizers P) {R S : CommRingCat.{u}} [Algebra R S]
171+
{A B : Under R} (f g : A ⟶ B) (hA : P A.hom.hom) (hB : P B.hom.hom) :
172+
PreservesLimit (parallelPair f g) (CommRingCat.tensorProd R S) := by
173+
rw [CommRingCat.preservesLimit_parallelPair_tensorProd_iff_tensorEqualizer_bijective]
174+
exact hPse _ _ hA hB
175+
176+
lemma RingHom.HasStableEqualizers.preservesEqualizers_pushout (hPi : RespectsIso P)
177+
(hPe : HasEqualizers P) (hPse : HasStableEqualizers P)
178+
[(toMorphismProperty P).IsStableUnderCobaseChange] {R S : CommRingCat.{u}} (f : R ⟶ S) :
179+
PreservesLimitsOfShape WalkingParallelPair (Under.pushout (toMorphismProperty P) ⊤ f) := by
180+
refine ⟨fun {K} ↦ ?_⟩
181+
have := hPe.createsLimitsWalkingParallelPair hPi R
182+
algebraize [f.hom]
183+
have : PreservesLimit (K ⋙ Under.forget (toMorphismProperty P) ⊤ R)
184+
(CategoryTheory.Under.pushout f) := by
185+
rw [← CommRingCat.ofHom_hom f,
186+
← preservesLimit_iff_of_natIso _ (CommRingCat.tensorProdIsoPushout R S),
187+
← preservesLimit_iff_of_iso_diagram _ (diagramIsoParallelPair _).symm]
188+
exact hPse.preservesLimit_parallelPair_tensorProd _ _ ((K.obj _).prop) ((K.obj _).prop)
189+
have : PreservesLimit K (Under.pushout (toMorphismProperty P) ⊤ f ⋙
190+
Under.forget (toMorphismProperty P) ⊤ S) := by
191+
rw [preservesLimit_iff_of_natIso _ (Under.pushoutCompForgetIso _)]
192+
infer_instance
193+
exact preservesLimit_of_reflects_of_preserves _ (Under.forget _ ⊤ S)
194+
195+
/-- If `P` is a property of ring homs that is stable under finite products and
196+
equalizers, and the latter are preserved by arbitrary base change,
197+
pushout along any ring homomorphism preserves finite limits. -/
198+
lemma RingHom.HasStableEqualizers.preservesFiniteLimits_pushout (hPi : RingHom.RespectsIso P)
199+
(hPp : HasFiniteProducts P) (hPe : HasEqualizers P) (hPse : HasStableEqualizers P)
200+
[(toMorphismProperty P).IsStableUnderCobaseChange] {R S : CommRingCat.{u}} (f : R ⟶ S) :
201+
PreservesFiniteLimits (Under.pushout (toMorphismProperty P) ⊤ f) :=
202+
have := hPp.preservesFiniteProducts_pushout hPi f
203+
have := hPse.preservesEqualizers_pushout hPi hPe f
204+
have := CommRingCat.Under.hasFiniteLimits hPi hPp hPe
205+
preservesFiniteLimits_of_preservesEqualizers_and_finiteProducts _

Mathlib/CategoryTheory/Limits/Preserves/Basic.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ lemma preservesLimit_of_iso_diagram {K₁ K₂ : J ⥤ C} (F : C ⥤ D) (h : K
231231
apply IsLimit.ofIsoLimit (isLimitOfPreserves F this)
232232
exact Cone.ext (Iso.refl _)⟩
233233

234+
lemma preservesLimit_iff_of_iso_diagram {K₁ K₂ : J ⥤ C} (F : C ⥤ D) (h : K₁ ≅ K₂) :
235+
PreservesLimit K₁ F ↔ PreservesLimit K₂ F :=
236+
fun _ ↦ preservesLimit_of_iso_diagram _ h, fun _ ↦ preservesLimit_of_iso_diagram _ h.symm⟩
237+
234238
/-- Transfer preservation of a limit along a natural isomorphism in the functor. -/
235239
lemma preservesLimit_of_natIso (K : J ⥤ C) {F G : C ⥤ D} (h : F ≅ G) [PreservesLimit K F] :
236240
PreservesLimit K G where
@@ -307,6 +311,10 @@ lemma preservesColimit_of_iso_diagram {K₁ K₂ : J ⥤ C} (F : C ⥤ D) (h : K
307311
apply IsColimit.ofIsoColimit (isColimitOfPreserves F this)
308312
exact Cocone.ext (Iso.refl _)⟩
309313

314+
lemma preservesColimit_iff_of_iso_diagram {K₁ K₂ : J ⥤ C} (F : C ⥤ D) (h : K₁ ≅ K₂) :
315+
PreservesColimit K₁ F ↔ PreservesColimit K₂ F :=
316+
fun _ ↦ preservesColimit_of_iso_diagram _ h, fun _ ↦ preservesColimit_of_iso_diagram _ h.symm⟩
317+
310318
/-- Transfer preservation of a colimit along a natural isomorphism in the functor. -/
311319
lemma preservesColimit_of_natIso (K : J ⥤ C) {F G : C ⥤ D} (h : F ≅ G) [PreservesColimit K F] :
312320
PreservesColimit K G where

Mathlib/CategoryTheory/MorphismProperty/Limits.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,17 @@ as `f`, the pullback of that morphism along `f` exists. -/
131131
protected class HasPullbacksAlong {X Y : C} (f : X ⟶ Y) : Prop where
132132
hasPullback {W} (g : W ⟶ Y) : P g → HasPullback g f
133133

134+
instance {X Y : C} (f : X ⟶ Y) [HasPullbacksAlong f] : P.HasPullbacksAlong f where
135+
hasPullback _ _ := inferInstance
136+
134137
/-- `P.HasPushoutsAlong f` states that for any morphism satisfying `P` with the same domain
135138
as `f`, the pushout of that morphism along `f` exists. -/
136139
protected class HasPushoutsAlong {X Y : C} (f : X ⟶ Y) : Prop where
137140
hasPushout {W} (g : X ⟶ W) : P g → HasPushout g f
138141

142+
instance {X Y : C} (f : X ⟶ Y) [HasPushoutsAlong f] : P.HasPushoutsAlong f where
143+
hasPushout _ _ := inferInstance
144+
139145
/-- `P.IsStableUnderBaseChangeAlong f` states that for any morphism satisfying `P` with the same
140146
codomain as `f`, any pullback of that morphism along `f` also satisfies `P`. -/
141147
class IsStableUnderBaseChangeAlong {X Y : C} (f : X ⟶ Y) : Prop where

Mathlib/CategoryTheory/MorphismProperty/OverAdjunction.lean

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,15 @@ noncomputable def Over.pullbackMapHomPullback [P.IsStableUnderComposition]
157157
Over.homMk (pullback.map _ _ _ _ (𝟙 A.left) f (𝟙 Z) (by simp) (by cat_disch))
158158
(by simp) (Q.pullbackMap (Q.id_mem _) hQf (by simp) (by cat_disch))
159159

160+
/-- `MorphismProperty.Over.pullback` commutes with `MorphismProperty.Over.forget`. -/
161+
@[simps!]
162+
noncomputable
163+
def Over.pullbackCompForgetIso {X Y : T} (f : X ⟶ Y) [HasPullbacksAlong f]
164+
[P.IsStableUnderBaseChangeAlong f] [Q.IsStableUnderBaseChange] :
165+
Over.pullback P Q f ⋙ Over.forget _ _ _ ≅
166+
Over.forget _ _ _ ⋙ CategoryTheory.Over.pullback f :=
167+
Iso.refl _
168+
160169
end Pullback
161170

162171
section Adjunction
@@ -297,6 +306,15 @@ lemma Under.pushoutCongr_hom_app_left_fst {f : X ⟶ Y} [P.HasPushoutsAlong f] {
297306
subst h
298307
simp [pushoutCongr]
299308

309+
/-- `MorphismProperty.Under.pushout` commutes with `MorphismProperty.Under.forget`. -/
310+
@[simps!]
311+
noncomputable
312+
def Under.pushoutCompForgetIso {X Y : T} (f : X ⟶ Y) [HasPushoutsAlong f]
313+
[P.IsStableUnderCobaseChangeAlong f] [Q.IsStableUnderCobaseChange] :
314+
Under.pushout P Q f ⋙ Under.forget _ _ _ ≅
315+
Under.forget _ _ _ ⋙ CategoryTheory.Under.pushout f :=
316+
Iso.refl _
317+
300318
end Pushout
301319

302320
section Adjunction

Mathlib/RingTheory/Flat/Equalizer.lean

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,3 +351,18 @@ lemma Algebra.kerTensorProductMapIdToAlgHomEquiv_symm_apply [Module.Flat R T]
351351
x ⊗ₜ (y * z.1) := rfl
352352

353353
end Algebra
354+
355+
namespace RingHom
356+
357+
/--
358+
A property `P` of ring homomorphisms is said to have stable equalizers, if the equalizer
359+
of algebra maps between algebras with structure morphisms satisfying `P`, is preserved by
360+
arbitrary base change.
361+
-/
362+
def HasStableEqualizers (P : ∀ {R S : Type u} [CommRing R] [CommRing S], (R →+* S) → Prop) : Prop :=
363+
∀ {R S A B : Type u} [CommRing R] [CommRing S] [CommRing A] [CommRing B]
364+
[Algebra R A] [Algebra R S] [Algebra R B]
365+
(f g : A →ₐ[R] B), P (algebraMap R A) → P (algebraMap R B) →
366+
Function.Bijective (f.tensorEqualizer R S g)
367+
368+
end RingHom

0 commit comments

Comments
 (0)