Constructing a single cell in cylindrical algebraic decomposition

Constructing a single cell in cylindrical algebraic decomposition

Journal of Symbolic Computation 70 (2015) 14–48 Contents lists available at ScienceDirect Journal of Symbolic Computation www.elsevier.com/locate/js...

806KB Sizes 0 Downloads 15 Views

Journal of Symbolic Computation 70 (2015) 14–48

Contents lists available at ScienceDirect

Journal of Symbolic Computation www.elsevier.com/locate/jsc

Constructing a single cell in cylindrical algebraic decomposition Christopher W. Brown a , Marek Košta b a b

United States Naval Academy, 21402 Annapolis, MD, USA Max-Planck-Institut für Informatik, 66123 Saarbrücken, Germany

a r t i c l e

i n f o

Article history: Received 14 January 2014 Accepted 13 September 2014 Available online 19 September 2014 Keywords: Cylindrical algebraic decomposition Projection operator Polynomial constraints

a b s t r a c t This paper presents an algorithm which, given a point and a set of polynomials, constructs a single cylindrical cell containing the point, such that the given polynomials are sign-invariant in the computed cell. To represent a single cylindrical cell, a novel data structure is introduced. The algorithm works with this representation and proceeds incrementally, i.e., first constructing a cell representing the whole real space, and then iterating over the input polynomials, refining the cell at each step to ensure the sign-invariance of the current input polynomial. A merge procedure realizing this refinement is described, and its correctness is proven. The merge procedure is based on McCallum’s projection operator, but uses geometric information relative to the input point to reduce the number of projection polynomials computed. The use of McCallum’s operator implies the incompleteness of the algorithm in general. However, the algorithm is complete for well-oriented sets of polynomials. Moreover, the incremental approach described in this paper can be easily adapted to a different projection operator. The cell construction algorithm presented in this paper is an alternative to the “model-based” method described by Jovanovic´ and de Moura in a 2012 paper. It generalizes the algorithm described by the first author in a 2013 paper, which could only produce full-dimensional cells, to allow for the construction of cells of arbitrary dimension. While a thorough comparison, whether analytical or empirical, of the new algorithm and the “modelbased” approach will be the subject of future work, this paper

E-mail addresses: [email protected] (C.W. Brown), [email protected] (M. Košta). http://dx.doi.org/10.1016/j.jsc.2014.09.024 0747-7171/© 2014 Elsevier Ltd. All rights reserved.

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

15

provides preliminary justification for asserting the superiority of the new method. © 2014 Elsevier Ltd. All rights reserved.

1. Introduction Motivated by recent work of Jovanovic´ and de Moura (2012), Brown (2013) considered (roughly speaking) the problem of constructing a single open cell from a CAD, given a sample point.1 In the context of Jovanovic´ and de Moura’s work, this is viewed as generalizing from a point at which certain polynomial sign-conditions hold to an open cell in which those sign-conditions hold. The approach described in Brown (2013) has advantages over the straightforward approach of using partial CAD in the obvious way: It is faster, and it constructs cells that are generally larger — a better generalization, from Jovanovic´ and de Moura’s perspective. However, because only open cells are constructed, it returns FAIL for inputs containing a condition that a certain polynomial must be zero, i.e., inputs containing an equation, which is obviously quite limiting. Moreover, when the input sample point is a zero of one of the projection factors computed while constructing the cell, the algorithm must return FAIL. The contribution of this paper is an algorithm that extends the approach of Brown (2013) to allow cells of lower dimension to be constructed, and thus to deal with equations and to handle the situation in which an input polynomial or projection factor is zero at the input sample point. Our algorithm is not complete, meaning that it too might return FAIL, but as with CAD construction using the McCallum’s projection operator described in McCallum (1998), it is complete for well-oriented sets of polynomials. This paper is organized as follows: Section 2 gives the precise formulation of the cell construction problem mentioned above. The new algorithm, which extends the approach of Brown (2013), for the problem is informally described in Section 3. A novel data structure for representation of a single cell is introduced in Section 4. The straightforward algorithm for the cell construction problem is given in Section 5. The crucial part of the new algorithm—the merging algorithm—is formally described in Section 6. Sections 7 and 8 prove the correctness of the merging algorithm. After this, formal description of the new algorithm together with the proof of its correctness is given in Section 9. The relation between outputs of the new and the straightforward algorithm is determined in Section 9 as well. Section 10 is devoted to examples of cell construction using our new algorithm. Finally, Section 11 wraps up the achieved results and outlines future research directions. 2. The precise problem At its simplest, our problem is to take a point α and a set Q of polynomials, and produce a description of a cylindrical algebraic cell containing α in which the elements of Q have constant sign. However, this problem is not very well-defined. After all, α itself is a cylindrical algebraic cell, so an algorithm that simply returns α would “solve” the problem as posed. This prompts us to instead phrase our problem roughly as follows: Given a finite set P of polynomials in Z[x1 , . . . , xn ] and an algebraic point α ∈ Rn , construct the cell containing α that would be constructed by McCallum’s CAD algorithm (which would, however, have constructed many other cells as well), the payoff being that all elements of P will have constant sign throughout the cell. Connecting the cell we return to the cell that McCallum’s algorithm would produce allows us to deduce that repeatedly calling our algorithm, each time with a point that is not contained in any previously constructed cell, necessarily results after a finite number of steps in a finite set of cells that covers the whole n-dimensional Euclidean space (assuming the input set of polynomials is well-oriented). This is an immediate consequence of the fact that McCallum’s algorithm decomposes n-dimensional space into a finite number of cells. That said, we need to be still more careful in defining our problem for two reasons:

1

The exact formulation of the problem is somewhat more involved.

16

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

1. McCallum’s algorithm may return FAIL if the input set of polynomials is not well-oriented (McCallum, 1998, Section 6.1). In this case we will allow our algorithm to return FAIL as well. 2. We are happy to allow our algorithm to return a cylindrical cell containing the cell that McCallum’s algorithm would have constructed, as long as the elements of P have constant sign within the cell our algorithm produces.2 Clearly, one could solve this problem by simply applying McCallum’s CAD construction algorithm to P , locating the cell in the resulting CAD that contains α , and returning a description of that cell. In fact, there is an obvious way to apply the idea of partial CAD, introduced by Collins and Hong (1991), so that only a small number of the total number of cells in the CAD needs to be constructed in order to construct the one cell that contains α . Our purpose is to never do worse than that approach, and, hopefully, to usually do much better. Since we use the McCallum’s projection as a baseline like this, it is worth discussing the relationship between it and the “model-based projection” proposed by Jovanovic´ and de Moura (2012). After all, if our motivation is (at least in part) to improve their decision procedure, then we’d like our baseline to be better than what they are doing. First of all, what we propose is a model-based projection, meaning that the projection is based on the input point α , as is the projection in Brown (2013). However, Jovanovic´ and de Moura called their projection “the model-based projection,” so we use that term only to refer to it. There are two big differences between their work and ours. First, we do no worse than the McCallum’s projection, in terms of the size of the projection set, they do no worse than Collins’ projection operator. We inherit the difficulties inherent in McCallum’s projection (order-invariance, well-oriented sets, delineating polynomials, failures), but they inherit the larger projection factor sets inherent in Collins’ projection operator. The second difference is that we make stronger use of the model, i.e., of the point α . We do this by looking at not only whether particular polynomials vanish at α , but also by looking at geometric information about the ordering of roots of polynomials around α . In Brown (2013), this stronger use of geometric information produced substantially smaller projection factor sets and substantially larger cells. Because our problem will be cast in terms of McCallum’s algorithm, some understanding of it will be required. The reader that is not familiar with McCallum’s projection operator and lifting procedure is referred to McCallum (1998). For completeness, we provide the definition of McCallum’s projection operator, proj(·), and its closure proj∗ (·) in Definition 9. In Section 5 we provide a short description of the previously mentioned approach combining McCallum’s algorithm and partial CAD. We note that throughout this paper when the term delineable is used, it is intended to refer to analytic delineability, as defined in McCallum (1998). We also note that the definition of a cell’s dimension in the context of CAD is unambiguous, as all cells are analytic submanifolds and thus homeomorphic to an open ball of the appropriate dimension. With the notions of level, sector, and section defined in Section 3, we can characterize the dimension of a k-level cell as the number of levels i ∈ {1, . . . , k} for which the cell is a sector at level i. Our algorithm will return a single cell, rather than a decomposition of real space, so it will help to define a cylindrical algebraic cell outside of the context of a complete decomposition. A cylindrical algebraic cell consists of the set of points satisfying a formula B 1 ∧ · · · ∧ B n , such that each B i is either of the form li (x1 , . . . , xi −1 ) < xi < u i (x1 , . . . , xi −1 ) or e i (x1 , . . . , xi −1 ) = xi , where li , u i , and e i ´ are continuous, real-valued, algebraic functions on B 1 ∧ · · · ∧ B i −1 . Note that Strzebonski (2012) calls the formula B 1 ∧ · · · ∧ B n an atomic cylindrical algebraic formula, and defines a cell as a set of points ´ satisfying such a formula. Therefore, our notion of a cell is the same as in Strzebonski (2012). We proceed by giving a formal description of our problem that is almost correct. We will then explain the problem statement and why it is insufficient.

2 We choose McCallum’s projection rather than the Brown–McCallum’s projection operator because the latter requires an outside mechanism for identifying and describing regions at which projection factors are nullified. Incorporating that in this localized (to α ) setting is problematic. However, for most input points and polynomials, our algorithms actually use the Brown– McCallum’s projection.

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

17

Problem 1 (A mostly correct formulation). Given point α ∈ Rn with algebraic coordinates and Q a finite set of irreducible polynomials in Z[x1 , . . . , xn ], produce either (a) C n , a description of a cylindrical algebraic cell in Rn containing α in which the elements of Q have constant sign, such that the li ’s, u i ’s, and e i ’s that define the boundaries of C n are sections (as the term is used in the CAD literature) of elements of proj∗ ( Q ); or (b) (FAIL, f , C j −1 ), where j ≤ n, and C j −1 is a description of a positive-dimensional cylindrical algebraic cell in R j −1 containing (α1 , . . . , α j −1 ), and f is a j-level polynomial such that 1. f ∈ proj∗ ( Q ) \ Z[x1 , . . . , x j −1 ], 2. f is nullified throughout C j −1 , and 3. the li ’s, u i ’s, and e i ’s that define the boundaries of C j −1 are sections (as the term is used in the CAD literature) of elements of proj∗ ( Q ). In the non-FAIL case (a), the algorithm returns a description C n of a cell containing α . Because all of the boundaries are defined by sections of elements of proj∗ ( Q ), any cell in the CAD produced from Q by McCallum’s algorithm is either contained in the cell described by C n or disjoint from it. This means that the cell produced by the baseline approach combining McCallum’s algorithm and partial CAD in the obvious way is contained in the cell described by C n . In the FAIL case (b), f and C j −1 constitute a witness proving that McCallum’s algorithm would have returned FAIL with Q as input. Point 1 characterizes f as a polynomial that McCallum’s algorithm requires to be order-invariant in cells. Point 2 characterizes f as nullified on a positivedimensional region, so that points 1 and 2 imply that Q is not well-oriented. Point 3, which mirrors the language of the non-FAIL case, ensures that Q is in some sense “locally” not well-oriented — which requires some explanation. We would like to be able to say that we are allowed to return FAIL only if the baseline approach combining McCallum’s algorithm and partial CAD to construct a cell containing α would return FAIL. However, it could happen that the baseline approach would not return FAIL because, although f is nullified, the base cell it constructs is a single-point cell contained in C j −1 . Point 3 ensures that this is the only way we could be in the FAIL case when the baseline approach does not produce FAIL. Since C j −1 has positive dimension, and f is nullified throughout it, there is a point arbitrarily close to α for which the baseline approach would return FAIL. The formulation of Problem 1 has a flaw: It doesn’t account for the possibility of having boundaries that are sections of delineating polynomials. These are polynomials introduced in McCallum’s algorithm during the lifting phase, and thus they may not be elements of proj∗ ( Q ). The problem statement needs to be relaxed to allow for boundaries defined by delineating polynomials provided that they are delineating polynomials that would have been introduced by the baseline algorithm. This makes the already complex formulation of the problem still more complex! However, the basic idea and intuition remain unchanged. Problem 2 (A correct formulation). Given point α ∈ Rn with algebraic coordinates, and Q a finite set of irreducible polynomials in Z[x1 , . . . , xn ], produce either (a) C n , a description of a cylindrical algebraic cell in Rn containing α in which the elements of Q have constant sign, such that each of the li ’s, u i ’s, and e i ’s that define the boundaries of C n is a section (as the term is used in the CAD literature) either of an element of proj∗ ( Q ) or of a delineating polynomial for an element of proj∗ ( Q ) \ Z[x1 , . . . , xi −1 ] that is nullified at (α1 , . . . , αi −1 ); or (b) (FAIL, f , C j −1 ), where j ≤ n, and C j −1 is a description of a positive-dimensional cylindrical algebraic cell in R j −1 containing (α1 , . . . , α j −1 ), and f is a j-level polynomial such that 1. f ∈ proj∗ ( Q ) \ Z[x1 , . . . , x j −1 ], 2. f is nullified throughout C j −1 , and 3. each of the li ’s, u i ’s, and e i ’s that define the boundaries of C j −1 is a section (as the term is used in the CAD literature) either of an element of proj∗ ( Q ) or of a delineating polynomial for an element of proj∗ ( Q ) \ Z[x1 , . . . , xi −1 ] that is nullified at (α1 , . . . , αi −1 ).

18

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

Fig. 1. Examples of merging when polynomial p is not zero at point the same.

α . An important point to note is that the dimension stays

3. The basic idea Recall that a cylindrical algebraic cell consists of the set of points satisfying a formula B 1 ∧ · · · ∧ B n , where each B i is either of the form li (x1 , . . . , xi −1 ) < xi < u i (x1 , . . . , xi −1 ), in which case we say the cell is a sector at level i, or xi = e i (x1 , . . . , xi −1 ), in which case we say the cell is a section at level i, where the li ’s, u i ’s, and e i ’s are continuous, real-valued, algebraic functions on B 1 ∧ · · · ∧ B i −1 . Section 4 gives a precise description of the data structure used to represent a cell, referred to as a OneCell data structure, which is basically a description of a cell along with a set of polynomials that are known to have constant sign (or constant order, which is complication we describe later) in the cell. Our algorithm, described in Section 9, constructs a OneCell data structure for a set P of polynomials by repeatedly applying a merge operation, described in Section 6. The merge operation takes a OneCell data structure C and a polynomial p and “merges” p with C , which means refining cell C so that the sign (or order) of p is constant within C . So the real work in constructing a OneCell data structure is the merge operation. The basic merge operation is not all that hard to understand — though the proof of its correctness (Section 8) is somewhat involved. The key idea is that there are three cases for merging polynomial p into cell described by C , and each case is broken out as a separate subalgorithm. The first case is when p (α ) = 0, and some diagrammatic examples of merge in this case are given in Fig. 1. Generally, in this case the dimension of the cell is the same after the merge as before. In the second case, α is a root of p, but p is not nullified, i.e., p (α ) = 0, but p (α1 , . . . , αn−1 , xn ) = 0. In this case, the merge operation generally results in reducing the dimension of the cell. Fig. 2 gives some diagrammatic examples of merge in this case. In the third and final case, p is nullified, i.e., p (α1 , . . . , αn−1 , xn ) = 0. This case is the one that causes the most trouble, as will be explained in more detail later. In fact, this is the case that may result in FAIL being returned. Fig. 3 gives some diagrammatic examples of merge in this case. 4. The OneCell data structure In this section the OneCell data structure is formally defined. We begin by defining basic concepts and notation.

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

19

