Profunctors #
A profunctor from a category C to a category D is a functor from C to a category of
presheaves of sets on D. We define this as Profunctor.{w} C D := C ⥤ Dᵒᵖ ⥤ Type w.
This file provides convenient constructors ProfunctorCore and ProfunctorCore.Hom for profunctors
and natural transformations between them. We also define the identity profunctor Profunctor.id
as the Yoneda bifunctor, the opposite of a profunctor, the ulift of a profunctor, whiskering
of a profunctor with functors, and the profunctors in both directions corresponding to a functor
C ⥤ D (see Functor.toProfunctor and Functor.toProfunctorFlip).
Future work #
- Define composition of profunctors.
- Define the bicategory of categories where the 1-morphisms are profunctors.
Custom structure to construct profunctors, i.e. bifunctors C ⥤ Dᵒᵖ ⥤ Type w.
- obj : C → D → Type w
The object part
The morphism part
- map_id (X : C) (Y : D) : self.map (CategoryStruct.id X) (CategoryStruct.id Y) = CategoryStruct.id (self.obj X Y)
- map_comp {X₁ X₂ X₃ : C} {Y₁ Y₂ Y₃ : D} (f : X₁ ⟶ X₂) (f' : X₂ ⟶ X₃) (g : Y₁ ⟶ Y₂) (g' : Y₂ ⟶ Y₃) : self.map (CategoryStruct.comp f f') (CategoryStruct.comp g g') = CategoryStruct.comp (self.map f g') (self.map f' g)
Instances For
A profunctor from C to D (Profunctor.{w} C D) is a bifunctor C ⥤ Dᵒᵖ ⥤ Type w.
Equations
Instances For
Typecheck a bifunctor C ⥤ Dᵒᵖ ⥤ Type w as a profunctor.
Equations
- F.profunctor = F
Instances For
Custom structure to construct natural transformations between profunctors, see
CategoryTheory.Profunctor.ofHom.
The components of the natural transformation
- naturality ⦃X X' : C⦄ ⦃Y Y' : D⦄ (f : X ⟶ X') (g : Y ⟶ Y') : CategoryStruct.comp (P.map f g) (self.app X' Y) = CategoryStruct.comp (self.app X Y') (Q.map f g)
Instances For
Construct a profunctor from a ProfunctorCore.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Construct a natural transformation between profunctors from a ProfunctorCore.Hom.
Equations
- CategoryTheory.Profunctor.ofHom f = { app := fun (X : C) => { app := fun (Y : Dᵒᵖ) => f.app X (Opposite.unop Y), naturality := ⋯ }, naturality := ⋯ }
Instances For
The identity profunctor from C to C. This is defined as the Yoneda bifunctor.
Instances For
The opposite of a profunctor.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Whisker a profunctor from C to D with functors into C and D.
Equations
- P.whiskerLeft₂ F G = (((CategoryTheory.Functor.whiskeringLeft₂ (Type ?u.63)).obj F).obj G.op).obj P
Instances For
Increase the universe level of a profunctor.
Equations
Instances For
Increase the universe level of a profunctor by one. This enables dot notation P.ulift1,
which is not possible with Profunctor.ulift.
Equations
Instances For
Given a functor from C to D, this is the corresponding profunctor from C to D.
Equations
Instances For
Given a functor from C to D, this is the corresponding profunctor from D to C.