TITLE: Reduction modulo $p$ in number fields
QUESTION [5 upvotes]: For every prime number $p$, there exist a map
  $$f:\mathbb{P}^n(\mathbb{Q})\to\mathbb{P}^n(\mathbb{F}_p)$$ defined
  by: for $P\in \mathbb{P}^n(\mathbb{Q})$, we can find a unique tuple
  $(x_1,\dots,x_n)\in\mathbb{Z}^n$ of coprime integers such that
  $P=[x_1,\dots,x_n]$. Then
  $f(P):=[\overline{x_1},\dots,\overline{x_n}]\in \mathbb{P}^n(\mathbb{F}_p)$.

Now, replace $\mathbb{Q}$ by a number field $K$ and $p$ by a prime ideal $\mathfrak{p}$ of $\mathcal{O}_K$. A paper I read speaks of a map
$$f:\mathbb{P}^n(K)\to\mathbb{P}^n(\mathcal{O}/\mathfrak{p}).$$
But how is this defined ? For $P\in\mathbb{P}^n(K)$, we can find $(x_1,\dots,x_n)\in\mathcal{O}_K^n$ such that $P=[x_1,\dots,x_n]$, however, if $\mathcal{O}_K$ is not a UFD, we cannot necessarily choose them such that $x_i\not\in\mathfrak{p}$ for some $i$ as in the rational case...

REPLY [4 votes]: We cannot necessarily choose them such that $x_i \notin \mathfrak{p}$ for some $i$ as in the rational case...

Right, but we don't need to.  In order for the reduction map to be defined we don't need $x_i \in \mathcal{O}_K$ for all $i$; we need $v_{\mathfrak{p}}(x_i) \geq 0$ for all $i$ and $v_{\mathfrak{p}}(x_i) = 0$ for at least one $i$.  In other words, we can define the reduction map by replacing $R$ with its localization $R_{\mathfrak{p}}$, which has the same fraction field $K$, and is a DVR hence a UFD.  
Note that this works for a nonzero prime ideal $\mathfrak{p}$ in any Dedekind domain $R$ with fraction field $K$.