conditions on glueing group scheme Say let $S=\mathbb{P}^1_k=\mathop{\mathrm{Proj}}k[x_0,x_1]$ be the base scheme where $k$ is a field.
Let $\pi:G\to S$ be a morphism of $S$-schemes s.t. $G_i:=G|_{D_+(x_i)}$ is a group scheme over $D_+(x_i)$ for each $i$ and their group scheme structures agree on $G|_{D_+(x_0)\cap D_+(x_1)}$. Will this suffice for $G/S$ to be a group scheme? If not, what else do we need?
Sidenote:
Denote $S_j = D_+(x_j)$, then for each $j$ we have the multiplication map $m_j:G_j\times_{S_j} G_j \to G_j$, the inverse map $i_j:G_j \to G_j$ and the unit section $e_j:S_j\to G_j$ satisfing certain group axioms.
Clearly we can glue a candidate inverse map $i:G\to G$ and a candidate unit section $e:S\to G$, but how do we glue the multiplication map $m:G\times_S G\to G$?
 A: The essential point is that $\{G_i\times_{S_i}G_i\}_i$ actually covers $G\times_S G$!
Short answer: Glue $m:G\times_S G\to G$ via $m_i$, and then check all the group axioms work.
Theorem: Let $S$ be a scheme with an open covering $\{U_j\}_{j\in I}$. For each $j\in I$, let $(G_j,m_j,i_j,e_j)$ be a group scheme over $U_j$ with $\pi_j:G_j\to U_j$ s.t.

*

*for each pair of $(j,k)\in I^2$, there exists an isomorphism of group schemes over $U_{jk}:=U_j \cap U_k$ s.t. $\phi_{jk}:G_j|_{U_{jk}}\to G_k|_{U_{jk}}$ ($\phi_{jj}=\mathrm{id}$).

*for each triple $(j,k,l)\in I^3$, $\phi_{kl}\circ\phi_{jk}=\phi_{jl}$ restricting to $U_{jkl}:=U_j\cap U_k \cap U_l$.

Then there exists a group scheme $(G,m,i,e)$ over $S$, with structure morphism $\pi:G\to S$, open immersions of $S$-schemes $g_j:G_j\to G$ s.t. $g_k\circ \phi_{jk}=g_j$ for all $(j,k)\in I^2$, and $g_j^* f=f_j$ for each $f\in \{m,i,e\}$. And $G$ is unique up to isomorphism.

Before we state the proof, let us introduce some definitions to make it easier.
Definitions:
Let $G$ be an $S$-scheme. Define inductively $G^{(0)}:=S$ and $G^{(r+1)}=G^{(r)}\times_S G$ for $r\geq 0$. Let $\mathcal{C}$ be a sub-category of $S$-schemes s.t. the objects of $\mathcal{C}$ are $\{G^{(r)}:r\geq 0\}$ and the maps between them are just $S$-morphisms.
Given a set of morphisms (as variables) in $\mathcal{C}$, say $J=\{f_i:G^{(l_i)}\to G^{(r_i)}\}_{i\in I}$, we define $\langle J\rangle$ to be the smallest set $M$ of morphisms in $\mathcal{C}$ s.t.

*

*$M$ contains $J$, all the identity morphisms $\mathrm{id}_{G^{(r)}}$,all the structure morphisms and all the projection morphisms.

*$M$ is closed under composition.

*If $f:G^{(a)}\to G^{(b)}$ and $g:G^{(a)}\to G^{(c)}$ are in $M$, then so is $(f,g):G^{(a)}\to G^{(b+c)}$
Let
$$J_1=\{h\in \bigcup_{r\geq 0}\mathrm{Hom}_S(G^{(r)},G)| h=(G^{(r)}\stackrel{\mathrm{pr}}{\to}G^{(l_i)}\stackrel{f_i}{\to}G^{(r_i)}\stackrel{\mathrm{pr}_t}{\to}G) \text{ for some }f_i\in J \text{ or }h=(G^{(r)}\stackrel{\mathrm{pr}_t}{\to}G) \text{ for some } t \text{ and }r\}.$$
Note that the structure morphism $G^{(r)}\to G^{(0)}$ is also considered as a projection morphism.
Lemma: $\langle J\rangle$ consists of morphisms of the form $F_m\circ F_{m-1} \circ \cdots \circ F_1$ for some $m\geq 1$ s.t. for each $i$, $F_i: G^{(s_i)}\to G^{(s_{i+1})}$ satisfies the condition that either $s_{i+1}=0$ then $F_i$ agrees with the structure morphism or $(G^{(s_i)}\stackrel{F_i}{\to}G^{(s_{i+1})}\stackrel{\mathrm{pr}_t}{\to}G)\in J_1$ for all $t$.
Proof: Omitted.
If we view elements of $J$ as variables, then each element of $\langle J \rangle$ can be viewed as a function on $J$ and $\langle J \rangle$ can be view as the polynomial ring. Then we say an axiom data $\mathcal{M}$ associated to  a set of morphisms $J=\{f_i:G^{(l_i)}\to G^{(r_i)}\}_{i\in I}$ in $\mathcal{C}$ is a set of pairs of functions on $J$ (i.e. pairs in $\langle J \rangle^2$) with the same target and source.
To distinct variables $J$ from real maps $J$, we uses $\mathcal{J}$ to denote the variables and $J$ to denote the real maps. Given a pair $(\mathcal{J},\mathcal{M})$ where $\mathcal{J}$ is a set of variable morphisms and $\mathcal{M}$ is an axiom data associated to $\mathcal{J}$, we say a pair $(G,J)$ is an object associated to $(\mathcal{J},\mathcal{M})$ if $\forall (E,F)\in \mathcal{M}$, we have $E(J)=F(J)$. A $(\mathcal{J},\mathcal{M})$-map between $(G_1,J_1)$ and $(G_2,J_2)$ is an $S$-morphism between $G_1$ and $G_2$ which is compatitble with morphisms in $J_i$.
e.g: Let $J=\{i:G\to G,m:G\times_S G\to G,e:S\to G\}$ and $\mathcal{M}$ be the required condition for $G$ to be a group scheme over $S$. Then $(G,m,i,e)$ is a group scheme over $S$ if and only if $(G,J)$ satisfies the axiom data $\mathcal{M}$.
Now we can prove our theorem.
Proof:  Clearly the data glues to a scheme $G$ over $S$ via $\pi:G\to S$ with open immersions of $S$-schemes $g_j:G_j\to G$ s.t. $g_k\circ \phi_{jk}=g_j$ for all $(j,k)\in I^2$. Since $G^{(r)}$ can be covered by $G_j^{(r)}$ over $U_j$, we can glue $(m:G\times_S G\to G,i:G\to G,e:S\to G)$ which are compatitble with open immersions $g_j$.
Now let $J=\{m,i,e\}$ and $\mathcal{J}$ be the corresponding variable set, and $\mathcal{M}$ be the group scheme axiom data. Then for each $E(\mathcal{J})\in \langle \mathcal{J} \rangle$, $E(J)$ is the unique morphism glued by $\{E(\{m_j,i_j,e_j\})\}_{j\in J}$ (this can be proved step by step, we may start from $J_1$). So for each pair $(E,F)\in \mathcal{M}$, we have $E(J)=F(J)$ if and only if $E(\{m_j,i_j,e_j\})=F(\{m_j,i_j,e_j\})$ for all $j\in J$. The result follows.