Fig. 2. Examples of merging when point α is a root of polynomial p. An important point to note is that the dimension decreases as a result of this merge. In the left example, we start with a 2D sector cell, and end up with a 1D section cell. In the right example, we start with a 2D sector cell over a sector in 2-space, and end up with a 1D section cell over a section in 2-space.

Fig. 3. Examples of merging when polynomial p is nullified over (α1 , . . . , αn−1 ). Note that these examples are representational rather than literal, because nullification only happens in dimension three or higher. An important point to take away is that, once again, the dimension is reduced by the merge process. The distinction between this case and the prior case is that in the prior case, p (α ) = 0, but p (α1 , . . . , αn−1 , xn ) is not the zero polynomial. In this case, p (α1 , . . . , αn−1 , xn ) is the zero polynomial.

Definition 1. The level of a non-constant polynomial p ∈ R[x1 , . . . , xk ] is the largest j such that degx j ( p ) > 0. Definition 2. A tagged polynomial of level k is a pair (t , p ), where t ∈ {oi, si}, and p ∈ R[x1 , . . . , xk ] is a polynomial of level k. Tagged polynomial (t , p ) of level k is tag-invariant on a connected region C ⊆ Rk if t = oi and p is order-invariant in C , or if t = si and p is sign-invariant in C . When talking

20

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

about tagged polynomial ( p , t ) we will sometimes mean only p without the tag t. This will be always clear from context. When factoring a tagged polynomial, the tags are inherited, and tagged factors are obtained. Therefore, factorization of (oi, pq) yields {(oi, p ), (oi, q)}, and factorization of (si, pq) yields {(si, p ), (si, q)}. This naturally generalizes to sets of tagged polynomials. Definition 3. For p ∈ R[x1 , . . . , xk ] and non-negative integer i, we define the indexed root expression root( p , i , xk ) at the point γ = (γ1 , . . . , γn ), n ≥ k − 1, as the i-th distinct real root of p (γ1 , . . . , γk−1 , xk ) (ordered smallest to largest). If the level of p is not k, if polynomial p (γ1 , . . . , γk−1 , xk ) is the zero polynomial or if it has fewer than i distinct real roots, the expression has value undef. We also allow the special indexed root expressions root(+∞, 1, xk ) and root(−∞, 1, xk ) to represent positive and negative infinity, respectively. We will not do any arithmetic with these expressions, so those semantics will not be addressed. We formally extend the usual relational operators {<, >, ≤, ≥, =, =} to be false if either the left or right hand side is undef. We allow the expressions root(+∞, 1, xk ) and root(−∞, 1, xk ) on the left and right hand side of the relational operators with the obvious semantics. Definition 4. A RealAlgNum is a triple ( p , I , j ), where p is a square-free univariate polynomial whose coefficients are rational numbers or RealAlgNum’s. I is an isolating interval for the j-th distinct real root of p ordered from smallest to largest. If A is a RealAlgNum we adopt the notation A . p, A . I , and A . j to refer to the three components of the triple. We refer to the real algebraic number that is the A . j-th distinct real root of A . p as val( A ). To simplify the presentation below, we will use A to denote both the triple ( p , I , j ) and the real algebraic number val( A ), which the triple represents. This will be always clear from context. Furthermore, we allow A . p to be +∞ or −∞, in which case val( A ) is +∞ or −∞, respectively. Note that the following definition of a delineating polynomial is slightly different from the one used by McCallum (1998). Definition 5. Let k ≥ 2, let p ∈ R[x1 , . . . , xk ] and let (α1 , . . . , αk−1 ) ∈ Rk−1 . Let m be the smallest index for which at least one m-partial derivative of p is not identically zero at (α1 , . . . , αk−1 ). An element d ∈ R[x1 , . . . , xk ] is called a delineating polynomial for p on (α1 , . . . , αk−1 ) if the following conditions hold: 1. d(α1 , . . . , αk−1 , xk ) = 0. 2. For every i, where 0 ≤ i < m, and for every i-partial derivative q of p it holds that q(α1 , . . . , αk−1 , xk ) = 0. 3. If (α1 , . . . , αk ) ∈ Rk is a common root of all m-partial derivatives of p, then d(α1 , . . . , αk ) = 0. Now we are ready to state the central definition of the paper. Note that the operators S and bpoly, which are used in the following definition are defined below in Definitions 7 and 8. Definition 6. A OneCell data structure containing point α = (α1 , . . . , αk ) ∈ Rk is a triple ( P prj , P dln , D ), where P = P prj ∪ P dln is a set of tagged integer polynomials, and D = ( D 1 , . . . , D k ). D k is either (section, e , E ) or (sector, l, L , u , U ). If D k is a section, then D k .e ∈ Z[x1 , . . . , xk ] is a polynomial of level k, and D k . E is a RealAlgNum. If D k is a sector, then:

• Either D k .l ∈ Z[x1 , . . . , xk ] is a polynomial of level k and D k . L is a RealAlgNum, or D k .l = −∞. • Either D k .u ∈ Z[x1 , . . . , xk ] is a polynomial of level k and D k .U is a RealAlgNum, or D k .u = +∞. Furthermore, the following conditions hold:

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

21

1. If k > 1, ( P prj , P dln , ( D 1 , . . . , D k−1 )) is a OneCell data structure containing the point (α1 , . . . , αk−1 ). 2. If D k is a section, then D k . E . p is a non-constant univariate polynomial in variable xk , which divides D k .e (α1 , . . . , αk−1 , xk ). 3. If D k is a sector, then either D k .l = −∞ and D k . L = (−∞, [0, 0], 1), or the following conditions hold: (i) D k . L . p is a non-constant univariate polynomial in variable xk , which divides D k .l(α1 , . . . , αk−1 , xk ). (ii) D k . L . p has no real root in the open interval (val( D k . L ), val( D k .U )). 4. If D k is a sector, then either D k .u = +∞ and D k .U = (+∞, [0, 0], 1), or the following conditions hold: (i) D k .U . p is a non-constant univariate polynomial in variable xk , which divides D k .u (α1 , . . . , αk−1 , xk ). (ii) D k .U . p has no real root in the open interval (val( D k . L ), val( D k .U )). 5. If D k is a section, the following formula is true at point α :

αk = root( D k .e, D k . E . j , xk ). 6. If D k is a sector, the following formula is true at point

α:

root( D k .l, D k . L . j , xk ) < αk < root( D k .u , D k .U . j , xk ). 7. S ( D 1 , . . . , D k ) is a cylindrical algebraic subset of Rk . 8. Polynomials bpoly( D k ) ⊆ P are delineable on S ( D 1 , . . . , D k−1 ). 9. Let S be the maximal connected region of Rk containing α , such that the polynomials from P of level at most k are tag-invariant in S. Then it holds that S = S ( D 1 , . . . , D k ). 10. For each k-th level polynomial f ∈ P dln there exists k-th level polynomial g ∈ P prj , such that f is a delineating polynomial for g on (α1 , . . . , αk−1 ). If there exists a delineating polynomial of level k in P dln , S ( D 1 , . . . , D k−1 ) consists of the single point (α1 , . . . , αk−1 ). Definition 7. Let D = ( D 1 , . . . , D k ) be as in Definition 6. Let α = (α1 , . . . , αn ) ∈ Rn , where n ≥ k. We define F ( D ) to be a formula which is true when k = 0. If k > 0, and D k is a section then we define F ( D ) to be:

F ( D 1 , . . . , D k−1 ) ∧ xk = root( D k .e , D k . E . j , xk ). If k > 0, and D k is a sector then we define F ( D ) to be:

F ( D 1 , . . . , D k−1 ) ∧ root( D k .l, D k . L . j , xk ) < xk < root( D k .u , D k .U . j , xk ). We define S ( D ) as R0 if k = 0, and otherwise

S(D) =







γ ∈ Rk  F ( D ) is true at γ .

We define S α ( D ) as







S α ( D ) = (α1 , . . . , αk−1 , γk ) ∈ Rk  F ( D ) is true at (α1 , . . . , αk−1 , γk ) . Definition 8. Let ( P prj , P dln , D ), where D = ( D 1 , . . . , D k ) be a OneCell data structure. For 1 ≤ i ≤ k we define bpoly( D i ) to be the set of bounding polynomials occurring in D i . If D i is a section then bpoly( D i ) = { D i .e }. IfD i is a sector then bpoly( D i ) = { D i .l, D i .u } \ {−∞, +∞}. For m ≤ k we define bpoly( D 1 , . . . , D m ) = 1≤i ≤m bpoly( D i ). To state the results of this paper, the definition of the McCallum’s projection operator is needed. Therefore, we define it here for completeness. Further details can be found in McCallum (1998).

22

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

Definition 9. For set P of polynomials of level k the McCallum’s projection operator is defined as follows:

proj( P ) =



coeffxk ( p ) ∪

p∈ P



p∈ P



discxk ( p ) ∪

resxk ( p , q).

p ,q∈ P ∧ p =q

We define the closure of P under proj as the following set of polynomials:

proj∗ ( P ) = P ∪

k −1

proji ( P ).

i =1

5. The straightforward approach using partial CAD In this section we describe the algorithm McCell (Algorithm 1). This algorithm combines the McCallum’s algorithm and partial CAD. Given a set of polynomials P and a sample point α , McCell constructs a single CAD cell containing α . The main reason why we describe this algorithm here is that we will use it as a baseline. In Section 9 we will prove that a cell computed by our algorithm contains the cell which would have been computed by McCell. Given a set of polynomials P and a sample point α ∈ Rn , a cell containing α can be easily extracted from a CAD of Rn induced by the set of polynomials P . To compute such a CAD, the algorithm described by McCallum (1998) can be used. However, this naive approach does too much unnecessary work: To construct a single cell, it computes the complete decomposition. During this process, the sample point α plays no role at all — it is just used to extract the cell it lies in after the complete CAD was constructed. McCell improves on this naive approach: To construct only the cell containing α , it uses this point during the lifting phase. This idea is similar to the partial CAD algorithm due to Collins and Hong (1998). The projection phase, though, is the same as in the complete CAD algorithm of McCallum (1998). The rest of this section describes each step of McCell in detail. Lines 1–2 of McCell compute the projection factor set for P using the McCallum’s projection operator. The base phase is done at line 3: All real roots of the univariate polynomials in x1 are isolated, and a cell, which is a subset of R1 containing α1 is constructed. The loop at lines 5–19 does the lifting. For each level j, where 2 ≤ j ≤ k, cell C j containing (α1 , . . . , α j ) is constructed over cell C j −1 containing (α1 , . . . , α j −1 ). More specifically, one iteration of the loop consists of the following operations: First it is checked whether some projection factor of level j is not nullified over C j −1 (line 6). If this is the case, and C j −1 is of positive dimension, FAIL is returned. After this test, all projection factors of level j are used to do the lifting. If nullification of a j-th level projection factor p occurs over a zero-dimensional cell, a delineating polynomial for p is added to Q j , so the lifting is done with respect to it as well. Finally, root isolation of polynomials in Q j is done, and C j containing (α1 , . . . , α j ) is constructed. The correctness of McCell directly follows from the results of McCallum (1998). Note that the cell computed by McCell is the same cell that would have been computed by constructing the complete CAD and picking the cell which contains α . If FAIL is returned by McCell, the algorithm for complete CAD construction would have returned FAIL on input Q as well. This occurs when some projection factor is nullified over a positive-dimensional cell containing α . Note that the reverse situation is also possible: The complete CAD algorithm fails on input Q , but McCell successfully returns a cell containing α . This occurs when some projection factor is nullified over a cell, which does not contain α . Now we come to an important point: Algorithm 1 uses point α to save some work in the lifting phase — the projection phase is the same as in the complete CAD algorithm. The natural question is, if it is possible to save some work in the projection phase as well. Our incremental algorithm described in Section 6 can be viewed as an affirmative answer to this question. 6. The merging algorithm The main result of this paper is Merge (Algorithm 2) described in this section. Given a OneCell data structure containing point α and a tagged polynomial p of level k, Merge shrinks the cell

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

23

Algorithm 1: One cell algorithm using partial CAD (McCell). α, Q α = (α1 , . . . , αn ) ∈ Rn , and αi is a RealAlgNum for 1 ≤ i ≤ n.

Input:

1 2 3 4 5 6 7 8 9 10 11 12

Q = {q1 , . . . , qm } ⊆ Z[x1 , . . . , xn ]. Output: C C ⊆ Rn is a cell containing α , i.e., a maximal connected cylindrical algebraic subset of Rn , such that (α1 , . . . , αk ) ∈ C , and all polynomials from proj∗ ( Q ) are order-invariant in C . OR (FAIL, f , C j −1 ) f ∈ proj∗ ( Q ) is a projection factor of level j, which is nullified over positive-dimensional region C j −1 containing (α1 , . . . , α j −1 ). Compute proj∗ ( Q ). Let proj∗ ( Q ) = Q 1 · · · Q n , such that each Q i contains only polynomials of level exactly i, where 1 ≤ i ≤ n. Isolate all real roots of polynomials in Q 1 to get cell C 1 either as a point equal to α1 or as an open interval containing α1 . j := 2 while j ≤ n do if there is f ∈ Q j such that f (α1 , . . . , α j −1 , x j ) = 0 and dim(C j −1 ) > 0 then return (FAIL, f , C j −1 ) Q j := ∅ foreach f ∈ Q j do if f (α1 , . . . , α j −1 , x j ) = 0 then Compute m, the smallest index for which at least one m-partial derivative of f is not identically zero at (α1 , . . . , α j −1 ). Let I p be the set of all m-partial derivatives of f , which are not identically zero at (α1 , . . . , α j −1 ).

13

I p := {q(α1 , . . . , α j −1 , x j ) | q ∈ I p }

14

Let g be the square-free part of the gcd of polynomials in I p . Q j := Q j ∪ { g }

15 16 17 18 19

else Q j := Q j ∪ { p (α1 , . . . , α j −1 , x j )} Using polynomials Q j , do the lifting over C j −1 . Set C j to the section or sector over C j −1 containing (α1 , . . . , α j ). j := j + 1

20 return C n

described by this data structure to ensure the tag-invariance of p in the shrunken cell. A OneCell data structure representing this shrunken cell is returned as a result. Recall that the merging algorithm distinguishes three different cases: (a) p is nullified over (α1 , . . . , αk−1 ). This situation is handled by MergeNull (Algorithm 4). (b) p is not nullified over (α1 , . . . , αk−1 ), but α is a root of p. In this case MergeRoot (Algorithm 5) is used. (c) p is non-zero at point α . This case is handled by MergeNotRoot (Algorithm 6). The task of Merge is to detect, which of the three different cases occur for the given input, and to call the appropriate algorithm. Merge first checks whether p is trivially tag-invariant in the input cell (lines 1–4). The case when p contains only variable x1 is dealt with at lines 5–7. Then it is checked whether p is nullified at (α1 , . . . , αk−1 ). If yes, MergeNull is called (lines 8–9). If p is not nullified, and the dimension of the underlying cell is zero, adjustment of bounds of level k is sufficient. Therefore, Update (Algorithm 3) is called at line 11. If none of the above is the case, lines 13–16 check whether α is a root of p, and the appropriate algorithm is called. The role of the Update algorithm can be informally described as follows: Assume that p and the bounding polynomials of level k are delineable over the underlying cell containing (α1 , . . . , αk−1 ). Then the roots of p (α1 , . . . , αk−1 , xk ) identify all p-sections over the underlying cell. Update uses this fact and adjusts the bounds on level k in such a way that the new cell contains (α1 , . . . , αk ), and p is tag-invariant in it. Finally, note that Update can be called by MergeRoot and MergeNotRoot as well.

24

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

Algorithm 2: Polynomial merge – main procedure (Merge). α , (t , p ), ( P prj , P dln , ( D 1 , . . . , D n )) α = (α1 , . . . , αn ) ∈ Rn , and αi is a RealAlgNum for 1 ≤ i ≤ n.

Input:

