may be generalized to free modules over a principal ideal domain. For instance, submodules of free modules over principal ideal domains are free, a fact that writes allows for "automatic generalization" of homological machinery to these modules. Additionally, the theorem that every projective is free generalizes in the same way. Properties Universal property A free abelian group with basis has the following universal property: for every function from to an abelian group , there exists a unique group homomorphism from to which extends . Here, a group homomorphism is a mapping from one group to the other that is consistent with the group product law: performing a product before or after the mapping produces the same result. By a general property of universal properties, this shows that "the" abelian group of base is unique up to an isomorphism. Therefore, the universal property can be used as a definition of the free abelian group of base . The uniqueness of the group defined by this property shows that all the other definitions are equivalent. It is because of this universal property that free abelian groups are called "free": they are the free objects in the category of abelian groups, the category that has abelian groups as its objects and homomorphisms as its arrows. The map from a basis to its free abelian group is a functor, a structure-preserving mapping of categories, from sets to abelian groups, and is adjoint to the forgetful functor from abelian groups to sets. However, a free abelian group is not a free group except in two cases: a free abelian group having an empty basis (rank zero, giving the trivial group) or having just one element in the basis (rank one, giving the infinite cyclic group). Other abelian groups are not free groups because in free groups must be different from if and are different elements of the basis, while in free abelian groups the two products must be identical for all pairs of elements. In the general category of groups, it is an added constraint to demand that , whereas this is a necessary property in the category of abelian groups. Rank Every two bases of the same free abelian group have the same cardinality, so the cardinality of a basis forms an invariant of the group known as its rank. Two free abelian groups are isomorphic if and only if they have the same