Constructing the groupification of a semigroup (Vakil 1.5.G)? In the first chapter of Ravi Vakil's Algebraic Geometry notes, he suggests a construction of the groupification $H(S)$ of an abelian semigroup $S$ by considering $S\times S/\sim$ where $(a,b)\sim (c,d)$ iff there is $e\in S$ such that $a+d+e=b+c+e$. 
I can verify that this is a group, but I can't figure out what the universal map $S\to H(S)$ should be so that all morphisms $S\to G$ for $G$ a group factor uniquely though $H(S)$. For the Grothendieck group of a commutative monoid, the same construction would have the universal map $s\mapsto (s,0)$, but I don't know how to mimic this if $S$ has no identity. 
 A: The construction is not completely correct. If $S=\emptyset$, then $H(S)=\emptyset$, which carries no group structure. So you should better first consider the free commutative monoid on your commutative semigroup. It just freely adjoins a unit element $0$. Then perform the Grothendieck group. The universal homomorphism $S \to H(S)$ is $s \mapsto [s,0]$.
A: Since $(a,b)$ is sopposed to equal $a-b$, you could take $s\mapsto [(s+b,b)]$ for any fixed (or even variable)  $b$. Maybe the most convenient way is to write $s\mapsto [(s+s,s)]$.
A: You can also construct the groupification in terms of generators and relations. Let $(S,*)$ be your abelian semigroup, and let $F(S)$ be the free abelian group with generators $S$. Define $\langle C\rangle$ be the subgroup generated by the elements $(a*b)-a-b$ for all $a,b\in S$. 
I claim that the groupification $\operatorname{Grp}(S)=F(S)/\langle C\rangle$. For ease, let $\bar{a}=a+\langle C\rangle$ denote the coset represented by $a$. Then $\operatorname{Grp}(S)$ is generated by $\{\bar{a}:a\in S\}$ subject to $\overline{a*b}=\bar{a}+\bar{b}$. Define the universal map $\varphi\colon S\to\operatorname{Grp}(S)$ by $a\mapsto\bar{a}$. This is indeed a semigroup morphism since
$$
\varphi(a*b)=\overline{a*b}=\bar{a}+\bar{b}=\varphi(a)+\varphi(b).
$$
Then $(\operatorname{Grp}(S),\varphi)$ satisfies the desired universal property. For suppose $g\colon S\to G$ is a morphism of semigroups, where $G$ is an abelian group. This extends to a map, also denoted $g$, on $F(S)$. Observe
$$
g(a*b-a-b)=g(a*b)-g(a)-g(b)=g(a)+g(b)-g(a)-g(b)=0
$$
so $g$ factors through $\operatorname{Grp}(S)$ since it kills $\langle C\rangle$, inducing a map $\tilde{g}\colon \operatorname{Grp}(S)\to G$ such that $\tilde{g}(\bar{a})=g(a)$. Then
$$
\tilde{g}(\varphi(a))=\tilde{g}(\bar{a})=g(a)
$$
so $g=\tilde{g}\circ\varphi$. If $h\colon\operatorname{Grp}(S)\to G$ is another morphism such that $g=h\circ\varphi$, then
$$
h(\bar{a})=h(\varphi(a))=g(a)=\tilde{g}(\bar{a})
$$
so that $h=\tilde{g}$, as they agree on a generating set $\{\bar{a}:a\in S\}$ of $\operatorname{Grp}(S)$. 
