1 Introduction

Let R be a fixed real closed field and \(\hbox {D}\subset \mathrm{R}\) an ordered domain. We will denote by \(\hbox {C}\) the algebraic closure of \(\mathrm{R}\). We consider in this paper the algorithmic problem of given a polynomial \(P \in \hbox {D}[ X_{1} , \ldots ,X_{{ k}} ]\), determining the number of semi-algebraically connected components of the set, \({\mathrm{{Zer}}}(P, \mathrm{R}^{{ k}})\), of zeros of \(P\) in \(\mathrm{R}^{{ k}}\). Moreover, given two points \(x,y \in {\mathrm{{Zer}}} ( P, \mathrm{R}^{{ k}})\), described by real univariate representations (see below for precise definition), we would like to decide if \(x,y\) belong to the same semi-algebraically connected component of \({\mathrm{{Zer}}} ( P, \mathrm{R}^{{ k}} )\), and if so, to compute a semi-algebraic path with image contained in \({\mathrm{{Zer}}} ( P, \mathrm{R}^{{ k}} )\), connecting them. We measure the complexity of an algorithm by the number of arithmetic operations performed in the ring \(\hbox {D}\).

The problem of designing an efficient algorithm for solving the problem described in the previous paragraph is very well studied in algorithmic semi-algebraic geometry. It follows from Collins’ algorithm [6] for computing cylindrical algebraic decomposition [6] that this problem can be solved with complexity \(d^{2^{O ( k )}}\), where \(d= \deg ( P )\) [20]. Notice that this complexity is doubly exponential in \(k\). Singly exponential algorithms for solving this problem were introduced by Canny in [5], and successively completed and refined in [1, 1014, 22], the best complexity bound being \(d^{O ( k^{2} )}\) [1]. However, these results remained unsatisfactory from the complexity point of view for the following reason. It is a classical result due to Oleĭnik and Petrovskiĭ [17], Thom [21] and Milnor[16] that the number of semi-algebraically connected components of a real algebraic variety in \(\mathrm{R}^{{ k}}\) defined by polynomials of degree at most \(d\) (in fact, the sum of all the Betti numbers of the variety) is bounded by \(d ( 2d-1 )^{k-1} =O ( d )^{k}\). Indeed, the Morse-theoretic proof of this fact had inspired the so called “critical point” method, that is at the base of many algorithms in semi-algebraic geometry. The best algorithms using the critical point method often have complexity \(d^{O ( k )}\) when applied to real algebraic varieties in \(\mathrm{R}^{{ k}}\) defined by polynomials of degree \(d\). It is the case for testing emptiness, computing at least one point in every connected component, optimizing a polynomial and computing the Euler–Poincaré characteristic (see for example [2]). In contrast, for counting the number of semi-algebraically connected components and computing semi-algebraic paths, the best complexity bound remained \(d^{O ( k^{2} )}\).

All known singly exponential algorithms for deciding connectivity of a semi-algebraic set \(S\) rely on computing a certain one dimensional semi-algebraic subset, which is referred to as a roadmap of \(S\). The definition of a roadmap of an arbitrary semi-algebraic set \(S\) (not just a real variety) is as follows.

Definition 1.1

A roadmap for \(S\) is a semi-algebraic set \(M\) of dimension at most one contained in \(S\) such that \(M\) satisfies the following conditions:

  • \(\hbox {RM}_{1}\) For every semi-algebraically connected component \(D\) of \(S\), \(D \cap M\) is non-empty and semi-algebraically connected.

  • \(\hbox {RM}_{2}\) For every \(x \in \mathrm{R}\) and for every semi-algebraically connected component \(D'\) of \(S_{x} =S \cap \pi _{1}^{-1} ( \{ x \} )\), \(D' \cap M \ne \emptyset \), where \(\pi _{1} : \mathrm{R}^{{ k}} \rightarrow \mathrm{R}\) is the projection on the first coordinate.

Once roadmaps are computed with singly exponential complexity, questions about connectivity are reduced to the same questions in a finite graph, and can be answered with complexity no greater than polynomial in the size of the roadmap itself.

All known algorithms for computing roadmaps follow a certain paradigm which can be roughly described as follows. Given a semi-algebraic set \(V \subset \mathrm{R}^{{ k}}\) (might be assumed to satisfy certain additional properties, such as being a bounded, non-singular hypersurface), one defines

  1. (1)

    a certain semi-algebraic subset \(V^{0} \subset V\), with dimension of \(V^{0}\) bounded by \(p<k\),

  2. (2)

    a finite subset of points of \(\mathcal {N} \subset \mathrm{R}^{p}\).

