Hartshorne II prop 6.6 I'm having a really hard time understanding the proof of this proposition.  $X$ is a noetherian integral separated scheme that is regular in codimension 1.  We consider $X\times \mathbb{A}^1$ and the projection $\pi$ onto $X$.  
First, Hartshorne says there are two types of codimension 1 points of $X\times \mathbb{A}^1$, type 1 being those which map to a codimension 1 point of $X$ through $\pi$ and type 2 being those which map to the generic point.  I'm not clear on why these are the only types.  I believe that when $Y$ is a subscheme of $X$ that $\pi^{-1}(Y)=Y\times \mathbb{A}^1$ and is a subscheme of $X\times \mathbb{A}^1$.  Is it true that the codimension of $\pi^{-1}(Y)$ is less than or equal to the codimension of $Y$?  Is this what Hartshorne is implicitly using?  I think if this is true we would also get a 1-1 correspondence between type 1 prime divisors of $X\times \mathbb{A}^1$ and prime divisors of $X$.  
Next, if we have that the function field of  $X$ is $K$, then we have the function field of $X\times \mathbb{A}^1$ is $K(t)$.  I guess Hartshorne is saying that if $f\in K$ then $(f)_X=(f)_{X\times \mathbb{A}^1}$ where on the r.h.s we view $f\in K(t)$.  I am confused about why this is true.  I guess I need to understand how to compare the image of $f$ in the local rings at generic points of $X\times \mathbb{A}^1$ with those of $X$.  
 A: Your questions can all be answered by reducing to the case where $X = \operatorname{Spec} R$ is affine.
We have $Y = \operatorname{Spec} R[t]$, with the projection map $\pi$ induced by the inclusion $R\to R[t]$.  First of all, notice that if $K$ is the fraction field of $R$, then $K(t)$ is the fraction field of $R[t]$.  And in general, localizations of $R$ inject into corresponding localizations of $R[t]$.
What are the codimension $1$ points of $Y$, i.e. the height $1$ primes of $R[t]$?  Well, if $P \subset R[t]$ is a height $1$ prime, then either $P\cap R = Q$ is a height $1$ prime of $R$, or $P\cap R = (0)$.
And what are the corresponding localizations in each case?  In the first case, $R_Q \subset R[t]_P = (R_Q)[t]$.  In the second, $K=R_{(0)} \subset R[t]_P = K[t]_{P'}$, where $P'$ is the (maximal) ideal of $K[t]$ generated by $P$.
In other words, we have, in the first case, points that just correspond to the codimension-1 points of $X$ (and are in fact the generic points of the fibers over these points), and, in the second case, basically the closed points of $\mathbb{A}^1_{K(X)}$ (though since $K(X)$ is not algebraically closed, be a little careful of thinking this way, as Hartshorne is always working over algebraically closed fields).
