Let $R$ be a Dedekind domain. Let $A$ and $B$ be two finitely generated domains over $R$. Assume that for every maximal ideal $\mathfrak{p}\subset R$ the $R_{\mathfrak{p}}$algebras $A_{\mathfrak{p}}$ and $B_{\mathfrak{p}}$ are isomorphic. Are $A$ and $B$ isomorphic?

$\begingroup$ Does subscript $\mathfrak{p}$ stand for localization or completion on the adic topology? $\endgroup$ – kneidell Apr 20 at 21:15

$\begingroup$ @kneidell localization. $\endgroup$ – danand Apr 20 at 21:21
Counterexample. Let $R$ be a Dedekind domain with $\operatorname{Cl}(R) \neq 0$. Let $I \subseteq R$ be an ideal that is not principal (in algebraic geometry language, let $\mathscr L$ be a nontrivial line bundle), and let $J = R$ be the trivial ideal (let $\mathcal O$ be the trivial line bundle). Then $I_{\mathfrak p} \cong R_\mathfrak p \cong J_\mathfrak p$ for every $\mathfrak p$.
Then $A = \operatorname{Sym}^*(I^\vee)$ and $B = R[t] = \operatorname{Sym}^*(J^\vee)$ are not isomorphic. Geometrically, this is saying that the geometric vector bundles $\mathbf V(\mathscr L) = \operatorname{Spec}(\operatorname{Sym}^* \mathscr L^\vee)$ and $\mathbf V(\mathcal O) = \mathbf A^1_R$ are not isomorphic as $R$schemes. For example, $\mathbf V(\mathcal O)$ has a pair of disjoint sections $0, 1 \colon \operatorname{Spec} R \rightrightarrows \mathbf V(\mathcal O)$, but a nontrivial line bundle $\mathscr L$ does not have two disjoint sections (the difference gives a nowhere vanishing section, which is an isomorphism $\mathcal O \stackrel\sim\to \mathscr L$). But they are locally isomorphic at every prime since every vector bundle over a local ring is trivial.
(In principle you could unwind this argument algebraically if you want: $B$ has a surjection to $R \times R$ by $f(t) \mapsto (f(0),f(1))$, but $A$ does not admit such a surjection. Basic geometric operations like 'take the difference of two sections' and 'a nowhere vanishing section is an isomorphism $\mathcal O \stackrel\sim\to \mathscr L$' become Hopf algebra stuff, so you have to do some work.)
Remark. If you want an example over a PID, just take any PID $R$ that has a finite extension $R \subseteq R'$ of Dedekind domains such that $\operatorname{Cl}(R') \neq 0$ (such an extension exists in many cases, e.g. if $R = \mathbf Z$ or $R = k[t]$ for any field $k$). Take $I, J \subseteq R'$ and $R' \to A$ and $R' \to B$ as above. They are still isomorphic around any $\mathfrak p \subseteq R$, because a line bundle on $\operatorname{Spec} R'$ is trivialised on the finite set of primes above $\mathfrak p$.
Given an isomorphism $\phi \colon A \stackrel\sim\to B$ of $R$algebras, the integral closure $R'$ of $R$ in $A$ and $B$ is preserved by $\phi$, hence up to composing with an $R$automorphism of $R'$ we may assume $\phi$ is an $R'$algebra isomorphism, which is impossible by the argument above.

$\begingroup$ are there counterexamples if the class group is trivial? $\endgroup$ – danand Apr 20 at 21:23

$\begingroup$ One thing you can do in many cases is take an extension $R \subseteq R'$ of Dedekind domains with $\operatorname{Cl}(R') \neq 0$ and proceed as in my answer. Then you have to convince yourself that an isomorphism of $R$algebras can be upgraded to an isomorphism of $R'$algebras, which should be fine for example if $R = k[t]$ and $R'$ is an affine part of an elliptic curve (use that maps $\mathbf A^1 \to E$ are constant). $\endgroup$ – R. van Dobben de Bruyn Apr 21 at 0:59

$\begingroup$ There might be some subtlety in the "for example because..." part: The left hand sides "should be" just sets, not $R$modules, so to show that they are not "equal", i.e. bijective, one should not invoke the module structure. On the geometric side, I believe that the same can be formulated as: we would like to show that $\mathbf{V}(\mathscr{L})$ and $\mathbf{V}(\mathcal{O})$ are not isomorphic as actual $R$schemes, while the argument shows that they are not isomorphic as (geometric) line bundles. $\endgroup$ – Pavel Čoupek Apr 21 at 4:56

1$\begingroup$ @PavelČoupek: ok, you're right. The trivial line bundle has two disjoint sections $B \rightrightarrows R$, but no nontrivial line bundle does. $\endgroup$ – R. van Dobben de Bruyn Apr 21 at 5:10