Skip to content

Commit ab7cf6e

Browse files
committed
feat(CategoryTheory): Grothendieck.map preserves finality (#19073)
1 parent 6414284 commit ab7cf6e

File tree

3 files changed

+75
-1
lines changed

3 files changed

+75
-1
lines changed

Mathlib/CategoryTheory/EqToHom.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ theorem eqToHom_trans {X Y Z : C} (p : X = Y) (q : Y = Z) :
5151
cases q
5252
simp
5353

54+
/-- `eqToHom h` is heterogeneously equal to the identity of its domain. -/
55+
lemma eqToHom_heq_id_dom (X Y : C) (h : X = Y) : HEq (eqToHom h) (𝟙 X) := by
56+
subst h; rfl
57+
58+
/-- `eqToHom h` is heterogeneously equal to the identity of its codomain. -/
59+
lemma eqToHom_heq_id_cod (X Y : C) (h : X = Y) : HEq (eqToHom h) (𝟙 Y) := by
60+
subst h; rfl
61+
5462
/-- Two morphisms are conjugate via eqToHom if and only if they are heterogeneously equal.
5563
Note this used to be in the Functor namespace, where it doesn't belong. -/
5664
theorem conj_eqToHom_iff_heq {W X Y Z : C} (f : W ⟶ X) (g : Y ⟶ Z) (h : W = Y) (h' : X = Z) :

Mathlib/CategoryTheory/Grothendieck.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ def compAsSmallFunctorEquivalence :
319319
counitIso := Iso.refl _
320320
unitIso := Iso.refl _
321321

322+
variable {F} in
322323
/-- Mapping a Grothendieck construction along the whiskering of any natural transformation
323324
`α : F ⟶ G` with the functor `asSmallFunctor : Cat ⥤ Cat` is naturally isomorphic to conjugating
324325
`map α` with the equivalence between `Grothendieck (F ⋙ asSmallFunctor)` and `Grothendieck F`. -/
@@ -578,6 +579,11 @@ def ιCompFunctorFrom (c : C) : ι F c ⋙ (functorFrom fib hom hom_id hom_comp)
578579

579580
end FunctorFrom
580581

582+
/-- The fiber inclusion `ι F c` composed with `map α` is isomorphic to `α.app c ⋙ ι F' c`. -/
583+
@[simps!]
584+
def ιCompMap {F' : C ⥤ Cat} (α : F ⟶ F') (c : C) : ι F c ⋙ map α ≅ α.app c ⋙ ι F' c :=
585+
NatIso.ofComponents (fun X => Iso.refl _) (fun f => by simp [map])
586+
581587
end Grothendieck
582588

583589
end CategoryTheory

Mathlib/CategoryTheory/Limits/Final.lean

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
/-
22
Copyright (c) 2020 Kim Morrison. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
4-
Authors: Kim Morrison
4+
Authors: Kim Morrison, Jakob von Raumer
55
-/
6+
import Mathlib.CategoryTheory.Category.Cat.AsSmall
67
import Mathlib.CategoryTheory.Comma.StructuredArrow.Basic
78
import Mathlib.CategoryTheory.IsConnected
89
import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Terminal
910
import Mathlib.CategoryTheory.Limits.Shapes.Types
11+
import Mathlib.CategoryTheory.Limits.Shapes.Grothendieck
1012
import Mathlib.CategoryTheory.Filtered.Basic
1113
import Mathlib.CategoryTheory.Limits.Yoneda
1214
import Mathlib.CategoryTheory.PUnit
@@ -42,6 +44,9 @@ From 3., we prove 1. directly in `final_of_colimit_comp_coyoneda_iso_pUnit`.
4244
Dually, we prove that if a functor `F : C ⥤ D` is initial, then any functor `G : D ⥤ E` has a
4345
limit if and only if `F ⋙ G` does, and these limits are isomorphic via `limit.pre G F`.
4446
47+
In the end of the file, we characterize the finality of some important induced functors on the
48+
(co)structured arrow category (`StructuredArrow.pre` and `CostructuredArrow.pre`) and on the
49+
Grothendieck construction (`Grothendieck.pre` and `Grothendieck.map`).
4550
4651
## Naming
4752
There is some discrepancy in the literature about naming; some say 'cofinal' instead of 'final'.
@@ -1017,6 +1022,61 @@ instance Grothendieck.final_pre [hG : Final G] : (Grothendieck.pre F G).Final :=
10171022
exact zigzag_prefunctor_obj_of_zigzag (Grothendieck.structuredArrowToStructuredArrowPre F G d f)
10181023
(isPreconnected_zigzag (.mk gbi) (.mk gbj))
10191024

1025+
open Limits
1026+
1027+
/-- A natural transformation `α : F ⟶ G` between functors `F G : C ⥤ Cat` which is is final on each
1028+
fiber `(α.app X)` induces an equivalence of fiberwise colimits of `map α ⋙ H` and `H` for each
1029+
functor `H : Grothendieck G ⥤ Type`. -/
1030+
def Grothendieck.fiberwiseColimitMapCompEquivalence {C : Type u₁} [Category.{v₁} C]
1031+
{F G : C ⥤ Cat.{v₂, u₂}} (α : F ⟶ G) [∀ X, Final (α.app X)] (H : Grothendieck G ⥤ Type u₂) :
1032+
fiberwiseColimit (map α ⋙ H) ≅ fiberwiseColimit H :=
1033+
NatIso.ofComponents
1034+
(fun X =>
1035+
HasColimit.isoOfNatIso ((Functor.associator _ _ _).symm ≪≫
1036+
isoWhiskerRight (ιCompMap α X) H ≪≫ Functor.associator _ _ _) ≪≫
1037+
Final.colimitIso (α.app X) (ι G X ⋙ H))
1038+
(fun f => colimit.hom_ext <| fun d => by
1039+
simp only [map, Cat.comp_obj, comp_obj, ι_obj, fiberwiseColimit_obj, fiberwiseColimit_map,
1040+
ιNatTrans, ιCompMap, Iso.trans_hom, Category.assoc, ι_colimMap_assoc, NatTrans.comp_app,
1041+
whiskerRight_app, Functor.comp_map, Cat.eqToHom_app, map_id, Category.comp_id,
1042+
associator_hom_app, colimit.ι_pre_assoc, HasColimit.isoOfNatIso_ι_hom_assoc, Iso.symm_hom,
1043+
isoWhiskerRight_hom, associator_inv_app, NatIso.ofComponents_hom_app, Iso.refl_hom,
1044+
Final.ι_colimitIso_hom, Category.id_comp, Final.ι_colimitIso_hom_assoc, colimit.ι_pre]
1045+
have := Functor.congr_obj (α.naturality f) d
1046+
dsimp at this
1047+
congr
1048+
apply eqToHom_heq_id_dom)
1049+
1050+
/-- This is the small version of the more general lemma `Grothendieck.final_map` below. -/
1051+
private lemma Grothendieck.final_map_small {C : Type u₁} [SmallCategory C] {F G : C ⥤ Cat.{u₁, u₁}}
1052+
(α : F ⟶ G) [hα : ∀ X, Final (α.app X)] : Final (map α) := by
1053+
rw [final_iff_isIso_colimit_pre]
1054+
intro H
1055+
let i := (colimitFiberwiseColimitIso _).symm ≪≫
1056+
HasColimit.isoOfNatIso (fiberwiseColimitMapCompEquivalence α H) ≪≫ colimitFiberwiseColimitIso _
1057+
convert Iso.isIso_hom i
1058+
apply colimit.hom_ext
1059+
intro X
1060+
simp [i, fiberwiseColimitMapCompEquivalence]
1061+
1062+
/-- The functor `Grothendieck.map α` for a natural transformation `α : F ⟶ G`, with
1063+
`F G : C ⥤ Cat`, is final if for each `X : C`, the functor `α.app X` is final. -/
1064+
lemma Grothendieck.final_map {F G : C ⥤ Cat.{v₂, u₂}} (α : F ⟶ G) [hα : ∀ X, Final (α.app X)] :
1065+
Final (map α) := by
1066+
let sC : C ≌ AsSmall.{max u₁ u₂ v₁ v₂} C := AsSmall.equiv
1067+
let F' : AsSmall C ⥤ Cat := sC.inverse ⋙ F ⋙ Cat.asSmallFunctor.{max v₁ u₁ v₂ u₂}
1068+
let G' : AsSmall C ⥤ Cat := sC.inverse ⋙ G ⋙ Cat.asSmallFunctor.{max v₁ u₁ v₂ u₂}
1069+
let α' : F' ⟶ G' := whiskerLeft _ (whiskerRight α _)
1070+
have : ∀ X, Final (α'.app X) := fun X =>
1071+
inferInstanceAs (AsSmall.equiv.inverse ⋙ _ ⋙ AsSmall.equiv.functor).Final
1072+
have hα' : (map α').Final := final_map_small _
1073+
dsimp only [α', ← Equivalence.symm_functor] at hα'
1074+
have i := mapWhiskerLeftIsoConjPreMap sC.symm (whiskerRight α Cat.asSmallFunctor)
1075+
≪≫ isoWhiskerLeft _ (isoWhiskerRight (mapWhiskerRightAsSmallFunctor α) _)
1076+
have := final_of_natIso i
1077+
rwa [← final_iff_equivalence_comp, ← final_iff_comp_equivalence,
1078+
← final_iff_equivalence_comp, ← final_iff_comp_equivalence] at this
1079+
10201080
end Grothendieck
10211081

10221082
section Prod

0 commit comments

Comments
 (0)