internal hom

This page discusses the general concept of mapping spaces and internal homs. For mapping spaces in topology, see at compact-open topology.



For π’ž\mathcal{C} a category and X,Yβˆˆπ’žX, Y \in \mathcal{C} two objects, the internal hom [X,Y]βˆˆπ’ž[X,Y] \in \mathcal{C} from XX to YY is, if it exists, another object of π’ž\mathcal{C} which behaves like the β€œobject of morphisms” from XX to YY. In other words it is, if it exists, an internal version of the ordinary hom set π’žβˆˆSet\mathcal{C} \in Set or more generally hom object π’ž(X,Y)βˆˆπ’±\mathcal{C}(X, Y) \in \mathcal{V} of a locally small category or 𝒱\mathcal{V}-enriched category.

One way to make this precise starts by mimicking a property of the function set [X,Y]={f:Xβ†’Y}[X,Y] = \{f : X \to Y\} of functions between two sets XX and YY: this set is characterized by the fact that for any other set SS, the functions Sβ†’[X,Y]S \to [X,Y] are in natural bijection with the functions SΓ—Xβ†’YS \times X \to Y out of the cartesian product of SS with XX. That is: for each set XX, the functor (βˆ’)Γ—X(-) \times X has a right adjoint, given by the construction [X,βˆ’][X,-].

One can verbalize this thus: taking the cartesian product with the set XX is left-adjoint to taking the set of all functions out of XX.

This, then, is, generally, the definition of internal hom in any cartesian monoidal category or in fact in any monoidal category (π’ž,βŠ—)(\mathcal{C}, \otimes): the right adjoint [X,βˆ’][X,-] to the given tensor product functor (βˆ’)βŠ—X(-)\otimes X for all objects XX. It may or may not exist. If it exists, one says that (π’ž,βŠ—)(\mathcal{C}, \otimes) is a closed monoidal category. Explicity, the condition is that there is an isomorphism(bijection)

π’ž(A,[X,Z])β†’β‰ƒπ’ž(AβŠ—X,Z) \mathcal{C}(A, [X,Z]) \stackrel{\simeq}{\to} \mathcal{C}(A \otimes X, Z)

which is natural in all three variables. (The rightward map here is often called currying, especially in a closed monoidal category (and more especially for the Ξ»\lambda-calculus).)

In particular this implies that in a closed monoidal category the external hom is re-obtained from the internal hom as its set of generalized elements out of the tensor unit Iβˆˆπ’žI \in \mathcal{C} in that

I→[X,Y]X→Y \frac{I \to [X,Y]}{X \to Y}

using that IβŠ—X≃XI \otimes X \simeq X by definition of the tensor unit.

Here β€œclosed” in β€œclosed monoidal category” is in the sense that forming β€œhom-sets” does not lead β€œout of the category”. In fact the internal hom of a cartesian monoidal category is indeed the hom as seen in the internal logic of that category (the function type).

More generally, one can consider objects that satisfy some basic universal properties that an internal hom should satisfy even in the absence of a monoidal structure. If such objects exist one speaks therefore just of a closed category. Every closed category may be seen as a category enriched over itself. Accordingly, an internal hom is after all a special case of a hom-object, for the special case of this enrichment over itself.



Let (π’ž,βŠ—)(\mathcal{C}, \otimes) be a monoidal category. An internal hom in π’ž\mathcal{C} is a functor

[βˆ’,βˆ’]:π’ž opΓ—π’žβ†’π’ž [-,-] : \mathcal{C}^{op} \times \mathcal{C} \to \mathcal{C}

such that for every object Xβˆˆπ’žX \in \mathcal{C} we have a pair of adjoint functors

((βˆ’)βŠ—X⊣[X,βˆ’]):π’žβ†’π’ž. ((-) \otimes X \dashv [X, -]) : \mathcal{C} \to \mathcal{C} \,.

If this exists, (π’ž,βŠ—)(\mathcal{C}, \otimes) is called a closed monoidal category.