The set \(V^{0}\) and the finite set \(\mathcal {N}\) are not arbitrary but must satisfy certain intricate conditions. A crucial mathematical result is then proved: for any semi-algebraically connected component \(C\) of \(V\), \(C \cap (V^{0} \cup V_{\mathcal {N}})\) is non-empty and semi-algebraically connected, where \(V_{\mathcal {N}} =V \cap \pi _{[ 1,p ]}^{-1} ( \mathcal {N} )\), with \(\pi _{[ 1,p ]}:\mathrm{R}^{{ k}} \rightarrow \mathrm{R}^{p}\) the projection on the first \(p\) coordinates (see, for example, Proposition 15.7 in [2] for the special case when \(p=1\), Theorem 14 in [8, Proposition 3 in [3], or Proposition 3.4 of the current paper).

The actual algorithm then proceeds by reducing the problem of computing a roadmap of \(V\) to computing roadmaps of \(V^{0}\) and of the fibers \(V_{\mathcal {N}}\), each such roadmap containing a well chosen set of points including the intersection of \(V^{0}\) and the fibers \(V_{\mathcal {N}}\). The roadmaps of fibers are then computed using a recursive call to the same algorithm and the remaining problem is to compute a roadmap of \(V^{0}\).

In the classical algorithm (see, for example, Chap. 15, [2]), \(p=1\), and thus \(V^{0}\) has dimension at most one, and is already a roadmap of itself. The complexity of this algorithm for computing the roadmap of an algebraic set \(V \subset \mathrm{R}^{{ k}}\), defined by a polynomial of degree \(d\) in \(k\) variables, is \(d^{O ( k^{2} )}\) . The exponent \(O ( k^{2} )\) remained a very difficult obstacle to overcome for many years, and the first progress was reported only very recently.

A fully general deterministic Baby-step Giant-step algorithm with complexity \(d^{O ( k^{3/2} )}\) for computing the roadmap of an algebraic set \(V \subset \mathrm{R}^{{ k}}\), defined by a polynomial of degree \(d\) in \(k\) variables, is given in [3]. Its recursive scheme is similar to the one introduced in [8] where a probabilistic algorithm of complexity \(d^{O ( k^{3/2} )}\) for computing roadmaps of smooth bounded hypersurfaces of degree \(d\) in \(k\) variables is given. In [3], the parameter \(p\) is chosen to be \({\approx }\sqrt{k}\), the roadmaps of the fibers are computed recursively using the same algorithm, while that of \(V^{0}\) is computed using the classical algorithm. The main reason for having such an unbalanced approach, and not using recursion to compute a roadmap of \(V^{0}\) as well, is that the good properties of \(V\) under which the mathematical connectivity result is proved, are not inherited by \(V^{0}\). This difficulty is avoided by making a call to the classical roadmap for \(V^{0}\). The classical roadmap algorithm can be modified so that its complexity is \(d^{O ( p k )}\) for special algebraic sets of dimension at most \(p\). Having an unbalanced approach where the dimension \(p\) of \(V^{0}\) is much smaller (roughly \(p= \sqrt{k}\)) compared to the dimension of the various fibers (roughly \(k - \sqrt{k}\)), the complexity of the algorithm in [3] can be bounded by \(d^{O (\sqrt{k} k)}\).

It is reasonable to hope that a more balanced algorithm in which \(p \approx k/2\), and where the roadmaps of both \(V^{0}\) and the \(V_{\mathcal {N}}\) are computed recursively using the same algorithm, by a divide-and-conquer method, can compute a roadmap with a complexity \(d^{\tilde{O} ( k )}\) where we denote by \(\tilde{O} ( k )\) any function of \(k\) of the form \(k \log ^{O ( 1 )} ( k )\).

We prove the following theorem which is the main result of this paper (definitions of real univariate representations are given in Sect. 7.2).

Theorem 1.2

Let \(\mathrm{R}\) be a real closed field and \(\hbox {D}\subset \mathrm{R}\) an ordered domain. The following holds.

  • There exists an algorithm that takes as input:

    1. (1)

      a polynomial \(P \in \hbox {D}[ X_{1} , \ldots ,X_{{ k}} ]\), with \(\deg ( P) \le d\);

    2. (2)

      a finite set, \(A\), of real univariate representations whose associated set of points, \(\mathcal {A} = \{ p_{1} , \ldots ,p_{m}\}\), is contained in \(V= {\mathrm{{Zer}}} ( P, \mathrm{R}^{{ k}} )\), and such that the degree of the real univariate representation representing \(p_{i}\) is bounded by \(D_{i}\) for \(1 \le i \le m\);

    and computes a roadmap of \(V\) containing \(\mathcal {A}\). The complexity of the algorithm is bounded by

    $$\begin{aligned} \Big ( 1+ \sum _{i=1}^{m} D_{i}^{O ( \log ^{2} ( k ) )} \Big ) \big ( k^{\log ( k )} d \big )^{O ( k\log ^{2} ( k ) )}. \end{aligned}$$

    The size of the output is bounded by \(( \hbox {card} ( \mathcal {A}) + 1 ) ( k^{\log ( k )} d )^{O ( k\log ( k ) )}\), while the degrees of the polynomials appearing in the descriptions of the curve segments and points in the output are bounded by

    $$\begin{aligned} \big ( \mathop {\max }\limits _{1 \le i \le m}D_{i} \big )^{O ( \log ( k ) )} \big ( k^{\log ( k )} d \big )^{O ( k\log ( k ) )}. \end{aligned}$$
  • There exists an algorithm that takes as input a polynomial \(P \in \hbox {D}[ X_{1} , \ldots ,X_{{ k}} ]\), with \(\deg ( P ) \le d\), and computes the number of semi-algebraically connected components of \(V= {\mathrm{{Zer}}} ( P, \mathrm{R}^{{ k}} )\), with complexity bounded by

    $$\begin{aligned} \big (k^{\log ( k )}d\big )^{O ( k\log ^{2} ( k ) )}. \end{aligned}$$
  • There exists an algorithm that takes as input:

    1. (1)

      a polynomial \(P \in \hbox {D}[ X_{1} , \ldots ,X_{{ k}} ]\), with \(\deg ( P ) \le d\);

    2. (2)

      two real univariate representations whose associated points are contained in \(V= {\mathrm{{Zer}}} ( P, \mathrm{R}^{{ k}} )\), and whose degrees are bounded by \(D_{1}\) and \(D_{2}\) respectively;

    and decides whether the two points belong to the same semi-algebraically connected component of \(V\), and if so computes a description of a semi-algebraic path connecting them with image contained in \(V\). The complexity of the algorithm is bounded by

    $$\begin{aligned} \big (D_{1}^{O ( \log ^{2} ( k ) )} +D_{2}^{O ( \log ^{2} ( k ) )} +1\big ) \big (k^{\log ( k )} d\big )^{O ( k\log ^{2} ( k ) )}. \end{aligned}$$

    The size of the output as well as the degrees of the polynomials appearing in the descriptions of the curve segments and points in the output are bounded by

    $$\begin{aligned} \max ( 1 ,D_{1} ,D_{2} )^{O ( \log ( k ) )} \big (k^{\log ( k )} d\big )^{O ( k\log ( k ) )}. \end{aligned}$$

In fact we prove the following more technical result.

We need the following definition.

Definition 1.3

A semi-algebraic set \(S \subset \mathrm{R}^{ k}\) is strongly of dimension \(\le \ell \) if for every \(y\in \mathrm{R}^\ell \), \(S_y=\{x\in S\mid \pi _{[1,\ell ]}(x)=y\}\) is finite (possibly empty), where \(\pi _{[1,\ell ]}\) denotes the projection to the first \(\ell \) coordinates. (Note that the notion of being strongly of dimension \(\le \ell \) is not invariant under arbitrary change of coordinates. However, if a semi-algebraic set \(S\subset \mathrm{R}^k\) is strongly of dimension \(\le \ell \), then any semi-algebraic subset of \(S\) is strongly of dimension \(\le \ell \).)

Theorem 1.4

Let \(\mathrm{R}\) be a real closed field and \(\hbox {D}\subset \mathrm{R}\) an ordered domain. Then the following holds. There exists an algorithm that takes as input:

  1. (1)

    a polynomial \(P \in \hbox {D}[ X_{1} , \ldots ,X_{{ k}} ]\), with \(\deg ( P ) \le d\) such that \(V= {\mathrm{{Zer}}} ( P, \mathrm{R}^{{ k}} )\) is bounded and strongly of dimension \(\le k'\),

  2. (2)

    a finite set, \(A\), of real univariate representations whose associated set of points, \(\mathcal {A} = \{ p_{1} , \ldots ,p_{m} \}\), is contained in \(V\), and such that the degree of the real univariate representation representing \(p_{i}\) is bounded by \(D_{i}\) for \(1 \le i \le m\);

and computes a roadmap of \(V\) containing \(\mathcal {A}\). The complexity of the algorithm is bounded by

$$\begin{aligned} \Big ( 1+ \sum \limits _{i=1}^{m} D_{i}^{O ( \log ^{2} ( k') )}\Big ) \big (k^{\log (k')} d\big )^{O ( k\log ^{2} ( k' ) )}. \end{aligned}$$

The size of the output is bounded by \(( \hbox {card} ( \mathcal {A} ) + 1 ) ( k^{\log ( k' )} d )^{O ( k\log ( k' ) )}\), while the degrees of the polynomials appearing in the descriptions of the curve segments and points in the output are bounded by

$$\begin{aligned} \Big ( \mathop {\max }\limits _{1 \le i \le m}D_{i} \Big )^{O ( \log ( k') )} \big (k^{\log ( k' )} d \big )^{O ( k\log ( k') )}. \end{aligned}$$

The bounds on the complexity of the roadmap given in Theorem 1.2 give an upper bound on the length of a semi-algebraic curve required to connect two points in the same connected component of a real algebraic variety in \(\mathbb {R}^{k}\). In [7], the authors proved that the geodesic diameter of any connected component \(C\) of a real algebraic variety in \(\mathbb {R}^{k}\) defined by a polynomial of degree \(d\) and contained inside the unit ball in \(\mathbb {R}^{k}\), is bounded by \(( O ( d ) )^{k-1}\). This result guarantees the existence of a semi-algebraic path connecting any two points in \(C\) of length bounded by \(( O ( d ) )^{k-1}\). Unfortunately, the complexity of this path (namely, the number and degrees of the polynomials needed to define it) is not uniformly bounded as a function of \(k\) and \(d\). We obtain a path of length bounded by \(( k ^{\log (k )} d )^{O ( k\log ( k ) )}\), but moreover with uniformly bounded complexity. We have the following theorem.

Theorem 1.5

Let \(V \subset \mathbb {R}^{k}\) be a real algebraic variety defined by a polynomial of degree at most \(d\), and let \(C\) be a connected component of \(V\) contained in the unit ball centered at the origin. Then any two points \(x,y \in C\) can be connected inside \(C\) by a semi-algebraic path of length at most \(( k ^{\log (k )} d )^{O ( k\log ( k ) )}\) consisting of at most \(( k ^{\log (k )} d )^{O ( k\log ( k ) )}\) curve segments of degrees bounded by \(( k ^{\log ( k )} d )^{O ( k \log ( k) )}\).

Note that the algebraic case dealt with in this paper is usually the main building block in designing roadmap algorithms for more general semi-algebraic sets (see for example Chapter 16 in [2]). We believe that with extra effort, the improvement in the algebraic case reported here could lead to a corresponding improvement in the general semi-algebraic setting.

We prove Theorem 1.2 by giving a divide-and-conquer algorithm for computing a roadmap based on two recursive calls to subvarieties whose dimensions are at most half the dimension on the given variety \(V\) (see Algorithms 6 and 9 in Sect. 7 below).

Such a divide-and-conquer roadmap algorithm would be quite simple if it was the case that the sub-varieties of \(V\) obtained by iterating the following two operations in any order:

  1. (1)

    taking the sub-variety consisting of the set of critical points of \(G\), for some polynomial \(G \in \hbox {D}[ X_{1} , \ldots ,X_{{ k}} ]\), restricted to the fibers, \(V_{y} =V \cap \pi ^{-1} ( \{ y \} )\), where \(\pi \) is a projection map to a subset of the coordinates (see Definition 2.3 below for a precise definition of critical points of \(G\) restricted to the fibers of \(V\));

  2. (2)

    fixing a subset of coordinates (i.e., taking fibers of \(V\));

had good properties, e.g. the number of critical points of \(G\) remains finite as the parameters vary.

Suppose for simplicity that \(k-1\) is a power of \(2\). Then, the following simple algorithm for constructing a roadmap would work, namely, in the very first step consider the projection map, \(\pi \), to the first \(p/2\) coordinates, where \(p=\dim ( V ) =k-1\). For every \(y \in \mathrm{R}^{p/2}\), let \(V_{y} =V \cap \pi ^{-1} ( \{ y \} )\) be the corresponding fiber and let \(V_{y}^{0} \subset V_{y}\) be the set of critical points of \(G\) restricted to \(V_{y}\) and \(V^{0} = \bigcup _{y \in \mathrm{{R}}^{p/2 }} V_{y}^{0}\). Let \(\mathcal {M} \subset V\) be the set of \(G\)-critical points of \(V\), and \(\mathcal {M}^{0}\) the (assumed finite) \(G\)-critical points of \(V^{0}\). Let \(\mathcal {N} =\pi ( \mathcal {M} \cup \mathcal {M}^{0} )\). It can be proved that a roadmap of \(V\) can be obtained by taking the union of

  • a roadmap of \(V^{0}\) containing \(V^{0}_{\mathcal {N}}\),

  • and roadmaps of \(V_{y}\), containing the points of \(V^{0}\) above for \(y \in \mathcal {N}\).

Both \(V^{0}\) and the \(V_{y}\) , \(y \in \mathcal {N}\), are of dimension \(p/2\). If \(p/2=1\), then the roadmaps of \(V^{0}\) and the \(V_{y}\), \(y \in \mathcal {N}\), coincide with themselves. Otherwise, these roadmaps can then be computed by recursive calls to the same algorithm.

The description given above, which we are using as a guide, is flawed in a fundamental way. We know of no way to ensure that all the intermediate varieties that occur in the course of the algorithm have good properties even if the original variety \(V\) has them.

In order to get around this difficulty we use perturbation techniques, in the spirit of several other prior works on computing roadmaps. The main difficulty is to ensure that good properties are preserved for the variety \(V^{0}\) as we go down in the recursion.

In the divide-and-conquer scheme pursued in this paper, it is imperative, for complexity reasons, that \(V^{0}\) and the fibers \(V_{y}\) have the same dimension (namely, \(\tfrac{1}{2} \dim ( V )\)). So we cannot resort to the classical roadmap algorithm for \(V^{0}\) any more and we need to ensure good properties for \(V^{0}\) (which is no more an hypersurface even if \(V\) is) as well.

While the general principle—that of making perturbations to reach an ideal situation—is similar to that used in [3] for the Baby-step Giant-step algorithm for computing roadmaps, there are many new ideas involved which we list below.

We start the construction with an algebraic hypersurface \(V\), defined as the zero set of one single polynomial \(P\).

  1. (1)

    We make a deformation \(\tilde{P}\) of \(P\) using an infinitesimal, and consider the algebraic set \(\tilde{V}\) defined by \(\tilde{P}\) with coefficients in a new field \(\tilde{\mathrm{R}}\) consisting of algebraic Puiseux series (with coefficients in \(\mathrm{R}\)) in this infinitesimal.

  2. (2)

    Instead of considering critical points of the projection map onto a fixed coordinate, we consider critical points of a well chosen fixed polynomial \(G \). This is done to ensure more genericity. Geometrically, we sweep using the level surfaces of the polynomial \(G\).

  3. (3)

    For every \(y \in \tilde{\mathrm{R}}^{p/2 }\), let \({\tilde{V}}^{0}_{y} \subset {\tilde{V}}_{y}\) be the set of critical points of \(G\) restricted to \({\tilde{V}}_{y}\) and \({\tilde{V}}^{0} = \bigcup _{y \in \tilde{\mathrm{R}}^{p/2 }} {\tilde{V}}_{y}^{0}\). The closed semi-algebraic set \(\tilde{V}^{0}\) is naturally described as the projection of some variety involving extra variables. This causes a problem, since we need an explicit description of \(\tilde{V}^{0}\) in order to be able to make a recursive call. We are able to express \(\tilde{V}^{0}\) as the union of several pieces (charts), each described as a basic constructible set of the form

    $$\begin{aligned} \bigwedge _{P \in \mathcal {P}} ( P=0 ) \wedge \left( Q \ne 0 \right) . \end{aligned}$$
  4. (4)

    The preceding decomposition of \(\tilde{V}^{0}\) into open charts is not very easy to use, so we modify the description using instead closed sets (by shrinking slightly the constructible sets). We are able to cover (an approximation of) \(\tilde{V}^{0}\) by basic semi-algebraic sets of the form

    $$\begin{aligned} \bigwedge _{P \in \mathcal {P}} ( P=0 ) \wedge ( Q \ge 0 ) . \end{aligned}$$
  5. (5)

    This necessitates that in our recursive calls we accept as inputs not just varieties, but basic semi-algebraic sets of a certain special form having only a few inequalities in their definitions.

  6. (6)

    The Morse-theoretical connectivity results needed to prove the correctness of the new algorithms have to be extended to take into account the two new features mentioned above. The first new feature is that instead of considering projection map to a fixed coordinate, we are using the polynomial \(G\) as the “Morse function”. Secondly, instead of varieties we need to deal with more general semi-algebraic sets. We define a new variant of the notion of “pseudo-critical values” introduced in [2] which is applicable to the semi-algebraic case and which takes into account the polynomial \(G\), and prove the required Morse theoretical lemmas in this new setting.

  7. (7)

    The covering mentioned in (4) above means that we are replacing each semi-algebraic set, by several basic semi-algebraic sets, the union of whose limits coincides with the given set. In order that the union of the limits of the roadmaps computed for each of the new sets gives a roadmap of the original one, we need to make sure that the roadmaps of the new sets contain certain carefully chosen points. Very roughly speaking these points will correspond to a finite number of pairs of closest points realizing the locally minimal distance between any two semi-algebraically connected components of the new sets.

  8. (8)

    The construction involves a perturbation using four infinitesimals at each level of the recursion. Since there will be at most \(O ( \log ( k' ) )\) levels, at the end we will be doing computations in a ring with \(O ( \log ( k' ) )\) infinitesimals. At the end of the algorithm we will need to compute descriptions of the limits of the semi-algebraic curves computed in the previous steps of the algorithm. We show that these limits can be computed within the claimed complexity bound. For this the fact that we have only \(O ( \log ( k' ) )\) infinitesimals, and not more, is crucial.

The rest of the paper is organized as follows. In Sect. 2, we state some basic results of Morse theory for non-singular varieties of higher codimension, including definitions of critical points on basic semi-algebraic sets and their properties.

In Sect. 3, we prove the connectivity results that we will require. We introduce a set of axioms (to be satisfied by a basic semi-algebraic set \(S\) and certain subsets of \(S\)) and prove an abstract connectivity result (Proposition 3.4) which forms the basis of the roadmap algorithm in this paper. The main differences between Proposition 3.4 and a similar result in [3, Proposition 3] are that Proposition 3.4 applies to basic semi-algebraic sets (not just to algebraic hypersurfaces), and that there is an auxiliary polynomial \(G\) which plays the role of the \(X_{1}\)-coordinate in [3].

In Sect. 5, we discuss certain specific infinitesimal deformations that we will use in order to ensure that the properties defined in Sect. 3 hold. In Sect. 4, we explain a deformation technique to reach general position and prove that the set of \(G\)-critical points is finite for a certain well chosen polynomial \(G\). The techniques used in this section are adapted from [15]. In Sect. 4.2, we define a new notion of pseudo-critical values for semi-algebraic sets with respect to a given polynomial \(G\) and state their connectivity properties, generalizing to this new context results from [2]. In Sect. 5, we discuss how the deformations are used to ensure the connectivity properties defined in Sect. 3.

Section 6 is devoted to a description of the set of \(G\)-critical points using minors of certain Jacobian matrices and the properties of the set of \(G\)-critical points.

Section 7 is devoted to the description of the Divide and Conquer Roadmap Algorithm. We first define the tree that is computed, explain how it gives a roadmap, and finally describe the Divide and Conquer Algorithm first for the bounded case (Algorithm 8), and then in general (Algorithm 9).

In the Annex (Sect. 8), we include certain technical proofs of propositions on critical and pseudo-critical values stated in Sects. 2.2 and 4.2 and used in the paper.

2 Critical Points of Algebraic and Basic Semi-algebraic Sets

In this section we define critical points of a polynomial first on an algebraic set and then on a basic semi-algebraic set and discuss their properties.

2.1 Critical Points of Algebraic Sets

Definition 2.1

Let \(G \in \mathrm{R}[ X_{1} , \ldots ,X_{{ k}} ]\) and \(\mathcal {P} =\{ P_{1} , \ldots ,P_{m} \} \subset \mathrm{R}[ X_{1} , \ldots ,X_{{ k}} ]\) be a finite family of polynomials.

We say that \(x \in {\mathrm{{Zer}}} ( \mathcal {P}, \mathrm{R}^{{ k}} )\) is a \(G\) -critical point of \({\mathrm{{Zer}}} ( \mathcal {P}, \mathrm{R}^{{ k}} )\), if there exists \(\lambda = ( \lambda _{0} , \ldots , \lambda _{m} ) \in \mathrm{R}^{m+1}\) satisfying the system of equations \(\hbox {CritEq} ( \mathcal {P} ,G )\)

$$\begin{aligned} P_{j}&= 0,\quad j=1, \ldots ,m, \nonumber \\ \sum ^{m}_{j=1} \lambda _{j} \frac{\partial P_{j}}{\partial X_{i}} - \lambda _{0} \frac{\partial G}{\partial X_{i}}&= 0,\quad i=1, \ldots ,k,\\ \sum _{j=0}^{m} \lambda _{j}^{2} -1&= 0. \nonumber \end{aligned}$$
(1)

The set \(\hbox {Crit} ( \mathcal {P} ,G ) \subset \mathrm{R}^{{ k}}\) is the set of \(G\)-critical points of \({\mathrm{{Zer}}} ( \mathcal {P}, \mathrm{R}^{{ k}} )\), i.e., the projection on \(\mathrm{R}^{{ k}}\) of \(\hbox {Zer} \left( \hbox {CritEq} ( \mathcal {P} ,G ) , \mathrm{R}^{{ k}+{ m}+1} \right) \). Note that geometrically, in the case the polynomials \(\mathcal {P}\) define a non-singular complete intersection, \(\hbox {Crit} ( \mathcal {P} ,G )\) is the set of points \(x \in {\mathrm{{Zer}}} ( \mathcal {P}, \mathrm{R}^{{ k}} )\), such that the tangent space at \(x\) of \({\mathrm{{Zer}}} ( \mathcal {P}, \mathrm{R}^{{ k}} )\) is orthogonal to \(\hbox {grad} ( G ) ( x )\). In case \({\mathrm{{Zer}}} ( \mathcal {P}, \mathrm{R}^{{ k}} )\) is singular, then the set of \(G\)-critical points includes the set of singular points of \({\mathrm{{Zer}}} ( \mathcal {P}, \mathrm{R}^{{ k}} )\), which is clear from (1).

2.2 Critical Points of Basic Semi-algebraic Sets

Notation 2.2

Given two finite families of polynomials \(\mathcal {P},\mathcal {Q}\subset \mathrm{R}[ X_{1} , \ldots ,X_{{ k}} ]\), we denote by \(\hbox {Bas} ( \mathcal {P} , \mathcal {Q} )\) the basic semi-algebraic set defined by

$$\begin{aligned} \hbox {Bas} ( \mathcal {P} , \mathcal {Q} )=\Big \{ x\in \mathrm{R}^{{ k}} \left| \right. \bigwedge _{P \in \mathcal {P}}P ( x ) =0 \wedge \bigwedge _{Q \in \mathcal {Q}} Q ( x ) \ge 0 \Big \} . \end{aligned}$$

Definition 2.3

Let \(G \in \mathrm{R}[ X_{1} , \ldots ,X_{{ k}} ]\). We define \(\hbox {Crit} ( \mathcal {P} , \mathcal {Q} ,G )\), the set of \(G\) -critical points of \(\hbox {Bas} (\mathcal {P}, \mathcal {Q})\), by

$$\begin{aligned} \hbox {Crit} ( \mathcal {P} , \mathcal {Q} ,G ) = \hbox {Bas} ( \mathcal {P}, \mathcal {Q} ) \cap \Big ( \bigcup _{\mathcal {Q' \subset Q }} \hbox {Crit} ( \mathcal {P} \cup \mathcal {Q}' ,G ) \Big ) . \end{aligned}$$

Definition 2.4

We say that the pair \(\mathcal {P},\mathcal {Q}\) is in general position with respect to \(G \in \mathrm{R}[ X_{1} , \ldots ,X_{{ k}} ]\) if \({\mathrm{{Zer}}} (\mathcal {P}, \mathrm{R}^{{ k}})\) is bounded, and for any subset \(\mathcal {Q}' \subset ~\mathcal {Q,}\,\hbox {Crit} ( \mathcal {P \cup Q'} ,G ) \subset \mathrm{R}^{{ k}}\) is empty or finite.

Remark 2.5

Note that in this case \({\mathrm{{Zer}}} ( \mathcal {P} , \mathrm{R}^{{ k}})\) has only a finite number of singular points; moreover if \( \hbox {card}(\mathcal {P})=k\), \({\mathrm{{Zer}}} ( \mathcal {P} , \mathrm{R}^{{ k}})\) is finite (possibly empty).

The properties of \(G\)-critical points used later in the paper are now given in the following two Morse-theoretic lemmas. The proofs, which are slight variants of the classical proofs, are included in the Annex (Sect. 8).

Notation 2.6

Let \(T \subset \mathrm{R}^{{ k}}\), \(G\) a function \(\mathrm{R}^{{ k}} \longrightarrow \mathrm{R}\), and suppose that \(a \in \mathrm{R}\). We denote

$$\begin{aligned} T_{G=a}&= \{ x \in T \mid G ( x ) =a \} ,\\ T_{G \le a}&= \{ x \in T \mid G ( x ) \le a \} ,\\ T_{G<a}&= \{ x \in T \mid G ( x ) <a \} . \end{aligned}$$

Let \(\mathcal {P},\mathcal {Q}\subset \mathrm{R}[ X_{1} , \ldots ,X_{{ k}} ]\), \(S = \hbox {Bas} ( \mathcal {P} , \mathcal {Q} )\), \(S\) bounded, and \(\mathcal {M} = \hbox {Crit} ( \mathcal {P} , \mathcal {Q} ,G )\).

Lemma 2.7

Suppose that \(b \not \in \mathcal {D} =G ( \mathcal {M} )\). Let \(C\) be a semi-algebraically connected component of \(S_{G \le b}\). If \(a<b\) and \((a,b] \cap \mathcal {D}\) is empty, then \(C_{G \le a}\) is semi-algebraically connected.

Now assume that \(\mathcal {P},\mathcal {Q}\) are in general position with respect to \(G \) (cf. Definition 2.4).

Lemma 2.8

Let \(C\) be a semi-algebraically connected component of \(S_{G \le b}\) such that \(C_{G=b}\) is not empty.

  1. (1)

    If \(\dim (C) =0\), \(C\) is a point contained in \(\mathcal {M}\).

  2. (2)

    If \(\dim ( C ) \ne 0\), then \(C_{G<b}\) is non-empty. Let \(B_{1} , \ldots ,B_{r}\) be the semi-algebraically connected components of \(C_{G<b}\). Then

    1. (a)

      for each \(i,1 \le i \le r\), \(\bar{B_{i}} \cap \mathcal {M} \ne \emptyset \);

    2. (b)

      if there exist \(i,j,1 \le i<j \le r\) such that \(\bar{B_{i}} \cap \bar{B_{j}} \ne \emptyset \), then \(\bar{B_{i}} \cap \bar{B_{j}} \subset \mathcal {M}\);

    3. (c)

      \(\bigcup _{i=1}^{r} \bar{B_{i}} =C\), and hence \(\bigcup _{i=1}^{r} \bar{B_{i}}\) is semi-algebraically connected.

3 Axiomatics for Connectivity

In this subsection we identify a set of properties, to be satisfied by a basic semi-algebraic set \(\hbox {Bas} ( \mathcal {P} , \mathcal {Q} )\), a polynomial \(G\), and certain finite subsets of points contained in \(\hbox {Bas} ( \mathcal {P} , \mathcal {Q} )\), and prove a key connectivity result (Proposition 3.4 below) for such a situation, which plays a key role in our recursive algorithm later. In Sect. 5 we will explain how to use a perturbation technique to reach the ideal situation described here.

Notation 3.1

Let \(\pi _{[ 1, \ell ]}\) be the projection map from \(\mathrm{R}^{{ k}}\) to \(\mathrm{R}^{\ell }\) forgetting the last \(k- \ell \) coordinates. For every \(T \subset \mathrm{R}^{{ k}}\) and \(A \subset \mathrm{R}^{\ell }\), we denote \(T_{A} = T \cap \pi _{[ 1, \ell ]}^{-1} ( A )\). For \( w \in \mathrm{R}^{\ell }\), we denote \(T_{w} = T \cap \pi _{[ 1, \ell ]}^{-1} ( \{ w \} )\).

Definition 3.2

Let \(1\le \ell <k\), \(G\in \mathrm{R}[ X_{1} , \ldots ,X_{{ k}} ]\), and let \(\mathcal {P},\mathcal {Q} \subset \mathrm{R}[ X_{1} , \ldots ,X_{{ k}} ]\) be in general position with respect to \(G\). Let \(S = \hbox {Bas} ( \mathcal {P} , \mathcal {Q} )\), and suppose that \(S\) is bounded.

We say that a tuple \((S, \mathcal {M,} \ell ,S^{0},\mathcal {D}^{0},\mathcal {M}^{0})\) is special if it satisfies the following Properties 1, 2, 3, and 4.

  1. (1)

    \(\mathcal {M} = \hbox {Crit} ( \mathcal {P} , \mathcal {Q} ,G )\) is the finite set of critical points of \(G\) on \(S\).

  2. (2)

    \(S^{0} \subset S\) is a semi-algebraic set strongly of dimension \(\le \ell \) such that for every \(w\in \mathrm{R}^{\ell }\), \(S^{0}_{w}\) meets every semi-algebraically connected component of \(S_{w}\), and for each semi-algebraically connected component \(C\) of \(S_{w}\), \(S^{0}_{w}\) contains a minimizer of \(G\) over \(C\).

  3. (3)

    \(\mathcal {D}^{0} \subset \mathrm{R}\) is a finite set of values satisfying for every interval \([ a,b ] \subset \mathrm{R}\) and \(c\in [ a,b ]\), with \(\{ c \} \supset \mathcal {D}^{0} \cap [ a,b ]\), if \(D\) is a semi-algebraically connected component of \(S^{0}_{a \le G \le b}\), then \(D_{G=c}\) is a semi-algebraically connected component of \(S^{0}_{G=c}\).

  4. (4)

    \(\mathcal {M}^{0} \subset S^{0}\) is a finite set of points satisfying the following properties:

    1. (a)

      \(G ( \mathcal {M}^{0} )\)=\(\mathcal {D}^{0}\),

    2. (b)

      \(\mathcal {M}^{0}\) meets every semi-algebraically connected component of \(S^{0}_{G=a}\) for all \(a\in \mathcal {D}^{0}\).

Definition 3.3

For a semi-algebraic subset \(S \subset T\), we say that \(S\) has good connectivity property with respect to \(T\), if the intersection of \(S\) with every semi-algebraically connected component of \(T\) is non-empty and semi-algebraically connected.

With the definition introduced above we have the following key result which generalizes Proposition 3 in [3] (see also Theorem 14 in [8]).

Proposition 3.4

Let \( ( S, \mathcal {M, \ell ,} S^{0} ,\mathcal {D}^{0} ,\mathcal {M}^{0} )\) be a special tuple. Then, for every finite \(\mathcal {N }\supset \pi _{[ 1, \ell ]} ( M \cup M^{0} )\), the semi-algebraic set \(S^{0} \cup S_{\mathcal {N}}\) has good connectivity property with respect to \(S\).

In the proof of Proposition 3.4 we will use the following notation.

Notation 3.5

If \(S \subset \mathrm{R}^{{ k}}\) is semi-algebraic set and \(x \in S\), then we denote by \(\mathrm{Cc}(x,S)\) the semi-algebraically connected component of \(S\) containing \(x\).

Notation 3.6

Given a real closed field \(\mathrm{R}\) and a variable \(\varepsilon \), we denote by \(\mathrm{R}\langle \varepsilon \rangle \) the real closed field of algebraic Puiseux series (see [2]). In the ordered field \(\mathrm{R}\langle \varepsilon \rangle \), \(\varepsilon \) is positive and infinitesimal, i.e., smaller than any positive element of \(\mathrm{R}\). We denote by \(\lim _{\varepsilon }\) the mapping which sends a bounded Puiseux series to its constant term.

Notation 3.7

If \(\mathrm{R}'\) is a real closed extension of a real closed field \(\mathrm{R}\), and \(S \subset \mathrm{R}^{{ k}}\) is a semi-algebraic set defined by a first-order formula with coefficients in \(\mathrm{R}\), then we will denote by \(\hbox {Ext}\left( S, \mathrm{R}' \right) \subset \mathrm{R}'^{{ k}}\) the semi-algebraic subset of \(\mathrm{R}'^{{ k}}\) defined by the same formula. It is well known that \(\hbox {Ext}\left( S, \mathrm{R}' \right) \) does not depend on the choice of the formula defining \(S\) (see [2] for example).

Proof of Proposition 3.4

Let \(S^{1}=S_{\pi _{[ 1, \ell ]} ( \mathcal {M} \cup \mathcal {M}_{0})}\). We are going to prove that \(S^{0} \cup S^{1}\) has good connectivity property with respect to \(S\), which implies the proposition.

For \(a\) in \(\mathrm{R}\), we say that property \(\hbox {GCP} (a)\) holds if \(( S^{0} \cup S^{1} )_{G \le a}\) has good connectivity property with respect to \(S\).

We prove that for all \(a\) in \(\mathrm{R}\), \(\hbox {GCP} (a)\) holds. Since \(S\) is assumed to be bounded, the proposition follows immediately from this claim, since it is clear that the proposition follows from \(\hbox {GCP} ( a )\) for any \(a \ge \max _{x \in S}G (x)\).

The proof uses two intermediate results:

Step 1 :

For every \(a \in \mathcal {D} \cup \mathcal {D}^{0}\), and for every \(b \in \mathrm{R}\) with \((a,b] \cap \mathcal {( D \cup D^{0} )} = \emptyset \), \( \hbox {GCP} (a)\) implies \(\hbox {GCP} ( b )\).

Step 2 :

For every \(b \in \mathcal {D \cup D^{0}}\), if \( \hbox {GCP} (a)\) holds for all \(a<b\), then \( \hbox {GCP} (b)\) holds.

The combination of Steps 1 and 2 implies by an easy induction that the property \(\hbox {GCP} (a)\) holds for all \(a\) in \(\mathrm{R}\), since for \(a< \min _{x \in S} ( G ( x) )\), the property \( \hbox {GCP} (a)\) holds vacuously. So the proposition follows from Steps 1 and 2.

We now prove the two steps.

Step 1 We suppose that \(a \in \mathcal {D \cup D^{0}}\) and \( \hbox {GCP} (a)\) holds, take \(b \in \mathrm{R}\), \(a<b\) with \((a,b] \cap \mathcal {( D \cup D^{0} )} = \emptyset \), and prove that \(\hbox {GCP} (b)\) holds. Let \(C\) be a semi-algebraically connected component of \(S_{G \le b}\). We have to prove that \(C \cap ( S^{0} \cup S^{1} )\) is semi-algebraically connected.

Since \((a,b] \cap \mathcal {( D \cup D^{0} )} = \emptyset \), it follows that \(\mathcal {M}_{a< G \le b} = \emptyset \), and it follows from Lemma 2.7 that \(C_{G \le a}\) is a semi-algebraically connected component of \(S_{G \le a}\). Now, using property \(\hbox {GCP} (a)\), we see that \(C_{G \le a} \cap ( S^{0} \cup S^{1} )\) is non-empty and semi-algebraically connected.

Let \(x \in C \cap ( S^{0} \cup S^{1} )\). We prove that \(x\) can be semi-algebraically connected to a point in \(C_{G \le a} \cap S^{0}\) by a semi-algebraic path in \(C \cap ( S^{0} \cup S^{1} )\), which is enough to prove that \(C \cap ( S^{0} \cup S^{1} )\) is semi-algebraically connected.

There are three cases to consider.

Case 1 \(x \in S^{1}\). In this case, consider \(\mathrm{Cc}( x,S_{\pi _{[ 1, \ell ]} ( x )} )= \mathrm{Cc}( x,S^{1}_{\pi _{[ 1, \ell ]} ( x )} )\). Then, by Definition 3.2, Part (2), there exists \(x' \in \mathrm{Cc}( x,S_{\pi _{[ 1,q ]} ( x )} ) \cap S^{0}\) such that \(x'\) is a minimizer of \(G\) over \(\mathrm{Cc}( x,S_{\pi _{[ 1, \ell ]} ( x )} )\) i.e.,

$$\begin{aligned} G( x' ) = \min _{x'' \in \mathrm{Cc}( x,S_{\pi _{[ 1, \ell ]} ( x )} )} G ( x''). \end{aligned}$$

In particular, \(x' \in \mathrm{Cc}( x,S^{0}_{G \le b} ) \subset C\). Connecting \(x\) to \(x'\) by a semi-algebraic path inside \(\mathrm{Cc}( x,S^{1}_{\pi _{[ 1, \ell ]} ( x )} )\) we reduce either to Cases 2 or 3 below.

Case 2 \(x \in S^{0} \), \(G ( x ) \le a\). In this case there is nothing to prove.

Case 3 \(x \in S^{0}\), \(G ( x )>a\). By Definition 3.2, Part (3) applied to \(\mathrm{Cc}(x,S^{0}_{a \le G \le b} )\) we have that \(a \in G ( \mathrm{Cc}(x,S^{0}_{a \le G \le b} ))\) and \(\mathrm{Cc}(x,S^{0}_{a \le G \le b} )_{G=a}\) is non-empty. Hence, there exists a semi-algebraic path connecting \(x\) to a point in \(\mathrm{Cc}(x;S^{0}_{a \le G \le b} )_{G=a}\) inside \(\mathrm{Cc}(x,S^{0}_{a \le G \le b} )\). Since \(\mathrm{Cc}(x,S^{0}_{a \le G \le b} ) \subset S^{0}\) and \(\mathrm{Cc}(x,S^{0}_{a \le G \le b} ) \subset C\), it follows that \(\mathrm{Cc}(x,S^{0}_{a \le G \le b} ) \subset C \cap S^{0}\) and we are done.

This finishes the proof of Step 1.

Step 2 We suppose that \(b \in \mathcal {D \cup D^{0}}\), and \( \hbox {GCP} (a)\) holds for all \(a<b\), and prove that \( \hbox {GCP} (b)\) holds.

Let \(C\) be a semi-algebraically connected component of \(S_{G \le b}\).

If \(\dim (C) =0\), \(C\) is a point belonging to \(\mathcal {M} \subset ( S^{0} \cup S^{1} )\) by Lemma 2.8. So \(C \cap ( S^{0} \cup S^{1} )\) is semi-algebraically connected.

Hence, we can assume that \(\dim (C) >0\). If \(C_{G=b} = \emptyset \) there is nothing to prove. Suppose that \(C_{G=b}\) is non-empty, so that \(C_{G<b}\) is non-empty by Lemma 2.8.

Our aim is to prove that \(C \cap ( S^{0} \cup S^{1} )\) is semi-algebraically connected. We do this in two steps. We prove the following statements:

(a):

if \(B\) is a semi-algebraically connected component of \(C_{G<b}\), then \(\bar{B} \cap ( S^{0} \cup S^{1} )\) is non-empty and semi-algebraically connected, and

(b):

using (a) \(C \cap ( S^{0} \cup S^{1} )\) is semi-algebraically connected.

Proof of (a) We prove that if \(B\) is a semi-algebraically connected component of \(V_{G<b}\), then \(\bar{B} \cap ( S^{0} \cup S^{1} )\) is non-empty and semi-algebraically connected.

Since \(\bar{B}\) contains a point of \(\mathcal {M}\) it follows that \(\bar{B} \cap ( S^{0} \cup S^{1} )\) is not empty.

Note that if \(\bar{B} \cap ( S^{0} \cup S^{1} ) =B \cap ( S^{0} \cup S^{1} )\), then there exists \(a\) with

$$\begin{aligned} \max \big (\big \{G(x) \mid x \in B \cap \big ( S^{0} \cup S^{1} \big )\big \}\big ) <a<b, \end{aligned}$$

such that \(B \cap ( S^{0} \cup S^{1} ) = (B \cap ( S^{0} \cup S^{1}) )_{G \le a}\), and using Lemma 2.7, \(B_{G \le a}\) is semi-algebraically connected. So \(B \cap ( S^{0} \cup S^{1} )\) is semi-algebraically connected since \(\hbox {GCP} (a)\) holds.

We now suppose that \(( \bar{B} \setminus B) \cap ( S^{0} \cup S^{1} )\) is non-empty. Taking \(x \in ( \bar{B} \setminus B) \cap ( S^{0} \cup S^{1} )\), we are going to show that \(x\) can be connected to a point \(z\) in \(B \cap S^{0}\) by a semi-algebraic path \(\gamma \) inside \(\bar{B} \cap ( S^{0} \cup S^{1} )\). Notice that \(G (x) =b\).

We first prove that we can assume without loss of generality that \(x \in S_{0}\). Otherwise, since \(x \in S^{0} \cup S^{1}\), we must have that \(x \in S_{w}\) with \(w= \pi _{[1, \ell ]} (x)\) and \(S_{w} \subset S^{ 1}\). Let \(A= \mathrm{Cc}(x,S_{w} \cap \bar{B} )\). We now prove that \(A \cap S^{0}_{w} \ne \emptyset \). Using the curve section lemma, choose a semi-algebraic path \(\gamma : [0, \varepsilon ] \rightarrow \hbox {Ext}( \bar{B} , \mathrm{R}\left\langle \varepsilon \right\rangle )\) such that \(\gamma (0) =x\), \(\lim _{\varepsilon } \gamma ( \varepsilon ) =x\) and \(\gamma ((0, \varepsilon ]) \subset \hbox {Ext}(B, \mathrm{R}\left\langle \varepsilon \right\rangle )\). Let \(w_{\varepsilon } = \pi _{[1, \ell ]} ( \gamma ( \varepsilon ))\) and

$$\begin{aligned} A_{\varepsilon } = \mathrm{Cc}( \gamma ( \varepsilon ), \hbox {Ext}\big (B, \mathrm{R}\left\langle \varepsilon \right\rangle )_{w_{\varepsilon }} \big ) . \end{aligned}$$

Note that \(x \in \lim _{\varepsilon }A_{\varepsilon } \subset A\).

By the Tarski–Seidenberg transfer principle [2], \(\hbox {Ext}(B, \mathrm{R}\left\langle \varepsilon \right\rangle )\) is a semi-algebraically connected component of \( \hbox {Ext}(S_{G<a} , \mathrm{R}\left\langle \varepsilon \right\rangle )\) which implies that \(A_{\varepsilon }\) is a semi-algebraically connected component of \(\hbox {Ext}(S, \mathrm{R}\left\langle \varepsilon \right\rangle )_{w_{\varepsilon }}\). By Definition 3.2, Part (2), and the Tarski–Seidenberg transfer principle,

$$\begin{aligned} \hbox {Ext}\big (S^{0} , \mathrm{R}\left\langle \varepsilon \right\rangle \big )_{w_{\varepsilon }} \cap A_{\varepsilon } \ne \emptyset . \end{aligned}$$

Then since \(\hbox {Ext}(S^{0} , \mathrm{R}\left\langle \varepsilon \right\rangle )_{w_{\varepsilon }} \cap A_{\varepsilon }\) is bounded over \(\mathrm{R}\),

$$\begin{aligned} \lim _{\varepsilon } ( \hbox {Ext}(S^{0} , \mathrm{R}\left\langle \varepsilon \right\rangle )_{w_{\varepsilon }} \cap A_{\varepsilon } ) \end{aligned}$$

is a non-empty subset of \(S^{0}_{w} \cap A\).

Now connect \(x\) to a point in \(x' \in S^{0}_{w}\) by a semi-algebraic path whose image is contained in \(A \subset \bar{B}_{w} \subset ( \bar{B} \setminus B) \cap ( S^{0} \cup S^{1} )\) such that \(x'\) is a minimizer of \(G\) on \(A\). If \(G ( x' ) <b\), take \(z=x'\). Otherwise, replacing \(x\) by \(x'\) if necessary we can assume that \(x \in S^{0}\) as announced.

There are four cases—namely,

  1. (1)

    \(x \in \mathcal {M} \cup \mathcal {M}^{0}\);

  2. (2)

    \(x \not \in \mathcal {M} \cup \mathcal {M}^{0}\) and \(\mathrm{Cc}\big (x,S^{0}_{G=b} \big )\bar{B}\);

  3. (3)

    \(x \not \in \mathcal {M} \cup \mathcal {M}^{0}\), \(\mathrm{Cc}\big (x,S^{0}_{G=b} \big ) \subset \bar{B}\) and \(b \in \mathcal {D}^{0}\);

  4. (4)

    \(x \not \in \mathcal {M} \cup \mathcal {M}^{0}\), \(\mathrm{Cc}\big (x,S^{0}_{G=b} \big ) \subset \bar{B}\) and \(b \not \in \mathcal {D}^{0}\);

that we consider now.

  1. (1)

    \(x \in \mathcal {M} \cup \mathcal {M}^{0}\):

    Define \(w= \pi _{[1, \ell ]} (x)\), and note that \(S_{y} \subset ( S^{0} \cup S^{1} )\). Since \(x \in \bar{B}\), and \(B\) is bounded, \(w \in \pi _{[1, \ell ]} ( \bar{B} ) = \bar{\pi _{[1, \ell ]} (B)}\). Now let \(\varepsilon >0\) be an infinitesimal. By applying the curve selection lemma to the set \(B\) and \(x \in \bar{B}\), we obtain that there exists \(x_{\varepsilon } \in \hbox {Ext}\left( B, \mathrm{R}\langle \varepsilon \rangle \right) \) with \(\lim _{\varepsilon } x_{\varepsilon } =x\), \(G (x_{\varepsilon } ) <G (x)\) and \(x \in \lim _{\varepsilon } \hbox {Ext}(S, \mathrm{R}\langle \varepsilon \rangle )_{w_{\varepsilon }}\), where \(w_{\varepsilon } = \pi _{[1, \ell ]} \left( x_{\varepsilon } \right) \). By Definition 3.2, Part (2), and the Tarski–Seidenberg transfer principle, we have that \(\hbox {Ext}(S^{0} , \mathrm{R}\langle \varepsilon \rangle )_{w_{\varepsilon }}\) is non-empty, and contains a minimizer of \(G\) over \(\mathrm{Cc}\left( x_{\varepsilon } , \hbox {Ext}\left( S, \mathrm{R}\langle \varepsilon \rangle \right) _{w_{\varepsilon }} \right) \). Let

    $$\begin{aligned} x'_{\varepsilon } \in \hbox {Ext}\big (S^{0} , \mathrm{R}\langle \varepsilon \rangle )_{w_{\varepsilon }} \cap \mathrm{Cc}(x_{\varepsilon } , \hbox {Ext}(B, \mathrm{R}\left\langle \varepsilon \right\rangle )_{w_{\varepsilon }} \big ) \end{aligned}$$

    be such a minimizer and let \(x' = \lim _{\varepsilon }x'_{\varepsilon }\). Notice that \(G \left( x_{\varepsilon } \right) < G ( x )\). Since \(\lim _{\varepsilon }x_{\varepsilon } =x\) and \(\lim _{\varepsilon } \mathrm{Cc}(x_{\varepsilon } , \hbox {Ext}(B, \mathrm{R}\left\langle \varepsilon \right\rangle )_{w_{\varepsilon }} )\) is semi-algebraically connected,

    $$\begin{aligned} \lim _{\varepsilon } \mathrm{Cc}\big (x_{\varepsilon } , {\hbox {Ext}} {(B, \mathrm{R}\left\langle \varepsilon \right\rangle )_{w_{\varepsilon }}} \big ) \subset {\mathrm{Cc}} \big (x, {\bar{B}}_{w} \big ) . \end{aligned}$$

    Now choose a semi-algebraic path \(\gamma _{1}\) connecting \(x\) to \(x'\) inside \(\mathrm{Cc}(x, \bar{B}_{w} )\) (and hence inside \(S^{0} \cup S^{1}\) since \(\mathrm{Cc}(x, \bar{B}_{w} ) \subset S_{w} \subset S^{0} \cup S^{1}\)), and a semi-algebraic path \(\gamma _{2} ( \varepsilon )\) joining \(x'\) to \(x'_{\varepsilon }\) inside \(\hbox {Ext}(S^{0} , \mathrm{R}\langle \varepsilon \rangle )\). The concatenation of \(\gamma _{1} , \gamma _{2} ( \varepsilon )\) gives a semi-algebraic path \(\gamma \) having the required property, after replacing \(\varepsilon \) in \(\gamma _{2} ( \varepsilon )\) by a small enough positive element of \(t \in \mathrm{R}\). Now take \(z =\gamma _{2} ( t )\).

  2. (2)

    \(x \not \in \mathcal {M} \cup \mathcal {M}^{0}\) and \(\mathrm{Cc}(x,S^{0}_{G=b} )\bar{B}\):

    There exists \(x' \in \mathrm{Cc}(x,S^{0}_{G=b} )\), \(x' \not \in \bar{B}\) and a semi-algebraic path \(\gamma : [0,1] \rightarrow \mathrm{Cc}(x,S^{0}_{G=b} )\), with \(\gamma (0) =x, \gamma (1) =x'\). Since \(x' \not \in \bar{B}\), it follows from Lemma 2.8 (2) that for \(t_{1} = \max \{0 \le t<1{\mid }\gamma (t) \in \bar{B} \}\), \(\gamma (t_{1} ) \in \mathcal {M}\). We can now connect \(x\) to a point in \(z\in B \cap S^{0}\) by a semi-algebraic path inside \(\bar{B} \cap ( S^{0} \cup S^{1} )\) using what has been already proved in Case (1) above.

  3. (3)

    \(x \not \in \mathcal {M} \cup \mathcal {M}^{0}\), \(\mathrm{Cc}(x,S^{0}_{G=b} ) \subset \bar{B}\) and \(b \in \mathcal {D}^{0}\): Since \(b \in \mathcal {D}^{0}\), by Definition 3.2, Part (4b) there exists \(x' \in \mathrm{Cc}(x,S^{0}_{G=b} ) \cap \mathcal {M}^{0}\). Thus, there exists a semi-algebraic path connecting \(x\) to \(x' \in \mathcal {M}_{0}\) with image contained in \(\bar{B} \cap ( S^{0} \cup S^{1} )\). We can now connect \(x'\) to a point in \(z \in B \cap S^{0}\) by a semi-algebraic path inside \(\bar{B} \cap ( S^{0} \cup S^{1} )\) using what has been already proved in Case (1) above.

  4. (4)

    \(x \not \in \mathcal {M} \cup \mathcal {M}^{0}\), \(\mathrm{Cc}(x,S^{0}_{G=b} ) \subset \bar{B}\) and \(b \not \in \mathcal {D}^{0}\):

    Since \(b \not \in \mathcal {D}_{0}\), for all \(a<b\) such that \([a,b] \cap \mathcal {D}_{0} = \emptyset \), \(\mathrm{Cc}(x,S^{0}_{a \le G \le b} )_{G=b} = \mathrm{Cc}(x,S^{0}_{G=b} )\) and \(\mathrm{Cc}(x,S^{0}_{a \le G \le b} )_{G=a} \ne \emptyset \) by Definition 3.2, Part (3). Let \(x' \in \mathrm{Cc}(x,S^{0}_{a \le G \le b} )_{G=a}\). We can choose a semi-algebraic path \(\gamma : [0,1] \rightarrow \mathrm{Cc}(x,S^{0}_{a \le G \le b} )\) with \(\gamma (0)\! =\!x, \gamma (1) \!=x'\). Let \(t_{1} \!=\! \max \{0 \!\le \! t\!<\!1 \mid \gamma (t) \!\in \! S^{0}_{G=b}\}\). Then either \(\gamma (t_{1} ) \in \mathcal {M}\) and we can connect \(\gamma (t_{1} )\) to a point in \(B \cap ( S^{0} \cup S^{1} )\) by a semi-algebraic path inside \(\bar{B} \cap ( S^{0} \cup S^{1} )\) using Case (1); otherwise, by Lemma 2.8 (2b), for all small enough \(r>0\), \(B_{k} ( \gamma (t_{1} ),r) \cap C_{G<b}\) is non-empty and contained in \(B\). Then, there exists \(t_{2} \in (t_{1} ,1]\) such that \(z= \gamma (t_{2} ) \in B \cap S^{0}\), and the semi-algebraic path \(\gamma |_{[0,t_{2} ]}\) gives us the required path in this case.

Taking \(x\) and \(x'\) in \(\bar{B} \cap ( S^{0} \cup S^{1} )\), they can be connected to points \(z\) and \(z'\) in \(B \cap S_{0}\) by semi-algebraic paths \(\gamma \) and \(\gamma '\) inside \(\bar{B} \cap ( S^{0} \cup S^{1} )\) such that, without loss of generality, \(G (z) =G (z' ) =a\). Using \(\hbox {GCP} (a)\), we conclude that \(\hbox {GCP} (b)\) holds.

Proof of (b). We have to prove that \(C \cap ( S^{0} \cup S^{1} )\) is semi-algebraically connected.

Let \(x\) and \(x'\) be in \(C \cap ( S^{0} \cup S^{1} )\). We prove that it is possible to connect them by a semi-algebraic path inside \(C \cap ( S^{0} \cup S^{1} )\).

Since we suppose that \(\dim (C) >0\), \(C_{G<b}\) is non-empty by Lemma 2.8 (2c). Using Lemma 2.8 (2c), let \(B_{i}\) (resp. \(B_{j}\)) be a semi-algebraically connected component of \(C_{<b}\) such that \(x \in \bar{B_{i}}\) (resp. \(x' \in \bar{B_{j}}\)).

If \(i=j\), \(x\) and \(x'\) both lie in \(\bar{B}_{i} \cap ( S^{0} \cup S^{1} )\) which is semi-algebraically connected by (a). Hence, they can be connected by a semi-algebraically connected path in \(\bar{B}_{i} \cap ( S^{0} \cup S^{1} ) \subset C \cap ( S^{0} \cup S^{1} )\).

So let us suppose that \(i \ne j\). Note that:

  • by Lemma 2.8 (2a), \(\bar{B_{i}} \cap \mathcal {M}\) and \(\bar{B_{j}} \cap \mathcal {M}\) are not empty,

  • by (a) \(\bar{B_{i}} \cap ( S^{0} \cup S^{1} )\) and \(\bar{B_{j}} \cap ( S^{0} \cup S^{1} )\) are semi-algebraically connected,

  • by definition of \(S^{0} \cup S^{1}\), \(\mathcal {M} \subset S^{0} \cup S^{1}\).

Then one can connect \(x\) (resp. \(x'\)) to a point in \(\bar{B}_{i} \cap \mathcal {M}\) (resp. \(\bar{B}_{j} \cap \mathcal {M}\)) so that one can suppose without loss of generality that \(x \in \bar{B}_{i} \cap \mathcal {M}\) and \(x' \in \bar{B}_{j} \cap \mathcal {M}\).

Let \(\gamma : [0,1] \rightarrow C\) be a semi-algebraic path that connects \(x\) to \(x'\), and let \(I= \gamma ^{-1}(C \cap \mathcal {M} )\) and \(H= [0,1] \setminus I\).

Since \(\mathcal {M}\) is finite, we can assume without loss of generality that \(I\) is a finite set of points, and \(H\) is a union of a finite number of open intervals.

Since \(\gamma (I) \subset \mathcal {M} \subset S^{0} \cup S^{1}\), it suffices to prove that if \(t\) and \(t'\) are the end points of an interval in \(H\), then \(\gamma (t)\) and \(\gamma (t' )\) are connected by a semi-algebraic path inside \(C \cap ( S^{0} \cup S^{1} )\).

Notice that \(\gamma ((t,t' )) \cap \mathcal {M} = \emptyset \) so that \(\gamma (t)\) and \(\gamma (t' )\) belong to the same \(\bar{B}_{\ell }\) by Lemma 2.8 (2b) . Hence, \(\gamma (t), \gamma (t' )\) both belong to \(\bar{B}_{\ell } \cap ( S^{0} \cup S^{1} )\), and we know that \(\bar{B}_{\ell } \cap ( S^{0} \cup S^{1} )\) is semi-algebraically connected by (a). Consequently, \(\gamma (t)\) and \(\gamma (t' )\) can be connected by a semi-algebraic path in \(\bar{B}_{\ell } \cap ( S^{0} \cup S^{1} ) \subset C \cap ( S^{0} \cup S^{1} )\). \(\square \)

4 Good Rank Property

In this section, we introduce matrices having the “good rank property” and derive two geometric consequences of this property which will be important for us later.

Notation 4.1

Let \(m \ge 0,B =( b_{i, j} )_{0 \le i \le m,1\le j \le k} \in \mathrm{R}^{({ m}+1 ) \times { k}}\) such that every \(j \times j\) sub-matrix of \(B\) with \(1 \le j \le m+1 \) has rank \(j\). We say that the matrix \(B\) has good rank property.

4.1 A Deformation of Several Equations to General Position

Our first application of matrices having good rank property is to use such a matrix to define a deformation of a finite set of polynomials with the property of being in general position which is what we describe now (see Proposition 4.4 below). We discuss first how to deform a given system of equation, following an idea introduced in [15], so that the number of critical points of a certain well chosen polynomial \(G\) is guaranteed to be finite.

Notation 4.2

Let \(Q \in \mathrm{R}[ X_{1} , \ldots ,X_{{ k}} ]\), \(b= ( b_{0} ,b_{1} , \ldots ,b_{{ k}} ) \in \mathrm{R}^{{ k}+1}\), and \(d\ge 0\). Let \(\zeta \) be a new variable. We denote

$$\begin{aligned} \hbox {Def}( Q, \zeta ,b,d )&= ( 1- \zeta ) Q^{2}- \zeta \big ( b_{0} +b_{1} X_{1}^{d} + \cdots +b_{k} X_{{ k}}^{d} \big ) . \end{aligned}$$
(2)

In the special case when \(b= ( 1, \ldots ,1 )\) and \(d=2\deg ( Q )\)+2, we denote

$$\begin{aligned} \hbox {Def}( Q, \zeta )&= \hbox {Def}( Q, \zeta ,b,d ) . \end{aligned}$$
(3)

Notation 4.3

Let \(m \ge 0,B =( b_{i, j} )_{0 \le i \le m,0 \le j \le k} \in \mathrm{R}^{( m+1 ) \times ( { k}+1 )}\), a matrix having good rank property and \(b_{0} = ( 1,2, \ldots ,k )\). For \(i=0, \ldots ,m\), let \(b_{i} =( b_{i, 0} , \ldots ,b_{i ,k} )\) denote the \(i\)-th row of \(B\).

Let \(\mathcal {P} = \{ P_{1} , \ldots ,P_{m} \} \subset \mathrm{R}[ X_{1} , \ldots ,X_{{ k}} ]\), and \(\bar{\zeta } = ( \zeta _{1} , \ldots , \zeta _{m} )\) new variables.

For any \(d \ge 0\), we denote by \(\hbox {Def}( \mathcal {P} , \bar{\zeta } ,B,d )\) the polynomials

$$\begin{aligned} \hbox {Def}( P_{1} , \zeta _{1} ,b_{1} ,d ) , \ldots , \hbox {Def}( P_{m} , \zeta _{m} ,b_{m} ,d ) , \end{aligned}$$
(4)

and denote

$$\begin{aligned} G_{d}&= b_{0,0} + \sum _{j=1}^{k} b_{0,j}X_{j}^{d} . \end{aligned}$$
(5)

The following proposition and its proof are similar to results in [15]. We include it here for the sake of completeness.

Proposition 4.4

Suppose that \(B =( b_{i, j} )_{0 \le i \le m,0\le j \le k} \in \mathrm{{R}}^{( m+1 ) \times k}\) has good rank property. Let \(0 \le \ell \le k\), and \(d > 2\max _{1 \le i \le m} \deg ( P_{i} )\). Then for each \(w \in \mathrm{{R}}^{\ell }\), and \(\bar{\zeta } = ( \zeta _{1} , \ldots , \zeta _{m} ) \in \left( \mathrm{{R}} \setminus \{ 0 \} \right) ^{m}\), \(\mathrm{{Def}} ( \mathcal {P} , \bar{\zeta } ,B,d ) ( w, \cdot )\) is in general position with respect to \(G_{d} ( w, \cdot )\).

Proof

Fix \(w \in \mathrm{R}^{\ell }\), and \(\bar{\zeta } \in \left( \mathrm{R}\setminus \{ 0 \} \right) ^{m}\). We prove that \(\hbox {Crit} \left( \hbox {Def}( \mathcal {P}, \bar{\zeta } ,B,d ) ( w, \cdot ) ,G \right) \) is finite (possibly empty).

Consider the following system of bi-homogeneous equations defining a sub-variety \(W \subset \mathbb {P}^{k - \ell }_{\mathrm{C}} \times \mathbb {P}^{m}_{\mathrm{C}}\):

$$\begin{aligned} \begin{aligned} \left( \hbox {Def}( P_{i} , \zeta _{i} ,b_{i} ,d ) ( w, \cdot ) \right) ^{h}&= 0,\quad i=1, \ldots ,m, \\ \sum _{i=1}^{m} \lambda _{i} \frac{\partial \left( \hbox {Def}( P_{i} , \zeta _{i} ,b_{i} ,d ) ( w, \cdot ) \right) ^{h}}{\partial X_{j}}&= \lambda _{0}\frac{\partial G_{d} ( w, \cdot )^{h}}{\partial X_{j}} ,\quad j= \ell +1, \ldots ,k. \end{aligned} \end{aligned}$$
(6)

Let \(\pi : \mathbb {P}^{k - \ell }_{\mathrm{C}} \times \mathbb {P}^{m}_{\mathrm{C}} \longrightarrow \mathbb {P}^{m}_{\mathrm{C}}\) be the projection map to the second factor.

It follows from the definition of \(\hbox {Crit} \left( \hbox {Def}( \mathcal {P}, \bar{\zeta } ,B,d ) ( w, \cdot ) ,G_{d} \right) \) that this set is contained in the real affine part of \(\pi ( W )\), and thus in order to prove that

$$\begin{aligned} \hbox {Crit} \left( \hbox {Def}( \mathcal {P}, \bar{\zeta } ,B,d ) ( y, \cdot ) ,G_{d} \right) \end{aligned}$$

is finite (possibly empty), it suffices to show that the complex projective variety \(\pi ( W )\) is a finite number of points (possibly empty). So, we prove that the projective variety \(\pi ( W ) \subset \mathbb {P}_{\mathrm{C}}^{m}\) has an empty intersection with the hyperplane at infinity defined by \(X_{0} =0\).

Substituting \(X_{0} =0\) in the system (6), we get

$$\begin{aligned} \zeta _{i} \big ( b_{i, \ell +1} X_{\ell +1}^{d} + \cdots +b_{i,k} X_{k}^{d} \big )&= 0,\quad i=1, \ldots ,m, \end{aligned}$$
(7)
$$\begin{aligned} d \Big ( \sum _{i=1}^{m} \zeta _{i} \lambda _{i} b_{i,j} - \lambda _{0 } b_{0,j} \Big )X_{j}^{d-1}&= 0,\quad j= \ell +1, \ldots ,k. \end{aligned}$$
(8)

There are two cases to consider.

Case 1 :

\(m \ge k- \ell \): In this case, since the matrix of coefficients in the first set of equations

$$\begin{aligned} \left( \begin{array}{c@{\quad }c@{\quad }c@{\quad }c} b_{1, \ell +1} &{} \cdot &{} \cdot &{} b_{1,k}\\ \cdot &{} \cdot &{} \cdot &{} \cdot \\ b_{m, \ell +1} &{} \cdot &{} \cdot &{} b_{m,k} \end{array}\right) \end{aligned}$$

has rank \(k- \ell \) which follows from the given property of the matrix \(B\), we get that \(X_{\ell +1} = \cdots =X_{{ k}} =0\), which is impossible.

Case 2 :

\(m<k- \ell \): Consider the second set of equations involving the Lagrangian variables \(\lambda _{0} , \ldots , \lambda _{m}\). Since the matrix \(B\) has the property that every \(( m+1 ) \times ( m+1 )\) sub-matrix has rank \(( m+1 )\), we have for every choice \(J \subset [ \ell +1,k ] , \hbox {card} ( J ) =m+1\), the system of equations

$$\begin{aligned} \sum _{i=1}^{p} \zeta _{i} \lambda _{i} b_{i,j} - \lambda _{0 } b_{0,j} =0 ,\quad j \in J, \end{aligned}$$

has an empty solution in \(\mathbb {P}^{m}_\mathrm{{C}}\), and hence at least \(k-m- \ell \) amongst the variables \(X_{\ell +1} , \ldots ,X_{{ k}}\) must be equal to \(0\). Suppose that \(X_{m+ \ell +1} = \cdots =X_{k } =0\). Now, from the property that the all \(m \times m\) sub-matrices of \(B\) have full rank we obtain that the only solution to system (7) with \(X_{m+ \ell +1} = \cdots =X_{{ k}} =0\) is the one with \(X_{\ell +1} = \cdots =X_{{ k}} =0\), which is impossible.

This proves that in both cases the projective variety \(\pi ( W ) \subset \mathbb {P}_\mathrm{{C}}^{m}\) has an empty intersection with the hyperplane at infinity defined by \(X_{0} =0\), and hence \(\pi ( W )\) is a finite number of points which finishes the proof. \(\square \)

4.2 \((B,G)\)-Pseudo-critical Values

We now describe a second application of matrices with the good rank property. Given a finite family of polynomials \(\mathcal {P}= \{ P_{1} , \ldots ,P_{s} \} \subset \mathrm{R}[ X_{1} , \ldots ,X_{{ k}} ]\), a matrix \(B =( b_{i, j} )_{1 \le i \le s,0\le j \le k} \in \mathrm{R}^{{ s} \times ( { k}+1 )}\) having good rank property (see Notation 4.3), and a polynomial \(G \in \mathrm{R}[ X_{1} , \ldots ,X_{{ k}} ]\), we define a finite set \(\mathcal {D} ( \mathcal {P},B,G ) \subset \mathrm{R}\) which we call the \(( B,G )\) -pseudo-critical values of the family \(\mathcal {P}\).

These \(( B,G )\)-pseudo-critical values are used to ensure good connectivity properties in the case of basic closed semi-algebraic sets.

Definition 4.5

Let \(\mathcal {P}= \{ P_{1} , \ldots ,P_{s}\} \subset \mathrm{R}[ X_{1}, \ldots ,X_{{ k}} ]\), \(B =( b_{i, j})_{1 \le i \le s,0\le j \le k} \in \mathrm{R}^{s \times ( k+1 )}\) a matrix having good rank property (see Notation 4.3), and let \(G \in \mathrm{R}[ X_{1} , \ldots ,X_{{ k}} ]\). We denote for \(1 \le i \le s\),

$$\begin{aligned} H_{i}&= b_{i,0} + \sum _{j=1}^{k} b_{i,j} X_{j}^{d} , \end{aligned}$$

where \(d\) is the least even number greater than \(\max _{P \in \mathcal {P}} \deg ( P )\). For \(I \subset [ 1,s ] \), and \(\sigma \in \{ -1,1 \}^{I}\), we denote

$$\begin{aligned} \tilde{\mathcal {P}}_{I, \sigma ,B}&= \{ P_{i} +\gamma \sigma ( i ) H_{i} \mid i \in I \} . \end{aligned}$$

We say that \(c \in \mathrm{R}\) is a \(( B,G )\)-pseudo-critical value of \(\mathcal {P}\) if there exists \(I \subset [ 1,s ] \) with \(\hbox {card} ( I ) \le k\), \(\sigma \in \{ -1,1 \}^{I}\), \(( x, \lambda ) \in \mathrm{R}\langle \gamma \rangle ^{{ k}} \times \mathrm{R}\langle \gamma \rangle ^{(\mathrm{{card}} ( I ) +1 )}\) bounded over R, such that

$$\begin{aligned} c&= \lim _{\gamma }G ( x ) , \end{aligned}$$

and \(( x, \lambda ) \in {\mathrm{{Zer}}} \big ( \hbox {CritEq} ({\tilde{\mathcal {P}}}_{I, \sigma ,B} ,G ) , \mathrm{R}\langle \gamma \rangle ^{{ k}+ \mathrm{{card}} ( I ) +1} \big )\) (see Definition 2.1, (1)). We denote set of all \(( B,G )\)-pseudo-critical values of \(\mathcal {P}\) by \(\mathcal {D} ( \mathcal {P},B,G )\).

The property of \(( B,G )\)-pseudo-critical values used in the paper is the following result. Its proof is postponed to the Annex (Sect. 8).

Proposition 4.6

Let \(\mathcal {P},\mathcal {Q} \subset \mathrm{R}[ X_{1} , \ldots ,X_{{ k}} ]\), \(B =( b_{i, j} )_{1 \le i \le \mathrm{{card}} ( \mathcal {P} ) + \mathrm{{card}} ( \mathcal {Q} ) ,0\le j \le k} \in \mathrm{R}^{(\mathrm{{card}}(\mathcal {P}) + \mathrm{{card}}(\mathcal {Q}) ) \times ( { k}+1 )}\), a matrix having good rank property, and \(G\in \mathrm{R}[ X_{1} , \ldots , X_{{ k}} ]\), where \(d\) is the least even number greater than \(\max _{P \in \mathcal {P}} \deg ( P )\). Suppose that \(S= \hbox {Bas} ( \mathcal {P},\mathcal {Q} )\) is bounded. Then

  1. (1)

    the set \(\mathcal {D}=\mathcal {D} ( \mathcal {P} \cup \mathcal {Q},B,G )\) is finite;

  2. (2)

    for any interval \([ a,b ] \subset \mathrm{R}\) and \(c\in [ a,b ]\), with \(\{ c \} \supset \mathcal {D} \cap [ a,b ]\), if \(D\) is a semi-algebraically connected component of \(S_{a\le G \le b}\), then \(D_{G=c}\) is a semi-algebraically connected component of \(S_{G=c}\).

5 Deformation to the Special Case

Our aim in this section is to associate to a basic semi-algebraic set \(S= \hbox {Bas} ( \mathcal {P} , \mathcal {Q} )\) a deformation \(\tilde{S}\) of \(S\), and a special tuple \( ( \tilde{S} , \tilde{\mathcal {M}} , \ell , \tilde{S}^{0} ,\mathcal {D}^{0} ,\mathcal {M}^{0} )\) (cf. Definition 3.2).

Notation 5.1

We fix for the remainder of this section:

  1. (1)

    \(p \in \mathbb {N} ,1 \le p \le k;\)

  2. (2)

    two finite sets of polynomials \(\mathcal {P}\subset \mathrm{R}[ X_{1} , \ldots ,X_{{ k}} ]\), \( \mathcal {Q}= \{ Q_{1} , \ldots ,Q_{q} \} \subset \mathrm{R}[ X_{1} , \ldots ,X_{{ k}} ]\);

  3. (3)

    \(d= \max _{P \in \mathcal {P} \cup \mathcal {Q}} \deg ( P )\);

  4. (4)

    \(G=G_{2d+2}\)=\(1+ \sum ^{k}_{i=1} i X_{i}^{2d+2}\).

5.1 Deformation of \(\hbox {Bas} ( \mathcal {P} , \mathcal {Q} )\) to \(\hbox {Bas} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} )\)

Notation 5.2

Let \(\mathcal {H}_{N,k} =( h_{i j} )_{0 \le i \le N,0 \le j \le k}\) be an \(( N +1 ) \times ( k+1 )\) matrix with integer entries defined by \(h_{i,j} =j^{i+1}\) and for each \(i,0\le i\le N,0 \le j \le k\).

Notice that the matrix \(\mathcal {H}_{N,k}\) has good rank property (see Notation 4.1), since every submatrix of \(\mathcal {H}_{N,k}\) is a generalized Vandermonde matrix (see for example [18, page 43).

Notation 5.3

Given a finite list of variables \(\zeta = ( \zeta _{1} , \ldots , \zeta _{t} )\), we denote by \(\mathrm{R}\langle \zeta \rangle = \mathrm{R}\langle \zeta _{1} , \ldots , \zeta _{t} \rangle \) the field \(\mathrm{R}\langle \zeta _{1} \rangle \cdots \langle \zeta _{t} \rangle \) and for any \(\xi \in \mathrm{R}\langle \zeta _{1} , \ldots , \zeta _{t} \rangle \) bounded over \(\mathrm{R}\langle \zeta _{1} , \ldots , \zeta _{i} \rangle \), \(i<t\), we denote by \(\lim _{\zeta _{i+1}} ( \xi )\) the element \(( \lim _{\zeta _{i+1}} \circ \cdots \circ \lim _{\zeta _{t}} ) ( \xi )\) of \(\mathrm{R}\langle \zeta _{1} , \ldots , \zeta _{i} \rangle \). For an element \(f= \sum _{\alpha } c_{\alpha } \zeta ^{\alpha } \in \hbox {D}[ \zeta _{1} , \ldots , \zeta _{t} ]\), we will denote by \(o_{\zeta } ( f ) = \alpha _{0} \in \mathbb {N}^{t}\) such that \(\zeta ^{\alpha _{0}}\) is the largest element of \(\hbox {supp} ( f )=\{ \zeta ^{\alpha } \mid c_{\alpha } \ne 0 \}\) in the unique ordering of the real closed field \(\mathrm{R}\langle \zeta \rangle \). For \(\alpha , \beta \in \mathbb {N}^{t}\), we denote \(\alpha \ge \beta \) if \(\zeta ^{\alpha } \ge \zeta ^{\beta }\).

We now define families \(\tilde{\mathcal {P}}\) and \(\tilde{\mathcal {Q}}\) such that \(\hbox {Bas} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} )\) is a deformation of \(\hbox {Bas} ( \mathcal {P} , \mathcal {Q} )\).

Notation 5.4

Let

$$\begin{aligned} H_{i} = h_{i,0} + \sum ^{k}_{j=1} h_{i j}X_{j}^{2d+2} , \end{aligned}$$

where \(d= \max _{P \in \mathcal {P} \cup \mathcal {Q}} \deg ( P )\), and the \(h_{i j}\)’s are the entries in the matrix \(\mathcal {H}_{k-p+q,k}\), and let

$$\begin{aligned} P_{1}^{\star }&= ( 1- \zeta ) \sum _{P \in \mathcal {P}} P^{2} + \zeta \Big ( X_{p+1}^{2d+2} + \cdots +X_{{ k}}^{2d+2} +X_{p+1}^{2} + \cdots +X_{{ k}}^{2} \Big ) ,\\ P_{i}^{\star }&= \dfrac{\partial P_{1}^{\star }}{\partial X_{p+i}},\quad 2 \le i \le k-p,\\ \mathcal {P}^{\star }&= \big \{ P_{1}^{\star } , \ldots ,P^{\star }_{k-p} \big \} . \end{aligned}$$

For \(1 \le i \le k-p\), let

$$\begin{aligned} \tilde{P}_{i}=\left( 1- \varepsilon \right) P^{\star }_{i} -\varepsilon H_{i} , \end{aligned}$$

and for \(1\le j \le q \), let

$$\begin{aligned} \tilde{Q}_{j} =( 1- \delta )Q_{j} +\delta H_{k-p+j} . \end{aligned}$$

Finally, define

$$\begin{aligned} \tilde{\mathcal {P}}&= \big \{ \tilde{P}_{1} , \ldots , \tilde{P}_{k-p} \big \},\\ \tilde{\mathcal {Q}}&= \big \{ \tilde{Q}_{1} , \ldots , \tilde{Q}_{q} \big \} . \end{aligned}$$

Proposition 5.5

Suppose that \(\mathrm{{Bas}} ( \mathcal {P} , \mathcal {Q} )\) is bounded, and that for each \(y \in \mathrm{R}^{p}\), \({\mathrm{{Zer}}} ( \mathcal {P}, \mathrm{R}^{{ k}} )_{y}\) is a finite number of points (possibly empty). Let \(\mathrm{{Bas}} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} ) \subset \mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ^{k}\). Then

$$\begin{aligned} \mathrm{{Bas}} ( \mathcal {P} , \mathcal {Q} ) = \lim _{\zeta } \big ( \mathrm{{Bas}} \big ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} \big ) \big ) . \end{aligned}$$

Proof

It is clear that \(\lim _{\zeta } ( \hbox {Bas} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} ) ) \subset \hbox {Bas} ( \mathcal {P} , \mathcal {Q} )\). We now prove that \(\hbox {Bas} ( \mathcal {P} , \mathcal {Q} ) \subset \lim _{\zeta } ( \hbox {Bas} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} ) )\). Let \(x=( y,z ) \in \hbox {Bas} ( \mathcal {P} , \mathcal {Q} )\), where \(y \in \mathrm{R}^{{ p}}\) and \(z \in \mathrm{R}^{{ k}-{ p}}\). For each (of the finitely many) \(z \in \mathrm{R}^{{ k}-{ p}}\) such that \(x= ( y,z ) \in \hbox {Bas} ( \mathcal {P} , \mathcal {Q} )\), there exists a bounded semi-algebraically connected component \(C_{z}\) of the non-singular hypersurface \({\mathrm{{Zer}}} ( P_{1}^{\star } ( y, \cdot ) , \mathrm{R}\langle \zeta \rangle ^{{ k}-{ p}} )\) such that \(\lim _{\zeta } ( C_{z} )= z\).

Now, the system \(\mathcal {P}^{\star } ( y, \cdot ) \) has only simple zeros in \(\mathrm{R}\langle \zeta \rangle ^{{ k}-{ p}}\) (see [2, Proposition 12.44) and contains the non-empty set of \(X_{p+1}\)-extremal points of \(C_{z}\). Let \(z' \in \mathrm{R}\langle \zeta \rangle ^{{ k}-{ p}}\) be an \(X_{p+1}\)-extremal point of \(C_{z}\). Then since \(z'\) is a simple zero of the system \(\mathcal {P}^{\star } ( y, \cdot )\), there must exist \(z'' \in {\mathrm{{Zer}}} ( \tilde{\mathcal {P}} , \mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ^{{ k}-{ p}} )\) such that \(\lim _{\varepsilon } (z'' )= z'\). Moreover, it is clear that \(x'' = ( y,z'' ) \in \hbox {Bas} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} )\), and that \(\lim _{\zeta } ( x'' ) =x\), which finishes the proof. \(\square \)

5.2 General Position and Definition of \(\tilde{\mathcal {M}}\)

Suppose now that \({\mathrm{{Zer}}}( \mathcal {P},\mathrm{R}^{ k})\) is strongly of dimension \(\le p\), and let \(S= \hbox {Bas} ( \mathcal {P} , \mathcal {Q} ) \subset \mathrm{R}^{{ k}}\). Let

$$\begin{aligned} \tilde{S} = \hbox {Bas} \big ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} \big ) \subset \mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ^{{ k}} \end{aligned}$$

following Notation 5.4.

Proposition 5.6

For every \(\ell \le p\) and for every \(w \in \mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ^{\ell }\), \(\tilde{\mathcal {P}} ( w,- ) , \tilde{\mathcal {Q}} ( w,- )\) is in general position with respect to \(G ( w,- )\).

Proof

Follows from Definition 2.4 and Proposition 4.4 noting that \(\varepsilon , \delta \ne 0\) in \(\mathrm{R}\langle \zeta , \varepsilon , \delta \rangle \). \(\square \)

Corollary 5.7

The set \(\tilde{\mathcal {M}} = \mathrm{{Cr}} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} ,G )\) is finite.

Corollary 5.8

\({\mathrm{{Zer}}}(\mathcal {P},\mathrm{R}^k)\) and \(\mathrm{{Bas}} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} )\) are strongly of dimension \(\le p\).

Proof

Applying Proposition 5.6 with \(\ell = p\), and noting that \(\hbox {card}(\mathcal {P}) = k-p\), we get that for every \(w \in \mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ^{p}\), \({\mathrm{{Zer}}}(\tilde{\mathcal {P}}, \mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ^{{ k}})_{w}\) is finite (possibly empty) by Remark 2.5. It then follows from Definition 1.3 that, \({\mathrm{{Zer}}}(\tilde{\mathcal {P}}, \mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ^{{ k}})\) is strongly of dimension \(\le p\). The same then holds for \(\hbox {Bas} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} )\), since \(\hbox {Bas} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} )\subset {\mathrm{{Zer}}}(\tilde{\mathcal {P}}, \mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ^{{ k}})\). \(\square \)

5.3 Definition of \(\tilde{\mathcal {A}}\)

Since we have replaced \(\hbox {Bas} ( \mathcal {P} , \mathcal {Q} )\) by \(\hbox {Bas} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} )\), we need to associate to any given finite set of points \(\mathcal {\mathcal {A} \subset \hbox {Bas} ( \mathcal {\mathcal {P} , \mathcal {Q}} )}\), a corresponding finite set of points \(\tilde{\mathcal {A}} \subset \hbox {Bas} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} )\) whose limits contain \(\mathcal {A}\), and which moreover ensures certain connectivity properties (see Proposition 5.13).

