For categories , the functor category (also or ) has functors as objects and natural transformations as morphisms; composition is vertical composition of natural transformations (componentwise) and identities are (7S Exercise 3.55).
Sources: 7 Sketches Definition 3.54, Examples 3.56, 3.57, Definition 3.60; Kittenlab Lecture 7 (
FunctorCat), 8, 9, 12; DaoFP §9.3 (“Functor categories”), §9.7, §10.1, §10.4; CTfS Proposition 4.3.2.2, Exercises 4.3.2.5–4.3.2.10, Example 4.5.3.22
- “What is an arrow in one category could be an object in another”: in functors are arrows; in they are dots (DaoFP).
- is the category of database instances (Definition 3.60); ; (Category of Graphs); is the category of presheaves and of co-presheaves.
- for the preorder is the preorder of monotone maps (Example 3.57); in general is a preorder when is.
- is the category of diagrams of shape ; limits and colimits are adjoints to ; .
- is the internal hom of the cartesian closed category , so functors can be curried (DaoFP §9.7, §10.1: ); this is how the Yoneda Embedding arises from the Hom Functor.
- Limits and colimits in are computed pointwise when has them (products/coproducts/pushouts of graphs, Kittenlab). is a Topos.
- Small cases (CTfS Exercises 4.3.2.5–4.3.2.9): , and — the laws , , of Arithmetic of Sets; is the arrow category of , whose objects are morphisms and whose morphisms are commutative squares. Natural transformations are functors too (CTfS Example 4.5.3.22): between is the same as a functor out of the “-shaped prism”, sending the front pane via , the back pane via , and the front-to-back edges to the components.
- The set of natural transformations is an End: (DaoFP §17.3). The Yoneda Lemma: .
Docs: Categories & functors — Kittenlab Lecture 7
Builds on: Category (Category), Functor (Functor), Natural Transformation (NaturalTransformation) — run those notes’ Julia code first.
# Kittenlab src/NaturalTransformations.jl
struct FunctorCat{C<:Category, D<:Category} <: Category{Functor{C,D}, NaturalTransformation{C,D}}
c::C; d::D
end
# compose = vertical composition of components, id = identity transformation (see Natural Transformation)
# Catlab: the category of C-sets for a schema is available through ACSet types;
# hom-sets are computed by `homomorphisms(X, Y)`open CategoryTheory in
example {C D : Type} [Category C] [Category D] : Category (C ⥤ D) := inferInstance -- Functor.category
#check CategoryTheory.Functor.category
#check CategoryTheory.currying -- (C × D ⥤ E) ≌ (C ⥤ D ⥤ E)-- objects: Functor instances f; morphisms: forall a. f a -> g a; composition is (.)
newtype (:~>) f g = Nat (forall a. f a -> g a)
idNat :: f :~> f
idNat = Nat id
compNat :: (g :~> h) -> (f :~> g) -> (f :~> h)
compNat (Nat b) (Nat a) = Nat (b . a)