Let $p:\mathbb{R}^n\to[0,1)^n$ be the map defined by $p(x\_1,\ldots,x\_n)=(\{x\_1\},\ldots,\{x\_n\})$, where $\{\cdot\}$ is the fractional part operator. Experimentation suggests that if $S \subseteq \mathbb{R}^n$ is semialgebraic, then the closure of the image set $p(S)$ is semialgebraic. (By a "semialgebraic" subset of $\mathbb{R}^n$ I mean here a finite union of sets, each defined by a system of polynomial inequalities with real coefficients. By "closure" I mean in the usual topology on $\mathbb{R}^n$, restricted to $[0,1)^n$.) 


Is this true? Can anyone provide a proof or a counterexample or a relevant reference?



Is the closure of a semialgebraic set mod 1 also semialgebraic?
For $n=2$, the set $S=\{(x,y)\in \mathbb R^2| xy=1\}$ provides a counterexample.


For $n=1$, the statement is true.