(t , p ) is a tagged irreducible integer polynomial of level k, for some k ≤ n. ( P prj , P dln , ( D 1 , . . . , D n )) is a OneCell data structure containing α .

, P , ( D , . . . , D )) Output: ( P prj n 1 dln ∗

, P , ( D , . . . , D )) is a OneCell data structure containing α , such that p ∈ P , P

( P prj prj ⊆ P prj ⊆ proj ( P prj ∪ { p }), and n 1 prj dln

P dln ⊆ P dln . OR (FAIL, f , ( D 1 , . . . , D j −1 ))

In this case the following hold: 1. f is an irreducible integer polynomial of level j, for some j ≤ k. 2. f ∈ proj∗ ( P prj ∪ { p }). 3. (α1 , . . . , α j −1 ) ∈ S ( D 1 , . . . , D j −1 ), and f is nullified over every point of positive-dimensional region S ( D 1 , . . . , D j −1 ).

1 if (oi, p ) ∈ ( P prj ∪ P dln ) or (t , p ) ∈ ( P prj ∪ P dln ) then 2 return ( P prj , P dln , ( D 1 , . . . , D n )) 3 if dim( S ( D 1 , . . . , D k )) = 0 then 4 return ( P prj ∪ {(oi, p )}, P dln , ( D 1 , . . . , D n )) 5 if k = 1 then 6 D 1 := Update(α , p , ( P prj , P dln , ( D 1 , . . . , D n ))) 7 return ( P prj ∪ {(oi, p )}, P dln , ( D 1 , D 2 , . . . , D n )) 8 if p (α1 , . . . , αk−1 , xk ) = 0 then 9 return MergeNull(α , (t , p ), ( P prj , P dln , ( D 1 , . . . , D n ))) 10 if dim( S ( D 1 , . . . , D k−1 )) = 0 then 11 D k := Update(α , p , ( P prj , P dln , ( D 1 , . . . , D n ))) 12 return ( P prj ∪ {(oi, p )}, P dln , ( D 1 , . . . , D k−1 , D k , D k+1 , . . . , D n )) 13 if p (α1 , . . . , αk ) = 0 then 14 return MergeRoot(α , (t , p ), ( P prj , P dln , ( D 1 , . . . , D n ))) 15 if p (α1 , . . . , αk ) = 0 then 16 return MergeNotRoot(α , (t , p ), ( P prj , P dln , ( D 1 , . . . , D n )))

Note that Merge is recursive in nature: Although there is no direct recursive call to itself in Merge, this can happen indirectly through MergeNull, MergeRoot, or MergeNotRoot. Finally, let us shortly comment on the role of algorithms RefNonNull and RefNull. The former is used when p is not nullified over (α1 , . . . , αk−1 ), the latter is used when p is nullified over this point. Both of them refine the underlying cell to ensure that p is (not) nullified over the whole refined underlying cell. The reason why this has to be done is that no coefficients of p except of the leading coefficient are merged into the underlying data structure by MergeNull, MergeRoot, and MergeNotRoot. Therefore, it is possible that p is (not) nullified over (α1 , . . . , αk−1 ), but this does not hold over the whole cell containing this point. This is the same issue, which has to be dealt with when using Brown’s improvement of the McCallum’s projection operator in a general CAD algorithm. 7. Two useful lemmata The following lemmata will be used to prove the correctness of MergeRoot (Algorithm 5) and MergeNotRoot (Algorithm 6). Note that polynomial e in Lemma 1 plays a role of an equational constraint, which is a concept introduced by McCallum (1999). Lemma 1. Let k ≥ 2. Let e be an irreducible polynomial of level k, which is delineable on some connected region S k−1 ⊆ Rk−1 . Let S k be an e-section over S k−1 , and let (t , p ) be a tagged irreducible polynomial of level k coprime with e. If t = si, and resxk ( p , e ) is order-invariant in S k−1 , then p is sign-invariant in S k . If t = oi, p is nullified over no point of S k−1 , and polynomials (oi, resxk ( p , e )), (si, ldcfxk ( p )), and (oi, discxk ( p )) are tag-invariant in S k−1 , then p is order-invariant in S k .

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

25

Algorithm 3: Update bounds (Update). α , p, ( P prj , P dln , ( D 1 , . . . , D n )) α = (α1 , . . . , αn ) ∈ Rn , and αi is a RealAlgNum for 1 ≤ i ≤ n.

Input:

p is an integer polynomial of level k, where 1 ≤ k ≤ n, such that p (α1 , . . . , αk−1 , xk ) = 0. ( P prj , P dln , ( D 1 , . . . , D n )) is a OneCell data structure containing α .

Output: D k D k is a section or a sector, such that S α ( D 1 , . . . , D k−1 , D k ) ⊆ S α ( D 1 , . . . , D k−1 , D k ), and S α ( D 1 , . . . , D k−1 , D k ) is the maximal connected subregion of (α1 , . . . , αk−1 ) × R containing (α1 , . . . , αk ) where the polynomials of level at most k from P prj ∪ P dln ∪ {(oi, p )} are tag-invariant. Moreover, conditions 2–6 of Definition 6 hold for D k . Note: Update refines the k-th level bounding polynomials “locally,” i.e., only over point (α1 , . . . , αk−1 ). The calling algorithm has to ensure that bpoly( D k ) will actually be bounding polynomials over the whole base cell containing (α1 , . . . , αk−1 ). This generalization from a point to the base cell is achieved by ensuring the delineability of bpoly( D k ) ∪ { p } over the base cell. 1 if D k is a section then 2 return D k 3 Set p to the square-free part of the univariate polynomial p (α1 , . . . , αk−1 , xk ). 4 Isolate all real roots of p, obtaining the sorted list of RealAlgNum’s B 1 , . . . , B s . 5 if αk = val( B i ) for some 1 ≤ i ≤ s then 6 return (section, p , B i ) 7 Merge αk , D k . L, and D k .U into the list B 1 , . . . , B s . 8 Set D k to a copy of D k . 9 if B i , αk occur in the merged list for some 1 ≤ i ≤ s then 10 D k .l := p 11 D k . L := B i 12 if 13 14

αk , B i occur in the merged list for some 1 ≤ i ≤ s then D k .u := p D k .U := B i

15 return D k

Proof. First note that when e and p are coprime, then resxk ( p , e ) = 0. Similarly, if p is square-free, then discxk ( p ) = 0. If t = si, the statement of the lemma is just a special case of Theorem 2.2 in McCallum (1999). Assume that t = oi. Sign-invariance of ldcfxk ( p ) in S k−1 and the fact p is nullified over no point of S k−1 imply that p is degree-invariant on S k−1 (Brown, 2001, Theorem 3.1). Degree invariance of p, tag-invariance of (oi, discxk ( p )), and nullification of p over no point of S k−1 imply that p is delineable on S k−1 and order-invariant in every p-section over S k−1 (McCallum, 1998, Theorem 2). Delineability of p and tag-invariance of (oi, resxk ( p , e )) on S k−1 imply that e is sign-invariant in every p-section over S k−1 (McCallum, 1999, Theorem 2.2). This implies that any two sections of p and e over S k−1 are either disjoint or equal. If S k is equal to some p-section over S k−1 , then p is tag-invariant in S k , as we have just shown. If S k is disjoint from all p-sections over S k−1 , then p has non-zero sign in the whole S k . This ensures the tag-invariance of p in S k . In either case, p is tag-invariant in e-section S k . 2 Lemma 2. Let l and u be irreducible polynomials of level k, which are delineable on connected region S k−1 ⊆ Rk−1 . Let p be an irreducible polynomial of level k such that l and p are coprime, u and p are coprime, and p is nullified over no point of S k−1 . If {(si, ldcfxk ( p )), (oi, discxk ( p )), (oi, resxk ( p , l)), (oi, resxk ( p , u ))} are tag-invariant in S k−1 , then {l, u , p } are delineable on S k−1 , and p is order-invariant in every p-section over S k−1 . Proof. Similar arguments as in Lemma 1 can be used. Using assumptions that (si, ldcfxk ( p )) and (oi, discxk ( p )) are tag-invariant in S k−1 , and that p is nullified over no point of S k−1 we can conclude that p is delineable on S k−1 . Tag-invariance of (oi, resxk ( p , l)) implies sign-invariance of l in every p-section over S k−1 . Delineability of l and u on S k−1 implies that any two sections of p and l are either disjoint or equal. The same arguments show that any two sections of p and u are either disjoint or equal. This shows that l, u, and p are delineable on S k−1 , and that p is order-invariant in every p-section over S k−1 . 2

26

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

Algorithm 4: Polynomial merge – nullification case (MergeNull). α , (t , p ), ( P prj , P dln , ( D 1 , . . . , D n )), α = (α1 , . . . , αn ) ∈ Rn , and αi is a RealAlgNum for 1 ≤ i ≤ n.

Input:

(t , p ) is a tagged irreducible integer polynomial of level k, such that 2 ≤ k ≤ n and p (α1 , . . . , αk−1 , xk ) = 0. ( P prj , P dln , ( D 1 , . . . , D n )) is a OneCell data structure containing α .

, P , ( D , . . . , D )) Output: ( P prj n 1 dln ∗

, P , ( D , . . . , D )) is a OneCell data structure containing α , such that p ∈ P , P

