# Is the closure of a semialgebraic set mod 1 also semialgebraic?

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?

-
Would S = {(x,y) in R^2 | xy=1} be a counterexample? – André Henriques Feb 3 '12 at 10:16
@André Henriques: Why don't you post that as an answer? It certainly answers the question. – Ketil Tveiten Feb 3 '12 at 11:06
@Andre - Thanks. Looks like I should have done more experimentation! Post it as answer and I'll accept. – SJR Feb 3 '12 at 11:42

For $n=2$, the set $S=\{(x,y)\in \mathbb R^2| xy=1\}$ provides a counterexample.
For $n=1$, the statement is true.