One way to define the free abelian group on a set $S$ is as $F(S) := \mbox{Hom}\_{\text{Set}}(S, \mathbb{Z})$ with the group operation coming by composition with the map $\mathbb{Z} \times \mathbb{Z} \to \mathbb{Z}$. The problem with this definition is that it's contravariant, whereas it seems to me that $F$ should really be a covariant functor since it should take functions $S \to T$ to homomorphisms $F(S) \to F(T)$. (Or should it?)


One way to get a covariant functor is to actually define $F(S) := \mbox{Hom}\_{\mbox{Ab}}( \mbox{Hom}\_{\text{Set}}(S, \mathbb{Z}), \mathbb{Z})$. It's interesting to think of the free abelian group as a "double dual" construction, but now I'm not sure that one gets the group operation in a natural way. Which of these definitions is "correct" (if either), and why? 


**Edit:** Let me rephrase my question, then. One way to explicitly describe the free abelian group on a set $S$ is as the direct sum of $|S|$ copies of $\mathbb{Z}$. Is there a categorical description of this construction, i.e. one which doesn't refer to elements, only morphisms?


(If it helps, I'm trying to digest more thoroughly the relationship between chain and cochain groups.)



What is the "right" definition of the free abelian group on a set?
As I understand things, the desire to find a more categorical *construction* of the free abelian group on a set S is not itself fully in the categorical spirit. Rather, for an object which is defined by a universal mapping property, you only need to convince yourself that it exists; you don't need to be bothered by looking at any particular construction. The point is that anything that you want to know about this object will follow most transparently from the universal mapping property. 


In this case, if we have a universal map S -> FreeAb(S) and a map of sets S -> T, we can define a map FreeAb(S) -> FreeAb(T) without "looking under the hood" at how FreeAb's are 
constructed. Namely, by composing S -> T and T -> FreeAb(T) we get a set map S -> FreeAb(T). By the universal mapping property, this factors through a homomorphism FreeAb(S) -> FreeAb(T), which is what we wanted. Done!