In our constructions we will often require to choose a finite subset of a given semi-algebraic set \(S\) which meets every semi-algebraically connected component of \(S\). Since the relevant connectivity properties of the constructions will not depend on how these points are chosen it is convenient to have the following notation. Later in the descriptions of our algorithms we will specify precisely how these points are chosen.

Notation 5.9

For any closed and bounded semi-algebraic subset \(S \subset \mathrm{R}^{{ k}}\), we denote by \(\hbox {Samp} ( S )\) some finite subset of \(S\) which meets every semi-algebraically connected component of \(S\).

Notation 5.10

We associate to two closed and bounded semi-algebraic sets \(S_{1} ,S_{2} \subset \mathrm{R}^{{ k}}\) a finite set of points \(\hbox {MinDist} ( S_{1} ,S_{2} ) \subset S_{1}\) defined as follows. Let \(M\) be the set of local minimizers of the polynomial function \(F ( X,Y ) = \sum _{i=1}^{k} ( X_{i} -Y_{i} )^{2}\) on the set \(S_{1} \times S_{2}\) and let \(\pi _{1} , \pi _{2} : \mathrm{R}^{{ k}} \times \mathrm{R}^{{ k}} \longrightarrow \mathrm{R}^{{ k}}\) be the projections on the first and second components respectively. Let

$$\begin{aligned} \hbox {MinDi} ( S_{1} ,S_{2} )&= \pi _{1} ( \hbox {Samp} ( M ) ) \cup \pi _{2} ( \hbox {Samp} ( M ) ) \end{aligned}$$

using Notation 5.9.

Proposition 5.11

Let \(T \subset \mathrm{R}\langle \zeta \rangle ^{{ k}}\) be a closed semi-algebraic set bounded over \(\mathrm{R}\), and \(x \in \lim _{\zeta } ( T )\). Then \(\mathrm{{MinDi}} ( T, \{ x \} ) \ne \emptyset \), and \(x \in \lim _{\zeta } ( \mathrm{{MinDi}} ( T, \{ x \} ) )\).

Proof

Let \(C\) be the semi-algebraically connected component of \(\lim _{\zeta } ( T )\) containing \(x\). Then, there exists semi-algebraically connected components \(C_{1} , \ldots ,C_{m}\) of \(T\) such that \(C =\bigcup _{i=1}^{m} \lim _{\zeta } ( C_{i} )\). Hence, there exists \(i,1 \le i \le m\), such that \(x \in \lim _{\zeta } ( C_{i} )\). Since \(C_{i}\) is bounded over \(\mathrm{R}\), the subset \(M_{i,x } \subset C_{i}\) of points which achieve the minimum distance from \(x\) to \(C_{i}\) is non-empty. Every semi-algebraically connected component of \(M_{i,x }\) is a semi-algebraically connected component of the set \(M_{x} \subset T\) of points which achieve the minimum distance from \(x\) to \(T\). Hence, \(M_{i,x }\) contains one point, \(\tilde{x}\), which is included in \(\hbox {MinDi} ( T, \{ x \} )\). It is now clear that \(\hbox {MinDi} ( T, \{ x \} ) \ne \emptyset \), and that \(x= \lim _{\zeta } ( \tilde{x} ) \in \lim _{\zeta } ( \hbox {MinDi} ( T, \{ x \} ) \ne \emptyset )\). \(\square \)

Proposition 5.12

Let \(T_{1} ,T_{2} \subset \mathrm{R}\langle \zeta \rangle ^{{ k}}\) be closed semi-algebraic sets bounded over \(\mathrm{R}\). Then, for every \(\tilde{C} , \tilde{D}\) semi-algebraically connected components of \(T_{1}\) and \(T_{2}\) respectively, such that \(\lim _{\zeta } ( \tilde{C} ) \cap \lim _{\zeta } ( \tilde{D} )\) is non-empty, \(\lim _{\zeta } ( \tilde{C} \cap \mathrm{{MinDi}} ( T_{1} ,T_{2} ) ) \cap \lim _{\zeta } ( \tilde{D} \cap \mathrm{{MinDi}} ( T_{1} ,T_{2} ) )\) is non-empty, and meets every semi-algebraically connected component of \(\lim _{\zeta } ( \tilde{C} ) \cap \lim _{\zeta } ( \tilde{D} )\).

Proof

Let \(M\) denote the semi-algebraic subset of \(\mathrm{R}\langle \zeta \rangle ^{{ k}} \times \mathrm{R}\langle \zeta \rangle ^{{ k}}\) consisting of the local minimizers of the polynomial function \(F ( X,Y ) = \sum _{i=1}^{k} ( X_{i} -Y_{i} )^{2}\) on \(T_{1} \times T_{2}\). Also, note that the function \(F\) is proportional to the square of the distance to the diagonal \(\Delta \subset \mathrm{R}\langle \zeta \rangle ^{{ k}} \times \mathrm{R}\langle \zeta \rangle ^{{ k}}\).

Let \(B\) be a semi-algebraically connected component of \(\lim _{\zeta } ( \tilde{C} ) \cap \lim _{\zeta } ( \tilde{D} )\). Notice that \(( B \times B ) \cap \Delta \) is a semi-algebraically connected component of \(( \lim _{\zeta } ( \tilde{C} ) \times \lim _{\zeta } ( \tilde{D} ) ) \cap \Delta \). Let \(( \tilde{u}_{0} , \tilde{v}_{0} ) \in \tilde{C} \times \tilde{D}\) such that \(\lim _{\zeta } ( \tilde{u}_{0} ) = \lim _{\zeta } ( \tilde{v}_{0} ) \in B\). Notice that \(\lim _{\zeta } ( F ( \tilde{u}_{0} , \tilde{v}_{0} ) ) =F ( \lim _{\zeta } ( \tilde{u}_{0} ) , \lim _{\zeta } ( \tilde{v}_{0} ) ) =0\), and hence \(F ( \tilde{u}_{0} , \tilde{v}_{0} )\) is infinitesimally small. Let

$$\begin{aligned} U&= \big \{ \big ( \tilde{u} , \tilde{v} \big ) \in \tilde{C} \times \tilde{D} \mid F \big ( \tilde{u} , \tilde{v} \big ) <F \big ( \tilde{u}_{0} , \tilde{v}_{0} \big ) \big \} . \end{aligned}$$

