It is well known that the profinite completion of the integers, $\hat{\mathbb{Z}} = \varprojlim \mathbb{Z}/n\mathbb{Z}$ is, by the Chinese remainder theorem, isomorphic to $\prod_p \mathbb{Z}_p$.
I have two questions about this. 1) Is this ring isomorphism also topological? and 2) does it generalize to the ring of integers in a global field? Id est, if $\mathcal{O} \subset k$ is the ring of integers in a number field or global function field over a finite field, do we know that $\hat{\mathcal{O}}\cong \prod_\mathfrak{p} \mathcal{O}_\mathfrak{p}$, where $\mathfrak{p}$ varies over all (finite?) primes and $\mathcal{O}_\mathfrak{p}$ is the local completion with respect to $\mathfrak{p}$ ?
Since $\hat{\mathcal{O}} = \varprojlim \mathcal{O}/\mathfrak{n}$ and since we have a unique factorisation of ideals into prime ideals, I feel like the CRT would give us this same result. Is my intuition correct?
Certainly more discussion of various details could be warranted, depending on taste/interest, but the basic topological point is that those finite quotients $\mathfrak O/\mathfrak n$ have a unique locally compact Hausdorff topology, namely, the discrete topology. Projective limits of topological rings (with identities $1$ mapping to each other, for example) exist in a category of locally compact Hausdorff topological rings: the closed subset of the product defined by the transition maps in the limit.
Products and (projective) limits are both instances of "limit" in a somewhat larger sense, and "commute", so Sun-Ze's theorem (a.k.a. "Chinese Remainder Theorem") gives the indicated factorization.