# Elements of a local field with trace in $\mathbb Z_p$

Let $$K_p$$ be a finite extension of $$\mathbb Q_p$$. Then we have the trace map: $$T:=\operatorname{Tr}_{K_p|\mathbb Q_p}:K_p\to\mathbb Q_p$$ Is there any characterization of the open set $$T^{-1}(\mathbb Z_p)$$?

I only know that if $$\pi$$ is a uniformizing element of $$K_p$$ then there exists a maximum positive integer $$d$$ such that $$\pi^{-d}O_{K_p}\subseteq T^{-1}(\mathbb Z_p)$$.

In other words is there a way to characterize the element of a local field having integral trace?

What you might really be interested in is the elements having integral trace after multiplication by all integers of $$K_p$$. That is related to the local different ideal, just like the description of the global different ideal.
For a number field $$K$$, the set $$S(K) = \{\alpha \in K : {\rm Tr}_{K/\mathbf Q}(\alpha\mathcal O_K) \subset \mathbf Z\}$$ is a fractional ideal in $$K$$ that contains $$\mathcal O_K$$. Since $$1 \in \mathcal O_K$$, all elements of that fractional ideal have integral trace, but to be in that fractional ideal is a stronger condition than merely having integral trace by itself and nothing else. When $$K = \mathbf Q(i)$$, $$S(\mathbf Q(i)) = \{\alpha \in K : {\rm Tr}_{K/\mathbf Q}(\alpha\mathcal O_K) \subset \mathbf Z\} = \frac{1}{2}\mathbf Z[i]$$ while $$\{\alpha \in K : {\rm Tr}_{K/\mathbf Q}(\alpha) \in \mathbf Z\} = \frac{1}{2}\mathbf Z + \mathbf Q{i}.$$ The first set is a fractional ideal while the second set is some ugly thing with no worthwhile properties (well, it's an abelian group, but certainly not a $$\mathbf Z[i]$$-module: it contains $$i/3$$ but not $$i(i/3) = -1/3$$).
Since $$S(K)$$ is a fractional ideal containing $$\mathcal O_K$$, the inverse $$S(K)^{-1}$$ is a nonzero ideal contained in $$\mathcal O_K$$: it is an integral ideal. This is called the different ideal $$\mathfrak D_{K/\mathbf Q}$$ and it is closed related to ramification: its prime ideal factors are precisely the prime ideals in $$K$$ that ramify over $$\mathbf Q$$ (the multiplicity of the prime ideal factors can be tricky).
The local story is analogous: the set $$\{\alpha \in K_p : {\rm Tr}_{K_p/\mathbf Q_p}(\alpha\mathcal O_{K_p}) \subset \mathbf Z_p\}$$ is a nonzero finitely generated $${\mathcal O}_{K_p}$$-module in $$K_p$$ that contains $$\mathcal O_{K_p}$$, so its inverse is a nonzero ideal in $$\mathcal O_{K_p}$$ that is called the local different ideal. It is $$\mathcal O_{K_p}$$ if and only if $$K_p$$ is unramified. When $$K_p/\mathbf Q_p$$ is ramified and $$\pi$$ is a uniformizer in $$K_p$$, the local different is $$\pi^d\mathcal O_{K_p}$$ where $$d \geq 1$$. On the other hand, the set $$T^{-1}(\mathbf Z_p) = \{\alpha \in K_p : {\rm Tr}_{K_p/\mathbf Q_p}(\alpha) \in \mathbf Z_p\}$$ is some ugly thing with no worthwhile features. For example, when $$K_2 = \mathbf Q_2(i)$$, $$T^{-1}(\mathbf Z_2) = \{\alpha \in K_2 : {\rm Tr}_{K_2/\mathbf Q_2}(\alpha) \in \mathbf Z_2\} = \frac{1}{2}\mathbf Z_2 + \mathbf Q_2i.$$ and when $$K_3 = \mathbf Q_3(i)$$, $$T^{-1}(\mathbf Z_3) = \{\alpha \in K_3 : {\rm Tr}_{K_3/\mathbf Q_3}(\alpha) \in \mathbf Z_2\} = \frac{1}{2}\mathbf Z_3 + \mathbf Q_3i = \mathbf Z_3 + \mathbf Q_3i.$$
I suspect you really want to work with the local different ideal (or its inverse), not $$T^{-1}(\mathbf Z_p)$$.