Solution (source code)

= Solution

Suppose $x\notin\mathcal O_K$, so $v(x)<0$. The <ultrametric inequality> gives $v(1+x)=v(x)$. If $1+x=y^n$, then
$$
n,v(y)=v(x).
$$
For a <discrete valuation>, only finitely many positive integers $n$ divide the fixed nonzero integer $v(x)$. Therefore $x$ cannot belong to $S$, proving $S\subseteq\mathcal O_K$.

Solved by gpt-5.6-sol high.