Evaluation map

Let (π’ž,βŠ—)(\mathcal{C}, \otimes) be a closed monoidal category.


For X,Yβˆˆπ’žX,Y \in \mathcal{C} two objects, the evaluation map

eval X,Y:[X,Y]βŠ—Xβ†’Y eval_{X,Y} : [X,Y] \otimes X \to Y

is the ((βˆ’)βŠ—X⊣[X,βˆ’])((-)\otimes X \dashv [X,-])-adjunct of the identity id [X,Y]:[X,Y]β†’[X,Y]id_{[X,Y]} : [X,Y] \to [X,Y].


If π’ž\mathcal{C} is specifically a locally cartesian closed category, then in terms of the type theory internal language of π’ž\mathcal{C} the evaluation map is the categorical semantics of the dependent type which in type theory syntax is

f:Xβ†’Y,x:X⊒f(x):Y, f \colon X \to Y,\; x \colon X \;\vdash\; f(x) \colon Y \,,

with function application on the right.

Composition map

Let (π’ž,Γ—)(\mathcal{C}, \times) be a closed monoidal category.


For X,Y,Zβˆˆπ’žX, Y, Z \in \mathcal{C} three objects, the composition morphism

∘ X,Y,Z:[Y,Z]Γ—[X,Y]β†’[X,Z] \circ_{X,Y,Z} : [Y, Z] \times [X, Y] \to [X, Z]

is the ((βˆ’)Γ—X⊣[X,βˆ’])((-)\times X \dashv [X,-])-adjunct of the following composite of two evaluation maps, def. 2:

[Y,Z]×[X,Y]×X→(id [Y,Z],eval X,Y)[Y,Z]×Y→eval Y,ZZ. [Y, Z] \times [X , Y] \times X \stackrel{(id_{[Y,Z]}, eval_{X,Y})}{\to} [Y,Z] \times Y \stackrel{eval_{Y,Z}}{\to} Z \,.

Relation to function types

The internal hom is the categorical semantics of what in type theory are function types

type theorycategory theory
natural deductionuniversal construction
function typeinternal hom
type formation⊒X:Type⊒A:Type⊒(Xβ†’A):Type\frac{\vdash\: X \colon Type \;\;\;\;\; \vdash\; A\colon Type}{\vdash \; \left(X \to A\right) \colon Type}
term introductionx:X⊒a(x):A⊒(x↦a(x)):(Xβ†’A)\frac{x \colon X \;\vdash\; a(x) \colon A}{\vdash (x \mapsto a\left(x\right)) \colon \left(X \to A\right) }
term elimination⊒f:(Xβ†’A)⊒x:Xx:X⊒f(x):A\frac{\vdash\; f \colon \left(X \to A\right)\;\;\;\; \vdash \; x \colon X}{x \colon X\;\vdash\; f(x) \colon A}
computation rule(y↦a(y))(x)=a(x)(y \mapsto a(y))(x) = a(x)

Induced monad (state monad)

For each object SS the (internal hom ⊣\dashv tensor product)-adjunction induces a monad [S,SβŠ—(βˆ’)][S, S \otimes (-)]. In computer science this monad (in computer science) is called the state monad.


In sets

In the category Set of sets, regarded as a cartesian monoidal category, the internal hom is given by function sets. This exists, by the discussion there, as soon as the foundational axioms are strong enough, for instance as soon as there are power objects, which is the special case of a function set into the 2-element set.

In simplicial sets

In the category sSet of simplicial sets, the internal hom between two simplicial sets X,YX,Y is given by the formula

[X,Y] n=Hom sSet(XΓ—Ξ”[n],Y), [X,Y]_n = Hom_{sSet}(X\times \Delta[n],Y) \,,

where Ξ”[n]\Delta[n] is the simplicial n-simplex. This [X,Y]∈sSet[X,Y] \in sSet is also called the function complex between XX and YY.

