1 Introduction

If A and B are two closed subanalytic subsets of \({\mathbb R}^n\), the Hausdorff distance between their intersections with the sphere of radius r centered at a common point P can be used to “measure” how near the two sets are at P. We say that A and B are s-equivalent (at P) if the previous distance tends to 0 more rapidly than \(r^s\) (if so, we write \(A \sim _sB\)).

In the papers [3, 4] and [5], we addressed the question of the existence of an algebraic representative Y in the class of s-equivalence of a given subanalytic set A at a fixed point P. In this case, we also say that Y s-approximates A.

The answer to the previous question is in general negative for subanalytic sets (see [4]).

On the other hand, in [3], it was proved that, for any real number \(s\ge 1\) and for any closed semialgebraic set \(A \subset {\mathbb R}^n\) of codimension \(\ge \)1, there exists an algebraic subset Y of \({\mathbb R}^n\) such that \(A \sim _sY\). The proof of the latter result consists in finding equations for Y starting from the polynomials appearing in a presentation of A. For instance, if \(A=\{x\in {\mathbb R}^n\ |\ f(x)=0, h(x)\ge 0\}\) with \(f,h\in {\mathbb R}[x]\), then A can be s-approximated by the algebraic set \(Y=\{x\in {\mathbb R}^n\ |\ (f^2- h^m)(x)= 0\}\) for any sufficiently large odd integer m. This procedure does not guarantee that Y has the same dimension as A at P as the following trivial example shows.

Let A be the positive \(x_3\)-axis in \({\mathbb R}^3\) presented as \(A=\{(x_1,x_2,x_3)\in {\mathbb R}^3\ |\ x_1^2+x_2^2=0, x_3\ge 0\}\). Then, according to the previous procedure, for any sufficiently large odd integer m, A is s-approximated at the origin O by the algebraic set \(Y=\{(x_1,x_2,x_3)\in {\mathbb R}^3\ |\ (x_1^2+x_2^2)^2 - x_3^m= 0\}\), whose germ at O has dimension 2. However, we can also s-approximate A at O by the one-dimensional algebraic set \(W=\{(x_1,x_2,x_3)\in {\mathbb R}^3\ |\ x_1^2- x_3^m= 0,x_2=0 \}\) for any sufficiently large odd integer m. This algebraic set can be obtained by a similar construction as before, but starting from the different presentation \(A =\{(x_1,x_2,x_3)\in {\mathbb R}^3\ |\ x_1=0, x_2=0, x_3\ge 0\}\).

In [5], we proved that, for any \(s \ge 1\), any closed semianalytic subset \(A\subseteq {\mathbb R}^n\) is s-equivalent to a semialgebraic set \(Y \subset {\mathbb R}^n\) having the same local dimension as A. However, the arguments used in the proof of this latter result do not guarantee that, even if A is analytic, it can be approximated by means of an algebraic one of the same dimension.

In this paper, we prove in Theorem 4.1 that any semialgebraic set of codimension \(\ge \)1 is s-equivalent to an algebraic one of the same dimension. Using the mentioned result of [5], we obtain (Corollary 4.3) that any semianalytic set of codimension \(\ge \)1 can be s-approximated by an algebraic one preserving the local dimension. The proof of Theorem 4.1 works provided that the semialgebraic set is described by means of a suitable presentation, as in the previous example. Therefore, Sect. 3 is devoted to introduce the notion of “regular presentation” and to prove that one can reduce to work with regularly presented sets.

We wish to thank the referee for his useful comments and suggestions.

2 Basic properties of s-equivalence

In this section, we recall the definition and some basic properties of s-equivalence of subanalytic sets at a common point which, without loss of generality, we can assume to be the origin O of \({\mathbb R}^n\). We refer the reader to [4] for the proofs of the results that we only mention.

If A, B are non-empty compact subsets of \({\mathbb R}^n\), let \(\delta (A,B) = \sup _{x\in B} d(x,A) \). Thus, denoting by D(AB) the classical Hausdorff distance between the two sets, we have that \(D(A,B)= \max \{\delta (A,B),\ \delta (B,A)\}\).

Definition 2.1

Let A and B be closed subanalytic subsets of \({\mathbb R}^n\) with \(O\in A\cap B\). Let s be a real number \({\ge } 1\). Denote by \(S_r\) the sphere of radius r centered at the origin.

  1. (a)

    We say that \(A\le _s B\) if one of the following conditions holds:

    1. (i)

      O is isolated in A,

    2. (ii)

      O is non-isolated both in A and in B and

      $$\begin{aligned} \lim _{r\rightarrow 0}\frac{\delta (B \cap S_r,A\cap S_r)}{r^s} =0. \end{aligned}$$
  2. (b)

    We say that A and B are s-equivalent (and we will write \(A \sim _sB\)) if \(A\le _s B\) and \(B\le _s A\).

It is easy to check that \(\le _s\) is transitive and that \(\sim _s\) is an equivalence relation.

Let B(OR) denote the open ball centered at O of radius R. Observe that if there exists \(R>0\) such that \(A\cap B(O,R) \subseteq B\), then \(A \le _sB\) for any \(s\ge 1\).

The following result shows the behavior of s-equivalence with respect to the union of sets:

Proposition 2.2

Let A, \(A'\), B and \(B'\) be closed subanalytic subsets of \({\mathbb R}^n\).

  1. 1.

    If \(A \le _s B\) and \(A' \le _s B'\), then \(A\cup A' \le _s B\cup B'\).

  2. 2.

    If \(A \sim _s B\) and \(A' \sim _s B'\), then \(A\cup A' \sim _s B\cup B'\).

A useful tool to test the s-equivalence of two subanalytic sets is introduced in the following definition:

Definition 2.3

Let A be a closed subanalytic subset of \({\mathbb R}^n\), \(O\in A\). For any real \( \sigma >1\), we will call horn-neighborhood with center A and exponent \( \sigma \) the set

$$\begin{aligned} \mathcal H(A,\sigma )= \{ x\in {\mathbb R}^n \ |\ d(x,A)< \Vert x\Vert ^\sigma \}. \end{aligned}$$

Remark 2.4

If A is a closed semialgebraic subset of \({\mathbb R}^n\) and \(\sigma \) is a rational number, then \(\mathcal H(A,\sigma )\) is semialgebraic. Moreover, if O is isolated in A, then \(\mathcal H(A,\sigma )\) is empty near O.

Proposition 2.5

Let AB be closed subanalytic subsets of \({\mathbb R}^n\) with \(O\in A\cap B\) and let \(s \ge 1\). Then, \(A\le _s B\) if and only if there exist real constants \(R>0\) and \(\sigma >s\) such that

$$\begin{aligned}(A \setminus \{O\}) \cap B(O,R)\subseteq \mathcal H(B,\sigma ).\end{aligned}$$

An essential tool will be the following version of Łojasiewicz’ inequality, proved in [5]; henceforth, for any map \(f :{\mathbb R}^n \rightarrow {\mathbb R}^p\), we will denote by V(f) the zero-set \(f^{-1}(O)\).

