Let $B$ be a noetherian integral domain and consider the polynomial ring $B[t]$. Let $\mathfrak{p}$ be a prime ideal in $B[t]$ of height $1$ such that $\mathfrak{p} \cap B = (0)$. Show that $B[t]_{\mathfrak{p}}$ is just $K[t]_{\mathfrak{m}}$ where $K$ is the field of fractions of $B$ and $\mathfrak{m}$ is some maximal ideal of $K[t]$.
Note this isn't a homework problem, it's actually a step in a proof in Hartshorne that I got stuck on, showing that the preimage of the generic point under the fibered product is a regular codimension $1$ point. For reference it's Proposition II.6.6.
It seems like this should be straight forward, but I'm having trouble making it rigourous. We have $B[t]_{\mathfrak{p}}$, and since $\mathfrak{p}$ doesn't contain any non-zero element in $B$, then $B[t]_{\mathfrak{p}}$ must at least contain $K[t]$. If $B$ was a UFD then it would be easy, since we could say that $\mathfrak{p}$ is principal. But say $\mathfrak{p}$ is generated by $\{ f_{1}, f_{2}, \ldots , f_{r} \}$. I can "see" intuitively that the result should be $K[t]_{\langle f_{1}, \ldots, f_{r}\rangle}$, and of course $\langle f_{1}, \ldots, f_{r} \rangle$ would be principal in $K[t]$. But I can't seem to be able to make this rigorous, which is worrying to me because I feel like this should be extremely straight forward. Any advice?
Let me give it a try: let $\mathfrak{m}$ be a maximal ideal of $K[t]$ containing $\mathfrak{p}$ ($\mathfrak{p}K[t]$ contains non nonzero constant element because $\mathfrak{p}$ doesn't, so it's a strict ideal: such an $\mathfrak{m}$ exists).
The idea of my proof is to show that $K[t]_\mathfrak{m}$ has the universal property of $B[t]_\mathfrak{p}$, which will allow us to prove the isomorphism between the two (and it's easy to check that it's "the right isomorphism")
Consider a morphism $f: B[t]\to C$, $C$ a ring such that for $x\notin \mathfrak{p}$, $f(x) \in C^\times$.
Compose with the inclusion $i: B\to B[t]$ this yields a morphism $f\circ i: B\to C$, and your hypothesis concerning $\mathfrak{p}\cap B$ + the hypothesis concerning $f$ yields that this extends to $g: K\to C$.
By the universal property of $K[t]$, sending $K$ to $C$ with $g$ and $t$ to $f(t)$ yields a morphism $s: K[t] \to C$, which corresponds to the following commutative diagram :
$\require{AMScd} \begin{CD} B @>>> K;\\ @VV^iV @VVV \\ B[t] @>>> K[t];\\ @VV^fV @VV^sV \\ C@>>^{id_C}>C \end{CD}$
Now let $A \in K[t], A\notin \mathfrak{m}$. For some $q\in B$, $qA\in B[t]$. $s(qA) = f(qA)$. Now if $qA \in \mathfrak{p}$ then $qA \in \mathfrak{m}$ hence (by maximality) $q\in \mathfrak{m}$ or $A\in \mathfrak{m}$. The second option is impossible by hypothesis, but so is the first since $q\in K^\times$. Hence $qA\notin \mathfrak{p}$ and so $f(qA)\in C^\times$. Hence $s(q)s(A)\in C^\times$, and so $s(A) \in C^\times$.
By the universal property of the localization at $\mathfrak{m}$, we get a morphism $e:K[t]_{\mathfrak{m}}\to C$ making the whole thing commute:
$\require{AMScd} \begin{CD} B @>>> K;\\ @VV^iV @VVV \\ B[t] @>>> K[t] @>>> K[t]_{\mathfrak{m}};\\ @VV^fV @VV^sV @VV^eV \\ C@>>^{id_C}>C @>>^{id_C}> C \end{CD}$
So apart from uniqueness which is left to prove, $K[t]_{\mathfrak{m}}$ satisfies the universal property of $B[t]_{\mathfrak{p}}$, so it is isomorphic to it.
Let's now prove the uniqueness part: assume the morphism $l: K[t]_{\mathfrak{m}}$ makes the traingle commute:
$\require{AMScd} \begin{CD} B[t] @>>> K[t]_{\mathfrak{m}};\\ @VV^fV @VV^lV \\ C@>>^{id_C}>C \end{CD}$
Then the induced map $K\to C$ is necessarily obtained by the universal property of $K$ with respect to $B$, because of the uniqueness there, similarly for the map $K[t]\to C$, and so the map $l:K[t]_\mathfrak{m}\to C$ is the one that is induced by the universal property with respect to $K[t]$ , that is $l=e$.
So uniqueness follows, and we have our proof.
(If anyone knows how to make diagonal arrows instead of putting $id_C$'s everywhere, please feel free to edit)