Quanti er elimination for real algebra - the quadratic case ... - CiteSeerX

Report 8 Downloads 79 Views
Quanti er elimination for real algebra - the quadratic case and beyond Volker Weispfenning Lehrstuhl fur Mathematik, Universitat Passau, D-94030 Passau, Germany, e-mail: [email protected]

Abstract. We present a new, \elementary" quanti er elimination method for various

special cases of the general quanti er elimination problem for the rst{order theory of real numbers. These include the elimination of one existential quanti er 9x in front of quanti er{free formulas restricted by a non-trivial quadratic equation in x (the case considered also in [7]), and more generally in front of arbitrary quanti er{free formulas involving only polynomials that are quadratic in x. The method generalizes the linear quanti er elimination method by virtual substitution of test terms in [9]. It yields a quanti er elimination method for an arbitrary number of quanti ers in certain formulas involving only linear and quadratic occurences of the quanti ed variables. Moreover, for existential formulas ' of this kind it yields sample answers to the query represented by '. The method is implemented in reduce as part of the redlog package (see [4, 5]). Experiments show that the method is applicable to a range of benchmark examples, where it runs in most cases signi cantly faster than the qepcad package of Collins and Hong. An extension of the method to higher degree polynomials using Thom's lemma is sketched.

Keywords: Fast quanti er elimination and decision methods, rst{order theory of reals, automatic theorem proving.

1 Introduction Quanti er elimination for the rst{order theory of real numbers is a fascinating area of research at the intersection of various eld of mathematics and computer science, such as mathematical logic, commutative algebra and algebraic geometry, computer algebra, computational geometry and complexity theory. The rst quanti er elimination procedure for the elementary formal theory of real closed elds was found in the 1930's by A. Tarski, using an extension of Sturm's theorem of the 1830's for counting the number

2

V. Weispfenning

of real zeros of a univariate polynomial in a given interval. Since then an abundance of new decision and quanti er elimination methods for this theory with variations and optimizations has been published with the aim both of establishing the theoretical complexity of the problem and of nding methods that are of practical importance (see the discussion and references in [12, 1] for a comparsion of these methods). The high \practical complexity" of the general quanti er elimination problem for the reals stimulated research concerning more specialized procedures for subproblems given by input formulas of special forms. The case of input formulas in which all quanti ed variables occur only linearly has been handled in [13, 9]. Elimination of a single quanti ed variable that is restricted by a non-trivial quadratic equation has been treated in [7]. In both cases the specialized \elementary" methods perform signi cantly better than the general purpose method in [3, 6] in some test examples. Notice, however, that the theoretical worst-case complexity of the quanti er elimination problem for the linear case is \the same" as for the general case up to undetermined multiplicative constants (see [12, 13]). In the present note we explore an extension of the ideas in [9] from the linear to the quadratic case. In the linear case (i.e. the case, where all quanti ed variables occur only linearly in the input formula) theWelimination of a quanti er 9x' was achieved by replacing 9x' by a nite disjunction t2S '[t=x] ranging over certain test terms t that may formally involve improper expressions such as 1 or an \in nitesimal" . The substitution '[t=x] is however de ned in such a way that these improper expressions do not really occur in the resulting formula. We refer to this method as \virtual substitution" of t for x in '. In the following we extend this idea to various \quadratic cases". These include

 The case of a single quanti ed variable restricted by a non-trivial quadratic equa-

tion (treated in [7] by a di erent method).  The case of a single quanti ed variable occuring in the given input formula only at most quadratically (but not necessarily restricted by a quadratic equation).  The case of several quanti ed variables occuring in the given input formula at most quadratically certain restrictions that guarantee that the degrees of all quanti ed variables never exceed 2 during successive elimination steps. This includes the case, where that all but the outermost or second to outermost of the quanti ed variables occur at most linearly. If by polynomial factorization these degrees can be lowered to values of at most 2, the elimination method succeeds as well. The respective cases are considered in the following three sections. We prove upper worst-case complexity bounds that match the known bounds for the general real quanti er elimination problem (see [12, 1]). Moreover these bounds are independent of the number of free variables of the input formula; this is an inherent feature of the virtual substitution method. We note also that the method can be used as a partial quanti er

Quanti er elimination for real algebra - the quadratic case and beyond

3

elimination for input formulas, where only some of the innermost quanti ed variables are of the type described above. The substitutions of improper expressions occuring in the linear case are extended to improper expressions containing besides 1 and a positive in nitesimal  also squareroot symbols; moreover these virtual substitutions are performed in arbitrary polynomials, not just linear or quadratic ones. Moreover, in contrast to [9] we avoid the use of inverses containing variables altogether, instead of eliminating inverses after quanti er elimination. This has turned out to be less cumbersome in practice, since the resulting formulas are better prepared for automatic simpli cation. Algorithmically the virtual substitutions can be handled in a single preprocessing step for any given degree bound in the variable to be substituted. Section 5 presents examples computed in reduce using the redlog package of A. Dolzmann and T. Sturm (see [4, 5]). Where applicable comparative timings with the qepcad package are given. Our experiments include some well-known benchmark examples (compare [3, 6, 7, 8, 9, 10]), a fourth-degree example, and an example involving 5 generic quadratic polynomials and hence 15 free variables. For the latter type of input formula with many free variables elimination methods based on a cell decomposition of the whole variable space, such as the qepcad package of Collins-Hong, tend to perform badly. The last section explores the potential of the method for higher degree polynomials. The sketch given here has been worked out in detail for cubic polynomials in [15].

2 Substitution of square-root expressions in formulas An atomic formula is an expression of the form f (x ; : : : ; xn)  g(x ; : : : ; xn ), where f; g 2 Q[x ; : : : ; xn ] and  is one of the relations =; ; 2; D(') = 1 D('0)  2 for D( ) = 2; D(') = 1 at('0)  11 at(') + 4 The same estimates hold if the degree D of formulas is taken with respect to a xed arbitrary set of variables including x. p Proof. Let e = ?b?1 c or e = (2a)?1(?b  b2 ? 4ac); and de ne the degree of a square-root as half the degree of the radicand, the degree of a rational function as the maximum of the degree of numerator and denominator. Then for a polynomial g in '; D(g[e=x])  (k + 1)D(') ? 2k, and so D('0)  2((k + 1)D(') ? 2k) = 2(k + 1)D(') ? 4k: For the remaining cases one argues similarly. p From the fact that at('[?b?1 c=x]) = at(') and at('[2a?1 (?b  b2 ? 4ac)=x])  5 at('), we may conclude that at('0)  2 + at(') + 2 + 10 at(') = 4 + 11 at('):

3 Substitution of in nitesimal expressions Consider a formula 9x', where ' is quanti er-free and x occurs in ' only linearly or quadratically. Then an elimination of the quanti er 9x in this formula may be obtained by an extension of the technique in [9] from the linear to the quadratic case. The crucial step is to de ne a formal substitution of expressions of the form e +  for a variable x in a formula ', where  is a symbol for a positive in nitesimal, and e is a square-root expression. Semantically, such expressions are handled as follows: All variables in terms, formulas or square-root expressions are still considered to range over the eld R of real numbers. The symbol  is interpreted as a positive in nitesimal (i.e. 0 <  < R ) in some proper ordered extension eld R of R. The properties of  we are going to use are the following: Let 0 6= f (x) 2 R[x], 2 R. Then +

6

V. Weispfenning 1. f ( + ) 6= 0; 2. f ( ) 6= 0 ) f ( )  f ( + ) > 0 (i.e. f keeps its sign on an in nitesimal neighborhood of in R); 3. 0 = f ( ) = : : : = f k? ( ) 6= f k ( ) ) f k ( )  f ( + ) > 0 (i.e. the highest non-vanishing derivative of f with respect to x at determines the sign of f at a point in nitesimally to the right of in R). (

1)

( )

These properties are immediate from the Taylor-expansion of f at evaluated at the point +  in R. They guarantee that the following de nition of a formal substitution of an in nitesimal expression into a formula is semantically correct. Let e +  be an in nitesimal expression, i.e. e is a square-root expression and  is a symbol for a positive in nitesimal. Then the substitution '[e + =x] of e +  for the variable x in an atomic formula is de ned as follows: P Assume, to begin with, that ' is of the form f  0 with  2 f=; ; 0, then  (f ) : f < 0 _ (f = 0 ^  (f 0 )). Then we put: n ^ (f = 0)[e + =x] : ai = 0 =0

i=0

(f < 0)[e + =x] :  (f )[e=x] (f  0)[e + =x] : (f = 0)[e + =x] _ (f < 0)[e + =x] (f 6= 0)[e + =x] :

n _

i=0

ai 6= 0:

If ' is an arbitrary atomic formula of the form f  g then '[e + =x] is de ned by (f ? g  0)[e + =x]. Finally for an arbitrary formula ', the substitution '[e + =x] is obtained by performing the substitution [e + =x] in all atomic subformulas of '. Besides these substitutions, we also need the formal substitution of 1 for a variable x in a formula. Since the semantics of 1 is obvious (take e.g. 1 as some elements of R with ?1 < R < 1), the de nition is straightforward: For f as above, de ne the formula (f ) recursively with respect to n as follows: If n = 0, then (f ) : a < 0. P If n > 0, then (f ) : (?1)nan < 0 _ (an = 0 ^ ( in? aix)). 0

(f = 0)[?1=x] :

n ^

i=0

1 =0

ai = 0

Quanti er elimination for real algebra - the quadratic case and beyond

7

(f < 0)[?1=x] : (f ) (f  0)[?1=x] : (f < 0)[?1=x] _ (f = 0)[?1=x] (f 6= 0)[?1=x] :

n _ i=0

ai 6= 0:

For 1 in place of ?1 the de nitions are analogous. The extension of the substitution '[1=x] to arbitrary formulas is de ned similarly as before. Let now x be a variable and let ' be an ^?_-combination of atomic formulas such that x occurs in ' at most quadratically. Let f i : i 2 I g be the set of atomic subformulas of ' and let i be the relation occurring in i. Let I ; I ; I ; I be the set of those i 2 I such that i is the relation =; ; 0 ^ a  1=2 ^ b > 0 ^ r > 0 ^ r < 1) The resulting output formula contains 26 atomic subformulas. Time: 969 ms (qepcad: 7616 ms, with output formula containing 20 atomic subformulas). 2

2

2

2

2

2

2

2

5.3 The Davenport{Heintz{ Example For the origin of this example see [3]. The input formula is

' := 9c8b8a(a = d ^ b = c _ a = c ^ b = 1 =) a = b) This is a mixed quadratic{linear example, where the applicability of our method is not obvious; but after interchanging the quanti ers 8b and 8a the formula is of the type linear{quadratic{linear that was considered in section 4. The output formula is d 6= 0 ^ (d + 1 = 0 _ d ? 1 = 0) (The super ous occurence of d 6= 0 can be removed automatically by an application of the Grobner simpli er implemented in redlog.) Time: 102 ms (qepcad: 1733 ms, with the improved output formula). 2

Quanti er elimination for real algebra - the quadratic case and beyond

15

5.4 The X {axis ellipse problem For the origin of this example see [6]. The input formula is

' := 8x8x(b (x ? c) + a y ? a b = 0 =) x + y  1) 2

2

2

2

2 2

2

2

This is a problem with two quadratic variables, where the innermost variable has only purely quadratic occurences; so it ts into one of the types considered in section 4. The output formula contains 75 atomic subformulas. Time: 4063 ms (qepcad 4455333 ms, with output formula containing 14 atomic subformulas).

5.5 Example: 5 generic quadratic polynomials This example involves 2 quadratic equations and 3 quadratic inequalities all with indeterminate coecients. So the input formula has 15 free variables and one bound variable. We were unable to compute a quanti er{free formula for this example using the Collins{Hong package qepcad due to lack of memory. So the example shows the superiority of the present method in situations, where many free variables are present. The input formula is:

' := 9x(a x + b x + c = 0 ^ a x + b x + c = 0 ^ a x + b x + c < 0 ^ a x + b x + c < 0 ^ a x + b x + c < 0) 1

2

1

4

1

2

2

2

4

2

4

2

2

5

3

5

2

3

3

5

The output formula contains 408 atomic subformulas. Time: 107168 ms

5.6 Example: The Motzkin polynomial The polynomial f (x; y) = 1 + x y (x + y ? 3) found by L. Motzkin is an example of a positive semide nite polynomial on R that is not a sum of squares of real polynomials. The assertion 2

2

2

2

2

8x8y(1 + x y (x + y ? 3)  0) 2

2

2

2

that f is positive semide nite is veri ed by redlog via an implicit reduction of this formula (by remark 4 of section 3) to the formula

8x8y(x  0 ^ y  0 =) 1 + xy(x + y ? 3)  0);

16

V. Weispfenning

where quanti er elimination succeeds. Time (for the original input formula): 51 ms (qepcad: 483 ms) The following decision problems from [3] have been solved by the method via a complete quanti er elimination using the implicit factorization option described in remark 3 of section 3: The collision problem: Time: 85 ms (qepcad: 633 ms). Consistency in strict inequalities: Time: 340 ms, (qepcad: 993 ms) Termination of term rewrite system: Time: 2788 ms (qepcad: 934 ms) redlog has also been able to eliminate all quanti ers in the geometric examples 1. - 7.

of [10] in timings comparable or smaller than those quoted for the faster CSI-option on a DEC-station 5000/25 in [10].

6 Beyond Quadratic Polynomials Let us brie y analyze which features of quadratic polynomials with parametric coecients we have used in sections 2 and 3 for our quanti er elimination method: 1. The non-negativity of the discriminants provides an easy test for the existence of real roots. 2. The two real roots can be represented unambiguously by square-root expressions. 3. The sign of other polynomials with parametric coecients at a square-root expression can be evaluated without use of such an expression. Which of these properties can be lifted to arbitrary degree polynomials? Of course, representation of roots by surds is in general impossible. As far as a unique representation of real roots is concerned, there is, however, a perfect replacement by Thom's lemma (see [2]): Any real root of f (x) 2 R[x] is uniquely determined by the sign of the derivatives f 0( ); : : : ; f d? ( ), where d = deg(f (x)). Of course, not any combination of signs is consistent, since there are at most d reals roots. Similarly, the sign of a further polynomial g(x) 2 R[x] can be found by determining the unique one among the sign conditions g(x) > 0; g(x) = 0; g(x) < 0 that is consistent with f (x) = 0 and the signs of f i (x)( ) (1  i < d). So in order to extend our method to a general quanti er elimination procedure for the reals, one can proceed as follows: 1

( )

Quanti er elimination for real algebra - the quadratic case and beyond

17

Suppose one has already found a method to determine quanti er-free equivalents '0(f )d; and 0 (f; g)d; , respectively, for the following formulas '(f )d; and (f; g)d; :

'(f )d; : 9x(f (x) = 0 ^ (f; g)d; : 9x(f (x) = 0 ^

d^ ?1 i=1

d^ ?1 i=1

f i (x) i 0) ( )

f i (x) i 0 ^ g(x) d 0); ( )

where  2 f>; =; ; =; 0, let us call a set f ; : : : ; k g (1  k  d) of sign sequences of length (d ? 1) maximally consistent, if there exist real values of the coecients a ; : : : ; ad of f such that f has exactly k di erent real roots, say ; : : : ; k , satisfying the sign conditions  ; : : : ; k , (i.e. '(f )d; ; : : : ; '(f )d;k ), respectively. The number s(d) of maximally consistent sets of sign sequences is much less than one may expect a priori, e.g. = 16; s(4) = 32; whereas a theoretical upper bound for s(d) is Pd for ds?(2)k = 6; s(3) d = O(3 ): k 3 Suppose, we have for a given degree bound (by a suitable special purpose decision procedure) determined the set S (d) of sets of maximal consistent sign-sequences. Then a general quanti er elimination method based on the computation of S (d); 'd; and d; is obtained as follows: Consider w.l.o.g. an input formula 9x('), where ' is an ^{_{combination of the atomic formulas fi (x) i 0; (1  i  m), and fi are polynomials of formal degree d in x with parametric coecients and i 2 f=; 0: 1

0

0

1

0

1

1

=1

(

1)

1

2

(g = 0)[ i;=x] : 0 (f; g)d;f g (g < 0)[ i;=x] : 0 (fi; g)d;f