Since sSet≃PSh(Ξ”)sSet \simeq PSh(\Delta) is the category of presheaves over the simplex category, this is a special case of internal homs in sheaf toposes, discussed below.

In a sheaf topos or (∞,1)(\infty,1)-sheaf (∞,1)(\infty,1)-topos

Let CC be a site. Let H=Sh(C)\mathbf{H} = Sh(C) be the sheaf topos over CC or in fact the (∞,1)-sheaf (∞,1)-topos. We discuss the internal hom of this regard as a cartesian monoidal category/cartesian monoidal (∞,1)-category.

Hence the internal hom exist.



For X,Y∈HX, Y \in \mathbf{H} two objects, the internal hom-object

[X,Y]∈H [X,Y] \in \mathbf{H}

is the sheaf/(∞,1)-sheaf given by the assignment

[X,Y]:U↦H(UΓ—X,Y), [X,Y] : U \mapsto \mathbf{H}(U \times X, Y) \,,

for all objects U∈CU \in C which on the right we regard under the Yoneda embedding/∞-Yoneda embedding U∈Cβ†ͺYonedaHU \in C \stackrel{Yoneda}{\hookrightarrow} \mathbf{H}.


See also at closed monoidal structure on presheaves.


By the Yoneda lemma/(∞,1)-Yoneda lemma we have natural equivalences

[X,Y](U)≃H(U,[X,Y]) [X,Y](U) \simeq \mathbf{H}(U , [X,Y])

and by the defining ((βˆ’)Γ—X⊒[X,βˆ’])((-)\times X \vdash [X,-])adjunction this is naturally equivalent to

⋯≃H(UΓ—X,Y). \cdots \simeq \mathbf{H}(U \times X, Y) \,.

In the (homotopy-)type theory syntax of the internal language of H\mathbf{H} the internal hom [X,Y]∈H[X, Y] \in \mathbf{H} is the categorical semantics of the function type

⊒(Xβ†’Y):Type. \vdash (X \to Y) : Type \,.

For X,Y∈HX, Y \in \mathbf{H}, the evaluation map, def. 2,

eval X,Y:[X,Y]×X→Y eval_{X,Y} : [X,Y] \times X \to Y

is the morphism of sheaves which over each U∈CU \in C sends a morphism of sheaves ΞΈ:H(βˆ’,U)Γ—X(βˆ’)β†’Y(βˆ’)\theta : \mathbf{H}(-,U) \times X(-) \to Y(-) (which is the first component by prop. 2) and an x∈H(U,X)x \in \mathbf{H}(U,X) to

eval X,Y(U):(ΞΈ,x)↦θ U(id U,x)∈Y(U). eval_{X,Y}(U) : (\theta, x) \mapsto \theta_U(id_U, x) \in Y(U) \,.

See (MacLane-Moerdijk, p. 46).


For X,Y,Z∈HX, Y, Z \in \mathbf{H} three objects of H\mathbf{H}, the canonical composition morphism, def. 3,

∘ X,Y,Z:[Y,Z]Γ—[X,Y]β†’[X,Z] \circ_{X,Y,Z} : [Y, Z] \times [X, Y] \to [X, Z]

is given by the morphism of presheaves/(∞,1)-presheaves whose component over U∈CU \in C is the morphism of sets/∞-groupoids

∘ X,Y,Z(U):H(UΓ—X,Y)Γ—H(UΓ—Y,Z)β†’H(UΓ—X,Z) \circ_{X,Y,Z}(U) : \mathbf{H}(U \times X, Y) \times \mathbf{H}(U \times Y, Z) \to \mathbf{H}(U \times X, Z)

which sends a pair (f:U×X→Y,g:U×Y→Z)(f : U \times X \to Y, g : U \times Y \to Z) to the composite

