@@ -25,11 +25,17 @@ namespace CategoryTheory
2525
2626universe w
2727
28+ /-- A profunctor between two categories `C` and `D` is a functor from `Cᵒᵖ × D` to the category of
29+ types. We encode this data as a structure. -/
2830structure Profunctor (C : Type *) [Category* C] (D : Type *) [Category* D] where
31+ /-- Apply a profunctor to a pair of objects. -/
2932 obj : D → C → Type w
33+ /-- Apply a profunctor to a pair of maps. -/
3034 map {X X' : D} {Y Y' : C} (f : X' ⟶ X) (g : Y ⟶ Y') :
3135 obj X Y → obj X' Y'
36+ /-- Identity law for profunctors. -/
3237 map_id (X : D) (Y : C) (e : obj X Y) : map (𝟙 _) (𝟙 _) e = e
38+ /-- Composition law for profunctors. -/
3339 map_comp {X X' X'' : D} {Y Y' Y'' : C}
3440 (f' : X'' ⟶ X') (f : X' ⟶ X)
3541 (g : Y ⟶ Y') (g' : Y' ⟶ Y'')
@@ -85,12 +91,14 @@ theorem map_eq_mapR_mapL (H : Profunctor.{w} C D) {X X' : D} {Y Y' : C}
8591 H.map f g e = H.mapL f (H.mapR g e) := by
8692 simp only [mapL, mapR, ← H.map_comp, Category.comp_id]
8793
88- def mpRight (H : Profunctor.{w} C D) {a b c} (p : b = c) (f : H.obj a b) : H.obj a c :=
89- H.mapR (eqToHom p) f
90-
94+ /-- Transport a profunctor along an equality on the left. -/
9195def mpLeft (H : Profunctor.{w} C D) {a b c} (p : a = b) (f : H.obj b c) : H.obj a c :=
9296 H.mapL (eqToHom p) f
9397
98+ /-- Transport a profunctor along an equality on the right. -/
99+ def mpRight (H : Profunctor.{w} C D) {a b c} (p : b = c) (f : H.obj a b) : H.obj a c :=
100+ H.mapR (eqToHom p) f
101+
94102/-- A natural transformation between profunctors `H` and `K`. -/
95103structure NatTrans (H K : Profunctor.{w} C D) where
96104 /-- The component of the natural transformation at each pair of objects. -/
0 commit comments