( P prj prj ⊆ P prj ⊆ proj ( P prj ∪ { p }), and n 1 prj dln

P dln ⊆ P dln . OR (FAIL, f , ( D 1 , . . . , D j −1 ))

In this case the following hold: 1. f is an irreducible integer polynomial of level j, for some j ≤ k. 2. f ∈ proj∗ ( P prj ∪ { p }). 3. (α1 , . . . , α j −1 ) ∈ S ( D 1 , . . . , D j −1 ), and f is nullified over every point of positive-dimensional region S ( D 1 , . . . , D j −1 ).

1 R := RefNull(α , p , ( P prj , P dln , ( D 1 , . . . , D n ))) 2 if R is a FAIL message then 3 return R

, P , ( D , . . . , D )) := R 4 ( P prj n 1 dln 5 if t = si then

, ( D , . . . , D )) 6 return ( P prj ∪ {(si, p )}, P dln n 1

7 if t = oi then 8 if dim( S ( D 1 , . . . , D k −1 )) > 0 then 9 return (FAIL, p , ( D 1 , . . . , D k −1 )) 10 11 12 13 14

Compute m, the smallest index for which at least one m-partial derivative of p is not identically zero at

(α1 , . . . , αk−1 ). Let {d1 , . . . , dr } be the set of all m-partial derivatives of p, which are not identically zero at (α1 , . . . , αk−1 ). g := d21 + · · · + dr2

, P , ( D , . . . , D ))) D k := Update(α , g , ( P prj n 1 dln

∪ {(oi, p )}, P ∪ {(oi, g )}, ( D , . . . , D )) return ( P prj n 1 dln

8. Correctness proof of the merging algorithm In this section we prove that Merge (Algorithm 2) is correct, i.e., it meets its specification. The whole proof is done by induction on the level of the input polynomial p. If k = 1, Merge calls only Update. Therefore, the correctness of Merge in this case follows from the correctness of Update, which we are going to prove. Assuming the correctness of Merge for polynomials of level smaller than k, the correctness of MergeNull, MergeRoot, and MergeNotRoot for polynomials of level k is established in Lemmata 7, 8, and 9, respectively. With these intermediate results at hand, the formal proof of Theorem 1 is straightforward. We begin by proving the correctness of Update. Lemma 3. Update (Algorithm 3) meets its specification. Proof. If D k is a section, then S α ( D 1 , . . . , D k ) consists of the single point (α1 , . . . , αk ), and the specification trivially holds for D k returned at line 2. Assume that D k is a sector. Observe that p is of positive degree in xk because p (α1 , . . . , αk−1 , xk ) = 0, and p is of level k. Moreover, p divides p. There are two different cases to consider. First assume that p (α1 , . . . , αk ) = 0. In this case αk = val( B i ) for some 1 ≤ i ≤ s and (section, p , B i ) is returned at line 4. Therefore, {(α1 , . . . , αk−1 )} = S α ( D 1 , . . . , D k−1 , D k ) ⊆ S α ( D 1 , . . . , D k−1 , D k ). The maximality of this single point region is proved by contradiction: Let S be a strictly bigger connected region containing (α1 , . . . , αk ), such that P prj ∪ P dln ∪ {(oi, p )} are tag-invariant in S . S has to be an interval in (α1 , . . . , αk−1 ) × R. Therefore, S contains a point where D k .e is non-zero. This contradicts the sign-invariance of D k .e in S , because D k .e (α1 , . . . , αk ) = 0. Condition 2 of Definition 6

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

27

Algorithm 5: Polynomial merge – root case (MergeRoot). α , (t , p ), ( P prj , P dln , ( D 1 , . . . , D n )) α = (α1 , . . . , αn ) ∈ Rn , and αi is a RealAlgNum for 1 ≤ i ≤ n.

Input:

(t , p ) is a tagged irreducible integer polynomial of level k, such that 2 ≤ k ≤ n, p (α1 , . . . , αk−1 , xk ) = 0, and p (α1 , . . . , αk ) = 0. ( P prj , P dln , ( D 1 , . . . , D n )) is a OneCell data structure containing α , such that bpoly( D k ) ⊆ P prj .

, P , ( D , . . . , D )) Output: ( P prj n 1 dln ∗

, P , ( D , . . . , D )) is a OneCell data structure containing α , such that p ∈ P , P

( P prj prj ⊆ P prj ⊆ proj ( P prj ∪ { p }), and n 1 prj dln

P dln ⊆ P dln . OR (FAIL, f , ( D 1 , . . . , D j −1 ))

In this case the following hold: 1. f is an irreducible integer polynomial of level j, for some j ≤ k. 2. f ∈ proj∗ ( P prj ∪ { p }). 3. (α1 , . . . , α j −1 ) ∈ S ( D 1 , . . . , D j −1 ), and f is nullified over every point of positive-dimensional region S ( D 1 , . . . , D j −1 ).

1 if D k is a section then 2 F := {(oi, resxk ( p , D k .e ))} 3 if t = oi then 4 F := F ∪ {(si, ldcfxk ( p )), (oi, discxk ( p ))} 5 if D k is a sector then 6 F := {(si, ldcfxk ( p )), (oi, discxk ( p ))} 7 if D k .l = −∞ then F := F ∪ {(oi, resxk ( p , D k .l))} 8 if D k .u = +∞ then F := F ∪ {(oi, resxk ( p , D k .u ))}

, P , ( D , . . . , D )) to a copy of ( P , P , ( D , . . . , D )). 9 Set ( P prj 1 n prj dln n 1 dln 10 foreach non-constant irreducible factor (t , f ) of the polynomials in F do

, P , ( D , . . . , D ))) 11 R := Merge(α , (t , f ), ( P prj n 1 dln

12 13

if R is a FAIL message then return R

, P , ( D , . . . , D )) := R ( P prj n 1 dln

14 if t = oi or D k is a sector then

, P , ( D , . . . , D ))) 15 R := RefNonNull(α , p , ( P prj n 1 dln 16 17 18 19

if R is a FAIL message then return R

, P , ( D , . . . , D )) := R ( P prj n 1 dln

, P , ( D , . . . , D ))) D k := Update(α , p , ( P prj n 1 dln

∪ {(oi, p )}, P , ( D , . . . , D )) return ( P prj n 1 dln

∪ {(si, p )}, P , ( D , . . . , D )) 20 return ( P prj n 1 dln

p is of positive degree in xk because p (α1 , . . . , αk−1 ). Condition 2 of Definition 6 holds because of the properties p observed above. Condition 5 holds because αk is a root of p. Now assume that p (α1 , . . . , αk ) = 0. If the lower (upper) bound of D k is changed, then it is defined by the closest smaller (greater) root of p. Therefore, S α ( D 1 , . . . , D k−1 , D k ) ⊆ S α ( D 1 , . . . , D k−1 , D k ) holds. To prove the maximality of the smaller region, assume for contradiction that S is a strictly bigger connected region containing (α1 , . . . , αk ). S is a (possibly unbounded) interval in (α1 , . . . , αk−1 ) × R. This implies that S contains at least one of the endpoints of interval (val( D k . L ), val( D k .U )), i.e., RealAlgNum’s D k . L or D k .U . These are roots of D k .l and D k .u, respectively. This is a contradiction because D k .l and D k .u are non-zero inside the interval (val( D k . L ), val( D k .U )). The order invariance of { p } in S α ( D 1 , . . . , D k−1 , D k ) follows from the sign invariance of p in this interval, because the sign of p is non-zero in it. The validity of conditions 3, 4, and 6 of Definition 6 follow from the facts concerning p observed above. 2 The following lemma formalizes the important technical point made in Section 2: Projection polynomials and delineating polynomials are strictly divided during the incremental computation. This means that Merge will never compute a (partial) projection of a set containing a delineating polynomial.

28

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

Algorithm 6: Polynomial merge – not root case (MergeNotRoot). α , (t , p ), ( P prj , P dln , ( D 1 , . . . , D n )) α = (α1 , . . . , αn ) ∈ Rn , and αi is a RealAlgNum for 1 ≤ i ≤ n.

Input:

(t , p ) is a tagged irreducible integer polynomial of level k, such that 2 ≤ k ≤ n and p (α1 , . . . , αk ) = 0. ( P prj , P dln , ( D 1 , . . . , D n )) is a OneCell data structure containing α , such that bpoly( D k ) ⊆ P prj .

, P , ( D , . . . , D )) Output: ( P prj n 1 dln ∗

, P , ( D , . . . , D )) is a OneCell data structure containing α , such that p ∈ P , P

( P prj prj ⊆ P prj ⊆ proj ( P prj ∪ { p }), and n 1 prj dln

P dln ⊆ P dln . OR (FAIL, f , ( D 1 , . . . , D j −1 ))

In this case the following hold: 1. f is an irreducible integer polynomial of level j, for some j ≤ k. 2. f ∈ proj∗ ( P prj ∪ { p }). 3. (α1 , . . . , α j −1 ) ∈ S ( D 1 , . . . , D j −1 ), and f is nullified over every point of positive-dimensional region S ( D 1 , . . . , D j −1 ).

1 if D k is a section then 2 F := {(oi, resxk ( p , D k .e ))} 3 if D k is a sector then 4 F := {(oi, discxk ( p ))} 5 if some real root of p (α1 , . . . , αk−1 , xk ) lies in the closed interval [val( D k . L ), val( D k .U )] or D k .l = −∞ or D k .u = +∞ then 6 7

F := F ∪ {(si, ldcfxk ( p ))} if D k .l = −∞ then F := F ∪ {(oi, resxk ( p , D k .l))} if D k .u = +∞ then F := F ∪ {(oi, resxk ( p , D k .u ))}

, P , ( D , . . . , D )) to a copy of ( P , P , ( D , . . . , D )). 8 Set ( P prj 1 n prj dln n 1 dln

9 foreach non-constant irreducible factor (t , f ) of the polynomials in F do

, P , ( D , . . . , D ))) 10 R := Merge(α , (t , f ), ( P prj n 1 dln 11 12

if R is a FAIL message then return R

, P , ( D , . . . , D )) := R ( P prj n 1 dln

13 if D k is a sector then

, P , ( D , . . . , D ))) 14 R := RefNonNull(α , p , ( P prj n 1 dln 15 16 17

if R is a FAIL message then return R

, P , ( D , . . . , D )) := R ( P prj n 1 dln

, P , ( D , . . . , D ))) D k := Update(α , p , ( P prj n 1 dln

∪ {(oi, p )}, P , ( D , . . . , D )) 18 return ( P prj n 1 dln

Lemma 4. Let n ≥ k ≥ 2. Assume that Merge (Algorithm 2) meets its specification for polynomials of levels smaller than k. Let ( P prj , P dln , ( D 1 , . . . , D n )) be a OneCell data structure containing α . Let (t , f ) be a non-constant tagged irreducible polynomial of level smaller than k. Let Q be a set of polynomials, such that P prj ∪ { f } ⊆ proj∗ ( Q ). The following hold:

, P , ( D , . . . , D )) implies P ⊆ proj∗ ( Q ). (i) Merge(α , (t , f ), ( P prj , P dln , ( D 1 , . . . , D n ))) = ( P prj n 1 prj dln

(ii) Merge(α , (t , f ), ( P prj , P dln , ( D 1 , . . . , D n ))) = (FAIL, g , ( D 1 , . . . , D j −1 )) implies g ∈ proj∗ ( Q ).

, P , Proof. First assume that the result of Merge(α , (t , f ), ( P prj , P dln , ( D 1 , . . . , D n ))) is ( P prj dln

⊆ proj∗ ( P ( D 1 , . . . , D n )). The Merge specification guarantees that P prj prj ∪ { f }). By assumption, ∗ ∗ ∗ proj ( P prj ∪ { f }) ⊆ proj (proj ( Q )). Definition 9 now implies that proj∗ (proj∗ ( Q )) = proj∗ ( Q ). If Merge(α , (t , f ), ( P prj , P dln , ( D 1 , . . . , D n ))) = (FAIL, g , ( D 1 , . . . , D j −1 )), the Merge specification guarantees that g ∈ proj∗ ( P prj ∪ { f }). The same argument as above shows that g ∈ proj∗ ( Q ). 2

To establish the correctness of MergeNull (Algorithm 4), the correctness of its subalgorithms RefNonNull and RefNull (Algorithms 7 and 8) needs to be proven first. Lemma 5. Let k ≥ 2. Assume that Merge (Algorithm 2) meets its specification for polynomials of levels smaller than k. RefNonNull (Algorithm 7) meets its specification for polynomials of level k.

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

29

Algorithm 7: Cell refinement – not nullification case (RefNonNull). α , p, ( P prj , P dln , ( D 1 , . . . , D n )) α = (α1 , . . . , αn ) ∈ Rn , and αi is a RealAlgNum for 1 ≤ i ≤ n.

Input:

p is an irreducible integer polynomial of level k, where 2 ≤ k ≤ n, and p (α1 , . . . , αk−1 , xk ) = 0. ( P prj , P dln , ( D 1 , . . . , D n )) is a OneCell data structure containing α .

, P , ( D , . . . , D )) Output: ( P prj n 1 dln ∗

, P , ( D , . . . , D )) is a OneCell data structure containing α , such that P

( P prj prj ⊆ P prj ⊆ proj ( P prj ∪ { p }), and n 1 dln

P dln ⊆ P dln . Moreover, p is nullified over no point of S ( D 1 , . . . , D k−1 ). OR (FAIL, f , ( D 1 , . . . , D j −1 ))

In this case the following hold: 1. f is an irreducible integer polynomial of level j, for some j ≤ k. 2. f ∈ proj∗ ( P prj ∪ { p }). 3. (α1 , . . . , α j −1 ) ∈ S ( D 1 , . . . , D j −1 ), and f is nullified over every point of positive-dimensional region S ( D 1 , . . . , D j −1 ). 1 Let p (x1 , . . . , xk ) = cm xm + · · · + c 1 xk + c 0 , where c i is a polynomial of level at most k − 1 for every 1 ≤ i ≤ m. Let k

P = ( P prj ∪ P dln )

2 if there is a non-zero constant in {cm , . . . , c 0 } then return ( P prj , P dln , D ) 3 if ldcfxk ( p ) ∈ P and ldcfxk ( p )(α1 , . . . , αk−1 ) = 0 then return ( P prj , P dln , D ) 4 if discxk ( p ) ∈ P and discxk ( p )(α1 , . . . , αk−1 ) = 0 then return ( P prj , P dln , D )

i =m

5 if F ( D 1 , . . . , D k−1 ) ∧ i =0 c i = 0 is inconsistent then return ( P prj , P dln , D )

, P , D ) to a copy of ( P , P , ( D , . . . , D )). 6 Set ( P prj 1 n prj dln dln 7 q := c i , such that c i (α1 , . . . , αk−1 ) = 0. 8 foreach non-constant irreducible factor (si, f ) of (si, q) do

, P , D )) 9 R := Merge(α , (si, f ), ( P prj dln 10 11

if R is a FAIL message then return R

, P , D ) := R ( P prj dln

, P , D ) 12 return ( P prj dln

Algorithm 8: Cell refinement – nullification case (RefNull). α , p, ( P prj , P dln , ( D 1 , . . . , D n )) α = (α1 , . . . , αn ) ∈ Rn , and αi is a RealAlgNum for 1 ≤ i ≤ n.

Input:

p is an irreducible integer polynomial of level k, where 2 ≤ k ≤ n, and p (α1 , . . . , αk−1 , xk ) = 0. ( P prj , P dln , ( D 1 , . . . , D n )) is a OneCell data structure containing α .

, P , ( D , . . . , D )) Output: ( P prj n 1 dln

⊆ proj∗ ( P ( P prj , P dln , ( D 1 , . . . , D n )) is a OneCell data structure containing α , such that P prj ⊆ P prj prj ∪ { p }), and

P dln ⊆ P dln . Moreover, p is nullified over each point in S ( D 1 , . . . , D k −1 ). OR (FAIL, f , ( D 1 , . . . , D j −1 ))

In this case the following hold: 1. f is an irreducible integer polynomial of level j, for some j ≤ k. 2. f ∈ proj∗ ( P prj ∪ { p }). 3. (α1 , . . . , α j −1 ) ∈ S ( D 1 , . . . , D j −1 ), and f is nullified over every point of positive-dimensional region S ( D 1 , . . . , D j −1 ). 1 Let p (x1 , . . . , xk ) = cm xm + · · · + c 1 xk + c 0 , where c i is a polynomial of level at most k − 1 for 1 ≤ i ≤ m. k

, P , ( D , . . . , D )) to a copy of ( P , P , ( D , . . . , D )). 2 Set ( P prj 1 n prj dln n 1 dln 3 F := {(oi, discxk ( p )), (oi, cm ), (oi, c 0 )} 4 foreach non-constant irreducible factor (t , f ) of the polynomials in F do

, P , ( D , . . . , D ))) 5 R := Merge(α , (t , f ), ( P prj n 1 dln 6 7

if R is a FAIL message then return R

, P , ( D , . . . , D )) := R ( P prj n 1 dln

, P , ( D , . . . , D )) 8 return ( P prj n 1 dln

Proof. Let P = P prj ∪ P dln . If there is a non-zero constant coefficient of p, then p is not nullified over any point in Rk−1 . If the leading coefficient of p is in P , and it is non-zero at (α1 , . . . , αk−1 ), then it is non-zero in the whole cell S ( D 1 , . . . , D k−1 ). This means that p is not nullified over the whole cell S ( D 1 , . . . , D k−1 ). Similarly, when discxk ( p ) ∈ P and discxk ( p ) is non-zero in  S ( D 1 , . . . , D k−1 ), p m is not nullified over the whole S ( D 1 , . . . , D k−1 ). If the system F ( D 1 , . . . , D k−1 ) ∧ i =0 c i = 0 has no

30

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

solution, it follows that p is not nullified over the whole S ( D 1 , . . . , D k−1 ). This proves that when at least one condition at lines 2–5 is true, the result of RefNonNull is correct.

, P , ( D , . . . , D )) containing α is returned at line 9. Assume that OneCell data structure ( P prj n 1 dln Polynomial f is a factor of a coefficient of p, and f is of level smaller than k. The assumed correctness of Merge for polynomials of level smaller than k together with Lemma 4 imply that

⊆ proj∗ ( P

P prj ⊆ P prj prj ∪ { p }), and P dln ⊆ P dln . Using this argument iteratively for all irreducible fac-

⊆ proj∗ ( P

tors f of p shows that when line 12 is reached, P prj ⊆ P prj prj ∪ { p }), and P dln ⊆ P dln indeed

hold. Moreover, p is not nullified over the whole cell S ( D 1 , . . . , D k −1 ) because c i is sign-invariant in this cell and c i (α1 , . . . , αk−1 ) is non-zero. Therefore, the correctness of RefNonNull follows in this case. If a FAIL message is returned at line 9, the specification of Merge guarantees that this FAIL message meets the specification of RefNonNull as well. 2

Lemma 6. Let k ≥ 2. Assume that Merge (Algorithm 2) meets its specification for polynomials of levels smaller than k. RefNull (Algorithm 8) meets its specification for polynomials of level k. Proof. First assume that during the execution of the loop, no call to Merge at line 5 returns FAIL.

, P , ( D , . . . , D )) be the OneCell data structure returned at line 8. The first condition of Let ( P prj n 1 dln

, P , ( D , . . . , D )) is a OneCell data structure containing the specification, namely that ( P prj n 1 dln

α , such

⊆ proj∗ ( P

that P prj ⊆ P prj prj ∪ { p }), and P dln ⊆ P dln holds because of the correctness of Merge for polynomials of levels smaller than k, and because only discriminant, leading, and trailing coefficient of p were merged into the input OneCell data structure. Furthermore, the specification of Merge ensures that discxk ( p ), cm , and co are order-invariant in S ( D 1 , . . . , D k −1 ). Theorem 2.10 in Hong and

McCallum (in preparation)3 and the fact that p (α1 , . . . , αk−1 , xk ) = 0 imply that p is nullified over each point in S ( D 1 , . . . , D k −1 ). If a call to Merge at line 5 returns FAIL, the specification of Merge guarantees that the returned FAIL message meets the specification. 2

Lemma 7. Let k ≥ 2. Assume that Merge (Algorithm 2) meets its specification for polynomials of levels smaller than k. MergeNull (Algorithm 4) meets its specification for polynomials of level k. Proof. Lemma 6 guarantees the correctness of RefNull for polynomials of level k. If the call to RefNull at line 1 returns a FAIL message, it meets the specification of RefNull. Therefore, a FAIL message, which meets the specification of MergeNull is returned at line 3. In the following we assume that the call at line 1 does not fail, and distinguish two cases. First assume t = si. By the specification of RefNull, p is nullified over the whole cell S ( D 1 , . . . , D k −1 ) at line 4. This means that p is sign-invariant in S ( D 1 , . . . , D k −1 ) × R. Therefore, the data structure returned at line 6 has properties as specified. Now assume t = oi. After the cell refinement at lines 1–4, the dimension of S ( D 1 , . . . , D k −1 ) is tested at line 8. If it is positive, a FAIL message is returned. In this case the conditions 1–3 of the specification hold for j = k, because p is an irreducible integer polynomial nullified over S ( D 1 , . . . , D k −1 ), and p ∈ proj∗ ( P prj ∪ { p }). Assume dim( S ( D 1 , . . . , D k −1 )) = 0 at line 8, i.e., S ( D 1 , . . . , D k −1 ) consists of the single point (α1 , . . . , αk−1 ). The fact that p is nullified over (α1 , . . . , αk−1 ) implies that the order of p in the region (α1 , . . . , αk−1 ) × R is at least one. Moreover, the line (α1 , . . . , αk−1 ) × R can be decomposed into intervals and points where p has constant order of vanishing. Let m be the smallest index for which at least one of the m-order partial derivatives of p is not identically zero at (α1 , . . . , αk−1 ). Let 3 Theorem 2.10 appears in an as of yet unpublished paper on Lazard’s projection by Hong and McCallum. It states that in a connected submanifold S, the order-invariance of the discriminant, leading coefficient, and trailing coefficient of a polynomial p implies that p is either nullified at all points in S, or at no point in S. We have read the manuscript, which is expected to be submitted for publication soon, and are confident of the correctness of the result.

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

31

{d1 , . . . , dr } be all such derivatives. Order of p on the line (α1 , . . . , αk−1 ) × R is greater than m exactly at those points (α1 , . . . , αk−1 , γk ), γk ∈ R, where all polynomials in {d1 , . . . , dr } are simultaneously zero. This happens if and only if g (computed at line 12) is zero. Therefore, the roots of g divide the line (α1 , . . . , αk−1 ) × R to sectors where the order of p is exactly m, and sections where the order of p is strictly greater than m. The first are open intervals where g = 0, and the latter are points where g = 0. According to Definition 5, g is a delineating polynomial for p on (α1 , . . . , αk−1 ). To ensure the order-invariance of p (and g), the bounds of D k are updated at line 13. Note that all conditions of the input specification of Update hold, because g is not nullified at α . To show

∪ {(oi, p )}, P ∪ {(oi, g )}, ( D , . . . , D )), returned at line 14, is a OneCell data structure conthat ( P prj n 1 dln taining α we need to show that all conditions of Definition 6 hold. Condition 1 holds because of the input specification and the correctness of RefNull. Conditions 2–6 are ensured by the specification of Update. Conditions 7 and 8 hold because S ( D 1 , . . . , D k −1 ) = {(α1 , . . . , αk−1 )}, and S ( D 1 , . . . , D k ) is a point or an interval in (α1 , . . . , αk−1 ) × R. Condition 9 holds because Update constructs a maximal

∪ P ∪ {(oi, g )} are tag-invariant. The fact that g is a desubregion of (α1 , . . . , αk−1 ) × R, where P prj dln

∪ P ∪ {(oi, g ), (oi, p )} are tag-invariant in S ( D , . . . , D ) lineating polynomial for p implies that P prj 1 k dln

, is a delineating polynomial for p on as well. Condition 10 holds because g, which is added to P dln (α1 , . . . , αk−1 ). This completes the proof. 2

Lemma 8. Let k ≥ 2. Assume that Merge (Algorithm 2) meets its specification for polynomials of levels smaller than k. MergeRoot (Algorithm 5) meets its specification for polynomials of level k. Proof. Observe that the algorithm at first chooses which polynomials should be put into F at lines 1–8. After this, at lines 9–13, all polynomials from F are merged into the input data structure. We first analyze the case when a FAIL message is returned during this merging process.

, P , ( D , . . . , D ))) at line 11 returned (FAIL, g , Assume that the call Merge(α , (t , f ), ( P prj n 1 dln

( D

1 , . . . , D

j −1 )). Here (t , f ) is a tagged non-constant irreducible factor of some polynomial from F . The correctness of Merge for polynomials of level smaller than k guarantees that g is an irreducible integer polynomial of level j for some j ≤ k − 1, g is nullified over the positive-dimensional re ∪ { f }). To prove that this FAIL message gion S ( D

1 , . . . , D

j −1 )  (α1 , . . . , α j −1 ), and g ∈ proj∗ ( P prj meets the specification of MergeRoot, we need to show that g ∈ proj∗ ( P prj ∪ { p }). The inclusion bpoly( D k ) ⊆ P prj implies that F ⊆ proj( P prj ∪ { p }) holds after line 8. Therefore, by induction and

⊆ proj∗ ( P Lemma 4 it follows that the inclusion P prj prj ∪ { p }) at line 14 holds. Using Lemma 4 again ∗ yields g ∈ proj ( P prj ∪{ p }). This proves that a FAIL message returned at line 12 meets the specification. In the following we assume that the loop at lines 10–13 does not return FAIL. Induction with

⊆ P Lemma 4 ensure that after the successful execution of the loop, i.e., after line 13, P prj prj ∪ { p } holds. We continue by distinguishing two cases, namely when D k is a section, and when it is a sector. First we assume that D k is a section. If t = si, then F = {(oi, resxk ( p , D k .e ))}. After merging F into

∪ {(si, p )}, P , ( D , . . . , D )) is returned. ( P prj , P dln , ( D 1 , . . . , D n )), the OneCell data structure ( P prj n 1 dln

Lemma 1 ensures that p is sign-invariant in S ( D 1 , . . . , D k ). Together with the correctness of Merge

∪ {(si, p )}, P , ( D , . . . , D )) returned for polynomials of level smaller than k, this implies that ( P prj n 1 dln at line 20 is a OneCell data structure with properties as specified. If t = oi, and D k is a section, then F = {discxk ( p ), resxk ( p , D k .e )}. Polynomials p and D k .e are merged into the data structure. After merging F into ( P prj , P dln , ( D 1 , . . . , D n )), the cell is refined

⊆ P (line 15), so that p is not nullified over the whole cell S ( D 1 , . . . , D k −1 ). Recall that P prj prj ∪ { p } holds before the call to RefNull at line 15. Therefore, in case this call to RefNull returns (FAIL, g , ( D

1 , . . . , D

j −1 )), Lemma 4 guarantees that g ∈ P prj ∪ { p }. Together with the correctness of RefNull, guaranteed by Lemma 6, this shows that the fail message meets the specification. Now assume that the call at line 15 successfully refines the data structure. Lemma 1 ensures that p is order ⊆ P invariant in section D k . Lemma 4 and the correctness of RefNull assures us that P prj prj ∪ { p }.

⊆ P Conditions of Definition 6 and P prj prj ∪ { p } follow from the correctness of RefNull as well.

The call to Update at line 18 does not change D k because D k is a section. These facts prove that

32

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

∪ {(oi, p )}, P , ( D , . . . , D )) returned at line 19 meets the specification for the case when D ( P prj k n 1 dln is a section, and t = oi. Let us consider the case when D k is a sector. Polynomials from F ⊆ proj( P prj ∪ { p }) are merged

into the data structure at lines 10–13. Refinement of the resulting data structure is done afterwards (lines 15–17). The same arguments as above prove that in case the call at line 15 fails, the returned fail message meets the specification. Therefore, we assume that this call is successful, and

, P , ( D , . . . , D )) is updated at line 17. In this case P ⊆ P ( P prj prj ∪ { p } follows by Lemma 4. Acn 1 prj dln

cording to the specification of RefNonNull, p is nullified over no point of the cell S ( D 1 , . . . , D k −1 ). Therefore, Lemma 2 assures us that p, D k .l, and D k .u are delineable over S ( D 1 , . . . , D k −1 ). By condition 6 of Definition 6, root( D k .l, D k . L . j , xk ) < αk < root( D k .u , D k .U . j , xk ) is true at point α . Delineability of D k .l, D k .u, and p implies that these inequalities hold over the whole cell S ( D 1 , . . . , D k −1 ), so the p-section containing α lies strictly “between” the sections of D k .l and D k .u. By Lemma 2, p is order-invariant in this p-section. Moreover, D k .e = p after call to Update at line 18, because p (α1 , . . . , αk ) = 0. To complete the proof for the case when D k is a sector, we need to show that all conditions of

∪ {(oi, p )}, P , ( D , . . . , D )) returned at line 19. Validity of condition 1 folDefinition 6 hold for ( P prj n 1 dln lows from the correctness of Merge and RefNull for polynomials of level smaller than k. The call to Update at line 18 ensures that conditions 2 and 5 hold. Delineability of D k .e = p on S ( D 1 , . . . , D k −1 )

was shown above, proving condition 8. This implies that S ( D 1 , . . . , D k ) is a cylindrical subset of Rk , proving condition 7. Correctness of algorithm Merge, RefNull, and Update together with the de ∪ {(oi, p )} ∪ P . lineability of p imply tag-invariance of polynomials of levels at most k from P prj dln

Now we show that S ( D 1 , . . . , D k ) is the maximal connected region containing α in which

∪{(oi, p )} ∪ P of level at most k are tag-invariant. Assume for contradiction that there is a bigger P prj dln

connected region S ⊆ Rk , S ( D 1 , . . . , D k )  S with the given property. Let πk−1 denote the projection of a point in real n-dimensional space, where n ≥ k, onto (k − 1)-dimensional space. There are two cases to consider. First suppose πk−1 (a) ∈ / S ( D 1 , . . . , D k −1 ) for some point a ∈ S. Projection of a connected region in Rk onto Rk−1 is a connected region in Rk−1 . Therefore, k−1

is a connected region in R

πk−1 ( S )  S ( D 1 , . . . , D k −1 )

∪ P strictly containing (α1 , . . . , αk−1 ) where P prj of level at most dln

k − 1 are tag-invariant. This is a contradiction with the maximality of S ( D 1 , . . . , D k −1 ). Recall that the maximality of S ( D 1 , . . . , D k −1 ) with the mentioned properties follows from the correctness of Merge and RefNull. The second case to consider is πk−1 (a) ∈ S ( D 1 , . . . , D k −1 ) for all points a ∈ S. Since p is delineable over S ( D 1 , . . . , D k −1 ) and tag-invariant in S, S can contain only points from p-sections over S ( D 1 , . . . , D k −1 ). The whole p-section defined by F ( D 1 , . . . , D k −1 ) ∧ root( p , D k . E .i , xk ) containing α is in S because S ( D 1 , . . . , D k )  S. This fact together with the assumption that πk−1 (a) ∈ S ( D 1 , . . . , D k −1 ) for all points a ∈ S implies that there are two distinct points (a1 , . . . , ak−1 , z) ∈ S and (a1 , . . . , ak−1 , z ) ∈ S, where z = z , which are zeroes of p. Finally, existence of points in S from two different p-sections contradicts the connectedness of S. This proves that there is no bigger connected

∪ {(oi, p )} ∪ P are tag-invariant. This proves condition 9 of region in Rk containing α in which P prj dln Definition 6.

. This Finally, condition 10 holds because no delineating polynomial of level k was added to P prj concludes the proof of correctness for the case when D k is a sector and the proof of the whole lemma. 2 Lemma 9. Let k ≥ 2. Assume that Merge (Algorithm 2) meets its specification for polynomials of levels smaller than k. Then MergeNotRoot (Algorithm 6) meets its specification for polynomials of level k. Proof. The schema of Algorithm 6 is the same as of Algorithm 5: At lines 1–7 it is decided, which polynomials should be added to F . At lines 9–12, polynomials in F are recursively merged into the input data structure. Finally, lines 13–17 do refinement of S ( D 1 , . . . , D k −1 ) and update of D k . Note that a FAIL message can be returned only when merging of some polynomial at line 10 or cell refinement at line 14 returns a FAIL message. Proof that these FAIL messages meet the specification can be

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

33

done in exactly the same way as in Lemma 8. In the following we therefore assume that all calls to Merge and RefNull succeed and no FAIL message is returned by the algorithm. As in the proof of Lemma 8, we analyze all possible cases. Assume that D k is a section. In this case F = {(oi, resxk ( p , D k .e ))} is merged into ( P prj , P dln ,

, P , ( D , . . . , D )) containing α . Lemma 1 guarantees that p is sign( D 1 , . . . , D n )), obtaining ( P prj n 1 dln

invariant in S ( D 1 , . . . , D k ). The sign of p in the whole section is non-zero because p (α1 , . . . , αk ) = 0, and (α1 , . . . , αk ) ∈ S ( D 1 , . . . , D k ). This means that p is actually order-invariant in S ( D 1 , . . . , D k ). Therefore, after successful merge of (oi, resxk ( p , D k .e )) at lines 9–12, no bound adjustments of D k

∪ {(oi, p )}, P , ( D , . . . , D )) is returned at line 18. are needed and the OneCell data structure ( P prj n 1 dln The correctness of Merge for polynomials of level smaller than k ensures that all conditions of Definition 6 hold for this data structure. Let D k be a sector. There are two cases to consider. First, suppose that (si, ldcfxk ( p )) was added to F at line 5. Recall that we assume that RefNonNull at line 14 does not return a FAIL mes , P , ( D , . . . , D )) be a OneCell data structure returned at line 16: It holds that p is sage. Let ( P prj n 1 dln

identically zero over no point in S ( D 1 , . . . , D k −1 ), and { D k .l, D k .u } are delineable on S ( D 1 , . . . , D k −1 ). The polynomials in F are tag-invariant in S ( D 1 , . . . , D k −1 ), because they were successfully merged into ( P prj , P dln , ( D 1 , . . . , D n )) at lines 9–12. Lemma 2 ensures that { D k .l, D k .u , p } are delineable on S ( D 1 , . . . , D k −1 ).

∪ {(oi, p )}, P , ( D , . . . , D )) returned at line 18 is a valid OneCell data Now we prove that ( P prj n 1 dln structure containing point α . Condition 1 of Definition 6 follows from the correctness of Merge, and RefNonNull for polynomials of level smaller than k. D k is a sector because we assume that D k is a sector, and p (α1 , . . . , αk ) = 0. Conditions 3, 4, and 6 of Definition 6 hold because Update is correct. Condition 7 holds because S ( D 1 , . . . , D k ) is a sector over S ( D 1 , . . . , D k −1 ), which is a cylindrical algebraic subset of Rk−1 . Therefore, S ( D 1 , . . . , D k ) is an open cylindrical subset of Rk containing α . Condition 8 follows from the fact shown above: D k .l, D k .u, and p are delineable on S ( D 1 , . . . , D k −1 ).

∪ {(oi, p )} ∪ P To show that P prj are tag-invariant in S ( D 1 , . . . , D k ) it suffices to show that p is dln

order-invariant in this cell. Recall that α is not a root of p, which is delineable on S ( D 1 , . . . , D k −1 ). This together with condition 6 implies that p is sign-invariant in S ( D 1 , . . . , D k ) with a non-zero sign. Therefore, p is order invariant in S ( D 1 , . . . , D k ) as well. To complete the proof for the case when ldcfxk ( p ) was included in F , we show that S ( D 1 , . . . , D k ) is the maximal connected region with the properties of condition 9 of Definition 6. Since we have shown that S ( D 1 , . . . , D k ) is an open cylindrical subset of Rk , it suffices to show that if a sequence of points in S ( D 1 , . . . , D k ) converges to a point γ ∈ / S ( D 1 , . . . , D k ), then some polynomial

from P prj ∪ {oi, p } of level at most k has different order (or sign, depending on the tag) at γ . Sup-

pose there is an infinite sequence {γi }∞ of points in S ( D 1 , . . . , D k ) that converges to point γ not i =1 in S ( D 1 , . . . , D k ). Let πk−1 denote the projection of a point in real n-dimensional space, where n ≥ k, onto (k − 1)-dimensional space. There are two cases. First, suppose πk−1 (γ ) ∈ / S ( D 1 , . . . , D k −1 ). Since ∞

{πk−1 (γi )}i =1 converges to πk−1 (γ ), the maximality of S ( D 1 , . . . , D k−1 ) implies that at least one of

of level at most k − 1 has different order (or sign) at π P prj k−1 (γ ). This contradicts the maximality of S ( D 1 , . . . , D k −1 ). The second case is implies that





πk−1 (γ ) ∈ S ( D 1 , . . . , D k −1 ). In this case, γ ∈/ S ( D 1 , . . . , D k )



root D k .l, D k . L . j , xk < xk < root D k .u , D k .U . j , xk



(1)

fails to hold at γ . Since (1) holds for all points in sequence {γi }∞ , this implies that either D k .l i =1

or D k .u is zero at γ . This is a contradiction because the signs of D k .l and D k .u are non-zero in S ( D , . . . , D ). This completes the proof of condition 9 of Definition 6. Condition 10 holds because 1

k

. This concludes the proof for the case when no delineating polynomials of level k were added to P dln ldcfxk ( p ) was added to F . The second case to consider is when ldcfxk ( p ) was not added to F . This occurs when S ( D 1 , . . . , D k ) is bounded in xk and no root of p (α1 , . . . , αk−1 , xk ) lies in the closed interval [val( D k . L ), val( D k .U )].

, P , ( D , . . . , D )) returned by Update at line 17. Since Consider the OneCell data structure ( P prj n 1 dln every real root of p (α1 , . . . , αk−1 , xk ) is either strictly bigger than val( D k .U ) or strictly smaller than

34

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

val( D k . L ), the call to Update at line 17 will not change the bounding polynomials in this case. Thus, p ∈ / bpoly( D k ). In the following we will show that p has a non-zero sign in S ( D 1 , . . . , D k ). This together with the correctness of Merge and RefNonNull will imply that the OneCell data structure returned at line 18 meets all the requirements specified. The polynomials D k .l and D k .u are delineable over S ( D 1 , . . . , D k −1 ) ⊆ S ( D 1 , . . . , D k−1 ). Since resxk ( p , D k .l) and resxk ( p , D k .u ) are order-invariant in S ( D 1 , . . . , D k −1 ), Lemma 1 assures us that p is sign-invariant in every section of D k .l and D k .u over S ( D 1 , . . . , D k −1 ). Consider the D k .l-section containing the point (α1 , . . . , αk−1 , val( D k . L )) and the D k .u-section containing the point (α1 , . . . , αk−1 , val( D k .U )). Sign-invariance of p in both of these sections, together with the fact that there is no root of p (α1 , . . . , αk−1 , xk ) in [val( D k . L ), val( D k .U )] imply that the sign of p is non-zero in both of these sections. In the following we refer to these sections as the “lower” and the “upper” section, respectively. Consider a decomposition of S ( D 1 , . . . , D k −1 ) = R 1 · · · R m , such that R i is a maximal connected region where ldcfxk ( p ) is sign-invariant for 1 ≤ i ≤ m. By Lemma 2, D k .l, D k .u, and p are delineable over R i , where 1 ≤ i ≤ m. To show that p is non-zero in the whole S ( D 1 , . . . , D k ), we have to show that for every i, where 1 ≤ i ≤ m, there is no p-section lying strictly between the parts of the lower and the upper section over R i . If m = 1, then D k .l, D k .u, and p are delineable over the whole R 1 = S ( D 1 , . . . , D k −1 ). The fact that p (α1 , . . . , αk−1 , xk ) has no root in [val( D k . L ), val( D k .U )] then implies that there is no root of p in S ( D 1 , . . . , D k ). Let m > 1 and assume for contradiction that there is a root of p in S ( D 1 , . . . , D k ). Let, without loss of generality, (α1 , . . . , αk−1 ) ∈ R 1 , and consider a p-section over R 2 lying strictly between the upper and the lower section. Pick a point a from this p-section and consider the maximal connected region T ⊆ S ( D 1 , . . . , D k −1 ) × R containing a such that p is order-invariant in T . The sign of p in T is zero because p (a) = 0. The lower and the upper section bound T in variable xk from below and above, respectively. The reasons for this are: T is connected, the sign of p is zero in T , and the sign of p is non-zero in the lower and the upper section. Since discxk ( p ) = 0 is order-invariant in S ( D 1 , . . . , D k −1 ), and p vanishes identically at no point in S ( D 1 , . . . , D k −1 ), Theorem 5.1 in Brown (2001) assures us that πk−1 ( T ) = S ( D 1 , . . . , D k −1 ). On the other hand, (α1 , . . . , αk−1 ) ∈/ πk−1 ( T ), because there is no root of p (α1 , . . . , αk−1 , xk ) in [val( D k . L ), val( D k .U )]. This obvious contradiction concludes the proof of the fact that the sign of p is non-zero in the whole S ( D 1 , . . . , D k ). Therefore, the algorithm is correct for the case when ldcfxk ( p ) ∈ / F as well. 2 Now we are ready to prove the correctness of Merge. Theorem 1. Merge (Algorithm 2) meets its specification. Proof. Let P denote P prj ∪ P dln , and D denote D 1 , . . . , D n . Line 1 of Merge checks whether p is already tag-invariant in S ( D ). Note that order-invariance implies sign-invariance, therefore the returned ( P prj , P dln , D ) at line 2 meets the specification. In the following it is assumed that p ∈ / P or (si, p ) ∈ P , and t = oi. If dim( D 1 , . . . , D k ) = 0, then S ( D 1 , . . . , D k ) consists of the single point (α1 , . . . , αk ). Therefore, p is trivially order invariant in S ( D 1 , . . . , D k ), and a correct data structure is returned at line 4. Otherwise, we proceed by induction on the level k of polynomial p. Let k = 1. The bounds of D 1 are updated at line 6. Let us prove that all conditions of Definition 6 hold for ( P prj ∪ {(oi, p )}, P dln , ( D 1 , D 2 , . . . , D n )) returned at line 7: Conditions 1 and 8 hold, because k = 1. Conditions 2–6, 7, and 9 are guaranteed to hold by the specification of Update. Condition 10 holds because no delineating polynomial was added to P dln . Let k > 1, and assume that Merge is correct for polynomials of level smaller than k. If p (α1 , . . . , αk−1 , xk ) = 0, Lemma 7 guarantees that the output of MergeNull returned at line 9 meets the specification. Let us assume that p (α1 , . . . , αk−1 , xk ) = 0. Now there are two cases to consider, depending on the dimension of S ( D 1 , . . . , D k−1 ). If S ( D 1 , . . . , D k−1 ) consists of the single point (α1 , . . . , αk−1 ), the correctness of Update guarantees that the data structure returned at line 12 meets the specification. Suppose dim( S ( D 1 , . . . , D k−1 )) > 0. In this case bpoly( D k ) ⊆ P prj , because if there was a bounding polynomial of level k in P dln , condition 10 of Definition 6 would imply

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

35

Algorithm 9: OneCell construction (Construct). α, Q α = (α1 , . . . , αn ) ∈ Rn , and αi is a RealAlgNum for every 1 ≤ i ≤ n.

Input:

Q = {q1 , . . . , qm } ⊆ Z[x1 , . . . , xn ]. Output: ( P prj , P dln , ( D 1 , . . . , D n )) ( P prj , P dln , ( D 1 , . . . , D n )) is a OneCell data structure containing α , such that {(si, q1 ), . . . , (si, qm )} ⊆ P prj ⊆ proj∗ ( Q ). OR (FAIL, f , ( D 1 , . . . , D j −1 )) In this case the following hold: 1. f is an irreducible integer polynomial of level j, for some j ≤ n. 2. f ∈ proj∗ ( Q ). 3. (α1 , . . . , α j −1 ) ∈ S ( D 1 , . . . , D j −1 ), and f is nullified over every point of positive-dimensional region S ( D 1 , . . . , D j −1 ). 1 l := −∞; L := (−∞, [0, 0], 1) 2 u := +∞; U := (+∞, [0, 0], 1) 3 for i := 1 to n do 4 D i := (sector , l, L , u , U ) 5 P prj := ∅; P dln := ∅ 6 for i := 1 to m do 7 R := Merge(α , (si, qi ), ( P prj , P dln , ( D 1 , . . . , D n ))) 8 if R is a FAIL message then 9 return R 10

( P prj , P dln , ( D 1 , . . . , D n )) := R

11 return ( P prj , P dln , ( D 1 , . . . , D n ))

dim( S ( D 1 , . . . , D k−1 )) = 0. If p (α1 , . . . , αk ) = 0, Lemma 8 ensures the correctness of the data structure returned at line 14. Finally, if p (α1 , . . . , αk ) = 0, Lemma 9 ensures the correctness of the data structure returned at line 16. This concludes the correctness proof of Merge. 2 9. The OneCell construction algorithm The Construct algorithm presented in this section constructs a single CAD cell containing α , such that the input polynomials {q1 , . . . , qm } are sign-invariant in the cell. The algorithm begins with an empty OneCell data structure, and incrementally refines it by merging polynomials {q1 , . . . , qm } one after another into this initial empty data structure. Therefore, the correctness proof of Construct relies on the correctness of Merge. Theorem 2. Construct (Algorithm 9) meets its specification. Proof. Lines 1–5 initialize an empty OneCell data structure containing no polynomials. Such data structure represents the cell Rn . All conditions of Definition 6 hold for this data structure: Conditions 1, 3, 4, and 6 hold because D i .l = −∞, D i .u = +∞, and −∞ < αi < +∞ is true for every 1 ≤ i ≤ n. Condition 7 holds because S ( D 1 , . . . , D i ) = Ri for every 1 ≤ i ≤ n. The fact that P prj = P dln = ∅ implies conditions 8–10. At lines 6–10 all polynomials from Q are merged into the data structure. There are two cases to consider. First assume that no call to Merge at line 7 returns a FAIL message. We prove by induction on m that the data structure returned at line 11 meets the specification. Let m = 1. After merging (si, q1 ) into the empty data structure, the specification of Merge ensures that (si, q1 ) ∈ P prj ⊆ proj∗ (q1 ). Assume m > 1. Let ( P prj , P dln , ( D 1 , . . . , D n )) denote the input data

, P , ( D , . . . , D )) denote the structure, which is an argument of the call to Merge at line 7. Let ( P prj n 1 dln

data structure returned by Merge and assume {(si, q1 ), . . . , (si, qm−1 )} ⊆ P prj ⊆ proj∗ ({q1 , . . . , qm−1 }).

⊆ proj∗ ({q , The specification of Merge and Lemma 4 ensure that {(si, q1 ), . . . , (si, qm )} ⊆ P prj 1 . . . , qm }). This concludes the proof for the non-failing case. Assume that the k-th call to Merge at line 7 fails on input α , (si, qk ), and ( P prj , P dln , ( D 1 , . . . , D n )). Let (FAIL, f , ( D 1 , . . . , D j −1 )) be the returned FAIL message. Induction and Lemma 4 assure us that

36

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

P prj ⊆ proj∗ ({q1 , . . . , qk−1 }). Using again the specification of Merge together with Lemma 4, we obtain that f ∈ proj({q1 , . . . , qk }), and that the properties 1–3 of the specification of Construct hold. 2 The following two corollaries relate the possible outcomes of Construct to the outcome of McCell on the same input. Corollary 1 states that when both algorithms successfully compute a cell, then the cell computed by Construct contains the cell computed by McCell. Corollary 2 deals with the situation when Construct fails, and McCell computes a cell. In this case there exists a point β arbitrarily close to the input point α , such that McCell fails to construct a cell containing β . The reason for this is that a projection polynomial f returned by Construct in its FAIL message is nullified over a positive-dimensional region containing β . Corollary 1. Let Q ⊆ Z[x1 , . . . , xn ] be a finite set of polynomials. Let α = (α1 , . . . , αn ) ∈ Rn be such that αi is a RealAlgNum for every 1 ≤ i ≤ n. Let C be a cell returned by McCell(α , Q ). Let ( P prj , P dln , ( D 1 , . . . , D n )) be a OneCell data structure returned by Construct(α , Q ). Then C ⊆ S ( D 1 , . . . , D n ). Proof. First we prove that P prj ∪ P dln are tag-invariant in C . Let f ∈ P prj . The specification of Construct guarantees that f ∈ proj∗ ( Q ). Therefore, the specification of McCell ensures that f is order-invariant in C . The fact that order-invariance implies sign-invariance proves the tag-invariance of f in C . Let f ∈ P dln be a polynomial of level k. Then there exists k-th level polynomial g ∈ P prj such that f is a delineating polynomial for g on (α1 , . . . , αk−1 ). This means that g is nullified on (α1 , . . . , αk−1 ), and C = S ( D 1 , . . . , D k−1 ) = {(α1 , . . . , αk−1 )}. Since McCell used a delineating polynomial for g during the lifting phase (line 14 of Algorithm 1), f is order-invariant in C . Let S be the maximal region containing α such that P pr j ∪ P dln are tag-invariant in S. Condition 9 of Definition 6 guarantees that S = S ( D 1 , . . . , D n ). Since C is a connected region containing α , the fact that all polynomials from P pr j ∪ P dln are tag-invariant in C shown above implies that C ⊆ S. 2 Corollary 2. Let Q ⊆ Z[x1 , . . . , xn ] be a finite set of polynomials. Let α = (α1 , . . . , αn ) ∈ Rn be such that αi is a RealAlgNum for every 1 ≤ i ≤ n. Let C be a cell returned by McCell(α , Q ). Let (FAIL, f , ( D 1 , . . . , D j −1 )) be a FAIL message returned by Construct(α , Q ). Then there exists a point β that is arbitrarily close to α such that McCell(β, Q ) returns (FAIL, g ), where g is a polynomial from proj∗ ( Q ). Proof. The Construct specification guarantees that j-th level polynomial f ∈ proj∗ ( Q ) is nullified over positive-dimensional cell S ( D 1 , . . . , D j −1 ) containing (α1 , . . . , α j −1 ). Since McCell(α , Q ) did not fail, it holds that C ∩R j −1 = {(α1 , . . . , α j −1 )}. Consider a CAD of R j −1 induced by Z[x1 , . . . , x j −1 ] ∩ proj∗ ( Q ). Observe that (α1 , . . . , α j −1 ) is a cell in this CAD because McCell constructed it as the maximal cell containing (α1 , . . . , α j −1 ) where polynomials proj∗ ( Q ) of level at most j − 1 are taginvariant. The properties of a cylindrical algebraic decomposition and the fact that S ( D 1 , . . . , D j −1 ) is a positive-dimensional region imply that there exists a cell C in this CAD with the following two properties: 1. ( S ( D 1 , . . . , D j −1 ) \ {(α1 , . . . , α j −1 )}) ∩ C is a positive-dimensional connected region. In the following we denote this region by R. 2. (α1 , . . . , α j −1 ) lies on the boundary of R. These properties ensure the existence of point (β1 , . . . , β j −1 ), which is arbitrarily close to (α1 , . . . , α j −1 ), and lies in R ⊆ S ( D 1 , . . . , D j −1 ). Since we considered a CAD of R j −1 induced by proj∗ ( Q ) ∩ Z[x1 , . . . , x j −1 ], and f is nullified over (β1 , . . . , β j −1 ) ∈ R ⊆ S ( D 1 , . . . , D j −1 ), it follows that the cell of this CAD containing (β1 , . . . , β j −1 ) is a positive-dimensional cell contained in S ( D 1 , . . . , D j −1 ). This means that McCell((β1 , . . . , β j −1 , α j , . . . , αn ), Q ) returns (FAIL, g ) for some g ∈ proj∗ ( Q ) of level at most j. Finally, observe that the point (β1 , . . . , β j −1 , α j , . . . , αn ) is arbitrarily close to α . 2

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

37

10. Examples of cell construction Illustrating the cell construction process completely through examples is impractical, since there are many cases that only come about as the dimension and, to a lesser extent, the degree and number of input polynomials gets large. These examples are then too big to trace through in written form. However, we provide in this section several smaller examples that at least illustrate many of the cases that can arise and clarify how the process of cell construction operates. In the following, we trace through three different calls to the algorithm Construct, each time with polynomial set Q = { p 1 , p 2 , p 3 }, where

p 1 = 2z + y + 2x − 2, p 2 = 3z − 3 y − 2x + 3, p 3 = z2 + y 2 + x2 − 1, but with different input points for α . The different input points are used to demonstrate different parts of the cell construction process: 1. The first point is generic, meaning that none of the original polynomials and none of the computed projection factors are zero at that point. This yields a full-dimensional cell. 2. The second point is one at which one of the original input polynomials, i.e., an element of Q , is zero. 3. In the third and last case we consider a point at which a projection factor, namely a resultant of two input polynomials is zero. For all three cases considered here, the “Open-McCallum” projection suffices for CAD construction. This follows from the Brown–McCallum’s projection because the three input polynomials are clearly not nullified anywhere, and all projection factors, except for the polynomials in Q , are of level at most two. Moreover, for all three points we are going to consider, Jovanovic´ and de Moura’s model-based projection yields the same polynomials—and thus produces the same cells—as the “Open-McCallum” projection. Note that we will work with polynomials from Z[x, y , z] using ordering of variables z  y  x. All data structures processed by Construct and its subalgorithms follow this, i.e., polynomials of level one are from Z[x] \ Z, polynomials of level two are from Z[x, y ] \ Z[x], and polynomials of level three are from Z[x, y , z] \ Z[x, y ]. Finally, recall that D i denotes either a sector or a section at level i. 10.1. The full-dimensional case with a generic α Here we trace through the call Construct(α , Q ), where α = (− 14 , 0, 32 ). This input point is generic, so the algorithm produces an open cell in three-dimensional space. Construct itself does very little: It first constructs an empty OneCell data structure ({}, {}, (−∞ < x < ∞, −∞ < y < ∞, −∞ < z < ∞)), and then calls Merge successively on each of the three elements of Q in order to refine the cell so that it contains α = (− 14 , 0, 32 ), and all three elements of Q have constant sign within it. The initial call is







−∞ < x < ∞ Merge α , (si, p 1 ), {}, {}, −∞ < y < ∞ −∞ < z < ∞



.

Now we trace through this Merge call in detail: (1) (si, p 1 ) ∈ / P pr j ∪ P dln = {}, so branch at line 1 is not taken. (2) dim( S ( D 1 , D 2 , D 3 )) = 3 = 0, so branch at line 3 is not taken. (3) k = 3 = 1, so branch at line 5 is not taken.

38

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

(4) p 1 (α1 , α2 , z) = p 1 (− 14 , 0, z) = 0, so branch at line 8 is not taken. (5) dim( S ( D 1 , D 2 )) = 2 = 0, so branch at line 10 is not taken. (6) Finally, since p 1 (− 14 , 0, 32 ) = 0, MergeNotRoot is called at line 16. We will not step through it, but MergeNotRoot eventually returns the following OneCell data structure:





 (oi, p 1 ) , {},



−∞ < x < ∞ −∞ < y < ∞ root( p 1 , 1, z) < z < ∞



.

Now we continue by merging the second polynomial p 2 ∈ Q into this data structure. This second call to Merge is





Merge α , (si, p 2 ),



 (oi, p 1 ) , {},



−∞ < x < ∞ −∞ < y < ∞ root( p 1 , 1, z) < z < ∞



.

Note that p 2 ( −41 , 0, 32 ) = 0. Doing a similar case analysis as above, we see that we reach line 16 of Merge. Now we trace through this call to MergeNotRoot at line 16 in detail: (1) D 3 is a sector, so go to line 4. Note that disc z ( p 2 ) = 1, so we do not need to add it to F . (2) Since D 3 .u = ∞, we should add (si, ldcfz ( p 2 )) to F at line 5. However, ldcfz ( p 2 ) = 1, so F is not changed. (3) At line 6, set F := F ∪ {(oi, r21 )}, where

r21 = resz ( p 2 , p 1 ) = 9 y + 10x − 12. (4) At line 10, call Merge(α , (oi, r21 ), ( P pr j , P dln , D 1 , D 2 , D 3 )) is executed. We do not step through this recursive call here. We only note that we obtain the following OneCell data structure:

R :=



−∞ < x < ∞  (oi, p 1 ), (oi, r21 ) , {}, −∞ < y < root(r21 , 1, y ) . root( p 1 , 1, z) < z < ∞

(5) Note that the call to RefNonNull at line 14 has no effect on R. This is so because at line 2 of RefNonNull, if p 2 —regarded as a polynomial in its highest-level variable z—has a constant coefficient, RefNonNull returns the cell it was passed unaltered. In this case, the leading coefficient of p 2 as a polynomial in z is 1, which is a constant. (6) Finally, the call D 3 := Update(α , p 2 , R ) at line 17 is done. Let us trace through this call in detail. Lines 3–4 isolate distinct real roots of p 2 (α1 , α2 , z) = p 2 (− 14 , 0, z) = 3z +

gle root B 1 =

− 76 .

7 , 2

yielding the sin-

Observe that the set satisfying the condition root( p 2 , 1, z) < z < ∞ at point

(x, y ) = (− 14 , 0) is ( 54 , ∞) = ( D 3 . L , D 3 .U ). On the other hand, α3 = 32 , so we have B 1 < D 3 . L < α3 < D 3 .U , which means the tests at lines 9 and 12 both fail. Therefore, Update at the end returns D 3 = D 3 = (root( p 2 , 1, z) < z < ∞) unchanged. To sum up, the result of merging p 2 is





−∞ < x < ∞  (oi, p 1 ), (oi, p 2 ), (oi, r21 ) , {}, −∞ < y < root(r21 , 1, y ) . root( p 1 , 1, z) < z < ∞

Now we merge the third and final polynomial p 3 to this OneCell data structure. This final top-level call to Merge is



Merge α , (si, p 3 ),





−∞ < x < ∞ (oi, p 1 ), . (oi, p 2 ), , {}, −∞ < y < root(r21 , 1, y ) (oi, r21 ) root( p 1 , 1, z) < z < ∞

Since p 3 (− 14 , 0, 32 ) = 0, call to MergeNotRoot occurs at line 16, which we are going to trace in detail.

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

39

(1) Line 4 of MergeNotRoot sets F := {(oi, d3 )}, where

d3 = discz ( p 3 ) = y 2 + x2 − 1. (2) Since D 3 .U = ∞, we should add (si, ldcfz ( p 3 )) to F at line 5. However, the leading coefficient of p 3 is 1. (3) Line 6 sets F := F ∪ {(oi, r31 )}, where

r31 = resz ( p 3 , p 1 ) = 5 y 2 + 4xy − 4 y + 8x2 − 8x. (4) The test at line 7 fails, so we proceed with the execution of the foreach loop at line 9. The first iteration carries out

R := Merge



α , (oi, d3 ),



(oi, p 1 ), −∞ < x < ∞ . (oi, p 2 ), , {}, −∞ < y < root(r21 , 1, y ) (oi, r21 ) root( p 1 , 1, z) < z < ∞

The result of this recursive call is:

R=

P prj , {},

where

 P prj =

root(x + 1, 1, x) < x < root(181x2 − 240x + 63, 1, x) root(d3 , 1, y ) < y < root(d3 , 2, y ) root( p 1 , 1, z) < z < ∞

,

 (oi, p 1 ), (oi, p 2 ), (oi, r21 ), (oi, d3 ), (oi, x + 1), . (oi, x − 1), (oi, 181x2 − 240x + 63)

(5) The second iteration of the foreach loop at line 9 leads to call



R := Merge



α , (oi, r31 ), R from the first iteration .

The result of this recursive call is:

R=

P prj , {},

where

 P prj =

root(x + 1, 1, x) < x < root(9x + 1, 1, x) root(d3 , 1, y ) < y < root(d3 , 2, y ) root( p 1 , 1, z) < z < ∞

,

 (oi, p 1 ), (oi, p 2 ), (oi, r21 ), (oi, d3 ), (oi, r31 ), (oi, x + 1), . 2 (oi, x − 1), (oi, 181x − 240x + 63), (oi, 9x + 1)

(6) The call to RefNonNull at line 14 has no effect because ldcf z ( p ) = 1. (7) The call to Update at line 17 has no effect because p has no roots in cell R. Finally, the resulting OneCell data structure obtained as the result of the third top-level call to

Merge is



P prj , {}, where

root(x + 1, 1, x) < x < root(9x + 1, 1, x) root(d3 , 1, y ) < y < root(d3 , 2, y ) root( p 1 , 1, z) < z < ∞

,



 (oi, p 1 ), (oi, p 2 ), (oi, p 3 ), (oi, r21 ), (oi, d3 ), (oi, r31 ), (oi, x + 1), P prj = . (oi, x − 1), (oi, 181x2 − 240x + 63), (oi, 9x + 1)

The difference between this cell and the cell, which McCell returns on the same input is illustrated in Fig. 4.

40

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

Fig. 4. The left-hand side shows the cell produced by both McCell(α , Q ) and by the model-based projection algorithm. The right-hand side shows the cell produced by Construct(α , Q ). In both cases the input point α is (− 14 , 0, 32 ).

10.2. The case when α is a zero of an input polynomial Here we trace through the call Construct(α , Q ), where α = (− 14 , 0, 54 ). This input point is a zero of the input polynomial p 1 , which means that the cell we get will have dimension less than three. We will also see that the algorithm can take advantage of the vanishing of this polynomial. Using this fact it will reduce the number of projection factors computed. The first call to Merge looks as follows:







−∞ < x < ∞ Merge α , (si, p 1 ), {}, {}, −∞ < y < ∞ −∞ < z < ∞



.

Since p 1 (− 14 , 0, 54 ) = 0, MergeRoot is called at line 14. Let us analyze this call. (1) The polynomial p 1 is linear in z, so the discriminant is 1. The leading coefficient is 1 as well. Thus, there is nothing to do until line 15. (2) The call to RefNonNull at line 14 does not change the data structure because ldcf z ( p 1 ) = 1. (3) At line 18, the call D 3 := Update(α , p 1 , ({}, {}, ( D 1 , D 2 , D 3 ))) is made. This call executes the following operations: (i) Lines 3 and 4 of Update compute p 1 (α1 , α2 , z) = p 1 (− 14 , 0, z) = 2z − 52 with the single root B 1 , val( B 1 ) = 54 .

(ii) At line 5 we have

α3 = val( B 1 ) = 54 , so we return (section, p 1 , B 1 ).

Therefore, the result of merging p 1 into an empty OneCell data structure is





 (oi, p 1 ) , {},



−∞ < x < ∞ −∞ < y < ∞ z = root( p 1 , 1, z)



We continue by merging the second polynomial, i.e., by calling





Merge α , (si, p 2 ),



 (oi, p 1 ) , {},



−∞ < x < ∞ −∞ < y < ∞ z = root( p 1 , 1, z)

.

Since p 2 (− 14 , 0, 54 ) = 0, we call MergeNotRoot at line 16. A detailed analysis of this call follows. (1) Since D 3 is a section, we set F := {r21 } at line 2, where

r21 = resz ( p 2 , p 1 ) = 9 y + 10x − 12. (2) Since | F | = 1, the single iteration of the foreach loop at line 9 calls



R := Merge



α , (oi, r21 ),



 (oi, p 1 ) , {},



−∞ < x < ∞ −∞ < y < ∞ z = root( p 1 , 1, z)

.

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

41

We do not trace through this recursive call. The result we obtain is



−∞ < x < ∞   (oi, p 1 ), (oi, r21 ) , {}, −∞ < y < root(r21 , 1, y ) R= . z = root( p 1 , 1, z) (3) Back in MergeNotRoot, D 3 is a section, so lines 13–17 are skipped. Therefore, an intermediate OneCell data structure after merging p 1 and p 2 is



−∞ < x < ∞  (oi, p 1 ), (oi, p 2 ), (oi, r21 ) , {}, −∞ < y < root(r21 , 1, y ) . z = root( p 1 , 1, z)



To merge p 3 into this data structure we call





Merge α , (si, p 3 ),



(oi, p 1 ), −∞ < x < ∞ . (oi, p 2 ), , {}, −∞ < y < root(r21 , 1, y ) z = root( p 1 , 1, z) (oi, r21 )

It holds that p 3 (− 14 , 0, 54 ) = 0, so we call MergeNotRoot at line 16. (1) Since D 3 is a section with p 1 as the bounding polynomial, we set F := {(oi, r31 )} at line 2. Here

r31 = resz ( p 3 , p 1 ) = 5 y 2 + 4xy − 4 y + 8x2 − 8x. (2) With | F | = 1, there is only one iteration of the foreach loop, which calls

R := Merge



α , (oi, r31 ),



(oi, p 1 ), −∞ < x < ∞ . (oi, p 2 ), , {}, −∞ < y < root(r21 , 1, y ) (oi, r21 ) z = root( p 1 , 1, z)

We do not trace through this recursive call here. The result of it is

R=



(oi, p 1 ), (oi, p 2 ), (oi, r21 ), −∞ < x < root(9x + 1, 1, x) . (oi, r31 ), (oi, 9x + 1), (oi, x − 1), , {}, −∞ < y < root(r21 , 1, y ) (oi, 197x2 − 264x + 22) z = root( p 1 , 1, z)

(3) Back in MergeNotRoot, D 3 is a section, so lines 13–17 are skipped. This leads to the final result, which is





−∞ < x < root(9x + 1, 1, x) (oi, p 1 ),(oi, p 2 ),(oi, p 3 ),(oi,r21 ), , {}, . (oi, r31 ),(oi,9x+1),(oi,x−1), −∞ < y < root(r21 , 1, y ) (oi, 197x2 − 264x + 22) z = root( p 1 , 1, z)

The difference between this cell and the cell, returned by McCell on the same input is illustrated in Fig. 5. It is worth noting that, compared to the computation for the generic point (− 14 , 0, 32 ) considered above, this cell was constructed without ever computing projection factors y 2 + x2 − 1 or x + 1. 10.3. The case when α is a zero of a resultant Here we trace through the call Construct(α , Q ), where α = (− 12 , 17 , 5 ). This input point is 9 4 a zero of 9 y + 10x − 12, which is the resultant of input polynomials p 2 and p 1 with respect to variable z. Once again, the dimension of the resulting cell will be less than three, and once again the algorithm takes advantage of the vanishing of this polynomial to reduce the number of projection factors computed.

42

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

Fig. 5. The left-hand side shows the cell produced by both McCell(α , Q ) and the model-based projection algorithm. The right-hand side shows the cell produced by Construct(α , Q ). In both cases the input point α = (− 14 , 0, 54 ).

We begin with







−∞ < x < ∞ Merge α , (si, p 1 ), {}, {}, −∞ < y < ∞ −∞ < z < ∞ It holds that p 1 (− 12 ,

17 5 , ) 9 4

.

= 0, so MergeNotRoot is called at line 16.

(1) The polynomial p 1 is linear in z, so the discriminant is 1. Furthermore, its leading coefficient is 1 as well. Thus, there is nothing to do until line 14. (2) The call to RefNonNull at line 14 changes nothing, since ldcf z ( p 1 ) = 1. (3) At line 17, the following call is made:







−∞ < x < ∞ D 3 := Update α , p 1 , {}, {}, −∞ < y < ∞ −∞ < z < ∞



.

(i) Lines 3 and 4 of this Update call compute p 1 (α1 , α2 , z) = p 1 (− 12 , single root B 1 , val( B 1 ) =

(ii) At line 5 we have

5 9

5 . 9

17 , z) 9



−∞ < x < ∞ (oi, p 1 ), {}, −∞ < y < ∞ root( p 1 , 1, z) < z < ∞

.

We continue with the second polynomial, i.e., with the call





Merge α , (si, p 2 ), We have p 2 (− 12 ,

17 5 , ) 9 4



 (oi, p 1 ) , {},



−∞ < x < ∞ −∞ < y < ∞ root( p 1 , 1, z) < z < ∞

.

= 0, so we call MergeNotRoot at line 16.

(1) Now D 3 is a sector, so lines 4–7 yield F := {(oi, r21 )}, where

r21 = resz ( p 2 , p 1 ) = 9 y + 10x − 12. Here note that ldcfz ( p 1 ) = discz ( p 1 ) = 1. (2) Since | F | = 1, the single iteration of the foreach loop at line 9 calls



R := Merge

10 9

with a

= val( B 1 ) < α3 = 54 , so we return the sector (root( p 1 , 1, z) < z < ∞).

Therefore, after merging the first polynomial we have



= 2z −



α , (oi, r21 ),



 (oi, p 1 ) , {},



−∞ < x < ∞ −∞ < y < ∞ z = root( p 1 , 1, z)

.

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

Since r21 (− 12 ,





17 5 , ) 9 4

43

= 0, this call results in MergeRoot, which yields

 (oi, p 1 ), (oi, r21 ) , {},



−∞ < x < ∞ y = root(r21 , 1, y ) root( p 1 , 1, z) < z < ∞



.

(3) Back in MergeNotRoot, the call to RefNonNull at line 14 has no effect because ldcf z ( p 2 ) = 1. (4) At line 17, Update is invoked. However, it has no effect, because the polynomials p 2 (− 12 , 17 , z ), 9 and p 1 (− 12 ,

17 , z) 9

have the same single root z = 59 .

Therefore, after merging p 2 we obtain the following OneCell data structure:





 (oi, p 1 ), (oi, p 2 ), (oi, r21 ) , {},



−∞ < x < ∞ y = root(r21 , 1, y ) root( p 1 , 1, z) < z < ∞



.

The third and final top-level call to Merge is





Merge α , (si, p 3 ), Since p 3 (− 12 ,

17 5 , ) 9 4



−∞ < x < ∞ (oi, p 1 ), . (oi, p 2 ), , {}, y = root(r21 , 1, y ) (oi, r21 ) root( p 1 , 1, z) < z < ∞

= 0, MergeNotRoot is called at line 16.

(1) Line 4 sets F := {(oi, d3 )}, where

d3 = x2 + y 2 − 1. The test at line 5 succeeds, but ldcf z ( p 3 ) = 1. (2) Line 6 sets F := F ∪ {(oi, r31 )}, where

r31 = resz ( p 3 , p 1 ) = 5 y 2 + 4xy − 4 y + 8x2 − 8x. The test at line 7 fails. (3) The first iteration of the foreach loop at line 9 invokes



R := Merge



α , (oi, d3 ),



−∞ < x < ∞ (oi, p 1 ), . (oi, p 2 ), , {}, y = root(r21 , 1, y ) (oi, r21 ) root( p 1 , 1, z) < z < ∞

We will not trace through this recursive call. The result of this the call is





−∞ < x < root(181x2 − 240x + 63, 1, x) R = P prj , {}, y = root(r21 , 1, y ) root( p 1 , 1, z) < z < ∞ where





 (oi, p 1 ), (oi, p 2 ), (oi, r21 ), P prj = . (oi, d3 ), (oi, 181x2 − 240x + 63)

(4) The second iteration of the foreach loop at line 9 leads to call



R := Merge



α , (oi, r31 ), R from the previous iteration .

The result of this recursive call is





−∞ < x < root(9x + 1, 1, x) R = P prj , {}, y = root(r21 , 1, y ) root( p 1 , 1, z) < z < ∞ where



,

 (oi, p 1 ), (oi, p 2 ), (oi, r21 ), (oi, r31 ), (oi, d3 ), P prj = . (oi, x − 1), (oi, 9x + 1), (oi, 181x2 − 240x + 63)

,

44

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

Fig. 6. The left-hand side shows the cell produced by both McCell(α , Q ) and by the model-based projection algorithm. The right-hand side shows the cell produced by Construct(α , Q ). In both cases the input point α is (− 12 , 17 , 5 ). 9 4

(5) The call to RefNonNull at line 14 has no effect because ldcf z ( p ) = 1. (6) The call to Update at line 17 has no effect, since p 3 has no roots in cell R. Therefore, the final result is





−∞ < x < root(9x + 1, 1, x) P prj , {}, y = root(r21 , 1, y ) root( p 1 , 1, z) < z < ∞

where

 P prj =

,

 (oi, p 1 ), (oi, p 2 ), (oi, p 3 ), (oi, r21 ), (oi, r31 ), (oi, d3 ), . (oi, 9x + 1), (oi, x − 1), (oi, 181x2 − 240x + 63)

The difference between this cell and the cell returned by McCell on the same input is illustrated in Fig. 6. 10.4. Two partial examples involving nullification The three examples from the previous subsections illustrate the complete process of cell construction from an input set of polynomials and a model point. One issue that does not arise in those computations is nullification. To illustrate how nullification is handled, we consider two more examples, which are calls to Merge rather than complete cell constructions from a non-trivial set of polynomials. In both examples we consider merging (oi, p ), where

p = yz + x2 into a cell consisting of the whole three-dimensional space. In the first example we will consider α = (1, 0, 12 ), which means that the leading coefficient of p vanishes at α , but p is not nullified at α . In the second example we will take

α = (0, 0, 12 ), which means that p is nullified at α .

10.4.1. Ensuring non-nullification In this example we merge polynomial (oi, p ) whose leading coefficient y vanishes at α = (1, 0, 12 ). Because of this, the intermediate cell defined by y = 0, has to be refined to ensure that p is not nullified in the resulting cell. Consider the call







−∞ < x < ∞ Merge α , (oi, p ), {}, {}, −∞ < y < ∞ −∞ < z < ∞

.

Since p (1, 0, 12 ) = 0, MergeNotRoot is called at line 16. (1) It holds that disc z ( p ) = ldcfz ( p ) = y. Therefore, F := {(oi, y )}.

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

45

(2) The one and only iteration of the foreach loop at line 9 calls







−∞ < x < ∞ R := Merge α , (oi, y ), {}, {}, −∞ < y < ∞ −∞ < z < ∞ The result of this call is





 (oi, y ) , {},



−∞ < x < ∞ y = root( y , 1, y ) −∞ < z < ∞

.

.

(3) Since D 3 is a sector, the call to RefNonNull at line 14 follows. (i) Each of the tests at lines 2–5 of RefNonNull fails. (ii) At line 7, q := x2 . (iii) The one and only iteration of the foreach loop at line 8 invokes



R := Merge



α , (si, x),



 (oi, y ) , {},



−∞ < x < ∞ y = root( y , 1, y ) −∞ < z < ∞

.

The result of this call is



root(x, 1, x) < x < ∞   . R := (oi, y ), (oi, x) , {}, y = root( y , 1, y ) −∞ < z < ∞

(4) Back to MergeNotRoot, the call to Update at line 17 has no effect, because the polynomial p (α1 , α2 , z) = p (1, 0, z) = 1 has no roots. Therefore, the final result of the top-level Merge call is







2

(oi, y ), (oi, x), oi, yz + x





, {},

root(x, 1, x) < x < ∞ y = root( y , 1, y ) −∞ < z < ∞

.

10.4.2. Dealing with nullification In this example, we merge (oi, p ), p = yz + x2 at point α = (0, 0, 12 ). In this case, p is nullified at α . Since we are requiring p to be order-invariant after merging, we need to deal with delineating polynomials. Consider the call







−∞ < x < ∞ Merge α , (oi, p ), {}, {}, −∞ < y < ∞ −∞ < z < ∞



.

Since p (0, 0, z) = 0, we call MergeNull at line 9. (1) At line 1 of MergeNull we call



R := RefNull





−∞ < x < ∞



α , p , {}, {}, −∞ < y < ∞

.

−∞ < z < ∞

(i) At line 3 of this RefNull call we set F := {(oi, y ), (oi, x2 )} because p = c 1 z + c 0 , where c 1 = y, and c 0 = x2 . Moreover, discz ( p ) = y. (ii) The foreach loop at line 3 merges (oi, y ) and (oi, x) into the data structure, resulting in





 (oi, y ), (oi, x) , {},



x = root(x, 1, x) y = root( y , 1, y ) −∞ < z < ∞



which is then the final result of the RefNull call.

,

46

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

Back in MergeNull, we have t = oi, so we continue with line 8. dim( S ( D 1 , D 2 )) = 0, so we skip line 9. At line 10, the first order partial derivatives of p are p x = 2x, p y = z, and p z = y. Since p y is the only partial derivative, which is not identically zero at (α1 , α2 ) = (0, 0), the set {d1 } = { z}. Therefore, at line 12 we have g = z2 . (6) The call to Update at line 13, namely

(2) (3) (4) (5)



D 3 := Update

α, g,



x = root(x, 1, x) y = root( y , 1, y ) −∞ < z < ∞



yields D 3 = (root( z, 1, z) < z < ∞). Therefore, the final result of the top-level call to Merge is in this case



     (oi, y ), (oi, x), oi, yz + x2 , oi, z2 ,



x = root(x, 1, x) y = root( y , 1, y ) root( z, 1, z) < z < ∞

.

11. Conclusions and future work In this paper we have introduced the OneCell data structure for representing a single cylindrical cell, and we have provided an algorithm for constructing a cell in this representation from an input point, which is to be contained within the cell, and an input set of polynomials, which are to have constant sign within the cell. This work generalizes the data structure and algorithm due to Brown (2013), which only produces open cells and requires a suitably generic input point. It provides an alternative to the “model-based” projection and cell construction algorithm described in Jovanovic´ and de Moura (2012). A careful analytical and empirical comparison of the two approaches is a subject for future work. However, we will make some remarks on the topic here. The problem of constructing a cell from a point and a set of polynomials was first considered, to the best of our knowledge, in Jovanovic´ and de Moura (2012), where it arises as a “conflict generalization” step that is applied repeatedly as part of their SAT solving-based algorithm for Tarski formulas. Their algorithm repeatedly generates points and sets of polynomials, each pair of which results in a cell. The process continues until a point satisfying the input Tarski formula is discovered, or the set of generated cells covers the whole Euclidean space. With this or some similar application in mind, we see that understanding the performance of an algorithm for constructing a cell requires considering not only the problem of constructing a single cell from a single point and polynomial set, but also the problem of repeatedly constructing cells until the underlying Euclidean space is covered. In terms of constructing a single cell as an isolated problem, the case of a “generic” point is relatively straightforward. For a sufficiently generic input point, the Construct algorithm from this paper is essentially the same as the OC-Construct algorithm from Brown (2013), which always produces a projection factor set that is a subset of the “Open-McCallum” projection — and usually a strict subset that is much smaller. The model-based projection, for a sufficiently generic point, is in fact identical to the “Open-McCallum” projection. So, for sufficiently generic points, Construct is definitely superior. For less generic points, the comparison becomes too complex to address here, and will be a subject for future study. Next consider the situation in which cells are repeatedly constructed, as in Jovanovic´ and de Moura’s SAT solving-based algorithm. We assume some original set of polynomials is fixed, call it P . The set of input polynomials for the first cell construction is a subset of P . Subsequent calls, however, are made with input polynomials chosen from amongst both the elements of P and the defining polynomials from previously constructed cells. Jovanovic´ and de Moura show that, for the model-based projection, the set of all projection factors computed across the many cell constructions is a subset of the closure of P under the Collins’ projection. An analogous analysis for the Construct algorithm introduced in this paper is somewhat complicated by the fact that we have two types of polynomials — projection factors and delineating polynomials. The important observation is that a delineating

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

47

polynomial added during the construction of cell C plays no role in the projection process. This is a result of the fact that a k-level delineating polynomial is only added during the construction of a cell whose (k − 1)-level base cell is zero-dimensional. In this case, it is easy to verify that Construct would not perform further projections of k-level polynomials. When applying Construct repeatedly in the situation described above, some care would have to be taken to recognize delineating polynomials in defining formulas, and ensure that a k-level delineating polynomial p (that is not also a regular projection polynomial) is never part of the input to a subsequent call to Construct unless the input point and remaining input polynomials will produce a cell whose (k − 1)-level base is zero-dimensional. Ensuring this simply amounts to some extra bookkeeping. If this is done, then we may say that the set of projection polynomials produced by repeated calls to Construct is a subset of the closure of P under the McCallum’s projection, and the set of delineating polynomials produced is a subset of the set of delineating polynomials produced by McCallum’s CAD construction algorithm given P as input. In both of the above cases, we have sketched results that give reason to think that the Construct algorithm in this paper may be superior to the model-based approach in many situations. However, a thorough analysis — both analytical and empirical — is called for, and is an obvious avenue for future investigations. An implementation of the algorithm, obviously a prerequisite for any empirical analysis, is a high priority for the authors in terms of future work on this topic. One downside to Construct is that it might return FAIL. This happens when a projection factor that comes about as a factor of a resultant or discriminant is nullified on a positive-dimensional region, i.e., the input polynomials are not well-oriented. Just as McCallum’s method may return FAIL in this case, so too does Construct, but Construct also provides an “explanation” for the FAIL, which consists of a j-level projection factor f and a positive-dimensional ( j − 1)-level cell D 1 , . . . , D j −1 . The explanation for the FAIL result is that polynomial f is nullified on the cell D 1 , . . . , D j −1 . No efficient fully algorithmic approach to recovering from a FAIL result when constructing a CAD using McCallum’s approach has been proposed. Essentially, one must start over using Collins’ or Hong’s projection operator, or perhaps work out some resolution by hand for that particular input. However, in the case of repeatedly constructing single cells, a FAIL is not so much of a problem. All prior cell constructions are still valid, so there is no lost work, and one could simply proceed with the model-based method using a new input formula formed as the conjunction of the original input with the defining formula for D 1 , . . . , D j −1 . Alternately, one could try to recover from a fail by pulling out the defining equations from D 1 , . . . , D j −1 , reducing the input polynomials by them, and restarting Construct on the new set. Investigating these and other possible ways of recovering from a FAIL is another avenue for future work. We close with a few parting observations. First is that there is strong reason to believe that, compared to the model-based approach, Construct will typically produce much larger cells, produce them much faster, and construct far fewer projection polynomials in the process. Naturally, analytical or empirical analysis will be needed in order to see if this is the case, but it is nice to have some reason to believe that the effort will be well-spent. Second, for those familiar with equational constraints, we note that not only does Construct use equational constraints, but the presence of the input point makes it trivial to deal with the otherwise difficult issue of “propagation” of constraints. In Construct and its sub-algorithms, the propagated constraints are those lower-level projection factors that are zero at the input point. Third, we reiterate that with Construct, unlike constructing a full CAD with McCallum’s method, a FAIL result is not catastrophic. Finally, we note that the method for choosing delineating polynomials in this paper is very crude, and that it would be interesting to examine that issue further. Acknowledgements The second author is supported by the German Transregional Collaborative Research Center SFB/TR 14 AVACS. This work arose out of discussions at the Schloss Dagstuhl Seminar 12462, Symbolic Methods for Chemical Reaction Networks, held in November 2012. We would like to thank the organizers of the event and Leibniz Zentrum für Informatik for a wonderful scientific program. Moreover, we thank

48

C.W. Brown, M. Košta / Journal of Symbolic Computation 70 (2015) 14–48

Thomas Sturm for supporting our collaboration in many different ways. Finally, we would like to thank Hoon Hong and Scott McCallum for providing us with their unpublished results. References Brown, C.W., 2001. Improved projection for cylindrical algebraic decomposition. J. Symb. Comput. 32, 447–465. Brown, C.W., 2013. Constructing a single open cell in a cylindrical algebraic decomposition. In: Proceedings of the 38th International Symposium on Symbolic and Algebraic Computation. ACM, New York, NY, USA, pp. 133–140. Collins, G.E., Hong, H., 1991. Partial cylindrical algebraic decomposition for quantifier elimination. J. Symb. Comput. 12, 299–328. Collins, G.E., Hong, H., 1998. Partial cylindrical algebraic decomposition for quantifier elimination. In: Caviness, B.F., Johnson, J.R. (Eds.), Quantifier Elimination and Cylindrical Algebraic Decomposition. In: Texts and Monographs in Symbolic Computation. Springer, Vienna, pp. 174–200. Hong, H., McCallum, S., in preparation. On Lazard’s projection and valuation in CAD construction. ´ D., de Moura, L., 2012. Solving non-linear arithmetic. In: Gramlich, B., Miller, D., Sattler, U. (Eds.), Automated ReasonJovanovic, ing. In: Lecture Notes in Computer Science, vol. 7364. Springer, Berlin, Heidelberg, pp. 339–354. McCallum, S., 1998. An improved projection operator for cylindrical algebraic decomposition. In: Caviness, B., Johnson, J. (Eds.), Quantifier Elimination and Cylindrical Algebraic Decomposition. Springer-Verlag, Vienna, pp. 242–268. McCallum, S., 1999. On projection in CAD-based quantifier elimination with equational constraint. In: Proceedings of the 1999 International Symposium on Symbolic and Algebraic Computation. ACM, New York, NY, USA, pp. 145–149. ´ Strzebonski, A., 2012. Solving polynomial systems over semialgebraic sets represented by cylindrical algebraic formulas. In: Proceedings of the 37th International Symposium on Symbolic and Algebraic Computation. ACM, New York, NY, USA, pp. 335–342.