Since the image under \(\lim _{\zeta }\) of a bounded, semi-algebraically connected set is semi-algebraically connected (see Proposition 12.43 in [2]), for any semi-algebraically connected component \(V\) of \(U\), \(\lim _{\zeta } ( V )\) is either contained in \(( B \times B ) \cap \Delta \) or disjoint from \(( B \times B ) \cap \Delta \). Denote by \(U'\) the union of semi-algebraically connected components \(V\) of \(U\) such that \(\lim _{\zeta } ( V ) \subset ( B \times B ) \cap \Delta \), and denote by \(\bar{U'} \subset \tilde{C} \times \tilde{D}\) the closure of \(U'\). If \(U'\) is empty then \(( \tilde{u}_{0} , \tilde{v}_{0} )\) is a local minimizer of \(F\) on \(\tilde{C} \times \tilde{D}\) and we are done. Otherwise, the minimum of \(F\) on \(\bar{U'}\) is strictly smaller than \(F ( \tilde{u}_{0} , \tilde{v}_{0} )\), and it must be realized at a point of \(U'\), since \(F ( \tilde{u} , \tilde{v} ) =F ( \tilde{u}_{0} , \tilde{v}_{0} )\) for all \(( \tilde{u} , \tilde{v} ) \in \bar{U'} \setminus U'\), and we are done. \(\square \)

We now let \(\mathcal {A} \subset S\) be a fixed finite set of points contained in \(S\).

Let (using Notation 5.10)

$$\begin{aligned} \tilde{\mathcal {A}}&= \hbox {MinDi} \big ( \tilde{S} ,\mathcal {A} \big ) \cup \hbox {MinDi} \big ( \tilde{S} , \tilde{S} \big ) . \end{aligned}$$

Proposition 5.13

The finite set \(\tilde{\mathcal {A}} \subset \tilde{S}\) has the following properties.

  1. (1)

    \(\lim _{\zeta } ( \tilde{\mathcal {A}} ) \supset \mathcal {A}\);

  2. (2)

    for every pair of semi-algebraically connected components \(\tilde{C} , \tilde{D}\) of \(\tilde{S}\) such that \(\lim _{\zeta } ( \tilde{C} ) \cap \lim _{\zeta } ( \tilde{D} )\) is non-empty, \(\lim _{\zeta } ( \tilde{C} \cap \tilde{\mathcal {A}} ) \cap \lim _{\zeta } ( \tilde{D} \cap \tilde{\mathcal {A}} )\) is non-empty, and meets every semi-algebraically connected component of \(\lim _{\zeta } ( \tilde{C} ) \cap \lim _{\zeta } ( \tilde{D} )\);

  3. (3)

    \(\tilde{\mathcal {A}}\) meets every semi-algebraically connected component of \(\tilde{S}\).

Proof

Part (1) follows from Proposition 5.11 after observing that \(\hbox {MinDist} ( \tilde{S} ,\tilde{\mathcal {A}} ) = \bigcup _{x \in \mathcal {A}} \hbox {MinDi} ( \tilde{S} , \{ x \} )\) (see Notation 5.10), and the fact that \(\tilde{\mathcal {A}}\) contains \(\hbox {MinDist} ( \tilde{S} ,\mathcal {A} )\).

Part (2) follows directly from Proposition 5.12 with \(T_{1} = T_{2} = \tilde{S}\) and the fact that \(\tilde{A}\) contains \(\hbox {MinDi} ( \tilde{S} , \tilde{S} )\).

Part (3) is a special case of Part (2), with \(T_{1} =T_{2} = \tilde{S}\), and \(\tilde{C} = \tilde{D}\). \(\square \)

Corollary 5.14

Let \(x,x' \in \tilde{S}\) such that \(\lim _{\zeta } ( x' ) \in \mathrm{Cc}( \lim _{\zeta } ( x ) ,S )\). Then there exist elements \(\tilde{x}_{0} =x, \ldots , \tilde{x}_{2n+1} =x'\) of \(\tilde{S}\) such that

  1. (1)

    for all \(i=1, \ldots ,n,\,\lim _{\zeta _{t}} ( \tilde{x}_{2i-1} ) = \lim _{\zeta } ( \tilde{x}_{2i} )\),

  2. (2)

    for all \(i=0, \ldots ,n\), \({\tilde{x}}_{2i+1} \in \mathrm{Cc}( \tilde{x}_{2i} , \tilde{S} )\),

  3. (3)

    for all \(i=1, \ldots ,2n\), \(\tilde{x}_{i} \in \tilde{\mathcal {A}}\).

Proof

Follows clearly from Part (2) of Proposition 5.13. \(\square \)

5.4 Definition of \(\tilde{S}^{0}\)

We want to consider \(G\)-critical points parametrized by \(\mathrm{R}^{\ell }\).

Notation 5.15

Let \(G \in \mathrm{R}[ X_{1} , \ldots ,X_{{ k}} ]\) and \(\mathcal {P} =\{ P_{1} , \ldots ,P_{m} \} \subset \mathrm{R}[ X_{1} , \ldots ,X_{{ k}} ]\) be a finite family of polynomials.

Let \(0 \le \ell \le k\) and consider the system of equations \(\hbox {CritEq}_{\ell } ( \mathcal {P} ,G )\)

$$\begin{aligned} P_{j}&= 0,\quad j=1, \ldots ,m,\\ \sum \limits _{j=1}^{m} \lambda _{j} \frac{\partial P_{j}}{\partial X_{i}} - \lambda _{0} \frac{\partial G}{\partial X_{i}}&= 0,\quad i= \ell +1, \ldots ,k,\\ \sum \limits _{j=0}^{m} \lambda _{j}^{2} -1&= 0. \end{aligned}$$

The set \(\hbox {Crit}_{\ell } ( \mathcal {P} ,G ) \subset \mathrm{R}^{{ k}}\) is the projection to \(\mathrm{R}^{{ k}}\) of

$$\begin{aligned} {\mathrm{{Zer}}} \big ( \hbox {CritEq}_{\ell } ( \mathcal {P} ,G ) , \mathrm{R}^{{ k}} \times \mathrm{R}^{\max ( { m},{ k} ) +1} \big ). \end{aligned}$$

Note that for every \(w \in \mathrm{R}^{\ell }\),

$$\begin{aligned} \hbox {Crit}_{\ell } ( \mathcal {P} ,G )_{w} = \hbox {Crit} ( \mathcal {P} ( w, \cdot ) ,G ( w, \cdot ) ) . \end{aligned}$$

We now fix \(\ell ,1 \le \ell <p\).

Notation 5.16

Let \(\tilde{\mathcal {Q}'} \subset \tilde{\mathcal {Q}}\). Define

$$\begin{aligned} \tilde{S}^{0} ( \tilde{\mathcal {Q}}' )&= \hbox {Cr}_{\ell } \big ( \tilde{\mathcal {P}} \cup \tilde{\mathcal {Q}}' ,G \big ) \cap \tilde{S} , \\ \tilde{S}^{0}&= \bigcup _{\tilde{\mathcal {Q}'} \subset \tilde{\mathcal {Q}}} \tilde{S}^{0} \big ( \tilde{\mathcal {Q}}' \big ) . \end{aligned}$$

Proposition 5.17

For each \(w\in \mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ^{\ell }\):

  1. (1)

    \(\tilde{S}^{0}_{w}\) is a finite set;

  2. (2)

    \(\tilde{S}^{0}_{w}\) meets every semi-algebraically connected component of \(\tilde{S}_{w}\), and contains for every semi-algebraically connected component \(C\) of \(\tilde{S}_{w}\) a minimizer of \(G\) over \(C\).

Proof

Part (1) is immediate from Proposition 5.6.

Part (2) follows from the fact that for each semi-algebraically connected component \(C\) of \(\tilde{S}_{w}\), there exists some \(\tilde{\mathcal {Q}'}\) such that the minimizer of \(G\) over \(C\) is a local minimizer \(x \in \big ( {\mathrm{{Zer}}} ( \tilde{\mathcal {P}} \cup \tilde{\mathcal {Q}}' , \mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ) \big )_{{ w}}\) of \(G\) over \(\big ( {\mathrm{{Zer}}} ( \tilde{\mathcal {P}} \cup \tilde{\mathcal {Q}}' , \mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ) \big )_{{ w}}\), and then \(x\) clearly belongs to \(\hbox {Cr}_{\ell } ( \tilde{\mathcal {P}} \cup \tilde{Q}' ,G ) \cap \tilde{S}\). Since \(\tilde{S}_{w}\) is closed and bounded, every semi-algebraically connected component \(C\) of \(\tilde{S}_{w}\) must contain a minimizer of \(G\) over \(C\), and hence \(\tilde{S}^{0}_{w}\) meets every semi-algebraically connected component of \(\tilde{S}_{ w}\). \(\square \)

5.5 Definition of \(\mathcal {D}^{0}\), \(\mathcal {M}^{0}\)

Notation 5.18

Let

$$\begin{aligned} \tilde{S}&= \hbox {Bas} \big ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} \big ) ,\\ F&= \prod \limits _{\tilde{\mathcal {Q}'} \subset \tilde{\mathcal {Q}}} F \big ( \tilde{\mathcal {Q}}' \big ) , \end{aligned}$$

where

$$\begin{aligned} F \big ( \tilde{\mathcal {Q}}' \big )&= \sum \limits _{P \in \mathrm{{CrEq}}_{\ell } ( \tilde{\mathcal {P}} \cup \tilde{Q}' ,G )} P^{2} . \end{aligned}$$

We denote (see Definition 4.5)

$$\begin{aligned} \mathcal {D}^{0}&= \mathcal {D} \big ( \{ F \} \cup \tilde{\mathcal {Q}} ,\mathcal {H}_{\mathrm{{card}} ( \mathcal {Q} ) +1,2k-p+ \mathrm{{card}} ( \mathcal {Q} ) +1} ,G \big ) \end{aligned}$$
(9)

considering the polynomials in \(\{ F \} \cup \tilde{\mathcal {Q}}\) as elements of

$$\begin{aligned} \mathrm{R}\left[ \zeta , \varepsilon , \delta \right] \big [ X_{1} , \ldots ,X_{{ k}} , \lambda _{0} , \ldots , \lambda _{{ k}-{ p}+ \mathrm{{card}} ( \mathcal {Q} )} \big ]. \end{aligned}$$

Let \(\mathcal {M}^{ 0} = \hbox {Samp} \big ( \bigcup _{c \in \mathcal {D}^{0}} \tilde{S}_{G=c} \big )\) be a finite set of points meeting every semi-algebraically connected component of \(\bigcup _{c \in \mathcal {D}^{0}} \tilde{S}_{G=c}\).

Lemma 5.19

The sets \(\mathcal {D}^{0}\) and \(\mathcal {M}^{0}\) have the following properties:

  1. (1)

    for every interval \([ a,b ] \subset \mathrm{R}\langle \zeta , \varepsilon , \delta \rangle \) and \(c\in [ a,b ]\), with \(\{ c \} \supset \mathcal {D}^{0} \cap [ a,b ]\), if \(D\) is a semi-algebraically connected component of \(( \tilde{S}^{0} )_{a\le G \le b}\), then \(D_{G=c}\) is a semi-algebraically connected component of \(( \tilde{S}^{0} )_{G=c}\);

  2. (2)

    \(\mathcal {M}^{0}\) meets every semi-algebraically connected component of \(( \tilde{S}^{0} )_{G=a} \) for all \(a\in \mathcal {D}^{0}\).

Proof

Part (1): notice that \(\mathcal {D}^{0}\) is the finite set of \(( B,G )\)-pseudo-critical values of the family \(\{ F \} \cup \tilde{\mathcal {Q}}\), for the matrix \(B=\mathcal {H}_{\mathrm{{card}} ( \mathcal {Q} ) +1,2k-p+ \mathrm{{card}} ( \mathcal {Q} ) +1}\) which has the good rank property. Hence, using Part (2) of Proposition 4.6 we have that for every interval \([ a,b ] \subset \mathrm{R}\langle \zeta , \varepsilon , \delta \rangle \) and \(c\in [ a,b ]\), with \(\{ c \} \supset \mathcal {D}^{0} \cap [ a,b ]\), if \(D\) is a semi-algebraically connected component of \(( \hbox {Bas} ( \{ F \} , \tilde{\mathcal {Q}} ) )_{a\le G \le b}\), then \(D_{G=c}\) is a semi-algebraically connected component of \(( \hbox {Bas} ( \{ F \} , \tilde{\mathcal {Q}} ) )_{G=c}\).

To finish the proof of Part (1) observe that \(\tilde{S}^{0}\) is the image of \(\hbox {Bas} ( \{ F \} , \tilde{\mathcal {Q}} ) \subset \mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ^{{ k}} \times \mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ^{{ k}-{ p}+ \mathrm{{card}} ( \mathcal {Q} ) +1}\) under projection to \(\mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ^{{ k}}\), and the fibers of this projection are intersections of linear subspaces with the unit sphere in \(\mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ^{k-{ p}+ \mathrm{{card}} ( \mathcal {Q} ) +1}\), and the polynomial \(G\) is independent of the \(\lambda \)’s. Hence, the semi-algebraically connected components of \(( \tilde{S}^{0} )_{a\le G \le b}\) and \(( \tilde{S}^{0} )_{G=c}\) are in correspondence with those of \(( \hbox {Bas} ( \{ F \} , \tilde{\mathcal {Q}} ) )_{a\le G \le b}\) and \(( \hbox {Bas} ( \{ F \} , \tilde{\mathcal {Q}} ) )_{G=c}\), respectively.

Part (2) is clear from the definition of \(\mathcal {M}^{0}\). \(\square \)

Remark 5.20

Note that the elements of \(\mathcal {D}^{0}\) are the \(( B,G )\)-pseudo-critical values of the family \(\{ F \} \cup \tilde{\mathcal {Q}}\), for the matrix \(B=\mathcal {H}_{\mathrm{{card}} ( \mathcal {Q} ) +1,2k-p+ \mathrm{{card}} ( \mathcal {Q} ) +1}\), and thus satisfy the properties of Proposition 4.6 with respect to the level sets of the polynomial \(G\) restricted to \(\hbox {Bas} ( \{ F \} , \tilde{\mathcal {Q}} ) \subset \mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ^{{ k}} \times \mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ^{{ k}-{ p}+ \mathrm{{card}} ( \mathcal {Q} ) +1}\). Part (1) of Lemma 5.19 implies that the same properties also hold for \(\tilde{S}^{0}\) with respect to the values \(\mathcal {D}^{0}\) (recall that \(\tilde{S}^{0}\) is defined in Notation 5.16 as the projection of \(\hbox {Bas} ( \{ F \} , \tilde{Q} )\) to \(\mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ^{{ k}}\)).

5.6 Definition of \(\mathcal {N} , \tilde{S}^{1}\), and \(\mathcal {B}\)

We will use the two following propositions which use the definitions given above.

Proposition 5.21

The tuple \( ( \tilde{S} , \tilde{\mathcal {M}} , \ell , \tilde{S}^{0} ,\mathcal {D}^{0} ,\mathcal {M}^{0} )\) is special (cf. Definition 3.2).

Proof

Follows from Lemma 5.19 and Definition 3.2. \(\square \)

We denote \(\mathcal {N} = \pi _{[ 1, \ell ]} ( \tilde{\mathcal {M}} \cup \mathcal {\mathcal {M}}^{0} \cup \tilde{\mathcal {A}} )\), \(\tilde{S}^{ 1}_{\mathcal {}} = \tilde{S}_{\mathcal {N}}\) and \(\mathcal {B} = ( \tilde{S}^{0} )_{\mathcal {N}}\). Note that \(\tilde{S}^{0} \cap \tilde{S}^{ 1}_{\mathcal {}} = \mathcal {B} .\)

Proposition 5.22

The semi-algebraic set \(\tilde{S}^{0} \cup \tilde{S}^{ 1}_{\mathcal {}}\) has good connectivity property with respect to \(\tilde{S}\).

Proof

Follows from Propositions 5.21 and 3.4. \(\square \)

6 Critical Points and Minors

In the previous section, \(\tilde{S}^{0}\) is described as the image of a projection applied to the basic semi-algebraic set \(\hbox {Bas} ( \{ F \} , \tilde{\mathcal {Q}} )\) (see Remark 5.20). This means that we cannot hope to compute a roadmap of \(\tilde{S}^{0}\) by a divide-and-conquer algorithm directly since the input to such an algorithm should be a basic semi-algebraic set. In this section, we give an alternative description of \(\tilde{S}^{0}\) (see Proposition 6.4 below) as a (limit of) union of basic semi-algebraic sets which allows us to get past this problem.

6.1 Description of Critical Points

In the case when \(\mathcal {P} = \{ P_{1} , \ldots ,P_{m} \}\), \(m<k\), is in general position with respect to \(G \in \mathrm{R}[ X_{1} , \ldots ,X_{{ k}} ]\), we can describe \(\hbox {Crit} ( \mathcal {P} ,G ) \subset \mathrm{R}^{{ k}}\) as follows.

Define the Jacobian matrix

$$\begin{aligned} \hbox {Jac}&= \left( \begin{array}{c@{\quad }c@{\quad }c@{\quad }c} \frac{\partial G}{\partial X_{1}} &{} \frac{\partial P_{1}}{\partial X_{1}} &{}\cdots &{} \frac{\partial P_{m}}{\partial X_{1}}\\ \vdots &{} \vdots &{}&{} \vdots \\ \frac{\partial G}{\partial X_{{ k}}} &{} \frac{\partial P_{1}}{\partial X_{{ k}}} &{} \cdots &{} \frac{\partial P_{m}}{\partial X_{{ k}}} \end{array}\right) \end{aligned}$$

whose rows are indexed by \([ 1,k ]\) and columns by \([ 0,m ]\).

For \(J \subset [ 1,k ]\) and \(J' \subset [ 0,m ]\), let \(\hbox {Jac} ( J,J' )\) the matrix obtained from \(\hbox {Jac}\) by extracting the rows numbered by elements of \(J\), and the columns numbered by elements of \(J'\).

We use the following convenient notation in what follows. For any finite set \(X\), and any integer \(r\ge 0\), we will denote by \(\left( {\begin{array}{c}X\\ r\end{array}}\right) \) the set of all subsets of \(X\) of cardinality \(r\).

For each \(0 \le r \le m\), and each \(J \in \left( {\begin{array}{c}[ 1,k ]\\ r\end{array}}\right) , J' \in \left( {\begin{array}{c}[ 0,m ]\\ r\end{array}}\right) \), let

$$\begin{aligned} \hbox {jac} ( J,J' ) = \det ( \hbox {Jac} ( J,J' ) ) . \end{aligned}$$

For every \(i \in [ 1,k ] \setminus J\), and \(i' \in [ 0,m ] \setminus J'\), let

$$\begin{aligned} \hbox {Eq} ( J,J' )&= \mathcal {P} \cup \bigcup _{i \in [ 1,k ] \setminus J,i' \in [ 0,m ] \setminus J'} \hbox {jac} ( J \cup \{ i \} ,J' \cup \{ i' \} ) , \end{aligned}$$

and

$$\begin{aligned} \hbox {Cons} ( J,J' )&= \big \{ x \in {\mathrm{{Zer}}} \big ( \hbox {Eq} ( J,J' ) , \mathrm{R}^{{ k}} \big )\mid \hbox {jac} ( J,J' ) ( x ) \ne 0 \big \} . \end{aligned}$$

Proposition 6.1

If \(\mathcal {P}= \{ P_{1} , \ldots ,P_{m} \}\) is in general position with respect to \(G \in \mathrm{R}[ X_{1} , \ldots ,X_{{ k}} ]\), the finite variety \(\mathrm{{Crit}} ( \mathcal {P},G )\) is the union of the various

$$\begin{aligned} \mathrm{{Cons}} ( J,J' ),\quad 0 \le r \le m,\quad J \in \left( {\begin{array}{c}[1,k]\\ r\end{array}}\right) ,\quad J' \in \left( {\begin{array}{c}[ 0,m ]\\ r\end{array}}\right) . \end{aligned}$$

Proof

We first prove that \(\hbox {Crit} ( \mathcal {P},G )\) is contained in the union of the various \(\hbox {Cons} ( J,J' ) ,0 \le r \le m, J \in \left( {\begin{array}{c}[ 1,k ]\\ r\end{array}}\right) ,J' \in \left( {\begin{array}{c}[ 0,m ]\\ r\end{array}}\right) \). It follows from Definition 2.1 that each \(x \in \hbox {Crit} ( \mathcal {P},G )\) is contained in the projection to \(\mathrm{R}^{{ k}}\) of the set of solutions to the system of equations, \(\hbox {CritEq} ( \mathcal {P} ,G )\) (cf. (1)).

Substituting \(X=x\) in the above system, we obtain the following system of homogeneous linear equations in \(\lambda = ( \lambda _{0} , \ldots , \lambda _{m} )\).

$$\begin{aligned} \lambda _{0} \frac{\partial G}{\partial X_{i}} ( x ) + \sum ^{m}_{j=1} \lambda _{j} \frac{\partial P_{j}}{\partial X_{i}} ( x )&= 0,\quad i=1, \ldots ,k. \end{aligned}$$
(10)

Let the rank of the matrix of coefficients of the above system be \(r_{x}\). Then \(r_{x} \le m\), since there must exist a \(\lambda = ( \lambda _{0} , \ldots , \lambda _{m} )\) satisfying (10) and \(\lambda \ne ( 0, \ldots ,0 )\) since it has to satisfy also the equation

$$\begin{aligned} \sum _{j=0}^{m} \lambda _{j}^{2} -1&= 0. \end{aligned}$$

Then there exists \(J \subset \left( {\begin{array}{c}[ 1,k ]\\ r_{x}\end{array}}\right) ,J' \subset \left( {\begin{array}{c}[ 0,m ]\\ r_{x}\end{array}}\right) \) such that the \(r_{x} \times r_{x}\) sub-matrix of the matrix of coefficients with rows indexed by \(J\) and columns indexed by \(J'\) has full rank and hence \(\hbox {jac} ( J,J' ) ( x ) \ne 0\). Then clearly for every \(i \in [ 1,k ] \setminus J\), and \(i' \in [ 0,m ] \setminus J'\),

$$\begin{aligned} \hbox {jac} ( J \cup \{ i \} ,J' \cup \{ i' \} ) ( x ) =0. \end{aligned}$$

Hence, \(x \in \hbox {Cons} ( J,J' )\) using the definition of the set \(\hbox {Cons} ( J,J' )\). This completes the proof that \(\hbox {Crit} ( \mathcal {P},G )\) is contained in union of the various \(\hbox {Cons} ( J,J' ), 0 \le r \le m,J \in \left( {\begin{array}{c}[ 1,k ]\\ r\end{array}}\right) ,J' \in \left( {\begin{array}{c}[ 0,m ]\\ r\end{array}}\right) \).

To prove the reverse inclusion fix, \(r\), \(0 \le r \le m\), \(J \in \left( {\begin{array}{c}[ 1,k ]\\ r\end{array}}\right) ,J' \in \left( {\begin{array}{c}[ 0,m ]\\ r\end{array}}\right) \), and let \(x \in \hbox {Cons} ( J,J' )\). Then \(\hbox {jac} ( J,J' ) ( x ) \ne 0\), and for each \(i \in [ 1,k ] \setminus J\) and \(i' \in [ 0,m ] \setminus J'\), \(\hbox {jac} ( J \cup \{ j \} ,J' \cup \{ i' \} ) ( x )= 0\). We now show that there exists \(\lambda = ( \lambda _{0} , \ldots , \lambda _{m} )\) such that \(( x, \lambda )\) satisfy the system of equations (1). It follows from Cramer’s rule that for each \(i \in J\), the equation

$$\begin{aligned} \lambda _{0} \frac{\partial G}{\partial X_{i}} ( x ) + \sum ^{m}_{j=1} \lambda _{j} \frac{\partial P_{j}}{\partial X_{i}} ( x )&= 0 \end{aligned}$$

is satisfied after making the substitution

$$\begin{aligned} \lambda _{j}&= - \sum _{j' \in J' \setminus \{ j \}} \frac{\hbox {jac} ( J,J' \setminus \{ j \} \cup \{ j' \} ) ( x )}{\hbox {jac} ( J,J' ) ( x )} \lambda _{j'} \end{aligned}$$
(11)

for each \(j \in J'\).

Moreover, substituting the expressions in (11) in the equations indexed by \(i \in [ 1,k ] \setminus J\) in (1), clearing the denominator \(\hbox {jac} ( J,J' ) ( x )\), we have that the coefficient of \(\lambda _{i'}\) for \(i' \in [ 0,m ] \setminus J'\) equals \(\hbox {jac} ( J \cup \{ i \} ,J' \cup \{ i' \} ) ( x )\), and hence equal to \(0\). Thus, the equations indexed by \(i \in [ 1,k ] \setminus J\) in (1) are satisfied as well. Finally since \(r \le m<m+1\), we can assume that there exists \(\lambda = ( \lambda _{0} , \ldots , \lambda _{m} ) \in \mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ^{{ m}+1}\) with not all coordinates equal to \(0 \), such that \(( x, \lambda )\) satisfy all but the last equation in (1), and it follows that there exists \(\lambda \) such that \(( x, \lambda )\) satisfy (1), and hence \(x \in \hbox {Crit} ( \mathcal {P},G )\). This proves the reverse inclusion. \(\square \)

6.2 Description of \(\tilde{S}^{0}\) Using Minors

Notation 6.2

Following Notations 5.1 and 5.4:

  1. (1)

    Let \(\ell <p \le k\), \(\tilde{\mathcal {Q}}' \subset \tilde{Q}\) and \( \tilde{\mathcal {P}} \cup \tilde{\mathcal {Q}}' = \{ F_{1} , \ldots ,F_{m} \}\).

  2. (2)

    Define the matrix

    $$\begin{aligned} \hbox {Jac} ( \ell , \tilde{\mathcal {Q}}' )&= \left( \begin{array}{c@{\quad }c@{\quad }c@{\quad }c} \frac{\partial G}{\partial X_{\ell +1}} &{} \frac{\partial F_{1}}{\partial X_{\ell +1}} &{} \cdots &{} \frac{\partial F_{m}}{\partial X_{\ell +1}} \\ \vdots &{} \vdots &{}&{} \vdots \\ \frac{\partial G}{\partial X_{{ k}}} &{} \frac{\partial F_{1}}{\partial X_{{ k}}} &{} \cdots &{} \frac{\partial F_{m}}{\partial X_{{ k}}} \end{array}\right) \end{aligned}$$

    whose rows are indexed by \([ \ell +1,k ]\) and columns by \([ 0,m ]\).

    For each \(\alpha = ( \tilde{\mathcal {Q}}' ,r,J,J' )\) with \(\tilde{\mathcal {Q}}' \subset \tilde{Q}\), \(0 \le r \le m\), \(J \in \left( {\begin{array}{c}[ \ell +1,k ]\\ r\end{array}}\right) , J' \in \left( {\begin{array}{c}[ 0,m ]\\ r\end{array}}\right) \) denote by

    $$\begin{aligned} \hbox {jac} ( \alpha ) = \det ( \hbox {Jac} ( \ell , \tilde{\mathcal {Q}}' ) ( J,J' ) ) . \end{aligned}$$

    Moreover, for each \(i \in [ \ell +1,k ] \setminus J\), \(i' \in [ 0,m ] \setminus J'\), let

    $$\begin{aligned} \hbox {jac} ( \alpha ,i,i' ) = \det ( \hbox {Jac} ( \ell , \tilde{\mathcal {Q}}' ) ( J \cup \{ i \} ,J' \cup \{ i' \} ) ) . \end{aligned}$$

    Let

    $$\begin{aligned} \mathcal {P}^{0} ( \alpha )&= \tilde{\mathcal {P}} \cup \tilde{\mathcal {Q}}' \cup \bigcup _{i \in [ \ell +1,k ] \setminus J,i' \in [ 0,m ] \setminus J'} \{ \hbox {jac} ( \alpha ,i,i' ) \} , \end{aligned}$$
    (12)
    $$\begin{aligned} \mathcal {Q}^{0} ( \alpha )&= \tilde{\mathcal {Q}} \cup \{ \hbox {jac} ( \alpha )^{2} - \gamma \} \end{aligned}$$
    (13)

    where \(\gamma \) is a new variable.

  3. (3)

    Define

    $$\begin{aligned} S^{0} ( \alpha )&= \hbox {Bas} \big ( \mathcal {P}^{0} ( \alpha ) ,\mathcal {Q}^{0} ( \alpha ) \big ) \subset \mathrm{R}\langle \zeta , \varepsilon , \delta , \gamma \rangle ^{{ k}} . \end{aligned}$$

Notation 6.3

Fixing \(\tilde{\mathcal {P}} , \tilde{\mathcal {Q}} , \ell \) with \(0 \le \ell <p \le k \), we denote by \(\mathcal {I ( \tilde{P} , \tilde{Q} , \ell )}\) the set of quadruples \(\alpha = ( \tilde{\mathcal {Q}}' ,r,J,J' )\) with \(\tilde{\mathcal {Q}}' \subset \tilde{Q}\), \(0 \le r \le m\), \(J \in \left( {\begin{array}{c}[ {\ell } +1,k ]\\ r\end{array}}\right) , J' \in \left( {\begin{array}{c}[ 0,m ]\\ r\end{array}}\right) \).

Proposition 6.4

$$\begin{aligned} \begin{array}{lll} \tilde{S}^{0}&= \lim _{\gamma } \big ( \bigcup _{\alpha \in \mathcal {I ( \tilde{P} , \tilde{Q} , \ell )}} S^{0} ( \alpha ) \big ) . \end{array} \end{aligned}$$

Proof

We first prove that

$$\begin{aligned} \tilde{S}^{0}&= \bigcup _{\alpha \in \mathcal {I ( \tilde{P} , \tilde{Q} , \ell )}} \big \{ x \in \hbox {Bas} \big ( \mathcal {P}^{0} ( \alpha ) , \tilde{\mathcal {Q}} \big ) \mid \hbox {jac} ( \alpha ) ( x ) \ne 0\big \} . \end{aligned}$$
(14)

Using Notation 5.16, notice that for each \(\tilde{\mathcal {Q}}' \subset \tilde{Q}\), \(\tilde{S}^{0} ( \tilde{\mathcal {Q}}' )\) is the set of \(G\)-critical points of \({\mathrm{{Zer}}} ( \tilde{\mathcal {P}} \cup \tilde{\mathcal {Q}}' ( w, \cdot ) , \mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ^{{ k}} )\) contained in \(\tilde{S}\), as \(w\) varies over \(\mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ^{\ell }\), and \(\tilde{S}^{0}=\bigcup _{\tilde{\mathcal {Q}}' \subset \tilde{Q}} \tilde{S}^{0} ( \tilde{\mathcal {Q}}' )\). It follows from Proposition 6.1 that for each \(\tilde{\mathcal {Q}}' \subset \tilde{Q}\),

$$\begin{aligned} \tilde{S}^{0} \big ( \tilde{\mathcal {Q}}' \big )&= \big \{ x \in \hbox {Bas} \big ( \mathcal {P}^{0} ( \alpha ) , \tilde{\mathcal {Q}}\big ) \mid \hbox {jac} ( \alpha ) ( x ) \ne 0\big \} , \end{aligned}$$
(15)

and this proves (14).

Noticing that all the sets \(\{ x \in \hbox {Bas} ( \mathcal {P}^{0} ( \alpha ) , \tilde{\mathcal {Q}} ) \mid \hbox {jac} ( \alpha ) ( x ) \ne 0\} \subset \mathrm{R}\langle \zeta , \varepsilon , \delta \rangle ^{{ k}}\) are bounded, it follows from the definition of \(S^{0} ( \alpha )\) that

$$\begin{aligned} \lim _{\gamma }S^{0} ( \alpha )&= {\overline{\{ x \in {\hbox {Bas}} (\mathcal {P}^{0} (\alpha ) , \tilde{\mathcal {Q}}) \mid {\hbox {jac}} (\alpha ) (x) \ne 0\}}} , \end{aligned}$$
(16)

using [2, Proposition 11.56.

Also, since \(\tilde{S}^{0}\) is closed it follows from (15) that

$$\begin{aligned} \tilde{S}^{0}&= \bigcup _{\alpha \in \mathcal {I ( \tilde{P} , \tilde{Q} , \ell )}} {\overline{\{ x \in \hbox {Bas} ( \mathcal {P}^{0} ( \alpha ) , \tilde{\mathcal {Q}} ) \mid {\hbox {jac}} ( \alpha ) ( x ) \ne 0 \}}} . \end{aligned}$$

The proposition now follows from (16). \(\square \)

Remark 6.5

Note that if the description of \(S\) does not involve any inequality, this is the first time that an inequality appears in the construction.

6.2.1 Definition of \(\mathcal {A} ( \alpha )\)

Since we have covered \(\tilde{S}^{0}\) by the (limit of the) union of the \(S^{0} ( \alpha )\), we need to choose a finite set of points ensuring connectivity properties.

Notation 6.6

For each \(\alpha \in \mathcal {I} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} , \ell )\), we denote (using Notation 5.10)

$$\begin{aligned} \mathcal {A} ( \alpha )&= \hbox {MinDi} ( S^{0} ( \alpha ) , \mathcal {B} ) \cup \Big ( \bigcup _{\beta \in \mathcal {I ( \tilde{P} , \tilde{Q} , \ell )}} \hbox {MinDi} \big ( S^{0} ( \alpha ) ,S^{0} ( \beta ) \big ) \Big ) . \end{aligned}$$

We have the following property of the finite sets \(\mathcal {A} ( \alpha ) , \alpha \in \mathcal {I} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} , \ell )\).

Proposition 6.7

For every \(\alpha , \beta \) in \(\mathcal {I ( \tilde{P} , \tilde{Q} , \ell )}\) the following are true.

  1. (1)

    \(\bigcup _{\alpha \in \mathcal {I} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} , \ell )} \lim _{\gamma } ( \mathcal {A ( \alpha )} ) \supset \mathcal {B}\).

  2. (2)

    For \(C\) and \(D\) semi-algebraically connected components (not necessarily distinct) of \(S^{0} ( \alpha )\) and \(S^{0} ( \beta )\) such that \(\lim _{\gamma } ( C ) \cap \lim _{\gamma } ( D )\) is non-empty, \(\lim _{\gamma } ( C \cap \mathcal {A} ( \alpha ) ) \cap \lim _{\gamma } ( D \cap \mathcal {A} ( \beta ) )\) is non-empty, and meets every semi-algebraically connected component of \(\lim _{\gamma } ( C ) \cap \lim _{\gamma } (D)\).

  3. (3)

    \(\mathcal {A ( \alpha )}\) meets every semi-algebraically connected component of \(S^{0} ( \alpha )\).

Proof

Part (1) follows from Proposition 5.11.

Part (2) follows from Proposition 5.12.

Part (3) is a special case of Part (2). \(\square \)

7 Divide and Conquer Algorithm

7.1 Description of the Tree \(\hbox {Tree} ( V,\mathcal {A} )\), and its Associated Roadmap

We first describe the tree which is going to be constructed in the algorithm, using the definitions in the two former sections. We then prove that the (limits of the) union of the leaves of the tree give a roadmap.

Since new infinitesimals will be added at each level of the tree, we need the following notation.

Notation 7.1

We consider an ordered domain \(\hbox {D}\) contained in a real closed field \(\mathrm{R}\). We denote by \(\hbox {D}_{t}\) the polynomial ring \(\hbox {D}[ \eta ]\) and we denote by \(\mathrm{R}_{t}\) the real closed field \(\mathrm{R}\langle \eta \rangle \) where \(\eta = ( \eta _{1} , \ldots , \eta _{t} )\) and \(\eta _{i} = \left( \zeta _{i} , \varepsilon _{i} , \delta _{i} , \gamma _{i} \right) \). By convention \(\mathrm{R}_{0} = \mathrm{R}\) and \(\hbox {D}_{0} = \hbox {D}\).

7.1.1 Description of the Tree \(\mathrm{{Tree}} ( V,\mathcal {A})\)

We start with a bounded real algebraic variety \(V = {\mathrm{{Zer}}} ( P, \mathrm{R}^{{ k}})\), strongly of dimension \(\le k'\) (assumed to be a power of \(2\) for simplicity), and suppose that \(\mathcal {A} \subset V\) is a finite set of points meeting every semi-algebraically connected component of \(V\). The algorithm constructs a rooted tree, which we denote by \(\hbox {Tree} (V,\mathcal {A} )\).

More precisely, the root, \(\mathfrak {r}\), of \(\hbox {Tree} ( V,\mathcal {A} )\) has level \(0\), contains the empty string \(s ( \mathfrak {r} )\), the real algebraic variety \(\hbox {Bas} ( \mathfrak {r} )= V\), and the finite set of points \(\mathcal {A} ( \mathfrak {r} )= \mathcal {A}\). A node \(\mathfrak {n}\) of the tree \(\hbox {Tree} ( V,\mathcal {A} )\) at level \(t \ne 0\) contains a string \(s ( \mathfrak {n} ) \in \{ 0,1 \}^{t}\), a basic semi-algebraic set \(\hbox {Bas} ( \mathfrak {n} ) = \{ w ( \mathfrak {n} ) \} \times \hbox {Bas} ( \mathcal {P} ( \mathfrak {n} ) ,\mathcal {Q} ( \mathfrak {n} ) ) \subset \mathrm{R}_{{ t}}^{{ k}}\), such that \(\hbox {Bas} ( \mathfrak {n} )\) is strongly of dimension \(\le k' /2^{t}\), \(w ( \mathfrak {n} ) \in \mathrm{R}_{{ t}}^{\mathrm{{Fix}} ( \mathfrak {n} )}\), defining

$$\begin{aligned} \hbox {Fix} ( \mathfrak {n} ) = \sum _{i=1}^{t} s ( \mathfrak {n} )_{i} k' /2^{i} , \end{aligned}$$

and a finite number of points \(\mathcal {A} ( \mathfrak {n} ) \subset \hbox {Bas} ( \mathfrak {n} )\) meeting every semi-algebraically connected components of \(\hbox {Bas} ( \mathfrak {n} )\). A node \(\mathfrak {n}\) of the tree \(\hbox {Tree} ( V,\mathcal {A} )\) of level \(t \ne 0\) is either a left child, if the last bit of \(s ( \mathfrak {n} )\) is \(0\), or a right child if the last bit of \(s ( \mathfrak {n} )\) is \(1\).

If the level of the node \(\mathfrak {n}\) is \(< \log ( k' )\), we construct the left children and right children of \(\mathfrak {n}\) as follows. We replace \(\hbox {Bas} ( \mathfrak {n} )\) by a semi-algebraic set \(\widetilde{\hbox {Bas}} ( \mathfrak {n} ) = \{ w ( \mathfrak {n} ) \} \times \hbox {Bas} ( \tilde{\mathcal {P}} ( \mathfrak {n} ) , \tilde{\mathcal {Q}} ( \mathfrak {n} ) ) \subset \mathrm{R}_{{ t}}^{{ k}}\) (see Notation 5.4) such that

  1. (1)

    \(\lim _{\zeta _{t}} ( \widetilde{\hbox {Bas}} ( \mathfrak {n} ) ) =\hbox {Bas} ( \mathfrak {n} )\) (using Proposition 5.5), and

  2. (2)

    \(\widetilde{\hbox {Bas}} ( \mathfrak {n} )\) is strongly of dimension \(\le k' /2^{t}\) (using Corollary 5.8).

We define semi-algebraic subsets \(\widetilde{\hbox {Bas}} ( \mathfrak {n} )^{0} , \widetilde{\hbox {Bas}} ( \mathfrak {n} )^{1}\) of \(\widetilde{\hbox {Bas}} ( \mathfrak {n} )\), with \(\widetilde{\hbox {Bas}} ( \mathfrak {n} )^{ 1}\) strongly of dimension \(\le k'/2^{{ t}+1}\), by the method described in Sect. 5, with \(p= k'/2^{t}\), \(\ell =p/2= k'/2^{{ t}+1}\).

We define \(\mathcal {N ( \mathfrak {n} )}\), \(\tilde{\mathcal {A}} ( \mathfrak {n} )\), and \(\mathcal {\mathcal {B}} ( \mathfrak {n} )\) as in Sect. 5. For every \(w \in \mathcal {N ( \mathfrak {n} )}\) we have a right child \(\mathfrak {m}\) of the node \(\mathfrak {n}\), with

$$\begin{aligned} \begin{aligned} s ( \mathfrak {m} )&= s ( \mathfrak {n} ) 1, \\ w ( \mathfrak {m} )&= ( w ( \mathfrak {n} ) ,w ) , \\ \hbox {Bas} ( \mathfrak {m} )&= \hbox {Ext}\left( \widetilde{\hbox {Bas}} ( \mathfrak {n} )_{w ( \mathfrak {m} )} , \mathrm{R}_{t} \right) , \\ \mathcal {A} ( \mathfrak {m} )&= \big ( \tilde{\mathcal {A} ( \mathfrak {n} ) \cup \mathcal {\mathcal {B} ( \mathfrak {n} )}} \big )_{w ( \mathfrak {m})}. \end{aligned} \end{aligned}$$
(17)

Recall that \(\widetilde{\hbox {Bas}} ( \mathfrak {n} )^{0} \subset \mathrm{R}_{t} \langle \zeta _{{ t}+1} , \varepsilon _{{ t}+1} , \delta _{{ t}+1} \rangle ^{{ k}}\) is defined as an image of a certain semi-algebraic set under a projection along Lagrangian variables. We are able to identify (by the method of Sect. 6.2, using Notation 6.3) a finite family \(( \hbox {Bas} ( \mathfrak {n} )^{0} ( \alpha ) )_{\alpha \in \mathcal {I ( \mathfrak {n} )}}\) (with \(\mathcal {I} ( \mathfrak {n} ) =\mathcal {I} ( \tilde{\mathcal {P}} ( \mathfrak {n} ) , \tilde{\mathcal {Q}} ( \mathfrak {n} ) , k'/2^{{ t}+1} )\) of basic semi-algebraic subsets of \(\hbox {Ext}\left( \widetilde{\hbox {Bas}} ( \mathfrak {n} )^{0} , \mathrm{R}_{{ t}+1} \right) \), with each

$$\begin{aligned} \begin{array}{lll} \hbox {Bas} ( \mathfrak {n} )^{0} ( \alpha )&:= \{ w ( \mathfrak {n} ) \} \times \hbox {Bas} \big ( \mathcal {P}^{0} ( \alpha ) ,\mathcal {Q}^{0} ( \alpha ) \big ) \end{array} \subset \mathrm{R}_{{ t}+1}^{{ k}} , \end{aligned}$$

such that

$$\begin{aligned} \bigcup _{\alpha \in \mathcal {I} ( \mathfrak {n} )} \lim _{\gamma _{{ t}+1}} \big ( \hbox {Bas} ( \mathfrak {n} )^{0} ( \alpha ) \big ) =\widetilde{\hbox {Bas}} ( \mathfrak {n} )^{0} \end{aligned}$$

using Proposition 6.4.

For each \(\alpha \in \mathcal {I ( \mathfrak {n} )}\) we include a left child node \(\mathfrak {n} ( \alpha )\), with

$$\begin{aligned} s ( \mathfrak {n} ( \alpha ) )&= s ( \mathfrak {n} ) 0,\\ w ( \mathfrak {n} ( \alpha ) )&= w ( \mathfrak {n} ) ,\\ \hbox {Bas} ( \mathfrak {n} ( \alpha ) )&= \hbox {Bas} ( \mathfrak {n} )^{0}( \alpha ) ,\\ \mathcal {A} ( \mathfrak {n} ( \alpha ) )&= \mathcal {A} ( \alpha ) \hbox { (using the definition in Sect.~6.2.1)}. \end{aligned}$$

If the level of the node \(\mathfrak {n}\) is \(\log ( k' )\), then \(\mathfrak {n}\) is a leaf of \(\hbox {Tree} ( V,\mathcal {A} ) .\) Note that the basic semi-algebraic set \(\hbox {Bas} ( \mathfrak {n} )\) contained in a leaf \(\mathfrak {n}\) is strongly of dimension \(\le 1\).

Definition 7.2

We denote by \(\hbox {Leav} ( V,\mathcal {A} )\) the set of leaf nodes of \(\hbox {Tree} ( V,\mathcal {A} )\). When \(\mathfrak {n}\) is a node in \(\hbox {Tree} ( V,\mathcal {A} )\), we denote by

  1. (1)

    \(\hbox {Leav} ( \mathfrak {n} )\) the set of leaves of the subtree of \(\hbox {Tree} ( V,\mathcal {A} )\) rooted at \(\mathfrak {n}\),

  2. (2)

    \(\hbox {Leav}^{1} ( \mathfrak {n} )\) the set of leaves \(\mathfrak {l}\) of the subtree of \(\hbox {Tree} ( V,\mathcal {A} )\) rooted at \(\mathfrak {n}\) with \(s ( \mathfrak {l} )\) consisting of \(s ( \mathfrak {n} )\) followed only by 1,

  3. (3)

    \(\hbox {Leav}^{0} ( \mathfrak {n} )\) the set of leaves \(\mathfrak {l}\) of the subtree of \(\hbox {Tree} ( V,\mathcal {A} )\) rooted at \(\mathfrak {n}\) with \(s ( \mathfrak {l} )\) consisting of \(s ( \mathfrak {n} )\) followed only by 0.

Note that for every node \(\mathfrak {n}\) of level \(t\) of \(\hbox {Tree} ( V,\mathcal {A} )\) we have

$$\begin{aligned} \mathcal {A} ( \mathfrak {n} )&\subset \bigcup _{\mathfrak {l} \in \hbox {Leav}^{1} ( \mathfrak {n} )} \lim _{\zeta _{{ t}+1}} ( \mathcal {A} ( \mathfrak {l} ) ) , \end{aligned}$$
(18)
$$\begin{aligned} \mathcal {B} ( \mathfrak {n} )&\subset \bigcup _{\mathfrak {l} \in \hbox {Leav}^{1} ( \mathfrak {n} )} \lim _{\gamma _{{ t}+1}} ( \mathcal {A} ( \mathfrak {l} ) ) . \end{aligned}$$
(19)

A useful fact is the following.

Proposition 7.3

Suppose that \(\mathcal {A}_{1} , \mathcal {A}_{2}\) are finite subsets of \(V\), and \(\mathcal {A} =\mathcal {A}_{1} \cup \mathcal {A}_{2}\).

Then

$$\begin{aligned} \bigcup _{\mathfrak {l} \in \mathrm{{Leav}} ( V,\mathcal {A}_{1} ) \cup \mathrm{{Leav}} ( V, \mathcal {A}_{2})}\mathrm{{Bas}} ( \mathfrak {l} )&= \bigcup _{\mathfrak {l} \in \mathrm{{Leav}} ( V, \mathcal {A} )} \mathrm{{Bas}} ( \mathfrak {l} ) . \end{aligned}$$

Proof

We prove by induction on the level \(t\) the two following statements.

  1. (1)

    For each node \(\mathfrak {m}\) of \(\hbox {Tree} ( V,\mathcal {A}_{1} )\) (respectively \(\hbox {Tree} ( V, \mathcal {\mathcal {A}_{2}} )\)) with \(\hbox {level} ( \mathfrak {m} ) =t\), there exists a node \(\mathfrak {m}'\) of \(\hbox {Tree} ( V, \mathcal {A} )\) with level \(t\) such that

    $$\begin{aligned} \begin{aligned} \big ( w ( \mathfrak {m}' ) ,s ( \mathfrak {m}' ) , \tilde{\mathcal {P}} ( \mathfrak {m}' ) , \tilde{\mathcal {Q}} ( \mathfrak {m}' ) \big )&= \big ( w ( \mathfrak {m} ) ,s ( \mathfrak {m} ) , \tilde{\mathcal {P}} ( \mathfrak {m} ) , \tilde{\mathcal {Q}} ( \mathfrak {m} ) \big ) ,\\ \mathcal {A} ( \mathfrak {m}' )&\supset \mathcal {A} ( \mathfrak {m} ) . \end{aligned} \end{aligned}$$
    (20)
  2. (2)

    For each node \(\mathfrak {m}\) of \(\hbox {Tree} ( V, \mathcal {A} )\) with \(\hbox {level} ( \mathfrak {m} ) =t\), either there exists a node \(\mathfrak {m}_{1}\) of \(\hbox {Tree} ( V,\mathcal {A}_{1} )\) with level \(t\) such that

    $$\begin{aligned} \begin{aligned} \big ( w ( \mathfrak {m}_{1} ) ,s ( \mathfrak {m}_{1} ) , \tilde{\mathcal {P}} ( \mathfrak {m}_{1} ) , \tilde{\mathcal {Q}} ( \mathfrak {m}_{1} ) \big )&= \big ( w ( \mathfrak {m} ) ,s ( \mathfrak {m} ) , \tilde{\mathcal {P}} ( \mathfrak {m} ) , \tilde{\mathcal {Q}} ( \mathfrak {m} ) \big ) , \\ \mathcal {A} ( \mathfrak {m}_{1} )&= \mathcal {A} ( \mathfrak {m} ) , \end{aligned} \end{aligned}$$
    (21)

    or there exists a node \(\mathfrak {m}_{2}\) of \(\hbox {Tree} ( V, \mathcal {\mathcal {A}_{2}} )\) with level \(t\) such that

    $$\begin{aligned} \begin{aligned} \big ( w ( \mathfrak {m}_{2} ) ,s ( \mathfrak {m}_{2} ) , \tilde{\mathcal {P}} ( \mathfrak {m}_{2} ) , \tilde{\mathcal {Q}} ( \mathfrak {m}_{2} ) \big )&= \big ( w ( \mathfrak {m} ) ,s ( \mathfrak {m} ) , \tilde{\mathcal {P}} ( \mathfrak {m} ) , \tilde{\mathcal {Q}} ( \mathfrak {m} ) \big ) , \\ \mathcal {A} ( \mathfrak {m}_{2} )&= \mathcal {A} ( \mathfrak {m} ) , \end{aligned} \end{aligned}$$
    (22)

    or there exists a node \(\mathfrak {m}_{1}\) of \(\hbox {Tree} ( V,\mathcal {A}_{1} )\) and a node \(\mathfrak {m}_{2}\) of \(\hbox {Tree} ( V, \mathcal {A}_{2} )\), both with level \(t\) such that

    $$\begin{aligned} \big ( w ( \mathfrak {m}_{1} ) ,s ( \mathfrak {m}_{1} ) , \tilde{\mathcal {P}} ( \mathfrak {m}_{1} ) , \tilde{\mathcal {Q}} ( \mathfrak {m}_{1} ) \big )&= \big ( w ( \mathfrak {m}_{2} ) ,s ( \mathfrak {m}_{2} ) , \tilde{\mathcal {P}} ( \mathfrak {m}_{2} ) , \tilde{\mathcal {Q}} ( \mathfrak {m}_{2} ) \big ) \nonumber \\&= \big ( w ( \mathfrak {m} ) ,s ( \mathfrak {m} ) , \tilde{\mathcal {P}} ( \mathfrak {m} ) , \tilde{\mathcal {Q}} ( \mathfrak {m} ) \big ) ,\\ \mathcal {A} ( \mathfrak {m}_{1} ) \cup \mathcal {A} ( \mathfrak {m}_{2} )&= \mathcal {A} ( \mathfrak {m} ) . \nonumber \end{aligned}$$
    (23)

The base case is when \(t=0\), and in this case the claim is obviously true. We now prove the inductive step from \(t-1\) to \(t\).

  1. (1)

    Suppose that the node \(\mathfrak {m}\) is a child of \(\mathfrak {n}\). Since \(\hbox {level} ( \mathfrak {n} ) =t-1\), by induction hypothesis there exists a node \(\mathfrak {n}'\) in \(\hbox {Tree} ( V, \mathcal {A} )\) with level \(t-1\) such that

    $$\begin{aligned} \big ( w ( \mathfrak {n}' ) ,s ( \mathfrak {n}' ) , \tilde{\mathcal {P}} ( \mathfrak {n}' ) , \tilde{\mathcal {Q}} ( \mathfrak {n}' ) \big )&= \big ( w ( \mathfrak {n} ) ,s ( \mathfrak {n} ) , \tilde{\mathcal {P}} ( \mathfrak {n} ) , \tilde{\mathcal {Q}} ( \mathfrak {n} ) \big ) ,\\ \mathcal {A} ( \mathfrak {n}' )&\supset&\mathcal {A} ( \mathfrak {n} ) . \end{aligned}$$

    The existence of a child \(\mathfrak {m}'\) of the node \(\mathfrak {n}'\) satisfying (20) is now clear from the definition of \(\hbox {Tree} ( V, \mathcal {A} )\) (following the description given in Sect. 7.1.1). This completes the induction in this case.

  2. (2)

    Suppose again that the node \(\mathfrak {m}\) is a child of \(\mathfrak {n}\). Since \(\hbox {level} ( \mathfrak {n} ) =t-1\), by induction hypothesis there exists either a node \(\mathfrak {n}_{1}\) of \(\hbox {Tree} ( V,\mathcal {A}_{1} )\) with level \(t-1\) such that

    $$\begin{aligned} \begin{aligned} \big ( w ( \mathfrak {n}_{1} ) ,s ( \mathfrak {n}_{1} ) , \tilde{\mathcal {P}} ( \mathfrak {n}_{1} ) , \tilde{\mathcal {Q}} ( \mathfrak {n}_{1} ) \big )&= \big ( w ( \mathfrak {n} ) ,s ( \mathfrak {n} ) , \tilde{\mathcal {P}} ( \mathfrak {n} ) , \tilde{\mathcal {Q}} ( \mathfrak {n} ) \big ) , \\ \mathcal {A} ( \mathfrak {n}_{1} )&= \mathcal {A} ( \mathfrak {n} ) , \end{aligned} \end{aligned}$$
    (24)

    or there exists a node \(\mathfrak {n}_{2}\) of \(\hbox {Tree} ( V, \mathcal {A}_{2} )\) with level \(t-1\) such that

    $$\begin{aligned} \begin{aligned} \big ( w ( \mathfrak {n}_{2} ) ,s ( \mathfrak {n}_{2} ) , \tilde{\mathcal {P}} ( \mathfrak {n}_{2} ) , \tilde{\mathcal {Q}} ( \mathfrak {n}_{2} ) \big )&= \big ( w ( \mathfrak {n} ) ,s ( \mathfrak {n} ) , \tilde{\mathcal {P}} ( \mathfrak {n} ) , \tilde{\mathcal {Q}} ( \mathfrak {n} ) \big ) , \\ \mathcal {A} ( \mathfrak {n}_{2} )&= \mathcal {A} ( \mathfrak {n} ), \end{aligned} \end{aligned}$$
    (25)

    or there exists a node \(\mathfrak {n}_{1}\) of \(\hbox {Tree} ( V,\mathcal {A}_{1} )\) and a node \(\mathfrak {n}_{2}\) of \(\hbox {Tree} ( V, \mathcal {A}_{2} )\) both with level \(t-1\) such that

    $$\begin{aligned} \big ( w ( \mathfrak {n}_{1} ) ,s ( \mathfrak {n}_{1} ) , \tilde{\mathcal {P}} ( \mathfrak {n}_{1} ) , \tilde{\mathcal {Q}} ( \mathfrak {n}_{1} ) \big )&= \big ( w ( \mathfrak {n}_{2} ) ,s ( \mathfrak {n}_{2} ) , \tilde{\mathcal {P}} ( \mathfrak {n}_{2} ) , \tilde{\mathcal {Q}} ( \mathfrak {n}_{2} ) \big ) \nonumber \\&= \big ( w ( \mathfrak {n} ) ,s ( \mathfrak {n} ) , \tilde{\mathcal {P}} ( \mathfrak {n} ) , \tilde{\mathcal {Q}} ( \mathfrak {n} ) \big ) , \\ \mathcal {A} ( \mathfrak {n}_{1} ) \cup \mathcal {A} ( \mathfrak {n}_{2} )&= \mathcal {A} ( \mathfrak {n} ) . \nonumber \end{aligned}$$
    (26)

    It follows from the description of \(\hbox {Tree} ( V,\mathcal {A}_{1} )\) given in Sect. 7.1.1 that (21) implies that there exists a child \(\mathfrak {m}_{1}\) of the node \(\mathfrak {n}_{1}\) satisfying (24). Similarly, it is clear that (22) implies that there exists a child \(\mathfrak {m}_{2}\) of the node \(\mathfrak {n}_{2}\) satisfying (25). Now suppose that (23) hold. If \(\mathfrak {m}\) is a left child of \(\mathfrak {n}\), then clearly there exists a child \(\mathfrak {m}_{1}\) of the node \(\mathfrak {n}_{1}\), and a child \(\mathfrak {m}_{2}\) of the node \(\mathfrak {n}_{2}\) satisfying (26). If \(\mathfrak {m}\) is a right child of \(\mathfrak {n}\), then there are several cases.

    1. (a)

      Case \(w ( \mathfrak {m} ) \in \pi _{[ 1, \hbox {Fix} ( \mathfrak {m} ) ]} ( \mathcal {A} ( \mathfrak {n}_{1} ) \cap \mathcal {A} ( \mathfrak {n}_{2} ) )\): In this case there exists a child \(\mathfrak {m}_{1}\) of the node \(\mathfrak {n}_{1}\), and a child \(\mathfrak {m}_{2}\) of the node \(\mathfrak {n}_{2}\) satisfying (23).

    2. (b)

      Case \(w ( \mathfrak {m} ) \in \pi _{[ 1, \hbox {Fix} ( \mathfrak {m} ) ]} ( \mathcal {A} ( \mathfrak {n}_{1} ) \setminus \mathcal {A} ( \mathfrak {n}_{1} ) \cap \mathcal {A} ( \mathfrak {n}_{2} ) )\): In this case there exists a child \(\mathfrak {m}_{1}\) of the node \(\mathfrak {n}_{1}\) satisfying (21).

    3. (c)

      Case \(w ( \mathfrak {m} ) \in \pi _{[ 1, \hbox {Fix} ( \mathfrak {m} ) ]} ( \mathcal {A} ( \mathfrak {n}_{2} ) \setminus \mathcal {A} ( \mathfrak {n}_{1} ) \cap \mathcal {A} ( \mathfrak {n}_{2} ) )\): In this case there exists a child \(\mathfrak {m}_{2}\) of the node \(\mathfrak {n}_{2}\) satisfying (22).

    This completes the induction in this case.

The proposition follows by applying the result proved above to the leaf nodes of the trees \(\hbox {Tree} ( V,\mathcal {A}_{1} )\), \(\hbox {Tree} ( V, \mathcal {A}_{2} )\) and \(\hbox {Tree} ( V, \mathcal {A} )\). \(\square \)

7.1.2 Roadmap Associated to \(\hbox {Tree} ( V,\mathcal {A} )\)

We now prove that the union of the (limits of the) sets contained in the leaves of \(\hbox {Tree} ( V,\mathcal {A} )\) form a roadmap. Most of this section is devoted to the proof of the following theorem, which is the key result needed to prove the correctness of our algorithms.

Theorem 7.4

The semi-algebraic set

$$\begin{aligned} \mathrm{{DCRM}} ( V, \mathcal {A} ) :=\bigcup _{\mathfrak {l} \in \mathrm{{Leav}} ( V,\mathcal {A} )}\lim _{\zeta _{1}} ( \mathrm{{Bas}} ( \mathfrak {l} ) ) \end{aligned}$$

contains \(\mathcal {A}\), and is a roadmap of \(V\).

Theorem 7.4 will follow from the following more general proposition.

Proposition 7.5

Let \(\mathfrak {n}\) be a node in \(\hbox {Tree} ( V,\mathcal {A} )\) of level \(t\). Then the semi-algebraic set

$$\begin{aligned} \mathrm{{DCRM}} ( \mathrm{{Bas}} ( \mathfrak {n} ) , \mathcal {A ( \mathfrak {n} )} ) :=\bigcup _{\mathfrak {l} \in \mathrm{{Leav}} ( \mathfrak {n} )} \lim _{\zeta _{{ t}+1}} ( \mathrm{{Bas}} ( \mathfrak {l} ) ) \end{aligned}$$

contains \(\mathcal {A} ( \mathfrak {n} )\), and is a roadmap of \(\mathrm{{Bas}} ( \mathfrak {n} )\).

Several intermediate results will be used in the proof of Proposition 7.5 and Theorem 7.4.

The following relation defined on elements of \(\{ 0,1 \}^{t}\) will be used to define a notion of “neighbor” amongst the leaf nodes of \(\hbox {Tree} ( V,\mathcal {A} )\) which in turn will be used to prove the existence of connecting paths in the roadmap of \(V\) defined by \(\hbox {Tree} ( V,\mathcal {A} )\) having some extra structure.

Definition 7.6

We define a symmetric and reflexive relation \(N_{t}\) on elements of \(\{ 0,1 \}^{ t}\) by induction on \(t\) as follows.

  1. (1)

    If \(t=1\), \(0N_{1} 1\).

  2. (2)

    For all \(s,s' \in \{ 0,1 \}^{t}\), \(sN_{t} s'\) implies that \(0sN_{{ t}+1} 0s' \), and \(1sN_{{ t}+1} 1s\).

  3. (3)

    Finally, \(01^{t-1} N_{t} 1^{t}\) for all \(t \ge 1\).

Remark 7.7

The relation \(N_{t}\) defined in Definition 7.6 induces the structure of a tree on the set \(\{ 0,1 \}^{t}\). This tree in the case \(t=4\) is displayed in Fig. 1. The edges in the tree correspond to pairs of elements \(s,t \in \{ 0,1 \}^{4}\), with \(s N_{4}t\).

Fig. 1
figure 1

Tree of leaves

The following proposition which uses the relation defined in Definition 7.6 above will be used to prove the existence of connecting paths in the roadmap. These connecting paths will have a certain special structure—and this structure will be defined using the relation defined in Definition 7.6.

Proposition 7.8

Let \(\mathfrak {n}\) be a node of \(\mathrm{{Tree}} ( V,\mathcal {A} )\) with \(\mathrm{{level}} ( \mathfrak {n} ) =t\), \(\mathfrak {l},\mathfrak {l}' \in \mathrm{{Leav}} ( \mathfrak {n} )\), and \(x \in \mathcal {A} ( \mathfrak {l} ) ,x' \in \mathcal {A} ( \mathfrak {l}' )\), such that \(\lim _{\zeta _{{ t}+1}} ( x ) \in \hbox {Cc} ( \lim _{\zeta _{{ t}+1}} ( x' ) , \mathrm{{Bas}} ( \mathfrak {n} ) )\). Then there exist \(\mathfrak {\mathfrak {l}= \mathfrak {\mathfrak {l}}}_{0} , \ldots ,\mathfrak {l}_{N} =\mathfrak {l}' \in \mathrm{{Leav}} ( \mathfrak {n} )\), and for each \(i,0 \le i \le N\), \(x_{2i} ,x_{2i+1} \in \mathcal {\mathcal {A}} ( \mathfrak {l}_{i} )\) such that

  1. (1)

    \(x_{0} =x\), \(x_{2N+1} =x'\);

  2. (2)

    for all \(i=1, \ldots ,N,\,\lim _{\zeta _{{ t}+1}} ( x_{2i-1} ) = \lim _{\zeta _{{ t}+1}} ( x_{2i} )\);

  3. (3)

    for all \(i=0, \ldots ,N\), \(x_{2i+1} \in \hbox {Cc} ( x_{2i} , \mathrm{{Bas}} ( \mathfrak {\mathfrak {\mathfrak {l}}_{i}} ) )\);

  4. (4)

    for all \(i=0, \ldots ,N-1,\) \(s ( \mathfrak {l}_{i} ) N_{\log ( k' )} s ( \mathfrak {l}_{i+1} )\).

The proof of Proposition 7.8 will use the following lemma.

Lemma 7.9

Let \(\mathfrak {m}_{1} ,\mathfrak {m}_{2}\) be two distinct children of a node \(\mathfrak {n}\) of \(\mathrm{{Tree}} ( V,\mathcal {A} )\) with \(\mathrm{{level}} ( \mathfrak {n} ) =t\), and for \(i=1,2\), let \(B_{i}\) be a semi-algebraically connected component of \(\mathrm{{Bas}} ( \mathfrak {m}_{i} )\). Suppose that \(\lim _{\gamma _{{ t}+1}} ( B_{1} ) \cap \lim _{\gamma _{{ t}+1}} ( B_{2} ) \ne \emptyset \). Then there exist \(\mathfrak {l}_{1} \in \mathrm{{Leav}} ( \mathfrak {m}_{1} ) ,\mathfrak {l}_{2} \in \mathrm{{Leav}} ( \mathfrak {m}_{2} )\), and \(x_{1} \in \mathcal {A} ( \mathfrak {l}_{1} ) ,x_{2} \in \mathcal {A} ( \mathfrak {l}_{2} )\), such that

$$\begin{aligned} \lim _{\zeta _{{ t}+1}} ( x_{1} )&= \lim _{\zeta _{{ t}+1}} ( x_{2} ) ,\\ \lim _{\zeta _{t+2}} ( x_{i} )&\in B_{i} \text { for } i=1,2, \end{aligned}$$

and

$$\begin{aligned} s ( \mathfrak {l}_{1} )N_{\log ( k' )} s (\mathfrak {l}_{2}). \end{aligned}$$

Proof

There are four cases to consider.

  1. (1)

    \(\mathfrak {m}_{1}\) is a left child and \(\mathfrak {m}_{2}\) a right child of \(\mathfrak {n}\). Let \(\mathfrak {m}_{1} =\mathfrak {n} ( \alpha )\) for some \(\alpha \in \mathcal {I} ( \mathfrak {n} )\). Since \(\mathcal {B} ( \mathfrak {n} ) = \widetilde{\hbox {Bas}} ( \mathfrak {n} )^{0} \cap \widetilde{\hbox {Bas}} ( \mathfrak {n} )^{1}\), and \(\lim _{\gamma _{{ t}+1}} ( B_{2} ) \cap \lim _{\gamma _{{ t}+1}} ( B_{1} ) \ne \emptyset \), there exists a point \(x \in \lim _{\gamma _{{ t}+1}} ( B_{2} ) \cap \lim _{\gamma _{{ t}+1}} ( B_{1} ) \subset \mathcal {B ( \mathfrak {n} )}\). Moreover \(x \in \lim _{\gamma _{{ t}+1}} ( \mathcal {A} ( \alpha ) \cap B_{1} )\) by definition of \(\mathcal {A} ( \alpha )\) (see Notation 50), since \(\mathcal {B} ( \mathfrak {n} ) = \widetilde{\hbox {Bas}} ( \mathfrak {n} )^{0} \cap \widetilde{\hbox {Bas}} ( \mathfrak {n} )^{1}\) is finite. Moreover \(x\in \mathcal {B ( \mathfrak {n} ) \cap } \lim _{\gamma _{{ t}+1}} ( B_{2} ) \subset \mathcal {B ( \mathfrak {n} ) \cap } \lim _{\gamma _{{ t}+1}} ( \hbox {Bas} ( \mathfrak {m}_{2} ) ) \subset \lim _{\gamma _{{ t}+1}} ( \mathcal {A} ( \mathfrak {m}_{2} ) )\) using (17).

       Using (19), there exist for \(i=1,2 ,\mathfrak {l}_{i} \in \hbox {Leav} ( \mathfrak {m}_{i} )\), and \(x_{i} \in \mathcal {A} ( \mathfrak {l}_{i} )\), with \(\lim _{\gamma _{{ t}+1}} ( x_{i} ) =x\). Then \(\lim _{\zeta _{{ t}+1}} ( x_{i} ) = \lim _{\zeta _{{ t}+1}} ( x )\), and \(\lim _{\zeta _{t+2}} ( x_{i} ) \in B_{i}\) and

    $$\begin{aligned} s ( \mathfrak {l}_{i} ) =s ( \mathfrak {m}_{i} ) 1 \cdots 1 . \end{aligned}$$
    (27)

    Since in this case, \(s ( \mathfrak {m}_{1} ) =s ( \mathfrak {n} ) 0\), and \(s ( \mathfrak {m}_{2} ) =s ( \mathfrak {n} ) 1\), it follows from Definition 7.6 and (27) that \(s ( \mathfrak {l}_{1} ) N_{\log ( k' )} s ( \mathfrak {l}_{2} )\).

  2. (2)

    \(\mathfrak {m}_{1}\) is a right child and \(\mathfrak {m}_{2}\) a left child of \(\mathfrak {n}\). This case is similar to the one above with the roles of \(\mathfrak {m}_{1}\) and \(\mathfrak {m}_{2}\) reversed.

  3. (3)

    Both \(\mathfrak {m}_{1} ,\mathfrak {m}_{2}\) are right children of \(\mathfrak {n}\). In this case, \( \hbox {Bas} ( \mathfrak {m}_{1} ) \cap \hbox {Bas} ( \mathfrak {m}_{2} ) = \emptyset \), and hence \(\lim _{\gamma _{{ t}+1}} ( \hbox {Bas} ( \mathfrak {m}_{1} ) ) \cap \lim _{\gamma _{{ t}+1}} ( \hbox {Bas} ( \mathfrak {m}_{2} ) ) = \emptyset \), since the descriptions of \( \hbox {Bas} ( \mathfrak {m}_{1} )\) and \(\hbox {Bas} ( \mathfrak {m}_{2} )\) do not depend on \(\gamma _{{ t}+1}\). Thus, there is nothing to prove in this case.

  4. (4)

    Both \(\mathfrak {m}_{1} ,\mathfrak {m}_{2}\) are left children of \(\mathfrak {n}\). In this case there exist \(\alpha _{1} , \alpha _{2} \in \mathcal {I} ( \mathfrak {n} )\) such that for \(i=1,2\), \(\mathfrak {m}_{i} =\mathfrak {n} ( \alpha _{i} )\). In this case there exists for \(i=1,2\), \(x'_{i} \in \mathcal {A} ( \alpha _{i} )\) such that \(\lim _{\gamma _{{ t}+1}} ( x'_{1} ) = \lim _{\gamma _{{ t}+1}} ( x'_{2} ) \in \lim _{\gamma _{{ t}+1}} ( B_{1} ) \cap \lim _{\gamma _{{ t}+1}} ( B_{2} )\) (using Proposition 6.7). Moreover, using (18), there exist for \(i=1,2\), \(\mathfrak {l}_{i} \in \hbox {Leav}^{1} ( \mathfrak {m}_{i} )\), and \(x_{i} \in \mathcal {A} ( \mathfrak {l}_{i} )\) such that \(x'_{i} = \lim _{\zeta _{t+2}} ( x_{i} )\). Notice that, for \(i=1,2\), \(s ( \mathfrak {l}_{i} ) =s ( \mathfrak {m}_{i} ) 1 \cdots 1\). It is now easy to check that \(s ( \mathfrak {l}_{1} ) =s ( \mathfrak {l}_{2} )\), and that the tuple \(( x_{1} ,\mathfrak {l}_{1} ,x_{2} ,\mathfrak {l}_{2} )\) then satisfies the required properties. \(\square \)

Proof of Proposition 7.8

The proof of the proposition is by induction on \(t= \hbox {level} ( \mathfrak {n} )\). The base case is when \(\mathfrak {n}\) is a leaf node, in which case the statement clearly holds. Otherwise, suppose that the proposition is true for all nodes having level greater than \(t\).

Using Corollary 5.14, we can assume without loss of generality that

$$\begin{aligned} \lim _{\gamma _{{ t}+1}} ( x ) \in \hbox {Cc} \big ( \lim _{\gamma _{{ t}+1}} ( x' ) , \widetilde{\hbox {Bas}} ( \mathfrak {n} ) \big ) . \end{aligned}$$

Since by Proposition 5.22, \(\widetilde{\hbox {Bas}} ( \mathfrak {n} )^{0} \cup \widetilde{\hbox {Bas}} ( \mathfrak {n} )^{1}\) has good connectivity property with respect to \(\widetilde{\hbox {Bas}} (\mathfrak {n})\), and since

$$\begin{aligned} \bigcup _{\mathfrak {l}\text { child of } \mathfrak {n}} \lim _{\gamma _{{ t}+1}} ( \mathcal {\mathcal {A}} ( \mathfrak {l} ) )\subset \widetilde{\hbox {Bas}} ( \mathfrak {n} )^{0} \cup \widetilde{\hbox {Bas}} ( \mathfrak {n} )^{1}, \end{aligned}$$

it follows that \(\lim _{\gamma _{{ t}+1}} ( x' ) \in \hbox {Cc} ( \lim _{\gamma _{{ t}+1}} ( x ) , \widetilde{\hbox {Bas}} ( \mathfrak {n} )^{0} \cup \widetilde{\hbox {Bas}} ( \mathfrak {n} )^{1} )\). So there exists a sequence \(\mathfrak {m}=\mathfrak {m}_{0} , \ldots ,\mathfrak {m}_{n} =\mathfrak {m}'\) of children of \(\mathfrak {n}\), for each \(i, 0 \le i \le n \), a semi-algebraically connected component \(B_{i }\) of \(\hbox {Bas} ( \mathfrak {m}_{i} )\), with

$$\begin{aligned} B_{0} = \hbox {Cc} \big ( \lim _{\zeta _{t+2}} ( x ), \hbox {Bas} ( \mathfrak {m}_{0} ) \big ) ,B_{n} = \hbox {Cc} \big ( \lim _{\zeta _{t+2}} ( x' ) , \hbox {Bas} ( \mathfrak {m}_{n} ) \big ), \end{aligned}$$

and for each \(i, 0 \le i \le n-1\), \(\lim _{\gamma _{{ t}+1}} ( B_{i} )\cap \lim _{\gamma _{{ t}+1}} ( B_{i+1} ) \ne \emptyset \).

Applying Lemma 7.9 we have that for each \(i,0\le i \le n \), there exist \(\mathfrak {l}_{2i} ,\mathfrak {l}_{2i+1} \in \hbox {Leav} ( \mathfrak {m}_{i} )\), and for each \(j,1 \le j \le 2n\), \(\bar{x}_{j} \in \mathcal {A} ( \mathfrak {l}_{j} )\) such that for each \(i,0 \le i \le n-1,\)

$$\begin{aligned}&\lim _{\zeta _{{ t}+1}} ( \bar{x}_{2i+1} ) = \lim _{\zeta _{{ t}+1}} ( \bar{x}_{2i+2} ) ,\\&\lim _{\zeta _{t+2}} ( \bar{x}_{2i} ) , \lim _{\zeta _{t+2}} (\bar{x}_{2i+1}) \in B_{i}, \end{aligned}$$

and

$$\begin{aligned} s ( \mathfrak {l}_{i} )N_{\log ( k' )} s ( \mathfrak {l}_{i+1} ) . \end{aligned}$$
(28)

Let also

$$\begin{aligned} \bar{x}_{0}&= x,\\ \bar{x}_{2n+1}&= x' ,\\ \mathfrak {l}_{0}&= \mathfrak {l},\\ \mathfrak {l}_{2n+1}&= \mathfrak {l}' . \end{aligned}$$

We now apply the induction hypothesis to each of the pairs \(\bar{x}_{2i} , \bar{x}_{2i+1}\), \(0 \le i \le n\), and use (28) to complete the induction. \(\square \)

Proposition 7.10

Let \(\mathfrak {n}\) be a node of the tree \(\mathrm{{Tree}} ( V,\mathcal {A} )\), with \(\mathrm{{level}} ( \mathfrak {n} ) =t \), and \(\mathrm{{Leav}} ( \mathfrak {n} )\) be the set of leaves of the sub-tree of \(\mathrm{{Tree}} ( V,\mathcal {A} )\) rooted at \(\mathfrak {n}\). For any two leaves \(\mathfrak {l}\) and \(\mathfrak {l}'\) in \(\mathrm{{Leav}} ( \mathfrak {n} )\) and any two points \(x \in \lim _{\zeta _{{ t}+1}} ( \mathrm{{Bas}} ( \mathfrak {l} ) ), x' \in \lim _{\zeta _{{ t}+1}} ( \mathrm{{Bas}} ( \mathfrak {l}' ) )\) such that \(x' \in \hbox {Cc} ( x, \mathrm{{Bas}} ( \mathfrak {n} ) )\), there exists a semi-algebraic path \(\varGamma \) connecting \(x\) to \(x'\) such that:

  1. (1)

    \(\varGamma \) is a concatenation of semi-algebraic paths \(\varGamma _{0} , \ldots , \varGamma _{m}\), where each \(\varGamma _{i} \subset \lim _{\zeta _{{ t}+1}} ( \mathrm{{Bas}} ( \mathfrak {l}_{i} ) )\), for some \(\mathfrak {l}_{i} \in \mathrm{{Leav}} ( \mathfrak {n} )\);

  2. (2)

    for each \(i,0 \le i \le m-1\), \(s ( \mathfrak {l}_{i} ) N_{\log ( k' )}s ( \mathfrak {l}_{i+1} )\).

Proof

Immediate consequence of Proposition 7.8. \(\square \)

The following two propositions will be used in the proof of Proposition 7.5.

Proposition 7.11

Let \(\mathfrak {n}\) be a node of the tree \(\mathrm{{Tree}} ( V,\mathcal {A} )\) with \(\mathrm{{level}} ( \mathfrak {n} ) =t\), and let \(\mathrm{{Leav}}^{ 0} ( \mathfrak {n} )\) be the set of leaves \(\mathfrak {m}\) of the subtree of \(\mathrm{{Tree}} ( V,\mathcal {A} )\) rooted at \(\mathfrak {n}\) such that \(s ( \mathfrak {m} )\) contains no \(1\) to the right of \(s ( \mathfrak {n} )\). Then the semi-algebraic set

$$\begin{aligned} L&= \bigcup _{\mathfrak {m} \in \mathrm{{Leav}}^{0} ( \mathfrak {n} )} \lim _{\zeta _{{ t}+1}} ( \mathrm{{Bas}} ( \mathfrak {m} ) ) \end{aligned}$$

is such that for all \(x \in \mathrm{R}_{{ t}}\), \(L_{( w ( \mathfrak {n} ) ,x )}\) meets every semi-algebraically connected component of \(\mathrm{{Bas}} ( \mathfrak {n} )_{( w ( \mathfrak {n} ) ,x )}\).

Proof

The proof is by induction on \(t= \mathrm{{level}} ( \mathfrak {n} )\). If \(\mathfrak {n}\) is a leaf node with \(| s ( \mathfrak {n} ) | =0\), then \(\hbox {Leav}^{ 0} ( \mathfrak {n} ) = \{ \mathfrak {n} \}\) and there is nothing to prove. Now assume that the proposition is true for all \(\mathfrak {n}'\), with \(\hbox {level} ( \mathfrak {n}' ) >t \).

Note that the left children of \(\mathfrak {n}\) are precisely those children \(\mathfrak {m}\) of \(\mathfrak {n}\) with \(s ( \mathfrak {m} ) = ( s ( \mathfrak {n} ) ,0 )\), and these are in 1–1 correspondence with \(\alpha \in \mathcal {I} ( \mathfrak {n} )\). Denote by \(\mathfrak {n} ( \alpha )\) the left child of \(\mathfrak {n}\) corresponding to \(\alpha \in \mathcal {I} ( \mathfrak {n} )\) .

We denote (with a slight abuse of notation) \(\hbox {Ext}\left( \widetilde{\hbox {Bas}} ( \mathfrak {n} )^{0} , \mathrm{R}_{{ t}+1} \right) \) by \(\widetilde{\hbox {Bas}} ( \mathfrak {n} )^{0}\) and \(\hbox {Ext}\left( \widetilde{\hbox {Bas}} ( \mathfrak {n} ) , \mathrm{R}_{{ t}+1} \right) \) by \(\widetilde{\hbox {Bas}} ( \mathfrak {n} )\), and make the following claims.

  1. 1.

    For each \(w \in \mathrm{R}_{{ t}+1}^{\ell }\), where \(\ell = k'/2^{{ t}+1}\), \(\widetilde{\hbox {Bas}} ( \mathfrak {n} )^{0}_{( w ( \mathfrak {n} ) ,w )}\) meets every semi-algebraically connected component of \(\widetilde{\hbox {Bas}} ( \mathfrak {n} )_{( w ( \mathfrak {n} ) ,w )}\) (Proposition 5.17). It follows immediately (since \(\ell \ge 1\)) that for each \(x' \in \mathrm{R}_{{ t}+1}\), \(\widetilde{\hbox {Bas}} ( \mathfrak {n} )^{0}_{( w ( \mathfrak {n} ) ,x' )}\) meets every semi-algebraically connected component of \(\widetilde{\hbox {Bas}} ( \mathfrak {n} )_{( w ( \mathfrak {n} ) ,x' )}\).

  2. 2.

    Also, \(\lim _{\zeta _{{ t}+1}} ( \widetilde{\hbox {Bas}} ( \mathfrak {n} ) ) = \hbox {Bas} ( \mathfrak {n} ) \subset \mathrm{R}_{{ t}}^{{ k}}\) (Proposition 5.5). It follows that for any \(x \in \mathrm{R}_{{ t}}\), and \(C\) a semi-algebraically connected component of \(\hbox {Bas} ( \mathfrak {n} )_{( w ( \mathfrak {n} ) ,x )}\), there exists \(x' \in \mathrm{R}_{{ t}+1}\) with \(\lim _{\zeta _{{ t}+1}} ( x' ) =x\), and a semi-algebraically connected component \(D\) of \(\widetilde{\hbox {Bas}} ( \mathfrak {n} )_{( w ( \mathfrak {n} ) ,x' )}\) such that \(\lim _{\zeta _{{ t}+1}} ( D ) \subset C\).

  3. 3.

    Using Claim 1. there exists a semi-algebraically connected component \(D^{0}\) of \(\widetilde{\hbox {Bas}} ( \mathfrak {n} )_{( w ( \mathfrak {n} ) ,x' )}^{0}\) which is contained in \(D\).

Now since

$$\begin{aligned} \widetilde{\hbox {Bas}} ( \mathfrak {n} )^{0} = \bigcup _{\alpha \in \mathcal {I} ( \mathfrak {n} )} \lim _{\gamma _{{ t}+1}} \mathrm{{Bas}} ( \mathfrak {n} ( \alpha ) ) \end{aligned}$$

there exists a left child \(\mathfrak {n} ( \alpha )\) of \(\mathfrak {n}\) and a semi-algebraically connected component \(D_{\mathfrak {n} ( \alpha )}\) of \(\hbox {Bas} ( \mathfrak {n} ( \alpha ) )\) such that \(\lim _{\gamma _{{ t}+1}} ( D_{\mathfrak {n} ( \alpha )} ) \subset D^{0}\).

Noting that being the left child of \(\mathfrak {n}\), \(\hbox {level} ( \mathfrak {n} ( \alpha ) ) > \hbox {level} ( \mathfrak {n} )\), and noting that the fact \(s ( \mathfrak {n} ( \alpha ) ) =s ( \mathfrak {n} ) 0\) implies that \(\hbox {Fix} ( \mathfrak {n} ( \alpha ) ) = \hbox {Fix} ( \mathfrak {n} )\), we can apply the induction hypothesis to obtain that \(L'_{( w ( \mathfrak {n} ) ,x' )}\) meets \(D_{\mathfrak {n} ( \alpha )}\), where

$$\begin{aligned} L' = \bigcup _{\mathfrak {m} \in \hbox {Leav}^{ 0} ( \mathfrak {n} ( \alpha ) )} \lim _{\zeta _{t+2}} ( \hbox {Bas} ( \mathfrak {m} ) ) . \end{aligned}$$

Now \(\lim _{\zeta _{{ t}+1}} ( L' ) \subset L\), which implies that \(\lim _{\zeta _{{ t}+1}} ( L'_{( w ( \mathfrak {n} ) ,x' )} ) \subset L_{( w ( \mathfrak {n} ) ,x )}\). Moreover, \(L'_{( w ( \mathfrak {n} ) ,x )} \cap D_{\mathfrak {n} ( \alpha )} \ne \emptyset \), \(\lim _{\gamma _{{ t}+1}} ( D_{\mathfrak {n} ( \alpha )} ) \subset D^{0} \subset D\), and \(\lim _{\zeta _{{ t}+1}} ( D ) \subset C\). Together they imply that \(L_{( w ( \mathfrak {n} ) ,x )} \cap C \ne \emptyset \). \(\square \)

Corollary 7.12

\(\mathrm{{DCRM}} ( \mathrm{{Bas}} ( \mathfrak {n} ) , \mathcal {A (\mathfrak {n} )} )\) meets every semi-algebraically connected component of \(\mathrm{{Bas}} ( \mathfrak {n} )\).

We are now ready for the proof of Proposition 7.5, and as an immediate consequence Theorem 7.4.

Proof of Proposition 7.5

The fact that \(\mathcal {A} ( \mathfrak {n} )\) is contained in the set

$$\begin{aligned} \mathrm{{DCRM}} ( \hbox {Bas} ( \mathfrak {n} ) ,\mathcal {A} ( \mathfrak {n} ) ) = \bigcup _{\mathfrak {l} \in \mathrm{{Leav}} ( \mathfrak {n} )} \lim _{\zeta _{{ t}+1}} ( \hbox {Bas} ( \mathfrak {l} ) ) \end{aligned}$$

follows from (18). The roadmap property \(\hbox {RM}_{1}\) follows from Proposition 7.10 and Corollary 7.12. The property \(\hbox {RM}_{2}\) follows from Proposition 7.11. \(\square \)

Proof of Theorem 7.4

Follows immediately from Proposition 7.5, setting \(\mathfrak {n}=\mathfrak {r}\), and observing that \(\mathcal {A}=\mathcal {A} ( \mathfrak {r} )\) by construction, and that \(\hbox {Fix} ( \mathfrak {r} ) =0\). \(\square \)

7.2 Preliminary Definitions and Algorithms

In this subsection we introduce certain notation, definitions and algorithms that will be used in Algorithm 5 (Divide) in the next subsection. Recall that in the description of the tree \(\hbox {Tree} ( V,\mathcal {A} )\), at each node \(\mathfrak {n}\) of \(\hbox {Tree} ( V,\mathcal {A} )\), some coordinates have been fixed and the basic semi-algebraic set \(\hbox {Bas} ( \mathfrak {n} )\) is contained in the fiber over the point \(w ( \mathfrak {n} )\) consisting of the fixed coordinates. We now explain how we represent algebraically the points that fix the fibers in our construction, and also the necessary algorithms to compute these points. We refer the reader to [2] for any missing detail.

A root of a univariate polynomials is going to be described by a Thom encoding.

Notation 7.13

Let \(P\) be a univariate polynomial of degree \(p\) in \(\hbox {D}[X]\). We denote by \(\hbox {Der} ( P )\) the list \(P,P' , \ldots ,P^{(p)}\). Let \(P \in \hbox {D}[X]\) and \(\sigma \in \{0,1, -1\}^{\mathrm{{Der}} (P)}\) a sign condition on the set \(\hbox {Der}(P)\) of derivatives of \(P\). The Thom encoding of a root \(x\) of \(P\) in \(\mathrm{R}\) is equal to \(\sigma \) if the sign condition taken by the set \(\hbox {Der}(P)\) at \(x\) coincides with \(\sigma \). Note that two different roots of \(P\) have different Thom encodings (see [2] Proposition 2.28).

Because we need to fix successively blocks of coordinates of decreasing size, triangular Thom encodings appear naturally.

Definition 7.14

A triangular system of polynomials with variables \(T= ( T_{1} , \ldots ,T_{t} )\) is a tuple \(\mathcal {T=} ( F_{1} , \ldots ,F_{t} )\) where

$$\begin{aligned}&F_{i} \in&\hbox {D}[T_{1} , \ldots ,T_{i} ],\quad 1 \le i \le t, \end{aligned}$$

such that \({\mathrm{{Zer}}} ( \mathcal {T} , \mathrm{R}^{{ t}} )\) is finite. A triangular Thom encoding specifying

$$\begin{aligned} \theta = ( \theta _{1} , \ldots , \theta _{t} ) \in \mathrm{R}^{{ t}} \end{aligned}$$

is a pair \(( \mathcal {T} , \tau )\) where \(\mathcal {T}\) is a triangular system of polynomials, and \(\tau = \tau _{1} , \ldots , \tau _{t}\) is a list of Thom encodings, such that \(\tau _{i}\) is the Thom encoding of the real root \(\theta _{i}\) of \(F_{i} ( \theta _{1} , \ldots , \theta _{i-1} ,T_{i} )\) for \(i=1, \ldots ,t\).

Moreover, we need to describe points in the corresponding fibers, which is done using real univariate representations.

Definition 7.15

A \(k\) -real univariate representation \(u\) over a triangular Thom encoding \(\mathcal {T}, \tau \) specifying \(\theta \in \mathrm{R}^{{ t}}\) is of the form

$$\begin{aligned} u= (f(T,U), \sigma ,F(T,U)) , \end{aligned}$$

where \(f (T,U) ,F (T,U) = ( f_{0} ( T,U ) , \ldots ,f_{k} ( T,U ) )\) is a \(k+2\)-tuple of polynomials in \(\hbox {D}[T,U]\) such that \(f ( \theta ,U )\) and \(f_{0} ( \theta ,U )\) are co-prime, and \(\sigma \) is the Thom encoding of a real root \(x\) of \(f ( \theta ,U )\). The point associated to \(u\) is the point

$$\begin{aligned} \Big ( \frac{f_{1} ( \theta ,x)}{f_{0} ( \theta ,x )} , \ldots , \frac{f_{k} ( \theta ,x)}{f_{0} ( \theta ,x)} \Big ) \in \mathrm{R}^{{ k}} . \end{aligned}$$

For \(1 \le p \le k\), we call the real univariate representation \(u_{\le p} = (f(T,U), \sigma , F_{\le p} (T,U))\) where \(F_{\le p} (T,U) = ( f_{0} ( T,U ) , \ldots ,f_{p} ( T,U ) )\), over the initial real triangular Thom encoding \(\mathcal {T}, \tau \) to be the projection of \(u\) to the first \(p\) coordinates. Geometrically this corresponds to forgetting the last \(k-p\) coordinates of the associated point.

We now give a few auxiliary algorithms. The first one computes the limit of a Thom Encoding and is used in the determination of the \(( B,G )\)-pseudo-critical values needed in our construction.

In the following algorithm \(\bar{\varepsilon } = \left( \varepsilon _{1} , \ldots , \varepsilon _{t} \right) \) is a tuple of infinitesimals.

Algorithm 1. [Limit of a Thom Encoding]

  • Input: a Thom encoding \(\left( f_{\bar{\varepsilon }} , \sigma _{\bar{\varepsilon }} \right) \) , \(f_{\bar{\varepsilon }} \in \hbox {D}\left[ \bar{\varepsilon } ,U \right] \), representing \(x_{\bar{\varepsilon }} \in \mathrm{R}_{{ t}} \langle \,\,\bar{\,}\,\,{\varepsilon } \rangle \) bounded over \(\mathrm{R}\).

  • Output: a Thom encoding \(( f_{,} \sigma )\) , \(f \in \hbox {D}[ U ]\), representing

    $$\begin{aligned} x= \lim _{\varepsilon _{1}} ( x_{\bar{\varepsilon }} ) \in \mathrm{R}. \end{aligned}$$
  • Complexity and degree bounds: If \(D_{1}\) (resp. \(D_{2}\)) is a bound on the degree of \(f_{\bar{\varepsilon }}\) with respect to \(U\) (resp. \(\bar{\varepsilon }\)) the number of arithmetic operations in \(\hbox {D}\) is bounded by \(D_{1}^{O (1)} D_{2}^{O (t)}\). Moreover, the degrees in \(U\) of the polynomials appearing in the output are still bounded by \(D_{1}\).

  • Procedure:

  • Step 1. Replace \(f_{\bar{\varepsilon }}\) by \(\bar{\varepsilon }^{-o_{\bar{\varepsilon }} \left( f_{\bar{\varepsilon }} \right) } f_{\bar{\varepsilon }}\) (see Notation 5.3). Denote by \(f (T)\) the polynomial obtained by substituting successively \(\varepsilon _{t}\) by \(0\), and then \(\varepsilon _{t-1}\) by 0, and so on, and finally \(\varepsilon _{1}\) by \(0\), in \(f_{\bar{\varepsilon }}\).

  • Step 2. Compute the set \(\Sigma \) of Thom encodings of roots of \(f (T)\) using Algorithm 10.11 (Sign Determination) from [2].

  • Step 3. Identify the Thom encoding \(\sigma \) using Algorithm 10.13 (Univariate Sign Determination) from [2], by checking whether a ball of infinitesimal radius \(\delta \) (\(1 \gg \delta \gg \bar{\varepsilon } >0\)) around the point \(x\) represented by the real univariate representation \(f, \sigma \) contains \(x_{\bar{\varepsilon }}\).

Proof of correctness

Follows immediately from the correctness of Algorithm 10.11 (Sign Determination) and Algorithm 10.13 (Univariate Sign Determination) in [2]. \(\square \)

Proof of complexity and degree bounds

Follows from the complexity of Algorithm 10.11 (Sign Determination) and Algorithm 10.13 (Univariate Sign Determination) in [2]. The fact that the degree in \(U\) of the polynomials in the output are bounded by \(D_{1}\) is clear. \(\square \)

Remark 7.16

Our algorithms use several algorithms from [2] such as Algorithm 12.16 (Bounded Algebraic Sampling), Algorithm 14.9 (Global Optimization), Algorithm 15.2 (Curve Segments), and Algorithm 11.19 (Restricted Elimination) with one important modification. Each of these algorithms described in [2] has an associated structure which is an ordered domain in which all computations (i.e., arithmetic operations and sign evaluations) take place. In the calls to these algorithms in this paper, this ordered domain will be of the form \(\hbox {D}_{t} [ \theta ]\), where \(\theta \in \mathrm{R}_{{ t}}^{{ m}}\) is specified by a triangular Thom encoding \(( \mathcal {T}, \tau )\) and involves \(4t\) infinitesimals (see Notation 7.1). Each element of \(\hbox {D}_{t} [ \theta ]\) is represented by some polynomial in \(\hbox {D}_{t} [ T ] = \hbox {D}[ \eta ,T_{1} , \ldots ,T_{m} ]\) and arithmetic operations are performed as ordinary polynomial arithmetic in the ring \(\hbox {D}_{t} [ T ]\). For the evaluation of the sign of an element in \(\hbox {D}_{t} [ \theta ]\) represented by a polynomial \(f \in \hbox {D}_{t} [ T ]\) we also use an algorithm from [2], namely Algorithm 12.10 (Triangular Sign Determination) with input \(f,\mathcal {T}, \tau \).

Suppose that the degree of the output (and of the intermediate computations) of a particular algorithm in [2] is bounded by some function \(f ( d,k,s )\) of the degrees \(d\), the number of variables \(k\), and the number of polynomials \(s\). If \(d' ,k' ,s'\) is a bound on the degrees, number of variables and number of the input polynomials (considered as polynomials with coefficients in \(\hbox {D}_{t} [ \theta ]\)) in a call to that algorithm in this paper, then the degree bound of the output (and intermediate computations) is \(f ( d' ,k' ,s' )\) in the ring \(\hbox {D}_{t} [ \theta ]\).

But we want to evaluate the complexity in the ring \(\hbox {D}\). Denoting by \(N\) a bound on the degrees in \(T, \eta \) of the input polynomials, we have the following:

  • the degrees in \(T, \eta \) of the output (and of the intermediate computations) are bounded by \(O ( Nf ( d' ,k' ,s' ) )\),

  • if the complexity of a particular algorithm in [2] is bounded by some function \(F ( d,k,s )\), then the number of arithmetic operations and sign evaluations in \(\hbox {D}_{t} [ \theta ]\) of the call to that algorithm in this paper is bounded by \(F ( d' ,k' ,s' )\) , while the cost of the call to that algorithm in this paper, i.e., the number of arithmetic operations and sign evaluations in \(\hbox {D}\), is bounded by \(N^{O ( m+t )} F ( d' ,k' ,s' )\).

These statements do not follow immediately from the complexity results on the algorithms given in [2]. It is necessary to inspect the algorithms in [2] carefully, noticing that they are all based on linear algebra subroutines and determinant computations.

We now describe an algorithm for computing the \(( B,G )\)-pseudo-critical values of a family of polynomials (cf. Definition 4.5), using Notation 7.1.

Algorithm 2. [\(( B,G )\)-pseudo-critical values over a Triangular Thom Encoding]

  • Input:

    1. (1)

      a triangular Thom encoding \(\left( \mathcal {T} ,\tau \right) \) with \(\mathcal {T} \subset \hbox {D}_{t} [ T ]\), fixing a point \(\theta \in \mathrm{R}^{{ m}}\), \(m \le t\);

    2. (2)

      a family of polynomials \(\mathcal {P}= \{ P_{1} , \ldots ,P_{s} \} \subset \hbox {D}_{t} [T,X_{1} , \ldots ,X_{{ k}} ] \) such that \({\mathrm{{Zer}}} ( \mathcal {P} ( \theta , \cdot ) , \mathrm{R}^{{ k}} )\) is bounded;

    3. (3)

      a matrix \(B =( b_{i, j} )_{1 \le i \le s,0\le j \le k} \in \mathbb {N}_{>0}^{s \times ( k+1 )}\) having good rank property;

    4. (4)

      a polynomial \(G \in \hbox {D}_{t} [ X_{1} , \ldots ,X_{{ k}} ]\).

  • Output: a set of Thom encodings \(( f, \sigma )\) over \(\left( \mathcal {T},\tau \right) \) specifying a finite subset of \(\mathrm{R}\) containing the \(( B,G )\)-pseudo-critical values of \({\mathrm{{Zer}}} (\mathcal {P} ( \theta , \cdot ) , \mathrm{R}_{{ t}}^{{ k}} )\).

  • Complexity and degree bounds: \(s^{k}D^{O ( t+m )}d^{O ( k )}\) arithmetic operations in \(\hbox {D}\), where \(D\) is a bound on the degree of \(\mathcal {T}\) with respect to \(T, \eta \), and \(d\) is a bound on the degrees of the polynomials in \(\mathcal {P}\) and of \(G\). The degrees in \(T, \eta \) of the polynomials appearing in the Thom encodings over \(( \mathcal {T,} \tau )\) output are bounded by \(O ( d )^{k} D\), while the degree in the new variable \(U\) is bounded by \(O ( d )^{k}\).

  • Procedure:

  • Step 1. For each \(I \subset [ 1,s ] \) with \(\hbox {card} ( I ) \le k\), \(\sigma \in \{ -1,1 \}^{I}\), compute using Algorithm 12.16 (Bounded Algebraic Sampling) from [2] with ring \(\hbox {D}_{t} [ \theta , \gamma ]\) and input \(\hbox {CritEq} ( \tilde{\mathcal {P}}_{I,B} ,G )\) (see Definition 4.5 for the definition of \(\tilde{\mathcal {P}}_{I,B}\)) a set of real univariate representations over \(( \mathcal {T, \tau } )\) with associated points meeting every semi-algebraically connected component of \({\mathrm{{Zer}}} ( \hbox {CritEq} ( \tilde{\mathcal {P}}_{I,B} ,G ) \cup \{ G-Z \} , \mathrm{R}_{{ t}} \langle \gamma \rangle ^{{ k}+ \hbox {card} ( I ) +2})\).

  • Step 2. For each real univariate representation

    $$\begin{aligned} ( f,g_{0} ,g_{1} , \ldots ,g_{k} ,g_{\lambda _{0}} , \ldots ,g_{\lambda _{\mathrm{{card}} ( I )}} ,g_{Z} ) , \sigma \end{aligned}$$

    over \(( \mathcal {T, \tau } )\) output in the previous step, where

    $$\begin{aligned} f,g_{0} ,g_{1} , \ldots ,g_{k} ,g_{\lambda _{0}} , \ldots ,g_{\lambda _{\mathrm{{card}} ( I )}} ,g_{Z} \in \hbox {D}_{t} [ T, \gamma ,U ], \end{aligned}$$

    eliminating \(U\) from the equations

    $$\begin{aligned} f ( T,U ),Z g_{0} ( T,U ) -g_{Z} ( T,U ) \end{aligned}$$

    obtain a Thom encoding \(( A ( T, \gamma ,Z ) , \alpha )\) over \(( \mathcal {T,} \tau )\) describing a point \(a \in \mathrm{R}_{{ t}} \langle \gamma \rangle \).

  • Step 3. Compute a Thom encoding describing \(\lim _{\gamma } ( a )\) using Algorithm 1 (Limit of a Thom Encoding).

  • Step 4. Output the set of all real univariate representations computed in Step 3.

Proof of correctness

The correctness of Algorithm 2 is a consequence of the correctness of Algorithm 12.16 (Bounded Algebraic Sampling) and Algorithm 12.14 (Limit of bounded points) from [2] given the definition of \(( B,G )\)-pseudo-critical values (see Definition 4.5). \(\square \)

Proof of complexity and degree bounds

It follows from the complexity of Algorithm 12.16 (Bounded Algebraic Sampling) and Algorithm 12.14 (Limits of bounded points) from [2] and from Remark 7.16, that the complexity is bounded by

$$\begin{aligned} s^{k}D^{O (m+t )} d^{O ( k )}. \end{aligned}$$

Moreover, it follows from the complexity analysis of Algorithm 12.16 (Bounded Algebraic Sampling) from [2], and that of Algorithm 1 (Limit of a Thom Encoding), that the degrees in \(T, \eta \) of the polynomials appearing in the Thom encodings over \(( \mathcal {T,} \tau )\) output is bounded by \(O ( d )^{k} D\), and the degree in \(U\) is bounded by \(O ( d )^{k}\). \(\square \)

As mentioned earlier, we will need to compute certain well chosen finite sets of points which correspond to points that minimize locally the distance between pairs of semi-algebraically connected components of some basic semi-algebraic set described in the input. For technical reasons, we need such an algorithm in two different versions. In the first algorithm (Algorithm 3) the input is a basic semi-algebraic set and a point, while in the second algorithm (Algorithm 4) the input is a pair of basic semi-algebraic sets.

We use again Notation 7.1.

Algorithm 3. [Closest Point over a Triangular Thom Encoding]

  • Input: A triangular Thom encoding \(\left( \mathcal {T}, \tau \right) \), \(\mathcal { T} \subset \hbox {D}_{t} [ T ]\), fixing a point \(\theta \in \mathrm{R}^{{ m}}\), finite subsets \(\mathcal {P} ,\mathcal {Q} \subset \hbox {D}_{t} [T,X_{1} , \ldots ,X_{{ k}} ]\) with \(\hbox {Bas} ( \mathcal {P} ( \theta , \cdot ) \mathcal {,Q} ( \theta , \cdot ) )\) bounded, and a real univariate representation \(u= ( g, \sigma ,G )\) over \(\left( \mathcal {T}, \tau \right) \) with associated point \(x\).

  • Output: A finite set of real univariate representations over \(( \mathcal {T}, \tau )\) with associated points \(\hbox {MinDi} ( \hbox {Bas} ( \mathcal {P} ( \theta , \cdot ) \mathcal {,Q} ( \theta , \cdot ) ) , \{ x \} )\).

  • Complexity and degree bounds: Let \(\hbox {card} ( \mathcal {Q} )\le t\), \(\deg _{X} ( \mathcal {P} , \mathcal {Q} ) \le d\), \(\deg _{\eta ,T} ( \mathcal {T} ) \le D\), \(\deg _{\eta ,T ,U} ( u ) \le D\), and \(\deg _{\eta ,T} ( \mathcal {P} , \mathcal {Q} ) \le dD\). Then the number of arithmetic operations in \(\hbox {D}\) is bounded by \(d^{O ( k )} D^{O ( m+t )}\). The degrees in \(T, \eta \) of the polynomials appearing in the Thom encodings over \(( \mathcal {T,} \tau )\) output are bounded by \(O ( d )^{k} D\), while the degree in the new variable \(U\) is bounded by \(O ( d )^{k}\).

  • Procedure:

  • Step 1. Let \(S \subset \mathrm{R}^{{ k}} \times \mathrm{R}^{{ k}}\) be the semi-algebraic sets defined by

    $$\begin{aligned} S&:= \hbox {Bas} (\mathcal {P} (\theta , \cdot ) ,\mathcal {Q} ( \theta , \cdot )) \times \{ x \} , \end{aligned}$$

    where, with \(G= (g_{0}, \ldots , g_{k})\), the point \(x\) associated to \(u\) is defined by

    $$\begin{aligned} \sum \limits _{i=1}^{k} (g_{0} (T,U) Y_{i}-g_{i} ( T,U ) )^{2} . \end{aligned}$$
  • Step 2. Let \(F =\sum _{1 \le i \le k} ( X_{i} -Y_{i} )^{2}\). Apply Algorithm 14.9 (Global Optimization) from [2] with ring \(\hbox {D}[ \theta , \theta _{g} ]\), where \(( \theta , \theta _{g} )\) is associated to the triangular Thom encoding \(( ( \mathcal {T},g ) , ( \tau , \sigma ) )\), and the pair \(( S,F )\) as input, and project the set of real univariate representations over \(( ( \mathcal {T},g ) , ( \tau , \sigma ) )\) that are output, to the first \(k\) coordinates.

  • Step 3. For each univariate representation \(w= ( h ( T,U,V ) , \sigma _{h} ,H ( T,U,V ) )\) output in Step 2, use Algorithm 12.16 (Bounded Algebraic Sampling) from [2] with ring \(\hbox {D}[ \theta ]\) and the polynomials \(\{ g,h \}\) to obtain a set of real univariate representations \(v= ( e ( T,T' ) , \sigma _{e} ,E= ( e_{0,} e_{U} ,e_{V} ) )\). Substitute the rational functions \(\tfrac{e_{U}}{e_{0}} , \frac{e_{V}}{e_{0}}\) for \(U,V\) in the real univariate representation \(w\), and output the resulting real univariate representation over \(( \mathcal {T}, \tau )\).

Proof of correctness

The correctness of Algorithm 3 is a consequence of the correctness of Algorithm 14.9 (Global Optimization), and of Algorithm 12.16 (Bounded Algebraic Sampling) from [2]. The degree bounds follow from the complexity analysis of the above algorithms. \(\square \)

Proof of complexity and degree bounds

It follows from the complexity analysis of Algorithm 14.9 (Global Optimization) from [2], and Remark 7.16, that the complexity of Step 2 is bounded by \(d^{O ( k )} D^{O ( m+t )}\). Moreover, the degrees in \(\eta ,T,U,V\) of the polynomials appearing in the real univariate representation \(w\) are bounded by \(D d^{O ( k )}\). The cardinality of the set of real univariate representations output is bounded by \(2^{t} d^{O ( k )}\). It follows from the complexity of Algorithm 12.16 (Bounded Algebraic Sampling) from [2] and Remark 7.16 that the degrees in \(\eta ,T,T'\) of the \(e,E\) are bounded by \(D^{O ( 1 )} d^{O ( k )}\), and that the complexity of Step 3 is bounded by \(d^{O ( k )} D^{O ( t )}\). \(\square \)

Algorithm 4. [Closest Pairs over a Triangular Thom Encoding]

  • Input: A triangular Thom encoding \(\left( \mathcal {T} , \tau \right) \),\(\mathcal {T} \subset \hbox {D}_{t} [ T ]\), fixing a point \(\theta \in \mathrm{R}_{{ t}}^{{ m}}\) and finite subsets \(\mathcal {P}_{1} ,\mathcal {Q}_{1} ,\mathcal {P}_{2} ,\mathcal {Q}_{2} \subset \hbox {D}_{t} [T ,X_{1} , \ldots ,X_{{ k}} ]\) such that \(\hbox {Bas} ( \mathcal {P}_{1} ( \theta , \cdot ), \mathcal {Q}_{1} ( \theta , \cdot ) )\) and \(\hbox {Bas} ( \mathcal {P}_{2} ( \theta , \cdot ) \mathcal {,Q}_{2} ( \theta , \cdot ) )\) are bounded.

  • Output: A finite set of real univariate representations over \(( \mathcal {T}, \tau )\) with associated points

    $$\begin{aligned} \hbox {MinDi} ( \hbox {Bas} ( \mathcal {P}_{1} ( \theta , \cdot ) \mathcal {,Q}_{1} ( \theta , \cdot ) ) , \hbox {Bas} ( \mathcal {P}_{2} ( \theta , \cdot ) \mathcal {,Q}_{2} ( \theta , \cdot ) ) ) . \end{aligned}$$
  • Complexity and degree bounds: Suppose that

    1. (1)

      \(\hbox {card} (\mathcal {Q}_{1} ), \hbox {card} ( \mathcal {Q}_{2} ) \le t,\)

    2. (2)

      \(\deg _{X} ( \mathcal {P}_{1} ,\mathcal {Q}_{1} ,\mathcal {P}_{2} , \mathcal {Q}_{2} ) \le d\),

    3. (3)

      \(\deg _{\eta ,T} ( \mathcal {T} ) \le D\),

    4. (4)

      and \(\deg _{\eta ,T} ( \mathcal {P}_{1} ,\mathcal {Q}_{1} ,\mathcal {P}_{2} ,\mathcal {Q}_{2} ) \le dD\).

    Then the number of arithmetic operations in D is bounded by \(d^{O ( k )} D^{O ( m+t )}\). The degrees in \(T, \eta \) of the polynomials appearing in the Thom encodings over \(( \mathcal {T,} \tau )\) output are bounded by \(O ( d )^{k} D\), while the degree in the new variable \(U\) is bounded by \(O ( d )^{k}\).

  • Procedure:

  • Step 1. Let \(S \subset \mathrm{R}^{{ k}} \times \mathrm{R}^{{ k}}\) be the semi-algebraic sets defined by

    $$\begin{aligned} S&= \hbox {Bas} ( \mathcal {P}_{1} ( \theta , \cdot ) ,\mathcal {Q}_{1} ( \theta , \cdot ) ) \times \hbox {Bas} ( \mathcal {P}_{2} ( \theta , \cdot ) ,\mathcal {Q}_{2} ( \theta , \cdot ) ) . \end{aligned}$$
  • Step 2. Let \(F =\sum _{1 \le i \le k} ( X_{i} -Y_{i} )^{2}\). Apply Algorithm 14.9 (Global Optimization) from [2] to the pair \(( S,F )\) with ring \(\hbox {D}_{t} [ \theta ]\) and project the output set of real univariate representations over \(( \mathcal {T}, \tau )\) to the first \(k\)-coordinates as well as to the last \(k\)-coordinates.

Proof of correctness

The correctness of Algorithm 4 is a consequence of the correctness of Algorithm 14.9 (Global Optimization) from [2]. \(\square \)

Proof of complexity and degree bounds

It follows from the complexity of Algorithm 14.9 (Global Optimization) from [2] and Remark 7.16 that the complexity of Step 2 is bounded by \(^{} d^{O ( k )} D^{O ( m+t )}\). The degree bounds follow from the complexity analysis of the Algorithm 14.9 (Global Optimization) from [2]. \(\square \)

7.3 The Divide Algorithm

We now describe Algorithm 5 (Divide) which will be used later to create the left and right children of a node of the tree, \(\hbox {Tree} ( V,\mathcal {A} )\), described in Sect. 7.1.1 above.

Algorithm 5. [Divide]

  • Input: A tuple \(( s, ( \mathcal {T} , \tau ) , \mathcal {P} , \mathcal {Q} ,A )\) satisfying the following.

    1. (1)

      \(s \in \{ 0,1 \}^{t}\).

    2. (2)

      \(( \mathcal {T}, \tau )\) is a triangular Thom encoding fixing \(\theta \in \mathrm{R}_{{ t}}^{| \mathrm{{fix}} ( s ) |} \), where \(\mathcal {T}\) is a triangular system with variables \(T_{\mathrm{{fix}} ( s )} = ( T_{i_{1}} , \ldots ,T_{i_{| \mathrm{{fix}} ( s ) |}} ),i_{j} \in \hbox {fix} ( s ) = \{ i \mid s_{i} =1 \}\).

    3. (3)

      \(\mathcal {P}\subset \hbox {D}_{t} [ T_{\mathrm{{fix}} ( s )} ,X_{\mathrm{{Fix}} ( s ) +1} , \ldots ,X_{{ k}} ]\) is a finite set of polynomials, where \(\mathrm{{Fix}} ( s ) = \sum _{i=1}^{t} s_{i} k'/2^{i}\), and \(\mathcal {Q}\subset \hbox {D}_{t} [ T_{\mathrm{{fix}} ( s )} ,X_{\mathrm{{Fix}} ( s ) +1} , \ldots ,X_{{ k}} ]\) is a set of \(t-\hbox {card} ( \hbox {fix} ( s ) )\) polynomials, defining a semi-algebraic set

      $$\begin{aligned} \hbox {Bas} ( \mathcal {P} ( \theta , \cdot ) ,\mathcal {Q} ( \theta , \cdot ) ) \subset \mathrm{R}_{{ t}}^{{ k}- \mathrm{{Fix}} ( s )} \end{aligned}$$

      (cf. Notation 7.1).

    4. (4)

      \(A\) is a finite set of real univariate representations over \(\mathcal {T}\), with associated points \(\mathcal {A} \subset S= \hbox {Bas} ( \mathcal {P} ( \theta , \cdot ) ,\mathcal {Q} ( \theta , \cdot ) )\), meeting every semi-algebraically connected component of \(S\).

    5. (5)

      \({\mathrm{{Zer}}} ( \mathcal {P} ( \theta , \cdot ) , \mathrm{R}_{{ t}}^{{ k}- \mathrm{{Fix}} (s)})\) is strongly of dimension \(\le p= k'/2^{t}\), if \(t \ne 0\). More precisely, for every \(z \in \mathrm{R}_{{ t}}^{{ p}}\), \({\mathrm{{Zer}}} ( \mathcal {P} ( \theta , \cdot ) , \mathrm{R}_{{ t}}^{{ k}-\mathrm{{Fix}} ( s )})_{z}\) is a finite set (possibly empty).

  • Output:

    A tuple \(( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} , \tilde{A} ,N,B, ( \mathcal {P}^{0} ( \alpha ) ,\mathcal {Q}^{0} ( \alpha ) ,A ( \alpha ) )_{\alpha \in \mathcal {I} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} ,p/2 )} )\) where:

    1. (1)

      \(\tilde{\mathcal {P}} \subset \hbox {D}_{t} \left[ \zeta _{{ t}+1} , \varepsilon _{t+1} \right] [ T_{\mathrm{{fix}} ( s )} ,X_{\mathrm{{Fix}} ( s ) +1} , \ldots X_{{ k}} ]\), is a finite set of polynomials with \(\hbox {card} ( \tilde{\mathcal {P}} ) =k- \hbox {Fix} ( s ) -p\).

    2. (2)

      \(\tilde{\mathcal {Q}} \subset \hbox {D}_{t} \left[ \zeta _{{ t}+1} , \varepsilon _{t+1} , \delta _{{ t}+1} \right] [ T_{\mathrm{{fix}} ( s )} ,X_{X_{\mathrm{{Fix}} ( s ) +1}} , \ldots X_{{ k}} ]\) is a finite set of polynomials with \(\hbox {card} ( \tilde{\mathcal {Q}} ) = \hbox {card} (\mathcal {Q} ) =t- \hbox {card} ( \hbox {fix} ( s ) )\).

    3. (3)

      \(\tilde{A}\) is a set of real univariate representations over \(( \mathcal {T}, \tau )\) whose set of associated points is \(\tilde{\mathcal {A}} \subset \tilde{S} = \hbox {Bas} ( \tilde{\mathcal {P}} ( \theta , \cdot ) , \tilde{\mathcal {Q}} ( \theta , \cdot ) )\).

    4. (4)

      \(N\) is a set of real univariate representations, \(u= ( h, \sigma ,H )\), over \(( \mathcal {T}, \tau )\) with associated points \(\mathcal {N} \subset \mathrm{R}_{{ t}+1}^{{ p}/2}\)(and new variable \(T_{{ t}+1}\)).

    5. (5)

      \(B= \bigcup _{u \in N} B ( u )\), where for each \(u= ( h, \sigma ,H ) \in N\) output in (4), \(B ( u )\) is a set of real univariate representations over \(( ( \mathcal {T},h ) , ( \tau , \sigma ) )\) describing \(\theta ' = ( \theta ,x_{\sigma } ) \in \mathrm{R}_{{ t}}^{\mathrm{{Fix}}(s)+1}\) whose set of associated points is \(\mathcal {B} ( u ) \subset \hbox {Bas} ( \tilde{\mathcal {P}}_{u} ( \theta ' , \cdot ) , \tilde{\mathcal {Q}}_{u} ( \theta ' , \cdot ) )\). We denote the set of associated points of \(B\) by \(\mathcal {B}\).

    6. (6)

      For every \(\alpha \in \mathcal {I} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} ,p/2 )\) (see Notation 6.3),

      $$\begin{aligned} \mathcal {P}^{0} ( \alpha ) ,\mathcal {Q}^{0} ( \alpha ) \subset \hbox {D}_{{ t}+1} \big [ T_{\mathrm{{fix}} ( s )} ,X_{\mathrm{{Fix}} ( s ) +1} , \ldots X_{{ k}} \big ] \end{aligned}$$

      are finite subsets with \(\hbox {card} (\mathcal {Q}^{0} (\alpha ))=\hbox {card} (\mathcal {Q} ) +1\), and \(A ( \alpha )\) is a set of real univariate representations over \(\mathcal {T}\), whose set of associated points is \(\mathcal {A} ( \alpha ) \subset S^{0} ( \alpha ) = \hbox {Bas} ( \mathcal {P}^{0} ( \alpha ) (\theta , \cdot ) ,\mathcal {Q}^{0} ( \alpha ) ( \theta , \cdot )).\)

    The tuple \(( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} , \tilde{A} ,N,B , ( \mathcal {P}^{0} ( \alpha ) ,\mathcal {Q}^{0} ( \alpha ) ,A ( \alpha ) )_{\alpha \in \mathcal {I} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} ,p/2 )} )\) satisfies the following properties. Let

    $$\begin{aligned} \tilde{S}^{0}&= \lim _{\gamma _{{ t}+1}} \Big ( \bigcup _{\alpha \in \mathcal {I} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} ,p/2 )} S^{0} ( \alpha )\Big ), \\ \tilde{S}^{1}&= \tilde{S}_{\mathcal {N}}. \end{aligned}$$
    1. (1)

      \(\lim _{\zeta _{t}} ( \tilde{S} ) =S\).

    2. (2)

      \(\tilde{S}^{0} \cup \tilde{S}^{ 1}\) has good connectivity properties with respect to \(\tilde{S}\).

    3. (3)

      \(\tilde{S}^{0}\) and \(\tilde{S}_{\mathcal {N}}\) are both strongly of dimension \(\le p/2\).

    4. (4)

      \(\tilde{\mathcal {A}} = \hbox {MinDi} ( \tilde{S} ,\mathcal {A} ) \cup \hbox {MinDi} ( \tilde{S} , \tilde{S} )\), \(\mathcal {N} \supset \pi _{[ \mathrm{{Fix}} ( s ) +1, \mathrm{{Fix}} ( s ) +p/2 ]} \big (\tilde{\mathcal {A}}\big )\).

    5. (5)

      \(\mathcal {B} = \tilde{S}^{0} \cap \tilde{S}^{1}\).

    6. (6)

      \(\mathcal {A} ( \alpha ) = \hbox {MinDi} ( S^{0} ( \alpha ) , \mathcal {B} ) \cup \big ( \displaystyle \bigcup \nolimits _{\beta \in \mathcal {I ( \tilde{P} , \tilde{\mathcal {Q}} , \ell )}} \hbox {MinDi} ( S^{0} ( \alpha ) ,S^{0} ( \beta ) ) \big )\).

    7. (7)

      For every \(\alpha \in \mathcal {I}\), \(\mathcal {A ( \alpha )} \subset S^{0} ( \alpha )\) meets every semi-algebraically connected component of \(S^{0} ( \alpha )\), and for every \(\alpha , \beta \) in \(\mathcal {I}\), and \(C\) (resp. \(D\)) semi-algebraically connected component of \(S^{0} ( \alpha )\) (resp. \(S^{0} ( \beta )\)) such that \(\lim _{\gamma _{{ t}+1}} ( C ) \cap \lim _{\gamma _{{ t}+1}} ( D )\) is non-empty, \(\lim _{\gamma _{{ t}+1}} ( C \cap \mathcal {A} ( \alpha ) ) \cap \lim _{\gamma _{{ t}+1}} ( D \cap \mathcal {A} ( \beta ) )\) is non-empty, and meets every semi-algebraically connected component of \(\lim _{\gamma _{{ t}+1}} ( C ) \cap \lim _{\gamma _{{ t}+1}} ( D )\).

  • Complexity and degree bounds: In order to simplify the complexity analysis, we are going to make the following assumptions which are going to be satisfied for each call to this algorithm in Algorithm 6 (Divide and Conquer Roadmap Algorithm for Bounded Algebraic Sets). Let the triangular system \(\mathcal {T}\) in the input be \(\mathcal {T}= ( F_{1} , \ldots ,F_{| \mathrm{{fix}} ( s ) |} )\), where for each \(h, \; 1 \le h \le \hbox {card} ( \hbox {fix} ( s ) )\), \(F_{h} \in \hbox {D}_{t} [ T_{i_{1}} , \ldots ,T_{i_{h}} ]\). Also denote \(\eta = \left( \zeta _{1} , \varepsilon _{1} , \delta _{1} , \gamma _{1} \ldots , \zeta _{t} , \varepsilon _{t} , \delta _{t} , \gamma _{t} \right) \) and \(\eta _{{ t}+1} = \left( \zeta _{{ t}+1} , \varepsilon _{t+1} , \delta _{{ t}+1} , \gamma _{t+1} \right) \) (as in Notation 7.1). Let \(c > 0\) be a constant. We assume that:

    1. (1)

      \(\deg _{X} ( \mathcal {P}, \mathcal {Q} ) \le ( 2 k )^{t } d\);

    2. (2)

      \(\deg _{T_{\mathrm{{fix}} ( s )}} ( \mathcal {P}, \mathcal {Q} )\), \(\deg _{\eta } ( \mathcal {P}, \mathcal {Q} )\), \(\deg _{T_{\mathrm{{fix}} ( s )}} ( F_{h} )\), \(\deg _{\eta } ( F_{h} )\) are all bounded by \(D^{t} ( ( 2k )^{t} d )^{c k t}\);

    3. (3)

      The degrees in \(\eta ,T_{\mathrm{{fix}} ( s )}\) of the polynomials (belonging to \(\hbox {D}_{t} [ T_{\mathrm{{fix}} ( s )} ,T_{{ t}+1} ]\)) appearing in the univariate representations \(A\) are bounded by

      $$\begin{aligned} D^{t} \big ( ( 2k )^{t} d\big )^{c k t},\end{aligned}$$

      while the degrees in \(T_{{ t}+1}\) are bounded by \(D\).

    With the above assumption on the input parameters, the output tuple (\(\tilde{\mathcal {P}} , \tilde{\mathcal {Q}}\),\(\tilde{A} ,N, B, ( \mathcal {P}^{0} ( \alpha ) ,\mathcal {Q}^{0} ( \alpha ),A ( \alpha ) )_{\alpha \in \mathcal {I} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} ,p/2 )}\)) satisfies the following, for \(c\) large enough.

    1. (1)
      $$\begin{aligned} \deg _{X} \big ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} \big )&\le 2( 2 k )^{t } d,\\ \deg _{T_{\mathrm{{fix}} ( s )}} \big ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} \big )&\le 2D^{t} \big ( ( 2k )^{t} d \big )^{c k t},\\ \deg _{\eta } \big ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} \big )&\le 2D^{t} \big ( ( 2k )^{t} d \big )^{c k t},\\ \deg _{\eta _{{ t}+1}} \big ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} \big )&= 1. \end{aligned}$$
    2. (2)
      $$\begin{aligned} \deg _{X} \big ( \mathcal {P}^{0} ( \alpha ) , \mathcal {Q}^{0} ( \alpha ) \big )&\le ( 2 k )^{t } d k, \\ \deg _{T_{\mathrm{{fix}} ( s )}} \big ( \mathcal {P}^{0} ( \alpha ) , \mathcal {Q}^{0} ( \alpha ) \big )&\le D^{{ t}+1} \big ( ( 2k )^{{ t}+1} d \big )^{c k ( t+1 )},\\ \deg _{\eta } \big ( \mathcal {P}^{0} ( \alpha ) , \mathcal {Q}^{0} ( \alpha ) \big )&\le D^{{ t}+1} \big ( ( 2k )^{{ t}+1} d \big )^{c k ( t+1 )}. \end{aligned}$$
    3. (3)

      The univariate representations in \(\tilde{A} ,N, B ,A ( \alpha )\) have degrees in the new variable \(T_{{ t}+1}\), as well as in \(\eta _{{ t}+1}\), bounded by \(D ( ( 2k )^{{ t}+1} d )^{ c k}\), and have degrees at most \(D^{{ t}+1} ( ( 2k )^{t+1} d )^{c k( t+1 )}\) in the variables \(\eta ,T_{\mathrm{{fix}} ( s )}\). The cardinalities of the sets \(\tilde{A} ,N, B,A ( \alpha )\) are all bounded by \(( \hbox {card} ( \mathcal {A} ) +1 ) ( ( 2k )^{{ t}+1} d )^{ c k}\).

    The complexity of the algorithm is bounded by

    $$\begin{aligned} ( \hbox {card} ( \mathcal {A} ) +1 ) D^{O ( t^{2} )} ( k^{t } d )^{O ( t^{2} )} . \end{aligned}$$
  • Procedure:

  • Step 1. Define \(\tilde{\mathcal {P}}\) and \(\tilde{\mathcal {Q}}\) as in Notation 5.4.

  • Step 2. Compute \(\tilde{M}\) as follows. For each subset \(\tilde{\mathcal {Q}}' \subset \tilde{\mathcal {Q}}\) and \( \tilde{\mathcal {P}} \cup \tilde{\mathcal {Q}}' = \{ F_{1} , \ldots ,F_{m} \} \), compute, using Algorithm 12.16 (Bounded Algebraic Sampling) from [2] in the ring \(\hbox {D}_{t} [ \theta ]\), a finite set of real univariate representations, \(\tilde{M} ( \tilde{\mathcal {Q}}' )\) over \(( \mathcal {T}, \tau )\) whose associated points are the real solutions to the system

    $$\begin{aligned} \hbox {CritEq}_{p/2} \big ( \tilde{\mathcal {P}} ( \theta , \cdot ) \cup \tilde{\mathcal {Q}}' ( \theta , \cdot ) ,G \big ) \end{aligned}$$

    and projecting the real univariate representations to the first \(k\) coordinates.

    Let

    $$\begin{aligned} \tilde{M}&= \bigcup _{\tilde{\mathcal {Q}}' \subset \tilde{\mathcal {Q}}} \tilde{M} \big ( \tilde{\mathcal {Q}}' \big ) . \end{aligned}$$

    Note that the associated set of points, \(\tilde{\mathcal {M}}\) of \(\tilde{M}\), is the finite set of critical points of \(G\) on \(\hbox {Bas} ( \tilde{\mathcal {P}} ( \theta , \cdot ) , \tilde{\mathcal {Q}} ( \theta , \cdot ) )\).

  • Step 3. Compute a set, \(D^{0}\), of Thom encodings over \(( \mathcal {T}, \tau )\) as follows.

    Let

    $$\begin{aligned} F=\prod _{\tilde{\mathcal {Q}}' \subset \tilde{\mathcal {Q}}} F \big ( \tilde{\mathcal {Q}}' \big ) , \end{aligned}$$

    where

    $$\begin{aligned} F \big ( \tilde{\mathcal {Q}}' \big ) = \sum _{P \in \hbox {CrEq}_{\ell } ( \tilde{\mathcal {P}} \cup \tilde{\mathcal {Q}}' ,G )} P^{2} . \end{aligned}$$

    Compute using Algorithm 2 (\(( B,G )\)-pseudo-critical values over a Triangular Thom Encoding), a set, \(D^{0}\), of Thom encodings over \(( \mathcal {T}, \tau )\), whose set of associated values, \(\mathcal {D}^{0}\), contain the \(( B,G )\)-pseudo-critical values of the set \( \{ F ( \theta , \cdot ) \} \cup \tilde{\mathcal {Q}} ( \theta , \cdot )\), with \(B=\mathcal {H}_{\mathrm{{card}} ( \mathcal {Q} ) +1,k-{_\mathrm{Fix}} ( s ) + \hbox {card} ( \tilde{\mathcal {P}} ) + \hbox {card} ( \tilde{\mathcal {Q}} ) +2}\) (see Notation 5.2).

  • Step 4. Compute \(M^{0}\) as follows. For each \(( h, \tau _{h} ) \in D^{0}\), use Algorithm 12.16 (Bounded Algebraic Sampling) from [2] in the ring \(\hbox {D}_{t} [ \theta ' ]\) (where \(\theta '\) is specified by \(\mathcal {T} \cup \{ h ( T_{\mathrm{{fix}} ( s )} ,U ) \} , ( \tau , \tau _{h} )\)) with input the set of polynomials \(\tilde{\mathcal {P}} \cup \tilde{\mathcal {Q}} \cup \{ G-U \}\), to obtain real univariate representations \(( f, \sigma _{f} ,F )\), where \(f \in \hbox {D}_{{ t}+1} [ T_{\mathrm{{fix}} ( s )} ,U,V ]\). Use Algorithm 12.16 (Bounded Algebraic Sampling) from [2] in the ring \(\hbox {D}_{t} [ \theta ]\) again with input \(\{ h,f \}\) to obtain a real univariate representation \(u= ( e, \tau _{e} ,E )\) over \(( \mathcal {T}, \tau )\) with \(e \in \hbox {D}_{{ t}+1} [ T_{\mathrm{{fix}} ( s )} ,T_{{ t}+1} ]\). Substitute the rational functions, in \(E\) corresponding to \(U,V\) into the polynomials in \(F\) to obtain \(F_{u}\). Output the resulting set of real univariate representations \(( e, \tau _{e} ,F_{u} )\) over \(( \mathcal {T}, \tau )\).

  • Step 5. Compute \(N\) as follows. First compute \(\tilde{A}\) by applying Algorithm 3 (Closest Point over a Triangular Thom Encoding) with input \(( ( \mathcal {T}, \tau ) , ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} ) ,u )\) for each \(u \in A\) and Algorithm 4 (Closest Pairs over a Triangular Thom Encoding) with input \(( ( \mathcal {T}, \tau ) , ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} ) , ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} ) )\). Keeping the first \(p/2\) coordinates of these real univariate representations, obtain a set of real univariate representations, \(N\), over \(( \mathcal {T}, \tau )\), with associated set of points \(\mathcal {N} = \pi _{[ \mathrm{{Fix}} ( s ) +1, \mathrm{{Fix}} ( s ) +p/2 ]} ( \tilde{\mathcal {M}} \cup \mathcal {M}^{0} \cup \tilde{\mathcal {A}} )\) (identifying those which are equal). For each \(w \in \mathcal {N}\), with corresponding real univariate representation \(( f, \sigma ,F )\), let \(( \mathcal {T}_{w} , \tau _{w} )\) denote the real triangular Thom encoding \(( ( \mathcal {T},f ) , ( \tau , \sigma ) )\).

  • Step 6. Compute \(B\) as follows. For each univariate representation \(u= ( e, \tau _{e} ,E ) \in N\), substitute the rational functions in \(u\), for the block of variables \(X_{\mathrm{{Fix}} ( s ) +1} , \ldots ,X_{\mathrm{{Fix}} ( s ) +p/2}\), in the polynomials \(F\),\(\tilde{\mathcal {Q}}\) to obtain \(F_{u} , \tilde{\mathcal {Q}}_{u}\). Now apply Algorithm 12.16 (Bounded Algebraic Sampling) from [2] in the ring \(\hbox {D}_{t} [ \theta '' ]\) (where \(\theta ''\) is specified by \(( ( \mathcal {T},e ) , ( \tau , \tau _{e} ) )\)) with input the polynomials \(F_{u} , \tilde{\mathcal {Q}}_{u}\), and project to the coordinates \(X_{\mathrm{{Fix}} ( s ) +p/2+1} , \ldots ,X_{{ k}}\) to obtain \(B ( u )\).

  • Step 7. For every \(\alpha = ( \tilde{\mathcal {Q}}' ,r,J,J' ) \in \mathcal {I} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} ,p/2 )\), compute

    $$\begin{aligned} \mathcal {P}^{0} ( \alpha )&:= \tilde{\mathcal {P}} \cup \tilde{\mathcal {Q}}' \cup \bigcup _{i \in [ \mathrm{{Fix}} ( s ) +p/2+1,k ] \setminus \hbox {fix} ( s )} \{ \hbox {jac} ( \alpha ,i ) \} ,\\ \mathcal {Q}^{0} ( \alpha )&:= \tilde{\mathcal {Q}} \cup \big \{ \hbox {jac} ( \alpha ,i)^{2} - \gamma \big \} . \end{aligned}$$

    (see Notation 6.2).

  • Step 8. Compute \(A ( \alpha )\) by applying for each \(\beta \in \mathcal {I} ( \tilde{\mathcal {P}} , \tilde{\mathcal {Q}} ,p/2 )\), Algorithm 3 (Closest Point over a Triangular Thom Encoding) with input

    $$\begin{aligned} \big ( ( \mathcal {T}, \tau ) ,\mathcal {P}^{0} ( \alpha ) ,\mathcal {Q}^{0} ( \alpha ) ,u \big ) \end{aligned}$$

    for each \(u \in B\) computed in Step 6, and Algorithm 4 (Closest Pairs over a Triangular Thom Encoding) with input

    $$\begin{aligned} \big ( ( \mathcal {T}, \tau ) ,\mathcal {P}^{0} ( \alpha ) ,\mathcal {Q}^{0} ( \alpha ) ,\mathcal {P}^{0} ( \beta ) ,\mathcal {Q}^{0} ( \beta ) \big ). \end{aligned}$$

Proof of correctness

The correctness of the algorithm follows from the correctness of the various algorithms called inside the algorithm, and Propositions 5.5, 5.11, 5.12, 5.21, and 6.1. \(\square \)

Proof of complexity and degree bounds

We first prove that the bounds stated in (1), (2), and (3) are true.

1. It is clear from Step 1 and Notation 5.4 that the degrees of the polynomials in \(\tilde{\mathcal {P}}\) (respectively, \(\tilde{\mathcal {Q}}\)) are at most twice the degrees of the polynomials in \(\mathcal {P}\) (respectively, \(\mathcal {Q}\)). It follows from the assumptions on the input that \( \deg _{X} ( \tilde{\mathcal {P}} ) , \deg _{X} ( \tilde{\mathcal {Q}} ) \le 2( 2 k )^{t } d\), and \(\deg _{T_{\mathrm{{fix}} ( s )}} ( \tilde{\mathcal {P}} ) , \deg _{T_{\mathrm{{fix}} ( s )}} ( \tilde{\mathcal {Q}} ) , \deg _{\eta } ( \tilde{\mathcal {P}} ) , \deg _{\eta } ( \tilde{\mathcal {Q}} ) \le 2D^{t} ( ( 2k )^{t} d )^{c k t}\). It also follows from Notation 5.4 that \(\deg _{\eta _{{ t}+1}} ( \tilde{\mathcal {P}} ) , \deg _{\eta _{{ t}+1}} ( \tilde{\mathcal {Q}} )=1\). This proves Part (1) of the complexity estimate of the output.

2. Part (2) is an easy consequence of the degree bounds on \(\tilde{\mathcal {P}}\) and \(\tilde{\mathcal {Q}}\) proved above in (1), and the definitions of \(\mathcal {P}^{0} ( \alpha )\) and \(\mathcal {Q}^{0} ( \alpha )\).

3. We now bound the degrees of the univariate representations in \(\tilde{M}\),\(D^{0} ,M^{0} , \tilde{A} ,N\). They have degrees in the new variable, as well as in \(\eta _{{ t}+1}\), bounded by \(( ( 2k )^{{ t}+1} d )^{ c k}\), and have degrees at most \(D^{t} ( ( 2k )^{{ t}+1} d )^{c k( t+1 )}\) in the variables \(T_{\mathrm{{fix}} ( s )} , \eta \).

i. The univariate representations in \(\tilde{M}\) are obtained by applying Algorithm 12.16 (Bounded Algebraic Sampling) from [2] to the set of equations in \(\hbox {CritEq}_{p/2} ( \tilde{\mathcal {P}} \cup \tilde{\mathcal {Q}}' ,G )\), for each subset \(\tilde{\mathcal {Q}}' \subset \tilde{\mathcal {Q}}\), and then projecting the real univariate representations to the first \(k\) coordinates. The number of variables (including the Lagrangian variables \(\lambda _{i}\)’s) is at most \(2k\). The degrees in \(X\) of the polynomials in \(\hbox {CritEq}_{\ell } ( \tilde{\mathcal {P}} \cup \tilde{\mathcal {Q}}' ,G )\) are bounded by the degrees in \(X\) of the polynomials in \(\tilde{\mathcal {P}}\) and \(\tilde{\mathcal {Q}}\) which are at most \( 2( 2 k )^{t } d\) (using the bounds in (1)), and the degrees in the Lagrangian variables are all equal to \(1\). The degrees in \(T_{\mathrm{{fix}} ( s )}\) and \(\eta \) in \(\hbox {CritEq}_{p/2} ( \tilde{\mathcal {P}} \cup \tilde{\mathcal {Q}}' ,G )\) are bounded by their degrees in \(\tilde{\mathcal {P}}\) and \(\tilde{\mathcal {Q}}\) which are at most \(2D^{t} ( ( 2k )^{t} d )^{c k t}\) (using the bounds in (1)). Finally, the degrees in \(\eta _{{ t}+1}\) of the polynomials in \(\hbox {CritEq}_{p/2} ( \tilde{\mathcal {P}} \cup \tilde{\mathcal {Q}}' ,G )\) are at most \(1\). Now using the complexity analysis of Algorithm 12.16 (Bounded Algebraic Sampling) from [2], we get the following bounds.

  • The degrees in the new variable \(T_{{ t}+1}\) and the new infinitesimals \(\eta _{{ t}+1}\) are bounded by

    $$\begin{aligned} \big (2( 2 k )^{t } d \big )^{2c_{1} k} , \end{aligned}$$

    where \(c_{1} >0\) is a constant; choosing \(c\) to be sufficiently large compared to \(c_{1}\),

    $$\begin{aligned} \big (2(2k)^{t}d\big )^{2c_{1}k}&\le \big ((2 k )^{t+1 } d \big )^{c k}. \end{aligned}$$
  • The degrees in \(T_{\mathrm{{fix}} ( s )}\) and \(\eta \) are bounded by

    $$\begin{aligned} 2D^{{ t}+1} \big ( ( 2k )^{t} d \big )^{c k t} \big (2( 2 k )^{t } d \big )^{2c_{1} k} \le D^{{ t}+1} \big ( ( 2k )^{{ t}+1} d \big )^{c k( t+1 )} , \end{aligned}$$

    given the choice of \(c\).

ii. The real Thom encodings, \(u \in D^{0}\) over \(\mathcal {T}\), are computed using Algorithm 2 (\(( B,G )\)-pseudo-critical values over a Triangular Thom Encoding), with the polynomial

$$\begin{aligned} F=\prod _{\tilde{\mathcal {Q}}' \subset \tilde{\mathcal {Q}}} F\big ( \tilde{\mathcal {Q}}' \big ), \end{aligned}$$
(29)

as input, where

$$\begin{aligned} F ( \tilde{\mathcal {Q}}' ) = \sum _{P \in \hbox {CrEq}_{\ell } ( \tilde{\mathcal {P}} \cup \tilde{\mathcal {Q}}' ,G )} P^{2} . \end{aligned}$$

The number of polynomials, \(F ( \tilde{\mathcal {Q}}' )\), appearing in the product in (29) is bounded by \(2^{\mathrm{{card}} ( \tilde{\mathcal {Q}} )} \le 2^{t} \le k\). Using the facts noted about the degrees in the various variables of the polynomials in \(\tilde{\mathcal {P}}\),\(\tilde{\mathcal {Q}}\) we obtain that the degree in \(X\) of \(F\) is bounded by \( 2^{{ t}+1} ( 2 k )^{t } d\). The degrees in the Lagrangian variables are bounded by \(2^{t}\). The degrees in the variables \(T_{\mathrm{{fix}} ( s )}\), and \(\eta \) are bounded by \(2^{{ t}+1} D^{t} ( ( 2k )^{t} d )^{c k t}\) . Finally, the degree in \(\eta _{{ t}+1}\) in \(F\) is at most \(2^{t}\). The number of variables is at most \(2k\).

Using the complexity analysis of Algorithm 2 (\(( B,G )\)-pseudo-critical values over a Triangular Thom Encoding) we get the following bounds.

  • The degree in the new variable \(U\) is bounded by

    $$\begin{aligned} \big ( 2^{{ t}+1} ( 2 k )^{t } d \big )^{2c_{2} k} \end{aligned}$$

    where \(c_{2} >0\) is a constant, while the degree in \(\eta _{{ t}+1}\) is bounded by

    $$\begin{aligned} 2^{t}\big ( 2^{{ t}+1} ( 2 k )^{t } d \big )^{2c_{2} k}; \end{aligned}$$

    choosing \(c\) to be sufficiently large compared to \(c_{2}\), and noting that \(2^{t} \le k\),

    $$\begin{aligned} 2^{t}\big ( 2^{{ t}+1} ( 2 k )^{t } d \big )^{2c_{2} k}&\le \big ( ( 2 k )^{t+1 } d \big )^{c k}. \end{aligned}$$
  • The degrees in \(T_{\mathrm{{fix}} ( s )}\) and \(\eta \) are bounded by

    $$\begin{aligned} 2^{{ t}+1} D^{t} \big ( ( 2k )^{t} d \big )^{c k t} \big (2^{{ t}+1} ( 2 k )^{t } d \big )^{2c_{2} k} \le D^{{ t}+1} \big ( ( 2k )^{{ t}+1} d \big )^{c k( t+1 )} , \end{aligned}$$

    given the choice of \(c\).

iii. In Step 4 (computation of \(M^{0}\)), the degrees of the polynomials in the real univariate representation \(( f, \sigma _{f} ,F )\) computed are bounded as follows.

  • The degrees in the new variable \(V\)and \(\eta _{{ t}+1}\) are bounded by

    $$\begin{aligned} \big (2( 2 k )^{t } d \big )^{c_{1} ( k+1 )} \end{aligned}$$

    using the complexity of Algorithm 12.16 (Bounded Algebraic Sampling) from [2].

  • The degrees in \(T_{\mathrm{{fix}} ( s )}\), and \(\eta \) are bounded by

    $$\begin{aligned} 2D^{t} \big ( ( 2k )^{t} d \big )^{c k t} \big (2 ( 2 k )^{t } d \big )^{c_{1} ( k+1 )} . \end{aligned}$$

Using again the complexity analysis of Algorithm 12.16 (Bounded Algebraic Sampling) from [2] we obtain that the degrees of the polynomials in \(u\) in the various variables are bounded as follows.

  • The degrees in the new variable \(T_{{ t}+1}\) and in \(\eta _{{ t}+1}\) are bounded by

    $$\begin{aligned} \big ( \max \big ( 2 \cdot 2^{t} \big ( 2^{{ t}+1} ( 2 k )^{t } d \big )^{2c_{2} k} ,2 \big ( 2( 2 k )^{t } d \big )^{c_{1} ( k+1 )} \big ) \big )^{2c_{1}} \le \big ( ( 2 k )^{t+1 } d \big )^{c k} \end{aligned}$$

    using the complexity of Algorithm 12.16 (Bounded Algebraic Sampling) from [2] and the degree bounds in \(U\) and \(V\) of the polynomials \(D^{0}\) and \(f\), and choosing \(c\) sufficiently large.

  • The degrees in \(T_{\mathrm{{fix}} ( s )}\) and \(\eta \) are bounded by the maximum of the degrees in \(T_{\mathrm{{fix}} ( s )}\), and \(\eta \) in the polynomials \(D^{0}\) and \(f\) multiplied by \(( ( 2 k )^{t+1 } d )^{c k}\). It follows that these degrees are bounded by

    $$\begin{aligned} D^{t} \big ( ( 2 k )^{t+1 } d \big )^{c k ( t+1 )} . \end{aligned}$$

iv. Using the complexity of Algorithm 4 (Closest Pairs over a Triangular Thom Encoding), and Algorithm 3 (Closest Point over a Triangular Thom Encoding) and the degree estimates of \(\tilde{\mathcal {P}}\) and \(\tilde{\mathcal {Q}}\) and of the univariate representations in \(A\), we obtain that the degrees in the univariate representations in \(\tilde{A}\) are bounded as follows.

  • The degrees in the new variable \(T_{{ t}+1}\) and \(\eta _{{ t}+1}\) are bounded by

    $$\begin{aligned} D \big (2( 2 k )^{t } d \big )^{2c_{1} k} , \end{aligned}$$

    where \(c_{1} >0\) is a constant; and given the choice of \(c\), we have that

    $$\begin{aligned} \big (2( 2 k )^{t } d \big )^{2c_{1} k}&\le \big ( ( 2 k )^{t+1 } d \big )^{c k}. \end{aligned}$$
  • The degrees in \(T_{\mathrm{{fix}} ( s )}\) and \(\eta \) are bounded by

    $$\begin{aligned} 2D^{{ t}+1} \big ( ( 2k )^{t} d \big )^{c k t} \big (2( 2 k )^{t } d \big )^{2c_{1} k} \le D^{{ t}+1} \big ( ( 2k )^{{ t}+1} d \big )^{c k( t+1 )} , \end{aligned}$$

    given the choice of \(c\).

  • Finally, the cardinality of \(\tilde{A}\) is bounded by \(( \hbox {card} ( \mathcal {A} ) +1 )( ( 2 k )^{t+1 } d )^{c k}\) using the complexity analysis of Algorithm 4 (Closest Pairs over a Triangular Thom Encoding) and Algorithm 3 (Closest Point over a Triangular Thom Encoding).

Together, (i), (ii), (iii), and (iv) above imply that the univariate representations in \(\tilde{M}\),\(D^{0} ,M^{0} , \tilde{A} ,N\) have degrees in the new variable, as well as in \(T_{{ t}+1} , \eta _{{ t}+1}\), bounded by \(D ( ( 2k )^{{ t}+1} d )^{ c k}\), and have degrees at most \(D^{{ t}+1} ( ( 2k )^{{ t}+1} d )^{c k( t+1 )}\) in \(T_{\mathrm{{fix}} ( s )} , \eta \). Moreover, the cardinalities of \(\tilde{M}\), \(D^{0} ,M^{0}\) are bounded by \(( ( 2k )^{{ t}+1} d )^{ c k}\) (taking into account that the number of polynomials in the call to Algorithm 2 (\(( B,G )\)-pseudo-critical values over a Triangular Thom Encoding) in Step 3 is bounded by \(t+1\)). The cardinalities of \(\tilde{A} ,N\) are bounded by \(( \hbox {card} ( \mathcal {A} ) +1 )( ( 2k )^{{ t}+1} d )^{ c k}\).

Using the bound on the degrees of \(F\) and the univariate representations in \(N\) obtained above, and the degree estimates of the output of Algorithm 12.16 (Bounded Algebraic Sampling) in [2], we get that the degrees of the polynomials appearing in \(B\) in the new variable are bounded by

$$\begin{aligned} \big (2( 2 k )^{t } d \big )^{2c_{1} k}&\le \big ( ( 2 k )^{t+1 } d \big )^{c k}, \end{aligned}$$

while the degrees in \(T_{\mathrm{{fix}} ( s )} , \eta \) are bounded by

$$\begin{aligned} D^{{ t}+1} \big ( ( 2k )^{{ t}+1} d \big )^{c k( t+1 )} \big ( 2( 2 k )^{t } d \big ) \big (2( 2 k )^{t } d \big )^{2c_{1} k} \le D^{{ t}+1} \big ( ( 2k )^{{ t}+1} d \big )^{c k( t+1 )} .&\end{aligned}$$

Finally, the degrees in \(T_{{ t}+1} , \eta _{{ t}+1}\) are bounded by

$$\begin{aligned} D \big (2( 2 k )^{t } d \big )^{2c_{1} k} \big (2( 2 k )^{t } d \big )^{2c_{1} k}&\le D \big ( ( 2 k )^{t+1 } d \big )^{c k}. \end{aligned}$$

The cardinality of \(B\) is bounded by \(( \hbox {card} ( \mathcal {A} ) +1 ) ( ( 2 k )^{t+1 } d )^{c k}\).

The degree estimates, as well as the estimates on the cardinality of \(A ( \alpha )\) are now a consequence of the bounds on the degrees of \(\mathcal {P}^{0} ( \alpha )\), \(\mathcal {Q}^{0} ( \alpha )\) and \(B\), and the cardinality of \(B\) proved above, and the complexity of Algorithm 4 (Closest Pairs over a Triangular Thom encoding), and Algorithm 3 (Closest Point over a Triangular Thom encoding)). This proves Part (3) of the complexity of the output.

It follows from the complexity estimates of the algorithms used in various steps of Algorithm 5, namely Algorithm 12.16 (Bounded Algebraic Sampling) in [2], Algorithm 14.9 (Global Optimization) in [2], Algorithm 2 (\(( B,G )\)-pseudo-critical values over a Triangular Thom Encoding), Algorithm 4 (Closest Pairs over a Triangular Thom Encoding), and Algorithm 3 (Closest Point over a Triangular Thom Encoding)), and Remark 7.16, as well as the degree estimates proved above, that the complexity of the whole algorithm is bounded by \(( \hbox {card} ( \mathcal {A} ) +1 ) D^{O ( t^{2} )} ( k^{t } d )^{O ( t^{2 } k )}\). \(\square \)

Remark 7.17

Notice that we never reduce any intermediate polynomial obtained in the computation, modulo \(\mathcal {T}\), and that \(( \mathcal {T, \tau } )\) is used only if the sign of an element of \(\hbox {D}_{t} [ \theta ]\), represented by a polynomial, is required. As a result the degrees in the \(T\)’s and also in the infinitesimals occurring in \(\mathcal {T}\) grow. We analyzed this growth carefully in the complexity analysis of Algorithm 5 (Divide). This is a point of difference between the algorithm presented in the current paper, and that in [3]. In the Baby-step Giant-step algorithm presented in [3] a process of pseudo-reduction was necessary since the degree growth in \(\mathcal {T}\) would have spoiled the overall complexity of the algorithm. This phenomenon does not occur here because the number of different blocks of variables (and hence the size of the triangular systems) in the algorithm of this paper is much smaller (\(O ( \log ( k ) )\)) compared to \(O( \sqrt{k})\) in the Baby-step Giant-step algorithm) and hence we can tolerate the growth in degree in the current paper without resorting to reducing in each step. This is fortunate, since pseudo-reduction is not anymore an option for us, as the growth in the degrees in the various infinitesimals in this divide-and-conquer approach would reach \(d^{ O ( k^{ 2} )}\), and will be unacceptably large.

7.4 Computation of the Tree \(\hbox {Tree} ( V,\mathcal {A} )\)

In this subsection we describe an algorithm computing the tree \(\hbox {Tree} ( V,\mathcal {A} )\), using in a recursive way Algorithm 5 (Divide) and analyze the complexity of this algorithm.

The description of the algorithm will use the following notation.

Notation 7.18

A node \(\mathfrak {n}\) of level \(t= \hbox {level} ( \mathfrak {n} )\) is a tuple

$$\begin{aligned} ( s ( \mathfrak {n} ) ,\mathcal {T} ( \mathfrak {n} ) , W ( \mathfrak {n} ) ,\mathcal {P} ( \mathfrak {n} ) ,\mathcal {Q} ( \mathfrak {n} ) ,A ( \mathfrak {n})), \end{aligned}$$

where

  1. (1)

    \(s ( \mathfrak {n} ) \in \{ 0,1 \}^{t}\);

  2. (2)

    \(\mathcal {T} ( \mathfrak {n}), \tau ( \mathfrak {n} ) ,W ( \mathfrak {n} )\) is a block triangular system fixing a point \(\theta ( \mathfrak {n} ) \in \mathrm{R}_{{ t}}^{\mathrm{{card}} ( \mathrm{{fix}} ( \mathfrak {n} ) )}\), and \(w ( \mathfrak {n} ) \in \mathrm{R}_{{ t}}^{\mathrm{{Fix}} ( \mathfrak {n} )}\), where

    $$\begin{aligned} \hbox {fix} ( \mathfrak {n} )&= \{ i \mid s ( \mathfrak {n} )_{i} =1 \} ,\\ \hbox {Fix} ( \mathfrak {n} )&= \sum _{i=1}^{t} s ( \mathfrak {n} )_{i} k'/2^{i} ; \end{aligned}$$
  3. (3)

    \(\mathcal {P} ( \mathfrak {n} ) \subset \mathrm{R}_{{ t}} [ T_{\mathrm{{fix}} ( \mathfrak {n} )}, X_{\mathrm{{Fix}} ( \mathfrak {n} ) +1} , \ldots ,X_{{ k}} ] \);

  4. (4)

    \(\mathcal {Q} ( \mathfrak {n} ) \subset \mathrm{R}_{{ t}} [ T_{\mathrm{{fix}} ( \mathfrak {n} )} ,X_{\mathrm{{Fix}} (\mathfrak {n} )+1} , \ldots ,X_{{ k}} ]\), \(\hbox {card} ( \mathcal {Q} ( \mathfrak {n} ) )=t- \hbox {card} ( \hbox {fix} ( \mathfrak {n} ) )\);

  5. (5)

    \(A ( \mathfrak {n} )\) is a set of real univariate representations over \(\mathcal {T} ( \mathfrak {n} )\), with associated points \(\mathcal {A} ( \mathfrak {n} ) \subset \hbox {Bas} ( \mathcal {P} ( \mathfrak {n} ) ( \theta ( \mathfrak {n} ) , \cdot ) ,\mathcal {Q} ( \mathfrak {n} ) ( \theta ( \mathfrak {n} ) , \cdot ) )\).

Algorithm 6. [Computation of the tree \(\hbox {Tree} ( V,\mathcal {A} )\)]

  • Input: A polynomial \(P \in \hbox {D}[ X_{1} , \ldots ,X_{{ k}} ]\) such that \(V= {\mathrm{{Zer}}} ( P, \mathrm{R}^{{ k}} )\) is bounded and strongly of dimension \(\le k'\), and a set \(A\) of real univariate representations with associated set of points \(\mathcal {A} \subset {\mathrm{{Zer}}} ( P, \mathrm{R}^{{ k}} )\).

  • Output: The tree \(\hbox {Tree} ( V,\mathcal {A} )\).

  • Complexity and degree bounds: Let \(d = \deg ( P )\) and suppose that the degrees of the polynomials appearing in the real univariate representations in \(A\) are bounded by \(D\). The complexity is bounded by

    $$\begin{aligned} (\mathrm{card}( \mathcal {A} ) +1 ) D^{O ( \log ^{2} ( k' ) )} ( k^{\log ( k' )} d )^{O ( k \log ^{2} ( k' ) }. \end{aligned}$$

    For each leaf node \(\mathfrak {n}\) of the tree \(\hbox {Tree} ( V,\mathcal {A} )\) output by the algorithm, the degrees in \(T_{\mathrm{{Fix}} ( \mathfrak {n} )}\), as well as in the variables \(\eta \)’s, of the polynomials in \(\mathcal {T} ( \mathfrak {n} )\), as well as those in \(\mathcal {P} ( \mathfrak {n} ) \) and \(\mathcal {Q} ( \mathfrak {n} )\), are all bounded by

    $$\begin{aligned} D^{\log ( k' ) +1} ( k^{\log ( k' )} d )^{O ( k\log ( k' ) )}. \end{aligned}$$

    The degrees in \(X_{\mathrm{{Fix}} ( \mathfrak {n} ) +1} , \ldots ,X_{{ k}}\) of \(\mathcal {P} ( \mathfrak {n} ) \) and \(\mathcal {Q} ( \mathfrak {n} )\) are bounded by

    $$\begin{aligned} (O ( k ))^{\log ( k' )} d. \end{aligned}$$
  • Procedure:

  • Step 1. Initialize \(\mathfrak {r}\) to be the node with

    1. (1)

      \(s ( \mathfrak {r} ):= ( )\);

    2. (2)

      \(\mathcal {T} ( \mathfrak {r} ) , \tau ( \mathfrak {r} ) ,W ( \mathfrak {r} )\) is empty;

    3. (3)

      \(\mathcal {P} ( \mathfrak {r} ) := \{ P \}\);

    4. (4)

      \(\mathcal {Q} ( \mathfrak {r} ) := \emptyset \);

    5. (5)

      \(A ( \mathfrak {r} ) :=A\).

    Initialize the set \(\hbox {Nodes} := \{ \mathfrak {r} \}\).

  • Step 2. Repeat until \(\hbox {level} ( \mathfrak {n} ) = \log ( k' )\) for all \(\mathfrak {n} \in \hbox {Nodes}\);

    • Select \(\mathfrak {n} \in \hbox {Nodes}\), such that \(\hbox {level} ( \mathfrak {n} ) < \log ( k' )\).

    • Remove \(\mathfrak {n}\) from \(\hbox {Nodes}\).

    • Call Algorithm 5 (Divide) with input \(( s ( \mathfrak {n} ) ,\mathcal {T} ( \mathfrak {n} ) ,\tau ( \mathfrak {n} ) ,\mathcal {P} ( \mathfrak {n} ) ,\mathcal {Q} ( \mathfrak {n} ) ,A ( \mathfrak {n} ) )\).

      • For each \(\alpha \) output by Algorithm 5 (Divide) add a node \(\mathfrak {m}\) to \(\hbox {Nodes}\) with

        1. (1)

          \(s ( \mathfrak {m} ) := ( s ( \mathfrak {n} ) ,0 )\);

        2. (2)

          \(( \mathcal {T} ( \mathfrak {m} ) , \tau ( \mathfrak {m} ) ) := ( \mathcal {T} ( \mathfrak {n} ), \tau ( \mathfrak {n} ) )\); \(W ( \mathfrak {m} ) := W ( \mathfrak {n} )\);

        3. (3)

          \(\mathcal {P} ( \mathfrak {m} ) :=\mathcal {P}^{0} ( \alpha ) \subset \mathrm{R}_{{ t}+1} [ T_{\mathrm{{fix}}( \mathfrak {m} )} ,X_{\mathrm{{Fix}} ( \mathfrak {m} ) +1} , \ldots ,X_{{ k}} ]\);

        4. (4)

          \(\mathcal {Q} ( \mathfrak {m} ) :=\mathcal {Q}^{0} ( \alpha ) \subset \mathrm{R}_{{ t}+1} [ T_{\mathrm{{fix}} ( \mathfrak {m} )} ,X_{\mathrm{{Fix}} ( \mathfrak {m} )+1} , \ldots ,X_{{ k}} ]\);

        5. (5)

          \(A ( \mathfrak {m} ) :=A ( \alpha )\).

      • For each real univariate representation \(u_{w}=(f_{w} ,F_{w}) , \tau \), in \(N\), representing a point \(w \in \mathcal {N}\), with \(f_{w,} ,F_{w} \subset \hbox {D}_{t} [ T_{\mathrm{{fix}}( \mathfrak {n} )} ,T_{{ t}+1} ]\), output by the algorithm, add a node \(\mathfrak {m}\) to \(\hbox {Nodes}\) with

        1. (1)

          \(s (\mathfrak {m} ) := ( s ( \mathfrak {n} ) ,1 )\);

        2. (2)

          \(( \mathcal {T} ( \mathfrak {m} ) , \tau ( \mathfrak {m} ) ) := ( \mathcal {T} ( \mathfrak {n} ) ,f_{w} ), ( \tau ( \mathfrak {n} ) , \tau )\); \(W ( \mathfrak {m} ) := ( W ( \mathfrak {n} ) ,u_{w} )\);

        3. (3)

          \(\mathcal {P} ( \mathfrak {m} ) :=\mathcal {P} ( \mathfrak {n} )_{w} \subset \mathrm{R}_{{ t}} [ T_{\mathrm{{fix}} ( \mathfrak {m} )} ,X_{\mathrm{{Fix}} ( \mathfrak {m} ) +1} , \ldots ,X_{{ k}} ]\);

        4. (4)

          \(\mathcal {Q} ( \mathfrak {m} ) :=\mathcal {Q} ( \mathfrak {n} )_{w} \subset \mathrm{R}_{{ t}} [ T_{\mathrm{{fix}} ( \mathfrak {m} )} ,X_{\mathrm{{Fix}} (\mathfrak {m} )+1} , \ldots ,X_{{ k}} ]\);

        5. (5)

          \(A ( \mathfrak {m} ) := \tilde{A} ( \mathfrak {n} )_{w} \cup B ( \mathfrak {n} )_{w}\).

      • Denote by \(\mathcal {A} ( \mathfrak {m} )\) (respectively, \(\mathcal {B} ( \mathfrak {m} ) , \tilde{\mathcal {A}} ( \mathfrak {m} )\)) the set of points associated to \(A ( \mathfrak {m} )\) (respectively, \(B ( \mathfrak {m} ) , \tilde{A} ( \mathfrak {m} )\)).

Proof of correctness

The correctness of the algorithm follows from Theorem 7.4 and the correctness of Algorithm 5. \(\square \)

Proof of complexity and degree bounds

We first observe that for each call to Algorithm 5 (Divide) in Algorithm 6 the input satisfies the estimates used in the complexity analysis of Algorithm 5 (Divide). This is obvious when Algorithm 5 (Divide) is called with \(\mathfrak {n}=\mathfrak {r}\), and in the other cases it follows inductively from the bound on the degrees proved in the complexity analysis of Algorithm 5 (Divide).

Using the complexity analysis of Algorithm 5 (Divide) the number of right children of any node \(\mathfrak {n}\) of level \(t\) in the tree created by the algorithm is bounded by the cardinality of \(N ( \mathfrak {n} )\), which in turn is bounded by \(( \hbox {card} ( \mathcal {A} ( \mathfrak {n} ) ) +1 )( ( 2k )^{{ t}+1} d )^{ c k}\). The number of left children of \(\mathfrak {n}\) is bounded by \(k \times \hbox {card} ( \mathcal {I} ( \mathcal {P} ( \mathfrak {n} ) ,\mathcal {Q} ( \mathfrak {n} ) , k'/2^{\mathrm{{level}} ( \mathfrak {n} )} ) ) =O ( 1 )^{k}\). Thus, the total number of children of a node \(\mathfrak {n}\) of level \(t\) is bounded by \(( \hbox {card} ( \mathcal {A} ( \mathfrak {n} ) )\!+\!1 ) ( ( 2k )^{{ t}\!+\!1} d )^{ c k}\).

Now let \(\mathfrak {m},\mathfrak {m}'\) be two distinct right children of \(\mathfrak {n}\). Then clearly \(\mathcal {A} ( \mathfrak {m} ) \cap \mathcal {A} ( \mathfrak {m}' )= \emptyset \), and using the complexity analysis of Algorithm 5 (Divide) we have

$$\begin{aligned} \sum \limits _{\mathfrak {m}\text { right child of }\mathfrak {n}} \hbox {card} ( \mathcal {A} ( \mathfrak {m} ) )&\le \hbox {card} ( \mathcal {\mathcal {B}} ( \mathfrak {n} ) ) + \hbox {card} \big ( \tilde{\mathcal {A}} ( \mathfrak {n} )\big )\\&\le 2 ( \hbox {card} ( \mathcal {A} ( \mathfrak {n} ) ) +1 )\big ( ( 2k )^{{ t}+1} d \big )^{ c k} . \end{aligned}$$

Moreover, for each left child \(\mathfrak {m}\) of \(\mathfrak {n}\), \(\hbox {card} ( \mathcal {A} ( \mathfrak {m} ) ) \le \hbox {card} ( \mathcal {A} ( \mathfrak {n} ) ) ( ( 2k )^{{ t}+1} d )^{ c k}\) again using the complexity analysis of Algorithm 5 (Divide). But since there are only \(O ( 1 )^{k}\) left children of \(\mathfrak {n}\) we obtain that

$$\begin{aligned} \sum \limits _{\mathfrak {m} \text { child of }\mathfrak {n}} ( \hbox {card} ( \mathcal {A} ( \mathfrak {m} ) ) +1 )&\le 3 ( \hbox {card} ( \mathcal {A} ( \mathfrak {n} ) ) +1 )\big ( ( 2k )^{{ t}+1} d \big )^{ c k} \nonumber \\&\le ( \hbox {card} ( \mathcal {A} ( \mathfrak {n} ) ) +1 )\big ( ( 2k )^{{ t}+1} d \big )^{ c'k} \end{aligned}$$
(30)

for some \(c' >0\).

We now prove by induction on \(t\), with base case \(t=0\), that

$$\begin{aligned} \sum _{\mathrm{{level}} ( \mathfrak {n} ) =t} \big ( \hbox {card} ( \mathcal {A} ( \mathfrak {n} ) ) +1 )&\le ( \hbox {card} ( \mathcal {A} ) +1 ) ( ( 2k )^{{ t}+1} d \big )^{ c''k ( t+1 )} \end{aligned}$$
(31)

for some \(c'' >0\).

For the base case,

$$\begin{aligned} \hbox {card} ( \mathcal {A} ( \mathfrak {r} ) ) +1&\le ( \hbox {card} ( \mathcal {A} ) +1 ) ( 2k d )^{ c''k} . \end{aligned}$$

For the inductive step (from \(t-1\) to \(t\)) we have

$$\begin{aligned} \sum \limits _{\mathrm{{level}} ( \mathfrak {m} ) =t} ( \hbox {card} ( \mathcal {A} ( \mathfrak {m} ) ) +1 )&= \sum _{\mathrm{{level}} ( \mathfrak {n} ) =t-1} \sum _{\mathfrak {m} \text { child of }\mathfrak {n}} ( \hbox {card} ( \mathcal {A} ( \mathfrak {m} ) ) +1 )\\&\le \sum _{\mathrm{{level}} ( \mathfrak {n} ) =t-1} ( \hbox {card} ( \mathcal {A} ( \mathfrak {n} ) ) +1 )( ( 2k )^{t} d )^{ c'k} \text {(using (30))}\\&\le ( \hbox {card} ( \mathcal {A} ) +1 ) ( ( 2k )^{t} d )^{ c''k t} ( ( 2k )^{t} d )^{ c'k} \\&\text { (using the induction hypothesis)}\\&\le ( \hbox {card} ( \mathcal {A} ) +1 ) ( ( 2k )^{{ t}+1} d )^{ c''k ( t+1 )} , \end{aligned}$$

taking \(c''\) large compared to \(c'\).

Using the complexity analysis of Algorithm 5 (Divide) and (31), we now obtain that the total cost of the calls to Algorithm 5 (Divide) for all nodes of the tree at level \(t\) is bounded by

$$\begin{aligned}&( \hbox {card} ( \mathcal {A} ) +1 ) \big ( ( 2k )^{{ t}+1} d \big )^{ c''k ( t+1 )} D^{O ( t^{2} )} ( k^{t}d )^{O ( t^{2} k )}\\&\quad = ( \hbox {card} ( \mathcal {A} ) +1 ) D^{O ( t^{2} )} ( k^{t}d )^{O ( t^{2} k )} . \end{aligned}$$

Since the tree has depth \(\log ( k' )\) the total cost of the calls to Algorithm 5 (Divide) is bounded by

$$\begin{aligned} ( \hbox {card} ( \mathcal {A} ) +1 ) D^{O ( \log ^{2} ( k' ) )} \big ( k^{\log ( k' )} d \big )^{O ( k\log ^{2} ( k' ) )} . \end{aligned}$$

From the complexity analysis of Algorithm 5 (Divide) we also get that for each \(\mathfrak {n} \in \hbox {Leav}\), the degrees in \(T_{\mathrm{{Fix}} ( \mathfrak {n} )}\), and the variables \(\eta \)’s, of the polynomials in \(\mathcal {T} ( \mathfrak {n} )\), as well as those in \(\mathcal {P} ( \mathfrak {n} ) \) and \(\mathcal {Q} ( \mathfrak {n} )\), are all bounded by

$$\begin{aligned} D^{\log ( k' ) +1} \big ( k^{\log ( k' )} d \big )^{O ( k\log ( k' ) )}. \end{aligned}$$

The degrees in \(X_{\mathrm{{Fix}} ( \mathfrak {n} ) +1} , \ldots ,X_{{ k}}\) of \(\mathcal {P} ( \mathfrak {n} ) \) and \(\mathcal {Q} ( \mathfrak {n} )\) are bounded by \(O ( k )^{\log ( k' )} d\). \(\square \)

Remark 7.19

Note that in the above analysis of the degrees in the variables \(T\)’s and the infinitesimals \(\eta \)’s of the polynomials in \(\mathcal {P} ( \mathfrak {n} ) ,\mathcal {Q} ( \mathfrak {n} )\) depends on \(s ( \mathfrak {n} )\). It is instructive to work out the actual bound on the degrees in the following three cases (in the special case where \(\mathcal {A}= \emptyset \)):

  1. 1.

    \(s ( \mathfrak {n} ) =0^{t}\): In this case, the polynomials in \(\mathcal {P} ( \mathfrak {n} ) ,\mathcal {Q} ( \mathfrak {n} )\) do not have any \(T' s\) in them, and the degrees in \(\eta \) is bounded by \(O ( k )^{t} d\). It is not difficult to see that the complexity of Algorithm 5 (Divide) at such a node is bounded by \(d^{O ( k )} k^{O ( k t )}= d^{O ( k )} k^{O ( k\log ( k' ) )}\).

  2. 2.

    \(s ( \mathfrak {n} ) =1^{t}\): In this case, the degrees of the polynomials in \(\mathcal {P} ( \mathfrak {n} ) ,\mathcal {Q} ( \mathfrak {n} )\) in \(T\)’s and \(\eta \)’s are bounded by \(O ( d )^{k'/2^{t-1}}\). As a consequence, it is not difficult to see that the complexity of Algorithm 5 (Divide) at such a node is bounded by \(d^{O ( k )} k^{O ( k\log ( k' ) )}\).

If these were the only types of nodes in the tree computed by Algorithm 6 then we would obtain an algorithm with complexity \(d^{O ( k\log ( k' ) )} k^{O ( k\log ^{2} ( k' ) )}\). In fact the complexity is worse and this is caused by paths in the tree which are away from the extreme left and right ones. For example consider a node \(\mathfrak {n}\) with level \(t\), and with \(s ( \mathfrak {n} ) =0101 \ldots \). The polynomials in \(\mathcal {P} ( \mathfrak {n} ) ,\mathcal {Q} ( \mathfrak {n} )\) will depend on \(T_{2} ,T_{4}, \ldots \) while since \(\hbox {Free} ( \mathfrak {m} ) \ge \frac{k}{2}\) for each node \(\mathfrak {m}\) along the path from the root to \(\mathfrak {n}\), the degrees in each of the \(T_{2i}\) can only be bounded by \(( k^{i} d )^{O ( k i )}\), and is thus \(( k^{t} d )^{O ( k t )}\) in the worst case. As a result the complexity of the call to Algorithm 5 (Divide) at the node \(\mathfrak {n}\) can only be bounded by \(( k ^{\log ( k' )}d )^{O ( k\log ^{2} ( k' ) )}\), and this dominates the complexity of all calls to Algorithm 5 (Divide) in Algorithm 6.

7.5 Divide and Conquer Roadmap

We are going to construct the roadmap of \(V\) from the tree \(\hbox {Tree} ( V,\mathcal {A} )\), by taking limits of the basic semi-algebraic sets associated to the leaves, which are strongly of dimension \(\le 1 \). Theorem 7.4 then guarantees the correctness of the algorithm. Thus, we need to know how to compute limits of points and curve segments, and this what we explain below.

In the following \(\bar{\varepsilon } = \left( \varepsilon _{1} , \ldots , \varepsilon _{t} \right) \) is a tuple of infinitesimals.

Algorithm 7 [Limit of a Bounded Point]

  • Input:

    1. (1)

      A Thom encoding \(\left( f_{\bar{\varepsilon }} , \sigma _{\bar{\varepsilon }} \right) \) , \(f_{\bar{\varepsilon }} \in \hbox {D}\left[ \bar{\varepsilon } ,U \right] \), representing \(x_{\bar{\varepsilon }} \in {\mathrm{R}} \langle \bar{\varepsilon } \rangle \) bounded over \(\mathrm{R}\).

    2. (2)

      A real univariate representation \(\left( g_{\bar{\varepsilon }} , \tau _{\bar{\varepsilon }} ,G_{\bar{\varepsilon }} \right) \) over \(\left( f_{\bar{\varepsilon }} , \sigma _{\bar{\varepsilon }} \right) \), where \(g_{\bar{\varepsilon }} ,G_{\bar{\varepsilon }} \subset \hbox {D}[ \bar{\varepsilon } ,U,V]\), representing a point \(z_{\bar{\varepsilon }} \in {\mathrm{R}} \langle \bar{\varepsilon } \rangle ^{p}\) bounded over \(\mathrm{R}\).

  • Output: a real univariate representation \((g, \tau ,G)\) representing

    $$\begin{aligned} z= \lim _{\varepsilon _{1}} ( z_{\bar{\varepsilon }} ) \in \mathrm{R}^{p} . \end{aligned}$$
  • Complexity and degree bounds: If \(D\) is a bound on the degrees of the polynomials in \(f_{\bar{\varepsilon }} ,g_{\bar{\varepsilon }}\) and \(G_{\varepsilon }\) with respect to \(U,V\) and \(\bar{\varepsilon }\), then the degrees of the polynomials appearing in the output are bounded by \(D^{O ( 1 )}\), and the number of arithmetic operations in \(\hbox {D}\) is bounded by \(p^{O ( 1 )} D^{O (t)}\).

  • Procedure:

  • Step 1. Using Algorithm 12.16 (Bounded Algebraic Sampling) from [2] in the ring \(\hbox {D}\left[ \bar{\varepsilon } \right] \) with input \(\left\{ f_{\bar{\varepsilon }} ,g_{\bar{\varepsilon }} \right\} \) obtain a set of univariate representation \(u= \left( h_{\bar{\varepsilon }} ,H= ( h_{0} ,h_{U} ,h_{V} ) \right) \). For each such \(u\), substitute the rational function \(\frac{h_{U}}{h_{0}}\) for \(U\) in \(f_{\bar{\varepsilon }}\) and its derivatives with respect to \(U\). Similarly, substitute the rational functions \(\frac{h_{U}}{h_{0}} , \frac{h_{V}}{h_{0}}\) for \(U,V\) in \(g_{\bar{\varepsilon }}\) and its derivatives with respect to \(V\) to obtain \(f_{\bar{\varepsilon } ,u} ,g_{\bar{\varepsilon } ,u}\) and \(\hbox {Der} \left( f_{\bar{\varepsilon }} \right) _{u}\),\(\hbox {Der} \left( g_{\bar{\varepsilon }} \right) _{u}\).

  • Step 2. Using Algorithm 10.13 (Univariate Sign Determination) from [2] with input \(h_{\varepsilon }\), \(\hbox {Der} \left( h_{\varepsilon } \right) \) and \(\hbox {Der} \left( f_{\bar{\varepsilon }} \right) _{u}\),\(\hbox {Der} \left( g_{\bar{\varepsilon }} \right) _{u}\), determine a real univariate representation \(u= \left( h_{\bar{\varepsilon }} , \tau '_{\bar{\varepsilon }} ,E= ( h_{0} ,h_{U} ,h_{V} ) \right) \) whose associated point is \(\left( u_{\bar{\varepsilon }} ,v_{\bar{\varepsilon }} \right) \) where \(u_{\bar{\varepsilon }}\) is associated to the Thom encoding \(\left( f_{\bar{\varepsilon }} , \sigma _{\bar{\varepsilon }} \right) \) and \(v_{\bar{\varepsilon }}\) is associated to the Thom encoding \(\left( g_{\bar{\varepsilon }} , \tau _{\bar{\varepsilon }} \right) \) over \(\left( f_{\bar{\varepsilon }} , \sigma _{\bar{\varepsilon }} \right) \). Substitute the rational functions \(\frac{h_{U}}{h_{0}} , \frac{h_{V}}{h_{0}}\) for \(U,V\) in \(G_{\bar{\varepsilon }}\), to obtain \(G_{\bar{\varepsilon } ,u}\) and replace \(\left( g_{\bar{\varepsilon }} , \tau _{\bar{\varepsilon }} ,G_{\bar{\varepsilon }} \right) \) by the new real univariate representation \(\left( e, \tau _{e} ,G_{\bar{\varepsilon } ,u} \right) \), where \(e \in \hbox {D}\left[ \bar{\varepsilon , } T \right] \).

  • Step 3. Replace (see Notation 5.3) \(g_{\bar{\varepsilon }}\) by \(\bar{\varepsilon }^{-o_{\bar{\varepsilon }} \left( g_{\bar{\varepsilon }} \right) }g_{\bar{\varepsilon }}\). Denote by \(g (T)\) the polynomial obtained by substituting successively \(\varepsilon _{t}\) by \(0\), and then \(\varepsilon _{t-1}\) by 0, and so on, and finally \(\varepsilon _{1}\) by \(0\), in \(g_{\bar{\varepsilon }}\). Similarly denote by \(G (T)\) the polynomials obtained by substituting successively \(\varepsilon _{t}\) by \(0\), and then \(\varepsilon _{t-1}\) by 0, and so on, and finally \(\varepsilon _{1}\) by \(0\), in \(G_{\bar{\varepsilon }}\).

  • Step 4. Compute the set \(\Sigma \) of Thom encodings of roots of \(g (T)\) using Algorithm 10.13 (Univariate Sign Determination) from [2]. Denoting by \(\mu _{\sigma }\) the multiplicity of the root of \(g (T)\) with Thom encoding \(\sigma \), define \(G_{\sigma }\) as the \(( \mu _{\sigma } -1 )\)-st derivative of \(G\) with respect to \(T\).

  • Step 5. Identify the Thom encoding \(\sigma \) and \(G_{\sigma }\) representing \(z\) using Algorithm 11.13 (Univariate Sign Determination) from [2], by checking whether a ball of infinitesimal radius \(\delta \) (\(1 \gg \delta \gg \bar{\varepsilon } >0\)) around the point \(z\) represented by the real univariate representation \(g, \sigma ,G_{\sigma }\) contains \(z_{\bar{\varepsilon }}\).

Proof of correctness

The correctness of the algorithm follows from the correctness of Algorithm 12.16 (Bounded Algebraic Sampling) and Algorithm 10.13 (Univariate Sign Determination) from [2]. \(\square \)

Proof of complexity and degree bounds

Using the complexity analysis of Algorithm 12.16 (Bounded Algebraic Sampling) from [2] the number of arithmetic operations in the ring \(\hbox {D}\left[ \bar{\varepsilon } \right] \) is bounded by \(p^{O ( 1 )} D^{O ( 1 )}\). The degrees in \(T, \bar{\varepsilon }\) of the polynomials in \(H\), as well as \(f_{\bar{\varepsilon } ,u} ,g_{\bar{\varepsilon } ,u}\), are also bounded by \(D^{O ( 1 )}\). From the complexity analysis of Algorithm 10.13 (Univariate Sign Determination) from [2], the number of arithmetic operations in \(\hbox {D}\left[ \bar{\varepsilon } \right] \) in Step 2 is bounded by \(D^{O ( 1 )}\). It also follows that the number of arithmetic operations in \(\hbox {D}\) of these two steps is bounded by \(D^{O ( t )}\). From the bound on the degrees in \(\bar{\varepsilon }\) it follows that the complexity of Step 3 is bounded by \(p^{O ( 1 )} D^{O ( t )}\). Since the degrees do not increase in Step 3, it follows again from the complexity analysis of Algorithm 10.13 (Univariate Sign Determination) from [2] that the number of arithmetic operations in \(\hbox {D}\) in Steps 4 and 5 is bounded by \(p^{O ( 1 )} D^{O ( t )}\). Thus, the total complexity is bounded by \(p^{O ( 1 )} D^{O ( t )}\), and the degrees of the polynomials appearing in the output are bounded by \(D^{O ( 1 )}\). \(\square \)

Definition 7.20

Let \(({g}_{1} , \tau _{1} )\), \(({g}_{2} , \tau _{2} )\) be Thom encodings above a Thom encoding \(( h, \sigma )\). We denote by \(z \in \mathrm{R}\) the point specified by \(( h, \sigma )\), and by \((z,a)\), \((z,b)\) the points specified by \(({g}_{1} , \tau _{1} )\) and \(({g}_{2} , \tau _{2} )\).

A curve segment representation \(\left( u, \rho \right) \) on \(( {g}_{1} , \tau _{1} ) , ({g}_{2} , \tau _{2} )\) over \(( h, \sigma )\) is:

  • a parametrized univariate representation with parameters \((X_{\le i} )\), i.e.,

    $$\begin{aligned} u= (f(Z,X,U),f_{0} (Z,X,U),f_{1} (Z,X,U), \ldots ,f_{k} (Z,X,U)) \subset \hbox {D}[ Z,X,U ] , \end{aligned}$$
  • a sign condition \(\rho \) on \(\hbox {Der}(f)\) such that for every \(x \in (a,b)\) there exists a real root \(u (x)\) of \(f (z,x,U)\) with Thom encoding \(\rho \) and \(f_{0} (z,x,u ( x ) ) \ne 0\).

The curve segment associated to \(u, \rho \) is the semi-algebraic function \(\upsilon \) which maps a point \(x\) of \((a,b)\) to the point of \(\mathrm{R}^{{ k}}\) defined by

$$\begin{aligned} \upsilon (x) = \Big ( x, \frac{f_{1} (z,x,u ( x ) )}{f_{0} (z,x,u ( x ) )} , \ldots , \frac{f_{k} (z,x,u ( x ) )}{f_{0} (z,x,u ( x ) )} \Big ) . \end{aligned}$$

It is a continuous injective semi-algebraic function.

In the following algorithms we will need to compute descriptions of the limits of certain curve segments. These limits are computed using a slight modification of Algorithm (Limit of a Curve) from [3].

Algorithm 8. [Divide and Conquer Roadmap Algorithm for Bounded Algebraic Sets]

  • Input: A polynomial \(P \in \hbox {D}[ X_{1} , \ldots ,X_{{ k}} ]\) such that \({\mathrm{{Zer}}} ( P, \mathrm{R}^{{ k}} )\) is bounded, and a set \(A= \{ u_{1} , \ldots ,u_{m} \}\) of real univariate representations with associated set of points \(\mathcal {A} \subset {\mathrm{{Zer}}} ( P, \mathrm{R}^{{ k}} )\).

  • Output: A roadmap, \(\hbox {DCRM} ( {\mathrm{{Zer}}} ( P , \mathrm{R}^{{ k}} ) ,\mathcal {A})\), of \({\mathrm{{Zer}}} ( P, \mathrm{R}^{{ k}} )\) containing \(\mathcal {A}\).

  • Complexity and degree bounds: Let \(d = \deg ( P )\) and suppose that the degrees of the polynomials appearing in the real univariate representation in \(A\) with associated point \(p_{i}\) be bounded by \(D_{i}\). The complexity is bounded by

    $$\begin{aligned} \Big ( 1+ \sum _{i=1}^{m} D_{i}^{O ( \log ^{2} ( k' ) )} \Big ) \big ( k^{\log ( k' )} d \big )^{O ( k \log ( k' )^{2} } . \end{aligned}$$

    Moreover, the degrees of the polynomials appearing in the descriptions of the curve segments and points in the output are bounded by

    $$\begin{aligned} \Big ( \max _{1 \le i \le k}D_{i} \Big )^{O ( \log ( k' ) )} \big ( k^{\log ( k' )} d \big )^{O ( k\log ( k' ) )} . \end{aligned}$$
  • Procedure:

  • Step 1. For each \(i,1 \le i \le m\), call Algorithm 6 with input \(P\) and \(\{ u_{i} \}\), and denote by \(\hbox {Leav}\) the collection of the leaves of \(\hbox {Tree} ( V, \{ u_{i} \} ),i=1, \ldots ,m\).

  • Step 2. Define

    $$\begin{aligned} \varGamma&:= \bigcup _{\mathfrak {n} \in \hbox {Leav}} \hbox {Bas} ( \mathfrak {n} ) ) . \end{aligned}$$

    Compute \(\lim _{\zeta _{1}} ( \varGamma )\) as follows.

    1. (1)

      For each \(\mathfrak {n} \in \hbox {Leav}\), let

      $$\begin{aligned} F ( \mathfrak {n} ):= \sum _{f \in \mathcal {T} ( \mathfrak {n} )} f^{2} \in \hbox {D}_{\log ( k' )} \big [ T_{\mathrm{{fix}} ( \mathfrak {n} )} \big ] . \end{aligned}$$
    2. (2)

      Compute using Algorithm 12.16 (Bounded Algebraic Sampling) from [2] in the ring \(\hbox {D}_{\log ( k' )} [ \theta ( \mathfrak {n} ) ]\) and \(F ( \mathfrak {n} )\) as input, and compute a real univariate representation \(u_{\mathfrak {n}} = ( h_{\mathfrak {n}} , \sigma _{\mathfrak {n} ,} H_{\mathfrak {n}} )\) whose associated point \(w ( \mathfrak {n} ) \in \mathrm{R}_{\log ( k' )}^{\mathrm{{Fix}} ( \mathfrak {n} )}\).

    3. (3)

      For every \(\mathcal {Q}' \subset \mathcal {Q} ( \mathfrak {n} )\), apply Algorithm 15.2 (Curve Segments) from [2] with input the Thom encoding \(( h_{\mathfrak {n}} , \sigma _{\mathfrak {n} ,} )\) specifying \(c_{\mathfrak {n}} \in \mathrm{R}_{\log ( k' )}\) and the polynomial

      $$\begin{aligned} G ( \mathfrak {n} )= \sum _{g \in \mathcal {P} ( \mathfrak {n} )_{u_{\mathfrak {n}}} \cup \mathcal {Q'}_{u_{\mathfrak {n}}}} g^{2} \in \hbox {D}_{\log ( k' )} \big [ U,X_{\mathrm{{Fix}} ( \mathfrak {n} ) +1} , \ldots ,X_{{ k}} \big ] . \end{aligned}$$

      with parameter \(X_{\mathrm{{Fix}} ( \mathfrak {n} ) +1}\) to obtain a set, \(\varGamma _{\mathfrak {n}}\), of curve segments with associated sets contained in \(\{ w ( \mathfrak {n} ) \} \times \mathrm{R}^{{ k}- \hbox {Fix} ( \mathfrak {n} )}_{\log ( k' )}\). Subdivide the interval of definition of each curve segment into pieces above which the sign of \(\mathcal {Q} ( \mathfrak {n} )\) remains fixed on the curve segment, and retain only those contained \(\hbox {Bas} ( \mathcal {P ( \mathfrak {n} ) ,Q} ( \mathfrak {n} ) )\) using Algorithm 11.19 (Restricted Elimination) from [2].

    4. (4)

      Now apply Algorithm (Limit of a Curve) from [3] to the curve segments output in Step 3, with the following modifications:we use Algorithm 7 (Limit of a Bounded Point) instead of the corresponding algorithm in [3] and replace the various instances of substituting \(\varepsilon \) by \(0\) by substituting successively \(\eta _{t}\) by \(0\), and then \(\eta _{t-1}\) by 0, and so on, and finally \(\eta _{1}\) by \(0\).

Proof of correctness

Follows from the correctness of Algorithms 6, 7, Algorithm (Limit of a Curve) from [3], and Proposition 7.3. \(\square \)

Proof of complexity and degree bounds

The complexity of Step 1 is

$$\begin{aligned} \Big ( 1+ \sum \limits _{i=1}^{m} D_{i}^{O ( \log ^{2} ( k' ) )} \Big ) \big ( k^{\log ( k' )} d \big )^{O ( k \log ^{2} ( k' ) )} \end{aligned}$$

by the complexity of Algorithm 6. Now using the complexity analysis of Algorithm 12.16 (Bounded Algebraic Sampling) from [2], as well as those of Algorithm 15.2 (Curve Segments) from [2], and Algorithm 11.19 (Restricted Elimination) from [2], the number of arithmetic operations in \(\hbox {D}[ \eta ]\) in Steps 2(i), 2(ii), and 2(iii) is bounded by

$$\begin{aligned} \Big ( 1+ \sum \limits _{i=1}^{m} D_{i}^{O ( \log ( k' ) )} \Big ) \big ( k^{\log ( k' )} d \big )^{O ( k \log ( k' ) )} . \end{aligned}$$

So using the fact that the degrees in \(\eta \) are bounded by \(D_{i}^{O ( \log ( k' ) )} ( k^{\log ( k' )} d )^{O ( k\log ( k' ) )}\) in the complexity analysis of Algorithm 6, the number of arithmetic operations in \(\hbox {D}\) is bounded by

$$\begin{aligned} \Big ( 1+ \sum \limits _{i=1}^{m} D_{i}^{O ( \log ^{2} ( k' ) )} \Big ) \big ( k^{\log ( k' )} d \big )^{O ( k \log ^{2} ( k' ) )} . \end{aligned}$$

Note also that the degrees (in the parameters as well as in \(\eta \)) of the polynomials used to describe the curve segments output in Step 2(iii) are bounded by \(D_{i}^{O ( \log ( k' ) )} ( k^{\log ( k' )} d )^{O ( k\log ( k' ) )}\). Finally using the complexity analysis of Algorithm (Limit of a Curve) from [3], as well as that of Algorithm 7 (Limit of a Bounded Point), we get that the complexity of Step 2(iv) is bounded by

$$\begin{aligned} \Big ( 1+ \sum _{i=1}^{m} D_{i}^{O ( \log ^{2} ( k' ) )} \Big ) \big ( k^{\log ( k' )} d \big )^{O ( k \log ^{2} ( k' ) )} \end{aligned}$$

as well. Thus, the total complexity is bounded by

$$\begin{aligned} \Big ( 1+ \sum _{i=1}^{m} D_{i}^{O ( \log ^{2} ( k' ) )} \Big ) \big ( k^{\log ( k' )} d \big )^{O ( k \log ^{2} ( k' ) )} . \end{aligned}$$

Moreover, it follows from above and the complexity of Algorithm (Limit of a Curve) from [3], and Algorithm 7 (Limit of a Bounded Point), that the degrees of the polynomials appearing in the descriptions of the curve segments and points in the output are bounded by \(( \max _{1 \le i \le k}D_{i} )^{O ( \log ( k' ) )} ( k^{\log ( k' )} d )^{O ( k\log ( k' ) )}\). \(\square \)

We are now in a position to describe a divide-and-conquer algorithm for computing a roadmap of a general (i.e., possibly unbounded) algebraic set. The procedure of passing from the bounded case to the unbounded one is the same as that used in [1] as well as in [3]. We include it here for the sake of completeness.

We first need a notation.

Notation 7.21

Let \(F \in \hbox {D}[ X ]\) be given by \(F= a_{p} X^{p} + \cdots +a_{q} X^{q}\). We denote

$$\begin{aligned} c ( P )&= \left( \sum \limits _{i=q}^{p} \Big \vert \tfrac{a_{i}}{a_{q}} \Big \vert \right) ^{-1}\!. \end{aligned}$$

Algorithm 9. [Divide and Conquer Roadmap Algorithm for General Algebraic Sets]

  • Input: A polynomial \(P \in \hbox {D}[ X_{1} , \ldots ,X_{{ k}} ]\) such that \({\mathrm{{Zer}}} ( P, \mathrm{R}^{{ k}} )\) is bounded and strongly of dimension \(\le k'\), and a set \(A= \{ u_{1} , \ldots ,u_{m} \}\) of real univariate representations with associated set of points \(\mathcal {A} \subset {\mathrm{{Zer}}} ( P, \mathrm{R}^{{ k}} )\).

  • Output: A roadmap, \(\hbox {DCRM} ( {\mathrm{{Zer}}} ( P , \mathrm{R}^{{ k}} ) ,\mathcal {A})\), of \({\mathrm{{Zer}}} ( P, \mathrm{R}^{{ k}} )\) containing \(\mathcal {A}\).

  • Complexity and degree bounds: Let \(d = \deg ( P )\), and suppose that the degrees of the polynomials appearing in the real univariate representation in \(A\) with associated point \(p_{i}\) are bounded by \(D_{i}\). The complexity is bounded by

    $$\begin{aligned} \Big ( 1+ \sum \limits _{i=1}^{m} D_{i}^{O ( \log ^{2} ( k' ) )} \Big ) \big ( k^{\log ( k' )} d \big )^{O ( k \log ( k' )^{2} } . \end{aligned}$$

    The degrees of the polynomials appearing in the descriptions of the curve segments and points in the output are bounded by

    $$\begin{aligned} ( \mathop {\max }\limits _{1 \le i \le k} D_{i} )^{O ( \log ( k' ) )} \big ( k^{\log ( k' )} d \big )^{O ( k\log ( k' ) )}. \end{aligned}$$
  • Procedure:

  • Step 1. Introduce new variables \(X_{k+1}\) and \(\varepsilon \) and replace \(P\) by the polynomial

    $$\begin{aligned} P_{\varepsilon } =P^{2} + \Big ( \varepsilon ^{2} \Big ( \sum _{i=1}^{k+1} X_{i}^{2} \Big ) -1 \Big )^{2} . \end{aligned}$$
  • Step 2. Replace \(A\) by \(A_{\varepsilon }\), the set of real univariate representations representing the elements \(\mathcal {A}_{\varepsilon }\) of \({\mathrm{{Zer}}} ( P_{\varepsilon } , \mathrm{R}\langle \varepsilon \rangle ^{{ k}} )\) above the points represented by \(\mathcal {A}\) using Algorithm 12.16 (Bounded Algebraic Sampling) [2].

  • Step 3. Call Algorithm 8 (Divide and Conquer Roadmap Algorithm for Bounded Algebraic Sets) with input \(P_{\varepsilon } ,A\), performing arithmetic operations in the domain \(\hbox {D}\left[ \varepsilon \right] \). The algorithm outputs a roadmap

    $$\begin{aligned} \hbox {DCRM} \big ( {\mathrm{{Zer}}} \big ( P_{\varepsilon } , \mathrm{R}\langle \varepsilon \rangle ^{{ k}+1} \big ) ,\mathcal {A}_{\varepsilon } \big ) \end{aligned}$$

    composed of points and curves whose description involves \(\varepsilon \).

  • Step 4. Denote by \(\mathcal {L}\) the set of polynomials in \(\hbox {D}\left[ \varepsilon \right] \) whose signs have been determined in the preceding computation and take

    $$\begin{aligned} a= \min _{F \in \mathcal {L}}c ( F ) \end{aligned}$$

    using Notation 7.21.

    Replace \(\varepsilon \) by \(a\) in the polynomial \(P_{\varepsilon }\) to get a polynomial \(P_{a}\). Replace \(\varepsilon \) by \(a\) in the output roadmap to obtain a roadmap which when projected to \(\mathrm{R}^{{ k}}\) gives a roadmap of \({\mathrm{{Zer}}} ( P , {\mathrm{R}}^{k} ) \cap \bar{B}_{k} \left( 0, \tfrac{1}{a} \right) \) (where \(\bar{B}_{k} (x,r)\) is the \(k\)-dimensional closed ball of center \(x\) and radius \(r\)) containing the finite set of points \(\mathcal {A}\).

  • Step 5. In order to extend the roadmap outside \(\bar{B}_{k} \left( 0, \tfrac{1}{a} \right) \) collect all the points \(( y_{1} , \ldots ,y_{k} ,y_{k+1} ) \in \mathrm{R}\langle \varepsilon \rangle ^{{ k}+1}\) in the roadmap

    $$\begin{aligned} \hbox {DCRM} \big ( {\mathrm{{Zer}}} \big ( P_{\varepsilon } , \mathrm{R}\langle \varepsilon \rangle ^{k+1} \big ) ,\mathcal {A}_{\varepsilon }\big ), \end{aligned}$$

    which satisfies \(\varepsilon ^{2} ( y_{1}^{2} + \cdots +y_{k+1}^{2} ) =1\). Each such point is described by a real univariate representation involving \(\varepsilon \). Add to the roadmap the curve segment obtained by first forgetting the last coordinate and then treating \(\varepsilon \) as a parameter which varies over \(( 0,a ]\) to get a roadmap \(\hbox {DCRM} ( {\mathrm{{Zer}}} ( P , \mathrm{R}^{{ k}} ) ,\mathcal {A})\).

Proof of correctness

The correctness follows from the correctness of Algorithm 8 (Divide and Conquer Roadmap Algorithm for Bounded Algebraic Sets), taking into account that a bounded algebraic set is always strongly of dimension \(\le k-1\). \(\square \)

Proof of complexity and degree bounds

It is clear that the complexity is dominated by that of the third step. The degree bounds on the polynomials in the output follow from those of Algorithm 8 (Divide and Conquer Roadmap Algorithm for Bounded Algebraic Sets). \(\square \)

7.6 Proofs of Theorems 1.4, 1.2 and 1.5

Proof of Theorem 1.4

Clear from the the proofs of correctness, complexity and degree bounds of Algorithm 8 (Divide and Conquer Roadmap Algorithm for Bounded Algebraic Sets). \(\square \)

Proof of Theorem 1.2

Clear from the proofs of correctness, complexity and degree bounds of Algorithm 9 (Divide and Conquer Roadmap Algorithm for General Algebraic Sets). \(\square \)

Proof of Theorem 1.5

Using Theorem 1.2, we have that \(x,y\) can be connected by a semi-algebraic path, consisting of at most \(( k ^{\log ( k )} d )^{O ( k\log ( k ) )}\) curve segments, and each curve segment has degree bounded by \(( k ^{\log ( k )} d )^{O ( k \log ( k ) )}\). It is clear that a curve segment of degree bounded by \(D\) meets a generic hyperplane in at most \(O ( D^{2} )\) points. It now follows immediately from the Cauchy–Crofton formula [19] that the length of each curve segment appearing in the path is bounded by \(( k ^{\log (k )} d )^{O ( k\log ( k ) )}\), and finally that the total length of the path is also bounded by \(( k ^{\log ( k )} d )^{O ( k\log ( k ) )}\). \(\square \)

8 Annex: Auxiliary Proofs

The main purpose of this Annex is to prove Lemmas 2.7, 2.8 and Proposition 4.6 which were stated earlier in the paper. We first prove an auxiliary proposition that will be needed in the proofs of Lemma 2.8 and Proposition 4.6.

Proposition 8.1

Let \(\mathcal {P},\mathcal {Q} \subset \mathbb {R} [ X_{1} , \ldots ,X_{{ k}} ]\) be a finite set of polynomials and let \(G \in \mathbb {R} [ X_{1} , \ldots ,X_{{ k}} ]\). Suppose that \([ a,b ] \subset \mathbb {R}\) is such that \(G ( \mathrm{{Crit}} ( \mathcal {P},\mathcal {Q},G ) ) \cap ( a,b )\) is empty. Let \(S= \mathrm{{Bas}} ( \mathcal {P},\mathcal {Q} )\) be bounded. Then for any \(c \in ( a,b )\) the semi-algebraic set \(S_{a<G<b}\) is homeomorphic to \(S_{G=c} \times ( a,b )\) by a fiber preserving homeomorphism. In particular, for each semi-algebraically connected component \(C\) of \(S_{a<G<b}\), \(C_{G=c}\) is non-empty and semi-algebraically connected.

Proof

The condition that \(G ( \hbox {Crit} ( \mathcal {P},\mathcal {Q},G ) ) \cap [ a,b ]\) is empty implies that \(S_{a<G<b}\) is a Whitney-stratified set with strata \({\mathrm{{Zer}}} ( \mathcal {P} \cup \mathcal {Q}' ,\mathbb {R}^{k} )_{a<G<b} \cap S\), \(\mathcal {Q}' \subset \mathcal {Q}\), where the dimension of \({\mathrm{{Zer}}} ( \mathcal {P} \cup \mathcal {Q}' ,\mathbb {R}^{k} )_{a<G<b}\) is equal to \(k- ( \hbox {card} ( \mathcal {P} \cup \mathcal {Q}')\) if non-empty. The proposition now follows from a basic result in stratified Morse theory (see for example, Theorem SMT Part A in [9]). \(\square \)

8.1 Proof of Properties of \(G\)-Critical Values

Proof of Lemma 2.7

Let \(x\) and \(y\) be two points of \(C_{G \le a}\) and \(\gamma : [0,1] \rightarrow C\) be a semi-algebraic path connecting \(x\) to \(y\) inside \(C\). We want to prove that there is a semi-algebraic path connecting \(x\) to \(y\) inside \(C_{G \le a}\).

If \(\hbox {Im}( \gamma ) \subset C_{G \le a}\) there is nothing to prove. If \(\hbox {Im}( \gamma ) \not \subset C_{G \le a}\),

$$\begin{aligned} \exists c \in \mathrm{R}, \forall a<d<c, \hbox {Im}( \gamma ) \cap S_{{ G}={ d}} \ne \emptyset . \end{aligned}$$

Let \(\varepsilon \) be a positive infinitesimal. Then

$$\begin{aligned} \hbox {Ext}( \gamma ([0,1]), \mathrm{R}\langle \varepsilon \rangle ) \cap \hbox {Ext}\left( S, \mathrm{R}\langle \varepsilon \rangle \right) _{{ G}={ a}+ \varepsilon } \ne \emptyset \end{aligned}$$

using [2, Proposition 3.17].

Since

$$\begin{aligned} \big \{u \in [0,1] \subset \mathrm{R}\langle \varepsilon \rangle \mid \hbox {Ext}( \gamma , \mathrm{R}\left\langle \varepsilon \right\rangle )(u) \in \hbox {Ext}\left( S, \mathrm{R}\langle \varepsilon \rangle \right) _{{ G}<{ a}+ \varepsilon } \big \} \end{aligned}$$

and

$$\begin{aligned} \big \{u \in [0,1] \subset \mathrm{R}\langle \varepsilon \rangle \mid \hbox {Ext}( \gamma , \mathrm{R}\left\langle \varepsilon \right\rangle )(u) \in \hbox {Ext}\left( S , \mathrm{R}\langle \varepsilon \rangle \right) _{[{ a}+ \varepsilon \le { G} \le { b}]} \big \} \end{aligned}$$

are semi-algebraic subsets of \([0,1] \subset \mathrm{R}\langle \varepsilon \rangle \) there exists by [2, Corollary 2.79] a finite partition \(\mathfrak {P}\) of \([0,1] \subset \mathrm{R}\langle \varepsilon \rangle \) such that for each open interval \((u,v)\) of \(\mathfrak {P}\), \(\hbox {Ext}( \gamma , \mathrm{R}\left\langle \varepsilon \right\rangle ) (u,v)\) is either contained in

$$\begin{aligned} \hbox {Ext}\left( S, \mathrm{R}\langle \varepsilon \rangle \right) _{G<a+ \varepsilon }, \end{aligned}$$

or in

$$\begin{aligned} \hbox {Ext}\left( S, \mathrm{R}\langle \varepsilon \rangle \right) _{[a+ \varepsilon \le G \le b]}, \end{aligned}$$

with \(\gamma (u)\) and \(\gamma (v)\) in \(C_{G=a+\varepsilon }\).

If \(\hbox {Ext}( \gamma , \mathrm{R}\left\langle \varepsilon \right\rangle ) (u,v)\) is contained in \(\hbox {Ext}{\left( S, \mathrm{R}\langle \varepsilon \rangle \right) }_{[a+ \varepsilon \le G \le b]}\), we can replace \(\gamma \) by a semi-algebraic path \(\gamma '_{[a,b]}\) connecting \(\gamma (u)\) to \(\gamma (v)\) inside \(C_{G<a+ \varepsilon }\). Note that there is no critical point of \(G\) in \(\hbox {Ext}\left( S, \mathrm{R}\langle \varepsilon \rangle \right) _{[a+ \varepsilon \le G \le b]}\) by [2, Proposition 3.17].

By Proposition 8.1, if \(D\) is a semi-algebraically connected component of

$$\begin{aligned} \hbox {Ext}(S, \mathrm{R}\left\langle \varepsilon \right\rangle )_{{ a}+ \varepsilon \le { G} \le { b}}, \end{aligned}$$

\(D_{G=a+ \varepsilon }\) is a semi-algebraically connected component of \(\hbox {Ext}(S, \mathrm{R}\left\langle \varepsilon \right\rangle )_{{ G}={ a}+ \varepsilon }\).

Construct a semi-algebraic path \(\gamma '\) from \(x\) to \(x'\) inside \(C_{G \le a+ \varepsilon }\), obtained by concatenating pieces of \(\gamma \) inside \(\hbox {Ext}\left( S, \mathrm{R}\langle \varepsilon \rangle \right) _{G<a+ \varepsilon }\) and the paths \(\gamma '_{(u,v)}\) connecting \(\gamma (u)\) to \(\gamma (v)\) for \((u,v)\) such that \(\hbox {Ext}( \gamma , \mathrm{R}\left\langle \varepsilon \right\rangle ) (u,v) \subset \hbox {Ext}\left( S, \mathrm{R}\langle \varepsilon \rangle \right) _{{ a}+ \varepsilon \le { G} \le { b}}\). Note that such a semi-algebraically connected path \(\gamma '\) is closed and bounded. Applying [2, Proposition 12.43], \(\hbox {lim}_{\varepsilon } ( \gamma ' ([0,1]))\) is semi-algebraically connected, contains \(x\) and \(x'\) and is contained in \(\hbox {lim}_{\varepsilon } (C_{G \le a+ \varepsilon } ) =C_{G \le a}\). This is enough to prove the lemma. \(\square \)

Proof of Lemma 2.8

We are going to prove the lemma assuming \(\mathrm{R}= \mathbb {R}\). The general case follows from a standard transfer argument that we omit.

Part (1) follows immediately from Proposition 8.1. We now prove Part (2). Since \(\mathcal {M}\) is finite, there is a point \(x \in C_{G=b}\) which is not a critical point of \(G\) on \(S\). Let \(\mathcal {P}_{x}=\{ P\in \mathcal {P} \cup \mathcal {Q} \mid P ( x )= 0 \}\). Then, since \(x\) is not a \(G\)-critical point of \({\mathrm{{Zer}}} ( \mathcal {P}_{x} , \mathrm{R}^{{ k}} )\), it follows that \(T_{x}{\mathrm{{Zer}}} ( \mathcal {P}_{x} , \mathrm{R}^{{ k}} )\) is not tangent to the level surface of \(G\) defined by \(G=b\), and hence for \(\varepsilon >0\) infinitesimal, \(B_{{ k}} \left( x, \varepsilon \right) _{G<b} \cap T_{x}{\mathrm{{Zer}}} ( \mathcal {P}_{x} , \mathrm{R}\langle \varepsilon \rangle ^{k} )\) is not empty (where \(B_{k} (x,r)\) is the \(k\)-dimensional open ball of center \(x\) and radius \(r\)), and hence \(B_{k} \left( x, \varepsilon \right) _{G<b} \cap \) \({\mathrm{{Zer}}} ( \mathcal {P}_{x} , \mathrm{R}\langle \varepsilon \rangle ^{{ k}} )\) is not empty either. Let \(y\in B_{k} \left( x, \varepsilon \right) _{G<b} \cap {\mathrm{{Zer}}} ( \mathcal {P}_{x} , \mathrm{R}\langle \varepsilon \rangle ^{{ k}} )\). Then, since \(\lim _{\varepsilon } y =x \) and \(y \in {\mathrm{{Zer}}} ( \mathcal {P}_{x} , \mathrm{R}\langle \varepsilon \rangle ^{{ k}} )\), we have that for each polynomial \(P\in \mathcal {P} \cup \mathcal {Q}\), \(P ( x )\) and \(P ( y )\) have the same signs, and hence \(y\in S\). Moreover, since \(S\) is closed and \(\lim _{\varepsilon } y = x\in C\), we have that \(y\in \hbox {Ext}\left( C, \mathrm{R}\langle \varepsilon \rangle \right) \). Now using the transfer principle it follows \(C_{G<b}\) is non-empty.

Parts (2a) and (2b) are immediate consequences of Proposition 8.1.

We prove (2c). Clearly, \(\bigcup _{i=1}^{r} \bar{B_{i}} \subset C\). Suppose that \(x \in A=C \setminus \bigcup _{i=1}^{r} \bar{B_{i}}\). For \(r>0\) and small enough, \(B_{k} (x,r) \cap C_{G<b} = \emptyset \) . Note that \(G (b)=b\), since otherwise \(x\) belongs to \(C_{G<b}\), and thus to one of the \(B_{i}\)’s.

Applying Proposition 8.1, we deduce from the fact that \(B_{k} (x,r) \cap C_{G<b} =B_{k} (x,r)_{G<b} \cap C= \emptyset \) that \(x\) is a \(G\)-critical point of \({\mathrm{{Zer}}} ( \mathcal {P}_{x} , \mathrm{R}^{{ k}} )\). In other words \(x \in \mathcal {M}\). But since by assumption \(\mathcal {M}\) is finite, this implies that \(A\) is a finite set and is thus closed. Since \(C\) is semi-algebraically connected and \(\bigcup _{i=1}^{r} \bar{B_{i}}\) is closed and non-empty, \(A\) must be empty. \(\square \)

8.2 Proof of Properties of \(( B,G )\)-Pseudo-critical Values

Proof of Proposition 4.6

We are going to prove the proposition assuming \(\mathrm{R}= \mathbb {R}\). The general case follows from a standard transfer argument that we omit. Let \(\mathcal {F}= \{ F_{1} , \ldots ,F_{s} \}\), where \(\mathcal {P}= \{ F_{1} , \ldots ,F_{m} \} ,\mathcal {Q}= \{ F_{m+1} , \ldots ,F_{s} \}\).

  1. (1)

    It follows from the good rank property of the matrix \(B\) and Proposition 4.4 that for any \(I \subset [ 1,s ]\), \(\sigma \in \{ -1,1 \}^{I}\), the algebraic sets \({\mathrm{{Zer}}} ( \tilde{\mathcal {F}}_{I, \sigma ,B} , \mathrm{R}\langle \gamma \rangle ^{{ k}} )\) have at most isolated singularities. It now follows from the semi-algebraic Sard’s theorem [4], that the set of critical values of \(G\) restricted to the various \({\mathrm{{Zer}}} ( \tilde{\mathcal {F}}_{I, \sigma ,B} , \mathrm{R}\langle \gamma \rangle ^{{ k}} )\) is a finite set. This proves that the set \(\mathcal {D} ( \mathcal {P} \cup \mathcal {Q},B,G )\) is finite.

  2. (2)

    Let

    $$\begin{aligned} \tilde{\mathcal {F}}&= \bigcup \limits _{i=1}^{m} \{ \pm F_{i} + \gamma H_{i} \} \cup \bigcup \limits _{i=m+1}^{s} \{ F_{i} + \gamma H_{i} \} \end{aligned}$$

    and \(\tilde{S} = \hbox {Bas} ( \emptyset , \tilde{\mathcal {F}} ) \subset \mathrm{R}\langle \gamma \rangle ^{{ k}}\). Clearly, \(\hbox {Ext}\left( S, \mathrm{R}\langle \gamma \rangle \right) \subset \tilde{S}\), and since \(S\) is bounded, there exists a unique semi-algebraically connected component, \(\tilde{D}\) of \(\tilde{S}_{a \le G \le b}\), such that \(\tilde{D}\) is bounded over \(\mathrm{R}\), \(\hbox {Ext}\left( D, \mathrm{R}\langle \gamma \rangle \right) \subset \tilde{D}\), and \(\lim _{\gamma } \tilde{D} =D\). It is also clear from the definition of \(\tilde{S}\) and the fact that \(c \in \mathrm{R}\), that \(\hbox {Ext}\left( D_{G=c} , \mathrm{R}\langle \gamma \rangle \right) \subset \tilde{D}_{G=c}\), and \(D_{G=c} = \lim _{\gamma } ( \tilde{D}_{G=c} )\). Since, \(\tilde{D}\) is bounded over \(\mathrm{R}\), in order to prove that \(D_{G=c}\) is non-empty and semi-algebraically connected, it suffices to prove (using Proposition 12.43 in [2]) that \(\tilde{D}_{G=c}\) is non-empty and semi-algebraically connected. Since \(\lim _{\gamma } ( \hbox {Crit} ( \tilde{\mathcal {F}}_{I, \sigma ,B} ,G ) ) \cap \) \([a,b] \setminus \{c\}\) is empty for all \(I \subset [ 1,s ]\) and \(\sigma \in \{ -1,1 \}^{I}\), it follows that for all \(I \subset [ 1,s ]\) and \(\sigma \in \{ -1,1 \}^{I}\), \(( \hbox {Crit} ( \tilde{\mathcal {F}}_{I, \sigma ,B} ,G ) ) \cap [ a,b ]\) belongs to the interval \([c- \delta ,c+ \delta ]\) (respectively, \([ a,a+ \delta ]\) if \(c=a\), and \([ b- \delta ,b ]\) if \(c=b\)), where \(\delta >0\) is a new infinitesimal.

    We claim that \(\hbox {Ext}( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle )_{{ c}- \delta \le { G} \le { c}+ \delta }\) in case \(c \ne a,b\) (respectively, \(\hbox {Ext}( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle )_{{ a} \le {G} \le a+ \delta }\) if \(c=a\), and \(\hbox {Ext}\big ( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle \big )_{{ b}- \delta \le { G} \le { b}}\) if \(c=b\)) is non-empty and semi-algebraically connected. We prove the statement only in case \(c \ne a,b\); the proof in the other two cases being very similar.

       Let \(x,y\) be any two points in \(\hbox {Ext}( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle )_{{ c}- \delta \le { G} \le { c}+ \delta }\).

       We show that there exists a semi-algebraic path connecting \(x\) to \(y\) lying within \(\hbox {Ext}( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle )_{{ c}- \delta \le { G} \le { c}+ \delta }\). Since \(\tilde{D}\) itself is semi-algebraically connected, there exists a semi-algebraic path, \(\gamma : [0,1] \rightarrow \hbox {Ext}( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle )\), with \(\gamma (0) =x, \gamma (1) =y\), and \(\gamma (t) \in \hbox {Ext}( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle ) ,0 \le t \le 1\). If \(\gamma (t) \in \hbox {Ext}( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle )_{{ c}- \delta \le { G} \le { c}+ \delta }\) for all \(t \in [0,1]\), we are done. Otherwise, the semi-algebraic path \(\gamma \) is the union of a finite number of closed connected pieces \(\gamma _{i}\) lying either in \(\hbox {Ext}( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle )_{a \le G \le c- \delta } \), \(\hbox {Ext}( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle )_{{ c}- \delta \le { G} \le { c}+ \delta }\), or \(\hbox {Ext}( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle )_{{ c}+ \delta \le { G} \le { b}}\).

    By Lemma 2.7 the semi-algebraically connected components of

    $$\begin{aligned} \hbox {Ext}\big ( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle \big )_{{ G}={ c}- \delta } \end{aligned}$$

    (resp. \(\hbox {Ext}( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle )_{G=c+ \delta }\)) are in 1–1 correspondence with the semi-algebraically connected components of

    $$\begin{aligned} \hbox {Ext}( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle )_{{ a} \le { G} \le { c}- \delta }\end{aligned}$$

    (resp. \(\hbox {Ext}(\tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle )_{{ c}+ \delta \le { G} \le { b}}\)) containing them. In particular, notice that since \(D\) is non-empty being a semi-algebraically connected component of the semi-algebraic set \(S_{a \le G \le b}\), \(\tilde{D}\) is also non-empty, and hence at least one of the sets

    $$\begin{aligned}&\hbox {Ext}\big ( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle \big )_{{ a} \le { G} \le { c}- \delta }, \\&\hbox {Ext}\big (\tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle \big )_{{ c}- \delta \le { G} \le { c}+ \delta }, \\&\hbox {Ext}\big ( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle \big )_{{ c}+ \delta \le { G} \le { b}} \end{aligned}$$

    is not empty. Thus, \(\hbox {Ext}( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle )_{{ c}- \delta \le {G} \le {c}+ \delta } \ne \emptyset . \) But, since

    $$\begin{aligned} \lim _{\gamma } \left( \hbox {Ext}\big ( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle \big )_{{ c}- \delta \le { G} \le { c}+ \delta } \right) =D_{c}, \end{aligned}$$

    this proves that \(D_{c}\) is not empty. We can now replace using Proposition 8.1 each of the \(\gamma _{i}\) lying in

    $$\begin{aligned} \hbox {Ext}\big ( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle \big )_{{ a} \le { G} \le { c}- \delta } \end{aligned}$$

    (resp. \(\hbox {Ext}( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle )_{{ c}+ \delta \le { G} \le { b}}\)) with endpoints in \(\hbox {Ext}( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle )_{{ G}={ c}- \delta }\) (resp. \(\hbox {Ext}( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle )_{{ G}={ c}+ \delta }\)) by another segment with the same endpoints but lying completely in \(\hbox {Ext}( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle )_{{ G}={ c}- \delta }\)(resp. \(\hbox {Ext}( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle )_{{ G}={ c}+ \delta }\)). We thus obtain a new semi-algebraic path \(\gamma '\) connecting \(x\) to \(y\) and lying inside \(\hbox {Ext}( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle )_{{ c}- \delta \le { G} \le { c}+ \delta }.\) This proves that \(\hbox {Ext}( \tilde{D} , \mathrm{R}\langle \gamma , \delta \rangle )_{{ c}- \delta \le { G} \le { c}+ \delta }\) is semi-algebraically connected and hence so is \(\tilde{D}_{c} = \lim _{\delta } \tilde{D}_{c- \delta \le G \le c+ \delta }\) (by Proposition 12.43 in [2]). \(\square \)