TITLE: explicitly represent a representable functor
QUESTION [8 upvotes]: Assume you were given a functor $$F : k\text{-}\mathbf{alg}\to\mathbf{set},$$
with the additional information that it is representable. Is there then a procedure to find an object $A$ that represents $F$? (In other words, an object $A$ such that there is a natural isomorphism $h^A \simeq F$.) 
For instance, we could think of the functor $G_m : R \mapsto R^\times$, where $R$ is a $k$-algebra and $R^\times$ is the set of invertible elements in $R$. Then the object $A = k[t,t^{-1}]$ will do, but this already requires a moment of thought. Is there an infallible way to find this?

REPLY [9 votes]: Zhen Lin's Postscript already answers the general question: If $F$ is isomorphic to a functor of the form $R \mapsto \{a \in R^I : f_j(a)=0 \forall j\}$, where $I$ is a set and $f_j \in k[\{X_i\}_{i \in I}$ are polynomials, then $F$ is represented by $k[\{X_i\}_{i \in I}]/(f_j)$. For example, the functor $R \mapsto \{(a,b,c) \in R^3 : 1+ab=c^2, c \in R^*\}$ is isomorphic to $\{(a,b,c,d) \in R^4 : 1+ab=c^2,cd=1\}$ and therefore represented by $k[x_1,x_2,x_3,x_4]/(1+x_1 x_2-x_3^2,1-x_3 x_4)$.
Let me apply this to a specific situation where you probably don't see a representing object immediately. I hope that this illustrates how one can find a representing object quite systematically. 
Let $G$ be a group and fix some $n \in \mathbb{N}$. If $R$ is a $k$-algebra, let $F_G(R)$ be the set of $n$-dimensional representations of $G$ over $R$, i.e. homomorphisms $G \to \mathrm{GL}_n(R)$. The action on morphisms is clear, thus we get a functor $F_G : \mathsf{Alg}(k) \to \mathsf{Set}$. I claim that $F_G$ is representable by some $k$-algebra $R_k(G)$. Of course this is clear by the usual Adjoint Functor Theorem quoted by Zhen Lin. But how does $R_k(G)$ look like?
For $G=\mathbb{Z}$ we have $F_{\mathbb{Z}}(R)=\mathrm{GL}_n(R)$, which is clearly represented by $R_k(\mathbb{Z})=k[\{X_{ij}\}_{1 \leq i,j \leq n},\mathrm{det}(X_{ij})^{-1}]$ (using the universal properties of polynomial algebras and localization).
If $G=G_1 \sqcup G_2$ is a coproduct of two groups, then $F_{G}=F_{G_1} \times F_{G_2}$, thus $R_k(G)=R_k(G_1) \sqcup R_k(G_2)$ as $k$-algebras, where $\sqcup=\otimes_k$ here. The same works for infinitely many groups. So we have found $R_k(G)$ for free groups $G$.
If $G_1 \rightrightarrows G_2 \to G$ is a coequalizer, then $F_G \to F_{G_1} \rightrightarrows F_{G_2}$ is an equalizer, hence $R_{G_1} \rightrightarrows R_{G_2} \to R_G$ is a coequalizer. Since every group $G$ is some coequalizer as above with $G_1,G_2$ free, we have constructed $R_k(G)$.
Note that although the construction of $R_k(G)$ depends on a free presentation of $G$ and is therefore terribly uncanonical, the definition via the universal property $\hom_{\mathsf{Alg}(k)}(R_k(G),R) \cong \hom_{\mathsf{Grp}}(G,\mathrm{GL}_n(R))$ means that $R_k(G)$ is canonically determined.
Here is an example: Let $n=1$ and $G=\mathbb{Z}/5$. We have $R_k(\mathbb{Z})=k[x,x^{-1}]$. Since $\mathbb{Z} \rightrightarrows \mathbb{Z} \to \mathbb{Z}/5$ is a coequalizer, where the two maps are multiplication with $0$ resp. $5$, it follows that (one possible construction for) $R_k(\mathbb{Z}/5)$ is the coequalizer of $k[x,x^{-1}] \rightrightarrows k[x,x^{-1}]$, where the maps send $x \mapsto x^0=1$ resp. $x^5$, i.e. $k[x]/(x^5-1)$.
Actually this example is a special case of a quite general notion of tensor product studied by Freyd in his paper Algebra-valued functors in general and tensor products in particular. If $C,D,E$ are algebraic categories, then right adjoints $C \to D$ and $D \to E$ compose to a right adjoint $C \to E$. But right adjoints $C \to D$ are represented by Co-$C$-algebras in $D$. Thus, if we also have a Co-$D$-algebra in $E$, we may "tensor" them over $D$ to get a Co-$C$-algebra in $E$. It may be described via generators and relations. In the example above, $F_G$ is the composition of the representable functors $\mathrm{GL}_n : \mathsf{Alg}(k) \to \mathsf{Grp}$ and $\hom(G,-):\mathsf{Grp} \to \mathsf{Set}$, hence represented by $A \otimes_{\mathsf{Grp}} G$ where $A$ represents $\mathrm{GL}_n$. Of course, Freyd's tensor products can be applied to lots of other examples.