Skip to main content

M-sets and Yoneda for monoids

The Yoneda lemma says that for a category C\mathbb{C}, an object CC in C\mathbb{C}, and a functor S:CSetsS:\mathbb{C}\to\textbf{Sets}, Nat(hom(C,),S)\operatorname{Nat}(\operatorname{hom}(C,-),S) is in bijection with S(C)S(C). These bijections are given by α:Nat(hom(C,),S)S(C)\alpha: \operatorname{Nat}(\operatorname{hom}(C,-),S)\to S(C) and β:S(C)Nat(hom(C,),S)\beta: S(C) \to \operatorname{Nat}(\operatorname{hom}(C,-),S) defined as α(σ)=σC(1C)\alpha(\sigma)=\sigma_ {C}(1_ {C}) and β(c)A(f)=S(f)(c)\beta(c)_ {A}(f)=S(f)(c)1. This is the covariant form of the Yoneda lemma. There is also a contravariant form that specifies the bijective correspondence Nat(hom(,C),S)S(C)\operatorname{Nat}(\operatorname{hom}(-,C),S)\approx S(C). Setting S=hom(,C)S=\operatorname{hom}(-,C'), the Yoneda lemma tells us that natural transformations between the functors hom(,C)\operatorname{hom}(-,C) and hom(,C)\operatorname{hom}(-,C') are in bijection with elements of the set hom(C,C)\operatorname{hom}(C,C').


Let MM be a monoid, then a left MM-set X\mathcal{X} is an object in the functor category SetsM\textbf{Sets}^M1. Let X:MSets\mathcal{X}:M\to\textbf{Sets} be a covariant functor then X\mathcal{X} specifies an object XX in Sets\textbf{Sets}, the image of the unique object of MM under X\mathcal{X}, together with an endomorphism X(u):XX\mathcal{X}(u):X\to X for each morphism uu of MM (i.e. an element of the monoid MM) that maps xuxx\mapsto ux such that X(u)X(v)=X(uv)\mathcal{X}(u)\mathcal{X}(v)=\mathcal{X}(uv) and X(e)=1X\mathcal{X}(e)=1_ {X}. Similarly, a contravariant functor X:MopSets\mathcal{X}:M^{op}\to\textbf{Sets} is a right MM-set (or equivalently, an MopM^{op}-set), but must instead satisfy X(vu)=X(u)X(v)\mathcal{X}(vu) = \mathcal{X}(u)\mathcal{X}(v). When we refer to “MM-sets” we mean left MM-sets.

The monoid MM itself is an MM-set. Since MM, viewed as a category, has only a single object, the set homM({M},{M})\operatorname{hom}_ {M}(\{M\},\{M\}) is the set of MM-set endomorphisms of {M}\{M\} in MM and so homM({M},{M})=M\operatorname{hom}_ {M}(\{M\},\{M\})=M. Note that the set homM({M},{M})\operatorname{hom}_ {M}(\{M\},\{M\}) inherits the monoid structure from the properties of composition of morphisms in a category. The covariant functor homM({M},):MSets\operatorname{hom}_ {M}(\{M\},-):M\to \textbf{Sets} is a MM-set U(M)U(M) (where U:MonSetsU:\textbf{Mon}\to\textbf{Sets} is the forgetful functor) with MM acting on U(M)U(M) by left multiplication since for uMu\in M, homM({M},u):MM\operatorname{hom}_ {M}(\{M\},u):M\to M is defined by homM({M},u)(x)=ux\operatorname{hom}_ {M}(\{M\},u)(x)=ux for all xMx\in M. Similarly, the contravariant functor homM(,{M}):MopSets\operatorname{hom}_ {M}(-,\{M\}):M^{op}\to \textbf{Sets} is a MM-set U(M)U(M) with MM acting on U(M)U(M) by right multiplication. As a result, we denote the MM-set U(M)U(M) as MM.


Consider an MM-set S:MSetsS:M\to \textbf{Sets}, then a natural transformation τ:MS\tau : M \to S is an MM-set homomorphism from MM to SS1. The map τ:MS\tau : M\to S is the unique component of the natural transformation. The naturality condition is satisfied since τ\tau is a MM-set homomorphism, that is, for uu a morphism in MM,

τ(M(u)(x))=τ(ux)=uτ(x)=S(u)(τ(x))\tau (M(u)(x))=\tau (ux)=u\tau (x)=S(u)(\tau (x))

for all xMx\in M.

Now, we can form the set homSetsM(M,S)\operatorname{hom}_ {\textbf{Sets}^M}(M,S) which consists of morphisms MSM\to S of MM-sets (i.e. MM-set homomorphisms). These morphisms are natural transformations of the functors MM and SS, so

homSetsM(M,S)=Nat(M,S)=Nat(homM({M},),S)\operatorname{hom}_ {\textbf{Sets}^M}(M,S)=\operatorname{Nat}(M,S)=\operatorname{Nat}(\operatorname{hom}_ {M}(\{M\},-),S)

since we can represent MM with the functor homM({M},)\operatorname{hom}_ {M}(\{M\},-) as every monoid acts on itself by left or right multiplication. Hence by the Yoneda lemma,

homSetsM(M,S)=Nat(homM({M},),S)S({M})=S.\operatorname{hom}_ {\textbf{Sets}^M}(M,S) = \operatorname{Nat}(\operatorname{hom}_ {M}(\{M\},-),S)\approx S(\{M\})=S.

We have proved the following result,

MM-set homomorphisms MSM\to S correspond bijectively to elements of SS.

This bijection is given by the maps α:homSetsM(M,S)S\alpha:\operatorname{hom}_ {\textbf{Sets}^M}(M,S)\to S and β:ShomSetsM(M,S)\beta:S\to\operatorname{hom}_ {\textbf{Sets}^M}(M,S) defined by

α(σ)=σ(e) and,\alpha(\sigma)=\sigma(e)\text{ and,}β(s)(x)=S(x)(s)=xs.\beta(s)(x)=S(x)(s)=xs.

They are inverse to each other since

α(β(s)(x))=β(s)(e)=es=s and,\alpha(\beta(s)(x))=\beta(s)(e)=es=s\text{ and,}β(α(σ))(x)=S(x)(α(σ))=xα(σ)=xσ(e)=σ(xe)=σ(x).\beta(\alpha(\sigma))(x)=S(x)(\alpha(\sigma))=x\alpha(\sigma)=x\sigma(e)=\sigma(xe)=\sigma(x).

We can interpret this bijection as follows, the choice of σ(e)\sigma(e) determines every other value σ(x)\sigma(x) for xMx\in M since

σ(x)=σ(xe)=xσ(e)\sigma(x)=\sigma(xe)=x\sigma(e)

as σ\sigma is an MM-set homomorphism2.

Cayley’s Theorem arises as a special case of the above result. For a group GG, set M=S=GM=S=G then we have that

hom(G,G)G\operatorname{hom}(G,G)\approx G

and since the set hom(G,G)\operatorname{hom}(G,G) contains automorphisms of GG, it is a subgroup of the group of all permutations on GG.


There is a counterpart to the bijection hom(M,S)S\operatorname{hom}(M,S)\approx S in linear algebra. Consider a field K\mathbb{K} and a K\mathbb{K}-vector space VV, then hom(K,V)V\operatorname{hom}(\mathbb{K},V)\approx V. This bijection is given by α:hom(K,V)V\alpha:\operatorname{hom}(\mathbb{K},V)\to V defined as α(σ)=σ(1)\alpha(\sigma)=\sigma(1). The map α\alpha is clearly linear and injective. To see that it is surjective, notice that for any vVv\in V, there is a map σhom(K,V)\sigma\in\operatorname{hom}(\mathbb{K},V) that maps the multiplicative identity 11 onto vv, namely, σ(k)=kv\sigma(k)=kv. The inverse map β:Vhom(K,V)\beta:V\to\operatorname{hom}(\mathbb{K},V) is given by β(v)(k)=kv\beta(v)(k)=kv, and we have that

α(β(v)(k))=β(v)(1)=1v=v and,\alpha(\beta(v)(k))=\beta(v)(1)=1v=v\text{ and,}β(α(σ))(k)=β(σ(1))(k)=kσ(1)=σ(k).\beta(\alpha(\sigma))(k)=\beta(\sigma(1))(k)=k\sigma(1)=\sigma(k).

However, we are not able to obtain this result from the Yoneda lemma as it has been formulated here. A stronger result, the enriched Yoneda lemma, is required3.


Let C\mathbb{C} be a category, then the Yoneda embedding is the functor Y:CSetsCopY:\mathbb{C}\to\textbf{Sets}^{\mathbb{C}^{op}} that maps every object CC in C\mathbb{C} to the functor hom(,C):CopSets\operatorname{hom}(-,C):\mathbb{C}^{op}\to\textbf{Sets} and every morphism c:CCc:C\to C' in C\mathbb{C} to the natural transformation hom(,c):hom(,C)hom(,C)\operatorname{hom}(-,c):\operatorname{hom}(-,C)\to\operatorname{hom}(-,C'), where each component of the natural transformation is defined by hom(,c)A=hom(A,c)\operatorname{hom}(-,c)_ {A}=\operatorname{hom}(A,c) for each object AA in C\mathbb{C} (i.e. postcomposition with cc). The Yoneda embedding is fully faithful which follows from the Yoneda lemma1. This means that the functor YY preserves the relationships that CC shares with every other object in C\mathbb{C} and so YY fully faithfully embeds C\mathbb{C} into SetsCop\textbf{Sets}^{\mathbb{C}^{op}}. That is, for every natural transformation τ:hom(,C)hom(,C)\tau:\operatorname{hom}(-,C)\to\operatorname{hom}(-,C') there is exactly one morphism c:CCc:C\to C' such that hom(,c)=τ\operatorname{hom}(-,c)=\tau. Using this embedding, we are able to work with any category C\mathbb{C} by embedding it in SetsCop\textbf{Sets}^{\mathbb{C}^{op}} which, in general, has `nicer’ properties and is easier to work with3.

We are able to obtain the Yoneda embedding by using the Yoneda lemma in the case where S=hom(,C)S=\operatorname{hom}(-,C') for some object CC' in C\mathbb{C} since the Yoneda lemma says that Nat(hom(,C),hom(,C))\operatorname{Nat}(\operatorname{hom}(-,C),\operatorname{hom}(-,C')) is in bijection with hom(C,C)\operatorname{hom}(C,C'), which is exactly the Yoneda embedding which assigns to each morphism c:CCc:C\to C' in C\mathbb{C} the natural transformation hom(,c)\operatorname{hom}(-,c) in SetsCop\textbf{Sets}^{\mathbb{C}^{op}}.

Since the Yoneda embedding YY fully faithfully embeds C\mathbb{C} into SetsCop\textbf{Sets}^{\mathbb{C}^{op}}, we have that, for any two objects CC and CC' in C\mathbb{C},

Nat(Y(C),Y(C))=Nat(hom(,C),hom(,C))hom(C,C)\operatorname{Nat}(Y(C),Y(C'))=\operatorname{Nat}(\operatorname{hom}(-,C),\operatorname{hom}(-,C'))\approx \operatorname{hom}(C,C')

and hence, there is a relationship CSetsCopSets\mathbb{C}\longleftrightarrow\textbf{Sets}^{\mathbb{C}^{op}}\longleftrightarrow\textbf{Sets} that allows us to characterise an object CC in C\mathbb{C} by its relationships to all other objects CC' in C\mathbb{C}. That is, the properties of any object CC in C\mathbb{C} are encoded in the sets hom(C,C)\operatorname{hom}(C,C') for each CC' in C\mathbb{C}.


Let M^\hat{M} be the monoid of all maps MMM\to M (not just monoid homomorphisms) and f:MM^f:M\to\hat{M} map each xMx\in M to the map f(x):MMf(x):M\to M defined by f(x)(y)=xyf(x)(y)=xy. Let Y:MSetsMopY: M\to\textbf{Sets}^{M^{op}} be the Yoneda embedding of MM into SetsMop\textbf{Sets}^{M^{op}}. Then f(x)=hom({M},x)=hom(,x)=Y(x)f(x) = \operatorname{hom}(\{M\},x) = \operatorname{hom}(-,x)=Y(x) and Y({M})=hom(,{M})=hom({M},{M})=MY(\{M\})=\operatorname{hom}(-,\{M\})=\operatorname{hom}(\{M\},\{M\})=M since MM is a single object category. Now, since YY is fully faithful, the induced functor,

Y{M},{M}:homM({M},{M})homSetsMop(Y({M}),Y({M}))Y_ {\{M\},\{M\}}:\operatorname{hom}_ {M}(\{M\},\{M\})\to\operatorname{hom}_ {\textbf{Sets}^{M^{op}}}(Y(\{M\}),Y(\{M\}))

is bijective. But, homM({M},{M})=M\operatorname{hom}_ {M}(\{M\},\{M\})=M and

homSetsMop(Y({M}),Y({M}))=homSetsMop(M,M)homSets(M,M)=M^\operatorname{hom}_ {\textbf{Sets}^{M^{op}}}(Y(\{M\}),Y(\{M\}))=\operatorname{hom}_ {\textbf{Sets}^{M^{op}}}(M,M)\subset\operatorname{hom}_ {\textbf{Sets}}(M,M) = \hat{M}

since Y({M})Y(\{M\}) is the MopM^{op}-set U(M)U(M) which is MM viewed as a right MM-set. So we have that the induced functor

Y{M},{M}:MM^,Y_ {\{M\},\{M\}}:M\to\hat{M},

defined by Y{M},{M}(x)=Y(x)=f(x)Y_ {\{M\},\{M\}}(x) =Y(x)= f(x), is bijective onto homSetsMop(M,M)\operatorname{hom}_ {\textbf{Sets}^{M^{op}}}(M,M). However, it is only injective into M^\hat{M}. Now, since f(uv)(y)=(uv)y=u(vy)=f(u)(vy)=f(u)f(v)(y)f(uv)(y)=(uv)y=u(vy)=f(u)(vy)=f(u)f(v)(y), f:MM^f:M\to\hat{M} is an injective homomorphism of monoids. The image of ff is the image of the induced functor which is just the set homSetsMop(M,M)\operatorname{hom}_ {\textbf{Sets}^{M^{op}}}(M,M) of all MopM^{op}-set homomorphisms from MM to MM (or equivalently, right MM-set homomorphisms from MM to MM).


  1. George Janelidze. Category theory: A first course. Lecture Notes, 2020. ↩︎ ↩︎ ↩︎ ↩︎

  2. Emily Riehl. Category theory in context. Dover Publications, 2017. ↩︎

  3. George Janelidze. Conversation on yoneda lemma. Personal communication 07/06/22, 2022. ↩︎ ↩︎