Curry and uncurry, as functors. #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
We define curry : ((C × D) ⥤ E) ⥤ (C ⥤ (D ⥤ E))
and uncurry : (C ⥤ (D ⥤ E)) ⥤ ((C × D) ⥤ E)
,
and verify that they provide an equivalence of categories
currying : (C ⥤ (D ⥤ E)) ≌ ((C × D) ⥤ E)
.
The uncurrying functor, taking a functor C ⥤ (D ⥤ E)
and producing a functor (C × D) ⥤ E
.
Equations
- category_theory.uncurry = {obj := λ (F : C ⥤ D ⥤ E), {obj := λ (X : C × D), (F.obj X.fst).obj X.snd, map := λ (X Y : C × D) (f : X ⟶ Y), (F.map f.fst).app X.snd ≫ (F.obj Y.fst).map f.snd, map_id' := _, map_comp' := _}, map := λ (F G : C ⥤ D ⥤ E) (T : F ⟶ G), {app := λ (X : C × D), (T.app X.fst).app X.snd, naturality' := _}, map_id' := _, map_comp' := _}
The object level part of the currying functor. (See curry
for the functorial version.)
The currying functor, taking a functor (C × D) ⥤ E
and producing a functor C ⥤ (D ⥤ E)
.
Equations
- category_theory.curry = {obj := λ (F : C × D ⥤ E), category_theory.curry_obj F, map := λ (F G : C × D ⥤ E) (T : F ⟶ G), {app := λ (X : C), {app := λ (Y : D), T.app (X, Y), naturality' := _}, naturality' := _}, map_id' := _, map_comp' := _}
The equivalence of functor categories given by currying/uncurrying.
Equations
- category_theory.currying = category_theory.equivalence.mk category_theory.uncurry category_theory.curry (category_theory.nat_iso.of_components (λ (F : C ⥤ D ⥤ E), category_theory.nat_iso.of_components (λ (X : C), category_theory.nat_iso.of_components (λ (Y : D), category_theory.iso.refl ((((𝟭 (C ⥤ D ⥤ E)).obj F).obj X).obj Y)) _) _) category_theory.currying._proof_3) (category_theory.nat_iso.of_components (λ (F : C × D ⥤ E), category_theory.nat_iso.of_components (λ (X : C × D), category_theory.eq_to_iso _) _) category_theory.currying._proof_6)
F.flip
is isomorphic to uncurrying F
, swapping the variables, and currying.
Equations
- category_theory.flip_iso_curry_swap_uncurry F = category_theory.nat_iso.of_components (λ (d : D), category_theory.nat_iso.of_components (λ (c : C), category_theory.iso.refl ((F.flip.obj d).obj c)) _) _
The uncurrying of F.flip
is isomorphic to
swapping the factors followed by the uncurrying of F
.
Equations
- category_theory.uncurry_obj_flip F = category_theory.nat_iso.of_components (λ (p : D × C), category_theory.iso.refl ((category_theory.uncurry.obj F.flip).obj p)) _
A version of category_theory.whiskering_right
for bifunctors, obtained by uncurrying,
applying whiskering_right
and currying back
Equations
- category_theory.whiskering_right₂ B C D E = category_theory.uncurry ⋙ category_theory.whiskering_right B (C × D) E ⋙ (category_theory.whiskering_left ((B ⥤ C) × (B ⥤ D)) (B ⥤ C × D) (B ⥤ E)).obj (category_theory.prod_functor_to_functor_prod B C D) ⋙ category_theory.curry