Proposition 2.6

Let A be a compact subanalytic subset of \({\mathbb R}^n\). Assume f and g are subanalytic functions defined on A such that f is continuous, \(V(f) \subseteq V(g)\), g is continuous at the points of V(g) and such that \(\sup |g|<1\). Then, there exists a positive constant \(\alpha \) such that \(|g|^\alpha \le |f|\) on A and \(|g|^\alpha < |f|\) on \(A\setminus V(f)\).

The following consequences of Proposition 2.6 will be very useful for us:

Proposition 2.7

Let AB be closed subanalytic subsets of \({\mathbb R}^n\) with \(A\cap B\subseteq \{O\}\). Then, there exist positive constants R and \(\beta _0\) such that, for any \(\beta \ge \beta _0\), we have

$$\begin{aligned}\mathcal H(A,\beta ) \cap B \cap B(O,R) =\emptyset .\end{aligned}$$

Proof

Let \(\phi :B \rightarrow {\mathbb R}\) be the function defined by \(\phi (x) = d(x, A)\) for every \(x\in B\). The function \(\phi \) is subanalytic, continuous and \(V(\phi )= A \cap B \subseteq \{O\}\). Hence, by Proposition 2.6, there exist positive constants R and \(\beta _0\) such that \(d(x, A) > \Vert x\Vert ^{\beta _0} \) for all \( x\in B \cap B(O,R) \setminus \{O\}\). So, for any \(\beta \ge \beta _0\), no x can lie in \(\mathcal H(A, \beta ) \cap B \cap B(O,R)\).\(\square \)

Proposition 2.8

Assume that A and B are closed subanalytic subsets of \({\mathbb R}^n\) with \(B\subseteq A\) and \(O\in B\). If there exists \(s_0\ge 1\) such that \(A\le _s B\) for every \(s\ge s_0\), then there exists \(R>0\) such that \(A\cap B(O,R) = B \cap B(O,R)\).

Proof

Assume by contradiction that \(A\cap B(O,R) \not \subseteq B \cap B(O,R)\) for every \(R>0\). In particular, this implies that \(O\in \overline{A \setminus B}\) and so, by the curve selection lemma, there exists an analytic curve \(\gamma :(-1,1) \rightarrow {\mathbb R}^n\) such that \(\gamma (0)=O\) and \(\gamma (t)\in A \setminus B\) for \(t\in (0,1)\). We can assume that the arc \(\gamma \) intersects each sphere centered at O of sufficiently small radius, i.e., there exists \(r_0<1\) such that for any \(0<r\le r_0\) there exists \(x_r\in Im (\gamma ) \cap S_r \subseteq (A \setminus B) \cap S_r\). Since \(d(x_r, B \cap S_r)>0\), the subanalytic function \(\varphi :[0,r_0] \rightarrow {\mathbb R}\), defined by \(\varphi ( r)= \sup _{x\in A\cap S_r} d(x, B \cap S_r)= \delta (B \cap S_r,A \cap S_r)\) if \(r>0\) and \(\varphi ( 0)=0\), vanishes only at 0. Hence, by Proposition 2.6, there exists a real \(\mu \ge 1\) (and we can assume \(\mu \ge s_0\)) such that \(\varphi ( r) > r^\mu \) for all \(r\in (0,r_0]\), that is \(\frac{\delta (B \cap S_r,A \cap S_r)}{r^\mu }>1\) for all \(r\in (0,r_0]\). Then, \(A\not \le _{\mu } B\), which is a contradiction.\(\square \)

The following technical result shows that it is possible to modify a subanalytic set by means of a suitable horn-neighborhood producing a new subanalytic set s-equivalent to the original one:

Lemma 2.9

Let \(X\subseteq A \subseteq {\mathbb R}^n\) be closed subanalytic sets such that \(O\in X\) and let \(s\ge 1\). Then:

  1. 1.

    for any \(\sigma >s\), we have \(A \sim _sA \cup \mathcal H(X,\sigma )\);

  2. 2.

    if \(\overline{A \setminus X} =A\), there exists \(\sigma >s\) such that \(A \setminus \mathcal H(X,\sigma ) \sim _sA.\)

Let us now present a generalization of the previous result that will be used later on:

Lemma 2.10

Let \(X\subseteq A \subseteq {\mathbb R}^n\) be closed subanalytic sets such that \(O\in X\cap \overline{A \setminus X}\) and let \(s\ge 1\). Then, there exists \(\sigma >s\) such that \(A \setminus \mathcal H(X,\sigma ') \sim _s\overline{A \setminus X}\) for all \(\sigma ' \ge \sigma \).

Proof

Let \(Z=\overline{A \setminus X}\). Since \(\overline{Z \setminus (Z \cap X)}=Z\), the sets Z and \(Z \cap X\) satisfy the hypothesis of Lemma 2.9 (2). Hence, there exists \(\tau >s\) such that \(Z \setminus \mathcal H(Z \cap X,\tau ) \sim _sZ.\) Since \((Z \setminus \mathcal H(Z \cap X,\tau ))\cap X\subseteq \{O\}\), by Proposition 2.7 there exist positive constants R and \(\sigma >s\) such that

$$\begin{aligned} \mathcal H(X,\sigma ) \cap (Z \setminus \mathcal H(Z \cap X,\tau ) )\cap B(O,R) =\emptyset , \end{aligned}$$

i.e., \((Z \setminus \mathcal H(Z \cap X,\tau )) \cap B(O,R)\subseteq Z \setminus \mathcal H(X,\sigma )\) and hence

$$\begin{aligned} Z \le _s Z \setminus \mathcal H(Z \cap X,\tau ) \le _s Z \setminus \mathcal H(X,\sigma ) \le _s Z. \end{aligned}$$

Therefore,

$$\begin{aligned}Z \sim _sZ \setminus \mathcal H(X,\sigma ) = A \setminus \mathcal H(X,\sigma ).\end{aligned}$$

Moreover, since for any \(\sigma ' \ge \sigma \) near the origin we have \(\mathcal H(X,\sigma ') \subseteq \mathcal H(X,\sigma )\), then

