What is the meaning of a finite $\pi$-adic expansion in a local number field? Every $p$-adic integer $x \in \mathbb{Z}_p$ can be written uniquely as an "infinite polynomial" in powers of $p$:
$$x = a_0 + a_1 p + a_2 p^2 + a_3 p^3 + \dots $$
where $a_i \in \{0, 1, \dots, p-1\}$. We know that if $x \in \mathbb{Z}_p$ has a finite polynomial expansion then $x \in \mathbb{Z}$, where here we think of $\mathbb{Z}$ as being a subset of $\mathbb{Z}_p$.
My question is: does this last sentence hold for number fields? That is, let $K$ be a number field, $\mathcal{O}_K$ its ring of integers. Let
$\mathfrak{p}$ be a prime ideal in $\mathcal{O}_K$. Let $\mathcal{O}_{K, \mathfrak{p}}$ be the completion of $\mathcal{O}_K$ at the prime $\mathfrak{p}$.
If we pick a uniformizer $\pi \in \mathcal{O}_{K, \mathfrak{p}}$, then we can uniquely express every element $x \in \mathcal{O}_{K, \mathfrak{p}}$ as an "infinite polynomial" in powers of $\pi$:
$$x = a_0 + a_1 \pi + a_2 \pi^2 + a_3 \pi^3 + \dots  $$
where the digits $a_i$ belong to some fixed set of coset representatives of the residue field $\mathcal{O}_{K, \mathfrak{p}} / (\pi)$.
Now comes the question in more detail: is it true that if an element $x \in \mathcal{O}_{K, \mathfrak{p}}$ has a finite polynomial expansion then $x \in \mathcal{O}_K$? Again, here we identify $\mathcal{O}_K$ with a subset of its completion $\mathcal{O}_{K, \mathfrak{p}}$ at the prime $\mathfrak{p}$. This is true in the case $\mathcal{O}_K = \mathbb{Z}$ and $\mathcal{O}_{K, \mathfrak{p}} = \mathbb{Z}_p$ because if an element $x \in \mathbb{Z}_p$ has a finite polynomial expansion then $x \in \mathbb{Z}$. Is it true in general?
EDIT: This depends heavily on the choice of coset representatives for the polynomial expansion. For simplicity, suppose that the residue field of $\mathcal{O}_{K, {\mathfrak{p}}}$ is $\mathbb{F}_p$; i.e: suppose that the extension $K_{\mathfrak{p}} / \mathbb{Q}_p$ is totally ramified. Then we can pick the digits $\{0,1, \dots, p-1\}$ as a set of "digits" for the polynomial expansion. Is the theorem true then?
In terms of what I've tried: I've tried showing that we can pick the uniformizer $\pi$ to belong to $\mathcal{O}_K$, and we can pick the digits of the polynomial expansion to be elements of $\mathcal{O}_K$ as well. If this is true, (which I'm not very sure about!) then it follows that any finite polynomial in $\pi$ belongs to $\mathcal{O}_K$. Any suggestions / references would be welcome. Thanks!
 A: As you suspect, one can always choose a uniformiser $\pi \in \mathcal{O}_{K, \mathfrak p}$ to come from $\mathcal{O}_K$ (actually, any element $\in \mathfrak p \setminus \mathfrak p ^2$ will do), and one also can always choose a full set of representatives of the residue field $\mathcal{O}_{K, \mathfrak p}/(\pi)$ within $\mathcal{O}_K$ (this standard fact is usually formulated and proven as saying that the natural map $\mathcal{O}_{K}/\mathfrak p \rightarrow \mathcal{O}_{K, \mathfrak p}/(\pi)$ is bijective).
Now of course if these two conditions are simultaneously satisfied, all elements $\sum_{i=0}^n a_i \pi^i$ with the $a_i \in \mathcal{O}_{K}$ are in $\mathcal{O}_{K}$.
However, if either of the conditions is not satisfied, I think there is not much sensible to say in generality, by the way already in the case of $\mathbb Z_p$.
Example 1: Let $u \in \mathbb Z_p \setminus \mathbb Z$ with $u \in 1+p\mathbb Z_p$ (there are many such elements), and take that one as a representative of $1 \in \mathbb F_p$, the other representatives being $\{0,2,..., p-1\}$ as before, and keep $p$ as uniformiser. Then all finite sums with all "coefficients" $\neq u$ are in $\mathbb Z$, whereas all the ones with a $u$ occuring are not.
Example 2: Again keep $p$ as uniformiser, let $u$ be as above, and as representative of $1$ take $r_1:=1+up^2$, as representative of $2$ take $r_1:=2-up$, all others stay in $\{0, 3, ..., p-1\}$. Now $r_1, r_2 \notin \mathbb Z$, e.g. $2+r_1 p$ or $2p^3 + r_2p^7$ also $\notin \mathbb Z$, but $r_1+r_2 p \in \mathbb Z$, and so is (say $p \ge 11$) $7 + 10p^3 +r_1p^9 +r_2p^{10}+8p^{17}$ but not $7 + 10p^3 +r_1p^9 +r_2p^{10}+r_1p^{17}$.
Example 3: Via Hensel's Lemma there is an element $\pi \in p \mathbb Z_p$ such that $\pi^2+\pi =p$. It is not in $\mathbb Z$. Take that as uniformiser, while keeping the usual representatives $\{0,1, ..., p-1\}$. Then all "degree 0" expressions are in $\mathbb Z$; all "degree 1" expressions are not; but $\pi +\pi^2 \in \mathbb Z$ (and so is ($p \ge 3$) e.g. $1 + \pi^2+2\pi^3+\pi^4$) whereas e.g. $\pi^2$ or $1+\pi^2$ are not.
I imagine if one "mixes" the ideas of examples 2 and 3 one can create more chaos.
