Why is $O_K\otimes \mathbb{Z}_p\cong \oplus_{\mathfrak{p}|p}O_{K,\mathfrak{p}}$?
In my old number theory notebook this is stated as a fact. However, I ran into problems when I tried to prove it. First let me state the (supposed) theorem accurately:
Theorem (?)
Let $K$ be a number field with ring of integers $O_K$. Let $p$ be a prime of $\mathbb{Z}$. Then $O_K\otimes \mathbb{Z}_p\cong \oplus_{\mathfrak{p}|p}O_{K,\mathfrak{p}}$, where $\mathfrak{p}$ runs over those primes of $O_K$ that lie over $p$, and where $O_{K,\mathfrak{p}}$ is the formal local ring of $O_K$ at $\mathfrak{p}$ (i.e., $\varprojlim O_K/\mathfrak{p}^n$).
Attempt
The way I was thinking of proving this is through the Chinese Remainder Theorem. The following is true for every natural number $n$: $$O_K\otimes \mathbb{Z}/p^n\mathbb{Z}\cong O_K/p^nO_K\cong O_K/\mathfrak{p}_1^{ne_1}\cdots \mathfrak{p}_m^{ne_m}\cong O_K/\mathfrak{p}_1^{ne_1}\oplus...\oplus O_K/\mathfrak{p}_m^{ne_m}.$$ where $pO_K=\mathfrak{p}_1^{e_1}\cdots \mathfrak{p}_m^{e_m}$.
The next natural step is to take inverse limits of both sides with respect to n. As inverse limits commute with direct sums (as both are limits), $\varprojlim O_K/\mathfrak{p}_1^{ne_1}\oplus...\oplus O_K/\mathfrak{p}_m^{ne_m}\cong O_{K,\mathfrak{p}_1}\oplus...\oplus O_{K,\mathfrak{p}_m}$.
This is where the wheels come off the argument: inverse limits don't generally commute with tensor products. This is because inverse limits are categorical limits, whereas tensor products are categorical colimits (indeed they are the coproduct of the category of $\mathbb{Z}$-algebras). So there is no reason, a priori, that $\varprojlim O_K\otimes \mathbb{Z}/p^n\mathbb{Z}$ would be isomorphic to $O_K\otimes \mathbb{Z}_p$.
So this leads me to the
Question
Why is the theorem true? (if it even is.)
Solution 1:
As noticed wxu in the comments, $O_K$ is finite free over $\mathbb Z$. Write $O_K=\oplus_{1\le i\le d} e_i\mathbb Z$. Then we have $$ O_K\otimes_\mathbb Z \mathbb Z/p^n \mathbb Z =\oplus_{1\le i\le d} e_i(\mathbb Z/p^n\mathbb Z).$$ Passing to the inverse limit, we get $$\varprojlim_n O_K\otimes \mathbb Z/p^n \mathbb Z =\oplus_{1\le i\le d} e_i\mathbb Z_p=O_K\otimes_\mathbb Z \mathbb Z_p.$$
Solution 2:
Your problem can be solved under more general conditions. Let $A$ be a Noetherian commutative ring. Let $I$ be an ideal of $A$. Let $M$ be a finitely generated $A$-module. Let $A_I$ = $\varprojlim A/I^n$. Then $M\otimes A_I$ $\cong$ $\varprojlim M\otimes (A/I^n)$. The proof can be found, for example, in Matsumura's "Commutative ring theory", Theorem 8.7 in page 60.