∘ X,Y,Z(U)(f,g)=UΓ—Xβ†’(Ξ” U,id X)UΓ—UΓ—Xβ†’(id U,f)UΓ—Yβ†’gZ, \circ_{X,Y,Z}(U)(f,g) = U \times X \stackrel{(\Delta_U, id_X)}{\to} U \times U \times X \stackrel{(id_U, f)}{\to} U \times Y \stackrel{g}{\to} Z \,,

where Δ U:U→U×U\Delta_U : U \to U \times U is the diagonal morphism on UU.


By definition 3 the morphism is the adjunct of the double evaluation map

[Y,Z]×[X,Y]×X→Z. [Y,Z] \times [X,Y] \times X \to Z \,.

Since the cartesian product of two sheaves A,B∈HA, B \in \mathbf{H} is computed objectwise

AΓ—B:U↦A(U)Γ—B(U) A \times B : U \mapsto A(U) \times B(U)

it follows that over each U∈CU \in C this double evaluation map is the morphism of sets/∞\infty-groupoids

[Y,Z](U)Γ—[X,Y](U)Γ—X(U)β†’Z(U) [Y,Z](U) \times [X,Y](U) \times X(U) \to Z(U)

hence by prop. 2

H(UΓ—Y,Z)Γ—H(UΓ—X,Y)Γ—H(U,X)β†’H(U,Z), \mathbf{H}(U \times Y, Z) \times \mathbf{H}(U \times X, Y) \times \mathbf{H}(U,X) \to \mathbf{H}(U,Z) \,,

where now by prop. \ref this is the external evaluation.


Intuitively this says that the composite of a UU-parameterized family of maps {f(u):Xβ†’Y|u∈U}\{f(u) : X \to Y| u \in U\} with a UU-parameterized family of maps g(u):Yβ†’Z|u∈U{g(u) : Y \to Z| u \in U} is the UU-family given by the parameter-wise composite {g(u)∘f(u)|u∈U}\{g(u)\circ f(u) | u \in U\}.


The internal automorphism group/automorphism ∞-group of an object X∈HX \in \mathbf{H} is the subobject

Aut(X)β†ͺ[X,X] \mathbf{Aut}(X) \hookrightarrow [X,X]

of the internal hom which is maximal subject to the property that the composition of prop. 4 becomes invertible.

The (homotopy-)type theory syntax for this is given by the type of equivalences in homotopy type theory

⊒(X→≃X):Type. \vdash (X \stackrel{\simeq}{\to} X) : Type \,.

In slice categories

Let H\mathbf{H} be a locally cartesian closed category. This means that for each object X∈HX \in \mathbf{H} the slice category H /X\mathbf{H}_{/X} is a cartesian closed category. The product in the slice is given by the fiber product over XX computed in H\mathbf{H}. Fairly detailed discussion of constructions of the internal hom in such slices H /X\mathbf{H}_{/X} is at locally cartesian closed category – cartesian closure in terms of base change and dependent product.

We record some further properties


For π’ž\mathcal{C} a locally cartesian closed category and f:Xβ†’Yf \colon X \to Y any morphism in π’ž\mathcal{C}, the inverse image f *f^* of the corresponding base change adjunction

π’ž /Xβ†’βˆ f←f *β†’βˆ‘ fπ’ž /Y \mathcal{C}_{/X} \stackrel{\overset{\sum_f}{\to}}{\stackrel{\overset{f^*}{\leftarrow}}{\underset{\prod_f}{\to}}} \mathcal{C}_{/Y}

is a cartesian closed functor.

This is discussed in more detail at cartesian closed functor – Examples.

So for A,Bβˆˆπ’ž /YA,B \in \mathcal{C}_{/Y} we have isomorphisms

f *[A,B]→≃[f *A,f *B] f^* \left[A,B\right] \stackrel{\simeq}{\to} \left[f^* A , f^* B\right]

between the image of the internal hom under f *f^* and the internal hom of the images of AA and BB separately.


For H\mathbf{H} a locally cartesian closed category, f:Xβ†’Yf \colon X \to Y any morphism, and A,B∈H /XA, B \in \mathbf{H}_{/X} two objects in the slice over XX, there is a natural morphism (not in general an isomorphism)

