TITLE: Yoneda lemma and (locally) small categories
QUESTION [6 upvotes]: A category is locally small if for all objects $A, B$, $\textrm{Hom}(A,B)$ is a set.  A category is small if its objects and morphisms are all elements of a single set.
Wikipedia defines a functor category $\mathcal D^{\mathcal C}$ only for $\mathcal C$ a small category (https://en.wikipedia.org/wiki/Functor_category).  Why is this?  If $\mathcal C$ is instead locally small, does it somehow not make sense to talk about the category of functors from $\mathcal C$ to $\mathcal D$? 
Also, what does this mean for the Yoneda lemma?  Do you need for $\mathcal C$ to be a small category in order for the statement "$\mathcal C$ is antiequivalent to the full subcategory of $\mathcal D^{\mathcal C}$ consisting of representable functors" to make sense?

REPLY [4 votes]: The reason $\mathcal D^{\mathcal C}$ is usually only defined for small categories $\mathcal C$ is that it is only for small categories that the category tends to exist more or less independently of the notion of classes chosen (e.g. all functor categories always exist if you use a Grothendieck universe, but if you use "syntactic" classes it is only functor categories from small categories that are guaranteed to exist; for more on the various notions of classes see Mike Shulman's expository article Set Theory for Category Theory).
Regarding the Yoneda lemma, what you wrote seems confused: $\mathcal C$ is not anti-equivalent to a subcategory of an arbitrary $\mathcal D^{\mathcal C}$ (e.g. it's certainly not if $\mathcal D=\mathbf 1\neq\mathcal C$ where $\mathbf 1$ is the category with one object). Furthermore, the statement that (for small $\mathcal C$) $\mathcal C$ is anti-equivalent to the subcategory of representable functors in $\mathcal Set^{\mathcal C}$ is a special case of the Yoneda embedding, not the Yoneda lemma.
The Yoneda lemma states that if you have a class-valued copresheaf $\mathcal F$ on a category $\mathcal C$, then the natural transformations from the representable class-valued copresheaf $\mathrm{Hom}_{\mathcal C}(X,-)$ to $F$ are in natural bijection with the class $\mathcal F(X)$. One consequence is that the category of representable class-valued copresheaves is isomorphic to the opposite category of $\mathcal C$.
A category is locally small if each representable class-valued copresheaf $\mathrm{Hom}_{\mathcal C}(X,-)$ is representable functor to $\mathcal Set$. Since sets are small classes, the Yoneda lemma implies that the natural transformations from the representable set-valued functor $\mathrm{Hom}_{\mathcal C}(X,-)$ to a set-valued functor $F$ are in natural bijection with the set $F(X)$.
The cocompletion of a category $\mathcal C$ is a functor $\mathcal C\to\hat{\mathcal C}$ initial among functors $\mathcal C\to\mathcal D$ for $\mathcal D$ a category complete under small colimits. The Yoneda embedding is the cocompletion $\mathcal C\to\hat{\mathcal C}$ of a locally small category, which always exists (and $\hat{\mathcal C}$ is actually locally small). Explicitly, the cocompletion $\hat{\mathcal C}$ is constructed by identifying $\mathcal C$ with the category of representable (contravariant) set-valued functors $\mathrm{Hom}_{\mathcal C}(-,X)$, identifying the objects of $\hat{\mathcal C}$ with small diagrams of representable functors, then using the facts that presheaves send colimits to limits and that colimits of functors are computed pointwise, to identify $\mathrm{Hom}_{\hat{\mathcal C}}(J,K)=\mathrm{Nat}(\mathrm{colim}_j\mathrm{Hom}(-,X_j),\mathrm{colim}_k\mathrm{Hom}(-,X_k))=\mathrm{lim}_j\mathrm{colim}_k\mathrm{Hom}_{\mathcal C}(X_k,X_j)$.
In particular, the cocompletion $\hat{\mathcal C}$ of a locally small category is always a full locally small "subcategory" of $\mathcal Set^{\mathcal C}$, even if the latter is large or does not exist.
In fact, a category $\mathcal C$ is equivalent to a small category if and only if $\mathcal C$ and $\mathcal Set^{\mathcal C}$ are both locally small, in which case the cocompletion $\hat{\mathcal C}$ is all of $\mathcal Set^{\mathcal C}$; for a proof see On the Size of Categories by Freyd and Street.