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
PseudofunctorandOplaxFunctorare 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 pseudofunctorFthe infoview will printF.mapas(↑F.toPrelaxfunctor).mapwhich makes long expressions unecessarily hard to read. The change is just like howFunctordoes not have a coercion toPreFunctor. This refactor will allow us to definemapFunctorandmap₂Isoon the level ofPrelaxFunctors, which allows it to be reused for bothPseudofunctors andOplaxFunctors instead of having to be defined separately. A new constructors on this level has also been added,PrelaxFunctor.mkOfHomFunctors, that constructs aPrelaxFunctorgiven 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/WithTerminalhas been edited just to fix the proof after these new changes.