Commit 2024-07-06 10:06 a347c63b
View on Github →refactor(Bicategory/Functor): refactor prelaxfunctors (#14098) This PR suggests a refactor (and renaming) of prelax functors. This is to provide more reusability of code between oplax functors, pseudofunctors (and soon) lax functors. This is done in the following way:
- A new file is created called
Bicategory.Functor.Prelax
. - What (before this suggested refactor) was called
PrelaxFunctor
, is renamed toLaxPrefunctor
. Recall that this is a prefunctor that is also equipped with a mapmap₂
on 2-morphisms. - A new structure is added, taking over the name
PrelaxFunctor
, which additionally requires that the associated prefunctors between hom types are functors. In other words,map₂
should respect identities and compositions. - Both
Pseudofunctor
andOplaxFunctor
are updated to extend the new notion ofPrelaxFunctor
. Finally: Coercions have also been removed between these various structures. This is to prevent the following behaviour in the current library: given a pseudofunctorF
the infoview will printF.map
as(↑F.toPrelaxfunctor).map
which makes long expressions unecessarily hard to read. The change is just like howFunctor
does not have a coercion toPreFunctor
. This refactor will allow us to definemapFunctor
andmap₂Iso
on the level ofPrelaxFunctor
s, which allows it to be reused for bothPseudofunctor
s andOplaxFunctor
s instead of having to be defined separately. A new constructors on this level has also been added,PrelaxFunctor.mkOfHomFunctors
, that constructs aPrelaxFunctor
given a map on types and functors between the corresponding hom types. This could for example be used to construct the pseudofunctor in the bicategorical yoneda lemma, by using the collection of functorsprecomposing
(seeBicategory.Basic
). The fileCategoryTheory/WithTerminal
has been edited just to fix the proof after these new changes.