Oplax functors and pseudofunctors #
An oplax functor F
between bicategories B
and C
consists of
- a function between objects
F.obj : B ⟶ C
, - a family of functions between 1-morphisms
F.map : (a ⟶ b) → (F.obj a ⟶ F.obj b)
, - a family of functions between 2-morphisms
F.map₂ : (f ⟶ g) → (F.map f ⟶ F.map g)
, - a family of 2-morphisms
F.mapId a : F.map (𝟙 a) ⟶ 𝟙 (F.obj a)
, - a family of 2-morphisms
F.mapComp f g : F.map (f ≫ g) ⟶ F.map f ≫ F.map g
, and - certain consistency conditions on them.
A pseudofunctor is an oplax functor whose mapId
and mapComp
are isomorphisms. We provide
several constructors for pseudofunctors:
Pseudofunctor.mk
: the default constructor, which requiresmap₂_whiskerLeft
andmap₂_whiskerRight
instead of naturality ofmapComp
.Pseudofunctor.mkOfOplax
: construct a pseudofunctor from an oplax functor whosemapId
andmapComp
are isomorphisms. This constructor usesIso
to describe isomorphisms.pseudofunctor.mkOfOplax'
: similar tomkOfOplax
, but usesIsIso
to describe isomorphisms.
The additional constructors are useful when constructing a pseudofunctor where the construction of the oplax functor associated with it is already done. For example, the composition of pseudofunctors can be defined by using the composition of oplax functors as follows:
def comp (F : Pseudofunctor B C) (G : Pseudofunctor C D) : Pseudofunctor B D :=
mkOfOplax ((F : OplaxFunctor B C).comp G)
{ mapIdIso := λ a => (G.mapFunctor _ _).mapIso (F.mapId a) ≪≫ G.mapId (F.obj a),
mapCompIso := λ f g =>
(G.mapFunctor _ _).mapIso (F.mapComp f g) ≪≫ G.mapComp (F.map f) (F.map g) }
although the composition of pseudofunctors in this file is defined by using the default constructor
because obviously
wasn't smart enough in mathlib3 and the porter of this file was too lazy
to investigate this issue further in mathlib4. Similarly, the composition is also defined by using
mkOfOplax'
after giving appropriate instances for IsIso
. The former constructor
mkOfOplax
requires isomorphisms as data type Iso
, and so it is useful if you don't want
to forget the definitions of the inverses. On the other hand, the latter constructor
mkOfOplax'
is useful if you want to use propositional type class IsIso
.
Main definitions #
CategoryTheory.OplaxFunctor B C
: an oplax functor between bicategoriesB
andC
CategoryTheory.OplaxFunctor.comp F G
: the composition of oplax functorsCategoryTheory.Pseudofunctor B C
: a pseudofunctor between bicategoriesB
andC
CategoryTheory.Pseudofunctor.comp F G
: the composition of pseudofunctors
Future work #
There are two types of functors between bicategories, called lax and oplax functors, depending on
the directions of mapId
and mapComp
. We may need both in mathlib in the future, but for
now we only define oplax functors.
A prelax functor between bicategories consists of functions between objects,
1-morphisms, and 2-morphisms. This structure will be extended to define OplaxFunctor
.
- obj : B → C
The action of a prelax functor on 2-morphisms.
Instances For
Equations
- CategoryTheory.PrelaxFunctor.hasCoeToPrefunctor = { coe := CategoryTheory.PrelaxFunctor.toPrefunctor }
The identity prelax functor.
Equations
- CategoryTheory.PrelaxFunctor.id B = let src := 𝟭q B; { toPrefunctor := src, map₂ := fun {a b : B} {f g : a ⟶ b} (η : f ⟶ g) => η }
Instances For
Equations
- CategoryTheory.PrelaxFunctor.instInhabitedPrelaxFunctor = { default := CategoryTheory.PrelaxFunctor.id B }
Composition of prelax functors.
Equations
- CategoryTheory.PrelaxFunctor.comp F G = let src := ↑F ⋙q ↑G; { toPrefunctor := src, map₂ := fun {a b : B} {f g : a ⟶ b} (η : f ⟶ g) => G.map₂ (F.map₂ η) }
Instances For
An oplax functor F
between bicategories B
and C
consists of a function between objects
F.obj
, a function between 1-morphisms F.map
, and a function between 2-morphisms F.map₂
.
Unlike functors between categories, F.map
do not need to strictly commute with the composition,
and do not need to strictly preserve the identity. Instead, there are specified 2-morphisms
F.map (𝟙 a) ⟶ 𝟙 (F.obj a)
and F.map (f ≫ g) ⟶ F.map f ≫ F.map g
.
F.map₂
strictly commute with compositions and preserve the identity. They also preserve the
associator, the left unitor, and the right unitor modulo some adjustments of domains and codomains
of 2-morphisms.
- obj : B → C
- mapId : (a : B) → (↑self.toPrelaxFunctor).map (CategoryTheory.CategoryStruct.id a) ⟶ CategoryTheory.CategoryStruct.id ((↑self.toPrelaxFunctor).obj a)
- mapComp : {a b c : B} → (f : a ⟶ b) → (g : b ⟶ c) → (↑self.toPrelaxFunctor).map (CategoryTheory.CategoryStruct.comp f g) ⟶ CategoryTheory.CategoryStruct.comp ((↑self.toPrelaxFunctor).map f) ((↑self.toPrelaxFunctor).map g)
- mapComp_naturality_left : ∀ {a b c : B} {f f' : a ⟶ b} (η : f ⟶ f') (g : b ⟶ c), CategoryTheory.CategoryStruct.comp (self.toPrelaxFunctor.map₂ (CategoryTheory.Bicategory.whiskerRight η g)) (self.mapComp f' g) = CategoryTheory.CategoryStruct.comp (self.mapComp f g) (CategoryTheory.Bicategory.whiskerRight (self.toPrelaxFunctor.map₂ η) ((↑self.toPrelaxFunctor).map g))
- mapComp_naturality_right : ∀ {a b c : B} (f : a ⟶ b) {g g' : b ⟶ c} (η : g ⟶ g'), CategoryTheory.CategoryStruct.comp (self.toPrelaxFunctor.map₂ (CategoryTheory.Bicategory.whiskerLeft f η)) (self.mapComp f g') = CategoryTheory.CategoryStruct.comp (self.mapComp f g) (CategoryTheory.Bicategory.whiskerLeft ((↑self.toPrelaxFunctor).map f) (self.toPrelaxFunctor.map₂ η))
- map₂_id : ∀ {a b : B} (f : a ⟶ b), self.toPrelaxFunctor.map₂ (CategoryTheory.CategoryStruct.id f) = CategoryTheory.CategoryStruct.id ((↑self.toPrelaxFunctor).map f)
- map₂_comp : ∀ {a b : B} {f g h : a ⟶ b} (η : f ⟶ g) (θ : g ⟶ h), self.toPrelaxFunctor.map₂ (CategoryTheory.CategoryStruct.comp η θ) = CategoryTheory.CategoryStruct.comp (self.toPrelaxFunctor.map₂ η) (self.toPrelaxFunctor.map₂ θ)
- map₂_associator : ∀ {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d), CategoryTheory.CategoryStruct.comp (self.toPrelaxFunctor.map₂ (CategoryTheory.Bicategory.associator f g h).hom) (CategoryTheory.CategoryStruct.comp (self.mapComp f (CategoryTheory.CategoryStruct.comp g h)) (CategoryTheory.Bicategory.whiskerLeft ((↑self.toPrelaxFunctor).map f) (self.mapComp g h))) = CategoryTheory.CategoryStruct.comp (self.mapComp (CategoryTheory.CategoryStruct.comp f g) h) (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (self.mapComp f g) ((↑self.toPrelaxFunctor).map h)) (CategoryTheory.Bicategory.associator ((↑self.toPrelaxFunctor).map f) ((↑self.toPrelaxFunctor).map g) ((↑self.toPrelaxFunctor).map h)).hom)
- map₂_leftUnitor : ∀ {a b : B} (f : a ⟶ b), self.toPrelaxFunctor.map₂ (CategoryTheory.Bicategory.leftUnitor f).hom = CategoryTheory.CategoryStruct.comp (self.mapComp (CategoryTheory.CategoryStruct.id a) f) (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (self.mapId a) ((↑self.toPrelaxFunctor).map f)) (CategoryTheory.Bicategory.leftUnitor ((↑self.toPrelaxFunctor).map f)).hom)
- map₂_rightUnitor : ∀ {a b : B} (f : a ⟶ b), self.toPrelaxFunctor.map₂ (CategoryTheory.Bicategory.rightUnitor f).hom = CategoryTheory.CategoryStruct.comp (self.mapComp f (CategoryTheory.CategoryStruct.id b)) (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft ((↑self.toPrelaxFunctor).map f) (self.mapId b)) (CategoryTheory.Bicategory.rightUnitor ((↑self.toPrelaxFunctor).map f)).hom)
Instances For
Equations
- CategoryTheory.OplaxFunctor.hasCoeToPrelax = { coe := CategoryTheory.OplaxFunctor.toPrelaxFunctor }
Function between 1-morphisms as a functor.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The identity oplax functor.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- CategoryTheory.OplaxFunctor.instInhabitedOplaxFunctor = { default := CategoryTheory.OplaxFunctor.id B }
Composition of oplax functors.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A structure on an oplax functor that promotes an oplax functor to a pseudofunctor.
See Pseudofunctor.mkOfOplax
.
- mapIdIso : (a : B) → (↑F.toPrelaxFunctor).map (CategoryTheory.CategoryStruct.id a) ≅ CategoryTheory.CategoryStruct.id ((↑F.toPrelaxFunctor).obj a)
- mapCompIso : {a b c : B} → (f : a ⟶ b) → (g : b ⟶ c) → (↑F.toPrelaxFunctor).map (CategoryTheory.CategoryStruct.comp f g) ≅ CategoryTheory.CategoryStruct.comp ((↑F.toPrelaxFunctor).map f) ((↑F.toPrelaxFunctor).map g)
- mapIdIso_hom : ∀ {a : B}, (self.mapIdIso a).hom = F.mapId a
Instances For
A pseudofunctor F
between bicategories B
and C
consists of a function between objects
F.obj
, a function between 1-morphisms F.map
, and a function between 2-morphisms F.map₂
.
Unlike functors between categories, F.map
do not need to strictly commute with the compositions,
and do not need to strictly preserve the identity. Instead, there are specified 2-isomorphisms
F.map (𝟙 a) ≅ 𝟙 (F.obj a)
and F.map (f ≫ g) ≅ F.map f ≫ F.map g
.
F.map₂
strictly commute with compositions and preserve the identity. They also preserve the
associator, the left unitor, and the right unitor modulo some adjustments of domains and codomains
of 2-morphisms.
- obj : B → C
- mapId : (a : B) → (↑self.toPrelaxFunctor).map (CategoryTheory.CategoryStruct.id a) ≅ CategoryTheory.CategoryStruct.id ((↑self.toPrelaxFunctor).obj a)
- mapComp : {a b c : B} → (f : a ⟶ b) → (g : b ⟶ c) → (↑self.toPrelaxFunctor).map (CategoryTheory.CategoryStruct.comp f g) ≅ CategoryTheory.CategoryStruct.comp ((↑self.toPrelaxFunctor).map f) ((↑self.toPrelaxFunctor).map g)
- map₂_id : ∀ {a b : B} (f : a ⟶ b), self.toPrelaxFunctor.map₂ (CategoryTheory.CategoryStruct.id f) = CategoryTheory.CategoryStruct.id ((↑self.toPrelaxFunctor).map f)
- map₂_comp : ∀ {a b : B} {f g h : a ⟶ b} (η : f ⟶ g) (θ : g ⟶ h), self.toPrelaxFunctor.map₂ (CategoryTheory.CategoryStruct.comp η θ) = CategoryTheory.CategoryStruct.comp (self.toPrelaxFunctor.map₂ η) (self.toPrelaxFunctor.map₂ θ)
- map₂_whisker_left : ∀ {a b c : B} (f : a ⟶ b) {g h : b ⟶ c} (η : g ⟶ h), self.toPrelaxFunctor.map₂ (CategoryTheory.Bicategory.whiskerLeft f η) = CategoryTheory.CategoryStruct.comp (self.mapComp f g).hom (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft ((↑self.toPrelaxFunctor).map f) (self.toPrelaxFunctor.map₂ η)) (self.mapComp f h).inv)
- map₂_whisker_right : ∀ {a b c : B} {f g : a ⟶ b} (η : f ⟶ g) (h : b ⟶ c), self.toPrelaxFunctor.map₂ (CategoryTheory.Bicategory.whiskerRight η h) = CategoryTheory.CategoryStruct.comp (self.mapComp f h).hom (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (self.toPrelaxFunctor.map₂ η) ((↑self.toPrelaxFunctor).map h)) (self.mapComp g h).inv)
- map₂_associator : ∀ {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d), self.toPrelaxFunctor.map₂ (CategoryTheory.Bicategory.associator f g h).hom = CategoryTheory.CategoryStruct.comp (self.mapComp (CategoryTheory.CategoryStruct.comp f g) h).hom (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (self.mapComp f g).hom ((↑self.toPrelaxFunctor).map h)) (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator ((↑self.toPrelaxFunctor).map f) ((↑self.toPrelaxFunctor).map g) ((↑self.toPrelaxFunctor).map h)).hom (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft ((↑self.toPrelaxFunctor).map f) (self.mapComp g h).inv) (self.mapComp f (CategoryTheory.CategoryStruct.comp g h)).inv)))
- map₂_left_unitor : ∀ {a b : B} (f : a ⟶ b), self.toPrelaxFunctor.map₂ (CategoryTheory.Bicategory.leftUnitor f).hom = CategoryTheory.CategoryStruct.comp (self.mapComp (CategoryTheory.CategoryStruct.id a) f).hom (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (self.mapId a).hom ((↑self.toPrelaxFunctor).map f)) (CategoryTheory.Bicategory.leftUnitor ((↑self.toPrelaxFunctor).map f)).hom)
- map₂_right_unitor : ∀ {a b : B} (f : a ⟶ b), self.toPrelaxFunctor.map₂ (CategoryTheory.Bicategory.rightUnitor f).hom = CategoryTheory.CategoryStruct.comp (self.mapComp f (CategoryTheory.CategoryStruct.id b)).hom (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft ((↑self.toPrelaxFunctor).map f) (self.mapId b).hom) (CategoryTheory.Bicategory.rightUnitor ((↑self.toPrelaxFunctor).map f)).hom)
Instances For
Equations
- CategoryTheory.Pseudofunctor.hasCoeToPrelaxFunctor = { coe := CategoryTheory.Pseudofunctor.toPrelaxFunctor }
The oplax functor associated with a pseudofunctor.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- CategoryTheory.Pseudofunctor.hasCoeToOplax = { coe := CategoryTheory.Pseudofunctor.toOplax }
Function on 1-morphisms as a functor.
Equations
Instances For
The identity pseudofunctor.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- CategoryTheory.Pseudofunctor.instInhabitedPseudofunctor = { default := CategoryTheory.Pseudofunctor.id B }
Composition of pseudofunctors.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Construct a pseudofunctor from an oplax functor whose mapId
and mapComp
are isomorphisms.
Equations
- CategoryTheory.Pseudofunctor.mkOfOplax F F' = let src := F.toPrelaxFunctor; CategoryTheory.Pseudofunctor.mk src F'.mapIdIso fun {a b c : B} => F'.mapCompIso
Instances For
Construct a pseudofunctor from an oplax functor whose mapId
and mapComp
are isomorphisms.
Equations
- One or more equations did not get rendered due to their size.