Hom(–, B) maps each object X in C to the set of morphisms, Hom(X, B)
Hom(–, B) maps each morphism h : X → Y to the function
Hom(h, B) : Hom(Y, B) → Hom(X, B) given by
for each g in Hom(Y, B).
The functor Hom(–, B) is also called the functor of points of the object B.
Note that fixing the first argument of Hom naturally gives rise to a covariant functor and fixing the second argument naturally gives a contravariant functor. This is an artifact of the way in which one must compose the morphisms.
The pair of functors Hom(A, –) and Hom(–, B) are related in a natural manner. For any pair of morphisms f : B → B′ and h : A′ → A the following diagram commutes:
Both paths send g : A → B to f ∘ g ∘ h : A′ → B′.
The commutativity of the above diagram implies that Hom(–, –) is a bifunctor from C × C to Set which is contravariant in the first argument and covariant in the second. Equivalently, we may say that Hom(–, –) is a bifunctor
Hom(–, –) : Cop × C → Set
where Cop is the opposite category to C. The notation HomC(–, –) is sometimes used for Hom(–, –) in order to emphasize the category forming the domain.
Yoneda's lemma implies that every natural transformation between Hom functors is of this form. In other words, the Hom functors give rise to a full and faithful embedding of the category C into the functor categorySetCop (covariant or contravariant depending on which Hom functor is used).
Internal Hom functor
Some categories may possess a functor that behaves like a Hom functor, but takes values in the category C itself, rather than Set. Such a functor is referred to as the internal Hom functor, and is often written as
to emphasize its product-like nature, or as
to emphasize its functorial nature, or sometimes merely in lower-case:
where is a bifunctor, the internal product functor defining a monoidal category. The isomorphism is natural in both X and Z. In other words, in a closed monoidal category, the internal Hom functor is an adjoint functor to the internal product functor. The object is called the internal Hom. When is the Cartesian product, the object is called the exponential object, and is often written as .
A functor F : C → Set that is naturally isomorphic to Hom(A, –) for some A in C is called a representable functor (or representable copresheaf); likewise, a contravariant functor equivalent to Hom(–, A) might be called corepresentable.
Note that Hom(–, –) : Cop × C → Set is a profunctor, and, specifically, it is the identity profunctor .
The internal hom functor preserves limits; that is, sends limits to limits, while sends limits in , that is colimits in , into limits. In a certain sense, this can be taken as the definition of a limit or colimit.
Herrlich, Horst; Strecker, George E. (1979). "V. Functors and Natural Transformations". Category Theory. SSPM (Sigma Series in Pure Mathematics) 01. Heldermann. ISBN978-3-88538-001-6.