$$\begin{aligned} \overline{A \setminus X} \le _s A \setminus \mathcal H(X,\sigma ) \le _s A \setminus \mathcal H(X,\sigma ' ) \le _s \overline{A \setminus X} \end{aligned}$$

which yields the thesis.\(\square \)

3 Presentations of semialgebraic sets

This section is devoted to the first crucial step in our strategy, that is reducing ourselves to prove the main theorem for semialgebraic sets suitably presented.

Definition 3.1

Let A be a closed semialgebraic subset of \({\mathbb R}^n\) with \(\dim _O A=d>0\). We will say that A admits a good presentation if

  1. (a)

    the Zariski closure \(\overline{A}^Z\) of A is irreducible

  2. (b)

    there exist generators \( f_1, \ldots , f_p\) of the ideal \(I(\overline{A}^Z)\subseteq {\mathbb R}[x_1, \ldots , x_n]\) and \(h_1, \dots , h_q\) polynomial functions such that

    $$\begin{aligned} A=\{x \in {\mathbb R}^n \ |\ f_i(x)=0, h_j(x)\ge 0, \quad i=1, \ldots , p, j=1,\dots ,q\} \end{aligned}$$
  3. (c)

    \(h_i(O)=0\) and \(\dim _O (V(h_i) \cap V(f) ) < d\),    for each i, where \(f=(f_1, \ldots ,f_p)\).

Lemma 3.2

Let A be a closed semialgebraic subset of \({\mathbb R}^n\) with \(\dim _O A=d>0\). Then, there exist closed semialgebraic sets \({\varGamma }_1, \ldots , {\varGamma }_r,{\varGamma }'\) such that

  1. 1.

    \(A= \left( \bigcup _{i=1}^r {\varGamma }_i\right) \cup {\varGamma }'\)

  2. 2.

    for each i, \(\dim _O {\varGamma }_i =d\), and \(\dim _O {\varGamma }' < d\)

  3. 3.

    for each i, \({\varGamma }_i\) admits a good presentation.

Proof

Arguing as in [5, Lemma 3.2] in the semialgebraic setting, there exist semialgebraic sets \({\varGamma }_1, \ldots , {\varGamma }_r,{\varGamma }'\) fulfilling conditions (1) and (2) of the thesis and such that, for each i, \({\varGamma }_i\) admits a presentation satisfying conditions (a) and (b) of Definition 3.1. In order to achieve also condition (c), it suffices to drop from the presentation of each \({\varGamma }_i\) all the inequalities \(h_j(x)\ge 0\) such that \(h_j\) vanishes identically on \({\varGamma }_i\).\(\square \)

Since we are interested in preserving dimension, we will reduce ourselves to work with a set presented by as many polynomial equations as its codimension and with the critical locus of the associated polynomial map nowhere dense.

Notation 3.3

Let \({\varOmega }\) be an open subset of \({\mathbb R}^n\). For any smooth \(\varphi :{\varOmega }\rightarrow {\mathbb R}^p\), denote \({\varSigma }_r(\varphi )=\{x\in {\varOmega }\ |\ {\text {rk}}\ d_x \varphi <r\}\) and \({\varSigma }(\varphi )={\varSigma }_p(\varphi )\).

Definition 3.4

Let A be a closed semialgebraic subset of \({\mathbb R}^n\) with \(\dim _O A=d>0\). We will say that A admits a regular presentation if there exist a polynomial map \(F:{\mathbb R}^n \rightarrow {\mathbb R}^{n-d}\) and polynomial functions \(h_1, \ldots , h_q\) such that

  1. (a)

    \(A=\{x \in {\mathbb R}^n \ |\ F(x)= 0, h_j(x)\ge 0, \quad \ j=1,\dots ,q\}\),

  2. (b)

    \(\dim _O ({\varSigma }(F) \cap A) <d\)

  3. (c)

    \(h_i(O)=0\) and \(\dim _O (V(h_i) \cap A ) < d\), for each i.

A useful tool to pass from a good presentation to a regular one will be the following result (for a proof see for instance [1, Lemma 7.7.10]):

Lemma 3.5

Let A be a closed semialgebraic subset of \({\mathbb R}^n\) and let hg be polynomial functions on \({\mathbb R}^n\). Then, there exist polynomial functions \(\varphi , \psi \) with \(\varphi >0\) and \(\psi \ge 0\) such that

  1. 1.

    \(sign(\varphi h + \psi g) =sign (h)\) on A

  2. 2.

    \(V(\psi ) \subseteq \overline{V(h)\cap A}^Z\).

Proposition 3.6

Let A be a closed semialgebraic subset of \({\mathbb R}^n\) with \(\dim _O A=d>0\) which admits a good presentation. Let \(s\ge 1\). Then, there exists a closed semialgebraic subset \(\widetilde{A}\) of \({\mathbb R}^n\) with \(\dim _O \widetilde{A}=d>0\) such that

  1. 1.

    \(\widetilde{A}\) admits a regular presentation

  2. 2.

    \(\widetilde{A} \sim _sA\).

Proof

By hypothesis, we have that

$$\begin{aligned} A=\{x \in {\mathbb R}^n \ |\ f(x)=O, h_j(x)\ge 0,\quad j=1,\dots ,q\} \end{aligned}$$

with \(f=(f_1,\dots , f_p)\) such that V(f) is irreducible, \(V(f)=\overline{A}^Z\) and \(f_1,\dots , f_p\) generate the ideal I(V(f)). In particular, \(\dim _O({\varSigma }_{n-d}(f) \cap V(f))<d\) (see for instance [1, Definition 3.3.3]).

If \(p=n-d\), we have the thesis with \(\widetilde{A}=A\); thus, let \(p> n-d\).

Denote by \({\varPi }\) the set of surjective linear maps from \({\mathbb R}^p\) to \({\mathbb R}^{n-d}\) and consider the smooth map \({\varPhi }:({\mathbb R}^n-V(f) ) \times {\varPi }\rightarrow {\mathbb R}^{n-d}\) defined by \({\varPhi }(x, \pi ) = (\pi \circ f) (x)\) for all \(x\in {\mathbb R}^n-V(f) \) and \(\pi \in {\varPi }\).

The map \({\varPhi }\) is transverse to \(\{O\}\): namely the partial Jacobian matrix of \({\varPhi }\) with respect to the variables in \({\varPi }\) (considered as an open subset of \({\mathbb R}^{p(n-d)}\)) is the \((n-d) \times p(n-d)\) matrix

$$\begin{aligned} \left[ \begin{array}{l@{\quad }l@{\quad }l@{\quad }l@{\quad }l} f(x)&{} \quad O&{}\quad O &{}\quad \dots &{} \quad O\\ O&{}\quad f(x)&{}\quad O&{}\quad \dots &{}\quad O \\ \vdots &{}&{}&{}&{}\\ O&{}\quad O&{}\quad O&{} \quad \dots &{}\quad f(x) \end{array}\right] ; \end{aligned}$$

thus, for all \(x\in {\mathbb R}^n-V(f)\) and for all \(\pi \in {\varPi }\), the Jacobian matrix of \({\varPhi }\) has rank \(n-d\).

As a consequence, by a well-known result of singularity theory (see for instance [2, Lemma 3.2]), we have that the map \({\varPhi }_{\pi } :{\mathbb R}^n-V(f) \rightarrow {\mathbb R}^{n-d}\) defined by \({\varPhi }_{\pi } (x)= {\varPhi }(x, \pi )=(\pi \circ f)(x)\) is transverse to \(\{O\}\) for all \(\pi \) outside a set \({\varGamma }\subset {\varPi }\) of measure zero, and hence, \(\pi \circ f\) is a submersion on \(V(\pi \circ f)\setminus V(f)\) for all such \(\pi \).

Let \(x\in V(f)\) be a point at which f has rank \(n-d\). Then, there is an open dense set \(U\subset {\varPi }\) such that, for all \(\pi \in U\), the map \(\pi \circ f\) is a submersion at x, and hence off some subvariety of V(f) of dimension smaller than d.

Thus, if we choose \(\pi _0\in ({\varPi }\setminus {\varGamma })\cap U\), the map \(F= \pi _0 \circ f :{\mathbb R}^n \rightarrow {\mathbb R}^{n-d}\) satisfies the following properties:

  • \(\dim _O V(F)=\dim _O V(f)=d\),

  • \({\varSigma }(F) \cap V(F)\subseteq V(f)\subseteq V(F)\),

  • \(\dim _O ({\varSigma }(F) \cap V(F))<d\).

We want to show that there exist polynomials \(h_i'\) such that

  • \(A=\{x \in {\mathbb R}^n \ |\ f(x)=O, h_i'(x)\ge 0, \quad i=1,\dots ,q\}\)

  • \(\dim _O (V(F) \cap \bigcup _{i=1}^q V(h_i'))<d. \)

Namely, for each \(i\in \{1, \ldots , q\}\) denote by \(W_i\) the union of the irreducible components Y of V(F) such that \(\dim _O (V(h_i)\cap Y) <d\) ; let also \(T_i= \overline{V(F)\setminus W_i}^Z\). Note that \(V(f) \subseteq W_i\).

If we apply Lemma 3.5 choosing \(h=h_i\) and \(g= \Vert f\Vert ^2\) on \(W_i\), then there exist \(\varphi , \psi \) with \(\varphi >0\) and \(\psi \ge 0\) such that the function \(h'_i = \varphi h_i + \psi \Vert f\Vert ^2\) has the same sign as \(h_i\) on \(W_i\) and \(V(\psi ) \subseteq \overline{V(h_i)\cap W_i}^Z\). Then,

  • \(V(h_i')\cap W_i = V(h_i)\cap W_i\)

  • since \(h_i' |_{T_i} = (\psi \Vert f\Vert ^2 )|_{T_i}\), then \(V(h_i')\cap T_i = (V(\psi ) \cap T_i) \cup (V(f) \cap T_i) \subseteq W_i \cap T_i\).

Thus, \(\dim _O ( V(h_i')\cap V(F)) <d\) for any i and

$$\begin{aligned} A=\{x \in {\mathbb R}^n \ |\ f(x)=O, h_i'(x)\ge 0, \quad i=1,\dots ,q\}. \end{aligned}$$

For each \(m \in {\mathbb N}\) denote

$$\begin{aligned} \widetilde{A}_m=\{x \in {\mathbb R}^n \ |\ F(x)=0, \Vert x\Vert ^{2m} - \Vert f(x)\Vert ^2 \ge 0, h_i'(x)\ge 0, \quad i=1,\dots ,q\}. \end{aligned}$$
(1)

Since \(A \subseteq \widetilde{A}_m \subseteq V(F)\), then \(\dim _O \widetilde{A}_m =d\).

We claim that there exists m such that \(\widetilde{A}_m \sim _s A\). Since \(A \subseteq \widetilde{A}_m\), we trivially have that \(A \le _s \widetilde{A}_m\) for any m. Thus, it is sufficient to prove that there exists m such that \(\widetilde{A}_m \le _s A\). Namely, let \({\varLambda }=\{x \in {\mathbb R}^n \ |\ h_i'(x)\ge 0, i=1,\dots ,q\}\). Since \(V(\Vert f\Vert )\cap {\varLambda }=A =V(d(x,A) )\cap {\varLambda }\), by Proposition 2.6 there exist a rational number \(\tau \) and a real number \(R>0\) such that

$$\begin{aligned} d(x,A)^\tau < \Vert f(x)\Vert \qquad \forall x\in ({\varLambda }\setminus V(f))\cap B(O,R)= ({\varLambda }\setminus A)\cap B(O,R). \end{aligned}$$

Let \(m > s\tau \). Then \(d(x,A) < \Vert f(x)\Vert ^{\frac{1}{\tau }} \le \Vert x\Vert ^ {\frac{m}{\tau }}\) for all \(x\in (\widetilde{A}_m\setminus A) \cap B(O,R)\). This implies that \((\widetilde{A}_m \setminus \{O\}) \cap B(O,R) \subseteq \mathcal H(A,\frac{m}{\tau })\), and hence, by Proposition 2.5, \(\widetilde{A}_m \le _s A\).

Up to increasing m, we can also assume that \(\dim _O (V(F) \cap V(\Vert x\Vert ^{2m} - \Vert f(x)\Vert ^2 ))<d\) and hence that (1) is a regular presentation of \(\widetilde{A}_m\).

It is thus sufficient to choose m as above and \(\widetilde{A} =\widetilde{A}_m\). \(\square \)

4 Main result

Since s-equivalence depends only on the germs at O, we are allowed to identify a subanalytic set with a realization of its germ at the origin in a suitable ball B(OR) with \(R<1\). Henceforth, we will even omit to explicitly indicate the intersection of our sets with B(OR); in particular, given two sets U and \(U'\), when we write that \(U \subseteq U'\) we mean that \(U\cap B(O,R) \subseteq U'\) for a suitable radius R.

Theorem 4.1

For any real number \(s\ge 1\) and for any closed semialgebraic set \(A \subset {\mathbb R}^n\) of codimension \({\ge } 1\) with \(O\in A\), there exists an algebraic subset S of \({\mathbb R}^n\) such that \(A \sim _sS\) and \(\dim _O S= \dim _O A\).

Proof

We will prove the thesis by induction on \(d= \dim _O A\).

If \(d=0\) the result holds trivially. So let \(d\ge 1\) and assume that the result holds for all semialgebraic sets of dimension smaller that d.

By Lemma 3.2, there exist closed semialgebraic sets \({\varGamma }_1, \ldots , {\varGamma }_r,{\varGamma }'\) such that

  1. 1.

    \(A= \left( \bigcup _{i=1}^r {\varGamma }_i\right) \cup {\varGamma }'\)

  2. 2.

    for each i, \(\dim _O {\varGamma }_i =d\) and \({\varGamma }_i\) admits a good presentation

  3. 3.

    \(\dim _O {\varGamma }' < d\).

By Proposition 2.2, by Proposition 3.6 and by the inductive hypothesis, we can assume that A is described by means of a regular presentation as

$$\begin{aligned} A=\{x \in {\mathbb R}^n \ |\ F_0(x)=O, h_j(x)\ge 0, \quad j=1,\dots ,q\} \end{aligned}$$

with \(F_0=(f_1,\dots , f_{n-d})\). We can assume \(q\ge 1\), because otherwise there is nothing to prove.

We will use the following notation:

  • \(Z_i=\bigcup _{j=i+1}^q V(h_j)\) for \(i=0, \ldots , q-1\), and \(Z_q=\emptyset \),

  • \(X= ({\varSigma }(F_0) \cup Z_0)\cap A\),

  • \(\widetilde{f} =(f_2,\dots , f_{n-d}):{\mathbb R}^n \rightarrow {\mathbb R}^{n-d-1}\) and \(V=V(\widetilde{f})\),

  • \({\varLambda }_i=\{x \in {\mathbb R}^n \ |\ h_j(x)\ge 0, \ j=i+1,\dots ,q\}\) for any \(i=0, \ldots , q-1\), and \({\varLambda }_{q}= {\mathbb R}^n\).

In order to avoid trivial cases, we can consider only the case when \(O\in X\).

Since the presentation of A is regular, we have that

$$\begin{aligned} \dim _O({\varSigma }(F_0) \cap A)<d \quad \text{ and } \quad \dim _O(Z_0 \cap A) <d. \end{aligned}$$

Let \(Y=\overline{X\setminus \overline{A \setminus X}} \), then \(A= \overline{A \setminus X} \cup Y\). Since \(\dim _O X <d\), then \(\dim _O Y <d\) too and thus, by the inductive hypothesis, there exists an algebraic subset T of \({\mathbb R}^n\) such that \(Y\sim _sT\) and \(\dim _O T = \dim _O Y.\)

In particular,

$$\begin{aligned} A = \overline{A\setminus X} \cup Y \sim _s\overline{A\setminus X} \cup T. \end{aligned}$$

Since \(\dim _O X <\dim _O A\), then O is a non-isolated point in \(\overline{A\setminus X}\) and Lemma 2.10 ensures that there exists \(\sigma >s\) such that, for any \(\sigma ' \ge \sigma \), we have

$$\begin{aligned} A\setminus \mathcal H(X,\sigma ')\sim _s\overline{A\setminus X}. \end{aligned}$$

We claim that there exists a rational number \(\sigma _0 >\sigma \) such that O is an accumulation point for \(A\setminus \overline{\mathcal H(X,\sigma _0)}\). Otherwise for any integer \(n > 2\), there exists \(R_n>0\) such that \((A\setminus \overline{\mathcal H(X,n)}) \cap B(O,R_n) =\emptyset \), i.e., \(A\cap B(O,R_n) \subseteq \overline{\mathcal H(X,n)} \subseteq \mathcal H(X,n-1)\cup \{O\}\). By Proposition 2.5, it follows that \(A\le _t X\) for any \(t >1\). Then, by Proposition 2.8, there exists \(R>0\) such that \(A\cap B(O,R) = X\cap B(O,R)\), which is not possible since \(\dim _O X <\dim _O A\).

If we denote \(K_0= {\mathbb R}^n \setminus \mathcal H(X,\sigma _0)\), then

$$\begin{aligned} A\cap K_0 \sim _s\overline{A\setminus X} \end{aligned}$$

and, moreover, O is an accumulation point for \(A \cap \overset{\circ }{K}_0\), where \(\overset{\circ }{K}_0\) denotes the interior part of \(K_0 \).

Let \(g_0=f_1\). We will recursively construct polynomial functions \(g_1 \ldots , g_q\) and closed semialgebraic sets \(K_1 \ldots , K_q\) such that

  • \(K_i \subseteq \overset{\circ }{K}_{i+1} \cup \{O\}\) for any \(i= 0, \ldots , q-1\)

  • if \(F_i=(g_i, f_2, \ldots , f_{n-d})\), then for any \(i= 0, \ldots , q\) the semialgebraic subset

    $$\begin{aligned} A_i=\{x \in {\mathbb R}^n \ |\ F_i(x)=0, h_j(x)\ge 0, \quad j=i+1,\dots ,q\}=V(g_i) \cap V \cap {\varLambda }_{i} \end{aligned}$$

    satisfies the following properties:

    1. P1(i):

      \( \left\{ \begin{array}{ll} A\cap K_0 \sim _s\overline{A\setminus X} &{} \quad \text{ if } i=0 \\ A_i\cap K_i\sim _sA_{i-1}\cap K_{i-1} &{} \quad \text{ if } i=1, \ldots , q\\ \end{array} \right. \)

    2. P2(i):

      \(Z_i \cap A_i\cap K_i \subseteq \{O\}\)

    3. P3(i):

      \({\varSigma }(F_i) \cap A_i \cap K_i \subseteq \{O\}\)

    4. P4(i):

      O is an accumulation point for \(A_i \cap \overset{\circ }{K}_i\).

Evidently, the set \(A_0=A\) satisfies the properties P1(0), P2(0), P3(0) and P4(0). Thus, assume that \(0 \le i\le q-1\), assume that we have already constructed \(A_i\) fulfilling the four previous properties and let us construct \(g_{i+1} \) in such a way that \(A_{i+1}\) satisfies properties P1(\(i+1\)), P2(\(i+1\)), P3(\(i+1\)) and P4(\(i+1\)).

For any positive integer m, let \(g_{i+1} =g_i^2-h_{i+1}^m\).

We will see that there exists \(m_s\in {\mathbb N}\) such that for any odd integer \(m\ge m_s\) the semialgebraic set \(A_{i+1}= V(g_{i+1}) \cap V\cap {\varLambda }_{i+1} \) satisfies properties P1\((i+1)\), P2\((i+1),\) P3\((i+1)\) and P4\((i+1)\).

Properties P2(i) and P3(i) guarantee that \((A_i\cap K_i ) \cap ({\varSigma }(F_i) \cup Z_i )\subseteq \{O\}\). Hence, by Proposition 2.7, there exists a rational number \(\beta >s\) such that (near the origin)

$$\begin{aligned} \mathcal H(A_i \cap K_i ,\beta ) \cap \left( {\varSigma }(F_i) \cup Z_i\right) =\emptyset . \end{aligned}$$

Let \(H_\beta = \mathcal H(A_i \cap K_i ,\beta )\). Up to increasing \(\beta \), we can assume that

$$\begin{aligned} \overline{H_\beta } \cap \left( {\varSigma }(F_i) \cup Z_i\right) \subseteq \{O\} \end{aligned}$$
(2)

. Consider the set \(E={\mathbb R}^n \setminus H_\beta \).

Evidently, the closed semialgebraic set \(W= \left( V \cap {\varLambda }_{i+1} \cap K_i \cap E\right) \cap \{h_{i+1} \ge 0\}\) fulfills the condition

$$\begin{aligned} V(g_i) \cap W= (A_i\cap K_i ) \cap E=\{O\}. \end{aligned}$$

Thus, by Proposition 2.6 there exists \(m_1\in {\mathbb N}\) such that, for any integer number \(m\ge m_1\), we have \(g_i(x)^2\ge h_{i+1}(x)^m\) for all \(x\in W\) and \(g_i(x)^2> h_{i+1}(x)^m\) for all \(x\in W\setminus \{O\}\).

If we take m an odd integer \(\ge m_1\), by construction \(g_{i+1}=g_i^2-h_{i+1}^m\) is strictly positive on \(W\setminus \{O\}\) and on \(\{h_{i+1}<0\}\), hence \(g_{i+1}\) is strictly positive on \((V \cap {\varLambda }_{i+1} \cap K_i \cap E) \setminus \{O\}\). Since \(A_{i+1}=V(g_{i+1}) \cap V \cap {\varLambda }_{i+1}\), it follows that

$$\begin{aligned} A_{i+1} \cap K_i \subseteq ({\mathbb R}^n \setminus E)\cup \{O\}= H_\beta \cup \{O\} \end{aligned}$$
(3)

and therefore, by Proposition 2.5, we have

$$\begin{aligned}A_{i+1}\cap K_i \le _s A_i\cap K_i. \end{aligned}$$

Claim: There exists a closed semialgebraic set \(K_{i+1}\) such that

  1. 1.

    \(K_{i} \subseteq \overset{\circ }{K}_{i+1} \cup \{O\}\)

  2. 2.

    \((A_i \cup A_{i+1}) \cap K_{i+1}\subseteq H_\beta \cup \{O\}\).

Proof of the Claim

Since \(A_i \cap K_i \subseteq H_\beta \cup \{O\} \) and by (3), we have that

$$\begin{aligned} (A_i \cup A_{i+1}) \cap K_i\subseteq H_\beta \cup \{O\}. \end{aligned}$$
(4)

Then, the set \(\left( (A_i \cup A_{i+1}) \setminus (K_i \cup H_\beta )\right) \cup \{O\} = (A_i \cup A_{i+1}) \setminus H_\beta \) is closed and intersects \(K_i\) only at O. Hence, by Proposition 2.7, there exists a rational number \(\sigma ' >s\) such that

$$\begin{aligned} \left( (A_i \cup A_{i+1}) \setminus (K_i \cup H_\beta )\right) \cap \mathcal H(K_i, \sigma ') =\emptyset . \end{aligned}$$

Up to increasing \(\sigma ' \), we can assume that

$$\begin{aligned} \left( (A_i \cup A_{i+1}) \setminus (K_i \cup H_\beta )\right) \cap \overline{ \mathcal H(K_i, \sigma ')}=\emptyset . \end{aligned}$$

Thus, if we let \(K_{i+1}=\overline{ \mathcal H(K_i, \sigma ')}\), we have

$$\begin{aligned} \left( (A_i \cup A_{i+1}) \setminus (K_i \cup H_\beta )\right) \cap K_{i+1} =\emptyset \end{aligned}$$

and hence

$$\begin{aligned} (A_i \cup A_{i+1}) \cap (K_{i+1}\setminus K_i) \subseteq H_\beta . \end{aligned}$$

Then, recalling (4), we have

$$\begin{aligned} (A_i \cup A_{i+1}) \cap K_{i+1} = \left( (A_i \cup A_{i+1}) \cap K_i\right) \cup \left( (A_i \cup A_{i+1}) \cap (K_{i+1} \setminus K_i)\right) \subseteq H_\beta \cup \{O\}, \end{aligned}$$

which concludes the proof of the Claim.\(\square \)

In particular, the previous Claim ensures that \( A_{i+1} \cap K_{i+1}\subseteq H_\beta \cup \{O\}\), and hence

$$\begin{aligned} A_{i+1} \cap K_{i+1} \le _s A_i \cap K_i. \end{aligned}$$

It remains to prove that \(A_i\cap K_i \le _s A_{i+1}\cap K_{i+1}\).

Consider the set \(B_i= V\cap {\varLambda }_{i}\supseteq A_i\).

By the Claim and by (2), for any \(x\in (A_i\cap K_{i+1})\setminus \{O\}\), we have \(\dim _x A_i=d\) and \(\dim _x B_i=d+1\). Moreover, since \(A_i\cap K_i\sim _sA \cap K_0\), O is a non-isolated point in \(A_i\cap K_i\) and hence in \(A_i\cap K_{i+1}\) too.

Then, if we let \({\varOmega }_i= K_{i+1}\setminus \overset{\circ }{K}_i\), for any \(x\in A_i\cap \overset{\circ }{K}_{i+1}\setminus \{O\}\) at least one of the following facts holds:

  • \(\dim _x (B_i \cap K_i)=d+1\)

  • \(\dim _x (B_i \cap {\varOmega }_i)=d+1\).

It will be useful to consider the following closed semialgebraic sets

$$\begin{aligned} (B_i \cap K_i)^*= & {} \overline{ \{x\in B_i \cap K_i\ |\ \dim _x (B_i \cap K_i)=d+1\} }\\ (A_i \cap K_i)^*= & {} A_i \cap (B_i \cap K_i)^*\\ (B_i \cap {\varOmega }_i)^*= & {} \overline{ \{x\in B_i \cap {\varOmega }_i\ |\ \dim _x (B_i \cap {\varOmega }_i)=d+1\} }\\ (A_i \cap {\varOmega }_i)^*= & {} A_i \cap (B_i \cap {\varOmega }_i)^*. \end{aligned}$$

Since \(K_i \subseteq \overset{\circ }{K}_{i+1}\cup \{O\}\), the previous considerations imply that

$$\begin{aligned} A_i \cap K_i \setminus \{O\} \subseteq (A_i \cap K_i)^* \cup (A_i \cap {\varOmega }_i)^*. \end{aligned}$$

Moreover, since \(A_i \cap \overset{\circ }{K}_i \setminus \{O\} \subseteq (A_i \cap K_i)^*\) and using property P4(i), then O is an accumulation point for \((A_i \cap K_i)^*\) and hence a non-isolated point of \((A_i \cap K_i)^*\). Therefore,

$$\begin{aligned} A_i \cap K_i \subseteq (A_i \cap K_i)^* \cup (A_i \cap {\varOmega }_i)^*. \end{aligned}$$

We also have that

$$\begin{aligned} \overline{(B_i \cap K_i)^* \setminus (A_i \cap K_i)^*}= (B_i \cap K_i)^*. \end{aligned}$$
(5)

Namely, if \(x\in (A_i \cap K_i)^*\), there exists a sequence \(x_\nu \in (B_i \cap K_i)\setminus \{O\}\) converging to x and such that \(\dim _{x_\nu } (B_i \cap K_i) =d+1\). If definitively \(x_\nu \notin A_i\), then x is a limit point of \((B_i \cap K_i)^* \setminus (A_i \cap K_i)^*\). Otherwise, for any \(x_\nu \in A_i\), since \(\dim _{x_\nu } (A_i \cap K_i) \le d\), there exists \(y_\nu \in (B_i \cap K_i) \setminus (A_i \cap K_i)\) such that \(\dim _{y_\nu } (B_i \cap K_i) =d+1\) and \(\Vert x_\nu - y_\nu \Vert <\frac{1}{\nu }\). Then, x is a limit point of the sequence \( y_\nu \in (B_i \cap K_i)^* \setminus (A_i \cap K_i)^*\).

Let \(d_g\) be the geodesic distance on \((B_i \cap K_i)^*\) and denote by \(B_g (x_0, r)=\{y\in (B_i \cap K_i)^* \ |\ d_g (y, x_0) <r\}\) the geodesic ball centered at \(x_0 \in (B_i \cap K_i)^*\).

By [6, Proposition 3, page 70], there exist constants \(R_0>0\), \(C>0\) and \( 0<\alpha \le 1\) such that, for any \(y_1,y_2 \in (B_i \cap K_i)^* \cap B(O,R_0)\), we have that

$$\begin{aligned} \Vert y_1-y_2\Vert \le d_g(y_1,y_2) \le C \Vert y_1-y_2\Vert ^{\alpha }. \end{aligned}$$

Therefore, for \(x_0 \in (B_i \cap K_i)^* \cap B(O,\frac{R_0}{2})\) and for \(r<\frac{R_0}{2}\), we have

$$\begin{aligned} B_g (x_0, r) \subseteq B(x_0, r) \cap (B_i \cap K_i)^* \subseteq B_g (x_0, C r^{\alpha }). \end{aligned}$$

Up to decreasing \(R_0\) and \(\alpha \) if necessary, we can assume that \(C=1\). We emphasize that, by the convention settled at the beginning of this section, we can assume that the ball B(OR) where we are working is contained in \(B(O,\frac{R_0}{2})\).

By (5) and by Lemma 2.9, there exists a closed semialgebraic subset \(L \subseteq (B_i \cap K_i)^*\) such that

$$\begin{aligned} L\cap (A_i \cap K_i)^*=\{O\} \quad \text{ and } \quad (B_i \cap K_i)^* \sim _{\frac{s+\beta }{\alpha }} L. \end{aligned}$$

Evidently,

$$\begin{aligned} V(g_i) \cap L = V(g_i) \cap L \cap (B_i \cap K_i)^* = A_i \cap L \cap (B_i \cap K_i)^* = L \cap (A_i \cap K_i)^* = \{O\}. \end{aligned}$$

Thus, by Proposition 2.6, there exists \(m_2\in {\mathbb N}\) such that for any integer \(m\ge m_2\) we have \(g_i(x)^2\ge h_{i+1}(x)^m\) for all \(x\in L\) and \(g_i(x)^2> h_{i+1}(x)^m\) for all \(x\in L \setminus \{O\}\).

If we take an integer \(m \ge m_2\), by construction \(g_{i+1}=g_i^2-h_{i+1}^m\) is strictly positive on \(L \setminus \{O\}\).

Let \(x \in (A_i \cap K_i)^*\setminus \{O\}\). By P2(i), we have \(h_{i+1}(x)>0\), so that \(g_{i+1}(x)<0\). Since \((B_i \cap K_i)^* \sim _{\frac{s+\beta }{\alpha }} L\), by Proposition 2.5 there exist \(\eta >\frac{s+\beta }{\alpha }\) and \(z\in L \subseteq (B_i \cap K_i)^*\) such that \(\Vert x-z\Vert <\Vert x\Vert ^{\eta }\) (and we can assume that \(z\ne O\)).

As \(g_{i+1}\) is strictly positive on \(L\setminus \{O\}\), then \(g_{i+1}(z)>0\). Since \(z\in B(x, \Vert x\Vert ^\eta )\cap (B_i \cap K_i)^*\), then \(z \in B_g (x, \Vert x\Vert ^{\eta \alpha })\). So, by the Intermediate Value Theorem on \(B_g\left( x, \Vert x\Vert ^{\eta \alpha }\right) \), there exists \(w \in B_g\left( x, \Vert x\Vert ^{\eta \alpha }\right) \subseteq B\left( x, \Vert x\Vert ^{\eta \alpha }\right) \cap (B_i \cap K_i)^* \) such that \(g_{i+1}(w)=0\). Hence, \(w\in (B_i \cap K_i)^* \cap V(g_{i+1}) \subseteq A_{i+1}\cap K_i\); as a consequence, \(x \in \mathcal H( A_{i+1}\cap K_i, \eta \alpha )\).

We have thus proved that \((A_i \cap K_i)^* \setminus \{O\} \subseteq \mathcal H(A_{i+1}\cap K_i, \eta \alpha )\) and therefore, since \(\eta \alpha >s\), that

$$\begin{aligned} (A_i \cap K_i)^* \le _s A_{i+1}\cap K_i \end{aligned}$$
(6)

by Proposition 2.5.

If \(O\in (A_i \cap {\varOmega }_i)^* \), a slight modification of the previous argument allows one to obtain that there exists \(m_3\in {\mathbb N}\) such that, for any integer \(m\ge m_3\), if \(g_{i+1}=g_i^2-h_{i+1}^m\), then

$$\begin{aligned} (A_i \cap {\varOmega }_i)^* \le _s A_{i+1}\cap {\varOmega }_i . \end{aligned}$$

The only needed change occurs to prove that \((A_i \cap {\varOmega }_i)^* \setminus \{O\} \subseteq \mathcal H(A_{i+1}\cap {\varOmega }_i, \eta ' \alpha )\) for some \(\eta '\), avoiding the use of P2(i). Namely, we can proceed as above to show that every \(x\in (A_i \cap {\varOmega }_i)^* \setminus \{O\}\) such that \(h_{i+1}(x)>0\) belongs to \(\mathcal H(A_{i+1}\cap {\varOmega }_i, \eta ' \alpha )\); if instead \(h_{i+1}(x)=0\), then \(g_{i+1}(x)=0\) too and therefore \(x\in A_{i+1}\cap {\varOmega }_i\).

Hence, if \(O\in (A_i \cap {\varOmega }_i)^* \), then, for any integer \(m \ge \max \{m_2, m_3\}\),

$$\begin{aligned} A_i \cap K_i\le _s (A_i \cap K_i)^* \cup (A_i \cap {\varOmega }_i)^* \le _s (A_{i+1}\cap K_i) \cup (A_{i+1}\cap {\varOmega }_i )= A_{i+1}\cap K_{i+1}. \end{aligned}$$

If instead \(O\notin (A_i \cap {\varOmega }_i)^* \), then, near O, we have \(A_i \cap K_i \subseteq (A_i \cap K_i)^*\) and hence

$$\begin{aligned} A_i \cap K_i\le _s (A_i \cap K_i)^* \le _s A_{i+1}\cap K_i \le _s A_{i+1}\cap K_{i+1} \end{aligned}$$

(in this case let \(m_3=1\)).

Hence, if we let \(M= \max \{m_1, m_2, m_3\}\), then, for any odd integer \(m \ge M\), we have

$$\begin{aligned} A_{i+1} \cap K_{i+1} \sim _sA_i\cap K_i \end{aligned}$$

and so P1(\(i+1\)) is proved.

. By (2) and by the Claim, we have that

$$\begin{aligned} A_{i+1}\cap K_{i+1} \cap Z_i \subseteq \{O\}. \end{aligned}$$

Since \(Z_{i+1} \subseteq Z_{i}\), property P2(\(i+1\)) holds. In addition, we have obtained that \(h_{i+1}\) does not vanish on \(A_{i+1}\cap K_{i+1} \setminus \{O\}\).

. In order to prove P3(\(i+1\)), consider the Jacobian matrix of \(F_{i+1}=(g_{i+1},f_2, \dots , f_{n-d})\), i.e.,

$$\begin{aligned} \begin{pmatrix} 2 g_i \nabla g_i -m\, h_{i+1}^{m-1} \nabla h_{i+1} \\ \nabla f_2\\ \vdots \\ \nabla f_{n-d} \end{pmatrix}. \end{aligned}$$

Evaluating it on the points of \(A_{i+1}\), we get the matrix

$$\begin{aligned} \begin{pmatrix} h_{i+1}^{\frac{m}{2}}(2 \nabla g_i -m\, h_{i+1}^{\frac{m}{2}-1} \nabla h_{i+1} )\\ \nabla f_2\\ \vdots \\ \nabla f_{n-d} \end{pmatrix}. \end{aligned}$$

Since, as seen above, \(h_{i+1}\) does not vanish on \(A_{i+1}\cap K_{i+1} \setminus \{O\}\),

$$\begin{aligned} \begin{array}{ll} &{} {\varSigma }(F_{i+1}) \cap A_{i+1} \cap K_{i+1} \\ &{} = \left\{ x\in A_{i+1} \cap K_{i+1} \ |\ \left( 2 \nabla g_i -m\, h_{i+1}^{\frac{m}{2}-1} \nabla h_{i+1} \right) \wedge \nabla f_2 \wedge \cdots \wedge \nabla f_{n-d} =0\right\} . \end{array} \end{aligned}$$

If we let \(\varphi = 4 \Vert \nabla g_i \wedge \nabla f_2 \wedge \ldots \wedge \nabla f_{n-d} \Vert ^2\) and \(\psi = \Vert \nabla h_{i+1} \wedge \nabla f_2 \wedge \cdots \wedge \nabla f_{n-d}\Vert ^2\), we have that

$$\begin{aligned} {\varSigma }(F_{i+1}) \cap A_{i+1}\cap K_{i+1} \subseteq \left\{ x\in A_{i+1} \cap K_{i+1} \ |\ \varphi (x) = m^2 |h_{i+1}(x)| ^{m-2} \psi (x)\right\} . \end{aligned}$$

Since \(V(\varphi ) ={\varSigma }(F_i)\), by (2) \(V(\varphi ) \cap \overline{H_\beta } \subseteq \{O\}\); then, by Proposition 2.6, there exists \(\lambda \) such that \(\varphi (x) \ge \Vert x\Vert ^\lambda \) on \(\overline{H_\beta }\) and hence, by the Claim, also on \(A_{i+1} \cap K _{i+1}\).

Moreover, there exist constants \(\mu \) and N such that both \(|h_{i+1}(x)|^\mu \le \Vert x\Vert \) and \(\psi \le N\) on a neighborhood of O.

If \(m> \lambda \mu +2\), then \({\varSigma }(F_{i+1}) \cap A_{i+1} \cap K_{i+1} \subseteq \{O\}\). Namely, if by contradiction there exists a sequence of points \(x_\nu \in A_{i+1} \cap K_{i+1} \) converging to O such that \(\varphi (x_\nu ) =m^2 |h_{i+1}(x_\nu )| ^{m-2} \psi (x_\nu )\), then

$$\begin{aligned} \Vert x_\nu \Vert ^{\lambda \mu }\le m^{2\mu } N^\mu \Vert x_\nu \Vert ^ {m-2} \end{aligned}$$

which is a contradiction.

Let \(m_4\) be an integer such that \(m_4 > \lambda \mu +2\). Thus, for any odd integer \(m\ge m_4\), we have that \(A_{i+1}\) satisfies property P3\((i+1)\).

. By hypothesis, O is an accumulation point for \(A_i \cap \overset{\circ }{K}_i\). Since \(A_i \cap \overset{\circ }{K}_i \setminus \{O\}\subseteq (A_i \cap K_i)^*\), by (6) O is an accumulation point for \(A_{i+1} \cap K_i\) and then also for \(A_{i+1} \cap \overset{\circ }{K}_{i+1}\).

Finally, if we let \(m_s =\max \{M, m_4\}\), then for any odd integer \(m\ge m_s\), we have that \(A_{i+1}\) satisfies all the properties P1(\(i+1\)), P2(\(i+1\)), P3(\(i+1\)) and P4(\(i+1\)).

At the end of the recursive construction, the set \(A_q\) is algebraic.

For any \(x\in A_q \cap K_q \setminus \{O\}\), by the properties P2(q) and P3(q) we have that \(\dim _x A_q =d\), and hence, \(\dim _x (A_q \cap K_q) \le d\). Then, \(\dim _O (A_q \cap K_q) \le d\).

On the other hand, for any \(x\in A_q \cap \overset{\circ }{K}_q\setminus \{O\}\), we have that \(\dim _x (A_q \cap K_q)=\dim _x (A_q \cap \overset{\circ }{K}_q)= d\). Since, by property P4(q), O is an accumulation point for \(A_q \cap \overset{\circ }{K}_q\), then \(\dim _O (A_q \cap K_q)\ge d\). Hence, \(\dim _O (A_q \cap K_q)=d\).

Moreover the following facts hold:

  1. (a)

    \(A \sim _s\overline{A \setminus X} \cup T \sim _s(A \cap K_0) \cup T \sim _s(A _q\cap K_q) \cup T\)

  2. (b)

    \(A _q\setminus K_q \subseteq {\mathbb R}^n \setminus K_0 = \mathcal H(X,\sigma _0)\), and thus, \(A _q\setminus K_q \le _s X\)

  3. (c)

    \(A_q = (A _q\setminus K_q) \cup (A _q\cap K_q) \le _s X \cup \overline{A \setminus X} =A\).

As a consequence

$$\begin{aligned} \overline{(A_q \cap K_q) }^Z \cup T \le _s A_q \cup T\le _s A \cup Y =A \le _s (A_q \cap K_q)\cup T \le _s \overline{(A_q \cap K_q) }^Z \cup T. \end{aligned}$$

Thus, \(S= \overline{(A_q \cap K_q) }^Z \cup T \) satisfies the thesis. \(\square \)

The previous theorem allows us to strengthen the following result on approximation preserving dimension which can be found in [5]:

Theorem 4.2

Let A be a closed semianalytic subset of \({\mathbb R}^n\) with \(O\in A\). Then, for any \(s \ge 1\), there exists a closed semialgebraic set \(B\subseteq {\mathbb R}^n\) such that \(A \sim _s B\) and \(\dim _O B= \dim _O A\).

From Theorem 4.1 and from Theorem 4.2, we immediately obtain:

Corollary 4.3

For any real number \(s\ge 1\) and for any closed semianalytic set \(A \subset {\mathbb R}^n\) of codimension \({\ge } 1\) with \(O\in A\), there exists an algebraic subset S of \({\mathbb R}^n\) such that \(A \sim _sS\) and \(\dim _O S= \dim _O A\).

Example 4.4

If \(A=\{(x,y,z)\in {\mathbb R}^3 \ |\ z=0, x\ge 0, y\ge 0\}\) and \(s\ge 1\), the approximation technique described in the proof of Theorem 4.1 yields a surface defined by \((z^2-x^m)^2 -y^p=0\) for suitable odd integers m and p; the shape of such a surface is represented in Fig. 1.

Fig. 1
figure 1

Algebraic approximation of a quadrant