I asked this question and I couldn't understand the following result. https://math.stackexchange.com/questions/3956704/hartshorne-Ⅱ-prop-6-6-irreducible
Let $X$ be a noetherian integral separated scheme which is regular in codimension one, $\pi$ is a projection $X \times_{\operatorname{Spec}\mathbb{Z}} \operatorname{Spec}\mathbb{Z}[t] \rightarrow X$,and $Y$ be a prime divisor of $X$. Then, according to the person who answered that question, $\pi^{-1}(Y)=Y\times_{\operatorname{Spec}\mathbb{Z}}\operatorname{Spec}\mathbb{Z}[t]$ . But I can't prove this and I also think this can be true in more general case, that is,
$X$,$Y$ be schemes over scheme $S$, $\pi$:$X\times_{S} Y \rightarrow X$ be a projection, $Z\subset X$ be a closed subset. Then $\pi^{-1}(Z)=Z\times Y$.
If this is true, I want to know how to prove it, and if this needs some modifications, I want to know it and its proof. This may be a elementary question, so only a good reference will be a great help.
If $C:=Spec(\mathbb{Z}[t])$ and $\pi: X\times_{\mathbb{Z}} C\rightarrow X$ is the canonical projection map and $Y\subseteq X$ is any subscheme it follows
F1. $\pi^{-1}(Y):=Y\times_X X\times_{\mathbb{Z}} C\cong Y\times_{\mathbb{Z}} C$.
The $X$-terms "cancel each other out". You will find this in Hartshorne, Chapter II.3.
Answer: Yes, F1 is the definition of the inverse image of $Y$. It follows
$top(\pi^{-1}(Y)):= top(Y\times_{\mathbb{Z}} C)$