twisting sheaf on projective space Let $\mathbb{K}$ be an algebraically closed field, $S=\mathbb{K}[T_0, \dots, T_r]$ and $X=\mathrm{Proj}(S)=\mathbb{P}^r_{\mathbb{K}}$. On page 117, Hartshorne defines the twisting sheaf of Serre to be $\mathcal{O}_X(1)=S(1)^{\sim}$ which is the sheaf associated to $S(1)$ on $X$.
On page 120, he further defines the twisting sheaf for any scheme $Y$. According to this definition, we have $\mathcal{O}_X(1)=g^*(\mathcal{O}(1))$, where $g\colon X=\mathbb{P}^r_{\mathbb{Z}} \times_{\mathrm{Spec}(\mathbb{Z})}  \mathbb{P}^r_{\mathbb{K}} \; \rightarrow \;\mathbb{P}^r_{\mathbb{Z}}$ is the natural map.
I'm totally confused by these definitions. Probably this is a stupid question, but do they coincide? And if yes, why?
Thanks a lot in advance!
 A: First you need a proposition
Proposition 5.12 (c) Let  $S$ be a graded ring and let $X = \text{Proj } S$. Assume that $S$ is generated by $S_1$ as an $S_0$ algebra. Let $T$ another graded ring, generated by $T_1$ as a $T_0$ algebra, let $\phi: S\to T$ a morphism preserving degrees, and let $U\subset Y = \text{Proj } T$ and $f: U\to X$ be the morphism determined by $\phi$. Then $f^*(\mathcal{O}_X(n)\cong \mathcal{O}_Y(n)|_U$
Remember that the induced morphism $f$ is $f(\mathfrak{p}) = \phi^{-1}(\mathfrak{p})$ this is well defined because $\phi$ is a graded morphism. Now let me cite a lemma wich you surely have been using but maybe didn't notice
Lemma. $\text{Proj} \, A[x_0,...,x_n] = \text{Proj} \, \mathbb{Z}[x_0,...,x_n] \times_{\text{Spec }\mathbb{Z}} \text{Spec} \, A$
What you need to show is the following
Claim. If $Z=\text{Spec } A$ then the twisting sheaf $\mathcal{O}(1)$ on $\mathbb{P}^r_Z$ is the same as the $\mathcal{O}(1)$ defined on $\mathbb{P}^r_A$
Proof. We are going to show that satisfies the hypothesis of the previous proposition, so let $S=\mathbb{Z}[x_0,\dots,x_r]$ and let $T=A[y_0,\dots,y_r]$ both with the natural graduation. Consider the canonical morphism $\phi: S\to T$ and let $Y=\text{Proj } T$, in this case use $U=Y$. Now $X= \mathbb{P}_\mathbb{Z}^r$ and by the lemma 
$$\mathbb{P}^r_Z = \mathbb{P}^r_\mathbb{Z}\times_{\text{Spec }\mathbb{Z}} \text{Spec } A = \text{Proj} \, \mathbb{Z}[x_0,...,x_r] \times_{\text{Spec }\mathbb{Z}} \text{Spec} \, A = \text{Proj } A[x_0,\dots,x_r] = \text{Proj } T = Y$$
Observe that by definition the induced map $f: Y \to X$ is the same as the natural map $g$ used in your second definition, so by the proposition $\mathcal{O}(1) = g^*(\mathcal{O}_X(1)) = f^*(\mathcal{O}_X(1)) = \mathcal{O}_Y(1)$
