Skip to content

Commit 7f97404

Browse files
chrisflavBergschaf
authored andcommitted
chore(CategoryTheory/Limits): preservation of pullbacks in terms of IsPullback (leanprover-community#39595)
1 parent 7008845 commit 7f97404

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

Mathlib/CategoryTheory/Limits/Preserves/Basic.lean

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,16 @@ instance [HasLimit K] {F : C ⥤ D} [PreservesLimit K F] : HasLimit (K ⋙ F) wh
175175
instance [HasColimit K] {F : C ⥤ D} [PreservesColimit K F] : HasColimit (K ⋙ F) where
176176
exists_colimit := ⟨_, isColimitOfPreserves F (colimit.isColimit K)⟩
177177

178+
/-- To show that `F` preserves the limit of `K`, we may assume that `K` has a limit. -/
179+
lemma PreservesLimit.mk' {F : C ⥤ D} (h : HasLimit K → PreservesLimit K F) :
180+
PreservesLimit K F where
181+
preserves hc := (h ⟨_, hc⟩).preserves hc
182+
183+
/-- To show that `F` preserves the colimit of `K`, we may assume that `K` has a colimit. -/
184+
lemma PreservesColimit.mk' {F : C ⥤ D} (h : HasColimit K → PreservesColimit K F) :
185+
PreservesColimit K F where
186+
preserves hc := (h ⟨_, hc⟩).preserves hc
187+
178188
section
179189

180190
variable {E : Type u₃} [ℰ : Category.{v₃} E]

Mathlib/CategoryTheory/Limits/Shapes/Pullback/IsPullback/Basic.lean

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,48 @@ theorem IsPushout.map_iff {D : Type*} [Category* D] (F : C ⥤ D) [PreservesColi
868868
IsPushout (F.map f) (F.map g) (F.map h) (F.map i) ↔ IsPushout f g h i :=
869869
fun h => h.of_map F e, fun h => h.map F⟩
870870

871+
variable {F} in
872+
lemma IsPullback.preservesLimit_cospan_iff {P X Y Z : C} {fst : P ⟶ X}
873+
{snd : P ⟶ Y} {f : X ⟶ Z} {g : Y ⟶ Z} (h : IsPullback fst snd f g) :
874+
PreservesLimit (cospan f g) F ↔ IsPullback (F.map fst) (F.map snd) (F.map f) (F.map g) := by
875+
refine ⟨fun _ ↦ h.map _, fun hF ↦ ?_⟩
876+
apply preservesLimit_of_preserves_limit_cone h.isLimit
877+
exact (PullbackCone.isLimitMapConeEquiv _ _).symm hF.isLimit
878+
879+
variable {F} in
880+
lemma IsPushout.preservesColimit_span_iff {P X Y Z : C} {inl : X ⟶ P}
881+
{inr : Y ⟶ P} {f : Z ⟶ X} {g : Z ⟶ Y} (h : IsPushout f g inl inr) :
882+
PreservesColimit (span f g) F ↔ IsPushout (F.map f) (F.map g) (F.map inl) (F.map inr) := by
883+
refine ⟨fun _ ↦ h.map _, fun hF ↦ ?_⟩
884+
apply preservesColimit_of_preserves_colimit_cocone h.isColimit
885+
exact (PushoutCocone.isColimitMapCoconeEquiv _ _).symm hF.isColimit
886+
887+
variable {F} in
888+
lemma Limits.preservesLimitsOfShape_walkingCospan_of_forall_isPullback
889+
(H : ∀ ⦃X Y Z : C⦄ (f : X ⟶ Z) (g : Y ⟶ Z) [HasPullback f g],
890+
∃ (P : C) (fst : P ⟶ X) (snd : P ⟶ Y),
891+
IsPullback fst snd f g ∧ IsPullback (F.map fst) (F.map snd) (F.map f) (F.map g)) :
892+
PreservesLimitsOfShape WalkingCospan F := by
893+
suffices h : ∀ {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z), PreservesLimit (cospan f g) F from
894+
fun {K} ↦ preservesLimit_of_iso_diagram _ (Limits.diagramIsoCospan K).symm⟩
895+
intro X Y Z f g
896+
refine .mk' fun h ↦ ?_
897+
obtain ⟨P, fst, snd, h, h'⟩ := H f g
898+
rwa [h.preservesLimit_cospan_iff]
899+
900+
variable {F} in
901+
lemma Limits.preservesColimitsOfShape_walkingCospan_of_forall_isPushout
902+
(H : ∀ ⦃X Y Z : C⦄ (f : Z ⟶ X) (g : Z ⟶ Y) [HasPushout f g],
903+
∃ (P : C) (inl : X ⟶ P) (inr : Y ⟶ P),
904+
IsPushout f g inl inr ∧ IsPushout (F.map f) (F.map g) (F.map inl) (F.map inr)) :
905+
PreservesColimitsOfShape WalkingSpan F := by
906+
suffices h : ∀ {X Y Z : C} (f : Z ⟶ X) (g : Z ⟶ Y), PreservesColimit (span f g) F from
907+
fun {K} ↦ preservesColimit_of_iso_diagram _ (diagramIsoSpan K).symm⟩
908+
intro X Y Z f g
909+
refine .mk' fun h ↦ ?_
910+
obtain ⟨P, fst, snd, h, h'⟩ := H f g
911+
rwa [h.preservesColimit_span_iff]
912+
871913
lemma IsPullback.app [HasPullbacks D] {F₁ F₂ F₃ F₄ : C ⥤ D}
872914
{f₁ : F₁ ⟶ F₂} {f₂ : F₁ ⟶ F₃} {f₃ : F₂ ⟶ F₄} {f₄ : F₃ ⟶ F₄} (h : IsPullback f₁ f₂ f₃ f₄)
873915
(X : C) : IsPullback (f₁.app X) (f₂.app X) (f₃.app X) (f₄.app X) :=

0 commit comments

Comments
 (0)