Semialgebraic set technical lemma Suppose that $U\subseteq \mathbb{R}^3$ is real-semialgebraic set such that $U'\times \mathbb{R}\subseteq \overline{U}$ where $U'$ is an infinite set. I want to show that there exist $x,y$ such that there are infinitely many $z$ with $(x,y,z)\in U.$
I was trying to answer this question when I asked Semi-algebraic set has nonempty interior relative to Zariski closure, but the answer I was given was incomplete, and now I think what I was trying to prove was stronger than what I really need.
 A: Here's a sketch. First, we demonstrate the claim when $U$ is open (in the Euclidean topology) in $\overline{U}$ and $\overline{U}$ is irreducible. In that case $\overline{U'}\times \mathbb{R}\subseteq \overline{U}.$ Since $U'$ is infinite, the set $\overline{U'}$ has dimension at least $1$. Therefore $\overline{U'}\times \mathbb{R}$ has dimension at least $2$. Then, since $\overline{U}$ is irreducible, we must either have $\overline{U}=U'\times \mathbb{R}$ or $\overline{U}=\mathbb{R}^3.$ Finally, since $U$ is open in the Euclidean topology as a subset of $\overline{U}$, there must exists $x,y$ such that there are infinitely many $z$ with $(x,y,z)\in U.$
Next, show that if the property holds for semialgebraic sets $U$ and $V$, then it must also hold for $U\cup V$. Then, it suffices to show that any semialgebraic set can be decomposed as a union of semialgebraic sets open in their irreducible Zariski closure.
Any semialgebraic set is a finite union of sets of the form $U=\{\mathbf{x}\in \mathbb{R}^3:\forall i \ f_i(\mathbf{x})=0, \forall j \ g_j(\mathbf{x})>0\}.$ Next, write $\overline{U}$ as a union of irreducible components $U_k$, such that no component is contained in the union of the others. Next, decompose $U$ as a union of the sets $U\cap U_k$ and prove that $\overline{U\cap U_k}=U_k.$ Notice that $U\cap U_k$ is open in its irreducible Zariski closure $U_k.$ Since $U$ can be decomposed as a union of these sets, we are done.