∏ f[A,B]β†’[βˆ‘ fA,βˆ‘ fB]. \prod_f \left[A,B \right] \to \left[ \sum_f A, \sum_f B\right] \,.

Here are two ways to get this morphism:

Proof/Construction 1

For any object U∈H /YU \in \mathbf{H}_{/Y} we have a canonical morphism of hom sets

H /Y(U,∏ f[A,B]) ≃H /X(f *U,[A,B]) ≃H /X(f *UΓ—A,B) β†’H /Y(βˆ‘ f(f *UΓ—A),βˆ‘ fB) ≃Frob.Rec.H /Y(UΓ—βˆ‘ fA,βˆ‘ fB) ≃H /Y(U,[βˆ‘ fA,βˆ‘ fB]) \begin{aligned} \mathbf{H}_{/Y}( U, \prod_f [A,B] ) & \simeq \mathbf{H}_{/X}( f^* U, [A,B] ) \\ & \simeq \mathbf{H}_{/X}(f^* U \times A, B) \\ & \stackrel{}{\to} \mathbf{H}_{/Y}( \sum_f( f^* U \times A ), \sum_f B ) \\ & \stackrel{Frob.Rec.}{\simeq} \mathbf{H}_{/Y}( U \times \sum_f A , \sum_f B ) \\ & \simeq \mathbf{H}_{/Y}(U, [\sum_f A , \sum_f B]) \end{aligned}

where the first and the last steps use adjunction properties, where the morphism in the middle is the component of the dependent sum functor, and where β€œFrob.Rec.” is Frobenius reciprocity.

Since this is natural in UU, the Yoneda lemma implies the claimed morphism.

Proof/Construction 2

There is the composite morphism

(f *∏ f[A,B])Γ—Aβ†’counitΓ—id A[A,B]Γ—Aβ†’evalBβ†’unitf *βˆ‘ fB \left(f^\ast \prod_f [A, B]\right) \times A \stackrel{counit \times id_A}{\to} [A, B] \times A \stackrel{eval}{\to} B \stackrel{unit}{\to} f^\ast \sum_f B

of the adjunction (co)units and the evaluation map of the internal hom. Its hom-adjunct is

Aβ†’[f *∏ f[A,B],f *βˆ‘ fB]β‰…f *[∏ f[A,B],βˆ‘ fB], A \to [f^\ast \prod_f [A, B], f^\ast \sum_f B] \cong f^\ast [\prod_f [A, B], \sum_f B] \,,

using prop. 5 on the right. The hom-adjunct of that in turn is

βˆ‘ fAβ†’[∏ f[A,B],βˆ‘ fB]\sum_f A \to [\prod_f [A, B], \sum_f B]

and by symmetry the morphism that we are after:

∏ f[A,B]β†’[βˆ‘ fA,βˆ‘ fB]. \prod_f [A, B] \to [\sum_f A, \sum_f B] \,.

If YY is the terminal object (for simplicity), then the morphism of prop. 6 can be understood as follows: a global element of the dependent product ∏ f[A,B]\prod_f [A,B] is given by a commuting diagram in H\mathbf{H} of the form

βˆ‘ fA β†’ βˆ‘ fB β†˜ ↙ X. \array{ \sum_f A &&\to&& \sum_f B \\ & \searrow && \swarrow \\ && X } \,.

The map in prop. 6 picks out the top horizontal morphism in this diagram.

For smooth spaces and smooth ∞\infty-groupoids

Consider the site C=C = SmthMfd of smooth manifolds (and the open cover coverage) or equivalently over the dense subsite CartSp of Cartesian spaces and smooth functions between these.

The sheaf topos/(∞,1)-sheaf (∞,1)-topos H=Sh(C)\mathbf{H} = Sh(C) is that of smooth spaces/smooth ∞-groupoids. So the discussion of internal homs here is a special case of the above discussion In a sheaf topos.


