definition example

For an object of , the constant functor sends every object of to and every morphism to . In Haskell it is Const c (functorial in its second argument, DaoFP Exercise 8.3.3).

Sources: DaoFP §8.2, §8.3, §9.4 (“Picking objects”), §10.2 (“The diagonal functor”); 7 Sketches Definition 3.92 (cones); Kittenlab Lecture 9; CTfS Exercise 4.3.1.10, §5.1.2

  • Picking an object of is the same as a functor , or a constant functor from any ; picking a pair, a functor from the discrete ; picking an arrow, a functor from the Walking Arrow.
  • A Cone over a Diagram with apex is a Natural Transformation ; a Cocone is (DaoFP §9.5, Kittenlab Lecture 9: ” sends to the constant functor at ”). Hence limits and colimits are adjoints to : .
  • A function gives a natural transformation between constant functors whose every component is ; naturality squares commute trivially because the functors send all arrows to identities (CTfS Exercise 4.3.1.10). So is itself a functor, and CTfS §5.1.2 obtains limits and colimits of all -shaped diagrams at once as its adjoints .
  • The Diagonal Functor is the constant functor curried: , “which is why we use the same symbol for both”.
  • A constant -valued functor is the most lossy model of a category (DaoFP §9.6); it is represented by the Initial Object when the constant is (DaoFP Exercise 9.8.4; Kittenlab Lecture 10: represents the constant singleton functor on ).

Docs: FinCats · Categories & functors — Kittenlab Lecture 9, Lecture 10

Builds on: Category (Category), Functor (Functor) — run those notes’ Julia code first.

struct ConstFunctor{C<:Category, D<:Category, Ob, Hom} <: Functor{C, D}
  d::D; c::Ob
end
ob_map(F::ConstFunctor, _) = F.c
hom_map(F::ConstFunctor, _) = id(F.d, F.c)
#check CategoryTheory.Functor.const     -- (const J).obj X : J ⥤ C, the constant functor at X
#check CategoryTheory.Limits.Cone       -- structure Cone F: pt, π : (const J).obj pt ⟶ F
data Const c a = Const c
instance Functor (Const c) where
  fmap _ (Const c) = Const c