Skip to content

Commit 8be8e0b

Browse files
committed
chore(Pseudofunctor): add notation of pseudofunctors (#31171)
This is starting to become necessary by now. If anyone has issues with the notation or other suggestions I am happy to change. I am leaving similar changes for Lax and Oplax functors for later, they can be addressed if people are happy with this PR.
1 parent 7f8f0b7 commit 8be8e0b

File tree

11 files changed

+43
-40
lines changed

11 files changed

+43
-40
lines changed

Mathlib/CategoryTheory/Bicategory/Adjunction/Adj.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ instance : Bicategory (Adj B) where
177177

178178
/-- The forget pseudofunctor from `Adj B` to `B`. -/
179179
@[simps]
180-
def forget₁ : Pseudofunctor (Adj B) B where
180+
def forget₁ : Adj B ⥤ᵖ B where
181181
obj a := a.obj
182182
map x := x.l
183183
map₂ α := α.τl

Mathlib/CategoryTheory/Bicategory/Coherence.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The proof is almost the same as the proof of the coherence theorem for monoidal
1818
has been previously formalized in mathlib, which is based on the proof described by Ilya Beylin
1919
and Peter Dybjer. The idea is to view a path on a quiver as a normal form of a 1-morphism in the
2020
free bicategory on the same quiver. A normalization procedure is then described by
21-
`normalize : Pseudofunctor (FreeBicategory B) (LocallyDiscrete (Paths B))`, which is a
21+
`normalize : FreeBicategory B ⥤ᵖ (LocallyDiscrete (Paths B))`, which is a
2222
pseudofunctor from the free bicategory to the locally discrete bicategory on the path category.
2323
It turns out that this pseudofunctor is locally an equivalence of categories, and the coherence
2424
theorem follows immediately from this fact.
@@ -178,7 +178,7 @@ theorem normalizeAux_nil_comp {a b c : B} (f : Hom a b) (g : Hom b c) :
178178

179179
/-- The normalization pseudofunctor for the free bicategory on a quiver `B`. -/
180180
def normalize (B : Type u) [Quiver.{v + 1} B] :
181-
Pseudofunctor (FreeBicategory B) (LocallyDiscrete (Paths B)) where
181+
FreeBicategory B ⥤ᵖ (LocallyDiscrete (Paths B)) where
182182
obj a := ⟨a⟩
183183
map f := ⟨normalizeAux nil f⟩
184184
map₂ η := eqToHom <| Discrete.ext <| normalizeAux_congr nil η
@@ -224,7 +224,7 @@ def inclusionMapCompAux {a b : B} :
224224
free bicategory.
225225
-/
226226
def inclusion (B : Type u) [Quiver.{v + 1} B] :
227-
Pseudofunctor (LocallyDiscrete (Paths B)) (FreeBicategory B) :=
227+
LocallyDiscrete (Paths B) ⥤ᵖ (FreeBicategory B) :=
228228
{ -- All the conditions for 2-morphisms are trivial thanks to the coherence theorem!
229229
preinclusion B with
230230
mapId := fun _ => Iso.refl _

Mathlib/CategoryTheory/Bicategory/Free.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ theorem liftHom₂_congr {a b : FreeBicategory B} {f g : a ⟶ b} {η θ : Hom
320320
`free_bicategory B` to `C`.
321321
-/
322322
@[simps]
323-
def lift : Pseudofunctor (FreeBicategory B) C where
323+
def lift : FreeBicategory B ⥤ᵖ C where
324324
obj := F.obj
325325
map := liftHom F
326326
mapId _ := Iso.refl _

Mathlib/CategoryTheory/Bicategory/Functor/Cat.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ open Bicategory
2121

2222
namespace Pseudofunctor
2323

24-
variable {B : Type u} [Bicategory.{w, v} B] (F : Pseudofunctor B Cat.{v', u'})
24+
variable {B : Type u} [Bicategory.{w, v} B] (F : B ⥤ᵖ Cat.{v', u'})
2525

2626
section naturality
2727

Mathlib/CategoryTheory/Bicategory/Functor/LocallyDiscrete.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def pseudofunctorOfIsLocallyDiscrete
4949
(map₂_right_unitor : ∀ {b₀ b₁ : B} (f : b₀ ⟶ b₁),
5050
(mapComp f (𝟙 b₁)).hom ≫ map f ◁ (mapId b₁).hom ≫ (ρ_ (map f)).hom = eqToHom (by simp) := by
5151
cat_disch) :
52-
Pseudofunctor B C where
52+
B ⥤ᵖ C where
5353
obj := obj
5454
map := map
5555
map₂ φ := eqToHom (by
@@ -107,7 +107,7 @@ A functor between two categories `C` and `D` can be lifted to a pseudofunctor be
107107
corresponding locally discrete bicategories.
108108
-/
109109
@[simps! obj map mapId mapComp]
110-
def Functor.toPseudoFunctor : Pseudofunctor (LocallyDiscrete C) (LocallyDiscrete D) :=
110+
def Functor.toPseudoFunctor : LocallyDiscrete C ⥤ᵖ (LocallyDiscrete D) :=
111111
pseudofunctorOfIsLocallyDiscrete
112112
(fun ⟨X⟩ ↦.mk <| F.obj X) (fun ⟨f⟩ ↦ (F.map f).toLoc)
113113
(fun ⟨X⟩ ↦ eqToIso (by simp)) (fun f g ↦ eqToIso (by simp))
@@ -136,7 +136,7 @@ If `B` is a strict bicategory and `I` is a (1-)category, any functor (of 1-categ
136136
be promoted to a pseudofunctor from `LocallyDiscrete I` to `B`.
137137
-/
138138
@[simps! obj map mapId mapComp]
139-
def Functor.toPseudoFunctor' : Pseudofunctor (LocallyDiscrete I) B :=
139+
def Functor.toPseudoFunctor' : LocallyDiscrete I ⥤ᵖ B :=
140140
pseudofunctorOfIsLocallyDiscrete
141141
(fun ⟨X⟩ ↦ F.obj X) (fun ⟨f⟩ ↦ F.map f)
142142
(fun ⟨X⟩ ↦ eqToIso (by simp)) (fun f g ↦ eqToIso (by simp))
@@ -171,7 +171,7 @@ def mkPseudofunctor {B₀ C : Type*} [Category B₀] [Bicategory C]
171171
(map₂_right_unitor : ∀ {b₀ b₁ : B₀} (f : b₀ ⟶ b₁),
172172
(mapComp f (𝟙 b₁)).hom ≫ map f ◁ (mapId b₁).hom ≫ (ρ_ (map f)).hom = eqToHom (by simp) := by
173173
cat_disch) :
174-
Pseudofunctor (LocallyDiscrete B₀) C :=
174+
LocallyDiscrete B₀ ⥤ᵖ C :=
175175
pseudofunctorOfIsLocallyDiscrete (fun b ↦ obj b.as) (fun f ↦ map f.as)
176176
(fun _ ↦ mapId _) (fun _ _ ↦ mapComp _ _) (fun _ _ _ ↦ map₂_associator _ _ _)
177177
(fun _ ↦ map₂_left_unitor _) (fun _ ↦ map₂_right_unitor _)

Mathlib/CategoryTheory/Bicategory/Functor/Pseudofunctor.lean

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ namespace CategoryTheory
3434

3535
open Category Bicategory
3636

37-
open Bicategory
38-
3937
universe w₁ w₂ w₃ v₁ v₂ v₃ u₁ u₂ u₃
4038

4139
variable {B : Type u₁} [Bicategory.{w₁, v₁} B] {C : Type u₂} [Bicategory.{w₂, v₂} C]
@@ -79,6 +77,11 @@ structure Pseudofunctor (B : Type u₁) [Bicategory.{w₁, v₁} B] (C : Type u
7977
map₂ (ρ_ f).hom = (mapComp f (𝟙 b)).hom ≫ map f ◁ (mapId b).hom ≫ (ρ_ (map f)).hom := by
8078
cat_disch
8179

80+
/-- Notation for a pseudofunctor between bicategories. -/
81+
-- Given similar precedence as ⥤ (26).
82+
-- For example, `C × D ⥤ E` should parse as `(C × D) ⥤ E` not `C × (D ⥤ E)`.
83+
scoped[CategoryTheory.Bicategory] infixr:26 " ⥤ᵖ " => Pseudofunctor -- type as \func\^p
84+
8285
initialize_simps_projections Pseudofunctor (+toPrelaxFunctor, -obj, -map, -map₂)
8386

8487
namespace Pseudofunctor
@@ -102,7 +105,7 @@ attribute [nolint docBlame] CategoryTheory.Pseudofunctor.mapId
102105
CategoryTheory.Pseudofunctor.map₂_left_unitor
103106
CategoryTheory.Pseudofunctor.map₂_right_unitor
104107

105-
variable (F : Pseudofunctor B C)
108+
variable (F : B ⥤ᵖ C)
106109

107110
/-- The oplax functor associated with a pseudofunctor. -/
108111
@[simps]
@@ -111,7 +114,7 @@ def toOplax : OplaxFunctor B C where
111114
mapId := fun a => (F.mapId a).hom
112115
mapComp := fun f g => (F.mapComp f g).hom
113116

114-
instance hasCoeToOplax : Coe (Pseudofunctor B C) (OplaxFunctor B C) :=
117+
instance hasCoeToOplax : Coe (B ⥤ᵖ C) (OplaxFunctor B C) :=
115118
⟨toOplax⟩
116119

117120
/-- The Lax functor associated with a pseudofunctor. -/
@@ -127,22 +130,22 @@ def toLax : LaxFunctor B C where
127130
rw [← F.map₂Iso_inv, eq_inv_comp, comp_inv_eq]
128131
simp
129132

130-
instance hasCoeToLax : Coe (Pseudofunctor B C) (LaxFunctor B C) :=
133+
instance hasCoeToLax : Coe (B ⥤ᵖ C) (LaxFunctor B C) :=
131134
⟨toLax⟩
132135

133136
/-- The identity pseudofunctor. -/
134137
@[simps]
135-
def id (B : Type u₁) [Bicategory.{w₁, v₁} B] : Pseudofunctor B B where
138+
def id (B : Type u₁) [Bicategory.{w₁, v₁} B] : B ⥤ᵖ B where
136139
toPrelaxFunctor := PrelaxFunctor.id B
137140
mapId := fun a => Iso.refl (𝟙 a)
138141
mapComp := fun f g => Iso.refl (f ≫ g)
139142

140-
instance : Inhabited (Pseudofunctor B B) :=
143+
instance : Inhabited (B ⥤ᵖ B) :=
141144
⟨id B⟩
142145

143146
/-- Composition of pseudofunctors. -/
144147
@[simps]
145-
def comp (F : Pseudofunctor B C) (G : Pseudofunctor C D) : Pseudofunctor B D where
148+
def comp (F : B ⥤ᵖ C) (G : C ⥤ᵖ D) : B ⥤ᵖ D where
146149
toPrelaxFunctor := F.toPrelaxFunctor.comp G.toPrelaxFunctor
147150
mapId := fun a => G.map₂Iso (F.mapId a) ≪≫ G.mapId (F.obj a)
148151
mapComp := fun f g => (G.map₂Iso (F.mapComp f g)) ≪≫ G.mapComp (F.map f) (F.map g)
@@ -155,7 +158,7 @@ def comp (F : Pseudofunctor B C) (G : Pseudofunctor C D) : Pseudofunctor B D whe
155158

156159
section
157160

158-
variable (F : Pseudofunctor B C) {a b : B}
161+
variable (F : B ⥤ᵖ C) {a b : B}
159162

160163
@[to_app (attr := reassoc)]
161164
lemma mapComp_assoc_right_hom {c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d) :
@@ -288,7 +291,7 @@ end
288291

289292
/-- Construct a pseudofunctor from an oplax functor whose `mapId` and `mapComp` are isomorphisms. -/
290293
@[simps]
291-
def mkOfOplax (F : OplaxFunctor B C) (F' : F.PseudoCore) : Pseudofunctor B C where
294+
def mkOfOplax (F : OplaxFunctor B C) (F' : F.PseudoCore) : B ⥤ᵖ C where
292295
toPrelaxFunctor := F.toPrelaxFunctor
293296
mapId := F'.mapIdIso
294297
mapComp := F'.mapCompIso
@@ -306,7 +309,7 @@ def mkOfOplax (F : OplaxFunctor B C) (F' : F.PseudoCore) : Pseudofunctor B C whe
306309
/-- Construct a pseudofunctor from an oplax functor whose `mapId` and `mapComp` are isomorphisms. -/
307310
@[simps!]
308311
noncomputable def mkOfOplax' (F : OplaxFunctor B C) [∀ a, IsIso (F.mapId a)]
309-
[∀ {a b c} (f : a ⟶ b) (g : b ⟶ c), IsIso (F.mapComp f g)] : Pseudofunctor B C where
312+
[∀ {a b c} (f : a ⟶ b) (g : b ⟶ c), IsIso (F.mapComp f g)] : B ⥤ᵖ C where
310313
toPrelaxFunctor := F.toPrelaxFunctor
311314
mapId := fun a => asIso (F.mapId a)
312315
mapComp := fun f g => asIso (F.mapComp f g)
@@ -324,7 +327,7 @@ noncomputable def mkOfOplax' (F : OplaxFunctor B C) [∀ a, IsIso (F.mapId a)]
324327

325328
/-- Construct a pseudofunctor from a lax functor whose `mapId` and `mapComp` are isomorphisms. -/
326329
@[simps]
327-
def mkOfLax (F : LaxFunctor B C) (F' : F.PseudoCore) : Pseudofunctor B C where
330+
def mkOfLax (F : LaxFunctor B C) (F' : F.PseudoCore) : B ⥤ᵖ C where
328331
toPrelaxFunctor := F.toPrelaxFunctor
329332
mapId := F'.mapIdIso
330333
mapComp := F'.mapCompIso
@@ -343,7 +346,7 @@ def mkOfLax (F : LaxFunctor B C) (F' : F.PseudoCore) : Pseudofunctor B C where
343346
/-- Construct a pseudofunctor from a lax functor whose `mapId` and `mapComp` are isomorphisms. -/
344347
@[simps!]
345348
noncomputable def mkOfLax' (F : LaxFunctor B C) [∀ a, IsIso (F.mapId a)]
346-
[∀ {a b c} (f : a ⟶ b) (g : b ⟶ c), IsIso (F.mapComp f g)] : Pseudofunctor B C :=
349+
[∀ {a b c} (f : a ⟶ b) (g : b ⟶ c), IsIso (F.mapComp f g)] : B ⥤ᵖ C :=
347350
mkOfLax F
348351
{ mapIdIso := fun a => (asIso (F.mapId a)).symm
349352
mapCompIso := fun f g => (asIso (F.mapComp f g)).symm }

Mathlib/CategoryTheory/Bicategory/Grothendieck.lean

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ This is consistent with the convention for the Grothendieck construction on 1-fu
4848
## Future work / TODO
4949
5050
1. Once the bicategory of pseudofunctors has been defined, show that this construction forms a
51-
pseudofunctor from `Pseudofunctor (LocallyDiscrete 𝒮) Catᵒᵖ` to `Cat`.
51+
pseudofunctor from `LocallyDiscrete 𝒮 ⥤ᵖ Catᵒᵖ` to `Cat`.
5252
2. Deduce the results in `CategoryTheory.Grothendieck` as a specialization of
5353
`Pseudofunctor.Grothendieck`.
5454
3. Dualize all `CoGrothendieck` results to `Grothendieck`.
@@ -70,15 +70,15 @@ variable {𝒮 : Type u₁} [Category.{v₁} 𝒮]
7070
/-- The type of objects in the fibered category associated to a pseudofunctor from a
7171
1-category to Cat. -/
7272
@[ext]
73-
structure Grothendieck (F : Pseudofunctor (LocallyDiscrete 𝒮) Cat.{v₂, u₂}) where
73+
structure Grothendieck (F : LocallyDiscrete 𝒮 ⥤ᵖ Cat.{v₂, u₂}) where
7474
/-- The underlying object in the base category. -/
7575
base : 𝒮
7676
/-- The object in the fiber of the base object. -/
7777
fiber : F.obj ⟨base⟩
7878

7979
namespace Grothendieck
8080

81-
variable {F : Pseudofunctor (LocallyDiscrete 𝒮) Cat.{v₂, u₂}}
81+
variable {F : LocallyDiscrete 𝒮 ⥤ᵖ Cat.{v₂, u₂}}
8282

8383
/-- Notation for the Grothendieck category associated to a pseudofunctor `F`. -/
8484
scoped prefix:75 "∫ " => Grothendieck
@@ -111,15 +111,15 @@ end Grothendieck
111111
/-- The type of objects in the fibered category associated to a contravariant
112112
pseudofunctor from a 1-category to Cat. -/
113113
@[ext]
114-
structure CoGrothendieck (F : Pseudofunctor (LocallyDiscrete 𝒮ᵒᵖ) Cat.{v₂, u₂}) where
114+
structure CoGrothendieck (F : LocallyDiscrete 𝒮ᵒᵖ ⥤ᵖ Cat.{v₂, u₂}) where
115115
/-- The underlying object in the base category. -/
116116
base : 𝒮
117117
/-- The object in the fiber of the base object. -/
118118
fiber : F.obj ⟨op base⟩
119119

120120
namespace CoGrothendieck
121121

122-
variable {F : Pseudofunctor (LocallyDiscrete 𝒮ᵒᵖ) Cat.{v₂, u₂}}
122+
variable {F : LocallyDiscrete 𝒮ᵒᵖ ⥤ᵖ Cat.{v₂, u₂}}
123123

124124
/-- Notation for the CoGrothendieck category associated to a pseudofunctor `F`. -/
125125
scoped prefix:75 "∫ᶜ " => CoGrothendieck
@@ -190,7 +190,7 @@ variable (F)
190190
/-- The projection `∫ᶜ F ⥤ 𝒮` given by projecting both objects and homs to the first
191191
factor. -/
192192
@[simps]
193-
def forget (F : Pseudofunctor (LocallyDiscrete 𝒮ᵒᵖ) Cat.{v₂, u₂}) : ∫ᶜ F ⥤ 𝒮 where
193+
def forget (F : LocallyDiscrete 𝒮ᵒᵖ ⥤ᵖ Cat.{v₂, u₂}) : ∫ᶜ F ⥤ 𝒮 where
194194
obj X := X.base
195195
map f := f.base
196196

@@ -199,8 +199,8 @@ section
199199
attribute [local simp]
200200
Strict.leftUnitor_eqToIso Strict.rightUnitor_eqToIso Strict.associator_eqToIso
201201

202-
variable {F} {G : Pseudofunctor (LocallyDiscrete 𝒮ᵒᵖ) Cat.{v₂, u₂}}
203-
{H : Pseudofunctor (LocallyDiscrete 𝒮ᵒᵖ) Cat.{v₂, u₂}}
202+
variable {F} {G : LocallyDiscrete 𝒮ᵒᵖ ⥤ᵖ Cat.{v₂, u₂}}
203+
{H : LocallyDiscrete 𝒮ᵒᵖ ⥤ᵖ Cat.{v₂, u₂}}
204204

205205
/-- The CoGrothendieck construction is functorial: a strong natural transformation `α : F ⟶ G`
206206
induces a functor `CoGrothendieck.map : ∫ᶜ F ⥤ ∫ᶜ G`. -/

Mathlib/CategoryTheory/Bicategory/NaturalTransformation/Pseudo.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ attribute [reassoc (attr := simp)] StrongTrans.naturality_naturality
7676

7777
namespace StrongTrans
7878

79-
variable {F G : Pseudofunctor B C}
79+
variable {F G : B ⥤ᵖ C}
8080

8181
/-- The underlying oplax transformation of a strong transformation. -/
8282
@[simps]
@@ -107,17 +107,17 @@ def id : StrongTrans F F where
107107
instance : Inhabited (StrongTrans F F) :=
108108
⟨id F⟩
109109

110-
variable {H : Pseudofunctor B C}
110+
variable {H : B ⥤ᵖ C}
111111

112112
/-- Vertical composition of strong transformations. -/
113113
def vcomp (η : StrongTrans F G) (θ : StrongTrans G H) : StrongTrans F H :=
114114
mkOfOplax (Oplax.StrongTrans.vcomp η.toOplax θ.toOplax)
115115

116-
/-- `CategoryStruct` on `Pseudofunctor B C` where the (1-)morphisms are given by strong
116+
/-- `CategoryStruct` on `B ⥤ᵖ C` where the (1-)morphisms are given by strong
117117
transformations. -/
118118
@[simps! id_app id_naturality_hom id_naturality_inv comp_naturality_hom
119119
comp_naturality_inv]
120-
scoped instance categoryStruct : CategoryStruct (Pseudofunctor B C) where
120+
scoped instance categoryStruct : CategoryStruct (B ⥤ᵖ C) where
121121
Hom F G := StrongTrans F G
122122
id F := StrongTrans.id F
123123
comp := StrongTrans.vcomp

Mathlib/CategoryTheory/Bicategory/Strict/Pseudofunctor.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ open Bicategory
3131
namespace Pseudofunctor
3232

3333
variable {B : Type u₁} {C : Type u₂} [Bicategory.{w₁, v₁} B]
34-
[Strict B] [Bicategory.{w₂, v₂} C] (F : Pseudofunctor B C)
34+
[Strict B] [Bicategory.{w₂, v₂} C] (F : B ⥤ᵖ C)
3535

3636
lemma mapComp'_comp_id {b₀ b₁ : B} (f : b₀ ⟶ b₁) :
3737
F.mapComp' f (𝟙 b₁) f = (ρ_ _).symm ≪≫ whiskerLeftIso _ (F.mapId b₁).symm := by

Mathlib/CategoryTheory/FiberedCategory/Grothendieck.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace CategoryTheory.Pseudofunctor.CoGrothendieck
2626

2727
open Functor Opposite Bicategory Fiber
2828

29-
variable {𝒮 : Type*} [Category 𝒮] {F : Pseudofunctor (LocallyDiscrete 𝒮ᵒᵖ) Cat}
29+
variable {𝒮 : Type*} [Category 𝒮] {F : LocallyDiscrete 𝒮ᵒᵖ ⥤ᵖ Cat}
3030

3131
section
3232

0 commit comments

Comments
 (0)