For X,Y∈SmthMfdβ†ͺHX , Y \in SmthMfd \hookrightarrow \mathbf{H} two smooth manifolds, the internal hom [X,Y]∈H[X,Y] \in \mathbf{H} is the mapping space between them regarded as a diffeological space.

See at manifold structure of mapping spaces for when this internal hom is representable again by a smooth manifold.


For X∈SmthMfdβ†ͺHX \in SmthMfd \hookrightarrow \mathbf{H} the internal automorphism group, example 1, of XX is the diffeomorphism group of XX, regarded as a diffeological group

Aut(X)=Diff(X). \mathbf{Aut}(X) = \mathbf{Diff}(X) \,.

For chain complexes

For super vector spaces

The category sVectsVect of super vector spaces is the category of β„€/2\mathbb{Z}/2-graded vector spaces. Thus, its objects are pairs of vector spaces (V +,V βˆ’)(V_+,V_-), with V +V_+ called the even part and V βˆ’V_- the odd part. The morphisms in sVectsVect are likewise pairs of linear maps, i.e. we define sVectsVect to be VectΓ—Vect=Vect β„€/2Vect \times Vect = Vect^{\mathbb{Z}/2}, as usual for any sort of graded object. With this definition of the category sVectsVect, we capture the concepts of superalgebra and so on in succinct categorical terms.

Because the morphisms in sVectsVect send even things to even things and odd things to odd things, they are sometimes called even linear maps, and one may write

sVect(V,W)=EvenLin(V,W). sVect(V, W) = Even Lin(V,W).

Note that sVectsVect is enriched over VectVect, i.e. these hom-sets are vector spaces.

Occasionally, however, one does need to refer to the odd linear maps, which send even things to odd things and odd things to even things. That is, an odd linear map Vβ†’WV\to W is a pair of linear maps V +β†’W βˆ’V_+ \to W_- and V βˆ’β†’W +V_-\to W_+. The internal-hom in sVectsVect allows us to capture these as well: it is the following super vector space:

[V,W] +=EvenLin(V,W)[V,W] βˆ’=OddLin(V,W). [V,W]_+ = Even Lin(V,W) \qquad [V,W]_- = Odd Lin(V,W).

With this definition, sVectsVect becomes a closed monoidal category.

We can equivalently regard a super vector spaces (V +,V βˆ’)(V_+,V_-) as being the direct sum vector space V +βŠ•V βˆ’V_+ \oplus V_- equipped with this direct sum decomposition. If we view the internal-hom [V,W][V,W] in this way as well, then we have

[V,W]=EvenLin(V,W)βŠ•OddLin(V,W)=Lin(V,W). [V, W] = Even Lin(V,W) \oplus Odd Lin(V,W) = Lin(V,W).

In other words, any linear map between these β€œsummed” super vector spaces decomposes uniquely as the sum of an even linear map and an odd one.

For Banach spaces

A similar thing happens in the category BanBan of Banach spaces and short linear operators. The external hom consists of only the short linear maps (those bounded by 11):

Ban(V,W)={f:Lin(V,W)|β€–f‖≀1}. Ban(V,W) = \{ f\colon Lin(V,W) \;|\; {\|f\|} \leq 1 \} .

This definition of morphism recovers the most specific notion of isomorphism of Banach spaces, as well as defining the product and coproduct as the direct sum completed with p=∞p = \infty or p=1p = 1 respectively.

But the internal hom is the Banach space of all bounded linear maps:

[V,W]={f:Lin(V,W)|β€–fβ€–<∞}. [V,W] = \{ f\colon Lin(V,W) \;|\; {\|f\|} \lt \infty \} .

This is a Banach space and makes BanBan into a closed category.


A discussion query (R. Brown, T. Bartels, M. Shulman) about internal hom is at nnForum here.

Revised on October 18, 2017 10:05:03 by Urs Schreiber (