Skip to content

Commit 738f9b7

Browse files
committed
limits under
1 parent c60f516 commit 738f9b7

File tree

4 files changed

+147
-4
lines changed

4 files changed

+147
-4
lines changed

Mathlib/CategoryTheory/Limits/Comma.lean

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ namespace StructuredArrow
215215

216216
variable {X : T} {G : A ⥤ T} (F : J ⥤ StructuredArrow X G)
217217

218+
instance [G.Faithful] [G.Full] {Y : A} : HasInitial (StructuredArrow (G.obj Y) G) :=
219+
StructuredArrow.mkIdInitial.hasInitial
220+
218221
set_option backward.isDefEq.respectTransparency false in
219222
instance hasLimit [i₁ : HasLimit (F ⋙ proj X G)] [i₂ : PreservesLimit (F ⋙ proj X G) G] :
220223
HasLimit F := by
@@ -307,4 +310,10 @@ instance {X : T} : HasTerminal (Over X) := CostructuredArrow.hasTerminal
307310

308311
end Over
309312

313+
namespace Under
314+
315+
instance {X : T} : HasInitial (Under X) := Under.mkIdInitial.hasInitial
316+
317+
end Under
318+
310319
end CategoryTheory

Mathlib/CategoryTheory/Limits/Constructions/Over/Basic.lean

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,16 @@ instance hasLimits {B : C} [HasWidePullbacks.{w} C] : HasLimitsOfSize.{w, w} (Ov
4848
have := ConstructProducts.over_products_of_widePullbacks (B := B)
4949
apply has_limits_of_hasEqualizers_and_products
5050

51-
end CategoryTheory.Over
51+
end Over
52+
53+
namespace Under
54+
55+
instance {B : C} [HasFiniteWidePushouts C] : HasFiniteColimits (Under B) := by
56+
rw [← hasFiniteLimits_opposite_iff]
57+
exact hasFiniteLimits_of_hasLimitsLimits_of_createsFiniteLimits (Over.opEquivOpUnder _).inverse
58+
59+
instance {B : C} [HasWidePushouts.{w} C] : HasColimitsOfSize.{w, w} (Under B) := by
60+
rw [← hasLimitsOfSize_opposite_iff]
61+
exact hasLimits_of_hasLimits_createsLimits (Over.opEquivOpUnder _).inverse
62+
63+
end CategoryTheory.Under

Mathlib/CategoryTheory/Limits/Constructions/Over/Connected.lean

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Authors: Johan Commelin, Reid Barton, Bhavik Mehta
55
-/
66
module
77

8-
public import Mathlib.CategoryTheory.Limits.Creates
8+
public import Mathlib.CategoryTheory.Limits.Preserves.Creates.Opposites
99
public import Mathlib.CategoryTheory.Comma.Over.Basic
1010
public import Mathlib.CategoryTheory.IsConnected
1111
public import Mathlib.CategoryTheory.Filtered.Final
@@ -115,6 +115,29 @@ instance hasLimitsOfShape_of_isConnected {B : D} [IsConnected J] [HasLimitsOfSha
115115

116116
end CostructuredArrow
117117

118+
namespace StructuredArrow
119+
120+
/-- The projection from `StructuredArrow K B` to `C` creates any connected colimit. -/
121+
instance [IsConnected J] {B : D} : CreatesColimitsOfShape J (StructuredArrow.proj B K) :=
122+
letI : CreatesLimitsOfShape Jᵒᵖ (proj B K).op :=
123+
inferInstanceAs <| CreatesLimitsOfShape Jᵒᵖ <|
124+
(structuredArrowOpEquivalence K B).functor ⋙ CostructuredArrow.proj K.op (.op B)
125+
createsColimitsOfShapeOfOp _ _
126+
127+
set_option backward.isDefEq.respectTransparency false in
128+
/-- The forgetful functor from `StructuredArrow K B` preserves any connected colimit. -/
129+
instance [IsConnected J] {B : D} : PreservesColimitsOfShape J (StructuredArrow.proj B K) := by
130+
have : PreservesLimitsOfShape Jᵒᵖ (proj B K).op :=
131+
inferInstanceAs <| PreservesLimitsOfShape Jᵒᵖ <|
132+
(structuredArrowOpEquivalence K B).functor ⋙ CostructuredArrow.proj K.op (.op B)
133+
apply preservesColimitsOfShape_of_op
134+
135+
instance {B : D} [IsConnected J] [HasColimitsOfShape J C] :
136+
HasColimitsOfShape J (StructuredArrow B K) where
137+
has_colimit F := hasColimit_of_created F (StructuredArrow.proj B K)
138+
139+
end StructuredArrow
140+
118141
namespace Over
119142

120143
/-- The forgetful functor from the over category creates any connected limit. -/
@@ -160,4 +183,23 @@ def isLimitConePost [IsCofilteredOrEmpty J] {F : J ⥤ C} {c : Cone F} (i : J) (
160183
isLimitOfReflects (Over.forget _)
161184
((Functor.Initial.isLimitWhiskerEquiv (Over.forget i) c).symm hc)
162185

163-
end CategoryTheory.Over
186+
end Over
187+
188+
namespace Under
189+
190+
/-- The forgetful functor from the under category creates any connected limit. -/
191+
instance createsColimitsOfShapeForgetOfIsConnected [IsConnected J] {B : C} :
192+
CreatesColimitsOfShape J (forget B) :=
193+
inferInstanceAs <| CreatesColimitsOfShape J (StructuredArrow.proj _ _)
194+
195+
/-- The forgetful functor from the under category preserves any connected limit. -/
196+
instance preservesColimitsOfShape_forget_of_isConnected [IsConnected J] {B : C} :
197+
PreservesColimitsOfShape J (forget B) :=
198+
inferInstanceAs <| PreservesColimitsOfShape J (StructuredArrow.proj _ _)
199+
200+
/-- The under category has any connected limit which the original category has. -/
201+
instance hasColimitsOfShape_of_isConnected {B : C} [IsConnected J] [HasColimitsOfShape J C] :
202+
HasColimitsOfShape J (Under B) where
203+
has_colimit F := hasColimit_of_created F (forget B)
204+
205+
end CategoryTheory.Under

Mathlib/CategoryTheory/Limits/Opposites.lean

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ We construct limits and colimits in the opposite categories.
1818
@[expose] public section
1919

2020

21-
universe v₁ v₂ u₁ u₂
21+
universe w v₁ v₂ u₁ u₂
2222

2323
noncomputable section
2424

@@ -509,12 +509,26 @@ theorem hasColimits_of_hasLimits_op [HasLimitsOfSize.{v₂, u₂} Cᵒᵖ] :
509509
HasColimitsOfSize.{v₂, u₂} C :=
510510
{ has_colimits_of_shape := fun _ _ => hasColimitsOfShape_of_hasLimitsOfShape_op }
511511

512+
lemma hasColimitsOfSize_opposite_iff :
513+
HasColimitsOfSize.{v₂, u₂} Cᵒᵖ ↔ HasLimitsOfSize.{v₂, u₂} C :=
514+
fun _ ↦ hasLimits_of_hasColimits_op, fun _ ↦ inferInstance⟩
515+
516+
lemma hasLimitsOfSize_opposite_iff :
517+
HasLimitsOfSize.{v₂, u₂} Cᵒᵖ ↔ HasColimitsOfSize.{v₂, u₂} C :=
518+
fun _ ↦ hasColimits_of_hasLimits_op, fun _ ↦ inferInstance⟩
519+
512520
instance hasFiniteColimits_opposite [HasFiniteLimits C] : HasFiniteColimits Cᵒᵖ :=
513521
fun _ _ _ => hasColimitsOfShape_op_of_hasLimitsOfShape⟩
514522

515523
instance hasFiniteLimits_opposite [HasFiniteColimits C] : HasFiniteLimits Cᵒᵖ :=
516524
fun _ _ _ => hasLimitsOfShape_op_of_hasColimitsOfShape⟩
517525

526+
lemma hasFiniteLimits_opposite_iff : HasFiniteLimits Cᵒᵖ ↔ HasFiniteColimits C :=
527+
fun _ ↦ ⟨fun _ _ _ ↦ hasColimitsOfShape_of_hasLimitsOfShape_op⟩, fun _ ↦ inferInstance⟩
528+
529+
lemma hasFiniteColimits_opposite_iff : HasFiniteColimits Cᵒᵖ ↔ HasFiniteLimits C :=
530+
fun _ ↦ ⟨fun _ _ _ ↦ hasLimitsOfShape_of_hasColimitsOfShape_op⟩, fun _ ↦ inferInstance⟩
531+
518532
lemma hasColimit_op_iff_hasLimit {F : J ⥤ C} : HasColimit F.op ↔ HasLimit F :=
519533
fun _ ↦ hasLimit_of_hasColimit_op F, fun _ ↦ inferInstance⟩
520534

@@ -533,4 +547,70 @@ lemma hasLimit_leftOp_iff_hasColimit {F : J ⥤ Cᵒᵖ} : HasLimit F.leftOp ↔
533547
lemma hasLimit_rightOp_iff_hasColimit {F : Jᵒᵖ ⥤ C} : HasLimit F.rightOp ↔ HasColimit F :=
534548
fun _ ↦ hasColimit_of_hasLimit_rightOp F, fun _ ↦ inferInstance⟩
535549

550+
lemma hasLimitsOfShape_opposite_iff : HasLimitsOfShape J Cᵒᵖ ↔ HasColimitsOfShape Jᵒᵖ C := by
551+
refine ⟨fun _ ↦ ?_, fun _ ↦ inferInstance⟩
552+
have : HasLimitsOfShape Jᵒᵖᵒᵖ Cᵒᵖ := hasLimitsOfShape_of_equivalence (opOpEquivalence J).symm
553+
exact hasColimitsOfShape_of_hasLimitsOfShape_op
554+
555+
lemma hasColimitsOfShape_opposite_iff : HasColimitsOfShape J Cᵒᵖ ↔ HasLimitsOfShape Jᵒᵖ C := by
556+
refine ⟨fun _ ↦ ?_, fun _ ↦ inferInstance⟩
557+
have : HasColimitsOfShape Jᵒᵖᵒᵖ Cᵒᵖ := hasColimitsOfShape_of_equivalence (opOpEquivalence J).symm
558+
exact hasLimitsOfShape_of_hasColimitsOfShape_op
559+
560+
lemma hasLimitsOfShape_opposite_opposite_iff :
561+
HasLimitsOfShape Jᵒᵖ Cᵒᵖ ↔ HasColimitsOfShape J C := by
562+
refine ⟨fun _ ↦ hasColimitsOfShape_of_hasLimitsOfShape_op, fun _ ↦ ?_⟩
563+
have : HasColimitsOfShape Jᵒᵖᵒᵖ C := hasColimitsOfShape_of_equivalence (opOpEquivalence J).symm
564+
exact hasLimitsOfShape_op_of_hasColimitsOfShape
565+
566+
lemma hasColimitsOfShape_opposite_opposite_iff :
567+
HasColimitsOfShape Jᵒᵖ Cᵒᵖ ↔ HasLimitsOfShape J C := by
568+
refine ⟨fun _ ↦ hasLimitsOfShape_of_hasColimitsOfShape_op, fun _ ↦ ?_⟩
569+
have : HasLimitsOfShape Jᵒᵖᵒᵖ C := hasLimitsOfShape_of_equivalence (opOpEquivalence J).symm
570+
exact hasColimitsOfShape_op_of_hasLimitsOfShape
571+
572+
instance [HasWidePullbacks.{w} C] : HasWidePushouts.{w} Cᵒᵖ := by
573+
intro ι
574+
rw [hasColimitsOfShape_opposite_iff]
575+
exact hasLimitsOfShape_of_equivalence (widePushoutShapeOpEquiv _).symm
576+
577+
instance [HasWidePushouts.{w} C] : HasWidePullbacks.{w} Cᵒᵖ := by
578+
intro ι
579+
rw [hasLimitsOfShape_opposite_iff]
580+
exact hasColimitsOfShape_of_equivalence (widePullbackShapeOpEquiv _).symm
581+
582+
lemma hasWidePullbacks_opposite_iff :
583+
HasWidePullbacks.{w} Cᵒᵖ ↔ HasWidePushouts.{w} C := by
584+
refine ⟨fun h ι ↦ ?_, fun _ ↦ inferInstance⟩
585+
rw [← hasLimitsOfShape_opposite_opposite_iff]
586+
exact hasLimitsOfShape_of_equivalence (widePushoutShapeOpEquiv _).symm
587+
588+
lemma hasWidePushouts_opposite_iff :
589+
HasWidePushouts.{w} Cᵒᵖ ↔ HasWidePullbacks.{w} C := by
590+
refine ⟨fun h ι ↦ ?_, fun _ ↦ inferInstance⟩
591+
rw [← hasColimitsOfShape_opposite_opposite_iff]
592+
exact hasColimitsOfShape_of_equivalence (widePullbackShapeOpEquiv _).symm
593+
594+
instance [HasFiniteWidePullbacks C] : HasFiniteWidePushouts Cᵒᵖ := by
595+
refine ⟨fun J _ ↦ ?_⟩
596+
rw [hasColimitsOfShape_opposite_iff]
597+
exact hasLimitsOfShape_of_equivalence (widePushoutShapeOpEquiv _).symm
598+
599+
instance [HasFiniteWidePushouts C] : HasFiniteWidePullbacks Cᵒᵖ := by
600+
refine ⟨fun J _ ↦ ?_⟩
601+
rw [hasLimitsOfShape_opposite_iff]
602+
exact hasColimitsOfShape_of_equivalence (widePullbackShapeOpEquiv _).symm
603+
604+
lemma hasFiniteWidePullbacks_opposite_iff :
605+
HasFiniteWidePullbacks Cᵒᵖ ↔ HasFiniteWidePushouts C := by
606+
refine ⟨fun h ↦ ⟨fun J _ ↦ ?_⟩, fun _ ↦ inferInstance⟩
607+
rw [← hasLimitsOfShape_opposite_opposite_iff]
608+
exact hasLimitsOfShape_of_equivalence (widePushoutShapeOpEquiv _).symm
609+
610+
lemma hasFiniteWidePushouts_opposite_iff :
611+
HasFiniteWidePushouts Cᵒᵖ ↔ HasFiniteWidePullbacks C := by
612+
refine ⟨fun h ↦ ⟨fun J _ ↦ ?_⟩, fun _ ↦ inferInstance⟩
613+
rw [← hasColimitsOfShape_opposite_opposite_iff]
614+
exact hasColimitsOfShape_of_equivalence (widePullbackShapeOpEquiv _).symm
615+
536616
end CategoryTheory.Limits

0 commit comments

Comments
 (0)