In mathematics, specifically in category theory, hom-sets (i.e. sets of morphisms between objects) give rise to important functors to the category of sets.
These functors are called hom-functors and have numerous applications in category theory and other branches of mathematics.
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.
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 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.
Referring to the above commutative diagram, one observes that every morphism gives rise to a natural transformation and every morphism gives rise to a natural transformation Yoneda's lemma implies that every natural transformation between Hom functors is of this form.
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: Categories that possess an internal Hom functor are referred to as closed categories.
For the case of a closed monoidal category, this extends to the notion of currying, namely, that where
is a bifunctor, the internal product functor defining a monoidal category.
The most famous of these are simply typed lambda calculus, which is the internal language of Cartesian closed categories, and the linear type system, which is the internal language of closed symmetric monoidal categories.
Note that a functor of the form is a presheaf; likewise, Hom(A, –) is a copresheaf.
The internal hom functor preserves limits; that is,
If A is an abelian category and A is an object of A, then HomA(A, –) is a covariant left-exact functor from A to the category Ab of abelian groups.