@@ -161,6 +161,13 @@ theorem map_map_left : ((map f).map g).left = g.left :=
161161 rfl
162162end
163163
164+ /-- If `f` is an isomorphism, `map f` is an equivalence of categories. -/
165+ def mapIso {Y : T} (f : X ≅ Y) : Over X ≌ Over Y :=
166+ Comma.mapRightIso _ <| Discrete.natIso fun _ ↦ f
167+
168+ @[simp] lemma mapIso_functor {Y : T} (f : X ≅ Y) : (mapIso f).functor = map f.hom := rfl
169+ @[simp] lemma mapIso_inverse {Y : T} (f : X ≅ Y) : (mapIso f).inverse = map f.inv := rfl
170+
164171section coherences
165172/-!
166173This section proves various equalities between functors that
@@ -186,6 +193,7 @@ theorem mapId_eq (Y : T) : map (𝟙 Y) = 𝟭 _ := by
186193 simp
187194
188195/-- The natural isomorphism arising from `mapForget_eq`. -/
196+ @[simps!]
189197def mapId (Y : T) : map (𝟙 Y) ≅ 𝟭 _ := eqToIso (mapId_eq Y)
190198-- NatIso.ofComponents fun X => isoMk (Iso.refl _)
191199
@@ -215,9 +223,16 @@ theorem mapComp_eq {X Y Z : T} (f : X ⟶ Y) (g : Y ⟶ Z) :
215223 simp
216224
217225/-- The natural isomorphism arising from `mapComp_eq`. -/
226+ @[simps!]
218227def mapComp {X Y Z : T} (f : X ⟶ Y) (g : Y ⟶ Z) :
219228 map (f ≫ g) ≅ (map f) ⋙ (map g) := eqToIso (mapComp_eq f g)
220229
230+ /-- If `f = g`, then `map f` is naturally isomorphic to `map g`. -/
231+ @[simps!]
232+ def mapCongr {X Y : T} (f g : X ⟶ Y) (h : f = g) :
233+ map f ≅ map g :=
234+ NatIso.ofComponents (fun A ↦ eqToIso (by rw [h]))
235+
221236variable (T) in
222237/-- The functor defined by the over categories.-/
223238@[simps] def mapFunctor : T ⥤ Cat where
@@ -317,6 +332,57 @@ def post (F : T ⥤ D) : Over X ⥤ Over (F.obj X) where
317332 map f := Over.homMk (F.map f.left)
318333 (by simp only [Functor.id_obj, mk_left, Functor.const_obj_obj, mk_hom, ← F.map_comp, w])
319334
335+ lemma post_comp {E : Type *} [Category E] (F : T ⥤ D) (G : D ⥤ E) :
336+ post (X := X) (F ⋙ G) = post (X := X) F ⋙ post G :=
337+ rfl
338+
339+ /-- `post (F ⋙ G)` is isomorphic (actually equal) to `post F ⋙ post G`. -/
340+ @[simps!]
341+ def postComp {E : Type *} [Category E] (F : T ⥤ D) (G : D ⥤ E) :
342+ post (X := X) (F ⋙ G) ≅ post F ⋙ post G :=
343+ NatIso.ofComponents (fun X ↦ Iso.refl _)
344+
345+ /-- A natural transformation `F ⟶ G` induces a natural transformation on
346+ `Over X` up to `Under.map`. -/
347+ @[simps]
348+ def postMap {F G : T ⥤ D} (e : F ⟶ G) : post F ⋙ map (e.app X) ⟶ post G where
349+ app Y := Over.homMk (e.app Y.left)
350+
351+ /-- If `F` and `G` are naturally isomorphic, then `Over.post F` and `Over.post G` are also naturally
352+ isomorphic up to `Over.map` -/
353+ @[simps!]
354+ def postCongr {F G : T ⥤ D} (e : F ≅ G) : post F ⋙ map (e.hom.app X) ≅ post G :=
355+ NatIso.ofComponents (fun A ↦ Over.isoMk (e.app A.left))
356+
357+ variable (X) (F : T ⥤ D)
358+
359+ instance [F.Faithful] : (Over.post (X := X) F).Faithful where
360+ map_injective {A B} f g h := by
361+ ext
362+ exact F.map_injective (congrArg CommaMorphism.left h)
363+
364+ instance [F.Faithful] [F.Full] : (Over.post (X := X) F).Full where
365+ map_surjective {A B} f := by
366+ obtain ⟨a, ha⟩ := F.map_surjective f.left
367+ have w : a ≫ B.hom = A.hom := F.map_injective <| by simpa [ha] using Over.w _
368+ exact ⟨Over.homMk a, by ext; simpa⟩
369+
370+ instance [F.Full] [F.EssSurj] : (Over.post (X := X) F).EssSurj where
371+ mem_essImage B := by
372+ obtain ⟨A', ⟨e⟩⟩ := Functor.EssSurj.mem_essImage (F := F) B.left
373+ obtain ⟨f, hf⟩ := F.map_surjective (e.hom ≫ B.hom)
374+ exact ⟨Over.mk f, ⟨Over.isoMk e⟩⟩
375+
376+ instance [F.IsEquivalence] : (Over.post (X := X) F).IsEquivalence where
377+
378+ /-- An equivalence of categories induces an equivalence on over categories. -/
379+ @[simps]
380+ def postEquiv (F : T ≌ D) : Over X ≌ Over (F.functor.obj X) where
381+ functor := Over.post F.functor
382+ inverse := Over.post (X := F.functor.obj X) F.inverse ⋙ Over.map (F.unitIso.inv.app X)
383+ unitIso := NatIso.ofComponents (fun A ↦ Over.isoMk (F.unitIso.app A.left))
384+ counitIso := NatIso.ofComponents (fun A ↦ Over.isoMk (F.counitIso.app A.left))
385+
320386end Over
321387
322388namespace CostructuredArrow
@@ -457,6 +523,13 @@ theorem map_map_right : ((map f).map g).right = g.right :=
457523 rfl
458524end
459525
526+ /-- If `f` is an isomorphism, `map f` is an equivalence of categories. -/
527+ def mapIso {Y : T} (f : X ≅ Y) : Under Y ≌ Under X :=
528+ Comma.mapLeftIso _ <| Discrete.natIso fun _ ↦ f.symm
529+
530+ @[simp] lemma mapIso_functor {Y : T} (f : X ≅ Y) : (mapIso f).functor = map f.hom := rfl
531+ @[simp] lemma mapIso_inverse {Y : T} (f : X ≅ Y) : (mapIso f).inverse = map f.inv := rfl
532+
460533section coherences
461534/-!
462535This section proves various equalities between functors that
@@ -476,6 +549,7 @@ theorem mapId_eq (Y : T) : map (𝟙 Y) = 𝟭 _ := by
476549 simp
477550
478551/-- Mapping by the identity morphism is just the identity functor. -/
552+ @[simps!]
479553def mapId (Y : T) : map (𝟙 Y) ≅ 𝟭 _ := eqToIso (mapId_eq Y)
480554
481555/-- Mapping by `f` and then forgetting is the same as forgetting. -/
@@ -504,9 +578,16 @@ theorem mapComp_eq {X Y Z : T} (f : X ⟶ Y) (g : Y ⟶ Z) :
504578 simp
505579
506580/-- The natural isomorphism arising from `mapComp_eq`. -/
581+ @[simps!]
507582def mapComp {Y Z : T} (f : X ⟶ Y) (g : Y ⟶ Z) : map (f ≫ g) ≅ map g ⋙ map f :=
508583 eqToIso (mapComp_eq f g)
509584
585+ /-- If `f = g`, then `map f` is naturally isomorphic to `map g`. -/
586+ @[simps!]
587+ def mapCongr {X Y : T} (f g : X ⟶ Y) (h : f = g) :
588+ map f ≅ map g :=
589+ NatIso.ofComponents (fun A ↦ eqToIso (by rw [h]))
590+
510591variable (T) in
511592/-- The functor defined by the under categories.-/
512593@[simps] def mapFunctor : Tᵒᵖ ⥤ Cat where
@@ -570,6 +651,58 @@ def post {X : T} (F : T ⥤ D) : Under X ⥤ Under (F.obj X) where
570651 map f := Under.homMk (F.map f.right)
571652 (by simp only [Functor.id_obj, Functor.const_obj_obj, mk_right, mk_hom, ← F.map_comp, w])
572653
654+ lemma post_comp {E : Type *} [Category E] (F : T ⥤ D) (G : D ⥤ E) :
655+ post (X := X) (F ⋙ G) = post (X := X) F ⋙ post G :=
656+ rfl
657+
658+ /-- `post (F ⋙ G)` is isomorphic (actually equal) to `post F ⋙ post G`. -/
659+ @[simps!]
660+ def postComp {E : Type *} [Category E] (F : T ⥤ D) (G : D ⥤ E) :
661+ post (X := X) (F ⋙ G) ≅ post F ⋙ post G :=
662+ NatIso.ofComponents (fun X ↦ Iso.refl _)
663+
664+ /-- A natural transformation `F ⟶ G` induces a natural transformation on
665+ `Under X` up to `Under.map`. -/
666+ @[simps]
667+ def postMap {F G : T ⥤ D} (e : F ⟶ G) : post (X := X) F ⟶ post G ⋙ map (e.app X) where
668+ app Y := Under.homMk (e.app Y.right)
669+
670+ /-- If `F` and `G` are naturally isomorphic, then `Under.post F` and `Under.post G` are also
671+ naturally isomorphic up to `Under.map` -/
672+ @[simps!]
673+ def postCongr {F G : T ⥤ D} (e : F ≅ G) : post F ≅ post G ⋙ map (e.hom.app X) :=
674+ NatIso.ofComponents (fun A ↦ Under.isoMk (e.app A.right))
675+
676+ variable (X) (F : T ⥤ D)
677+
678+ instance [F.Faithful] : (Under.post (X := X) F).Faithful where
679+ map_injective {A B} f g h := by
680+ ext
681+ exact F.map_injective (congrArg CommaMorphism.right h)
682+
683+ instance [F.Faithful] [F.Full] : (Under.post (X := X) F).Full where
684+ map_surjective {A B} f := by
685+ obtain ⟨a, ha⟩ := F.map_surjective f.right
686+ dsimp at a
687+ have w : A.hom ≫ a = B.hom := F.map_injective <| by simpa [ha] using Under.w f
688+ exact ⟨Under.homMk a, by ext; simpa⟩
689+
690+ instance [F.Full] [F.EssSurj] : (Under.post (X := X) F).EssSurj where
691+ mem_essImage B := by
692+ obtain ⟨B', ⟨e⟩⟩ := Functor.EssSurj.mem_essImage (F := F) B.right
693+ obtain ⟨f, hf⟩ := F.map_surjective (B.hom ≫ e.inv)
694+ exact ⟨Under.mk f, ⟨Under.isoMk e⟩⟩
695+
696+ instance [F.IsEquivalence] : (Under.post (X := X) F).IsEquivalence where
697+
698+ /-- An equivalence of categories induces an equivalence on under categories. -/
699+ @[simps]
700+ def postEquiv (F : T ≌ D) : Under X ≌ Under (F.functor.obj X) where
701+ functor := post F.functor
702+ inverse := post (X := F.functor.obj X) F.inverse ⋙ Under.map (F.unitIso.hom.app X)
703+ unitIso := NatIso.ofComponents (fun A ↦ Under.isoMk (F.unitIso.app A.right))
704+ counitIso := NatIso.ofComponents (fun A ↦ Under.isoMk (F.counitIso.app A.right))
705+
573706end Under
574707
575708namespace StructuredArrow
@@ -774,4 +907,52 @@ def ofDiagEquivalence' (X : T × T) :
774907
775908end CostructuredArrow
776909
910+ section Opposite
911+
912+ open Opposite
913+
914+ variable (X : T)
915+
916+ /-- The canonical functor by reversing structure arrows. -/
917+ @[simps]
918+ def Over.opToOpUnder : Over (op X) ⥤ (Under X)ᵒᵖ where
919+ obj Y := ⟨Under.mk Y.hom.unop⟩
920+ map {Z Y} f := ⟨Under.homMk (f.left.unop) (by dsimp; rw [← unop_comp, Over.w])⟩
921+
922+ /-- The canonical functor by reversing structure arrows. -/
923+ @[simps]
924+ def Under.opToOverOp : (Under X)ᵒᵖ ⥤ Over (op X) where
925+ obj Y := Over.mk (Y.unop.hom.op)
926+ map {Z Y} f := Over.homMk f.unop.right.op <| by dsimp; rw [← Under.w f.unop, op_comp]
927+
928+ /-- `Over.opToOpUnder` is an equivalence of categories. -/
929+ @[simps]
930+ def Over.opEquivOpUnder : Over (op X) ≌ (Under X)ᵒᵖ where
931+ functor := Over.opToOpUnder X
932+ inverse := Under.opToOverOp X
933+ unitIso := Iso.refl _
934+ counitIso := Iso.refl _
935+
936+ /-- The canonical functor by reversing structure arrows. -/
937+ @[simps]
938+ def Under.opToOpOver : Under (op X) ⥤ (Over X)ᵒᵖ where
939+ obj Y := ⟨Over.mk Y.hom.unop⟩
940+ map {Z Y} f := ⟨Over.homMk (f.right.unop) (by dsimp; rw [← unop_comp, Under.w])⟩
941+
942+ /-- The canonical functor by reversing structure arrows. -/
943+ @[simps]
944+ def Over.opToUnderOp : (Over X)ᵒᵖ ⥤ Under (op X) where
945+ obj Y := Under.mk (Y.unop.hom.op)
946+ map {Z Y} f := Under.homMk f.unop.left.op <| by dsimp; rw [← Over.w f.unop, op_comp]
947+
948+ /-- `Under.opToOpOver` is an equivalence of categories. -/
949+ @[simps]
950+ def Under.opEquivOpOver : Under (op X) ≌ (Over X)ᵒᵖ where
951+ functor := Under.opToOpOver X
952+ inverse := Over.opToUnderOp X
953+ unitIso := Iso.refl _
954+ counitIso := Iso.refl _
955+
956+ end Opposite
957+
777958end CategoryTheory
0 commit comments