Definitions of a Group Scheme I am confused about why the following two definitions of group schemes is equivalent:
$Def\space 1$: Let $S$ be a scheme. A group scheme over $S$ is an $S$-scheme $G$ equipped with $S$-maps $m:G\times_SG\to G$ and $i:G\to G$ satisfying some natural identities and associativities.
$Def\space2$: Let $S$ be a scheme. A group scheme over $S$ is an $S$-scheme $G$ such that for any $S$-scheme $S^\prime$, the set $G(S^\prime)={Hom}_S(S^\prime, G)$ has a group structure functorial in $S^\prime$.
The second definition is from the remark in Brian Conrad's notes on abelian varieties. I'm not sure whether I have misunderstood some part. I am now confused about why the second definition implies the first one. Looking forward to your answer. Thanks
 A: You’re missing one “neutral $S$-map” $S \rightarrow G$ in your first definition.
To go from the second definition to the first, take as neutral map $\nu: S \rightarrow G$ is the neutral element of $G(S)$. Take as inverse map $i: G \rightarrow G$ the inverse of identity in the group $G(G)$. Take as multiplication map $m: G\times_S G \rightarrow G$ the product (in the group $G(G\times_S G)$) of the first and the second projection.
I’ll let you check that the associativity and neutral identities are satisfied.
A: There is a much more general definition applying for categories having finite products and terminal objects than just schemes. Let $\mathcal{C}$ be a category having finite products and terminal objects $Z$. A group objects in $\mathcal{C}$ is an object $G$ and three morphisms $\mu:G \times G \to G, G \to G, Z \to G$ (multiplication, inverse and identity element) satisfying certain commutative diagrams as in the case of schemes.
Theorem. Let $\mathcal{C}$ be a category having finite products and terminal objects $Z$. An object $G$ in $\mathcal{C}$ is a group object if and only if $\mathrm{Hom}(\square,G)$ takes value in $\mathbf{Groups}$ - the category of groups. In this case, the multiplication
$$\mathrm{Hom}(X,G) \times \mathrm{Hom}(X,G) \to \mathrm{Hom}(X,G)$$
is given by $(f,g) \mapsto \mu(f\times g)$, where $f \times g: X \to G \times G$ is given by the universal property of product.
You may wish to prove the theorem above by yourself. It is straightforward.
A: That the second definition implies the first one is an application of the Yoneda lemma. In fact, if the functor $G(-)$ takes values in the category of groups, then one obtains natural transformations $m\colon G(-)\times G(-)\to G(-)$, $i\colon G(-)\to G(-)$ and $e\colon S(-)\to G(-)$ that satisfy the axioms of your first definition on the level of set-valued functors on the category of $S$-schemes. Then the Yoneda lemma implies that the maps $m, i$ and $e$ come from maps in the category of $S$- schemes that satisfy the same relations.
